@anker-in/headless-ui 1.0.26-alpha.1762509077023 → 1.0.26-alpha.1762756639604

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 (67) hide show
  1. package/dist/cjs/biz-components/FeatureCards/FeatureCards.js +1 -1
  2. package/dist/cjs/biz-components/FeatureCards/FeatureCards.js.map +2 -2
  3. package/dist/cjs/biz-components/FeatureShowcase/FeatureShowcase.js +1 -1
  4. package/dist/cjs/biz-components/FeatureShowcase/FeatureShowcase.js.map +2 -2
  5. package/dist/cjs/biz-components/ImageTextFeature/ImageTextFeature.js +1 -1
  6. package/dist/cjs/biz-components/ImageTextFeature/ImageTextFeature.js.map +2 -2
  7. package/dist/cjs/biz-components/ImageWithText/ImageWithText.js +1 -1
  8. package/dist/cjs/biz-components/ImageWithText/ImageWithText.js.map +2 -2
  9. package/dist/cjs/biz-components/Ksp/index.js +1 -1
  10. package/dist/cjs/biz-components/Ksp/index.js.map +3 -3
  11. package/dist/cjs/biz-components/Listing/BizProductProvider.d.ts +2 -4
  12. package/dist/cjs/biz-components/Listing/BizProductProvider.js +1 -1
  13. package/dist/cjs/biz-components/Listing/BizProductProvider.js.map +3 -3
  14. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/BenefitsTab.js +4 -4
  15. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/BenefitsTab.js.map +3 -3
  16. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductBundle/index.js +1 -1
  17. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductBundle/index.js.map +2 -2
  18. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductExchangePurchase/index.js +1 -1
  19. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductExchangePurchase/index.js.map +2 -2
  20. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductFreeGift/index.js +1 -1
  21. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductFreeGift/index.js.map +2 -2
  22. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductSummary/index.js +1 -1
  23. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductSummary/index.js.map +3 -3
  24. package/dist/cjs/biz-components/Listing/components/PurchaseBar/ProductActions/index.js +1 -1
  25. package/dist/cjs/biz-components/Listing/components/PurchaseBar/ProductActions/index.js.map +3 -3
  26. package/dist/cjs/biz-components/Listing/index.js +1 -1
  27. package/dist/cjs/biz-components/Listing/index.js.map +3 -3
  28. package/dist/cjs/biz-components/ProductHero/ProductHero.js +1 -1
  29. package/dist/cjs/biz-components/ProductHero/ProductHero.js.map +2 -2
  30. package/dist/cjs/biz-components/TabWithImage/TabWithImage.js +1 -1
  31. package/dist/cjs/biz-components/TabWithImage/TabWithImage.js.map +2 -2
  32. package/dist/cjs/biz-components/VideoFeature/VideoFeature.js +1 -1
  33. package/dist/cjs/biz-components/VideoFeature/VideoFeature.js.map +2 -2
  34. package/dist/esm/biz-components/FeatureCards/FeatureCards.js +1 -1
  35. package/dist/esm/biz-components/FeatureCards/FeatureCards.js.map +2 -2
  36. package/dist/esm/biz-components/FeatureShowcase/FeatureShowcase.js +1 -1
  37. package/dist/esm/biz-components/FeatureShowcase/FeatureShowcase.js.map +2 -2
  38. package/dist/esm/biz-components/ImageTextFeature/ImageTextFeature.js +1 -1
  39. package/dist/esm/biz-components/ImageTextFeature/ImageTextFeature.js.map +2 -2
  40. package/dist/esm/biz-components/ImageWithText/ImageWithText.js +1 -1
  41. package/dist/esm/biz-components/ImageWithText/ImageWithText.js.map +2 -2
  42. package/dist/esm/biz-components/Ksp/index.js +1 -1
  43. package/dist/esm/biz-components/Ksp/index.js.map +3 -3
  44. package/dist/esm/biz-components/Listing/BizProductProvider.d.ts +2 -4
  45. package/dist/esm/biz-components/Listing/BizProductProvider.js +1 -1
  46. package/dist/esm/biz-components/Listing/BizProductProvider.js.map +3 -3
  47. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/BenefitsTab.js +4 -4
  48. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/BenefitsTab.js.map +3 -3
  49. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductBundle/index.js +1 -1
  50. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductBundle/index.js.map +2 -2
  51. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductExchangePurchase/index.js +1 -1
  52. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductExchangePurchase/index.js.map +2 -2
  53. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductFreeGift/index.js +1 -1
  54. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductFreeGift/index.js.map +2 -2
  55. package/dist/esm/biz-components/Listing/components/ProductCard/ProductSummary/index.js +1 -1
  56. package/dist/esm/biz-components/Listing/components/ProductCard/ProductSummary/index.js.map +3 -3
  57. package/dist/esm/biz-components/Listing/components/PurchaseBar/ProductActions/index.js +1 -1
  58. package/dist/esm/biz-components/Listing/components/PurchaseBar/ProductActions/index.js.map +3 -3
  59. package/dist/esm/biz-components/Listing/index.js +1 -1
  60. package/dist/esm/biz-components/Listing/index.js.map +3 -3
  61. package/dist/esm/biz-components/ProductHero/ProductHero.js +1 -1
  62. package/dist/esm/biz-components/ProductHero/ProductHero.js.map +2 -2
  63. package/dist/esm/biz-components/TabWithImage/TabWithImage.js +1 -1
  64. package/dist/esm/biz-components/TabWithImage/TabWithImage.js.map +2 -2
  65. package/dist/esm/biz-components/VideoFeature/VideoFeature.js +1 -1
  66. package/dist/esm/biz-components/VideoFeature/VideoFeature.js.map +2 -2
  67. package/package.json +1 -1
@@ -1,2 +1,2 @@
1
- "use strict";var M=Object.create;var E=Object.defineProperty;var W=Object.getOwnPropertyDescriptor;var q=Object.getOwnPropertyNames;var K=Object.getPrototypeOf,Q=Object.prototype.hasOwnProperty;var U=(n,t)=>{for(var o in t)E(n,o,{get:t[o],enumerable:!0})},G=(n,t,o,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of q(t))!Q.call(n,s)&&s!==o&&E(n,s,{get:()=>t[s],enumerable:!(i=W(t,s))||i.enumerable});return n};var X=(n,t,o)=>(o=n!=null?M(K(n)):{},G(t||!n||!n.__esModule?E(o,"default",{value:n,enumerable:!0}):o,n)),Y=n=>G(E({},"__esModule",{value:!0}),n);var te={};U(te,{default:()=>ee});module.exports=Y(te);var e=require("react/jsx-runtime"),a=require("../../../../../components"),k=require("../../../BizProductProvider"),g=require("react"),m=require("../../../utils"),P=require("../../../../AiuiProvider"),ie=require("../../../../../helpers"),B=X(require("decimal.js")),R=require("../../../utils/textFormat");const Z=({})=>{const{locale:n="us",copyWriting:t}=(0,P.useAiuiContext)(),{product:o,variant:i,finalPrice:s,comparePrice:u,coupon:b,selectedOptions:p,selectedVariants:r,totalSavings:h,onAddToCart:D,onBuyNow:z,savingDetail:N,checkedBundle:C,joinedRecommendBuyProducts:l,setJoinedRecommendBuyProducts:f,setCheckedGift:O,setCheckedExchangePurchase:x,setCheckedBundle:y,setSavingDetail:I,addToCartLoading:T,buyNowLoading:$}=(0,k.useBizProductContext)(),[w]=r,J=(0,g.useMemo)(()=>{const[d]=C?.variants||[],H=new B.default(w?.price?.amount||0).minus(d?.price||w?.price?.amount).toNumber();return new B.default(w?.price?.amount||0).minus(N?.coupon).minus(H).toNumber()},[w,h,C]);if(!i.availableForSale)return null;const{bundleVariant:A,giftVariant:F,exchangeVariant:j}=_()||{},[c,v]=(0,g.useState)();(0,g.useEffect)(()=>{v({bundle:l.bundle?.value?void 0:A,gift:l.gift?.value?void 0:F,exchange:l.exchange?.value?void 0:j})},[A,F,j,l]);const ne=(0,g.useMemo)(()=>new B.default(u).minus(N.freeGift).toNumber(),[u,N]);return(0,e.jsx)("div",{className:"ipc-product-summary laptop:px-16 desktop:px-0 mt-16 desktop:mt-[96px] lg-desktop:mt-[128px]",children:(0,e.jsx)("div",{className:"bg-[#F5F5F7] laptop:rounded-2xl",children:(0,e.jsxs)(a.Grid,{className:"px-4 pt-6 tablet:p-8 tablet:!pb-0",children:[(0,e.jsxs)(a.GridItem,{className:"col-span-12 laptop:col-start-1 laptop:col-span-5 gap-4 flex flex-col justify-between",children:[(0,e.jsx)(a.Heading,{className:"font-bold text-[24px] lg-desktop:text-[48px] laptop:text-[32px] desktop:text-[40px] leading-[1] mb-4 [&>span]:text-[#D1D1D1]",html:`${o.title} is ready <br/><span>Just the way you want it.</span>`}),(0,e.jsx)("div",{className:"",children:(0,e.jsx)(a.Picture,{source:i.image?.url||o?.images?.[0]?.url,className:"lg-desktop:aspect-[644/368] desktop:aspect-[503/272] laptop:aspect-[331/191] tablet:aspect-[704/380] aspect-[358/192]",imgClassName:"object-cover h-full"})})]}),(0,e.jsxs)(a.GridItem,{className:"col-span-12 mt-8 pb-6 tablet:pb-8 laptop:col-start-7 laptop:mt-0 laptop:col-span-6 flex flex-col gap-6 justify-between",children:[(0,e.jsxs)("div",{children:[(0,e.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,e.jsxs)("div",{className:"flex items-center justify-between",children:[(0,e.jsxs)("div",{className:"shrink-0 flex items-center gap-4",children:[(0,e.jsx)(a.Picture,{source:i.image?.url||o?.images?.[0]?.url,className:"size-10 laptop:size-12 p-2 lg-desktop:size-16 object-cover border-1 border-[#E4E5E6] bg-[#EAEAEC] rounded-[5px] rounded-lg"}),(0,e.jsxs)("div",{className:"flex flex-col gap-[6px] max-w-[178px] tablet:max-w-none",children:[(0,e.jsx)(a.Text,{className:"font-bold text-[14px] line-clamp-2 desktop:text-[16px] lg-desktop:text-[18px]",html:o.title}),(0,e.jsx)(a.Text,{className:"text-[12px] laptop:text-[14px] desktop:text-[18px] font-bold text-[#6D6D6F]",html:`x1 | ${p.color||p.colour||p.couleur}`})]})]}),(0,e.jsxs)("div",{className:"flex items-center gap-1",children:[(0,e.jsx)(a.Text,{className:"text-base desktop:text-2xl font-bold",html:(0,m.formatPrice)({amount:J,currencyCode:i.price.currencyCode,locale:n})}),h>0&&(0,e.jsx)(a.Text,{className:"text-base desktop:text-2xl laptop:text-xl font-bold line-through text-[#6D6D6F]",html:(0,m.formatPrice)({amount:i?.price?.amount,currencyCode:i.price.currencyCode,locale:n})})]})]}),l?.gift?.value&&(0,e.jsx)(L,{giftOperation:d=>{O?.(void 0),f?.({...l,gift:{value:void 0,canOperate:!0}}),v?.({...c,gift:d})},status:!!l?.gift,gift:l?.gift?.value,canOperate:l?.gift?.canOperate}),l?.bundle?.value&&(0,e.jsx)(S,{bundleOperation:d=>{y?.(void 0),f?.({...l,bundle:{value:void 0,canOperate:!0}}),v?.({...c,bundle:d})},status:!!l?.bundle,bundleListItem:l?.bundle?.value,canOperate:l?.bundle?.canOperate}),l?.exchange?.value&&(0,e.jsx)(V,{exchangeOperation:d=>{x?.(void 0),f?.({...l,exchange:{value:void 0,canOperate:!0}}),v?.({...c,exchange:d})},status:!!l?.exchange,canOperate:l?.exchange?.canOperate,exchange:l?.exchange?.value})]}),(c?.bundle||c?.gift||c?.exchange)&&(0,e.jsxs)("div",{className:"mt-6",children:[(0,e.jsx)(a.Text,{className:"text-sm desktop:text-[18px] font-bold",html:"Recommend Buy"}),(0,e.jsxs)("div",{className:"flex flex-col gap-6 mt-6",children:[c?.exchange&&(0,e.jsx)(V,{exchangeOperation:d=>{y?.(void 0),f?.({bundle:{value:void 0,canOperate:!0},gift:{value:l?.gift?.value,canOperate:!0},exchange:{value:d,canOperate:!0}}),v?.({...c,exchange:void 0})},canOperate:l?.exchange?.canOperate,status:!c?.exchange,exchange:c?.exchange}),c?.bundle&&(0,e.jsx)(S,{bundleOperation:d=>{O?.(void 0),x?.(void 0),I?.({...N,exchangePurchase:0}),f?.({gift:{value:void 0,canOperate:!0},exchange:{value:void 0,canOperate:!0},bundle:{value:d,canOperate:!0}}),v?.({...c,bundle:void 0})},canOperate:l?.bundle?.canOperate,status:!c?.bundle,bundleListItem:c?.bundle}),c?.gift&&(0,e.jsx)(L,{giftOperation:d=>{y?.(void 0),f?.({bundle:{value:void 0,canOperate:!0},exchange:{value:l?.exchange?.value,canOperate:!0},gift:{value:d,canOperate:!0}}),v?.({...c,gift:void 0})},canOperate:l?.gift?.canOperate,status:!c?.gift,gift:c?.gift})]})]})]}),(0,e.jsxs)("div",{className:"text-right",children:[(0,e.jsx)(a.Text,{className:"laptop:text-xl desktop:text-2xl font-bold text-right",html:`${(0,R.replaceTemplate)(t?.totalPrice||"",{amount:(0,m.formatPrice)({amount:s,currencyCode:i.price.currencyCode,locale:n})})}`}),h>0&&(0,e.jsx)(a.Text,{className:"text-base laptop:text-xl desktop:text-2xl ml-1 font-bold line-through text-[#6D6D6F]",html:(0,m.formatPrice)({amount:u,currencyCode:i.price.currencyCode,locale:n})}),(0,e.jsxs)("div",{className:"flex gap-3 mt-2 justify-end",children:[(0,e.jsx)(a.Button,{size:"lg",variant:"secondary",loading:T,className:"w-1/2 tablet:w-auto laptop:w-1/2 desktop:w-auto",onClick:()=>D?.(),children:t?.addToCart}),(0,e.jsx)(a.Button,{size:"lg",loading:$,variant:"primary",className:"w-1/2 tablet:w-auto laptop:w-1/2 desktop:w-auto",onClick:()=>z?.(),children:t?.shopNow})]})]})]})]})})})},_=()=>{const{bundle:n,variant:t,checkedBundle:o,freeGift:i,checkedGift:s,exchangePurchase:u,checkedExchangePurchase:b}=(0,k.useBizProductContext)();let p,r,h;const{bundleList:D}=n||{},{giftList:z=[]}=i||{},{giftList:N=[]}=u||{},C=D?.filter(x=>x.variants.slice(1,x.variants.length).every(y=>y.variant.availableForSale))||[],[l]=C;p=o||l;const[f]=z?.filter(x=>x.availableForSale);r=s||f;const[O]=N?.filter(x=>x.availableForSale);return h=b||O,{bundleVariant:p,giftVariant:r,exchangeVariant:h}},S=({bundleOperation:n,bundleListItem:t,canOperate:o,status:i})=>{const{locale:s="us"}=(0,P.useAiuiContext)(),{variant:u,setCheckedBundle:b}=(0,k.useBizProductContext)(),p=t?.variants.filter(r=>r.variant.sku!==u.sku);return(0,e.jsx)("div",{className:"",children:p?.map(r=>(0,e.jsxs)("div",{className:"flex items-center gap-4 justify-between",children:[(0,e.jsxs)("div",{className:"flex items-center gap-4",children:[(0,e.jsx)(a.Picture,{source:r?.variant?.image?.url,className:"size-10 laptop:size-12 p-2 lg-desktop:size-16 object-cover border-1 border-[#E4E5E6] bg-[#EAEAEC] rounded-[5px] rounded-lg"}),(0,e.jsx)("div",{className:"flex flex-col gap-[6px] line-clamp-2 max-w-[178px] tablet:max-w-none",children:(0,e.jsx)(a.Text,{className:"font-bold text-[14px] desktop:text-[16px] lg-desktop:text-[18px]",html:r.variant.product.title})})]}),(0,e.jsxs)("div",{className:"flex flex-col items-end gap-1 justify-center",children:[!!t&&(0,e.jsxs)("div",{className:"flex items-center gap-1",children:[(0,e.jsx)(a.Text,{className:"text-base desktop:text-2xl font-bold",html:(0,m.formatPrice)({amount:r?.price||0,locale:s,currencyCode:r.variant?.price?.currencyCode||""})}),(0,e.jsx)(a.Text,{className:"text-base desktop:text-2xl font-bold line-through text-[#6D6D6F]",html:(0,m.formatPrice)({amount:r.variant.price.amount||0,locale:s,currencyCode:r.variant?.price?.currencyCode||""})})]}),o&&(0,e.jsx)(a.Button,{size:"icon",variant:"link",onClick:()=>{b?.(i?void 0:t),n?.(t)},className:"shrink-0 size-auto underline",children:i?"Remove":"Add"})]})]},r.variant.id))})},L=({giftOperation:n,gift:t,status:o,canOperate:i})=>{const{locale:s="us"}=(0,P.useAiuiContext)(),{freeGift:u,setCheckedGift:b}=(0,k.useBizProductContext)(),{freeLabel:p,count:r}=u||{};return(0,e.jsxs)("div",{className:"flex items-center justify-between",children:[(0,e.jsxs)("div",{className:"flex items-center gap-4",children:[(0,e.jsx)(a.Picture,{source:t?.image?.url,className:"size-10 laptop:size-12 p-2 lg-desktop:size-16 object-cover border-1 border-[#E4E5E6] bg-[#EAEAEC] rounded-[5px] rounded-lg"}),(0,e.jsxs)("div",{className:"flex flex-col gap-[6px] max-w-[178px] tablet:max-w-none",children:[(0,e.jsx)(a.Text,{className:"font-bold text-[14px] line-clamp-2 desktop:text-[16px] lg-desktop:text-[18px]",html:t?.product?.title}),(0,e.jsx)(a.Text,{className:"text-[12px] laptop:text-[14px] desktop:text-[18px] font-bold text-[#6D6D6F]",html:`x${r} | ${p}`})]})]}),(0,e.jsxs)("div",{className:"flex flex-col items-end gap-2 justify-center",children:[!!t&&(0,e.jsxs)("div",{className:"flex items-center gap-1",children:[(0,e.jsx)(a.Text,{className:"text-base desktop:text-2xl font-bold",html:p}),(0,e.jsx)(a.Text,{className:"text-base desktop:text-2xl font-bold line-through text-[#6D6D6F]",html:(0,m.formatPrice)({amount:t.price.amount,locale:s,currencyCode:t.price.currencyCode})})]}),i&&(0,e.jsx)(a.Button,{size:"icon",variant:"link",onClick:()=>{b?.(o?void 0:t),n(t)},className:"shrink-0 size-auto underline",children:o?"Remove":"Add"})]})]})},V=({exchangeOperation:n,exchange:t,canOperate:o,status:i})=>{const{locale:s="us"}=(0,P.useAiuiContext)(),{setCheckedExchangePurchase:u}=(0,k.useBizProductContext)();return(0,e.jsxs)("div",{className:"flex items-center justify-between",children:[(0,e.jsxs)("div",{className:"flex items-center gap-4",children:[(0,e.jsx)(a.Picture,{source:t?.image?.url,className:"size-10 laptop:size-12 p-2 lg-desktop:size-16 object-cover border-1 border-[#E4E5E6] bg-[#EAEAEC] rounded-[5px] rounded-lg"}),(0,e.jsxs)("div",{className:"flex flex-col gap-[6px] max-w-[178px] tablet:max-w-none",children:[(0,e.jsx)(a.Text,{className:"font-bold text-[14px] line-clamp-2 desktop:text-[16px] lg-desktop:text-[18px]",html:t?.product?.title}),(0,e.jsx)(a.Text,{className:"text-[12px] laptop:text-[14px] desktop:text-[18px] font-bold text-[#6D6D6F]"})]})]}),(0,e.jsxs)("div",{className:"flex flex-col items-end gap-2 justify-center",children:[!!t&&(0,e.jsxs)("div",{className:"flex items-center gap-1",children:[(0,e.jsx)(a.Text,{className:"text-base desktop:text-2xl font-bold",html:(0,m.formatPrice)({amount:t.finalPrice?.amount||0,locale:s,currencyCode:t.price.currencyCode})}),(0,e.jsx)(a.Text,{className:"text-base desktop:text-2xl font-bold line-through text-[#6D6D6F]",html:(0,m.formatPrice)({amount:t.price?.amount||0,locale:s,currencyCode:t.price.currencyCode})})]}),o&&(0,e.jsx)(a.Button,{size:"icon",variant:"link",onClick:()=>{u?.(i?void 0:t),n(t)},className:"shrink-0 size-auto underline",children:i?"Remove":"Add"})]})]})};var ee=Z;
1
+ "use strict";var K=Object.create;var B=Object.defineProperty;var Q=Object.getOwnPropertyDescriptor;var U=Object.getOwnPropertyNames;var X=Object.getPrototypeOf,Y=Object.prototype.hasOwnProperty;var Z=(n,t)=>{for(var o in t)B(n,o,{get:t[o],enumerable:!0})},L=(n,t,o,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of U(t))!Y.call(n,s)&&s!==o&&B(n,s,{get:()=>t[s],enumerable:!(i=Q(t,s))||i.enumerable});return n};var _=(n,t,o)=>(o=n!=null?K(X(n)):{},L(t||!n||!n.__esModule?B(o,"default",{value:n,enumerable:!0}):o,n)),ee=n=>L(B({},"__esModule",{value:!0}),n);var le={};Z(le,{default:()=>ne});module.exports=ee(le);var e=require("react/jsx-runtime"),a=require("../../../../../components"),h=require("../../../BizProductProvider"),N=require("react"),p=require("../../../utils"),C=require("../../../../AiuiProvider"),se=require("../../../../../helpers"),A=_(require("decimal.js")),T=require("../../../utils/textFormat");const te=({})=>{const{locale:n="us",copyWriting:t}=(0,C.useAiuiContext)(),{product:o,variant:i,finalPrice:s,comparePrice:m,coupon:g,selectedOptions:u,selectedVariants:r,totalSavings:b,onAddToCart:D,onBuyNow:z,savingDetail:k,checkedBundle:O,joinedRecommendBuyProducts:l,setJoinedRecommendBuyProducts:f,setCheckedGift:E,setCheckedExchangePurchase:x,setCheckedBundle:y,setSavingDetail:$,addToCartLoading:J,buyNowLoading:H,profile:F}=(0,h.useBizProductContext)(),[P]=r,M=(0,N.useMemo)(()=>{const d=O?.variants.find(q=>q.variant.sku===P?.sku),W=new A.default(P?.price?.amount||0).minus(d?.price||P?.price?.amount).toNumber();let w=new A.default(P?.price?.amount||0);return F?.email&&(w=w.minus(k?.member||0)),w.minus(k?.coupon).minus(W).toNumber(),w.toNumber()},[P,b,O,F]);if(!i.availableForSale)return null;const{bundleVariant:j,giftVariant:S,exchangeVariant:G}=ae()||{},[c,v]=(0,N.useState)();return(0,N.useEffect)(()=>{v({bundle:l.bundle?.value?void 0:j,gift:l.gift?.value?void 0:S,exchange:l.exchange?.value?void 0:G})},[j,S,G,l]),(0,e.jsx)("div",{className:"ipc-product-summary laptop:px-16 desktop:px-0 mt-16 desktop:mt-[96px] lg-desktop:mt-[128px]",children:(0,e.jsx)("div",{className:"bg-[#F5F5F7] laptop:rounded-2xl",children:(0,e.jsxs)(a.Grid,{className:"px-4 pt-6 tablet:p-8 tablet:!pb-0",children:[(0,e.jsxs)(a.GridItem,{className:"col-span-12 laptop:col-start-1 laptop:col-span-5 gap-4 flex flex-col justify-between",children:[(0,e.jsx)(a.Heading,{className:"font-bold text-[24px] lg-desktop:text-[48px] laptop:text-[32px] desktop:text-[40px] leading-[1] mb-4 [&>span]:text-[#D1D1D1]",html:`${o.title} is ready <br/><span>Just the way you want it.</span>`}),(0,e.jsx)("div",{className:"",children:(0,e.jsx)(a.Picture,{source:i.image?.url||o?.images?.[0]?.url,className:"lg-desktop:aspect-[644/368] desktop:aspect-[503/272] laptop:aspect-[331/191] tablet:aspect-[704/380] aspect-[358/192]",imgClassName:"object-cover h-full"})})]}),(0,e.jsxs)(a.GridItem,{className:"col-span-12 mt-8 pb-6 tablet:pb-8 laptop:col-start-7 laptop:mt-0 laptop:col-span-6 flex flex-col gap-6 justify-between",children:[(0,e.jsxs)("div",{children:[(0,e.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,e.jsxs)("div",{className:"flex items-center justify-between",children:[(0,e.jsxs)("div",{className:"shrink-0 flex items-center gap-4",children:[(0,e.jsx)(a.Picture,{source:i.image?.url||o?.images?.[0]?.url,className:"size-10 laptop:size-12 p-2 lg-desktop:size-16 object-cover border-1 border-[#E4E5E6] bg-[#EAEAEC] rounded-[5px] rounded-lg"}),(0,e.jsxs)("div",{className:"flex flex-col gap-[6px] max-w-[178px] tablet:max-w-none",children:[(0,e.jsx)(a.Text,{className:"font-bold text-[14px] line-clamp-2 desktop:text-[16px] lg-desktop:text-[18px]",html:o.title}),(0,e.jsx)(a.Text,{className:"text-[12px] laptop:text-[14px] desktop:text-[18px] font-bold text-[#6D6D6F]",html:`x1 | ${u.color||u.colour||u.couleur}`})]})]}),(0,e.jsxs)("div",{className:"flex items-center gap-1",children:[(0,e.jsx)(a.Text,{className:"text-base desktop:text-2xl font-bold",html:(0,p.formatPrice)({amount:M,currencyCode:i.price.currencyCode,locale:n})}),b>0&&(0,e.jsx)(a.Text,{className:"text-base desktop:text-2xl laptop:text-xl font-bold line-through text-[#6D6D6F]",html:(0,p.formatPrice)({amount:i?.price?.amount,currencyCode:i.price.currencyCode,locale:n})})]})]}),l?.gift?.value&&(0,e.jsx)(R,{giftOperation:d=>{E?.(void 0),f?.({...l,gift:{value:void 0,canOperate:!0}}),v?.({...c,gift:d})},status:!!l?.gift,gift:l?.gift?.value,canOperate:l?.gift?.canOperate}),l?.bundle?.value&&(0,e.jsx)(V,{bundleOperation:d=>{y?.(void 0),f?.({...l,bundle:{value:void 0,canOperate:!0}}),v?.({...c,bundle:d})},status:!!l?.bundle,bundleListItem:l?.bundle?.value,canOperate:l?.bundle?.canOperate}),l?.exchange?.value&&(0,e.jsx)(I,{exchangeOperation:d=>{x?.(void 0),f?.({...l,exchange:{value:void 0,canOperate:!0}}),v?.({...c,exchange:d})},status:!!l?.exchange,canOperate:l?.exchange?.canOperate,exchange:l?.exchange?.value})]}),(c?.bundle||c?.gift||c?.exchange)&&(0,e.jsxs)("div",{className:"mt-6",children:[(0,e.jsx)(a.Text,{className:"text-sm desktop:text-[18px] font-bold",html:"Recommend Buy"}),(0,e.jsxs)("div",{className:"flex flex-col gap-6 mt-6",children:[c?.exchange&&(0,e.jsx)(I,{exchangeOperation:d=>{y?.(void 0),f?.({bundle:{value:void 0,canOperate:!0},gift:{value:l?.gift?.value,canOperate:!0},exchange:{value:d,canOperate:!0}}),v?.({...c,exchange:void 0})},canOperate:l?.exchange?.canOperate,status:!c?.exchange,exchange:c?.exchange}),c?.bundle&&(0,e.jsx)(V,{bundleOperation:d=>{E?.(void 0),x?.(void 0),$?.({...k,exchangePurchase:0}),f?.({gift:{value:void 0,canOperate:!0},exchange:{value:void 0,canOperate:!0},bundle:{value:d,canOperate:!0}}),v?.({...c,bundle:void 0})},canOperate:l?.bundle?.canOperate,status:!c?.bundle,bundleListItem:c?.bundle}),c?.gift&&(0,e.jsx)(R,{giftOperation:d=>{y?.(void 0),f?.({bundle:{value:void 0,canOperate:!0},exchange:{value:l?.exchange?.value,canOperate:!0},gift:{value:d,canOperate:!0}}),v?.({...c,gift:void 0})},canOperate:l?.gift?.canOperate,status:!c?.gift,gift:c?.gift})]})]})]}),(0,e.jsxs)("div",{className:"text-right",children:[(0,e.jsx)(a.Text,{className:"laptop:text-xl desktop:text-2xl font-bold text-right",html:`${(0,T.replaceTemplate)(t?.totalPrice||"",{amount:(0,p.formatPrice)({amount:s,currencyCode:i.price.currencyCode,locale:n})})}`}),b>0&&(0,e.jsx)(a.Text,{className:"text-base laptop:text-xl desktop:text-2xl ml-1 font-bold line-through text-[#6D6D6F]",html:(0,p.formatPrice)({amount:m,currencyCode:i.price.currencyCode,locale:n})}),(0,e.jsxs)("div",{className:"flex gap-3 mt-2 justify-end",children:[(0,e.jsx)(a.Button,{size:"lg",variant:"secondary",loading:J,className:"w-1/2 tablet:w-auto laptop:w-1/2 desktop:w-auto",onClick:()=>D?.(),children:t?.addToCart}),(0,e.jsx)(a.Button,{size:"lg",loading:H,variant:"primary",className:"w-1/2 tablet:w-auto laptop:w-1/2 desktop:w-auto",onClick:()=>z?.(),children:t?.shopNow})]})]})]})]})})})},ae=()=>{const{bundle:n,variant:t,checkedBundle:o,freeGift:i,checkedGift:s,exchangePurchase:m,checkedExchangePurchase:g}=(0,h.useBizProductContext)();let u,r,b;const{bundleList:D}=n||{},{giftList:z=[]}=i||{},{giftList:k=[]}=m||{},O=D?.filter(x=>x.variants.slice(1,x.variants.length).every(y=>y.variant.availableForSale))||[],[l]=O;u=o||l;const[f]=z?.filter(x=>x.availableForSale);r=s||f;const[E]=k?.filter(x=>x.availableForSale);return b=g||E,{bundleVariant:u,giftVariant:r,exchangeVariant:b}},V=({bundleOperation:n,bundleListItem:t,canOperate:o,status:i})=>{const{locale:s="us"}=(0,C.useAiuiContext)(),{variant:m,setCheckedBundle:g}=(0,h.useBizProductContext)(),u=t?.variants.filter(r=>r.variant.sku!==m.sku);return(0,e.jsx)("div",{className:"",children:u?.map(r=>(0,e.jsxs)("div",{className:"flex items-center gap-4 justify-between",children:[(0,e.jsxs)("div",{className:"flex items-center gap-4",children:[(0,e.jsx)(a.Picture,{source:r?.variant?.image?.url,className:"size-10 laptop:size-12 p-2 lg-desktop:size-16 object-cover border-1 border-[#E4E5E6] bg-[#EAEAEC] rounded-[5px] rounded-lg"}),(0,e.jsx)("div",{className:"flex flex-col gap-[6px] line-clamp-2 max-w-[178px] tablet:max-w-none",children:(0,e.jsx)(a.Text,{className:"font-bold text-[14px] desktop:text-[16px] lg-desktop:text-[18px]",html:r.variant.product.title})})]}),(0,e.jsxs)("div",{className:"flex flex-col items-end gap-1 justify-center",children:[!!t&&(0,e.jsxs)("div",{className:"flex items-center gap-1",children:[(0,e.jsx)(a.Text,{className:"text-base desktop:text-2xl font-bold",html:(0,p.formatPrice)({amount:r?.price||0,locale:s,currencyCode:r.variant?.price?.currencyCode||""})}),(0,e.jsx)(a.Text,{className:"text-base desktop:text-2xl font-bold line-through text-[#6D6D6F]",html:(0,p.formatPrice)({amount:r.variant.price.amount||0,locale:s,currencyCode:r.variant?.price?.currencyCode||""})})]}),o&&(0,e.jsx)(a.Button,{size:"icon",variant:"link",onClick:()=>{g?.(i?void 0:t),n?.(t)},className:"shrink-0 size-auto underline",children:i?"Remove":"Add"})]})]},r.variant.id))})},R=({giftOperation:n,gift:t,status:o,canOperate:i})=>{const{locale:s="us"}=(0,C.useAiuiContext)(),{freeGift:m,setCheckedGift:g}=(0,h.useBizProductContext)(),{freeLabel:u,count:r}=m||{};return(0,e.jsxs)("div",{className:"flex items-center justify-between",children:[(0,e.jsxs)("div",{className:"flex items-center gap-4",children:[(0,e.jsx)(a.Picture,{source:t?.image?.url,className:"size-10 laptop:size-12 p-2 lg-desktop:size-16 object-cover border-1 border-[#E4E5E6] bg-[#EAEAEC] rounded-[5px] rounded-lg"}),(0,e.jsxs)("div",{className:"flex flex-col gap-[6px] max-w-[178px] tablet:max-w-none",children:[(0,e.jsx)(a.Text,{className:"font-bold text-[14px] line-clamp-2 desktop:text-[16px] lg-desktop:text-[18px]",html:t?.product?.title}),(0,e.jsx)(a.Text,{className:"text-[12px] laptop:text-[14px] desktop:text-[18px] font-bold text-[#6D6D6F]",html:`x${r} | ${u}`})]})]}),(0,e.jsxs)("div",{className:"flex flex-col items-end gap-2 justify-center",children:[!!t&&(0,e.jsxs)("div",{className:"flex items-center gap-1",children:[(0,e.jsx)(a.Text,{className:"text-base desktop:text-2xl font-bold",html:u}),(0,e.jsx)(a.Text,{className:"text-base desktop:text-2xl font-bold line-through text-[#6D6D6F]",html:(0,p.formatPrice)({amount:t.price.amount,locale:s,currencyCode:t.price.currencyCode})})]}),i&&(0,e.jsx)(a.Button,{size:"icon",variant:"link",onClick:()=>{g?.(o?void 0:t),n(t)},className:"shrink-0 size-auto underline",children:o?"Remove":"Add"})]})]})},I=({exchangeOperation:n,exchange:t,canOperate:o,status:i})=>{const{locale:s="us"}=(0,C.useAiuiContext)(),{setCheckedExchangePurchase:m}=(0,h.useBizProductContext)();return(0,e.jsxs)("div",{className:"flex items-center justify-between",children:[(0,e.jsxs)("div",{className:"flex items-center gap-4",children:[(0,e.jsx)(a.Picture,{source:t?.image?.url,className:"size-10 laptop:size-12 p-2 lg-desktop:size-16 object-cover border-1 border-[#E4E5E6] bg-[#EAEAEC] rounded-[5px] rounded-lg"}),(0,e.jsxs)("div",{className:"flex flex-col gap-[6px] max-w-[178px] tablet:max-w-none",children:[(0,e.jsx)(a.Text,{className:"font-bold text-[14px] line-clamp-2 desktop:text-[16px] lg-desktop:text-[18px]",html:t?.product?.title}),(0,e.jsx)(a.Text,{className:"text-[12px] laptop:text-[14px] desktop:text-[18px] font-bold text-[#6D6D6F]"})]})]}),(0,e.jsxs)("div",{className:"flex flex-col items-end gap-2 justify-center",children:[!!t&&(0,e.jsxs)("div",{className:"flex items-center gap-1",children:[(0,e.jsx)(a.Text,{className:"text-base desktop:text-2xl font-bold",html:(0,p.formatPrice)({amount:t.finalPrice?.amount||0,locale:s,currencyCode:t.price.currencyCode})}),(0,e.jsx)(a.Text,{className:"text-base desktop:text-2xl font-bold line-through text-[#6D6D6F]",html:(0,p.formatPrice)({amount:t.price?.amount||0,locale:s,currencyCode:t.price.currencyCode})})]}),o&&(0,e.jsx)(a.Button,{size:"icon",variant:"link",onClick:()=>{m?.(i?void 0:t),n(t)},className:"shrink-0 size-auto underline",children:i?"Remove":"Add"})]})]})};var ne=te;
2
2
  //# sourceMappingURL=index.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../../src/biz-components/Listing/components/ProductCard/ProductSummary/index.tsx"],
