@anker-in/headless-ui 1.1.8 → 1.1.9-alpha.1763969620454

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 (37) hide show
  1. package/dist/cjs/biz-components/AplusDesc/index.js +1 -1
  2. package/dist/cjs/biz-components/AplusDesc/index.js.map +3 -3
  3. package/dist/cjs/biz-components/Features/index.js +1 -1
  4. package/dist/cjs/biz-components/Features/index.js.map +3 -3
  5. package/dist/cjs/biz-components/GiftBox/index.js +1 -1
  6. package/dist/cjs/biz-components/GiftBox/index.js.map +3 -3
  7. package/dist/cjs/biz-components/GraphicMore/index.js +1 -1
  8. package/dist/cjs/biz-components/GraphicMore/index.js.map +2 -2
  9. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductHighlight/index.js +3 -3
  10. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductHighlight/index.js.map +3 -3
  11. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductGallery/index.js +1 -1
  12. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductGallery/index.js.map +3 -3
  13. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductSummary/index.js +1 -1
  14. package/dist/cjs/biz-components/Listing/components/ProductCard/ProductSummary/index.js.map +3 -3
  15. package/dist/cjs/biz-components/SelectStore/index.js +1 -1
  16. package/dist/cjs/biz-components/SelectStore/index.js.map +3 -3
  17. package/dist/cjs/biz-components/Specs/index.js +1 -1
  18. package/dist/cjs/biz-components/Specs/index.js.map +2 -2
  19. package/dist/esm/biz-components/AplusDesc/index.js +1 -1
  20. package/dist/esm/biz-components/AplusDesc/index.js.map +3 -3
  21. package/dist/esm/biz-components/Features/index.js +1 -1
  22. package/dist/esm/biz-components/Features/index.js.map +3 -3
  23. package/dist/esm/biz-components/GiftBox/index.js +1 -1
  24. package/dist/esm/biz-components/GiftBox/index.js.map +3 -3
  25. package/dist/esm/biz-components/GraphicMore/index.js +1 -1
  26. package/dist/esm/biz-components/GraphicMore/index.js.map +2 -2
  27. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductHighlight/index.js +3 -3
  28. package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductHighlight/index.js.map +3 -3
  29. package/dist/esm/biz-components/Listing/components/ProductCard/ProductGallery/index.js +1 -1
  30. package/dist/esm/biz-components/Listing/components/ProductCard/ProductGallery/index.js.map +3 -3
  31. package/dist/esm/biz-components/Listing/components/ProductCard/ProductSummary/index.js +1 -1
  32. package/dist/esm/biz-components/Listing/components/ProductCard/ProductSummary/index.js.map +3 -3
  33. package/dist/esm/biz-components/SelectStore/index.js +1 -1
  34. package/dist/esm/biz-components/SelectStore/index.js.map +3 -3
  35. package/dist/esm/biz-components/Specs/index.js +1 -1
  36. package/dist/esm/biz-components/Specs/index.js.map +2 -2
  37. package/package.json +1 -1
@@ -1,2 +1,2 @@
1
- "use strict";"use client";var q=Object.create;var h=Object.defineProperty;var z=Object.getOwnPropertyDescriptor;var Q=Object.getOwnPropertyNames;var G=Object.getPrototypeOf,J=Object.prototype.hasOwnProperty;var K=(a,n)=>{for(var i in n)h(a,i,{get:n[i],enumerable:!0})},j=(a,n,i,u)=>{if(n&&typeof n=="object"||typeof n=="function")for(let b of Q(n))!J.call(a,b)&&b!==i&&h(a,b,{get:()=>n[b],enumerable:!(u=z(n,b))||u.enumerable});return a};var A=(a,n,i)=>(i=a!=null?q(G(a)):{},j(n||!a||!a.__esModule?h(i,"default",{value:a,enumerable:!0}):i,a)),W=a=>j(h({},"__esModule",{value:!0}),a);var Y={};K(Y,{default:()=>X});module.exports=W(Y);var e=require("react/jsx-runtime"),H=A(require("./dropdown.js")),R=require("../AiuiProvider/index.js"),I=require("react-responsive"),p=require("react"),P=require("../../shared/Styles.js"),_=require("../ShelfDisplay/shelfDisplay.js"),d=require("../../components/index.js"),g=A(require("react"));const L=g.default.forwardRef((a,n)=>{const{data:i,buildData:u,onChange:b,onSecondaryChange:Z}=a||{},N=(0,I.useMediaQuery)({query:"(max-width: 768px)"}),[c,w]=(0,p.useState)({}),[D,S]=(0,p.useState)(!1),[k,C]=(0,p.useState)({}),E=(0,g.useRef)(null),{locale:$="us"}=(0,R.useAiuiContext)(),{LeftMenu:M,RightMenu:T,DefaultSelectMenu:v}=(0,p.useMemo)(()=>i?.data||{},[i?.data]),U=t=>{try{const o=new URL(t).pathname.toLowerCase();return/\.(jpeg|jpg|gif|png|webp|bmp|svg|tiff)$/.test(o)}catch{return/\.(jpeg|jpg|gif|png|webp|bmp|svg|tiff)$/i.test(t)}},V=(t,s)=>{const o=T?.menus?.find?.(y=>y?.handle===t?.handle),l=t?.variants?.find?.(y=>y?.sku===t?.sku||o?.sku),r=l?.coupons?.[0],{price:m,basePrice:x}=(0,_.formatVariantPrice)({locale:$||"us",amount:r?r?.variant_price4wscode:l?.price,baseAmount:r?l?.price:0,currencyCode:t?.price?.currencyCode||"USD"}),f=typeof v?.buttonText=="string"?v?.buttonText:v?.buttonText?.[String(s)]||"";return(0,e.jsxs)("div",{className:"specs-sku-node-wrap box-border",children:[(0,e.jsxs)(d.Text,{className:"md-tablet:p-2 l-tablet:mb-4 l-tablet:text-sm desktop:px-6 lg-desktop:mb-8 lg-desktop:text-lg openDropDown specs-sku-node-text relative mb-6 box-border block rounded-[50px] border border-[#E4E5E6] bg-[#F5F5F7] px-6 py-4 text-base font-bold",onClick:()=>C({...k,[s]:!k?.[s]}),children:[(0,e.jsxs)("div",{className:"flex items-center justify-between overflow-hidden",children:[(0,e.jsx)("div",{className:"openDropDown md-tablet:text-sm lg-desktop:text-lg specs-sku-node-title flex-1 truncate text-base",title:c?.[s]?.name||"",children:c?.[s]?.name||""}),(0,e.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"25",viewBox:"0 0 24 25",fill:"none",className:"openDropDown",children:(0,e.jsx)("path",{d:"M6 9.5L12 15.5L18 9.5",stroke:"#1D1D1F","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"})})]}),(0,e.jsx)(H.default,{index:s,list:u?.products,active:c,filterActive:c,setActive:w,visible:k,setVisible:C})]}),(0,e.jsx)("div",{className:"lg-desktop:max-h-[196px] lg-desktop:max-w-[196px] max-h-[138px] max-w-[138px]",children:(0,e.jsx)(d.Picture,{source:l?.image?.url||"",className:"aspect-h-[280] aspect-w-[280]",imgClassName:"w-full h-full object-cover hover:scale-105 transition-all duration-300"})}),l?.availableForSale?(0,e.jsxs)("div",{className:"lg-desktop:text-2xl mb-2 mt-6 flex items-center text-xl font-bold",children:[(0,e.jsx)("div",{className:"specs-sku-node-price text-[#1D1D1F]",children:m||""}),x&&(0,e.jsx)("div",{className:"lg-desktop:text-2xl specs-sku-node-base-price ml-1 text-xl text-[#86868C] line-through",children:x})]}):!1,f?(0,e.jsx)(d.Button,{onClick:()=>{b?.(t,s)},className:"specs-sku-node-button",children:f}):null]})},B=t=>t&&typeof t!="string"?(0,e.jsxs)("div",{className:"size-full",children:[(0,e.jsx)("p",{className:"min-xxl:text-lg specs-normal-node-text text-base font-bold text-[#1D1D1F] md:text-sm",dangerouslySetInnerHTML:{__html:t?.text||""}}),(0,e.jsx)(d.Picture,{source:t?.imgUrl,className:"l:max-h-[174px] l:max-w-[174px] m-auto max-h-[360px] max-w-[360px]",imgClassName:"w-full h-full object-cover"})]}):(0,e.jsx)("div",{className:"break-all",children:U(t)?(0,e.jsx)(d.Picture,{source:t,className:"l:max-h-[174px] l:max-w-[174px] m-auto max-h-[360px] max-w-[360px]",imgClassName:"w-full h-full object-cover"}):(0,e.jsx)("p",{className:"min-xxl:text-lg specs-normal-node-text text-base font-bold text-[#1D1D1F] md:text-sm",dangerouslySetInnerHTML:{__html:t||""}})}),F=t=>t.map((s,o)=>{const l=o===0;return(0,e.jsxs)("div",{className:"l-tablet:flex l-tablet:flex-col box-border grid w-full cursor-pointer grid-cols-3 overflow-hidden border-t border-t-[#E4E5E6] specs-product-node-wrap",children:[(0,e.jsx)(d.Heading,{as:"h3",html:s||"",className:"tablet:py-6 l-tablet:text-[#86868C] desktop:p-6 lg-desktop:text-lg specs-product-node-title mr-4 flex-1 pt-4 text-base font-bold md:text-sm"}),(0,e.jsx)("div",{className:`l-tablet:w-full l-tablet:gap-4 laptop:gap-8 desktop:gap-12 desktop:p-6 lg-desktop:gap-16 grid-cols- col-span-2 grid flex-1 py-6${D?3:2} specs-product-node-body`,children:Object.keys(c)?.map?.(r=>{const m=c?.[r],x=T?.menus?.find?.(f=>f?.handle===m?.handle)?.subTitle;return B(x?.[s])})})]},s)}),O=t=>{if(!c)return;const{subTitle:s,isProduct:o}=t;return o?(0,e.jsxs)(e.Fragment,{children:[(0,e.jsxs)("div",{className:"l-tablet:flex l-tablet:flex-col specs-content-item-product box-border grid w-full cursor-pointer grid-cols-3 border-t-0 border-t-[#E4E5E6]",children:[t?.title&&(0,e.jsx)(d.Heading,{as:"h3",html:t?.title||"",className:"l:hidden specs-item-product-title"}),(0,e.jsx)("div",{className:`l-tablet:w-full l-tablet:gap-4 laptop:gap-8 desktop:gap-12 desktop:p-6 lg-desktop:gap-16 grid-cols- col-span-2 grid flex-1 pb-4${D?3:2} specs-item-product-body pr-0`,children:Object.keys(c)?.map((l,r)=>{const m=c?.[l],x=u?.products?.find?.(f=>f?.handle===m?.handle);return(0,e.jsx)("div",{children:V({...x,sku:m?.sku,item:l},r)},l)})})]}),s?.length?F(s):null]}):F(s)};return(0,g.useImperativeHandle)(n,()=>E.current),(0,p.useEffect)(()=>{if(!u?.products?.length)return;const t=v?.sku?.split?.(",")||[];let s={};t?.forEach?.((o,l)=>{const r=u?.products?.find?.(m=>{if(m?.variants?.find?.(f=>f?.sku===o))return!0});r&&(s={...s,[l]:{sku:o,name:r?.name||r?.title,handle:r?.handle}})}),w(s),S(t?.length>2)},[u]),(0,p.useEffect)(()=>{if(N){const t=Object.keys(c||{});if(t?.length>2){const s=t?.slice?.(0,2);let o={};s?.forEach?.(l=>{o={...o,[l]:c?.[l]}}),S(!1),w(o)}}},[N]),(0,e.jsx)("div",{className:"specs-wrapper w-full overflow-hidden bg-[#F5F5F7]",ref:E,children:M?.data?(0,e.jsx)("div",{className:"specs-wrapper-content box-border w-full overflow-hidden",children:M?.data?.map?.((t,s)=>(0,e.jsx)("div",{className:"specs-wrapper-content-item w-full overflow-hidden pt-10 [&:first-child]:pt-0",children:O(t)},s))}):null})});L.displayName="Specs";var X=(0,P.withLayout)(L);
1
+ "use strict";"use client";var q=Object.create;var h=Object.defineProperty;var z=Object.getOwnPropertyDescriptor;var Q=Object.getOwnPropertyNames;var G=Object.getPrototypeOf,J=Object.prototype.hasOwnProperty;var K=(a,n)=>{for(var i in n)h(a,i,{get:n[i],enumerable:!0})},j=(a,n,i,u)=>{if(n&&typeof n=="object"||typeof n=="function")for(let b of Q(n))!J.call(a,b)&&b!==i&&h(a,b,{get:()=>n[b],enumerable:!(u=z(n,b))||u.enumerable});return a};var A=(a,n,i)=>(i=a!=null?q(G(a)):{},j(n||!a||!a.__esModule?h(i,"default",{value:a,enumerable:!0}):i,a)),W=a=>j(h({},"__esModule",{value:!0}),a);var Y={};K(Y,{default:()=>X});module.exports=W(Y);var e=require("react/jsx-runtime"),H=A(require("./dropdown.js")),R=require("../AiuiProvider/index.js"),I=require("react-responsive"),p=require("react"),P=require("../../shared/Styles.js"),_=require("../ShelfDisplay/shelfDisplay.js"),d=require("../../components/index.js"),g=A(require("react"));const L=g.default.forwardRef((a,n)=>{const{data:i,buildData:u,onChange:b,onSecondaryChange:Z}=a||{},N=(0,I.useMediaQuery)({query:"(max-width: 768px)"}),[c,w]=(0,p.useState)({}),[D,S]=(0,p.useState)(!1),[k,C]=(0,p.useState)({}),E=(0,g.useRef)(null),{locale:$="us"}=(0,R.useAiuiContext)(),{LeftMenu:M,RightMenu:T,DefaultSelectMenu:v}=(0,p.useMemo)(()=>i?.data||{},[i?.data]),U=t=>{try{const o=new URL(t).pathname.toLowerCase();return/\.(jpeg|jpg|gif|png|webp|bmp|svg|tiff)$/.test(o)}catch{return/\.(jpeg|jpg|gif|png|webp|bmp|svg|tiff)$/i.test(t)}},V=(t,s)=>{const o=T?.menus?.find?.(y=>y?.handle===t?.handle),l=t?.variants?.find?.(y=>y?.sku===t?.sku||o?.sku),r=l?.coupons?.[0],{price:m,basePrice:x}=(0,_.formatVariantPrice)({locale:$||"us",amount:r?r?.variant_price4wscode:l?.price,baseAmount:r?l?.price:0,currencyCode:t?.price?.currencyCode||"USD"}),f=typeof v?.buttonText=="string"?v?.buttonText:v?.buttonText?.[String(s)]||"";return(0,e.jsxs)("div",{className:"specs-sku-node-wrap box-border",children:[(0,e.jsxs)(d.Text,{className:"md-tablet:p-2 l-tablet:mb-4 l-tablet:text-sm desktop:px-6 lg-desktop:mb-8 lg-desktop:text-lg openDropDown specs-sku-node-text relative mb-6 box-border block rounded-[50px] border border-[#E4E5E6] bg-[#F5F5F7] px-6 py-4 text-base font-bold",onClick:()=>C({...k,[s]:!k?.[s]}),children:[(0,e.jsxs)("div",{className:"flex items-center justify-between overflow-hidden",children:[(0,e.jsx)("div",{className:"openDropDown md-tablet:text-sm lg-desktop:text-lg specs-sku-node-title flex-1 truncate text-base",title:c?.[s]?.name||"",children:c?.[s]?.name||""}),(0,e.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"25",viewBox:"0 0 24 25",fill:"none",className:"openDropDown",children:(0,e.jsx)("path",{d:"M6 9.5L12 15.5L18 9.5",stroke:"#1D1D1F","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"})})]}),(0,e.jsx)(H.default,{index:s,list:u?.products,active:c,filterActive:c,setActive:w,visible:k,setVisible:C})]}),(0,e.jsx)("div",{className:"lg-desktop:max-h-[196px] lg-desktop:max-w-[196px] max-h-[138px] max-w-[138px]",children:(0,e.jsx)(d.Picture,{source:l?.image?.url||"",className:"aspect-h-[280] aspect-w-[280]",imgClassName:"w-full h-full object-cover hover:scale-105 transition-all duration-300"})}),l?.availableForSale?(0,e.jsxs)("div",{className:"lg-desktop:text-2xl mb-2 mt-6 flex items-center text-xl font-bold",children:[(0,e.jsx)("div",{className:"specs-sku-node-price text-[#1D1D1F]",children:m||""}),x&&(0,e.jsx)("div",{className:"lg-desktop:text-2xl specs-sku-node-base-price ml-1 text-xl text-[#86868C] line-through",children:x})]}):!1,f?(0,e.jsx)(d.Button,{onClick:()=>{b?.(t,s)},className:"specs-sku-node-button",children:f}):null]})},B=t=>t&&typeof t!="string"?(0,e.jsxs)("div",{className:"size-full",children:[(0,e.jsx)("p",{className:"min-xxl:text-lg specs-normal-node-text text-base font-bold text-[#1D1D1F] md:text-sm",dangerouslySetInnerHTML:{__html:t?.text||""}}),(0,e.jsx)(d.Picture,{source:t?.imgUrl,className:"l:max-h-[174px] l:max-w-[174px] m-auto max-h-[360px] max-w-[360px]",imgClassName:"w-full h-full object-cover"})]}):(0,e.jsx)("div",{className:"break-all",children:U(t)?(0,e.jsx)(d.Picture,{source:t,className:"l:max-h-[174px] l:max-w-[174px] m-auto max-h-[360px] max-w-[360px]",imgClassName:"w-full h-full object-cover"}):(0,e.jsx)("p",{className:"min-xxl:text-lg specs-normal-node-text text-base font-bold text-[#1D1D1F] md:text-sm",dangerouslySetInnerHTML:{__html:t||""}})}),F=t=>t.map((s,o)=>{const l=o===0;return(0,e.jsxs)("div",{className:"l-tablet:flex l-tablet:flex-col box-border grid w-full cursor-pointer grid-cols-3 overflow-hidden border-t border-t-[#E4E5E6] specs-product-node-wrap",children:[(0,e.jsx)(d.Heading,{as:"h3",html:s||"",className:"tablet:py-6 l-tablet:text-[#86868C] desktop:p-6 lg-desktop:text-lg specs-product-node-title mr-4 flex-1 pt-4 text-base font-bold md:text-sm"}),(0,e.jsx)("div",{className:`l-tablet:w-full l-tablet:gap-4 laptop:gap-8 desktop:gap-12 desktop:p-6 lg-desktop:gap-16 grid-cols-${D?3:2} specs-product-node-body col-span-2 grid flex-1 py-6`,children:Object.keys(c)?.map?.(r=>{const m=c?.[r],x=T?.menus?.find?.(f=>f?.handle===m?.handle)?.subTitle;return B(x?.[s])})})]},s)}),O=t=>{if(!c)return;const{subTitle:s,isProduct:o}=t;return o?(0,e.jsxs)(e.Fragment,{children:[(0,e.jsxs)("div",{className:"l-tablet:flex l-tablet:flex-col specs-content-item-product box-border grid w-full cursor-pointer grid-cols-3 border-t-0 border-t-[#E4E5E6]",children:[t?.title&&(0,e.jsx)(d.Heading,{as:"h3",html:t?.title||"",className:"l:hidden specs-item-product-title"}),(0,e.jsx)("div",{className:`l-tablet:w-full l-tablet:gap-4 laptop:gap-8 desktop:gap-12 desktop:p-6 lg-desktop:gap-16 grid-cols-${D?3:2} specs-item-product-body col-span-2 grid flex-1 pb-4 pr-0`,children:Object.keys(c)?.map((l,r)=>{const m=c?.[l],x=u?.products?.find?.(f=>f?.handle===m?.handle);return(0,e.jsx)("div",{children:V({...x,sku:m?.sku,item:l},r)},l)})})]}),s?.length?F(s):null]}):F(s)};return(0,g.useImperativeHandle)(n,()=>E.current),(0,p.useEffect)(()=>{if(!u?.products?.length)return;const t=v?.sku?.split?.(",")||[];let s={};t?.forEach?.((o,l)=>{const r=u?.products?.find?.(m=>{if(m?.variants?.find?.(f=>f?.sku===o))return!0});r&&(s={...s,[l]:{sku:o,name:r?.name||r?.title,handle:r?.handle}})}),w(s),S(t?.length>2)},[u]),(0,p.useEffect)(()=>{if(N){const t=Object.keys(c||{});if(t?.length>2){const s=t?.slice?.(0,2);let o={};s?.forEach?.(l=>{o={...o,[l]:c?.[l]}}),S(!1),w(o)}}},[N]),(0,e.jsx)("div",{className:"specs-wrapper w-full overflow-hidden bg-[#F5F5F7]",ref:E,children:M?.data?(0,e.jsx)("div",{className:"specs-wrapper-content box-border w-full overflow-hidden",children:M?.data?.map?.((t,s)=>(0,e.jsx)("div",{className:"specs-wrapper-content-item w-full overflow-hidden pt-10 [&:first-child]:pt-0",children:O(t)},s))}):null})});L.displayName="Specs";var X=(0,P.withLayout)(L);
2
2
  //# sourceMappingURL=index.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/biz-components/Specs/index.tsx"],
