@medusajs/draft-order 2.11.4-preview-20251121120142 → 2.11.4-preview-20251121180139

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.
@@ -9755,6 +9755,74 @@ const BillingAddressForm = ({ order }) => {
9755
9755
  ) });
9756
9756
  };
9757
9757
  const schema$5 = addressSchema;
9758
+ const Email = () => {
9759
+ const { id } = useParams();
9760
+ const { order, isPending, isError, error } = useOrder(id, {
9761
+ fields: "+email"
9762
+ });
9763
+ if (isError) {
9764
+ throw error;
9765
+ }
9766
+ const isReady = !isPending && !!order;
9767
+ return /* @__PURE__ */ jsxs(RouteDrawer, { children: [
9768
+ /* @__PURE__ */ jsxs(RouteDrawer.Header, { children: [
9769
+ /* @__PURE__ */ jsx(RouteDrawer.Title, { asChild: true, children: /* @__PURE__ */ jsx(Heading, { children: "Edit Email" }) }),
9770
+ /* @__PURE__ */ jsx(RouteDrawer.Description, { asChild: true, children: /* @__PURE__ */ jsx("span", { className: "sr-only", children: "Edit the email for the draft order" }) })
9771
+ ] }),
9772
+ isReady && /* @__PURE__ */ jsx(EmailForm, { order })
9773
+ ] });
9774
+ };
9775
+ const EmailForm = ({ order }) => {
9776
+ const form = useForm({
9777
+ defaultValues: {
9778
+ email: order.email ?? ""
9779
+ },
9780
+ resolver: zodResolver(schema$4)
9781
+ });
9782
+ const { mutateAsync, isPending } = useUpdateDraftOrder(order.id);
9783
+ const { handleSuccess } = useRouteModal();
9784
+ const onSubmit = form.handleSubmit(async (data) => {
9785
+ await mutateAsync(
9786
+ { email: data.email },
9787
+ {
9788
+ onSuccess: () => {
9789
+ handleSuccess();
9790
+ },
9791
+ onError: (error) => {
9792
+ toast.error(error.message);
9793
+ }
9794
+ }
9795
+ );
9796
+ });
9797
+ return /* @__PURE__ */ jsx(RouteDrawer.Form, { form, children: /* @__PURE__ */ jsxs(
9798
+ KeyboundForm,
9799
+ {
9800
+ className: "flex flex-1 flex-col overflow-hidden",
9801
+ onSubmit,
9802
+ children: [
9803
+ /* @__PURE__ */ jsx(RouteDrawer.Body, { className: "flex flex-col gap-y-6 overflow-y-auto", children: /* @__PURE__ */ jsx(
9804
+ Form$2.Field,
9805
+ {
9806
+ control: form.control,
9807
+ name: "email",
9808
+ render: ({ field }) => /* @__PURE__ */ jsxs(Form$2.Item, { children: [
9809
+ /* @__PURE__ */ jsx(Form$2.Label, { children: "Email" }),
9810
+ /* @__PURE__ */ jsx(Form$2.Control, { children: /* @__PURE__ */ jsx(Input, { ...field }) }),
9811
+ /* @__PURE__ */ jsx(Form$2.ErrorMessage, {})
9812
+ ] })
9813
+ }
9814
+ ) }),
9815
+ /* @__PURE__ */ jsx(RouteDrawer.Footer, { children: /* @__PURE__ */ jsxs("div", { className: "flex justify-end gap-2", children: [
9816
+ /* @__PURE__ */ jsx(RouteDrawer.Close, { asChild: true, children: /* @__PURE__ */ jsx(Button, { size: "small", variant: "secondary", children: "Cancel" }) }),
9817
+ /* @__PURE__ */ jsx(Button, { size: "small", type: "submit", isLoading: isPending, children: "Save" })
9818
+ ] }) })
9819
+ ]
9820
+ }
9821
+ ) });
9822
+ };
9823
+ const schema$4 = objectType({
9824
+ email: stringType().email()
9825
+ });
9758
9826
  const CustomItems = () => {
9759
9827
  return /* @__PURE__ */ jsxs(RouteDrawer, { children: [
9760
9828
  /* @__PURE__ */ jsx(RouteDrawer.Header, { children: /* @__PURE__ */ jsx(RouteDrawer.Title, { asChild: true, children: /* @__PURE__ */ jsx(Heading, { children: "Edit Custom Items" }) }) }),
@@ -9763,7 +9831,7 @@ const CustomItems = () => {
9763
9831
  };
9764
9832
  const CustomItemsForm = () => {
9765
9833
  const form = useForm({
9766
- resolver: zodResolver(schema$4)
9834
+ resolver: zodResolver(schema$3)
9767
9835
  });
9768
9836
  return /* @__PURE__ */ jsx(RouteDrawer.Form, { form, children: /* @__PURE__ */ jsxs(KeyboundForm, { className: "flex flex-1 flex-col", children: [
9769
9837
  /* @__PURE__ */ jsx(RouteDrawer.Body, {}),
@@ -9773,7 +9841,7 @@ const CustomItemsForm = () => {
9773
9841
  ] }) })
9774
9842
  ] }) });
9775
9843
  };
9776
- const schema$4 = objectType({
9844
+ const schema$3 = objectType({
9777
9845
  email: stringType().email()
9778
9846
  });
9779
9847
  const NumberInput = forwardRef(
@@ -11405,7 +11473,7 @@ const SalesChannelForm = ({ order }) => {
11405
11473
  defaultValues: {
11406
11474
  sales_channel_id: order.sales_channel_id || ""
11407
11475
  },
11408
- resolver: zodResolver(schema$3)
11476
+ resolver: zodResolver(schema$2)
11409
11477
  });
11410
11478
  const { mutateAsync, isPending } = useUpdateDraftOrder(order.id);
11411
11479
  const { handleSuccess } = useRouteModal();
@@ -11480,131 +11548,334 @@ const SalesChannelField = ({ control, order }) => {
11480
11548
  }
11481
11549
  );
11482
11550
  };