4
- "sourcesContent": ["import { Text, Button, Container, Grid, GridItem, Picture, Heading } from '../../../../../components'\nimport type { ProductSummaryProps } from './types'\nimport { useBizProductContext } from '../../../BizProductProvider'\nimport { useEffect, useMemo, useState } from 'react'\nimport { formatPrice } from '../../../utils'\nimport { useAiuiContext } from '../../../../AiuiProvider'\nimport type { BundleListItem, ProductVariant, ProductPrice } from '../../../types/product'\nimport { cn } from '../../../../../helpers'\nimport Decimal from 'decimal.js'\nimport { replaceTemplate } from '../../../utils/textFormat'\n\nconst ProductSummary = ({}: ProductSummaryProps) => {\n const { locale = 'us', copyWriting } = useAiuiContext()\n const {\n product,\n variant,\n finalPrice,\n comparePrice,\n coupon,\n selectedOptions,\n selectedVariants,\n totalSavings,\n onAddToCart,\n onBuyNow,\n savingDetail,\n checkedBundle,\n joinedRecommendBuyProducts,\n setJoinedRecommendBuyProducts,\n setCheckedGift,\n setCheckedExchangePurchase,\n setCheckedBundle,\n setSavingDetail,\n addToCartLoading,\n buyNowLoading,\n } = useBizProductContext()\n\n const [currentProductVariant] = selectedVariants\n\n const summaryFinalPrice = useMemo(() => {\n const [currentBundleVariant] = checkedBundle?.variants || []\n const currentBundlePrice = new Decimal(currentProductVariant?.price?.amount || 0)\n .minus(currentBundleVariant?.price || currentProductVariant?.price?.amount)\n .toNumber()\n return new Decimal(currentProductVariant?.price?.amount || 0)\n .minus(savingDetail?.coupon)\n .minus(currentBundlePrice)\n .toNumber()\n }, [currentProductVariant, totalSavings, checkedBundle])\n\n const isAvailable = variant.availableForSale\n if (!isAvailable) return null\n\n const { bundleVariant, giftVariant, exchangeVariant } = useRecommendBuyProducts() || {}\n const [initialRecommendBuyProducts, setInitialRecommendBuyProducts] = useState<{\n bundle?: BundleListItem\n gift?: ProductVariant\n exchange?: ProductVariant\n }>()\n\n useEffect(() => {\n setInitialRecommendBuyProducts({\n bundle: joinedRecommendBuyProducts.bundle?.value ? undefined : bundleVariant,\n gift: joinedRecommendBuyProducts.gift?.value ? undefined : giftVariant,\n exchange: joinedRecommendBuyProducts.exchange?.value ? undefined : exchangeVariant,\n })\n }, [bundleVariant, giftVariant, exchangeVariant, joinedRecommendBuyProducts])\n\n const comparePriceRemovedFreeGift = useMemo(\n () => new Decimal(comparePrice).minus(savingDetail.freeGift).toNumber(),\n [comparePrice, savingDetail]\n )\n\n return (\n <div className=\"ipc-product-summary laptop:px-16 desktop:px-0 mt-16 desktop:mt-[96px] lg-desktop:mt-[128px]\">\n <div className=\"bg-[#F5F5F7] laptop:rounded-2xl\">\n <Grid className=\"px-4 pt-6 tablet:p-8 tablet:!pb-0\">\n <GridItem className=\"col-span-12 laptop:col-start-1 laptop:col-span-5 gap-4 flex flex-col justify-between\">\n <Heading\n className=\"font-bold text-[24px] lg-desktop:text-[48px] laptop:text-[32px] desktop:text-[40px] leading-[1] mb-4 [&>span]:text-[#D1D1D1]\"\n html={`${product.title} is ready <br/><span>Just the way you want it.</span>`}\n />\n <div className=\"\">\n <Picture\n source={variant.image?.url || product?.images?.[0]?.url}\n className=\"lg-desktop:aspect-[644/368] desktop:aspect-[503/272] laptop:aspect-[331/191] tablet:aspect-[704/380] aspect-[358/192]\"\n imgClassName=\"object-cover h-full\"\n />\n </div>\n </GridItem>\n <GridItem className=\"col-span-12 mt-8 pb-6 tablet:pb-8 laptop:col-start-7 laptop:mt-0 laptop:col-span-6 flex flex-col gap-6 justify-between\">\n <div>\n <div className=\"flex flex-col gap-4\">\n <div className=\"flex items-center justify-between\">\n <div className=\"shrink-0 flex items-center gap-4\">\n <Picture\n source={variant.image?.url || product?.images?.[0]?.url}\n className=\"size-10 laptop:size-12 p-2 lg-desktop:size-16 object-cover border-1 border-[#E4E5E6] bg-[#EAEAEC] rounded-[5px] rounded-lg\"\n />\n <div className=\"flex flex-col gap-[6px] max-w-[178px] tablet:max-w-none\">\n <Text\n className=\"font-bold text-[14px] line-clamp-2 desktop:text-[16px] lg-desktop:text-[18px]\"\n html={product.title}\n />\n <Text\n className=\"text-[12px] laptop:text-[14px] desktop:text-[18px] font-bold text-[#6D6D6F]\"\n html={`x1 | ${selectedOptions.color || selectedOptions.colour || selectedOptions.couleur}`}\n />\n </div>\n </div>\n <div className=\"flex items-center gap-1\">\n <Text\n className=\"text-base desktop:text-2xl font-bold\"\n html={formatPrice({\n amount: summaryFinalPrice,\n currencyCode: variant.price.currencyCode,\n locale,\n })}\n />\n {totalSavings > 0 && (\n <Text\n className=\"text-base desktop:text-2xl laptop:text-xl font-bold line-through text-[#6D6D6F]\"\n html={formatPrice({\n amount: variant?.price?.amount,\n currencyCode: variant.price.currencyCode,\n locale,\n })}\n />\n )}\n </div>\n </div>\n {joinedRecommendBuyProducts?.gift?.value && (\n <ProductGiftSummary\n giftOperation={gift => {\n setCheckedGift?.(undefined)\n setJoinedRecommendBuyProducts?.({\n ...joinedRecommendBuyProducts,\n gift: {\n value: undefined,\n canOperate: true,\n },\n })\n setInitialRecommendBuyProducts?.({ ...initialRecommendBuyProducts, gift })\n }}\n status={!!joinedRecommendBuyProducts?.gift}\n gift={joinedRecommendBuyProducts?.gift?.value}\n canOperate={joinedRecommendBuyProducts?.gift?.canOperate}\n />\n )}\n {joinedRecommendBuyProducts?.bundle?.value && (\n <ProductBundleSummary\n bundleOperation={bundle => {\n setCheckedBundle?.(undefined)\n setJoinedRecommendBuyProducts?.({\n ...joinedRecommendBuyProducts,\n bundle: {\n value: undefined,\n canOperate: true,\n },\n })\n setInitialRecommendBuyProducts?.({ ...initialRecommendBuyProducts, bundle })\n }}\n status={!!joinedRecommendBuyProducts?.bundle}\n bundleListItem={joinedRecommendBuyProducts?.bundle?.value}\n canOperate={joinedRecommendBuyProducts?.bundle?.canOperate}\n />\n )}\n {joinedRecommendBuyProducts?.exchange?.value && (\n <ProductExchangeSummary\n exchangeOperation={exchange => {\n setCheckedExchangePurchase?.(undefined)\n setJoinedRecommendBuyProducts?.({\n ...joinedRecommendBuyProducts,\n exchange: {\n value: undefined,\n canOperate: true,\n },\n })\n setInitialRecommendBuyProducts?.({ ...initialRecommendBuyProducts, exchange })\n }}\n status={!!joinedRecommendBuyProducts?.exchange}\n canOperate={joinedRecommendBuyProducts?.exchange?.canOperate}\n exchange={joinedRecommendBuyProducts?.exchange?.value}\n />\n )}\n </div>\n {(initialRecommendBuyProducts?.bundle ||\n initialRecommendBuyProducts?.gift ||\n initialRecommendBuyProducts?.exchange) && (\n <div className=\"mt-6\">\n <Text className=\"text-sm desktop:text-[18px] font-bold\" html={'Recommend Buy'} />\n <div className=\"flex flex-col gap-6 mt-6\">\n {initialRecommendBuyProducts?.exchange && (\n <ProductExchangeSummary\n exchangeOperation={exchange => {\n setCheckedBundle?.(undefined)\n setJoinedRecommendBuyProducts?.({\n bundle: {\n value: undefined,\n canOperate: true,\n },\n gift: {\n value: joinedRecommendBuyProducts?.gift?.value,\n canOperate: true,\n },\n exchange: {\n value: exchange,\n canOperate: true,\n },\n })\n setInitialRecommendBuyProducts?.({ ...initialRecommendBuyProducts, exchange: undefined })\n }}\n canOperate={joinedRecommendBuyProducts?.exchange?.canOperate}\n status={!initialRecommendBuyProducts?.exchange}\n exchange={initialRecommendBuyProducts?.exchange}\n />\n )}\n {initialRecommendBuyProducts?.bundle && (\n <ProductBundleSummary\n bundleOperation={bundle => {\n setCheckedGift?.(undefined)\n setCheckedExchangePurchase?.(undefined)\n setSavingDetail?.({ ...savingDetail, exchangePurchase: 0 })\n setJoinedRecommendBuyProducts?.({\n gift: {\n value: undefined,\n canOperate: true,\n },\n exchange: {\n value: undefined,\n canOperate: true,\n },\n bundle: {\n value: bundle,\n canOperate: true,\n },\n })\n setInitialRecommendBuyProducts?.({ ...initialRecommendBuyProducts, bundle: undefined })\n }}\n canOperate={joinedRecommendBuyProducts?.bundle?.canOperate}\n status={!initialRecommendBuyProducts?.bundle}\n bundleListItem={initialRecommendBuyProducts?.bundle}\n />\n )}\n {initialRecommendBuyProducts?.gift && (\n <ProductGiftSummary\n giftOperation={gift => {\n setCheckedBundle?.(undefined)\n setJoinedRecommendBuyProducts?.({\n bundle: {\n value: undefined,\n canOperate: true,\n },\n exchange: {\n value: joinedRecommendBuyProducts?.exchange?.value,\n canOperate: true,\n },\n gift: {\n value: gift,\n canOperate: true,\n },\n })\n setInitialRecommendBuyProducts?.({ ...initialRecommendBuyProducts, gift: undefined })\n }}\n canOperate={joinedRecommendBuyProducts?.gift?.canOperate}\n status={!initialRecommendBuyProducts?.gift}\n gift={initialRecommendBuyProducts?.gift}\n />\n )}\n </div>\n </div>\n )}\n </div>\n <div className=\"text-right\">\n <Text\n className=\"laptop:text-xl desktop:text-2xl font-bold text-right\"\n html={`${replaceTemplate(copyWriting?.totalPrice || '', { amount: formatPrice({ amount: finalPrice, currencyCode: variant.price.currencyCode, locale }) })}`}\n />\n\n {totalSavings > 0 && (\n <Text\n className=\"text-base laptop:text-xl desktop:text-2xl ml-1 font-bold line-through text-[#6D6D6F]\"\n html={formatPrice({\n amount: comparePrice,\n currencyCode: variant.price.currencyCode,\n locale,\n })}\n />\n )}\n <div className=\"flex gap-3 mt-2 justify-end\">\n <Button\n size=\"lg\"\n variant=\"secondary\"\n loading={addToCartLoading}\n className=\"w-1/2 tablet:w-auto laptop:w-1/2 desktop:w-auto\"\n onClick={() => onAddToCart?.()}\n >\n {copyWriting?.addToCart}\n </Button>\n <Button\n size=\"lg\"\n loading={buyNowLoading}\n variant=\"primary\"\n className=\"w-1/2 tablet:w-auto laptop:w-1/2 desktop:w-auto\"\n onClick={() => onBuyNow?.()}\n >\n {copyWriting?.shopNow}\n </Button>\n </div>\n </div>\n </GridItem>\n </Grid>\n </div>\n </div>\n )\n}\n\nconst useRecommendBuyProducts = () => {\n const { bundle, variant, checkedBundle, freeGift, checkedGift, exchangePurchase, checkedExchangePurchase } =\n useBizProductContext()\n let bundleVariant = undefined\n let giftVariant = undefined\n let exchangeVariant = undefined\n const { bundleList } = bundle || {}\n\n const { giftList = [] } = freeGift || {}\n const { giftList: exchangeList = [] } = exchangePurchase || {}\n\n const availableBundleList =\n bundleList?.filter(bundle =>\n bundle.variants.slice(1, bundle.variants.length).every(v => v.variant.availableForSale)\n ) || []\n\n const [firstAvailableBundle] = availableBundleList\n bundleVariant = checkedBundle || firstAvailableBundle\n\n const [firstAvailableGift] = giftList?.filter(gift => gift.availableForSale)\n giftVariant = checkedGift || firstAvailableGift\n\n const [firstAvailableExchange] = exchangeList?.filter(exchange => exchange.availableForSale)\n exchangeVariant = checkedExchangePurchase || firstAvailableExchange\n\n return { bundleVariant, giftVariant, exchangeVariant }\n}\n\nconst ProductBundleSummary = ({\n bundleOperation,\n bundleListItem,\n canOperate,\n status,\n}: {\n bundleOperation: (bundle?: BundleListItem) => void\n bundleListItem?: BundleListItem\n canOperate?: boolean\n status?: boolean\n}) => {\n const { locale = 'us' } = useAiuiContext()\n const { variant, setCheckedBundle } = useBizProductContext()\n const bundleVariants = bundleListItem?.variants.filter(v => v.variant.sku !== variant.sku)\n\n return (\n <div className=\"\">\n {bundleVariants?.map(bundleVariant => {\n return (\n <div className=\"flex items-center gap-4 justify-between\" key={bundleVariant.variant.id}>\n <div className=\"flex items-center gap-4\">\n <Picture\n source={bundleVariant?.variant?.image?.url}\n className=\"size-10 laptop:size-12 p-2 lg-desktop:size-16 object-cover border-1 border-[#E4E5E6] bg-[#EAEAEC] rounded-[5px] rounded-lg\"\n />\n <div className=\"flex flex-col gap-[6px] line-clamp-2 max-w-[178px] tablet:max-w-none\">\n <Text\n className=\"font-bold text-[14px] desktop:text-[16px] lg-desktop:text-[18px]\"\n html={bundleVariant.variant.product.title}\n />\n </div>\n </div>\n <div className=\"flex flex-col items-end gap-1 justify-center\">\n {!!bundleListItem && (\n <div className=\"flex items-center gap-1\">\n <Text\n className=\"text-base desktop:text-2xl font-bold\"\n html={formatPrice({\n amount: bundleVariant?.price || 0,\n locale,\n currencyCode: bundleVariant.variant?.price?.currencyCode || '',\n })}\n />\n <Text\n className=\"text-base desktop:text-2xl font-bold line-through text-[#6D6D6F]\"\n html={formatPrice({\n amount: bundleVariant.variant.price.amount || 0,\n locale,\n currencyCode: bundleVariant.variant?.price?.currencyCode || '',\n })}\n />\n </div>\n )}\n {canOperate && (\n <Button\n size=\"icon\"\n variant=\"link\"\n onClick={() => {\n setCheckedBundle?.(status ? undefined : bundleListItem)\n bundleOperation?.(bundleListItem)\n }}\n className=\"shrink-0 size-auto underline\"\n >\n {!!status ? 'Remove' : 'Add'}\n </Button>\n )}\n </div>\n </div>\n )\n })}\n </div>\n )\n}\n\nconst ProductGiftSummary = ({\n giftOperation,\n gift,\n status,\n canOperate,\n}: {\n giftOperation: (gift?: ProductVariant) => void\n gift?: ProductVariant\n status?: boolean\n canOperate?: boolean\n}) => {\n const { locale = 'us' } = useAiuiContext()\n const { freeGift, setCheckedGift } = useBizProductContext()\n const { freeLabel, count } = freeGift || {}\n\n return (\n <div className=\"flex items-center justify-between\">\n <div className=\"flex items-center gap-4\">\n <Picture\n source={gift?.image?.url}\n className=\"size-10 laptop:size-12 p-2 lg-desktop:size-16 object-cover border-1 border-[#E4E5E6] bg-[#EAEAEC] rounded-[5px] rounded-lg\"\n />\n <div className=\"flex flex-col gap-[6px] max-w-[178px] tablet:max-w-none\">\n <Text\n className=\"font-bold text-[14px] line-clamp-2 desktop:text-[16px] lg-desktop:text-[18px]\"\n html={gift?.product?.title}\n />\n <Text\n className=\"text-[12px] laptop:text-[14px] desktop:text-[18px] font-bold text-[#6D6D6F]\"\n html={`x${count} | ${freeLabel}`}\n />\n </div>\n </div>\n <div className=\"flex flex-col items-end gap-2 justify-center\">\n {!!gift && (\n <div className=\"flex items-center gap-1\">\n <Text className=\"text-base desktop:text-2xl font-bold\" html={freeLabel} />\n <Text\n className=\"text-base desktop:text-2xl font-bold line-through text-[#6D6D6F]\"\n html={formatPrice({\n amount: gift.price.amount,\n locale,\n currencyCode: gift.price.currencyCode,\n })}\n />\n </div>\n )}\n {canOperate && (\n <Button\n size=\"icon\"\n variant=\"link\"\n onClick={() => {\n setCheckedGift?.(status ? undefined : gift)\n giftOperation(gift)\n }}\n className=\"shrink-0 size-auto underline\"\n >\n {status ? 'Remove' : 'Add'}\n </Button>\n )}\n </div>\n </div>\n )\n}\n\nconst ProductExchangeSummary = ({\n exchangeOperation,\n exchange,\n canOperate,\n status,\n}: {\n exchangeOperation: (exchange?: ProductVariant) => void\n exchange?: ProductVariant & { finalPrice?: ProductPrice }\n canOperate?: boolean\n status?: boolean\n}) => {\n const { locale = 'us' } = useAiuiContext()\n const { setCheckedExchangePurchase } = useBizProductContext()\n\n return (\n <div className=\"flex items-center justify-between\">\n <div className=\"flex items-center gap-4\">\n <Picture\n source={exchange?.image?.url}\n className=\"size-10 laptop:size-12 p-2 lg-desktop:size-16 object-cover border-1 border-[#E4E5E6] bg-[#EAEAEC] rounded-[5px] rounded-lg\"\n />\n <div className=\"flex flex-col gap-[6px] max-w-[178px] tablet:max-w-none\">\n <Text\n className=\"font-bold text-[14px] line-clamp-2 desktop:text-[16px] lg-desktop:text-[18px]\"\n html={exchange?.product?.title}\n />\n <Text className=\"text-[12px] laptop:text-[14px] desktop:text-[18px] font-bold text-[#6D6D6F]\" />\n </div>\n </div>\n <div className=\"flex flex-col items-end gap-2 justify-center\">\n {!!exchange && (\n <div className=\"flex items-center gap-1\">\n <Text\n className=\"text-base desktop:text-2xl font-bold\"\n html={formatPrice({\n amount: exchange.finalPrice?.amount || 0,\n locale,\n currencyCode: exchange.price.currencyCode,\n })}\n />\n <Text\n className=\"text-base desktop:text-2xl font-bold line-through text-[#6D6D6F]\"\n html={formatPrice({\n amount: exchange.price?.amount || 0,\n locale,\n currencyCode: exchange.price.currencyCode,\n })}\n />\n </div>\n )}\n {canOperate && (\n <Button\n size=\"icon\"\n variant=\"link\"\n onClick={() => {\n setCheckedExchangePurchase?.(status ? undefined : exchange)\n exchangeOperation(exchange)\n }}\n className=\"shrink-0 size-auto underline\"\n >\n {status ? 'Remove' : 'Add'}\n </Button>\n )}\n </div>\n </div>\n )\n}\n\nexport default ProductSummary\n"],
5
- "mappings": "0jBAAA,IAAAA,GAAA,GAAAC,EAAAD,GAAA,aAAAE,KAAA,eAAAC,EAAAH,IA4EU,IAAAI,EAAA,6BA5EVC,EAA0E,qCAE1EC,EAAqC,uCACrCC,EAA6C,iBAC7CC,EAA4B,0BAC5BC,EAA+B,oCAE/BC,GAAmB,kCACnBC,EAAoB,yBACpBC,EAAgC,qCAEhC,MAAMC,EAAiB,CAAC,CAAC,IAA2B,CAClD,KAAM,CAAE,OAAAC,EAAS,KAAM,YAAAC,CAAY,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O,QAAU,EAClC,OAAAvC,EACA,aAAcuC,EAAS,MAAM,YAC/B,CAAC,EACH,GACF,EAEDe,MACC,OAAC,UACC,KAAK,OACL,QAAQ,OACR,QAAS,IAAM,CACbrC,IAA6BsC,EAAS,OAAYhB,CAAQ,EAC1DqB,EAAkBrB,CAAQ,CAC5B,EACA,UAAU,+BAET,SAAAgB,EAAS,SAAW,MACvB,GAEJ,GACF,CAEJ,EAEA,IAAOnE,GAAQW",
6
- "names": ["ProductSummary_exports", "__export", "ProductSummary_default", "__toCommonJS", "import_jsx_runtime", "import_components", "import_BizProductProvider", "import_react", "import_utils", "import_AiuiProvider", "import_helpers", "import_decimal", "import_textFormat", "ProductSummary", "locale", "copyWriting", "product", "variant", "finalPrice", "comparePrice", "coupon", "selectedOptions", "selectedVariants", "totalSavings", "onAddToCart", "onBuyNow", "savingDetail", "checkedBundle", "joinedRecommendBuyProducts", "setJoinedRecommendBuyProducts", "setCheckedGift", "setCheckedExchangePurchase", "setCheckedBundle", "setSavingDetail", "addToCartLoading", "buyNowLoading", "currentProductVariant", "summaryFinalPrice", "currentBundleVariant", "currentBundlePrice", "Decimal", "bundleVariant", "giftVariant", "exchangeVariant", "useRecommendBuyProducts", "initialRecommendBuyProducts", "setInitialRecommendBuyProducts", "comparePriceRemovedFreeGift", "ProductGiftSummary", "gift", "ProductBundleSummary", "bundle", "ProductExchangeSummary", "exchange", "freeGift", "checkedGift", "exchangePurchase", "checkedExchangePurchase", "bundleList", "giftList", "exchangeList", "availableBundleList", "v", "firstAvailableBundle", "firstAvailableGift", "firstAvailableExchange", "bundleOperation", "bundleListItem", "canOperate", "status", "bundleVariants", "giftOperation", "freeLabel", "count", "exchangeOperation"]
4
+ "sourcesContent": ["import { Text, Button, Container, Grid, GridItem, Picture, Heading } from '../../../../../components'\nimport type { ProductSummaryProps } from './types'\nimport { useBizProductContext } from '../../../BizProductProvider'\nimport { useEffect, useMemo, useState } from 'react'\nimport { formatPrice } from '../../../utils'\nimport { useAiuiContext } from '../../../../AiuiProvider'\nimport type { BundleListItem, ProductVariant, ProductPrice } from '../../../types/product'\nimport { cn } from '../../../../../helpers'\nimport Decimal from 'decimal.js'\nimport { replaceTemplate } from '../../../utils/textFormat'\n\nconst ProductSummary = ({}: ProductSummaryProps) => {\n const { locale = 'us', copyWriting } = useAiuiContext()\n const {\n product,\n variant,\n finalPrice,\n comparePrice,\n coupon,\n selectedOptions,\n selectedVariants,\n totalSavings,\n onAddToCart,\n onBuyNow,\n savingDetail,\n checkedBundle,\n joinedRecommendBuyProducts,\n setJoinedRecommendBuyProducts,\n setCheckedGift,\n setCheckedExchangePurchase,\n setCheckedBundle,\n setSavingDetail,\n addToCartLoading,\n buyNowLoading,\n profile,\n } = useBizProductContext()\n\n const [currentProductVariant] = selectedVariants\n\n const summaryFinalPrice = useMemo(() => {\n const currentBundleVariant = checkedBundle?.variants.find(v => v.variant.sku === currentProductVariant?.sku)\n const currentBundlePrice = new Decimal(currentProductVariant?.price?.amount || 0)\n .minus(currentBundleVariant?.price || currentProductVariant?.price?.amount)\n .toNumber()\n let currentProductPrice = new Decimal(currentProductVariant?.price?.amount || 0)\n if (!!profile?.email) {\n currentProductPrice = currentProductPrice.minus(savingDetail?.member || 0)\n }\n currentProductPrice.minus(savingDetail?.coupon).minus(currentBundlePrice).toNumber()\n return currentProductPrice.toNumber()\n }, [currentProductVariant, totalSavings, checkedBundle, profile])\n\n const isAvailable = variant.availableForSale\n if (!isAvailable) return null\n\n const { bundleVariant, giftVariant, exchangeVariant } = useRecommendBuyProducts() || {}\n const [initialRecommendBuyProducts, setInitialRecommendBuyProducts] = useState<{\n bundle?: BundleListItem\n gift?: ProductVariant\n exchange?: ProductVariant\n }>()\n\n useEffect(() => {\n setInitialRecommendBuyProducts({\n bundle: joinedRecommendBuyProducts.bundle?.value ? undefined : bundleVariant,\n gift: joinedRecommendBuyProducts.gift?.value ? undefined : giftVariant,\n exchange: joinedRecommendBuyProducts.exchange?.value ? undefined : exchangeVariant,\n })\n }, [bundleVariant, giftVariant, exchangeVariant, joinedRecommendBuyProducts])\n\n return (\n <div className=\"ipc-product-summary laptop:px-16 desktop:px-0 mt-16 desktop:mt-[96px] lg-desktop:mt-[128px]\">\n <div className=\"bg-[#F5F5F7] laptop:rounded-2xl\">\n <Grid className=\"px-4 pt-6 tablet:p-8 tablet:!pb-0\">\n <GridItem className=\"col-span-12 laptop:col-start-1 laptop:col-span-5 gap-4 flex flex-col justify-between\">\n <Heading\n className=\"font-bold text-[24px] lg-desktop:text-[48px] laptop:text-[32px] desktop:text-[40px] leading-[1] mb-4 [&>span]:text-[#D1D1D1]\"\n html={`${product.title} is ready <br/><span>Just the way you want it.</span>`}\n />\n <div className=\"\">\n <Picture\n source={variant.image?.url || product?.images?.[0]?.url}\n className=\"lg-desktop:aspect-[644/368] desktop:aspect-[503/272] laptop:aspect-[331/191] tablet:aspect-[704/380] aspect-[358/192]\"\n imgClassName=\"object-cover h-full\"\n />\n </div>\n </GridItem>\n <GridItem className=\"col-span-12 mt-8 pb-6 tablet:pb-8 laptop:col-start-7 laptop:mt-0 laptop:col-span-6 flex flex-col gap-6 justify-between\">\n <div>\n <div className=\"flex flex-col gap-4\">\n <div className=\"flex items-center justify-between\">\n <div className=\"shrink-0 flex items-center gap-4\">\n <Picture\n source={variant.image?.url || product?.images?.[0]?.url}\n className=\"size-10 laptop:size-12 p-2 lg-desktop:size-16 object-cover border-1 border-[#E4E5E6] bg-[#EAEAEC] rounded-[5px] rounded-lg\"\n />\n <div className=\"flex flex-col gap-[6px] max-w-[178px] tablet:max-w-none\">\n <Text\n className=\"font-bold text-[14px] line-clamp-2 desktop:text-[16px] lg-desktop:text-[18px]\"\n html={product.title}\n />\n <Text\n className=\"text-[12px] laptop:text-[14px] desktop:text-[18px] font-bold text-[#6D6D6F]\"\n html={`x1 | ${selectedOptions.color || selectedOptions.colour || selectedOptions.couleur}`}\n />\n </div>\n </div>\n <div className=\"flex items-center gap-1\">\n <Text\n className=\"text-base desktop:text-2xl font-bold\"\n html={formatPrice({\n amount: summaryFinalPrice,\n currencyCode: variant.price.currencyCode,\n locale,\n })}\n />\n {totalSavings > 0 && (\n <Text\n className=\"text-base desktop:text-2xl laptop:text-xl font-bold line-through text-[#6D6D6F]\"\n html={formatPrice({\n amount: variant?.price?.amount,\n currencyCode: variant.price.currencyCode,\n locale,\n })}\n />\n )}\n </div>\n </div>\n {joinedRecommendBuyProducts?.gift?.value && (\n <ProductGiftSummary\n giftOperation={gift => {\n setCheckedGift?.(undefined)\n setJoinedRecommendBuyProducts?.({\n ...joinedRecommendBuyProducts,\n gift: {\n value: undefined,\n canOperate: true,\n },\n })\n setInitialRecommendBuyProducts?.({ ...initialRecommendBuyProducts, gift })\n }}\n status={!!joinedRecommendBuyProducts?.gift}\n gift={joinedRecommendBuyProducts?.gift?.value}\n canOperate={joinedRecommendBuyProducts?.gift?.canOperate}\n />\n )}\n {joinedRecommendBuyProducts?.bundle?.value && (\n <ProductBundleSummary\n bundleOperation={bundle => {\n setCheckedBundle?.(undefined)\n setJoinedRecommendBuyProducts?.({\n ...joinedRecommendBuyProducts,\n bundle: {\n value: undefined,\n canOperate: true,\n },\n })\n setInitialRecommendBuyProducts?.({ ...initialRecommendBuyProducts, bundle })\n }}\n status={!!joinedRecommendBuyProducts?.bundle}\n bundleListItem={joinedRecommendBuyProducts?.bundle?.value}\n canOperate={joinedRecommendBuyProducts?.bundle?.canOperate}\n />\n )}\n {joinedRecommendBuyProducts?.exchange?.value && (\n <ProductExchangeSummary\n exchangeOperation={exchange => {\n setCheckedExchangePurchase?.(undefined)\n setJoinedRecommendBuyProducts?.({\n ...joinedRecommendBuyProducts,\n exchange: {\n value: undefined,\n canOperate: true,\n },\n })\n setInitialRecommendBuyProducts?.({ ...initialRecommendBuyProducts, exchange })\n }}\n status={!!joinedRecommendBuyProducts?.exchange}\n canOperate={joinedRecommendBuyProducts?.exchange?.canOperate}\n exchange={joinedRecommendBuyProducts?.exchange?.value}\n />\n )}\n </div>\n {(initialRecommendBuyProducts?.bundle ||\n initialRecommendBuyProducts?.gift ||\n initialRecommendBuyProducts?.exchange) && (\n <div className=\"mt-6\">\n <Text className=\"text-sm desktop:text-[18px] font-bold\" html={'Recommend Buy'} />\n <div className=\"flex flex-col gap-6 mt-6\">\n {initialRecommendBuyProducts?.exchange && (\n <ProductExchangeSummary\n exchangeOperation={exchange => {\n setCheckedBundle?.(undefined)\n setJoinedRecommendBuyProducts?.({\n bundle: {\n value: undefined,\n canOperate: true,\n },\n gift: {\n value: joinedRecommendBuyProducts?.gift?.value,\n canOperate: true,\n },\n exchange: {\n value: exchange,\n canOperate: true,\n },\n })\n setInitialRecommendBuyProducts?.({ ...initialRecommendBuyProducts, exchange: undefined })\n }}\n canOperate={joinedRecommendBuyProducts?.exchange?.canOperate}\n status={!initialRecommendBuyProducts?.exchange}\n exchange={initialRecommendBuyProducts?.exchange}\n />\n )}\n {initialRecommendBuyProducts?.bundle && (\n <ProductBundleSummary\n bundleOperation={bundle => {\n setCheckedGift?.(undefined)\n setCheckedExchangePurchase?.(undefined)\n setSavingDetail?.({ ...savingDetail, exchangePurchase: 0 })\n setJoinedRecommendBuyProducts?.({\n gift: {\n value: undefined,\n canOperate: true,\n },\n exchange: {\n value: undefined,\n canOperate: true,\n },\n bundle: {\n value: bundle,\n canOperate: true,\n },\n })\n setInitialRecommendBuyProducts?.({ ...initialRecommendBuyProducts, bundle: undefined })\n }}\n canOperate={joinedRecommendBuyProducts?.bundle?.canOperate}\n status={!initialRecommendBuyProducts?.bundle}\n bundleListItem={initialRecommendBuyProducts?.bundle}\n />\n )}\n {initialRecommendBuyProducts?.gift && (\n <ProductGiftSummary\n giftOperation={gift => {\n setCheckedBundle?.(undefined)\n setJoinedRecommendBuyProducts?.({\n bundle: {\n value: undefined,\n canOperate: true,\n },\n exchange: {\n value: joinedRecommendBuyProducts?.exchange?.value,\n canOperate: true,\n },\n gift: {\n value: gift,\n canOperate: true,\n },\n })\n setInitialRecommendBuyProducts?.({ ...initialRecommendBuyProducts, gift: undefined })\n }}\n canOperate={joinedRecommendBuyProducts?.gift?.canOperate}\n status={!initialRecommendBuyProducts?.gift}\n gift={initialRecommendBuyProducts?.gift}\n />\n )}\n </div>\n </div>\n )}\n </div>\n <div className=\"text-right\">\n <Text\n className=\"laptop:text-xl desktop:text-2xl font-bold text-right\"\n html={`${replaceTemplate(copyWriting?.totalPrice || '', { amount: formatPrice({ amount: finalPrice, currencyCode: variant.price.currencyCode, locale }) })}`}\n />\n\n {totalSavings > 0 && (\n <Text\n className=\"text-base laptop:text-xl desktop:text-2xl ml-1 font-bold line-through text-[#6D6D6F]\"\n html={formatPrice({\n amount: comparePrice,\n currencyCode: variant.price.currencyCode,\n locale,\n })}\n />\n )}\n <div className=\"flex gap-3 mt-2 justify-end\">\n <Button\n size=\"lg\"\n variant=\"secondary\"\n loading={addToCartLoading}\n className=\"w-1/2 tablet:w-auto laptop:w-1/2 desktop:w-auto\"\n onClick={() => onAddToCart?.()}\n >\n {copyWriting?.addToCart}\n </Button>\n <Button\n size=\"lg\"\n loading={buyNowLoading}\n variant=\"primary\"\n className=\"w-1/2 tablet:w-auto laptop:w-1/2 desktop:w-auto\"\n onClick={() => onBuyNow?.()}\n >\n {copyWriting?.shopNow}\n </Button>\n </div>\n </div>\n </GridItem>\n </Grid>\n </div>\n </div>\n )\n}\n\nconst useRecommendBuyProducts = () => {\n const { bundle, variant, checkedBundle, freeGift, checkedGift, exchangePurchase, checkedExchangePurchase } =\n useBizProductContext()\n let bundleVariant = undefined\n let giftVariant = undefined\n let exchangeVariant = undefined\n const { bundleList } = bundle || {}\n\n const { giftList = [] } = freeGift || {}\n const { giftList: exchangeList = [] } = exchangePurchase || {}\n\n const availableBundleList =\n bundleList?.filter(bundle =>\n bundle.variants.slice(1, bundle.variants.length).every(v => v.variant.availableForSale)\n ) || []\n\n const [firstAvailableBundle] = availableBundleList\n bundleVariant = checkedBundle || firstAvailableBundle\n\n const [firstAvailableGift] = giftList?.filter(gift => gift.availableForSale)\n giftVariant = checkedGift || firstAvailableGift\n\n const [firstAvailableExchange] = exchangeList?.filter(exchange => exchange.availableForSale)\n exchangeVariant = checkedExchangePurchase || firstAvailableExchange\n\n return { bundleVariant, giftVariant, exchangeVariant }\n}\n\nconst ProductBundleSummary = ({\n bundleOperation,\n bundleListItem,\n canOperate,\n status,\n}: {\n bundleOperation: (bundle?: BundleListItem) => void\n bundleListItem?: BundleListItem\n canOperate?: boolean\n status?: boolean\n}) => {\n const { locale = 'us' } = useAiuiContext()\n const { variant, setCheckedBundle } = useBizProductContext()\n const bundleVariants = bundleListItem?.variants.filter(v => v.variant.sku !== variant.sku)\n\n return (\n <div className=\"\">\n {bundleVariants?.map(bundleVariant => {\n return (\n <div className=\"flex items-center gap-4 justify-between\" key={bundleVariant.variant.id}>\n <div className=\"flex items-center gap-4\">\n <Picture\n source={bundleVariant?.variant?.image?.url}\n className=\"size-10 laptop:size-12 p-2 lg-desktop:size-16 object-cover border-1 border-[#E4E5E6] bg-[#EAEAEC] rounded-[5px] rounded-lg\"\n />\n <div className=\"flex flex-col gap-[6px] line-clamp-2 max-w-[178px] tablet:max-w-none\">\n <Text\n className=\"font-bold text-[14px] desktop:text-[16px] lg-desktop:text-[18px]\"\n html={bundleVariant.variant.product.title}\n />\n </div>\n </div>\n <div className=\"flex flex-col items-end gap-1 justify-center\">\n {!!bundleListItem && (\n <div className=\"flex items-center gap-1\">\n <Text\n className=\"text-base desktop:text-2xl font-bold\"\n html={formatPrice({\n amount: bundleVariant?.price || 0,\n locale,\n currencyCode: bundleVariant.variant?.price?.currencyCode || '',\n })}\n />\n <Text\n className=\"text-base desktop:text-2xl font-bold line-through text-[#6D6D6F]\"\n html={formatPrice({\n amount: bundleVariant.variant.price.amount || 0,\n locale,\n currencyCode: bundleVariant.variant?.price?.currencyCode || '',\n })}\n />\n </div>\n )}\n {canOperate && (\n <Button\n size=\"icon\"\n variant=\"link\"\n onClick={() => {\n setCheckedBundle?.(status ? undefined : bundleListItem)\n bundleOperation?.(bundleListItem)\n }}\n className=\"shrink-0 size-auto underline\"\n >\n {!!status ? 'Remove' : 'Add'}\n </Button>\n )}\n </div>\n </div>\n )\n })}\n </div>\n )\n}\n\nconst ProductGiftSummary = ({\n giftOperation,\n gift,\n status,\n canOperate,\n}: {\n giftOperation: (gift?: ProductVariant) => void\n gift?: ProductVariant\n status?: boolean\n canOperate?: boolean\n}) => {\n const { locale = 'us' } = useAiuiContext()\n const { freeGift, setCheckedGift } = useBizProductContext()\n const { freeLabel, count } = freeGift || {}\n\n return (\n <div className=\"flex items-center justify-between\">\n <div className=\"flex items-center gap-4\">\n <Picture\n source={gift?.image?.url}\n className=\"size-10 laptop:size-12 p-2 lg-desktop:size-16 object-cover border-1 border-[#E4E5E6] bg-[#EAEAEC] rounded-[5px] rounded-lg\"\n />\n <div className=\"flex flex-col gap-[6px] max-w-[178px] tablet:max-w-none\">\n <Text\n className=\"font-bold text-[14px] line-clamp-2 desktop:text-[16px] lg-desktop:text-[18px]\"\n html={gift?.product?.title}\n />\n <Text\n className=\"text-[12px] laptop:text-[14px] desktop:text-[18px] font-bold text-[#6D6D6F]\"\n html={`x${count} | ${freeLabel}`}\n />\n </div>\n </div>\n <div className=\"flex flex-col items-end gap-2 justify-center\">\n {!!gift && (\n <div className=\"flex items-center gap-1\">\n <Text className=\"text-base desktop:text-2xl font-bold\" html={freeLabel} />\n <Text\n className=\"text-base desktop:text-2xl font-bold line-through text-[#6D6D6F]\"\n html={formatPrice({\n amount: gift.price.amount,\n locale,\n currencyCode: gift.price.currencyCode,\n })}\n />\n </div>\n )}\n {canOperate && (\n <Button\n size=\"icon\"\n variant=\"link\"\n onClick={() => {\n setCheckedGift?.(status ? undefined : gift)\n giftOperation(gift)\n }}\n className=\"shrink-0 size-auto underline\"\n >\n {status ? 'Remove' : 'Add'}\n </Button>\n )}\n </div>\n </div>\n )\n}\n\nconst ProductExchangeSummary = ({\n exchangeOperation,\n exchange,\n canOperate,\n status,\n}: {\n exchangeOperation: (exchange?: ProductVariant) => void\n exchange?: ProductVariant & { finalPrice?: ProductPrice }\n canOperate?: boolean\n status?: boolean\n}) => {\n const { locale = 'us' } = useAiuiContext()\n const { setCheckedExchangePurchase } = useBizProductContext()\n\n return (\n <div className=\"flex items-center justify-between\">\n <div className=\"flex items-center gap-4\">\n <Picture\n source={exchange?.image?.url}\n className=\"size-10 laptop:size-12 p-2 lg-desktop:size-16 object-cover border-1 border-[#E4E5E6] bg-[#EAEAEC] rounded-[5px] rounded-lg\"\n />\n <div className=\"flex flex-col gap-[6px] max-w-[178px] tablet:max-w-none\">\n <Text\n className=\"font-bold text-[14px] line-clamp-2 desktop:text-[16px] lg-desktop:text-[18px]\"\n html={exchange?.product?.title}\n />\n <Text className=\"text-[12px] laptop:text-[14px] desktop:text-[18px] font-bold text-[#6D6D6F]\" />\n </div>\n </div>\n <div className=\"flex flex-col items-end gap-2 justify-center\">\n {!!exchange && (\n <div className=\"flex items-center gap-1\">\n <Text\n className=\"text-base desktop:text-2xl font-bold\"\n html={formatPrice({\n amount: exchange.finalPrice?.amount || 0,\n locale,\n currencyCode: exchange.price.currencyCode,\n })}\n />\n <Text\n className=\"text-base desktop:text-2xl font-bold line-through text-[#6D6D6F]\"\n html={formatPrice({\n amount: exchange.price?.amount || 0,\n locale,\n currencyCode: exchange.price.currencyCode,\n })}\n />\n </div>\n )}\n {canOperate && (\n <Button\n size=\"icon\"\n variant=\"link\"\n onClick={() => {\n setCheckedExchangePurchase?.(status ? undefined : exchange)\n exchangeOperation(exchange)\n }}\n className=\"shrink-0 size-auto underline\"\n >\n {status ? 'Remove' : 'Add'}\n </Button>\n )}\n </div>\n </div>\n )\n}\n\nexport default ProductSummary\n"],
5
+ "mappings": "2jBAAA,IAAAA,GAAA,GAAAC,EAAAD,GAAA,aAAAE,KAAA,eAAAC,GAAAH,IA0EU,IAAAI,EAAA,6BA1EVC,EAA0E,qCAE1EC,EAAqC,uCACrCC,EAA6C,iBAC7CC,EAA4B,0BAC5BC,EAA+B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,QACC,UAAU,uCACV,QAAM,eAAY,CAChB,OAAQA,EAAS,YAAY,QAAU,EACvC,OAAAzC,EACA,aAAcyC,EAAS,MAAM,YAC/B,CAAC,EACH,KACA,OAAC,QACC,UAAU,mEACV,QAAM,eAAY,CAChB,OAAQA,EAAS,OAAO,QAAU,EAClC,OAAAzC,EACA,aAAcyC,EAAS,MAAM,YAC/B,CAAC,EACH,GACF,EAEDc,MACC,OAAC,UACC,KAAK,OACL,QAAQ,OACR,QAAS,IAAM,CACbtC,IAA6BuC,EAAS,OAAYf,CAAQ,EAC1DoB,EAAkBpB,CAAQ,CAC5B,EACA,UAAU,+BAET,SAAAe,EAAS,SAAW,MACvB,GAEJ,GACF,CAEJ,EAEA,IAAOpE,GAAQW",
6
+ "names": ["ProductSummary_exports", "__export", "ProductSummary_default", "__toCommonJS", "import_jsx_runtime", "import_components", "import_BizProductProvider", "import_react", "import_utils", "import_AiuiProvider", "import_helpers", "import_decimal", "import_textFormat", "ProductSummary", "locale", "copyWriting", "product", "variant", "finalPrice", "comparePrice", "coupon", "selectedOptions", "selectedVariants", "totalSavings", "onAddToCart", "onBuyNow", "savingDetail", "checkedBundle", "joinedRecommendBuyProducts", "setJoinedRecommendBuyProducts", "setCheckedGift", "setCheckedExchangePurchase", "setCheckedBundle", "setSavingDetail", "addToCartLoading", "buyNowLoading", "profile", "currentProductVariant", "summaryFinalPrice", "currentBundleVariant", "v", "currentBundlePrice", "Decimal", "currentProductPrice", "bundleVariant", "giftVariant", "exchangeVariant", "useRecommendBuyProducts", "initialRecommendBuyProducts", "setInitialRecommendBuyProducts", "ProductGiftSummary", "gift", "ProductBundleSummary", "bundle", "ProductExchangeSummary", "exchange", "freeGift", "checkedGift", "exchangePurchase", "checkedExchangePurchase", "bundleList", "giftList", "exchangeList", "availableBundleList", "firstAvailableBundle", "firstAvailableGift", "firstAvailableExchange", "bundleOperation", "bundleListItem", "canOperate", "status", "bundleVariants", "giftOperation", "freeLabel", "count", "exchangeOperation"]
7
7
  }
