@shipengine/elements 0.26.1 → 0.26.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.cjs CHANGED
@@ -3715,8 +3715,12 @@ $$c({ target: 'String', proto: true }, {
3715
3715
  }
3716
3716
  });
3717
3717
 
3718
- var _a;
3719
- let _LOCALE = (_a = navigator === null || navigator === void 0 ? void 0 : navigator.language) !== null && _a !== void 0 ? _a : "en-US";
3718
+ // TODO: Quick Fix for White Label; The navigator object cannot be accessed from within SSR,
3719
+ // so this provides default value until this feature can be refactored to support SSR.
3720
+ let _LOCALE = "en-US";
3721
+ try {
3722
+ _LOCALE = navigator.language;
3723
+ } catch (_a) {}
3720
3724
  const loadableLocale = _LOCALE.replaceAll("-", "");
3721
3725
  const loadableBackupLocale = _LOCALE.split("-")[0];
3722
3726
  let intlLocale = undefined;
@@ -10170,6 +10174,7 @@ const styles$c = createStyles({
10170
10174
  const Onboarding = ({
10171
10175
  carriers,
10172
10176
  createWarehouse,
10177
+ features,
10173
10178
  onCarrierCreated,
10174
10179
  onCompleteOnboarding,
10175
10180
  onWarehouseCreated,
@@ -10181,6 +10186,14 @@ const Onboarding = ({
10181
10186
  registerUpsCarrierErrors,
10182
10187
  warehouses
10183
10188
  }) => {
10189
+ var _a, _b;
10190
+ features = Object.assign({
10191
+ global: {
10192
+ presentation: {
10193
+ poweredByShipEngine: false
10194
+ }
10195
+ }
10196
+ }, features !== null && features !== void 0 ? features : {});
10184
10197
  const {
10185
10198
  t
10186
10199
  } = reactI18next.useTranslation(["common", "register-wallet"]);
@@ -10225,7 +10238,7 @@ const Onboarding = ({
10225
10238
  carrierCode: "dhl_express_walleted",
10226
10239
  nickname: "dhl_express_walleted"
10227
10240
  })]);
10228
- } catch (_a) {
10241
+ } catch (_c) {
10229
10242
  // Errors shown inline for recovery
10230
10243
  }
10231
10244
  yield onCarrierCreated();
@@ -10419,7 +10432,9 @@ const Onboarding = ({
10419
10432
  css: styles$c.step,
10420
10433
  label: t("onboarding:steps.payment")
10421
10434
  })]
10422
- })), renderStep(), jsxRuntime.jsx(Spacer, {}), jsxRuntime.jsx(PoweredByShipEngine, {})]
10435
+ })), renderStep(), ((_b = (_a = features === null || features === void 0 ? void 0 : features.global) === null || _a === void 0 ? void 0 : _a.presentation) === null || _b === void 0 ? void 0 : _b.poweredByShipEngine) && jsxRuntime.jsxs(jsxRuntime.Fragment, {
10436
+ children: [jsxRuntime.jsx(Spacer, {}), jsxRuntime.jsx(PoweredByShipEngine, {})]
10437
+ })]
10423
10438
  }));
10424
10439
  };
10425
10440
 
