@unchainedshop/admin-ui 4.8.29 → 5.0.0-alpha.10
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 +136 -16
- package/dist/chunk-3L6EZQ6P.js +135 -0
- package/dist/chunk-5WPFHQZN.js +388 -0
- package/dist/chunk-AE5LOZGH.js +3350 -0
- package/dist/{chunk-JAVEZY3Q.js → chunk-AOR2B5N5.js} +14 -5
- package/dist/chunk-DTJ2DTKS.js +314 -0
- package/dist/{chunk-2RTX42IE.js → chunk-E7BVYJ3R.js} +2 -2
- package/dist/{chunk-XHOCXPD5.js → chunk-F6LBNV3H.js} +1 -1
- package/dist/chunk-FDHXLNZQ.js +44 -0
- package/dist/{chunk-MSPWYMDY.js → chunk-H6G4UTZ5.js} +83 -48
- package/dist/{chunk-XJBPMIC4.js → chunk-HERLM47Z.js} +81 -56
- package/dist/chunk-HTPSKUXQ.js +22476 -0
- package/dist/{chunk-7PPOGX7R.js → chunk-I64TXIE7.js} +48 -11
- package/dist/{chunk-QNLGYFV7.js → chunk-IYKPRAWC.js} +4 -0
- package/dist/chunk-J23QSWDL.js +8 -0
- package/dist/{chunk-SRAAKMWY.js → chunk-JED6SHHG.js} +4 -2
- package/dist/chunk-KRIRF7F6.js +76 -0
- package/dist/chunk-OTXM2UCD.js +19 -0
- package/dist/chunk-QHR23GVH.js +1099 -0
- package/dist/chunk-VBO377AY.js +14 -0
- package/dist/{chunk-4VNS5WPM.js → chunk-WPLOTFGW.js} +7 -8
- package/dist/components/ui/form/ChoicesField.d.ts.map +1 -1
- package/dist/components/ui/form/index.d.ts +1 -0
- package/dist/components/ui/form/index.d.ts.map +1 -1
- package/dist/components/ui/index.d.ts +5 -0
- package/dist/components/ui/index.d.ts.map +1 -1
- package/dist/form.js +1792 -27496
- package/dist/gql/operation-types.d.ts +20 -0
- package/dist/gql/operation-types.d.ts.map +1 -1
- package/dist/gql/schema-types.d.ts +1 -0
- package/dist/gql/schema-types.d.ts.map +1 -1
- package/dist/hooks.js +13 -6
- package/dist/modal.js +11 -78
- package/dist/modules/Auth/AuthContext.d.ts +9 -0
- package/dist/modules/Auth/AuthContext.d.ts.map +1 -0
- package/dist/modules/Auth/useAuth.d.ts +6 -0
- package/dist/modules/Auth/useAuth.d.ts.map +1 -0
- package/dist/modules/accounts.js +1 -1
- package/dist/modules/assortment.js +3 -3
- package/dist/modules/common/components/AppContext.d.ts.map +1 -1
- package/dist/modules/common/components/FormWrapper.d.ts.map +1 -1
- package/dist/modules/common/components/LocaleWrapper.d.ts +7 -0
- package/dist/modules/common/components/LocaleWrapper.d.ts.map +1 -0
- package/dist/modules/common/components/MediaAvatar.d.ts +6 -0
- package/dist/modules/common/components/MediaAvatar.d.ts.map +1 -0
- package/dist/modules/common/components/SelectOptions.d.ts +17 -0
- package/dist/modules/common/components/SelectOptions.d.ts.map +1 -0
- package/dist/modules/common/components/Table.d.ts +25 -0
- package/dist/modules/common/components/Table.d.ts.map +1 -0
- package/dist/modules/common/components/TableCell.d.ts +12 -0
- package/dist/modules/common/components/TableCell.d.ts.map +1 -0
- package/dist/modules/common/components/TableRow.d.ts +10 -0
- package/dist/modules/common/components/TableRow.d.ts.map +1 -0
- package/dist/modules/common/components/ThemeWrapper.d.ts.map +1 -1
- package/dist/modules/common/utils/sharedContext.d.ts +9 -0
- package/dist/modules/common/utils/sharedContext.d.ts.map +1 -0
- package/dist/modules/country.js +1 -1
- package/dist/modules/currency.js +1 -1
- package/dist/modules/delivery-provider.js +1 -1
- package/dist/modules/enrollment.js +1 -1
- package/dist/modules/event.js +1 -1
- package/dist/modules/filter.js +1 -1
- package/dist/modules/forms/lib/FormContext.d.ts.map +1 -1
- package/dist/modules/language.js +1 -1
- package/dist/modules/modal/hooks/useModal.d.ts.map +1 -1
- package/dist/modules/modal/utils/ModalContext.d.ts.map +1 -1
- package/dist/modules/order.js +1 -1
- package/dist/modules/payment-providers.js +1 -1
- package/dist/modules/product-review.js +3 -3
- package/dist/modules/product.js +4748 -7
- package/dist/modules/quotation.js +1 -1
- package/dist/modules/token.js +2 -2
- package/dist/modules/warehousing-providers.js +1 -1
- package/dist/modules/work.js +6 -10
- package/dist/plugins.js +1 -1
- package/dist/providers.js +8 -5
- package/dist/sdk/hooks.d.ts +3 -0
- package/dist/sdk/hooks.d.ts.map +1 -1
- package/dist/shims/admin-ui-plugins.js +1 -1
- package/dist/shims/apollo-client-react.js +1 -1
- package/dist/shims/apollo-client.js +1 -1
- package/dist/shims/next-head.js +1 -1
- package/dist/shims/next-image.js +1 -1
- package/dist/shims/next-link.js +1 -1
- package/dist/shims/next-router.js +1 -1
- package/dist/shims/react-dom-client.js +1 -1
- package/dist/shims/react-dom.js +1 -1
- package/dist/shims/react-hook-form.js +1 -1
- package/dist/shims/react-intl.js +1 -1
- package/dist/shims/react-jsx-runtime.js +1 -1
- package/dist/shims/react-toastify.js +1 -1
- package/dist/shims/react.js +1 -1
- package/dist/theme.js +1 -1
- package/dist/ui.js +3397 -3055
- package/out/403/index.html +2 -2
- package/out/404/index.html +2 -2
- package/out/404.html +2 -2
- package/out/423/index.html +2 -2
- package/out/500/index.html +2 -2
- package/out/_next/static/chunks/0-2b37ubdpy0o.js +7 -0
- package/out/_next/static/chunks/012cafv-4m7rj.js +807 -0
- package/out/_next/static/chunks/02dnhll1bce87.js +46 -0
- package/out/_next/static/chunks/02ptvddfjlsxb.js +1 -0
- package/out/_next/static/chunks/03ebenjfvoj8n.js +1 -0
- package/out/_next/static/chunks/03r347235l6c4.js +7 -0
- package/out/_next/static/chunks/05au-xyt__0f2.js +3 -0
- package/out/_next/static/chunks/05nn5xr3ufcsh.js +1 -0
- package/out/_next/static/chunks/05o_q7jg8wucs.js +44 -0
- package/out/_next/static/chunks/05scroolqe8fu.js +234 -0
- package/out/_next/static/chunks/072qxdqjtqvn9.js +11 -0
- package/out/_next/static/chunks/0752goe9_9g2s.js +110 -0
- package/out/_next/static/chunks/07e-sk6v9u-qh.js +807 -0
- package/out/_next/static/chunks/07evy5u8ldd1y.js +50 -0
- package/out/_next/static/chunks/083ylavob4a8d.js +3 -0
- package/out/_next/static/chunks/08jrw03_vxllg.js +54 -0
- package/out/_next/static/chunks/08pag0k09j2b3.js +807 -0
- package/out/_next/static/chunks/09n6h-_l73rez.js +13 -0
- package/out/_next/static/chunks/0_b5faks_mrvi.js +14 -0
- package/out/_next/static/chunks/0a_bg-ub3r2eo.js +60 -0
- package/out/_next/static/chunks/0aqxsjssb0dh9.js +21 -0
- package/out/_next/static/chunks/0aw4jxe6zcc0c.js +32 -0
- package/out/_next/static/chunks/0b0hrx3sbbs70.js +807 -0
- package/out/_next/static/chunks/0bg4_y1qh5y5h.js +47 -0
- package/out/_next/static/chunks/0bgz44wi1lidl.js +13 -0
- package/out/_next/static/chunks/0dcpvidzyamvk.js +100 -0
- package/out/_next/static/chunks/{19y4w6_d_qiou.js → 0dnh0kr83_tj0.js} +1 -1
- package/out/_next/static/chunks/0dxp17sbyy_dr.js +22 -0
- package/out/_next/static/chunks/0dxu94yin5gdn.js +35 -0
- package/out/_next/static/chunks/0e2c-jlh2q_eq.js +74 -0
- package/out/_next/static/chunks/0el7gr-83bm5j.js +3 -0
- package/out/_next/static/chunks/0f_ofo__wyqsp.js +22 -0
- package/out/_next/static/chunks/0gx9t6j5kx_ho.js +9 -0
- package/out/_next/static/chunks/0i9ymn9xxs0nx.js +18 -0
- package/out/_next/static/chunks/0iy11ws57hzzr.js +99 -0
- package/out/_next/static/chunks/0j8_uikfyrn1f.js +1 -0
- package/out/_next/static/chunks/0jeddko6bac8h.js +1 -0
- package/out/_next/static/chunks/0jzx7vxh13cpi.js +15 -0
- package/out/_next/static/chunks/0kody3217__os.js +16 -0
- package/out/_next/static/chunks/0kwo-m1-mo-s-.js +31 -0
- package/out/_next/static/chunks/0lp_pnq1t06sl.js +104 -0
- package/out/_next/static/chunks/0mez27zlo26ni.js +103 -0
- package/out/_next/static/chunks/0nj8vn3509oe-.js +9 -0
- package/out/_next/static/chunks/0np9pcbt6dmxe.js +25 -0
- package/out/_next/static/chunks/0o7k5vanq57ch.js +807 -0
- package/out/_next/static/chunks/0rqjr_lmrk4pz.js +5 -0
- package/out/_next/static/chunks/0swe0fkt4vyzn.js +136 -0
- package/out/_next/static/chunks/0u4st428hgv1v.js +27 -0
- package/out/_next/static/chunks/0u7--d8_-qyne.js +83 -0
- package/out/_next/static/chunks/0ubzi2s1spm4e.js +342 -0
- package/out/_next/static/chunks/0uecw_5mn0zvr.js +110 -0
- package/out/_next/static/chunks/0uxwblyj0htyb.js +1 -0
- package/out/_next/static/chunks/0uyhr7vs9ltp0.js +141 -0
- package/out/_next/static/chunks/0vr19nswhvt2-.js +14 -0
- package/out/_next/static/chunks/0vyvc19p87f_r.js +234 -0
- package/out/_next/static/chunks/0wznlnzc2xsbz.js +16 -0
- package/out/_next/static/chunks/0ycu-q8fcc8ta.js +1 -0
- package/out/_next/static/chunks/0ytserk6fuf71.js +175 -0
- package/out/_next/static/chunks/0zoum0jzrtu0s.js +145 -0
- package/out/_next/static/chunks/1-6s62fsl_z_7.js +126 -0
- package/out/_next/static/chunks/10b6et0qn-pa0.js +59 -0
- package/out/_next/static/chunks/13m7st62a61df.js +25 -0
- package/out/_next/static/chunks/13u_a5l2xngm4.js +1 -0
- package/out/_next/static/chunks/15vz50rks0o2-.js +238 -0
- package/out/_next/static/chunks/1647yxi4ymq0z.js +14 -0
- package/out/_next/static/chunks/16hd7xvkocqxs.js +807 -0
- package/out/_next/static/chunks/16t18hhd4ax36.js +2 -0
- package/out/_next/static/chunks/17wle25pg9jkp.js +11 -0
- package/out/_next/static/chunks/18juy_eauk94g.js +58 -0
- package/out/_next/static/chunks/19eflki8bmivb.js +81 -0
- package/out/_next/static/chunks/19eu5d-wm2hfr.js +23 -0
- package/out/_next/static/chunks/19izcjxrrapb3.js +9 -0
- package/out/_next/static/chunks/1_jbj-c1d2606.js +21 -0
- package/out/_next/static/chunks/1_pwqdjxb6oou.js +226 -0
- package/out/_next/static/chunks/1bftmuhck_-7b.js +1 -0
- package/out/_next/static/chunks/1bww_2og01jxh.js +807 -0
- package/out/_next/static/chunks/1c0cemuv_tf6i.js +16 -0
- package/out/_next/static/chunks/1c4a2qxtb3r4_.js +16 -0
- package/out/_next/static/chunks/1cjd95y23a9qx.js +1 -0
- package/out/_next/static/chunks/1cy-2yb5j5_9b.js +157 -0
- package/out/_next/static/chunks/1dkv555kaccbl.js +13 -0
- package/out/_next/static/chunks/1dt9_bzfioi8a.js +24 -0
- package/out/_next/static/chunks/1fd7ewfb7bi_g.js +234 -0
- package/out/_next/static/chunks/1gncrqljnmqjn.js +43 -0
- package/out/_next/static/chunks/1iewktf-9h_n8.js +15 -0
- package/out/_next/static/chunks/1l7p7exnzd0c2.js +12 -0
- package/out/_next/static/chunks/1nqu3ymv6lgev.js +3 -0
- package/out/_next/static/chunks/1o_8g-kpuqi9h.js +1 -0
- package/out/_next/static/chunks/1oent0-9-0rgb.js +20 -0
- package/out/_next/static/chunks/1og09fg689_nc.js +180 -0
- package/out/_next/static/chunks/1pj279k5ntty3.js +13 -0
- package/out/_next/static/chunks/1q_sewe1wbxsk.js +54 -0
- package/out/_next/static/chunks/1qvs4gd4rbhb2.js +15 -0
- package/out/_next/static/chunks/1rtv3c_klo0jk.js +1 -0
- package/out/_next/static/chunks/1sdqr2_r6o46f.js +16 -0
- package/out/_next/static/chunks/1vti949e9wuhz.js +15 -0
- package/out/_next/static/chunks/1x-yucftdml28.js +1 -0
- package/out/_next/static/chunks/1ylgjha1c0ua_.js +124 -0
- package/out/_next/static/chunks/1yp98n-n4gxwy.js +15 -0
- package/out/_next/static/chunks/1zcm_9oew7412.js +14 -0
- package/out/_next/static/chunks/2-e0d1qpp7rk9.js +14 -0
- package/out/_next/static/chunks/20ubrczdsehfm.js +879 -0
- package/out/_next/static/chunks/23m--gc-gjenm.js +3 -0
- package/out/_next/static/chunks/24-pobk4qjjvp.js +3 -0
- package/out/_next/static/chunks/24jptulqn322i.js +15 -0
- package/out/_next/static/chunks/24jyi7e2pq4gy.js +15 -0
- package/out/_next/static/chunks/26eux546aoag5.js +58 -0
- package/out/_next/static/chunks/270ua9t85a7ev.js +5 -0
- package/out/_next/static/chunks/28r_j2kquxrjn.js +807 -0
- package/out/_next/static/chunks/2_ccruvok3u8j.js +16 -0
- package/out/_next/static/chunks/2_ojfjgg8do9t.js +1 -0
- package/out/_next/static/chunks/2aj5aq_c0b4r_.js +13 -0
- package/out/_next/static/chunks/2ba3n9zx9e9q9.js +807 -0
- package/out/_next/static/chunks/2d-hxb31pgpn7.js +13 -0
- package/out/_next/static/chunks/2df2cqwidgpan.js +15 -0
- package/out/_next/static/chunks/2djnsowjy3p8y.js +1 -0
- package/out/_next/static/chunks/2dyj8q92_k5el.js +708 -0
- package/out/_next/static/chunks/2e0k9dt1emjfm.js +1 -0
- package/out/_next/static/chunks/2e3gba1n-yyuj.js +15 -0
- package/out/_next/static/chunks/2e_p1vqr0g_-_.js +7 -0
- package/out/_next/static/chunks/2e_te6sbs_5uw.js +1 -0
- package/out/_next/static/chunks/2f16josk9b_cl.js +8 -0
- package/out/_next/static/chunks/2fo2ki1egxbah.js +39 -0
- package/out/_next/static/chunks/2g8gzs8wpsofk.js +2 -0
- package/out/_next/static/chunks/2gh355-kh19zx.js +13 -0
- package/out/_next/static/chunks/2gr4t5xe0atdr.js +15 -0
- package/out/_next/static/chunks/2ib6fee-nqe-z.js +23 -0
- package/out/_next/static/chunks/2kjux30i3gg-c.js +5 -0
- package/out/_next/static/chunks/2ll_mqee86g8c.js +1 -0
- package/out/_next/static/chunks/2lx_iig9xewfj.js +52 -0
- package/out/_next/static/chunks/2lylr4-3tu1_t.js +15 -0
- package/out/_next/static/chunks/2n1v8ph2nt43w.js +17 -0
- package/out/_next/static/chunks/2o9hdz0gk1-s7.js +165 -0
- package/out/_next/static/chunks/2oadogfqpak51.js +1 -0
- package/out/_next/static/chunks/2oogwntgnu9rf.js +17 -0
- package/out/_next/static/chunks/2p4e3kh8sa8iq.js +13 -0
- package/out/_next/static/chunks/2q-mpau-4gsvd.js +1 -0
- package/out/_next/static/chunks/2rddaar-ns45d.js +116 -0
- package/out/_next/static/chunks/2s3qhuh87mu_w.js +126 -0
- package/out/_next/static/chunks/2s6u8274_jzk2.js +105 -0
- package/out/_next/static/chunks/2skfzjx2g9hkk.js +134 -0
- package/out/_next/static/chunks/2u6jwsqz0uhes.js +24 -0
- package/out/_next/static/chunks/2v4k4vpb2id7m.js +44 -0
- package/out/_next/static/chunks/2xctb084h1lyg.js +329 -0
- package/out/_next/static/chunks/2xgpwzpd6-tdb.js +234 -0
- package/out/_next/static/chunks/3-soz24u9483h.js +15 -0
- package/out/_next/static/chunks/30_ns6urg1dkn.js +41 -0
- package/out/_next/static/chunks/30nxkqu5mcga3.js +1 -0
- package/out/_next/static/chunks/{0gurfn3nhm859.js → 313i1x81q2xj1.js} +1 -1
- package/out/_next/static/chunks/31qwglme02a_r.js +807 -0
- package/out/_next/static/chunks/31sk60zzj3bc5.js +17 -0
- package/out/_next/static/chunks/325a7n__tfxy_.js +61 -0
- package/out/_next/static/chunks/33emlry70k-lv.js +2 -0
- package/out/_next/static/chunks/33v8la4hkia7j.js +1 -0
- package/out/_next/static/chunks/34ar-34flu6bu.js +43 -0
- package/out/_next/static/chunks/34z48lfdm9u0l.js +9 -0
- package/out/_next/static/chunks/351jscvbk_wb9.js +13 -0
- package/out/_next/static/chunks/357odtev0t245.js +59 -0
- package/out/_next/static/chunks/360g4b1clnt45.js +142 -0
- package/out/_next/static/chunks/360uyru28azf6.js +20 -0
- package/out/_next/static/chunks/366apf6d0xh2u.js +30 -0
- package/out/_next/static/chunks/36_zbuqpk5cpj.js +14 -0
- package/out/_next/static/chunks/36aqs7u7s-lb1.js +119 -0
- package/out/_next/static/chunks/36beon3q8orx2.js +1 -0
- package/out/_next/static/chunks/37703j9_zf5_h.js +13 -0
- package/out/_next/static/chunks/37rwzuocwsv_k.js +16 -0
- package/out/_next/static/chunks/37w6b3h04uc4c.js +19 -0
- package/out/_next/static/chunks/38ffn8gazqz8_.js +3 -0
- package/out/_next/static/chunks/38xse6_r51yqp.js +234 -0
- package/out/_next/static/chunks/39s8xbnm9f08v.js +14 -0
- package/out/_next/static/chunks/39x-p8r_sl0ng.js +15 -0
- package/out/_next/static/chunks/39zisxvmik0t_.js +34 -0
- package/out/_next/static/chunks/3_97tge0xvvon.js +11 -0
- package/out/_next/static/chunks/3aw-ri7876ngd.js +39 -0
- package/out/_next/static/chunks/3bv7gi3o6-41h.js +11 -0
- package/out/_next/static/chunks/3cdfuacs4_0d-.js +1 -0
- package/out/_next/static/chunks/3cxpx38ycu7u2.js +9 -0
- package/out/_next/static/chunks/3d1ofcqmlbg-5.js +52 -0
- package/out/_next/static/chunks/3e3i3qqkv_my7.js +15 -0
- package/out/_next/static/chunks/3ex71q3pp_ekc.js +247 -0
- package/out/_next/static/chunks/3g1lpkudwo8kg.js +1 -0
- package/out/_next/static/chunks/3h68t22714to5.js +3 -0
- package/out/_next/static/chunks/3jpzhwqgdnobq.js +103 -0
- package/out/_next/static/chunks/3jxuqt_2-j_uc.js +18 -0
- package/out/_next/static/chunks/3kqqv33l7ssn0.js +16 -0
- package/out/_next/static/chunks/3l-9xxd1i1sya.js +1 -0
- package/out/_next/static/chunks/3mancxzz8c7hl.js +51 -0
- package/out/_next/static/chunks/3mq2s9rfy78je.js +27 -0
- package/out/_next/static/chunks/3om1fkw-lrmng.js +1 -0
- package/out/_next/static/chunks/3oynij37wfjb2.js +119 -0
- package/out/_next/static/chunks/3pbyo5kkko3wh.js +1 -0
- package/out/_next/static/chunks/3pjja1obml896.js +15 -0
- package/out/_next/static/chunks/3qaiz-jwi7q2x.js +1 -0
- package/out/_next/static/chunks/3rh3nigvg06yu.js +337 -0
- package/out/_next/static/chunks/3rppjab6j3_k9.js +1 -0
- package/out/_next/static/chunks/3t_3vlnk1ntkb.js +95 -0
- package/out/_next/static/chunks/3tpo2ho54vtth.js +807 -0
- package/out/_next/static/chunks/3tqspv0ggt8j0.js +17 -0
- package/out/_next/static/chunks/3um54w4ca27n_.js +17 -0
- package/out/_next/static/chunks/3vet2a9q9rf2c.js +61 -0
- package/out/_next/static/chunks/3vjgbl76cgrmt.js +1 -0
- package/out/_next/static/chunks/3vz3gqmojh7sx.js +4 -0
- package/out/_next/static/chunks/3w2e5xa061qou.js +9 -0
- package/out/_next/static/chunks/3w9xrlkiztuwi.js +23 -0
- package/out/_next/static/chunks/3x4xfy_av3o0d.js +1 -0
- package/out/_next/static/chunks/3x9k13s5fam4j.js +22 -0
- package/out/_next/static/chunks/{3a7wm2331v13r.js → 3xmtbqm0gddn8.js} +3 -3
- package/out/_next/static/chunks/3z5uyt9mc9_fd.js +2 -0
- package/out/_next/static/chunks/3zlwp96x3hoy9.js +16 -0
- package/out/_next/static/chunks/3zr_sumh1g7il.js +22 -0
- package/out/_next/static/chunks/40jl8yfmy6tp6.js +234 -0
- package/out/_next/static/chunks/40xhwnc_48o73.js +297 -0
- package/out/_next/static/chunks/41-iysd7qkyg1.js +16 -0
- package/out/_next/static/chunks/4105a9rejv_p4.js +1 -0
- package/out/_next/static/chunks/41e2wlkp9_pvk.js +28 -0
- package/out/_next/static/chunks/41g7mv3yuhz6k.js +68 -0
- package/out/_next/static/chunks/43jyzccx6x0lw.js +1 -0
- package/out/_next/static/chunks/43vuxh3wdo567.js +10 -0
- package/out/_next/static/chunks/44daaafswok67.css +1 -0
- package/out/_next/static/chunks/452fv7r-tie6t.js +1 -0
- package/out/_next/static/chunks/{164wr2-2gfnlb.js → 457j51b69odrw.js} +1 -1
- package/out/_next/static/chunks/{turbopack-3pgmc-lv74ewz.js → turbopack-02vysfmmbped5.js} +1 -1
- package/out/_next/static/chunks/{turbopack-1o1rar8ouv6h9.js → turbopack-03fj2scz_09ul.js} +1 -1
- package/out/_next/static/chunks/turbopack-07wtduwtfqsl_.js +1 -0
- package/out/_next/static/chunks/turbopack-0_zihh5ueb_wj.js +1 -0
- package/out/_next/static/chunks/{turbopack-2yekm5ij2g-aw.js → turbopack-0b8-ww_z1vgvn.js} +1 -1
- package/out/_next/static/chunks/{turbopack-431y1sh-m_0mp.js → turbopack-0beql_u-wc_3e.js} +1 -1
- package/out/_next/static/chunks/{turbopack-3_mmmbs60vr14.js → turbopack-0dxdn-gyy3_qj.js} +1 -1
- package/out/_next/static/chunks/turbopack-0hqw81t-42tbj.js +1 -0
- package/out/_next/static/chunks/turbopack-0jsdrr-oq87lm.js +1 -0
- package/out/_next/static/chunks/turbopack-0jxa33q3ikjqg.js +1 -0
- package/out/_next/static/chunks/turbopack-0k9zths9zte_8.js +1 -0
- package/out/_next/static/chunks/turbopack-0pa42wgwsv141.js +1 -0
- package/out/_next/static/chunks/{turbopack-19vr9o5829d-f.js → turbopack-0te09_mp07k1x.js} +1 -1
- package/out/_next/static/chunks/turbopack-0xsxl45thi-35.js +1 -0
- package/out/_next/static/chunks/{turbopack-2fuk9oepxr5n0.js → turbopack-10-8q-q2zomxa.js} +1 -1
- package/out/_next/static/chunks/turbopack-142w-8owzbg7_.js +1 -0
- package/out/_next/static/chunks/{turbopack-23u97wxsuqiqb.js → turbopack-18tezl3vagvil.js} +1 -1
- package/out/_next/static/chunks/turbopack-1_1a-_v7vml72.js +1 -0
- package/out/_next/static/chunks/{turbopack-1zn9gl4fpayoc.js → turbopack-1_k-7s9lmntml.js} +1 -1
- package/out/_next/static/chunks/turbopack-1a47di2tss4e-.js +1 -0
- package/out/_next/static/chunks/turbopack-1c60gn7g-uduw.js +1 -0
- package/out/_next/static/chunks/turbopack-1e1yk3pkaodr5.js +1 -0
- package/out/_next/static/chunks/{turbopack-3v4nxmdavly34.js → turbopack-1jtk1c9w2axlk.js} +1 -1
- package/out/_next/static/chunks/turbopack-1k2ukl9u-7ovo.js +1 -0
- package/out/_next/static/chunks/{turbopack-39nctu3yv9iv4.js → turbopack-1lkz81ntcp1zv.js} +1 -1
- package/out/_next/static/chunks/{turbopack-2dk8ur1fvwxzj.js → turbopack-1pkw_r5dvv20d.js} +1 -1
- package/out/_next/static/chunks/turbopack-1pu2s2k3szn0s.js +1 -0
- package/out/_next/static/chunks/turbopack-1rxz_6lqtls5b.js +1 -0
- package/out/_next/static/chunks/turbopack-1uf07pugrv1fy.js +1 -0
- package/out/_next/static/chunks/turbopack-1uobzdn2r7ebw.js +1 -0
- package/out/_next/static/chunks/{turbopack-1od_4a7nj02l4.js → turbopack-1wv610ktbtzka.js} +1 -1
- package/out/_next/static/chunks/{turbopack-3w26eu86co02z.js → turbopack-1wz4te1fj20zp.js} +1 -1
- package/out/_next/static/chunks/{turbopack-0s4b5r_1d8yqv.js → turbopack-1zi2ss8eiiyfx.js} +1 -1
- package/out/_next/static/chunks/turbopack-207p7bsc5wea7.js +1 -0
- package/out/_next/static/chunks/{turbopack-2ga09m38zacev.js → turbopack-21zngkzhonfcm.js} +1 -1
- package/out/_next/static/chunks/turbopack-23y20ll8n-nwk.js +1 -0
- package/out/_next/static/chunks/{turbopack-19e_bi5k2rqyy.js → turbopack-26wtylwa4_s95.js} +1 -1
- package/out/_next/static/chunks/turbopack-27l7xplqpifq6.js +1 -0
- package/out/_next/static/chunks/turbopack-285oyoobdo21x.js +1 -0
- package/out/_next/static/chunks/turbopack-28b0zyhf3uqaq.js +1 -0
- package/out/_next/static/chunks/{turbopack-0ga3wfg-oyyst.js → turbopack-28m_9eg3draop.js} +1 -1
- package/out/_next/static/chunks/{turbopack-23nr2ioaqw90j.js → turbopack-29h9fgcal-fng.js} +1 -1
- package/out/_next/static/chunks/turbopack-2a84kh6nmf_78.js +1 -0
- package/out/_next/static/chunks/turbopack-2b73dx1bsdg5f.js +1 -0
- package/out/_next/static/chunks/{turbopack-2u_328z53ed9p.js → turbopack-2bslf96g-y1vv.js} +1 -1
- package/out/_next/static/chunks/turbopack-2d-2wg8-_f9-v.js +1 -0
- package/out/_next/static/chunks/{turbopack-30qkgccwlkv7n.js → turbopack-2ez-mfb63qve0.js} +1 -1
- package/out/_next/static/chunks/{turbopack-0m3lvbvrn923g.js → turbopack-2g7u83j1wlswz.js} +1 -1
- package/out/_next/static/chunks/{turbopack-3uj40sz7i7jg0.js → turbopack-2m4gns1_64-7_.js} +1 -1
- package/out/_next/static/chunks/{turbopack-0anbjm4c1j4u4.js → turbopack-2n4ba44aafc4x.js} +1 -1
- package/out/_next/static/chunks/turbopack-2t3zb47_j-ahd.js +1 -0
- package/out/_next/static/chunks/{turbopack-2rz_y4ejrvafp.js → turbopack-2tf6rdek5zvm6.js} +1 -1
- package/out/_next/static/chunks/{turbopack-0a3j0ezn8okfg.js → turbopack-2vb0p2htqo4nd.js} +1 -1
- package/out/_next/static/chunks/{turbopack-0sihqflu4qpvw.js → turbopack-30-bi-9_7jd01.js} +1 -1
- package/out/_next/static/chunks/turbopack-32pjcar5xpn1o.js +1 -0
- package/out/_next/static/chunks/{turbopack-3cv3hgsoo_z1k.js → turbopack-3a3skasosq9-4.js} +1 -1
- package/out/_next/static/chunks/{turbopack-0w2rzh4i3j2og.js → turbopack-3d2rk8-5wcgrs.js} +1 -1
- package/out/_next/static/chunks/{turbopack-4166pmk5_y_4x.js → turbopack-3i91g2le3tkne.js} +1 -1
- package/out/_next/static/chunks/turbopack-3j4bdo8-ldea5.js +1 -0
- package/out/_next/static/chunks/{turbopack-2qbfd_-7v5dbo.js → turbopack-3m47jybfw85nc.js} +1 -1
- package/out/_next/static/chunks/{turbopack-24ylsu2au7hg1.js → turbopack-3yfksvslbm14s.js} +1 -1
- package/out/_next/static/chunks/{turbopack-21vayl2_q4r5u.js → turbopack-414roft8p92hp.js} +1 -1
- package/out/_next/static/chunks/{turbopack-1r_0o22d_puxo.js → turbopack-424slv1lqxh_5.js} +1 -1
- package/out/_next/static/chunks/turbopack-444yt6auyioxn.js +1 -0
- package/out/_next/static/{4-xf4wPkZc5rcBq3jUTDg → z5KrmhOz2mLscINN5EbUf}/_buildManifest.js +66 -62
- package/out/_offline/index.html +2 -2
- package/out/account/forgot-password/index.html +2 -2
- package/out/account/index.html +2 -2
- package/out/assortments/AssortmentDetailPage/index.html +2 -2
- package/out/assortments/index.html +2 -2
- package/out/assortments/new/index.html +2 -2
- package/out/copilot/index.html +2 -2
- package/out/country/CountryDetailPage/index.html +2 -2
- package/out/country/index.html +2 -2
- package/out/country/new/index.html +2 -2
- package/out/currency/CurrencyDetailPage/index.html +2 -2
- package/out/currency/index.html +2 -2
- package/out/currency/new/index.html +2 -2
- package/out/delivery-provider/DeliveryProviderDetailPage/index.html +2 -2
- package/out/delivery-provider/index.html +2 -2
- package/out/delivery-provider/new/index.html +2 -2
- package/out/enrollments/EnrollmentDetailPage/index.html +2 -2
- package/out/enrollments/index.html +2 -2
- package/out/events/EventDetailPage/index.html +2 -2
- package/out/events/index.html +2 -2
- package/out/exports/index.html +2 -2
- package/out/ext/[[...slug]]/index.html +11 -0
- package/out/external/index.html +2 -2
- package/out/filters/FilterDetailPage/index.html +2 -2
- package/out/filters/index.html +2 -2
- package/out/filters/new/index.html +2 -2
- package/out/index.html +2 -2
- package/out/install/index.html +2 -2
- package/out/language/LanguageDetailPage/index.html +2 -2
- package/out/language/index.html +2 -2
- package/out/language/new/index.html +2 -2
- package/out/log-in/index.html +2 -2
- package/out/orders/OrderDetailPage/index.html +2 -2
- package/out/orders/index.html +2 -2
- package/out/payment-provider/PaymentProviderDetailPage/index.html +2 -2
- package/out/payment-provider/index.html +2 -2
- package/out/payment-provider/new/index.html +2 -2
- package/out/products/ProductDetailPage/index.html +2 -2
- package/out/products/index.html +2 -2
- package/out/products/new/index.html +2 -2
- package/out/quotations/QuotationDetailPage/index.html +2 -2
- package/out/quotations/index.html +2 -2
- package/out/reset-password/index.html +2 -2
- package/out/sign-up/index.html +2 -2
- package/out/styleguide/index.html +2 -2
- package/out/tokens/TokenDetailPage/index.html +2 -2
- package/out/tokens/index.html +2 -2
- package/out/users/UserDetailPage/index.html +2 -2
- package/out/users/index.html +2 -2
- package/out/users/new/index.html +2 -2
- package/out/verify-email/index.html +2 -2
- package/out/warehousing-provider/WarehousingProviderDetailPage/index.html +2 -2
- package/out/warehousing-provider/index.html +2 -2
- package/out/warehousing-provider/new/index.html +2 -2
- package/out/works/WorkDetailPage/index.html +2 -2
- package/out/works/WorkQueueListView/index.html +2 -2
- package/out/works/index.html +2 -2
- package/out/works/management/index.html +2 -2
- package/package.json +130 -26
- package/src/modules/accounts/index.ts +34 -0
- package/src/modules/assortment/index.ts +29 -0
- package/src/modules/copilot/index.ts +4 -0
- package/src/modules/country/index.ts +5 -0
- package/src/modules/currency/index.ts +5 -0
- package/src/modules/delivery-provider/index.ts +7 -0
- package/src/modules/enrollment/index.ts +6 -0
- package/src/modules/event/index.ts +3 -0
- package/src/modules/filter/index.ts +13 -0
- package/src/modules/language/index.ts +5 -0
- package/src/modules/order/index.ts +8 -0
- package/src/modules/payment-providers/index.ts +7 -0
- package/src/modules/product/index.ts +49 -0
- package/src/modules/product-review/index.ts +6 -0
- package/src/modules/quotation/index.ts +6 -0
- package/src/modules/token/index.ts +3 -0
- package/src/modules/warehousing-providers/index.ts +7 -0
- package/src/modules/work/index.ts +7 -0
- package/src/sdk/README.md +226 -0
- package/src/sdk/form-entry.test.mjs +11 -0
- package/src/sdk/hooks.ts +15 -0
- package/src/sdk/modal.ts +6 -0
- package/src/sdk/plugin-build.mjs +97 -0
- package/src/sdk/plugin-build.test.mjs +46 -0
- package/src/sdk/plugin-runtime.cjs +66 -0
- package/src/sdk/plugin-runtime.d.mts +11 -0
- package/src/sdk/plugin-runtime.mjs +27 -0
- package/src/sdk/plugin-runtime.test.mjs +32 -0
- package/src/sdk/plugins.mjs +17 -0
- package/src/sdk/plugins.ts +105 -0
- package/src/sdk/providers.ts +4 -0
- package/src/sdk/shared-context.test.mjs +40 -0
- package/src/sdk/shims/admin-ui-plugins.ts +3 -0
- package/src/sdk/shims/apollo-client-react.ts +3 -0
- package/src/sdk/shims/apollo-client.ts +3 -0
- package/src/sdk/shims/host.ts +61 -0
- package/src/sdk/shims/next-head.ts +3 -0
- package/src/sdk/shims/next-image.ts +3 -0
- package/src/sdk/shims/next-link.ts +3 -0
- package/src/sdk/shims/next-router.ts +3 -0
- package/src/sdk/shims/react-dom-client.ts +3 -0
- package/src/sdk/shims/react-dom.ts +3 -0
- package/src/sdk/shims/react-hook-form.ts +3 -0
- package/src/sdk/shims/react-intl.ts +3 -0
- package/src/sdk/shims/react-jsx-runtime.ts +3 -0
- package/src/sdk/shims/react-toastify.ts +3 -0
- package/src/sdk/shims/react.ts +3 -0
- package/src/sdk/tailwind-preset.mjs +94 -0
- package/src/sdk/theme.ts +61 -0
- package/src/styles/globals.css +291 -0
- package/dist/chunk-F2TCVEQX.js +0 -514
- package/dist/chunk-KCN7DDPH.js +0 -1116
- package/dist/chunk-RORNAN2J.js +0 -12
- package/dist/chunk-RVG6IOFC.js +0 -11
- package/dist/chunk-YZGQJJCD.js +0 -37
- package/out/_next/static/chunks/0-mytn4v5bu5h.js +0 -12
- package/out/_next/static/chunks/0-uh133eqcz6n.js +0 -60
- package/out/_next/static/chunks/0060t3kg_i0lf.js +0 -10
- package/out/_next/static/chunks/0186bg0b60cid.js +0 -13
- package/out/_next/static/chunks/018n9pot9f5uf.js +0 -90
- package/out/_next/static/chunks/01h4ept18s-ns.js +0 -807
- package/out/_next/static/chunks/02cdoh48sex9m.js +0 -1
- package/out/_next/static/chunks/03-z1yl608b56.js +0 -807
- package/out/_next/static/chunks/030bzkeke0edz.js +0 -7
- package/out/_next/static/chunks/037vsiy28s6dg.js +0 -41
- package/out/_next/static/chunks/049clkw76lm67.js +0 -16
- package/out/_next/static/chunks/04bb4k67x398t.js +0 -1
- package/out/_next/static/chunks/057evs7qr5y-t.js +0 -17
- package/out/_next/static/chunks/05qpw6q8uiz3l.js +0 -15
- package/out/_next/static/chunks/062myzj-2ehu-.js +0 -52
- package/out/_next/static/chunks/06l-rqlf4bp81.js +0 -108
- package/out/_next/static/chunks/06tejx8u1_0kg.js +0 -1
- package/out/_next/static/chunks/07nffhr51vke6.js +0 -59
- package/out/_next/static/chunks/08tyybz20igty.js +0 -15
- package/out/_next/static/chunks/0989pcuje2j55.js +0 -66
- package/out/_next/static/chunks/0_02skyivjqh6.js +0 -14
- package/out/_next/static/chunks/0_ngi84ak813x.js +0 -288
- package/out/_next/static/chunks/0bc02hascgv7z.js +0 -1
- package/out/_next/static/chunks/0c9ruqj2wf3n6.js +0 -905
- package/out/_next/static/chunks/0cblqqpscyy7w.js +0 -12
- package/out/_next/static/chunks/0cotrfgh1n2cx.js +0 -346
- package/out/_next/static/chunks/0d6_opzy2p6ik.js +0 -807
- package/out/_next/static/chunks/0e2e0srgvkzk9.js +0 -144
- package/out/_next/static/chunks/0g6hr3dmen536.js +0 -7
- package/out/_next/static/chunks/0ht2wu-61vq9v.js +0 -807
- package/out/_next/static/chunks/0ibp5q64hnd88.js +0 -18
- package/out/_next/static/chunks/0ichlp5c67dko.js +0 -12
- package/out/_next/static/chunks/0iui_zfuxfa45.js +0 -12
- package/out/_next/static/chunks/0k6z6zl_zxqp7.js +0 -13
- package/out/_next/static/chunks/0kkky_8vhaeaz.js +0 -227
- package/out/_next/static/chunks/0lutmpv07icdg.js +0 -8
- package/out/_next/static/chunks/0mzh9-epgepi1.js +0 -119
- package/out/_next/static/chunks/0n0uzfbkfb7e5.js +0 -12
- package/out/_next/static/chunks/0nhczsa2mm354.js +0 -16
- package/out/_next/static/chunks/0pecsk3c09b19.js +0 -3
- package/out/_next/static/chunks/0prynyrvhm7ef.js +0 -2
- package/out/_next/static/chunks/0q-14a7j6afh3.js +0 -1
- package/out/_next/static/chunks/0razrbxeai797.js +0 -807
- package/out/_next/static/chunks/0ryqvctymlr3k.js +0 -12
- package/out/_next/static/chunks/0se09klbk8drd.js +0 -68
- package/out/_next/static/chunks/0sh5256hzmj3b.js +0 -14
- package/out/_next/static/chunks/0srpqs12m-bwy.js +0 -13
- package/out/_next/static/chunks/0ukyxgmnqos6o.js +0 -1
- package/out/_next/static/chunks/0uv4d5f9o8wu1.js +0 -10
- package/out/_next/static/chunks/0vls1lbu_rh78.js +0 -342
- package/out/_next/static/chunks/0vx_1vxljh4tn.js +0 -13
- package/out/_next/static/chunks/0vxe9bw7ffqy2.js +0 -15
- package/out/_next/static/chunks/0w0zigi7aws2m.js +0 -1
- package/out/_next/static/chunks/0w2zoz_fn_wha.js +0 -137
- package/out/_next/static/chunks/0xuevvy5i5d12.js +0 -138
- package/out/_next/static/chunks/0xxvsq70e4xn0.js +0 -1
- package/out/_next/static/chunks/0yxc1yy1eq4u3.js +0 -149
- package/out/_next/static/chunks/1-uz_5-063kh9.js +0 -188
- package/out/_next/static/chunks/10h7lznd10mmp.js +0 -384
- package/out/_next/static/chunks/10os1s66nimmi.js +0 -110
- package/out/_next/static/chunks/12_5-baf13q49.js +0 -195
- package/out/_next/static/chunks/12qzh85d5on4y.js +0 -44
- package/out/_next/static/chunks/12ukdi5bzlbeo.js +0 -596
- package/out/_next/static/chunks/1398hevtpl_69.js +0 -1
- package/out/_next/static/chunks/13qk8ukzu1snm.js +0 -288
- package/out/_next/static/chunks/16ey81skn09dz.js +0 -1
- package/out/_next/static/chunks/18kae_yjyhjwf.js +0 -16
- package/out/_next/static/chunks/1_quktgfhf40v.js +0 -31
- package/out/_next/static/chunks/1aegvtb5jv57q.js +0 -12
- package/out/_next/static/chunks/1cgxgd2cf8u3j.js +0 -157
- package/out/_next/static/chunks/1cp4-dvxowp4c.js +0 -24
- package/out/_next/static/chunks/1d951b6ed8oqn.js +0 -110
- package/out/_next/static/chunks/1d_puhcn8lg6q.js +0 -51
- package/out/_next/static/chunks/1drrou5kp4qdz.js +0 -1
- package/out/_next/static/chunks/1e4_28-3u5o85.js +0 -30
- package/out/_next/static/chunks/1f3mflnvp8_7-.js +0 -31
- package/out/_next/static/chunks/1f5-j4f3irx0j.js +0 -147
- package/out/_next/static/chunks/1fzbon-ih4_3j.js +0 -1
- package/out/_next/static/chunks/1g57y7cq7tjcb.js +0 -9
- package/out/_next/static/chunks/1g8f6jrb9cp9v.js +0 -13
- package/out/_next/static/chunks/1gksg35fivk0-.js +0 -224
- package/out/_next/static/chunks/1gy9ae4fpd6jm.js +0 -17
- package/out/_next/static/chunks/1hq9yt63076pk.js +0 -16
- package/out/_next/static/chunks/1ikm9qcx--k3u.js +0 -807
- package/out/_next/static/chunks/1izpxynqp99t4.js +0 -193
- package/out/_next/static/chunks/1j2ko85jp-5wy.js +0 -807
- package/out/_next/static/chunks/1k-cn_5ey1u62.js +0 -15
- package/out/_next/static/chunks/1k0mvn915uz76.js +0 -14
- package/out/_next/static/chunks/1l4snbkce_jb6.js +0 -15
- package/out/_next/static/chunks/1lbsdlf5h6ojc.js +0 -16
- package/out/_next/static/chunks/1mwvnv71bl7mc.js +0 -1
- package/out/_next/static/chunks/1n7i2rp59o9o8.js +0 -384
- package/out/_next/static/chunks/1pklei2ds10d2.js +0 -66
- package/out/_next/static/chunks/1pxor-3_vf3du.js +0 -31
- package/out/_next/static/chunks/1qp68765j1aiv.js +0 -61
- package/out/_next/static/chunks/1r-cvj3mpr-7x.js +0 -87
- package/out/_next/static/chunks/1sivy8bkkmwxl.js +0 -5
- package/out/_next/static/chunks/1vk6h4qps69vq.js +0 -12
- package/out/_next/static/chunks/1vx8_u7-f7q8u.js +0 -28
- package/out/_next/static/chunks/1weq9keqxiqpy.js +0 -73
- package/out/_next/static/chunks/1wvicoevgxhkk.js +0 -14
- package/out/_next/static/chunks/1ziicn0eb_yji.js +0 -16
- package/out/_next/static/chunks/1zza9faw4t3b_.js +0 -46
- package/out/_next/static/chunks/1zzpf1xbmchcj.js +0 -132
- package/out/_next/static/chunks/2-4ng9fxftmld.js +0 -1
- package/out/_next/static/chunks/201rx84kyo8ag.js +0 -1
- package/out/_next/static/chunks/20rtv8f0brb0n.js +0 -43
- package/out/_next/static/chunks/21a19t2pe0fpg.js +0 -81
- package/out/_next/static/chunks/21o2yfegozc0m.js +0 -16
- package/out/_next/static/chunks/22w2ovaffle-i.js +0 -21
- package/out/_next/static/chunks/234pfdqctlnyt.js +0 -100
- package/out/_next/static/chunks/25d8wr34sbm__.js +0 -15
- package/out/_next/static/chunks/275o3ly3svw4p.js +0 -1
- package/out/_next/static/chunks/28z1z7in8-kbg.js +0 -26
- package/out/_next/static/chunks/29w1exzy704_7.js +0 -8
- package/out/_next/static/chunks/2bb7696udjx6k.js +0 -44
- package/out/_next/static/chunks/2bm5aw8hqlgf2.js +0 -50
- package/out/_next/static/chunks/2c4vy8ofex0ti.js +0 -14
- package/out/_next/static/chunks/2c7gw8ronvu-c.js +0 -807
- package/out/_next/static/chunks/2cbr3ybo4xsrv.js +0 -43
- package/out/_next/static/chunks/2eh6ku1a1zbs4.js +0 -135
- package/out/_next/static/chunks/2fed4-6c0ghqp.js +0 -99
- package/out/_next/static/chunks/2g39exixp92yf.js +0 -13
- package/out/_next/static/chunks/2gil5igdermzh.js +0 -36
- package/out/_next/static/chunks/2hm0mbq0vtqmw.js +0 -5
- package/out/_next/static/chunks/2hvt_8j6jkd_n.js +0 -14
- package/out/_next/static/chunks/2i5uj5i4z-xu8.js +0 -188
- package/out/_next/static/chunks/2ismth22knujm.js +0 -1
- package/out/_next/static/chunks/2iuznbar_ttrh.js +0 -18
- package/out/_next/static/chunks/2j6cph79-th54.js +0 -7
- package/out/_next/static/chunks/2jln1kjysf99p.js +0 -1
- package/out/_next/static/chunks/2jtk4-i4e9lug.js +0 -1
- package/out/_next/static/chunks/2k020ab3luqev.js +0 -1
- package/out/_next/static/chunks/2kbieaechn8m8.js +0 -1
- package/out/_next/static/chunks/2lwxs_ly4bz1o.js +0 -12
- package/out/_next/static/chunks/2mr2k4sb6i021.js +0 -32
- package/out/_next/static/chunks/2na27-e8gs0-f.js +0 -171
- package/out/_next/static/chunks/2nn3_f04lnr0b.js +0 -807
- package/out/_next/static/chunks/2ocwu5vbc5r34.js +0 -73
- package/out/_next/static/chunks/2qprgjhjl8d4c.js +0 -807
- package/out/_next/static/chunks/2rtyphk0o1hbr.js +0 -5
- package/out/_next/static/chunks/2skxi0oqka3ef.js +0 -26
- package/out/_next/static/chunks/2sukt9l-1md8_.js +0 -25
- package/out/_next/static/chunks/2t3t6gm5vlg_0.js +0 -58
- package/out/_next/static/chunks/2vt52_i-6cdbh.js +0 -10
- package/out/_next/static/chunks/2w5y5xf0nriwx.js +0 -1
- package/out/_next/static/chunks/2we4fnghpvprw.js +0 -190
- package/out/_next/static/chunks/30g-s0ioynhjx.js +0 -224
- package/out/_next/static/chunks/31y7dx6ytab7h.js +0 -3
- package/out/_next/static/chunks/363ng2l8o_bee.js +0 -101
- package/out/_next/static/chunks/36jick0alh9oa.js +0 -50
- package/out/_next/static/chunks/36pa0vs0telmp.js +0 -1
- package/out/_next/static/chunks/36yth4lm03_j8.js +0 -1
- package/out/_next/static/chunks/37phwvegpccj0.js +0 -217
- package/out/_next/static/chunks/38b7m-s26ciug.js +0 -137
- package/out/_next/static/chunks/38ipj45w-tqay.js +0 -21
- package/out/_next/static/chunks/38pz7fmyf6ay0.js +0 -1
- package/out/_next/static/chunks/39634va9fx9s2.js +0 -13
- package/out/_next/static/chunks/3a0hqx7ohm5lh.js +0 -23
- package/out/_next/static/chunks/3dr_oa5hx41is.js +0 -14
- package/out/_next/static/chunks/3e7w6ko5psik7.js +0 -17
- package/out/_next/static/chunks/3ebh4y7h6y1vq.js +0 -58
- package/out/_next/static/chunks/3eow7lw1727kt.js +0 -13
- package/out/_next/static/chunks/3f1gb4_hyhtho.js +0 -20
- package/out/_next/static/chunks/3g4qj6_qh97q_.js +0 -12
- package/out/_next/static/chunks/3gfjdynb9mg8h.js +0 -23
- package/out/_next/static/chunks/3gx4smk7pb27x.js +0 -119
- package/out/_next/static/chunks/3jcf4ei6zgnca.js +0 -17
- package/out/_next/static/chunks/3kisw9hre44e5.js +0 -807
- package/out/_next/static/chunks/3mnt471ayfsvh.js +0 -22
- package/out/_next/static/chunks/3ondw3-zthjz5.js +0 -15
- package/out/_next/static/chunks/3opuxnw_w3yb5.js +0 -101
- package/out/_next/static/chunks/3oxv1fo564rrf.js +0 -142
- package/out/_next/static/chunks/3ra_41-fw410n.js +0 -14
- package/out/_next/static/chunks/3s22ovhmk-4h7.js +0 -1
- package/out/_next/static/chunks/3sktz8258so64.js +0 -2
- package/out/_next/static/chunks/3tq-bb0j1_lpu.js +0 -14
- package/out/_next/static/chunks/3v1dxn4rp-o3v.js +0 -315
- package/out/_next/static/chunks/3w_wwl_hd91od.js +0 -1
- package/out/_next/static/chunks/3ww_p-agyd9u-.js +0 -14
- package/out/_next/static/chunks/3wzzh45yillzb.js +0 -1
- package/out/_next/static/chunks/3xfj8_2nd5d_1.js +0 -1
- package/out/_next/static/chunks/3xhmfg-981n_5.js +0 -61
- package/out/_next/static/chunks/3yz34q3ulli7q.js +0 -12
- package/out/_next/static/chunks/3z_c5kpm-e1ty.js +0 -15
- package/out/_next/static/chunks/3zqfchpzqxd92.css +0 -1
- package/out/_next/static/chunks/3zs002htik_8l.js +0 -21
- package/out/_next/static/chunks/4079hjuumfmm2.js +0 -31
- package/out/_next/static/chunks/40922jbr_e5ug.js +0 -51
- package/out/_next/static/chunks/40zy6mxa-be0m.js +0 -1
- package/out/_next/static/chunks/41fbmiggueudh.js +0 -13
- package/out/_next/static/chunks/43e0fp97w800k.js +0 -13
- package/out/_next/static/chunks/43gv4x1sfyb5l.js +0 -9
- package/out/_next/static/chunks/44nj9c766dqvc.js +0 -807
- package/out/_next/static/chunks/44r51e87s4z_d.js +0 -8
- package/out/_next/static/chunks/458tg2eg5h8j5.js +0 -324
- package/out/_next/static/chunks/45cd4ypk94sw2.js +0 -807
- package/out/_next/static/chunks/turbopack-01866gjdddrxa.js +0 -1
- package/out/_next/static/chunks/turbopack-08ttg7vxsdnsj.js +0 -1
- package/out/_next/static/chunks/turbopack-0pmjdjcdx7cqp.js +0 -1
- package/out/_next/static/chunks/turbopack-0tc31uax4buqq.js +0 -1
- package/out/_next/static/chunks/turbopack-10ldzl5n31zl-.js +0 -1
- package/out/_next/static/chunks/turbopack-19i6-4a5o4fil.js +0 -1
- package/out/_next/static/chunks/turbopack-19yw5qwon7l57.js +0 -1
- package/out/_next/static/chunks/turbopack-1cx5i7_gdoz5k.js +0 -1
- package/out/_next/static/chunks/turbopack-1d-c7awe26kf5.js +0 -1
- package/out/_next/static/chunks/turbopack-1l1aen9tojmq4.js +0 -1
- package/out/_next/static/chunks/turbopack-1rmdtpi005n_6.js +0 -1
- package/out/_next/static/chunks/turbopack-1wx5785osz26z.js +0 -1
- package/out/_next/static/chunks/turbopack-28_dvdmt6lvhn.js +0 -1
- package/out/_next/static/chunks/turbopack-2bo7hmw4eirxu.js +0 -1
- package/out/_next/static/chunks/turbopack-2e_wy0ffi64id.js +0 -1
- package/out/_next/static/chunks/turbopack-2g2viapamsvwe.js +0 -1
- package/out/_next/static/chunks/turbopack-2pxtve7lryqre.js +0 -1
- package/out/_next/static/chunks/turbopack-2u0ls0liblo_9.js +0 -1
- package/out/_next/static/chunks/turbopack-2xfom16ggx1i3.js +0 -1
- package/out/_next/static/chunks/turbopack-2ycfwit0p-fkf.js +0 -1
- package/out/_next/static/chunks/turbopack-3-w-v8og1lok2.js +0 -1
- package/out/_next/static/chunks/turbopack-36bl9-rerhcfg.js +0 -1
- package/out/_next/static/chunks/turbopack-37a6lyjyz7fts.js +0 -1
- package/out/_next/static/chunks/turbopack-37lb9ujef-ujm.js +0 -1
- package/out/_next/static/chunks/turbopack-3_o3qz69ih0uu.js +0 -1
- package/out/_next/static/chunks/turbopack-3cv39r7v3s2gr.js +0 -1
- package/out/_next/static/chunks/turbopack-3vfm6fp92up6y.js +0 -1
- package/out/_next/static/chunks/turbopack-3vyi51cuxeowy.js +0 -1
- package/out/_next/static/chunks/turbopack-3zc0h1216mtm2.js +0 -1
- package/out/admin-ui-permissions.js +0 -129
- /package/out/_next/static/{4-xf4wPkZc5rcBq3jUTDg → z5KrmhOz2mLscINN5EbUf}/_clientMiddlewareManifest.js +0 -0
- /package/out/_next/static/{4-xf4wPkZc5rcBq3jUTDg → z5KrmhOz2mLscINN5EbUf}/_ssgManifest.js +0 -0
|
@@ -0,0 +1,708 @@
|
|
|
1
|
+
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,42929,10878,97057,95379,51628,e=>{"use strict";var t=e.i(91398),a=e.i(69322);e.i(51523);var s=e.i(19518),l=e.i(25705),i=e.i(50243),d=e.i(94330),r=e.i(43054),n=e.i(95336),o=e.i(16113),u=e.i(82191),c=e.i(31004),m=e.i(76929),p=e.i(27927),f=e.i(61113),x=e.i(49740),g=e.i(11056),h=e.i(42532),v=e.i(10785),b=e.i(1330),y=e.i(73356),j=e.i(50099),I=e.i(77035),w=e.i(56902),M=e.i(72264),P=e.i(56779),N=e.i(19051),_=e.i(11907),k=e.i(34948),$=e.i(41418),C=e.i(58971),S=e.i(91788),T=e.i(44112),q=e.i(5505),R=e.i(53296),A=e.i(59080),D=e.i(32171),V=e.i(1880);let E=A.gql`
|
|
2
|
+
fragment ProductAssignmentFragment on ProductVariationAssignment {
|
|
3
|
+
_id
|
|
4
|
+
vectors {
|
|
5
|
+
_id
|
|
6
|
+
option {
|
|
7
|
+
_id
|
|
8
|
+
value
|
|
9
|
+
texts {
|
|
10
|
+
_id
|
|
11
|
+
title
|
|
12
|
+
subtitle
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
variation {
|
|
16
|
+
_id
|
|
17
|
+
key
|
|
18
|
+
texts {
|
|
19
|
+
_id
|
|
20
|
+
locale
|
|
21
|
+
title
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
product {
|
|
26
|
+
_id
|
|
27
|
+
texts {
|
|
28
|
+
_id
|
|
29
|
+
title
|
|
30
|
+
slug
|
|
31
|
+
subtitle
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
`,O=A.gql`
|
|
36
|
+
query ProductAssignments($productId: ID, $slug: String) {
|
|
37
|
+
product(productId: $productId, slug: $slug) {
|
|
38
|
+
_id
|
|
39
|
+
... on ConfigurableProduct {
|
|
40
|
+
texts {
|
|
41
|
+
_id
|
|
42
|
+
subtitle
|
|
43
|
+
slug
|
|
44
|
+
title
|
|
45
|
+
}
|
|
46
|
+
variations {
|
|
47
|
+
_id
|
|
48
|
+
key
|
|
49
|
+
texts {
|
|
50
|
+
_id
|
|
51
|
+
title
|
|
52
|
+
}
|
|
53
|
+
options {
|
|
54
|
+
_id
|
|
55
|
+
value
|
|
56
|
+
texts {
|
|
57
|
+
_id
|
|
58
|
+
title
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
assignments(includeInactive: true) {
|
|
63
|
+
...ProductAssignmentFragment
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
${E}
|
|
69
|
+
`;var U=e.i(8918);let L=(e,t,a)=>{let s=e[a],l=[];return(s?.values.filter(e=>e.length).forEach(e=>{let a={};a[s.key]=e,t.length>0?t.forEach(e=>{l.push({...e,...a})}):l.push(a)}),e.length>a+1)?L(e,l,a+1):Array.from(new Set(l.map(e=>JSON.stringify(e)))).map(e=>JSON.parse(e))},F=({_id:e,texts:t})=>({value:e,label:t?.title});var Q=e.i(21623),B=e.i(24557),z=e.i(24994),K=e.i(2765),H=e.i(15971),W=e.i(6607),Z=e.i(76204);let G=A.gql`
|
|
70
|
+
mutation AddProductAssignment(
|
|
71
|
+
$proxyId: ID!
|
|
72
|
+
$productId: ID!
|
|
73
|
+
$vectors: [ProductAssignmentVectorInput!]!
|
|
74
|
+
) {
|
|
75
|
+
addProductAssignment(
|
|
76
|
+
proxyId: $proxyId
|
|
77
|
+
productId: $productId
|
|
78
|
+
vectors: $vectors
|
|
79
|
+
) {
|
|
80
|
+
_id
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
`,X=()=>{let[e]=(0,Z.useMutation)(G);return{addProductAssignment:async({productId:t,proxyId:a,vectors:s})=>e({variables:{productId:t,proxyId:a,vectors:s},refetchQueries:["ProductAssignments"]})}};var J=e.i(24112);let Y=A.gql`
|
|
84
|
+
mutation RemoveProductAssignment(
|
|
85
|
+
$proxyId: ID!
|
|
86
|
+
$vectors: [ProductAssignmentVectorInput!]!
|
|
87
|
+
) {
|
|
88
|
+
removeProductAssignment(proxyId: $proxyId, vectors: $vectors) {
|
|
89
|
+
_id
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
`;var ee=e.i(41158),et=e.i(57748),ea=e.i(98949),es=e.i(69211),el=e.i(16984),ei=e.i(21128);let ed={SimpleProduct:"SIMPLE_PRODUCT",BundleProduct:"BUNDLE_PRODUCT",PlanProduct:"PLAN_PRODUCT",ConfigurableProduct:"CONFIGURABLE_PRODUCT",TokenizedProduct:"TOKENIZED_PRODUCT"};e.s(["PRODUCT_TYPES",0,ed],10878);var er=e.i(38994);let en=function({proxyProduct:e,vectors:t,onSuccess:s,locale:l}){let{createProduct:i}=(0,er.default)(),{addProductAssignment:d}=X(),{formatMessage:r}=(0,a.useIntl)();return async({title:a,type:n})=>{let o=[{title:a,slug:a.toLowerCase().replace(/\s+/g,"-"),locale:l}],{data:u}=await i({product:{type:n||ed.SimpleProduct},texts:o}),c=u?.createProduct,m=c?._id;if(!m)throw Error(r({id:"product_creation_failed",defaultMessage:"Product creation failed"}));return await d({productId:m,proxyId:e?._id,vectors:t}),s?.(c),{success:!0}}};var eo=e.i(10685),eu=e.i(57561);let ec=({proxyProduct:e,vectors:l,onSuccess:i})=>{let{formatMessage:d}=(0,a.useIntl)(),{selectedLocale:r}=(0,eu.default)(),n=en({onSuccess:i,proxyProduct:e,vectors:l,locale:r}),{hasRole:o}=(0,C.default)(),u=(0,S.useMemo)(()=>l.map(({value:e})=>e),[l]),c=(0,S.useMemo)(()=>{let t=e?.texts?.title??"";return`${u.join("-")} ${t}`.trim()},[u,e]),m=async({title:e,type:t})=>{try{return await n({title:e,type:t}),{success:!0}}catch(e){return{success:!1,error:{message:e?.message}}}},p=d({id:"product-scaffolded-success",defaultMessage:"Product scaffolded successfully"}),f=(0,ea.default)({submit:m,successMessage:p,enableReinitialize:!0,initialValues:{title:c,type:s.IProductType.SimpleProduct}});return(0,t.jsxs)(es.default,{className:"mt-3 rounded-md",form:f,children:[(0,t.jsxs)("div",{className:"p-5 pb-7 sm:max-w-full flex flex-col gap-3",children:[(0,t.jsx)(el.default,{name:"title",id:"title",label:d({id:"name",defaultMessage:"Name"}),required:!0,className:"block w-full max-w-full rounded-md border-border-default text-sm focus:ring-focus-ring sm:text-sm"}),(0,t.jsx)(eo.default,{className:"mt-1 w-full",label:d({id:"type",defaultMessage:"Type"}),placeholder:d({id:"type",defaultMessage:"Type"}),required:!0,name:"type",options:Object.fromEntries(Object.entries(s.IProductType).map(([e,t])=>[t,e]))})]}),o(s.IRoleAction.ManageProducts)&&(0,t.jsx)("div",{className:"border-t border-t-border-subtle bg-surface-subtle p-5 text-right",children:(0,t.jsx)(ei.default,{label:d({id:"scaffold_product",defaultMessage:"Scaffold"})})})]})},em=({columns:e,variationProduct:l,product:i,loading:d,disabled:r,proxyId:n,columnKeys:o})=>{let{formatMessage:u}=(0,a.useIntl)(),[c,m]=(0,S.useState)(""),{addProductAssignment:p}=X(),{removeProductAssignment:f}=(()=>{let[e]=(0,Z.useMutation)(Y);return{removeProductAssignment:async({proxyId:t,vectors:a})=>e({variables:{proxyId:t,vectors:a},refetchQueries:["ProductAssignments"]})}})(),{hasRole:x}=(0,C.default)(),{setModal:g}=(0,W.default)(),{products:h}=(0,J.default)({queryString:c,limit:50,sort:[{key:"created",value:s.ISortDirection.Desc}]}),v=(0,S.useMemo)(()=>e.map((e,t)=>({key:o[t],value:e})).filter(({value:e})=>e),[e,o]),b=(0,S.useCallback)(async e=>{e&&"string"==typeof e&&await p({proxyId:n,productId:e,vectors:v})},[v,p,n]),y=(0,S.useCallback)(async()=>{await g((0,t.jsx)(H.default,{onCancelClick:async()=>g(""),message:u({id:"delete_product_assignment",defaultMessage:"This action might cause inconsistencies with other data that relates to it. Are you sure you want to delete this assignment? "}),onOkClick:async()=>{g(""),await f({proxyId:n,vectors:v})},okText:u({id:"delete_variation_assignment",defaultMessage:"Delete assignment"})}))},[n,v,u,g,f]),j=(0,S.useMemo)(()=>(0,K.default)(200)(m),[]),I=!l&&i?.variations?.length!==e?.length,w=(0,S.useMemo)(()=>h?.map(F).filter(({value:e})=>e!==n)||[],[h,n]),M=async()=>{await g((0,t.jsx)(ec,{proxyProduct:i,vectors:v,onSuccess:()=>{g(null)}}))};return(0,t.jsxs)(U.default.Row,{children:[e.map((e,a)=>(0,t.jsx)(U.default.Cell,{className:"font-medium",children:e},`${e}`)),(0,t.jsx)(U.default.Cell,{children:l?(0,t.jsx)("div",{className:"flex items-center",children:(0,t.jsx)(ee.default,{href:`/products?slug=${(0,V.default)(l)}`,children:(0,t.jsx)("span",{className:"text-green-700 dark:text-green-300 font-medium",children:l?.texts?.title})})}):I?(0,t.jsx)("div",{className:"mt-1 text-sm text-rose-600 italic",children:u({id:"assign_product_needs_variations",defaultMessage:"Please configure all variation options before assigning a product."})}):(0,t.jsx)("div",{className:"relative w-full",children:(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("div",{className:"flex-1",children:(0,t.jsx)(z.default,{name:"productId",placeholder:u({id:"search_product",defaultMessage:"Search product"}),isLoading:d,disabled:r,onChange:b,onSearch:j,options:w,className:"mt-1 w-full"})}),x(s.IRoleAction.ManageProducts)&&(0,t.jsx)(Q.default,{onClick:M,children:(0,t.jsx)(et.SparklesIcon,{className:"h-5 w-5"})})]})})}),(0,t.jsx)(U.default.Cell,{children:l&&l._id&&(0,t.jsx)(Q.default,{variant:"danger",size:"xs",rounded:"full",icon:(0,t.jsx)(B.TrashIcon,{className:"h-5 w-5"}),onClick:y})})]})};var ep=e.i(82078);let ef=({proxyId:e,disabled:s=!1})=>{let{formatMessage:l}=(0,a.useIntl)(),{product:i,loading:d}=(({productId:e=null,slug:t=null}={})=>{let a=(0,V.parseUniqueId)(t),{data:s,loading:l,error:i}=(0,D.useQuery)(O,{skip:!e&&!a,variables:{productId:e||a}});return{product:s?.product,loading:l,error:i}})({productId:e}),r=i&&i?.variations||[],n=i&&i.assignments||[],o=(0,S.useMemo)(()=>r.filter(({options:e})=>e.length).map(({key:e})=>e),[r]),u=(0,S.useMemo)(()=>r.map(({key:e,options:t})=>({values:t?.map(e=>e.value),key:e})),[r]),c=(0,S.useMemo)(()=>{let e=u.filter(({values:e})=>e?.length);return e.length>0?L(e,[],0):[]},[u]),m=(0,S.useMemo)(()=>n.map(e=>{let t={};return o.forEach(a=>{let s=e.vectors.find(e=>e.variation?.key===a);t[a]=s?.option?.value??""}),t}),[n,o]),p=(0,S.useMemo)(()=>{let e=[...c,...m],t=new Set;return e.filter(e=>{let a=Object.values(e).join("::");return!t.has(a)&&(t.add(a),!0)})},[c,m]),f=(0,S.useMemo)(()=>n.map(e=>{let t={};return e.vectors.forEach(e=>{e?.variation?.key&&e?.option?.value&&(t[e.variation.key]=e.option.value)}),{keys:t,product:e.product}}),[n]),x=(0,S.useMemo)(()=>p.map(e=>{let t=f.find(({keys:t})=>Object.entries(t).every(([t,a])=>e[t]===a));return{_id:Object.values(e).join("::"),product:t?.product,columns:Object.values(e),columnsText:Object.values(e)}}),[p,f]),g=(0,S.useMemo)(()=>r.length>0,[r]),h=(0,S.useMemo)(()=>r.some(e=>e.options&&e.options.length>0),[r]);return(0,t.jsxs)(q.default,{children:[(0,t.jsx)(ep.default,{title:l({id:"product_assignments_explanation_title",defaultMessage:"About Product Assignments"}),description:l({id:"product_assignments_explanation_text",defaultMessage:"Product assignments allow you to link specific products to each unique combination of variation options. For example, if you have a t-shirt with 'Size' and 'Color' variations, you can assign different product SKUs to each combination like 'Large + Red' or 'Small + Blue'. This is useful for managing inventory, pricing, and product details for each specific variant."})}),!g&&(0,t.jsxs)("div",{className:"text-center py-8",children:[(0,t.jsx)("div",{className:"inline-flex items-center justify-center w-16 h-16 rounded-full bg-gray-100 dark:bg-gray-800 mb-4",children:(0,t.jsx)(T.InformationCircleIcon,{className:"w-8 h-8 text-gray-400"})}),(0,t.jsx)("h3",{className:"text-lg font-medium text-text-primary mb-2",children:l({id:"no_variations_configured",defaultMessage:"No variations configured yet. Please add variations and their options in the Variations tab first."})})]}),g&&h&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{className:"mb-4",children:(0,t.jsx)(R.default,{messageKey:"assignment_matrix_help",defaultMessage:"Each row represents a unique combination of your product variations. Assign a specific product to each combination to create a complete product catalog."})}),(0,t.jsxs)(U.default,{children:[(0,t.jsxs)(U.default.Row,{children:[o.map(e=>(0,t.jsx)(U.default.Cell,{className:"font-semibold bg-gray-50 dark:bg-gray-800",children:r.find(t=>t.key===e)?.texts?.title||e},e)),(0,t.jsx)(U.default.Cell,{className:"font-semibold bg-gray-50 dark:bg-gray-800",children:l({id:"assigned_product_column_header",defaultMessage:"Assigned Product"})}),(0,t.jsx)(U.default.Cell,{className:"font-semibold bg-gray-50 dark:bg-gray-800",children:l({id:"actions_column_header",defaultMessage:"Actions"})})]}),x.length>0&&x.map(({_id:a,columns:l,product:r})=>(0,t.jsx)(em,{columns:l,disabled:s,loading:d,product:i,variationProduct:r,columnKeys:o,proxyId:e},a))]})]}),g&&!h&&(0,t.jsxs)("div",{className:"text-center py-8",children:[(0,t.jsx)("div",{className:"inline-flex items-center justify-center w-16 h-16 rounded-full bg-yellow-100 dark:bg-yellow-900/30 mb-4",children:(0,t.jsx)(T.InformationCircleIcon,{className:"w-8 h-8 text-yellow-600 dark:text-yellow-400"})}),(0,t.jsx)("h3",{className:"text-lg font-medium text-text-primary mb-2",children:l({id:"assign_product_needs_variations",defaultMessage:"Please configure all variation options before assigning a product."})}),(0,t.jsx)("p",{className:"text-sm text-gray-600 dark:text-gray-400",children:l({id:"assignment_matrix_help",defaultMessage:"Each row represents a unique combination of your product variations. Assign a specific product to each combination to create a complete product catalog."})})]})]})};var ex=e.i(60195),eg=e.i(1504);let eh=A.gql`
|
|
93
|
+
query ProductTokenization($productId: ID, $slug: String) {
|
|
94
|
+
product(productId: $productId, slug: $slug) {
|
|
95
|
+
_id
|
|
96
|
+
... on TokenizedProduct {
|
|
97
|
+
contractConfiguration {
|
|
98
|
+
tokenId
|
|
99
|
+
supply
|
|
100
|
+
}
|
|
101
|
+
contractStandard
|
|
102
|
+
contractAddress
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
`,ev=A.gql`
|
|
107
|
+
query SmartContractStandards {
|
|
108
|
+
smartContractStandards: __type(name: "SmartContractStandard") {
|
|
109
|
+
options: enumValues {
|
|
110
|
+
value: name
|
|
111
|
+
label: name
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
`,eb=A.gql`
|
|
116
|
+
mutation UpdateProductTokenization(
|
|
117
|
+
$productId: ID!
|
|
118
|
+
$tokenization: UpdateProductTokenizationInput!
|
|
119
|
+
) {
|
|
120
|
+
updateProductTokenization(
|
|
121
|
+
productId: $productId
|
|
122
|
+
tokenization: $tokenization
|
|
123
|
+
) {
|
|
124
|
+
_id
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
`,ey=({productId:e,disabled:l=!1})=>{let{formatMessage:i}=(0,a.useIntl)(),{hasRole:d}=(0,C.default)(),{smartContractStandards:r}=(()=>{let{data:e,loading:t,error:a}=(0,D.useQuery)(ev);return{smartContractStandards:e?.smartContractStandards?.options||[],loading:t,error:a}})(),{updateProductTokenization:n}=(()=>{let[e]=(0,Z.useMutation)(eb);return{updateProductTokenization:async({productId:t,tokenization:{contractAddress:a,contractStandard:s,tokenId:l,supply:i}})=>e({variables:{productId:t,tokenization:{contractAddress:a,contractStandard:s,tokenId:l,supply:parseInt(i,10)}},refetchQueries:["Product","Products"]})}})(),{product:o,loading:u}=(({productId:e=null,slug:t=null}={})=>{let a=(0,V.parseUniqueId)(t),{data:s,loading:l,error:i}=(0,D.useQuery)(eh,{skip:!e&&!t,variables:{productId:e||a}});return{product:s?.product,loading:l,error:i}})({productId:e}),c=async({contractAddress:t,contractStandard:a,tokenId:s,supply:l})=>(await n({productId:e,tokenization:{contractAddress:t,contractStandard:a,tokenId:s||"",supply:l}}),{success:!0}),m=i({id:"token_updated",defaultMessage:"Token update successfully!"}),p=(0,ea.default)({disabled:l,submit:c,successMessage:m,initialValues:{contractAddress:"",contractStandard:"",tokenId:"",supply:""}});return(0,S.useEffect)(()=>{u||p.api.setValues({contractAddress:o?.contractAddress||"",contractStandard:o?.contractStandard||"",tokenId:o?.contractConfiguration?.tokenId||"",supply:o?.contractConfiguration?.supply||""})},[u]),(0,t.jsx)(ex.default,{documentationLabel:i({id:"texts",defaultMessage:"Texts"}),className:"mt-2 lg:mt-5",documentation:(0,t.jsx)(a.FormattedMessage,{id:"tokenized_product_text_form_description",defaultMessage:"<b>Contract standards </b> <ol> \n <dt><b> ERC721 </b></dt> <dd> Buying multiple Products leads to multiple Tokens (make sure to set the tokenId to 0 to make it auto generate new id's) </dd>\n <dt> <b> ERC1155 </b></dt> <dd> Buying multiple Products leads to a new token with balance 3 of token with tokenId assigned </dd>\n <dt> <b> Contract address </b></dt> <dd> Address of a token on a given network </dd> </ol>",values:{ol:e=>(0,t.jsxs)("ol",{children:[e," "]}),dt:e=>(0,t.jsxs)("dt",{className:"bold",children:[e," "]}),dd:e=>(0,t.jsxs)("dd",{children:[e," "]}),b:e=>(0,t.jsxs)("b",{children:[e," "]})}}),children:(0,t.jsx)(q.default,{children:(0,t.jsxs)(es.default,{form:p,children:[(0,t.jsxs)("div",{className:"p-5 pb-7 sm:max-w-full flex flex-col gap-y-5",children:[(0,t.jsx)(eo.default,{className:"w-full",label:i({id:"contract-standard",defaultMessage:"Contract standard"}),placeholder:i({id:"contract-standard",defaultMessage:"Contract standard"}),required:!0,name:"contractStandard",options:(0,eg.default)(r,"label","value")}),(0,t.jsx)(el.default,{name:"contractAddress",id:"contractAddress",label:i({id:"contract-address-label",defaultMessage:"Contract Address"}),placeholder:i({id:"contract-address-label",defaultMessage:"Contract Address"}),required:!0,className:"block w-full max-w-full rounded-md border-border-default text-sm focus:ring-focus-ring sm:text-sm"}),(0,t.jsx)(el.default,{name:"supply",id:"supply",type:"number",label:i({id:"token-supply",defaultMessage:"Supply"}),placeholder:i({id:"token-supply",defaultMessage:"Supply"}),required:!0,className:"block w-full max-w-full rounded-md border-border-default text-sm focus:ring-focus-ring sm:text-sm"}),(0,t.jsx)(el.default,{name:"tokenId",id:"tokenId",label:i({id:"token-id-label",defaultMessage:"Token Serial Number"}),placeholder:i({id:"token-id-label",defaultMessage:"Token Serial Number"}),className:"block w-full max-w-full rounded-md border-border-default text-sm focus:ring-focus-ring sm:text-sm"})]}),d(s.IRoleAction.ManageProducts)&&(0,t.jsx)("div",{className:"space-y-6 border-t border-t-border-subtle bg-surface-subtle p-5 text-right",children:(0,t.jsx)(ei.default,{label:i({id:"update_token",defaultMessage:"Update token"})})})]})})})};var ej=e.i(31494),eI=e.i(83788),ew=e.i(13534),eM=e.i(70475);let eP=({id:e,selectedView:a="",disableAll:s=!1,...l})=>{if("texts"===a)return(0,t.jsx)(g.default,{children:(0,t.jsx)(v.default,{productId:e,disabled:s})});if("media"===a)return(0,t.jsx)(eI.default,{children:(0,t.jsx)(g.default,{children:(0,t.jsx)(b.default,{productId:e})})});if("commerce"===a)return(0,t.jsx)(h.default,{productId:e,disabled:s});if("supply"===a)return(0,t.jsx)(j.default,{productId:e,disabled:s});if("warehousing"===a)return(0,t.jsx)(w.default,{productId:e,disabled:s});if("fulfillment"===a)return(0,t.jsx)(M.default,{productId:e});if("variations"===a)return(0,t.jsx)(g.default,{children:(0,t.jsx)(I.default,{productId:e,disabled:s})});if("bundled_products"===a)return(0,t.jsx)(g.default,{children:(0,t.jsx)(_.default,{productId:e,disabled:s})});if("subscriptions"===a)return(0,t.jsx)(y.default,{productId:e,disabled:s});if("reviews"===a)return(0,t.jsx)(N.default,{productId:e});if("assignments"===a)return(0,t.jsx)(g.default,{children:(0,t.jsx)(ef,{proxyId:e,disabled:s})});if("token"===a)return(0,t.jsx)(ey,{productId:e,disabled:s});if("extended"===a)return(0,t.jsx)(ej.default,{data:l});if(a?.startsWith("plugin:")){let s=a.replace("plugin:","");return(0,t.jsx)(eM.default,{slot:"product:tabs",entityId:e,children:(a,l)=>l.component===s?(0,t.jsx)(a,{entityId:e}):null})}return(0,t.jsx)(g.default,{children:(0,t.jsx)(v.default,{productId:e})})};e.s(["default",0,({product:e,extendedData:g={}})=>{let{formatMessage:h}=(0,a.useIntl)(),{hasRole:v}=(0,C.default)(),{updateProduct:b}=(0,$.default)(),{shopInfo:y}=(0,eu.default)(),{getSlotPlugins:j}=(0,ew.usePlugins)(),{__typename:I}=e||{},w=[{id:"texts",title:h({id:"general_text",defaultMessage:"Text"}),Icon:(0,t.jsx)(l.DocumentTextIcon,{className:"h-5 w-5"})},{id:"media",title:h({id:"media",defaultMessage:"Media"}),Icon:(0,t.jsx)(i.FilmIcon,{className:"h-5 w-5"})},"ConfigurableProduct"!==I&&{id:"commerce",title:h({id:"commerce",defaultMessage:"Commerce"}),Icon:(0,t.jsx)(d.ShoppingBagIcon,{className:"h-5 w-5"})},"SimpleProduct"===I&&{id:"supply",title:h({id:"supply",defaultMessage:"Supply"}),Icon:(0,t.jsx)(r.ChartPieIcon,{className:"h-5 w-5"})},"SimpleProduct"===I&&{id:"warehousing",title:h({id:"warehousing",defaultMessage:"Warehousing"}),Icon:(0,t.jsx)(n.ArchiveBoxIcon,{className:"h-5 w-5"})},"SimpleProduct"===I&&{id:"fulfillment",title:h({id:"fulfillment",defaultMessage:"Fulfillment"}),Icon:(0,t.jsx)(x.TruckIcon,{className:"h-5 w-5"})},"ConfigurableProduct"===I&&{id:"variations",title:h({id:"variations",defaultMessage:"Variations"}),Icon:(0,t.jsx)(o.SwatchIcon,{className:"h-5 w-5"})},"BundleProduct"===I&&{id:"bundled_products",title:h({id:"bundled_items",defaultMessage:"Bundled items"}),Icon:(0,t.jsx)(u.PresentationChartLineIcon,{className:"h-5 w-5"})},"PlanProduct"===I&&{id:"subscriptions",title:h({id:"subscriptions",defaultMessage:"Subscriptions"}),Icon:(0,t.jsx)(c.UsersIcon,{className:"h-5 w-5"})},"ConfigurableProduct"===I&&{id:"assignments",title:h({id:"assignments",defaultMessage:"Assignments"}),Icon:(0,t.jsx)(p.LinkIcon,{className:"h-5 w-5"})},"TokenizedProduct"===I&&{id:"token",title:h({id:"token",defaultMessage:"Token"}),Icon:(0,t.jsx)(p.LinkIcon,{className:"h-5 w-5"})},{id:"reviews",title:h({id:"reviews",defaultMessage:"Reviews"}),Icon:(0,t.jsx)(f.StarIcon,{className:"h-5 w-5"})},null!==g&&{id:"extended",title:h({id:"extended-fields",defaultMessage:"Extended"}),Icon:(0,t.jsx)(m.PuzzlePieceIcon,{className:"h-5 w-5"})}].filter(e=>e),M=j("product:tabs").map(({config:e})=>({id:`plugin:${e.component}`,title:e.label,Icon:(0,t.jsx)(m.PuzzlePieceIcon,{className:"h-5 w-5"})}));w.push(...M);let N=async({tags:t})=>(await b({productId:e?._id,product:{tags:t}}),!0);return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{className:"mt-5 flex flex-wrap items-center justify-between gap-10",children:(0,t.jsx)(k.default,{defaultValue:e?.tags,onSubmit:N,enableEdit:v(s.IRoleAction.ManageProducts),availableTagOptions:y?.adminUiConfig?.productTags.filter(t=>!(e?.tags||[])?.includes(t)).map(e=>({value:e,label:e}))})}),(0,t.jsx)(P.default,{tabItems:w,defaultTab:"texts",children:(0,t.jsx)(eP,{disableAll:e?.status===s.IProductStatus.Deleted,id:e?._id,...g})})]})}],42929);var eN=e.i(87284);e.s(["default",0,({media:e=[],onEditMedia:a})=>(0,t.jsx)("div",{className:"my-5",children:(0,t.jsx)("div",{className:"flex gap-3 overflow-x-auto",children:e.map(e=>(0,t.jsx)("div",{className:"relative flex-shrink-0 group",children:(0,t.jsx)("div",{className:"w-16 h-16 bg-surface-raised rounded-lg overflow-hidden cursor-pointer border border-border-subtle",onClick:()=>{var t;return t=e._id,void(a&&a(t))},children:(0,t.jsx)(eN.default,{src:e?.file?.url,alt:e.texts?.[0]?.title||e?.file?.url,width:128,height:128,className:"w-full h-full object-cover"})})},e._id))})})],97057);var e_=e.i(62199);let ek=A.gql`
|
|
128
|
+
mutation PublishProduct($productId: ID!) {
|
|
129
|
+
publishProduct(productId: $productId) {
|
|
130
|
+
...ProductDetailFragment
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
${e_.default}
|
|
134
|
+
`;e.s(["default",0,()=>{let[e]=(0,Z.useMutation)(ek);return{publishProduct:async({productId:t})=>e({variables:{productId:t},refetchQueries:["Product","ShopStatus"],awaitRefetchQueries:!0})}}],95379);let e$=A.gql`
|
|
135
|
+
mutation UnpublishProduct($productId: ID!) {
|
|
136
|
+
unpublishProduct(productId: $productId) {
|
|
137
|
+
...ProductDetailFragment
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
${e_.default}
|
|
141
|
+
`;e.s(["default",0,()=>{let[e]=(0,Z.useMutation)(e$);return{unPublishProduct:async({productId:t})=>e({variables:{productId:t},refetchQueries:["Product","ShopStatus"],awaitRefetchQueries:!0})}}],51628)},88604,e=>{"use strict";var t=e.i(59080),a=e.i(76204);let s=t.gql`
|
|
142
|
+
mutation RemoveProduct($productId: ID!) {
|
|
143
|
+
removeProduct(productId: $productId) {
|
|
144
|
+
_id
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
`;e.s(["default",0,()=>{let[e]=(0,a.useMutation)(s);return{removeProduct:async({productId:t})=>e({variables:{productId:t},refetchQueries:["Products","ShopStatus","ShopInfo"]})}}])},41418,e=>{"use strict";var t=e.i(59080),a=e.i(76204),s=e.i(62199);let l=t.gql`
|
|
148
|
+
mutation UpdateProduct($productId: ID!, $product: UpdateProductInput!) {
|
|
149
|
+
updateProduct(productId: $productId, product: $product) {
|
|
150
|
+
...ProductDetailFragment
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
${s.default}
|
|
154
|
+
`;e.s(["default",0,()=>{let[e]=(0,a.useMutation)(l);return{updateProduct:async({productId:t,product:{tags:a,sequence:s,meta:l}})=>e({variables:{productId:t,product:{tags:a,sequence:s,meta:l}},refetchQueries:["Products","ShopStatus","ShopInfo"]})}}])},30311,e=>{"use strict";var t=e.i(91398),a=e.i(69322);e.i(51523);var s=e.i(19518),l=e.i(28401),i=e.i(50595),d=e.i(53576),r=e.i(25327),n=e.i(84818),o=e.i(42929),u=e.i(97057),c=e.i(84278),m=e.i(92276),p=e.i(95379),f=e.i(51628),x=e.i(41418),g=e.i(21623),h=e.i(88604),v=e.i(6607),b=e.i(15971),y=e.i(41215),j=e.i(3828),I=e.i(58971),w=e.i(24608),M=e.i(91788),P=e.i(34728);e.s(["default",0,({slug:e})=>{let{formatMessage:N}=(0,a.useIntl)(),{formatDateTime:_}=(0,n.default)(),{hasRole:k}=(0,I.default)(),{publishProduct:$}=(0,p.default)(),{unPublishProduct:C}=(0,f.default)(),{removeProduct:S}=(0,h.default)(),{updateProduct:T}=(0,x.default)(),{setModal:q}=(0,v.default)(),R=(0,j.useRouter)(),{push:A}=(0,j.useRouter)(),{product:D,loading:V,error:E,extendedData:O}=(0,c.default)({slug:e}),U=D?.status||"DRAFT",L=(0,M.useMemo)(()=>[{id:"published",title:N({id:"published",defaultMessage:"Published"}),description:N({id:"publish_product_description",defaultMessage:"Product will be searchable and is available for orders"}),current:"ACTIVE"===U,selectedTitle:N({id:"published",defaultMessage:"Published"}),onClick:async()=>{try{await $({productId:D?._id}),l.toast.success(N({id:"product_published",defaultMessage:"Published successfully "}))}catch(t){console.error("Failed to publish product:",t);let e=t?.message||"Unknown error";l.toast.error(`${N({id:"product_publish_error",defaultMessage:"Failed to publish product"})}: ${e}`)}},bgColor:"green",disable:!k(s.IRoleAction.ManageProducts)},{id:"draft",title:N({id:"draft",defaultMessage:"Draft"}),description:N({id:"draft_product_description",defaultMessage:"Product will not be discoverable and can not be orderose"}),current:"DRAFT"===U,selectedTitle:N({id:"not_published",defaultMessage:"Not published"}),bgColor:"amber",disable:"ACTIVE"===U&&!k(s.IRoleAction.ManageProducts),onClick:async()=>{if(k(s.IRoleAction.ManageProducts))try{await C({productId:D?._id}),l.toast.success(N({id:"product_drafted",defaultMessage:"Drafted successfully "}))}catch(t){console.error("Failed to unpublish product:",t);let e=t?.message||"Unknown error";l.toast.error(`${N({id:"product_unpublish_error",defaultMessage:"Failed to unpublish product"})}: ${e}`)}}}],[D]);if(E)return console.error("Error loading product:",E),(0,t.jsx)("div",{className:"mt-5 max-w-full",children:(0,t.jsx)("div",{className:"text-center py-8",children:(0,t.jsx)("p",{className:"text-danger",children:N({id:"product_load_error",defaultMessage:"Failed to load product"})})})});let F=async e=>{e.target.value&&await T({productId:D?._id,product:{sequence:parseInt(e.target.value,10)}})},Q=async()=>{"proxies"in D&&D.proxies?.length?await q((0,t.jsx)(P.default,{headerText:N({id:"product_delete_blocked_header",defaultMessage:"Remove links before deleting"}),message:(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)("p",{children:N({id:"product_delete_blocked_intro",defaultMessage:"This product is linked to the following product types:"})}),(0,t.jsx)("ul",{className:"list-disc list-inside text-sm text-text-secondary",children:"proxies"in D&&D.proxies.map(({__typename:e},a)=>(0,t.jsx)("li",{children:e.replace("Product","")},a))}),(0,t.jsx)("p",{children:N({id:"product_delete_blocked_action",defaultMessage:"Please unlink it before trying to delete it."})})]}),buttonText:N({id:"ok",defaultMessage:"Ok"}),onOkClick:()=>q(null)})):await q((0,t.jsx)(b.default,{onCancelClick:()=>q(""),message:N({id:"delete_product_confirmation",defaultMessage:"This action might cause inconsistencies with other data that relates to it and it is nonreversible. Are you sure you want to delete this product?"}),onOkClick:async()=>{q("");try{await S({productId:D?._id}),l.toast.success(N({id:"product_deleted_success",defaultMessage:"Deleted successfully"})),R.push("/products")}catch(e){await q((0,t.jsx)(b.default,{onCancelClick:()=>q(""),headerText:N({id:"error",defaultMessage:"Error"}),message:e instanceof y.default?e.message:e,icon:(0,t.jsx)("div",{className:"mx-auto flex h-12 w-12 shrink-0 items-center justify-center rounded-full bg-rose-100 dark:bg-rose-900/30 sm:mx-0 sm:h-10 sm:w-10",children:(0,t.jsx)(w.XMarkIcon,{className:"h-6 w-6 text-danger",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2"})}),okText:N({id:"ok",defaultMessage:"Ok"}),onOkClick:async()=>{q("")}}))}}}))};return D||V?V?(0,t.jsx)(d.default,{}):(0,t.jsxs)("div",{className:"mt-5 max-w-full",children:[(0,t.jsx)(i.default,{routeName:e,depth:3,currentPageTitle:D?.texts?.title}),"DELETED"===U&&(0,t.jsx)("div",{className:"mb-4 rounded-md border border-rose-300 bg-rose-50 p-4 text-sm text-rose-800 dark:border-rose-700 dark:bg-rose-900/30 dark:text-rose-300",children:N({id:"product_deleted_notice",defaultMessage:"This product has been deleted and is no longer active. Some actions may be restricted."})}),(0,t.jsxs)("div",{children:[(0,t.jsxs)("div",{className:"items-center flex-wrap flex gap-5 min-w-full justify-between",children:[(0,t.jsx)(r.default,{headerText:(0,t.jsxs)(t.Fragment,{children:[D?.texts?.title||"Untitled Product","DELETED"===U&&(0,t.jsx)("span",{className:"ml-3 rounded bg-rose-100 px-2 py-1 text-xs font-semibold text-rose-800 dark:bg-rose-900/40 dark:text-rose-300",children:N({id:"deleted_status",defaultMessage:"Deleted"})})]}),title:`${D?.texts?.title||"Product"} (${D?._id})`}),(0,t.jsxs)("div",{className:"publish-and-order flex flex-wrap gap-3",children:[U&&"DELETED"!==U&&(0,t.jsx)(m.default,{options:L,type:N({id:"product",defaultMessage:"Product"})}),(0,t.jsxs)("div",{className:"inline-flex items-center gap-2 rounded-md dark:border-slate-600 px-4 py-2 text-sm font-medium leading-5 shadow-xs bg-surface h-[38px]",children:[(0,t.jsx)("label",{htmlFor:"sequence-input",className:"text-text-secondary font-medium cursor-pointer",children:N({id:"sequence",defaultMessage:"Display Order"})}),(0,t.jsx)("input",{type:"number",id:"sequence-input",disabled:!k(s.IRoleAction.ManageProducts),className:"text-center w-12 bg-transparent border border-border-default rounded focus:ring-2 focus:ring-focus-ring focus:border-transparent focus:outline-none text-sm font-semibold text-text-primary px-2 py-1 transition-all",defaultValue:D?.sequence,onBlur:F})]}),"DRAFT"===U&&k(s.IRoleAction.ManageProducts)&&(0,t.jsx)(g.default,{variant:"danger",icon:(0,t.jsx)(w.XMarkIcon,{className:"h-5 w-5"}),text:"Delete",onClick:Q})]})]}),(0,t.jsxs)("div",{className:"mt-8 flex flex-wrap gap-3 gap-x-10 text-text-secondary",children:[(0,t.jsxs)("div",{className:"flex flex-col items-baseline gap-0",children:[(0,t.jsx)("span",{className:"mr-2 text-xs text-text-muted",children:"ID:"}),(0,t.jsx)("span",{className:"text-sm font-mono",children:D?._id})]}),(0,t.jsxs)("div",{className:"flex flex-col items-baseline gap-0",children:[(0,t.jsx)("span",{className:"text-xs text-text-muted",children:"Type:"}),(0,t.jsx)("p",{className:"text-sm font-mono",children:D?.__typename})]}),D?.created&&(0,t.jsxs)("div",{className:"flex flex-col items-baseline gap-0",children:[(0,t.jsxs)("span",{className:"text-xs text-text-muted",children:[N({id:"created",defaultMessage:"Created"}),":"]}),(0,t.jsx)("span",{className:"text-sm font-mono",children:_(D.created,{dateStyle:"medium",timeStyle:"short"})})]}),D?.updated&&(0,t.jsxs)("div",{className:"flex flex-col items-baseline gap-0",children:[(0,t.jsxs)("span",{className:"text-xs text-text-muted",children:[N({id:"updated",defaultMessage:"Updated"}),":"]}),(0,t.jsx)("span",{className:"text-sm font-mono",children:_(D.updated,{dateStyle:"medium",timeStyle:"short"})})]}),D?.published&&(0,t.jsxs)("div",{className:"flex flex-col items-baseline gap-0",children:[(0,t.jsxs)("span",{className:"text-xs text-text-muted",children:[N({id:"published",defaultMessage:"Published"}),":"]}),(0,t.jsx)("span",{className:"text-sm font-mono",children:_(D.published,{dateStyle:"medium",timeStyle:"short"})})]})]})]}),(0,t.jsx)(u.default,{productId:D?._id,media:D?.media||[],onEditMedia:e=>{R.push({pathname:R.pathname,query:{...R.query,tab:"media"}},void 0,{shallow:!0})},canEdit:k(s.IRoleAction.ManageProducts)}),(0,t.jsx)(o.default,{product:D,extendedData:O})]}):(A("/404"),null)}])},43054,95336,16113,82191,42532,10785,1330,73356,50099,77035,56902,72264,19051,84278,11907,e=>{"use strict";var t=e.i(91788);let a=t.forwardRef(function({title:e,titleId:a,...s},l){return t.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:l,"aria-labelledby":a},s),e?t.createElement("title",{id:a},e):null,t.createElement("path",{d:"M12 9a1 1 0 0 1-1-1V3c0-.552.45-1.007.997-.93a7.004 7.004 0 0 1 5.933 5.933c.078.547-.378.997-.93.997h-5Z"}),t.createElement("path",{d:"M8.003 4.07C8.55 3.994 9 4.449 9 5v5a1 1 0 0 0 1 1h5c.552 0 1.008.45.93.997A7.001 7.001 0 0 1 2 11a7.002 7.002 0 0 1 6.003-6.93Z"}))});e.s(["ChartPieIcon",0,a],43054);let s=t.forwardRef(function({title:e,titleId:a,...s},l){return t.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:l,"aria-labelledby":a},s),e?t.createElement("title",{id:a},e):null,t.createElement("path",{d:"M2 3a1 1 0 0 0-1 1v1a1 1 0 0 0 1 1h16a1 1 0 0 0 1-1V4a1 1 0 0 0-1-1H2Z"}),t.createElement("path",{fillRule:"evenodd",d:"M2 7.5h16l-.811 7.71a2 2 0 0 1-1.99 1.79H4.802a2 2 0 0 1-1.99-1.79L2 7.5ZM7 11a1 1 0 0 1 1-1h4a1 1 0 1 1 0 2H8a1 1 0 0 1-1-1Z",clipRule:"evenodd"}))});e.s(["ArchiveBoxIcon",0,s],95336);let l=t.forwardRef(function({title:e,titleId:a,...s},l){return t.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:l,"aria-labelledby":a},s),e?t.createElement("title",{id:a},e):null,t.createElement("path",{fillRule:"evenodd",d:"M3.5 2A1.5 1.5 0 0 0 2 3.5V15a3 3 0 1 0 6 0V3.5A1.5 1.5 0 0 0 6.5 2h-3Zm11.753 6.99L9.5 14.743V6.257l1.51-1.51a1.5 1.5 0 0 1 2.122 0l2.121 2.121a1.5 1.5 0 0 1 0 2.122ZM8.364 18H16.5a1.5 1.5 0 0 0 1.5-1.5v-3a1.5 1.5 0 0 0-1.5-1.5h-2.136l-6 6ZM5 16a1 1 0 1 0 0-2 1 1 0 0 0 0 2Z",clipRule:"evenodd"}))});e.s(["SwatchIcon",0,l],16113);let i=t.forwardRef(function({title:e,titleId:a,...s},l){return t.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:l,"aria-labelledby":a},s),e?t.createElement("title",{id:a},e):null,t.createElement("path",{fillRule:"evenodd",d:"M1 2.75A.75.75 0 0 1 1.75 2h16.5a.75.75 0 0 1 0 1.5H18v8.75A2.75 2.75 0 0 1 15.25 15h-1.072l.798 3.06a.75.75 0 0 1-1.452.38L13.41 18H6.59l-.114.44a.75.75 0 0 1-1.452-.38L5.823 15H4.75A2.75 2.75 0 0 1 2 12.25V3.5h-.25A.75.75 0 0 1 1 2.75ZM7.373 15l-.391 1.5h6.037l-.392-1.5H7.373Zm7.49-8.931a.75.75 0 0 1-.175 1.046 19.326 19.326 0 0 0-3.398 3.098.75.75 0 0 1-1.097.04L8.5 8.561l-2.22 2.22A.75.75 0 1 1 5.22 9.72l2.75-2.75a.75.75 0 0 1 1.06 0l1.664 1.663a20.786 20.786 0 0 1 3.122-2.74.75.75 0 0 1 1.046.176Z",clipRule:"evenodd"}))});e.s(["PresentationChartLineIcon",0,i],82191);var d=e.i(91398);e.i(51523);var r=e.i(19518),n=e.i(58021),o=e.i(69322),u=e.i(58971),c=e.i(5505),m=e.i(1504),p=e.i(98520),f=e.i(79093),x=e.i(30434),g=e.i(69211),h=e.i(63094),v=e.i(10685),b=e.i(21128),y=e.i(16984),j=e.i(21623),I=e.i(98949),w=e.i(82226),M=e.i(59080),P=e.i(32171);let N=M.gql`
|
|
155
|
+
fragment ProductCatalogPriceFragment on ProductCatalogPrice {
|
|
156
|
+
isTaxable
|
|
157
|
+
isNetPrice
|
|
158
|
+
country {
|
|
159
|
+
_id
|
|
160
|
+
isoCode
|
|
161
|
+
name
|
|
162
|
+
flagEmoji
|
|
163
|
+
}
|
|
164
|
+
currency {
|
|
165
|
+
_id
|
|
166
|
+
isoCode
|
|
167
|
+
isActive
|
|
168
|
+
}
|
|
169
|
+
amount
|
|
170
|
+
minQuantity
|
|
171
|
+
}
|
|
172
|
+
`,_=M.gql`
|
|
173
|
+
query ProductCatalogPrices($productId: ID!) {
|
|
174
|
+
productCatalogPrices(productId: $productId) {
|
|
175
|
+
...ProductCatalogPriceFragment
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
${N}
|
|
179
|
+
`;var k=e.i(76204),$=e.i(62199);let C=M.gql`
|
|
180
|
+
mutation UpdateProductCommerce(
|
|
181
|
+
$productId: ID!
|
|
182
|
+
$commerce: UpdateProductCommerceInput!
|
|
183
|
+
) {
|
|
184
|
+
updateProductCommerce(productId: $productId, commerce: $commerce) {
|
|
185
|
+
...ProductDetailFragment
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
${$.default}
|
|
189
|
+
`,S=({defaultCountryValue:e,defaultCurrencyValue:t,countries:a,currencies:s})=>{let{formatMessage:l}=(0,o.useIntl)(),{hasRole:i}=(0,u.default)(),{watch:c,getValues:p,trigger:f}=(0,n.useFormContext)(),{fields:g,append:h,remove:b}=(0,n.useFieldArray)({name:"pricing"});c("pricing");let I=()=>p("pricing"),M=()=>{let e=g.map((e,t)=>`pricing.${t}.minQuantity`);setTimeout(()=>f(e),0)};return(0,d.jsxs)("div",{children:[g.map((n,o)=>{let u=[(0,w.validateProductCommerce)(o,I)];return 0===o&&u.push((0,w.validateProductCommerceOneZero)(I)),(0,d.jsxs)("div",{className:"relative max-w-full border-b dark:border-slate-700 pt-1 pb-5 mb-3 align-baseline lg:flex",children:[(0,d.jsxs)("div",{className:"flex w-full gap-x-2",children:[(0,d.jsx)(y.default,{className:"w-full",disabled:!i(r.IRoleAction.ManageProducts),validators:u,name:`pricing.${o}.minQuantity`,id:`pricing.${o}.minQuantity`,type:"number",min:0,hideLabel:!0,onChange:M,label:l({id:"min_quantity",defaultMessage:"Min Quantity"})}),(0,d.jsx)(y.default,{type:"number",className:"w-full",disabled:!i(r.IRoleAction.ManageProducts),name:`pricing.${o}.amount`,id:`pricing.${o}.amount`,required:!0,hideLabel:!0,label:l({id:"price",defaultMessage:"Price "})})]}),(0,d.jsxs)("div",{className:"flex w-full gap-x-2 pt-3 pb-2",children:[(0,d.jsx)("div",{className:"w-full lg:ml-8 lg:items-center",children:(0,d.jsx)(x.default,{name:`pricing.${o}.isTaxable`,labelClassName:"lg:sr-only items-center ",disabled:!i(r.IRoleAction.ManageProducts),label:l({id:"vat_suspect",defaultMessage:"Vat Suspect"}),className:"mr-2 h-4 w-4 rounded-sm border-border-default bg-white dark:!bg-slate-900 text-slate-950 focus:ring-focus-ring lg:items-center",type:"checkbox"})}),(0,d.jsx)("div",{className:"w-full lg:ml-8",children:(0,d.jsx)(x.default,{name:`pricing.${o}.isNetPrice`,labelClassName:"lg:sr-only items-center",disabled:!i(r.IRoleAction.ManageProducts),label:l({id:"net_price",defaultMessage:"Net Price"}),hideLabel:!0,className:"mr-2 h-4 w-4 justify-between rounded-sm border-border-default bg-white dark:!bg-slate-900 text-slate-950 focus:ring-focus-ring lg:items-center",type:"checkbox"})})]}),(0,d.jsxs)("div",{className:"flex w-full gap-x-2 mt-1",children:[(0,d.jsx)(v.default,{defaultValue:e,className:"w-full lg:ml-4 lg:mr-4",label:l({id:"country",defaultMessage:"Country"}),name:`pricing.${o}.countryCode`,id:`pricing.${o}.countryCode`,disabled:!i(r.IRoleAction.ManageProducts),required:!0,options:(0,m.default)(a,"isoCode","isoCode"),hideLabel:!0}),(0,d.jsx)(v.default,{defaultValue:t,className:"w-full lg:mr-8 ",label:l({id:"currency",defaultMessage:"Currency"}),disabled:!i(r.IRoleAction.ManageProducts),name:`pricing.${o}.currencyCode`,id:`pricing.${o}.currencyCode`,required:!0,options:(0,m.default)(s,"isoCode","isoCode"),hideLabel:!0,placeholder:l({id:"country_currency",defaultMessage:"Currency"})})]}),i(r.IRoleAction.ManageProducts)&&(0,d.jsx)("div",{className:"absolute -top-2 right-0 mt-0 mr-0 shrink-0 pb-1 md:mr-0 lg:mt-6 lg:py-0 lg:px-0 ",children:(0,d.jsx)("button",{className:"items-center rounded-full bg-surface-input px-1 py-1 text-sm text-rose-500 dark:text-rose-400 hover:bg-rose-50 focus:outline-hidden focus:ring-0 focus:ring-rose-500 focus:ring-offset-2",type:"button",onClick:()=>b(o),children:(0,d.jsxs)("svg",{className:"h-4 w-4",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,d.jsx)("polyline",{points:"3 6 5 6 21 6"}),(0,d.jsx)("path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"}),(0,d.jsx)("line",{x1:"10",y1:"11",x2:"10",y2:"17"}),(0,d.jsx)("line",{x1:"14",y1:"11",x2:"14",y2:"17"})]})})})]},n.id)}),i(r.IRoleAction.ManageProducts)&&(0,d.jsx)("div",{className:"mt-6",children:(0,d.jsx)(j.default,{variant:"tertiary",text:l({id:"add_price_row",defaultMessage:"Add Price Row"}),className:"w-full items-center justify-center",onClick:()=>h({minQuantity:"",amount:null,isTaxable:!1,isNetPrice:!1,currencyCode:t,countryCode:e})})})]})};e.s(["default",0,({productId:e,disabled:t=!1})=>{let{formatMessage:a}=(0,o.useIntl)(),{catalogPrices:s}=(({productId:e})=>{let{data:t,loading:a,error:s}=(0,P.useQuery)(_,{skip:!e,variables:{productId:e}});return{catalogPrices:t?.productCatalogPrices||[],loading:a,error:s}})({productId:e}),{hasRole:l}=(0,u.default)(),{updateProductCommerce:i}=(()=>{let[e]=(0,k.useMutation)(C),{currencies:t}=(0,f.default)();return{updateProductCommerce:async({productId:a,commerce:{pricing:s}})=>e({variables:{productId:a,commerce:{pricing:s.map(e=>{let a=t.find(({isoCode:t})=>t===e.currencyCode),s=((e,t)=>{if(!e||t<0)return 0;let a=e.trim();if(!/^-?\d*\.?\d*$/.test(a))return 0;let s=a.indexOf(".");return -1===s?Number(a)*10**t:Number((a.slice(0,s)||"0")+a.slice(s+1).slice(0,t).padEnd(t,"0"))})(e.amount.toString(),a.decimals);return{...e,amount:s}})}},refetchQueries:["Products"]})}})(),{countries:n}=(0,p.default)(),{currencies:m}=(0,f.default)(),x=n?.find(({isBase:e})=>e),v=x?.isoCode,y=x?.defaultCurrency?.isoCode,j=async({pricing:t})=>(await i({productId:e,commerce:{pricing:t}}),{success:!0}),w=a({id:"saved",defaultMessage:"Saved"}),M=((e=[],t=[])=>t.length?e.map(e=>{let a=t.find(({isoCode:t})=>t.toLowerCase()===e.currency.isoCode.toLowerCase());return{countryCode:e.country.isoCode,currencyCode:e.currency.isoCode,isTaxable:!!e.isTaxable,isNetPrice:!!e.isNetPrice,amount:((e,t)=>{if(t<0)return"0";if(0===t)return e.toString();let a=e.toString();if("0"===a)return"0."+"0".repeat(t);let s=a.startsWith("-"),l=s?a.slice(1):a;if(l.length<=t){let e=l.padStart(t,"0");return`${s?"-":""}0.${e}`}let i=l.length-t,d=l.slice(0,i),r=l.slice(i);return`${s?"-":""}${d}.${r}`})(e.amount,a?.decimals),minQuantity:e.minQuantity}}):[])(s,m),N=(0,I.default)({disabled:t,submit:j,successMessage:w,enableReinitialize:!0,initialValues:{pricing:[...M?.length?M:[{minQuantity:"",amount:null,isTaxable:!1,isNetPrice:!1,currencyCode:y,countryCode:v}]]}});return(0,d.jsx)("div",{children:(0,d.jsxs)("div",{className:"mt-5 md:col-span-3 lg:mt-0",children:[(0,d.jsx)(c.default,{children:(0,d.jsxs)(g.default,{className:"mt-3 rounded-md",form:N,disabled:!l(r.IRoleAction.ManageProducts),children:[(0,d.jsxs)("div",{className:"relative max-w-full p-3 sm:px-5",children:[(0,d.jsx)("div",{className:"max-w-full justify-between align-baseline"}),(0,d.jsxs)("label",{className:"sr-only flex w-full font-sans text-sm text-text-muted lg:not-sr-only",children:[(0,d.jsxs)("span",{className:"flex w-full",children:[(0,d.jsx)("span",{className:"w-full",children:a({id:"min_quantity",defaultMessage:"Min Quantity"})}),(0,d.jsx)("span",{className:"w-full lg:ml-5",children:a({id:"price",defaultMessage:"Price"})})]}),(0,d.jsxs)("span",{className:"flex w-full",children:[(0,d.jsx)("span",{className:"w-full lg:ml-8",children:a({id:"vat_suspect",defaultMessage:"Vat Suspect"})}),(0,d.jsx)("span",{className:"w-full lg:ml-12",children:a({id:"net_price",defaultMessage:"Net Price"})})]}),(0,d.jsxs)("span",{className:"mr-5 flex w-full",children:[(0,d.jsx)("span",{className:"ml-10 w-full",children:a({id:"country",defaultMessage:"Country"})}),(0,d.jsx)("span",{className:"w-full",children:a({id:"currency",defaultMessage:"Currency"})})]})]}),(0,d.jsx)(S,{defaultCountryValue:v,defaultCurrencyValue:y,countries:n,currencies:m})]}),(0,d.jsx)(h.default,{displayFieldErrors:!0}),l(r.IRoleAction.ManageProducts)&&(0,d.jsx)("div",{className:"-mx-6 p-6 bg-surface-subtle text-right",children:(0,d.jsx)(b.default,{className:"mx-6",label:a({id:"save",defaultMessage:"Save"})})})]})}),(0,d.jsx)("p",{className:"mt-6 mb-10 text-sm text-text-muted",children:a({id:"product_commerce_info",defaultMessage:"One price should have a min quantity of 0 (or empty) and no two prices should share the same min quantity, currency and country"})})]})})}],42532);var T=e.i(70693),q=e.i(14336);let R=M.gql`
|
|
190
|
+
mutation UpdateProductTexts($productId: ID!, $texts: [ProductTextInput!]!) {
|
|
191
|
+
updateProductTexts(productId: $productId, texts: $texts) {
|
|
192
|
+
...ProductTextsFragment
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
${q.default}
|
|
196
|
+
`;var A=e.i(60195),D=e.i(83094),V=e.i(13120),E=e.i(53296),O=e.i(57561),U=e.i(48539);e.s(["default",0,({productId:e,disabled:a=!1})=>{let{selectedLocale:s,setSelectedLocale:l,languageDialectList:i}=(0,O.default)(),{formatMessage:n}=(0,o.useIntl)(),{hasRole:m}=(0,u.default)(),{defaultLocale:p,shopInfo:f,loading:x}=(0,U.default)(),{translatedTexts:h}=(({productId:e})=>{let{customProperties:t}=(0,T.default)(),{data:a,loading:s,error:l}=(0,P.useQuery)(((e="")=>M.gql`
|
|
197
|
+
query TranslatedProductTexts($productId: ID!) {
|
|
198
|
+
translatedProductTexts(productId: $productId) {
|
|
199
|
+
...ProductTextsFragment
|
|
200
|
+
${e}
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
${q.default}
|
|
204
|
+
`)(t?.ProductTexts),{skip:!e,variables:{productId:e}});return{translatedTexts:a?.translatedProductTexts||[],loading:s,error:l}})({productId:e}),v=n({id:"saved",defaultMessage:"Saved"}),{updateProductTexts:j}=(()=>{let[e]=(0,k.useMutation)(R);return{updateProductTexts:async({productId:t,texts:a})=>e({variables:{productId:t,texts:a},refetchQueries:["TranslatedProductTexts"]})}})(),w=async({slug:t,title:a,subtitle:l,vendor:i,description:d,brand:r,labels:n})=>(await j({productId:e,texts:[{locale:s,slug:t,title:a,subtitle:l,vendor:i,description:d,brand:r,labels:n}]}),{success:!0}),N=(0,I.default)({disabled:a,submit:w,successMessage:v,initialValues:{slug:"",title:"",subtitle:"",vendor:"",description:"",brand:"",labels:[]}});return(0,t.useEffect)(()=>{let e=h?.find(e=>e.locale===s);N.api.setValues({slug:"",title:"",subtitle:"",vendor:"",description:"",brand:"",labels:[],...e||{}})},[h,s]),(0,t.useEffect)(()=>{if(f&&h?.length&&!h?.find(({locale:e})=>e===s))if(p&&h?.find(({locale:e})=>e===p))l(p);else if(p&&h?.find(({locale:e})=>e===p.split("-")[0]))l(p.split("-")[0]);else{let e=h?.find(({locale:e})=>e&&i?.find(({isoCode:t})=>t===e));l(e?.locale)}},[x,h]),(0,d.jsx)(A.default,{documentationLabel:n({id:"texts",defaultMessage:"Texts"}),className:"mt-2 lg:mt-5",documentation:(0,d.jsx)(o.FormattedMessage,{id:"product_text_form_description",defaultMessage:"<ul> <li><strong>Slug:</strong> The unique part of your product URL (e.g., 'my-awesome-product'). Keep it short and descriptive.</li>\n <li><strong>Localization:</strong> Switch languages using the dropdown at the top left to translate content for different markets.</li>\n <li><strong>Description:</strong> Supports Markdown and HTML formatting. Use double backslash (\\\\\\\\) for line breaks.</li>\n <li><strong>Labels:</strong> Eye-catching badges that appear on your product (e.g., 'New Arrival', '50% Off', 'Limited Edition'). Perfect for promotions and highlighting special features. Each language can have unique labels.</li>\n <li><strong>Key Difference:</strong> Labels are customer-facing promotional badges, while Tags are internal keywords for organization and filtering.</li>\n </ul>",values:{ul:e=>(0,d.jsxs)("ul",{className:"space-y-2",children:[e," "]}),li:e=>(0,d.jsxs)("li",{className:"text-sm",children:[e," "]},Math.random()),strong:e=>(0,d.jsx)("strong",{className:"font-semibold text-text-secondary",children:e})}}),children:(0,d.jsx)(c.default,{children:(0,d.jsxs)(g.default,{form:N,disabled:!m(r.IRoleAction.ManageProducts),children:[(0,d.jsxs)("div",{className:"relative text-text-muted px-4 py-5 sm:p-6",children:[(0,d.jsxs)("div",{className:"grid grid-cols-6 gap-6",children:[(0,d.jsx)("div",{className:"col-span-6 sm:col-span-3",children:(0,d.jsx)(y.default,{name:"slug",disabled:!m(r.IRoleAction.ManageProducts),required:!0,id:"slug",label:n({id:"slug",defaultMessage:"Slug"}),autoComplete:"on",className:"text-sm"})}),(0,d.jsx)("div",{className:"col-span-6 sm:col-span-3",children:(0,d.jsx)(y.default,{name:"title",disabled:!m(r.IRoleAction.ManageProducts),required:!0,id:"title",label:n({id:"title",defaultMessage:"Title"}),autoComplete:"on",className:"text-sm"})}),(0,d.jsx)("div",{className:"col-span-6 sm:col-span-3",children:(0,d.jsx)(y.default,{name:"subtitle",disabled:!m(r.IRoleAction.ManageProducts),id:"subtitle",label:n({id:"subtitle",defaultMessage:"Subtitle"}),autoComplete:"on",className:"text-sm"})}),(0,d.jsx)("div",{className:"col-span-6 sm:col-span-3",children:(0,d.jsx)(y.default,{name:"vendor",disabled:!m(r.IRoleAction.ManageProducts),id:"vendor",label:n({id:"vendor",defaultMessage:"Vendor"}),autoComplete:"on",className:"text-sm"})}),(0,d.jsx)("div",{className:"col-span-6 sm:col-span-3",children:(0,d.jsx)(y.default,{name:"brand",disabled:!m(r.IRoleAction.ManageProducts),id:"brand",label:n({id:"brand",defaultMessage:"Brand"}),autoComplete:"on",className:"text-sm"})}),(0,d.jsxs)("div",{className:"col-span-6 sm:col-span-3",children:[(0,d.jsx)(V.default,{name:"labels",id:"labels",disabled:!m(r.IRoleAction.ManageProducts),label:n({id:"labels",defaultMessage:"Labels"}),placeholder:n({id:"label",defaultMessage:"Label"}),buttonText:n({id:"add",defaultMessage:"Add"}),autoComplete:"on",className:"text-sm"}),(0,d.jsx)(E.default,{messageKey:"product_labels_help",defaultMessage:"Add promotional badges like 'New Arrival', '50% Off', or 'Limited Edition' that customers will see on your product. Perfect for highlighting deals and special features.",className:"mt-3"})]})]}),(0,d.jsx)("div",{className:"col-span-6 mt-6 sm:col-span-3",children:(0,d.jsx)(D.default,{name:"description",id:"description",disabled:!m(r.IRoleAction.ManageProducts),label:n({id:"description",defaultMessage:"Description"})})})]}),m(r.IRoleAction.ManageProducts)&&(0,d.jsx)("div",{className:"border-t-slate-100 border-t border-t-border-subtle bg-surface-subtle px-4 py-5 text-right sm:px-6",children:(0,d.jsx)(b.default,{label:n({id:"save",defaultMessage:"Save"})})})]})})})}],10785);var L=e.i(28401),F=e.i(59295),Q=e.i(6277),B=e.i(33006),z=e.i(93994),K=e.i(64479);let H=M.gql`
|
|
205
|
+
mutation PrepareProductMediaUpload($mediaName: String!, $productId: ID!) {
|
|
206
|
+
prepareProductMediaUpload(mediaName: $mediaName, productId: $productId) {
|
|
207
|
+
_id
|
|
208
|
+
putURL
|
|
209
|
+
expires
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
`;var W=e.i(1880);let Z=M.gql`
|
|
213
|
+
fragment ProductMediaFragment on ProductMedia {
|
|
214
|
+
_id
|
|
215
|
+
tags
|
|
216
|
+
file {
|
|
217
|
+
_id
|
|
218
|
+
name
|
|
219
|
+
type
|
|
220
|
+
size
|
|
221
|
+
url
|
|
222
|
+
}
|
|
223
|
+
sortKey
|
|
224
|
+
texts {
|
|
225
|
+
_id
|
|
226
|
+
locale
|
|
227
|
+
title
|
|
228
|
+
subtitle
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
`,G=M.gql`
|
|
232
|
+
query ProductMedia($productId: ID, $slug: String) {
|
|
233
|
+
product(productId: $productId, slug: $slug) {
|
|
234
|
+
_id
|
|
235
|
+
media {
|
|
236
|
+
...ProductMediaFragment
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
${Z}
|
|
241
|
+
`;var X=e.i(2194),J=e.i(90062);let Y=M.gql`
|
|
242
|
+
fragment ProductMediaTextsFragment on ProductMediaTexts {
|
|
243
|
+
_id
|
|
244
|
+
locale
|
|
245
|
+
title
|
|
246
|
+
subtitle
|
|
247
|
+
}
|
|
248
|
+
`,ee=M.gql`
|
|
249
|
+
query TranslatedProductMediaTexts($productMediaId: ID!) {
|
|
250
|
+
translatedProductMediaTexts(productMediaId: $productMediaId) {
|
|
251
|
+
...ProductMediaTextsFragment
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
${Y}
|
|
255
|
+
`,et=M.gql`
|
|
256
|
+
mutation UpdateProductMediaTexts(
|
|
257
|
+
$productMediaId: ID!
|
|
258
|
+
$texts: [ProductMediaTextInput!]!
|
|
259
|
+
) {
|
|
260
|
+
updateProductMediaTexts(productMediaId: $productMediaId, texts: $texts) {
|
|
261
|
+
...ProductMediaTextsFragment
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
${Y}
|
|
265
|
+
`;var ea=e.i(15971);let es=M.gql`
|
|
266
|
+
mutation RemoveProductMedia($productMediaId: ID!) {
|
|
267
|
+
removeProductMedia(productMediaId: $productMediaId) {
|
|
268
|
+
_id
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
`;var el=e.i(6607);let ei=({media:e,id:a})=>{let{setModal:s}=(0,el.default)(),{removeProductMedia:l}=(()=>{let[e]=(0,k.useMutation)(es);return{removeProductMedia:async({productMediaId:t})=>e({variables:{productMediaId:t},refetchQueries:["ProductMedia"]})}})(),{formatMessage:i}=(0,o.useIntl)(),{selectedLocale:n}=(0,O.default)(),{updateProductMediaTexts:c}=(()=>{let[e]=(0,k.useMutation)(et);return{updateProductMediaTexts:async({productMediaId:t,texts:a})=>e({variables:{productMediaId:t,texts:a},refetchQueries:["TranslatedProductMediaTexts"]})}})(),[m,p]=(0,t.useState)(!1),{hasRole:f}=(0,u.default)(),{translatedMediaTexts:x}=(({productMediaId:e})=>{let{data:t,loading:a,error:s}=(0,P.useQuery)(ee,{skip:!e,variables:{productMediaId:e}});return{translatedMediaTexts:t?.translatedProductMediaTexts||[],loading:a,error:s}})({productMediaId:e._id}),g=x?.find(e=>e.locale===n)||{},h=async e=>{await s((0,d.jsx)(ea.default,{onCancelClick:async()=>s(""),message:i({id:"delete_product_media_confirmation",defaultMessage:"This action might cause inconsistencies with other data that relates to it. Are you sure you want to delete this media? "}),onOkClick:async()=>{s(""),await l({productMediaId:e}),L.toast.success(i({id:"product_media_deleted",defaultMessage:"Media deleted successfully"}))},okText:i({id:"delete_product_media",defaultMessage:"Delete media"})}))},v=async({title:t,subtitle:a})=>(await c({productMediaId:e._id,texts:[{title:t,locale:n,subtitle:a}]}),p(!1),!0);return(0,d.jsx)(J.default,{id:a,media:e,mediaText:g,isEdit:m,onDelete:f(r.IRoleAction.ManageProducts)?h:void 0,onEdit:f(r.IRoleAction.ManageProducts)?p:void 0,onUpdate:f(r.IRoleAction.ManageProducts)?v:void 0})},ed=({medias:e,items:t})=>{let{formatMessage:a}=(0,o.useIntl)();return(0,d.jsx)("div",{className:"rounded-md lg:col-span-6 px-6",children:(0,d.jsxs)("div",{className:"mx-auto overflow-hidden",children:[(0,d.jsx)("h2",{className:"sr-only",children:a({id:"product_media",defaultMessage:"Product Media"})}),(0,d.jsx)("div",{className:"flow-root",children:(0,d.jsx)(Q.SortableContext,{items:t,strategy:Q.verticalListSortingStrategy,children:(0,d.jsx)("ul",{className:"flex flex-col gap-3 rounded-md transition-[background-color] ease-in-out delay-200 ",children:e?.length?t.map(t=>{let a=Object.values(e).find(e=>e._id===t);return(0,d.jsx)(ei,{id:t,media:a},a._id)}):(0,d.jsx)(X.default,{message:a({id:"media",defaultMessage:"Media"})})})})})]})})},er=M.gql`
|
|
272
|
+
mutation ReOrderProductMedia($sortKeys: [ReorderProductMediaInput!]!) {
|
|
273
|
+
reorderProductMedia(sortKeys: $sortKeys) {
|
|
274
|
+
_id
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
`;e.s(["default",0,({productId:e})=>{let{productMedia:t}=(({productId:e=null,slug:t=null}={})=>{let a=(0,W.parseUniqueId)(t),{data:s,loading:l,error:i}=(0,P.useQuery)(G,{skip:!e&&!a,variables:{productId:e||a}});return{productMedia:s?.product?.media||[],loading:l,error:i}})({productId:e}),{formatMessage:a}=(0,o.useIntl)(),{hasRole:s}=(0,u.default)(),{addProductMedia:l}=(()=>{let[e]=(0,k.useMutation)(H),{confirmMediaUpload:t}=(0,K.default)({refetchQueries:["Product"]});return{addProductMedia:async({productId:a,media:s})=>{let{data:l}=await e({variables:{productId:a,mediaName:s.name}}),{prepareProductMediaUpload:i}=l;return await (0,z.default)(s,i.putURL),t({mediaUploadTicketId:i._id,size:s?.size,type:s.type})}}})(),{reOrderProductMedia:i}=(()=>{let[e]=(0,k.useMutation)(er);return{reOrderProductMedia:async({sortKeys:t})=>e({variables:{sortKeys:t},refetchQueries:["ProductMedia"]})}})(),n=t?.map(e=>e._id),c=async t=>{try{await l({productId:e,media:t}),L.toast.success(a({id:"product_media_upload",defaultMessage:"Media uploaded successfully"}))}catch(e){L.toast.error(a({id:"fail_upload",defaultMessage:"Media upload failed"}))}},m=async e=>{let{active:t,over:s}=e;if(t.id!==s.id){let e=n.indexOf(t.id),l=n.indexOf(s.id),d=(0,Q.arrayMove)(n,e,l).map((e,t)=>({productMediaId:e,sortKey:t}));try{await i({sortKeys:d}),L.toast.success(a({id:"link_reorder",defaultMessage:"Link reorder successfully"}))}catch(e){L.toast.error(a({id:"fail_reorder",defaultMessage:"Reordering failed, Try again!"}))}}else L.toast.info(a({id:"reorder_original",defaultMessage:"Reorder to original location"}))},p=(0,F.useSensors)((0,F.useSensor)(F.PointerSensor,{activationConstraint:{distance:5}}),(0,F.useSensor)(F.KeyboardSensor,{coordinateGetter:Q.sortableKeyboardCoordinates}));return(0,d.jsxs)("div",{className:"mx-auto mt-5 space-y-5 lg:space-y-0 max-w-full py-6 lg:grid lg:grid-cols-12 lg:gap-4",children:[s(r.IRoleAction.ManageProducts)&&(0,d.jsx)("div",{className:"mx-auto w-full px-6 lg:col-span-6 lg:col-start-1",children:(0,d.jsx)(B.default,{onlyDragAndDrop:!0,addMedia:c})}),(0,d.jsx)(F.DndContext,{sensors:p,collisionDetection:F.closestCenter,onDragEnd:m,children:(0,d.jsx)(ed,{medias:t,items:n})})]})}],1330);let en=M.gql`
|
|
278
|
+
fragment ProductPlanConfigurationFragment on ProductPlanConfiguration {
|
|
279
|
+
usageCalculationType
|
|
280
|
+
billingInterval
|
|
281
|
+
trialInterval
|
|
282
|
+
trialIntervalCount
|
|
283
|
+
billingIntervalCount
|
|
284
|
+
}
|
|
285
|
+
`,eo=M.gql`
|
|
286
|
+
query ProductPlan($productId: ID, $slug: String) {
|
|
287
|
+
product(productId: $productId, slug: $slug) {
|
|
288
|
+
_id
|
|
289
|
+
... on PlanProduct {
|
|
290
|
+
plan {
|
|
291
|
+
...ProductPlanConfigurationFragment
|
|
292
|
+
}
|
|
293
|
+
}
|
|
294
|
+
}
|
|
295
|
+
}
|
|
296
|
+
${en}
|
|
297
|
+
`,eu=M.gql`
|
|
298
|
+
query ProductPlanConfigurationOptions {
|
|
299
|
+
usageCalculationTypes: __type(name: "ProductPlanUsageCalculationType") {
|
|
300
|
+
options: enumValues {
|
|
301
|
+
value: name
|
|
302
|
+
label: description
|
|
303
|
+
}
|
|
304
|
+
}
|
|
305
|
+
configurationIntervals: __type(name: "ProductPlanConfigurationInterval") {
|
|
306
|
+
options: enumValues {
|
|
307
|
+
value: name
|
|
308
|
+
label: description
|
|
309
|
+
}
|
|
310
|
+
}
|
|
311
|
+
}
|
|
312
|
+
`,ec=M.gql`
|
|
313
|
+
mutation UpdateProductPlan($productId: ID!, $plan: UpdateProductPlanInput!) {
|
|
314
|
+
updateProductPlan(productId: $productId, plan: $plan) {
|
|
315
|
+
_id
|
|
316
|
+
}
|
|
317
|
+
}
|
|
318
|
+
`;e.s(["default",0,({productId:e,disabled:a=!1})=>{let{formatMessage:s}=(0,o.useIntl)(),{configurationIntervals:l,usageCalculationTypes:i}=(()=>{let{data:e,loading:t,error:a}=(0,P.useQuery)(eu),s=e?.usageCalculationTypes?.options||[];return{configurationIntervals:e?.configurationIntervals?.options||[],usageCalculationTypes:s,loading:t,error:a}})(),{plan:n,loading:p}=(({productId:e=null,slug:t=null}={})=>{let a=(0,W.parseUniqueId)(t),{data:s,loading:l,error:i}=(0,P.useQuery)(eo,{skip:!e&&!a,variables:{productId:e||a}}),d=s?.product;return{plan:d?.plan,loading:l,error:i}})({productId:e}),{hasRole:f}=(0,u.default)(),{updateProductPlan:x}=(()=>{let[e]=(0,k.useMutation)(ec);return{updateProductPlan:async({productId:t,plan:{usageCalculationType:a,billingInterval:s,billingIntervalCount:l=null,trialInterval:i=null,trialIntervalCount:d=null}})=>e({variables:{productId:t,plan:{usageCalculationType:a,billingInterval:s,billingIntervalCount:l,trialInterval:i,trialIntervalCount:d}},refetchQueries:["Products"]})}})(),h=s({id:"enrollment_updated_successfully",defaultMessage:"Enrollment saved successfully"}),j=async({trialInterval:t,trialIntervalCount:a,billingInterval:s,billingIntervalCount:l,usageCalculationType:i})=>(await x({productId:e,plan:{billingInterval:s,usageCalculationType:i,billingIntervalCount:l,trialInterval:t,trialIntervalCount:a}}),{success:!0}),w=(0,I.default)({disabled:a,submit:j,successMessage:h,initialValues:{trialInterval:"",trialIntervalCount:"",billingInterval:"",billingIntervalCount:"",usageCalculationType:""},getSubmitErrorMessage:e=>e?.message?.includes("Status of the product does not allow this operation")?s({id:"subscription_product_type_not_valid",defaultMessage:"Status of the product does not allow this operation"}):e?.message||""});return(0,t.useEffect)(()=>{n&&!p&&w.api.setValues(n)},[n]),(0,d.jsx)(A.default,{documentationLabel:s({id:"subscription",defaultMessage:"Subscription"}),className:"mt-2 lg:mt-5",documentation:(0,d.jsx)(o.FormattedMessage,{id:"product_subscription_form_description",defaultMessage:"<ul><li> Information that will be used to calculate price of a subscription based product </li>\n <li>The price specified in commerce section will be used when calculating fees on each interval. </li>\n <li>Price will not be included for the specified trial period </li> </ul>",values:{ul:e=>(0,d.jsxs)("ul",{className:"space-y-1",children:[e," "]}),li:e=>(0,d.jsx)("li",{children:e})}}),children:(0,d.jsx)(c.default,{children:(0,d.jsx)(g.default,{form:w,children:(0,d.jsxs)("div",{className:"relative max-w-full space-y-6 rounded-md sm:p-6",children:[(0,d.jsx)(v.default,{required:!0,className:"mt-2.5 w-full py-1.5 text-sm font-medium text-slate-500",label:s({id:"usage_calculation_type",defaultMessage:"Usage calculation type"}),placeholder:s({id:"usage_calculation_type",defaultMessage:"Usage calculation type"}),name:"usageCalculationType",options:(0,m.default)(i,"value","value")}),(0,d.jsxs)("div",{className:"w-full items-end justify-end sm:flex",children:[(0,d.jsx)(v.default,{className:"mt-2.5 w-full text-sm font-medium text-slate-500",required:!0,label:s({id:"billing_interval_unit",defaultMessage:"Billing interval unit"}),placeholder:s({id:"billing_interval_unit",defaultMessage:"Billing interval unit"}),name:"billingInterval",options:(0,m.default)(l,"value","value")}),(0,d.jsx)(y.default,{name:"billingIntervalCount",id:"billing_unit",type:"number",required:!0,label:s({id:"billing_unit",defaultMessage:"Billing Unit"}),placeholder:s({id:"billing_unit",defaultMessage:"Billing Unit"}),className:"mt-1 w-full text-sm font-medium text-slate-500 sm:ml-1"})]}),(0,d.jsxs)("div",{className:"max-w-full items-end justify-end sm:flex",children:[(0,d.jsx)(v.default,{className:"mt-2.5 w-full text-sm font-medium text-slate-500",label:s({id:"trial_interval_unit",defaultMessage:"Trial interval unit"}),placeholder:s({id:"trial_interval_unit",defaultMessage:"Trial interval unit"}),name:"trialInterval",options:(0,m.default)(l,"value","value")}),(0,d.jsx)(y.default,{type:"number",name:"trialIntervalCount",id:"trialIntervalCount ",label:s({id:"trial_unit",defaultMessage:"Trial Unit"}),placeholder:s({id:"trial_unit",defaultMessage:"Trial Unit"}),required:!0,className:"mt-1 w-full text-sm font-medium text-slate-500 sm:ml-1"})]}),f(r.IRoleAction.CreateEnrollment)&&(0,d.jsx)("div",{className:"-mx-6 -mb-6 mt-6 border-t-slate-100 border-t space-y-6 bg-slate-50 dark:bg-slate-500 text-right sm:p-6",children:(0,d.jsx)(b.default,{label:s({id:"save",defaultMessage:"Save"})})})]})})})})}],73356);var em=e.i(60959);let ep=M.gql`
|
|
319
|
+
query ProductSupply($productId: ID, $slug: String) {
|
|
320
|
+
product(productId: $productId, slug: $slug) {
|
|
321
|
+
_id
|
|
322
|
+
... on SimpleProduct {
|
|
323
|
+
dimensions {
|
|
324
|
+
...ProductDimensionFragment
|
|
325
|
+
}
|
|
326
|
+
}
|
|
327
|
+
}
|
|
328
|
+
}
|
|
329
|
+
${em.default}
|
|
330
|
+
`,ef=M.gql`
|
|
331
|
+
mutation UpdateProductSupply(
|
|
332
|
+
$productId: ID!
|
|
333
|
+
$supply: UpdateProductSupplyInput!
|
|
334
|
+
) {
|
|
335
|
+
updateProductSupply(productId: $productId, supply: $supply) {
|
|
336
|
+
_id
|
|
337
|
+
... on SimpleProduct {
|
|
338
|
+
dimensions {
|
|
339
|
+
...ProductDimensionFragment
|
|
340
|
+
}
|
|
341
|
+
}
|
|
342
|
+
}
|
|
343
|
+
}
|
|
344
|
+
${em.default}
|
|
345
|
+
`;e.s(["default",0,({productId:e,disabled:a=!1})=>{let{formatMessage:s}=(0,o.useIntl)(),l=s({id:"saved",defaultMessage:"Saved"}),{hasRole:i}=(0,u.default)(),{updateProductSupply:n}=(()=>{let[e]=(0,k.useMutation)(ef);return{updateProductSupply:async({productId:t,supply:{weightInGram:a=null,heightInMillimeters:s=null,lengthInMillimeters:l=null,widthInMillimeters:i=null}})=>e({variables:{productId:t,supply:{weightInGram:a||null,heightInMillimeters:s||null,lengthInMillimeters:l||null,widthInMillimeters:i||null}},refetchQueries:["Products"]})}})(),{dimensions:m}=(({productId:e=null,slug:t=null}={})=>{let a=(0,W.parseUniqueId)(t),{data:s,loading:l,error:i}=(0,P.useQuery)(ep,{skip:!e&&!t,variables:{productId:e||a}}),d=s?.product;return{dimensions:d?.dimensions||{},loading:l,error:i}})({productId:e}),p=async({weight:t,length:a,width:s,height:l})=>(await n({productId:e,supply:{weightInGram:t,lengthInMillimeters:a,heightInMillimeters:l,widthInMillimeters:s}}),{success:!0}),f=(0,I.default)({disabled:a,submit:p,getSubmitErrorMessage:e=>(e.message.includes("supply.weightInGram")&&e.message.includes("Expected type Int")?f.api.setFieldError("weight","Invalid value, only integer is accepted"):e.message.includes("supply.heightInMillimeters")&&e.message.includes("Expected type Int")?f.api.setFieldError("height","Invalid value, only integer is accepted"):e.message.includes("supply.lengthInMillimeters")&&e.message.includes("Expected type Int")&&f.api.setFieldError("length","Invalid value, only integer is accepted"),null),successMessage:l,initialValues:{weight:"",length:"",width:"",height:""}});return(0,t.useEffect)(()=>{Object.keys(m).length&&f.api.setValues(m)},[m]),(0,d.jsx)("div",{className:"mt-5 md:col-span-2 md:mt-0",children:(0,d.jsx)(c.default,{children:(0,d.jsxs)(g.default,{form:f,disabled:!i(r.IRoleAction.ManageProducts),children:[(0,d.jsx)("div",{className:"relative px-4 py-5 sm:p-6",children:(0,d.jsxs)("div",{className:"grid grid-cols-6 gap-6",children:[(0,d.jsx)("div",{className:"col-span-6 sm:col-span-3",children:(0,d.jsx)(y.default,{validators:[(0,w.validateInteger)()],type:"number",name:"weight",disabled:!i(r.IRoleAction.ManageProducts),id:"weight",label:s({id:"weight_gram",defaultMessage:"Weight (Gram)"}),className:"text-sm"})}),(0,d.jsx)("div",{className:"col-span-6 sm:col-span-3",children:(0,d.jsx)(y.default,{validators:[(0,w.validateInteger)()],name:"length",disabled:!i(r.IRoleAction.ManageProducts),id:"length",type:"number",label:s({id:"length_millimeter",defaultMessage:"Length (Millimeter)"}),className:"text-sm"})}),(0,d.jsx)("div",{className:"col-span-6 sm:col-span-3",children:(0,d.jsx)(y.default,{validators:[(0,w.validateInteger)()],type:"number",name:"width",disabled:!i(r.IRoleAction.ManageProducts),id:"width ",label:s({id:"width",defaultMessage:"Width (Millimeter)"}),className:"text-sm "})}),(0,d.jsx)("div",{className:"col-span-6 sm:col-span-3",children:(0,d.jsx)(y.default,{validators:[(0,w.validateInteger)()],name:"height",disabled:!i(r.IRoleAction.ManageProducts),type:"number",id:"height",label:s({id:"height",defaultMessage:"Height (Millimeter)"}),className:"text-sm "})})]})}),i(r.IRoleAction.ManageProducts)&&(0,d.jsx)("div",{className:"border-t-slate-100 border-t border-t-border-subtle space-y-6 bg-surface-subtle text-right sm:p-6",children:(0,d.jsx)(b.default,{label:s({id:"save",defaultMessage:"Save"}),full:!0})})]})})})}],50099);var ex=e.i(37369),eg=e.i(53576);let eh=M.gql`
|
|
346
|
+
mutation CreateProductVariation(
|
|
347
|
+
$productId: ID!
|
|
348
|
+
$variation: CreateProductVariationInput!
|
|
349
|
+
$texts: [ProductVariationTextInput!]
|
|
350
|
+
) {
|
|
351
|
+
createProductVariation(
|
|
352
|
+
productId: $productId
|
|
353
|
+
variation: $variation
|
|
354
|
+
texts: $texts
|
|
355
|
+
) {
|
|
356
|
+
_id
|
|
357
|
+
}
|
|
358
|
+
}
|
|
359
|
+
`,ev=M.gql`
|
|
360
|
+
fragment ProductVariationFragment on ProductVariation {
|
|
361
|
+
_id
|
|
362
|
+
type
|
|
363
|
+
key
|
|
364
|
+
texts(forceLocale: $locale) {
|
|
365
|
+
_id
|
|
366
|
+
locale
|
|
367
|
+
title
|
|
368
|
+
subtitle
|
|
369
|
+
}
|
|
370
|
+
options {
|
|
371
|
+
_id
|
|
372
|
+
texts(forceLocale: $locale) {
|
|
373
|
+
_id
|
|
374
|
+
locale
|
|
375
|
+
title
|
|
376
|
+
subtitle
|
|
377
|
+
}
|
|
378
|
+
value
|
|
379
|
+
}
|
|
380
|
+
}
|
|
381
|
+
`,eb=M.gql`
|
|
382
|
+
query ProductVariations($productId: ID, $slug: String, $locale: Locale) {
|
|
383
|
+
product(productId: $productId, slug: $slug) {
|
|
384
|
+
_id
|
|
385
|
+
... on ConfigurableProduct {
|
|
386
|
+
variations {
|
|
387
|
+
...ProductVariationFragment
|
|
388
|
+
}
|
|
389
|
+
}
|
|
390
|
+
}
|
|
391
|
+
}
|
|
392
|
+
${ev}
|
|
393
|
+
`,ey=M.gql`
|
|
394
|
+
query ProductVariationType {
|
|
395
|
+
variationTypes: __type(name: "ProductVariationType") {
|
|
396
|
+
options: enumValues {
|
|
397
|
+
value: name
|
|
398
|
+
label: description
|
|
399
|
+
}
|
|
400
|
+
}
|
|
401
|
+
}
|
|
402
|
+
`,ej=({helpKey:e,helpText:t,helpValues:a,...s})=>(0,d.jsxs)("div",{className:"space-y-1",children:[(0,d.jsx)(y.default,{...s}),(e||t)&&(0,d.jsx)(E.default,{messageKey:e||`${s.name}_help`,defaultMessage:t,values:a,className:"mt-1"})]});var eI=e.i(95789);let ew=M.gql`
|
|
403
|
+
mutation RemoveProductVariation($productVariationId: ID!) {
|
|
404
|
+
removeProductVariation(productVariationId: $productVariationId) {
|
|
405
|
+
_id
|
|
406
|
+
}
|
|
407
|
+
}
|
|
408
|
+
`;var eM=e.i(42469);let eP=M.gql`
|
|
409
|
+
mutation UpdateProductVariationTexts(
|
|
410
|
+
$productVariationId: ID!
|
|
411
|
+
$productVariationOptionValue: String
|
|
412
|
+
$texts: [ProductVariationTextInput!]!
|
|
413
|
+
) {
|
|
414
|
+
updateProductVariationTexts(
|
|
415
|
+
productVariationId: $productVariationId
|
|
416
|
+
productVariationOptionValue: $productVariationOptionValue
|
|
417
|
+
texts: $texts
|
|
418
|
+
) {
|
|
419
|
+
_id
|
|
420
|
+
}
|
|
421
|
+
}
|
|
422
|
+
`,eN=()=>{let[e]=(0,k.useMutation)(eP);return{updateProductVariationTexts:async({productVariationId:t,productVariationOptionValue:a,texts:s})=>e({variables:{productVariationId:t,productVariationOptionValue:a,texts:s},refetchQueries:["ProductVariations"]})}},e_=({variation:e,onCancel:t,onSuccess:a})=>{let{updateProductVariationTexts:s}=eN(),{formatMessage:l}=(0,o.useIntl)(),{selectedLocale:i}=(0,O.default)(),r=async({title:t,subtitle:l})=>(await s({productVariationId:e._id,texts:[{title:t,subtitle:l,locale:i}]}),a(),{success:!0}),n=(0,I.default)({submit:r,initialValues:{title:e?.texts?.title??"",subtitle:e?.texts?.subtitle??""}});return(0,d.jsx)(g.default,{form:n,className:"variation-update-form bg-surface px-4 py-3 border-b border-border-subtle w-full overflow-x-hidden overflow-y-visible relative hover:outline hover:outline-2 hover:outline-slate-400 dark:hover:outline-slate-500 transition-all","data-variationid":e._id,children:(0,d.jsxs)("div",{className:"flex items-center justify-between w-full gap-4",tabIndex:-1,children:[(0,d.jsxs)("div",{className:"flex items-center gap-4 flex-1 min-w-0 overflow-hidden flex-wrap",children:[(0,d.jsx)("div",{className:"flex-shrink-0 min-w-[180px]",children:(0,d.jsx)(y.default,{className:"mt-0 py-1",name:"title",required:!0,label:l({id:"title",defaultMessage:"Title"})})}),e?.type&&(0,d.jsx)(eM.default,{text:e.type,color:"slate",className:"rounded-md uppercase text-xs font-medium flex-shrink-0"}),(0,d.jsx)("div",{className:"text-sm text-text-muted truncate min-w-[200px]",children:(0,d.jsx)(y.default,{className:"mt-0 py-1",name:"subtitle",label:l({id:"subtitle",defaultMessage:"Subtitle"})})}),e?.options?.length>0&&(0,d.jsx)("div",{className:"flex items-center gap-2 flex-wrap",children:e.options.map((e,t)=>(0,d.jsx)("span",{className:"inline-flex text-nowrap items-center px-2 py-0.5 rounded-lg text-xs font-medium bg-slate-100 dark:bg-slate-900 text-text-secondary border border-border-subtle",children:e?.texts?.title||e.value},e.value||t))}),(0,d.jsxs)("div",{className:"text-sm text-text-muted font-mono flex-shrink-0",children:["(",e?.key,")"]})]}),(0,d.jsxs)("div",{className:"flex space-x-2 flex-shrink-0",children:[(0,d.jsx)(j.default,{onClick:t,type:"button",variant:"secondary",size:"sm",text:l({id:"cancel",defaultMessage:"Cancel"})}),(0,d.jsx)(j.default,{onClick:()=>n.api.submitForm(),type:"submit",variant:"primary",size:"sm",text:l({id:"save",defaultMessage:"Save"})})]})]})})};var ek=e.i(86712),e$=e.i(64481),eC=e.i(37650),eS=e.i(24557);let eT=({type:e,variation:a,onEdit:s,onDelete:l})=>{let[i,r]=(0,t.useState)(!1),{formatMessage:n}=(0,o.useIntl)(),{buttonRef:u,menuRef:c,menuPosition:m}=((e,a)=>{let s=(0,t.useRef)(null),l=(0,t.useRef)(null),[i,d]=(0,t.useState)({top:0,left:0});return(0,t.useEffect)(()=>{let e=e=>{s.current&&!s.current.contains(e.target)&&a(!1)};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[a]),(0,t.useEffect)(()=>{if(e&&l.current){let e=l.current.getBoundingClientRect(),t=e.bottom+4,a=e.right-192;a<8&&(a=8),t+80>window.innerHeight-8&&(t=e.top-80-4),d({top:t,left:a})}},[e]),{buttonRef:l,menuRef:s,menuPosition:i}})(i,r);return(0,d.jsx)("div",{className:"variation-display bg-surface px-4 py-3 border-b border-border-subtle w-full overflow-x-hidden overflow-y-visible relative hover:outline hover:outline-2 hover:outline-slate-400 dark:hover:outline-slate-500 transition-all",children:(0,d.jsxs)("div",{className:"flex items-center justify-between w-full gap-4",tabIndex:-1,children:[(0,d.jsxs)("div",{className:"flex items-center gap-4 flex-1 min-w-0 overflow-hidden",children:[(0,d.jsx)("div",{className:"flex-shrink-0 text-lg font-semibold text-text-primary truncate",children:a?.texts?.title}),e&&(0,d.jsx)(eM.default,{text:e,color:"slate",className:"rounded-md uppercase text-xs font-medium flex-shrink-0"}),a?.texts?.subtitle&&(0,d.jsx)("div",{className:"text-sm text-text-muted truncate",children:a?.texts?.subtitle}),a?.options?.length>0&&(0,d.jsx)("div",{className:"flex items-center gap-2 flex-wrap",children:a.options.map((e,t)=>(0,d.jsx)("span",{className:"inline-flex text-nowrap items-center px-2 py-0.5 rounded-lg text-xs font-medium bg-slate-100 dark:bg-slate-900 text-text-secondary border border-border-subtle",children:e?.texts?.title||e.value},e.value||t))}),(0,d.jsxs)("div",{className:"text-sm text-text-muted font-mono flex-shrink-0",children:["(",a?.key,")"]})]}),(0,d.jsxs)("div",{className:"relative flex-shrink-0",children:[(0,d.jsx)("button",{ref:u,type:"button",onClick:e=>{e.stopPropagation(),e.preventDefault(),r(e=>!e)},className:"flex items-center justify-center w-8 h-8 rounded-md hover:bg-surface-raised transition-colors",children:(0,d.jsx)(ek.EllipsisHorizontalIcon,{className:"w-5 h-5 text-text-muted"})}),i&&(0,d.jsx)(e$.default,{children:(0,d.jsx)("div",{ref:c,className:"fixed w-48 bg-surface rounded-md shadow-xl border border-border-subtle z-[9999]",style:{top:m.top,left:m.left,boxShadow:"0 10px 25px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05)"},children:(0,d.jsxs)("div",{className:"py-1",children:[(0,d.jsxs)("button",{type:"button",onClick:e=>{e.stopPropagation(),e.preventDefault(),s(),r(!1)},className:"flex items-center w-full px-4 py-2 text-sm text-text-secondary hover:bg-surface-raised transition-colors",children:[(0,d.jsx)(eC.PencilSquareIcon,{className:"mr-3 h-5 w-5"}),n({id:"edit",defaultMessage:"Edit"})]}),(0,d.jsxs)("button",{type:"button",onClick:e=>{e.stopPropagation(),e.preventDefault(),l(a._id),r(!1)},className:"flex items-center w-full px-4 py-2 text-sm text-danger hover:bg-rose-50 dark:hover:bg-rose-900/20 transition-colors",children:[(0,d.jsx)(eS.TrashIcon,{className:"mr-3 h-5 w-5"}),n({id:"delete",defaultMessage:"Delete"})]})]})})})]})]})})},eq=({type:e,variation:a,onDelete:s})=>{let[l,i]=(0,t.useState)(!1);return l?(0,d.jsx)(e_,{variation:a,onCancel:()=>i(!1),onSuccess:()=>i(!1)}):(0,d.jsx)(eT,{type:e,variation:a,onEdit:()=>i(!0),onDelete:s})},eR=M.gql`
|
|
423
|
+
mutation CreateProductVariationOption(
|
|
424
|
+
$productVariationId: ID!
|
|
425
|
+
$option: String!
|
|
426
|
+
$texts: [ProductVariationTextInput!]
|
|
427
|
+
) {
|
|
428
|
+
createProductVariationOption(
|
|
429
|
+
productVariationId: $productVariationId
|
|
430
|
+
option: $option
|
|
431
|
+
texts: $texts
|
|
432
|
+
) {
|
|
433
|
+
_id
|
|
434
|
+
}
|
|
435
|
+
}
|
|
436
|
+
`,eA=M.gql`
|
|
437
|
+
mutation RemoveProductVariationOption(
|
|
438
|
+
$productVariationId: ID!
|
|
439
|
+
$productVariationOptionValue: String!
|
|
440
|
+
) {
|
|
441
|
+
removeProductVariationOption(
|
|
442
|
+
productVariationId: $productVariationId
|
|
443
|
+
productVariationOptionValue: $productVariationOptionValue
|
|
444
|
+
) {
|
|
445
|
+
_id
|
|
446
|
+
}
|
|
447
|
+
}
|
|
448
|
+
`,eD=({onSubmit:e})=>{let{formatMessage:t}=(0,o.useIntl)(),{hasRole:a}=(0,u.default)(),s=t({id:"variation_option_added",defaultMessage:"Variation option added successfully!"}),l=(0,I.default)({submit:e,successMessage:s,initialValues:{value:"",title:""}});return(0,d.jsxs)(g.default,{form:l,className:"variation-option-form relative overflow-visible",children:[(0,d.jsx)("div",{className:"mb-4 px-2 sm:px-4 pt-2",children:(0,d.jsx)("div",{className:"p-3 bg-surface-subtle/20 rounded-lg border border-border-subtle",children:(0,d.jsx)("p",{className:"text-sm text-text-secondary",children:t({id:"variation_options_explanation",defaultMessage:'Add individual choices for this variation (e.g., "Red", "Blue", "Green" for a Color variation)'})})})}),(0,d.jsxs)("div",{className:"grid lg:grid-cols-2 gap-3 px-2 sm:px-4 sm:pb-4",children:[(0,d.jsx)("div",{className:"col-span-1",children:(0,d.jsx)(ej,{className:"mt-2 pt-1",name:"title",label:t({id:"title",defaultMessage:"Title"}),helpText:t({id:"variation_option_title_help",defaultMessage:'Display name customers see (e.g., "Red", "Large", "Cotton")'}),required:!0})}),(0,d.jsx)("div",{className:"col-span-1",children:(0,d.jsx)(ej,{className:"mt-2 pt-1",name:"value",label:t({id:"value",defaultMessage:"Value"}),helpText:t({id:"variation_option_value_help",defaultMessage:'Internal identifier (e.g., "red", "large", "cotton")'}),required:!0})})]}),a(r.IRoleAction.ManageProducts)&&(0,d.jsx)("div",{className:"text-right mt-2 px-6 pb-6",children:(0,d.jsx)(b.default,{className:"py-2.5",label:t({id:"add_variation_option",defaultMessage:"Add option"})})})]})};var eV=e.i(3095);let eE=({option:e,onDelete:a,variationId:s})=>{let{formatMessage:l}=(0,o.useIntl)(),{selectedLocale:i}=(0,O.default)(),[r,n]=(0,t.useState)(!1),u=l({id:"variation_option_updated",defaultMessage:"Variation option updated successfully!"}),{updateProductVariationTexts:c}=eN(),m=async({title:t,subtitle:a})=>{let l=await c({productVariationId:s,productVariationOptionValue:e.value,texts:[{title:t,subtitle:a,locale:i}]});return n(!1),{data:l,success:!0}},p=(0,I.default)({submit:m,successMessage:u,initialValues:{title:e?.texts?.title,subtitle:e?.texts?.subtitle}});return(0,d.jsx)(g.default,{form:p,className:"last:pb-2 variation-option-update-form relative overflow-visible",children:(0,d.jsx)("div",{className:"my-2 rounded-sm border dark:border-slate-700 mx-4 ",children:(0,d.jsx)("div",{className:"p-2 bg-surface-input dark:text-slate-200",children:(0,d.jsxs)("div",{className:"flex gap-2 w-full items-center justify-between",children:[(0,d.jsx)(eM.default,{text:e?.value,color:"slate",className:"rounded-md"}),(0,d.jsxs)("div",{className:"flex items-center gap-4 w-full",children:[(0,d.jsx)("p",{className:"truncate text-sm font-medium text-slate-900 dark:text-slate-400",children:r?(0,d.jsx)(y.default,{className:"mt-0",name:"title",required:!0,label:l({id:"title",defaultMessage:"Title"})}):e?.texts?.title}),(0,d.jsx)("p",{className:"truncate text-sm text-slate-500",children:r?(0,d.jsx)(y.default,{className:"mt-0",name:"subtitle",label:l({id:"subtitle",defaultMessage:"Subtitle"})}):e?.texts?.subtitle})]}),(0,d.jsx)("div",{className:"flex items-center justify-end ml-auto",children:r?(0,d.jsxs)("div",{className:"flex space-x-2 py-2",children:[(0,d.jsx)("button",{onClick:()=>n(!r),"aria-label":l({id:"cancel",defaultMessage:"Cancel"}),type:"button",className:"inline-flex items-center justify-center font-medium shadow-sm focus:outline-hidden focus:ring-2 focus:ring-offset-2 transition-colors duration-200 disabled:cursor-not-allowed disabled:opacity-50 px-3 py-2 text-sm h-8 rounded-md border border-border-default bg-surface text-text-secondary hover:bg-surface-raised focus:ring-focus-ring",children:l({id:"cancel",defaultMessage:"Cancel"})}),(0,d.jsx)("button",{type:"submit","aria-label":l({id:"save",defaultMessage:"Save"}),className:"inline-flex items-center justify-center font-medium shadow-sm focus:outline-hidden focus:ring-2 focus:ring-offset-2 transition-colors duration-200 disabled:cursor-not-allowed disabled:opacity-50 px-3 py-2 text-sm h-8 rounded-md border border-accent bg-accent text-text-on-accent hover:bg-accent-hover focus:ring-focus-ring",children:l({id:"save",defaultMessage:"Save"})})]}):(0,d.jsx)(eV.default,{onEdit:()=>{n(!0)},onDelete:()=>{a(e.value)},showEdit:!0,showDelete:!0})})]})})})})},eO=({variationId:e,options:t})=>{let{createProductVariationOption:a}=(()=>{let[e]=(0,k.useMutation)(eR);return{createProductVariationOption:async({productVariationId:t,option:a,texts:s})=>e({variables:{productVariationId:t,option:a,texts:s},refetchQueries:["ProductVariations","Product"]})}})(),{formatMessage:s}=(0,o.useIntl)(),{selectedLocale:l}=(0,O.default)(),{setModal:i}=(0,el.default)(),{removeProductVariationOption:r}=(()=>{let[e]=(0,k.useMutation)(eA);return{removeProductVariationOption:async({productVariationId:t,productVariationOptionValue:a})=>e({variables:{productVariationId:t,productVariationOptionValue:a},refetchQueries:["ProductVariations"]})}})(),n=async t=>{await i((0,d.jsx)(ea.default,{message:s({id:"delete_variation_option_confirmation",defaultMessage:"This action might cause inconsistencies with other data that relates to it. Are you sure you want to delete this option? "}),onCancelClick:()=>i(""),onOkClick:async()=>{i(""),await r({productVariationId:e,productVariationOptionValue:t}),L.toast.success(s({id:"product_variation_option_deleted",defaultMessage:"Variation option deleted successfully"}))},okText:s({id:"delete_variation_option",defaultMessage:"Delete option"})}))},u=async({value:t,title:s})=>(await a({productVariationId:e,option:t,texts:[{title:s,locale:l}]}),{success:!0});return(0,d.jsxs)("div",{className:"relative overflow-visible",children:[(0,d.jsx)(eD,{onSubmit:u}),t.length?t.map(t=>(0,d.jsx)(eE,{variationId:e,option:t,onDelete:n},t._id)):(0,d.jsx)(X.default,{message:s({id:"option",defaultMessage:"Option"})})]})},eU=({productVariationId:e,variation:t})=>{let{formatMessage:a}=(0,o.useIntl)(),{setModal:s}=(0,el.default)(),{options:l}=t,{removeProductVariation:i}=(()=>{let[e]=(0,k.useMutation)(ew);return{removeProductVariation:async({productVariationId:t})=>e({variables:{productVariationId:t},refetchQueries:["ProductVariations"]})}})(),r=async()=>{await s((0,d.jsx)(ea.default,{onCancelClick:async()=>s(""),message:a({id:"delete_product_variation_confirmation",defaultMessage:"This action might cause inconsistencies with other data that relates to it. Are you sure you want to delete this variation? "}),onOkClick:async()=>{s(""),await i({productVariationId:e}),L.toast.success(a({id:"product_variation_deleted",defaultMessage:"Variation deleted successfully"}))},okText:a({id:"delete_product_variation",defaultMessage:"Delete variation"})}))},n=[{header:(0,d.jsx)(eq,{onDelete:r,variation:t,...t}),body:(0,d.jsx)(eO,{variationId:t._id,options:l},e)}];return(0,d.jsx)(eI.default,{"data-variationid":t._id,data:n,containerCSS:"w-full max-w-full !my-0 !border-0 !shadow-none relative",bodyCSS:"bg-surface-subtle !border-t-0 relative overflow-visible",itemContainerCSS:"!mt-0 !mb-0 !border-0",headerCSS:"w-full flex items-center justify-between !p-0 !bg-transparent !border-0",hideChevron:!0})},eL=({onSubmit:e,disabled:t,formatMessage:a})=>{let{variationTypes:s}=(()=>{let{data:e,loading:t,error:a}=(0,P.useQuery)(ey);return{variationTypes:e?.variationTypes?.options||[],loading:t,error:a}})(),{hasRole:l}=(0,u.default)(),i=a({id:"product_variation_added",defaultMessage:"Product variation added successfully"}),n=(0,I.default)({disabled:t,submit:e,successMessage:i,initialValues:{title:"",key:"",type:""}});return(0,d.jsxs)("div",{children:[(0,d.jsxs)("div",{className:"mb-6",children:[(0,d.jsx)("h3",{className:"text-lg font-semibold text-text-primary mb-2",children:a({id:"product_variations_explanation_title",defaultMessage:"About Product Variations"})}),(0,d.jsx)("p",{className:"text-sm text-text-secondary",children:a({id:"product_variations_explanation",defaultMessage:"Variations allow customers to choose different options for your product (like color, size, material). Each variation can have multiple options that customers can select from."})})]}),(0,d.jsxs)(g.default,{form:n,children:[(0,d.jsxs)("div",{className:"space-y-6",children:[(0,d.jsx)(ej,{name:"title",id:"title",label:a({id:"title",defaultMessage:"Title"}),helpText:a({id:"product_variation_title_help",defaultMessage:'The display name customers will see (e.g., "Color", "Size", "Material")'}),required:!0,autoComplete:"on",className:"w-full"}),(0,d.jsx)(ej,{name:"key",id:"key",label:a({id:"key",defaultMessage:"Key"}),helpText:a({id:"product_variation_key_help",defaultMessage:'Unique identifier used internally (e.g., "color", "size"). Use lowercase without spaces.'}),required:!0,autoComplete:"on",className:"w-full"}),(0,d.jsxs)("div",{children:[(0,d.jsx)(v.default,{required:!0,className:"w-full",label:a({id:"type",defaultMessage:"Type"}),placeholder:a({id:"type",defaultMessage:"Type"}),name:"type",options:(0,m.default)(s,"value","value")}),(0,d.jsx)(E.default,{messageKey:"product_variation_type_help",defaultMessage:"COLOR: For predefined options like colors or sizes. TEXT: For free-form input like custom text or measurements.",className:"mt-1"})]})]}),l(r.IRoleAction.ManageProducts)&&(0,d.jsx)("div",{className:"flex justify-end mt-6 py-6 -mb-6 bg-slate-100 -mx-6 pe-5 border-t border-border-subtle bg-surface-subtle",children:(0,d.jsx)(b.default,{label:a({id:"add_variation",defaultMessage:"Add variation"})})})]})]})};e.s(["default",0,({productId:e,disabled:t=!1})=>{let{createProductVariation:a}=(()=>{let[e]=(0,k.useMutation)(eh);return{createProductVariation:async({productId:t,variation:{key:a,type:s},texts:l})=>e({variables:{productId:t,variation:{key:a,type:s},texts:l},refetchQueries:["ProductVariations"]})}})(),{selectedLocale:s}=(0,O.default)(),{formatMessage:l}=(0,o.useIntl)(),{setModal:i}=(0,el.default)(),{variations:r,loading:n}=(({productId:e=null,slug:t=null,locale:a=null}={})=>{let s=(0,W.parseUniqueId)(t),{data:l,loading:i,error:d}=(0,P.useQuery)(eb,{skip:!e&&!s,variables:{productId:e||s,locale:a}}),r=l?.product;return{variations:r?.variations,loading:i,error:d}})({productId:e,locale:s}),u=async({title:t,key:l,type:d})=>(await a({productId:e,variation:{key:l,type:d},texts:[{title:t,locale:s}]}),i(""),{success:!0});return n?(0,d.jsx)(eg.default,{}):(0,d.jsxs)("div",{className:"mt-6 overflow-hidden rounded-md w-full max-w-full",children:[(0,d.jsx)("div",{className:"mb-6 flex justify-end items-center",children:(0,d.jsx)(j.default,{className:"m-1",onClick:()=>{i((0,d.jsx)(eL,{onSubmit:u,disabled:t,formatMessage:l}))},disabled:t,variant:"secondary",icon:(0,d.jsx)(ex.PlusIcon,{className:"w-5 h-5"}),text:l({id:"add_variation",defaultMessage:"Add variation"})})}),(0,d.jsx)("div",{className:"flex flex-col border border-border-subtle rounded-md overflow-x-hidden overflow-y-visible w-full relative",children:r?.length?r?.map(e=>(0,d.jsx)(eU,{productVariationId:e._id,variation:e},e._id)):(0,d.jsx)(X.default,{message:l({id:"variations",defaultMessage:"Variations"})})})]})}],77035);let eF=M.gql`
|
|
449
|
+
query ProductWarehousing($productId: ID, $slug: String) {
|
|
450
|
+
product(productId: $productId, slug: $slug) {
|
|
451
|
+
_id
|
|
452
|
+
... on SimpleProduct {
|
|
453
|
+
sku
|
|
454
|
+
baseUnit
|
|
455
|
+
}
|
|
456
|
+
}
|
|
457
|
+
}
|
|
458
|
+
`,eQ=M.gql`
|
|
459
|
+
mutation UpdateProductWarehousing(
|
|
460
|
+
$productId: ID!
|
|
461
|
+
$warehousing: UpdateProductWarehousingInput!
|
|
462
|
+
) {
|
|
463
|
+
updateProductWarehousing(productId: $productId, warehousing: $warehousing) {
|
|
464
|
+
_id
|
|
465
|
+
... on SimpleProduct {
|
|
466
|
+
sku
|
|
467
|
+
baseUnit
|
|
468
|
+
}
|
|
469
|
+
}
|
|
470
|
+
}
|
|
471
|
+
`;e.s(["default",0,({productId:e,disabled:a=!1})=>{let{formatMessage:s}=(0,o.useIntl)(),{product:l}=(({productId:e=null,slug:t=null}={})=>{let a=(0,W.parseUniqueId)(t),{data:s,loading:l,error:i}=(0,P.useQuery)(eF,{skip:!e&&!a,variables:{productId:e||a}});return{product:s?.product||{},loading:l,error:i}})({productId:e}),{hasRole:i}=(0,u.default)(),{updateProductWarehousing:n}=(()=>{let[e]=(0,k.useMutation)(eQ);return{updateProductWarehousing:async({productId:t,warehousing:{sku:a=null,baseUnit:s=null}})=>e({variables:{productId:t,warehousing:{sku:a,baseUnit:s}},refetchQueries:["Products"]})}})(),m=s({id:"saved",defaultMessage:"Saved"}),p=async({sku:t,baseUnit:a})=>({data:await n({productId:e,warehousing:{baseUnit:a,sku:t}}),success:!0}),f=(0,I.default)({disabled:a,submit:p,successMessage:m,initialValues:{sku:"",baseUnit:""}});return(0,t.useEffect)(()=>{Object.keys(l).length&&f.api.setValues({...l})},[l]),(0,d.jsx)("div",{className:"mt-5 md:mt-0",children:(0,d.jsx)(c.default,{children:(0,d.jsxs)(g.default,{className:"rounded",form:f,disabled:!i(r.IRoleAction.ManageProducts),children:[(0,d.jsx)("div",{className:"relative px-4 pb-5 sm:p-6",children:(0,d.jsxs)("div",{className:"w-full justify-between align-baseline lg:flex gap-6",children:[(0,d.jsx)(y.default,{name:"sku",disabled:!i(r.IRoleAction.ManageProducts),id:"sku",label:s({id:"sku",defaultMessage:"SKU"}),className:"mb-4 text-sm"}),(0,d.jsx)(y.default,{name:"baseUnit",id:"baseUnit",disabled:!i(r.IRoleAction.ManageProducts),label:s({id:"baseUnit",defaultMessage:"Base Unit"}),className:"text-sm"})]})}),i(r.IRoleAction.ManageProducts)&&(0,d.jsx)("div",{className:"border-t-slate-100 border-t border-t-border-subtle space-y-6 bg-surface-subtle text-right sm:p-6",children:(0,d.jsx)(b.default,{label:s({id:"save",defaultMessage:"Save"})})})]})})})}],56902);var eB=e.i(56417),ez=e.i(27028),eK=e.i(3883),eH=e.i(84818);let eW=M.gql`
|
|
472
|
+
query ProductFulfillmentSimulation(
|
|
473
|
+
$productId: ID
|
|
474
|
+
$deliveryProviderType: DeliveryProviderType
|
|
475
|
+
$quantity: Int
|
|
476
|
+
$referenceDate: Timestamp
|
|
477
|
+
) {
|
|
478
|
+
product(productId: $productId) {
|
|
479
|
+
_id
|
|
480
|
+
... on SimpleProduct {
|
|
481
|
+
simulatedDispatches(
|
|
482
|
+
deliveryProviderType: $deliveryProviderType
|
|
483
|
+
quantity: $quantity
|
|
484
|
+
referenceDate: $referenceDate
|
|
485
|
+
) {
|
|
486
|
+
shipping
|
|
487
|
+
earliestDelivery
|
|
488
|
+
deliveryProvider {
|
|
489
|
+
_id
|
|
490
|
+
type
|
|
491
|
+
isActive
|
|
492
|
+
interface {
|
|
493
|
+
_id
|
|
494
|
+
label
|
|
495
|
+
version
|
|
496
|
+
}
|
|
497
|
+
}
|
|
498
|
+
warehousingProvider {
|
|
499
|
+
_id
|
|
500
|
+
type
|
|
501
|
+
isActive
|
|
502
|
+
interface {
|
|
503
|
+
_id
|
|
504
|
+
label
|
|
505
|
+
version
|
|
506
|
+
}
|
|
507
|
+
}
|
|
508
|
+
}
|
|
509
|
+
simulatedStocks(
|
|
510
|
+
deliveryProviderType: $deliveryProviderType
|
|
511
|
+
referenceDate: $referenceDate
|
|
512
|
+
) {
|
|
513
|
+
quantity
|
|
514
|
+
deliveryProvider {
|
|
515
|
+
_id
|
|
516
|
+
type
|
|
517
|
+
interface {
|
|
518
|
+
_id
|
|
519
|
+
label
|
|
520
|
+
}
|
|
521
|
+
}
|
|
522
|
+
warehousingProvider {
|
|
523
|
+
_id
|
|
524
|
+
interface {
|
|
525
|
+
_id
|
|
526
|
+
label
|
|
527
|
+
}
|
|
528
|
+
}
|
|
529
|
+
}
|
|
530
|
+
}
|
|
531
|
+
}
|
|
532
|
+
}
|
|
533
|
+
`,eZ=(e,t)=>e?.deliveryProvider?._id===t?.deliveryProvider?._id&&e?.warehousingProvider?._id===t?.warehousingProvider?._id,eG="w-full rounded-md border-1 border-border-default bg-surface-input px-3 py-2 text-sm shadow-xs text-text-primary focus:outline-hidden focus:ring-2 focus:ring-focus-ring",eX=e=>[e?.interface?.label,e?.interface?.version].filter(Boolean).join(" ")||e?._id||null;e.s(["default",0,({productId:e})=>{let{formatMessage:a}=(0,o.useIntl)(),{formatDateTime:s}=(0,eH.default)(),[l,i]=(0,t.useState)(1),[n,u]=(0,t.useState)(null),[c,m]=(0,t.useState)(""),{dispatches:p,unroutedStocks:f,loading:x,error:g}=(({productId:e,deliveryProviderType:a=null,quantity:s=null,referenceDate:l=null})=>{let{data:i,loading:d,error:r}=(0,P.useQuery)(eW,{skip:!e,variables:{productId:e,deliveryProviderType:a,quantity:s,referenceDate:l},errorPolicy:"all"}),{dispatches:n,unroutedStocks:o}=(0,t.useMemo)(()=>{let e=i?.product||{},t=(e?.simulatedDispatches||[]).filter(e=>!a||e?.deliveryProvider?.type===a),s=(e?.simulatedStocks||[]).filter(e=>!a||!e?.deliveryProvider?.type||e?.deliveryProvider?.type===a);return{dispatches:t.map(e=>({...e,stockQuantity:s.find(t=>eZ(t,e))?.quantity??null})),unroutedStocks:s.filter(e=>!t.some(t=>eZ(e,t)))}},[i,a]);return{dispatches:n,unroutedStocks:o,loading:d,error:r}})({productId:e,quantity:l,referenceDate:n?new Date(n).getTime():null,deliveryProviderType:c||null});return(0,d.jsxs)("div",{className:"mt-5 md:mt-0 space-y-6",children:[(0,d.jsx)("div",{children:(0,d.jsx)(E.default,{messageKey:"fulfillment_preview_description",defaultMessage:"Preview which delivery and warehousing providers the engine would use to fulfill this product, exactly as calculated during checkout."})}),(0,d.jsxs)("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-3 max-w-2xl",children:[(0,d.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,d.jsx)("label",{htmlFor:"simulation-quantity",className:"text-sm font-medium text-text-secondary",children:a({id:"quantity",defaultMessage:"Quantity"})}),(0,d.jsx)("input",{type:"number",id:"simulation-quantity",min:1,value:l,onChange:e=>i(Math.max(1,Number(e.target.value))),className:eG})]}),(0,d.jsx)(eK.default,{id:"simulation-reference-date",label:a({id:"simulate_as_of",defaultMessage:"Simulate as of"}),value:n,onChange:u}),(0,d.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,d.jsx)("label",{htmlFor:"simulation-delivery-type",className:"text-sm font-medium text-text-secondary",children:a({id:"delivery_type",defaultMessage:"Delivery type"})}),(0,d.jsxs)("select",{id:"simulation-delivery-type",value:c,onChange:e=>m(e.target.value),className:eG,children:[(0,d.jsx)("option",{value:"",children:a({id:"all_types",defaultMessage:"All types"})}),Object.values(r.IDeliveryProviderType).map(e=>(0,d.jsx)("option",{value:e,children:a({id:e,defaultMessage:e,description:"Delivery provider type"})},e))]})]})]}),x?(0,d.jsx)(eg.default,{}):!g||p.length||f.length?p.length||f.length?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("div",{className:"grid grid-cols-1 gap-4 lg:grid-cols-2",children:p.map((e,t)=>(0,d.jsxs)("div",{className:"rounded-lg border border-border-default bg-surface p-4 shadow-xs",children:[(0,d.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,d.jsxs)("div",{className:"flex items-center gap-2 min-w-0",children:[(0,d.jsx)(eB.TruckIcon,{className:"h-5 w-5 shrink-0 text-text-muted"}),(0,d.jsx)("span",{className:"truncate text-sm font-semibold text-text-primary",children:eX(e?.deliveryProvider)||a({id:"unknown_delivery_provider",defaultMessage:"Unknown delivery provider"})})]}),e?.deliveryProvider?.type&&(0,d.jsx)(eM.default,{text:a({id:e.deliveryProvider.type,defaultMessage:e.deliveryProvider.type,description:"Delivery provider type"}),color:"sky",square:!0})]}),(0,d.jsxs)("dl",{className:"mt-4 space-y-2 text-sm",children:[(0,d.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,d.jsx)("dt",{className:"text-text-muted",children:a({id:"warehouse",defaultMessage:"Warehouse"})}),(0,d.jsxs)("dd",{className:"flex items-center gap-1 text-text-primary truncate",children:[(0,d.jsx)(ez.BuildingStorefrontIcon,{className:"h-4 w-4 shrink-0 text-text-muted"}),eX(e?.warehousingProvider)||"n/a"]})]}),(0,d.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,d.jsx)("dt",{className:"text-text-muted",children:a({id:"ships",defaultMessage:"Ships"})}),(0,d.jsx)("dd",{className:"text-text-primary",children:s(e?.shipping,{dateStyle:"medium",timeStyle:"short"})})]}),(0,d.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,d.jsx)("dt",{className:"text-text-muted",children:a({id:"earliest_delivery",defaultMessage:"Earliest delivery"})}),(0,d.jsx)("dd",{className:"text-text-primary",children:s(e?.earliestDelivery,{dateStyle:"medium",timeStyle:"short"})})]}),e?.stockQuantity!==null&&(0,d.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,d.jsx)("dt",{className:"text-text-muted",children:a({id:"stock",defaultMessage:"Stock"})}),(0,d.jsx)("dd",{className:"font-semibold text-text-primary",children:a({id:"units_available",defaultMessage:"{quantity} units available"},{quantity:e.stockQuantity})})]})]})]},`${e?.deliveryProvider?._id}-${e?.warehousingProvider?._id}-${t}`))}),f.length>0&&(0,d.jsxs)("div",{children:[(0,d.jsx)("h3",{className:"text-sm font-semibold text-text-primary",children:a({id:"stock_without_dispatch_route",defaultMessage:"Stock without a dispatch route"})}),(0,d.jsx)("p",{className:"mt-1 text-sm text-text-muted",children:a({id:"stock_without_dispatch_route_hint",defaultMessage:"Inventory is reported for these provider combinations, but the engine could not calculate a dispatch for them."})}),(0,d.jsx)("ul",{className:"mt-3 space-y-2",children:f.map((e,t)=>(0,d.jsxs)("li",{className:"flex items-center justify-between gap-2 rounded-md border border-border-subtle bg-surface-subtle px-3 py-2 text-sm",children:[(0,d.jsxs)("span",{className:"truncate text-text-secondary",children:[eX(e?.warehousingProvider)||"n/a",e?.deliveryProvider&&` — ${eX(e.deliveryProvider)}`]}),(0,d.jsx)("span",{className:"font-semibold text-text-primary",children:a({id:"units_available",defaultMessage:"{quantity} units available"},{quantity:e?.quantity??0})})]},`${e?.deliveryProvider?._id}-${e?.warehousingProvider?._id}-${t}`))})]})]}):(0,d.jsxs)("div",{children:[(0,d.jsx)(X.default,{message:a({id:"dispatch_routes",defaultMessage:"dispatch routes"}),Icon:(0,d.jsx)(eB.TruckIcon,{className:"h-6 w-6"})}),(0,d.jsx)("p",{className:"mt-3 text-sm text-text-muted",children:a({id:"fulfillment_preview_empty_hint",defaultMessage:"The engine could not simulate any dispatch for this product. Customers will not see delivery options for it. Verify that at least one delivery provider and one warehousing provider are configured, active and free of configuration errors."})})]}):(0,d.jsxs)("div",{className:"text-sm text-danger",children:[a({id:"fulfillment_simulation_error",defaultMessage:"Fulfillment simulation failed"}),": ",g.message]})]})}],72264);var eJ=r;let eY=M.gql`
|
|
534
|
+
fragment ProductReviewDetailFragment on ProductReview {
|
|
535
|
+
_id
|
|
536
|
+
created
|
|
537
|
+
updated
|
|
538
|
+
deleted
|
|
539
|
+
author {
|
|
540
|
+
_id
|
|
541
|
+
username
|
|
542
|
+
name
|
|
543
|
+
profile {
|
|
544
|
+
displayName
|
|
545
|
+
address {
|
|
546
|
+
firstName
|
|
547
|
+
lastName
|
|
548
|
+
}
|
|
549
|
+
}
|
|
550
|
+
isGuest
|
|
551
|
+
avatar {
|
|
552
|
+
_id
|
|
553
|
+
|
|
554
|
+
url
|
|
555
|
+
}
|
|
556
|
+
}
|
|
557
|
+
product {
|
|
558
|
+
_id
|
|
559
|
+
texts(forceLocale: $forceLocale) {
|
|
560
|
+
_id
|
|
561
|
+
title
|
|
562
|
+
subtitle
|
|
563
|
+
}
|
|
564
|
+
media {
|
|
565
|
+
_id
|
|
566
|
+
file {
|
|
567
|
+
_id
|
|
568
|
+
url
|
|
569
|
+
}
|
|
570
|
+
}
|
|
571
|
+
}
|
|
572
|
+
rating
|
|
573
|
+
title
|
|
574
|
+
review
|
|
575
|
+
upVote: voteCount(type: UPVOTE)
|
|
576
|
+
downVote: voteCount(type: DOWNVOTE)
|
|
577
|
+
voteReport: voteCount(type: REPORT)
|
|
578
|
+
ownVotes {
|
|
579
|
+
timestamp
|
|
580
|
+
type
|
|
581
|
+
}
|
|
582
|
+
}
|
|
583
|
+
`,e0=M.gql`
|
|
584
|
+
query ProductReviewByProduct(
|
|
585
|
+
$productId: ID
|
|
586
|
+
$slug: String
|
|
587
|
+
$limit: Int
|
|
588
|
+
$offset: Int
|
|
589
|
+
$sort: [SortOptionInput!]
|
|
590
|
+
$forceLocale: Locale
|
|
591
|
+
) {
|
|
592
|
+
product(productId: $productId, slug: $slug) {
|
|
593
|
+
_id
|
|
594
|
+
reviews(limit: $limit, offset: $offset, sort: $sort) {
|
|
595
|
+
...ProductReviewDetailFragment
|
|
596
|
+
}
|
|
597
|
+
reviewsCount
|
|
598
|
+
}
|
|
599
|
+
}
|
|
600
|
+
${eY}
|
|
601
|
+
`;var e1=e.i(66859),e5=e.i(39833),e2=e.i(84339);let e3=t.forwardRef(function({title:e,titleId:a,...s},l){return t.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:l,"aria-labelledby":a},s),e?t.createElement("title",{id:a},e):null,t.createElement("path",{fillRule:"evenodd",d:"M10.788 3.21c.448-1.077 1.976-1.077 2.424 0l2.082 5.006 5.404.434c1.164.093 1.636 1.545.749 2.305l-4.117 3.527 1.257 5.273c.271 1.136-.964 2.033-1.96 1.425L12 18.354 7.373 21.18c-.996.608-2.231-.29-1.96-1.425l1.257-5.273-4.117-3.527c-.887-.76-.415-2.212.749-2.305l5.404-.434 2.082-5.005Z",clipRule:"evenodd"}))}),e4=({productReviews:e})=>{let{formatMessage:t}=(0,o.useIntl)(),a=e.reduce((e,t)=>e+t.upVote,0),s=e.reduce((e,t)=>e+t.downVote,0),l=a?a/(a+s)*100:0,i=l?100-l:0;return(0,d.jsxs)("div",{className:"lg:col-span-4",children:[(0,d.jsx)("h2",{className:"text-2xl",children:t({id:"customer_reviews",defaultMessage:"Customer Reviews"})}),(0,d.jsxs)("div",{className:"mt-3 flex items-center",children:[(0,d.jsx)("div",{children:(0,d.jsx)("div",{title:`${l}`,className:"flex items-center",children:[0,1,2,3,4].map(e=>{let t=l>=20*e;return(0,d.jsx)(e3,{className:`
|
|
602
|
+
${t?"text-amber-400":"text-slate-300 dark:text-slate-600"}
|
|
603
|
+
h-5 w-5 shrink-0
|
|
604
|
+
`,"aria-hidden":"true"},e)})})}),(0,d.jsx)("div",{className:"ml-2 text-sm",children:(0,d.jsx)(o.FormattedMessage,{id:"review_summary",defaultMessage:"<div> Based on <cta> {total} </cta> reviews</div>",values:{div:e=>(0,d.jsx)("div",{children:e}),cta:e=>(0,d.jsx)("b",{className:"font-semibold",children:e}),total:e.length}})})]}),(0,d.jsxs)("div",{className:"mt-6",children:[(0,d.jsx)("h3",{className:"sr-only",children:t({id:"review_data",defaultMessage:"Review data"})}),(0,d.jsxs)("dl",{className:"space-y-3",children:[(0,d.jsxs)("div",{className:"flex items-center text-sm",children:[(0,d.jsxs)("dt",{className:"flex flex-1 items-center",children:[(0,d.jsx)("p",{className:"font-medium",children:a}),(0,d.jsxs)("div",{"aria-hidden":"true",className:"ml-2 flex flex-1 items-center",children:[(0,d.jsx)(e2.HandThumbUpIcon,{className:`
|
|
605
|
+
${a>0?"text-emerald-500":"text-slate-500"}
|
|
606
|
+
h-5 w-5 shrink-0`,"aria-hidden":"true"}),(0,d.jsxs)("div",{className:"relative ml-3 flex-1",children:[(0,d.jsx)("div",{className:"h-3 rounded-full border border-border-default bg-surface-subtle"}),a>0?(0,d.jsx)("div",{className:"absolute inset-y-0 rounded-full border border-emerald-500 bg-emerald-500",style:{width:`calc(${l}%)`}}):null]})]})]}),(0,d.jsxs)("dd",{className:"ml-3 w-10 text-right text-sm tabular-nums",children:[Math.round(l),"%"]})]}),(0,d.jsxs)("div",{className:"flex items-center text-sm",children:[(0,d.jsxs)("dt",{className:"flex flex-1 items-center",children:[(0,d.jsxs)("p",{className:"font-medium",children:[s,(0,d.jsx)("span",{className:"sr-only",children:t({id:"star_reviews",defaultMessage:"Star reviews"})})]}),(0,d.jsxs)("div",{"aria-hidden":"true",className:"ml-2 flex flex-1 items-center",children:[(0,d.jsx)(e5.HandThumbDownIcon,{className:`
|
|
607
|
+
${s>0?"text-rose-500":"text-slate-500"}
|
|
608
|
+
h-5 w-5 shrink-0
|
|
609
|
+
`,"aria-hidden":"true"}),(0,d.jsxs)("div",{className:"relative ml-3 flex-1",children:[(0,d.jsx)("div",{className:"h-3 rounded-full border border-border-default bg-surface-subtle"}),s>0?(0,d.jsx)("div",{className:"absolute inset-y-0 rounded-full border border-rose-500 bg-rose-500",style:{width:`calc(${i}%)`}}):null]})]})]}),(0,d.jsxs)("dd",{className:"ml-3 w-10 text-right text-sm tabular-nums",children:[Math.round(i),"%"]})]})]})]})]})};var e6=e.i(87213);let e9=({onSubmit:e,onSubmitSuccess:t=null,defaultValue:a={},isEdit:s=!1})=>{let{formatMessage:l}=(0,o.useIntl)(),{hasRole:i}=(0,u.default)(),n=l({id:"product_review_added",defaultMessage:"Review added successfully!"}),c=l({id:"product_review_updated",defaultMessage:"Review updated successfully!"}),m=(0,I.default)({submit:e,onSubmitSuccess:t,successMessage:s?c:n,initialValues:{title:"",review:"",rating:1,...a}});return(0,d.jsxs)("div",{className:"bg-surface rounded-md shadow-sm overflow-hidden p-6 mb-6",children:[(0,d.jsx)("h3",{className:"text-lg font-semibold text-text-primary mb-4",children:l({id:"write_review",defaultMessage:"Write a Review"})}),(0,d.jsxs)(g.default,{form:m,children:[(0,d.jsxs)("div",{className:"space-y-4",children:[(0,d.jsx)(y.default,{name:"title",disabled:!i(r.IRoleAction.ReviewProduct),id:"title",label:l({id:"title",defaultMessage:"Title"}),autoComplete:"off",required:!0}),(0,d.jsx)(e6.default,{rows:4,name:"review",disabled:!i(r.IRoleAction.ReviewProduct),id:"review",label:l({id:"review",defaultMessage:"Review"}),placeholder:l({id:"review_placeholder",defaultMessage:"Share your thoughts about this product..."})})]}),i(r.IRoleAction.ReviewProduct)&&(0,d.jsx)("div",{className:"mt-6 flex justify-end",children:(0,d.jsx)(b.default,{label:l(s?{id:"update_review",defaultMessage:"Update Review"}:{id:"add_review",defaultMessage:"Add Review"}),className:"px-6 py-2"})})]})]})},e7=M.gql`
|
|
610
|
+
mutation CreateProductReview(
|
|
611
|
+
$productId: ID!
|
|
612
|
+
$productReview: ProductReviewInput!
|
|
613
|
+
$forceLocale: Locale
|
|
614
|
+
) {
|
|
615
|
+
createProductReview(productId: $productId, productReview: $productReview) {
|
|
616
|
+
_id
|
|
617
|
+
}
|
|
618
|
+
}
|
|
619
|
+
`;e.s(["default",0,({productId:e})=>{let{productReviews:t,loadMore:a,reviewsCount:s}=(({productId:e=null,slug:t=null,limit:a=10,offset:s=0,sort:l=[{key:"created",value:eJ.ISortDirection.Desc}]}={})=>{let{selectedLocale:i}=(0,O.default)(),{data:d,loading:r,error:n,fetchMore:o}=(0,P.useQuery)(e0,{skip:!e,variables:{productId:e,slug:t,limit:a,offset:s,sort:l,forceLocale:i}}),u=d?.product,c=u?.reviews||[];return{productReviews:c,loading:r,error:n,reviewsCount:u?.reviewsCount||0,loadMore:()=>{o({variables:{offset:c?.length}})}}})({productId:e}),{createProductReview:l}=(()=>{let[e]=(0,k.useMutation)(e7);return{createProductReview:async({productId:t,productReview:{title:a,rating:s,review:l}})=>e({variables:{productId:t,productReview:{title:a,rating:s,review:l}},refetchQueries:["ProductReviewByProduct","ProductReviewByUser"]})}})(),{formatMessage:i}=(0,o.useIntl)();return(0,d.jsxs)("div",{className:"sm:max-w-full",children:[(0,d.jsx)("div",{className:"text-text-primary",children:(0,d.jsxs)("div",{className:"mx-auto p-2 lg:grid lg:max-w-7xl lg:grid-cols-12 lg:gap-x-8",children:[(0,d.jsx)(e4,{productReviews:t}),(0,d.jsxs)("div",{className:"mt-16 lg:col-span-7 lg:col-start-6 lg:mt-0",children:[e&&(0,d.jsx)(e9,{onSubmit:async({title:t,review:a,rating:s})=>await l({productId:e,productReview:{title:t,review:a,rating:10}})}),(0,d.jsx)("h3",{className:"sr-only",children:i({id:"recent_reviews",defaultMessage:"Recent reviews"})}),(0,d.jsx)("div",{className:"flow-root",children:(0,d.jsx)("div",{className:"-my-3",children:t.map(e=>(0,d.jsx)(e1.default,{review:e},e._id))})})]})]})}),s>t?.length?(0,d.jsx)(j.default,{text:i({id:"load-more-reviews",defaultMessage:"Load reviews"}),onClick:a}):null]})}],19051);var e8=e.i(47542);let te=M.gql`
|
|
620
|
+
mutation CreateProductBundleItem(
|
|
621
|
+
$productId: ID!
|
|
622
|
+
$item: CreateProductBundleItemInput!
|
|
623
|
+
) {
|
|
624
|
+
createProductBundleItem(productId: $productId, item: $item) {
|
|
625
|
+
_id
|
|
626
|
+
}
|
|
627
|
+
}
|
|
628
|
+
`;var tt=e.i(24112),ta=e.i(5270);let ts={name:"sparkles",size:24,node:[["path",{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z",key:"1s2grr"}],["path",{d:"M20 2v4",key:"1rf3ol"}],["path",{d:"M22 4h-4",key:"gwowj6"}],["circle",{cx:"4",cy:"20",r:"2",key:"6kqj1y"}]],aliases:["stars"]};ts.node;let tl=(0,ta.default)(ts);var ti=e.i(38994);let td=function({onSuccess:e}){let{selectedLocale:t}=(0,O.default)(),{createProduct:a}=(0,ti.default)(),{formatMessage:s}=(0,o.useIntl)();return async({title:l,type:i,quantity:d=1})=>{let n=[{title:l,slug:l.toLowerCase().replace(/\s+/g,"-"),locale:t}],{data:o}=await a({product:{type:i||r.IProductType.SimpleProduct},texts:n}),u=o?.createProduct;if(!u?._id)throw Error(s({id:"product_creation_failed",defaultMessage:"Product creation failed"}));return e?.(u,d),{success:!0}}},tr=({bundleProduct:e,onSuccess:a})=>{let{formatMessage:s}=(0,o.useIntl)(),{hasRole:l}=(0,u.default)(),i=td({onSuccess:a}),n=(0,t.useMemo)(()=>{let t=e?.texts?.title??"";return`${t} - New Bundle Item`},[e]),c=async({title:e,type:t,quantity:a})=>{try{return await i({title:e,type:t,quantity:a}),{success:!0}}catch(e){return{success:!1,error:{message:e?.message}}}},m=s({id:"bundle-item-scaffolded-success",defaultMessage:"New product scaffolded and added to bundle successfully"}),p=(0,I.default)({submit:c,successMessage:m,enableReinitialize:!0,initialValues:{title:n,type:r.IProductType.SimpleProduct,quantity:1}});return(0,d.jsxs)(g.default,{className:"mt-4 rounded-md border border-border-subtle",form:p,children:[(0,d.jsxs)("div",{className:"p-5 flex flex-col gap-3",children:[(0,d.jsx)("h3",{className:"text-md font-semibold text-slate-800 dark:text-slate-100",children:s({id:"scaffold_bundle_item_title",defaultMessage:"Scaffold New Bundle Item"})}),(0,d.jsx)(y.default,{name:"title",id:"title",label:s({id:"name",defaultMessage:"Name"}),required:!0,className:"block w-full rounded-md border-border-default text-sm"}),(0,d.jsx)(v.default,{className:"mt-1 w-full",label:s({id:"type",defaultMessage:"Type"}),placeholder:s({id:"type",defaultMessage:"Type"}),required:!0,name:"type",options:Object.fromEntries(Object.entries(r.IProductType).filter(([,e])=>e!==r.IProductType.ConfigurableProduct&&e!==r.IProductType.BundleProduct).map(([e,t])=>[t,e]))}),(0,d.jsx)(y.default,{name:"quantity",type:"number",required:!0,label:s({id:"quantity",defaultMessage:"Quantity"})})]}),l(r.IRoleAction.ManageProducts)&&(0,d.jsx)("div",{className:"border-t border-border-subtle bg-surface-subtle p-5 text-right",children:(0,d.jsx)(b.default,{label:s({id:"scaffold_and_add",defaultMessage:"Scaffold & Add"})})})]})},tn=({productId:e=null,slug:t=null}={})=>{let a=(0,W.parseUniqueId)(t),{customProperties:s,hydrateFragment:l}=(0,T.default)(),{data:i,loading:d,error:r}=(0,P.useQuery)(((e="")=>M.gql`
|
|
629
|
+
query Product($productId: ID, $slug: String) {
|
|
630
|
+
product(productId: $productId, slug: $slug) {
|
|
631
|
+
...ProductDetailFragment
|
|
632
|
+
${e}
|
|
633
|
+
texts {
|
|
634
|
+
_id
|
|
635
|
+
title
|
|
636
|
+
subtitle
|
|
637
|
+
description
|
|
638
|
+
}
|
|
639
|
+
... on SimpleProduct {
|
|
640
|
+
texts {
|
|
641
|
+
_id
|
|
642
|
+
title
|
|
643
|
+
subtitle
|
|
644
|
+
description
|
|
645
|
+
}
|
|
646
|
+
proxies {
|
|
647
|
+
__typename
|
|
648
|
+
}
|
|
649
|
+
}
|
|
650
|
+
... on ConfigurableProduct {
|
|
651
|
+
texts {
|
|
652
|
+
_id
|
|
653
|
+
title
|
|
654
|
+
subtitle
|
|
655
|
+
description
|
|
656
|
+
}
|
|
657
|
+
}
|
|
658
|
+
... on PlanProduct {
|
|
659
|
+
texts {
|
|
660
|
+
_id
|
|
661
|
+
title
|
|
662
|
+
subtitle
|
|
663
|
+
description
|
|
664
|
+
}
|
|
665
|
+
proxies {
|
|
666
|
+
__typename
|
|
667
|
+
}
|
|
668
|
+
}
|
|
669
|
+
... on BundleProduct {
|
|
670
|
+
texts {
|
|
671
|
+
_id
|
|
672
|
+
title
|
|
673
|
+
subtitle
|
|
674
|
+
description
|
|
675
|
+
}
|
|
676
|
+
proxies {
|
|
677
|
+
__typename
|
|
678
|
+
}
|
|
679
|
+
}
|
|
680
|
+
}
|
|
681
|
+
}
|
|
682
|
+
${$.default}
|
|
683
|
+
`)(s?.Product),{skip:!e&&!a,variables:{productId:e||a}}),n=l(s?.Product,i?.product);return{product:i?.product,loading:d,error:r,extendedData:n}};e.s(["default",0,tn],84278);let to=({productId:e,disabled:a=!1})=>{let{product:s}=tn({productId:e}),{setModal:l}=(0,el.default)(),[i,n]=(0,t.useState)(""),{createProductBundleItem:c}=(()=>{let[e]=(0,k.useMutation)(te);return{createProductBundleItem:async({productId:t,item:a})=>e({variables:{productId:t,item:a},refetchQueries:["ProductBundleItems"]})}})(),{hasRole:m}=(0,u.default)(),{formatMessage:p}=(0,o.useIntl)(),{products:f,loading:x}=(0,tt.default)({queryString:i,includeDrafts:!0,limit:50,sort:[{key:"created",value:r.ISortDirection.Desc}]}),h=async({productId:t,quantity:a})=>(await c({item:{productId:t,quantity:a},productId:e}),{success:!0}),v=p({id:"bundle_item_added",defaultMessage:"Bundle product added successfully"}),w=(0,I.default)({disabled:a,submit:h,successMessage:v,onSubmitSuccess:()=>(w.api.resetForm(),null),initialValues:{productId:"",quantity:1}}),M=(0,t.useCallback)(async()=>{await l((0,d.jsx)(tr,{bundleProduct:s,onSuccess:async(t,a=1)=>{await c({item:{productId:t._id,quantity:a},productId:e}),l("")}}))},[s]);return(0,d.jsxs)(g.default,{form:w,children:[(0,d.jsxs)("div",{className:"flex items-end gap-2 w-full",children:[(0,d.jsx)("div",{className:"flex-1",children:(0,d.jsx)(e8.default,{name:"productId",onFilter:n,queryString:i,label:p({id:"product",defaultMessage:"Product"}),data:((e=[])=>e.map(({_id:e,status:t,texts:a,media:s})=>({id:e,tag:t,...a,image:s?.length?s[0]?.file?.url:null})))(f),isLoading:x,className:"w-full text-sm font-medium text-slate-500",required:!0})}),m(r.IRoleAction.ManageProducts)&&(0,d.jsx)("div",{className:"pb-3",children:(0,d.jsx)(j.default,{className:"flex items-center justify-center p-2 rounded-md",onClick:M,children:(0,d.jsx)(tl,{className:"h-5 w-5"})})})]}),(0,d.jsx)(y.default,{name:"quantity",type:"number",required:!0,label:p({id:"quantity",defaultMessage:"Quantity"})}),m(r.IRoleAction.ManageProducts)&&(0,d.jsx)(b.default,{label:p({id:"submit",defaultMessage:"Submit"}),className:"mt-2"})]})};var tu=e.i(54529);let tc=M.gql`
|
|
684
|
+
query ProductBundleItems(
|
|
685
|
+
$productId: ID
|
|
686
|
+
$slug: String
|
|
687
|
+
$forceLocale: Locale
|
|
688
|
+
) {
|
|
689
|
+
product(productId: $productId, slug: $slug) {
|
|
690
|
+
_id
|
|
691
|
+
... on BundleProduct {
|
|
692
|
+
bundleItems {
|
|
693
|
+
product {
|
|
694
|
+
...ProductBriefFragment
|
|
695
|
+
}
|
|
696
|
+
quantity
|
|
697
|
+
}
|
|
698
|
+
}
|
|
699
|
+
}
|
|
700
|
+
}
|
|
701
|
+
${tu.default}
|
|
702
|
+
`,tm=M.gql`
|
|
703
|
+
mutation RemoveBundleItem($productId: ID!, $index: Int!) {
|
|
704
|
+
removeBundleItem(productId: $productId, index: $index) {
|
|
705
|
+
_id
|
|
706
|
+
}
|
|
707
|
+
}
|
|
708
|
+
`;var tp=e.i(41158),tf=e.i(87284),tx=e.i(76069);let tg=({item:e,onDelete:t,index:a})=>{let{product:s,quantity:l}=e;return(0,d.jsx)(tp.default,{href:`/products?slug=${(0,W.default)(s)}`,children:(0,d.jsxs)("div",{className:" group flex w-full items-center justify-between border-b border-border-subtle hover:border-slate-300 dark:hover:border-slate-600 hover:bg-slate-50/80 dark:hover:bg-slate-700/50 transition-all duration-200 ease-in-out hover:shadow-sm last:border-none",children:[(0,d.jsxs)("div",{className:"flex w-full items-center space-x-6 py-4",children:[s.media?.length?(0,d.jsx)("div",{className:"flex w-20 flex-col items-center",children:(0,d.jsx)("div",{className:"relative m-1 mr-2 mt-1 flex items-center justify-center rounded-full ",children:(0,d.jsx)(tf.default,{className:"mx-auto w-auto",src:s.media[0]?.file?.url,width:160,height:100,alt:s?.texts?.title||s?.texts?.subtitle})})}):(0,d.jsx)(tx.default,{className:"h-10 w-10"}),(0,d.jsxs)("div",{className:"shrink grow basis-1/2",children:[(0,d.jsx)("h3",{className:"text-lg text-text-secondary",children:s?.texts?.title}),(0,d.jsx)("p",{className:"text-xs text-slate-600 dark:text-slate-200",children:s?.texts?.subtitle})]}),(0,d.jsx)("div",{className:"ml-auto",children:(0,d.jsx)(eM.default,{text:l,color:"slate",square:!0})})]}),(0,d.jsx)(eV.default,{onDelete:()=>{t(a)},showDelete:!0})]})})},th=({productId:e})=>{let{formatMessage:t}=(0,o.useIntl)(),{setModal:a}=(0,el.default)(),{selectedLocale:s}=(0,O.default)(),{bundleItems:l,loading:i}=(({productId:e=null,slug:t=null}={})=>{let{selectedLocale:a}=(0,O.default)(),s=(0,W.parseUniqueId)(t),{data:l,loading:i,error:d}=(0,P.useQuery)(tc,{skip:!e&&!s,variables:{productId:e||s,forceLocale:a},context:{headers:{forceLocale:a}}});return{bundleItems:l?.product?.bundleItems||[],loading:i,error:d}})({productId:e,forceLocale:s}),{removeBundleItem:r}=(()=>{let[e]=(0,k.useMutation)(tm);return{removeBundleItem:async({productId:t,index:a})=>e({variables:{productId:t,index:a},refetchQueries:["ProductBundleItems"]})}})(),n=async s=>{await a((0,d.jsx)(ea.default,{onCancelClick:async()=>a(""),message:t({id:"delete_bundle_item_confirmation",defaultMessage:"This action might cause inconsistencies with other data that relates to it. Are you sure you want to delete this bundle item? "}),onOkClick:async()=>{a(""),await r({productId:e,index:s}),L.toast.success(t({id:"bundle_item_deleted",defaultMessage:"Bundle item deleted successfully"}))},okText:t({id:"delete_bundle_item",defaultMessage:"Delete item"})}))};return i?(0,d.jsx)(eg.default,{}):l.length?(0,d.jsx)(d.Fragment,{children:l.map((e,t)=>(0,d.jsx)(tg,{index:t,item:e,onDelete:n},e.product._id))}):(0,d.jsx)(X.default,{message:t({id:"bundle",defaultMessage:"Bundle product"})})};e.s(["default",0,({productId:e,disabled:t=!1})=>(0,d.jsx)("div",{className:"mt-6 rounded-md",children:(0,d.jsxs)("div",{className:"lg:grid lg:grid-cols-9",children:[(0,d.jsx)("div",{className:"mb-5 lg:col-span-4 lg:pr-5",children:(0,d.jsx)(to,{productId:e,disabled:t})}),(0,d.jsx)("div",{className:"col-span-5 ml-auto rounded-md bg-surface px-8 shadow-md dark:shadow-none lg:w-full",children:(0,d.jsx)("div",{className:"py-4",children:(0,d.jsx)(th,{productId:e})})})]})})],11907)}]);
|