4
- "sourcesContent": ["'use client'\n\nimport DropDown from './dropdown.js'\nimport { useAiuiContext } from '../AiuiProvider/index.js'\nimport { useMediaQuery } from 'react-responsive'\nimport { useMemo, useState, useEffect } from 'react'\nimport { withLayout } from '../../shared/Styles.js'\nimport { formatVariantPrice } from '../ShelfDisplay/shelfDisplay.js'\nimport { Picture, Text, Button, Container, Heading } from '../../components/index.js'\nimport React, { useImperativeHandle, useRef } from 'react'\n\nconst Specs = React.forwardRef<HTMLDivElement, any>((page: any, ref) => {\n const { data, buildData, onChange, onSecondaryChange } = page || {}\n\n const isMobile = useMediaQuery({ query: '(max-width: 768px)' })\n\n const [active, setActive] = useState<any>({})\n const [isShowMax, setIsShowMax] = useState<boolean>(false)\n const [visibleActive, setVisibleActive] = useState<{ [key: number]: boolean }>({})\n\n const innerRef = useRef<HTMLDivElement>(null)\n\n const { locale = 'us' } = useAiuiContext()\n\n const { LeftMenu, RightMenu, DefaultSelectMenu } = useMemo(() => data?.data || {}, [data?.data])\n\n const isImageUrl = (urlPath: string) => {\n try {\n const url = new URL(urlPath)\n const path = url.pathname.toLowerCase()\n return /\\.(jpeg|jpg|gif|png|webp|bmp|svg|tiff)$/.test(path)\n } catch (e) {\n // \u5982\u679C\u4F20\u5165\u7684\u4E0D\u662F\u6709\u6548URL\uFF08\u5982\u76F8\u5BF9\u8DEF\u5F84\uFF09\uFF0C\u76F4\u63A5\u68C0\u67E5\u8DEF\u5F84\n return /\\.(jpeg|jpg|gif|png|webp|bmp|svg|tiff)$/i.test(urlPath)\n }\n }\n\n const skuNode = (product: any, index: number) => {\n const findCurrentData = RightMenu?.menus?.find?.((item: any) => item?.handle === product?.handle)\n const findSku = product?.variants?.find?.((item: any) => item?.sku === product?.sku || findCurrentData?.sku)\n const coupon = findSku?.coupons?.[0]\n const { price, basePrice } = formatVariantPrice({\n locale: locale || 'us',\n amount: coupon ? coupon?.variant_price4wscode : findSku?.price,\n baseAmount: coupon ? findSku?.price : 0,\n currencyCode: product?.price?.currencyCode || 'USD',\n })\n const buttonTextValue =\n typeof DefaultSelectMenu?.buttonText === 'string'\n ? DefaultSelectMenu?.buttonText\n : DefaultSelectMenu?.buttonText?.[String(index)] || ''\n return (\n <div className=\"specs-sku-node-wrap box-border\">\n <Text\n className={`md-tablet:p-2 l-tablet:mb-4 l-tablet:text-sm desktop:px-6 lg-desktop:mb-8 lg-desktop:text-lg openDropDown specs-sku-node-text relative mb-6 box-border block rounded-[50px] border border-[#E4E5E6] bg-[#F5F5F7] px-6 py-4 text-base font-bold`}\n onClick={() => setVisibleActive({ ...visibleActive, [index]: !visibleActive?.[index] })}\n >\n <div className=\"flex items-center justify-between overflow-hidden\">\n <div\n className=\"openDropDown md-tablet:text-sm lg-desktop:text-lg specs-sku-node-title flex-1 truncate text-base\"\n title={active?.[index]?.name || ''}\n >\n {active?.[index]?.name || ''}\n </div>\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"24\"\n height=\"25\"\n viewBox=\"0 0 24 25\"\n fill=\"none\"\n className=\"openDropDown\"\n >\n <path\n d=\"M6 9.5L12 15.5L18 9.5\"\n stroke=\"#1D1D1F\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n />\n </svg>\n </div>\n <DropDown\n index={index}\n list={buildData?.products}\n active={active}\n filterActive={active}\n setActive={setActive}\n visible={visibleActive}\n setVisible={setVisibleActive}\n />\n </Text>\n <div className=\"lg-desktop:max-h-[196px] lg-desktop:max-w-[196px] max-h-[138px] max-w-[138px]\">\n <Picture\n source={findSku?.image?.url || ''}\n className=\"aspect-h-[280] aspect-w-[280]\"\n imgClassName=\"w-full h-full object-cover hover:scale-105 transition-all duration-300\"\n />\n </div>\n {findSku?.availableForSale ? (\n <div className=\"lg-desktop:text-2xl mb-2 mt-6 flex items-center text-xl font-bold\">\n <div className=\"specs-sku-node-price text-[#1D1D1F]\">{price || ''}</div>\n {basePrice && (\n <div className=\"lg-desktop:text-2xl specs-sku-node-base-price ml-1 text-xl text-[#86868C] line-through\">\n {basePrice}\n </div>\n )}\n </div>\n ) : (\n false\n )}\n {buttonTextValue ? (\n <Button\n onClick={() => {\n onChange?.(product, index)\n }}\n className=\"specs-sku-node-button\"\n >\n {buttonTextValue}\n </Button>\n ) : null}\n </div>\n )\n }\n\n const normalNode = (v: any) => {\n if (v && typeof v !== 'string') {\n return (\n <div className=\"size-full\">\n <p\n className=\"min-xxl:text-lg specs-normal-node-text text-base font-bold text-[#1D1D1F] md:text-sm\"\n dangerouslySetInnerHTML={{\n __html: v?.text || '',\n }}\n />\n <Picture\n source={v?.imgUrl}\n className=\"l:max-h-[174px] l:max-w-[174px] m-auto max-h-[360px] max-w-[360px]\"\n imgClassName=\"w-full h-full object-cover\"\n />\n </div>\n )\n }\n return (\n <div className=\"break-all\">\n {isImageUrl(v) ? (\n <Picture\n source={v}\n className=\"l:max-h-[174px] l:max-w-[174px] m-auto max-h-[360px] max-w-[360px]\"\n imgClassName=\"w-full h-full object-cover\"\n />\n ) : (\n <p\n className=\"min-xxl:text-lg specs-normal-node-text text-base font-bold text-[#1D1D1F] md:text-sm\"\n dangerouslySetInnerHTML={{\n __html: v || '',\n }}\n />\n )}\n </div>\n )\n }\n\n const productNode = (data: any) => {\n return data.map((st: any, idx: number) => {\n const isFirstParameter = idx === 0\n return (\n <div\n key={st}\n className={`l-tablet:flex l-tablet:flex-col box-border grid w-full cursor-pointer grid-cols-3 overflow-hidden border-t border-t-[#E4E5E6] ${isFirstParameter ? '' : ''} specs-product-node-wrap`}\n >\n <Heading\n as=\"h3\"\n html={st || ''}\n className=\"tablet:py-6 l-tablet:text-[#86868C] desktop:p-6 lg-desktop:text-lg specs-product-node-title mr-4 flex-1 pt-4 text-base font-bold md:text-sm\"\n />\n <div\n className={`l-tablet:w-full l-tablet:gap-4 laptop:gap-8 desktop:gap-12 desktop:p-6 lg-desktop:gap-16 grid-cols- col-span-2 grid flex-1 py-6${isShowMax ? 3 : 2} specs-product-node-body`}\n >\n {Object.keys(active)?.map?.((item: string) => {\n const currentData = active?.[item]\n const currentMenus = RightMenu?.menus?.find?.(\n (item: any) => item?.handle === currentData?.handle\n )?.subTitle\n return normalNode(currentMenus?.[st])\n })}\n </div>\n </div>\n )\n })\n }\n\n // \u5DE6\u4FA7\u6807\u9898\u83DC\u5355\n const childrenNode = (node: any) => {\n if (!active) return\n const { subTitle, isProduct } = node\n // \u5982\u679C\u662F\u4EA7\u54C1\n if (isProduct) {\n return (\n <>\n <div\n className={`l-tablet:flex l-tablet:flex-col specs-content-item-product box-border grid w-full cursor-pointer grid-cols-3 border-t-0 border-t-[#E4E5E6]`}\n >\n {node?.title && <Heading as=\"h3\" html={node?.title || ''} className=\"l:hidden specs-item-product-title\" />}\n <div\n className={`l-tablet:w-full l-tablet:gap-4 laptop:gap-8 desktop:gap-12 desktop:p-6 lg-desktop:gap-16 grid-cols- col-span-2 grid flex-1 pb-4${isShowMax ? 3 : 2} specs-item-product-body pr-0`}\n >\n {Object.keys(active)?.map((item: string, index: number) => {\n const currentData = active?.[item]\n const currentProduct = buildData?.products?.find?.((item: any) => item?.handle === currentData?.handle)\n return <div key={item}>{skuNode({ ...currentProduct, sku: currentData?.sku, item: item }, index)}</div>\n })}\n </div>\n </div>\n {subTitle?.length ? productNode(subTitle) : null}\n </>\n )\n }\n return productNode(subTitle)\n }\n\n useImperativeHandle(ref, () => innerRef.current as HTMLDivElement)\n\n useEffect(() => {\n if (!buildData?.products?.length) return\n const skus = DefaultSelectMenu?.sku?.split?.(',') || []\n let currentActive = {}\n skus?.forEach?.((sku: string, index: number) => {\n const findData = buildData?.products?.find?.((item: any) => {\n const findSku = item?.variants?.find?.((v: any) => v?.sku === sku)\n if (findSku) return true\n })\n if (findData) {\n currentActive = {\n ...currentActive,\n [index]: {\n sku: sku,\n name: findData?.name || findData?.title,\n handle: findData?.handle,\n },\n }\n }\n })\n setActive(currentActive)\n setIsShowMax(skus?.length > 2)\n }, [buildData])\n\n useEffect(() => {\n if (isMobile) {\n const currentActive = Object.keys(active || {})\n if (currentActive?.length > 2) {\n const newActive = currentActive?.slice?.(0, 2)\n let newShowActive = {}\n newActive?.forEach?.((item: string) => {\n newShowActive = { ...newShowActive, [item]: active?.[item] }\n })\n setIsShowMax(false)\n setActive(newShowActive)\n }\n }\n }, [isMobile])\n\n return (\n <div className=\"specs-wrapper w-full overflow-hidden bg-[#F5F5F7]\" ref={innerRef}>\n {LeftMenu?.data ? (\n <div className=\"specs-wrapper-content box-border w-full overflow-hidden\">\n {LeftMenu?.data?.map?.((item: any, index: number) => {\n return (\n <div key={index} className=\"specs-wrapper-content-item w-full overflow-hidden pt-10 [&:first-child]:pt-0\">\n {childrenNode(item)}\n </div>\n )\n })}\n </div>\n ) : null}\n </div>\n )\n})\n\nSpecs.displayName = 'Specs'\n\nexport default withLayout(Specs)\n"],
5
- "mappings": "ukBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,aAAAE,IAAA,eAAAC,EAAAH,GAyDU,IAAAI,EAAA,6BAvDVC,EAAqB,4BACrBC,EAA+B,oCAC/BC,EAA8B,4BAC9BC,EAA6C,iBAC7CC,EAA2B,kCAC3BC,EAAmC,2CACnCC,EAA0D,qCAC1DH,EAAmD,oBAEnD,MAAMI,EAAQ,EAAAC,QAAM,WAAgC,CAACC,EAAWC,IAAQ,CACtE,KAAM,CAAE,KAAAC,EAAM,UAAAC,EAAW,SAAAC,EAAU,kBAAAC,CAAkB,EAAIL,GAAQ,CAAC,EAE5DM,KAAW,iBAAc,CAAE,MAAO,oBAAqB,CAAC,EAExD,CAACC,EAAQC,CAAS,KAAI,YAAc,CAAC,CAAC,EACtC,CAACC,EAAWC,CAAY,KAAI,YAAkB,EAAK,EACnD,CAACC,EAAeC,CAAgB,KAAI,YAAqC,CAAC,CAAC,EAE3EC,KAAW,UAAuB,IAAI,EAEtC,CAAE,OAAAC,EAAS,IAAK,KAAI,kBAAe,EAEnC,CAAE,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EAAG,CACP,IAAKwB,EACL,KAAMC,GAAU,MAAQA,GAAU,MAClC,OAAQA,GAAU,MACpB,CACF,EAEJ,CAAC,EACDxC,EAAUsC,CAAa,EACvBpC,EAAamC,GAAM,OAAS,CAAC,CAC/B,EAAG,CAAC1C,CAAS,CAAC,KAEd,aAAU,IAAM,CACd,GAAIG,EAAU,CACZ,MAAMwC,EAAgB,OAAO,KAAKvC,GAAU,CAAC,CAAC,EAC9C,GAAIuC,GAAe,OAAS,EAAG,CAC7B,MAAMG,EAAYH,GAAe,QAAQ,EAAG,CAAC,EAC7C,IAAII,EAAgB,CAAC,EACrBD,GAAW,UAAWxB,GAAiB,CACrCyB,EAAgB,CAAE,GAAGA,EAAe,CAACzB,CAAI,EAAGlB,IAASkB,CAAI,CAAE,CAC7D,CAAC,EACDf,EAAa,EAAK,EAClBF,EAAU0C,CAAa,CACzB,CACF,CACF,EAAG,CAAC5C,CAAQ,CAAC,KAGX,OAAC,OAAI,UAAU,oDAAoD,IAAKO,EACrE,SAAAE,GAAU,QACT,OAAC,OAAI,UAAU,0DACZ,SAAAA,GAAU,MAAM,MAAM,CAACU,EAAWF,OAE/B,OAAC,OAAgB,UAAU,+EACxB,SAAAiB,EAAaf,CAAI,GADVF,CAEV,CAEH,EACH,EACE,KACN,CAEJ,CAAC,EAEDzB,EAAM,YAAc,QAEpB,IAAOV,KAAQ,cAAWU,CAAK",
4
+ "sourcesContent": ["'use client'\n\nimport DropDown from './dropdown.js'\nimport { useAiuiContext } from '../AiuiProvider/index.js'\nimport { useMediaQuery } from 'react-responsive'\nimport { useMemo, useState, useEffect } from 'react'\nimport { withLayout } from '../../shared/Styles.js'\nimport { formatVariantPrice } from '../ShelfDisplay/shelfDisplay.js'\nimport { Picture, Text, Button, Container, Heading } from '../../components/index.js'\nimport React, { useImperativeHandle, useRef } from 'react'\n\nconst Specs = React.forwardRef<HTMLDivElement, any>((page: any, ref) => {\n const { data, buildData, onChange, onSecondaryChange } = page || {}\n\n const isMobile = useMediaQuery({ query: '(max-width: 768px)' })\n\n const [active, setActive] = useState<any>({})\n const [isShowMax, setIsShowMax] = useState<boolean>(false)\n const [visibleActive, setVisibleActive] = useState<{ [key: number]: boolean }>({})\n\n const innerRef = useRef<HTMLDivElement>(null)\n\n const { locale = 'us' } = useAiuiContext()\n\n const { LeftMenu, RightMenu, DefaultSelectMenu } = useMemo(() => data?.data || {}, [data?.data])\n\n const isImageUrl = (urlPath: string) => {\n try {\n const url = new URL(urlPath)\n const path = url.pathname.toLowerCase()\n return /\\.(jpeg|jpg|gif|png|webp|bmp|svg|tiff)$/.test(path)\n } catch (e) {\n // \u5982\u679C\u4F20\u5165\u7684\u4E0D\u662F\u6709\u6548URL\uFF08\u5982\u76F8\u5BF9\u8DEF\u5F84\uFF09\uFF0C\u76F4\u63A5\u68C0\u67E5\u8DEF\u5F84\n return /\\.(jpeg|jpg|gif|png|webp|bmp|svg|tiff)$/i.test(urlPath)\n }\n }\n\n const skuNode = (product: any, index: number) => {\n const findCurrentData = RightMenu?.menus?.find?.((item: any) => item?.handle === product?.handle)\n const findSku = product?.variants?.find?.((item: any) => item?.sku === product?.sku || findCurrentData?.sku)\n const coupon = findSku?.coupons?.[0]\n const { price, basePrice } = formatVariantPrice({\n locale: locale || 'us',\n amount: coupon ? coupon?.variant_price4wscode : findSku?.price,\n baseAmount: coupon ? findSku?.price : 0,\n currencyCode: product?.price?.currencyCode || 'USD',\n })\n const buttonTextValue =\n typeof DefaultSelectMenu?.buttonText === 'string'\n ? DefaultSelectMenu?.buttonText\n : DefaultSelectMenu?.buttonText?.[String(index)] || ''\n return (\n <div className=\"specs-sku-node-wrap box-border\">\n <Text\n className={`md-tablet:p-2 l-tablet:mb-4 l-tablet:text-sm desktop:px-6 lg-desktop:mb-8 lg-desktop:text-lg openDropDown specs-sku-node-text relative mb-6 box-border block rounded-[50px] border border-[#E4E5E6] bg-[#F5F5F7] px-6 py-4 text-base font-bold`}\n onClick={() => setVisibleActive({ ...visibleActive, [index]: !visibleActive?.[index] })}\n >\n <div className=\"flex items-center justify-between overflow-hidden\">\n <div\n className=\"openDropDown md-tablet:text-sm lg-desktop:text-lg specs-sku-node-title flex-1 truncate text-base\"\n title={active?.[index]?.name || ''}\n >\n {active?.[index]?.name || ''}\n </div>\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n width=\"24\"\n height=\"25\"\n viewBox=\"0 0 24 25\"\n fill=\"none\"\n className=\"openDropDown\"\n >\n <path\n d=\"M6 9.5L12 15.5L18 9.5\"\n stroke=\"#1D1D1F\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n />\n </svg>\n </div>\n <DropDown\n index={index}\n list={buildData?.products}\n active={active}\n filterActive={active}\n setActive={setActive}\n visible={visibleActive}\n setVisible={setVisibleActive}\n />\n </Text>\n <div className=\"lg-desktop:max-h-[196px] lg-desktop:max-w-[196px] max-h-[138px] max-w-[138px]\">\n <Picture\n source={findSku?.image?.url || ''}\n className=\"aspect-h-[280] aspect-w-[280]\"\n imgClassName=\"w-full h-full object-cover hover:scale-105 transition-all duration-300\"\n />\n </div>\n {findSku?.availableForSale ? (\n <div className=\"lg-desktop:text-2xl mb-2 mt-6 flex items-center text-xl font-bold\">\n <div className=\"specs-sku-node-price text-[#1D1D1F]\">{price || ''}</div>\n {basePrice && (\n <div className=\"lg-desktop:text-2xl specs-sku-node-base-price ml-1 text-xl text-[#86868C] line-through\">\n {basePrice}\n </div>\n )}\n </div>\n ) : (\n false\n )}\n {buttonTextValue ? (\n <Button\n onClick={() => {\n onChange?.(product, index)\n }}\n className=\"specs-sku-node-button\"\n >\n {buttonTextValue}\n </Button>\n ) : null}\n </div>\n )\n }\n\n const normalNode = (v: any) => {\n if (v && typeof v !== 'string') {\n return (\n <div className=\"size-full\">\n <p\n className=\"min-xxl:text-lg specs-normal-node-text text-base font-bold text-[#1D1D1F] md:text-sm\"\n dangerouslySetInnerHTML={{\n __html: v?.text || '',\n }}\n />\n <Picture\n source={v?.imgUrl}\n className=\"l:max-h-[174px] l:max-w-[174px] m-auto max-h-[360px] max-w-[360px]\"\n imgClassName=\"w-full h-full object-cover\"\n />\n </div>\n )\n }\n return (\n <div className=\"break-all\">\n {isImageUrl(v) ? (\n <Picture\n source={v}\n className=\"l:max-h-[174px] l:max-w-[174px] m-auto max-h-[360px] max-w-[360px]\"\n imgClassName=\"w-full h-full object-cover\"\n />\n ) : (\n <p\n className=\"min-xxl:text-lg specs-normal-node-text text-base font-bold text-[#1D1D1F] md:text-sm\"\n dangerouslySetInnerHTML={{\n __html: v || '',\n }}\n />\n )}\n </div>\n )\n }\n\n const productNode = (data: any) => {\n return data.map((st: any, idx: number) => {\n const isFirstParameter = idx === 0\n return (\n <div\n key={st}\n className={`l-tablet:flex l-tablet:flex-col box-border grid w-full cursor-pointer grid-cols-3 overflow-hidden border-t border-t-[#E4E5E6] ${isFirstParameter ? '' : ''} specs-product-node-wrap`}\n >\n <Heading\n as=\"h3\"\n html={st || ''}\n className=\"tablet:py-6 l-tablet:text-[#86868C] desktop:p-6 lg-desktop:text-lg specs-product-node-title mr-4 flex-1 pt-4 text-base font-bold md:text-sm\"\n />\n <div\n className={`l-tablet:w-full l-tablet:gap-4 laptop:gap-8 desktop:gap-12 desktop:p-6 lg-desktop:gap-16 grid-cols-${isShowMax ? 3 : 2} specs-product-node-body col-span-2 grid flex-1 py-6`}\n >\n {Object.keys(active)?.map?.((item: string) => {\n const currentData = active?.[item]\n const currentMenus = RightMenu?.menus?.find?.(\n (item: any) => item?.handle === currentData?.handle\n )?.subTitle\n return normalNode(currentMenus?.[st])\n })}\n </div>\n </div>\n )\n })\n }\n\n // \u5DE6\u4FA7\u6807\u9898\u83DC\u5355\n const childrenNode = (node: any) => {\n if (!active) return\n const { subTitle, isProduct } = node\n // \u5982\u679C\u662F\u4EA7\u54C1\n if (isProduct) {\n return (\n <>\n <div\n className={`l-tablet:flex l-tablet:flex-col specs-content-item-product box-border grid w-full cursor-pointer grid-cols-3 border-t-0 border-t-[#E4E5E6]`}\n >\n {node?.title && <Heading as=\"h3\" html={node?.title || ''} className=\"l:hidden specs-item-product-title\" />}\n <div\n className={`l-tablet:w-full l-tablet:gap-4 laptop:gap-8 desktop:gap-12 desktop:p-6 lg-desktop:gap-16 grid-cols-${isShowMax ? 3 : 2} specs-item-product-body col-span-2 grid flex-1 pb-4 pr-0`}\n >\n {Object.keys(active)?.map((item: string, index: number) => {\n const currentData = active?.[item]\n const currentProduct = buildData?.products?.find?.((item: any) => item?.handle === currentData?.handle)\n return <div key={item}>{skuNode({ ...currentProduct, sku: currentData?.sku, item: item }, index)}</div>\n })}\n </div>\n </div>\n {subTitle?.length ? productNode(subTitle) : null}\n </>\n )\n }\n return productNode(subTitle)\n }\n\n useImperativeHandle(ref, () => innerRef.current as HTMLDivElement)\n\n useEffect(() => {\n if (!buildData?.products?.length) return\n const skus = DefaultSelectMenu?.sku?.split?.(',') || []\n let currentActive = {}\n skus?.forEach?.((sku: string, index: number) => {\n const findData = buildData?.products?.find?.((item: any) => {\n const findSku = item?.variants?.find?.((v: any) => v?.sku === sku)\n if (findSku) return true\n })\n if (findData) {\n currentActive = {\n ...currentActive,\n [index]: {\n sku: sku,\n name: findData?.name || findData?.title,\n handle: findData?.handle,\n },\n }\n }\n })\n setActive(currentActive)\n setIsShowMax(skus?.length > 2)\n }, [buildData])\n\n useEffect(() => {\n if (isMobile) {\n const currentActive = Object.keys(active || {})\n if (currentActive?.length > 2) {\n const newActive = currentActive?.slice?.(0, 2)\n let newShowActive = {}\n newActive?.forEach?.((item: string) => {\n newShowActive = { ...newShowActive, [item]: active?.[item] }\n })\n setIsShowMax(false)\n setActive(newShowActive)\n }\n }\n }, [isMobile])\n\n return (\n <div className=\"specs-wrapper w-full overflow-hidden bg-[#F5F5F7]\" ref={innerRef}>\n {LeftMenu?.data ? (\n <div className=\"specs-wrapper-content box-border w-full overflow-hidden\">\n {LeftMenu?.data?.map?.((item: any, index: number) => {\n return (\n <div key={index} className=\"specs-wrapper-content-item w-full overflow-hidden pt-10 [&:first-child]:pt-0\">\n {childrenNode(item)}\n </div>\n )\n })}\n </div>\n ) : null}\n </div>\n )\n})\n\nSpecs.displayName = 'Specs'\n\nexport default withLayout(Specs)\n"],
5
+ "mappings": "ukBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,aAAAE,IAAA,eAAAC,EAAAH,GAyDU,IAAAI,EAAA,6BAvDVC,EAAqB,4BACrBC,EAA+B,oCAC/BC,EAA8B,4BAC9BC,EAA6C,iBAC7CC,EAA2B,kCAC3BC,EAAmC,2CACnCC,EAA0D,qCAC1DH,EAAmD,oBAEnD,MAAMI,EAAQ,EAAAC,QAAM,WAAgC,CAACC,EAAWC,IAAQ,CACtE,KAAM,CAAE,KAAAC,EAAM,UAAAC,EAAW,SAAAC,EAAU,kBAAAC,CAAkB,EAAIL,GAAQ,CAAC,EAE5DM,KAAW,iBAAc,CAAE,MAAO,oBAAqB,CAAC,EAExD,CAACC,EAAQC,CAAS,KAAI,YAAc,CAAC,CAAC,EACtC,CAACC,EAAWC,CAAY,KAAI,YAAkB,EAAK,EACnD,CAACC,EAAeC,CAAgB,KAAI,YAAqC,CAAC,CAAC,EAE3EC,KAAW,UAAuB,IAAI,EAEtC,CAAE,OAAAC,EAAS,IAAK,KAAI,kBAAe,EAEnC,CAAE,SAAAC,EAAU,UAAAC,EAAW,kBAAAC,CAAkB,KAAI,WAAQ,IAAMf,GAAM,MAAQ,CAAC,EAAG,CAACA,GAAM,IAAI,CAAC,EAEzFgB,EAAcC,GAAoB,CACtC,GAAI,CAEF,MAAMC,EADM,IAAI,IAAID,CAAO,EACV,SAAS,YAAY,EACtC,MAAO,0CAA0C,KAAKC,CAAI,CAC5D,MAAY,CAEV,MAAO,2CAA2C,KAAKD,CAAO,CAChE,CACF,EAEME,EAAU,CAACC,EAAcC,IAAkB,CAC/C,MAAMC,EAAkBR,GAAW,OAAO,OAAQS,GAAcA,GAAM,SAAWH,GAAS,MAAM,EAC1FI,EAAUJ,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,EAAgB,CAAE,GAAGA,EAAe,CAACzB,CAAI,EAAGlB,IAASkB,CAAI,CAAE,CAC7D,CAAC,EACDf,EAAa,EAAK,EAClBF,EAAU0C,CAAa,CACzB,CACF,CACF,EAAG,CAAC5C,CAAQ,CAAC,KAGX,OAAC,OAAI,UAAU,oDAAoD,IAAKO,EACrE,SAAAE,GAAU,QACT,OAAC,OAAI,UAAU,0DACZ,SAAAA,GAAU,MAAM,MAAM,CAACU,EAAWF,OAE/B,OAAC,OAAgB,UAAU,+EACxB,SAAAiB,EAAaf,CAAI,GADVF,CAEV,CAEH,EACH,EACE,KACN,CAEJ,CAAC,EAEDzB,EAAM,YAAc,QAEpB,IAAOV,KAAQ,cAAWU,CAAK",
6
6
  "names": ["Specs_exports", "__export", "Specs_default", "__toCommonJS", "import_jsx_runtime", "import_dropdown", "import_AiuiProvider", "import_react_responsive", "import_react", "import_Styles", "import_shelfDisplay", "import_components", "Specs", "React", "page", "ref", "data", "buildData", "onChange", "onSecondaryChange", "isMobile", "active", "setActive", "isShowMax", "setIsShowMax", "visibleActive", "setVisibleActive", "innerRef", "locale", "LeftMenu", "RightMenu", "DefaultSelectMenu", "isImageUrl", "urlPath", "path", "skuNode", "product", "index", "findCurrentData", "item", "findSku", "coupon", "price", "basePrice", "buttonTextValue", "DropDown", "normalNode", "v", "productNode", "st", "idx", "isFirstParameter", "currentData", "currentMenus", "childrenNode", "node", "subTitle", "isProduct", "currentProduct", "skus", "currentActive", "sku", "findData", "newActive", "newShowActive"]
