@unchainedshop/admin-ui 5.0.0-alpha.12 → 5.0.0-alpha.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (292) hide show
  1. package/dist/{chunk-ATZJXTRA.js → chunk-5UHBGLFV.js} +39 -1
  2. package/dist/{chunk-4MXPTVDL.js → chunk-6WMH7PLC.js} +1 -1
  3. package/dist/{chunk-GWMLIF3C.js → chunk-EKWWSFDK.js} +1 -1
  4. package/dist/{chunk-Q6S3LBUF.js → chunk-JC6PXYZP.js} +7 -1
  5. package/dist/{chunk-BOMSMJF2.js → chunk-JGER2LQO.js} +1 -0
  6. package/dist/{chunk-YUXHILXY.js → chunk-M2242FCR.js} +1 -1
  7. package/dist/{chunk-33ZO52Z7.js → chunk-NUGWX3KO.js} +123 -19
  8. package/dist/{chunk-ED2FP42R.js → chunk-XZ2V6XTD.js} +2 -2
  9. package/dist/components/ui/index.d.ts +1 -0
  10. package/dist/components/ui/index.d.ts.map +1 -1
  11. package/dist/form.js +7 -99
  12. package/dist/gql/operation-types.d.ts +51 -18
  13. package/dist/gql/operation-types.d.ts.map +1 -1
  14. package/dist/gql/schema-types.d.ts +25 -0
  15. package/dist/gql/schema-types.d.ts.map +1 -1
  16. package/dist/hooks.js +4 -4
  17. package/dist/modules/UnchainedContext/UnchainedContext.d.ts +1 -0
  18. package/dist/modules/UnchainedContext/UnchainedContext.d.ts.map +1 -1
  19. package/dist/modules/UnchainedContext/useUnchainedContext.d.ts +1 -0
  20. package/dist/modules/UnchainedContext/useUnchainedContext.d.ts.map +1 -1
  21. package/dist/modules/accounts.js +47 -1
  22. package/dist/modules/assortment.js +1 -1
  23. package/dist/modules/common/components/SearchWithTags.d.ts +10 -0
  24. package/dist/modules/common/components/SearchWithTags.d.ts.map +1 -0
  25. package/dist/modules/common/hooks/useShopInfo.d.ts +1 -0
  26. package/dist/modules/common/hooks/useShopInfo.d.ts.map +1 -1
  27. package/dist/modules/enrollment.js +24 -10
  28. package/dist/modules/forms/lib/validators.d.ts +3 -1
  29. package/dist/modules/forms/lib/validators.d.ts.map +1 -1
  30. package/dist/modules/order/fragments/OrderDetailFragment.d.ts.map +1 -1
  31. package/dist/modules/order.js +0 -1
  32. package/dist/modules/product/hooks/useProductsCount.d.ts +1 -1
  33. package/dist/modules/product/hooks/useProductsCount.d.ts.map +1 -1
  34. package/dist/modules/product-review.js +1 -1
  35. package/dist/modules/product.js +436 -24
  36. package/dist/modules/quotation.js +1 -0
  37. package/dist/ui.js +1317 -411
  38. package/out/403/index.html +3 -3
  39. package/out/404/index.html +3 -3
  40. package/out/404.html +3 -3
  41. package/out/423/index.html +3 -3
  42. package/out/500/index.html +3 -3
  43. package/out/_next/static/WEaZ5SW9HLnJWzXs84JMH/_buildManifest.js +266 -0
  44. package/out/_next/static/chunks/{2_0v0fw6x71zy.js → 00p6gl0n0kga2.js} +4 -4
  45. package/out/_next/static/chunks/0389l__ljgq-b.js +1 -0
  46. package/out/_next/static/chunks/039xltalow0bh.js +1 -0
  47. package/out/_next/static/chunks/{0w9d4swf95hvu.js → 03awz8e25u6-9.js} +1 -1
  48. package/out/_next/static/chunks/04kydtjv2qqb1.js +39 -0
  49. package/out/_next/static/chunks/05ghb-a4hshp1.js +24 -0
  50. package/out/_next/static/chunks/06gqojz2tfk7h.js +33 -0
  51. package/out/_next/static/chunks/08e3-wndual-j.js +183 -0
  52. package/out/_next/static/chunks/{41c4n9whpyrjc.js → 08gngcgmdigfl.js} +2 -2
  53. package/out/_next/static/chunks/{3e7d8sb4289js.js → 08htfpcq8k2ct.js} +1 -1
  54. package/out/_next/static/chunks/{45c05mbjow5wz.js → 0ao00r36i0nko.js} +1 -1
  55. package/out/_next/static/chunks/{01isyk4v59s_4.js → 0az9r1m1m5nw7.js} +2 -2
  56. package/out/_next/static/chunks/{2q988j4vovsiy.js → 0bahbwxzev843.js} +3 -3
  57. package/out/_next/static/chunks/{1z-etrje5tsj6.js → 0ejd4so6pfsb9.js} +2 -1
  58. package/out/_next/static/chunks/0f0aouv41459l.js +99 -0
  59. package/out/_next/static/chunks/{3fevbt4ysloo8.js → 0f4mwm9gegsvc.js} +3 -3
  60. package/out/_next/static/chunks/{1fehej_7rgmmo.js → 0ffdde8s4b7e2.js} +1 -1
  61. package/out/_next/static/chunks/0ftb36h7poyeo.js +235 -0
  62. package/out/_next/static/chunks/{1z1d11slpalrq.js → 0gclli_nyb0px.js} +1 -1
  63. package/out/_next/static/chunks/{0hv3x0mo1tt7i.js → 0hv62tllrjbgx.js} +2 -2
  64. package/out/_next/static/chunks/0ik3suboifvvc.js +1 -0
  65. package/out/_next/static/chunks/{3exy4ii5maq4x.js → 0jsbw2npug66o.js} +1 -1
  66. package/out/_next/static/chunks/0lgoprkr2wj68.js +12 -0
  67. package/out/_next/static/chunks/0mpgc4f7hc1dd.js +7 -0
  68. package/out/_next/static/chunks/{2y11qf38baxpu.js → 0oauw10y-zu7q.js} +5 -5
  69. package/out/_next/static/chunks/0pnifxx4n6jz4.js +30 -0
  70. package/out/_next/static/chunks/{2bxdh-td1el8z.js → 0rj53mrsrvu49.js} +1 -1
  71. package/out/_next/static/chunks/{3ek680kdzjdr7.js → 0v2f0xq8mp63h.js} +1 -1
  72. package/out/_next/static/chunks/{32whi9clpxjd0.js → 0wvck3kmtd8h3.js} +1 -1
  73. package/out/_next/static/chunks/{3h6a3clw5m5ro.js → 0y-xf7e4lgmru.js} +1 -1
  74. package/out/_next/static/chunks/12z0--swhgre2.js +33 -0
  75. package/out/_next/static/chunks/139wqbl161pdw.js +12 -0
  76. package/out/_next/static/chunks/{1hzt0aoixrv4_.js → 13sl42_jx13hh.js} +2 -2
  77. package/out/_next/static/chunks/14wav1vmqi2oo.js +371 -0
  78. package/out/_next/static/chunks/{3b1kt-r_75q1a.js → 15oodwh44nrve.js} +2 -2
  79. package/out/_next/static/chunks/15ullli2vlj87.js +8 -0
  80. package/out/_next/static/chunks/17g3a6iz0s59f.js +837 -0
  81. package/out/_next/static/chunks/{2m38nntt3z8zi.js → 19-fs9eq1syvw.js} +3 -3
  82. package/out/_next/static/chunks/{3fu072xwkf88o.js → 195cwzh3q1i0h.js} +2 -1
  83. package/out/_next/static/chunks/1fou9xz0_rm6d.js +5 -0
  84. package/out/_next/static/chunks/{37jjn1wguhj-a.js → 1k1b69hvwr-0g.js} +1 -1
  85. package/out/_next/static/chunks/{0rrhyxuk32t3n.js → 1kyjdq0bnkw10.js} +2 -2
  86. package/out/_next/static/chunks/{0v1tb34y7e1y4.js → 1l2ix83845lui.js} +1 -1
  87. package/out/_next/static/chunks/{3x_gia2m5w9_l.js → 1ossmsdseqyeu.js} +6 -6
  88. package/out/_next/static/chunks/1pm7k55e4pfpm.js +59 -0
  89. package/out/_next/static/chunks/1pqyz1opm5_7r.js +1 -0
  90. package/out/_next/static/chunks/{39moagn46hde9.js → 1qd4fupa708s4.js} +2 -2
  91. package/out/_next/static/chunks/{3o-h2po9z09dk.js → 1t1ecrjkykbv1.js} +1 -1
  92. package/out/_next/static/chunks/{28o6402k4vuky.js → 1tej7js0fwv1h.js} +3 -3
  93. package/out/_next/static/chunks/1th8knz7txt9f.js +5 -0
  94. package/out/_next/static/chunks/1tuf110jbpl_r.js +1 -0
  95. package/out/_next/static/chunks/1tzkeg4c-br-z.js +17 -0
  96. package/out/_next/static/chunks/{0_3suta3t3lus.js → 1u7l4tos3wysc.js} +2 -2
  97. package/out/_next/static/chunks/1v0ag3k96c56s.js +1 -0
  98. package/out/_next/static/chunks/1w6iuc_ba9g-3.js +3 -0
  99. package/out/_next/static/chunks/1x7cm_fuwp9m8.js +1 -0
  100. package/out/_next/static/chunks/1yv22tvuqofr_.js +296 -0
  101. package/out/_next/static/chunks/{0rt4le6syjqdj.js → 2-s-hteo3lrnj.js} +12 -12
  102. package/out/_next/static/chunks/20p146xfq-xrq.js +5 -0
  103. package/out/_next/static/chunks/{3ujdligrod612.js → 20t2g2u3jhtvy.js} +1 -1
  104. package/out/_next/static/chunks/{1ug1ie2lrhi0a.js → 231mhpexhdm2g.js} +1 -1
  105. package/out/_next/static/chunks/24zfmgc4cu-n1.js +9 -0
  106. package/out/_next/static/chunks/{44b7_q6pkf1k9.js → 25b_pi2_ro9yy.js} +1 -1
  107. package/out/_next/static/chunks/{2uo6puoi0y082.js → 2693w1263bb3s.js} +1 -1
  108. package/out/_next/static/chunks/{0i481ym5-ss1t.js → 26yarz_db5ms0.js} +1 -1
  109. package/out/_next/static/chunks/28xbb7hkhkoup.js +1 -0
  110. package/out/_next/static/chunks/299pou8yuoq6b.js +116 -0
  111. package/out/_next/static/chunks/2_cq751vth7u7.js +81 -0
  112. package/out/_next/static/chunks/2a2cayocu5mc3.js +1 -0
  113. package/out/_next/static/chunks/{1th1-x1szvnq8.js → 2dn2ma73q9ye0.js} +1 -1
  114. package/out/_next/static/chunks/{3www97fxyknos.js → 2fnn6q9fmhu3s.js} +1 -1
  115. package/out/_next/static/chunks/{3pls-kicv4xu9.js → 2ga95n_v_6_7b.js} +1 -1
  116. package/out/_next/static/chunks/{1q7wxp4rlhy0x.js → 2gfljy_oo0nnr.js} +5 -5
  117. package/out/_next/static/chunks/{0qv2nce7okzy5.js → 2gfot_-pkeohl.js} +1 -1
  118. package/out/_next/static/chunks/2h4bxz0oww5pk.js +4 -0
  119. package/out/_next/static/chunks/2j4g1tyyp8ta1.js +1 -0
  120. package/out/_next/static/chunks/2mt78e61hd_4p.js +100 -0
  121. package/out/_next/static/chunks/{05474mknnr_tw.js → 2rri_ex6s-d8g.js} +1 -1
  122. package/out/_next/static/chunks/{2ud5j0_nqocf4.js → 2sc6dwzzc2t7n.js} +1 -1
  123. package/out/_next/static/chunks/2texlu369byon.js +1 -0
  124. package/out/_next/static/chunks/{3lr6hkso67d68.js → 2tq8sqd3-wavo.js} +2 -2
  125. package/out/_next/static/chunks/2u2obxhc_n6xk.js +119 -0
  126. package/out/_next/static/chunks/{157ndq6b9jcvv.js → 2u4cc_r_qo0s4.js} +4 -4
  127. package/out/_next/static/chunks/2u6n7ohruqpxp.js +1 -0
  128. package/out/_next/static/chunks/2u9myo1sjc-q0.js +276 -0
  129. package/out/_next/static/chunks/{0we1tw4xvdb7o.js → 2ubbeh02scr2l.js} +2 -2
  130. package/out/_next/static/chunks/{1w6gc_cygbi6h.js → 2v_bdu-atp2qq.js} +1 -1
  131. package/out/_next/static/chunks/{1gv0k-w7m83om.js → 2vyv371s8n48m.js} +2 -2
  132. package/out/_next/static/chunks/{24caedynuzux0.js → 2xd_5hafdvicw.js} +1 -1
  133. package/out/_next/static/chunks/2ym9q2u0yw0m8.js +326 -0
  134. package/out/_next/static/chunks/{131uuhqexo4si.js → 3-grp4-_b_uin.js} +2 -1
  135. package/out/_next/static/chunks/{2s-0q8i8lr2p2.js → 31i76bjr7wp3u.js} +1 -1
  136. package/out/_next/static/chunks/{1j2gw9gyg8j80.js → 32thgoqghnqfk.js} +2 -2
  137. package/out/_next/static/chunks/{3hmoy4f23y1s4.js → 33svzh7wrh2ca.js} +4 -4
  138. package/out/_next/static/chunks/{345s7967cwd02.js → 33v1m9okpss0r.js} +1 -1
  139. package/out/_next/static/chunks/34gspkpv7wikw.js +8 -0
  140. package/out/_next/static/chunks/{0mcu2o1ir2t_w.js → 35zhvtyq31ani.js} +1 -1
  141. package/out/_next/static/chunks/36vqjcd_y2j30.js +1 -0
  142. package/out/_next/static/chunks/{1msc4qrgaanh7.js → 38043sp-g7lor.js} +2 -2
  143. package/out/_next/static/chunks/395bs5xmcnl_3.js +31 -0
  144. package/out/_next/static/chunks/{2w3z7kqh6nbmw.js → 3_jqu6hq_bq0s.js} +2 -2
  145. package/out/_next/static/chunks/{153-_av1r1ssb.js → 3_tuio1shb_8w.js} +1 -1
  146. package/out/_next/static/chunks/{0br42_xli8-2x.js → 3_u_uxeaysv2y.js} +1 -1
  147. package/out/_next/static/chunks/{1bypzyw5fs3w2.js → 3e9x78_cfl4gs.js} +4 -4
  148. package/out/_next/static/chunks/3i7obrooylax2.js +1 -0
  149. package/out/_next/static/chunks/3ij_85v4doyfu.js +2 -0
  150. package/out/_next/static/chunks/3jgmo9q79w1-c.js +290 -0
  151. package/out/_next/static/chunks/{42dygj7ul4k54.js → 3jp_xvjzuj3ts.js} +2 -2
  152. package/out/_next/static/chunks/{1k06h8wbfrx_v.js → 3l9ixfzewn8ct.js} +1 -1
  153. package/out/_next/static/chunks/3ltrxqm61t2um.js +1 -0
  154. package/out/_next/static/chunks/{1bxznw06g-5u2.js → 3qt1oiw306jtf.js} +2 -2
  155. package/out/_next/static/chunks/{0zqdvl0b4w5nc.js → 3s5_6nq23zb_5.js} +1 -1
  156. package/out/_next/static/chunks/{1vzs8hvrsoslf.js → 3s_74oi_rqb7q.js} +1 -1
  157. package/out/_next/static/chunks/{2-qo63s4vlxol.js → 3skconxcf6r_s.js} +5 -5
  158. package/out/_next/static/chunks/{3xs_undkbcqp7.js → 3ud-crkzgoj7q.js} +3 -3
  159. package/out/_next/static/chunks/{2u64ldp2xfy8a.js → 3wr9v36meolw7.js} +71 -70
  160. package/out/_next/static/chunks/3xun85a44o067.js +1 -0
  161. package/out/_next/static/chunks/{0cdk-eqghrgee.js → 407elvwrmcfn6.js} +1 -1
  162. package/out/_next/static/chunks/40j4nxaeofft-.js +1 -0
  163. package/out/_next/static/chunks/{3k01tdsm6l20w.js → 42ijceja_327z.js} +2 -2
  164. package/out/_next/static/chunks/440jwge6wnjj6.js +1 -0
  165. package/out/_next/static/chunks/44xnlcqhabyj6.js +174 -0
  166. package/out/_offline/index.html +3 -3
  167. package/out/account/forgot-password/index.html +3 -3
  168. package/out/account/index.html +3 -3
  169. package/out/assortments/AssortmentDetailPage/index.html +3 -3
  170. package/out/assortments/index.html +3 -3
  171. package/out/assortments/new/index.html +3 -3
  172. package/out/copilot/index.html +3 -3
  173. package/out/country/CountryDetailPage/index.html +3 -3
  174. package/out/country/index.html +3 -3
  175. package/out/country/new/index.html +3 -3
  176. package/out/currency/CurrencyDetailPage/index.html +3 -3
  177. package/out/currency/index.html +3 -3
  178. package/out/currency/new/index.html +3 -3
  179. package/out/delivery-provider/DeliveryProviderDetailPage/index.html +3 -3
  180. package/out/delivery-provider/index.html +3 -3
  181. package/out/delivery-provider/new/index.html +3 -3
  182. package/out/enrollments/EnrollmentDetailPage/index.html +3 -3
  183. package/out/enrollments/index.html +3 -3
  184. package/out/events/EventDetailPage/index.html +3 -3
  185. package/out/events/index.html +3 -3
  186. package/out/exports/index.html +3 -3
  187. package/out/ext/[[...slug]]/index.html +3 -3
  188. package/out/external/index.html +3 -3
  189. package/out/filters/FilterDetailPage/index.html +3 -3
  190. package/out/filters/index.html +3 -3
  191. package/out/filters/new/index.html +3 -3
  192. package/out/index.html +3 -3
  193. package/out/install/index.html +3 -3
  194. package/out/language/LanguageDetailPage/index.html +3 -3
  195. package/out/language/index.html +3 -3
  196. package/out/language/new/index.html +3 -3
  197. package/out/log-in/index.html +3 -3
  198. package/out/login-code/index.html +12 -0
  199. package/out/orders/OrderDetailPage/index.html +3 -3
  200. package/out/orders/index.html +3 -3
  201. package/out/payment-provider/PaymentProviderDetailPage/index.html +3 -3
  202. package/out/payment-provider/index.html +3 -3
  203. package/out/payment-provider/new/index.html +3 -3
  204. package/out/products/ProductDetailPage/index.html +3 -3
  205. package/out/products/index.html +3 -3
  206. package/out/products/new/index.html +3 -3
  207. package/out/quotations/QuotationDetailPage/index.html +3 -3
  208. package/out/quotations/index.html +3 -3
  209. package/out/reset-password/index.html +3 -3
  210. package/out/sign-up/index.html +3 -3
  211. package/out/styleguide/index.html +3 -3
  212. package/out/tokens/TokenDetailPage/index.html +3 -3
  213. package/out/tokens/index.html +3 -3
  214. package/out/users/UserDetailPage/index.html +3 -3
  215. package/out/users/index.html +3 -3
  216. package/out/users/new/index.html +3 -3
  217. package/out/verify-email/index.html +3 -3
  218. package/out/warehousing-provider/WarehousingProviderDetailPage/index.html +3 -3
  219. package/out/warehousing-provider/index.html +3 -3
  220. package/out/warehousing-provider/new/index.html +3 -3
  221. package/out/works/WorkDetailPage/index.html +3 -3
  222. package/out/works/WorkQueueListView/index.html +3 -3
  223. package/out/works/index.html +3 -3
  224. package/out/works/management/index.html +3 -3
  225. package/package.json +1 -1
  226. package/src/modules/accounts/hooks/useLoginWithLoginCode.ts +45 -0
  227. package/src/modules/accounts/hooks/useRequestLoginCode.ts +31 -0
  228. package/src/modules/accounts/index.ts +2 -0
  229. package/src/modules/common/hooks/useShopInfo.ts +1 -0
  230. package/src/modules/enrollment/fragments/EnrollmentDetailFragment.ts +3 -2
  231. package/src/modules/enrollment/hooks/useSuspendEnrollment.ts +5 -3
  232. package/src/modules/enrollment/hooks/useTerminateEnrollment.ts +15 -3
  233. package/src/modules/enrollment/hooks/useUpdateEnrollmentExpires.ts +38 -0
  234. package/src/modules/order/fragments/OrderDetailFragment.ts +0 -1
  235. package/src/modules/product/hooks/useProductTokenization.ts +1 -0
  236. package/src/modules/product/hooks/useProductsCount.ts +4 -0
  237. package/src/modules/product/hooks/useUpdateProductCommerce.ts +2 -13
  238. package/src/modules/product/hooks/useUpdateProductTokenization.ts +8 -1
  239. package/src/modules/product/index.ts +3 -0
  240. package/src/modules/quotation/fragments/QuotationDetailFragment.ts +1 -0
  241. package/src/sdk/README.md +1 -1
  242. package/out/_next/static/bg3Z_ZBjStiTvJAHlsPDE/_buildManifest.js +0 -262
  243. package/out/_next/static/chunks/00wlebfe9j80r.js +0 -24
  244. package/out/_next/static/chunks/03x_mgpai_kbn.js +0 -1
  245. package/out/_next/static/chunks/04327_1fq5i7-.js +0 -9
  246. package/out/_next/static/chunks/0_a5fzdztv84p.js +0 -272
  247. package/out/_next/static/chunks/0d54jo566j9ka.js +0 -12
  248. package/out/_next/static/chunks/0gfia1t8drmnx.js +0 -182
  249. package/out/_next/static/chunks/0gwd6ju8j_bwr.js +0 -39
  250. package/out/_next/static/chunks/0j46qnxaxeqk_.js +0 -1
  251. package/out/_next/static/chunks/0op3htrvd-ix6.js +0 -5
  252. package/out/_next/static/chunks/1-wbp_4f-c4-3.js +0 -837
  253. package/out/_next/static/chunks/11vnr4kb9qkjr.js +0 -1
  254. package/out/_next/static/chunks/14eqp21pspjud.js +0 -234
  255. package/out/_next/static/chunks/1eokbzdgdicpa.js +0 -33
  256. package/out/_next/static/chunks/1f0t23r6y0hni.js +0 -1
  257. package/out/_next/static/chunks/1ia6hdgf7pj9y.js +0 -174
  258. package/out/_next/static/chunks/1oqc8etm-romv.js +0 -1
  259. package/out/_next/static/chunks/1tbd6m-xvx0um.js +0 -353
  260. package/out/_next/static/chunks/1tw97cvdosb89.js +0 -5
  261. package/out/_next/static/chunks/1ubmbegreszhk.js +0 -1
  262. package/out/_next/static/chunks/1uw7hr3o4w5cj.js +0 -8
  263. package/out/_next/static/chunks/1xybsisfyvqrj.js +0 -115
  264. package/out/_next/static/chunks/1zdral15la_p7.js +0 -99
  265. package/out/_next/static/chunks/2-4610weysas_.js +0 -1
  266. package/out/_next/static/chunks/22duvsj-priip.js +0 -7
  267. package/out/_next/static/chunks/22rdge7enz4nd.js +0 -12
  268. package/out/_next/static/chunks/2b4k5t_myq-pa.js +0 -1
  269. package/out/_next/static/chunks/2dz0_3jf4m9cy.js +0 -31
  270. package/out/_next/static/chunks/2erqawjj0rnih.js +0 -117
  271. package/out/_next/static/chunks/2grm6dtosrvoq.js +0 -1
  272. package/out/_next/static/chunks/2imf3_f1_ex86.js +0 -1
  273. package/out/_next/static/chunks/2iwst7mjldlcz.js +0 -1
  274. package/out/_next/static/chunks/2ja0dztzyw8zw.js +0 -1
  275. package/out/_next/static/chunks/2ja1--2x_gs49.js +0 -83
  276. package/out/_next/static/chunks/2lec5u8obskt6.js +0 -5
  277. package/out/_next/static/chunks/2pogx3xggqd8y.js +0 -1
  278. package/out/_next/static/chunks/3205eg3ochzp4.js +0 -297
  279. package/out/_next/static/chunks/3368kg846t33d.js +0 -57
  280. package/out/_next/static/chunks/33oz-znvi5-m6.js +0 -1
  281. package/out/_next/static/chunks/3e38rrs6dszgt.js +0 -8
  282. package/out/_next/static/chunks/3eth7s2-06yuz.js +0 -1
  283. package/out/_next/static/chunks/3i4_3b36nutw7.js +0 -33
  284. package/out/_next/static/chunks/3lzin6_25n8rs.js +0 -30
  285. package/out/_next/static/chunks/3onharcadlou0.js +0 -327
  286. package/out/_next/static/chunks/3tg_clsx6ux4o.js +0 -1
  287. package/out/_next/static/chunks/3ttz1zgoq3xmp.js +0 -1
  288. package/out/_next/static/chunks/3ytp87o76hzmx.js +0 -100
  289. package/out/_next/static/chunks/40kvu3lk3s9h2.js +0 -276
  290. package/out/_next/static/chunks/44qc0zn0tudui.js +0 -2
  291. /package/out/_next/static/{bg3Z_ZBjStiTvJAHlsPDE → WEaZ5SW9HLnJWzXs84JMH}/_clientMiddlewareManifest.js +0 -0
  292. /package/out/_next/static/{bg3Z_ZBjStiTvJAHlsPDE → WEaZ5SW9HLnJWzXs84JMH}/_ssgManifest.js +0 -0
