@medusajs/draft-order 2.11.1-preview-20251023150219 → 2.11.1-preview-20251023210200

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.
@@ -9565,6 +9565,196 @@ const ID = () => {
9565
9565
  /* @__PURE__ */ jsx(Outlet, {})
9566
9566
  ] });
9567
9567
  };
9568
+ const BillingAddress = () => {
9569
+ const { id } = useParams();
9570
+ const { order, isPending, isError, error } = useOrder(id, {
9571
+ fields: "+billing_address"
9572
+ });
9573
+ if (isError) {
9574
+ throw error;
9575
+ }
9576
+ const isReady = !isPending && !!order;
9577
+ return /* @__PURE__ */ jsxs(RouteDrawer, { children: [
9578
+ /* @__PURE__ */ jsxs(RouteDrawer.Header, { children: [
9579
+ /* @__PURE__ */ jsx(RouteDrawer.Title, { asChild: true, children: /* @__PURE__ */ jsx(Heading, { children: "Edit Billing Address" }) }),
9580
+ /* @__PURE__ */ jsx(RouteDrawer.Description, { asChild: true, children: /* @__PURE__ */ jsx("span", { className: "sr-only", children: "Edit the billing address for the draft order" }) })
9581
+ ] }),
9582
+ isReady && /* @__PURE__ */ jsx(BillingAddressForm, { order })
9583
+ ] });
9584
+ };
9585
+ const BillingAddressForm = ({ order }) => {
9586
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;
9587
+ const form = useForm({
9588
+ defaultValues: {
9589
+ first_name: ((_a = order.billing_address) == null ? void 0 : _a.first_name) ?? "",
9590
+ last_name: ((_b = order.billing_address) == null ? void 0 : _b.last_name) ?? "",
9591
+ company: ((_c = order.billing_address) == null ? void 0 : _c.company) ?? "",
9592
+ address_1: ((_d = order.billing_address) == null ? void 0 : _d.address_1) ?? "",
9593
+ address_2: ((_e = order.billing_address) == null ? void 0 : _e.address_2) ?? "",
9594
+ city: ((_f = order.billing_address) == null ? void 0 : _f.city) ?? "",
9595
+ province: ((_g = order.billing_address) == null ? void 0 : _g.province) ?? "",
9596
+ country_code: ((_h = order.billing_address) == null ? void 0 : _h.country_code) ?? "",
9597
+ postal_code: ((_i = order.billing_address) == null ? void 0 : _i.postal_code) ?? "",
9598
+ phone: ((_j = order.billing_address) == null ? void 0 : _j.phone) ?? ""
9599
+ },
9600
+ resolver: zodResolver(schema$5)
9601
+ });
9602
+ const { mutateAsync, isPending } = useUpdateDraftOrder(order.id);
9603
+ const { handleSuccess } = useRouteModal();
9604
+ const onSubmit = form.handleSubmit(async (data) => {
9605
+ await mutateAsync(
9606
+ { billing_address: data },
9607
+ {
9608
+ onSuccess: () => {
9609
+ handleSuccess();
9610
+ },
9611
+ onError: (error) => {
9612
+ toast.error(error.message);
9613
+ }
9614
+ }
9615
+ );
9616
+ });
9617
+ return /* @__PURE__ */ jsx(RouteDrawer.Form, { form, children: /* @__PURE__ */ jsxs(
9618
+ KeyboundForm,
9619
+ {
9620
+ className: "flex flex-1 flex-col overflow-hidden",
9621
+ onSubmit,
9622
+ children: [
9623
+ /* @__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: [
9624
+ /* @__PURE__ */ jsx(
9625
+ Form$2.Field,
9626
+ {
9627
+ control: form.control,
9628
+ name: "country_code",
9629
+ render: ({ field }) => /* @__PURE__ */ jsxs(Form$2.Item, { children: [
9630
+ /* @__PURE__ */ jsx(Form$2.Label, { children: "Country" }),
9631
+ /* @__PURE__ */ jsx(Form$2.Control, { children: /* @__PURE__ */ jsx(CountrySelect, { ...field }) }),
9632
+ /* @__PURE__ */ jsx(Form$2.ErrorMessage, {})
9633
+ ] })
9634
+ }
9635
+ ),
9636
+ /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-2 gap-4", children: [
9637
+ /* @__PURE__ */ jsx(
9638
+ Form$2.Field,
9639
+ {
9640
+ control: form.control,
9641
+ name: "first_name",
9642
+ render: ({ field }) => /* @__PURE__ */ jsxs(Form$2.Item, { children: [
9643
+ /* @__PURE__ */ jsx(Form$2.Label, { children: "First name" }),
9644
+ /* @__PURE__ */ jsx(Form$2.Control, { children: /* @__PURE__ */ jsx(Input, { ...field }) }),
9645
+ /* @__PURE__ */ jsx(Form$2.ErrorMessage, {})
9646
+ ] })
9647
+ }
9648
+ ),
9649
+ /* @__PURE__ */ jsx(
9650
+ Form$2.Field,
9651
+ {
9652
+ control: form.control,
9653
+ name: "last_name",
9654
+ render: ({ field }) => /* @__PURE__ */ jsxs(Form$2.Item, { children: [
9655
+ /* @__PURE__ */ jsx(Form$2.Label, { children: "Last name" }),
9656
+ /* @__PURE__ */ jsx(Form$2.Control, { children: /* @__PURE__ */ jsx(Input, { ...field }) }),
9657
+ /* @__PURE__ */ jsx(Form$2.ErrorMessage, {})
9658
+ ] })
9659
+ }
9660
+ )
9661
+ ] }),
9662
+ /* @__PURE__ */ jsx(
9663
+ Form$2.Field,
9664
+ {
9665
+ control: form.control,
9666
+ name: "company",
9667
+ render: ({ field }) => /* @__PURE__ */ jsxs(Form$2.Item, { children: [
9668
+ /* @__PURE__ */ jsx(Form$2.Label, { optional: true, children: "Company" }),
9669
+ /* @__PURE__ */ jsx(Form$2.Control, { children: /* @__PURE__ */ jsx(Input, { ...field }) }),
9670
+ /* @__PURE__ */ jsx(Form$2.ErrorMessage, {})
9671
+ ] })
9672
+ }
9673
+ ),
9674
+ /* @__PURE__ */ jsx(
9675
+ Form$2.Field,
9676
+ {
9677
+ control: form.control,
9678
+ name: "address_1",
9679
+ render: ({ field }) => /* @__PURE__ */ jsxs(Form$2.Item, { children: [
9680
+ /* @__PURE__ */ jsx(Form$2.Label, { children: "Address" }),
9681
+ /* @__PURE__ */ jsx(Form$2.Control, { children: /* @__PURE__ */ jsx(Input, { ...field }) }),
9682
+ /* @__PURE__ */ jsx(Form$2.ErrorMessage, {})
9683
+ ] })
9684
+ }
9685
+ ),
9686
+ /* @__PURE__ */ jsx(
9687
+ Form$2.Field,
9688
+ {
9689
+ control: form.control,
9690
+ name: "address_2",
9691
+ render: ({ field }) => /* @__PURE__ */ jsxs(Form$2.Item, { children: [
9692
+ /* @__PURE__ */ jsx(Form$2.Label, { optional: true, children: "Apartment, suite, etc." }),
9693
+ /* @__PURE__ */ jsx(Form$2.Control, { children: /* @__PURE__ */ jsx(Input, { ...field }) }),
9694
+ /* @__PURE__ */ jsx(Form$2.ErrorMessage, {})
9695
+ ] })
9696
+ }
9697
+ ),
9698
+ /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-2 gap-4", children: [
9699
+ /* @__PURE__ */ jsx(
9700
+ Form$2.Field,
9701
+ {
9702
+ control: form.control,
9703
+ name: "postal_code",
9704
+ render: ({ field }) => /* @__PURE__ */ jsxs(Form$2.Item, { children: [
9705
+ /* @__PURE__ */ jsx(Form$2.Label, { children: "Postal code" }),
9706
+ /* @__PURE__ */ jsx(Form$2.Control, { children: /* @__PURE__ */ jsx(Input, { ...field }) }),
9707
+ /* @__PURE__ */ jsx(Form$2.ErrorMessage, {})
9708
+ ] })
9709
+ }
9710
+ ),
9711
+ /* @__PURE__ */ jsx(
9712
+ Form$2.Field,
9713
+ {
9714
+ control: form.control,
9715
+ name: "city",
9716
+ render: ({ field }) => /* @__PURE__ */ jsxs(Form$2.Item, { children: [
9717
+ /* @__PURE__ */ jsx(Form$2.Label, { children: "City" }),
9718
+ /* @__PURE__ */ jsx(Form$2.Control, { children: /* @__PURE__ */ jsx(Input, { ...field }) }),
9719
+ /* @__PURE__ */ jsx(Form$2.ErrorMessage, {})
9720
+ ] })
9721
+ }
9722
+ )
9723
+ ] }),
9724
+ /* @__PURE__ */ jsx(
9725
+ Form$2.Field,
9726
+ {
9727
+ control: form.control,
9728
+ name: "province",
9729
+ render: ({ field }) => /* @__PURE__ */ jsxs(Form$2.Item, { children: [
9730
+ /* @__PURE__ */ jsx(Form$2.Label, { optional: true, children: "Province / State" }),
9731
+ /* @__PURE__ */ jsx(Form$2.Control, { children: /* @__PURE__ */ jsx(Input, { ...field }) }),
9732
+ /* @__PURE__ */ jsx(Form$2.ErrorMessage, {})
9733
+ ] })
9734
+ }
9735
+ ),
9736
+ /* @__PURE__ */ jsx(
9737
+ Form$2.Field,
9738
+ {
9739
+ control: form.control,
9740
+ name: "phone",
9741
+ render: ({ field }) => /* @__PURE__ */ jsxs(Form$2.Item, { children: [
9742
+ /* @__PURE__ */ jsx(Form$2.Label, { optional: true, children: "Phone" }),
9743
+ /* @__PURE__ */ jsx(Form$2.Control, { children: /* @__PURE__ */ jsx(Input, { ...field }) }),
9744
+ /* @__PURE__ */ jsx(Form$2.ErrorMessage, {})
9745
+ ] })
9746
+ }
9747
+ )
9748
+ ] }) }),
9749
+ /* @__PURE__ */ jsx(RouteDrawer.Footer, { children: /* @__PURE__ */ jsxs("div", { className: "flex justify-end gap-2", children: [
9750
+ /* @__PURE__ */ jsx(RouteDrawer.Close, { asChild: true, children: /* @__PURE__ */ jsx(Button, { size: "small", variant: "secondary", children: "Cancel" }) }),
9751
+ /* @__PURE__ */ jsx(Button, { size: "small", type: "submit", isLoading: isPending, children: "Save" })
9752
+ ] }) })
9753
+ ]
9754
+ }
9755
+ ) });
9756
+ };
9757
+ const schema$5 = addressSchema;
9568
9758
  const CustomItems = () => {
9569
9759
  return /* @__PURE__ */ jsxs(RouteDrawer, { children: [
9570
9760
  /* @__PURE__ */ jsx(RouteDrawer.Header, { children: /* @__PURE__ */ jsx(RouteDrawer.Title, { asChild: true, children: /* @__PURE__ */ jsx(Heading, { children: "Edit Custom Items" }) }) }),
@@ -9573,7 +9763,7 @@ const CustomItems = () => {
9573
9763
  };
9574
9764
  const CustomItemsForm = () => {
9575
9765
  const form = useForm({
9576
- resolver: zodResolver(schema$5)
9766
+ resolver: zodResolver(schema$4)
9577
9767
  });
9578
9768
  return /* @__PURE__ */ jsx(RouteDrawer.Form, { form, children: /* @__PURE__ */ jsxs(KeyboundForm, { className: "flex flex-1 flex-col", children: [
9579
9769
  /* @__PURE__ */ jsx(RouteDrawer.Body, {}),
@@ -9583,45 +9773,113 @@ const CustomItemsForm = () => {
9583
9773
  ] }) })
9584
9774
  ] }) });
9585
9775
  };