@@ -1,2 +1,2 @@
1
- "use strict";var T=Object.create;var m=Object.defineProperty;var P=Object.getOwnPropertyDescriptor;var B=Object.getOwnPropertyNames;var F=Object.getPrototypeOf,M=Object.prototype.hasOwnProperty;var A=(e,t)=>{for(var o in t)m(e,o,{get:t[o],enumerable:!0})},g=(e,t,o,c)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of B(t))!M.call(e,r)&&r!==o&&m(e,r,{get:()=>t[r],enumerable:!(c=P(t,r))||c.enumerable});return e};var z=(e,t,o)=>(o=e!=null?T(F(e)):{},g(t||!e||!e.__esModule?m(o,"default",{value:e,enumerable:!0}):o,e)),L=e=>g(m({},"__esModule",{value:!0}),e);var O={};A(O,{default:()=>G});module.exports=L(O);var a=require("react/jsx-runtime"),l=require("../../../../../components"),v=require("../../../../AiuiProvider/index.js"),f=require("../../../BizProductProvider.js"),s=require("react"),n=require("../../../utils"),C=z(require("decimal.js")),p=require("../../../utils/textFormat");const D=()=>{const{copyWriting:e,locale:t="us"}=(0,v.useAiuiContext)(),{variant:o,finalPrice:c,totalSavings:r,memberFunctionResult:x,isLogin:d,comparePrice:u,onAddToCart:y,onBuyNow:N,savingDetail:b,coupon:R,addToCartLoading:S,buyNowLoading:w}=(0,f.useBizProductContext)(),W=(0,s.useMemo)(()=>new C.default(u).minus(b.freeGift).toNumber(),[u,b]),i=Math.max(x?.withCouponMemberTotalSave??0,x?.withoutCouponMaxMemberTotalSave??0),h=(0,s.useMemo)(()=>(0,p.replaceTemplate)(e?.totalSavings||"",{amount:(0,n.formatPrice)({amount:r,currencyCode:o.price.currencyCode,locale:t})}),[e?.totalSavings,r,o.price.currencyCode,t]),k=(0,s.useMemo)(()=>(0,p.replaceTemplate)(e?.memberSaving||"",{amount:(0,n.formatPrice)({amount:i,currencyCode:o.price.currencyCode,locale:t})}),[e?.memberSaving,i,o.price.currencyCode,t]);return(0,a.jsxs)("div",{className:"bg-white py-3 px-4 tablet:p-0 tablet:flex tablet:items-center tablet:gap-4",children:[o.availableForSale?(0,a.jsxs)("div",{className:"flex items-center justify-between tablet:flex-col desktop:items-end",children:[(0,a.jsxs)("div",{className:"flex items-center gap-1",children:[(0,a.jsx)(l.Text,{className:"text-xl font-bold !leading-[1.2] desktop:text-xl lg-desktop:text-2xl",html:(0,n.formatPrice)({amount:c,currencyCode:o.price.currencyCode,locale:t})}),(r>0||i>0&&d)&&(0,a.jsx)(l.Text,{className:"text-xl font-bold line-through text-[#999] !leading-[1.2] desktop:text-xl lg-desktop:text-2xl",html:(0,n.formatPrice)({amount:u,currencyCode:o.price.currencyCode,locale:t})})]}),(r>0||i>0&&d)&&(0,a.jsx)(l.Text,{className:"text-brand-0 text-base !leading-[1.2] font-bold desktop:text-xl lg-desktop:text-2xl",html:`${i>0&&d?k:h}`})]}):(0,a.jsx)(l.Text,{className:"text-[20px] font-bold text-[#999999]",html:e?.soldOut??"Sold Out"}),(0,a.jsxs)("div",{className:"flex items-center gap-2 mt-2 tablet:mt-0",children:[(0,a.jsx)(l.Button,{variant:"secondary",disabled:!o.availableForSale,size:"lg",className:"w-1/2 tablet:w-auto",onClick:()=>y?.(),loading:S,children:e?.addToCart??"Add to Cart"}),(0,a.jsx)(l.Button,{variant:"primary",disabled:!o.availableForSale,size:"lg",loading:w,className:"w-1/2 tablet:w-auto",onClick:()=>N?.(),children:e?.buyNow??"Buy Now"})]})]})};var G=D;
1
+ "use strict";var s=Object.defineProperty;var w=Object.getOwnPropertyDescriptor;var h=Object.getOwnPropertyNames;var k=Object.prototype.hasOwnProperty;var T=(t,e)=>{for(var o in e)s(t,o,{get:e[o],enumerable:!0})},P=(t,e,o,c)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of h(e))!k.call(t,r)&&r!==o&&s(t,r,{get:()=>e[r],enumerable:!(c=w(e,r))||c.enumerable});return t};var B=t=>P(s({},"__esModule",{value:!0}),t);var F={};T(F,{default:()=>A});module.exports=B(F);var a=require("react/jsx-runtime"),l=require("../../../../../components"),x=require("../../../../AiuiProvider/index.js"),b=require("../../../BizProductProvider.js"),d=require("react"),n=require("../../../utils"),O=require("decimal.js"),u=require("../../../utils/textFormat");const M=()=>{const{copyWriting:t,locale:e="us"}=(0,x.useAiuiContext)(),{variant:o,finalPrice:c,totalSavings:r,memberFunctionResult:p,isLogin:m,comparePrice:g,onAddToCart:v,onBuyNow:f,savingDetail:z,coupon:L,addToCartLoading:C,buyNowLoading:y}=(0,b.useBizProductContext)(),i=Math.max(p?.withCouponMemberTotalSave??0,p?.withoutCouponMaxMemberTotalSave??0),N=(0,d.useMemo)(()=>(0,u.replaceTemplate)(t?.totalSavings||"",{amount:(0,n.formatPrice)({amount:r,currencyCode:o.price.currencyCode,locale:e})}),[t?.totalSavings,r,o.price.currencyCode,e]),S=(0,d.useMemo)(()=>(0,u.replaceTemplate)(t?.memberSaving||"",{amount:(0,n.formatPrice)({amount:i,currencyCode:o.price.currencyCode,locale:e})}),[t?.memberSaving,i,o.price.currencyCode,e]);return(0,a.jsxs)("div",{className:"bg-white py-3 px-4 tablet:p-0 tablet:flex tablet:items-center tablet:gap-4",children:[o.availableForSale?(0,a.jsxs)("div",{className:"flex items-center justify-between tablet:flex-col desktop:items-end",children:[(0,a.jsxs)("div",{className:"flex items-center gap-1",children:[(0,a.jsx)(l.Text,{className:"text-xl font-bold !leading-[1.2] desktop:text-xl lg-desktop:text-2xl",html:(0,n.formatPrice)({amount:c,currencyCode:o.price.currencyCode,locale:e})}),(r>0||i>0&&m)&&(0,a.jsx)(l.Text,{className:"text-xl font-bold line-through text-[#999] !leading-[1.2] desktop:text-xl lg-desktop:text-2xl",html:(0,n.formatPrice)({amount:g,currencyCode:o.price.currencyCode,locale:e})})]}),(r>0||i>0&&m)&&(0,a.jsx)(l.Text,{className:"text-brand-0 text-base !leading-[1.2] font-bold desktop:text-xl lg-desktop:text-2xl",html:`${i>0&&m?S:N}`})]}):(0,a.jsx)(l.Text,{className:"text-[20px] font-bold text-[#999999]",html:t?.soldOut??"Sold Out"}),(0,a.jsxs)("div",{className:"flex items-center gap-2 mt-2 tablet:mt-0",children:[(0,a.jsx)(l.Button,{variant:"secondary",disabled:!o.availableForSale,size:"lg",className:"w-1/2 tablet:w-auto",onClick:()=>v?.(),loading:C,children:t?.addToCart??"Add to Cart"}),(0,a.jsx)(l.Button,{variant:"primary",disabled:!o.availableForSale,size:"lg",loading:y,className:"w-1/2 tablet:w-auto",onClick:()=>f?.(),children:t?.buyNow??"Buy Now"})]})]})};var A=M;
2
2
  //# sourceMappingURL=index.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../../src/biz-components/Listing/components/PurchaseBar/ProductActions/index.tsx"],
