@anker-in/headless-ui 1.0.26-alpha.1763111166215 → 1.0.26-alpha.1763367560339

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 (100) hide show
  1. package/dist/cjs/biz-components/DownLoad/index.js +1 -1
  2. package/dist/cjs/biz-components/DownLoad/index.js.map +2 -2
  3. package/dist/cjs/biz-components/Features/index.js +1 -1
  4. package/dist/cjs/biz-components/Features/index.js.map +2 -2
  5. package/dist/cjs/biz-components/Listing/components/PaidShipping/index.d.ts +23 -7
  6. package/dist/cjs/biz-components/Listing/components/PaidShipping/index.js +1 -1
  7. package/dist/cjs/biz-components/Listing/components/PaidShipping/index.js.map +3 -3
  8. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/BenefitsTab.d.ts +5 -2
  9. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/BenefitsTab.js +5 -5
  10. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/BenefitsTab.js.map +3 -3
  11. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductBundle/index.d.ts +6 -2
  12. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductBundle/index.js +1 -1
  13. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductBundle/index.js.map +3 -3
  14. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductExchangePurchase/index.d.ts +6 -2
  15. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductExchangePurchase/index.js +1 -1
  16. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductExchangePurchase/index.js.map +3 -3
  17. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductFreeGift/index.d.ts +6 -2
  18. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductFreeGift/index.js +1 -1
  19. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductFreeGift/index.js.map +3 -3
  20. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductHighlight/index.d.ts +6 -2
  21. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductHighlight/index.js +1 -1
  22. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductHighlight/index.js.map +3 -3
  23. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductOptions/index.d.ts +6 -2
  24. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductOptions/index.js +1 -1
  25. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductOptions/index.js.map +3 -3
  26. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductGallery/index.d.ts +6 -2
  27. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductGallery/index.js +1 -1
  28. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductGallery/index.js.map +3 -3
  29. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductGallery/types.d.ts +43 -12
  30. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductGallery/types.js +1 -1
  31. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductGallery/types.js.map +2 -2
  32. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductSummary/index.d.ts +6 -2
  33. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductSummary/index.js +1 -1
  34. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductSummary/index.js.map +3 -3
  35. package/dist/cjs/biz-components/Listing/components/PurchaseBar/ProductActions/index.js +1 -1
  36. package/dist/cjs/biz-components/Listing/components/PurchaseBar/ProductActions/index.js.map +2 -2
  37. package/dist/cjs/biz-components/Listing/components/PurchaseBar/index.d.ts +6 -2
  38. package/dist/cjs/biz-components/Listing/components/PurchaseBar/index.js +1 -1
  39. package/dist/cjs/biz-components/Listing/components/PurchaseBar/index.js.map +3 -3
  40. package/dist/cjs/biz-components/SelectStore/index.js +1 -1
  41. package/dist/cjs/biz-components/SelectStore/index.js.map +2 -2
  42. package/dist/cjs/components/ExposureDetector.d.ts +45 -0
  43. package/dist/cjs/components/ExposureDetector.js +2 -0
  44. package/dist/cjs/components/ExposureDetector.js.map +7 -0
  45. package/dist/cjs/components/index.d.ts +1 -0
  46. package/dist/cjs/components/index.js +1 -1
  47. package/dist/cjs/components/index.js.map +3 -3
  48. package/dist/cjs/hooks/useExposureDetection.d.ts +69 -0
  49. package/dist/cjs/hooks/useExposureDetection.js +2 -0
  50. package/dist/cjs/hooks/useExposureDetection.js.map +7 -0
  51. package/dist/esm/biz-components/DownLoad/index.js +1 -1
  52. package/dist/esm/biz-components/DownLoad/index.js.map +2 -2
  53. package/dist/esm/biz-components/Features/index.js +1 -1
  54. package/dist/esm/biz-components/Features/index.js.map +2 -2
  55. package/dist/esm/biz-components/Listing/components/PaidShipping/index.d.ts +23 -7
  56. package/dist/esm/biz-components/Listing/components/PaidShipping/index.js +1 -1
  57. package/dist/esm/biz-components/Listing/components/PaidShipping/index.js.map +3 -3
  58. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/BenefitsTab.d.ts +5 -2
  59. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/BenefitsTab.js +5 -5
  60. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/BenefitsTab.js.map +3 -3
  61. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductBundle/index.d.ts +6 -2
  62. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductBundle/index.js +1 -1
  63. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductBundle/index.js.map +3 -3
  64. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductExchangePurchase/index.d.ts +6 -2
  65. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductExchangePurchase/index.js +1 -1
  66. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductExchangePurchase/index.js.map +3 -3
  67. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductFreeGift/index.d.ts +6 -2
  68. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductFreeGift/index.js +1 -1
  69. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductFreeGift/index.js.map +3 -3
  70. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductHighlight/index.d.ts +6 -2
  71. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductHighlight/index.js +1 -1
  72. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductHighlight/index.js.map +3 -3
  73. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductOptions/index.d.ts +6 -2
  74. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductOptions/index.js +1 -1
  75. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductOptions/index.js.map +3 -3
  76. package/dist/esm/biz-components/Listing/components/ProductCard/ProductGallery/index.d.ts +6 -2
  77. package/dist/esm/biz-components/Listing/components/ProductCard/ProductGallery/index.js +1 -1
  78. package/dist/esm/biz-components/Listing/components/ProductCard/ProductGallery/index.js.map +3 -3
  79. package/dist/esm/biz-components/Listing/components/ProductCard/ProductGallery/types.d.ts +43 -12
  80. package/dist/esm/biz-components/Listing/components/ProductCard/ProductGallery/types.js.map +2 -2
  81. package/dist/esm/biz-components/Listing/components/ProductCard/ProductSummary/index.d.ts +6 -2
  82. package/dist/esm/biz-components/Listing/components/ProductCard/ProductSummary/index.js +1 -1
  83. package/dist/esm/biz-components/Listing/components/ProductCard/ProductSummary/index.js.map +3 -3
  84. package/dist/esm/biz-components/Listing/components/PurchaseBar/ProductActions/index.js +1 -1
  85. package/dist/esm/biz-components/Listing/components/PurchaseBar/ProductActions/index.js.map +2 -2
  86. package/dist/esm/biz-components/Listing/components/PurchaseBar/index.d.ts +6 -2
  87. package/dist/esm/biz-components/Listing/components/PurchaseBar/index.js +1 -1
  88. package/dist/esm/biz-components/Listing/components/PurchaseBar/index.js.map +3 -3
  89. package/dist/esm/biz-components/SelectStore/index.js +1 -1
  90. package/dist/esm/biz-components/SelectStore/index.js.map +2 -2
  91. package/dist/esm/components/ExposureDetector.d.ts +45 -0
  92. package/dist/esm/components/ExposureDetector.js +2 -0
  93. package/dist/esm/components/ExposureDetector.js.map +7 -0
  94. package/dist/esm/components/index.d.ts +1 -0
  95. package/dist/esm/components/index.js +1 -1
  96. package/dist/esm/components/index.js.map +3 -3
  97. package/dist/esm/hooks/useExposureDetection.d.ts +69 -0
  98. package/dist/esm/hooks/useExposureDetection.js +2 -0
  99. package/dist/esm/hooks/useExposureDetection.js.map +7 -0
  100. package/package.json +1 -1
@@ -1,2 +1,2 @@
1
- "use strict";var u=Object.defineProperty;var w=Object.getOwnPropertyDescriptor;var _=Object.getOwnPropertyNames;var k=Object.prototype.hasOwnProperty;var E=(s,o)=>{for(var n in o)u(s,n,{get:o[n],enumerable:!0})},P=(s,o,n,a)=>{if(o&&typeof o=="object"||typeof o=="function")for(let i of _(o))!k.call(s,i)&&i!==n&&u(s,i,{get:()=>o[i],enumerable:!(a=w(o,i))||a.enumerable});return s};var C=s=>P(u({},"__esModule",{value:!0}),s);var O={};E(O,{default:()=>L});module.exports=C(O);var e=require("react/jsx-runtime"),d=require("../../../../../../components"),l=require("../../../../../../helpers/index.js"),p=require("react"),f=require("../../../../BizProductProvider.js"),v=require("../../../../../AiuiProvider/index.js"),x=require("../../../../utils/helper.js");const z=()=>{const{product:s,selectedOptions:o,setSelectedOptions:n,setJoinedRecommendBuyProducts:a}=(0,f.useBizProductContext)(),{storeDomain:i}=(0,v.useAiuiContext)(),[g,y]=(0,p.useState)({});return s.options.length?(0,e.jsx)("div",{className:"flex flex-col gap-12",children:s.options.map(r=>{const N=r.name.toLowerCase();return["color","colour","couleur"].some(t=>N.includes(t))?(0,e.jsxs)("div",{className:"ipc-product-detail-options",children:[(0,e.jsx)(d.Text,{as:"p",size:3,className:"font-bold",html:"Select Color: "+o[r.name]}),(0,e.jsx)("div",{className:"flex items-center gap-4 mt-4 ml-1",children:r.values.map(({label:t},c)=>{const b=`https://${i}/cdn/shop/files/${(0,x.handle)(t)}.png`;return(0,e.jsxs)("div",{className:"relative ipc-product-detail-options-value",children:[(0,e.jsx)("button",{"aria-label":`switch to ${t}`,title:t,onClick:()=>{n(m=>({...m,[r.name]:t})),a?.({gift:void 0,bundle:void 0})},className:(0,l.cn)("flex size-[30px] items-center justify-center rounded-full bg-center bg-no-repeat outline outline-2 outline-offset-4 outline-white",{"outline-brand":o[r.name]===t}),children:!g[t]&&(0,e.jsx)(e.Fragment,{children:(0,e.jsx)(d.Picture,{className:"w-full",source:b,onError:({currentTarget:m})=>{m.onerror=null,y(h=>({...h,[t]:!0}))}})})}),(0,e.jsx)("div",{className:"pointer-events-none absolute inset-0 rounded-full shadow-[inset_0_0_4px_rgba(0,0,0,0.08),inset_0_2px_2px_rgba(0,0,0,0.12)]"})]},t+c)})})]},r.id):(0,e.jsxs)("div",{className:"ipc-product-detail-options",children:[(0,e.jsx)(d.Text,{as:"p",size:3,className:"font-bold",html:r.name}),(0,e.jsx)("div",{className:"flex items-center gap-4 mt-4",children:r.values.map(({label:t})=>(0,e.jsx)("button",{onClick:()=>{n(c=>({...c,[r.name]:t}))},className:(0,l.cn)("w-1/2 text-left font-bold px-4 py-6 rounded-box border-[#E4E5E6] border-2",{"border-brand":o[r.name]===t}),children:t},t))})]},r.id)})}):null};var L=z;
1
+ "use strict";var u=Object.defineProperty;var _=Object.getOwnPropertyDescriptor;var k=Object.getOwnPropertyNames;var E=Object.prototype.hasOwnProperty;var P=(s,o)=>{for(var n in o)u(s,n,{get:o[n],enumerable:!0})},C=(s,o,n,a)=>{if(o&&typeof o=="object"||typeof o=="function")for(let i of k(o))!E.call(s,i)&&i!==n&&u(s,i,{get:()=>o[i],enumerable:!(a=_(o,i))||a.enumerable});return s};var L=s=>C(u({},"__esModule",{value:!0}),s);var B={};P(B,{default:()=>O});module.exports=L(B);var e=require("react/jsx-runtime"),d=require("../../../../../../components"),l=require("../../../../../../helpers/index.js"),p=require("react"),f=require("../../../../BizProductProvider.js"),v=require("../../../../../AiuiProvider/index.js"),x=require("../../../../utils/helper.js"),g=require("../../../../../../shared/Styles.js");const z=()=>{const{product:s,selectedOptions:o,setSelectedOptions:n,setJoinedRecommendBuyProducts:a}=(0,f.useBizProductContext)(),{storeDomain:i}=(0,v.useAiuiContext)(),[y,N]=(0,p.useState)({});return s.options.length?(0,e.jsx)("div",{className:"flex flex-col gap-12",children:s.options.map(r=>{const h=r.name.toLowerCase();return["color","colour","couleur"].some(t=>h.includes(t))?(0,e.jsxs)("div",{className:"ipc-product-detail-options",children:[(0,e.jsx)(d.Text,{as:"p",size:3,className:"font-bold",html:"Select Color: "+o[r.name]}),(0,e.jsx)("div",{className:"flex items-center gap-4 mt-4 ml-1",children:r.values.map(({label:t},m)=>{const b=`https://${i}/cdn/shop/files/${(0,x.handle)(t)}.png`;return(0,e.jsxs)("div",{className:"relative ipc-product-detail-options-value",children:[(0,e.jsx)("button",{"aria-label":`switch to ${t}`,title:t,onClick:()=>{n(c=>({...c,[r.name]:t})),a?.({gift:void 0,bundle:void 0})},className:(0,l.cn)("flex size-[30px] items-center justify-center rounded-full bg-center bg-no-repeat outline outline-2 outline-offset-4 outline-white",{"outline-brand":o[r.name]===t}),children:!y[t]&&(0,e.jsx)(e.Fragment,{children:(0,e.jsx)(d.Picture,{className:"w-full",source:b,onError:({currentTarget:c})=>{c.onerror=null,N(w=>({...w,[t]:!0}))}})})}),(0,e.jsx)("div",{className:"pointer-events-none absolute inset-0 rounded-full shadow-[inset_0_0_4px_rgba(0,0,0,0.08),inset_0_2px_2px_rgba(0,0,0,0.12)]"})]},t+m)})})]},r.id):(0,e.jsxs)("div",{className:"ipc-product-detail-options",children:[(0,e.jsx)(d.Text,{as:"p",size:3,className:"font-bold",html:r.name}),(0,e.jsx)("div",{className:"flex items-center gap-4 mt-4",children:r.values.map(({label:t})=>(0,e.jsx)("button",{onClick:()=>{n(m=>({...m,[r.name]:t}))},className:(0,l.cn)("w-1/2 text-left font-bold px-4 py-6 rounded-box border-[#E4E5E6] border-2",{"border-brand":o[r.name]===t}),children:t},t))})]},r.id)})}):null};var O=(0,g.withLayout)(z);
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/ProductDetail/ProductOptions/index.tsx"],
4
- "sourcesContent": ["import { Text, Picture, Button } from '../../../../../../components'\nimport type { ProductOptionsProps } from '../types'\nimport { cn } from '../../../../../../helpers/index.js'\nimport { useState } from 'react'\nimport { useBizProductContext } from '../../../../BizProductProvider.js'\nimport { useAiuiContext } from '../../../../../AiuiProvider/index.js'\nimport { handle } from '../../../../utils/helper.js'\n\nconst ProductOptions = () => {\n const { product, selectedOptions, setSelectedOptions, setJoinedRecommendBuyProducts } =\n useBizProductContext()\n const { storeDomain } = useAiuiContext()\n const [imgLoadError, setImgLoadError] = useState({})\n if (!product.options.length) return null\n return (\n <div className=\"flex flex-col gap-12\">\n {product.options.map(option => {\n const lowercasedName = option.name.toLowerCase()\n const colorKeywords = ['color', 'colour', 'couleur']\n if (colorKeywords.some(keyword => lowercasedName.includes(keyword))) {\n return (\n <div key={option.id} className=\"ipc-product-detail-options\">\n <Text as=\"p\" size={3} className=\"font-bold\" html={'Select Color: ' + selectedOptions[option.name]} />\n <div className=\"flex items-center gap-4 mt-4 ml-1\">\n {option.values.map(({ label }, index) => {\n const imagePath = `https://${storeDomain}/cdn/shop/files/${handle(label)}.png`\n return (\n <div key={label + index} className=\"relative ipc-product-detail-options-value\">\n <button\n aria-label={`switch to ${label}`}\n title={label}\n onClick={() => {\n setSelectedOptions(prev => ({ ...prev, [option.name]: label }))\n setJoinedRecommendBuyProducts?.({ gift: undefined, bundle: undefined })\n }}\n className={cn(\n 'flex size-[30px] items-center justify-center rounded-full bg-center bg-no-repeat outline outline-2 outline-offset-4 outline-white',\n {\n 'outline-brand': selectedOptions[option.name] === label,\n }\n )}\n >\n {!imgLoadError[label as keyof typeof imgLoadError] && (\n <>\n <Picture\n className=\"w-full\"\n source={imagePath}\n onError={({ currentTarget }) => {\n currentTarget.onerror = null // prevents looping\n setImgLoadError(prev => ({ ...prev, [label]: true }))\n }}\n />\n </>\n )}\n </button>\n <div className=\"pointer-events-none absolute inset-0 rounded-full shadow-[inset_0_0_4px_rgba(0,0,0,0.08),inset_0_2px_2px_rgba(0,0,0,0.12)]\"></div>\n </div>\n )\n })}\n </div>\n </div>\n )\n } else {\n return (\n <div key={option.id} className=\"ipc-product-detail-options\">\n <Text as=\"p\" size={3} className=\"font-bold\" html={option.name} />\n <div className=\"flex items-center gap-4 mt-4\">\n {option.values.map(({ label }) => (\n <button\n key={label}\n onClick={() => {\n setSelectedOptions(prev => ({ ...prev, [option.name]: label }))\n // setProductSummaryStatus?.({ giftSummary: false, bundleSummary: false })\n }}\n className={cn('w-1/2 text-left font-bold px-4 py-6 rounded-box border-[#E4E5E6] border-2', {\n 'border-brand': selectedOptions[option.name] === label,\n })}\n >\n {label}\n </button>\n ))}\n </div>\n </div>\n )\n }\n })}\n </div>\n )\n}\n\nexport default ProductOptions\n"],
5
- "mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,aAAAE,IAAA,eAAAC,EAAAH,GAsBc,IAAAI,EAAA,6BAtBdC,EAAsC,wCAEtCC,EAAmB,8CACnBC,EAAyB,iBACzBC,EAAqC,6CACrCC,EAA+B,gDAC/BC,EAAuB,uCAEvB,MAAMC,EAAiB,IAAM,CAC3B,KAAM,CAAE,QAAAC,EAAS,gBAAAC,EAAiB,mBAAAC,EAAoB,8BAAAC,CAA8B,KAClF,wBAAqB,EACjB,CAAE,YAAAC,CAAY,KAAI,kBAAe,EACjC,CAACC,EAAcC,CAAe,KAAI,YAAS,CAAC,CAAC,EACnD,OAAKN,EAAQ,QAAQ,UAEnB,OAAC,OAAI,UAAU,uBAC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IAAI,CAAC,CAAE,MAAAG,CAAM,OAC1B,OAAC,UAEC,QAAS,IAAM,CACbR,EAAmBW,IAAS,CAAE,GAAGA,EAAM,CAACN,EAAO,IAAI,EAAGG,CAAM,EAAE,CAEhE,EACA,aAAW,MAAG,4EAA6E,CACzF,eAAgBT,EAAgBM,EAAO,IAAI,IAAMG,CACnD,CAAC,EAEA,SAAAA,GATIA,CAUP,CACD,EACH,IAjBQH,EAAO,EAkBjB,CAGN,CAAC,EACH,EAzEkC,IA2EtC,EAEA,IAAOjB,EAAQS",
6
- "names": ["ProductOptions_exports", "__export", "ProductOptions_default", "__toCommonJS", "import_jsx_runtime", "import_components", "import_helpers", "import_react", "import_BizProductProvider", "import_AiuiProvider", "import_helper", "ProductOptions", "product", "selectedOptions", "setSelectedOptions", "setJoinedRecommendBuyProducts", "storeDomain", "imgLoadError", "setImgLoadError", "option", "lowercasedName", "keyword", "label", "index", "imagePath", "prev", "currentTarget"]
4
+ "sourcesContent": ["import { Text, Picture, Button } from '../../../../../../components'\nimport type { ProductOptionsProps } from '../types'\nimport { cn } from '../../../../../../helpers/index.js'\nimport { useState } from 'react'\nimport { useBizProductContext } from '../../../../BizProductProvider.js'\nimport { useAiuiContext } from '../../../../../AiuiProvider/index.js'\nimport { handle } from '../../../../utils/helper.js'\nimport { withLayout } from '../../../../../../shared/Styles.js'\n\nconst ProductOptions = () => {\n const { product, selectedOptions, setSelectedOptions, setJoinedRecommendBuyProducts } =\n useBizProductContext()\n const { storeDomain } = useAiuiContext()\n const [imgLoadError, setImgLoadError] = useState({})\n if (!product.options.length) return null\n return (\n <div className=\"flex flex-col gap-12\">\n {product.options.map(option => {\n const lowercasedName = option.name.toLowerCase()\n const colorKeywords = ['color', 'colour', 'couleur']\n if (colorKeywords.some(keyword => lowercasedName.includes(keyword))) {\n return (\n <div key={option.id} className=\"ipc-product-detail-options\">\n <Text as=\"p\" size={3} className=\"font-bold\" html={'Select Color: ' + selectedOptions[option.name]} />\n <div className=\"flex items-center gap-4 mt-4 ml-1\">\n {option.values.map(({ label }, index) => {\n const imagePath = `https://${storeDomain}/cdn/shop/files/${handle(label)}.png`\n return (\n <div key={label + index} className=\"relative ipc-product-detail-options-value\">\n <button\n aria-label={`switch to ${label}`}\n title={label}\n onClick={() => {\n setSelectedOptions(prev => ({ ...prev, [option.name]: label }))\n setJoinedRecommendBuyProducts?.({ gift: undefined, bundle: undefined })\n }}\n className={cn(\n 'flex size-[30px] items-center justify-center rounded-full bg-center bg-no-repeat outline outline-2 outline-offset-4 outline-white',\n {\n 'outline-brand': selectedOptions[option.name] === label,\n }\n )}\n >\n {!imgLoadError[label as keyof typeof imgLoadError] && (\n <>\n <Picture\n className=\"w-full\"\n source={imagePath}\n onError={({ currentTarget }) => {\n currentTarget.onerror = null // prevents looping\n setImgLoadError(prev => ({ ...prev, [label]: true }))\n }}\n />\n </>\n )}\n </button>\n <div className=\"pointer-events-none absolute inset-0 rounded-full shadow-[inset_0_0_4px_rgba(0,0,0,0.08),inset_0_2px_2px_rgba(0,0,0,0.12)]\"></div>\n </div>\n )\n })}\n </div>\n </div>\n )\n } else {\n return (\n <div key={option.id} className=\"ipc-product-detail-options\">\n <Text as=\"p\" size={3} className=\"font-bold\" html={option.name} />\n <div className=\"flex items-center gap-4 mt-4\">\n {option.values.map(({ label }) => (\n <button\n key={label}\n onClick={() => {\n setSelectedOptions(prev => ({ ...prev, [option.name]: label }))\n // setProductSummaryStatus?.({ giftSummary: false, bundleSummary: false })\n }}\n className={cn('w-1/2 text-left font-bold px-4 py-6 rounded-box border-[#E4E5E6] border-2', {\n 'border-brand': selectedOptions[option.name] === label,\n })}\n >\n {label}\n </button>\n ))}\n </div>\n </div>\n )\n }\n })}\n </div>\n )\n}\n\nexport default withLayout(ProductOptions)\n"],
5
+ "mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,aAAAE,IAAA,eAAAC,EAAAH,GAuBc,IAAAI,EAAA,6BAvBdC,EAAsC,wCAEtCC,EAAmB,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KACxBR,EAAgBO,IAAS,CAAE,GAAGA,EAAM,CAACH,CAAK,EAAG,EAAK,EAAE,CACtD,EACF,EACF,EAEJ,KACA,OAAC,OAAI,UAAU,6HAA6H,IA5BpIA,EAAQC,CA6BlB,CAEJ,CAAC,EACH,IAtCQJ,EAAO,EAuCjB,KAIA,QAAC,OAAoB,UAAU,6BAC7B,oBAAC,QAAK,GAAG,IAAI,KAAM,EAAG,UAAU,YAAY,KAAMA,EAAO,KAAM,KAC/D,OAAC,OAAI,UAAU,+BACZ,SAAAA,EAAO,OAAO,IAAI,CAAC,CAAE,MAAAG,CAAM,OAC1B,OAAC,UAEC,QAAS,IAAM,CACbR,EAAmBW,IAAS,CAAE,GAAGA,EAAM,CAACN,EAAO,IAAI,EAAGG,CAAM,EAAE,CAEhE,EACA,aAAW,MAAG,4EAA6E,CACzF,eAAgBT,EAAgBM,EAAO,IAAI,IAAMG,CACnD,CAAC,EAEA,SAAAA,GATIA,CAUP,CACD,EACH,IAjBQH,EAAO,EAkBjB,CAGN,CAAC,EACH,EAzEkC,IA2EtC,EAEA,IAAOlB,KAAQ,cAAWU,CAAc",
6
+ "names": ["ProductOptions_exports", "__export", "ProductOptions_default", "__toCommonJS", "import_jsx_runtime", "import_components", "import_helpers", "import_react", "import_BizProductProvider", "import_AiuiProvider", "import_helper", "import_Styles", "ProductOptions", "product", "selectedOptions", "setSelectedOptions", "setJoinedRecommendBuyProducts", "storeDomain", "imgLoadError", "setImgLoadError", "option", "lowercasedName", "keyword", "label", "index", "imagePath", "prev", "currentTarget"]
7
7
  }