7
7
  }
@@ -1,2 +1,2 @@
1
- "use client";import{Fragment as n,jsx as e,jsxs as s}from"react/jsx-runtime";import{cn as x}from"../../helpers/utils.js";import{withLayout as c}from"../../shared/Styles.js";import{Picture as o,Text as m}from"../../components/index.js";const u=d=>{const{data:t,className:k}=d,{title:a,img:i,mobileImg:p,list:g}=t;return e(n,{children:s("div",{className:"w-full",children:[s("div",{className:"desktop:items-center desktop:justify-between desktop:flex-row flex w-full flex-col",children:[e("div",{className:" desktop:w-[600px] lg-desktop:w-[800px]",children:a&&e(m,{html:a,className:"desktop:text-[16px] lg-desktop:text-[18px] text-[14px] font-bold leading-[1.2]"})}),s("div",{children:[i?.url&&e(o,{className:"desktop:block hidden w-[464px] rounded-2xl",imgClassName:"",source:t?.img?.url,alt:t?.img?.alt||""}),p?.url&&e(o,{className:"desktop:hidden block w-[224px] rounded-2xl",imgClassName:"",source:t?.mobileImg?.url,alt:t?.mobileImg?.alt||""})]})]}),e("div",{className:"tablet:grid-cols-2 desktop:grid-cols-3 mt-[24px] grid grid-cols-1 gap-[16px]",children:g.map((l,r)=>s("div",{className:"relative",children:[e(o,{className:" rounded-2xl",imgClassName:"",source:l?.img?.url,alt:l?.img?.alt||""}),s("div",{className:x("text-info-primary desktop:bottom-[24px] desktop:left-[24px] lg-desktop:bottom-[32px] lg-desktop:left-[32px] absolute bottom-[16px] left-[16px] flex flex-col",{"aiui-dark":l.theme==="dark"}),children:[e(m,{html:l?.title,className:" lg-desktop:text-[24px] text-[20px] font-bold leading-[1.2]"}),e(m,{html:l?.desc,className:" lg-desktop:text-[16px] text-[14px] font-bold leading-[1.4]"})]})]},r))})]})})};var v=c(u);export{v as default};
1
+ "use client";import{Fragment as I,jsx as t,jsxs as l}from"react/jsx-runtime";import{cn as g}from"../../helpers/utils.js";import{withLayout as x}from"../../shared/Styles.js";import{Picture as m,Text as p}from"../../components/index.js";import{useExposure as u}from"../../hooks/useExposure.js";import{useRef as f}from"react";const k="image",N="aplus_desc",b=({index:s,item:e})=>{const o=f(null);return u(o,{componentType:k,componentName:N,position:s+1,componentTitle:e.title,componentDescription:e.desc}),l("div",{ref:o,className:"relative",children:[t(m,{className:" rounded-2xl",imgClassName:"",source:e?.img?.url,alt:e?.img?.alt||""}),l("div",{className:g("text-info-primary desktop:bottom-[24px] desktop:left-[24px] lg-desktop:bottom-[32px] lg-desktop:left-[32px] absolute bottom-[16px] left-[16px] flex flex-col",{"aiui-dark":e.theme==="dark"}),children:[t(p,{html:e?.title,className:" lg-desktop:text-[24px] text-[20px] font-bold leading-[1.2]"}),t(p,{html:e?.desc,className:" lg-desktop:text-[16px] text-[14px] font-bold leading-[1.4]"})]})]})},v=s=>{const{data:e,className:o}=s,{title:i,img:d,mobileImg:r,list:c}=e;return t(I,{children:l("div",{className:"w-full",children:[l("div",{className:"desktop:items-center desktop:justify-between desktop:flex-row flex w-full flex-col",children:[t("div",{className:" desktop:w-[600px] lg-desktop:w-[800px]",children:i&&t(p,{html:i,className:"desktop:text-[16px] lg-desktop:text-[18px] text-[14px] font-bold leading-[1.2]"})}),l("div",{children:[d?.url&&t(m,{className:"desktop:block hidden w-[464px] rounded-2xl",imgClassName:"",source:e?.img?.url,alt:e?.img?.alt||""}),r?.url&&t(m,{className:"desktop:hidden block w-[224px] rounded-2xl",imgClassName:"",source:e?.mobileImg?.url,alt:e?.mobileImg?.alt||""})]})]}),t("div",{className:"tablet:grid-cols-2 desktop:grid-cols-3 mt-[24px] grid grid-cols-1 gap-[16px]",children:c.map((n,a)=>t(b,{index:a,item:n},a))})]})})};var D=x(v);export{D as default};
2
2
  //# sourceMappingURL=index.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/biz-components/AplusDesc/index.tsx"],
4
- "sourcesContent": ["'use client'\nimport { cn } from '../../helpers/utils.js'\nimport type { Img } from '../../types/props.js'\nimport { withLayout } from '../../shared/Styles.js'\nimport { Picture, Text } from '../../components/index.js'\n\ntype AplusItem = {\n img: Img\n mobileImg: Img\n title: string\n desc: string\n theme: 'light' | 'dark'\n}\n\ntype AplusDescType = {\n data: {\n title: string\n img: Img\n mobileImg: Img\n list: AplusItem[]\n }\n className?: string\n}\n\nconst AplusDesc = (props: AplusDescType) => {\n const { data, className } = props\n const { title, img, mobileImg, list } = data\n\n return (\n <>\n <div className=\"w-full\">\n <div className=\"desktop:items-center desktop:justify-between desktop:flex-row flex w-full flex-col\">\n <div className=\" desktop:w-[600px] lg-desktop:w-[800px]\">\n {title && (\n <Text\n html={title}\n className=\"desktop:text-[16px] lg-desktop:text-[18px] text-[14px] font-bold leading-[1.2]\"\n />\n )}\n </div>\n <div>\n {img?.url && (\n <Picture\n className=\"desktop:block hidden w-[464px] rounded-2xl\"\n imgClassName=\"\"\n source={data?.img?.url}\n alt={data?.img?.alt || ''}\n />\n )}\n {mobileImg?.url && (\n <Picture\n className=\"desktop:hidden block w-[224px] rounded-2xl\"\n imgClassName=\"\"\n source={data?.mobileImg?.url}\n alt={data?.mobileImg?.alt || ''}\n />\n )}\n </div>\n </div>\n <div className=\"tablet:grid-cols-2 desktop:grid-cols-3 mt-[24px] grid grid-cols-1 gap-[16px]\">\n {list.map((item, ind) => (\n <div key={ind} className=\"relative\">\n <Picture className=\" rounded-2xl\" imgClassName=\"\" source={item?.img?.url} alt={item?.img?.alt || ''} />\n <div\n className={cn(\n 'text-info-primary desktop:bottom-[24px] desktop:left-[24px] lg-desktop:bottom-[32px] lg-desktop:left-[32px] absolute bottom-[16px] left-[16px] flex flex-col',\n {\n 'aiui-dark': item.theme === 'dark',\n }\n )}\n >\n <Text html={item?.title} className=\" lg-desktop:text-[24px] text-[20px] font-bold leading-[1.2]\" />\n <Text html={item?.desc} className=\" lg-desktop:text-[16px] text-[14px] font-bold leading-[1.4]\" />\n </div>\n </div>\n ))}\n </div>\n </div>\n </>\n )\n}\n\nexport default withLayout(AplusDesc)\n"],
5
- "mappings": "aA6BI,mBAAAA,EAKU,OAAAC,EAMJ,QAAAC,MAXN,oBA5BJ,OAAS,MAAAC,MAAU,yBAEnB,OAAS,cAAAC,MAAkB,yBAC3B,OAAS,WAAAC,EAAS,QAAAC,MAAY,4BAoB9B,MAAMC,EAAaC,GAAyB,CAC1C,KAAM,CAAE,KAAAC,EAAM,UAAAC,CAAU,EAAIF,EACtB,CAAE,MAAAG,EAAO,IAAAC,EAAK,UAAAC,EAAW,KAAAC,CAAK,EAAIL,EAExC,OACER,EAAAD,EAAA,CACE,SAAAE,EAAC,OAAI,UAAU,SACb,UAAAA,EAAC,OAAI,UAAU,qFACb,UAAAD,EAAC,OAAI,UAAU,0CACZ,SAAAU,GACCV,EAACK,EAAA,CACC,KAAMK,EACN,UAAU,iFACZ,EAEJ,EACAT,EAAC,OACE,UAAAU,GAAK,KACJX,EAACI,EAAA,CACC,UAAU,6CACV,aAAa,GACb,OAAQI,GAAM,KAAK,IACnB,IAAKA,GAAM,KAAK,KAAO,GACzB,EAEDI,GAAW,KACVZ,EAACI,EAAA,CACC,UAAU,6CACV,aAAa,GACb,OAAQI,GAAM,WAAW,IACzB,IAAKA,GAAM,WAAW,KAAO,GAC/B,GAEJ,GACF,EACAR,EAAC,OAAI,UAAU,+EACZ,SAAAa,EAAK,IAAI,CAACC,EAAMC,IACfd,EAAC,OAAc,UAAU,WACvB,UAAAD,EAACI,EAAA,CAAQ,UAAU,eAAe,aAAa,GAAG,OAAQU,GAAM,KAAK,IAAK,IAAKA,GAAM,KAAK,KAAO,GAAI,EACrGb,EAAC,OACC,UAAWC,EACT,+JACA,CACE,YAAaY,EAAK,QAAU,MAC9B,CACF,EAEA,UAAAd,EAACK,EAAA,CAAK,KAAMS,GAAM,MAAO,UAAU,8DAA8D,EACjGd,EAACK,EAAA,CAAK,KAAMS,GAAM,KAAM,UAAU,8DAA8D,GAClG,IAZQC,CAaV,CACD,EACH,GACF,EACF,CAEJ,EAEA,IAAOC,EAAQb,EAAWG,CAAS",
6
- "names": ["Fragment", "jsx", "jsxs", "cn", "withLayout", "Picture", "Text", "AplusDesc", "props", "data", "className", "title", "img", "mobileImg", "list", "item", "ind", "AplusDesc_default"]
4
+ "sourcesContent": ["'use client'\nimport { cn } from '../../helpers/utils.js'\nimport type { Img } from '../../types/props.js'\nimport { withLayout } from '../../shared/Styles.js'\nimport { Picture, Text } from '../../components/index.js'\nimport { useExposure } from '../../hooks/useExposure.js'\nimport { useRef } from 'react'\n\ntype AplusItem = {\n img: Img\n mobileImg: Img\n title: string\n desc: string\n theme: 'light' | 'dark'\n}\n\ntype AplusDescType = {\n data: {\n title: string\n img: Img\n mobileImg: Img\n list: AplusItem[]\n }\n className?: string\n}\n\nconst componentType = 'image'\nconst componentName = 'aplus_desc'\n\nconst Item = ({ index, item }: { index: number; item: AplusItem }) => {\n const ref = useRef<HTMLDivElement>(null)\n\n useExposure(ref, {\n componentType: componentType,\n componentName: componentName,\n position: index + 1,\n componentTitle: item.title,\n componentDescription: item.desc,\n })\n\n return (\n <div ref={ref} className=\"relative\">\n <Picture className=\" rounded-2xl\" imgClassName=\"\" source={item?.img?.url} alt={item?.img?.alt || ''} />\n <div\n className={cn(\n 'text-info-primary desktop:bottom-[24px] desktop:left-[24px] lg-desktop:bottom-[32px] lg-desktop:left-[32px] absolute bottom-[16px] left-[16px] flex flex-col',\n {\n 'aiui-dark': item.theme === 'dark',\n }\n )}\n >\n <Text html={item?.title} className=\" lg-desktop:text-[24px] text-[20px] font-bold leading-[1.2]\" />\n <Text html={item?.desc} className=\" lg-desktop:text-[16px] text-[14px] font-bold leading-[1.4]\" />\n </div>\n </div>\n )\n}\n\nconst AplusDesc = (props: AplusDescType) => {\n const { data, className } = props\n const { title, img, mobileImg, list } = data\n\n return (\n <>\n <div className=\"w-full\">\n <div className=\"desktop:items-center desktop:justify-between desktop:flex-row flex w-full flex-col\">\n <div className=\" desktop:w-[600px] lg-desktop:w-[800px]\">\n {title && (\n <Text\n html={title}\n className=\"desktop:text-[16px] lg-desktop:text-[18px] text-[14px] font-bold leading-[1.2]\"\n />\n )}\n </div>\n <div>\n {img?.url && (\n <Picture\n className=\"desktop:block hidden w-[464px] rounded-2xl\"\n imgClassName=\"\"\n source={data?.img?.url}\n alt={data?.img?.alt || ''}\n />\n )}\n {mobileImg?.url && (\n <Picture\n className=\"desktop:hidden block w-[224px] rounded-2xl\"\n imgClassName=\"\"\n source={data?.mobileImg?.url}\n alt={data?.mobileImg?.alt || ''}\n />\n )}\n </div>\n </div>\n <div className=\"tablet:grid-cols-2 desktop:grid-cols-3 mt-[24px] grid grid-cols-1 gap-[16px]\">\n {list.map((item, index) => (\n <Item key={index} index={index} item={item} />\n ))}\n </div>\n </div>\n </>\n )\n}\n\nexport default withLayout(AplusDesc)\n"],
5
+ "mappings": "aA0CM,OAqBF,YAAAA,EArBE,OAAAC,EACA,QAAAC,MADA,oBAzCN,OAAS,MAAAC,MAAU,yBAEnB,OAAS,cAAAC,MAAkB,yBAC3B,OAAS,WAAAC,EAAS,QAAAC,MAAY,4BAC9B,OAAS,eAAAC,MAAmB,6BAC5B,OAAS,UAAAC,MAAc,QAoBvB,MAAMC,EAAgB,QAChBC,EAAgB,aAEhBC,EAAO,CAAC,CAAE,MAAAC,EAAO,KAAAC,CAAK,IAA0C,CACpE,MAAMC,EAAMN,EAAuB,IAAI,EAEvC,OAAAD,EAAYO,EAAK,CACf,cAAeL,EACf,cAAeC,EACf,SAAUE,EAAQ,EAClB,eAAgBC,EAAK,MACrB,qBAAsBA,EAAK,IAC7B,CAAC,EAGCX,EAAC,OAAI,IAAKY,EAAK,UAAU,WACvB,UAAAb,EAACI,EAAA,CAAQ,UAAU,eAAe,aAAa,GAAG,OAAQQ,GAAM,KAAK,IAAK,IAAKA,GAAM,KAAK,KAAO,GAAI,EACrGX,EAAC,OACC,UAAWC,EACT,+JACA,CACE,YAAaU,EAAK,QAAU,MAC9B,CACF,EAEA,UAAAZ,EAACK,EAAA,CAAK,KAAMO,GAAM,MAAO,UAAU,8DAA8D,EACjGZ,EAACK,EAAA,CAAK,KAAMO,GAAM,KAAM,UAAU,8DAA8D,GAClG,GACF,CAEJ,EAEME,EAAaC,GAAyB,CAC1C,KAAM,CAAE,KAAAC,EAAM,UAAAC,CAAU,EAAIF,EACtB,CAAE,MAAAG,EAAO,IAAAC,EAAK,UAAAC,EAAW,KAAAC,CAAK,EAAIL,EAExC,OACEhB,EAAAD,EAAA,CACE,SAAAE,EAAC,OAAI,UAAU,SACb,UAAAA,EAAC,OAAI,UAAU,qFACb,UAAAD,EAAC,OAAI,UAAU,0CACZ,SAAAkB,GACClB,EAACK,EAAA,CACC,KAAMa,EACN,UAAU,iFACZ,EAEJ,EACAjB,EAAC,OACE,UAAAkB,GAAK,KACJnB,EAACI,EAAA,CACC,UAAU,6CACV,aAAa,GACb,OAAQY,GAAM,KAAK,IACnB,IAAKA,GAAM,KAAK,KAAO,GACzB,EAEDI,GAAW,KACVpB,EAACI,EAAA,CACC,UAAU,6CACV,aAAa,GACb,OAAQY,GAAM,WAAW,IACzB,IAAKA,GAAM,WAAW,KAAO,GAC/B,GAEJ,GACF,EACAhB,EAAC,OAAI,UAAU,+EACZ,SAAAqB,EAAK,IAAI,CAACT,EAAMD,IACfX,EAACU,EAAA,CAAiB,MAAOC,EAAO,KAAMC,GAA3BD,CAAiC,CAC7C,EACH,GACF,EACF,CAEJ,EAEA,IAAOW,EAAQnB,EAAWW,CAAS",
6
+ "names": ["Fragment", "jsx", "jsxs", "cn", "withLayout", "Picture", "Text", "useExposure", "useRef", "componentType", "componentName", "Item", "index", "item", "ref", "AplusDesc", "props", "data", "className", "title", "img", "mobileImg", "list", "AplusDesc_default"]
7
7
  }