@@ -1,7 +1,7 @@
1
- (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,34071,(e,s,t)=>{let r="/works/WorkDetailPage";(window.__NEXT_P=window.__NEXT_P||[]).push([r,()=>e.r(9459)]),s.hot&&s.hot.dispose(function(){window.__NEXT_P.push([r])})},65897,e=>{"use strict";var s=e.i(91398),t=e.i(56206);e.s(["f",0,({value:e,className:r,onChange:a=()=>{},rows:l=7,...i})=>{let d=Math.max(e?e.split("\n").length:1,l);return(0,s.jsx)("textarea",{className:(0,t.U)("text-black dark:bg-slate-900 dark:text-slate-200 border-transparent border-t border-t-border-subtle resize-y",r),value:e,onChange:a,rows:d,...i})}])},50647,e=>{"use strict";var s=e.i(91398),t=e.i(91788);e.s(["f",0,({text:e,children:r})=>{let[a,l]=(0,t.useState)(!1);return(0,s.jsxs)("div",{className:"relative",children:[(0,s.jsx)("div",{onMouseEnter:()=>{l(!0)},onMouseLeave:()=>{l(!1)},children:r}),a&&(0,s.jsx)("div",{className:"tooltip absolute p-2 bg-slate-700 text-white rounded-lg whitespace-nowrap",children:e})]})}])},97776,e=>{"use strict";var s=e.i(91398),t=e.i(56206),r=e.i(60741),a=e.i(82226),l=e.i(54879);e.s(["f",0,({validators:e=[],className:i,...d})=>{let o=(0,r.f)({validators:[...e,a.G],...d}),n=o.value?new Date(o.value).toISOString().split("T")[0]:"";return(0,s.jsx)(l.f,{...o,className:d.containerClassName,children:(0,s.jsx)("input",{type:"date",id:o.id,name:o.name,disabled:o.disabled,className:(0,t.U)("relative mt-0 block w-full appearance-none rounded-md rounded-b-md border-1 border-border-default px-4 py-2.5 text-sm text-text-primary dark:bg-slate-900 placeholder-slate-400 shadow-xs focus:z-10 focus:outline-hidden focus:ring-2 focus:ring-focus-ring",i,{"border-rose-700 placeholder:text-rose-300":!!o.error}),onChange:o.onChange,onBlur:o.onBlur,value:n,placeholder:o.placeholder,autoComplete:"off",...d})})}])},23239,e=>{"use strict";var s=e.i(91398),t=e.i(56206),r=e.i(65897),a=e.i(60741),l=e.i(54879);e.s(["f",0,({validators:e=[],rows:i=10,...d})=>{let o=(0,a.f)({...d,validators:[...e,{isValid:e=>{try{return JSON?.parse(e),!0}catch(e){return!1}},intlMessageDescriptor:{id:"invalid_json_input",defaultMessage:"Invalid JSON input"}}]});return(0,s.jsx)(l.f,{...o,children:(0,s.jsx)(r.f,{className:(0,t.U)("mt-1 block w-full max-w-full rounded-md border-1 border-border-default dark:bg-slate-900 dark:text-slate-200 shadow-xs dark:shadow-none focus:ring-focus-ring sm:text-sm",{"border-rose-300 text-rose-600 focus:border-rose-600 focus:ring-rose-600":!!o.error},d.className),disabled:o.disabled,id:o.name,name:o.name,onChange:e=>{try{JSON.parse(e.target.value||"{}"),o.setError("")}catch(e){o.setError(e.message?.replace("JSON.parse",""))}finally{o.setValue(e.target.value,!0),o.setTouched(!0)}},onBlur:e=>{try{o.setValue(JSON.stringify(JSON.parse(e.target.value),void 0,2),!0),o.setError("")}catch(e){o.setError(e.message)}},placeholder:o.placeholder,autoComplete:o.autoComplete,value:o.value})})}])},30595,54020,e=>{"use strict";var s=e.i(98170),t=e.i(50216),r=e.i(27861),a=e.i(36980),l=e.i(57322),i=e.i(24323),d=e.i(60836),o=e.i(2848);let n=["years","months","weeks","days","hours","minutes","seconds"];e.s(["f",0,()=>({getScheduledTime:e=>{if(!e)return null;let{scheduled:n,status:c,started:u}=e;if("FAILED"===c||"SUCCESS"===c||"DELETED"===c)return null;let m=new Date(n).getTime();if("ALLOCATED"===c||"NEW"===c&&!u){var x;return x={addSuffix:!0},function(e,s,n){let c,u=(0,r.f)(),m=n?.locale??u.locale??t.f,x=(0,d.f)(e,s);if(isNaN(x))throw RangeError("Invalid time value");let f=Object.assign({},n,{addSuffix:n?.addSuffix,comparison:x}),[h,p]=(0,i.f)(n?.in,...x>0?[s,e]:[e,s]),g=(0,a.f)(n?.roundingMethod??"round"),b=p.getTime()-h.getTime(),w=b/o.z,v=(b-((0,l.f)(p)-(0,l.f)(h)))/o.z,j=n?.unit;if("second"===(c=j||(w<1?"second":w<60?"minute":w<o.k?"hour":v<o.d?"day":v<o.l?"month":"year"))){let e=g(b/1e3);return m.formatDistance("xSeconds",e,f)}if("minute"===c){let e=g(w);return m.formatDistance("xMinutes",e,f)}if("hour"===c){let e=g(w/60);return m.formatDistance("xHours",e,f)}if("day"===c){let e=g(v/o.k);return m.formatDistance("xDays",e,f)}if("month"===c){let e=g(v/o.d);return 12===e&&"month"!==j?m.formatDistance("xYears",1,f):m.formatDistance("xMonths",e,f)}else{let e=g(v/o.l);return m.formatDistance("xYears",e,f)}}(m,(0,s.f)(m,Date.now()),x)}return null},getDuration:e=>{var s,a;let l,i,d,o,c,u;if(!e)return null;let{started:m,finished:x}=e,f=new Date().getTime();return m?(s={hours:Number(Math.floor((l=x?new Date(x).getTime()-new Date(m).getTime():f-new Date(m).getTime())/1e3/60/60)%24),minutes:Number(Math.floor(l/1e3/60)%60),seconds:Number(Math.ceil(l/1e3)%60)},a={zero:!1},i=(0,r.f)(),d=a?.locale??i.locale??t.f,o=a?.format??n,c=a?.zero??!1,u=a?.delimiter??" ",d.formatDistance?o.reduce((e,t)=>{let r=`x${t.replace(/(^.)/,e=>e.toUpperCase())}`,a=s[t];return void 0!==a&&(c||s[t])?e.concat(d.formatDistance(r,a)):e},[]).join(u):""):null}})],30595);var c=e.i(91398);e.s(["f",0,({work:e,children:s=null})=>e?.original?e?.original?.retries===e?.retries?(0,c.jsxs)("span",{children:[(0,c.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor",className:"w-3 h-3 inline-block text-slate-500 mr-2",children:(0,c.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M16.023 9.348h4.992v-.001M2.985 19.644v-4.992m0 0h4.992m-4.993 0 3.181 3.183a8.25 8.25 0 0 0 13.803-3.7M4.031 9.865a8.25 8.25 0 0 1 13.803-3.7l3.181 3.182m0-4.991v4.99"})}),s]}):(0,c.jsx)("span",{children:(0,c.jsxs)("span",{children:[(0,c.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor",className:"w-3 h-3 inline-block text-slate-500 mr-2",children:(0,c.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M16.023 9.348h4.992v-.001M2.985 19.644v-4.992m0 0h4.992m-4.993 0 3.181 3.183a8.25 8.25 0 0 0 13.803-3.7M4.031 9.865a8.25 8.25 0 0 1 13.803-3.7l3.181 3.182m0-4.991v4.99"})}),s,(0,c.jsx)("span",{className:"text-rose-400 text-sm ml-2",children:`${e?.retries} / ${e?.original?.retries}`})]})}):s],54020)},9459,e=>{"use strict";var s=e.i(91398),t=e.i(3828),r=e.i(3326),a=e.i(28401),l=e.i(41158),i=e.i(91788),d=e.i(42469),o=e.i(84818),n=e.i(60193),c=e.i(65897),u=e.i(30595),m=e.i(50647),x=e.i(54020);let f=({work:e})=>{let{formatMessage:t}=(0,r.X)(),{formatDateTime:a}=(0,o.f)(),{getDuration:f,getScheduledTime:h}=(0,u.f)(),[,p]=(0,i.useState)(null);(0,i.useEffect)(()=>{let s=null;return e&&("NEW"===e.status||"ALLOCATED"===e.status)&&(s=setInterval(()=>p(Date.now()),1e3)),()=>{clearInterval(s)}},[e?.status]);let g={timeStyle:"medium",dateStyle:"long"};return(0,s.jsx)("div",{className:`rounded-xl xl:-mx-8 mt-10 p-2 sm:p-6 lg:p-8 ${(0,n.c)(e?.status)}`,children:(0,s.jsxs)("div",{className:"grid grid-cols-1 gap-8 lg:grid-cols-2 auto-rows-max",children:[(0,s.jsxs)("div",{className:"max-h-fit col-span-2 rounded-lg border border-border-default bg-surface-input p-4 shadow-md dark:shadow-none sm:p-6 lg:col-span-1 lg:p-8",children:[(0,s.jsxs)("div",{className:"mb-2 flex flex-wrap items-center justify-between",children:[(0,s.jsx)("div",{className:"mr-4 text-base text-text-muted ",children:t({id:"work_type",defaultMessage:"Work type"})}),(0,s.jsx)("div",{className:"mt-2 max-w-prose space-y-5 text-sm",children:e?.type})]}),(0,s.jsxs)("div",{className:"mb-2 flex flex-wrap items-center justify-between",children:[(0,s.jsx)("div",{className:"mr-4 text-base text-text-muted ",children:t({id:"work_status",defaultMessage:"Work Status"})}),(0,s.jsx)(d.f,{text:e?.status,color:n.Q[e?.status]})]}),(0,s.jsxs)("div",{className:"mb-2 flex flex-wrap items-center justify-between",children:[(0,s.jsx)("div",{className:"mr-4 text-base text-text-muted ",children:t({id:"work_priority",defaultMessage:"Priority"})}),(0,s.jsx)("div",{className:"mt-2 max-w-prose space-y-5 text-sm ",children:e?.priority})]}),(0,s.jsxs)("div",{className:"mb-2 flex flex-wrap items-center justify-between",children:[(0,s.jsx)("div",{className:"mr-4 text-base text-text-muted ",children:t({id:"work_retries",defaultMessage:"Retries"})}),(0,s.jsx)("div",{className:"mt-2 max-w-prose space-y-5 text-sm",children:(0,s.jsx)(x.f,{work:e})})]}),(0,s.jsxs)("div",{className:"mb-2 flex flex-wrap items-center justify-between",children:[(0,s.jsx)("div",{className:"mr-4 text-base text-text-muted ",children:t({id:"worker",defaultMessage:"Worker"})}),(0,s.jsx)("div",{className:"mt-2 max-w-prose space-y-5 text-sm",children:e?.worker?(0,s.jsx)(d.f,{text:t({id:"worker_dynamic",defaultMessage:"{worker}"},{worker:e?.worker}),color:"purple"}):"n/a"})]}),e?.retries||e?.original?(0,s.jsxs)("div",{className:"mb-2 flex flex-wrap items-center justify-between",children:[(0,s.jsx)("div",{className:"mr-4 text-base text-text-muted ",children:t({id:"work_original",defaultMessage:"Original Work"})}),(0,s.jsx)("div",{className:"mt-2 max-w-prose space-y-5 text-sm",children:(0,s.jsx)(l.default,{href:`/works?workerId=${e?.original?._id}`,className:"text-text-primary",children:e?.original?._id})})]}):""]}),(0,s.jsx)("div",{className:"col-span-2 rounded-lg border border-border-default bg-surface-input p-4 shadow-md dark:shadow-none sm:p-6 lg:col-span-1 lg:p-8",children:(0,s.jsxs)("div",{className:"grid grid-cols-2 gap-5",children:[(0,s.jsxs)("div",{className:"sm:col-span-1",children:[(0,s.jsx)("div",{className:"flex text-base text-text-muted ",children:t({id:"work_created",defaultMessage:"Created"})}),(0,s.jsx)("div",{className:"flex text-sm",children:a(e?.created,g)})]}),(0,s.jsxs)("div",{className:"sm:col-span-1",children:[(0,s.jsx)("div",{className:"flex text-base text-text-muted ",children:t({id:"work_scheduled",defaultMessage:"Scheduled"})}),(0,s.jsx)("div",{className:"flex text-sm w-100",children:(0,s.jsx)(m.f,{text:a(e?.scheduled,g),children:h(e)})})]}),(0,s.jsxs)("div",{className:"sm:col-span-1",children:[(0,s.jsx)("div",{className:"flex text-base text-text-muted ",children:t({id:"work_started",defaultMessage:"Started"})}),(0,s.jsx)("div",{className:"flex text-sm",children:a(e?.started,g)})]}),(0,s.jsxs)("div",{className:"sm:col-span-1",children:[(0,s.jsx)("div",{className:"flex text-base text-text-muted ",children:t({id:"work_finished",defaultMessage:"Finished"})}),(0,s.jsx)("div",{className:"flex text-sm",children:a(e?.finished,g)})]}),(0,s.jsxs)("div",{className:"sm:col-span-1",children:[(0,s.jsx)("div",{className:"flex text-base text-text-muted ",children:t({id:"duration",defaultMessage:"Duration"})}),(0,s.jsx)("div",{className:"flex text-sm",children:f(e)})]}),e?.deleted&&(0,s.jsxs)("div",{className:"sm:col-span-1",children:[(0,s.jsx)("div",{className:"flex text-base text-text-muted ",children:t({id:"deleted",defaultMessage:"Deleted"})}),(0,s.jsx)("div",{className:"flex text-sm",children:a(e?.deleted,g)})]})]})}),e?.error&&(0,s.jsxs)("div",{className:"rounded-lg shadow-md dark:shadow-none border-2 border-rose-300 dark:border-rose-800 col-span-2 lg:col-span-2 order-first overflow-hidden bg-rose-100 dark:bg-rose-800",children:[(0,s.jsx)("div",{className:"px-4 py-5 sm:px-6 border-b border-rose-300 dark:border-rose-800",children:(0,s.jsxs)("h3",{className:"text-lg font-medium leading-6 text-rose-700 dark:text-rose-300 flex items-center gap-2",children:[(0,s.jsx)("svg",{className:"w-6 h-6",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 8v4m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})}),t({id:"error",defaultMessage:"Error"})]})}),(0,s.jsx)("div",{className:"bg-rose-50 dark:bg-rose-950",children:(0,s.jsx)(c.f,{value:decodeURI(JSON.stringify(e.error,null,2)),disabled:!0,className:"block border-none w-full max-w-full resize-none sm:text-sm text-rose-900 dark:text-rose-100"})})]}),e?.input&&(0,s.jsxs)("div",{className:"overflow-hidden rounded-lg border border-border-default col-span-2 shadow-md dark:shadow-none bg-surface-input lg:col-span-1",children:[(0,s.jsx)("div",{className:"px-4 py-5 sm:px-6",children:(0,s.jsx)("h3",{className:"text-lg font-medium leading-6 text-slate-900 dark:text-slate-500",children:t({id:"input",defaultMessage:"Input"})})}),(0,s.jsx)(c.f,{value:JSON.stringify(e.input,null,2),disabled:!0,className:"block w-full max-w-full resize-none sm:text-sm"})]}),e?.result&&(0,s.jsxs)("div",{className:"overflow-hidden rounded-lg shadow-md dark:shadow-none border border-border-default col-span-2 bg-surface-input lg:col-span-1",children:[(0,s.jsxs)("div",{className:"px-4 py-5 sm:px-6 flex items-center justify-between",children:[(0,s.jsx)("h3",{className:"text-lg font-medium leading-6 text-slate-900 dark:text-slate-500",children:t({id:"result",defaultMessage:"Result"})}),e?.type==="BULK_IMPORT"&&e?.result?.created&&(0,s.jsx)("span",{className:"text-sm text-text-secondary",children:t({id:"items_created",defaultMessage:"{count} items created"},{count:e.result.created.length})})]}),(0,s.jsx)(c.f,{value:JSON.stringify(e.result,null,2),disabled:!0,className:`block w-full max-w-full resize-none sm:text-sm ${e?.type==="BULK_IMPORT"&&e?.result?.created?.length>50?"max-h-96 overflow-y-auto":""}`})]})]})})};var h=e.i(63104),p=e.i(59080),g=e.i(76204);let b=p.a`
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,34071,(e,s,t)=>{let r="/works/WorkDetailPage";(window.__NEXT_P=window.__NEXT_P||[]).push([r,()=>e.r(9459)]),s.hot&&s.hot.dispose(function(){window.__NEXT_P.push([r])})},65897,e=>{"use strict";var s=e.i(91398),t=e.i(56206);e.s(["f",0,({value:e,className:r,onChange:a=()=>{},rows:l=7,...i})=>{let d=Math.max(e?e.split("\n").length:1,l);return(0,s.jsx)("textarea",{className:(0,t.U)("text-black dark:bg-slate-900 dark:text-slate-200 border-transparent border-t border-t-border-subtle resize-y",r),value:e,onChange:a,rows:d,...i})}])},50647,e=>{"use strict";var s=e.i(91398),t=e.i(91788);e.s(["f",0,({text:e,children:r})=>{let[a,l]=(0,t.useState)(!1);return(0,s.jsxs)("div",{className:"relative",children:[(0,s.jsx)("div",{onMouseEnter:()=>{l(!0)},onMouseLeave:()=>{l(!1)},children:r}),a&&(0,s.jsx)("div",{className:"tooltip absolute p-2 bg-slate-700 text-white rounded-lg whitespace-nowrap",children:e})]})}])},97776,e=>{"use strict";var s=e.i(91398),t=e.i(56206),r=e.i(60741),a=e.i(82226),l=e.i(54879);e.s(["f",0,({validators:e=[],className:i,...d})=>{let n=(0,r.f)({validators:[...e,a.G],...d}),o=n.value?new Date(n.value).toISOString().split("T")[0]:"";return(0,s.jsx)(l.f,{...n,className:d.containerClassName,children:(0,s.jsx)("input",{type:"date",id:n.id,name:n.name,disabled:n.disabled,className:(0,t.U)("relative mt-0 block w-full appearance-none rounded-md rounded-b-md border-1 border-border-default px-4 py-2.5 text-sm text-text-primary dark:bg-slate-900 placeholder-slate-400 shadow-xs focus:z-10 focus:outline-hidden focus:ring-2 focus:ring-focus-ring",i,{"border-rose-700 placeholder:text-rose-300":!!n.error}),onChange:n.onChange,onBlur:n.onBlur,value:o,placeholder:n.placeholder,autoComplete:"off",...d})})}])},23239,e=>{"use strict";var s=e.i(91398),t=e.i(56206),r=e.i(65897),a=e.i(60741),l=e.i(54879);e.s(["f",0,({validators:e=[],rows:i=10,...d})=>{let n=(0,a.f)({...d,validators:[...e,{isValid:e=>{try{return JSON?.parse(e),!0}catch(e){return!1}},intlMessageDescriptor:{id:"invalid_json_input",defaultMessage:"Invalid JSON input"}}]});return(0,s.jsx)(l.f,{...n,children:(0,s.jsx)(r.f,{className:(0,t.U)("mt-1 block w-full max-w-full rounded-md border-1 border-border-default dark:bg-slate-900 dark:text-slate-200 shadow-xs dark:shadow-none focus:ring-focus-ring sm:text-sm",{"border-rose-300 text-rose-600 focus:border-rose-600 focus:ring-rose-600":!!n.error},d.className),disabled:n.disabled,id:n.name,name:n.name,onChange:e=>{try{JSON.parse(e.target.value||"{}"),n.setError("")}catch(e){n.setError(e.message?.replace("JSON.parse",""))}finally{n.setValue(e.target.value,!0),n.setTouched(!0)}},onBlur:e=>{try{n.setValue(JSON.stringify(JSON.parse(e.target.value),void 0,2),!0),n.setError("")}catch(e){n.setError(e.message)}},placeholder:n.placeholder,autoComplete:n.autoComplete,value:n.value})})}])},30595,54020,e=>{"use strict";var s=e.i(98170),t=e.i(50216),r=e.i(27861),a=e.i(36980),l=e.i(57322),i=e.i(24323),d=e.i(60836),n=e.i(2848);let o=["years","months","weeks","days","hours","minutes","seconds"];e.s(["f",0,()=>({getScheduledTime:e=>{if(!e)return null;let{scheduled:o,status:c,started:u}=e;if("FAILED"===c||"SUCCESS"===c||"DELETED"===c)return null;let m=new Date(o).getTime();if("ALLOCATED"===c||"NEW"===c&&!u){var x;return x={addSuffix:!0},function(e,s,o){let c,u=(0,r.f)(),m=o?.locale??u.locale??t.f,x=(0,d.f)(e,s);if(isNaN(x))throw RangeError("Invalid time value");let f=Object.assign({},o,{addSuffix:o?.addSuffix,comparison:x}),[h,p]=(0,i.f)(o?.in,...x>0?[s,e]:[e,s]),g=(0,a.f)(o?.roundingMethod??"round"),b=p.getTime()-h.getTime(),w=b/n.z,v=(b-((0,l.f)(p)-(0,l.f)(h)))/n.z,j=o?.unit;if("second"===(c=j||(w<1?"second":w<60?"minute":w<n.k?"hour":v<n.d?"day":v<n.l?"month":"year"))){let e=g(b/1e3);return m.formatDistance("xSeconds",e,f)}if("minute"===c){let e=g(w);return m.formatDistance("xMinutes",e,f)}if("hour"===c){let e=g(w/60);return m.formatDistance("xHours",e,f)}if("day"===c){let e=g(v/n.k);return m.formatDistance("xDays",e,f)}if("month"===c){let e=g(v/n.d);return 12===e&&"month"!==j?m.formatDistance("xYears",1,f):m.formatDistance("xMonths",e,f)}else{let e=g(v/n.l);return m.formatDistance("xYears",e,f)}}(m,(0,s.f)(m,Date.now()),x)}return null},getDuration:e=>{var s,a;let l,i,d,n,c,u;if(!e)return null;let{started:m,finished:x}=e,f=new Date().getTime();return m?(s={hours:Number(Math.floor((l=x?new Date(x).getTime()-new Date(m).getTime():f-new Date(m).getTime())/1e3/60/60)%24),minutes:Number(Math.floor(l/1e3/60)%60),seconds:Number(Math.ceil(l/1e3)%60)},a={zero:!1},i=(0,r.f)(),d=a?.locale??i.locale??t.f,n=a?.format??o,c=a?.zero??!1,u=a?.delimiter??" ",d.formatDistance?n.reduce((e,t)=>{let r=`x${t.replace(/(^.)/,e=>e.toUpperCase())}`,a=s[t];return void 0!==a&&(c||s[t])?e.concat(d.formatDistance(r,a)):e},[]).join(u):""):null}})],30595);var c=e.i(91398);e.s(["f",0,({work:e,children:s=null})=>e?.original?e?.original?.retries===e?.retries?(0,c.jsxs)("span",{children:[(0,c.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor",className:"w-3 h-3 inline-block text-slate-500 mr-2",children:(0,c.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M16.023 9.348h4.992v-.001M2.985 19.644v-4.992m0 0h4.992m-4.993 0 3.181 3.183a8.25 8.25 0 0 0 13.803-3.7M4.031 9.865a8.25 8.25 0 0 1 13.803-3.7l3.181 3.182m0-4.991v4.99"})}),s]}):(0,c.jsx)("span",{children:(0,c.jsxs)("span",{children:[(0,c.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor",className:"w-3 h-3 inline-block text-slate-500 mr-2",children:(0,c.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M16.023 9.348h4.992v-.001M2.985 19.644v-4.992m0 0h4.992m-4.993 0 3.181 3.183a8.25 8.25 0 0 0 13.803-3.7M4.031 9.865a8.25 8.25 0 0 1 13.803-3.7l3.181 3.182m0-4.991v4.99"})}),s,(0,c.jsx)("span",{className:"text-rose-400 text-sm ml-2",children:`${e?.retries} / ${e?.original?.retries}`})]})}):s],54020)},9459,e=>{"use strict";var s=e.i(91398),t=e.i(3828),r=e.i(3326),a=e.i(28401),l=e.i(41158),i=e.i(91788),d=e.i(42469),n=e.i(84818),o=e.i(60193),c=e.i(65897),u=e.i(30595),m=e.i(50647),x=e.i(54020);let f=({work:e})=>{let{formatMessage:t}=(0,r.X)(),{formatDateTime:a}=(0,n.f)(),{getDuration:f,getScheduledTime:h}=(0,u.f)(),[,p]=(0,i.useState)(null);(0,i.useEffect)(()=>{let s=null;return e&&("NEW"===e.status||"ALLOCATED"===e.status)&&(s=setInterval(()=>p(Date.now()),1e3)),()=>{clearInterval(s)}},[e?.status]);let g={timeStyle:"medium",dateStyle:"long"};return(0,s.jsx)("div",{className:`rounded-xl xl:-mx-8 mt-10 p-2 sm:p-6 lg:p-8 ${(0,o.c)(e?.status)}`,children:(0,s.jsxs)("div",{className:"grid grid-cols-1 gap-8 lg:grid-cols-2 auto-rows-max",children:[(0,s.jsxs)("div",{className:"max-h-fit col-span-2 rounded-lg border border-border-default bg-surface-input p-4 shadow-md dark:shadow-none sm:p-6 lg:col-span-1 lg:p-8",children:[(0,s.jsxs)("div",{className:"mb-2 flex flex-wrap items-center justify-between",children:[(0,s.jsx)("div",{className:"mr-4 text-base text-text-muted ",children:t({id:"work_type",defaultMessage:"Work type"})}),(0,s.jsx)("div",{className:"mt-2 max-w-prose space-y-5 text-sm",children:e?.type})]}),(0,s.jsxs)("div",{className:"mb-2 flex flex-wrap items-center justify-between",children:[(0,s.jsx)("div",{className:"mr-4 text-base text-text-muted ",children:t({id:"work_status",defaultMessage:"Work Status"})}),(0,s.jsx)(d.f,{text:e?.status,color:o.Q[e?.status]})]}),(0,s.jsxs)("div",{className:"mb-2 flex flex-wrap items-center justify-between",children:[(0,s.jsx)("div",{className:"mr-4 text-base text-text-muted ",children:t({id:"work_priority",defaultMessage:"Priority"})}),(0,s.jsx)("div",{className:"mt-2 max-w-prose space-y-5 text-sm ",children:e?.priority})]}),(0,s.jsxs)("div",{className:"mb-2 flex flex-wrap items-center justify-between",children:[(0,s.jsx)("div",{className:"mr-4 text-base text-text-muted ",children:t({id:"work_retries",defaultMessage:"Retries"})}),(0,s.jsx)("div",{className:"mt-2 max-w-prose space-y-5 text-sm",children:(0,s.jsx)(x.f,{work:e})})]}),(0,s.jsxs)("div",{className:"mb-2 flex flex-wrap items-center justify-between",children:[(0,s.jsx)("div",{className:"mr-4 text-base text-text-muted ",children:t({id:"worker",defaultMessage:"Worker"})}),(0,s.jsx)("div",{className:"mt-2 max-w-prose space-y-5 text-sm",children:e?.worker?(0,s.jsx)(d.f,{text:t({id:"worker_dynamic",defaultMessage:"{worker}"},{worker:e?.worker}),color:"purple"}):"n/a"})]}),e?.retries||e?.original?(0,s.jsxs)("div",{className:"mb-2 flex flex-wrap items-center justify-between",children:[(0,s.jsx)("div",{className:"mr-4 text-base text-text-muted ",children:t({id:"work_original",defaultMessage:"Original Work"})}),(0,s.jsx)("div",{className:"mt-2 max-w-prose space-y-5 text-sm",children:(0,s.jsx)(l.default,{href:`/works?workerId=${e?.original?._id}`,className:"text-text-primary",children:e?.original?._id})})]}):""]}),(0,s.jsx)("div",{className:"col-span-2 rounded-lg border border-border-default bg-surface-input p-4 shadow-md dark:shadow-none sm:p-6 lg:col-span-1 lg:p-8",children:(0,s.jsxs)("div",{className:"grid grid-cols-2 gap-5",children:[(0,s.jsxs)("div",{className:"sm:col-span-1",children:[(0,s.jsx)("div",{className:"flex text-base text-text-muted ",children:t({id:"work_created",defaultMessage:"Created"})}),(0,s.jsx)("div",{className:"flex text-sm",children:a(e?.created,g)})]}),(0,s.jsxs)("div",{className:"sm:col-span-1",children:[(0,s.jsx)("div",{className:"flex text-base text-text-muted ",children:t({id:"work_scheduled",defaultMessage:"Scheduled"})}),(0,s.jsx)("div",{className:"flex text-sm w-100",children:(0,s.jsx)(m.f,{text:a(e?.scheduled,g),children:h(e)})})]}),(0,s.jsxs)("div",{className:"sm:col-span-1",children:[(0,s.jsx)("div",{className:"flex text-base text-text-muted ",children:t({id:"work_started",defaultMessage:"Started"})}),(0,s.jsx)("div",{className:"flex text-sm",children:a(e?.started,g)})]}),(0,s.jsxs)("div",{className:"sm:col-span-1",children:[(0,s.jsx)("div",{className:"flex text-base text-text-muted ",children:t({id:"work_finished",defaultMessage:"Finished"})}),(0,s.jsx)("div",{className:"flex text-sm",children:a(e?.finished,g)})]}),(0,s.jsxs)("div",{className:"sm:col-span-1",children:[(0,s.jsx)("div",{className:"flex text-base text-text-muted ",children:t({id:"duration",defaultMessage:"Duration"})}),(0,s.jsx)("div",{className:"flex text-sm",children:f(e)})]}),e?.deleted&&(0,s.jsxs)("div",{className:"sm:col-span-1",children:[(0,s.jsx)("div",{className:"flex text-base text-text-muted ",children:t({id:"deleted",defaultMessage:"Deleted"})}),(0,s.jsx)("div",{className:"flex text-sm",children:a(e?.deleted,g)})]})]})}),e?.error&&(0,s.jsxs)("div",{className:"rounded-lg shadow-md dark:shadow-none border-2 border-rose-300 dark:border-rose-800 col-span-2 lg:col-span-2 order-first overflow-hidden bg-rose-100 dark:bg-rose-800",children:[(0,s.jsx)("div",{className:"px-4 py-5 sm:px-6 border-b border-rose-300 dark:border-rose-800",children:(0,s.jsxs)("h3",{className:"text-lg font-medium leading-6 text-rose-700 dark:text-rose-300 flex items-center gap-2",children:[(0,s.jsx)("svg",{className:"w-6 h-6",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 8v4m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})}),t({id:"error",defaultMessage:"Error"})]})}),(0,s.jsx)("div",{className:"bg-rose-50 dark:bg-rose-950",children:(0,s.jsx)(c.f,{value:decodeURI(JSON.stringify(e.error,null,2)),disabled:!0,className:"block border-none w-full max-w-full resize-none sm:text-sm text-rose-900 dark:text-rose-100"})})]}),e?.input&&(0,s.jsxs)("div",{className:"overflow-hidden rounded-lg border border-border-default col-span-2 shadow-md dark:shadow-none bg-surface-input lg:col-span-1",children:[(0,s.jsx)("div",{className:"px-4 py-5 sm:px-6",children:(0,s.jsx)("h3",{className:"text-lg font-medium leading-6 text-slate-900 dark:text-slate-500",children:t({id:"input",defaultMessage:"Input"})})}),(0,s.jsx)(c.f,{value:JSON.stringify(e.input,null,2),disabled:!0,className:"block w-full max-w-full resize-none sm:text-sm"})]}),e?.result&&(0,s.jsxs)("div",{className:"overflow-hidden rounded-lg shadow-md dark:shadow-none border border-border-default col-span-2 bg-surface-input lg:col-span-1",children:[(0,s.jsxs)("div",{className:"px-4 py-5 sm:px-6 flex items-center justify-between",children:[(0,s.jsx)("h3",{className:"text-lg font-medium leading-6 text-slate-900 dark:text-slate-500",children:t({id:"result",defaultMessage:"Result"})}),e?.type==="BULK_IMPORT"&&e?.result?.created&&(0,s.jsx)("span",{className:"text-sm text-text-secondary",children:t({id:"items_created",defaultMessage:"{count} items created"},{count:e.result.created.length})})]}),(0,s.jsx)(c.f,{value:JSON.stringify(e.result,null,2),disabled:!0,className:`block w-full max-w-full resize-none sm:text-sm ${e?.type==="BULK_IMPORT"&&e?.result?.created?.length>50?"max-h-96 overflow-y-auto":""}`})]})]})})};var h=e.i(63104),p=e.i(59080),g=e.i(76204);let b=p.a`
2
2
  mutation RemoveWork($workId: ID!) {
3
3
  removeWork(workId: $workId) {
4
4
  _id
5
5
  }
6
6
  }
