@shipengine/elements 0.24.0 → 0.26.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (74) hide show
  1. package/index.cjs +1442 -654
  2. package/index.js +1449 -668
  3. package/package.json +13 -4
  4. package/src/components/error-display/error-display.d.ts +1 -0
  5. package/src/components/error-display/error-display.styles.d.ts +19 -0
  6. package/src/components/error-display/index.d.ts +1 -0
  7. package/src/components/field/field.styles.d.ts +2 -12
  8. package/src/components/field/rate-card/rate-card.d.ts +1 -1
  9. package/src/components/history/history-card/history-card.styles.d.ts +12 -14
  10. package/src/components/history/history-card-extension/history-card-extension.d.ts +1 -0
  11. package/src/components/history/history-card-extension/history-card-extension.styles.d.ts +26 -0
  12. package/src/components/history/history-card-extension/index.d.ts +1 -0
  13. package/src/components/history/index.d.ts +1 -0
  14. package/src/components/index.d.ts +1 -0
  15. package/src/components/label/label.d.ts +1 -1
  16. package/src/components/label/label.styles.d.ts +5 -1
  17. package/src/components/label-layout/label-layout-settings.d.ts +3 -1
  18. package/src/components/link-action/link-action.d.ts +3 -1
  19. package/src/components/powered-by-shipengine/index.d.ts +1 -0
  20. package/src/components/powered-by-shipengine/powered-by-shipengine.d.ts +1 -0
  21. package/src/components/powered-by-shipengine/powered-by-shipengine.styles.d.ts +11 -0
  22. package/src/components/save-status/index.d.ts +2 -0
  23. package/src/components/save-status/save-status-styles.d.ts +43 -0
  24. package/src/components/save-status/save-status.d.ts +6 -0
  25. package/src/components/templates/index.d.ts +0 -1
  26. package/src/components/templates/rate-form/rate-form.d.ts +4 -1
  27. package/src/components/unit-settings/unit-settings.d.ts +1 -4
  28. package/src/constants/shipengine/address.d.ts +2 -0
  29. package/src/elements/configure-shipment/hooks/use-rates-form.d.ts +2 -0
  30. package/src/elements/list-carriers/list-carriers.d.ts +29 -14
  31. package/src/elements/manage-warehouses/manage-warehouses.d.ts +29 -14
  32. package/src/elements/onboarding/onboarding.d.ts +29 -14
  33. package/src/elements/purchase-label/hooks/use-load-or-create-shipment.d.ts +6 -0
  34. package/src/elements/purchase-label/purchase-label-by-shipment.d.ts +5 -2
  35. package/src/elements/purchase-label/purchase-label.d.ts +41 -20
  36. package/src/elements/view-shipment/view-shipment.d.ts +29 -14
  37. package/src/{components/templates/void-label/void-label.d.ts → elements/void-label/components/actions/actions.d.ts} +3 -3
  38. package/src/elements/void-label/components/actions/index.d.ts +1 -0
  39. package/src/elements/void-label/components/index.d.ts +2 -0
  40. package/src/elements/void-label/components/message/index.d.ts +1 -0
  41. package/src/elements/void-label/components/message/message.d.ts +6 -0
  42. package/src/elements/void-label/void-label.d.ts +29 -14
  43. package/src/factories/shipengine/wallet-history.d.ts +52 -0
  44. package/src/features/wallet-history/wallet-history.styles.d.ts +4 -0
  45. package/src/hooks/options/index.d.ts +1 -0
  46. package/src/hooks/options/use-package-options.d.ts +1 -1
  47. package/src/hooks/options/use-service-code-options.d.ts +1 -1
  48. package/src/hooks/options/use-shipment-metadata.d.ts +8 -0
  49. package/src/hooks/options/use-shipping-presets-options.d.ts +2 -1
  50. package/src/hooks/use-get-or-create-shipment.d.ts +2 -0
  51. package/src/locales/en/index.d.ts +29 -14
  52. package/src/mocks/account-settings/handlers.d.ts +8 -0
  53. package/src/mocks/account-settings/index.d.ts +1 -0
  54. package/src/mocks/index.d.ts +1 -0
  55. package/src/mocks/server.d.ts +1 -0
  56. package/src/testing/extensions/index.d.ts +2 -0
  57. package/src/testing/extensions/matchers/extend-matchers.d.ts +8 -0
  58. package/src/testing/extensions/matchers/index.d.ts +1 -0
  59. package/src/testing/extensions/matchers/matchers.d.ts +1 -0
  60. package/src/testing/extensions/matchers/to-have-loading-spinner.d.ts +2 -0
  61. package/src/testing/extensions/queries/by-icon-name.d.ts +4 -0
  62. package/src/testing/extensions/queries/index.d.ts +57 -0
  63. package/src/testing/extensions/queries/queries.d.ts +1 -0
  64. package/src/testing/index.d.ts +1 -1
  65. package/src/testing/test-utils.d.ts +292 -0
  66. package/src/utilities/error.d.ts +13 -0
  67. package/src/utilities/i18nDateUtils.d.ts +16 -0
  68. package/src/utilities/rates.d.ts +1 -1
  69. package/src/utilities/shipengine/address.d.ts +4 -0
  70. package/src/utilities/shipengine/carrier.d.ts +1 -0
  71. package/vite.config.d.ts +2 -0
  72. package/src/components/templates/void-label/index.d.ts +0 -1
  73. package/src/public-sdk.d.ts +0 -38
  74. package/src/testing/render.d.ts +0 -6
package/index.js CHANGED
@@ -1,26 +1,29 @@
1
1
  import { jsx, jsxs, Fragment } from '@emotion/react/jsx-runtime';
2
2
  import { useController, get as get$1, set as set$2, useWatch, useFormState, useForm } from 'react-hook-form';
3
3
  import { useTranslation, Trans } from 'react-i18next';
4
- import { Typography, FormField, FieldMessageType, Checkbox, Input, Icon, Divider, Link, SelectAutocomplete, Select as Select$1, OptionGroup, Option, Button, Switch as Switch$1, Textarea, ButtonVariant, InlineNotification, NotificationType, ButtonColor, Grid, GridChild, Tag, TagColor, ButtonSize, Spinner, IconSize, Skeleton, SkeletonAnimation, SkeletonVariant, SkeletonBackgroundColor, RadioGroup, Radio, Stepper, Step, SpinnerSize, ChipList, Chip, Table, TableBody, TableBaseRow, TableBodyCell, TableHeader, TableHeaderCell, Popover, DropdownOptionList, BottomSheet, DatePicker as DatePicker$1 } from '@packlink/giger';
4
+ import { Typography, FormField, FieldMessageType, Checkbox, Input, Icon, Divider, Link, SelectAutocomplete, Select as Select$1, OptionGroup, Option, Button, Switch as Switch$1, Textarea, ButtonVariant, InlineNotification, NotificationType, ButtonColor, Grid, GridChild, Tag, TagColor, ButtonSize, Spinner, IconSize, Skeleton, SkeletonAnimation, SkeletonVariant, SkeletonBackgroundColor, RadioGroup, Radio, Stepper, Step, SpinnerSize, ChipList, Chip, Table, TableBody, TableBaseRow, TableBodyCell, TableHeader, TableHeaderCell, Popover, DropdownOptionList, DatePicker as DatePicker$1, BottomSheet } from '@packlink/giger';
5
5
  import axios from 'axios';
6
- import alchemy, { logger, SE, useValidateAddresses, useAddFunds, useGetCarrierById, useUpdateAutoFunding, useGetAutoFundingConfiguration, Currency, useListCarriers, useConnectCarrier, useListWarehouses, useUpdateWarehouse, useCreateWarehouse, useDeleteWarehouse, useUpdateSalesOrderShipment, useParseAddress, useListCustomPackageTypes, useCalculateRates, useGetShipmentRates, useCreateLabel, useListSalesOrderShipments, useCreateSalesOrderShipment, useGetAccountSettings, useListSalesOrders, useGetSalesOrder, useListOrderSources, useRefreshOrderSource, useGetShipment, useGetSalesOrderShipment, useListLabels, useGetLabel, useVoidLabel } from '@shipengine/alchemy';
6
+ import alchemy, { logger, SE, useValidateAddresses, useAddFunds, useGetCarrierById, useGetAccountSettings, useUpdateAccountSettings, useUpdateAutoFunding, useGetAutoFundingConfiguration, Currency, useListCarriers, useConnectCarrier, useListWarehouses, useUpdateWarehouse, useCreateWarehouse, useDeleteWarehouse, useUpdateSalesOrderShipment, useParseAddress, useListCustomPackageTypes, useCalculateRates, useGetShipmentRates, useListLabels, useCreateLabel, useListSalesOrderShipments, useCreateSalesOrderShipment, useListSalesOrders, useGetSalesOrder, useListOrderSources, useRefreshOrderSource, useShipEngine, CodedError, useGetSalesOrderShipment, useGetLabel, useVoidLabel } from '@shipengine/alchemy';
7
7
  import { zodResolver } from '@hookform/resolvers/zod';
8
8
  import { z } from 'zod';
9
9
  import * as React from 'react';
10
- import { useEffect, useRef, createElement as createElement$2, useCallback, useReducer, useMemo, memo, forwardRef, useState, createContext, useContext, Fragment as Fragment$1 } from 'react';
10
+ import { useEffect, useRef, createElement as createElement$2, forwardRef, useCallback, useReducer, useMemo, memo, useState, createContext, useContext, Fragment as Fragment$1 } from 'react';
11
11
  import { useTheme, css as css$1, createElement as createElement$3, keyframes } from '@emotion/react';
12
12
  import { camelize } from 'humps';
13
- import ReactDatePicker from 'react-datepicker';
13
+ import ReactDatePicker, { registerLocale, setDefaultLocale } from 'react-datepicker';
14
14
  import { IconNames } from '@packlink/giger-theme';
15
+ import { parse, format } from 'date-fns';
16
+ import * as Locales from 'date-fns/locale';
15
17
  import { css } from '@emotion/css';
16
- import _$2, { isEqual } from 'lodash';
18
+ import _$3, { isEqual } from 'lodash';
17
19
  import { createPortal } from 'react-dom';
18
20
  import { isValidPhoneNumber } from 'libphonenumber-js/min';
19
21
  import copy from 'copy-to-clipboard';
20
22
  import { encode } from 'js-base64';
21
23
  import cardValidator from 'card-validator';
22
- import { useQueryClient } from 'react-query';
24
+ import { useQueryClient, useQuery } from 'react-query';
23
25
  import { IconNames as IconNames$1 } from '@packlink/brands';
26
+ import { onError } from '@shipengine/react-api';
24
27
 
25
28
  var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
26
29
 