@@ -1,2 +1,2 @@
1
- "use client";import{Fragment as x,jsx as t,jsxs as p}from"react/jsx-runtime";import"../../helpers/utils.js";import"../SwiperBox/index.js";import{withLayout as d}from"../../shared/Styles.js";import{Picture as s,Text as a}from"../../components/index.js";const n=i=>{const{data:l,className:g}=i,{list:r}=l;return t(x,{children:p("div",{className:"",children:[l?.title&&t("div",{className:"desktop:w-[800px] pb-[24px]",children:t(a,{html:l?.title,className:" desktop:!text-[32px] lg-desktop:text-lg line-clamp-3 !text-[24px] !leading-[1.2] [&_*_strong]:!font-bold"})}),l?.img?.url&&t(s,{className:"md-tablet:hidden aspect-[1664/560] rounded-2xl",imgClassName:"",source:l?.img?.url,alt:l?.img?.alt||""}),l?.mobileImg?.url&&t(s,{className:"tablet:hidden aspect-[358/360] rounded-2xl",imgClassName:"",source:l?.mobileImg?.url,alt:l?.mobileImg?.alt||""}),t("div",{className:"",children:t("div",{className:"flex flex-col gap-4",children:r.map((e,o)=>p("div",{className:`desktop:flex tablet:gap-8 laptop:gap-[64px] gap-4 pt-[64px] ${o%2===0?"laptop:flex-row-reverse":""}`,children:[p("div",{className:"desktop:w-[500px] lg-desktop:w-[640px] flex shrink-0 flex-col justify-center",children:[t(a,{html:e?.title,className:"graphic-title desktop:text-[32px] line-clamp-3 text-[24px] leading-[1.2] [&_*_strong]:!font-bold"}),t(a,{html:e?.description,className:"graphic-title desktop:pt-[8px] lg-desktop:text-[18px] desktop:text-[16px] pt-[4px] text-[14px] leading-[1.2] [&_*_strong]:!font-bold"}),e?.numberOne&&p("div",{className:"desktop:pt-[48px] desktop:flex-col desktop:gap-[48px] flex flex-row gap-[24px] pt-[24px]",children:[p("div",{className:"",children:[t(a,{style:{background:"var(--1, linear-gradient(90deg, #3AD1FF 0%, #008CD6 100%))",backgroundClip:"text",WebkitBackgroundClip:"text",WebkitTextFillColor:"transparent",color:"transparent"},html:e?.numberOne,className:"graphic-title desktop:text-[64px] line-clamp-3 text-[40px] leading-none [&_*_strong]:!font-bold"}),t(a,{html:e?.textOne,className:"graphic-title lg-desktop:text-lg desktop:text-[18px] line-clamp-3 text-[14px] leading-[1.4] [&_*_strong]:!font-bold"})]}),p("div",{children:[t(a,{style:{background:"var(--1, linear-gradient(90deg, #3AD1FF 0%, #008CD6 100%))",backgroundClip:"text",WebkitBackgroundClip:"text",WebkitTextFillColor:"transparent",color:"transparent"},html:e?.numberTwo,className:"graphic-title desktop:text-[64px] line-clamp-3 text-[40px] leading-none [&_*_strong]:!font-bold"}),t(a,{html:e?.textTwo,className:"graphic-title lg-desktop:text-lg desktop:text-[18px] line-clamp-3 text-[14px] leading-[1.4] [&_*_strong]:!font-bold"})]})]}),e?.icon?.url&&t("div",{className:"desktop:pt-[24px] lg-desktop:pt-[48px] pt-[24px]",children:t(s,{className:"desktop:w-[368px] lg-desktop:w-[488px] w-[358px]",source:e?.icon?.url,alt:e?.icon?.alt||""})})]}),t("div",{className:"md-tablet:hidden laptop:pt-[32px] desktop:pt-0 aspect-[964/560] overflow-hidden rounded-2xl pt-[24px]",children:t(s,{className:"size-full object-cover ",source:e?.img?.url,alt:e?.img?.alt||""})}),t("div",{className:"tablet:hidden mt-[24px] aspect-[358/360] overflow-hidden rounded-2xl",children:t(s,{className:"size-full object-cover",source:e?.mobileImg?.url,alt:e?.mobileImg?.alt||""})})]},o))})})]})})};var f=d(n);export{f as default};
1
+ "use client";import{Fragment as b,jsx as e,jsxs as o}from"react/jsx-runtime";import"../../helpers/utils.js";import"../SwiperBox/index.js";import{useExposure as d}from"../../hooks/useExposure.js";import{withLayout as m}from"../../shared/Styles.js";import{Picture as s,Text as l}from"../../components/index.js";import{useRef as x}from"react";const c="image",g="features",u=({index:p,item:t})=>{const a=x(null);return d(a,{componentType:c,componentName:g,position:p+1,componentTitle:t.title,componentDescription:t.description}),o("div",{className:`desktop:flex tablet:gap-8 laptop:gap-[64px] gap-4 pt-[64px] ${p%2===0?"laptop:flex-row-reverse":""}`,ref:a,children:[o("div",{className:"desktop:w-[500px] lg-desktop:w-[640px] flex shrink-0 flex-col justify-center",children:[e(l,{html:t?.title,className:"graphic-title desktop:text-base desktop:text-[32px] line-clamp-3 text-[24px] leading-[1.2] [&_*_strong]:!font-bold"}),e(l,{html:t?.description,className:"graphic-title desktop:pt-[8px] lg-desktop:text-lg desktop:text-base lg-desktop:text-[18px] desktop:text-[16px] pt-[4px] text-[14px] leading-[1.2] [&_*_strong]:!font-bold"}),t?.numberOne&&o("div",{className:"desktop:pt-[48px] desktop:flex-col desktop:gap-[48px] flex flex-row gap-[24px] pt-[24px]",children:[o("div",{className:"",children:[e(l,{style:{background:"var(--1, linear-gradient(90deg, #3AD1FF 0%, #008CD6 100%))",backgroundClip:"text",WebkitBackgroundClip:"text",WebkitTextFillColor:"transparent",color:"transparent"},html:t?.numberOne,className:"graphic-title desktop:text-base desktop:text-[64px] line-clamp-3 text-[40px] leading-none [&_*_strong]:!font-bold"}),e(l,{html:t?.textOne,className:"graphic-title lg-desktop:text-lg desktop:text-base desktop:text-[18px] line-clamp-3 text-[14px] leading-[1.4] [&_*_strong]:!font-bold"})]}),o("div",{children:[e(l,{style:{background:"var(--1, linear-gradient(90deg, #3AD1FF 0%, #008CD6 100%))",backgroundClip:"text",WebkitBackgroundClip:"text",WebkitTextFillColor:"transparent",color:"transparent"},html:t?.numberTwo,className:"graphic-title desktop:text-base desktop:text-[64px] line-clamp-3 text-[40px] leading-none [&_*_strong]:!font-bold"}),e(l,{html:t?.textTwo,className:"graphic-title lg-desktop:text-lg desktop:text-base desktop:text-[18px] line-clamp-3 text-[14px] leading-[1.4] [&_*_strong]:!font-bold"})]})]}),t?.icon?.url&&e("div",{className:"desktop:pt-[24px] lg-desktop:pt-[48px] pt-[24px]",children:e(s,{className:"desktop:w-[368px] lg-desktop:w-[488px] w-[358px]",source:t?.icon?.url,alt:t?.icon?.alt||""})})]}),e("div",{className:"md-tablet:hidden laptop:pt-[32px] desktop:pt-0 aspect-[964/560] overflow-hidden rounded-2xl pt-[24px]",children:e(s,{className:"size-full object-cover ",source:t?.img?.url,alt:t?.img?.alt||""})}),e("div",{className:"tablet:hidden mt-[24px] aspect-[358/360] overflow-hidden rounded-2xl",children:e(s,{className:"size-full object-cover",source:t?.mobileImg?.url,alt:t?.mobileImg?.alt||""})})]})},k=p=>{const{data:t,className:a}=p,{list:n}=t;return e(b,{children:o("div",{className:"",children:[t?.title&&e("div",{className:"desktop:w-[800px] pb-[24px]",children:e(l,{html:t?.title,className:" desktop:!text-[32px] lg-desktop:text-lg desktop:text-base line-clamp-3 !text-[24px] !leading-[1.2] [&_*_strong]:!font-bold"})}),t?.img?.url&&e(s,{className:"md-tablet:hidden aspect-[1664/560] rounded-2xl",imgClassName:"",source:t?.img?.url,alt:t?.img?.alt||""}),t?.mobileImg?.url&&e(s,{className:"tablet:hidden aspect-[358/360] rounded-2xl",imgClassName:"",source:t?.mobileImg?.url,alt:t?.mobileImg?.alt||""}),e("div",{className:"flex flex-col gap-4",children:n.map((r,i)=>e(u,{index:i,item:r},i))})]})})};var _=m(k);export{_ as default};
2
2
  //# sourceMappingURL=index.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/biz-components/Features/index.tsx"],
4
- "sourcesContent": ["'use client'\nimport { cn } from '../../helpers/utils.js'\nimport SwiperBox from '../SwiperBox/index.js'\nimport type { Img } from '../../types/props.js'\nimport { withLayout } from '../../shared/Styles.js'\nimport { Picture, Text } from '../../components/index.js'\nexport type FeaturesDataType = {\n img: Img\n mobileImg: Img\n title: string\n description: string\n numberOne: string\n textOne: string\n numberTwo: string\n textTwo: string\n icon: Img\n}\ntype FeaturesType = {\n data: {\n title: string\n img: Img\n mobileImg: Img\n list: FeaturesDataType[]\n }\n className?: string\n}\n\nconst Features = (props: FeaturesType) => {\n const { data, className } = props\n const { list } = data\n\n return (\n <>\n <div className=\"\">\n {data?.title && (\n <div className=\"desktop:w-[800px] pb-[24px]\">\n <Text\n html={data?.title}\n className=\" desktop:!text-[32px] lg-desktop:text-lg line-clamp-3 !text-[24px] !leading-[1.2] [&_*_strong]:!font-bold\"\n />\n </div>\n )}\n {data?.img?.url && (\n <Picture\n className=\"md-tablet:hidden aspect-[1664/560] rounded-2xl\"\n imgClassName=\"\"\n source={data?.img?.url}\n alt={data?.img?.alt || ''}\n />\n )}\n {data?.mobileImg?.url && (\n <Picture\n className=\"tablet:hidden aspect-[358/360] rounded-2xl\"\n imgClassName=\"\"\n source={data?.mobileImg?.url}\n alt={data?.mobileImg?.alt || ''}\n />\n )}\n <div className=\"\">\n <div className=\"flex flex-col gap-4\">\n {list.map((item, index) => (\n <div\n key={index}\n className={`desktop:flex tablet:gap-8 laptop:gap-[64px] gap-4 pt-[64px] ${index % 2 === 0 ? 'laptop:flex-row-reverse' : ''}`}\n >\n <div className=\"desktop:w-[500px] lg-desktop:w-[640px] flex shrink-0 flex-col justify-center\">\n <Text\n html={item?.title}\n className=\"graphic-title desktop:text-[32px] line-clamp-3 text-[24px] leading-[1.2] [&_*_strong]:!font-bold\"\n />\n <Text\n html={item?.description}\n className=\"graphic-title desktop:pt-[8px] lg-desktop:text-[18px] desktop:text-[16px] pt-[4px] text-[14px] leading-[1.2] [&_*_strong]:!font-bold\"\n />\n {/* \u6E10\u53D8\u8272 */}\n {item?.numberOne && (\n <div className=\"desktop:pt-[48px] desktop:flex-col desktop:gap-[48px] flex flex-row gap-[24px] pt-[24px]\">\n <div className=\"\">\n <Text\n style={{\n background: 'var(--1, linear-gradient(90deg, #3AD1FF 0%, #008CD6 100%))',\n backgroundClip: 'text',\n WebkitBackgroundClip: 'text',\n WebkitTextFillColor: 'transparent',\n color: 'transparent', // \u5EFA\u8BAE\u52A0\u4E0A\uFF0C\u517C\u5BB9\u90E8\u5206\u6D4F\u89C8\u5668\n }}\n html={item?.numberOne}\n className=\"graphic-title desktop:text-[64px] line-clamp-3 text-[40px] leading-none [&_*_strong]:!font-bold\"\n />\n <Text\n html={item?.textOne}\n className=\"graphic-title lg-desktop:text-lg desktop:text-[18px] line-clamp-3 text-[14px] leading-[1.4] [&_*_strong]:!font-bold\"\n />\n </div>\n <div>\n <Text\n style={{\n background: 'var(--1, linear-gradient(90deg, #3AD1FF 0%, #008CD6 100%))',\n backgroundClip: 'text',\n WebkitBackgroundClip: 'text',\n WebkitTextFillColor: 'transparent',\n color: 'transparent', // \u5EFA\u8BAE\u52A0\u4E0A\uFF0C\u517C\u5BB9\u90E8\u5206\u6D4F\u89C8\u5668\n }}\n html={item?.numberTwo}\n className=\"graphic-title desktop:text-[64px] line-clamp-3 text-[40px] leading-none [&_*_strong]:!font-bold\"\n />\n <Text\n html={item?.textTwo}\n className=\"graphic-title lg-desktop:text-lg desktop:text-[18px] line-clamp-3 text-[14px] leading-[1.4] [&_*_strong]:!font-bold\"\n />\n </div>\n </div>\n )}\n {item?.icon?.url && (\n <div className=\"desktop:pt-[24px] lg-desktop:pt-[48px] pt-[24px]\">\n <Picture\n className=\"desktop:w-[368px] lg-desktop:w-[488px] w-[358px]\"\n source={item?.icon?.url}\n alt={item?.icon?.alt || ''}\n />\n </div>\n )}\n </div>\n <div className=\"md-tablet:hidden laptop:pt-[32px] desktop:pt-0 aspect-[964/560] overflow-hidden rounded-2xl pt-[24px]\">\n <Picture className=\"size-full object-cover \" source={item?.img?.url} alt={item?.img?.alt || ''} />\n </div>\n <div className=\"tablet:hidden mt-[24px] aspect-[358/360] overflow-hidden rounded-2xl\">\n <Picture\n className=\"size-full object-cover\"\n source={item?.mobileImg?.url}\n alt={item?.mobileImg?.alt || ''}\n />\n </div>\n </div>\n ))}\n </div>\n </div>\n </div>\n </>\n )\n}\n\nexport default withLayout(Features)\n"],
5
- "mappings": "aAgCI,mBAAAA,EAIQ,OAAAC,EAyCU,QAAAC,MA7ClB,oBA/BJ,MAAmB,yBACnB,MAAsB,wBAEtB,OAAS,cAAAC,MAAkB,yBAC3B,OAAS,WAAAC,EAAS,QAAAC,MAAY,4BAsB9B,MAAMC,EAAYC,GAAwB,CACxC,KAAM,CAAE,KAAAC,EAAM,UAAAC,CAAU,EAAIF,EACtB,CAAE,KAAAG,CAAK,EAAIF,EAEjB,OACEP,EAAAD,EAAA,CACE,SAAAE,EAAC,OAAI,UAAU,GACZ,UAAAM,GAAM,OACLP,EAAC,OAAI,UAAU,8BACb,SAAAA,EAACI,EAAA,CACC,KAAMG,GAAM,MACZ,UAAU,4GACZ,EACF,EAEDA,GAAM,KAAK,KACVP,EAACG,EAAA,CACC,UAAU,iDACV,aAAa,GACb,OAAQI,GAAM,KAAK,IACnB,IAAKA,GAAM,KAAK,KAAO,GACzB,EAEDA,GAAM,WAAW,KAChBP,EAACG,EAAA,CACC,UAAU,6CACV,aAAa,GACb,OAAQI,GAAM,WAAW,IACzB,IAAKA,GAAM,WAAW,KAAO,GAC/B,EAEFP,EAAC,OAAI,UAAU,GACb,SAAAA,EAAC,OAAI,UAAU,sBACZ,SAAAS,E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
6
- "names": ["Fragment", "jsx", "jsxs", "withLayout", "Picture", "Text", "Features", "props", "data", "className", "list", "item", "index", "Features_default"]
4
+ "sourcesContent": ["/* eslint-disable tailwindcss/no-contradicting-classname */\n'use client'\nimport { cn } from '../../helpers/utils.js'\nimport SwiperBox from '../SwiperBox/index.js'\nimport { useExposure } from '../../hooks/useExposure.js'\nimport type { Img } from '../../types/props.js'\nimport { withLayout } from '../../shared/Styles.js'\nimport { Picture, Text } from '../../components/index.js'\nimport { useRef } from 'react'\n\nexport type FeaturesDataType = {\n img: Img\n mobileImg: Img\n title: string\n description: string\n numberOne: string\n textOne: string\n numberTwo: string\n textTwo: string\n icon: Img\n}\ntype FeaturesType = {\n data: {\n title: string\n img: Img\n mobileImg: Img\n list: FeaturesDataType[]\n }\n className?: string\n}\n\nconst componentType = 'image'\nconst componentName = 'features'\n\nconst Item = ({ index, item }: { index: number; item: FeaturesDataType }) => {\n const ref = useRef<HTMLDivElement>(null)\n\n useExposure(ref, {\n componentType: componentType,\n componentName: componentName,\n position: index + 1,\n componentTitle: item.title,\n componentDescription: item.description,\n })\n\n return (\n <div\n className={`desktop:flex tablet:gap-8 laptop:gap-[64px] gap-4 pt-[64px] ${index % 2 === 0 ? 'laptop:flex-row-reverse' : ''}`}\n ref={ref}\n >\n <div className=\"desktop:w-[500px] lg-desktop:w-[640px] flex shrink-0 flex-col justify-center\">\n <Text\n html={item?.title}\n className=\"graphic-title desktop:text-base desktop:text-[32px] line-clamp-3 text-[24px] leading-[1.2] [&_*_strong]:!font-bold\"\n />\n <Text\n html={item?.description}\n className=\"graphic-title desktop:pt-[8px] lg-desktop:text-lg desktop:text-base lg-desktop:text-[18px] desktop:text-[16px] pt-[4px] text-[14px] leading-[1.2] [&_*_strong]:!font-bold\"\n />\n {/* \u6E10\u53D8\u8272 */}\n {item?.numberOne && (\n <div className=\"desktop:pt-[48px] desktop:flex-col desktop:gap-[48px] flex flex-row gap-[24px] pt-[24px]\">\n <div className=\"\">\n <Text\n style={{\n background: 'var(--1, linear-gradient(90deg, #3AD1FF 0%, #008CD6 100%))',\n backgroundClip: 'text',\n WebkitBackgroundClip: 'text',\n WebkitTextFillColor: 'transparent',\n color: 'transparent', // \u5EFA\u8BAE\u52A0\u4E0A\uFF0C\u517C\u5BB9\u90E8\u5206\u6D4F\u89C8\u5668\n }}\n html={item?.numberOne}\n className=\"graphic-title desktop:text-base desktop:text-[64px] line-clamp-3 text-[40px] leading-none [&_*_strong]:!font-bold\"\n />\n <Text\n html={item?.textOne}\n className=\"graphic-title lg-desktop:text-lg desktop:text-base desktop:text-[18px] line-clamp-3 text-[14px] leading-[1.4] [&_*_strong]:!font-bold\"\n />\n </div>\n <div>\n <Text\n style={{\n background: 'var(--1, linear-gradient(90deg, #3AD1FF 0%, #008CD6 100%))',\n backgroundClip: 'text',\n WebkitBackgroundClip: 'text',\n WebkitTextFillColor: 'transparent',\n color: 'transparent', // \u5EFA\u8BAE\u52A0\u4E0A\uFF0C\u517C\u5BB9\u90E8\u5206\u6D4F\u89C8\u5668\n }}\n html={item?.numberTwo}\n className=\"graphic-title desktop:text-base desktop:text-[64px] line-clamp-3 text-[40px] leading-none [&_*_strong]:!font-bold\"\n />\n <Text\n html={item?.textTwo}\n className=\"graphic-title lg-desktop:text-lg desktop:text-base desktop:text-[18px] line-clamp-3 text-[14px] leading-[1.4] [&_*_strong]:!font-bold\"\n />\n </div>\n </div>\n )}\n {item?.icon?.url && (\n <div className=\"desktop:pt-[24px] lg-desktop:pt-[48px] pt-[24px]\">\n <Picture\n className=\"desktop:w-[368px] lg-desktop:w-[488px] w-[358px]\"\n source={item?.icon?.url}\n alt={item?.icon?.alt || ''}\n />\n </div>\n )}\n </div>\n <div className=\"md-tablet:hidden laptop:pt-[32px] desktop:pt-0 aspect-[964/560] overflow-hidden rounded-2xl pt-[24px]\">\n <Picture className=\"size-full object-cover \" source={item?.img?.url} alt={item?.img?.alt || ''} />\n </div>\n <div className=\"tablet:hidden mt-[24px] aspect-[358/360] overflow-hidden rounded-2xl\">\n <Picture className=\"size-full object-cover\" source={item?.mobileImg?.url} alt={item?.mobileImg?.alt || ''} />\n </div>\n </div>\n )\n}\n\nconst Features = (props: FeaturesType) => {\n const { data, className } = props\n const { list } = data\n\n return (\n <>\n <div className=\"\">\n {data?.title && (\n <div className=\"desktop:w-[800px] pb-[24px]\">\n <Text\n html={data?.title}\n className=\" desktop:!text-[32px] lg-desktop:text-lg desktop:text-base line-clamp-3 !text-[24px] !leading-[1.2] [&_*_strong]:!font-bold\"\n />\n </div>\n )}\n {data?.img?.url && (\n <Picture\n className=\"md-tablet:hidden aspect-[1664/560] rounded-2xl\"\n imgClassName=\"\"\n source={data?.img?.url}\n alt={data?.img?.alt || ''}\n />\n )}\n {data?.mobileImg?.url && (\n <Picture\n className=\"tablet:hidden aspect-[358/360] rounded-2xl\"\n imgClassName=\"\"\n source={data?.mobileImg?.url}\n alt={data?.mobileImg?.alt || ''}\n />\n )}\n <div className=\"flex flex-col gap-4\">\n {list.map((item, index) => (\n <Item key={index} index={index} item={item} />\n ))}\n </div>\n </div>\n </>\n )\n}\n\nexport default withLayout(Features)\n"],
5
+ "mappings": "aAmDQ,OAwEJ,YAAAA,EAxEI,OAAAC,EAWI,QAAAC,MAXJ,oBAjDR,MAAmB,yBACnB,MAAsB,wBACtB,OAAS,eAAAC,MAAmB,6BAE5B,OAAS,cAAAC,MAAkB,yBAC3B,OAAS,WAAAC,EAAS,QAAAC,MAAY,4BAC9B,OAAS,UAAAC,MAAc,QAuBvB,MAAMC,EAAgB,QAChBC,EAAgB,WAEhBC,EAAO,CAAC,CAAE,MAAAC,EAAO,KAAAC,CAAK,IAAiD,CAC3E,MAAMC,EAAMN,EAAuB,IAAI,EAEvC,OAAAJ,EAAYU,EAAK,CACf,cAAeL,EACf,cAAeC,EACf,SAAUE,EAAQ,EAClB,eAAgBC,EAAK,MACrB,qBAAsBA,EAAK,WAC7B,CAAC,EAGCV,EAAC,OACC,UAAW,+DAA+DS,EAAQ,IA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EAAAD,EAAA,CACE,SAAAE,EAAC,OAAI,UAAU,GACZ,UAAAc,GAAM,OACLf,EAAC,OAAI,UAAU,8BACb,SAAAA,EAACK,EAAA,CACC,KAAMU,GAAM,MACZ,UAAU,8HACZ,EACF,EAEDA,GAAM,KAAK,KACVf,EAACI,EAAA,CACC,UAAU,iDACV,aAAa,GACb,OAAQW,GAAM,KAAK,IACnB,IAAKA,GAAM,KAAK,KAAO,GACzB,EAEDA,GAAM,WAAW,KAChBf,EAACI,EAAA,CACC,UAAU,6CACV,aAAa,GACb,OAAQW,GAAM,WAAW,IACzB,IAAKA,GAAM,WAAW,KAAO,GAC/B,EAEFf,EAAC,OAAI,UAAU,sBACZ,SAAAiB,EAAK,IAAI,CAACN,EAAMD,IACfV,EAACS,EAAA,CAAiB,MAAOC,EAAO,KAAMC,GAA3BD,CAAiC,CAC7C,EACH,GACF,EACF,CAEJ,EAEA,IAAOQ,EAAQf,EAAWU,CAAQ",
6
+ "names": ["Fragment", "jsx", "jsxs", "useExposure", "withLayout", "Picture", "Text", "useRef", "componentType", "componentName", "Item", "index", "item", "ref", "Features", "props", "data", "className", "list", "Features_default"]
7
7
  }