@@ -10886,8 +10901,8 @@ const FundAndPurchase = ({
10886
10901
  const renderActionButtons = (addFundsForm = {}) => jsxRuntime.jsxs(jsxRuntime.Fragment, {
10887
10902
  children: [isSavingError && jsxRuntime.jsxs(jsxRuntime.Fragment, {
10888
10903
  children: [jsxRuntime.jsx(giger.InlineNotification, Object.assign({
10889
- type: giger.NotificationType.ERROR,
10890
- title: t("purchase-label:errorMessages.saveRateFailedTitle")
10904
+ title: t("purchase-label:errorMessages.saveRateFailedTitle"),
10905
+ type: giger.NotificationType.ERROR
10891
10906
  }, {
10892
10907
  children: jsxRuntime.jsx(giger.Typography, {
10893
10908
  children: t("purchase-label:errorMessages.saveRateFailedMessage")
@@ -11427,56 +11442,39 @@ const LabelLayout = ({
11427
11442
  });
11428
11443
  };
11429
11444
 
11430
- const styles$5 = createStyles({
11431
- fundAndPurchase: theme => ({
11432
- borderTop: `1px solid ${theme.palette.gray.ultraLight}`
11433
- }),
11434
- ratesInterstitial: {
11435
- alignItems: "center",
11436
- display: "flex",
11437
- flexDirection: "column",
11438
- justifyContent: "center",
11439
- textAlign: "center"
11440
- },
11441
- showMoreOrLessRatesButton: {
11442
- alignItems: "center",
11443
- display: "flex"
11444
- }
11445
- });
11446
-
11447
- const rateSchema = zod.z.object({
11448
- rate: zod.z.object({
11449
- isAcknowledged: zod.z.boolean().refine(v => v === true, "purchase-label:schemaErrors.needToAcknowledge"),
11450
- rateId: zod.z.string()
11451
- })
11452
- }).transform(schema => schema.rate.rateId);
11453
-
11454
- var _path, _path2;
11445
+ var _g, _defs;
11455
11446
  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); }
11456
11447
  var SvgShipengineLogo = function SvgShipengineLogo(props) {
11457
11448
  return /*#__PURE__*/React__namespace.createElement("svg", _extends({
11458
- width: 244,
11459
- height: 31,
11449
+ width: 156,
11450
+ height: 20,
11460
11451
  fill: "none",
11461
11452
  xmlns: "http://www.w3.org/2000/svg"
11462
- }, props), _path || (_path = /*#__PURE__*/React__namespace.createElement("path", {
11463
- 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",
11453
+ }, props), _g || (_g = /*#__PURE__*/React__namespace.createElement("g", {
11454
+ clipPath: "url(#shipengine-logo_svg__a)"
11455
+ }, /*#__PURE__*/React__namespace.createElement("path", {
11456
+ d: "M16.007 9.91c0-.61-.228-1.144-.686-1.601-.457-.457-.99-.686-1.6-.686-.61 0-1.144.229-1.601.686-.458.457-.686.99-.686 1.6 0 .61.228 1.144.686 1.601.457.458.99.687 1.6.687.61 0 1.144-.23 1.601-.686.458-.458.686-.991.686-1.601Zm4.574-.991V10.9c0 .076 0 .152-.076.229l-.152.152-1.677.229c-.077.305-.23.61-.382.762.229.305.534.686.991 1.22.077.076.077.152.077.228 0 .076 0 .153-.077.229-.152.229-.457.534-.838.99-.381.458-.686.61-.839.61-.076 0-.152 0-.228-.076l-1.296-.991c-.23.153-.534.23-.839.306-.077.838-.152 1.371-.229 1.676 0 .229-.152.305-.304.305H12.73c-.077 0-.153 0-.23-.076-.076-.076-.076-.152-.076-.229l-.228-1.676c-.305-.077-.534-.23-.839-.306l-1.296.992c-.076.076-.152.076-.228.076-.077 0-.153 0-.229-.076-.762-.686-1.22-1.144-1.448-1.525-.077-.076-.077-.152-.077-.229 0-.076 0-.152.077-.229.076-.152.228-.305.457-.61.229-.304.381-.457.457-.61-.152-.304-.305-.61-.38-.914l-1.602-.229c-.076 0-.152-.076-.152-.076s-.077-.076-.077-.152V8.919c0-.077 0-.153.077-.23l.152-.151 1.677-.23c.077-.304.23-.533.382-.837-.229-.305-.534-.763-.991-1.22-.077-.077-.077-.153-.077-.23 0-.075 0-.151.077-.227.152-.23.457-.534.914-.991.458-.458.686-.61.84-.61.076 0 .151 0 .228.076l1.22.99c.228-.152.533-.228.838-.304.077-.84.152-1.372.229-1.677.076-.153.152-.23.305-.23h1.982c.076 0 .152 0 .228.078.077.076.077.152.077.228l.228 1.677c.305.077.534.229.839.305l1.296-.991c.076-.077.152-.077.228-.077.077 0 .153 0 .229.077.762.686 1.296 1.22 1.448 1.525.077.076.077.076.077.228 0 .077 0 .153-.077.229-.076.153-.228.305-.457.61s-.381.457-.457.61c.152.305.305.61.38.838l1.602.229c.076 0 .152.076.152.076s.076.153.076.229Z",
11464
11457
  fill: "#45AAF2"
11465
- })), _path2 || (_path2 = /*#__PURE__*/React__namespace.createElement("path", {
11466
- 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",
11458
+ }), /*#__PURE__*/React__namespace.createElement("path", {
11459
+ d: "M0 10.444V9.3a1.087 1.087 0 0 0 .914-.457c.23-.305.306-.686.306-1.144v-4.65c0-.914.305-1.676.838-2.21C2.668.23 3.278 0 4.041 0h1.372v1.296H4.04c-.381 0-.762.152-1.067.534a1.922 1.922 0 0 0-.458 1.295v4.803c0 1.068-.381 1.677-1.067 1.982.686.305 1.067.99 1.067 1.982v4.878c0 .534.153.991.458 1.297.305.38.686.533 1.067.533h1.372v1.22H4.04a2.77 2.77 0 0 1-1.982-.838c-.61-.534-.838-1.296-.838-2.211v-4.727c0-.457-.077-.838-.305-1.143A1.087 1.087 0 0 0 0 10.444Zm22.107 8.08h1.372c.38 0 .762-.152 1.067-.534.305-.381.457-.762.457-1.295v-4.803c0-1.068.381-1.753 1.067-1.982-.686-.305-1.067-.991-1.067-1.982V3.125c0-.533-.152-.99-.457-1.295-.305-.382-.686-.534-1.067-.534h-1.372V0h1.372c.762 0 1.448.305 1.982.839.534.533.838 1.295.838 2.21v4.65c0 .458.076.839.305 1.144.229.305.534.457.839.457v1.144c-.305 0-.534.152-.763.457-.228.305-.305.686-.305 1.143v4.727c0 .914-.305 1.6-.838 2.21-.61.534-1.296.839-2.058.839h-1.372v-1.296Zm11.434-4.955.762-.991c.381.458.839.762 1.372 1.068.534.304 1.144.38 1.83.38a4.62 4.62 0 0 0 1.143-.152c.305-.077.61-.23.762-.457.23-.077.382-.305.458-.458.076-.228.152-.381.152-.61a1.29 1.29 0 0 0-.229-.762 1.78 1.78 0 0 0-.533-.534c-.229-.152-.534-.228-.839-.381-.304-.152-.61-.228-.99-.305-.382-.076-.687-.152-.992-.304a5.292 5.292 0 0 1-.99-.382c-.305-.152-.61-.305-.839-.533-.228-.23-.457-.458-.533-.763a2.436 2.436 0 0 1-.23-1.067c0-.838.306-1.524.992-2.059.686-.533 1.524-.761 2.515-.761 1.525 0 2.745.457 3.66 1.448l-.763.914c-.763-.837-1.753-1.22-2.973-1.22-.61 0-1.144.154-1.525.458-.38.305-.61.686-.61 1.144 0 .229.077.457.23.686.152.229.304.305.533.457.228.153.533.229.838.305.305.077.61.153.992.305.38.153.685.305.99.381.343.094.675.222.991.382.305.152.61.304.84.533.227.229.456.457.532.762.077.305.23.686.23 1.068 0 .305-.077.61-.154.914-.075.305-.228.534-.38.839l-.687.686c-.31.242-.677.4-1.067.457a5.272 5.272 0 0 1-1.524.229c-1.677 0-2.973-.533-3.964-1.677Zm12.12 1.525V4.803h1.296v4.345h6.023V4.726h1.295v10.29H52.98v-4.725h-6.022v4.726h-1.296v.077Zm13.417 0V4.803h1.296v10.29h-1.296Zm6.174 0V4.803h4.117c.99 0 1.753.304 2.363.914.61.61.839 1.372.839 2.21a3.32 3.32 0 0 1-.84 2.212c-.61.533-1.371.838-2.362.838h-2.897v4.117h-1.22Zm1.296-5.26h2.668c.61 0 1.068-.153 1.525-.534.457-.381.61-.838.61-1.448s-.23-1.068-.61-1.449c-.381-.381-.915-.533-1.525-.533h-2.668v3.964Zm9.91 5.26V4.803h7.547V7.09h-4.88v1.6h4.804v2.287h-4.803v1.753h4.879v2.287h-7.547v.077Zm11.587 0V4.803h2.668l4.193 5.64v-5.64h2.667v10.29h-2.591l-4.345-5.945v5.946h-2.592Zm13.34-5.184c0-.762.152-1.525.457-2.211.305-.686.686-1.22 1.22-1.677.534-.457 1.067-.838 1.753-1.067.686-.229 1.372-.381 2.211-.381.534 0 1.067.077 1.525.229.457.152.914.304 1.219.533.381.229.686.534.915.762l.686.915-2.211 1.144a2.62 2.62 0 0 0-.914-.915 2.572 2.572 0 0 0-1.296-.381c-.839 0-1.525.305-2.059.838-.533.534-.838 1.296-.838 2.135 0 .838.305 1.524.838 2.134.534.534 1.22.839 2.059.839.381 0 .686-.077 1.067-.153.381-.152.61-.305.838-.457v-.762h-2.286V9.148h4.955v4.116c-1.22 1.372-2.745 1.982-4.574 1.982a7.077 7.077 0 0 1-2.211-.381 4.528 4.528 0 0 1-1.753-1.068c-.534-.457-.915-.99-1.22-1.676a7.075 7.075 0 0 1-.381-2.211Zm14.103 5.184V4.803h2.668v10.29h-2.668Zm6.937 0V4.803h2.744l4.193 5.64v-5.64h2.668v10.29h-2.592l-4.345-5.945v5.946h-2.668Zm13.874 0V4.803h7.546V7.09h-4.878v1.6h4.802v2.287h-4.802v1.753h4.878v2.287h-7.546v.077Zm11.586-8.767c0-.457.153-.914.534-1.22.381-.304.762-.533 1.22-.533.304 0 .609.077.914.229.305.152.458.38.61.609.153.229.229.534.229.915 0 .457-.153.914-.534 1.22-.381.305-.762.534-1.219.534-.458 0-.915-.153-1.22-.534-.305-.381-.534-.763-.534-1.22Zm.305 0c0 .381.153.762.458 1.068.305.304.686.457 1.067.457.381 0 .762-.153 1.067-.458a1.514 1.514 0 0 0 .457-1.067c0-.457-.152-.762-.457-1.068a1.51 1.51 0 0 0-1.067-.456c-.458 0-.762.152-1.067.457-.305.229-.458.61-.458 1.068v-.001Zm.839.99V5.337h.838c.153 0 .305.077.458.153.152.076.152.228.152.457s-.076.381-.152.457c-.077.077-.229.153-.305.153l.533.838h-.381l-.533-.838h-.382v.838h-.228v-.076Zm.228-.99h.534c.076 0 .152 0 .229-.077.152-.152.152-.228.152-.304 0-.077 0-.229-.076-.305-.076-.077-.153-.077-.229-.077h-.533v.763h-.077Z",
11467
11460
  fill: "#162948"
11468
- })));
11461
+ }))), _defs || (_defs = /*#__PURE__*/React__namespace.createElement("defs", null, /*#__PURE__*/React__namespace.createElement("clipPath", {
11462
+ id: "shipengine-logo_svg__a"
11463
+ }, /*#__PURE__*/React__namespace.createElement("path", {
11464
+ fill: "#fff",
11465
+ d: "M0 0h156v19.82H0z"
11466
+ })))));
11469
11467
  };
11470
11468
 
11471
- const styles$4 = createStyles({
11469
+ const styles$5 = createStyles({
11472
11470
  poweredByShipEngine: {
11473
- display: "flex",
11474
11471
  alignItems: "center",
11475
- justifyContent: "center",
11476
- textAlign: "center",
11477
- margin: "1rem 0",
11472
+ color: "#818F9C",
11473
+ display: "flex",
11478
11474
  gap: "1rem",
11479
- color: "#818F9C"
11475
+ justifyContent: "center",
11476
+ padding: "1rem 0",
11477
+ textAlign: "center"
11480
11478
  }
11481
11479
  });
11482
11480
 
@@ -11485,16 +11483,40 @@ const PoweredByShipEngine = () => {
11485
11483
  t
11486
11484
  } = reactI18next.useTranslation();
11487
11485
  return jsxRuntime.jsxs("div", Object.assign({
11488
- css: styles$4.poweredByShipEngine
11486
+ css: styles$5.poweredByShipEngine
11489
11487
  }, {
11490
11488
  children: [jsxRuntime.jsx(giger.Typography, Object.assign({
11491
- variant: "subtitle1"
11489
+ variant: "body2"
11492
11490
  }, {
11493
11491
  children: t("powered-by")
11494
11492
  })), jsxRuntime.jsx(SvgShipengineLogo, {})]
11495
11493
  }));
11496
11494
  };
11497
11495
 
11496
+ const styles$4 = createStyles({
11497
+ fundAndPurchase: theme => ({
11498
+ borderTop: `1px solid ${theme.palette.gray.ultraLight}`
11499
+ }),
11500
+ ratesInterstitial: {
11501
+ alignItems: "center",
11502
+ display: "flex",
11503
+ flexDirection: "column",
11504
+ justifyContent: "center",
11505
+ textAlign: "center"
11506
+ },
11507
+ showMoreOrLessRatesButton: {
11508
+ alignItems: "center",
11509
+ display: "flex"
11510
+ }
11511
+ });
11512
+
11513
+ const rateSchema = zod.z.object({
11514
+ rate: zod.z.object({
11515
+ isAcknowledged: zod.z.boolean().refine(v => v === true, "purchase-label:schemaErrors.needToAcknowledge"),
11516
+ rateId: zod.z.string()
11517
+ })
11518
+ }).transform(schema => schema.rate.rateId);
11519
+
11498
11520
  const RateForm = ({
11499
11521
  carriers,
11500
11522
  disabled,
@@ -11513,11 +11535,19 @@ const RateForm = ({
11513
11535
  shipment,
11514
11536
  outOfBandDisplayableErrors
11515
11537
  }) => {
11538
+ var _a, _b, _c, _d, _e, _f;
11516
11539
  features = Object.assign({
11517
- enableGlobalPostFiltering: false,
11518
- labelLayout: false,
11519
- nicknameRate: true,
11520
- saveRate: true
11540
+ global: {
11541
+ presentation: {
11542
+ poweredByShipEngine: false
11543
+ }
11544
+ },
11545
+ rateForm: {
11546
+ enableGlobalPostFiltering: false,
11547
+ labelLayout: false,
11548
+ nicknameRate: true,
11549
+ saveRate: true
11550
+ }
11521
11551
  }, features !== null && features !== void 0 ? features : {});
11522
11552
  const allDisplayableErrors = [...(displayableErrors !== null && displayableErrors !== void 0 ? displayableErrors : []), ...(outOfBandDisplayableErrors !== null && outOfBandDisplayableErrors !== void 0 ? outOfBandDisplayableErrors : [])];
11523
11553
  const {
@@ -11554,7 +11584,7 @@ const RateForm = ({
11554
11584
  });
11555
11585
  }
11556
11586
  })));
11557
- const rateOptions = useRateOptions(rates, carriers, shipment, features.enableGlobalPostFiltering);
11587
+ const rateOptions = useRateOptions(rates, carriers, shipment, !!((_a = features === null || features === void 0 ? void 0 : features.rateForm) === null || _a === void 0 ? void 0 : _a.enableGlobalPostFiltering));
11558
11588
  // Return true if User has multiple accounts for a single carrier.
11559
11589
  const hasDuplicateCarrierCode = carriers => {
11560
11590
  const uniqueCarrierCodes = new Set();
@@ -11626,11 +11656,11 @@ const RateForm = ({
11626
11656
  name: "rate",
11627
11657
  nicknameFeature:
11628
11658
  // if feature flag is on, and if account has duplicate carrierCodes, then show nickname
11629
- features.nicknameRate && carriers && hasDuplicateCarrierCode(carriers),
11659
+ ((_b = features === null || features === void 0 ? void 0 : features.rateForm) === null || _b === void 0 ? void 0 : _b.nicknameRate) && carriers && hasDuplicateCarrierCode(carriers),
11630
11660
  onClick: onSelectRate,
11631
11661
  options: showHiddenRates ? rateOptions : filteredRateOptions
11632
11662
  }), rateOptions.some(option => option.requiresAcknowledgement) && rateOptions.length > 5 && jsxRuntime.jsx(giger.Link, Object.assign({
11633
- css: styles$5.showMoreOrLessRatesButton,
11663
+ css: styles$4.showMoreOrLessRatesButton,
11634
11664
  onClick: () => {
11635
11665
  var _a;
11636
11666
  setShowHiddenRates(!showHiddenRates);
@@ -11651,7 +11681,7 @@ const RateForm = ({
11651
11681
  }))
11652
11682
  }))]
11653
11683
  }) : !isLoading && !!allDisplayableErrors.length ? null : jsxRuntime.jsxs("article", Object.assign({
11654
- css: styles$5.ratesInterstitial,
11684
+ css: styles$4.ratesInterstitial,
11655
11685
  role: "presentation"
11656
11686
  }, {
11657
11687
  children: [jsxRuntime.jsx(Cube, {
@@ -11665,7 +11695,7 @@ const RateForm = ({
11665
11695
  children: [displayableErrors, outOfBandDisplayableErrors, displayableLabelErrors]
11666
11696
  })
11667
11697
  }))]
11668
- })), features.labelLayout && !labelsLoading && !(labels === null || labels === void 0 ? void 0 : labels.length) && jsxRuntime.jsx(Section, Object.assign({
11698
+ })), ((_c = features === null || features === void 0 ? void 0 : features.rateForm) === null || _c === void 0 ? void 0 : _c.labelLayout) && !labelsLoading && !(labels === null || labels === void 0 ? void 0 : labels.length) && jsxRuntime.jsx(Section, Object.assign({
11669
11699
  title: t("manage-defaults:label.title")
11670
11700
  }, {
11671
11701
  children: jsxRuntime.jsx(LabelLayout, {
@@ -11674,14 +11704,16 @@ const RateForm = ({
11674
11704
  })), jsxRuntime.jsx(FundAndPurchase, {
11675
11705
  carrierId: selectedRate === null || selectedRate === void 0 ? void 0 : selectedRate.carrierId,
11676
11706
  control: form.control,
11677
- css: styles$5.fundAndPurchase,
11707
+ css: styles$4.fundAndPurchase,
11678
11708
  disabled: disabled,
11679
- isFundingEnabled: features === null || features === void 0 ? void 0 : features.enableFunding,
11709
+ isFundingEnabled: !!((_d = features === null || features === void 0 ? void 0 : features.rateForm) === null || _d === void 0 ? void 0 : _d.enableFunding),
11680
11710
  isFundingRequired: (selectedRate === null || selectedRate === void 0 ? void 0 : selectedRate.balance) !== undefined && !!selectedRate.requiresFundedAmount,
11681
11711
  onPurchase: handleSubmit,
11682
11712
  onSave: handleSaveRate,
11683
11713
  purchaseAmount: getTotalRateAmount(selectedRate)
11684
- }), jsxRuntime.jsx(Spacer, {}), jsxRuntime.jsx(PoweredByShipEngine, {})]
11714
+ }), ((_f = (_e = features === null || features === void 0 ? void 0 : features.global) === null || _e === void 0 ? void 0 : _e.presentation) === null || _f === void 0 ? void 0 : _f.poweredByShipEngine) && jsxRuntime.jsxs(jsxRuntime.Fragment, {
11715
+ children: [jsxRuntime.jsx(Spacer, {}), jsxRuntime.jsx(PoweredByShipEngine, {})]
11716
+ })]
11685
11717
  }));
11686
11718
  };