9586
- const schema$5 = objectType({
9776
+ const schema$4 = objectType({
9587
9777
  email: stringType().email()
9588
9778
  });
9589
- const NumberInput = forwardRef(
9590
- ({
9591
- value,
9592
- onChange,
9593
- size = "base",
9594
- min = 0,
9595
- max = 100,
9596
- step = 1,
9597
- className,
9598
- disabled,
9599
- ...props
9600
- }, ref) => {
9601
- const handleChange = (event) => {
9602
- const newValue = event.target.value === "" ? min : Number(event.target.value);
9603
- if (!isNaN(newValue) && (max === void 0 || newValue <= max) && (min === void 0 || newValue >= min)) {
9604
- onChange(newValue);
9605
- }
9606
- };
9607
- const handleIncrement = () => {
9608
- const newValue = value + step;
9609
- if (max === void 0 || newValue <= max) {
9610
- onChange(newValue);
9611
- }
9612
- };
9613
- const handleDecrement = () => {
9614
- const newValue = value - step;
9615
- if (min === void 0 || newValue >= min) {
9616
- onChange(newValue);
9617
- }
9618
- };
9619
- return /* @__PURE__ */ jsxs(
9620
- "div",
9779
+ const Email = () => {
9780
+ const { id } = useParams();
9781
+ const { order, isPending, isError, error } = useOrder(id, {
9782
+ fields: "+email"
9783
+ });
9784
+ if (isError) {
9785
+ throw error;
9786
+ }
9787
+ const isReady = !isPending && !!order;
9788
+ return /* @__PURE__ */ jsxs(RouteDrawer, { children: [
9789
+ /* @__PURE__ */ jsxs(RouteDrawer.Header, { children: [
9790
+ /* @__PURE__ */ jsx(RouteDrawer.Title, { asChild: true, children: /* @__PURE__ */ jsx(Heading, { children: "Edit Email" }) }),
9791
+ /* @__PURE__ */ jsx(RouteDrawer.Description, { asChild: true, children: /* @__PURE__ */ jsx("span", { className: "sr-only", children: "Edit the email for the draft order" }) })
9792
+ ] }),
9793
+ isReady && /* @__PURE__ */ jsx(EmailForm, { order })
9794
+ ] });
9795
+ };
9796
+ const EmailForm = ({ order }) => {
9797
+ const form = useForm({
9798
+ defaultValues: {
9799
+ email: order.email ?? ""
9800
+ },
9801
+ resolver: zodResolver(schema$3)
9802
+ });
9803
+ const { mutateAsync, isPending } = useUpdateDraftOrder(order.id);
9804
+ const { handleSuccess } = useRouteModal();
9805
+ const onSubmit = form.handleSubmit(async (data) => {
9806
+ await mutateAsync(
9807
+ { email: data.email },
9621
9808
  {
9622
- className: clx(
9623
- "inline-flex rounded-md bg-ui-bg-field shadow-borders-base overflow-hidden divide-x transition-fg",
9624
- "[&:has(input:focus)]:shadow-borders-interactive-with-active",
9809
+ onSuccess: () => {
9810
+ handleSuccess();
9811
+ },
9812
+ onError: (error) => {
9813
+ toast.error(error.message);
9814
+ }
9815
+ }
9816
+ );
9817
+ });
9818
+ return /* @__PURE__ */ jsx(RouteDrawer.Form, { form, children: /* @__PURE__ */ jsxs(
9819
+ KeyboundForm,
9820
+ {
9821
+ className: "flex flex-1 flex-col overflow-hidden",
9822
+ onSubmit,
9823
+ children: [
9824
+ /* @__PURE__ */ jsx(RouteDrawer.Body, { className: "flex flex-col gap-y-6 overflow-y-auto", children: /* @__PURE__ */ jsx(
9825
+ Form$2.Field,
9826
+ {
9827
+ control: form.control,
9828
+ name: "email",
9829
+ render: ({ field }) => /* @__PURE__ */ jsxs(Form$2.Item, { children: [
9830
+ /* @__PURE__ */ jsx(Form$2.Label, { children: "Email" }),
9831
+ /* @__PURE__ */ jsx(Form$2.Control, { children: /* @__PURE__ */ jsx(Input, { ...field }) }),
9832
+ /* @__PURE__ */ jsx(Form$2.ErrorMessage, {})
9833
+ ] })
9834
+ }
9835
+ ) }),
9836
+ /* @__PURE__ */ jsx(RouteDrawer.Footer, { children: /* @__PURE__ */ jsxs("div", { className: "flex justify-end gap-2", children: [
9837
+ /* @__PURE__ */ jsx(RouteDrawer.Close, { asChild: true, children: /* @__PURE__ */ jsx(Button, { size: "small", variant: "secondary", children: "Cancel" }) }),
9838
+ /* @__PURE__ */ jsx(Button, { size: "small", type: "submit", isLoading: isPending, children: "Save" })
9839
+ ] }) })
9840
+ ]
9841
+ }
9842
+ ) });
9843
+ };
9844
+ const schema$3 = objectType({
9845
+ email: stringType().email()
9846
+ });
9847
+ const NumberInput = forwardRef(
9848
+ ({
9849
+ value,
9850
+ onChange,
9851
+ size = "base",
9852
+ min = 0,
9853
+ max = 100,
9854
+ step = 1,
9855
+ className,
9856
+ disabled,
9857
+ ...props
9858
+ }, ref) => {
9859
+ const handleChange = (event) => {
9860
+ const newValue = event.target.value === "" ? min : Number(event.target.value);
9861
+ if (!isNaN(newValue) && (max === void 0 || newValue <= max) && (min === void 0 || newValue >= min)) {
9862
+ onChange(newValue);
9863
+ }
9864
+ };
9865
+ const handleIncrement = () => {
9866
+ const newValue = value + step;
9867
+ if (max === void 0 || newValue <= max) {
9868
+ onChange(newValue);
9869
+ }
9870
+ };
9871
+ const handleDecrement = () => {
9872
+ const newValue = value - step;
9873
+ if (min === void 0 || newValue >= min) {
9874
+ onChange(newValue);
9875
+ }
9876
+ };
9877
+ return /* @__PURE__ */ jsxs(
9878
+ "div",
9879
+ {
9880
+ className: clx(
9881
+ "inline-flex rounded-md bg-ui-bg-field shadow-borders-base overflow-hidden divide-x transition-fg",
9882
+ "[&:has(input:focus)]:shadow-borders-interactive-with-active",
9625
9883
  {
9626
9884
  "h-7": size === "small",
9627
9885
  "h-8": size === "base"
@@ -11190,303 +11448,58 @@ function getPromotionIds(items, shippingMethods) {
11190
11448
  const SalesChannel = () => {
11191
11449
  const { id } = useParams();
11192
11450
  const { draft_order, isPending, isError, error } = useDraftOrder(
11193
- id,
11194
- {
11195
- fields: "+sales_channel_id"
11196
- },
11197
- {
11198
- enabled: !!id
11199
- }
11200
- );
11201
- if (isError) {
11202
- throw error;
11203
- }
11204
- const ISrEADY = !!draft_order && !isPending;
11205
- return /* @__PURE__ */ jsxs(RouteDrawer, { children: [
11206
- /* @__PURE__ */ jsxs(RouteDrawer.Header, { children: [
11207
- /* @__PURE__ */ jsx(RouteDrawer.Title, { asChild: true, children: /* @__PURE__ */ jsx(Heading, { children: "Edit Sales Channel" }) }),
11208
- /* @__PURE__ */ jsx(RouteDrawer.Description, { asChild: true, children: /* @__PURE__ */ jsx("span", { className: "sr-only", children: "Update which sales channel the draft order is associated with" }) })
11209
- ] }),
11210
- ISrEADY && /* @__PURE__ */ jsx(SalesChannelForm, { order: draft_order })
11211
- ] });
11212
- };
11213
- const SalesChannelForm = ({ order }) => {
11214
- const form = useForm({
11215
- defaultValues: {
11216
- sales_channel_id: order.sales_channel_id || ""
11217
- },
11218
- resolver: zodResolver(schema$4)
11219
- });
11220
- const { mutateAsync, isPending } = useUpdateDraftOrder(order.id);
11221
- const { handleSuccess } = useRouteModal();
11222
- const onSubmit = form.handleSubmit(async (data) => {
11223
- await mutateAsync(
11224
- {
11225
- sales_channel_id: data.sales_channel_id
11226
- },
11227
- {
11228
- onSuccess: () => {
11229
- toast.success("Sales channel updated");
11230
- handleSuccess();
11231
- },
11232
- onError: (error) => {
11233
- toast.error(error.message);
11234
- }
11235
- }
11236
- );
11237
- });
11238
- return /* @__PURE__ */ jsx(RouteDrawer.Form, { form, children: /* @__PURE__ */ jsxs(
11239
- KeyboundForm,
11240
- {
11241
- className: "flex flex-1 flex-col overflow-hidden",
11242
- onSubmit,
11243
- children: [
11244
- /* @__PURE__ */ jsx(RouteDrawer.Body, { className: "flex flex-col gap-y-6 overflow-y-auto", children: /* @__PURE__ */ jsx(SalesChannelField, { control: form.control, order }) }),
11245
- /* @__PURE__ */ jsx(RouteDrawer.Footer, { children: /* @__PURE__ */ jsxs("div", { className: "flex justify-end gap-2", children: [
11246
- /* @__PURE__ */ jsx(RouteDrawer.Close, { asChild: true, children: /* @__PURE__ */ jsx(Button, { size: "small", variant: "secondary", children: "Cancel" }) }),
11247
- /* @__PURE__ */ jsx(Button, { size: "small", type: "submit", isLoading: isPending, children: "Save" })
11248
- ] }) })
11249
- ]
11250
- }
11251
- ) });
11252
- };
11253
- const SalesChannelField = ({ control, order }) => {
11254
- const salesChannels = useComboboxData({
11255
- queryFn: async (params) => {
11256
- return await sdk.admin.salesChannel.list(params);
11257
- },
11258
- queryKey: ["sales-channels"],
11259
- getOptions: (data) => {
11260
- return data.sales_channels.map((salesChannel) => ({
11261
- label: salesChannel.name,
11262
- value: salesChannel.id
11263
- }));
11264
- },
11265
- defaultValue: order.sales_channel_id || void 0
11266
- });
11267
- return /* @__PURE__ */ jsx(
11268
- Form$2.Field,
11269
- {
11270
- control,
11271
- name: "sales_channel_id",
11272
- render: ({ field }) => {
11273
- return /* @__PURE__ */ jsxs(Form$2.Item, { children: [
11274
- /* @__PURE__ */ jsx(Form$2.Label, { children: "Sales Channel" }),
11275
- /* @__PURE__ */ jsx(Form$2.Control, { children: /* @__PURE__ */ jsx(
11276
- Combobox,
11277
- {
11278
- options: salesChannels.options,
11279
- fetchNextPage: salesChannels.fetchNextPage,
11280
- isFetchingNextPage: salesChannels.isFetchingNextPage,
11281
- searchValue: salesChannels.searchValue,
11282
- onSearchValueChange: salesChannels.onSearchValueChange,
11283
- placeholder: "Select sales channel",
11284
- ...field
11285
- }
11286
- ) }),
11287
- /* @__PURE__ */ jsx(Form$2.ErrorMessage, {})
11288
- ] });
11289
- }
11290
- }
11291
- );
11292
- };
11293
- const schema$4 = objectType({
11294
- sales_channel_id: stringType().min(1)
11295
- });
11296
- const ShippingAddress = () => {
11297
- const { id } = useParams();
11298
- const { order, isPending, isError, error } = useOrder(id, {
11299
- fields: "+shipping_address"
11300
- });
11301
- if (isError) {
11302
- throw error;
11303
- }
11304
- const isReady = !isPending && !!order;
11305
- return /* @__PURE__ */ jsxs(RouteDrawer, { children: [
11306
- /* @__PURE__ */ jsxs(RouteDrawer.Header, { children: [
11307
- /* @__PURE__ */ jsx(RouteDrawer.Title, { asChild: true, children: /* @__PURE__ */ jsx(Heading, { children: "Edit Shipping Address" }) }),
11308
- /* @__PURE__ */ jsx(RouteDrawer.Description, { asChild: true, children: /* @__PURE__ */ jsx("span", { className: "sr-only", children: "Edit the shipping address for the draft order" }) })
11309
- ] }),
11310
- isReady && /* @__PURE__ */ jsx(ShippingAddressForm, { order })
11311
- ] });
11312
- };
11313
- const ShippingAddressForm = ({ order }) => {
11314
- var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;
11315
- const form = useForm({
11316
- defaultValues: {
11317
- first_name: ((_a = order.shipping_address) == null ? void 0 : _a.first_name) ?? "",
11318
- last_name: ((_b = order.shipping_address) == null ? void 0 : _b.last_name) ?? "",
11319
- company: ((_c = order.shipping_address) == null ? void 0 : _c.company) ?? "",
11320
- address_1: ((_d = order.shipping_address) == null ? void 0 : _d.address_1) ?? "",
11321
- address_2: ((_e = order.shipping_address) == null ? void 0 : _e.address_2) ?? "",
11322
- city: ((_f = order.shipping_address) == null ? void 0 : _f.city) ?? "",
11323
- province: ((_g = order.shipping_address) == null ? void 0 : _g.province) ?? "",
11324
- country_code: ((_h = order.shipping_address) == null ? void 0 : _h.country_code) ?? "",
11325
- postal_code: ((_i = order.shipping_address) == null ? void 0 : _i.postal_code) ?? "",
11326
- phone: ((_j = order.shipping_address) == null ? void 0 : _j.phone) ?? ""
11327
- },
11328
- resolver: zodResolver(schema$3)
11329
- });
11330
- const { mutateAsync, isPending } = useUpdateDraftOrder(order.id);
11331
- const { handleSuccess } = useRouteModal();
11332
- const onSubmit = form.handleSubmit(async (data) => {
11333
- await mutateAsync(
11334
- {
11335
- shipping_address: {
11336
- first_name: data.first_name,
11337
- last_name: data.last_name,
11338
- company: data.company,
11339
- address_1: data.address_1,
11340
- address_2: data.address_2,
11341
- city: data.city,
11342
- province: data.province,
11343
- country_code: data.country_code,
11344
- postal_code: data.postal_code,
11345
- phone: data.phone
11346
- }
11347
- },
11348
- {
11349
- onSuccess: () => {
11350
- handleSuccess();
11351
- },
11352
- onError: (error) => {
11353
- toast.error(error.message);
11354
- }
11355
- }
11356
- );
11357
- });
11358
- return /* @__PURE__ */ jsx(RouteDrawer.Form, { form, children: /* @__PURE__ */ jsxs(
11359
- KeyboundForm,
11360
- {
11361
- className: "flex flex-1 flex-col overflow-hidden",
11362
- onSubmit,
11363
- children: [
11364
- /* @__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: [
11365
- /* @__PURE__ */ jsx(
11366
- Form$2.Field,
11367
- {
11368
- control: form.control,
11369
- name: "country_code",
11370
- render: ({ field }) => /* @__PURE__ */ jsxs(Form$2.Item, { children: [
11371
- /* @__PURE__ */ jsx(Form$2.Label, { children: "Country" }),
11372
- /* @__PURE__ */ jsx(Form$2.Control, { children: /* @__PURE__ */ jsx(CountrySelect, { ...field }) }),
11373
- /* @__PURE__ */ jsx(Form$2.ErrorMessage, {})
11374
- ] })
11375
- }
11376
- ),
11377
- /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-2 gap-4", children: [
11378
- /* @__PURE__ */ jsx(
11379
- Form$2.Field,
11380
- {
11381
- control: form.control,
11382
- name: "first_name",
11383
- render: ({ field }) => /* @__PURE__ */ jsxs(Form$2.Item, { children: [
11384
- /* @__PURE__ */ jsx(Form$2.Label, { children: "First name" }),
11385
- /* @__PURE__ */ jsx(Form$2.Control, { children: /* @__PURE__ */ jsx(Input, { ...field }) }),
11386
- /* @__PURE__ */ jsx(Form$2.ErrorMessage, {})
11387
- ] })
11388
- }
11389
- ),
11390
- /* @__PURE__ */ jsx(
11391
- Form$2.Field,
11392
- {
11393
- control: form.control,
11394
- name: "last_name",
11395
- render: ({ field }) => /* @__PURE__ */ jsxs(Form$2.Item, { children: [
11396
- /* @__PURE__ */ jsx(Form$2.Label, { children: "Last name" }),
11397
- /* @__PURE__ */ jsx(Form$2.Control, { children: /* @__PURE__ */ jsx(Input, { ...field }) }),
11398
- /* @__PURE__ */ jsx(Form$2.ErrorMessage, {})
11399
- ] })
11400
- }
11401
- )
11402
- ] }),
11403
- /* @__PURE__ */ jsx(
11404
- Form$2.Field,
11405
- {
11406
- control: form.control,
11407
- name: "company",
11408
- render: ({ field }) => /* @__PURE__ */ jsxs(Form$2.Item, { children: [
11409
- /* @__PURE__ */ jsx(Form$2.Label, { optional: true, children: "Company" }),
11410
- /* @__PURE__ */ jsx(Form$2.Control, { children: /* @__PURE__ */ jsx(Input, { ...field }) }),
11411
- /* @__PURE__ */ jsx(Form$2.ErrorMessage, {})
11412
- ] })
11413
- }
11414
- ),
11415
- /* @__PURE__ */ jsx(
11416
- Form$2.Field,
11417
- {
11418
- control: form.control,
11419
- name: "address_1",
11420
- render: ({ field }) => /* @__PURE__ */ jsxs(Form$2.Item, { children: [
11421
- /* @__PURE__ */ jsx(Form$2.Label, { children: "Address" }),
11422
- /* @__PURE__ */ jsx(Form$2.Control, { children: /* @__PURE__ */ jsx(Input, { ...field }) }),
11423
- /* @__PURE__ */ jsx(Form$2.ErrorMessage, {})
11424
- ] })
11425
- }
11426
- ),
11427
- /* @__PURE__ */ jsx(
11428
- Form$2.Field,
11429
- {
11430
- control: form.control,
11431
- name: "address_2",
11432
- render: ({ field }) => /* @__PURE__ */ jsxs(Form$2.Item, { children: [
11433
- /* @__PURE__ */ jsx(Form$2.Label, { optional: true, children: "Apartment, suite, etc." }),
11434
- /* @__PURE__ */ jsx(Form$2.Control, { children: /* @__PURE__ */ jsx(Input, { ...field }) }),
11435
- /* @__PURE__ */ jsx(Form$2.ErrorMessage, {})
11436
- ] })
11437
- }
11438
- ),
11439
- /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-2 gap-4", children: [
11440
- /* @__PURE__ */ jsx(
11441
- Form$2.Field,
11442
- {
11443
- control: form.control,
11444
- name: "postal_code",
11445
- render: ({ field }) => /* @__PURE__ */ jsxs(Form$2.Item, { children: [
11446
- /* @__PURE__ */ jsx(Form$2.Label, { children: "Postal code" }),
11447
- /* @__PURE__ */ jsx(Form$2.Control, { children: /* @__PURE__ */ jsx(Input, { ...field }) }),
11448
- /* @__PURE__ */ jsx(Form$2.ErrorMessage, {})
11449
- ] })
11450
- }
11451
- ),
11452
- /* @__PURE__ */ jsx(
11453
- Form$2.Field,
11454
- {
11455
- control: form.control,
11456
- name: "city",
11457
- render: ({ field }) => /* @__PURE__ */ jsxs(Form$2.Item, { children: [
11458
- /* @__PURE__ */ jsx(Form$2.Label, { children: "City" }),
11459
- /* @__PURE__ */ jsx(Form$2.Control, { children: /* @__PURE__ */ jsx(Input, { ...field }) }),
11460
- /* @__PURE__ */ jsx(Form$2.ErrorMessage, {})
11461
- ] })
11462
- }
11463
- )
11464
- ] }),
11465
- /* @__PURE__ */ jsx(
11466
- Form$2.Field,
11467
- {
11468
- control: form.control,
11469
- name: "province",
11470
- render: ({ field }) => /* @__PURE__ */ jsxs(Form$2.Item, { children: [
11471
- /* @__PURE__ */ jsx(Form$2.Label, { optional: true, children: "Province / State" }),
11472
- /* @__PURE__ */ jsx(Form$2.Control, { children: /* @__PURE__ */ jsx(Input, { ...field }) }),
11473
- /* @__PURE__ */ jsx(Form$2.ErrorMessage, {})
11474
- ] })
11475
- }
11476
- ),
11477
- /* @__PURE__ */ jsx(
11478
- Form$2.Field,
11479
- {
11480
- control: form.control,
11481
- name: "phone",
11482
- render: ({ field }) => /* @__PURE__ */ jsxs(Form$2.Item, { children: [
11483
- /* @__PURE__ */ jsx(Form$2.Label, { optional: true, children: "Phone" }),
11484
- /* @__PURE__ */ jsx(Form$2.Control, { children: /* @__PURE__ */ jsx(Input, { ...field }) }),
11485
- /* @__PURE__ */ jsx(Form$2.ErrorMessage, {})
11486
- ] })
11487
- }
11488
- )
11489
- ] }) }),
11451
+ id,
11452
+ {
11453
+ fields: "+sales_channel_id"
11454
+ },
11455
+ {
11456
+ enabled: !!id
11457
+ }
11458
+ );
11459
+ if (isError) {
11460
+ throw error;
11461
+ }
11462
+ const ISrEADY = !!draft_order && !isPending;
11463
+ return /* @__PURE__ */ jsxs(RouteDrawer, { children: [
11464
+ /* @__PURE__ */ jsxs(RouteDrawer.Header, { children: [
11465
+ /* @__PURE__ */ jsx(RouteDrawer.Title, { asChild: true, children: /* @__PURE__ */ jsx(Heading, { children: "Edit Sales Channel" }) }),
11466
+ /* @__PURE__ */ jsx(RouteDrawer.Description, { asChild: true, children: /* @__PURE__ */ jsx("span", { className: "sr-only", children: "Update which sales channel the draft order is associated with" }) })
11467
+ ] }),
11468
+ ISrEADY && /* @__PURE__ */ jsx(SalesChannelForm, { order: draft_order })
11469
+ ] });
11470
+ };
11471
+ const SalesChannelForm = ({ order }) => {
11472
+ const form = useForm({
11473
+ defaultValues: {
11474
+ sales_channel_id: order.sales_channel_id || ""
11475
+ },
11476
+ resolver: zodResolver(schema$2)
11477
+ });
11478
+ const { mutateAsync, isPending } = useUpdateDraftOrder(order.id);
11479
+ const { handleSuccess } = useRouteModal();
11480
+ const onSubmit = form.handleSubmit(async (data) => {
11481
+ await mutateAsync(
11482
+ {
11483
+ sales_channel_id: data.sales_channel_id
11484
+ },
11485
+ {
11486
+ onSuccess: () => {
11487
+ toast.success("Sales channel updated");
11488
+ handleSuccess();
11489
+ },
11490
+ onError: (error) => {
11491
+ toast.error(error.message);
11492
+ }
11493
+ }
11494
+ );
11495
+ });
11496
+ return /* @__PURE__ */ jsx(RouteDrawer.Form, { form, children: /* @__PURE__ */ jsxs(
11497
+ KeyboundForm,
11498
+ {
11499
+ className: "flex flex-1 flex-col overflow-hidden",
11500
+ onSubmit,
11501
+ children: [
11502
+ /* @__PURE__ */ jsx(RouteDrawer.Body, { className: "flex flex-col gap-y-6 overflow-y-auto", children: /* @__PURE__ */ jsx(SalesChannelField, { control: form.control, order }) }),
11490
11503
  /* @__PURE__ */ jsx(RouteDrawer.Footer, { children: /* @__PURE__ */ jsxs("div", { className: "flex justify-end gap-2", children: [
11491
11504
  /* @__PURE__ */ jsx(RouteDrawer.Close, { asChild: true, children: /* @__PURE__ */ jsx(Button, { size: "small", variant: "secondary", children: "Cancel" }) }),
11492
11505
  /* @__PURE__ */ jsx(Button, { size: "small", type: "submit", isLoading: isPending, children: "Save" })
@@ -11495,7 +11508,49 @@ const ShippingAddressForm = ({ order }) => {
11495
11508
  }
11496
11509
  ) });
11497
11510
  };
11498
- const schema$3 = addressSchema;
11511
+ const SalesChannelField = ({ control, order }) => {
11512
+ const salesChannels = useComboboxData({
11513
+ queryFn: async (params) => {
11514
+ return await sdk.admin.salesChannel.list(params);
11515
+ },
11516
+ queryKey: ["sales-channels"],
11517
+ getOptions: (data) => {
11518
+ return data.sales_channels.map((salesChannel) => ({
11519
+ label: salesChannel.name,
11520
+ value: salesChannel.id
11521
+ }));
11522
+ },
11523
+ defaultValue: order.sales_channel_id || void 0
11524
+ });
11525
+ return /* @__PURE__ */ jsx(
11526
+ Form$2.Field,
11527
+ {
11528
+ control,
11529
+ name: "sales_channel_id",
11530
+ render: ({ field }) => {
11531
+ return /* @__PURE__ */ jsxs(Form$2.Item, { children: [
11532
+ /* @__PURE__ */ jsx(Form$2.Label, { children: "Sales Channel" }),
11533
+ /* @__PURE__ */ jsx(Form$2.Control, { children: /* @__PURE__ */ jsx(
11534
+ Combobox,
11535
+ {
11536
+ options: salesChannels.options,
11537
+ fetchNextPage: salesChannels.fetchNextPage,
11538
+ isFetchingNextPage: salesChannels.isFetchingNextPage,
11539
+ searchValue: salesChannels.searchValue,
11540
+ onSearchValueChange: salesChannels.onSearchValueChange,
11541
+ placeholder: "Select sales channel",
11542
+ ...field
11543
+ }
11544
+ ) }),
11545
+ /* @__PURE__ */ jsx(Form$2.ErrorMessage, {})
11546
+ ] });
11547
+ }
11548
+ }
11549
+ );
11550
+ };
11551
+ const schema$2 = objectType({
11552
+ sales_channel_id: stringType().min(1)
11553
+ });
11499
11554
  const STACKED_FOCUS_MODAL_ID = "shipping-form";
11500
11555
  const Shipping = () => {
11501
11556
  var _a;
@@ -12250,59 +12305,262 @@ const ShippingOptionField = ({
12250
12305
  /* @__PURE__ */ jsx(Form$2.Hint, { children: "Choose the shipping option to use." })
12251
12306
  ] }),
12252
12307
  /* @__PURE__ */ jsx(
12253
- ConditionalTooltip,
12308
+ ConditionalTooltip,
12309
+ {
12310
+ content: tooltipContent,
12311
+ showTooltip: !locationId || !shippingProfileId,
12312
+ children: /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(Form$2.Control, { children: /* @__PURE__ */ jsx(
12313
+ Combobox,
12314
+ {
12315
+ options: shippingOptions.options,
12316
+ fetchNextPage: shippingOptions.fetchNextPage,
12317
+ isFetchingNextPage: shippingOptions.isFetchingNextPage,
12318
+ searchValue: shippingOptions.searchValue,
12319
+ onSearchValueChange: shippingOptions.onSearchValueChange,
12320
+ placeholder: "Select shipping option",
12321
+ ...field,
12322
+ disabled: !locationId || !shippingProfileId
12323
+ }
12324
+ ) }) })
12325
+ }
12326
+ )
12327
+ ] }) });
12328
+ }
12329
+ }
12330
+ );
12331
+ };
12332
+ const CustomAmountField = ({
12333
+ control,
12334
+ currencyCode
12335
+ }) => {
12336
+ return /* @__PURE__ */ jsx(
12337
+ Form$2.Field,
12338
+ {
12339
+ control,
12340
+ name: "custom_amount",
12341
+ render: ({ field: { onChange, ...field } }) => {
12342
+ return /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-2 gap-x-3", children: [
12343
+ /* @__PURE__ */ jsxs("div", { className: "flex flex-col", children: [
12344
+ /* @__PURE__ */ jsx(Form$2.Label, { optional: true, children: "Custom amount" }),
12345
+ /* @__PURE__ */ jsx(Form$2.Hint, { children: "Set a custom amount for the shipping option." })
12346
+ ] }),
12347
+ /* @__PURE__ */ jsx(Form$2.Control, { children: /* @__PURE__ */ jsx(
12348
+ CurrencyInput,
12349
+ {
12350
+ ...field,
12351
+ onValueChange: (value) => onChange(value),
12352
+ symbol: getNativeSymbol(currencyCode),
12353
+ code: currencyCode
12354
+ }
12355
+ ) })
12356
+ ] });
12357
+ }
12358
+ }
12359
+ );
12360
+ };
12361
+ const ShippingAddress = () => {
12362
+ const { id } = useParams();
12363
+ const { order, isPending, isError, error } = useOrder(id, {
12364
+ fields: "+shipping_address"
12365
+ });
12366
+ if (isError) {
12367
+ throw error;
12368
+ }
12369
+ const isReady = !isPending && !!order;
12370
+ return /* @__PURE__ */ jsxs(RouteDrawer, { children: [
12371
+ /* @__PURE__ */ jsxs(RouteDrawer.Header, { children: [
12372
+ /* @__PURE__ */ jsx(RouteDrawer.Title, { asChild: true, children: /* @__PURE__ */ jsx(Heading, { children: "Edit Shipping Address" }) }),
12373
+ /* @__PURE__ */ jsx(RouteDrawer.Description, { asChild: true, children: /* @__PURE__ */ jsx("span", { className: "sr-only", children: "Edit the shipping address for the draft order" }) })
12374
+ ] }),
12375
+ isReady && /* @__PURE__ */ jsx(ShippingAddressForm, { order })
12376
+ ] });
12377
+ };
12378
+ const ShippingAddressForm = ({ order }) => {
12379
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;
12380
+ const form = useForm({
12381
+ defaultValues: {
12382
+ first_name: ((_a = order.shipping_address) == null ? void 0 : _a.first_name) ?? "",
12383
+ last_name: ((_b = order.shipping_address) == null ? void 0 : _b.last_name) ?? "",
12384
+ company: ((_c = order.shipping_address) == null ? void 0 : _c.company) ?? "",
12385
+ address_1: ((_d = order.shipping_address) == null ? void 0 : _d.address_1) ?? "",
12386
+ address_2: ((_e = order.shipping_address) == null ? void 0 : _e.address_2) ?? "",
12387
+ city: ((_f = order.shipping_address) == null ? void 0 : _f.city) ?? "",
12388
+ province: ((_g = order.shipping_address) == null ? void 0 : _g.province) ?? "",
12389
+ country_code: ((_h = order.shipping_address) == null ? void 0 : _h.country_code) ?? "",
12390
+ postal_code: ((_i = order.shipping_address) == null ? void 0 : _i.postal_code) ?? "",
12391
+ phone: ((_j = order.shipping_address) == null ? void 0 : _j.phone) ?? ""
12392
+ },
12393
+ resolver: zodResolver(schema$1)
12394
+ });
12395
+ const { mutateAsync, isPending } = useUpdateDraftOrder(order.id);
12396
+ const { handleSuccess } = useRouteModal();
12397
+ const onSubmit = form.handleSubmit(async (data) => {
12398
+ await mutateAsync(
12399
+ {
12400
+ shipping_address: {
12401
+ first_name: data.first_name,
12402
+ last_name: data.last_name,
12403
+ company: data.company,
12404
+ address_1: data.address_1,
12405
+ address_2: data.address_2,
12406
+ city: data.city,
12407
+ province: data.province,
12408
+ country_code: data.country_code,
12409
+ postal_code: data.postal_code,
12410
+ phone: data.phone
12411
+ }
12412
+ },
12413
+ {
12414
+ onSuccess: () => {
12415
+ handleSuccess();
12416
+ },
12417
+ onError: (error) => {
12418
+ toast.error(error.message);
12419
+ }
12420
+ }
12421
+ );
12422
+ });
12423
+ return /* @__PURE__ */ jsx(RouteDrawer.Form, { form, children: /* @__PURE__ */ jsxs(
12424
+ KeyboundForm,
12425
+ {
12426
+ className: "flex flex-1 flex-col overflow-hidden",
12427
+ onSubmit,
12428
+ children: [
12429
+ /* @__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: [
12430
+ /* @__PURE__ */ jsx(
12431
+ Form$2.Field,
12432
+ {
12433
+ control: form.control,
12434
+ name: "country_code",
12435
+ render: ({ field }) => /* @__PURE__ */ jsxs(Form$2.Item, { children: [
12436
+ /* @__PURE__ */ jsx(Form$2.Label, { children: "Country" }),
12437
+ /* @__PURE__ */ jsx(Form$2.Control, { children: /* @__PURE__ */ jsx(CountrySelect, { ...field }) }),
12438
+ /* @__PURE__ */ jsx(Form$2.ErrorMessage, {})
12439
+ ] })
12440
+ }
12441
+ ),
12442
+ /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-2 gap-4", children: [
12443
+ /* @__PURE__ */ jsx(
12444
+ Form$2.Field,
12445
+ {
12446
+ control: form.control,
12447
+ name: "first_name",
12448
+ render: ({ field }) => /* @__PURE__ */ jsxs(Form$2.Item, { children: [
12449
+ /* @__PURE__ */ jsx(Form$2.Label, { children: "First name" }),
12450
+ /* @__PURE__ */ jsx(Form$2.Control, { children: /* @__PURE__ */ jsx(Input, { ...field }) }),
12451
+ /* @__PURE__ */ jsx(Form$2.ErrorMessage, {})
12452
+ ] })
12453
+ }
12454
+ ),
12455
+ /* @__PURE__ */ jsx(
12456
+ Form$2.Field,
12457
+ {
12458
+ control: form.control,
12459
+ name: "last_name",
12460
+ render: ({ field }) => /* @__PURE__ */ jsxs(Form$2.Item, { children: [
12461
+ /* @__PURE__ */ jsx(Form$2.Label, { children: "Last name" }),
12462
+ /* @__PURE__ */ jsx(Form$2.Control, { children: /* @__PURE__ */ jsx(Input, { ...field }) }),
12463
+ /* @__PURE__ */ jsx(Form$2.ErrorMessage, {})
12464
+ ] })
12465
+ }
12466
+ )
12467
+ ] }),
12468
+ /* @__PURE__ */ jsx(
12469
+ Form$2.Field,
12254
12470
  {
12255
- content: tooltipContent,
12256
- showTooltip: !locationId || !shippingProfileId,
12257
- children: /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(Form$2.Control, { children: /* @__PURE__ */ jsx(
12258
- Combobox,
12259
- {
12260
- options: shippingOptions.options,
12261
- fetchNextPage: shippingOptions.fetchNextPage,
12262
- isFetchingNextPage: shippingOptions.isFetchingNextPage,
12263
- searchValue: shippingOptions.searchValue,
12264
- onSearchValueChange: shippingOptions.onSearchValueChange,
12265
- placeholder: "Select shipping option",
12266
- ...field,
12267
- disabled: !locationId || !shippingProfileId
12268
- }
12269
- ) }) })
12471
+ control: form.control,
12472
+ name: "company",
12473
+ render: ({ field }) => /* @__PURE__ */ jsxs(Form$2.Item, { children: [
12474
+ /* @__PURE__ */ jsx(Form$2.Label, { optional: true, children: "Company" }),
12475
+ /* @__PURE__ */ jsx(Form$2.Control, { children: /* @__PURE__ */ jsx(Input, { ...field }) }),
12476
+ /* @__PURE__ */ jsx(Form$2.ErrorMessage, {})
12477
+ ] })
12270
12478
  }
12271
- )
12272
- ] }) });
12273
- }
12274
- }
12275
- );
12276
- };
12277
- const CustomAmountField = ({
12278
- control,
12279
- currencyCode
12280
- }) => {
12281
- return /* @__PURE__ */ jsx(
12282
- Form$2.Field,
12283
- {
12284
- control,
12285
- name: "custom_amount",
12286
- render: ({ field: { onChange, ...field } }) => {
12287
- return /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-2 gap-x-3", children: [
12288
- /* @__PURE__ */ jsxs("div", { className: "flex flex-col", children: [
12289
- /* @__PURE__ */ jsx(Form$2.Label, { optional: true, children: "Custom amount" }),
12290
- /* @__PURE__ */ jsx(Form$2.Hint, { children: "Set a custom amount for the shipping option." })
12479
+ ),
12480
+ /* @__PURE__ */ jsx(
12481
+ Form$2.Field,
12482
+ {
12483
+ control: form.control,
12484
+ name: "address_1",
12485
+ render: ({ field }) => /* @__PURE__ */ jsxs(Form$2.Item, { children: [
12486
+ /* @__PURE__ */ jsx(Form$2.Label, { children: "Address" }),
12487
+ /* @__PURE__ */ jsx(Form$2.Control, { children: /* @__PURE__ */ jsx(Input, { ...field }) }),
12488
+ /* @__PURE__ */ jsx(Form$2.ErrorMessage, {})
12489
+ ] })
12490
+ }
12491
+ ),
12492
+ /* @__PURE__ */ jsx(
12493
+ Form$2.Field,
12494
+ {
12495
+ control: form.control,
12496
+ name: "address_2",
12497
+ render: ({ field }) => /* @__PURE__ */ jsxs(Form$2.Item, { children: [
12498
+ /* @__PURE__ */ jsx(Form$2.Label, { optional: true, children: "Apartment, suite, etc." }),
12499
+ /* @__PURE__ */ jsx(Form$2.Control, { children: /* @__PURE__ */ jsx(Input, { ...field }) }),
12500
+ /* @__PURE__ */ jsx(Form$2.ErrorMessage, {})
12501
+ ] })
12502
+ }
12503
+ ),
12504
+ /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-2 gap-4", children: [
12505
+ /* @__PURE__ */ jsx(
12506
+ Form$2.Field,
12507
+ {
12508
+ control: form.control,
12509
+ name: "postal_code",
12510
+ render: ({ field }) => /* @__PURE__ */ jsxs(Form$2.Item, { children: [
12511
+ /* @__PURE__ */ jsx(Form$2.Label, { children: "Postal code" }),
12512
+ /* @__PURE__ */ jsx(Form$2.Control, { children: /* @__PURE__ */ jsx(Input, { ...field }) }),
12513
+ /* @__PURE__ */ jsx(Form$2.ErrorMessage, {})
12514
+ ] })
12515
+ }
12516
+ ),
12517
+ /* @__PURE__ */ jsx(
12518
+ Form$2.Field,
12519
+ {
12520
+ control: form.control,
12521
+ name: "city",
12522
+ render: ({ field }) => /* @__PURE__ */ jsxs(Form$2.Item, { children: [
12523
+ /* @__PURE__ */ jsx(Form$2.Label, { children: "City" }),
12524
+ /* @__PURE__ */ jsx(Form$2.Control, { children: /* @__PURE__ */ jsx(Input, { ...field }) }),
12525
+ /* @__PURE__ */ jsx(Form$2.ErrorMessage, {})
12526
+ ] })
12527
+ }
12528
+ )
12291
12529
  ] }),
12292
- /* @__PURE__ */ jsx(Form$2.Control, { children: /* @__PURE__ */ jsx(
12293
- CurrencyInput,
12530
+ /* @__PURE__ */ jsx(
12531
+ Form$2.Field,
12294
12532
  {
12295
- ...field,
12296
- onValueChange: (value) => onChange(value),
12297
- symbol: getNativeSymbol(currencyCode),
12298
- code: currencyCode
12533
+ control: form.control,
12534
+ name: "province",
12535
+ render: ({ field }) => /* @__PURE__ */ jsxs(Form$2.Item, { children: [
12536
+ /* @__PURE__ */ jsx(Form$2.Label, { optional: true, children: "Province / State" }),
12537
+ /* @__PURE__ */ jsx(Form$2.Control, { children: /* @__PURE__ */ jsx(Input, { ...field }) }),
12538
+ /* @__PURE__ */ jsx(Form$2.ErrorMessage, {})
12539
+ ] })
12299
12540
  }
12300
- ) })
12301
- ] });
12302
- }
12541
+ ),
12542
+ /* @__PURE__ */ jsx(
12543
+ Form$2.Field,
12544
+ {
12545
+ control: form.control,
12546
+ name: "phone",
12547
+ render: ({ field }) => /* @__PURE__ */ jsxs(Form$2.Item, { children: [
12548
+ /* @__PURE__ */ jsx(Form$2.Label, { optional: true, children: "Phone" }),
12549
+ /* @__PURE__ */ jsx(Form$2.Control, { children: /* @__PURE__ */ jsx(Input, { ...field }) }),
12550
+ /* @__PURE__ */ jsx(Form$2.ErrorMessage, {})
12551
+ ] })
12552
+ }
12553
+ )
12554
+ ] }) }),
12555
+ /* @__PURE__ */ jsx(RouteDrawer.Footer, { children: /* @__PURE__ */ jsxs("div", { className: "flex justify-end gap-2", children: [
12556
+ /* @__PURE__ */ jsx(RouteDrawer.Close, { asChild: true, children: /* @__PURE__ */ jsx(Button, { size: "small", variant: "secondary", children: "Cancel" }) }),
12557
+ /* @__PURE__ */ jsx(Button, { size: "small", type: "submit", isLoading: isPending, children: "Save" })
12558
+ ] }) })
12559
+ ]
12303
12560
  }