@@ -1,2 +1,2 @@
1
- "use client";import{jsx as l,jsxs as a}from"react/jsx-runtime";import"../../helpers/utils.js";import"../SwiperBox/index.js";import{withLayout as m}from"../../shared/Styles.js";import{Picture as e,Text as r}from"../../components/index.js";const d=o=>{const{data:s,className:g}=o,{list:i}=s;return l("div",{className:"w-full rounded-2xl bg-[#EAEAEC]",children:l("div",{className:"laptop:gap-4 tablet:grid-cols-4 laptop:grid-cols-3 desktop:grid-cols-5 lg-desktop:grid-cols-6 grid grid-cols-2 gap-3",children:i.map((t,p)=>a("div",{className:"laptop:p-[20px] flex flex-col items-center justify-center p-[12px]",children:[a("div",{children:[t?.img?.url&&l(e,{className:"l-tablet:hidden aspect-[194/194]",imgClassName:"",source:t?.img?.url,alt:t?.img?.alt||""}),t?.mobileImg?.url&&l(e,{className:"laptop:hidden aspect-[120/120]",imgClassName:"",source:t?.mobileImg?.url,alt:t?.mobileImg?.alt||""})]}),l(r,{html:t?.title,className:"laptop:text-[18px] text-[14px] font-bold leading-[1.4]"})]},p))})})};var N=m(d);export{N as default};
1
+ "use client";import{jsx as e,jsxs as a}from"react/jsx-runtime";import"../../helpers/utils.js";import"../SwiperBox/index.js";import{withLayout as r}from"../../shared/Styles.js";import{Picture as p,Text as c}from"../../components/index.js";import{useExposure as n}from"../../hooks/useExposure.js";import{useRef as g}from"react";const d="image",f="gift_box",x=({index:o,item:t})=>{const l=g(null);return n(l,{componentType:d,componentName:f,position:o+1,componentTitle:t.title}),a("div",{className:"laptop:p-[20px] flex flex-col items-center justify-center p-[12px]",children:[a("div",{children:[t?.img?.url&&e(p,{className:"l-tablet:hidden aspect-[194/194]",imgClassName:"",source:t?.img?.url,alt:t?.img?.alt||""}),t?.mobileImg?.url&&e(p,{className:"laptop:hidden aspect-[120/120]",imgClassName:"",source:t?.mobileImg?.url,alt:t?.mobileImg?.alt||""})]}),e(c,{html:t?.title,className:"laptop:text-[18px] text-[14px] font-bold leading-[1.4]"})]},o)},u=o=>{const{data:t,className:l}=o,{list:s}=t;return e("div",{className:"w-full rounded-2xl bg-[#EAEAEC]",children:e("div",{className:"laptop:gap-4 tablet:grid-cols-4 laptop:grid-cols-3 desktop:grid-cols-5 lg-desktop:grid-cols-6 grid grid-cols-2 gap-3",children:s.map((m,i)=>e(x,{index:i,item:m},i))})})};var E=r(u);export{E as default};
2
2
  //# sourceMappingURL=index.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/biz-components/GiftBox/index.tsx"],
4
- "sourcesContent": ["'use client'\nimport { cn } from '../../helpers/utils.js'\nimport SwiperBox from '../SwiperBox/index.js'\nimport type { Img } from '../../types/props.js'\nimport { withLayout } from '../../shared/Styles.js'\nimport { Picture, Text } from '../../components/index.js'\n\nexport type GiftBoxDataType = {\n img: Img\n mobileImg: Img\n title: string\n}\n\ntype GiftBoxType = {\n data: {\n list: GiftBoxDataType[]\n }\n className?: string\n}\n\nconst GiftBox = (props: GiftBoxType) => {\n const { data, className } = props\n const { list } = data\n\n return (\n <div className=\"w-full rounded-2xl bg-[#EAEAEC]\">\n <div className=\"laptop:gap-4 tablet:grid-cols-4 laptop:grid-cols-3 desktop:grid-cols-5 lg-desktop:grid-cols-6 grid grid-cols-2 gap-3\">\n {list.map((item, index) => (\n <div key={index} className=\"laptop:p-[20px] flex flex-col items-center justify-center p-[12px]\">\n <div>\n {item?.img?.url && (\n <Picture\n className=\"l-tablet:hidden aspect-[194/194]\"\n imgClassName=\"\"\n source={item?.img?.url}\n alt={item?.img?.alt || ''}\n />\n )}\n {item?.mobileImg?.url && (\n <Picture\n className=\"laptop:hidden aspect-[120/120]\"\n imgClassName=\"\"\n source={item?.mobileImg?.url}\n alt={item?.mobileImg?.alt || ''}\n />\n )}\n </div>\n <Text html={item?.title} className=\"laptop:text-[18px] text-[14px] font-bold leading-[1.4]\" />\n </div>\n ))}\n </div>\n </div>\n )\n}\n\nexport default withLayout(GiftBox)\n"],
5
- "mappings": "aA6BY,OAEI,OAAAA,EAFJ,QAAAC,MAAA,oBA5BZ,MAAmB,yBACnB,MAAsB,wBAEtB,OAAS,cAAAC,MAAkB,yBAC3B,OAAS,WAAAC,EAAS,QAAAC,MAAY,4BAe9B,MAAMC,EAAWC,GAAuB,CACtC,KAAM,CAAE,KAAAC,EAAM,UAAAC,CAAU,EAAIF,EACtB,CAAE,KAAAG,CAAK,EAAIF,EAEjB,OACEP,EAAC,OAAI,UAAU,kCACb,SAAAA,EAAC,OAAI,UAAU,uHACZ,SAAAS,EAAK,IAAI,CAACC,EAAMC,IACfV,EAAC,OAAgB,UAAU,qEACzB,UAAAA,EAAC,OACE,UAAAS,GAAM,KAAK,KACVV,EAACG,EAAA,CACC,UAAU,mCACV,aAAa,GACb,OAAQO,GAAM,KAAK,IACnB,IAAKA,GAAM,KAAK,KAAO,GACzB,EAEDA,GAAM,WAAW,KAChBV,EAACG,EAAA,CACC,UAAU,iCACV,aAAa,GACb,OAAQO,GAAM,WAAW,IACzB,IAAKA,GAAM,WAAW,KAAO,GAC/B,GAEJ,EACAV,EAACI,EAAA,CAAK,KAAMM,GAAM,MAAO,UAAU,yDAAyD,IAnBpFC,CAoBV,CACD,EACH,EACF,CAEJ,EAEA,IAAOC,EAAQV,EAAWG,CAAO",
6
- "names": ["jsx", "jsxs", "withLayout", "Picture", "Text", "GiftBox", "props", "data", "className", "list", "item", "index", "GiftBox_default"]
4
+ "sourcesContent": ["'use client'\nimport { cn } from '../../helpers/utils.js'\nimport SwiperBox from '../SwiperBox/index.js'\nimport type { Img } from '../../types/props.js'\nimport { withLayout } from '../../shared/Styles.js'\nimport { Picture, Text } from '../../components/index.js'\nimport { useExposure } from '../../hooks/useExposure.js'\nimport { useRef } from 'react'\n\nexport type GiftBoxDataType = {\n img: Img\n mobileImg: Img\n title: string\n}\n\ntype GiftBoxType = {\n data: {\n list: GiftBoxDataType[]\n }\n className?: string\n}\n\nconst componentType = 'image'\nconst componentName = 'gift_box'\n\nconst Item = ({ index, item }: { index: number; item: GiftBoxDataType }) => {\n const ref = useRef<HTMLDivElement>(null)\n\n useExposure(ref, {\n componentType: componentType,\n componentName: componentName,\n position: index + 1,\n componentTitle: item.title,\n })\n return (\n <div key={index} className=\"laptop:p-[20px] flex flex-col items-center justify-center p-[12px]\">\n <div>\n {item?.img?.url && (\n <Picture\n className=\"l-tablet:hidden aspect-[194/194]\"\n imgClassName=\"\"\n source={item?.img?.url}\n alt={item?.img?.alt || ''}\n />\n )}\n {item?.mobileImg?.url && (\n <Picture\n className=\"laptop:hidden aspect-[120/120]\"\n imgClassName=\"\"\n source={item?.mobileImg?.url}\n alt={item?.mobileImg?.alt || ''}\n />\n )}\n </div>\n <Text html={item?.title} className=\"laptop:text-[18px] text-[14px] font-bold leading-[1.4]\" />\n </div>\n )\n}\n\nconst GiftBox = (props: GiftBoxType) => {\n const { data, className } = props\n const { list } = data\n\n return (\n <div className=\"w-full rounded-2xl bg-[#EAEAEC]\">\n <div className=\"laptop:gap-4 tablet:grid-cols-4 laptop:grid-cols-3 desktop:grid-cols-5 lg-desktop:grid-cols-6 grid grid-cols-2 gap-3\">\n {list.map((item, index) => (\n <Item key={index} index={index} item={item} />\n ))}\n </div>\n </div>\n )\n}\n\nexport default withLayout(GiftBox)\n"],
5
+ "mappings": "aAoCM,OAEI,OAAAA,EAFJ,QAAAC,MAAA,oBAnCN,MAAmB,yBACnB,MAAsB,wBAEtB,OAAS,cAAAC,MAAkB,yBAC3B,OAAS,WAAAC,EAAS,QAAAC,MAAY,4BAC9B,OAAS,eAAAC,MAAmB,6BAC5B,OAAS,UAAAC,MAAc,QAevB,MAAMC,EAAgB,QAChBC,EAAgB,WAEhBC,EAAO,CAAC,CAAE,MAAAC,EAAO,KAAAC,CAAK,IAAgD,CAC1E,MAAMC,EAAMN,EAAuB,IAAI,EAEvC,OAAAD,EAAYO,EAAK,CACf,cAAeL,EACf,cAAeC,EACf,SAAUE,EAAQ,EAClB,eAAgBC,EAAK,KACvB,CAAC,EAECV,EAAC,OAAgB,UAAU,qEACzB,UAAAA,EAAC,OACE,UAAAU,GAAM,KAAK,KACVX,EAACG,EAAA,CACC,UAAU,mCACV,aAAa,GACb,OAAQQ,GAAM,KAAK,IACnB,IAAKA,GAAM,KAAK,KAAO,GACzB,EAEDA,GAAM,WAAW,KAChBX,EAACG,EAAA,CACC,UAAU,iCACV,aAAa,GACb,OAAQQ,GAAM,WAAW,IACzB,IAAKA,GAAM,WAAW,KAAO,GAC/B,GAEJ,EACAX,EAACI,EAAA,CAAK,KAAMO,GAAM,MAAO,UAAU,yDAAyD,IAnBpFD,CAoBV,CAEJ,EAEMG,EAAWC,GAAuB,CACtC,KAAM,CAAE,KAAAC,EAAM,UAAAC,CAAU,EAAIF,EACtB,CAAE,KAAAG,CAAK,EAAIF,EAEjB,OACEf,EAAC,OAAI,UAAU,kCACb,SAAAA,EAAC,OAAI,UAAU,uHACZ,SAAAiB,EAAK,IAAI,CAACN,EAAMD,IACfV,EAACS,EAAA,CAAiB,MAAOC,EAAO,KAAMC,GAA3BD,CAAiC,CAC7C,EACH,EACF,CAEJ,EAEA,IAAOQ,EAAQhB,EAAWW,CAAO",
6
+ "names": ["jsx", "jsxs", "withLayout", "Picture", "Text", "useExposure", "useRef", "componentType", "componentName", "Item", "index", "item", "ref", "GiftBox", "props", "data", "className", "list", "GiftBox_default"]
7
7
  }
@@ -1,2 +1,2 @@
1
- "use client";import{Fragment as g,jsx as t,jsxs as l}from"react/jsx-runtime";import{cn as o}from"../../helpers/utils.js";import"../SwiperBox/index.js";import{withLayout as c}from"../../shared/Styles.js";import{Grid as x,GridItem as f}from"../../components/gird.js";import{Picture as i,Text as a}from"../../components/index.js";const u=p=>{const{data:m,className:n}=p,{productsTab:d,shape:s}=m;return l(g,{children:[t("div",{className:o("creativeModuleBlock","tablet:block box-border hidden w-full overflow-hidden text-[#1D1D1F]"),children:t(x,{className:o("tablet:gap-4 grid grid-cols-12 gap-3 ",n),children:d?.map((e,r)=>l(f,{span:e.span,className:o("text-info-primary relative w-full overflow-hidden",s==="rounded"?"rounded-2xl":"rounded-none","",{"aiui-dark":e.theme==="dark"}),children:[t(i,{source:e.img.url,className:"size-full",imgClassName:""}),l("div",{className:"footBottom lg-desktop:top-8 lg-desktop:px-8 desktop:top-6 desktop:px-6 absolute inset-x-0 top-4 flex flex-col gap-[6px] overflow-hidden px-4",children:[e.title&&t(a,{html:e.title,as:"p",className:"lg-desktop:text-[24px] line-clamp-2 text-[20px] font-bold leading-[1.2]"}),e.description&&t(a,{html:e.description,className:"desktop:text-lg line-clamp-2 text-sm font-bold"})]})]},r))})}),t("div",{className:"tablet:hidden block text-[#1D1D1F]",children:t("div",{className:" flex flex-wrap gap-[12px]",children:d?.map((e,r)=>l("div",{className:o("text-info-primary relative overflow-hidden",s==="rounded"?"rounded-xl":"rounded-none",{"aiui-dark":e.theme==="dark"},e?.fullWidth==="true"?"w-full flex-none":" w-[calc(50%-6px)]"),children:[t(i,{source:e.mobileImg.url,className:"size-full",imgClassName:"h-full object-cover"}),l("div",{className:"footBottomMob absolute inset-x-0 top-4 flex flex-col gap-[6px] overflow-hidden px-4",children:[e.title&&t(a,{html:e.title,as:"p",className:"line-clamp-3 text-xl font-bold leading-[1.2]"}),e.description&&t(a,{html:e.description,className:"line-clamp-2 text-xl font-bold"})]})]},r))})})]})};var w=c(u);export{w as default};
1
+ "use client";import{Fragment as g,jsx as t,jsxs as l}from"react/jsx-runtime";import{cn as o}from"../../helpers/utils.js";import"../SwiperBox/index.js";import{withLayout as c}from"../../shared/Styles.js";import{Grid as x,GridItem as f}from"../../components/gird.js";import{Picture as i,Text as a}from"../../components/index.js";const u=p=>{const{data:m,className:n}=p,{productsTab:d,shape:s}=m;return l(g,{children:[t("div",{className:o("creativeModuleBlock","tablet:block box-border hidden w-full overflow-hidden text-[#1D1D1F]"),children:t(x,{className:o("tablet:gap-4 grid grid-cols-12 gap-3 ",n),children:d?.map((e,r)=>l(f,{span:e.span,className:o("text-info-primary relative w-full overflow-hidden",s==="rounded"?"rounded-2xl":"rounded-none","",{"aiui-dark":e?.theme==="dark"}),children:[t(i,{source:e?.img?.url,className:"size-full",imgClassName:""}),l("div",{className:"footBottom lg-desktop:top-8 lg-desktop:px-8 desktop:top-6 desktop:px-6 absolute inset-x-0 top-4 flex flex-col gap-[6px] overflow-hidden px-4",children:[e?.title&&t(a,{html:e?.title,as:"p",className:"lg-desktop:text-[24px] line-clamp-2 text-[20px] font-bold leading-[1.2]"}),e?.description&&t(a,{html:e?.description,className:"desktop:text-lg line-clamp-2 text-sm font-bold"})]})]},r))})}),t("div",{className:"tablet:hidden block text-[#1D1D1F]",children:t("div",{className:" flex flex-wrap gap-[12px]",children:d?.map((e,r)=>l("div",{className:o("text-info-primary relative overflow-hidden",s==="rounded"?"rounded-xl":"rounded-none",{"aiui-dark":e?.theme==="dark"},e?.fullWidth==="true"?"w-full flex-none":" w-[calc(50%-6px)]"),children:[t(i,{source:e?.mobileImg?.url,className:"size-full",imgClassName:"h-full object-cover"}),l("div",{className:"footBottomMob absolute inset-x-0 top-4 flex flex-col gap-[6px] overflow-hidden px-4",children:[e?.title&&t(a,{html:e?.title,as:"p",className:"line-clamp-3 text-xl font-bold leading-[1.2]"}),e?.description&&t(a,{html:e?.description,className:"line-clamp-2 text-xl font-bold"})]})]},r))})})]})};var w=c(u);export{w as default};
2
2
  //# sourceMappingURL=index.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/biz-components/GraphicMore/index.tsx"],