4
- "sourcesContent": ["import { Text, Button } from '../../../../../components'\nimport { useAiuiContext } from '../../../../AiuiProvider/index.js'\nimport { useBizProductContext } from '../../../BizProductProvider.js'\nimport { useMemo } from 'react'\nimport { formatPrice } from '../../../utils'\nimport Decimal from 'decimal.js'\nimport { replaceTemplate } from '../../../utils/textFormat'\n\nconst ProductActions = () => {\n const { copyWriting, locale = 'us' } = useAiuiContext()\n const {\n variant,\n finalPrice,\n totalSavings,\n memberFunctionResult,\n isLogin,\n comparePrice,\n onAddToCart,\n onBuyNow,\n savingDetail,\n coupon,\n addToCartLoading,\n buyNowLoading,\n } = useBizProductContext()\n\n const comparePriceRemovedFreeGift = useMemo(\n () => new Decimal(comparePrice).minus(savingDetail.freeGift).toNumber(),\n [comparePrice, savingDetail]\n )\n\n const memberPriceSave = Math.max(\n memberFunctionResult?.withCouponMemberTotalSave ?? 0,\n memberFunctionResult?.withoutCouponMaxMemberTotalSave ?? 0\n )\n\n const totalSavingsText = useMemo(() => {\n return replaceTemplate(copyWriting?.totalSavings || '', {\n amount: formatPrice({ amount: totalSavings, currencyCode: variant.price.currencyCode, locale }),\n })\n }, [copyWriting?.totalSavings, totalSavings, variant.price.currencyCode, locale])\n\n const memberPriceSaveText = useMemo(() => {\n return replaceTemplate(copyWriting?.memberSaving || '', {\n amount: formatPrice({ amount: memberPriceSave, currencyCode: variant.price.currencyCode, locale }),\n })\n }, [copyWriting?.memberSaving, memberPriceSave, variant.price.currencyCode, locale])\n\n return (\n <div className=\"bg-white py-3 px-4 tablet:p-0 tablet:flex tablet:items-center tablet:gap-4\">\n {variant.availableForSale ? (\n <div className=\"flex items-center justify-between tablet:flex-col desktop:items-end\">\n <div className=\"flex items-center gap-1\">\n <Text\n className=\"text-xl font-bold !leading-[1.2] desktop:text-xl lg-desktop:text-2xl\"\n html={formatPrice({ amount: finalPrice, currencyCode: variant.price.currencyCode, locale })}\n />\n {(totalSavings > 0 || memberPriceSave > 0 && isLogin ) && (\n <Text\n className=\"text-xl font-bold line-through text-[#999] !leading-[1.2] desktop:text-xl lg-desktop:text-2xl\"\n html={formatPrice({\n amount: comparePrice,\n currencyCode: variant.price.currencyCode,\n locale,\n })}\n />\n )}\n </div>\n {(totalSavings > 0 || (memberPriceSave > 0 && isLogin)) && (\n <Text\n className=\"text-brand-0 text-base !leading-[1.2] font-bold desktop:text-xl lg-desktop:text-2xl\"\n html={`${memberPriceSave > 0 && isLogin ? memberPriceSaveText : totalSavingsText}`}\n />\n )}\n </div>\n ) : (\n <Text className=\"text-[20px] font-bold text-[#999999]\" html={copyWriting?.soldOut ?? 'Sold Out'} />\n )}\n <div className=\"flex items-center gap-2 mt-2 tablet:mt-0\">\n <Button\n variant=\"secondary\"\n disabled={!variant.availableForSale}\n size=\"lg\"\n className=\"w-1/2 tablet:w-auto\"\n onClick={() => onAddToCart?.()}\n loading={addToCartLoading}\n >\n {copyWriting?.addToCart ?? 'Add to Cart'}\n </Button>\n <Button\n variant=\"primary\"\n disabled={!variant.availableForSale}\n size=\"lg\"\n loading={buyNowLoading}\n className=\"w-1/2 tablet:w-auto\"\n onClick={() => onBuyNow?.()}\n >\n {copyWriting?.buyNow ?? 'Buy Now'}\n </Button>\n </div>\n </div>\n )\n}\n\nexport default ProductActions\n"],
5
- "mappings": "0jBAAA,IAAAA,EAAA,GAAA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CAAE,OAAQC,EAAY,aAAcD,EAAQ,MAAM,aAAc,OAAAD,CAAO,CAAC,EAC5F,GACEG,EAAe,GAAKY,EAAkB,GAAKV,OAC3C,OAAC,QACC,UAAU,gGACV,QAAM,eAAY,CAChB,OAAQC,EACR,aAAcL,EAAQ,MAAM,aAC5B,OAAAD,CACF,CAAC,EACH,GAEJ,GACEG,EAAe,GAAMY,EAAkB,GAAKV,OAC5C,OAAC,QACC,UAAU,sFACV,KAAM,GAAGU,EAAkB,GAAKV,EAAUY,EAAsBD,CAAgB,GAClF,GAEJ,KAEA,OAAC,QAAK,UAAU,uCAAuC,KAAMjB,GAAa,SAAW,WAAY,KAEnG,QAAC,OAAI,UAAU,2CACb,oBAAC,UACC,QAAQ,YACR,SAAU,CAACE,EAAQ,iBACnB,KAAK,KACL,UAAU,sBACV,QAAS,IAAMM,IAAc,EAC7B,QAASI,EAER,SAAAZ,GAAa,WAAa,cAC7B,KACA,OAAC,UACC,QAAQ,UACR,SAAU,CAACE,EAAQ,iBACnB,KAAK,KACL,QAASW,EACT,UAAU,sBACV,QAAS,IAAMJ,IAAW,EAEzB,SAAAT,GAAa,QAAU,UAC1B,GACF,GACF,CAEJ,EAEA,IAAOX,EAAQU",
6
- "names": ["ProductActions_exports", "__export", "ProductActions_default", "__toCommonJS", "import_jsx_runtime", "import_components", "import_AiuiProvider", "import_BizProductProvider", "import_react", "import_utils", "import_decimal", "import_textFormat", "ProductActions", "copyWriting", "locale", "variant", "finalPrice", "totalSavings", "memberFunctionResult", "isLogin", "comparePrice", "onAddToCart", "onBuyNow", "savingDetail", "coupon", "addToCartLoading", "buyNowLoading", "comparePriceRemovedFreeGift", "Decimal", "memberPriceSave", "totalSavingsText", "memberPriceSaveText"]
4
+ "sourcesContent": ["import { Text, Button } from '../../../../../components'\nimport { useAiuiContext } from '../../../../AiuiProvider/index.js'\nimport { useBizProductContext } from '../../../BizProductProvider.js'\nimport { useMemo } from 'react'\nimport { formatPrice } from '../../../utils'\nimport Decimal from 'decimal.js'\nimport { replaceTemplate } from '../../../utils/textFormat'\n\nconst ProductActions = () => {\n const { copyWriting, locale = 'us' } = useAiuiContext()\n const {\n variant,\n finalPrice,\n totalSavings,\n memberFunctionResult,\n isLogin,\n comparePrice,\n onAddToCart,\n onBuyNow,\n savingDetail,\n coupon,\n addToCartLoading,\n buyNowLoading,\n } = useBizProductContext()\n\n const memberPriceSave = Math.max(\n memberFunctionResult?.withCouponMemberTotalSave ?? 0,\n memberFunctionResult?.withoutCouponMaxMemberTotalSave ?? 0\n )\n\n const totalSavingsText = useMemo(() => {\n return replaceTemplate(copyWriting?.totalSavings || '', {\n amount: formatPrice({ amount: totalSavings, currencyCode: variant.price.currencyCode, locale }),\n })\n }, [copyWriting?.totalSavings, totalSavings, variant.price.currencyCode, locale])\n\n const memberPriceSaveText = useMemo(() => {\n return replaceTemplate(copyWriting?.memberSaving || '', {\n amount: formatPrice({ amount: memberPriceSave, currencyCode: variant.price.currencyCode, locale }),\n })\n }, [copyWriting?.memberSaving, memberPriceSave, variant.price.currencyCode, locale])\n\n return (\n <div className=\"bg-white py-3 px-4 tablet:p-0 tablet:flex tablet:items-center tablet:gap-4\">\n {variant.availableForSale ? (\n <div className=\"flex items-center justify-between tablet:flex-col desktop:items-end\">\n <div className=\"flex items-center gap-1\">\n <Text\n className=\"text-xl font-bold !leading-[1.2] desktop:text-xl lg-desktop:text-2xl\"\n html={formatPrice({ amount: finalPrice, currencyCode: variant.price.currencyCode, locale })}\n />\n {(totalSavings > 0 || memberPriceSave > 0 && isLogin ) && (\n <Text\n className=\"text-xl font-bold line-through text-[#999] !leading-[1.2] desktop:text-xl lg-desktop:text-2xl\"\n html={formatPrice({\n amount: comparePrice,\n currencyCode: variant.price.currencyCode,\n locale,\n })}\n />\n )}\n </div>\n {(totalSavings > 0 || (memberPriceSave > 0 && isLogin)) && (\n <Text\n className=\"text-brand-0 text-base !leading-[1.2] font-bold desktop:text-xl lg-desktop:text-2xl\"\n html={`${memberPriceSave > 0 && isLogin ? memberPriceSaveText : totalSavingsText}`}\n />\n )}\n </div>\n ) : (\n <Text className=\"text-[20px] font-bold text-[#999999]\" html={copyWriting?.soldOut ?? 'Sold Out'} />\n )}\n <div className=\"flex items-center gap-2 mt-2 tablet:mt-0\">\n <Button\n variant=\"secondary\"\n disabled={!variant.availableForSale}\n size=\"lg\"\n className=\"w-1/2 tablet:w-auto\"\n onClick={() => onAddToCart?.()}\n loading={addToCartLoading}\n >\n {copyWriting?.addToCart ?? 'Add to Cart'}\n </Button>\n <Button\n variant=\"primary\"\n disabled={!variant.availableForSale}\n size=\"lg\"\n loading={buyNowLoading}\n className=\"w-1/2 tablet:w-auto\"\n onClick={() => onBuyNow?.()}\n >\n {copyWriting?.buyNow ?? 'Buy Now'}\n </Button>\n </div>\n </div>\n )\n}\n\nexport default ProductActions\n"],
5
+ "mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,aAAAE,IAAA,eAAAC,EAAAH,GA8CU,IAAAI,EAAA,6BA9CVC,EAA6B,qCAC7BC,EAA+B,6CAC/BC,EAAqC,0CACrCC,EAAwB,iBACxBC,EAA4B,0BAC5BC,EAAoB,sBACpBC,EAAgC,qCAEhC,MAAMC,EAAiB,IAAM,CAC3B,KAAM,CAAE,YAAAC,EAAa,OAAAC,EAAS,IAAK,KAAI,kBAAe,EAChD,CACJ,QAAAC,EACA,WAAAC,EACA,aAAAC,EACA,qBAAAC,EACA,QAAAC,EACA,aAAAC,EACA,YAAAC,EACA,SAAAC,EACA,aAAAC,EACA,OAAAC,EACA,iBAAAC,EACA,cAAAC,CACF,KAAI,wBAAqB,EAEnBC,EAAkB,KAAK,IAC3BT,GAAsB,2BAA6B,EACnDA,GAAsB,iCAAmC,CAC3D,EAEMU,KAAmB,WAAQ,OACxB,mBAAgBf,GAAa,cAAgB,GAAI,CACtD,UAAQ,eAAY,CAAE,OAAQI,EAAc,aAAcF,EAAQ,MAAM,aAAc,OAAAD,CAAO,CAAC,CAChG,CAAC,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__toCommonJS", "import_jsx_runtime", "import_components", "import_AiuiProvider", "import_BizProductProvider", "import_react", "import_utils", "import_decimal", "import_textFormat", "ProductActions", "copyWriting", "locale", "variant", "finalPrice", "totalSavings", "memberFunctionResult", "isLogin", "comparePrice", "onAddToCart", "onBuyNow", "savingDetail", "coupon", "addToCartLoading", "buyNowLoading", "memberPriceSave", "totalSavingsText", "memberPriceSaveText"]
7
7
  }
