@mercurjs/vendor 2.1.2 → 2.2.0-canary.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.
Files changed (230) hide show
  1. package/dist/{[id]-PDGHF5J2.js → [id]-2DQX3YWJ.js} +35 -31
  2. package/dist/{[id]-TO6KT3ZE.js → [id]-4OBGG7OH.js} +23 -21
  3. package/dist/{[id]-X4DDKOMQ.js → [id]-4PKMKNJH.js} +26 -22
  4. package/dist/[id]-4STHLE4N.js +1442 -0
  5. package/dist/{[id]-4VCL3MMM.js → [id]-5UFO4RKF.js} +26 -22
  6. package/dist/{[id]-H3C3ZSC6.js → [id]-6MXCVV5J.js} +25 -21
  7. package/dist/{[id]-6PXEWRG7.js → [id]-7BAKUHUO.js} +13 -13
  8. package/dist/{[id]-7RUAH3TI.js → [id]-K2CT7BXQ.js} +4 -4
  9. package/dist/{[id]-3G5G7ZFV.js → [id]-KJIQTFGE.js} +22 -20
  10. package/dist/{[id]-INOFZHL7.js → [id]-LTNOHLGE.js} +16 -16
  11. package/dist/{[id]-B3LHVQM5.js → [id]-PGIT5WJC.js} +25 -21
  12. package/dist/{[id]-T2ROPEGY.js → [id]-Y2ISCLUD.js} +7 -7
  13. package/dist/{[id]-Y7GAMNC5.js → [id]-ZCMSBEVM.js} +4 -4
  14. package/dist/{[id]-UTKO3VG4.js → [id]-ZWWMJAKI.js} +9 -9
  15. package/dist/{[location_id]-D55RQOXT.js → [location_id]-NUBXDDJC.js} +9 -9
  16. package/dist/{[province_id]-OFH2ZOFQ.js → [province_id]-H2QAPKVH.js} +20 -18
  17. package/dist/{add-C6OX5C54.js → add-GZJ7OMV3.js} +34 -30
  18. package/dist/add-KQAABWCR.js +392 -0
  19. package/dist/{add-customer-groups-PJRJUWS2.js → add-customer-groups-RAHCP67U.js} +16 -14
  20. package/dist/{add-products-INOLNPO6.js → add-products-TSVQHC67.js} +23 -19
  21. package/dist/{add-promotions-AHDOP52Q.js → add-promotions-CSCAJZHV.js} +7 -7
  22. package/dist/{add-to-campaign-HL6NGRR4.js → add-to-campaign-DLP7PSQB.js} +4 -4
  23. package/dist/{address-KRENKSLP.js → address-7F5SN7PV.js} +17 -15
  24. package/dist/{adjust-inventory-H4EUP7J3.js → adjust-inventory-SZF4W7LR.js} +2 -2
  25. package/dist/{allocate-items-SUCUZU4D.js → allocate-items-SDFS5GYN.js} +6 -6
  26. package/dist/{areas-UUMZDXLX.js → areas-7Y6BVS5A.js} +8 -8
  27. package/dist/{attributes-CALEHJJG.js → attributes-MBZ76HVZ.js} +3 -3
  28. package/dist/{breadcrumb-BS7Y5OKF.js → breadcrumb-65SAGUUL.js} +2 -2
  29. package/dist/{breadcrumb-6W2VP3OZ.js → breadcrumb-7PURSRTT.js} +13 -11
  30. package/dist/{breadcrumb-M5Z5WA6I.js → breadcrumb-EDPMEN2P.js} +2 -2
  31. package/dist/breadcrumb-FLDHJRVY.js +26 -0
  32. package/dist/{breadcrumb-VNNZ3TTW.js → breadcrumb-HND5FFWC.js} +2 -2
  33. package/dist/{breadcrumb-OIGGCB3L.js → breadcrumb-QV2IAX7N.js} +8 -2
  34. package/dist/{breadcrumb-KQSFIXQ4.js → breadcrumb-VWELWDB2.js} +1 -1
  35. package/dist/{breadcrumb-IG7VZGW2.js → breadcrumb-WRG4SITG.js} +13 -11
  36. package/dist/{breadcrumb-TW5JEOYS.js → breadcrumb-ZCG2RHIU.js} +12 -10
  37. package/dist/{campaigns-HS6MIO7X.js → campaigns-L6ULR6KR.js} +5 -5
  38. package/dist/{categories-PKWR3FM3.js → categories-FUZQKBXV.js} +6 -6
  39. package/dist/{chunk-PDQSPKG5.js → chunk-2DXNJURE.js} +1 -1
  40. package/dist/{chunk-ZZO3INVE.js → chunk-2MDGYHWN.js} +128 -25
  41. package/dist/{chunk-5UD4P6YL.js → chunk-2USXZSTK.js} +4 -4
  42. package/dist/{chunk-6SBMVLJ2.js → chunk-36L54SQQ.js} +1 -1
  43. package/dist/chunk-37G4Y5I7.js +101 -0
  44. package/dist/{chunk-5M3SL4UZ.js → chunk-3CVJA5UE.js} +9 -104
  45. package/dist/chunk-432S4FGR.js +0 -0
  46. package/dist/{chunk-KQGVSLUI.js → chunk-44RQ5PTN.js} +1803 -914
  47. package/dist/{chunk-Y2QI7KWS.js → chunk-4LVP635F.js} +408 -664
  48. package/dist/{chunk-UL4O5M4S.js → chunk-4S6XGIC6.js} +1 -18
  49. package/dist/chunk-5ZVWOCAC.js +426 -0
  50. package/dist/{chunk-WITQNQXN.js → chunk-6BS2AVGJ.js} +3 -3
  51. package/dist/{chunk-ZYOXKUKZ.js → chunk-7LBY5JLV.js} +1 -1
  52. package/dist/chunk-7SLWXX6L.js +811 -0
  53. package/dist/{chunk-LQYMBSRQ.js → chunk-AIZM66CG.js} +1 -1
  54. package/dist/{chunk-IZ5RG5XI.js → chunk-AJLGY3LQ.js} +1 -21
  55. package/dist/{chunk-WFE6CT6M.js → chunk-AVOIZO63.js} +21 -77
  56. package/dist/chunk-C2FG3SX2.js +68 -0
  57. package/dist/chunk-CFRWIQIZ.js +43 -0
  58. package/dist/{chunk-WNVEMFIK.js → chunk-CNMY5HVP.js} +2 -2
  59. package/dist/{chunk-BLVJAKBA.js → chunk-DDH7ULIQ.js} +1 -1
  60. package/dist/chunk-DIW4GRTI.js +503 -0
  61. package/dist/{chunk-JQP7MOFH.js → chunk-DVEKYLPV.js} +1 -1
  62. package/dist/{chunk-QX45GVAL.js → chunk-EIUYXS7E.js} +8 -8
  63. package/dist/{chunk-N7OVXN72.js → chunk-EROX26D4.js} +1 -1
  64. package/dist/{chunk-2RHAI7WK.js → chunk-EZ3JOAUS.js} +1 -1
  65. package/dist/{chunk-HFRHHT36.js → chunk-FDR22JMM.js} +63 -8
  66. package/dist/{chunk-PEKANQ3T.js → chunk-FJUUGFXL.js} +2 -2
  67. package/dist/{chunk-3CK6OINO.js → chunk-GDWBOQI5.js} +3 -5
  68. package/dist/{chunk-47SXTGLN.js → chunk-GXIAIITP.js} +63 -200
  69. package/dist/{chunk-4MFMCZEJ.js → chunk-H6LZ77GX.js} +2 -2
  70. package/dist/chunk-IWLDKGYQ.js +95 -0
  71. package/dist/chunk-K4X324QP.js +18 -0
  72. package/dist/{chunk-VQ5EKDA3.js → chunk-KD7RYE6R.js} +1 -1
  73. package/dist/chunk-LEWA4BPH.js +18 -0
  74. package/dist/{chunk-7Q5SDEK7.js → chunk-LNM2D2I4.js} +4 -4
  75. package/dist/{chunk-LPOAVK6Y.js → chunk-LQD232FW.js} +47 -12
  76. package/dist/{chunk-OXXL4WQU.js → chunk-M7KSRYRI.js} +5 -5
  77. package/dist/chunk-MBFHMJHN.js +2063 -0
  78. package/dist/{chunk-I2IKYOZX.js → chunk-N4MVIBFM.js} +19 -19
  79. package/dist/{chunk-PCMNEUMV.js → chunk-NHFEY3EI.js} +1 -1
  80. package/dist/{chunk-RTAWYMQP.js → chunk-NJMNYS7G.js} +1 -1
  81. package/dist/{chunk-HGQTL7NX.js → chunk-NSZQERLE.js} +2 -2
  82. package/dist/{chunk-RL7SFZOF.js → chunk-NXNJQZCP.js} +1 -1
  83. package/dist/{chunk-CNLP35S7.js → chunk-OD3U3TX4.js} +16 -31
  84. package/dist/{chunk-D2MA5TAP.js → chunk-PBD36EZJ.js} +2 -2
  85. package/dist/{chunk-4ZGFODSC.js → chunk-PZ44R4AS.js} +1 -1
  86. package/dist/{chunk-ZEVYT6IX.js → chunk-QNNJN4H6.js} +116 -286
  87. package/dist/{chunk-WBI7FEGI.js → chunk-QS6RWIBL.js} +1 -1
  88. package/dist/chunk-QT7YFHCA.js +198 -0
  89. package/dist/{chunk-GYV6SKY7.js → chunk-QXLRABYH.js} +4 -6
  90. package/dist/chunk-RXZFEFNV.js +73 -0
  91. package/dist/{chunk-RUE5BPC2.js → chunk-RZLN2Q6G.js} +1 -1
  92. package/dist/{chunk-NYDJTWRL.js → chunk-SGR4DMCW.js} +4 -4
  93. package/dist/chunk-T6LHVNWO.js +27 -0
  94. package/dist/{chunk-DKQ4XMSN.js → chunk-TNVYTMBL.js} +6 -6
  95. package/dist/{chunk-32RYSB2V.js → chunk-TODJFRLH.js} +2 -2
  96. package/dist/{chunk-P3ZTO6T2.js → chunk-UAF2S447.js} +1 -1
  97. package/dist/{chunk-J6BRLL3F.js → chunk-UCQKXXLD.js} +2 -2
  98. package/dist/chunk-UORPTGV2.js +114 -0
  99. package/dist/{chunk-CYTNBXWF.js → chunk-UX7J5NZG.js} +9 -9
  100. package/dist/{chunk-X4FLOQ45.js → chunk-WBHFU3MG.js} +2 -2
  101. package/dist/chunk-WLT7K7K7.js +63 -0
  102. package/dist/{chunk-4URLUCTD.js → chunk-WUPJADSO.js} +2 -2
  103. package/dist/{chunk-ITI54CII.js → chunk-X4INVIWL.js} +5 -5
  104. package/dist/{chunk-PTW7JNAP.js → chunk-XFQJU6FA.js} +4 -4
  105. package/dist/{collections-DJZI2RM2.js → collections-3OPR3DSD.js} +22 -19
  106. package/dist/{configuration-RHPIO2QT.js → configuration-C4IGBNXH.js} +1 -1
  107. package/dist/{configuration-GN3TO77H.js → configuration-UOSNP45I.js} +3 -3
  108. package/dist/{create-3EK5CNNX.js → create-2MQFQHTE.js} +33 -29
  109. package/dist/{create-YO55Z3YD.js → create-2PCLG7TV.js} +32 -38
  110. package/dist/{create-G4T2PAJH.js → create-35MYQPVM.js} +23 -21
  111. package/dist/{create-HKJVSFB7.js → create-BJ4OO6LS.js} +23 -21
  112. package/dist/create-DDPIXCXT.js +210 -0
  113. package/dist/{create-7S7CZWEN.js → create-GB3ZA4LH.js} +4 -4
  114. package/dist/create-JDGM5KXE.js +193 -0
  115. package/dist/{create-IDVCZHIX.js → create-ORXYT74H.js} +14 -12
  116. package/dist/{create-GHM7OTCR.js → create-R7K3ECN6.js} +1 -1
  117. package/dist/{create-D6EW3EWC.js → create-SFU3W3ZH.js} +1 -1
  118. package/dist/{create-3ZVXEPX5.js → create-SQ3FYMGI.js} +25 -21
  119. package/dist/{create-33TRLASX.js → create-UPYB65PD.js} +1 -1
  120. package/dist/{create-OCFPLNNY.js → create-UQNYMVBM.js} +6 -6
  121. package/dist/{create-OGLPDVOI.js → create-XAD5NMSJ.js} +37 -35
  122. package/dist/{create-KGYL7FBM.js → create-XVHOCZHJ.js} +1 -1
  123. package/dist/{create-4AE3VTWN.js → create-YBF4YGWG.js} +2 -2
  124. package/dist/{customers-6ZLE65UX.js → customers-ETXVNM3G.js} +5 -5
  125. package/dist/{edit-QBISX7D3.js → edit-2Q7TRUTL.js} +14 -12
  126. package/dist/{edit-B5B3XKDM.js → edit-522DG3BY.js} +1 -1
  127. package/dist/{edit-ATXE6CM5.js → edit-C4OCKQVU.js} +1 -1
  128. package/dist/{edit-IR6V2IDN.js → edit-FKXIQ6ZI.js} +19 -17
  129. package/dist/{edit-4HZHLYI3.js → edit-GQNIINRR.js} +1 -1
  130. package/dist/{edit-LRRJTHV2.js → edit-KAKVPHZZ.js} +1 -1
  131. package/dist/{edit-ZSOI56BQ.js → edit-L5ZZLMAY.js} +22 -22
  132. package/dist/{edit-FNDDSSMT.js → edit-NYD45J2Q.js} +37 -8
  133. package/dist/{edit-GIJXLMC3.js → edit-O4JLGKQR.js} +2 -2
  134. package/dist/{edit-5CJZRHAA.js → edit-ORXS3A2Y.js} +1 -1
  135. package/dist/{edit-FC64DWB2.js → edit-Q3UQIOLS.js} +1 -1
  136. package/dist/{edit-7HTH2UJF.js → edit-REDDBLTA.js} +3 -3
  137. package/dist/{edit-2KRJIPRK.js → edit-SGUY2CCK.js} +19 -17
  138. package/dist/{edit-B75KK5ZX.js → edit-SWRWWFW6.js} +35 -31
  139. package/dist/{edit-7GVP6SRA.js → edit-ZAHCMF5U.js} +1 -1
  140. package/dist/{edit-RNT555GP.js → edit-ZCXUG42Q.js} +13 -11
  141. package/dist/{edit-MYSWY6W4.js → edit-ZMERG3L7.js} +1 -1
  142. package/dist/{edit-budget-J27CSEZH.js → edit-budget-L3CCEWNF.js} +1 -1
  143. package/dist/{edit-inventory-item-US77M2FF.js → edit-inventory-item-6B7ITDGD.js} +2 -2
  144. package/dist/{edit-inventory-item-attributes-UGAE2NAZ.js → edit-inventory-item-attributes-Y7MQZLXI.js} +3 -3
  145. package/dist/{fulfillment-DCS67LTK.js → fulfillment-75Z4H23W.js} +16 -14
  146. package/dist/{fulfillment-providers-GM5PO6N3.js → fulfillment-providers-KCQWL62T.js} +20 -17
  147. package/dist/index.css +27 -62
  148. package/dist/index.d.ts +3 -10
  149. package/dist/index.js +522 -458
  150. package/dist/{inventory-OPZ2FSEE.js → inventory-KAUVPMPZ.js} +6 -6
  151. package/dist/{invite-764K3TJS.js → invite-6CPYVHDX.js} +24 -21
  152. package/dist/{invite-KEJLNXEZ.js → invite-CI2P4GF6.js} +15 -12
  153. package/dist/loader-FBB5OQRT.js +31 -0
  154. package/dist/{locations-ZVPTQCQY.js → locations-INS6FTMJ.js} +4 -4
  155. package/dist/{login-OUHRNNXA.js → login-KY342RMK.js} +12 -10
  156. package/dist/{manage-locations-YUKEFCBJ.js → manage-locations-WNHEBS3A.js} +2 -2
  157. package/dist/{media-4KYFHB5V.js → media-KOYAOXG6.js} +41 -9
  158. package/dist/{metadata-NYYL26MQ.js → metadata-2CMH4I6U.js} +16 -14
  159. package/dist/{metadata-AWUKZ25V.js → metadata-5BPOBBU2.js} +3 -3
  160. package/dist/{metadata-OCE6A3JE.js → metadata-GWI6R4ES.js} +15 -13
  161. package/dist/{metadata-G7KZXVNE.js → metadata-NUXUC2JA.js} +15 -13
  162. package/dist/{metadata-XP3ZYW2M.js → metadata-TLDUF5KV.js} +17 -15
  163. package/dist/{metadata-PYY4IB7K.js → metadata-WR4RFXO5.js} +16 -14
  164. package/dist/offer-create-page-YKMHHTU5.js +743 -0
  165. package/dist/offer-detail-page-6MAHNNIO.js +488 -0
  166. package/dist/offer-edit-page-DYQFU6JU.js +151 -0
  167. package/dist/offer-inventory-batch-page-WKCWNDNK.js +290 -0
  168. package/dist/offer-pricing-edit-page-4TYGGSOE.js +195 -0
  169. package/dist/offers-UGQJNGTD.js +32 -0
  170. package/dist/{onboarding-WXZHW62K.js → onboarding-43LQQQGQ.js} +22 -20
  171. package/dist/{orders-LWJ472VM.js → orders-R2LOJ6N5.js} +24 -21
  172. package/dist/organization-XGFU4YDG.js +375 -0
  173. package/dist/{organize-RFOMQCBG.js → organize-HNJUHEEG.js} +4 -4
  174. package/dist/{organize-OVKJ3HZO.js → organize-K6QMAMEN.js} +4 -4
  175. package/dist/pages/index.d.ts +415 -758
  176. package/dist/pages/index.js +81 -77
  177. package/dist/{payment-details-UVXYCTUK.js → payment-details-64US5XWD.js} +17 -15
  178. package/dist/{payouts-TR7K5I37.js → payouts-UXJDTXDL.js} +6 -6
  179. package/dist/{price-lists-S2WNELFZ.js → price-lists-KBPUVSZI.js} +8 -8
  180. package/dist/{pricing-UF27DAXA.js → pricing-DF6C5XK4.js} +35 -32
  181. package/dist/{product-tags-2CKH2M6D.js → product-tags-CL7HSEDI.js} +32 -28
  182. package/dist/{product-types-FX43JEO2.js → product-types-UUHBV4IZ.js} +5 -5
  183. package/dist/product-variant-detail-RVWEYVPC.js +220 -0
  184. package/dist/{product-variant-edit-P3DSIFE3.js → product-variant-edit-MNCS7ZYW.js} +126 -66
  185. package/dist/{products-H5EMRJYS.js → products-4KV5Y2JY.js} +23 -19
  186. package/dist/{products-2LHGS7X3.js → products-SXYTQFJ3.js} +40 -43
  187. package/dist/{professional-details-HYKTH44B.js → professional-details-5T2VS6MM.js} +16 -14
  188. package/dist/{profile-PB27WIRW.js → profile-6XGHAT7H.js} +20 -18
  189. package/dist/{promotions-5EYPGHJP.js → promotions-O7U4BTK6.js} +8 -8
  190. package/dist/{register-4O4F6YZK.js → register-GDKN3SKM.js} +16 -14
  191. package/dist/{reset-password-GTWLBOFK.js → reset-password-EICPAY2N.js} +1 -1
  192. package/dist/{return-reasons-LOKYRGMI.js → return-reasons-M6IR77XW.js} +16 -14
  193. package/dist/{sales-channels-7R2IY3KG.js → sales-channels-B6FULRWI.js} +8 -7
  194. package/dist/{sales-channels-Y4LRP7JC.js → sales-channels-JW3QUYR7.js} +8 -7
  195. package/dist/{settings-2XDLFYMS.js → settings-SAAHTUZZ.js} +39 -35
  196. package/dist/{shipment-4GW2JFWB.js → shipment-Q33QBMXX.js} +13 -11
  197. package/dist/{shipping-profile-R3NABPQF.js → shipping-profile-Y4SNEPZX.js} +2 -2
  198. package/dist/{shipping-profiles-QVKNFLCW.js → shipping-profiles-2NWKCEJK.js} +18 -16
  199. package/dist/{stock-5RXNUPUT.js → stock-7CSVEJJU.js} +19 -17
  200. package/dist/{store-DE2RGX7T.js → store-GHFWU7EV.js} +28 -25
  201. package/dist/{store-closure-DNMCHUXD.js → store-closure-P5PD2RSV.js} +16 -14
  202. package/dist/{store-select-GZEJHRZ7.js → store-select-KDT6USQA.js} +17 -15
  203. package/dist/{tax-regions-UD6P5FVC.js → tax-regions-YXZW7UVX.js} +5 -5
  204. package/dist/{team-JXKAVRPU.js → team-EDJ62747.js} +25 -23
  205. package/dist/types-CtCEtTE6.d.ts +16 -0
  206. package/package.json +3 -3
  207. package/dist/[id]-BYP37PU4.js +0 -1314
  208. package/dist/add-KRAGFFBJ.js +0 -158
  209. package/dist/bulk-edit-3SMBLIOA.js +0 -244
  210. package/dist/chunk-4KX6CBJ4.js +0 -178
  211. package/dist/chunk-DLNNTQRY.js +0 -217
  212. package/dist/chunk-FX4V5JCF.js +0 -37
  213. package/dist/chunk-GC33DBKG.js +0 -143
  214. package/dist/chunk-NK4NR6MN.js +0 -173
  215. package/dist/chunk-PFU6FSXY.js +0 -430
  216. package/dist/chunk-QJEOPT2P.js +0 -330
  217. package/dist/chunk-QSGR43JM.js +0 -30
  218. package/dist/chunk-STR3NGWE.js +0 -3736
  219. package/dist/create-3DOO3RNH.js +0 -716
  220. package/dist/create-I7HV3RM6.js +0 -150
  221. package/dist/edit-K2AD335I.js +0 -237
  222. package/dist/edit-VO5XLIEL.js +0 -362
  223. package/dist/edit-stocks-and-prices-MHHQFWFA.js +0 -408
  224. package/dist/organization-LPYQRTQC.js +0 -303
  225. package/dist/prices-3OXV5RGY.js +0 -270
  226. package/dist/product-variant-detail-WV4KXVXR.js +0 -590
  227. package/dist/stock-GPC3BCL6.js +0 -500
  228. package/dist/{chunk-SDSEW72R.js → chunk-E2HQPY32.js} +3 -3
  229. package/dist/{chunk-6WY5X4PE.js → chunk-L7QKFC5N.js} +7 -7
  230. /package/dist/{chunk-CAS74NLJ.js → chunk-YV6MK4PZ.js} +0 -0
@@ -1,1314 +0,0 @@
1
- import {
2
- SectionRow
3
- } from "./chunk-4TLP3TAA.js";
4
- import {
5
- SidebarLink
6
- } from "./chunk-4GPAS5GW.js";
7
- import "./chunk-U2EI2ZLM.js";
8
- import {
9
- getFormattedCountry
10
- } from "./chunk-W6Y3PPU5.js";
11
- import {
12
- TwoColumnPage
13
- } from "./chunk-CAS74NLJ.js";
14
- import {
15
- useDataTableDateFilters
16
- } from "./chunk-HFRHHT36.js";
17
- import {
18
- DataTable
19
- } from "./chunk-PPLC4IKI.js";
20
- import {
21
- useQueryParams
22
- } from "./chunk-THHRRYRS.js";
23
- import "./chunk-LRD242C7.js";
24
- import "./chunk-JRTZWK77.js";
25
- import "./chunk-47SXTGLN.js";
26
- import "./chunk-F4OJN2F2.js";
27
- import "./chunk-LRARA622.js";
28
- import "./chunk-M6N4ISXL.js";
29
- import "./chunk-S7EKBD2C.js";
30
- import "./chunk-VXMOPVRH.js";
31
- import "./chunk-IQWK723D.js";
32
- import "./chunk-VV6IKGCN.js";
33
- import "./chunk-PCMNEUMV.js";
34
- import "./chunk-BOZJOOGW.js";
35
- import "./chunk-RL7SFZOF.js";
36
- import "./chunk-LWJF63JW.js";
37
- import "./chunk-NBPMNUKZ.js";
38
- import "./chunk-WBI7FEGI.js";
39
- import "./chunk-VXWN37PT.js";
40
- import "./chunk-UL4O5M4S.js";
41
- import "./chunk-FX4V5JCF.js";
42
- import {
43
- ActionMenu
44
- } from "./chunk-BDGZ4EQO.js";
45
- import "./chunk-QHQWEERJ.js";
46
- import {
47
- useSalesChannels
48
- } from "./chunk-3B34B2M2.js";
49
- import {
50
- useProductCategories
51
- } from "./chunk-RUE5BPC2.js";
52
- import {
53
- Thumbnail
54
- } from "./chunk-WIYFXWRI.js";
55
- import "./chunk-LAVHRER2.js";
56
- import "./chunk-Y7QKP6QU.js";
57
- import {
58
- TwoColumnPageSkeleton
59
- } from "./chunk-INNFZYX2.js";
60
- import {
61
- productsQueryKeys,
62
- useDeleteProduct,
63
- useDeleteProductOption,
64
- useDeleteVariantLazy,
65
- useProduct,
66
- useProductVariants,
67
- useRemoveProductAttribute,
68
- useUpdateProduct
69
- } from "./chunk-ZEVYT6IX.js";
70
- import "./chunk-A5DJIOHN.js";
71
- import {
72
- queryClient
73
- } from "./chunk-RHKRREUU.js";
74
- import "./chunk-ZA2KFUFR.js";
75
- import {
76
- sdk
77
- } from "./chunk-RIN4CBRB.js";
78
- import "./chunk-NBMM2TZK.js";
79
-
80
- // src/pages/products/[id]/loader.tsx
81
- var PRODUCT_DETAIL_FIELDS = [
82
- "*variants.inventory_items",
83
- "*variants.images",
84
- "*categories",
85
- "+additional_data",
86
- "+attribute_values.*",
87
- "+attribute_values.attribute.*",
88
- "+options.*",
89
- "+options.values.*"
90
- ].join(",");
91
- var productDetailQuery = (id) => ({
92
- queryKey: productsQueryKeys.detail(id, { fields: PRODUCT_DETAIL_FIELDS }),
93
- queryFn: async () => sdk.vendor.products.$id.query({
94
- $id: id,
95
- fields: PRODUCT_DETAIL_FIELDS
96
- })
97
- });
98
- var loader = async ({ params }) => {
99
- const id = params.id;
100
- const query = productDetailQuery(id);
101
- const response = await queryClient.ensureQueryData({
102
- ...query,
103
- staleTime: 9e4
104
- });
105
- return response;
106
- };
107
-
108
- // src/pages/products/[id]/product-detail-page.tsx
109
- import { Children } from "react";
110
- import { useParams as useParams2 } from "react-router-dom";
111
-
112
- // src/pages/products/[id]/context.tsx
113
- import { createContext, useContext } from "react";
114
- import { jsx } from "react/jsx-runtime";
115
- var ProductDetailContext = createContext(
116
- null
117
- );
118
- var useProductDetailContext = () => {
119
- const context = useContext(ProductDetailContext);
120
- if (!context) {
121
- throw new Error(
122
- "useProductDetailContext must be used within a ProductDetailPage"
123
- );
124
- }
125
- return context;
126
- };
127
- var ProductDetailProvider = ({
128
- product,
129
- children
130
- }) => {
131
- return /* @__PURE__ */ jsx(ProductDetailContext.Provider, { value: { product }, children });
132
- };
133
-
134
- // src/pages/products/[id]/_components/product-general-section/product-general-section.tsx
135
- import { PencilSquare, Trash } from "@medusajs/icons";
136
- import { Container, Heading, StatusBadge, usePrompt } from "@medusajs/ui";
137
- import { useTranslation } from "react-i18next";
138
- import { useNavigate } from "react-router-dom";
139
- import { jsx as jsx2, jsxs } from "react/jsx-runtime";
140
- var productStatusColor = (status) => {
141
- switch (status) {
142
- case "draft":
143
- return "grey";
144
- case "proposed":
145
- return "orange";
146
- case "published":
147
- return "green";
148
- case "rejected":
149
- return "red";
150
- default:
151
- return "grey";
152
- }
153
- };
154
- var ProductGeneralSection = () => {
155
- const { product } = useProductDetailContext();
156
- const { t } = useTranslation();
157
- const prompt = usePrompt();
158
- const navigate = useNavigate();
159
- const { mutateAsync } = useDeleteProduct(product.id);
160
- const handleDelete = async () => {
161
- const res = await prompt({
162
- title: t("general.areYouSure"),
163
- description: t("products.deleteWarning", {
164
- title: product.title
165
- }),
166
- confirmText: t("actions.delete"),
167
- cancelText: t("actions.cancel")
168
- });
169
- if (!res) {
170
- return;
171
- }
172
- await mutateAsync(void 0, {
173
- onSuccess: () => {
174
- navigate("..");
175
- }
176
- });
177
- };
178
- return /* @__PURE__ */ jsxs(Container, { className: "divide-y p-0", children: [
179
- /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between px-6 py-4", children: [
180
- /* @__PURE__ */ jsx2(Heading, { children: product.title }),
181
- /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-x-4", children: [
182
- /* @__PURE__ */ jsx2(StatusBadge, { color: productStatusColor(product.status), children: t(`products.productStatus.${product.status}`) }),
183
- /* @__PURE__ */ jsx2(
184
- ActionMenu,
185
- {
186
- groups: [
187
- {
188
- actions: [
189
- {
190
- label: t("actions.edit"),
191
- to: "edit",
192
- icon: /* @__PURE__ */ jsx2(PencilSquare, {})
193
- }
194
- ]
195
- },
196
- {
197
- actions: [
198
- {
199
- label: t("actions.delete"),
200
- onClick: handleDelete,
201
- icon: /* @__PURE__ */ jsx2(Trash, {})
202
- }
203
- ]
204
- }
205
- ]
206
- }
207
- )
208
- ] })
209
- ] }),
210
- /* @__PURE__ */ jsx2(SectionRow, { title: t("fields.description"), value: product.description || "-" }),
211
- /* @__PURE__ */ jsx2(SectionRow, { title: t("fields.subtitle"), value: product.subtitle || "-" }),
212
- /* @__PURE__ */ jsx2(SectionRow, { title: t("fields.handle"), value: `/${product.handle}` }),
213
- /* @__PURE__ */ jsx2(
214
- SectionRow,
215
- {
216
- title: t("fields.discountable"),
217
- value: product.discountable ? t("general.true") : t("general.false")
218
- }
219
- )
220
- ] });
221
- };
222
-
223
- // src/pages/products/[id]/_components/product-media-section/product-media-section.tsx
224
- import { useState } from "react";
225
- import { PencilSquare as PencilSquare2, ThumbnailBadge } from "@medusajs/icons";
226
- import {
227
- Button,
228
- Checkbox,
229
- clx,
230
- CommandBar,
231
- Container as Container2,
232
- Heading as Heading2,
233
- Text,
234
- Tooltip,
235
- usePrompt as usePrompt2
236
- } from "@medusajs/ui";
237
- import { useTranslation as useTranslation2 } from "react-i18next";
238
- import { Link } from "react-router-dom";
239
- import { jsx as jsx3, jsxs as jsxs2 } from "react/jsx-runtime";
240
- var ProductMediaSection = () => {
241
- const { product } = useProductDetailContext();
242
- const { t } = useTranslation2();
243
- const prompt = usePrompt2();
244
- const [selection, setSelection] = useState({});
245
- const media = getMedia(product);
246
- const handleCheckedChange = (id) => {
247
- setSelection((prev) => {
248
- if (prev[id]) {
249
- const { [id]: _, ...rest } = prev;
250
- return rest;
251
- } else {
252
- return { ...prev, [id]: true };
253
- }
254
- });
255
- };
256
- const { mutateAsync } = useUpdateProduct(product.id);
257
- const handleDelete = async () => {
258
- const ids = Object.keys(selection);
259
- const includingThumbnail = ids.some((id) => media.find((m) => m.id === id)?.isThumbnail);
260
- const res = await prompt({
261
- title: t("general.areYouSure"),
262
- description: includingThumbnail ? t("products.media.deleteWarningWithThumbnail", {
263
- count: ids.length
264
- }) : t("products.media.deleteWarning", {
265
- count: ids.length
266
- }),
267
- confirmText: t("actions.delete"),
268
- cancelText: t("actions.cancel")
269
- });
270
- if (!res) {
271
- return;
272
- }
273
- const mediaToKeep = product.images?.filter((i) => !ids.includes(i.id)).map((i) => ({ url: i.url }));
274
- await mutateAsync(
275
- {
276
- images: mediaToKeep,
277
- thumbnail: includingThumbnail ? "" : void 0
278
- },
279
- {
280
- onSuccess: () => {
281
- setSelection({});
282
- }
283
- }
284
- );
285
- };
286
- return /* @__PURE__ */ jsxs2(Container2, { className: "divide-y p-0", children: [
287
- /* @__PURE__ */ jsxs2("div", { className: "flex items-center justify-between px-6 py-4", children: [
288
- /* @__PURE__ */ jsx3(Heading2, { level: "h2", children: t("products.media.label") }),
289
- /* @__PURE__ */ jsx3(
290
- ActionMenu,
291
- {
292
- groups: [
293
- {
294
- actions: [
295
- {
296
- label: t("actions.edit"),
297
- to: "media?view=edit",
298
- icon: /* @__PURE__ */ jsx3(PencilSquare2, {})
299
- }
300
- ]
301
- }
302
- ]
303
- }
304
- )
305
- ] }),
306
- media.length > 0 ? /* @__PURE__ */ jsx3("div", { className: "grid grid-cols-[repeat(auto-fill,minmax(96px,1fr))] gap-4 px-6 py-4", children: media.map((i, index) => {
307
- const isSelected = selection[i.id];
308
- return /* @__PURE__ */ jsxs2(
309
- "div",
310
- {
311
- className: "group relative aspect-square size-full cursor-pointer overflow-hidden rounded-[8px] shadow-elevation-card-rest transition-fg hover:shadow-elevation-card-hover",
312
- children: [
313
- /* @__PURE__ */ jsx3(
314
- "div",
315
- {
316
- className: clx(
317
- "invisible absolute right-2 top-2 opacity-0 transition-fg group-hover:visible group-hover:opacity-100",
318
- {
319
- "visible opacity-100": isSelected
320
- }
321
- ),
322
- children: /* @__PURE__ */ jsx3(
323
- Checkbox,
324
- {
325
- checked: selection[i.id] || false,
326
- onCheckedChange: () => handleCheckedChange(i.id)
327
- }
328
- )
329
- }
330
- ),
331
- i.isThumbnail && /* @__PURE__ */ jsx3("div", { className: "absolute left-2 top-2", children: /* @__PURE__ */ jsx3(Tooltip, { content: t("fields.thumbnail"), children: /* @__PURE__ */ jsx3(ThumbnailBadge, {}) }) }),
332
- /* @__PURE__ */ jsx3(
333
- Link,
334
- {
335
- to: `media`,
336
- state: { curr: index },
337
- children: /* @__PURE__ */ jsx3(
338
- "img",
339
- {
340
- src: i.url,
341
- alt: product.title,
342
- className: "size-full object-cover"
343
- }
344
- )
345
- }
346
- )
347
- ]
348
- },
349
- i.id
350
- );
351
- }) }) : /* @__PURE__ */ jsxs2("div", { className: "flex flex-col items-center gap-y-4 pb-8 pt-6", children: [
352
- /* @__PURE__ */ jsxs2("div", { className: "flex flex-col items-center", children: [
353
- /* @__PURE__ */ jsx3(
354
- Text,
355
- {
356
- size: "small",
357
- leading: "compact",
358
- weight: "plus",
359
- className: "text-ui-fg-subtle",
360
- children: t("products.media.emptyState.header")
361
- }
362
- ),
363
- /* @__PURE__ */ jsx3(
364
- Text,
365
- {
366
- size: "small",
367
- className: "text-ui-fg-muted",
368
- children: t("products.media.emptyState.description")
369
- }
370
- )
371
- ] }),
372
- /* @__PURE__ */ jsx3(
373
- Button,
374
- {
375
- size: "small",
376
- variant: "secondary",
377
- asChild: true,
378
- children: /* @__PURE__ */ jsx3(Link, { to: "media?view=edit", children: t("products.media.emptyState.action") })
379
- }
380
- )
381
- ] }),
382
- /* @__PURE__ */ jsx3(CommandBar, { open: !!Object.keys(selection).length, children: /* @__PURE__ */ jsxs2(CommandBar.Bar, { children: [
383
- /* @__PURE__ */ jsx3(CommandBar.Value, { children: t("general.countSelected", {
384
- count: Object.keys(selection).length
385
- }) }),
386
- /* @__PURE__ */ jsx3(CommandBar.Seperator, {}),
387
- /* @__PURE__ */ jsx3(
388
- CommandBar.Command,
389
- {
390
- action: handleDelete,
391
- label: t("actions.delete"),
392
- shortcut: "d"
393
- }
394
- )
395
- ] }) })
396
- ] });
397
- };
398
- var getMedia = (product) => {
399
- const { images = [], thumbnail } = product;
400
- const media = (images || []).map((image) => ({
401
- id: image.id,
402
- url: image.url,
403
- isThumbnail: image.url === thumbnail
404
- }));
405
- if (thumbnail && !media.some((mediaItem) => mediaItem.url === thumbnail)) {
406
- media.unshift({
407
- id: "img_thumbnail",
408
- url: thumbnail,
409
- isThumbnail: true
410
- });
411
- }
412
- return media;
413
- };
414
-
415
- // src/pages/products/[id]/_components/product-option-section/product-option-section.tsx
416
- import { PencilSquare as PencilSquare3, Plus, Trash as Trash2 } from "@medusajs/icons";
417
- import { Badge, Container as Container3, Heading as Heading3, usePrompt as usePrompt3 } from "@medusajs/ui";
418
- import { useTranslation as useTranslation3 } from "react-i18next";
419
- import { jsx as jsx4, jsxs as jsxs3 } from "react/jsx-runtime";
420
- var OptionActions = ({
421
- option
422
- }) => {
423
- const { product } = useProductDetailContext();
424
- const { t } = useTranslation3();
425
- const { mutateAsync } = useDeleteProductOption(product.id, option.id);
426
- const prompt = usePrompt3();
427
- const handleDelete = async () => {
428
- const res = await prompt({
429
- title: t("general.areYouSure"),
430
- description: t("products.options.deleteWarning", {
431
- title: option.title
432
- }),
433
- confirmText: t("actions.delete"),
434
- cancelText: t("actions.cancel")
435
- });
436
- if (!res) {
437
- return;
438
- }
439
- await mutateAsync();
440
- };
441
- return /* @__PURE__ */ jsx4(
442
- ActionMenu,
443
- {
444
- groups: [
445
- {
446
- actions: [
447
- {
448
- label: t("actions.edit"),
449
- to: `options/${option.id}/edit`,
450
- icon: /* @__PURE__ */ jsx4(PencilSquare3, {})
451
- }
452
- ]
453
- },
454
- {
455
- actions: [
456
- {
457
- label: t("actions.delete"),
458
- onClick: handleDelete,
459
- icon: /* @__PURE__ */ jsx4(Trash2, {})
460
- }
461
- ]
462
- }
463
- ]
464
- }
465
- );
466
- };
467
- var ProductOptionSection = () => {
468
- const { product } = useProductDetailContext();
469
- const { t } = useTranslation3();
470
- return /* @__PURE__ */ jsxs3(Container3, { className: "divide-y p-0", children: [
471
- /* @__PURE__ */ jsxs3("div", { className: "flex items-center justify-between px-6 py-4", children: [
472
- /* @__PURE__ */ jsx4(Heading3, { level: "h2", children: t("products.options.header") }),
473
- /* @__PURE__ */ jsx4(
474
- ActionMenu,
475
- {
476
- groups: [
477
- {
478
- actions: [
479
- {
480
- label: t("actions.create"),
481
- to: "options/create",
482
- icon: /* @__PURE__ */ jsx4(Plus, {})
483
- }
484
- ]
485
- }
486
- ]
487
- }
488
- )
489
- ] }),
490
- product.options?.map((option) => {
491
- return /* @__PURE__ */ jsx4(
492
- SectionRow,
493
- {
494
- title: option.title,
495
- value: option.values?.map((val) => {
496
- return /* @__PURE__ */ jsx4(
497
- Badge,
498
- {
499
- size: "2xsmall",
500
- className: "flex min-w-[20px] items-center justify-center",
501
- children: val.value
502
- },
503
- val.value
504
- );
505
- }),
506
- actions: /* @__PURE__ */ jsx4(OptionActions, { option })
507
- },
508
- option.id
509
- );
510
- })
511
- ] });
512
- };
513
-
514
- // src/pages/products/[id]/_components/product-organization-section/product-organization-section.tsx
515
- import { useMemo } from "react";
516
- import { PencilSquare as PencilSquare4 } from "@medusajs/icons";
517
- import { Badge as Badge2, Container as Container4, Heading as Heading4, Tooltip as Tooltip2 } from "@medusajs/ui";
518
- import { useTranslation as useTranslation4 } from "react-i18next";
519
- import { Link as Link2 } from "react-router-dom";
520
- import { jsx as jsx5, jsxs as jsxs4 } from "react/jsx-runtime";
521
- var ProductOrganizationSection = () => {
522
- const { product } = useProductDetailContext();
523
- const { t } = useTranslation4();
524
- const additionalSecondaryCategoryIds = useMemo(() => {
525
- const additional = product.additional_data?.secondary_categories;
526
- if (!additional || !Array.isArray(additional)) return [];
527
- return additional.flatMap(
528
- (entry) => Array.isArray(entry.category_ids) ? entry.category_ids : []
529
- );
530
- }, [product]);
531
- const hasSecondaryFromAdditional = additionalSecondaryCategoryIds.length > 0;
532
- const { product_categories: allCategories } = useProductCategories(
533
- {
534
- id: additionalSecondaryCategoryIds,
535
- limit: 100
536
- },
537
- { enabled: hasSecondaryFromAdditional }
538
- );
539
- const secondaryCategories = useMemo(() => {
540
- if (product.secondary_categories?.length) {
541
- return product.secondary_categories;
542
- }
543
- if (hasSecondaryFromAdditional && allCategories) {
544
- return allCategories;
545
- }
546
- return [];
547
- }, [product, hasSecondaryFromAdditional, allCategories]);
548
- return /* @__PURE__ */ jsxs4(Container4, { className: "divide-y p-0", children: [
549
- /* @__PURE__ */ jsxs4("div", { className: "flex items-center justify-between px-6 py-4", children: [
550
- /* @__PURE__ */ jsx5(Heading4, { level: "h2", children: t("products.organization.header") }),
551
- /* @__PURE__ */ jsx5(
552
- ActionMenu,
553
- {
554
- groups: [
555
- {
556
- actions: [
557
- {
558
- label: t("actions.edit"),
559
- to: "organization",
560
- icon: /* @__PURE__ */ jsx5(PencilSquare4, {})
561
- }
562
- ]
563
- }
564
- ]
565
- }
566
- )
567
- ] }),
568
- /* @__PURE__ */ jsx5(
569
- SectionRow,
570
- {
571
- title: t("fields.tags"),
572
- value: product.tags?.length ? product.tags.map((tag) => /* @__PURE__ */ jsx5(
573
- OrganizationTag,
574
- {
575
- label: tag.value,
576
- to: `/settings/product-tags/${tag.id}`
577
- },
578
- tag.id
579
- )) : void 0
580
- }
581
- ),
582
- /* @__PURE__ */ jsx5(
583
- SectionRow,
584
- {
585
- title: t("fields.type"),
586
- value: product.type ? /* @__PURE__ */ jsx5(
587
- OrganizationTag,
588
- {
589
- label: product.type.value,
590
- to: `/settings/product-types/${product.type_id}`
591
- }
592
- ) : void 0
593
- }
594
- ),
595
- /* @__PURE__ */ jsx5(
596
- SectionRow,
597
- {
598
- title: t("fields.collection"),
599
- value: product.collection ? /* @__PURE__ */ jsx5(
600
- OrganizationTag,
601
- {
602
- label: product.collection.title,
603
- to: `/collections/${product.collection.id}`
604
- }
605
- ) : void 0
606
- }
607
- ),
608
- /* @__PURE__ */ jsx5(
609
- SectionRow,
610
- {
611
- title: t("products.fields.primaryCategory.label"),
612
- value: product.categories?.length ? product.categories.map((pcat) => /* @__PURE__ */ jsx5(
613
- OrganizationTag,
614
- {
615
- label: pcat.name,
616
- to: `/categories/${pcat.id}`
617
- },
618
- pcat.id
619
- )) : void 0
620
- }
621
- ),
622
- /* @__PURE__ */ jsx5(
623
- SectionRow,
624
- {
625
- title: t("products.fields.secondaryCategories.label", "Secondary Categories"),
626
- value: secondaryCategories?.length ? secondaryCategories.map((cat) => /* @__PURE__ */ jsx5(
627
- OrganizationTag,
628
- {
629
- label: cat.name,
630
- to: `/categories/${cat.id}`
631
- },
632
- cat.id
633
- )) : void 0
634
- }
635
- )
636
- ] });
637
- };
638
- var OrganizationTag = ({ label, to }) => {
639
- return /* @__PURE__ */ jsx5(Tooltip2, { content: label, children: /* @__PURE__ */ jsx5(Badge2, { size: "2xsmall", className: "block w-fit truncate", asChild: true, children: /* @__PURE__ */ jsx5(Link2, { to, children: label }) }) });
640
- };
641
-
642
- // src/pages/products/[id]/_components/product-variant-section/product-variant-section.tsx
643
- import { Buildings, Component, PencilSquare as PencilSquare5, Trash as Trash3 } from "@medusajs/icons";
644
- import {
645
- Badge as Badge3,
646
- clx as clx2,
647
- Container as Container5,
648
- createDataTableColumnHelper,
649
- createDataTableCommandHelper,
650
- createDataTableFilterHelper,
651
- Tooltip as Tooltip3,
652
- usePrompt as usePrompt4
653
- } from "@medusajs/ui";
654
- import { keepPreviousData } from "@tanstack/react-query";
655
- import { useCallback, useMemo as useMemo2 } from "react";
656
- import { useTranslation as useTranslation5 } from "react-i18next";
657
- import { useNavigate as useNavigate2, useParams, useSearchParams } from "react-router-dom";
658
-
659
- // src/pages/products/common/constants.ts
660
- var PRODUCT_VARIANT_IDS_KEY = "product_variant_ids";
661
-
662
- // src/pages/products/[id]/_components/product-variant-section/product-variant-section.tsx
663
- import { jsx as jsx6, jsxs as jsxs5 } from "react/jsx-runtime";
664
- var PAGE_SIZE = 10;
665
- var PREFIX = "pv";
666
- var ProductVariantSection = () => {
667
- const { id } = useParams();
668
- const { product } = useProduct(id);
669
- const { t } = useTranslation5();
670
- const { q, order, offset, allow_backorder, manage_inventory } = useQueryParams(
671
- ["q", "order", "offset", "manage_inventory", "allow_backorder"],
672
- PREFIX
673
- );
674
- const columns = useColumns(product);
675
- const filters = useFilters();
676
- const commands = useCommands();
677
- const { variants, count, isPending, isError, error } = useProductVariants(
678
- product.id,
679
- {
680
- q,
681
- order: order ? order : "variant_rank",
682
- offset: offset ? parseInt(offset) : void 0,
683
- limit: PAGE_SIZE,
684
- allow_backorder: allow_backorder ? JSON.parse(allow_backorder) : void 0,
685
- manage_inventory: manage_inventory ? JSON.parse(manage_inventory) : void 0,
686
- fields: "title,sku,thumbnail,*options,created_at,updated_at,*inventory_items.inventory.location_levels,inventory_quantity,manage_inventory"
687
- },
688
- {
689
- placeholderData: keepPreviousData
690
- }
691
- );
692
- if (isError) {
693
- throw error;
694
- }
695
- return /* @__PURE__ */ jsx6(Container5, { className: "divide-y p-0", children: /* @__PURE__ */ jsx6(
696
- DataTable,
697
- {
698
- data: variants,
699
- columns,
700
- filters,
701
- rowCount: count,
702
- getRowId: (row) => row.id,
703
- rowHref: (row) => `/products/${product.id}/variants/${row.id}`,
704
- pageSize: PAGE_SIZE,
705
- isLoading: isPending,
706
- heading: t("products.variants.header"),
707
- headingLevel: "h2",
708
- emptyState: {
709
- empty: {
710
- heading: t("products.variants.empty.heading"),
711
- description: t("products.variants.empty.description")
712
- },
713
- filtered: {
714
- heading: t("products.variants.filtered.heading"),
715
- description: t("products.variants.filtered.description")
716
- }
717
- },
718
- action: {
719
- label: t("actions.create"),
720
- to: `variants/create`
721
- },
722
- actionMenu: {
723
- groups: [
724
- {
725
- actions: [
726
- {
727
- label: t("products.variants.editStocksAndPrices.action", "Edit Stocks & Prices"),
728
- to: `edit-stocks-and-prices`,
729
- icon: /* @__PURE__ */ jsx6(PencilSquare5, {})
730
- }
731
- ]
732
- }
733
- ]
734
- },
735
- commands,
736
- prefix: PREFIX
737
- }
738
- ) });
739
- };
740
- var columnHelper = createDataTableColumnHelper();
741
- var useColumns = (product) => {
742
- const { t } = useTranslation5();
743
- const navigate = useNavigate2();
744
- const { mutateAsync } = useDeleteVariantLazy(product.id);
745
- const prompt = usePrompt4();
746
- const [searchParams] = useSearchParams();
747
- const _tableSearchParams = useMemo2(() => {
748
- const filtered = new URLSearchParams();
749
- for (const [key, value] of searchParams.entries()) {
750
- if (key.startsWith(`${PREFIX}_`)) {
751
- filtered.append(key, value);
752
- }
753
- }
754
- return filtered;
755
- }, [searchParams]);
756
- const handleDelete = useCallback(
757
- async (id, title) => {
758
- const res = await prompt({
759
- title: t("general.areYouSure"),
760
- description: t("products.deleteVariantWarning", {
761
- title
762
- }),
763
- confirmText: t("actions.delete"),
764
- cancelText: t("actions.cancel")
765
- });
766
- if (!res) {
767
- return;
768
- }
769
- await mutateAsync({ variantId: id });
770
- },
771
- [mutateAsync, prompt, t]
772
- );
773
- const optionColumns = useMemo2(() => {
774
- if (!product?.options) {
775
- return [];
776
- }
777
- return product.options.map((option) => {
778
- return columnHelper.display({
779
- id: option.id,
780
- header: option.title,
781
- cell: ({ row }) => {
782
- const variantOpt = row.original.options?.find(
783
- (opt) => opt.option_id === option.id
784
- );
785
- if (!variantOpt) {
786
- return /* @__PURE__ */ jsx6("span", { className: "text-ui-fg-muted", children: "-" });
787
- }
788
- return /* @__PURE__ */ jsx6("div", { className: "flex items-center", children: /* @__PURE__ */ jsx6(Tooltip3, { content: variantOpt.value, children: /* @__PURE__ */ jsx6(
789
- Badge3,
790
- {
791
- size: "2xsmall",
792
- title: variantOpt.value,
793
- className: "inline-flex min-w-[20px] max-w-[140px] items-center justify-center overflow-hidden truncate",
794
- children: variantOpt.value
795
- }
796
- ) }) });
797
- }
798
- });
799
- });
800
- }, [product]);
801
- const getActions = useCallback(
802
- (ctx) => {
803
- const variant = ctx.row.original;
804
- const mainActions = [
805
- {
806
- icon: /* @__PURE__ */ jsx6(PencilSquare5, {}),
807
- label: t("actions.edit"),
808
- onClick: () => {
809
- navigate(`variants/${variant.id}/edit`);
810
- }
811
- }
812
- ];
813
- if (variant.manage_inventory) {
814
- const inventoryItemsCount = variant.inventory_items?.length || 0;
815
- if (inventoryItemsCount === 1) {
816
- const inventoryItemLink = `/inventory/${variant.inventory_items[0].inventory.id}`;
817
- mainActions.push({
818
- label: t("products.variant.inventory.actions.inventoryItems"),
819
- onClick: () => {
820
- navigate(inventoryItemLink);
821
- },
822
- icon: /* @__PURE__ */ jsx6(Buildings, {})
823
- });
824
- } else if (inventoryItemsCount > 1) {
825
- const ids = variant.inventory_items?.map((i) => i.inventory?.id).filter(Boolean);
826
- if (ids && ids.length > 0) {
827
- const inventoryKitLink = `/inventory?${new URLSearchParams({
828
- id: ids.join(",")
829
- }).toString()}`;
830
- mainActions.push({
831
- label: t("products.variant.inventory.actions.inventoryKit"),
832
- onClick: () => {
833
- navigate(inventoryKitLink);
834
- },
835
- icon: /* @__PURE__ */ jsx6(Component, {})
836
- });
837
- }
838
- }
839
- }
840
- const secondaryActions = [
841
- {
842
- icon: /* @__PURE__ */ jsx6(Trash3, {}),
843
- label: t("actions.delete"),
844
- onClick: () => handleDelete(variant.id, variant.title)
845
- }
846
- ];
847
- return [mainActions, secondaryActions];
848
- },
849
- [handleDelete, navigate, t]
850
- );
851
- const getInventory = useCallback(
852
- (variant) => {
853
- const castVariant = variant;
854
- if (!variant.manage_inventory) {
855
- return {
856
- text: t("products.variant.inventory.notManaged"),
857
- hasInventoryKit: false,
858
- notManaged: true
859
- };
860
- }
861
- const inventoryItems = castVariant.inventory_items?.map((i) => i.inventory).filter(Boolean);
862
- const hasInventoryKit = inventoryItems.length > 1;
863
- const locations = {};
864
- let totalStocked = 0;
865
- inventoryItems.forEach((i) => {
866
- i.location_levels?.forEach((l) => {
867
- locations[l.id] = true;
868
- totalStocked += l.stocked_quantity ?? 0;
869
- });
870
- });
871
- const locationCount = Object.keys(locations).length;
872
- const quantity = variant.inventory_quantity ?? totalStocked;
873
- const text = hasInventoryKit ? t("products.variant.tableItemAvailable", {
874
- availableCount: quantity
875
- }) : t("products.variant.tableItem", {
876
- availableCount: quantity,
877
- locationCount,
878
- count: locationCount
879
- });
880
- return { text, hasInventoryKit, quantity, notManaged: false };
881
- },
882
- [t]
883
- );
884
- return useMemo2(() => {
885
- return [
886
- columnHelper.accessor("thumbnail", {
887
- header: "",
888
- headerAlign: "center",
889
- maxSize: 72,
890
- cell: ({ row }) => {
891
- return /* @__PURE__ */ jsx6("div", { className: "flex items-center pl-[1px]", children: /* @__PURE__ */ jsx6(Thumbnail, { src: row.original.thumbnail }) });
892
- }
893
- }),
894
- columnHelper.accessor("title", {
895
- header: t("fields.title"),
896
- enableSorting: true,
897
- sortAscLabel: t("filters.sorting.alphabeticallyAsc"),
898
- sortDescLabel: t("filters.sorting.alphabeticallyDesc")
899
- }),
900
- columnHelper.accessor("sku", {
901
- header: t("fields.sku"),
902
- enableSorting: true,
903
- sortAscLabel: t("filters.sorting.alphabeticallyAsc"),
904
- sortDescLabel: t("filters.sorting.alphabeticallyDesc")
905
- }),
906
- columnHelper.accessor("created_at", {
907
- header: t("fields.createdAt"),
908
- enableSorting: true,
909
- sortAscLabel: t("filters.sorting.dateAsc"),
910
- sortDescLabel: t("filters.sorting.dateDesc"),
911
- enableHiding: true,
912
- isVisibleByDefault: false
913
- }),
914
- columnHelper.accessor("updated_at", {
915
- header: t("fields.updatedAt"),
916
- enableSorting: true,
917
- sortAscLabel: t("filters.sorting.dateAsc"),
918
- sortDescLabel: t("filters.sorting.dateDesc"),
919
- enableHiding: true,
920
- isVisibleByDefault: false
921
- }),
922
- ...optionColumns,
923
- columnHelper.display({
924
- id: "inventory",
925
- header: t("fields.inventory"),
926
- cell: ({ row }) => {
927
- const { text, hasInventoryKit, quantity, notManaged } = getInventory(
928
- row.original
929
- );
930
- return /* @__PURE__ */ jsx6(Tooltip3, { content: text, children: /* @__PURE__ */ jsxs5("div", { className: "flex h-full w-full items-center gap-2 overflow-hidden", children: [
931
- hasInventoryKit && /* @__PURE__ */ jsx6(Component, {}),
932
- /* @__PURE__ */ jsx6(
933
- "span",
934
- {
935
- className: clx2("truncate", {
936
- "text-ui-fg-error": !quantity && !notManaged
937
- }),
938
- children: text
939
- }
940
- )
941
- ] }) });
942
- },
943
- maxSize: 250
944
- }),
945
- columnHelper.action({
946
- actions: getActions
947
- })
948
- ];
949
- }, [t, optionColumns, getActions, getInventory]);
950
- };
951
- var filterHelper = createDataTableFilterHelper();
952
- var useFilters = () => {
953
- const { t } = useTranslation5();
954
- const dateFilters = useDataTableDateFilters();
955
- return useMemo2(() => {
956
- return [
957
- filterHelper.accessor("allow_backorder", {
958
- type: "radio",
959
- label: t("fields.allowBackorder"),
960
- options: [
961
- { label: t("filters.radio.yes"), value: "true" },
962
- { label: t("filters.radio.no"), value: "false" }
963
- ]
964
- }),
965
- filterHelper.accessor("manage_inventory", {
966
- type: "radio",
967
- label: t("fields.manageInventory"),
968
- options: [
969
- { label: t("filters.radio.yes"), value: "true" },
970
- { label: t("filters.radio.no"), value: "false" }
971
- ]
972
- }),
973
- ...dateFilters
974
- ];
975
- }, [t, dateFilters]);
976
- };
977
- var commandHelper = createDataTableCommandHelper();
978
- var useCommands = () => {
979
- const { t } = useTranslation5();
980
- const navigate = useNavigate2();
981
- return [
982
- commandHelper.command({
983
- label: t("inventory.stock.action"),
984
- shortcut: "i",
985
- action: async (selection) => {
986
- navigate(
987
- `stock?${PRODUCT_VARIANT_IDS_KEY}=${Object.keys(selection).join(",")}`
988
- );
989
- }
990
- })
991
- ];
992
- };
993
-
994
- // src/pages/products/[id]/_components/product-attribute-section/product-attribute-section.tsx
995
- import { PencilSquare as PencilSquare6 } from "@medusajs/icons";
996
- import { Container as Container6, Heading as Heading5 } from "@medusajs/ui";
997
- import { useTranslation as useTranslation6 } from "react-i18next";
998
- import { jsx as jsx7, jsxs as jsxs6 } from "react/jsx-runtime";
999
- var ProductAttributeSection = () => {
1000
- const { product } = useProductDetailContext();
1001
- const { t } = useTranslation6();
1002
- return /* @__PURE__ */ jsxs6(Container6, { className: "divide-y p-0", children: [
1003
- /* @__PURE__ */ jsxs6("div", { className: "flex items-center justify-between px-6 py-4", children: [
1004
- /* @__PURE__ */ jsx7(Heading5, { level: "h2", children: t("products.attributes") }),
1005
- /* @__PURE__ */ jsx7(
1006
- ActionMenu,
1007
- {
1008
- groups: [
1009
- {
1010
- actions: [
1011
- {
1012
- label: t("actions.edit"),
1013
- to: "attributes",
1014
- icon: /* @__PURE__ */ jsx7(PencilSquare6, {})
1015
- }
1016
- ]
1017
- }
1018
- ]
1019
- }
1020
- )
1021
- ] }),
1022
- /* @__PURE__ */ jsx7(SectionRow, { title: t("fields.height"), value: product.height }),
1023
- /* @__PURE__ */ jsx7(SectionRow, { title: t("fields.width"), value: product.width }),
1024
- /* @__PURE__ */ jsx7(SectionRow, { title: t("fields.length"), value: product.length }),
1025
- /* @__PURE__ */ jsx7(SectionRow, { title: t("fields.weight"), value: product.weight }),
1026
- /* @__PURE__ */ jsx7(SectionRow, { title: t("fields.midCode"), value: product.mid_code }),
1027
- /* @__PURE__ */ jsx7(SectionRow, { title: t("fields.hsCode"), value: product.hs_code }),
1028
- /* @__PURE__ */ jsx7(
1029
- SectionRow,
1030
- {
1031
- title: t("fields.countryOfOrigin"),
1032
- value: getFormattedCountry(product.origin_country)
1033
- }
1034
- )
1035
- ] });
1036
- };
1037
-
1038
- // src/pages/products/[id]/_components/product-additional-attribute-section/ProductAdditionalAttributesSection.tsx
1039
- import { DropCap, PencilSquare as PencilSquare7, Plus as Plus2, Swatch, Trash as Trash4 } from "@medusajs/icons";
1040
- import { Badge as Badge4, Container as Container7, Heading as Heading6, Text as Text2, toast, usePrompt as usePrompt5 } from "@medusajs/ui";
1041
- import { useTranslation as useTranslation7 } from "react-i18next";
1042
- import { jsx as jsx8, jsxs as jsxs7 } from "react/jsx-runtime";
1043
- var OptionRowActions = ({ productId, option }) => {
1044
- const { t } = useTranslation7();
1045
- const prompt = usePrompt5();
1046
- const { mutateAsync, isPending } = useDeleteProductOption(productId, option.id);
1047
- const canDelete = option.metadata?.author !== "admin";
1048
- const handleDelete = async () => {
1049
- const res = await prompt({
1050
- title: t("general.areYouSure"),
1051
- description: t("products.options.deleteWarning", { title: option.title }),
1052
- confirmText: t("actions.delete"),
1053
- cancelText: t("actions.cancel")
1054
- });
1055
- if (!res) return;
1056
- await mutateAsync(void 0, { onError: (err) => toast.error(err.message) });
1057
- };
1058
- return /* @__PURE__ */ jsx8(
1059
- ActionMenu,
1060
- {
1061
- groups: [
1062
- { actions: [{ icon: /* @__PURE__ */ jsx8(PencilSquare7, {}), label: t("actions.edit"), to: `options/${option.id}/edit` }] },
1063
- ...canDelete ? [{ actions: [{ icon: /* @__PURE__ */ jsx8(Trash4, {}), label: t("actions.delete"), disabled: isPending, onClick: handleDelete }] }] : []
1064
- ]
1065
- }
1066
- );
1067
- };
1068
- var InformationalAttributeRowActions = ({ productId, attribute }) => {
1069
- const { t } = useTranslation7();
1070
- const prompt = usePrompt5();
1071
- const { mutateAsync, isPending } = useRemoveProductAttribute(productId, attribute.attribute_id);
1072
- const isVendorSource = attribute.attribute_source === "vendor";
1073
- const handleDelete = async () => {
1074
- const res = await prompt({
1075
- title: t("general.areYouSure"),
1076
- description: t("products.attributesSection.removeWarning"),
1077
- confirmText: t("actions.delete"),
1078
- cancelText: t("actions.cancel")
1079
- });
1080
- if (!res) return;
1081
- await mutateAsync(void 0, { onError: (err) => toast.error(err.message) });
1082
- };
1083
- return /* @__PURE__ */ jsx8(
1084
- ActionMenu,
1085
- {
1086
- groups: [
1087
- { actions: [{ icon: /* @__PURE__ */ jsx8(PencilSquare7, {}), label: t("actions.edit"), to: `informational-attributes/${attribute.attribute_id}/edit` }] },
1088
- ...isVendorSource ? [{ actions: [{ icon: /* @__PURE__ */ jsx8(Trash4, {}), label: t("actions.delete"), disabled: isPending, onClick: handleDelete }] }] : []
1089
- ]
1090
- }
1091
- );
1092
- };
1093
- var ProductAdditionalAttributesSection = ({ product }) => {
1094
- const { t } = useTranslation7();
1095
- const informationalAttributes = product.informational_attributes?.filter(Boolean) ?? [];
1096
- const options = product.options?.filter(Boolean) ?? [];
1097
- if (!informationalAttributes.length && !options.length) return null;
1098
- return /* @__PURE__ */ jsxs7(Container7, { className: "p-0", children: [
1099
- /* @__PURE__ */ jsxs7("div", { className: "flex items-center justify-between border-b px-6 py-4", children: [
1100
- /* @__PURE__ */ jsx8(Heading6, { children: t("products.attributes") }),
1101
- /* @__PURE__ */ jsx8(ActionMenu, { groups: [{ actions: [{ label: t("actions.add"), to: "attributes/add", icon: /* @__PURE__ */ jsx8(Plus2, {}) }] }] })
1102
- ] }),
1103
- options.length > 0 && /* @__PURE__ */ jsxs7("div", { className: "px-3 py-4", children: [
1104
- /* @__PURE__ */ jsxs7("div", { className: "flex items-center gap-x-3 px-3 pb-4", children: [
1105
- /* @__PURE__ */ jsx8("div", { className: "flex size-7 items-center justify-center rounded-md bg-ui-bg-base shadow-borders-base", children: /* @__PURE__ */ jsx8("div", { className: "flex size-6 items-center justify-center rounded-[4px] bg-ui-bg-component", children: /* @__PURE__ */ jsx8(Swatch, { className: "text-ui-fg-subtle" }) }) }),
1106
- /* @__PURE__ */ jsxs7("div", { children: [
1107
- /* @__PURE__ */ jsx8(Text2, { size: "small", weight: "plus", leading: "compact", children: t("products.options.variations.label") }),
1108
- /* @__PURE__ */ jsx8(Text2, { size: "xsmall", leading: "compact", className: "text-ui-fg-subtle", children: t("products.options.variations.description") })
1109
- ] })
1110
- ] }),
1111
- /* @__PURE__ */ jsx8("div", { className: "divide-y overflow-hidden rounded-lg border", children: options.map((option) => /* @__PURE__ */ jsx8(
1112
- SectionRow,
1113
- {
1114
- title: option.title,
1115
- actions: /* @__PURE__ */ jsx8(OptionRowActions, { productId: product.id, option }),
1116
- className: "bg-ui-bg-component p-3",
1117
- value: option.values?.map((value, index) => /* @__PURE__ */ jsx8(Badge4, { size: "2xsmall", className: "flex min-w-[20px] items-center justify-center", children: value.value }, `${option.id}-${value.value}-${index}`)),
1118
- tooltip: option.metadata?.author === "admin" ? t("products.edit.attributes.required") : void 0
1119
- },
1120
- option.id
1121
- )) })
1122
- ] }),
1123
- options.length > 0 && informationalAttributes.length > 0 && /* @__PURE__ */ jsx8("div", { className: "border-t border-dashed border-ui-border-base" }),
1124
- informationalAttributes.length > 0 && /* @__PURE__ */ jsxs7("div", { className: "px-3 py-4", children: [
1125
- /* @__PURE__ */ jsxs7("div", { className: "flex items-center gap-x-3 px-3 pb-4", children: [
1126
- /* @__PURE__ */ jsx8("div", { className: "flex size-7 items-center justify-center rounded-md bg-ui-bg-base shadow-borders-base", children: /* @__PURE__ */ jsx8("div", { className: "flex size-6 items-center justify-center rounded-[4px] bg-ui-bg-component", children: /* @__PURE__ */ jsx8(DropCap, { className: "text-ui-fg-subtle" }) }) }),
1127
- /* @__PURE__ */ jsxs7("div", { children: [
1128
- /* @__PURE__ */ jsx8(Text2, { size: "small", weight: "plus", leading: "compact", children: t("products.edit.informationalAttributes.header") }),
1129
- /* @__PURE__ */ jsx8(Text2, { size: "xsmall", leading: "compact", className: "text-ui-fg-subtle", children: t("products.edit.informationalAttributes.description") })
1130
- ] })
1131
- ] }),
1132
- /* @__PURE__ */ jsx8("div", { className: "divide-y overflow-hidden rounded-lg border", children: informationalAttributes.map((attribute) => /* @__PURE__ */ jsx8(
1133
- SectionRow,
1134
- {
1135
- title: attribute.name,
1136
- actions: /* @__PURE__ */ jsx8(InformationalAttributeRowActions, { productId: product.id, attribute }),
1137
- className: "bg-ui-bg-component p-3 [&>p]:gap-x-1",
1138
- value: attribute.values?.length ? attribute.values.map((v) => v.value).join(", ") : "-",
1139
- tooltip: attribute.is_required ? t("products.edit.attributes.required") : void 0
1140
- },
1141
- `${attribute.attribute_id}-${attribute.attribute_source}`
1142
- )) })
1143
- ] })
1144
- ] });
1145
- };
1146
-
1147
- // src/pages/products/[id]/_components/product-shipping-profile-section/product-shipping-profile-section.tsx
1148
- import { PencilSquare as PencilSquare8, ShoppingBag } from "@medusajs/icons";
1149
- import { Container as Container8, Heading as Heading7 } from "@medusajs/ui";
1150
- import { useTranslation as useTranslation8 } from "react-i18next";
1151
- import { jsx as jsx9, jsxs as jsxs8 } from "react/jsx-runtime";
1152
- var ProductShippingProfileSection = () => {
1153
- const { product } = useProductDetailContext();
1154
- const { t } = useTranslation8();
1155
- const shippingProfile = product.shipping_profile;
1156
- return /* @__PURE__ */ jsxs8(Container8, { className: "p-0", children: [
1157
- /* @__PURE__ */ jsxs8("div", { className: "flex items-center justify-between px-6 py-4", children: [
1158
- /* @__PURE__ */ jsx9(Heading7, { level: "h2", children: t("products.shippingProfile.header") }),
1159
- /* @__PURE__ */ jsx9(
1160
- ActionMenu,
1161
- {
1162
- groups: [
1163
- {
1164
- actions: [
1165
- {
1166
- label: t("actions.edit"),
1167
- to: "shipping-profile",
1168
- icon: /* @__PURE__ */ jsx9(PencilSquare8, {})
1169
- }
1170
- ]
1171
- }
1172
- ]
1173
- }
1174
- )
1175
- ] }),
1176
- shippingProfile && /* @__PURE__ */ jsx9(
1177
- SidebarLink,
1178
- {
1179
- to: `/settings/locations/shipping-profiles/${shippingProfile.id}`,
1180
- labelKey: shippingProfile.name,
1181
- descriptionKey: shippingProfile.type,
1182
- icon: /* @__PURE__ */ jsx9(ShoppingBag, {})
1183
- }
1184
- )
1185
- ] });
1186
- };
1187
-
1188
- // src/pages/products/[id]/_components/product-sales-channel-section/product-sales-channel-section.tsx
1189
- import { Channels, PencilSquare as PencilSquare9 } from "@medusajs/icons";
1190
- import { Container as Container9, Heading as Heading8, Text as Text3, Tooltip as Tooltip4 } from "@medusajs/ui";
1191
- import { Trans, useTranslation as useTranslation9 } from "react-i18next";
1192
- import { jsx as jsx10, jsxs as jsxs9 } from "react/jsx-runtime";
1193
- var ProductSalesChannelSection = () => {
1194
- const { product } = useProductDetailContext();
1195
- const { count } = useSalesChannels();
1196
- const { t } = useTranslation9();
1197
- const availableInSalesChannels = product.sales_channels?.map((sc) => ({
1198
- id: sc.id,
1199
- name: sc.name
1200
- })) ?? [];
1201
- const firstChannels = availableInSalesChannels.slice(0, 3);
1202
- const restChannels = availableInSalesChannels.slice(3);
1203
- return /* @__PURE__ */ jsxs9(Container9, { className: "flex flex-col gap-y-4 px-6 py-4", children: [
1204
- /* @__PURE__ */ jsxs9("div", { className: "flex items-center justify-between", children: [
1205
- /* @__PURE__ */ jsx10(Heading8, { level: "h2", children: t("fields.sales_channels") }),
1206
- /* @__PURE__ */ jsx10(
1207
- ActionMenu,
1208
- {
1209
- groups: [
1210
- {
1211
- actions: [
1212
- {
1213
- label: t("actions.edit"),
1214
- to: "sales-channels",
1215
- icon: /* @__PURE__ */ jsx10(PencilSquare9, {})
1216
- }
1217
- ]
1218
- }
1219
- ]
1220
- }
1221
- )
1222
- ] }),
1223
- /* @__PURE__ */ jsxs9("div", { className: "grid grid-cols-[28px_1fr] items-center gap-x-3", children: [
1224
- /* @__PURE__ */ jsx10("div", { className: "bg-ui-bg-base shadow-borders-base flex size-7 items-center justify-center rounded-md", children: /* @__PURE__ */ jsx10("div", { className: "bg-ui-bg-component flex size-6 items-center justify-center rounded-[4px]", children: /* @__PURE__ */ jsx10(Channels, { className: "text-ui-fg-subtle" }) }) }),
1225
- availableInSalesChannels.length > 0 ? /* @__PURE__ */ jsxs9("div", { className: "flex items-center gap-x-1", children: [
1226
- /* @__PURE__ */ jsx10(Text3, { size: "small", leading: "compact", children: firstChannels.map((sc) => sc.name).join(", ") }),
1227
- restChannels.length > 0 && /* @__PURE__ */ jsx10(
1228
- Tooltip4,
1229
- {
1230
- content: /* @__PURE__ */ jsx10("ul", { children: restChannels.map((sc) => /* @__PURE__ */ jsx10("li", { children: sc.name }, sc.id)) }),
1231
- children: /* @__PURE__ */ jsx10(
1232
- Text3,
1233
- {
1234
- size: "small",
1235
- leading: "compact",
1236
- className: "text-ui-fg-subtle",
1237
- children: `+${restChannels.length}`
1238
- }
1239
- )
1240
- }
1241
- )
1242
- ] }) : /* @__PURE__ */ jsx10(Text3, { size: "small", leading: "compact", className: "text-ui-fg-subtle", children: t("products.noSalesChannels") })
1243
- ] }),
1244
- /* @__PURE__ */ jsx10("div", { children: /* @__PURE__ */ jsx10(Text3, { className: "text-ui-fg-subtle", size: "small", leading: "compact", children: /* @__PURE__ */ jsx10(
1245
- Trans,
1246
- {
1247
- i18nKey: "sales_channels.availableIn",
1248
- values: {
1249
- x: availableInSalesChannels.length,
1250
- y: count ?? 0
1251
- },
1252
- components: [
1253
- /* @__PURE__ */ jsx10(
1254
- "span",
1255
- {
1256
- className: "text-ui-fg-base txt-compact-medium-plus"
1257
- },
1258
- "x"
1259
- ),
1260
- /* @__PURE__ */ jsx10(
1261
- "span",
1262
- {
1263
- className: "text-ui-fg-base txt-compact-medium-plus"
1264
- },
1265
- "y"
1266
- )
1267
- ]
1268
- }
1269
- ) }) })
1270
- ] });
1271
- };
1272
-
1273
- // src/pages/products/[id]/product-detail-page.tsx
1274
- import { jsx as jsx11, jsxs as jsxs10 } from "react/jsx-runtime";
1275
- var Root = ({ children }) => {
1276
- const { id } = useParams2();
1277
- const { product, isLoading, isError, error } = useProduct(id);
1278
- if (isLoading || !product) {
1279
- return /* @__PURE__ */ jsx11(TwoColumnPageSkeleton, { mainSections: 4, sidebarSections: 3 });
1280
- }
1281
- if (isError) {
1282
- throw error;
1283
- }
1284
- return /* @__PURE__ */ jsx11(ProductDetailProvider, { product, children: Children.count(children) > 0 ? children : /* @__PURE__ */ jsxs10(TwoColumnPage, { data: product, children: [
1285
- /* @__PURE__ */ jsxs10(TwoColumnPage.Main, { children: [
1286
- /* @__PURE__ */ jsx11(ProductGeneralSection, {}),
1287
- /* @__PURE__ */ jsx11(ProductMediaSection, {}),
1288
- /* @__PURE__ */ jsx11(ProductVariantSection, {})
1289
- ] }),
1290
- /* @__PURE__ */ jsxs10(TwoColumnPage.Sidebar, { children: [
1291
- /* @__PURE__ */ jsx11(ProductOrganizationSection, {}),
1292
- /* @__PURE__ */ jsx11(ProductAdditionalAttributesSection, { product })
1293
- ] })
1294
- ] }) });
1295
- };
1296
- var ProductDetailPage = Object.assign(Root, {
1297
- Main: TwoColumnPage.Main,
1298
- Sidebar: TwoColumnPage.Sidebar,
1299
- MainGeneralSection: ProductGeneralSection,
1300
- MainMediaSection: ProductMediaSection,
1301
- MainOptionSection: ProductOptionSection,
1302
- MainVariantSection: ProductVariantSection,
1303
- MainAttributeSection: ProductAttributeSection,
1304
- MainAdditionalAttributeSection: ProductAdditionalAttributesSection,
1305
- SidebarShippingProfileSection: ProductShippingProfileSection,
1306
- SidebarOrganizationSection: ProductOrganizationSection,
1307
- SidebarSalesChannelSection: ProductSalesChannelSection,
1308
- useContext: useProductDetailContext
1309
- });
1310
- export {
1311
- PRODUCT_DETAIL_FIELDS,
1312
- ProductDetailPage,
1313
- loader
1314
- };