4
- "sourcesContent": ["'use client'\nimport { cn } from '../../helpers/utils.js'\nimport SwiperBox from '../SwiperBox/index.js'\nimport type { Img } from '../../types/props.js'\nimport { withLayout } from '../../shared/Styles.js'\nimport { Grid, GridItem } from '../../components/gird.js'\nimport { Picture, Text } from '../../components/index.js'\nexport type GraphicMoreDataType = {\n img: Img\n mobileImg: Img\n title: string\n description: string\n theme: 'light' | 'dark'\n fullWidth: 'true' | 'false'\n span: 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12\n}\ntype GraphicMoreType = {\n data: {\n shape?: 'rounded' | 'square'\n productsTab: GraphicMoreDataType[]\n }\n className?: string\n}\n\nconst GraphicMore = (props: GraphicMoreType) => {\n const { data, className } = props\n const { productsTab, shape } = data\n\n return (\n <>\n <div\n className={cn('creativeModuleBlock', 'tablet:block box-border hidden w-full overflow-hidden text-[#1D1D1F]')}\n >\n <Grid className={cn('tablet:gap-4 grid grid-cols-12 gap-3 ', className)}>\n {productsTab?.map((item, index) => {\n return (\n <GridItem\n key={index}\n span={item.span}\n className={cn(\n 'text-info-primary relative w-full overflow-hidden',\n shape === 'rounded' ? 'rounded-2xl' : 'rounded-none',\n '',\n {\n 'aiui-dark': item.theme === 'dark',\n }\n )}\n >\n <Picture source={item.img.url} className=\"size-full\" imgClassName=\"\" />\n <div className=\"footBottom lg-desktop:top-8 lg-desktop:px-8 desktop:top-6 desktop:px-6 absolute inset-x-0 top-4 flex flex-col gap-[6px] overflow-hidden px-4\">\n {item.title && (\n <Text\n html={item.title}\n as=\"p\"\n className=\"lg-desktop:text-[24px] line-clamp-2 text-[20px] font-bold leading-[1.2]\"\n />\n )}\n {item.description && (\n <Text html={item.description} className=\"desktop:text-lg line-clamp-2 text-sm font-bold\" />\n )}\n </div>\n </GridItem>\n )\n })}\n </Grid>\n </div>\n <div className=\"tablet:hidden block text-[#1D1D1F]\">\n <div className=\" flex flex-wrap gap-[12px]\">\n {productsTab?.map((it, ind) => {\n return (\n <div\n key={ind}\n className={cn(\n 'text-info-primary relative overflow-hidden',\n shape === 'rounded' ? 'rounded-xl' : 'rounded-none',\n { 'aiui-dark': it.theme === 'dark' },\n it?.fullWidth === 'true'\n ? 'w-full flex-none' // \u5360\u6EE1\u6574\u884C\n : ' w-[calc(50%-6px)]' // \u666E\u901A\u5143\u7D20\n )}\n >\n <Picture source={it.mobileImg.url} className=\"size-full\" imgClassName=\"h-full object-cover\" />\n <div className=\"footBottomMob absolute inset-x-0 top-4 flex flex-col gap-[6px] overflow-hidden px-4\">\n {it.title && <Text html={it.title} as=\"p\" className=\"line-clamp-3 text-xl font-bold leading-[1.2]\" />}\n {it.description && <Text html={it.description} className=\"line-clamp-2 text-xl font-bold\" />}\n </div>\n </div>\n )\n })}\n </div>\n </div>\n </>\n )\n}\n\nexport default withLayout(GraphicMore)\n"],
5
- "mappings": "aA6BI,mBAAAA,EAmBY,OAAAC,EACA,QAAAC,MApBZ,oBA5BJ,OAAS,MAAAC,MAAU,yBACnB,MAAsB,wBAEtB,OAAS,cAAAC,MAAkB,yBAC3B,OAAS,QAAAC,EAAM,YAAAC,MAAgB,2BAC/B,OAAS,WAAAC,EAAS,QAAAC,MAAY,4BAkB9B,MAAMC,EAAeC,GAA2B,CAC9C,KAAM,CAAE,KAAAC,EAAM,UAAAC,CAAU,EAAIF,EACt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,CAAW",
4
+ "sourcesContent": ["'use client'\nimport { cn } from '../../helpers/utils.js'\nimport SwiperBox from '../SwiperBox/index.js'\nimport type { Img } from '../../types/props.js'\nimport { withLayout } from '../../shared/Styles.js'\nimport { Grid, GridItem } from '../../components/gird.js'\nimport { Picture, Text } from '../../components/index.js'\nexport type GraphicMoreDataType = {\n img: Img\n mobileImg: Img\n title: string\n description: string\n theme: 'light' | 'dark'\n fullWidth: 'true' | 'false'\n span: 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12\n}\ntype GraphicMoreType = {\n data: {\n shape?: 'rounded' | 'square'\n productsTab: GraphicMoreDataType[]\n }\n className?: string\n}\n\nconst GraphicMore = (props: GraphicMoreType) => {\n const { data, className } = props\n const { productsTab, shape } = data\n\n return (\n <>\n <div\n className={cn('creativeModuleBlock', 'tablet:block box-border hidden w-full overflow-hidden text-[#1D1D1F]')}\n >\n <Grid className={cn('tablet:gap-4 grid grid-cols-12 gap-3 ', className)}>\n {productsTab?.map((item, index) => {\n return (\n <GridItem\n key={index}\n span={item.span}\n className={cn(\n 'text-info-primary relative w-full overflow-hidden',\n shape === 'rounded' ? 'rounded-2xl' : 'rounded-none',\n '',\n {\n 'aiui-dark': item?.theme === 'dark',\n }\n )}\n >\n <Picture source={item?.img?.url} className=\"size-full\" imgClassName=\"\" />\n <div className=\"footBottom lg-desktop:top-8 lg-desktop:px-8 desktop:top-6 desktop:px-6 absolute inset-x-0 top-4 flex flex-col gap-[6px] overflow-hidden px-4\">\n {item?.title && (\n <Text\n html={item?.title}\n as=\"p\"\n className=\"lg-desktop:text-[24px] line-clamp-2 text-[20px] font-bold leading-[1.2]\"\n />\n )}\n {item?.description && (\n <Text html={item?.description} className=\"desktop:text-lg line-clamp-2 text-sm font-bold\" />\n )}\n </div>\n </GridItem>\n )\n })}\n </Grid>\n </div>\n <div className=\"tablet:hidden block text-[#1D1D1F]\">\n <div className=\" flex flex-wrap gap-[12px]\">\n {productsTab?.map((it, ind) => {\n return (\n <div\n key={ind}\n className={cn(\n 'text-info-primary relative overflow-hidden',\n shape === 'rounded' ? 'rounded-xl' : 'rounded-none',\n { 'aiui-dark': it?.theme === 'dark' },\n it?.fullWidth === 'true'\n ? 'w-full flex-none' // \u5360\u6EE1\u6574\u884C\n : ' w-[calc(50%-6px)]' // \u666E\u901A\u5143\u7D20\n )}\n >\n <Picture source={it?.mobileImg?.url} className=\"size-full\" imgClassName=\"h-full object-cover\" />\n <div className=\"footBottomMob absolute inset-x-0 top-4 flex flex-col gap-[6px] overflow-hidden px-4\">\n {it?.title && (\n <Text html={it?.title} as=\"p\" className=\"line-clamp-3 text-xl font-bold leading-[1.2]\" />\n )}\n {it?.description && <Text html={it?.description} className=\"line-clamp-2 text-xl font-bold\" />}\n </div>\n </div>\n )\n })}\n </div>\n </div>\n </>\n )\n}\n\nexport default withLayout(GraphicMore)\n"],
5
+ "mappings": "aA6BI,mBAAAA,EAmBY,OAAAC,EACA,QAAAC,MApBZ,oBA5BJ,OAAS,MAAAC,MAAU,yBACnB,MAAsB,wBAEtB,OAAS,cAAAC,MAAkB,yBAC3B,OAAS,QAAAC,EAAM,YAAAC,MAAgB,2BAC/B,OAAS,WAAAC,EAAS,QAAAC,MAAY,4BAkB9B,MAAMC,EAAeC,GAA2B,CAC9C,KAAM,CAAE,KAAAC,EAAM,UAAAC,CAAU,EAAIF,EACtB,CAAE,YAAAG,EAAa,MAAAC,CAAM,EAAIH,EAE/B,OACET,EAAAF,EAAA,CACE,UAAAC,EAAC,OACC,UAAWE,EAAG,sBAAuB,sEAAsE,EAE3G,SAAAF,EAACI,EAAA,CAAK,UAAWF,EAAG,wCAAyCS,CAAS,EACnE,SAAAC,GAAa,IAAI,CAACE,EAAMC,IAErBd,EAACI,EAAA,CAEC,KAAMS,EAAK,KACX,UAAWZ,EACT,oDACAW,IAAU,UAAY,cAAgB,eACtC,GACA,CACE,YAAaC,GAAM,QAAU,MAC/B,CACF,EAEA,UAAAd,EAACM,EAAA,CAAQ,OAAQQ,GAAM,KAAK,IAAK,UAAU,YAAY,aAAa,GAAG,EACvEb,EAAC,OAAI,UAAU,+IACZ,UAAAa,GAAM,OACLd,EAACO,EAAA,CACC,KAAMO,GAAM,MACZ,GAAG,IACH,UAAU,0EACZ,EAEDA,GAAM,aACLd,EAACO,EAAA,CAAK,KAAMO,GAAM,YAAa,UAAU,iDAAiD,GAE9F,IAvBKC,CAwBP,CAEH,EACH,EACF,EACAf,EAAC,OAAI,UAAU,qCACb,SAAAA,EAAC,OAAI,UAAU,6BACZ,SAAAY,GAAa,IAAI,CAACI,EAAIC,IAEnBhB,EAAC,OAEC,UAAWC,EACT,6CACAW,IAAU,UAAY,aAAe,eACrC,CAAE,YAAaG,GAAI,QAAU,MAAO,EACpCA,GAAI,YAAc,OACd,mBACA,oBACN,EAEA,UAAAhB,EAACM,EAAA,CAAQ,OAAQU,GAAI,WAAW,IAAK,UAAU,YAAY,aAAa,sBAAsB,EAC9Ff,EAAC,OAAI,UAAU,sFACZ,UAAAe,GAAI,OACHhB,EAACO,EAAA,CAAK,KAAMS,GAAI,MAAO,GAAG,IAAI,UAAU,+CAA+C,EAExFA,GAAI,aAAehB,EAACO,EAAA,CAAK,KAAMS,GAAI,YAAa,UAAU,iCAAiC,GAC9F,IAhBKC,CAiBP,CAEH,EACH,EACF,GACF,CAEJ,EAEA,IAAOC,EAAQf,EAAWK,CAAW",
6
6
  "names": ["Fragment", "jsx", "jsxs", "cn", "withLayout", "Grid", "GridItem", "Picture", "Text", "GraphicMore", "props", "data", "className", "productsTab", "shape", "item", "index", "it", "ind", "GraphicMore_default"]
7
7
  }
@@ -1,6 +1,6 @@
1
- import{jsx as e,jsxs as r}from"react/jsx-runtime";import{Text as f,Picture as y,Button as w,Dialog as N,DialogContent as C,DialogTrigger as T}from"../../../../../../components/index.js";import{Content as x,List as E,Root as D,Trigger as H}from"@radix-ui/react-tabs";import{useCallback as h,useEffect as P,useMemo as I,useRef as k,useState as m}from"react";import{cn as L}from"../../../../../../helpers/index.js";import{useBizProductContext as _}from"../../../../BizProductProvider.js";import{withLayout as A}from"../../../../../../shared/Styles.js";import{gaTrack as R}from"../../../../../../shared/track.js";const z=()=>{const{product:l,variant:a}=_(),[u,c]=m(!1),o=I(()=>l?.payload?.components?.find(t=>t.componentKey==="ProductHighlight")?.data||{},[l?.payload]),[n,d]=m(o?.ksp?.[0]),i=h(t=>{R({event:"ga4Event",event_name:"lp_button",event_parameters:{page_group:`Product Detail Page${a.sku}`,position:o?.title||"",button_name:t||o?.view||""}})},[o?.title,o?.view,a.sku]);return r("div",{className:"ipc-product-detail-highlight",children:[r("div",{className:"flex items-center justify-between",children:[o?.title&&e(f,{size:3,className:"font-bold leading-[1.2]",html:o?.title}),r(N,{open:u,onOpenChange:c,children:[e(T,{asChild:!0,children:e(w,{variant:"link",className:"!p-0 text-base font-bold",onClick:()=>i(),children:o?.view})}),e(B,{ksp:o?.ksp||[],clickActiveKspItem:n,gaTrackEvent:i})]})]}),e("div",{className:"lg-desktop:mt-4 mt-3 flex flex-wrap gap-4",children:o?.ksp?.map(t=>e("div",{className:"product-highlight-item lg-desktop:h-[38px] lg-desktop:leading-[38px] h-[36px] cursor-pointer rounded-full bg-[#F5F5F7] px-4 leading-[36px] hover:bg-[#EAEAEC]",children:e(f,{size:3,onClick:()=>{d(t),c(!0),i(t?.title)},className:"lg-desktop:text-[16px] line-clamp-1 overflow-hidden break-all text-[14px] font-bold text-[#1D1D1F]",html:t?.title})},t?.title))})]})},B=({ksp:l,clickActiveKspItem:a,gaTrackEvent:u})=>{const c=k([]),o=k(null),[n,d]=m(null),i=h(t=>{const s=l.findIndex(g=>g.title===t?.title),p=c.current[s];if(p&&o.current){const g=o.current,v=p,b=v.offsetLeft-g.offsetWidth/2+v.offsetWidth/2;g.scrollTo({left:b,behavior:"smooth"})}},[a,l]);return P(()=>{a&&(d(a),setTimeout(()=>{i(n)},100))},[a,i]),r(C,{className:"tablet:max-w-[896px] tablet:rounded-2xl [&_.dialog-close-icon]:laptop:size-6 mx-auto w-full max-w-[326px] overflow-hidden rounded-xl border-none p-0 [&_.dialog-close-icon]:size-4",children:[e("style",{children:`
1
+ import{jsx as e,jsxs as s}from"react/jsx-runtime";import{Text as u,Picture as b,Button as w,Dialog as y,DialogContent as N,DialogTrigger as C}from"../../../../../../components/index.js";import{Content as m,List as T,Root as D,Trigger as E}from"@radix-ui/react-tabs";import{useCallback as v,useEffect as A,useMemo as L,useRef as x,useState as h}from"react";import{cn as P}from"../../../../../../helpers/index.js";import{useBizProductContext as _}from"../../../../BizProductProvider.js";import{withLayout as H}from"../../../../../../shared/Styles.js";import{gaTrack as I}from"../../../../../../shared/track.js";const R=()=>{const{product:a,variant:i}=_(),[g,d]=h(!1),l=L(()=>a?.payload?.components?.find(o=>o.componentKey==="ProductHighlight")?.data||{},[a?.payload]),[r,n]=h(l?.ksp?.[0]),t=v(o=>{I({event:"ga4Event",event_name:"lp_button",event_parameters:{page_group:`Product Detail Page${i.sku}`,position:l?.title||"",button_name:o||l?.view||""}})},[l?.title,l?.view,i.sku]);return s("div",{className:"ipc-product-detail-highlight",children:[s("div",{className:"flex items-center justify-between",children:[l?.title&&e(u,{size:3,className:"font-bold leading-[1.2]",html:l?.title}),s(y,{open:g,onOpenChange:d,children:[e(C,{asChild:!0,children:e(w,{variant:"link",className:"!p-0 text-base font-bold",onClick:()=>t(),children:l?.view})}),e(z,{ksp:l?.ksp||[],activeKspItem:r,setActiveKspItem:n,gaTrackEvent:t})]})]}),e("div",{className:"lg-desktop:mt-4 mt-3 flex flex-wrap gap-4",children:l?.ksp?.map(o=>e("div",{className:"product-highlight-item lg-desktop:h-[38px] lg-desktop:leading-[38px] h-[36px] cursor-pointer rounded-full bg-[#F5F5F7] px-4 leading-[36px] hover:bg-[#EAEAEC]",children:e(u,{size:3,onClick:()=>{n(o),d(!0),t(o?.title)},className:"lg-desktop:text-[16px] line-clamp-1 overflow-hidden break-all text-[14px] font-bold text-[#1D1D1F]",html:o?.title})},o?.title))})]})},z=({ksp:a,activeKspItem:i,setActiveKspItem:g,gaTrackEvent:d})=>{const l=x([]),r=x(null),n=v(t=>{const o=a.findIndex(p=>p.title===t?.title),c=l.current[o];if(c&&r.current){const p=r.current,f=c,k=f.offsetLeft-p.offsetWidth/2+f.offsetWidth/2;p.scrollTo({left:k,behavior:"smooth"})}},[a]);return A(()=>{i&&setTimeout(()=>{n(i)},100)},[n,i]),s(N,{className:"tablet:max-w-[896px] [&_.dialog-close-icon]:laptop:size-6 !rounded-box mx-auto w-full max-w-[326px] overflow-hidden border-none p-0 [&_.dialog-close-icon]:size-4",children:[e("style",{children:`
2
2
  .dialog-close-icon {
3
- color: ${n?.closeColor};
3
+ color: ${i?.closeColor||"#1D1D1F"};
4
4
  }
5
- `}),r(D,{value:n?.title,className:"w-full overflow-hidden",children:[l?.map(t=>e(x,{value:t.title,children:e(y,{source:`${t?.img}, ${t?.mobileImg} 767`,className:"desktop:h-[480px] h-[304px] w-full",alt:t.img.alt,imgClassName:"object-cover h-full"})},t.title)),r("div",{className:"desktop:py-6 w-full overflow-visible py-4",children:[e("div",{ref:o,style:{scrollbarWidth:"none",msOverflowStyle:"none"},className:"desktop:px-6 overflow-x-auto px-4",children:e("div",{className:"w-fit rounded-full bg-[#EAEAEC]",children:e(E,{className:"flex w-max p-1",children:l?.map((t,s)=>e(H,{ref:p=>{p&&(c.current[s]=p)},className:L("lg-desktop:px-7 h-[38px] shrink-0 rounded-full px-5 leading-[38px]",t.title===n?.title&&"bg-white"),onClick:()=>{i(t),d(t),u(t?.title)},value:t.title,children:e(f,{html:t.title,className:"text-[14px] font-bold leading-[1.2]"})},s+t.title))})})}),e("div",{className:"desktop:px-6 mt-4 px-4",children:l?.map((t,s)=>e(x,{value:t.title,className:"desktop:text-[18px] text-[14px] font-bold",children:t.description},s+t.title))})]})]})]})};var q=A(z);export{q as default};
5
+ `}),s(D,{value:i?.title,className:"w-full overflow-hidden",children:[a?.map(t=>e(m,{value:t.title,children:e(b,{source:`${t?.img}, ${t?.mobileImg} 767`,className:"desktop:h-[480px] h-[304px] w-full",alt:t.img.alt,imgClassName:"object-cover h-full"})},t.title)),s("div",{className:"desktop:py-6 w-full overflow-visible py-4",children:[e("div",{ref:r,style:{scrollbarWidth:"none",msOverflowStyle:"none"},className:"desktop:px-6 overflow-x-auto px-4",children:e("div",{className:"rounded-btn w-fit bg-[#EAEAEC]",children:e(T,{className:"flex w-max p-1",children:a?.map((t,o)=>e(E,{ref:c=>{c&&(l.current[o]=c)},className:P("lg-desktop:px-7 rounded-btn h-[38px] shrink-0 px-5 leading-[38px]",t.title===i?.title&&"bg-white"),onClick:()=>{n(t),g(t),d(t?.title)},value:t.title,children:e(u,{html:t.title,className:"text-[14px] font-bold leading-[1.2]"})},o+t.title))})})}),e("div",{className:"desktop:px-6 mt-4 px-4",children:a?.map((t,o)=>e(m,{value:t.title,className:"desktop:text-[18px] text-[14px] font-bold",children:t.description},o+t.title))})]})]})]})};var W=H(R);export{W as default};
6
6
  //# sourceMappingURL=index.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../../../src/biz-components/Listing/components/ProductCard/ProductDetail/ProductHighlight/index.tsx"],