@@ -1,2 +1,2 @@
1
- "use strict";var j=Object.create;var d=Object.defineProperty;var F=Object.getOwnPropertyDescriptor;var J=Object.getOwnPropertyNames;var K=Object.getPrototypeOf,Q=Object.prototype.hasOwnProperty;var V=(e,o)=>{for(var t in o)d(e,t,{get:o[t],enumerable:!0})},p=(e,o,t,n)=>{if(o&&typeof o=="object"||typeof o=="function")for(let r of J(o))!Q.call(e,r)&&r!==t&&d(e,r,{get:()=>o[r],enumerable:!(n=F(o,r))||n.enumerable});return e};var E=(e,o,t)=>(t=e!=null?j(K(e)):{},p(o||!e||!e.__esModule?d(t,"default",{value:e,enumerable:!0}):t,e)),H=e=>p(d({},"__esModule",{value:!0}),e);var W={};V(W,{default:()=>U});module.exports=H(W);var i=require("react/jsx-runtime"),m=require("../AiuiProvider/index.js"),c=require("./components/index.js"),u=E(require("./BizProductProvider.js")),y=require("./components/index.js"),a=require("react-responsive");const l=({product:e,renderRating:o,variant:t,selectedOptions:n,setSelectedOptions:r,isLogin:X,finalPrice:f,coupon:P,comparePrice:v,totalSavings:C,savingDetail:S,freeGift:g,bundle:h,checkedBundle:k,checkedGift:B,setCheckedBundle:N,setCheckedGift:x,compareData:I,selectedVariants:A,onAddToCart:D,onBuyNow:b,openModal:w,setSavingDetail:M,openSignInPopup:R,openAuthCodePopup:z,renderAffirm:G,renderKlarna:L,renderPaypal:O})=>{const{locale:Y}=(0,m.useAiuiContext)(),s=(0,a.useMediaQuery)({query:"(max-width: 768px)"}),T=(0,a.useMediaQuery)({query:"(min-width: 1440px)"});return(0,i.jsx)(u.default,{product:e,isMobile:s,isDesktop:T,freeGift:g,renderRating:o,finalPrice:f,comparePrice:v,totalSavings:C,savingDetail:S,variant:t,selectedOptions:n,setSelectedOptions:r,bundle:h,coupon:P,checkedBundle:k,checkedGift:B,setCheckedBundle:N,setCheckedGift:x,compareData:I,selectedVariants:A,onAddToCart:D,onBuyNow:b,openModal:w,setSavingDetail:M,openSignInPopup:R,openAuthCodePopup:z,renderAffirm:G,renderKlarna:L,renderPaypal:O,children:(0,i.jsxs)("div",{id:"ipc-listing",children:[(0,i.jsx)(c.PurchaseBar,{onSpyNavItemClick:q=>{console.log(q)}}),s&&(0,i.jsx)("div",{className:"fixed bottom-0 left-0 w-full z-[60]",children:(0,i.jsx)(c.ProductActions,{})}),(0,i.jsx)(y.ProductCard,{})]})})};l.displayName="Listing";var U=l;
1
+ "use strict";var T=Object.create;var c=Object.defineProperty;var q=Object.getOwnPropertyDescriptor;var j=Object.getOwnPropertyNames;var F=Object.getPrototypeOf,J=Object.prototype.hasOwnProperty;var Q=(e,t)=>{for(var o in t)c(e,o,{get:t[o],enumerable:!0})},p=(e,t,o,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of j(t))!J.call(e,n)&&n!==o&&c(e,n,{get:()=>t[n],enumerable:!(r=q(t,n))||r.enumerable});return e};var V=(e,t,o)=>(o=e!=null?T(F(e)):{},p(t||!e||!e.__esModule?c(o,"default",{value:e,enumerable:!0}):o,e)),E=e=>p(c({},"__esModule",{value:!0}),e);var K={};Q(K,{default:()=>H});module.exports=E(K);var i=require("react/jsx-runtime"),m=require("../AiuiProvider/index.js"),d=require("./components/index.js"),u=V(require("./BizProductProvider.js")),y=require("./components/index.js"),s=require("react-responsive");const l=({product:e,renderRating:t,variant:o,selectedOptions:r,setSelectedOptions:n,isLogin:U,finalPrice:P,coupon:f,comparePrice:v,totalSavings:C,savingDetail:S,freeGift:g,bundle:h,checkedBundle:k,checkedGift:B,setCheckedBundle:N,setCheckedGift:x,compareData:I,selectedVariants:D,onAddToCart:b,onBuyNow:w,openModal:A,setSavingDetail:M,openSignInPopup:R,openAuthCodePopup:z,renderInstallments:G})=>{const{locale:W}=(0,m.useAiuiContext)(),a=(0,s.useMediaQuery)({query:"(max-width: 768px)"}),L=(0,s.useMediaQuery)({query:"(min-width: 1440px)"});return(0,i.jsx)(u.default,{product:e,isMobile:a,isDesktop:L,freeGift:g,renderRating:t,finalPrice:P,comparePrice:v,totalSavings:C,savingDetail:S,variant:o,selectedOptions:r,setSelectedOptions:n,bundle:h,coupon:f,checkedBundle:k,checkedGift:B,setCheckedBundle:N,setCheckedGift:x,compareData:I,selectedVariants:D,onAddToCart:b,onBuyNow:w,openModal:A,setSavingDetail:M,openSignInPopup:R,openAuthCodePopup:z,renderInstallments:G,children:(0,i.jsxs)("div",{id:"ipc-listing",children:[(0,i.jsx)(d.PurchaseBar,{onSpyNavItemClick:O=>{console.log(O)}}),a&&(0,i.jsx)("div",{className:"fixed bottom-0 left-0 w-full z-[60]",children:(0,i.jsx)(d.ProductActions,{})}),(0,i.jsx)(y.ProductCard,{})]})})};l.displayName="Listing";var H=l;
2
2
  //# sourceMappingURL=index.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/biz-components/Listing/index.tsx"],
4
- "sourcesContent": ["import { useAiuiContext } from '../AiuiProvider/index.js'\nimport { PurchaseBar, ProductActions } from './components/index.js'\nimport type { ScrollSpyNavItem } from './components/PurchaseBar/types.js'\nimport BizProductProvider, { type ProductContextType } from './BizProductProvider.js'\nimport { ProductCard } from './components/index.js'\n\nimport { useMediaQuery } from 'react-responsive'\n\nconst Listing: React.FC<Omit<ProductContextType, 'joinedRecommendBuyProducts' | 'setJoinedRecommendBuyProducts'>> = ({\n product,\n renderRating,\n variant,\n selectedOptions,\n setSelectedOptions,\n isLogin,\n finalPrice,\n coupon,\n comparePrice,\n totalSavings,\n savingDetail,\n freeGift,\n bundle,\n checkedBundle,\n checkedGift,\n setCheckedBundle,\n setCheckedGift,\n compareData,\n selectedVariants,\n onAddToCart,\n onBuyNow,\n openModal,\n setSavingDetail,\n openSignInPopup,\n openAuthCodePopup,\n renderAffirm,\n renderKlarna,\n renderPaypal,\n}) => {\n const { locale } = useAiuiContext()\n\n const isMobile = useMediaQuery({ query: '(max-width: 768px)' })\n const isDesktop = useMediaQuery({ query: '(min-width: 1440px)' })\n\n const onSpyNavItemClick = (tab: ScrollSpyNavItem) => {\n console.log(tab)\n }\n\n return (\n <BizProductProvider\n product={product}\n isMobile={isMobile}\n isDesktop={isDesktop}\n freeGift={freeGift}\n renderRating={renderRating}\n finalPrice={finalPrice}\n comparePrice={comparePrice}\n totalSavings={totalSavings}\n savingDetail={savingDetail}\n variant={variant}\n selectedOptions={selectedOptions}\n setSelectedOptions={setSelectedOptions}\n bundle={bundle}\n coupon={coupon}\n checkedBundle={checkedBundle}\n checkedGift={checkedGift}\n setCheckedBundle={setCheckedBundle}\n setCheckedGift={setCheckedGift}\n compareData={compareData}\n selectedVariants={selectedVariants}\n onAddToCart={onAddToCart}\n onBuyNow={onBuyNow}\n openModal={openModal}\n setSavingDetail={setSavingDetail}\n openSignInPopup={openSignInPopup}\n openAuthCodePopup={openAuthCodePopup}\n renderAffirm={renderAffirm}\n renderKlarna={renderKlarna}\n renderPaypal={renderPaypal}\n >\n <div id=\"ipc-listing\">\n <PurchaseBar onSpyNavItemClick={onSpyNavItemClick} />\n {isMobile && (\n <div className=\"fixed bottom-0 left-0 w-full z-[60]\">\n <ProductActions />\n </div>\n )}\n <ProductCard />\n </div>\n </BizProductProvider>\n )\n}\n\nListing.displayName = 'Listing'\n\nexport default Listing\n"],
5
- "mappings": "0jBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,aAAAE,IAAA,eAAAC,EAAAH,GA+EM,IAAAI,EAAA,6BA/ENC,EAA+B,oCAC/BC,EAA4C,iCAE5CC,EAA4D,sCAC5DD,EAA4B,iCAE5BE,EAA8B,4BAE9B,MAAMC,EAA8G,CAAC,CACnH,QAAAC,EACA,aAAAC,EACA,QAAAC,EACA,gBAAAC,EACA,mBAAAC,EACA,QAAAC,EACA,WAAAC,EACA,OAAAC,EACA,aAAAC,EACA,aAAAC,EACA,aAAAC,EACA,SAAAC,EACA,OAAAC,EACA,cAAAC,EACA,YAAAC,EACA,iBAAAC,EACA,eAAAC,EACA,YAAAC,EACA,iBAAAC,EACA,YAAAC,EACA,SAAAC,EACA,UAAAC,EACA,gBAAAC,EACA,gBAAAC,EACA,kBAAAC,EACA,aAAAC,EACA,aAAAC,EACA,aAAAC,CACF,IAAM,CACJ,KAAM,CAAE,OAAAC,CAAO,KAAI,kBAAe,EAE5BC,KAAW,iBAAc,CAAE,MAAO,oBAAqB,CAAC,EACxDC,KAAY,iBAAc,CAAE,MAAO,qBAAsB,CAAC,EAMhE,SACE,OAAC,EAAAC,QAAA,CACC,QAAS/B,EACT,SAAU6B,EACV,UAAWC,EACX,SAAUnB,EACV,aAAcV,EACd,WAAYK,EACZ,aAAcE,EACd,aAAcC,EACd,aAAcC,EACd,QAASR,EACT,gBAAiBC,EACjB,mBAAoBC,EACpB,OAAQQ,EACR,OAAQL,EACR,cAAeM,EACf,YAAaC,EACb,iBAAkBC,EAClB,eAAgBC,EAChB,YAAaC,EACb,iBAAkBC,EAClB,YAAaC,EACb,SAAUC,EACV,UAAWC,EACX,gBAAiBC,EACjB,gBAAiBC,EACjB,kBAAmBC,EACnB,aAAcC,EACd,aAAcC,EACd,aAAcC,EAEd,oBAAC,OAAI,GAAG,cACN,oBAAC,eAAY,kBArCQK,GAA0B,CACnD,QAAQ,IAAIA,CAAG,CACjB,EAmCyD,EAClDH,MACC,OAAC,OAAI,UAAU,sCACb,mBAAC,mBAAe,EAClB,KAEF,OAAC,gBAAY,GACf,EACF,CAEJ,EAEA9B,EAAQ,YAAc,UAEtB,IAAOP,EAAQO",
6
- "names": ["Listing_exports", "__export", "Listing_default", "__toCommonJS", "import_jsx_runtime", "import_AiuiProvider", "import_components", "import_BizProductProvider", "import_react_responsive", "Listing", "product", "renderRating", "variant", "selectedOptions", "setSelectedOptions", "isLogin", "finalPrice", "coupon", "comparePrice", "totalSavings", "savingDetail", "freeGift", "bundle", "checkedBundle", "checkedGift", "setCheckedBundle", "setCheckedGift", "compareData", "selectedVariants", "onAddToCart", "onBuyNow", "openModal", "setSavingDetail", "openSignInPopup", "openAuthCodePopup", "renderAffirm", "renderKlarna", "renderPaypal", "locale", "isMobile", "isDesktop", "BizProductProvider", "tab"]
4
+ "sourcesContent": ["import { useAiuiContext } from '../AiuiProvider/index.js'\nimport { PurchaseBar, ProductActions } from './components/index.js'\nimport type { ScrollSpyNavItem } from './components/PurchaseBar/types.js'\nimport BizProductProvider, { type ProductContextType } from './BizProductProvider.js'\nimport { ProductCard } from './components/index.js'\n\nimport { useMediaQuery } from 'react-responsive'\n\nconst Listing: React.FC<Omit<ProductContextType, 'joinedRecommendBuyProducts' | 'setJoinedRecommendBuyProducts'>> = ({\n product,\n renderRating,\n variant,\n selectedOptions,\n setSelectedOptions,\n isLogin,\n finalPrice,\n coupon,\n comparePrice,\n totalSavings,\n savingDetail,\n freeGift,\n bundle,\n checkedBundle,\n checkedGift,\n setCheckedBundle,\n setCheckedGift,\n compareData,\n selectedVariants,\n onAddToCart,\n onBuyNow,\n openModal,\n setSavingDetail,\n openSignInPopup,\n openAuthCodePopup,\n renderInstallments,\n}) => {\n const { locale } = useAiuiContext()\n\n const isMobile = useMediaQuery({ query: '(max-width: 768px)' })\n const isDesktop = useMediaQuery({ query: '(min-width: 1440px)' })\n\n const onSpyNavItemClick = (tab: ScrollSpyNavItem) => {\n console.log(tab)\n }\n\n return (\n <BizProductProvider\n product={product}\n isMobile={isMobile}\n isDesktop={isDesktop}\n freeGift={freeGift}\n renderRating={renderRating}\n finalPrice={finalPrice}\n comparePrice={comparePrice}\n totalSavings={totalSavings}\n savingDetail={savingDetail}\n variant={variant}\n selectedOptions={selectedOptions}\n setSelectedOptions={setSelectedOptions}\n bundle={bundle}\n coupon={coupon}\n checkedBundle={checkedBundle}\n checkedGift={checkedGift}\n setCheckedBundle={setCheckedBundle}\n setCheckedGift={setCheckedGift}\n compareData={compareData}\n selectedVariants={selectedVariants}\n onAddToCart={onAddToCart}\n onBuyNow={onBuyNow}\n openModal={openModal}\n setSavingDetail={setSavingDetail}\n openSignInPopup={openSignInPopup}\n openAuthCodePopup={openAuthCodePopup}\n renderInstallments={renderInstallments}\n >\n <div id=\"ipc-listing\">\n <PurchaseBar onSpyNavItemClick={onSpyNavItemClick} />\n {isMobile && (\n <div className=\"fixed bottom-0 left-0 w-full z-[60]\">\n <ProductActions />\n </div>\n )}\n <ProductCard />\n </div>\n </BizProductProvider>\n )\n}\n\nListing.displayName = 'Listing'\n\nexport default Listing\n"],
5
+ "mappings": "0jBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,aAAAE,IAAA,eAAAC,EAAAH,GA2EM,IAAAI,EAAA,6BA3ENC,EAA+B,oCAC/BC,EAA4C,iCAE5CC,EAA4D,sCAC5DD,EAA4B,iCAE5BE,EAA8B,4BAE9B,MAAMC,EAA8G,CAAC,CACnH,QAAAC,EACA,aAAAC,EACA,QAAAC,EACA,gBAAAC,EACA,mBAAAC,EACA,QAAAC,EACA,WAAAC,EACA,OAAAC,EACA,aAAAC,EACA,aAAAC,EACA,aAAAC,EACA,SAAAC,EACA,OAAAC,EACA,cAAAC,EACA,YAAAC,EACA,iBAAAC,EACA,eAAAC,EACA,YAAAC,EACA,iBAAAC,EACA,YAAAC,EACA,SAAAC,EACA,UAAAC,EACA,gBAAAC,EACA,gBAAAC,EACA,kBAAAC,EACA,mBAAAC,CACF,IAAM,CACJ,KAAM,CAAE,OAAAC,CAAO,KAAI,kBAAe,EAE5BC,KAAW,iBAAc,CAAE,MAAO,oBAAqB,CAAC,EACxDC,KAAY,iBAAc,CAAE,MAAO,qBAAsB,CAAC,EAMhE,SACE,OAAC,EAAAC,QAAA,CACC,QAAS7B,EACT,SAAU2B,EACV,UAAWC,EACX,SAAUjB,EACV,aAAcV,EACd,WAAYK,EACZ,aAAcE,EACd,aAAcC,EACd,aAAcC,EACd,QAASR,EACT,gBAAiBC,EACjB,mBAAoBC,EACpB,OAAQQ,EACR,OAAQL,EACR,cAAeM,EACf,YAAaC,EACb,iBAAkBC,EAClB,eAAgBC,EAChB,YAAaC,EACb,iBAAkBC,EAClB,YAAaC,EACb,SAAUC,EACV,UAAWC,EACX,gBAAiBC,EACjB,gBAAiBC,EACjB,kBAAmBC,EACnB,mBAAoBC,EAEpB,oBAAC,OAAI,GAAG,cACN,oBAAC,eAAY,kBAnCQK,GAA0B,CACnD,QAAQ,IAAIA,CAAG,CACjB,EAiCyD,EAClDH,MACC,OAAC,OAAI,UAAU,sCACb,mBAAC,mBAAe,EAClB,KAEF,OAAC,gBAAY,GACf,EACF,CAEJ,EAEA5B,EAAQ,YAAc,UAEtB,IAAOP,EAAQO",
6
+ "names": ["Listing_exports", "__export", "Listing_default", "__toCommonJS", "import_jsx_runtime", "import_AiuiProvider", "import_components", "import_BizProductProvider", "import_react_responsive", "Listing", "product", "renderRating", "variant", "selectedOptions", "setSelectedOptions", "isLogin", "finalPrice", "coupon", "comparePrice", "totalSavings", "savingDetail", "freeGift", "bundle", "checkedBundle", "checkedGift", "setCheckedBundle", "setCheckedGift", "compareData", "selectedVariants", "onAddToCart", "onBuyNow", "openModal", "setSavingDetail", "openSignInPopup", "openAuthCodePopup", "renderInstallments", "locale", "isMobile", "isDesktop", "BizProductProvider", "tab"]
7
7
  }