7
- `;var w=e.i(30086),v=e.i(53576),j=e.i(25327),k=e.i(50595),N=e.i(15971),y=e.i(6607),M=e.i(21623),_=e.i(24608),S=e.i(86129);e.i(51523);var D=e.i(19518),C=e.i(5505),T=e.i(97776),I=e.i(69211),O=e.i(23239),W=e.i(21128),E=e.i(16984),R=e.i(98949);let L=({work:e,onSubmit:a})=>{let{formatMessage:l,locale:i}=(0,r.X)(),d=(0,t.useRouter)(),o=l({id:"work_added_success",defaultMessage:"Work added successfully!"}),n=(0,R.f)({submit:a,successMessage:o,onSubmitSuccess:(e,{_id:s})=>(d.replace(`/works?workerId=${s}`),!0),enableReinitialize:!0,initialValues:{...e,input:JSON.stringify(e?.input||{},null,2)}});return(0,s.jsx)(C.U,{children:(0,s.jsx)(I.f,{form:n,children:(0,s.jsxs)("div",{className:"space-y-6 rounded-md bg-surface-input shadow-md ",children:[(0,s.jsx)("h2",{className:"text-2xl font-bold text-text-primary ",children:l({id:"retry_work",defaultMessage:"Retry Work"})}),(0,s.jsx)("div",{className:"flex flex-col sm:flex-row sm:justify-between sm:items-center dark:border-slate-700 pb-4 mb-4",children:(0,s.jsx)("div",{className:"text-sm text-text-muted mt-2 sm:mt-0 flex flex-col sm:flex-row sm:gap-4",children:(0,s.jsxs)("span",{children:[(0,s.jsx)("strong",{children:l({id:"type",defaultMessage:"Type"})})," ",e.type]})})}),(0,s.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[(0,s.jsx)(E.f,{name:"priority",id:"priority",label:l({id:"priority",defaultMessage:"Priority"}),labelClassName:"text-sm font-medium text-slate-500 mb-1",type:"number",className:"w-full py-2 text-sm text-text-primary dark:bg-slate-800 rounded-md"}),(0,s.jsx)(E.f,{name:"retries",id:"retries",label:l({id:"retries",defaultMessage:"Retries"}),labelClassName:"text-sm font-medium text-slate-500 mb-1",type:"number",className:"w-full py-2 text-sm text-text-primary dark:bg-slate-800 rounded-md"})]}),(0,s.jsx)(T.f,{name:"scheduled",label:l({id:"scheduled",defaultMessage:"Scheduled"}),labelClassName:"text-sm font-medium text-slate-500 mb-1",className:"w-full py-2 text-sm text-text-primary dark:bg-slate-800 rounded-md",containerClassName:"w-full",locale:i,showTimeInput:!0,timeFormat:"p",timeIntervals:15}),(0,s.jsx)("div",{children:(0,s.jsx)(O.f,{name:"input",label:l({id:"input",defaultMessage:"Input"}),labelClassName:"text-sm font-medium text-slate-500 mb-1",className:"w-full h-48 text-sm text-text-primary dark:bg-slate-800 rounded-md"})}),(0,s.jsx)("div",{className:"border-t-slate-100 border-t border-t-border-subtle space-y-6 bg-surface-subtle p-5 text-right",children:(0,s.jsx)(W.f,{label:l({id:"retry_submit",defaultMessage:"Retry"})})})]})})})};e.s(["default",0,({workerId:e})=>{let l,{formatMessage:d}=(0,r.X)(),{push:o}=(0,t.useRouter)(),{work:n}=(0,h.U)({workId:e,pollInterval:2e3}),{setModal:c}=(0,y.f)(),{removeWork:u}=(()=>{let[e]=(0,g.f)(b);return{removeWork:async({workId:s})=>e({variables:{workId:s},refetchQueries:["WorkQueue"]})}})(),{addWork:m}=(0,w.f)(),x=(0,i.useCallback)(async()=>{c((0,s.jsx)(L,{work:n,onSubmit:async e=>{try{let{data:s}=await m({type:n?.type,priority:e.priority||n?.priority,retries:e.retries,scheduled:e.scheduled,input:JSON.parse(e.input||"{}"),originalWorkId:n?._id});return o(`/works?workerId=${s.addWork._id}`),c(null),{success:!0}}catch(e){return{success:!1,error:e}}}}),{closeOnOutsideClick:!0})},[n]),p=async()=>{await c((0,s.jsx)(N.f,{onCancelClick:()=>c(""),message:d({id:"delete_work_confirmation",defaultMessage:"This action might cause inconsistencies with other data that relates to it. Are you sure you want to delete this work? "}),onOkClick:async()=>{c(""),await u({workId:e}),a.toast.success(d({id:"work_deleted",defaultMessage:"Work deleted successfully"}))},okText:d({id:"delete_work",defaultMessage:"Delete work"})}))};return(0,s.jsxs)("div",{className:"mt-5 max-w-full",children:[(0,s.jsx)(k.f,{}),(0,s.jsxs)("div",{className:"items-center flex min-w-full justify-between gap-3 flex-wrap",children:[(0,s.jsx)(j.f,{headerText:d({id:"work_detail",defaultMessage:"Work Detail"}),title:d({id:"work_detail_title",defaultMessage:"Work {id}"},{id:n?._id})}),n&&(n?.status===D.i.Failed||n?.status===D.i.Success)?(0,s.jsxs)("button",{type:"button","aria-describedby":"header-delete-button",className:"my-auto flex items-center justify-center rounded-sm border-1 border-emerald-600 px-3 py-2 text-sm font-semibold text-emerald-600 shadow-xs hover:border-emerald-800 hover:bg-emerald-700 hover:text-white focus:outline-hidden focus:ring-2 focus:ring-emerald-700 focus:ring-offset-2",onClick:x,children:[(0,s.jsx)("span",{className:"pr-1",children:(0,s.jsx)(S.f,{className:"h-5 w-5"})}),d({id:"retry-work",defaultMessage:"Retry"})]}):null,n&&((l=n?.status)===D.i.New||l===D.i.Allocated)?(0,s.jsx)(M.f,{variant:"danger",icon:(0,s.jsx)(_.f,{className:"h-5 w-5"}),text:"Delete",onClick:p}):null]}),n?(0,s.jsx)(f,{work:n}):(0,s.jsx)(v.f,{variant:"detail"})]})}],9459)},86129,e=>{"use strict";var s=e.i(94396);e.s(["f",()=>s.f])},36980,e=>{"use strict";e.s(["f",0,function(e){return s=>{let t=(e?Math[e]:Math.trunc)(s);return 0===t?0:t}}])},60836,e=>{"use strict";var s=e.i(35113);e.s(["f",0,function(e,t){let r=(0,s.f)(e)-(0,s.f)(t);return r<0?-1:r>0?1:r}])}]);
7
+ `;var w=e.i(30086),v=e.i(53576),j=e.i(25327),k=e.i(50595),N=e.i(15971),y=e.i(6607),M=e.i(21623),_=e.i(24608),S=e.i(86129);e.i(51523);var D=e.i(19518),C=e.i(5505),T=e.i(97776),I=e.i(69211),O=e.i(23239),W=e.i(21128),E=e.i(16984),R=e.i(98949);let L=({work:e,onSubmit:a})=>{let{formatMessage:l,locale:i}=(0,r.X)(),d=(0,t.useRouter)(),n=l({id:"work_added_success",defaultMessage:"Work added successfully!"}),o=(0,R.f)({submit:a,successMessage:n,onSubmitSuccess:(e,{_id:s})=>(d.replace(`/works?workerId=${s}`),!0),enableReinitialize:!0,initialValues:{...e,input:JSON.stringify(e?.input||{},null,2)}});return(0,s.jsx)(C.U,{children:(0,s.jsx)(I.f,{form:o,children:(0,s.jsxs)("div",{className:"space-y-6 rounded-md bg-surface-input shadow-md ",children:[(0,s.jsx)("h2",{className:"text-2xl font-bold text-text-primary ",children:l({id:"retry_work",defaultMessage:"Retry Work"})}),(0,s.jsx)("div",{className:"flex flex-col sm:flex-row sm:justify-between sm:items-center dark:border-slate-700 pb-4 mb-4",children:(0,s.jsx)("div",{className:"text-sm text-text-muted mt-2 sm:mt-0 flex flex-col sm:flex-row sm:gap-4",children:(0,s.jsxs)("span",{children:[(0,s.jsx)("strong",{children:l({id:"type",defaultMessage:"Type"})})," ",e.type]})})}),(0,s.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[(0,s.jsx)(E.f,{name:"priority",id:"priority",label:l({id:"priority",defaultMessage:"Priority"}),labelClassName:"text-sm font-medium text-slate-500 mb-1",type:"number",className:"w-full py-2 text-sm text-text-primary dark:bg-slate-800 rounded-md"}),(0,s.jsx)(E.f,{name:"retries",id:"retries",label:l({id:"retries",defaultMessage:"Retries"}),labelClassName:"text-sm font-medium text-slate-500 mb-1",type:"number",className:"w-full py-2 text-sm text-text-primary dark:bg-slate-800 rounded-md"})]}),(0,s.jsx)(T.f,{name:"scheduled",label:l({id:"scheduled",defaultMessage:"Scheduled"}),labelClassName:"text-sm font-medium text-slate-500 mb-1",className:"w-full py-2 text-sm text-text-primary dark:bg-slate-800 rounded-md",containerClassName:"w-full",locale:i,showTimeInput:!0,timeFormat:"p",timeIntervals:15}),(0,s.jsx)("div",{children:(0,s.jsx)(O.f,{name:"input",validators:[{isValid:e=>!String(e??"").includes("******"),intlMessageDescriptor:{id:"retry_masked_input",defaultMessage:"The input contains masked values (******). Replace them before retrying."}}],label:l({id:"input",defaultMessage:"Input"}),labelClassName:"text-sm font-medium text-slate-500 mb-1",className:"w-full h-48 text-sm text-text-primary dark:bg-slate-800 rounded-md"})}),(0,s.jsx)("div",{className:"border-t-slate-100 border-t border-t-border-subtle space-y-6 bg-surface-subtle p-5 text-right",children:(0,s.jsx)(W.f,{label:l({id:"retry_submit",defaultMessage:"Retry"})})})]})})})};e.s(["default",0,({workerId:e})=>{let l,{formatMessage:d}=(0,r.X)(),{push:n}=(0,t.useRouter)(),{work:o}=(0,h.U)({workId:e,pollInterval:2e3}),{setModal:c}=(0,y.f)(),{removeWork:u}=(()=>{let[e]=(0,g.f)(b);return{removeWork:async({workId:s})=>e({variables:{workId:s},refetchQueries:["WorkQueue"]})}})(),{addWork:m}=(0,w.f)(),x=(0,i.useCallback)(async()=>{c((0,s.jsx)(L,{work:o,onSubmit:async e=>{try{let{data:s}=await m({type:o?.type,priority:e.priority||o?.priority,retries:e.retries,scheduled:e.scheduled,input:JSON.parse(e.input||"{}"),originalWorkId:o?._id});return n(`/works?workerId=${s.addWork._id}`),c(null),{success:!0}}catch(e){return{success:!1,error:e}}}}),{closeOnOutsideClick:!0})},[o]),p=async()=>{await c((0,s.jsx)(N.f,{onCancelClick:()=>c(""),message:d({id:"delete_work_confirmation",defaultMessage:"This action might cause inconsistencies with other data that relates to it. Are you sure you want to delete this work? "}),onOkClick:async()=>{c(""),await u({workId:e}),a.toast.success(d({id:"work_deleted",defaultMessage:"Work deleted successfully"}))},okText:d({id:"delete_work",defaultMessage:"Delete work"})}))};return(0,s.jsxs)("div",{className:"mt-5 max-w-full",children:[(0,s.jsx)(k.f,{}),(0,s.jsxs)("div",{className:"items-center flex min-w-full justify-between gap-3 flex-wrap",children:[(0,s.jsx)(j.f,{headerText:d({id:"work_detail",defaultMessage:"Work Detail"}),title:d({id:"work_detail_title",defaultMessage:"Work {id}"},{id:o?._id})}),o&&(o?.status===D.i.Failed||o?.status===D.i.Success)?(0,s.jsxs)("button",{type:"button","aria-describedby":"header-delete-button",className:"my-auto flex items-center justify-center rounded-sm border-1 border-emerald-600 px-3 py-2 text-sm font-semibold text-emerald-600 shadow-xs hover:border-emerald-800 hover:bg-emerald-700 hover:text-white focus:outline-hidden focus:ring-2 focus:ring-emerald-700 focus:ring-offset-2",onClick:x,children:[(0,s.jsx)("span",{className:"pr-1",children:(0,s.jsx)(S.f,{className:"h-5 w-5"})}),d({id:"retry-work",defaultMessage:"Retry"})]}):null,o&&((l=o?.status)===D.i.New||l===D.i.Allocated)?(0,s.jsx)(M.f,{variant:"danger",icon:(0,s.jsx)(_.f,{className:"h-5 w-5"}),text:"Delete",onClick:p}):null]}),o?(0,s.jsx)(f,{work:o}):(0,s.jsx)(v.f,{variant:"detail"})]})}],9459)},86129,e=>{"use strict";var s=e.i(94396);e.s(["f",()=>s.f])},36980,e=>{"use strict";e.s(["f",0,function(e){return s=>{let t=(e?Math[e]:Math.trunc)(s);return 0===t?0:t}}])},60836,e=>{"use strict";var s=e.i(35113);e.s(["f",0,function(e,t){let r=(0,s.f)(e)-(0,s.f)(t);return r<0?-1:r>0?1:r}])}]);
@@ -0,0 +1,371 @@
1
+ (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,21002,(e,t,s)=>{let a="/enrollments";(window.__NEXT_P=window.__NEXT_P||[]).push([a,()=>e.r(58994)]),t.hot&&t.hot.dispose(function(){window.__NEXT_P.push([a])})},95789,e=>{"use strict";var t=e.i(91398),s=e.i(56206),a=e.i(88566),l=e.i(25575),r=e.i(91788);let i=({header:e,body:i,headerCSS:n="",bodyCSS:d="",itemContainerCSS:o="",itemindex:c=1,hideChevron:m=!1})=>{let[u,x]=(0,r.useState)(!1);return(0,t.jsxs)("div",{className:(0,s.U)("mt-3",o),"data-itemindex":c,children:[(0,t.jsxs)("button",{type:"button",onClick:()=>x(!u),className:(0,s.U)("relative cursor-pointer border dark:border-slate-800 bg-surface-input text-text-muted hover:bg-surface-raised w-full max-w-full overflow-hidden",n),children:[(0,t.jsx)("div",{className:"w-full",children:e}),!m&&(0,t.jsx)("span",{className:"px-2",children:u?(0,t.jsx)(l.f,{className:"h-5 w-5"}):(0,t.jsx)(a.f,{className:"h-5 w-5"})})]}),u?(0,t.jsx)("div",{className:(0,s.U)("rounded-lg sm:p-4 xl:p-10 relative overflow-visible",d),children:i}):""]})};e.s(["f",0,({data:e,containerCSS:a="",headerCSS:l="",bodyCSS:r="",itemContainerCSS:n="",hideChevron:d=!1,...o})=>(0,t.jsx)("div",{className:(0,s.U)("my-3",a),...o,children:e.map(({header:e,body:s},a)=>(0,t.jsx)(i,{itemindex:a,header:e,body:s,headerCSS:l,bodyCSS:r,itemContainerCSS:n,hideChevron:d},a))})],95789)},25093,e=>{"use strict";var t=e.i(91398),s=e.i(91788);e.s(["f",0,({value:e,duration:a=300})=>{let[l,r]=(0,s.useState)(0);return(0,s.useEffect)(()=>{let t,s;if(0===e)return void r(0);let l=i=>{t||(t=i);let n=Math.min((i-t)/a,1);r(Math.round((1-Math.pow(1-n,3))*e)),n<1&&(s=requestAnimationFrame(l))};return s=requestAnimationFrame(l),()=>{s&&cancelAnimationFrame(s)}},[e,a]),(0,t.jsx)("span",{children:l})}])},57986,26013,e=>{"use strict";var t=e.i(91398),s=e.i(3326),a=e.i(15361),l=e.i(10833);e.s(["f",()=>l.f],26013);var l=l,r=e.i(67912),i=e.i(41158),n=e.i(93380),d=e.i(87284);let o=({username:e})=>(0,t.jsx)(r.f,{className:"h-8 w-8 text-slate-800 dark:text-slate-600"});e.s(["f",0,({user:e,contact:r})=>{let{formatMessage:c}=(0,s.X)();return(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)("div",{className:"h-8 w-8 rounded-full",children:e?.avatar?(0,t.jsx)(d.f,{src:e.avatar.url,alt:e.name||e.username,width:100,height:100}):(0,t.jsx)(o,{username:e?.username})}),(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-4",children:[(0,t.jsx)("div",{className:"flex items-center justify-between gap-3 flex-wrap",children:(0,t.jsxs)("span",{className:"flex items-center",children:[(0,t.jsx)("h3",{className:"text-xl font-semibold capitalize",children:(0,t.jsx)(i.default,{href:`/users?userId=${e?._id}`,className:"text-text-secondary hover:text-slate-900 dark:hover:text-slate-600",children:(0,n.f)(e)})}),e?.primaryEmail?.verified&&(0,t.jsxs)("dl",{className:"self-end",children:[(0,t.jsx)("dt",{className:"sr-only",children:c({id:"account_status",defaultMessage:"Account status"})}),(0,t.jsx)("dd",{className:"mt-3 flex items-center self-end text-sm font-medium capitalize text-slate-900 sm:mr-6 sm:mt-0",children:e?.primaryEmail?.verified?(0,t.jsx)(a.f,{className:"h-4 w-4 shrink-0 text-emerald-400","aria-hidden":"true"}):(0,t.jsx)(l.f,{className:"h-4 w-4 shrink-0 text-rose-400","aria-hidden":"true"})})]})]})}),r?.emailAddress&&(0,t.jsx)("div",{children:r.emailAddress}),r?.telNumber&&(0,t.jsx)("div",{children:r.telNumber})]})]})}],57986)},65897,e=>{"use strict";var t=e.i(91398),s=e.i(56206);e.s(["f",0,({value:e,className:a,onChange:l=()=>{},rows:r=7,...i})=>{let n=Math.max(e?e.split("\n").length:1,r);return(0,t.jsx)("textarea",{className:(0,s.U)("text-black dark:bg-slate-900 dark:text-slate-200 border-transparent border-t border-t-border-subtle resize-y",a),value:e,onChange:l,rows:n,...i})}])},70553,e=>{"use strict";var t=e.i(91398),s=e.i(3326);e.s(["f",0,({children:e=null,totalRecords:a=null})=>{let{formatMessage:l}=(0,s.X)();return(0,t.jsxs)("div",{className:"mt-5",children:[null!==a?(0,t.jsx)("div",{className:"text-md text-slate-950 dark:text-slate-100 mb-3",children:l({id:"total_records",defaultMessage:"{total} records found"},{total:a??0})}):null,e&&(0,t.jsx)("div",{className:"flex items-center mt-10",children:(0,t.jsx)("h3",{className:"text-xs leading-6 text-text-muted",children:e})})]})}])},2194,e=>{"use strict";var t=e.i(91398),s=e.i(92802),s=s,a=e.i(56206),l=e.i(3326);e.s(["f",0,({message:e,className:r="",Icon:i=null})=>(0,t.jsx)("div",{className:(0,a.U)("rounded-md flex w-full flex-col items-center justify-center min-h-[176px] py-8 border-1 border-dashed border-border-default text-slate-500 dark:text-slate-600",r),children:(0,t.jsxs)("div",{className:"grid items-center justify-center",children:[(0,t.jsx)("div",{className:"flex items-center justify-center text-slate-400 dark:text-slate-600",children:i||(0,t.jsx)(s.f,{className:"h-6 w-6"})}),(0,t.jsx)(l.L,{id:"no_data_message",defaultMessage:"<p>No <span> {message} available</span> </p>",values:{p:e=>(0,t.jsx)("p",{className:"mt-2 m-auto flex items-center justify-center",children:e}),span:e=>(0,t.jsxs)("span",{className:"capitalize ml-1",children:[" ",e," "]}),message:e}})]})})],2194)},76069,e=>{"use strict";var t=e.i(91398),s=e.i(81618),a=e.i(56206);e.s(["f",0,({className:e="",containerClassName:l="",Icon:r=null})=>(0,t.jsx)("span",{className:(0,a.U)("text-slate-400",l),children:r||(0,t.jsx)(s.f,{className:(0,a.U)(e)})})])},35429,e=>{"use strict";var t=e.i(91398),s=e.i(56206),a=e.i(3326),l=e.i(21128);e.s(["f",0,({cancelText:e=null,showCancel:r=!0,submitText:i=null,showSubmit:n=!0,onCancel:d,className:o=""})=>{let{formatMessage:c}=(0,a.X)();return(0,t.jsxs)("span",{className:(0,s.U)("flex shrink-0 items-center space-x-4 py-5 pl-1",o),children:[r?(0,t.jsx)("button",{onClick:d,"data-id":"cancel_update",type:"button",className:(0,s.U)("focus:ring-focus-ring","inline-flex items-center rounded-md border border-border-default bg-surface px-4 py-2 text-sm font-medium text-text-secondary shadow-xs hover:bg-surface-raised focus:outline-hidden focus:ring-2 focus:ring-focus-ring focus:ring-offset-2"),children:e||c({id:"cancel",defaultMessage:"Cancel"})}):null,n?(0,t.jsx)(l.f,{label:i||c({id:"save",defaultMessage:"Save"})}):null]})}])},35793,e=>{"use strict";var t=e.i(91398),s=e.i(3326),a=e.i(2765);e.s(["f",0,({inputText:e=null,onInputChange:l,defaultValue:r})=>{let{formatMessage:i}=(0,s.X)(),n=(0,a.f)(200)(l);return(0,t.jsxs)("div",{className:"w-full",children:[(0,t.jsx)("label",{htmlFor:"search",className:"sr-only",children:e||i({id:"search",defaultMessage:"Search"})}),(0,t.jsxs)("div",{className:"relative",children:[(0,t.jsx)("div",{className:"pointer-events-none absolute inset-y-0 left-0 flex items-center pl-3",children:(0,t.jsx)("svg",{className:"h-5 w-5 text-slate-400 dark:text-slate-200",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",children:(0,t.jsx)("path",{fillRule:"evenodd",d:"M8 4a4 4 0 100 8 4 4 0 000-8zM2 8a6 6 0 1110.89 3.476l4.817 4.817a1 1 0 01-1.414 1.414l-4.816-4.816A6 6 0 012 8z",clipRule:"evenodd"})})}),(0,t.jsx)("input",{onChange:e=>n(e.target.value),id:"search",defaultValue:r,name:"search",className:"block w-full rounded-md border-1 border-border-default text-slate-900 dark:bg-slate-900 dark:text-slate-200 py-3 pl-10 px-4 shadow-xs placeholder:text-slate-400 dark:placeholder:text-slate-400 focus:ring-2 focus:ring-focus-ring focus:outline-hidden sm:text-sm",placeholder:i({id:"search",defaultMessage:"Search"}),type:"search"})]})]})}])},76038,e=>{"use strict";var t=e.i(91398),s=e.i(91788),a=e.i(56206),l=e.i(3326),r=e.i(42469);let i=e=>e?Array.isArray(e)?e:e.toString()?.split(",")?.map(e=>e.trim()):[];e.s(["f",0,({tagList:e,onChange:n,disabled:d=!1,name:o="tag-input",id:c="tag-input",placeholder:m="",selectOptions:u=[],className:x="",buttonText:f="",showTagsInline:h=!0})=>{let{formatMessage:p}=(0,l.X)(),[g,b]=(0,s.useState)(i(e)),[j,v]=(0,s.useState)(""),[y,N]=(0,s.useState)(!1),w=(0,s.useRef)(null);(0,s.useEffect)(()=>{b(i(e))},[e]),(0,s.useEffect)(()=>{let e=e=>{w.current&&!w.current.contains(e.target)&&N(!1)};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[]);let _=(0,s.useCallback)(e=>{let t=e.trim(),s=u.find(e=>e.value.toLowerCase()===t.toLowerCase()),a=s?.value||t;if(!g.some(e=>e.toLowerCase()===a.toLowerCase())&&a){let e=[...g,a];b(e),n(e),v(""),N(!1)}},[g,n,u]),C=(0,s.useMemo)(()=>{let e=u.filter(e=>!g.some(t=>t.toLowerCase()===e.value.toLowerCase()));return j?e.filter(e=>e.label.toLowerCase().includes(j.toLowerCase())):e},[u,g,j]),E=j.trim().toLowerCase(),M=!!(E&&!g.some(e=>e.toLowerCase()===E)&&!u.some(e=>e.value.toLowerCase()===E)),S=(0,t.jsxs)("div",{className:"relative",ref:w,children:[(0,t.jsx)("input",{id:c,name:o,type:"text",role:"combobox","aria-expanded":y,"aria-autocomplete":"list",disabled:d,className:(0,a.U)("w-full rounded-md border border-border-default bg-surface-input py-2.5 pl-4 pr-4 text-sm text-text-primary placeholder:text-text-muted shadow-xs focus:outline-hidden focus:ring-2 focus:ring-focus-ring",x),placeholder:m,value:j,onChange:e=>{v(e.target.value),N(!0)},onFocus:()=>N(!0),onKeyDown:e=>{"Enter"===e.key&&j.trim()&&(e.preventDefault(),_(C[0]?.value||j.trim()))}}),y&&(M||C.length>0)&&(0,t.jsxs)("ul",{role:"listbox",className:"absolute z-9999999 mt-1 max-h-60 w-full overflow-auto rounded-md bg-surface border border-border-subtle py-1 text-sm shadow-lg",children:[C.map(e=>(0,t.jsx)("li",{role:"option","aria-selected":!1,className:"cursor-pointer select-none py-2 px-4 text-text-primary hover:bg-surface-raised",onMouseDown:t=>{t.preventDefault(),_(e.value)},children:e.label},e.value)),M&&(0,t.jsx)("li",{role:"option","aria-selected":!1,className:"cursor-pointer select-none border-t border-border-subtle py-2 px-4 text-text-primary hover:bg-surface-raised",onMouseDown:e=>{e.preventDefault(),_(j.trim())},children:f||p({id:"add_new_tag",defaultMessage:'Add "{inputValue}"'},{inputValue:j.trim()})})]})]});return h?(0,t.jsxs)(t.Fragment,{children:[S,(0,t.jsx)("div",{className:(0,a.U)("ml-4 flex items-center flex-wrap gap-5",g.length>0&&"mt-1"),children:g?.map(e=>(0,t.jsx)(r.f,{text:e,color:"slate",onClick:()=>(e=>{let t=g.indexOf(e);if(-1!==t){let e=[...g];e.splice(t,1),n(e),b(e)}})(e)},e))})]}):S}])},97776,e=>{"use strict";var t=e.i(91398),s=e.i(56206),a=e.i(60741),l=e.i(82226),r=e.i(54879);e.s(["f",0,({validators:e=[],className:i,...n})=>{let d=(0,a.f)({validators:[...e,l.G],...n}),o=d.value?new Date(d.value).toISOString().split("T")[0]:"";return(0,t.jsx)(r.f,{...d,className:n.containerClassName,children:(0,t.jsx)("input",{type:"date",id:d.id,name:d.name,disabled:d.disabled,className:(0,s.U)("relative mt-0 block w-full appearance-none rounded-md rounded-b-md border-1 border-border-default px-4 py-2.5 text-sm text-text-primary dark:bg-slate-900 placeholder-slate-400 shadow-xs focus:z-10 focus:outline-hidden focus:ring-2 focus:ring-focus-ring",i,{"border-rose-700 placeholder:text-rose-300":!!d.error}),onChange:d.onChange,onBlur:d.onBlur,value:o,placeholder:d.placeholder,autoComplete:"off",...n})})}])},10685,e=>{"use strict";var t=e.i(91398),s=e.i(56206),a=e.i(60741),l=e.i(54879);e.s(["f",0,e=>{let{options:r,...i}=(0,a.f)(e),{className:n}=e||{className:""};return(0,t.jsx)(l.f,{...i,children:(0,t.jsx)("div",{className:"select-wrap",children:(0,t.jsxs)("select",{className:(0,s.U)("block w-full bg-surface-input rounded-md border-1 border-border-default py-2.5 pl-3 pr-10 text-base text-text-primary shadow-xs focus:outline-hidden focus:ring-2 focus:ring-focus-ring sm:text-sm",n,{"border-rose-700 text-rose-600 dark:border-rose-500 dark:text-rose-400":!!i.error}),disabled:i.disabled,id:i.name,name:i.name,onChange:i.onChange,onBlur:i.onBlur,value:i.value,children:[(0,t.jsx)("option",{className:"text-text-secondary",value:"",disabled:i.required,hidden:i.required,children:i.placeholder||i.label}),Object.entries(r).map(([e,s])=>(0,t.jsx)("option",{className:"text-text-secondary",value:e,children:s},e))]})})})}])},87213,e=>{"use strict";var t=e.i(91398),s=e.i(56206),a=e.i(82226),l=e.i(60741),r=e.i(54879);e.s(["f",0,({maxLength:e,validators:i=[],...n})=>{let d=(0,l.f)({validators:[...i,e&&(0,a.f)(e)],...n});return(0,t.jsx)(r.f,{...d,children:(0,t.jsx)("textarea",{className:(0,s.U)("relative mt-1 block w-full dark:focus:autofill dark:hover:autofill dark:autofill dark:placeholder:text-slate-400 dark:bg-slate-900 dark:text-slate-200 appearance-none rounded-md border-1 border-border-default px-4 py-2.5 text-sm text-slate-900 placeholder-slate-400 shadow-xs placeholder:text-slate-400 focus:outline-hidden focus:ring-2 focus:ring-focus-ring",d.className,{"border-rose-700 placeholder:text-rose-300 placeholder-rose-300":!!d.error}),disabled:d.disabled,id:d.name,name:d.name,rows:d.rows||10,onChange:d.onChange,onBlur:d.onBlur,placeholder:d.placeholder,autoComplete:d.autoComplete||"off",value:d.value})})}])},78704,e=>{"use strict";var t=e.i(91398),s=e.i(91788),a=e.i(53576);e.s(["f",0,({loading:e,hasMore:l,onLoadMore:r,children:i,threshold:n=200})=>{let d=(0,s.useRef)(null),o=(0,s.useRef)(e),c=(0,s.useRef)(l),m=(0,s.useRef)(r);return o.current=e,c.current=l,m.current=r,(0,s.useEffect)(()=>{let e=d.current;if(!e)return;let t=new IntersectionObserver(e=>{let t=e.at(-1);t?.isIntersecting&&c.current&&!o.current&&m.current()},{rootMargin:`${n}px`});return t.observe(e),()=>t.disconnect()},[n,l]),(0,t.jsxs)(t.Fragment,{children:[i,l&&(0,t.jsx)("div",{ref:d,className:"h-4"}),e&&(0,t.jsx)("div",{className:"flex justify-center py-4",children:(0,t.jsx)(a.f,{variant:"list"})})]})}])},11056,e=>{"use strict";var t=e.i(91398),s=e.i(91788),a=e.i(5505),l=e.i(57561);e.s(["f",0,({children:e,onlyFull:r=!1})=>{let{languageDialectList:i,selectedLocale:n,setSelectedLocale:d}=(0,l.f)(),o=(0,s.useContext)(a.W),c=i.filter(e=>!r||e.isoCode.includes("-"));return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{className:`w-fit mt-5 mb-3 ${o?"ml-5":""}`,children:(0,t.jsx)("select",{id:"locale-wrapper",className:"cursor-pointer rounded-md border-1 border-border-default py-1 pr-8 text-sm lg:py-1 lg:pr-10 text-black dark:text-white dark:bg-slate-800 shadow-xs focus:outline-hidden focus:ring-2 focus:ring-focus-ring",value:n||"",onChange:e=>{e.stopPropagation(),d(e.target.value)},children:c?.map(e=>(0,t.jsx)("option",{value:e.isoCode,children:e.isoCode},e._id))})}),(0,t.jsx)("div",{children:s.default.cloneElement(e)})]})}])},77043,e=>{"use strict";var t=e.i(91398),s=e.i(56206),a=e.i(3326),l=e.i(87284),r=e.i(76069);e.s(["f",0,({file:e,className:i=""})=>{let{formatMessage:n}=(0,a.X)();return(0,t.jsx)("div",{className:(0,s.U)("h-10 w-10 shrink-0",i),children:e?(0,t.jsx)(l.f,{className:"relative h-10 w-10 rounded-sm",src:e.url,width:100,height:100,alt:n({id:"image_not_available",defaultMessage:"Image not available"})}):(0,t.jsx)(r.f,{})})}])},51128,e=>{"use strict";var t=e.i(91398),s=e.i(3326),a=e.i(3828),l=e.i(35793),r=e.i(76038),i=e.i(42469),n=e.i(83147),d=e.i(73319);e.s(["f",0,({children:e,onSearchChange:o,defaultSearchValue:c,showTagFilter:m=!1,availableTagOptions:u=[]})=>{let{formatMessage:x}=(0,s.X)(),{query:f,push:h}=(0,a.useRouter)(),p=e=>{let{skip:t,tags:s,...a}=f;h({query:(0,d.T)(e)?(0,n._)(a,e.join(","),"tags"):(0,n._)(a)})};return(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{className:"my-3 flex flex-col gap-3",children:(0,t.jsxs)("div",{className:"flex flex-col sm:flex-row sm:items-start gap-3",children:[(0,t.jsx)("div",{className:"flex-shrink-0",children:(0,t.jsx)(l.f,{onInputChange:o,defaultValue:c})}),m&&(0,t.jsxs)("div",{className:"flex flex-col gap-2 flex-1 sm:border-l sm:border-border-default sm:pl-3",children:[(0,t.jsx)("div",{className:"max-w-xs",children:(0,t.jsx)(r.f,{buttonText:x({id:"apply",defaultMessage:"Apply"}),placeholder:x({id:"enter_tag",defaultMessage:"Enter tag..."}),tagList:f?.tags?.split(","),onChange:p,selectOptions:u,showTagsInline:!1})}),f?.tags?.split(",").filter(Boolean).length>0&&(0,t.jsx)("div",{className:"flex flex-wrap gap-2",children:f?.tags?.split(",").filter(Boolean).map(e=>(0,t.jsx)(i.f,{text:e,color:"slate",onClick:()=>{let t=f?.tags?.split(",").filter(t=>t!==e);p(t.length>0?t:null)}},e))})]})]})}),e]})}])},92229,e=>{"use strict";var t=e.i(91398),s=e.i(3326);e.s(["f",0,({selectedStatuses:e=[],onStatusChange:a,statuses:l})=>{let{formatMessage:r}=(0,s.X)(),i=Array.isArray(e)?e:[],n=e=>{let{value:t,checked:s}=e.target;a(s?[...i,t]:i.filter(e=>e!==t))};return l?.map(e=>(0,t.jsxs)("div",{className:"inline-flex items-center rounded-md py-2 text-sm font-medium text-slate-900",children:[(0,t.jsx)("input",{className:"h-4 w-4 rounded-sm border-border-default bg-white dark:!bg-slate-800 text-slate-950 focus:ring-focus-ring",type:"checkbox",id:e,name:e,value:e,checked:i.includes(e),onChange:n}),(0,t.jsx)("div",{className:"ml-2",children:(0,t.jsx)("label",{className:"text-sm text-slate-600 dark:text-slate-200",htmlFor:e,children:r({id:e.toLowerCase(),defaultMessage:e})})})]},e))}])},66885,e=>{"use strict";var t=e.i(91398),s=e.i(3326),a=e.i(38322),l=e.i(84818),r=e.i(83147),i=e.i(51782);e.s(["f",0,({data:e,statusTypes:n,timeline:d})=>{let{formatMessage:o}=(0,s.X)(),{formatDateTime:c}=(0,l.f)(),{content:m={},id:u}=d[e?.status]||{},x=n.filter(({value:e})=>d[e]?.visible);return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{className:"flow-root sm:hidden",children:(0,t.jsx)("ul",{className:"my-4",children:x.map(({value:s,label:l},i)=>(0,t.jsx)("li",{children:(0,t.jsxs)("div",{className:"relative pb-8",children:[i!==x.length-1?(0,t.jsx)("span",{className:(0,r.S)(u>i+1?"bg-slate-900":"bg-slate-200","absolute top-2.5 left-2.5 -ml-px h-full w-0.5"),"aria-hidden":"true"}):null,(0,t.jsxs)("div",{className:"relative flex items-center space-x-3",children:[(0,t.jsx)("div",{children:(0,t.jsx)("span",{className:(0,r.S)(u>i?"bg-slate-900":"bg-slate-600","flex h-5 w-5 items-center justify-center rounded-full"),children:u>i?(0,t.jsx)(a.f,{className:"h-5 w-5 text-white","aria-hidden":"true"}):null})}),(0,t.jsxs)("div",{className:"ml-4 flex min-w-0 flex-1 items-center justify-between",children:[(0,t.jsx)("div",{className:"flex-auto",children:(0,t.jsx)("p",{className:"text-sm text-slate-500",children:(0,t.jsxs)("span",{className:"flex w-full items-center justify-between text-text-primary",children:[s,d[s]?.Component&&d[s].Component]})})}),u>=d[s].id?(0,t.jsx)("div",{className:"whitespace-nowrap text-right text-sm text-text-muted ml-4",children:e[d?.[s]?.content]?c(e[d?.[s]?.content],{dateStyle:"short",timeStyle:"short"}):null}):null]})]})]})},`${s}${l}`))})}),(0,t.jsxs)("div",{className:" p-4 bg-white shadow-sm dark:shadow-none dark:border dark:border-slate-700 sm:rounded-lg dark:bg-slate-900",children:[(0,t.jsxs)("p",{className:"font-medium flex items-center justify-between",children:[(0,t.jsx)(i.f,{status:e.status}),(0,t.jsx)("span",{children:e[m]?c(e[m],{dateStyle:"full",timeStyle:"medium"}):o({id:"in_cart",defaultMessage:"In cart"})})]}),(0,t.jsx)("div",{className:"mt-2","aria-hidden":"true",children:(0,t.jsx)("div",{className:"mt-2 hidden text-sm font-medium text-slate-600 sm:flex",children:x.map(({value:s,label:a})=>(0,t.jsxs)("div",{className:"sm:flex-auto",children:[(0,t.jsx)("div",{className:"relative mb-4 mr-1",children:(0,t.jsx)("span",{className:(0,r.S)(u>=d[s].id?e?.status==="CONFIRMED"?"bg-lime-600":e?.status==="PENDING"?"bg-amber-600":e?.status==="OPEN"?"bg-sky-600":"bg-emerald-600":"bg-surface-raised","absolute top-0 left-0 -ml-px h-2 w-full"),"aria-hidden":"true"})}),(0,t.jsxs)("div",{className:(0,r.S)(u>=d[s].id?"text-slate-900":"opacity-50","text-start"),children:[(0,t.jsx)("span",{className:"text-slate-900 dark:text-slate-400 uppercase",children:d[s]?.Component?d[s].Component:"CONFIRMED"===s?o({id:"confirmed",defaultMessage:"CONFIRMED"}):"PENDING"===s?o({id:"pending",defaultMessage:"PENDING"}):"OPEN"===s?o({id:"open",defaultMessage:"OPEN"}):"FULFILLED"===s?o({id:"fulfilled",defaultMessage:"FULFILLED"}):"REJECTED"===s?o({id:"rejected",defaultMessage:"REJECTED"}):s}),(0,t.jsx)("span",{className:"block text-text-primary",children:u>=d?.[s]?.id?c(e[d?.[s]?.content],{dateStyle:"short",timeStyle:"short"}):null})]})]},`${s}${a}`))})})]})]})}])},8918,e=>{"use strict";var t=e.i(91398),s=e.i(91788),a=e.i(56206),l=e.i(3326),r=e.i(88566),i=e.i(25575),n=e.i(3828),d=e.i(83147);let o=({onSort:e,sortDirection:s})=>s?"ASC"===s?(0,t.jsx)(i.f,{className:"ml-2 w-5 h-5 text-slate-700",onClick:e}):(0,t.jsx)(r.f,{className:"ml-2 w-5 h-5 text-slate-700",onClick:e}):(0,t.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",className:"ml-2 w-6 h-6",onClick:e,children:(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M8.25 15L12 18.75 15.75 15m-7.5-6L12 5.25 15.75 9"})});var c=e.i(2194);let m=e=>{let t=[],a=[],l=[];return s.default.Children.forEach(e.children,e=>{e?.props?.header?t.push(e):e?.props?.footer?l.push(e):a.push(e)}),{header:t,footer:l,body:a}},u=({className:e="",...r})=>{let[i,n]=(0,s.useState)(m(r)),{formatMessage:d}=(0,l.X)(),o={...i,header:s.default.Children.map(i.header,e=>s.default.cloneElement(e))};return(0,s.useEffect)(()=>{n(m(r))},[r.children]),o.header.length||o.body.length?(0,t.jsxs)("table",{className:(0,a.U)("overflow-hidden my-3 flex w-full flex-row flex-nowrap divide-y divide-slate-200 dark:divide-slate-600 shadow-sm sm:rounded-lg sm:bg-white dark:bg-slate-950",e),...r,children:[(0,t.jsx)("thead",{className:"hidden sm:table-header-group bg-surface-raised text-sm text-text-secondary",children:o.header}),o.body.length?(0,t.jsx)("tbody",{className:"space-y-4 sm:space-y-0 flex-1 sm:divide-y divide-slate-200 dark:divide-slate-700 sm:bg-white dark:sm:bg-slate-800 sm:flex-none",children:o.body}):null,o.footer.length?(0,t.jsx)("tfoot",{children:o.footer}):null]}):(0,t.jsx)(c.f,{message:d({id:"data",defaultMessage:"Data"})})};u.Row=({className:e="",children:l=[],header:r=!1,enablesort:i=!1,...n})=>{let d=s.default.Children.map(l,e=>s.default?.cloneElement(e||(0,t.jsx)("span",{}),{header:r,enablesort:i}));return(0,t.jsx)("tr",{className:(0,a.U)("grid grid-cols-1 auto-rows-fr border border-border-subtle sm:border-0 rounded-md sm:mb-0 sm:table-row sm:rounded-none bg-surface sm:bg-inherit dark:sm:bg-inherit",e),...n,children:d})},u.Cell=({className:e="",header:s=!1,enablesort:l=!1,children:r,sortKey:i=null,defaultSortDirection:c=null,...m})=>{let u=(0,n.useRouter)(),x=(0,d.v)(u.query?.sort),f=s?"th":"td";return(0,t.jsx)(f,{className:(0,a.U)(s?"px-4 py-3 text-left text-text-muted":"whitespace-nowrap px-4 py-3 text-text-muted border-b dark:border-slate-300 last:border-b-0 sm:border-b-0 text-left flex items-center sm:table-cell",e),...m,children:(0,t.jsxs)("div",{className:"flex items-center",children:[r,"th"===f&&l&&i&&(0,t.jsx)(o,{onSort:e=>{var t;let s;e.preventDefault(),((t=x[i])?"ASC"===t?"DESC":null:"ASC")||!x[i]?s={...x,[i]:"ASC"===x[i]?"DESC":"ASC"}:(delete x[i],s=x);let a=Object.entries(s).map(([e,t])=>[e,t].join("_")).join(","),{sort:l,...r}=u.query,n=Object.keys(r).map(e=>[e,r[e]].join("=")).join("&"),o=0===Object.keys(r).length?`${u.basePath}?sort=${a}`:`${u.basePath}?${n}&sort=${a}`;a?u.push(o):u.push({query:(0,d._)(r)})},sortDirection:Object.keys(x).length?x[i]:c})]})})},e.s(["f",0,u],8918)},11959,e=>{"use strict";var t=e.i(59080),s=e.i(32171);let a=t.a`
2
+ query StatusTypes($enumName: String!) {
3
+ statusTypes: __type(name: $enumName) {
4
+ options: enumValues {
5
+ value: name
6
+ label: description
7
+ }
8
+ }
9
+ }
10
+ `;e.s(["f",0,e=>{let{data:t,loading:l,error:r}=(0,s.f)(a,{variables:{enumName:e}});return{statusTypes:t?.statusTypes?.options||[],loading:l,error:r}}])},2765,e=>{"use strict";e.s(["f",0,(e=500)=>t=>{let s;return(...a)=>{let l;clearTimeout(s),s=setTimeout(()=>t.apply(l,a),e)}}])},20096,e=>{"use strict";var t=e.i(22422);e.s(["f",0,e=>t.f.is(e)?e.errors[0]:e])},77930,e=>{"use strict";var t=e.i(91398),s=e.i(3326),a=e.i(8918),l=e.i(41158),r=e.i(42469),i=e.i(84818),n=e.i(1880),d=e.i(77043),o=e.i(93380);let c={INITIAL:"orange",PAUSED:"yellow",SUSPENDED:"blue",TERMINATED:"amber",ACTIVE:"emerald"},m=({enrollment:e,showUser:m})=>{let{formatMessage:u}=(0,s.X)(),{formatDateTime:x}=(0,i.f)();return(0,t.jsxs)(a.f.Row,{children:[(0,t.jsx)(a.f.Cell,{children:(0,t.jsx)("div",{className:"text-sm",children:(0,t.jsx)(l.default,{href:`/enrollments?enrollmentId=${e._id}`,className:"font-medium text-slate-800 dark:text-slate-700",children:e?.enrollmentNumber||e._id?.substr(0,10)})})}),(0,t.jsx)(a.f.Cell,{children:(0,t.jsx)("div",{className:"flex items-center text-sm ",children:x(e.created,{dateStyle:"medium",timeStyle:"medium"})})}),(0,t.jsx)(a.f.Cell,{children:(0,t.jsx)("div",{className:"flex items-center text-sm ",children:e.isExpired?(0,t.jsx)(r.f,{text:u({id:"expired",defaultMessage:"Expired"}),color:"amber"}):e.expires?x(e.expires,{dateStyle:"medium",timeStyle:"medium"}):u({id:"renews_automatically",defaultMessage:"Renews automatically"})})}),m&&e.user&&(0,t.jsx)(a.f.Cell,{children:(0,t.jsxs)(l.default,{href:`/users?userId=${e.user._id}`,className:"flex items-center text-sm text-slate-800 dark:text-slate-700 hover:text-decoration",children:[(0,t.jsx)("span",{className:"inline-block h-9 w-9 rounded-full",children:(0,t.jsx)(d.f,{file:e?.user?.avatar,className:"mr-3"})}),(0,t.jsx)("span",{className:"ml-2",children:(0,o.f)(e.user)})]})}),(0,t.jsx)(a.f.Cell,{children:(0,t.jsxs)(l.default,{href:`/products?slug=${(0,n.U)(e.plan.product)}`,className:"flex items-center text-sm text-slate-800 dark:text-slate-700 hover:text-decoration",children:[(0,t.jsx)(d.f,{file:e?.plan?.product?.media?.[0]?.file,className:"mr-3"}),(0,t.jsx)("span",{className:"ml-2",children:e?.plan?.product?.texts?.title})]})}),(0,t.jsx)(a.f.Cell,{children:(0,t.jsx)(r.f,{text:e?.status,color:c[e.status],square:!0})})]})};e.s(["f",0,({enrollments:e,showUser:l=null,sortable:r=!1})=>{let{formatMessage:i}=(0,s.X)();return(0,t.jsxs)(a.f,{className:"min-w-full",children:[e?.map(e=>(0,t.jsxs)(a.f.Row,{header:!0,enablesort:r,children:[(0,t.jsx)(a.f.Cell,{sortKey:"enrollmentNumber",children:i({id:"enrollment_number",defaultMessage:"Enrollment number"})}),(0,t.jsx)(a.f.Cell,{sortKey:"created",children:i({id:"created",defaultMessage:"Created"})}),(0,t.jsx)(a.f.Cell,{children:i({id:"expires",defaultMessage:"Expires"})}),l&&(0,t.jsx)(a.f.Cell,{children:i({id:"user",defaultMessage:"User"})}),(0,t.jsx)(a.f.Cell,{children:i({id:"product",defaultMessage:"Product"})}),(0,t.jsx)(a.f.Cell,{sortKey:"status",children:i({id:"status",defaultMessage:"Status"})})]},e._id)),e?.map(e=>(0,t.jsx)(m,{showUser:l,enrollment:e},`${e?._id}-body`))]})}],77930)},21056,e=>{"use strict";var t=e.i(59080),s=e.i(76204);let a=t.a`
11
+ mutation SendEnrollmentEmail($email: String!) {
12
+ sendEnrollmentEmail(email: $email) {
13
+ success
14
+ }
15
+ }
16
+ `;e.s(["f",0,()=>{let[e]=(0,s.f)(a);return{sendEnrollmentEmail:async({email:t})=>e({variables:{email:t}})}}])},34728,e=>{"use strict";var t=e.i(91398),s=e.i(38322);e.s(["f",0,({onOkClick:e,buttonText:a,headerText:l,message:r,icon:i=null})=>(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{children:[i||(0,t.jsx)("div",{className:"mx-auto flex h-12 w-12 items-center justify-center rounded-full bg-emerald-100 dark:bg-emerald-900/30",children:(0,t.jsx)(s.f,{className:"h-6 w-6 text-emerald-600 dark:text-emerald-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","aria-hidden":"true"})}),(0,t.jsxs)("div",{className:"mt-3 text-center sm:mt-5",children:[(0,t.jsx)("h3",{className:"text-lg text-text-primary",id:"modal-title",children:l}),(0,t.jsx)("div",{className:"mt-2",children:(0,t.jsx)("p",{className:"text-sm text-text-muted",children:r})})]})]}),(0,t.jsx)("div",{className:"mt-5 sm:mt-6",children:(0,t.jsx)("button",{id:"alert_ok",onClick:e,type:"button",className:"inline-flex w-full justify-center rounded-md border border-transparent bg-accent px-4 py-2 text-base font-medium text-text-on-accent shadow-xs hover:bg-accent-hover focus:outline-hidden focus:ring-2 focus:ring-focus-ring focus:ring-offset-2 sm:text-sm",children:a})})]})])},51782,e=>{"use strict";var t=e.i(91398),s=e.i(3326),a=e.i(42469),l=e.i(60193);let r={PENDING:"bg-yellow-100 text-yellow-800",CONFIRMED:"bg-blue-100 text-blue-800",OPEN:"bg-gray-100 text-gray-800",FULFILLED:"bg-green-100 text-green-800",REJECTED:"bg-red-100 text-red-800"};e.s(["f",0,({status:e,className:i=""})=>{let{formatMessage:n}=(0,s.X)(),d={PENDING:n({id:"pending",defaultMessage:"PENDING"}),CONFIRMED:n({id:"confirmed",defaultMessage:"CONFIRMED"}),OPEN:n({id:"open",defaultMessage:"OPEN"}),FULFILLED:n({id:"fulfilled",defaultMessage:"FULFILLED"}),REJECTED:n({id:"rejected",defaultMessage:"REJECTED"})},o=d?.[e]??n({id:"cart",defaultMessage:"Cart"});return r?.[e],(0,t.jsx)(a.f,{text:o,color:l.v[e],square:!0,className:`uppercase ${i}`})}])},54529,e=>{"use strict";var t=e.i(59080);let s=t.a`
17
+ fragment ProductBriefFragment on Product {
18
+ texts(forceLocale: $forceLocale) {
19
+ _id
20
+ slug
21
+ title
22
+ subtitle
23
+ description
24
+ vendor
25
+ brand
26
+ labels
27
+ locale
28
+ }
29
+ _id
30
+ sequence
31
+ status
32
+ tags
33
+ sequence
34
+ updated
35
+ published
36
+ media {
37
+ _id
38
+ tags
39
+ file {
40
+ _id
41
+ url
42
+ }
43
+ }
44
+ ... on BundleProduct {
45
+ proxies {
46
+ __typename
47
+ }
48
+ }
49
+ ... on SimpleProduct {
50
+ catalogPrice {
51
+ amount
52
+ currencyCode
53
+ }
54
+ proxies {
55
+ __typename
56
+ }
57
+ }
58
+ ... on PlanProduct {
59
+ catalogPrice {
60
+ amount
61
+ currencyCode
62
+ }
63
+ proxies {
64
+ __typename
65
+ }
66
+ }
67
+ }
68
+ `;e.s(["f",0,s])},24112,60959,e=>{"use strict";var t=e.i(59080),s=e.i(32171),a=e.i(54529);let l=t.a`
69
+ fragment ProductDimensionFragment on Dimensions {
70
+ weight(unit: GRAM)
71
+ length(unit: MILLIMETERS)
72
+ width(unit: MILLIMETERS)
73
+ height(unit: MILLIMETERS)
74
+ }
75
+ `;e.s(["f",0,l],60959);let r=t.a`
76
+ query Products(
77
+ $queryString: String
78
+ $tags: [LowerCaseString!]
79
+ $slugs: [String!]
80
+ $limit: Int
81
+ $offset: Int
82
+ $includeDrafts: Boolean
83
+ $sort: [SortOptionInput!]
84
+ $forceLocale: Locale
85
+ $type: ProductType
86
+ ) {
87
+ products(
88
+ queryString: $queryString
89
+ tags: $tags
90
+ slugs: $slugs
91
+ limit: $limit
92
+ offset: $offset
93
+ includeDrafts: $includeDrafts
94
+ sort: $sort
95
+ type: $type
96
+ ) {
97
+ ...ProductBriefFragment
98
+ ... on SimpleProduct {
99
+ sku
100
+ baseUnit
101
+ dimensions {
102
+ ...ProductDimensionFragment
103
+ }
104
+ }
105
+ }
106
+ productsCount(
107
+ tags: $tags
108
+ slugs: $slugs
109
+ includeDrafts: $includeDrafts
110
+ queryString: $queryString
111
+ type: $type
112
+ )
113
+ }
114
+ ${l}
115
+ ${a.f}
116
+ `;e.s(["f",0,({queryString:e="",limit:t=20,offset:a=0,tags:l=null,includeDrafts:i=!0,slugs:n=null,sort:d=[],forceLocale:o="",type:c=null}={})=>{let{data:m,loading:u,error:x,fetchMore:f,client:h}=(0,s.f)(r,{context:{headers:{forceLocale:o}},variables:{queryString:e,limit:t,offset:a,includeDrafts:i,tags:l,slugs:n,type:c,sort:d.length?d:[{key:"sequence",value:"ASC"}]}}),p=m?.products||[],g=m?.productsCount,b=p?.length<g;return{products:p,productsCount:g,hasMore:b,loading:u,error:x,loadMore:()=>{f({variables:{offset:p.length}})},client:h}}],24112)},20372,e=>{"use strict";var t=e.i(91398),s=e.i(3326),a=e.i(50595),l=e.i(53576),r=e.i(25327),i=e.i(91788),n=e.i(92042),d=e.i(41158),o=e.i(28401),c=e.i(17774),c=c,m=e.i(84818),u=e.i(11959),x=e.i(66885),f=e.i(95789),h=e.i(83147),p=e.i(16509),g=e.i(2194),b=e.i(42469),j=e.i(8918);let v=({periods:e})=>{let{formatMessage:a}=(0,s.X)(),{formatDateTime:l}=(0,m.f)();return(0,t.jsx)("section",{className:"mt-3",children:e?.length?(0,t.jsxs)(j.f,{className:"mt-0 min-w-full rounded-t-none",children:[(e||[])?.map(e=>(0,t.jsxs)(j.f.Row,{className:"bg-white ",header:!0,children:[(0,t.jsx)(j.f.Cell,{children:a({id:"order",defaultMessage:"Order"})}),(0,t.jsx)(j.f.Cell,{className:"text-left",children:a({id:"start",defaultMessage:"Start"})}),(0,t.jsx)(j.f.Cell,{children:a({id:"end",defaultMessage:"End"})})]},`${e.start}${e.end}`)),(e||[])?.map(e=>(0,t.jsxs)(j.f.Row,{children:[(0,t.jsx)(j.f.Cell,{children:(0,t.jsxs)("div",{className:"flex items-center text-sm text-slate-900",children:[e?.order?.orderNumber?e?.order?.orderNumber:"n/a",e?.isTrial&&(0,t.jsx)(b.f,{text:a({id:"trial",defaultMessage:"Trial"}),color:"pink",className:"ml-2 rounded-full py-1 text-sm font-semibold leading-5",square:!0})]})}),(0,t.jsx)(j.f.Cell,{children:l(e?.start,{dateStyle:"medium",timeStyle:"medium"})}),(0,t.jsx)(j.f.Cell,{children:l(e?.end,{dateStyle:"medium",timeStyle:"medium"})})]},`${e.start}`))]}):(0,t.jsx)(g.f,{message:a({id:"subscription_message",defaultMessage:"Subscription"})})})};var y=e.i(21623),N=e.i(59080),w=e.i(76204);let _=N.a`
117
+ mutation ActivateEnrollment($enrollmentId: ID!) {
118
+ activateEnrollment(enrollmentId: $enrollmentId) {
119
+ _id
120
+ }
121
+ }
122
+ `;var C=e.i(6607),E=e.i(34728);let M=N.a`
123
+ mutation TerminateEnrollment(
124
+ $enrollmentId: ID!
125
+ $reason: EnrollmentTerminationReason
126
+ $comment: String
127
+ ) {
128
+ terminateEnrollment(
129
+ enrollmentId: $enrollmentId
130
+ reason: $reason
131
+ comment: $comment
132
+ ) {
133
+ _id
134
+ status
135
+ expires
136
+ }
137
+ }
138
+ `,S=N.a`
139
+ mutation SuspendEnrollment($enrollmentId: ID!, $resumeAt: DateTimeISO) {
140
+ suspendEnrollment(enrollmentId: $enrollmentId, resumeAt: $resumeAt) {
141
+ _id
142
+ }
143
+ }
144
+ `;var k=e.i(21056);let I=N.a`
145
+ mutation UpdateEnrollmentPlan(
146
+ $enrollmentId: ID!
147
+ $plan: EnrollmentPlanInput!
148
+ ) {
149
+ updateEnrollment(enrollmentId: $enrollmentId, plan: $plan) {
150
+ _id
151
+ status
152
+ plan {
153
+ product {
154
+ _id
155
+ texts {
156
+ _id
157
+ title
158
+ }
159
+ }
160
+ quantity
161
+ configuration {
162
+ key
163
+ value
164
+ }
165
+ }
166
+ }
167
+ }
168
+ `,$=N.a`
169
+ mutation UpdateEnrollmentExpires($enrollmentId: ID!, $expires: DateTimeISO) {
170
+ updateEnrollment(enrollmentId: $enrollmentId, expires: $expires) {
171
+ _id
172
+ expires
173
+ }
174
+ }
175
+ `;var T=e.i(57986);let A=({enrollment:e})=>{let{formatMessage:a,locale:l}=(0,s.X)(),{formatDateTime:r}=(0,m.f)();return(0,t.jsxs)("section",{children:[(0,t.jsx)(T.f,{user:e?.user,contact:e?.contact}),(0,t.jsxs)("div",{className:"mt-2 flex border-b border-border-default pb-2 text-sm",children:[(0,t.jsxs)("dl",{className:"flex flex-wrap items-center gap-1",children:[(0,t.jsxs)("dt",{className:"hidden capitalize text-slate-500 sm:block",children:[a({id:"enrollment",defaultMessage:"enrollment"}),"#  "]}),(0,t.jsxs)("dd",{className:"inline-flex text-lg font-medium text-slate-900 sm:flex-none sm:text-xl sm:font-semibold",children:[(0,t.jsx)("span",{className:"sm:hidden",children:"# "}),e?.enrollmentNumber?(0,t.jsx)(b.f,{color:"slate",text:e?.enrollmentNumber,className:"p-0 text-lg font-medium sm:text-xl sm:font-semibold"}):(0,t.jsx)(b.f,{text:a({id:"initial",defaultMessage:"Initial"}),color:"yellow",className:"p-0 text-lg font-medium sm:text-xl sm:font-semibold"})]}),(0,t.jsx)("dt",{children:(0,t.jsx)("span",{className:"sr-only",children:a({id:"date",defaultMessage:"Date"})})}),(0,t.jsx)("dd",{className:"font-medium text-slate-900",children:e?.ordered?r(e?.ordered):null})]}),(0,t.jsxs)("div",{className:"ml-auto flex flex-wrap items-center justify-center gap-x-2 gap-y-1 text-sm text-slate-900 sm:text-base",children:[(0,t.jsx)("span",{children:e?.country?.flagEmoji}),(0,t.jsx)("span",{children:(0,h.j)(l,e?.currency?.isoCode)}),(0,t.jsx)("span",{children:e?.currency?.isoCode&&(0,t.jsx)(b.f,{text:e?.currency?.isoCode,color:"amber",className:"px-2 py-0 sm:py-1",square:!0})})]})]})]})};var D=e.i(35429),P=e.i(63094),L=e.i(69211),R=e.i(98949);let q=({headerText:e,message:s,submitText:a,initialValues:l,onSubmit:r,onCancel:i,children:n})=>{let d=(0,R.f)({submit:r,onSubmitSuccess:async()=>(i(),!0),initialValues:l});return(0,t.jsxs)(L.f,{form:d,children:[(0,t.jsx)("h3",{className:"text-lg text-text-primary",children:e}),s&&(0,t.jsx)("p",{className:"mt-2 text-sm text-text-secondary",children:s}),(0,t.jsx)("div",{className:"mt-4 space-y-4",children:n}),(0,t.jsx)(P.f,{}),(0,t.jsx)("div",{className:"border border-t-slate-100 bg-slate-50 mt-6 -mx-5 -mb-6 dark:bg-slate-500 dark:border-0",children:(0,t.jsx)(D.f,{onCancel:i,submitText:a,className:"justify-end"})})]})};var U=e.i(65897),F=e.i(87284);e.i(51523);var O=e.i(19518),B=e.i(58971),X=e.i(24112),z=e.i(24994),V=e.i(97776),G=e.i(10685),Q=e.i(87213),J=e.i(2765),K=e.i(20096);let W=e=>e?new Date(`${e}T00:00`).toISOString():null,Z=({enrollment:e})=>{let{formatMessage:a}=(0,s.X)(),{formatDateTime:l}=(0,m.f)(),{setModal:r}=(0,C.f)(),{hasRole:g}=(0,B.f)(),{statusTypes:b}=(0,u.f)("EnrollmentStatus"),{activateEnrollment:j}=(()=>{let[e]=(0,w.f)(_);return{activateEnrollment:async({enrollmentId:t})=>e({variables:{enrollmentId:t},refetchQueries:["Enrollments","Enrollment"]})}})(),{terminateEnrollment:N}=(()=>{let[e]=(0,w.f)(M);return{terminateEnrollment:async({enrollmentId:t,reason:s,comment:a})=>e({variables:{enrollmentId:t,reason:s,comment:a},refetchQueries:["Enrollments","Enrollment"]})}})(),{suspendEnrollment:T}=(()=>{let[e]=(0,w.f)(S);return{suspendEnrollment:async({enrollmentId:t,resumeAt:s})=>e({variables:{enrollmentId:t,resumeAt:s},refetchQueries:["Enrollments","Enrollment"]})}})(),{sendEnrollmentEmail:D}=(0,k.f)(),{updateEnrollmentPlan:P}=(()=>{let[e]=(0,w.f)(I);return{updateEnrollmentPlan:async({enrollmentId:t,plan:s})=>e({variables:{enrollmentId:t,plan:s},refetchQueries:["Enrollments","Enrollment"]})}})(),{updateEnrollmentExpires:L}=(()=>{let[e]=(0,w.f)($);return{updateEnrollmentExpires:async({enrollmentId:t,expires:s})=>e({variables:{enrollmentId:t,expires:s},refetchQueries:["Enrollments","Enrollment"]})}})(),[R,Z]=(0,i.useState)(""),H=(0,i.useMemo)(()=>(0,J.f)(200)(Z),[]),{products:Y,loading:ee}=(0,X.f)({queryString:R,limit:20,includeDrafts:!1,sort:[{key:"created",value:O.B.Desc}],type:O.f.PlanProduct}),et=(0,i.useMemo)(()=>(Y||[]).map(e=>({value:e._id,label:e.texts?.title||e._id})),[Y]);if(!e)return null;let es=async()=>{await r((0,t.jsx)(E.f,{buttonText:a({id:"activate_button",defaultMessage:"Activate"}),headerText:a({id:"activate_header_title",defaultMessage:"Activate subscription."}),message:a({id:"activate_header_conformation",defaultMessage:"Are you sure you want to activate this subscription?"}),onOkClick:async()=>{r("");try{await j({enrollmentId:e?._id}),o.toast.success(a({id:"success_message",defaultMessage:"Subscription successfully activated."}))}catch(e){o.toast.error((0,K.f)(e)?.message)}}}))},ea=(0,t.jsx)("div",{className:"flex w-full items-center justify-center",children:(0,t.jsx)("div",{className:"mx-auto flex h-12 w-12 shrink-0 items-center justify-center rounded-full bg-blue-100 dark:bg-blue-900/30 sm:mx-0 sm:h-10 sm:w-10",children:(0,t.jsx)(c.f,{className:"h-6 w-6 text-slate-900 dark:text-blue-400","aria-hidden":"true"})})}),el=async()=>{await r((0,t.jsx)(E.f,{icon:ea,buttonText:a({id:"send_button",defaultMessage:"Send"}),headerText:a({id:"send_activation_email_header",defaultMessage:"Send Email."}),message:a({id:"send_activation_email_confirm",defaultMessage:"Are you sure you want to send email?"}),onOkClick:async()=>{r("");let{data:t}=await D({email:e?.contact.emailAddress});t?.sendEnrollmentEmail?.success?o.toast.success(a({id:"enrollment_success_message",defaultMessage:"Subscription activation email sent"})):o.toast.error(a({id:"terminate_enrollment_error",defaultMessage:"Failed when sending subscription activation email, please try again"}))}}))},er={[O.A.UserRequested]:a({id:"termination_reason_user_requested",defaultMessage:"Requested by the customer"}),[O.A.PaymentFailed]:a({id:"termination_reason_payment_failed",defaultMessage:"Payment failed"}),[O.A.Expired]:a({id:"termination_reason_expired",defaultMessage:"Expired"}),[O.A.AdminAction]:a({id:"termination_reason_admin_action",defaultMessage:"Administrative action"}),[O.A.Other]:a({id:"termination_reason_other",defaultMessage:"Other"})},ei=async()=>{await r((0,t.jsxs)(q,{headerText:a({id:"terminate_subscription",defaultMessage:"Terminate subscription"}),message:a({id:"terminate_enrollment_confirmation",defaultMessage:"Are you sure you want to terminate this subscription? "}),submitText:a({id:"terminate_subscription",defaultMessage:"Terminate subscription"}),initialValues:{reason:"",comment:""},onCancel:()=>r(""),onSubmit:async({reason:t,comment:s})=>{let{data:r}=await N({enrollmentId:e._id,reason:t||null,comment:s||null}),{status:i,expires:n}=r?.terminateEnrollment||{};return o.toast.success(i===O.h.Terminated?a({id:"terminate_enrollment_success",defaultMessage:"Subscription terminated successfully"}):a({id:"scheduled_termination",defaultMessage:"Termination scheduled for {date}"},{date:l(n,{dateStyle:"full"})})),{success:!0}},children:[(0,t.jsx)(G.f,{name:"reason",label:a({id:"cancellation_reason",defaultMessage:"Cancellation reason"}),placeholder:a({id:"cancellation_reason",defaultMessage:"Cancellation reason"}),options:er}),(0,t.jsx)(Q.f,{name:"comment",rows:3,label:a({id:"cancellation_comment",defaultMessage:"Comment"})})]}))},en=async()=>{await r((0,t.jsx)(q,{headerText:a({id:"suspend_header",defaultMessage:"Suspend subscription."}),message:a({id:"suspend_confirmation",defaultMessage:"Are you sure you want to suspend this subscription? No new orders will be generated until it is resumed."}),submitText:a({id:"suspend_button",defaultMessage:"Suspend"}),initialValues:{resumeAt:null},onCancel:()=>r(""),onSubmit:async({resumeAt:t})=>(await T({enrollmentId:e._id,resumeAt:W(t)}),o.toast.success(a({id:"suspend_success",defaultMessage:"Subscription suspended successfully."})),{success:!0}),children:(0,t.jsx)(V.f,{name:"resumeAt",label:a({id:"resume_at_label",defaultMessage:"Resume automatically on (optional)"})})}))},ed=async()=>{let s;await r((0,t.jsx)(q,{headerText:a({id:"set_end_date_header",defaultMessage:"Set end date"}),message:a({id:"set_end_date_message",defaultMessage:"The subscription ends on this date. Unlike a termination, no notice period or minimum commitment applies."}),submitText:a({id:"save",defaultMessage:"Save"}),initialValues:{expires:(s=e.expires)?(0,n.f)(new Date(s),"yyyy-MM-dd"):null},onCancel:()=>r(""),onSubmit:async({expires:t})=>(await L({enrollmentId:e._id,expires:W(t)}),o.toast.success(a({id:"end_date_updated",defaultMessage:"End date updated"})),{success:!0}),children:(0,t.jsx)(V.f,{name:"expires",required:!0,label:a({id:"end_date",defaultMessage:"End date"})})}))},eo=async()=>{await r((0,t.jsx)(E.f,{buttonText:a({id:"remove_end_date",defaultMessage:"Remove end date"}),headerText:a({id:"remove_end_date",defaultMessage:"Remove end date"}),message:a({id:"remove_end_date_message",defaultMessage:"The subscription renews again until it is terminated."}),onOkClick:async()=>{r("");try{await L({enrollmentId:e._id,expires:null}),o.toast.success(a({id:"end_date_updated",defaultMessage:"End date updated"}))}catch(e){o.toast.error((0,K.f)(e)?.message)}}}))},ec=e.status!==O.h.Terminated&&g(O.C.ManageEnrollments),em=async s=>{s&&await r((0,t.jsx)(E.f,{buttonText:a({id:"change_plan_button",defaultMessage:"Change Plan"}),headerText:a({id:"change_plan_header",defaultMessage:"Change subscription plan"}),message:a({id:"change_plan_confirmation",defaultMessage:'Change the plan to "{plan}"? It applies from the next billing period on.'},{plan:s.label}),onOkClick:async()=>{r("");try{await P({enrollmentId:e._id,plan:{productId:s.value,quantity:e.plan?.quantity||1}}),o.toast.success(a({id:"change_plan_success",defaultMessage:"Plan changed successfully."}))}catch(e){o.toast.error(e.message||"Plan change failed")}}}))},eu=e.status!==O.h.Initial&&e.status!==O.h.Terminated&&e.status!==O.h.Suspended&&g(O.C.UpdateEnrollment),ex={INITIAL:{id:1,content:"created",visible:!0},ACTIVE:{id:2,content:"updated",visible:!0,Component:e?.status===O.h.Active&&g(O.C.ManageEnrollments)&&(0,t.jsx)(y.f,{text:a({id:"suspend",defaultMessage:"Suspend"}),onClick:en,className:"bg-white-300 relative -ml-px inline-flex items-center space-x-2 rounded-md border border-blue-500 bg-blue-500 px-2 py-1 text-base font-medium text-white hover:bg-blue-700 focus:outline-hidden focus:ring-0"})},SUSPENDED:{id:3,content:"updated",visible:!0,Component:e?.status===O.h.Suspended&&g(O.C.ManageEnrollments)&&(0,t.jsx)(y.f,{text:a({id:"resume",defaultMessage:"Resume"}),onClick:es,className:"bg-white-300 relative -ml-px inline-flex items-center space-x-2 rounded-md border border-slate-900 dark:border-slate-600 bg-slate-800 dark:bg-slate-600 px-2 py-1 text-base font-medium text-white hover:bg-slate-950 dark:hover:bg-slate-500 focus:outline-hidden focus:ring-0"})},PAUSED:{id:4,content:"updated",visible:!0,Component:e?.status===O.h.Paused&&g(O.C.ManageEnrollments)&&(0,t.jsx)(y.f,{text:a({id:"activate",defaultMessage:"Activate"}),onClick:es,className:"bg-white-300 relative -ml-px inline-flex items-center space-x-2 rounded-md border border-accent bg-accent px-2 py-1 text-base font-medium text-text-on-accent hover:bg-accent-hover dark:focus:border-slate-400 focus:outline-hidden focus:ring-0 focus:ring-focus-ring"})},TERMINATED:{id:5,content:"updated",visible:!0,Component:e?.status!==O.h.Terminated&&g(O.C.UpdateEnrollment)&&(0,t.jsx)(y.f,{text:a({id:"terminate_enrollment",defaultMessage:"Terminate Enrollment"}),onClick:ei,className:"bg-white-300 inline-flex items-center space-x-2 rounded-md border border-rose-500 bg-rose-500 px-2 py-1 text-base font-medium text-white hover:bg-rose-700 focus:border-rose-400 focus:outline-hidden focus:ring-0 focus:ring-rose-400"})}},ef={header:(0,t.jsx)("span",{className:"flex",children:a({id:"periods",defaultMessage:"Periods"})}),body:(0,t.jsx)(v,{periods:e?.periods})};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(A,{enrollment:e}),e?.expires&&e?.status!==O.h.Terminated&&(0,t.jsx)("div",{className:"my-2 rounded-md border border-amber-300 bg-amber-50 p-3 text-sm text-amber-800",children:a({id:"scheduled_termination",defaultMessage:"Termination scheduled for {date}"},{date:l(e.expires,{dateStyle:"full",timeStyle:"short"})})}),e?.resumeAt&&e?.status===O.h.Suspended&&(0,t.jsx)("div",{className:"my-2 rounded-md border border-blue-300 bg-blue-50 p-3 text-sm text-blue-800",children:a({id:"resumes_automatically",defaultMessage:"Resumes automatically on {date}"},{date:l(e.resumeAt,{dateStyle:"full",timeStyle:"short"})})}),e?.minimumCommitmentEnd&&e?.status!==O.h.Terminated&&(0,t.jsx)("div",{className:"my-2 rounded-md border border-blue-300 bg-blue-50 p-3 text-sm text-blue-800",children:a({id:"minimum_commitment",defaultMessage:"Minimum commitment until {date}"},{date:l(e.minimumCommitmentEnd,{dateStyle:"full",timeStyle:"short"})})}),(0,t.jsx)(x.f,{data:e,statusTypes:b,timeline:ex}),(0,t.jsx)("section",{className:"rounded-md border border-slate-300 bg-white",children:(0,t.jsx)("div",{className:"mx-auto -mt-12 max-w-7xl px-4 pb-4 sm:px-6 sm:pb-16 lg:px-8",children:(0,t.jsxs)("dl",{className:"mx-auto mt-16 grid max-w-2xl grid-cols-1 gap-x-6 gap-y-4 sm:grid-cols-2 sm:gap-y-8 lg:max-w-none lg:grid-cols-3 lg:gap-x-8",children:[(0,t.jsxs)("div",{className:"w flex flex-auto flex-col gap-y-4 gap-x-8 sm:col-span-2 sm:gap-y-8 lg:col-span-3 lg:grid-cols-12 lg:flex-row",children:[(0,t.jsxs)("div",{className:"flex flex-auto flex-col gap-y-8 pt-4 lg:col-span-6",children:[(0,t.jsx)("span",{className:"h relative h-48 w-full rounded-lg",children:(0,t.jsx)(F.f,{loader:p.f,src:e?.plan?.product?.media?.[0]?.file?.url,alt:e?.plan?.product?.texts?.title,layout:"fill",objectFit:"contain"})}),(0,t.jsxs)("div",{className:"flex flex-col",children:[(0,t.jsx)("dt",{className:"font-medium text-slate-900",children:a({id:"product_title",defaultMessage:"Product"})}),(0,t.jsx)("dd",{className:"my-2 text-sm text-slate-500",children:e?.plan.product?.texts?.title}),(0,t.jsx)("dt",{className:"font-medium text-slate-900",children:a({id:"product_quantity",defaultMessage:"Quantity"})}),(0,t.jsx)("dd",{className:"my-2 text-sm text-slate-500",children:e?.plan?.quantity})]})]}),eu&&(0,t.jsxs)("div",{className:"flex-auto border-t border-border-default pt-4 lg:col-span-6 lg:border-0",children:[(0,t.jsx)("dt",{className:"font-medium text-slate-900 mb-2",children:a({id:"change_plan",defaultMessage:"Change Plan"})}),(0,t.jsx)(z.f,{name:"planProductId",placeholder:a({id:"search_plan_product",defaultMessage:"Search plan product..."}),isLoading:ee,onChange:e=>{let t=et.find(({value:t})=>t===e);t&&em(t)},onSearch:H,options:et,className:"w-full text-sm"})]}),(0,t.jsx)("div",{className:"flex-auto border-t border-border-default pt-4 lg:col-span-6 lg:border-0",children:(0,t.jsx)(U.f,{disabled:!0,className:"bg-surface-input dark:text-slate-200 mt-1 block w-full max-w-full rounded-md border-1 resize-none border-border-default shadow-xs sm:text-sm",value:JSON.stringify((e?.plan.configuration||[]).map(({__typename:e,...t})=>t),null,2)})})]}),(0,t.jsxs)("div",{className:"grid grid-cols-1 gap-x-6 gap-y-4 sm:gap-y-8 lg:col-span-2 lg:grid-cols-2 lg:gap-x-8",children:[(0,t.jsxs)("div",{className:"border-t border-border-default pt-4",children:[(0,t.jsx)("dt",{className:"font-medium text-slate-900",children:a({id:"payment_provider",defaultMessage:"Payment provider"})}),(0,t.jsx)("dd",{className:"mt-2 text-sm text-slate-500",children:(0,t.jsx)(d.default,{href:`/payment-provider?paymentProviderId=${e?.payment?.provider?._id}`,className:"text-text-primary",children:(0,h.D)(e?.payment?.provider?.interface)})})]}),(0,t.jsxs)("div",{className:"border-t border-border-default pt-4",children:[(0,t.jsx)("dt",{className:"font-medium text-slate-900",children:a({id:"delivery_provider",defaultMessage:"Delivery Provider"})}),(0,t.jsx)("dd",{className:"mt-2 text-sm text-slate-500",children:(0,t.jsx)(d.default,{href:`/delivery-provider?deliveryProviderId=${e?.delivery?.provider?._id}`,className:"text-text-primary",children:(0,h.D)(e?.delivery?.provider?.interface)})})]}),e?.contact&&(0,t.jsxs)("div",{className:"col-span-1 border-t border-border-default pt-4",children:[(0,t.jsx)("div",{className:"font-medium text-slate-900",children:a({id:"contact",defaultMessage:"Contact"})}),(0,t.jsx)("div",{className:"mt-2 text-sm text-slate-500",children:e?.contact?.telNumber}),(0,t.jsx)("div",{className:"mt-2 text-sm text-slate-500",children:e?.contact?.emailAddress}),e?.contact?.emailAddress&&g(O.C.UpdateEnrollment)&&(0,t.jsx)(y.f,{text:a({id:"send_email_button",defaultMessage:"Send Email"}),className:"px-2 py-1",onClick:el})]}),(0,t.jsxs)("div",{className:"border-t border-border-default pt-4",children:[(0,t.jsx)("dt",{className:"font-medium text-slate-900",children:a({id:"contract_start",defaultMessage:"Contract start"})}),(0,t.jsx)("dd",{className:"mt-2 text-sm text-slate-500",children:e?.contractStartDate?l(e.contractStartDate,{dateStyle:"medium"}):"-"})]}),(0,t.jsxs)("div",{className:"border-t border-border-default pt-4",children:[(0,t.jsx)("dt",{className:"font-medium text-slate-900",children:a({id:"end_date",defaultMessage:"End date"})}),(0,t.jsx)("dd",{className:"mt-2 text-sm text-slate-500",children:e?.expires?l(e.expires,{dateStyle:"medium"}):a({id:"renews_automatically",defaultMessage:"Renews automatically"})}),ec&&(0,t.jsxs)("div",{className:"mt-2 flex gap-2",children:[(0,t.jsx)(y.f,{text:e?.expires?a({id:"change",defaultMessage:"Change"}):a({id:"set_end_date_header",defaultMessage:"Set end date"}),variant:"secondary",className:"px-2 py-1",onClick:ed}),e?.expires&&(0,t.jsx)(y.f,{text:a({id:"remove_end_date",defaultMessage:"Remove end date"}),variant:"secondary",className:"px-2 py-1",onClick:eo})]})]}),e?.cancellationReason&&(0,t.jsxs)("div",{className:"border-t border-border-default pt-4",children:[(0,t.jsx)("dt",{className:"font-medium text-slate-900",children:a({id:"cancellation_reason",defaultMessage:"Cancellation reason"})}),(0,t.jsx)("dd",{className:"mt-2 text-sm text-slate-500",children:er[e.cancellationReason]}),e?.cancellationComment&&(0,t.jsx)("dd",{className:"mt-2 text-sm text-slate-500",children:e.cancellationComment})]})]}),(0,t.jsxs)("div",{className:"border-t border-border-default pt-4",children:[(0,t.jsx)("dt",{className:"font-medium text-slate-900",children:a({id:"billing_address",defaultMessage:"Billing address"})}),(0,t.jsxs)("dd",{className:"mt-2 text-sm text-slate-500",children:[e?.billingAddress?.firstName,"  ",e?.billingAddress?.lastName]}),(0,t.jsx)("dd",{className:"mt-2 text-sm text-slate-500",children:e?.billingAddress?.company}),(0,t.jsx)("dd",{className:"mt-2 text-sm text-slate-500",children:e?.billingAddress?.addressLine}),(0,t.jsx)("dd",{className:"mt-2 text-sm text-slate-500",children:e?.billingAddress?.addressLine2}),(0,t.jsx)("dd",{className:"mt-2 text-sm text-slate-500",children:e?.billingAddress?.postalCode}),(0,t.jsxs)("dd",{className:"mt-2 text-sm text-slate-500",children:[e?.billingAddress?.city,"  ",e?.billingAddress?.regionCode,"  ",e?.billingAddress?.countryCode]})]})]})})}),(0,t.jsx)(f.f,{data:[ef],headerCSS:"inline-flex items-center justify-between w-full px-4 py-2 rounded-t-md border border-slate-300 bg-slate-50 text-sm font-medium text-slate-700 hover:bg-slate-50 focus:z-10 focus:outline-hidden focus:ring-2 focus:ring-focus-ring "})]})};var H=e.i(32171),Y=e.i(70693);let ee=N.a`
176
+ fragment EnrollmentDetailFragment on Enrollment {
177
+ _id
178
+ country {
179
+ _id
180
+ isoCode
181
+ }
182
+ enrollmentNumber
183
+ updated
184
+ status
185
+ created
186
+ expires
187
+ resumeAt
188
+ contractStartDate
189
+ minimumCommitmentEnd
190
+ cancellationReason
191
+ cancellationComment
192
+ billingAddress {
193
+ addressLine
194
+ addressLine2
195
+ city
196
+ company
197
+ countryCode
198
+ firstName
199
+ lastName
200
+ postalCode
201
+ regionCode
202
+ }
203
+ contact {
204
+ emailAddress
205
+ telNumber
206
+ }
207
+ currency {
208
+ _id
209
+ contractAddress
210
+ decimals
211
+ isActive
212
+ isoCode
213
+ }
214
+ delivery {
215
+ provider {
216
+ _id
217
+ configurationError
218
+ interface {
219
+ _id
220
+ label
221
+ version
222
+ }
223
+ isActive
224
+
225
+ simulatedPrice {
226
+ amount
227
+ currencyCode
228
+ isNetPrice
229
+ isTaxable
230
+ }
231
+ type
232
+ }
233
+ }
234
+ payment {
235
+ provider {
236
+ _id
237
+ configurationError
238
+ interface {
239
+ _id
240
+ label
241
+ version
242
+ }
243
+ isActive
244
+ type
245
+ }
246
+ }
247
+ periods {
248
+ start
249
+ end
250
+ isTrial
251
+ order {
252
+ _id
253
+ }
254
+ }
255
+
256
+ isExpired
257
+ plan {
258
+ configuration {
259
+ key
260
+ value
261
+ }
262
+ product {
263
+ _id
264
+ texts {
265
+ _id
266
+ title
267
+ }
268
+ }
269
+ quantity
270
+ }
271
+ user {
272
+ _id
273
+ username
274
+ name
275
+ avatar {
276
+ _id
277
+ url
278
+ }
279
+ }
280
+ }
281
+ `;e.s(["default",0,({enrollmentId:e})=>{let{formatMessage:i}=(0,s.X)(),{enrollment:n,loading:d}=(({enrollmentId:e=null})=>{let{customProperties:t}=(0,Y.f)(),{data:s,loading:a,error:l}=(0,H.f)(((e="")=>N.a`
282
+ query Enrollment($enrollmentId: ID!) {
283
+ enrollment(enrollmentId: $enrollmentId) {
284
+ ...EnrollmentDetailFragment
285
+ ${e}
286
+
287
+ }
288
+ }
289
+ ${ee}
290
+ `)(t?.Enrollment),{skip:!e,variables:{enrollmentId:e}});return{enrollment:s?.enrollment,loading:a,error:l}})({enrollmentId:e});return(0,t.jsxs)("div",{className:"mt-5 max-w-full",children:[(0,t.jsx)(a.f,{currentPageTitle:n?.enrollmentNumber?`#${n?.enrollmentNumber}`:""}),(0,t.jsx)("div",{className:"items-center flex min-w-full justify-between gap-3 flex-wrap",children:(0,t.jsx)(r.f,{headerText:i({id:"enrollment_detail",defaultMessage:"Enrollment Detail"}),title:i({id:"enrollment_detail_title",defaultMessage:"Enrollment {id}"},{id:n?._id})})}),d?(0,t.jsx)(l.f,{variant:"detail"}):(0,t.jsx)(Z,{enrollment:n})]})}],20372)},58994,e=>{"use strict";var t=e.i(91398),s=e.i(3326),a=e.i(3828),l=e.i(50595),r=e.i(70553),i=e.i(78704),n=e.i(53576),d=e.i(25327),o=e.i(60193),c=e.i(77930),m=e.i(59080),u=e.i(32171);let x=m.a`
291
+ fragment EnrollmentFragment on Enrollment {
292
+ _id
293
+ country {
294
+ _id
295
+ isoCode
296
+ }
297
+ currency {
298
+ _id
299
+ isoCode
300
+ }
301
+ enrollmentNumber
302
+ updated
303
+ status
304
+ created
305
+ expires
306
+ contractStartDate
307
+ minimumCommitmentEnd
308
+ isExpired
309
+ periods {
310
+ start
311
+ end
312
+ isTrial
313
+ }
314
+ payment {
315
+ provider {
316
+ _id
317
+ }
318
+ }
319
+ delivery {
320
+ provider {
321
+ _id
322
+ }
323
+ }
324
+ plan {
325
+ product {
326
+ _id
327
+ media {
328
+ _id
329
+ file {
330
+ _id
331
+ url
332
+ }
333
+ }
334
+ texts {
335
+ _id
336
+ title
337
+ }
338
+ }
339
+ quantity
340
+ }
341
+ user {
342
+ _id
343
+ username
344
+ name
345
+ avatar {
346
+ _id
347
+ url
348
+ }
349
+ }
350
+ }
351
+ `,f=m.a`
352
+ query Enrollments(
353
+ $offset: Int
354
+ $limit: Int
355
+ $queryString: String
356
+ $sort: [SortOptionInput!]
357
+ $status: [String!]
358
+ ) {
359
+ enrollments(
360
+ offset: $offset
361
+ limit: $limit
362
+ queryString: $queryString
363
+ sort: $sort
364
+ status: $status
365
+ ) {
366
+ ...EnrollmentFragment
367
+ }
368
+ enrollmentsCount(queryString: $queryString, status: $status)
369
+ }
370
+ ${x}
371
+ `;var h=e.i(83147),p=e.i(73319),g=e.i(11959),b=e.i(92229),j=e.i(51128),v=e.i(20372),y=e.i(25093),N=e.i(11056),w=e.i(57561);e.s(["default",0,()=>{let{formatMessage:e}=(0,s.X)(),{query:m,push:x}=(0,a.useRouter)(),_=parseInt(m?.limit,10)||o.h,C=parseInt(m?.skip,10)||0,E=m?.sort||"",{selectedLocale:M}=(0,w.f)(),{queryString:S,enrollmentId:k,...I}=m,$=(0,h.R)(E),T=(0,p.Q)(m?.status),{enrollments:A,enrollmentsCount:D,loading:P,loadMore:L,hasMore:R}=(({limit:e=20,offset:t=0,queryString:s="",sort:a=[],status:l=null,forceLocale:r=""}={})=>{let{data:i,loading:n,error:d,fetchMore:o}=(0,u.f)(f,{context:{headers:{forceLocale:r}},variables:{limit:e,offset:t,queryString:s,sort:a,status:l}}),c=i?.enrollments||[],m=i?.enrollmentsCount,x=c?.length<m;return{enrollments:c,enrollmentsCount:m,hasMore:x,loading:n,error:d,loadMore:()=>{o({variables:{offset:c?.length}})}}})({queryString:S,limit:_,offset:C,sort:$,status:T.length?T:null,forceLocale:M}),{statusTypes:q}=(0,g.f)("EnrollmentStatus"),U=q?.map(({value:e})=>e)||[];if(k)return(0,t.jsx)(v.default,{enrollmentId:k});let F=1===D?e({id:"enrollment_header",defaultMessage:"1 Enrollment"}):e({id:"enrollment_count_header",defaultMessage:"{count} Enrollments"},{count:(0,t.jsx)(y.f,{value:D})});return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(l.f,{}),(0,t.jsx)(d.f,{title:e({id:"enrollment_page_title",defaultMessage:"{count, plural, one {# Enrollment} other {# Enrollments}}"},{count:D}),headerText:F}),(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"mt-5 text-sm text-text-muted lg:gap-7 lg:leading-6 ",children:e({id:"status",defaultMessage:"Status"})}),(0,t.jsx)("div",{className:"flex flex-wrap gap-10",children:(0,t.jsx)(b.f,{statuses:U,onStatusChange:e=>{let{status:t,...s}=m;e?.length?x({query:(0,h._)(s,e,"status")}):x({query:s})},selectedStatuses:T})})]}),(0,t.jsxs)("div",{className:"min-w-full overflow-x-auto px-1",children:[(0,t.jsx)(r.f,{}),(0,t.jsx)(j.f,{onSearchChange:e=>{let{skip:t,...s}=I;e?x({query:(0,h._)(s,e,"queryString")}):x({query:(0,h._)(I)})},defaultSearchValue:S,children:(0,t.jsx)(N.f,{onlyFull:!0,children:(0,t.jsx)(i.f,{loading:P,hasMore:R,onLoadMore:L,children:P&&A?.length===0?(0,t.jsx)(n.f,{variant:"list"}):(0,t.jsx)(c.f,{enrollments:A,showUser:!0,sortable:!0})})})})]})]})}],58994)},88566,25575,e=>{"use strict";var t=e.i(91788);let s=t.forwardRef(function({title:e,titleId:s,...a},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":s},a),e?t.createElement("title",{id:s},e):null,t.createElement("path",{fillRule:"evenodd",d:"M5.22 8.22a.75.75 0 0 1 1.06 0L10 11.94l3.72-3.72a.75.75 0 1 1 1.06 1.06l-4.25 4.25a.75.75 0 0 1-1.06 0L5.22 9.28a.75.75 0 0 1 0-1.06Z",clipRule:"evenodd"}))});e.s(["f",0,s],88566);let a=t.forwardRef(function({title:e,titleId:s,...a},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":s},a),e?t.createElement("title",{id:s},e):null,t.createElement("path",{fillRule:"evenodd",d:"M9.47 6.47a.75.75 0 0 1 1.06 0l4.25 4.25a.75.75 0 1 1-1.06 1.06L10 8.06l-3.72 3.72a.75.75 0 0 1-1.06-1.06l4.25-4.25Z",clipRule:"evenodd"}))});e.s(["f",0,a],25575)},15361,e=>{"use strict";var t=e.i(89974);e.s(["f",()=>t.f])},38322,e=>{"use strict";var t=e.i(57862);e.s(["f",()=>t.f])},81618,e=>{"use strict";var t=e.i(43119);e.s(["f",()=>t.f])},67912,e=>{"use strict";var t=e.i(37224);e.s(["f",()=>t.f])}]);