4
- "sourcesContent": ["import type { HighlightProps } from '../types'\nimport {\n Text,\n Picture,\n Button,\n Heading,\n Dialog,\n DialogContent,\n DialogTrigger,\n} from '../../../../../../components/index.js'\nimport { Content, List, Root, Trigger } from '@radix-ui/react-tabs'\nimport { useCallback, useEffect, useMemo, useRef, useState } from 'react'\nimport { cn } from '../../../../../../helpers/index.js'\nimport { useBizProductContext } from '../../../../BizProductProvider.js'\nimport { withLayout } from '../../../../../../shared/Styles.js'\nimport { gaTrack } from '../../../../../../shared/track.js'\n\nconst ProductHighlight = () => {\n const { product, variant } = useBizProductContext()\n const [open, setOpen] = useState(false)\n\n const productHighlightData = useMemo(() => {\n return product?.payload?.components?.find((item: any) => item.componentKey === 'ProductHighlight')?.data || {}\n }, [product?.payload])\n\n const [activeKspItem, setActiveKspItem] = useState(productHighlightData?.ksp?.[0])\n\n const gaTrackEvent = useCallback(\n (buttonName?: string) => {\n gaTrack({\n event: 'ga4Event',\n event_name: 'lp_button',\n event_parameters: {\n page_group: `Product Detail Page${variant.sku}`,\n position: productHighlightData?.title || '',\n button_name: buttonName || productHighlightData?.view || '',\n },\n })\n },\n [productHighlightData?.title, productHighlightData?.view, variant.sku]\n )\n\n return (\n <div className=\"ipc-product-detail-highlight\">\n <div className=\"flex items-center justify-between\">\n {productHighlightData?.title && (\n <Text size={3} className=\"font-bold leading-[1.2]\" html={productHighlightData?.title} />\n )}\n <Dialog open={open} onOpenChange={setOpen}>\n <DialogTrigger asChild>\n <Button variant=\"link\" className=\"!p-0 text-base font-bold\" onClick={() => gaTrackEvent()}>\n {productHighlightData?.view}\n </Button>\n </DialogTrigger>\n <ProductHighlightModal\n ksp={productHighlightData?.ksp || []}\n clickActiveKspItem={activeKspItem}\n gaTrackEvent={gaTrackEvent}\n />\n </Dialog>\n </div>\n <div className=\"lg-desktop:mt-4 mt-3 flex flex-wrap gap-4\">\n {productHighlightData?.ksp?.map((item: any) => (\n <div\n key={item?.title}\n className=\"product-highlight-item lg-desktop:h-[38px] lg-desktop:leading-[38px] h-[36px] cursor-pointer rounded-full bg-[#F5F5F7] px-4 leading-[36px] hover:bg-[#EAEAEC]\"\n >\n <Text\n size={3}\n onClick={() => {\n setActiveKspItem(item)\n setOpen(true)\n gaTrackEvent(item?.title)\n }}\n className=\"lg-desktop:text-[16px] line-clamp-1 overflow-hidden break-all text-[14px] font-bold text-[#1D1D1F]\"\n html={item?.title}\n />\n </div>\n ))}\n </div>\n </div>\n )\n}\n\nconst ProductHighlightModal = ({\n ksp,\n clickActiveKspItem,\n gaTrackEvent,\n}: {\n ksp: any[]\n clickActiveKspItem: any\n gaTrackEvent: (buttonName: string) => void\n}) => {\n const highlightRef = useRef<HTMLButtonElement[]>([])\n const scrollContainerRef = useRef<HTMLDivElement>(null)\n const [activeKspItem, setActiveKspItem] = useState<any>(null)\n\n const autoScrollToActiveItem = useCallback(\n (activeKspItem: any) => {\n const curIndex = ksp.findIndex(item => item.title === activeKspItem?.title)\n const curRef = highlightRef.current[curIndex]\n\n if (curRef && scrollContainerRef.current) {\n const container = scrollContainerRef.current\n const button = curRef\n const scrollLeft = button.offsetLeft - container.offsetWidth / 2 + button.offsetWidth / 2\n\n container.scrollTo({\n left: scrollLeft,\n behavior: 'smooth',\n })\n }\n },\n [clickActiveKspItem, ksp]\n )\n\n useEffect(() => {\n if (!clickActiveKspItem) return\n setActiveKspItem(clickActiveKspItem)\n\n // \u5EF6\u8FDF\u6267\u884C\uFF0C\u7B49\u5F85 Dialog \u548C\u5185\u90E8\u5143\u7D20\u5B8C\u5168\u6E32\u67D3\n setTimeout(() => {\n autoScrollToActiveItem(activeKspItem)\n }, 100)\n }, [clickActiveKspItem, autoScrollToActiveItem])\n\n return (\n <DialogContent className=\"tablet:max-w-[896px] tablet:rounded-2xl [&_.dialog-close-icon]:laptop:size-6 mx-auto w-full max-w-[326px] overflow-hidden rounded-xl border-none p-0 [&_.dialog-close-icon]:size-4\">\n <style>{`\n .dialog-close-icon {\n color: ${activeKspItem?.closeColor};\n }\n `}</style>\n <Root value={activeKspItem?.title} className=\"w-full overflow-hidden\">\n {ksp?.map(item => (\n <Content value={item.title} key={item.title}>\n <Picture\n source={`${item?.img}, ${item?.mobileImg} 767`}\n className=\"desktop:h-[480px] h-[304px] w-full\"\n alt={item.img.alt}\n imgClassName=\"object-cover h-full\"\n />\n </Content>\n ))}\n <div className=\"desktop:py-6 w-full overflow-visible py-4\">\n <div\n ref={scrollContainerRef}\n style={{\n scrollbarWidth: 'none',\n msOverflowStyle: 'none',\n }}\n className=\"desktop:px-6 overflow-x-auto px-4\"\n >\n <div className=\"w-fit rounded-full bg-[#EAEAEC]\">\n <List className=\"flex w-max p-1\">\n {ksp?.map((item, index) => (\n <Trigger\n ref={el => {\n if (el) {\n highlightRef.current[index] = el\n }\n }}\n className={cn(\n 'lg-desktop:px-7 h-[38px] shrink-0 rounded-full px-5 leading-[38px]',\n item.title === activeKspItem?.title && 'bg-white'\n )}\n onClick={() => {\n autoScrollToActiveItem(item)\n setActiveKspItem(item)\n gaTrackEvent(item?.title)\n }}\n key={index + item.title}\n value={item.title}\n >\n <Text html={item.title} className=\"text-[14px] font-bold leading-[1.2]\" />\n </Trigger>\n ))}\n </List>\n </div>\n </div>\n <div className=\"desktop:px-6 mt-4 px-4\">\n {ksp?.map((item, index) => (\n <Content\n value={item.title}\n key={index + item.title}\n className=\"desktop:text-[18px] text-[14px] font-bold\"\n >\n {item.description}\n </Content>\n ))}\n </div>\n </div>\n </Root>\n </DialogContent>\n )\n}\n\nexport default withLayout(ProductHighlight)\n"],
5
- "mappings": "AA8CU,cAAAA,EAEF,QAAAC,MAFE,oBA7CV,OACE,QAAAC,EACA,WAAAC,EACA,UAAAC,EAEA,UAAAC,EACA,iBAAAC,EACA,iBAAAC,MACK,wCACP,OAAS,WAAAC,EAAS,QAAAC,EAAM,QAAAC,EAAM,WAAAC,MAAe,uBAC7C,OAAS,eAAAC,EAAa,aAAAC,EAAW,WAAAC,EAAS,UAAAC,EAAQ,YAAAC,MAAgB,QAClE,OAAS,MAAAC,MAAU,qCACnB,OAAS,wBAAAC,MAA4B,oCACrC,OAAS,cAAAC,MAAkB,qCAC3B,OAAS,WAAAC,MAAe,oCAExB,MAAMC,EAAmB,IAAM,CAC7B,KAAM,CAAE,QAAAC,EAAS,QAAAC,CAAQ,EAAIL,EAAqB,EAC5C,CAACM,EAAMC,CAAO,EAAIT,EAAS,EAAK,EAEhCU,EAAuBZ,EAAQ,IAC5BQ,GAAS,SAAS,YAAY,KAAMK,GAAcA,EAAK,eAAiB,kBAAkB,GAAG,MAAQ,CAAC,EAC5G,CAACL,GAAS,OAAO,CAAC,EAEf,CAACM,EAAeC,CAAgB,EAAIb,EAASU,GAAsB,MAAM,CAAC,CAAC,EAE3EI,EAAelB,EAClBmB,GAAw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CACbS,EAAuBV,CAAI,EAC3BE,EAAiBF,CAAI,EACrBG,EAAaH,GAAM,KAAK,CAC1B,EAEA,MAAOA,EAAK,MAEZ,SAAA3B,EAACE,EAAA,CAAK,KAAMyB,EAAK,MAAO,UAAU,sCAAsC,GAHnEgB,EAAQhB,EAAK,KAIpB,CACD,EACH,EACF,EACF,EACA3B,EAAC,OAAI,UAAU,yBACZ,SAAAiC,GAAK,IAAI,CAACN,EAAMgB,IACf3C,EAACQ,EAAA,CACC,MAAOmB,EAAK,MAEZ,UAAU,4CAET,SAAAA,EAAK,aAHDgB,EAAQhB,EAAK,KAIpB,CACD,EACH,GACF,GACF,GACF,CAEJ,EAEA,IAAOkB,EAAQ1B,EAAWE,CAAgB",
6
- "names": ["jsx", "jsxs", "Text", "Picture", "Button", "Dialog", "DialogContent", "DialogTrigger", "Content", "List", "Root", "Trigger", "useCallback", "useEffect", "useMemo", "useRef", "useState", "cn", "useBizProductContext", "withLayout", "gaTrack", "ProductHighlight", "product", "variant", "open", "setOpen", "productHighlightData", "item", "activeKspItem", "setActiveKspItem", "gaTrackEvent", "buttonName", "ProductHighlightModal", "ksp", "clickActiveKspItem", "highlightRef", "scrollContainerRef", "autoScrollToActiveItem", "curIndex", "curRef", "container", "button", "scrollLeft", "index", "el", "ProductHighlight_default"]
4
+ "sourcesContent": ["import { Text, Picture, Button, Dialog, DialogContent, DialogTrigger } from '../../../../../../components/index.js'\nimport { Content, List, Root, Trigger } from '@radix-ui/react-tabs'\nimport { useCallback, useEffect, useMemo, useRef, useState } from 'react'\nimport { cn } from '../../../../../../helpers/index.js'\nimport { useBizProductContext } from '../../../../BizProductProvider.js'\nimport { withLayout } from '../../../../../../shared/Styles.js'\nimport { gaTrack } from '../../../../../../shared/track.js'\n\nconst ProductHighlight = () => {\n const { product, variant } = useBizProductContext()\n const [open, setOpen] = useState(false)\n\n const productHighlightData = useMemo(() => {\n return product?.payload?.components?.find((item: any) => item.componentKey === 'ProductHighlight')?.data || {}\n }, [product?.payload])\n\n const [activeKspItem, setActiveKspItem] = useState(productHighlightData?.ksp?.[0])\n\n const gaTrackEvent = useCallback(\n (buttonName?: string) => {\n gaTrack({\n event: 'ga4Event',\n event_name: 'lp_button',\n event_parameters: {\n page_group: `Product Detail Page${variant.sku}`,\n position: productHighlightData?.title || '',\n button_name: buttonName || productHighlightData?.view || '',\n },\n })\n },\n [productHighlightData?.title, productHighlightData?.view, variant.sku]\n )\n\n return (\n <div className=\"ipc-product-detail-highlight\">\n <div className=\"flex items-center justify-between\">\n {productHighlightData?.title && (\n <Text size={3} className=\"font-bold leading-[1.2]\" html={productHighlightData?.title} />\n )}\n <Dialog open={open} onOpenChange={setOpen}>\n <DialogTrigger asChild>\n <Button variant=\"link\" className=\"!p-0 text-base font-bold\" onClick={() => gaTrackEvent()}>\n {productHighlightData?.view}\n </Button>\n </DialogTrigger>\n <ProductHighlightModal\n ksp={productHighlightData?.ksp || []}\n activeKspItem={activeKspItem}\n setActiveKspItem={setActiveKspItem}\n gaTrackEvent={gaTrackEvent}\n />\n </Dialog>\n </div>\n <div className=\"lg-desktop:mt-4 mt-3 flex flex-wrap gap-4\">\n {productHighlightData?.ksp?.map((item: any) => (\n <div\n key={item?.title}\n className=\"product-highlight-item lg-desktop:h-[38px] lg-desktop:leading-[38px] h-[36px] cursor-pointer rounded-full bg-[#F5F5F7] px-4 leading-[36px] hover:bg-[#EAEAEC]\"\n >\n <Text\n size={3}\n onClick={() => {\n setActiveKspItem(item)\n setOpen(true)\n gaTrackEvent(item?.title)\n }}\n className=\"lg-desktop:text-[16px] line-clamp-1 overflow-hidden break-all text-[14px] font-bold text-[#1D1D1F]\"\n html={item?.title}\n />\n </div>\n ))}\n </div>\n </div>\n )\n}\n\nconst ProductHighlightModal = ({\n ksp,\n activeKspItem,\n setActiveKspItem,\n gaTrackEvent,\n}: {\n ksp: any[]\n activeKspItem: any\n setActiveKspItem: (activeKspItem: any) => void\n gaTrackEvent: (buttonName: string) => void\n}) => {\n const highlightRef = useRef<HTMLButtonElement[]>([])\n const scrollContainerRef = useRef<HTMLDivElement>(null)\n\n const autoScrollToActiveItem = useCallback(\n (activeKspItem: any) => {\n const curIndex = ksp.findIndex(item => item.title === activeKspItem?.title)\n const curRef = highlightRef.current[curIndex]\n\n if (curRef && scrollContainerRef.current) {\n const container = scrollContainerRef.current\n const button = curRef\n const scrollLeft = button.offsetLeft - container.offsetWidth / 2 + button.offsetWidth / 2\n\n container.scrollTo({\n left: scrollLeft,\n behavior: 'smooth',\n })\n }\n },\n [ksp]\n )\n\n useEffect(() => {\n if (!activeKspItem) return\n // setActiveKspItem(clickActiveKspItem)\n\n // \u5EF6\u8FDF\u6267\u884C\uFF0C\u7B49\u5F85 Dialog \u548C\u5185\u90E8\u5143\u7D20\u5B8C\u5168\u6E32\u67D3\n setTimeout(() => {\n autoScrollToActiveItem(activeKspItem)\n }, 100)\n }, [autoScrollToActiveItem, activeKspItem])\n\n return (\n <DialogContent className=\"tablet:max-w-[896px] [&_.dialog-close-icon]:laptop:size-6 !rounded-box mx-auto w-full max-w-[326px] overflow-hidden border-none p-0 [&_.dialog-close-icon]:size-4\">\n <style>{`\n .dialog-close-icon {\n color: ${activeKspItem?.closeColor || '#1D1D1F'};\n }\n `}</style>\n <Root value={activeKspItem?.title} className=\"w-full overflow-hidden\">\n {ksp?.map(item => (\n <Content value={item.title} key={item.title}>\n <Picture\n source={`${item?.img}, ${item?.mobileImg} 767`}\n className=\"desktop:h-[480px] h-[304px] w-full\"\n alt={item.img.alt}\n imgClassName=\"object-cover h-full\"\n />\n </Content>\n ))}\n <div className=\"desktop:py-6 w-full overflow-visible py-4\">\n <div\n ref={scrollContainerRef}\n style={{\n scrollbarWidth: 'none',\n msOverflowStyle: 'none',\n }}\n className=\"desktop:px-6 overflow-x-auto px-4\"\n >\n <div className=\"rounded-btn w-fit bg-[#EAEAEC]\">\n <List className=\"flex w-max p-1\">\n {ksp?.map((item, index) => (\n <Trigger\n ref={el => {\n if (el) {\n highlightRef.current[index] = el\n }\n }}\n className={cn(\n 'lg-desktop:px-7 rounded-btn h-[38px] shrink-0 px-5 leading-[38px]',\n item.title === activeKspItem?.title && 'bg-white'\n )}\n onClick={() => {\n autoScrollToActiveItem(item)\n setActiveKspItem(item)\n gaTrackEvent(item?.title)\n }}\n key={index + item.title}\n value={item.title}\n >\n <Text html={item.title} className=\"text-[14px] font-bold leading-[1.2]\" />\n </Trigger>\n ))}\n </List>\n </div>\n </div>\n <div className=\"desktop:px-6 mt-4 px-4\">\n {ksp?.map((item, index) => (\n <Content\n value={item.title}\n key={index + item.title}\n className=\"desktop:text-[18px] text-[14px] font-bold\"\n >\n {item.description}\n </Content>\n ))}\n </div>\n </div>\n </Root>\n </DialogContent>\n )\n}\n\nexport default withLayout(ProductHighlight)\n"],
5
+ "mappings": "AAqCU,cAAAA,EAEF,QAAAC,MAFE,oBArCV,OAAS,QAAAC,EAAM,WAAAC,EAAS,UAAAC,EAAQ,UAAAC,EAAQ,iBAAAC,EAAe,iBAAAC,MAAqB,wCAC5E,OAAS,WAAAC,EAAS,QAAAC,EAAM,QAAAC,EAAM,WAAAC,MAAe,uBAC7C,OAAS,eAAAC,EAAa,aAAAC,EAAW,WAAAC,EAAS,UAAAC,EAAQ,YAAAC,MAAgB,QAClE,OAAS,MAAAC,MAAU,qCACnB,OAAS,wBAAAC,MAA4B,oCACrC,OAAS,cAAAC,MAAkB,qCAC3B,OAAS,WAAAC,MAAe,oCAExB,MAAMC,EAAmB,IAAM,CAC7B,KAAM,CAAE,QAAAC,EAAS,QAAAC,CAAQ,EAAIL,EAAqB,EAC5C,CAACM,EAAMC,CAAO,EAAIT,EAAS,EAAK,EAEhCU,EAAuBZ,EAAQ,IAC5BQ,GAAS,SAAS,YAAY,KAAMK,GAAcA,EAAK,eAAiB,kBAAkB,GAAG,MAAQ,CAAC,EAC5G,CAACL,GAAS,OAAO,CAAC,EAEf,CAACM,EAAeC,CAAgB,EAAIb,EAASU,GAAsB,MAAM,CAAC,CAAC,EAE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C3BE,EAAiBF,CAAI,EACrBG,EAAaH,GAAM,KAAK,CAC1B,EAEA,MAAOA,EAAK,MAEZ,SAAA3B,EAACE,EAAA,CAAK,KAAMyB,EAAK,MAAO,UAAU,sCAAsC,GAHnEe,EAAQf,EAAK,KAIpB,CACD,EACH,EACF,EACF,EACA3B,EAAC,OAAI,UAAU,yBACZ,SAAAiC,GAAK,IAAI,CAACN,EAAMe,IACf1C,EAACQ,EAAA,CACC,MAAOmB,EAAK,MAEZ,UAAU,4CAET,SAAAA,EAAK,aAHDe,EAAQf,EAAK,KAIpB,CACD,EACH,GACF,GACF,GACF,CAEJ,EAEA,IAAOiB,EAAQzB,EAAWE,CAAgB",
6
+ "names": ["jsx", "jsxs", "Text", "Picture", "Button", "Dialog", "DialogContent", "DialogTrigger", "Content", "List", "Root", "Trigger", "useCallback", "useEffect", "useMemo", "useRef", "useState", "cn", "useBizProductContext", "withLayout", "gaTrack", "ProductHighlight", "product", "variant", "open", "setOpen", "productHighlightData", "item", "activeKspItem", "setActiveKspItem", "gaTrackEvent", "buttonName", "ProductHighlightModal", "ksp", "highlightRef", "scrollContainerRef", "autoScrollToActiveItem", "curIndex", "curRef", "container", "button", "scrollLeft", "index", "el", "ProductHighlight_default"]
7
7
  }