@@ -1,2 +1,2 @@
1
- "use strict";"use client";var N=Object.create;var c=Object.defineProperty;var H=Object.getOwnPropertyDescriptor;var k=Object.getOwnPropertyNames;var P=Object.getPrototypeOf,g=Object.prototype.hasOwnProperty;var v=(t,e)=>{for(var s in e)c(t,s,{get:e[s],enumerable:!0})},m=(t,e,s,l)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of k(e))!g.call(t,r)&&r!==s&&c(t,r,{get:()=>e[r],enumerable:!(l=H(e,r))||l.enumerable});return t};var w=(t,e,s)=>(s=t!=null?N(P(t)):{},m(e||!t||!t.__esModule?c(s,"default",{value:t,enumerable:!0}):s,t)),T=t=>m(c({},"__esModule",{value:!0}),t);var E={};v(E,{default:()=>D});module.exports=T(E);var o=require("react/jsx-runtime"),a=w(require("react")),p=require("../../components/index.js"),n=require("../../helpers/utils.js"),d=require("../../shared/Styles.js"),f=require("../../hooks/useExposure.js");const y="image",L="product_hero",u=a.default.forwardRef(({data:t,className:e},s)=>{const{title:l,subtitle:r,ctaText:h,poster:b,mobPoster:x,ctaLink:_}=t,i=(0,a.useRef)(null);return(0,f.useExposure)(i,{componentType:y,componentName:L,componentTitle:l,componentDescription:r}),(0,a.useImperativeHandle)(s,()=>i.current),(0,o.jsxs)("section",{ref:i,"data-ui-component-id":"ProductHero",className:(0,n.cn)("product-hero flex w-full flex-col items-center justify-between gap-[32px] tablet:flex-row tablet:gap-[16px] lg-desktop:gap-[64px]",e),children:[(0,o.jsxs)("div",{className:"product-hero__content flex w-full flex-col items-start gap-[24px] tablet:basis-[42%] laptop:basis-[36%]",children:[(0,o.jsxs)("div",{className:"product-hero__text",children:[(0,o.jsx)(p.Heading,{as:"h3",size:4,html:l,className:"product-hero__title"}),(0,o.jsx)(p.Heading,{as:"h4",size:2,html:r,className:"product-hero__subtitle product-hero__subtitle--desktop mt-[4px] hidden laptop:mt-[12px] laptop:block desktop:mt-[16px]"}),(0,o.jsx)(p.Text,{as:"p",size:2,html:r,className:"product-hero__subtitle product-hero__subtitle--mobile mt-[4px] block laptop:mt-[12px] laptop:hidden desktop:mt-[16px]"})]}),(0,o.jsx)("a",{href:_,className:"product-hero__cta-link",children:(0,o.jsx)(p.Button,{className:"product-hero__cta-button w-fit",children:h})})]}),(0,o.jsx)(p.Picture,{className:"product-hero__image aspect-[358/360] flex-shrink tablet:aspect-[824/640] tablet:basis-[58%] laptop:basis-[64%]",source:`${b.url}, ${x.url} 768`})]})});u.displayName="ProductHero";var D=(0,d.withLayout)(u);
1
+ "use strict";"use client";var N=Object.create;var c=Object.defineProperty;var H=Object.getOwnPropertyDescriptor;var k=Object.getOwnPropertyNames;var P=Object.getPrototypeOf,g=Object.prototype.hasOwnProperty;var v=(t,e)=>{for(var s in e)c(t,s,{get:e[s],enumerable:!0})},m=(t,e,s,l)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of k(e))!g.call(t,r)&&r!==s&&c(t,r,{get:()=>e[r],enumerable:!(l=H(e,r))||l.enumerable});return t};var w=(t,e,s)=>(s=t!=null?N(P(t)):{},m(e||!t||!t.__esModule?c(s,"default",{value:t,enumerable:!0}):s,t)),T=t=>m(c({},"__esModule",{value:!0}),t);var E={};v(E,{default:()=>D});module.exports=T(E);var o=require("react/jsx-runtime"),a=w(require("react")),p=require("../../components/index.js"),n=require("../../helpers/utils.js"),d=require("../../shared/Styles.js"),f=require("../../hooks/useExposure.js");const y="image",L="product_hero",u=a.default.forwardRef(({data:t,className:e},s)=>{const{title:l,subtitle:r,ctaText:h,poster:b,mobPoster:x,ctaLink:_}=t,i=(0,a.useRef)(null);return(0,f.useExposure)(i,{componentType:y,componentName:L,componentTitle:l,componentDescription:r}),(0,a.useImperativeHandle)(s,()=>i.current),(0,o.jsxs)("section",{ref:i,"data-ui-component-id":"ProductHero",className:(0,n.cn)("product-hero flex w-full flex-col items-center justify-between gap-[32px] tablet:flex-row tablet:gap-[16px] lg-desktop:gap-[64px]",e),children:[(0,o.jsxs)("div",{className:"product-hero__content flex w-full flex-col items-start gap-[24px] tablet:basis-[42%] laptop:basis-[36%]",children:[(0,o.jsxs)("div",{className:"product-hero__text",children:[(0,o.jsx)(p.Heading,{as:"h3",size:4,html:l,className:"product-hero__title"}),(0,o.jsx)(p.Heading,{as:"h4",size:2,html:r,className:"product-hero__subtitle product-hero__subtitle--desktop mt-[4px] hidden laptop:mt-[12px] laptop:block desktop:mt-[16px]"}),(0,o.jsx)(p.Text,{as:"p",size:2,html:r,className:"product-hero__subtitle product-hero__subtitle--mobile mt-[4px] block laptop:mt-[12px] laptop:hidden desktop:mt-[16px]"})]}),(0,o.jsx)("a",{href:_,className:"product-hero__cta-link",children:(0,o.jsx)(p.Button,{className:"product-hero__cta-button w-fit",children:h})})]}),(0,o.jsx)(p.Picture,{className:"product-hero__image aspect-[358/360] flex-shrink tablet:aspect-[824/640] tablet:basis-[58%] laptop:basis-[64%]",source:`${b?.url}, ${x?.url} 768`})]})});u.displayName="ProductHero";var D=(0,d.withLayout)(u);
2
2
  //# sourceMappingURL=ProductHero.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/biz-components/ProductHero/ProductHero.tsx"],
4
- "sourcesContent": ["'use client'\nimport React, { useRef, useImperativeHandle } from 'react'\nimport { Heading, Button, Picture, Text } from '../../components/index.js'\nimport { cn } from '../../helpers/utils.js'\nimport { withLayout } from '../../shared/Styles.js'\nimport { useExposure } from '../../hooks/useExposure.js'\nimport type { ProductHeroProps } from './types.js'\n\nconst componentType = 'image'\nconst componentName = 'product_hero'\n\nconst ProductHero = React.forwardRef<HTMLDivElement, ProductHeroProps>(({ data, className }, ref) => {\n const { title, subtitle, ctaText, poster, mobPoster, ctaLink } = data\n\n const boxRef = useRef<HTMLDivElement>(null)\n\n useExposure(boxRef, {\n componentType,\n componentName,\n componentTitle: title,\n componentDescription: subtitle,\n })\n\n useImperativeHandle(ref, () => boxRef.current as HTMLDivElement)\n\n return (\n <section\n ref={boxRef}\n data-ui-component-id=\"ProductHero\"\n className={cn(\n 'product-hero flex w-full flex-col items-center justify-between gap-[32px] tablet:flex-row tablet:gap-[16px] lg-desktop:gap-[64px]',\n className\n )}\n >\n <div className=\"product-hero__content flex w-full flex-col items-start gap-[24px] tablet:basis-[42%] laptop:basis-[36%]\">\n <div className=\"product-hero__text\">\n <Heading as={'h3'} size={4} html={title} className=\"product-hero__title\" />\n <Heading\n as={'h4'}\n size={2}\n html={subtitle}\n className=\"product-hero__subtitle product-hero__subtitle--desktop mt-[4px] hidden laptop:mt-[12px] laptop:block desktop:mt-[16px]\"\n />\n <Text\n as={'p'}\n size={2}\n html={subtitle}\n className=\"product-hero__subtitle product-hero__subtitle--mobile mt-[4px] block laptop:mt-[12px] laptop:hidden desktop:mt-[16px]\"\n />\n </div>\n <a href={ctaLink} className=\"product-hero__cta-link\">\n <Button className=\"product-hero__cta-button w-fit\">{ctaText}</Button>\n </a>\n </div>\n <Picture\n className=\"product-hero__image aspect-[358/360] flex-shrink tablet:aspect-[824/640] tablet:basis-[58%] laptop:basis-[64%]\"\n source={`${poster.url}, ${mobPoster.url} 768`}\n />\n </section>\n )\n})\n\nProductHero.displayName = 'ProductHero'\n\nexport default withLayout(ProductHero)\n"],
5
- "mappings": "ukBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,aAAAE,IAAA,eAAAC,EAAAH,GAmCQ,IAAAI,EAAA,6BAlCRC,EAAmD,oBACnDC,EAA+C,qCAC/CC,EAAmB,kCACnBC,EAA2B,kCAC3BC,EAA4B,sCAG5B,MAAMC,EAAgB,QAChBC,EAAgB,eAEhBC,EAAc,EAAAC,QAAM,WAA6C,CAAC,CAAE,KAAAC,EAAM,UAAAC,CAAU,EAAGC,IAAQ,CACnG,KAAM,CAAE,MAAAC,EAAO,SAAAC,EAAU,QAAAC,EAAS,OAAAC,EAAQ,UAAAC,EAAW,QAAAC,CAAQ,EAAIR,EAE3DS,KAAS,UAAuB,IAAI,EAE1C,wBAAYA,EAAQ,CAClB,cAAAb,EACA,cAAAC,EACA,eAAgBM,EAChB,qBAAsBC,CACxB,CAAC,KAED,uBAAoBF,EAAK,IAAMO,EAAO,OAAyB,KAG7D,QAAC,WACC,IAAKA,EACL,uBAAqB,cACrB,aAAW,MACT,oIACAR,CACF,EAEA,qBAAC,OAAI,UAAU,0GACb,qBAAC,OAAI,UAAU,qBACb,oBAAC,WAAQ,GAAI,KAAM,KAAM,EAAG,KAAME,EAAO,UAAU,sBAAsB,KACzE,OAAC,WACC,GAAI,KACJ,KAAM,EACN,KAAMC,EACN,UAAU,yHACZ,KACA,OAAC,QACC,GAAI,IACJ,KAAM,EACN,KAAMA,EACN,UAAU,wHACZ,GACF,KACA,OAAC,KAAE,KAAMI,EAAS,UAAU,yBAC1B,mBAAC,UAAO,UAAU,iCAAkC,SAAAH,EAAQ,EAC9D,GACF,KACA,OAAC,WACC,UAAU,iHACV,OAAQ,GAAGC,EAAO,GAAG,KAAKC,EAAU,GAAG,OACzC,GACF,CAEJ,CAAC,EAEDT,EAAY,YAAc,cAE1B,IAAOV,KAAQ,cAAWU,CAAW",
4
+ "sourcesContent": ["'use client'\nimport React, { useRef, useImperativeHandle } from 'react'\nimport { Heading, Button, Picture, Text } from '../../components/index.js'\nimport { cn } from '../../helpers/utils.js'\nimport { withLayout } from '../../shared/Styles.js'\nimport { useExposure } from '../../hooks/useExposure.js'\nimport type { ProductHeroProps } from './types.js'\n\nconst componentType = 'image'\nconst componentName = 'product_hero'\n\nconst ProductHero = React.forwardRef<HTMLDivElement, ProductHeroProps>(({ data, className }, ref) => {\n const { title, subtitle, ctaText, poster, mobPoster, ctaLink } = data\n\n const boxRef = useRef<HTMLDivElement>(null)\n\n useExposure(boxRef, {\n componentType,\n componentName,\n componentTitle: title,\n componentDescription: subtitle,\n })\n\n useImperativeHandle(ref, () => boxRef.current as HTMLDivElement)\n\n return (\n <section\n ref={boxRef}\n data-ui-component-id=\"ProductHero\"\n className={cn(\n 'product-hero flex w-full flex-col items-center justify-between gap-[32px] tablet:flex-row tablet:gap-[16px] lg-desktop:gap-[64px]',\n className\n )}\n >\n <div className=\"product-hero__content flex w-full flex-col items-start gap-[24px] tablet:basis-[42%] laptop:basis-[36%]\">\n <div className=\"product-hero__text\">\n <Heading as={'h3'} size={4} html={title} className=\"product-hero__title\" />\n <Heading\n as={'h4'}\n size={2}\n html={subtitle}\n className=\"product-hero__subtitle product-hero__subtitle--desktop mt-[4px] hidden laptop:mt-[12px] laptop:block desktop:mt-[16px]\"\n />\n <Text\n as={'p'}\n size={2}\n html={subtitle}\n className=\"product-hero__subtitle product-hero__subtitle--mobile mt-[4px] block laptop:mt-[12px] laptop:hidden desktop:mt-[16px]\"\n />\n </div>\n <a href={ctaLink} className=\"product-hero__cta-link\">\n <Button className=\"product-hero__cta-button w-fit\">{ctaText}</Button>\n </a>\n </div>\n <Picture\n className=\"product-hero__image aspect-[358/360] flex-shrink tablet:aspect-[824/640] tablet:basis-[58%] laptop:basis-[64%]\"\n source={`${poster?.url}, ${mobPoster?.url} 768`}\n />\n </section>\n )\n})\n\nProductHero.displayName = 'ProductHero'\n\nexport default withLayout(ProductHero)\n"],
5
+ "mappings": "ukBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,aAAAE,IAAA,eAAAC,EAAAH,GAmCQ,IAAAI,EAAA,6BAlCRC,EAAmD,oBACnDC,EAA+C,qCAC/CC,EAAmB,kCACnBC,EAA2B,kCAC3BC,EAA4B,sCAG5B,MAAMC,EAAgB,QAChBC,EAAgB,eAEhBC,EAAc,EAAAC,QAAM,WAA6C,CAAC,CAAE,KAAAC,EAAM,UAAAC,CAAU,EAAGC,IAAQ,CACnG,KAAM,CAAE,MAAAC,EAAO,SAAAC,EAAU,QAAAC,EAAS,OAAAC,EAAQ,UAAAC,EAAW,QAAAC,CAAQ,EAAIR,EAE3DS,KAAS,UAAuB,IAAI,EAE1C,wBAAYA,EAAQ,CAClB,cAAAb,EACA,cAAAC,EACA,eAAgBM,EAChB,qBAAsBC,CACxB,CAAC,KAED,uBAAoBF,EAAK,IAAMO,EAAO,OAAyB,KAG7D,QAAC,WACC,IAAKA,EACL,uBAAqB,cACrB,aAAW,MACT,oIACAR,CACF,EAEA,qBAAC,OAAI,UAAU,0GACb,qBAAC,OAAI,UAAU,qBACb,oBAAC,WAAQ,GAAI,KAAM,KAAM,EAAG,KAAME,EAAO,UAAU,sBAAsB,KACzE,OAAC,WACC,GAAI,KACJ,KAAM,EACN,KAAMC,EACN,UAAU,yHACZ,KACA,OAAC,QACC,GAAI,IACJ,KAAM,EACN,KAAMA,EACN,UAAU,wHACZ,GACF,KACA,OAAC,KAAE,KAAMI,EAAS,UAAU,yBAC1B,mBAAC,UAAO,UAAU,iCAAkC,SAAAH,EAAQ,EAC9D,GACF,KACA,OAAC,WACC,UAAU,iHACV,OAAQ,GAAGC,GAAQ,GAAG,KAAKC,GAAW,GAAG,OAC3C,GACF,CAEJ,CAAC,EAEDT,EAAY,YAAc,cAE1B,IAAOV,KAAQ,cAAWU,CAAW",
6
6
  "names": ["ProductHero_exports", "__export", "ProductHero_default", "__toCommonJS", "import_jsx_runtime", "import_react", "import_components", "import_utils", "import_Styles", "import_useExposure", "componentType", "componentName", "ProductHero", "React", "data", "className", "ref", "title", "subtitle", "ctaText", "poster", "mobPoster", "ctaLink", "boxRef"]
7
7
  }