12304
- );
12561
+ ) });
12305
12562
  };
12563
+ const schema$1 = addressSchema;
12306
12564
  const TransferOwnership = () => {
12307
12565
  const { id } = useParams();
12308
12566
  const { draft_order, isPending, isError, error } = useDraftOrder(id, {
@@ -12326,7 +12584,7 @@ const TransferOwnershipForm = ({ order }) => {
12326
12584
  defaultValues: {
12327
12585
  customer_id: order.customer_id || ""
12328
12586
  },
12329
- resolver: zodResolver(schema$2)
12587
+ resolver: zodResolver(schema)
12330
12588
  });
12331
12589
  const { mutateAsync, isPending } = useUpdateDraftOrder(order.id);
12332
12590
  const { handleSuccess } = useRouteModal();
@@ -12713,330 +12971,72 @@ const Illustration = () => {
12713
12971
  stroke: "#A1A1AA",
12714
12972
  strokeWidth: "1.5",
12715
12973
  strokeLinecap: "round",
12716
- strokeLinejoin: "round"
12717
- }
12718
- ) }),
12719
- /* @__PURE__ */ jsxs("defs", { children: [
12720
- /* @__PURE__ */ jsx("clipPath", { id: "clip0_20915_38670", children: /* @__PURE__ */ jsx(
12721
- "rect",
12722
- {
12723
- width: "12",
12724
- height: "12",
12725
- fill: "white",
12726
- transform: "matrix(0.865865 0.500278 -0.871576 0.490261 138.36 74.6508)"
12727
- }
12728
- ) }),
12729
- /* @__PURE__ */ jsx("clipPath", { id: "clip1_20915_38670", children: /* @__PURE__ */ jsx(
12730
- "rect",
12731
- {
12732
- width: "12",
12733
- height: "12",
12734
- fill: "white",
12735
- transform: "matrix(0.865865 0.500278 -0.871576 0.490261 148.75 80.6541)"
12736
- }
12737
- ) }),
12738
- /* @__PURE__ */ jsx("clipPath", { id: "clip2_20915_38670", children: /* @__PURE__ */ jsx(
12739
- "rect",
12740
- {
12741
- width: "12",
12742
- height: "12",
12743
- fill: "white",
12744
- transform: "matrix(0.865865 0.500278 -0.871576 0.490261 159.141 86.6575)"
12745
- }
12746
- ) }),
12747
- /* @__PURE__ */ jsx("clipPath", { id: "clip3_20915_38670", children: /* @__PURE__ */ jsx(
12748
- "rect",
12749
- {
12750
- width: "12",
12751
- height: "12",
12752
- fill: "white",
12753
- transform: "matrix(0.865865 0.500278 -0.871576 0.490261 120.928 84.4561)"
12754
- }
12755
- ) }),
12756
- /* @__PURE__ */ jsx("clipPath", { id: "clip4_20915_38670", children: /* @__PURE__ */ jsx(
12757
- "rect",
12758
- {
12759
- width: "12",
12760
- height: "12",
12761
- fill: "white",
12762
- transform: "matrix(0.865865 0.500278 -0.871576 0.490261 131.318 90.4594)"
12763
- }
12764
- ) }),
12765
- /* @__PURE__ */ jsx("clipPath", { id: "clip5_20915_38670", children: /* @__PURE__ */ jsx(
12766
- "rect",
12767
- {
12768
- width: "12",
12769
- height: "12",
12770
- fill: "white",
12771
- transform: "matrix(0.865865 0.500278 -0.871576 0.490261 141.709 96.4627)"
12772
- }
12773
- ) })
12774
- ] })
12775
- ]
12776
- }
12777
- );
12778
- };
12779
- const schema$2 = objectType({
12780
- customer_id: stringType().min(1)
12781
- });
12782
- const Email = () => {
12783
- const { id } = useParams();
12784
- const { order, isPending, isError, error } = useOrder(id, {
12785
- fields: "+email"
12786
- });
12787
- if (isError) {
12788
- throw error;
12789
- }
12790
- const isReady = !isPending && !!order;
12791
- return /* @__PURE__ */ jsxs(RouteDrawer, { children: [
12792
- /* @__PURE__ */ jsxs(RouteDrawer.Header, { children: [
12793
- /* @__PURE__ */ jsx(RouteDrawer.Title, { asChild: true, children: /* @__PURE__ */ jsx(Heading, { children: "Edit Email" }) }),
12794
- /* @__PURE__ */ jsx(RouteDrawer.Description, { asChild: true, children: /* @__PURE__ */ jsx("span", { className: "sr-only", children: "Edit the email for the draft order" }) })
12795
- ] }),
12796
- isReady && /* @__PURE__ */ jsx(EmailForm, { order })
12797
- ] });
12798
- };
12799
- const EmailForm = ({ order }) => {
12800
- const form = useForm({
12801
- defaultValues: {
12802
- email: order.email ?? ""
12803
- },
12804
- resolver: zodResolver(schema$1)
12805
- });
12806
- const { mutateAsync, isPending } = useUpdateDraftOrder(order.id);
12807
- const { handleSuccess } = useRouteModal();
12808
- const onSubmit = form.handleSubmit(async (data) => {
12809
- await mutateAsync(
12810
- { email: data.email },
12811
- {
12812
- onSuccess: () => {
12813
- handleSuccess();
12814
- },
12815
- onError: (error) => {
12816
- toast.error(error.message);
12817
- }
12818
- }
12819
- );
12820
- });
12821
- return /* @__PURE__ */ jsx(RouteDrawer.Form, { form, children: /* @__PURE__ */ jsxs(
12822
- KeyboundForm,
12823
- {
12824
- className: "flex flex-1 flex-col overflow-hidden",
12825
- onSubmit,
12826
- children: [
12827
- /* @__PURE__ */ jsx(RouteDrawer.Body, { className: "flex flex-col gap-y-6 overflow-y-auto", children: /* @__PURE__ */ jsx(
12828
- Form$2.Field,
12829
- {
12830
- control: form.control,
12831
- name: "email",
12832
- render: ({ field }) => /* @__PURE__ */ jsxs(Form$2.Item, { children: [
12833
- /* @__PURE__ */ jsx(Form$2.Label, { children: "Email" }),
12834
- /* @__PURE__ */ jsx(Form$2.Control, { children: /* @__PURE__ */ jsx(Input, { ...field }) }),
12835
- /* @__PURE__ */ jsx(Form$2.ErrorMessage, {})
12836
- ] })
12974
+ strokeLinejoin: "round"
12837
12975
  }
12838
12976
  ) }),
12839
- /* @__PURE__ */ jsx(RouteDrawer.Footer, { children: /* @__PURE__ */ jsxs("div", { className: "flex justify-end gap-2", children: [
12840
- /* @__PURE__ */ jsx(RouteDrawer.Close, { asChild: true, children: /* @__PURE__ */ jsx(Button, { size: "small", variant: "secondary", children: "Cancel" }) }),
12841
- /* @__PURE__ */ jsx(Button, { size: "small", type: "submit", isLoading: isPending, children: "Save" })
12842
- ] }) })
12843
- ]
12844
- }
12845
- ) });
12846
- };
12847
- const schema$1 = objectType({
12848
- email: stringType().email()
12849
- });
12850
- const BillingAddress = () => {
12851
- const { id } = useParams();
12852
- const { order, isPending, isError, error } = useOrder(id, {
12853
- fields: "+billing_address"
12854
- });
12855
- if (isError) {
12856
- throw error;
12857
- }
12858
- const isReady = !isPending && !!order;
12859
- return /* @__PURE__ */ jsxs(RouteDrawer, { children: [
12860
- /* @__PURE__ */ jsxs(RouteDrawer.Header, { children: [
12861
- /* @__PURE__ */ jsx(RouteDrawer.Title, { asChild: true, children: /* @__PURE__ */ jsx(Heading, { children: "Edit Billing Address" }) }),
12862
- /* @__PURE__ */ jsx(RouteDrawer.Description, { asChild: true, children: /* @__PURE__ */ jsx("span", { className: "sr-only", children: "Edit the billing address for the draft order" }) })
12863
- ] }),
12864
- isReady && /* @__PURE__ */ jsx(BillingAddressForm, { order })
12865
- ] });
12866
- };
12867
- const BillingAddressForm = ({ order }) => {
12868
- var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;
12869
- const form = useForm({
12870
- defaultValues: {
12871
- first_name: ((_a = order.billing_address) == null ? void 0 : _a.first_name) ?? "",
12872
- last_name: ((_b = order.billing_address) == null ? void 0 : _b.last_name) ?? "",
12873
- company: ((_c = order.billing_address) == null ? void 0 : _c.company) ?? "",
12874
- address_1: ((_d = order.billing_address) == null ? void 0 : _d.address_1) ?? "",
12875
- address_2: ((_e = order.billing_address) == null ? void 0 : _e.address_2) ?? "",
12876
- city: ((_f = order.billing_address) == null ? void 0 : _f.city) ?? "",
12877
- province: ((_g = order.billing_address) == null ? void 0 : _g.province) ?? "",
12878
- country_code: ((_h = order.billing_address) == null ? void 0 : _h.country_code) ?? "",
12879
- postal_code: ((_i = order.billing_address) == null ? void 0 : _i.postal_code) ?? "",
12880
- phone: ((_j = order.billing_address) == null ? void 0 : _j.phone) ?? ""
12881
- },
12882
- resolver: zodResolver(schema)
12883
- });
12884
- const { mutateAsync, isPending } = useUpdateDraftOrder(order.id);
12885
- const { handleSuccess } = useRouteModal();
12886
- const onSubmit = form.handleSubmit(async (data) => {
12887
- await mutateAsync(
12888
- { billing_address: data },
12889
- {
12890
- onSuccess: () => {
12891
- handleSuccess();
12892
- },
12893
- onError: (error) => {
12894
- toast.error(error.message);
12895
- }
12896
- }
12897
- );
12898
- });
12899
- return /* @__PURE__ */ jsx(RouteDrawer.Form, { form, children: /* @__PURE__ */ jsxs(
12900
- KeyboundForm,
12901
- {
12902
- className: "flex flex-1 flex-col overflow-hidden",
12903
- onSubmit,
12904
- children: [
12905
- /* @__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: [
12906
- /* @__PURE__ */ jsx(
12907
- Form$2.Field,
12977
+ /* @__PURE__ */ jsxs("defs", { children: [
12978
+ /* @__PURE__ */ jsx("clipPath", { id: "clip0_20915_38670", children: /* @__PURE__ */ jsx(
12979
+ "rect",
12908
12980
  {
12909
- control: form.control,
12910
- name: "country_code",
12911
- render: ({ field }) => /* @__PURE__ */ jsxs(Form$2.Item, { children: [
12912
- /* @__PURE__ */ jsx(Form$2.Label, { children: "Country" }),
12913
- /* @__PURE__ */ jsx(Form$2.Control, { children: /* @__PURE__ */ jsx(CountrySelect, { ...field }) }),
12914
- /* @__PURE__ */ jsx(Form$2.ErrorMessage, {})
12915
- ] })
12981
+ width: "12",
12982
+ height: "12",
12983
+ fill: "white",
12984
+ transform: "matrix(0.865865 0.500278 -0.871576 0.490261 138.36 74.6508)"
12916
12985
  }
12917
- ),
12918
- /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-2 gap-4", children: [
12919
- /* @__PURE__ */ jsx(
12920
- Form$2.Field,
12921
- {
12922
- control: form.control,
12923
- name: "first_name",
12924
- render: ({ field }) => /* @__PURE__ */ jsxs(Form$2.Item, { children: [
12925
- /* @__PURE__ */ jsx(Form$2.Label, { children: "First name" }),
12926
- /* @__PURE__ */ jsx(Form$2.Control, { children: /* @__PURE__ */ jsx(Input, { ...field }) }),
12927
- /* @__PURE__ */ jsx(Form$2.ErrorMessage, {})
12928
- ] })
12929
- }
12930
- ),
12931
- /* @__PURE__ */ jsx(
12932
- Form$2.Field,
12933
- {
12934
- control: form.control,
12935
- name: "last_name",
12936
- render: ({ field }) => /* @__PURE__ */ jsxs(Form$2.Item, { children: [
12937
- /* @__PURE__ */ jsx(Form$2.Label, { children: "Last name" }),
12938
- /* @__PURE__ */ jsx(Form$2.Control, { children: /* @__PURE__ */ jsx(Input, { ...field }) }),
12939
- /* @__PURE__ */ jsx(Form$2.ErrorMessage, {})
12940
- ] })
12941
- }
12942
- )
12943
- ] }),
12944
- /* @__PURE__ */ jsx(
12945
- Form$2.Field,
12986
+ ) }),
12987
+ /* @__PURE__ */ jsx("clipPath", { id: "clip1_20915_38670", children: /* @__PURE__ */ jsx(
12988
+ "rect",
12946
12989
  {
12947
- control: form.control,
12948
- name: "company",
12949
- render: ({ field }) => /* @__PURE__ */ jsxs(Form$2.Item, { children: [
12950
- /* @__PURE__ */ jsx(Form$2.Label, { optional: true, children: "Company" }),
12951
- /* @__PURE__ */ jsx(Form$2.Control, { children: /* @__PURE__ */ jsx(Input, { ...field }) }),
12952
- /* @__PURE__ */ jsx(Form$2.ErrorMessage, {})
12953
- ] })
12990
+ width: "12",
12991
+ height: "12",
12992
+ fill: "white",
12993
+ transform: "matrix(0.865865 0.500278 -0.871576 0.490261 148.75 80.6541)"
12954
12994
  }
12955
- ),
12956
- /* @__PURE__ */ jsx(
12957
- Form$2.Field,
12995
+ ) }),
12996
+ /* @__PURE__ */ jsx("clipPath", { id: "clip2_20915_38670", children: /* @__PURE__ */ jsx(
12997
+ "rect",
12958
12998
  {
12959
- control: form.control,
12960
- name: "address_1",
12961
- render: ({ field }) => /* @__PURE__ */ jsxs(Form$2.Item, { children: [
12962
- /* @__PURE__ */ jsx(Form$2.Label, { children: "Address" }),
12963
- /* @__PURE__ */ jsx(Form$2.Control, { children: /* @__PURE__ */ jsx(Input, { ...field }) }),
12964
- /* @__PURE__ */ jsx(Form$2.ErrorMessage, {})
12965
- ] })
12999
+ width: "12",
13000
+ height: "12",
13001
+ fill: "white",
13002
+ transform: "matrix(0.865865 0.500278 -0.871576 0.490261 159.141 86.6575)"
12966
13003
  }
12967
- ),
12968
- /* @__PURE__ */ jsx(
12969
- Form$2.Field,
13004
+ ) }),
13005
+ /* @__PURE__ */ jsx("clipPath", { id: "clip3_20915_38670", children: /* @__PURE__ */ jsx(
13006
+ "rect",
12970
13007
  {
12971
- control: form.control,
12972
- name: "address_2",
12973
- render: ({ field }) => /* @__PURE__ */ jsxs(Form$2.Item, { children: [
12974
- /* @__PURE__ */ jsx(Form$2.Label, { optional: true, children: "Apartment, suite, etc." }),
12975
- /* @__PURE__ */ jsx(Form$2.Control, { children: /* @__PURE__ */ jsx(Input, { ...field }) }),
12976
- /* @__PURE__ */ jsx(Form$2.ErrorMessage, {})
12977
- ] })
13008
+ width: "12",
13009
+ height: "12",
13010
+ fill: "white",
13011
+ transform: "matrix(0.865865 0.500278 -0.871576 0.490261 120.928 84.4561)"
12978
13012
  }
12979
- ),
12980
- /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-2 gap-4", children: [
12981
- /* @__PURE__ */ jsx(
12982
- Form$2.Field,
12983
- {
12984
- control: form.control,
12985
- name: "postal_code",
12986
- render: ({ field }) => /* @__PURE__ */ jsxs(Form$2.Item, { children: [
12987
- /* @__PURE__ */ jsx(Form$2.Label, { children: "Postal code" }),
12988
- /* @__PURE__ */ jsx(Form$2.Control, { children: /* @__PURE__ */ jsx(Input, { ...field }) }),
12989
- /* @__PURE__ */ jsx(Form$2.ErrorMessage, {})
12990
- ] })
12991
- }
12992
- ),
12993
- /* @__PURE__ */ jsx(
12994
- Form$2.Field,
12995
- {
12996
- control: form.control,
12997
- name: "city",
12998
- render: ({ field }) => /* @__PURE__ */ jsxs(Form$2.Item, { children: [
12999
- /* @__PURE__ */ jsx(Form$2.Label, { children: "City" }),
13000
- /* @__PURE__ */ jsx(Form$2.Control, { children: /* @__PURE__ */ jsx(Input, { ...field }) }),
13001
- /* @__PURE__ */ jsx(Form$2.ErrorMessage, {})
13002
- ] })
13003
- }
13004
- )
13005
- ] }),
13006
- /* @__PURE__ */ jsx(
13007
- Form$2.Field,
13013
+ ) }),
13014
+ /* @__PURE__ */ jsx("clipPath", { id: "clip4_20915_38670", children: /* @__PURE__ */ jsx(
13015
+ "rect",
13008
13016
  {
13009
- control: form.control,
13010
- name: "province",
13011
- render: ({ field }) => /* @__PURE__ */ jsxs(Form$2.Item, { children: [
13012
- /* @__PURE__ */ jsx(Form$2.Label, { optional: true, children: "Province / State" }),
13013
- /* @__PURE__ */ jsx(Form$2.Control, { children: /* @__PURE__ */ jsx(Input, { ...field }) }),
13014
- /* @__PURE__ */ jsx(Form$2.ErrorMessage, {})
13015
- ] })
13017
+ width: "12",
13018
+ height: "12",
13019
+ fill: "white",
13020
+ transform: "matrix(0.865865 0.500278 -0.871576 0.490261 131.318 90.4594)"
13016
13021
  }
13017
- ),
13018
- /* @__PURE__ */ jsx(
13019
- Form$2.Field,
13022
+ ) }),
13023
+ /* @__PURE__ */ jsx("clipPath", { id: "clip5_20915_38670", children: /* @__PURE__ */ jsx(
13024
+ "rect",
13020
13025
  {
13021
- control: form.control,
13022
- name: "phone",
13023
- render: ({ field }) => /* @__PURE__ */ jsxs(Form$2.Item, { children: [
13024
- /* @__PURE__ */ jsx(Form$2.Label, { optional: true, children: "Phone" }),
13025
- /* @__PURE__ */ jsx(Form$2.Control, { children: /* @__PURE__ */ jsx(Input, { ...field }) }),
13026
- /* @__PURE__ */ jsx(Form$2.ErrorMessage, {})
13027
- ] })
13026
+ width: "12",
13027
+ height: "12",
13028
+ fill: "white",
13029
+ transform: "matrix(0.865865 0.500278 -0.871576 0.490261 141.709 96.4627)"
13028
13030
  }
13029
- )
13030
- ] }) }),
13031
- /* @__PURE__ */ jsx(RouteDrawer.Footer, { children: /* @__PURE__ */ jsxs("div", { className: "flex justify-end gap-2", children: [
13032
- /* @__PURE__ */ jsx(RouteDrawer.Close, { asChild: true, children: /* @__PURE__ */ jsx(Button, { size: "small", variant: "secondary", children: "Cancel" }) }),
13033
- /* @__PURE__ */ jsx(Button, { size: "small", type: "submit", isLoading: isPending, children: "Save" })
13034
- ] }) })
13031
+ ) })
13032
+ ] })
13035
13033
  ]