11687
11719
 
@@ -13007,7 +13039,14 @@ const Shipment = ({
13007
13039
  shipment,
13008
13040
  warehouse
13009
13041
  }) => {
13010
- var _a;
13042
+ var _a, _b, _c, _d;
13043
+ features = Object.assign({
13044
+ global: {
13045
+ presentation: {
13046
+ poweredByShipEngine: false
13047
+ }
13048
+ }
13049
+ }, features !== null && features !== void 0 ? features : {});
13011
13050
  const {
13012
13051
  t
13013
13052
  } = reactI18next.useTranslation(["common", "view-shipment"]);
@@ -13124,7 +13163,7 @@ const Shipment = ({
13124
13163
  }) : ""].filter(unit => unit.length).join(" ")
13125
13164
  }))]
13126
13165
  })), jsxRuntime.jsxs(Section, Object.assign({
13127
- rightContent: (features === null || features === void 0 ? void 0 : features.schedulePickup) && schedulePickupForCarrier(activeLabel === null || activeLabel === void 0 ? void 0 : activeLabel.carrierCode) ? jsxRuntime.jsx(giger.Link, Object.assign({
13166
+ rightContent: ((_a = features === null || features === void 0 ? void 0 : features.shipment) === null || _a === void 0 ? void 0 : _a.schedulePickup) && schedulePickupForCarrier(activeLabel === null || activeLabel === void 0 ? void 0 : activeLabel.carrierCode) ? jsxRuntime.jsx(giger.Link, Object.assign({
13128
13167
  css: theme => ({
13129
13168
  fontWeight: theme.typography.fontWeight.normal
13130
13169
  }),
@@ -13136,7 +13175,7 @@ const Shipment = ({
13136
13175
  })) : undefined,
13137
13176
  title: t("view-shipment:sections.labels")
13138
13177
  }, {
13139
- children: [(_a = sortLabels(labels)) === null || _a === void 0 ? void 0 : _a.map((label, i, data) => {
13178
+ children: [(_b = sortLabels(labels)) === null || _b === void 0 ? void 0 : _b.map((label, i, data) => {
13140
13179
  const carrier = carriers === null || carriers === void 0 ? void 0 : carriers.find(c => c.carrierCode === label.carrierCode);
13141
13180
  const service = carrier === null || carrier === void 0 ? void 0 : carrier.services.find(s => s.serviceCode === label.serviceCode);
13142
13181
  return jsxRuntime.jsxs(React.Fragment, {
@@ -13188,7 +13227,9 @@ const Shipment = ({
13188
13227
  })), "representative."]
13189
13228
  }))
13190
13229
  }))
13191
- })), jsxRuntime.jsx(Spacer, {}), jsxRuntime.jsx(PoweredByShipEngine, {})]
13230
+ })), ((_d = (_c = features === null || features === void 0 ? void 0 : features.global) === null || _c === void 0 ? void 0 : _c.presentation) === null || _d === void 0 ? void 0 : _d.poweredByShipEngine) && jsxRuntime.jsxs(jsxRuntime.Fragment, {
13231
+ children: [jsxRuntime.jsx(Spacer, {}), jsxRuntime.jsx(PoweredByShipEngine, {})]
13232
+ })]
13192
13233
  });