@@ -1,2 +1,2 @@
1
- "use strict";"use client";var D=Object.create;var x=Object.defineProperty;var E=Object.getOwnPropertyDescriptor;var H=Object.getOwnPropertyNames;var L=Object.getPrototypeOf,M=Object.prototype.hasOwnProperty;var W=(t,a)=>{for(var l in a)x(t,l,{get:a[l],enumerable:!0})},v=(t,a,l,c)=>{if(a&&typeof a=="object"||typeof a=="function")for(let p of H(a))!M.call(t,p)&&p!==l&&x(t,p,{get:()=>a[p],enumerable:!(c=E(a,p))||c.enumerable});return t};var P=(t,a,l)=>(l=t!=null?D(L(t)):{},v(a||!t||!t.__esModule?x(l,"default",{value:t,enumerable:!0}):l,t)),R=t=>v(x({},"__esModule",{value:!0}),t);var $={};W($,{default:()=>S});module.exports=R($);var e=require("react/jsx-runtime"),i=P(require("react")),n=require("../../components/index.js"),g=require("../../helpers/utils.js"),y=require("../../shared/Styles.js"),T=require("../../hooks/useExposure.js"),b=require("framer-motion");const z="image",A="tab_with_image",_=i.default.forwardRef(({data:t,className:a},l)=>{const{title:c,subtitle:p,desc:h,image:j,mobileImage:C,datalist:s=[]}=t,f=(0,i.useRef)(null);(0,T.useExposure)(f,{componentType:z,componentName:A,componentTitle:c,componentDescription:h}),(0,i.useImperativeHandle)(l,()=>f.current);const N=(r,o)=>{I(r),o.target.scrollIntoView({behavior:"smooth",inline:"center",block:"nearest"})},[m,I]=(0,i.useState)(0),u=(0,i.useRef)([]),[w,k]=(0,i.useState)({left:0,width:0});return(0,i.useEffect)(()=>{const r=u.current[m];if(r){const{offsetLeft:o,offsetWidth:d}=r;k({left:o,width:d})}},[m,s.length]),(0,e.jsxs)("section",{ref:f,"data-ui-component-id":"TabWithImage",className:(0,g.cn)("tab-with-image flex text-[#fff] l:gap-[24px] xl:flex-col min-md:justify-between min-l:gap-[20px]",a),children:[(0,e.jsxs)("div",{className:"tab-with-image__content inline-flex flex-col justify-center min-md:gap-[24px] laptop:basis-[36%]",children:[(0,e.jsxs)("div",{className:"tab-with-image__header",children:[(0,e.jsx)(n.Heading,{as:"h3",size:4,html:c,className:"tab-with-image__title"}),(0,e.jsx)(n.Text,{as:"p",size:1,html:h,className:"tab-with-image__description mt-[4px] text-[14px] tablet:text-[14px] laptop:text-[14px] desktop:text-[16px] lg-desktop:text-[18px]"})]}),(0,e.jsx)("div",{className:"tab-with-image__tabs-wrapper relative md:overflow-hidden md:overflow-x-scroll md:scrollbar-hidden",children:(0,e.jsxs)("div",{className:"tab-with-image__tabs relative inline-flex rounded-[24px] bg-[#1D1D1F] px-[4px] md:my-[24px]",children:[(0,e.jsx)("div",{className:"tab-with-image__slider absolute bottom-0 top-0 rounded-[24px] bg-white transition-all duration-300 ease-in-out",style:{left:w.left,width:w.width}}),s.map((r,o)=>(0,e.jsx)("div",{ref:d=>{u.current[o]=d},onClick:d=>N(o,d),className:(0,g.cn)("tab-with-image__tab relative z-10 cursor-pointer rounded-[24px] px-[20px] py-[10px] text-center text-[12px] font-medium transition-colors duration-300 md:px-[20px] md:py-[10px] min-xxl:px-[28px] min-xxl:py-[15px]",m===o?"tab-with-image__tab--active text-black":"text-white"),children:(0,e.jsx)(n.Heading,{as:"h1",size:1,html:r?.title,className:"tab-with-image__tab-title text-balance-normal !whitespace-nowrap md:text-[14px]"})},o))]})})]}),(0,e.jsx)("div",{className:"tab-with-image__image-wrapper relative w-full flex-shrink md:aspect-[358/360] min-xxl:aspect-[824/560] min-xxl:max-w-[824px] tablet:aspect-[704/360] laptop:aspect-[744/336] laptop:basis-[64%] desktop:aspect-[648/448]",children:(0,e.jsx)(b.AnimatePresence,{mode:"wait",children:s[m]&&(0,e.jsx)(b.motion.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.3},className:"tab-with-image__image-motion absolute left-0 top-0 w-full",children:(0,e.jsx)(n.Picture,{source:`${s[m].image.url} ,${s[m].imgPad?.url||s[m].image.url} 1440, ${s[m].imageMob?.url||s[m].image.url} 767`,alt:s[m].image.alt,className:"tab-with-image__image rounded-[16px] md:aspect-[358/360] min-xxl:aspect-[824/560] min-xxl:max-w-[824px] tablet:aspect-[704/360] laptop:aspect-[744/336] desktop:aspect-[648/448] "})},s[m].image.url)})})]})});_.displayName="TabWithImage";var S=(0,y.withLayout)(_);
1
+ "use strict";"use client";var D=Object.create;var x=Object.defineProperty;var E=Object.getOwnPropertyDescriptor;var H=Object.getOwnPropertyNames;var L=Object.getPrototypeOf,M=Object.prototype.hasOwnProperty;var W=(t,a)=>{for(var l in a)x(t,l,{get:a[l],enumerable:!0})},v=(t,a,l,c)=>{if(a&&typeof a=="object"||typeof a=="function")for(let p of H(a))!M.call(t,p)&&p!==l&&x(t,p,{get:()=>a[p],enumerable:!(c=E(a,p))||c.enumerable});return t};var P=(t,a,l)=>(l=t!=null?D(L(t)):{},v(a||!t||!t.__esModule?x(l,"default",{value:t,enumerable:!0}):l,t)),R=t=>v(x({},"__esModule",{value:!0}),t);var $={};W($,{default:()=>S});module.exports=R($);var e=require("react/jsx-runtime"),i=P(require("react")),n=require("../../components/index.js"),g=require("../../helpers/utils.js"),y=require("../../shared/Styles.js"),T=require("../../hooks/useExposure.js"),b=require("framer-motion");const z="image",A="tab_with_image",_=i.default.forwardRef(({data:t,className:a},l)=>{const{title:c,subtitle:p,desc:h,image:j,mobileImage:C,datalist:s=[]}=t,f=(0,i.useRef)(null);(0,T.useExposure)(f,{componentType:z,componentName:A,componentTitle:c,componentDescription:h}),(0,i.useImperativeHandle)(l,()=>f.current);const N=(r,o)=>{I(r),o.target.scrollIntoView({behavior:"smooth",inline:"center",block:"nearest"})},[m,I]=(0,i.useState)(0),u=(0,i.useRef)([]),[w,k]=(0,i.useState)({left:0,width:0});return(0,i.useEffect)(()=>{const r=u.current[m];if(r){const{offsetLeft:o,offsetWidth:d}=r;k({left:o,width:d})}},[m,s.length]),(0,e.jsxs)("section",{ref:f,"data-ui-component-id":"TabWithImage",className:(0,g.cn)("tab-with-image flex text-[#fff] l:gap-[24px] xl:flex-col min-md:justify-between min-l:gap-[20px]",a),children:[(0,e.jsxs)("div",{className:"tab-with-image__content inline-flex flex-col justify-center min-md:gap-[24px] laptop:basis-[36%]",children:[(0,e.jsxs)("div",{className:"tab-with-image__header",children:[(0,e.jsx)(n.Heading,{as:"h3",size:4,html:c,className:"tab-with-image__title"}),(0,e.jsx)(n.Text,{as:"p",size:1,html:h,className:"tab-with-image__description mt-[4px] text-[14px] tablet:text-[14px] laptop:text-[14px] desktop:text-[16px] lg-desktop:text-[18px]"})]}),(0,e.jsx)("div",{className:"tab-with-image__tabs-wrapper relative md:overflow-hidden md:overflow-x-scroll md:scrollbar-hidden",children:(0,e.jsxs)("div",{className:"tab-with-image__tabs relative inline-flex rounded-[24px] bg-[#1D1D1F] px-[4px] md:my-[24px]",children:[(0,e.jsx)("div",{className:"tab-with-image__slider absolute bottom-0 top-0 rounded-[24px] bg-white transition-all duration-300 ease-in-out",style:{left:w.left,width:w.width}}),s.map((r,o)=>(0,e.jsx)("div",{ref:d=>{u.current[o]=d},onClick:d=>N(o,d),className:(0,g.cn)("tab-with-image__tab relative z-10 cursor-pointer rounded-[24px] px-[20px] py-[10px] text-center text-[12px] font-medium transition-colors duration-300 md:px-[20px] md:py-[10px] min-xxl:px-[28px] min-xxl:py-[15px]",m===o?"tab-with-image__tab--active text-black":"text-white"),children:(0,e.jsx)(n.Heading,{as:"h1",size:1,html:r?.title,className:"tab-with-image__tab-title text-balance-normal !whitespace-nowrap md:text-[14px]"})},o))]})})]}),(0,e.jsx)("div",{className:"tab-with-image__image-wrapper relative w-full flex-shrink md:aspect-[358/360] min-xxl:aspect-[824/560] min-xxl:max-w-[824px] tablet:aspect-[704/360] laptop:aspect-[744/336] laptop:basis-[64%] desktop:aspect-[648/448]",children:(0,e.jsx)(b.AnimatePresence,{mode:"wait",children:s[m]&&(0,e.jsx)(b.motion.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.3},className:"tab-with-image__image-motion absolute left-0 top-0 w-full",children:(0,e.jsx)(n.Picture,{source:`${s[m].image?.url} ,${s[m].imgPad?.url||s[m].image?.url} 1440, ${s[m].imageMob?.url||s[m].image?.url} 767`,alt:s[m].image?.alt,className:"tab-with-image__image rounded-[16px] md:aspect-[358/360] min-xxl:aspect-[824/560] min-xxl:max-w-[824px] tablet:aspect-[704/360] laptop:aspect-[744/336] desktop:aspect-[648/448] "})},s[m].image?.url)})})]})});_.displayName="TabWithImage";var S=(0,y.withLayout)(_);
2
2
  //# sourceMappingURL=TabWithImage.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/biz-components/TabWithImage/TabWithImage.tsx"],
4
- "sourcesContent": ["'use client'\nimport React, { useState, useEffect, useRef, useImperativeHandle } from 'react'\nimport { Heading, Picture, Text } from '../../components/index.js'\nimport { cn } from '../../helpers/utils.js'\nimport { withLayout } from '../../shared/Styles.js'\nimport { useExposure } from '../../hooks/useExposure.js'\nimport type { TabWithImageProps, TabWithImageDataItem } from './types.js'\nimport { motion, AnimatePresence } from 'framer-motion'\n\nconst componentType = 'image'\nconst componentName = 'tab_with_image'\n\nconst TabWithImage = React.forwardRef<HTMLDivElement, TabWithImageProps>(({ data, className }, ref) => {\n const { title, subtitle, desc, image, mobileImage, datalist = [] } = data\n\n const boxRef = useRef<HTMLDivElement>(null)\n\n useExposure(boxRef, {\n componentType,\n componentName,\n componentTitle: title,\n componentDescription: desc,\n })\n\n useImperativeHandle(ref, () => boxRef.current as HTMLDivElement)\n\n const handleClick = (index: number, e: React.MouseEvent<HTMLDivElement>) => {\n setActiveIndex(index)\n ;(e.target as HTMLElement).scrollIntoView({\n behavior: 'smooth', // \u5E73\u6ED1\u6EDA\u52A8\n inline: 'center', // \u6A2A\u5411\u5C45\u4E2D\u5BF9\u9F50\n block: 'nearest', // \u5782\u76F4\u65B9\u5411\u4E0D\u52A8\n })\n }\n\n const [activeIndex, setActiveIndex] = useState(0)\n const tabRefs = useRef<Array<HTMLDivElement | null>>([]) // \u8BB0\u5F55\u6BCF\u4E2Atab\u7684\u4F4D\u7F6E\n const [sliderStyle, setSliderStyle] = useState({ left: 0, width: 0 })\n\n useEffect(() => {\n const current = tabRefs.current[activeIndex]\n if (current) {\n const { offsetLeft, offsetWidth } = current\n setSliderStyle({ left: offsetLeft, width: offsetWidth })\n }\n }, [activeIndex, datalist.length])\n\n return (\n <section\n ref={boxRef}\n data-ui-component-id=\"TabWithImage\"\n className={cn(\n 'tab-with-image flex text-[#fff] l:gap-[24px] xl:flex-col min-md:justify-between min-l:gap-[20px]',\n className\n )}\n >\n <div className=\"tab-with-image__content inline-flex flex-col justify-center min-md:gap-[24px] laptop:basis-[36%]\">\n <div className=\"tab-with-image__header\">\n <Heading as={'h3'} size={4} html={title} className=\"tab-with-image__title\" />\n <Text\n as={'p'}\n size={1}\n html={desc}\n className=\"tab-with-image__description mt-[4px] text-[14px] tablet:text-[14px] laptop:text-[14px] desktop:text-[16px] lg-desktop:text-[18px]\"\n />\n </div>\n\n <div className=\"tab-with-image__tabs-wrapper relative md:overflow-hidden md:overflow-x-scroll md:scrollbar-hidden\">\n <div className=\"tab-with-image__tabs relative inline-flex rounded-[24px] bg-[#1D1D1F] px-[4px] md:my-[24px]\">\n {/* \u6ED1\u52A8\u80CC\u666F */}\n <div\n className=\"tab-with-image__slider absolute bottom-0 top-0 rounded-[24px] bg-white transition-all duration-300 ease-in-out\"\n style={{\n left: sliderStyle.left,\n width: sliderStyle.width,\n }}\n />\n\n {/* Tab Items */}\n {datalist.map((item: TabWithImageDataItem, index: number) => (\n <div\n key={index}\n ref={el => {\n tabRefs.current[index] = el\n }}\n onClick={e => handleClick(index, e)}\n className={cn(\n 'tab-with-image__tab relative z-10 cursor-pointer rounded-[24px] px-[20px] py-[10px] text-center text-[12px] font-medium transition-colors duration-300 md:px-[20px] md:py-[10px] min-xxl:px-[28px] min-xxl:py-[15px]',\n activeIndex === index ? 'tab-with-image__tab--active text-black' : 'text-white'\n )}\n >\n <Heading\n as=\"h1\"\n size={1}\n html={item?.title}\n className=\"tab-with-image__tab-title text-balance-normal !whitespace-nowrap md:text-[14px]\"\n />\n </div>\n ))}\n </div>\n </div>\n </div>\n <div className=\"tab-with-image__image-wrapper relative w-full flex-shrink md:aspect-[358/360] min-xxl:aspect-[824/560] min-xxl:max-w-[824px] tablet:aspect-[704/360] laptop:aspect-[744/336] laptop:basis-[64%] desktop:aspect-[648/448]\">\n <AnimatePresence mode=\"wait\">\n {datalist[activeIndex] && (\n <motion.div\n key={datalist[activeIndex].image.url}\n {...({\n initial: { opacity: 0 },\n animate: { opacity: 1 },\n exit: { opacity: 0 },\n transition: { duration: 0.3 },\n } as any)}\n className=\"tab-with-image__image-motion absolute left-0 top-0 w-full\"\n >\n <Picture\n source={`${datalist[activeIndex].image.url} ,${datalist[activeIndex].imgPad?.url || datalist[activeIndex].image.url} 1440, ${datalist[activeIndex].imageMob?.url || datalist[activeIndex].image.url} 767`}\n alt={datalist[activeIndex].image.alt}\n className=\"tab-with-image__image rounded-[16px] md:aspect-[358/360] min-xxl:aspect-[824/560] min-xxl:max-w-[824px] tablet:aspect-[704/360] laptop:aspect-[744/336] desktop:aspect-[648/448] \"\n />\n </motion.div>\n )}\n </AnimatePresence>\n </div>\n </section>\n )\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AOX,KAAQ,cAAWW,CAAY",
4
+ "sourcesContent": ["'use client'\nimport React, { useState, useEffect, useRef, useImperativeHandle } from 'react'\nimport { Heading, Picture, Text } from '../../components/index.js'\nimport { cn } from '../../helpers/utils.js'\nimport { withLayout } from '../../shared/Styles.js'\nimport { useExposure } from '../../hooks/useExposure.js'\nimport type { TabWithImageProps, TabWithImageDataItem } from './types.js'\nimport { motion, AnimatePresence } from 'framer-motion'\n\nconst componentType = 'image'\nconst componentName = 'tab_with_image'\n\nconst TabWithImage = React.forwardRef<HTMLDivElement, TabWithImageProps>(({ data, className }, ref) => {\n const { title, subtitle, desc, image, mobileImage, datalist = [] } = data\n\n const boxRef = useRef<HTMLDivElement>(null)\n\n useExposure(boxRef, {\n componentType,\n componentName,\n componentTitle: title,\n componentDescription: desc,\n })\n\n useImperativeHandle(ref, () => boxRef.current as HTMLDivElement)\n\n const handleClick = (index: number, e: React.MouseEvent<HTMLDivElement>) => {\n setActiveIndex(index)\n ;(e.target as HTMLElement).scrollIntoView({\n behavior: 'smooth', // \u5E73\u6ED1\u6EDA\u52A8\n inline: 'center', // \u6A2A\u5411\u5C45\u4E2D\u5BF9\u9F50\n block: 'nearest', // \u5782\u76F4\u65B9\u5411\u4E0D\u52A8\n })\n }\n\n const [activeIndex, setActiveIndex] = useState(0)\n const tabRefs = useRef<Array<HTMLDivElement | null>>([]) // \u8BB0\u5F55\u6BCF\u4E2Atab\u7684\u4F4D\u7F6E\n const [sliderStyle, setSliderStyle] = useState({ left: 0, width: 0 })\n\n useEffect(() => {\n const current = tabRefs.current[activeIndex]\n if (current) {\n const { offsetLeft, offsetWidth } = current\n setSliderStyle({ left: offsetLeft, width: offsetWidth })\n }\n }, [activeIndex, datalist.length])\n\n return (\n <section\n ref={boxRef}\n data-ui-component-id=\"TabWithImage\"\n className={cn(\n 'tab-with-image flex text-[#fff] l:gap-[24px] xl:flex-col min-md:justify-between min-l:gap-[20px]',\n className\n )}\n >\n <div className=\"tab-with-image__content inline-flex flex-col justify-center min-md:gap-[24px] laptop:basis-[36%]\">\n <div className=\"tab-with-image__header\">\n <Heading as={'h3'} size={4} html={title} className=\"tab-with-image__title\" />\n <Text\n as={'p'}\n size={1}\n html={desc}\n className=\"tab-with-image__description mt-[4px] text-[14px] tablet:text-[14px] laptop:text-[14px] desktop:text-[16px] lg-desktop:text-[18px]\"\n />\n </div>\n\n <div className=\"tab-with-image__tabs-wrapper relative md:overflow-hidden md:overflow-x-scroll md:scrollbar-hidden\">\n <div className=\"tab-with-image__tabs relative inline-flex rounded-[24px] bg-[#1D1D1F] px-[4px] md:my-[24px]\">\n {/* \u6ED1\u52A8\u80CC\u666F */}\n <div\n className=\"tab-with-image__slider absolute bottom-0 top-0 rounded-[24px] bg-white transition-all duration-300 ease-in-out\"\n style={{\n left: sliderStyle.left,\n width: sliderStyle.width,\n }}\n />\n\n {/* Tab Items */}\n {datalist.map((item: TabWithImageDataItem, index: number) => (\n <div\n key={index}\n ref={el => {\n tabRefs.current[index] = el\n }}\n onClick={e => handleClick(index, e)}\n className={cn(\n 'tab-with-image__tab relative z-10 cursor-pointer rounded-[24px] px-[20px] py-[10px] text-center text-[12px] font-medium transition-colors duration-300 md:px-[20px] md:py-[10px] min-xxl:px-[28px] min-xxl:py-[15px]',\n activeIndex === index ? 'tab-with-image__tab--active text-black' : 'text-white'\n )}\n >\n <Heading\n as=\"h1\"\n size={1}\n html={item?.title}\n className=\"tab-with-image__tab-title text-balance-normal !whitespace-nowrap md:text-[14px]\"\n />\n </div>\n ))}\n </div>\n </div>\n </div>\n <div className=\"tab-with-image__image-wrapper relative w-full flex-shrink md:aspect-[358/360] min-xxl:aspect-[824/560] min-xxl:max-w-[824px] tablet:aspect-[704/360] laptop:aspect-[744/336] laptop:basis-[64%] desktop:aspect-[648/448]\">\n <AnimatePresence mode=\"wait\">\n {datalist[activeIndex] && (\n <motion.div\n key={datalist[activeIndex].image?.url}\n {...({\n initial: { opacity: 0 },\n animate: { opacity: 1 },\n exit: { opacity: 0 },\n transition: { duration: 0.3 },\n } as any)}\n className=\"tab-with-image__image-motion absolute left-0 top-0 w-full\"\n >\n <Picture\n source={`${datalist[activeIndex].image?.url} ,${datalist[activeIndex].imgPad?.url || datalist[activeIndex].image?.url} 1440, ${datalist[activeIndex].imageMob?.url || datalist[activeIndex].image?.url} 767`}\n alt={datalist[activeIndex].image?.alt}\n className=\"tab-with-image__image rounded-[16px] md:aspect-[358/360] min-xxl:aspect-[824/560] min-xxl:max-w-[824px] tablet:aspect-[704/360] laptop:aspect-[744/336] desktop:aspect-[648/448] \"\n />\n </motion.div>\n )}\n </AnimatePresence>\n </div>\n </section>\n )\n})\n\nTabWithImage.displayName = 'TabWithImage'\n\nexport default withLayout(TabWithImage)\n"],
5
+ "mappings": "ukBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,aAAAE,IAAA,eAAAC,EAAAH,GAyDQ,IAAAI,EAAA,6BAxDRC,EAAwE,oBACxEC,EAAuC,qCACvCC,EAAmB,kCACnBC,EAA2B,kCAC3BC,EAA4B,sCAE5BC,EAAwC,yBAExC,MAAMC,EAAgB,QAChBC,EAAgB,iBAEhBC,EAAe,EAAAC,QAAM,WAA8C,CAAC,CAAE,KAAAC,EAAM,UAAAC,CAAU,EAAGC,IAAQ,CACrG,KAAM,CAAE,MAAAC,EAAO,SAAAC,EAAU,KAAAC,EAAM,MAAAC,EAAO,YAAAC,EAAa,SAAAC,EAAW,CAAC,CAAE,EAAIR,EAE/DS,KAAS,UAAuB,IAAI,KAE1C,eAAYA,EAAQ,CAClB,cAAAb,EACA,cAAAC,EACA,eAAgBM,EAChB,qBAAsBE,CACxB,CAAC,KAED,uBAAoBH,EAAK,IAAMO,EAAO,OAAyB,EAE/D,MAAMC,EAAc,CAACC,EAAeC,IAAwC,CAC1EC,EAAeF,CAAK,EAClBC,EAAE,OAAuB,eAAe,CACxC,SAAU,SACV,OAAQ,SACR,MAAO,SACT,CAAC,CACH,EAEM,CAACE,EAAaD,CAAc,KAAI,YAAS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EACnB,WAAY,CAAE,SAAU,EAAI,EAE9B,UAAU,4DAEV,mBAAC,WACC,OAAQ,GAAGN,EAASM,CAAW,EAAE,OAAO,GAAG,KAAKN,EAASM,CAAW,EAAE,QAAQ,KAAON,EAASM,CAAW,EAAE,OAAO,GAAG,UAAUN,EAASM,CAAW,EAAE,UAAU,KAAON,EAASM,CAAW,EAAE,OAAO,GAAG,OACtM,IAAKN,EAASM,CAAW,EAAE,OAAO,IAClC,UAAU,oLACZ,GAbKN,EAASM,CAAW,EAAE,OAAO,GAcpC,EAEJ,EACF,GACF,CAEJ,CAAC,EAEDhB,EAAa,YAAc,eAE3B,IAAOX,KAAQ,cAAWW,CAAY",
6
6
  "names": ["TabWithImage_exports", "__export", "TabWithImage_default", "__toCommonJS", "import_jsx_runtime", "import_react", "import_components", "import_utils", "import_Styles", "import_useExposure", "import_framer_motion", "componentType", "componentName", "TabWithImage", "React", "data", "className", "ref", "title", "subtitle", "desc", "image", "mobileImage", "datalist", "boxRef", "handleClick", "index", "e", "setActiveIndex", "activeIndex", "tabRefs", "sliderStyle", "setSliderStyle", "current", "offsetLeft", "offsetWidth", "item", "el"]
7
7
  }