13036
13034
  }
13037
- ) });
13035
+ );
13038
13036
  };
13039
- const schema = addressSchema;
13037
+ const schema = objectType({
13038
+ customer_id: stringType().min(1)
13039
+ });
13040
13040
  const widgetModule = { widgets: [] };
13041
13041
  const routeModule = {
13042
13042
  routes: [
@@ -13057,10 +13057,18 @@ const routeModule = {
13057
13057
  handle,
13058
13058
  loader,
13059
13059
  children: [
13060
+ {
13061
+ Component: BillingAddress,
13062
+ path: "/draft-orders/:id/billing-address"
13063
+ },
13060
13064
  {
13061
13065
  Component: CustomItems,
13062
13066
  path: "/draft-orders/:id/custom-items"
13063
13067
  },
13068
+ {
13069
+ Component: Email,
13070
+ path: "/draft-orders/:id/email"
13071
+ },
13064
13072
  {
13065
13073
  Component: Items,
13066
13074
  path: "/draft-orders/:id/items"
@@ -13077,25 +13085,17 @@ const routeModule = {
13077
13085
  Component: SalesChannel,
13078
13086
  path: "/draft-orders/:id/sales-channel"
13079
13087
  },
13080
- {
13081
- Component: ShippingAddress,
13082
- path: "/draft-orders/:id/shipping-address"
13083
- },
13084
13088
  {
13085
13089
  Component: Shipping,
13086
13090
  path: "/draft-orders/:id/shipping"
13087
13091
  },
13088
13092
  {
13089
- Component: TransferOwnership,
13090
- path: "/draft-orders/:id/transfer-ownership"
13091
- },
13092
- {
13093
- Component: Email,
13094
- path: "/draft-orders/:id/email"
13093
+ Component: ShippingAddress,
13094
+ path: "/draft-orders/:id/shipping-address"
13095
13095
  },
13096
13096
  {
13097
- Component: BillingAddress,
13098
- path: "/draft-orders/:id/billing-address"
13097
+ Component: TransferOwnership,
13098
+ path: "/draft-orders/:id/transfer-ownership"
13099
13099
  }
13100
13100
  ]
13101
13101
  }
@@ -13115,12 +13115,14 @@ const formModule = { customFields: {} };
13115
13115
  const displayModule = {
13116
13116
  displays: {}
13117
13117
  };
13118
+ const i18nModule = { resources: {} };
13118
13119
  const plugin = {
13119
13120
  widgetModule,
13120
13121
  routeModule,
13121
13122
  menuItemModule,
13122
13123
  formModule,
13123
- displayModule
13124
+ displayModule,
13125
+ i18nModule
13124
13126
  };
13125
13127
  export {
13126
13128
  plugin as default