{"version":3,"file":"utils.BZsua8Yc.mjs","names":["useMemo"],"sources":["https:/framerusercontent.com/modules/vC6fzbfO83MgBPIhn5zl/DUlbmWuOELzEUenVmv3G/locales.js","https:/framer.com/m/framer/icon-nullstate.js@0.7.0","https:/framerusercontent.com/modules/Ma20hU0GGRxLxZphbywl/OSpwWF91FHPVFyQJjMHt/utils.js"],"sourcesContent":["export const getCurrentLanguage=()=>{if(typeof window===\"undefined\")return\"en\";// First check URL path for language\nconst pathname=window.location.pathname;const pathSegments=pathname.split(\"/\").filter(Boolean);const validLanguages=[// Basic language codes\n\"ar\",\"bg\",\"bn\",\"cs\",\"da\",\"de\",\"el\",\"en\",\"es\",\"fi\",\"fr\",\"he\",\"hi\",\"hr\",\"hu\",\"id\",\"it\",\"ja\",\"ko\",\"lt\",\"ms\",\"nb\",\"nl\",\"pl\",\"ro\",\"ru\",\"sk\",\"sl\",\"sr\",\"sv\",\"ta\",\"th\",\"tr\",\"uk\",\"vi\",// Region-specific language codes\n\"pt-BR\",\"pt-PT\",\"zh-CN\",\"zh-TW\"];// Helper function to normalize language codes\nconst normalizeLanguageCode=code=>{const lowerCode=code.toLowerCase();// Special handling for region-specific codes\nif(lowerCode===\"pt\"||lowerCode.startsWith(\"pt-\")){// Default Portuguese to Brazilian Portuguese if no specific region\nif(lowerCode.length===2)return\"pt-BR\";// Preserve uppercase region codes for Portuguese\nconst region=code.substring(3).toUpperCase();return`pt-${region}`;}if(lowerCode===\"zh\"||lowerCode.startsWith(\"zh-\")){// Default Chinese to Simplified Chinese if no specific region\nif(lowerCode.length===2)return\"zh-CN\";// Preserve uppercase region codes for Chinese\nconst region=code.substring(3).toUpperCase();return`zh-${region}`;}// For basic language codes, return lowercase\nreturn lowerCode;};// Check if the first path segment is a valid language code\nif(pathSegments[0]){const normalizedCode=normalizeLanguageCode(pathSegments[0]);if(validLanguages.includes(normalizedCode)){return normalizedCode;}}// Then check sessionStorage for checkoutLocale\nconst sessionStorageLocale=sessionStorage.getItem(\"checkoutLocale\");if(sessionStorageLocale){const normalizedLocale=normalizeLanguageCode(sessionStorageLocale);if(validLanguages.includes(normalizedLocale)){return normalizedLocale;}}// Then check localStorage for checkoutLocale\nconst localStorageLocale=localStorage.getItem(\"checkoutLocale\");if(localStorageLocale){const normalizedLocale=normalizeLanguageCode(localStorageLocale);if(validLanguages.includes(normalizedLocale)){return normalizedLocale;}}// Then check if we have a default language set in the window config\nif(window.__FcCheckoutConfigs?.locale){const configLocale=normalizeLanguageCode(window.__FcCheckoutConfigs.locale);if(validLanguages.includes(configLocale)){return configLocale;}}return\"en\";};export const appendLanguageToUrl=url=>{if(!url)return url;try{const urlObj=new URL(url);const currentLang=getCurrentLanguage();urlObj.searchParams.delete(\"locale\");urlObj.searchParams.append(\"locale\",currentLang);return urlObj.toString();}catch(error){console.error(\"Error in appendLanguageToUrl:\",error);return url;}};// Helper function to map country code to appropriate locale\nexport const getLocaleFromCountry=countryCode=>{// Default fallback locale\nif(!countryCode)return undefined;// Common country code to locale mappings\nconst countryToLocale={// North America\nUS:\"en-US\",CA:\"en-CA\",QC:\"fr-CA\",// Europe\nGB:\"en-GB\",FR:\"fr-FR\",DE:\"de-DE\",IT:\"it-IT\",ES:\"es-ES\",PT:\"pt-PT\",NL:\"nl-NL\",BE:\"fr-BE\",LU:\"fr-LU\",CH:\"de-CH\",AT:\"de-AT\",SE:\"sv-SE\",NO:\"nb-NO\",DK:\"da-DK\",FI:\"fi-FI\",PL:\"pl-PL\",CZ:\"cs-CZ\",HU:\"hu-HU\",RU:\"ru-RU\",// Asia Pacific\nCN:\"zh-CN\",JP:\"ja-JP\",KR:\"ko-KR\",IN:\"en-IN\",AU:\"en-AU\",NZ:\"en-NZ\",// Latin America\nMX:\"es-MX\",BR:\"pt-BR\",AR:\"es-AR\",CL:\"es-CL\",CO:\"es-CO\",PE:\"es-PE\",// Middle East & Africa\nAE:\"ar-AE\",SA:\"ar-SA\",ZA:\"en-ZA\",IL:\"he-IL\"};return countryToLocale[countryCode]||undefined;};\nexport const __FramerMetadata__ = {\"exports\":{\"getCurrentLanguage\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"getLocaleFromCountry\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"appendLanguageToUrl\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./locales.map","import { jsx as _jsx } from \"react/jsx-runtime\";\nimport * as React from \"react\";\nexport const containerStyles = {\n    width: \"100%\",\n    height: \"100%\",\n    display: \"flex\",\n    justifyContent: \"center\",\n    alignItems: \"center\"\n};\nconst nullIconStyle = {\n    minWidth: \"10px\",\n    minHeight: \"10px\",\n    maxWidth: \"20px\",\n    maxHeight: \"20px\",\n    width: \"60%\",\n    height: \"60%\"\n};\nconst emptyStateStyle = {\n    ...containerStyles,\n    borderRadius: 6,\n    background: \"rgba(149, 149, 149, 0.1)\",\n    border: \"1px dashed rgba(149, 149, 149, 0.15)\",\n    color: \"#a5a5a5\",\n    flexDirection: \"column\"\n};\nexport const NullState = /*#__PURE__*/ React.forwardRef((_, ref)=>{\n    return(/*#__PURE__*/ _jsx(\"div\", {\n        style: emptyStateStyle,\n        ref: ref\n    }));\n}) /*\n\n<svg\n                xmlns=\"http://www.w3.org/2000/svg\"\n                viewBox=\"0 0 30 30\"\n                style={nullIconStyle}\n            >\n                <path\n                    d=\"M 12.857 0 C 19.958 0 25.714 5.756 25.714 12.857 C 25.714 19.958 19.958 25.714 12.857 25.714 C 5.756 25.714 0 19.958 0 12.857 C 0 5.756 5.756 0 12.857 0 Z\"\n                    fill=\"#FFFFFF\"\n                ></path>\n                <path\n                    d=\"M 20.357 20.357 L 27.857 27.857\"\n                    fill=\"transparent\"\n                    strokeWidth=\"4.28\"\n                    stroke=\"#FFFFFF\"\n                    strokeLinecap=\"round\"\n                ></path>\n                <g transform=\"translate(9.643 6.429)\">\n                    <path\n                        d=\"M 3.214 12.857 L 3.214 12.857\"\n                        fill=\"transparent\"\n                        strokeWidth=\"3.75\"\n                        stroke=\"currentColor\"\n                        strokeLinecap=\"round\"\n                    ></path>\n                    <path\n                        d=\"M 0 3.214 C 0 1.004 1.843 0 3.214 0 C 4.586 0 6.429 0.603 6.429 3.214 C 6.429 5.826 3.214 5.913 3.214 7.232 C 3.214 8.552 3.214 8.571 3.214 8.571\"\n                        fill=\"transparent\"\n                        strokeWidth=\"3.22\"\n                        stroke=\"currentColor\"\n                        strokeLinecap=\"round\"\n                        strokeLinejoin=\"round\"\n                    ></path>\n                </g>\n            </svg>\n            */ ;\n\nexport const __FramerMetadata__ = {\"exports\":{\"containerStyles\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"NullState\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}}}}\n//# sourceMappingURL=./nullstate.map","import{useMemo}from\"react\";import{ControlType}from\"framer\";/*\n ** ICON UTILS\n ** Pull as much re-usable logic into here as possible\n ** This will make it easier to replace in all icon components\n */ export const containerStyles={width:\"100%\",height:\"100%\",display:\"flex\",justifyContent:\"center\",alignItems:\"center\"};export const defaultEvents={onClick:{type:ControlType.EventHandler},onMouseDown:{type:ControlType.EventHandler},onMouseUp:{type:ControlType.EventHandler},onMouseEnter:{type:ControlType.EventHandler},onMouseLeave:{type:ControlType.EventHandler}};const findByArray=(arr,search)=>arr.find(a=>a.toLowerCase().includes(search));export function getIconSelection(iconKeys,selectByList,iconSearch=\"\",iconSelection,lowercaseIconKeyPairs){// gotta get the exact match first THEN find\n// have a set and try to access ?\nif(selectByList)return iconSelection;if(iconSearch==null||(iconSearch===null||iconSearch===void 0?void 0:iconSearch.length)===0)return null;const iconSearchTerm=iconSearch.toLowerCase().replace(/-|\\s/g,\"\");var _iconSearchTerm;// check for exact match, otherwise use .find\nconst searchResult=(_iconSearchTerm=lowercaseIconKeyPairs[iconSearchTerm])!==null&&_iconSearchTerm!==void 0?_iconSearchTerm:findByArray(iconKeys,iconSearchTerm);return searchResult;}export function useIconSelection(iconKeys,selectByList,iconSearch=\"\",iconSelection,lowercaseIconKeyPairs){// Clean search term\nconst iconSearchResult=useMemo(()=>{if(iconSearch==null||(iconSearch===null||iconSearch===void 0?void 0:iconSearch.length)===0)return null;const iconSearchTerm=iconSearch.toLowerCase().replace(/-|\\s/g,\"\");var _iconSearchTerm;// check for exact match, otherwise use .find\nconst searchResult=(_iconSearchTerm=lowercaseIconKeyPairs[iconSearchTerm])!==null&&_iconSearchTerm!==void 0?_iconSearchTerm:findByArray(iconKeys,iconSearchTerm);return searchResult;},[iconSelection,iconSearch]);const name=selectByList?iconSelection:iconSearchResult;return name;}\nexport const __FramerMetadata__ = {\"exports\":{\"getIconSelection\":{\"type\":\"function\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"containerStyles\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"useIconSelection\":{\"type\":\"function\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"defaultEvents\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./utils.map"],"mappings":"gTAAa,MAAuB,CAAC,GAAU,IAAS,OAAY,MAAM,KAClC,IAAM,EAA/B,EAAO,SAAS,SAAqC,MAAM,IAAI,CAAC,OAAO,QAAQ,CAAO,EAAe,6IAEpF,CAC1B,EAAsB,GAAM,CAAC,IAAM,EAAU,EAAK,aAAa,CAMrE,OALG,IAAY,MAAM,EAAU,WAAW,MAAM,CAC7C,EAAU,SAAS,EAAQ,QACqB,MAAtC,EAAK,UAAU,EAAE,CAAC,aAAa,GAA0B,IAAY,MAAM,EAAU,WAAW,MAAM,CAChH,EAAU,SAAS,EAAQ,QACqB,MAAtC,EAAK,UAAU,EAAE,CAAC,aAAa,GACrC,GACP,GAAG,EAAa,GAAG,CAAC,IAAM,EAAe,EAAsB,EAAa,GAAG,CAAC,GAAG,EAA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