13193
13234
  };
13194
13235
 
@@ -14450,6 +14491,7 @@ var manageWarehouses = /*#__PURE__*/Object.freeze({
14450
14491
  });
14451
14492
 
14452
14493
  const Component$3 = ({
14494
+ features,
14453
14495
  onCompleteOnboarding
14454
14496
  }) => {
14455
14497
  const {
@@ -14493,6 +14535,7 @@ const Component$3 = ({
14493
14535
  return jsxRuntime.jsx(Onboarding, {
14494
14536
  carriers: carriers,
14495
14537
  createWarehouse: createWarehouse,
14538
+ features: features,
14496
14539
  onCarrierCreated: onCarrierCreated,
14497
14540
  onCompleteOnboarding: onCompleteOnboarding,
14498
14541
  onWarehouseCreated: onWarehouseCreated,
@@ -15225,7 +15268,7 @@ const ConfigureShipment = _a => {
15225
15268
  onDirty: handleOnDirty
15226
15269
  })), jsxRuntime.jsx(RateForm, Object.assign({}, rateFormProps, {
15227
15270
  disabled: charsetWarning === null || charsetWarning === void 0 ? void 0 : charsetWarning.error,
15228
- features: features === null || features === void 0 ? void 0 : features.rateForm,
15271
+ features: features,
15229
15272
  onSelectRate: resetLabel,
15230
15273
  outOfBandDisplayableErrors: shipmentFormProps.displayableErrors
15231
15274
  }))]
@@ -15442,7 +15485,6 @@ const useGetOrCreateShipment = shipmentId => {
15442
15485
  []);
15443
15486
  return reactQuery.useQuery({
15444
15487
  onError: reactApi.onError,
15445
- retry: shipmentId !== undefined,
15446
15488
  queryFn: () => __awaiter(void 0, void 0, void 0, function* () {
15447
15489
  var _a;
15448
15490
  if (shipmentId) {
@@ -15452,10 +15494,10 @@ const useGetOrCreateShipment = shipmentId => {
15452
15494
  const defaultOrFirstWarehouse = (_a = warehouses.find(warehouse => warehouse.isDefault)) !== null && _a !== void 0 ? _a : warehouses[0];
15453
15495
  if (defaultOrFirstWarehouse === undefined) {
15454
15496
  throw [alchemy.CodedError.fromObject({
15455
- message: "errorMessages.noWarehouses",
15456
- errorType: "unknown",
15457
15497
  errorCode: "unknown",
15458
- errorSource: "client"
15498
+ errorSource: "client",
15499
+ errorType: "unknown",
15500
+ message: "errorMessages.noWarehouses"
15459
15501
  })];
15460
15502
  }
15461
15503
  const shipTo = {
@@ -15474,7 +15516,8 @@ const useGetOrCreateShipment = shipmentId => {
15474
15516
  return newShipment.data.shipments[0];
15475
15517
  }
15476
15518
  }),
15477
- queryKey: ["useGetOrCreateShipment", shipmentId || `--${shipmentCreation}`]
15519
+ queryKey: ["useGetOrCreateShipment", shipmentId || `--${shipmentCreation}`],
15520
+ retry: shipmentId !== undefined
15478
15521
  });
15479
15522
  };
15480
15523
 
@@ -15585,7 +15628,7 @@ const Component$1 = ({
15585
15628
  });
15586
15629
  return jsxRuntime.jsx(Shipment, {
15587
15630
  carriers: carriers.data,
15588
- features: features === null || features === void 0 ? void 0 : features.shipment,
15631
+ features: features,
15589
15632
  labels: labels.data,
15590
15633
  onClickPrintLabel: onClickPrintLabel,
15591
15634
  onClickPurchaseLabel: onClickPurchaseLabel,
@@ -15717,12 +15760,20 @@ const Message = ({
15717
15760
  };
15718
15761
 
15719
15762
  const Component = ({
15763
+ features,
15720
15764
  labelId,
15721
15765
  onComplete,
15722
15766
  onSuccess,
15723
15767
  onViewShipment
15724
15768
  }) => {
15725
- var _a;
15769
+ var _a, _b, _c;
15770
+ features = Object.assign({
15771
+ global: {
15772
+ presentation: {
15773
+ poweredByShipEngine: false
15774
+ }
15775
+ }
15776
+ }, features !== null && features !== void 0 ? features : {});
15726
15777
  // TODO [LMNT-910] - labelId should be a required prop
15727
15778
  if (!labelId) throw new Error("void-label:errorMessages.labelIdRequired");
15728
15779
  const {
@@ -15756,7 +15807,9 @@ const Component = ({
15756
15807
  onViewShipment: onViewShipment,
15757
15808
  shipment: shipment.data,
15758
15809
  voidRequest: voidLabel.data
15759
- }), jsxRuntime.jsx(Spacer, {}), jsxRuntime.jsx(PoweredByShipEngine, {})]
15810
+ }), ((_c = (_b = features === null || features === void 0 ? void 0 : features.global) === null || _b === void 0 ? void 0 : _b.presentation) === null || _c === void 0 ? void 0 : _c.poweredByShipEngine) && jsxRuntime.jsxs(jsxRuntime.Fragment, {
15811
+ children: [jsxRuntime.jsx(Spacer, {}), jsxRuntime.jsx(PoweredByShipEngine, {})]
15812
+ })]
15760
15813
  });
15761
15814
  };
15762
15815
  const Element = alchemy__default["default"].createElement(Component, ErrorFallback, {
package/index.js CHANGED
@@ -3683,8 +3683,12 @@ $$c({ target: 'String', proto: true }, {
3683
3683
  }
3684
3684
  });
3685
3685
 
3686
- var _a;
3687
- let _LOCALE = (_a = navigator === null || navigator === void 0 ? void 0 : navigator.language) !== null && _a !== void 0 ? _a : "en-US";
3686
+ // TODO: Quick Fix for White Label; The navigator object cannot be accessed from within SSR,
3687
+ // so this provides default value until this feature can be refactored to support SSR.
3688
+ let _LOCALE = "en-US";
3689
+ try {
3690
+ _LOCALE = navigator.language;
3691
+ } catch (_a) {}
3688
3692
  const loadableLocale = _LOCALE.replaceAll("-", "");
3689
3693
  const loadableBackupLocale = _LOCALE.split("-")[0];
3690
3694
  let intlLocale = undefined;
@@ -10138,6 +10142,7 @@ const styles$c = createStyles({
10138
10142
  const Onboarding = ({
10139
10143
  carriers,
10140
10144
  createWarehouse,
10145
+ features,
10141
10146
  onCarrierCreated,
10142
10147
  onCompleteOnboarding,
10143
10148
  onWarehouseCreated,
@@ -10149,6 +10154,14 @@ const Onboarding = ({
10149
10154
  registerUpsCarrierErrors,
10150
10155
  warehouses
10151
10156
  }) => {
10157
+ var _a, _b;
10158
+ features = Object.assign({
10159
+ global: {
10160
+ presentation: {
10161
+ poweredByShipEngine: false
10162
+ }
10163
+ }
10164
+ }, features !== null && features !== void 0 ? features : {});
10152
10165
  const {
10153
10166
  t
10154
10167
  } = useTranslation(["common", "register-wallet"]);
@@ -10193,7 +10206,7 @@ const Onboarding = ({
10193
10206
  carrierCode: "dhl_express_walleted",
10194
10207
  nickname: "dhl_express_walleted"
10195
10208
  })]);
10196
- } catch (_a) {
10209
+ } catch (_c) {
10197
10210
  // Errors shown inline for recovery
10198
10211
  }
10199
10212
  yield onCarrierCreated();
@@ -10387,7 +10400,9 @@ const Onboarding = ({
10387
10400
  css: styles$c.step,
10388
10401
  label: t("onboarding:steps.payment")
10389
10402
  })]
10390
- })), renderStep(), jsx(Spacer, {}), jsx(PoweredByShipEngine, {})]
10403
+ })), renderStep(), ((_b = (_a = features === null || features === void 0 ? void 0 : features.global) === null || _a === void 0 ? void 0 : _a.presentation) === null || _b === void 0 ? void 0 : _b.poweredByShipEngine) && jsxs(Fragment, {
10404
+ children: [jsx(Spacer, {}), jsx(PoweredByShipEngine, {})]
10405
+ })]
10391
10406
  }));
10392
10407
  };
10393
10408
 