@@ -1,2 +1,2 @@
1
- import{Fragment as ve,jsx as e,jsxs as y}from"react/jsx-runtime";import{useAiuiContext as U}from"../../../../AiuiProvider/index.js";import{Text as ee,Picture as z,Badge as te}from"../../../../../components/index.js";import{useCallback as S,useMemo as D,useState as v,forwardRef as Z,useRef as A,useEffect as R,useImperativeHandle as le}from"react";import{Swiper as B,SwiperSlide as $}from"swiper/react";import{Navigation as F,Mousewheel as q,Thumbs as j,Pagination as J}from"swiper/modules";import{cn as E}from"../../../../../helpers/index.js";import{GalleryTabType as _}from"./types.js";import{Content as ae,List as ie,Root as oe,Trigger as re}from"@radix-ui/react-tabs";import{useBizProductContext as H}from"../../../BizProductProvider.js";import{useVariantMedia as se}from"../../../hooks/use-variant-media.js";import{SpecsModal as ne}from"./components/SpecsModal.js";import ce from"./components/CompareModal.js";import{formatPrice as de}from"../../../utils/index.js";import{withLayout as ue}from"../../../../../shared/Styles.js";import{gaTrack as pe}from"../../../../../shared/track.js";import{ExposureDetector as be}from"../../../../../components/index.js";const Q=t=>y("svg",{width:"48",height:"48",viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t,children:[e("rect",{x:"48",y:"48",width:"48",height:"48",rx:"24",transform:"rotate(-180 48 48)",fill:"white"}),e("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"})]}),X=t=>y("svg",{width:"48",height:"48",viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t,children:[e("rect",{width:"48",height:"48",rx:"24",transform:"matrix(1 -8.74228e-08 -8.74228e-08 -1 0 48)",fill:"white"}),e("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"})]}),me=()=>{const{copyWriting:t}=U(),{product:s,variant:b,selectedOptions:k}=H(),u=se({product:s,variant:b}),[c,h]=v(null),C=A(null),p=b?.metafields?.component?.custom_media_list;let f,T,I,x;p&&p?.available?(f=p?.product||[],T=p?.scenarios||[],I=p?.keyFeatures||[],x=p?.video||[]):(f=u?.productList,T=u?.sceneList,I=u?.keyFeaturesList,x=u?.videoList);const a=D(()=>[...f,...T,...x],[f,T,x]),d={productList:f,sceneList:T,keyFeaturesList:I,videoList:x},l=D(()=>(s?.payload?.components?.find(r=>r.componentKey==="ProductGallery")?.data||[])?.map(r=>{let Y=d[r?.galleries]||[];if(r?.images&&Array.isArray(r.images)&&r.images.length>0){const O=r.images.map(n=>{const L=[];if(n.image_1920&&n.image_1920.trim()&&L.push(`${n.image_1920} 1920`),n.image_1440&&n.image_1440.trim()&&L.push(`${n.image_1440} 1440`),n.image_1024&&n.image_1024.trim()&&L.push(`${n.image_1024} 1024`),n.image_768&&n.image_768.trim()&&L.push(`${n.image_768} 767`),n.image_390&&n.image_390.trim()&&L.push(`${n.image_390} 390`),L.length>0){const K=L.join(", ");return{image:{url:K,altText:r.comment?.content||""},_fromImages:!0,_responsiveSource:K}}return null}).filter(n=>n!==null);O.length>0&&(Y=O)}return{...r,galleries:Y}}).filter(r=>r.galleries.length>0),[s?.payload,d]),[w,N]=v(l?.[0]),[m,G]=v(0),[P,i]=v(null),g=S(()=>{const o=(m+1)%l.length;G(o),N(l[o]),i(0)},[m,l]),M=S(()=>{const o=m===0?l.length-1:m-1;G(o),N(l[o]);const r=l[o]?.galleries||[];i(r.length-1)},[m,l]);R(()=>{m!=null&&requestAnimationFrame(()=>{C.current?.scrollToTab(m)})},[m]),R(()=>{N(l[0]),G(0)},[b?.id]);const V=(o,r)=>{switch(o?.galleryTabType){case _.GALLERY_IMAGE_MAIN:return e(W,{...o,index:r,onNextTab:g,onPrevTab:M,targetSlideIndex:P,onSlideChange:()=>i(null)});case _.GALLERY_IMAGE_FEATURES:return e(W,{...o,index:r,onNextTab:g,onPrevTab:M,targetSlideIndex:P,onSlideChange:()=>i(null)});case _.GALLERY_IMAGE_SCENE:return e(W,{...o,index:r,onNextTab:g,onPrevTab:M,targetSlideIndex:P,onSlideChange:()=>i(null)});case _.GALLERY_VIDEO:return e(fe,{...o,onNextTab:g,onPrevTab:M,targetSlideIndex:P,onSlideChange:()=>i(null)});default:return null}};return e("div",{id:"ipc-product-gallery",children:y(oe,{className:"relative",value:w?.tabValue,defaultValue:l?.[0]?.tabValue,children:[e("div",{className:"tablet:h-[620px] desktop:rounded-2xl desktop:h-[560px] lg-desktop:h-[700px] desktop:relative h-[420px] overflow-hidden bg-[#EAEAEC] ",children:l.map((o,r)=>e(ae,{className:"h-full",value:o.tabValue,children:V(o,r)},o.tabValue))}),e(ge,{ref:C,galleryTabs:l,activeGalleryTab:w,setActiveGalleryTab:N,setActiveTabIndex:G,setTargetSlideIndex:i})]})})},ge=Z((t,s)=>{const{galleryTabs:b,activeGalleryTab:k,setActiveGalleryTab:u,setActiveTabIndex:c,setTargetSlideIndex:h}=t,{product:C}=H(),p=A(null),f=A(new Map),T=S((a,d,l)=>{u(d),c(l),h(0),I(a)},[u,c,h]),I=S(a=>{if(p.current){const d=p.current,l=a.currentTarget,w=l.offsetLeft-d.offsetWidth/2+l.offsetWidth/2;d.scrollTo({left:w,behavior:"smooth"})}},[]),x=S(a=>{if(p.current&&b[a]){const d=p.current,l=b[a],w=f.current.get(l.tabValue);if(w){const N=w.offsetLeft-d.offsetWidth/2+w.offsetWidth/2;d.scrollTo({left:N,behavior:"smooth"})}}},[b]);return le(s,()=>({scrollToTab:x})),y("div",{className:"laptop:inset-x-16 tablet:mt-3 desktop:static absolute inset-x-4 bottom-4 z-[2] flex items-center justify-between",children:[e(ie,{ref:p,className:"laptop:p-0 desktop:p-1 overflow-x-auto rounded-full bg-[#EAEAEC] p-1",style:{scrollbarWidth:"none",msOverflowStyle:"none"},children:e("div",{className:"whitespace-nowrap",children:b?.map((a,d)=>e(re,{ref:l=>{l?f.current.set(a.tabValue,l):f.current.delete(a.tabValue)},className:E("lg-desktop:px-7 lg-desktop:pb-[14px] lg-desktop:pt-[15px] lg-desktop:text-[16px] rounded-full px-5 pb-[10px] pt-[11px] text-[14px] font-bold leading-tight",a.tabValue===k?.tabValue&&"bg-white"),onClick:l=>T(l,a,d),value:a.tabValue,children:a.tabLabel},a.tabValue+d))})}),e("div",{className:"laptop:gap-2 laptop:flex hidden",children:C.metafields?.global?.specifications&&y(ve,{children:[e(ne,{})," | ",e(ce,{})]})})]})}),W=Z((t,s)=>{const{locale:b="us",copyWriting:k}=U(),{variant:u,totalSavings:c}=H(),h=A(null),[C,p]=v(null),[f,T]=v(!0),[I,x]=v(!1),[a,d]=v(null),l=A(null),[w,N]=v(!1),m=D(()=>{if(t?.galleryTabType===_.GALLERY_IMAGE_MAIN)return"size-[240px] mx-auto mt-[42px] tablet:mt-16 tablet:size-[420px] lg-desktop:size-[560px]";t?.galleryTabType===_.GALLERY_IMAGE_FEATURES||(t?.galleryTabType,_.GALLERY_IMAGE_SCENE)},[t?.galleryTabType]),G=S(()=>{a?.isBeginning?t.onPrevTab?.():a?.slidePrev()},[a,t]),P=S(()=>{a?.isEnd?t.onNextTab?.():a?.slideNext()},[a,t]);return R(()=>{a&&t.targetSlideIndex&&(a.slideTo(t.targetSlideIndex,0),t.onSlideChange?.())},[a,t.targetSlideIndex,t]),y("div",{className:"h-full [&_.swiper-button]:hover:opacity-100",children:[e(B,{ref:s,className:"h-full",onSwiper:d,onProgress:i=>{T(i.isBeginning),x(i.isEnd)},onTouchEnd:(i,g)=>{i.isBeginning&&i.swipeDirection==="prev"?G():i.isEnd&&i.swipeDirection==="next"&&P()},pagination:{clickable:!0,el:h.current},thumbs:{swiper:C},modules:[q,j,F,J],mousewheel:{forceToAxis:!0},breakpoints:{0:{slidesPerView:1,freeMode:!1}},children:t?.galleries?.map((i,g)=>{const M=`${t.tabValue}-${g}`,V=()=>{pe({event:"ga4Event",event_name:"component_impression",event_parameters:{page_group:`Product Detail Page${u.sku}`,component_type:"image",component_name:t?.tabLabel||"",position:g+1,creative_id:"",component_title:"",component_description:"",navigation:""}})},o=i?._responsiveSource||i?.image?.url||"";return e($,{className:"h-full",children:e(be,{onExposure:V,exposureKey:M,threshold:.5,duration:2e3,className:"h-full",children:e(z,{source:o,alt:i?.image?.altText,className:E("h-full",m),imgClassName:"object-cover h-full"})})},t?.id+"SwiperSlideItem"+g)})}),u.availableForSale&&!!c&&!t.index&&e(te,{size:"lg",className:"bg-brand laptop:left-16 laptop:top-5 desktop:left-6 desktop:top-6 absolute left-4 top-3 z-[2] text-white",children:`${de({amount:c,currencyCode:u?.price?.currencyCode,locale:b})} ${k?.off}`}),e("div",{className:E("tablet:opacity-0 tablet:block tablet:absolute tablet:top-1/2 laptop:left-16 tablet:left-6 desktop:left-6 z-10 hidden -translate-y-1/2 cursor-pointer","swiper-button"),onClick:G,children:e(Q,{className:E("tablet:size-10 lg-desktop:size-12")})}),e("div",{className:E("tablet:block tablet:opacity-0 tablet:absolute tablet:top-1/2 laptop:right-16 tablet:right-6 desktop:right-6 z-10 hidden -translate-y-1/2 cursor-pointer","swiper-button"),onClick:P,children:e(X,{className:E("tablet:size-10 lg-desktop:size-12")})}),y("div",{className:"tablet:bottom-[70px] tablet:flex laptop:inset-x-16 desktop:bottom-[20px] desktop:inset-x-6 absolute inset-x-4 bottom-[94px] z-10 items-center justify-between",children:[e("div",{className:"tablet:block hidden",children:e(B,{className:"flex items-center justify-between",onSwiper:p,spaceBetween:12,slidesPerView:6,freeMode:!0,watchSlidesProgress:!0,modules:[F,j],children:t?.galleries?.map((i,g)=>e($,{className:"[&.swiper-slide-thumb-active]:border-brand !w-auto cursor-pointer border border-transparent [&.swiper-slide-thumb-active]:rounded",children:e(z,{source:i.image?.url,alt:i.image?.altText,className:"lg-desktop:size-12 size-10 overflow-hidden rounded bg-white",imgClassName:"object-cover h-full"})},t?.id+"SwiperSlideThumbItem"+g))})}),!t?.index&&y("div",{className:"flex items-center gap-2",children:[e(z,{source:t?.comment?.avatar?.url,className:"laptop:size-10 size-8 shrink-0 rounded-full",imgClassName:"object-cover "}),e("div",{className:"relative max-w-[528px] overflow-hidden",children:e("div",{ref:l,className:E("line-clamp-2"),style:{},children:e(ee,{html:t?.comment?.content,className:"lg-desktop:text-base text-sm font-bold text-[#1D1D1F]"})})})]})]}),e("div",{ref:h,className:"tablet:hidden absolute inset-x-4 !bottom-[70px] z-10 text-center [&_.swiper-pagination-bullet]:bg-white [&_.swiper-pagination-bullet]:opacity-100"})]})}),fe=t=>{const[s,b]=v(null),k=S(()=>{s?.isBeginning?t.onPrevTab?.():s?.slidePrev()},[s,t]),u=S(()=>{s?.isEnd?t.onNextTab?.():s?.slideNext()},[s,t]);return R(()=>{s&&t.targetSlideIndex!==null&&t.targetSlideIndex!==void 0&&(s.slideTo(t.targetSlideIndex,0),t.onSlideChange?.())},[s,t.targetSlideIndex,t]),y("div",{className:"h-full [&_.swiper-button]:hover:opacity-100",children:[e(B,{className:"h-full",onSwiper:b,onTouchEnd:(c,h)=>{c.isBeginning&&c.swipeDirection==="prev"?k():c.isEnd&&c.swipeDirection==="next"&&u()},modules:[q,j,F,J],mousewheel:{forceToAxis:!0},breakpoints:{0:{slidesPerView:1,freeMode:!1}},children:t?.galleries?.map((c,h)=>e($,{className:"h-full",children:y("video",{controls:!0,className:"size-full object-cover",children:[e("track",{kind:"captions"}),e("source",{src:c?.sources?.[0]?.url,type:"video/mp4"}),e("source",{src:c?.sources?.[0]?.url,type:"video/webm"}),e("source",{src:c?.sources?.[0]?.url,type:"video/ogg"})]})},t?.id+"SwiperSlideItem"+h))}),e("div",{className:E("swiper-button tablet:block tablet:opacity-0 tablet:absolute tablet:top-1/2 tablet:left-6 z-10 hidden -translate-y-1/2 cursor-pointer"),onClick:k,children:e(Q,{className:"tablet:size-10 lg-desktop:size-12"})}),e("div",{className:E("tablet:block swiper-button tablet:opacity-0 tablet:absolute tablet:top-1/2 tablet:right-6 z-10 hidden -translate-y-1/2 cursor-pointer"),onClick:u,children:e(X,{className:"tablet:size-10 lg-desktop:size-12"})})]})},Re=t=>e("div",{children:"3D View"});var Ve=ue(me);export{Ve as default};
1
+ import{Fragment as ve,jsx as e,jsxs as y}from"react/jsx-runtime";import{useAiuiContext as K}from"../../../../AiuiProvider/index.js";import{Text as ee,Picture as V,Badge as te}from"../../../../../components/index.js";import{useCallback as x,useMemo as z,useState as k,forwardRef as U,useRef as I,useEffect as R,useImperativeHandle as le}from"react";import{Swiper as D,SwiperSlide as B}from"swiper/react";import{Navigation as $,Mousewheel as Z,Thumbs as F,Pagination as q}from"swiper/modules";import{cn as w}from"../../../../../helpers/index.js";import{GalleryTabType as L}from"./types.js";import{Content as ae,List as ie,Root as oe,Trigger as re}from"@radix-ui/react-tabs";import{useBizProductContext as j}from"../../../BizProductProvider.js";import{useVariantMedia as se}from"../../../hooks/use-variant-media.js";import{SpecsModal as ne}from"./components/SpecsModal.js";import ce from"./components/CompareModal.js";import{formatPrice as de}from"../../../utils/index.js";import{withLayout as ue}from"../../../../../shared/Styles.js";import{gaTrack as pe}from"../../../../../shared/track.js";import{ExposureDetector as be}from"../../../../../components/index.js";const J=t=>y("svg",{width:"48",height:"48",viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t,children:[e("rect",{x:"48",y:"48",width:"48",height:"48",rx:"24",transform:"rotate(-180 48 48)",fill:"white"}),e("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"})]}),Q=t=>y("svg",{width:"48",height:"48",viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t,children:[e("rect",{width:"48",height:"48",rx:"24",transform:"matrix(1 -8.74228e-08 -8.74228e-08 -1 0 48)",fill:"white"}),e("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"})]}),me=()=>{const{copyWriting:t}=K(),{product:r,variant:g,selectedOptions:N}=j(),b=se({product:r,variant:g}),[u,h]=k(null),P=I(null),m=g?.metafields?.component?.custom_media_list;let a,v,E,S;m&&m?.available?(a=m?.product||[],v=m?.scenarios||[],E=m?.keyFeatures||[],S=m?.video||[]):(a=b?.productList,v=b?.sceneList,E=b?.keyFeaturesList,S=b?.videoList);const c=z(()=>[...a,...v,...S],[a,v,S]),p={productList:a,sceneList:v,keyFeaturesList:E,videoList:S},l=z(()=>(r?.payload?.components?.find(i=>i.componentKey==="ProductGallery")?.data||[])?.map(i=>{let W=p[i?.galleries]||[];if(i?.images&&Array.isArray(i.images)&&i.images.length>0){const Y=i.images.map(n=>{const G=[];if(n.image_1920&&n.image_1920.trim()&&G.push(`${n.image_1920} 1920`),n.image_1440&&n.image_1440.trim()&&G.push(`${n.image_1440} 1440`),n.image_1024&&n.image_1024.trim()&&G.push(`${n.image_1024} 1024`),n.image_768&&n.image_768.trim()&&G.push(`${n.image_768} 767`),n.image_390&&n.image_390.trim()&&G.push(`${n.image_390} 390`),G.length>0){const O=G.join(", ");return{image:{url:O,altText:i.comment?.content||""},_fromImages:!0,_responsiveSource:O}}return null}).filter(n=>n!==null);Y.length>0&&(W=Y)}return{...i,galleries:W}}).filter(i=>i.galleries.length>0),[r?.payload,p]),[f,o]=k(l?.[0]),[d,_]=k(0),[C,T]=k(null),M=x(()=>{const s=(d+1)%l.length;_(s),o(l[s]),T(0)},[d,l]),A=x(()=>{const s=d===0?l.length-1:d-1;_(s),o(l[s]);const i=l[s]?.galleries||[];T(i.length-1)},[d,l]);R(()=>{d!=null&&requestAnimationFrame(()=>{P.current?.scrollToTab(d)})},[d]),R(()=>{o(l[0]),_(0)},[g?.id]);const X=(s,i)=>{switch(s?.galleryTabType){case L.GALLERY_IMAGE_MAIN:return e(H,{...s,index:i,onNextTab:M,onPrevTab:A,targetSlideIndex:C,onSlideChange:()=>T(null)});case L.GALLERY_IMAGE_FEATURES:return e(H,{...s,index:i,onNextTab:M,onPrevTab:A,targetSlideIndex:C,onSlideChange:()=>T(null)});case L.GALLERY_IMAGE_SCENE:return e(H,{...s,index:i,onNextTab:M,onPrevTab:A,targetSlideIndex:C,onSlideChange:()=>T(null)});case L.GALLERY_VIDEO:return e(fe,{...s,onNextTab:M,onPrevTab:A,targetSlideIndex:C,onSlideChange:()=>T(null)});default:return null}};return e("div",{id:"ipc-product-gallery",children:y(oe,{className:"relative",value:f?.tabValue,defaultValue:l?.[0]?.tabValue,children:[e("div",{className:"tablet:h-[620px] desktop:rounded-2xl desktop:h-[560px] lg-desktop:h-[700px] desktop:relative h-[420px] overflow-hidden bg-[#EAEAEC] ",children:l.map((s,i)=>e(ae,{className:"h-full",value:s.tabValue,children:X(s,i)},s.tabValue))}),e(ge,{ref:P,galleryTabs:l,activeGalleryTab:f,setActiveGalleryTab:o,setActiveTabIndex:_,setTargetSlideIndex:T})]})})},ge=U((t,r)=>{const{galleryTabs:g,activeGalleryTab:N,setActiveGalleryTab:b,setActiveTabIndex:u,setTargetSlideIndex:h}=t,{product:P}=j(),m=I(null),a=I(new Map),v=x(c=>{if(m.current){const p=m.current,l=c.currentTarget,f=l.offsetLeft-p.offsetWidth/2+l.offsetWidth/2;p.scrollTo({left:f,behavior:"smooth"})}},[]),E=x((c,p,l)=>{b(p),u(l),h(0),v(c)},[b,u,h,v]),S=x(c=>{if(m.current&&g[c]){const p=m.current,l=g[c],f=a.current.get(l.tabValue);if(f){const o=f.offsetLeft-p.offsetWidth/2+f.offsetWidth/2;p.scrollTo({left:o,behavior:"smooth"})}}},[g]);return le(r,()=>({scrollToTab:S})),y("div",{className:"laptop:inset-x-16 tablet:mt-3 desktop:static absolute inset-x-4 bottom-4 z-[2] flex items-center justify-between",children:[e(ie,{ref:m,className:"laptop:p-0 desktop:p-1 overflow-x-auto rounded-full bg-[#EAEAEC] p-1",style:{scrollbarWidth:"none",msOverflowStyle:"none"},children:e("div",{className:"whitespace-nowrap",children:g?.map((c,p)=>e(re,{ref:l=>{l?a.current.set(c.tabValue,l):a.current.delete(c.tabValue)},className:w("lg-desktop:px-7 lg-desktop:pb-[14px] lg-desktop:pt-[15px] lg-desktop:text-[16px] rounded-full px-5 pb-[10px] pt-[11px] text-[14px] font-bold leading-tight",c.tabValue===N?.tabValue&&"bg-white"),onClick:l=>E(l,c,p),value:c.tabValue,children:c.tabLabel},c.tabValue+p))})}),e("div",{className:"laptop:gap-2 laptop:flex hidden",children:P.metafields?.global?.specifications&&y(ve,{children:[e(ne,{})," | ",e(ce,{})]})})]})}),H=U((t,r)=>{const{locale:g="us",copyWriting:N}=K(),{variant:b,totalSavings:u}=j(),h=I(null),[P,m]=k(null),[a,v]=k(null),E=I(null),[S,c]=k(!1),p=z(()=>{if(t?.galleryTabType===L.GALLERY_IMAGE_MAIN)return"size-[240px] mx-auto mt-[42px] tablet:mt-16 tablet:size-[420px] lg-desktop:size-[560px]";t?.galleryTabType===L.GALLERY_IMAGE_FEATURES||(t?.galleryTabType,L.GALLERY_IMAGE_SCENE)},[t?.galleryTabType]),l=x(()=>{a?.isBeginning?t.onPrevTab?.():a?.slidePrev()},[a,t]),f=x(()=>{a?.isEnd?t.onNextTab?.():a?.slideNext()},[a,t]);return R(()=>{a&&t.targetSlideIndex&&(a.slideTo(t.targetSlideIndex,0),t.onSlideChange?.())},[a,t.targetSlideIndex,t]),y("div",{className:"h-full [&_.swiper-button]:hover:opacity-100",children:[e(D,{ref:r,className:"h-full",onSwiper:v,onTouchEnd:(o,d)=>{o.isBeginning&&o.swipeDirection==="prev"?l():o.isEnd&&o.swipeDirection==="next"&&f()},pagination:{clickable:!0,el:h.current},thumbs:{swiper:P},modules:[Z,F,$,q],mousewheel:{forceToAxis:!0},breakpoints:{0:{slidesPerView:1,freeMode:!1}},children:t?.galleries?.map((o,d)=>{const _=`${t.tabValue}-${d}`,C=()=>{pe({event:"ga4Event",event_name:"component_impression",event_parameters:{page_group:`Product Detail Page${b.sku}`,component_type:"image",component_name:t?.tabLabel||"",position:d+1,creative_id:"",component_title:"",component_description:"",navigation:""}})},T=o?._responsiveSource||o?.image?.url||"";return e(B,{className:"h-full",children:e(be,{onExposure:C,exposureKey:_,threshold:.5,duration:2e3,className:"h-full",children:e(V,{source:T,alt:o?.image?.altText,className:w("h-full",p),imgClassName:"object-cover h-full"})})},t?.id+"SwiperSlideItem"+d)})}),b.availableForSale&&!!u&&!t.index&&e(te,{size:"lg",className:"bg-brand laptop:left-16 laptop:top-5 desktop:left-6 desktop:top-6 absolute left-4 top-3 z-[2] text-white",children:`${de({amount:u,currencyCode:b?.price?.currencyCode,locale:g})} ${N?.off}`}),e("div",{className:w("tablet:opacity-0 tablet:block tablet:absolute tablet:top-1/2 laptop:left-16 tablet:left-6 desktop:left-6 z-10 hidden -translate-y-1/2 cursor-pointer","swiper-button"),onClick:l,children:e(J,{className:w("tablet:size-10 lg-desktop:size-12")})}),e("div",{className:w("tablet:block tablet:opacity-0 tablet:absolute tablet:top-1/2 laptop:right-16 tablet:right-6 desktop:right-6 z-10 hidden -translate-y-1/2 cursor-pointer","swiper-button"),onClick:f,children:e(Q,{className:w("tablet:size-10 lg-desktop:size-12")})}),y("div",{className:"tablet:bottom-[70px] tablet:flex laptop:inset-x-16 desktop:bottom-[20px] desktop:inset-x-6 absolute inset-x-4 bottom-[94px] z-10 items-center justify-between",children:[e("div",{className:"tablet:block hidden",children:e(D,{className:"flex items-center justify-between",onSwiper:m,spaceBetween:12,slidesPerView:6,freeMode:!0,watchSlidesProgress:!0,modules:[$,F],children:t?.galleries?.map((o,d)=>e(B,{className:"[&.swiper-slide-thumb-active]:border-brand !w-auto cursor-pointer border border-transparent [&.swiper-slide-thumb-active]:rounded",children:e(V,{source:o.image?.url,alt:o.image?.altText,className:"lg-desktop:size-12 size-10 overflow-hidden rounded bg-white",imgClassName:"object-cover h-full"})},t?.id+"SwiperSlideThumbItem"+d))})}),!t?.index&&y("div",{className:"flex items-center gap-2",children:[e(V,{source:t?.comment?.avatar?.url,className:"laptop:size-10 size-8 shrink-0 rounded-full",imgClassName:"object-cover "}),e("div",{className:"relative max-w-[528px] overflow-hidden",children:e("div",{ref:E,className:w("line-clamp-2"),style:{},children:e(ee,{html:t?.comment?.content,className:"lg-desktop:text-base text-sm font-bold text-[#1D1D1F]"})})})]})]}),e("div",{ref:h,className:"tablet:hidden absolute inset-x-4 !bottom-[70px] z-10 text-center [&_.swiper-pagination-bullet-active]:!bg-[#1D1D1F] [&_.swiper-pagination-bullet]:bg-white [&_.swiper-pagination-bullet]:opacity-100"})]})}),fe=t=>{const[r,g]=k(null),N=x(()=>{r?.isBeginning?t.onPrevTab?.():r?.slidePrev()},[r,t]),b=x(()=>{r?.isEnd?t.onNextTab?.():r?.slideNext()},[r,t]);return R(()=>{r&&t.targetSlideIndex!==null&&t.targetSlideIndex!==void 0&&(r.slideTo(t.targetSlideIndex,0),t.onSlideChange?.())},[r,t.targetSlideIndex,t]),y("div",{className:"h-full [&_.swiper-button]:hover:opacity-100",children:[e(D,{className:"h-full",onSwiper:g,onTouchEnd:(u,h)=>{u.isBeginning&&u.swipeDirection==="prev"?N():u.isEnd&&u.swipeDirection==="next"&&b()},modules:[Z,F,$,q],mousewheel:{forceToAxis:!0},breakpoints:{0:{slidesPerView:1,freeMode:!1}},children:t?.galleries?.map((u,h)=>e(B,{className:"h-full",children:y("video",{controls:!0,className:"size-full object-cover",children:[e("track",{kind:"captions"}),e("source",{src:u?.sources?.[0]?.url,type:"video/mp4"}),e("source",{src:u?.sources?.[0]?.url,type:"video/webm"}),e("source",{src:u?.sources?.[0]?.url,type:"video/ogg"})]})},t?.id+"SwiperSlideItem"+h))}),e("div",{className:w("swiper-button tablet:block tablet:opacity-0 tablet:absolute tablet:top-1/2 tablet:left-6 z-10 hidden -translate-y-1/2 cursor-pointer"),onClick:N,children:e(J,{className:"tablet:size-10 lg-desktop:size-12"})}),e("div",{className:w("tablet:block swiper-button tablet:opacity-0 tablet:absolute tablet:top-1/2 tablet:right-6 z-10 hidden -translate-y-1/2 cursor-pointer"),onClick:b,children:e(Q,{className:"tablet:size-10 lg-desktop:size-12"})})]})},Re=t=>e("div",{children:"3D View"});var Ve=ue(me);export{Ve as default};
2
2
  //# sourceMappingURL=index.js.map