@nuskin/shipping-address-form 1.7.7 → 1.7.8-3258-comuna.2

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.
@@ -109,6 +109,8 @@ const buildIntlVerifiedAddressMapping = (validatedAddress = {}) => {
109
109
  address1: formatted.address1,
110
110
  address2: formatted.address2,
111
111
  city: components.locality || '',
112
+ district: components.sub_administrative_area || '',
113
+ region: components.administrative_area || '',
112
114
  postalCode: (0, _validators.normalizePostalCodeValue)(components.postal_code || '')
113
115
  },
114
116
  mapAddressLines: responseAddressLines.length ? responseAddressLines : formattedAddressLines
@@ -121,6 +123,7 @@ const buildIntlAutocompleteAddressMapping = (selectedAddress = {}, addressForm =
121
123
  address1: selectedAddress.street || '',
122
124
  address2: '',
123
125
  city: selectedAddress.locality || '',
126
+ district: selectedAddress.sub_administrative_area || '',
124
127
  region: selectedAddress.administrative_area || '',
125
128
  postalCode: (0, _validators.normalizePostalCodeValue)(selectedAddress.postal_code || '')
126
129
  };
@@ -1 +1 @@
1
- {"version":3,"file":"addressMapping.js","names":["_validators","require","joinAddressParts","parts","filter","Boolean","join","replace","trim","MANAGED_ADDRESS_FIELDS","Set","getMappedFieldValue","source","context","String","split","reduce","value","key","undefined","hasConfiguredMappings","mappingType","addressElements","some","element","_element$apiMappings","apiMappings","buildMappedFieldsFromConfig","mapped","forEach","_element$apiMappings2","field","has","normalizePostalCodeValue","STRUCTURED_LOCATION_TOKENS","stripEdgeCommasAndSpaces","start","end","length","includes","slice","normalizeFormattedLine","map","part","buildFormattedAddressLines","addressFormat","components","line","token","getAddressFormatTokens","addressFormatLine","match","isStructuredOnlyAddressFormatLine","tokens","every","buildUSFormattedAddress","validatedAddress","streetLine","primary_number","street_predirection","street_name","street_suffix","street_postdirection","secondaryLine","secondary_designator","secondary_number","extra_secondary_designator","extra_secondary_number","pmb_designator","pmb_number","formatted","address1","delivery_line_1","address2","delivery_line_2","exports","buildIntlFormattedAddress","_validatedAddress$met","_validatedAddress$met2","metadata","address_format","meta","addressFormatLines","formattedAddressLines","responseAddressLines","address3","fallbackAddress1","thoroughfare","premise","leadingStreetLineIndexes","indexes","index","stopped","values","push","buildIntlVerifiedAddressMapping","city","locality","postalCode","postal_code","mapAddressLines","buildIntlAutocompleteAddressMapping","selectedAddress","addressForm","fallbackMapped","street","region","administrative_area","buildIntlConfiguredVerificationMapping","fallback","mappingContext","preserveBlankConfiguredMappings","currentValues","nextMapped","_element$apiMappings3","buildUSVerifiedAddressMapping","city_name","state_abbreviation","zipcode"],"sources":["../../../src/addressLookup/utils/addressMapping.js"],"sourcesContent":["import { normalizePostalCodeValue } from './validators';\n\nconst joinAddressParts = (parts = []) => (\n parts.filter(Boolean).join(' ').replace(/\\s+/g, ' ').trim()\n);\n\nconst MANAGED_ADDRESS_FIELDS = new Set([\n 'address1',\n 'address2',\n 'city',\n 'district',\n 'region',\n 'postalCode'\n]);\n\nconst getMappedFieldValue = (source, context) => {\n if (!source) {\n return '';\n }\n\n return String(\n source.split('.').reduce((value, key) => (\n value && value[key] !== undefined ? value[key] : undefined\n ), context) || ''\n ).trim();\n};\n\nconst hasConfiguredMappings = (mappingType, addressElements = []) => (\n addressElements.some((element) => element.apiMappings?.[mappingType])\n);\n\nconst buildMappedFieldsFromConfig = (mappingType, context, addressElements = []) => {\n const mapped = {};\n\n addressElements.forEach((element) => {\n if (!element?.field || !MANAGED_ADDRESS_FIELDS.has(element.field)) {\n return;\n }\n\n const value = getMappedFieldValue(element.apiMappings?.[mappingType], context);\n mapped[element.field] = element.field === 'postalCode' ? normalizePostalCodeValue(value) : value;\n });\n\n return mapped;\n};\n\nconst STRUCTURED_LOCATION_TOKENS = new Set([\n 'locality',\n 'dependent_locality',\n 'double_dependent_locality',\n 'administrative_area',\n 'sub_administrative_area',\n 'postal_code',\n 'sorting_code',\n 'country'\n]);\n\nconst stripEdgeCommasAndSpaces = (value = '') => {\n let start = 0;\n let end = value.length;\n\n while (start < end && [',', ' '].includes(value[start])) {\n start += 1;\n }\n\n while (end > start && [',', ' '].includes(value[end - 1])) {\n end -= 1;\n }\n\n return value.slice(start, end);\n};\n\nconst normalizeFormattedLine = (value = '') => (\n stripEdgeCommasAndSpaces(\n String(value)\n .split(',')\n .map((part) => part.trim())\n .filter(Boolean)\n .join(', ')\n .split(/\\s+/)\n .filter(Boolean)\n .join(' ')\n )\n);\n\nconst buildFormattedAddressLines = (addressFormat = '', components = {}) => (\n String(addressFormat)\n .split('|')\n .map((line) => normalizeFormattedLine(\n line.replace(/\\b[a-z_]+\\b/g, (token) => components[token] || '')\n ))\n .filter(Boolean)\n);\n\nconst getAddressFormatTokens = (addressFormatLine = '') => (\n String(addressFormatLine).match(/[a-z_]+/g) || []\n);\n\nconst isStructuredOnlyAddressFormatLine = (addressFormatLine = '') => {\n const tokens = getAddressFormatTokens(addressFormatLine);\n return tokens.length > 0 && tokens.every((token) => STRUCTURED_LOCATION_TOKENS.has(token));\n};\n\nexport const buildUSFormattedAddress = (validatedAddress = {}) => {\n const components = validatedAddress.components || {};\n\n const streetLine = joinAddressParts([\n components.primary_number,\n components.street_predirection,\n components.street_name,\n components.street_suffix,\n components.street_postdirection\n ]);\n\n const secondaryLine = [\n joinAddressParts([components.secondary_designator, components.secondary_number]),\n joinAddressParts([components.extra_secondary_designator, components.extra_secondary_number]),\n joinAddressParts([components.pmb_designator, components.pmb_number])\n ].filter(Boolean).join(', ').trim();\n\n return {\n formatted: {\n address1: streetLine || validatedAddress.delivery_line_1 || '',\n address2: secondaryLine || validatedAddress.delivery_line_2 || ''\n }\n };\n};\n\nexport const buildIntlFormattedAddress = (validatedAddress = {}) => {\n const components = validatedAddress.components || {};\n const addressFormat = validatedAddress.metadata?.address_format || validatedAddress.meta?.address_format || '';\n const addressFormatLines = String(addressFormat).split('|');\n const formattedAddressLines = buildFormattedAddressLines(addressFormat, components);\n const responseAddressLines = [\n validatedAddress.address1,\n validatedAddress.address2,\n validatedAddress.address3\n ].filter(Boolean);\n\n const fallbackAddress1 = joinAddressParts([components.thoroughfare, components.premise]);\n const leadingStreetLineIndexes = addressFormatLines.reduce((indexes, line, index) => {\n if (indexes.stopped) {\n return indexes;\n }\n\n if (isStructuredOnlyAddressFormatLine(line)) {\n indexes.stopped = true;\n return indexes;\n }\n\n if (formattedAddressLines[index]) {\n indexes.values.push(index);\n }\n\n return indexes;\n }, { values: [], stopped: false }).values;\n\n const address1 = (\n formattedAddressLines[leadingStreetLineIndexes[0]] ||\n fallbackAddress1 ||\n ''\n );\n const address2 = leadingStreetLineIndexes.length > 1 ?\n (formattedAddressLines[leadingStreetLineIndexes[1]] || '') :\n '';\n\n return {\n formatted: {\n address1,\n address2\n },\n responseAddressLines,\n formattedAddressLines\n };\n};\n\nexport const buildIntlVerifiedAddressMapping = (validatedAddress = {}) => {\n const components = validatedAddress.components || {};\n const {\n formatted,\n responseAddressLines,\n formattedAddressLines\n } = buildIntlFormattedAddress(validatedAddress);\n\n return {\n formatted,\n mapped: {\n address1: formatted.address1,\n address2: formatted.address2,\n city: components.locality || '',\n postalCode: normalizePostalCodeValue(components.postal_code || '')\n },\n mapAddressLines: responseAddressLines.length ? responseAddressLines : formattedAddressLines\n };\n};\n\nexport const buildIntlAutocompleteAddressMapping = (\n selectedAddress = {},\n addressForm = null\n) => {\n const addressElements = addressForm?.addressElements || [];\n const fallbackMapped = {\n address1: selectedAddress.street || '',\n address2: '',\n city: selectedAddress.locality || '',\n region: selectedAddress.administrative_area || '',\n postalCode: normalizePostalCodeValue(selectedAddress.postal_code || '')\n };\n\n if (!hasConfiguredMappings('autocomplete', addressElements)) {\n return fallbackMapped;\n }\n\n return buildMappedFieldsFromConfig('autocomplete', selectedAddress, addressElements);\n};\n\nexport const buildIntlConfiguredVerificationMapping = (\n validatedAddress = {},\n addressForm = null\n) => {\n const fallback = buildIntlVerifiedAddressMapping(validatedAddress);\n const addressElements = addressForm?.addressElements || [];\n\n if (!hasConfiguredMappings('verification', addressElements)) {\n return fallback;\n }\n\n const mappingContext = {\n ...validatedAddress,\n formatted: fallback.formatted\n };\n\n return {\n ...fallback,\n mapped: buildMappedFieldsFromConfig('verification', mappingContext, addressElements)\n };\n};\n\nexport const preserveBlankConfiguredMappings = (mapped = {}, currentValues = {}, addressElements = [], mappingType) => {\n const nextMapped = { ...mapped };\n\n addressElements.forEach((element) => {\n if (!element?.field || !MANAGED_ADDRESS_FIELDS.has(element.field)) {\n return;\n }\n\n if (!element.apiMappings?.[mappingType]) {\n return;\n }\n\n if (nextMapped[element.field] !== '') {\n return;\n }\n\n nextMapped[element.field] = currentValues[element.field] || '';\n });\n\n return nextMapped;\n};\n\nexport const buildUSVerifiedAddressMapping = (validatedAddress = {}) => {\n const components = validatedAddress.components || {};\n const { formatted } = buildUSFormattedAddress(validatedAddress);\n const city = components.city_name || '';\n const region = components.state_abbreviation || '';\n const postalCode = normalizePostalCodeValue(components.zipcode || '');\n\n return {\n formatted,\n mapped: {\n address1: formatted.address1,\n address2: formatted.address2,\n city,\n region,\n postalCode\n },\n mapAddressLines: [\n formatted.address1,\n formatted.address2,\n [city, region, postalCode].filter(Boolean).join(' ')\n ].filter(Boolean)\n };\n};\n"],"mappings":";;;;;;AAAA,IAAAA,WAAA,GAAAC,OAAA;AAEA,MAAMC,gBAAgB,GAAGA,CAACC,KAAK,GAAG,EAAE,KAClCA,KAAK,CAACC,MAAM,CAACC,OAAO,CAAC,CAACC,IAAI,CAAC,GAAG,CAAC,CAACC,OAAO,CAAC,MAAM,EAAE,GAAG,CAAC,CAACC,IAAI,CAAC,CAC3D;AAED,MAAMC,sBAAsB,GAAG,IAAIC,GAAG,CAAC,CACrC,UAAU,EACV,UAAU,EACV,MAAM,EACN,UAAU,EACV,QAAQ,EACR,YAAY,CACb,CAAC;AAEF,MAAMC,mBAAmB,GAAGA,CAACC,MAAM,EAAEC,OAAO,KAAK;EAC/C,IAAI,CAACD,MAAM,EAAE;IACX,OAAO,EAAE;EACX;EAEA,OAAOE,MAAM,CACXF,MAAM,CAACG,KAAK,CA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AM,GAAG5D,UAAU,CAACuE,kBAAkB,IAAI,EAAE;EAClD,MAAMnB,UAAU,GAAG,IAAAjE,oCAAwB,EAACa,UAAU,CAACwE,OAAO,IAAI,EAAE,CAAC;EAErE,OAAO;IACLhD,SAAS;IACT1C,MAAM,EAAE;MACN2C,QAAQ,EAAED,SAAS,CAACC,QAAQ;MAC5BE,QAAQ,EAAEH,SAAS,CAACG,QAAQ;MAC5BuB,IAAI;MACJU,MAAM;MACNR;IACF,CAAC;IACDE,eAAe,EAAE,CACf9B,SAAS,CAACC,QAAQ,EAClBD,SAAS,CAACG,QAAQ,EAClB,CAACuB,IAAI,EAAEU,MAAM,EAAER,UAAU,CAAC,CAAC9F,MAAM,CAACC,OAAO,CAAC,CAACC,IAAI,CAAC,GAAG,CAAC,CACrD,CAACF,MAAM,CAACC,OAAO;EAClB,CAAC;AACH,CAAC;AAACsE,OAAA,CAAAwC,6BAAA,GAAAA,6BAAA","ignoreList":[]}
1
+ {"version":3,"file":"addressMapping.js","names":["_validators","require","joinAddressParts","parts","filter","Boolean","join","replace","trim","MANAGED_ADDRESS_FIELDS","Set","getMappedFieldValue","source","context","String","split","reduce","value","key","undefined","hasConfiguredMappings","mappingType","addressElements","some","element","_element$apiMappings","apiMappings","buildMappedFieldsFromConfig","mapped","forEach","_element$apiMappings2","field","has","normalizePostalCodeValue","STRUCTURED_LOCATION_TOKENS","stripEdgeCommasAndSpaces","start","end","length","includes","slice","normalizeFormattedLine","map","part","buildFormattedAddressLines","addressFormat","components","line","token","getAddressFormatTokens","addressFormatLine","match","isStructuredOnlyAddressFormatLine","tokens","every","buildUSFormattedAddress","validatedAddress","streetLine","primary_number","street_predirection","street_name","street_suffix","street_postdirection","secondaryLine","secondary_designator","secondary_number","extra_secondary_designator","extra_secondary_number","pmb_designator","pmb_number","formatted","address1","delivery_line_1","address2","delivery_line_2","exports","buildIntlFormattedAddress","_validatedAddress$met","_validatedAddress$met2","metadata","address_format","meta","addressFormatLines","formattedAddressLines","responseAddressLines","address3","fallbackAddress1","thoroughfare","premise","leadingStreetLineIndexes","indexes","index","stopped","values","push","buildIntlVerifiedAddressMapping","city","locality","district","sub_administrative_area","region","administrative_area","postalCode","postal_code","mapAddressLines","buildIntlAutocompleteAddressMapping","selectedAddress","addressForm","fallbackMapped","street","buildIntlConfiguredVerificationMapping","fallback","mappingContext","preserveBlankConfiguredMappings","currentValues","nextMapped","_element$apiMappings3","buildUSVerifiedAddressMapping","city_name","state_abbreviation","zipcode"],"sources":["../../../src/addressLookup/utils/addressMapping.js"],"sourcesContent":["import { normalizePostalCodeValue } from './validators';\n\nconst joinAddressParts = (parts = []) => (\n parts.filter(Boolean).join(' ').replace(/\\s+/g, ' ').trim()\n);\n\nconst MANAGED_ADDRESS_FIELDS = new Set([\n 'address1',\n 'address2',\n 'city',\n 'district',\n 'region',\n 'postalCode'\n]);\n\nconst getMappedFieldValue = (source, context) => {\n if (!source) {\n return '';\n }\n\n return String(\n source.split('.').reduce((value, key) => (\n value && value[key] !== undefined ? value[key] : undefined\n ), context) || ''\n ).trim();\n};\n\nconst hasConfiguredMappings = (mappingType, addressElements = []) => (\n addressElements.some((element) => element.apiMappings?.[mappingType])\n);\n\nconst buildMappedFieldsFromConfig = (mappingType, context, addressElements = []) => {\n const mapped = {};\n\n addressElements.forEach((element) => {\n if (!element?.field || !MANAGED_ADDRESS_FIELDS.has(element.field)) {\n return;\n }\n\n const value = getMappedFieldValue(element.apiMappings?.[mappingType], context);\n mapped[element.field] = element.field === 'postalCode' ? normalizePostalCodeValue(value) : value;\n });\n\n return mapped;\n};\n\nconst STRUCTURED_LOCATION_TOKENS = new Set([\n 'locality',\n 'dependent_locality',\n 'double_dependent_locality',\n 'administrative_area',\n 'sub_administrative_area',\n 'postal_code',\n 'sorting_code',\n 'country'\n]);\n\nconst stripEdgeCommasAndSpaces = (value = '') => {\n let start = 0;\n let end = value.length;\n\n while (start < end && [',', ' '].includes(value[start])) {\n start += 1;\n }\n\n while (end > start && [',', ' '].includes(value[end - 1])) {\n end -= 1;\n }\n\n return value.slice(start, end);\n};\n\nconst normalizeFormattedLine = (value = '') => (\n stripEdgeCommasAndSpaces(\n String(value)\n .split(',')\n .map((part) => part.trim())\n .filter(Boolean)\n .join(', ')\n .split(/\\s+/)\n .filter(Boolean)\n .join(' ')\n )\n);\n\nconst buildFormattedAddressLines = (addressFormat = '', components = {}) => (\n String(addressFormat)\n .split('|')\n .map((line) => normalizeFormattedLine(\n line.replace(/\\b[a-z_]+\\b/g, (token) => components[token] || '')\n ))\n .filter(Boolean)\n);\n\nconst getAddressFormatTokens = (addressFormatLine = '') => (\n String(addressFormatLine).match(/[a-z_]+/g) || []\n);\n\nconst isStructuredOnlyAddressFormatLine = (addressFormatLine = '') => {\n const tokens = getAddressFormatTokens(addressFormatLine);\n return tokens.length > 0 && tokens.every((token) => STRUCTURED_LOCATION_TOKENS.has(token));\n};\n\nexport const buildUSFormattedAddress = (validatedAddress = {}) => {\n const components = validatedAddress.components || {};\n\n const streetLine = joinAddressParts([\n components.primary_number,\n components.street_predirection,\n components.street_name,\n components.street_suffix,\n components.street_postdirection\n ]);\n\n const secondaryLine = [\n joinAddressParts([components.secondary_designator, components.secondary_number]),\n joinAddressParts([components.extra_secondary_designator, components.extra_secondary_number]),\n joinAddressParts([components.pmb_designator, components.pmb_number])\n ].filter(Boolean).join(', ').trim();\n\n return {\n formatted: {\n address1: streetLine || validatedAddress.delivery_line_1 || '',\n address2: secondaryLine || validatedAddress.delivery_line_2 || ''\n }\n };\n};\n\nexport const buildIntlFormattedAddress = (validatedAddress = {}) => {\n const components = validatedAddress.components || {};\n const addressFormat = validatedAddress.metadata?.address_format || validatedAddress.meta?.address_format || '';\n const addressFormatLines = String(addressFormat).split('|');\n const formattedAddressLines = buildFormattedAddressLines(addressFormat, components);\n const responseAddressLines = [\n validatedAddress.address1,\n validatedAddress.address2,\n validatedAddress.address3\n ].filter(Boolean);\n\n const fallbackAddress1 = joinAddressParts([components.thoroughfare, components.premise]);\n const leadingStreetLineIndexes = addressFormatLines.reduce((indexes, line, index) => {\n if (indexes.stopped) {\n return indexes;\n }\n\n if (isStructuredOnlyAddressFormatLine(line)) {\n indexes.stopped = true;\n return indexes;\n }\n\n if (formattedAddressLines[index]) {\n indexes.values.push(index);\n }\n\n return indexes;\n }, { values: [], stopped: false }).values;\n\n const address1 = (\n formattedAddressLines[leadingStreetLineIndexes[0]] ||\n fallbackAddress1 ||\n ''\n );\n const address2 = leadingStreetLineIndexes.length > 1 ?\n (formattedAddressLines[leadingStreetLineIndexes[1]] || '') :\n '';\n\n return {\n formatted: {\n address1,\n address2\n },\n responseAddressLines,\n formattedAddressLines\n };\n};\n\nexport const buildIntlVerifiedAddressMapping = (validatedAddress = {}) => {\n const components = validatedAddress.components || {};\n const {\n formatted,\n responseAddressLines,\n formattedAddressLines\n } = buildIntlFormattedAddress(validatedAddress);\n\n return {\n formatted,\n mapped: {\n address1: formatted.address1,\n address2: formatted.address2,\n city: components.locality || '',\n district: components.sub_administrative_area || '',\n region: components.administrative_area || '',\n postalCode: normalizePostalCodeValue(components.postal_code || '')\n },\n mapAddressLines: responseAddressLines.length ? responseAddressLines : formattedAddressLines\n };\n};\n\nexport const buildIntlAutocompleteAddressMapping = (\n selectedAddress = {},\n addressForm = null\n) => {\n const addressElements = addressForm?.addressElements || [];\n const fallbackMapped = {\n address1: selectedAddress.street || '',\n address2: '',\n city: selectedAddress.locality || '',\n district: selectedAddress.sub_administrative_area || '',\n region: selectedAddress.administrative_area || '',\n postalCode: normalizePostalCodeValue(selectedAddress.postal_code || '')\n };\n\n if (!hasConfiguredMappings('autocomplete', addressElements)) {\n return fallbackMapped;\n }\n\n return buildMappedFieldsFromConfig('autocomplete', selectedAddress, addressElements);\n};\n\nexport const buildIntlConfiguredVerificationMapping = (\n validatedAddress = {},\n addressForm = null\n) => {\n const fallback = buildIntlVerifiedAddressMapping(validatedAddress);\n const addressElements = addressForm?.addressElements || [];\n\n if (!hasConfiguredMappings('verification', addressElements)) {\n return fallback;\n }\n\n const mappingContext = {\n ...validatedAddress,\n formatted: fallback.formatted\n };\n\n return {\n ...fallback,\n mapped: buildMappedFieldsFromConfig('verification', mappingContext, addressElements)\n };\n};\n\nexport const preserveBlankConfiguredMappings = (mapped = {}, currentValues = {}, addressElements = [], mappingType) => {\n const nextMapped = { ...mapped };\n\n addressElements.forEach((element) => {\n if (!element?.field || !MANAGED_ADDRESS_FIELDS.has(element.field)) {\n return;\n }\n\n if (!element.apiMappings?.[mappingType]) {\n return;\n }\n\n if (nextMapped[element.field] !== '') {\n return;\n }\n\n nextMapped[element.field] = currentValues[element.field] || '';\n });\n\n return nextMapped;\n};\n\nexport const buildUSVerifiedAddressMapping = (validatedAddress = {}) => {\n const components = validatedAddress.components || {};\n const { formatted } = buildUSFormattedAddress(validatedAddress);\n const city = components.city_name || '';\n const region = components.state_abbreviation || '';\n const postalCode = normalizePostalCodeValue(components.zipcode || '');\n\n return {\n formatted,\n mapped: {\n address1: formatted.address1,\n address2: formatted.address2,\n city,\n region,\n postalCode\n },\n mapAddressLines: [\n formatted.address1,\n formatted.address2,\n [city, region, postalCode].filter(Boolean).join(' ')\n ].filter(Boolean)\n };\n};\n "],"mappings":";;;;;;AAAA,IAAAA,WAAA,GAAAC,OAAA;AAEA,MAAMC,gBAAgB,GAAGA,CAACC,KAAK,GAAG,EAAE,KAClCA,KAAK,CAACC,MAAM,CAACC,OAAO,CAAC,CAACC,IAAI,CAAC,GAAG,CAAC,CAACC,OAAO,CAAC,MAAM,EAAE,GAAG,CAAC,CAACC,IAAI,CAAC,CAC3D;AAED,MAAMC,sBAAsB,GAAG,IAAIC,GAAG,CAAC,CACrC,UAAU,EACV,UAAU,EACV,MAAM,EACN,UAAU,EACV,QAAQ,EACR,YAAY,CACb,CAAC;AAEF,MAAMC,mBAAmB,GAAGA,CAACC,MAAM,EAAEC,OAAO,KAAK;EAC/C,IAAI,CAACD,MAAM,EAAE;IACX,OAAO,EAAE;EACX;EAEA,OAAOE,MAAM,CACX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GAAGU,gBAAgB,CAACV,UAAU,IAAI,CAAC,CAAC;EACpD,MAAM;IAAEwB;EAAU,CAAC,GAAGf,uBAAuB,CAACC,gBAAgB,CAAC;EAC/D,MAAMwC,IAAI,GAAGlD,UAAU,CAACwE,SAAS,IAAI,EAAE;EACvC,MAAMlB,MAAM,GAAGtD,UAAU,CAACyE,kBAAkB,IAAI,EAAE;EAClD,MAAMjB,UAAU,GAAG,IAAArE,oCAAwB,EAACa,UAAU,CAAC0E,OAAO,IAAI,EAAE,CAAC;EAErE,OAAO;IACLlD,SAAS;IACT1C,MAAM,EAAE;MACN2C,QAAQ,EAAED,SAAS,CAACC,QAAQ;MAC5BE,QAAQ,EAAEH,SAAS,CAACG,QAAQ;MAC5BuB,IAAI;MACJI,MAAM;MACNE;IACF,CAAC;IACDE,eAAe,EAAE,CACflC,SAAS,CAACC,QAAQ,EAClBD,SAAS,CAACG,QAAQ,EAClB,CAACuB,IAAI,EAAEI,MAAM,EAAEE,UAAU,CAAC,CAAClG,MAAM,CAACC,OAAO,CAAC,CAACC,IAAI,CAAC,GAAG,CAAC,CACrD,CAACF,MAAM,CAACC,OAAO;EAClB,CAAC;AACH,CAAC;AAACsE,OAAA,CAAA0C,6BAAA,GAAAA,6BAAA","ignoreList":[]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nuskin/shipping-address-form",
3
- "version": "1.7.7",
3
+ "version": "1.7.8-3258-comuna.2",
4
4
  "description": "React components for standalone address lookup and shipping address forms",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {