@acmekit/dashboard 2.13.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +30 -0
- package/dist/Inter-Medium-RUQTUVA3.ttf +0 -0
- package/dist/Inter-Regular-CKBOXRQ3.ttf +0 -0
- package/dist/RobotoMono-Medium-LUNBMOOH.ttf +0 -0
- package/dist/RobotoMono-Regular-27MA6W2G.ttf +0 -0
- package/dist/add-campaign-promotions-GV3D3N2X.mjs +263 -0
- package/dist/add-locales-WQDGU5A2.mjs +82 -0
- package/dist/adjust-inventory-CSOFODJL.mjs +217 -0
- package/dist/api-key-management-create-JUXDTSXT.mjs +176 -0
- package/dist/api-key-management-detail-7TKDKAYS.mjs +493 -0
- package/dist/api-key-management-edit-ZWOCXPXV.mjs +110 -0
- package/dist/api-key-management-list-C6BVUVSI.mjs +356 -0
- package/dist/api-key-management-sales-channels-B2HCUBX7.mjs +206 -0
- package/dist/app.css +5330 -0
- package/dist/app.js +195968 -0
- package/dist/app.mjs +81 -0
- package/dist/campaign-budget-edit-OHOU27NN.mjs +147 -0
- package/dist/campaign-configuration-MZHTGODE.mjs +154 -0
- package/dist/campaign-create-VAJXI544.mjs +31 -0
- package/dist/campaign-detail-MWRQ5LSR.mjs +677 -0
- package/dist/campaign-edit-Z2KT7NZD.mjs +206 -0
- package/dist/campaign-list-HOAE6MXC.mjs +192 -0
- package/dist/categories-metadata-OESX2QXC.mjs +74 -0
- package/dist/category-create-AIVN7H3A.mjs +423 -0
- package/dist/category-detail-PDRC4NHH.mjs +579 -0
- package/dist/category-edit-7OLII5PI.mjs +224 -0
- package/dist/category-list-SYODXAV7.mjs +309 -0
- package/dist/category-organize-C3IUWW33.mjs +113 -0
- package/dist/category-products-GA4KP7EC.mjs +284 -0
- package/dist/chunk-22YYMH6M.mjs +382 -0
- package/dist/chunk-2PCPX3L2.mjs +92 -0
- package/dist/chunk-2V4DS7AE.mjs +49 -0
- package/dist/chunk-3C6WQ7NH.mjs +46 -0
- package/dist/chunk-3ISBJK7K.mjs +45 -0
- package/dist/chunk-3TAD7FW4.mjs +431 -0
- package/dist/chunk-3TZOFKX2.mjs +110 -0
- package/dist/chunk-3VXYG7KG.mjs +64 -0
- package/dist/chunk-3WPRVYF6.mjs +122 -0
- package/dist/chunk-452UKZW6.mjs +471 -0
- package/dist/chunk-4DFGIDVN.mjs +117 -0
- package/dist/chunk-4FM6S5CX.mjs +17 -0
- package/dist/chunk-4GQOUCX6.mjs +0 -0
- package/dist/chunk-4UTXEJBF.mjs +128 -0
- package/dist/chunk-4XSXVVYD.mjs +18 -0
- package/dist/chunk-535OVBXR.mjs +226 -0
- package/dist/chunk-54IEHX46.mjs +116 -0
- package/dist/chunk-5DXB7NNX.mjs +221 -0
- package/dist/chunk-5Q74GF5H.mjs +94 -0
- package/dist/chunk-5SAFO54D.mjs +56 -0
- package/dist/chunk-6GU6IDUA.mjs +8 -0
- package/dist/chunk-6HTZNHPT.mjs +34 -0
- package/dist/chunk-6T6CP246.mjs +340 -0
- package/dist/chunk-774WSTCC.mjs +19 -0
- package/dist/chunk-7AXHHXCX.mjs +4 -0
- package/dist/chunk-7M2A645H.mjs +63 -0
- package/dist/chunk-7PCPPVXC.mjs +175 -0
- package/dist/chunk-AM2BU2RH.mjs +6 -0
- package/dist/chunk-B2FDWFGX.mjs +171 -0
- package/dist/chunk-B4QEDA23.mjs +97 -0
- package/dist/chunk-B6ZOPCPA.mjs +73 -0
- package/dist/chunk-BALV2UTZ.mjs +24 -0
- package/dist/chunk-BBP7EYBG.mjs +260 -0
- package/dist/chunk-BCEWAWGA.mjs +39 -0
- package/dist/chunk-BD3XDAG5.mjs +401 -0
- package/dist/chunk-BGATYAVC.mjs +47 -0
- package/dist/chunk-BZ3BUDOK.mjs +4113 -0
- package/dist/chunk-C5P5PL3E.mjs +31 -0
- package/dist/chunk-C76H5USB.mjs +16 -0
- package/dist/chunk-C7F7MMXS.mjs +68 -0
- package/dist/chunk-CABJXU6D.mjs +302 -0
- package/dist/chunk-CBSCX7RE.mjs +13 -0
- package/dist/chunk-CG3YNOEK.mjs +144 -0
- package/dist/chunk-CNZM6RE7.mjs +610 -0
- package/dist/chunk-CQWBG33R.mjs +30 -0
- package/dist/chunk-CRBKNYSH.mjs +275 -0
- package/dist/chunk-D3YQN7HV.mjs +30 -0
- package/dist/chunk-DFFLVEZ5.mjs +40 -0
- package/dist/chunk-DG7J63J2.mjs +1764 -0
- package/dist/chunk-DHF3B6D2.mjs +9 -0
- package/dist/chunk-DK4WIVY6.mjs +749 -0
- package/dist/chunk-DKOD27V5.mjs +175 -0
- package/dist/chunk-DLZWPHHO.mjs +20 -0
- package/dist/chunk-DTY37DDZ.mjs +20 -0
- package/dist/chunk-DXWAKJTM.mjs +108 -0
- package/dist/chunk-EAZDQKZL.mjs +259 -0
- package/dist/chunk-EFEGJQI5.mjs +34 -0
- package/dist/chunk-EG5MMCD4.mjs +50 -0
- package/dist/chunk-EHAU7SOS.mjs +1280 -0
- package/dist/chunk-EKFF2W4G.mjs +124 -0
- package/dist/chunk-EN5J6OFE.mjs +41 -0
- package/dist/chunk-EO7CNFE6.mjs +265 -0
- package/dist/chunk-EVPLJRXF.mjs +123 -0
- package/dist/chunk-EVY7AHQA.mjs +50 -0
- package/dist/chunk-EZGBAGIR.mjs +310 -0
- package/dist/chunk-F57Z263P.mjs +36 -0
- package/dist/chunk-F6ZOHZVB.mjs +9 -0
- package/dist/chunk-FA2DYBNX.mjs +6 -0
- package/dist/chunk-FHSC5X62.mjs +31 -0
- package/dist/chunk-FUDIA3GL.mjs +39 -0
- package/dist/chunk-FVMHCXYX.mjs +106 -0
- package/dist/chunk-FX5GXN2P.mjs +164 -0
- package/dist/chunk-FXYH54JP.mjs +16 -0
- package/dist/chunk-G22WWLPG.mjs +44 -0
- package/dist/chunk-G2GBTFKW.mjs +522 -0
- package/dist/chunk-G2J2T2QU.mjs +85 -0
- package/dist/chunk-G2VJOHHV.mjs +32 -0
- package/dist/chunk-G4M37GFI.mjs +98061 -0
- package/dist/chunk-G57B6U6Y.mjs +41 -0
- package/dist/chunk-GBFVWROS.mjs +58 -0
- package/dist/chunk-GF7N2AY2.mjs +79 -0
- package/dist/chunk-GGTFPFCV.mjs +1150 -0
- package/dist/chunk-HE77DA46.mjs +108 -0
- package/dist/chunk-HKYVPRUA.mjs +182 -0
- package/dist/chunk-HVQIZLNB.mjs +108 -0
- package/dist/chunk-I2GUUJVE.mjs +127 -0
- package/dist/chunk-IR5DHEKS.mjs +9 -0
- package/dist/chunk-IU262EDH.mjs +495 -0
- package/dist/chunk-IUCDCPJU.mjs +0 -0
- package/dist/chunk-IW4TACOD.mjs +55 -0
- package/dist/chunk-IXXG72CP.mjs +422 -0
- package/dist/chunk-JHATTPS3.mjs +6 -0
- package/dist/chunk-JO7JAVWB.mjs +170 -0
- package/dist/chunk-JQ67EF5F.mjs +101 -0
- package/dist/chunk-K5DSJBZS.mjs +556 -0
- package/dist/chunk-KA4KBTUN.mjs +29 -0
- package/dist/chunk-KIASDQKH.mjs +51 -0
- package/dist/chunk-KPLL3ATX.mjs +97 -0
- package/dist/chunk-L7YA4D55.mjs +61 -0
- package/dist/chunk-LEYWBRRG.mjs +225 -0
- package/dist/chunk-LKWTBYYC.mjs +35 -0
- package/dist/chunk-LLJB2TFN.mjs +50 -0
- package/dist/chunk-LQTHYS2Z.mjs +0 -0
- package/dist/chunk-LSEYENCI.mjs +14 -0
- package/dist/chunk-LT4MVCA7.mjs +19 -0
- package/dist/chunk-LWUDSTVZ.mjs +128 -0
- package/dist/chunk-LXIJHOSW.mjs +43 -0
- package/dist/chunk-LZX5TJ65.mjs +42 -0
- package/dist/chunk-MFALVTRQ.mjs +181 -0
- package/dist/chunk-MKJPYPAH.mjs +516 -0
- package/dist/chunk-MOSRJHJ3.mjs +31 -0
- package/dist/chunk-N7BIDSR6.mjs +45 -0
- package/dist/chunk-ND3ODI36.mjs +161 -0
- package/dist/chunk-NOAFLTPV.mjs +99 -0
- package/dist/chunk-NPOS27VN.mjs +29 -0
- package/dist/chunk-NQMO3WSW.mjs +98 -0
- package/dist/chunk-NSKLCNSB.mjs +1106 -0
- package/dist/chunk-NTEWUH4C.mjs +65 -0
- package/dist/chunk-NUHHTFNL.mjs +1144 -0
- package/dist/chunk-OAHCJFG3.mjs +17 -0
- package/dist/chunk-OK4NIKP5.mjs +84 -0
- package/dist/chunk-OMC5JCQH.mjs +31 -0
- package/dist/chunk-OWHSIJ2H.mjs +37 -0
- package/dist/chunk-P3DRE4IY.mjs +39 -0
- package/dist/chunk-P3UUX2T6.mjs +9 -0
- package/dist/chunk-P3VJXF6S.mjs +345 -0
- package/dist/chunk-PB5SVVN2.mjs +117 -0
- package/dist/chunk-PEZUM4LH.mjs +174 -0
- package/dist/chunk-PMA2D6IL.mjs +49 -0
- package/dist/chunk-PQGZLPCG.mjs +61 -0
- package/dist/chunk-PXZ7QYKX.mjs +14 -0
- package/dist/chunk-PYIO3TDQ.mjs +18 -0
- package/dist/chunk-QAFVGV7P.mjs +47 -0
- package/dist/chunk-QDRW4DAC.mjs +363 -0
- package/dist/chunk-QJ6SBVJ2.mjs +17 -0
- package/dist/chunk-QKARRHBY.mjs +146 -0
- package/dist/chunk-QNGB3OCG.mjs +391 -0
- package/dist/chunk-QVJ6Q4XS.mjs +157 -0
- package/dist/chunk-QZ5QAA5L.mjs +89 -0
- package/dist/chunk-QZ7TP4HQ.mjs +7 -0
- package/dist/chunk-R65S6ZZV.mjs +70 -0
- package/dist/chunk-RIV7FKGN.mjs +31 -0
- package/dist/chunk-RPAL6FHW.mjs +73 -0
- package/dist/chunk-RREPQMYC.mjs +116 -0
- package/dist/chunk-S3REQHPQ.mjs +86 -0
- package/dist/chunk-S4DMV3ZT.mjs +35 -0
- package/dist/chunk-SC6BSTC7.mjs +38 -0
- package/dist/chunk-SLYFSTN7.mjs +824 -0
- package/dist/chunk-SZXVOG6N.mjs +42 -0
- package/dist/chunk-T7THKDM2.mjs +132 -0
- package/dist/chunk-TCNCAWYD.mjs +9 -0
- package/dist/chunk-TDK3JDOB.mjs +31 -0
- package/dist/chunk-TNJMHOGZ.mjs +34 -0
- package/dist/chunk-TU3OVBKQ.mjs +87 -0
- package/dist/chunk-TXO6ZWHH.mjs +79 -0
- package/dist/chunk-U7I66IFZ.mjs +88 -0
- package/dist/chunk-UC26CCHZ.mjs +45 -0
- package/dist/chunk-UCZNM66J.mjs +22 -0
- package/dist/chunk-ULSPL3DR.mjs +126 -0
- package/dist/chunk-UVPCTLA2.mjs +79 -0
- package/dist/chunk-V7OUZM56.mjs +83 -0
- package/dist/chunk-VAO4P4YN.mjs +44 -0
- package/dist/chunk-W4OT76ZB.mjs +23 -0
- package/dist/chunk-W7625H47.mjs +18 -0
- package/dist/chunk-WATKBUHQ.mjs +12 -0
- package/dist/chunk-WILMJYUB.mjs +35 -0
- package/dist/chunk-WJ4YB5O4.mjs +87 -0
- package/dist/chunk-WKOPGFW5.mjs +8 -0
- package/dist/chunk-WMOGMKQN.mjs +0 -0
- package/dist/chunk-WRSGHGAT.mjs +41 -0
- package/dist/chunk-X4LMDPH5.mjs +52 -0
- package/dist/chunk-X6BAAGCL.mjs +48 -0
- package/dist/chunk-XIM7X4FB.mjs +83 -0
- package/dist/chunk-XIWUBH6W.mjs +37 -0
- package/dist/chunk-XJYL2XTV.mjs +280 -0
- package/dist/chunk-XP4VHZBM.mjs +162 -0
- package/dist/chunk-XR4GEMGR.mjs +31 -0
- package/dist/chunk-XRTVFYCW.mjs +0 -0
- package/dist/chunk-XU4GD2XM.mjs +360 -0
- package/dist/chunk-XUQVQCAO.mjs +16 -0
- package/dist/chunk-YF6NQZGM.mjs +78 -0
- package/dist/chunk-YOYOJU5D.mjs +0 -0
- package/dist/chunk-YVPTNVHA.mjs +792 -0
- package/dist/chunk-YWU55M6Z.mjs +183 -0
- package/dist/chunk-Z5LP57ST.mjs +160 -0
- package/dist/chunk-ZFCG2354.mjs +98 -0
- package/dist/chunk-ZGI57SVH.mjs +49 -0
- package/dist/chunk-ZNSZ45XP.mjs +193 -0
- package/dist/chunk-ZQRKUG6J.mjs +72 -0
- package/dist/collection-add-products-IY6FQ72Q.mjs +287 -0
- package/dist/collection-create-HT3M5GN2.mjs +134 -0
- package/dist/collection-detail-B2ITEYFM.mjs +469 -0
- package/dist/collection-edit-XFZ2MCJM.mjs +125 -0
- package/dist/collection-list-XOQQ2LT2.mjs +257 -0
- package/dist/collection-metadata-3EZ5FMJI.mjs +73 -0
- package/dist/customer-create-PGX4DCTL.mjs +183 -0
- package/dist/customer-create-address-QOU74N6J.mjs +293 -0
- package/dist/customer-detail-HUXNR3Y5.mjs +706 -0
- package/dist/customer-edit-T4TG2APF.mjs +194 -0
- package/dist/customer-group-add-customers-62EAFEKD.mjs +244 -0
- package/dist/customer-group-create-QE5D76WG.mjs +113 -0
- package/dist/customer-group-detail-PE3DCMPC.mjs +437 -0
- package/dist/customer-group-edit-O3TX6KF5.mjs +110 -0
- package/dist/customer-group-list-IXQNLETU.mjs +268 -0
- package/dist/customer-group-metadata-FKKGWCL3.mjs +44 -0
- package/dist/customer-list-M7XWLNDQ.mjs +163 -0
- package/dist/customer-metadata-72M7HMZU.mjs +44 -0
- package/dist/customers-add-customer-group-B6KORLWA.mjs +279 -0
- package/dist/edit-inventory-item-44J2OXJL.mjs +130 -0
- package/dist/edit-inventory-item-attributes-S3HC6QLQ.mjs +297 -0
- package/dist/edit-reservation-LOB3RJ7B.mjs +249 -0
- package/dist/edit-rules-HUMVN4MD.mjs +272 -0
- package/dist/en.json +3311 -0
- package/dist/home-KFQGXKRT.mjs +16 -0
- package/dist/index.d.ts +10 -0
- package/dist/inventory-create-ZPUOJP7S.mjs +599 -0
- package/dist/inventory-detail-IBGA6OJ5.mjs +751 -0
- package/dist/inventory-list-4C5Z7CC5.mjs +413 -0
- package/dist/inventory-metadata-774S7FV4.mjs +74 -0
- package/dist/inventory-stock-RBIJMUBV.mjs +293 -0
- package/dist/invite-3KUCHUTF.mjs +362 -0
- package/dist/location-create-YRQYKOVU.mjs +240 -0
- package/dist/location-detail-F6MVSFSE.mjs +823 -0
- package/dist/location-edit-RZAKOXKH.mjs +256 -0
- package/dist/location-fulfillment-providers-3ODKOKQV.mjs +291 -0
- package/dist/location-list-C4EDJMIE.mjs +323 -0
- package/dist/location-sales-channels-NFDU7PBR.mjs +189 -0
- package/dist/location-service-zone-create-KFEG2FP7.mjs +174 -0
- package/dist/location-service-zone-edit-RWWWYJ7O.mjs +137 -0
- package/dist/location-service-zone-manage-areas-GPWFFIBT.mjs +155 -0
- package/dist/location-service-zone-shipping-option-create-PB4OXW3T.mjs +796 -0
- package/dist/location-service-zone-shipping-option-edit-7ME3GVRL.mjs +368 -0
- package/dist/location-service-zone-shipping-option-pricing-E24IAV36.mjs +357 -0
- package/dist/login-WSXW2XIW.mjs +325 -0
- package/dist/manage-locations-4DGVNLYL.mjs +250 -0
- package/dist/no-match-4YRQTKJD.mjs +33 -0
- package/dist/order-allocate-items-LSVBTKPE.mjs +558 -0
- package/dist/order-create-claim-BS7QRFZT.mjs +2143 -0
- package/dist/order-create-edit-BNIKKD6R.mjs +772 -0
- package/dist/order-create-exchange-LZZOJKHY.mjs +2144 -0
- package/dist/order-create-fulfillment-YWEDORGR.mjs +610 -0
- package/dist/order-create-refund-J5FTOWGJ.mjs +690 -0
- package/dist/order-create-return-SI4UJIK5.mjs +1288 -0
- package/dist/order-create-shipment-M2TDSJP6.mjs +284 -0
- package/dist/order-detail-WTAGF6K5.mjs +3553 -0
- package/dist/order-edit-billing-address-RYPXALHJ.mjs +300 -0
- package/dist/order-edit-email-Y5YD24FI.mjs +148 -0
- package/dist/order-edit-shipping-address-5G5S5JG2.mjs +297 -0
- package/dist/order-export-HCIPFZXG.mjs +131 -0
- package/dist/order-list-4JYZ5PVV.mjs +330 -0
- package/dist/order-metadata-IG4BXARU.mjs +73 -0
- package/dist/order-receive-return-I6LBDB3Q.mjs +554 -0
- package/dist/order-request-transfer-EMUBP52T.mjs +575 -0
- package/dist/price-list-configuration-HAVZ2V7E.mjs +355 -0
- package/dist/price-list-create-RAZUHESH.mjs +960 -0
- package/dist/price-list-detail-TNP75PRJ.mjs +559 -0
- package/dist/price-list-edit-7SW7BUF4.mjs +227 -0
- package/dist/price-list-list-5N5HJPM3.mjs +251 -0
- package/dist/price-list-prices-add-7IEBI6VR.mjs +615 -0
- package/dist/price-list-prices-edit-JHHVHIK3.mjs +313 -0
- package/dist/product-attributes-FZN5FBTN.mjs +340 -0
- package/dist/product-create-KOARKVLW.mjs +2231 -0
- package/dist/product-create-option-NPEDGHZE.mjs +151 -0
- package/dist/product-create-variant-43Y5RF3E.mjs +823 -0
- package/dist/product-detail-IN2O5DEF.mjs +1256 -0
- package/dist/product-edit-RLW4J3UB.mjs +313 -0
- package/dist/product-edit-option-66YVWG6O.mjs +157 -0
- package/dist/product-export-YAB56R6E.mjs +131 -0
- package/dist/product-image-variants-edit-LUKL275V.mjs +334 -0
- package/dist/product-import-AX6Q42LM.mjs +268 -0
- package/dist/product-list-TF24QRNG.mjs +459 -0
- package/dist/product-media-3DQ2LIUB.mjs +701 -0
- package/dist/product-metadata-7SAZ35AT.mjs +74 -0
- package/dist/product-organization-YN7YXIWS.mjs +281 -0
- package/dist/product-prices-LOUY77V4.mjs +227 -0
- package/dist/product-sales-channels-S2OD4436.mjs +165 -0
- package/dist/product-shipping-profile-WD6LOI4M.mjs +145 -0
- package/dist/product-stock-HZRHSEDF.mjs +545 -0
- package/dist/product-tag-create-UUM4ZE2M.mjs +127 -0
- package/dist/product-tag-detail-W6M2LEQR.mjs +304 -0
- package/dist/product-tag-edit-674OSZZH.mjs +140 -0
- package/dist/product-tag-list-RXZFET7E.mjs +282 -0
- package/dist/product-tag-metadata-GRLX3C2Q.mjs +73 -0
- package/dist/product-type-create-XY5BE533.mjs +103 -0
- package/dist/product-type-detail-22ZHL6DS.mjs +265 -0
- package/dist/product-type-edit-M2U7YUJD.mjs +117 -0
- package/dist/product-type-list-3JY7CTAA.mjs +201 -0
- package/dist/product-type-metadata-PSRCZKDV.mjs +73 -0
- package/dist/product-variant-detail-4F6IX6MM.mjs +571 -0
- package/dist/product-variant-edit-IRUNIAYG.mjs +539 -0
- package/dist/product-variant-manage-inventory-items-ET6YPQP3.mjs +343 -0
- package/dist/product-variant-media-DRT5DE5P.mjs +376 -0
- package/dist/product-variant-metadata-HRVK7DEZ.mjs +77 -0
- package/dist/profile-detail-VNUJILTO.mjs +96 -0
- package/dist/profile-edit-TFV42P22.mjs +177 -0
- package/dist/promotion-add-campaign-HB2IHPPX.mjs +45 -0
- package/dist/promotion-create-S6FP2NTH.mjs +1227 -0
- package/dist/promotion-detail-AECYBJWT.mjs +509 -0
- package/dist/promotion-edit-details-2UNVLLBP.mjs +498 -0
- package/dist/promotion-list-PYMKNPW3.mjs +216 -0
- package/dist/refund-reason-create-75WFVL5X.mjs +195 -0
- package/dist/refund-reason-edit-JLIAOA54.mjs +196 -0
- package/dist/refund-reason-list-EWXWKRUP.mjs +246 -0
- package/dist/region-add-countries-FH7WTMU5.mjs +223 -0
- package/dist/region-create-2T4MWC4Z.mjs +497 -0
- package/dist/region-detail-B3GUB37B.mjs +494 -0
- package/dist/region-edit-2FSEVLOP.mjs +310 -0
- package/dist/region-list-QEADKLOY.mjs +215 -0
- package/dist/region-metadata-NFYAHB2F.mjs +74 -0
- package/dist/reservation-create-ND6DSNKT.mjs +312 -0
- package/dist/reservation-detail-YBOFICEP.mjs +235 -0
- package/dist/reservation-list-K44BOK7R.mjs +302 -0
- package/dist/reservation-metadata-PDKWSVYX.mjs +74 -0
- package/dist/reset-password-E7TYBPPE.mjs +381 -0
- package/dist/return-reason-create-MGNM7VYN.mjs +163 -0
- package/dist/return-reason-edit-OM3Y5MMI.mjs +168 -0
- package/dist/return-reason-list-7SNQPIIW.mjs +245 -0
- package/dist/sales-channel-add-products-ZHJ3AGRH.mjs +274 -0
- package/dist/sales-channel-create-XG3PEX3G.mjs +156 -0
- package/dist/sales-channel-detail-XFSOLMFO.mjs +442 -0
- package/dist/sales-channel-edit-DG27YNYG.mjs +166 -0
- package/dist/sales-channel-list-AJ6P4KAT.mjs +207 -0
- package/dist/sales-channel-metadata-BA3SFE2P.mjs +79 -0
- package/dist/settings-FKUZ6EYT.mjs +19 -0
- package/dist/settings-KJGPXBDJ.mjs +549 -0
- package/dist/shipping-option-type-create-HDNTVL56.mjs +198 -0
- package/dist/shipping-option-type-detail-RLTKAAQK.mjs +180 -0
- package/dist/shipping-option-type-edit-KEDMAP7J.mjs +197 -0
- package/dist/shipping-option-type-list-L5PZ7ZFM.mjs +279 -0
- package/dist/shipping-profile-create-Z7XRDHU3.mjs +125 -0
- package/dist/shipping-profile-detail-AYYBFPSQ.mjs +165 -0
- package/dist/shipping-profile-metadata-35WEIPZB.mjs +75 -0
- package/dist/shipping-profiles-list-YSYM46QD.mjs +251 -0
- package/dist/store-add-currencies-QGLOAIJO.mjs +300 -0
- package/dist/store-add-locales-72674T3W.mjs +82 -0
- package/dist/store-detail-VKOWH3SL.mjs +781 -0
- package/dist/store-edit-XCBTEI35.mjs +247 -0
- package/dist/store-metadata-V4SGUYKY.mjs +72 -0
- package/dist/tax-region-create-G3BOD6C5.mjs +301 -0
- package/dist/tax-region-detail-FS6ZNEAI.mjs +388 -0
- package/dist/tax-region-edit-INVOVYED.mjs +167 -0
- package/dist/tax-region-list-KQP4Q3E5.mjs +100 -0
- package/dist/tax-region-province-create-OFPOZSXU.mjs +312 -0
- package/dist/tax-region-province-detail-RN64NGAZ.mjs +280 -0
- package/dist/tax-region-tax-override-create-3Q56UJRX.mjs +681 -0
- package/dist/tax-region-tax-override-edit-LJ7AI3XV.mjs +273 -0
- package/dist/tax-region-tax-rate-create-VXJ3UZTT.mjs +195 -0
- package/dist/tax-region-tax-rate-edit-PBFVAWDZ.mjs +195 -0
- package/dist/translation-list-77WQA3S6.mjs +582 -0
- package/dist/translations-edit-2ASRTZ77.mjs +674 -0
- package/dist/user-detail-PHL64WWP.mjs +172 -0
- package/dist/user-edit-33WO64ER.mjs +118 -0
- package/dist/user-invite-F5D5RCWB.mjs +343 -0
- package/dist/user-list-IL65REDJ.mjs +165 -0
- package/dist/user-metadata-OUQI74YV.mjs +74 -0
- package/dist/workflow-execution-detail-7U67F575.mjs +840 -0
- package/dist/workflow-execution-list-54WC7PFS.mjs +179 -0
- package/package.json +89 -0
- package/src/app.tsx +34 -0
- package/src/assets/fonts/Inter-Medium.ttf +0 -0
- package/src/assets/fonts/Inter-Regular.ttf +0 -0
- package/src/assets/fonts/RobotoMono-Medium.ttf +0 -0
- package/src/assets/fonts/RobotoMono-Regular.ttf +0 -0
- package/src/components/authentication/protected-route/index.ts +1 -0
- package/src/components/authentication/protected-route/protected-route.tsx +30 -0
- package/src/components/common/action-menu/action-menu.tsx +125 -0
- package/src/components/common/action-menu/index.ts +1 -0
- package/src/components/common/badge-list-summary/badge-list-summary.tsx +81 -0
- package/src/components/common/badge-list-summary/index.ts +1 -0
- package/src/components/common/chip-group/chip-group.tsx +111 -0
- package/src/components/common/chip-group/index.ts +1 -0
- package/src/components/common/conditional-tooltip/conditional-tooltip.tsx +20 -0
- package/src/components/common/conditional-tooltip/index.ts +1 -0
- package/src/components/common/customer-info/customer-info.tsx +202 -0
- package/src/components/common/customer-info/index.ts +1 -0
- package/src/components/common/date-range-display/date-range-display.tsx +73 -0
- package/src/components/common/date-range-display/index.ts +1 -0
- package/src/components/common/display-id/display-id.tsx +30 -0
- package/src/components/common/display-id/index.ts +1 -0
- package/src/components/common/empty-table-content/empty-table-content.tsx +106 -0
- package/src/components/common/empty-table-content/index.ts +1 -0
- package/src/components/common/file-preview/file-preview.tsx +130 -0
- package/src/components/common/file-preview/index.ts +1 -0
- package/src/components/common/file-upload/file-upload.tsx +156 -0
- package/src/components/common/file-upload/index.ts +1 -0
- package/src/components/common/form/form.tsx +222 -0
- package/src/components/common/form/index.ts +1 -0
- package/src/components/common/icon-avatar/icon-avatar.tsx +42 -0
- package/src/components/common/icon-avatar/index.ts +1 -0
- package/src/components/common/infinite-list/index.ts +1 -0
- package/src/components/common/infinite-list/infinite-list.tsx +156 -0
- package/src/components/common/json-view-section/index.ts +1 -0
- package/src/components/common/json-view-section/json-view-section.tsx +201 -0
- package/src/components/common/link-button/index.ts +1 -0
- package/src/components/common/link-button/link-button.tsx +29 -0
- package/src/components/common/list-summary/index.ts +1 -0
- package/src/components/common/list-summary/list-summary.tsx +70 -0
- package/src/components/common/listicle/index.ts +1 -0
- package/src/components/common/listicle/listicle.tsx +34 -0
- package/src/components/common/logo-box/avatar-box.tsx +87 -0
- package/src/components/common/logo-box/index.ts +2 -0
- package/src/components/common/logo-box/logo-box.tsx +74 -0
- package/src/components/common/metadata-section/index.ts +1 -0
- package/src/components/common/metadata-section/metadata-section.tsx +49 -0
- package/src/components/common/progress-bar/index.ts +1 -0
- package/src/components/common/progress-bar/progress-bar.tsx +33 -0
- package/src/components/common/section/index.ts +1 -0
- package/src/components/common/section/section-row.tsx +41 -0
- package/src/components/common/segmented-control/index.ts +2 -0
- package/src/components/common/segmented-control/segmented-control.tsx +53 -0
- package/src/components/common/sidebar-link/indext.ts +1 -0
- package/src/components/common/sidebar-link/sidebar-link.tsx +47 -0
- package/src/components/common/skeleton/index.ts +1 -0
- package/src/components/common/skeleton/skeleton.tsx +327 -0
- package/src/components/common/sortable-list/index.ts +1 -0
- package/src/components/common/sortable-list/sortable-list.tsx +228 -0
- package/src/components/common/sortable-tree/index.ts +1 -0
- package/src/components/common/sortable-tree/keyboard-coordinates.ts +156 -0
- package/src/components/common/sortable-tree/sortable-tree-item.tsx +62 -0
- package/src/components/common/sortable-tree/sortable-tree.tsx +379 -0
- package/src/components/common/sortable-tree/tree-item.tsx +207 -0
- package/src/components/common/sortable-tree/types.ts +23 -0
- package/src/components/common/sortable-tree/utils.ts +299 -0
- package/src/components/common/switch-box/index.ts +1 -0
- package/src/components/common/switch-box/switch-box.tsx +76 -0
- package/src/components/common/tax-badge/tax-badge.tsx +30 -0
- package/src/components/common/thumbnail/index.ts +1 -0
- package/src/components/common/thumbnail/thumbnail.tsx +32 -0
- package/src/components/common/user-link/index.ts +1 -0
- package/src/components/common/user-link/user-link.tsx +45 -0
- package/src/components/data-grid/components/data-grid-boolean-cell.tsx +71 -0
- package/src/components/data-grid/components/data-grid-cell-container.tsx +97 -0
- package/src/components/data-grid/components/data-grid-country-select-cell.tsx +149 -0
- package/src/components/data-grid/components/data-grid-currency-cell.tsx +140 -0
- package/src/components/data-grid/components/data-grid-duplicate-cell.tsx +21 -0
- package/src/components/data-grid/components/data-grid-keyboard-shortcut-modal.tsx +245 -0
- package/src/components/data-grid/components/data-grid-multiline-cell.tsx +103 -0
- package/src/components/data-grid/components/data-grid-number-cell.tsx +94 -0
- package/src/components/data-grid/components/data-grid-readonly-cell.tsx +43 -0
- package/src/components/data-grid/components/data-grid-root.tsx +1156 -0
- package/src/components/data-grid/components/data-grid-row-error-indicator.tsx +55 -0
- package/src/components/data-grid/components/data-grid-select-cell.tsx +55 -0
- package/src/components/data-grid/components/data-grid-skeleton.tsx +63 -0
- package/src/components/data-grid/components/data-grid-text-cell.tsx +75 -0
- package/src/components/data-grid/components/data-grid-textarea-modal-cell.tsx +233 -0
- package/src/components/data-grid/components/data-grid-toggleable-number-cell.tsx +206 -0
- package/src/components/data-grid/components/index.ts +9 -0
- package/src/components/data-grid/context/data-grid-context.tsx +45 -0
- package/src/components/data-grid/context/index.ts +2 -0
- package/src/components/data-grid/context/use-data-grid-context.tsx +14 -0
- package/src/components/data-grid/data-grid.tsx +56 -0
- package/src/components/data-grid/helpers/create-data-grid-column-helper.ts +93 -0
- package/src/components/data-grid/helpers/create-data-grid-price-columns.tsx +136 -0
- package/src/components/data-grid/helpers/index.ts +2 -0
- package/src/components/data-grid/hooks/index.ts +14 -0
- package/src/components/data-grid/hooks/use-data-grid-cell-error.tsx +78 -0
- package/src/components/data-grid/hooks/use-data-grid-cell-handlers.tsx +162 -0
- package/src/components/data-grid/hooks/use-data-grid-cell-metadata.tsx +75 -0
- package/src/components/data-grid/hooks/use-data-grid-cell-snapshot.tsx +75 -0
- package/src/components/data-grid/hooks/use-data-grid-cell.tsx +257 -0
- package/src/components/data-grid/hooks/use-data-grid-clipboard-events.tsx +105 -0
- package/src/components/data-grid/hooks/use-data-grid-column-visibility.tsx +68 -0
- package/src/components/data-grid/hooks/use-data-grid-duplicate-cell.tsx +18 -0
- package/src/components/data-grid/hooks/use-data-grid-error-highlighting.tsx +133 -0
- package/src/components/data-grid/hooks/use-data-grid-form-handlers.tsx +237 -0
- package/src/components/data-grid/hooks/use-data-grid-keydown-event.tsx +732 -0
- package/src/components/data-grid/hooks/use-data-grid-mouse-up-event.tsx +96 -0
- package/src/components/data-grid/hooks/use-data-grid-navigation.tsx +113 -0
- package/src/components/data-grid/hooks/use-data-grid-query-tool.tsx +15 -0
- package/src/components/data-grid/index.ts +2 -0
- package/src/components/data-grid/models/data-grid-bulk-update-command.ts +38 -0
- package/src/components/data-grid/models/data-grid-matrix.ts +421 -0
- package/src/components/data-grid/models/data-grid-query-tool.ts +74 -0
- package/src/components/data-grid/models/data-grid-update-command.ts +33 -0
- package/src/components/data-grid/models/index.ts +5 -0
- package/src/components/data-grid/types.ts +173 -0
- package/src/components/data-grid/utils.ts +28 -0
- package/src/components/data-table/components/data-table-status-cell/data-table-status-cell.tsx +35 -0
- package/src/components/data-table/data-table.tsx +545 -0
- package/src/components/data-table/helpers/general/use-data-table-date-columns.tsx +61 -0
- package/src/components/data-table/helpers/general/use-data-table-date-filters.tsx +95 -0
- package/src/components/data-table/helpers/sales-channels/index.ts +4 -0
- package/src/components/data-table/helpers/sales-channels/use-sales-channel-table-columns.tsx +61 -0
- package/src/components/data-table/helpers/sales-channels/use-sales-channel-table-empty-state.tsx +22 -0
- package/src/components/data-table/helpers/sales-channels/use-sales-channel-table-filters.tsx +33 -0
- package/src/components/data-table/helpers/sales-channels/use-sales-channel-table-query.tsx +30 -0
- package/src/components/data-table/index.ts +1 -0
- package/src/components/filtering/filter-group/filter-group.tsx +58 -0
- package/src/components/filtering/filter-group/index.ts +1 -0
- package/src/components/filtering/order-by/index.ts +1 -0
- package/src/components/filtering/order-by/order-by.tsx +151 -0
- package/src/components/filtering/query/index.ts +1 -0
- package/src/components/filtering/query/query.tsx +57 -0
- package/src/components/forms/address-form/address-form.tsx +228 -0
- package/src/components/forms/address-form/index.ts +1 -0
- package/src/components/forms/email-form/email-form.tsx +42 -0
- package/src/components/forms/email-form/index.ts +1 -0
- package/src/components/forms/metadata-form/index.ts +1 -0
- package/src/components/forms/metadata-form/metadata-form.tsx +438 -0
- package/src/components/inputs/chip-input/chip-input.tsx +191 -0
- package/src/components/inputs/chip-input/index.ts +1 -0
- package/src/components/inputs/combobox/combobox.tsx +422 -0
- package/src/components/inputs/combobox/index.ts +1 -0
- package/src/components/inputs/country-select/country-select.tsx +53 -0
- package/src/components/inputs/country-select/index.ts +1 -0
- package/src/components/inputs/handle-input/handle-input.tsx +24 -0
- package/src/components/inputs/handle-input/index.ts +1 -0
- package/src/components/inputs/percentage-input/index.ts +1 -0
- package/src/components/inputs/percentage-input/percentage-input.tsx +105 -0
- package/src/components/inputs/province-select/index.ts +1 -0
- package/src/components/inputs/province-select/province-select.tsx +91 -0
- package/src/components/layout/main-layout/index.ts +1 -0
- package/src/components/layout/main-layout/main-layout.tsx +389 -0
- package/src/components/layout/nav-item/index.ts +1 -0
- package/src/components/layout/nav-item/nav-item.tsx +254 -0
- package/src/components/layout/notifications/index.ts +1 -0
- package/src/components/layout/notifications/notifications.tsx +232 -0
- package/src/components/layout/pages/index.ts +2 -0
- package/src/components/layout/pages/single-column-page/index.ts +1 -0
- package/src/components/layout/pages/single-column-page/single-column-page.tsx +63 -0
- package/src/components/layout/pages/two-column-page/index.ts +1 -0
- package/src/components/layout/pages/two-column-page/two-column-page.tsx +141 -0
- package/src/components/layout/pages/types.ts +15 -0
- package/src/components/layout/public-layout/index.ts +1 -0
- package/src/components/layout/public-layout/public-layout.tsx +5 -0
- package/src/components/layout/settings-layout/index.ts +1 -0
- package/src/components/layout/settings-layout/settings-layout.tsx +266 -0
- package/src/components/layout/shell/index.ts +1 -0
- package/src/components/layout/shell/shell.tsx +263 -0
- package/src/components/layout/user-menu/index.ts +1 -0
- package/src/components/layout/user-menu/user-menu.tsx +344 -0
- package/src/components/localization/localized-table-pagination/index.ts +1 -0
- package/src/components/localization/localized-table-pagination/localized-table-pagination.tsx +26 -0
- package/src/components/modals/hooks/use-state-aware-to.tsx +32 -0
- package/src/components/modals/index.ts +7 -0
- package/src/components/modals/route-drawer/index.ts +1 -0
- package/src/components/modals/route-drawer/route-drawer.tsx +82 -0
- package/src/components/modals/route-focus-modal/index.ts +1 -0
- package/src/components/modals/route-focus-modal/route-focus-modal.tsx +109 -0
- package/src/components/modals/route-modal-form/index.ts +1 -0
- package/src/components/modals/route-modal-form/route-modal-form.tsx +93 -0
- package/src/components/modals/route-modal-provider/index.ts +2 -0
- package/src/components/modals/route-modal-provider/route-modal-context.tsx +12 -0
- package/src/components/modals/route-modal-provider/route-provider.tsx +51 -0
- package/src/components/modals/route-modal-provider/use-route-modal.tsx +12 -0
- package/src/components/modals/stacked-drawer/index.ts +1 -0
- package/src/components/modals/stacked-drawer/stacked-drawer.tsx +85 -0
- package/src/components/modals/stacked-focus-modal/index.ts +1 -0
- package/src/components/modals/stacked-focus-modal/stacked-focus-modal.tsx +98 -0
- package/src/components/modals/stacked-modal-provider/index.ts +2 -0
- package/src/components/modals/stacked-modal-provider/stacked-modal-context.tsx +10 -0
- package/src/components/modals/stacked-modal-provider/stacked-modal-provider.tsx +54 -0
- package/src/components/modals/stacked-modal-provider/use-stacked-modal.ts +14 -0
- package/src/components/search/constants.ts +30 -0
- package/src/components/search/index.ts +1 -0
- package/src/components/search/search.tsx +576 -0
- package/src/components/search/types.ts +20 -0
- package/src/components/search/use-search-results.tsx +752 -0
- package/src/components/table/configurable-data-table/configurable-data-table.tsx +240 -0
- package/src/components/table/configurable-data-table/index.ts +3 -0
- package/src/components/table/configurable-data-table/save-view-dropdown.tsx +87 -0
- package/src/components/table/data-table/data-table-filter/context.tsx +19 -0
- package/src/components/table/data-table/data-table-filter/data-table-filter.tsx +296 -0
- package/src/components/table/data-table/data-table-filter/date-filter.tsx +328 -0
- package/src/components/table/data-table/data-table-filter/filter-chip.tsx +97 -0
- package/src/components/table/data-table/data-table-filter/index.ts +1 -0
- package/src/components/table/data-table/data-table-filter/number-filter.tsx +316 -0
- package/src/components/table/data-table/data-table-filter/select-filter.tsx +201 -0
- package/src/components/table/data-table/data-table-filter/string-filter.tsx +125 -0
- package/src/components/table/data-table/data-table-filter/types.ts +9 -0
- package/src/components/table/data-table/data-table-order-by/data-table-order-by.tsx +153 -0
- package/src/components/table/data-table/data-table-order-by/index.ts +1 -0
- package/src/components/table/data-table/data-table-query/data-table-query.tsx +39 -0
- package/src/components/table/data-table/data-table-query/index.ts +1 -0
- package/src/components/table/data-table/data-table-root/data-table-root.tsx +382 -0
- package/src/components/table/data-table/data-table-root/index.ts +1 -0
- package/src/components/table/data-table/data-table-search/data-table-search.tsx +61 -0
- package/src/components/table/data-table/data-table-search/index.ts +1 -0
- package/src/components/table/data-table/data-table.tsx +96 -0
- package/src/components/table/data-table/hooks.tsx +73 -0
- package/src/components/table/data-table/index.ts +2 -0
- package/src/components/table/save-view-dialog/index.ts +1 -0
- package/src/components/table/save-view-dialog/save-view-dialog.tsx +163 -0
- package/src/components/table/save-view-dropdown/index.ts +1 -0
- package/src/components/table/save-view-dropdown/save-view-dropdown.tsx +88 -0
- package/src/components/table/table-cells/common/code-cell/code-cell.tsx +27 -0
- package/src/components/table/table-cells/common/code-cell/index.ts +1 -0
- package/src/components/table/table-cells/common/created-at-cell/created-at-cell.tsx +44 -0
- package/src/components/table/table-cells/common/created-at-cell/index.ts +1 -0
- package/src/components/table/table-cells/common/date-cell/date-cell.tsx +44 -0
- package/src/components/table/table-cells/common/date-cell/index.ts +1 -0
- package/src/components/table/table-cells/common/email-cell/email-cell.tsx +28 -0
- package/src/components/table/table-cells/common/email-cell/index.ts +1 -0
- package/src/components/table/table-cells/common/money-amount-cell/index.ts +1 -0
- package/src/components/table/table-cells/common/money-amount-cell/money-amount-cell.tsx +38 -0
- package/src/components/table/table-cells/common/name-cell/index.ts +1 -0
- package/src/components/table/table-cells/common/name-cell/name-cell.tsx +31 -0
- package/src/components/table/table-cells/common/placeholder-cell/index.ts +1 -0
- package/src/components/table/table-cells/common/placeholder-cell/placeholder-cell.tsx +7 -0
- package/src/components/table/table-cells/common/status-cell/index.ts +1 -0
- package/src/components/table/table-cells/common/status-cell/status-cell.tsx +35 -0
- package/src/components/table/table-cells/common/text-cell/index.ts +1 -0
- package/src/components/table/table-cells/common/text-cell/text-cell.tsx +49 -0
- package/src/components/table/table-cells/customer/account-cell/account-cell.tsx +27 -0
- package/src/components/table/table-cells/customer/first-seen-cell/first-seen-cell.tsx +25 -0
- package/src/components/table/table-cells/customer/first-seen-cell/index.ts +1 -0
- package/src/components/table/table-cells/order/country-cell/country-cell.tsx +36 -0
- package/src/components/table/table-cells/order/country-cell/index.ts +1 -0
- package/src/components/table/table-cells/order/customer-cell/customer-cell.tsx +31 -0
- package/src/components/table/table-cells/order/customer-cell/index.ts +1 -0
- package/src/components/table/table-cells/order/display-id-cell/display-id-cell.tsx +24 -0
- package/src/components/table/table-cells/order/display-id-cell/index.ts +1 -0
- package/src/components/table/table-cells/order/fulfillment-status-cell/fulfillment-status-cell.tsx +35 -0
- package/src/components/table/table-cells/order/fulfillment-status-cell/index.ts +1 -0
- package/src/components/table/table-cells/order/payment-status-cell/index.ts +1 -0
- package/src/components/table/table-cells/order/payment-status-cell/payment-status-cell.tsx +26 -0
- package/src/components/table/table-cells/order/sales-channel-cell/index.ts +1 -0
- package/src/components/table/table-cells/order/sales-channel-cell/sales-channel-cell.tsx +30 -0
- package/src/components/table/table-cells/order/total-cell/index.ts +1 -0
- package/src/components/table/table-cells/order/total-cell/total-cell.tsx +29 -0
- package/src/components/table/table-cells/product/collection-cell/collection-cell.tsx +30 -0
- package/src/components/table/table-cells/product/collection-cell/index.ts +1 -0
- package/src/components/table/table-cells/product/product-cell/index.ts +1 -0
- package/src/components/table/table-cells/product/product-cell/product-cell.tsx +31 -0
- package/src/components/table/table-cells/product/product-status-cell/index.ts +1 -0
- package/src/components/table/table-cells/product/product-status-cell/product-status-cell.tsx +31 -0
- package/src/components/table/table-cells/product/sales-channels-cell/index.ts +1 -0
- package/src/components/table/table-cells/product/sales-channels-cell/sales-channels-cell.tsx +67 -0
- package/src/components/table/table-cells/product/variant-cell/index.ts +1 -0
- package/src/components/table/table-cells/product/variant-cell/variant-cell.tsx +34 -0
- package/src/components/table/table-cells/promotion/status-cell/index.ts +1 -0
- package/src/components/table/table-cells/promotion/status-cell/status-cell.tsx +13 -0
- package/src/components/table/table-cells/region/countries-cell/countries-cell.tsx +39 -0
- package/src/components/table/table-cells/region/countries-cell/index.ts +1 -0
- package/src/components/table/table-cells/region/fulfillment-providers-cell/fulfillment-providers-cell.tsx +49 -0
- package/src/components/table/table-cells/region/fulfillment-providers-cell/index.ts +1 -0
- package/src/components/table/table-cells/region/payment-providers-cell/index.ts +1 -0
- package/src/components/table/table-cells/region/payment-providers-cell/payment-providers-cell.tsx +36 -0
- package/src/components/table/table-cells/region/region-cell/index.ts +1 -0
- package/src/components/table/table-cells/region/region-cell/region-cell.tsx +23 -0
- package/src/components/table/table-cells/sales-channel/description-cell/description-cell.tsx +28 -0
- package/src/components/table/table-cells/sales-channel/description-cell/index.ts +1 -0
- package/src/components/table/table-cells/sales-channel/name-cell/index.ts +1 -0
- package/src/components/table/table-cells/sales-channel/name-cell/name-cell.tsx +28 -0
- package/src/components/table/table-cells/shipping-option/admin-only-cell/admin-only-cell.tsx +25 -0
- package/src/components/table/table-cells/shipping-option/admin-only-cell/index.ts +1 -0
- package/src/components/table/table-cells/shipping-option/is-return-cell/index.ts +1 -0
- package/src/components/table/table-cells/shipping-option/is-return-cell/is-return-cell.tsx +27 -0
- package/src/components/table/table-cells/shipping-option/price-type-cell/index.ts +1 -0
- package/src/components/table/table-cells/shipping-option/price-type-cell/price-type-cell.tsx +34 -0
- package/src/components/table/table-cells/shipping-option/shipping-option-cell/index.ts +1 -0
- package/src/components/table/table-cells/shipping-option/shipping-option-cell/shipping-option-cell.tsx +28 -0
- package/src/components/table/table-cells/shipping-option/shipping-price-cell/shipping-price-cell.tsx +31 -0
- package/src/components/table/table-cells/taxes/type-cell/index.ts +1 -0
- package/src/components/table/table-cells/taxes/type-cell/type-cell.tsx +33 -0
- package/src/components/table/view-selector/index.ts +2 -0
- package/src/components/table/view-selector/view-pills.tsx +265 -0
- package/src/components/table/view-selector/view-selector.tsx +253 -0
- package/src/components/utilities/error-boundary/error-boundary.tsx +75 -0
- package/src/components/utilities/error-boundary/index.ts +1 -0
- package/src/components/utilities/generic-forward-ref/generic-forward-ref.tsx +7 -0
- package/src/components/utilities/generic-forward-ref/index.ts +1 -0
- package/src/components/utilities/i18n/i18n.tsx +33 -0
- package/src/components/utilities/i18n/index.ts +1 -0
- package/src/components/utilities/keybound-form/index.ts +1 -0
- package/src/components/utilities/keybound-form/keybound-form.tsx +42 -0
- package/src/components/utilities/visually-hidden/index.ts +1 -0
- package/src/components/utilities/visually-hidden/visually-hidden.tsx +5 -0
- package/src/dashboard-app/__tests__/sort-menu-items-by-rank.spec.ts +169 -0
- package/src/dashboard-app/dashboard-app.tsx +499 -0
- package/src/dashboard-app/forms/form-extension-zone/form-extension-zone.tsx +116 -0
- package/src/dashboard-app/forms/form-extension-zone/index.ts +1 -0
- package/src/dashboard-app/forms/form-extension-zone/types.ts +1 -0
- package/src/dashboard-app/forms/form-extension-zone/utils.ts +66 -0
- package/src/dashboard-app/forms/hooks.tsx +86 -0
- package/src/dashboard-app/forms/index.ts +2 -0
- package/src/dashboard-app/index.ts +12 -0
- package/src/dashboard-app/links/utils.ts +20 -0
- package/src/dashboard-app/routes/get-route.map.tsx +1904 -0
- package/src/dashboard-app/routes/utils.ts +229 -0
- package/src/dashboard-app/types.ts +143 -0
- package/src/dashboard-app/utils/sort-menu-items-by-rank.ts +43 -0
- package/src/hooks/api/api-keys.tsx +179 -0
- package/src/hooks/api/auth.tsx +75 -0
- package/src/hooks/api/campaigns.tsx +138 -0
- package/src/hooks/api/categories.tsx +186 -0
- package/src/hooks/api/claims.tsx +593 -0
- package/src/hooks/api/cloud.tsx +41 -0
- package/src/hooks/api/collections.tsx +180 -0
- package/src/hooks/api/currencies.tsx +52 -0
- package/src/hooks/api/customer-groups.tsx +207 -0
- package/src/hooks/api/customers.tsx +263 -0
- package/src/hooks/api/exchanges.tsx +475 -0
- package/src/hooks/api/feature-flags.tsx +26 -0
- package/src/hooks/api/fulfillment-providers.tsx +59 -0
- package/src/hooks/api/fulfillment-sets.tsx +180 -0
- package/src/hooks/api/fulfillment.tsx +66 -0
- package/src/hooks/api/index.ts +41 -0
- package/src/hooks/api/inventory.tsx +274 -0
- package/src/hooks/api/invites.tsx +135 -0
- package/src/hooks/api/locales.tsx +52 -0
- package/src/hooks/api/notification.tsx +52 -0
- package/src/hooks/api/order-edits.tsx +242 -0
- package/src/hooks/api/orders.tsx +457 -0
- package/src/hooks/api/payment-collections.tsx +104 -0
- package/src/hooks/api/payments.tsx +116 -0
- package/src/hooks/api/plugins.tsx +28 -0
- package/src/hooks/api/price-lists.tsx +199 -0
- package/src/hooks/api/price-preferences.tsx +113 -0
- package/src/hooks/api/product-types.tsx +152 -0
- package/src/hooks/api/product-variants.tsx +69 -0
- package/src/hooks/api/products.tsx +508 -0
- package/src/hooks/api/promotions.tsx +286 -0
- package/src/hooks/api/refund-reasons.tsx +124 -0
- package/src/hooks/api/regions.tsx +131 -0
- package/src/hooks/api/reservations.tsx +149 -0
- package/src/hooks/api/return-reasons.tsx +132 -0
- package/src/hooks/api/returns.tsx +651 -0
- package/src/hooks/api/sales-channels.tsx +236 -0
- package/src/hooks/api/shipping-option-types.tsx +128 -0
- package/src/hooks/api/shipping-options.tsx +128 -0
- package/src/hooks/api/shipping-profiles.tsx +131 -0
- package/src/hooks/api/stock-locations.tsx +202 -0
- package/src/hooks/api/store.tsx +83 -0
- package/src/hooks/api/tags.tsx +160 -0
- package/src/hooks/api/tax-rates.tsx +127 -0
- package/src/hooks/api/tax-regions.tsx +124 -0
- package/src/hooks/api/translations.tsx +241 -0
- package/src/hooks/api/users.tsx +150 -0
- package/src/hooks/api/views.tsx +244 -0
- package/src/hooks/api/workflow-executions.tsx +52 -0
- package/src/hooks/table/columns/index.ts +12 -0
- package/src/hooks/table/columns/use-campaign-table-columns.tsx +73 -0
- package/src/hooks/table/columns/use-collection-table-columns.tsx +33 -0
- package/src/hooks/table/columns/use-column-state.ts +209 -0
- package/src/hooks/table/columns/use-configurable-table-columns.tsx +109 -0
- package/src/hooks/table/columns/use-customer-group-table-columns.tsx +33 -0
- package/src/hooks/table/columns/use-customer-table-columns.tsx +51 -0
- package/src/hooks/table/columns/use-fulfillment-provider-table-columns.tsx +25 -0
- package/src/hooks/table/columns/use-order-data-table-columns.tsx +234 -0
- package/src/hooks/table/columns/use-order-table-columns.tsx +162 -0
- package/src/hooks/table/columns/use-product-table-columns.tsx +59 -0
- package/src/hooks/table/columns/use-product-tag-table-columns.tsx +35 -0
- package/src/hooks/table/columns/use-product-type-table-columns.tsx +36 -0
- package/src/hooks/table/columns/use-promotion-table-columns.tsx +49 -0
- package/src/hooks/table/columns/use-refund-reason-table-columns.tsx +39 -0
- package/src/hooks/table/columns/use-region-table-columns.tsx +40 -0
- package/src/hooks/table/columns/use-return-reason-table-columns.tsx +32 -0
- package/src/hooks/table/columns/use-shipping-option-table-columns.tsx +89 -0
- package/src/hooks/table/columns/use-shipping-option-type-table-columns.tsx +44 -0
- package/src/hooks/table/columns/use-tax-rates-table-columns.tsx +55 -0
- package/src/hooks/table/filters/index.ts +12 -0
- package/src/hooks/table/filters/use-collection-table-filters.tsx +7 -0
- package/src/hooks/table/filters/use-customer-group-table-filters.tsx +21 -0
- package/src/hooks/table/filters/use-customer-table-filters.tsx +68 -0
- package/src/hooks/table/filters/use-date-table-filters.tsx +17 -0
- package/src/hooks/table/filters/use-order-table-filters.tsx +158 -0
- package/src/hooks/table/filters/use-product-table-filters.tsx +212 -0
- package/src/hooks/table/filters/use-product-tag-table-filters.tsx +7 -0
- package/src/hooks/table/filters/use-product-type-table-filters.tsx +7 -0
- package/src/hooks/table/filters/use-promotion-table-filters.tsx +13 -0
- package/src/hooks/table/filters/use-region-table-filters.tsx +19 -0
- package/src/hooks/table/filters/use-shipping-option-table-filters.tsx +30 -0
- package/src/hooks/table/filters/use-shipping-option-type-table-filters.tsx +5 -0
- package/src/hooks/table/filters/use-tax-rate-table-filters.tsx +19 -0
- package/src/hooks/table/query/index.ts +15 -0
- package/src/hooks/table/query/use-campaign-table-query.tsx +31 -0
- package/src/hooks/table/query/use-collection-table-query.tsx +33 -0
- package/src/hooks/table/query/use-customer-group-table-query.tsx +33 -0
- package/src/hooks/table/query/use-customer-table-query.tsx +44 -0
- package/src/hooks/table/query/use-fulfillment-providers-table-query.tsx +31 -0
- package/src/hooks/table/query/use-order-table-query.tsx +57 -0
- package/src/hooks/table/query/use-product-table-query.tsx +72 -0
- package/src/hooks/table/query/use-product-tag-table-query.tsx +32 -0
- package/src/hooks/table/query/use-product-type-table-query.tsx +32 -0
- package/src/hooks/table/query/use-product-variant-table-query.tsx +32 -0
- package/src/hooks/table/query/use-promotion-table-query.tsx +33 -0
- package/src/hooks/table/query/use-refund-reason-table-query.tsx +32 -0
- package/src/hooks/table/query/use-region-table-query.tsx +33 -0
- package/src/hooks/table/query/use-return-reason-table-query.tsx +32 -0
- package/src/hooks/table/query/use-shipping-option-table-query.tsx +61 -0
- package/src/hooks/table/query/use-shipping-option-type-table-query.tsx +32 -0
- package/src/hooks/table/query/use-tax-rate-table-query.tsx +33 -0
- package/src/hooks/table/query/use-tax-region-table-query.tsx +32 -0
- package/src/hooks/table/query/use-user-invite-table-query.tsx +32 -0
- package/src/hooks/table/use-table-configuration.tsx +287 -0
- package/src/hooks/use-combined-refs.tsx +19 -0
- package/src/hooks/use-combobox-data.tsx +123 -0
- package/src/hooks/use-command-history.tsx +67 -0
- package/src/hooks/use-data-table.tsx +132 -0
- package/src/hooks/use-date.tsx +48 -0
- package/src/hooks/use-debounced-search.tsx +29 -0
- package/src/hooks/use-document-direction.tsx +54 -0
- package/src/hooks/use-handle-table-scroll.tsx +24 -0
- package/src/hooks/use-infinite-list.tsx +92 -0
- package/src/hooks/use-media-query.tsx +14 -0
- package/src/hooks/use-query-params.tsx +24 -0
- package/src/hooks/use-view-configurations.tsx +102 -0
- package/src/i18n/config.ts +16 -0
- package/src/i18n/languages.ts +223 -0
- package/src/i18n/translations/$schema.json +12399 -0
- package/src/i18n/translations/__tests__/validate-translations.spec.ts +67 -0
- package/src/i18n/translations/ar.json +2956 -0
- package/src/i18n/translations/bg.json +2987 -0
- package/src/i18n/translations/bs.json +3016 -0
- package/src/i18n/translations/cs.json +3050 -0
- package/src/i18n/translations/de.json +2792 -0
- package/src/i18n/translations/el.json +2960 -0
- package/src/i18n/translations/en.json +3311 -0
- package/src/i18n/translations/es.json +3167 -0
- package/src/i18n/translations/fa.json +2932 -0
- package/src/i18n/translations/fr.json +2791 -0
- package/src/i18n/translations/he.json +3017 -0
- package/src/i18n/translations/hu.json +3005 -0
- package/src/i18n/translations/id.json +3020 -0
- package/src/i18n/translations/index.ts +126 -0
- package/src/i18n/translations/it.json +2805 -0
- package/src/i18n/translations/ja.json +2821 -0
- package/src/i18n/translations/ko.json +3026 -0
- package/src/i18n/translations/lt.json +3007 -0
- package/src/i18n/translations/mk.json +2925 -0
- package/src/i18n/translations/mn.json +2922 -0
- package/src/i18n/translations/nl.json +3005 -0
- package/src/i18n/translations/pl.json +3227 -0
- package/src/i18n/translations/ptBR.json +2789 -0
- package/src/i18n/translations/ptPT.json +3219 -0
- package/src/i18n/translations/ro.json +2935 -0
- package/src/i18n/translations/ru.json +2936 -0
- package/src/i18n/translations/th.json +2792 -0
- package/src/i18n/translations/tr.json +2961 -0
- package/src/i18n/translations/uk.json +2856 -0
- package/src/i18n/translations/vi.json +3051 -0
- package/src/i18n/translations/zhCN.json +3017 -0
- package/src/i18n/translations/zhTW.json +3249 -0
- package/src/i18n/types.ts +15 -0
- package/src/i18next.d.ts +7 -0
- package/src/index.css +48 -0
- package/src/index.ts +2 -0
- package/src/lib/addresses.ts +97 -0
- package/src/lib/cast-number.ts +6 -0
- package/src/lib/client/client.ts +18 -0
- package/src/lib/client/index.ts +1 -0
- package/src/lib/common.ts +45 -0
- package/src/lib/credit-line.ts +8 -0
- package/src/lib/data/countries.ts +1767 -0
- package/src/lib/data/country-states.ts +1311 -0
- package/src/lib/data/currencies.ts +752 -0
- package/src/lib/form-helpers.ts +69 -0
- package/src/lib/format-currency.ts +7 -0
- package/src/lib/format-provider.ts +18 -0
- package/src/lib/is-fetch-error.ts +5 -0
- package/src/lib/money-amount-helpers.ts +75 -0
- package/src/lib/number-helper.ts +19 -0
- package/src/lib/order-helpers.ts +74 -0
- package/src/lib/order-item.ts +5 -0
- package/src/lib/orders.ts +23 -0
- package/src/lib/payment.ts +23 -0
- package/src/lib/percentage-helpers.ts +28 -0
- package/src/lib/plugins.ts +7 -0
- package/src/lib/promotions.ts +51 -0
- package/src/lib/query-client.ts +13 -0
- package/src/lib/query-key-factory.ts +53 -0
- package/src/lib/rma.ts +17 -0
- package/src/lib/schemas.ts +36 -0
- package/src/lib/shipping-options.ts +62 -0
- package/src/lib/storefront.ts +2 -0
- package/src/lib/table/cell-renderers.tsx +332 -0
- package/src/lib/table/entity-adapters.tsx +138 -0
- package/src/lib/table/entity-defaults.ts +73 -0
- package/src/lib/table/field-utils.ts +75 -0
- package/src/lib/table/table-adapters.ts +94 -0
- package/src/lib/table-display-utils.tsx +372 -0
- package/src/lib/validation.ts +101 -0
- package/src/main.tsx +9 -0
- package/src/module.d.ts +41 -0
- package/src/providers/extension-provider/extension-context.tsx +8 -0
- package/src/providers/extension-provider/extension-provider.tsx +18 -0
- package/src/providers/extension-provider/index.ts +2 -0
- package/src/providers/extension-provider/use-extension.tsx +10 -0
- package/src/providers/feature-flag-provider/index.tsx +46 -0
- package/src/providers/i18n-provider/i18n-provider.tsx +25 -0
- package/src/providers/i18n-provider/index.ts +1 -0
- package/src/providers/index.ts +1 -0
- package/src/providers/keybind-provider/hooks.tsx +319 -0
- package/src/providers/keybind-provider/index.ts +3 -0
- package/src/providers/keybind-provider/keybind-context.tsx +4 -0
- package/src/providers/keybind-provider/keybind-provider.tsx +64 -0
- package/src/providers/keybind-provider/types.ts +28 -0
- package/src/providers/keybind-provider/utils.ts +92 -0
- package/src/providers/providers.tsx +34 -0
- package/src/providers/search-provider/index.ts +2 -0
- package/src/providers/search-provider/search-context.tsx +9 -0
- package/src/providers/search-provider/search-provider.tsx +50 -0
- package/src/providers/search-provider/use-search.tsx +10 -0
- package/src/providers/sidebar-provider/index.ts +2 -0
- package/src/providers/sidebar-provider/sidebar-context.tsx +9 -0
- package/src/providers/sidebar-provider/sidebar-provider.tsx +31 -0
- package/src/providers/sidebar-provider/use-sidebar.tsx +12 -0
- package/src/providers/theme-provider/index.ts +3 -0
- package/src/providers/theme-provider/theme-context.tsx +11 -0
- package/src/providers/theme-provider/theme-provider.tsx +84 -0
- package/src/providers/theme-provider/use-theme.tsx +10 -0
- package/src/routes/api-key-management/api-key-management-create/api-key-management-create.tsx +15 -0
- package/src/routes/api-key-management/api-key-management-create/components/api-key-create-form/api-key-create-form.tsx +205 -0
- package/src/routes/api-key-management/api-key-management-create/components/api-key-create-form/index.ts +1 -0
- package/src/routes/api-key-management/api-key-management-create/index.ts +1 -0
- package/src/routes/api-key-management/api-key-management-detail/api-key-management-detail.tsx +48 -0
- package/src/routes/api-key-management/api-key-management-detail/breadcrumb.tsx +24 -0
- package/src/routes/api-key-management/api-key-management-detail/components/api-key-general-section/api-key-general-section.tsx +249 -0
- package/src/routes/api-key-management/api-key-management-detail/components/api-key-general-section/index.ts +1 -0
- package/src/routes/api-key-management/api-key-management-detail/components/api-key-sales-channel-section/api-key-sales-channel-section.tsx +206 -0
- package/src/routes/api-key-management/api-key-management-detail/components/api-key-sales-channel-section/index.ts +1 -0
- package/src/routes/api-key-management/api-key-management-detail/index.ts +3 -0
- package/src/routes/api-key-management/api-key-management-detail/loader.ts +17 -0
- package/src/routes/api-key-management/api-key-management-edit/api-key-management-edit.tsx +34 -0
- package/src/routes/api-key-management/api-key-management-edit/components/edit-api-key-form/edit-api-key-form.tsx +87 -0
- package/src/routes/api-key-management/api-key-management-edit/components/edit-api-key-form/index.ts +1 -0
- package/src/routes/api-key-management/api-key-management-edit/index.ts +1 -0
- package/src/routes/api-key-management/api-key-management-list/api-key-management-list.tsx +25 -0
- package/src/routes/api-key-management/api-key-management-list/components/api-key-management-list-table/api-key-management-list-table.tsx +93 -0
- package/src/routes/api-key-management/api-key-management-list/components/api-key-management-list-table/api-key-row-actions.tsx +123 -0
- package/src/routes/api-key-management/api-key-management-list/components/api-key-management-list-table/index.ts +1 -0
- package/src/routes/api-key-management/api-key-management-list/components/api-key-management-list-table/use-api-key-management-table-columns.tsx +80 -0
- package/src/routes/api-key-management/api-key-management-list/components/api-key-management-list-table/use-api-key-management-table-filters.tsx +18 -0
- package/src/routes/api-key-management/api-key-management-list/components/api-key-management-list-table/use-api-key-management-table-query.tsx +34 -0
- package/src/routes/api-key-management/api-key-management-list/index.ts +1 -0
- package/src/routes/api-key-management/api-key-management-sales-channels/api-key-management-sales-channels.tsx +32 -0
- package/src/routes/api-key-management/api-key-management-sales-channels/components/api-key-sales-channels-form/api-key-sales-channels-form.tsx +202 -0
- package/src/routes/api-key-management/api-key-management-sales-channels/components/api-key-sales-channels-form/index.ts +1 -0
- package/src/routes/api-key-management/api-key-management-sales-channels/index.ts +1 -0
- package/src/routes/api-key-management/common/constants.ts +4 -0
- package/src/routes/api-key-management/common/utils.ts +62 -0
- package/src/routes/campaigns/add-campaign-promotions/add-campaign-promotions.tsx +19 -0
- package/src/routes/campaigns/add-campaign-promotions/components/add-campaign-promotions-form.tsx +260 -0
- package/src/routes/campaigns/add-campaign-promotions/components/index.ts +1 -0
- package/src/routes/campaigns/add-campaign-promotions/index.ts +1 -0
- package/src/routes/campaigns/campaign-budget-edit/campaign-budget-edit.tsx +29 -0
- package/src/routes/campaigns/campaign-budget-edit/components/edit-campaign-budget-form/edit-campaign-budget-form.tsx +138 -0
- package/src/routes/campaigns/campaign-budget-edit/components/edit-campaign-budget-form/index.ts +1 -0
- package/src/routes/campaigns/campaign-budget-edit/index.ts +1 -0
- package/src/routes/campaigns/campaign-configuration/campaign-configuration.tsx +33 -0
- package/src/routes/campaigns/campaign-configuration/components/campaign-configuration-form/campaign-configuration-form.tsx +134 -0
- package/src/routes/campaigns/campaign-configuration/components/campaign-configuration-form/index.ts +1 -0
- package/src/routes/campaigns/campaign-configuration/index.ts +1 -0
- package/src/routes/campaigns/campaign-create/campaign-create.tsx +10 -0
- package/src/routes/campaigns/campaign-create/components/create-campaign-form/create-campaign-form.tsx +113 -0
- package/src/routes/campaigns/campaign-create/components/create-campaign-form/index.ts +1 -0
- package/src/routes/campaigns/campaign-create/index.ts +1 -0
- package/src/routes/campaigns/campaign-detail/breadcrumb.tsx +29 -0
- package/src/routes/campaigns/campaign-detail/campaign-detail.tsx +69 -0
- package/src/routes/campaigns/campaign-detail/components/campaign-budget/campaign-budget.tsx +88 -0
- package/src/routes/campaigns/campaign-detail/components/campaign-budget/index.ts +1 -0
- package/src/routes/campaigns/campaign-detail/components/campaign-configuration-section/campaign-configuration-section.tsx +43 -0
- package/src/routes/campaigns/campaign-detail/components/campaign-configuration-section/index.ts +1 -0
- package/src/routes/campaigns/campaign-detail/components/campaign-general-section/campaign-general-section.tsx +137 -0
- package/src/routes/campaigns/campaign-detail/components/campaign-general-section/index.ts +1 -0
- package/src/routes/campaigns/campaign-detail/components/campaign-promotion-section/campaign-promotion-section.tsx +237 -0
- package/src/routes/campaigns/campaign-detail/components/campaign-promotion-section/index.ts +1 -0
- package/src/routes/campaigns/campaign-detail/components/campaign-spend/campaign-spend.tsx +61 -0
- package/src/routes/campaigns/campaign-detail/components/campaign-spend/index.ts +1 -0
- package/src/routes/campaigns/campaign-detail/constants.ts +1 -0
- package/src/routes/campaigns/campaign-detail/index.ts +3 -0
- package/src/routes/campaigns/campaign-detail/loader.ts +21 -0
- package/src/routes/campaigns/campaign-edit/campaign-edit.tsx +33 -0
- package/src/routes/campaigns/campaign-edit/components/edit-campaign-form/edit-campaign-form.tsx +194 -0
- package/src/routes/campaigns/campaign-edit/components/edit-campaign-form/index.ts +1 -0
- package/src/routes/campaigns/campaign-edit/index.ts +1 -0
- package/src/routes/campaigns/campaign-list/campaign-list.tsx +19 -0
- package/src/routes/campaigns/campaign-list/components/campaign-list-table.tsx +157 -0
- package/src/routes/campaigns/campaign-list/components/index.ts +1 -0
- package/src/routes/campaigns/campaign-list/index.ts +1 -0
- package/src/routes/campaigns/common/components/create-campaign-form-fields/create-campaign-form-fields.tsx +402 -0
- package/src/routes/campaigns/common/components/create-campaign-form-fields/index.ts +1 -0
- package/src/routes/campaigns/common/constants.ts +15 -0
- package/src/routes/campaigns/common/utils/campaign-status.ts +31 -0
- package/src/routes/categories/categories-metadata/categories-metadata.tsx +30 -0
- package/src/routes/categories/categories-metadata/index.ts +1 -0
- package/src/routes/categories/category-create/category-create.tsx +16 -0
- package/src/routes/categories/category-create/components/create-category-form/create-category-details.tsx +144 -0
- package/src/routes/categories/category-create/components/create-category-form/create-category-form.tsx +209 -0
- package/src/routes/categories/category-create/components/create-category-form/create-category-nesting.tsx +114 -0
- package/src/routes/categories/category-create/components/create-category-form/index.ts +1 -0
- package/src/routes/categories/category-create/components/create-category-form/schema.ts +17 -0
- package/src/routes/categories/category-create/index.ts +1 -0
- package/src/routes/categories/category-detail/breadcrumb.tsx +29 -0
- package/src/routes/categories/category-detail/category-detail.tsx +65 -0
- package/src/routes/categories/category-detail/components/category-general-section/category-general-section.tsx +93 -0
- package/src/routes/categories/category-detail/components/category-general-section/index.ts +1 -0
- package/src/routes/categories/category-detail/components/category-organize-section/category-organize-section.tsx +216 -0
- package/src/routes/categories/category-detail/components/category-organize-section/index.ts +1 -0
- package/src/routes/categories/category-detail/components/category-product-section/category-product-section.tsx +204 -0
- package/src/routes/categories/category-detail/components/category-product-section/index.ts +1 -0
- package/src/routes/categories/category-detail/index.ts +3 -0
- package/src/routes/categories/category-detail/loader.ts +17 -0
- package/src/routes/categories/category-edit/category-edit.tsx +36 -0
- package/src/routes/categories/category-edit/components/edit-category-form/edit-category-form.tsx +204 -0
- package/src/routes/categories/category-edit/components/edit-category-form/index.ts +1 -0
- package/src/routes/categories/category-edit/index.ts +1 -0
- package/src/routes/categories/category-list/category-list.tsx +19 -0
- package/src/routes/categories/category-list/components/category-list-table/category-list-table.tsx +169 -0
- package/src/routes/categories/category-list/components/category-list-table/index.ts +1 -0
- package/src/routes/categories/category-list/components/category-list-table/use-category-table-columns.tsx +116 -0
- package/src/routes/categories/category-list/components/category-list-table/use-category-table-query.tsx +23 -0
- package/src/routes/categories/category-list/index.ts +1 -0
- package/src/routes/categories/category-organize/category-organize.tsx +10 -0
- package/src/routes/categories/category-organize/components/organize-category-form/index.ts +1 -0
- package/src/routes/categories/category-organize/components/organize-category-form/organize-category-form.tsx +131 -0
- package/src/routes/categories/category-organize/index.ts +1 -0
- package/src/routes/categories/category-products/category-products.tsx +30 -0
- package/src/routes/categories/category-products/components/edit-category-products-form/edit-category-products-form.tsx +245 -0
- package/src/routes/categories/category-products/components/edit-category-products-form/index.ts +1 -0
- package/src/routes/categories/category-products/index.ts +1 -0
- package/src/routes/categories/common/components/category-tree/category-tree.tsx +55 -0
- package/src/routes/categories/common/components/category-tree/index.ts +1 -0
- package/src/routes/categories/common/hooks/use-delete-product-category-action.tsx +49 -0
- package/src/routes/categories/common/types.ts +7 -0
- package/src/routes/categories/common/utils.ts +157 -0
- package/src/routes/collections/collection-add-products/collection-add-products.tsx +22 -0
- package/src/routes/collections/collection-add-products/components/add-products-to-collection-form/add-products-to-collection-form.tsx +259 -0
- package/src/routes/collections/collection-add-products/components/add-products-to-collection-form/index.ts +1 -0
- package/src/routes/collections/collection-add-products/index.ts +1 -0
- package/src/routes/collections/collection-create/collection-create.tsx +10 -0
- package/src/routes/collections/collection-create/components/create-collection-form/create-collection-form.tsx +120 -0
- package/src/routes/collections/collection-create/components/create-collection-form/index.ts +1 -0
- package/src/routes/collections/collection-create/index.ts +1 -0
- package/src/routes/collections/collection-detail/breadcrumb.tsx +23 -0
- package/src/routes/collections/collection-detail/collection-detail.tsx +45 -0
- package/src/routes/collections/collection-detail/components/collection-general-section/collection-general-section.tsx +91 -0
- package/src/routes/collections/collection-detail/components/collection-general-section/index.ts +1 -0
- package/src/routes/collections/collection-detail/components/collection-product-section/collection-product-section.tsx +272 -0
- package/src/routes/collections/collection-detail/components/collection-product-section/index.ts +1 -0
- package/src/routes/collections/collection-detail/index.ts +3 -0
- package/src/routes/collections/collection-detail/loader.ts +17 -0
- package/src/routes/collections/collection-edit/collection-edit.tsx +27 -0
- package/src/routes/collections/collection-edit/components/edit-collection-form/edit-collection-form.tsx +110 -0
- package/src/routes/collections/collection-edit/components/edit-collection-form/index.ts +1 -0
- package/src/routes/collections/collection-edit/index.ts +1 -0
- package/src/routes/collections/collection-list/collection-list.tsx +18 -0
- package/src/routes/collections/collection-list/components/collection-list-table/collection-list-table.tsx +99 -0
- package/src/routes/collections/collection-list/components/collection-list-table/collection-row-actions.tsx +78 -0
- package/src/routes/collections/collection-list/components/collection-list-table/index.ts +1 -0
- package/src/routes/collections/collection-list/index.ts +1 -0
- package/src/routes/collections/collection-metadata/collection-metadata.tsx +26 -0
- package/src/routes/collections/collection-metadata/index.ts +1 -0
- package/src/routes/customer-groups/customer-group-add-customers/components/add-customers-form/add-customers-form.tsx +245 -0
- package/src/routes/customer-groups/customer-group-add-customers/components/add-customers-form/index.ts +1 -0
- package/src/routes/customer-groups/customer-group-add-customers/customer-group-add-customers.tsx +13 -0
- package/src/routes/customer-groups/customer-group-add-customers/index.ts +1 -0
- package/src/routes/customer-groups/customer-group-create/components/create-customer-group-form/create-customer-group-form.tsx +110 -0
- package/src/routes/customer-groups/customer-group-create/components/create-customer-group-form/index.ts +1 -0
- package/src/routes/customer-groups/customer-group-create/customer-group-create.tsx +10 -0
- package/src/routes/customer-groups/customer-group-create/index.ts +1 -0
- package/src/routes/customer-groups/customer-group-detail/breadcrumb.tsx +31 -0
- package/src/routes/customer-groups/customer-group-detail/components/customer-group-customer-section/customer-group-customer-section.tsx +243 -0
- package/src/routes/customer-groups/customer-group-detail/components/customer-group-customer-section/index.ts +1 -0
- package/src/routes/customer-groups/customer-group-detail/components/customer-group-general-section/customer-group-general-section.tsx +90 -0
- package/src/routes/customer-groups/customer-group-detail/components/customer-group-general-section/index.ts +1 -0
- package/src/routes/customer-groups/customer-group-detail/constants.ts +1 -0
- package/src/routes/customer-groups/customer-group-detail/customer-group-detail.tsx +51 -0
- package/src/routes/customer-groups/customer-group-detail/index.ts +3 -0
- package/src/routes/customer-groups/customer-group-detail/loader.ts +20 -0
- package/src/routes/customer-groups/customer-group-edit/components/edit-customer-group-form/edit-customer-group-form.tsx +90 -0
- package/src/routes/customer-groups/customer-group-edit/components/edit-customer-group-form/index.ts +1 -0
- package/src/routes/customer-groups/customer-group-edit/customer-group-edit.tsx +28 -0
- package/src/routes/customer-groups/customer-group-edit/index.ts +1 -0
- package/src/routes/customer-groups/customer-group-list/components/customer-group-list-table/customer-group-list-table.tsx +223 -0
- package/src/routes/customer-groups/customer-group-list/components/customer-group-list-table/index.ts +1 -0
- package/src/routes/customer-groups/customer-group-list/customer-group-list.tsx +18 -0
- package/src/routes/customer-groups/customer-group-list/index.ts +1 -0
- package/src/routes/customer-groups/customer-group-metadata/customer-metadata.tsx +26 -0
- package/src/routes/customer-groups/customer-group-metadata/index.ts +1 -0
- package/src/routes/customers/customer-create/components/create-customer-form/create-customer-form.tsx +179 -0
- package/src/routes/customers/customer-create/components/create-customer-form/index.ts +1 -0
- package/src/routes/customers/customer-create/customer-create.tsx +10 -0
- package/src/routes/customers/customer-create/index.ts +1 -0
- package/src/routes/customers/customer-create-address/components/create-customer-address-form/create-customer-address-form.tsx +282 -0
- package/src/routes/customers/customer-create-address/components/create-customer-address-form/index.ts +1 -0
- package/src/routes/customers/customer-create-address/customer-create-address.tsx +10 -0
- package/src/routes/customers/customer-create-address/index.ts +1 -0
- package/src/routes/customers/customer-detail/breadcrumb.tsx +29 -0
- package/src/routes/customers/customer-detail/components/customer-address-section/customer-address-section.tsx +104 -0
- package/src/routes/customers/customer-detail/components/customer-address-section/index.ts +1 -0
- package/src/routes/customers/customer-detail/components/customer-general-section/customer-general-section.tsx +127 -0
- package/src/routes/customers/customer-detail/components/customer-general-section/index.ts +1 -0
- package/src/routes/customers/customer-detail/components/customer-group-section/customer-group-section.tsx +269 -0
- package/src/routes/customers/customer-detail/components/customer-group-section/index.ts +1 -0
- package/src/routes/customers/customer-detail/components/customer-order-section/customer-order-section.tsx +130 -0
- package/src/routes/customers/customer-detail/components/customer-order-section/index.ts +1 -0
- package/src/routes/customers/customer-detail/customer-detail.tsx +58 -0
- package/src/routes/customers/customer-detail/index.ts +3 -0
- package/src/routes/customers/customer-detail/loader.ts +19 -0
- package/src/routes/customers/customer-edit/components/edit-customer-form/edit-customer-form.tsx +178 -0
- package/src/routes/customers/customer-edit/components/edit-customer-form/index.ts +1 -0
- package/src/routes/customers/customer-edit/customer-edit.tsx +26 -0
- package/src/routes/customers/customer-edit/index.ts +1 -0
- package/src/routes/customers/customer-list/components/customer-list-table/customer-list-table.tsx +124 -0
- package/src/routes/customers/customer-list/components/customer-list-table/index.ts +1 -0
- package/src/routes/customers/customer-list/customer-list.tsx +18 -0
- package/src/routes/customers/customer-list/index.ts +1 -0
- package/src/routes/customers/customer-metadata/customer-metadata.tsx +23 -0
- package/src/routes/customers/customer-metadata/index.ts +1 -0
- package/src/routes/customers/customers-add-customer-group/components/add-customers-form/add-customer-groups-form.tsx +257 -0
- package/src/routes/customers/customers-add-customer-group/components/add-customers-form/index.ts +1 -0
- package/src/routes/customers/customers-add-customer-group/customer-add-customer-groups.tsx +13 -0
- package/src/routes/customers/customers-add-customer-group/index.ts +1 -0
- package/src/routes/home/home.tsx +12 -0
- package/src/routes/home/index.ts +1 -0
- package/src/routes/inventory/common/constants.ts +1 -0
- package/src/routes/inventory/inventory-create/components/inventory-create-form/index.ts +1 -0
- package/src/routes/inventory/inventory-create/components/inventory-create-form/inventory-availability-form.tsx +78 -0
- package/src/routes/inventory/inventory-create/components/inventory-create-form/inventory-create-form.tsx +517 -0
- package/src/routes/inventory/inventory-create/components/inventory-create-form/schema.ts +23 -0
- package/src/routes/inventory/inventory-create/index.ts +1 -0
- package/src/routes/inventory/inventory-create/inventory-create.tsx +21 -0
- package/src/routes/inventory/inventory-detail/breadcrumb.tsx +31 -0
- package/src/routes/inventory/inventory-detail/components/adjust-inventory/adjust-inventory-drawer.tsx +55 -0
- package/src/routes/inventory/inventory-detail/components/adjust-inventory/components/adjust-inventory-form.tsx +178 -0
- package/src/routes/inventory/inventory-detail/components/adjust-inventory/index.ts +1 -0
- package/src/routes/inventory/inventory-detail/components/edit-inventory-item/components/edit-item-form.tsx +105 -0
- package/src/routes/inventory/inventory-detail/components/edit-inventory-item/edit-item-drawer.tsx +33 -0
- package/src/routes/inventory/inventory-detail/components/edit-inventory-item/index.ts +1 -0
- package/src/routes/inventory/inventory-detail/components/edit-inventory-item-attributes/components/edit-item-attributes-form.tsx +270 -0
- package/src/routes/inventory/inventory-detail/components/edit-inventory-item-attributes/edit-item-attributes-drawer.tsx +33 -0
- package/src/routes/inventory/inventory-detail/components/edit-inventory-item-attributes/index.ts +1 -0
- package/src/routes/inventory/inventory-detail/components/inventory-item-attributes/attributes-section.tsx +50 -0
- package/src/routes/inventory/inventory-detail/components/inventory-item-general-section.tsx +65 -0
- package/src/routes/inventory/inventory-detail/components/inventory-item-location-levels.tsx +26 -0
- package/src/routes/inventory/inventory-detail/components/inventory-item-reservations.tsx +28 -0
- package/src/routes/inventory/inventory-detail/components/inventory-item-variants/variants-section.tsx +72 -0
- package/src/routes/inventory/inventory-detail/components/location-levels-table/location-list-table.tsx +49 -0
- package/src/routes/inventory/inventory-detail/components/location-levels-table/use-location-list-table-columns.tsx +170 -0
- package/src/routes/inventory/inventory-detail/components/location-levels-table/use-location-list-table-query.tsx +32 -0
- package/src/routes/inventory/inventory-detail/components/manage-locations/components/location-item.tsx +51 -0
- package/src/routes/inventory/inventory-detail/components/manage-locations/components/location-search-input.tsx +34 -0
- package/src/routes/inventory/inventory-detail/components/manage-locations/components/manage-locations-form.tsx +183 -0
- package/src/routes/inventory/inventory-detail/components/manage-locations/index.ts +1 -0
- package/src/routes/inventory/inventory-detail/components/manage-locations/manage-locations-drawer.tsx +40 -0
- package/src/routes/inventory/inventory-detail/components/reservations-table/reservation-actions.tsx +64 -0
- package/src/routes/inventory/inventory-detail/components/reservations-table/reservation-list-table.tsx +70 -0
- package/src/routes/inventory/inventory-detail/components/reservations-table/use-reservation-list-table-columns.tsx +93 -0
- package/src/routes/inventory/inventory-detail/components/reservations-table/use-reservation-list-table-query.tsx +35 -0
- package/src/routes/inventory/inventory-detail/constants.ts +2 -0
- package/src/routes/inventory/inventory-detail/index.ts +3 -0
- package/src/routes/inventory/inventory-detail/inventory-detail.tsx +80 -0
- package/src/routes/inventory/inventory-detail/loader.ts +21 -0
- package/src/routes/inventory/inventory-list/components/inventory-actions.tsx +53 -0
- package/src/routes/inventory/inventory-list/components/inventory-list-table.tsx +105 -0
- package/src/routes/inventory/inventory-list/components/use-inventory-table-columns.tsx +125 -0
- package/src/routes/inventory/inventory-list/components/use-inventory-table-filters.tsx +82 -0
- package/src/routes/inventory/inventory-list/components/use-inventory-table-query.tsx +70 -0
- package/src/routes/inventory/inventory-list/index.ts +1 -0
- package/src/routes/inventory/inventory-list/inventory-list.tsx +18 -0
- package/src/routes/inventory/inventory-metadata/index.ts +1 -0
- package/src/routes/inventory/inventory-metadata/inventory-metadata.tsx +27 -0
- package/src/routes/inventory/inventory-stock/components/inventory-stock-form/index.ts +1 -0
- package/src/routes/inventory/inventory-stock/components/inventory-stock-form/inventory-stock-form.tsx +163 -0
- package/src/routes/inventory/inventory-stock/hooks/use-inventory-stock-columns.tsx +76 -0
- package/src/routes/inventory/inventory-stock/index.ts +1 -0
- package/src/routes/inventory/inventory-stock/inventory-stock.tsx +58 -0
- package/src/routes/inventory/inventory-stock/schema.ts +22 -0
- package/src/routes/invite/index.ts +1 -0
- package/src/routes/invite/invite.tsx +416 -0
- package/src/routes/locations/common/components/conditional-price-form/conditional-price-form.tsx +713 -0
- package/src/routes/locations/common/components/conditional-price-form/index.ts +1 -0
- package/src/routes/locations/common/components/geo-zone-form/geo-zone-form.tsx +327 -0
- package/src/routes/locations/common/components/geo-zone-form/index.ts +1 -0
- package/src/routes/locations/common/components/shipping-option-price-cell/index.ts +1 -0
- package/src/routes/locations/common/components/shipping-option-price-cell/shipping-option-price-cell.tsx +261 -0
- package/src/routes/locations/common/components/shipping-option-price-provider/index.ts +2 -0
- package/src/routes/locations/common/components/shipping-option-price-provider/shipping-option-price-context.tsx +10 -0
- package/src/routes/locations/common/components/shipping-option-price-provider/shipping-option-price-provider.tsx +23 -0
- package/src/routes/locations/common/components/shipping-option-price-provider/use-shipping-option-price.tsx +14 -0
- package/src/routes/locations/common/constants.ts +16 -0
- package/src/routes/locations/common/hooks/use-shipping-option-price-columns.tsx +174 -0
- package/src/routes/locations/common/schema.ts +192 -0
- package/src/routes/locations/common/types.ts +12 -0
- package/src/routes/locations/common/utils/get-custom-shipping-option-price-field-info.ts +19 -0
- package/src/routes/locations/common/utils/price-rule-helpers.ts +41 -0
- package/src/routes/locations/location-create/components/create-location-form/create-location-form.tsx +248 -0
- package/src/routes/locations/location-create/components/create-location-form/index.ts +1 -0
- package/src/routes/locations/location-create/index.ts +1 -0
- package/src/routes/locations/location-create/location-create.tsx +10 -0
- package/src/routes/locations/location-detail/breadcrumb.tsx +31 -0
- package/src/routes/locations/location-detail/components/location-fulfillment-providers-section/index.ts +1 -0
- package/src/routes/locations/location-detail/components/location-fulfillment-providers-section/location-fulfillment-providers-section.tsx +81 -0
- package/src/routes/locations/location-detail/components/location-general-section/index.ts +1 -0
- package/src/routes/locations/location-detail/components/location-general-section/location-general-section.tsx +661 -0
- package/src/routes/locations/location-detail/components/location-sales-channels-section/index.ts +1 -0
- package/src/routes/locations/location-detail/components/location-sales-channels-section/locations-sales-channels-section.tsx +76 -0
- package/src/routes/locations/location-detail/constants.ts +2 -0
- package/src/routes/locations/location-detail/index.ts +3 -0
- package/src/routes/locations/location-detail/loader.ts +23 -0
- package/src/routes/locations/location-detail/location-detail.tsx +64 -0
- package/src/routes/locations/location-edit/components/edit-location-form/edit-location-form.tsx +234 -0
- package/src/routes/locations/location-edit/components/edit-location-form/index.ts +1 -0
- package/src/routes/locations/location-edit/index.ts +1 -0
- package/src/routes/locations/location-edit/location-edit.tsx +33 -0
- package/src/routes/locations/location-fulfillment-providers/components/edit-fulfillment-providers-form/edit-fulfillment-providers-form.tsx +207 -0
- package/src/routes/locations/location-fulfillment-providers/components/edit-fulfillment-providers-form/index.ts +1 -0
- package/src/routes/locations/location-fulfillment-providers/index.ts +1 -0
- package/src/routes/locations/location-fulfillment-providers/location-fulfillment-providers.tsx +27 -0
- package/src/routes/locations/location-list/components/location-list-item/index.ts +1 -0
- package/src/routes/locations/location-list/components/location-list-item/location-list-item.tsx +186 -0
- package/src/routes/locations/location-list/constants.ts +3 -0
- package/src/routes/locations/location-list/index.ts +1 -0
- package/src/routes/locations/location-list/location-list.tsx +128 -0
- package/src/routes/locations/location-list/use-location-list-table-columns.tsx +185 -0
- package/src/routes/locations/location-list/use-location-list-table-query.tsx +22 -0
- package/src/routes/locations/location-sales-channels/components/edit-sales-channels-form/edit-sales-channels-form.tsx +177 -0
- package/src/routes/locations/location-sales-channels/components/edit-sales-channels-form/index.ts +1 -0
- package/src/routes/locations/location-sales-channels/index.ts +1 -0
- package/src/routes/locations/location-sales-channels/location-sales-channels.tsx +27 -0
- package/src/routes/locations/location-service-zone-create/components/create-service-zone-form/create-service-zone-form.tsx +146 -0
- package/src/routes/locations/location-service-zone-create/components/create-service-zone-form/index.ts +1 -0
- package/src/routes/locations/location-service-zone-create/index.ts +1 -0
- package/src/routes/locations/location-service-zone-create/location-service-zone-create.tsx +47 -0
- package/src/routes/locations/location-service-zone-edit/components/edit-region-form/edit-service-zone-form.tsx +105 -0
- package/src/routes/locations/location-service-zone-edit/components/edit-region-form/index.ts +1 -0
- package/src/routes/locations/location-service-zone-edit/index.ts +1 -0
- package/src/routes/locations/location-service-zone-edit/location-service-zone-edit.tsx +47 -0
- package/src/routes/locations/location-service-zone-manage-areas/components/edit-region-areas-form/edit-service-zone-areas-form.tsx +120 -0
- package/src/routes/locations/location-service-zone-manage-areas/components/edit-region-areas-form/index.ts +1 -0
- package/src/routes/locations/location-service-zone-manage-areas/index.ts +1 -0
- package/src/routes/locations/location-service-zone-manage-areas/location-service-zone-manage-areas.tsx +41 -0
- package/src/routes/locations/location-service-zone-shipping-option-create/components/create-shipping-options-form/create-shipping-option-details-form.tsx +297 -0
- package/src/routes/locations/location-service-zone-shipping-option-create/components/create-shipping-options-form/create-shipping-options-form.tsx +359 -0
- package/src/routes/locations/location-service-zone-shipping-option-create/components/create-shipping-options-form/create-shipping-options-prices-form.tsx +145 -0
- package/src/routes/locations/location-service-zone-shipping-option-create/components/create-shipping-options-form/index.ts +1 -0
- package/src/routes/locations/location-service-zone-shipping-option-create/components/create-shipping-options-form/schema.ts +44 -0
- package/src/routes/locations/location-service-zone-shipping-option-create/constants.ts +2 -0
- package/src/routes/locations/location-service-zone-shipping-option-create/index.ts +1 -0
- package/src/routes/locations/location-service-zone-shipping-option-create/location-service-zone-shipping-option-create.tsx +55 -0
- package/src/routes/locations/location-service-zone-shipping-option-edit/components/edit-region-form/edit-shipping-option-form.tsx +314 -0
- package/src/routes/locations/location-service-zone-shipping-option-edit/components/edit-region-form/index.ts +1 -0
- package/src/routes/locations/location-service-zone-shipping-option-edit/index.ts +1 -0
- package/src/routes/locations/location-service-zone-shipping-option-edit/location-service-zone-shipping-option-edit.tsx +59 -0
- package/src/routes/locations/location-service-zone-shipping-option-pricing/components/create-shipping-options-form/edit-shipping-options-pricing-form.tsx +384 -0
- package/src/routes/locations/location-service-zone-shipping-option-pricing/components/create-shipping-options-form/index.ts +1 -0
- package/src/routes/locations/location-service-zone-shipping-option-pricing/index.ts +1 -0
- package/src/routes/locations/location-service-zone-shipping-option-pricing/location-service-zone-shipping-option-pricing.tsx +36 -0
- package/src/routes/login/components/cloud-auth-login.tsx +166 -0
- package/src/routes/login/index.ts +1 -0
- package/src/routes/login/login.tsx +175 -0
- package/src/routes/no-match/index.ts +1 -0
- package/src/routes/no-match/no-match.tsx +36 -0
- package/src/routes/orders/common/placeholders.tsx +48 -0
- package/src/routes/orders/order-allocate-items/components/order-create-fulfillment-form/constants.ts +6 -0
- package/src/routes/orders/order-allocate-items/components/order-create-fulfillment-form/index.ts +1 -0
- package/src/routes/orders/order-allocate-items/components/order-create-fulfillment-form/order-allocate-items-form.tsx +349 -0
- package/src/routes/orders/order-allocate-items/components/order-create-fulfillment-form/order-allocate-items-item.tsx +346 -0
- package/src/routes/orders/order-allocate-items/components/order-create-fulfillment-form/utils.ts +28 -0
- package/src/routes/orders/order-allocate-items/index.ts +1 -0
- package/src/routes/orders/order-allocate-items/order-allocate-items.tsx +26 -0
- package/src/routes/orders/order-balance-settlement/components/order-balance-settlement-form/index.ts +1 -0
- package/src/routes/orders/order-balance-settlement/components/order-balance-settlement-form/order-balance-settlement-form.tsx +396 -0
- package/src/routes/orders/order-balance-settlement/index.ts +1 -0
- package/src/routes/orders/order-create-claim/claim-create.tsx +84 -0
- package/src/routes/orders/order-create-claim/components/add-claim-items-table/add-claim-items-table.tsx +283 -0
- package/src/routes/orders/order-create-claim/components/add-claim-items-table/index.ts +1 -0
- package/src/routes/orders/order-create-claim/components/add-claim-items-table/use-claim-item-table-columns.tsx +103 -0
- package/src/routes/orders/order-create-claim/components/add-claim-items-table/use-claim-item-table-filters.tsx +32 -0
- package/src/routes/orders/order-create-claim/components/add-claim-items-table/use-claim-item-table-query.tsx +61 -0
- package/src/routes/orders/order-create-claim/components/add-claim-outbound-items-table/add-claim-outbound-items-table.tsx +94 -0
- package/src/routes/orders/order-create-claim/components/add-claim-outbound-items-table/index.ts +1 -0
- package/src/routes/orders/order-create-claim/components/add-claim-outbound-items-table/use-claim-outbound-item-table-columns.tsx +68 -0
- package/src/routes/orders/order-create-claim/components/add-claim-outbound-items-table/use-claim-outbound-item-table-filters.tsx +22 -0
- package/src/routes/orders/order-create-claim/components/add-claim-outbound-items-table/use-claim-outbound-item-table-query.tsx +40 -0
- package/src/routes/orders/order-create-claim/components/claim-create-form/claim-create-form.tsx +1092 -0
- package/src/routes/orders/order-create-claim/components/claim-create-form/claim-inbound-item.tsx +244 -0
- package/src/routes/orders/order-create-claim/components/claim-create-form/claim-outbound-item.tsx +121 -0
- package/src/routes/orders/order-create-claim/components/claim-create-form/claim-outbound-section.tsx +442 -0
- package/src/routes/orders/order-create-claim/components/claim-create-form/index.ts +1 -0
- package/src/routes/orders/order-create-claim/components/claim-create-form/item-placeholder.tsx +11 -0
- package/src/routes/orders/order-create-claim/components/claim-create-form/schema.ts +24 -0
- package/src/routes/orders/order-create-claim/index.ts +1 -0
- package/src/routes/orders/order-create-edit/components/add-order-edit-items-table/add-order-edit-items-table.tsx +87 -0
- package/src/routes/orders/order-create-edit/components/add-order-edit-items-table/index.ts +1 -0
- package/src/routes/orders/order-create-edit/components/add-order-edit-items-table/use-order-edit-item-table-columns.tsx +68 -0
- package/src/routes/orders/order-create-edit/components/add-order-edit-items-table/use-order-edit-item-table-filters.tsx +22 -0
- package/src/routes/orders/order-create-edit/components/add-order-edit-items-table/use-order-edit-item-table-query.tsx +26 -0
- package/src/routes/orders/order-create-edit/components/order-edit-create-form/index.ts +1 -0
- package/src/routes/orders/order-create-edit/components/order-edit-create-form/order-edit-create-form.tsx +231 -0
- package/src/routes/orders/order-create-edit/components/order-edit-create-form/order-edit-item.tsx +257 -0
- package/src/routes/orders/order-create-edit/components/order-edit-create-form/order-edit-items-section.tsx +145 -0
- package/src/routes/orders/order-create-edit/components/order-edit-create-form/schema.ts +8 -0
- package/src/routes/orders/order-create-edit/index.ts +1 -0
- package/src/routes/orders/order-create-edit/order-edit-create.tsx +65 -0
- package/src/routes/orders/order-create-exchange/components/add-exchange-inbound-items-table/add-exchange-inbound-items-table.tsx +193 -0
- package/src/routes/orders/order-create-exchange/components/add-exchange-inbound-items-table/index.ts +1 -0
- package/src/routes/orders/order-create-exchange/components/add-exchange-inbound-items-table/use-exchange-item-table-columns.tsx +103 -0
- package/src/routes/orders/order-create-exchange/components/add-exchange-inbound-items-table/use-exchange-item-table-filters.tsx +22 -0
- package/src/routes/orders/order-create-exchange/components/add-exchange-inbound-items-table/use-exchange-item-table-query.tsx +26 -0
- package/src/routes/orders/order-create-exchange/components/add-exchange-outbound-items-table/add-exchange-outbound-items-table.tsx +94 -0
- package/src/routes/orders/order-create-exchange/components/add-exchange-outbound-items-table/index.ts +1 -0
- package/src/routes/orders/order-create-exchange/components/add-exchange-outbound-items-table/use-exchange-outbound-item-table-columns.tsx +68 -0
- package/src/routes/orders/order-create-exchange/components/add-exchange-outbound-items-table/use-exchange-outbound-item-table-filters.tsx +22 -0
- package/src/routes/orders/order-create-exchange/components/add-exchange-outbound-items-table/use-exchange-outbound-item-table-query.tsx +26 -0
- package/src/routes/orders/order-create-exchange/components/exchange-create-form/exchange-create-form.tsx +652 -0
- package/src/routes/orders/order-create-exchange/components/exchange-create-form/exchange-inbound-item.tsx +269 -0
- package/src/routes/orders/order-create-exchange/components/exchange-create-form/exchange-inbound-section.tsx +546 -0
- package/src/routes/orders/order-create-exchange/components/exchange-create-form/exchange-outbound-item.tsx +140 -0
- package/src/routes/orders/order-create-exchange/components/exchange-create-form/exchange-outbound-section.tsx +450 -0
- package/src/routes/orders/order-create-exchange/components/exchange-create-form/index.ts +1 -0
- package/src/routes/orders/order-create-exchange/components/exchange-create-form/schema.ts +25 -0
- package/src/routes/orders/order-create-exchange/exchange-create.tsx +84 -0
- package/src/routes/orders/order-create-exchange/index.ts +1 -0
- package/src/routes/orders/order-create-fulfillment/components/order-create-fulfillment-form/constants.ts +8 -0
- package/src/routes/orders/order-create-fulfillment/components/order-create-fulfillment-form/index.ts +1 -0
- package/src/routes/orders/order-create-fulfillment/components/order-create-fulfillment-form/order-create-fulfillment-form.tsx +437 -0
- package/src/routes/orders/order-create-fulfillment/components/order-create-fulfillment-form/order-create-fulfillment-item.tsx +250 -0
- package/src/routes/orders/order-create-fulfillment/index.ts +1 -0
- package/src/routes/orders/order-create-fulfillment/order-create-fulfillments.tsx +33 -0
- package/src/routes/orders/order-create-refund/components/create-refund-form/create-refund-form.tsx +306 -0
- package/src/routes/orders/order-create-refund/components/create-refund-form/index.ts +1 -0
- package/src/routes/orders/order-create-refund/index.ts +1 -0
- package/src/routes/orders/order-create-refund/order-create-refund.tsx +31 -0
- package/src/routes/orders/order-create-return/components/add-return-items-table/add-return-items-table.tsx +284 -0
- package/src/routes/orders/order-create-return/components/add-return-items-table/index.ts +1 -0
- package/src/routes/orders/order-create-return/components/add-return-items-table/use-return-item-table-columns.tsx +103 -0
- package/src/routes/orders/order-create-return/components/add-return-items-table/use-return-item-table-filters.tsx +32 -0
- package/src/routes/orders/order-create-return/components/add-return-items-table/use-return-item-table-query.tsx +61 -0
- package/src/routes/orders/order-create-return/components/return-create-form/index.ts +1 -0
- package/src/routes/orders/order-create-return/components/return-create-form/return-create-form.tsx +785 -0
- package/src/routes/orders/order-create-return/components/return-create-form/return-item.tsx +246 -0
- package/src/routes/orders/order-create-return/components/return-create-form/schema.ts +19 -0
- package/src/routes/orders/order-create-return/index.ts +1 -0
- package/src/routes/orders/order-create-return/return-create.tsx +80 -0
- package/src/routes/orders/order-create-shipment/components/order-create-shipment-form/constants.ts +13 -0
- package/src/routes/orders/order-create-shipment/components/order-create-shipment-form/index.ts +1 -0
- package/src/routes/orders/order-create-shipment/components/order-create-shipment-form/order-create-shipment-form.tsx +234 -0
- package/src/routes/orders/order-create-shipment/index.ts +1 -0
- package/src/routes/orders/order-create-shipment/order-create-shipment.tsx +30 -0
- package/src/routes/orders/order-detail/breadcrumb.tsx +27 -0
- package/src/routes/orders/order-detail/components/active-order-claim-section/active-order-claim-section.tsx +79 -0
- package/src/routes/orders/order-detail/components/active-order-claim-section/index.ts +1 -0
- package/src/routes/orders/order-detail/components/active-order-exchange-section/active-order-exchange-section.tsx +83 -0
- package/src/routes/orders/order-detail/components/active-order-exchange-section/index.ts +1 -0
- package/src/routes/orders/order-detail/components/active-order-return-section/active-order-return-section.tsx +82 -0
- package/src/routes/orders/order-detail/components/active-order-return-section/index.ts +1 -0
- package/src/routes/orders/order-detail/components/copy-payment-link/copy-payment-link.tsx +80 -0
- package/src/routes/orders/order-detail/components/copy-payment-link/index.ts +1 -0
- package/src/routes/orders/order-detail/components/order-active-edit-section/index.ts +1 -0
- package/src/routes/orders/order-detail/components/order-active-edit-section/order-active-edit-section.tsx +199 -0
- package/src/routes/orders/order-detail/components/order-activity-section/activity-items.tsx +125 -0
- package/src/routes/orders/order-detail/components/order-activity-section/change-details-tooltip.tsx +74 -0
- package/src/routes/orders/order-detail/components/order-activity-section/index.ts +1 -0
- package/src/routes/orders/order-detail/components/order-activity-section/order-activity-section.tsx +25 -0
- package/src/routes/orders/order-detail/components/order-activity-section/order-note-form.tsx +112 -0
- package/src/routes/orders/order-detail/components/order-activity-section/order-timeline.tsx +1121 -0
- package/src/routes/orders/order-detail/components/order-customer-section/index.ts +1 -0
- package/src/routes/orders/order-detail/components/order-customer-section/order-customer-section.tsx +68 -0
- package/src/routes/orders/order-detail/components/order-fulfillment-section/index.ts +1 -0
- package/src/routes/orders/order-detail/components/order-fulfillment-section/order-fulfillment-section.tsx +489 -0
- package/src/routes/orders/order-detail/components/order-general-section/index.ts +1 -0
- package/src/routes/orders/order-detail/components/order-general-section/order-general-section.tsx +136 -0
- package/src/routes/orders/order-detail/components/order-payment-section/index.ts +1 -0
- package/src/routes/orders/order-detail/components/order-payment-section/order-payment-section.tsx +465 -0
- package/src/routes/orders/order-detail/components/order-summary-section/index.ts +1 -0
- package/src/routes/orders/order-detail/components/order-summary-section/order-summary-section.tsx +1270 -0
- package/src/routes/orders/order-detail/components/order-summary-section/return-info-popover.tsx +90 -0
- package/src/routes/orders/order-detail/components/order-summary-section/shipping-info-popover.tsx +48 -0
- package/src/routes/orders/order-detail/constants.ts +64 -0
- package/src/routes/orders/order-detail/index.ts +3 -0
- package/src/routes/orders/order-detail/loader.ts +21 -0
- package/src/routes/orders/order-detail/order-detail.tsx +96 -0
- package/src/routes/orders/order-edit-billing-address/components/edit-order-billing-address-form/edit-order-billing-address-form.tsx +250 -0
- package/src/routes/orders/order-edit-billing-address/components/edit-order-billing-address-form/index.ts +1 -0
- package/src/routes/orders/order-edit-billing-address/index.ts +1 -0
- package/src/routes/orders/order-edit-billing-address/order-edit-billing-address.tsx +31 -0
- package/src/routes/orders/order-edit-email/components/edit-order-email-form/edit-order-email-form.tsx +95 -0
- package/src/routes/orders/order-edit-email/components/edit-order-email-form/index.ts +1 -0
- package/src/routes/orders/order-edit-email/index.ts +1 -0
- package/src/routes/orders/order-edit-email/order-edit-email.tsx +31 -0
- package/src/routes/orders/order-edit-shipping-address/components/edit-order-shipping-address-form/edit-order-shipping-address-form.tsx +247 -0
- package/src/routes/orders/order-edit-shipping-address/components/edit-order-shipping-address-form/index.ts +1 -0
- package/src/routes/orders/order-edit-shipping-address/index.ts +1 -0
- package/src/routes/orders/order-edit-shipping-address/order-edit-shipping-address.tsx +31 -0
- package/src/routes/orders/order-export/components/export-filters.tsx +22 -0
- package/src/routes/orders/order-export/index.ts +1 -0
- package/src/routes/orders/order-export/order-export.tsx +66 -0
- package/src/routes/orders/order-list/components/order-list-table/components/save-view-dropdown.tsx +81 -0
- package/src/routes/orders/order-list/components/order-list-table/configurable-order-list-table.tsx +24 -0
- package/src/routes/orders/order-list/components/order-list-table/constants.ts +14 -0
- package/src/routes/orders/order-list/components/order-list-table/hooks/use-order-data-table-columns.tsx +153 -0
- package/src/routes/orders/order-list/components/order-list-table/index.ts +1 -0
- package/src/routes/orders/order-list/components/order-list-table/order-list-table.tsx +89 -0
- package/src/routes/orders/order-list/components/order-list-table/order-table-adapter.tsx +133 -0
- package/src/routes/orders/order-list/const.ts +18 -0
- package/src/routes/orders/order-list/index.ts +1 -0
- package/src/routes/orders/order-list/order-list.tsx +20 -0
- package/src/routes/orders/order-metadata/index.ts +1 -0
- package/src/routes/orders/order-metadata/order-metadata.tsx +26 -0
- package/src/routes/orders/order-receive-return/components/order-receive-return-form/constants.ts +12 -0
- package/src/routes/orders/order-receive-return/components/order-receive-return-form/dismissed-quantity.tsx +167 -0
- package/src/routes/orders/order-receive-return/components/order-receive-return-form/index.ts +1 -0
- package/src/routes/orders/order-receive-return/components/order-receive-return-form/order-receive-return-form.tsx +386 -0
- package/src/routes/orders/order-receive-return/index.ts +1 -0
- package/src/routes/orders/order-receive-return/order-receive-return.tsx +96 -0
- package/src/routes/orders/order-request-transfer/components/create-order-transfer-form/create-order-transfer-form.tsx +152 -0
- package/src/routes/orders/order-request-transfer/components/create-order-transfer-form/index.ts +1 -0
- package/src/routes/orders/order-request-transfer/components/create-order-transfer-form/transfer-header.tsx +299 -0
- package/src/routes/orders/order-request-transfer/index.ts +1 -0
- package/src/routes/orders/order-request-transfer/order-request-transfer.tsx +34 -0
- package/src/routes/price-lists/common/components/price-list-customer-group-rule-form/index.ts +1 -0
- package/src/routes/price-lists/common/components/price-list-customer-group-rule-form/price-list-customer-group-rule-form.tsx +194 -0
- package/src/routes/price-lists/common/constants.ts +20 -0
- package/src/routes/price-lists/common/hooks/use-delete-price-list-action.tsx +50 -0
- package/src/routes/price-lists/common/hooks/use-price-list-currency-data.tsx +79 -0
- package/src/routes/price-lists/common/hooks/use-price-list-grid-columns.tsx +91 -0
- package/src/routes/price-lists/common/schemas.ts +96 -0
- package/src/routes/price-lists/common/utils.ts +123 -0
- package/src/routes/price-lists/price-list-configuration/components/price-list-configuration-form/index.ts +1 -0
- package/src/routes/price-lists/price-list-configuration/components/price-list-configuration-form/price-list-configuration-form.tsx +311 -0
- package/src/routes/price-lists/price-list-configuration/index.ts +1 -0
- package/src/routes/price-lists/price-list-configuration/price-list-configuration.tsx +68 -0
- package/src/routes/price-lists/price-list-create/components/price-list-create-form/index.ts +1 -0
- package/src/routes/price-lists/price-list-create/components/price-list-create-form/price-list-create-form.tsx +364 -0
- package/src/routes/price-lists/price-list-create/components/price-list-create-form/price-list-details-form.tsx +331 -0
- package/src/routes/price-lists/price-list-create/components/price-list-create-form/price-list-prices-form.tsx +96 -0
- package/src/routes/price-lists/price-list-create/components/price-list-create-form/price-list-products-form.tsx +187 -0
- package/src/routes/price-lists/price-list-create/components/price-list-create-form/schema.ts +59 -0
- package/src/routes/price-lists/price-list-create/index.ts +1 -0
- package/src/routes/price-lists/price-list-create/price-list-create.tsx +20 -0
- package/src/routes/price-lists/price-list-detail/breadcrumb.tsx +23 -0
- package/src/routes/price-lists/price-list-detail/components/price-list-configuration-section/index.ts +1 -0
- package/src/routes/price-lists/price-list-detail/components/price-list-configuration-section/price-list-configuration-section.tsx +96 -0
- package/src/routes/price-lists/price-list-detail/components/price-list-general-section/index.ts +1 -0
- package/src/routes/price-lists/price-list-detail/components/price-list-general-section/price-list-general-section.tsx +94 -0
- package/src/routes/price-lists/price-list-detail/components/price-list-product-section/index.ts +1 -0
- package/src/routes/price-lists/price-list-detail/components/price-list-product-section/price-list-product-section.tsx +285 -0
- package/src/routes/price-lists/price-list-detail/index.ts +3 -0
- package/src/routes/price-lists/price-list-detail/loader.ts +16 -0
- package/src/routes/price-lists/price-list-detail/price-list-detail.tsx +48 -0
- package/src/routes/price-lists/price-list-edit/components/price-list-edit-form/edit-price-list-form.tsx +193 -0
- package/src/routes/price-lists/price-list-edit/components/price-list-edit-form/index.ts +1 -0
- package/src/routes/price-lists/price-list-edit/index.ts +1 -0
- package/src/routes/price-lists/price-list-edit/price-list-edit.tsx +28 -0
- package/src/routes/price-lists/price-list-list/components/price-list-list-table/index.ts +1 -0
- package/src/routes/price-lists/price-list-list/components/price-list-list-table/price-count-cell.tsx +19 -0
- package/src/routes/price-lists/price-list-list/components/price-list-list-table/price-list-list-table-actions.tsx +42 -0
- package/src/routes/price-lists/price-list-list/components/price-list-list-table/price-list-list-table.tsx +76 -0
- package/src/routes/price-lists/price-list-list/components/price-list-list-table/use-pricing-table-columns.tsx +45 -0
- package/src/routes/price-lists/price-list-list/components/price-list-list-table/use-pricing-table-filters.tsx +7 -0
- package/src/routes/price-lists/price-list-list/components/price-list-list-table/use-pricing-table-query.tsx +25 -0
- package/src/routes/price-lists/price-list-list/index.ts +1 -0
- package/src/routes/price-lists/price-list-list/price-list-list.tsx +18 -0
- package/src/routes/price-lists/price-list-prices-add/components/price-list-prices-add-form/index.ts +1 -0
- package/src/routes/price-lists/price-list-prices-add/components/price-list-prices-add-form/price-list-prices-add-form.tsx +305 -0
- package/src/routes/price-lists/price-list-prices-add/components/price-list-prices-add-form/price-list-prices-add-prices-form.tsx +97 -0
- package/src/routes/price-lists/price-list-prices-add/components/price-list-prices-add-form/price-list-prices-add-product-ids-form.tsx +231 -0
- package/src/routes/price-lists/price-list-prices-add/components/price-list-prices-add-form/schema.ts +27 -0
- package/src/routes/price-lists/price-list-prices-add/index.ts +1 -0
- package/src/routes/price-lists/price-list-prices-add/price-list-prices-add.tsx +35 -0
- package/src/routes/price-lists/price-list-prices-edit/components/price-list-prices-edit-form/index.ts +1 -0
- package/src/routes/price-lists/price-list-prices-edit/components/price-list-prices-edit-form/price-list-prices-edit-form.tsx +313 -0
- package/src/routes/price-lists/price-list-prices-edit/index.ts +1 -0
- package/src/routes/price-lists/price-list-prices-edit/price-list-prices-edit.tsx +65 -0
- package/src/routes/product-tags/common/hooks/use-delete-product-tag-action.tsx +52 -0
- package/src/routes/product-tags/product-tag-create/components/product-tag-create-form/index.ts +1 -0
- package/src/routes/product-tags/product-tag-create/components/product-tag-create-form/product-tag-create-form.tsx +100 -0
- package/src/routes/product-tags/product-tag-create/index.ts +1 -0
- package/src/routes/product-tags/product-tag-create/product-tag-create.tsx +10 -0
- package/src/routes/product-tags/product-tag-detail/breadcrumb.tsx +23 -0
- package/src/routes/product-tags/product-tag-detail/components/product-tag-general-section/index.ts +1 -0
- package/src/routes/product-tags/product-tag-detail/components/product-tag-general-section/product-tag-general-section.tsx +63 -0
- package/src/routes/product-tags/product-tag-detail/components/product-tag-product-section/index.ts +1 -0
- package/src/routes/product-tags/product-tag-detail/components/product-tag-product-section/product-tag-product-section.tsx +74 -0
- package/src/routes/product-tags/product-tag-detail/index.ts +3 -0
- package/src/routes/product-tags/product-tag-detail/loader.ts +17 -0
- package/src/routes/product-tags/product-tag-detail/product-tag-detail.tsx +50 -0
- package/src/routes/product-tags/product-tag-edit/components/product-tag-edit-form/index.ts +1 -0
- package/src/routes/product-tags/product-tag-edit/components/product-tag-edit-form/product-tag-edit-form.tsx +88 -0
- package/src/routes/product-tags/product-tag-edit/index.ts +1 -0
- package/src/routes/product-tags/product-tag-edit/product-tag-edit.tsx +33 -0
- package/src/routes/product-tags/product-tag-list/components/product-tag-list-table/index.ts +1 -0
- package/src/routes/product-tags/product-tag-list/components/product-tag-list-table/product-tag-list-table.tsx +148 -0
- package/src/routes/product-tags/product-tag-list/index.ts +2 -0
- package/src/routes/product-tags/product-tag-list/loader.ts +34 -0
- package/src/routes/product-tags/product-tag-list/product-tag-list.tsx +21 -0
- package/src/routes/product-tags/product-tag-metadata/index.ts +1 -0
- package/src/routes/product-tags/product-tag-metadata/product-tag-metadata.tsx +26 -0
- package/src/routes/product-types/common/hooks/use-delete-product-type-action.tsx +38 -0
- package/src/routes/product-types/product-type-create/components/create-product-type-form/create-product-type-form.tsx +100 -0
- package/src/routes/product-types/product-type-create/components/create-product-type-form/index.ts +1 -0
- package/src/routes/product-types/product-type-create/index.ts +1 -0
- package/src/routes/product-types/product-type-create/product-type-create.tsx +10 -0
- package/src/routes/product-types/product-type-detail/breadcrumb.tsx +24 -0
- package/src/routes/product-types/product-type-detail/components/product-type-general-section/index.ts +1 -0
- package/src/routes/product-types/product-type-detail/components/product-type-general-section/product-type-general-section.tsx +63 -0
- package/src/routes/product-types/product-type-detail/components/product-type-product-section/index.ts +1 -0
- package/src/routes/product-types/product-type-detail/components/product-type-product-section/product-type-product-section.tsx +70 -0
- package/src/routes/product-types/product-type-detail/index.ts +3 -0
- package/src/routes/product-types/product-type-detail/loader.ts +17 -0
- package/src/routes/product-types/product-type-detail/product-type-detail.tsx +49 -0
- package/src/routes/product-types/product-type-edit/components/edit-product-type-form/edit-product-type-form.tsx +94 -0
- package/src/routes/product-types/product-type-edit/components/edit-product-type-form/index.ts +1 -0
- package/src/routes/product-types/product-type-edit/index.ts +1 -0
- package/src/routes/product-types/product-type-edit/product-type-edit.tsx +28 -0
- package/src/routes/product-types/product-type-list/components/product-type-list-table/index.ts +1 -0
- package/src/routes/product-types/product-type-list/components/product-type-list-table/product-table-row-actions.tsx +59 -0
- package/src/routes/product-types/product-type-list/components/product-type-list-table/product-type-list-table.tsx +98 -0
- package/src/routes/product-types/product-type-list/index.ts +1 -0
- package/src/routes/product-types/product-type-list/product-type-list.tsx +18 -0
- package/src/routes/product-types/product-type-metadata/index.ts +1 -0
- package/src/routes/product-types/product-type-metadata/product-type-metadata.tsx +26 -0
- package/src/routes/product-variants/product-variant-detail/breadcrumb.tsx +31 -0
- package/src/routes/product-variants/product-variant-detail/components/variant-general-section/index.ts +1 -0
- package/src/routes/product-variants/product-variant-detail/components/variant-general-section/variant-general-section.tsx +112 -0
- package/src/routes/product-variants/product-variant-detail/components/variant-inventory-section/index.ts +1 -0
- package/src/routes/product-variants/product-variant-detail/components/variant-inventory-section/inventory-actions.tsx +26 -0
- package/src/routes/product-variants/product-variant-detail/components/variant-inventory-section/use-inventory-table-columns.tsx +104 -0
- package/src/routes/product-variants/product-variant-detail/components/variant-inventory-section/variant-inventory-section.tsx +94 -0
- package/src/routes/product-variants/product-variant-detail/components/variant-media-section/index.ts +1 -0
- package/src/routes/product-variants/product-variant-detail/components/variant-media-section/variant-media-section.tsx +77 -0
- package/src/routes/product-variants/product-variant-detail/components/variant-prices-section/index.ts +1 -0
- package/src/routes/product-variants/product-variant-detail/components/variant-prices-section/variant-prices-section.tsx +82 -0
- package/src/routes/product-variants/product-variant-detail/constants.ts +2 -0
- package/src/routes/product-variants/product-variant-detail/index.ts +3 -0
- package/src/routes/product-variants/product-variant-detail/loader.ts +25 -0
- package/src/routes/product-variants/product-variant-detail/product-variant-detail.tsx +85 -0
- package/src/routes/product-variants/product-variant-edit/components/product-edit-variant-form/index.ts +1 -0
- package/src/routes/product-variants/product-variant-edit/components/product-edit-variant-form/product-edit-variant-form.tsx +447 -0
- package/src/routes/product-variants/product-variant-edit/index.ts +2 -0
- package/src/routes/product-variants/product-variant-edit/loader.ts +33 -0
- package/src/routes/product-variants/product-variant-edit/product-variant-edit.tsx +62 -0
- package/src/routes/product-variants/product-variant-manage-inventory-items/components/manage-variant-inventory-items-form/index.ts +1 -0
- package/src/routes/product-variants/product-variant-manage-inventory-items/components/manage-variant-inventory-items-form/manage-variant-inventory-items-form.tsx +376 -0
- package/src/routes/product-variants/product-variant-manage-inventory-items/index.ts +1 -0
- package/src/routes/product-variants/product-variant-manage-inventory-items/product-variant-manage-inventory-items.tsx +31 -0
- package/src/routes/product-variants/product-variant-media/components/edit-product-variant-media-form/edit-product-variant-media-form.tsx +434 -0
- package/src/routes/product-variants/product-variant-media/components/edit-product-variant-media-form/index.ts +1 -0
- package/src/routes/product-variants/product-variant-media/index.ts +1 -0
- package/src/routes/product-variants/product-variant-media/product-variant-media.tsx +38 -0
- package/src/routes/product-variants/product-variant-metadata/index.ts +1 -0
- package/src/routes/product-variants/product-variant-metadata/product-variant-metadata.tsx +30 -0
- package/src/routes/products/common/components/category-combobox/category-combobox.tsx +499 -0
- package/src/routes/products/common/components/category-combobox/index.ts +1 -0
- package/src/routes/products/common/components/upload-media-form-item/index.ts +1 -0
- package/src/routes/products/common/components/upload-media-form-item/upload-media-form-item.tsx +134 -0
- package/src/routes/products/common/constants.ts +1 -0
- package/src/routes/products/common/variant-pricing-form.tsx +99 -0
- package/src/routes/products/product-attributes/components/product-attributes-form/index.ts +1 -0
- package/src/routes/products/product-attributes/components/product-attributes-form/product-attributes-form.tsx +277 -0
- package/src/routes/products/product-attributes/index.ts +1 -0
- package/src/routes/products/product-attributes/product-attributes.tsx +33 -0
- package/src/routes/products/product-create/components/product-create-details-form/components/product-create-details-general-section/index.ts +1 -0
- package/src/routes/products/product-create/components/product-create-details-form/components/product-create-details-general-section/product-create-general-section.tsx +91 -0
- package/src/routes/products/product-create/components/product-create-details-form/components/product-create-details-media-section/index.ts +1 -0
- package/src/routes/products/product-create/components/product-create-details-form/components/product-create-details-media-section/product-create-details-media-section.tsx +338 -0
- package/src/routes/products/product-create/components/product-create-details-form/components/product-create-details-variant-section/index.ts +1 -0
- package/src/routes/products/product-create/components/product-create-details-form/components/product-create-details-variant-section/product-create-details-variant-section.tsx +528 -0
- package/src/routes/products/product-create/components/product-create-details-form/index.ts +1 -0
- package/src/routes/products/product-create/components/product-create-details-form/product-create-details-form.tsx +44 -0
- package/src/routes/products/product-create/components/product-create-form/index.ts +1 -0
- package/src/routes/products/product-create/components/product-create-form/product-create-form.tsx +404 -0
- package/src/routes/products/product-create/components/product-create-inventory-kit-form/components/product-create-inventory-kit-section/index.ts +1 -0
- package/src/routes/products/product-create/components/product-create-inventory-kit-form/components/product-create-inventory-kit-section/product-create-inventory-kit-section.tsx +248 -0
- package/src/routes/products/product-create/components/product-create-inventory-kit-form/index.ts +1 -0
- package/src/routes/products/product-create/components/product-create-inventory-kit-form/product-create-inventory-kit-form.tsx +20 -0
- package/src/routes/products/product-create/components/product-create-organize-form/components/product-create-organize-attribute-section/index.ts +1 -0
- package/src/routes/products/product-create/components/product-create-organize-form/components/product-create-organize-attribute-section/product-create-details-attribute-section.tsx +155 -0
- package/src/routes/products/product-create/components/product-create-organize-form/components/product-create-organize-section/index.ts +1 -0
- package/src/routes/products/product-create/components/product-create-organize-form/components/product-create-organize-section/product-create-details-organize-section.tsx +248 -0
- package/src/routes/products/product-create/components/product-create-organize-form/components/product-create-sales-channel-stacked-modal/index.ts +1 -0
- package/src/routes/products/product-create/components/product-create-organize-form/components/product-create-sales-channel-stacked-modal/product-create-sales-channel-drawer.tsx +160 -0
- package/src/routes/products/product-create/components/product-create-organize-form/constants.ts +1 -0
- package/src/routes/products/product-create/components/product-create-organize-form/index.ts +1 -0
- package/src/routes/products/product-create/components/product-create-organize-form/product-create-organize-form.tsx +33 -0
- package/src/routes/products/product-create/components/product-create-variants-form/index.ts +1 -0
- package/src/routes/products/product-create/components/product-create-variants-form/product-create-variants-form.tsx +204 -0
- package/src/routes/products/product-create/constants.ts +163 -0
- package/src/routes/products/product-create/index.ts +1 -0
- package/src/routes/products/product-create/product-create.tsx +90 -0
- package/src/routes/products/product-create/types.ts +6 -0
- package/src/routes/products/product-create/utils.ts +118 -0
- package/src/routes/products/product-create-option/components/create-product-option-form/create-product-option-form.tsx +122 -0
- package/src/routes/products/product-create-option/components/create-product-option-form/index.ts +1 -0
- package/src/routes/products/product-create-option/index.ts +1 -0
- package/src/routes/products/product-create-option/product-create-option.tsx +30 -0
- package/src/routes/products/product-create-variant/components/create-product-variant-form/constants.ts +44 -0
- package/src/routes/products/product-create-variant/components/create-product-variant-form/create-product-variant-form.tsx +387 -0
- package/src/routes/products/product-create-variant/components/create-product-variant-form/details-tab.tsx +193 -0
- package/src/routes/products/product-create-variant/components/create-product-variant-form/index.ts +1 -0
- package/src/routes/products/product-create-variant/components/create-product-variant-form/inventory-kit-tab.tsx +188 -0
- package/src/routes/products/product-create-variant/components/create-product-variant-form/pricing-tab.tsx +100 -0
- package/src/routes/products/product-create-variant/index.ts +1 -0
- package/src/routes/products/product-create-variant/product-create-variant.tsx +23 -0
- package/src/routes/products/product-detail/breadcrumb.tsx +30 -0
- package/src/routes/products/product-detail/components/product-attribute-section/index.ts +1 -0
- package/src/routes/products/product-detail/components/product-attribute-section/product-attribute-section.tsx +53 -0
- package/src/routes/products/product-detail/components/product-general-section/index.ts +1 -0
- package/src/routes/products/product-detail/components/product-general-section/product-general-section.tsx +130 -0
- package/src/routes/products/product-detail/components/product-media-section/index.ts +1 -0
- package/src/routes/products/product-detail/components/product-media-section/product-media-section.tsx +220 -0
- package/src/routes/products/product-detail/components/product-option-section/index.ts +1 -0
- package/src/routes/products/product-detail/components/product-option-section/product-option-section.tsx +113 -0
- package/src/routes/products/product-detail/components/product-organization-section/index.ts +1 -0
- package/src/routes/products/product-detail/components/product-organization-section/product-organization-section.tsx +107 -0
- package/src/routes/products/product-detail/components/product-sales-channel-section/index.ts +1 -0
- package/src/routes/products/product-detail/components/product-sales-channel-section/product-sales-channel-section.tsx +106 -0
- package/src/routes/products/product-detail/components/product-shipping-profile-section/index.ts +1 -0
- package/src/routes/products/product-detail/components/product-shipping-profile-section/product-shipping-profile-section.tsx +51 -0
- package/src/routes/products/product-detail/components/product-variant-section/index.ts +1 -0
- package/src/routes/products/product-detail/components/product-variant-section/product-variant-section.tsx +468 -0
- package/src/routes/products/product-detail/constants.ts +6 -0
- package/src/routes/products/product-detail/index.ts +3 -0
- package/src/routes/products/product-detail/loader.ts +24 -0
- package/src/routes/products/product-detail/product-detail.tsx +81 -0
- package/src/routes/products/product-edit/components/edit-product-form/edit-product-form.tsx +246 -0
- package/src/routes/products/product-edit/components/edit-product-form/index.ts +1 -0
- package/src/routes/products/product-edit/index.ts +1 -0
- package/src/routes/products/product-edit/product-edit.tsx +36 -0
- package/src/routes/products/product-edit-option/components/edit-product-option-form/edit-product-option-form.tsx +125 -0
- package/src/routes/products/product-edit-option/components/edit-product-option-form/index.ts +1 -0
- package/src/routes/products/product-edit-option/index.ts +1 -0
- package/src/routes/products/product-edit-option/product-edit-option.tsx +35 -0
- package/src/routes/products/product-export/components/export-filters.tsx +22 -0
- package/src/routes/products/product-export/index.ts +1 -0
- package/src/routes/products/product-export/product-export.tsx +67 -0
- package/src/routes/products/product-image-variants-edit/components/variants-table-form/index.ts +1 -0
- package/src/routes/products/product-image-variants-edit/components/variants-table-form/variants-table-form.tsx +264 -0
- package/src/routes/products/product-image-variants-edit/index.ts +1 -0
- package/src/routes/products/product-image-variants-edit/product-image-variants-edit.tsx +65 -0
- package/src/routes/products/product-import/components/import-summary.tsx +50 -0
- package/src/routes/products/product-import/components/upload-import.tsx +61 -0
- package/src/routes/products/product-import/helpers/import-template.ts +12 -0
- package/src/routes/products/product-import/index.ts +1 -0
- package/src/routes/products/product-import/product-import.tsx +143 -0
- package/src/routes/products/product-list/components/product-list-table/configurable-product-list-table.tsx +26 -0
- package/src/routes/products/product-list/components/product-list-table/index.ts +1 -0
- package/src/routes/products/product-list/components/product-list-table/product-list-table.tsx +203 -0
- package/src/routes/products/product-list/components/product-list-table/product-table-adapter.tsx +51 -0
- package/src/routes/products/product-list/components/product-list-table/use-product-table-filters.tsx +104 -0
- package/src/routes/products/product-list/index.ts +2 -0
- package/src/routes/products/product-list/loader.ts +28 -0
- package/src/routes/products/product-list/product-list.tsx +18 -0
- package/src/routes/products/product-media/components/edit-product-media-form/edit-product-media-form.tsx +457 -0
- package/src/routes/products/product-media/components/edit-product-media-form/index.ts +1 -0
- package/src/routes/products/product-media/components/product-media-gallery/index.ts +1 -0
- package/src/routes/products/product-media/components/product-media-gallery/product-media-gallery.tsx +327 -0
- package/src/routes/products/product-media/components/product-media-view/index.ts +1 -0
- package/src/routes/products/product-media/components/product-media-view/product-media-view-context.tsx +9 -0
- package/src/routes/products/product-media/components/product-media-view/product-media-view.tsx +54 -0
- package/src/routes/products/product-media/components/product-media-view/use-product-media-view.tsx +14 -0
- package/src/routes/products/product-media/index.ts +1 -0
- package/src/routes/products/product-media/product-media.tsx +33 -0
- package/src/routes/products/product-metadata/index.ts +1 -0
- package/src/routes/products/product-metadata/product-metadata.tsx +28 -0
- package/src/routes/products/product-organization/components/product-organization-form/index.ts +1 -0
- package/src/routes/products/product-organization/components/product-organization-form/product-organization-form.tsx +218 -0
- package/src/routes/products/product-organization/index.ts +1 -0
- package/src/routes/products/product-organization/product-organization.tsx +32 -0
- package/src/routes/products/product-prices/index.ts +1 -0
- package/src/routes/products/product-prices/pricing-edit.tsx +149 -0
- package/src/routes/products/product-prices/product-prices.tsx +26 -0
- package/src/routes/products/product-sales-channels/components/edit-sales-channels-form/edit-sales-channels-form.tsx +155 -0
- package/src/routes/products/product-sales-channels/components/edit-sales-channels-form/index.ts +1 -0
- package/src/routes/products/product-sales-channels/index.ts +1 -0
- package/src/routes/products/product-sales-channels/product-sales-channels.tsx +23 -0
- package/src/routes/products/product-shipping-profile/components/product-organization-form/index.ts +1 -0
- package/src/routes/products/product-shipping-profile/components/product-organization-form/product-shipping-profile-form.tsx +133 -0
- package/src/routes/products/product-shipping-profile/index.ts +1 -0
- package/src/routes/products/product-shipping-profile/product-shipping-profile.tsx +35 -0
- package/src/routes/products/product-stock/components/product-stock-form/index.ts +1 -0
- package/src/routes/products/product-stock/components/product-stock-form/product-stock-form.tsx +220 -0
- package/src/routes/products/product-stock/hooks/use-product-stock-columns.tsx +227 -0
- package/src/routes/products/product-stock/index.ts +2 -0
- package/src/routes/products/product-stock/loader.ts +55 -0
- package/src/routes/products/product-stock/product-stock.tsx +106 -0
- package/src/routes/products/product-stock/schema.ts +33 -0
- package/src/routes/products/product-stock/utils.ts +53 -0
- package/src/routes/profile/profile-detail/components/profile-general-section/index.ts +1 -0
- package/src/routes/profile/profile-detail/components/profile-general-section/profile-general-section.tsx +76 -0
- package/src/routes/profile/profile-detail/index.ts +1 -0
- package/src/routes/profile/profile-detail/profile-detail.tsx +30 -0
- package/src/routes/profile/profile-edit/components/edit-profile-form/edit-profile-form.tsx +205 -0
- package/src/routes/profile/profile-edit/index.ts +1 -0
- package/src/routes/profile/profile-edit/profile-edit.tsx +26 -0
- package/src/routes/promotions/common/edit-rules/components/edit-rules-form/edit-rules-form.tsx +76 -0
- package/src/routes/promotions/common/edit-rules/components/edit-rules-form/form-schema.ts +32 -0
- package/src/routes/promotions/common/edit-rules/components/edit-rules-form/index.ts +1 -0
- package/src/routes/promotions/common/edit-rules/components/edit-rules-form/utils.ts +17 -0
- package/src/routes/promotions/common/edit-rules/components/edit-rules-wrapper/edit-rules-wrapper.tsx +123 -0
- package/src/routes/promotions/common/edit-rules/components/edit-rules-wrapper/index.ts +1 -0
- package/src/routes/promotions/common/edit-rules/components/edit-rules-wrapper/utils.ts +9 -0
- package/src/routes/promotions/common/edit-rules/components/rule-value-form-field/index.ts +1 -0
- package/src/routes/promotions/common/edit-rules/components/rule-value-form-field/rule-value-form-field.tsx +168 -0
- package/src/routes/promotions/common/edit-rules/components/rules-form-field/constants.ts +11 -0
- package/src/routes/promotions/common/edit-rules/components/rules-form-field/index.ts +1 -0
- package/src/routes/promotions/common/edit-rules/components/rules-form-field/rules-form-field.tsx +450 -0
- package/src/routes/promotions/common/edit-rules/edit-rules.tsx +63 -0
- package/src/routes/promotions/common/edit-rules/index.ts +1 -0
- package/src/routes/promotions/promotion-add-campaign/components/add-campaign-promotion-form/add-campaign-promotion-form.tsx +244 -0
- package/src/routes/promotions/promotion-add-campaign/components/add-campaign-promotion-form/campaign-details.tsx +145 -0
- package/src/routes/promotions/promotion-add-campaign/components/add-campaign-promotion-form/index.ts +1 -0
- package/src/routes/promotions/promotion-add-campaign/index.ts +1 -0
- package/src/routes/promotions/promotion-add-campaign/promotion-add-campaign.tsx +29 -0
- package/src/routes/promotions/promotion-create/components/create-promotion-form/constants.ts +11 -0
- package/src/routes/promotions/promotion-create/components/create-promotion-form/create-promotion-form.tsx +1086 -0
- package/src/routes/promotions/promotion-create/components/create-promotion-form/form-schema.ts +62 -0
- package/src/routes/promotions/promotion-create/components/create-promotion-form/index.ts +1 -0
- package/src/routes/promotions/promotion-create/components/create-promotion-form/templates.ts +140 -0
- package/src/routes/promotions/promotion-create/index.ts +1 -0
- package/src/routes/promotions/promotion-create/promotion-create.tsx +10 -0
- package/src/routes/promotions/promotion-detail/breadcrumb.tsx +22 -0
- package/src/routes/promotions/promotion-detail/components/campaign-section/campaign-section.tsx +92 -0
- package/src/routes/promotions/promotion-detail/components/campaign-section/index.ts +1 -0
- package/src/routes/promotions/promotion-detail/components/promotion-conditions-section/index.ts +1 -0
- package/src/routes/promotions/promotion-detail/components/promotion-conditions-section/promotion-conditions-section.tsx +105 -0
- package/src/routes/promotions/promotion-detail/components/promotion-general-section/index.ts +1 -0
- package/src/routes/promotions/promotion-detail/components/promotion-general-section/promotion-general-section.tsx +215 -0
- package/src/routes/promotions/promotion-detail/index.ts +3 -0
- package/src/routes/promotions/promotion-detail/loader.ts +16 -0
- package/src/routes/promotions/promotion-detail/promotion-detail.tsx +72 -0
- package/src/routes/promotions/promotion-edit-details/components/edit-promotion-form/edit-promotion-details-form.tsx +455 -0
- package/src/routes/promotions/promotion-edit-details/components/edit-promotion-form/index.ts +1 -0
- package/src/routes/promotions/promotion-edit-details/index.ts +1 -0
- package/src/routes/promotions/promotion-edit-details/promotion-edit-details.tsx +30 -0
- package/src/routes/promotions/promotion-list/components/promotion-list-table/index.ts +1 -0
- package/src/routes/promotions/promotion-list/components/promotion-list-table/promotion-list-table.tsx +158 -0
- package/src/routes/promotions/promotion-list/index.ts +2 -0
- package/src/routes/promotions/promotion-list/loader.ts +27 -0
- package/src/routes/promotions/promotion-list/promotions-list.tsx +18 -0
- package/src/routes/refund-reasons/refund-reason-create/components/refund-reason-create-form/index.ts +1 -0
- package/src/routes/refund-reasons/refund-reason-create/components/refund-reason-create-form/refund-reason-create-form.tsx +177 -0
- package/src/routes/refund-reasons/refund-reason-create/index.ts +1 -0
- package/src/routes/refund-reasons/refund-reason-create/refund-reason-create.tsx +10 -0
- package/src/routes/refund-reasons/refund-reason-edit/components/refund-reason-edit-form/index.ts +1 -0
- package/src/routes/refund-reasons/refund-reason-edit/components/refund-reason-edit-form/refund-reason-edit-form.tsx +141 -0
- package/src/routes/refund-reasons/refund-reason-edit/index.ts +1 -0
- package/src/routes/refund-reasons/refund-reason-edit/refund-reason-edit.tsx +33 -0
- package/src/routes/refund-reasons/refund-reason-list/components/refund-reason-list-table/index.ts +1 -0
- package/src/routes/refund-reasons/refund-reason-list/components/refund-reason-list-table/refund-reason-list-table.tsx +138 -0
- package/src/routes/refund-reasons/refund-reason-list/index.ts +2 -0
- package/src/routes/refund-reasons/refund-reason-list/loader.ts +16 -0
- package/src/routes/refund-reasons/refund-reason-list/refund-reason-list.tsx +21 -0
- package/src/routes/regions/common/constants.ts +4 -0
- package/src/routes/regions/common/hooks/use-countries.tsx +68 -0
- package/src/routes/regions/common/hooks/use-country-table-columns.tsx +25 -0
- package/src/routes/regions/common/hooks/use-country-table-query.tsx +25 -0
- package/src/routes/regions/region-add-countries/components/add-countries-form/add-countries-form.tsx +208 -0
- package/src/routes/regions/region-add-countries/components/add-countries-form/index.ts +1 -0
- package/src/routes/regions/region-add-countries/index.ts +1 -0
- package/src/routes/regions/region-add-countries/region-add-countries.tsx +27 -0
- package/src/routes/regions/region-create/components/create-region-form/create-region-form.tsx +523 -0
- package/src/routes/regions/region-create/components/create-region-form/index.ts +1 -0
- package/src/routes/regions/region-create/index.ts +1 -0
- package/src/routes/regions/region-create/region-create.tsx +22 -0
- package/src/routes/regions/region-detail/breadcrumb.tsx +27 -0
- package/src/routes/regions/region-detail/components/region-country-section/index.ts +1 -0
- package/src/routes/regions/region-detail/components/region-country-section/region-country-section.tsx +255 -0
- package/src/routes/regions/region-detail/components/region-general-section/index.ts +1 -0
- package/src/routes/regions/region-detail/components/region-general-section/region-general-section.tsx +138 -0
- package/src/routes/regions/region-detail/constants.ts +2 -0
- package/src/routes/regions/region-detail/index.ts +3 -0
- package/src/routes/regions/region-detail/loader.ts +25 -0
- package/src/routes/regions/region-detail/region-detail.tsx +77 -0
- package/src/routes/regions/region-edit/components/edit-region-form/edit-region-form.tsx +251 -0
- package/src/routes/regions/region-edit/components/edit-region-form/index.ts +1 -0
- package/src/routes/regions/region-edit/index.ts +1 -0
- package/src/routes/regions/region-edit/region-edit.tsx +78 -0
- package/src/routes/regions/region-list/components/region-list-table/index.ts +1 -0
- package/src/routes/regions/region-list/components/region-list-table/region-list-table.tsx +178 -0
- package/src/routes/regions/region-list/index.ts +1 -0
- package/src/routes/regions/region-list/region-list.tsx +18 -0
- package/src/routes/regions/region-metadata/index.ts +1 -0
- package/src/routes/regions/region-metadata/region-metadata.tsx +27 -0
- package/src/routes/reservations/reservation-create/components/reservation-create-from/index.ts +1 -0
- package/src/routes/reservations/reservation-create/components/reservation-create-from/reservation-create-from.tsx +311 -0
- package/src/routes/reservations/reservation-create/index.ts +2 -0
- package/src/routes/reservations/reservation-create/reservation-create.tsx +16 -0
- package/src/routes/reservations/reservation-detail/breadcrumb.tsx +29 -0
- package/src/routes/reservations/reservation-detail/components/edit-reservation/components/edit-reservation-form.tsx +215 -0
- package/src/routes/reservations/reservation-detail/components/edit-reservation/components/index.tsx +1 -0
- package/src/routes/reservations/reservation-detail/components/edit-reservation/edit-reservation-modal.tsx +53 -0
- package/src/routes/reservations/reservation-detail/components/edit-reservation/index.ts +1 -0
- package/src/routes/reservations/reservation-detail/components/reservation-general-section/index.ts +1 -0
- package/src/routes/reservations/reservation-detail/components/reservation-general-section/reservation-general-section.tsx +90 -0
- package/src/routes/reservations/reservation-detail/index.ts +3 -0
- package/src/routes/reservations/reservation-detail/loader.ts +16 -0
- package/src/routes/reservations/reservation-detail/reservation-detail.tsx +73 -0
- package/src/routes/reservations/reservation-list/components/reservation-list-table/index.ts +1 -0
- package/src/routes/reservations/reservation-list/components/reservation-list-table/reservation-actions.tsx +57 -0
- package/src/routes/reservations/reservation-list/components/reservation-list-table/reservation-list-table.tsx +67 -0
- package/src/routes/reservations/reservation-list/components/reservation-list-table/use-reservation-table-columns.tsx +107 -0
- package/src/routes/reservations/reservation-list/components/reservation-list-table/use-reservation-table-filters.tsx +35 -0
- package/src/routes/reservations/reservation-list/components/reservation-list-table/use-reservation-table-query.tsx +32 -0
- package/src/routes/reservations/reservation-list/constants.ts +1 -0
- package/src/routes/reservations/reservation-list/index.ts +1 -0
- package/src/routes/reservations/reservation-list/reservation-list.tsx +18 -0
- package/src/routes/reservations/reservation-metadata/index.ts +1 -0
- package/src/routes/reservations/reservation-metadata/reservation-metadata.tsx +30 -0
- package/src/routes/reset-password/index.ts +2 -0
- package/src/routes/reset-password/reset-password.tsx +341 -0
- package/src/routes/return-reasons/common/hooks/use-delete-return-reason-action.tsx +40 -0
- package/src/routes/return-reasons/return-reason-create/components/return-reason-create-form/index.ts +1 -0
- package/src/routes/return-reasons/return-reason-create/components/return-reason-create-form/return-reason-create-form.tsx +157 -0
- package/src/routes/return-reasons/return-reason-create/index.ts +1 -0
- package/src/routes/return-reasons/return-reason-create/return-reason-create.tsx +10 -0
- package/src/routes/return-reasons/return-reason-edit/components/return-reason-edit-form/index.ts +1 -0
- package/src/routes/return-reasons/return-reason-edit/components/return-reason-edit-form/return-reason-edit-form.tsx +141 -0
- package/src/routes/return-reasons/return-reason-edit/index.ts +1 -0
- package/src/routes/return-reasons/return-reason-edit/return-reason-edit.tsx +33 -0
- package/src/routes/return-reasons/return-reason-list/components/return-reason-list-table/index.ts +1 -0
- package/src/routes/return-reasons/return-reason-list/components/return-reason-list-table/return-reason-list-table.tsx +128 -0
- package/src/routes/return-reasons/return-reason-list/index.ts +2 -0
- package/src/routes/return-reasons/return-reason-list/loader.ts +21 -0
- package/src/routes/return-reasons/return-reason-list/return-reason-list.tsx +21 -0
- package/src/routes/sales-channels/sales-channel-add-products/components/add-products-to-sales-channel-form.tsx +240 -0
- package/src/routes/sales-channels/sales-channel-add-products/components/index.ts +1 -0
- package/src/routes/sales-channels/sales-channel-add-products/index.ts +1 -0
- package/src/routes/sales-channels/sales-channel-add-products/sales-channel-add-products.tsx +26 -0
- package/src/routes/sales-channels/sales-channel-create/components/create-sales-channel-form/create-sales-channel-form.tsx +154 -0
- package/src/routes/sales-channels/sales-channel-create/components/create-sales-channel-form/index.ts +1 -0
- package/src/routes/sales-channels/sales-channel-create/index.ts +1 -0
- package/src/routes/sales-channels/sales-channel-create/sales-channel-create.tsx +10 -0
- package/src/routes/sales-channels/sales-channel-detail/breadcrumb.tsx +23 -0
- package/src/routes/sales-channels/sales-channel-detail/components/sales-channel-general-section/index.ts +1 -0
- package/src/routes/sales-channels/sales-channel-detail/components/sales-channel-general-section/sales-channel-general-section.tsx +99 -0
- package/src/routes/sales-channels/sales-channel-detail/components/sales-channel-product-section/index.ts +1 -0
- package/src/routes/sales-channels/sales-channel-detail/components/sales-channel-product-section/sales-channel-product-section.tsx +255 -0
- package/src/routes/sales-channels/sales-channel-detail/index.ts +3 -0
- package/src/routes/sales-channels/sales-channel-detail/loader.ts +17 -0
- package/src/routes/sales-channels/sales-channel-detail/sales-channel-detail.tsx +41 -0
- package/src/routes/sales-channels/sales-channel-edit/components/edit-sales-channel-form/edit-sales-channel-form.tsx +136 -0
- package/src/routes/sales-channels/sales-channel-edit/components/edit-sales-channel-form/index.ts +1 -0
- package/src/routes/sales-channels/sales-channel-edit/index.ts +1 -0
- package/src/routes/sales-channels/sales-channel-edit/sales-channel-edit.tsx +36 -0
- package/src/routes/sales-channels/sales-channel-list/components/index.ts +1 -0
- package/src/routes/sales-channels/sales-channel-list/components/sales-channel-list-table.tsx +158 -0
- package/src/routes/sales-channels/sales-channel-list/index.ts +1 -0
- package/src/routes/sales-channels/sales-channel-list/sales-channel-list.tsx +20 -0
- package/src/routes/sales-channels/sales-channel-metadata/index.ts +1 -0
- package/src/routes/sales-channels/sales-channel-metadata/sales-channel-metadata.tsx +32 -0
- package/src/routes/settings/index.ts +1 -0
- package/src/routes/settings/settings.tsx +15 -0
- package/src/routes/shipping-option-types/common/hooks/use-delete-shipping-option-type-action.tsx +43 -0
- package/src/routes/shipping-option-types/shipping-option-type-create/components/create-shipping-option-type-form/create-shipping-option-type-form.tsx +168 -0
- package/src/routes/shipping-option-types/shipping-option-type-create/components/create-shipping-option-type-form/index.ts +1 -0
- package/src/routes/shipping-option-types/shipping-option-type-create/index.ts +1 -0
- package/src/routes/shipping-option-types/shipping-option-type-create/shipping-option-type-create.tsx +10 -0
- package/src/routes/shipping-option-types/shipping-option-type-detail/breadcrumb.tsx +24 -0
- package/src/routes/shipping-option-types/shipping-option-type-detail/components/shipping-option-type-general-section/index.ts +1 -0
- package/src/routes/shipping-option-types/shipping-option-type-detail/components/shipping-option-type-general-section/shipping-option-type-general-section.tsx +66 -0
- package/src/routes/shipping-option-types/shipping-option-type-detail/index.ts +3 -0
- package/src/routes/shipping-option-types/shipping-option-type-detail/loader.ts +19 -0
- package/src/routes/shipping-option-types/shipping-option-type-detail/shipping-option-type-detail.tsx +46 -0
- package/src/routes/shipping-option-types/shipping-option-type-edit/components/edit-shipping-option-type-form/edit-shipping-option-type-form.tsx +145 -0
- package/src/routes/shipping-option-types/shipping-option-type-edit/components/edit-shipping-option-type-form/index.ts +1 -0
- package/src/routes/shipping-option-types/shipping-option-type-edit/index.ts +1 -0
- package/src/routes/shipping-option-types/shipping-option-type-edit/shipping-option-type-edit.tsx +31 -0
- package/src/routes/shipping-option-types/shipping-option-type-list/components/shipping-option-type-list-table/index.ts +1 -0
- package/src/routes/shipping-option-types/shipping-option-type-list/components/shipping-option-type-list-table/shipping-option-type-list-table.tsx +99 -0
- package/src/routes/shipping-option-types/shipping-option-type-list/components/shipping-option-type-list-table/shipping-option-type-table-row-actions.tsx +44 -0
- package/src/routes/shipping-option-types/shipping-option-type-list/index.ts +1 -0
- package/src/routes/shipping-option-types/shipping-option-type-list/shipping-option-type-list.tsx +18 -0
- package/src/routes/shipping-profiles/shipping-profile-create/components/create-shipping-profile-form/create-shipping-profile-form.tsx +129 -0
- package/src/routes/shipping-profiles/shipping-profile-create/components/create-shipping-profile-form/index.ts +1 -0
- package/src/routes/shipping-profiles/shipping-profile-create/index.ts +1 -0
- package/src/routes/shipping-profiles/shipping-profile-create/shipping-profile-create.tsx +10 -0
- package/src/routes/shipping-profiles/shipping-profile-detail/breadcrumb.tsx +27 -0
- package/src/routes/shipping-profiles/shipping-profile-detail/components/shipping-profile-general-section/index.ts +1 -0
- package/src/routes/shipping-profiles/shipping-profile-detail/components/shipping-profile-general-section/shipping-profile-general-section.tsx +76 -0
- package/src/routes/shipping-profiles/shipping-profile-detail/index.ts +3 -0
- package/src/routes/shipping-profiles/shipping-profile-detail/loader.ts +17 -0
- package/src/routes/shipping-profiles/shipping-profile-detail/shipping-profile-detail.tsx +47 -0
- package/src/routes/shipping-profiles/shipping-profile-metadata/index.ts +1 -0
- package/src/routes/shipping-profiles/shipping-profile-metadata/shipping-profile-metadata.tsx +31 -0
- package/src/routes/shipping-profiles/shipping-profiles-list/components/shipping-profile-list-table/index.ts +1 -0
- package/src/routes/shipping-profiles/shipping-profiles-list/components/shipping-profile-list-table/shipping-options-row-actions.tsx +64 -0
- package/src/routes/shipping-profiles/shipping-profiles-list/components/shipping-profile-list-table/shipping-profile-list-table.tsx +78 -0
- package/src/routes/shipping-profiles/shipping-profiles-list/components/shipping-profile-list-table/use-shipping-profile-table-columns.tsx +31 -0
- package/src/routes/shipping-profiles/shipping-profiles-list/components/shipping-profile-list-table/use-shipping-profile-table-filters.tsx +33 -0
- package/src/routes/shipping-profiles/shipping-profiles-list/components/shipping-profile-list-table/use-shipping-profile-table-query.tsx +30 -0
- package/src/routes/shipping-profiles/shipping-profiles-list/index.ts +1 -0
- package/src/routes/shipping-profiles/shipping-profiles-list/shipping-profile-list.tsx +18 -0
- package/src/routes/store/common/hooks/use-currencies-table-columns.tsx +29 -0
- package/src/routes/store/common/hooks/use-currencies-table-query.tsx +21 -0
- package/src/routes/store/common/hooks/use-locales-table-columns.tsx +29 -0
- package/src/routes/store/common/hooks/use-locales-table-query.tsx +21 -0
- package/src/routes/store/store-add-currencies/components/add-currencies-form/add-currencies-form.tsx +308 -0
- package/src/routes/store/store-add-currencies/index.ts +1 -0
- package/src/routes/store/store-add-currencies/store-add-currencies.tsx +42 -0
- package/src/routes/store/store-add-locales/components/add-locales-form/add-locales-form.tsx +231 -0
- package/src/routes/store/store-add-locales/index.ts +1 -0
- package/src/routes/store/store-add-locales/store-add-locales.tsx +29 -0
- package/src/routes/store/store-detail/components/store-currency-section/index.ts +1 -0
- package/src/routes/store/store-detail/components/store-currency-section/store-currency-section.tsx +387 -0
- package/src/routes/store/store-detail/components/store-general-section/index.ts +1 -0
- package/src/routes/store/store-detail/components/store-general-section/store-general-section.tsx +142 -0
- package/src/routes/store/store-detail/components/store-locale-section/index.ts +1 -0
- package/src/routes/store/store-detail/components/store-locale-section/store-locale-section.tsx +282 -0
- package/src/routes/store/store-detail/index.ts +2 -0
- package/src/routes/store/store-detail/loader.ts +18 -0
- package/src/routes/store/store-detail/store-detail.tsx +48 -0
- package/src/routes/store/store-edit/components/edit-store-form/edit-store-form.tsx +232 -0
- package/src/routes/store/store-edit/index.ts +1 -0
- package/src/routes/store/store-edit/store-edit.tsx +25 -0
- package/src/routes/store/store-metadata/index.ts +1 -0
- package/src/routes/store/store-metadata/store-metadata.tsx +24 -0
- package/src/routes/tax-regions/common/components/target-form/index.ts +1 -0
- package/src/routes/tax-regions/common/components/target-form/target-form.tsx +970 -0
- package/src/routes/tax-regions/common/components/target-item/index.ts +1 -0
- package/src/routes/tax-regions/common/components/target-item/target-item.tsx +43 -0
- package/src/routes/tax-regions/common/components/tax-override-card/index.ts +1 -0
- package/src/routes/tax-regions/common/components/tax-override-card/tax-override-card.tsx +404 -0
- package/src/routes/tax-regions/common/components/tax-override-table/index.ts +1 -0
- package/src/routes/tax-regions/common/components/tax-override-table/tax-override-table.tsx +119 -0
- package/src/routes/tax-regions/common/components/tax-rate-line/index.ts +1 -0
- package/src/routes/tax-regions/common/components/tax-rate-line/tax-rate-line.tsx +82 -0
- package/src/routes/tax-regions/common/components/tax-region-card/index.ts +1 -0
- package/src/routes/tax-regions/common/components/tax-region-card/tax-region-card.tsx +218 -0
- package/src/routes/tax-regions/common/components/tax-region-table/index.ts +1 -0
- package/src/routes/tax-regions/common/components/tax-region-table/tax-region-table.tsx +122 -0
- package/src/routes/tax-regions/common/constants.ts +8 -0
- package/src/routes/tax-regions/common/hooks/use-tax-override-table.tsx +92 -0
- package/src/routes/tax-regions/common/hooks/use-tax-region-table.tsx +92 -0
- package/src/routes/tax-regions/common/hooks.ts +79 -0
- package/src/routes/tax-regions/common/schemas.ts +16 -0
- package/src/routes/tax-regions/common/utils.ts +12 -0
- package/src/routes/tax-regions/tax-region-create/components/tax-region-create-form/index.ts +1 -0
- package/src/routes/tax-regions/tax-region-create/components/tax-region-create-form/tax-region-create-form.tsx +276 -0
- package/src/routes/tax-regions/tax-region-create/index.ts +3 -0
- package/src/routes/tax-regions/tax-region-create/tax-region-create.tsx +10 -0
- package/src/routes/tax-regions/tax-region-detail/breadcrumb.tsx +29 -0
- package/src/routes/tax-regions/tax-region-detail/components/index.ts +2 -0
- package/src/routes/tax-regions/tax-region-detail/components/tax-region-detail-section/index.ts +1 -0
- package/src/routes/tax-regions/tax-region-detail/components/tax-region-detail-section/tax-region-detail-section.tsx +41 -0
- package/src/routes/tax-regions/tax-region-detail/components/tax-region-override-section/index.ts +1 -0
- package/src/routes/tax-regions/tax-region-detail/components/tax-region-override-section/tax-region-override-section.tsx +66 -0
- package/src/routes/tax-regions/tax-region-detail/components/tax-region-province-section/index.ts +1 -0
- package/src/routes/tax-regions/tax-region-detail/components/tax-region-province-section/tax-region-province-section.tsx +72 -0
- package/src/routes/tax-regions/tax-region-detail/components/tax-region-sublevel-alert/index.ts +1 -0
- package/src/routes/tax-regions/tax-region-detail/components/tax-region-sublevel-alert/tax-region-sublevel-alert.tsx +62 -0
- package/src/routes/tax-regions/tax-region-detail/index.ts +5 -0
- package/src/routes/tax-regions/tax-region-detail/loader.ts +16 -0
- package/src/routes/tax-regions/tax-region-detail/tax-region-detail.tsx +65 -0
- package/src/routes/tax-regions/tax-region-detail/tax-region-provider-section/index.ts +1 -0
- package/src/routes/tax-regions/tax-region-detail/tax-region-provider-section/tax-region-provider-section.tsx +28 -0
- package/src/routes/tax-regions/tax-region-edit/components/tax-region-edit/index.ts +1 -0
- package/src/routes/tax-regions/tax-region-edit/components/tax-region-edit/tax-region-edit-form.tsx +109 -0
- package/src/routes/tax-regions/tax-region-edit/index.ts +1 -0
- package/src/routes/tax-regions/tax-region-edit/tax-region-edit.tsx +33 -0
- package/src/routes/tax-regions/tax-region-list/components/tax-region-list-view/index.ts +1 -0
- package/src/routes/tax-regions/tax-region-list/components/tax-region-list-view/tax-region-list-view.tsx +58 -0
- package/src/routes/tax-regions/tax-region-list/index.ts +1 -0
- package/src/routes/tax-regions/tax-region-list/tax-region-list.tsx +19 -0
- package/src/routes/tax-regions/tax-region-metadata/index.ts +1 -0
- package/src/routes/tax-regions/tax-region-metadata/tax-region-metadata.tsx +31 -0
- package/src/routes/tax-regions/tax-region-province-create/components/tax-region-province-create-form/index.ts +1 -0
- package/src/routes/tax-regions/tax-region-province-create/components/tax-region-province-create-form/tax-region-province-create-form.tsx +249 -0
- package/src/routes/tax-regions/tax-region-province-create/index.ts +3 -0
- package/src/routes/tax-regions/tax-region-province-create/tax-region-province-create.tsx +22 -0
- package/src/routes/tax-regions/tax-region-province-detail/breadcrumb.tsx +32 -0
- package/src/routes/tax-regions/tax-region-province-detail/components/index.ts +2 -0
- package/src/routes/tax-regions/tax-region-province-detail/components/tax-region-province-detail-section/index.ts +1 -0
- package/src/routes/tax-regions/tax-region-province-detail/components/tax-region-province-detail-section/tax-region-detail-section.tsx +42 -0
- package/src/routes/tax-regions/tax-region-province-detail/components/tax-region-province-override-section/index.ts +1 -0
- package/src/routes/tax-regions/tax-region-province-detail/components/tax-region-province-override-section/tax-region-province-override-section.tsx +65 -0
- package/src/routes/tax-regions/tax-region-province-detail/index.ts +5 -0
- package/src/routes/tax-regions/tax-region-province-detail/loader.ts +16 -0
- package/src/routes/tax-regions/tax-region-province-detail/tax-region-detail.tsx +49 -0
- package/src/routes/tax-regions/tax-region-tax-override-create/components/tax-region-override-create-form/index.ts +1 -0
- package/src/routes/tax-regions/tax-region-tax-override-create/components/tax-region-override-create-form/tax-region-tax-override-create.tsx +675 -0
- package/src/routes/tax-regions/tax-region-tax-override-create/index.ts +1 -0
- package/src/routes/tax-regions/tax-region-tax-override-create/tax-region-tax-override-create.tsx +24 -0
- package/src/routes/tax-regions/tax-region-tax-override-edit/components/tax-region-tax-override-edit-form/index.ts +1 -0
- package/src/routes/tax-regions/tax-region-tax-override-edit/components/tax-region-tax-override-edit-form/tax-region-tax-override-edit-form.tsx +652 -0
- package/src/routes/tax-regions/tax-region-tax-override-edit/index.ts +1 -0
- package/src/routes/tax-regions/tax-region-tax-override-edit/tax-region-tax-override-edit.tsx +211 -0
- package/src/routes/tax-regions/tax-region-tax-override-edit/types.ts +11 -0
- package/src/routes/tax-regions/tax-region-tax-rate-create/components/tax-region-tax-rate-create-form/index.ts +1 -0
- package/src/routes/tax-regions/tax-region-tax-rate-create/components/tax-region-tax-rate-create-form/tax-region-tax-rate-create-form.tsx +180 -0
- package/src/routes/tax-regions/tax-region-tax-rate-create/index.ts +1 -0
- package/src/routes/tax-regions/tax-region-tax-rate-create/tax-region-tax-rate-create.tsx +29 -0
- package/src/routes/tax-regions/tax-region-tax-rate-edit/components/tax-region-tax-rate-edit-form/index.ts +1 -0
- package/src/routes/tax-regions/tax-region-tax-rate-edit/components/tax-region-tax-rate-edit-form/tax-region-tax-rate-edit-form.tsx +159 -0
- package/src/routes/tax-regions/tax-region-tax-rate-edit/index.ts +1 -0
- package/src/routes/tax-regions/tax-region-tax-rate-edit/tax-region-edit.tsx +38 -0
- package/src/routes/translations/add-locales/add-locales.tsx +29 -0
- package/src/routes/translations/add-locales/index.tsx +1 -0
- package/src/routes/translations/settings/components/batch-translation-settings-form/batch-translation-settings-form.tsx +246 -0
- package/src/routes/translations/settings/components/entity-selector-tree/entity-selector-tree.tsx +288 -0
- package/src/routes/translations/settings/components/selector-tree-filter/selector-tree-filter.tsx +88 -0
- package/src/routes/translations/settings/index.tsx +2 -0
- package/src/routes/translations/settings/settings.tsx +35 -0
- package/src/routes/translations/translation-list/components/active-locales-section/active-locales-section.tsx +85 -0
- package/src/routes/translations/translation-list/components/translation-list-section/translation-list-section.tsx +48 -0
- package/src/routes/translations/translation-list/components/translations-completion-section/translations-completion-section.tsx +285 -0
- package/src/routes/translations/translation-list/index.tsx +1 -0
- package/src/routes/translations/translation-list/translation-list.tsx +188 -0
- package/src/routes/translations/translations-edit/components/translations-edit-form/index.ts +1 -0
- package/src/routes/translations/translations-edit/components/translations-edit-form/translations-edit-form.tsx +747 -0
- package/src/routes/translations/translations-edit/index.ts +1 -0
- package/src/routes/translations/translations-edit/translations-edit.tsx +85 -0
- package/src/routes/users/user-detail/breadcrumb.tsx +24 -0
- package/src/routes/users/user-detail/components/user-general-section/index.ts +1 -0
- package/src/routes/users/user-detail/components/user-general-section/user-general-section.tsx +86 -0
- package/src/routes/users/user-detail/index.ts +3 -0
- package/src/routes/users/user-detail/loader.ts +17 -0
- package/src/routes/users/user-detail/user-detail.tsx +47 -0
- package/src/routes/users/user-edit/components/edit-user-form/edit-user-form.tsx +97 -0
- package/src/routes/users/user-edit/components/edit-user-form/index.ts +1 -0
- package/src/routes/users/user-edit/index.ts +1 -0
- package/src/routes/users/user-edit/user-edit.tsx +25 -0
- package/src/routes/users/user-invite/components/invite-user-form/invite-user-form.tsx +345 -0
- package/src/routes/users/user-invite/index.ts +1 -0
- package/src/routes/users/user-invite/user-invite.tsx +10 -0
- package/src/routes/users/user-list/components/user-list-table/index.ts +1 -0
- package/src/routes/users/user-list/components/user-list-table/user-list-table.tsx +131 -0
- package/src/routes/users/user-list/index.ts +1 -0
- package/src/routes/users/user-list/user-list.tsx +18 -0
- package/src/routes/users/user-metadata/index.ts +1 -0
- package/src/routes/users/user-metadata/user-metadata.tsx +27 -0
- package/src/routes/workflow-executions/constants.ts +38 -0
- package/src/routes/workflow-executions/types.ts +28 -0
- package/src/routes/workflow-executions/utils.ts +103 -0
- package/src/routes/workflow-executions/workflow-execution-detail/breadcrumb.tsx +26 -0
- package/src/routes/workflow-executions/workflow-execution-detail/components/workflow-execution-general-section/index.ts +1 -0
- package/src/routes/workflow-executions/workflow-execution-detail/components/workflow-execution-general-section/workflow-execution-general-section.tsx +120 -0
- package/src/routes/workflow-executions/workflow-execution-detail/components/workflow-execution-history-section/index.ts +1 -0
- package/src/routes/workflow-executions/workflow-execution-detail/components/workflow-execution-history-section/workflow-execution-history-section.tsx +334 -0
- package/src/routes/workflow-executions/workflow-execution-detail/components/workflow-execution-payload-section/index.ts +1 -0
- package/src/routes/workflow-executions/workflow-execution-detail/components/workflow-execution-payload-section/workflow-execution-payload-section.tsx +24 -0
- package/src/routes/workflow-executions/workflow-execution-detail/components/workflow-execution-timeline-section/index.ts +1 -0
- package/src/routes/workflow-executions/workflow-execution-detail/components/workflow-execution-timeline-section/workflow-execution-timeline-section.tsx +446 -0
- package/src/routes/workflow-executions/workflow-execution-detail/index.ts +3 -0
- package/src/routes/workflow-executions/workflow-execution-detail/loader.ts +19 -0
- package/src/routes/workflow-executions/workflow-execution-detail/workflow-detail.tsx +43 -0
- package/src/routes/workflow-executions/workflow-execution-list/components/workflow-execution-list-table/index.ts +1 -0
- package/src/routes/workflow-executions/workflow-execution-list/components/workflow-execution-list-table/use-workflow-execution-table-columns.tsx +72 -0
- package/src/routes/workflow-executions/workflow-execution-list/components/workflow-execution-list-table/use-workflow-execution-table-query.tsx +25 -0
- package/src/routes/workflow-executions/workflow-execution-list/components/workflow-execution-list-table/workflow-execution-list-table.tsx +69 -0
- package/src/routes/workflow-executions/workflow-execution-list/index.ts +1 -0
- package/src/routes/workflow-executions/workflow-execution-list/workflow-execution-list.tsx +20 -0
- package/src/utils/column-utils.ts +71 -0
- package/src/vite-env.d.ts +20 -0
|
@@ -0,0 +1,3553 @@
|
|
|
1
|
+
import {
|
|
2
|
+
By
|
|
3
|
+
} from "./chunk-LZX5TJ65.mjs";
|
|
4
|
+
import "./chunk-PYIO3TDQ.mjs";
|
|
5
|
+
import {
|
|
6
|
+
formatPercentage
|
|
7
|
+
} from "./chunk-4FM6S5CX.mjs";
|
|
8
|
+
import {
|
|
9
|
+
useCancelClaim,
|
|
10
|
+
useCancelClaimRequest,
|
|
11
|
+
useClaims
|
|
12
|
+
} from "./chunk-6T6CP246.mjs";
|
|
13
|
+
import {
|
|
14
|
+
useCancelExchange,
|
|
15
|
+
useCancelExchangeRequest,
|
|
16
|
+
useExchanges
|
|
17
|
+
} from "./chunk-EZGBAGIR.mjs";
|
|
18
|
+
import {
|
|
19
|
+
useCancelOrderEdit,
|
|
20
|
+
useConfirmOrderEdit
|
|
21
|
+
} from "./chunk-PEZUM4LH.mjs";
|
|
22
|
+
import {
|
|
23
|
+
getLoyaltyPlugin
|
|
24
|
+
} from "./chunk-DHF3B6D2.mjs";
|
|
25
|
+
import {
|
|
26
|
+
formatProvider
|
|
27
|
+
} from "./chunk-IR5DHEKS.mjs";
|
|
28
|
+
import {
|
|
29
|
+
formatCurrency
|
|
30
|
+
} from "./chunk-WATKBUHQ.mjs";
|
|
31
|
+
import {
|
|
32
|
+
getPaymentsFromOrder,
|
|
33
|
+
getReservationsLimitCount
|
|
34
|
+
} from "./chunk-4XSXVVYD.mjs";
|
|
35
|
+
import {
|
|
36
|
+
getReturnableQuantity
|
|
37
|
+
} from "./chunk-PXZ7QYKX.mjs";
|
|
38
|
+
import {
|
|
39
|
+
DEFAULT_FIELDS
|
|
40
|
+
} from "./chunk-C7F7MMXS.mjs";
|
|
41
|
+
import {
|
|
42
|
+
useCancelReturn,
|
|
43
|
+
useCancelReturnRequest,
|
|
44
|
+
useReturns
|
|
45
|
+
} from "./chunk-3TAD7FW4.mjs";
|
|
46
|
+
import {
|
|
47
|
+
getCanceledOrderStatus,
|
|
48
|
+
getOrderFulfillmentStatus,
|
|
49
|
+
getOrderPaymentStatus
|
|
50
|
+
} from "./chunk-NTEWUH4C.mjs";
|
|
51
|
+
import {
|
|
52
|
+
getLocaleAmount,
|
|
53
|
+
getStylizedAmount,
|
|
54
|
+
isAmountLessThenRoundingError
|
|
55
|
+
} from "./chunk-X6BAAGCL.mjs";
|
|
56
|
+
import "./chunk-DK4WIVY6.mjs";
|
|
57
|
+
import {
|
|
58
|
+
getFormattedAddress,
|
|
59
|
+
isSameAddress
|
|
60
|
+
} from "./chunk-B6ZOPCPA.mjs";
|
|
61
|
+
import {
|
|
62
|
+
TwoColumnPage
|
|
63
|
+
} from "./chunk-22YYMH6M.mjs";
|
|
64
|
+
import {
|
|
65
|
+
useDate
|
|
66
|
+
} from "./chunk-DFFLVEZ5.mjs";
|
|
67
|
+
import {
|
|
68
|
+
Thumbnail
|
|
69
|
+
} from "./chunk-CQWBG33R.mjs";
|
|
70
|
+
import "./chunk-DG7J63J2.mjs";
|
|
71
|
+
import {
|
|
72
|
+
useExtension
|
|
73
|
+
} from "./chunk-C5P5PL3E.mjs";
|
|
74
|
+
import {
|
|
75
|
+
Skeleton,
|
|
76
|
+
TwoColumnPageSkeleton
|
|
77
|
+
} from "./chunk-YWU55M6Z.mjs";
|
|
78
|
+
import {
|
|
79
|
+
ActionMenu
|
|
80
|
+
} from "./chunk-S3REQHPQ.mjs";
|
|
81
|
+
import "./chunk-OAHCJFG3.mjs";
|
|
82
|
+
import "./chunk-S4DMV3ZT.mjs";
|
|
83
|
+
import "./chunk-535OVBXR.mjs";
|
|
84
|
+
import {
|
|
85
|
+
useCapturePayment,
|
|
86
|
+
useMarkPaymentCollectionAsPaid,
|
|
87
|
+
usePlugins
|
|
88
|
+
} from "./chunk-BD3XDAG5.mjs";
|
|
89
|
+
import "./chunk-GBFVWROS.mjs";
|
|
90
|
+
import "./chunk-ULSPL3DR.mjs";
|
|
91
|
+
import "./chunk-V7OUZM56.mjs";
|
|
92
|
+
import "./chunk-GF7N2AY2.mjs";
|
|
93
|
+
import "./chunk-LKWTBYYC.mjs";
|
|
94
|
+
import "./chunk-YF6NQZGM.mjs";
|
|
95
|
+
import "./chunk-PB5SVVN2.mjs";
|
|
96
|
+
import "./chunk-HVQIZLNB.mjs";
|
|
97
|
+
import "./chunk-WJ4YB5O4.mjs";
|
|
98
|
+
import "./chunk-W4OT76ZB.mjs";
|
|
99
|
+
import "./chunk-XIM7X4FB.mjs";
|
|
100
|
+
import "./chunk-UVPCTLA2.mjs";
|
|
101
|
+
import "./chunk-4UTXEJBF.mjs";
|
|
102
|
+
import {
|
|
103
|
+
useCustomer
|
|
104
|
+
} from "./chunk-BBP7EYBG.mjs";
|
|
105
|
+
import "./chunk-ZFCG2354.mjs";
|
|
106
|
+
import "./chunk-LEYWBRRG.mjs";
|
|
107
|
+
import "./chunk-2PCPX3L2.mjs";
|
|
108
|
+
import {
|
|
109
|
+
ordersQueryKeys,
|
|
110
|
+
useCancelOrder,
|
|
111
|
+
useCancelOrderFulfillment,
|
|
112
|
+
useCancelOrderTransfer,
|
|
113
|
+
useMarkOrderFulfillmentAsDelivered,
|
|
114
|
+
useOrder,
|
|
115
|
+
useOrderChanges,
|
|
116
|
+
useOrderLineItems,
|
|
117
|
+
useOrderPreview
|
|
118
|
+
} from "./chunk-XJYL2XTV.mjs";
|
|
119
|
+
import {
|
|
120
|
+
useReservationItems
|
|
121
|
+
} from "./chunk-DXWAKJTM.mjs";
|
|
122
|
+
import {
|
|
123
|
+
useStockLocation
|
|
124
|
+
} from "./chunk-XP4VHZBM.mjs";
|
|
125
|
+
import "./chunk-JQ67EF5F.mjs";
|
|
126
|
+
import "./chunk-QVJ6Q4XS.mjs";
|
|
127
|
+
import "./chunk-I2GUUJVE.mjs";
|
|
128
|
+
import "./chunk-QZ5QAA5L.mjs";
|
|
129
|
+
import "./chunk-7M2A645H.mjs";
|
|
130
|
+
import "./chunk-NPOS27VN.mjs";
|
|
131
|
+
import "./chunk-452UKZW6.mjs";
|
|
132
|
+
import "./chunk-7AXHHXCX.mjs";
|
|
133
|
+
import {
|
|
134
|
+
queryClient
|
|
135
|
+
} from "./chunk-FXYH54JP.mjs";
|
|
136
|
+
import "./chunk-774WSTCC.mjs";
|
|
137
|
+
import {
|
|
138
|
+
sdk
|
|
139
|
+
} from "./chunk-DTY37DDZ.mjs";
|
|
140
|
+
import "./chunk-QZ7TP4HQ.mjs";
|
|
141
|
+
|
|
142
|
+
// src/routes/orders/order-detail/breadcrumb.tsx
|
|
143
|
+
import { jsxs } from "react/jsx-runtime";
|
|
144
|
+
var OrderDetailBreadcrumb = (props) => {
|
|
145
|
+
const { id } = props.params || {};
|
|
146
|
+
const { order } = useOrder(
|
|
147
|
+
id,
|
|
148
|
+
{
|
|
149
|
+
fields: DEFAULT_FIELDS
|
|
150
|
+
},
|
|
151
|
+
{
|
|
152
|
+
initialData: props.data,
|
|
153
|
+
enabled: Boolean(id)
|
|
154
|
+
}
|
|
155
|
+
);
|
|
156
|
+
if (!order) {
|
|
157
|
+
return null;
|
|
158
|
+
}
|
|
159
|
+
return /* @__PURE__ */ jsxs("span", { children: [
|
|
160
|
+
"#",
|
|
161
|
+
order.display_id
|
|
162
|
+
] });
|
|
163
|
+
};
|
|
164
|
+
|
|
165
|
+
// src/routes/orders/order-detail/loader.ts
|
|
166
|
+
var orderDetailQuery = (id) => ({
|
|
167
|
+
queryKey: ordersQueryKeys.detail(id),
|
|
168
|
+
queryFn: async () => sdk.admin.order.retrieve(id, {
|
|
169
|
+
fields: DEFAULT_FIELDS
|
|
170
|
+
})
|
|
171
|
+
});
|
|
172
|
+
var orderLoader = async ({ params }) => {
|
|
173
|
+
const id = params.id;
|
|
174
|
+
const query = orderDetailQuery(id);
|
|
175
|
+
return queryClient.ensureQueryData(query);
|
|
176
|
+
};
|
|
177
|
+
|
|
178
|
+
// src/routes/orders/order-detail/order-detail.tsx
|
|
179
|
+
import { useLoaderData, useParams } from "react-router-dom";
|
|
180
|
+
|
|
181
|
+
// src/routes/orders/order-detail/components/active-order-claim-section/active-order-claim-section.tsx
|
|
182
|
+
import { ExclamationCircle } from "@acmekit/icons";
|
|
183
|
+
import { Button, Container, Heading, Text, toast } from "@acmekit/ui";
|
|
184
|
+
import { useTranslation } from "react-i18next";
|
|
185
|
+
import { useNavigate } from "react-router-dom";
|
|
186
|
+
import { jsx, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
187
|
+
var ActiveOrderClaimSection = ({
|
|
188
|
+
orderPreview
|
|
189
|
+
}) => {
|
|
190
|
+
const { t } = useTranslation();
|
|
191
|
+
const claimId = orderPreview?.order_change?.claim_id;
|
|
192
|
+
const { mutateAsync: cancelClaim } = useCancelClaimRequest(
|
|
193
|
+
claimId,
|
|
194
|
+
orderPreview.id
|
|
195
|
+
);
|
|
196
|
+
const navigate = useNavigate();
|
|
197
|
+
const onContinueClaim = async () => {
|
|
198
|
+
navigate(`/orders/${orderPreview.id}/claims`);
|
|
199
|
+
};
|
|
200
|
+
const onCancelClaim = async () => {
|
|
201
|
+
await cancelClaim(void 0, {
|
|
202
|
+
onSuccess: () => {
|
|
203
|
+
toast.success(t("orders.claims.toast.canceledSuccessfully"));
|
|
204
|
+
},
|
|
205
|
+
onError: (error) => {
|
|
206
|
+
toast.error(error.message);
|
|
207
|
+
}
|
|
208
|
+
});
|
|
209
|
+
};
|
|
210
|
+
if (!claimId) {
|
|
211
|
+
return;
|
|
212
|
+
}
|
|
213
|
+
return /* @__PURE__ */ jsx(
|
|
214
|
+
"div",
|
|
215
|
+
{
|
|
216
|
+
style: {
|
|
217
|
+
background: "repeating-linear-gradient(-45deg, rgb(212, 212, 216, 0.15), rgb(212, 212, 216,.15) 10px, transparent 10px, transparent 20px)"
|
|
218
|
+
},
|
|
219
|
+
className: "-m-4 mb-1 border-b border-l p-4",
|
|
220
|
+
children: /* @__PURE__ */ jsx(Container, { className: "flex items-center justify-between p-0", children: /* @__PURE__ */ jsxs2("div", { className: "flex w-full flex-row justify-between", children: [
|
|
221
|
+
/* @__PURE__ */ jsxs2("div", { children: [
|
|
222
|
+
/* @__PURE__ */ jsxs2("div", { className: "mb-2 flex items-center gap-2 px-6 pt-4", children: [
|
|
223
|
+
/* @__PURE__ */ jsx(ExclamationCircle, { className: "text-ui-fg-subtle" }),
|
|
224
|
+
/* @__PURE__ */ jsx(Heading, { level: "h2", children: t("orders.claims.panel.title") })
|
|
225
|
+
] }),
|
|
226
|
+
/* @__PURE__ */ jsx("div", { className: "gap-2 px-6 pb-4", children: /* @__PURE__ */ jsx(Text, { children: t("orders.claims.panel.description") }) })
|
|
227
|
+
] }),
|
|
228
|
+
/* @__PURE__ */ jsxs2("div", { className: "flex items-center justify-end gap-x-2 rounded-b-xl px-4 py-4", children: [
|
|
229
|
+
/* @__PURE__ */ jsx(Button, { size: "small", variant: "secondary", onClick: onCancelClaim, children: t("orders.claims.cancel.title") }),
|
|
230
|
+
/* @__PURE__ */ jsx(Button, { size: "small", variant: "secondary", onClick: onContinueClaim, children: t("actions.continue") })
|
|
231
|
+
] })
|
|
232
|
+
] }) })
|
|
233
|
+
}
|
|
234
|
+
);
|
|
235
|
+
};
|
|
236
|
+
|
|
237
|
+
// src/routes/orders/order-detail/components/active-order-exchange-section/active-order-exchange-section.tsx
|
|
238
|
+
import { ArrowPath } from "@acmekit/icons";
|
|
239
|
+
import { Button as Button2, Container as Container2, Heading as Heading2, Text as Text2, toast as toast2 } from "@acmekit/ui";
|
|
240
|
+
import { useTranslation as useTranslation2 } from "react-i18next";
|
|
241
|
+
import { useNavigate as useNavigate2 } from "react-router-dom";
|
|
242
|
+
import { jsx as jsx2, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
243
|
+
var ActiveOrderExchangeSection = ({
|
|
244
|
+
orderPreview
|
|
245
|
+
}) => {
|
|
246
|
+
const { t } = useTranslation2();
|
|
247
|
+
const exchangeId = orderPreview?.order_change?.exchange_id;
|
|
248
|
+
const { mutateAsync: cancelExchange } = useCancelExchangeRequest(
|
|
249
|
+
exchangeId,
|
|
250
|
+
orderPreview.id
|
|
251
|
+
);
|
|
252
|
+
const navigate = useNavigate2();
|
|
253
|
+
const onContinueExchange = async () => {
|
|
254
|
+
navigate(`/orders/${orderPreview.id}/exchanges`);
|
|
255
|
+
};
|
|
256
|
+
const onCancelExchange = async () => {
|
|
257
|
+
await cancelExchange(void 0, {
|
|
258
|
+
onSuccess: () => {
|
|
259
|
+
toast2.success(t("orders.exchanges.toast.canceledSuccessfully"));
|
|
260
|
+
},
|
|
261
|
+
onError: (error) => {
|
|
262
|
+
toast2.error(error.message);
|
|
263
|
+
}
|
|
264
|
+
});
|
|
265
|
+
};
|
|
266
|
+
if (!exchangeId) {
|
|
267
|
+
return;
|
|
268
|
+
}
|
|
269
|
+
return /* @__PURE__ */ jsx2(
|
|
270
|
+
"div",
|
|
271
|
+
{
|
|
272
|
+
style: {
|
|
273
|
+
background: "repeating-linear-gradient(-45deg, rgb(212, 212, 216, 0.15), rgb(212, 212, 216,.15) 10px, transparent 10px, transparent 20px)"
|
|
274
|
+
},
|
|
275
|
+
className: "-m-4 mb-1 border-b border-l p-4",
|
|
276
|
+
children: /* @__PURE__ */ jsx2(Container2, { className: "flex items-center justify-between p-0", children: /* @__PURE__ */ jsxs3("div", { className: "flex w-full flex-row justify-between", children: [
|
|
277
|
+
/* @__PURE__ */ jsxs3("div", { children: [
|
|
278
|
+
/* @__PURE__ */ jsxs3("div", { className: "mb-2 flex items-center gap-2 px-6 pt-4", children: [
|
|
279
|
+
/* @__PURE__ */ jsx2(ArrowPath, { className: "text-ui-fg-subtle" }),
|
|
280
|
+
/* @__PURE__ */ jsx2(Heading2, { level: "h2", children: t("orders.exchanges.panel.title") })
|
|
281
|
+
] }),
|
|
282
|
+
/* @__PURE__ */ jsx2("div", { className: "gap-2 px-6 pb-4", children: /* @__PURE__ */ jsx2(Text2, { children: t("orders.exchanges.panel.description") }) })
|
|
283
|
+
] }),
|
|
284
|
+
/* @__PURE__ */ jsxs3("div", { className: "flex items-center justify-end gap-x-2 rounded-b-xl px-4 py-4", children: [
|
|
285
|
+
/* @__PURE__ */ jsx2(Button2, { size: "small", variant: "secondary", onClick: onCancelExchange, children: t("orders.exchanges.cancel.title") }),
|
|
286
|
+
/* @__PURE__ */ jsx2(
|
|
287
|
+
Button2,
|
|
288
|
+
{
|
|
289
|
+
size: "small",
|
|
290
|
+
variant: "secondary",
|
|
291
|
+
onClick: onContinueExchange,
|
|
292
|
+
children: t("actions.continue")
|
|
293
|
+
}
|
|
294
|
+
)
|
|
295
|
+
] })
|
|
296
|
+
] }) })
|
|
297
|
+
}
|
|
298
|
+
);
|
|
299
|
+
};
|
|
300
|
+
|
|
301
|
+
// src/routes/orders/order-detail/components/active-order-return-section/active-order-return-section.tsx
|
|
302
|
+
import { ArrowUturnLeft } from "@acmekit/icons";
|
|
303
|
+
import { Button as Button3, Container as Container3, Heading as Heading3, Text as Text3, toast as toast3 } from "@acmekit/ui";
|
|
304
|
+
import { useTranslation as useTranslation3 } from "react-i18next";
|
|
305
|
+
import { useNavigate as useNavigate3 } from "react-router-dom";
|
|
306
|
+
import { jsx as jsx3, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
307
|
+
var ActiveOrderReturnSection = ({
|
|
308
|
+
orderPreview
|
|
309
|
+
}) => {
|
|
310
|
+
const { t } = useTranslation3();
|
|
311
|
+
const orderChange = orderPreview?.order_change;
|
|
312
|
+
const returnId = orderChange?.return_id;
|
|
313
|
+
const isReturnRequest = orderChange?.change_type === "return_request" && !!orderChange.return_id;
|
|
314
|
+
const { mutateAsync: cancelReturn } = useCancelReturnRequest(
|
|
315
|
+
returnId,
|
|
316
|
+
orderPreview.id
|
|
317
|
+
);
|
|
318
|
+
const navigate = useNavigate3();
|
|
319
|
+
const onContinueReturn = async () => {
|
|
320
|
+
navigate(`/orders/${orderPreview.id}/returns`);
|
|
321
|
+
};
|
|
322
|
+
const onCancelReturn = async () => {
|
|
323
|
+
await cancelReturn(void 0, {
|
|
324
|
+
onSuccess: () => {
|
|
325
|
+
toast3.success(t("orders.returns.toast.canceledSuccessfully"));
|
|
326
|
+
},
|
|
327
|
+
onError: (error) => {
|
|
328
|
+
toast3.error(error.message);
|
|
329
|
+
}
|
|
330
|
+
});
|
|
331
|
+
};
|
|
332
|
+
if (!returnId || !isReturnRequest) {
|
|
333
|
+
return;
|
|
334
|
+
}
|
|
335
|
+
return /* @__PURE__ */ jsx3(
|
|
336
|
+
"div",
|
|
337
|
+
{
|
|
338
|
+
style: {
|
|
339
|
+
background: "repeating-linear-gradient(-45deg, rgb(212, 212, 216, 0.15), rgb(212, 212, 216,.15) 10px, transparent 10px, transparent 20px)"
|
|
340
|
+
},
|
|
341
|
+
className: "-m-4 mb-1 border-b border-l p-4",
|
|
342
|
+
children: /* @__PURE__ */ jsx3(Container3, { className: "flex items-center justify-between p-0", children: /* @__PURE__ */ jsxs4("div", { className: "flex w-full flex-row justify-between", children: [
|
|
343
|
+
/* @__PURE__ */ jsxs4("div", { children: [
|
|
344
|
+
/* @__PURE__ */ jsxs4("div", { className: "mb-2 flex items-center gap-2 px-6 pt-4", children: [
|
|
345
|
+
/* @__PURE__ */ jsx3(ArrowUturnLeft, { className: "text-ui-fg-subtle" }),
|
|
346
|
+
/* @__PURE__ */ jsx3(Heading3, { level: "h2", children: t("orders.returns.panel.title") })
|
|
347
|
+
] }),
|
|
348
|
+
/* @__PURE__ */ jsx3("div", { className: "gap-2 px-6 pb-4", children: /* @__PURE__ */ jsx3(Text3, { children: t("orders.returns.panel.description") }) })
|
|
349
|
+
] }),
|
|
350
|
+
/* @__PURE__ */ jsxs4("div", { className: "flex items-center justify-end gap-x-2 rounded-b-xl px-4 py-4", children: [
|
|
351
|
+
/* @__PURE__ */ jsx3(Button3, { size: "small", variant: "secondary", onClick: onCancelReturn, children: t("orders.returns.cancel.title") }),
|
|
352
|
+
/* @__PURE__ */ jsx3(Button3, { size: "small", variant: "secondary", onClick: onContinueReturn, children: t("actions.continue") })
|
|
353
|
+
] })
|
|
354
|
+
] }) })
|
|
355
|
+
}
|
|
356
|
+
);
|
|
357
|
+
};
|
|
358
|
+
|
|
359
|
+
// src/routes/orders/order-detail/components/order-active-edit-section/order-active-edit-section.tsx
|
|
360
|
+
import { Button as Button4, Container as Container4, Copy, Heading as Heading4, toast as toast4 } from "@acmekit/ui";
|
|
361
|
+
import { useTranslation as useTranslation4 } from "react-i18next";
|
|
362
|
+
import { ExclamationCircleSolid } from "@acmekit/icons";
|
|
363
|
+
import { useMemo } from "react";
|
|
364
|
+
import { useNavigate as useNavigate4 } from "react-router-dom";
|
|
365
|
+
import { jsx as jsx4, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
366
|
+
function EditItem({
|
|
367
|
+
item,
|
|
368
|
+
quantity
|
|
369
|
+
}) {
|
|
370
|
+
return /* @__PURE__ */ jsx4("div", { className: "text-ui-fg-subtle items-center gap-x-2", children: /* @__PURE__ */ jsxs5("div", { className: "flex items-center gap-x-2", children: [
|
|
371
|
+
/* @__PURE__ */ jsxs5("div", { className: "w-fit min-w-[27px]", children: [
|
|
372
|
+
/* @__PURE__ */ jsx4("span", { className: "txt-small tabular-nums", children: quantity }),
|
|
373
|
+
"x"
|
|
374
|
+
] }),
|
|
375
|
+
/* @__PURE__ */ jsx4(Thumbnail, { src: item.thumbnail }),
|
|
376
|
+
/* @__PURE__ */ jsx4("span", { className: "txt-small text-ui-fg-subtle font-medium", children: item.title }),
|
|
377
|
+
item.variant_sku && " \xB7 ",
|
|
378
|
+
item.variant_sku && /* @__PURE__ */ jsxs5("div", { className: "flex items-center gap-x-1", children: [
|
|
379
|
+
/* @__PURE__ */ jsx4("span", { className: "txt-small", children: item.variant_sku }),
|
|
380
|
+
/* @__PURE__ */ jsx4(Copy, { content: item.variant_sku, className: "text-ui-fg-muted" })
|
|
381
|
+
] })
|
|
382
|
+
] }) }, item.id);
|
|
383
|
+
}
|
|
384
|
+
var OrderActiveEditSection = ({
|
|
385
|
+
order
|
|
386
|
+
}) => {
|
|
387
|
+
const { t } = useTranslation4();
|
|
388
|
+
const navigate = useNavigate4();
|
|
389
|
+
const { order: orderPreview } = useOrderPreview(order.id);
|
|
390
|
+
const { mutateAsync: cancelOrderEdit } = useCancelOrderEdit(order.id);
|
|
391
|
+
const { mutateAsync: confirmOrderEdit } = useConfirmOrderEdit(order.id);
|
|
392
|
+
const isPending = orderPreview.order_change?.status === "pending";
|
|
393
|
+
const [addedItems, removedItems] = useMemo(() => {
|
|
394
|
+
const added = [];
|
|
395
|
+
const removed = [];
|
|
396
|
+
const orderLookupMap = new Map(order.items.map((i) => [i.id, i]));
|
|
397
|
+
(orderPreview?.items || []).forEach((currentItem) => {
|
|
398
|
+
const originalItem = orderLookupMap.get(currentItem.id);
|
|
399
|
+
if (!originalItem) {
|
|
400
|
+
added.push({ item: currentItem, quantity: currentItem.quantity });
|
|
401
|
+
return;
|
|
402
|
+
}
|
|
403
|
+
if (originalItem.quantity > currentItem.quantity) {
|
|
404
|
+
removed.push({
|
|
405
|
+
item: currentItem,
|
|
406
|
+
quantity: originalItem.quantity - currentItem.quantity
|
|
407
|
+
});
|
|
408
|
+
}
|
|
409
|
+
if (originalItem.quantity < currentItem.quantity) {
|
|
410
|
+
added.push({
|
|
411
|
+
item: currentItem,
|
|
412
|
+
quantity: currentItem.quantity - originalItem.quantity
|
|
413
|
+
});
|
|
414
|
+
}
|
|
415
|
+
});
|
|
416
|
+
return [added, removed];
|
|
417
|
+
}, [orderPreview]);
|
|
418
|
+
const onConfirmOrderEdit = async () => {
|
|
419
|
+
try {
|
|
420
|
+
await confirmOrderEdit();
|
|
421
|
+
toast4.success(t("orders.edits.toast.confirmedSuccessfully"));
|
|
422
|
+
} catch (e) {
|
|
423
|
+
toast4.error(e.message);
|
|
424
|
+
}
|
|
425
|
+
};
|
|
426
|
+
const onCancelOrderEdit = async () => {
|
|
427
|
+
try {
|
|
428
|
+
await cancelOrderEdit();
|
|
429
|
+
toast4.success(t("orders.edits.toast.canceledSuccessfully"));
|
|
430
|
+
} catch (e) {
|
|
431
|
+
toast4.error(e.message);
|
|
432
|
+
}
|
|
433
|
+
};
|
|
434
|
+
if (!orderPreview || orderPreview.order_change?.change_type !== "edit") {
|
|
435
|
+
return null;
|
|
436
|
+
}
|
|
437
|
+
return /* @__PURE__ */ jsx4(
|
|
438
|
+
"div",
|
|
439
|
+
{
|
|
440
|
+
style: {
|
|
441
|
+
background: "repeating-linear-gradient(-45deg, rgb(212, 212, 216, 0.15), rgb(212, 212, 216,.15) 10px, transparent 10px, transparent 20px)"
|
|
442
|
+
},
|
|
443
|
+
className: "-m-4 mb-1 border-b border-l p-4",
|
|
444
|
+
children: /* @__PURE__ */ jsx4(Container4, { className: "flex items-center justify-between p-0", children: /* @__PURE__ */ jsxs5("div", { className: "flex w-full flex-col divide-y divide-dashed", children: [
|
|
445
|
+
/* @__PURE__ */ jsxs5("div", { className: "flex items-center gap-2 px-6 py-4", children: [
|
|
446
|
+
/* @__PURE__ */ jsx4(ExclamationCircleSolid, { className: "text-blue-500" }),
|
|
447
|
+
/* @__PURE__ */ jsx4(Heading4, { level: "h2", children: t(
|
|
448
|
+
isPending ? "orders.edits.panel.titlePending" : "orders.edits.panel.title"
|
|
449
|
+
) })
|
|
450
|
+
] }),
|
|
451
|
+
!!addedItems.length && /* @__PURE__ */ jsxs5("div", { className: "txt-small text-ui-fg-subtle flex flex-row px-6 py-4", children: [
|
|
452
|
+
/* @__PURE__ */ jsx4("span", { className: "flex-1 font-medium", children: t("labels.added") }),
|
|
453
|
+
/* @__PURE__ */ jsx4("div", { className: "flex flex-1 flex-col gap-y-2", children: addedItems.map(({ item, quantity }) => /* @__PURE__ */ jsx4(EditItem, { item, quantity }, item.id)) })
|
|
454
|
+
] }),
|
|
455
|
+
!!removedItems.length && /* @__PURE__ */ jsxs5("div", { className: "txt-small text-ui-fg-subtle flex flex-row px-6 py-4", children: [
|
|
456
|
+
/* @__PURE__ */ jsx4("span", { className: "flex-1 font-medium", children: t("labels.removed") }),
|
|
457
|
+
/* @__PURE__ */ jsx4("div", { className: "flex flex-1 flex-col gap-y-2", children: removedItems.map(({ item, quantity }) => /* @__PURE__ */ jsx4(EditItem, { item, quantity }, item.id)) })
|
|
458
|
+
] }),
|
|
459
|
+
/* @__PURE__ */ jsxs5("div", { className: "bg-ui-bg-subtle flex items-center justify-end gap-x-2 rounded-b-xl px-4 py-4", children: [
|
|
460
|
+
isPending ? /* @__PURE__ */ jsx4(
|
|
461
|
+
Button4,
|
|
462
|
+
{
|
|
463
|
+
size: "small",
|
|
464
|
+
variant: "secondary",
|
|
465
|
+
onClick: () => navigate(`/orders/${order.id}/edits`),
|
|
466
|
+
children: t("actions.continueEdit")
|
|
467
|
+
}
|
|
468
|
+
) : /* @__PURE__ */ jsx4(
|
|
469
|
+
Button4,
|
|
470
|
+
{
|
|
471
|
+
size: "small",
|
|
472
|
+
variant: "secondary",
|
|
473
|
+
onClick: onConfirmOrderEdit,
|
|
474
|
+
children: t("actions.forceConfirm")
|
|
475
|
+
}
|
|
476
|
+
),
|
|
477
|
+
/* @__PURE__ */ jsx4(
|
|
478
|
+
Button4,
|
|
479
|
+
{
|
|
480
|
+
size: "small",
|
|
481
|
+
variant: "secondary",
|
|
482
|
+
onClick: onCancelOrderEdit,
|
|
483
|
+
children: t("actions.cancel")
|
|
484
|
+
}
|
|
485
|
+
)
|
|
486
|
+
] })
|
|
487
|
+
] }) })
|
|
488
|
+
}
|
|
489
|
+
);
|
|
490
|
+
};
|
|
491
|
+
|
|
492
|
+
// src/routes/orders/order-detail/components/order-activity-section/order-activity-section.tsx
|
|
493
|
+
import { Container as Container5, Heading as Heading5 } from "@acmekit/ui";
|
|
494
|
+
import { useTranslation as useTranslation8 } from "react-i18next";
|
|
495
|
+
|
|
496
|
+
// src/routes/orders/order-detail/components/order-activity-section/order-timeline.tsx
|
|
497
|
+
import { Button as Button5, Text as Text6, Tooltip, clx, toast as toast5, usePrompt } from "@acmekit/ui";
|
|
498
|
+
import { Collapsible as RadixCollapsible } from "radix-ui";
|
|
499
|
+
import { useMemo as useMemo2, useState as useState3 } from "react";
|
|
500
|
+
import { useTranslation as useTranslation7 } from "react-i18next";
|
|
501
|
+
|
|
502
|
+
// src/routes/orders/order-detail/components/order-activity-section/activity-items.tsx
|
|
503
|
+
import { Popover, Text as Text4 } from "@acmekit/ui";
|
|
504
|
+
import { useState } from "react";
|
|
505
|
+
import { useTranslation as useTranslation5 } from "react-i18next";
|
|
506
|
+
import { jsx as jsx5, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
507
|
+
function ActivityItems(props) {
|
|
508
|
+
const { t } = useTranslation5();
|
|
509
|
+
const [open, setOpen] = useState(false);
|
|
510
|
+
const itemsToSend = props.itemsToSend;
|
|
511
|
+
const itemsToReturn = props.itemsToReturn;
|
|
512
|
+
const itemsMap = props.itemsMap;
|
|
513
|
+
const title = props.title;
|
|
514
|
+
const handleMouseEnter = () => {
|
|
515
|
+
setOpen(true);
|
|
516
|
+
};
|
|
517
|
+
const handleMouseLeave = () => {
|
|
518
|
+
setOpen(false);
|
|
519
|
+
};
|
|
520
|
+
if (!itemsToSend?.length && !itemsToReturn?.length) {
|
|
521
|
+
return;
|
|
522
|
+
}
|
|
523
|
+
return /* @__PURE__ */ jsxs6(Popover, { open, children: [
|
|
524
|
+
/* @__PURE__ */ jsx5(
|
|
525
|
+
Popover.Trigger,
|
|
526
|
+
{
|
|
527
|
+
onMouseEnter: handleMouseEnter,
|
|
528
|
+
onMouseLeave: handleMouseLeave,
|
|
529
|
+
autoFocus: false,
|
|
530
|
+
className: "focus-visible:outline-none",
|
|
531
|
+
children: /* @__PURE__ */ jsx5(Text4, { size: "small", leading: "compact", weight: "plus", children: title })
|
|
532
|
+
}
|
|
533
|
+
),
|
|
534
|
+
/* @__PURE__ */ jsx5(
|
|
535
|
+
Popover.Content,
|
|
536
|
+
{
|
|
537
|
+
align: "center",
|
|
538
|
+
side: "top",
|
|
539
|
+
className: "bg-ui-bg-component max-w-[200px] p-0 focus-visible:outline-none",
|
|
540
|
+
children: /* @__PURE__ */ jsxs6("div", { className: "flex flex-col", children: [
|
|
541
|
+
!!itemsToSend?.length && /* @__PURE__ */ jsxs6("div", { className: "p-3", children: [
|
|
542
|
+
/* @__PURE__ */ jsx5("div", { className: "txt-compact-small-plus mb-1", children: t("orders.activity.events.common.toSend") }),
|
|
543
|
+
/* @__PURE__ */ jsxs6("div", { className: "flex flex-col", children: [
|
|
544
|
+
itemsToSend?.map((item) => {
|
|
545
|
+
const originalItem = itemsMap?.get(item.item_id);
|
|
546
|
+
return /* @__PURE__ */ jsxs6("div", { className: "flex items-center gap-x-3", children: [
|
|
547
|
+
/* @__PURE__ */ jsxs6(Text4, { size: "small", className: "text-ui-fg-subtle", children: [
|
|
548
|
+
item.quantity,
|
|
549
|
+
"x"
|
|
550
|
+
] }),
|
|
551
|
+
/* @__PURE__ */ jsx5(Thumbnail, { src: originalItem?.thumbnail }),
|
|
552
|
+
/* @__PURE__ */ jsx5(Text4, { className: "txt-compact-small text-ui-fg-subtle truncate", children: `${originalItem?.variant_title} \xB7 ${originalItem?.product_title}` })
|
|
553
|
+
] }, item.id);
|
|
554
|
+
}),
|
|
555
|
+
/* @__PURE__ */ jsx5("div", { className: "flex flex-1 flex-row items-center gap-2" })
|
|
556
|
+
] })
|
|
557
|
+
] }),
|
|
558
|
+
!!itemsToReturn?.length && /* @__PURE__ */ jsxs6("div", { className: "border-t-2 border-dotted p-3", children: [
|
|
559
|
+
/* @__PURE__ */ jsx5("div", { className: "txt-compact-small-plus mb-1", children: t("orders.activity.events.common.toReturn") }),
|
|
560
|
+
/* @__PURE__ */ jsxs6("div", { className: "flex flex-col", children: [
|
|
561
|
+
itemsToReturn?.map((item) => {
|
|
562
|
+
const originalItem = itemsMap?.get(item.item_id);
|
|
563
|
+
return /* @__PURE__ */ jsxs6("div", { className: "flex items-center gap-x-3", children: [
|
|
564
|
+
/* @__PURE__ */ jsxs6(Text4, { size: "small", className: "text-ui-fg-subtle", children: [
|
|
565
|
+
item.quantity,
|
|
566
|
+
"x"
|
|
567
|
+
] }),
|
|
568
|
+
/* @__PURE__ */ jsx5(Thumbnail, { src: originalItem?.thumbnail }),
|
|
569
|
+
/* @__PURE__ */ jsx5(Text4, { className: "txt-compact-small text-ui-fg-subtle truncate", children: `${originalItem?.variant_title} \xB7 ${originalItem?.product_title}` })
|
|
570
|
+
] }, item.id);
|
|
571
|
+
}),
|
|
572
|
+
/* @__PURE__ */ jsx5("div", { className: "flex flex-1 flex-row items-center gap-2" })
|
|
573
|
+
] })
|
|
574
|
+
] })
|
|
575
|
+
] })
|
|
576
|
+
}
|
|
577
|
+
)
|
|
578
|
+
] });
|
|
579
|
+
}
|
|
580
|
+
var activity_items_default = ActivityItems;
|
|
581
|
+
|
|
582
|
+
// src/routes/orders/order-detail/components/order-activity-section/change-details-tooltip.tsx
|
|
583
|
+
import { Popover as Popover2, Text as Text5 } from "@acmekit/ui";
|
|
584
|
+
import { useState as useState2 } from "react";
|
|
585
|
+
import { useTranslation as useTranslation6 } from "react-i18next";
|
|
586
|
+
import { jsx as jsx6, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
587
|
+
function ChangeDetailsTooltip(props) {
|
|
588
|
+
const { t } = useTranslation6();
|
|
589
|
+
const [open, setOpen] = useState2(false);
|
|
590
|
+
const previous = props.previous;
|
|
591
|
+
const next = props.next;
|
|
592
|
+
const title = props.title;
|
|
593
|
+
const handleMouseEnter = () => {
|
|
594
|
+
setOpen(true);
|
|
595
|
+
};
|
|
596
|
+
const handleMouseLeave = () => {
|
|
597
|
+
setOpen(false);
|
|
598
|
+
};
|
|
599
|
+
if (!previous && !next) {
|
|
600
|
+
return null;
|
|
601
|
+
}
|
|
602
|
+
return /* @__PURE__ */ jsxs7(Popover2, { open, children: [
|
|
603
|
+
/* @__PURE__ */ jsx6(
|
|
604
|
+
Popover2.Trigger,
|
|
605
|
+
{
|
|
606
|
+
onMouseEnter: handleMouseEnter,
|
|
607
|
+
onMouseLeave: handleMouseLeave,
|
|
608
|
+
autoFocus: false,
|
|
609
|
+
className: "focus-visible:outline-none",
|
|
610
|
+
children: /* @__PURE__ */ jsx6(Text5, { size: "small", leading: "compact", weight: "plus", children: title })
|
|
611
|
+
}
|
|
612
|
+
),
|
|
613
|
+
/* @__PURE__ */ jsx6(
|
|
614
|
+
Popover2.Content,
|
|
615
|
+
{
|
|
616
|
+
align: "center",
|
|
617
|
+
side: "top",
|
|
618
|
+
className: "bg-ui-bg-component max-w-[200px] p-0 focus-visible:outline-none",
|
|
619
|
+
children: /* @__PURE__ */ jsxs7("div", { className: "flex flex-col", children: [
|
|
620
|
+
!!previous && /* @__PURE__ */ jsxs7("div", { className: "p-3", children: [
|
|
621
|
+
/* @__PURE__ */ jsx6("div", { className: "txt-compact-small-plus mb-1", children: t("labels.from") }),
|
|
622
|
+
/* @__PURE__ */ jsx6("p", { className: "txt-compact-small text-ui-fg-subtle", children: previous })
|
|
623
|
+
] }),
|
|
624
|
+
!!next && /* @__PURE__ */ jsxs7("div", { className: "border-t-2 border-dotted p-3", children: [
|
|
625
|
+
/* @__PURE__ */ jsx6("div", { className: "txt-compact-small-plus mb-1", children: t("labels.to") }),
|
|
626
|
+
/* @__PURE__ */ jsx6("p", { className: "txt-compact-small text-ui-fg-subtle", children: next })
|
|
627
|
+
] })
|
|
628
|
+
] })
|
|
629
|
+
}
|
|
630
|
+
)
|
|
631
|
+
] });
|
|
632
|
+
}
|
|
633
|
+
var change_details_tooltip_default = ChangeDetailsTooltip;
|
|
634
|
+
|
|
635
|
+
// src/routes/orders/order-detail/components/order-activity-section/order-timeline.tsx
|
|
636
|
+
import { Fragment, jsx as jsx7, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
637
|
+
var NON_RMA_CHANGE_TYPES = ["transfer", "update_order"];
|
|
638
|
+
var OrderTimeline = ({ order }) => {
|
|
639
|
+
const items = useActivityItems(order);
|
|
640
|
+
if (items.length <= 3) {
|
|
641
|
+
return /* @__PURE__ */ jsx7("div", { className: "flex flex-col gap-y-0.5", children: items.map((item, index) => {
|
|
642
|
+
return /* @__PURE__ */ jsx7(
|
|
643
|
+
OrderActivityItem,
|
|
644
|
+
{
|
|
645
|
+
title: item.title,
|
|
646
|
+
timestamp: item.timestamp,
|
|
647
|
+
isFirst: index === items.length - 1,
|
|
648
|
+
itemsToSend: item.itemsToSend,
|
|
649
|
+
itemsToReturn: item.itemsToReturn,
|
|
650
|
+
itemsMap: item.itemsMap,
|
|
651
|
+
children: item.children
|
|
652
|
+
},
|
|
653
|
+
index
|
|
654
|
+
);
|
|
655
|
+
}) });
|
|
656
|
+
}
|
|
657
|
+
const lastItems = items.slice(0, 2);
|
|
658
|
+
const collapsibleItems = items.slice(2, items.length - 1);
|
|
659
|
+
const firstItem = items[items.length - 1];
|
|
660
|
+
return /* @__PURE__ */ jsxs8("div", { className: "flex flex-col gap-y-0.5", children: [
|
|
661
|
+
lastItems.map((item, index) => {
|
|
662
|
+
return /* @__PURE__ */ jsx7(
|
|
663
|
+
OrderActivityItem,
|
|
664
|
+
{
|
|
665
|
+
title: item.title,
|
|
666
|
+
timestamp: item.timestamp,
|
|
667
|
+
itemsToSend: item.itemsToSend,
|
|
668
|
+
itemsToReturn: item.itemsToReturn,
|
|
669
|
+
itemsMap: item.itemsMap,
|
|
670
|
+
children: item.children
|
|
671
|
+
},
|
|
672
|
+
index
|
|
673
|
+
);
|
|
674
|
+
}),
|
|
675
|
+
/* @__PURE__ */ jsx7(OrderActivityCollapsible, { activities: collapsibleItems }),
|
|
676
|
+
/* @__PURE__ */ jsx7(
|
|
677
|
+
OrderActivityItem,
|
|
678
|
+
{
|
|
679
|
+
title: firstItem.title,
|
|
680
|
+
timestamp: firstItem.timestamp,
|
|
681
|
+
isFirst: true,
|
|
682
|
+
itemsToSend: firstItem.itemsToSend,
|
|
683
|
+
itemsToReturn: firstItem.itemsToReturn,
|
|
684
|
+
itemsMap: firstItem.itemsMap,
|
|
685
|
+
children: firstItem.children
|
|
686
|
+
}
|
|
687
|
+
)
|
|
688
|
+
] });
|
|
689
|
+
};
|
|
690
|
+
var useActivityItems = (order) => {
|
|
691
|
+
const { t } = useTranslation7();
|
|
692
|
+
const { order: initialOrder = order } = useOrder(order.id, {
|
|
693
|
+
version: 1,
|
|
694
|
+
fields: "created_at,total,currency_code"
|
|
695
|
+
}, { enabled: order.version !== 1 });
|
|
696
|
+
const { order_changes: orderChanges = [] } = useOrderChanges(order.id, {
|
|
697
|
+
change_type: [
|
|
698
|
+
"edit",
|
|
699
|
+
"claim",
|
|
700
|
+
"exchange",
|
|
701
|
+
"return",
|
|
702
|
+
"transfer",
|
|
703
|
+
"update_order"
|
|
704
|
+
]
|
|
705
|
+
});
|
|
706
|
+
const rmaChanges = orderChanges.filter(
|
|
707
|
+
(oc) => !NON_RMA_CHANGE_TYPES.includes(oc.change_type)
|
|
708
|
+
);
|
|
709
|
+
const missingLineItemIds = getMissingLineItemIds(order, rmaChanges);
|
|
710
|
+
const { order_items: removedLineItems = [] } = useOrderLineItems(
|
|
711
|
+
order.id,
|
|
712
|
+
{
|
|
713
|
+
fields: "+quantity",
|
|
714
|
+
item_id: missingLineItemIds
|
|
715
|
+
},
|
|
716
|
+
{
|
|
717
|
+
enabled: !!rmaChanges.length
|
|
718
|
+
}
|
|
719
|
+
);
|
|
720
|
+
const itemsMap = useMemo2(() => {
|
|
721
|
+
const _itemsMap = new Map(order?.items?.map((i) => [i.id, i]));
|
|
722
|
+
for (const id of missingLineItemIds) {
|
|
723
|
+
const i = removedLineItems.find((i2) => i2.item.id === id);
|
|
724
|
+
if (i) {
|
|
725
|
+
_itemsMap.set(id, { ...i.item, quantity: i.quantity });
|
|
726
|
+
}
|
|
727
|
+
}
|
|
728
|
+
return _itemsMap;
|
|
729
|
+
}, [order.items, removedLineItems, missingLineItemIds]);
|
|
730
|
+
const { returns = [] } = useReturns({
|
|
731
|
+
order_id: order.id,
|
|
732
|
+
fields: "+received_at,*items"
|
|
733
|
+
});
|
|
734
|
+
const { claims = [] } = useClaims({
|
|
735
|
+
order_id: order.id,
|
|
736
|
+
fields: "*additional_items"
|
|
737
|
+
});
|
|
738
|
+
const { exchanges = [] } = useExchanges({
|
|
739
|
+
order_id: order.id,
|
|
740
|
+
fields: "*additional_items"
|
|
741
|
+
});
|
|
742
|
+
const payments = getPaymentsFromOrder(order);
|
|
743
|
+
const notes = [];
|
|
744
|
+
const isLoading = false;
|
|
745
|
+
return useMemo2(() => {
|
|
746
|
+
if (isLoading) {
|
|
747
|
+
return [];
|
|
748
|
+
}
|
|
749
|
+
const items = [];
|
|
750
|
+
for (const payment of payments) {
|
|
751
|
+
const amount = payment.amount;
|
|
752
|
+
items.push({
|
|
753
|
+
title: t("orders.activity.events.payment.awaiting"),
|
|
754
|
+
timestamp: payment.created_at,
|
|
755
|
+
children: /* @__PURE__ */ jsx7(Text6, { size: "small", className: "text-ui-fg-subtle", children: getStylizedAmount(amount, payment.currency_code) })
|
|
756
|
+
});
|
|
757
|
+
if (payment.canceled_at) {
|
|
758
|
+
items.push({
|
|
759
|
+
title: t("orders.activity.events.payment.canceled"),
|
|
760
|
+
timestamp: payment.canceled_at,
|
|
761
|
+
children: /* @__PURE__ */ jsx7(Text6, { size: "small", className: "text-ui-fg-subtle", children: getStylizedAmount(amount, payment.currency_code) })
|
|
762
|
+
});
|
|
763
|
+
}
|
|
764
|
+
if (payment.captured_at) {
|
|
765
|
+
items.push({
|
|
766
|
+
title: t("orders.activity.events.payment.captured"),
|
|
767
|
+
timestamp: payment.captured_at,
|
|
768
|
+
children: /* @__PURE__ */ jsx7(Text6, { size: "small", className: "text-ui-fg-subtle", children: getStylizedAmount(amount, payment.currency_code) })
|
|
769
|
+
});
|
|
770
|
+
}
|
|
771
|
+
for (const refund of payment.refunds || []) {
|
|
772
|
+
items.push({
|
|
773
|
+
title: t("orders.activity.events.payment.refunded"),
|
|
774
|
+
timestamp: refund.created_at,
|
|
775
|
+
children: /* @__PURE__ */ jsx7(Text6, { size: "small", className: "text-ui-fg-subtle", children: getStylizedAmount(
|
|
776
|
+
refund.amount,
|
|
777
|
+
payment.currency_code
|
|
778
|
+
) })
|
|
779
|
+
});
|
|
780
|
+
}
|
|
781
|
+
}
|
|
782
|
+
for (const fulfillment of order.fulfillments || []) {
|
|
783
|
+
items.push({
|
|
784
|
+
title: t("orders.activity.events.fulfillment.created"),
|
|
785
|
+
timestamp: fulfillment.created_at,
|
|
786
|
+
children: /* @__PURE__ */ jsx7(FulfillmentCreatedBody, { fulfillment })
|
|
787
|
+
});
|
|
788
|
+
if (fulfillment.delivered_at) {
|
|
789
|
+
items.push({
|
|
790
|
+
title: t("orders.activity.events.fulfillment.delivered"),
|
|
791
|
+
timestamp: fulfillment.delivered_at,
|
|
792
|
+
children: /* @__PURE__ */ jsx7(FulfillmentCreatedBody, { fulfillment })
|
|
793
|
+
});
|
|
794
|
+
}
|
|
795
|
+
if (fulfillment.shipped_at) {
|
|
796
|
+
items.push({
|
|
797
|
+
title: t("orders.activity.events.fulfillment.shipped"),
|
|
798
|
+
timestamp: fulfillment.shipped_at,
|
|
799
|
+
children: /* @__PURE__ */ jsx7(FulfillmentCreatedBody, { fulfillment, isShipment: true })
|
|
800
|
+
});
|
|
801
|
+
}
|
|
802
|
+
if (fulfillment.canceled_at) {
|
|
803
|
+
items.push({
|
|
804
|
+
title: t("orders.activity.events.fulfillment.canceled"),
|
|
805
|
+
timestamp: fulfillment.canceled_at
|
|
806
|
+
});
|
|
807
|
+
}
|
|
808
|
+
}
|
|
809
|
+
const returnMap = /* @__PURE__ */ new Map();
|
|
810
|
+
for (const ret of returns) {
|
|
811
|
+
returnMap.set(ret.id, ret);
|
|
812
|
+
if (ret.claim_id || ret.exchange_id) {
|
|
813
|
+
continue;
|
|
814
|
+
}
|
|
815
|
+
items.push({
|
|
816
|
+
title: t("orders.activity.events.return.created", {
|
|
817
|
+
returnId: ret.id.slice(-7)
|
|
818
|
+
}),
|
|
819
|
+
timestamp: ret.created_at,
|
|
820
|
+
itemsToReturn: ret?.items,
|
|
821
|
+
itemsMap,
|
|
822
|
+
children: /* @__PURE__ */ jsx7(ReturnBody, { orderReturn: ret, isCreated: !ret.canceled_at })
|
|
823
|
+
});
|
|
824
|
+
if (ret.canceled_at) {
|
|
825
|
+
items.push({
|
|
826
|
+
title: t("orders.activity.events.return.canceled", {
|
|
827
|
+
returnId: ret.id.slice(-7)
|
|
828
|
+
}),
|
|
829
|
+
timestamp: ret.canceled_at
|
|
830
|
+
});
|
|
831
|
+
}
|
|
832
|
+
if (ret.status === "received" || ret.status === "partially_received") {
|
|
833
|
+
items.push({
|
|
834
|
+
title: t("orders.activity.events.return.received", {
|
|
835
|
+
returnId: ret.id.slice(-7)
|
|
836
|
+
}),
|
|
837
|
+
timestamp: ret.received_at,
|
|
838
|
+
itemsToReturn: ret?.items,
|
|
839
|
+
itemsMap,
|
|
840
|
+
children: /* @__PURE__ */ jsx7(ReturnBody, { orderReturn: ret, isReceived: true })
|
|
841
|
+
});
|
|
842
|
+
}
|
|
843
|
+
}
|
|
844
|
+
for (const claim of claims) {
|
|
845
|
+
const claimReturn = returnMap.get(claim.return_id);
|
|
846
|
+
items.push({
|
|
847
|
+
title: t(
|
|
848
|
+
claim.canceled_at ? "orders.activity.events.claim.canceled" : "orders.activity.events.claim.created",
|
|
849
|
+
{
|
|
850
|
+
claimId: claim.id.slice(-7)
|
|
851
|
+
}
|
|
852
|
+
),
|
|
853
|
+
timestamp: claim.canceled_at || claim.created_at,
|
|
854
|
+
itemsToSend: claim.additional_items,
|
|
855
|
+
itemsToReturn: claimReturn?.items,
|
|
856
|
+
itemsMap,
|
|
857
|
+
children: /* @__PURE__ */ jsx7(ClaimBody, { claim, claimReturn })
|
|
858
|
+
});
|
|
859
|
+
}
|
|
860
|
+
for (const exchange of exchanges) {
|
|
861
|
+
const exchangeReturn = returnMap.get(exchange.return_id);
|
|
862
|
+
items.push({
|
|
863
|
+
title: t(
|
|
864
|
+
exchange.canceled_at ? "orders.activity.events.exchange.canceled" : "orders.activity.events.exchange.created",
|
|
865
|
+
{
|
|
866
|
+
exchangeId: exchange.id.slice(-7)
|
|
867
|
+
}
|
|
868
|
+
),
|
|
869
|
+
timestamp: exchange.canceled_at || exchange.created_at,
|
|
870
|
+
itemsToSend: exchange.additional_items,
|
|
871
|
+
itemsToReturn: exchangeReturn?.items,
|
|
872
|
+
itemsMap,
|
|
873
|
+
children: /* @__PURE__ */ jsx7(ExchangeBody, { exchange, exchangeReturn })
|
|
874
|
+
});
|
|
875
|
+
}
|
|
876
|
+
for (const edit of orderChanges.filter((oc) => oc.change_type === "edit")) {
|
|
877
|
+
const isConfirmed = edit.status === "confirmed";
|
|
878
|
+
const isPending = edit.status === "pending";
|
|
879
|
+
if (isPending) {
|
|
880
|
+
continue;
|
|
881
|
+
}
|
|
882
|
+
items.push({
|
|
883
|
+
title: t(`orders.activity.events.edit.${edit.status}`, {
|
|
884
|
+
editId: edit.id.slice(-7)
|
|
885
|
+
}),
|
|
886
|
+
timestamp: edit.status === "requested" ? edit.requested_at : edit.status === "confirmed" ? edit.confirmed_at : edit.status === "declined" ? edit.declined_at : edit.status === "canceled" ? edit.canceled_at : edit.created_at,
|
|
887
|
+
children: isConfirmed ? /* @__PURE__ */ jsx7(OrderEditBody, { edit }) : null
|
|
888
|
+
});
|
|
889
|
+
}
|
|
890
|
+
for (const transfer of orderChanges.filter(
|
|
891
|
+
(oc) => oc.change_type === "transfer"
|
|
892
|
+
)) {
|
|
893
|
+
if (transfer.requested_at) {
|
|
894
|
+
items.push({
|
|
895
|
+
title: t(`orders.activity.events.transfer.requested`, {
|
|
896
|
+
transferId: transfer.id.slice(-7)
|
|
897
|
+
}),
|
|
898
|
+
timestamp: transfer.requested_at,
|
|
899
|
+
children: /* @__PURE__ */ jsx7(TransferOrderRequestBody, { transfer })
|
|
900
|
+
});
|
|
901
|
+
}
|
|
902
|
+
if (transfer.confirmed_at) {
|
|
903
|
+
items.push({
|
|
904
|
+
title: t(`orders.activity.events.transfer.confirmed`, {
|
|
905
|
+
transferId: transfer.id.slice(-7)
|
|
906
|
+
}),
|
|
907
|
+
timestamp: transfer.confirmed_at
|
|
908
|
+
});
|
|
909
|
+
}
|
|
910
|
+
if (transfer.declined_at) {
|
|
911
|
+
items.push({
|
|
912
|
+
title: t(`orders.activity.events.transfer.declined`, {
|
|
913
|
+
transferId: transfer.id.slice(-7)
|
|
914
|
+
}),
|
|
915
|
+
timestamp: transfer.declined_at
|
|
916
|
+
});
|
|
917
|
+
}
|
|
918
|
+
}
|
|
919
|
+
for (const update of orderChanges.filter(
|
|
920
|
+
(oc) => oc.change_type === "update_order"
|
|
921
|
+
)) {
|
|
922
|
+
const updateType = update.actions[0]?.details?.type;
|
|
923
|
+
if (updateType === "shipping_address") {
|
|
924
|
+
items.push({
|
|
925
|
+
title: /* @__PURE__ */ jsx7(
|
|
926
|
+
change_details_tooltip_default,
|
|
927
|
+
{
|
|
928
|
+
title: t(`orders.activity.events.update_order.shipping_address`),
|
|
929
|
+
previous: getFormattedAddress({
|
|
930
|
+
address: update.actions[0].details.old
|
|
931
|
+
}).join(", "),
|
|
932
|
+
next: getFormattedAddress({
|
|
933
|
+
address: update.actions[0].details.new
|
|
934
|
+
}).join(", ")
|
|
935
|
+
}
|
|
936
|
+
),
|
|
937
|
+
timestamp: update.created_at,
|
|
938
|
+
children: /* @__PURE__ */ jsxs8("div", { className: "text-ui-fg-subtle mt-2 flex gap-x-2 text-sm", children: [
|
|
939
|
+
t("fields.by"),
|
|
940
|
+
" ",
|
|
941
|
+
/* @__PURE__ */ jsx7(By, { id: update.created_by })
|
|
942
|
+
] })
|
|
943
|
+
});
|
|
944
|
+
}
|
|
945
|
+
if (updateType === "billing_address") {
|
|
946
|
+
items.push({
|
|
947
|
+
title: /* @__PURE__ */ jsx7(
|
|
948
|
+
change_details_tooltip_default,
|
|
949
|
+
{
|
|
950
|
+
title: t(`orders.activity.events.update_order.billing_address`),
|
|
951
|
+
previous: getFormattedAddress({
|
|
952
|
+
address: update.actions[0].details.old
|
|
953
|
+
}).join(", "),
|
|
954
|
+
next: getFormattedAddress({
|
|
955
|
+
address: update.actions[0].details.new
|
|
956
|
+
}).join(", ")
|
|
957
|
+
}
|
|
958
|
+
),
|
|
959
|
+
timestamp: update.created_at,
|
|
960
|
+
children: /* @__PURE__ */ jsxs8("div", { className: "text-ui-fg-subtle mt-2 flex gap-x-2 text-sm", children: [
|
|
961
|
+
t("fields.by"),
|
|
962
|
+
" ",
|
|
963
|
+
/* @__PURE__ */ jsx7(By, { id: update.created_by })
|
|
964
|
+
] })
|
|
965
|
+
});
|
|
966
|
+
}
|
|
967
|
+
if (updateType === "email") {
|
|
968
|
+
items.push({
|
|
969
|
+
title: /* @__PURE__ */ jsx7(
|
|
970
|
+
change_details_tooltip_default,
|
|
971
|
+
{
|
|
972
|
+
title: t(`orders.activity.events.update_order.email`),
|
|
973
|
+
previous: update.actions[0].details.old,
|
|
974
|
+
next: update.actions[0].details.new
|
|
975
|
+
}
|
|
976
|
+
),
|
|
977
|
+
timestamp: update.created_at,
|
|
978
|
+
children: /* @__PURE__ */ jsxs8("div", { className: "text-ui-fg-subtle mt-2 flex gap-x-2 text-sm", children: [
|
|
979
|
+
t("fields.by"),
|
|
980
|
+
" ",
|
|
981
|
+
/* @__PURE__ */ jsx7(By, { id: update.created_by })
|
|
982
|
+
] })
|
|
983
|
+
});
|
|
984
|
+
}
|
|
985
|
+
}
|
|
986
|
+
if (order.canceled_at) {
|
|
987
|
+
items.push({
|
|
988
|
+
title: t("orders.activity.events.canceled.title"),
|
|
989
|
+
timestamp: order.canceled_at
|
|
990
|
+
});
|
|
991
|
+
}
|
|
992
|
+
const sortedActivities = items.sort((a, b) => {
|
|
993
|
+
return new Date(b.timestamp).getTime() - new Date(a.timestamp).getTime();
|
|
994
|
+
});
|
|
995
|
+
if (initialOrder.created_at) {
|
|
996
|
+
const createdAt = {
|
|
997
|
+
title: t("orders.activity.events.placed.title"),
|
|
998
|
+
timestamp: initialOrder.created_at,
|
|
999
|
+
children: /* @__PURE__ */ jsx7(Text6, { size: "small", className: "text-ui-fg-subtle", children: getStylizedAmount(initialOrder.total, initialOrder.currency_code) })
|
|
1000
|
+
};
|
|
1001
|
+
sortedActivities.push(createdAt);
|
|
1002
|
+
}
|
|
1003
|
+
return [...sortedActivities];
|
|
1004
|
+
}, [
|
|
1005
|
+
order,
|
|
1006
|
+
initialOrder,
|
|
1007
|
+
payments,
|
|
1008
|
+
returns,
|
|
1009
|
+
exchanges,
|
|
1010
|
+
orderChanges,
|
|
1011
|
+
notes,
|
|
1012
|
+
isLoading,
|
|
1013
|
+
itemsMap
|
|
1014
|
+
]);
|
|
1015
|
+
};
|
|
1016
|
+
var OrderActivityItem = ({
|
|
1017
|
+
title,
|
|
1018
|
+
timestamp,
|
|
1019
|
+
isFirst = false,
|
|
1020
|
+
children,
|
|
1021
|
+
itemsToSend,
|
|
1022
|
+
itemsToReturn,
|
|
1023
|
+
itemsMap
|
|
1024
|
+
}) => {
|
|
1025
|
+
const { getFullDate, getRelativeDate } = useDate();
|
|
1026
|
+
return /* @__PURE__ */ jsxs8("div", { className: "grid grid-cols-[20px_1fr] items-start gap-2", children: [
|
|
1027
|
+
/* @__PURE__ */ jsxs8("div", { className: "flex size-full flex-col items-center gap-y-0.5", children: [
|
|
1028
|
+
/* @__PURE__ */ jsx7("div", { className: "flex size-5 items-center justify-center", children: /* @__PURE__ */ jsx7("div", { className: "bg-ui-bg-base shadow-borders-base flex size-2.5 items-center justify-center rounded-full", children: /* @__PURE__ */ jsx7("div", { className: "bg-ui-tag-neutral-icon size-1.5 rounded-full" }) }) }),
|
|
1029
|
+
!isFirst && /* @__PURE__ */ jsx7("div", { className: "bg-ui-border-base w-px flex-1" })
|
|
1030
|
+
] }),
|
|
1031
|
+
/* @__PURE__ */ jsxs8(
|
|
1032
|
+
"div",
|
|
1033
|
+
{
|
|
1034
|
+
className: clx({
|
|
1035
|
+
"pb-4": !isFirst
|
|
1036
|
+
}),
|
|
1037
|
+
children: [
|
|
1038
|
+
/* @__PURE__ */ jsxs8("div", { className: "flex items-center justify-between", children: [
|
|
1039
|
+
itemsToSend?.length || itemsToReturn?.length ? /* @__PURE__ */ jsx7(
|
|
1040
|
+
activity_items_default,
|
|
1041
|
+
{
|
|
1042
|
+
title,
|
|
1043
|
+
itemsToSend,
|
|
1044
|
+
itemsToReturn,
|
|
1045
|
+
itemsMap
|
|
1046
|
+
},
|
|
1047
|
+
title
|
|
1048
|
+
) : /* @__PURE__ */ jsx7(Text6, { size: "small", leading: "compact", weight: "plus", children: title }),
|
|
1049
|
+
timestamp && /* @__PURE__ */ jsx7(
|
|
1050
|
+
Tooltip,
|
|
1051
|
+
{
|
|
1052
|
+
content: getFullDate({ date: timestamp, includeTime: true }),
|
|
1053
|
+
children: /* @__PURE__ */ jsx7(
|
|
1054
|
+
Text6,
|
|
1055
|
+
{
|
|
1056
|
+
size: "small",
|
|
1057
|
+
leading: "compact",
|
|
1058
|
+
className: "text-ui-fg-subtle text-right",
|
|
1059
|
+
children: getRelativeDate(timestamp)
|
|
1060
|
+
}
|
|
1061
|
+
)
|
|
1062
|
+
}
|
|
1063
|
+
)
|
|
1064
|
+
] }),
|
|
1065
|
+
/* @__PURE__ */ jsx7("div", { children })
|
|
1066
|
+
]
|
|
1067
|
+
}
|
|
1068
|
+
)
|
|
1069
|
+
] });
|
|
1070
|
+
};
|
|
1071
|
+
var OrderActivityCollapsible = ({
|
|
1072
|
+
activities
|
|
1073
|
+
}) => {
|
|
1074
|
+
const [open, setOpen] = useState3(false);
|
|
1075
|
+
const { t } = useTranslation7();
|
|
1076
|
+
if (!activities.length) {
|
|
1077
|
+
return null;
|
|
1078
|
+
}
|
|
1079
|
+
return /* @__PURE__ */ jsxs8(RadixCollapsible.Root, { open, onOpenChange: setOpen, children: [
|
|
1080
|
+
!open && /* @__PURE__ */ jsxs8("div", { className: "grid grid-cols-[20px_1fr] items-start gap-2", children: [
|
|
1081
|
+
/* @__PURE__ */ jsx7("div", { className: "flex size-full flex-col items-center", children: /* @__PURE__ */ jsx7("div", { className: "border-ui-border-strong w-px flex-1 bg-[linear-gradient(var(--border-strong)_33%,rgba(255,255,255,0)_0%)] bg-[length:1px_3px] bg-right bg-repeat-y" }) }),
|
|
1082
|
+
/* @__PURE__ */ jsx7("div", { className: "pb-4", children: /* @__PURE__ */ jsx7(RadixCollapsible.Trigger, { className: "text-left", children: /* @__PURE__ */ jsx7(
|
|
1083
|
+
Text6,
|
|
1084
|
+
{
|
|
1085
|
+
size: "small",
|
|
1086
|
+
leading: "compact",
|
|
1087
|
+
weight: "plus",
|
|
1088
|
+
className: "text-ui-fg-muted",
|
|
1089
|
+
children: t("orders.activity.showMoreActivities", {
|
|
1090
|
+
count: activities.length
|
|
1091
|
+
})
|
|
1092
|
+
}
|
|
1093
|
+
) }) })
|
|
1094
|
+
] }),
|
|
1095
|
+
/* @__PURE__ */ jsx7(RadixCollapsible.Content, { children: /* @__PURE__ */ jsx7("div", { className: "flex flex-col gap-y-0.5", children: activities.map((item, index) => {
|
|
1096
|
+
return /* @__PURE__ */ jsx7(
|
|
1097
|
+
OrderActivityItem,
|
|
1098
|
+
{
|
|
1099
|
+
title: item.title,
|
|
1100
|
+
timestamp: item.timestamp,
|
|
1101
|
+
itemsToSend: item.itemsToSend,
|
|
1102
|
+
itemsToReturn: item.itemsToReturn,
|
|
1103
|
+
itemsMap: item.itemsMap,
|
|
1104
|
+
children: item.children
|
|
1105
|
+
},
|
|
1106
|
+
index
|
|
1107
|
+
);
|
|
1108
|
+
}) }) })
|
|
1109
|
+
] });
|
|
1110
|
+
};
|
|
1111
|
+
var FulfillmentCreatedBody = ({
|
|
1112
|
+
fulfillment
|
|
1113
|
+
}) => {
|
|
1114
|
+
const { t } = useTranslation7();
|
|
1115
|
+
const numberOfItems = fulfillment.items.reduce((acc, item) => {
|
|
1116
|
+
return acc + item.quantity;
|
|
1117
|
+
}, 0);
|
|
1118
|
+
return /* @__PURE__ */ jsx7("div", { children: /* @__PURE__ */ jsx7(Text6, { size: "small", className: "text-ui-fg-subtle", children: t("orders.activity.events.fulfillment.items", {
|
|
1119
|
+
count: numberOfItems
|
|
1120
|
+
}) }) });
|
|
1121
|
+
};
|
|
1122
|
+
var ReturnBody = ({
|
|
1123
|
+
orderReturn,
|
|
1124
|
+
isCreated,
|
|
1125
|
+
isReceived
|
|
1126
|
+
}) => {
|
|
1127
|
+
const prompt = usePrompt();
|
|
1128
|
+
const { t } = useTranslation7();
|
|
1129
|
+
const { mutateAsync: cancelReturnRequest } = useCancelReturn(
|
|
1130
|
+
orderReturn.id,
|
|
1131
|
+
orderReturn.order_id
|
|
1132
|
+
);
|
|
1133
|
+
const onCancel = async () => {
|
|
1134
|
+
const res = await prompt({
|
|
1135
|
+
title: t("orders.returns.cancel.title"),
|
|
1136
|
+
description: t("orders.returns.cancel.description"),
|
|
1137
|
+
confirmText: t("actions.confirm"),
|
|
1138
|
+
cancelText: t("actions.cancel")
|
|
1139
|
+
});
|
|
1140
|
+
if (!res) {
|
|
1141
|
+
return;
|
|
1142
|
+
}
|
|
1143
|
+
await cancelReturnRequest().catch((error) => {
|
|
1144
|
+
toast5.error(error.message);
|
|
1145
|
+
});
|
|
1146
|
+
};
|
|
1147
|
+
const numberOfItems = orderReturn.items.reduce((acc, item) => {
|
|
1148
|
+
return acc + (isReceived ? item.received_quantity : item.quantity);
|
|
1149
|
+
}, 0);
|
|
1150
|
+
return /* @__PURE__ */ jsxs8("div", { className: "flex items-start gap-1", children: [
|
|
1151
|
+
/* @__PURE__ */ jsx7(Text6, { size: "small", className: "text-ui-fg-subtle", children: t("orders.activity.events.return.items", {
|
|
1152
|
+
count: numberOfItems
|
|
1153
|
+
}) }),
|
|
1154
|
+
isCreated && /* @__PURE__ */ jsxs8(Fragment, { children: [
|
|
1155
|
+
/* @__PURE__ */ jsx7("div", { className: "mt-[2px] flex items-center leading-none", children: "\u22C5" }),
|
|
1156
|
+
/* @__PURE__ */ jsx7(
|
|
1157
|
+
Button5,
|
|
1158
|
+
{
|
|
1159
|
+
onClick: onCancel,
|
|
1160
|
+
className: "text-ui-fg-subtle h-auto px-0 leading-none hover:bg-transparent",
|
|
1161
|
+
variant: "transparent",
|
|
1162
|
+
size: "small",
|
|
1163
|
+
children: t("actions.cancel")
|
|
1164
|
+
}
|
|
1165
|
+
)
|
|
1166
|
+
] })
|
|
1167
|
+
] });
|
|
1168
|
+
};
|
|
1169
|
+
var ClaimBody = ({
|
|
1170
|
+
claim,
|
|
1171
|
+
claimReturn
|
|
1172
|
+
}) => {
|
|
1173
|
+
const prompt = usePrompt();
|
|
1174
|
+
const { t } = useTranslation7();
|
|
1175
|
+
const isCanceled = !!claim.created_at;
|
|
1176
|
+
const { mutateAsync: cancelClaim } = useCancelClaim(claim.id, claim.order_id);
|
|
1177
|
+
const onCancel = async () => {
|
|
1178
|
+
const res = await prompt({
|
|
1179
|
+
title: t("orders.claims.cancel.title"),
|
|
1180
|
+
description: t("orders.claims.cancel.description"),
|
|
1181
|
+
confirmText: t("actions.confirm"),
|
|
1182
|
+
cancelText: t("actions.cancel")
|
|
1183
|
+
});
|
|
1184
|
+
if (!res) {
|
|
1185
|
+
return;
|
|
1186
|
+
}
|
|
1187
|
+
await cancelClaim().catch((error) => {
|
|
1188
|
+
toast5.error(error.message);
|
|
1189
|
+
});
|
|
1190
|
+
};
|
|
1191
|
+
const outboundItems = (claim.additional_items || []).reduce(
|
|
1192
|
+
(acc, item) => acc + item.quantity,
|
|
1193
|
+
0
|
|
1194
|
+
);
|
|
1195
|
+
const inboundItems = (claimReturn?.items || []).reduce(
|
|
1196
|
+
(acc, item) => acc + item.quantity,
|
|
1197
|
+
0
|
|
1198
|
+
);
|
|
1199
|
+
return /* @__PURE__ */ jsxs8("div", { children: [
|
|
1200
|
+
outboundItems > 0 && /* @__PURE__ */ jsx7(Text6, { size: "small", className: "text-ui-fg-subtle", children: t("orders.activity.events.claim.itemsInbound", {
|
|
1201
|
+
count: outboundItems
|
|
1202
|
+
}) }),
|
|
1203
|
+
inboundItems > 0 && /* @__PURE__ */ jsx7(Text6, { size: "small", className: "text-ui-fg-subtle", children: t("orders.activity.events.claim.itemsOutbound", {
|
|
1204
|
+
count: inboundItems
|
|
1205
|
+
}) }),
|
|
1206
|
+
!isCanceled && /* @__PURE__ */ jsx7(
|
|
1207
|
+
Button5,
|
|
1208
|
+
{
|
|
1209
|
+
onClick: onCancel,
|
|
1210
|
+
className: "text-ui-fg-subtle h-auto px-0 leading-none hover:bg-transparent",
|
|
1211
|
+
variant: "transparent",
|
|
1212
|
+
size: "small",
|
|
1213
|
+
children: t("actions.cancel")
|
|
1214
|
+
}
|
|
1215
|
+
)
|
|
1216
|
+
] });
|
|
1217
|
+
};
|
|
1218
|
+
var ExchangeBody = ({
|
|
1219
|
+
exchange,
|
|
1220
|
+
exchangeReturn
|
|
1221
|
+
}) => {
|
|
1222
|
+
const prompt = usePrompt();
|
|
1223
|
+
const { t } = useTranslation7();
|
|
1224
|
+
const isCanceled = !!exchange.canceled_at;
|
|
1225
|
+
const { mutateAsync: cancelExchange } = useCancelExchange(
|
|
1226
|
+
exchange.id,
|
|
1227
|
+
exchange.order_id
|
|
1228
|
+
);
|
|
1229
|
+
const onCancel = async () => {
|
|
1230
|
+
const res = await prompt({
|
|
1231
|
+
title: t("orders.exchanges.cancel.title"),
|
|
1232
|
+
description: t("orders.exchanges.cancel.description"),
|
|
1233
|
+
confirmText: t("actions.confirm"),
|
|
1234
|
+
cancelText: t("actions.cancel")
|
|
1235
|
+
});
|
|
1236
|
+
if (!res) {
|
|
1237
|
+
return;
|
|
1238
|
+
}
|
|
1239
|
+
await cancelExchange().catch((error) => {
|
|
1240
|
+
toast5.error(error.message);
|
|
1241
|
+
});
|
|
1242
|
+
};
|
|
1243
|
+
const outboundItems = (exchange.additional_items || []).reduce(
|
|
1244
|
+
(acc, item) => acc + item.quantity,
|
|
1245
|
+
0
|
|
1246
|
+
);
|
|
1247
|
+
const inboundItems = (exchangeReturn?.items || []).reduce(
|
|
1248
|
+
(acc, item) => acc + item.quantity,
|
|
1249
|
+
0
|
|
1250
|
+
);
|
|
1251
|
+
return /* @__PURE__ */ jsxs8("div", { children: [
|
|
1252
|
+
outboundItems > 0 && /* @__PURE__ */ jsx7(Text6, { size: "small", className: "text-ui-fg-subtle", children: t("orders.activity.events.exchange.itemsInbound", {
|
|
1253
|
+
count: outboundItems
|
|
1254
|
+
}) }),
|
|
1255
|
+
inboundItems > 0 && /* @__PURE__ */ jsx7(Text6, { size: "small", className: "text-ui-fg-subtle", children: t("orders.activity.events.exchange.itemsOutbound", {
|
|
1256
|
+
count: inboundItems
|
|
1257
|
+
}) }),
|
|
1258
|
+
!isCanceled && /* @__PURE__ */ jsx7(
|
|
1259
|
+
Button5,
|
|
1260
|
+
{
|
|
1261
|
+
onClick: onCancel,
|
|
1262
|
+
className: "text-ui-fg-subtle h-auto px-0 leading-none hover:bg-transparent",
|
|
1263
|
+
variant: "transparent",
|
|
1264
|
+
size: "small",
|
|
1265
|
+
children: t("actions.cancel")
|
|
1266
|
+
}
|
|
1267
|
+
)
|
|
1268
|
+
] });
|
|
1269
|
+
};
|
|
1270
|
+
var OrderEditBody = ({ edit }) => {
|
|
1271
|
+
const { t } = useTranslation7();
|
|
1272
|
+
const [itemsAdded, itemsRemoved] = useMemo2(
|
|
1273
|
+
() => countItemsChange(edit.actions),
|
|
1274
|
+
[edit]
|
|
1275
|
+
);
|
|
1276
|
+
return /* @__PURE__ */ jsxs8("div", { children: [
|
|
1277
|
+
itemsAdded > 0 && /* @__PURE__ */ jsxs8(Text6, { size: "small", className: "text-ui-fg-subtle", children: [
|
|
1278
|
+
t("labels.added"),
|
|
1279
|
+
": ",
|
|
1280
|
+
itemsAdded
|
|
1281
|
+
] }),
|
|
1282
|
+
itemsRemoved > 0 && /* @__PURE__ */ jsxs8(Text6, { size: "small", className: "text-ui-fg-subtle", children: [
|
|
1283
|
+
t("labels.removed"),
|
|
1284
|
+
": ",
|
|
1285
|
+
itemsRemoved
|
|
1286
|
+
] })
|
|
1287
|
+
] });
|
|
1288
|
+
};
|
|
1289
|
+
var TransferOrderRequestBody = ({
|
|
1290
|
+
transfer
|
|
1291
|
+
}) => {
|
|
1292
|
+
const prompt = usePrompt();
|
|
1293
|
+
const { t } = useTranslation7();
|
|
1294
|
+
const action = transfer.actions[0];
|
|
1295
|
+
const { customer } = useCustomer(action.reference_id);
|
|
1296
|
+
const isCompleted = !!transfer.confirmed_at;
|
|
1297
|
+
const { mutateAsync: cancelTransfer } = useCancelOrderTransfer(
|
|
1298
|
+
transfer.order_id
|
|
1299
|
+
);
|
|
1300
|
+
const handleDelete = async () => {
|
|
1301
|
+
const res = await prompt({
|
|
1302
|
+
title: t("general.areYouSure"),
|
|
1303
|
+
description: t("actions.cannotUndo"),
|
|
1304
|
+
confirmText: t("actions.delete"),
|
|
1305
|
+
cancelText: t("actions.cancel")
|
|
1306
|
+
});
|
|
1307
|
+
if (!res) {
|
|
1308
|
+
return;
|
|
1309
|
+
}
|
|
1310
|
+
await cancelTransfer().catch((error) => {
|
|
1311
|
+
toast5.error(error.message);
|
|
1312
|
+
});
|
|
1313
|
+
};
|
|
1314
|
+
return /* @__PURE__ */ jsxs8("div", { children: [
|
|
1315
|
+
/* @__PURE__ */ jsxs8(Text6, { size: "small", className: "text-ui-fg-subtle", children: [
|
|
1316
|
+
t("orders.activity.from"),
|
|
1317
|
+
": ",
|
|
1318
|
+
action.details?.original_email
|
|
1319
|
+
] }),
|
|
1320
|
+
/* @__PURE__ */ jsxs8(Text6, { size: "small", className: "text-ui-fg-subtle", children: [
|
|
1321
|
+
t("orders.activity.to"),
|
|
1322
|
+
":",
|
|
1323
|
+
" ",
|
|
1324
|
+
customer?.first_name ? `${customer?.first_name} ${customer?.last_name}` : customer?.email
|
|
1325
|
+
] }),
|
|
1326
|
+
!isCompleted && /* @__PURE__ */ jsx7(
|
|
1327
|
+
Button5,
|
|
1328
|
+
{
|
|
1329
|
+
onClick: handleDelete,
|
|
1330
|
+
className: "text-ui-fg-subtle h-auto px-0 leading-none hover:bg-transparent",
|
|
1331
|
+
variant: "transparent",
|
|
1332
|
+
size: "small",
|
|
1333
|
+
children: t("actions.cancel")
|
|
1334
|
+
}
|
|
1335
|
+
)
|
|
1336
|
+
] });
|
|
1337
|
+
};
|
|
1338
|
+
function countItemsChange(actions) {
|
|
1339
|
+
let added = 0;
|
|
1340
|
+
let removed = 0;
|
|
1341
|
+
actions.forEach((action) => {
|
|
1342
|
+
if (action.action === "ITEM_ADD") {
|
|
1343
|
+
added += action.details.quantity;
|
|
1344
|
+
}
|
|
1345
|
+
if (action.action === "ITEM_UPDATE") {
|
|
1346
|
+
const quantityDiff = action.details.quantity_diff;
|
|
1347
|
+
if (quantityDiff > 0) {
|
|
1348
|
+
added += quantityDiff;
|
|
1349
|
+
} else {
|
|
1350
|
+
removed += Math.abs(quantityDiff);
|
|
1351
|
+
}
|
|
1352
|
+
}
|
|
1353
|
+
});
|
|
1354
|
+
return [added, removed];
|
|
1355
|
+
}
|
|
1356
|
+
function getMissingLineItemIds(order, changes) {
|
|
1357
|
+
if (!changes?.length) {
|
|
1358
|
+
return [];
|
|
1359
|
+
}
|
|
1360
|
+
const retIds = /* @__PURE__ */ new Set();
|
|
1361
|
+
const existingItemsMap = new Map(order.items.map((item) => [item.id, true]));
|
|
1362
|
+
changes.forEach((change) => {
|
|
1363
|
+
change.actions.forEach((action) => {
|
|
1364
|
+
if (!action.details?.reference_id) {
|
|
1365
|
+
return;
|
|
1366
|
+
}
|
|
1367
|
+
if (action.details.reference_id.startsWith("ordli_") && !existingItemsMap.has(action.details.reference_id)) {
|
|
1368
|
+
retIds.add(action.details.reference_id);
|
|
1369
|
+
}
|
|
1370
|
+
});
|
|
1371
|
+
});
|
|
1372
|
+
return Array.from(retIds);
|
|
1373
|
+
}
|
|
1374
|
+
|
|
1375
|
+
// src/routes/orders/order-detail/components/order-activity-section/order-activity-section.tsx
|
|
1376
|
+
import { jsx as jsx8, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
1377
|
+
var OrderActivitySection = ({ order }) => {
|
|
1378
|
+
const { t } = useTranslation8();
|
|
1379
|
+
return /* @__PURE__ */ jsxs9(Container5, { className: "flex flex-col gap-y-8 px-6 py-4", children: [
|
|
1380
|
+
/* @__PURE__ */ jsx8("div", { className: "flex flex-col gap-y-4", children: /* @__PURE__ */ jsx8("div", { className: "flex items-center justify-between", children: /* @__PURE__ */ jsx8(Heading5, { level: "h2", children: t("orders.activity.header") }) }) }),
|
|
1381
|
+
/* @__PURE__ */ jsx8(OrderTimeline, { order })
|
|
1382
|
+
] });
|
|
1383
|
+
};
|
|
1384
|
+
|
|
1385
|
+
// src/routes/orders/order-detail/components/order-customer-section/order-customer-section.tsx
|
|
1386
|
+
import { Container as Container6, Heading as Heading6 } from "@acmekit/ui";
|
|
1387
|
+
import { useTranslation as useTranslation10 } from "react-i18next";
|
|
1388
|
+
import { ArrowPath as ArrowPath2, CurrencyDollar, Envelope, FlyingBox } from "@acmekit/icons";
|
|
1389
|
+
|
|
1390
|
+
// src/components/common/customer-info/customer-info.tsx
|
|
1391
|
+
import { Avatar, Copy as Copy2, Text as Text7 } from "@acmekit/ui";
|
|
1392
|
+
import { useTranslation as useTranslation9 } from "react-i18next";
|
|
1393
|
+
import { Link } from "react-router-dom";
|
|
1394
|
+
import { jsx as jsx9, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
1395
|
+
var ID = ({ data }) => {
|
|
1396
|
+
const { t } = useTranslation9();
|
|
1397
|
+
const id = data.customer_id;
|
|
1398
|
+
const name = getOrderCustomer(data);
|
|
1399
|
+
const email = data.email;
|
|
1400
|
+
const fallback = (name || email || "").charAt(0).toUpperCase();
|
|
1401
|
+
return /* @__PURE__ */ jsxs10("div", { className: "text-ui-fg-subtle grid grid-cols-2 items-center px-6 py-4", children: [
|
|
1402
|
+
/* @__PURE__ */ jsx9(Text7, { size: "small", leading: "compact", weight: "plus", children: t("fields.id") }),
|
|
1403
|
+
/* @__PURE__ */ jsx9(
|
|
1404
|
+
Link,
|
|
1405
|
+
{
|
|
1406
|
+
to: `/customers/${id}`,
|
|
1407
|
+
className: "focus:shadow-borders-focus rounded-[4px] outline-none transition-shadow",
|
|
1408
|
+
children: /* @__PURE__ */ jsxs10("div", { className: "flex items-center gap-x-2 overflow-hidden", children: [
|
|
1409
|
+
/* @__PURE__ */ jsx9(Avatar, { size: "2xsmall", fallback }),
|
|
1410
|
+
/* @__PURE__ */ jsx9(
|
|
1411
|
+
Text7,
|
|
1412
|
+
{
|
|
1413
|
+
size: "small",
|
|
1414
|
+
leading: "compact",
|
|
1415
|
+
className: "text-ui-fg-subtle hover:text-ui-fg-base transition-fg truncate",
|
|
1416
|
+
children: name || email
|
|
1417
|
+
}
|
|
1418
|
+
)
|
|
1419
|
+
] })
|
|
1420
|
+
}
|
|
1421
|
+
)
|
|
1422
|
+
] });
|
|
1423
|
+
};
|
|
1424
|
+
var Company = ({ data }) => {
|
|
1425
|
+
const { t } = useTranslation9();
|
|
1426
|
+
const company = data.shipping_address?.company || data.billing_address?.company;
|
|
1427
|
+
if (!company) {
|
|
1428
|
+
return null;
|
|
1429
|
+
}
|
|
1430
|
+
return /* @__PURE__ */ jsxs10("div", { className: "text-ui-fg-subtle grid grid-cols-2 items-center px-6 py-4", children: [
|
|
1431
|
+
/* @__PURE__ */ jsx9(Text7, { size: "small", leading: "compact", weight: "plus", children: t("fields.company") }),
|
|
1432
|
+
/* @__PURE__ */ jsx9(Text7, { size: "small", leading: "compact", className: "truncate", children: company })
|
|
1433
|
+
] });
|
|
1434
|
+
};
|
|
1435
|
+
var Contact = ({ data }) => {
|
|
1436
|
+
const { t } = useTranslation9();
|
|
1437
|
+
const phone = data.shipping_address?.phone || data.billing_address?.phone;
|
|
1438
|
+
const email = data.email || "";
|
|
1439
|
+
return /* @__PURE__ */ jsxs10("div", { className: "text-ui-fg-subtle grid grid-cols-2 items-start px-6 py-4", children: [
|
|
1440
|
+
/* @__PURE__ */ jsx9(Text7, { size: "small", leading: "compact", weight: "plus", children: t("orders.customer.contactLabel") }),
|
|
1441
|
+
/* @__PURE__ */ jsxs10("div", { className: "flex flex-col gap-y-2", children: [
|
|
1442
|
+
/* @__PURE__ */ jsxs10("div", { className: "grid grid-cols-[1fr_20px] items-start gap-x-2", children: [
|
|
1443
|
+
/* @__PURE__ */ jsx9(
|
|
1444
|
+
Text7,
|
|
1445
|
+
{
|
|
1446
|
+
size: "small",
|
|
1447
|
+
leading: "compact",
|
|
1448
|
+
className: "text-pretty break-all",
|
|
1449
|
+
children: email
|
|
1450
|
+
}
|
|
1451
|
+
),
|
|
1452
|
+
/* @__PURE__ */ jsx9("div", { className: "flex justify-end", children: /* @__PURE__ */ jsx9(Copy2, { content: email, className: "text-ui-fg-muted" }) })
|
|
1453
|
+
] }),
|
|
1454
|
+
phone && /* @__PURE__ */ jsxs10("div", { className: "grid grid-cols-[1fr_20px] items-start gap-x-2", children: [
|
|
1455
|
+
/* @__PURE__ */ jsx9(
|
|
1456
|
+
Text7,
|
|
1457
|
+
{
|
|
1458
|
+
size: "small",
|
|
1459
|
+
leading: "compact",
|
|
1460
|
+
className: "text-pretty break-all",
|
|
1461
|
+
children: phone
|
|
1462
|
+
}
|
|
1463
|
+
),
|
|
1464
|
+
/* @__PURE__ */ jsx9("div", { className: "flex justify-end", children: /* @__PURE__ */ jsx9(Copy2, { content: phone, className: "text-ui-fg-muted" }) })
|
|
1465
|
+
] })
|
|
1466
|
+
] })
|
|
1467
|
+
] });
|
|
1468
|
+
};
|
|
1469
|
+
var AddressPrint = ({
|
|
1470
|
+
address,
|
|
1471
|
+
type
|
|
1472
|
+
}) => {
|
|
1473
|
+
const { t } = useTranslation9();
|
|
1474
|
+
return /* @__PURE__ */ jsxs10("div", { className: "text-ui-fg-subtle grid grid-cols-2 items-start px-6 py-4", children: [
|
|
1475
|
+
/* @__PURE__ */ jsx9(Text7, { size: "small", leading: "compact", weight: "plus", children: type === "shipping" ? t("addresses.shippingAddress.label") : t("addresses.billingAddress.label") }),
|
|
1476
|
+
address ? /* @__PURE__ */ jsxs10("div", { className: "grid grid-cols-[1fr_20px] items-start gap-x-2", children: [
|
|
1477
|
+
/* @__PURE__ */ jsx9(Text7, { size: "small", leading: "compact", children: getFormattedAddress({ address }).map((line, i) => {
|
|
1478
|
+
return /* @__PURE__ */ jsxs10("span", { className: "break-words", children: [
|
|
1479
|
+
line,
|
|
1480
|
+
/* @__PURE__ */ jsx9("br", {})
|
|
1481
|
+
] }, i);
|
|
1482
|
+
}) }),
|
|
1483
|
+
/* @__PURE__ */ jsx9("div", { className: "flex justify-end", children: /* @__PURE__ */ jsx9(
|
|
1484
|
+
Copy2,
|
|
1485
|
+
{
|
|
1486
|
+
content: getFormattedAddress({ address }).join("\n"),
|
|
1487
|
+
className: "text-ui-fg-muted"
|
|
1488
|
+
}
|
|
1489
|
+
) })
|
|
1490
|
+
] }) : /* @__PURE__ */ jsx9(Text7, { size: "small", leading: "compact", children: "-" })
|
|
1491
|
+
] });
|
|
1492
|
+
};
|
|
1493
|
+
var Addresses = ({ data }) => {
|
|
1494
|
+
const { t } = useTranslation9();
|
|
1495
|
+
return /* @__PURE__ */ jsxs10("div", { className: "divide-y", children: [
|
|
1496
|
+
/* @__PURE__ */ jsx9(AddressPrint, { address: data.shipping_address, type: "shipping" }),
|
|
1497
|
+
!isSameAddress(data.shipping_address, data.billing_address) ? /* @__PURE__ */ jsx9(AddressPrint, { address: data.billing_address, type: "billing" }) : /* @__PURE__ */ jsxs10("div", { className: "grid grid-cols-2 items-center px-6 py-4", children: [
|
|
1498
|
+
/* @__PURE__ */ jsx9(
|
|
1499
|
+
Text7,
|
|
1500
|
+
{
|
|
1501
|
+
size: "small",
|
|
1502
|
+
leading: "compact",
|
|
1503
|
+
weight: "plus",
|
|
1504
|
+
className: "text-ui-fg-subtle",
|
|
1505
|
+
children: t("addresses.billingAddress.label")
|
|
1506
|
+
}
|
|
1507
|
+
),
|
|
1508
|
+
/* @__PURE__ */ jsx9(Text7, { size: "small", leading: "compact", className: "text-ui-fg-muted", children: t("addresses.billingAddress.sameAsShipping") })
|
|
1509
|
+
] })
|
|
1510
|
+
] });
|
|
1511
|
+
};
|
|
1512
|
+
var CustomerInfo = Object.assign(
|
|
1513
|
+
{},
|
|
1514
|
+
{
|
|
1515
|
+
ID,
|
|
1516
|
+
Company,
|
|
1517
|
+
Contact,
|
|
1518
|
+
Addresses
|
|
1519
|
+
}
|
|
1520
|
+
);
|
|
1521
|
+
var getOrderCustomer = (obj) => {
|
|
1522
|
+
const { first_name: sFirstName, last_name: sLastName } = obj.shipping_address || {};
|
|
1523
|
+
const { first_name: bFirstName, last_name: bLastName } = obj.billing_address || {};
|
|
1524
|
+
const { first_name: cFirstName, last_name: cLastName } = obj.customer || {};
|
|
1525
|
+
const customerName = [cFirstName, cLastName].filter(Boolean).join(" ");
|
|
1526
|
+
const shippingName = [sFirstName, sLastName].filter(Boolean).join(" ");
|
|
1527
|
+
const billingName = [bFirstName, bLastName].filter(Boolean).join(" ");
|
|
1528
|
+
const name = customerName || shippingName || billingName;
|
|
1529
|
+
return name;
|
|
1530
|
+
};
|
|
1531
|
+
|
|
1532
|
+
// src/routes/orders/order-detail/components/order-customer-section/order-customer-section.tsx
|
|
1533
|
+
import { jsx as jsx10, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
1534
|
+
var OrderCustomerSection = ({ order }) => {
|
|
1535
|
+
return /* @__PURE__ */ jsxs11(Container6, { className: "divide-y p-0", children: [
|
|
1536
|
+
/* @__PURE__ */ jsx10(Header, {}),
|
|
1537
|
+
/* @__PURE__ */ jsx10(CustomerInfo.ID, { data: order }),
|
|
1538
|
+
/* @__PURE__ */ jsx10(CustomerInfo.Contact, { data: order }),
|
|
1539
|
+
/* @__PURE__ */ jsx10(CustomerInfo.Company, { data: order }),
|
|
1540
|
+
/* @__PURE__ */ jsx10(CustomerInfo.Addresses, { data: order })
|
|
1541
|
+
] });
|
|
1542
|
+
};
|
|
1543
|
+
var Header = () => {
|
|
1544
|
+
const { t } = useTranslation10();
|
|
1545
|
+
return /* @__PURE__ */ jsxs11("div", { className: "flex items-center justify-between px-6 py-4", children: [
|
|
1546
|
+
/* @__PURE__ */ jsx10(Heading6, { level: "h2", children: t("fields.customer") }),
|
|
1547
|
+
/* @__PURE__ */ jsx10(
|
|
1548
|
+
ActionMenu,
|
|
1549
|
+
{
|
|
1550
|
+
groups: [
|
|
1551
|
+
{
|
|
1552
|
+
actions: [
|
|
1553
|
+
{
|
|
1554
|
+
label: t("transferOwnership.label"),
|
|
1555
|
+
to: `transfer`,
|
|
1556
|
+
icon: /* @__PURE__ */ jsx10(ArrowPath2, {})
|
|
1557
|
+
}
|
|
1558
|
+
]
|
|
1559
|
+
},
|
|
1560
|
+
{
|
|
1561
|
+
actions: [
|
|
1562
|
+
{
|
|
1563
|
+
label: t("addresses.shippingAddress.editLabel"),
|
|
1564
|
+
to: "shipping-address",
|
|
1565
|
+
icon: /* @__PURE__ */ jsx10(FlyingBox, {})
|
|
1566
|
+
},
|
|
1567
|
+
{
|
|
1568
|
+
label: t("addresses.billingAddress.editLabel"),
|
|
1569
|
+
to: "billing-address",
|
|
1570
|
+
icon: /* @__PURE__ */ jsx10(CurrencyDollar, {})
|
|
1571
|
+
}
|
|
1572
|
+
]
|
|
1573
|
+
},
|
|
1574
|
+
{
|
|
1575
|
+
actions: [
|
|
1576
|
+
{
|
|
1577
|
+
label: t("email.editLabel"),
|
|
1578
|
+
to: `email`,
|
|
1579
|
+
icon: /* @__PURE__ */ jsx10(Envelope, {})
|
|
1580
|
+
}
|
|
1581
|
+
]
|
|
1582
|
+
}
|
|
1583
|
+
]
|
|
1584
|
+
}
|
|
1585
|
+
)
|
|
1586
|
+
] });
|
|
1587
|
+
};
|
|
1588
|
+
|
|
1589
|
+
// src/routes/orders/order-detail/components/order-fulfillment-section/order-fulfillment-section.tsx
|
|
1590
|
+
import { Buildings, XCircle } from "@acmekit/icons";
|
|
1591
|
+
import {
|
|
1592
|
+
Button as Button6,
|
|
1593
|
+
Container as Container7,
|
|
1594
|
+
Copy as Copy3,
|
|
1595
|
+
Heading as Heading7,
|
|
1596
|
+
StatusBadge,
|
|
1597
|
+
Text as Text8,
|
|
1598
|
+
Tooltip as Tooltip2,
|
|
1599
|
+
toast as toast6,
|
|
1600
|
+
usePrompt as usePrompt2
|
|
1601
|
+
} from "@acmekit/ui";
|
|
1602
|
+
import { format } from "date-fns";
|
|
1603
|
+
import { useTranslation as useTranslation11 } from "react-i18next";
|
|
1604
|
+
import { Link as Link2, useNavigate as useNavigate5 } from "react-router-dom";
|
|
1605
|
+
import { Fragment as Fragment2, jsx as jsx11, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
1606
|
+
var OrderFulfillmentSection = ({
|
|
1607
|
+
order
|
|
1608
|
+
}) => {
|
|
1609
|
+
const fulfillments = order.fulfillments || [];
|
|
1610
|
+
return /* @__PURE__ */ jsxs12("div", { className: "flex flex-col gap-y-3", children: [
|
|
1611
|
+
/* @__PURE__ */ jsx11(UnfulfilledItemBreakdown, { order }),
|
|
1612
|
+
fulfillments.map((f, index) => /* @__PURE__ */ jsx11(Fulfillment, { index, fulfillment: f, order }, f.id))
|
|
1613
|
+
] });
|
|
1614
|
+
};
|
|
1615
|
+
var UnfulfilledItem = ({
|
|
1616
|
+
item,
|
|
1617
|
+
currencyCode
|
|
1618
|
+
}) => {
|
|
1619
|
+
return /* @__PURE__ */ jsxs12(
|
|
1620
|
+
"div",
|
|
1621
|
+
{
|
|
1622
|
+
className: "text-ui-fg-subtle grid grid-cols-2 items-start px-6 py-4",
|
|
1623
|
+
children: [
|
|
1624
|
+
/* @__PURE__ */ jsxs12("div", { className: "flex items-start gap-x-4", children: [
|
|
1625
|
+
/* @__PURE__ */ jsx11(Thumbnail, { src: item.thumbnail }),
|
|
1626
|
+
/* @__PURE__ */ jsxs12("div", { children: [
|
|
1627
|
+
/* @__PURE__ */ jsx11(
|
|
1628
|
+
Text8,
|
|
1629
|
+
{
|
|
1630
|
+
size: "small",
|
|
1631
|
+
leading: "compact",
|
|
1632
|
+
weight: "plus",
|
|
1633
|
+
className: "text-ui-fg-base",
|
|
1634
|
+
children: item.title
|
|
1635
|
+
}
|
|
1636
|
+
),
|
|
1637
|
+
item.variant_sku && /* @__PURE__ */ jsxs12("div", { className: "flex items-center gap-x-1", children: [
|
|
1638
|
+
/* @__PURE__ */ jsx11(Text8, { size: "small", children: item.variant_sku }),
|
|
1639
|
+
/* @__PURE__ */ jsx11(Copy3, { content: item.variant_sku, className: "text-ui-fg-muted" })
|
|
1640
|
+
] }),
|
|
1641
|
+
/* @__PURE__ */ jsx11(Text8, { size: "small", children: item.variant?.options.map((o) => o.value).join(" \xB7 ") })
|
|
1642
|
+
] })
|
|
1643
|
+
] }),
|
|
1644
|
+
/* @__PURE__ */ jsxs12("div", { className: "grid grid-cols-3 items-center gap-x-4", children: [
|
|
1645
|
+
/* @__PURE__ */ jsx11("div", { className: "flex items-center justify-end", children: /* @__PURE__ */ jsx11(Text8, { size: "small", children: getLocaleAmount(item.unit_price, currencyCode) }) }),
|
|
1646
|
+
/* @__PURE__ */ jsx11("div", { className: "flex items-center justify-end", children: /* @__PURE__ */ jsxs12(Text8, { children: [
|
|
1647
|
+
/* @__PURE__ */ jsx11("span", { className: "tabular-nums", children: item.quantity - item.detail.fulfilled_quantity }),
|
|
1648
|
+
"x"
|
|
1649
|
+
] }) }),
|
|
1650
|
+
/* @__PURE__ */ jsx11("div", { className: "flex items-center justify-end", children: /* @__PURE__ */ jsx11(Text8, { size: "small", children: getLocaleAmount(item.subtotal || 0, currencyCode) }) })
|
|
1651
|
+
] })
|
|
1652
|
+
]
|
|
1653
|
+
},
|
|
1654
|
+
item.id
|
|
1655
|
+
);
|
|
1656
|
+
};
|
|
1657
|
+
var UnfulfilledItemBreakdown = ({ order }) => {
|
|
1658
|
+
const unfulfilledItemsWithShipping = order.items.filter(
|
|
1659
|
+
(i) => i.requires_shipping && i.detail.fulfilled_quantity < i.quantity
|
|
1660
|
+
);
|
|
1661
|
+
const unfulfilledItemsWithoutShipping = order.items.filter(
|
|
1662
|
+
(i) => !i.requires_shipping && i.detail.fulfilled_quantity < i.quantity
|
|
1663
|
+
);
|
|
1664
|
+
return /* @__PURE__ */ jsxs12(Fragment2, { children: [
|
|
1665
|
+
!!unfulfilledItemsWithShipping.length && /* @__PURE__ */ jsx11(
|
|
1666
|
+
UnfulfilledItemDisplay,
|
|
1667
|
+
{
|
|
1668
|
+
order,
|
|
1669
|
+
unfulfilledItems: unfulfilledItemsWithShipping,
|
|
1670
|
+
requiresShipping: true
|
|
1671
|
+
}
|
|
1672
|
+
),
|
|
1673
|
+
!!unfulfilledItemsWithoutShipping.length && /* @__PURE__ */ jsx11(
|
|
1674
|
+
UnfulfilledItemDisplay,
|
|
1675
|
+
{
|
|
1676
|
+
order,
|
|
1677
|
+
unfulfilledItems: unfulfilledItemsWithoutShipping,
|
|
1678
|
+
requiresShipping: false
|
|
1679
|
+
}
|
|
1680
|
+
)
|
|
1681
|
+
] });
|
|
1682
|
+
};
|
|
1683
|
+
var UnfulfilledItemDisplay = ({
|
|
1684
|
+
order,
|
|
1685
|
+
unfulfilledItems,
|
|
1686
|
+
requiresShipping = false
|
|
1687
|
+
}) => {
|
|
1688
|
+
const { t } = useTranslation11();
|
|
1689
|
+
if (order.status === "canceled") {
|
|
1690
|
+
return;
|
|
1691
|
+
}
|
|
1692
|
+
return /* @__PURE__ */ jsxs12(Container7, { className: "divide-y p-0", children: [
|
|
1693
|
+
/* @__PURE__ */ jsxs12("div", { className: "flex items-center justify-between px-6 py-4", children: [
|
|
1694
|
+
/* @__PURE__ */ jsx11(Heading7, { level: "h2", children: t("orders.fulfillment.unfulfilledItems") }),
|
|
1695
|
+
/* @__PURE__ */ jsxs12("div", { className: "flex items-center gap-x-4", children: [
|
|
1696
|
+
requiresShipping && /* @__PURE__ */ jsx11(StatusBadge, { color: "red", className: "text-nowrap", children: t("orders.fulfillment.requiresShipping") }),
|
|
1697
|
+
/* @__PURE__ */ jsx11(StatusBadge, { color: "red", className: "text-nowrap", children: t("orders.fulfillment.awaitingFulfillmentBadge") }),
|
|
1698
|
+
/* @__PURE__ */ jsx11(
|
|
1699
|
+
ActionMenu,
|
|
1700
|
+
{
|
|
1701
|
+
groups: [
|
|
1702
|
+
{
|
|
1703
|
+
actions: [
|
|
1704
|
+
{
|
|
1705
|
+
label: t("orders.fulfillment.fulfillItems"),
|
|
1706
|
+
icon: /* @__PURE__ */ jsx11(Buildings, {}),
|
|
1707
|
+
to: `/orders/${order.id}/fulfillment?requires_shipping=${requiresShipping}`
|
|
1708
|
+
}
|
|
1709
|
+
]
|
|
1710
|
+
}
|
|
1711
|
+
]
|
|
1712
|
+
}
|
|
1713
|
+
)
|
|
1714
|
+
] })
|
|
1715
|
+
] }),
|
|
1716
|
+
/* @__PURE__ */ jsx11("div", { children: unfulfilledItems.map((item) => /* @__PURE__ */ jsx11(
|
|
1717
|
+
UnfulfilledItem,
|
|
1718
|
+
{
|
|
1719
|
+
item,
|
|
1720
|
+
currencyCode: order.currency_code
|
|
1721
|
+
},
|
|
1722
|
+
item.id
|
|
1723
|
+
)) })
|
|
1724
|
+
] });
|
|
1725
|
+
};
|
|
1726
|
+
var Fulfillment = ({
|
|
1727
|
+
fulfillment,
|
|
1728
|
+
order,
|
|
1729
|
+
index
|
|
1730
|
+
}) => {
|
|
1731
|
+
const { t } = useTranslation11();
|
|
1732
|
+
const prompt = usePrompt2();
|
|
1733
|
+
const navigate = useNavigate5();
|
|
1734
|
+
const showLocation = !!fulfillment.location_id;
|
|
1735
|
+
const isPickUpFulfillment = fulfillment.shipping_option?.service_zone.fulfillment_set.type === "pickup" /* Pickup */;
|
|
1736
|
+
const { stock_location, isError, error } = useStockLocation(
|
|
1737
|
+
fulfillment.location_id,
|
|
1738
|
+
void 0,
|
|
1739
|
+
{
|
|
1740
|
+
enabled: showLocation
|
|
1741
|
+
}
|
|
1742
|
+
);
|
|
1743
|
+
let statusText = fulfillment.requires_shipping ? isPickUpFulfillment ? "Awaiting pickup" : "Awaiting shipping" : "Awaiting delivery";
|
|
1744
|
+
let statusColor = "blue";
|
|
1745
|
+
let statusTimestamp = fulfillment.created_at;
|
|
1746
|
+
if (fulfillment.canceled_at) {
|
|
1747
|
+
statusText = "Canceled";
|
|
1748
|
+
statusColor = "red";
|
|
1749
|
+
statusTimestamp = fulfillment.canceled_at;
|
|
1750
|
+
} else if (fulfillment.delivered_at) {
|
|
1751
|
+
statusText = "Delivered";
|
|
1752
|
+
statusColor = "green";
|
|
1753
|
+
statusTimestamp = fulfillment.delivered_at;
|
|
1754
|
+
} else if (fulfillment.shipped_at) {
|
|
1755
|
+
statusText = "Shipped";
|
|
1756
|
+
statusColor = "green";
|
|
1757
|
+
statusTimestamp = fulfillment.shipped_at;
|
|
1758
|
+
}
|
|
1759
|
+
const { mutateAsync } = useCancelOrderFulfillment(order.id, fulfillment.id);
|
|
1760
|
+
const { mutateAsync: markAsDelivered } = useMarkOrderFulfillmentAsDelivered(
|
|
1761
|
+
order.id,
|
|
1762
|
+
fulfillment.id
|
|
1763
|
+
);
|
|
1764
|
+
const showShippingButton = !fulfillment.canceled_at && !fulfillment.shipped_at && !fulfillment.delivered_at && fulfillment.requires_shipping && !isPickUpFulfillment;
|
|
1765
|
+
const showDeliveryButton = !fulfillment.canceled_at && !fulfillment.delivered_at;
|
|
1766
|
+
const handleMarkAsDelivered = async () => {
|
|
1767
|
+
const res = await prompt({
|
|
1768
|
+
title: t("general.areYouSure"),
|
|
1769
|
+
description: t("orders.fulfillment.markAsDeliveredWarning"),
|
|
1770
|
+
confirmText: t("actions.continue"),
|
|
1771
|
+
cancelText: t("actions.cancel"),
|
|
1772
|
+
variant: "confirmation"
|
|
1773
|
+
});
|
|
1774
|
+
if (res) {
|
|
1775
|
+
await markAsDelivered(void 0, {
|
|
1776
|
+
onSuccess: () => {
|
|
1777
|
+
toast6.success(
|
|
1778
|
+
t(
|
|
1779
|
+
isPickUpFulfillment ? "orders.fulfillment.toast.fulfillmentPickedUp" : "orders.fulfillment.toast.fulfillmentDelivered"
|
|
1780
|
+
)
|
|
1781
|
+
);
|
|
1782
|
+
},
|
|
1783
|
+
onError: (e) => {
|
|
1784
|
+
toast6.error(e.message);
|
|
1785
|
+
}
|
|
1786
|
+
});
|
|
1787
|
+
}
|
|
1788
|
+
};
|
|
1789
|
+
const handleCancel = async () => {
|
|
1790
|
+
if (fulfillment.shipped_at) {
|
|
1791
|
+
toast6.warning(t("orders.fulfillment.toast.fulfillmentShipped"));
|
|
1792
|
+
return;
|
|
1793
|
+
}
|
|
1794
|
+
const res = await prompt({
|
|
1795
|
+
title: t("general.areYouSure"),
|
|
1796
|
+
description: t("orders.fulfillment.cancelWarning"),
|
|
1797
|
+
confirmText: t("actions.continue"),
|
|
1798
|
+
cancelText: t("actions.cancel")
|
|
1799
|
+
});
|
|
1800
|
+
if (res) {
|
|
1801
|
+
await mutateAsync(void 0, {
|
|
1802
|
+
onSuccess: () => {
|
|
1803
|
+
toast6.success(t("orders.fulfillment.toast.canceled"));
|
|
1804
|
+
},
|
|
1805
|
+
onError: (e) => {
|
|
1806
|
+
toast6.error(e.message);
|
|
1807
|
+
}
|
|
1808
|
+
});
|
|
1809
|
+
}
|
|
1810
|
+
};
|
|
1811
|
+
if (isError) {
|
|
1812
|
+
throw error;
|
|
1813
|
+
}
|
|
1814
|
+
const isValidUrl = (url) => url && url.length > 0 && url !== "#";
|
|
1815
|
+
return /* @__PURE__ */ jsxs12(Container7, { className: "divide-y p-0", children: [
|
|
1816
|
+
/* @__PURE__ */ jsxs12("div", { className: "flex items-center justify-between px-6 py-4", children: [
|
|
1817
|
+
/* @__PURE__ */ jsx11(Heading7, { level: "h2", children: t("orders.fulfillment.number", {
|
|
1818
|
+
number: index + 1
|
|
1819
|
+
}) }),
|
|
1820
|
+
/* @__PURE__ */ jsxs12("div", { className: "flex items-center gap-x-4", children: [
|
|
1821
|
+
/* @__PURE__ */ jsx11(
|
|
1822
|
+
Tooltip2,
|
|
1823
|
+
{
|
|
1824
|
+
content: format(
|
|
1825
|
+
new Date(statusTimestamp),
|
|
1826
|
+
"dd MMM, yyyy, HH:mm:ss"
|
|
1827
|
+
),
|
|
1828
|
+
children: /* @__PURE__ */ jsx11(StatusBadge, { color: statusColor, className: "text-nowrap", children: statusText })
|
|
1829
|
+
}
|
|
1830
|
+
),
|
|
1831
|
+
/* @__PURE__ */ jsx11(
|
|
1832
|
+
ActionMenu,
|
|
1833
|
+
{
|
|
1834
|
+
groups: [
|
|
1835
|
+
{
|
|
1836
|
+
actions: [
|
|
1837
|
+
{
|
|
1838
|
+
label: t("actions.cancel"),
|
|
1839
|
+
icon: /* @__PURE__ */ jsx11(XCircle, {}),
|
|
1840
|
+
onClick: handleCancel,
|
|
1841
|
+
disabled: !!fulfillment.canceled_at || !!fulfillment.shipped_at || !!fulfillment.delivered_at
|
|
1842
|
+
}
|
|
1843
|
+
]
|
|
1844
|
+
}
|
|
1845
|
+
]
|
|
1846
|
+
}
|
|
1847
|
+
)
|
|
1848
|
+
] })
|
|
1849
|
+
] }),
|
|
1850
|
+
/* @__PURE__ */ jsxs12("div", { className: "text-ui-fg-subtle grid grid-cols-2 items-start px-6 py-4", children: [
|
|
1851
|
+
/* @__PURE__ */ jsx11(Text8, { size: "small", leading: "compact", weight: "plus", children: t("orders.fulfillment.itemsLabel") }),
|
|
1852
|
+
/* @__PURE__ */ jsx11("ul", { children: fulfillment.items.map((f_item) => /* @__PURE__ */ jsx11("li", { children: /* @__PURE__ */ jsxs12(Text8, { size: "small", leading: "compact", children: [
|
|
1853
|
+
f_item.quantity,
|
|
1854
|
+
"x ",
|
|
1855
|
+
f_item.title
|
|
1856
|
+
] }) }, f_item.line_item_id)) })
|
|
1857
|
+
] }),
|
|
1858
|
+
showLocation && /* @__PURE__ */ jsxs12("div", { className: "text-ui-fg-subtle grid grid-cols-2 items-center px-6 py-4", children: [
|
|
1859
|
+
/* @__PURE__ */ jsx11(Text8, { size: "small", leading: "compact", weight: "plus", children: t("orders.fulfillment.shippingFromLabel") }),
|
|
1860
|
+
stock_location ? /* @__PURE__ */ jsx11(
|
|
1861
|
+
Link2,
|
|
1862
|
+
{
|
|
1863
|
+
to: `/settings/locations/${stock_location.id}`,
|
|
1864
|
+
className: "text-ui-fg-interactive hover:text-ui-fg-interactive-hover transition-fg",
|
|
1865
|
+
children: /* @__PURE__ */ jsx11(Text8, { size: "small", leading: "compact", children: stock_location.name })
|
|
1866
|
+
}
|
|
1867
|
+
) : /* @__PURE__ */ jsx11(Skeleton, { className: "w-16" })
|
|
1868
|
+
] }),
|
|
1869
|
+
/* @__PURE__ */ jsxs12("div", { className: "text-ui-fg-subtle grid grid-cols-2 items-center px-6 py-4", children: [
|
|
1870
|
+
/* @__PURE__ */ jsx11(Text8, { size: "small", leading: "compact", weight: "plus", children: t("fields.provider") }),
|
|
1871
|
+
/* @__PURE__ */ jsx11(Text8, { size: "small", leading: "compact", children: formatProvider(fulfillment.provider_id) })
|
|
1872
|
+
] }),
|
|
1873
|
+
/* @__PURE__ */ jsxs12("div", { className: "text-ui-fg-subtle grid grid-cols-2 items-start px-6 py-4", children: [
|
|
1874
|
+
/* @__PURE__ */ jsx11(Text8, { size: "small", leading: "compact", weight: "plus", children: t("orders.fulfillment.trackingLabel") }),
|
|
1875
|
+
/* @__PURE__ */ jsx11("div", { children: fulfillment.labels && fulfillment.labels.length > 0 ? /* @__PURE__ */ jsx11("ul", { children: fulfillment.labels.map((tlink) => {
|
|
1876
|
+
const hasTrackingUrl = isValidUrl(tlink.tracking_url);
|
|
1877
|
+
const hasLabelUrl = isValidUrl(tlink.label_url);
|
|
1878
|
+
if (hasTrackingUrl || hasLabelUrl) {
|
|
1879
|
+
return /* @__PURE__ */ jsxs12("li", { children: [
|
|
1880
|
+
hasTrackingUrl && /* @__PURE__ */ jsx11(
|
|
1881
|
+
"a",
|
|
1882
|
+
{
|
|
1883
|
+
href: tlink.tracking_url,
|
|
1884
|
+
target: "_blank",
|
|
1885
|
+
rel: "noopener noreferrer",
|
|
1886
|
+
className: "text-ui-fg-interactive hover:text-ui-fg-interactive-hover transition-fg",
|
|
1887
|
+
children: /* @__PURE__ */ jsx11(Text8, { size: "small", leading: "compact", as: "span", children: tlink.tracking_number })
|
|
1888
|
+
}
|
|
1889
|
+
),
|
|
1890
|
+
hasTrackingUrl && hasLabelUrl && " - ",
|
|
1891
|
+
hasLabelUrl && /* @__PURE__ */ jsx11(
|
|
1892
|
+
"a",
|
|
1893
|
+
{
|
|
1894
|
+
href: tlink.label_url,
|
|
1895
|
+
target: "_blank",
|
|
1896
|
+
rel: "noopener noreferrer",
|
|
1897
|
+
className: "text-ui-fg-interactive hover:text-ui-fg-interactive-hover transition-fg",
|
|
1898
|
+
children: /* @__PURE__ */ jsx11(Text8, { size: "small", leading: "compact", as: "span", children: "Label" })
|
|
1899
|
+
}
|
|
1900
|
+
)
|
|
1901
|
+
] }, tlink.tracking_number);
|
|
1902
|
+
}
|
|
1903
|
+
return /* @__PURE__ */ jsx11("li", { children: /* @__PURE__ */ jsx11(Text8, { size: "small", leading: "compact", children: tlink.tracking_number }) }, tlink.tracking_number);
|
|
1904
|
+
}) }) : /* @__PURE__ */ jsx11(Text8, { size: "small", leading: "compact", children: "-" }) })
|
|
1905
|
+
] }),
|
|
1906
|
+
(showShippingButton || showDeliveryButton) && /* @__PURE__ */ jsxs12("div", { className: "bg-ui-bg-subtle flex items-center justify-end gap-x-2 rounded-b-xl px-4 py-4", children: [
|
|
1907
|
+
showDeliveryButton && /* @__PURE__ */ jsx11(Button6, { onClick: handleMarkAsDelivered, variant: "secondary", children: t(
|
|
1908
|
+
isPickUpFulfillment ? "orders.fulfillment.markAsPickedUp" : "orders.fulfillment.markAsDelivered"
|
|
1909
|
+
) }),
|
|
1910
|
+
showShippingButton && /* @__PURE__ */ jsx11(
|
|
1911
|
+
Button6,
|
|
1912
|
+
{
|
|
1913
|
+
onClick: () => navigate(`./${fulfillment.id}/create-shipment`),
|
|
1914
|
+
variant: "secondary",
|
|
1915
|
+
children: t("orders.fulfillment.markAsShipped")
|
|
1916
|
+
}
|
|
1917
|
+
)
|
|
1918
|
+
] })
|
|
1919
|
+
] });
|
|
1920
|
+
};
|
|
1921
|
+
|
|
1922
|
+
// src/routes/orders/order-detail/components/order-general-section/order-general-section.tsx
|
|
1923
|
+
import { XCircle as XCircle2 } from "@acmekit/icons";
|
|
1924
|
+
import {
|
|
1925
|
+
Container as Container8,
|
|
1926
|
+
Copy as Copy4,
|
|
1927
|
+
Heading as Heading8,
|
|
1928
|
+
StatusBadge as StatusBadge2,
|
|
1929
|
+
Text as Text9,
|
|
1930
|
+
toast as toast7,
|
|
1931
|
+
usePrompt as usePrompt3
|
|
1932
|
+
} from "@acmekit/ui";
|
|
1933
|
+
import { useTranslation as useTranslation12 } from "react-i18next";
|
|
1934
|
+
import { jsx as jsx12, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
1935
|
+
var OrderGeneralSection = ({ order }) => {
|
|
1936
|
+
const { t } = useTranslation12();
|
|
1937
|
+
const prompt = usePrompt3();
|
|
1938
|
+
const { getFullDate } = useDate();
|
|
1939
|
+
const { mutateAsync: cancelOrder } = useCancelOrder(order.id);
|
|
1940
|
+
const handleCancel = async () => {
|
|
1941
|
+
const res = await prompt({
|
|
1942
|
+
title: t("general.areYouSure"),
|
|
1943
|
+
description: t("orders.cancelWarning", {
|
|
1944
|
+
id: `#${order.display_id}`
|
|
1945
|
+
}),
|
|
1946
|
+
confirmText: t("actions.continue"),
|
|
1947
|
+
cancelText: t("actions.cancel")
|
|
1948
|
+
});
|
|
1949
|
+
if (!res) {
|
|
1950
|
+
return;
|
|
1951
|
+
}
|
|
1952
|
+
await cancelOrder(void 0, {
|
|
1953
|
+
onSuccess: () => {
|
|
1954
|
+
toast7.success(t("orders.orderCanceled"));
|
|
1955
|
+
},
|
|
1956
|
+
onError: (e) => {
|
|
1957
|
+
toast7.error(e.message);
|
|
1958
|
+
}
|
|
1959
|
+
});
|
|
1960
|
+
};
|
|
1961
|
+
return /* @__PURE__ */ jsxs13(Container8, { className: "flex items-center justify-between px-6 py-4", children: [
|
|
1962
|
+
/* @__PURE__ */ jsxs13("div", { children: [
|
|
1963
|
+
/* @__PURE__ */ jsxs13("div", { className: "flex items-center gap-x-1", children: [
|
|
1964
|
+
/* @__PURE__ */ jsxs13(Heading8, { children: [
|
|
1965
|
+
"#",
|
|
1966
|
+
order.display_id
|
|
1967
|
+
] }),
|
|
1968
|
+
/* @__PURE__ */ jsx12(Copy4, { content: `#${order.display_id}`, className: "text-ui-fg-muted" })
|
|
1969
|
+
] }),
|
|
1970
|
+
/* @__PURE__ */ jsx12(Text9, { size: "small", className: "text-ui-fg-subtle", children: t("orders.onDateFromSalesChannel", {
|
|
1971
|
+
date: getFullDate({ date: order.created_at, includeTime: true }),
|
|
1972
|
+
salesChannel: order.sales_channel?.name
|
|
1973
|
+
}) })
|
|
1974
|
+
] }),
|
|
1975
|
+
/* @__PURE__ */ jsxs13("div", { className: "flex items-center gap-x-4", children: [
|
|
1976
|
+
/* @__PURE__ */ jsxs13("div", { className: "flex items-center gap-x-1.5", children: [
|
|
1977
|
+
/* @__PURE__ */ jsx12(OrderBadge, { order }),
|
|
1978
|
+
/* @__PURE__ */ jsx12(PaymentBadge, { order }),
|
|
1979
|
+
/* @__PURE__ */ jsx12(FulfillmentBadge, { order })
|
|
1980
|
+
] }),
|
|
1981
|
+
/* @__PURE__ */ jsx12(
|
|
1982
|
+
ActionMenu,
|
|
1983
|
+
{
|
|
1984
|
+
groups: [
|
|
1985
|
+
{
|
|
1986
|
+
actions: [
|
|
1987
|
+
{
|
|
1988
|
+
label: t("actions.cancel"),
|
|
1989
|
+
onClick: handleCancel,
|
|
1990
|
+
disabled: !!order.canceled_at,
|
|
1991
|
+
icon: /* @__PURE__ */ jsx12(XCircle2, {})
|
|
1992
|
+
}
|
|
1993
|
+
]
|
|
1994
|
+
}
|
|
1995
|
+
]
|
|
1996
|
+
}
|
|
1997
|
+
)
|
|
1998
|
+
] })
|
|
1999
|
+
] });
|
|
2000
|
+
};
|
|
2001
|
+
var FulfillmentBadge = ({ order }) => {
|
|
2002
|
+
const { t } = useTranslation12();
|
|
2003
|
+
const { label, color } = getOrderFulfillmentStatus(
|
|
2004
|
+
t,
|
|
2005
|
+
order.fulfillment_status
|
|
2006
|
+
);
|
|
2007
|
+
return /* @__PURE__ */ jsx12(StatusBadge2, { color, className: "text-nowrap", children: label });
|
|
2008
|
+
};
|
|
2009
|
+
var PaymentBadge = ({ order }) => {
|
|
2010
|
+
const { t } = useTranslation12();
|
|
2011
|
+
const { label, color } = getOrderPaymentStatus(t, order.payment_status);
|
|
2012
|
+
return /* @__PURE__ */ jsx12(StatusBadge2, { color, className: "text-nowrap", children: label });
|
|
2013
|
+
};
|
|
2014
|
+
var OrderBadge = ({ order }) => {
|
|
2015
|
+
const { t } = useTranslation12();
|
|
2016
|
+
const orderStatus = getCanceledOrderStatus(t, order.status);
|
|
2017
|
+
if (!orderStatus) {
|
|
2018
|
+
return null;
|
|
2019
|
+
}
|
|
2020
|
+
return /* @__PURE__ */ jsx12(StatusBadge2, { color: orderStatus.color, className: "text-nowrap", children: orderStatus.label });
|
|
2021
|
+
};
|
|
2022
|
+
|
|
2023
|
+
// src/routes/orders/order-detail/components/order-payment-section/order-payment-section.tsx
|
|
2024
|
+
import { ArrowDownRightMini, DocumentText, XCircle as XCircle3 } from "@acmekit/icons";
|
|
2025
|
+
import {
|
|
2026
|
+
Badge,
|
|
2027
|
+
Button as Button7,
|
|
2028
|
+
Container as Container9,
|
|
2029
|
+
Heading as Heading9,
|
|
2030
|
+
StatusBadge as StatusBadge3,
|
|
2031
|
+
Text as Text10,
|
|
2032
|
+
toast as toast9,
|
|
2033
|
+
Tooltip as Tooltip4,
|
|
2034
|
+
usePrompt as usePrompt4
|
|
2035
|
+
} from "@acmekit/ui";
|
|
2036
|
+
import { format as format2 } from "date-fns";
|
|
2037
|
+
import { Trans, useTranslation as useTranslation14 } from "react-i18next";
|
|
2038
|
+
|
|
2039
|
+
// src/components/common/display-id/display-id.tsx
|
|
2040
|
+
import { useTranslation as useTranslation13 } from "react-i18next";
|
|
2041
|
+
import { useState as useState4 } from "react";
|
|
2042
|
+
import copy from "copy-to-clipboard";
|
|
2043
|
+
import { clx as clx2, toast as toast8, Tooltip as Tooltip3 } from "@acmekit/ui";
|
|
2044
|
+
import { jsx as jsx13, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
2045
|
+
function DisplayId({ id, className }) {
|
|
2046
|
+
const { t } = useTranslation13();
|
|
2047
|
+
const [open, setOpen] = useState4(false);
|
|
2048
|
+
const onClick = () => {
|
|
2049
|
+
copy(id);
|
|
2050
|
+
toast8.success(t("actions.idCopiedToClipboard"));
|
|
2051
|
+
};
|
|
2052
|
+
return /* @__PURE__ */ jsx13(Tooltip3, { maxWidth: 260, content: id, open, onOpenChange: setOpen, children: /* @__PURE__ */ jsxs14("span", { onClick, className: clx2("cursor-pointer", className), children: [
|
|
2053
|
+
"#",
|
|
2054
|
+
id.slice(-7)
|
|
2055
|
+
] }) });
|
|
2056
|
+
}
|
|
2057
|
+
var display_id_default = DisplayId;
|
|
2058
|
+
|
|
2059
|
+
// src/lib/payment.ts
|
|
2060
|
+
var getTotalCaptured = (paymentCollections) => paymentCollections.reduce((acc, paymentCollection) => {
|
|
2061
|
+
acc = acc + (paymentCollection.captured_amount - paymentCollection.refunded_amount);
|
|
2062
|
+
return acc;
|
|
2063
|
+
}, 0);
|
|
2064
|
+
var getTotalPending = (paymentCollections) => paymentCollections.filter((pc) => pc.status !== "canceled").reduce((acc, paymentCollection) => {
|
|
2065
|
+
acc += paymentCollection.amount - paymentCollection.captured_amount;
|
|
2066
|
+
return acc;
|
|
2067
|
+
}, 0);
|
|
2068
|
+
|
|
2069
|
+
// src/routes/orders/order-detail/components/order-payment-section/order-payment-section.tsx
|
|
2070
|
+
import { jsx as jsx14, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
2071
|
+
var OrderPaymentSection = ({
|
|
2072
|
+
order,
|
|
2073
|
+
plugins
|
|
2074
|
+
}) => {
|
|
2075
|
+
const payments = getPaymentsFromOrder(order);
|
|
2076
|
+
const refunds = payments.map((payment) => payment?.refunds).flat(1).filter(Boolean);
|
|
2077
|
+
return /* @__PURE__ */ jsxs15(Container9, { className: "divide-y divide-dashed p-0", children: [
|
|
2078
|
+
/* @__PURE__ */ jsx14(Header2, { order }),
|
|
2079
|
+
/* @__PURE__ */ jsx14(
|
|
2080
|
+
PaymentBreakdown,
|
|
2081
|
+
{
|
|
2082
|
+
order,
|
|
2083
|
+
plugins,
|
|
2084
|
+
payments,
|
|
2085
|
+
refunds,
|
|
2086
|
+
currencyCode: order.currency_code
|
|
2087
|
+
}
|
|
2088
|
+
),
|
|
2089
|
+
/* @__PURE__ */ jsx14(Total, { order })
|
|
2090
|
+
] });
|
|
2091
|
+
};
|
|
2092
|
+
var Header2 = ({ order }) => {
|
|
2093
|
+
const { t } = useTranslation14();
|
|
2094
|
+
const { label, color } = getOrderPaymentStatus(t, order.payment_status);
|
|
2095
|
+
return /* @__PURE__ */ jsxs15("div", { className: "flex items-center justify-between px-6 py-4", children: [
|
|
2096
|
+
/* @__PURE__ */ jsx14(Heading9, { level: "h2", children: t("orders.payment.title") }),
|
|
2097
|
+
/* @__PURE__ */ jsx14(StatusBadge3, { color, className: "text-nowrap", children: label })
|
|
2098
|
+
] });
|
|
2099
|
+
};
|
|
2100
|
+
var Refund = ({
|
|
2101
|
+
refund,
|
|
2102
|
+
currencyCode
|
|
2103
|
+
}) => {
|
|
2104
|
+
const { t } = useTranslation14();
|
|
2105
|
+
const RefundReasonBadge = refund?.refund_reason && /* @__PURE__ */ jsx14(
|
|
2106
|
+
Badge,
|
|
2107
|
+
{
|
|
2108
|
+
size: "2xsmall",
|
|
2109
|
+
className: "cursor-default select-none capitalize",
|
|
2110
|
+
rounded: "full",
|
|
2111
|
+
children: refund.refund_reason.label
|
|
2112
|
+
}
|
|
2113
|
+
);
|
|
2114
|
+
const RefundNoteIndicator = refund.note && /* @__PURE__ */ jsx14(Tooltip4, { content: refund.note, children: /* @__PURE__ */ jsx14(DocumentText, { className: "text-ui-tag-neutral-icon ml-1 inline" }) });
|
|
2115
|
+
return /* @__PURE__ */ jsxs15("div", { className: "bg-ui-bg-subtle text-ui-fg-subtle grid grid-cols-[1fr_1fr_1fr_20px] items-center gap-x-4 px-6 py-4", children: [
|
|
2116
|
+
/* @__PURE__ */ jsxs15("div", { className: "flex flex-row", children: [
|
|
2117
|
+
/* @__PURE__ */ jsx14("div", { className: "self-center pr-3", children: /* @__PURE__ */ jsx14(ArrowDownRightMini, { className: "text-ui-fg-muted" }) }),
|
|
2118
|
+
/* @__PURE__ */ jsxs15("div", { children: [
|
|
2119
|
+
/* @__PURE__ */ jsxs15(Text10, { size: "small", leading: "compact", weight: "plus", children: [
|
|
2120
|
+
t("orders.payment.refund"),
|
|
2121
|
+
" ",
|
|
2122
|
+
RefundNoteIndicator
|
|
2123
|
+
] }),
|
|
2124
|
+
/* @__PURE__ */ jsx14(Text10, { size: "small", leading: "compact", children: format2(new Date(refund.created_at), "dd MMM, yyyy, HH:mm:ss") })
|
|
2125
|
+
] })
|
|
2126
|
+
] }),
|
|
2127
|
+
/* @__PURE__ */ jsx14("div", { className: "flex items-center justify-end", children: RefundReasonBadge }),
|
|
2128
|
+
/* @__PURE__ */ jsx14("div", { className: "flex items-center justify-end", children: /* @__PURE__ */ jsxs15(Text10, { size: "small", leading: "compact", children: [
|
|
2129
|
+
"- ",
|
|
2130
|
+
getLocaleAmount(refund.amount, currencyCode)
|
|
2131
|
+
] }) })
|
|
2132
|
+
] });
|
|
2133
|
+
};
|
|
2134
|
+
var Payment = ({
|
|
2135
|
+
order,
|
|
2136
|
+
payment,
|
|
2137
|
+
refunds,
|
|
2138
|
+
currencyCode
|
|
2139
|
+
}) => {
|
|
2140
|
+
const { t } = useTranslation14();
|
|
2141
|
+
const prompt = usePrompt4();
|
|
2142
|
+
const { mutateAsync } = useCapturePayment(order.id, payment.id);
|
|
2143
|
+
const handleCapture = async () => {
|
|
2144
|
+
const res = await prompt({
|
|
2145
|
+
title: t("orders.payment.capture"),
|
|
2146
|
+
description: t("orders.payment.capturePayment", {
|
|
2147
|
+
amount: formatCurrency(payment.amount, currencyCode)
|
|
2148
|
+
}),
|
|
2149
|
+
confirmText: t("actions.confirm"),
|
|
2150
|
+
cancelText: t("actions.cancel"),
|
|
2151
|
+
variant: "confirmation"
|
|
2152
|
+
});
|
|
2153
|
+
if (!res) {
|
|
2154
|
+
return;
|
|
2155
|
+
}
|
|
2156
|
+
await mutateAsync(
|
|
2157
|
+
{ amount: payment.amount },
|
|
2158
|
+
{
|
|
2159
|
+
onSuccess: () => {
|
|
2160
|
+
toast9.success(
|
|
2161
|
+
t("orders.payment.capturePaymentSuccess", {
|
|
2162
|
+
amount: formatCurrency(payment.amount, currencyCode)
|
|
2163
|
+
})
|
|
2164
|
+
);
|
|
2165
|
+
},
|
|
2166
|
+
onError: (error) => {
|
|
2167
|
+
toast9.error(error.message);
|
|
2168
|
+
}
|
|
2169
|
+
}
|
|
2170
|
+
);
|
|
2171
|
+
};
|
|
2172
|
+
const getPaymentStatusAttributes = (payment2) => {
|
|
2173
|
+
if (payment2.canceled_at) {
|
|
2174
|
+
return ["Canceled", "red"];
|
|
2175
|
+
} else if (payment2.captured_at) {
|
|
2176
|
+
return ["Captured", "green"];
|
|
2177
|
+
} else {
|
|
2178
|
+
return ["Pending", "orange"];
|
|
2179
|
+
}
|
|
2180
|
+
};
|
|
2181
|
+
const [status, color] = getPaymentStatusAttributes(payment);
|
|
2182
|
+
const showCapture = payment.captured_at === null && payment.canceled_at === null;
|
|
2183
|
+
const totalRefunded = payment.refunds.reduce(
|
|
2184
|
+
(acc, next) => next.amount + acc,
|
|
2185
|
+
0
|
|
2186
|
+
);
|
|
2187
|
+
return /* @__PURE__ */ jsxs15("div", { className: "divide-y divide-dashed", children: [
|
|
2188
|
+
/* @__PURE__ */ jsxs15("div", { className: "text-ui-fg-subtle grid grid-cols-[1fr_1fr_1fr_20px] items-center gap-x-4 px-6 py-4 sm:grid-cols-[1fr_1fr_1fr_1fr_20px]", children: [
|
|
2189
|
+
/* @__PURE__ */ jsxs15("div", { className: "w-full min-w-[60px] overflow-hidden", children: [
|
|
2190
|
+
/* @__PURE__ */ jsx14(
|
|
2191
|
+
Text10,
|
|
2192
|
+
{
|
|
2193
|
+
size: "small",
|
|
2194
|
+
leading: "compact",
|
|
2195
|
+
weight: "plus",
|
|
2196
|
+
className: "truncate",
|
|
2197
|
+
children: /* @__PURE__ */ jsx14(display_id_default, { id: payment.id })
|
|
2198
|
+
}
|
|
2199
|
+
),
|
|
2200
|
+
/* @__PURE__ */ jsx14(Text10, { size: "small", leading: "compact", children: format2(
|
|
2201
|
+
new Date(payment.created_at),
|
|
2202
|
+
"dd MMM, yyyy, HH:mm:ss"
|
|
2203
|
+
) })
|
|
2204
|
+
] }),
|
|
2205
|
+
/* @__PURE__ */ jsx14("div", { className: "hidden items-center justify-end sm:flex", children: /* @__PURE__ */ jsx14(Text10, { size: "small", leading: "compact", className: "capitalize", children: payment.provider_id }) }),
|
|
2206
|
+
/* @__PURE__ */ jsx14("div", { className: "flex items-center justify-end", children: /* @__PURE__ */ jsx14(StatusBadge3, { color, className: "text-nowrap", children: status }) }),
|
|
2207
|
+
/* @__PURE__ */ jsx14("div", { className: "flex items-center justify-end", children: /* @__PURE__ */ jsx14(Text10, { size: "small", leading: "compact", children: getLocaleAmount(payment.amount, payment.currency_code) }) }),
|
|
2208
|
+
/* @__PURE__ */ jsx14(
|
|
2209
|
+
ActionMenu,
|
|
2210
|
+
{
|
|
2211
|
+
groups: [
|
|
2212
|
+
{
|
|
2213
|
+
actions: [
|
|
2214
|
+
{
|
|
2215
|
+
label: t("orders.payment.refund"),
|
|
2216
|
+
icon: /* @__PURE__ */ jsx14(XCircle3, {}),
|
|
2217
|
+
to: `/orders/${order.id}/refund?paymentId=${payment.id}`,
|
|
2218
|
+
disabled: !payment.captured_at || !!payment.canceled_at || totalRefunded >= payment.amount
|
|
2219
|
+
}
|
|
2220
|
+
]
|
|
2221
|
+
}
|
|
2222
|
+
]
|
|
2223
|
+
}
|
|
2224
|
+
)
|
|
2225
|
+
] }),
|
|
2226
|
+
showCapture && /* @__PURE__ */ jsxs15("div", { className: "bg-ui-bg-subtle flex items-center justify-between px-6 py-4", children: [
|
|
2227
|
+
/* @__PURE__ */ jsxs15("div", { className: "flex items-center gap-x-2", children: [
|
|
2228
|
+
/* @__PURE__ */ jsx14(ArrowDownRightMini, { className: "text-ui-fg-muted shrink-0" }),
|
|
2229
|
+
/* @__PURE__ */ jsx14(Text10, { size: "small", leading: "compact", children: /* @__PURE__ */ jsx14(
|
|
2230
|
+
Trans,
|
|
2231
|
+
{
|
|
2232
|
+
i18nKey: "orders.payment.isReadyToBeCaptured",
|
|
2233
|
+
components: [/* @__PURE__ */ jsx14(display_id_default, { id: payment.id })]
|
|
2234
|
+
}
|
|
2235
|
+
) })
|
|
2236
|
+
] }),
|
|
2237
|
+
/* @__PURE__ */ jsxs15(
|
|
2238
|
+
Button7,
|
|
2239
|
+
{
|
|
2240
|
+
className: "shrink-0",
|
|
2241
|
+
size: "small",
|
|
2242
|
+
variant: "secondary",
|
|
2243
|
+
onClick: handleCapture,
|
|
2244
|
+
children: [
|
|
2245
|
+
/* @__PURE__ */ jsx14("span", { className: "hidden sm:block", children: t("orders.payment.capture") }),
|
|
2246
|
+
/* @__PURE__ */ jsx14("span", { className: "sm:hidden", children: t("orders.payment.capture_short") })
|
|
2247
|
+
]
|
|
2248
|
+
}
|
|
2249
|
+
)
|
|
2250
|
+
] }),
|
|
2251
|
+
refunds.map((refund) => /* @__PURE__ */ jsx14(Refund, { refund, currencyCode }, refund.id))
|
|
2252
|
+
] });
|
|
2253
|
+
};
|
|
2254
|
+
var CreditLine = ({
|
|
2255
|
+
creditLine,
|
|
2256
|
+
currencyCode,
|
|
2257
|
+
plugins
|
|
2258
|
+
}) => {
|
|
2259
|
+
const loyaltyPlugin = getLoyaltyPlugin(plugins);
|
|
2260
|
+
if (!loyaltyPlugin) {
|
|
2261
|
+
return null;
|
|
2262
|
+
}
|
|
2263
|
+
const prettyReference = creditLine.reference?.split("_").join(" ").split("-").join(" ");
|
|
2264
|
+
const prettyReferenceId = creditLine.reference_id ? /* @__PURE__ */ jsx14(display_id_default, { id: creditLine.reference_id }) : null;
|
|
2265
|
+
return /* @__PURE__ */ jsx14("div", { className: "divide-y divide-dashed", children: /* @__PURE__ */ jsxs15("div", { className: "text-ui-fg-subtle grid grid-cols-[1fr_1fr_20px] items-center gap-x-4 px-6 py-4 sm:grid-cols-[1fr_1fr_1fr_20px]", children: [
|
|
2266
|
+
/* @__PURE__ */ jsxs15("div", { className: "w-full min-w-[60px] overflow-hidden", children: [
|
|
2267
|
+
/* @__PURE__ */ jsx14(
|
|
2268
|
+
Text10,
|
|
2269
|
+
{
|
|
2270
|
+
size: "small",
|
|
2271
|
+
leading: "compact",
|
|
2272
|
+
weight: "plus",
|
|
2273
|
+
className: "truncate",
|
|
2274
|
+
children: loyaltyPlugin ? /* @__PURE__ */ jsx14(Text10, { size: "small", leading: "compact", weight: "plus", children: "Store credit refund" }) : /* @__PURE__ */ jsx14(display_id_default, { id: creditLine.id })
|
|
2275
|
+
}
|
|
2276
|
+
),
|
|
2277
|
+
/* @__PURE__ */ jsx14(Text10, { size: "small", leading: "compact", children: format2(
|
|
2278
|
+
new Date(creditLine.created_at),
|
|
2279
|
+
"dd MMM, yyyy, HH:mm:ss"
|
|
2280
|
+
) })
|
|
2281
|
+
] }),
|
|
2282
|
+
/* @__PURE__ */ jsx14("div", { className: "hidden items-center justify-end sm:flex", children: /* @__PURE__ */ jsxs15(Text10, { size: "small", leading: "compact", className: "capitalize", children: [
|
|
2283
|
+
prettyReference,
|
|
2284
|
+
" (",
|
|
2285
|
+
prettyReferenceId,
|
|
2286
|
+
")"
|
|
2287
|
+
] }) }),
|
|
2288
|
+
/* @__PURE__ */ jsx14("div", { className: "flex items-center justify-end", children: /* @__PURE__ */ jsx14(Text10, { size: "small", leading: "compact", children: getLocaleAmount(creditLine.amount, currencyCode) }) })
|
|
2289
|
+
] }) });
|
|
2290
|
+
};
|
|
2291
|
+
var PaymentBreakdown = ({
|
|
2292
|
+
order,
|
|
2293
|
+
payments,
|
|
2294
|
+
refunds,
|
|
2295
|
+
currencyCode,
|
|
2296
|
+
plugins
|
|
2297
|
+
}) => {
|
|
2298
|
+
const orderRefunds = refunds.filter((refund) => refund.payment_id === null);
|
|
2299
|
+
const creditLines = order.credit_lines ?? [];
|
|
2300
|
+
const creditLineRefunds = creditLines.filter(
|
|
2301
|
+
(creditLine) => creditLine.amount < 0
|
|
2302
|
+
);
|
|
2303
|
+
const entries = [...orderRefunds, ...payments, ...creditLineRefunds].sort((a, b) => {
|
|
2304
|
+
return new Date(a.created_at).getTime() - new Date(b.created_at).getTime();
|
|
2305
|
+
}).map((entry) => {
|
|
2306
|
+
let type = entry.id.startsWith("pay_") ? "payment" : "refund";
|
|
2307
|
+
if (entry.id.startsWith("ordcl_")) {
|
|
2308
|
+
type = "credit_line_refund";
|
|
2309
|
+
}
|
|
2310
|
+
return { event: entry, type };
|
|
2311
|
+
});
|
|
2312
|
+
return /* @__PURE__ */ jsx14("div", { className: "flex flex-col divide-y divide-dashed", children: entries.map(({ type, event }) => {
|
|
2313
|
+
switch (type) {
|
|
2314
|
+
case "payment":
|
|
2315
|
+
return /* @__PURE__ */ jsx14(
|
|
2316
|
+
Payment,
|
|
2317
|
+
{
|
|
2318
|
+
order,
|
|
2319
|
+
payment: event,
|
|
2320
|
+
refunds: refunds.filter(
|
|
2321
|
+
(refund) => refund.payment_id === event.id
|
|
2322
|
+
),
|
|
2323
|
+
currencyCode
|
|
2324
|
+
},
|
|
2325
|
+
event.id
|
|
2326
|
+
);
|
|
2327
|
+
case "refund":
|
|
2328
|
+
return /* @__PURE__ */ jsx14(
|
|
2329
|
+
Refund,
|
|
2330
|
+
{
|
|
2331
|
+
refund: event,
|
|
2332
|
+
currencyCode
|
|
2333
|
+
},
|
|
2334
|
+
event.id
|
|
2335
|
+
);
|
|
2336
|
+
case "credit_line_refund":
|
|
2337
|
+
return /* @__PURE__ */ jsx14(
|
|
2338
|
+
CreditLine,
|
|
2339
|
+
{
|
|
2340
|
+
creditLine: event,
|
|
2341
|
+
currencyCode,
|
|
2342
|
+
plugins
|
|
2343
|
+
},
|
|
2344
|
+
event.id
|
|
2345
|
+
);
|
|
2346
|
+
}
|
|
2347
|
+
}) });
|
|
2348
|
+
};
|
|
2349
|
+
var Total = ({ order }) => {
|
|
2350
|
+
const { t } = useTranslation14();
|
|
2351
|
+
const totalPending = getTotalPending(order.payment_collections);
|
|
2352
|
+
return /* @__PURE__ */ jsxs15("div", { className: "flex flex-col gap-y-4 px-6 py-4", children: [
|
|
2353
|
+
/* @__PURE__ */ jsxs15("div", { className: "flex items-center justify-between", children: [
|
|
2354
|
+
/* @__PURE__ */ jsx14(Text10, { size: "small", weight: "plus", leading: "compact", children: t("orders.payment.totalPaidByCustomer") }),
|
|
2355
|
+
/* @__PURE__ */ jsx14(Text10, { size: "small", weight: "plus", leading: "compact", children: getStylizedAmount(
|
|
2356
|
+
getTotalCaptured(order.payment_collections),
|
|
2357
|
+
order.currency_code
|
|
2358
|
+
) })
|
|
2359
|
+
] }),
|
|
2360
|
+
order.status !== "canceled" && totalPending > 0 && /* @__PURE__ */ jsxs15("div", { className: "flex items-center justify-between", children: [
|
|
2361
|
+
/* @__PURE__ */ jsx14(Text10, { size: "small", weight: "plus", leading: "compact", children: "Total pending" }),
|
|
2362
|
+
/* @__PURE__ */ jsx14(Text10, { size: "small", weight: "plus", leading: "compact", children: getStylizedAmount(totalPending, order.currency_code) })
|
|
2363
|
+
] })
|
|
2364
|
+
] });
|
|
2365
|
+
};
|
|
2366
|
+
|
|
2367
|
+
// src/routes/orders/order-detail/components/order-summary-section/order-summary-section.tsx
|
|
2368
|
+
import { useMemo as useMemo3, useState as useState7 } from "react";
|
|
2369
|
+
import { useTranslation as useTranslation18 } from "react-i18next";
|
|
2370
|
+
import { Link as Link3 } from "react-router-dom";
|
|
2371
|
+
import {
|
|
2372
|
+
ArrowDownRightMini as ArrowDownRightMini2,
|
|
2373
|
+
ArrowLongRight,
|
|
2374
|
+
ArrowPath as ArrowPath3,
|
|
2375
|
+
ArrowUturnLeft as ArrowUturnLeft2,
|
|
2376
|
+
DocumentText as DocumentText2,
|
|
2377
|
+
ExclamationCircle as ExclamationCircle2,
|
|
2378
|
+
PencilSquare,
|
|
2379
|
+
ReceiptPercent,
|
|
2380
|
+
TriangleDownMini
|
|
2381
|
+
} from "@acmekit/icons";
|
|
2382
|
+
import {
|
|
2383
|
+
Badge as Badge4,
|
|
2384
|
+
Button as Button9,
|
|
2385
|
+
clx as clx3,
|
|
2386
|
+
Container as Container10,
|
|
2387
|
+
Copy as Copy5,
|
|
2388
|
+
Heading as Heading10,
|
|
2389
|
+
StatusBadge as StatusBadge4,
|
|
2390
|
+
Text as Text12,
|
|
2391
|
+
toast as toast10,
|
|
2392
|
+
Tooltip as Tooltip7,
|
|
2393
|
+
usePrompt as usePrompt5
|
|
2394
|
+
} from "@acmekit/ui";
|
|
2395
|
+
|
|
2396
|
+
// src/lib/credit-line.ts
|
|
2397
|
+
var getTotalCreditLines = (creditLines) => creditLines.reduce((acc, creditLine) => {
|
|
2398
|
+
acc = acc + creditLine.amount;
|
|
2399
|
+
return acc;
|
|
2400
|
+
}, 0);
|
|
2401
|
+
|
|
2402
|
+
// src/routes/orders/order-detail/components/copy-payment-link/copy-payment-link.tsx
|
|
2403
|
+
import { CheckCircleSolid, SquareTwoStack } from "@acmekit/icons";
|
|
2404
|
+
import { Button as Button8, Tooltip as Tooltip5 } from "@acmekit/ui";
|
|
2405
|
+
import copy2 from "copy-to-clipboard";
|
|
2406
|
+
import React, { useState as useState5 } from "react";
|
|
2407
|
+
import { useTranslation as useTranslation15 } from "react-i18next";
|
|
2408
|
+
|
|
2409
|
+
// src/lib/storefront.ts
|
|
2410
|
+
var MEDUSA_STOREFRONT_URL = __STOREFRONT_URL__ ?? "http://localhost:8000";
|
|
2411
|
+
|
|
2412
|
+
// src/routes/orders/order-detail/components/copy-payment-link/copy-payment-link.tsx
|
|
2413
|
+
import { jsx as jsx15, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
2414
|
+
var CopyPaymentLink = React.forwardRef(
|
|
2415
|
+
({ paymentCollection, order }, ref) => {
|
|
2416
|
+
const [done, setDone] = useState5(false);
|
|
2417
|
+
const [open, setOpen] = useState5(false);
|
|
2418
|
+
const [text, setText] = useState5("CopyPaymentLink");
|
|
2419
|
+
const { t } = useTranslation15();
|
|
2420
|
+
const copyToClipboard = async (e) => {
|
|
2421
|
+
e.stopPropagation();
|
|
2422
|
+
setDone(true);
|
|
2423
|
+
copy2(
|
|
2424
|
+
`${MEDUSA_STOREFRONT_URL}/payment-collection/${paymentCollection.id}`
|
|
2425
|
+
);
|
|
2426
|
+
setTimeout(() => {
|
|
2427
|
+
setDone(false);
|
|
2428
|
+
}, 2e3);
|
|
2429
|
+
};
|
|
2430
|
+
React.useEffect(() => {
|
|
2431
|
+
if (done) {
|
|
2432
|
+
setText(t("actions.copied"));
|
|
2433
|
+
return;
|
|
2434
|
+
}
|
|
2435
|
+
setTimeout(() => {
|
|
2436
|
+
setText(t("actions.copy"));
|
|
2437
|
+
}, 500);
|
|
2438
|
+
}, [done]);
|
|
2439
|
+
return /* @__PURE__ */ jsx15(Tooltip5, { content: text, open: done || open, onOpenChange: setOpen, children: /* @__PURE__ */ jsxs16(
|
|
2440
|
+
Button8,
|
|
2441
|
+
{
|
|
2442
|
+
ref,
|
|
2443
|
+
variant: "secondary",
|
|
2444
|
+
size: "small",
|
|
2445
|
+
"aria-label": "CopyPaymentLink code snippet",
|
|
2446
|
+
onClick: copyToClipboard,
|
|
2447
|
+
children: [
|
|
2448
|
+
done ? /* @__PURE__ */ jsx15(CheckCircleSolid, { className: "inline" }) : /* @__PURE__ */ jsx15(SquareTwoStack, { className: "inline" }),
|
|
2449
|
+
t("orders.payment.paymentLink", {
|
|
2450
|
+
amount: getStylizedAmount(
|
|
2451
|
+
paymentCollection.amount,
|
|
2452
|
+
order?.currency_code
|
|
2453
|
+
)
|
|
2454
|
+
})
|
|
2455
|
+
]
|
|
2456
|
+
}
|
|
2457
|
+
) });
|
|
2458
|
+
}
|
|
2459
|
+
);
|
|
2460
|
+
CopyPaymentLink.displayName = "CopyPaymentLink";
|
|
2461
|
+
|
|
2462
|
+
// src/routes/orders/order-detail/components/order-summary-section/return-info-popover.tsx
|
|
2463
|
+
import { InformationCircleSolid } from "@acmekit/icons";
|
|
2464
|
+
import { Badge as Badge2, Popover as Popover3, Text as Text11 } from "@acmekit/ui";
|
|
2465
|
+
import { useState as useState6 } from "react";
|
|
2466
|
+
import { useTranslation as useTranslation16 } from "react-i18next";
|
|
2467
|
+
import { jsx as jsx16, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
2468
|
+
function ReturnInfoPopover({ orderReturn }) {
|
|
2469
|
+
const { t } = useTranslation16();
|
|
2470
|
+
const [open, setOpen] = useState6(false);
|
|
2471
|
+
const { getFullDate } = useDate();
|
|
2472
|
+
const handleMouseEnter = () => {
|
|
2473
|
+
setOpen(true);
|
|
2474
|
+
};
|
|
2475
|
+
const handleMouseLeave = () => {
|
|
2476
|
+
setOpen(false);
|
|
2477
|
+
};
|
|
2478
|
+
let returnType = "Return";
|
|
2479
|
+
let returnTypeId = orderReturn.id;
|
|
2480
|
+
if (orderReturn.claim_id) {
|
|
2481
|
+
returnType = "Claim";
|
|
2482
|
+
returnTypeId = orderReturn.claim_id;
|
|
2483
|
+
}
|
|
2484
|
+
if (orderReturn.exchange_id) {
|
|
2485
|
+
returnType = "Exchange";
|
|
2486
|
+
returnTypeId = orderReturn.exchange_id;
|
|
2487
|
+
}
|
|
2488
|
+
if (typeof orderReturn !== "object") {
|
|
2489
|
+
return;
|
|
2490
|
+
}
|
|
2491
|
+
return /* @__PURE__ */ jsxs17(Popover3, { open, children: [
|
|
2492
|
+
/* @__PURE__ */ jsx16(
|
|
2493
|
+
Popover3.Trigger,
|
|
2494
|
+
{
|
|
2495
|
+
onMouseEnter: handleMouseEnter,
|
|
2496
|
+
onMouseLeave: handleMouseLeave,
|
|
2497
|
+
autoFocus: false,
|
|
2498
|
+
className: "align-sub focus-visible:outline-none",
|
|
2499
|
+
children: /* @__PURE__ */ jsx16(InformationCircleSolid, {})
|
|
2500
|
+
}
|
|
2501
|
+
),
|
|
2502
|
+
/* @__PURE__ */ jsx16(
|
|
2503
|
+
Popover3.Content,
|
|
2504
|
+
{
|
|
2505
|
+
align: "center",
|
|
2506
|
+
side: "top",
|
|
2507
|
+
className: "bg-ui-bg-component p-2 focus-visible:outline-none",
|
|
2508
|
+
children: /* @__PURE__ */ jsxs17("div", { className: "", children: [
|
|
2509
|
+
/* @__PURE__ */ jsxs17(Badge2, { size: "2xsmall", className: "mb-2", rounded: "full", children: [
|
|
2510
|
+
returnType,
|
|
2511
|
+
": #",
|
|
2512
|
+
returnTypeId.slice(-7)
|
|
2513
|
+
] }),
|
|
2514
|
+
/* @__PURE__ */ jsxs17(Text11, { size: "xsmall", children: [
|
|
2515
|
+
/* @__PURE__ */ jsx16("span", { className: "text-ui-fg-subtle", children: t(`orders.returns.returnRequested`) }),
|
|
2516
|
+
" \xB7 ",
|
|
2517
|
+
getFullDate({ date: orderReturn.requested_at, includeTime: true })
|
|
2518
|
+
] }),
|
|
2519
|
+
/* @__PURE__ */ jsxs17(Text11, { size: "xsmall", children: [
|
|
2520
|
+
/* @__PURE__ */ jsx16("span", { className: "text-ui-fg-subtle", children: t(`orders.returns.itemReceived`) }),
|
|
2521
|
+
" \xB7 ",
|
|
2522
|
+
orderReturn.received_at ? getFullDate({
|
|
2523
|
+
date: orderReturn.received_at,
|
|
2524
|
+
includeTime: true
|
|
2525
|
+
}) : "-"
|
|
2526
|
+
] })
|
|
2527
|
+
] })
|
|
2528
|
+
}
|
|
2529
|
+
)
|
|
2530
|
+
] });
|
|
2531
|
+
}
|
|
2532
|
+
var return_info_popover_default = ReturnInfoPopover;
|
|
2533
|
+
|
|
2534
|
+
// src/routes/orders/order-detail/components/order-summary-section/shipping-info-popover.tsx
|
|
2535
|
+
import { InformationCircleSolid as InformationCircleSolid2 } from "@acmekit/icons";
|
|
2536
|
+
import { Badge as Badge3, Tooltip as Tooltip6 } from "@acmekit/ui";
|
|
2537
|
+
import { useTranslation as useTranslation17 } from "react-i18next";
|
|
2538
|
+
import { jsx as jsx17, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
2539
|
+
function ShippingInfoPopover({ shippingMethod }) {
|
|
2540
|
+
const { t } = useTranslation17();
|
|
2541
|
+
const shippingDetail = shippingMethod?.detail;
|
|
2542
|
+
if (!shippingDetail) {
|
|
2543
|
+
return;
|
|
2544
|
+
}
|
|
2545
|
+
let rmaType = t("orders.return");
|
|
2546
|
+
let rmaId = shippingDetail.return_id;
|
|
2547
|
+
if (shippingDetail.claim_id) {
|
|
2548
|
+
rmaType = t("orders.claim");
|
|
2549
|
+
rmaId = shippingDetail.claim_id;
|
|
2550
|
+
}
|
|
2551
|
+
if (shippingDetail.exchange_id) {
|
|
2552
|
+
rmaType = t("orders.exchange");
|
|
2553
|
+
rmaId = shippingDetail.exchange_id;
|
|
2554
|
+
}
|
|
2555
|
+
if (!rmaId) {
|
|
2556
|
+
return;
|
|
2557
|
+
}
|
|
2558
|
+
return /* @__PURE__ */ jsx17(
|
|
2559
|
+
Tooltip6,
|
|
2560
|
+
{
|
|
2561
|
+
content: /* @__PURE__ */ jsxs18(Badge3, { size: "2xsmall", rounded: "full", children: [
|
|
2562
|
+
rmaType,
|
|
2563
|
+
": #",
|
|
2564
|
+
rmaId.slice(-7)
|
|
2565
|
+
] }),
|
|
2566
|
+
children: /* @__PURE__ */ jsx17(InformationCircleSolid2, { className: "inline-block text-ui-fg-muted ml-1" })
|
|
2567
|
+
}
|
|
2568
|
+
);
|
|
2569
|
+
}
|
|
2570
|
+
var shipping_info_popover_default = ShippingInfoPopover;
|
|
2571
|
+
|
|
2572
|
+
// src/routes/orders/order-detail/components/order-summary-section/order-summary-section.tsx
|
|
2573
|
+
import { Fragment as Fragment3, jsx as jsx18, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
2574
|
+
var OrderSummarySection = ({
|
|
2575
|
+
order,
|
|
2576
|
+
plugins
|
|
2577
|
+
}) => {
|
|
2578
|
+
const { t } = useTranslation18();
|
|
2579
|
+
const prompt = usePrompt5();
|
|
2580
|
+
const { reservations } = useReservationItems(
|
|
2581
|
+
{
|
|
2582
|
+
line_item_id: order?.items?.map((i) => i.id),
|
|
2583
|
+
limit: getReservationsLimitCount(order)
|
|
2584
|
+
},
|
|
2585
|
+
{ enabled: Array.isArray(order?.items) }
|
|
2586
|
+
);
|
|
2587
|
+
const { order: orderPreview } = useOrderPreview(order.id);
|
|
2588
|
+
const { returns = [] } = useReturns({
|
|
2589
|
+
status: "requested",
|
|
2590
|
+
order_id: order.id,
|
|
2591
|
+
fields: "+received_at"
|
|
2592
|
+
});
|
|
2593
|
+
const receivableReturns = useMemo3(
|
|
2594
|
+
() => returns.filter((r) => !r.canceled_at),
|
|
2595
|
+
[returns]
|
|
2596
|
+
);
|
|
2597
|
+
const showReturns = !!receivableReturns.length;
|
|
2598
|
+
const showAllocateButton = useMemo3(() => {
|
|
2599
|
+
if (!reservations) {
|
|
2600
|
+
return false;
|
|
2601
|
+
}
|
|
2602
|
+
const reservationsMap = new Map(
|
|
2603
|
+
reservations.map((r) => [r.line_item_id, r.id])
|
|
2604
|
+
);
|
|
2605
|
+
for (const item of order.items) {
|
|
2606
|
+
if (item.variant?.manage_inventory) {
|
|
2607
|
+
if (item.quantity - item.detail.fulfilled_quantity > 0) {
|
|
2608
|
+
if (!reservationsMap.has(item.id)) {
|
|
2609
|
+
return true;
|
|
2610
|
+
}
|
|
2611
|
+
}
|
|
2612
|
+
}
|
|
2613
|
+
}
|
|
2614
|
+
return false;
|
|
2615
|
+
}, [order.items, reservations]);
|
|
2616
|
+
const unpaidPaymentCollection = order.payment_collections.find(
|
|
2617
|
+
(pc) => pc.status === "not_paid"
|
|
2618
|
+
);
|
|
2619
|
+
const { mutateAsync: markAsPaid } = useMarkPaymentCollectionAsPaid(
|
|
2620
|
+
order.id,
|
|
2621
|
+
unpaidPaymentCollection?.id
|
|
2622
|
+
);
|
|
2623
|
+
const pendingDifference = order.summary?.pending_difference || 0;
|
|
2624
|
+
const isAmountSignificant = !isAmountLessThenRoundingError(
|
|
2625
|
+
pendingDifference,
|
|
2626
|
+
order.currency_code
|
|
2627
|
+
);
|
|
2628
|
+
const showPayment = unpaidPaymentCollection && pendingDifference > 0 && isAmountSignificant;
|
|
2629
|
+
const showRefund = pendingDifference < 0 && isAmountSignificant;
|
|
2630
|
+
const handleMarkAsPaid = async (paymentCollection) => {
|
|
2631
|
+
const res = await prompt({
|
|
2632
|
+
title: t("orders.payment.markAsPaid"),
|
|
2633
|
+
description: t("orders.payment.markAsPaidPayment", {
|
|
2634
|
+
amount: formatCurrency(
|
|
2635
|
+
paymentCollection.amount,
|
|
2636
|
+
order.currency_code
|
|
2637
|
+
)
|
|
2638
|
+
}),
|
|
2639
|
+
confirmText: t("actions.confirm"),
|
|
2640
|
+
cancelText: t("actions.cancel"),
|
|
2641
|
+
variant: "confirmation"
|
|
2642
|
+
});
|
|
2643
|
+
if (!res) {
|
|
2644
|
+
return;
|
|
2645
|
+
}
|
|
2646
|
+
await markAsPaid(
|
|
2647
|
+
{ order_id: order.id },
|
|
2648
|
+
{
|
|
2649
|
+
onSuccess: () => {
|
|
2650
|
+
toast10.success(
|
|
2651
|
+
t("orders.payment.markAsPaidPaymentSuccess", {
|
|
2652
|
+
amount: formatCurrency(
|
|
2653
|
+
paymentCollection.amount,
|
|
2654
|
+
order.currency_code
|
|
2655
|
+
)
|
|
2656
|
+
})
|
|
2657
|
+
);
|
|
2658
|
+
},
|
|
2659
|
+
onError: (error) => {
|
|
2660
|
+
toast10.error(error.message);
|
|
2661
|
+
}
|
|
2662
|
+
}
|
|
2663
|
+
);
|
|
2664
|
+
};
|
|
2665
|
+
return /* @__PURE__ */ jsxs19(Container10, { className: "divide-y divide-dashed p-0", children: [
|
|
2666
|
+
/* @__PURE__ */ jsx18(Header3, { order, orderPreview }),
|
|
2667
|
+
/* @__PURE__ */ jsx18(ItemBreakdown, { order, reservations }),
|
|
2668
|
+
/* @__PURE__ */ jsx18(CostBreakdown, { order }),
|
|
2669
|
+
/* @__PURE__ */ jsx18(DiscountAndTotalBreakdown, { order, plugins }),
|
|
2670
|
+
/* @__PURE__ */ jsx18(Total2, { order }),
|
|
2671
|
+
(showAllocateButton || showReturns || showPayment || showRefund) && /* @__PURE__ */ jsxs19("div", { className: "bg-ui-bg-subtle flex items-center justify-end gap-x-2 rounded-b-xl px-4 py-4", children: [
|
|
2672
|
+
showReturns && (receivableReturns.length === 1 ? /* @__PURE__ */ jsx18(Button9, { asChild: true, variant: "secondary", size: "small", children: /* @__PURE__ */ jsx18(
|
|
2673
|
+
Link3,
|
|
2674
|
+
{
|
|
2675
|
+
to: `/orders/${order.id}/returns/${receivableReturns[0].id}/receive`,
|
|
2676
|
+
children: t("orders.returns.receive.action")
|
|
2677
|
+
}
|
|
2678
|
+
) }) : /* @__PURE__ */ jsx18(
|
|
2679
|
+
ActionMenu,
|
|
2680
|
+
{
|
|
2681
|
+
groups: [
|
|
2682
|
+
{
|
|
2683
|
+
actions: receivableReturns.map((r) => {
|
|
2684
|
+
let id = r.id;
|
|
2685
|
+
let returnType = "Return";
|
|
2686
|
+
if (r.exchange_id) {
|
|
2687
|
+
id = r.exchange_id;
|
|
2688
|
+
returnType = "Exchange";
|
|
2689
|
+
}
|
|
2690
|
+
if (r.claim_id) {
|
|
2691
|
+
id = r.claim_id;
|
|
2692
|
+
returnType = "Claim";
|
|
2693
|
+
}
|
|
2694
|
+
return {
|
|
2695
|
+
label: t("orders.returns.receive.receiveItems", {
|
|
2696
|
+
id: `#${id.slice(-7)}`,
|
|
2697
|
+
returnType
|
|
2698
|
+
}),
|
|
2699
|
+
icon: /* @__PURE__ */ jsx18(ArrowLongRight, {}),
|
|
2700
|
+
to: `/orders/${order.id}/returns/${r.id}/receive`
|
|
2701
|
+
};
|
|
2702
|
+
})
|
|
2703
|
+
}
|
|
2704
|
+
],
|
|
2705
|
+
children: /* @__PURE__ */ jsx18(Button9, { variant: "secondary", size: "small", children: t("orders.returns.receive.action") })
|
|
2706
|
+
}
|
|
2707
|
+
)),
|
|
2708
|
+
showAllocateButton && /* @__PURE__ */ jsx18(Button9, { asChild: true, variant: "secondary", size: "small", children: /* @__PURE__ */ jsx18(Link3, { to: "allocate-items", children: t("orders.allocateItems.action") }) }),
|
|
2709
|
+
showPayment && /* @__PURE__ */ jsx18(
|
|
2710
|
+
CopyPaymentLink,
|
|
2711
|
+
{
|
|
2712
|
+
paymentCollection: unpaidPaymentCollection,
|
|
2713
|
+
order
|
|
2714
|
+
}
|
|
2715
|
+
),
|
|
2716
|
+
showPayment && /* @__PURE__ */ jsx18(
|
|
2717
|
+
Button9,
|
|
2718
|
+
{
|
|
2719
|
+
size: "small",
|
|
2720
|
+
variant: "secondary",
|
|
2721
|
+
onClick: () => handleMarkAsPaid(unpaidPaymentCollection),
|
|
2722
|
+
children: t("orders.payment.markAsPaid")
|
|
2723
|
+
}
|
|
2724
|
+
),
|
|
2725
|
+
showRefund && /* @__PURE__ */ jsx18(Button9, { size: "small", variant: "secondary", asChild: true, children: /* @__PURE__ */ jsx18(Link3, { to: `/orders/${order.id}/refund`, children: t("orders.payment.refundAmount", {
|
|
2726
|
+
amount: getStylizedAmount(
|
|
2727
|
+
pendingDifference * -1,
|
|
2728
|
+
order?.currency_code
|
|
2729
|
+
)
|
|
2730
|
+
}) }) })
|
|
2731
|
+
] })
|
|
2732
|
+
] });
|
|
2733
|
+
};
|
|
2734
|
+
var Header3 = ({
|
|
2735
|
+
order,
|
|
2736
|
+
orderPreview
|
|
2737
|
+
}) => {
|
|
2738
|
+
const { t } = useTranslation18();
|
|
2739
|
+
const shouldDisableReturn = order.items.every(
|
|
2740
|
+
(i) => !(getReturnableQuantity(i) > 0)
|
|
2741
|
+
);
|
|
2742
|
+
const isOrderEditActive = orderPreview?.order_change?.change_type === "edit";
|
|
2743
|
+
const isOrderEditPending = orderPreview?.order_change?.change_type === "edit" && orderPreview?.order_change?.status === "pending";
|
|
2744
|
+
return /* @__PURE__ */ jsxs19("div", { className: "flex items-center justify-between px-6 py-4", children: [
|
|
2745
|
+
/* @__PURE__ */ jsx18(Heading10, { level: "h2", children: t("fields.summary") }),
|
|
2746
|
+
/* @__PURE__ */ jsx18(
|
|
2747
|
+
ActionMenu,
|
|
2748
|
+
{
|
|
2749
|
+
groups: [
|
|
2750
|
+
{
|
|
2751
|
+
actions: [
|
|
2752
|
+
{
|
|
2753
|
+
label: t(
|
|
2754
|
+
isOrderEditPending ? "orders.summary.editOrderContinue" : "orders.summary.editOrder"
|
|
2755
|
+
),
|
|
2756
|
+
to: `/orders/${order.id}/edits`,
|
|
2757
|
+
icon: /* @__PURE__ */ jsx18(PencilSquare, {}),
|
|
2758
|
+
disabled: order.status === "canceled" || orderPreview?.order_change && orderPreview?.order_change?.change_type !== "edit" || orderPreview?.order_change?.change_type === "edit" && orderPreview?.order_change?.status === "requested"
|
|
2759
|
+
}
|
|
2760
|
+
]
|
|
2761
|
+
},
|
|
2762
|
+
{
|
|
2763
|
+
actions: [
|
|
2764
|
+
{
|
|
2765
|
+
label: t("orders.returns.create"),
|
|
2766
|
+
to: `/orders/${order.id}/returns`,
|
|
2767
|
+
icon: /* @__PURE__ */ jsx18(ArrowUturnLeft2, {}),
|
|
2768
|
+
disabled: shouldDisableReturn || isOrderEditActive || !!orderPreview?.order_change?.exchange_id || !!orderPreview?.order_change?.claim_id
|
|
2769
|
+
},
|
|
2770
|
+
{
|
|
2771
|
+
label: orderPreview?.order_change?.id && orderPreview?.order_change?.exchange_id ? t("orders.exchanges.manage") : t("orders.exchanges.create"),
|
|
2772
|
+
to: `/orders/${order.id}/exchanges`,
|
|
2773
|
+
icon: /* @__PURE__ */ jsx18(ArrowPath3, {}),
|
|
2774
|
+
disabled: shouldDisableReturn || isOrderEditActive || !!orderPreview?.order_change?.return_id && !orderPreview?.order_change?.exchange_id || !!orderPreview?.order_change?.claim_id
|
|
2775
|
+
},
|
|
2776
|
+
{
|
|
2777
|
+
label: orderPreview?.order_change?.id && orderPreview?.order_change?.claim_id ? t("orders.claims.manage") : t("orders.claims.create"),
|
|
2778
|
+
to: `/orders/${order.id}/claims`,
|
|
2779
|
+
icon: /* @__PURE__ */ jsx18(ExclamationCircle2, {}),
|
|
2780
|
+
disabled: shouldDisableReturn || isOrderEditActive || !!orderPreview?.order_change?.return_id && !orderPreview?.order_change?.claim_id || !!orderPreview?.order_change?.exchange_id
|
|
2781
|
+
}
|
|
2782
|
+
]
|
|
2783
|
+
}
|
|
2784
|
+
]
|
|
2785
|
+
}
|
|
2786
|
+
)
|
|
2787
|
+
] });
|
|
2788
|
+
};
|
|
2789
|
+
var Item = ({
|
|
2790
|
+
item,
|
|
2791
|
+
currencyCode,
|
|
2792
|
+
reservation,
|
|
2793
|
+
returns,
|
|
2794
|
+
claims,
|
|
2795
|
+
exchanges
|
|
2796
|
+
}) => {
|
|
2797
|
+
const { t } = useTranslation18();
|
|
2798
|
+
const isInventoryManaged = item.variant?.manage_inventory;
|
|
2799
|
+
const hasInventoryKit = isInventoryManaged && ((item.variant?.inventory_items?.length || 0) > 1 || item.variant?.inventory_items?.some((i) => i.required_quantity > 1));
|
|
2800
|
+
const hasUnfulfilledItems = item.quantity - item.detail.fulfilled_quantity > 0;
|
|
2801
|
+
const appliedPromoCodes = (item.adjustments || []).map((a) => a.code);
|
|
2802
|
+
return /* @__PURE__ */ jsxs19(Fragment3, { children: [
|
|
2803
|
+
/* @__PURE__ */ jsxs19(
|
|
2804
|
+
"div",
|
|
2805
|
+
{
|
|
2806
|
+
className: "text-ui-fg-subtle grid grid-cols-2 items-center gap-x-4 px-6 py-4",
|
|
2807
|
+
children: [
|
|
2808
|
+
/* @__PURE__ */ jsxs19("div", { className: " flex justify-between gap-x-2 ", children: [
|
|
2809
|
+
/* @__PURE__ */ jsxs19("div", { className: " group flex items-start gap-x-4", children: [
|
|
2810
|
+
/* @__PURE__ */ jsx18(Thumbnail, { src: item.thumbnail }),
|
|
2811
|
+
/* @__PURE__ */ jsxs19("div", { children: [
|
|
2812
|
+
/* @__PURE__ */ jsx18(Text12, { size: "small", leading: "compact", className: "text-ui-fg-base", children: item.title }),
|
|
2813
|
+
item.variant_sku && /* @__PURE__ */ jsxs19("div", { className: "flex items-center gap-x-1", children: [
|
|
2814
|
+
/* @__PURE__ */ jsx18(Text12, { size: "small", children: item.variant_sku }),
|
|
2815
|
+
/* @__PURE__ */ jsx18(
|
|
2816
|
+
Copy5,
|
|
2817
|
+
{
|
|
2818
|
+
content: item.variant_sku,
|
|
2819
|
+
className: "text-ui-fg-muted hidden group-hover:block"
|
|
2820
|
+
}
|
|
2821
|
+
)
|
|
2822
|
+
] }),
|
|
2823
|
+
/* @__PURE__ */ jsx18(Text12, { size: "small", children: item.variant?.options?.map((o) => o.value).join(" \xB7 ") })
|
|
2824
|
+
] })
|
|
2825
|
+
] }),
|
|
2826
|
+
appliedPromoCodes.length > 0 && /* @__PURE__ */ jsx18(
|
|
2827
|
+
Tooltip7,
|
|
2828
|
+
{
|
|
2829
|
+
content: /* @__PURE__ */ jsx18("span", { className: "text-pretty", children: appliedPromoCodes.map((code) => /* @__PURE__ */ jsx18("div", { children: code }, code)) }),
|
|
2830
|
+
children: /* @__PURE__ */ jsx18(ReceiptPercent, { className: "text-ui-fg-subtle flex-shrink self-center " })
|
|
2831
|
+
}
|
|
2832
|
+
)
|
|
2833
|
+
] }),
|
|
2834
|
+
/* @__PURE__ */ jsxs19("div", { className: "grid grid-cols-3 items-center gap-x-4", children: [
|
|
2835
|
+
/* @__PURE__ */ jsx18("div", { className: "flex items-center justify-end gap-x-4", children: /* @__PURE__ */ jsx18(Text12, { size: "small", children: getLocaleAmount(item.unit_price, currencyCode) }) }),
|
|
2836
|
+
/* @__PURE__ */ jsxs19("div", { className: "flex items-center gap-x-2", children: [
|
|
2837
|
+
/* @__PURE__ */ jsx18("div", { className: "w-fit min-w-[27px]", children: /* @__PURE__ */ jsxs19(Text12, { size: "small", children: [
|
|
2838
|
+
/* @__PURE__ */ jsx18("span", { className: "tabular-nums", children: item.quantity }),
|
|
2839
|
+
"x"
|
|
2840
|
+
] }) }),
|
|
2841
|
+
/* @__PURE__ */ jsx18("div", { className: "overflow-visible", children: isInventoryManaged && hasUnfulfilledItems && /* @__PURE__ */ jsx18(
|
|
2842
|
+
StatusBadge4,
|
|
2843
|
+
{
|
|
2844
|
+
color: reservation ? "green" : "orange",
|
|
2845
|
+
className: "text-nowrap",
|
|
2846
|
+
children: reservation ? t("orders.reservations.allocatedLabel") : t("orders.reservations.notAllocatedLabel")
|
|
2847
|
+
}
|
|
2848
|
+
) })
|
|
2849
|
+
] }),
|
|
2850
|
+
/* @__PURE__ */ jsx18("div", { className: "flex items-center justify-end", children: /* @__PURE__ */ jsx18(Text12, { size: "small", className: "pt-[1px]", children: getLocaleAmount(item.subtotal || 0, currencyCode) }) })
|
|
2851
|
+
] })
|
|
2852
|
+
]
|
|
2853
|
+
},
|
|
2854
|
+
item.id
|
|
2855
|
+
),
|
|
2856
|
+
hasInventoryKit && /* @__PURE__ */ jsx18(InventoryKitBreakdown, { item }),
|
|
2857
|
+
returns.map((r) => /* @__PURE__ */ jsx18(ReturnBreakdown, { orderReturn: r, itemId: item.id }, r.id)),
|
|
2858
|
+
claims.map((claim) => /* @__PURE__ */ jsx18(ClaimBreakdown, { claim, itemId: item.id }, claim.id)),
|
|
2859
|
+
exchanges.map((exchange) => /* @__PURE__ */ jsx18(
|
|
2860
|
+
ExchangeBreakdown,
|
|
2861
|
+
{
|
|
2862
|
+
exchange,
|
|
2863
|
+
itemId: item.id
|
|
2864
|
+
},
|
|
2865
|
+
exchange.id
|
|
2866
|
+
))
|
|
2867
|
+
] });
|
|
2868
|
+
};
|
|
2869
|
+
var ItemBreakdown = ({
|
|
2870
|
+
order,
|
|
2871
|
+
reservations
|
|
2872
|
+
}) => {
|
|
2873
|
+
const { claims = [] } = useClaims({
|
|
2874
|
+
order_id: order.id,
|
|
2875
|
+
fields: "*additional_items"
|
|
2876
|
+
});
|
|
2877
|
+
const { exchanges = [] } = useExchanges({
|
|
2878
|
+
order_id: order.id,
|
|
2879
|
+
fields: "*additional_items"
|
|
2880
|
+
});
|
|
2881
|
+
const { returns = [] } = useReturns({
|
|
2882
|
+
order_id: order.id,
|
|
2883
|
+
fields: "*items,*items.reason"
|
|
2884
|
+
});
|
|
2885
|
+
const reservationsMap = useMemo3(
|
|
2886
|
+
() => new Map((reservations || []).map((r) => [r.line_item_id, r])),
|
|
2887
|
+
[reservations]
|
|
2888
|
+
);
|
|
2889
|
+
return /* @__PURE__ */ jsx18("div", { children: order.items?.map((item) => {
|
|
2890
|
+
const reservation = reservationsMap.get(item.id);
|
|
2891
|
+
return /* @__PURE__ */ jsx18(
|
|
2892
|
+
Item,
|
|
2893
|
+
{
|
|
2894
|
+
item,
|
|
2895
|
+
currencyCode: order.currency_code,
|
|
2896
|
+
reservation,
|
|
2897
|
+
returns,
|
|
2898
|
+
exchanges,
|
|
2899
|
+
claims
|
|
2900
|
+
},
|
|
2901
|
+
item.id
|
|
2902
|
+
);
|
|
2903
|
+
}) });
|
|
2904
|
+
};
|
|
2905
|
+
var Cost = ({
|
|
2906
|
+
label,
|
|
2907
|
+
value,
|
|
2908
|
+
secondaryValue,
|
|
2909
|
+
tooltip
|
|
2910
|
+
}) => /* @__PURE__ */ jsxs19("div", { className: "grid grid-cols-3 items-center", children: [
|
|
2911
|
+
/* @__PURE__ */ jsxs19(Text12, { size: "small", leading: "compact", children: [
|
|
2912
|
+
label,
|
|
2913
|
+
" ",
|
|
2914
|
+
tooltip
|
|
2915
|
+
] }),
|
|
2916
|
+
/* @__PURE__ */ jsx18("div", { className: "text-right", children: /* @__PURE__ */ jsx18(Text12, { size: "small", leading: "compact", children: secondaryValue }) }),
|
|
2917
|
+
/* @__PURE__ */ jsx18("div", { className: "text-right", children: /* @__PURE__ */ jsx18(Text12, { size: "small", leading: "compact", children: value }) })
|
|
2918
|
+
] });
|
|
2919
|
+
var CostBreakdown = ({
|
|
2920
|
+
order
|
|
2921
|
+
}) => {
|
|
2922
|
+
const { t } = useTranslation18();
|
|
2923
|
+
const [isTaxOpen, setIsTaxOpen] = useState7(false);
|
|
2924
|
+
const [isShippingOpen, setIsShippingOpen] = useState7(false);
|
|
2925
|
+
const taxCodes = useMemo3(() => {
|
|
2926
|
+
const taxCodeMap = {};
|
|
2927
|
+
order.items.forEach((item) => {
|
|
2928
|
+
item.tax_lines?.forEach((line) => {
|
|
2929
|
+
const currTotal = line.subtotal || 0;
|
|
2930
|
+
const prevTotal = taxCodeMap[line.code]?.total || 0;
|
|
2931
|
+
taxCodeMap[line.code] = {
|
|
2932
|
+
total: prevTotal + currTotal,
|
|
2933
|
+
rate: line.rate
|
|
2934
|
+
};
|
|
2935
|
+
});
|
|
2936
|
+
});
|
|
2937
|
+
order.shipping_methods.forEach((sm) => {
|
|
2938
|
+
sm.tax_lines?.forEach((line) => {
|
|
2939
|
+
const currTotal = line.subtotal || 0;
|
|
2940
|
+
const prevTotal = taxCodeMap[line.code]?.total || 0;
|
|
2941
|
+
taxCodeMap[line.code] = {
|
|
2942
|
+
total: prevTotal + currTotal,
|
|
2943
|
+
rate: line.rate
|
|
2944
|
+
};
|
|
2945
|
+
});
|
|
2946
|
+
});
|
|
2947
|
+
return taxCodeMap;
|
|
2948
|
+
}, [order]);
|
|
2949
|
+
const hasTaxes = !!Object.keys(taxCodes).length;
|
|
2950
|
+
return /* @__PURE__ */ jsxs19("div", { className: "text-ui-fg-subtle flex flex-col gap-y-2 px-6 py-4", children: [
|
|
2951
|
+
/* @__PURE__ */ jsx18(
|
|
2952
|
+
Cost,
|
|
2953
|
+
{
|
|
2954
|
+
label: t("orders.summary.itemSubtotal"),
|
|
2955
|
+
value: getLocaleAmount(order.item_subtotal, order.currency_code)
|
|
2956
|
+
}
|
|
2957
|
+
),
|
|
2958
|
+
/* @__PURE__ */ jsx18(
|
|
2959
|
+
Cost,
|
|
2960
|
+
{
|
|
2961
|
+
label: /* @__PURE__ */ jsxs19(
|
|
2962
|
+
"div",
|
|
2963
|
+
{
|
|
2964
|
+
onClick: () => setIsShippingOpen((o) => !o),
|
|
2965
|
+
className: "flex cursor-pointer items-center gap-1",
|
|
2966
|
+
children: [
|
|
2967
|
+
/* @__PURE__ */ jsx18("span", { children: t("orders.summary.shippingSubtotal") }),
|
|
2968
|
+
/* @__PURE__ */ jsx18(
|
|
2969
|
+
TriangleDownMini,
|
|
2970
|
+
{
|
|
2971
|
+
style: {
|
|
2972
|
+
transform: `rotate(${isShippingOpen ? 0 : -90}deg)`
|
|
2973
|
+
}
|
|
2974
|
+
}
|
|
2975
|
+
)
|
|
2976
|
+
]
|
|
2977
|
+
}
|
|
2978
|
+
),
|
|
2979
|
+
value: getLocaleAmount(order.shipping_subtotal, order.currency_code)
|
|
2980
|
+
}
|
|
2981
|
+
),
|
|
2982
|
+
isShippingOpen && /* @__PURE__ */ jsx18("div", { className: "flex flex-col gap-1 pl-5", children: (order.shipping_methods || []).sort(
|
|
2983
|
+
(m1, m2) => m1.created_at.localeCompare(m2.created_at)
|
|
2984
|
+
).map((sm, i) => {
|
|
2985
|
+
return /* @__PURE__ */ jsxs19(
|
|
2986
|
+
"div",
|
|
2987
|
+
{
|
|
2988
|
+
className: "flex items-center justify-between gap-x-2",
|
|
2989
|
+
children: [
|
|
2990
|
+
/* @__PURE__ */ jsx18("div", { children: /* @__PURE__ */ jsxs19("span", { className: "txt-small", children: [
|
|
2991
|
+
sm.name,
|
|
2992
|
+
sm.detail.return_id && ` (${t("fields.returnShipping")})`,
|
|
2993
|
+
" ",
|
|
2994
|
+
/* @__PURE__ */ jsx18(shipping_info_popover_default, { shippingMethod: sm }, i)
|
|
2995
|
+
] }) }),
|
|
2996
|
+
/* @__PURE__ */ jsx18("div", { className: "relative flex-1", children: /* @__PURE__ */ jsx18("div", { className: "bottom-[calc(50% - 2px)] absolute h-[1px] w-full border-b border-dashed" }) }),
|
|
2997
|
+
/* @__PURE__ */ jsx18("span", { className: "txt-small text-ui-fg-muted", children: getLocaleAmount(sm.subtotal, order.currency_code) })
|
|
2998
|
+
]
|
|
2999
|
+
},
|
|
3000
|
+
sm.id
|
|
3001
|
+
);
|
|
3002
|
+
}) }),
|
|
3003
|
+
/* @__PURE__ */ jsxs19(Fragment3, { children: [
|
|
3004
|
+
/* @__PURE__ */ jsxs19("div", { className: "flex justify-between", children: [
|
|
3005
|
+
/* @__PURE__ */ jsxs19(
|
|
3006
|
+
"div",
|
|
3007
|
+
{
|
|
3008
|
+
onClick: () => hasTaxes && setIsTaxOpen((o) => !o),
|
|
3009
|
+
className: clx3("flex items-center gap-1", {
|
|
3010
|
+
"cursor-pointer": hasTaxes
|
|
3011
|
+
}),
|
|
3012
|
+
children: [
|
|
3013
|
+
/* @__PURE__ */ jsx18("span", { className: "txt-small select-none", children: t("orders.summary.taxTotal") }),
|
|
3014
|
+
hasTaxes && /* @__PURE__ */ jsx18(
|
|
3015
|
+
TriangleDownMini,
|
|
3016
|
+
{
|
|
3017
|
+
style: {
|
|
3018
|
+
transform: `rotate(${isTaxOpen ? 0 : -90}deg)`
|
|
3019
|
+
}
|
|
3020
|
+
}
|
|
3021
|
+
)
|
|
3022
|
+
]
|
|
3023
|
+
}
|
|
3024
|
+
),
|
|
3025
|
+
/* @__PURE__ */ jsx18("div", { className: "text-right", children: /* @__PURE__ */ jsx18(Text12, { size: "small", leading: "compact", children: getLocaleAmount(order.original_tax_total, order.currency_code) }) })
|
|
3026
|
+
] }),
|
|
3027
|
+
isTaxOpen && /* @__PURE__ */ jsx18("div", { className: "flex flex-col gap-1 pl-5", children: Object.entries(taxCodes).map(([code, { total, rate }]) => {
|
|
3028
|
+
return /* @__PURE__ */ jsxs19(
|
|
3029
|
+
"div",
|
|
3030
|
+
{
|
|
3031
|
+
className: "flex items-center justify-between gap-x-2",
|
|
3032
|
+
children: [
|
|
3033
|
+
/* @__PURE__ */ jsxs19("div", { className: "flex gap-1", children: [
|
|
3034
|
+
/* @__PURE__ */ jsx18("span", { className: "txt-small", children: code }),
|
|
3035
|
+
/* @__PURE__ */ jsxs19("span", { className: "txt-small", children: [
|
|
3036
|
+
"(",
|
|
3037
|
+
formatPercentage(rate),
|
|
3038
|
+
")"
|
|
3039
|
+
] })
|
|
3040
|
+
] }),
|
|
3041
|
+
/* @__PURE__ */ jsx18("div", { className: "relative flex-1", children: /* @__PURE__ */ jsx18("div", { className: "bottom-[calc(50% - 2px)] absolute h-[1px] w-full border-b border-dashed" }) }),
|
|
3042
|
+
/* @__PURE__ */ jsx18("span", { className: "txt-small text-ui-fg-muted", children: getLocaleAmount(total, order.currency_code) })
|
|
3043
|
+
]
|
|
3044
|
+
},
|
|
3045
|
+
code
|
|
3046
|
+
);
|
|
3047
|
+
}) })
|
|
3048
|
+
] }),
|
|
3049
|
+
/* @__PURE__ */ jsxs19("div", { className: "text-ui-fg-base flex items-center justify-between", children: [
|
|
3050
|
+
/* @__PURE__ */ jsx18(Text12, { className: "text-ui-fg-subtle", size: "small", leading: "compact", children: t("fields.total") }),
|
|
3051
|
+
/* @__PURE__ */ jsx18(
|
|
3052
|
+
Text12,
|
|
3053
|
+
{
|
|
3054
|
+
className: "text-ui-fg-subtle text-bold",
|
|
3055
|
+
size: "small",
|
|
3056
|
+
leading: "compact",
|
|
3057
|
+
children: getLocaleAmount(order.original_total, order.currency_code)
|
|
3058
|
+
}
|
|
3059
|
+
)
|
|
3060
|
+
] })
|
|
3061
|
+
] });
|
|
3062
|
+
};
|
|
3063
|
+
var DiscountAndTotalBreakdown = ({
|
|
3064
|
+
order,
|
|
3065
|
+
plugins
|
|
3066
|
+
}) => {
|
|
3067
|
+
const { t } = useTranslation18();
|
|
3068
|
+
const [isDiscountOpen, setIsDiscountOpen] = useState7(false);
|
|
3069
|
+
const [isCreditLinesOpen, setIsCreditLinesOpen] = useState7(false);
|
|
3070
|
+
const creditLines = order.credit_lines ?? [];
|
|
3071
|
+
const loyaltyPlugin = getLoyaltyPlugin(plugins);
|
|
3072
|
+
const discounts = useMemo3(() => {
|
|
3073
|
+
const discounts2 = [];
|
|
3074
|
+
if (order.item_discount_total) {
|
|
3075
|
+
discounts2.push({
|
|
3076
|
+
type: "item",
|
|
3077
|
+
total: order.item_discount_total,
|
|
3078
|
+
codes: Array.from(
|
|
3079
|
+
new Set(
|
|
3080
|
+
order.items.flatMap((item) => item.adjustments || []).map((adjustment) => adjustment.code)
|
|
3081
|
+
)
|
|
3082
|
+
).sort()
|
|
3083
|
+
});
|
|
3084
|
+
}
|
|
3085
|
+
if (order.shipping_discount_total) {
|
|
3086
|
+
discounts2.push({
|
|
3087
|
+
type: "shipping",
|
|
3088
|
+
total: order.shipping_discount_total,
|
|
3089
|
+
codes: Array.from(
|
|
3090
|
+
new Set(
|
|
3091
|
+
order.shipping_methods.flatMap((shippingMethod) => shippingMethod.adjustments || []).map((adjustment) => adjustment.code)
|
|
3092
|
+
)
|
|
3093
|
+
).sort()
|
|
3094
|
+
});
|
|
3095
|
+
}
|
|
3096
|
+
return discounts2;
|
|
3097
|
+
}, [order]);
|
|
3098
|
+
const hasDiscount = discounts.length > 0;
|
|
3099
|
+
const hasCreditLines = creditLines.length > 0;
|
|
3100
|
+
return /* @__PURE__ */ jsxs19("div", { className: "text-ui-fg-subtle flex flex-col gap-y-2 px-6 py-4", children: [
|
|
3101
|
+
/* @__PURE__ */ jsx18(
|
|
3102
|
+
Cost,
|
|
3103
|
+
{
|
|
3104
|
+
label: /* @__PURE__ */ jsxs19(
|
|
3105
|
+
"div",
|
|
3106
|
+
{
|
|
3107
|
+
onClick: () => hasDiscount && setIsDiscountOpen((o) => !o),
|
|
3108
|
+
className: clx3("flex items-center gap-1", {
|
|
3109
|
+
"cursor-pointer": hasDiscount
|
|
3110
|
+
}),
|
|
3111
|
+
children: [
|
|
3112
|
+
/* @__PURE__ */ jsx18("span", { children: t("orders.summary.discountTotal") }),
|
|
3113
|
+
hasDiscount && /* @__PURE__ */ jsx18(
|
|
3114
|
+
TriangleDownMini,
|
|
3115
|
+
{
|
|
3116
|
+
style: {
|
|
3117
|
+
transform: `rotate(${isDiscountOpen ? 0 : -90}deg)`
|
|
3118
|
+
}
|
|
3119
|
+
}
|
|
3120
|
+
)
|
|
3121
|
+
]
|
|
3122
|
+
}
|
|
3123
|
+
),
|
|
3124
|
+
value: getLocaleAmount(order.discount_total, order.currency_code)
|
|
3125
|
+
}
|
|
3126
|
+
),
|
|
3127
|
+
isDiscountOpen && /* @__PURE__ */ jsx18("div", { className: "flex flex-col gap-1 pl-5", children: discounts.map(({ type, total, codes }) => {
|
|
3128
|
+
return /* @__PURE__ */ jsxs19(
|
|
3129
|
+
"div",
|
|
3130
|
+
{
|
|
3131
|
+
className: "flex items-center justify-between gap-x-2",
|
|
3132
|
+
children: [
|
|
3133
|
+
/* @__PURE__ */ jsxs19("div", { className: "flex gap-1", children: [
|
|
3134
|
+
/* @__PURE__ */ jsx18("span", { className: "txt-small", children: t(`fields.${type}`) }),
|
|
3135
|
+
/* @__PURE__ */ jsxs19("span", { className: "txt-small", children: [
|
|
3136
|
+
"(",
|
|
3137
|
+
codes.join(", "),
|
|
3138
|
+
")"
|
|
3139
|
+
] })
|
|
3140
|
+
] }),
|
|
3141
|
+
/* @__PURE__ */ jsx18("div", { className: "relative flex-1", children: /* @__PURE__ */ jsx18("div", { className: "bottom-[calc(50% - 2px)] absolute h-[1px] w-full border-b border-dashed" }) }),
|
|
3142
|
+
/* @__PURE__ */ jsx18("span", { className: "txt-small text-ui-fg-muted", children: getLocaleAmount(total, order.currency_code) })
|
|
3143
|
+
]
|
|
3144
|
+
},
|
|
3145
|
+
type
|
|
3146
|
+
);
|
|
3147
|
+
}) }),
|
|
3148
|
+
hasCreditLines && /* @__PURE__ */ jsxs19(Fragment3, { children: [
|
|
3149
|
+
/* @__PURE__ */ jsx18(
|
|
3150
|
+
Cost,
|
|
3151
|
+
{
|
|
3152
|
+
label: /* @__PURE__ */ jsxs19(
|
|
3153
|
+
"div",
|
|
3154
|
+
{
|
|
3155
|
+
onClick: () => setIsCreditLinesOpen((o) => !o),
|
|
3156
|
+
className: "flex cursor-pointer items-center gap-1",
|
|
3157
|
+
children: [
|
|
3158
|
+
/* @__PURE__ */ jsx18("span", { children: loyaltyPlugin ? t("orders.giftCardsStoreCreditLines") : t("orders.creditLines.title") }),
|
|
3159
|
+
/* @__PURE__ */ jsx18(
|
|
3160
|
+
TriangleDownMini,
|
|
3161
|
+
{
|
|
3162
|
+
style: {
|
|
3163
|
+
transform: `rotate(${isCreditLinesOpen ? 0 : -90}deg)`
|
|
3164
|
+
}
|
|
3165
|
+
}
|
|
3166
|
+
)
|
|
3167
|
+
]
|
|
3168
|
+
}
|
|
3169
|
+
),
|
|
3170
|
+
value: getLocaleAmount(
|
|
3171
|
+
order.credit_line_total,
|
|
3172
|
+
order.currency_code
|
|
3173
|
+
)
|
|
3174
|
+
}
|
|
3175
|
+
),
|
|
3176
|
+
isCreditLinesOpen && /* @__PURE__ */ jsx18("div", { className: "flex flex-col gap-1 pl-5", children: creditLines.map((creditLine) => {
|
|
3177
|
+
const prettyReference = creditLine.reference?.split("_").join(" ").split("-").join(" ");
|
|
3178
|
+
return /* @__PURE__ */ jsxs19(
|
|
3179
|
+
"div",
|
|
3180
|
+
{
|
|
3181
|
+
className: "flex items-center justify-between gap-x-2",
|
|
3182
|
+
children: [
|
|
3183
|
+
/* @__PURE__ */ jsxs19("div", { className: "flex items-center", children: [
|
|
3184
|
+
/* @__PURE__ */ jsx18(
|
|
3185
|
+
Text12,
|
|
3186
|
+
{
|
|
3187
|
+
size: "small",
|
|
3188
|
+
leading: "compact",
|
|
3189
|
+
weight: "plus",
|
|
3190
|
+
className: "txt-small text-ui-fg-subtle font-medium",
|
|
3191
|
+
children: /* @__PURE__ */ jsx18(display_id_default, { id: creditLine.id })
|
|
3192
|
+
}
|
|
3193
|
+
),
|
|
3194
|
+
/* @__PURE__ */ jsx18("span", { className: "txt-small text-ui-fg-subtle mx-1", children: "-" }),
|
|
3195
|
+
/* @__PURE__ */ jsxs19(
|
|
3196
|
+
Text12,
|
|
3197
|
+
{
|
|
3198
|
+
size: "small",
|
|
3199
|
+
leading: "compact",
|
|
3200
|
+
className: "txt-small text-ui-fg-subtle capitalize",
|
|
3201
|
+
children: [
|
|
3202
|
+
"(",
|
|
3203
|
+
prettyReference,
|
|
3204
|
+
")"
|
|
3205
|
+
]
|
|
3206
|
+
}
|
|
3207
|
+
)
|
|
3208
|
+
] }),
|
|
3209
|
+
/* @__PURE__ */ jsx18("div", { className: "relative flex-1", children: /* @__PURE__ */ jsx18("div", { className: "bottom-[calc(50% - 2px)] absolute h-[1px] w-full border-b border-dashed" }) }),
|
|
3210
|
+
/* @__PURE__ */ jsx18("span", { className: "txt-small text-ui-fg-muted", children: getLocaleAmount(
|
|
3211
|
+
creditLine.amount,
|
|
3212
|
+
order.currency_code
|
|
3213
|
+
) })
|
|
3214
|
+
]
|
|
3215
|
+
},
|
|
3216
|
+
creditLine.id
|
|
3217
|
+
);
|
|
3218
|
+
}) })
|
|
3219
|
+
] }),
|
|
3220
|
+
/* @__PURE__ */ jsxs19("div", { className: "text-ui-fg-base flex items-center justify-between", children: [
|
|
3221
|
+
/* @__PURE__ */ jsx18(Text12, { className: "text-ui-fg-subtle", size: "small", leading: "compact", children: t("orders.summary.totalAfterDiscount") }),
|
|
3222
|
+
/* @__PURE__ */ jsx18(
|
|
3223
|
+
Text12,
|
|
3224
|
+
{
|
|
3225
|
+
className: "text-ui-fg-subtle text-bold",
|
|
3226
|
+
size: "small",
|
|
3227
|
+
leading: "compact",
|
|
3228
|
+
children: getLocaleAmount(order.total, order.currency_code)
|
|
3229
|
+
}
|
|
3230
|
+
)
|
|
3231
|
+
] })
|
|
3232
|
+
] });
|
|
3233
|
+
};
|
|
3234
|
+
var InventoryKitBreakdown = ({ item }) => {
|
|
3235
|
+
const { t } = useTranslation18();
|
|
3236
|
+
const [isOpen, setIsOpen] = useState7(false);
|
|
3237
|
+
const inventory = item.variant?.inventory_items || [];
|
|
3238
|
+
return /* @__PURE__ */ jsxs19(Fragment3, { children: [
|
|
3239
|
+
/* @__PURE__ */ jsxs19(
|
|
3240
|
+
"div",
|
|
3241
|
+
{
|
|
3242
|
+
onClick: () => setIsOpen((o) => !o),
|
|
3243
|
+
className: "flex cursor-pointer items-center gap-2 border-t border-dashed px-6 py-4",
|
|
3244
|
+
children: [
|
|
3245
|
+
/* @__PURE__ */ jsx18(
|
|
3246
|
+
TriangleDownMini,
|
|
3247
|
+
{
|
|
3248
|
+
style: {
|
|
3249
|
+
transform: `rotate(${isOpen ? 0 : -90}deg)`
|
|
3250
|
+
}
|
|
3251
|
+
}
|
|
3252
|
+
),
|
|
3253
|
+
/* @__PURE__ */ jsx18("span", { className: "text-ui-fg-muted txt-small select-none", children: t("orders.summary.inventoryKit", { count: inventory.length }) })
|
|
3254
|
+
]
|
|
3255
|
+
}
|
|
3256
|
+
),
|
|
3257
|
+
isOpen && /* @__PURE__ */ jsx18("div", { className: "flex flex-col gap-1 px-6 pb-4", children: inventory.map((i) => {
|
|
3258
|
+
return /* @__PURE__ */ jsxs19(
|
|
3259
|
+
"div",
|
|
3260
|
+
{
|
|
3261
|
+
className: "flex items-center justify-between gap-x-2",
|
|
3262
|
+
children: [
|
|
3263
|
+
/* @__PURE__ */ jsx18("div", { children: /* @__PURE__ */ jsxs19("span", { className: "txt-small text-ui-fg-subtle font-medium", children: [
|
|
3264
|
+
i.inventory.title,
|
|
3265
|
+
i.inventory.sku && /* @__PURE__ */ jsxs19("span", { className: "text-ui-fg-subtle font-normal", children: [
|
|
3266
|
+
" ",
|
|
3267
|
+
"\u22C5 ",
|
|
3268
|
+
i.inventory.sku
|
|
3269
|
+
] })
|
|
3270
|
+
] }) }),
|
|
3271
|
+
/* @__PURE__ */ jsx18("div", { className: "relative flex-1", children: /* @__PURE__ */ jsx18("div", { className: "bottom-[calc(50% - 2px)] absolute h-[1px] w-full border-b border-dashed" }) }),
|
|
3272
|
+
/* @__PURE__ */ jsxs19("span", { className: "txt-small text-ui-fg-muted", children: [
|
|
3273
|
+
i.required_quantity,
|
|
3274
|
+
"x"
|
|
3275
|
+
] })
|
|
3276
|
+
]
|
|
3277
|
+
},
|
|
3278
|
+
i.inventory.id
|
|
3279
|
+
);
|
|
3280
|
+
}) })
|
|
3281
|
+
] });
|
|
3282
|
+
};
|
|
3283
|
+
var ReturnBreakdownWithDamages = ({
|
|
3284
|
+
orderReturn,
|
|
3285
|
+
itemId
|
|
3286
|
+
}) => {
|
|
3287
|
+
const { t } = useTranslation18();
|
|
3288
|
+
const item = orderReturn?.items?.find((ri) => ri.item_id === itemId);
|
|
3289
|
+
const damagedQuantity = item?.damaged_quantity || 0;
|
|
3290
|
+
return item && /* @__PURE__ */ jsxs19(
|
|
3291
|
+
"div",
|
|
3292
|
+
{
|
|
3293
|
+
className: "txt-compact-small-plus text-ui-fg-subtle bg-ui-bg-subtle flex flex-row justify-between gap-y-2 border-t-2 border-dotted px-6 py-4",
|
|
3294
|
+
children: [
|
|
3295
|
+
/* @__PURE__ */ jsxs19("div", { className: "flex items-center gap-2", children: [
|
|
3296
|
+
/* @__PURE__ */ jsx18(ArrowDownRightMini2, { className: "text-ui-fg-muted" }),
|
|
3297
|
+
/* @__PURE__ */ jsx18(Text12, { size: "small", children: t(`orders.returns.damagedItemsReturned`, {
|
|
3298
|
+
quantity: damagedQuantity
|
|
3299
|
+
}) }),
|
|
3300
|
+
item?.note && /* @__PURE__ */ jsx18(Tooltip7, { content: item.note, children: /* @__PURE__ */ jsx18(DocumentText2, { className: "text-ui-tag-neutral-icon ml-1 inline" }) }),
|
|
3301
|
+
item?.reason && /* @__PURE__ */ jsx18(
|
|
3302
|
+
Badge4,
|
|
3303
|
+
{
|
|
3304
|
+
size: "2xsmall",
|
|
3305
|
+
className: "cursor-default select-none capitalize",
|
|
3306
|
+
rounded: "full",
|
|
3307
|
+
children: item?.reason?.label
|
|
3308
|
+
}
|
|
3309
|
+
)
|
|
3310
|
+
] }),
|
|
3311
|
+
/* @__PURE__ */ jsxs19(Text12, { size: "small", leading: "compact", className: "text-ui-fg-muted", children: [
|
|
3312
|
+
t(`orders.returns.damagedItemReceived`),
|
|
3313
|
+
/* @__PURE__ */ jsx18("span", { className: "ml-2", children: /* @__PURE__ */ jsx18(return_info_popover_default, { orderReturn }) })
|
|
3314
|
+
] })
|
|
3315
|
+
]
|
|
3316
|
+
},
|
|
3317
|
+
orderReturn.id
|
|
3318
|
+
);
|
|
3319
|
+
};
|
|
3320
|
+
var ReturnBreakdown = ({
|
|
3321
|
+
orderReturn,
|
|
3322
|
+
itemId
|
|
3323
|
+
}) => {
|
|
3324
|
+
const { t } = useTranslation18();
|
|
3325
|
+
const { getRelativeDate } = useDate();
|
|
3326
|
+
if (!["requested", "received", "partially_received"].includes(
|
|
3327
|
+
orderReturn.status || ""
|
|
3328
|
+
)) {
|
|
3329
|
+
return null;
|
|
3330
|
+
}
|
|
3331
|
+
const isRequested = orderReturn.status === "requested";
|
|
3332
|
+
const item = orderReturn?.items?.find((ri) => ri.item_id === itemId);
|
|
3333
|
+
const damagedQuantity = item?.damaged_quantity || 0;
|
|
3334
|
+
return item && /* @__PURE__ */ jsxs19(Fragment3, { children: [
|
|
3335
|
+
damagedQuantity > 0 && /* @__PURE__ */ jsx18(
|
|
3336
|
+
ReturnBreakdownWithDamages,
|
|
3337
|
+
{
|
|
3338
|
+
orderReturn,
|
|
3339
|
+
itemId
|
|
3340
|
+
}
|
|
3341
|
+
),
|
|
3342
|
+
/* @__PURE__ */ jsxs19(
|
|
3343
|
+
"div",
|
|
3344
|
+
{
|
|
3345
|
+
className: "txt-compact-small-plus text-ui-fg-subtle bg-ui-bg-subtle flex flex-row justify-between gap-y-2 border-t-2 border-dotted px-6 py-4",
|
|
3346
|
+
children: [
|
|
3347
|
+
/* @__PURE__ */ jsxs19("div", { className: "flex items-center gap-2", children: [
|
|
3348
|
+
/* @__PURE__ */ jsx18(ArrowDownRightMini2, { className: "text-ui-fg-muted" }),
|
|
3349
|
+
/* @__PURE__ */ jsx18(Text12, { size: "small", children: t(
|
|
3350
|
+
`orders.returns.${isRequested ? "returnRequestedInfo" : "returnReceivedInfo"}`,
|
|
3351
|
+
{
|
|
3352
|
+
requestedItemsCount: item?.[isRequested ? "quantity" : "received_quantity"]
|
|
3353
|
+
}
|
|
3354
|
+
) }),
|
|
3355
|
+
item?.note && /* @__PURE__ */ jsx18(Tooltip7, { content: item.note, children: /* @__PURE__ */ jsx18(DocumentText2, { className: "text-ui-tag-neutral-icon ml-1 inline" }) }),
|
|
3356
|
+
item?.reason && /* @__PURE__ */ jsx18(
|
|
3357
|
+
Badge4,
|
|
3358
|
+
{
|
|
3359
|
+
size: "2xsmall",
|
|
3360
|
+
className: "cursor-default select-none capitalize",
|
|
3361
|
+
rounded: "full",
|
|
3362
|
+
children: item?.reason?.label
|
|
3363
|
+
}
|
|
3364
|
+
)
|
|
3365
|
+
] }),
|
|
3366
|
+
orderReturn && isRequested && /* @__PURE__ */ jsxs19(Text12, { size: "small", leading: "compact", className: "text-ui-fg-muted", children: [
|
|
3367
|
+
getRelativeDate(orderReturn.created_at),
|
|
3368
|
+
/* @__PURE__ */ jsx18("span", { className: "ml-2", children: /* @__PURE__ */ jsx18(return_info_popover_default, { orderReturn }) })
|
|
3369
|
+
] }),
|
|
3370
|
+
orderReturn && !isRequested && /* @__PURE__ */ jsxs19(Text12, { size: "small", leading: "compact", className: "text-ui-fg-muted", children: [
|
|
3371
|
+
t(`orders.returns.itemReceived`),
|
|
3372
|
+
/* @__PURE__ */ jsx18("span", { className: "ml-2", children: /* @__PURE__ */ jsx18(return_info_popover_default, { orderReturn }) })
|
|
3373
|
+
] })
|
|
3374
|
+
]
|
|
3375
|
+
},
|
|
3376
|
+
item.id
|
|
3377
|
+
)
|
|
3378
|
+
] });
|
|
3379
|
+
};
|
|
3380
|
+
var ClaimBreakdown = ({
|
|
3381
|
+
claim,
|
|
3382
|
+
itemId
|
|
3383
|
+
}) => {
|
|
3384
|
+
const { t } = useTranslation18();
|
|
3385
|
+
const { getRelativeDate } = useDate();
|
|
3386
|
+
const items = claim.additional_items.filter(
|
|
3387
|
+
(item) => item.item?.id === itemId
|
|
3388
|
+
);
|
|
3389
|
+
return !!items.length && /* @__PURE__ */ jsxs19(
|
|
3390
|
+
"div",
|
|
3391
|
+
{
|
|
3392
|
+
className: "txt-compact-small-plus text-ui-fg-subtle bg-ui-bg-subtle flex flex-row justify-between gap-y-2 border-b-2 border-t-2 border-dotted px-6 py-4",
|
|
3393
|
+
children: [
|
|
3394
|
+
/* @__PURE__ */ jsxs19("div", { className: "flex items-center gap-2", children: [
|
|
3395
|
+
/* @__PURE__ */ jsx18(ArrowDownRightMini2, { className: "text-ui-fg-muted" }),
|
|
3396
|
+
/* @__PURE__ */ jsx18(Text12, { size: "small", children: t(`orders.claims.outboundItemAdded`, {
|
|
3397
|
+
itemsCount: items.reduce(
|
|
3398
|
+
(acc, item) => acc = acc + item.quantity,
|
|
3399
|
+
0
|
|
3400
|
+
)
|
|
3401
|
+
}) })
|
|
3402
|
+
] }),
|
|
3403
|
+
/* @__PURE__ */ jsx18(Text12, { size: "small", leading: "compact", className: "text-ui-fg-muted", children: getRelativeDate(claim.created_at) })
|
|
3404
|
+
]
|
|
3405
|
+
},
|
|
3406
|
+
claim.id
|
|
3407
|
+
);
|
|
3408
|
+
};
|
|
3409
|
+
var ExchangeBreakdown = ({
|
|
3410
|
+
exchange,
|
|
3411
|
+
itemId
|
|
3412
|
+
}) => {
|
|
3413
|
+
const { t } = useTranslation18();
|
|
3414
|
+
const { getRelativeDate } = useDate();
|
|
3415
|
+
const items = exchange.additional_items.filter(
|
|
3416
|
+
(item) => item?.item?.id === itemId
|
|
3417
|
+
);
|
|
3418
|
+
return !!items.length && /* @__PURE__ */ jsxs19(
|
|
3419
|
+
"div",
|
|
3420
|
+
{
|
|
3421
|
+
className: "txt-compact-small-plus text-ui-fg-subtle bg-ui-bg-subtle flex flex-row justify-between gap-y-2 border-b-2 border-t-2 border-dotted px-6 py-4",
|
|
3422
|
+
children: [
|
|
3423
|
+
/* @__PURE__ */ jsxs19("div", { className: "flex items-center gap-2", children: [
|
|
3424
|
+
/* @__PURE__ */ jsx18(ArrowDownRightMini2, { className: "text-ui-fg-muted" }),
|
|
3425
|
+
/* @__PURE__ */ jsx18(Text12, { size: "small", children: t(`orders.exchanges.outboundItemAdded`, {
|
|
3426
|
+
itemsCount: items.reduce(
|
|
3427
|
+
(acc, item) => acc = acc + item.quantity,
|
|
3428
|
+
0
|
|
3429
|
+
)
|
|
3430
|
+
}) })
|
|
3431
|
+
] }),
|
|
3432
|
+
/* @__PURE__ */ jsx18(Text12, { size: "small", leading: "compact", className: "text-ui-fg-muted", children: getRelativeDate(exchange.created_at) })
|
|
3433
|
+
]
|
|
3434
|
+
},
|
|
3435
|
+
exchange.id
|
|
3436
|
+
);
|
|
3437
|
+
};
|
|
3438
|
+
var Total2 = ({ order }) => {
|
|
3439
|
+
const { t } = useTranslation18();
|
|
3440
|
+
return /* @__PURE__ */ jsxs19("div", { className: " flex flex-col gap-y-2 px-6 py-4", children: [
|
|
3441
|
+
/* @__PURE__ */ jsxs19("div", { className: "text-ui-fg-base flex items-center justify-between", children: [
|
|
3442
|
+
/* @__PURE__ */ jsx18(Text12, { className: "text-ui-fg-subtle", size: "small", leading: "compact", children: t("fields.paidTotal") }),
|
|
3443
|
+
/* @__PURE__ */ jsx18(Text12, { className: "text-ui-fg-subtle", size: "small", leading: "compact", children: getStylizedAmount(
|
|
3444
|
+
getTotalCaptured(order.payment_collections || []),
|
|
3445
|
+
order.currency_code
|
|
3446
|
+
) })
|
|
3447
|
+
] }),
|
|
3448
|
+
getTotalCreditLines(order.credit_lines ?? []) > 0 && /* @__PURE__ */ jsxs19("div", { className: "text-ui-fg-base flex items-center justify-between", children: [
|
|
3449
|
+
/* @__PURE__ */ jsx18(Text12, { className: "text-ui-fg-subtle", size: "small", leading: "compact", children: t("fields.creditTotal") }),
|
|
3450
|
+
/* @__PURE__ */ jsx18(Text12, { className: "text-ui-fg-subtle", size: "small", leading: "compact", children: getStylizedAmount(
|
|
3451
|
+
getTotalCreditLines(order.credit_lines ?? []),
|
|
3452
|
+
order.currency_code
|
|
3453
|
+
) })
|
|
3454
|
+
] }),
|
|
3455
|
+
/* @__PURE__ */ jsxs19("div", { className: "text-ui-fg-base flex items-center justify-between", children: [
|
|
3456
|
+
/* @__PURE__ */ jsx18(
|
|
3457
|
+
Text12,
|
|
3458
|
+
{
|
|
3459
|
+
className: "text-ui-fg-subtle text-semibold",
|
|
3460
|
+
size: "small",
|
|
3461
|
+
leading: "compact",
|
|
3462
|
+
children: t("orders.returns.outstandingAmount")
|
|
3463
|
+
}
|
|
3464
|
+
),
|
|
3465
|
+
/* @__PURE__ */ jsx18(
|
|
3466
|
+
Text12,
|
|
3467
|
+
{
|
|
3468
|
+
className: "text-ui-fg-subtle text-bold",
|
|
3469
|
+
size: "small",
|
|
3470
|
+
leading: "compact",
|
|
3471
|
+
children: getStylizedAmount(
|
|
3472
|
+
order.summary.pending_difference || 0,
|
|
3473
|
+
order.currency_code
|
|
3474
|
+
)
|
|
3475
|
+
}
|
|
3476
|
+
)
|
|
3477
|
+
] })
|
|
3478
|
+
] });
|
|
3479
|
+
};
|
|
3480
|
+
|
|
3481
|
+
// src/routes/orders/order-detail/order-detail.tsx
|
|
3482
|
+
import { jsx as jsx19, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
3483
|
+
var OrderDetail = () => {
|
|
3484
|
+
const initialData = useLoaderData();
|
|
3485
|
+
const { id } = useParams();
|
|
3486
|
+
const { getWidgets } = useExtension();
|
|
3487
|
+
const { plugins = [] } = usePlugins();
|
|
3488
|
+
const { order, isLoading, isError, error } = useOrder(
|
|
3489
|
+
id,
|
|
3490
|
+
{
|
|
3491
|
+
fields: DEFAULT_FIELDS
|
|
3492
|
+
},
|
|
3493
|
+
{
|
|
3494
|
+
initialData
|
|
3495
|
+
}
|
|
3496
|
+
);
|
|
3497
|
+
if (order) {
|
|
3498
|
+
order.items = order.items.sort((itemA, itemB) => {
|
|
3499
|
+
if (itemA.created_at > itemB.created_at) {
|
|
3500
|
+
return 1;
|
|
3501
|
+
}
|
|
3502
|
+
if (itemA.created_at < itemB.created_at) {
|
|
3503
|
+
return -1;
|
|
3504
|
+
}
|
|
3505
|
+
return 0;
|
|
3506
|
+
});
|
|
3507
|
+
}
|
|
3508
|
+
const { order: orderPreview, isLoading: isPreviewLoading } = useOrderPreview(
|
|
3509
|
+
id
|
|
3510
|
+
);
|
|
3511
|
+
if (isLoading || !order || isPreviewLoading) {
|
|
3512
|
+
return /* @__PURE__ */ jsx19(TwoColumnPageSkeleton, { mainSections: 4, sidebarSections: 2, showJSON: true });
|
|
3513
|
+
}
|
|
3514
|
+
if (isError) {
|
|
3515
|
+
throw error;
|
|
3516
|
+
}
|
|
3517
|
+
return /* @__PURE__ */ jsxs20(
|
|
3518
|
+
TwoColumnPage,
|
|
3519
|
+
{
|
|
3520
|
+
widgets: {
|
|
3521
|
+
after: getWidgets("order.details.after"),
|
|
3522
|
+
before: getWidgets("order.details.before"),
|
|
3523
|
+
sideAfter: getWidgets("order.details.side.after"),
|
|
3524
|
+
sideBefore: getWidgets("order.details.side.before")
|
|
3525
|
+
},
|
|
3526
|
+
data: order,
|
|
3527
|
+
showJSON: true,
|
|
3528
|
+
showMetadata: true,
|
|
3529
|
+
hasOutlet: true,
|
|
3530
|
+
children: [
|
|
3531
|
+
/* @__PURE__ */ jsxs20(TwoColumnPage.Main, { children: [
|
|
3532
|
+
/* @__PURE__ */ jsx19(OrderActiveEditSection, { order }),
|
|
3533
|
+
/* @__PURE__ */ jsx19(ActiveOrderClaimSection, { orderPreview }),
|
|
3534
|
+
/* @__PURE__ */ jsx19(ActiveOrderExchangeSection, { orderPreview }),
|
|
3535
|
+
/* @__PURE__ */ jsx19(ActiveOrderReturnSection, { orderPreview }),
|
|
3536
|
+
/* @__PURE__ */ jsx19(OrderGeneralSection, { order }),
|
|
3537
|
+
/* @__PURE__ */ jsx19(OrderSummarySection, { order, plugins }),
|
|
3538
|
+
/* @__PURE__ */ jsx19(OrderPaymentSection, { order, plugins }),
|
|
3539
|
+
/* @__PURE__ */ jsx19(OrderFulfillmentSection, { order })
|
|
3540
|
+
] }),
|
|
3541
|
+
/* @__PURE__ */ jsxs20(TwoColumnPage.Sidebar, { children: [
|
|
3542
|
+
/* @__PURE__ */ jsx19(OrderCustomerSection, { order }),
|
|
3543
|
+
/* @__PURE__ */ jsx19(OrderActivitySection, { order })
|
|
3544
|
+
] })
|
|
3545
|
+
]
|
|
3546
|
+
}
|
|
3547
|
+
);
|
|
3548
|
+
};
|
|
3549
|
+
export {
|
|
3550
|
+
OrderDetailBreadcrumb as Breadcrumb,
|
|
3551
|
+
OrderDetail as Component,
|
|
3552
|
+
orderLoader as loader
|
|
3553
|
+
};
|