@@ -1,5 +1,9 @@
1
- declare const ProductGallery: () => import("react/jsx-runtime").JSX.Element;
1
+ /// <reference types="react" />
2
2
  export interface ProductGalleryTabRef {
3
3
  scrollToTab: (index: number) => void;
4
4
  }
5
- export default ProductGallery;
5
+ declare const _default: import("react").ForwardRefExoticComponent<Omit<object, keyof import("../../../../../shared/Styles.js").StylesProps> & Partial<import("../../../../../shared/Styles.js").StylesProps & import("../../../../../shared/Styles.js").ContainerProps> & {
6
+ className?: string | undefined;
7
+ data?: Record<string, any> | undefined;
8
+ } & import("react").RefAttributes<any>>;
9
+ export default _default;
@@ -1,2 +1,2 @@
1
- "use strict";var O=Object.create;var R=Object.defineProperty;var q=Object.getOwnPropertyDescriptor;var U=Object.getOwnPropertyNames;var Z=Object.getPrototypeOf,K=Object.prototype.hasOwnProperty;var J=(t,a)=>{for(var s in a)R(t,s,{get:a[s],enumerable:!0})},B=(t,a,s,v)=>{if(a&&typeof a=="object"||typeof a=="function")for(let n of U(a))!K.call(t,n)&&n!==s&&R(t,n,{get:()=>a[n],enumerable:!(v=q(a,n))||v.enumerable});return t};var Q=(t,a,s)=>(s=t!=null?O(Z(t)):{},B(a||!t||!t.__esModule?R(s,"default",{value:t,enumerable:!0}):s,t)),X=t=>B(R({},"__esModule",{value:!0}),t);var ie={};J(ie,{default:()=>ae});module.exports=X(ie);var e=require("react/jsx-runtime"),D=require("../../../../AiuiProvider/index.js"),I=require("../../../../../components"),l=require("react"),E=require("swiper/react"),m=require("swiper/modules"),T=require("../../../../../helpers/index.js"),N=require("./types.js"),G=require("@radix-ui/react-tabs"),V=require("../../../BizProductProvider.js"),j=require("../../../hooks/use-variant-media.js"),W=require("./components/SpecsModal.js"),Y=Q(require("./components/CompareModal.js")),$=require("../../../utils/index.js");const H=t=>(0,e.jsxs)("svg",{width:"48",height:"48",viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t,children:[(0,e.jsx)("rect",{x:"48",y:"48",width:"48",height:"48",rx:"24",transform:"rotate(-180 48 48)",fill:"white"}),(0,e.jsx)("path",{d:"M25.1035 16.8545C25.5372 16.3818 26.246 16.3818 26.6797 16.8545C27.1067 17.3201 27.1067 18.0706 26.6797 18.5361L21.668 24L26.6797 29.4639C27.1067 29.9294 27.1067 30.6799 26.6797 31.1455C26.246 31.6182 25.5372 31.6182 25.1035 31.1455L19.3203 24.8408C18.8933 24.3752 18.8933 23.6248 19.3203 23.1592L25.1035 16.8545Z",fill:"currentColor"})]}),F=t=>(0,e.jsxs)("svg",{width:"48",height:"48",viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t,children:[(0,e.jsx)("rect",{width:"48",height:"48",rx:"24",transform:"matrix(1 -8.74228e-08 -8.74228e-08 -1 0 48)",fill:"white"}),(0,e.jsx)("path",{d:"M22.8965 16.8545C22.4628 16.3818 21.754 16.3818 21.3203 16.8545C20.8933 17.3201 20.8933 18.0706 21.3203 18.5361L26.332 24L21.3203 29.4639C20.8933 29.9294 20.8933 30.6799 21.3203 31.1455C21.754 31.6182 22.4628 31.6182 22.8965 31.1455L28.6797 24.8408C29.1067 24.3752 29.1067 23.6248 28.6797 23.1592L22.8965 16.8545Z",fill:"currentColor"})]}),ee=()=>{const{copyWriting:t}=(0,D.useAiuiContext)(),{product:a,variant:s,selectedOptions:v}=(0,V.useBizProductContext)(),n=(0,j.useVariantMedia)({product:a,variant:s}),[d,x]=(0,l.useState)(null),C=(0,l.useRef)(null),u=s?.metafields?.component?.custom_media_list;let h,w,M,S;u&&u?.available?(h=u?.product||[],w=u?.scenarios||[],M=u?.keyFeatures||[],S=u?.video||[]):(h=n?.productList,w=n?.sceneList,M=n?.keyFeaturesList,S=n?.videoList);const o=(0,l.useMemo)(()=>[...h,...w,...S],[h,w,S]),p={productList:h,sceneList:w,keyFeaturesList:M,videoList:S},i=(0,l.useMemo)(()=>(a?.payload?.components?.find(b=>b.componentKey==="ProductGallery")?.data||[])?.map(b=>({...b,galleries:p[b?.galleries]||[]})).filter(b=>b.galleries.length>0),[a?.payload,p]),[y,k]=(0,l.useState)(i?.[0]),[g,L]=(0,l.useState)(0),[P,r]=(0,l.useState)(null),f=(0,l.useCallback)(()=>{const c=(g+1)%i.length;L(c),k(i[c]),r(0)},[g,i]),A=(0,l.useCallback)(()=>{const c=g===0?i.length-1:g-1;L(c),k(i[c]);const b=i[c]?.galleries||[];r(b.length-1)},[g,i]);(0,l.useEffect)(()=>{g!=null&&requestAnimationFrame(()=>{C.current?.scrollToTab(g)})},[g]),(0,l.useEffect)(()=>{k(i[0]),L(0)},[s?.id]);const z=(c,b)=>{switch(c?.galleryTabType){case N.GalleryTabType.GALLERY_IMAGE_MAIN:return(0,e.jsx)(_,{...c,index:b,onNextTab:f,onPrevTab:A,targetSlideIndex:P,onSlideChange:()=>r(null)});case N.GalleryTabType.GALLERY_IMAGE_FEATURES:return(0,e.jsx)(_,{...c,index:b,onNextTab:f,onPrevTab:A,targetSlideIndex:P,onSlideChange:()=>r(null)});case N.GalleryTabType.GALLERY_IMAGE_SCENE:return(0,e.jsx)(_,{...c,index:b,onNextTab:f,onPrevTab:A,targetSlideIndex:P,onSlideChange:()=>r(null)});case N.GalleryTabType.GALLERY_VIDEO:return(0,e.jsx)(le,{...c,onNextTab:f,onPrevTab:A,targetSlideIndex:P,onSlideChange:()=>r(null)});default:return null}};return(0,e.jsx)("div",{id:"ipc-product-gallery",children:(0,e.jsxs)(G.Root,{className:"relative",value:y?.tabValue,defaultValue:i?.[0]?.tabValue,children:[(0,e.jsx)("div",{className:"h-[420px] overflow-hidden tablet:h-[620px] desktop:rounded-2xl desktop:h-[560px] lg-desktop:h-[700px] bg-[#EAEAEC] desktop:relative ",children:i.map((c,b)=>(0,e.jsx)(G.Content,{className:"h-full",value:c.tabValue,children:z(c,b)},c.tabValue))}),(0,e.jsx)(te,{ref:C,galleryTabs:i,activeGalleryTab:y,setActiveGalleryTab:k,setActiveTabIndex:L,setTargetSlideIndex:r})]})})},te=(0,l.forwardRef)((t,a)=>{const{galleryTabs:s,activeGalleryTab:v,setActiveGalleryTab:n,setActiveTabIndex:d,setTargetSlideIndex:x}=t,{product:C}=(0,V.useBizProductContext)(),u=(0,l.useRef)(null),h=(0,l.useRef)(new Map),w=(0,l.useCallback)((o,p,i)=>{n(p),d(i),x(0),M(o)},[n,d,x]),M=(0,l.useCallback)(o=>{if(u.current){const p=u.current,i=o.currentTarget,y=i.offsetLeft-p.offsetWidth/2+i.offsetWidth/2;p.scrollTo({left:y,behavior:"smooth"})}},[]),S=(0,l.useCallback)(o=>{if(u.current&&s[o]){const p=u.current,i=s[o],y=h.current.get(i.tabValue);if(y){const k=y.offsetLeft-p.offsetWidth/2+y.offsetWidth/2;p.scrollTo({left:k,behavior:"smooth"})}}},[s]);return(0,l.useImperativeHandle)(a,()=>({scrollToTab:S})),(0,e.jsxs)("div",{className:"absolute z-[2] bottom-4 left-4 right-4 laptop:left-16 laptop:right-16 flex justify-between items-center tablet:mt-3 desktop:static",children:[(0,e.jsx)(G.List,{ref:u,className:"rounded-full bg-[#EAEAEC] p-1 laptop:p-0 desktop:p-1 overflow-x-auto",style:{scrollbarWidth:"none",msOverflowStyle:"none"},children:(0,e.jsx)("div",{className:"whitespace-nowrap",children:s?.map((o,p)=>(0,e.jsx)(G.Trigger,{ref:i=>{i?h.current.set(o.tabValue,i):h.current.delete(o.tabValue)},className:(0,T.cn)("lg-desktop:px-7 lg-desktop:pb-[14px] rounded-full font-bold lg-desktop:pt-[15px] lg-desktop:text-[16px] px-5 pb-[10px] pt-[11px] text-[14px] leading-tight",o.tabValue===v?.tabValue&&"bg-white"),onClick:i=>w(i,o,p),value:o.tabValue,children:o.tabLabel},o.tabValue))})}),(0,e.jsx)("div",{className:"laptop:gap-2 hidden laptop:flex",children:C.metafields?.global?.specifications&&(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(W.SpecsModal,{})," | ",(0,e.jsx)(Y.default,{})]})})]})}),_=(0,l.forwardRef)((t,a)=>{const{locale:s="us",copyWriting:v}=(0,D.useAiuiContext)(),{variant:n,totalSavings:d}=(0,V.useBizProductContext)(),x=(0,l.useRef)(null),[C,u]=(0,l.useState)(null),[h,w]=(0,l.useState)(!0),[M,S]=(0,l.useState)(!1),[o,p]=(0,l.useState)(null),i=(0,l.useRef)(null),[y,k]=(0,l.useState)(!1),g=(0,l.useMemo)(()=>{if(t?.galleryTabType===N.GalleryTabType.GALLERY_IMAGE_MAIN)return"size-[240px] mx-auto mt-[42px] tablet:mt-16 tablet:size-[420px] lg-desktop:size-[560px]";t?.galleryTabType===N.GalleryTabType.GALLERY_IMAGE_FEATURES||(t?.galleryTabType,N.GalleryTabType.GALLERY_IMAGE_SCENE)},[t?.galleryTabType]),L=(0,l.useCallback)(()=>{o?.isBeginning?t.onPrevTab?.():o?.slidePrev()},[o,t]),P=(0,l.useCallback)(()=>{o?.isEnd?t.onNextTab?.():o?.slideNext()},[o,t]);return(0,l.useEffect)(()=>{o&&t.targetSlideIndex&&(o.slideTo(t.targetSlideIndex,0),t.onSlideChange?.())},[o,t.targetSlideIndex,t]),(0,l.useEffect)(()=>{if(i.current){const r=i.current,f=r.scrollHeight,A=r.clientHeight,z=f>A;k(z)}},[]),(0,e.jsxs)("div",{className:"h-full [&_.swiper-button]:hover:opacity-100",children:[(0,e.jsx)(E.Swiper,{ref:a,className:"h-full",onSwiper:p,onProgress:r=>{w(r.isBeginning),S(r.isEnd)},onTouchEnd:(r,f)=>{r.isBeginning&&r.swipeDirection==="prev"?L():r.isEnd&&r.swipeDirection==="next"&&P()},pagination:{clickable:!0,el:x.current},thumbs:{swiper:C},modules:[m.Mousewheel,m.Thumbs,m.Navigation,m.Pagination],mousewheel:{forceToAxis:!0},breakpoints:{0:{slidesPerView:1,freeMode:!1}},children:t?.galleries?.map((r,f)=>(0,e.jsx)(E.SwiperSlide,{className:"h-full",children:(0,e.jsx)(I.Picture,{source:r?.image?.url,alt:r?.image?.altText,className:(0,T.cn)("h-full",g),imgClassName:"object-cover h-full"})},t?.id+"SwiperSlideItem"+f))}),n.availableForSale&&!!d&&!t.index&&(0,e.jsx)(I.Badge,{size:"lg",className:"absolute bg-brand text-white top-3 laptop:left-16 laptop:top-5 left-4 z-[2] desktop:left-6 desktop:top-6",children:`${(0,$.formatPrice)({amount:d,currencyCode:n?.price?.currencyCode,locale:s})} ${v?.off}`}),(0,e.jsx)("div",{className:(0,T.cn)("hidden tablet:opacity-0 tablet:block tablet:absolute tablet:top-1/2 laptop:left-16 tablet:left-6 desktop:left-6 z-10 -translate-y-1/2 cursor-pointer","swiper-button"),onClick:L,children:(0,e.jsx)(H,{className:(0,T.cn)("tablet:size-10 lg-desktop:size-12")})}),(0,e.jsx)("div",{className:(0,T.cn)("hidden tablet:block tablet:opacity-0 tablet:absolute tablet:top-1/2 laptop:right-16 tablet:right-6 z-10 desktop:right-6 -translate-y-1/2 cursor-pointer","swiper-button"),onClick:P,children:(0,e.jsx)(F,{className:(0,T.cn)("tablet:size-10 lg-desktop:size-12")})}),(0,e.jsxs)("div",{className:"absolute bottom-[94px] tablet:bottom-[70px] left-4 right-4 z-10 items-center tablet:flex justify-between laptop:left-16 laptop:right-16 desktop:bottom-[20px] desktop:right-6 desktop:left-6",children:[(0,e.jsx)("div",{className:"hidden tablet:block",children:(0,e.jsx)(E.Swiper,{className:"flex items-center justify-between",onSwiper:u,spaceBetween:12,slidesPerView:6,freeMode:!0,watchSlidesProgress:!0,modules:[m.Navigation,m.Thumbs],children:t?.galleries?.map((r,f)=>(0,e.jsx)(E.SwiperSlide,{className:"!w-auto border [&.swiper-slide-thumb-active]:rounded [&.swiper-slide-thumb-active]:border-brand",children:(0,e.jsx)(I.Picture,{source:r.image?.url,alt:r.image?.altText,className:"size-10 lg-desktop:size-12 overflow-hidden bg-white rounded",imgClassName:"object-contain h-full"})},t?.id+"SwiperSlideThumbItem"+f))})}),!t?.index&&(0,e.jsxs)("div",{className:"flex items-center gap-2",children:[(0,e.jsx)(I.Picture,{source:t?.comment?.avatar?.url,className:"size-8 laptop:size-10 rounded-full shrink-0",imgClassName:"object-cover "}),(0,e.jsx)("div",{className:"overflow-hidden max-w-[528px] relative",children:(0,e.jsx)("div",{ref:i,className:(0,T.cn)("h-10 lg-desktop:h-12",y?"animate-marquee-scroll":""),style:{animationDuration:"3s"},children:(0,e.jsx)(I.Text,{html:t?.comment?.content,className:"text-sm lg-desktop:text-base font-bold text-[#1D1D1F]"})})})]})]}),(0,e.jsx)("div",{ref:x,className:"tablet:hidden [&_.swiper-pagination-bullet]:bg-white [&_.swiper-pagination-bullet]:opacity-100 [&_.swiper-pagination-bullet]:bg-white text-center absolute !bottom-[70px] left-4 right-4 z-10"})]})}),le=t=>{const[a,s]=(0,l.useState)(null),v=(0,l.useCallback)(()=>{a?.isBeginning?t.onPrevTab?.():a?.slidePrev()},[a,t]),n=(0,l.useCallback)(()=>{a?.isEnd?t.onNextTab?.():a?.slideNext()},[a,t]);return(0,l.useEffect)(()=>{a&&t.targetSlideIndex!==null&&t.targetSlideIndex!==void 0&&(a.slideTo(t.targetSlideIndex,0),t.onSlideChange?.())},[a,t.targetSlideIndex,t]),(0,e.jsxs)("div",{className:"h-full [&_.swiper-button]:hover:opacity-100",children:[(0,e.jsx)(E.Swiper,{className:"h-full",onSwiper:s,onTouchEnd:(d,x)=>{d.isBeginning&&d.swipeDirection==="prev"?v():d.isEnd&&d.swipeDirection==="next"&&n()},modules:[m.Mousewheel,m.Thumbs,m.Navigation,m.Pagination],mousewheel:{forceToAxis:!0},breakpoints:{0:{slidesPerView:1,freeMode:!1}},children:t?.galleries?.map((d,x)=>(0,e.jsx)(E.SwiperSlide,{className:"h-full",children:(0,e.jsxs)("video",{controls:!0,className:"size-full object-cover",children:[(0,e.jsx)("track",{kind:"captions"}),(0,e.jsx)("source",{src:d?.sources?.[0]?.url,type:"video/mp4"}),(0,e.jsx)("source",{src:d?.sources?.[0]?.url,type:"video/webm"}),(0,e.jsx)("source",{src:d?.sources?.[0]?.url,type:"video/ogg"})]})},t?.id+"SwiperSlideItem"+x))}),(0,e.jsx)("div",{className:(0,T.cn)("hidden swiper-button tablet:block tablet:opacity-0 tablet:absolute tablet:top-1/2 tablet:left-6 z-10 -translate-y-1/2 cursor-pointer"),onClick:v,children:(0,e.jsx)(H,{className:"tablet:size-10 lg-desktop:size-12"})}),(0,e.jsx)("div",{className:(0,T.cn)("hidden tablet:block swiper-button tablet:opacity-0 tablet:absolute tablet:top-1/2 tablet:right-6 z-10 -translate-y-1/2 cursor-pointer"),onClick:n,children:(0,e.jsx)(F,{className:"tablet:size-10 lg-desktop:size-12"})})]})},se=t=>(0,e.jsx)("div",{children:"3D View"});var ae=ee;
1
+ "use strict";var ee=Object.create;var z=Object.defineProperty;var te=Object.getOwnPropertyDescriptor;var le=Object.getOwnPropertyNames;var ae=Object.getPrototypeOf,oe=Object.prototype.hasOwnProperty;var ie=(t,a)=>{for(var s in a)z(t,s,{get:a[s],enumerable:!0})},W=(t,a,s,h)=>{if(a&&typeof a=="object"||typeof a=="function")for(let n of le(a))!oe.call(t,n)&&n!==s&&z(t,n,{get:()=>a[n],enumerable:!(h=te(a,n))||h.enumerable});return t};var re=(t,a,s)=>(s=t!=null?ee(ae(t)):{},W(a||!t||!t.__esModule?z(s,"default",{value:t,enumerable:!0}):s,t)),se=t=>W(z({},"__esModule",{value:!0}),t);var pe={};ie(pe,{default:()=>ue});module.exports=se(pe);var e=require("react/jsx-runtime"),$=require("../../../../AiuiProvider/index.js"),P=require("../../../../../components"),l=require("react"),L=require("swiper/react"),g=require("swiper/modules"),x=require("../../../../../helpers/index.js"),G=require("./types.js"),_=require("@radix-ui/react-tabs"),D=require("../../../BizProductProvider.js"),K=require("../../../hooks/use-variant-media.js"),q=require("./components/SpecsModal.js"),U=re(require("./components/CompareModal.js")),Z=require("../../../utils/index.js"),J=require("../../../../../shared/Styles.js"),Q=require("../../../../../shared/track.js"),X=require("../../../../../components/index.js");const Y=t=>(0,e.jsxs)("svg",{width:"48",height:"48",viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t,children:[(0,e.jsx)("rect",{x:"48",y:"48",width:"48",height:"48",rx:"24",transform:"rotate(-180 48 48)",fill:"white"}),(0,e.jsx)("path",{d:"M25.1035 16.8545C25.5372 16.3818 26.246 16.3818 26.6797 16.8545C27.1067 17.3201 27.1067 18.0706 26.6797 18.5361L21.668 24L26.6797 29.4639C27.1067 29.9294 27.1067 30.6799 26.6797 31.1455C26.246 31.6182 25.5372 31.6182 25.1035 31.1455L19.3203 24.8408C18.8933 24.3752 18.8933 23.6248 19.3203 23.1592L25.1035 16.8545Z",fill:"currentColor"})]}),O=t=>(0,e.jsxs)("svg",{width:"48",height:"48",viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t,children:[(0,e.jsx)("rect",{width:"48",height:"48",rx:"24",transform:"matrix(1 -8.74228e-08 -8.74228e-08 -1 0 48)",fill:"white"}),(0,e.jsx)("path",{d:"M22.8965 16.8545C22.4628 16.3818 21.754 16.3818 21.3203 16.8545C20.8933 17.3201 20.8933 18.0706 21.3203 18.5361L26.332 24L21.3203 29.4639C20.8933 29.9294 20.8933 30.6799 21.3203 31.1455C21.754 31.6182 22.4628 31.6182 22.8965 31.1455L28.6797 24.8408C29.1067 24.3752 29.1067 23.6248 28.6797 23.1592L22.8965 16.8545Z",fill:"currentColor"})]}),ne=()=>{const{copyWriting:t}=(0,$.useAiuiContext)(),{product:a,variant:s,selectedOptions:h}=(0,D.useBizProductContext)(),n=(0,K.useVariantMedia)({product:a,variant:s}),[p,w]=(0,l.useState)(null),A=(0,l.useRef)(null),b=s?.metafields?.component?.custom_media_list;let y,S,R,k;b&&b?.available?(y=b?.product||[],S=b?.scenarios||[],R=b?.keyFeatures||[],k=b?.video||[]):(y=n?.productList,S=n?.sceneList,R=n?.keyFeaturesList,k=n?.videoList);const r=(0,l.useMemo)(()=>[...y,...S,...k],[y,S,k]),m={productList:y,sceneList:S,keyFeaturesList:R,videoList:k},o=(0,l.useMemo)(()=>(a?.payload?.components?.find(d=>d.componentKey==="ProductGallery")?.data||[])?.map(d=>{let H=m[d?.galleries]||[];if(d?.images&&Array.isArray(d.images)&&d.images.length>0){const F=d.images.map(u=>{const M=[];if(u.image_390&&u.image_390.trim()&&M.push(`${u.image_390} 390`),u.image_768&&u.image_768.trim()&&M.push(`${u.image_768} 768`),u.image_1024&&u.image_1024.trim()&&M.push(`${u.image_1024} 1024`),u.image_1440&&u.image_1440.trim()&&M.push(`${u.image_1440} 1440`),u.image_1920&&u.image_1920.trim()&&M.push(`${u.image_1920} 1920`),M.length>0){const j=M.join(", ");return{image:{url:j,altText:d.comment?.content||""},_fromImages:!0,_responsiveSource:j}}return null}).filter(u=>u!==null);F.length>0&&(H=F)}return{...d,galleries:H}}).filter(d=>d.galleries.length>0),[a?.payload,m]),[T,E]=(0,l.useState)(o?.[0]),[v,C]=(0,l.useState)(0),[I,i]=(0,l.useState)(null),f=(0,l.useCallback)(()=>{const c=(v+1)%o.length;C(c),E(o[c]),i(0)},[v,o]),N=(0,l.useCallback)(()=>{const c=v===0?o.length-1:v-1;C(c),E(o[c]);const d=o[c]?.galleries||[];i(d.length-1)},[v,o]);(0,l.useEffect)(()=>{v!=null&&requestAnimationFrame(()=>{A.current?.scrollToTab(v)})},[v]),(0,l.useEffect)(()=>{E(o[0]),C(0)},[s?.id]);const V=(c,d)=>{switch(c?.galleryTabType){case G.GalleryTabType.GALLERY_IMAGE_MAIN:return(0,e.jsx)(B,{...c,index:d,onNextTab:f,onPrevTab:N,targetSlideIndex:I,onSlideChange:()=>i(null)});case G.GalleryTabType.GALLERY_IMAGE_FEATURES:return(0,e.jsx)(B,{...c,index:d,onNextTab:f,onPrevTab:N,targetSlideIndex:I,onSlideChange:()=>i(null)});case G.GalleryTabType.GALLERY_IMAGE_SCENE:return(0,e.jsx)(B,{...c,index:d,onNextTab:f,onPrevTab:N,targetSlideIndex:I,onSlideChange:()=>i(null)});case G.GalleryTabType.GALLERY_VIDEO:return(0,e.jsx)(de,{...c,onNextTab:f,onPrevTab:N,targetSlideIndex:I,onSlideChange:()=>i(null)});default:return null}};return(0,e.jsx)("div",{id:"ipc-product-gallery",children:(0,e.jsxs)(_.Root,{className:"relative",value:T?.tabValue,defaultValue:o?.[0]?.tabValue,children:[(0,e.jsx)("div",{className:"h-[420px] overflow-hidden tablet:h-[620px] desktop:rounded-2xl desktop:h-[560px] lg-desktop:h-[700px] bg-[#EAEAEC] desktop:relative ",children:o.map((c,d)=>(0,e.jsx)(_.Content,{className:"h-full",value:c.tabValue,children:V(c,d)},c.tabValue))}),(0,e.jsx)(ce,{ref:A,galleryTabs:o,activeGalleryTab:T,setActiveGalleryTab:E,setActiveTabIndex:C,setTargetSlideIndex:i})]})})},ce=(0,l.forwardRef)((t,a)=>{const{galleryTabs:s,activeGalleryTab:h,setActiveGalleryTab:n,setActiveTabIndex:p,setTargetSlideIndex:w}=t,{product:A}=(0,D.useBizProductContext)(),b=(0,l.useRef)(null),y=(0,l.useRef)(new Map),S=(0,l.useCallback)((r,m,o)=>{n(m),p(o),w(0),R(r)},[n,p,w]),R=(0,l.useCallback)(r=>{if(b.current){const m=b.current,o=r.currentTarget,T=o.offsetLeft-m.offsetWidth/2+o.offsetWidth/2;m.scrollTo({left:T,behavior:"smooth"})}},[]),k=(0,l.useCallback)(r=>{if(b.current&&s[r]){const m=b.current,o=s[r],T=y.current.get(o.tabValue);if(T){const E=T.offsetLeft-m.offsetWidth/2+T.offsetWidth/2;m.scrollTo({left:E,behavior:"smooth"})}}},[s]);return(0,l.useImperativeHandle)(a,()=>({scrollToTab:k})),(0,e.jsxs)("div",{className:"absolute z-[2] bottom-4 left-4 right-4 laptop:left-16 laptop:right-16 flex justify-between items-center tablet:mt-3 desktop:static",children:[(0,e.jsx)(_.List,{ref:b,className:"rounded-full bg-[#EAEAEC] p-1 laptop:p-0 desktop:p-1 overflow-x-auto",style:{scrollbarWidth:"none",msOverflowStyle:"none"},children:(0,e.jsx)("div",{className:"whitespace-nowrap",children:s?.map((r,m)=>(0,e.jsx)(_.Trigger,{ref:o=>{o?y.current.set(r.tabValue,o):y.current.delete(r.tabValue)},className:(0,x.cn)("lg-desktop:px-7 lg-desktop:pb-[14px] rounded-full font-bold lg-desktop:pt-[15px] lg-desktop:text-[16px] px-5 pb-[10px] pt-[11px] text-[14px] leading-tight",r.tabValue===h?.tabValue&&"bg-white"),onClick:o=>S(o,r,m),value:r.tabValue,children:r.tabLabel},r.tabValue))})}),(0,e.jsx)("div",{className:"laptop:gap-2 hidden laptop:flex",children:A.metafields?.global?.specifications&&(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(q.SpecsModal,{})," | ",(0,e.jsx)(U.default,{})]})})]})}),B=(0,l.forwardRef)((t,a)=>{const{locale:s="us",copyWriting:h}=(0,$.useAiuiContext)(),{variant:n,totalSavings:p}=(0,D.useBizProductContext)(),w=(0,l.useRef)(null),[A,b]=(0,l.useState)(null),[y,S]=(0,l.useState)(!0),[R,k]=(0,l.useState)(!1),[r,m]=(0,l.useState)(null),o=(0,l.useRef)(null),[T,E]=(0,l.useState)(!1),v=(0,l.useMemo)(()=>{if(t?.galleryTabType===G.GalleryTabType.GALLERY_IMAGE_MAIN)return"size-[240px] mx-auto mt-[42px] tablet:mt-16 tablet:size-[420px] lg-desktop:size-[560px]";t?.galleryTabType===G.GalleryTabType.GALLERY_IMAGE_FEATURES||(t?.galleryTabType,G.GalleryTabType.GALLERY_IMAGE_SCENE)},[t?.galleryTabType]),C=(0,l.useCallback)(()=>{r?.isBeginning?t.onPrevTab?.():r?.slidePrev()},[r,t]),I=(0,l.useCallback)(()=>{r?.isEnd?t.onNextTab?.():r?.slideNext()},[r,t]);return(0,l.useEffect)(()=>{r&&t.targetSlideIndex&&(r.slideTo(t.targetSlideIndex,0),t.onSlideChange?.())},[r,t.targetSlideIndex,t]),(0,l.useEffect)(()=>{if(o.current){const i=o.current,f=i.scrollHeight,N=i.clientHeight,V=f>N;E(V)}},[]),(0,e.jsxs)("div",{className:"h-full [&_.swiper-button]:hover:opacity-100",children:[(0,e.jsx)(L.Swiper,{ref:a,className:"h-full",onSwiper:m,onProgress:i=>{S(i.isBeginning),k(i.isEnd)},onTouchEnd:(i,f)=>{i.isBeginning&&i.swipeDirection==="prev"?C():i.isEnd&&i.swipeDirection==="next"&&I()},pagination:{clickable:!0,el:w.current},thumbs:{swiper:A},modules:[g.Mousewheel,g.Thumbs,g.Navigation,g.Pagination],mousewheel:{forceToAxis:!0},breakpoints:{0:{slidesPerView:1,freeMode:!1}},children:t?.galleries?.map((i,f)=>{const N=`${t.id}-${f}`,V=()=>{(0,Q.gaTrack)({event:"ga4Event",event_name:"component_impression",event_parameters:{page_group:`Product Detail Page${n.sku}`,component_type:"image",component_name:t?.tabLabel||"",position:f+1,creative_id:"",component_title:"",component_description:"",navigation:""}})},c=i?._responsiveSource||i?.image?.url||"";return console.log("item",i?._responsiveSource),(0,e.jsx)(L.SwiperSlide,{className:"h-full",children:(0,e.jsx)(X.ExposureDetector,{onExposure:V,exposureKey:N,threshold:.5,duration:2e3,className:"h-full",children:(0,e.jsx)(P.Picture,{source:c,alt:i?.image?.altText,className:(0,x.cn)("h-full",v),imgClassName:"object-cover h-full"})})},t?.id+"SwiperSlideItem"+f)})}),n.availableForSale&&!!p&&!t.index&&(0,e.jsx)(P.Badge,{size:"lg",className:"absolute bg-brand text-white top-3 laptop:left-16 laptop:top-5 left-4 z-[2] desktop:left-6 desktop:top-6",children:`${(0,Z.formatPrice)({amount:p,currencyCode:n?.price?.currencyCode,locale:s})} ${h?.off}`}),(0,e.jsx)("div",{className:(0,x.cn)("hidden tablet:opacity-0 tablet:block tablet:absolute tablet:top-1/2 laptop:left-16 tablet:left-6 desktop:left-6 z-10 -translate-y-1/2 cursor-pointer","swiper-button"),onClick:C,children:(0,e.jsx)(Y,{className:(0,x.cn)("tablet:size-10 lg-desktop:size-12")})}),(0,e.jsx)("div",{className:(0,x.cn)("hidden tablet:block tablet:opacity-0 tablet:absolute tablet:top-1/2 laptop:right-16 tablet:right-6 z-10 desktop:right-6 -translate-y-1/2 cursor-pointer","swiper-button"),onClick:I,children:(0,e.jsx)(O,{className:(0,x.cn)("tablet:size-10 lg-desktop:size-12")})}),(0,e.jsxs)("div",{className:"absolute bottom-[94px] tablet:bottom-[70px] left-4 right-4 z-10 items-center tablet:flex justify-between laptop:left-16 laptop:right-16 desktop:bottom-[20px] desktop:right-6 desktop:left-6",children:[(0,e.jsx)("div",{className:"hidden tablet:block",children:(0,e.jsx)(L.Swiper,{className:"flex items-center justify-between",onSwiper:b,spaceBetween:12,slidesPerView:6,freeMode:!0,watchSlidesProgress:!0,modules:[g.Navigation,g.Thumbs],children:t?.galleries?.map((i,f)=>(0,e.jsx)(L.SwiperSlide,{className:"!w-auto border border-transparent cursor-pointer [&.swiper-slide-thumb-active]:rounded [&.swiper-slide-thumb-active]:border-brand",children:(0,e.jsx)(P.Picture,{source:i.image?.url,alt:i.image?.altText,className:"size-10 lg-desktop:size-12 overflow-hidden bg-white rounded",imgClassName:"object-contain h-full"})},t?.id+"SwiperSlideThumbItem"+f))})}),!t?.index&&(0,e.jsxs)("div",{className:"flex items-center gap-2",children:[(0,e.jsx)(P.Picture,{source:t?.comment?.avatar?.url,className:"size-8 laptop:size-10 rounded-full shrink-0",imgClassName:"object-cover "}),(0,e.jsx)("div",{className:"overflow-hidden max-w-[528px] relative",children:(0,e.jsx)("div",{ref:o,className:(0,x.cn)("h-10 lg-desktop:h-12",T?"animate-marquee-scroll":""),style:{animationDuration:"3s"},children:(0,e.jsx)(P.Text,{html:t?.comment?.content,className:"text-sm lg-desktop:text-base font-bold text-[#1D1D1F]"})})})]})]}),(0,e.jsx)("div",{ref:w,className:"tablet:hidden [&_.swiper-pagination-bullet]:bg-white [&_.swiper-pagination-bullet]:opacity-100 [&_.swiper-pagination-bullet]:bg-white text-center absolute !bottom-[70px] left-4 right-4 z-10"})]})}),de=t=>{const[a,s]=(0,l.useState)(null),h=(0,l.useCallback)(()=>{a?.isBeginning?t.onPrevTab?.():a?.slidePrev()},[a,t]),n=(0,l.useCallback)(()=>{a?.isEnd?t.onNextTab?.():a?.slideNext()},[a,t]);return(0,l.useEffect)(()=>{a&&t.targetSlideIndex!==null&&t.targetSlideIndex!==void 0&&(a.slideTo(t.targetSlideIndex,0),t.onSlideChange?.())},[a,t.targetSlideIndex,t]),(0,e.jsxs)("div",{className:"h-full [&_.swiper-button]:hover:opacity-100",children:[(0,e.jsx)(L.Swiper,{className:"h-full",onSwiper:s,onTouchEnd:(p,w)=>{p.isBeginning&&p.swipeDirection==="prev"?h():p.isEnd&&p.swipeDirection==="next"&&n()},modules:[g.Mousewheel,g.Thumbs,g.Navigation,g.Pagination],mousewheel:{forceToAxis:!0},breakpoints:{0:{slidesPerView:1,freeMode:!1}},children:t?.galleries?.map((p,w)=>(0,e.jsx)(L.SwiperSlide,{className:"h-full",children:(0,e.jsxs)("video",{controls:!0,className:"size-full object-cover",children:[(0,e.jsx)("track",{kind:"captions"}),(0,e.jsx)("source",{src:p?.sources?.[0]?.url,type:"video/mp4"}),(0,e.jsx)("source",{src:p?.sources?.[0]?.url,type:"video/webm"}),(0,e.jsx)("source",{src:p?.sources?.[0]?.url,type:"video/ogg"})]})},t?.id+"SwiperSlideItem"+w))}),(0,e.jsx)("div",{className:(0,x.cn)("hidden swiper-button tablet:block tablet:opacity-0 tablet:absolute tablet:top-1/2 tablet:left-6 z-10 -translate-y-1/2 cursor-pointer"),onClick:h,children:(0,e.jsx)(Y,{className:"tablet:size-10 lg-desktop:size-12"})}),(0,e.jsx)("div",{className:(0,x.cn)("hidden tablet:block swiper-button tablet:opacity-0 tablet:absolute tablet:top-1/2 tablet:right-6 z-10 -translate-y-1/2 cursor-pointer"),onClick:n,children:(0,e.jsx)(O,{className:"tablet:size-10 lg-desktop:size-12"})})]})},ge=t=>(0,e.jsx)("div",{children:"3D View"});var ue=(0,J.withLayout)(ne);
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/ProductGallery/index.tsx"],
4
- "sourcesContent": ["import { useAiuiContext } from '../../../../AiuiProvider/index.js'\nimport { Text, Picture, Button, Badge } from '../../../../../components'\nimport {\n useCallback,\n useMemo,\n useState,\n forwardRef,\n useRef,\n type RefObject,\n useEffect,\n type Dispatch,\n type SetStateAction,\n useImperativeHandle,\n} from 'react'\nimport { Swiper, SwiperSlide, type SwiperRef } from 'swiper/react'\nimport { Navigation, Mousewheel, Thumbs, Pagination } from 'swiper/modules'\nimport { cn } from '../../../../../helpers/index.js'\nimport { GalleryTabType } from './types.js'\nimport { Content, List, Root, Trigger } from '@radix-ui/react-tabs'\nimport { useBizProductContext } from '../../../BizProductProvider.js'\nimport { useVariantMedia } from '../../../hooks/use-variant-media.js'\nimport { SpecsModal } from './components/SpecsModal.js'\nimport CompareModal from './components/CompareModal.js'\nimport { formatPrice } from '../../../utils/index.js'\n\nimport type { Swiper as SwiperType } from 'swiper'\nimport type { ImageMedia, VideoMedia } from '../../../hooks/use-variant-media.js'\nimport type { ProductGalleryProps, ProductGalleryTabItemProps, GalleryTabItemProps } from './types.js'\n\nconst SwiperLeftButtonIcon = (props: React.SVGProps<SVGSVGElement>) => {\n return (\n <svg width=\"48\" height=\"48\" viewBox=\"0 0 48 48\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\" {...props}>\n <rect x=\"48\" y=\"48\" width=\"48\" height=\"48\" rx=\"24\" transform=\"rotate(-180 48 48)\" fill=\"white\" />\n <path\n d=\"M25.1035 16.8545C25.5372 16.3818 26.246 16.3818 26.6797 16.8545C27.1067 17.3201 27.1067 18.0706 26.6797 18.5361L21.668 24L26.6797 29.4639C27.1067 29.9294 27.1067 30.6799 26.6797 31.1455C26.246 31.6182 25.5372 31.6182 25.1035 31.1455L19.3203 24.8408C18.8933 24.3752 18.8933 23.6248 19.3203 23.1592L25.1035 16.8545Z\"\n fill=\"currentColor\"\n />\n </svg>\n )\n}\n\nconst SwiperRightButtonIcon = (props: React.SVGProps<SVGSVGElement>) => {\n return (\n <svg width=\"48\" height=\"48\" viewBox=\"0 0 48 48\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\" {...props}>\n <rect width=\"48\" height=\"48\" rx=\"24\" transform=\"matrix(1 -8.74228e-08 -8.74228e-08 -1 0 48)\" fill=\"white\" />\n <path\n d=\"M22.8965 16.8545C22.4628 16.3818 21.754 16.3818 21.3203 16.8545C20.8933 17.3201 20.8933 18.0706 21.3203 18.5361L26.332 24L21.3203 29.4639C20.8933 29.9294 20.8933 30.6799 21.3203 31.1455C21.754 31.6182 22.4628 31.6182 22.8965 31.1455L28.6797 24.8408C29.1067 24.3752 29.1067 23.6248 28.6797 23.1592L22.8965 16.8545Z\"\n fill=\"currentColor\"\n />\n </svg>\n )\n}\n\nconst ProductGallery = () => {\n const { copyWriting } = useAiuiContext()\n const { product, variant, selectedOptions } = useBizProductContext()\n const defaultMediaData = useVariantMedia({ product, variant })\n const [swiper, setSwiper] = useState<SwiperType | null>(null)\n const productGalleryTabRef = useRef<ProductGalleryTabRef>(null)\n\n const customMediaList = variant?.metafields?.component?.custom_media_list\n let productList: ImageMedia[], sceneList: ImageMedia[], keyFeaturesList: ImageMedia[], videoList: VideoMedia[]\n\n if (customMediaList && customMediaList?.available) {\n productList = customMediaList?.product || []\n sceneList = customMediaList?.scenarios || []\n keyFeaturesList = customMediaList?.keyFeatures || []\n videoList = customMediaList?.video || []\n } else {\n productList = defaultMediaData?.productList\n sceneList = defaultMediaData?.sceneList\n keyFeaturesList = defaultMediaData?.keyFeaturesList\n videoList = defaultMediaData?.videoList\n }\n\n const allMedia = useMemo(() => [...productList, ...sceneList, ...videoList], [productList, sceneList, videoList])\n\n const galleryMap: Record<string, ImageMedia[] | VideoMedia[]> = {\n productList: productList,\n sceneList: sceneList,\n keyFeaturesList: keyFeaturesList,\n videoList: videoList,\n }\n\n const galleryTabs = useMemo(() => {\n const productTab =\n product?.payload?.components?.find((item: any) => item.componentKey === 'ProductGallery')?.data || []\n\n return productTab\n ?.map((item: any) => ({\n ...item,\n galleries: galleryMap[item?.galleries] || [],\n }))\n .filter((item: any) => item.galleries.length > 0)\n }, [product?.payload, galleryMap])\n\n const [activeGalleryTab, setActiveGalleryTab] = useState<GalleryTabItemProps>(galleryTabs?.[0])\n const [activeTabIndex, setActiveTabIndex] = useState(0)\n const [targetSlideIndex, setTargetSlideIndex] = useState<number | null>(null)\n\n // \u5207\u6362\u5230\u4E0B\u4E00\u4E2A tab\uFF08\u8DF3\u8F6C\u5230\u7B2C\u4E00\u5F20\uFF09\n const handleNextTab = useCallback(() => {\n const nextIndex = (activeTabIndex + 1) % galleryTabs.length\n setActiveTabIndex(nextIndex)\n setActiveGalleryTab(galleryTabs[nextIndex])\n setTargetSlideIndex(0) // \u8DF3\u8F6C\u5230\u7B2C\u4E00\u5F20\n }, [activeTabIndex, galleryTabs])\n\n // \u5207\u6362\u5230\u4E0A\u4E00\u4E2A tab\uFF08\u8DF3\u8F6C\u5230\u6700\u540E\u4E00\u5F20\uFF09\n const handlePrevTab = useCallback(() => {\n const prevIndex = activeTabIndex === 0 ? galleryTabs.length - 1 : activeTabIndex - 1\n setActiveTabIndex(prevIndex)\n setActiveGalleryTab(galleryTabs[prevIndex])\n // \u8DF3\u8F6C\u5230\u4E0A\u4E00\u4E2A tab \u7684\u6700\u540E\u4E00\u5F20\n const prevTabGalleries = galleryTabs[prevIndex]?.galleries || []\n setTargetSlideIndex(prevTabGalleries.length - 1)\n }, [activeTabIndex, galleryTabs])\n\n // \u5F53 activeTabIndex \u53D8\u5316\u65F6\uFF0C\u81EA\u52A8\u6EDA\u52A8\u5230\u5BF9\u5E94\u7684 tab\n useEffect(() => {\n if (activeTabIndex !== null && activeTabIndex !== undefined) {\n // \u4F7F\u7528 requestAnimationFrame \u786E\u4FDD DOM \u5DF2\u66F4\u65B0\n requestAnimationFrame(() => {\n productGalleryTabRef.current?.scrollToTab(activeTabIndex)\n })\n }\n }, [activeTabIndex])\n\n useEffect(() => {\n // \u5F53 variant \u53D8\u5316\u65F6\uFF0C\u5207\u6362\u5230\u7B2C\u4E00\u4E2A tab\n setActiveGalleryTab(galleryTabs[0])\n setActiveTabIndex(0)\n }, [variant?.id])\n\n // \u4E3A\u6BCF\u4E2A tab \u6E32\u67D3\u5BF9\u5E94\u7684\u7EC4\u4EF6\n const renderGalleryForTab = (tab: any, index: number) => {\n switch (tab?.galleryTabType) {\n case GalleryTabType.GALLERY_IMAGE_MAIN:\n return (\n <ProductGalleryTabImage\n {...tab}\n index={index}\n onNextTab={handleNextTab}\n onPrevTab={handlePrevTab}\n targetSlideIndex={targetSlideIndex}\n onSlideChange={() => setTargetSlideIndex(null)}\n />\n )\n case GalleryTabType.GALLERY_IMAGE_FEATURES:\n return (\n <ProductGalleryTabImage\n {...tab}\n index={index}\n onNextTab={handleNextTab}\n onPrevTab={handlePrevTab}\n targetSlideIndex={targetSlideIndex}\n onSlideChange={() => setTargetSlideIndex(null)}\n />\n )\n case GalleryTabType.GALLERY_IMAGE_SCENE:\n return (\n <ProductGalleryTabImage\n {...tab}\n index={index}\n onNextTab={handleNextTab}\n onPrevTab={handlePrevTab}\n targetSlideIndex={targetSlideIndex}\n onSlideChange={() => setTargetSlideIndex(null)}\n />\n )\n case GalleryTabType.GALLERY_VIDEO:\n return (\n <ProductGalleryTabVideo\n {...tab}\n onNextTab={handleNextTab}\n onPrevTab={handlePrevTab}\n targetSlideIndex={targetSlideIndex}\n onSlideChange={() => setTargetSlideIndex(null)}\n />\n )\n default:\n return null\n }\n }\n\n return (\n <div id=\"ipc-product-gallery\">\n <Root className=\"relative\" value={activeGalleryTab?.tabValue} defaultValue={galleryTabs?.[0]?.tabValue}>\n <div className=\"h-[420px] overflow-hidden tablet:h-[620px] desktop:rounded-2xl desktop:h-[560px] lg-desktop:h-[700px] bg-[#EAEAEC] desktop:relative \">\n {galleryTabs.map((item: any, index: number) => {\n return (\n <Content key={item.tabValue} className=\"h-full\" value={item.tabValue}>\n {renderGalleryForTab(item, index)}\n </Content>\n )\n })}\n </div>\n <ProductGalleryTab\n ref={productGalleryTabRef}\n galleryTabs={galleryTabs}\n activeGalleryTab={activeGalleryTab}\n setActiveGalleryTab={setActiveGalleryTab}\n setActiveTabIndex={setActiveTabIndex}\n setTargetSlideIndex={setTargetSlideIndex}\n />\n </Root>\n </div>\n )\n}\n\nexport interface ProductGalleryTabRef {\n scrollToTab: (index: number) => void\n}\n\nconst ProductGalleryTab = forwardRef<\n ProductGalleryTabRef,\n {\n galleryTabs: GalleryTabItemProps[]\n activeGalleryTab: GalleryTabItemProps\n setActiveGalleryTab: Dispatch<SetStateAction<GalleryTabItemProps>>\n setActiveTabIndex: Dispatch<SetStateAction<number>>\n setTargetSlideIndex: Dispatch<SetStateAction<number | null>>\n }\n>((props, ref) => {\n const { galleryTabs, activeGalleryTab, setActiveGalleryTab, setActiveTabIndex, setTargetSlideIndex } = props\n const { product } = useBizProductContext()\n const scrollContainerRef = useRef<HTMLDivElement>(null)\n const triggerRefs = useRef<Map<string, HTMLButtonElement>>(new Map())\n\n const handleGalleryTabClick = useCallback(\n (el: React.MouseEvent<HTMLButtonElement>, item: GalleryTabItemProps, index: number) => {\n setActiveGalleryTab(item)\n setActiveTabIndex(index)\n setTargetSlideIndex(0) // \u624B\u52A8\u70B9\u51FB tab \u65F6\uFF0C\u8DF3\u8F6C\u5230\u7B2C\u4E00\u5F20\n scrollToEvent(el)\n },\n [setActiveGalleryTab, setActiveTabIndex, setTargetSlideIndex]\n )\n\n const scrollToEvent = useCallback((event: React.MouseEvent<HTMLButtonElement>) => {\n if (scrollContainerRef.current) {\n const container = scrollContainerRef.current\n const button = event.currentTarget\n const scrollLeft = button.offsetLeft - container.offsetWidth / 2 + button.offsetWidth / 2\n container.scrollTo({\n left: scrollLeft,\n behavior: 'smooth',\n })\n }\n }, [])\n\n // \u6EDA\u52A8\u5230\u6307\u5B9A\u7D22\u5F15\u7684 tab\n const scrollToTab = useCallback(\n (index: number) => {\n if (scrollContainerRef.current && galleryTabs[index]) {\n const container = scrollContainerRef.current\n const tabItem = galleryTabs[index]\n const button = triggerRefs.current.get(tabItem.tabValue)\n\n if (button) {\n const scrollLeft = button.offsetLeft - container.offsetWidth / 2 + button.offsetWidth / 2\n container.scrollTo({\n left: scrollLeft,\n behavior: 'smooth',\n })\n }\n }\n },\n [galleryTabs]\n )\n\n useImperativeHandle(ref, () => ({\n scrollToTab,\n }))\n\n return (\n <div className=\"absolute z-[2] bottom-4 left-4 right-4 laptop:left-16 laptop:right-16 flex justify-between items-center tablet:mt-3 desktop:static\">\n <List\n ref={scrollContainerRef}\n className=\"rounded-full bg-[#EAEAEC] p-1 laptop:p-0 desktop:p-1 overflow-x-auto\"\n style={{\n scrollbarWidth: 'none',\n msOverflowStyle: 'none',\n }}\n >\n <div className=\"whitespace-nowrap\">\n {galleryTabs?.map((item, index) => {\n return (\n <Trigger\n ref={el => {\n if (el) {\n triggerRefs.current.set(item.tabValue, el)\n } else {\n triggerRefs.current.delete(item.tabValue)\n }\n }}\n className={cn(\n 'lg-desktop:px-7 lg-desktop:pb-[14px] rounded-full font-bold lg-desktop:pt-[15px] lg-desktop:text-[16px] px-5 pb-[10px] pt-[11px] text-[14px] leading-tight',\n item.tabValue === activeGalleryTab?.tabValue && 'bg-white'\n )}\n onClick={el => handleGalleryTabClick(el, item, index)}\n key={item.tabValue}\n value={item.tabValue}\n >\n {item.tabLabel}\n </Trigger>\n )\n })}\n </div>\n </List>\n <div className=\"laptop:gap-2 hidden laptop:flex\">\n {product.metafields?.global?.specifications && (\n <>\n <SpecsModal /> | <CompareModal />\n </>\n )}\n </div>\n </div>\n )\n})\n\nconst ProductGalleryTabImage = forwardRef<SwiperRef, ProductGalleryTabItemProps>((props, ref) => {\n const { locale = 'us', copyWriting } = useAiuiContext()\n const { variant, totalSavings } = useBizProductContext()\n const paginationRef = useRef<HTMLDivElement>(null)\n const [thumbsSwiper, setThumbsSwiper] = useState<SwiperType | null>(null)\n const [isStart, setStart] = useState(true)\n const [isEnd, setEnd] = useState(false)\n const [swiper, setSwiper] = useState<SwiperType | null>(null)\n const commentRef = useRef<HTMLDivElement>(null)\n const [shouldScroll, setShouldScroll] = useState(false)\n\n const imageClassName = useMemo(() => {\n if (props?.galleryTabType === GalleryTabType.GALLERY_IMAGE_MAIN) {\n return 'size-[240px] mx-auto mt-[42px] tablet:mt-16 tablet:size-[420px] lg-desktop:size-[560px]'\n } else if (props?.galleryTabType === GalleryTabType.GALLERY_IMAGE_FEATURES) {\n // return '420px'\n } else if (props?.galleryTabType === GalleryTabType.GALLERY_IMAGE_SCENE) {\n // return '560px'\n }\n }, [props?.galleryTabType])\n\n // \u5904\u7406\u5DE6\u53F3\u6309\u94AE\u70B9\u51FB\uFF0C\u652F\u6301\u8DE8 tab \u5FAA\u73AF\n const handlePrevClick = useCallback(() => {\n if (swiper?.isBeginning) {\n // \u5F53\u524D tab \u5DF2\u7ECF\u662F\u7B2C\u4E00\u5F20\uFF0C\u5207\u6362\u5230\u4E0A\u4E00\u4E2A tab\n props.onPrevTab?.()\n } else {\n // \u5426\u5219\u5728\u5F53\u524D tab \u5185\u5207\u6362\n swiper?.slidePrev()\n }\n }, [swiper, props])\n\n const handleNextClick = useCallback(() => {\n if (swiper?.isEnd) {\n // \u5F53\u524D tab \u5DF2\u7ECF\u662F\u6700\u540E\u4E00\u5F20\uFF0C\u5207\u6362\u5230\u4E0B\u4E00\u4E2A tab\n props.onNextTab?.()\n } else {\n // \u5426\u5219\u5728\u5F53\u524D tab \u5185\u5207\u6362\n swiper?.slideNext()\n }\n }, [swiper, props])\n\n // \u76D1\u542C targetSlideIndex\uFF0C\u5F53 tab \u5207\u6362\u65F6\u8DF3\u8F6C\u5230\u6307\u5B9A\u7684 slide\n useEffect(() => {\n if (swiper && !!props.targetSlideIndex) {\n swiper.slideTo(props.targetSlideIndex, 0) // 0 \u8868\u793A\u7ACB\u5373\u8DF3\u8F6C\uFF0C\u65E0\u52A8\u753B\n props.onSlideChange?.() // \u6E05\u9664 targetSlideIndex\n }\n }, [swiper, props.targetSlideIndex, props])\n\n // \u68C0\u6D4B\u6587\u672C\u5185\u5BB9\u662F\u5426\u8D85\u8FC7\u5BB9\u5668\u9AD8\u5EA6\uFF0C\u51B3\u5B9A\u662F\u5426\u9700\u8981\u6EDA\u52A8\n useEffect(() => {\n if (commentRef.current) {\n const container = commentRef.current\n const contentHeight = container.scrollHeight\n const containerHeight = container.clientHeight\n const needsScroll = contentHeight > containerHeight\n setShouldScroll(needsScroll)\n }\n }, [])\n\n return (\n <div className=\"h-full [&_.swiper-button]:hover:opacity-100\">\n <Swiper\n ref={ref}\n className=\"h-full\"\n // navigation={{\n // nextEl: `.ipc-product-gallery-${props?.id}-custom-swiper-button-next`,\n // prevEl: `.ipc-product-gallery-${props?.id}-custom-swiper-button-prev`,\n // }}\n onSwiper={setSwiper}\n onProgress={swiper => {\n setStart(swiper.isBeginning)\n setEnd(swiper.isEnd)\n }}\n onTouchEnd={(swiper, event) => {\n if (swiper.isBeginning && swiper.swipeDirection === 'prev') {\n handlePrevClick()\n } else if (swiper.isEnd && swiper.swipeDirection === 'next') {\n handleNextClick()\n }\n }}\n pagination={{\n clickable: true,\n el: paginationRef.current,\n }}\n thumbs={{ swiper: thumbsSwiper }}\n modules={[Mousewheel, Thumbs, Navigation, Pagination]}\n mousewheel={{\n forceToAxis: true,\n }}\n breakpoints={{\n 0: {\n slidesPerView: 1,\n freeMode: false,\n },\n }}\n >\n {props?.galleries?.map((item, jIndex) => {\n return (\n <SwiperSlide className=\"h-full\" key={props?.id + 'SwiperSlideItem' + jIndex}>\n <Picture\n source={item?.image?.url}\n alt={item?.image?.altText}\n className={cn('h-full', imageClassName)}\n imgClassName=\"object-cover h-full\"\n />\n </SwiperSlide>\n )\n })}\n </Swiper>\n {variant.availableForSale && !!totalSavings && !props.index && (\n <Badge\n size=\"lg\"\n className=\"absolute bg-brand text-white top-3 laptop:left-16 laptop:top-5 left-4 z-[2] desktop:left-6 desktop:top-6\"\n >\n {`${formatPrice({\n amount: totalSavings,\n currencyCode: variant?.price?.currencyCode,\n locale: locale,\n })} ${copyWriting?.off}`}\n </Badge>\n )}\n <div\n className={cn(\n 'hidden tablet:opacity-0 tablet:block tablet:absolute tablet:top-1/2 laptop:left-16 tablet:left-6 desktop:left-6 z-10 -translate-y-1/2 cursor-pointer',\n // `ipc-product-gallery-${props?.id}-custom-swiper-button-prev`,\n `swiper-button`\n )}\n onClick={handlePrevClick}\n >\n <SwiperLeftButtonIcon className={cn('tablet:size-10 lg-desktop:size-12')} />\n </div>\n <div\n className={cn(\n 'hidden tablet:block tablet:opacity-0 tablet:absolute tablet:top-1/2 laptop:right-16 tablet:right-6 z-10 desktop:right-6 -translate-y-1/2 cursor-pointer',\n // `ipc-product-gallery-${props?.id}-custom-swiper-button-next`,\n `swiper-button`\n )}\n onClick={handleNextClick}\n >\n <SwiperRightButtonIcon className={cn('tablet:size-10 lg-desktop:size-12')} />\n </div>\n {/* {props?.galleries?.map((item, jIndex) => {\n return (\n <Picture\n key={props?.id + 'SwiperSlideItem' + jIndex}\n source={item?.image?.url}\n alt={item?.image?.altText}\n className=\"h-full\"\n imgClassName=\"object-cover h-full\"\n />\n )\n })} */}\n <div className=\"absolute bottom-[94px] tablet:bottom-[70px] left-4 right-4 z-10 items-center tablet:flex justify-between laptop:left-16 laptop:right-16 desktop:bottom-[20px] desktop:right-6 desktop:left-6\">\n <div className=\"hidden tablet:block\">\n <Swiper\n className=\"flex items-center justify-between\"\n onSwiper={setThumbsSwiper}\n spaceBetween={12}\n slidesPerView={6}\n freeMode={true}\n watchSlidesProgress={true}\n modules={[Navigation, Thumbs]}\n >\n {props?.galleries?.map((item, jIndex) => (\n <SwiperSlide\n key={props?.id + 'SwiperSlideThumbItem' + jIndex}\n className=\"!w-auto border [&.swiper-slide-thumb-active]:rounded [&.swiper-slide-thumb-active]:border-brand\"\n >\n <Picture\n source={item.image?.url}\n alt={item.image?.altText}\n className=\"size-10 lg-desktop:size-12 overflow-hidden bg-white rounded\"\n imgClassName=\"object-contain h-full\"\n />\n </SwiperSlide>\n ))}\n </Swiper>\n </div>\n {!props?.index && (\n <div className=\"flex items-center gap-2\">\n <Picture\n source={props?.comment?.avatar?.url}\n className=\"size-8 laptop:size-10 rounded-full shrink-0\"\n imgClassName=\"object-cover \"\n />\n <div className=\"overflow-hidden max-w-[528px] relative\">\n <div\n ref={commentRef}\n className={cn('h-10 lg-desktop:h-12', shouldScroll ? 'animate-marquee-scroll' : '')}\n style={{\n animationDuration: `3s`,\n }}\n >\n <Text\n html={props?.comment?.content}\n className=\"text-sm lg-desktop:text-base font-bold text-[#1D1D1F]\"\n />\n </div>\n </div>\n </div>\n )}\n </div>\n <div\n ref={paginationRef}\n className=\"tablet:hidden [&_.swiper-pagination-bullet]:bg-white [&_.swiper-pagination-bullet]:opacity-100 [&_.swiper-pagination-bullet]:bg-white text-center absolute !bottom-[70px] left-4 right-4 z-10\"\n />\n </div>\n )\n})\n\nconst ProductGalleryTabVideo = (props: ProductGalleryTabItemProps) => {\n const [swiper, setSwiper] = useState<SwiperType | null>(null)\n\n // \u5904\u7406\u5DE6\u53F3\u6309\u94AE\u70B9\u51FB\uFF0C\u652F\u6301\u8DE8 tab \u5FAA\u73AF\n const handlePrevClick = useCallback(() => {\n if (swiper?.isBeginning) {\n // \u5F53\u524D tab \u5DF2\u7ECF\u662F\u7B2C\u4E00\u5F20\uFF0C\u5207\u6362\u5230\u4E0A\u4E00\u4E2A tab\n props.onPrevTab?.()\n } else {\n // \u5426\u5219\u5728\u5F53\u524D tab \u5185\u5207\u6362\n swiper?.slidePrev()\n }\n }, [swiper, props])\n\n const handleNextClick = useCallback(() => {\n if (swiper?.isEnd) {\n // \u5F53\u524D tab \u5DF2\u7ECF\u662F\u6700\u540E\u4E00\u5F20\uFF0C\u5207\u6362\u5230\u4E0B\u4E00\u4E2A tab\n props.onNextTab?.()\n } else {\n // \u5426\u5219\u5728\u5F53\u524D tab \u5185\u5207\u6362\n swiper?.slideNext()\n }\n }, [swiper, props])\n\n // \u76D1\u542C targetSlideIndex\uFF0C\u5F53 tab \u5207\u6362\u65F6\u8DF3\u8F6C\u5230\u6307\u5B9A\u7684 slide\n useEffect(() => {\n if (swiper && props.targetSlideIndex !== null && props.targetSlideIndex !== undefined) {\n swiper.slideTo(props.targetSlideIndex, 0) // 0 \u8868\u793A\u7ACB\u5373\u8DF3\u8F6C\uFF0C\u65E0\u52A8\u753B\n props.onSlideChange?.() // \u6E05\u9664 targetSlideIndex\n }\n }, [swiper, props.targetSlideIndex, props])\n\n return (\n <div className=\"h-full [&_.swiper-button]:hover:opacity-100\">\n <Swiper\n className=\"h-full\"\n onSwiper={setSwiper}\n onTouchEnd={(swiper, event) => {\n if (swiper.isBeginning && swiper.swipeDirection === 'prev') {\n handlePrevClick()\n } else if (swiper.isEnd && swiper.swipeDirection === 'next') {\n handleNextClick()\n }\n }}\n // navigation={{\n // nextEl: `.ipc-product-gallery-${props?.id}-custom-swiper-button-next`,\n // prevEl: `.ipc-product-gallery-${props?.id}-custom-swiper-button-prev`,\n // }}\n modules={[Mousewheel, Thumbs, Navigation, Pagination]}\n mousewheel={{\n forceToAxis: true,\n }}\n breakpoints={{\n 0: {\n slidesPerView: 1,\n freeMode: false,\n },\n }}\n >\n {props?.galleries?.map((item, jIndex) => {\n return (\n <SwiperSlide className=\"h-full\" key={props?.id + 'SwiperSlideItem' + jIndex}>\n <video controls className=\"size-full object-cover\">\n <track kind=\"captions\" />\n <source src={item?.sources?.[0]?.url} type=\"video/mp4\" />\n <source src={item?.sources?.[0]?.url} type=\"video/webm\" />\n <source src={item?.sources?.[0]?.url} type=\"video/ogg\" />\n </video>\n </SwiperSlide>\n )\n })}\n </Swiper>\n <div\n className={cn(\n 'hidden swiper-button tablet:block tablet:opacity-0 tablet:absolute tablet:top-1/2 tablet:left-6 z-10 -translate-y-1/2 cursor-pointer'\n // `ipc-product-gallery-${props?.id}-custom-swiper-button-prev`\n )}\n onClick={handlePrevClick}\n >\n <SwiperLeftButtonIcon className=\"tablet:size-10 lg-desktop:size-12\" />\n </div>\n <div\n className={cn(\n 'hidden tablet:block swiper-button tablet:opacity-0 tablet:absolute tablet:top-1/2 tablet:right-6 z-10 -translate-y-1/2 cursor-pointer'\n // `ipc-product-gallery-${props?.id}-custom-swiper-button-next`\n )}\n onClick={handleNextClick}\n >\n <SwiperRightButtonIcon className=\"tablet:size-10 lg-desktop:size-12\" />\n </div>\n </div>\n )\n}\n\nconst ProductGalleryTab3DView = (props: ProductGalleryTabItemProps) => {\n return <div>3D View</div>\n}\n\nexport default ProductGallery\n"],
5
- "mappings": "0jBAAA,IAAAA,GAAA,GAAAC,EAAAD,GAAA,aAAAE,KAAA,eAAAC,EAAAH,IA+BI,IAAAI,EAAA,6BA/BJC,EAA+B,6CAC/BC,EAA6C,qCAC7CC,EAWO,iBACPA,EAAoD,wBACpDC,EAA2D,0BAC3DC,EAAmB,2CACnBC,EAA+B,sBAC/BC,EAA6C,gCAC7CC,EAAqC,0CACrCC,EAAgC,+CAChCC,EAA2B,sCAC3BC,EAAyB,2CACzBC,EAA4B,mCAM5B,MAAMC,EAAwBC,MAE1B,QAAC,OAAI,MAAM,KAAK,OAAO,KAAK,QAAQ,YAAY,KAAK,OAAO,MAAM,6BAA8B,GAAGA,EACjG,oBAAC,QAAK,EAAE,KAAK,EAAE,KAAK,MAAM,KAAK,OAAO,KAAK,GAAG,KAAK,UAAU,qBAAqB,KAAK,QAAQ,KAC/F,OAAC,QACC,EAAE,4TACF,KAAK,eACP,GACF,EAIEC,EAAyBD,MAE3B,QAAC,OAAI,MAAM,KAAK,OAAO,KAAK,QAAQ,YAAY,KAAK,OAAO,MAAM,6BAA8B,GAAGA,EACjG,oBAAC,QAAK,MAAM,KAAK,OAAO,KAAK,GAAG,KAAK,UAAU,8CAA8C,KAAK,QAAQ,KAC1G,OAAC,QACC,EAAE,4TACF,KAAK,eACP,GACF,EAIEE,GAAiB,IAAM,CAC3B,KAAM,CAAE,YAAAC,CAAY,KAAI,kBAAe,EACjC,CAAE,QAAAC,EAAS,QAAAC,EAAS,gBAAAC,CAAgB,KAAI,wBAAqB,EAC7DC,KAAmB,mBAAgB,CAAE,QAAAH,EAAS,QAAAC,CAAQ,CAAC,EACvD,CAACG,EAAQC,CAAS,KAAI,YAA4B,IAAI,EACtDC,KAAuB,UAA6B,IAAI,EAExDC,EAAkBN,GA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AAW,KACvB,OAAC,UAAO,IAAKjD,GAAM,UAAU,CAAC,GAAG,IAAK,KAAK,YAAY,KACvD,OAAC,UAAO,IAAKA,GAAM,UAAU,CAAC,GAAG,IAAK,KAAK,aAAa,KACxD,OAAC,UAAO,IAAKA,GAAM,UAAU,CAAC,GAAG,IAAK,KAAK,YAAY,GACzD,GANmCnB,GAAO,GAAK,kBAAoBoE,CAOrE,CAEH,EACH,KACA,OAAC,OACC,aAAW,MACT,sIAEF,EACA,QAASL,EAET,mBAAChE,EAAA,CAAqB,UAAU,oCAAoC,EACtE,KACA,OAAC,OACC,aAAW,MACT,uIAEF,EACA,QAASiE,EAET,mBAAC/D,EAAA,CAAsB,UAAU,oCAAoC,EACvE,GACF,CAEJ,EAEMoE,GAA2BrE,MACxB,OAAC,OAAI,mBAAO,EAGrB,IAAOhB,GAAQkB",
6
- "names": ["ProductGallery_exports", "__export", "ProductGallery_default", "__toCommonJS", "import_jsx_runtime", "import_AiuiProvider", "import_components", "import_react", "import_modules", "import_helpers", "import_types", "import_react_tabs", "import_BizProductProvider", "import_use_variant_media", "import_SpecsModal", "import_CompareModal", "import_utils", "SwiperLeftButtonIcon", "props", "SwiperRightButtonIcon", "ProductGallery", "copyWriting", "product", "variant", "selectedOptions", "defaultMediaData", "swiper", "setSwiper", "productGalleryTabRef", "customMediaList", "productList", "sceneList", "keyFeaturesList", "videoList", "allMedia", "galleryMap", "galleryTabs", "item", "activeGalleryTab", "setActiveGalleryTab", "activeTabIndex", "setActiveTabIndex", "targetSlideIndex", "setTargetSlideIndex", "handleNextTab", "nextIndex", "handlePrevTab", "prevIndex", "prevTabGalleries", "renderGalleryForTab", "tab", "index", "ProductGalleryTabImage", "ProductGalleryTabVideo", "ProductGalleryTab", "ref", "scrollContainerRef", "triggerRefs", "handleGalleryTabClick", "el", "scrollToEvent", "event", "container", "button", "scrollLeft", "scrollToTab", "tabItem", "CompareModal", "locale", "totalSavings", "paginationRef", "thumbsSwiper", "setThumbsSwiper", "isStart", "setStart", "isEnd", "setEnd", "commentRef", "shouldScroll", "setShouldScroll", "imageClassName", "handlePrevClick", "handleNextClick", "contentHeight", "containerHeight", "needsScroll", "jIndex", "ProductGalleryTab3DView"]
4
+ "sourcesContent": ["import { useAiuiContext } from '../../../../AiuiProvider/index.js'\nimport { Text, Picture, Button, Badge } from '../../../../../components'\nimport {\n useCallback,\n useMemo,\n useState,\n forwardRef,\n useRef,\n type RefObject,\n useEffect,\n type Dispatch,\n type SetStateAction,\n useImperativeHandle,\n} from 'react'\nimport { Swiper, SwiperSlide, type SwiperRef } from 'swiper/react'\nimport { Navigation, Mousewheel, Thumbs, Pagination } from 'swiper/modules'\nimport { cn } from '../../../../../helpers/index.js'\nimport { GalleryTabType } from './types.js'\nimport { Content, List, Root, Trigger } from '@radix-ui/react-tabs'\nimport { useBizProductContext } from '../../../BizProductProvider.js'\nimport { useVariantMedia } from '../../../hooks/use-variant-media.js'\nimport { SpecsModal } from './components/SpecsModal.js'\nimport CompareModal from './components/CompareModal.js'\nimport { formatPrice } from '../../../utils/index.js'\nimport { withLayout } from '../../../../../shared/Styles.js'\nimport { gaTrack } from '../../../../../shared/track.js'\nimport { ExposureDetector } from '../../../../../components/index.js'\n\nimport type { Swiper as SwiperType } from 'swiper'\nimport type { ImageMedia, VideoMedia } from '../../../hooks/use-variant-media.js'\nimport type { ProductGalleryProps, ProductGalleryTabItemProps, GalleryTabItemProps } from './types.js'\n\nconst SwiperLeftButtonIcon = (props: React.SVGProps<SVGSVGElement>) => {\n return (\n <svg width=\"48\" height=\"48\" viewBox=\"0 0 48 48\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\" {...props}>\n <rect x=\"48\" y=\"48\" width=\"48\" height=\"48\" rx=\"24\" transform=\"rotate(-180 48 48)\" fill=\"white\" />\n <path\n d=\"M25.1035 16.8545C25.5372 16.3818 26.246 16.3818 26.6797 16.8545C27.1067 17.3201 27.1067 18.0706 26.6797 18.5361L21.668 24L26.6797 29.4639C27.1067 29.9294 27.1067 30.6799 26.6797 31.1455C26.246 31.6182 25.5372 31.6182 25.1035 31.1455L19.3203 24.8408C18.8933 24.3752 18.8933 23.6248 19.3203 23.1592L25.1035 16.8545Z\"\n fill=\"currentColor\"\n />\n </svg>\n )\n}\n\nconst SwiperRightButtonIcon = (props: React.SVGProps<SVGSVGElement>) => {\n return (\n <svg width=\"48\" height=\"48\" viewBox=\"0 0 48 48\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\" {...props}>\n <rect width=\"48\" height=\"48\" rx=\"24\" transform=\"matrix(1 -8.74228e-08 -8.74228e-08 -1 0 48)\" fill=\"white\" />\n <path\n d=\"M22.8965 16.8545C22.4628 16.3818 21.754 16.3818 21.3203 16.8545C20.8933 17.3201 20.8933 18.0706 21.3203 18.5361L26.332 24L21.3203 29.4639C20.8933 29.9294 20.8933 30.6799 21.3203 31.1455C21.754 31.6182 22.4628 31.6182 22.8965 31.1455L28.6797 24.8408C29.1067 24.3752 29.1067 23.6248 28.6797 23.1592L22.8965 16.8545Z\"\n fill=\"currentColor\"\n />\n </svg>\n )\n}\n\nconst ProductGallery = () => {\n const { copyWriting } = useAiuiContext()\n const { product, variant, selectedOptions } = useBizProductContext()\n const defaultMediaData = useVariantMedia({ product, variant })\n const [swiper, setSwiper] = useState<SwiperType | null>(null)\n const productGalleryTabRef = useRef<ProductGalleryTabRef>(null)\n\n const customMediaList = variant?.metafields?.component?.custom_media_list\n let productList: ImageMedia[], sceneList: ImageMedia[], keyFeaturesList: ImageMedia[], videoList: VideoMedia[]\n\n if (customMediaList && customMediaList?.available) {\n productList = customMediaList?.product || []\n sceneList = customMediaList?.scenarios || []\n keyFeaturesList = customMediaList?.keyFeatures || []\n videoList = customMediaList?.video || []\n } else {\n productList = defaultMediaData?.productList\n sceneList = defaultMediaData?.sceneList\n keyFeaturesList = defaultMediaData?.keyFeaturesList\n videoList = defaultMediaData?.videoList\n }\n\n const allMedia = useMemo(() => [...productList, ...sceneList, ...videoList], [productList, sceneList, videoList])\n\n const galleryMap: Record<string, ImageMedia[] | VideoMedia[]> = {\n productList: productList,\n sceneList: sceneList,\n keyFeaturesList: keyFeaturesList,\n videoList: videoList,\n }\n\n const galleryTabs = useMemo(() => {\n const productTab: ProductGalleryProps =\n product?.payload?.components?.find((item: any) => item.componentKey === 'ProductGallery')?.data || []\n\n return productTab\n ?.map((item: any) => {\n // \u5982\u679C\u5B58\u5728 images \u6570\u7EC4\u4E14\u6709\u6709\u6548\u503C\uFF0C\u4F18\u5148\u4F7F\u7528 images \u521B\u5EFA\u54CD\u5E94\u5F0F\u56FE\u7247\u6570\u636E\n let galleries = galleryMap[item?.galleries] || []\n \n if (item?.images && Array.isArray(item.images) && item.images.length > 0) {\n // \u5904\u7406 images \u6570\u7EC4\uFF0C\u4E3A\u6BCF\u5F20\u56FE\u7247\u751F\u6210\u54CD\u5E94\u5F0F source\n const imageGalleries = item.images\n .map((imageItem: any) => {\n // \u4ECE\u5355\u4E2A\u56FE\u7247\u5BF9\u8C61\u751F\u6210\u54CD\u5E94\u5F0F\u56FE\u7247\u7684 source \u5B57\u7B26\u4E32\n const imageSourceParts: string[] = []\n if (imageItem.image_390 && imageItem.image_390.trim()) {\n imageSourceParts.push(`${imageItem.image_390} 390`)\n }\n if (imageItem.image_768 && imageItem.image_768.trim()) {\n imageSourceParts.push(`${imageItem.image_768} 768`)\n }\n if (imageItem.image_1024 && imageItem.image_1024.trim()) {\n imageSourceParts.push(`${imageItem.image_1024} 1024`)\n }\n if (imageItem.image_1440 && imageItem.image_1440.trim()) {\n imageSourceParts.push(`${imageItem.image_1440} 1440`)\n }\n if (imageItem.image_1920 && imageItem.image_1920.trim()) {\n imageSourceParts.push(`${imageItem.image_1920} 1920`)\n }\n \n // \u5982\u679C\u751F\u6210\u4E86\u6709\u6548\u7684\u54CD\u5E94\u5F0F source\uFF0C\u8FD4\u56DE\u56FE\u7247\u5BF9\u8C61\n if (imageSourceParts.length > 0) {\n const responsiveSource = imageSourceParts.join(', ')\n return {\n image: {\n url: responsiveSource,\n altText: item.comment?.content || '',\n },\n // \u6807\u8BB0\u8FD9\u662F\u4ECE images \u751F\u6210\u7684\uFF0C\u7528\u4E8E\u540E\u7EED\u5904\u7406\n _fromImages: true,\n _responsiveSource: responsiveSource,\n } as any\n }\n return null\n })\n .filter((gallery: any) => gallery !== null) // \u8FC7\u6EE4\u6389\u65E0\u6548\u7684\u56FE\u7247\n \n // \u5982\u679C\u4ECE images \u6570\u7EC4\u751F\u6210\u4E86\u6709\u6548\u7684\u56FE\u7247\uFF0C\u4F7F\u7528\u5B83\u4EEC\uFF1B\u5426\u5219\u56DE\u9000\u5230\u539F\u6709\u7684 galleries\n if (imageGalleries.length > 0) {\n galleries = imageGalleries\n }\n // \u5982\u679C images \u5B58\u5728\u4F46\u90FD\u662F\u7A7A\u503C\uFF0C\u5219\u56DE\u9000\u5230\u539F\u6709\u7684 galleries \u903B\u8F91\n }\n \n return {\n ...item,\n galleries,\n }\n })\n .filter((item: any) => item.galleries.length > 0)\n }, [product?.payload, galleryMap])\n\n const [activeGalleryTab, setActiveGalleryTab] = useState<GalleryTabItemProps>(galleryTabs?.[0])\n const [activeTabIndex, setActiveTabIndex] = useState(0)\n const [targetSlideIndex, setTargetSlideIndex] = useState<number | null>(null)\n\n // \u5207\u6362\u5230\u4E0B\u4E00\u4E2A tab\uFF08\u8DF3\u8F6C\u5230\u7B2C\u4E00\u5F20\uFF09\n const handleNextTab = useCallback(() => {\n const nextIndex = (activeTabIndex + 1) % galleryTabs.length\n setActiveTabIndex(nextIndex)\n setActiveGalleryTab(galleryTabs[nextIndex])\n setTargetSlideIndex(0) // \u8DF3\u8F6C\u5230\u7B2C\u4E00\u5F20\n }, [activeTabIndex, galleryTabs])\n\n // \u5207\u6362\u5230\u4E0A\u4E00\u4E2A tab\uFF08\u8DF3\u8F6C\u5230\u6700\u540E\u4E00\u5F20\uFF09\n const handlePrevTab = useCallback(() => {\n const prevIndex = activeTabIndex === 0 ? galleryTabs.length - 1 : activeTabIndex - 1\n setActiveTabIndex(prevIndex)\n setActiveGalleryTab(galleryTabs[prevIndex])\n // \u8DF3\u8F6C\u5230\u4E0A\u4E00\u4E2A tab \u7684\u6700\u540E\u4E00\u5F20\n const prevTabGalleries = galleryTabs[prevIndex]?.galleries || []\n setTargetSlideIndex(prevTabGalleries.length - 1)\n }, [activeTabIndex, galleryTabs])\n\n // \u5F53 activeTabIndex \u53D8\u5316\u65F6\uFF0C\u81EA\u52A8\u6EDA\u52A8\u5230\u5BF9\u5E94\u7684 tab\n useEffect(() => {\n if (activeTabIndex !== null && activeTabIndex !== undefined) {\n // \u4F7F\u7528 requestAnimationFrame \u786E\u4FDD DOM \u5DF2\u66F4\u65B0\n requestAnimationFrame(() => {\n productGalleryTabRef.current?.scrollToTab(activeTabIndex)\n })\n }\n }, [activeTabIndex])\n\n useEffect(() => {\n // \u5F53 variant \u53D8\u5316\u65F6\uFF0C\u5207\u6362\u5230\u7B2C\u4E00\u4E2A tab\n setActiveGalleryTab(galleryTabs[0])\n setActiveTabIndex(0)\n }, [variant?.id])\n\n // \u4E3A\u6BCF\u4E2A tab \u6E32\u67D3\u5BF9\u5E94\u7684\u7EC4\u4EF6\n const renderGalleryForTab = (tab: any, index: number) => {\n switch (tab?.galleryTabType) {\n case GalleryTabType.GALLERY_IMAGE_MAIN:\n return (\n <ProductGalleryTabImage\n {...tab}\n index={index}\n onNextTab={handleNextTab}\n onPrevTab={handlePrevTab}\n targetSlideIndex={targetSlideIndex}\n onSlideChange={() => setTargetSlideIndex(null)}\n />\n )\n case GalleryTabType.GALLERY_IMAGE_FEATURES:\n return (\n <ProductGalleryTabImage\n {...tab}\n index={index}\n onNextTab={handleNextTab}\n onPrevTab={handlePrevTab}\n targetSlideIndex={targetSlideIndex}\n onSlideChange={() => setTargetSlideIndex(null)}\n />\n )\n case GalleryTabType.GALLERY_IMAGE_SCENE:\n return (\n <ProductGalleryTabImage\n {...tab}\n index={index}\n onNextTab={handleNextTab}\n onPrevTab={handlePrevTab}\n targetSlideIndex={targetSlideIndex}\n onSlideChange={() => setTargetSlideIndex(null)}\n />\n )\n case GalleryTabType.GALLERY_VIDEO:\n return (\n <ProductGalleryTabVideo\n {...tab}\n onNextTab={handleNextTab}\n onPrevTab={handlePrevTab}\n targetSlideIndex={targetSlideIndex}\n onSlideChange={() => setTargetSlideIndex(null)}\n />\n )\n default:\n return null\n }\n }\n\n return (\n <div id=\"ipc-product-gallery\">\n <Root className=\"relative\" value={activeGalleryTab?.tabValue} defaultValue={galleryTabs?.[0]?.tabValue}>\n <div className=\"h-[420px] overflow-hidden tablet:h-[620px] desktop:rounded-2xl desktop:h-[560px] lg-desktop:h-[700px] bg-[#EAEAEC] desktop:relative \">\n {galleryTabs.map((item: any, index: number) => {\n return (\n <Content key={item.tabValue} className=\"h-full\" value={item.tabValue}>\n {renderGalleryForTab(item, index)}\n </Content>\n )\n })}\n </div>\n <ProductGalleryTab\n ref={productGalleryTabRef}\n galleryTabs={galleryTabs}\n activeGalleryTab={activeGalleryTab}\n setActiveGalleryTab={setActiveGalleryTab}\n setActiveTabIndex={setActiveTabIndex}\n setTargetSlideIndex={setTargetSlideIndex}\n />\n </Root>\n </div>\n )\n}\n\nexport interface ProductGalleryTabRef {\n scrollToTab: (index: number) => void\n}\n\nconst ProductGalleryTab = forwardRef<\n ProductGalleryTabRef,\n {\n galleryTabs: GalleryTabItemProps[]\n activeGalleryTab: GalleryTabItemProps\n setActiveGalleryTab: Dispatch<SetStateAction<GalleryTabItemProps>>\n setActiveTabIndex: Dispatch<SetStateAction<number>>\n setTargetSlideIndex: Dispatch<SetStateAction<number | null>>\n }\n>((props, ref) => {\n const { galleryTabs, activeGalleryTab, setActiveGalleryTab, setActiveTabIndex, setTargetSlideIndex } = props\n const { product } = useBizProductContext()\n const scrollContainerRef = useRef<HTMLDivElement>(null)\n const triggerRefs = useRef<Map<string, HTMLButtonElement>>(new Map())\n\n const handleGalleryTabClick = useCallback(\n (el: React.MouseEvent<HTMLButtonElement>, item: GalleryTabItemProps, index: number) => {\n setActiveGalleryTab(item)\n setActiveTabIndex(index)\n setTargetSlideIndex(0) // \u624B\u52A8\u70B9\u51FB tab \u65F6\uFF0C\u8DF3\u8F6C\u5230\u7B2C\u4E00\u5F20\n scrollToEvent(el)\n },\n [setActiveGalleryTab, setActiveTabIndex, setTargetSlideIndex]\n )\n\n const scrollToEvent = useCallback((event: React.MouseEvent<HTMLButtonElement>) => {\n if (scrollContainerRef.current) {\n const container = scrollContainerRef.current\n const button = event.currentTarget\n const scrollLeft = button.offsetLeft - container.offsetWidth / 2 + button.offsetWidth / 2\n container.scrollTo({\n left: scrollLeft,\n behavior: 'smooth',\n })\n }\n }, [])\n\n // \u6EDA\u52A8\u5230\u6307\u5B9A\u7D22\u5F15\u7684 tab\n const scrollToTab = useCallback(\n (index: number) => {\n if (scrollContainerRef.current && galleryTabs[index]) {\n const container = scrollContainerRef.current\n const tabItem = galleryTabs[index]\n const button = triggerRefs.current.get(tabItem.tabValue)\n\n if (button) {\n const scrollLeft = button.offsetLeft - container.offsetWidth / 2 + button.offsetWidth / 2\n container.scrollTo({\n left: scrollLeft,\n behavior: 'smooth',\n })\n }\n }\n },\n [galleryTabs]\n )\n\n useImperativeHandle(ref, () => ({\n scrollToTab,\n }))\n\n return (\n <div className=\"absolute z-[2] bottom-4 left-4 right-4 laptop:left-16 laptop:right-16 flex justify-between items-center tablet:mt-3 desktop:static\">\n <List\n ref={scrollContainerRef}\n className=\"rounded-full bg-[#EAEAEC] p-1 laptop:p-0 desktop:p-1 overflow-x-auto\"\n style={{\n scrollbarWidth: 'none',\n msOverflowStyle: 'none',\n }}\n >\n <div className=\"whitespace-nowrap\">\n {galleryTabs?.map((item, index) => {\n return (\n <Trigger\n ref={el => {\n if (el) {\n triggerRefs.current.set(item.tabValue, el)\n } else {\n triggerRefs.current.delete(item.tabValue)\n }\n }}\n className={cn(\n 'lg-desktop:px-7 lg-desktop:pb-[14px] rounded-full font-bold lg-desktop:pt-[15px] lg-desktop:text-[16px] px-5 pb-[10px] pt-[11px] text-[14px] leading-tight',\n item.tabValue === activeGalleryTab?.tabValue && 'bg-white'\n )}\n onClick={el => handleGalleryTabClick(el, item, index)}\n key={item.tabValue}\n value={item.tabValue}\n >\n {item.tabLabel}\n </Trigger>\n )\n })}\n </div>\n </List>\n <div className=\"laptop:gap-2 hidden laptop:flex\">\n {product.metafields?.global?.specifications && (\n <>\n <SpecsModal /> | <CompareModal />\n </>\n )}\n </div>\n </div>\n )\n})\n\nconst ProductGalleryTabImage = forwardRef<SwiperRef, ProductGalleryTabItemProps>((props, ref) => {\n const { locale = 'us', copyWriting } = useAiuiContext()\n const { variant, totalSavings } = useBizProductContext()\n const paginationRef = useRef<HTMLDivElement>(null)\n const [thumbsSwiper, setThumbsSwiper] = useState<SwiperType | null>(null)\n const [isStart, setStart] = useState(true)\n const [isEnd, setEnd] = useState(false)\n const [swiper, setSwiper] = useState<SwiperType | null>(null)\n const commentRef = useRef<HTMLDivElement>(null)\n const [shouldScroll, setShouldScroll] = useState(false)\n\n const imageClassName = useMemo(() => {\n if (props?.galleryTabType === GalleryTabType.GALLERY_IMAGE_MAIN) {\n return 'size-[240px] mx-auto mt-[42px] tablet:mt-16 tablet:size-[420px] lg-desktop:size-[560px]'\n } else if (props?.galleryTabType === GalleryTabType.GALLERY_IMAGE_FEATURES) {\n // return '420px'\n } else if (props?.galleryTabType === GalleryTabType.GALLERY_IMAGE_SCENE) {\n // return '560px'\n }\n }, [props?.galleryTabType])\n\n // \u5904\u7406\u5DE6\u53F3\u6309\u94AE\u70B9\u51FB\uFF0C\u652F\u6301\u8DE8 tab \u5FAA\u73AF\n const handlePrevClick = useCallback(() => {\n if (swiper?.isBeginning) {\n // \u5F53\u524D tab \u5DF2\u7ECF\u662F\u7B2C\u4E00\u5F20\uFF0C\u5207\u6362\u5230\u4E0A\u4E00\u4E2A tab\n props.onPrevTab?.()\n } else {\n // \u5426\u5219\u5728\u5F53\u524D tab \u5185\u5207\u6362\n swiper?.slidePrev()\n }\n }, [swiper, props])\n\n const handleNextClick = useCallback(() => {\n if (swiper?.isEnd) {\n // \u5F53\u524D tab \u5DF2\u7ECF\u662F\u6700\u540E\u4E00\u5F20\uFF0C\u5207\u6362\u5230\u4E0B\u4E00\u4E2A tab\n props.onNextTab?.()\n } else {\n // \u5426\u5219\u5728\u5F53\u524D tab \u5185\u5207\u6362\n swiper?.slideNext()\n }\n }, [swiper, props])\n\n // \u76D1\u542C targetSlideIndex\uFF0C\u5F53 tab \u5207\u6362\u65F6\u8DF3\u8F6C\u5230\u6307\u5B9A\u7684 slide\n useEffect(() => {\n if (swiper && !!props.targetSlideIndex) {\n swiper.slideTo(props.targetSlideIndex, 0) // 0 \u8868\u793A\u7ACB\u5373\u8DF3\u8F6C\uFF0C\u65E0\u52A8\u753B\n props.onSlideChange?.() // \u6E05\u9664 targetSlideIndex\n }\n }, [swiper, props.targetSlideIndex, props])\n\n\n // \u68C0\u6D4B\u6587\u672C\u5185\u5BB9\u662F\u5426\u8D85\u8FC7\u5BB9\u5668\u9AD8\u5EA6\uFF0C\u51B3\u5B9A\u662F\u5426\u9700\u8981\u6EDA\u52A8\n useEffect(() => {\n if (commentRef.current) {\n const container = commentRef.current\n const contentHeight = container.scrollHeight\n const containerHeight = container.clientHeight\n const needsScroll = contentHeight > containerHeight\n setShouldScroll(needsScroll)\n }\n }, [])\n\n return (\n <div className=\"h-full [&_.swiper-button]:hover:opacity-100\">\n <Swiper\n ref={ref}\n className=\"h-full\"\n // navigation={{\n // nextEl: `.ipc-product-gallery-${props?.id}-custom-swiper-button-next`,\n // prevEl: `.ipc-product-gallery-${props?.id}-custom-swiper-button-prev`,\n // }}\n onSwiper={setSwiper}\n onProgress={swiper => {\n setStart(swiper.isBeginning)\n setEnd(swiper.isEnd)\n }}\n onTouchEnd={(swiper, event) => {\n if (swiper.isBeginning && swiper.swipeDirection === 'prev') {\n handlePrevClick()\n } else if (swiper.isEnd && swiper.swipeDirection === 'next') {\n handleNextClick()\n }\n }}\n pagination={{\n clickable: true,\n el: paginationRef.current,\n }}\n thumbs={{ swiper: thumbsSwiper }}\n modules={[Mousewheel, Thumbs, Navigation, Pagination]}\n mousewheel={{\n forceToAxis: true,\n }}\n breakpoints={{\n 0: {\n slidesPerView: 1,\n freeMode: false,\n },\n }}\n >\n {props?.galleries?.map((item, jIndex) => {\n // \u751F\u6210\u552F\u4E00\u7684\u66DD\u5149 key\uFF08tabId + index\uFF09\n const exposureKey = `${props.id}-${jIndex}`\n\n // \u66DD\u5149\u68C0\u6D4B\u56DE\u8C03\n const handleExposure = () => {\n gaTrack({\n event: 'ga4Event',\n event_name: 'component_impression',\n event_parameters: {\n page_group: `Product Detail Page${variant.sku}`, \n component_type: 'image', \n component_name: props?.tabLabel || '', \n position: jIndex + 1,\n creative_id: '', \n component_title: '', \n component_description: '', \n navigation: '',\n },\n })\n }\n\n // \u4F18\u5148\u4F7F\u7528\u4ECE images \u751F\u6210\u7684\u54CD\u5E94\u5F0F source\uFF0C\u5426\u5219\u4F7F\u7528\u539F\u6709\u7684 image.url\n const pictureSource = (item as any)?._responsiveSource || item?.image?.url || ''\n console.log('item', (item as any)?._responsiveSource)\n \n return (\n <SwiperSlide className=\"h-full\" key={props?.id + 'SwiperSlideItem' + jIndex}>\n <ExposureDetector\n onExposure={handleExposure}\n exposureKey={exposureKey}\n threshold={0.5}\n duration={2000}\n className=\"h-full\"\n >\n <Picture\n source={pictureSource}\n alt={item?.image?.altText}\n className={cn('h-full', imageClassName)}\n imgClassName=\"object-cover h-full\"\n />\n </ExposureDetector>\n </SwiperSlide>\n )\n })}\n </Swiper>\n {variant.availableForSale && !!totalSavings && !props.index && (\n <Badge\n size=\"lg\"\n className=\"absolute bg-brand text-white top-3 laptop:left-16 laptop:top-5 left-4 z-[2] desktop:left-6 desktop:top-6\"\n >\n {`${formatPrice({\n amount: totalSavings,\n currencyCode: variant?.price?.currencyCode,\n locale: locale,\n })} ${copyWriting?.off}`}\n </Badge>\n )}\n <div\n className={cn(\n 'hidden tablet:opacity-0 tablet:block tablet:absolute tablet:top-1/2 laptop:left-16 tablet:left-6 desktop:left-6 z-10 -translate-y-1/2 cursor-pointer',\n // `ipc-product-gallery-${props?.id}-custom-swiper-button-prev`,\n `swiper-button`\n )}\n onClick={handlePrevClick}\n >\n <SwiperLeftButtonIcon className={cn('tablet:size-10 lg-desktop:size-12')} />\n </div>\n <div\n className={cn(\n 'hidden tablet:block tablet:opacity-0 tablet:absolute tablet:top-1/2 laptop:right-16 tablet:right-6 z-10 desktop:right-6 -translate-y-1/2 cursor-pointer',\n // `ipc-product-gallery-${props?.id}-custom-swiper-button-next`,\n `swiper-button`\n )}\n onClick={handleNextClick}\n >\n <SwiperRightButtonIcon className={cn('tablet:size-10 lg-desktop:size-12')} />\n </div>\n {/* {props?.galleries?.map((item, jIndex) => {\n return (\n <Picture\n key={props?.id + 'SwiperSlideItem' + jIndex}\n source={item?.image?.url}\n alt={item?.image?.altText}\n className=\"h-full\"\n imgClassName=\"object-cover h-full\"\n />\n )\n })} */}\n <div className=\"absolute bottom-[94px] tablet:bottom-[70px] left-4 right-4 z-10 items-center tablet:flex justify-between laptop:left-16 laptop:right-16 desktop:bottom-[20px] desktop:right-6 desktop:left-6\">\n <div className=\"hidden tablet:block\">\n <Swiper\n className=\"flex items-center justify-between\"\n onSwiper={setThumbsSwiper}\n spaceBetween={12}\n slidesPerView={6}\n freeMode={true}\n watchSlidesProgress={true}\n modules={[Navigation, Thumbs]}\n >\n {props?.galleries?.map((item, jIndex) => (\n <SwiperSlide\n key={props?.id + 'SwiperSlideThumbItem' + jIndex}\n className=\"!w-auto border border-transparent cursor-pointer [&.swiper-slide-thumb-active]:rounded [&.swiper-slide-thumb-active]:border-brand\"\n >\n <Picture\n source={item.image?.url}\n alt={item.image?.altText}\n className=\"size-10 lg-desktop:size-12 overflow-hidden bg-white rounded\"\n imgClassName=\"object-contain h-full\"\n />\n </SwiperSlide>\n ))}\n </Swiper>\n </div>\n {!props?.index && (\n <div className=\"flex items-center gap-2\">\n <Picture\n source={props?.comment?.avatar?.url}\n className=\"size-8 laptop:size-10 rounded-full shrink-0\"\n imgClassName=\"object-cover \"\n />\n <div className=\"overflow-hidden max-w-[528px] relative\">\n <div\n ref={commentRef}\n className={cn('h-10 lg-desktop:h-12', shouldScroll ? 'animate-marquee-scroll' : '')}\n style={{\n animationDuration: `3s`,\n }}\n >\n <Text\n html={props?.comment?.content}\n className=\"text-sm lg-desktop:text-base font-bold text-[#1D1D1F]\"\n />\n </div>\n </div>\n </div>\n )}\n </div>\n <div\n ref={paginationRef}\n className=\"tablet:hidden [&_.swiper-pagination-bullet]:bg-white [&_.swiper-pagination-bullet]:opacity-100 [&_.swiper-pagination-bullet]:bg-white text-center absolute !bottom-[70px] left-4 right-4 z-10\"\n />\n </div>\n )\n})\n\nconst ProductGalleryTabVideo = (props: ProductGalleryTabItemProps) => {\n const [swiper, setSwiper] = useState<SwiperType | null>(null)\n\n // \u5904\u7406\u5DE6\u53F3\u6309\u94AE\u70B9\u51FB\uFF0C\u652F\u6301\u8DE8 tab \u5FAA\u73AF\n const handlePrevClick = useCallback(() => {\n if (swiper?.isBeginning) {\n // \u5F53\u524D tab \u5DF2\u7ECF\u662F\u7B2C\u4E00\u5F20\uFF0C\u5207\u6362\u5230\u4E0A\u4E00\u4E2A tab\n props.onPrevTab?.()\n } else {\n // \u5426\u5219\u5728\u5F53\u524D tab \u5185\u5207\u6362\n swiper?.slidePrev()\n }\n }, [swiper, props])\n\n const handleNextClick = useCallback(() => {\n if (swiper?.isEnd) {\n // \u5F53\u524D tab \u5DF2\u7ECF\u662F\u6700\u540E\u4E00\u5F20\uFF0C\u5207\u6362\u5230\u4E0B\u4E00\u4E2A tab\n props.onNextTab?.()\n } else {\n // \u5426\u5219\u5728\u5F53\u524D tab \u5185\u5207\u6362\n swiper?.slideNext()\n }\n }, [swiper, props])\n\n // \u76D1\u542C targetSlideIndex\uFF0C\u5F53 tab \u5207\u6362\u65F6\u8DF3\u8F6C\u5230\u6307\u5B9A\u7684 slide\n useEffect(() => {\n if (swiper && props.targetSlideIndex !== null && props.targetSlideIndex !== undefined) {\n swiper.slideTo(props.targetSlideIndex, 0) // 0 \u8868\u793A\u7ACB\u5373\u8DF3\u8F6C\uFF0C\u65E0\u52A8\u753B\n props.onSlideChange?.() // \u6E05\u9664 targetSlideIndex\n }\n }, [swiper, props.targetSlideIndex, props])\n\n return (\n <div className=\"h-full [&_.swiper-button]:hover:opacity-100\">\n <Swiper\n className=\"h-full\"\n onSwiper={setSwiper}\n onTouchEnd={(swiper, event) => {\n if (swiper.isBeginning && swiper.swipeDirection === 'prev') {\n handlePrevClick()\n } else if (swiper.isEnd && swiper.swipeDirection === 'next') {\n handleNextClick()\n }\n }}\n // navigation={{\n // nextEl: `.ipc-product-gallery-${props?.id}-custom-swiper-button-next`,\n // prevEl: `.ipc-product-gallery-${props?.id}-custom-swiper-button-prev`,\n // }}\n modules={[Mousewheel, Thumbs, Navigation, Pagination]}\n mousewheel={{\n forceToAxis: true,\n }}\n breakpoints={{\n 0: {\n slidesPerView: 1,\n freeMode: false,\n },\n }}\n >\n {props?.galleries?.map((item, jIndex) => {\n return (\n <SwiperSlide className=\"h-full\" key={props?.id + 'SwiperSlideItem' + jIndex}>\n <video controls className=\"size-full object-cover\">\n <track kind=\"captions\" />\n <source src={item?.sources?.[0]?.url} type=\"video/mp4\" />\n <source src={item?.sources?.[0]?.url} type=\"video/webm\" />\n <source src={item?.sources?.[0]?.url} type=\"video/ogg\" />\n </video>\n </SwiperSlide>\n )\n })}\n </Swiper>\n <div\n className={cn(\n 'hidden swiper-button tablet:block tablet:opacity-0 tablet:absolute tablet:top-1/2 tablet:left-6 z-10 -translate-y-1/2 cursor-pointer'\n // `ipc-product-gallery-${props?.id}-custom-swiper-button-prev`\n )}\n onClick={handlePrevClick}\n >\n <SwiperLeftButtonIcon className=\"tablet:size-10 lg-desktop:size-12\" />\n </div>\n <div\n className={cn(\n 'hidden tablet:block swiper-button tablet:opacity-0 tablet:absolute tablet:top-1/2 tablet:right-6 z-10 -translate-y-1/2 cursor-pointer'\n // `ipc-product-gallery-${props?.id}-custom-swiper-button-next`\n )}\n onClick={handleNextClick}\n >\n <SwiperRightButtonIcon className=\"tablet:size-10 lg-desktop:size-12\" />\n </div>\n </div>\n )\n}\n\nconst ProductGalleryTab3DView = (props: ProductGalleryTabItemProps) => {\n return <div>3D View</div>\n}\n\nexport default withLayout(ProductGallery)\n"],
5
+ "mappings": "ukBAAA,IAAAA,GAAA,GAAAC,GAAAD,GAAA,aAAAE,KAAA,eAAAC,GAAAH,IAkCI,IAAAI,EAAA,6BAlCJC,EAA+B,6CAC/BC,EAA6C,qCAC7CC,EAWO,iBACPA,EAAoD,wBACpDC,EAA2D,0BAC3DC,EAAmB,2CACnBC,EAA+B,sBAC/BC,EAA6C,gCAC7CC,EAAqC,0CACrCC,EAAgC,+CAChCC,EAA2B,sCAC3BC,EAAyB,4CACzBC,EAA4B,mCAC5BC,EAA2B,2CAC3BC,EAAwB,0CACxBZ,EAAiC,8CAMjC,MAAMa,EAAwBC,MAE1B,QAAC,OAAI,MAAM,KAAK,OAAO,KAAK,QAAQ,YAAY,KAAK,OAAO,MAAM,6BAA8B,GAAGA,EACjG,oBAAC,QAAK,EAAE,KAAK,EAAE,KAAK,MAAM,KAAK,OAAO,KAAK,GAAG,KAAK,UAAU,qBAAqB,KAAK,QAAQ,KAC/F,OAAC,QACC,EAAE,4TACF,KAAK,eACP,GACF,EAIEC,EAAyBD,MAE3B,QAAC,OAAI,MAAM,KAAK,OAAO,KAAK,QAAQ,YAAY,KAAK,OAAO,MAAM,6BAA8B,GAAGA,EACjG,oBAAC,QAAK,MAAM,KAAK,OAAO,KAAK,GAAG,KAAK,UAAU,8CAA8C,KAAK,QAAQ,KAC1G,OAAC,QACC,EAAE,4TACF,KAAK,eACP,GACF,EAIEE,GAAiB,IAAM,CAC3B,KAAM,CAAE,YAAAC,CAAY,KAAI,kBAAe,EACjC,CAAE,QAAAC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A,EAAO,iBAAmB,OAClD6D,EAAgB,EACP7D,EAAO,OAASA,EAAO,iBAAmB,QACnD8D,EAAgB,CAEpB,EAKA,QAAS,CAAC,aAAY,SAAQ,aAAY,YAAU,EACpD,WAAY,CACV,YAAa,EACf,EACA,YAAa,CACX,EAAG,CACD,cAAe,EACf,SAAU,EACZ,CACF,EAEC,SAAAtE,GAAO,WAAW,IAAI,CAACmB,EAAMuD,OAE1B,OAAC,eAAY,UAAU,SACrB,oBAAC,SAAM,SAAQ,GAAC,UAAU,yBACxB,oBAAC,SAAM,KAAK,WAAW,KACvB,OAAC,UAAO,IAAKvD,GAAM,UAAU,CAAC,GAAG,IAAK,KAAK,YAAY,KACvD,OAAC,UAAO,IAAKA,GAAM,UAAU,CAAC,GAAG,IAAK,KAAK,aAAa,KACxD,OAAC,UAAO,IAAKA,GAAM,UAAU,CAAC,GAAG,IAAK,KAAK,YAAY,GACzD,GANmCnB,GAAO,GAAK,kBAAoB0E,CAOrE,CAEH,EACH,KACA,OAAC,OACC,aAAW,MACT,sIAEF,EACA,QAASL,EAET,mBAACtE,EAAA,CAAqB,UAAU,oCAAoC,EACtE,KACA,OAAC,OACC,aAAW,MACT,uIAEF,EACA,QAASuE,EAET,mBAACrE,EAAA,CAAsB,UAAU,oCAAoC,EACvE,GACF,CAEJ,EAEM6E,GAA2B9E,MACxB,OAAC,OAAI,mBAAO,EAGrB,IAAOlB,MAAQ,cAAWoB,EAAc",
6
+ "names": ["ProductGallery_exports", "__export", "ProductGallery_default", "__toCommonJS", "import_jsx_runtime", "import_AiuiProvider", "import_components", "import_react", "import_modules", "import_helpers", "import_types", "import_react_tabs", "import_BizProductProvider", "import_use_variant_media", "import_SpecsModal", "import_CompareModal", "import_utils", "import_Styles", "import_track", "SwiperLeftButtonIcon", "props", "SwiperRightButtonIcon", "ProductGallery", "copyWriting", "product", "variant", "selectedOptions", "defaultMediaData", "swiper", "setSwiper", "productGalleryTabRef", "customMediaList", "productList", "sceneList", "keyFeaturesList", "videoList", "allMedia", "galleryMap", "galleryTabs", "item", "galleries", "imageGalleries", "imageItem", "imageSourceParts", "responsiveSource", "gallery", "activeGalleryTab", "setActiveGalleryTab", "activeTabIndex", "setActiveTabIndex", "targetSlideIndex", "setTargetSlideIndex", "handleNextTab", "nextIndex", "handlePrevTab", "prevIndex", "prevTabGalleries", "renderGalleryForTab", "tab", "index", "ProductGalleryTabImage", "ProductGalleryTabVideo", "ProductGalleryTab", "ref", "scrollContainerRef", "triggerRefs", "handleGalleryTabClick", "el", "scrollToEvent", "event", "container", "button", "scrollLeft", "scrollToTab", "tabItem", "CompareModal", "locale", "totalSavings", "paginationRef", "thumbsSwiper", "setThumbsSwiper", "isStart", "setStart", "isEnd", "setEnd", "commentRef", "shouldScroll", "setShouldScroll", "imageClassName", "handlePrevClick", "handleNextClick", "contentHeight", "containerHeight", "needsScroll", "jIndex", "exposureKey", "handleExposure", "pictureSource", "ProductGalleryTab3DView"]
7
7
  }