11483
- const schema$3 = objectType({
11551
+ const schema$2 = objectType({
11484
11552
  sales_channel_id: stringType().min(1)
11485
11553
  });
11486
- const STACKED_FOCUS_MODAL_ID = "shipping-form";
11487
- const Shipping = () => {
11488
- var _a;
11554
+ const ShippingAddress = () => {
11489
11555
  const { id } = useParams();
11490
11556
  const { order, isPending, isError, error } = useOrder(id, {
11491
- fields: "+items.*,+items.variant.*,+items.variant.product.*,+items.variant.product.shipping_profile.*,+currency_code"
11557
+ fields: "+shipping_address"
11492
11558
  });
11493
- const {
11494
- order: preview,
11495
- isPending: isPreviewPending,
11496
- isError: isPreviewError,
11497
- error: previewError
11498
- } = useOrderPreview(id);
11499
- useInitiateOrderEdit({ preview });
11500
- const { onCancel } = useCancelOrderEdit({ preview });
11501
11559
  if (isError) {
11502
11560
  throw error;
11503
11561
  }
11504
- if (isPreviewError) {
11505
- throw previewError;
11506
- }
11507
- const orderHasItems = (((_a = order == null ? void 0 : order.items) == null ? void 0 : _a.length) || 0) > 0;
11508
- const isReady = preview && !isPreviewPending && order && !isPending;
11509
- return /* @__PURE__ */ jsx(RouteFocusModal, { onClose: onCancel, children: !orderHasItems ? /* @__PURE__ */ jsxs("div", { className: "flex h-full flex-col overflow-hidden ", children: [
11510
- /* @__PURE__ */ jsx(RouteFocusModal.Header, {}),
11511
- /* @__PURE__ */ jsx(RouteFocusModal.Body, { className: "flex flex-1 flex-col overflow-hidden", children: /* @__PURE__ */ jsx("div", { className: "flex flex-1 flex-col items-center overflow-y-auto", children: /* @__PURE__ */ jsxs("div", { className: "flex w-full max-w-[720px] flex-col gap-y-6 px-6 py-16", children: [
11512
- /* @__PURE__ */ jsx(RouteFocusModal.Title, { asChild: true, children: /* @__PURE__ */ jsx(Heading, { children: "Shipping" }) }),
11513
- /* @__PURE__ */ jsx(RouteFocusModal.Description, { asChild: true, children: /* @__PURE__ */ jsx(Text, { size: "small", className: "text-ui-fg-subtle", children: "This draft order currently has no items. Add items to the order before adding shipping." }) })
11514
- ] }) }) }),
11515
- /* @__PURE__ */ jsx(RouteFocusModal.Footer, { children: /* @__PURE__ */ jsx(RouteFocusModal.Close, { asChild: true, children: /* @__PURE__ */ jsx(Button, { size: "small", variant: "secondary", type: "button", children: "Cancel" }) }) })
11516
- ] }) : isReady ? /* @__PURE__ */ jsx(ShippingForm, { preview, order }) : /* @__PURE__ */ jsxs("div", { children: [
11517
- /* @__PURE__ */ jsx(RouteFocusModal.Title, { asChild: true, children: /* @__PURE__ */ jsx("span", { className: "sr-only", children: "Edit Shipping" }) }),
11518
- /* @__PURE__ */ jsx(RouteFocusModal.Description, { asChild: true, children: /* @__PURE__ */ jsx("span", { className: "sr-only", children: "Loading data for the draft order, please wait..." }) })
11519
- ] }) });
11562
+ const isReady = !isPending && !!order;
11563
+ return /* @__PURE__ */ jsxs(RouteDrawer, { children: [
11564
+ /* @__PURE__ */ jsxs(RouteDrawer.Header, { children: [
11565
+ /* @__PURE__ */ jsx(RouteDrawer.Title, { asChild: true, children: /* @__PURE__ */ jsx(Heading, { children: "Edit Shipping Address" }) }),
11566
+ /* @__PURE__ */ jsx(RouteDrawer.Description, { asChild: true, children: /* @__PURE__ */ jsx("span", { className: "sr-only", children: "Edit the shipping address for the draft order" }) })
11567
+ ] }),
11568
+ isReady && /* @__PURE__ */ jsx(ShippingAddressForm, { order })
11569
+ ] });
11520
11570
  };
11521
- const ShippingForm = ({ preview, order }) => {
11522
- var _a;
11523
- const { setIsOpen } = useStackedModal();
11524
- const [isSubmitting, setIsSubmitting] = useState(false);
11525
- const [data, setData] = useState(null);
11526
- const appliedShippingOptionIds = (_a = preview.shipping_methods) == null ? void 0 : _a.map((method) => method.shipping_option_id).filter(Boolean);
11527
- const { shipping_options } = useShippingOptions(
11528
- {
11529
- id: appliedShippingOptionIds,
11530
- fields: "+service_zone.*,+service_zone.fulfillment_set.*,+service_zone.fulfillment_set.location.*"
11571
+ const ShippingAddressForm = ({ order }) => {
11572
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;
11573
+ const form = useForm({
11574
+ defaultValues: {
11575
+ first_name: ((_a = order.shipping_address) == null ? void 0 : _a.first_name) ?? "",
11576
+ last_name: ((_b = order.shipping_address) == null ? void 0 : _b.last_name) ?? "",
11577
+ company: ((_c = order.shipping_address) == null ? void 0 : _c.company) ?? "",
11578
+ address_1: ((_d = order.shipping_address) == null ? void 0 : _d.address_1) ?? "",
11579
+ address_2: ((_e = order.shipping_address) == null ? void 0 : _e.address_2) ?? "",
11580
+ city: ((_f = order.shipping_address) == null ? void 0 : _f.city) ?? "",
11581
+ province: ((_g = order.shipping_address) == null ? void 0 : _g.province) ?? "",
11582
+ country_code: ((_h = order.shipping_address) == null ? void 0 : _h.country_code) ?? "",
11583
+ postal_code: ((_i = order.shipping_address) == null ? void 0 : _i.postal_code) ?? "",
11584
+ phone: ((_j = order.shipping_address) == null ? void 0 : _j.phone) ?? ""
11531
11585
  },
11532
- {
11533
- enabled: appliedShippingOptionIds.length > 0
11534
- }
11535
- );
11536
- const uniqueShippingProfiles = useMemo(() => {
11537
- const profiles = /* @__PURE__ */ new Map();
11538
- getUniqueShippingProfiles(order.items).forEach((profile) => {
11539
- profiles.set(profile.id, profile);
11540
- });
11541
- shipping_options == null ? void 0 : shipping_options.forEach((option) => {
11542
- profiles.set(option.shipping_profile_id, option.shipping_profile);
11543
- });
11544
- return Array.from(profiles.values());
11545
- }, [order.items, shipping_options]);
11586
+ resolver: zodResolver(schema$1)
11587
+ });
11588
+ const { mutateAsync, isPending } = useUpdateDraftOrder(order.id);
11546
11589
  const { handleSuccess } = useRouteModal();
11547
- const { mutateAsync: confirmOrderEdit } = useDraftOrderConfirmEdit(preview.id);
11548
- const { mutateAsync: requestOrderEdit } = useDraftOrderRequestEdit(preview.id);
11549
- const { mutateAsync: removeShippingMethod } = useDraftOrderRemoveShippingMethod(preview.id);
11550
- const { mutateAsync: removeActionShippingMethod } = useDraftOrderRemoveActionShippingMethod(preview.id);
11551
- const onSubmit = async () => {
11552
- setIsSubmitting(true);
11553
- let requestSucceeded = false;
11554
- await requestOrderEdit(void 0, {
11555
- onError: (e) => {
11556
- toast.error(`Failed to request order edit: ${e.message}`);
11557
- },
11558
- onSuccess: () => {
11559
- requestSucceeded = true;
11560
- }
11561
- });
11562
- if (!requestSucceeded) {
11563
- setIsSubmitting(false);
11564
- return;
11565
- }
11566
- await confirmOrderEdit(void 0, {
11567
- onError: (e) => {
11568
- toast.error(`Failed to confirm order edit: ${e.message}`);
11569
- },
11570
- onSuccess: () => {
11571
- handleSuccess();
11590
+ const onSubmit = form.handleSubmit(async (data) => {
11591
+ await mutateAsync(
11592
+ {
11593
+ shipping_address: {
11594
+ first_name: data.first_name,
11595
+ last_name: data.last_name,
11596
+ company: data.company,
11597
+ address_1: data.address_1,
11598
+ address_2: data.address_2,
11599
+ city: data.city,
11600
+ province: data.province,
11601
+ country_code: data.country_code,
11602
+ postal_code: data.postal_code,
11603
+ phone: data.phone
11604
+ }
11572
11605
  },
11573
- onSettled: () => {
11574
- setIsSubmitting(false);
11575
- }
11576
- });
11577
- };
11578
- const onKeydown = useCallback(
11579
- (e) => {
11580
- if (e.key === "Enter" && (e.ctrlKey || e.metaKey)) {
11581
- if (data || isSubmitting) {
11582
- return;
11606
+ {
11607
+ onSuccess: () => {
11608
+ handleSuccess();
11609
+ },
11610
+ onError: (error) => {
11611
+ toast.error(error.message);
11583
11612
  }
11584
- onSubmit();
11585
11613
  }
11586
- },
11587
- [data, isSubmitting, onSubmit]
11588
- );
11589
- useEffect(() => {
11590
- document.addEventListener("keydown", onKeydown);
11591
- return () => {
11592
- document.removeEventListener("keydown", onKeydown);
11593
- };
11594
- }, [onKeydown]);
11595
- return /* @__PURE__ */ jsxs("div", { className: "flex h-full flex-col overflow-hidden", children: [
11596
- /* @__PURE__ */ jsx(RouteFocusModal.Header, {}),
11597
- /* @__PURE__ */ jsxs(RouteFocusModal.Body, { className: "flex flex-1 flex-col overflow-hidden", children: [
11598
- /* @__PURE__ */ jsx("div", { className: "flex flex-1 flex-col items-center overflow-y-auto", children: /* @__PURE__ */ jsxs("div", { className: "flex w-full max-w-[720px] flex-col gap-y-6 px-6 py-16", children: [
11599
- /* @__PURE__ */ jsxs("div", { children: [
11600
- /* @__PURE__ */ jsx(RouteFocusModal.Title, { asChild: true, children: /* @__PURE__ */ jsx(Heading, { children: "Shipping" }) }),
11601
- /* @__PURE__ */ jsx(RouteFocusModal.Description, { asChild: true, children: /* @__PURE__ */ jsx(Text, { size: "small", className: "text-ui-fg-subtle", children: "Choose which shipping method(s) to use for the items in the order." }) })
11602
- ] }),
11603
- /* @__PURE__ */ jsx(Divider, { variant: "dashed" }),
11604
- /* @__PURE__ */ jsx(Accordion.Root, { type: "multiple", children: /* @__PURE__ */ jsxs("div", { className: "bg-ui-bg-subtle shadow-elevation-card-rest rounded-xl", children: [
11605
- /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between px-4 py-2", children: [
11614
+ );
11615
+ });
11616
+ return /* @__PURE__ */ jsx(RouteDrawer.Form, { form, children: /* @__PURE__ */ jsxs(
11617
+ KeyboundForm,
11618
+ {
11619
+ className: "flex flex-1 flex-col overflow-hidden",
11620
+ onSubmit,
11621
+ children: [
11622
+ /* @__PURE__ */ jsx(RouteDrawer.Body, { className: "flex flex-col gap-y-6 overflow-y-auto", children: /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-y-4", children: [
11623
+ /* @__PURE__ */ jsx(
11624
+ Form$2.Field,
11625
+ {
11626
+ control: form.control,
11627
+ name: "country_code",
11628
+ render: ({ field }) => /* @__PURE__ */ jsxs(Form$2.Item, { children: [
11629
+ /* @__PURE__ */ jsx(Form$2.Label, { children: "Country" }),
11630
+ /* @__PURE__ */ jsx(Form$2.Control, { children: /* @__PURE__ */ jsx(CountrySelect, { ...field }) }),
11631
+ /* @__PURE__ */ jsx(Form$2.ErrorMessage, {})
11632
+ ] })
11633
+ }
11634
+ ),
11635
+ /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-2 gap-4", children: [
11606
11636
  /* @__PURE__ */ jsx(
11607
- Text,
11637
+ Form$2.Field,
11638
+ {
11639
+ control: form.control,
11640
+ name: "first_name",
11641
+ render: ({ field }) => /* @__PURE__ */ jsxs(Form$2.Item, { children: [
11642
+ /* @__PURE__ */ jsx(Form$2.Label, { children: "First name" }),
11643
+ /* @__PURE__ */ jsx(Form$2.Control, { children: /* @__PURE__ */ jsx(Input, { ...field }) }),
11644
+ /* @__PURE__ */ jsx(Form$2.ErrorMessage, {})
11645
+ ] })
11646
+ }
11647
+ ),
11648
+ /* @__PURE__ */ jsx(
11649
+ Form$2.Field,
11650
+ {
11651
+ control: form.control,
11652
+ name: "last_name",
11653
+ render: ({ field }) => /* @__PURE__ */ jsxs(Form$2.Item, { children: [
11654
+ /* @__PURE__ */ jsx(Form$2.Label, { children: "Last name" }),
11655
+ /* @__PURE__ */ jsx(Form$2.Control, { children: /* @__PURE__ */ jsx(Input, { ...field }) }),
11656
+ /* @__PURE__ */ jsx(Form$2.ErrorMessage, {})
11657
+ ] })
11658
+ }
11659
+ )
11660
+ ] }),
11661
+ /* @__PURE__ */ jsx(
11662
+ Form$2.Field,
11663
+ {
11664
+ control: form.control,
11665
+ name: "company",
11666
+ render: ({ field }) => /* @__PURE__ */ jsxs(Form$2.Item, { children: [
11667
+ /* @__PURE__ */ jsx(Form$2.Label, { optional: true, children: "Company" }),
11668
+ /* @__PURE__ */ jsx(Form$2.Control, { children: /* @__PURE__ */ jsx(Input, { ...field }) }),
11669
+ /* @__PURE__ */ jsx(Form$2.ErrorMessage, {})
11670
+ ] })
11671
+ }
11672
+ ),
11673
+ /* @__PURE__ */ jsx(
11674
+ Form$2.Field,
11675
+ {
11676
+ control: form.control,
11677
+ name: "address_1",
11678
+ render: ({ field }) => /* @__PURE__ */ jsxs(Form$2.Item, { children: [
11679
+ /* @__PURE__ */ jsx(Form$2.Label, { children: "Address" }),
11680
+ /* @__PURE__ */ jsx(Form$2.Control, { children: /* @__PURE__ */ jsx(Input, { ...field }) }),
11681
+ /* @__PURE__ */ jsx(Form$2.ErrorMessage, {})
11682
+ ] })
11683
+ }
11684
+ ),
11685
+ /* @__PURE__ */ jsx(
11686
+ Form$2.Field,
11687
+ {
11688
+ control: form.control,
11689
+ name: "address_2",
11690
+ render: ({ field }) => /* @__PURE__ */ jsxs(Form$2.Item, { children: [
11691
+ /* @__PURE__ */ jsx(Form$2.Label, { optional: true, children: "Apartment, suite, etc." }),
11692
+ /* @__PURE__ */ jsx(Form$2.Control, { children: /* @__PURE__ */ jsx(Input, { ...field }) }),
11693
+ /* @__PURE__ */ jsx(Form$2.ErrorMessage, {})
11694
+ ] })
11695
+ }
11696
+ ),
11697
+ /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-2 gap-4", children: [
11698
+ /* @__PURE__ */ jsx(
11699
+ Form$2.Field,
11700
+ {
11701
+ control: form.control,
11702
+ name: "postal_code",
11703
+ render: ({ field }) => /* @__PURE__ */ jsxs(Form$2.Item, { children: [
11704
+ /* @__PURE__ */ jsx(Form$2.Label, { children: "Postal code" }),
11705
+ /* @__PURE__ */ jsx(Form$2.Control, { children: /* @__PURE__ */ jsx(Input, { ...field }) }),
11706
+ /* @__PURE__ */ jsx(Form$2.ErrorMessage, {})
11707
+ ] })
11708
+ }
11709
+ ),
11710
+ /* @__PURE__ */ jsx(
11711
+ Form$2.Field,
11712
+ {
11713
+ control: form.control,
11714
+ name: "city",
11715
+ render: ({ field }) => /* @__PURE__ */ jsxs(Form$2.Item, { children: [
11716
+ /* @__PURE__ */ jsx(Form$2.Label, { children: "City" }),
11717
+ /* @__PURE__ */ jsx(Form$2.Control, { children: /* @__PURE__ */ jsx(Input, { ...field }) }),
11718
+ /* @__PURE__ */ jsx(Form$2.ErrorMessage, {})
11719
+ ] })
11720
+ }
11721
+ )
11722
+ ] }),
11723
+ /* @__PURE__ */ jsx(
11724
+ Form$2.Field,
11725
+ {
11726
+ control: form.control,
11727
+ name: "province",
11728
+ render: ({ field }) => /* @__PURE__ */ jsxs(Form$2.Item, { children: [
11729
+ /* @__PURE__ */ jsx(Form$2.Label, { optional: true, children: "Province / State" }),
11730
+ /* @__PURE__ */ jsx(Form$2.Control, { children: /* @__PURE__ */ jsx(Input, { ...field }) }),
11731
+ /* @__PURE__ */ jsx(Form$2.ErrorMessage, {})
11732
+ ] })
11733
+ }
11734
+ ),
11735
+ /* @__PURE__ */ jsx(
11736
+ Form$2.Field,
11737
+ {
11738
+ control: form.control,
11739
+ name: "phone",
11740
+ render: ({ field }) => /* @__PURE__ */ jsxs(Form$2.Item, { children: [
11741
+ /* @__PURE__ */ jsx(Form$2.Label, { optional: true, children: "Phone" }),
11742
+ /* @__PURE__ */ jsx(Form$2.Control, { children: /* @__PURE__ */ jsx(Input, { ...field }) }),
11743
+ /* @__PURE__ */ jsx(Form$2.ErrorMessage, {})
11744
+ ] })
11745
+ }
11746
+ )
11747
+ ] }) }),
11748
+ /* @__PURE__ */ jsx(RouteDrawer.Footer, { children: /* @__PURE__ */ jsxs("div", { className: "flex justify-end gap-2", children: [
11749
+ /* @__PURE__ */ jsx(RouteDrawer.Close, { asChild: true, children: /* @__PURE__ */ jsx(Button, { size: "small", variant: "secondary", children: "Cancel" }) }),
11750
+ /* @__PURE__ */ jsx(Button, { size: "small", type: "submit", isLoading: isPending, children: "Save" })
11751
+ ] }) })
11752
+ ]
11753
+ }
11754
+ ) });
11755
+ };
11756
+ const schema$1 = addressSchema;
11757
+ const STACKED_FOCUS_MODAL_ID = "shipping-form";
11758
+ const Shipping = () => {
11759
+ var _a;
11760
+ const { id } = useParams();
11761
+ const { order, isPending, isError, error } = useOrder(id, {
11762
+ fields: "+items.*,+items.variant.*,+items.variant.product.*,+items.variant.product.shipping_profile.*,+currency_code"
11763
+ });
11764
+ const {
11765
+ order: preview,
11766
+ isPending: isPreviewPending,
11767
+ isError: isPreviewError,
11768
+ error: previewError
11769
+ } = useOrderPreview(id);
11770
+ useInitiateOrderEdit({ preview });
11771
+ const { onCancel } = useCancelOrderEdit({ preview });
11772
+ if (isError) {
11773
+ throw error;
11774
+ }
11775
+ if (isPreviewError) {
11776
+ throw previewError;
11777
+ }
11778
+ const orderHasItems = (((_a = order == null ? void 0 : order.items) == null ? void 0 : _a.length) || 0) > 0;
11779
+ const isReady = preview && !isPreviewPending && order && !isPending;
11780
+ return /* @__PURE__ */ jsx(RouteFocusModal, { onClose: onCancel, children: !orderHasItems ? /* @__PURE__ */ jsxs("div", { className: "flex h-full flex-col overflow-hidden ", children: [
11781
+ /* @__PURE__ */ jsx(RouteFocusModal.Header, {}),
11782
+ /* @__PURE__ */ jsx(RouteFocusModal.Body, { className: "flex flex-1 flex-col overflow-hidden", children: /* @__PURE__ */ jsx("div", { className: "flex flex-1 flex-col items-center overflow-y-auto", children: /* @__PURE__ */ jsxs("div", { className: "flex w-full max-w-[720px] flex-col gap-y-6 px-6 py-16", children: [
11783
+ /* @__PURE__ */ jsx(RouteFocusModal.Title, { asChild: true, children: /* @__PURE__ */ jsx(Heading, { children: "Shipping" }) }),
11784
+ /* @__PURE__ */ jsx(RouteFocusModal.Description, { asChild: true, children: /* @__PURE__ */ jsx(Text, { size: "small", className: "text-ui-fg-subtle", children: "This draft order currently has no items. Add items to the order before adding shipping." }) })
11785
+ ] }) }) }),
11786
+ /* @__PURE__ */ jsx(RouteFocusModal.Footer, { children: /* @__PURE__ */ jsx(RouteFocusModal.Close, { asChild: true, children: /* @__PURE__ */ jsx(Button, { size: "small", variant: "secondary", type: "button", children: "Cancel" }) }) })
11787
+ ] }) : isReady ? /* @__PURE__ */ jsx(ShippingForm, { preview, order }) : /* @__PURE__ */ jsxs("div", { children: [
11788
+ /* @__PURE__ */ jsx(RouteFocusModal.Title, { asChild: true, children: /* @__PURE__ */ jsx("span", { className: "sr-only", children: "Edit Shipping" }) }),
11789
+ /* @__PURE__ */ jsx(RouteFocusModal.Description, { asChild: true, children: /* @__PURE__ */ jsx("span", { className: "sr-only", children: "Loading data for the draft order, please wait..." }) })
11790
+ ] }) });
11791
+ };
11792
+ const ShippingForm = ({ preview, order }) => {
11793
+ var _a;
11794
+ const { setIsOpen } = useStackedModal();
11795
+ const [isSubmitting, setIsSubmitting] = useState(false);
11796
+ const [data, setData] = useState(null);
11797
+ const appliedShippingOptionIds = (_a = preview.shipping_methods) == null ? void 0 : _a.map((method) => method.shipping_option_id).filter(Boolean);
11798
+ const { shipping_options } = useShippingOptions(
11799
+ {
11800
+ id: appliedShippingOptionIds,
11801
+ fields: "+service_zone.*,+service_zone.fulfillment_set.*,+service_zone.fulfillment_set.location.*"
11802
+ },
11803
+ {
11804
+ enabled: appliedShippingOptionIds.length > 0
11805
+ }
11806
+ );
11807
+ const uniqueShippingProfiles = useMemo(() => {
11808
+ const profiles = /* @__PURE__ */ new Map();
11809
+ getUniqueShippingProfiles(order.items).forEach((profile) => {
11810
+ profiles.set(profile.id, profile);
11811
+ });
11812
+ shipping_options == null ? void 0 : shipping_options.forEach((option) => {
11813
+ profiles.set(option.shipping_profile_id, option.shipping_profile);
11814
+ });
11815
+ return Array.from(profiles.values());
11816
+ }, [order.items, shipping_options]);
11817
+ const { handleSuccess } = useRouteModal();
11818
+ const { mutateAsync: confirmOrderEdit } = useDraftOrderConfirmEdit(preview.id);
11819
+ const { mutateAsync: requestOrderEdit } = useDraftOrderRequestEdit(preview.id);
11820
+ const { mutateAsync: removeShippingMethod } = useDraftOrderRemoveShippingMethod(preview.id);
11821
+ const { mutateAsync: removeActionShippingMethod } = useDraftOrderRemoveActionShippingMethod(preview.id);
11822
+ const onSubmit = async () => {
11823
+ setIsSubmitting(true);
11824
+ let requestSucceeded = false;
11825
+ await requestOrderEdit(void 0, {
11826
+ onError: (e) => {
11827
+ toast.error(`Failed to request order edit: ${e.message}`);
11828
+ },
11829
+ onSuccess: () => {
11830
+ requestSucceeded = true;
11831
+ }
11832
+ });
11833
+ if (!requestSucceeded) {
11834
+ setIsSubmitting(false);
11835
+ return;
11836
+ }
11837
+ await confirmOrderEdit(void 0, {
11838
+ onError: (e) => {
11839
+ toast.error(`Failed to confirm order edit: ${e.message}`);
11840
+ },
11841
+ onSuccess: () => {
11842
+ handleSuccess();
11843
+ },
11844
+ onSettled: () => {
11845
+ setIsSubmitting(false);
11846
+ }
11847
+ });
11848
+ };
11849
+ const onKeydown = useCallback(
11850
+ (e) => {
11851
+ if (e.key === "Enter" && (e.ctrlKey || e.metaKey)) {
11852
+ if (data || isSubmitting) {
11853
+ return;
11854
+ }
11855
+ onSubmit();
11856
+ }
11857
+ },
11858
+ [data, isSubmitting, onSubmit]
11859
+ );
11860
+ useEffect(() => {
11861
+ document.addEventListener("keydown", onKeydown);
11862
+ return () => {
11863
+ document.removeEventListener("keydown", onKeydown);
11864
+ };
11865
+ }, [onKeydown]);
11866
+ return /* @__PURE__ */ jsxs("div", { className: "flex h-full flex-col overflow-hidden", children: [
11867
+ /* @__PURE__ */ jsx(RouteFocusModal.Header, {}),
11868
+ /* @__PURE__ */ jsxs(RouteFocusModal.Body, { className: "flex flex-1 flex-col overflow-hidden", children: [
11869
+ /* @__PURE__ */ jsx("div", { className: "flex flex-1 flex-col items-center overflow-y-auto", children: /* @__PURE__ */ jsxs("div", { className: "flex w-full max-w-[720px] flex-col gap-y-6 px-6 py-16", children: [
11870
+ /* @__PURE__ */ jsxs("div", { children: [
11871
+ /* @__PURE__ */ jsx(RouteFocusModal.Title, { asChild: true, children: /* @__PURE__ */ jsx(Heading, { children: "Shipping" }) }),
11872
+ /* @__PURE__ */ jsx(RouteFocusModal.Description, { asChild: true, children: /* @__PURE__ */ jsx(Text, { size: "small", className: "text-ui-fg-subtle", children: "Choose which shipping method(s) to use for the items in the order." }) })
11873
+ ] }),
11874
+ /* @__PURE__ */ jsx(Divider, { variant: "dashed" }),
11875
+ /* @__PURE__ */ jsx(Accordion.Root, { type: "multiple", children: /* @__PURE__ */ jsxs("div", { className: "bg-ui-bg-subtle shadow-elevation-card-rest rounded-xl", children: [
11876
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between px-4 py-2", children: [
11877
+ /* @__PURE__ */ jsx(
11878
+ Text,
11608
11879
  {
11609
11880
  size: "xsmall",
11610
11881
  weight: "plus",
@@ -12313,7 +12584,7 @@ const TransferOwnershipForm = ({ order }) => {
12313
12584
  defaultValues: {
12314
12585
  customer_id: order.customer_id || ""
12315
12586
  },
12316
- resolver: zodResolver(schema$2)
12587
+ resolver: zodResolver(schema)
12317
12588
  });
12318
12589
  const { mutateAsync, isPending } = useUpdateDraftOrder(order.id);
12319
12590
  const { handleSuccess } = useRouteModal();
@@ -12763,280 +13034,9 @@ const Illustration = () => {
12763
13034
  }
12764
13035
  );
12765
13036
  };
12766
- const schema$2 = objectType({
13037
+ const schema = objectType({
12767
13038
  customer_id: stringType().min(1)
12768
13039
  });
12769
- const ShippingAddress = () => {
12770
- const { id } = useParams();
12771
- const { order, isPending, isError, error } = useOrder(id, {
12772
- fields: "+shipping_address"
12773
- });
12774
- if (isError) {
12775
- throw error;
12776
- }
12777
- const isReady = !isPending && !!order;
12778
- return /* @__PURE__ */ jsxs(RouteDrawer, { children: [
12779
- /* @__PURE__ */ jsxs(RouteDrawer.Header, { children: [
12780
- /* @__PURE__ */ jsx(RouteDrawer.Title, { asChild: true, children: /* @__PURE__ */ jsx(Heading, { children: "Edit Shipping Address" }) }),
12781
- /* @__PURE__ */ jsx(RouteDrawer.Description, { asChild: true, children: /* @__PURE__ */ jsx("span", { className: "sr-only", children: "Edit the shipping address for the draft order" }) })
12782
- ] }),
12783
- isReady && /* @__PURE__ */ jsx(ShippingAddressForm, { order })
12784
- ] });
12785
- };
12786
- const ShippingAddressForm = ({ order }) => {
12787
- var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;
12788
- const form = useForm({
12789
- defaultValues: {
12790
- first_name: ((_a = order.shipping_address) == null ? void 0 : _a.first_name) ?? "",
12791
- last_name: ((_b = order.shipping_address) == null ? void 0 : _b.last_name) ?? "",
12792
- company: ((_c = order.shipping_address) == null ? void 0 : _c.company) ?? "",
12793
- address_1: ((_d = order.shipping_address) == null ? void 0 : _d.address_1) ?? "",
12794
- address_2: ((_e = order.shipping_address) == null ? void 0 : _e.address_2) ?? "",
12795
- city: ((_f = order.shipping_address) == null ? void 0 : _f.city) ?? "",
12796
- province: ((_g = order.shipping_address) == null ? void 0 : _g.province) ?? "",
12797
- country_code: ((_h = order.shipping_address) == null ? void 0 : _h.country_code) ?? "",
12798
- postal_code: ((_i = order.shipping_address) == null ? void 0 : _i.postal_code) ?? "",
12799
- phone: ((_j = order.shipping_address) == null ? void 0 : _j.phone) ?? ""
12800
- },
12801
- resolver: zodResolver(schema$1)
12802
- });
12803
- const { mutateAsync, isPending } = useUpdateDraftOrder(order.id);
12804
- const { handleSuccess } = useRouteModal();
12805
- const onSubmit = form.handleSubmit(async (data) => {
12806
- await mutateAsync(
12807
- {
12808
- shipping_address: {
12809
- first_name: data.first_name,
12810
- last_name: data.last_name,
12811
- company: data.company,
12812
- address_1: data.address_1,
12813
- address_2: data.address_2,
12814
- city: data.city,
12815
- province: data.province,
12816
- country_code: data.country_code,
12817
- postal_code: data.postal_code,
12818
- phone: data.phone
12819
- }
12820
- },
12821
- {
12822
- onSuccess: () => {
12823
- handleSuccess();
12824
- },
12825
- onError: (error) => {
12826
- toast.error(error.message);
12827
- }
12828
- }
12829
- );
12830
- });
12831
- return /* @__PURE__ */ jsx(RouteDrawer.Form, { form, children: /* @__PURE__ */ jsxs(
12832
- KeyboundForm,
12833
- {
12834
- className: "flex flex-1 flex-col overflow-hidden",
12835
- onSubmit,
12836
- children: [
12837
- /* @__PURE__ */ jsx(RouteDrawer.Body, { className: "flex flex-col gap-y-6 overflow-y-auto", children: /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-y-4", children: [
12838
- /* @__PURE__ */ jsx(
12839
- Form$2.Field,
12840
- {
12841
- control: form.control,
12842
- name: "country_code",
12843
- render: ({ field }) => /* @__PURE__ */ jsxs(Form$2.Item, { children: [
12844
- /* @__PURE__ */ jsx(Form$2.Label, { children: "Country" }),
12845
- /* @__PURE__ */ jsx(Form$2.Control, { children: /* @__PURE__ */ jsx(CountrySelect, { ...field }) }),
12846
- /* @__PURE__ */ jsx(Form$2.ErrorMessage, {})
12847
- ] })
12848
- }
12849
- ),
12850
- /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-2 gap-4", children: [
12851
- /* @__PURE__ */ jsx(
12852
- Form$2.Field,
12853
- {
12854
- control: form.control,
12855
- name: "first_name",
12856
- render: ({ field }) => /* @__PURE__ */ jsxs(Form$2.Item, { children: [
12857
- /* @__PURE__ */ jsx(Form$2.Label, { children: "First name" }),
12858
- /* @__PURE__ */ jsx(Form$2.Control, { children: /* @__PURE__ */ jsx(Input, { ...field }) }),
12859
- /* @__PURE__ */ jsx(Form$2.ErrorMessage, {})
12860
- ] })
12861
- }
12862
- ),
12863
- /* @__PURE__ */ jsx(
12864
- Form$2.Field,
12865
- {
12866
- control: form.control,
12867
- name: "last_name",
12868
- render: ({ field }) => /* @__PURE__ */ jsxs(Form$2.Item, { children: [
12869
- /* @__PURE__ */ jsx(Form$2.Label, { children: "Last name" }),
12870
- /* @__PURE__ */ jsx(Form$2.Control, { children: /* @__PURE__ */ jsx(Input, { ...field }) }),
12871
- /* @__PURE__ */ jsx(Form$2.ErrorMessage, {})
12872
- ] })
12873
- }
12874
- )
12875
- ] }),
12876
- /* @__PURE__ */ jsx(
12877
- Form$2.Field,
12878
- {
12879
- control: form.control,
12880
- name: "company",
12881
- render: ({ field }) => /* @__PURE__ */ jsxs(Form$2.Item, { children: [
12882
- /* @__PURE__ */ jsx(Form$2.Label, { optional: true, children: "Company" }),
12883
- /* @__PURE__ */ jsx(Form$2.Control, { children: /* @__PURE__ */ jsx(Input, { ...field }) }),
12884
- /* @__PURE__ */ jsx(Form$2.ErrorMessage, {})
12885
- ] })
12886
- }
12887
- ),
12888
- /* @__PURE__ */ jsx(
12889
- Form$2.Field,
12890
- {
12891
- control: form.control,
12892
- name: "address_1",
12893
- render: ({ field }) => /* @__PURE__ */ jsxs(Form$2.Item, { children: [
12894
- /* @__PURE__ */ jsx(Form$2.Label, { children: "Address" }),
12895
- /* @__PURE__ */ jsx(Form$2.Control, { children: /* @__PURE__ */ jsx(Input, { ...field }) }),
12896
- /* @__PURE__ */ jsx(Form$2.ErrorMessage, {})
12897
- ] })
12898
- }
12899
- ),
12900
- /* @__PURE__ */ jsx(
12901
- Form$2.Field,
12902
- {
12903
- control: form.control,
12904
- name: "address_2",
12905
- render: ({ field }) => /* @__PURE__ */ jsxs(Form$2.Item, { children: [
12906
- /* @__PURE__ */ jsx(Form$2.Label, { optional: true, children: "Apartment, suite, etc." }),
12907
- /* @__PURE__ */ jsx(Form$2.Control, { children: /* @__PURE__ */ jsx(Input, { ...field }) }),
12908
- /* @__PURE__ */ jsx(Form$2.ErrorMessage, {})
12909
- ] })
12910
- }
12911
- ),
12912
- /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-2 gap-4", children: [
12913
- /* @__PURE__ */ jsx(
12914
- Form$2.Field,
12915
- {
12916
- control: form.control,
12917
- name: "postal_code",
12918
- render: ({ field }) => /* @__PURE__ */ jsxs(Form$2.Item, { children: [
12919
- /* @__PURE__ */ jsx(Form$2.Label, { children: "Postal code" }),
12920
- /* @__PURE__ */ jsx(Form$2.Control, { children: /* @__PURE__ */ jsx(Input, { ...field }) }),
12921
- /* @__PURE__ */ jsx(Form$2.ErrorMessage, {})
12922
- ] })
12923
- }
12924
- ),
12925
- /* @__PURE__ */ jsx(
12926
- Form$2.Field,
12927
- {
12928
- control: form.control,
12929
- name: "city",
12930
- render: ({ field }) => /* @__PURE__ */ jsxs(Form$2.Item, { children: [
12931
- /* @__PURE__ */ jsx(Form$2.Label, { children: "City" }),
12932
- /* @__PURE__ */ jsx(Form$2.Control, { children: /* @__PURE__ */ jsx(Input, { ...field }) }),
12933
- /* @__PURE__ */ jsx(Form$2.ErrorMessage, {})
12934
- ] })
12935
- }
12936
- )
12937
- ] }),
12938
- /* @__PURE__ */ jsx(
12939
- Form$2.Field,
12940
- {
12941
- control: form.control,
12942
- name: "province",
12943
- render: ({ field }) => /* @__PURE__ */ jsxs(Form$2.Item, { children: [
12944
- /* @__PURE__ */ jsx(Form$2.Label, { optional: true, children: "Province / State" }),
12945
- /* @__PURE__ */ jsx(Form$2.Control, { children: /* @__PURE__ */ jsx(Input, { ...field }) }),
12946
- /* @__PURE__ */ jsx(Form$2.ErrorMessage, {})
12947
- ] })
12948
- }
12949
- ),
12950
- /* @__PURE__ */ jsx(
12951
- Form$2.Field,
12952
- {
12953
- control: form.control,
12954
- name: "phone",
12955
- render: ({ field }) => /* @__PURE__ */ jsxs(Form$2.Item, { children: [
12956
- /* @__PURE__ */ jsx(Form$2.Label, { optional: true, children: "Phone" }),
12957
- /* @__PURE__ */ jsx(Form$2.Control, { children: /* @__PURE__ */ jsx(Input, { ...field }) }),
12958
- /* @__PURE__ */ jsx(Form$2.ErrorMessage, {})
12959
- ] })
12960
- }
12961
- )
12962
- ] }) }),
12963
- /* @__PURE__ */ jsx(RouteDrawer.Footer, { children: /* @__PURE__ */ jsxs("div", { className: "flex justify-end gap-2", children: [
12964
- /* @__PURE__ */ jsx(RouteDrawer.Close, { asChild: true, children: /* @__PURE__ */ jsx(Button, { size: "small", variant: "secondary", children: "Cancel" }) }),
12965
- /* @__PURE__ */ jsx(Button, { size: "small", type: "submit", isLoading: isPending, children: "Save" })
12966
- ] }) })
12967
- ]
12968
- }
12969
- ) });
12970
- };
12971
- const schema$1 = addressSchema;
12972
- const Email = () => {
12973
- const { id } = useParams();
12974
- const { order, isPending, isError, error } = useOrder(id, {
12975
- fields: "+email"
12976
- });
12977
- if (isError) {
12978
- throw error;
12979
- }
12980
- const isReady = !isPending && !!order;
12981
- return /* @__PURE__ */ jsxs(RouteDrawer, { children: [
12982
- /* @__PURE__ */ jsxs(RouteDrawer.Header, { children: [
12983
- /* @__PURE__ */ jsx(RouteDrawer.Title, { asChild: true, children: /* @__PURE__ */ jsx(Heading, { children: "Edit Email" }) }),
12984
- /* @__PURE__ */ jsx(RouteDrawer.Description, { asChild: true, children: /* @__PURE__ */ jsx("span", { className: "sr-only", children: "Edit the email for the draft order" }) })
12985
- ] }),
12986
- isReady && /* @__PURE__ */ jsx(EmailForm, { order })
12987
- ] });
12988
- };
12989
- const EmailForm = ({ order }) => {
12990
- const form = useForm({
12991
- defaultValues: {
12992
- email: order.email ?? ""
12993
- },
12994
- resolver: zodResolver(schema)
12995
- });
12996
- const { mutateAsync, isPending } = useUpdateDraftOrder(order.id);
12997
- const { handleSuccess } = useRouteModal();
12998
- const onSubmit = form.handleSubmit(async (data) => {
12999
- await mutateAsync(
13000
- { email: data.email },
13001
- {
13002
- onSuccess: () => {
13003
- handleSuccess();
13004
- },
13005
- onError: (error) => {
13006
- toast.error(error.message);
13007
- }
13008
- }
13009
- );
13010
- });
13011
- return /* @__PURE__ */ jsx(RouteDrawer.Form, { form, children: /* @__PURE__ */ jsxs(
13012
- KeyboundForm,
13013
- {
13014
- className: "flex flex-1 flex-col overflow-hidden",
13015
- onSubmit,
13016
- children: [
13017
- /* @__PURE__ */ jsx(RouteDrawer.Body, { className: "flex flex-col gap-y-6 overflow-y-auto", children: /* @__PURE__ */ jsx(
13018
- Form$2.Field,
13019
- {
13020
- control: form.control,
13021
- name: "email",
13022
- render: ({ field }) => /* @__PURE__ */ jsxs(Form$2.Item, { children: [
13023
- /* @__PURE__ */ jsx(Form$2.Label, { children: "Email" }),
13024
- /* @__PURE__ */ jsx(Form$2.Control, { children: /* @__PURE__ */ jsx(Input, { ...field }) }),
13025
- /* @__PURE__ */ jsx(Form$2.ErrorMessage, {})
13026
- ] })
13027
- }
13028
- ) }),
13029
- /* @__PURE__ */ jsx(RouteDrawer.Footer, { children: /* @__PURE__ */ jsxs("div", { className: "flex justify-end gap-2", children: [
13030
- /* @__PURE__ */ jsx(RouteDrawer.Close, { asChild: true, children: /* @__PURE__ */ jsx(Button, { size: "small", variant: "secondary", children: "Cancel" }) }),
13031
- /* @__PURE__ */ jsx(Button, { size: "small", type: "submit", isLoading: isPending, children: "Save" })
13032
- ] }) })
13033
- ]
13034
- }
13035
- ) });
13036
- };
13037
- const schema = objectType({
13038
- email: stringType().email()
13039
- });
13040
13040
  const widgetModule = { widgets: [] };
13041
13041
  const routeModule = {
13042
13042
  routes: [
@@ -13061,6 +13061,10 @@ const routeModule = {
13061
13061
  Component: BillingAddress,
13062
13062
  path: "/draft-orders/:id/billing-address"
13063
13063
  },
13064
+ {
13065
+ Component: Email,
13066
+ path: "/draft-orders/:id/email"
13067
+ },
13064
13068
  {
13065
13069
  Component: CustomItems,
13066
13070
  path: "/draft-orders/:id/custom-items"
@@ -13081,6 +13085,10 @@ const routeModule = {
13081
13085
  Component: SalesChannel,
13082
13086
  path: "/draft-orders/:id/sales-channel"
13083
13087
  },
13088
+ {
13089
+ Component: ShippingAddress,
13090
+ path: "/draft-orders/:id/shipping-address"
13091
+ },
13084
13092
  {
13085
13093
  Component: Shipping,
13086
13094
  path: "/draft-orders/:id/shipping"
@@ -13088,14 +13096,6 @@ const routeModule = {
13088
13096
  {
13089
13097
  Component: TransferOwnership,
13090
13098
  path: "/draft-orders/:id/transfer-ownership"
13091
- },
13092
- {
13093
- Component: ShippingAddress,
13094
- path: "/draft-orders/:id/shipping-address"
13095
- },
13096
- {
13097
- Component: Email,
13098
- path: "/draft-orders/:id/email"
13099
13099
  }
13100
13100
  ]
13101
13101
  }