@@ -10854,8 +10869,8 @@ const FundAndPurchase = ({
10854
10869
  const renderActionButtons = (addFundsForm = {}) => jsxs(Fragment, {
10855
10870
  children: [isSavingError && jsxs(Fragment, {
10856
10871
  children: [jsx(InlineNotification, Object.assign({
10857
- type: NotificationType.ERROR,
10858
- title: t("purchase-label:errorMessages.saveRateFailedTitle")
10872
+ title: t("purchase-label:errorMessages.saveRateFailedTitle"),
10873
+ type: NotificationType.ERROR
10859
10874
  }, {
10860
10875
  children: jsx(Typography, {
10861
10876
  children: t("purchase-label:errorMessages.saveRateFailedMessage")
@@ -11395,56 +11410,39 @@ const LabelLayout = ({
11395
11410
  });
11396
11411
  };
11397
11412
 
11398
- const styles$5 = createStyles({
11399
- fundAndPurchase: theme => ({
11400
- borderTop: `1px solid ${theme.palette.gray.ultraLight}`
11401
- }),
11402
- ratesInterstitial: {
11403
- alignItems: "center",
11404
- display: "flex",
11405
- flexDirection: "column",
11406
- justifyContent: "center",
11407
- textAlign: "center"
11408
- },
11409
- showMoreOrLessRatesButton: {
11410
- alignItems: "center",
11411
- display: "flex"
11412
- }
11413
- });
11414
-
11415
- const rateSchema = z.object({
11416
- rate: z.object({
11417
- isAcknowledged: z.boolean().refine(v => v === true, "purchase-label:schemaErrors.needToAcknowledge"),
11418
- rateId: z.string()
11419
- })
11420
- }).transform(schema => schema.rate.rateId);
11421
-
11422
- var _path, _path2;
11413
+ var _g, _defs;
11423
11414
  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); }
11424
11415
  var SvgShipengineLogo = function SvgShipengineLogo(props) {
11425
11416
  return /*#__PURE__*/React.createElement("svg", _extends({
11426
- width: 244,
11427
- height: 31,
11417
+ width: 156,
11418
+ height: 20,
11428
11419
  fill: "none",
11429
11420
  xmlns: "http://www.w3.org/2000/svg"
11430
- }, props), _path || (_path = /*#__PURE__*/React.createElement("path", {
11431
- 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",
11421
+ }, props), _g || (_g = /*#__PURE__*/React.createElement("g", {
11422
+ clipPath: "url(#shipengine-logo_svg__a)"
11423
+ }, /*#__PURE__*/React.createElement("path", {
11424
+ d: "M16.007 9.91c0-.61-.228-1.144-.686-1.601-.457-.457-.99-.686-1.6-.686-.61 0-1.144.229-1.601.686-.458.457-.686.99-.686 1.6 0 .61.228 1.144.686 1.601.457.458.99.687 1.6.687.61 0 1.144-.23 1.601-.686.458-.458.686-.991.686-1.601Zm4.574-.991V10.9c0 .076 0 .152-.076.229l-.152.152-1.677.229c-.077.305-.23.61-.382.762.229.305.534.686.991 1.22.077.076.077.152.077.228 0 .076 0 .153-.077.229-.152.229-.457.534-.838.99-.381.458-.686.61-.839.61-.076 0-.152 0-.228-.076l-1.296-.991c-.23.153-.534.23-.839.306-.077.838-.152 1.371-.229 1.676 0 .229-.152.305-.304.305H12.73c-.077 0-.153 0-.23-.076-.076-.076-.076-.152-.076-.229l-.228-1.676c-.305-.077-.534-.23-.839-.306l-1.296.992c-.076.076-.152.076-.228.076-.077 0-.153 0-.229-.076-.762-.686-1.22-1.144-1.448-1.525-.077-.076-.077-.152-.077-.229 0-.076 0-.152.077-.229.076-.152.228-.305.457-.61.229-.304.381-.457.457-.61-.152-.304-.305-.61-.38-.914l-1.602-.229c-.076 0-.152-.076-.152-.076s-.077-.076-.077-.152V8.919c0-.077 0-.153.077-.23l.152-.151 1.677-.23c.077-.304.23-.533.382-.837-.229-.305-.534-.763-.991-1.22-.077-.077-.077-.153-.077-.23 0-.075 0-.151.077-.227.152-.23.457-.534.914-.991.458-.458.686-.61.84-.61.076 0 .151 0 .228.076l1.22.99c.228-.152.533-.228.838-.304.077-.84.152-1.372.229-1.677.076-.153.152-.23.305-.23h1.982c.076 0 .152 0 .228.078.077.076.077.152.077.228l.228 1.677c.305.077.534.229.839.305l1.296-.991c.076-.077.152-.077.228-.077.077 0 .153 0 .229.077.762.686 1.296 1.22 1.448 1.525.077.076.077.076.077.228 0 .077 0 .153-.077.229-.076.153-.228.305-.457.61s-.381.457-.457.61c.152.305.305.61.38.838l1.602.229c.076 0 .152.076.152.076s.076.153.076.229Z",
11432
11425
  fill: "#45AAF2"
11433
- })), _path2 || (_path2 = /*#__PURE__*/React.createElement("path", {
11434
- 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",
11426
+ }), /*#__PURE__*/React.createElement("path", {
11427
+ d: "M0 10.444V9.3a1.087 1.087 0 0 0 .914-.457c.23-.305.306-.686.306-1.144v-4.65c0-.914.305-1.676.838-2.21C2.668.23 3.278 0 4.041 0h1.372v1.296H4.04c-.381 0-.762.152-1.067.534a1.922 1.922 0 0 0-.458 1.295v4.803c0 1.068-.381 1.677-1.067 1.982.686.305 1.067.99 1.067 1.982v4.878c0 .534.153.991.458 1.297.305.38.686.533 1.067.533h1.372v1.22H4.04a2.77 2.77 0 0 1-1.982-.838c-.61-.534-.838-1.296-.838-2.211v-4.727c0-.457-.077-.838-.305-1.143A1.087 1.087 0 0 0 0 10.444Zm22.107 8.08h1.372c.38 0 .762-.152 1.067-.534.305-.381.457-.762.457-1.295v-4.803c0-1.068.381-1.753 1.067-1.982-.686-.305-1.067-.991-1.067-1.982V3.125c0-.533-.152-.99-.457-1.295-.305-.382-.686-.534-1.067-.534h-1.372V0h1.372c.762 0 1.448.305 1.982.839.534.533.838 1.295.838 2.21v4.65c0 .458.076.839.305 1.144.229.305.534.457.839.457v1.144c-.305 0-.534.152-.763.457-.228.305-.305.686-.305 1.143v4.727c0 .914-.305 1.6-.838 2.21-.61.534-1.296.839-2.058.839h-1.372v-1.296Zm11.434-4.955.762-.991c.381.458.839.762 1.372 1.068.534.304 1.144.38 1.83.38a4.62 4.62 0 0 0 1.143-.152c.305-.077.61-.23.762-.457.23-.077.382-.305.458-.458.076-.228.152-.381.152-.61a1.29 1.29 0 0 0-.229-.762 1.78 1.78 0 0 0-.533-.534c-.229-.152-.534-.228-.839-.381-.304-.152-.61-.228-.99-.305-.382-.076-.687-.152-.992-.304a5.292 5.292 0 0 1-.99-.382c-.305-.152-.61-.305-.839-.533-.228-.23-.457-.458-.533-.763a2.436 2.436 0 0 1-.23-1.067c0-.838.306-1.524.992-2.059.686-.533 1.524-.761 2.515-.761 1.525 0 2.745.457 3.66 1.448l-.763.914c-.763-.837-1.753-1.22-2.973-1.22-.61 0-1.144.154-1.525.458-.38.305-.61.686-.61 1.144 0 .229.077.457.23.686.152.229.304.305.533.457.228.153.533.229.838.305.305.077.61.153.992.305.38.153.685.305.99.381.343.094.675.222.991.382.305.152.61.304.84.533.227.229.456.457.532.762.077.305.23.686.23 1.068 0 .305-.077.61-.154.914-.075.305-.228.534-.38.839l-.687.686c-.31.242-.677.4-1.067.457a5.272 5.272 0 0 1-1.524.229c-1.677 0-2.973-.533-3.964-1.677Zm12.12 1.525V4.803h1.296v4.345h6.023V4.726h1.295v10.29H52.98v-4.725h-6.022v4.726h-1.296v.077Zm13.417 0V4.803h1.296v10.29h-1.296Zm6.174 0V4.803h4.117c.99 0 1.753.304 2.363.914.61.61.839 1.372.839 2.21a3.32 3.32 0 0 1-.84 2.212c-.61.533-1.371.838-2.362.838h-2.897v4.117h-1.22Zm1.296-5.26h2.668c.61 0 1.068-.153 1.525-.534.457-.381.61-.838.61-1.448s-.23-1.068-.61-1.449c-.381-.381-.915-.533-1.525-.533h-2.668v3.964Zm9.91 5.26V4.803h7.547V7.09h-4.88v1.6h4.804v2.287h-4.803v1.753h4.879v2.287h-7.547v.077Zm11.587 0V4.803h2.668l4.193 5.64v-5.64h2.667v10.29h-2.591l-4.345-5.945v5.946h-2.592Zm13.34-5.184c0-.762.152-1.525.457-2.211.305-.686.686-1.22 1.22-1.677.534-.457 1.067-.838 1.753-1.067.686-.229 1.372-.381 2.211-.381.534 0 1.067.077 1.525.229.457.152.914.304 1.219.533.381.229.686.534.915.762l.686.915-2.211 1.144a2.62 2.62 0 0 0-.914-.915 2.572 2.572 0 0 0-1.296-.381c-.839 0-1.525.305-2.059.838-.533.534-.838 1.296-.838 2.135 0 .838.305 1.524.838 2.134.534.534 1.22.839 2.059.839.381 0 .686-.077 1.067-.153.381-.152.61-.305.838-.457v-.762h-2.286V9.148h4.955v4.116c-1.22 1.372-2.745 1.982-4.574 1.982a7.077 7.077 0 0 1-2.211-.381 4.528 4.528 0 0 1-1.753-1.068c-.534-.457-.915-.99-1.22-1.676a7.075 7.075 0 0 1-.381-2.211Zm14.103 5.184V4.803h2.668v10.29h-2.668Zm6.937 0V4.803h2.744l4.193 5.64v-5.64h2.668v10.29h-2.592l-4.345-5.945v5.946h-2.668Zm13.874 0V4.803h7.546V7.09h-4.878v1.6h4.802v2.287h-4.802v1.753h4.878v2.287h-7.546v.077Zm11.586-8.767c0-.457.153-.914.534-1.22.381-.304.762-.533 1.22-.533.304 0 .609.077.914.229.305.152.458.38.61.609.153.229.229.534.229.915 0 .457-.153.914-.534 1.22-.381.305-.762.534-1.219.534-.458 0-.915-.153-1.22-.534-.305-.381-.534-.763-.534-1.22Zm.305 0c0 .381.153.762.458 1.068.305.304.686.457 1.067.457.381 0 .762-.153 1.067-.458a1.514 1.514 0 0 0 .457-1.067c0-.457-.152-.762-.457-1.068a1.51 1.51 0 0 0-1.067-.456c-.458 0-.762.152-1.067.457-.305.229-.458.61-.458 1.068v-.001Zm.839.99V5.337h.838c.153 0 .305.077.458.153.152.076.152.228.152.457s-.076.381-.152.457c-.077.077-.229.153-.305.153l.533.838h-.381l-.533-.838h-.382v.838h-.228v-.076Zm.228-.99h.534c.076 0 .152 0 .229-.077.152-.152.152-.228.152-.304 0-.077 0-.229-.076-.305-.076-.077-.153-.077-.229-.077h-.533v.763h-.077Z",
11435
11428
  fill: "#162948"
11436
- })));
11429
+ }))), _defs || (_defs = /*#__PURE__*/React.createElement("defs", null, /*#__PURE__*/React.createElement("clipPath", {
11430
+ id: "shipengine-logo_svg__a"
11431
+ }, /*#__PURE__*/React.createElement("path", {
11432
+ fill: "#fff",
11433
+ d: "M0 0h156v19.82H0z"
11434
+ })))));
11437
11435
  };
11438
11436
 
11439
- const styles$4 = createStyles({
11437
+ const styles$5 = createStyles({
11440
11438
  poweredByShipEngine: {
11441
- display: "flex",
11442
11439
  alignItems: "center",
11443
- justifyContent: "center",
11444
- textAlign: "center",
11445
- margin: "1rem 0",
11440
+ color: "#818F9C",
11441
+ display: "flex",
11446
11442
  gap: "1rem",
11447
- color: "#818F9C"
11443
+ justifyContent: "center",
11444
+ padding: "1rem 0",
11445
+ textAlign: "center"
11448
11446
  }
11449
11447
  });
11450
11448
 
@@ -11453,16 +11451,40 @@ const PoweredByShipEngine = () => {
11453
11451
  t
11454
11452
  } = useTranslation();
11455
11453
  return jsxs("div", Object.assign({
11456
- css: styles$4.poweredByShipEngine
11454
+ css: styles$5.poweredByShipEngine
11457
11455
  }, {
11458
11456
  children: [jsx(Typography, Object.assign({
11459
- variant: "subtitle1"
11457
+ variant: "body2"
11460
11458
  }, {
11461
11459
  children: t("powered-by")
11462
11460
  })), jsx(SvgShipengineLogo, {})]
11463
11461
  }));
11464
11462
  };
11465
11463
 
11464
+ const styles$4 = createStyles({
11465
+ fundAndPurchase: theme => ({
11466
+ borderTop: `1px solid ${theme.palette.gray.ultraLight}`
11467
+ }),
11468
+ ratesInterstitial: {
11469
+ alignItems: "center",
11470
+ display: "flex",
11471
+ flexDirection: "column",
11472
+ justifyContent: "center",
11473
+ textAlign: "center"
11474
+ },
11475
+ showMoreOrLessRatesButton: {
11476
+ alignItems: "center",
11477
+ display: "flex"
11478
+ }
11479
+ });
11480
+
11481
+ const rateSchema = z.object({
11482
+ rate: z.object({
11483
+ isAcknowledged: z.boolean().refine(v => v === true, "purchase-label:schemaErrors.needToAcknowledge"),
11484
+ rateId: z.string()
11485
+ })
11486
+ }).transform(schema => schema.rate.rateId);
11487
+
11466
11488
  const RateForm = ({
11467
11489
  carriers,
11468
11490
  disabled,
@@ -11481,11 +11503,19 @@ const RateForm = ({
11481
11503
  shipment,
11482
11504
  outOfBandDisplayableErrors
11483
11505
  }) => {
11506
+ var _a, _b, _c, _d, _e, _f;
11484
11507
  features = Object.assign({
11485
- enableGlobalPostFiltering: false,
11486
- labelLayout: false,
11487
- nicknameRate: true,
11488
- saveRate: true
11508
+ global: {
11509
+ presentation: {
11510
+ poweredByShipEngine: false
11511
+ }
11512
+ },
11513
+ rateForm: {
11514
+ enableGlobalPostFiltering: false,
11515
+ labelLayout: false,
11516
+ nicknameRate: true,
11517
+ saveRate: true
11518
+ }
11489
11519
  }, features !== null && features !== void 0 ? features : {});
11490
11520
  const allDisplayableErrors = [...(displayableErrors !== null && displayableErrors !== void 0 ? displayableErrors : []), ...(outOfBandDisplayableErrors !== null && outOfBandDisplayableErrors !== void 0 ? outOfBandDisplayableErrors : [])];
11491
11521
  const {
@@ -11522,7 +11552,7 @@ const RateForm = ({
11522
11552
  });
11523
11553
  }
11524
11554
  })));
11525
- const rateOptions = useRateOptions(rates, carriers, shipment, features.enableGlobalPostFiltering);
11555
+ const rateOptions = useRateOptions(rates, carriers, shipment, !!((_a = features === null || features === void 0 ? void 0 : features.rateForm) === null || _a === void 0 ? void 0 : _a.enableGlobalPostFiltering));
11526
11556
  // Return true if User has multiple accounts for a single carrier.
11527
11557
  const hasDuplicateCarrierCode = carriers => {
11528
11558
  const uniqueCarrierCodes = new Set();
@@ -11594,11 +11624,11 @@ const RateForm = ({
11594
11624
  name: "rate",
11595
11625
  nicknameFeature:
11596
11626
  // if feature flag is on, and if account has duplicate carrierCodes, then show nickname
11597
- features.nicknameRate && carriers && hasDuplicateCarrierCode(carriers),
11627
+ ((_b = features === null || features === void 0 ? void 0 : features.rateForm) === null || _b === void 0 ? void 0 : _b.nicknameRate) && carriers && hasDuplicateCarrierCode(carriers),
11598
11628
  onClick: onSelectRate,
11599
11629
  options: showHiddenRates ? rateOptions : filteredRateOptions
11600
11630
  }), rateOptions.some(option => option.requiresAcknowledgement) && rateOptions.length > 5 && jsx(Link, Object.assign({
11601
- css: styles$5.showMoreOrLessRatesButton,
11631
+ css: styles$4.showMoreOrLessRatesButton,
11602
11632
  onClick: () => {
11603
11633
  var _a;
11604
11634
  setShowHiddenRates(!showHiddenRates);
@@ -11619,7 +11649,7 @@ const RateForm = ({
11619
11649
  }))
11620
11650
  }))]
11621
11651
  }) : !isLoading && !!allDisplayableErrors.length ? null : jsxs("article", Object.assign({
11622
- css: styles$5.ratesInterstitial,
11652
+ css: styles$4.ratesInterstitial,
11623
11653
  role: "presentation"
11624
11654
  }, {
11625
11655
  children: [jsx(Cube, {
@@ -11633,7 +11663,7 @@ const RateForm = ({
11633
11663
  children: [displayableErrors, outOfBandDisplayableErrors, displayableLabelErrors]
11634
11664
  })
11635
11665
  }))]
11636
- })), features.labelLayout && !labelsLoading && !(labels === null || labels === void 0 ? void 0 : labels.length) && jsx(Section, Object.assign({
11666
+ })), ((_c = features === null || features === void 0 ? void 0 : features.rateForm) === null || _c === void 0 ? void 0 : _c.labelLayout) && !labelsLoading && !(labels === null || labels === void 0 ? void 0 : labels.length) && jsx(Section, Object.assign({
11637
11667
  title: t("manage-defaults:label.title")
11638
11668
  }, {
11639
11669
  children: jsx(LabelLayout, {
@@ -11642,14 +11672,16 @@ const RateForm = ({
11642
11672
  })), jsx(FundAndPurchase, {
11643
11673
  carrierId: selectedRate === null || selectedRate === void 0 ? void 0 : selectedRate.carrierId,
11644
11674
  control: form.control,
11645
- css: styles$5.fundAndPurchase,
11675
+ css: styles$4.fundAndPurchase,
11646
11676
  disabled: disabled,
11647
- isFundingEnabled: features === null || features === void 0 ? void 0 : features.enableFunding,
11677
+ isFundingEnabled: !!((_d = features === null || features === void 0 ? void 0 : features.rateForm) === null || _d === void 0 ? void 0 : _d.enableFunding),
11648
11678
  isFundingRequired: (selectedRate === null || selectedRate === void 0 ? void 0 : selectedRate.balance) !== undefined && !!selectedRate.requiresFundedAmount,
11649
11679
  onPurchase: handleSubmit,
11650
11680
  onSave: handleSaveRate,
11651
11681
  purchaseAmount: getTotalRateAmount(selectedRate)
11652
- }), jsx(Spacer, {}), jsx(PoweredByShipEngine, {})]
11682
+ }), ((_f = (_e = features === null || features === void 0 ? void 0 : features.global) === null || _e === void 0 ? void 0 : _e.presentation) === null || _f === void 0 ? void 0 : _f.poweredByShipEngine) && jsxs(Fragment, {
11683
+ children: [jsx(Spacer, {}), jsx(PoweredByShipEngine, {})]
11684
+ })]
11653
11685
  }));
11654
11686
  };