@@ -68,10 +71,10 @@ var functionBindNative = !fails$o(function () {
68
71
 
69
72
  var NATIVE_BIND$3 = functionBindNative;
70
73
 
71
- var call$j = Function.prototype.call;
74
+ var call$k = Function.prototype.call;
72
75
 
73
- var functionCall = NATIVE_BIND$3 ? call$j.bind(call$j) : function () {
74
- return call$j.apply(call$j, arguments);
76
+ var functionCall = NATIVE_BIND$3 ? call$k.bind(call$k) : function () {
77
+ return call$k.apply(call$k, arguments);
75
78
  };
76
79
 
77
80
  var objectPropertyIsEnumerable = {};
@@ -102,30 +105,30 @@ var createPropertyDescriptor$4 = function (bitmap, value) {
102
105
  var NATIVE_BIND$2 = functionBindNative;
103
106
 
104
107
  var FunctionPrototype$2 = Function.prototype;
105
- var call$i = FunctionPrototype$2.call;
106
- var uncurryThisWithBind = NATIVE_BIND$2 && FunctionPrototype$2.bind.bind(call$i, call$i);
108
+ var call$j = FunctionPrototype$2.call;
109
+ var uncurryThisWithBind = NATIVE_BIND$2 && FunctionPrototype$2.bind.bind(call$j, call$j);
107
110
 
108
111
  var functionUncurryThis = NATIVE_BIND$2 ? uncurryThisWithBind : function (fn) {
109
112
  return function () {
110
- return call$i.apply(fn, arguments);
113
+ return call$j.apply(fn, arguments);
111
114
  };
112
115
  };
113
116
 
114
- var uncurryThis$q = functionUncurryThis;
117
+ var uncurryThis$r = functionUncurryThis;
115
118
 
116
- var toString$d = uncurryThis$q({}.toString);
117
- var stringSlice$6 = uncurryThis$q(''.slice);
119
+ var toString$e = uncurryThis$r({}.toString);
120
+ var stringSlice$7 = uncurryThis$r(''.slice);
118
121
 
119
122
  var classofRaw$2 = function (it) {
120
- return stringSlice$6(toString$d(it), 8, -1);
123
+ return stringSlice$7(toString$e(it), 8, -1);
121
124
  };
122
125
 
123
- var uncurryThis$p = functionUncurryThis;
126
+ var uncurryThis$q = functionUncurryThis;
124
127
  var fails$n = fails$q;
125
128
  var classof$8 = classofRaw$2;
126
129
 
127
130
  var $Object$4 = Object;
128
- var split = uncurryThis$p(''.split);
131
+ var split = uncurryThis$q(''.split);
129
132
 
130
133
  // fallback for non-array-like ES3 and non-enumerable old V8 strings
131
134
  var indexedObject = fails$n(function () {
@@ -138,27 +141,27 @@ var indexedObject = fails$n(function () {
138
141
 
139
142
  // we can't use just `it == null` since of `document.all` special case
140
143
  // https://tc39.es/ecma262/#sec-IsHTMLDDA-internal-slot-aec
141
- var isNullOrUndefined$6 = function (it) {
144
+ var isNullOrUndefined$7 = function (it) {
142
145
  return it === null || it === undefined;
143
146
  };
144
147
 
145
- var isNullOrUndefined$5 = isNullOrUndefined$6;
148
+ var isNullOrUndefined$6 = isNullOrUndefined$7;
146
149
 
147
- var $TypeError$h = TypeError;
150
+ var $TypeError$i = TypeError;
148
151
 
149
152
  // `RequireObjectCoercible` abstract operation
150
153
  // https://tc39.es/ecma262/#sec-requireobjectcoercible
151
- var requireObjectCoercible$8 = function (it) {
152
- if (isNullOrUndefined$5(it)) throw $TypeError$h("Can't call method on " + it);
154
+ var requireObjectCoercible$9 = function (it) {
155
+ if (isNullOrUndefined$6(it)) throw $TypeError$i("Can't call method on " + it);
153
156
  return it;
154
157
  };
155
158
 
156
159
  // toObject with fallback for non-array-like ES3 strings
157
160
  var IndexedObject$2 = indexedObject;
158
- var requireObjectCoercible$7 = requireObjectCoercible$8;
161
+ var requireObjectCoercible$8 = requireObjectCoercible$9;
159
162
 
160
163
  var toIndexedObject$5 = function (it) {
161
- return IndexedObject$2(requireObjectCoercible$7(it));
164
+ return IndexedObject$2(requireObjectCoercible$8(it));
162
165
  };
163
166
 
164
167
  var documentAll$2 = typeof document == 'object' && document.all;
@@ -177,37 +180,37 @@ var documentAll$1 = $documentAll$1.all;
177
180
 
178
181
  // `IsCallable` abstract operation
179
182
  // https://tc39.es/ecma262/#sec-iscallable
180
- var isCallable$n = $documentAll$1.IS_HTMLDDA ? function (argument) {
183
+ var isCallable$o = $documentAll$1.IS_HTMLDDA ? function (argument) {
181
184
  return typeof argument == 'function' || argument === documentAll$1;
182
185
  } : function (argument) {
183
186
  return typeof argument == 'function';
184
187
  };
185
188
 
186
- var isCallable$m = isCallable$n;
189
+ var isCallable$n = isCallable$o;
187
190
  var $documentAll = documentAll_1;
188
191
 
189
192
  var documentAll = $documentAll.all;
190
193
 
191
194
  var isObject$a = $documentAll.IS_HTMLDDA ? function (it) {
192
- return typeof it == 'object' ? it !== null : isCallable$m(it) || it === documentAll;
195
+ return typeof it == 'object' ? it !== null : isCallable$n(it) || it === documentAll;
193
196
  } : function (it) {
194
- return typeof it == 'object' ? it !== null : isCallable$m(it);
197
+ return typeof it == 'object' ? it !== null : isCallable$n(it);
195
198
  };
196
199
 
197
200
  var global$o = global$p;
198
- var isCallable$l = isCallable$n;
201
+ var isCallable$m = isCallable$o;
199
202
 
200
203
  var aFunction = function (argument) {
201
- return isCallable$l(argument) ? argument : undefined;
204
+ return isCallable$m(argument) ? argument : undefined;
202
205
  };
203
206
 
204
207
  var getBuiltIn$8 = function (namespace, method) {
205
208
  return arguments.length < 2 ? aFunction(global$o[namespace]) : global$o[namespace] && global$o[namespace][method];
206
209
  };
207
210
 
208
- var uncurryThis$o = functionUncurryThis;
211
+ var uncurryThis$p = functionUncurryThis;
209
212
 
210
- var objectIsPrototypeOf = uncurryThis$o({}.isPrototypeOf);
213
+ var objectIsPrototypeOf = uncurryThis$p({}.isPrototypeOf);
211
214
 
212
215
  var getBuiltIn$7 = getBuiltIn$8;
213
216
 
@@ -265,7 +268,7 @@ var useSymbolAsUid = NATIVE_SYMBOL$2
265
268
  && typeof Symbol.iterator == 'symbol';
266
269
 
267
270
  var getBuiltIn$6 = getBuiltIn$8;
268
- var isCallable$k = isCallable$n;
271
+ var isCallable$l = isCallable$o;
269
272
  var isPrototypeOf$4 = objectIsPrototypeOf;
270
273
  var USE_SYMBOL_AS_UID$1 = useSymbolAsUid;
271
274
 
@@ -275,7 +278,7 @@ var isSymbol$2 = USE_SYMBOL_AS_UID$1 ? function (it) {
275
278
  return typeof it == 'symbol';
276
279
  } : function (it) {
277
280
  var $Symbol = getBuiltIn$6('Symbol');
278
- return isCallable$k($Symbol) && isPrototypeOf$4($Symbol.prototype, $Object$3(it));
281
+ return isCallable$l($Symbol) && isPrototypeOf$4($Symbol.prototype, $Object$3(it));
279
282
  };
280
283
 
281
284
  var $String$4 = String;
@@ -288,41 +291,41 @@ var tryToString$5 = function (argument) {
288
291
  }
289
292
  };
290
293
 
291
- var isCallable$j = isCallable$n;
294
+ var isCallable$k = isCallable$o;
292
295
  var tryToString$4 = tryToString$5;
293
296
 
294
- var $TypeError$g = TypeError;
297
+ var $TypeError$h = TypeError;
295
298
 
296
299
  // `Assert: IsCallable(argument) is true`
297
300
  var aCallable$a = function (argument) {
298
- if (isCallable$j(argument)) return argument;
299
- throw $TypeError$g(tryToString$4(argument) + ' is not a function');
301
+ if (isCallable$k(argument)) return argument;
302
+ throw $TypeError$h(tryToString$4(argument) + ' is not a function');
300
303
  };
301
304
 
302
305
  var aCallable$9 = aCallable$a;
303
- var isNullOrUndefined$4 = isNullOrUndefined$6;
306
+ var isNullOrUndefined$5 = isNullOrUndefined$7;
304
307
 
305
308
  // `GetMethod` abstract operation
306
309
  // https://tc39.es/ecma262/#sec-getmethod
307
- var getMethod$5 = function (V, P) {
310
+ var getMethod$6 = function (V, P) {
308
311
  var func = V[P];
309
- return isNullOrUndefined$4(func) ? undefined : aCallable$9(func);
312
+ return isNullOrUndefined$5(func) ? undefined : aCallable$9(func);
310
313
  };
311
314
 
312
- var call$h = functionCall;
313
- var isCallable$i = isCallable$n;
315
+ var call$i = functionCall;
316
+ var isCallable$j = isCallable$o;
314
317
  var isObject$9 = isObject$a;
315
318
 
316
- var $TypeError$f = TypeError;
319
+ var $TypeError$g = TypeError;
317
320
 
318
321
  // `OrdinaryToPrimitive` abstract operation
319
322
  // https://tc39.es/ecma262/#sec-ordinarytoprimitive
320
323
  var ordinaryToPrimitive$1 = function (input, pref) {
321
324
  var fn, val;
322
- if (pref === 'string' && isCallable$i(fn = input.toString) && !isObject$9(val = call$h(fn, input))) return val;
323
- if (isCallable$i(fn = input.valueOf) && !isObject$9(val = call$h(fn, input))) return val;
324
- if (pref !== 'string' && isCallable$i(fn = input.toString) && !isObject$9(val = call$h(fn, input))) return val;
325
- throw $TypeError$f("Can't convert object to primitive value");
325
+ if (pref === 'string' && isCallable$j(fn = input.toString) && !isObject$9(val = call$i(fn, input))) return val;
326
+ if (isCallable$j(fn = input.valueOf) && !isObject$9(val = call$i(fn, input))) return val;
327
+ if (pref !== 'string' && isCallable$j(fn = input.toString) && !isObject$9(val = call$i(fn, input))) return val;
328
+ throw $TypeError$g("Can't convert object to primitive value");
326
329
  };
327
330
 
328
331
  var shared$4 = {exports: {}};
@@ -360,20 +363,20 @@ var store$2 = sharedStore;
360
363
  source: 'https://github.com/zloirock/core-js'
361
364
  });
362
365
 
363
- var requireObjectCoercible$6 = requireObjectCoercible$8;
366
+ var requireObjectCoercible$7 = requireObjectCoercible$9;
364
367
 
365
368
  var $Object$2 = Object;
366
369
 
367
370
  // `ToObject` abstract operation
368
371
  // https://tc39.es/ecma262/#sec-toobject
369
372
  var toObject$7 = function (argument) {
370
- return $Object$2(requireObjectCoercible$6(argument));
373
+ return $Object$2(requireObjectCoercible$7(argument));
371
374
  };
372
375
 
373
- var uncurryThis$n = functionUncurryThis;
376
+ var uncurryThis$o = functionUncurryThis;
374
377
  var toObject$6 = toObject$7;
375
378
 
376
- var hasOwnProperty = uncurryThis$n({}.hasOwnProperty);
379
+ var hasOwnProperty = uncurryThis$o({}.hasOwnProperty);
377
380
 
378
381
  // `HasOwnProperty` abstract operation
379
382
  // https://tc39.es/ecma262/#sec-hasownproperty
@@ -382,14 +385,14 @@ var hasOwnProperty_1 = Object.hasOwn || function hasOwn(it, key) {
382
385
  return hasOwnProperty(toObject$6(it), key);
383
386
  };
384
387
 
385
- var uncurryThis$m = functionUncurryThis;
388
+ var uncurryThis$n = functionUncurryThis;
386
389
 
387
390
  var id = 0;
388
391
  var postfix = Math.random();
389
- var toString$c = uncurryThis$m(1.0.toString);
392
+ var toString$d = uncurryThis$n(1.0.toString);
390
393
 
391
394
  var uid$2 = function (key) {
392
- return 'Symbol(' + (key === undefined ? '' : key) + ')_' + toString$c(++id + postfix, 36);
395
+ return 'Symbol(' + (key === undefined ? '' : key) + ')_' + toString$d(++id + postfix, 36);
393
396
  };
394
397
 
395
398
  var global$k = global$p;
@@ -404,7 +407,7 @@ var Symbol$3 = global$k.Symbol;
404
407
  var symbolFor = Symbol$3 && Symbol$3['for'];
405
408
  var createWellKnownSymbol = USE_SYMBOL_AS_UID ? Symbol$3 : Symbol$3 && Symbol$3.withoutSetter || uid$1;
406
409
 
407
- var wellKnownSymbol$j = function (name) {
410
+ var wellKnownSymbol$k = function (name) {
408
411
  if (!hasOwn$b(WellKnownSymbolsStore, name) || !(NATIVE_SYMBOL$1 || typeof WellKnownSymbolsStore[name] == 'string')) {
409
412
  var description = 'Symbol.' + name;
410
413
  if (NATIVE_SYMBOL$1 && hasOwn$b(Symbol$3, name)) {
@@ -417,27 +420,27 @@ var wellKnownSymbol$j = function (name) {
417
420
  } return WellKnownSymbolsStore[name];
418
421
  };
419
422
 
420
- var call$g = functionCall;
423
+ var call$h = functionCall;
421
424
  var isObject$8 = isObject$a;
422
425
  var isSymbol$1 = isSymbol$2;
423
- var getMethod$4 = getMethod$5;
426
+ var getMethod$5 = getMethod$6;
424
427
  var ordinaryToPrimitive = ordinaryToPrimitive$1;
425
- var wellKnownSymbol$i = wellKnownSymbol$j;
428
+ var wellKnownSymbol$j = wellKnownSymbol$k;
426
429
 
427
- var $TypeError$e = TypeError;
428
- var TO_PRIMITIVE = wellKnownSymbol$i('toPrimitive');
430
+ var $TypeError$f = TypeError;
431
+ var TO_PRIMITIVE = wellKnownSymbol$j('toPrimitive');
429
432
 
430
433
  // `ToPrimitive` abstract operation
431
434
  // https://tc39.es/ecma262/#sec-toprimitive
432
435
  var toPrimitive$1 = function (input, pref) {
433
436
  if (!isObject$8(input) || isSymbol$1(input)) return input;
434
- var exoticToPrim = getMethod$4(input, TO_PRIMITIVE);
437
+ var exoticToPrim = getMethod$5(input, TO_PRIMITIVE);
435
438
  var result;
436
439
  if (exoticToPrim) {
437
440
  if (pref === undefined) pref = 'default';
438
- result = call$g(exoticToPrim, input, pref);
441
+ result = call$h(exoticToPrim, input, pref);
439
442
  if (!isObject$8(result) || isSymbol$1(result)) return result;
440
- throw $TypeError$e("Can't convert object to primitive value");
443
+ throw $TypeError$f("Can't convert object to primitive value");
441
444
  }
442
445
  if (pref === undefined) pref = 'number';
443
446
  return ordinaryToPrimitive(input, pref);
@@ -477,7 +480,7 @@ var ie8DomDefine = !DESCRIPTORS$b && !fails$l(function () {
477
480
  });
478
481
 
479
482
  var DESCRIPTORS$a = descriptors;
480
- var call$f = functionCall;
483
+ var call$g = functionCall;
481
484
  var propertyIsEnumerableModule$1 = objectPropertyIsEnumerable;
482
485
  var createPropertyDescriptor$3 = createPropertyDescriptor$4;
483
486
  var toIndexedObject$4 = toIndexedObject$5;
@@ -496,7 +499,7 @@ objectGetOwnPropertyDescriptor.f = DESCRIPTORS$a ? $getOwnPropertyDescriptor$1 :
496
499
  if (IE8_DOM_DEFINE$1) try {
497
500
  return $getOwnPropertyDescriptor$1(O, P);
498
501
  } catch (error) { /* empty */ }
499
- if (hasOwn$a(O, P)) return createPropertyDescriptor$3(!call$f(propertyIsEnumerableModule$1.f, O, P), O[P]);
502
+ if (hasOwn$a(O, P)) return createPropertyDescriptor$3(!call$g(propertyIsEnumerableModule$1.f, O, P), O[P]);
500
503
  };
501
504
 
502
505
  var objectDefineProperty = {};
@@ -517,12 +520,12 @@ var v8PrototypeDefineBug = DESCRIPTORS$9 && fails$k(function () {
517
520
  var isObject$6 = isObject$a;
518
521
 
519
522
  var $String$3 = String;
520
- var $TypeError$d = TypeError;
523
+ var $TypeError$e = TypeError;
521
524
 
522
525
  // `Assert: Type(argument) is Object`
523
526
  var anObject$f = function (argument) {
524
527
  if (isObject$6(argument)) return argument;
525
- throw $TypeError$d($String$3(argument) + ' is not an object');
528
+ throw $TypeError$e($String$3(argument) + ' is not an object');
526
529
  };
527
530
 
528
531
  var DESCRIPTORS$8 = descriptors;
@@ -531,7 +534,7 @@ var V8_PROTOTYPE_DEFINE_BUG$1 = v8PrototypeDefineBug;
531
534
  var anObject$e = anObject$f;
532
535
  var toPropertyKey$1 = toPropertyKey$3;
533
536
 
534
- var $TypeError$c = TypeError;
537
+ var $TypeError$d = TypeError;
535
538
  // eslint-disable-next-line es/no-object-defineproperty -- safe
536
539
  var $defineProperty = Object.defineProperty;
537
540
  // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
@@ -564,7 +567,7 @@ objectDefineProperty.f = DESCRIPTORS$8 ? V8_PROTOTYPE_DEFINE_BUG$1 ? function de
564
567
  if (IE8_DOM_DEFINE) try {
565
568
  return $defineProperty(O, P, Attributes);
566
569
  } catch (error) { /* empty */ }
567
- if ('get' in Attributes || 'set' in Attributes) throw $TypeError$c('Accessors not supported');
570
+ if ('get' in Attributes || 'set' in Attributes) throw $TypeError$d('Accessors not supported');
568
571
  if ('value' in Attributes) O[P] = Attributes.value;
569
572
  return O;
570
573
  };
@@ -600,14 +603,14 @@ var functionName = {
600
603
  CONFIGURABLE: CONFIGURABLE
601
604
  };
602
605
 
603
- var uncurryThis$l = functionUncurryThis;
604
- var isCallable$h = isCallable$n;
606
+ var uncurryThis$m = functionUncurryThis;
607
+ var isCallable$i = isCallable$o;
605
608
  var store$1 = sharedStore;
606
609
 
607
- var functionToString = uncurryThis$l(Function.toString);
610
+ var functionToString = uncurryThis$m(Function.toString);
608
611
 
609
612
  // this helper broken in `core-js@3.4.1-3.4.4`, so we can't use `shared` helper
610
- if (!isCallable$h(store$1.inspectSource)) {
613
+ if (!isCallable$i(store$1.inspectSource)) {
611
614
  store$1.inspectSource = function (it) {
612
615
  return functionToString(it);
613
616
  };
@@ -616,11 +619,11 @@ if (!isCallable$h(store$1.inspectSource)) {
616
619
  var inspectSource$3 = store$1.inspectSource;
617
620
 
618
621
  var global$i = global$p;
619
- var isCallable$g = isCallable$n;
622
+ var isCallable$h = isCallable$o;
620
623
 
621
624
  var WeakMap$1 = global$i.WeakMap;
622
625
 
623
- var weakMapBasicDetection = isCallable$g(WeakMap$1) && /native code/.test(String(WeakMap$1));
626
+ var weakMapBasicDetection = isCallable$h(WeakMap$1) && /native code/.test(String(WeakMap$1));
624
627
 
625
628
  var shared$2 = shared$4.exports;
626
629
  var uid = uid$2;
@@ -705,7 +708,7 @@ var internalState = {
705
708
  };
706
709
 
707
710
  var fails$j = fails$q;
708
- var isCallable$f = isCallable$n;
711
+ var isCallable$g = isCallable$o;
709
712
  var hasOwn$7 = hasOwnProperty_1;
710
713
  var DESCRIPTORS$5 = descriptors;
711
714
  var CONFIGURABLE_FUNCTION_NAME$1 = functionName.CONFIGURABLE;
@@ -751,10 +754,10 @@ var makeBuiltIn$1 = makeBuiltIn$2.exports = function (value, name, options) {
751
754
  // add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative
752
755
  // eslint-disable-next-line no-extend-native -- required
753
756
  Function.prototype.toString = makeBuiltIn$1(function toString() {
754
- return isCallable$f(this) && getInternalState$2(this).source || inspectSource$2(this);
757
+ return isCallable$g(this) && getInternalState$2(this).source || inspectSource$2(this);
755
758
  }, 'toString');
756
759
 
757
- var isCallable$e = isCallable$n;
760
+ var isCallable$f = isCallable$o;
758
761
  var definePropertyModule$4 = objectDefineProperty;
759
762
  var makeBuiltIn = makeBuiltIn$2.exports;
760
763
  var defineGlobalProperty$1 = defineGlobalProperty$3;
@@ -763,7 +766,7 @@ var defineBuiltIn$7 = function (O, key, value, options) {
763
766
  if (!options) options = {};
764
767
  var simple = options.enumerable;
765
768
  var name = options.name !== undefined ? options.name : key;
766
- if (isCallable$e(value)) makeBuiltIn(value, name, options);
769
+ if (isCallable$f(value)) makeBuiltIn(value, name, options);
767
770
  if (options.global) {
768
771
  if (simple) O[key] = value;
769
772
  else defineGlobalProperty$1(key, value);
@@ -807,7 +810,7 @@ var toIntegerOrInfinity$6 = function (argument) {
807
810
 
808
811
  var toIntegerOrInfinity$5 = toIntegerOrInfinity$6;
809
812
 
810
- var max$2 = Math.max;
813
+ var max$3 = Math.max;
811
814
  var min$2 = Math.min;
812
815
 
813
816
  // Helper for a popular repeating case of the spec:
@@ -815,7 +818,7 @@ var min$2 = Math.min;
815
818
  // If integer < 0, let result be max((length + integer), 0); else let result be min(integer, length).
816
819
  var toAbsoluteIndex$2 = function (index, length) {
817
820
  var integer = toIntegerOrInfinity$5(index);
818
- return integer < 0 ? max$2(integer + length, 0) : min$2(integer, length);
821
+ return integer < 0 ? max$3(integer + length, 0) : min$2(integer, length);
819
822
  };
820
823
 
821
824
  var toIntegerOrInfinity$4 = toIntegerOrInfinity$6;
@@ -869,13 +872,13 @@ var arrayIncludes = {
869
872
  indexOf: createMethod$3(false)
870
873
  };
871
874
 
872
- var uncurryThis$k = functionUncurryThis;
875
+ var uncurryThis$l = functionUncurryThis;
873
876
  var hasOwn$6 = hasOwnProperty_1;
874
877
  var toIndexedObject$2 = toIndexedObject$5;
875
- var indexOf$1 = arrayIncludes.indexOf;
878
+ var indexOf$2 = arrayIncludes.indexOf;
876
879
  var hiddenKeys$2 = hiddenKeys$4;
877
880
 
878
- var push$2 = uncurryThis$k([].push);
881
+ var push$2 = uncurryThis$l([].push);
879
882
 
880
883
  var objectKeysInternal = function (object, names) {
881
884
  var O = toIndexedObject$2(object);
@@ -885,7 +888,7 @@ var objectKeysInternal = function (object, names) {
885
888
  for (key in O) !hasOwn$6(hiddenKeys$2, key) && hasOwn$6(O, key) && push$2(result, key);
886
889
  // Don't enum bug & hidden keys
887
890
  while (names.length > i) if (hasOwn$6(O, key = names[i++])) {
888
- ~indexOf$1(result, key) || push$2(result, key);
891
+ ~indexOf$2(result, key) || push$2(result, key);
889
892
  }
890
893
  return result;
891
894
  };
@@ -919,12 +922,12 @@ var objectGetOwnPropertySymbols = {};
919
922
  objectGetOwnPropertySymbols.f = Object.getOwnPropertySymbols;
920
923
 
921
924
  var getBuiltIn$5 = getBuiltIn$8;
922
- var uncurryThis$j = functionUncurryThis;
925
+ var uncurryThis$k = functionUncurryThis;
923
926
  var getOwnPropertyNamesModule = objectGetOwnPropertyNames;
924
927
  var getOwnPropertySymbolsModule$1 = objectGetOwnPropertySymbols;
925
928
  var anObject$d = anObject$f;
926
929
 
927
- var concat$2 = uncurryThis$j([].concat);
930
+ var concat$2 = uncurryThis$k([].concat);
928
931
 
929
932
  // all object keys, includes non-enumerable and symbols
930
933
  var ownKeys$1 = getBuiltIn$5('Reflect', 'ownKeys') || function ownKeys(it) {
@@ -951,7 +954,7 @@ var copyConstructorProperties$2 = function (target, source, exceptions) {
951
954
  };
952
955
 
953
956
  var fails$i = fails$q;
954
- var isCallable$d = isCallable$n;
957
+ var isCallable$e = isCallable$o;
955
958
 
956
959
  var replacement = /#|\.prototype\./;
957
960
 
@@ -959,7 +962,7 @@ var isForced$2 = function (feature, detection) {
959
962
  var value = data[normalize(feature)];
960
963
  return value == POLYFILL ? true
961
964
  : value == NATIVE ? false
962
- : isCallable$d(detection) ? fails$i(detection)
965
+ : isCallable$e(detection) ? fails$i(detection)
963
966
  : !!detection;
964
967
  };
965
968
 
@@ -1039,8 +1042,8 @@ var objectKeys$2 = Object.keys || function keys(O) {
1039
1042
  };
1040
1043
 
1041
1044
  var DESCRIPTORS$4 = descriptors;
1042
- var uncurryThis$i = functionUncurryThis;
1043
- var call$e = functionCall;
1045
+ var uncurryThis$j = functionUncurryThis;
1046
+ var call$f = functionCall;
1044
1047
  var fails$h = fails$q;
1045
1048
  var objectKeys$1 = objectKeys$2;
1046
1049
  var getOwnPropertySymbolsModule = objectGetOwnPropertySymbols;
@@ -1052,7 +1055,7 @@ var IndexedObject$1 = indexedObject;
1052
1055
  var $assign = Object.assign;
1053
1056
  // eslint-disable-next-line es/no-object-defineproperty -- required for testing
1054
1057
  var defineProperty$4 = Object.defineProperty;
1055
- var concat$1 = uncurryThis$i([].concat);
1058
+ var concat$1 = uncurryThis$j([].concat);
1056
1059
 
1057
1060
  // `Object.assign` method
1058
1061
  // https://tc39.es/ecma262/#sec-object.assign
@@ -1090,18 +1093,18 @@ var objectAssign = !$assign || fails$h(function () {
1090
1093
  var key;
1091
1094
  while (length > j) {
1092
1095
  key = keys[j++];
1093
- if (!DESCRIPTORS$4 || call$e(propertyIsEnumerable, S, key)) T[key] = S[key];
1096
+ if (!DESCRIPTORS$4 || call$f(propertyIsEnumerable, S, key)) T[key] = S[key];
1094
1097
  }
1095
1098
  } return T;
1096
1099
  } : $assign;
1097
1100
 
1098
- var $$j = _export;
1101
+ var $$k = _export;
1099
1102
  var assign = objectAssign;
1100
1103
 
1101
1104
  // `Object.assign` method
1102
1105
  // https://tc39.es/ecma262/#sec-object.assign
1103
1106
  // eslint-disable-next-line es/no-object-assign -- required for testing
1104
- $$j({ target: 'Object', stat: true, arity: 2, forced: Object.assign !== assign }, {
1107
+ $$k({ target: 'Object', stat: true, arity: 2, forced: Object.assign !== assign }, {
1105
1108
  assign: assign
1106
1109
  });
1107
1110
 
@@ -1147,7 +1150,7 @@ var toObject$4 = toObject$7;
1147
1150
  var IndexedObject = indexedObject;
1148
1151
  var lengthOfArrayLike$5 = lengthOfArrayLike$7;
1149
1152
 
1150
- var $TypeError$b = TypeError;
1153
+ var $TypeError$c = TypeError;
1151
1154
 
1152
1155
  // `Array.prototype.{ reduce, reduceRight }` methods implementation
1153
1156
  var createMethod$2 = function (IS_RIGHT) {
@@ -1166,7 +1169,7 @@ var createMethod$2 = function (IS_RIGHT) {
1166
1169
  }
1167
1170
  index += i;
1168
1171
  if (IS_RIGHT ? index < 0 : length <= index) {
1169
- throw $TypeError$b('Reduce of empty array with no initial value');
1172
+ throw $TypeError$c('Reduce of empty array with no initial value');
1170
1173
  }
1171
1174
  }
1172
1175
  for (;IS_RIGHT ? index >= 0 : length > index; index += i) if (index in self) {
@@ -1200,7 +1203,7 @@ var global$f = global$p;
1200
1203
 
1201
1204
  var engineIsNode = classof$7(global$f.process) == 'process';
1202
1205
 
1203
- var $$i = _export;
1206
+ var $$j = _export;
1204
1207
  var $reduce = arrayReduce.left;
1205
1208
  var arrayMethodIsStrict$1 = arrayMethodIsStrict$2;
1206
1209
  var CHROME_VERSION = engineV8Version;
@@ -1213,7 +1216,7 @@ var CHROME_BUG = !IS_NODE$4 && CHROME_VERSION > 79 && CHROME_VERSION < 83;
1213
1216
 
1214
1217
  // `Array.prototype.reduce` method
1215
1218
  // https://tc39.es/ecma262/#sec-array.prototype.reduce
1216
- $$i({ target: 'Array', proto: true, forced: !STRICT_METHOD$1 || CHROME_BUG }, {
1219
+ $$j({ target: 'Array', proto: true, forced: !STRICT_METHOD$1 || CHROME_BUG }, {
1217
1220
  reduce: function reduce(callbackfn /* , initialValue */) {
1218
1221
  var length = arguments.length;
1219
1222
  return $reduce(this, callbackfn, length, length > 1 ? arguments[1] : undefined);
@@ -1340,11 +1343,11 @@ var objectCreate = Object.create || function create(O, Properties) {
1340
1343
  return Properties === undefined ? result : definePropertiesModule.f(result, Properties);
1341
1344
  };
1342
1345
 
1343
- var wellKnownSymbol$h = wellKnownSymbol$j;
1346
+ var wellKnownSymbol$i = wellKnownSymbol$k;
1344
1347
  var create$2 = objectCreate;
1345
1348
  var defineProperty$3 = objectDefineProperty.f;
1346
1349
 
1347
- var UNSCOPABLES = wellKnownSymbol$h('unscopables');
1350
+ var UNSCOPABLES = wellKnownSymbol$i('unscopables');
1348
1351
  var ArrayPrototype$1 = Array.prototype;
1349
1352
 
1350
1353
  // Array.prototype[@@unscopables]
@@ -1373,7 +1376,7 @@ var correctPrototypeGetter = !fails$f(function () {
1373
1376
  });
1374
1377
 
1375
1378
  var hasOwn$4 = hasOwnProperty_1;
1376
- var isCallable$c = isCallable$n;
1379
+ var isCallable$d = isCallable$o;
1377
1380
  var toObject$3 = toObject$7;
1378
1381
  var sharedKey = sharedKey$3;
1379
1382
  var CORRECT_PROTOTYPE_GETTER = correctPrototypeGetter;
@@ -1389,19 +1392,19 @@ var objectGetPrototypeOf = CORRECT_PROTOTYPE_GETTER ? $Object$1.getPrototypeOf :
1389
1392
  var object = toObject$3(O);
1390
1393
  if (hasOwn$4(object, IE_PROTO)) return object[IE_PROTO];
1391
1394
  var constructor = object.constructor;
1392
- if (isCallable$c(constructor) && object instanceof constructor) {
1395
+ if (isCallable$d(constructor) && object instanceof constructor) {
1393
1396
  return constructor.prototype;
1394
1397
  } return object instanceof $Object$1 ? ObjectPrototype : null;
1395
1398
  };
1396
1399
 
1397
1400
  var fails$e = fails$q;
1398
- var isCallable$b = isCallable$n;
1401
+ var isCallable$c = isCallable$o;
1399
1402
  var isObject$4 = isObject$a;
1400
1403
  var getPrototypeOf$1 = objectGetPrototypeOf;
1401
1404
  var defineBuiltIn$5 = defineBuiltIn$7;
1402
- var wellKnownSymbol$g = wellKnownSymbol$j;
1405
+ var wellKnownSymbol$h = wellKnownSymbol$k;
1403
1406
 
1404
- var ITERATOR$7 = wellKnownSymbol$g('iterator');
1407
+ var ITERATOR$7 = wellKnownSymbol$h('iterator');
1405
1408
  var BUGGY_SAFARI_ITERATORS$1 = false;
1406
1409
 
1407
1410
  // `%IteratorPrototype%` object
@@ -1429,7 +1432,7 @@ if (NEW_ITERATOR_PROTOTYPE) IteratorPrototype$2 = {};
1429
1432
 
1430
1433
  // `%IteratorPrototype%[@@iterator]()` method
1431
1434
  // https://tc39.es/ecma262/#sec-%iteratorprototype%-@@iterator
1432
- if (!isCallable$b(IteratorPrototype$2[ITERATOR$7])) {
1435
+ if (!isCallable$c(IteratorPrototype$2[ITERATOR$7])) {
1433
1436
  defineBuiltIn$5(IteratorPrototype$2, ITERATOR$7, function () {
1434
1437
  return this;
1435
1438
  });
@@ -1442,9 +1445,9 @@ var iteratorsCore = {
1442
1445
 
1443
1446
  var defineProperty$2 = objectDefineProperty.f;
1444
1447
  var hasOwn$3 = hasOwnProperty_1;
1445
- var wellKnownSymbol$f = wellKnownSymbol$j;
1448
+ var wellKnownSymbol$g = wellKnownSymbol$k;
1446
1449
 
1447
- var TO_STRING_TAG$3 = wellKnownSymbol$f('toStringTag');
1450
+ var TO_STRING_TAG$3 = wellKnownSymbol$g('toStringTag');
1448
1451
 
1449
1452
  var setToStringTag$3 = function (target, TAG, STATIC) {
1450
1453
  if (target && !STATIC) target = target.prototype;
@@ -1469,19 +1472,19 @@ var iteratorCreateConstructor = function (IteratorConstructor, NAME, next, ENUME
1469
1472
  return IteratorConstructor;
1470
1473
  };
1471
1474
 
1472
- var isCallable$a = isCallable$n;
1475
+ var isCallable$b = isCallable$o;
1473
1476
 
1474
1477
  var $String$2 = String;
1475
- var $TypeError$a = TypeError;
1478
+ var $TypeError$b = TypeError;
1476
1479
 
1477
1480
  var aPossiblePrototype$1 = function (argument) {
1478
- if (typeof argument == 'object' || isCallable$a(argument)) return argument;
1479
- throw $TypeError$a("Can't set " + $String$2(argument) + ' as a prototype');
1481
+ if (typeof argument == 'object' || isCallable$b(argument)) return argument;
1482
+ throw $TypeError$b("Can't set " + $String$2(argument) + ' as a prototype');
1480
1483
  };
1481
1484
 
1482
1485
  /* eslint-disable no-proto -- safe */
1483
1486
 
1484
- var uncurryThis$h = functionUncurryThis;
1487
+ var uncurryThis$i = functionUncurryThis;
1485
1488
  var anObject$a = anObject$f;
1486
1489
  var aPossiblePrototype = aPossiblePrototype$1;
1487
1490
 
@@ -1495,7 +1498,7 @@ var objectSetPrototypeOf = Object.setPrototypeOf || ('__proto__' in {} ? functio
1495
1498
  var setter;
1496
1499
  try {
1497
1500
  // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
1498
- setter = uncurryThis$h(Object.getOwnPropertyDescriptor(Object.prototype, '__proto__').set);
1501
+ setter = uncurryThis$i(Object.getOwnPropertyDescriptor(Object.prototype, '__proto__').set);
1499
1502
  setter(test, []);
1500
1503
  CORRECT_SETTER = test instanceof Array;
1501
1504
  } catch (error) { /* empty */ }
@@ -1508,17 +1511,17 @@ var objectSetPrototypeOf = Object.setPrototypeOf || ('__proto__' in {} ? functio
1508
1511
  };
1509
1512
  }() : undefined);
1510
1513
 
1511
- var $$h = _export;
1512
- var call$d = functionCall;
1514
+ var $$i = _export;
1515
+ var call$e = functionCall;
1513
1516
  var FunctionName = functionName;
1514
- var isCallable$9 = isCallable$n;
1517
+ var isCallable$a = isCallable$o;
1515
1518
  var createIteratorConstructor = iteratorCreateConstructor;
1516
1519
  var getPrototypeOf = objectGetPrototypeOf;
1517
1520
  var setPrototypeOf$1 = objectSetPrototypeOf;
1518
1521
  var setToStringTag$1 = setToStringTag$3;
1519
1522
  var createNonEnumerableProperty$2 = createNonEnumerableProperty$5;
1520
1523
  var defineBuiltIn$4 = defineBuiltIn$7;
1521
- var wellKnownSymbol$e = wellKnownSymbol$j;
1524
+ var wellKnownSymbol$f = wellKnownSymbol$k;
1522
1525
  var Iterators$3 = iterators;
1523
1526
  var IteratorsCore = iteratorsCore;
1524
1527
 
@@ -1526,7 +1529,7 @@ var PROPER_FUNCTION_NAME$2 = FunctionName.PROPER;
1526
1529
  var CONFIGURABLE_FUNCTION_NAME = FunctionName.CONFIGURABLE;
1527
1530
  var IteratorPrototype = IteratorsCore.IteratorPrototype;
1528
1531
  var BUGGY_SAFARI_ITERATORS = IteratorsCore.BUGGY_SAFARI_ITERATORS;
1529
- var ITERATOR$6 = wellKnownSymbol$e('iterator');
1532
+ var ITERATOR$6 = wellKnownSymbol$f('iterator');
1530
1533
  var KEYS = 'keys';
1531
1534
  var VALUES = 'values';
1532
1535
  var ENTRIES = 'entries';
@@ -1563,7 +1566,7 @@ var iteratorDefine = function (Iterable, NAME, IteratorConstructor, next, DEFAUL
1563
1566
  if (getPrototypeOf(CurrentIteratorPrototype) !== IteratorPrototype) {
1564
1567
  if (setPrototypeOf$1) {
1565
1568
  setPrototypeOf$1(CurrentIteratorPrototype, IteratorPrototype);
1566
- } else if (!isCallable$9(CurrentIteratorPrototype[ITERATOR$6])) {
1569
+ } else if (!isCallable$a(CurrentIteratorPrototype[ITERATOR$6])) {
1567
1570
  defineBuiltIn$4(CurrentIteratorPrototype, ITERATOR$6, returnThis);
1568
1571
  }
1569
1572
  }
@@ -1578,7 +1581,7 @@ var iteratorDefine = function (Iterable, NAME, IteratorConstructor, next, DEFAUL
1578
1581
  createNonEnumerableProperty$2(IterablePrototype, 'name', VALUES);
1579
1582
  } else {
1580
1583
  INCORRECT_VALUES_NAME = true;
1581
- defaultIterator = function values() { return call$d(nativeIterator, this); };
1584
+ defaultIterator = function values() { return call$e(nativeIterator, this); };
1582
1585
  }
1583
1586
  }
1584
1587
 
@@ -1593,7 +1596,7 @@ var iteratorDefine = function (Iterable, NAME, IteratorConstructor, next, DEFAUL
1593
1596
  if (BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME || !(KEY in IterablePrototype)) {
1594
1597
  defineBuiltIn$4(IterablePrototype, KEY, methods[KEY]);
1595
1598
  }
1596
- } else $$h({ target: NAME, proto: true, forced: BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME }, methods);
1599
+ } else $$i({ target: NAME, proto: true, forced: BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME }, methods);
1597
1600
  }
1598
1601
 
1599
1602
  // define iterator
@@ -1721,10 +1724,10 @@ var DOMIterables = domIterables;
1721
1724
  var DOMTokenListPrototype = domTokenListPrototype;
1722
1725
  var ArrayIteratorMethods = es_array_iterator;
1723
1726
  var createNonEnumerableProperty$1 = createNonEnumerableProperty$5;
1724
- var wellKnownSymbol$d = wellKnownSymbol$j;
1727
+ var wellKnownSymbol$e = wellKnownSymbol$k;
1725
1728
 
1726
- var ITERATOR$5 = wellKnownSymbol$d('iterator');
1727
- var TO_STRING_TAG$2 = wellKnownSymbol$d('toStringTag');
1729
+ var ITERATOR$5 = wellKnownSymbol$e('iterator');
1730
+ var TO_STRING_TAG$2 = wellKnownSymbol$e('toStringTag');
1728
1731
  var ArrayValues = ArrayIteratorMethods.values;
1729
1732
 
1730
1733
  var handlePrototype = function (CollectionPrototype, COLLECTION_NAME) {
@@ -1843,6 +1846,18 @@ const createCodedErrors = err => {
1843
1846
  message: err.message
1844
1847
  }];
1845
1848
  };
1849
+ /**
1850
+ * Joins a list of error-like object's messages and throws them as a single error.
1851
+ */
1852
+ function throwJoinedMessages(errors) {
1853
+ throw new Error(errors.map(e => e.message).join(", "));
1854
+ }
1855
+ /**
1856
+ * If any CodedErrors exist, throw them all as a single error, otherwise assert errors is null.
1857
+ */
1858
+ function throwAny(errors) {
1859
+ if (errors) throwJoinedMessages(errors);
1860
+ }
1846
1861
 
1847
1862
  /**
1848
1863
  * @description
@@ -1880,9 +1895,9 @@ const formLogger = {
1880
1895
  })
1881
1896
  };
1882
1897
 
1883
- var wellKnownSymbol$c = wellKnownSymbol$j;
1898
+ var wellKnownSymbol$d = wellKnownSymbol$k;
1884
1899
 
1885
- var TO_STRING_TAG$1 = wellKnownSymbol$c('toStringTag');
1900
+ var TO_STRING_TAG$1 = wellKnownSymbol$d('toStringTag');
1886
1901
  var test$1 = {};
1887
1902
 
1888
1903
  test$1[TO_STRING_TAG$1] = 'z';
@@ -1890,11 +1905,11 @@ test$1[TO_STRING_TAG$1] = 'z';
1890
1905
  var toStringTagSupport = String(test$1) === '[object z]';
1891
1906
 
1892
1907
  var TO_STRING_TAG_SUPPORT = toStringTagSupport;
1893
- var isCallable$8 = isCallable$n;
1908
+ var isCallable$9 = isCallable$o;
1894
1909
  var classofRaw$1 = classofRaw$2;
1895
- var wellKnownSymbol$b = wellKnownSymbol$j;
1910
+ var wellKnownSymbol$c = wellKnownSymbol$k;
1896
1911
 
1897
- var TO_STRING_TAG = wellKnownSymbol$b('toStringTag');
1912
+ var TO_STRING_TAG = wellKnownSymbol$c('toStringTag');
1898
1913
  var $Object = Object;
1899
1914
 
1900
1915
  // ES3 wrong here
@@ -1916,14 +1931,14 @@ var classof$6 = TO_STRING_TAG_SUPPORT ? classofRaw$1 : function (it) {
1916
1931
  // builtinTag case
1917
1932
  : CORRECT_ARGUMENTS ? classofRaw$1(O)
1918
1933
  // ES3 arguments fallback
1919
- : (result = classofRaw$1(O)) == 'Object' && isCallable$8(O.callee) ? 'Arguments' : result;
1934
+ : (result = classofRaw$1(O)) == 'Object' && isCallable$9(O.callee) ? 'Arguments' : result;
1920
1935
  };
1921
1936
 
1922
1937
  var classof$5 = classof$6;
1923
1938
 
1924
1939
  var $String$1 = String;
1925
1940
 
1926
- var toString$b = function (argument) {
1941
+ var toString$c = function (argument) {
1927
1942
  if (classof$5(argument) === 'Symbol') throw TypeError('Cannot convert a Symbol value to a string');
1928
1943
  return $String$1(argument);
1929
1944
  };
@@ -1932,12 +1947,12 @@ var toString$b = function (argument) {
1932
1947
  var whitespaces$4 = '\u0009\u000A\u000B\u000C\u000D\u0020\u00A0\u1680\u2000\u2001\u2002' +
1933
1948
  '\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF';
1934
1949
 
1935
- var uncurryThis$g = functionUncurryThis;
1936
- var requireObjectCoercible$5 = requireObjectCoercible$8;
1937
- var toString$a = toString$b;
1950
+ var uncurryThis$h = functionUncurryThis;
1951
+ var requireObjectCoercible$6 = requireObjectCoercible$9;
1952
+ var toString$b = toString$c;
1938
1953
  var whitespaces$3 = whitespaces$4;
1939
1954
 
1940
- var replace$3 = uncurryThis$g(''.replace);
1955
+ var replace$3 = uncurryThis$h(''.replace);
1941
1956
  var whitespace = '[' + whitespaces$3 + ']';
1942
1957
  var ltrim = RegExp('^' + whitespace + whitespace + '*');
1943
1958
  var rtrim = RegExp(whitespace + whitespace + '*$');
@@ -1945,7 +1960,7 @@ var rtrim = RegExp(whitespace + whitespace + '*$');
1945
1960
  // `String.prototype.{ trim, trimStart, trimEnd, trimLeft, trimRight }` methods implementation
1946
1961
  var createMethod$1 = function (TYPE) {
1947
1962
  return function ($this) {
1948
- var string = toString$a(requireObjectCoercible$5($this));
1963
+ var string = toString$b(requireObjectCoercible$6($this));
1949
1964
  if (TYPE & 1) string = replace$3(string, ltrim, '');
1950
1965
  if (TYPE & 2) string = replace$3(string, rtrim, '');
1951
1966
  return string;
@@ -1980,13 +1995,13 @@ var stringTrimForced = function (METHOD_NAME) {
1980
1995
  });
1981
1996
  };
1982
1997
 
1983
- var $$g = _export;
1998
+ var $$h = _export;
1984
1999
  var $trim = stringTrim.trim;
1985
2000
  var forcedStringTrimMethod = stringTrimForced;
1986
2001
 
1987
2002
  // `String.prototype.trim` method
1988
2003
  // https://tc39.es/ecma262/#sec-string.prototype.trim
1989
- $$g({ target: 'String', proto: true, forced: forcedStringTrimMethod('trim') }, {
2004
+ $$h({ target: 'String', proto: true, forced: forcedStringTrimMethod('trim') }, {
1990
2005
  trim: function trim() {
1991
2006
  return $trim(this);
1992
2007
  }
@@ -2066,9 +2081,9 @@ var regexpUnsupportedNcg = fails$a(function () {
2066
2081
 
2067
2082
  /* eslint-disable regexp/no-empty-capturing-group, regexp/no-empty-group, regexp/no-lazy-ends -- testing */
2068
2083
  /* eslint-disable regexp/no-useless-quantifier -- testing */
2069
- var call$c = functionCall;
2070
- var uncurryThis$f = functionUncurryThis;
2071
- var toString$9 = toString$b;
2084
+ var call$d = functionCall;
2085
+ var uncurryThis$g = functionUncurryThis;
2086
+ var toString$a = toString$c;
2072
2087
  var regexpFlags = regexpFlags$1;
2073
2088
  var stickyHelpers = regexpStickyHelpers;
2074
2089
  var shared = shared$4.exports;
@@ -2080,16 +2095,16 @@ var UNSUPPORTED_NCG = regexpUnsupportedNcg;
2080
2095
  var nativeReplace = shared('native-string-replace', String.prototype.replace);
2081
2096
  var nativeExec = RegExp.prototype.exec;
2082
2097
  var patchedExec = nativeExec;
2083
- var charAt$4 = uncurryThis$f(''.charAt);
2084
- var indexOf = uncurryThis$f(''.indexOf);
2085
- var replace$2 = uncurryThis$f(''.replace);
2086
- var stringSlice$5 = uncurryThis$f(''.slice);
2098
+ var charAt$4 = uncurryThis$g(''.charAt);
2099
+ var indexOf$1 = uncurryThis$g(''.indexOf);
2100
+ var replace$2 = uncurryThis$g(''.replace);
2101
+ var stringSlice$6 = uncurryThis$g(''.slice);
2087
2102
 
2088
2103
  var UPDATES_LAST_INDEX_WRONG = (function () {
2089
2104
  var re1 = /a/;
2090
2105
  var re2 = /b*/g;
2091
- call$c(nativeExec, re1, 'a');
2092
- call$c(nativeExec, re2, 'a');
2106
+ call$d(nativeExec, re1, 'a');
2107
+ call$d(nativeExec, re2, 'a');
2093
2108
  return re1.lastIndex !== 0 || re2.lastIndex !== 0;
2094
2109
  })();
2095
2110
 
@@ -2104,31 +2119,31 @@ if (PATCH) {
2104
2119
  patchedExec = function exec(string) {
2105
2120
  var re = this;
2106
2121
  var state = getInternalState(re);
2107
- var str = toString$9(string);
2122
+ var str = toString$a(string);
2108
2123
  var raw = state.raw;
2109
2124
  var result, reCopy, lastIndex, match, i, object, group;
2110
2125
 
2111
2126
  if (raw) {
2112
2127
  raw.lastIndex = re.lastIndex;
2113
- result = call$c(patchedExec, raw, str);
2128
+ result = call$d(patchedExec, raw, str);
2114
2129
  re.lastIndex = raw.lastIndex;
2115
2130
  return result;
2116
2131
  }
2117
2132
 
2118
2133
  var groups = state.groups;
2119
2134
  var sticky = UNSUPPORTED_Y && re.sticky;
2120
- var flags = call$c(regexpFlags, re);
2135
+ var flags = call$d(regexpFlags, re);
2121
2136
  var source = re.source;
2122
2137
  var charsAdded = 0;
2123
2138
  var strCopy = str;
2124
2139
 
2125
2140
  if (sticky) {
2126
2141
  flags = replace$2(flags, 'y', '');
2127
- if (indexOf(flags, 'g') === -1) {
2142
+ if (indexOf$1(flags, 'g') === -1) {
2128
2143
  flags += 'g';
2129
2144
  }
2130
2145
 
2131
- strCopy = stringSlice$5(str, re.lastIndex);
2146
+ strCopy = stringSlice$6(str, re.lastIndex);
2132
2147
  // Support anchored sticky behavior.
2133
2148
  if (re.lastIndex > 0 && (!re.multiline || re.multiline && charAt$4(str, re.lastIndex - 1) !== '\n')) {
2134
2149
  source = '(?: ' + source + ')';
@@ -2145,12 +2160,12 @@ if (PATCH) {
2145
2160
  }
2146
2161
  if (UPDATES_LAST_INDEX_WRONG) lastIndex = re.lastIndex;
2147
2162
 
2148
- match = call$c(nativeExec, sticky ? reCopy : re, strCopy);
2163
+ match = call$d(nativeExec, sticky ? reCopy : re, strCopy);
2149
2164
 
2150
2165
  if (sticky) {
2151
2166
  if (match) {
2152
- match.input = stringSlice$5(match.input, charsAdded);
2153
- match[0] = stringSlice$5(match[0], charsAdded);
2167
+ match.input = stringSlice$6(match.input, charsAdded);
2168
+ match[0] = stringSlice$6(match[0], charsAdded);
2154
2169
  match.index = re.lastIndex;
2155
2170
  re.lastIndex += match[0].length;
2156
2171
  } else re.lastIndex = 0;
@@ -2160,7 +2175,7 @@ if (PATCH) {
2160
2175
  if (NPCG_INCLUDED && match && match.length > 1) {
2161
2176
  // Fix browsers whose `exec` methods don't consistently return `undefined`
2162
2177
  // for NPCG, like IE8. NOTE: This doesn't work for /(.?)?/
2163
- call$c(nativeReplace, match[0], reCopy, function () {
2178
+ call$d(nativeReplace, match[0], reCopy, function () {
2164
2179
  for (i = 1; i < arguments.length - 2; i++) {
2165
2180
  if (arguments[i] === undefined) match[i] = undefined;
2166
2181
  }
@@ -2181,12 +2196,12 @@ if (PATCH) {
2181
2196
 
2182
2197
  var regexpExec$2 = patchedExec;
2183
2198
 
2184
- var $$f = _export;
2199
+ var $$g = _export;
2185
2200
  var exec$2 = regexpExec$2;
2186
2201
 
2187
2202
  // `RegExp.prototype.exec` method
2188
2203
  // https://tc39.es/ecma262/#sec-regexp.prototype.exec
2189
- $$f({ target: 'RegExp', proto: true, forced: /./.exec !== exec$2 }, {
2204
+ $$g({ target: 'RegExp', proto: true, forced: /./.exec !== exec$2 }, {
2190
2205
  exec: exec$2
2191
2206
  });
2192
2207
 
@@ -2194,37 +2209,37 @@ var NATIVE_BIND$1 = functionBindNative;
2194
2209
 
2195
2210
  var FunctionPrototype = Function.prototype;
2196
2211
  var apply$2 = FunctionPrototype.apply;
2197
- var call$b = FunctionPrototype.call;
2212
+ var call$c = FunctionPrototype.call;
2198
2213
 
2199
2214
  // eslint-disable-next-line es/no-reflect -- safe
2200
- var functionApply = typeof Reflect == 'object' && Reflect.apply || (NATIVE_BIND$1 ? call$b.bind(apply$2) : function () {
2201
- return call$b.apply(apply$2, arguments);
2215
+ var functionApply = typeof Reflect == 'object' && Reflect.apply || (NATIVE_BIND$1 ? call$c.bind(apply$2) : function () {
2216
+ return call$c.apply(apply$2, arguments);
2202
2217
  });
2203
2218
 
2204
2219
  var classofRaw = classofRaw$2;
2205
- var uncurryThis$e = functionUncurryThis;
2220
+ var uncurryThis$f = functionUncurryThis;
2206
2221
 
2207
2222
  var functionUncurryThisClause = function (fn) {
2208
2223
  // Nashorn bug:
2209
2224
  // https://github.com/zloirock/core-js/issues/1128
2210
2225
  // https://github.com/zloirock/core-js/issues/1130
2211
- if (classofRaw(fn) === 'Function') return uncurryThis$e(fn);
2226
+ if (classofRaw(fn) === 'Function') return uncurryThis$f(fn);
2212
2227
  };
2213
2228
 
2214
2229
  // TODO: Remove from `core-js@4` since it's moved to entry points
2215
2230
 
2216
- var uncurryThis$d = functionUncurryThisClause;
2231
+ var uncurryThis$e = functionUncurryThisClause;
2217
2232
  var defineBuiltIn$3 = defineBuiltIn$7;
2218
2233
  var regexpExec$1 = regexpExec$2;
2219
2234
  var fails$9 = fails$q;
2220
- var wellKnownSymbol$a = wellKnownSymbol$j;
2235
+ var wellKnownSymbol$b = wellKnownSymbol$k;
2221
2236
  var createNonEnumerableProperty = createNonEnumerableProperty$5;
2222
2237
 
2223
- var SPECIES$4 = wellKnownSymbol$a('species');
2238
+ var SPECIES$4 = wellKnownSymbol$b('species');
2224
2239
  var RegExpPrototype$2 = RegExp.prototype;
2225
2240
 
2226
2241
  var fixRegexpWellKnownSymbolLogic = function (KEY, exec, FORCED, SHAM) {
2227
- var SYMBOL = wellKnownSymbol$a(KEY);
2242
+ var SYMBOL = wellKnownSymbol$b(KEY);
2228
2243
 
2229
2244
  var DELEGATES_TO_SYMBOL = !fails$9(function () {
2230
2245
  // String methods call symbol-named RegEp methods
@@ -2262,9 +2277,9 @@ var fixRegexpWellKnownSymbolLogic = function (KEY, exec, FORCED, SHAM) {
2262
2277
  !DELEGATES_TO_EXEC ||
2263
2278
  FORCED
2264
2279
  ) {
2265
- var uncurriedNativeRegExpMethod = uncurryThis$d(/./[SYMBOL]);
2280
+ var uncurriedNativeRegExpMethod = uncurryThis$e(/./[SYMBOL]);
2266
2281
  var methods = exec(SYMBOL, ''[KEY], function (nativeMethod, regexp, str, arg2, forceStringMethod) {
2267
- var uncurriedNativeMethod = uncurryThis$d(nativeMethod);
2282
+ var uncurriedNativeMethod = uncurryThis$e(nativeMethod);
2268
2283
  var $exec = regexp.exec;
2269
2284
  if ($exec === regexpExec$1 || $exec === RegExpPrototype$2.exec) {
2270
2285
  if (DELEGATES_TO_SYMBOL && !forceStringMethod) {
@@ -2285,18 +2300,18 @@ var fixRegexpWellKnownSymbolLogic = function (KEY, exec, FORCED, SHAM) {
2285
2300
  if (SHAM) createNonEnumerableProperty(RegExpPrototype$2[SYMBOL], 'sham', true);
2286
2301
  };
2287
2302
 
2288
- var uncurryThis$c = functionUncurryThis;
2303
+ var uncurryThis$d = functionUncurryThis;
2289
2304
  var toIntegerOrInfinity$3 = toIntegerOrInfinity$6;
2290
- var toString$8 = toString$b;
2291
- var requireObjectCoercible$4 = requireObjectCoercible$8;
2305
+ var toString$9 = toString$c;
2306
+ var requireObjectCoercible$5 = requireObjectCoercible$9;
2292
2307
 
2293
- var charAt$3 = uncurryThis$c(''.charAt);
2294
- var charCodeAt = uncurryThis$c(''.charCodeAt);
2295
- var stringSlice$4 = uncurryThis$c(''.slice);
2308
+ var charAt$3 = uncurryThis$d(''.charAt);
2309
+ var charCodeAt = uncurryThis$d(''.charCodeAt);
2310
+ var stringSlice$5 = uncurryThis$d(''.slice);
2296
2311
 
2297
2312
  var createMethod = function (CONVERT_TO_STRING) {
2298
2313
  return function ($this, pos) {
2299
- var S = toString$8(requireObjectCoercible$4($this));
2314
+ var S = toString$9(requireObjectCoercible$5($this));
2300
2315
  var position = toIntegerOrInfinity$3(pos);
2301
2316
  var size = S.length;
2302
2317
  var first, second;
@@ -2308,7 +2323,7 @@ var createMethod = function (CONVERT_TO_STRING) {
2308
2323
  ? charAt$3(S, position)
2309
2324
  : first
2310
2325
  : CONVERT_TO_STRING
2311
- ? stringSlice$4(S, position, position + 2)
2326
+ ? stringSlice$5(S, position, position + 2)
2312
2327
  : (first - 0xD800 << 10) + (second - 0xDC00) + 0x10000;
2313
2328
  };
2314
2329
  };
@@ -2330,19 +2345,19 @@ var advanceStringIndex$2 = function (S, index, unicode) {
2330
2345
  return index + (unicode ? charAt$2(S, index).length : 1);
2331
2346
  };
2332
2347
 
2333
- var uncurryThis$b = functionUncurryThis;
2348
+ var uncurryThis$c = functionUncurryThis;
2334
2349
  var toObject$2 = toObject$7;
2335
2350
 
2336
2351
  var floor$2 = Math.floor;
2337
- var charAt$1 = uncurryThis$b(''.charAt);
2338
- var replace$1 = uncurryThis$b(''.replace);
2339
- var stringSlice$3 = uncurryThis$b(''.slice);
2352
+ var charAt$1 = uncurryThis$c(''.charAt);
2353
+ var replace$1 = uncurryThis$c(''.replace);
2354
+ var stringSlice$4 = uncurryThis$c(''.slice);
2340
2355
  var SUBSTITUTION_SYMBOLS = /\$([$&'`]|\d{1,2}|<[^>]*>)/g;
2341
2356
  var SUBSTITUTION_SYMBOLS_NO_NAMED = /\$([$&'`]|\d{1,2})/g;
2342
2357
 
2343
2358
  // `GetSubstitution` abstract operation
2344
2359
  // https://tc39.es/ecma262/#sec-getsubstitution
2345
- var getSubstitution$1 = function (matched, str, position, captures, namedCaptures, replacement) {
2360
+ var getSubstitution$2 = function (matched, str, position, captures, namedCaptures, replacement) {
2346
2361
  var tailPos = position + matched.length;
2347
2362
  var m = captures.length;
2348
2363
  var symbols = SUBSTITUTION_SYMBOLS_NO_NAMED;
@@ -2355,10 +2370,10 @@ var getSubstitution$1 = function (matched, str, position, captures, namedCapture
2355
2370
  switch (charAt$1(ch, 0)) {
2356
2371
  case '$': return '$';
2357
2372
  case '&': return matched;
2358
- case '`': return stringSlice$3(str, 0, position);
2359
- case "'": return stringSlice$3(str, tailPos);
2373
+ case '`': return stringSlice$4(str, 0, position);
2374
+ case "'": return stringSlice$4(str, tailPos);
2360
2375
  case '<':
2361
- capture = namedCaptures[stringSlice$3(ch, 1, -1)];
2376
+ capture = namedCaptures[stringSlice$4(ch, 1, -1)];
2362
2377
  break;
2363
2378
  default: // \d\d?
2364
2379
  var n = +ch;
@@ -2375,52 +2390,52 @@ var getSubstitution$1 = function (matched, str, position, captures, namedCapture
2375
2390
  });
2376
2391
  };
2377
2392
 
2378
- var call$a = functionCall;
2393
+ var call$b = functionCall;
2379
2394
  var anObject$8 = anObject$f;
2380
- var isCallable$7 = isCallable$n;
2395
+ var isCallable$8 = isCallable$o;
2381
2396
  var classof$4 = classofRaw$2;
2382
2397
  var regexpExec = regexpExec$2;
2383
2398
 
2384
- var $TypeError$9 = TypeError;
2399
+ var $TypeError$a = TypeError;
2385
2400
 
2386
2401
  // `RegExpExec` abstract operation
2387
2402
  // https://tc39.es/ecma262/#sec-regexpexec
2388
2403
  var regexpExecAbstract = function (R, S) {
2389
2404
  var exec = R.exec;
2390
- if (isCallable$7(exec)) {
2391
- var result = call$a(exec, R, S);
2405
+ if (isCallable$8(exec)) {
2406
+ var result = call$b(exec, R, S);
2392
2407
  if (result !== null) anObject$8(result);
2393
2408
  return result;
2394
2409
  }
2395
- if (classof$4(R) === 'RegExp') return call$a(regexpExec, R, S);
2396
- throw $TypeError$9('RegExp#exec called on incompatible receiver');
2410
+ if (classof$4(R) === 'RegExp') return call$b(regexpExec, R, S);
2411
+ throw $TypeError$a('RegExp#exec called on incompatible receiver');
2397
2412
  };
2398
2413
 
2399
2414
  var apply$1 = functionApply;
2400
- var call$9 = functionCall;
2401
- var uncurryThis$a = functionUncurryThis;
2415
+ var call$a = functionCall;
2416
+ var uncurryThis$b = functionUncurryThis;
2402
2417
  var fixRegExpWellKnownSymbolLogic$1 = fixRegexpWellKnownSymbolLogic;
2403
2418
  var fails$8 = fails$q;
2404
2419
  var anObject$7 = anObject$f;
2405
- var isCallable$6 = isCallable$n;
2406
- var isNullOrUndefined$3 = isNullOrUndefined$6;
2420
+ var isCallable$7 = isCallable$o;
2421
+ var isNullOrUndefined$4 = isNullOrUndefined$7;
2407
2422
  var toIntegerOrInfinity$2 = toIntegerOrInfinity$6;
2408
2423
  var toLength$1 = toLength$3;
2409
- var toString$7 = toString$b;
2410
- var requireObjectCoercible$3 = requireObjectCoercible$8;
2424
+ var toString$8 = toString$c;
2425
+ var requireObjectCoercible$4 = requireObjectCoercible$9;
2411
2426
  var advanceStringIndex$1 = advanceStringIndex$2;
2412
- var getMethod$3 = getMethod$5;
2413
- var getSubstitution = getSubstitution$1;
2427
+ var getMethod$4 = getMethod$6;
2428
+ var getSubstitution$1 = getSubstitution$2;
2414
2429
  var regExpExec$1 = regexpExecAbstract;
2415
- var wellKnownSymbol$9 = wellKnownSymbol$j;
2430
+ var wellKnownSymbol$a = wellKnownSymbol$k;
2416
2431
 
2417
- var REPLACE = wellKnownSymbol$9('replace');
2418
- var max$1 = Math.max;
2432
+ var REPLACE$1 = wellKnownSymbol$a('replace');
2433
+ var max$2 = Math.max;
2419
2434
  var min = Math.min;
2420
- var concat = uncurryThis$a([].concat);
2421
- var push$1 = uncurryThis$a([].push);
2422
- var stringIndexOf$1 = uncurryThis$a(''.indexOf);
2423
- var stringSlice$2 = uncurryThis$a(''.slice);
2435
+ var concat = uncurryThis$b([].concat);
2436
+ var push$1 = uncurryThis$b([].push);
2437
+ var stringIndexOf$2 = uncurryThis$b(''.indexOf);
2438
+ var stringSlice$3 = uncurryThis$b(''.slice);
2424
2439
 
2425
2440
  var maybeToString = function (it) {
2426
2441
  return it === undefined ? it : String(it);
@@ -2435,8 +2450,8 @@ var REPLACE_KEEPS_$0 = (function () {
2435
2450
 
2436
2451
  // Safari <= 13.0.3(?) substitutes nth capture where n>m with an empty string
2437
2452
  var REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE = (function () {
2438
- if (/./[REPLACE]) {
2439
- return /./[REPLACE]('a', '$0') === '';
2453
+ if (/./[REPLACE$1]) {
2454
+ return /./[REPLACE$1]('a', '$0') === '';
2440
2455
  }
2441
2456
  return false;
2442
2457
  })();
@@ -2460,29 +2475,29 @@ fixRegExpWellKnownSymbolLogic$1('replace', function (_, nativeReplace, maybeCall
2460
2475
  // `String.prototype.replace` method
2461
2476
  // https://tc39.es/ecma262/#sec-string.prototype.replace
2462
2477
  function replace(searchValue, replaceValue) {
2463
- var O = requireObjectCoercible$3(this);
2464
- var replacer = isNullOrUndefined$3(searchValue) ? undefined : getMethod$3(searchValue, REPLACE);
2478
+ var O = requireObjectCoercible$4(this);
2479
+ var replacer = isNullOrUndefined$4(searchValue) ? undefined : getMethod$4(searchValue, REPLACE$1);
2465
2480
  return replacer
2466
- ? call$9(replacer, searchValue, O, replaceValue)
2467
- : call$9(nativeReplace, toString$7(O), searchValue, replaceValue);
2481
+ ? call$a(replacer, searchValue, O, replaceValue)
2482
+ : call$a(nativeReplace, toString$8(O), searchValue, replaceValue);
2468
2483
  },
2469
2484
  // `RegExp.prototype[@@replace]` method
2470
2485
  // https://tc39.es/ecma262/#sec-regexp.prototype-@@replace
2471
2486
  function (string, replaceValue) {
2472
2487
  var rx = anObject$7(this);
2473
- var S = toString$7(string);
2488
+ var S = toString$8(string);
2474
2489
 
2475
2490
  if (
2476
2491
  typeof replaceValue == 'string' &&
2477
- stringIndexOf$1(replaceValue, UNSAFE_SUBSTITUTE) === -1 &&
2478
- stringIndexOf$1(replaceValue, '$<') === -1
2492
+ stringIndexOf$2(replaceValue, UNSAFE_SUBSTITUTE) === -1 &&
2493
+ stringIndexOf$2(replaceValue, '$<') === -1
2479
2494
  ) {
2480
2495
  var res = maybeCallNative(nativeReplace, rx, S, replaceValue);
2481
2496
  if (res.done) return res.value;
2482
2497
  }
2483
2498
 
2484
- var functionalReplace = isCallable$6(replaceValue);
2485
- if (!functionalReplace) replaceValue = toString$7(replaceValue);
2499
+ var functionalReplace = isCallable$7(replaceValue);
2500
+ if (!functionalReplace) replaceValue = toString$8(replaceValue);
2486
2501
 
2487
2502
  var global = rx.global;
2488
2503
  if (global) {
@@ -2497,7 +2512,7 @@ fixRegExpWellKnownSymbolLogic$1('replace', function (_, nativeReplace, maybeCall
2497
2512
  push$1(results, result);
2498
2513
  if (!global) break;
2499
2514
 
2500
- var matchStr = toString$7(result[0]);
2515
+ var matchStr = toString$8(result[0]);
2501
2516
  if (matchStr === '') rx.lastIndex = advanceStringIndex$1(S, toLength$1(rx.lastIndex), fullUnicode);
2502
2517
  }
2503
2518
 
@@ -2506,8 +2521,8 @@ fixRegExpWellKnownSymbolLogic$1('replace', function (_, nativeReplace, maybeCall
2506
2521
  for (var i = 0; i < results.length; i++) {
2507
2522
  result = results[i];
2508
2523
 
2509
- var matched = toString$7(result[0]);
2510
- var position = max$1(min(toIntegerOrInfinity$2(result.index), S.length), 0);
2524
+ var matched = toString$8(result[0]);
2525
+ var position = max$2(min(toIntegerOrInfinity$2(result.index), S.length), 0);
2511
2526
  var captures = [];
2512
2527
  // NOTE: This is equivalent to
2513
2528
  // captures = result.slice(1).map(maybeToString)
@@ -2519,16 +2534,16 @@ fixRegExpWellKnownSymbolLogic$1('replace', function (_, nativeReplace, maybeCall
2519
2534
  if (functionalReplace) {
2520
2535
  var replacerArgs = concat([matched], captures, position, S);
2521
2536
  if (namedCaptures !== undefined) push$1(replacerArgs, namedCaptures);
2522
- var replacement = toString$7(apply$1(replaceValue, undefined, replacerArgs));
2537
+ var replacement = toString$8(apply$1(replaceValue, undefined, replacerArgs));
2523
2538
  } else {
2524
- replacement = getSubstitution(matched, S, position, captures, namedCaptures, replaceValue);
2539
+ replacement = getSubstitution$1(matched, S, position, captures, namedCaptures, replaceValue);
2525
2540
  }
2526
2541
  if (position >= nextSourcePosition) {
2527
- accumulatedResult += stringSlice$2(S, nextSourcePosition, position) + replacement;
2542
+ accumulatedResult += stringSlice$3(S, nextSourcePosition, position) + replacement;
2528
2543
  nextSourcePosition = position + matched.length;
2529
2544
  }
2530
2545
  }
2531
- return accumulatedResult + stringSlice$2(S, nextSourcePosition);
2546
+ return accumulatedResult + stringSlice$3(S, nextSourcePosition);
2532
2547
  }
2533
2548
  ];
2534
2549
  }, !REPLACE_SUPPORTS_NAMED_GROUPS || !REPLACE_KEEPS_$0 || REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE);
@@ -2563,10 +2578,15 @@ const formatExpiration = exp => {
2563
2578
 
2564
2579
  const isString = x => typeof x === "string";
2565
2580
 
2566
- const getRateRequiresAcknowledgement = serviceCode => {
2581
+ const getRateRequiresAcknowledgement = (serviceCode, packageType) => {
2567
2582
  switch (serviceCode) {
2568
2583
  case "usps_media_mail":
2569
2584
  return true;
2585
+ case "usps_first_class_mail":
2586
+ if (packageType === "large_envelope_or_flat") {
2587
+ return true;
2588
+ }
2589
+ return false;
2570
2590
  default:
2571
2591
  return false;
2572
2592
  }
@@ -2583,16 +2603,18 @@ const hasEuCustomsRules = true,
2583
2603
  // United States territories that ship domestic but require customs
2584
2604
  // https://blog.stamps.com/2015/09/23/how-to-ship-packages-to-u-s-territories/
2585
2605
  isUnitedStatesTerritory$1 = true,
2606
+ isUnsupportedByUps$1 = true,
2586
2607
  supportsByoa = true;
2587
2608
  class Country {
2588
2609
  constructor(name, code, rules = {}) {
2589
- var _a, _b, _c, _d;
2610
+ var _a, _b, _c, _d, _e;
2590
2611
  this.name = name;
2591
2612
  this.code = code;
2592
2613
  this.hasEuCustomsRules = (_a = rules.hasEuCustomsRules) !== null && _a !== void 0 ? _a : false;
2593
2614
  this.hasProvinces = (_b = rules.hasProvinces) !== null && _b !== void 0 ? _b : false;
2594
2615
  this.isUnitedStatesTerritory = (_c = rules.isUnitedStatesTerritory) !== null && _c !== void 0 ? _c : false;
2595
2616
  this.supportsByoa = (_d = rules.supportsByoa) !== null && _d !== void 0 ? _d : false;
2617
+ this.isUnsupportedByUps = (_e = rules.isUnsupportedByUps) !== null && _e !== void 0 ? _e : false;
2596
2618
  }
2597
2619
  }
2598
2620
  const countries = [new Country("Afghanistan", "AF"), new Country("Aland Islands", "AX"), new Country("Albania", "AL"), new Country("Algeria", "DZ"), new Country("American Samoa", "AS", {
@@ -2613,7 +2635,9 @@ const countries = [new Country("Afghanistan", "AF"), new Country("Aland Islands"
2613
2635
  supportsByoa
2614
2636
  }), new Country("Burkina Faso", "BF"), new Country("Burundi", "BI"), new Country("Canada", "CA", {
2615
2637
  hasProvinces
2616
- }), new Country("Cambodia", "KH"), new Country("Cameroon", "CM"), new Country("Cape Verde Islands", "CV"), new Country("Cayman Islands", "KY"), new Country("Central African Republic", "CF"), new Country("Chad", "TD"), new Country("Chile", "CL"), new Country("China", "CN"), new Country("Christmas Island", "CX"), new Country("Cocos(Keeling) Islands", "CC"), new Country("Colombia", "CO"), new Country("Comoros", "KM"), new Country("Congo", "CG"), new Country("Congo, The Democratic Republic of", "CD"), new Country("Cook Islands", "CK"), new Country("Costa Rica", "CR"), new Country("Croatia", "HR", {
2638
+ }), new Country("Cambodia", "KH", {
2639
+ isUnsupportedByUps: isUnsupportedByUps$1
2640
+ }), new Country("Cameroon", "CM"), new Country("Cape Verde Islands", "CV"), new Country("Cayman Islands", "KY"), new Country("Central African Republic", "CF"), new Country("Chad", "TD"), new Country("Chile", "CL"), new Country("China", "CN"), new Country("Christmas Island", "CX"), new Country("Cocos(Keeling) Islands", "CC"), new Country("Colombia", "CO"), new Country("Comoros", "KM"), new Country("Congo", "CG"), new Country("Congo, The Democratic Republic of", "CD"), new Country("Cook Islands", "CK"), new Country("Costa Rica", "CR"), new Country("Croatia", "HR", {
2617
2641
  hasEuCustomsRules,
2618
2642
  supportsByoa
2619
2643
  }), new Country("Cuba", "CU"), new Country("Curacao", "CW"), new Country("Cyprus", "CY", {
@@ -2674,7 +2698,9 @@ const countries = [new Country("Afghanistan", "AF"), new Country("Aland Islands"
2674
2698
  }), new Country("Moldova", "MD"), new Country("Monaco", "MC"), new Country("Mongolia", "MN"), new Country("Montenegro", "ME"), new Country("Montserrat", "MS"), new Country("Morocco", "MA"), new Country("Mozambique", "MZ"), new Country("Myanmar", "MM"), new Country("Namibia", "NA"), new Country("Nauru", "NR"), new Country("Nepal", "NP"), new Country("Netherlands", "NL", {
2675
2699
  hasEuCustomsRules,
2676
2700
  supportsByoa
2677
- }), new Country("Netherlands Antilles", "AN"), new Country("New Caledonia", "NC"), new Country("New Zealand", "NZ", {
2701
+ }), new Country("Netherlands Antilles", "AN"), new Country("New Caledonia", "NC", {
2702
+ isUnsupportedByUps: isUnsupportedByUps$1
2703
+ }), new Country("New Zealand", "NZ", {
2678
2704
  supportsByoa
2679
2705
  }), new Country("Nicaragua", "NI"), new Country("Niger", "NE"), new Country("Nigeria", "NG"), new Country("Niue", "NU"), new Country("Norfolk Island", "NF"), new Country("North Korea", "KP"), new Country("Northern Mariana Islands", "MP", {
2680
2706
  isUnitedStatesTerritory: isUnitedStatesTerritory$1
@@ -2791,6 +2817,13 @@ const isUnitedStatesTerritory = address => {
2791
2817
  var _a, _b;
2792
2818
  return !!(((_a = countries.find(c => c.code === address.countryCode)) === null || _a === void 0 ? void 0 : _a.isUnitedStatesTerritory) || ((_b = usStates.find(s => s.code === address.stateProvince)) === null || _b === void 0 ? void 0 : _b.isUnitedStatesTerritory));
2793
2819
  };
2820
+ /**
2821
+ * @category Utilities
2822
+ */
2823
+ const isUnsupportedByUps = address => {
2824
+ var _a;
2825
+ return !!((_a = countries.find(c => c.code === address.countryCode)) === null || _a === void 0 ? void 0 : _a.isUnsupportedByUps);
2826
+ };
2794
2827
  const PO_BOX_REGEX =
2795
2828
  // eslint-disable-next-line no-useless-escape
2796
2829
  /^(((p[\s\.\'\,]?[o\s][\.\'\,]?)\s?)|(post\s?office\s?))((box|bin|bo|b\.?)?\s?(num|number|#)?\s?\d+)/i;
@@ -2803,7 +2836,7 @@ const isPoBox = addressLine => PO_BOX_REGEX.test(addressLine);
2803
2836
  */
2804
2837
  const isPoBoxAddress = address => !!(isPoBox(address.addressLine1) || address.addressLine2 && isPoBox(address.addressLine2));
2805
2838
 
2806
- var $$e = _export;
2839
+ var $$f = _export;
2807
2840
  var $includes = arrayIncludes.includes;
2808
2841
  var fails$7 = fails$q;
2809
2842
  var addToUnscopables$1 = addToUnscopables$3;
@@ -2815,7 +2848,7 @@ var BROKEN_ON_SPARSE = fails$7(function () {
2815
2848
 
2816
2849
  // `Array.prototype.includes` method
2817
2850
  // https://tc39.es/ecma262/#sec-array.prototype.includes
2818
- $$e({ target: 'Array', proto: true, forced: BROKEN_ON_SPARSE }, {
2851
+ $$f({ target: 'Array', proto: true, forced: BROKEN_ON_SPARSE }, {
2819
2852
  includes: function includes(el /* , fromIndex = 0 */) {
2820
2853
  return $includes(this, el, arguments.length > 1 ? arguments[1] : undefined);
2821
2854
  }
@@ -2826,6 +2859,7 @@ addToUnscopables$1('includes');
2826
2859
 
2827
2860
  const USPS_CARRIER_CODES = ["usps", "stamps_com"];
2828
2861
  const isUspsCarrier = carrierCode => USPS_CARRIER_CODES.includes(carrierCode);
2862
+ const isUpsCarrier = carrierCode => carrierCode === "ups";
2829
2863
 
2830
2864
  function convertDimensions(dimensions, {
2831
2865
  allowAllZeroes
@@ -2890,10 +2924,10 @@ const getSalesOrderItemsFromSalesOrderOrShipment = ({
2890
2924
 
2891
2925
  var tryToString$3 = tryToString$5;
2892
2926
 
2893
- var $TypeError$8 = TypeError;
2927
+ var $TypeError$9 = TypeError;
2894
2928
 
2895
2929
  var deletePropertyOrThrow$1 = function (O, P) {
2896
- if (!delete O[P]) throw $TypeError$8('Cannot delete property ' + tryToString$3(P) + ' of ' + tryToString$3(O));
2930
+ if (!delete O[P]) throw $TypeError$9('Cannot delete property ' + tryToString$3(P) + ' of ' + tryToString$3(O));
2897
2931
  };
2898
2932
 
2899
2933
  var toPropertyKey = toPropertyKey$3;
@@ -2911,13 +2945,13 @@ var lengthOfArrayLike$4 = lengthOfArrayLike$7;
2911
2945
  var createProperty$1 = createProperty$2;
2912
2946
 
2913
2947
  var $Array$1 = Array;
2914
- var max = Math.max;
2948
+ var max$1 = Math.max;
2915
2949
 
2916
2950
  var arraySliceSimple = function (O, start, end) {
2917
2951
  var length = lengthOfArrayLike$4(O);
2918
2952
  var k = toAbsoluteIndex(start, length);
2919
2953
  var fin = toAbsoluteIndex(end === undefined ? length : end, length);
2920
- var result = $Array$1(max(fin - k, 0));
2954
+ var result = $Array$1(max$1(fin - k, 0));
2921
2955
  for (var n = 0; k < fin; k++, n++) createProperty$1(result, n, O[k]);
2922
2956
  result.length = n;
2923
2957
  return result;
@@ -2984,13 +3018,13 @@ var webkit = userAgent$3.match(/AppleWebKit\/(\d+)\./);
2984
3018
 
2985
3019
  var engineWebkitVersion = !!webkit && +webkit[1];
2986
3020
 
2987
- var $$d = _export;
2988
- var uncurryThis$9 = functionUncurryThis;
3021
+ var $$e = _export;
3022
+ var uncurryThis$a = functionUncurryThis;
2989
3023
  var aCallable$7 = aCallable$a;
2990
3024
  var toObject$1 = toObject$7;
2991
3025
  var lengthOfArrayLike$3 = lengthOfArrayLike$7;
2992
3026
  var deletePropertyOrThrow = deletePropertyOrThrow$1;
2993
- var toString$6 = toString$b;
3027
+ var toString$7 = toString$c;
2994
3028
  var fails$6 = fails$q;
2995
3029
  var internalSort = arraySort;
2996
3030
  var arrayMethodIsStrict = arrayMethodIsStrict$2;
@@ -3000,8 +3034,8 @@ var V8 = engineV8Version;
3000
3034
  var WEBKIT = engineWebkitVersion;
3001
3035
 
3002
3036
  var test = [];
3003
- var nativeSort = uncurryThis$9(test.sort);
3004
- var push = uncurryThis$9(test.push);
3037
+ var nativeSort = uncurryThis$a(test.sort);
3038
+ var push = uncurryThis$a(test.push);
3005
3039
 
3006
3040
  // IE8-
3007
3041
  var FAILS_ON_UNDEFINED = fails$6(function () {
@@ -3056,13 +3090,13 @@ var getSortCompare = function (comparefn) {
3056
3090
  if (y === undefined) return -1;
3057
3091
  if (x === undefined) return 1;
3058
3092
  if (comparefn !== undefined) return +comparefn(x, y) || 0;
3059
- return toString$6(x) > toString$6(y) ? 1 : -1;
3093
+ return toString$7(x) > toString$7(y) ? 1 : -1;
3060
3094
  };
3061
3095
  };
3062
3096
 
3063
3097
  // `Array.prototype.sort` method
3064
3098
  // https://tc39.es/ecma262/#sec-array.prototype.sort
3065
- $$d({ target: 'Array', proto: true, forced: FORCED$3 }, {
3099
+ $$e({ target: 'Array', proto: true, forced: FORCED$3 }, {
3066
3100
  sort: function sort(comparefn) {
3067
3101
  if (comparefn !== undefined) aCallable$7(comparefn);
3068
3102
 
@@ -3140,9 +3174,9 @@ function formatFractionalWeight(weight) {
3140
3174
 
3141
3175
  var isObject$3 = isObject$a;
3142
3176
  var classof$3 = classofRaw$2;
3143
- var wellKnownSymbol$8 = wellKnownSymbol$j;
3177
+ var wellKnownSymbol$9 = wellKnownSymbol$k;
3144
3178
 
3145
- var MATCH$1 = wellKnownSymbol$8('match');
3179
+ var MATCH$1 = wellKnownSymbol$9('match');
3146
3180
 
3147
3181
  // `IsRegExp` abstract operation
3148
3182
  // https://tc39.es/ecma262/#sec-isregexp
@@ -3151,19 +3185,19 @@ var isRegexp = function (it) {
3151
3185
  return isObject$3(it) && ((isRegExp = it[MATCH$1]) !== undefined ? !!isRegExp : classof$3(it) == 'RegExp');
3152
3186
  };
3153
3187
 
3154
- var isRegExp = isRegexp;
3188
+ var isRegExp$1 = isRegexp;
3155
3189
 
3156
- var $TypeError$7 = TypeError;
3190
+ var $TypeError$8 = TypeError;
3157
3191
 
3158
3192
  var notARegexp = function (it) {
3159
- if (isRegExp(it)) {
3160
- throw $TypeError$7("The method doesn't accept regular expressions");
3193
+ if (isRegExp$1(it)) {
3194
+ throw $TypeError$8("The method doesn't accept regular expressions");
3161
3195
  } return it;
3162
3196
  };
3163
3197
 
3164
- var wellKnownSymbol$7 = wellKnownSymbol$j;
3198
+ var wellKnownSymbol$8 = wellKnownSymbol$k;
3165
3199
 
3166
- var MATCH = wellKnownSymbol$7('match');
3200
+ var MATCH = wellKnownSymbol$8('match');
3167
3201
 
3168
3202
  var correctIsRegexpLogic = function (METHOD_NAME) {
3169
3203
  var regexp = /./;
@@ -3177,22 +3211,22 @@ var correctIsRegexpLogic = function (METHOD_NAME) {
3177
3211
  } return false;
3178
3212
  };
3179
3213
 
3180
- var $$c = _export;
3181
- var uncurryThis$8 = functionUncurryThis;
3214
+ var $$d = _export;
3215
+ var uncurryThis$9 = functionUncurryThis;
3182
3216
  var notARegExp = notARegexp;
3183
- var requireObjectCoercible$2 = requireObjectCoercible$8;
3184
- var toString$5 = toString$b;
3217
+ var requireObjectCoercible$3 = requireObjectCoercible$9;
3218
+ var toString$6 = toString$c;
3185
3219
  var correctIsRegExpLogic = correctIsRegexpLogic;
3186
3220
 
3187
- var stringIndexOf = uncurryThis$8(''.indexOf);
3221
+ var stringIndexOf$1 = uncurryThis$9(''.indexOf);
3188
3222
 
3189
3223
  // `String.prototype.includes` method
3190
3224
  // https://tc39.es/ecma262/#sec-string.prototype.includes
3191
- $$c({ target: 'String', proto: true, forced: !correctIsRegExpLogic('includes') }, {
3225
+ $$d({ target: 'String', proto: true, forced: !correctIsRegExpLogic('includes') }, {
3192
3226
  includes: function includes(searchString /* , position = 0 */) {
3193
- return !!~stringIndexOf(
3194
- toString$5(requireObjectCoercible$2(this)),
3195
- toString$5(notARegExp(searchString)),
3227
+ return !!~stringIndexOf$1(
3228
+ toString$6(requireObjectCoercible$3(this)),
3229
+ toString$6(notARegExp(searchString)),
3196
3230
  arguments.length > 1 ? arguments[1] : undefined
3197
3231
  );
3198
3232
  }
@@ -3511,6 +3545,16 @@ const CheckboxInput = _a => {
3511
3545
  };
3512
3546
 
3513
3547
  const getOverrideStyles = theme => ({
3548
+ "&& .react-datepicker__aria-live": {
3549
+ // Hide aria alerts that are for screen readers in a way screen readers can still read them
3550
+ clip: "rect(0 0 0 0)",
3551
+ clipPath: "inset(50%)",
3552
+ height: "1px",
3553
+ overflow: "hidden",
3554
+ position: "absolute",
3555
+ whiteSpace: "nowrap",
3556
+ width: "1px"
3557
+ },
3514
3558
  "&& input, && span[role='button']": {
3515
3559
  cursor: "auto",
3516
3560
  fontWeight: theme.typography.fontWeight.normal
@@ -3558,6 +3602,130 @@ const CreditCardInput = fieldProps => jsx(CreditCardInputController, Object.assi
3558
3602
  }
3559
3603
  }));
3560
3604
 
3605
+ var call$9 = functionCall;
3606
+ var hasOwn$2 = hasOwnProperty_1;
3607
+ var isPrototypeOf$3 = objectIsPrototypeOf;
3608
+ var regExpFlags = regexpFlags$1;
3609
+
3610
+ var RegExpPrototype$1 = RegExp.prototype;
3611
+
3612
+ var regexpGetFlags = function (R) {
3613
+ var flags = R.flags;
3614
+ return flags === undefined && !('flags' in RegExpPrototype$1) && !hasOwn$2(R, 'flags') && isPrototypeOf$3(RegExpPrototype$1, R)
3615
+ ? call$9(regExpFlags, R) : flags;
3616
+ };
3617
+
3618
+ var $$c = _export;
3619
+ var call$8 = functionCall;
3620
+ var uncurryThis$8 = functionUncurryThis;
3621
+ var requireObjectCoercible$2 = requireObjectCoercible$9;
3622
+ var isCallable$6 = isCallable$o;
3623
+ var isNullOrUndefined$3 = isNullOrUndefined$7;
3624
+ var isRegExp = isRegexp;
3625
+ var toString$5 = toString$c;
3626
+ var getMethod$3 = getMethod$6;
3627
+ var getRegExpFlags$1 = regexpGetFlags;
3628
+ var getSubstitution = getSubstitution$2;
3629
+ var wellKnownSymbol$7 = wellKnownSymbol$k;
3630
+
3631
+ var REPLACE = wellKnownSymbol$7('replace');
3632
+ var $TypeError$7 = TypeError;
3633
+ var indexOf = uncurryThis$8(''.indexOf);
3634
+ uncurryThis$8(''.replace);
3635
+ var stringSlice$2 = uncurryThis$8(''.slice);
3636
+ var max = Math.max;
3637
+
3638
+ var stringIndexOf = function (string, searchValue, fromIndex) {
3639
+ if (fromIndex > string.length) return -1;
3640
+ if (searchValue === '') return fromIndex;
3641
+ return indexOf(string, searchValue, fromIndex);
3642
+ };
3643
+
3644
+ // `String.prototype.replaceAll` method
3645
+ // https://tc39.es/ecma262/#sec-string.prototype.replaceall
3646
+ $$c({ target: 'String', proto: true }, {
3647
+ replaceAll: function replaceAll(searchValue, replaceValue) {
3648
+ var O = requireObjectCoercible$2(this);
3649
+ var IS_REG_EXP, flags, replacer, string, searchString, functionalReplace, searchLength, advanceBy, replacement;
3650
+ var position = 0;
3651
+ var endOfLastMatch = 0;
3652
+ var result = '';
3653
+ if (!isNullOrUndefined$3(searchValue)) {
3654
+ IS_REG_EXP = isRegExp(searchValue);
3655
+ if (IS_REG_EXP) {
3656
+ flags = toString$5(requireObjectCoercible$2(getRegExpFlags$1(searchValue)));
3657
+ if (!~indexOf(flags, 'g')) throw $TypeError$7('`.replaceAll` does not allow non-global regexes');
3658
+ }
3659
+ replacer = getMethod$3(searchValue, REPLACE);
3660
+ if (replacer) {
3661
+ return call$8(replacer, searchValue, O, replaceValue);
3662
+ }
3663
+ }
3664
+ string = toString$5(O);
3665
+ searchString = toString$5(searchValue);
3666
+ functionalReplace = isCallable$6(replaceValue);
3667
+ if (!functionalReplace) replaceValue = toString$5(replaceValue);
3668
+ searchLength = searchString.length;
3669
+ advanceBy = max(1, searchLength);
3670
+ position = stringIndexOf(string, searchString, 0);
3671
+ while (position !== -1) {
3672
+ replacement = functionalReplace
3673
+ ? toString$5(replaceValue(searchString, position, string))
3674
+ : getSubstitution(searchString, string, position, [], undefined, replaceValue);
3675
+ result += stringSlice$2(string, endOfLastMatch, position) + replacement;
3676
+ endOfLastMatch = position + searchLength;
3677
+ position = stringIndexOf(string, searchString, position + advanceBy);
3678
+ }
3679
+ if (endOfLastMatch < string.length) {
3680
+ result += stringSlice$2(string, endOfLastMatch);
3681
+ }
3682
+ return result;
3683
+ }
3684
+ });
3685
+
3686
+ let _LOCALE = navigator.language;
3687
+ const loadableLocale = _LOCALE.replaceAll("-", "");
3688
+ const loadableBackupLocale = _LOCALE.split("-")[0];
3689
+ let intlLocale = undefined;
3690
+ if (loadableLocale in Locales || loadableBackupLocale) {
3691
+ const targetLocale = loadableLocale in Locales ? loadableLocale : loadableBackupLocale;
3692
+ const l = Locales[targetLocale];
3693
+ registerLocale(_LOCALE, l);
3694
+ intlLocale = l;
3695
+ setDefaultLocale(_LOCALE);
3696
+ } else {
3697
+ // Really should never happen but this SHOULD revert to un-localized
3698
+ console.log(`User's navigator.language locale ${_LOCALE} could not be loaded because it was not found in date-fns.
3699
+ Backup attempt to load ${loadableBackupLocale} failed as well.
3700
+ Reverting to en-US.`);
3701
+ _LOCALE = "en-US";
3702
+ }
3703
+ const usaLocale = Locales["enUS"];
3704
+ const LOCALE = _LOCALE;
3705
+ /**
3706
+ * Parse a string in the CURRENT locale into a Date object.
3707
+ * current locale is determined by navigator.language for now
3708
+ * @param dateString
3709
+ */
3710
+ const parseLocaleDate = dateString => dateString ? parse(dateString, "P", new Date(), intlLocale ? {
3711
+ locale: intlLocale
3712
+ } : undefined) : null;
3713
+ const parseUSADate = dateString => dateString ? parse(dateString, "P", new Date(), {
3714
+ locale: usaLocale
3715
+ }) : null;
3716
+ /**
3717
+ *
3718
+ * Format a date into a string in the CURRENT locale.
3719
+ * current locale is determined by navigator.language for now
3720
+ * @param date
3721
+ */
3722
+ const formatLocaleDate = date => date ? format(date, "P", {
3723
+ locale: intlLocale
3724
+ }) : null;
3725
+ const formatUSADate = date => date ? format(date, "P", {
3726
+ locale: usaLocale
3727
+ }) : null;
3728
+
3561
3729
  function _EMOTION_STRINGIFIED_CSS_ERROR__$4() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; }
3562
3730
  const getPopperStyles = theme => /*#__PURE__*/css("padding-top:10px;z-index:10;.react-datepicker{background-color:", theme.palette.white, ";border-radius:0.25rem;box-shadow:", theme.getElevation("above").boxShadow, ";display:inline-block;font-size:1rem;position:relative;&__month-container{float:left;}&__header{border-top-left-radius:", theme.borderRadius.M, ";border-top-right-radius:", theme.borderRadius.M, ";padding:", theme.spacing(2), "px 0 ", theme.spacing(1), "px 0;position:relative;text-align:center;}&__current-month{color:", theme.palette.black, ";font-size:1rem;font-weight:600;line-height:1.25rem;margin-bottom:", theme.spacing(2), "px;}&__navigation{align-items:center;background:none;border:none;cursor:pointer;display:flex;height:32px;justify-content:center;overflow:hidden;position:absolute;text-align:center;text-indent:-999em;top:0.688rem;width:32px;z-index:1;&--previous{left:1rem;}&--next{right:1rem;}&:hover *::before{border-color:", theme.palette.gray.light, ";}&-icon{position:relative;top:-0.125rem;width:0;&::before{border-color:", theme.palette.gray.main, ";border-style:solid;border-width:2.5px 2.5px 0 0;content:\"\";display:block;height:6px;position:absolute;top:6px;width:6px;}&--previous{right:0rem;&::before{right:-0.438rem;transform:rotate(225deg);}}&--next{left:0rem;&::before{left:-0.438rem;transform:rotate(45deg);}}}} &__month{padding:0 1rem 1rem 1rem;text-align:center;}&__week{white-space:nowrap;} &__day{color:", theme.palette.black, ";cursor:pointer;display:inline-block;font-size:1rem;line-height:2rem;margin:0.25rem;text-align:center;width:2rem;&:hover[aria-selected=\"false\"]:not(&--disabled){background-color:", theme.palette.gray.ultraLight, ";border-radius:0.25rem;}&-name{color:", theme.palette.gray.main, ";display:inline-block;font-size:0.75rem;font-weight:600;line-height:1rem;margin:0 0.25rem;text-align:center;width:2rem;}&-names{white-space:nowrap;}&--disabled{color:", theme.palette.gray.main, ";cursor:default;&:hover{background-color:transparent;}}&--today[aria-selected=\"false\"]{position:relative;&::before{border-bottom:0.125rem solid ", theme.palette.primary.main, ";content:\"\";display:block;inset:0;position:absolute;}}&--highlighted{background-color:#3dcc4a;border-radius:0.25rem;color:#fff;&:hover{background-color:", theme.palette.secondary.main, ";}&-custom-1{color:magenta;}&-custom-2{color:green;}}&--selected,&--in-selecting-range,&--in-range{background-color:", theme.palette.primary.main, ";border-radius:0.25rem;color:#fff;&[aria-selected=\"true\"]{cursor:default;}&[aria-selected=\"false\"]:hover{background-color:", theme.palette.primary.dark, ";}}&--in-selecting-range:not(&--in-range){background-color:rgba(33, 107, 165, 0.5);}&--keyboard-selected{border-radius:0.25rem;outline:0.125rem solid ", theme.palette.primary.main, ";} &--selected:not(&--keyboard-selected):focus-visible{outline:0.125rem solid ", theme.palette.primary.main, ";}} &__input-container{display:inline-block;position:relative;width:100%;}}" + (process.env.NODE_ENV === "production" ? "" : ";label:getPopperStyles;"), process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImRhdGUtcGlja2VyLnN0eWxlcy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFDOEMiLCJmaWxlIjoiZGF0ZS1waWNrZXIuc3R5bGVzLnRzIiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHsgY3NzIH0gZnJvbSBcIkBlbW90aW9uL2Nzc1wiO1xyXG5leHBvcnQgY29uc3QgZ2V0UG9wcGVyU3R5bGVzID0gKHRoZW1lKSA9PiBjc3MgYFxuICBwYWRkaW5nLXRvcDogMTBweDtcbiAgei1pbmRleDogMTA7XG4gIC5yZWFjdC1kYXRlcGlja2VyIHtcbiAgICBiYWNrZ3JvdW5kLWNvbG9yOiAke3RoZW1lLnBhbGV0dGUud2hpdGV9O1xuICAgIGJvcmRlci1yYWRpdXM6IDAuMjVyZW07XG4gICAgYm94LXNoYWRvdzogJHt0aGVtZS5nZXRFbGV2YXRpb24oXCJhYm92ZVwiKS5ib3hTaGFkb3d9O1xuICAgIGRpc3BsYXk6IGlubGluZS1ibG9jaztcbiAgICBmb250LXNpemU6IDFyZW07XG4gICAgcG9zaXRpb246IHJlbGF0aXZlO1xuICAgICZfX21vbnRoLWNvbnRhaW5lciB7XG4gICAgICBmbG9hdDogbGVmdDtcbiAgICB9XG4gICAgJl9faGVhZGVyIHtcbiAgICAgIGJvcmRlci10b3AtbGVmdC1yYWRpdXM6ICR7dGhlbWUuYm9yZGVyUmFkaXVzLk19O1xuICAgICAgYm9yZGVyLXRvcC1yaWdodC1yYWRpdXM6ICR7dGhlbWUuYm9yZGVyUmFkaXVzLk19O1xuICAgICAgcGFkZGluZzogJHt0aGVtZS5zcGFjaW5nKDIpfXB4IDAgJHt0aGVtZS5zcGFjaW5nKDEpfXB4IDA7XG4gICAgICBwb3NpdGlvbjogcmVsYXRpdmU7XG4gICAgICB0ZXh0LWFsaWduOiBjZW50ZXI7XG4gICAgfVxuICAgICZfX2N1cnJlbnQtbW9udGgge1xuICAgICAgY29sb3I6ICR7dGhlbWUucGFsZXR0ZS5ibGFja307XG4gICAgICBmb250LXNpemU6IDFyZW07XG4gICAgICBmb250LXdlaWdodDogNjAwO1xuICAgICAgbGluZS1oZWlnaHQ6IDEuMjVyZW07XG4gICAgICBtYXJnaW4tYm90dG9tOiAke3RoZW1lLnNwYWNpbmcoMil9cHg7XG4gICAgfVxuICAgICZfX25hdmlnYXRpb24ge1xuICAgICAgYWxpZ24taXRlbXM6IGNlbnRlcjtcbiAgICAgIGJhY2tncm91bmQ6IG5vbmU7XG4gICAgICBib3JkZXI6IG5vbmU7XG4gICAgICBjdXJzb3I6IHBvaW50ZXI7XG4gICAgICBkaXNwbGF5OiBmbGV4O1xuICAgICAgaGVpZ2h0OiAzMnB4O1xuICAgICAganVzdGlmeS1jb250ZW50OiBjZW50ZXI7XG4gICAgICBvdmVyZmxvdzogaGlkZGVuO1xuICAgICAgcG9zaXRpb246IGFic29sdXRlO1xuICAgICAgdGV4dC1hbGlnbjogY2VudGVyO1xuICAgICAgdGV4dC1pbmRlbnQ6IC05OTllbTtcbiAgICAgIHRvcDogMC42ODhyZW07XG4gICAgICB3aWR0aDogMzJweDtcbiAgICAgIHotaW5kZXg6IDE7XG4gICAgICAmLS1wcmV2aW91cyB7XG4gICAgICAgIGxlZnQ6IDFyZW07XG4gICAgICB9XG4gICAgICAmLS1uZXh0IHtcbiAgICAgICAgcmlnaHQ6IDFyZW07XG4gICAgICB9XG4gICAgICAmOmhvdmVyICo6OmJlZm9yZSB7XG4gICAgICAgIGJvcmRlci1jb2xvcjogJHt0aGVtZS5wYWxldHRlLmdyYXkubGlnaHR9O1xuICAgICAgfVxuICAgICAgJi1pY29uIHtcbiAgICAgICAgcG9zaXRpb246IHJlbGF0aXZlO1xuICAgICAgICB0b3A6IC0wLjEyNXJlbTtcbiAgICAgICAgd2lkdGg6IDA7XG4gICAgICAgICY6OmJlZm9yZSB7XG4gICAgICAgICAgYm9yZGVyLWNvbG9yOiAke3RoZW1lLnBhbGV0dGUuZ3JheS5tYWlufTtcbiAgICAgICAgICBib3JkZXItc3R5bGU6IHNvbGlkO1xuICAgICAgICAgIGJvcmRlci13aWR0aDogMi41cHggMi41cHggMCAwO1xuICAgICAgICAgIGNvbnRlbnQ6IFwiXCI7XG4gICAgICAgICAgZGlzcGxheTogYmxvY2s7XG4gICAgICAgICAgaGVpZ2h0OiA2cHg7XG4gICAgICAgICAgcG9zaXRpb246IGFic29sdXRlO1xuICAgICAgICAgIHRvcDogNnB4O1xuICAgICAgICAgIHdpZHRoOiA2cHg7XG4gICAgICAgIH1cbiAgICAgICAgJi0tcHJldmlvdXMge1xuICAgICAgICAgIHJpZ2h0OiAwcmVtO1xuICAgICAgICAgICY6OmJlZm9yZSB7XG4gICAgICAgICAgICByaWdodDogLTAuNDM4cmVtO1xuICAgICAgICAgICAgdHJhbnNmb3JtOiByb3RhdGUoMjI1ZGVnKTtcbiAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgJi0tbmV4dCB7XG4gICAgICAgICAgbGVmdDogMHJlbTtcbiAgICAgICAgICAmOjpiZWZvcmUge1xuICAgICAgICAgICAgbGVmdDogLTAuNDM4cmVtO1xuICAgICAgICAgICAgdHJhbnNmb3JtOiByb3RhdGUoNDVkZWcpO1xuICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgfVxuICAgIH1cbiAgICAkeyAvKiAjZW5kcmVnaW9uICovXCJcIn1cbiAgICAmX19tb250aCB7XG4gICAgICBwYWRkaW5nOiAwIDFyZW0gMXJlbSAxcmVtO1xuICAgICAgdGV4dC1hbGlnbjogY2VudGVyO1xuICAgIH1cbiAgICAmX193ZWVrIHtcbiAgICAgIHdoaXRlLXNwYWNlOiBub3dyYXA7XG4gICAgfVxuICAgICR7IC8qICNyZWdpb24gWyByZ2JhKDEyMCw1MCwxNTAsMC4xKSBdIERheXMgKi9cIlwifVxuICAgICZfX2RheSB7XG4gICAgICBjb2xvcjogJHt0aGVtZS5wYWxldHRlLmJsYWNrfTtcbiAgICAgIGN1cnNvcjogcG9pbnRlcjtcbiAgICAgIGRpc3BsYXk6IGlubGluZS1ibG9jaztcbiAgICAgIGZvbnQtc2l6ZTogMXJlbTtcbiAgICAgIGxpbmUtaGVpZ2h0OiAycmVtO1xuICAgICAgbWFyZ2luOiAwLjI1cmVtO1xuICAgICAgdGV4dC1hbGlnbjogY2VudGVyO1xuICAgICAgd2lkdGg6IDJyZW07XG4gICAgICAmOmhvdmVyW2FyaWEtc2VsZWN0ZWQ9XCJmYWxzZVwiXTpub3QoJi0tZGlzYWJsZWQpIHtcbiAgICAgICAgYmFja2dyb3VuZC1jb2xvcjogJHt0aGVtZS5wYWxldHRlLmdyYXkudWx0cmFMaWdodH07XG4gICAgICAgIGJvcmRlci1yYWRpdXM6IDAuMjVyZW07XG4gICAgICB9XG4gICAgICAmLW5hbWUge1xuICAgICAgICBjb2xvcjogJHt0aGVtZS5wYWxldHRlLmdyYXkubWFpbn07XG4gICAgICAgIGRpc3BsYXk6IGlubGluZS1ibG9jaztcbiAgICAgICAgZm9udC1zaXplOiAwLjc1cmVtO1xuICAgICAgICBmb250LXdlaWdodDogNjAwO1xuICAgICAgICBsaW5lLWhlaWdodDogMXJlbTtcbiAgICAgICAgbWFyZ2luOiAwIDAuMjVyZW07XG4gICAgICAgIHRleHQtYWxpZ246IGNlbnRlcjtcbiAgICAgICAgd2lkdGg6IDJyZW07XG4gICAgICB9XG4gICAgICAmLW5hbWVzIHtcbiAgICAgICAgd2hpdGUtc3BhY2U6IG5vd3JhcDtcbiAgICAgIH1cbiAgICAgICYtLWRpc2FibGVkIHtcbiAgICAgICAgY29sb3I6ICR7dGhlbWUucGFsZXR0ZS5ncmF5Lm1haW59O1xuICAgICAgICBjdXJzb3I6IGRlZmF1bHQ7XG4gICAgICAgICY6aG92ZXIge1xuICAgICAgICAgIGJhY2tncm91bmQtY29sb3I6IHRyYW5zcGFyZW50O1xuICAgICAgICB9XG4gICAgICB9XG4gICAgICAmLS10b2RheVthcmlhLXNlbGVjdGVkPVwiZmFsc2VcIl0ge1xuICAgICAgICBwb3NpdGlvbjogcmVsYXRpdmU7XG4gICAgICAgICY6OmJlZm9yZSB7XG4gICAgICAgICAgYm9yZGVyLWJvdHRvbTogMC4xMjVyZW0gc29saWQgJHt0aGVtZS5wYWxldHRlLnByaW1hcnkubWFpbn07XG4gICAgICAgICAgY29udGVudDogXCJcIjtcbiAgICAgICAgICBkaXNwbGF5OiBibG9jaztcbiAgICAgICAgICBpbnNldDogMDtcbiAgICAgICAgICBwb3NpdGlvbjogYWJzb2x1dGU7XG4gICAgICAgIH1cbiAgICAgIH1cbiAgICAgICYtLWhpZ2hsaWdodGVkIHtcbiAgICAgICAgYmFja2dyb3VuZC1jb2xvcjogIzNkY2M0YTtcbiAgICAgICAgYm9yZGVyLXJhZGl1czogMC4yNXJlbTtcbiAgICAgICAgY29sb3I6ICNmZmY7XG4gICAgICAgICY6aG92ZXIge1xuICAgICAgICAgIGJhY2tncm91bmQtY29sb3I6ICR7dGhlbWUucGFsZXR0ZS5zZWNvbmRhcnkubWFpbn07XG4gICAgICAgIH1cbiAgICAgICAgJi1jdXN0b20tMSB7XG4gICAgICAgICAgY29sb3I6IG1hZ2VudGE7XG4gICAgICAgIH1cbiAgICAgICAgJi1jdXN0b20tMiB7XG4gICAgICAgICAgY29sb3I6IGdyZWVuO1xuICAgICAgICB9XG4gICAgICB9XG4gICAgICAmLS1zZWxlY3RlZCxcbiAgICAgICYtLWluLXNlbGVjdGluZy1yYW5nZSxcbiAgICAgICYtLWluLXJhbmdlIHtcbiAgICAgICAgYmFja2dyb3VuZC1jb2xvcjogJHt0aGVtZS5wYWxldHRlLnByaW1hcnkubWFpbn07XG4gICAgICAgIGJvcmRlci1yYWRpdXM6IDAuMjVyZW07XG4gICAgICAgIGNvbG9yOiAjZmZmO1xuICAgICAgICAmW2FyaWEtc2VsZWN0ZWQ9XCJ0cnVlXCJdIHtcbiAgICAgICAgICBjdXJzb3I6IGRlZmF1bHQ7XG4gICAgICAgIH1cbiAgICAgICAgJlthcmlhLXNlbGVjdGVkPVwiZmFsc2VcIl06aG92ZXIge1xuICAgICAgICAgIGJhY2tncm91bmQtY29sb3I6ICR7dGhlbWUucGFsZXR0ZS5wcmltYXJ5LmRhcmt9O1xuICAgICAgICB9XG4gICAgICB9XG4gICAgICAmLS1pbi1zZWxlY3RpbmctcmFuZ2U6bm90KCYtLWluLXJhbmdlKSB7XG4gICAgICAgIGJhY2tncm91bmQtY29sb3I6IHJnYmEoMzMsIDEwNywgMTY1LCAwLjUpO1xuICAgICAgfVxuICAgICAgJi0ta2V5Ym9hcmQtc2VsZWN0ZWQge1xuICAgICAgICBib3JkZXItcmFkaXVzOiAwLjI1cmVtO1xuICAgICAgICBvdXRsaW5lOiAwLjEyNXJlbSBzb2xpZCAke3RoZW1lLnBhbGV0dGUucHJpbWFyeS5tYWlufTtcbiAgICAgIH1cbiAgICAgICR7XHJcbi8qIFJEUCBkb2Vzbid0IGF0dGFjaCB0aGUgLS1rZXlib2FyZC1zZWxlY3RlZCBjbGFzcyBpZiB5b3UgYXJyb3ctbmF2aWdhdGUgdG8gdGhlIGN1cnJlbnRseVxyXG4gICAgIHNlbGVjdGVkIGRhdGUsIHdoaWNoIHdvdWxkIHJlc3VsdCBpbiBhIGRlZmF1bHQgYnJvd3NlciBmb2N1cy1yaW5nICovIFwiXCJ9XG4gICAgICAmLS1zZWxlY3RlZDpub3QoJi0ta2V5Ym9hcmQtc2VsZWN0ZWQpOmZvY3VzLXZpc2libGUge1xuICAgICAgICBvdXRsaW5lOiAwLjEyNXJlbSBzb2xpZCAke3RoZW1lLnBhbGV0dGUucHJpbWFyeS5tYWlufTtcbiAgICAgIH1cbiAgICB9XG4gICAgJHsgLyogI2VuZHJlZ2lvbiAqL1wiXCJ9XG4gICAgJl9faW5wdXQtY29udGFpbmVyIHtcbiAgICAgIGRpc3BsYXk6IGlubGluZS1ibG9jaztcbiAgICAgIHBvc2l0aW9uOiByZWxhdGl2ZTtcbiAgICAgIHdpZHRoOiAxMDAlO1xuICAgIH1cbiAgfVxuYDtcclxuZXhwb3J0IGNvbnN0IGdldFdyYXBwZXJTdHlsZXMgPSAodGhlbWUpID0+IGNzcyBgXG4gIGJvcmRlcjogMDtcbiAgZGlzcGxheTogaW5saW5lLWJsb2NrO1xuICBwYWRkaW5nOiAwO1xuICB3aWR0aDogMTAwJTtcbiAgei1pbmRleDogMjAwO1xuYDtcclxuLy8jIHNvdXJjZU1hcHBpbmdVUkw9ZGF0ZS1waWNrZXIuc3R5bGVzLmpzLm1hcCJdfQ== */");
3563
3731
  const getWrapperStyles = theme => /*#__PURE__*/css(process.env.NODE_ENV === "production" ? {
@@ -3576,28 +3744,43 @@ const DatePicker = fieldProps => {
3576
3744
  const datePickerRef = useRef(null);
3577
3745
  return jsx(DatePickerController, Object.assign({}, fieldProps, {
3578
3746
  children: _a => {
3579
- var {
3580
- ref
3581
- } = _a,
3582
- datePickerProps = __rest(_a, ["ref"]);
3747
+ var _datePickerProps = __rest(_a, ["ref"]);
3748
+ // Lens the form's usa date string into a locale date string
3749
+ // for the now localized date picker
3750
+ const onChange = date => {
3751
+ var _a;
3752
+ (_a = _datePickerProps.onChange) === null || _a === void 0 ? void 0 : _a.call(_datePickerProps, formatUSADate(parseLocaleDate(date)));
3753
+ };
3754
+ const value = formatLocaleDate(parseUSADate(_datePickerProps.value));
3755
+ const datePickerProps = Object.assign(Object.assign({}, _datePickerProps), {
3756
+ onChange,
3757
+ value
3758
+ });
3583
3759
  return jsx("div", Object.assign({
3584
- css: getOverrideStyles
3760
+ css: getOverrideStyles(theme)
3585
3761
  }, {
3586
- children: jsx(ReactDatePicker, Object.assign({}, datePickerProps, {
3587
- customInput: /*#__PURE__*/createElement$2(function InputWrapper(_a) {
3762
+ children: jsx(ReactDatePicker, Object.assign({
3763
+ locale: LOCALE
3764
+ }, datePickerProps, {
3765
+ customInput: /*#__PURE__*/createElement$2( /*#__PURE__*/forwardRef(function InputWrapper(_a, forwardedRef) {
3588
3766
  var _b;
3589
3767
  var {
3590
3768
  value
3591
3769
  } = _a,
3592
- props = __rest(_a, ["value"]);
3593
- const innerRef = useRef(null);
3594
- const refInterceptor = useCallback(node => {
3595
- ref(node);
3596
- innerRef.current = node;
3597
- }, []);
3598
- const isFocused = (_b = innerRef === null || innerRef === void 0 ? void 0 : innerRef.current) === null || _b === void 0 ? void 0 : _b.contains(document.activeElement);
3599
- return jsx(Input, Object.assign({}, props, {
3600
- ref: refInterceptor,
3770
+ inputProps = __rest(_a, ["value"]);
3771
+ if (typeof forwardedRef !== "function") throw new Error("DatePicker requires a callback-ref and should always be passing one (this should never happen)");
3772
+ // The forwarded ref that RDP supplies is a callback ref; we need a *mutable* ref in order to check if the DOM element is focused
3773
+ const mutableRef = useRef(null);
3774
+ // We wrap RDP's forwarded ref in order to setup our own mutable ref
3775
+ const callbackRef = useCallback(node => {
3776
+ // Invoke RDP's forwarded ref
3777
+ forwardedRef(node);
3778
+ // Setup our mutable ref
3779
+ if (node) mutableRef.current = node;
3780
+ }, [forwardedRef]);
3781
+ const isFocused = (_b = mutableRef.current) === null || _b === void 0 ? void 0 : _b.contains(document.activeElement);
3782
+ return jsx(Input, Object.assign({}, inputProps, {
3783
+ ref: callbackRef,
3601
3784
  rightContent: jsx(Icon
3602
3785
  // Internally, RDP applies this class to the Input, but the Icon is absolute / in its own context
3603
3786
  , {
@@ -3612,9 +3795,9 @@ const DatePicker = fieldProps => {
3612
3795
  return (_a = datePickerRef.current) === null || _a === void 0 ? void 0 : _a.setOpen(!datePickerRef.current.isCalendarOpen());
3613
3796
  }
3614
3797
  }),
3615
- value: isFocused || value !== new Date().toLocaleDateString("en-US") ? value : datePickerProps.placeholderText
3798
+ value: isFocused || value !== formatLocaleDate(new Date()) ? value : datePickerProps.placeholderText
3616
3799
  }));
3617
- }),
3800
+ })),
3618
3801
  "data-testid": fieldProps.name ? camelize(fieldProps.name) : "date",
3619
3802
  onCalendarOpen: () => {
3620
3803
  var _a;
@@ -3623,13 +3806,13 @@ const DatePicker = fieldProps => {
3623
3806
  onChange: (date, event) => {
3624
3807
  var _a;
3625
3808
  event === null || event === void 0 ? void 0 : event.preventDefault();
3626
- (_a = datePickerProps.onChange) === null || _a === void 0 ? void 0 : _a.call(datePickerProps, date ? date.toLocaleDateString("en-US") : null);
3809
+ (_a = datePickerProps.onChange) === null || _a === void 0 ? void 0 : _a.call(datePickerProps, date ? formatLocaleDate(date) : null);
3627
3810
  },
3628
3811
  popperClassName: getPopperStyles(theme),
3629
3812
  popperPlacement: "bottom-end",
3630
3813
  preventOpenOnFocus: true,
3631
3814
  ref: datePickerRef,
3632
- selected: datePickerProps.value ? new Date(datePickerProps.value) : null,
3815
+ selected: parseLocaleDate(datePickerProps.value),
3633
3816
  showPopperArrow: false,
3634
3817
  wrapperClassName: getWrapperStyles()
3635
3818
  }))
@@ -3739,7 +3922,7 @@ var flattenIntoArray_1 = flattenIntoArray$1;
3739
3922
 
3740
3923
  var uncurryThis$6 = functionUncurryThis;
3741
3924
  var fails$5 = fails$q;
3742
- var isCallable$5 = isCallable$n;
3925
+ var isCallable$5 = isCallable$o;
3743
3926
  var classof$1 = classof$6;
3744
3927
  var getBuiltIn$3 = getBuiltIn$8;
3745
3928
  var inspectSource$1 = inspectSource$3;
@@ -3793,7 +3976,7 @@ var isConstructor$2 = !construct || fails$5(function () {
3793
3976
  var isArray = isArray$2;
3794
3977
  var isConstructor$1 = isConstructor$2;
3795
3978
  var isObject$2 = isObject$a;
3796
- var wellKnownSymbol$6 = wellKnownSymbol$j;
3979
+ var wellKnownSymbol$6 = wellKnownSymbol$k;
3797
3980
 
3798
3981
  var SPECIES$3 = wellKnownSymbol$6('species');
3799
3982
  var $Array = Array;
@@ -3974,8 +4157,8 @@ var uncurryThis$5 = functionUncurryThis;
3974
4157
  var thisNumberValue$1 = uncurryThis$5(1.0.valueOf);
3975
4158
 
3976
4159
  var toIntegerOrInfinity$1 = toIntegerOrInfinity$6;
3977
- var toString$4 = toString$b;
3978
- var requireObjectCoercible$1 = requireObjectCoercible$8;
4160
+ var toString$4 = toString$c;
4161
+ var requireObjectCoercible$1 = requireObjectCoercible$9;
3979
4162
 
3980
4163
  var $RangeError$1 = RangeError;
3981
4164
 
@@ -4124,7 +4307,7 @@ $$a({ target: 'Number', proto: true, forced: FORCED$2 }, {
4124
4307
  var global$a = global$p;
4125
4308
  var fails$3 = fails$q;
4126
4309
  var uncurryThis$3 = functionUncurryThis;
4127
- var toString$3 = toString$b;
4310
+ var toString$3 = toString$c;
4128
4311
  var trim$1 = stringTrim.trim;
4129
4312
  var whitespaces$1 = whitespaces$4;
4130
4313
 
@@ -4284,7 +4467,7 @@ const MoneyInput = _a => {
4284
4467
  var global$9 = global$p;
4285
4468
  var fails$2 = fails$q;
4286
4469
  var uncurryThis$2 = functionUncurryThis;
4287
- var toString$2 = toString$b;
4470
+ var toString$2 = toString$c;
4288
4471
  var trim = stringTrim.trim;
4289
4472
  var whitespaces = whitespaces$4;
4290
4473
 
@@ -4357,23 +4540,10 @@ const NumberInput = _a => {
4357
4540
  }));
4358
4541
  };
4359
4542
 
4360
- var call$8 = functionCall;
4361
- var hasOwn$2 = hasOwnProperty_1;
4362
- var isPrototypeOf$3 = objectIsPrototypeOf;
4363
- var regExpFlags = regexpFlags$1;
4364
-
4365
- var RegExpPrototype$1 = RegExp.prototype;
4366
-
4367
- var regexpGetFlags = function (R) {
4368
- var flags = R.flags;
4369
- return flags === undefined && !('flags' in RegExpPrototype$1) && !hasOwn$2(R, 'flags') && isPrototypeOf$3(RegExpPrototype$1, R)
4370
- ? call$8(regExpFlags, R) : flags;
4371
- };
4372
-
4373
4543
  var PROPER_FUNCTION_NAME = functionName.PROPER;
4374
4544
  var defineBuiltIn$2 = defineBuiltIn$7;
4375
4545
  var anObject$6 = anObject$f;
4376
- var $toString = toString$b;
4546
+ var $toString = toString$c;
4377
4547
  var fails$1 = fails$q;
4378
4548
  var getRegExpFlags = regexpGetFlags;
4379
4549
 
@@ -4619,7 +4789,7 @@ const getDeliveryDaysLabel = deliveryDays => {
4619
4789
  }
4620
4790
  return `${deliveryDays.toString()} ${deliveryDays === 1 ? "day" : "days"}`;
4621
4791
  };
4622
- const getAcknowledgementLabel = serviceCode => {
4792
+ const getAcknowledgementLabel = (serviceCode, packageType) => {
4623
4793
  switch (serviceCode) {
4624
4794
  case "usps_media_mail":
4625
4795
  return jsxs(Trans, Object.assign({
@@ -4634,6 +4804,13 @@ const getAcknowledgementLabel = serviceCode => {
4634
4804
  children: "USPS guidelines for Media Mail®"
4635
4805
  }))]
4636
4806
  }));
4807
+ case "usps_first_class_mail":
4808
+ if (packageType === "large_envelope_or_flat") {
4809
+ return jsx(Trans, {
4810
+ i18nKey: "purchase-label:rates.uspsFirstClassMailAcknowledgement_leof"
4811
+ });
4812
+ }
4813
+ return;
4637
4814
  default:
4638
4815
  return null;
4639
4816
  }
@@ -4656,6 +4833,7 @@ const RateCard = ({
4656
4833
  requiresAcknowledgement,
4657
4834
  selected: _selected = false,
4658
4835
  serviceCode,
4836
+ packageType,
4659
4837
  serviceType,
4660
4838
  shippingAmount,
4661
4839
  taxAmount,
@@ -4728,7 +4906,11 @@ const RateCard = ({
4728
4906
  css: getFooterListItemStyles,
4729
4907
  variant: "body2"
4730
4908
  }, {
4731
- children: msg
4909
+ children: packageType === "large_envelope_or_flat" ? t(msg, {
4910
+ weight: 13
4911
+ }) : t(msg, {
4912
+ weight: 16
4913
+ })
4732
4914
  }), index + msg.length))
4733
4915
  })), requiresAcknowledgement && onClickAcknowledgement && jsx("div", Object.assign({
4734
4916
  css: getCheckboxWrapperStyles
@@ -4736,7 +4918,7 @@ const RateCard = ({
4736
4918
  children: jsx(Checkbox, {
4737
4919
  checked: isAcknowledged,
4738
4920
  css: getAcknowledgmentStyles,
4739
- label: getAcknowledgementLabel(serviceCode),
4921
+ label: getAcknowledgementLabel(serviceCode, packageType),
4740
4922
  onChange: e => onClickAcknowledgement(e.target.checked)
4741
4923
  })
4742
4924
  }))]
@@ -4855,7 +5037,7 @@ const Select = _a => {
4855
5037
  }, {
4856
5038
  children: jsx(Select$1, Object.assign({}, fieldProps, {
4857
5039
  showLabel: !!props.nativeLabel,
4858
- value: flatOptions === null || flatOptions === void 0 ? void 0 : flatOptions.find(option => _$2.isEqual(option.value, fieldProps.value))
5040
+ value: flatOptions === null || flatOptions === void 0 ? void 0 : flatOptions.find(option => _$3.isEqual(option.value, fieldProps.value))
4859
5041
  }, {
4860
5042
  children: options === null || options === void 0 ? void 0 : options.map((option, idx) => {
4861
5043
  if (isCategory(option)) {
@@ -4875,7 +5057,7 @@ const Select = _a => {
4875
5057
  onCategoryChange === null || onCategoryChange === void 0 ? void 0 : onCategoryChange(option.value);
4876
5058
  onChange === null || onChange === void 0 ? void 0 : onChange(value);
4877
5059
  },
4878
- selected: _$2.isEqual(value, fieldProps.value),
5060
+ selected: _$3.isEqual(value, fieldProps.value),
4879
5061
  showTick: true,
4880
5062
  value: stringifiedValue
4881
5063
  }, {
@@ -4892,7 +5074,7 @@ const Select = _a => {
4892
5074
  customOnChange === null || customOnChange === void 0 ? void 0 : customOnChange(option.value);
4893
5075
  onChange === null || onChange === void 0 ? void 0 : onChange(option.value);
4894
5076
  },
4895
- selected: _$2.isEqual(option.value, fieldProps.value),
5077
+ selected: _$3.isEqual(option.value, fieldProps.value),
4896
5078
  showTick: true,
4897
5079
  value: stringifiedValue
4898
5080
  }, {
@@ -5160,17 +5342,43 @@ const useInsuranceProviderOptions = (insuranceAccount, features) => {
5160
5342
  }), [t, insuranceAccount, features === null || features === void 0 ? void 0 : features.includeThirdPartyInsurance, features === null || features === void 0 ? void 0 : features.includeShipsuranceInsurance]);
5161
5343
  };
5162
5344
 
5163
- let _$1 = t => t,
5164
- _t$1,
5165
- _t2$1;
5345
+ const useShipmentMetadata = shipment => {
5346
+ const isInternational = useMemo(() => {
5347
+ return shipment ? getIsInternationalShipment(shipment) : false;
5348
+ }, [shipment]);
5349
+ const isPoBox = useMemo(() => (shipment === null || shipment === void 0 ? void 0 : shipment.shipTo) && isPoBoxAddress(shipment.shipTo), [shipment === null || shipment === void 0 ? void 0 : shipment.shipTo]);
5350
+ const isUnsupportedUpsCountry = useMemo(() => (shipment === null || shipment === void 0 ? void 0 : shipment.shipTo) && isUnsupportedByUps(shipment.shipTo), [shipment === null || shipment === void 0 ? void 0 : shipment.shipTo]);
5351
+ const isCustomsRequired = useMemo(() => {
5352
+ return shipment ? getIsCustomsRequiredForShipment(shipment) : false;
5353
+ }, [shipment]);
5354
+ const isContentDescriptionRequired = useMemo(() => {
5355
+ var _a;
5356
+ return shipment && ((_a = shipment.shipFrom) === null || _a === void 0 ? void 0 : _a.countryCode) === "MX" || (shipment === null || shipment === void 0 ? void 0 : shipment.shipTo.countryCode) === "MX";
5357
+ }, [shipment]);
5358
+ return {
5359
+ isContentDescriptionRequired,
5360
+ isCustomsRequired,
5361
+ isInternational,
5362
+ isPoBox,
5363
+ isUnsupportedUpsCountry
5364
+ };
5365
+ };
5366
+
5367
+ let _$2 = t => t,
5368
+ _t$2,
5369
+ _t2$2;
5166
5370
  const findGenericPackageFromCarriers = carriers => {
5167
5371
  const carrier = carriers.find(c => c.packages.some(p => p.packageCode === "package"));
5168
5372
  return carrier === null || carrier === void 0 ? void 0 : carrier.packages.find(p => p.packageCode === "package");
5169
5373
  };
5170
- const usePackageOptions = (carriers, customPackageTypes, poBox) => {
5374
+ const usePackageOptions = (carriers, customPackageTypes, shipment) => {
5171
5375
  const {
5172
5376
  t
5173
5377
  } = useTranslation("common");
5378
+ const {
5379
+ isPoBox,
5380
+ isUnsupportedUpsCountry
5381
+ } = useShipmentMetadata(shipment);
5174
5382
  return useMemo(() => {
5175
5383
  if (!carriers) return undefined;
5176
5384
  // Dictionary to lookup the uniqueness of each carrierCode
@@ -5179,7 +5387,7 @@ const usePackageOptions = (carriers, customPackageTypes, poBox) => {
5179
5387
  }));
5180
5388
  const genericPackage = findGenericPackageFromCarriers(carriers);
5181
5389
  const packageOptions = [...(genericPackage ? [{
5182
- label: t(_t$1 || (_t$1 = _$1`packageCategories.browseRates`)),
5390
+ label: t(_t$2 || (_t$2 = _$2`packageCategories.browseRates`)),
5183
5391
  options: [{
5184
5392
  label: t("packageCodes.package"),
5185
5393
  value: {
@@ -5187,7 +5395,7 @@ const usePackageOptions = (carriers, customPackageTypes, poBox) => {
5187
5395
  }
5188
5396
  }]
5189
5397
  }] : []), ...((customPackageTypes === null || customPackageTypes === void 0 ? void 0 : customPackageTypes.length) ? [{
5190
- label: t(_t2$1 || (_t2$1 = _$1`packageCategories.myCustomPackages`)),
5398
+ label: t(_t2$2 || (_t2$2 = _$2`packageCategories.myCustomPackages`)),
5191
5399
  options: customPackageTypes.sort((a, b) => a.name.localeCompare(b.name)).map(({
5192
5400
  dimensions,
5193
5401
  name,
@@ -5204,7 +5412,8 @@ const usePackageOptions = (carriers, customPackageTypes, poBox) => {
5204
5412
  return carriers.reduce((options, carrier) => {
5205
5413
  if (carrier.packages.length === 0) return options;
5206
5414
  // Filter out non-USPS packages for PO Box shipments
5207
- if (!isUspsCarrier(carrier.carrierCode) && poBox) return options;
5415
+ // Filter out UPS packages for unsupported countries
5416
+ if (!isUspsCarrier(carrier.carrierCode) && isPoBox || isUpsCarrier(carrier.carrierCode) && isUnsupportedUpsCountry) return options;
5208
5417
  return [...options, {
5209
5418
  // Check the uniqueness of the carrierCode, if unique default to friendlyName and if non-unique use nickname.
5210
5419
  label: isUniqueByCarrierCode[carrier.carrierCode] ? carrier.friendlyName : carrier.nickname,
@@ -5220,24 +5429,27 @@ const usePackageOptions = (carriers, customPackageTypes, poBox) => {
5220
5429
  value: carrier.carrierId
5221
5430
  }];
5222
5431
  }, packageOptions);
5223
- }, [carriers, customPackageTypes, poBox, t]);
5432
+ }, [carriers, customPackageTypes, isPoBox, isUnsupportedUpsCountry, t]);
5224
5433
  };
5225
5434
 
5226
5435
  const useRateOptions = (rates, carriers, shipment, enableGlobalPostFiltering) => {
5227
- const isInternationalShipment = useMemo(() => {
5228
- return shipment ? getIsInternationalShipment(shipment) : false;
5229
- }, [shipment]);
5230
- const isPoBoxShipment = useMemo(() => (shipment === null || shipment === void 0 ? void 0 : shipment.shipTo) && isPoBoxAddress(shipment.shipTo), [shipment === null || shipment === void 0 ? void 0 : shipment.shipTo]);
5231
5436
  const carriersById = useMemo(() => createDictionary(carriers, c => ({
5232
5437
  [c.carrierId]: c
5233
5438
  })), [carriers]);
5439
+ const {
5440
+ isInternational,
5441
+ isPoBox,
5442
+ isUnsupportedUpsCountry
5443
+ } = useShipmentMetadata(shipment);
5234
5444
  return useMemo(() => {
5235
5445
  return (rates !== null && rates !== void 0 ? rates : []).filter(r => {
5236
5446
  const carrier = carriersById[r.carrierId];
5237
5447
  const service = carrier === null || carrier === void 0 ? void 0 : carrier.services.find(s => s.serviceCode === r.serviceCode);
5238
- return (service === null || service === void 0 ? void 0 : service.domestic) === !isInternationalShipment && (!enableGlobalPostFiltering || !r.serviceCode.includes("globalpost_")) && (
5448
+ return (service === null || service === void 0 ? void 0 : service.domestic) === !isInternational && (!enableGlobalPostFiltering || !r.serviceCode.includes("globalpost_")) && (
5239
5449
  // Filter out non-USPS carriers for PO Box shipments
5240
- service && isUspsCarrier(service.carrierCode) || !isPoBoxShipment);
5450
+ service && isUspsCarrier(service.carrierCode) || !isPoBox) && (
5451
+ // Filter out UPS for unsupported countries
5452
+ service && !isUpsCarrier(service.carrierCode) || !isUnsupportedUpsCountry);
5241
5453
  }).sort((a, b) => getTotalRateAmount(a) - getTotalRateAmount(b)).map(r => {
5242
5454
  var _a, _b;
5243
5455
  const balance = (_a = carriersById[r.carrierId]) === null || _a === void 0 ? void 0 : _a.balance;
@@ -5245,26 +5457,33 @@ const useRateOptions = (rates, carriers, shipment, enableGlobalPostFiltering) =>
5245
5457
  return Object.assign(Object.assign({}, r), {
5246
5458
  balance,
5247
5459
  messages: r.warningMessages,
5248
- requiresAcknowledgement: getRateRequiresAcknowledgement(r.serviceCode),
5460
+ requiresAcknowledgement: getRateRequiresAcknowledgement(r.serviceCode, r.packageType),
5249
5461
  requiresFundedAmount
5250
5462
  });
5251
5463
  });
5252
- }, [carriersById, enableGlobalPostFiltering, isInternationalShipment, isPoBoxShipment, rates]);
5464
+ }, [carriersById, enableGlobalPostFiltering, isInternational, isPoBox, isUnsupportedUpsCountry, rates]);
5253
5465
  };
5254
5466
 
5255
- const useServiceCodeOptions = (carriers, domestic, poBox) => {
5467
+ const useServiceCodeOptions = (carriers, shipment) => {
5468
+ const {
5469
+ isInternational,
5470
+ isPoBox,
5471
+ isUnsupportedUpsCountry
5472
+ } = useShipmentMetadata(shipment);
5256
5473
  return useMemo(() => {
5257
5474
  // Dictionary to lookup the uniqueness of each carrierCode
5258
5475
  const isUniqueByCarrierCode = createDictionary(carriers, (c, partialResults) => ({
5259
5476
  [c.carrierCode]: partialResults[c.carrierCode] === undefined
5260
5477
  }));
5261
5478
  return (carriers !== null && carriers !== void 0 ? carriers : []).reduce((options, carrier) => {
5262
- if (!isUspsCarrier(carrier.carrierCode) && poBox) return options;
5263
- const services = carrier.services.filter(s => s.domestic === domestic &&
5479
+ // Filter out non-USPS service for PO Box shipments
5480
+ // Filter out UPS service for unsupported countries
5481
+ if (!isUspsCarrier(carrier.carrierCode) && isPoBox || isUpsCarrier(carrier.carrierCode) && isUnsupportedUpsCountry) return options;
5482
+ const services = carrier.services.filter(s => s.domestic === !isInternational &&
5264
5483
  // TODO: Pending LMNT-418, GlobalPost filtering should be wrapped in FF
5265
5484
  !s.serviceCode.includes("globalpost_"));
5266
5485
  if (services.length === 0) return options;
5267
- const sortedServices = _$2.orderBy(services, "name", "asc");
5486
+ const sortedServices = _$3.orderBy(services, "name", "asc");
5268
5487
  return [...options, {
5269
5488
  // Check the uniqueness of the carrierCode, if unique default to friendlyName and if non-unique use nickname.
5270
5489
  label: isUniqueByCarrierCode[carrier.carrierCode] ? carrier.friendlyName : carrier.nickname,
@@ -5278,7 +5497,7 @@ const useServiceCodeOptions = (carriers, domestic, poBox) => {
5278
5497
  value: carrier.carrierId
5279
5498
  }];
5280
5499
  }, []);
5281
- }, [carriers, domestic, poBox]);
5500
+ }, [carriers, isInternational, isPoBox, isUnsupportedUpsCountry]);
5282
5501
  };
5283
5502
 
5284
5503
  const getContainerStyles = theme => /*#__PURE__*/css$1({
@@ -5337,13 +5556,16 @@ const createCategoryFromShippingPresets = (categoryName, presets) => presets ? [
5337
5556
  const useShippingPresetsOptions = ({
5338
5557
  platform,
5339
5558
  user
5340
- } = {}, isInternationalShipment) => {
5559
+ } = {}, shipment) => {
5341
5560
  const {
5342
5561
  t
5343
5562
  } = useTranslation();
5344
- return useMemo(() => [...createCategoryFromShippingPresets(t("shippingPresets.user"), isInternationalShipment ? user === null || user === void 0 ? void 0 : user.international : user === null || user === void 0 ? void 0 : user.domestic),
5563
+ const {
5564
+ isInternational
5565
+ } = useShipmentMetadata(shipment);
5566
+ return useMemo(() => [...createCategoryFromShippingPresets(t("shippingPresets.user"), isInternational ? user === null || user === void 0 ? void 0 : user.international : user === null || user === void 0 ? void 0 : user.domestic),
5345
5567
  // TODO - platform name should probably be a platform-specific environmental variable ?
5346
- ...createCategoryFromShippingPresets(t("shippingPresets.platform"), isInternationalShipment ? platform === null || platform === void 0 ? void 0 : platform.international : platform === null || platform === void 0 ? void 0 : platform.domestic)], [isInternationalShipment, platform, t, user]);
5568
+ ...createCategoryFromShippingPresets(t("shippingPresets.platform"), isInternational ? platform === null || platform === void 0 ? void 0 : platform.international : platform === null || platform === void 0 ? void 0 : platform.domestic)], [isInternational, platform, t, user]);
5347
5569
  };
5348
5570
 
5349
5571
  const useStateCodeOptions = domestic => useMemo(() => usStates.flatMap(v => !domestic || !v.isMilitary && !v.isUnitedStatesTerritory ? {
@@ -5620,7 +5842,7 @@ const useRunOnceOnTrue = conditionalEffect => {
5620
5842
  */
5621
5843
  const useToggle = (initialValue = false) => useReducer((prev, next) => next !== undefined && typeof next !== "object" ? next : !prev, initialValue);
5622
5844
 
5623
- var wellKnownSymbol$5 = wellKnownSymbol$j;
5845
+ var wellKnownSymbol$5 = wellKnownSymbol$k;
5624
5846
  var Iterators$1 = iterators;
5625
5847
 
5626
5848
  var ITERATOR$2 = wellKnownSymbol$5('iterator');
@@ -5632,10 +5854,10 @@ var isArrayIteratorMethod$1 = function (it) {
5632
5854
  };
5633
5855
 
5634
5856
  var classof = classof$6;
5635
- var getMethod$2 = getMethod$5;
5636
- var isNullOrUndefined$2 = isNullOrUndefined$6;
5857
+ var getMethod$2 = getMethod$6;
5858
+ var isNullOrUndefined$2 = isNullOrUndefined$7;
5637
5859
  var Iterators = iterators;
5638
- var wellKnownSymbol$4 = wellKnownSymbol$j;
5860
+ var wellKnownSymbol$4 = wellKnownSymbol$k;
5639
5861
 
5640
5862
  var ITERATOR$1 = wellKnownSymbol$4('iterator');
5641
5863
 
@@ -5661,7 +5883,7 @@ var getIterator$1 = function (argument, usingIterator) {
5661
5883
 
5662
5884
  var call$6 = functionCall;
5663
5885
  var anObject$4 = anObject$f;
5664
- var getMethod$1 = getMethod$5;
5886
+ var getMethod$1 = getMethod$6;
5665
5887
 
5666
5888
  var iteratorClose$1 = function (iterator, kind, value) {
5667
5889
  var innerResult, innerError;
@@ -5782,7 +6004,7 @@ const useAddressValidation = () => {
5782
6004
  if (matchedAddress.addressLine2 === "") {
5783
6005
  matchedAddress.addressLine2 = null;
5784
6006
  }
5785
- if (_$2.isEqual(_$2.omit(matchedAddress, ["postalCode", "addressResidentialIndicator"]), _$2.omit(originalAddress, ["postalCode", "addressResidentialIndicator"]))) return true;else return false;
6007
+ if (_$3.isEqual(_$3.omit(matchedAddress, ["postalCode", "addressResidentialIndicator"]), _$3.omit(originalAddress, ["postalCode", "addressResidentialIndicator"]))) return true;else return false;
5786
6008
  }, []);
5787
6009
  const postalCodeCompare = useCallback((matched, original) => {
5788
6010
  if (matched === undefined || original === undefined) return false;
@@ -5909,7 +6131,7 @@ const AddressParser = ({
5909
6131
  }));
5910
6132
  };
5911
6133
 
5912
- const styles$l = createStyles({
6134
+ const styles$o = createStyles({
5913
6135
  grow: {
5914
6136
  flexGrow: 1
5915
6137
  },
@@ -6009,13 +6231,13 @@ const AddressFields = ({
6009
6231
  },
6010
6232
  options: countryCodeOptions
6011
6233
  }), jsxs("div", Object.assign({
6012
- css: styles$l.stateZipWrapper
6234
+ css: styles$o.stateZipWrapper
6013
6235
  }, {
6014
6236
  children: [jsx("div", Object.assign({
6015
- css: styles$l.stateWrapper
6237
+ css: styles$o.stateWrapper
6016
6238
  }, {
6017
6239
  children: jsx("div", Object.assign({
6018
- css: styles$l.grow
6240
+ css: styles$o.grow
6019
6241
  }, {
6020
6242
  children: watchCountryCode === "US" ?
6021
6243
  // Domestic States
@@ -6040,10 +6262,10 @@ const AddressFields = ({
6040
6262
  })
6041
6263
  }))
6042
6264
  })), jsx("div", Object.assign({
6043
- css: styles$l.zipWrapper
6265
+ css: styles$o.zipWrapper
6044
6266
  }, {
6045
6267
  children: jsx("div", Object.assign({
6046
- css: styles$l.grow
6268
+ css: styles$o.grow
6047
6269
  }, {
6048
6270
  children: jsx(TextInput, {
6049
6271
  control: form.control,
@@ -6083,11 +6305,11 @@ const extendZod = () => {
6083
6305
  var call$4 = functionCall;
6084
6306
  var fixRegExpWellKnownSymbolLogic = fixRegexpWellKnownSymbolLogic;
6085
6307
  var anObject$2 = anObject$f;
6086
- var isNullOrUndefined$1 = isNullOrUndefined$6;
6308
+ var isNullOrUndefined$1 = isNullOrUndefined$7;
6087
6309
  var toLength = toLength$3;
6088
- var toString$1 = toString$b;
6089
- var requireObjectCoercible = requireObjectCoercible$8;
6090
- var getMethod = getMethod$5;
6310
+ var toString$1 = toString$c;
6311
+ var requireObjectCoercible = requireObjectCoercible$9;
6312
+ var getMethod = getMethod$6;
6091
6313
  var advanceStringIndex = advanceStringIndex$2;
6092
6314
  var regExpExec = regexpExecAbstract;
6093
6315
 
@@ -6215,7 +6437,7 @@ const AddressForm = ({
6215
6437
  children: [jsxs("div", Object.assign({
6216
6438
  css: theme => ({
6217
6439
  display: "flex",
6218
- justifyContent: isAddressParserOpen ? "normal" : "flex-end",
6440
+ flexDirection: isAddressParserOpen ? "column" : "row",
6219
6441
  paddingBottom: theme.spacing(4),
6220
6442
  width: "100%"
6221
6443
  })
@@ -6281,7 +6503,7 @@ const AddressForm = ({
6281
6503
  }));
6282
6504
  };
6283
6505
 
6284
- const styles$k = createStyles({
6506
+ const styles$n = createStyles({
6285
6507
  agreement: {
6286
6508
  alignItems: "center",
6287
6509
  display: "flex",
@@ -6351,10 +6573,10 @@ const DisplayCarrierTerms = c => {
6351
6573
  const listCarrierLinks = () => {
6352
6574
  return c.carrierTerms.links.map((term, index) => {
6353
6575
  return jsx("li", Object.assign({
6354
- css: styles$k.listItems
6576
+ css: styles$n.listItems
6355
6577
  }, {
6356
6578
  children: jsx(Link, Object.assign({
6357
- css: styles$k.link,
6579
+ css: styles$n.link,
6358
6580
  href: term.url,
6359
6581
  isExternal: true,
6360
6582
  target: "_blank"
@@ -6370,18 +6592,18 @@ const DisplayCarrierTerms = c => {
6370
6592
  };
6371
6593
  const listCarrierTerms = () => {
6372
6594
  return jsxs("div", Object.assign({
6373
- css: styles$k.terms
6595
+ css: styles$n.terms
6374
6596
  }, {
6375
6597
  children: [jsx(Typography, Object.assign({
6376
6598
  variant: "subtitle1"
6377
6599
  }, {
6378
6600
  children: c.carrierTerms.title
6379
6601
  })), jsx("div", Object.assign({
6380
- css: styles$k.terms
6602
+ css: styles$n.terms
6381
6603
  }, {
6382
6604
  children: listCarrierContent()
6383
6605
  })), jsx("ul", Object.assign({
6384
- css: styles$k.links
6606
+ css: styles$n.links
6385
6607
  }, {
6386
6608
  children: listCarrierLinks()
6387
6609
  }))]
@@ -6611,7 +6833,7 @@ const AddressDisplay = ({
6611
6833
  }));
6612
6834
  };
6613
6835
 
6614
- const styles$j = createStyles({
6836
+ const styles$m = createStyles({
6615
6837
  container: theme => ({
6616
6838
  display: "flex",
6617
6839
  gap: theme.spacing()
@@ -6649,13 +6871,13 @@ const Disclosure = ({
6649
6871
  }, [open]);
6650
6872
  return jsxs(Fragment, {
6651
6873
  children: [jsxs("div", Object.assign({
6652
- css: styles$j.container
6874
+ css: styles$m.container
6653
6875
  }, {
6654
6876
  children: [jsx("div", {
6655
6877
  children: label
6656
6878
  }), _showToggle && jsx("button", Object.assign({
6657
6879
  "aria-expanded": isOpen,
6658
- css: styles$j.toggle,
6880
+ css: styles$m.toggle,
6659
6881
  onClick: () => {
6660
6882
  setIsOpen(!isOpen);
6661
6883
  onToggle(!isOpen);
@@ -6663,12 +6885,12 @@ const Disclosure = ({
6663
6885
  type: "button"
6664
6886
  }, {
6665
6887
  children: jsx(Icon, {
6666
- css: styles$j.icon,
6888
+ css: styles$m.icon,
6667
6889
  name: isOpen ? IconNames.CHEVRON_TOP : IconNames.CHEVRON_BOTTOM
6668
6890
  })
6669
6891
  }))]
6670
6892
  })), isOpen && jsx("div", Object.assign({
6671
- css: styles$j.content
6893
+ css: styles$m.content
6672
6894
  }, {
6673
6895
  children: typeof children === "function" ? children(() => setIsOpen(!isOpen)) : children
6674
6896
  }))]
@@ -6708,14 +6930,10 @@ const AddressPreferenceDisplay = ({
6708
6930
  }), [addressPreference, onChangePreference]);
6709
6931
  const disclosureContentTitle = useMemo(() => addressPreference.status === "verified" ? t(`address.preference.${addressPreference.alternativeSource}`) : t("address.preference.addressNotValidated"), [addressPreference, t]);
6710
6932
  const isVerified = useMemo(() => {
6711
- if (isDomesticAddress(addressPreference.selection) || addressPreference.selectionSource === "matchedAddress") {
6712
- return addressPreference.status === "verified";
6713
- }
6714
- // If the address is international and is modified, We might get "verified" even though we are displaying original "not verified" address
6715
- if (addressPreference.isModified) {
6716
- return false;
6933
+ if (addressPreference.status === "verified" && addressPreference.selectionSource === "matchedAddress") {
6934
+ return true;
6717
6935
  }
6718
- return addressPreference.status === "verified";
6936
+ return false;
6719
6937
  }, [addressPreference]);
6720
6938
  return jsxs(Fragment, {
6721
6939
  children: [jsx(AddressDisplay, {
@@ -6818,7 +7036,7 @@ const getCarrierRecoverySchema = requiresAddress => z.object({
6818
7036
  address: requiresAddress ? baseSchema : baseSchema.optional()
6819
7037
  });
6820
7038
 
6821
- const styles$i = createStyles({
7039
+ const styles$l = createStyles({
6822
7040
  grid: theme => ({
6823
7041
  margin: theme.spacing(4)
6824
7042
  }),
@@ -6861,7 +7079,7 @@ const CarrierRecoveryForm = ({
6861
7079
  onSubmit: formLogger.capture(handleSubmit)
6862
7080
  }, {
6863
7081
  children: jsxs(Grid, Object.assign({
6864
- css: styles$i.grid,
7082
+ css: styles$l.grid,
6865
7083
  noPadding: true
6866
7084
  }, {
6867
7085
  children: [requiresAddress && jsxs(Fragment, {
@@ -6869,14 +7087,14 @@ const CarrierRecoveryForm = ({
6869
7087
  colSpan: 12
6870
7088
  }, {
6871
7089
  children: jsx(Typography, Object.assign({
6872
- css: styles$i.heading,
7090
+ css: styles$l.heading,
6873
7091
  variant: "heading4"
6874
7092
  }, {
6875
7093
  children: t("register-wallet:sections.carriers.title")
6876
7094
  }))
6877
7095
  })), jsx(GridChild, Object.assign({
6878
7096
  colSpan: 12,
6879
- css: styles$i.subtitle
7097
+ css: styles$l.subtitle
6880
7098
  }, {
6881
7099
  children: jsx(Typography, Object.assign({
6882
7100
  variant: "subtitle1"
@@ -6962,7 +7180,7 @@ const CarrierTermsForm = ({
6962
7180
  onSubmit(payload.agreement);
6963
7181
  }));
6964
7182
  return jsxs("div", Object.assign({
6965
- css: styles$k.termsForm,
7183
+ css: styles$n.termsForm,
6966
7184
  "data-testid": "carrier-terms-form"
6967
7185
  }, {
6968
7186
  children: [jsx(Typography, Object.assign({
@@ -6978,7 +7196,7 @@ const CarrierTermsForm = ({
6978
7196
  })), jsx(Spacer, {
6979
7197
  multiplier: 1
6980
7198
  }), jsx("div", Object.assign({
6981
- css: styles$k.carrierLogos
7199
+ css: styles$n.carrierLogos
6982
7200
  }, {
6983
7201
  children: metadatas.map(({
6984
7202
  name,
@@ -6994,7 +7212,7 @@ const CarrierTermsForm = ({
6994
7212
  onSubmit: formLogger.capture(handleSubmit)
6995
7213
  }, {
6996
7214
  children: jsxs("div", Object.assign({
6997
- css: styles$k.agreement
7215
+ css: styles$n.agreement
6998
7216
  }, {
6999
7217
  children: [jsx("div", {
7000
7218
  children: jsx(CheckboxInput, {
@@ -7021,12 +7239,12 @@ const CarrierTermsForm = ({
7021
7239
  name: "agreement"
7022
7240
  })
7023
7241
  }), showTerms && jsxs("div", Object.assign({
7024
- css: styles$k.well
7242
+ css: styles$n.well
7025
7243
  }, {
7026
7244
  children: [terms.map(t => jsx(DisplayCarrierTerms, {
7027
7245
  carrierTerms: t
7028
7246
  }, t.title)), jsx("div", Object.assign({
7029
- css: styles$k.close
7247
+ css: styles$n.close
7030
7248
  }, {
7031
7249
  children: jsx(Button, Object.assign({
7032
7250
  onClick: () => setShowTerms(false),
@@ -7058,9 +7276,9 @@ var DESCRIPTORS$1 = descriptors;
7058
7276
  var global$8 = global$p;
7059
7277
  var uncurryThis$1 = functionUncurryThis;
7060
7278
  var hasOwn$1 = hasOwnProperty_1;
7061
- var isCallable$4 = isCallable$n;
7279
+ var isCallable$4 = isCallable$o;
7062
7280
  var isPrototypeOf$1 = objectIsPrototypeOf;
7063
- var toString = toString$b;
7281
+ var toString = toString$c;
7064
7282
  var defineProperty = objectDefineProperty.f;
7065
7283
  var copyConstructorProperties = copyConstructorProperties$2;
7066
7284
 
@@ -7279,7 +7497,8 @@ const icons = {
7279
7497
  add: IconNames.ADD,
7280
7498
  checkFilled: IconNames.CHECK_FILLED,
7281
7499
  copy: IconNames.COPY,
7282
- download: IconNames.DOWNLOAD
7500
+ download: IconNames.DOWNLOAD,
7501
+ retry: IconNames.CIRCULAR_ARROW
7283
7502
  };
7284
7503
  const LinkAction = _a => {
7285
7504
  var {
@@ -7287,11 +7506,12 @@ const LinkAction = _a => {
7287
7506
  icon,
7288
7507
  isDisabled,
7289
7508
  isLoading,
7290
- title
7509
+ title,
7510
+ isBold = true
7291
7511
  } = _a,
7292
- props = __rest(_a, ["css", "icon", "isDisabled", "isLoading", "title"]);
7512
+ props = __rest(_a, ["css", "icon", "isDisabled", "isLoading", "title", "isBold"]);
7293
7513
  return jsx(Link, Object.assign({}, props, {
7294
- bold: true,
7514
+ bold: isBold,
7295
7515
  css: theme => [Object.assign(Object.assign({
7296
7516
  "&&&": {
7297
7517
  textDecoration: "none"
@@ -7345,7 +7565,7 @@ const CopyButton = ({
7345
7565
  }));
7346
7566
  };
7347
7567
 
7348
- const styles$h = createStyles({
7568
+ const styles$k = createStyles({
7349
7569
  trackingNumber: theme => ({
7350
7570
  alignItems: "center",
7351
7571
  display: "flex"
@@ -7391,10 +7611,10 @@ const Label = ({
7391
7611
  shippingAmount: label.shipmentCost
7392
7612
  }, {
7393
7613
  children: label.trackingNumber && jsxs("div", Object.assign({
7394
- css: styles$h.trackingNumber
7614
+ css: styles$k.trackingNumber
7395
7615
  }, {
7396
7616
  children: [jsx("div", Object.assign({
7397
- css: styles$h.truncatedTrackingNumber
7617
+ css: styles$k.truncatedTrackingNumber
7398
7618
  }, {
7399
7619
  children: label.trackingNumber.toString()
7400
7620
  })), jsx(CopyButton, {
@@ -7506,7 +7726,7 @@ const LandingPageForm = ({
7506
7726
  }));
7507
7727
  };
7508
7728
 
7509
- const styles$g = createStyles({
7729
+ const styles$j = createStyles({
7510
7730
  container: theme => ({
7511
7731
  padding: theme.spacing(2)
7512
7732
  }),
@@ -7528,11 +7748,11 @@ const LandingPage = ({
7528
7748
  t
7529
7749
  } = useTranslation();
7530
7750
  return jsxs("div", Object.assign({
7531
- css: styles$g.container,
7751
+ css: styles$j.container,
7532
7752
  "data-testid": "landing-page"
7533
7753
  }, {
7534
7754
  children: [jsxs("div", Object.assign({
7535
- css: styles$g.header
7755
+ css: styles$j.header
7536
7756
  }, {
7537
7757
  children: [jsx(Typography, Object.assign({
7538
7758
  variant: "heading4"
@@ -7550,7 +7770,7 @@ const LandingPage = ({
7550
7770
  })), jsx(LandingPageForm, {
7551
7771
  onSubmit: onSubmit
7552
7772
  }), jsxs("div", Object.assign({
7553
- css: styles$g.header
7773
+ css: styles$j.header
7554
7774
  }, {
7555
7775
  children: [jsx(Spacer, {
7556
7776
  multiplier: 6
@@ -7561,14 +7781,14 @@ const LandingPage = ({
7561
7781
  })), jsx(Spacer, {
7562
7782
  multiplier: 2
7563
7783
  }), jsx(Typography, Object.assign({
7564
- css: styles$g.description,
7784
+ css: styles$j.description,
7565
7785
  variant: "body1"
7566
7786
  }, {
7567
7787
  children: t("onboarding:landing.messageLine1")
7568
7788
  })), jsx(Spacer, {
7569
7789
  multiplier: 2
7570
7790
  }), jsx(Typography, Object.assign({
7571
- css: styles$g.description,
7791
+ css: styles$j.description,
7572
7792
  variant: "body1"
7573
7793
  }, {
7574
7794
  children: t("onboarding:landing.messageLine2")
@@ -7579,7 +7799,7 @@ const LandingPage = ({
7579
7799
  }));
7580
7800
  };
7581
7801
 
7582
- const styles$f = createStyles({
7802
+ const styles$i = createStyles({
7583
7803
  icon: theme => ({
7584
7804
  color: theme.palette.primary.main,
7585
7805
  marginRight: theme.spacing(2)
@@ -7624,10 +7844,10 @@ const Section = _a => {
7624
7844
  rest = __rest(_a, ["bold", "title", "children", "rightContent"]);
7625
7845
  return jsxs(Fragment, {
7626
7846
  children: [title && jsx("summary", Object.assign({
7627
- css: styles$f.summary
7847
+ css: styles$i.summary
7628
7848
  }, {
7629
7849
  children: jsxs("div", Object.assign({
7630
- css: styles$f.summaryWrapper
7850
+ css: styles$i.summaryWrapper
7631
7851
  }, {
7632
7852
  children: [jsx(Typography, Object.assign({
7633
7853
  bold: bold,
@@ -7635,20 +7855,20 @@ const Section = _a => {
7635
7855
  }, {
7636
7856
  children: title
7637
7857
  })), rightContent && jsx("div", Object.assign({
7638
- css: styles$f.rightContentWrapper
7858
+ css: styles$i.rightContentWrapper
7639
7859
  }, {
7640
7860
  children: rightContent
7641
7861
  }))]
7642
7862
  }))
7643
7863
  })), jsx("section", Object.assign({
7644
- css: styles$f.section
7864
+ css: styles$i.section
7645
7865
  }, rest, {
7646
7866
  children: children
7647
7867
  }))]
7648
7868
  });
7649
7869
  };
7650
7870
 
7651
- const styles$e = createStyles({
7871
+ const styles$h = createStyles({
7652
7872
  container: {
7653
7873
  display: "flex",
7654
7874
  flexDirection: "column"
@@ -7708,14 +7928,14 @@ const ListCarriersRow = ({
7708
7928
  setIsSubmitting(false);
7709
7929
  });
7710
7930
  return jsxs("div", Object.assign({
7711
- css: styles$e.container,
7931
+ css: styles$h.container,
7712
7932
  "data-testid": "carrier-row"
7713
7933
  }, {
7714
7934
  children: [jsxs("div", Object.assign({
7715
- css: styles$e.rowContainer
7935
+ css: styles$h.rowContainer
7716
7936
  }, {
7717
7937
  children: [jsxs("div", Object.assign({
7718
- css: styles$e.logoContainer
7938
+ css: styles$h.logoContainer
7719
7939
  }, {
7720
7940
  children: [jsx("div", {
7721
7941
  children: jsx("img", {
@@ -7733,7 +7953,7 @@ const ListCarriersRow = ({
7733
7953
  css: _ref
7734
7954
  }, {
7735
7955
  children: jsx(LinkAction, {
7736
- css: styles$e.getConnectButton(isConnected),
7956
+ css: styles$h.getConnectButton(isConnected),
7737
7957
  isDisabled: isConnected || showDropDown,
7738
7958
  isLoading: isSubmitting,
7739
7959
  onClick: () => __awaiter(void 0, void 0, void 0, function* () {
@@ -7751,7 +7971,7 @@ const ListCarriersRow = ({
7751
7971
  }));
7752
7972
  };
7753
7973
 
7754
- const styles$d = createStyles({
7974
+ const styles$g = createStyles({
7755
7975
  carriersList: theme => ({
7756
7976
  "& > li:not(:last-of-type)": {
7757
7977
  borderBottom: `1px solid ${theme.palette.gray.light}`
@@ -7804,7 +8024,7 @@ const ListCarriers = ({
7804
8024
  }))
7805
8025
  })), jsx(Spacer, {})]
7806
8026
  }), jsx("ul", Object.assign({
7807
- css: styles$d.carriersList,
8027
+ css: styles$g.carriersList,
7808
8028
  "data-testid": "carriers-list"
7809
8029
  }, {
7810
8030
  children: isLoading ? jsxs(Fragment, {
@@ -7826,11 +8046,11 @@ const ListCarriers = ({
7826
8046
  };
7827
8047
  const LoadingSkeletonRow = () => {
7828
8048
  return jsxs("div", Object.assign({
7829
- css: styles$d.skeletonRow,
8049
+ css: styles$g.skeletonRow,
7830
8050
  "data-testid": "skeleton-carrier-row"
7831
8051
  }, {
7832
8052
  children: [jsxs("div", Object.assign({
7833
- css: styles$d.skeletonLogoContainer
8053
+ css: styles$g.skeletonLogoContainer
7834
8054
  }, {
7835
8055
  children: [jsx(Skeleton, {
7836
8056
  animation: SkeletonAnimation.WAVE,
@@ -8081,7 +8301,7 @@ const AddressPreferenceProvider = props => {
8081
8301
  returnAddress
8082
8302
  } = validationPreference;
8083
8303
  setPassengerData(data);
8084
- if (_$2.isEqual(addresses.originAddress, _$2.omit(validationPreference.originAddress, ["addressLine3", "addressResidentialIndicator"]))) {
8304
+ if (_$3.isEqual(addresses.originAddress, _$3.omit(validationPreference.originAddress, ["addressLine3", "addressResidentialIndicator"]))) {
8085
8305
  yield onValid({
8086
8306
  originAddress: addresses.originAddress,
8087
8307
  returnAddress: addresses === null || addresses === void 0 ? void 0 : addresses.returnAddress
@@ -8137,7 +8357,7 @@ const useAddressPreference = () => {
8137
8357
  return context;
8138
8358
  };
8139
8359
 
8140
- const styles$c = createStyles({
8360
+ const styles$f = createStyles({
8141
8361
  body: theme => ({
8142
8362
  borderTop: `1px solid ${theme.palette.gray.light}`,
8143
8363
  color: theme.palette.black,
@@ -8188,14 +8408,14 @@ const SettingsCard = ({
8188
8408
  verticallyAligned
8189
8409
  }) => {
8190
8410
  return jsxs("div", Object.assign({
8191
- css: verticallyAligned ? styles$c.verticalContainer : styles$c.container,
8411
+ css: verticallyAligned ? styles$f.verticalContainer : styles$f.container,
8192
8412
  "data-testid": "settingsCard"
8193
8413
  }, {
8194
8414
  children: [jsxs("div", Object.assign({
8195
- css: styles$c.header
8415
+ css: styles$f.header
8196
8416
  }, {
8197
8417
  children: [jsxs("div", Object.assign({
8198
- css: styles$c.title
8418
+ css: styles$f.title
8199
8419
  }, {
8200
8420
  children: [typeof title === "string" ? jsx(Typography, Object.assign({
8201
8421
  variant: "subtitle2"
@@ -8230,7 +8450,7 @@ const SettingsCard = ({
8230
8450
  }))
8231
8451
  }))]
8232
8452
  })), children && jsx("div", Object.assign({
8233
- css: styles$c.body
8453
+ css: styles$f.body
8234
8454
  }, {
8235
8455
  children: jsxs("div", {
8236
8456
  children: [children, accessoryAction && jsx(ButtonGroup, Object.assign({
@@ -8486,7 +8706,7 @@ const WarehouseForm = ({
8486
8706
  }));
8487
8707
  };
8488
8708
 
8489
- const styles$b = createStyles({
8709
+ const styles$e = createStyles({
8490
8710
  cardSpacing: theme => ({
8491
8711
  display: "flex",
8492
8712
  flexDirection: "column",
@@ -8516,9 +8736,9 @@ const ManageWarehouses = ({
8516
8736
  const [showAddNewWarehouseForm, toggleShowAddNewWarehouseForm] = useToggle(false);
8517
8737
  return jsxs(Fragment, {
8518
8738
  children: [showAddNewWarehouseForm ? jsx(AddressPreferenceProvider, Object.assign({
8519
- css: styles$b.well,
8739
+ css: styles$e.well,
8520
8740
  formHeader: jsxs("div", Object.assign({
8521
- css: styles$b.header
8741
+ css: styles$e.header
8522
8742
  }, {
8523
8743
  children: [jsx(Typography, Object.assign({
8524
8744
  variant: "subtitle1"
@@ -8563,14 +8783,14 @@ const ManageWarehouses = ({
8563
8783
  })]
8564
8784
  }))
8565
8785
  })), jsx("div", Object.assign({
8566
- css: styles$b.cardSpacing
8786
+ css: styles$e.cardSpacing
8567
8787
  }, {
8568
8788
  children: warehouses.map(warehouse => {
8569
8789
  if (editWarehouseId && editWarehouseId === warehouse.warehouseId) {
8570
8790
  return jsx(AddressPreferenceProvider, Object.assign({
8571
- css: styles$b.well,
8791
+ css: styles$e.well,
8572
8792
  formHeader: jsxs("div", Object.assign({
8573
- css: styles$b.header
8793
+ css: styles$e.header
8574
8794
  }, {
8575
8795
  children: [jsx(Typography, Object.assign({
8576
8796
  variant: "subtitle1"
@@ -8628,7 +8848,7 @@ const ManageWarehouses = ({
8628
8848
 
8629
8849
  var getBuiltIn$2 = getBuiltIn$8;
8630
8850
  var definePropertyModule = objectDefineProperty;
8631
- var wellKnownSymbol$3 = wellKnownSymbol$j;
8851
+ var wellKnownSymbol$3 = wellKnownSymbol$k;
8632
8852
  var DESCRIPTORS = descriptors;
8633
8853
 
8634
8854
  var SPECIES$2 = wellKnownSymbol$3('species');
@@ -8667,8 +8887,8 @@ var aConstructor$1 = function (argument) {
8667
8887
 
8668
8888
  var anObject$1 = anObject$f;
8669
8889
  var aConstructor = aConstructor$1;
8670
- var isNullOrUndefined = isNullOrUndefined$6;
8671
- var wellKnownSymbol$2 = wellKnownSymbol$j;
8890
+ var isNullOrUndefined = isNullOrUndefined$7;
8891
+ var wellKnownSymbol$2 = wellKnownSymbol$k;
8672
8892
 
8673
8893
  var SPECIES$1 = wellKnownSymbol$2('species');
8674
8894
 
@@ -8698,7 +8918,7 @@ var engineIsIos = /(?:ipad|iphone|ipod).*applewebkit/i.test(userAgent$2);
8698
8918
  var global$7 = global$p;
8699
8919
  var apply = functionApply;
8700
8920
  var bind$2 = functionBindContext;
8701
- var isCallable$3 = isCallable$n;
8921
+ var isCallable$3 = isCallable$o;
8702
8922
  var hasOwn = hasOwnProperty_1;
8703
8923
  var fails = fails$q;
8704
8924
  var html = html$2;
@@ -8965,10 +9185,10 @@ var engineIsBrowser = !IS_DENO$1 && !IS_NODE$1
8965
9185
 
8966
9186
  var global$2 = global$p;
8967
9187
  var NativePromiseConstructor$3 = promiseNativeConstructor;
8968
- var isCallable$2 = isCallable$n;
9188
+ var isCallable$2 = isCallable$o;
8969
9189
  var isForced = isForced_1;
8970
9190
  var inspectSource = inspectSource$3;
8971
- var wellKnownSymbol$1 = wellKnownSymbol$j;
9191
+ var wellKnownSymbol$1 = wellKnownSymbol$k;
8972
9192
  var IS_BROWSER = engineIsBrowser;
8973
9193
  var IS_DENO = engineIsDeno;
8974
9194
  var V8_VERSION = engineV8Version;
@@ -9040,7 +9260,7 @@ var setPrototypeOf = objectSetPrototypeOf;
9040
9260
  var setToStringTag = setToStringTag$3;
9041
9261
  var setSpecies = setSpecies$1;
9042
9262
  var aCallable$2 = aCallable$a;
9043
- var isCallable$1 = isCallable$n;
9263
+ var isCallable$1 = isCallable$o;
9044
9264
  var isObject$1 = isObject$a;
9045
9265
  var anInstance = anInstance$1;
9046
9266
  var speciesConstructor = speciesConstructor$1;
@@ -9318,7 +9538,7 @@ $$5({ global: true, constructor: true, wrap: true, forced: FORCED_PROMISE_CONSTR
9318
9538
  setToStringTag(PromiseConstructor, PROMISE, false);
9319
9539
  setSpecies(PROMISE);
9320
9540
 
9321
- var wellKnownSymbol = wellKnownSymbol$j;
9541
+ var wellKnownSymbol = wellKnownSymbol$k;
9322
9542
 
9323
9543
  var ITERATOR = wellKnownSymbol('iterator');
9324
9544
  var SAFE_CLOSING = false;
@@ -9408,7 +9628,7 @@ var $$3 = _export;
9408
9628
  var FORCED_PROMISE_CONSTRUCTOR$2 = promiseConstructorDetection.CONSTRUCTOR;
9409
9629
  var NativePromiseConstructor = promiseNativeConstructor;
9410
9630
  var getBuiltIn$1 = getBuiltIn$8;
9411
- var isCallable = isCallable$n;
9631
+ var isCallable = isCallable$o;
9412
9632
  var defineBuiltIn = defineBuiltIn$7;
9413
9633
 
9414
9634
  var NativePromisePrototype = NativePromiseConstructor && NativePromiseConstructor.prototype;
@@ -9748,7 +9968,7 @@ const EditWalletAddressForm = ({
9748
9968
  }));
9749
9969
  };
9750
9970
 
9751
- const styles$a = createStyles({
9971
+ const styles$d = createStyles({
9752
9972
  grid: theme => ({
9753
9973
  margin: theme.spacing(4)
9754
9974
  })
@@ -9810,7 +10030,7 @@ const WalletForm = ({
9810
10030
  onSubmit: formLogger.capture(handleSubmit)
9811
10031
  }, {
9812
10032
  children: jsxs(Grid, Object.assign({
9813
- css: styles$a.grid,
10033
+ css: styles$d.grid,
9814
10034
  noPadding: true
9815
10035
  }, {
9816
10036
  children: [jsx(GridChild, Object.assign({
@@ -9892,7 +10112,7 @@ const WalletForm = ({
9892
10112
  }));
9893
10113
  };
9894
10114
 
9895
- const styles$9 = createStyles({
10115
+ const styles$c = createStyles({
9896
10116
  container: theme => ({
9897
10117
  padding: theme.spacing(2)
9898
10118
  }),
@@ -10068,10 +10288,10 @@ const Onboarding = ({
10068
10288
  const defaultWarehouse = (_a = warehouses.find(w => w.isDefault)) !== null && _a !== void 0 ? _a : warehouses[0];
10069
10289
  return jsx(AddressPreferenceProvider, Object.assign({
10070
10290
  formHeader: jsxs("div", Object.assign({
10071
- css: styles$9.walletFormHeader
10291
+ css: styles$c.walletFormHeader
10072
10292
  }, {
10073
10293
  children: [jsxs("div", Object.assign({
10074
- css: styles$9.walletFormTitle
10294
+ css: styles$c.walletFormTitle
10075
10295
  }, {
10076
10296
  children: [jsx(Typography, Object.assign({
10077
10297
  variant: "heading4"
@@ -10148,38 +10368,38 @@ const Onboarding = ({
10148
10368
  });
10149
10369
  };
10150
10370
  return jsxs("div", Object.assign({
10151
- css: styles$9.container
10371
+ css: styles$c.container
10152
10372
  }, {
10153
10373
  children: [jsxs(Stepper, Object.assign({
10154
10374
  currentStep: currentStep
10155
10375
  }, {
10156
10376
  children: [jsx(Step, {
10157
- css: styles$9.step,
10377
+ css: styles$c.step,
10158
10378
  label: t("onboarding:steps.login")
10159
10379
  }), jsx(Step, {
10160
- css: styles$9.step,
10380
+ css: styles$c.step,
10161
10381
  label: t("onboarding:steps.carriers")
10162
10382
  }), jsx(Step, {
10163
- css: styles$9.step,
10383
+ css: styles$c.step,
10164
10384
  label: t("onboarding:steps.addresses")
10165
10385
  }), jsx(Step, {
10166
- css: styles$9.step,
10386
+ css: styles$c.step,
10167
10387
  label: t("onboarding:steps.payment")
10168
10388
  })]
10169
- })), renderStep()]
10389
+ })), renderStep(), jsx(Spacer, {}), jsx(PoweredByShipEngine, {})]
10170
10390
  }));
10171
10391
  };
10172
10392
 
10173
- let _ = t => t,
10174
- _t,
10175
- _t2;
10393
+ let _$1 = t => t,
10394
+ _t$1,
10395
+ _t2$1;
10176
10396
  const Cube = _a => {
10177
10397
  var {
10178
10398
  animate = false
10179
10399
  } = _a,
10180
10400
  props = __rest(_a, ["animate"]);
10181
10401
  const theme = useTheme();
10182
- const bounce = keyframes(_t || (_t = _`
10402
+ const bounce = keyframes(_t$1 || (_t$1 = _$1`
10183
10403
  0%, 100% {
10184
10404
  transform: translateY(-25%);
10185
10405
  animation-timing-function: cubic-bezier(0.8, 0, 1, 1);
@@ -10189,7 +10409,7 @@ const Cube = _a => {
10189
10409
  animation-timing-function: cubic-bezier(0, 0, 0.2, 1);
10190
10410
  }
10191
10411
  `));
10192
- const spin = keyframes(_t2 || (_t2 = _`
10412
+ const spin = keyframes(_t2$1 || (_t2$1 = _$1`
10193
10413
  from {
10194
10414
  transform: rotate(0deg);
10195
10415
  }
@@ -10292,12 +10512,12 @@ const Loader = props => {
10292
10512
  }
10293
10513
  }, {
10294
10514
  children: jsx(Spinner, Object.assign({}, props, {
10295
- size: SpinnerSize.SIZE_LARGE
10515
+ size: props.size || SpinnerSize.SIZE_LARGE
10296
10516
  }))
10297
10517
  }));
10298
10518
  };
10299
10519
 
10300
- const styles$8 = createStyles({
10520
+ const styles$b = createStyles({
10301
10521
  chipList: theme => ({
10302
10522
  gap: theme.spacing(1)
10303
10523
  }),
@@ -10408,7 +10628,7 @@ const AddFundsForm = ({
10408
10628
  })), jsx(Spacer, {
10409
10629
  multiplier: 2
10410
10630
  }), jsx(ChipList, Object.assign({
10411
- css: styles$8.chipList,
10631
+ css: styles$b.chipList,
10412
10632
  onChange: idx => {
10413
10633
  const chip = chips[idx];
10414
10634
  setSelectedChip(chip);
@@ -10423,7 +10643,7 @@ const AddFundsForm = ({
10423
10643
  }
10424
10644
  }, {
10425
10645
  children: chips.map(chip => jsx(Chip, Object.assign({
10426
- css: styles$8.getChip({
10646
+ css: styles$b.getChip({
10427
10647
  isDisabled: chip.value < _minimumAmount,
10428
10648
  isSelected: chip.value === selectedChip.value
10429
10649
  }),
@@ -10440,7 +10660,7 @@ const AddFundsForm = ({
10440
10660
  multiplier: 1
10441
10661
  }), jsx(MoneyInput, {
10442
10662
  control: form.control,
10443
- css: styles$8.fundsInput,
10663
+ css: styles$b.fundsInput,
10444
10664
  defaultValue: {
10445
10665
  amount: undefined,
10446
10666
  currency: SE.Currency.USD
@@ -10493,7 +10713,7 @@ const AddFundsForm = ({
10493
10713
  });
10494
10714
  };
10495
10715
 
10496
- const styles$7 = isLabelRight => createStyles({
10716
+ const styles$a = isLabelRight => createStyles({
10497
10717
  inlineContainer: theme => ({
10498
10718
  alignItems: "center",
10499
10719
  display: "flex",
@@ -10508,14 +10728,14 @@ const InlineLabel = ({
10508
10728
  isLabelRight,
10509
10729
  labelProps: _labelProps = {}
10510
10730
  }) => jsxs("div", Object.assign({
10511
- css: styles$7(isLabelRight).inlineContainer
10731
+ css: styles$a(isLabelRight).inlineContainer
10512
10732
  }, {
10513
10733
  children: [jsx(Typography, Object.assign({}, _labelProps, {
10514
10734
  children: label
10515
10735
  })), children]
10516
10736
  }));
10517
10737
 
10518
- const styles$6 = createStyles({
10738
+ const styles$9 = createStyles({
10519
10739
  getBalanceText: balance => theme => ({
10520
10740
  color: balance === undefined ? theme.palette.alert.main : balance >= 0 ? theme.palette.secondary.dark : theme.palette.error.main
10521
10741
  })
@@ -10538,7 +10758,7 @@ const CarrierBalance = ({
10538
10758
  }, {
10539
10759
  children: isLoadingCarrier || isRefetchingCarrier ? jsx(Spinner, {}) : jsx(Typography, Object.assign({
10540
10760
  bold: true,
10541
- css: styles$6.getBalanceText(balance)
10761
+ css: styles$9.getBalanceText(balance)
10542
10762
  }, {
10543
10763
  children: balance === undefined ? t("manage-funding:errors.balanceUnknown") : formatMoney({
10544
10764
  amount: balance,
@@ -10560,7 +10780,7 @@ const Spread = ({
10560
10780
  children: children
10561
10781
  }));
10562
10782
 
10563
- const styles$5 = createStyles({
10783
+ const styles$8 = createStyles({
10564
10784
  balanceText: theme => ({
10565
10785
  color: theme.palette.secondary.dark
10566
10786
  }),
@@ -10628,7 +10848,7 @@ const FundAndPurchase = ({
10628
10848
  }, {
10629
10849
  children: [jsx(Button, Object.assign({
10630
10850
  bold: false,
10631
- css: styles$5.saveRateButton,
10851
+ css: styles$8.saveRateButton,
10632
10852
  disabled: disabled || !carrierId || addFundsForm.isSubmitting || isRateFormSubmitting,
10633
10853
  isLoading: isSavingRate,
10634
10854
  onClick: handleSaveRate,
@@ -10648,7 +10868,7 @@ const FundAndPurchase = ({
10648
10868
  // don't show balance or funding form
10649
10869
  if (!isFundingRequired) return jsx("div", Object.assign({
10650
10870
  className: className,
10651
- css: styles$5.container
10871
+ css: styles$8.container
10652
10872
  }, {
10653
10873
  children: renderActionButtons()
10654
10874
  }));
@@ -10661,7 +10881,7 @@ const FundAndPurchase = ({
10661
10881
  // show balance, but not the funding form.
10662
10882
  if (!isFundingEnabled) return jsxs("div", Object.assign({
10663
10883
  className: className,
10664
- css: styles$5.container
10884
+ css: styles$8.container
10665
10885
  }, {
10666
10886
  children: [jsx(CarrierBalance, {
10667
10887
  carrierId: carrierId
@@ -10673,7 +10893,7 @@ const FundAndPurchase = ({
10673
10893
  // show balance and funding form
10674
10894
  return jsxs("div", Object.assign({
10675
10895
  className: className,
10676
- css: styles$5.container
10896
+ css: styles$8.container
10677
10897
  }, {
10678
10898
  children: [jsxs(Spread, {
10679
10899
  children: [jsx(CarrierBalance, {
@@ -10704,13 +10924,13 @@ const FundAndPurchase = ({
10704
10924
  var _a, _b;
10705
10925
  return jsxs(Fragment, {
10706
10926
  children: [jsxs("section", Object.assign({
10707
- css: styles$5.getFormExtension(addFundsForm.isCustomAmount)
10927
+ css: styles$8.getFormExtension(addFundsForm.isCustomAmount)
10708
10928
  }, {
10709
10929
  children: [jsx(InlineLabel, Object.assign({
10710
10930
  label: t("manage-funding:fundAndPurchase.newBalance")
10711
10931
  }, {
10712
10932
  children: jsx(Typography, Object.assign({
10713
- css: styles$5.balanceText
10933
+ css: styles$8.balanceText
10714
10934
  }, {
10715
10935
  children: formatMoney({
10716
10936
  amount: balance + ((_a = addFundsForm.selectedAmount) !== null && _a !== void 0 ? _a : 0),
@@ -10721,7 +10941,7 @@ const FundAndPurchase = ({
10721
10941
  label: t("manage-funding:fundAndPurchase.finalBalance")
10722
10942
  }, {
10723
10943
  children: jsx(Typography, Object.assign({
10724
- css: styles$5.balanceText
10944
+ css: styles$8.balanceText
10725
10945
  }, {
10726
10946
  children: formatMoney({
10727
10947
  amount: balance + ((_b = addFundsForm.selectedAmount) !== null && _b !== void 0 ? _b : 0) - purchaseAmount,
@@ -10748,30 +10968,480 @@ const FundAndPurchase = ({
10748
10968
  }));
10749
10969
  };
10750
10970
 
10751
- const styles$4 = createStyles({
10752
- fundAndPurchase: theme => ({
10753
- borderTop: `1px solid ${theme.palette.gray.ultraLight}`
10754
- }),
10755
- ratesInterstitial: {
10756
- alignItems: "center",
10757
- display: "flex",
10758
- flexDirection: "column",
10759
- justifyContent: "center",
10760
- textAlign: "center"
10761
- },
10762
- showMoreOrLessRatesButton: {
10763
- alignItems: "center",
10764
- display: "flex"
10765
- }
10766
- });
10767
-
10768
- const rateSchema = z.object({
10769
- rate: z.object({
10770
- isAcknowledged: z.boolean().refine(v => v === true, "purchase-label:schemaErrors.needToAcknowledge"),
10971
+ const LabelLayoutPurchase = ({
10972
+ onChange
10973
+ }) => {
10974
+ const {
10975
+ t
10976
+ } = useTranslation(["common", "manage-defaults"]);
10977
+ const [layout, setLayout] = useState("4x6");
10978
+ return jsxs(Fragment, {
10979
+ children: [jsx(InlineNotification, Object.assign({
10980
+ title: t("manage-defaults:label.purchase.title"),
10981
+ type: NotificationType.INFO
10982
+ }, {
10983
+ children: t("manage-defaults:label.purchase.description")
10984
+ })), jsx(Spacer, {
10985
+ multiplier: 1.5
10986
+ }), jsxs(RadioGroup, Object.assign({
10987
+ name: "labelLayout",
10988
+ onChange: e => {
10989
+ setLayout(e.target.value);
10990
+ onChange(e.target.value);
10991
+ },
10992
+ value: layout
10993
+ }, {
10994
+ children: [jsx(Radio, Object.assign({
10995
+ value: "Letter"
10996
+ }, {
10997
+ children: jsx(Typography, Object.assign({
10998
+ bold: true
10999
+ }, {
11000
+ children: t("manage-defaults:label.letter.title")
11001
+ }))
11002
+ })), jsx(Spacer, {
11003
+ multiplier: 3
11004
+ }), jsx(Radio, Object.assign({
11005
+ value: "4x6"
11006
+ }, {
11007
+ children: jsx(Typography, Object.assign({
11008
+ bold: true
11009
+ }, {
11010
+ children: t("manage-defaults:label.thermal.title")
11011
+ }))
11012
+ }))]
11013
+ }))]
11014
+ });
11015
+ };
11016
+
11017
+ let _ = t => t,
11018
+ _t,
11019
+ _t2,
11020
+ _t3;
11021
+ const stroke = keyframes(_t || (_t = _`
11022
+ 100% {
11023
+ stroke-dashoffset: 0;
11024
+ }
11025
+ `));
11026
+ const fadeInOut = keyframes(_t2 || (_t2 = _`
11027
+ 0%, 100% {
11028
+ opacity: 0;
11029
+ }
11030
+ 20% {
11031
+ opacity: 1;
11032
+ }
11033
+ 85% {
11034
+ opacity: 1;
11035
+ }
11036
+ `));
11037
+ const fill = keyframes(_t3 || (_t3 = _`
11038
+ 100% {
11039
+ box-shadow: inset 0px 0px 0px 30px #3F8200;
11040
+ `));
11041
+ const colors = {
11042
+ green: "#3F8200",
11043
+ grey: "#706F6F",
11044
+ red: "#EE3B3F"
11045
+ };
11046
+ const styles$7 = createStyles({
11047
+ checkmark: () => ({
11048
+ animation: `${fill} forwards`,
11049
+ borderRadius: "50%",
11050
+ height: "20px,",
11051
+ stroke: "#fff",
11052
+ width: "20px"
11053
+ }),
11054
+ checkmarkCheck: () => ({
11055
+ animation: `${stroke} 1s forwards`,
11056
+ strokeDasharray: "48",
11057
+ strokeDashoffset: "48"
11058
+ }),
11059
+ container: theme => ({
11060
+ alignItems: "center",
11061
+ animation: `${fadeInOut} 2.5s ease-in-out forwards`,
11062
+ display: "flex",
11063
+ justifyContent: "flex-start",
11064
+ padding: `0 ${theme.spacing(2)}px 0 0`
11065
+ }),
11066
+ saved: theme => ({
11067
+ color: colors.green,
11068
+ marginLeft: `${theme.spacing(1)}px`
11069
+ }),
11070
+ saving: theme => ({
11071
+ marginLeft: `${theme.spacing(1)}px`
11072
+ }),
11073
+ savingContainer: () => ({
11074
+ alignItems: "center",
11075
+ color: colors.grey,
11076
+ display: "flex",
11077
+ justifyContent: "flex-start"
11078
+ }),
11079
+ savingFailed: theme => ({
11080
+ color: "#EE3B3F",
11081
+ marginLeft: `${theme.spacing(1)}px`
11082
+ })
11083
+ });
11084
+
11085
+ const SaveStatus = ({
11086
+ errors,
11087
+ isSaving
11088
+ }) => {
11089
+ const {
11090
+ t
11091
+ } = useTranslation(["manage-defaults"]);
11092
+ if (isSaving) {
11093
+ return jsxs("div", Object.assign({
11094
+ css: styles$7.savingContainer
11095
+ }, {
11096
+ children: [jsx(Loader, {
11097
+ color: colors.grey,
11098
+ css: {
11099
+ color: colors.grey
11100
+ },
11101
+ size: SpinnerSize.SIZE_SMALL
11102
+ }), jsx(Typography, Object.assign({
11103
+ css: styles$7.saving
11104
+ }, {
11105
+ children: t("manage-defaults:status.saving")
11106
+ }))]
11107
+ }));
11108
+ }
11109
+ return !isSaving && !errors ? jsxs("div", Object.assign({
11110
+ css: styles$7.container
11111
+ }, {
11112
+ children: [jsx("svg", Object.assign({
11113
+ css: styles$7.checkmark,
11114
+ viewBox: "0 0 52 52"
11115
+ }, {
11116
+ children: jsx("path", {
11117
+ css: styles$7.checkmarkCheck,
11118
+ d: "M14.1 27.2l7.1 7.2 16.7-16.8",
11119
+ fill: "none",
11120
+ strokeWidth: "5px"
11121
+ })
11122
+ })), jsx(Typography, Object.assign({
11123
+ css: styles$7.saved
11124
+ }, {
11125
+ children: t("manage-defaults:status.saved")
11126
+ }))]
11127
+ })) : jsxs("div", Object.assign({
11128
+ css: [styles$7.container, {
11129
+ padding: "0"
11130
+ }]
11131
+ }, {
11132
+ children: [jsx(Icon, {
11133
+ css: {
11134
+ color: colors.red
11135
+ },
11136
+ name: IconNames.CANCEL_FILLED
11137
+ }), jsx(Typography, Object.assign({
11138
+ css: styles$7.savingFailed
11139
+ }, {
11140
+ children: t("manage-defaults:status.savingFailed")
11141
+ }))]
11142
+ }));
11143
+ };
11144
+
11145
+ const styles$6 = createStyles({
11146
+ button: theme => ({
11147
+ backgroundColor: "transparent",
11148
+ padding: 0
11149
+ }),
11150
+ buttonContainer: theme => ({
11151
+ alignItems: "center",
11152
+ display: "flex",
11153
+ justifyContent: "left"
11154
+ }),
11155
+ icon: theme => ({
11156
+ color: theme.palette.secondary.main,
11157
+ position: "absolute",
11158
+ right: theme.spacing(1),
11159
+ top: theme.spacing(1)
11160
+ }),
11161
+ letter: theme => ({
11162
+ ":hover": {
11163
+ border: `1px solid ${theme.palette.secondary.main}`
11164
+ },
11165
+ alignItems: "center",
11166
+ border: `1px solid ${theme.palette.gray.light}`,
11167
+ borderRadius: "10px",
11168
+ cursor: "pointer",
11169
+ display: "flex",
11170
+ flexDirection: "column",
11171
+ height: theme.spacing(31),
11172
+ marginRight: theme.spacing(3.5),
11173
+ position: "relative",
11174
+ width: theme.spacing(22)
11175
+ }),
11176
+ letterInner: theme => ({
11177
+ backgroundColor: "white",
11178
+ border: `1px solid ${theme.palette.gray.light}`,
11179
+ height: theme.spacing(14),
11180
+ marginBottom: theme.spacing(2),
11181
+ marginTop: theme.spacing(6),
11182
+ width: theme.spacing(10)
11183
+ }),
11184
+ letterLabel: theme => ({
11185
+ backgroundColor: "#95C2E0",
11186
+ height: theme.spacing(5),
11187
+ margin: theme.spacing(1.5)
11188
+ }),
11189
+ selectedLetter: theme => ({
11190
+ alignItems: "center",
11191
+ backgroundColor: "#EAF6FF",
11192
+ border: `1px solid ${theme.palette.secondary.main}`,
11193
+ borderRadius: "10px",
11194
+ boxShadow: `0 0 0 3px ${theme.palette.secondary.main}`,
11195
+ boxSizing: "border-box",
11196
+ cursor: "pointer",
11197
+ display: "flex",
11198
+ flexDirection: "column",
11199
+ height: theme.spacing(31),
11200
+ marginRight: theme.spacing(3.5),
11201
+ position: "relative",
11202
+ width: theme.spacing(22)
11203
+ }),
11204
+ selectedThermal: theme => ({
11205
+ alignItems: "center",
11206
+ backgroundColor: "#EAF6FF",
11207
+ border: `1px solid ${theme.palette.secondary.main}`,
11208
+ borderRadius: "10px",
11209
+ boxShadow: `0 0 0 3px ${theme.palette.secondary.main}`,
11210
+ cursor: "pointer",
11211
+ display: "flex",
11212
+ flexDirection: "column",
11213
+ height: theme.spacing(31),
11214
+ position: "relative",
11215
+ width: theme.spacing(22)
11216
+ }),
11217
+ thermal: theme => ({
11218
+ ":hover": {
11219
+ border: `1px solid ${theme.palette.secondary.main}`
11220
+ },
11221
+ alignItems: "center",
11222
+ border: `1px solid ${theme.palette.gray.light}`,
11223
+ borderRadius: "10px",
11224
+ cursor: "pointer",
11225
+ display: "flex",
11226
+ flexDirection: "column",
11227
+ height: theme.spacing(31),
11228
+ position: "relative",
11229
+ width: theme.spacing(22)
11230
+ }),
11231
+ thermalIcon: theme => ({
11232
+ backgroundColor: "#95C2E0",
11233
+ height: theme.spacing(8),
11234
+ width: theme.spacing(5)
11235
+ }),
11236
+ thermalInner: theme => ({
11237
+ alignItems: "center",
11238
+ display: "flex",
11239
+ height: theme.spacing(14),
11240
+ justifyContent: "center",
11241
+ marginBottom: theme.spacing(2),
11242
+ marginTop: theme.spacing(6),
11243
+ width: theme.spacing(10)
11244
+ }),
11245
+ thermalLabel: theme => ({
11246
+ backgroundColor: "#95C2E0",
11247
+ height: theme.spacing(8),
11248
+ width: theme.spacing(5)
11249
+ })
11250
+ });
11251
+
11252
+ const LabelLayoutSettings = ({
11253
+ errors,
11254
+ isSaving,
11255
+ onChange
11256
+ }) => {
11257
+ var _a;
11258
+ const {
11259
+ t
11260
+ } = useTranslation(["common", "manage-defaults"]);
11261
+ const {
11262
+ data: accountSettings
11263
+ } = useGetAccountSettings();
11264
+ const labelLayout = (_a = accountSettings === null || accountSettings === void 0 ? void 0 : accountSettings.defaultLabelLayout) === null || _a === void 0 ? void 0 : _a.toLowerCase();
11265
+ return jsx(Section, Object.assign({
11266
+ bold: true,
11267
+ rightContent: jsx(SaveStatus, {
11268
+ errors: errors,
11269
+ isSaving: isSaving
11270
+ }),
11271
+ title: t("manage-defaults:label.title")
11272
+ }, {
11273
+ children: jsxs("div", Object.assign({
11274
+ css: styles$6.buttonContainer
11275
+ }, {
11276
+ children: [jsx("button", Object.assign({
11277
+ css: styles$6.button,
11278
+ id: "letter",
11279
+ onClick: () => {
11280
+ onChange("Letter");
11281
+ },
11282
+ value: "letter"
11283
+ }, {
11284
+ children: jsxs("div", Object.assign({
11285
+ css: labelLayout === "letter" ? styles$6.selectedLetter : styles$6.letter
11286
+ }, {
11287
+ children: [labelLayout === "letter" && jsx(Icon, {
11288
+ css: styles$6.icon,
11289
+ name: IconNames$1.CHECK_FILLED
11290
+ }), jsx("div", Object.assign({
11291
+ css: styles$6.letterInner
11292
+ }, {
11293
+ children: jsx("div", {
11294
+ css: styles$6.letterLabel
11295
+ })
11296
+ })), jsx(Typography, {
11297
+ children: t("manage-defaults:label.letter.title")
11298
+ }), jsx(Spacer, {
11299
+ multiplier: 0.5
11300
+ }), jsx(Typography, Object.assign({
11301
+ css: {
11302
+ color: "#6C757D"
11303
+ }
11304
+ }, {
11305
+ children: t("manage-defaults:label.letter.description")
11306
+ }))]
11307
+ }))
11308
+ })), jsx("button", Object.assign({
11309
+ css: styles$6.button,
11310
+ id: "4x6",
11311
+ onClick: e => {
11312
+ onChange(e.currentTarget.value);
11313
+ },
11314
+ value: "4x6"
11315
+ }, {
11316
+ children: jsxs("div", Object.assign({
11317
+ css: labelLayout === "4x6" ? styles$6.selectedThermal : styles$6.thermal
11318
+ }, {
11319
+ children: [labelLayout === "4x6" && jsx(Icon, {
11320
+ css: styles$6.icon,
11321
+ name: IconNames$1.CHECK_FILLED
11322
+ }), jsx("div", Object.assign({
11323
+ css: styles$6.thermalInner
11324
+ }, {
11325
+ children: jsx("div", {
11326
+ css: styles$6.thermalLabel
11327
+ })
11328
+ })), jsx(Typography, {
11329
+ children: t("manage-defaults:label.thermal.title")
11330
+ }), jsx(Spacer, {
11331
+ multiplier: 0.5
11332
+ }), jsx(Typography, Object.assign({
11333
+ css: {
11334
+ color: "#6C757D"
11335
+ }
11336
+ }, {
11337
+ children: t("manage-defaults:label.thermal.description")
11338
+ }))]
11339
+ }))
11340
+ }))]
11341
+ }))
11342
+ }));
11343
+ };
11344
+
11345
+ const LabelLayout = ({
11346
+ display
11347
+ }) => {
11348
+ const {
11349
+ error: updateAccountSettingsErrors,
11350
+ isLoading: updatingAccountSettings,
11351
+ mutateAsync: updateAccountSettings
11352
+ } = useUpdateAccountSettings();
11353
+ const {
11354
+ refetch: refreshAccountSettings
11355
+ } = useGetAccountSettings();
11356
+ const handleSubmitUpdateAccountSettings = newLabelLayout => __awaiter(void 0, void 0, void 0, function* () {
11357
+ try {
11358
+ yield updateAccountSettings({
11359
+ defaultLabelLayout: newLabelLayout
11360
+ });
11361
+ } catch (error) {
11362
+ console.error(error);
11363
+ }
11364
+ yield refreshAccountSettings();
11365
+ });
11366
+ return jsxs(Fragment, {
11367
+ children: [display === "settings" && jsx(LabelLayoutSettings, {
11368
+ errors: updateAccountSettingsErrors,
11369
+ isSaving: updatingAccountSettings,
11370
+ onChange: handleSubmitUpdateAccountSettings
11371
+ }), display === "purchase" && jsx(LabelLayoutPurchase, {
11372
+ onChange: handleSubmitUpdateAccountSettings
11373
+ })]
11374
+ });
11375
+ };
11376
+
11377
+ const styles$5 = createStyles({
11378
+ fundAndPurchase: theme => ({
11379
+ borderTop: `1px solid ${theme.palette.gray.ultraLight}`
11380
+ }),
11381
+ ratesInterstitial: {
11382
+ alignItems: "center",
11383
+ display: "flex",
11384
+ flexDirection: "column",
11385
+ justifyContent: "center",
11386
+ textAlign: "center"
11387
+ },
11388
+ showMoreOrLessRatesButton: {
11389
+ alignItems: "center",
11390
+ display: "flex"
11391
+ }
11392
+ });
11393
+
11394
+ const rateSchema = z.object({
11395
+ rate: z.object({
11396
+ isAcknowledged: z.boolean().refine(v => v === true, "purchase-label:schemaErrors.needToAcknowledge"),
10771
11397
  rateId: z.string()
10772
11398
  })
10773
11399
  }).transform(schema => schema.rate.rateId);
10774
11400
 
11401
+ var _path, _path2;
11402
+ function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
11403
+ var SvgShipengineLogo = function SvgShipengineLogo(props) {
11404
+ return /*#__PURE__*/React.createElement("svg", _extends({
11405
+ width: 244,
11406
+ height: 31,
11407
+ fill: "none",
11408
+ xmlns: "http://www.w3.org/2000/svg"
11409
+ }, props), _path || (_path = /*#__PURE__*/React.createElement("path", {
11410
+ d: "M25.038 15.5c0-.954-.357-1.789-1.073-2.504-.715-.715-1.55-1.073-2.503-1.073-.954 0-1.789.358-2.504 1.073-.716.715-1.073 1.55-1.073 2.504s.357 1.788 1.073 2.504c.715.715 1.55 1.073 2.504 1.073.953 0 1.788-.358 2.503-1.073.716-.716 1.073-1.55 1.073-2.504zm7.154-1.55v3.1c0 .12 0 .238-.119.358l-.238.238-2.623.358c-.12.477-.358.954-.597 1.192.358.477.835 1.073 1.55 1.908.12.12.12.238.12.358 0 .119 0 .238-.12.357-.238.358-.715.835-1.311 1.55-.596.716-1.073.954-1.312.954-.119 0-.238 0-.357-.12l-2.027-1.55c-.358.24-.835.359-1.312.478-.12 1.311-.238 2.146-.358 2.623 0 .357-.238.477-.476.477h-3.1c-.12 0-.239 0-.358-.12-.12-.119-.12-.238-.12-.357l-.357-2.623c-.477-.12-.835-.358-1.312-.477l-2.027 1.55c-.119.12-.238.12-.357.12-.12 0-.239 0-.358-.12-1.192-1.073-1.908-1.789-2.265-2.385-.12-.119-.12-.238-.12-.357 0-.12 0-.239.12-.358.119-.239.357-.477.715-.954s.596-.715.715-.954c-.238-.477-.477-.954-.596-1.43l-2.504-.358c-.119 0-.238-.12-.238-.12s-.12-.119-.12-.238v-3.1c0-.12 0-.239.12-.358l.238-.238 2.623-.358c.12-.477.358-.835.597-1.311-.358-.477-.835-1.193-1.55-1.908-.12-.12-.12-.239-.12-.358s0-.238.12-.357c.238-.358.715-.835 1.43-1.55.716-.716 1.073-.954 1.312-.954.12 0 .238 0 .358.119l1.907 1.55c.358-.239.835-.358 1.312-.477.12-1.312.238-2.146.358-2.623.119-.239.238-.358.477-.358h3.1c.119 0 .238 0 .357.12.12.119.12.238.12.357l.357 2.623c.477.12.835.358 1.312.477l2.027-1.55c.119-.12.238-.12.357-.12.12 0 .239 0 .358.12 1.192 1.073 2.027 1.908 2.265 2.385.12.119.12.119.12.357 0 .12 0 .239-.12.358-.119.239-.357.477-.715.954s-.596.715-.715.954c.238.477.477.954.596 1.311l2.504.358c.119 0 .238.12.238.12s.12.238.12.357z",
11411
+ fill: "#45AAF2"
11412
+ })), _path2 || (_path2 = /*#__PURE__*/React.createElement("path", {
11413
+ d: "M0 16.335v-1.789a1.7 1.7 0 0 0 1.43-.715c.358-.477.478-1.073.478-1.789V4.77c0-1.43.477-2.623 1.311-3.457C4.173.358 5.127 0 6.32 0h2.146v2.027H6.32c-.596 0-1.192.238-1.669.835-.477.596-.715 1.192-.715 2.026V12.4c0 1.67-.597 2.623-1.67 3.1 1.073.477 1.67 1.55 1.67 3.1v7.63c0 .835.238 1.55.715 2.028.477.596 1.073.834 1.67.834h2.145V31H6.32c-1.192 0-2.265-.477-3.1-1.311-.954-.835-1.311-2.027-1.311-3.458v-7.393c0-.715-.12-1.311-.477-1.788A1.7 1.7 0 0 0 0 16.335zm34.577 12.638h2.146c.596 0 1.192-.238 1.67-.834.476-.597.715-1.193.715-2.027V18.6c0-1.67.596-2.742 1.669-3.1-1.073-.477-1.67-1.55-1.67-3.1V4.888c0-.834-.238-1.55-.715-2.026-.477-.597-1.073-.835-1.669-.835h-2.146V0h2.146c1.192 0 2.265.477 3.1 1.312.835.834 1.312 2.026 1.312 3.457v7.273c0 .716.119 1.312.477 1.789.357.477.834.715 1.311.715v1.789c-.477 0-.835.238-1.192.715-.358.477-.477 1.073-.477 1.788v7.393c0 1.43-.477 2.504-1.312 3.457-.954.835-2.027 1.312-3.219 1.312h-2.146v-2.027zm17.884-7.75 1.193-1.55c.596.716 1.311 1.192 2.146 1.67.835.476 1.788.596 2.861.596.716 0 1.312-.12 1.789-.239.477-.12.954-.358 1.192-.715.358-.12.596-.477.716-.716.119-.357.238-.596.238-.954 0-.477-.12-.834-.358-1.192a2.784 2.784 0 0 0-.834-.835c-.358-.238-.835-.357-1.312-.596-.477-.238-.954-.357-1.55-.477-.596-.119-1.073-.238-1.55-.476a8.281 8.281 0 0 1-1.55-.597c-.477-.238-.954-.477-1.311-.834-.358-.358-.716-.716-.835-1.193-.238-.476-.358-1.073-.358-1.669 0-1.311.477-2.384 1.55-3.22 1.073-.834 2.385-1.191 3.935-1.191 2.385 0 4.292.715 5.723 2.265l-1.192 1.43c-1.193-1.31-2.743-1.907-4.65-1.907-.954 0-1.789.239-2.385.715-.596.477-.954 1.073-.954 1.789 0 .358.12.715.358 1.073s.477.477.835.715c.357.239.834.358 1.311.477.477.12.954.239 1.55.477.596.239 1.073.477 1.55.596a8.28 8.28 0 0 1 1.55.597c.477.238.954.476 1.312.834.357.358.715.715.834 1.192.12.477.358 1.073.358 1.67 0 .477-.12.954-.239 1.43-.119.477-.357.835-.596 1.312l-1.073 1.073a3.562 3.562 0 0 1-1.669.715c-.835.239-1.55.358-2.385.358-2.623 0-4.65-.834-6.2-2.623zm18.958 2.385V7.512h2.027v6.796h9.42V7.392h2.026v16.096h-2.027v-7.392h-9.419v7.392h-2.027v.12zm20.985 0V7.512h2.027v16.096h-2.027zm9.657 0V7.512h6.439c1.55 0 2.742.476 3.696 1.43.954.954 1.312 2.146 1.312 3.458a5.193 5.193 0 0 1-1.312 3.458c-.954.834-2.146 1.311-3.696 1.311h-4.531v6.439h-1.908zm2.027-8.227h4.173c.954 0 1.67-.239 2.385-.835.715-.596.954-1.311.954-2.265 0-.954-.358-1.67-.954-2.266-.596-.596-1.431-.834-2.385-.834h-4.173v6.2zm15.5 8.227V7.512h11.804v3.577h-7.631v2.503h7.512v3.577h-7.512v2.742h7.631v3.577h-11.804v.12zm18.123 0V7.512h4.174l6.557 8.823V7.512h4.173v16.096h-4.054l-6.796-9.3v9.3h-4.054zm20.866-8.108c0-1.192.238-2.385.715-3.458.477-1.073 1.073-1.907 1.908-2.623.835-.715 1.669-1.311 2.742-1.669 1.073-.358 2.146-.596 3.458-.596.835 0 1.669.12 2.385.358.715.238 1.43.476 1.907.834.596.358 1.073.835 1.431 1.192l1.073 1.431-3.458 1.789a4.103 4.103 0 0 0-1.43-1.431c-.597-.358-1.312-.596-2.027-.596-1.312 0-2.385.477-3.22 1.311-.834.835-1.311 2.027-1.311 3.339 0 1.311.477 2.384 1.311 3.338.835.835 1.908 1.312 3.22 1.312.596 0 1.073-.12 1.669-.239.596-.238.954-.477 1.311-.715v-1.192h-3.576v-3.577h7.75v6.438c-1.908 2.146-4.293 3.1-7.154 3.1-1.193 0-2.385-.238-3.458-.596a7.074 7.074 0 0 1-2.742-1.67c-.835-.715-1.431-1.55-1.908-2.622-.358-1.073-.596-2.266-.596-3.458zm22.058 8.108V7.512h4.173v16.096h-4.173zm10.85 0V7.512h4.292l6.558 8.823V7.512h4.173v16.096h-4.054l-6.796-9.3v9.3h-4.173zm21.7 0V7.512h11.803v3.577h-7.63v2.503h7.511v3.577h-7.511v2.742h7.63v3.577h-11.803v.12zm18.123-13.712c0-.715.238-1.43.834-1.908.596-.476 1.193-.834 1.908-.834.477 0 .954.12 1.431.358.477.238.715.596.954.953.238.358.357.835.357 1.431 0 .715-.238 1.43-.834 1.908-.597.477-1.193.835-1.908.835-.715 0-1.431-.239-1.908-.835-.477-.596-.834-1.193-.834-1.908zm.477 0c0 .596.238 1.192.715 1.67.477.476 1.073.715 1.669.715.596 0 1.192-.239 1.669-.716a2.353 2.353 0 0 0 .716-1.669c0-.715-.239-1.192-.716-1.67a2.356 2.356 0 0 0-1.669-.714c-.715 0-1.192.238-1.669.715-.477.358-.715.954-.715 1.67zm1.311 1.55v-3.1h1.312c.238 0 .477.12.715.239s.238.357.238.715-.119.596-.238.715c-.119.12-.358.239-.477.239l.835 1.311h-.596l-.835-1.311h-.596v1.311h-.358v-.119zm.358-1.55h.834c.12 0 .239 0 .358-.12.239-.238.239-.357.239-.476 0-.12 0-.358-.12-.477-.119-.12-.238-.12-.357-.12h-.835v1.193h-.119z",
11414
+ fill: "#162948"
11415
+ })));
11416
+ };
11417
+
11418
+ const styles$4 = createStyles({
11419
+ poweredByShipEngine: {
11420
+ display: "flex",
11421
+ alignItems: "center",
11422
+ justifyContent: "center",
11423
+ textAlign: "center",
11424
+ margin: "1rem 0",
11425
+ gap: "1rem",
11426
+ color: "#818F9C"
11427
+ }
11428
+ });
11429
+
11430
+ const PoweredByShipEngine = () => {
11431
+ const {
11432
+ t
11433
+ } = useTranslation();
11434
+ return jsxs("div", Object.assign({
11435
+ css: styles$4.poweredByShipEngine
11436
+ }, {
11437
+ children: [jsx(Typography, Object.assign({
11438
+ variant: "subtitle1"
11439
+ }, {
11440
+ children: t("powered-by")
11441
+ })), jsx(SvgShipengineLogo, {})]
11442
+ }));
11443
+ };
11444
+
10775
11445
  const RateForm = ({
10776
11446
  carriers,
10777
11447
  disabled,
@@ -10780,6 +11450,8 @@ const RateForm = ({
10780
11450
  displayableLabelErrors,
10781
11451
  features,
10782
11452
  labelErrors,
11453
+ labels,
11454
+ labelsLoading,
10783
11455
  isLoading,
10784
11456
  onSave,
10785
11457
  onSelectRate,
@@ -10790,6 +11462,7 @@ const RateForm = ({
10790
11462
  }) => {
10791
11463
  features = Object.assign({
10792
11464
  enableGlobalPostFiltering: false,
11465
+ labelLayout: false,
10793
11466
  nicknameRate: true,
10794
11467
  saveRate: true
10795
11468
  }, features !== null && features !== void 0 ? features : {});
@@ -10854,6 +11527,14 @@ const RateForm = ({
10854
11527
  index < 5 && rateOptions.length <= 6 || !option.requiresAcknowledgement && index < 6 && rateOptions.length > 6 || option.rateId === selectedRateId), [rateOptions, selectedRateId]);
10855
11528
  // When rateOptions update, handle scrolling and single-rate auto-selection and form reset
10856
11529
  useEffect(() => {
11530
+ if (!(rateOptions === null || rateOptions === void 0 ? void 0 : rateOptions.length)) {
11531
+ form.setValue("rate", {
11532
+ isAcknowledged: false,
11533
+ rateId: ""
11534
+ }, {
11535
+ shouldDirty: true
11536
+ });
11537
+ }
10857
11538
  if (rateOptions.length === 1) {
10858
11539
  form.setValue("rate", {
10859
11540
  isAcknowledged: !rateOptions[0].requiresAcknowledgement,
@@ -10887,6 +11568,7 @@ const RateForm = ({
10887
11568
  children: [!isLoading && !!rateOptions.length ? jsxs(Fragment, {
10888
11569
  children: [jsx(RateSelect, {
10889
11570
  control: form.control,
11571
+ displayErrors: false,
10890
11572
  label: "Rate",
10891
11573
  name: "rate",
10892
11574
  nicknameFeature:
@@ -10895,7 +11577,7 @@ const RateForm = ({
10895
11577
  onClick: onSelectRate,
10896
11578
  options: showHiddenRates ? rateOptions : filteredRateOptions
10897
11579
  }), rateOptions.some(option => option.requiresAcknowledgement) && rateOptions.length > 5 && jsx(Link, Object.assign({
10898
- css: styles$4.showMoreOrLessRatesButton,
11580
+ css: styles$5.showMoreOrLessRatesButton,
10899
11581
  onClick: () => {
10900
11582
  var _a;
10901
11583
  setShowHiddenRates(!showHiddenRates);
@@ -10916,7 +11598,7 @@ const RateForm = ({
10916
11598
  }))
10917
11599
  }))]
10918
11600
  }) : !isLoading && !!allDisplayableErrors.length ? null : jsxs("article", Object.assign({
10919
- css: styles$4.ratesInterstitial,
11601
+ css: styles$5.ratesInterstitial,
10920
11602
  role: "presentation"
10921
11603
  }, {
10922
11604
  children: [jsx(Cube, {
@@ -10930,17 +11612,23 @@ const RateForm = ({
10930
11612
  children: [displayableErrors, outOfBandDisplayableErrors, displayableLabelErrors]
10931
11613
  })
10932
11614
  }))]
11615
+ })), features.labelLayout && !labelsLoading && !(labels === null || labels === void 0 ? void 0 : labels.length) && jsx(Section, Object.assign({
11616
+ title: t("manage-defaults:label.title")
11617
+ }, {
11618
+ children: jsx(LabelLayout, {
11619
+ display: "purchase"
11620
+ })
10933
11621
  })), jsx(FundAndPurchase, {
10934
11622
  carrierId: selectedRate === null || selectedRate === void 0 ? void 0 : selectedRate.carrierId,
10935
11623
  control: form.control,
10936
- css: styles$4.fundAndPurchase,
11624
+ css: styles$5.fundAndPurchase,
10937
11625
  disabled: disabled,
10938
11626
  isFundingEnabled: features === null || features === void 0 ? void 0 : features.enableFunding,
10939
11627
  isFundingRequired: (selectedRate === null || selectedRate === void 0 ? void 0 : selectedRate.balance) !== undefined && !!selectedRate.requiresFundedAmount,
10940
11628
  onPurchase: handleSubmit,
10941
11629
  onSave: handleSaveRate,
10942
11630
  purchaseAmount: getTotalRateAmount(selectedRate)
10943
- })]
11631
+ }), jsx(Spacer, {}), jsx(PoweredByShipEngine, {})]
10944
11632
  }));
10945
11633
  };
10946
11634
 
@@ -11505,13 +12193,10 @@ const ShipmentForm = ({
11505
12193
  } = useTranslation(["purchase-label"]);
11506
12194
  const [requireMeasurements, setRequireMeasurements] = useState(true);
11507
12195
  const [insuranceEnabled, setInsuranceEnabled] = useState(false);
11508
- const isCustomsRequired = useMemo(() => {
11509
- return shipment ? getIsCustomsRequiredForShipment(shipment) : false;
11510
- }, [shipment]);
11511
- const isContentDescriptionRequired = useMemo(() => {
11512
- var _a;
11513
- return shipment && ((_a = shipment.shipFrom) === null || _a === void 0 ? void 0 : _a.countryCode) === "MX" || (shipment === null || shipment === void 0 ? void 0 : shipment.shipTo.countryCode) === "MX";
11514
- }, [shipment]);
12196
+ const {
12197
+ isContentDescriptionRequired,
12198
+ isCustomsRequired
12199
+ } = useShipmentMetadata(shipment);
11515
12200
  const shipmentSchema = useMemo(() => getShipmentSchema({
11516
12201
  isContentDescriptionRequired,
11517
12202
  isCustomsRequired,
@@ -11522,7 +12207,7 @@ const ShipmentForm = ({
11522
12207
  const form = useForm({
11523
12208
  defaultValues: {
11524
12209
  __mode: features.browseRates ? "browse_rates" : "select_service",
11525
- shipDate: minimumShipDate.toLocaleDateString("en-US")
12210
+ shipDate: formatUSADate(minimumShipDate || new Date())
11526
12211
  },
11527
12212
  resolver: validationResolver(shipmentSchema)
11528
12213
  });
@@ -11547,10 +12232,6 @@ const ShipmentForm = ({
11547
12232
  return (carriers !== null && carriers !== void 0 ? carriers : []).filter(c => carrierIds.includes(c.carrierId));
11548
12233
  }, [carrierIds, carriers, selectedMode]);
11549
12234
  const nonAddressValidationErrors = errors === null || errors === void 0 ? void 0 : errors.filter(e => e.errorCode !== "invalid_address");
11550
- const isInternationalShipment = useMemo(() => {
11551
- return shipment ? getIsInternationalShipment(shipment) : false;
11552
- }, [shipment]);
11553
- const isPoBoxShipment = useMemo(() => (shipment === null || shipment === void 0 ? void 0 : shipment.shipTo) && isPoBoxAddress(shipment.shipTo), [shipment === null || shipment === void 0 ? void 0 : shipment.shipTo]);
11554
12235
  const confirmationOptions = useConfirmationOptions();
11555
12236
  const customsContentsOptions = useCustomsContentsOptions();
11556
12237
  const customsNonDeliveryOptions = useCustomsNonDeliveryOptions();
@@ -11558,9 +12239,9 @@ const ShipmentForm = ({
11558
12239
  includeShipsuranceInsurance: features === null || features === void 0 ? void 0 : features.includeShipsuranceInsurance,
11559
12240
  includeThirdPartyInsurance: features === null || features === void 0 ? void 0 : features.includeThirdPartyInsurance
11560
12241
  });
11561
- const packageOptions = usePackageOptions(selectedCarriers, customPackageTypes, isPoBoxShipment);
11562
- const serviceCodeOptions = useServiceCodeOptions(carriers, !isInternationalShipment, isPoBoxShipment);
11563
- const shippingPresetOptions = useShippingPresetsOptions(shippingPresets, isInternationalShipment);
12242
+ const packageOptions = usePackageOptions(selectedCarriers, customPackageTypes, shipment);
12243
+ const serviceCodeOptions = useServiceCodeOptions(carriers, shipment);
12244
+ const shippingPresetOptions = useShippingPresetsOptions(shippingPresets, shipment);
11564
12245
  const warehouseOptions = useWarehouseOptions(warehouses);
11565
12246
  const [showItems, setShowItems] = useState(false);
11566
12247
  const [showApplyPreset, setShowApplyPreset] = useState(false);
@@ -11658,7 +12339,7 @@ const ShipmentForm = ({
11658
12339
  carrierId: updatedShipment.carrierId,
11659
12340
  serviceCode: updatedShipment.serviceCode
11660
12341
  } : undefined,
11661
- shipDate: mostRecent(omitTime(updatedShipment.shipDate), minimumShipDate).toLocaleDateString("en-US"),
12342
+ shipDate: formatUSADate(mostRecent(omitTime(updatedShipment.shipDate), minimumShipDate)),
11662
12343
  shipmentId: updatedShipment.shipmentId,
11663
12344
  warehouseId: updatedShipment.warehouseId
11664
12345
  }));
@@ -11668,7 +12349,7 @@ const ShipmentForm = ({
11668
12349
  // Hydrate only the customs items portion of the shipment form
11669
12350
  const hydrateCustomsItems = useCallback(updatedShipment => {
11670
12351
  const formCustoms = form.getValues("customs");
11671
- if (updatedShipment.customs && !_$2.isEqual(formCustoms === null || formCustoms === void 0 ? void 0 : formCustoms.customsItems, updatedShipment.customs.customsItems)) {
12352
+ if (updatedShipment.customs && !_$3.isEqual(formCustoms === null || formCustoms === void 0 ? void 0 : formCustoms.customsItems, updatedShipment.customs.customsItems)) {
11672
12353
  form.setValue("customs.customsItems", updatedShipment.customs.customsItems.map(ci => Object.assign(Object.assign({}, ci), {
11673
12354
  value: typeof ci.value === "number" ? ci.value : ci.value.amount
11674
12355
  })), {
@@ -11709,7 +12390,7 @@ const ShipmentForm = ({
11709
12390
  // Autopopulate package dimensions if user selects a custom package
11710
12391
  useEffect(() => {
11711
12392
  const customPackage = findCustomPackage(selectedPackage === null || selectedPackage === void 0 ? void 0 : selectedPackage.code);
11712
- if ((customPackage === null || customPackage === void 0 ? void 0 : customPackage.dimensions) && !_$2.isEqual(customPackage === null || customPackage === void 0 ? void 0 : customPackage.dimensions, form.getValues("packages.0.dimensions"))) {
12393
+ if ((customPackage === null || customPackage === void 0 ? void 0 : customPackage.dimensions) && !_$3.isEqual(customPackage === null || customPackage === void 0 ? void 0 : customPackage.dimensions, form.getValues("packages.0.dimensions"))) {
11713
12394
  const {
11714
12395
  length,
11715
12396
  width,
@@ -11820,6 +12501,7 @@ const ShipmentForm = ({
11820
12501
  });
11821
12502
  if (errors) throw new Error(errors.map(e => e.message).join(", "));
11822
12503
  if (!shipment) throw new Error("errorMessages.unableToLoad.shipment");
12504
+ const isEmptyShipTo = Object.entries(shipment.shipTo).every(([key, value]) => key === "countryCode" || [null, "", "unknown"].includes(value));
11823
12505
  return jsxs("form", Object.assign({
11824
12506
  id: "shipment-form",
11825
12507
  onSubmit: formLogger.capture(handleSubmit)
@@ -11843,7 +12525,12 @@ const ShipmentForm = ({
11843
12525
  }), jsx(FieldLabel, Object.assign({
11844
12526
  label: !isEditShipFormToOpen ? "purchase-label:fields.shipTo" : ""
11845
12527
  }, {
11846
- children: !isEditShipFormToOpen && (addressPreference ? jsx(AddressPreferenceDisplay, {
12528
+ children: !isEditShipFormToOpen && (isEmptyShipTo ? jsx(Button, Object.assign({
12529
+ onClick: toggleIsEditShipFormToOpen,
12530
+ variant: ButtonVariant.OUTLINED
12531
+ }, {
12532
+ children: t("purchase-label:fields:addShipToAddress")
12533
+ })) : addressPreference ? jsx(AddressPreferenceDisplay, {
11847
12534
  addressPreference: addressPreference,
11848
12535
  onChangePreference: handleChangePreference,
11849
12536
  onEditAddress: () => {
@@ -12006,7 +12693,7 @@ const ShipmentForm = ({
12006
12693
  onClick: () => {
12007
12694
  handleApplyPreset(preset.value);
12008
12695
  },
12009
- selected: _$2.isEqual(selectedPreset, preset.value),
12696
+ selected: _$3.isEqual(selectedPreset, preset.value),
12010
12697
  value: JSON.stringify(preset.value)
12011
12698
  }, {
12012
12699
  children: preset.description
@@ -12448,7 +13135,7 @@ const Shipment = ({
12448
13135
  })), "representative."]
12449
13136
  }))
12450
13137
  }))
12451
- }))]
13138
+ })), jsx(Spacer, {}), jsx(PoweredByShipEngine, {})]
12452
13139
  });
12453
13140
  };
12454
13141
 
@@ -12476,115 +13163,6 @@ const SuspendShipment = ({
12476
13163
  }));
12477
13164
  };
12478
13165
 
12479
- const VoidLabel = ({
12480
- onComplete,
12481
- onSubmit,
12482
- onViewShipment,
12483
- shipment,
12484
- voidRequest
12485
- }) => {
12486
- const {
12487
- t
12488
- } = useTranslation(["common", "void-label"]);
12489
- const [isSubmitting, setIsSubmitting] = useState(false);
12490
- const handleSubmit = useCallback(() => __awaiter(void 0, void 0, void 0, function* () {
12491
- setIsSubmitting(true);
12492
- yield onSubmit();
12493
- setIsSubmitting(false);
12494
- }), [onSubmit]);
12495
- return jsxs(Fragment, {
12496
- children: [jsx(Section, {
12497
- children: voidRequest ? jsxs("section", Object.assign({
12498
- css: {
12499
- textAlign: "center",
12500
- width: "100%"
12501
- }
12502
- }, {
12503
- children: [jsx(Icon, {
12504
- css: theme => ({
12505
- color: (voidRequest === null || voidRequest === void 0 ? void 0 : voidRequest.approved) ? theme.palette.success.main : theme.palette.error.main
12506
- }),
12507
- name: (voidRequest === null || voidRequest === void 0 ? void 0 : voidRequest.approved) ? IconNames.CHECK_FILLED : IconNames.ALERT,
12508
- size: IconSize.SIZE_LARGE
12509
- }), (voidRequest === null || voidRequest === void 0 ? void 0 : voidRequest.approved) ? jsxs(Fragment, {
12510
- children: [jsx(Typography, Object.assign({
12511
- component: "h2"
12512
- }, {
12513
- children: t("void-label:resultTitles.approved")
12514
- })), jsx(Typography, Object.assign({
12515
- variant: "body1"
12516
- }, {
12517
- children: t("void-label:resultMessages.approved")
12518
- }))]
12519
- }) : jsxs(Fragment, {
12520
- children: [jsx(Typography, Object.assign({
12521
- component: "h2"
12522
- }, {
12523
- children: t("void-label:resultTitles.rejected")
12524
- })), jsx(Typography, Object.assign({
12525
- variant: "body1"
12526
- }, {
12527
- children: jsx("p", {
12528
- dangerouslySetInnerHTML: {
12529
- __html: t("void-label:resultMessages.rejected")
12530
- }
12531
- })
12532
- }))]
12533
- })]
12534
- })) : jsxs(Fragment, {
12535
- children: [jsx(Typography, Object.assign({
12536
- variant: "body1"
12537
- }, {
12538
- children: t("void-label:refund_process")
12539
- })), jsx(Typography, Object.assign({
12540
- component: "p",
12541
- variant: "body1"
12542
- }, {
12543
- children: t("void-label:refund_rules")
12544
- }))]
12545
- })
12546
- }), jsx(BottomSheet, Object.assign({
12547
- alwaysVisible: true,
12548
- css: theme => ({
12549
- borderTop: `1px solid ${theme.palette.gray.ultraLight}`,
12550
- boxShadow: "none",
12551
- position: "static"
12552
- })
12553
- }, {
12554
- children: (voidRequest === null || voidRequest === void 0 ? void 0 : voidRequest.approved) ?
12555
- // Label has been voided
12556
- jsxs(ButtonGroup, {
12557
- children: [jsx(Button, Object.assign({
12558
- bold: false,
12559
- onClick: () => shipment && onComplete(voidRequest, shipment),
12560
- type: "button",
12561
- variant: ButtonVariant.OUTLINED
12562
- }, {
12563
- children: t("void-label:actions.complete")
12564
- })), jsx(Button, Object.assign({
12565
- bold: false,
12566
- isFullWidth: true,
12567
- onClick: () => shipment && onViewShipment(shipment),
12568
- type: "button"
12569
- }, {
12570
- children: t("void-label:actions.viewShipment")
12571
- }))]
12572
- }) :
12573
- // Label has not yet been voided
12574
- jsx(Button, Object.assign({
12575
- bold: false,
12576
- disabled: isSubmitting,
12577
- isFullWidth: true,
12578
- isLoading: isSubmitting,
12579
- onClick: handleSubmit,
12580
- type: "submit"
12581
- }, {
12582
- children: t("void-label:actions.confirmVoid")
12583
- }))
12584
- }))]
12585
- });
12586
- };
12587
-
12588
13166
  var index = /*#__PURE__*/Object.freeze({
12589
13167
  __proto__: null,
12590
13168
  AddCarrierForm: AddCarrierForm,
@@ -12617,9 +13195,8 @@ var index = /*#__PURE__*/Object.freeze({
12617
13195
  Shipment: Shipment,
12618
13196
  SuspendShipment: SuspendShipment,
12619
13197
  WarehouseForm: WarehouseForm,
12620
- VoidLabel: VoidLabel,
12621
13198
  WalletForm: WalletForm,
12622
- styles: styles$a,
13199
+ styles: styles$d,
12623
13200
  billingAddressSchema: billingAddressSchema,
12624
13201
  walletSchema: walletSchema,
12625
13202
  BillingFields: BillingFields,
@@ -12904,6 +13481,7 @@ const DateRangeCombo = ({
12904
13481
  dateFormat: "MM/dd/yyyy",
12905
13482
  isClearable: true,
12906
13483
  label: t("wallet-history:actions.chooseDate"),
13484
+ locale: LOCALE,
12907
13485
  maxDate: new Date(),
12908
13486
  onClickConfirm: dates => {
12909
13487
  if (Array.isArray(dates) && dates.length === 2 && dates[1] !== null) handleConfirmCustomRange(dates);
@@ -13166,9 +13744,11 @@ var common = {
13166
13744
  invalidNameOrCompany: "Recipient name and company name (if provided) must have two characters in first and last name.",
13167
13745
  noWarehouses: "You must have an active Ship From Location to use this feature.",
13168
13746
  unableToLoad: {
13747
+ accountSettings: "Unable to load account settings",
13169
13748
  autoFundingSettings: "Unable to load auto funding settings",
13170
13749
  carrier: "Unable to load carrier",
13171
13750
  carriers: "Unable to load carriers",
13751
+ label: "Unable to load label",
13172
13752
  salesOrder: "Unable to load order",
13173
13753
  shipment: "Unable to load shipment",
13174
13754
  warehouses: "Unable to load warehouses"
@@ -13194,10 +13774,12 @@ var common = {
13194
13774
  thirdParty: "Third Party"
13195
13775
  },
13196
13776
  loading: {
13777
+ accountSettings: "Loading account settings...",
13197
13778
  carrier: "Loading carrier...",
13198
13779
  carriers: "Loading carriers...",
13199
13780
  data: "Loading...",
13200
13781
  importingSalesOrder: "Importing order...",
13782
+ label: "Loading label...",
13201
13783
  onboarding: "Loading onboarding...",
13202
13784
  salesOrder: "Loading order...",
13203
13785
  shipment: "Loading shipment...",
@@ -13224,6 +13806,7 @@ var common = {
13224
13806
  packageCodes: {
13225
13807
  "package": "Custom"
13226
13808
  },
13809
+ "powered-by": "Powered by",
13227
13810
  schema: {
13228
13811
  optionalLabel: "{{fieldLabel}} (optional)"
13229
13812
  },
@@ -13294,21 +13877,8 @@ var listCarriers$1 = {
13294
13877
 
13295
13878
  var manageDefaults = {
13296
13879
  "manage-defaults": {
13297
- units: {
13298
- title: "Units of Measure",
13299
- dimensions: {
13300
- title: "Dimensions",
13301
- standard: "Inches",
13302
- metric: "Centimeters"
13303
- },
13304
- weight: {
13305
- title: "Weight",
13306
- standard: "Pounds & Ounces",
13307
- g: "Grams",
13308
- kg: "Kilograms"
13309
- }
13310
- },
13311
13880
  label: {
13881
+ title: "Label Printing",
13312
13882
  letter: {
13313
13883
  title: "Letter (8.5 x 11 inch)",
13314
13884
  description: "For desktop printers"
@@ -13320,8 +13890,26 @@ var manageDefaults = {
13320
13890
  thermal: {
13321
13891
  title: "Thermal (4 x 6 inch)",
13322
13892
  description: "For label printers"
13893
+ }
13894
+ },
13895
+ status: {
13896
+ saving: "Saving...",
13897
+ saved: "Saved",
13898
+ savingFailed: "Saving Failed"
13899
+ },
13900
+ units: {
13901
+ title: "Units of Measure",
13902
+ dimensions: {
13903
+ title: "Dimensions",
13904
+ standard: "Inches",
13905
+ metric: "Centimeters"
13323
13906
  },
13324
- title: "Shipping Label Layout"
13907
+ weight: {
13908
+ title: "Weight",
13909
+ standard: "Pounds & Ounces",
13910
+ g: "Grams",
13911
+ kg: "Kilograms"
13912
+ }
13325
13913
  }
13326
13914
  }
13327
13915
  };
@@ -13482,6 +14070,7 @@ var purchaseLabel$1 = {
13482
14070
  shipDate: "Ship Date",
13483
14071
  service: "Service",
13484
14072
  shipTo: "Ship To",
14073
+ addShipToAddress: "Add Ship To Address",
13485
14074
  warehouse: "Ship From",
13486
14075
  weight: {
13487
14076
  whole: "Pounds",
@@ -13507,7 +14096,8 @@ var purchaseLabel$1 = {
13507
14096
  needToAcknowledge: "Need to accept Rate Compliance Agreement"
13508
14097
  },
13509
14098
  rates: {
13510
- uspsMediaMailAcknowledgement: "I confirm that this package is compliant with <1>USPS guidelines for Media Mail®</1>"
14099
+ uspsMediaMailAcknowledgement: "I confirm that this package is compliant with <1>USPS guidelines for Media Mail®</1>",
14100
+ uspsFirstClassMailAcknowledgement_leof: "I understand the limitations and confirm that this package is compliant with USPS guidelines for First Class Mail Large Envelopes or Flats."
13511
14101
  },
13512
14102
  shipToAddressFormFields: "Ship To Address Form Fields",
13513
14103
  sections: {
@@ -13616,6 +14206,9 @@ var voidLabel$1 = {
13616
14206
  confirmVoid: "Confirm Void",
13617
14207
  viewShipment: "View Shipment"
13618
14208
  },
14209
+ errorMessages: {
14210
+ labelIdRequired: "A label id is required"
14211
+ },
13619
14212
  resultMessages: {
13620
14213
  approved: "Your refund request has been submitted to the carrier.",
13621
14214
  rejected: "Your label may have already been scanned by the carrier or the label type is ineligible for voiding.<br /><br />Contact your carrier for assistance with shipments currently in transit."
@@ -13922,7 +14515,7 @@ const useAddress = ({
13922
14515
  // If the address is international, we always default to the original due to issues with SE-API's validation
13923
14516
  const selectionSource = isDomesticAddress(originalAddress) && status !== "error" ? matchedAddress ? "matchedAddress" : "originalAddress" : "originalAddress";
13924
14517
  const alternativeSource = selectionSource === "matchedAddress" ? "originalAddress" : "matchedAddress";
13925
- const newAddressPreference = Object.assign(Object.assign(Object.assign({}, validation), _$2.isEqual(originalAddress, matchedAddress) ? {
14518
+ const newAddressPreference = Object.assign(Object.assign(Object.assign({}, validation), _$3.isEqual(originalAddress, matchedAddress) ? {
13926
14519
  // An exact match in SE-API will *sometimes* return a matchedAddress exactly mirroring the originalAddress,
13927
14520
  // but it's supposed to return no matchedAddress at all. We handle this case by placing the fallbackAddress
13928
14521
  // (if given) into the originalAddress slot.
@@ -14117,7 +14710,7 @@ const useScrubErrors = ({
14117
14710
  };
14118
14711
 
14119
14712
  var usps_first_class_mail = [
14120
- "First Class Mail packages must weigh less than 16 oz. If the package weight exceeds the weight provided when buying the label, USPS will charge an adjustment fee."
14713
+ "First Class Mail shipments must weigh less than {{weight}} oz. Shipments exceeding the weight entered when buying the label will be charged an adjustment fee by USPS."
14121
14714
  ];
14122
14715
  var usps_media_mail = [
14123
14716
  "Media Mail® can only be used for shipping books, sound recordings, manuscripts, printed music, and other media in packages weighing 70 lbs. or less. Packages containing unsupported items may be subject to post-billing adjustment fees or returned to the sender."
@@ -14157,7 +14750,7 @@ var rateMessages = {
14157
14750
  "First Class Mail letter is not eligible for USPS tracking nor refund if unused. If the package weight exceeds the weight provided when buying the label, USPS will charge an adjustment fee."
14158
14751
  ],
14159
14752
  "usps_first_class_mail:large_envelope_or_flat": [
14160
- "First Class Mail large envelope or flats is not eligible for USPS tracking nor refund if unused. If the package weight exceeds the weight provided when buying the label, USPS will charge an adjustment fee."
14753
+ "Tracking and refunds are not available for First Class Mail Large Envelopes or Flats labels."
14161
14754
  ],
14162
14755
  usps_first_class_mail: usps_first_class_mail,
14163
14756
  usps_media_mail: usps_media_mail,
@@ -14166,10 +14759,25 @@ var rateMessages = {
14166
14759
  usps_priority_mail_express: usps_priority_mail_express,
14167
14760
  ups_ground: ups_ground,
14168
14761
  ups_2nd_day_air: ups_2nd_day_air,
14762
+ "ups_2nd_day_air:Saturday": [
14763
+ "Additional fees may apply post-delivery if picked up on a Saturday."
14764
+ ],
14169
14765
  ups_next_day_air_saver: ups_next_day_air_saver,
14766
+ "ups_next_day_air_saver:Saturday": [
14767
+ "Additional fees may apply post-delivery if picked up on a Saturday."
14768
+ ],
14170
14769
  ups_next_day_air: ups_next_day_air,
14770
+ "ups_next_day_air:Saturday": [
14771
+ "Additional fees may apply post-delivery if picked up on a Saturday."
14772
+ ],
14171
14773
  ups_next_day_air_early_am: ups_next_day_air_early_am,
14774
+ "ups_next_day_air_early_am:Saturday": [
14775
+ "Additional fees may apply post-delivery if picked up on a Saturday."
14776
+ ],
14172
14777
  ups_2nd_day_air_am: ups_2nd_day_air_am,
14778
+ "ups_2nd_day_air_am:Saturday": [
14779
+ "Additional fees may apply post-delivery if picked up on a Saturday."
14780
+ ],
14173
14781
  ups_3_day_select: ups_3_day_select
14174
14782
  };
14175
14783
 
@@ -14203,16 +14811,24 @@ const useRequestRates = ({
14203
14811
  if (result) yield onRatesCalculated === null || onRatesCalculated === void 0 ? void 0 : onRatesCalculated(result.rateResponse.rates, shipment);
14204
14812
  }), [calculateRates, carriers, customPackageTypes, onRatesCalculated]);
14205
14813
  let ratesResponse = ratedShipment === null || ratedShipment === void 0 ? void 0 : ratedShipment.rateResponse;
14814
+ const shipDay = useMemo(() => {
14815
+ if (ratedShipment === null || ratedShipment === void 0 ? void 0 : ratedShipment.shipDate) {
14816
+ return omitTime(ratedShipment === null || ratedShipment === void 0 ? void 0 : ratedShipment.shipDate).toLocaleString("en-us", {
14817
+ weekday: "long"
14818
+ });
14819
+ }
14820
+ return;
14821
+ }, [ratedShipment]);
14206
14822
  ratesResponse = useMemo(() => ratesResponse && Object.assign(Object.assign({}, ratesResponse), {
14207
14823
  rates: ratesResponse.rates.map(rate => {
14208
- var _a, _b;
14824
+ var _a, _b, _c;
14209
14825
  return Object.assign(Object.assign({}, rate), {
14210
14826
  warningMessages: [
14211
- // add additional rateMessages based on combinations of serviceCode and packageType
14212
- ...((_a = rateMessages[`${rate.serviceCode}:${rate.packageType}`]) !== null && _a !== void 0 ? _a : []), ...((_b = rateMessages[rate.serviceCode]) !== null && _b !== void 0 ? _b : []), ...rate.warningMessages]
14827
+ // add additional rateMessages based on combinations of serviceCode, packageType and shipDay
14828
+ ...((_a = rateMessages[`${rate.serviceCode}:${shipDay}`]) !== null && _a !== void 0 ? _a : []), ...((_b = rateMessages[`${rate.serviceCode}:${rate.packageType}`]) !== null && _b !== void 0 ? _b : []), ...((_c = rateMessages[rate.serviceCode]) !== null && _c !== void 0 ? _c : []), ...rate.warningMessages]
14213
14829
  });
14214
14830
  })
14215
- }), [ratesResponse]);
14831
+ }), [ratesResponse, shipDay]);
14216
14832
  return {
14217
14833
  ratesCalculating,
14218
14834
  ratesErrors,
@@ -14271,6 +14887,10 @@ const useRatesForm = ({
14271
14887
  const {
14272
14888
  data: carriers
14273
14889
  } = useListCarriers();
14890
+ const {
14891
+ data: labels,
14892
+ isLoading: labelsLoading
14893
+ } = useListLabels();
14274
14894
  const {
14275
14895
  mutateAsync: updateShipment
14276
14896
  } = useUpdateSalesOrderShipment();
@@ -14371,6 +14991,8 @@ const useRatesForm = ({
14371
14991
  errors: errors.length > 0 ? errors : undefined,
14372
14992
  isLoading: ratesCalculating,
14373
14993
  labelErrors: (labelErrors === null || labelErrors === void 0 ? void 0 : labelErrors.length) ? labelErrors : undefined,
14994
+ labels,
14995
+ labelsLoading,
14374
14996
  onSave: handleSave,
14375
14997
  onSubmit: handleSubmit,
14376
14998
  rates: ratesResponse === null || ratesResponse === void 0 ? void 0 : ratesResponse.rates,
@@ -14753,15 +15375,61 @@ const PurchaseLabelBySalesOrder = _a => {
14753
15375
  }));
14754
15376
  };
14755
15377
 
14756
- const useLoadShipment = ({
14757
- shipmentId
14758
- }) => {
15378
+ let shipmentsCreated = 0;
15379
+ const useGetOrCreateShipment = shipmentId => {
15380
+ const {
15381
+ client
15382
+ } = useShipEngine();
15383
+ const shipmentCreation = useMemo(() => {
15384
+ return ++shipmentsCreated;
15385
+ },
15386
+ // eslint-disable-next-line react-hooks/exhaustive-deps
15387
+ []);
15388
+ return useQuery({
15389
+ onError,
15390
+ retry: shipmentId !== undefined,
15391
+ queryFn: () => __awaiter(void 0, void 0, void 0, function* () {
15392
+ var _a;
15393
+ if (shipmentId) {
15394
+ return (yield client.salesOrderShipments.get(shipmentId)).data;
15395
+ } else {
15396
+ const warehouses = (yield client.warehouses.list()).data.warehouses;
15397
+ const defaultOrFirstWarehouse = (_a = warehouses.find(warehouse => warehouse.isDefault)) !== null && _a !== void 0 ? _a : warehouses[0];
15398
+ if (defaultOrFirstWarehouse === undefined) {
15399
+ throw [CodedError.fromObject({
15400
+ message: "errorMessages.noWarehouses",
15401
+ errorType: "unknown",
15402
+ errorCode: "unknown",
15403
+ errorSource: "client"
15404
+ })];
15405
+ }
15406
+ const shipTo = {
15407
+ addressLine1: "",
15408
+ cityLocality: "",
15409
+ countryCode: "",
15410
+ name: "",
15411
+ phone: "",
15412
+ postalCode: "",
15413
+ stateProvince: ""
15414
+ };
15415
+ const newShipment = yield client.shipments.create({
15416
+ shipTo: shipTo,
15417
+ warehouseId: defaultOrFirstWarehouse.warehouseId
15418
+ });
15419
+ return newShipment.data.shipments[0];
15420
+ }
15421
+ }),
15422
+ queryKey: ["useGetOrCreateShipment", shipmentId || `--${shipmentCreation}`]
15423
+ });
15424
+ };
15425
+
15426
+ const useLoadOrCreateShipment = shipmentId => {
14759
15427
  const {
14760
15428
  data: shipment,
14761
15429
  error: loadShipmentErrors,
14762
15430
  refetch: refetchShipment,
14763
15431
  isLoading
14764
- } = useGetShipment(shipmentId);
15432
+ } = useGetOrCreateShipment(shipmentId);
14765
15433
  const errors = [...(loadShipmentErrors !== null && loadShipmentErrors !== void 0 ? loadShipmentErrors : [])];
14766
15434
  return {
14767
15435
  errors: errors.length > 0 ? errors : undefined,
@@ -14773,15 +15441,12 @@ const useLoadShipment = ({
14773
15441
 
14774
15442
  const PurchaseLabelByShipment = _a => {
14775
15443
  var {
14776
- shipmentId,
14777
15444
  onLoad,
14778
15445
  onShipmentUpdated,
14779
15446
  features
14780
15447
  } = _a,
14781
- props = __rest(_a, ["shipmentId", "onLoad", "onShipmentUpdated", "features"]);
14782
- const _b = useLoadShipment({
14783
- shipmentId
14784
- }),
15448
+ props = __rest(_a, ["onLoad", "onShipmentUpdated", "features"]);
15449
+ const _b = useLoadOrCreateShipment("shipmentId" in props ? props.shipmentId : undefined),
14785
15450
  {
14786
15451
  shipment
14787
15452
  } = _b,
@@ -14813,16 +15478,11 @@ const PurchaseLabelByShipment = _a => {
14813
15478
  };
14814
15479
 
14815
15480
  const Component$2 = _a => {
14816
- var {
14817
- shipmentId
14818
- } = _a,
14819
- props = __rest(_a, ["shipmentId"]);
14820
- if (shipmentId) {
14821
- return jsx(PurchaseLabelByShipment, Object.assign({
14822
- shipmentId: shipmentId
14823
- }, props));
14824
- } else {
15481
+ var props = __rest(_a, []);
15482
+ if ("salesOrderId" in props) {
14825
15483
  return jsx(PurchaseLabelBySalesOrder, Object.assign({}, props));
15484
+ } else {
15485
+ return jsx(PurchaseLabelByShipment, Object.assign({}, props));
14826
15486
  }
14827
15487
  };
14828
15488
  const Element$2 = alchemy.createElement(Component$2, ErrorFallback, {
@@ -14896,6 +15556,111 @@ var viewShipment = /*#__PURE__*/Object.freeze({
14896
15556
  Element: Element$1
14897
15557
  });
14898
15558
 
15559
+ const Actions = ({
15560
+ onComplete,
15561
+ onSubmit,
15562
+ onViewShipment,
15563
+ shipment,
15564
+ voidRequest
15565
+ }) => {
15566
+ const {
15567
+ t
15568
+ } = useTranslation(["common", "void-label"]);
15569
+ const [isSubmitting, setIsSubmitting] = useState(false);
15570
+ const handleSubmit = useCallback(() => __awaiter(void 0, void 0, void 0, function* () {
15571
+ setIsSubmitting(true);
15572
+ yield onSubmit();
15573
+ setIsSubmitting(false);
15574
+ }), [onSubmit]);
15575
+ return jsx(BottomSheet, Object.assign({
15576
+ alwaysVisible: true,
15577
+ css: theme => ({
15578
+ borderTop: `1px solid ${theme.palette.gray.ultraLight}`,
15579
+ boxShadow: "none",
15580
+ position: "static"
15581
+ })
15582
+ }, {
15583
+ children: (voidRequest === null || voidRequest === void 0 ? void 0 : voidRequest.approved) ?
15584
+ // The void request has been approved
15585
+ jsxs(ButtonGroup, {
15586
+ children: [jsx(Button, Object.assign({
15587
+ bold: false,
15588
+ onClick: () => onComplete(voidRequest, shipment),
15589
+ variant: ButtonVariant.OUTLINED
15590
+ }, {
15591
+ children: t("void-label:actions.complete")
15592
+ })), jsx(Button, Object.assign({
15593
+ bold: false,
15594
+ isFullWidth: true,
15595
+ onClick: () => onViewShipment(shipment)
15596
+ }, {
15597
+ children: t("void-label:actions.viewShipment")
15598
+ }))]
15599
+ }) :
15600
+ // The void request has yet to be made or was rejected
15601
+ jsx(Button, Object.assign({
15602
+ bold: false,
15603
+ isFullWidth: true,
15604
+ isLoading: isSubmitting,
15605
+ onClick: handleSubmit
15606
+ }, {
15607
+ children: t("void-label:actions.confirmVoid")
15608
+ }))
15609
+ }));
15610
+ };
15611
+
15612
+ const Message = ({
15613
+ voidRequest
15614
+ }) => {
15615
+ const {
15616
+ t
15617
+ } = useTranslation(["common", "void-label"]);
15618
+ return jsx(Section, {
15619
+ children: voidRequest ? jsxs("section", Object.assign({
15620
+ css: {
15621
+ textAlign: "center",
15622
+ width: "100%"
15623
+ }
15624
+ }, {
15625
+ children: [jsx(Icon, {
15626
+ css: theme => ({
15627
+ color: (voidRequest === null || voidRequest === void 0 ? void 0 : voidRequest.approved) ? theme.palette.success.main : theme.palette.error.main
15628
+ }),
15629
+ name: (voidRequest === null || voidRequest === void 0 ? void 0 : voidRequest.approved) ? IconNames.CHECK_FILLED : IconNames.ALERT,
15630
+ size: IconSize.SIZE_LARGE
15631
+ }), (voidRequest === null || voidRequest === void 0 ? void 0 : voidRequest.approved) ? jsxs(Fragment, {
15632
+ children: [jsx(Typography, Object.assign({
15633
+ component: "h2"
15634
+ }, {
15635
+ children: t("void-label:resultTitles.approved")
15636
+ })), jsx(Typography, {
15637
+ children: t("void-label:resultMessages.approved")
15638
+ })]
15639
+ }) : jsxs(Fragment, {
15640
+ children: [jsx(Typography, Object.assign({
15641
+ component: "h2"
15642
+ }, {
15643
+ children: t("void-label:resultTitles.rejected")
15644
+ })), jsx(Typography, {
15645
+ children: jsx("p", {
15646
+ dangerouslySetInnerHTML: {
15647
+ __html: t("void-label:resultMessages.rejected")
15648
+ }
15649
+ })
15650
+ })]
15651
+ })]
15652
+ })) : jsxs(Fragment, {
15653
+ children: [jsx(Typography, {
15654
+ children: t("void-label:refund_process")
15655
+ }), jsx(Typography, Object.assign({
15656
+ component: "p"
15657
+ }, {
15658
+ children: t("void-label:refund_rules")
15659
+ }))]
15660
+ })
15661
+ });
15662
+ };
15663
+
14899
15664
  const Component = ({
14900
15665
  labelId,
14901
15666
  onComplete,
@@ -14903,24 +15668,40 @@ const Component = ({
14903
15668
  onViewShipment
14904
15669
  }) => {
14905
15670
  var _a;
15671
+ // TODO [LMNT-910] - labelId should be a required prop
15672
+ if (!labelId) throw new Error("void-label:errorMessages.labelIdRequired");
15673
+ const {
15674
+ t
15675
+ } = useTranslation();
14906
15676
  const label = useGetLabel(labelId);
14907
15677
  const shipment = useGetSalesOrderShipment((_a = label.data) === null || _a === void 0 ? void 0 : _a.shipmentId);
14908
15678
  const voidLabel = useVoidLabel();
15679
+ if (label.isLoading) return jsx(Loader, {
15680
+ message: t("loading.label")
15681
+ });
15682
+ if (shipment.isLoading) return jsx(Loader, {
15683
+ message: t("loading.shipment")
15684
+ });
15685
+ throwAny(label.error);
15686
+ throwAny(shipment.error);
15687
+ if (!label.data) throw new Error("errorMessages.unableToLoad.label");
15688
+ if (!shipment.data) throw new Error("errorMessages.unableToLoad.shipment");
14909
15689
  const handleVoidLabelSubmit = () => __awaiter(void 0, void 0, void 0, function* () {
14910
- if (!labelId) throw new Error("labelId is required");
14911
15690
  const result = yield voidLabel.mutateAsync(labelId);
14912
- // We should always have label.data and shipment.data if the request was approved,
14913
- // but we aren't using Suspense so we still need to check.
14914
- if ((result === null || result === void 0 ? void 0 : result.approved) && label.data && shipment.data) {
15691
+ if (result.approved) {
14915
15692
  onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess(label.data, shipment.data);
14916
15693
  }
14917
15694
  });
14918
- return jsx(VoidLabel, {
14919
- onComplete: onComplete,
14920
- onSubmit: handleVoidLabelSubmit,
14921
- onViewShipment: onViewShipment,
14922
- shipment: shipment.data,
14923
- voidRequest: voidLabel.data
15695
+ return jsxs(Fragment, {
15696
+ children: [jsx(Message, {
15697
+ voidRequest: voidLabel.data
15698
+ }), jsx(Actions, {
15699
+ onComplete: onComplete,
15700
+ onSubmit: handleVoidLabelSubmit,
15701
+ onViewShipment: onViewShipment,
15702
+ shipment: shipment.data,
15703
+ voidRequest: voidLabel.data
15704
+ }), jsx(Spacer, {}), jsx(PoweredByShipEngine, {})]
14924
15705
  });
14925
15706
  };
14926
15707
  const Element = alchemy.createElement(Component, ErrorFallback, {
@@ -14939,4 +15720,4 @@ var voidLabel = /*#__PURE__*/Object.freeze({
14939
15720
  Element: Element
14940
15721
  });
14941
15722
 
14942
- export { AddFundsForm, AutoFundingForm, ButtonGroup, CarrierBalance, CopyButton, Country, Cube, DateRangeCombo, DateRangeSelect, ErrorFallback, fields as Field, FieldLabel, FormPortal, FundAndPurchase, InlineLabel, ItemsBreakdown, LinkAction, listCarriers as ListCarriers, Loader, ManageFunding, manageWarehouses as ManageWarehouses, onboarding as Onboarding, PageLayoutProvider, Portal, purchaseLabel as PurchaseLabel, RootPortalProvider, Section, Spacer, Spread, StoryNotes, index as Templates, UsState, UsaCity, viewShipment as ViewShipment, voidLabel as VoidLabel, autoFundingSchema, calculateTotal, capitalizeFirstLetter, convertDimensions, convertWeight, countries, countryCodes, createCodedErrors, createDictionary, createStyles, currencySymbol, daysAfter, errorMap, euCountryCodes, extendZod, formLogger, formatCreditCardNumber, formatDate, formatDateDDMMYY, formatExpiration, formatFractionalWeight, formatMoney, getAddFundsSchema, getCustomsFromSalesOrder, getExpirationYears, getIsCustomsRequiredForSalesOrder, getIsCustomsRequiredForShipment, getIsInternationalShipment, getPendingShipment, getRateRequiresAcknowledgement, getRelativeDates, getRequestedServices, getSalesOrderItemsFromSalesOrderOrShipment, getTotalRateAmount, isDomesticAddress, isFlatRatePackageCode, isMilitaryAddress, isNowOrInTheFuture, isPoBox, isPoBoxAddress, isString, isUnitedStatesTerritory, isUspsCarrier, moneySchema, mostRecent, nextDayCutoff, omitTime, overrideCarrierCodes$1 as overrideCarrierCodes, phoneSchema, phoneSchemaUnvalidated, postalCodeRegex$3 as postalCodeRegex, sortByCreationDate, usCities, usStateCodes, usStates, useAddressValidation, useCarrierMetadata, useConfirmationOptions, useCountryCodeOptions, useCustomsContentsOptions, useCustomsNonDeliveryOptions, useDateRangeOptions, useExpirationMonthOptions, useInsuranceProviderOptions, useNestedForm, usePackageOptions, usePageLayout, useRateOptions, useRootPortal, useRunOnceOnTrue, useServiceCodeOptions, useShippingPresetsOptions, useStateCodeOptions, useToggle, useWarehouseOptions, validationResolver };
15723
+ export { AddFundsForm, AutoFundingForm, ButtonGroup, CarrierBalance, CopyButton, Country, Cube, DateRangeCombo, DateRangeSelect, ErrorFallback, fields as Field, FieldLabel, FormPortal, FundAndPurchase, InlineLabel, ItemsBreakdown, LinkAction, listCarriers as ListCarriers, Loader, ManageFunding, manageWarehouses as ManageWarehouses, onboarding as Onboarding, PageLayoutProvider, Portal, PoweredByShipEngine, purchaseLabel as PurchaseLabel, RootPortalProvider, Section, Spacer, Spread, StoryNotes, index as Templates, UsState, UsaCity, viewShipment as ViewShipment, voidLabel as VoidLabel, autoFundingSchema, calculateTotal, capitalizeFirstLetter, convertDimensions, convertWeight, countries, countryCodes, createCodedErrors, createDictionary, createStyles, currencySymbol, daysAfter, errorMap, euCountryCodes, extendZod, formLogger, formatCreditCardNumber, formatDate, formatDateDDMMYY, formatExpiration, formatFractionalWeight, formatMoney, getAddFundsSchema, getCustomsFromSalesOrder, getExpirationYears, getIsCustomsRequiredForSalesOrder, getIsCustomsRequiredForShipment, getIsInternationalShipment, getPendingShipment, getRateRequiresAcknowledgement, getRelativeDates, getRequestedServices, getSalesOrderItemsFromSalesOrderOrShipment, getTotalRateAmount, isDomesticAddress, isFlatRatePackageCode, isMilitaryAddress, isNowOrInTheFuture, isPoBox, isPoBoxAddress, isString, isUnitedStatesTerritory, isUnsupportedByUps, isUpsCarrier, isUspsCarrier, moneySchema, mostRecent, nextDayCutoff, omitTime, overrideCarrierCodes$1 as overrideCarrierCodes, phoneSchema, phoneSchemaUnvalidated, postalCodeRegex$3 as postalCodeRegex, sortByCreationDate, throwAny, throwJoinedMessages, usCities, usStateCodes, usStates, useAddressValidation, useCarrierMetadata, useConfirmationOptions, useCountryCodeOptions, useCustomsContentsOptions, useCustomsNonDeliveryOptions, useDateRangeOptions, useExpirationMonthOptions, useInsuranceProviderOptions, useNestedForm, usePackageOptions, usePageLayout, useRateOptions, useRootPortal, useRunOnceOnTrue, useServiceCodeOptions, useShipmentMetadata, useShippingPresetsOptions, useStateCodeOptions, useToggle, useWarehouseOptions, validationResolver };