@@ -1,12 +1,33 @@
1
1
  import type { Img } from '../../../../../types/props.js';
2
2
  import type { ImageMedia, VideoMedia } from '../../../hooks/use-variant-media.js';
3
- export interface ProductGalleryProps {
4
- data: {
5
- gallerySections: {
6
- title: string;
7
- }[];
3
+ export declare enum GalleryTabType {
4
+ GALLERY_IMAGE_MAIN = "ipc-gallery-tab-image-main",
5
+ GALLERY_IMAGE_FEATURES = "ipc-gallery-tab-image-features",
6
+ GALLERY_IMAGE_SCENE = "ipc-gallery-tab-image-scene",
7
+ GALLERY_VIDEO = "ipc-gallery-tab-video",
8
+ GALLERY_3D_VIEW = "ipc-gallery-tab-3d-view"
9
+ }
10
+ export interface ProductGalleryTabData {
11
+ tabLabel: string;
12
+ tabValue: string;
13
+ galleries: 'productList' | 'keyFeaturesList' | 'sceneList' | 'videoList';
14
+ galleryTabType: GalleryTabType | string;
15
+ images?: Array<{
16
+ image_390?: string;
17
+ image_768?: string;
18
+ image_1024?: string;
19
+ image_1440?: string;
20
+ image_1920?: string;
21
+ }>;
22
+ comment?: {
23
+ avatar: {
24
+ url: string;
25
+ };
26
+ content: string;
8
27
  };
28
+ id?: string;
9
29
  }
30
+ export type ProductGalleryProps = ProductGalleryTabData[];
10
31
  export interface ProductGalleryTabItemProps {
11
32
  index?: number;
12
33
  realIndex?: number;
@@ -18,6 +39,12 @@ export interface ProductGalleryTabItemProps {
18
39
  onPrevTab?: () => void;
19
40
  targetSlideIndex?: number | null;
20
41
  onSlideChange?: () => void;
42
+ onImageExposure?: (data: {
43
+ imageUrl: string;
44
+ imageAlt?: string;
45
+ index: number;
46
+ tabId: string;
47
+ }) => void;
21
48
  id: string;
22
49
  comment?: {
23
50
  content: string;
@@ -32,11 +59,15 @@ export interface GalleryTabItemProps {
32
59
  id: string;
33
60
  galleryTabType: GalleryTabType;
34
61
  galleries: ImageMedia[] | VideoMedia[];
35
- }
36
- export declare enum GalleryTabType {
37
- GALLERY_IMAGE_MAIN = "ipc-gallery-tab-image-main",
38
- GALLERY_IMAGE_FEATURES = "ipc-gallery-tab-image-features",
39
- GALLERY_IMAGE_SCENE = "ipc-gallery-tab-image-scene",
40
- GALLERY_VIDEO = "ipc-gallery-tab-video",
41
- GALLERY_3D_VIEW = "ipc-gallery-tab-3d-view"
62
+ images?: {
63
+ image_390?: string;
64
+ image_768?: string;
65
+ image_1024?: string;
66
+ image_1440?: string;
67
+ image_1920?: string;
68
+ };
69
+ comment?: {
70
+ avatar: Img;
71
+ content: string;
72
+ };
42
73
  }
@@ -1,2 +1,2 @@
1
- "use strict";var n=Object.defineProperty;var l=Object.getOwnPropertyDescriptor;var g=Object.getOwnPropertyNames;var m=Object.prototype.hasOwnProperty;var s=(a,e)=>{for(var t in e)n(a,t,{get:e[t],enumerable:!0})},b=(a,e,t,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of g(e))!m.call(a,i)&&i!==t&&n(a,i,{get:()=>e[i],enumerable:!(o=l(e,i))||o.enumerable});return a};var p=a=>b(n({},"__esModule",{value:!0}),a);var u={};s(u,{GalleryTabType:()=>d});module.exports=p(u);var d=(r=>(r.GALLERY_IMAGE_MAIN="ipc-gallery-tab-image-main",r.GALLERY_IMAGE_FEATURES="ipc-gallery-tab-image-features",r.GALLERY_IMAGE_SCENE="ipc-gallery-tab-image-scene",r.GALLERY_VIDEO="ipc-gallery-tab-video",r.GALLERY_3D_VIEW="ipc-gallery-tab-3d-view",r))(d||{});
1
+ "use strict";var n=Object.defineProperty;var o=Object.getOwnPropertyDescriptor;var m=Object.getOwnPropertyNames;var l=Object.prototype.hasOwnProperty;var d=(a,e)=>{for(var r in e)n(a,r,{get:e[r],enumerable:!0})},b=(a,e,r,g)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of m(e))!l.call(a,i)&&i!==r&&n(a,i,{get:()=>e[i],enumerable:!(g=o(e,i))||g.enumerable});return a};var p=a=>b(n({},"__esModule",{value:!0}),a);var u={};d(u,{GalleryTabType:()=>s});module.exports=p(u);var s=(t=>(t.GALLERY_IMAGE_MAIN="ipc-gallery-tab-image-main",t.GALLERY_IMAGE_FEATURES="ipc-gallery-tab-image-features",t.GALLERY_IMAGE_SCENE="ipc-gallery-tab-image-scene",t.GALLERY_VIDEO="ipc-gallery-tab-video",t.GALLERY_3D_VIEW="ipc-gallery-tab-3d-view",t))(s||{});
2
2
  //# sourceMappingURL=types.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../../src/biz-components/Listing/components/ProductCard/ProductGallery/types.ts"],
4
- "sourcesContent": ["import type { Img, Video } from '../../../../../types/props.js'\nimport type { ImageMedia, VideoMedia } from '../../../hooks/use-variant-media.js'\n\nexport interface ProductGalleryProps {\n data: {\n gallerySections: {\n title: string\n }[]\n }\n}\n\nexport interface ProductGalleryTabItemProps {\n index?: number\n realIndex?: number\n galleryTabType: GalleryTabType\n galleries: ImageMedia[] | VideoMedia[]\n onCurrentTabLoopStart?: (index: number) => void\n onCurrentTabLoopEnd?: (index: number) => void\n onNextTab?: () => void\n onPrevTab?: () => void\n targetSlideIndex?: number | null\n onSlideChange?: () => void\n id: string\n comment?: {\n content: string\n avatar: Img\n }\n tabLabel: string\n tabValue: string\n // galleryImgs?: Img[]\n // galleryVideo?: Video\n // gallery3DView?: Video\n}\n\nexport interface GalleryTabItemProps {\n tabLabel: string\n tabValue: string\n id: string\n galleryTabType: GalleryTabType\n galleries: ImageMedia[] | VideoMedia[]\n}[]\n\nexport enum GalleryTabType {\n GALLERY_IMAGE_MAIN = 'ipc-gallery-tab-image-main',\n GALLERY_IMAGE_FEATURES = 'ipc-gallery-tab-image-features',\n GALLERY_IMAGE_SCENE = 'ipc-gallery-tab-image-scene',\n GALLERY_VIDEO = 'ipc-gallery-tab-video',\n GALLERY_3D_VIEW = 'ipc-gallery-tab-3d-view',\n}\n"],
5
- "mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,oBAAAE,IAAA,eAAAC,EAAAH,GA0CO,IAAKE,OACVA,EAAA,mBAAqB,6BACrBA,EAAA,uBAAyB,iCACzBA,EAAA,oBAAsB,8BACtBA,EAAA,cAAgB,wBAChBA,EAAA,gBAAkB,0BALRA,OAAA",
4
+ "sourcesContent": ["import type { Img, Video } from '../../../../../types/props.js'\nimport type { ImageMedia, VideoMedia } from '../../../hooks/use-variant-media.js'\n\nexport enum GalleryTabType {\n GALLERY_IMAGE_MAIN = 'ipc-gallery-tab-image-main',\n GALLERY_IMAGE_FEATURES = 'ipc-gallery-tab-image-features',\n GALLERY_IMAGE_SCENE = 'ipc-gallery-tab-image-scene',\n GALLERY_VIDEO = 'ipc-gallery-tab-video',\n GALLERY_3D_VIEW = 'ipc-gallery-tab-3d-view',\n}\n\n// \u8F93\u5165\u6570\u636E\u7684\u7C7B\u578B\u5B9A\u4E49\uFF08\u4ECE product.payload.components \u4E2D\u83B7\u53D6\u7684\u539F\u59CB\u6570\u636E\u683C\u5F0F\uFF09\nexport interface ProductGalleryTabData {\n tabLabel: string\n tabValue: string\n galleries: 'productList' | 'keyFeaturesList' | 'sceneList' | 'videoList'\n galleryTabType: GalleryTabType | string\n images?: Array<{\n image_390?: string\n image_768?: string\n image_1024?: string\n image_1440?: string\n image_1920?: string\n }>\n comment?: {\n avatar: {\n url: string\n }\n content: string\n }\n id?: string\n}\n\nexport type ProductGalleryProps = ProductGalleryTabData[]\n\nexport interface ProductGalleryTabItemProps {\n index?: number\n realIndex?: number\n galleryTabType: GalleryTabType\n galleries: ImageMedia[] | VideoMedia[]\n onCurrentTabLoopStart?: (index: number) => void\n onCurrentTabLoopEnd?: (index: number) => void\n onNextTab?: () => void\n onPrevTab?: () => void\n targetSlideIndex?: number | null\n onSlideChange?: () => void\n onImageExposure?: (data: { imageUrl: string; imageAlt?: string; index: number; tabId: string }) => void\n id: string\n comment?: {\n content: string\n avatar: Img\n }\n tabLabel: string\n tabValue: string\n // galleryImgs?: Img[]\n // galleryVideo?: Video\n // gallery3DView?: Video\n}\n\nexport interface GalleryTabItemProps {\n tabLabel: string\n tabValue: string\n id: string\n galleryTabType: GalleryTabType\n galleries: ImageMedia[] | VideoMedia[]\n images?: {\n image_390?: string\n image_768?: string\n image_1024?: string\n image_1440?: string\n image_1920?: string\n }\n comment?: {\n avatar: Img\n content: string\n }\n}\n"],
5
+ "mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,oBAAAE,IAAA,eAAAC,EAAAH,GAGO,IAAKE,OACVA,EAAA,mBAAqB,6BACrBA,EAAA,uBAAyB,iCACzBA,EAAA,oBAAsB,8BACtBA,EAAA,cAAgB,wBAChBA,EAAA,gBAAkB,0BALRA,OAAA",
6
6
  "names": ["types_exports", "__export", "GalleryTabType", "__toCommonJS"]
7
7
  }
@@ -1,2 +1,6 @@
1
- declare const ProductSummary: () => import("react/jsx-runtime").JSX.Element | null;
2
- export default ProductSummary;
1
+ /// <reference types="react" />
2
+ declare const _default: import("react").ForwardRefExoticComponent<Omit<object, keyof import("../../../../../shared/Styles.js").StylesProps> & Partial<import("../../../../../shared/Styles.js").StylesProps & import("../../../../../shared/Styles.js").ContainerProps> & {
3
+ className?: string | undefined;
4
+ data?: Record<string, any> | undefined;
5
+ } & import("react").RefAttributes<any>>;
6
+ export default _default;
@@ -1,2 +1,2 @@
1
- "use strict";var W=Object.create;var O=Object.defineProperty;var _=Object.getOwnPropertyDescriptor;var q=Object.getOwnPropertyNames;var K=Object.getPrototypeOf,Q=Object.prototype.hasOwnProperty;var U=(n,t)=>{for(var l in t)O(n,l,{get:t[l],enumerable:!0})},R=(n,t,l,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of q(t))!Q.call(n,r)&&r!==l&&O(n,r,{get:()=>t[r],enumerable:!(i=_(t,r))||i.enumerable});return n};var X=(n,t,l)=>(l=n!=null?W(K(n)):{},R(t||!n||!n.__esModule?O(l,"default",{value:n,enumerable:!0}):l,n)),Y=n=>R(O({},"__esModule",{value:!0}),n);var ae={};U(ae,{default:()=>te});module.exports=Y(ae);var e=require("react/jsx-runtime"),a=require("../../../../../components"),h=require("../../../BizProductProvider"),N=require("react"),p=require("../../../utils"),y=require("../../../../AiuiProvider"),A=X(require("decimal.js")),$=require("../../../utils/textFormat");const Z=()=>{const{locale:n="us",copyWriting:t}=(0,y.useAiuiContext)(),{product:l,variant:i,finalPrice:r,comparePrice:m,coupon:b,selectedOptions:u,selectedVariants:s,totalSavings:P,onAddToCart:w,onBuyNow:E,savingDetail:v,checkedBundle:C,joinedRecommendBuyProducts:o,setJoinedRecommendBuyProducts:x,setSavingDetail:B,addToCartLoading:f,buyNowLoading:D,profile:j}=(0,h.useBizProductContext)(),[k]=s,F=(0,N.useMemo)(()=>{const d=C?.variants.find(H=>H.variant.sku===k?.sku),M=new A.default(k?.price?.amount||0).minus(d?.price||k?.price?.amount).toNumber();let z=new A.default(k?.price?.amount||0);j?.email&&(z=z.minus(v?.member||0));const J=z.minus(v?.coupon).minus(M).toNumber();return Math.floor(J*100)/100},[k,C,j,v?.member,v?.coupon]);if(!i.availableForSale)return null;const{bundleVariant:L,giftVariant:G,exchangeVariant:S}=ee()||{},[c,g]=(0,N.useState)();return(0,N.useEffect)(()=>{g({bundle:o.bundle?.value?void 0:L,gift:o.gift?.value?void 0:G,exchange:o.exchange?.value?void 0:S})},[L,G,S,o]),(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:`${l.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||l?.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 object-[center_36%]"})})]}),(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||l?.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:l.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:F,currencyCode:i.price.currencyCode,locale:n})}),F<i?.price?.amount&&(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})})]})]}),o?.gift?.value&&(0,e.jsx)(I,{giftOperation:d=>{x?.({...o,gift:{value:void 0,canOperate:!0}}),g?.({...c,gift:d})},status:!!o?.gift,gift:o?.gift?.value,canOperate:o?.gift?.canOperate}),o?.bundle?.value&&(0,e.jsx)(V,{bundleOperation:d=>{x?.({...o,bundle:{value:void 0,canOperate:!0}}),g?.({...c,bundle:d})},status:!!o?.bundle,bundleListItem:o?.bundle?.value,canOperate:o?.bundle?.canOperate}),o?.exchange?.value&&(0,e.jsx)(T,{exchangeOperation:d=>{x?.({...o,exchange:{value:void 0,canOperate:!0}}),g?.({...c,exchange:d})},status:!!o?.exchange,canOperate:o?.exchange?.canOperate,exchange:o?.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)(T,{exchangeOperation:d=>{x?.({...o,exchange:{value:d,canOperate:!0}}),g?.({...c,exchange:void 0})},canOperate:o?.exchange?.canOperate,status:!c?.exchange,exchange:c?.exchange}),c?.bundle&&(0,e.jsx)(V,{bundleOperation:d=>{B?.({...v,exchangePurchase:0}),x?.({...o,bundle:{value:d,canOperate:!0}}),g?.({...c,bundle:void 0})},canOperate:o?.bundle?.canOperate,status:!c?.bundle,bundleListItem:c?.bundle}),c?.gift&&(0,e.jsx)(I,{giftOperation:d=>{x?.({...o,gift:{value:d,canOperate:!0}}),g?.({...c,gift:void 0})},canOperate:o?.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,$.replaceTemplate)(t?.totalPrice||"",{amount:(0,p.formatPrice)({amount:Math.floor(r*100)/100,currencyCode:i.price.currencyCode,locale:n})})}`}),P>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:f,className:"w-1/2 tablet:w-auto laptop:w-1/2 desktop:w-auto",onClick:()=>w?.(),children:t?.addToCart}),(0,e.jsx)(a.Button,{size:"lg",loading:D,variant:"primary",className:"w-1/2 tablet:w-auto laptop:w-1/2 desktop:w-auto",onClick:()=>E?.(),children:t?.shopNow})]})]})]})]})})})},ee=()=>{const{bundle:n,variant:t,checkedBundle:l,freeGift:i,checkedGift:r,exchangePurchase:m,checkedExchangePurchase:b}=(0,h.useBizProductContext)();let u,s,P;const{bundleList:w}=n||{},{giftList:E=[]}=i||{},{giftList:v=[]}=m||{},C=w?.filter(f=>f.variants.slice(1,f.variants.length).every(D=>D.variant.availableForSale))||[],[o]=C;u=l||o;const[x]=E?.filter(f=>f.availableForSale);s=r||x;const[B]=v?.filter(f=>f.availableForSale);return P=b||B,{bundleVariant:u,giftVariant:s,exchangeVariant:P}},V=({bundleOperation:n,bundleListItem:t,canOperate:l,status:i})=>{const{locale:r="us"}=(0,y.useAiuiContext)(),{variant:m,setCheckedBundle:b}=(0,h.useBizProductContext)(),u=t?.variants.filter(s=>s.variant.sku!==m.sku);return(0,e.jsx)("div",{className:"",children:u?.map(s=>(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:s?.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:s.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:s?.price||0,locale:r,currencyCode:s.variant?.price?.currencyCode||""})}),s.price<s.variant.price.amount&&(0,e.jsx)(a.Text,{className:"text-base desktop:text-2xl font-bold line-through text-[#6D6D6F]",html:(0,p.formatPrice)({amount:s.variant.price.amount||0,locale:r,currencyCode:s.variant?.price?.currencyCode||""})})]}),l&&(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"})]})]},s.variant.id))})},I=({giftOperation:n,gift:t,status:l,canOperate:i})=>{const{locale:r="us"}=(0,y.useAiuiContext)(),{freeGift:m,setCheckedGift:b}=(0,h.useBizProductContext)(),{freeLabel:u,count:s}=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${s} | ${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:r,currencyCode:t.price.currencyCode})})]}),i&&(0,e.jsx)(a.Button,{size:"icon",variant:"link",onClick:()=>{b?.(l?void 0:t),n(t)},className:"shrink-0 size-auto underline",children:l?"Remove":"Add"})]})]})},T=({exchangeOperation:n,exchange:t,canOperate:l,status:i})=>{const{locale:r="us"}=(0,y.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:r,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:r,currencyCode:t.price.currencyCode})})]}),l&&(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 te=Z;
1
+ "use strict";var X=Object.create;var z=Object.defineProperty;var Y=Object.getOwnPropertyDescriptor;var Z=Object.getOwnPropertyNames;var ee=Object.getPrototypeOf,te=Object.prototype.hasOwnProperty;var ae=(o,t)=>{for(var i in t)z(o,i,{get:t[i],enumerable:!0})},T=(o,t,i,l)=>{if(t&&typeof t=="object"||typeof t=="function")for(let c of Z(t))!te.call(o,c)&&c!==i&&z(o,c,{get:()=>t[c],enumerable:!(l=Y(t,c))||l.enumerable});return o};var ne=(o,t,i)=>(i=o!=null?X(ee(o)):{},T(t||!o||!o.__esModule?z(i,"default",{value:o,enumerable:!0}):i,o)),oe=o=>T(z({},"__esModule",{value:!0}),o);var se={};ae(se,{default:()=>re});module.exports=oe(se);var e=require("react/jsx-runtime"),a=require("../../../../../components"),E=require("../../../BizProductProvider"),g=require("react"),x=require("../../../utils"),w=require("../../../../AiuiProvider"),G=ne(require("decimal.js")),K=require("../../../utils/textFormat"),W=require("../../../../../shared/Styles.js"),q=require("../../../../../components/index.js"),Q=require("../../../../../shared/track.js");const le=()=>{const{locale:o="us",copyWriting:t}=(0,w.useAiuiContext)(),{product:i,variant:l,finalPrice:c,comparePrice:f,coupon:C,selectedOptions:p,selectedVariants:r,totalSavings:B,onAddToCart:A,onBuyNow:j,savingDetail:h,checkedBundle:D,joinedRecommendBuyProducts:n,setJoinedRecommendBuyProducts:v,setSavingDetail:F,addToCartLoading:b,buyNowLoading:L,profile:S}=(0,E.useBizProductContext)(),[O]=r,R=(0,g.useMemo)(()=>{const u=D?.variants.find(P=>P.variant.sku===O?.sku),d=new G.default(O?.price?.amount||0).minus(u?.price||O?.price?.amount).toNumber();let m=new G.default(O?.price?.amount||0);S?.email&&(m=m.minus(h?.member||0));const y=m.minus(h?.coupon).minus(d).toNumber();return Math.floor(y*100)/100},[O,D,S,h?.member,h?.coupon]);if(!l.availableForSale)return null;const{bundleVariant:V,giftVariant:_,exchangeVariant:I}=ie()||{},[s,N]=(0,g.useState)(),[$,k]=(0,g.useState)([]);(0,g.useEffect)(()=>{N({bundle:n.bundle?.value?void 0:V,gift:n.gift?.value?void 0:_,exchange:n.exchange?.value?void 0:I})},[V,_,I,n]);const U=(0,g.useMemo)(()=>{const u=[];return $.forEach((d,m)=>{n[d]?.value&&u.push({type:d,key:`${d}-${m}`})}),u},[$,n]);return(0,g.useEffect)(()=>{k([])},[l?.id]),(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:`${i.title} is ready <br/><span>Just the way you want it.</span>`}),(0,e.jsx)("div",{className:"",children:(0,e.jsx)(a.Picture,{source:l.image?.url||i?.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 object-[center_36%]"})})]}),(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.jsx)(q.ExposureDetector,{exposureKey:"listing_selector",onExposure:()=>{(0,Q.gaTrack)({event:"ga4Event",event_name:"component_impression",event_parameters:{page_group:`Product Detail Page${l.sku}`,component_type:"image",component_name:"listing_selector",position:1}})},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:l.image?.url||i?.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:i.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,x.formatPrice)({amount:R,currencyCode:l.price.currencyCode,locale:o})}),R<l?.price?.amount&&(0,e.jsx)(a.Text,{className:"text-base desktop:text-2xl laptop:text-xl font-bold line-through text-[#6D6D6F]",html:(0,x.formatPrice)({amount:l?.price?.amount,currencyCode:l.price.currencyCode,locale:o})})]})]})}),U.map(({type:u,key:d})=>u==="gift"&&n?.gift?.value?(0,e.jsx)(M,{giftOperation:m=>{v?.({...n,gift:{value:void 0,canOperate:!0}}),N?.({...s,gift:m}),k(y=>y.filter(P=>P!=="gift"))},status:!!n?.gift,gift:n?.gift?.value,canOperate:n?.gift?.canOperate},d):u==="bundle"&&n?.bundle?.value?(0,e.jsx)(J,{bundleOperation:m=>{v?.({...n,bundle:{value:void 0,canOperate:!0}}),N?.({...s,bundle:m}),k(y=>y.filter(P=>P!=="bundle"))},status:!!n?.bundle,bundleListItem:n?.bundle?.value,canOperate:n?.bundle?.canOperate},d):u==="exchange"&&n?.exchange?.value?(0,e.jsx)(H,{exchangeOperation:m=>{v?.({...n,exchange:{value:void 0,canOperate:!0}}),N?.({...s,exchange:m}),k(y=>y.filter(P=>P!=="exchange"))},status:!!n?.exchange,canOperate:n?.exchange?.canOperate,exchange:n?.exchange?.value},d):null)]}),(s?.bundle||s?.gift||s?.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:[s?.exchange&&(0,e.jsx)(H,{exchangeOperation:u=>{v?.({...n,exchange:{value:u,canOperate:!0}}),N?.({...s,exchange:void 0}),k(d=>[...d,"exchange"])},canOperate:n?.exchange?.canOperate,status:!s?.exchange,exchange:s?.exchange}),s?.bundle&&(0,e.jsx)(J,{bundleOperation:u=>{F?.({...h,exchangePurchase:0}),v?.({...n,bundle:{value:u,canOperate:!0}}),N?.({...s,bundle:void 0}),k(d=>[...d,"bundle"])},canOperate:n?.bundle?.canOperate,status:!s?.bundle,bundleListItem:s?.bundle}),s?.gift&&(0,e.jsx)(M,{giftOperation:u=>{v?.({...n,gift:{value:u,canOperate:!0}}),N?.({...s,gift:void 0}),k(d=>[...d,"gift"])},canOperate:n?.gift?.canOperate,status:!s?.gift,gift:s?.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,K.replaceTemplate)(t?.totalPrice||"",{amount:(0,x.formatPrice)({amount:Math.floor(c*100)/100,currencyCode:l.price.currencyCode,locale:o})})}`}),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,x.formatPrice)({amount:f,currencyCode:l.price.currencyCode,locale:o})}),(0,e.jsxs)("div",{className:"flex gap-3 mt-2 justify-end",children:[(0,e.jsx)(a.Button,{size:"lg",variant:"secondary",loading:b,className:"w-1/2 tablet:w-auto laptop:w-1/2 desktop:w-auto",onClick:()=>A?.(),children:t?.addToCart}),(0,e.jsx)(a.Button,{size:"lg",loading:L,variant:"primary",className:"w-1/2 tablet:w-auto laptop:w-1/2 desktop:w-auto",onClick:()=>j?.(),children:t?.shopNow})]})]})]})]})})})},ie=()=>{const{bundle:o,variant:t,checkedBundle:i,freeGift:l,checkedGift:c,exchangePurchase:f,checkedExchangePurchase:C}=(0,E.useBizProductContext)();let p,r,B;const{bundleList:A}=o||{},{giftList:j=[]}=l||{},{giftList:h=[]}=f||{},D=A?.filter(b=>b.variants.slice(1,b.variants.length).every(L=>L.variant.availableForSale))||[],[n]=D;p=i||n;const[v]=j?.filter(b=>b.availableForSale);r=c||v;const[F]=h?.filter(b=>b.availableForSale);return B=C||F,{bundleVariant:p,giftVariant:r,exchangeVariant:B}},J=({bundleOperation:o,bundleListItem:t,canOperate:i,status:l})=>{const{locale:c="us"}=(0,w.useAiuiContext)(),{variant:f,setCheckedBundle:C}=(0,E.useBizProductContext)(),p=t?.variants.filter(r=>r.variant.sku!==f.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,x.formatPrice)({amount:r?.price||0,locale:c,currencyCode:r.variant?.price?.currencyCode||""})}),r.price<r.variant.price.amount&&(0,e.jsx)(a.Text,{className:"text-base desktop:text-2xl font-bold line-through text-[#6D6D6F]",html:(0,x.formatPrice)({amount:r.variant.price.amount||0,locale:c,currencyCode:r.variant?.price?.currencyCode||""})})]}),i&&(0,e.jsx)(a.Button,{size:"icon",variant:"link",onClick:()=>{C?.(l?void 0:t),o?.(t)},className:"shrink-0 size-auto underline",children:l?"Remove":"Add"})]})]},r.variant.id))})},M=({giftOperation:o,gift:t,status:i,canOperate:l})=>{const{locale:c="us"}=(0,w.useAiuiContext)(),{freeGift:f,setCheckedGift:C}=(0,E.useBizProductContext)(),{freeLabel:p,count:r}=f||{};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,x.formatPrice)({amount:t.price.amount,locale:c,currencyCode:t.price.currencyCode})})]}),l&&(0,e.jsx)(a.Button,{size:"icon",variant:"link",onClick:()=>{C?.(i?void 0:t),o(t)},className:"shrink-0 size-auto underline",children:i?"Remove":"Add"})]})]})},H=({exchangeOperation:o,exchange:t,canOperate:i,status:l})=>{const{locale:c="us"}=(0,w.useAiuiContext)(),{setCheckedExchangePurchase:f}=(0,E.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,x.formatPrice)({amount:t.finalPrice?.amount||0,locale:c,currencyCode:t.price.currencyCode})}),(0,e.jsx)(a.Text,{className:"text-base desktop:text-2xl font-bold line-through text-[#6D6D6F]",html:(0,x.formatPrice)({amount:t.price?.amount||0,locale:c,currencyCode:t.price.currencyCode})})]}),i&&(0,e.jsx)(a.Button,{size:"icon",variant:"link",onClick:()=>{f?.(l?void 0:t),o(t)},className:"shrink-0 size-auto underline",children:l?"Remove":"Add"})]})]})};var re=(0,W.withLayout)(le);
2
2
  //# sourceMappingURL=index.js.map