11655
11687
 
@@ -12975,7 +13007,14 @@ const Shipment = ({
12975
13007
  shipment,
12976
13008
  warehouse
12977
13009
  }) => {
12978
- var _a;
13010
+ var _a, _b, _c, _d;
13011
+ features = Object.assign({
13012
+ global: {
13013
+ presentation: {
13014
+ poweredByShipEngine: false
13015
+ }
13016
+ }
13017
+ }, features !== null && features !== void 0 ? features : {});
12979
13018
  const {
12980
13019
  t
12981
13020
  } = useTranslation(["common", "view-shipment"]);
@@ -13092,7 +13131,7 @@ const Shipment = ({
13092
13131
  }) : ""].filter(unit => unit.length).join(" ")
13093
13132
  }))]
13094
13133
  })), jsxs(Section, Object.assign({
13095
- rightContent: (features === null || features === void 0 ? void 0 : features.schedulePickup) && schedulePickupForCarrier(activeLabel === null || activeLabel === void 0 ? void 0 : activeLabel.carrierCode) ? jsx(Link, Object.assign({
13134
+ rightContent: ((_a = features === null || features === void 0 ? void 0 : features.shipment) === null || _a === void 0 ? void 0 : _a.schedulePickup) && schedulePickupForCarrier(activeLabel === null || activeLabel === void 0 ? void 0 : activeLabel.carrierCode) ? jsx(Link, Object.assign({
13096
13135
  css: theme => ({
13097
13136
  fontWeight: theme.typography.fontWeight.normal
13098
13137
  }),
@@ -13104,7 +13143,7 @@ const Shipment = ({
13104
13143
  })) : undefined,
13105
13144
  title: t("view-shipment:sections.labels")
13106
13145
  }, {
13107
- children: [(_a = sortLabels(labels)) === null || _a === void 0 ? void 0 : _a.map((label, i, data) => {
13146
+ children: [(_b = sortLabels(labels)) === null || _b === void 0 ? void 0 : _b.map((label, i, data) => {
13108
13147
  const carrier = carriers === null || carriers === void 0 ? void 0 : carriers.find(c => c.carrierCode === label.carrierCode);
13109
13148
  const service = carrier === null || carrier === void 0 ? void 0 : carrier.services.find(s => s.serviceCode === label.serviceCode);
13110
13149
  return jsxs(Fragment$1, {
@@ -13156,7 +13195,9 @@ const Shipment = ({
13156
13195
  })), "representative."]
13157
13196
  }))
13158
13197
  }))
13159
- })), jsx(Spacer, {}), jsx(PoweredByShipEngine, {})]
13198
+ })), ((_d = (_c = features === null || features === void 0 ? void 0 : features.global) === null || _c === void 0 ? void 0 : _c.presentation) === null || _d === void 0 ? void 0 : _d.poweredByShipEngine) && jsxs(Fragment, {
13199
+ children: [jsx(Spacer, {}), jsx(PoweredByShipEngine, {})]
13200
+ })]
13160
13201
  });