@@ -1,2 +1,2 @@
1
- "use strict";"use client";var L=Object.create;var a=Object.defineProperty;var T=Object.getOwnPropertyDescriptor;var H=Object.getOwnPropertyNames;var M=Object.getPrototypeOf,E=Object.prototype.hasOwnProperty;var R=(e,t)=>{for(var i in t)a(e,i,{get:t[i],enumerable:!0})},v=(e,t,i,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let d of H(t))!E.call(e,d)&&d!==i&&a(e,d,{get:()=>t[d],enumerable:!(r=T(t,d))||r.enumerable});return e};var F=(e,t,i)=>(i=e!=null?L(M(e)):{},v(t||!e||!e.__esModule?a(i,"default",{value:e,enumerable:!0}):i,e)),P=e=>v(a({},"__esModule",{value:!0}),e);var z={};R(z,{default:()=>g});module.exports=P(z);var l=require("react/jsx-runtime"),o=F(require("react")),s=require("../../components/index.js"),x=require("../../helpers/utils.js"),b=require("../../shared/Styles.js"),_=require("../../hooks/useExposure.js"),n=require("../../hooks/useIntersectionObserver.js");const S="video",I="video_feature",f=o.default.forwardRef(({data:e,className:t},i)=>{const{title:r,subtitle:d,poster:h,video:k,mobPoster:V,mobvideo:c}=e,p=(0,o.useRef)(null),u=(0,o.useRef)(null),m=(0,o.useRef)(null),[y,N]=(0,o.useState)(""),[D,w]=(0,o.useState)("");return(0,_.useExposure)(p,{componentType:S,componentName:I,componentTitle:r,componentDescription:d}),(0,o.useImperativeHandle)(i,()=>p.current),(0,n.useIntersectionObserverDelay)(u,{once:!0,threshold:.1,callback:()=>{N(k.url)}}),(0,n.useIntersectionObserverDelay)(m,{once:!0,threshold:.1,callback:()=>{c?.url&&w(c.url)}}),(0,l.jsxs)("section",{ref:p,"data-ui-component-id":"VideoFeature",className:(0,x.cn)("video-feature flex flex-col items-center rounded-[16px] text-white",t),children:[(0,l.jsx)(s.Heading,{as:"h2",size:4,html:r,className:"video-feature__title w-full text-left laptop:text-center"}),(0,l.jsx)(s.Text,{as:"p",size:4,html:d,className:"video-feature__subtitle mt-[4px] w-full text-left text-[14px] tablet:text-[14px] laptop:mt-[8px] laptop:text-center laptop:text-[14px] desktop:text-[16px] lg-desktop:text-[18px]"}),(0,l.jsxs)("div",{className:"video-feature__video-wrapper mt-[24px] overflow-hidden rounded-[16px] xl:h-[360px]",children:[(0,l.jsx)("div",{ref:u,className:"video-feature__desktop-video-container",children:(0,l.jsx)("video",{playsInline:!0,autoPlay:!0,muted:!0,poster:h?.url,src:y,loop:!0,className:"video-feature__video video-feature__video--desktop hidden h-full w-full object-cover xl:h-[360px] tablet:block"})}),(0,l.jsx)("div",{ref:m,className:"video-feature__mobile-video-container",children:(0,l.jsx)("video",{playsInline:!0,autoPlay:!0,muted:!0,poster:V?.url||"",src:D,loop:!0,className:"video-feature__video video-feature__video--mobile block tablet:hidden"})})]})]})});f.displayName="VideoFeature";var g=(0,b.withLayout)(f);
1
+ "use strict";"use client";var L=Object.create;var a=Object.defineProperty;var T=Object.getOwnPropertyDescriptor;var H=Object.getOwnPropertyNames;var M=Object.getPrototypeOf,E=Object.prototype.hasOwnProperty;var R=(e,t)=>{for(var i in t)a(e,i,{get:t[i],enumerable:!0})},v=(e,t,i,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let d of H(t))!E.call(e,d)&&d!==i&&a(e,d,{get:()=>t[d],enumerable:!(r=T(t,d))||r.enumerable});return e};var F=(e,t,i)=>(i=e!=null?L(M(e)):{},v(t||!e||!e.__esModule?a(i,"default",{value:e,enumerable:!0}):i,e)),P=e=>v(a({},"__esModule",{value:!0}),e);var z={};R(z,{default:()=>g});module.exports=P(z);var l=require("react/jsx-runtime"),o=F(require("react")),s=require("../../components/index.js"),x=require("../../helpers/utils.js"),b=require("../../shared/Styles.js"),_=require("../../hooks/useExposure.js"),n=require("../../hooks/useIntersectionObserver.js");const S="video",I="video_feature",f=o.default.forwardRef(({data:e,className:t},i)=>{const{title:r,subtitle:d,poster:h,video:k,mobPoster:V,mobvideo:c}=e,p=(0,o.useRef)(null),u=(0,o.useRef)(null),m=(0,o.useRef)(null),[y,N]=(0,o.useState)(""),[D,w]=(0,o.useState)("");return(0,_.useExposure)(p,{componentType:S,componentName:I,componentTitle:r,componentDescription:d}),(0,o.useImperativeHandle)(i,()=>p.current),(0,n.useIntersectionObserverDelay)(u,{once:!0,threshold:.1,callback:()=>{N(k?.url)}}),(0,n.useIntersectionObserverDelay)(m,{once:!0,threshold:.1,callback:()=>{c?.url&&w(c?.url)}}),(0,l.jsxs)("section",{ref:p,"data-ui-component-id":"VideoFeature",className:(0,x.cn)("video-feature flex flex-col items-center rounded-[16px] text-white",t),children:[(0,l.jsx)(s.Heading,{as:"h2",size:4,html:r,className:"video-feature__title w-full text-left laptop:text-center"}),(0,l.jsx)(s.Text,{as:"p",size:4,html:d,className:"video-feature__subtitle mt-[4px] w-full text-left text-[14px] tablet:text-[14px] laptop:mt-[8px] laptop:text-center laptop:text-[14px] desktop:text-[16px] lg-desktop:text-[18px]"}),(0,l.jsxs)("div",{className:"video-feature__video-wrapper mt-[24px] overflow-hidden rounded-[16px] xl:h-[360px]",children:[(0,l.jsx)("div",{ref:u,className:"video-feature__desktop-video-container",children:(0,l.jsx)("video",{playsInline:!0,autoPlay:!0,muted:!0,poster:h?.url,src:y,loop:!0,className:"video-feature__video video-feature__video--desktop hidden h-full w-full object-cover xl:h-[360px] tablet:block"})}),(0,l.jsx)("div",{ref:m,className:"video-feature__mobile-video-container",children:(0,l.jsx)("video",{playsInline:!0,autoPlay:!0,muted:!0,poster:V?.url||"",src:D,loop:!0,className:"video-feature__video video-feature__video--mobile block tablet:hidden"})})]})]})});f.displayName="VideoFeature";var g=(0,b.withLayout)(f);
2
2
  //# sourceMappingURL=VideoFeature.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/biz-components/VideoFeature/VideoFeature.tsx"],
4
- "sourcesContent": ["'use client'\nimport React, { useImperativeHandle, useRef, useState } from 'react'\nimport { Heading, Text } from '../../components/index.js'\nimport { cn } from '../../helpers/utils.js'\nimport { withLayout } from '../../shared/Styles.js'\nimport { useExposure } from '../../hooks/useExposure.js'\nimport { useIntersectionObserverDelay } from '../../hooks/useIntersectionObserver.js'\nimport type { VideoFeatureProps } from './types.js'\n\nconst componentType = 'video'\nconst componentName = 'video_feature'\n\nconst VideoFeature = React.forwardRef<HTMLDivElement, VideoFeatureProps>(({ data, className }, ref) => {\n const { title, subtitle, poster, video, mobPoster, mobvideo } = data\n\n const boxRef = useRef<HTMLDivElement>(null)\n const desktopVideoRef = useRef<HTMLDivElement>(null)\n const mobileVideoRef = useRef<HTMLDivElement>(null)\n\n // \u63A7\u5236\u89C6\u9891\u662F\u5426\u52A0\u8F7D\n const [loadedDesktopVideoSrc, setLoadedDesktopVideoSrc] = useState('')\n const [loadedMobileVideoSrc, setLoadedMobileVideoSrc] = useState('')\n\n useExposure(boxRef, {\n componentType,\n componentName,\n componentTitle: title,\n componentDescription: subtitle,\n })\n\n useImperativeHandle(ref, () => boxRef.current as HTMLDivElement)\n\n // \u684C\u9762\u7AEF\u89C6\u9891\u61D2\u52A0\u8F7D\n useIntersectionObserverDelay(desktopVideoRef, {\n once: true,\n threshold: 0.1,\n callback: () => {\n setLoadedDesktopVideoSrc(video.url)\n },\n })\n\n // \u79FB\u52A8\u7AEF\u89C6\u9891\u61D2\u52A0\u8F7D\n useIntersectionObserverDelay(mobileVideoRef, {\n once: true,\n threshold: 0.1,\n callback: () => {\n if (mobvideo?.url) {\n setLoadedMobileVideoSrc(mobvideo.url)\n }\n },\n })\n\n return (\n <section\n ref={boxRef}\n data-ui-component-id=\"VideoFeature\"\n className={cn('video-feature flex flex-col items-center rounded-[16px] text-white', className)}\n >\n <Heading as={'h2'} size={4} html={title} className=\"video-feature__title w-full text-left laptop:text-center\" />\n <Text\n as={'p'}\n size={4}\n html={subtitle}\n className=\"video-feature__subtitle mt-[4px] w-full text-left text-[14px] tablet:text-[14px] laptop:mt-[8px] laptop:text-center laptop:text-[14px] desktop:text-[16px] lg-desktop:text-[18px]\"\n />\n <div className=\"video-feature__video-wrapper mt-[24px] overflow-hidden rounded-[16px] xl:h-[360px]\">\n <div ref={desktopVideoRef} className=\"video-feature__desktop-video-container\">\n <video\n playsInline\n autoPlay\n muted\n poster={poster?.url}\n src={loadedDesktopVideoSrc}\n loop\n className=\"video-feature__video video-feature__video--desktop hidden h-full w-full object-cover xl:h-[360px] tablet:block\"\n ></video>\n </div>\n <div ref={mobileVideoRef} className=\"video-feature__mobile-video-container\">\n <video\n playsInline\n autoPlay\n muted\n poster={mobPoster?.url || ''}\n src={loadedMobileVideoSrc}\n loop\n className=\"video-feature__video video-feature__video--mobile block tablet:hidden\"\n ></video>\n </div>\n </div>\n </section>\n )\n})\n\nVideoFeature.displayName = 'VideoFeature'\n\nexport default withLayout(VideoFeature)\n"],
5
- "mappings": "ukBAAA,IAAAA,EAAA,GAAAC,EAAAD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ACR,MAAK,GACL,OAAQL,GAAQ,IAChB,IAAKO,EACL,KAAI,GACJ,UAAU,iHACX,EACH,KACA,OAAC,OAAI,IAAKD,EAAgB,UAAU,wCAClC,mBAAC,SACC,YAAW,GACX,SAAQ,GACR,MAAK,GACL,OAAQJ,GAAW,KAAO,GAC1B,IAAKO,EACL,KAAI,GACJ,UAAU,wEACX,EACH,GACF,GACF,CAEJ,CAAC,EAEDhB,EAAa,YAAc,eAE3B,IAAOX,KAAQ,cAAWW,CAAY",
4
+ "sourcesContent": ["'use client'\nimport React, { useImperativeHandle, useRef, useState } from 'react'\nimport { Heading, Text } from '../../components/index.js'\nimport { cn } from '../../helpers/utils.js'\nimport { withLayout } from '../../shared/Styles.js'\nimport { useExposure } from '../../hooks/useExposure.js'\nimport { useIntersectionObserverDelay } from '../../hooks/useIntersectionObserver.js'\nimport type { VideoFeatureProps } from './types.js'\n\nconst componentType = 'video'\nconst componentName = 'video_feature'\n\nconst VideoFeature = React.forwardRef<HTMLDivElement, VideoFeatureProps>(({ data, className }, ref) => {\n const { title, subtitle, poster, video, mobPoster, mobvideo } = data\n\n const boxRef = useRef<HTMLDivElement>(null)\n const desktopVideoRef = useRef<HTMLDivElement>(null)\n const mobileVideoRef = useRef<HTMLDivElement>(null)\n\n // \u63A7\u5236\u89C6\u9891\u662F\u5426\u52A0\u8F7D\n const [loadedDesktopVideoSrc, setLoadedDesktopVideoSrc] = useState('')\n const [loadedMobileVideoSrc, setLoadedMobileVideoSrc] = useState('')\n\n useExposure(boxRef, {\n componentType,\n componentName,\n componentTitle: title,\n componentDescription: subtitle,\n })\n\n useImperativeHandle(ref, () => boxRef.current as HTMLDivElement)\n\n // \u684C\u9762\u7AEF\u89C6\u9891\u61D2\u52A0\u8F7D\n useIntersectionObserverDelay(desktopVideoRef, {\n once: true,\n threshold: 0.1,\n callback: () => {\n setLoadedDesktopVideoSrc(video?.url)\n },\n })\n\n // \u79FB\u52A8\u7AEF\u89C6\u9891\u61D2\u52A0\u8F7D\n useIntersectionObserverDelay(mobileVideoRef, {\n once: true,\n threshold: 0.1,\n callback: () => {\n if (mobvideo?.url) {\n setLoadedMobileVideoSrc(mobvideo?.url)\n }\n },\n })\n\n return (\n <section\n ref={boxRef}\n data-ui-component-id=\"VideoFeature\"\n className={cn('video-feature flex flex-col items-center rounded-[16px] text-white', className)}\n >\n <Heading as={'h2'} size={4} html={title} className=\"video-feature__title w-full text-left laptop:text-center\" />\n <Text\n as={'p'}\n size={4}\n html={subtitle}\n className=\"video-feature__subtitle mt-[4px] w-full text-left text-[14px] tablet:text-[14px] laptop:mt-[8px] laptop:text-center laptop:text-[14px] desktop:text-[16px] lg-desktop:text-[18px]\"\n />\n <div className=\"video-feature__video-wrapper mt-[24px] overflow-hidden rounded-[16px] xl:h-[360px]\">\n <div ref={desktopVideoRef} className=\"video-feature__desktop-video-container\">\n <video\n playsInline\n autoPlay\n muted\n poster={poster?.url}\n src={loadedDesktopVideoSrc}\n loop\n className=\"video-feature__video video-feature__video--desktop hidden h-full w-full object-cover xl:h-[360px] tablet:block\"\n ></video>\n </div>\n <div ref={mobileVideoRef} className=\"video-feature__mobile-video-container\">\n <video\n playsInline\n autoPlay\n muted\n poster={mobPoster?.url || ''}\n src={loadedMobileVideoSrc}\n loop\n className=\"video-feature__video video-feature__video--mobile block tablet:hidden\"\n ></video>\n </div>\n </div>\n </section>\n )\n})\n\nVideoFeature.displayName = 'VideoFeature'\n\nexport default withLayout(VideoFeature)\n"],
5
+ "mappings": "ukBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,aAAAE,IAAA,eAAAC,EAAAH,GA0DM,IAAAI,EAAA,6BAzDNC,EAA6D,oBAC7DC,EAA8B,qCAC9BC,EAAmB,kCACnBC,EAA2B,kCAC3BC,EAA4B,sCAC5BC,EAA6C,kDAG7C,MAAMC,EAAgB,QAChBC,EAAgB,gBAEhBC,EAAe,EAAAC,QAAM,WAA8C,CAAC,CAAE,KAAAC,EAAM,UAAAC,CAAU,EAAGC,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AAc,eAE3B,IAAOX,KAAQ,cAAWW,CAAY",
6
6
  "names": ["VideoFeature_exports", "__export", "VideoFeature_default", "__toCommonJS", "import_jsx_runtime", "import_react", "import_components", "import_utils", "import_Styles", "import_useExposure", "import_useIntersectionObserver", "componentType", "componentName", "VideoFeature", "React", "data", "className", "ref", "title", "subtitle", "poster", "video", "mobPoster", "mobvideo", "boxRef", "desktopVideoRef", "mobileVideoRef", "loadedDesktopVideoSrc", "setLoadedDesktopVideoSrc", "loadedMobileVideoSrc", "setLoadedMobileVideoSrc"]
7
7
  }
@@ -1,2 +1,2 @@
1
- "use client";import{Fragment as z,jsx as t,jsxs as a}from"react/jsx-runtime";import f,{useImperativeHandle as N,useRef as w}from"react";import{Heading as l,Picture as m,Text as d}from"../../components/index.js";import{cn as i}from"../../helpers/utils.js";import{withLayout as y}from"../../shared/Styles.js";import{useExposure as b}from"../../hooks/useExposure.js";import{trackUrlRef as C}from"../../shared/trackUrlRef.js";import{Swiper as F,SwiperSlide as T}from"swiper/react";const o="image",c="feature_cards",_=f.forwardRef(({data:h,className:g},v)=>{const{title:s,subtitle:r,items:x=[]}=h,p=w(null);b(p,{componentType:o,componentName:c,componentTitle:s,componentDescription:r}),N(v,()=>p.current);const k=e=>{const u=a(z,{children:[t(m,{source:e.image.url,alt:e.image.alt||e.title,className:"feature-cards__card-image absolute inset-0 !h-full",imgClassName:"!h-full object-cover"}),a("div",{className:"feature-cards__card-content z-10",children:[t(l,{size:3,as:"h2",className:"feature-cards__card-title laptop:text-[20px] desktop:text-[32px] lg-desktop:text-[32px]",children:e.title}),t(d,{size:4,as:"p",className:"feature-cards__card-subtitle mt-[4px] line-clamp-2 h-[40px] text-[14px] laptop:h-[44px] lg-desktop:text-[18px]",children:e.subtitle})]})]}),n=i("feature-cards__card relative flex h-[360px] max-h-[560px] flex-1 flex-col justify-end gap-[16px] overflow-hidden rounded-[12px] px-[16px] py-[12px] text-info-primary tablet:h-[336px] laptop:h-[336px] laptop:px-[16px] laptop:py-[16px] desktop:h-[448px] desktop:rounded-[16px] desktop:px-[32px] desktop:py-[24px] lg-desktop:h-[560px]",{"aiui-dark":e.theme==="dark","aiui-light":e.theme==="light"});return e.link?t("a",{href:C(e.link,`${o}_${c}`),className:n,"data-headless-type-name":`${o}#${c}`,"data-headless-title-desc-button":`${s}#${e.title}#${e.subtitle}`,children:u}):t("div",{className:n,children:u})};return a("section",{ref:p,"data-ui-component-id":"FeatureCards",className:i("feature-cards flex w-full flex-col justify-center",g),children:[a("div",{className:"feature-cards__header",children:[t(l,{size:4,as:"h1",className:"feature-cards__title text-left laptop:text-center",children:s}),r&&t(d,{size:2,as:"p",className:"feature-cards__subtitle mt-[4px] text-left text-[14px] laptop:text-center desktop:text-[16px] lg-desktop:text-[18px]",children:r})]}),t("div",{className:"feature-cards__grid mt-[24px] hidden w-full gap-[16px] laptop:mt-[32px] laptop:flex desktop:mt-[40px] lg-desktop:mt-[24px]",children:x.map(e=>t(f.Fragment,{children:k(e)},e.title))}),t("div",{className:"feature-cards__swiper-container mt-[24px] w-full laptop:hidden",children:t(F,{spaceBetween:12,slidesPerView:"auto",grabCursor:!0,className:"feature-cards__swiper relative w-full !overflow-visible",children:x.map(e=>t(T,{className:"feature-cards__swiper-slide relative !h-[360px] !w-[296px]",children:a("div",{className:i("feature-cards__card feature-cards__card--mobile absolute inset-0 flex flex-1 flex-col justify-end gap-[16px] overflow-hidden rounded-[12px] px-[16px] py-[12px] text-info-primary laptop:px-[16px] laptop:py-[16px] desktop:rounded-[16px] desktop:px-[32px] desktop:py-[24px]",{"aiui-dark":e.theme==="dark","aiui-light":e.theme==="light"}),children:[t(m,{source:e.image.url,alt:e.image.alt||e.title,className:"feature-cards__card-image absolute inset-0 !h-full",imgClassName:"!h-full object-cover"}),a("div",{className:"feature-cards__card-content z-10",children:[t(l,{size:3,as:"h2",className:"feature-cards__card-title",children:e.title}),t(d,{size:4,as:"p",className:"feature-cards__card-subtitle mt-[4px] line-clamp-2 h-[40px] overflow-visible text-[14px] laptop:h-[50px] lg-desktop:text-[18px]",children:e.subtitle})]})]},e.title)},e.title))})})]})});_.displayName="FeatureCards";var L=y(_);export{L as default};
1
+ "use client";import{Fragment as z,jsx as t,jsxs as a}from"react/jsx-runtime";import f,{useImperativeHandle as N,useRef as w}from"react";import{Heading as l,Picture as m,Text as d}from"../../components/index.js";import{cn as i}from"../../helpers/utils.js";import{withLayout as y}from"../../shared/Styles.js";import{useExposure as b}from"../../hooks/useExposure.js";import{trackUrlRef as C}from"../../shared/trackUrlRef.js";import{Swiper as F,SwiperSlide as T}from"swiper/react";const o="image",c="feature_cards",_=f.forwardRef(({data:h,className:g},v)=>{const{title:s,subtitle:r,items:x=[]}=h,p=w(null);b(p,{componentType:o,componentName:c,componentTitle:s,componentDescription:r}),N(v,()=>p.current);const k=e=>{const u=a(z,{children:[t(m,{source:e.image?.url,alt:e.image?.alt||e.title,className:"feature-cards__card-image absolute inset-0 !h-full",imgClassName:"!h-full object-cover"}),a("div",{className:"feature-cards__card-content z-10",children:[t(l,{size:3,as:"h2",className:"feature-cards__card-title laptop:text-[20px] desktop:text-[32px] lg-desktop:text-[32px]",children:e.title}),t(d,{size:4,as:"p",className:"feature-cards__card-subtitle mt-[4px] line-clamp-2 h-[40px] text-[14px] laptop:h-[44px] lg-desktop:text-[18px]",children:e.subtitle})]})]}),n=i("feature-cards__card relative flex h-[360px] max-h-[560px] flex-1 flex-col justify-end gap-[16px] overflow-hidden rounded-[12px] px-[16px] py-[12px] text-info-primary tablet:h-[336px] laptop:h-[336px] laptop:px-[16px] laptop:py-[16px] desktop:h-[448px] desktop:rounded-[16px] desktop:px-[32px] desktop:py-[24px] lg-desktop:h-[560px]",{"aiui-dark":e.theme==="dark","aiui-light":e.theme==="light"});return e.link?t("a",{href:C(e.link,`${o}_${c}`),className:n,"data-headless-type-name":`${o}#${c}`,"data-headless-title-desc-button":`${s}#${e.title}#${e.subtitle}`,children:u}):t("div",{className:n,children:u})};return a("section",{ref:p,"data-ui-component-id":"FeatureCards",className:i("feature-cards flex w-full flex-col justify-center",g),children:[a("div",{className:"feature-cards__header",children:[t(l,{size:4,as:"h1",className:"feature-cards__title text-left laptop:text-center",children:s}),r&&t(d,{size:2,as:"p",className:"feature-cards__subtitle mt-[4px] text-left text-[14px] laptop:text-center desktop:text-[16px] lg-desktop:text-[18px]",children:r})]}),t("div",{className:"feature-cards__grid mt-[24px] hidden w-full gap-[16px] laptop:mt-[32px] laptop:flex desktop:mt-[40px] lg-desktop:mt-[24px]",children:x.map(e=>t(f.Fragment,{children:k(e)},e.title))}),t("div",{className:"feature-cards__swiper-container mt-[24px] w-full laptop:hidden",children:t(F,{spaceBetween:12,slidesPerView:"auto",grabCursor:!0,className:"feature-cards__swiper relative w-full !overflow-visible",children:x.map(e=>t(T,{className:"feature-cards__swiper-slide relative !h-[360px] !w-[296px]",children:a("div",{className:i("feature-cards__card feature-cards__card--mobile absolute inset-0 flex flex-1 flex-col justify-end gap-[16px] overflow-hidden rounded-[12px] px-[16px] py-[12px] text-info-primary laptop:px-[16px] laptop:py-[16px] desktop:rounded-[16px] desktop:px-[32px] desktop:py-[24px]",{"aiui-dark":e.theme==="dark","aiui-light":e.theme==="light"}),children:[t(m,{source:e.image?.url,alt:e.image?.alt||e.title,className:"feature-cards__card-image absolute inset-0 !h-full",imgClassName:"!h-full object-cover"}),a("div",{className:"feature-cards__card-content z-10",children:[t(l,{size:3,as:"h2",className:"feature-cards__card-title",children:e.title}),t(d,{size:4,as:"p",className:"feature-cards__card-subtitle mt-[4px] line-clamp-2 h-[40px] overflow-visible text-[14px] laptop:h-[50px] lg-desktop:text-[18px]",children:e.subtitle})]})]},e.title)},e.title))})})]})});_.displayName="FeatureCards";var L=y(_);export{L as default};
2
2
  //# sourceMappingURL=FeatureCards.js.map