@anker-in/headless-ui 1.3.21 → 1.3.22
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.
- package/dist/cjs/biz-components/BuyOneGetOneShelf/ProductCard.d.ts +1 -1
- package/dist/cjs/biz-components/BuyOneGetOneShelf/ProductCard.js +1 -1
- package/dist/cjs/biz-components/BuyOneGetOneShelf/ProductCard.js.map +3 -3
- package/dist/cjs/biz-components/BuyOneGetOneShelf/context.d.ts +4 -0
- package/dist/cjs/biz-components/BuyOneGetOneShelf/context.js +2 -0
- package/dist/cjs/biz-components/BuyOneGetOneShelf/context.js.map +7 -0
- package/dist/cjs/biz-components/BuyOneGetOneShelf/types.d.ts +1 -1
- package/dist/cjs/biz-components/BuyOneGetOneShelf/types.js.map +1 -1
- package/dist/cjs/biz-components/FooterNavigation/index.js +1 -1
- package/dist/cjs/biz-components/FooterNavigation/index.js.map +2 -2
- package/dist/cjs/biz-components/ShelfDisplay/shelfDisplayItem.js +1 -1
- package/dist/cjs/biz-components/ShelfDisplay/shelfDisplayItem.js.map +3 -3
- package/dist/cjs/components/alert.d.ts +1 -0
- package/dist/cjs/components/alert.js +1 -1
- package/dist/cjs/components/alert.js.map +2 -2
- package/dist/cjs/components/checkbox.js +1 -1
- package/dist/cjs/components/checkbox.js.map +2 -2
- package/dist/cjs/components/dialog.js +1 -1
- package/dist/cjs/components/dialog.js.map +3 -3
- package/dist/cjs/components/index.d.ts +1 -0
- package/dist/cjs/components/index.js +1 -1
- package/dist/cjs/components/index.js.map +3 -3
- package/dist/cjs/components/otp-input.d.ts +18 -0
- package/dist/cjs/components/otp-input.js +2 -0
- package/dist/cjs/components/otp-input.js.map +7 -0
- package/dist/cjs/helpers/utils.d.ts +7 -1
- package/dist/cjs/helpers/utils.js +1 -1
- package/dist/cjs/helpers/utils.js.map +3 -3
- package/dist/esm/biz-components/BuyOneGetOneShelf/ProductCard.d.ts +1 -1
- package/dist/esm/biz-components/BuyOneGetOneShelf/ProductCard.js +1 -1
- package/dist/esm/biz-components/BuyOneGetOneShelf/ProductCard.js.map +3 -3
- package/dist/esm/biz-components/BuyOneGetOneShelf/context.d.ts +4 -0
- package/dist/esm/biz-components/BuyOneGetOneShelf/context.js +2 -0
- package/dist/esm/biz-components/BuyOneGetOneShelf/context.js.map +7 -0
- package/dist/esm/biz-components/BuyOneGetOneShelf/types.d.ts +1 -1
- package/dist/esm/biz-components/BuyOneGetOneShelf/types.js.map +1 -1
- package/dist/esm/biz-components/FooterNavigation/index.js +1 -1
- package/dist/esm/biz-components/FooterNavigation/index.js.map +2 -2
- package/dist/esm/biz-components/ShelfDisplay/shelfDisplayItem.js +1 -1
- package/dist/esm/biz-components/ShelfDisplay/shelfDisplayItem.js.map +3 -3
- package/dist/esm/components/alert.d.ts +1 -0
- package/dist/esm/components/alert.js +1 -1
- package/dist/esm/components/alert.js.map +2 -2
- package/dist/esm/components/checkbox.js +1 -1
- package/dist/esm/components/checkbox.js.map +2 -2
- package/dist/esm/components/dialog.js +1 -1
- package/dist/esm/components/dialog.js.map +3 -3
- package/dist/esm/components/index.d.ts +1 -0
- package/dist/esm/components/index.js +1 -1
- package/dist/esm/components/index.js.map +2 -2
- package/dist/esm/components/otp-input.d.ts +18 -0
- package/dist/esm/components/otp-input.js +2 -0
- package/dist/esm/components/otp-input.js.map +7 -0
- package/dist/esm/helpers/utils.d.ts +7 -1
- package/dist/esm/helpers/utils.js +1 -1
- package/dist/esm/helpers/utils.js.map +3 -3
- package/package.json +1 -1
- package/style.css +42 -3
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var s=Object.defineProperty;var
|
|
1
|
+
"use strict";var s=Object.defineProperty;var l=Object.getOwnPropertyDescriptor;var u=Object.getOwnPropertyNames;var f=Object.prototype.hasOwnProperty;var h=(t,e)=>{for(var r in e)s(t,r,{get:e[r],enumerable:!0})},$=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of u(e))!f.call(t,i)&&i!==r&&s(t,i,{get:()=>e[i],enumerable:!(n=l(e,i))||n.enumerable});return t};var a=t=>$(s({},"__esModule",{value:!0}),t);var j={};h(j,{atobID:()=>p,cn:()=>y,getLocalizedPath:()=>R,highlightSearchWord:()=>S,noop:()=>b,spaceToHyphen:()=>W});module.exports=a(j);var c=require("clsx"),x=require("tailwind-merge");const d=(0,x.extendTailwindMerge)({extend:{theme:{borderRadius:["btn"]},classGroups:{"font-size":["text-heading-1","text-heading-2","text-heading-3","text-heading-4","text-heading-5","text-text-3","text-text-2","text-text-1"],"text-color":["text-info-primary","text-info-secondary","text-info-tertiary","text-info-quaternary","text-info-white"],leading:["leading-tight","leading-normal","leading-loose"]}}});function y(...t){return d((0,c.clsx)(t))}function b(){}function p(t){return t&&typeof t=="string"&&t.includes("/")?t.split("/").pop()?.split("?")?.shift():t}const W=t=>t?.replace(/\s+/g,"-"),w=t=>t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),S=(t,e)=>{try{if(!t||!e)return t;const r=w(e),n=new RegExp(r,"gi");return t.replace(n,i=>`<span class='text-brand-0 font-bold'>${i}</span>`)}catch(r){return console.error("highlightSearchWord error:",r),t}},R=(t,e,r)=>{if(!t)return t;if(t.startsWith("http://")||t.startsWith("https://")||t.startsWith("#"))return r?t.includes("?")?`${t}&${r}`:`${t}?${r}`:t;const n=t.split("/").filter(Boolean);if(n.length===0){const o=e==="us"?"/":`/${e}`;return r?`${o}?${r}`:o}if(n[0]===e){const o=`/${n.join("/")}`;return r?`${o}?${r}`:o}const g=`${e==="us"?"":`/${e}`}/${n.join("/")}`;return r?`${g}?${r}`:g};
|
|
2
2
|
//# sourceMappingURL=utils.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/helpers/utils.ts"],
|
|
4
|
-
"sourcesContent": ["import { clsx, type ClassValue } from 'clsx'\nimport { extendTailwindMerge } from 'tailwind-merge'\n\nconst twMerge = extendTailwindMerge({\n extend: {\n theme: {\n borderRadius: ['btn'],\n },\n classGroups: {\n 'font-size': [\n 'text-heading-1',\n 'text-heading-2',\n 'text-heading-3',\n 'text-heading-4',\n 'text-heading-5',\n 'text-text-3',\n 'text-text-2',\n 'text-text-1',\n ],\n 'text-color': [\n 'text-info-primary',\n 'text-info-secondary',\n 'text-info-tertiary',\n 'text-info-quaternary',\n 'text-info-white',\n ],\n leading: ['leading-tight', 'leading-normal', 'leading-loose'],\n },\n },\n})\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs))\n}\n\nexport function noop(): any {}\n\nexport function atobID(id: string) {\n if (id && typeof id === 'string' && id.includes('/')) {\n return id.split('/').pop()?.split('?')?.shift()\n } else {\n return id\n }\n}\nexport const spaceToHyphen = (str: string) => str?.replace(/\\s+/g, '-')\n\n/**\n * \u8F6C\u4E49\u6B63\u5219\u8868\u8FBE\u5F0F\u7279\u6B8A\u5B57\u7B26\n * @param str \u9700\u8981\u8F6C\u4E49\u7684\u5B57\u7B26\u4E32\n * @returns \u8F6C\u4E49\u540E\u7684\u5B57\u7B26\u4E32\n */\nconst escapeRegExp = (str: string): string => {\n return str.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\$&')\n}\n\n/**\n * \u9AD8\u4EAE\u641C\u7D22\u5173\u952E\u8BCD\n * @param text \u539F\u59CB\u6587\u672C\n * @param searchText \u641C\u7D22\u5173\u952E\u8BCD\n * @returns \u9AD8\u4EAE\u540E\u7684 HTML \u5B57\u7B26\u4E32\n */\nexport const highlightSearchWord = (text: string, searchText: string) => {\n try {\n if (!text || !searchText) {\n return text\n }\n\n // \u8F6C\u4E49\u641C\u7D22\u6587\u672C\u4E2D\u7684\u6B63\u5219\u8868\u8FBE\u5F0F\u7279\u6B8A\u5B57\u7B26\n const escapedSearchText = escapeRegExp(searchText)\n const regex = new RegExp(escapedSearchText, 'gi')\n\n // \u4F7F\u7528\u6B63\u5219\u8868\u8FBE\u5F0F\u7684\u5339\u914D\u7ED3\u679C\u6765\u4FDD\u6301\u539F\u59CB\u5927\u5C0F\u5199\n return text.replace(regex, match => `<span class='text-brand-0 font-bold'>${match}</span>`)\n } catch (e) {\n console.error('highlightSearchWord error:', e)\n return text\n }\n}\n\n/**\n * \u83B7\u53D6\u672C\u5730\u5316\u8DEF\u5F84\n *\n * \u6839\u636E\u8BED\u8A00\u6807\u8BC6\u4E3A\u8DEF\u5F84\u6DFB\u52A0\u5BF9\u5E94\u7684 locale \u524D\u7F00\u3002\n * - 'us' \u4E3A\u9ED8\u8BA4\u8BED\u8A00\uFF0C\u4E0D\u6DFB\u52A0\u524D\u7F00\n * - \u5176\u4ED6\u8BED\u8A00\u4F1A\u6DFB\u52A0 `/{locale}` \u524D\u7F00\n * - \u5B8C\u6574 URL\uFF08http/https\uFF09\u4E0D\u505A\u5904\u7406\n * - \u81EA\u52A8\u5904\u7406\u8DEF\u5F84\u683C\u5F0F\uFF08\u8865\u5145\u524D\u5BFC\u659C\u6760\u3001\u79FB\u9664\u5C3E\u90E8\u659C\u6760\uFF09\n *\n * @param path - \u539F\u59CB\u8DEF\u5F84\n * @param locale - \u8BED\u8A00\u6807\u8BC6\uFF08\u5982 'us', 'uk', 'de', 'jp' \u7B49\uFF09\n * @returns \u672C\u5730\u5316\u540E\u7684\u8DEF\u5F84\n *\n * @example\n * // \u57FA\u672C\u7528\u6CD5 - \u9ED8\u8BA4\u8BED\u8A00 'us' \u4E0D\u6DFB\u52A0\u524D\u7F00\n * getLocalizedPath('/products', 'us') // => '/products'\n * getLocalizedPath('/about', 'us') // => '/about'\n *\n * @example\n * // \u5176\u4ED6\u8BED\u8A00\u6DFB\u52A0\u524D\u7F00\n * getLocalizedPath('/products', 'uk') // => '/uk/products'\n * getLocalizedPath('/about/team', 'de') // => '/de/about/team'\n * getLocalizedPath('/contact', 'jp') // => '/jp/contact'\n *\n * @example\n * // \u6839\u8DEF\u5F84\u5904\u7406\n * getLocalizedPath('/', 'us') // => '/'\n * getLocalizedPath('/', 'uk') // => '/uk'\n *\n * @example\n * // \u81EA\u52A8\u683C\u5F0F\u5316\u8DEF\u5F84\n * getLocalizedPath('products', 'uk') // => '/uk/products' (\u8865\u5145\u524D\u5BFC\u659C\u6760)\n * getLocalizedPath('/products/', 'uk') // => '/uk/products' (\u79FB\u9664\u5C3E\u90E8\u659C\u6760)\n * getLocalizedPath('//products//detail/', 'uk') // => '/uk/products/detail' (\u79FB\u9664\u591A\u4F59\u659C\u6760)\n *\n * @example\n * // \u5DF2\u5305\u542B locale \u7684\u8DEF\u5F84\u4E0D\u91CD\u590D\u6DFB\u52A0\n * getLocalizedPath('/uk/products', 'uk') // => '/uk/products'\n *\n * @example\n * // \u5B8C\u6574 URL \u4E0D\u5904\u7406\n * getLocalizedPath('https://example.com/page', 'uk') // => 'https://example.com/page'\n * getLocalizedPath('http://example.com', 'de') // => 'http://example.com'\n *\n * @example\n * // \u7A7A\u8DEF\u5F84\u5904\u7406\n * getLocalizedPath('', 'uk') // => ''\n */\nexport const getLocalizedPath = (path: string, locale: string): string => {\n if (!path) return path\n\n // \u5982\u679C\u662F\u5B8C\u6574 URL\uFF08http:// \u6216 https://\uFF09\u6216\u951A\u70B9\u94FE\u63A5\uFF08#\uFF09\uFF0C\u4E0D\u5904\u7406\n if (path.startsWith('http://') || path.startsWith('https://') || path.startsWith('#')) {\n return path\n }\n\n // \u5206\u5272\u8DEF\u5F84\u5E76\u8FC7\u6EE4\u7A7A\u6BB5\uFF08\u5904\u7406\u591A\u4E2A\u8FDE\u7EED\u659C\u6760\u7684\u60C5\u51B5\uFF09\n const pathSegments = path.split('/').filter(Boolean)\n\n // \u5982\u679C\u6CA1\u6709\u6709\u6548\u8DEF\u5F84\u6BB5\uFF0C\u8FD4\u56DE locale \u524D\u7F00\u6216 '/'\n if (pathSegments.length === 0) {\n
|
|
5
|
-
"mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,YAAAE,EAAA,OAAAC,EAAA,qBAAAC,EAAA,wBAAAC,EAAA,SAAAC,EAAA,kBAAAC,IAAA,eAAAC,EAAAR,GAAA,IAAAS,EAAsC,gBACtCC,EAAoC,0BAEpC,MAAMC,KAAU,uBAAoB,CAClC,OAAQ,CACN,MAAO,CACL,aAAc,CAAC,KAAK,CACtB,EACA,YAAa,CACX,YAAa,CACX,iBACA,iBACA,iBACA,iBACA,iBACA,cACA,cACA,aACF,EACA,aAAc,CACZ,oBACA,sBACA,qBACA,uBACA,iBACF,EACA,QAAS,CAAC,gBAAiB,iBAAkB,eAAe,CAC9D,CACF,CACF,CAAC,EAEM,SAASR,KAAMS,EAAsB,CAC1C,OAAOD,KAAQ,QAAKC,CAAM,CAAC,CAC7B,CAEO,SAASN,GAAY,CAAC,CAEtB,SAASJ,EAAOW,EAAY,CACjC,OAAIA,GAAM,OAAOA,GAAO,UAAYA,EAAG,SAAS,GAAG,EAC1CA,EAAG,MAAM,GAAG,EAAE,IAAI,GAAG,MAAM,GAAG,GAAG,MAAM,EAEvCA,CAEX,CACO,MAAMN,EAAiBO,GAAgBA,GAAK,QAAQ,OAAQ,GAAG,EAOhEC,EAAgBD,GACbA,EAAI,QAAQ,sBAAuB,MAAM,EASrCT,EAAsB,CAACW,EAAcC,IAAuB,CACvE,GAAI,CACF,GAAI,CAACD,GAAQ,CAACC,EACZ,OAAOD,EAIT,MAAME,EAAoBH,EAAaE,CAAU,EAC3CE,EAAQ,IAAI,OAAOD,EAAmB,IAAI,EAGhD,OAAOF,EAAK,QAAQG,EAAOC,GAAS,wCAAwCA,CAAK,SAAS,CAC5F,OAASC,EAAG,CACV,eAAQ,MAAM,6BAA8BA,CAAC,EACtCL,CACT,CACF,
|
|
6
|
-
"names": ["utils_exports", "__export", "atobID", "cn", "getLocalizedPath", "highlightSearchWord", "noop", "spaceToHyphen", "__toCommonJS", "import_clsx", "import_tailwind_merge", "twMerge", "inputs", "id", "str", "escapeRegExp", "text", "searchText", "escapedSearchText", "regex", "match", "e", "path", "locale", "pathSegments"]
|
|
4
|
+
"sourcesContent": ["import { clsx, type ClassValue } from 'clsx'\nimport { extendTailwindMerge } from 'tailwind-merge'\n\nconst twMerge = extendTailwindMerge({\n extend: {\n theme: {\n borderRadius: ['btn'],\n },\n classGroups: {\n 'font-size': [\n 'text-heading-1',\n 'text-heading-2',\n 'text-heading-3',\n 'text-heading-4',\n 'text-heading-5',\n 'text-text-3',\n 'text-text-2',\n 'text-text-1',\n ],\n 'text-color': [\n 'text-info-primary',\n 'text-info-secondary',\n 'text-info-tertiary',\n 'text-info-quaternary',\n 'text-info-white',\n ],\n leading: ['leading-tight', 'leading-normal', 'leading-loose'],\n },\n },\n})\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs))\n}\n\nexport function noop(): any {}\n\nexport function atobID(id: string) {\n if (id && typeof id === 'string' && id.includes('/')) {\n return id.split('/').pop()?.split('?')?.shift()\n } else {\n return id\n }\n}\nexport const spaceToHyphen = (str: string) => str?.replace(/\\s+/g, '-')\n\n/**\n * \u8F6C\u4E49\u6B63\u5219\u8868\u8FBE\u5F0F\u7279\u6B8A\u5B57\u7B26\n * @param str \u9700\u8981\u8F6C\u4E49\u7684\u5B57\u7B26\u4E32\n * @returns \u8F6C\u4E49\u540E\u7684\u5B57\u7B26\u4E32\n */\nconst escapeRegExp = (str: string): string => {\n return str.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\$&')\n}\n\n/**\n * \u9AD8\u4EAE\u641C\u7D22\u5173\u952E\u8BCD\n * @param text \u539F\u59CB\u6587\u672C\n * @param searchText \u641C\u7D22\u5173\u952E\u8BCD\n * @returns \u9AD8\u4EAE\u540E\u7684 HTML \u5B57\u7B26\u4E32\n */\nexport const highlightSearchWord = (text: string, searchText: string) => {\n try {\n if (!text || !searchText) {\n return text\n }\n\n // \u8F6C\u4E49\u641C\u7D22\u6587\u672C\u4E2D\u7684\u6B63\u5219\u8868\u8FBE\u5F0F\u7279\u6B8A\u5B57\u7B26\n const escapedSearchText = escapeRegExp(searchText)\n const regex = new RegExp(escapedSearchText, 'gi')\n\n // \u4F7F\u7528\u6B63\u5219\u8868\u8FBE\u5F0F\u7684\u5339\u914D\u7ED3\u679C\u6765\u4FDD\u6301\u539F\u59CB\u5927\u5C0F\u5199\n return text.replace(regex, match => `<span class='text-brand-0 font-bold'>${match}</span>`)\n } catch (e) {\n console.error('highlightSearchWord error:', e)\n return text\n }\n}\n\n/**\n * \u83B7\u53D6\u672C\u5730\u5316\u8DEF\u5F84\n *\n * \u6839\u636E\u8BED\u8A00\u6807\u8BC6\u4E3A\u8DEF\u5F84\u6DFB\u52A0\u5BF9\u5E94\u7684 locale \u524D\u7F00\u3002\n * - 'us' \u4E3A\u9ED8\u8BA4\u8BED\u8A00\uFF0C\u4E0D\u6DFB\u52A0\u524D\u7F00\n * - \u5176\u4ED6\u8BED\u8A00\u4F1A\u6DFB\u52A0 `/{locale}` \u524D\u7F00\n * - \u5B8C\u6574 URL\uFF08http/https\uFF09\u4E0D\u505A\u5904\u7406\n * - \u81EA\u52A8\u5904\u7406\u8DEF\u5F84\u683C\u5F0F\uFF08\u8865\u5145\u524D\u5BFC\u659C\u6760\u3001\u79FB\u9664\u5C3E\u90E8\u659C\u6760\uFF09\n *\n * @param path - \u539F\u59CB\u8DEF\u5F84\n * @param locale - \u8BED\u8A00\u6807\u8BC6\uFF08\u5982 'us', 'uk', 'de', 'jp' \u7B49\uFF09\n * @returns \u672C\u5730\u5316\u540E\u7684\u8DEF\u5F84\n *\n * @example\n * // \u57FA\u672C\u7528\u6CD5 - \u9ED8\u8BA4\u8BED\u8A00 'us' \u4E0D\u6DFB\u52A0\u524D\u7F00\n * getLocalizedPath('/products', 'us') // => '/products'\n * getLocalizedPath('/about', 'us') // => '/about'\n *\n * @example\n * // \u5176\u4ED6\u8BED\u8A00\u6DFB\u52A0\u524D\u7F00\n * getLocalizedPath('/products', 'uk') // => '/uk/products'\n * getLocalizedPath('/about/team', 'de') // => '/de/about/team'\n * getLocalizedPath('/contact', 'jp') // => '/jp/contact'\n *\n * @example\n * // \u6839\u8DEF\u5F84\u5904\u7406\n * getLocalizedPath('/', 'us') // => '/'\n * getLocalizedPath('/', 'uk') // => '/uk'\n *\n * @example\n * // \u81EA\u52A8\u683C\u5F0F\u5316\u8DEF\u5F84\n * getLocalizedPath('products', 'uk') // => '/uk/products' (\u8865\u5145\u524D\u5BFC\u659C\u6760)\n * getLocalizedPath('/products/', 'uk') // => '/uk/products' (\u79FB\u9664\u5C3E\u90E8\u659C\u6760)\n * getLocalizedPath('//products//detail/', 'uk') // => '/uk/products/detail' (\u79FB\u9664\u591A\u4F59\u659C\u6760)\n *\n * @example\n * // \u5DF2\u5305\u542B locale \u7684\u8DEF\u5F84\u4E0D\u91CD\u590D\u6DFB\u52A0\n * getLocalizedPath('/uk/products', 'uk') // => '/uk/products'\n *\n * @example\n * // \u5B8C\u6574 URL \u4E0D\u5904\u7406\n * getLocalizedPath('https://example.com/page', 'uk') // => 'https://example.com/page'\n * getLocalizedPath('http://example.com', 'de') // => 'http://example.com'\n *\n * @example\n * // \u7A7A\u8DEF\u5F84\u5904\u7406\n * getLocalizedPath('', 'uk') // => ''\n *\n * @example\n * // appendParams \u4F1A\u81EA\u52A8\u5224\u65AD\u7528 ? \u8FD8\u662F &\n * getLocalizedPath('/products', 'us', 'ref=footer') // => '/products?ref=footer'\n * getLocalizedPath('https://example.com/page', 'us', 'ref=footer') // => 'https://example.com/page?ref=footer'\n * getLocalizedPath('https://example.com/page?app=foo', 'us', 'ref=footer') // => 'https://example.com/page?app=foo&ref=footer'\n */\nexport const getLocalizedPath = (path: string, locale: string, appendParams?: string): string => {\n if (!path) return path\n\n // \u5982\u679C\u662F\u5B8C\u6574 URL\uFF08http:// \u6216 https://\uFF09\u6216\u951A\u70B9\u94FE\u63A5\uFF08#\uFF09\uFF0C\u4E0D\u5904\u7406 locale\uFF0C\u4F46\u9700\u5904\u7406 appendParams\n if (path.startsWith('http://') || path.startsWith('https://') || path.startsWith('#')) {\n if (!appendParams) return path\n return path.includes('?') ? `${path}&${appendParams}` : `${path}?${appendParams}`\n }\n\n // \u5206\u5272\u8DEF\u5F84\u5E76\u8FC7\u6EE4\u7A7A\u6BB5\uFF08\u5904\u7406\u591A\u4E2A\u8FDE\u7EED\u659C\u6760\u7684\u60C5\u51B5\uFF09\n const pathSegments = path.split('/').filter(Boolean)\n\n // \u5982\u679C\u6CA1\u6709\u6709\u6548\u8DEF\u5F84\u6BB5\uFF0C\u8FD4\u56DE locale \u524D\u7F00\u6216 '/'\n if (pathSegments.length === 0) {\n const base = locale === 'us' ? '/' : `/${locale}`\n return appendParams ? `${base}?${appendParams}` : base\n }\n\n // \u68C0\u67E5\u8DEF\u5F84\u662F\u5426\u5DF2\u7ECF\u5305\u542B locale\n if (pathSegments[0] === locale) {\n const base = `/${pathSegments.join('/')}`\n return appendParams ? `${base}?${appendParams}` : base\n }\n\n // \u83B7\u53D6 locale \u524D\u7F00\u5E76\u62FC\u63A5\n const localePrefix = locale === 'us' ? '' : `/${locale}`\n const base = `${localePrefix}/${pathSegments.join('/')}`\n return appendParams ? `${base}?${appendParams}` : base\n}\n"],
|
|
5
|
+
"mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,YAAAE,EAAA,OAAAC,EAAA,qBAAAC,EAAA,wBAAAC,EAAA,SAAAC,EAAA,kBAAAC,IAAA,eAAAC,EAAAR,GAAA,IAAAS,EAAsC,gBACtCC,EAAoC,0BAEpC,MAAMC,KAAU,uBAAoB,CAClC,OAAQ,CACN,MAAO,CACL,aAAc,CAAC,KAAK,CACtB,EACA,YAAa,CACX,YAAa,CACX,iBACA,iBACA,iBACA,iBACA,iBACA,cACA,cACA,aACF,EACA,aAAc,CACZ,oBACA,sBACA,qBACA,uBACA,iBACF,EACA,QAAS,CAAC,gBAAiB,iBAAkB,eAAe,CAC9D,CACF,CACF,CAAC,EAEM,SAASR,KAAMS,EAAsB,CAC1C,OAAOD,KAAQ,QAAKC,CAAM,CAAC,CAC7B,CAEO,SAASN,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,IAAW,KAAO,GAAK,IAAIA,CAAM,EAC1B,IAAIE,EAAa,KAAK,GAAG,CAAC,GACtD,OAAOD,EAAe,GAAGE,CAAI,IAAIF,CAAY,GAAKE,CACpD",
|
|
6
|
+
"names": ["utils_exports", "__export", "atobID", "cn", "getLocalizedPath", "highlightSearchWord", "noop", "spaceToHyphen", "__toCommonJS", "import_clsx", "import_tailwind_merge", "twMerge", "inputs", "id", "str", "escapeRegExp", "text", "searchText", "escapedSearchText", "regex", "match", "e", "path", "locale", "appendParams", "pathSegments", "base"]
|
|
7
7
|
}
|
|
@@ -13,7 +13,7 @@ export interface ProductCardProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
|
13
13
|
tags?: ProductTag[];
|
|
14
14
|
/** 当前选中的赠品SKU(受控组件) */
|
|
15
15
|
selectedGiftSku?: string;
|
|
16
|
-
/**
|
|
16
|
+
/** @deprecated Layout is now automatically inferred by Root based on children count. */
|
|
17
17
|
layout?: 'horizontal' | 'vertical';
|
|
18
18
|
classNames?: Partial<Record<BuyOneGetOneShelfProductCardSemanticName, string>>;
|
|
19
19
|
soldOutText?: string;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use client";import{jsx as a,jsxs as
|
|
1
|
+
"use client";import{jsx as a,jsxs as v}from"react/jsx-runtime";import*as n from"react";import{cn as y}from"../../helpers/index.js";import _ from"./ProductImage.js";import $ from"./ProductInfo.js";import q from"./GiftSelection.js";import J from"./PriceAndActions.js";import{BuyOneGetOneShelfContext as K}from"./context.js";const w=n.forwardRef(({productData:e,gifts:r=[],giftType:i=1,selectedGiftSku:L,sceneImages:g,tags:F,layout:N,className:M,onProductClick:p,onProductImageClick:G,onLearnMore:O,onShopNow:I,onGiftClick:h,onGiftSelectionChange:T,classNames:S,soldOutText:H,...B},R)=>{const{layout:j}=n.useContext(K),u=N??j,[z,P]=n.useState(!1),[A,x]=n.useState(!1),[b,d]=n.useState(()=>!r||r.length===0?[]:i===2?r.map(t=>t.id):[r[0].id]),c=n.useMemo(()=>r?r.map(t=>({...t,selected:b.includes(t.id)})):[],[r,b]);n.useEffect(()=>{if(!r||r.length===0){d([]);return}d(i===2?r.map(t=>t.id):t=>{const o=t[0];return o&&r.some(m=>m.id===o)?[o]:[r[0].id]})},[r,i]);const s=n.useMemo(()=>({...e,gifts:r,gift_type:i}),[e,r,i]),E=t=>{if(i===2){const o=c.filter(l=>l.selected);h?.(t,o);return}d(()=>{const o=[t.id],l=r?.filter(m=>o.includes(m.id))||[];return h?.(t,l),T?.(l,s),o})},f=!!(G??p),C=`/products/${e.handle}`,k=()=>{(G??p)?.(s)},W=async()=>{const t=c.filter(o=>o.selected);P(!0);try{await O?.(s,t)}finally{P(!1)}},V=async()=>{const t=c.filter(o=>o.selected);x(!0);try{await I?.(s,t)}finally{x(!1)}};return v("div",{ref:R,className:y("bg-container-primary rounded-box flex items-stretch overflow-hidden",u==="horizontal"?["laptop:flex-row lg-desktop:min-h-[560px] desktop:min-h-[448px] tablet:min-h-[526px] min-h-[610px] flex-col","laptop:col-span-2"]:["flex-col justify-between"],M),...B,children:[a(_,{images:g,name:e.name,layout:u,tags:e.tags||F,onClick:f?k:void 0,href:f?void 0:C}),a("div",{className:y("bg-container-primary desktop:p-6 flex flex-col justify-between p-4",u==="horizontal"?["rounded-r-box laptop:rounded-r-box tablet:rounded-b-box tablet:rounded-l-none","laptop:basis-[39.1%]","desktop:basis-[42.1%]","lg-desktop:basis-[42.1%]","shrink-0"]:["rounded-b-box","w-full","grow"]),children:v("div",{className:"flex flex-1 flex-col justify-between gap-6",children:[a($,{name:e.name,onClick:f?k:void 0,href:f?void 0:C,description:e.description,classNames:S}),a(q,{freeGiftLabel:e.freeGiftLabel,freeGifts:c,onGiftClick:E,giftType:i,selectedGiftSku:L}),a(J,{currentPrice:e.currentPrice??"",originalPrice:e.originalPrice,priceLabel:e.priceLabel,learnMoreText:e.learnMoreText,shopNowText:e.shopNowText,soldOutText:H,onLearnMore:W,onShopNow:V,availableForSale:e.availableForSale,learnMoreLoading:z,shopNowLoading:A,trackingTitle:e.name,trackingDescription:e.description,trackingSku:e.sku,classNames:S})]})})]})});w.displayName="BuyOneGetOneShelf.ProductCard";var ee=w;export{ee as default};
|
|
2
2
|
//# sourceMappingURL=ProductCard.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/biz-components/BuyOneGetOneShelf/ProductCard.tsx"],
|
|
4
|
-
"sourcesContent": ["'use client'\n\nimport * as React from 'react'\nimport { cn } from '../../helpers/index.js'\nimport ProductImage from './ProductImage.js'\nimport ProductInfo from './ProductInfo.js'\nimport GiftSelection from './GiftSelection.js'\nimport PriceAndActions from './PriceAndActions.js'\nimport type {\n FreeGift,\n FreeGiftWithSelection,\n ProductCardData,\n PureProductData,\n ProductTag,\n BuyOneGetOneShelfProductCardSemanticName,\n} from './types.js'\n\nexport interface ProductCardProps extends React.HTMLAttributes<HTMLDivElement> {\n /** \u4EA7\u54C1\u6570\u636E\uFF08\u4E0D\u5305\u542B\u8D60\u54C1\u4FE1\u606F\uFF09 */\n productData: PureProductData\n /** \u8D60\u54C1\u5217\u8868 */\n gifts?: FreeGift[]\n /** \u8D60\u54C1\u7C7B\u578B 1-> \u8D60\u9001\u5176\u4E2D\u4E00\u4E2A\u8D60\u54C1\uFF0C 2 -> \u8D60\u9001\u6240\u6709\u8D60\u54C1 */\n giftType?: 1 | 2\n /** \u573A\u666F\u56FE\u7247 */\n sceneImages: any\n /** \u4EA7\u54C1\u6807\u7B7E */\n tags?: ProductTag[]\n /** \u5F53\u524D\u9009\u4E2D\u7684\u8D60\u54C1SKU\uFF08\u53D7\u63A7\u7EC4\u4EF6\uFF09 */\n selectedGiftSku?: string\n /** \u5E03\u5C40\u6A21\u5F0F */\n layout?: 'horizontal' | 'vertical'\n classNames?: Partial<Record<BuyOneGetOneShelfProductCardSemanticName, string>>\n soldOutText?: string\n /** @deprecated Use `onProductImageClick` instead. */\n onProductClick?: (product: ProductCardData) => void\n /** \u4EA7\u54C1\u56FE\u7247\u70B9\u51FB\u56DE\u8C03 */\n onProductImageClick?: (product: ProductCardData) => void\n /** Learn More \u70B9\u51FB\u56DE\u8C03 */\n onLearnMore?: (product: ProductCardData, selectedGifts: FreeGift[]) => void\n /** Shop Now \u70B9\u51FB\u56DE\u8C03 */\n onShopNow?: (product: ProductCardData, selectedGifts: FreeGift[]) => void\n /** \u8D60\u54C1\u70B9\u51FB\u56DE\u8C03 */\n onGiftClick?: (gift: FreeGift, selectedGifts: FreeGift[]) => void\n /** \u8D60\u54C1\u9009\u62E9\u53D8\u5316\u56DE\u8C03 */\n onGiftSelectionChange?: (selectedGifts: FreeGift[], product: ProductCardData) => void\n /** \u9009\u4E2D\u8D60\u54C1SKU\u53D8\u5316\u56DE\u8C03\uFF08\u53D7\u63A7\u7EC4\u4EF6\uFF09 */\n onSelectedGiftSkuChange?: (selectedSku: string | null) => void\n}\n\n/**\n * ProductCard - \u4E70\u8D60\u8D27\u67B6\u4EA7\u54C1\u5361\u7247\n *\n * @description \u7528\u4E8E\u4E70\u4E00\u8D60\u4E00\u6D3B\u52A8\u7684\u4EA7\u54C1\u5C55\u793A\u5361\u7247\uFF0C\u5DE6\u4FA7\u5C55\u793A\u4EA7\u54C1\u56FE\u7247\u548C\u6807\u7B7E\uFF0C\u53F3\u4FA7\u5C55\u793A\u4EA7\u54C1\u4FE1\u606F\u3001\u8D60\u54C1\u548C\u8D2D\u4E70\u6309\u94AE\n */\nconst ProductCard = React.forwardRef<HTMLDivElement, ProductCardProps>(\n (\n {\n productData,\n gifts = [],\n giftType = 1,\n selectedGiftSku,\n sceneImages,\n tags,\n layout = 'horizontal',\n className,\n onProductClick,\n onProductImageClick,\n onLearnMore,\n onShopNow,\n onGiftClick,\n onGiftSelectionChange,\n classNames,\n soldOutText,\n ...props\n },\n ref\n ) => {\n const [learnMoreLoading, setLearnMoreLoading] = React.useState(false)\n const [shopNowLoading, setShopNowLoading] = React.useState(false)\n\n // \u5185\u90E8\u72B6\u6001\u7BA1\u7406\u8D60\u54C1\u7684\u9009\u62E9\u72B6\u6001 - \u4F7F\u7528\u9009\u4E2D\u7684ID\u6570\u7EC4\u800C\u4E0D\u662F\u4FEE\u6539gift\u5BF9\u8C61\n const [selectedGiftIds, setSelectedGiftIds] = React.useState<string[]>(() => {\n if (!gifts || gifts.length === 0) return []\n\n if (giftType === 2) {\n // gift_type 2 (\u5168\u9009\u6A21\u5F0F) - \u9009\u4E2D\u6240\u6709\u8D60\u54C1\n return gifts.map((gift: FreeGift) => gift.id)\n } else {\n // gift_type 1 (\u5355\u9009\u6A21\u5F0F) - \u9ED8\u8BA4\u9009\u4E2D\u7B2C\u4E00\u4E2A\u8D60\u54C1\n return [gifts[0].id]\n }\n })\n\n // \u751F\u6210\u5E26\u6709\u9009\u62E9\u72B6\u6001\u7684\u8D60\u54C1\u5217\u8868\u7528\u4E8E\u6E32\u67D3\n const giftsWithSelection = React.useMemo(() => {\n if (!gifts) return []\n\n return gifts.map((gift: FreeGift) => ({\n ...gift,\n selected: selectedGiftIds.includes(gift.id),\n }))\n }, [gifts, selectedGiftIds])\n\n // \u5F53 gifts \u6216 giftType \u66F4\u65B0\u65F6\uFF0C\u540C\u6B65\u66F4\u65B0\u5185\u90E8\u72B6\u6001\n React.useEffect(() => {\n if (!gifts || gifts.length === 0) {\n setSelectedGiftIds([])\n return\n }\n\n if (giftType === 2) {\n // gift_type 2 (\u5168\u9009\u6A21\u5F0F) - \u9009\u4E2D\u6240\u6709\u8D60\u54C1\n setSelectedGiftIds(gifts.map((gift: FreeGift) => gift.id))\n } else {\n // gift_type 1 (\u5355\u9009\u6A21\u5F0F) - \u667A\u80FD\u72B6\u6001\u7BA1\u7406\n setSelectedGiftIds(prevSelectedIds => {\n // \u68C0\u67E5\u5F53\u524D\u9009\u4E2D\u7684\u793C\u54C1\u662F\u5426\u4ECD\u7136\u5B58\u5728\u4E8E\u65B0\u7684 gifts \u5217\u8868\u4E2D\n const currentSelectedId = prevSelectedIds[0]\n const isCurrentSelectionValid =\n currentSelectedId && gifts.some((gift: FreeGift) => gift.id === currentSelectedId)\n\n // \u5982\u679C\u5F53\u524D\u9009\u4E2D\u72B6\u6001\u4ECD\u7136\u6709\u6548\uFF0C\u4FDD\u6301\u4E0D\u53D8\uFF1B\u5426\u5219\u9ED8\u8BA4\u9009\u4E2D\u7B2C\u4E00\u4E2A\n return isCurrentSelectionValid ? [currentSelectedId] : [gifts[0].id]\n })\n }\n }, [gifts, giftType])\n\n // \u6784\u9020\u5B8C\u6574\u7684\u4EA7\u54C1\u6570\u636E\u7528\u4E8E\u56DE\u8C03\n const fullProductData: ProductCardData = React.useMemo(\n () => ({\n ...productData,\n gifts,\n gift_type: giftType,\n }),\n [productData, gifts, giftType]\n )\n\n const handleGiftClick = (gift: FreeGift) => {\n // gift_type 2 (\u5168\u9009\u6A21\u5F0F) - \u4E0D\u5141\u8BB8\u53D6\u6D88\u9009\u62E9\uFF0C\u76F4\u63A5\u8FD4\u56DE\n if (giftType === 2) {\n // \u83B7\u53D6\u5F53\u524D\u6240\u6709\u9009\u4E2D\u7684gifts\u4F5C\u4E3A\u7B2C\u4E8C\u4E2A\u53C2\u6570\n const currentSelectedGifts = giftsWithSelection.filter((g: FreeGiftWithSelection) => g.selected)\n onGiftClick?.(gift, currentSelectedGifts)\n return\n }\n\n // gift_type 1 (\u5355\u9009\u6A21\u5F0F)\n setSelectedGiftIds(() => {\n const newSelectedIds = [gift.id] // \u5355\u9009\uFF1A\u59CB\u7EC8\u9009\u4E2D\u5F53\u524D\u9879\uFF0C\u70B9\u51FB\u5DF2\u9009\u4E2D\u9879\u4FDD\u6301\u72B6\u6001\uFF0C\u70B9\u51FB\u672A\u9009\u4E2D\u9879\u5207\u6362\u5230\u8BE5\u9879\n\n // \u8BA1\u7B97\u65B0\u7684\u9009\u4E2Dgifts\u4F5C\u4E3A\u7B2C\u4E8C\u4E2A\u53C2\u6570\u4F20\u9012\u7ED9\u56DE\u8C03\n const newSelectedGifts = gifts?.filter((g: FreeGift) => newSelectedIds.includes(g.id)) || []\n\n // \u8C03\u7528\u56DE\u8C03\u51FD\u6570\uFF0C\u7B2C\u4E8C\u4E2A\u53C2\u6570\u662F\u5F53\u524D\u9009\u4E2D\u7684gifts\n onGiftClick?.(gift, newSelectedGifts)\n onGiftSelectionChange?.(newSelectedGifts, fullProductData)\n\n return newSelectedIds\n })\n }\n\n const hasClickHandler = !!(onProductImageClick ?? onProductClick)\n const productHref = `/products/${productData.handle}`\n\n const handleProductImageClick = () => {\n const callback = onProductImageClick ?? onProductClick\n callback?.(fullProductData)\n }\n\n const handleLearnMoreClick = async () => {\n const selectedGifts = giftsWithSelection.filter(gift => gift.selected)\n setLearnMoreLoading(true)\n try {\n await onLearnMore?.(fullProductData, selectedGifts)\n } finally {\n setLearnMoreLoading(false)\n }\n }\n\n const handleShopNowClick = async () => {\n const selectedGifts = giftsWithSelection.filter(gift => gift.selected)\n setShopNowLoading(true)\n try {\n await onShopNow?.(fullProductData, selectedGifts)\n } finally {\n setShopNowLoading(false)\n }\n }\n\n return (\n <div\n ref={ref}\n className={cn(\n 'bg-container-primary rounded-box flex items-stretch overflow-hidden',\n // \u6839\u636E\u5E03\u5C40\u6A21\u5F0F\u8C03\u6574\u5BB9\u5668\n layout === 'horizontal'\n ? [\n 'laptop:flex-row lg-desktop:min-h-[560px] desktop:min-h-[448px] tablet:min-h-[526px] min-h-[610px] flex-col',\n 'laptop:col-span-2',\n ]\n : ['flex-col justify-between'],\n className\n )}\n {...props}\n >\n {/* \u4EA7\u54C1\u56FE\u7247\u533A\u57DF */}\n <ProductImage\n images={sceneImages}\n name={productData.name}\n layout={layout}\n tags={productData.tags || tags}\n onClick={hasClickHandler ? handleProductImageClick : undefined}\n href={hasClickHandler ? undefined : productHref}\n />\n\n {/* \u4EA7\u54C1\u4FE1\u606F\u533A\u57DF */}\n <div\n className={cn(\n 'bg-container-primary desktop:p-6 flex flex-col justify-between p-4',\n // \u6839\u636E\u5E03\u5C40\u6A21\u5F0F\u8C03\u6574\u5706\u89D2\u548C\u5C3A\u5BF8\n layout === 'horizontal'\n ? [\n 'rounded-r-box laptop:rounded-r-box tablet:rounded-b-box tablet:rounded-l-none',\n // \u4F7F\u7528 flex-basis \u8BBE\u7F6E\u5BBD\u5EA6\u6BD4\u4F8B\n 'laptop:basis-[39.1%]', // 360px / 921px \u2248 39.1%\n 'desktop:basis-[42.1%]', // 552px / 1312px \u2248 42.1%\n 'lg-desktop:basis-[42.1%]', // 700px / 1664px \u2248 42.1%\n 'shrink-0',\n ]\n : ['rounded-b-box', 'w-full', 'grow']\n )}\n >\n <div className=\"flex flex-1 flex-col justify-between gap-6\">\n {/* \u4EA7\u54C1\u6807\u9898\u548C\u63CF\u8FF0 */}\n <ProductInfo\n name={productData.name}\n onClick={hasClickHandler ? handleProductImageClick : undefined}\n href={hasClickHandler ? undefined : productHref}\n description={productData.description}\n classNames={classNames}\n />\n\n {/* \u514D\u8D39\u8D60\u54C1\u533A\u57DF */}\n <GiftSelection\n freeGiftLabel={productData.freeGiftLabel}\n freeGifts={giftsWithSelection}\n onGiftClick={handleGiftClick}\n giftType={giftType}\n selectedGiftSku={selectedGiftSku}\n />\n <PriceAndActions\n currentPrice={productData.currentPrice ?? ''}\n originalPrice={productData.originalPrice}\n priceLabel={productData.priceLabel}\n learnMoreText={productData.learnMoreText}\n shopNowText={productData.shopNowText}\n soldOutText={soldOutText}\n onLearnMore={handleLearnMoreClick}\n onShopNow={handleShopNowClick}\n availableForSale={productData.availableForSale}\n learnMoreLoading={learnMoreLoading}\n shopNowLoading={shopNowLoading}\n trackingTitle={productData.name}\n trackingDescription={productData.description}\n trackingSku={productData.sku}\n classNames={classNames}\n />\n </div>\n </div>\n </div>\n )\n }\n)\n\nProductCard.displayName = 'BuyOneGetOneShelf.ProductCard'\n\nexport default ProductCard\n"],
|
|
5
|
-
"mappings": "
|
|
6
|
-
"names": ["jsx", "jsxs", "React", "cn", "ProductImage", "ProductInfo", "GiftSelection", "PriceAndActions", "ProductCard", "productData", "gifts", "giftType", "selectedGiftSku", "sceneImages", "tags", "
|
|
4
|
+
"sourcesContent": ["'use client'\n\nimport * as React from 'react'\nimport { cn } from '../../helpers/index.js'\nimport ProductImage from './ProductImage.js'\nimport ProductInfo from './ProductInfo.js'\nimport GiftSelection from './GiftSelection.js'\nimport PriceAndActions from './PriceAndActions.js'\nimport { BuyOneGetOneShelfContext } from './context.js'\nimport type {\n FreeGift,\n FreeGiftWithSelection,\n ProductCardData,\n PureProductData,\n ProductTag,\n BuyOneGetOneShelfProductCardSemanticName,\n} from './types.js'\n\nexport interface ProductCardProps extends React.HTMLAttributes<HTMLDivElement> {\n /** \u4EA7\u54C1\u6570\u636E\uFF08\u4E0D\u5305\u542B\u8D60\u54C1\u4FE1\u606F\uFF09 */\n productData: PureProductData\n /** \u8D60\u54C1\u5217\u8868 */\n gifts?: FreeGift[]\n /** \u8D60\u54C1\u7C7B\u578B 1-> \u8D60\u9001\u5176\u4E2D\u4E00\u4E2A\u8D60\u54C1\uFF0C 2 -> \u8D60\u9001\u6240\u6709\u8D60\u54C1 */\n giftType?: 1 | 2\n /** \u573A\u666F\u56FE\u7247 */\n sceneImages: any\n /** \u4EA7\u54C1\u6807\u7B7E */\n tags?: ProductTag[]\n /** \u5F53\u524D\u9009\u4E2D\u7684\u8D60\u54C1SKU\uFF08\u53D7\u63A7\u7EC4\u4EF6\uFF09 */\n selectedGiftSku?: string\n /** @deprecated Layout is now automatically inferred by Root based on children count. */\n layout?: 'horizontal' | 'vertical'\n classNames?: Partial<Record<BuyOneGetOneShelfProductCardSemanticName, string>>\n soldOutText?: string\n /** @deprecated Use `onProductImageClick` instead. */\n onProductClick?: (product: ProductCardData) => void\n /** \u4EA7\u54C1\u56FE\u7247\u70B9\u51FB\u56DE\u8C03 */\n onProductImageClick?: (product: ProductCardData) => void\n /** Learn More \u70B9\u51FB\u56DE\u8C03 */\n onLearnMore?: (product: ProductCardData, selectedGifts: FreeGift[]) => void\n /** Shop Now \u70B9\u51FB\u56DE\u8C03 */\n onShopNow?: (product: ProductCardData, selectedGifts: FreeGift[]) => void\n /** \u8D60\u54C1\u70B9\u51FB\u56DE\u8C03 */\n onGiftClick?: (gift: FreeGift, selectedGifts: FreeGift[]) => void\n /** \u8D60\u54C1\u9009\u62E9\u53D8\u5316\u56DE\u8C03 */\n onGiftSelectionChange?: (selectedGifts: FreeGift[], product: ProductCardData) => void\n /** \u9009\u4E2D\u8D60\u54C1SKU\u53D8\u5316\u56DE\u8C03\uFF08\u53D7\u63A7\u7EC4\u4EF6\uFF09 */\n onSelectedGiftSkuChange?: (selectedSku: string | null) => void\n}\n\n/**\n * ProductCard - \u4E70\u8D60\u8D27\u67B6\u4EA7\u54C1\u5361\u7247\n *\n * @description \u7528\u4E8E\u4E70\u4E00\u8D60\u4E00\u6D3B\u52A8\u7684\u4EA7\u54C1\u5C55\u793A\u5361\u7247\uFF0C\u5DE6\u4FA7\u5C55\u793A\u4EA7\u54C1\u56FE\u7247\u548C\u6807\u7B7E\uFF0C\u53F3\u4FA7\u5C55\u793A\u4EA7\u54C1\u4FE1\u606F\u3001\u8D60\u54C1\u548C\u8D2D\u4E70\u6309\u94AE\n */\nconst ProductCard = React.forwardRef<HTMLDivElement, ProductCardProps>(\n (\n {\n productData,\n gifts = [],\n giftType = 1,\n selectedGiftSku,\n sceneImages,\n tags,\n layout: layoutProp,\n className,\n onProductClick,\n onProductImageClick,\n onLearnMore,\n onShopNow,\n onGiftClick,\n onGiftSelectionChange,\n classNames,\n soldOutText,\n ...props\n },\n ref\n ) => {\n const { layout: contextLayout } = React.useContext(BuyOneGetOneShelfContext)\n const layout = layoutProp ?? contextLayout\n\n const [learnMoreLoading, setLearnMoreLoading] = React.useState(false)\n const [shopNowLoading, setShopNowLoading] = React.useState(false)\n\n // \u5185\u90E8\u72B6\u6001\u7BA1\u7406\u8D60\u54C1\u7684\u9009\u62E9\u72B6\u6001 - \u4F7F\u7528\u9009\u4E2D\u7684ID\u6570\u7EC4\u800C\u4E0D\u662F\u4FEE\u6539gift\u5BF9\u8C61\n const [selectedGiftIds, setSelectedGiftIds] = React.useState<string[]>(() => {\n if (!gifts || gifts.length === 0) return []\n\n if (giftType === 2) {\n // gift_type 2 (\u5168\u9009\u6A21\u5F0F) - \u9009\u4E2D\u6240\u6709\u8D60\u54C1\n return gifts.map((gift: FreeGift) => gift.id)\n } else {\n // gift_type 1 (\u5355\u9009\u6A21\u5F0F) - \u9ED8\u8BA4\u9009\u4E2D\u7B2C\u4E00\u4E2A\u8D60\u54C1\n return [gifts[0].id]\n }\n })\n\n // \u751F\u6210\u5E26\u6709\u9009\u62E9\u72B6\u6001\u7684\u8D60\u54C1\u5217\u8868\u7528\u4E8E\u6E32\u67D3\n const giftsWithSelection = React.useMemo(() => {\n if (!gifts) return []\n\n return gifts.map((gift: FreeGift) => ({\n ...gift,\n selected: selectedGiftIds.includes(gift.id),\n }))\n }, [gifts, selectedGiftIds])\n\n // \u5F53 gifts \u6216 giftType \u66F4\u65B0\u65F6\uFF0C\u540C\u6B65\u66F4\u65B0\u5185\u90E8\u72B6\u6001\n React.useEffect(() => {\n if (!gifts || gifts.length === 0) {\n setSelectedGiftIds([])\n return\n }\n\n if (giftType === 2) {\n // gift_type 2 (\u5168\u9009\u6A21\u5F0F) - \u9009\u4E2D\u6240\u6709\u8D60\u54C1\n setSelectedGiftIds(gifts.map((gift: FreeGift) => gift.id))\n } else {\n // gift_type 1 (\u5355\u9009\u6A21\u5F0F) - \u667A\u80FD\u72B6\u6001\u7BA1\u7406\n setSelectedGiftIds(prevSelectedIds => {\n // \u68C0\u67E5\u5F53\u524D\u9009\u4E2D\u7684\u793C\u54C1\u662F\u5426\u4ECD\u7136\u5B58\u5728\u4E8E\u65B0\u7684 gifts \u5217\u8868\u4E2D\n const currentSelectedId = prevSelectedIds[0]\n const isCurrentSelectionValid =\n currentSelectedId && gifts.some((gift: FreeGift) => gift.id === currentSelectedId)\n\n // \u5982\u679C\u5F53\u524D\u9009\u4E2D\u72B6\u6001\u4ECD\u7136\u6709\u6548\uFF0C\u4FDD\u6301\u4E0D\u53D8\uFF1B\u5426\u5219\u9ED8\u8BA4\u9009\u4E2D\u7B2C\u4E00\u4E2A\n return isCurrentSelectionValid ? [currentSelectedId] : [gifts[0].id]\n })\n }\n }, [gifts, giftType])\n\n // \u6784\u9020\u5B8C\u6574\u7684\u4EA7\u54C1\u6570\u636E\u7528\u4E8E\u56DE\u8C03\n const fullProductData: ProductCardData = React.useMemo(\n () => ({\n ...productData,\n gifts,\n gift_type: giftType,\n }),\n [productData, gifts, giftType]\n )\n\n const handleGiftClick = (gift: FreeGift) => {\n // gift_type 2 (\u5168\u9009\u6A21\u5F0F) - \u4E0D\u5141\u8BB8\u53D6\u6D88\u9009\u62E9\uFF0C\u76F4\u63A5\u8FD4\u56DE\n if (giftType === 2) {\n // \u83B7\u53D6\u5F53\u524D\u6240\u6709\u9009\u4E2D\u7684gifts\u4F5C\u4E3A\u7B2C\u4E8C\u4E2A\u53C2\u6570\n const currentSelectedGifts = giftsWithSelection.filter((g: FreeGiftWithSelection) => g.selected)\n onGiftClick?.(gift, currentSelectedGifts)\n return\n }\n\n // gift_type 1 (\u5355\u9009\u6A21\u5F0F)\n setSelectedGiftIds(() => {\n const newSelectedIds = [gift.id] // \u5355\u9009\uFF1A\u59CB\u7EC8\u9009\u4E2D\u5F53\u524D\u9879\uFF0C\u70B9\u51FB\u5DF2\u9009\u4E2D\u9879\u4FDD\u6301\u72B6\u6001\uFF0C\u70B9\u51FB\u672A\u9009\u4E2D\u9879\u5207\u6362\u5230\u8BE5\u9879\n\n // \u8BA1\u7B97\u65B0\u7684\u9009\u4E2Dgifts\u4F5C\u4E3A\u7B2C\u4E8C\u4E2A\u53C2\u6570\u4F20\u9012\u7ED9\u56DE\u8C03\n const newSelectedGifts = gifts?.filter((g: FreeGift) => newSelectedIds.includes(g.id)) || []\n\n // \u8C03\u7528\u56DE\u8C03\u51FD\u6570\uFF0C\u7B2C\u4E8C\u4E2A\u53C2\u6570\u662F\u5F53\u524D\u9009\u4E2D\u7684gifts\n onGiftClick?.(gift, newSelectedGifts)\n onGiftSelectionChange?.(newSelectedGifts, fullProductData)\n\n return newSelectedIds\n })\n }\n\n const hasClickHandler = !!(onProductImageClick ?? onProductClick)\n const productHref = `/products/${productData.handle}`\n\n const handleProductImageClick = () => {\n const callback = onProductImageClick ?? onProductClick\n callback?.(fullProductData)\n }\n\n const handleLearnMoreClick = async () => {\n const selectedGifts = giftsWithSelection.filter(gift => gift.selected)\n setLearnMoreLoading(true)\n try {\n await onLearnMore?.(fullProductData, selectedGifts)\n } finally {\n setLearnMoreLoading(false)\n }\n }\n\n const handleShopNowClick = async () => {\n const selectedGifts = giftsWithSelection.filter(gift => gift.selected)\n setShopNowLoading(true)\n try {\n await onShopNow?.(fullProductData, selectedGifts)\n } finally {\n setShopNowLoading(false)\n }\n }\n\n return (\n <div\n ref={ref}\n className={cn(\n 'bg-container-primary rounded-box flex items-stretch overflow-hidden',\n // \u6839\u636E\u5E03\u5C40\u6A21\u5F0F\u8C03\u6574\u5BB9\u5668\n layout === 'horizontal'\n ? [\n 'laptop:flex-row lg-desktop:min-h-[560px] desktop:min-h-[448px] tablet:min-h-[526px] min-h-[610px] flex-col',\n 'laptop:col-span-2',\n ]\n : ['flex-col justify-between'],\n className\n )}\n {...props}\n >\n {/* \u4EA7\u54C1\u56FE\u7247\u533A\u57DF */}\n <ProductImage\n images={sceneImages}\n name={productData.name}\n layout={layout}\n tags={productData.tags || tags}\n onClick={hasClickHandler ? handleProductImageClick : undefined}\n href={hasClickHandler ? undefined : productHref}\n />\n\n {/* \u4EA7\u54C1\u4FE1\u606F\u533A\u57DF */}\n <div\n className={cn(\n 'bg-container-primary desktop:p-6 flex flex-col justify-between p-4',\n // \u6839\u636E\u5E03\u5C40\u6A21\u5F0F\u8C03\u6574\u5706\u89D2\u548C\u5C3A\u5BF8\n layout === 'horizontal'\n ? [\n 'rounded-r-box laptop:rounded-r-box tablet:rounded-b-box tablet:rounded-l-none',\n // \u4F7F\u7528 flex-basis \u8BBE\u7F6E\u5BBD\u5EA6\u6BD4\u4F8B\n 'laptop:basis-[39.1%]', // 360px / 921px \u2248 39.1%\n 'desktop:basis-[42.1%]', // 552px / 1312px \u2248 42.1%\n 'lg-desktop:basis-[42.1%]', // 700px / 1664px \u2248 42.1%\n 'shrink-0',\n ]\n : ['rounded-b-box', 'w-full', 'grow']\n )}\n >\n <div className=\"flex flex-1 flex-col justify-between gap-6\">\n {/* \u4EA7\u54C1\u6807\u9898\u548C\u63CF\u8FF0 */}\n <ProductInfo\n name={productData.name}\n onClick={hasClickHandler ? handleProductImageClick : undefined}\n href={hasClickHandler ? undefined : productHref}\n description={productData.description}\n classNames={classNames}\n />\n\n {/* \u514D\u8D39\u8D60\u54C1\u533A\u57DF */}\n <GiftSelection\n freeGiftLabel={productData.freeGiftLabel}\n freeGifts={giftsWithSelection}\n onGiftClick={handleGiftClick}\n giftType={giftType}\n selectedGiftSku={selectedGiftSku}\n />\n <PriceAndActions\n currentPrice={productData.currentPrice ?? ''}\n originalPrice={productData.originalPrice}\n priceLabel={productData.priceLabel}\n learnMoreText={productData.learnMoreText}\n shopNowText={productData.shopNowText}\n soldOutText={soldOutText}\n onLearnMore={handleLearnMoreClick}\n onShopNow={handleShopNowClick}\n availableForSale={productData.availableForSale}\n learnMoreLoading={learnMoreLoading}\n shopNowLoading={shopNowLoading}\n trackingTitle={productData.name}\n trackingDescription={productData.description}\n trackingSku={productData.sku}\n classNames={classNames}\n />\n </div>\n </div>\n </div>\n )\n }\n)\n\nProductCard.displayName = 'BuyOneGetOneShelf.ProductCard'\n\nexport default ProductCard\n"],
|
|
5
|
+
"mappings": "aAmNQ,cAAAA,EA0BE,QAAAC,MA1BF,oBAjNR,UAAYC,MAAW,QACvB,OAAS,MAAAC,MAAU,yBACnB,OAAOC,MAAkB,oBACzB,OAAOC,MAAiB,mBACxB,OAAOC,MAAmB,qB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GJ,UAAA1B,EAACI,EAAA,CACC,OAAQU,EACR,KAAMJ,EAAY,KAClB,OAAQmB,EACR,KAAMnB,EAAY,MAAQK,EAC1B,QAAS+B,EAAkBE,EAA0B,OACrD,KAAMF,EAAkB,OAAYC,EACtC,EAGA/C,EAAC,OACC,UAAWG,EACT,qEAEA0B,IAAW,aACP,CACE,gFAEA,uBACA,wBACA,2BACA,UACF,EACA,CAAC,gBAAiB,SAAU,MAAM,CACxC,EAEA,SAAA5B,EAAC,OAAI,UAAU,6CAEb,UAAAD,EAACK,EAAA,CACC,KAAMK,EAAY,KAClB,QAASoC,EAAkBE,EAA0B,OACrD,KAAMF,EAAkB,OAAYC,EACpC,YAAarC,EAAY,YACzB,WAAYc,EACd,EAGAxB,EAACM,EAAA,CACC,cAAeI,EAAY,cAC3B,UAAW2B,EACX,YAAaI,EACb,SAAU7B,EACV,gBAAiBC,EACnB,EACAb,EAACO,EAAA,CACC,aAAcG,EAAY,cAAgB,GAC1C,cAAeA,EAAY,cAC3B,WAAYA,EAAY,WACxB,cAAeA,EAAY,cAC3B,YAAaA,EAAY,YACzB,YAAae,EACb,YAAawB,EACb,UAAWE,EACX,iBAAkBzC,EAAY,iBAC9B,iBAAkBoB,EAClB,eAAgBE,EAChB,cAAetB,EAAY,KAC3B,oBAAqBA,EAAY,YACjC,YAAaA,EAAY,IACzB,WAAYc,EACd,GACF,EACF,GACF,CAEJ,CACF,EAEAf,EAAY,YAAc,gCAE1B,IAAO2C,GAAQ3C",
|
|
6
|
+
"names": ["jsx", "jsxs", "React", "cn", "ProductImage", "ProductInfo", "GiftSelection", "PriceAndActions", "BuyOneGetOneShelfContext", "ProductCard", "productData", "gifts", "giftType", "selectedGiftSku", "sceneImages", "tags", "layoutProp", "className", "onProductClick", "onProductImageClick", "onLearnMore", "onShopNow", "onGiftClick", "onGiftSelectionChange", "classNames", "soldOutText", "props", "ref", "contextLayout", "layout", "learnMoreLoading", "setLearnMoreLoading", "shopNowLoading", "setShopNowLoading", "selectedGiftIds", "setSelectedGiftIds", "gift", "giftsWithSelection", "prevSelectedIds", "currentSelectedId", "fullProductData", "handleGiftClick", "currentSelectedGifts", "g", "newSelectedIds", "newSelectedGifts", "hasClickHandler", "productHref", "handleProductImageClick", "handleLearnMoreClick", "selectedGifts", "handleShopNowClick", "ProductCard_default"]
|
|
7
7
|
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/biz-components/BuyOneGetOneShelf/context.tsx"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react'\n\nexport const BuyOneGetOneShelfContext = React.createContext<{\n layout: 'horizontal' | 'vertical'\n}>({\n layout: 'horizontal',\n})\n"],
|
|
5
|
+
"mappings": "AAAA,UAAYA,MAAW,QAEhB,MAAMC,EAA2BD,EAAM,cAE3C,CACD,OAAQ,YACV,CAAC",
|
|
6
|
+
"names": ["React", "BuyOneGetOneShelfContext"]
|
|
7
|
+
}
|
|
@@ -203,7 +203,7 @@ export interface BuyOneGetOneShelfCardProps extends Omit<React.HTMLAttributes<HT
|
|
|
203
203
|
soldOutText?: string;
|
|
204
204
|
/** 场景图片 */
|
|
205
205
|
sceneImages?: ResponsiveImages;
|
|
206
|
-
/**
|
|
206
|
+
/** @deprecated Layout is now automatically inferred by Root based on children count. */
|
|
207
207
|
layout?: 'horizontal' | 'vertical';
|
|
208
208
|
/** ProductCard 组件的自定义类名 */
|
|
209
209
|
classNames?: Partial<Record<BuyOneGetOneShelfProductCardSemanticName, string>>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/biz-components/BuyOneGetOneShelf/types.ts"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react'\nimport type { Theme } from '../../types/props'\n\n/**\n * \u514D\u8D39\u8D60\u54C1\u63A5\u53E3\n */\nexport interface FreeGift {\n /** \u8D60\u54C1ID */\n id: string\n /** \u8D60\u54C1\u56FE\u7247URL */\n image: string\n /** \u8D60\u54C1\u540D\u79F0 */\n name: string\n /** \u539F\u4EF7 */\n originalPrice: string\n /** \u73B0\u4EF7\uFF08\u901A\u5E38\u4E3AFree\uFF09 */\n currentPrice: string\n /** \u6570\u91CF */\n quantity: number\n /** \u53D8\u4F53ID */\n variantId: string\n /** SKU */\n sku: string\n /** \u53E5\u67C4 */\n handle: string\n /** \u8D60\u54C1tag */\n tag?: string\n}\n\n/**\n * \u5E26\u9009\u62E9\u72B6\u6001\u7684\u514D\u8D39\u8D60\u54C1\u63A5\u53E3\n */\nexport interface FreeGiftWithSelection extends FreeGift {\n /** \u662F\u5426\u5DF2\u9009\u4E2D */\n selected?: boolean\n}\n\n/**\n * \u4EA7\u54C1\u6807\u7B7E\u63A5\u53E3\n */\nexport interface ProductTag {\n /** \u6807\u7B7E\u6587\u672C */\n label: string\n /** \u6807\u7B7E\u6837\u5F0F\u53D8\u4F53 */\n variant: 'outline' | 'fill' | 'promotional'\n /** \u4FC3\u9500\u7C7B\u578B\uFF08\u4EC5\u5F53 variant \u4E3A 'promotional' \u65F6\u6709\u6548\uFF09 */\n promotionalType?: 'plus-member' | 'regular-member' | 'regular-discount' | 'time-limited-discount'\n}\n\n// Root \u7EC4\u4EF6\u76F8\u5173\u7684\u8BED\u4E49\u7C7B\u540D\nexport type BuyOneGetOneShelfRootSemanticName = 'root' | 'title' | 'description' | 'content' | 'viewMoreBtn'\n\n// ProductCard \u7EC4\u4EF6\u76F8\u5173\u7684\u8BED\u4E49\u7C7B\u540D\nexport type BuyOneGetOneShelfProductCardSemanticName =\n | 'productCard'\n | 'productCardImage'\n | 'productCardTitle'\n | 'productCardDescription'\n | 'productCardPriceLabel'\n | 'productCardPrice'\n | 'productCardOriginalPrice'\n | 'productCardGiftsContainer'\n | 'productCardBtnGroup'\n\n// \u5B8C\u6574\u7684\u8BED\u4E49\u7C7B\u540D\uFF08\u5411\u540E\u517C\u5BB9\uFF09\nexport type BuyOneGetOneShelfSemanticName = BuyOneGetOneShelfRootSemanticName | BuyOneGetOneShelfProductCardSemanticName\n\n/**\n * \u54CD\u5E94\u5F0F\u56FE\u7247\u63A5\u53E3\n */\nexport interface ResponsiveImage {\n id: number\n baseUrl?: string\n url: string\n thumbnailURL?: string\n filename?: string\n mimeType?: string\n width?: number\n height?: number\n}\n\n/**\n * \u54CD\u5E94\u5F0F\u56FE\u7247\u96C6\u5408\u63A5\u53E3\n */\nexport interface ResponsiveImages {\n laptop?: ResponsiveImage\n mobile?: ResponsiveImage\n tablet?: ResponsiveImage\n desktop?: ResponsiveImage\n lgDesktop?: ResponsiveImage\n}\n\n/**\n * \u4EA7\u54C1\u57FA\u7840\u6570\u636E\u63A5\u53E3\n */\nexport interface BaseProductData {\n sku: string\n name: string\n image: string\n value: string\n handle: string\n shopify_id: string\n}\n\nexport interface WithGiftData {\n /**\n * \u8D60\u54C1\n */\n gifts: FreeGift[]\n /**\n * \u8D60\u54C1\u7C7B\u578B 1-> \u8D60\u9001\u5176\u4E2D\u4E00\u4E2A\u8D60\u54C1\uFF0C 2 -> \u8D60\u9001\u6240\u6709\u8D60\u54C1\n */\n gift_type: 1 | 2\n}\n\n/**\n * \u7EAF\u4EA7\u54C1\u6570\u636E\u63A5\u53E3\uFF08\u4E0D\u5305\u542B\u8D60\u54C1\u4FE1\u606F\uFF09\n */\nexport interface PureProductData extends BaseProductData {\n /** \u4EA7\u54C1\u63CF\u8FF0 */\n description?: string\n /** \u5F53\u524D\u4EF7\u683C */\n currentPrice?: string\n /** \u539F\u4EF7 */\n originalPrice?: string\n /** \u4EF7\u683C\u6807\u7B7E\u6587\u672C\uFF08\u5982 \"Plus Member Price\"\uFF09 */\n priceLabel?: string\n /** \u4E86\u89E3\u66F4\u591A\u6309\u94AE\u6587\u672C */\n learnMoreText?: string\n /** \u7ACB\u5373\u8D2D\u4E70\u6309\u94AE\u6587\u672C */\n shopNowText?: string\n /** \u8D60\u54C1\u6807\u7B7E\u6587\u672C */\n freeGiftLabel?: string\n /** \u4EA7\u54C1\u6807\u7B7E */\n tags?: ProductTag[]\n /** \u8D60\u54C1\u9009\u62E9\u6A21\u5F0F */\n giftSelectionMode?: 'single' | 'multiple'\n availableForSale: boolean\n}\n\nexport interface ProductData extends BaseProductData, WithGiftData {\n /** \u4EA7\u54C1\u63CF\u8FF0 */\n description?: string\n /** \u5F53\u524D\u4EF7\u683C */\n currentPrice?: string\n /** \u539F\u4EF7 */\n originalPrice?: string\n /** \u4E86\u89E3\u66F4\u591A\u6309\u94AE\u6587\u672C */\n learnMoreText?: string\n /** \u7ACB\u5373\u8D2D\u4E70\u6309\u94AE\u6587\u672C */\n shopNowText?: string\n /** \u8D60\u54C1\u6807\u7B7E\u6587\u672C */\n freeGiftLabel?: string\n /** \u8D60\u54C1\u9009\u62E9\u6A21\u5F0F */\n giftSelectionMode?: 'single' | 'multiple'\n}\n\n// Alias for consistency with other components\nexport type ProductCardData = ProductData\n\n/**\n * \u6587\u6848\u914D\u7F6E\u63A5\u53E3\n */\nexport interface CopyConfig {\n shopNowText: string\n freeGiftLabel: string\n learnMoreText: string\n freeGiftHeading: string\n soldOutText?: string\n}\n\n/**\n * \u4E70\u8D60\u9879\u76EE\u63A5\u53E3\n */\nexport interface BogoItem {\n id: string\n data: ProductData[]\n images: ResponsiveImages\n shopNowFun: string\n shopNowText: string\n learnMoreText: string\n layout?: 'horizontal' | 'vertical'\n}\n\n/**\n * BuyOneGetOneShelf \u4E1A\u52A1\u7EC4\u4EF6\u6570\u636E\u63A5\u53E3 - \u65B0\u683C\u5F0F\n */\nexport interface BuyOneGetOneShelfData {\n copy: CopyConfig\n theme: string\n title: string\n subtitle: string\n bogoItems: BogoItem[]\n /** \u8D85\u8FC7\u6B64\u6570\u91CF\u7684\u5546\u54C1\u65F6\u663E\u793A\"View More/View Less\"\u6309\u94AE\uFF0C\u9ED8\u8BA4 4 */\n viewMoreThreshold?: number\n /** View More \u6309\u94AE\u6587\u6848\uFF0C\u9ED8\u8BA4 'View More' */\n viewMoreText?: string\n /** View Less \u6309\u94AE\u6587\u6848\uFF0C\u9ED8\u8BA4 'View Less' */\n viewLessText?: string\n}\n\n// Root \u7EC4\u4EF6 Props\uFF08\u65B0\u7684\u7EC4\u5408\u5F0F\u8BBE\u8BA1\uFF09\nexport interface BuyOneGetOneShelfProps extends React.HTMLAttributes<HTMLDivElement> {\n /** \u6807\u9898 */\n title?: string\n /** \u526F\u6807\u9898 */\n subtitle?: string\n theme?: Theme\n /** \u5B50\u7EC4\u4EF6 */\n children: React.ReactNode\n /** Root \u7EC4\u4EF6\u7684\u81EA\u5B9A\u4E49\u7C7B\u540D */\n classNames?: Partial<Record<BuyOneGetOneShelfRootSemanticName, string>>\n /** \u8D85\u8FC7\u6B64\u6570\u91CF\u7684\u5546\u54C1\u65F6\u663E\u793A\"View More/View Less\"\u6309\u94AE\uFF0C\u9ED8\u8BA4 4 */\n viewMoreThreshold?: number\n /** View More \u6309\u94AE\u6587\u6848\uFF0C\u9ED8\u8BA4 'View More' */\n viewMoreText?: string\n /** View Less \u6309\u94AE\u6587\u6848\uFF0C\u9ED8\u8BA4 'View Less' */\n viewLessText?: string\n}\n\n// \u5361\u7247\u7EC4\u4EF6Props - \u57FA\u4E8EProductCardProps\u4F46\u7B80\u5316\nexport interface BuyOneGetOneShelfCardProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'onClick'> {\n /** \u4EA7\u54C1\u6570\u636E */\n productData: BaseProductData & {\n description?: string\n currentPrice?: string\n originalPrice?: string\n learnMoreText?: string\n shopNowText?: string\n freeGiftLabel?: string\n }\n /** \u8D60\u54C1\u5217\u8868 */\n gifts?: FreeGift[]\n /** \u8D60\u54C1\u7C7B\u578B 1-> \u8D60\u9001\u5176\u4E2D\u4E00\u4E2A\u8D60\u54C1\uFF0C 2 -> \u8D60\u9001\u6240\u6709\u8D60\u54C1 */\n giftType?: 1 | 2\n soldOutText?: string\n /** \u573A\u666F\u56FE\u7247 */\n sceneImages?: ResponsiveImages\n /**
|
|
4
|
+
"sourcesContent": ["import * as React from 'react'\nimport type { Theme } from '../../types/props'\n\n/**\n * \u514D\u8D39\u8D60\u54C1\u63A5\u53E3\n */\nexport interface FreeGift {\n /** \u8D60\u54C1ID */\n id: string\n /** \u8D60\u54C1\u56FE\u7247URL */\n image: string\n /** \u8D60\u54C1\u540D\u79F0 */\n name: string\n /** \u539F\u4EF7 */\n originalPrice: string\n /** \u73B0\u4EF7\uFF08\u901A\u5E38\u4E3AFree\uFF09 */\n currentPrice: string\n /** \u6570\u91CF */\n quantity: number\n /** \u53D8\u4F53ID */\n variantId: string\n /** SKU */\n sku: string\n /** \u53E5\u67C4 */\n handle: string\n /** \u8D60\u54C1tag */\n tag?: string\n}\n\n/**\n * \u5E26\u9009\u62E9\u72B6\u6001\u7684\u514D\u8D39\u8D60\u54C1\u63A5\u53E3\n */\nexport interface FreeGiftWithSelection extends FreeGift {\n /** \u662F\u5426\u5DF2\u9009\u4E2D */\n selected?: boolean\n}\n\n/**\n * \u4EA7\u54C1\u6807\u7B7E\u63A5\u53E3\n */\nexport interface ProductTag {\n /** \u6807\u7B7E\u6587\u672C */\n label: string\n /** \u6807\u7B7E\u6837\u5F0F\u53D8\u4F53 */\n variant: 'outline' | 'fill' | 'promotional'\n /** \u4FC3\u9500\u7C7B\u578B\uFF08\u4EC5\u5F53 variant \u4E3A 'promotional' \u65F6\u6709\u6548\uFF09 */\n promotionalType?: 'plus-member' | 'regular-member' | 'regular-discount' | 'time-limited-discount'\n}\n\n// Root \u7EC4\u4EF6\u76F8\u5173\u7684\u8BED\u4E49\u7C7B\u540D\nexport type BuyOneGetOneShelfRootSemanticName = 'root' | 'title' | 'description' | 'content' | 'viewMoreBtn'\n\n// ProductCard \u7EC4\u4EF6\u76F8\u5173\u7684\u8BED\u4E49\u7C7B\u540D\nexport type BuyOneGetOneShelfProductCardSemanticName =\n | 'productCard'\n | 'productCardImage'\n | 'productCardTitle'\n | 'productCardDescription'\n | 'productCardPriceLabel'\n | 'productCardPrice'\n | 'productCardOriginalPrice'\n | 'productCardGiftsContainer'\n | 'productCardBtnGroup'\n\n// \u5B8C\u6574\u7684\u8BED\u4E49\u7C7B\u540D\uFF08\u5411\u540E\u517C\u5BB9\uFF09\nexport type BuyOneGetOneShelfSemanticName = BuyOneGetOneShelfRootSemanticName | BuyOneGetOneShelfProductCardSemanticName\n\n/**\n * \u54CD\u5E94\u5F0F\u56FE\u7247\u63A5\u53E3\n */\nexport interface ResponsiveImage {\n id: number\n baseUrl?: string\n url: string\n thumbnailURL?: string\n filename?: string\n mimeType?: string\n width?: number\n height?: number\n}\n\n/**\n * \u54CD\u5E94\u5F0F\u56FE\u7247\u96C6\u5408\u63A5\u53E3\n */\nexport interface ResponsiveImages {\n laptop?: ResponsiveImage\n mobile?: ResponsiveImage\n tablet?: ResponsiveImage\n desktop?: ResponsiveImage\n lgDesktop?: ResponsiveImage\n}\n\n/**\n * \u4EA7\u54C1\u57FA\u7840\u6570\u636E\u63A5\u53E3\n */\nexport interface BaseProductData {\n sku: string\n name: string\n image: string\n value: string\n handle: string\n shopify_id: string\n}\n\nexport interface WithGiftData {\n /**\n * \u8D60\u54C1\n */\n gifts: FreeGift[]\n /**\n * \u8D60\u54C1\u7C7B\u578B 1-> \u8D60\u9001\u5176\u4E2D\u4E00\u4E2A\u8D60\u54C1\uFF0C 2 -> \u8D60\u9001\u6240\u6709\u8D60\u54C1\n */\n gift_type: 1 | 2\n}\n\n/**\n * \u7EAF\u4EA7\u54C1\u6570\u636E\u63A5\u53E3\uFF08\u4E0D\u5305\u542B\u8D60\u54C1\u4FE1\u606F\uFF09\n */\nexport interface PureProductData extends BaseProductData {\n /** \u4EA7\u54C1\u63CF\u8FF0 */\n description?: string\n /** \u5F53\u524D\u4EF7\u683C */\n currentPrice?: string\n /** \u539F\u4EF7 */\n originalPrice?: string\n /** \u4EF7\u683C\u6807\u7B7E\u6587\u672C\uFF08\u5982 \"Plus Member Price\"\uFF09 */\n priceLabel?: string\n /** \u4E86\u89E3\u66F4\u591A\u6309\u94AE\u6587\u672C */\n learnMoreText?: string\n /** \u7ACB\u5373\u8D2D\u4E70\u6309\u94AE\u6587\u672C */\n shopNowText?: string\n /** \u8D60\u54C1\u6807\u7B7E\u6587\u672C */\n freeGiftLabel?: string\n /** \u4EA7\u54C1\u6807\u7B7E */\n tags?: ProductTag[]\n /** \u8D60\u54C1\u9009\u62E9\u6A21\u5F0F */\n giftSelectionMode?: 'single' | 'multiple'\n availableForSale: boolean\n}\n\nexport interface ProductData extends BaseProductData, WithGiftData {\n /** \u4EA7\u54C1\u63CF\u8FF0 */\n description?: string\n /** \u5F53\u524D\u4EF7\u683C */\n currentPrice?: string\n /** \u539F\u4EF7 */\n originalPrice?: string\n /** \u4E86\u89E3\u66F4\u591A\u6309\u94AE\u6587\u672C */\n learnMoreText?: string\n /** \u7ACB\u5373\u8D2D\u4E70\u6309\u94AE\u6587\u672C */\n shopNowText?: string\n /** \u8D60\u54C1\u6807\u7B7E\u6587\u672C */\n freeGiftLabel?: string\n /** \u8D60\u54C1\u9009\u62E9\u6A21\u5F0F */\n giftSelectionMode?: 'single' | 'multiple'\n}\n\n// Alias for consistency with other components\nexport type ProductCardData = ProductData\n\n/**\n * \u6587\u6848\u914D\u7F6E\u63A5\u53E3\n */\nexport interface CopyConfig {\n shopNowText: string\n freeGiftLabel: string\n learnMoreText: string\n freeGiftHeading: string\n soldOutText?: string\n}\n\n/**\n * \u4E70\u8D60\u9879\u76EE\u63A5\u53E3\n */\nexport interface BogoItem {\n id: string\n data: ProductData[]\n images: ResponsiveImages\n shopNowFun: string\n shopNowText: string\n learnMoreText: string\n layout?: 'horizontal' | 'vertical'\n}\n\n/**\n * BuyOneGetOneShelf \u4E1A\u52A1\u7EC4\u4EF6\u6570\u636E\u63A5\u53E3 - \u65B0\u683C\u5F0F\n */\nexport interface BuyOneGetOneShelfData {\n copy: CopyConfig\n theme: string\n title: string\n subtitle: string\n bogoItems: BogoItem[]\n /** \u8D85\u8FC7\u6B64\u6570\u91CF\u7684\u5546\u54C1\u65F6\u663E\u793A\"View More/View Less\"\u6309\u94AE\uFF0C\u9ED8\u8BA4 4 */\n viewMoreThreshold?: number\n /** View More \u6309\u94AE\u6587\u6848\uFF0C\u9ED8\u8BA4 'View More' */\n viewMoreText?: string\n /** View Less \u6309\u94AE\u6587\u6848\uFF0C\u9ED8\u8BA4 'View Less' */\n viewLessText?: string\n}\n\n// Root \u7EC4\u4EF6 Props\uFF08\u65B0\u7684\u7EC4\u5408\u5F0F\u8BBE\u8BA1\uFF09\nexport interface BuyOneGetOneShelfProps extends React.HTMLAttributes<HTMLDivElement> {\n /** \u6807\u9898 */\n title?: string\n /** \u526F\u6807\u9898 */\n subtitle?: string\n theme?: Theme\n /** \u5B50\u7EC4\u4EF6 */\n children: React.ReactNode\n /** Root \u7EC4\u4EF6\u7684\u81EA\u5B9A\u4E49\u7C7B\u540D */\n classNames?: Partial<Record<BuyOneGetOneShelfRootSemanticName, string>>\n /** \u8D85\u8FC7\u6B64\u6570\u91CF\u7684\u5546\u54C1\u65F6\u663E\u793A\"View More/View Less\"\u6309\u94AE\uFF0C\u9ED8\u8BA4 4 */\n viewMoreThreshold?: number\n /** View More \u6309\u94AE\u6587\u6848\uFF0C\u9ED8\u8BA4 'View More' */\n viewMoreText?: string\n /** View Less \u6309\u94AE\u6587\u6848\uFF0C\u9ED8\u8BA4 'View Less' */\n viewLessText?: string\n}\n\n// \u5361\u7247\u7EC4\u4EF6Props - \u57FA\u4E8EProductCardProps\u4F46\u7B80\u5316\nexport interface BuyOneGetOneShelfCardProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'onClick'> {\n /** \u4EA7\u54C1\u6570\u636E */\n productData: BaseProductData & {\n description?: string\n currentPrice?: string\n originalPrice?: string\n learnMoreText?: string\n shopNowText?: string\n freeGiftLabel?: string\n }\n /** \u8D60\u54C1\u5217\u8868 */\n gifts?: FreeGift[]\n /** \u8D60\u54C1\u7C7B\u578B 1-> \u8D60\u9001\u5176\u4E2D\u4E00\u4E2A\u8D60\u54C1\uFF0C 2 -> \u8D60\u9001\u6240\u6709\u8D60\u54C1 */\n giftType?: 1 | 2\n soldOutText?: string\n /** \u573A\u666F\u56FE\u7247 */\n sceneImages?: ResponsiveImages\n /** @deprecated Layout is now automatically inferred by Root based on children count. */\n layout?: 'horizontal' | 'vertical'\n /** ProductCard \u7EC4\u4EF6\u7684\u81EA\u5B9A\u4E49\u7C7B\u540D */\n classNames?: Partial<Record<BuyOneGetOneShelfProductCardSemanticName, string>>\n /** @deprecated Use `onProductImageClick` instead. */\n onProductClick?: (product: ProductCardData) => void\n /** \u4EA7\u54C1\u56FE\u7247\u70B9\u51FB\u56DE\u8C03 */\n onProductImageClick?: (product: ProductCardData) => void\n /** Learn More \u70B9\u51FB\u56DE\u8C03 */\n onLearnMore?: (product: ProductCardData, selectedGifts: FreeGift[]) => void\n /** Shop Now \u70B9\u51FB\u56DE\u8C03 */\n onShopNow?: (product: ProductCardData, selectedGifts: FreeGift[]) => void\n /** \u8D60\u54C1\u70B9\u51FB\u56DE\u8C03 */\n onGiftClick?: (gift: FreeGift, selectedGifts: FreeGift[]) => void\n /** \u8D60\u54C1\u9009\u62E9\u53D8\u5316\u56DE\u8C03 */\n onGiftSelectionChange?: (selectedGifts: FreeGift[], product: ProductCardData) => void\n /** \u9009\u4E2D\u8D60\u54C1SKU\u53D8\u5316\u56DE\u8C03\uFF08\u53D7\u63A7\u7EC4\u4EF6\uFF09 */\n onSelectedGiftSkuChange?: (selectedSku: string | null) => void\n}\n\n// \u4FDD\u6301\u5411\u540E\u517C\u5BB9\u7684\u4F20\u7EDFProps\nexport interface BuyOneGetOneShelfLegacyProps extends React.HTMLAttributes<HTMLDivElement> {\n /** \u4E1A\u52A1\u6570\u636E */\n data: BuyOneGetOneShelfData\n /** @deprecated Use `onProductImageClick` instead. */\n onProductClick?: (product: ProductCardData) => void\n /** \u4EA7\u54C1\u56FE\u7247\u70B9\u51FB\u56DE\u8C03 */\n onProductImageClick?: (product: ProductCardData) => void\n /** Learn More\u6309\u94AE\u70B9\u51FB\u4E8B\u4EF6 */\n onLearnMore?: (product: ProductCardData, selectedGifts: FreeGift[]) => void\n /** Shop Now\u6309\u94AE\u70B9\u51FB\u4E8B\u4EF6 */\n onShopNow?: (product: ProductCardData, selectedGifts: FreeGift[]) => void\n onAddToCart?: (product: ProductCardData) => void\n /** \u8D60\u54C1\u70B9\u51FB\u4E8B\u4EF6 */\n onGiftClick?: (gift: FreeGift, selectedGifts: FreeGift[]) => void\n /** \u8D60\u54C1\u9009\u62E9\u53D8\u5316\u4E8B\u4EF6 */\n onGiftSelectionChange?: (selectedGifts: FreeGift[], product: ProductCardData) => void\n classNames?: Partial<Record<BuyOneGetOneShelfSemanticName, string>>\n}\n"],
|
|
5
5
|
"mappings": "AAAA,MAAuB",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{jsx as e,jsxs as o}from"react/jsx-runtime";import{useEffect as w,useMemo as D,useState as v}from"react";import{Text as d,Container as F,Link as x}from"../../components/index.js";import S from"../Subscribe/index.js";import{FooterNavigationBlockType as y}from"./types.js";import{AddIcon as B,SubtractIcon as C,ArrowRightIcon as z,CountryIcon as E}from"./icons/index.js";import{useMediaQuery as M}from"react-responsive";import{cn as m,getLocalizedPath as u}from"../../helpers/utils.js";import{useAiuiContext as k}from"../AiuiProvider/index.js";import{withLayout as $}from"../../shared/Styles.js";const T=({data:{footer:a}={},currentCountry:p,event:n,subscribeLoading:f,classNames:i,className:l,moduleIds:s,...b})=>{const[c,r]=v(!1),g=M({query:"(max-width: 1439px)"});w(()=>{r(g)},[g]);const h=D(()=>a?.blocks?.find(t=>t?.blockType===y.Brand)?.country||{},[a]);return e("footer",{...b,className:m(i?.root,l),children:o(F,{className:m(i?.child),childClassName:m("laptop:py-16 desktop:gap-16 flex flex-col gap-8 bg-black py-8"),children:[e(d,{html:a?.story,className:"desktop:text-sm text-xs font-bold text-[#6D6D6F]"}),a?.blocks?.map(t=>{if(t?.blockType===y.Signup)return e(P,{subscribeLoading:f,data:t,onSubmit:n?.signup,id:s?.marketingConversion},t.id);if(t?.blockType===y.Brand)return e(j,{data:t,isMobile:c,event:n,currentCountry:p,id:s?.footerBrand},t?.id);if(t?.blockType===y.Main)return e(O,{data:{...t,country:h},event:n,isMobile:c,currentCountry:p,id:s?.mainServices},t.id)})]})})},P=({data:a,onSubmit:p,subscribeLoading:n,id:f="footer-marketing-conversion"})=>{const{locale:i="us"}=k();return o("div",{id:f,className:"desktop:py-16 desktop:gap-16 laptop:px-8 desktop:flex-row rounded-btn flex flex-col gap-8 bg-[#1E2024] px-4 py-8",children:[e(S,{subscribeMetadata:a?.signup,className:"desktop:flex-[744]",onSubmit:p,loading:n}),e("div",{className:"desktop:hidden h-px w-full bg-[#3D3E3F]"}),o("div",{className:"desktop:gap-6 laptop:flex-row desktop:flex-[792] flex flex-col gap-4",children:[o("div",{className:"flex-1",children:[e(d,{html:a?.enjoy?.title,className:" text-xl font-bold leading-[1.2] text-white"}),e("div",{className:"mt-4 flex flex-col gap-2",children:a?.enjoy?.enjoys?.map(l=>o("div",{className:"flex-start flex gap-2",children:[e("img",{src:l?.icon?.url,loading:"lazy",alt:l?.icon?.alt||"",className:"size-5 shrink-0"}),e(d,{html:l?.label,className:"desktop:text-base text-sm font-bold leading-[1.2] text-[#B6B6BA]"})]},l?.id))})]}),e("div",{className:"desktop:block hidden w-px bg-[#3D3E3F]"}),o("div",{className:"flex-1",children:[e(d,{html:a?.benefit?.title,className:"text-xl font-bold leading-[1.2] text-white"}),e("div",{className:"mt-4 flex flex-col gap-2",children:a?.benefit?.benefits?.map(l=>e(x,{href:`${u(l?.link,i)}?ref=footer`,asChild:!l?.link,className:"no-underline",children:e(d,{html:l?.label,className:"desktop:text-base text-sm font-bold leading-[1.2] text-[#B6B6BA] hover:text-white"})},l?.id))})]})]})]})},O=({data:a,event:p,isMobile:n,currentCountry:f,id:i="footer-main-services"})=>{const{locale:l="us"}=k(),[s,b]=v(!1),{services:c,mainNav:r,country:g}=a,h="contact-section";return o("nav",{id:i,className:"flex flex-col gap-8","aria-label":"Main navigation",children:[o("div",{className:m({"desktop:gap-16 flex":c?.download?.title}),children:[o("div",{className:m("w-full",{"desktop:flex-[1260]":c?.download?.title}),children:[e(d,{html:c?.storeBenefits?.title,className:" text-xl font-bold leading-[1.2] text-white"}),e("div",{className:m("laptop:flex-row desktop:gap-4 laptop:flex-wrap mt-4 flex flex-col gap-2",{"desktop:max-w-[648px]":c?.download?.title}),children:c?.storeBenefits?.reasons?.map(t=>o("div",{className:"desktop:min-w-[288px] flex flex-1 shrink-0 items-center gap-2",children:[e("img",{src:t?.icon?.url,loading:"lazy",alt:t?.icon?.alt||"",className:"size-5 shrink-0"}),e(x,{href:`${u(t?.link,l)}?ref=footer`,asChild:!t?.link,className:"no-underline",children:e(d,{html:t?.label,className:"desktop:text-base text-sm font-bold leading-[1.2] text-[#B6B6BA]"})})]},t?.id))})]}),e(L,{className:m({"desktop:flex-[404] hidden desktop:block":c?.download?.title}),title:c?.download?.title,apps:c?.download?.apps})]}),e("div",{className:"desktop:block hidden h-px bg-[#3D3E3F]","aria-hidden":"true"}),o("div",{className:"desktop:grid grid-cols-4 gap-4",children:[e(N,{title:r?.products?.title,lists:r?.products?.products}),e(N,{title:r?.explore?.title,lists:r?.explore?.explores}),e(N,{title:r?.support?.title,lists:r?.support?.supports}),o("div",{className:"desktop:py-0 desktop:border-none border-t border-[#3D3E3F] pt-4",children:[o("div",{className:"desktop:pb-0 flex items-center justify-between pb-4",children:[e(d,{as:"p",html:r?.contact?.title,className:"text-xl font-bold leading-[1.2] text-white",id:h}),n&&e("button",{onClick:()=>b(!s),"aria-expanded":s,"aria-controls":h,"aria-label":s?"Collapse contact section":"Expand contact section",children:s?e(C,{width:20,height:20}):e(B,{width:20,height:20})})]}),(s&&n||!n)&&e("div",{className:"desktop:mt-4 desktop:mb-0 mb-4 flex flex-col gap-2",role:"region","aria-labelledby":h,children:r?.contact?.contacts?.map(t=>o(x,{href:t?.link,className:"group flex items-start gap-2 no-underline",children:[e("img",{src:t?.icon?.url,loading:"lazy",alt:t?.icon?.alt,className:"size-5 shrink-0 opacity-70 transition-opacity duration-200 group-hover:opacity-100"}),e(d,{html:t?.label,className:"desktop:text-base text-sm font-bold leading-[1.2] text-[#B6B6BA] transition-colors duration-200 group-hover:text-white"})]},t?.id))}),e(A,{country:f||g,className:"desktop:hidden border-b border-[#3D3E3F]",isMobile:n,onChangeCountry:p?.country}),e("div",{className:"desktop:hidden mt-8",children:e(L,{title:c?.download?.title,apps:c?.download?.apps})}),!!r?.socials?.length&&e("div",{className:"mt-8 flex items-center gap-2",role:"list","aria-label":"Social media links",children:r?.socials?.map(t=>e(x,{href:`${u(t?.link,l)}?ref=footer`,className:"group",role:"listitem","aria-label":t?.icon?.alt||"Social media",children:e("img",{src:t?.icon?.url,loading:"lazy",alt:t?.icon?.alt,className:"size-8 shrink-0 opacity-70 transition-opacity duration-200 group-hover:opacity-100"})},t?.id))}),e("div",{className:"mt-4 flex flex-wrap gap-2",role:"list","aria-label":"Payment methods",children:r?.payment?.map(t=>e(x,{href:u(t?.link,l),asChild:!t?.link,role:"listitem","aria-label":t?.icon?.alt||"Payment method",children:e("img",{src:t?.icon?.url,loading:"lazy",alt:t?.icon?.alt||"",className:"h-[28px] w-[44px] shrink-0"})},t?.id))})]})]})]})},j=({data:a,isMobile:p,event:n,currentCountry:f,id:i="footer-brand"})=>{const{locale:l="us"}=k();return o("div",{id:i,className:"flex flex-col gap-4",children:[o("div",{className:"desktop:items-center desktop:flex desktop:gap-4",children:[o("div",{className:"laptop:flex-row laptop:items-center desktop:flex-[980] flex flex-col items-start gap-4",children:[e(x,{href:`${u(a?.brand?.link,l)}?ref=footer`,asChild:!a?.brand?.link,children:e(d,{html:a?.brand?.currentBrand,className:"cursor-pointer text-[#B6B6BA] hover:text-white"})}),e("div",{className:"laptop:block laptop:mb-[10px] hidden h-[20px] w-px bg-[#B6B6BA]"}),e("div",{className:"desktop:gap-6 flex flex-wrap items-center gap-4",children:a?.brand?.brands?.map(s=>e(x,{href:`${u(s?.link,l)}?ref=footer`,children:e(d,{html:s?.icon,className:"text-[#B6B6BA] hover:text-white"})},s?.id))})]}),e(A,{country:f||a?.country,className:"desktop:flex-[316] desktop:block hidden",isMobile:p,onChangeCountry:n?.country})]}),e("div",{className:"h-px bg-[#3D3E3F]"}),o("div",{className:"laptop:flex-row desktop:gap-4 desktop:items-center flex flex-col items-start gap-1",children:[e(d,{html:a?.copyright?.label,className:"desktop:text-base text-xs font-bold leading-[1.4] text-[#6D6D6F]"}),o("div",{className:"flex flex-wrap items-center gap-x-2 gap-y-1",children:[a?.policy?.policies?.map(s=>e(x,{href:`${u(s?.link,l)}?ref=footer`,className:"desktop:text-base text-xs font-bold leading-[1.4] text-[#B6B6BA] no-underline hover:text-white",children:s?.label},s?.id)),a?.policy?.cookies&&e("button",{"data-cc":"show-preferencesModal",onClick:n?.cookiesSet,className:"desktop:text-base text-xs font-bold leading-[1.4] text-[#B6B6BA] no-underline hover:text-white focus:outline-none focus:ring-2 focus:ring-white focus:ring-offset-2 focus:ring-offset-black","aria-label":`Cookie preferences: ${a?.policy?.cookies}`,children:a?.policy?.cookies})]})]})]})},N=({title:a,lists:p,className:n})=>{const{locale:f="us"}=k(),[i,l]=v(!1),[s,b]=v(!1),c=M({query:"(max-width: 1439px)"});w(()=>{b(c)},[c]);const r=`nav-section-${a?.replace(/\s+/g,"-").toLowerCase()}`;return o("div",{className:m("desktop:py-0 desktop:border-none border-t border-[#3D3E3F] py-4",n),children:[o("div",{className:"flex items-center justify-between",children:[e(d,{as:"p",html:a,className:"text-xl font-bold leading-[1.2] text-white",id:r}),s&&e("button",{onClick:()=>l(!i),"aria-expanded":i,"aria-controls":r,"aria-label":i?`Collapse ${a}`:`Expand ${a}`,className:"focus:outline-none focus:ring-2 focus:ring-white focus:ring-offset-2 focus:ring-offset-black",children:i?e(C,{width:20,height:20}):e(B,{width:20,height:20})})]}),(i&&s||!s)&&e("nav",{className:"mt-4 flex flex-col gap-2",role:"region","aria-labelledby":r,children:p?.map(g=>e(x,{href:`${u(g?.link,f)}?ref=footer`,className:"no-underline",children:e(d,{html:g?.label,className:"desktop:text-base text-sm font-bold leading-[1.2] text-[#B6B6BA] hover:text-white"})},g?.id))})]})},L=({title:a,apps:p,className:n})=>{const{locale:f="us"}=k();return p?.length?o("div",{className:n,children:[e(d,{html:a,className:" text-xl font-bold leading-[1.2] text-white"}),e("div",{className:"mt-4 flex items-center gap-4",role:"list","aria-label":"Download apps",children:p?.map(i=>o(x,{href:u(i?.link,f),className:"group flex flex-col items-center gap-[6px]",role:"listitem","aria-label":i?.icon?.alt||i?.label||"Download app",children:[e("img",{src:i?.icon?.url,loading:"lazy",alt:i?.icon?.alt,className:"size-10 shrink-0 opacity-70 transition-opacity duration-200 group-hover:opacity-100"}),i?.label&&e(d,{html:i?.label,className:"text-xs font-bold text-[#999999] transition-colors duration-200 group-hover:text-white"})]},i?.id))})]}):null},A=({country:a,isMobile:p,className:n,onChangeCountry:f})=>e("div",{className:m("desktop:py-0 desktop:border-none border-t border-[#3D3E3F] py-4",n),children:o("button",{onClick:()=>f?.(),className:"flex w-full items-center justify-between focus:outline-none focus:ring-2 focus:ring-white focus:ring-offset-2 focus:ring-offset-black","aria-label":`Change country/region, current: ${a?.countryName||a?.country}`,children:[o("div",{className:"group flex items-center gap-2",children:[e(E,{width:20,height:20,className:"shrink-0 opacity-70 transition-opacity duration-200 group-hover:opacity-100","aria-hidden":"true"}),e(d,{as:"span",html:a?.countryName||a?.country,className:"desktop:text-[#B6B6BA] desktop:group-hover:text-white text-base font-bold leading-[1.4] text-white transition-colors duration-200"})]}),p&&e(z,{width:20,height:20,"aria-hidden":"true"})]})});var V=$(T);export{V as default};
|
|
1
|
+
import{jsx as e,jsxs as o}from"react/jsx-runtime";import{useEffect as w,useMemo as D,useState as v}from"react";import{Text as d,Container as F,Link as x}from"../../components/index.js";import S from"../Subscribe/index.js";import{FooterNavigationBlockType as y}from"./types.js";import{AddIcon as B,SubtractIcon as C,ArrowRightIcon as z,CountryIcon as E}from"./icons/index.js";import{useMediaQuery as M}from"react-responsive";import{cn as m,getLocalizedPath as u}from"../../helpers/utils.js";import{useAiuiContext as k}from"../AiuiProvider/index.js";import{withLayout as T}from"../../shared/Styles.js";const P=({data:{footer:a}={},currentCountry:p,event:n,subscribeLoading:f,classNames:i,className:l,moduleIds:s,...b})=>{const[c,r]=v(!1),g=M({query:"(max-width: 1439px)"});w(()=>{r(g)},[g]);const h=D(()=>a?.blocks?.find(t=>t?.blockType===y.Brand)?.country||{},[a]);return e("footer",{...b,className:m(i?.root,l),children:o(F,{className:m(i?.child),childClassName:m("laptop:py-16 desktop:gap-16 flex flex-col gap-8 bg-black py-8"),children:[e(d,{html:a?.story,className:"desktop:text-sm text-xs font-bold text-[#6D6D6F]"}),a?.blocks?.map(t=>{if(t?.blockType===y.Signup)return e($,{subscribeLoading:f,data:t,onSubmit:n?.signup,id:s?.marketingConversion},t.id);if(t?.blockType===y.Brand)return e(j,{data:t,isMobile:c,event:n,currentCountry:p,id:s?.footerBrand},t?.id);if(t?.blockType===y.Main)return e(O,{data:{...t,country:h},event:n,isMobile:c,currentCountry:p,id:s?.mainServices},t.id)})]})})},$=({data:a,onSubmit:p,subscribeLoading:n,id:f="footer-marketing-conversion"})=>{const{locale:i="us"}=k();return o("div",{id:f,className:"desktop:py-16 desktop:gap-16 laptop:px-8 desktop:flex-row rounded-btn flex flex-col gap-8 bg-[#1E2024] px-4 py-8",children:[e(S,{subscribeMetadata:a?.signup,className:"desktop:flex-[744]",onSubmit:p,loading:n}),e("div",{className:"desktop:hidden h-px w-full bg-[#3D3E3F]"}),o("div",{className:"desktop:gap-6 laptop:flex-row desktop:flex-[792] flex flex-col gap-4",children:[o("div",{className:"flex-1",children:[e(d,{html:a?.enjoy?.title,className:" text-xl font-bold leading-[1.2] text-white"}),e("div",{className:"mt-4 flex flex-col gap-2",children:a?.enjoy?.enjoys?.map(l=>o("div",{className:"flex-start flex gap-2",children:[e("img",{src:l?.icon?.url,loading:"lazy",alt:l?.icon?.alt||"",className:"size-5 shrink-0"}),e(d,{html:l?.label,className:"desktop:text-base text-sm font-bold leading-[1.2] text-[#B6B6BA]"})]},l?.id))})]}),e("div",{className:"desktop:block hidden w-px bg-[#3D3E3F]"}),o("div",{className:"flex-1",children:[e(d,{html:a?.benefit?.title,className:"text-xl font-bold leading-[1.2] text-white"}),e("div",{className:"mt-4 flex flex-col gap-2",children:a?.benefit?.benefits?.map(l=>e(x,{href:u(l?.link,i,"ref=footer"),asChild:!l?.link,className:"no-underline",children:e(d,{html:l?.label,className:"desktop:text-base text-sm font-bold leading-[1.2] text-[#B6B6BA] hover:text-white"})},l?.id))})]})]})]})},O=({data:a,event:p,isMobile:n,currentCountry:f,id:i="footer-main-services"})=>{const{locale:l="us"}=k(),[s,b]=v(!1),{services:c,mainNav:r,country:g}=a,h="contact-section";return o("nav",{id:i,className:"flex flex-col gap-8","aria-label":"Main navigation",children:[o("div",{className:m({"desktop:gap-16 flex":c?.download?.title}),children:[o("div",{className:m("w-full",{"desktop:flex-[1260]":c?.download?.title}),children:[e(d,{html:c?.storeBenefits?.title,className:" text-xl font-bold leading-[1.2] text-white"}),e("div",{className:m("laptop:flex-row desktop:gap-4 laptop:flex-wrap mt-4 flex flex-col gap-2",{"desktop:max-w-[648px]":c?.download?.title}),children:c?.storeBenefits?.reasons?.map(t=>o("div",{className:"desktop:min-w-[288px] flex flex-1 shrink-0 items-center gap-2",children:[e("img",{src:t?.icon?.url,loading:"lazy",alt:t?.icon?.alt||"",className:"size-5 shrink-0"}),e(x,{href:u(t?.link,l,"ref=footer"),asChild:!t?.link,className:"no-underline",children:e(d,{html:t?.label,className:"desktop:text-base text-sm font-bold leading-[1.2] text-[#B6B6BA]"})})]},t?.id))})]}),e(L,{className:m({"desktop:flex-[404] hidden desktop:block":c?.download?.title}),title:c?.download?.title,apps:c?.download?.apps})]}),e("div",{className:"desktop:block hidden h-px bg-[#3D3E3F]","aria-hidden":"true"}),o("div",{className:"desktop:grid grid-cols-4 gap-4",children:[e(N,{title:r?.products?.title,lists:r?.products?.products}),e(N,{title:r?.explore?.title,lists:r?.explore?.explores}),e(N,{title:r?.support?.title,lists:r?.support?.supports}),o("div",{className:"desktop:py-0 desktop:border-none border-t border-[#3D3E3F] pt-4",children:[o("div",{className:"desktop:pb-0 flex items-center justify-between pb-4",children:[e(d,{as:"p",html:r?.contact?.title,className:"text-xl font-bold leading-[1.2] text-white",id:h}),n&&e("button",{onClick:()=>b(!s),"aria-expanded":s,"aria-controls":h,"aria-label":s?"Collapse contact section":"Expand contact section",children:s?e(C,{width:20,height:20}):e(B,{width:20,height:20})})]}),(s&&n||!n)&&e("div",{className:"desktop:mt-4 desktop:mb-0 mb-4 flex flex-col gap-2",role:"region","aria-labelledby":h,children:r?.contact?.contacts?.map(t=>o(x,{href:t?.link,className:"group flex items-start gap-2 no-underline",children:[e("img",{src:t?.icon?.url,loading:"lazy",alt:t?.icon?.alt,className:"size-5 shrink-0 opacity-70 transition-opacity duration-200 group-hover:opacity-100"}),e(d,{html:t?.label,className:"desktop:text-base text-sm font-bold leading-[1.2] text-[#B6B6BA] transition-colors duration-200 group-hover:text-white"})]},t?.id))}),e(A,{country:f||g,className:"desktop:hidden border-b border-[#3D3E3F]",isMobile:n,onChangeCountry:p?.country}),e("div",{className:"desktop:hidden mt-8",children:e(L,{title:c?.download?.title,apps:c?.download?.apps})}),!!r?.socials?.length&&e("div",{className:"mt-8 flex items-center gap-2",role:"list","aria-label":"Social media links",children:r?.socials?.map(t=>e(x,{href:u(t?.link,l,"ref=footer"),className:"group",role:"listitem","aria-label":t?.icon?.alt||"Social media",children:e("img",{src:t?.icon?.url,loading:"lazy",alt:t?.icon?.alt,className:"size-8 shrink-0 opacity-70 transition-opacity duration-200 group-hover:opacity-100"})},t?.id))}),e("div",{className:"mt-4 flex flex-wrap gap-2",role:"list","aria-label":"Payment methods",children:r?.payment?.map(t=>e(x,{href:u(t?.link,l),asChild:!t?.link,role:"listitem","aria-label":t?.icon?.alt||"Payment method",children:e("img",{src:t?.icon?.url,loading:"lazy",alt:t?.icon?.alt||"",className:"h-[28px] w-[44px] shrink-0"})},t?.id))})]})]})]})},j=({data:a,isMobile:p,event:n,currentCountry:f,id:i="footer-brand"})=>{const{locale:l="us"}=k();return o("div",{id:i,className:"flex flex-col gap-4",children:[o("div",{className:"desktop:items-center desktop:flex desktop:gap-4",children:[o("div",{className:"laptop:flex-row laptop:items-center desktop:flex-[980] flex flex-col items-start gap-4",children:[e(x,{href:u(a?.brand?.link,l,"ref=footer"),asChild:!a?.brand?.link,children:e(d,{html:a?.brand?.currentBrand,className:"cursor-pointer text-[#B6B6BA] hover:text-white"})}),e("div",{className:"laptop:block laptop:mb-[10px] hidden h-[20px] w-px bg-[#B6B6BA]"}),e("div",{className:"desktop:gap-6 flex flex-wrap items-center gap-4",children:a?.brand?.brands?.map(s=>e(x,{href:u(s?.link,l,"ref=footer"),children:e(d,{html:s?.icon,className:"text-[#B6B6BA] hover:text-white"})},s?.id))})]}),e(A,{country:f||a?.country,className:"desktop:flex-[316] desktop:block hidden",isMobile:p,onChangeCountry:n?.country})]}),e("div",{className:"h-px bg-[#3D3E3F]"}),o("div",{className:"laptop:flex-row desktop:gap-4 desktop:items-center flex flex-col items-start gap-1",children:[e(d,{html:a?.copyright?.label,className:"desktop:text-base text-xs font-bold leading-[1.4] text-[#6D6D6F]"}),o("div",{className:"flex flex-wrap items-center gap-x-2 gap-y-1",children:[a?.policy?.policies?.map(s=>e(x,{href:u(s?.link,l,"ref=footer"),className:"desktop:text-base text-xs font-bold leading-[1.4] text-[#B6B6BA] no-underline hover:text-white",children:s?.label},s?.id)),a?.policy?.cookies&&e("button",{"data-cc":"show-preferencesModal",onClick:n?.cookiesSet,className:"desktop:text-base text-xs font-bold leading-[1.4] text-[#B6B6BA] no-underline hover:text-white focus:outline-none focus:ring-2 focus:ring-white focus:ring-offset-2 focus:ring-offset-black","aria-label":`Cookie preferences: ${a?.policy?.cookies}`,children:a?.policy?.cookies})]})]})]})},N=({title:a,lists:p,className:n})=>{const{locale:f="us"}=k(),[i,l]=v(!1),[s,b]=v(!1),c=M({query:"(max-width: 1439px)"});w(()=>{b(c)},[c]);const r=`nav-section-${a?.replace(/\s+/g,"-").toLowerCase()}`;return o("div",{className:m("desktop:py-0 desktop:border-none border-t border-[#3D3E3F] py-4",n),children:[o("div",{className:"flex items-center justify-between",children:[e(d,{as:"p",html:a,className:"text-xl font-bold leading-[1.2] text-white",id:r}),s&&e("button",{onClick:()=>l(!i),"aria-expanded":i,"aria-controls":r,"aria-label":i?`Collapse ${a}`:`Expand ${a}`,className:"focus:outline-none focus:ring-2 focus:ring-white focus:ring-offset-2 focus:ring-offset-black",children:i?e(C,{width:20,height:20}):e(B,{width:20,height:20})})]}),(i&&s||!s)&&e("nav",{className:"mt-4 flex flex-col gap-2",role:"region","aria-labelledby":r,children:p?.map(g=>e(x,{href:u(g?.link,f,"ref=footer"),className:"no-underline",children:e(d,{html:g?.label,className:"desktop:text-base text-sm font-bold leading-[1.2] text-[#B6B6BA] hover:text-white"})},g?.id))})]})},L=({title:a,apps:p,className:n})=>{const{locale:f="us"}=k();return p?.length?o("div",{className:n,children:[e(d,{html:a,className:" text-xl font-bold leading-[1.2] text-white"}),e("div",{className:"mt-4 flex items-center gap-4",role:"list","aria-label":"Download apps",children:p?.map(i=>o(x,{href:u(i?.link,f),className:"group flex flex-col items-center gap-[6px]",role:"listitem","aria-label":i?.icon?.alt||i?.label||"Download app",children:[e("img",{src:i?.icon?.url,loading:"lazy",alt:i?.icon?.alt,className:"size-10 shrink-0 opacity-70 transition-opacity duration-200 group-hover:opacity-100"}),i?.label&&e(d,{html:i?.label,className:"text-xs font-bold text-[#999999] transition-colors duration-200 group-hover:text-white"})]},i?.id))})]}):null},A=({country:a,isMobile:p,className:n,onChangeCountry:f})=>e("div",{className:m("desktop:py-0 desktop:border-none border-t border-[#3D3E3F] py-4",n),children:o("button",{onClick:()=>f?.(),className:"flex w-full items-center justify-between focus:outline-none focus:ring-2 focus:ring-white focus:ring-offset-2 focus:ring-offset-black","aria-label":`Change country/region, current: ${a?.countryName||a?.country}`,children:[o("div",{className:"group flex items-center gap-2",children:[e(E,{width:20,height:20,className:"shrink-0 opacity-70 transition-opacity duration-200 group-hover:opacity-100","aria-hidden":"true"}),e(d,{as:"span",html:a?.countryName||a?.country,className:"desktop:text-[#B6B6BA] desktop:group-hover:text-white text-base font-bold leading-[1.4] text-white transition-colors duration-200"})]}),p&&e(z,{width:20,height:20,"aria-hidden":"true"})]})});var V=T(P);export{V as default};
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/biz-components/FooterNavigation/index.tsx"],
|
|
4
|
-
"sourcesContent": ["import { useEffect, useMemo, useState } from 'react'\nimport { Text, Container, Link } from '../../components/index.js'\nimport Subscribe from '../Subscribe/index.js'\nimport type { FooterNavigationProps } from './types.js'\nimport { FooterNavigationBlockType } from './types.js'\nimport { AddIcon, SubtractIcon, ArrowRightIcon, CountryIcon } from './icons/index.js'\nimport { useMediaQuery } from 'react-responsive'\nimport { cn, getLocalizedPath } from '../../helpers/utils.js'\nimport { useAiuiContext } from '../AiuiProvider/index.js'\nimport { withLayout } from '../../shared/Styles.js'\n\nconst FooterNavigation = ({\n data: { footer } = {},\n currentCountry,\n event,\n subscribeLoading,\n classNames,\n className,\n moduleIds,\n ...rest\n}: FooterNavigationProps) => {\n const [isMobile, setIsMobile] = useState(false)\n\n const mediaQuery = useMediaQuery({ query: '(max-width: 1439px)' })\n\n useEffect(() => {\n setIsMobile(mediaQuery)\n }, [mediaQuery])\n\n const country = useMemo(() => {\n return footer?.blocks?.find((block: any) => block?.blockType === FooterNavigationBlockType.Brand)?.country || {}\n }, [footer])\n\n return (\n <footer {...rest} className={cn(classNames?.root, className)}>\n <Container\n className={cn(classNames?.child)}\n childClassName={cn('laptop:py-16 desktop:gap-16 flex flex-col gap-8 bg-black py-8')}\n >\n <Text html={footer?.story} className=\"desktop:text-sm text-xs font-bold text-[#6D6D6F]\" />\n {footer?.blocks?.map((block: any) => {\n if (block?.blockType === FooterNavigationBlockType.Signup) {\n return (\n <MarketingConversion\n key={block.id}\n subscribeLoading={subscribeLoading}\n data={block}\n onSubmit={event?.signup}\n id={moduleIds?.marketingConversion}\n />\n )\n }\n if (block?.blockType === FooterNavigationBlockType.Brand) {\n return (\n <FooterBrand\n key={block?.id}\n data={block}\n isMobile={isMobile}\n event={event}\n currentCountry={currentCountry}\n id={moduleIds?.footerBrand}\n />\n )\n }\n if (block?.blockType === FooterNavigationBlockType.Main) {\n return (\n <MainServices\n key={block.id}\n data={{ ...block, country }}\n event={event}\n isMobile={isMobile}\n currentCountry={currentCountry}\n id={moduleIds?.mainServices}\n />\n )\n }\n })}\n </Container>\n </footer>\n )\n}\n\n/**\n * MarketingConversion \u8425\u9500\u8F6C\u5316\u6A21\u5757\n * @param data\n * @param onSubmit signup\u63D0\u4EA4\u4E8B\u4EF6\n * @returns\n */\nconst MarketingConversion = ({\n data,\n onSubmit,\n subscribeLoading,\n id = 'footer-marketing-conversion',\n}: {\n data: any\n onSubmit?: (_params: any) => void\n subscribeLoading?: boolean\n id?: string\n}) => {\n const { locale = 'us' } = useAiuiContext()\n\n return (\n <div\n id={id}\n className=\"desktop:py-16 desktop:gap-16 laptop:px-8 desktop:flex-row rounded-btn flex flex-col gap-8 bg-[#1E2024] px-4 py-8\"\n >\n <Subscribe\n subscribeMetadata={data?.signup}\n className=\"desktop:flex-[744]\"\n onSubmit={onSubmit}\n loading={subscribeLoading}\n />\n <div className=\"desktop:hidden h-px w-full bg-[#3D3E3F]\" />\n <div className=\"desktop:gap-6 laptop:flex-row desktop:flex-[792] flex flex-col gap-4\">\n <div className=\"flex-1\">\n <Text html={data?.enjoy?.title} className=\" text-xl font-bold leading-[1.2] text-white\" />\n <div className=\"mt-4 flex flex-col gap-2\">\n {data?.enjoy?.enjoys?.map((enjoyItem: any) => (\n <div key={enjoyItem?.id} className=\"flex-start flex gap-2\">\n <img\n src={enjoyItem?.icon?.url}\n loading=\"lazy\"\n alt={enjoyItem?.icon?.alt || ''}\n className=\"size-5 shrink-0\"\n />\n <Text\n html={enjoyItem?.label}\n className=\"desktop:text-base text-sm font-bold leading-[1.2] text-[#B6B6BA]\"\n />\n </div>\n ))}\n </div>\n </div>\n <div className=\"desktop:block hidden w-px bg-[#3D3E3F]\" />\n <div className=\"flex-1\">\n <Text html={data?.benefit?.title} className=\"text-xl font-bold leading-[1.2] text-white\" />\n <div className=\"mt-4 flex flex-col gap-2\">\n {data?.benefit?.benefits?.map((benefitItem: any) => (\n <Link\n href={`${getLocalizedPath(benefitItem?.link, locale)}?ref=footer`}\n asChild={!benefitItem?.link}\n key={benefitItem?.id}\n className=\"no-underline\"\n >\n <Text\n html={benefitItem?.label}\n className=\"desktop:text-base text-sm font-bold leading-[1.2] text-[#B6B6BA] hover:text-white\"\n />\n </Link>\n ))}\n </div>\n </div>\n </div>\n </div>\n )\n}\n\n/**\n * MainServices \u4E3B\u5BFC\u822A\u4E0E\u670D\u52A1\u6A21\u5757\n * @param services \u670D\u52A1\n * @param mainNav \u4E3B\u5BFC\u822A\n * @param event \u4E8B\u4EF6\n * @param isMobile \u662F\u5426\u662F\u79FB\u52A8\u7AEF\n * @param currentCountry \u5F53\u524D\u56FD\u5BB6\n * @returns\n */\nconst MainServices = ({\n data,\n event,\n isMobile,\n currentCountry,\n id = 'footer-main-services',\n}: {\n data: any\n event: any\n isMobile: boolean\n currentCountry: any\n id?: string\n}) => {\n const { locale = 'us' } = useAiuiContext()\n const [mainNavMenuOpen, setMainNavMenuOpen] = useState<boolean>(false)\n const { services, mainNav, country } = data\n const contactSectionId = 'contact-section'\n\n return (\n <nav id={id} className=\"flex flex-col gap-8\" aria-label=\"Main navigation\">\n <div\n className={cn({\n 'desktop:gap-16 flex': services?.download?.title,\n })}\n >\n <div\n className={cn('w-full', {\n 'desktop:flex-[1260]': services?.download?.title,\n })}\n >\n <Text html={services?.storeBenefits?.title} className=\" text-xl font-bold leading-[1.2] text-white\" />\n <div\n className={cn('laptop:flex-row desktop:gap-4 laptop:flex-wrap mt-4 flex flex-col gap-2', {\n 'desktop:max-w-[648px]': services?.download?.title,\n })}\n >\n {services?.storeBenefits?.reasons?.map((reasonItem: any) => (\n <div key={reasonItem?.id} className=\"desktop:min-w-[288px] flex flex-1 shrink-0 items-center gap-2\">\n <img\n src={reasonItem?.icon?.url}\n loading=\"lazy\"\n alt={reasonItem?.icon?.alt || ''}\n className=\"size-5 shrink-0\"\n />\n <Link\n href={`${getLocalizedPath(reasonItem?.link, locale)}?ref=footer`}\n asChild={!reasonItem?.link}\n className=\"no-underline\"\n >\n <Text\n html={reasonItem?.label}\n className=\"desktop:text-base text-sm font-bold leading-[1.2] text-[#B6B6BA]\"\n />\n </Link>\n </div>\n ))}\n </div>\n </div>\n <DownloadApp\n className={cn({\n 'desktop:flex-[404] hidden desktop:block': services?.download?.title,\n })}\n title={services?.download?.title}\n apps={services?.download?.apps}\n />\n </div>\n <div className=\"desktop:block hidden h-px bg-[#3D3E3F]\" aria-hidden=\"true\" />\n <div className=\"desktop:grid grid-cols-4 gap-4\">\n <MainNavMenu title={mainNav?.products?.title} lists={mainNav?.products?.products} />\n <MainNavMenu title={mainNav?.explore?.title} lists={mainNav?.explore?.explores} />\n <MainNavMenu title={mainNav?.support?.title} lists={mainNav?.support?.supports} />\n <div className=\"desktop:py-0 desktop:border-none border-t border-[#3D3E3F] pt-4\">\n <div className=\"desktop:pb-0 flex items-center justify-between pb-4\">\n <Text\n as=\"p\"\n html={mainNav?.contact?.title}\n className=\"text-xl font-bold leading-[1.2] text-white\"\n id={contactSectionId}\n />\n {isMobile && (\n <button\n onClick={() => setMainNavMenuOpen(!mainNavMenuOpen)}\n aria-expanded={mainNavMenuOpen}\n aria-controls={contactSectionId}\n aria-label={mainNavMenuOpen ? 'Collapse contact section' : 'Expand contact section'}\n >\n {mainNavMenuOpen ? <SubtractIcon width={20} height={20} /> : <AddIcon width={20} height={20} />}\n </button>\n )}\n </div>\n {((mainNavMenuOpen && isMobile) || !isMobile) && (\n <div\n className=\"desktop:mt-4 desktop:mb-0 mb-4 flex flex-col gap-2\"\n role=\"region\"\n aria-labelledby={contactSectionId}\n >\n {mainNav?.contact?.contacts?.map((contactItem: any) => (\n <Link\n key={contactItem?.id}\n href={contactItem?.link}\n className=\"group flex items-start gap-2 no-underline\"\n >\n <img\n src={contactItem?.icon?.url}\n loading=\"lazy\"\n alt={contactItem?.icon?.alt}\n className=\"size-5 shrink-0 opacity-70 transition-opacity duration-200 group-hover:opacity-100\"\n />\n <Text\n html={contactItem?.label}\n className=\"desktop:text-base text-sm font-bold leading-[1.2] text-[#B6B6BA] transition-colors duration-200 group-hover:text-white\"\n />\n </Link>\n ))}\n </div>\n )}\n <ChangeCountry\n country={currentCountry || country}\n className=\"desktop:hidden border-b border-[#3D3E3F]\"\n isMobile={isMobile}\n onChangeCountry={event?.country}\n />\n <div className=\"desktop:hidden mt-8\">\n <DownloadApp title={services?.download?.title} apps={services?.download?.apps} />\n </div>\n {!!mainNav?.socials?.length && (\n <div className=\"mt-8 flex items-center gap-2\" role=\"list\" aria-label=\"Social media links\">\n {mainNav?.socials?.map((socialItem: any) => (\n <Link\n href={`${getLocalizedPath(socialItem?.link, locale)}?ref=footer`}\n key={socialItem?.id}\n className=\"group\"\n role=\"listitem\"\n aria-label={socialItem?.icon?.alt || 'Social media'}\n >\n <img\n src={socialItem?.icon?.url}\n loading=\"lazy\"\n alt={socialItem?.icon?.alt}\n className=\"size-8 shrink-0 opacity-70 transition-opacity duration-200 group-hover:opacity-100\"\n />\n </Link>\n ))}\n </div>\n )}\n <div className=\"mt-4 flex flex-wrap gap-2\" role=\"list\" aria-label=\"Payment methods\">\n {mainNav?.payment?.map((paymentItem: any) => (\n <Link\n href={getLocalizedPath(paymentItem?.link, locale)}\n asChild={!paymentItem?.link}\n key={paymentItem?.id}\n role=\"listitem\"\n aria-label={paymentItem?.icon?.alt || 'Payment method'}\n >\n <img\n src={paymentItem?.icon?.url}\n loading=\"lazy\"\n alt={paymentItem?.icon?.alt || ''}\n className=\"h-[28px] w-[44px] shrink-0\"\n />\n </Link>\n ))}\n </div>\n </div>\n </div>\n </nav>\n )\n}\n\nconst FooterBrand = ({\n data,\n isMobile,\n event,\n currentCountry,\n id = 'footer-brand',\n}: {\n data: any\n isMobile: boolean\n event: any\n currentCountry: any\n id?: string\n}) => {\n const { locale = 'us' } = useAiuiContext()\n\n return (\n <div id={id} className=\"flex flex-col gap-4\">\n <div className=\"desktop:items-center desktop:flex desktop:gap-4\">\n <div className=\"laptop:flex-row laptop:items-center desktop:flex-[980] flex flex-col items-start gap-4\">\n <Link href={`${getLocalizedPath(data?.brand?.link, locale)}?ref=footer`} asChild={!data?.brand?.link}>\n <Text html={data?.brand?.currentBrand} className=\"cursor-pointer text-[#B6B6BA] hover:text-white\" />\n </Link>\n <div className=\"laptop:block laptop:mb-[10px] hidden h-[20px] w-px bg-[#B6B6BA]\" />\n <div className=\"desktop:gap-6 flex flex-wrap items-center gap-4\">\n {data?.brand?.brands?.map((brandItem: any) => (\n <Link href={`${getLocalizedPath(brandItem?.link, locale)}?ref=footer`} key={brandItem?.id}>\n <Text html={brandItem?.icon} className=\"text-[#B6B6BA] hover:text-white\" />\n </Link>\n ))}\n </div>\n </div>\n <ChangeCountry\n country={currentCountry || data?.country}\n className=\"desktop:flex-[316] desktop:block hidden\"\n isMobile={isMobile}\n onChangeCountry={event?.country}\n />\n </div>\n <div className=\"h-px bg-[#3D3E3F]\" />\n <div className=\"laptop:flex-row desktop:gap-4 desktop:items-center flex flex-col items-start gap-1\">\n <Text\n html={data?.copyright?.label}\n className=\"desktop:text-base text-xs font-bold leading-[1.4] text-[#6D6D6F]\"\n />\n <div className=\"flex flex-wrap items-center gap-x-2 gap-y-1\">\n {data?.policy?.policies?.map((policyItem: any) => (\n <Link\n href={`${getLocalizedPath(policyItem?.link, locale)}?ref=footer`}\n key={policyItem?.id}\n className=\"desktop:text-base text-xs font-bold leading-[1.4] text-[#B6B6BA] no-underline hover:text-white\"\n >\n {policyItem?.label}\n </Link>\n ))}\n {data?.policy?.cookies && (\n <button\n data-cc=\"show-preferencesModal\"\n onClick={event?.cookiesSet}\n className=\"desktop:text-base text-xs font-bold leading-[1.4] text-[#B6B6BA] no-underline hover:text-white focus:outline-none focus:ring-2 focus:ring-white focus:ring-offset-2 focus:ring-offset-black\"\n aria-label={`Cookie preferences: ${data?.policy?.cookies}`}\n >\n {data?.policy?.cookies}\n </button>\n )}\n </div>\n </div>\n </div>\n )\n}\n\nconst MainNavMenu = ({ title, lists, className }: { title: string; lists: any[]; className?: string }) => {\n const { locale = 'us' } = useAiuiContext()\n const [mainNavMenuOpen, setMainNavMenuOpen] = useState<boolean>(false)\n const [isMobile, setIsMobile] = useState(false)\n\n const mediaQuery = useMediaQuery({ query: '(max-width: 1439px)' })\n\n useEffect(() => {\n setIsMobile(mediaQuery)\n }, [mediaQuery])\n\n const sectionId = `nav-section-${title?.replace(/\\s+/g, '-').toLowerCase()}`\n\n return (\n <div className={cn('desktop:py-0 desktop:border-none border-t border-[#3D3E3F] py-4', className)}>\n <div className=\"flex items-center justify-between\">\n <Text as=\"p\" html={title} className=\"text-xl font-bold leading-[1.2] text-white\" id={sectionId} />\n {isMobile && (\n <button\n onClick={() => setMainNavMenuOpen(!mainNavMenuOpen)}\n aria-expanded={mainNavMenuOpen}\n aria-controls={sectionId}\n aria-label={mainNavMenuOpen ? `Collapse ${title}` : `Expand ${title}`}\n className=\"focus:outline-none focus:ring-2 focus:ring-white focus:ring-offset-2 focus:ring-offset-black\"\n >\n {mainNavMenuOpen ? <SubtractIcon width={20} height={20} /> : <AddIcon width={20} height={20} />}\n </button>\n )}\n </div>\n {((mainNavMenuOpen && isMobile) || !isMobile) && (\n <nav className=\"mt-4 flex flex-col gap-2\" role=\"region\" aria-labelledby={sectionId}>\n {lists?.map((item: any) => (\n <Link href={`${getLocalizedPath(item?.link, locale)}?ref=footer`} key={item?.id} className=\"no-underline\">\n <Text\n html={item?.label}\n className=\"desktop:text-base text-sm font-bold leading-[1.2] text-[#B6B6BA] hover:text-white\"\n />\n </Link>\n ))}\n </nav>\n )}\n </div>\n )\n}\n\n/**\n * DownloadApp \u4E0B\u8F7D\u5E94\u7528\u6A21\u5757\n * @param title\n * @param apps\n * @param className\n * @returns\n */\nconst DownloadApp = ({ title, apps, className }: { title: string; apps: any[]; className?: string }) => {\n const { locale = 'us' } = useAiuiContext()\n\n if (!apps?.length) return null\n return (\n <div className={className}>\n <Text html={title} className=\" text-xl font-bold leading-[1.2] text-white\" />\n <div className=\"mt-4 flex items-center gap-4\" role=\"list\" aria-label=\"Download apps\">\n {apps?.map((appItem: any) => (\n <Link\n key={appItem?.id}\n href={getLocalizedPath(appItem?.link, locale)}\n className=\"group flex flex-col items-center gap-[6px]\"\n role=\"listitem\"\n aria-label={appItem?.icon?.alt || appItem?.label || 'Download app'}\n >\n <img\n src={appItem?.icon?.url}\n loading=\"lazy\"\n alt={appItem?.icon?.alt}\n className=\"size-10 shrink-0 opacity-70 transition-opacity duration-200 group-hover:opacity-100\"\n />\n {appItem?.label && (\n <Text\n html={appItem?.label}\n className=\"text-xs font-bold text-[#999999] transition-colors duration-200 group-hover:text-white\"\n />\n )}\n </Link>\n ))}\n </div>\n </div>\n )\n}\n\n/**\n * ChangeCountry \u5207\u6362\u56FD\u5BB6\u6A21\u5757\n * @param data \u6570\u636E\n * @param isMobile \u662F\u5426\u662F\u79FB\u52A8\u7AEF\n * @returns\n */\nconst ChangeCountry = ({\n country,\n isMobile,\n className,\n onChangeCountry,\n}: {\n country: any\n isMobile: boolean\n className?: string\n onChangeCountry?: () => void\n}) => {\n return (\n <div className={cn('desktop:py-0 desktop:border-none border-t border-[#3D3E3F] py-4', className)}>\n <button\n onClick={() => onChangeCountry?.()}\n className=\"flex w-full items-center justify-between focus:outline-none focus:ring-2 focus:ring-white focus:ring-offset-2 focus:ring-offset-black\"\n aria-label={`Change country/region, current: ${country?.countryName || country?.country}`}\n >\n <div className=\"group flex items-center gap-2\">\n <CountryIcon\n width={20}\n height={20}\n className=\"shrink-0 opacity-70 transition-opacity duration-200 group-hover:opacity-100\"\n aria-hidden=\"true\"\n />\n <Text\n as=\"span\"\n html={country?.countryName || country?.country}\n className=\"desktop:text-[#B6B6BA] desktop:group-hover:text-white text-base font-bold leading-[1.4] text-white transition-colors duration-200\"\n />\n </div>\n {isMobile && <ArrowRightIcon width={20} height={20} aria-hidden=\"true\" />}\n </button>\n </div>\n )\n}\n\nexport default withLayout(FooterNavigation)\n"],
|
|
5
|
-
"mappings": "AAmCM,OAIE,OAAAA,EAJF,QAAAC,MAAA,oBAnCN,OAAS,aAAAC,EAAW,WAAAC,EAAS,YAAAC,MAAgB,QAC7C,OAAS,QAAAC,EAAM,aAAAC,EAAW,QAAAC,MAAY,4BACtC,OAAOC,MAAe,wBAEtB,OAAS,6BAAAC,MAAiC,aAC1C,OAAS,WAAAC,EAAS,gBAAAC,EAAc,kBAAAC,EAAgB,eAAAC,MAAmB,mBACnE,OAAS,iBAAAC,MAAqB,mBAC9B,OAAS,MAAAC,EAAI,oBAAAC,MAAwB,yBACrC,OAAS,kBAAAC,MAAsB,2BAC/B,OAAS,cAAAC,MAAkB,yBAE3B,MAAMC,EAAmB,CAAC,CACxB,KAAM,CAAE,OAAAC,CAAO,EAAI,CAAC,EACpB,eAAAC,EACA,MAAAC,EACA,iBAAAC,EACA,WAAAC,EACA,UAAAC,EACA,UAAAC,EACA,GAAGC,CACL,IAA6B,CAC3B,KAAM,CAACC,EAAUC,CAAW,EAAIzB,EAAS,EAAK,EAExC0B,EAAahB,EAAc,CAAE,MAAO,qBAAsB,CAAC,EAEjEZ,EAAU,IAAM,CACd2B,EAAYC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,OAAI,UAAU,0CAA0C,EACzDC,EAAC,OAAI,UAAU,uEACb,UAAAA,EAAC,OAAI,UAAU,SACb,UAAAD,EAACK,EAAA,CAAK,KAAM+B,GAAM,OAAO,MAAO,UAAU,8CAA8C,EACxFpC,EAAC,OAAI,UAAU,2BACZ,SAAAoC,GAAM,OAAO,QAAQ,IAAKI,GACzBvC,EAAC,OAAwB,UAAU,wBACjC,UAAAD,EAAC,OACC,IAAKwC,GAAW,MAAM,IACtB,QAAQ,OACR,IAAKA,GAAW,MAAM,KAAO,GAC7B,UAAU,kBACZ,EACAxC,EAACK,EAAA,CACC,KAAMmC,GAAW,MACjB,UAAU,mEACZ,IAVQA,GAAW,EAWrB,CACD,EACH,GACF,EACAxC,EAAC,OAAI,UAAU,yCAAyC,EACxDC,EAAC,OAAI,UAAU,SACb,UAAAD,EAACK,EAAA,CAAK,KAAM+B,GAAM,SAAS,MAAO,UAAU,6CAA6C,EACzFpC,EAAC,OAAI,UAAU,2BACZ,SAAAoC,GAAM,SAAS,UAAU,IAAKK,GAC7BzC,EAACO,EAAA,CACC,
|
|
4
|
+
"sourcesContent": ["import { useEffect, useMemo, useState } from 'react'\nimport { Text, Container, Link } from '../../components/index.js'\nimport Subscribe from '../Subscribe/index.js'\nimport type { FooterNavigationProps } from './types.js'\nimport { FooterNavigationBlockType } from './types.js'\nimport { AddIcon, SubtractIcon, ArrowRightIcon, CountryIcon } from './icons/index.js'\nimport { useMediaQuery } from 'react-responsive'\nimport { cn, getLocalizedPath } from '../../helpers/utils.js'\nimport { useAiuiContext } from '../AiuiProvider/index.js'\nimport { withLayout } from '../../shared/Styles.js'\n\nconst FooterNavigation = ({\n data: { footer } = {},\n currentCountry,\n event,\n subscribeLoading,\n classNames,\n className,\n moduleIds,\n ...rest\n}: FooterNavigationProps) => {\n const [isMobile, setIsMobile] = useState(false)\n\n const mediaQuery = useMediaQuery({ query: '(max-width: 1439px)' })\n\n useEffect(() => {\n setIsMobile(mediaQuery)\n }, [mediaQuery])\n\n const country = useMemo(() => {\n return footer?.blocks?.find((block: any) => block?.blockType === FooterNavigationBlockType.Brand)?.country || {}\n }, [footer])\n\n return (\n <footer {...rest} className={cn(classNames?.root, className)}>\n <Container\n className={cn(classNames?.child)}\n childClassName={cn('laptop:py-16 desktop:gap-16 flex flex-col gap-8 bg-black py-8')}\n >\n <Text html={footer?.story} className=\"desktop:text-sm text-xs font-bold text-[#6D6D6F]\" />\n {footer?.blocks?.map((block: any) => {\n if (block?.blockType === FooterNavigationBlockType.Signup) {\n return (\n <MarketingConversion\n key={block.id}\n subscribeLoading={subscribeLoading}\n data={block}\n onSubmit={event?.signup}\n id={moduleIds?.marketingConversion}\n />\n )\n }\n if (block?.blockType === FooterNavigationBlockType.Brand) {\n return (\n <FooterBrand\n key={block?.id}\n data={block}\n isMobile={isMobile}\n event={event}\n currentCountry={currentCountry}\n id={moduleIds?.footerBrand}\n />\n )\n }\n if (block?.blockType === FooterNavigationBlockType.Main) {\n return (\n <MainServices\n key={block.id}\n data={{ ...block, country }}\n event={event}\n isMobile={isMobile}\n currentCountry={currentCountry}\n id={moduleIds?.mainServices}\n />\n )\n }\n })}\n </Container>\n </footer>\n )\n}\n\n/**\n * MarketingConversion \u8425\u9500\u8F6C\u5316\u6A21\u5757\n * @param data\n * @param onSubmit signup\u63D0\u4EA4\u4E8B\u4EF6\n * @returns\n */\nconst MarketingConversion = ({\n data,\n onSubmit,\n subscribeLoading,\n id = 'footer-marketing-conversion',\n}: {\n data: any\n onSubmit?: (_params: any) => void\n subscribeLoading?: boolean\n id?: string\n}) => {\n const { locale = 'us' } = useAiuiContext()\n\n return (\n <div\n id={id}\n className=\"desktop:py-16 desktop:gap-16 laptop:px-8 desktop:flex-row rounded-btn flex flex-col gap-8 bg-[#1E2024] px-4 py-8\"\n >\n <Subscribe\n subscribeMetadata={data?.signup}\n className=\"desktop:flex-[744]\"\n onSubmit={onSubmit}\n loading={subscribeLoading}\n />\n <div className=\"desktop:hidden h-px w-full bg-[#3D3E3F]\" />\n <div className=\"desktop:gap-6 laptop:flex-row desktop:flex-[792] flex flex-col gap-4\">\n <div className=\"flex-1\">\n <Text html={data?.enjoy?.title} className=\" text-xl font-bold leading-[1.2] text-white\" />\n <div className=\"mt-4 flex flex-col gap-2\">\n {data?.enjoy?.enjoys?.map((enjoyItem: any) => (\n <div key={enjoyItem?.id} className=\"flex-start flex gap-2\">\n <img\n src={enjoyItem?.icon?.url}\n loading=\"lazy\"\n alt={enjoyItem?.icon?.alt || ''}\n className=\"size-5 shrink-0\"\n />\n <Text\n html={enjoyItem?.label}\n className=\"desktop:text-base text-sm font-bold leading-[1.2] text-[#B6B6BA]\"\n />\n </div>\n ))}\n </div>\n </div>\n <div className=\"desktop:block hidden w-px bg-[#3D3E3F]\" />\n <div className=\"flex-1\">\n <Text html={data?.benefit?.title} className=\"text-xl font-bold leading-[1.2] text-white\" />\n <div className=\"mt-4 flex flex-col gap-2\">\n {data?.benefit?.benefits?.map((benefitItem: any) => (\n <Link\n href={getLocalizedPath(benefitItem?.link, locale, 'ref=footer')}\n asChild={!benefitItem?.link}\n key={benefitItem?.id}\n className=\"no-underline\"\n >\n <Text\n html={benefitItem?.label}\n className=\"desktop:text-base text-sm font-bold leading-[1.2] text-[#B6B6BA] hover:text-white\"\n />\n </Link>\n ))}\n </div>\n </div>\n </div>\n </div>\n )\n}\n\n/**\n * MainServices \u4E3B\u5BFC\u822A\u4E0E\u670D\u52A1\u6A21\u5757\n * @param services \u670D\u52A1\n * @param mainNav \u4E3B\u5BFC\u822A\n * @param event \u4E8B\u4EF6\n * @param isMobile \u662F\u5426\u662F\u79FB\u52A8\u7AEF\n * @param currentCountry \u5F53\u524D\u56FD\u5BB6\n * @returns\n */\nconst MainServices = ({\n data,\n event,\n isMobile,\n currentCountry,\n id = 'footer-main-services',\n}: {\n data: any\n event: any\n isMobile: boolean\n currentCountry: any\n id?: string\n}) => {\n const { locale = 'us' } = useAiuiContext()\n const [mainNavMenuOpen, setMainNavMenuOpen] = useState<boolean>(false)\n const { services, mainNav, country } = data\n const contactSectionId = 'contact-section'\n\n return (\n <nav id={id} className=\"flex flex-col gap-8\" aria-label=\"Main navigation\">\n <div\n className={cn({\n 'desktop:gap-16 flex': services?.download?.title,\n })}\n >\n <div\n className={cn('w-full', {\n 'desktop:flex-[1260]': services?.download?.title,\n })}\n >\n <Text html={services?.storeBenefits?.title} className=\" text-xl font-bold leading-[1.2] text-white\" />\n <div\n className={cn('laptop:flex-row desktop:gap-4 laptop:flex-wrap mt-4 flex flex-col gap-2', {\n 'desktop:max-w-[648px]': services?.download?.title,\n })}\n >\n {services?.storeBenefits?.reasons?.map((reasonItem: any) => (\n <div key={reasonItem?.id} className=\"desktop:min-w-[288px] flex flex-1 shrink-0 items-center gap-2\">\n <img\n src={reasonItem?.icon?.url}\n loading=\"lazy\"\n alt={reasonItem?.icon?.alt || ''}\n className=\"size-5 shrink-0\"\n />\n <Link\n href={getLocalizedPath(reasonItem?.link, locale, 'ref=footer')}\n asChild={!reasonItem?.link}\n className=\"no-underline\"\n >\n <Text\n html={reasonItem?.label}\n className=\"desktop:text-base text-sm font-bold leading-[1.2] text-[#B6B6BA]\"\n />\n </Link>\n </div>\n ))}\n </div>\n </div>\n <DownloadApp\n className={cn({\n 'desktop:flex-[404] hidden desktop:block': services?.download?.title,\n })}\n title={services?.download?.title}\n apps={services?.download?.apps}\n />\n </div>\n <div className=\"desktop:block hidden h-px bg-[#3D3E3F]\" aria-hidden=\"true\" />\n <div className=\"desktop:grid grid-cols-4 gap-4\">\n <MainNavMenu title={mainNav?.products?.title} lists={mainNav?.products?.products} />\n <MainNavMenu title={mainNav?.explore?.title} lists={mainNav?.explore?.explores} />\n <MainNavMenu title={mainNav?.support?.title} lists={mainNav?.support?.supports} />\n <div className=\"desktop:py-0 desktop:border-none border-t border-[#3D3E3F] pt-4\">\n <div className=\"desktop:pb-0 flex items-center justify-between pb-4\">\n <Text\n as=\"p\"\n html={mainNav?.contact?.title}\n className=\"text-xl font-bold leading-[1.2] text-white\"\n id={contactSectionId}\n />\n {isMobile && (\n <button\n onClick={() => setMainNavMenuOpen(!mainNavMenuOpen)}\n aria-expanded={mainNavMenuOpen}\n aria-controls={contactSectionId}\n aria-label={mainNavMenuOpen ? 'Collapse contact section' : 'Expand contact section'}\n >\n {mainNavMenuOpen ? <SubtractIcon width={20} height={20} /> : <AddIcon width={20} height={20} />}\n </button>\n )}\n </div>\n {((mainNavMenuOpen && isMobile) || !isMobile) && (\n <div\n className=\"desktop:mt-4 desktop:mb-0 mb-4 flex flex-col gap-2\"\n role=\"region\"\n aria-labelledby={contactSectionId}\n >\n {mainNav?.contact?.contacts?.map((contactItem: any) => (\n <Link\n key={contactItem?.id}\n href={contactItem?.link}\n className=\"group flex items-start gap-2 no-underline\"\n >\n <img\n src={contactItem?.icon?.url}\n loading=\"lazy\"\n alt={contactItem?.icon?.alt}\n className=\"size-5 shrink-0 opacity-70 transition-opacity duration-200 group-hover:opacity-100\"\n />\n <Text\n html={contactItem?.label}\n className=\"desktop:text-base text-sm font-bold leading-[1.2] text-[#B6B6BA] transition-colors duration-200 group-hover:text-white\"\n />\n </Link>\n ))}\n </div>\n )}\n <ChangeCountry\n country={currentCountry || country}\n className=\"desktop:hidden border-b border-[#3D3E3F]\"\n isMobile={isMobile}\n onChangeCountry={event?.country}\n />\n <div className=\"desktop:hidden mt-8\">\n <DownloadApp title={services?.download?.title} apps={services?.download?.apps} />\n </div>\n {!!mainNav?.socials?.length && (\n <div className=\"mt-8 flex items-center gap-2\" role=\"list\" aria-label=\"Social media links\">\n {mainNav?.socials?.map((socialItem: any) => (\n <Link\n href={getLocalizedPath(socialItem?.link, locale, 'ref=footer')}\n key={socialItem?.id}\n className=\"group\"\n role=\"listitem\"\n aria-label={socialItem?.icon?.alt || 'Social media'}\n >\n <img\n src={socialItem?.icon?.url}\n loading=\"lazy\"\n alt={socialItem?.icon?.alt}\n className=\"size-8 shrink-0 opacity-70 transition-opacity duration-200 group-hover:opacity-100\"\n />\n </Link>\n ))}\n </div>\n )}\n <div className=\"mt-4 flex flex-wrap gap-2\" role=\"list\" aria-label=\"Payment methods\">\n {mainNav?.payment?.map((paymentItem: any) => (\n <Link\n href={getLocalizedPath(paymentItem?.link, locale)}\n asChild={!paymentItem?.link}\n key={paymentItem?.id}\n role=\"listitem\"\n aria-label={paymentItem?.icon?.alt || 'Payment method'}\n >\n <img\n src={paymentItem?.icon?.url}\n loading=\"lazy\"\n alt={paymentItem?.icon?.alt || ''}\n className=\"h-[28px] w-[44px] shrink-0\"\n />\n </Link>\n ))}\n </div>\n </div>\n </div>\n </nav>\n )\n}\n\nconst FooterBrand = ({\n data,\n isMobile,\n event,\n currentCountry,\n id = 'footer-brand',\n}: {\n data: any\n isMobile: boolean\n event: any\n currentCountry: any\n id?: string\n}) => {\n const { locale = 'us' } = useAiuiContext()\n\n return (\n <div id={id} className=\"flex flex-col gap-4\">\n <div className=\"desktop:items-center desktop:flex desktop:gap-4\">\n <div className=\"laptop:flex-row laptop:items-center desktop:flex-[980] flex flex-col items-start gap-4\">\n <Link href={getLocalizedPath(data?.brand?.link, locale, 'ref=footer')} asChild={!data?.brand?.link}>\n <Text html={data?.brand?.currentBrand} className=\"cursor-pointer text-[#B6B6BA] hover:text-white\" />\n </Link>\n <div className=\"laptop:block laptop:mb-[10px] hidden h-[20px] w-px bg-[#B6B6BA]\" />\n <div className=\"desktop:gap-6 flex flex-wrap items-center gap-4\">\n {data?.brand?.brands?.map((brandItem: any) => (\n <Link href={getLocalizedPath(brandItem?.link, locale, 'ref=footer')} key={brandItem?.id}>\n <Text html={brandItem?.icon} className=\"text-[#B6B6BA] hover:text-white\" />\n </Link>\n ))}\n </div>\n </div>\n <ChangeCountry\n country={currentCountry || data?.country}\n className=\"desktop:flex-[316] desktop:block hidden\"\n isMobile={isMobile}\n onChangeCountry={event?.country}\n />\n </div>\n <div className=\"h-px bg-[#3D3E3F]\" />\n <div className=\"laptop:flex-row desktop:gap-4 desktop:items-center flex flex-col items-start gap-1\">\n <Text\n html={data?.copyright?.label}\n className=\"desktop:text-base text-xs font-bold leading-[1.4] text-[#6D6D6F]\"\n />\n <div className=\"flex flex-wrap items-center gap-x-2 gap-y-1\">\n {data?.policy?.policies?.map((policyItem: any) => (\n <Link\n href={getLocalizedPath(policyItem?.link, locale, 'ref=footer')}\n key={policyItem?.id}\n className=\"desktop:text-base text-xs font-bold leading-[1.4] text-[#B6B6BA] no-underline hover:text-white\"\n >\n {policyItem?.label}\n </Link>\n ))}\n {data?.policy?.cookies && (\n <button\n data-cc=\"show-preferencesModal\"\n onClick={event?.cookiesSet}\n className=\"desktop:text-base text-xs font-bold leading-[1.4] text-[#B6B6BA] no-underline hover:text-white focus:outline-none focus:ring-2 focus:ring-white focus:ring-offset-2 focus:ring-offset-black\"\n aria-label={`Cookie preferences: ${data?.policy?.cookies}`}\n >\n {data?.policy?.cookies}\n </button>\n )}\n </div>\n </div>\n </div>\n )\n}\n\nconst MainNavMenu = ({ title, lists, className }: { title: string; lists: any[]; className?: string }) => {\n const { locale = 'us' } = useAiuiContext()\n const [mainNavMenuOpen, setMainNavMenuOpen] = useState<boolean>(false)\n const [isMobile, setIsMobile] = useState(false)\n\n const mediaQuery = useMediaQuery({ query: '(max-width: 1439px)' })\n\n useEffect(() => {\n setIsMobile(mediaQuery)\n }, [mediaQuery])\n\n const sectionId = `nav-section-${title?.replace(/\\s+/g, '-').toLowerCase()}`\n\n return (\n <div className={cn('desktop:py-0 desktop:border-none border-t border-[#3D3E3F] py-4', className)}>\n <div className=\"flex items-center justify-between\">\n <Text as=\"p\" html={title} className=\"text-xl font-bold leading-[1.2] text-white\" id={sectionId} />\n {isMobile && (\n <button\n onClick={() => setMainNavMenuOpen(!mainNavMenuOpen)}\n aria-expanded={mainNavMenuOpen}\n aria-controls={sectionId}\n aria-label={mainNavMenuOpen ? `Collapse ${title}` : `Expand ${title}`}\n className=\"focus:outline-none focus:ring-2 focus:ring-white focus:ring-offset-2 focus:ring-offset-black\"\n >\n {mainNavMenuOpen ? <SubtractIcon width={20} height={20} /> : <AddIcon width={20} height={20} />}\n </button>\n )}\n </div>\n {((mainNavMenuOpen && isMobile) || !isMobile) && (\n <nav className=\"mt-4 flex flex-col gap-2\" role=\"region\" aria-labelledby={sectionId}>\n {lists?.map((item: any) => (\n <Link href={getLocalizedPath(item?.link, locale, 'ref=footer')} key={item?.id} className=\"no-underline\">\n <Text\n html={item?.label}\n className=\"desktop:text-base text-sm font-bold leading-[1.2] text-[#B6B6BA] hover:text-white\"\n />\n </Link>\n ))}\n </nav>\n )}\n </div>\n )\n}\n\n/**\n * DownloadApp \u4E0B\u8F7D\u5E94\u7528\u6A21\u5757\n * @param title\n * @param apps\n * @param className\n * @returns\n */\nconst DownloadApp = ({ title, apps, className }: { title: string; apps: any[]; className?: string }) => {\n const { locale = 'us' } = useAiuiContext()\n\n if (!apps?.length) return null\n return (\n <div className={className}>\n <Text html={title} className=\" text-xl font-bold leading-[1.2] text-white\" />\n <div className=\"mt-4 flex items-center gap-4\" role=\"list\" aria-label=\"Download apps\">\n {apps?.map((appItem: any) => (\n <Link\n key={appItem?.id}\n href={getLocalizedPath(appItem?.link, locale)}\n className=\"group flex flex-col items-center gap-[6px]\"\n role=\"listitem\"\n aria-label={appItem?.icon?.alt || appItem?.label || 'Download app'}\n >\n <img\n src={appItem?.icon?.url}\n loading=\"lazy\"\n alt={appItem?.icon?.alt}\n className=\"size-10 shrink-0 opacity-70 transition-opacity duration-200 group-hover:opacity-100\"\n />\n {appItem?.label && (\n <Text\n html={appItem?.label}\n className=\"text-xs font-bold text-[#999999] transition-colors duration-200 group-hover:text-white\"\n />\n )}\n </Link>\n ))}\n </div>\n </div>\n )\n}\n\n/**\n * ChangeCountry \u5207\u6362\u56FD\u5BB6\u6A21\u5757\n * @param data \u6570\u636E\n * @param isMobile \u662F\u5426\u662F\u79FB\u52A8\u7AEF\n * @returns\n */\nconst ChangeCountry = ({\n country,\n isMobile,\n className,\n onChangeCountry,\n}: {\n country: any\n isMobile: boolean\n className?: string\n onChangeCountry?: () => void\n}) => {\n return (\n <div className={cn('desktop:py-0 desktop:border-none border-t border-[#3D3E3F] py-4', className)}>\n <button\n onClick={() => onChangeCountry?.()}\n className=\"flex w-full items-center justify-between focus:outline-none focus:ring-2 focus:ring-white focus:ring-offset-2 focus:ring-offset-black\"\n aria-label={`Change country/region, current: ${country?.countryName || country?.country}`}\n >\n <div className=\"group flex items-center gap-2\">\n <CountryIcon\n width={20}\n height={20}\n className=\"shrink-0 opacity-70 transition-opacity duration-200 group-hover:opacity-100\"\n aria-hidden=\"true\"\n />\n <Text\n as=\"span\"\n html={country?.countryName || country?.country}\n className=\"desktop:text-[#B6B6BA] desktop:group-hover:text-white text-base font-bold leading-[1.4] text-white transition-colors duration-200\"\n />\n </div>\n {isMobile && <ArrowRightIcon width={20} height={20} aria-hidden=\"true\" />}\n </button>\n </div>\n )\n}\n\nexport default withLayout(FooterNavigation)\n"],
|
|
5
|
+
"mappings": "AAmCM,OAIE,OAAAA,EAJF,QAAAC,MAAA,oBAnCN,OAAS,aAAAC,EAAW,WAAAC,EAAS,YAAAC,MAAgB,QAC7C,OAAS,QAAAC,EAAM,aAAAC,EAAW,QAAAC,MAAY,4BACtC,OAAOC,MAAe,wBAEtB,OAAS,6BAAAC,MAAiC,aAC1C,OAAS,WAAAC,EAAS,gBAAAC,EAAc,kBAAAC,EAAgB,eAAAC,MAAmB,mBACnE,OAAS,iBAAAC,MAAqB,mBAC9B,OAAS,MAAAC,EAAI,oBAAAC,MAAwB,yBACrC,OAAS,kBAAAC,MAAsB,2BAC/B,OAAS,cAAAC,MAAkB,yBAE3B,MAAMC,EAAmB,CAAC,CACxB,KAAM,CAAE,OAAAC,CAAO,EAAI,CAAC,EACpB,eAAAC,EACA,MAAAC,EACA,iBAAAC,EACA,WAAAC,EACA,UAAAC,EACA,UAAAC,EACA,GAAGC,CACL,IAA6B,CAC3B,KAAM,CAACC,EAAUC,CAAW,EAAIzB,EAAS,EAAK,EAExC0B,EA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B,EACA,SAAAH,EACA,UAAAH,EACA,gBAAAqC,CACF,IAOI9D,EAAC,OAAI,UAAWe,EAAG,kEAAmEU,CAAS,EAC7F,SAAAxB,EAAC,UACC,QAAS,IAAM6D,IAAkB,EACjC,UAAU,wIACV,aAAY,mCAAmC/B,GAAS,aAAeA,GAAS,OAAO,GAEvF,UAAA9B,EAAC,OAAI,UAAU,gCACb,UAAAD,EAACa,EAAA,CACC,MAAO,GACP,OAAQ,GACR,UAAU,8EACV,cAAY,OACd,EACAb,EAACK,EAAA,CACC,GAAG,OACH,KAAM0B,GAAS,aAAeA,GAAS,QACvC,UAAU,oIACZ,GACF,EACCH,GAAY5B,EAACY,EAAA,CAAe,MAAO,GAAI,OAAQ,GAAI,cAAY,OAAO,GACzE,EACF,EAIJ,IAAOmD,EAAQ7C,EAAWC,CAAgB",
|
|
6
6
|
"names": ["jsx", "jsxs", "useEffect", "useMemo", "useState", "Text", "Container", "Link", "Subscribe", "FooterNavigationBlockType", "AddIcon", "SubtractIcon", "ArrowRightIcon", "CountryIcon", "useMediaQuery", "cn", "getLocalizedPath", "useAiuiContext", "withLayout", "FooterNavigation", "footer", "currentCountry", "event", "subscribeLoading", "classNames", "className", "moduleIds", "rest", "isMobile", "setIsMobile", "mediaQuery", "country", "block", "MarketingConversion", "FooterBrand", "MainServices", "data", "onSubmit", "id", "locale", "enjoyItem", "benefitItem", "mainNavMenuOpen", "setMainNavMenuOpen", "services", "mainNav", "contactSectionId", "reasonItem", "DownloadApp", "MainNavMenu", "contactItem", "ChangeCountry", "socialItem", "paymentItem", "brandItem", "policyItem", "title", "lists", "sectionId", "item", "apps", "appItem", "onChangeCountry", "FooterNavigation_default"]
|
|
7
7
|
}
|