13161
13202
  };
13162
13203
 
@@ -14418,6 +14459,7 @@ var manageWarehouses = /*#__PURE__*/Object.freeze({
14418
14459
  });
14419
14460
 
14420
14461
  const Component$3 = ({
14462
+ features,
14421
14463
  onCompleteOnboarding
14422
14464
  }) => {
14423
14465
  const {
@@ -14461,6 +14503,7 @@ const Component$3 = ({
14461
14503
  return jsx(Onboarding, {
14462
14504
  carriers: carriers,
14463
14505
  createWarehouse: createWarehouse,
14506
+ features: features,
14464
14507
  onCarrierCreated: onCarrierCreated,
14465
14508
  onCompleteOnboarding: onCompleteOnboarding,
14466
14509
  onWarehouseCreated: onWarehouseCreated,
@@ -15193,7 +15236,7 @@ const ConfigureShipment = _a => {
15193
15236
  onDirty: handleOnDirty
15194
15237
  })), jsx(RateForm, Object.assign({}, rateFormProps, {
15195
15238
  disabled: charsetWarning === null || charsetWarning === void 0 ? void 0 : charsetWarning.error,
15196
- features: features === null || features === void 0 ? void 0 : features.rateForm,
15239
+ features: features,
15197
15240
  onSelectRate: resetLabel,
15198
15241
  outOfBandDisplayableErrors: shipmentFormProps.displayableErrors
15199
15242
  }))]
@@ -15410,7 +15453,6 @@ const useGetOrCreateShipment = shipmentId => {
15410
15453
  []);
15411
15454
  return useQuery({
15412
15455
  onError,
15413
- retry: shipmentId !== undefined,
15414
15456
  queryFn: () => __awaiter(void 0, void 0, void 0, function* () {
15415
15457
  var _a;
15416
15458
  if (shipmentId) {
@@ -15420,10 +15462,10 @@ const useGetOrCreateShipment = shipmentId => {
15420
15462
  const defaultOrFirstWarehouse = (_a = warehouses.find(warehouse => warehouse.isDefault)) !== null && _a !== void 0 ? _a : warehouses[0];
15421
15463
  if (defaultOrFirstWarehouse === undefined) {
15422
15464
  throw [CodedError.fromObject({
15423
- message: "errorMessages.noWarehouses",
15424
- errorType: "unknown",
15425
15465
  errorCode: "unknown",
15426
- errorSource: "client"
15466
+ errorSource: "client",
15467
+ errorType: "unknown",
15468
+ message: "errorMessages.noWarehouses"
15427
15469
  })];
15428
15470
  }
15429
15471
  const shipTo = {
@@ -15442,7 +15484,8 @@ const useGetOrCreateShipment = shipmentId => {
15442
15484
  return newShipment.data.shipments[0];
15443
15485
  }
15444
15486
  }),
15445
- queryKey: ["useGetOrCreateShipment", shipmentId || `--${shipmentCreation}`]
15487
+ queryKey: ["useGetOrCreateShipment", shipmentId || `--${shipmentCreation}`],
15488
+ retry: shipmentId !== undefined
15446
15489
  });
15447
15490
  };
15448
15491
 
@@ -15553,7 +15596,7 @@ const Component$1 = ({
15553
15596
  });
15554
15597
  return jsx(Shipment, {
15555
15598
  carriers: carriers.data,
15556
- features: features === null || features === void 0 ? void 0 : features.shipment,
15599
+ features: features,
15557
15600
  labels: labels.data,
15558
15601
  onClickPrintLabel: onClickPrintLabel,
15559
15602
  onClickPurchaseLabel: onClickPurchaseLabel,
@@ -15685,12 +15728,20 @@ const Message = ({
15685
15728
  };
15686
15729
 
15687
15730
  const Component = ({
15731
+ features,
15688
15732
  labelId,
15689
15733
  onComplete,
15690
15734
  onSuccess,
15691
15735
  onViewShipment
15692
15736
  }) => {
15693
- var _a;
15737
+ var _a, _b, _c;
15738
+ features = Object.assign({
15739
+ global: {
15740
+ presentation: {
15741
+ poweredByShipEngine: false
15742
+ }
15743
+ }
15744
+ }, features !== null && features !== void 0 ? features : {});
15694
15745
  // TODO [LMNT-910] - labelId should be a required prop
15695
15746
  if (!labelId) throw new Error("void-label:errorMessages.labelIdRequired");
15696
15747
  const {
@@ -15724,7 +15775,9 @@ const Component = ({
15724
15775
  onViewShipment: onViewShipment,
15725
15776
  shipment: shipment.data,
15726
15777
  voidRequest: voidLabel.data
15727
- }), jsx(Spacer, {}), jsx(PoweredByShipEngine, {})]
15778
+ }), ((_c = (_b = features === null || features === void 0 ? void 0 : features.global) === null || _b === void 0 ? void 0 : _b.presentation) === null || _c === void 0 ? void 0 : _c.poweredByShipEngine) && jsxs(Fragment, {
15779
+ children: [jsx(Spacer, {}), jsx(PoweredByShipEngine, {})]
15780
+ })]
15728
15781
  });
15729
15782
  };
15730
15783
  const Element = alchemy.createElement(Component, ErrorFallback, {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shipengine/elements",
3
- "version": "0.26.1",
3
+ "version": "0.26.3",
4
4
  "typedoc": {
5
5
  "entryPoint": "./src/index.ts",
6
6
  "readmeFile": "../../README.md",
@@ -1,11 +1,11 @@
1
1
  export declare const styles: {
2
2
  poweredByShipEngine: {
3
- display: "flex";
4
3
  alignItems: "center";
4
+ color: "#818F9C";
5
+ display: "flex";
6
+ gap: string;
5
7
  justifyContent: "center";
8
+ padding: string;
6
9
  textAlign: "center";
7
- margin: string;
8
- gap: string;
9
- color: "#818F9C";
10
10
  };
11
11
  };
@@ -12,9 +12,17 @@ export type ValidateBilling = {
12
12
  type: "billing";
13
13
  };
14
14
  export type ValidateAddress = ValidateWarehouse | ValidateBilling;
15
+ export type OnboardingFeatures = {
16
+ global?: {
17
+ presentation?: {
18
+ poweredByShipEngine?: boolean;
19
+ };
20
+ };
21
+ };
15
22
  export type OnboardingProps = {
16
23
  carriers: SE.Carrier[];
17
24
  createWarehouse: (payload: Partial<SE.Warehouse>) => Promise<SE.Warehouse>;
25
+ features?: OnboardingFeatures;
18
26
  onCarrierCreated: () => Promise<void>;
19
27
  onCompleteOnboarding: () => void;
20
28
  onWarehouseCreated: () => Promise<void>;
@@ -26,4 +34,4 @@ export type OnboardingProps = {
26
34
  registerUpsCarrierErrors: SE.CodedError[] | null;
27
35
  warehouses: SE.Warehouse[];
28
36
  };
29
- export declare const Onboarding: ({ carriers, createWarehouse, onCarrierCreated, onCompleteOnboarding, onWarehouseCreated, registerDhlCarrier, registerDhlCarrierErrors, registerStampsCarrier, registerStampsCarrierErrors, registerUpsCarrier, registerUpsCarrierErrors, warehouses, }: OnboardingProps) => import("@emotion/react/jsx-runtime").JSX.Element;
37
+ export declare const Onboarding: ({ carriers, createWarehouse, features, onCarrierCreated, onCompleteOnboarding, onWarehouseCreated, registerDhlCarrier, registerDhlCarrierErrors, registerStampsCarrier, registerStampsCarrierErrors, registerUpsCarrier, registerUpsCarrierErrors, warehouses, }: OnboardingProps) => import("@emotion/react/jsx-runtime").JSX.Element;
@@ -1,18 +1,12 @@
1
1
  import { SE } from "@shipengine/alchemy";
2
- export type RateFormFeatures = {
3
- enableFunding?: boolean;
4
- enableGlobalPostFiltering?: boolean;
5
- labelLayout?: boolean;
6
- nicknameRate?: boolean;
7
- saveRate?: boolean;
8
- };
2
+ import { ConfigureShipmentFeatures } from "../../../elements/configure-shipment";
9
3
  export type RateFormProps = {
10
4
  carriers?: SE.Carrier[];
11
5
  disabled?: boolean;
12
6
  displayableErrors?: string[];
13
7
  displayableLabelErrors?: string[];
14
8
  errors?: SE.CodedError[];
15
- features?: RateFormFeatures;
9
+ features?: Pick<ConfigureShipmentFeatures, "global" | "rateForm">;
16
10
  isLoading?: boolean;
17
11
  labelErrors?: SE.CodedError[];
18
12
  labels?: SE.Label[];
@@ -1,7 +1,14 @@
1
1
  import { SE } from "@shipengine/alchemy";
2
2
  export declare const schedulePickupForCarrier: (carrierCode?: string, plaftformSchedulePickupUrl?: string) => string | undefined;
3
3
  export type ShipmentFeatures = {
4
- schedulePickup?: boolean;
4
+ global?: {
5
+ presentation?: {
6
+ poweredByShipEngine?: boolean;
7
+ };
8
+ };
9
+ shipment?: {
10
+ schedulePickup?: boolean;
11
+ };
5
12
  };
6
13
  export type ShipmentProps = {
7
14
  carriers?: SE.Carrier[];
@@ -3,9 +3,21 @@ import { Templates } from "../../components";
3
3
  import { UseShippingPresetsOptionsProps } from "../../hooks";
4
4
  import { UseRatesFormProps, UseShipmentFormProps } from "./hooks";
5
5
  export type ShipmentFormMode = "browse_rates" | "select_service";
6
+ export type RateFormFeatures = {
7
+ enableFunding?: boolean;
8
+ enableGlobalPostFiltering?: boolean;
9
+ labelLayout?: boolean;
10
+ nicknameRate?: boolean;
11
+ saveRate?: boolean;
12
+ };
6
13
  export type ConfigureShipmentFeatures = {
7
14
  compatibleCountryCodes?: UseShipmentFormProps["compatibleCountryCodes"];
8
- rateForm?: Templates.RateFormFeatures;
15
+ global?: {
16
+ presentation?: {
17
+ poweredByShipEngine?: boolean;
18
+ };
19
+ };
20
+ rateForm?: RateFormFeatures;
9
21
  shipmentForm?: Templates.ShipmentFormFeatures;
10
22
  };
11
23
  export type ConfigureShipmentProps = {
@@ -1,8 +1,10 @@
1
1
  /// <reference types="react" />
2
+ import { OnboardingProps } from "../../components/templates";
2
3
  export type ComponentProps = {
4
+ features?: OnboardingProps["features"];
3
5
  onCompleteOnboarding: () => void;
4
6
  };
5
- export declare const Component: ({ onCompleteOnboarding }: ComponentProps) => import("@emotion/react/jsx-runtime").JSX.Element;
7
+ export declare const Component: ({ features, onCompleteOnboarding }: ComponentProps) => import("@emotion/react/jsx-runtime").JSX.Element;
6
8
  export declare const Element: ({ resources, ...props }: ComponentProps & {
7
9
  resources?: {
8
10
  en: {
@@ -1,11 +1,8 @@
1
1
  /// <reference types="react" />
2
2
  import { SE } from "@shipengine/alchemy";
3
3
  import { Templates } from "../../components";
4
- export type Features = {
5
- shipment?: Templates.ShipmentFeatures;
6
- };
7
4
  export type ComponentProps = {
8
- features: Features;
5
+ features?: Templates.ShipmentFeatures;
9
6
  onClickPrintLabel?: () => void;
10
7
  onClickPurchaseLabel?: (order: SE.SalesOrder) => void;
11
8
  onClickVoidLabel?: (label: SE.Label) => void;
@@ -1,12 +1,19 @@
1
1
  /// <reference types="react" />
2
2
  import { SE } from "@shipengine/alchemy";
3
3
  export type ComponentProps = {
4
+ features: {
5
+ global?: {
6
+ presentation?: {
7
+ poweredByShipEngine?: boolean;
8
+ };
9
+ };
10
+ };
4
11
  labelId?: string;
5
12
  onComplete: (request: SE.VoidRequest, shipment: SE.SalesOrderShipment) => void;
6
13
  onSuccess?: (label: SE.Label, shipment: SE.SalesOrderShipment) => void;
7
14
  onViewShipment: (shipment: SE.SalesOrderShipment) => void;
8
15
  };
9
- export declare const Component: ({ labelId, onComplete, onSuccess, onViewShipment }: ComponentProps) => import("@emotion/react/jsx-runtime").JSX.Element;
16
+ export declare const Component: ({ features, labelId, onComplete, onSuccess, onViewShipment, }: ComponentProps) => import("@emotion/react/jsx-runtime").JSX.Element;
10
17
  export declare const Element: ({ resources, ...props }: ComponentProps & {
11
18
  resources?: {
12
19
  en: {