@unchainedshop/admin-ui 4.0.16 → 4.0.18

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 (232) hide show
  1. package/out/403/index.html +2 -2
  2. package/out/404/index.html +2 -2
  3. package/out/404.html +2 -2
  4. package/out/423/index.html +2 -2
  5. package/out/500/index.html +2 -2
  6. package/out/_next/static/DrJiftIXIXSswkrlx5Qns/_buildManifest.js +1 -0
  7. package/out/_next/static/chunks/1563-ca3f16e4bca8e444.js +1 -0
  8. package/out/_next/static/chunks/{1599-7469c89654f86e8d.js → 1599-92f6fcd8c0a46729.js} +1 -1
  9. package/out/_next/static/chunks/{3386-b5ae047ac208ac3f.js → 1721-8372573d5371a3d3.js} +1 -1
  10. package/out/_next/static/chunks/1734-d25fc559473817e4.js +1 -0
  11. package/out/_next/static/chunks/2090-726f07aecabdb100.js +1 -0
  12. package/out/_next/static/chunks/2604-6ba3a3be8d0c7229.js +1 -0
  13. package/out/_next/static/chunks/2730-4cbaf32d309ab774.js +1 -0
  14. package/out/_next/static/chunks/{2830-7cddfe9aef484863.js → 2830-3374d643941684d5.js} +1 -1
  15. package/out/_next/static/chunks/295-8b78f78487ebd71f.js +1 -0
  16. package/out/_next/static/chunks/3059-94f917b743528668.js +1 -0
  17. package/out/_next/static/chunks/3260-5d880fd9c21b9608.js +1 -0
  18. package/out/_next/static/chunks/439-a5ff1712bcb222c5.js +1 -0
  19. package/out/_next/static/chunks/4525-67805d137f1406ae.js +1 -0
  20. package/out/_next/static/chunks/4719-ea0fb7a3974c3631.js +1 -0
  21. package/out/_next/static/chunks/4806-d7bbed34f95ae523.js +1 -0
  22. package/out/_next/static/chunks/5231-b70477a72e7c0fa0.js +1 -0
  23. package/out/_next/static/chunks/6024-53f46be2b652fdc1.js +1 -0
  24. package/out/_next/static/chunks/6088-0e0e32eec876cec9.js +1 -0
  25. package/out/_next/static/chunks/6173-0f518e7d3bd99181.js +1 -0
  26. package/out/_next/static/chunks/6637-8f467d296ea5049e.js +1 -0
  27. package/out/_next/static/chunks/7068-bb5dc58c515e3edf.js +1 -0
  28. package/out/_next/static/chunks/7421-c9c225ba11b3a444.js +1 -0
  29. package/out/_next/static/chunks/7598-f168fa2c1e6c12a7.js +1 -0
  30. package/out/_next/static/chunks/8318-c3dd3c9f8f9b0622.js +1 -0
  31. package/out/_next/static/chunks/832-db1cfa309a4958e9.js +1 -0
  32. package/out/_next/static/chunks/8387-f0d1804f620b393b.js +1 -0
  33. package/out/_next/static/chunks/8419-7f13477899306ef0.js +1 -0
  34. package/out/_next/static/chunks/855-426ae976e6237ade.js +1 -0
  35. package/out/_next/static/chunks/9452-5c49f343f8e95819.js +1 -0
  36. package/out/_next/static/chunks/9480-4d0c6c172e10b403.js +1 -0
  37. package/out/_next/static/chunks/9523-9a62906a1ab30d5a.js +1 -0
  38. package/out/_next/static/chunks/9866-ac8ac382a5e3bf3d.js +1 -0
  39. package/out/_next/static/chunks/9931-9f0a44ae82b6d998.js +1 -0
  40. package/out/_next/static/chunks/pages/_app-9e6399e939f5ed1b.js +20 -0
  41. package/out/_next/static/chunks/pages/account/forgot-password-9fe4a9cc4612b61f.js +1 -0
  42. package/out/_next/static/chunks/pages/account-3a7248f7f4d38072.js +1 -0
  43. package/out/_next/static/chunks/pages/assortments/AssortmentDetailPage-36528e1082072651.js +1 -0
  44. package/out/_next/static/chunks/pages/assortments/new-394485e8f200eaab.js +1 -0
  45. package/out/_next/static/chunks/pages/assortments-a754bb71d1e6abab.js +1 -0
  46. package/out/_next/static/chunks/pages/copilot-6bfb0f6daad1914f.js +1 -0
  47. package/out/_next/static/chunks/pages/country/CountryDetailPage-505beeb2dc5d3ba2.js +1 -0
  48. package/out/_next/static/chunks/pages/country/new-13b49fe0a9a8a6c4.js +1 -0
  49. package/out/_next/static/chunks/pages/country-79502b0978e85167.js +1 -0
  50. package/out/_next/static/chunks/pages/currency/CurrencyDetailPage-20b5c5b27db6e8e3.js +1 -0
  51. package/out/_next/static/chunks/pages/currency/new-b16a2bef793a1389.js +1 -0
  52. package/out/_next/static/chunks/pages/currency-5987b1a562b75f6c.js +1 -0
  53. package/out/_next/static/chunks/pages/delivery-provider/DeliveryProviderDetailPage-d731bc47398c82b4.js +1 -0
  54. package/out/_next/static/chunks/pages/delivery-provider/new-791cddad812ba8a9.js +1 -0
  55. package/out/_next/static/chunks/pages/delivery-provider-2e5ab0092c5750d7.js +1 -0
  56. package/out/_next/static/chunks/pages/enrollments/EnrollmentDetailPage-cc87c8bd37fec5cb.js +1 -0
  57. package/out/_next/static/chunks/pages/enrollments-5b285765538d2eb0.js +1 -0
  58. package/out/_next/static/chunks/pages/events/EventDetailPage-98dafe383ad102d8.js +1 -0
  59. package/out/_next/static/chunks/pages/events-c41af8bc5740a9ca.js +1 -0
  60. package/out/_next/static/chunks/pages/filters/FilterDetailPage-31e5ac7d1efe9662.js +1 -0
  61. package/out/_next/static/chunks/pages/filters/new-ca900358e26b9aa7.js +1 -0
  62. package/out/_next/static/chunks/pages/filters-22e777d917e37c74.js +1 -0
  63. package/out/_next/static/chunks/pages/index-c83f77be8243394f.js +1 -0
  64. package/out/_next/static/chunks/pages/install-d1e29a46684be8f5.js +1 -0
  65. package/out/_next/static/chunks/pages/language/LanguageDetailPage-62a80a33e005b8a2.js +1 -0
  66. package/out/_next/static/chunks/pages/language/new-a9dc0878102631f8.js +1 -0
  67. package/out/_next/static/chunks/pages/language-01475d94b5654bab.js +1 -0
  68. package/out/_next/static/chunks/pages/log-in-2b627134ebb8d2cb.js +1 -0
  69. package/out/_next/static/chunks/pages/orders/OrderDetailPage-748f4f79ed2c8d82.js +1 -0
  70. package/out/_next/static/chunks/pages/orders-75a1ba02f44b4a45.js +1 -0
  71. package/out/_next/static/chunks/pages/payment-provider/PaymentProviderDetailPage-421714db11d89b07.js +1 -0
  72. package/out/_next/static/chunks/pages/payment-provider/new-e41a877cb3bab7bb.js +1 -0
  73. package/out/_next/static/chunks/pages/payment-provider-7397d089b6bca4fe.js +1 -0
  74. package/out/_next/static/chunks/pages/products/ProductDetailPage-33d98583edd7c5e7.js +1 -0
  75. package/out/_next/static/chunks/pages/products/new-6b8b2c6343be021b.js +1 -0
  76. package/out/_next/static/chunks/pages/products-7daf44247e00ae40.js +1 -0
  77. package/out/_next/static/chunks/pages/quotations/QuotationDetailPage-8bf4a3aea301810a.js +1 -0
  78. package/out/_next/static/chunks/pages/quotations-be266af91f847502.js +1 -0
  79. package/out/_next/static/chunks/pages/reset-password-8e56c56b901b22dd.js +1 -0
  80. package/out/_next/static/chunks/pages/sign-up-187956224558f516.js +1 -0
  81. package/out/_next/static/chunks/pages/tokens/TokenDetailPage-2e1bb3fc267037c5.js +1 -0
  82. package/out/_next/static/chunks/pages/tokens-8c05fb9488e12903.js +1 -0
  83. package/out/_next/static/chunks/pages/users/UserDetailPage-aa6fcff6dc2dd7ee.js +1 -0
  84. package/out/_next/static/chunks/pages/users/new-d4128039f39defbb.js +1 -0
  85. package/out/_next/static/chunks/pages/users-3b09253d7a64c69d.js +1 -0
  86. package/out/_next/static/chunks/pages/warehousing-provider/WarehousingProviderDetailPage-99656b6c16f073d5.js +1 -0
  87. package/out/_next/static/chunks/pages/warehousing-provider/new-efdd91be953f17e6.js +1 -0
  88. package/out/_next/static/chunks/pages/warehousing-provider-3ce8b3c05c44c7a8.js +1 -0
  89. package/out/_next/static/chunks/pages/works/WorkDetailPage-97964affd394b4ca.js +1 -0
  90. package/out/_next/static/chunks/pages/works/management-a071fffd7c13221e.js +1 -0
  91. package/out/_next/static/chunks/pages/works-808b26d15edb9325.js +1 -0
  92. package/out/_next/static/css/659efcc6c7e4e46d.css +1 -0
  93. package/out/_offline/index.html +2 -2
  94. package/out/account/forgot-password/index.html +2 -2
  95. package/out/account/index.html +2 -2
  96. package/out/admin-ui-permissions.js +3 -2
  97. package/out/assortments/AssortmentDetailPage/index.html +2 -2
  98. package/out/assortments/index.html +2 -2
  99. package/out/assortments/new/index.html +2 -2
  100. package/out/{index.old → copilot}/index.html +2 -2
  101. package/out/country/CountryDetailPage/index.html +2 -2
  102. package/out/country/index.html +2 -2
  103. package/out/country/new/index.html +2 -2
  104. package/out/currency/CurrencyDetailPage/index.html +2 -2
  105. package/out/currency/index.html +2 -2
  106. package/out/currency/new/index.html +2 -2
  107. package/out/delivery-provider/DeliveryProviderDetailPage/index.html +2 -2
  108. package/out/delivery-provider/index.html +2 -2
  109. package/out/delivery-provider/new/index.html +2 -2
  110. package/out/enrollments/EnrollmentDetailPage/index.html +2 -2
  111. package/out/enrollments/index.html +2 -2
  112. package/out/events/EventDetailPage/index.html +2 -2
  113. package/out/events/index.html +2 -2
  114. package/out/external/index.html +2 -2
  115. package/out/filters/FilterDetailPage/index.html +2 -2
  116. package/out/filters/index.html +2 -2
  117. package/out/filters/new/index.html +2 -2
  118. package/out/index.html +2 -2
  119. package/out/{home → install}/index.html +2 -2
  120. package/out/language/LanguageDetailPage/index.html +2 -2
  121. package/out/language/index.html +2 -2
  122. package/out/language/new/index.html +2 -2
  123. package/out/log-in/index.html +2 -2
  124. package/out/orders/OrderDetailPage/index.html +2 -2
  125. package/out/orders/index.html +2 -2
  126. package/out/payment-provider/PaymentProviderDetailPage/index.html +2 -2
  127. package/out/payment-provider/index.html +2 -2
  128. package/out/payment-provider/new/index.html +2 -2
  129. package/out/products/ProductDetailPage/index.html +2 -2
  130. package/out/products/index.html +2 -2
  131. package/out/products/new/index.html +2 -2
  132. package/out/quotations/QuotationDetailPage/index.html +2 -2
  133. package/out/quotations/index.html +2 -2
  134. package/out/reset-password/index.html +2 -2
  135. package/out/sign-up/index.html +2 -2
  136. package/out/tokens/TokenDetailPage/index.html +2 -2
  137. package/out/tokens/index.html +2 -2
  138. package/out/users/UserDetailPage/index.html +2 -2
  139. package/out/users/index.html +2 -2
  140. package/out/users/new/index.html +2 -2
  141. package/out/verify-email/index.html +2 -2
  142. package/out/warehousing-provider/WarehousingProviderDetailPage/index.html +2 -2
  143. package/out/warehousing-provider/index.html +2 -2
  144. package/out/warehousing-provider/new/index.html +2 -2
  145. package/out/works/WorkDetailPage/index.html +2 -2
  146. package/out/works/index.html +2 -2
  147. package/out/works/management/index.html +2 -2
  148. package/package.json +9 -9
  149. package/out/_next/static/chunks/1563-21284455b3385f0a.js +0 -1
  150. package/out/_next/static/chunks/1797-c71ee8b781de6746.js +0 -1
  151. package/out/_next/static/chunks/1992-688842cb5a8dc27a.js +0 -1
  152. package/out/_next/static/chunks/2169-ba46bd5577a5e1d4.js +0 -1
  153. package/out/_next/static/chunks/2745-af9bf7073cf853ec.js +0 -1
  154. package/out/_next/static/chunks/2837-54cb547483df55bc.js +0 -1
  155. package/out/_next/static/chunks/3537-e13161b33c5d4b0d.js +0 -1
  156. package/out/_next/static/chunks/4103-5d755e25cbaa9547.js +0 -1
  157. package/out/_next/static/chunks/4525-e690f0a01e215ab6.js +0 -1
  158. package/out/_next/static/chunks/4574-a687171a0d6761f0.js +0 -1
  159. package/out/_next/static/chunks/5145-57612d848a2c08ab.js +0 -1
  160. package/out/_next/static/chunks/551-3a2dfa1810729cc6.js +0 -1
  161. package/out/_next/static/chunks/5671-e0cb07e96c9d3f37.js +0 -1
  162. package/out/_next/static/chunks/5702-3084225a5b8bf901.js +0 -1
  163. package/out/_next/static/chunks/6173-cd5a2852040bb308.js +0 -1
  164. package/out/_next/static/chunks/671-b6e7029be19fc4aa.js +0 -1
  165. package/out/_next/static/chunks/6809-a2e96e8a02386b50.js +0 -1
  166. package/out/_next/static/chunks/6984-e96a7e7609270c53.js +0 -1
  167. package/out/_next/static/chunks/8033-953b6a0dd9f03457.js +0 -1
  168. package/out/_next/static/chunks/8231-a60b57d33ebd8fbc.js +0 -1
  169. package/out/_next/static/chunks/8419-97152dc7cf0685f8.js +0 -1
  170. package/out/_next/static/chunks/8683-c0f4de7f03275c0b.js +0 -1
  171. package/out/_next/static/chunks/9452-2d1c36b020234941.js +0 -1
  172. package/out/_next/static/chunks/9480-958a546e445a5c8d.js +0 -1
  173. package/out/_next/static/chunks/97-342ad4bc3c0f8df1.js +0 -1
  174. package/out/_next/static/chunks/9780-675c17034ce03f0d.js +0 -1
  175. package/out/_next/static/chunks/9793-ca78cbc0ebe8ac72.js +0 -1
  176. package/out/_next/static/chunks/9979-3a9b4ad3c8ad6d48.js +0 -1
  177. package/out/_next/static/chunks/pages/_app-0243a1e6675a72c9.js +0 -20
  178. package/out/_next/static/chunks/pages/account/forgot-password-ee5be2fccae6b158.js +0 -1
  179. package/out/_next/static/chunks/pages/account-8ef034d544494ccb.js +0 -1
  180. package/out/_next/static/chunks/pages/assortments/AssortmentDetailPage-d09942fc94106878.js +0 -1
  181. package/out/_next/static/chunks/pages/assortments/new-ddcb4f543e48d1b7.js +0 -1
  182. package/out/_next/static/chunks/pages/assortments-c4903883952e57b3.js +0 -1
  183. package/out/_next/static/chunks/pages/country/CountryDetailPage-e012327a708f0411.js +0 -1
  184. package/out/_next/static/chunks/pages/country/new-b8d276d2428c37b8.js +0 -1
  185. package/out/_next/static/chunks/pages/country-67a38a7a550bfc53.js +0 -1
  186. package/out/_next/static/chunks/pages/currency/CurrencyDetailPage-4a57c2fbc86f6ffb.js +0 -1
  187. package/out/_next/static/chunks/pages/currency/new-2a93dcfb4042d9f7.js +0 -1
  188. package/out/_next/static/chunks/pages/currency-58b6ff1e7bbb06e5.js +0 -1
  189. package/out/_next/static/chunks/pages/delivery-provider/DeliveryProviderDetailPage-219ea7eda50132f6.js +0 -1
  190. package/out/_next/static/chunks/pages/delivery-provider/new-60b7d83644a9aeb8.js +0 -1
  191. package/out/_next/static/chunks/pages/delivery-provider-7b639abbe5b7460e.js +0 -1
  192. package/out/_next/static/chunks/pages/enrollments/EnrollmentDetailPage-e9146d8e2e1ce2a0.js +0 -1
  193. package/out/_next/static/chunks/pages/enrollments-414b10c41a990a1a.js +0 -1
  194. package/out/_next/static/chunks/pages/events/EventDetailPage-b30e38b5a4bd982e.js +0 -1
  195. package/out/_next/static/chunks/pages/events-bda227c4e210f56a.js +0 -1
  196. package/out/_next/static/chunks/pages/filters/FilterDetailPage-257df97393ed8137.js +0 -1
  197. package/out/_next/static/chunks/pages/filters/new-3aff15be15e1eddf.js +0 -1
  198. package/out/_next/static/chunks/pages/filters-7bf2b7e140c715ae.js +0 -1
  199. package/out/_next/static/chunks/pages/home-a611bd1d6e445895.js +0 -1
  200. package/out/_next/static/chunks/pages/index-3e4ff78693231b34.js +0 -1
  201. package/out/_next/static/chunks/pages/index.old-c78957bb1fe826b7.js +0 -1
  202. package/out/_next/static/chunks/pages/language/LanguageDetailPage-cce36ed3fd96d893.js +0 -1
  203. package/out/_next/static/chunks/pages/language/new-a558c505cd1294ed.js +0 -1
  204. package/out/_next/static/chunks/pages/language-c6ed31818074a8c9.js +0 -1
  205. package/out/_next/static/chunks/pages/log-in-ab07b5daea724e34.js +0 -1
  206. package/out/_next/static/chunks/pages/orders/OrderDetailPage-15b5f3ea7151e8cd.js +0 -1
  207. package/out/_next/static/chunks/pages/orders-8d733bcfa2b05b76.js +0 -1
  208. package/out/_next/static/chunks/pages/payment-provider/PaymentProviderDetailPage-3bac3cfd0e479dcf.js +0 -1
  209. package/out/_next/static/chunks/pages/payment-provider/new-e95f2bd82ce3b2e9.js +0 -1
  210. package/out/_next/static/chunks/pages/payment-provider-a10e46e7628d3647.js +0 -1
  211. package/out/_next/static/chunks/pages/products/ProductDetailPage-1c8a3f4ff77d781f.js +0 -1
  212. package/out/_next/static/chunks/pages/products/new-689c2f7be2595c79.js +0 -1
  213. package/out/_next/static/chunks/pages/products-7ec12fb5d3eacf0e.js +0 -1
  214. package/out/_next/static/chunks/pages/quotations/QuotationDetailPage-c33feb58cf0168f3.js +0 -1
  215. package/out/_next/static/chunks/pages/quotations-2c3a195b91341916.js +0 -1
  216. package/out/_next/static/chunks/pages/reset-password-a85ba37dd5f70792.js +0 -1
  217. package/out/_next/static/chunks/pages/sign-up-c4c4ba79e26b3454.js +0 -1
  218. package/out/_next/static/chunks/pages/tokens/TokenDetailPage-854fd45cfdda3df8.js +0 -1
  219. package/out/_next/static/chunks/pages/tokens-dfdf32b3d8825447.js +0 -1
  220. package/out/_next/static/chunks/pages/users/UserDetailPage-26676fb98258b831.js +0 -1
  221. package/out/_next/static/chunks/pages/users/new-3b1574452d3ae0a3.js +0 -1
  222. package/out/_next/static/chunks/pages/users-e6a8a82278ddc974.js +0 -1
  223. package/out/_next/static/chunks/pages/warehousing-provider/WarehousingProviderDetailPage-b4b06c846edf0e30.js +0 -1
  224. package/out/_next/static/chunks/pages/warehousing-provider/new-5211d732c9c7f893.js +0 -1
  225. package/out/_next/static/chunks/pages/warehousing-provider-25b70652218396aa.js +0 -1
  226. package/out/_next/static/chunks/pages/works/WorkDetailPage-7a56dc2e720fff1a.js +0 -1
  227. package/out/_next/static/chunks/pages/works/management-90b47decb8ffa26d.js +0 -1
  228. package/out/_next/static/chunks/pages/works-05426b88d576481f.js +0 -1
  229. package/out/_next/static/css/8d28df6c2f6c13f8.css +0 -1
  230. package/out/_next/static/kjlG1JiSll7XZ8riqeZsU/_buildManifest.js +0 -1
  231. /package/out/_next/static/{kjlG1JiSll7XZ8riqeZsU → DrJiftIXIXSswkrlx5Qns}/_ssgManifest.js +0 -0
  232. /package/out/_next/static/chunks/{2272-0d5409b234decbcb.js → 2272-32f4533681c14568.js} +0 -0
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1563],{10561:(e,t,s)=>{s.d(t,{A:()=>n});var l=s(14351),r=s(52435),a=s(77742);let n=()=>{let{locale:e}=(0,a.A)();return{formatDateTime:function(t){let s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!t||!Date.parse(t))return"n/a";try{let l=e||"undefined"!=typeof navigator&&navigator.language||"de-ch";return Intl.DateTimeFormat(l,s).format(new Date(t).getTime())}catch(e){return Intl.DateTimeFormat("default",{year:"numeric",month:"short",day:"numeric"}).format(new Date(t).getTime())}},getDateFormatPattern:()=>{let t=e||"undefined"!=typeof navigator&&navigator.language||"de-ch";return new Intl.DateTimeFormat(t).formatToParts(new Date).map(e=>{switch(e.type){case"day":return"d".repeat(e.value.length);case"month":return"M".repeat(e.value.length);case"year":return"y".repeat(e.value.length);case"literal":return e.value;default:return"dd.mm.yyyy"}}).join("")},parseDate:e=>(0,l.GP)((0,r.uk)(e,Intl.DateTimeFormat().resolvedOptions().timeZone),"yyyy-MM-dd")}}},20432:(e,t,s)=>{s.d(t,{A:()=>i});var l=s(96427),r=s(79350),a=s(53588);function n(){let e=(0,l._)(["\n mutation AddWork(\n $type: WorkType!\n $priority: Int! = 0\n $input: JSON\n $originalWorkId: ID\n $scheduled: Timestamp\n $retries: Int! = 20\n ) {\n addWork(\n type: $type\n priority: $priority\n input: $input\n originalWorkId: $originalWorkId\n scheduled: $scheduled\n retries: $retries\n ) {\n _id\n }\n }\n"]);return n=function(){return e},e}let d=(0,r.J1)(n()),i=()=>{let[e]=(0,a.n)(d);return{addWork:async t=>{let{type:s,priority:l,input:r,originalWorkId:a,scheduled:n=null,retries:d}=t;return e({variables:{type:s,priority:l,input:r,originalWorkId:a,scheduled:n,retries:d},refetchQueries:["WorkQueue"]})}}}},36318:(e,t,s)=>{s.d(t,{A:()=>r});var l=s(37876);let r=e=>{var t,s;let{work:r,children:a=null}=e;return(null==r?void 0:r.original)?(null==r||null==(t=r.original)?void 0:t.retries)===(null==r?void 0:r.retries)?(0,l.jsxs)("span",{children:[(0,l.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,l.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"})}),a]}):(0,l.jsx)("span",{children:(0,l.jsxs)("span",{children:[(0,l.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,l.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"})}),a,(0,l.jsx)("span",{className:"text-rose-400 text-sm ml-2",children:"".concat(null==r?void 0:r.retries," / ").concat(null==r||null==(s=r.original)?void 0:s.retries)})]})}):a}},40817:(e,t,s)=>{s.d(t,{A:()=>n});var l=s(37876),r=s(21671),a=s(77742);let n=e=>{let{onClick:t,text:s=null,Icon:n=null}=e,{formatMessage:d}=(0,a.A)();return(0,l.jsxs)("button",{type:"button",onClick:t,"aria-describedby":"header-delete-button",className:"inline-flex items-center gap-2 justify-center rounded-md border border-rose-500 px-4 py-2 text-sm font-medium leading-5 text-rose-600 shadow-sm hover:border-rose-600 hover:bg-rose-600 hover:text-white focus:outline-hidden focus:ring-2 focus:ring-rose-500 focus:ring-offset-2 h-[38px]",children:[(0,l.jsx)("span",{children:n||(0,l.jsx)(r.A,{className:"h-5 w-5"})}),s||d({id:"delete",defaultMessage:"Delete"})]})}},47132:(e,t,s)=>{s.d(t,{A:()=>a});var l=s(37876),r=s(14232);let a=e=>{let{text:t,children:s}=e,[a,n]=(0,r.useState)(!1);return(0,l.jsxs)("div",{className:"relative",children:[(0,l.jsx)("div",{onMouseEnter:()=>{n(!0)},onMouseLeave:()=>{n(!1)},children:s}),a&&(0,l.jsx)("div",{className:"tooltip absolute p-2 bg-slate-700 text-white rounded-lg whitespace-nowrap",children:t})]})}},51563:(e,t,s)=>{s.r(t),s.d(t,{default:()=>R});var l=s(37876),r=s(89099),a=s(77742),n=s(4301),d=s(48230),i=s.n(d),o=s(14232),u=s(89452),c=s(10561),m=s(37857),x=s(68526),h=s(52725),f=s(47132),v=s(36318);let g=e=>{var t,s,r,n,d;let{work:g}=e,{formatMessage:w}=(0,a.A)(),{formatDateTime:k}=(0,c.A)(),{getDuration:p,getScheduledTime:b}=(0,h.A)(),[,j]=(0,o.useState)(null);(0,o.useEffect)(()=>{let e=null;return g&&("NEW"===g.status||"ALLOCATED"===g.status)&&(e=setInterval(()=>j(Date.now()),1e3)),()=>{clearInterval(e)}},[null==g?void 0:g.status]);let N={timeStyle:"medium",dateStyle:"long"};return(0,l.jsx)("div",{className:"rounded-xl xl:-mx-8 mt-10 p-2 sm:p-6 lg:p-8 ".concat((0,m.IL)(null==g?void 0:g.status)),children:(0,l.jsxs)("div",{className:"grid grid-cols-1 gap-8 lg:grid-cols-2 auto-rows-max",children:[(0,l.jsxs)("div",{className:"max-h-fit col-span-2 rounded-lg border border-slate-300 dark:border-slate-800 bg-white dark:bg-slate-900 p-4 shadow-md dark:shadow-none sm:p-6 lg:col-span-1 lg:p-8",children:[(0,l.jsxs)("div",{className:"mb-2 flex flex-wrap items-center justify-between",children:[(0,l.jsx)("div",{className:"mr-4 text-base text-slate-500 dark:text-slate-500 ",children:w({id:"work_type",defaultMessage:"Work type"})}),(0,l.jsx)("div",{className:"mt-2 max-w-prose space-y-5 text-sm",children:null==g?void 0:g.type})]}),(0,l.jsxs)("div",{className:"mb-2 flex flex-wrap items-center justify-between",children:[(0,l.jsx)("div",{className:"mr-4 text-base text-slate-500 dark:text-slate-500 ",children:w({id:"work_status",defaultMessage:"Work Status"})}),(0,l.jsx)(u.A,{text:null==g?void 0:g.status,color:m.tV[null==g?void 0:g.status]})]}),(0,l.jsxs)("div",{className:"mb-2 flex flex-wrap items-center justify-between",children:[(0,l.jsx)("div",{className:"mr-4 text-base text-slate-500 dark:text-slate-500 ",children:w({id:"work_priority",defaultMessage:"Priority"})}),(0,l.jsx)("div",{className:"mt-2 max-w-prose space-y-5 text-sm ",children:null==g?void 0:g.priority})]}),(0,l.jsxs)("div",{className:"mb-2 flex flex-wrap items-center justify-between",children:[(0,l.jsx)("div",{className:"mr-4 text-base text-slate-500 dark:text-slate-500 ",children:w({id:"work_retries",defaultMessage:"Retries"})}),(0,l.jsx)("div",{className:"mt-2 max-w-prose space-y-5 text-sm",children:(0,l.jsx)(v.A,{work:g})})]}),(0,l.jsxs)("div",{className:"mb-2 flex flex-wrap items-center justify-between",children:[(0,l.jsx)("div",{className:"mr-4 text-base text-slate-500 dark:text-slate-500 ",children:w({id:"worker",defaultMessage:"Worker"})}),(0,l.jsx)("div",{className:"mt-2 max-w-prose space-y-5 text-sm",children:(null==g?void 0:g.worker)?(0,l.jsx)(u.A,{text:w({id:"worker_dynamic",defaultMessage:"{worker}"},{worker:null==g?void 0:g.worker}),color:"purple"}):"n/a"})]}),(null==g?void 0:g.retries)||(null==g?void 0:g.original)?(0,l.jsxs)("div",{className:"mb-2 flex flex-wrap items-center justify-between",children:[(0,l.jsx)("div",{className:"mr-4 text-base text-slate-500 dark:text-slate-500 ",children:w({id:"work_original",defaultMessage:"Original Work"})}),(0,l.jsx)("div",{className:"mt-2 max-w-prose space-y-5 text-sm",children:(0,l.jsx)(i(),{href:"/works?workerId=".concat(null==g||null==(t=g.original)?void 0:t._id),className:"text-slate-900 dark:text-slate-300",children:null==g||null==(s=g.original)?void 0:s._id})})]}):""]}),(0,l.jsx)("div",{className:"col-span-2 rounded-lg border border-slate-300 dark:border-slate-800 bg-white dark:bg-slate-900 p-4 shadow-md dark:shadow-none sm:p-6 lg:col-span-1 lg:p-8",children:(0,l.jsxs)("div",{className:"grid grid-cols-2 gap-5",children:[(0,l.jsxs)("div",{className:"sm:col-span-1",children:[(0,l.jsx)("div",{className:"flex text-base text-slate-500 dark:text-slate-500 ",children:w({id:"work_created",defaultMessage:"Created"})}),(0,l.jsx)("div",{className:"flex text-sm",children:k(null==g?void 0:g.created,N)})]}),(0,l.jsxs)("div",{className:"sm:col-span-1",children:[(0,l.jsx)("div",{className:"flex text-base text-slate-500 dark:text-slate-500 ",children:w({id:"work_scheduled",defaultMessage:"Scheduled"})}),(0,l.jsx)("div",{className:"flex text-sm w-100",children:(0,l.jsx)(f.A,{text:k(null==g?void 0:g.scheduled,N),children:b(g)})})]}),(0,l.jsxs)("div",{className:"sm:col-span-1",children:[(0,l.jsx)("div",{className:"flex text-base text-slate-500 dark:text-slate-500 ",children:w({id:"work_started",defaultMessage:"Started"})}),(0,l.jsx)("div",{className:"flex text-sm",children:k(null==g?void 0:g.started,N)})]}),(0,l.jsxs)("div",{className:"sm:col-span-1",children:[(0,l.jsx)("div",{className:"flex text-base text-slate-500 dark:text-slate-500 ",children:w({id:"work_finished",defaultMessage:"Finished"})}),(0,l.jsx)("div",{className:"flex text-sm",children:k(null==g?void 0:g.finished,N)})]}),(0,l.jsxs)("div",{className:"sm:col-span-1",children:[(0,l.jsx)("div",{className:"flex text-base text-slate-500 dark:text-slate-500 ",children:w({id:"duration",defaultMessage:"Duration"})}),(0,l.jsx)("div",{className:"flex text-sm",children:p(g)})]}),(null==g?void 0:g.deleted)&&(0,l.jsxs)("div",{className:"sm:col-span-1",children:[(0,l.jsx)("div",{className:"flex text-base text-slate-500 dark:text-slate-500 ",children:w({id:"deleted",defaultMessage:"Deleted"})}),(0,l.jsx)("div",{className:"flex text-sm",children:k(null==g?void 0:g.deleted,N)})]})]})}),(null==g?void 0:g.error)&&(0,l.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,l.jsx)("div",{className:"px-4 py-5 sm:px-6 border-b border-rose-300 dark:border-rose-800",children:(0,l.jsxs)("h3",{className:"text-lg font-medium leading-6 text-rose-700 dark:text-rose-300 flex items-center gap-2",children:[(0,l.jsx)("svg",{className:"w-6 h-6",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,l.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 8v4m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})}),w({id:"error",defaultMessage:"Error"})]})}),(0,l.jsx)("div",{className:"bg-rose-50 dark:bg-rose-950",children:(0,l.jsx)(x.A,{value:decodeURI(JSON.stringify(g.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"})})]}),(null==g?void 0:g.input)&&(0,l.jsxs)("div",{className:"overflow-hidden rounded-lg border border-slate-300 dark:border-slate-800 col-span-2 shadow-md dark:shadow-none bg-white dark:bg-slate-900 lg:col-span-1",children:[(0,l.jsx)("div",{className:"px-4 py-5 sm:px-6",children:(0,l.jsx)("h3",{className:"text-lg font-medium leading-6 text-slate-900 dark:text-slate-500",children:w({id:"input",defaultMessage:"Input"})})}),(0,l.jsx)(x.A,{value:JSON.stringify(g.input,null,2),disabled:!0,className:"block w-full max-w-full resize-none sm:text-sm"})]}),(null==g?void 0:g.result)&&(0,l.jsxs)("div",{className:"overflow-hidden rounded-lg shadow-md dark:shadow-none border border-slate-300 dark:border-slate-800 col-span-2 bg-white dark:bg-slate-900 lg:col-span-1",children:[(0,l.jsxs)("div",{className:"px-4 py-5 sm:px-6 flex items-center justify-between",children:[(0,l.jsx)("h3",{className:"text-lg font-medium leading-6 text-slate-900 dark:text-slate-500",children:w({id:"result",defaultMessage:"Result"})}),(null==g?void 0:g.type)==="BULK_IMPORT"&&(null==g||null==(r=g.result)?void 0:r.created)&&(0,l.jsx)("span",{className:"text-sm text-slate-600 dark:text-slate-400",children:w({id:"items_created",defaultMessage:"{count} items created"},{count:g.result.created.length})})]}),(0,l.jsx)(x.A,{value:JSON.stringify(g.result,null,2),disabled:!0,className:"block w-full max-w-full resize-none sm:text-sm ".concat((null==g?void 0:g.type)==="BULK_IMPORT"&&(null==g||null==(d=g.result)||null==(n=d.created)?void 0:n.length)>50?"max-h-96 overflow-y-auto":"")})]})]})})};var w=s(96427),k=s(79350),p=s(54431),b=s(66400),j=s(81141);function N(){let e=(0,w._)(["\n query Work($workId: ID!) {\n work(workId: $workId) {\n ...WorkFragment\n ","\n input\n result\n error\n priority\n worker\n retries\n original {\n _id\n }\n timeout\n }\n }\n ","\n"]);return N=function(){return e},e}let y=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return(0,k.J1)(N(),e,j.A)},M=e=>{let{workId:t=null,...s}=e,{customProperties:l}=(0,b.A)(),{data:r,loading:a,error:n}=(0,p.IT)(y(null==l?void 0:l.Work),{skip:!t,variables:{workId:t},...s});return{work:null==r?void 0:r.work,loading:a,error:n}};var A=s(53588);function _(){let e=(0,w._)(["\n mutation RemoveWork($workId: ID!) {\n removeWork(workId: $workId) {\n _id\n }\n }\n"]);return _=function(){return e},e}let I=(0,k.J1)(_()),W=()=>{let[e]=(0,A.n)(I);return{removeWork:async t=>{let{workId:s}=t;return e({variables:{workId:s},refetchQueries:["WorkQueue"]})}}};var D=s(20432),T=s(13437),C=s(92797),L=s(17703),S=s(88943),$=s(89819),F=s(40817),E=s(8784),O=s(52272);let R=e=>{let{workerId:t}=e,{formatMessage:s}=(0,a.A)(),{query:d,push:i}=(0,r.useRouter)(),{work:u,loading:c}=M({workId:t,pollInterval:2e3}),{setModal:m}=(0,$.A)(),{removeWork:x}=W(),{addWork:h}=(0,D.A)(),f=(0,o.useCallback)(async()=>{let{data:e}=await h({...u,scheduled:null,originalWorkId:null==u?void 0:u._id});i("/works?workerId=".concat(e.addWork._id))},[u]),v=async()=>{await m((0,l.jsx)(S.A,{onCancelClick:()=>m(""),message:s({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()=>{m(""),await x({workId:t}),n.oR.success(s({id:"work_deleted",defaultMessage:"Work deleted successfully"}))},okText:s({id:"delete_work",defaultMessage:"Delete work"})}))};return(0,l.jsxs)("div",{className:"mt-5 max-w-full",children:[(0,l.jsx)(L.A,{}),(0,l.jsxs)("div",{className:"items-center flex min-w-full justify-between gap-3 flex-wrap",children:[(0,l.jsx)(C.A,{headerText:s({id:"work_detail",defaultMessage:"Work Detail"}),title:s({id:"work_detail_title",defaultMessage:"Work {id}"},{id:null==u?void 0:u._id})}),(e=>e&&((null==e?void 0:e.status)===O.Fh.Failed||(null==e?void 0:e.status)===O.Fh.Success))(u)?(0,l.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:f,children:[(0,l.jsx)("span",{className:"pr-1",children:(0,l.jsx)(E.A,{className:"h-5 w-5"})}),s({id:"retry-work",defaultMessage:"Retry"})]}):null,u&&(e=>e===O.Fh.New||e===O.Fh.Allocated)(null==u?void 0:u.status)?(0,l.jsx)(F.A,{onClick:v}):null]}),c?(0,l.jsx)(T.A,{}):(0,l.jsx)(g,{work:u})]})}},52725:(e,t,s)=>{s.d(t,{A:()=>a});var l=s(23463),r=s(31418);let a=()=>({getScheduledTime:e=>{if(!e)return null;let{scheduled:t,status:s,started:r}=e;if("FAILED"===s||"SUCCESS"===s||"DELETED"===s)return null;let a=new Date(t).getTime();return"ALLOCATED"!==s&&("NEW"!==s||r)?null:(0,l.B)(a,{addSuffix:!0})},getDuration:e=>{if(!e)return null;let{started:t,finished:s}=e,l=new Date().getTime();if(!t)return null;let a=null;return a=t&&!s?l-new Date(t).getTime():new Date(s).getTime()-new Date(t).getTime(),(0,r.a)({hours:Number(Math.floor(a/1e3/60/60)%24),minutes:Number(Math.floor(a/1e3/60)%60),seconds:Number(Math.ceil(a/1e3)%60)},{zero:!1})}})},68526:(e,t,s)=>{s.d(t,{A:()=>n});var l=s(37876),r=s(15039),a=s.n(r);let n=e=>{var t;let{value:s,className:r,onChange:n=()=>{},...d}=e;return(0,l.jsx)("textarea",{className:a()("text-black dark:bg-slate-900 dark:text-slate-200 border-transparent border-t border-t-slate-200 dark:border-t-slate-800",r),value:s,onChange:n,rows:Math.max(((null==(t=s||" ")?void 0:t.split(" "))||[]).length/2,7),...d})}},81141:(e,t,s)=>{s.d(t,{A:()=>a});var l=s(96427);function r(){let e=(0,l._)(["\n fragment WorkFragment on Work {\n _id\n type\n scheduled\n status\n started\n success\n finished\n created\n deleted\n retries\n original {\n _id\n retries\n }\n }\n"]);return r=function(){return e},e}let a=(0,s(79350).J1)(r())},88943:(e,t,s)=>{s.d(t,{A:()=>a});var l=s(37876),r=s(77742);let a=e=>{let{onOkClick:t,onCancelClick:s,okText:a=null,cancelText:n=null,headerText:d=null,message:i=null,icon:o=null,close:u=null}=e,{formatMessage:c}=(0,r.A)();return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)("div",{className:"sm:flex sm:items-start",children:[o||(0,l.jsx)("div",{className:"mx-auto flex h-12 w-12 shrink-0 items-center justify-center rounded-full bg-rose-100 dark:bg-rose-900/30 sm:mx-0 sm:h-10 sm:w-10",children:(0,l.jsx)("svg",{className:"h-6 w-6 text-rose-600 dark:text-rose-400",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","aria-hidden":"true",children:(0,l.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"})})}),(0,l.jsxs)("div",{className:"mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left",children:[(0,l.jsx)("h3",{className:"text-lg font-medium leading-6 text-slate-900 dark:text-slate-200",id:"modal-title",children:d||c({id:"warning",defaultMessage:"Warning!"})}),(0,l.jsx)("div",{className:"mt-2",children:(0,l.jsx)("p",{className:"text-sm text-slate-500 dark:text-slate-200",children:i||c({id:"are_you_sure",defaultMessage:"Are you sure?"})})})]})]}),(0,l.jsxs)("div",{className:"mt-5 sm:mt-4 sm:flex sm:flex-row-reverse",children:[(0,l.jsx)("button",{id:"danger_continue",onClick:t,type:"button",className:"inline-flex w-full justify-center rounded-md border border-transparent bg-rose-600 px-4 py-2 text-base font-medium text-white shadow-xs hover:bg-rose-700 focus:outline-hidden focus:ring-2 focus:ring-rose-500 focus:ring-offset-2 sm:ml-3 sm:w-auto sm:text-sm",children:a||c({id:"continue",defaultMessage:"Continue"})}),(0,l.jsx)("button",{id:"danger_cancel",onClick:s||u,type:"button",className:"mt-3 inline-flex w-full justify-center rounded-md border border-slate-300 bg-white px-4 py-2 text-base font-medium text-slate-700 shadow-xs hover:bg-slate-50 focus:outline-hidden focus:ring-2 focus:ring-slate-800 focus:ring-offset-2 sm:mt-0 sm:ml-3 sm:w-auto sm:text-sm",children:n||c({id:"cancel",defaultMessage:"Cancel"})})]})]})}},89819:(e,t,s)=>{s.d(t,{A:()=>a});var l=s(14232),r=s(71988);let a=()=>(0,l.useContext)(r.A)}}]);
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1797],{17703:(e,t,l)=>{l.d(t,{A:()=>o});var s=l(37876),r=l(48230),n=l.n(r),a=l(89099),d=l(77742);let o=e=>{var t,l;let{routeName:r=null,currentPageTitle:o=null,depth:i=null}=e,c=(0,a.useRouter)(),{formatMessage:u}=(0,d.A)(),m={home:"home",products:"products",orders:"orders",users:"users",assortments:"assortments",filters:"filters",tokens:"tokens",quotations:"quotations",enrollments:"enrollments",activities:"activities",works:"work_queue",events:"events",currency:"currencies",country:"countries",language:"languages","delivery-provider":"delivery_providers","payment-provider":"payment_providers","warehousing-provider":"warehousing_provider",system:"system",account:"account",new:"new",edit:"edit"},h=null==(l=c.asPath)||null==(t=l.split("/"))?void 0:t.filter((e,t)=>{var l,s;return(null==(s=c.asPath)||null==(l=s.split("/"))?void 0:l.indexOf(e))===t});if(1===h.length)return null;let x="";i&&h.splice(i),r&&(h[h.length-1]=r);let f=null==h?void 0:h.map(e=>{if(x+="".concat(e,"/"),!e)return{name:u({id:"home",defaultMessage:"Home"}),path:"/home"};let t=null==e?void 0:e.split("?")[0],l=r?t:t.replace(/-/g," "),s=m[t];return{name:s?u({id:s,defaultMessage:l}):decodeURIComponent(l),path:x.replace(/.$/,"")}});return(0,s.jsx)("nav",{className:"mb-5 hidden sm:flex lg:mt-5 lg:mb-8","aria-label":"Breadcrumb",children:(0,s.jsx)("ol",{className:"flex items-center space-x-4",children:null==f?void 0:f.map((e,t)=>(0,s.jsx)("li",{children:(0,s.jsxs)("div",{className:"flex items-center",children:[0!==t&&(0,s.jsx)("svg",{className:"mr-4 h-5 w-5 shrink-0 text-slate-400",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",children:(0,s.jsx)("path",{fillRule:"evenodd",d:"M7.293 14.707a1 1 0 010-1.414L10.586 10 7.293 6.707a1 1 0 011.414-1.414l4 4a1 1 0 010 1.414l-4 4a1 1 0 01-1.414 0z",clipRule:"evenodd"})}),(0,s.jsx)(n(),{href:e.path,className:"text-sm font-medium capitalize text-slate-500 dark:text-slate-400 dark:hover:text-slate-300 hover:text-slate-700 focus:outline-hidden focus:ring-2 focus:ring-slate-800 rounded-md px-1 py-1",children:t===f.length-1&&o?o:e.name})]})},e.path))})})}},46477:(e,t,l)=>{l.d(t,{Ab:()=>s,GC:()=>m,Jp:()=>i,SS:()=>r,Sn:()=>d,XM:()=>c,gQ:()=>a,t4:()=>o,xW:()=>n});let s=()=>({formatPrice:e=>{if(!(null==e?void 0:e.currencyCode))return"n/a";if((null==e?void 0:e.amount)===void 0||(null==e?void 0:e.amount)===null)return"";let{amount:t,currencyCode:l}=e||{};return new Intl.NumberFormat(navigator.language,{style:"currency",currency:l}).format(t/100)}}),r=e=>(null==e?void 0:e.label)&&(null==e?void 0:e.version)?"".concat(e.label," ").concat(e.version):"",n=function(){for(var e=arguments.length,t=Array(e),l=0;l<e;l++)t[l]=arguments[l];return t.filter(Boolean).join(" ")},a=function(e,t){let l=!(arguments.length>2)||void 0===arguments[2]||arguments[2];if(!t)return"";try{return"".concat(new Intl.DisplayNames([e],{type:"region"}).of(t)," ").concat(l?"(".concat(t,")"):"")}catch(e){return t}},d=function(e,t){let l=!(arguments.length>2)||void 0===arguments[2]||arguments[2];if(!t)return"";try{return"".concat(new Intl.DisplayNames([e],{type:"language"}).of(t)," ").concat(l?"(".concat(t,")"):"")}catch(e){return t}},o=function(e,t){let l=!(arguments.length>2)||void 0===arguments[2]||arguments[2];if(!t)return"";try{return"".concat(new Intl.DisplayNames([e],{type:"currency"}).of(t)," ").concat(l?"(".concat(t,")"):"")}catch(e){return t}},i=e=>e&&(null==e?void 0:e.split(",").reduce((e,t)=>{var l;let[s=null,r=null]=(null==(l=t||"")?void 0:l.split("_"))||[];return{...e,[s]:r}},null))||{},c=e=>{var t;return null==(t=Object.entries(i(e)))?void 0:t.map(e=>{let[t,l]=e;return{key:t,value:l}})},u=e=>{var t,l;return null==(l=Object.keys(e))||null==(t=l.map(t=>[t,e[t]].join("=")))?void 0:t.join("&")},m=(e,t,l)=>u(l?{...e,[l]:t}:e)},50970:(e,t,l)=>{l.d(t,{A:()=>o});var s=l(37876),r=l(7527),n=l(15039),a=l.n(n),d=l(8733);let o=e=>{let{message:t,className:l="",Icon:n=null}=e;return(0,s.jsx)("div",{className:a()("rounded-md flex w-full flex-col items-center justify-center min-h-[176px] py-8 border-1 border-dashed border-slate-300 dark:border-slate-700 text-slate-500 dark:text-slate-400",l),children:(0,s.jsxs)("div",{className:"grid items-center justify-center",children:[(0,s.jsx)("div",{className:"flex items-center justify-center text-slate-400 dark:text-slate-200",children:n||(0,s.jsx)(r.A,{className:"h-8 w-8"})}),(0,s.jsx)(d.A,{id:"no_data_message",defaultMessage:"<p>No <span> {message} available</span> </p>",values:{p:e=>(0,s.jsx)("p",{className:"mt-2 m-auto flex items-center justify-center",children:e}),span:e=>(0,s.jsxs)("span",{className:"capitalize ml-1",children:[" ",e," "]}),message:t}})]})})}},78474:(e,t,l)=>{l.d(t,{A:()=>v});var s=l(37876),r=l(14232),n=l(15039),a=l.n(n),d=l(77742),o=l(22660),i=l(14397),c=l(89099),u=l(46477);let m=e=>e?"ASC"===e?"DESC":null:"ASC",h=e=>{let{onSort:t,sortDirection:l}=e;return l?"ASC"===l?(0,s.jsx)(o.A,{className:"ml-2 w-4 h-4 text-slate-700",onClick:t}):(0,s.jsx)(i.A,{className:"ml-2 w-4 h-4 text-slate-700",onClick:t}):(0,s.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:t,children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M8.25 15L12 18.75 15.75 15m-7.5-6L12 5.25 15.75 9"})})};var x=l(50970);let f=e=>{let t=[],l=[],s=[];return r.Children.forEach(e.children,e=>{var r,n;(null==e||null==(r=e.props)?void 0:r.header)?t.push(e):(null==e||null==(n=e.props)?void 0:n.footer)?s.push(e):l.push(e)}),{header:t,footer:s,body:l}},p=e=>{let{className:t="",...l}=e,[n,o]=(0,r.useState)(f(l)),{formatMessage:i}=(0,d.A)(),c={...n,header:r.Children.map(n.header,e=>r.cloneElement(e))};return(0,r.useEffect)(()=>{o(f(l))},[l.children]),c.header.length||c.body.length?(0,s.jsxs)("table",{className:a()("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-800/25",t),...l,children:[(0,s.jsx)("thead",{className:"hidden sm:table-header-group bg-slate-100 dark:bg-slate-700 text-sm text-slate-700 dark:text-slate-200",children:c.header}),c.body.length?(0,s.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:c.body}):null,c.footer.length?(0,s.jsx)("tfoot",{children:c.footer}):null]}):(0,s.jsx)(x.A,{message:i({id:"data",defaultMessage:"Data"})})};p.Row=e=>{let{className:t="",children:l=[],header:n=!1,enablesort:d=!1,...o}=e,i=r.Children.map(l,e=>null==r?void 0:r.cloneElement(e||(0,s.jsx)("span",{}),{header:n,enablesort:d}));return(0,s.jsx)("tr",{className:a()("grid grid-cols-1 auto-rows-fr border border-slate-100 dark:border-slate-700 sm:border-0 rounded-md sm:mb-0 sm:table-row sm:rounded-none bg-white dark:bg-slate-800 sm:bg-inherit dark:sm:bg-inherit",t),...o,children:i})},p.Cell=e=>{var t;let{className:l="",header:r=!1,enablesort:n=!1,children:d,sortKey:o=null,defaultSortDirection:i=null,...x}=e,f=(0,c.useRouter)(),p=(0,u.Jp)(null==(t=f.query)?void 0:t.sort),v=r?"th":"td";return(0,s.jsx)(v,{className:a()(r?"px-4 py-3 text-left text-slate-500 dark:text-slate-200":"whitespace-nowrap px-4 py-3 text-slate-500 dark:text-slate-200 border-b dark:border-slate-700 last:border-b-0 sm:border-b-0 text-left flex items-center sm:table-cell",l),...x,children:(0,s.jsxs)("div",{className:"flex items-center",children:[(0,s.jsx)("div",{className:"sm:inline",children:d}),"th"===v&&n&&o&&(0,s.jsx)(h,{onSort:e=>{let t;e.preventDefault(),!m(p[o])&&p[o]?(delete p[o],t=p):t={...p,[o]:"ASC"===p[o]?"DESC":"ASC"};let l=Object.entries(t).map(e=>{let[t,l]=e;return[t,l].join("_")}).join(","),{sort:s,...r}=f.query,n=Object.keys(r).map(e=>[e,r[e]].join("=")).join("&"),a=0===Object.keys(r).length?"".concat(f.basePath,"?sort=").concat(l):"".concat(f.basePath,"?").concat(n,"&sort=").concat(l);l?f.push(a):f.push({query:(0,u.GC)(r)})},sortDirection:Object.keys(p).length?p[o]:i})]})})};let v=p},92797:(e,t,l)=>{l.d(t,{A:()=>c});var s=l(37876),r=l(77328),n=l.n(r),a=l(48230),d=l.n(a),o=l(77742),i=l(83992);let c=e=>{let{headerText:t=null,onEdit:l=null,onDelete:r=null,children:a=null,title:c=null,addPath:u=null,addButtonText:m=null}=e,{formatMessage:h}=(0,o.A)();return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(n(),{children:(0,s.jsxs)("title",{children:["Unchained Copilot - ",c||t," "]})}),(0,s.jsx)("div",{className:"flex gap-3 flex-wrap items-center justify-between",children:(0,s.jsxs)("div",{className:"flex items-center justify-between w-full gap-4",children:[t&&(0,s.jsx)("h2",{className:"text-2xl font-bold text-slate-900 dark:text-slate-200 sm:truncate sm:text-3xl lg:text-4xl xl:text-5xl",children:t}),u&&(0,s.jsxs)(d(),{href:u,className:"relative inline-flex items-center rounded-sm border border-transparent bg-slate-800 dark:bg-slate-600 px-3 py-3 text-sm font-medium text-white shadow-xs hover:bg-slate-950 dark:hover:bg-slate-500 focus:outline-hidden focus:ring-2 focus:ring-slate-800 dark:focus:ring-slate-400 focus:ring-offset-2",children:[(0,s.jsx)(i.A,{className:"h-5 w-5"}),(0,s.jsx)("span",{className:"ml-2",children:m||h({id:"add",defaultMessage:"Add"})})]}),l&&(0,s.jsx)("button",{type:"button",className:"inline-flex items-center rounded-md border border-slate-300 dark:border-slate-600 bg-slate-800 dark:bg-slate-600 px-4 py-2 text-sm font-medium text-white shadow-xs hover:shadow-xl hover:bg-slate-950 dark:hover:bg-slate-500 focus:outline-hidden focus:ring-2 focus:ring-slate-800 dark:focus:ring-slate-400 focus:ring-offset-2",onClick:l,children:h({id:"edit",defaultMessage:"Edit"})}),r&&(0,s.jsx)("button",{type:"button",className:"inline-flex items-center rounded-md border-2 border-rose-100 dark:border-rose-400 px-4 py-2 text-sm font-medium text-rose-400 hover:text-white shadow-xs hover:shadow-xl hover:bg-rose-600 dark:hover:bg-rose-600 focus:outline-hidden focus:ring-2 focus:ring-rose-500 dark:focus:ring-rose-400 focus:ring-offset-2",onClick:r,children:h({id:"delete",defaultMessage:"Delete"})}),a]})})]})}},97292:(e,t,l)=>{l.d(t,{A:()=>n});var s=l(37876),r=l(77742);let n=e=>{let{children:t=null,totalRecords:l=null}=e,{formatMessage:n}=(0,r.A)();return(0,s.jsxs)("div",{className:"mt-5",children:[null!==l?(0,s.jsx)("div",{className:"text-md text-slate-950 dark:text-slate-100 mb-3",children:n({id:"total_records",defaultMessage:"{total} records found"},{total:null!=l?l:0})}):null,t&&(0,s.jsx)("div",{className:"flex items-center mt-10",children:(0,s.jsx)("h3",{className:"text-xs leading-6 text-slate-500 dark:text-slate-200",children:t})})]})}}}]);
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1992],{21162:(t,e,n)=>{n.d(e,{A:()=>o});var i=n(14232);let o=i.forwardRef(function(t,e){let{title:n,titleId:o,...r}=t;return i.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:e,"aria-labelledby":o},r),n?i.createElement("title",{id:o},n):null,i.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19.5 14.25v-2.625a3.375 3.375 0 0 0-3.375-3.375h-1.5A1.125 1.125 0 0 1 13.5 7.125v-1.5a3.375 3.375 0 0 0-3.375-3.375H8.25m0 12.75h7.5m-7.5 3H12M10.5 2.25H5.625c-.621 0-1.125.504-1.125 1.125v17.25c0 .621.504 1.125 1.125 1.125h12.75c.621 0 1.125-.504 1.125-1.125V11.25a9 9 0 0 0-9-9Z"}))})},59454:(t,e,n)=>{n.d(e,{A:()=>o});var i=n(14232);let o=i.forwardRef(function(t,e){let{title:n,titleId:o,...r}=t;return i.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:e,"aria-labelledby":o},r),n?i.createElement("title",{id:o},n):null,i.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m16.862 4.487 1.687-1.688a1.875 1.875 0 1 1 2.652 2.652L10.582 16.07a4.5 4.5 0 0 1-1.897 1.13L6 18l.8-2.685a4.5 4.5 0 0 1 1.13-1.897l8.932-8.931Zm0 0L19.5 7.125M18 14v4.75A2.25 2.25 0 0 1 15.75 21H5.25A2.25 2.25 0 0 1 3 18.75V8.25A2.25 2.25 0 0 1 5.25 6H10"}))})},80400:(t,e,n)=>{n.d(e,{ll:()=>E,rD:()=>D,__:()=>C,UU:()=>V,cY:()=>A,BN:()=>S,Ej:()=>q});var i=n(81040);function o(t,e,n){let o,{reference:r,floating:l}=t,a=(0,i.TV)(e),f=(0,i.Dz)(e),c=(0,i.sq)(f),u=(0,i.C0)(e),s="y"===a,d=r.x+r.width/2-l.width/2,h=r.y+r.height/2-l.height/2,p=r[c]/2-l[c]/2;switch(u){case"top":o={x:d,y:r.y-l.height};break;case"bottom":o={x:d,y:r.y+r.height};break;case"right":o={x:r.x+r.width,y:h};break;case"left":o={x:r.x-l.width,y:h};break;default:o={x:r.x,y:r.y}}switch((0,i.Sg)(e)){case"start":o[f]-=p*(n&&s?-1:1);break;case"end":o[f]+=p*(n&&s?-1:1)}return o}let r=async(t,e,n)=>{let{placement:i="bottom",strategy:r="absolute",middleware:l=[],platform:a}=n,f=l.filter(Boolean),c=await (null==a.isRTL?void 0:a.isRTL(e)),u=await a.getElementRects({reference:t,floating:e,strategy:r}),{x:s,y:d}=o(u,i,c),h=i,p={},m=0;for(let n=0;n<f.length;n++){let{name:l,fn:g}=f[n],{x:v,y:w,data:x,reset:y}=await g({x:s,y:d,initialPlacement:i,placement:h,strategy:r,middlewareData:p,rects:u,platform:a,elements:{reference:t,floating:e}});s=null!=v?v:s,d=null!=w?w:d,p={...p,[l]:{...p[l],...x}},y&&m<=50&&(m++,"object"==typeof y&&(y.placement&&(h=y.placement),y.rects&&(u=!0===y.rects?await a.getElementRects({reference:t,floating:e,strategy:r}):y.rects),{x:s,y:d}=o(u,h,c)),n=-1)}return{x:s,y:d,placement:h,strategy:r,middlewareData:p}};async function l(t,e){var n;void 0===e&&(e={});let{x:o,y:r,platform:l,rects:a,elements:f,strategy:c}=t,{boundary:u="clippingAncestors",rootBoundary:s="viewport",elementContext:d="floating",altBoundary:h=!1,padding:p=0}=(0,i._3)(e,t),m=(0,i.nI)(p),g=f[h?"floating"===d?"reference":"floating":d],v=(0,i.B1)(await l.getClippingRect({element:null==(n=await (null==l.isElement?void 0:l.isElement(g)))||n?g:g.contextElement||await (null==l.getDocumentElement?void 0:l.getDocumentElement(f.floating)),boundary:u,rootBoundary:s,strategy:c})),w="floating"===d?{x:o,y:r,width:a.floating.width,height:a.floating.height}:a.reference,x=await (null==l.getOffsetParent?void 0:l.getOffsetParent(f.floating)),y=await (null==l.isElement?void 0:l.isElement(x))&&await (null==l.getScale?void 0:l.getScale(x))||{x:1,y:1},b=(0,i.B1)(l.convertOffsetParentRelativeRectToViewportRelativeRect?await l.convertOffsetParentRelativeRectToViewportRelativeRect({elements:f,rect:w,offsetParent:x,strategy:c}):w);return{top:(v.top-b.top+m.top)/y.y,bottom:(b.bottom-v.bottom+m.bottom)/y.y,left:(v.left-b.left+m.left)/y.x,right:(b.right-v.right+m.right)/y.x}}let a=new Set(["left","top"]);async function f(t,e){let{placement:n,platform:o,elements:r}=t,l=await (null==o.isRTL?void 0:o.isRTL(r.floating)),f=(0,i.C0)(n),c=(0,i.Sg)(n),u="y"===(0,i.TV)(n),s=a.has(f)?-1:1,d=l&&u?-1:1,h=(0,i._3)(e,t),{mainAxis:p,crossAxis:m,alignmentAxis:g}="number"==typeof h?{mainAxis:h,crossAxis:0,alignmentAxis:null}:{mainAxis:h.mainAxis||0,crossAxis:h.crossAxis||0,alignmentAxis:h.alignmentAxis};return c&&"number"==typeof g&&(m="end"===c?-1*g:g),u?{x:m*d,y:p*s}:{x:p*s,y:m*d}}var c=n(84974);function u(t){let e=(0,c.L9)(t),n=parseFloat(e.width)||0,o=parseFloat(e.height)||0,r=(0,c.sb)(t),l=r?t.offsetWidth:n,a=r?t.offsetHeight:o,f=(0,i.LI)(n)!==l||(0,i.LI)(o)!==a;return f&&(n=l,o=a),{width:n,height:o,$:f}}function s(t){return(0,c.vq)(t)?t:t.contextElement}function d(t){let e=s(t);if(!(0,c.sb)(e))return(0,i.Jx)(1);let n=e.getBoundingClientRect(),{width:o,height:r,$:l}=u(e),a=(l?(0,i.LI)(n.width):n.width)/o,f=(l?(0,i.LI)(n.height):n.height)/r;return a&&Number.isFinite(a)||(a=1),f&&Number.isFinite(f)||(f=1),{x:a,y:f}}let h=(0,i.Jx)(0);function p(t){let e=(0,c.zk)(t);return(0,c.Tc)()&&e.visualViewport?{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}:h}function m(t,e,n,o){var r;void 0===e&&(e=!1),void 0===n&&(n=!1);let l=t.getBoundingClientRect(),a=s(t),f=(0,i.Jx)(1);e&&(o?(0,c.vq)(o)&&(f=d(o)):f=d(t));let u=(void 0===(r=n)&&(r=!1),o&&(!r||o===(0,c.zk)(a))&&r)?p(a):(0,i.Jx)(0),h=(l.left+u.x)/f.x,m=(l.top+u.y)/f.y,g=l.width/f.x,v=l.height/f.y;if(a){let t=(0,c.zk)(a),e=o&&(0,c.vq)(o)?(0,c.zk)(o):o,n=t,i=(0,c._m)(n);for(;i&&o&&e!==n;){let t=d(i),e=i.getBoundingClientRect(),o=(0,c.L9)(i),r=e.left+(i.clientLeft+parseFloat(o.paddingLeft))*t.x,l=e.top+(i.clientTop+parseFloat(o.paddingTop))*t.y;h*=t.x,m*=t.y,g*=t.x,v*=t.y,h+=r,m+=l,n=(0,c.zk)(i),i=(0,c._m)(n)}}return(0,i.B1)({width:g,height:v,x:h,y:m})}function g(t,e){let n=(0,c.CP)(t).scrollLeft;return e?e.left+n:m((0,c.ep)(t)).left+n}function v(t,e,n){void 0===n&&(n=!1);let i=t.getBoundingClientRect();return{x:i.left+e.scrollLeft-(n?0:g(t,i)),y:i.top+e.scrollTop}}let w=new Set(["absolute","fixed"]);function x(t,e,n){let o;if("viewport"===e)o=function(t,e){let n=(0,c.zk)(t),i=(0,c.ep)(t),o=n.visualViewport,r=i.clientWidth,l=i.clientHeight,a=0,f=0;if(o){r=o.width,l=o.height;let t=(0,c.Tc)();(!t||t&&"fixed"===e)&&(a=o.offsetLeft,f=o.offsetTop)}return{width:r,height:l,x:a,y:f}}(t,n);else if("document"===e)o=function(t){let e=(0,c.ep)(t),n=(0,c.CP)(t),o=t.ownerDocument.body,r=(0,i.T9)(e.scrollWidth,e.clientWidth,o.scrollWidth,o.clientWidth),l=(0,i.T9)(e.scrollHeight,e.clientHeight,o.scrollHeight,o.clientHeight),a=-n.scrollLeft+g(t),f=-n.scrollTop;return"rtl"===(0,c.L9)(o).direction&&(a+=(0,i.T9)(e.clientWidth,o.clientWidth)-r),{width:r,height:l,x:a,y:f}}((0,c.ep)(t));else if((0,c.vq)(e))o=function(t,e){let n=m(t,!0,"fixed"===e),o=n.top+t.clientTop,r=n.left+t.clientLeft,l=(0,c.sb)(t)?d(t):(0,i.Jx)(1),a=t.clientWidth*l.x,f=t.clientHeight*l.y;return{width:a,height:f,x:r*l.x,y:o*l.y}}(e,n);else{let n=p(t);o={x:e.x-n.x,y:e.y-n.y,width:e.width,height:e.height}}return(0,i.B1)(o)}function y(t){return"static"===(0,c.L9)(t).position}function b(t,e){if(!(0,c.sb)(t)||"fixed"===(0,c.L9)(t).position)return null;if(e)return e(t);let n=t.offsetParent;return(0,c.ep)(t)===n&&(n=n.ownerDocument.body),n}function T(t,e){let n=(0,c.zk)(t);if((0,c.Tf)(t))return n;if(!(0,c.sb)(t)){let e=(0,c.$4)(t);for(;e&&!(0,c.eu)(e);){if((0,c.vq)(e)&&!y(e))return e;e=(0,c.$4)(e)}return n}let i=b(t,e);for(;i&&(0,c.Lv)(i)&&y(i);)i=b(i,e);return i&&(0,c.eu)(i)&&y(i)&&!(0,c.sQ)(i)?n:i||(0,c.gJ)(t)||n}let L=async function(t){let e=this.getOffsetParent||T,n=this.getDimensions,o=await n(t.floating);return{reference:function(t,e,n){let o=(0,c.sb)(e),r=(0,c.ep)(e),l="fixed"===n,a=m(t,!0,l,e),f={scrollLeft:0,scrollTop:0},u=(0,i.Jx)(0);if(o||!o&&!l)if(("body"!==(0,c.mq)(e)||(0,c.ZU)(r))&&(f=(0,c.CP)(e)),o){let t=m(e,!0,l,e);u.x=t.x+e.clientLeft,u.y=t.y+e.clientTop}else r&&(u.x=g(r));l&&!o&&r&&(u.x=g(r));let s=!r||o||l?(0,i.Jx)(0):v(r,f);return{x:a.left+f.scrollLeft-u.x-s.x,y:a.top+f.scrollTop-u.y-s.y,width:a.width,height:a.height}}(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}},R={convertOffsetParentRelativeRectToViewportRelativeRect:function(t){let{elements:e,rect:n,offsetParent:o,strategy:r}=t,l="fixed"===r,a=(0,c.ep)(o),f=!!e&&(0,c.Tf)(e.floating);if(o===a||f&&l)return n;let u={scrollLeft:0,scrollTop:0},s=(0,i.Jx)(1),h=(0,i.Jx)(0),p=(0,c.sb)(o);if((p||!p&&!l)&&(("body"!==(0,c.mq)(o)||(0,c.ZU)(a))&&(u=(0,c.CP)(o)),(0,c.sb)(o))){let t=m(o);s=d(o),h.x=t.x+o.clientLeft,h.y=t.y+o.clientTop}let g=!a||p||l?(0,i.Jx)(0):v(a,u,!0);return{width:n.width*s.x,height:n.height*s.y,x:n.x*s.x-u.scrollLeft*s.x+h.x+g.x,y:n.y*s.y-u.scrollTop*s.y+h.y+g.y}},getDocumentElement:c.ep,getClippingRect:function(t){let{element:e,boundary:n,rootBoundary:o,strategy:r}=t,l=[..."clippingAncestors"===n?(0,c.Tf)(e)?[]:function(t,e){let n=e.get(t);if(n)return n;let i=(0,c.v9)(t,[],!1).filter(t=>(0,c.vq)(t)&&"body"!==(0,c.mq)(t)),o=null,r="fixed"===(0,c.L9)(t).position,l=r?(0,c.$4)(t):t;for(;(0,c.vq)(l)&&!(0,c.eu)(l);){let e=(0,c.L9)(l),n=(0,c.sQ)(l);n||"fixed"!==e.position||(o=null),(r?!n&&!o:!n&&"static"===e.position&&!!o&&w.has(o.position)||(0,c.ZU)(l)&&!n&&function t(e,n){let i=(0,c.$4)(e);return!(i===n||!(0,c.vq)(i)||(0,c.eu)(i))&&("fixed"===(0,c.L9)(i).position||t(i,n))}(t,l))?i=i.filter(t=>t!==l):o=e,l=(0,c.$4)(l)}return e.set(t,i),i}(e,this._c):[].concat(n),o],a=l[0],f=l.reduce((t,n)=>{let o=x(e,n,r);return t.top=(0,i.T9)(o.top,t.top),t.right=(0,i.jk)(o.right,t.right),t.bottom=(0,i.jk)(o.bottom,t.bottom),t.left=(0,i.T9)(o.left,t.left),t},x(e,a,r));return{width:f.right-f.left,height:f.bottom-f.top,x:f.left,y:f.top}},getOffsetParent:T,getElementRects:L,getClientRects:function(t){return Array.from(t.getClientRects())},getDimensions:function(t){let{width:e,height:n}=u(t);return{width:e,height:n}},getScale:d,isElement:c.vq,isRTL:function(t){return"rtl"===(0,c.L9)(t).direction}};function k(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function E(t,e,n,o){let r;void 0===o&&(o={});let{ancestorScroll:l=!0,ancestorResize:a=!0,elementResize:f="function"==typeof ResizeObserver,layoutShift:u="function"==typeof IntersectionObserver,animationFrame:d=!1}=o,h=s(t),p=l||a?[...h?(0,c.v9)(h):[],...(0,c.v9)(e)]:[];p.forEach(t=>{l&&t.addEventListener("scroll",n,{passive:!0}),a&&t.addEventListener("resize",n)});let g=h&&u?function(t,e){let n,o=null,r=(0,c.ep)(t);function l(){var t;clearTimeout(n),null==(t=o)||t.disconnect(),o=null}return!function a(f,c){void 0===f&&(f=!1),void 0===c&&(c=1),l();let u=t.getBoundingClientRect(),{left:s,top:d,width:h,height:p}=u;if(f||e(),!h||!p)return;let m=(0,i.RI)(d),g=(0,i.RI)(r.clientWidth-(s+h)),v={rootMargin:-m+"px "+-g+"px "+-(0,i.RI)(r.clientHeight-(d+p))+"px "+-(0,i.RI)(s)+"px",threshold:(0,i.T9)(0,(0,i.jk)(1,c))||1},w=!0;function x(e){let i=e[0].intersectionRatio;if(i!==c){if(!w)return a();i?a(!1,i):n=setTimeout(()=>{a(!1,1e-7)},1e3)}1!==i||k(u,t.getBoundingClientRect())||a(),w=!1}try{o=new IntersectionObserver(x,{...v,root:r.ownerDocument})}catch(t){o=new IntersectionObserver(x,v)}o.observe(t)}(!0),l}(h,n):null,v=-1,w=null;f&&(w=new ResizeObserver(t=>{let[i]=t;i&&i.target===h&&w&&(w.unobserve(e),cancelAnimationFrame(v),v=requestAnimationFrame(()=>{var t;null==(t=w)||t.observe(e)})),n()}),h&&!d&&w.observe(h),w.observe(e));let x=d?m(t):null;return d&&function e(){let i=m(t);x&&!k(x,i)&&n(),x=i,r=requestAnimationFrame(e)}(),n(),()=>{var t;p.forEach(t=>{l&&t.removeEventListener("scroll",n),a&&t.removeEventListener("resize",n)}),null==g||g(),null==(t=w)||t.disconnect(),w=null,d&&cancelAnimationFrame(r)}}let C=l,A=function(t){return void 0===t&&(t=0),{name:"offset",options:t,async fn(e){var n,i;let{x:o,y:r,placement:l,middlewareData:a}=e,c=await f(e,t);return l===(null==(n=a.offset)?void 0:n.placement)&&null!=(i=a.arrow)&&i.alignmentOffset?{}:{x:o+c.x,y:r+c.y,data:{...c,placement:l}}}}},S=function(t){return void 0===t&&(t={}),{name:"shift",options:t,async fn(e){let{x:n,y:o,placement:r}=e,{mainAxis:a=!0,crossAxis:f=!1,limiter:c={fn:t=>{let{x:e,y:n}=t;return{x:e,y:n}}},...u}=(0,i._3)(t,e),s={x:n,y:o},d=await l(e,u),h=(0,i.TV)((0,i.C0)(r)),p=(0,i.PG)(h),m=s[p],g=s[h];if(a){let t="y"===p?"top":"left",e="y"===p?"bottom":"right",n=m+d[t],o=m-d[e];m=(0,i.qE)(n,m,o)}if(f){let t="y"===h?"top":"left",e="y"===h?"bottom":"right",n=g+d[t],o=g-d[e];g=(0,i.qE)(n,g,o)}let v=c.fn({...e,[p]:m,[h]:g});return{...v,data:{x:v.x-n,y:v.y-o,enabled:{[p]:a,[h]:f}}}}}},V=function(t){return void 0===t&&(t={}),{name:"flip",options:t,async fn(e){var n,o,r,a,f;let{placement:c,middlewareData:u,rects:s,initialPlacement:d,platform:h,elements:p}=e,{mainAxis:m=!0,crossAxis:g=!0,fallbackPlacements:v,fallbackStrategy:w="bestFit",fallbackAxisSideDirection:x="none",flipAlignment:y=!0,...b}=(0,i._3)(t,e);if(null!=(n=u.arrow)&&n.alignmentOffset)return{};let T=(0,i.C0)(c),L=(0,i.TV)(d),R=(0,i.C0)(d)===d,k=await (null==h.isRTL?void 0:h.isRTL(p.floating)),E=v||(R||!y?[(0,i.bV)(d)]:(0,i.WJ)(d)),C="none"!==x;!v&&C&&E.push(...(0,i.lP)(d,y,x,k));let A=[d,...E],S=await l(e,b),V=[],q=(null==(o=u.flip)?void 0:o.overflows)||[];if(m&&V.push(S[T]),g){let t=(0,i.w7)(c,s,k);V.push(S[t[0]],S[t[1]])}if(q=[...q,{placement:c,overflows:V}],!V.every(t=>t<=0)){let t=((null==(r=u.flip)?void 0:r.index)||0)+1,e=A[t];if(e&&("alignment"!==g||L===(0,i.TV)(e)||q.every(t=>t.overflows[0]>0&&(0,i.TV)(t.placement)===L)))return{data:{index:t,overflows:q},reset:{placement:e}};let n=null==(a=q.filter(t=>t.overflows[0]<=0).sort((t,e)=>t.overflows[1]-e.overflows[1])[0])?void 0:a.placement;if(!n)switch(w){case"bestFit":{let t=null==(f=q.filter(t=>{if(C){let e=(0,i.TV)(t.placement);return e===L||"y"===e}return!0}).map(t=>[t.placement,t.overflows.filter(t=>t>0).reduce((t,e)=>t+e,0)]).sort((t,e)=>t[1]-e[1])[0])?void 0:f[0];t&&(n=t);break}case"initialPlacement":n=d}if(c!==n)return{reset:{placement:n}}}return{}}}},q=function(t){return void 0===t&&(t={}),{name:"size",options:t,async fn(e){var n,o;let r,a,{placement:f,rects:c,platform:u,elements:s}=e,{apply:d=()=>{},...h}=(0,i._3)(t,e),p=await l(e,h),m=(0,i.C0)(f),g=(0,i.Sg)(f),v="y"===(0,i.TV)(f),{width:w,height:x}=c.floating;"top"===m||"bottom"===m?(r=m,a=g===(await (null==u.isRTL?void 0:u.isRTL(s.floating))?"start":"end")?"left":"right"):(a=m,r="end"===g?"top":"bottom");let y=x-p.top-p.bottom,b=w-p.left-p.right,T=(0,i.jk)(x-p[r],y),L=(0,i.jk)(w-p[a],b),R=!e.middlewareData.shift,k=T,E=L;if(null!=(n=e.middlewareData.shift)&&n.enabled.x&&(E=b),null!=(o=e.middlewareData.shift)&&o.enabled.y&&(k=y),R&&!g){let t=(0,i.T9)(p.left,0),e=(0,i.T9)(p.right,0),n=(0,i.T9)(p.top,0),o=(0,i.T9)(p.bottom,0);v?E=w-2*(0!==t||0!==e?t+e:(0,i.T9)(p.left,p.right)):k=x-2*(0!==n||0!==o?n+o:(0,i.T9)(p.top,p.bottom))}await d({...e,availableWidth:E,availableHeight:k});let C=await u.getDimensions(s.floating);return w!==C.width||x!==C.height?{reset:{rects:!0}}:{}}}},D=(t,e,n)=>{let i=new Map,o={platform:R,...n},l={...o.platform,_c:i};return r(t,e,{...o,platform:l})}},81040:(t,e,n)=>{n.d(e,{B1:()=>S,C0:()=>d,Dz:()=>w,Jx:()=>a,LI:()=>r,PG:()=>p,RI:()=>l,Sg:()=>h,T9:()=>o,TV:()=>v,WJ:()=>y,_3:()=>s,bV:()=>C,jk:()=>i,lP:()=>E,nI:()=>A,qE:()=>u,sq:()=>m,w7:()=>x});let i=Math.min,o=Math.max,r=Math.round,l=Math.floor,a=t=>({x:t,y:t}),f={left:"right",right:"left",bottom:"top",top:"bottom"},c={start:"end",end:"start"};function u(t,e,n){return o(t,i(e,n))}function s(t,e){return"function"==typeof t?t(e):t}function d(t){return t.split("-")[0]}function h(t){return t.split("-")[1]}function p(t){return"x"===t?"y":"x"}function m(t){return"y"===t?"height":"width"}let g=new Set(["top","bottom"]);function v(t){return g.has(d(t))?"y":"x"}function w(t){return p(v(t))}function x(t,e,n){void 0===n&&(n=!1);let i=h(t),o=w(t),r=m(o),l="x"===o?i===(n?"end":"start")?"right":"left":"start"===i?"bottom":"top";return e.reference[r]>e.floating[r]&&(l=C(l)),[l,C(l)]}function y(t){let e=C(t);return[b(t),e,b(e)]}function b(t){return t.replace(/start|end/g,t=>c[t])}let T=["left","right"],L=["right","left"],R=["top","bottom"],k=["bottom","top"];function E(t,e,n,i){let o=h(t),r=function(t,e,n){switch(t){case"top":case"bottom":if(n)return e?L:T;return e?T:L;case"left":case"right":return e?R:k;default:return[]}}(d(t),"start"===n,i);return o&&(r=r.map(t=>t+"-"+o),e&&(r=r.concat(r.map(b)))),r}function C(t){return t.replace(/left|right|bottom|top/g,t=>f[t])}function A(t){return"number"!=typeof t?{top:0,right:0,bottom:0,left:0,...t}:{top:t,right:t,bottom:t,left:t}}function S(t){let{x:e,y:n,width:i,height:o}=t;return{width:i,height:o,top:n,left:e,right:e+i,bottom:n+o,x:e,y:n}}},84974:(t,e,n)=>{function i(){return"undefined"!=typeof window}function o(t){return a(t)?(t.nodeName||"").toLowerCase():"#document"}function r(t){var e;return(null==t||null==(e=t.ownerDocument)?void 0:e.defaultView)||window}function l(t){var e;return null==(e=(a(t)?t.ownerDocument:t.document)||window.document)?void 0:e.documentElement}function a(t){return!!i()&&(t instanceof Node||t instanceof r(t).Node)}function f(t){return!!i()&&(t instanceof Element||t instanceof r(t).Element)}function c(t){return!!i()&&(t instanceof HTMLElement||t instanceof r(t).HTMLElement)}function u(t){return!!i()&&"undefined"!=typeof ShadowRoot&&(t instanceof ShadowRoot||t instanceof r(t).ShadowRoot)}n.d(e,{$4:()=>C,CP:()=>E,L9:()=>k,Lv:()=>p,Tc:()=>T,Tf:()=>g,ZU:()=>d,_m:()=>A,ep:()=>l,eu:()=>R,gJ:()=>b,mq:()=>o,sQ:()=>y,sb:()=>c,v9:()=>function t(e,n,i){var o;void 0===n&&(n=[]),void 0===i&&(i=!0);let l=function t(e){let n=C(e);return R(n)?e.ownerDocument?e.ownerDocument.body:e.body:c(n)&&d(n)?n:t(n)}(e),a=l===(null==(o=e.ownerDocument)?void 0:o.body),f=r(l);if(a){let e=A(f);return n.concat(f,f.visualViewport||[],d(l)?l:[],e&&i?t(e):[])}return n.concat(l,t(l,[],i))},vq:()=>f,zk:()=>r});let s=new Set(["inline","contents"]);function d(t){let{overflow:e,overflowX:n,overflowY:i,display:o}=k(t);return/auto|scroll|overlay|hidden|clip/.test(e+i+n)&&!s.has(o)}let h=new Set(["table","td","th"]);function p(t){return h.has(o(t))}let m=[":popover-open",":modal"];function g(t){return m.some(e=>{try{return t.matches(e)}catch(t){return!1}})}let v=["transform","translate","scale","rotate","perspective"],w=["transform","translate","scale","rotate","perspective","filter"],x=["paint","layout","strict","content"];function y(t){let e=T(),n=f(t)?k(t):t;return v.some(t=>!!n[t]&&"none"!==n[t])||!!n.containerType&&"normal"!==n.containerType||!e&&!!n.backdropFilter&&"none"!==n.backdropFilter||!e&&!!n.filter&&"none"!==n.filter||w.some(t=>(n.willChange||"").includes(t))||x.some(t=>(n.contain||"").includes(t))}function b(t){let e=C(t);for(;c(e)&&!R(e);){if(y(e))return e;if(g(e))break;e=C(e)}return null}function T(){return"undefined"!=typeof CSS&&!!CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")}let L=new Set(["html","body","#document"]);function R(t){return L.has(o(t))}function k(t){return r(t).getComputedStyle(t)}function E(t){return f(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function C(t){if("html"===o(t))return t;let e=t.assignedSlot||t.parentNode||u(t)&&t.host||l(t);return u(e)?e.host:e}function A(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}}}]);
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2169],{25783:(e,t,r)=>{r.d(t,{A:()=>o});var s=r(37876),a=r(15039),i=r.n(a),l=r(89099),n=r(46477);let o=e=>{var t;let{toggleText:r="",toggleKey:a=null,onToggle:o=null,active:d=!1,className:c="",disabled:u=!1,...m}=e,p=(0,l.useRouter)(),g=(null==p||null==(t=p.query)?void 0:t[a])==="true"||d;return(0,s.jsxs)("div",{className:i()("",c),children:[(0,s.jsxs)("button",{id:a,disabled:u,type:"button",className:i()("relative inline-flex h-3.5 w-9 shrink-0 cursor-pointer rounded-full border-1 border-transparent transition-all duration-200 ease-in-out focus:outline-hidden focus:ring-2 focus:ring-slate-400 focus:ring-offset-2",{"bg-slate-200 dark:bg-slate-700":!g,"bg-emerald-500 dark:bg-emerald-600 shadow-sm":g}),role:"switch",onClick:o||(()=>{let{skip:e,...t}=p.query;p.push({query:(0,n.GC)(t,!g,a)})}),"aria-checked":g?"true":"false",...m,children:[(0,s.jsx)("span",{className:"sr-only",children:r}),(0,s.jsxs)("span",{className:i()("ml-0.5 pointer-events-none relative inline-block h-3 w-3 transform rounded-full bg-white shadow-sm ring-0 transition-all duration-200 ease-in-out",{"translate-x-5 shadow-md":g,"translate-x-0":!g}),children:[(0,s.jsx)("span",{className:i()("absolute inset-0 flex h-full w-full items-center justify-center transition-opacity",{"opacity-0 duration-100 ease-out":g,"opacity-100 duration-200 ease-in":!g}),"aria-hidden":"true",children:(0,s.jsx)("svg",{className:"h-3 w-3 text-slate-400",fill:"none",viewBox:"0 0 12 12",children:(0,s.jsx)("path",{d:"M4 8l2-2m0 0l2-2M6 6L4 4m2 2l2 2",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}),(0,s.jsx)("span",{className:i()("absolute inset-0 flex h-full w-full items-center justify-center transition-opacity",{"opacity-100 duration-200 ease-in":g,"opacity-0 duration-100 ease-out":!g}),"aria-hidden":"true",children:(0,s.jsx)("svg",{className:"h-3 w-3 text-emerald-500",fill:"currentColor",viewBox:"0 0 12 12",children:(0,s.jsx)("path",{d:"M3.707 5.293a1 1 0 00-1.414 1.414l1.414-1.414zM5 8l-.707.707a1 1 0 001.414 0L5 8zm4.707-3.293a1 1 0 00-1.414-1.414l1.414 1.414zm-7.414 2l2 2 1.414-1.414-2-2-1.414 1.414zm3.414 2l4-4-1.414-1.414-4 4 1.414 1.414z"})})})]})]}),(0,s.jsx)("span",{className:"ml-3",id:"annual-billing-label",children:(0,s.jsx)("span",{className:"text-sm font-medium text-slate-900 dark:text-slate-200",children:r})})]})}},29157:(e,t,r)=>{r.d(t,{A:()=>i});var s=r(96427);function a(){let e=(0,s._)(["\n fragment CurrencyFragment on Currency {\n _id\n isoCode\n isActive\n contractAddress\n decimals\n }\n"]);return a=function(){return e},e}let i=(0,r(79350).J1)(a())},56962:(e,t,r)=>{r.d(t,{A:()=>g});var s=r(37876),a=r(77742),i=r(92436),l=r(62674),n=r(25783),o=r(79027),d=r(76309),c=r(67360),u=r(61835),m=r(72460),p=r(59455);let g=e=>{let{onSubmit:t,onSubmitSuccess:r=null,defaultValue:g={},isEdit:f=!1}=e,{formatMessage:h}=(0,a.A)(),{hasRole:b}=(0,i.A)(),y=h({id:"currency_added",defaultMessage:"Currency added successfully!"}),x=h({id:"currency_updated",defaultMessage:"Currency updated successfully!"}),v=(0,m.A)({submit:t,onSubmitSuccess:e=>(f||(0,l.TL)("currencies"),!r||r(e)),successMessage:f?x:y,getSubmitErrorMessage:e=>{var t;if(null==e||null==(t=e.message)?void 0:t.includes("duplicate key"))return v.formik.setFieldError("isoCode",h({id:"currency_exists",defaultMessage:"Currency with the same ISO code already exists"})),null},initialValues:{isoCode:"",contractAddress:"",isActive:!1,decimals:2,...g}});return(0,s.jsxs)(o.A,{form:v,children:[(0,s.jsxs)("div",{className:"p-5 pb-7",children:[(0,s.jsx)(c.A,{name:"isoCode",id:"isoCode",label:h({id:"iso_code",defaultMessage:"ISO code"}),autoComplete:"on",required:!0}),(0,s.jsx)(c.A,{name:"contractAddress",id:"contractAddress",validators:[(0,p.Dj)()],label:h({id:"contract_address",defaultMessage:"Contract Address"}),autoComplete:"on",className:"mt-4"}),(0,s.jsx)(u.A,{className:"mt-4",label:h({id:"decimals",defaultMessage:"decimals"}),required:!0,name:"decimals",options:Object.fromEntries(Array(32).fill(null).map((e,t)=>[t,"".concat(t)]))}),f&&(0,s.jsx)("div",{className:"mt-5 flex items-center",children:(0,s.jsx)(n.A,{toggleText:h({id:"active",defaultMessage:"Active"}),active:v.formik.values.isActive,onToggle:()=>v.formik.setFieldValue("isActive",!v.formik.values.isActive)})})]}),(0,s.jsx)("div",{className:"border-t-slate-100 border-t dark:border-t-slate-700 space-y-6 rounded-b-md bg-slate-50 dark:bg-slate-900 p-5 text-right",children:(0,s.jsx)(d.A,{hidden:!b("editCurrency"),label:f?h({id:"update_currency",defaultMessage:"Update Currency"}):h({id:"add_currency",defaultMessage:"Add Currency"})})})]})}},61835:(e,t,r)=>{r.d(t,{A:()=>o});var s=r(37876),a=r(15039),i=r.n(a),l=r(38168),n=r(68516);let o=e=>{let{options:t,...r}=(0,l.A)(e),{className:a}=e||{className:""};return(0,s.jsx)(n.A,{...r,children:(0,s.jsx)("div",{className:"select-wrap",children:(0,s.jsxs)("select",{className:i()("block w-full dark:bg-slate-900 dark:text-white rounded-md border-1 border-slate-300 dark:border-slate-700 py-2.5 pl-3 pr-10 text-base text-black shadow-xs focus:outline-hidden focus:ring-2 focus:ring-slate-800 sm:text-sm",a,{"border-rose-700 text-rose-600 dark:border-rose-500 dark:text-rose-400":!!r.error}),disabled:r.disabled,id:r.name,name:r.name,onChange:r.onChange,onBlur:r.onBlur,value:r.value,children:[(!!r.placeholder||!r.required)&&(0,s.jsx)("option",{className:"dark:text-slate-200",value:"",disabled:r.required,hidden:r.required,children:r.placeholder||r.label}),Object.entries(t).map(e=>{let[t,r]=e;return(0,s.jsx)("option",{className:"dark:text-slate-200",value:t,children:r},t)})]})})})}},62674:(e,t,r)=>{r.d(t,{$g:()=>l,TL:()=>n});let s="unchained_shop_config",a=[{id:"countries",title:"Countries",description:"Configure at least one country for your shop",isRequired:!0,setupUrl:"/country",category:"essential",estimatedTime:"2 min",icon:"globe"},{id:"currencies",title:"Currencies",description:"Set up currencies for pricing and payments",isRequired:!0,setupUrl:"/currency",category:"essential",estimatedTime:"2 min",icon:"currency"},{id:"languages",title:"Languages",description:"Configure languages for content localization",isRequired:!0,setupUrl:"/language",category:"essential",estimatedTime:"2 min",icon:"language"},{id:"payment",title:"Payment Processing",description:"Invoice payment provider is already configured",isRequired:!1,setupUrl:"/payment-provider",category:"commerce",estimatedTime:"10 min",icon:"credit-card"},{id:"delivery",title:"Shipping & Delivery",description:"Delivery methods are already configured",isRequired:!1,setupUrl:"/delivery-provider",category:"commerce",estimatedTime:"10 min",icon:"truck"},{id:"products",title:"Products",description:"Create your first products",isRequired:!1,setupUrl:"/products/new",category:"content",estimatedTime:"5 min",icon:"cube"},{id:"assortments",title:"Categories",description:"Organize products into categories",isRequired:!1,setupUrl:"/assortments/new",category:"content",estimatedTime:"3 min",icon:"folder"}];function i(e){let t=e.filter(e=>e.isComplete),r=e.filter(e=>e.isRequired),s=r.filter(e=>e.isComplete),a=e.filter(e=>"essential"===e.category),i=e.filter(e=>"commerce"===e.category),l=e.filter(e=>"content"===e.category),n=a.every(e=>e.isComplete),o=i.filter(e=>e.isRequired).every(e=>e.isComplete),d=l.every(e=>e.isComplete),c=e.length>0?Math.round(t.length/e.length*100):0;return{steps:e,overallProgress:c,isFullyConfigured:s.length===r.length,essentialStepsComplete:n,commerceStepsComplete:o,contentStepsComplete:d,lastUpdated:new Date().toISOString()}}function l(){let e=function(){try{let e=localStorage.getItem(s);return e?JSON.parse(e):null}catch(e){return console.warn("Failed to parse stored shop configuration:",e),null}}();return e&&e.steps?i(a.map(t=>{var r;let s=null==(r=e.steps)?void 0:r.find(e=>e.id===t.id);return{...t,isComplete:(null==s?void 0:s.isComplete)||!1,completedAt:null==s?void 0:s.completedAt}})):i(a.map(e=>({...e,isComplete:!1})))}function n(e){let t=l(),r=t.steps.findIndex(t=>t.id===e);-1!==r&&(t.steps[r]={...t.steps[r],isComplete:!0,completedAt:new Date().toISOString()});let a=i(t.steps);return function(e){try{localStorage.setItem(s,JSON.stringify(e))}catch(e){console.warn("Failed to save shop configuration:",e)}}(a),window.dispatchEvent(new CustomEvent("shopConfigUpdated",{detail:{stepId:e,config:a}})),a}},67360:(e,t,r)=>{r.d(t,{A:()=>d});var s=r(37876),a=r(15039),i=r.n(a),l=r(59455),n=r(38168),o=r(68516);let d=e=>{let{maxLength:t=0,validators:r=[],...a}=e,d=(0,n.A)({validators:[...r,t&&(0,l.Rr)(t)],...a});return(0,s.jsx)(o.A,{...d,children:(0,s.jsx)("input",{className:i()("relative mt-1 block w-full dark:focus:autofill dark:hover:autofill dark:autofill dark:placeholder:text-slate-600 dark:bg-slate-900 dark:text-slate-200 appearance-none rounded-md border-1 dark:border-slate-700 px-4 py-2.5 text-sm text-slate-900 focus:outline-hidden focus:ring-2 focus:ring-slate-800 shadow-xs",{"border-rose-700 placeholder:text-rose-500":!!d.error,"border-slate-300 placeholder-slate-400":!d.error}),disabled:d.disabled,id:d.name,name:d.name,onChange:d.onChange,onBlur:d.onBlur,placeholder:d.placeholder,autoComplete:d.autoComplete||"off",type:d.type||"text",value:d.value,autoFocus:d.autoFocus})})}},76309:(e,t,r)=>{r.d(t,{A:()=>o});var s=r(37876),a=r(15039),i=r.n(a),l=r(42059),n=r(17521);let o=e=>{let{label:t,disabled:r=!1,className:a="",hidden:o=!1,...d}=e,c=(0,l.j7)(),{...u}=d,m=Object.fromEntries(Object.keys(c.initialValues).map(e=>[e,c.getFieldMeta(e)])),{disabled:p}=(0,n.A)(),g=Object.values(m).reduce((e,t)=>{let{error:r,touched:s}=t;return e||r&&s},!1),f=r||p||c.isSubmitting||g;return(0,s.jsx)("input",{className:i()("inline-flex cursor-pointer justify-center rounded-sm border border-slate-300 px-4 py-2 text-center text-sm font-medium leading-5 shadow-sm hover:shadow-md focus:ring-slate-800 dark:focus:ring-slate-400",a,{"bg-rose-50 dark:bg-slate-800 dark:text-rose-300 cursor-not-allowed border-rose-300 dark:border-rose-600 text-rose-900":f,"bg-slate-800 dark:bg-slate-600 text-white hover:bg-slate-900 dark:hover:bg-slate-500 focus:outline-hidden focus:ring-2 focus:ring-offset-2 border-transparent":!f,hidden:o}),"aria-label":t,type:"submit",value:t,disabled:f,...u})}},83992:(e,t,r)=>{r.d(t,{A:()=>a});var s=r(14232);let a=s.forwardRef(function(e,t){let{title:r,titleId:a,...i}=e;return s.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:t,"aria-labelledby":a},i),r?s.createElement("title",{id:a},r):null,s.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 4.5v15m7.5-7.5h-15"}))})}}]);
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2745],{4492:(e,t,n)=>{n.d(t,{A:()=>d});var l=n(96427),s=n(79350),a=n(54431),r=n(29939);function i(){let e=(0,l._)(["\n query Languages(\n $queryString: String\n $offset: Int\n $limit: Int\n $includeInactive: Boolean\n $sort: [SortOptionInput!]\n ) {\n languages(\n queryString: $queryString\n offset: $offset\n limit: $limit\n includeInactive: $includeInactive\n sort: $sort\n ) {\n ...LanguageFragment\n }\n languagesCount(includeInactive: $includeInactive, queryString: $queryString)\n }\n ","\n"]);return i=function(){return e},e}let o=(0,s.J1)(i(),r.A),d=function(){let{queryString:e="",limit:t=20,offset:n=0,includeInactive:l=!0,sort:s=[]}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{data:r,loading:i,error:d,fetchMore:u}=(0,a.IT)(o,{variables:{queryString:e,limit:t,offset:n,includeInactive:l,sort:s}}),c=(null==r?void 0:r.languages)||[],g=null==r?void 0:r.languagesCount,f=(null==c?void 0:c.length)<g;return{languages:c,languagesCount:g,hasMore:f,loading:i,error:d,loadMore:()=>{u({variables:{offset:null==c?void 0:c.length}})}}}},29939:(e,t,n)=>{n.d(t,{A:()=>a});var l=n(96427);function s(){let e=(0,l._)(["\n fragment LanguageFragment on Language {\n _id\n isoCode\n isActive\n isBase\n name\n }\n"]);return s=function(){return e},e}let a=(0,n(79350).J1)(s())},36925:(e,t,n)=>{n.d(t,{A:()=>a});var l=n(96427);function s(){let e=(0,l._)(["\n fragment CountryFragment on Country {\n _id\n isoCode\n isActive\n isBase\n\n defaultCurrency {\n _id\n isoCode\n }\n }\n"]);return s=function(){return e},e}let a=(0,n(79350).J1)(s())},39104:(e,t,n)=>{n.d(t,{A:()=>d});var l=n(96427),s=n(79350),a=n(54431),r=n(94783);function i(){let e=(0,l._)(["\n query Products(\n $queryString: String\n $tags: [LowerCaseString!]\n $slugs: [String!]\n $limit: Int\n $offset: Int\n $includeDrafts: Boolean\n $sort: [SortOptionInput!]\n ) {\n products(\n queryString: $queryString\n tags: $tags\n slugs: $slugs\n limit: $limit\n offset: $offset\n includeDrafts: $includeDrafts\n sort: $sort\n ) {\n ...ProductBriefFragment\n }\n productsCount(\n tags: $tags\n slugs: $slugs\n includeDrafts: $includeDrafts\n queryString: $queryString\n )\n }\n ","\n"]);return i=function(){return e},e}let o=(0,s.J1)(i(),r.A),d=function(){let{queryString:e="",limit:t=20,offset:n=0,tags:l=null,includeDrafts:s=!0,slugs:r=null,sort:i=[],forceLocale:d=""}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{data:u,loading:c,error:g,fetchMore:f}=(0,a.IT)(o,{context:{headers:{forceLocale:d}},variables:{queryString:e,limit:t,offset:n,includeDrafts:s,tags:l,slugs:r,sort:i.length?i:[{key:"sequence",value:"ASC"}]}}),m=(null==u?void 0:u.products)||[],x=null==u?void 0:u.productsCount,h=(null==m?void 0:m.length)<x;return{products:m,productsCount:x,hasMore:h,loading:c,error:g,loadMore:()=>{f({variables:{offset:m.length}})}}}},51363:(e,t,n)=>{n.d(t,{A:()=>d});var l=n(37876),s=n(15039),a=n.n(s),r=n(14232),i=n(77742),o=n(83015);let d=e=>{let{enableDragAndDrop:t=!0,onlyDragAndDrop:n,text:s=null,addMedia:d}=e,[u,c]=(0,r.useState)(!1),{formatMessage:g}=(0,i.A)();return(0,l.jsxs)(l.Fragment,{children:[!n&&(0,l.jsxs)("div",{className:"text-slate-500 dark:text-slate-200",children:[(0,l.jsx)("h3",{className:"text-lg font-medium leading-6 text-slate-900 dark:text-slate-200",children:g({id:"avatar",defaultMessage:"Avatar"})}),(0,l.jsxs)("div",{className:"my-4 flex items-center",children:[(0,l.jsx)("span",{className:"inline-block h-12 w-12 overflow-hidden rounded-full ",children:(0,l.jsx)(o.A,{className:"h-full w-full text-slate-800 dark:text-slate-200"})}),(0,l.jsx)("button",{type:"button",className:"ml-5 rounded-md border border-slate-300 bg-white py-2 px-3 text-sm font-medium leading-4 text-slate-700 shadow-xs hover:bg-slate-50 focus:outline-hidden focus:ring-2 focus:ring-slate-800 focus:ring-offset-2",children:s||g({id:"upload",defaultMessage:"Upload"})})]})]}),t&&(0,l.jsx)("div",{id:"media_uploader",onDrop:e=>{e.stopPropagation(),e.preventDefault();let{files:t}=e.dataTransfer;[...t].forEach(e=>{d(e)}),c(!1)},onDragOver:e=>{e.stopPropagation(),e.preventDefault(),c(!0)},onDragEnter:e=>{e.stopPropagation(),e.preventDefault(),c(!0)},onDragLeave:e=>{e.stopPropagation(),e.preventDefault(),c(!1)},className:"text-slate-500 dark:text-slate-200",children:(0,l.jsxs)("label",{htmlFor:"file-upload",className:"block",children:[(0,l.jsx)("div",{className:a()("flex justify-center rounded-md border-1 border-dashed border-slate-300 px-6 py-10 cursor-pointer hover:border-slate-400 dark:hover:border-slate-500 transition-colors",{"border-slate-950":u}),children:(0,l.jsxs)("div",{className:"pl-5 space-y-1 text-center pointer-events-none",children:[(0,l.jsx)("svg",{className:"mx-auto h-12 w-12 text-slate-400 dark:text-slate-200",stroke:"currentColor",fill:"none",viewBox:"0 0 48 48","aria-hidden":"true",children:(0,l.jsx)("path",{d:"M28 8H12a4 4 0 00-4 4v20m32-12v8m0 0v8a4 4 0 01-4 4H12a4 4 0 01-4-4v-4m32-4l-3.172-3.172a4 4 0 00-5.656 0L28 28M8 32l9.172-9.172a4 4 0 015.656 0L28 28m0 0l4 4m4-24h8m-4-4v8m-12 4h.02",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})}),(0,l.jsxs)("div",{className:"flex text-sm text-slate-600 dark:text-slate-200",children:[(0,l.jsx)("span",{className:"px-1 mr-1 font-medium text-slate-950 dark:text-slate-300",children:g({id:"upload_file",defaultMessage:"Upload a file"})}),(0,l.jsx)("p",{className:"pl-1",children:g({id:"or_drag_and_drop",defaultMessage:"or drag and drop"})})]}),(0,l.jsx)("p",{className:"text-xs",children:"PNG, JPG, GIF up to 10MB"})]})}),(0,l.jsx)("input",{id:"file-upload",name:"file-upload",type:"file",multiple:!0,className:"sr-only",onChange:e=>{e.stopPropagation(),e.preventDefault();let{files:t}=e.target;[...t].forEach(e=>{d(e)}),c(!1)}})]})})]})}},64405:(e,t,n)=>{n.d(t,{A:()=>d});var l=n(96427),s=n(79350),a=n(54431),r=n(36925);function i(){let e=(0,l._)(["\n query Countries(\n $queryString: String\n $limit: Int\n $offset: Int\n $includeInactive: Boolean\n $sort: [SortOptionInput!]\n ) {\n countries(\n queryString: $queryString\n limit: $limit\n offset: $offset\n includeInactive: $includeInactive\n sort: $sort\n ) {\n ...CountryFragment\n }\n countriesCount(includeInactive: $includeInactive, queryString: $queryString)\n }\n\n ","\n"]);return i=function(){return e},e}let o=(0,s.J1)(i(),r.A),d=function(){let{queryString:e="",limit:t=20,offset:n=0,includeInactive:l=!0,sort:s=[]}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{data:r,loading:i,error:d,fetchMore:u}=(0,a.IT)(o,{variables:{queryString:e,limit:t,offset:n,includeInactive:l,sort:s}}),c=(null==r?void 0:r.countries)||[],g=null==r?void 0:r.countriesCount,f=(null==c?void 0:c.length)<g;return{countries:c,countriesCount:g,hasMore:f,loading:i,error:d,loadMore:()=>{u({variables:{offset:null==c?void 0:c.length}})}}}},67686:(e,t,n)=>{n.d(t,{A:()=>u});var l=n(37876),s=n(14232),a=n(77742),r=n(4492),i=n(64405),o=n(25602);let d=(e,t)=>{let n=[];return e.forEach(e=>{let{_id:l,isoCode:s}=e;n.push({_id:l,isoCode:s}),t.forEach(e=>{let{isoCode:t,_id:a}=e,r="".concat(s,"-").concat(t.toUpperCase());n.push({_id:"".concat(a,"-").concat(l),isoCode:r})})}),n},u=e=>{let{children:t,onlyFull:n=!1}=e,{languages:u}=(0,r.A)(),{shopInfo:c,loading:g}=(0,o.A)(),{countries:f}=(0,i.A)(),{locale:m}=(0,a.A)(),[x,h]=(0,s.useState)(null);(0,s.useEffect)(()=>{if(!g){var e,t,n;h((null==c||null==(e=c.language)?void 0:e.isoCode)+"-"+(null==c||null==(n=c.country)||null==(t=n.isoCode)?void 0:t.toUpperCase()))}},[c,g,m]);let p=d(u,f).filter(e=>!n||e.isoCode.includes("-"));return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)("div",{className:"w-fit mt-5 mb-3",children:(0,l.jsx)("select",{id:"locale-wrapper",className:"cursor-pointer rounded-md border-1 border-slate-300 dark:border-slate-700 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-slate-800",value:x||"",onChange:e=>{e.stopPropagation(),h(e.target.value)},children:null==p?void 0:p.map(e=>(0,l.jsx)("option",{value:e.isoCode,children:e.isoCode},e._id))})}),(0,l.jsx)("div",{children:s.cloneElement(t,{selectedLocale:x||""})})]})}},68154:(e,t,n)=>{n.d(t,{A:()=>u});var l=n(37876),s=n(15039),a=n.n(s),r=n(38442),i=n(68516),o=n(38168),d=n(16615);let u=e=>{let{data:t,onFilter:n,...s}=e,u=(0,o.A)({...s}),c=(0,d.A)(200)(n);return(0,l.jsx)("div",{className:"relative flex flex-col items-center dark:text-slate-900",children:(0,l.jsx)("div",{className:"w-full",children:(0,l.jsx)("div",{className:a()("my-2 flex items-center rounded-sm border-slate-300 dark:border-slate-800",s.className),children:(0,l.jsx)("div",{className:"w-full",children:(0,l.jsx)(i.A,{...u,children:(0,l.jsx)(r.Ay,{isDisabled:!!u.disabled,id:u.id,isLoading:s.isLoading,name:u.name,onBlur:u.onBlur,onInputChange:c,onChange:e=>{let{value:t}=e;u.setValue(t,!0)},placeholder:u.placeholder,options:null==t?void 0:t.map(e=>({label:e.title,value:e.id}))})})})})})})}},70360:(e,t,n)=>{n.d(t,{A:()=>j});var l=n(37876),s=n(14232),a=n(77742),r=n(54287),i=n(63727),o=n(79027),d=n(67360),u=n(72460),c=n(89819),g=n(59863);let f=()=>{let{setModal:e}=(0,c.A)(),{formatMessage:t}=(0,a.A)();return{displayImageInModal:n=>{let{url:s,closeOnOutsideClick:a=!0}=n;e((0,l.jsx)("div",{className:"flex h-96 w-96",children:(0,l.jsx)(g.A,{src:s,alt:t({id:"image-not-found",defaultMessage:"Image not found"}),className:"absolute top-0 left-0 -z-10 h-full w-full grow object-contain object-center",layout:"fill"})}),{closeOnOutsideClick:a})}}};var m=n(60358),x=n(74464),h=n(48124),p=n(1906),v=n(96387);let j=e=>{var t;let{media:n,mediaText:c,onEdit:j,isEdit:b,onDelete:y,onUpdate:N,id:A}=e,{formatMessage:$}=(0,a.A)(),{displayImageInModal:C}=f(),k=$({id:"media_updated",defaultMessage:"Media updated"}),w=(0,u.A)({submit:N,successMessage:k,initialValues:{title:c.title||"",subtitle:c.subTitle||""}});(0,s.useEffect)(()=>{c&&w.formik.setValues(c)},[c]);let{attributes:_,listeners:S,setNodeRef:I,transform:M,transition:q}=(0,r.gl)({id:A}),D={transform:i.Ks.Transform.toString(M),transition:q};return(0,l.jsxs)("li",{ref:I,style:D,className:"flex flex-wrap gap-4 rounded-sm hover:cursor-pointer",children:[(0,l.jsxs)("div",{className:"",children:[(0,l.jsx)("a",{onClick:()=>{var e;return C({url:null==n||null==(e=n.file)?void 0:e.url})},children:(0,l.jsx)(g.A,{src:null==n||null==(t=n.file)?void 0:t.url,alt:(null==c?void 0:c.title)||(null==c?void 0:c.subtitle)||$({id:"error-loading-image-alt",defaultMessage:"Error loading image"}),className:"h-36 w-36 flex-none rounded-md bg-slate-10 object-cover object-center",width:100,height:100})}),(null==n?void 0:n.tags)&&(0,l.jsx)("div",{className:"space-x-2",children:null==n?void 0:n.tags.map((e,t)=>(0,l.jsx)("span",{className:"rounded border px-1 text-sm font-light capitalize text-slate-900 dark:text-slate-200 shadow-xs dark:shadow-none",children:e},"".concat(e).concat(t+1)))})]}),(0,l.jsx)("div",{className:"my-auto flex-1 basis-1/3",children:(0,l.jsx)(o.A,{form:w,children:(0,l.jsxs)("div",{className:"space-y-2 sm:flex sm:flex-col sm:items-start sm:justify-between",children:[(0,l.jsxs)("div",{className:"flex flex-auto flex-col justify-center space-y-1 text-sm font-medium text-slate-900 dark:text-slate-500",children:[(0,l.jsx)("h3",{children:b?(0,l.jsx)(d.A,{name:"title",label:$({id:"title",defaultMessage:"Title"})}):(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)("span",{children:$({id:"media_title",defaultMessage:"Title:"})}),(0,l.jsx)("span",{className:"ml-2",children:null==c?void 0:c.title})]})}),(0,l.jsx)("p",{className:"sm:block",children:b?(0,l.jsx)(d.A,{name:"subtitle",label:$({id:"subtitle",defaultMessage:"Subtitle"})}):(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)("span",{children:$({id:"media_subtitle",defaultMessage:"Subtitle:"})}),(0,l.jsx)("span",{className:"ml-2",children:null==c?void 0:c.subtitle})]})})]}),(0,l.jsx)(p.A,{}),b&&(0,l.jsx)(h.A,{className:"justify-end",onCancel:()=>j(!b)})]})})}),(0,l.jsxs)("span",{className:"flex items-center gap-5",onClick:e=>{e.stopPropagation()},children:[!b&&(0,l.jsx)("button",{id:"edit",type:"button",onClick:e=>{e.stopPropagation(),j(!b)},children:(0,l.jsx)(x.A,{})}),(0,l.jsx)("button",{type:"button",..._,...S,className:"hover:cursor-move",children:(0,l.jsx)(v.A,{})}),(0,l.jsx)(m.A,{onClick:async e=>{e.stopPropagation(),y(n._id)}})]})]},n._id)}},74464:(e,t,n)=>{n.d(t,{A:()=>a});var l=n(37876),s=n(59454);let a=()=>(0,l.jsx)("div",{id:"edit__icon_button",className:"rounded-full bg-white dark:bg-slate-800 dark:hover:bg-slate-600 p-2 text-sm text-slate-900 dark:text-slate-200 hover:bg-slate-50 focus:outline-hidden focus:ring-0 focus:ring-rose-500 focus:ring-offset-2",children:(0,l.jsx)(s.A,{className:"h-5 w-5"})})},96387:(e,t,n)=>{n.d(t,{A:()=>s});var l=n(37876);let s=()=>(0,l.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-6 w-4 text-slate-900 group-hover:text-slate-800 dark:text-slate-500 dark:group-hover:text-slate-400",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",children:(0,l.jsx)("path",{d:"M8.5 17c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm7-10c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2zm-7 3c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm7 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0 7c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm-7-14c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z"})})}}]);
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2837],{13150:(e,t,n)=>{n.d(t,{Ay:()=>l,dF:()=>r,id:()=>s});let s=e=>{if(!e)return null;let t=null==e?void 0:e.split("_id_");return null==t?void 0:t.pop()},r=e=>{if(!e)return null;let[t]=(null==e?void 0:e.split("_id_"))||[];return t},l=e=>{var t;let{_id:n,texts:s}=e;return"".concat(null==s||null==(t=s.slug)?void 0:t.split("/").join(""),"_id_").concat(n)}},38824:(e,t,n)=>{n.d(t,{A:()=>l});var s=n(37876),r=n(33178);let l=e=>{let{onOkClick:t,buttonText:n,headerText:l,message:d,icon:a=null}=e;return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("div",{children:[a||(0,s.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,s.jsx)(r.A,{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,s.jsxs)("div",{className:"mt-3 text-center sm:mt-5",children:[(0,s.jsx)("h3",{className:"text-lg font-medium leading-6 text-slate-900 dark:text-slate-200",id:"modal-title",children:l}),(0,s.jsx)("div",{className:"mt-2",children:(0,s.jsx)("p",{className:"text-sm text-slate-500 dark:text-slate-200",children:d})})]})]}),(0,s.jsx)("div",{className:"mt-5 sm:mt-6",children:(0,s.jsx)("button",{id:"alert_ok",onClick:t,type:"button",className:"inline-flex w-full justify-center rounded-md border border-transparent bg-slate-800 dark:bg-slate-600 px-4 py-2 text-base font-medium text-white shadow-xs hover:bg-slate-950 dark:hover:bg-slate-500 focus:outline-hidden focus:ring-2 focus:ring-slate-800 dark:focus:ring-slate-400 focus:ring-offset-2 sm:text-sm",children:n})})]})}},40817:(e,t,n)=>{n.d(t,{A:()=>d});var s=n(37876),r=n(21671),l=n(77742);let d=e=>{let{onClick:t,text:n=null,Icon:d=null}=e,{formatMessage:a}=(0,l.A)();return(0,s.jsxs)("button",{type:"button",onClick:t,"aria-describedby":"header-delete-button",className:"inline-flex items-center gap-2 justify-center rounded-md border border-rose-500 px-4 py-2 text-sm font-medium leading-5 text-rose-600 shadow-sm hover:border-rose-600 hover:bg-rose-600 hover:text-white focus:outline-hidden focus:ring-2 focus:ring-rose-500 focus:ring-offset-2 h-[38px]",children:[(0,s.jsx)("span",{children:d||(0,s.jsx)(r.A,{className:"h-5 w-5"})}),n||a({id:"delete",defaultMessage:"Delete"})]})}},42841:(e,t,n)=>{n.d(t,{A:()=>i});var s=n(96427),r=n(79350),l=n(54431);function d(){let e=(0,s._)(['\n query DeliveryProvidersType {\n deliveryProviderType: __type(name: "DeliveryProviderType") {\n options: enumValues {\n value: name\n label: description\n }\n }\n }\n']);return d=function(){return e},e}let a=(0,r.J1)(d()),i=()=>{var e;let{data:t,loading:n,error:s}=(0,l.IT)(a);return{deliveryProviderType:(null==t||null==(e=t.deliveryProviderType)?void 0:e.options)||[],loading:n,error:s}}},72837:(e,t,n)=>{n.r(t),n.d(t,{default:()=>eg});var s=n(37876),r=n(89099),l=n(77742),d=n(4301),a=n(17703),i=n(13437),o=n(92797),u=n(96427),c=n(79350),m=n(54431),x=n(66400);function f(){let e=(0,u._)(["\n fragment OrderDetailFragment on Order {\n _id\n totalTax: total(category: TAXES) {\n amount\n currencyCode\n }\n itemsTotal: total(category: ITEMS) {\n amount\n currencyCode\n }\n totalDiscount: total(category: DISCOUNTS) {\n amount\n currencyCode\n }\n\n totalPayment: total(category: PAYMENT) {\n amount\n currencyCode\n }\n totalDelivery: total(category: DELIVERY) {\n amount\n currencyCode\n }\n\n user {\n _id\n username\n isGuest\n avatar {\n _id\n url\n }\n }\n discounts {\n _id\n trigger\n code\n interface {\n _id\n label\n version\n }\n total {\n amount\n currencyCode\n isTaxable\n isNetPrice\n }\n discounted {\n _id\n orderDiscount {\n _id\n total {\n amount\n currencyCode\n isTaxable\n isNetPrice\n }\n }\n total {\n amount\n currencyCode\n isTaxable\n isNetPrice\n }\n }\n }\n payment {\n _id\n provider {\n _id\n type\n interface {\n _id\n label\n version\n }\n }\n status\n fee {\n currencyCode\n amount\n }\n paid\n }\n delivery {\n _id\n status\n provider {\n _id\n type\n interface {\n _id\n label\n version\n }\n }\n\n delivered\n }\n\n orderNumber\n status\n created\n updated\n ordered\n\n confirmed\n fullfilled\n contact {\n telNumber\n emailAddress\n }\n country {\n _id\n isoCode\n flagEmoji\n name\n }\n currency {\n _id\n isoCode\n isActive\n }\n billingAddress {\n firstName\n lastName\n company\n addressLine\n addressLine2\n postalCode\n countryCode\n regionCode\n city\n }\n delivery {\n _id\n provider {\n _id\n created\n updated\n deleted\n type\n configuration\n interface {\n _id\n label\n version\n }\n }\n status\n delivered\n fee {\n isTaxable\n isNetPrice\n amount\n currencyCode\n }\n discounts {\n _id\n orderDiscount {\n _id\n trigger\n code\n order {\n _id\n orderNumber\n }\n interface {\n _id\n label\n version\n }\n total {\n isTaxable\n isNetPrice\n amount\n currencyCode\n }\n discounted {\n _id\n orderDiscount {\n _id\n trigger\n code\n order {\n _id\n orderNumber\n }\n interface {\n _id\n label\n version\n }\n total {\n isTaxable\n isNetPrice\n amount\n currencyCode\n }\n }\n }\n }\n }\n\n delivered\n }\n total {\n isTaxable\n isTaxable\n amount\n currencyCode\n }\n items {\n _id\n product {\n _id\n texts {\n _id\n slug\n brand\n vendor\n title\n subtitle\n }\n media {\n _id\n file {\n _id\n url\n }\n }\n }\n quantity\n\n unitPrice {\n amount\n isTaxable\n isNetPrice\n currencyCode\n }\n total {\n amount\n isTaxable\n isNetPrice\n currencyCode\n }\n }\n }\n"]);return f=function(){return e},e}let v=(0,c.J1)(f());function h(){let e=(0,u._)(["\n query Order($orderId: ID!) {\n order(orderId: $orderId) {\n ...OrderDetailFragment\n ","\n }\n }\n ","\n"]);return h=function(){return e},e}let p=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return(0,c.J1)(h(),e,v)},b=e=>{let{orderId:t=null}=e,{customProperties:n}=(0,x.A)(),{data:s,loading:r,error:l}=(0,m.IT)(p(null==n?void 0:n.Order),{skip:!t,variables:{orderId:t}});return{order:null==s?void 0:s.order,loading:r,error:l}};var y=n(48230),g=n.n(y),j=n(46477),N=n(13150),_=n(59863);let k=e=>{var t,n,r,d,a,i,o,u,c,m,x;let{item:f}=e,{formatMessage:v}=(0,l.A)(),{formatPrice:h}=(0,j.Ab)();return(0,s.jsx)("section",{"aria-labelledby":"products-heading",children:(0,s.jsxs)(g(),{href:"/products?slug=".concat((0,N.Ay)(f.product)),children:[(0,s.jsx)("h2",{id:"products-heading",className:"sr-only",children:v({id:"purchased_products",defaultMessage:"Purchased products"})}),(0,s.jsx)("div",{className:"space-y-8",children:(0,s.jsx)("div",{className:"mb-2 rounded-lg border border-slate-300 dark:border-slate-700 bg-white dark:bg-slate-800 shadow-sm dark:shadow-none dark:text-slate-200 hover:border hover:border-solid hover:border-slate-900",children:(0,s.jsx)("div",{className:"px-2 py-1",children:(0,s.jsxs)("div",{className:"flex items-center flex-wrap",children:[(0,s.jsx)("div",{className:"flex shrink-0 overflow-hidden rounded-lg sm:mx-0 ",children:(null==(n=f.product)||null==(t=n.media)?void 0:t.length)?(0,s.jsx)(_.A,{src:"".concat(null==(r=f.product)?void 0:r.media[0].file.url),alt:(null==f||null==(a=f.product)||null==(d=a.texts)?void 0:d.title)||(null==f||null==(o=f.product)||null==(i=o.texts)?void 0:i.subtitle),className:"object-cover object-center",width:80,height:80}):null}),(0,s.jsxs)("div",{className:"w-1/2 flex flex-col justify-center sm:mt-0 ml-3 sm:flex-auto",children:[(0,s.jsx)("h3",{className:"text-base text-slate-900 dark:text-slate-200 truncate",dangerouslySetInnerHTML:{__html:(null==f||null==(c=f.product)||null==(u=c.texts)?void 0:u.title)||(null==f||null==(x=f.product)||null==(m=x.texts)?void 0:m.subtitle)}}),(0,s.jsx)("div",{className:"mt-1 text-sm",children:h(null==f?void 0:f.unitPrice)}),(0,s.jsxs)("div",{className:"mt-2 text-xs",children:[v({id:"item_quantity",defaultMessage:"Quantity:"}),(0,s.jsx)("span",{className:"ml-2 font-bold",children:null==f?void 0:f.quantity})]})]})]})})})})]})})},w=e=>{var t,n,r,d,a;let{order:i}=e,{formatMessage:o}=(0,l.A)(),{formatPrice:u}=(0,j.Ab)();return(0,s.jsxs)("section",{"aria-labelledby":"summary-heading",children:[(0,s.jsx)("h2",{id:"summary-heading",className:"sr-only",children:o({id:"billing_summary",defaultMessage:"Billing Summary"})}),(0,s.jsxs)("div",{className:"md:grid md:grid-cols-2 md:gap-x-8",children:[(0,s.jsx)("dl",{className:"bg-white dark:bg-slate-800 p-4 shadow-sm dark:shadow-none sm:rounded-lg grid justify-center text-sm md:justify-start md:gap-x-8",children:(0,s.jsxs)("div",{children:[(0,s.jsx)("span",{className:"text-xl mb-5 block font-bold",children:(null==i||null==(t=i.billingAddress)?void 0:t.firstName)||(null==i||null==(n=i.billingAddress)?void 0:n.lastName)||"n/a"}),(0,s.jsx)("dt",{className:"mb-2 font-medium",children:o({id:"billing_address",defaultMessage:"Billing address"})}),(0,s.jsx)("span",{className:"my-1 inline-block",children:null==i||null==(r=i.billingAddress)?void 0:r.postalCode}),"\xa0",(0,s.jsx)("span",{className:"my-1 inline-block",children:null==i||null==(d=i.billingAddress)?void 0:d.addressLine}),(0,s.jsx)("span",{className:"block",children:null==i||null==(a=i.billingAddress)?void 0:a.city}),(0,s.jsx)("span",{className:"my-1 inline-block",children:"".concat(null==i?void 0:i.country.name,", ").concat(null==i?void 0:i.country.flagEmoji)})]})}),(0,s.jsxs)("dl",{className:"bg-white dark:bg-slate-800 p-4 shadow-sm dark:shadow-none sm:rounded-lg mt-4 divide-y divide-slate-100 dark:divide-slate-700 text-sm lg:mt-0",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between pb-3 text-lg",children:[(0,s.jsx)("dt",{className:"font-bold",children:o({id:"order_total",defaultMessage:"Order total"})}),(0,s.jsx)("dd",{className:"font-bold",children:u(null==i?void 0:i.total)})]}),(0,s.jsxs)("div",{className:"flex items-center justify-between py-1",children:[(0,s.jsx)("dt",{className:"text-slate-600 dark:text-slate-200",children:o({id:"discount",defaultMessage:"Discount"})}),(0,s.jsx)("dd",{className:"font-medium",children:u(null==i?void 0:i.totalDiscount)})]}),(0,s.jsxs)("div",{className:"flex items-center justify-between py-1",children:[(0,s.jsx)("dt",{className:"text-slate-600 dark:text-slate-200",children:o({id:"shipping",defaultMessage:"Shipping"})}),(0,s.jsx)("dd",{className:"font-medium",children:u(null==i?void 0:i.totalDelivery)})]}),(0,s.jsxs)("div",{className:"flex items-center justify-between py-1",children:[(0,s.jsx)("dt",{className:"text-slate-600 dark:text-slate-200",children:o({id:"tax",defaultMessage:"Tax"})}),(0,s.jsx)("dd",{className:"font-medium",children:u(null==i?void 0:i.totalTax)})]}),(0,s.jsxs)("div",{className:"flex items-center justify-between py-1",children:[(0,s.jsx)("dt",{className:"text-slate-600 dark:text-slate-200",children:o({id:"order_payment_fees",defaultMessage:"Fees"})}),(0,s.jsx)("dd",{className:"font-medium",children:u(null==i?void 0:i.totalPayment)})]}),(0,s.jsxs)("div",{className:"flex items-center justify-between py-1",children:[(0,s.jsx)("dt",{className:"text-slate-600 dark:text-slate-200",children:o({id:"subtotal",defaultMessage:"Subtotal"})}),(0,s.jsx)("dd",{className:"font-medium",children:u(null==i?void 0:i.itemsTotal)})]})]})]})]})};var A=n(83992),T=n(38824),C=n(89819),M=n(53588);function O(){let e=(0,u._)(["\n mutation PayOrder($orderId: ID!) {\n payOrder(orderId: $orderId) {\n _id\n }\n }\n"]);return O=function(){return e},e}let I=(0,c.J1)(O()),D=()=>{let[e]=(0,M.n)(I);return{payOrder:async t=>{let{orderId:n}=t;return e({variables:{orderId:n},refetchQueries:["Order"]})}}};var P=n(87774);function S(){let e=(0,u._)(['\n query OrderPaymentStatus {\n paymentStatusTypes: __type(name: "OrderPaymentStatus") {\n options: enumValues {\n value: name\n label: description\n }\n }\n }\n']);return S=function(){return e},e}let E=(0,c.J1)(S()),R=()=>{var e;let{data:t,loading:n,error:s}=(0,m.IT)(E);return{paymentStatusTypes:(null==t||null==(e=t.paymentStatusTypes)?void 0:e.options)||[],loading:n,error:s}};var J=n(10561);let q=e=>{let{enumType:t,currentType:n,label:r,component:l=null}=e;return l||(0,s.jsx)("span",{title:r,className:"".concat(n===t?"border-slate-300 bg-slate-200 text-slate-950":"opacity-10 dark:bg-slate-900 "," mr-2 mb-2 inline-flex items-center rounded-md border border-slate-300 bg-white px-2 py-1 text-sm"),children:t})},L=e=>{var t,n;let{order:r}=e,{paymentProviderType:a}=(0,P.A)(),{paymentStatusTypes:i}=R(),{formatDateTime:o}=(0,J.A)(),{formatPrice:u}=(0,j.Ab)(),{formatMessage:c}=(0,l.A)(),{setModal:m}=(0,C.A)(),{payOrder:x}=D(),f=async()=>{await m((0,s.jsx)(T.A,{buttonText:c({id:"pay",defaultMessage:"PAY"}),message:c({id:"mark_as_paid_question",defaultMessage:"This will change the order payment status as Paid."}),headerText:c({id:"mark_as_paid_question_header",defaultMessage:"Mark as paid ?"}),onOkClick:async()=>{m(""),await x({orderId:r._id}),d.oR.success(c({id:"order_paid",defaultMessage:"Order payed successfully"}))}}))};return(0,s.jsxs)("div",{className:"bg-white dark:bg-slate-800 shadow-sm dark:shadow-none sm:rounded-lg",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between px-4 sm:px-6",children:[(0,s.jsx)("h2",{className:"py-4 text-lg font-medium text-slate-900 dark:text-slate-200",children:c({id:"paid",defaultMessage:"Paid"})}),(0,s.jsx)("span",{className:"mr-2 block rounded-full py-1 text-xs font-semibold leading-5",children:u(r.payment.fee)}),(0,s.jsx)("span",{className:"font-medium",children:o(r.payment.paid,{timeStyle:"short",dateStyle:"medium"})})]}),(0,s.jsxs)("div",{className:"border-t border-slate-100 dark:border-slate-700 px-4 py-4 sm:px-6",children:[(0,s.jsx)("span",{className:"mb-5 block",children:(0,s.jsx)(g(),{href:"/payment-provider?paymentProviderId=".concat(r.payment.provider._id),className:"font-medium text-slate-900 dark:text-slate-300 hover:text-slate-800 dark:hover:text-slate-600",children:(0,j.SS)(null==(n=r.payment)||null==(t=n.provider)?void 0:t.interface)})}),(0,s.jsx)("div",{className:"mt-3 text-sm text-slate-400 dark:text-slate-200",children:c({id:"method",defaultMessage:"Method"})}),(0,s.jsx)("span",{className:"c mr-2 block rounded-full py-1 text-xs font-semibold leading-5",children:a.map(e=>{var t,n;return(0,s.jsx)(q,{enumType:e.value,currentType:null==(n=r.payment)||null==(t=n.provider)?void 0:t.type,label:e.label},e.value)})}),(0,s.jsx)("div",{className:"mt-3 text-sm text-slate-400 dark:text-slate-200",children:c({id:"delivery_status",defaultMessage:"Status"})}),(0,s.jsx)("span",{className:"mr-2 block rounded-full py-1 text-xs font-semibold leading-5",children:i.map(e=>{var t;return(0,s.jsx)(q,{enumType:e.value,currentType:null==(t=r.payment)?void 0:t.status,label:e.label,component:"OPEN"===r.payment.status&&"PAID"===e.value&&(0,s.jsxs)("button",{id:"pay",type:"button",onClick:f,className:"my-2 mr-2 inline-flex h-full items-center justify-center rounded-sm border border-slate-300 border-transparent bg-slate-800 dark:bg-slate-600 py-1 px-2 text-xs font-semibold text-white shadow-xs hover:bg-slate-950 dark:hover:bg-slate-500 focus:outline-hidden focus:ring-2 focus:ring-slate-700 dark:focus:ring-slate-400 focus:ring-offset-2",children:[(0,s.jsx)("span",{className:"mr-1",children:(0,s.jsx)(A.A,{className:"inline-block h-3 w-3 text-white"})}),c({id:"mark_as_paid",defaultMessage:"Mark as Paid"})]})},e.value)})})]})]})};var $=n(42841);function F(){let e=(0,u._)(['\n query OrderDeliveryStatus {\n deliveryStatusType: __type(name: "OrderDeliveryStatus") {\n options: enumValues {\n value: name\n label: description\n }\n }\n }\n']);return F=function(){return e},e}let V=(0,c.J1)(F()),Q=()=>{var e;let{data:t,loading:n,error:s}=(0,m.IT)(V);return{deliveryStatusType:(null==t||null==(e=t.deliveryStatusType)?void 0:e.options)||[],loading:n,error:s}};function B(){let e=(0,u._)(["\n mutation DeliverOrder($orderId: ID!) {\n deliverOrder(orderId: $orderId) {\n _id\n }\n }\n"]);return B=function(){return e},e}let Y=(0,c.J1)(B()),G=()=>{let[e]=(0,M.n)(Y);return{deliverOrder:async t=>{let{orderId:n}=t;return e({variables:{orderId:n},refetchQueries:["Order"]})}}},U=e=>{var t,n,r,a;let{order:i}=e,{deliveryProviderType:o}=(0,$.A)(),{setModal:u}=(0,C.A)(),{deliveryStatusType:c}=Q(),{deliverOrder:m}=G(),{formatPrice:x}=(0,j.Ab)(),{formatMessage:f}=(0,l.A)(),{formatDateTime:v}=(0,J.A)(),h=async()=>{await u((0,s.jsx)(T.A,{buttonText:f({id:"delivered",defaultMessage:"Delivered"}),message:f({id:"mark_as_delivered_message",defaultMessage:"This will change the order delivery status to delivered"}),headerText:f({id:"mark_as_delivered_question",defaultMessage:"Mark as delivered ?"}),onOkClick:async()=>{u(""),await m({orderId:i._id}),d.oR.success(f({id:"order__marked_delivered",defaultMessage:"Order marked as delivered successfully"}))}}))};return(0,s.jsxs)("div",{className:"bg-white dark:bg-slate-800 shadow-sm dark:shadow-none sm:rounded-lg",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between px-4 sm:px-6",children:[(0,s.jsx)("h2",{className:"py-4 text-lg font-medium",children:f({id:"delivered",defaultMessage:"Delivered"})}),(0,s.jsx)("span",{className:"mr-2 block rounded-full py-1 text-xs font-semibold leading-5",children:x(null==i?void 0:i.delivery.fee)}),(0,s.jsx)("span",{className:"font-medium",children:v(null==i||null==(t=i.delivery)?void 0:t.delivered,{timeStyle:"short",dateStyle:"medium"})})]}),(0,s.jsxs)("div",{className:"border-t border-slate-100 dark:border-slate-700 px-4 py-4 sm:px-6",children:[(0,s.jsx)("span",{className:"mb-5 block",children:(0,s.jsx)(g(),{href:"/delivery-provider?deliveryProviderId=".concat(null==i||null==(n=i.delivery)?void 0:n.provider._id),className:"font-medium text-slate-900 dark:text-slate-300 hover:text-slate-800 dark:hover:text-slate-600",children:(0,j.SS)(null==i||null==(a=i.delivery)||null==(r=a.provider)?void 0:r.interface)})}),(0,s.jsx)("div",{className:"mt-3 text-sm text-slate-400 dark:text-slate-200",children:f({id:"method",defaultMessage:"Method"})}),(0,s.jsx)("span",{className:"mr-2 block rounded-full py-1 text-xs font-semibold leading-5",children:o.map(e=>{var t,n;return(0,s.jsx)(q,{enumType:e.value,currentType:null==i||null==(n=i.delivery)||null==(t=n.provider)?void 0:t.type,label:e.label},e.value)})}),(0,s.jsx)("div",{className:"mt-3 text-sm text-slate-400 dark:text-slate-200",children:f({id:"status",defaultMessage:"Status"})}),(0,s.jsx)("span",{className:"mr-2 block rounded-full py-1 text-xs font-semibold leading-5",children:c.map(e=>{var t,n;return(0,s.jsx)(q,{enumType:e.value,currentType:null==i||null==(t=i.delivery)?void 0:t.status,label:e.label,component:(null==i||null==(n=i.delivery)?void 0:n.status)==="OPEN"&&"DELIVERED"===e.value&&(0,s.jsxs)("button",{id:"deliver",type:"button",onClick:h,className:"my-2 mr-2 inline-flex h-full items-center justify-center rounded-sm border border-slate-300 border-transparent bg-slate-800 dark:bg-slate-600 py-1 px-2 text-xs font-semibold text-white shadow-xs hover:bg-slate-950 dark:hover:bg-slate-500 focus:outline-hidden focus:ring-2 focus:ring-slate-700 dark:focus:ring-slate-400 focus:ring-offset-2",children:[(0,s.jsx)("span",{className:"mr-1",children:(0,s.jsx)(A.A,{className:"inline-block h-3 w-3 text-white"})}),f({id:"mark_as_delivered",defaultMessage:"Mark as delivered"})]})},e.value)})})]})]})};var W=n(14232),z=n(78474),H=n(89452),X=n(50970);let K={SYSTEM:"teal",USER:"indigo"},Z=e=>{var t,n;let{discounts:r}=e,{formatMessage:d}=(0,l.A)(),{formatPrice:a}=(0,j.Ab)();return(0,s.jsxs)("div",{className:"flex flex-auto flex-col bg-white dark:bg-slate-800 sm:rounded-lg",children:[(0,s.jsx)("h2",{className:"px-4 py-4 text-lg font-medium text-slate-900 dark:text-slate-200 sm:px-6",children:d({id:"discount_information",defaultMessage:"Discounts"})}),(null==r?void 0:r.length)?(0,s.jsxs)(z.A,{className:"min-w-full ",children:[null==(t=r||[])?void 0:t.map(e=>(0,s.jsxs)(z.A.Row,{header:!0,children:[(0,s.jsx)(z.A.Cell,{children:d({id:"code",defaultMessage:"Code"})}),(0,s.jsx)(z.A.Cell,{children:d({id:"discount_amount",defaultMessage:"Discount Amount"})})]},e._id)),null==(n=r||[])?void 0:n.map(e=>(0,s.jsx)(W.Fragment,{children:(0,s.jsxs)(z.A.Row,{children:[(0,s.jsx)(z.A.Cell,{children:(0,s.jsxs)("div",{className:"flex items-center text-sm text-slate-900",children:[e.code?e.code:"n/a",(0,s.jsx)("span",{className:"mr-2 inline-block rounded-full py-1 text-xs font-semibold leading-5",children:(0,s.jsx)(H.A,{text:e.trigger,color:K[e.trigger],square:!0})})]})}),(0,s.jsx)(z.A.Cell,{children:(0,s.jsx)("div",{className:"flex items-center text-sm text-slate-900",children:a(e.total)})})]})},e._id))]}):(0,s.jsx)(X.A,{message:d({id:"discounts",defaultMessage:"Discounts"}),className:"border-t border-slate-100 dark:border-slate-700 px-4 py-4 sm:px-6"})]})};function ee(){let e=(0,u._)(['\n query OrderStatus {\n orderStatusType: __type(name: "OrderStatus") {\n options: enumValues {\n value: name\n label: description\n }\n }\n }\n']);return ee=function(){return e},e}let et=(0,c.J1)(ee()),en=()=>{var e;let{data:t,loading:n,error:s}=(0,m.IT)(et);return{orderStatusType:(null==t||null==(e=t.orderStatusType)?void 0:e.options)||[],loading:n,error:s}};function es(){let e=(0,u._)(["\n mutation ConfirmOrder($orderId: ID!) {\n confirmOrder(orderId: $orderId) {\n _id\n }\n }\n"]);return es=function(){return e},e}let er=(0,c.J1)(es()),el=()=>{let[e]=(0,M.n)(er);return{confirmOrder:async t=>{let{orderId:n}=t;return e({variables:{orderId:n},refetchQueries:["Order"]})}}};var ed=n(58864),ea=n(16499);let ei=e=>{var t,n,r,d;let{order:a}=e,{formatMessage:i,locale:o}=(0,l.A)(),{formatDateTime:u}=(0,J.A)();return a?(0,s.jsxs)("div",{className:"bg-white dark:bg-slate-800 rounded-md shadow-sm dark:shadow-none p-4 space-y-5 ",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between",children:[(0,s.jsxs)("span",{className:"text-sm block mr-3",children:[i({id:"order_number",defaultMessage:"Order #"}),"\xa0"]}),(0,s.jsxs)("span",{id:"order_number_badge",className:"inline-flex text-lg font-medium text-slate-900 dark:text-slate-200 sm:text-xl sm:font-bold",children:[(0,s.jsx)("span",{className:"sm:hidden",children:"#\xa0"}),(null==a?void 0:a.orderNumber)?(0,s.jsx)(H.A,{text:a.orderNumber,square:!0,color:"slate",className:"text-lg font-medium sm:text-xl sm:font-bold "}):(0,s.jsx)(H.A,{text:i({id:"cart",defaultMessage:"Cart"}),color:"yellow",className:"text-lg font-medium sm:text-xl sm:font-bold"})]})]}),(0,s.jsx)(ea.A,{user:null==a?void 0:a.user,contact:null==a?void 0:a.contact}),(0,s.jsxs)("div",{className:"flex justify-between",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("span",{className:"text-sm mr-3",children:i({id:"date",defaultMessage:"Date"})}),(null==a?void 0:a.ordered)?u(a.ordered):null]}),(0,s.jsxs)("div",{className:"",children:[(0,s.jsx)("span",{children:null==a||null==(t=a.country)?void 0:t.flagEmoji}),(0,s.jsx)("span",{className:"mr-1",children:(0,j.t4)(o,null==a||null==(n=a.currency)?void 0:n.isoCode)}),(0,s.jsx)("span",{children:(null==a||null==(r=a.currency)?void 0:r.isoCode)&&(0,s.jsx)(H.A,{text:null==a||null==(d=a.currency)?void 0:d.isoCode,color:"amber",square:!0})})]})]})]}):null};function eo(){let e=(0,u._)(["\n mutation RejectOrder($orderId: ID!) {\n rejectOrder(orderId: $orderId) {\n _id\n }\n }\n"]);return eo=function(){return e},e}let eu=(0,c.J1)(eo()),ec=()=>{let[e]=(0,M.n)(eu);return{rejectOrder:async t=>{let{orderId:n}=t;return e({variables:{orderId:n},refetchQueries:["Order"]})}}};var em=n(88943);let ex=e=>(null==e?void 0:e.status)==="PENDING",ef=e=>{let{order:t}=e,{formatMessage:n}=(0,l.A)(),{setModal:r}=(0,C.A)(),{confirmOrder:a}=el(),{rejectOrder:i}=ec(),{orderStatusType:o}=en();if(!t)return null;let u=async()=>{await r((0,s.jsx)(T.A,{buttonText:n({id:"confirm_order_alert_button",defaultMessage:"Confirm"}),headerText:n({id:"confirm_order_alert_header",defaultMessage:"Confirm order?"}),message:n({id:"confirm_order_alert_message",defaultMessage:"This will mark order as confirmed"}),onOkClick:async()=>{r(""),await a({orderId:t._id}),d.oR.success(n({id:"order_confirmed_success",defaultMessage:"Order confirmed successfully"}))}}))},c=async()=>{await r((0,s.jsx)(em.A,{onCancelClick:async()=>r(""),okText:n({id:"reject_order_alert_button",defaultMessage:"Reject"}),headerText:n({id:"reject_order_alert_header",defaultMessage:"Reject order?"}),onOkClick:async()=>{r(""),await i({orderId:t._id}),d.oR.success(n({id:"order_reject_success",defaultMessage:"Order rejected successfully"}))}}))},m={OPEN:{id:1,content:"created",visible:!0},PENDING:{id:2,content:"ordered",Component:ex(t)&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("button",{id:"confirm_order",onClick:u,type:"button",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-sm font-medium text-white hover:bg-slate-950 dark:hover:bg-slate-500 dark:focus:border-slate-400 focus:outline-hidden focus:ring-0 focus:ring-slate-800 dark:focus:ring-slate-400",children:n({id:"confirm_order",defaultMessage:"Confirm order"})}),(0,s.jsx)("button",{id:"reject_order",onClick:c,type:"button",className:"bg-white-300 relative -ml-px inline-flex items-center space-x-2 rounded-md border border-rose-500 bg-rose-500 px-2 py-1 text-sm font-medium text-white hover:bg-rose-700 focus:border-rose-400 focus:outline-hidden focus:ring-0 focus:ring-rose-400",children:n({id:"reject_order",defaultMessage:"Reject order"})})]}),visible:!0},REJECTED:{id:3,content:"rejected",visible:(null==t?void 0:t.status)==="REJECTED"},CONFIRMED:{id:4,content:"confirmed",visible:(null==t?void 0:t.status)!=="REJECTED"},FULLFILLED:{id:5,content:"fullfilled",visible:(null==t?void 0:t.status)!=="REJECTED"}};return(0,s.jsxs)("div",{className:"space-y-4 lg:space-y-0 lg:grid lg:grid-cols-3 lg:gap-10 md:mt-10 dark:text-slate-200",children:[(0,s.jsx)("div",{children:(0,s.jsx)(ei,{order:t})}),(0,s.jsx)("div",{className:"lg:col-span-2",children:(0,s.jsx)(w,{order:t})}),(0,s.jsx)("div",{className:"lg:col-span-2 bg-white dark:bg-slate-800 p-4 shadow-sm dark:shadow-none rounded-md",children:(0,s.jsx)(ed.A,{data:t,statusTypes:o,timeline:m})}),(0,s.jsx)("div",{children:null==t?void 0:t.items.map(e=>(0,s.jsx)(k,{item:e},e._id))}),(0,s.jsx)("div",{children:(0,s.jsx)(U,{order:t})}),(0,s.jsx)("div",{children:(0,s.jsx)(L,{order:t})}),(0,s.jsx)("div",{children:(0,s.jsx)(Z,{discounts:null==t?void 0:t.discounts})})]})};function ev(){let e=(0,u._)(["\n mutation RemoveOrder($orderId: ID!) {\n removeOrder(orderId: $orderId) {\n _id\n }\n }\n"]);return ev=function(){return e},e}let eh=(0,c.J1)(ev()),ep=()=>{let[e]=(0,M.n)(eh);return{removeOrder:async t=>{let{orderId:n}=t;return e({variables:{orderId:n},refetchQueries:["Order"]})}}};var eb=n(40817),ey=n(92436);let eg=e=>{let{orderId:t}=e,{formatMessage:n}=(0,l.A)(),{setModal:u}=(0,C.A)(),{removeOrder:c}=ep(),m=(0,r.useRouter)(),{hasRole:x}=(0,ey.A)(),{order:f,loading:v}=b({orderId:t}),h=async()=>{await u((0,s.jsx)(em.A,{message:n({id:"delete_order_confirmation",defaultMessage:"This action might cause inconsistencies with other data that relates to it. Are you sure you want to delete this order? "}),onCancelClick:async()=>u(""),onOkClick:async()=>{u(""),await c({orderId:t}),d.oR.success(n({id:"order_deleted",defaultMessage:"Order deleted successfully"})),m.push("/orders")},okText:n({id:"delete_order",defaultMessage:"Delete order"})}))};return(0,s.jsxs)("div",{className:"mt-5 max-w-full",children:[(0,s.jsx)(a.A,{currentPageTitle:(null==f?void 0:f.orderNumber)?"#".concat(null==f?void 0:f.orderNumber):""}),(0,s.jsxs)("div",{className:"items-center flex min-w-full justify-between gap-3 flex-wrap",children:[(0,s.jsx)(o.A,{headerText:n({id:"order_detail",defaultMessage:"Order Detail"}),title:(null==f?void 0:f.orderNumber)?n({id:"order_detail_title",defaultMessage:"Order {id}"},{id:null==f?void 0:f.orderNumber}):n({id:"cart_detail_title",defaultMessage:"Cart {id}"},{id:null==f?void 0:f._id})}),f&&"OPEN"===f.status&&x("removeOrder")?(0,s.jsx)(eb.A,{onClick:h}):null]}),v?(0,s.jsx)(i.A,{}):(0,s.jsx)(ef,{order:f})]})}},87774:(e,t,n)=>{n.d(t,{A:()=>i});var s=n(96427),r=n(79350),l=n(54431);function d(){let e=(0,s._)(['\n query PaymentProvidersType {\n paymentProviderType: __type(name: "PaymentProviderType") {\n options: enumValues {\n value: name\n label: description\n }\n }\n }\n']);return d=function(){return e},e}let a=(0,r.J1)(d()),i=()=>{var e;let{data:t,loading:n,error:s}=(0,l.IT)(a);return{paymentProviderType:(null==t||null==(e=t.paymentProviderType)?void 0:e.options)||[],loading:n,error:s}}},88943:(e,t,n)=>{n.d(t,{A:()=>l});var s=n(37876),r=n(77742);let l=e=>{let{onOkClick:t,onCancelClick:n,okText:l=null,cancelText:d=null,headerText:a=null,message:i=null,icon:o=null,close:u=null}=e,{formatMessage:c}=(0,r.A)();return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("div",{className:"sm:flex sm:items-start",children:[o||(0,s.jsx)("div",{className:"mx-auto flex h-12 w-12 shrink-0 items-center justify-center rounded-full bg-rose-100 dark:bg-rose-900/30 sm:mx-0 sm:h-10 sm:w-10",children:(0,s.jsx)("svg",{className:"h-6 w-6 text-rose-600 dark:text-rose-400",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","aria-hidden":"true",children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"})})}),(0,s.jsxs)("div",{className:"mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left",children:[(0,s.jsx)("h3",{className:"text-lg font-medium leading-6 text-slate-900 dark:text-slate-200",id:"modal-title",children:a||c({id:"warning",defaultMessage:"Warning!"})}),(0,s.jsx)("div",{className:"mt-2",children:(0,s.jsx)("p",{className:"text-sm text-slate-500 dark:text-slate-200",children:i||c({id:"are_you_sure",defaultMessage:"Are you sure?"})})})]})]}),(0,s.jsxs)("div",{className:"mt-5 sm:mt-4 sm:flex sm:flex-row-reverse",children:[(0,s.jsx)("button",{id:"danger_continue",onClick:t,type:"button",className:"inline-flex w-full justify-center rounded-md border border-transparent bg-rose-600 px-4 py-2 text-base font-medium text-white shadow-xs hover:bg-rose-700 focus:outline-hidden focus:ring-2 focus:ring-rose-500 focus:ring-offset-2 sm:ml-3 sm:w-auto sm:text-sm",children:l||c({id:"continue",defaultMessage:"Continue"})}),(0,s.jsx)("button",{id:"danger_cancel",onClick:n||u,type:"button",className:"mt-3 inline-flex w-full justify-center rounded-md border border-slate-300 bg-white px-4 py-2 text-base font-medium text-slate-700 shadow-xs hover:bg-slate-50 focus:outline-hidden focus:ring-2 focus:ring-slate-800 focus:ring-offset-2 sm:mt-0 sm:ml-3 sm:w-auto sm:text-sm",children:d||c({id:"cancel",defaultMessage:"Cancel"})})]})]})}}}]);
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3537],{4492:(e,t,l)=>{l.d(t,{A:()=>o});var n=l(96427),i=l(79350),r=l(54431),a=l(29939);function s(){let e=(0,n._)(["\n query Languages(\n $queryString: String\n $offset: Int\n $limit: Int\n $includeInactive: Boolean\n $sort: [SortOptionInput!]\n ) {\n languages(\n queryString: $queryString\n offset: $offset\n limit: $limit\n includeInactive: $includeInactive\n sort: $sort\n ) {\n ...LanguageFragment\n }\n languagesCount(includeInactive: $includeInactive, queryString: $queryString)\n }\n ","\n"]);return s=function(){return e},e}let d=(0,i.J1)(s(),a.A),o=function(){let{queryString:e="",limit:t=20,offset:l=0,includeInactive:n=!0,sort:i=[]}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{data:a,loading:s,error:o,fetchMore:u}=(0,r.IT)(d,{variables:{queryString:e,limit:t,offset:l,includeInactive:n,sort:i}}),c=(null==a?void 0:a.languages)||[],f=null==a?void 0:a.languagesCount,m=(null==c?void 0:c.length)<f;return{languages:c,languagesCount:f,hasMore:m,loading:s,error:o,loadMore:()=>{u({variables:{offset:null==c?void 0:c.length}})}}}},8733:(e,t,l)=>{l.d(t,{A:()=>o});var n=l(4902),i=l(14232),r=l(37154),a=l(77742);function s(e){var t=(0,a.A)(),l=t.formatMessage,n=t.textComponent,r=void 0===n?i.Fragment:n,s=e.id,d=e.description,o=e.defaultMessage,u=e.values,c=e.children,f=e.tagName,m=void 0===f?r:f,x=l({id:s,description:d,defaultMessage:o},u,{ignoreTag:e.ignoreTag});return"function"==typeof c?c(Array.isArray(x)?x:[x]):m?i.createElement(m,null,x):i.createElement(i.Fragment,null,x)}s.displayName="FormattedMessage";var d=i.memo(s,function(e,t){var l=e.values,i=(0,n.__rest)(e,["values"]),a=t.values,s=(0,n.__rest)(t,["values"]);return(0,r.bN)(a,l)&&(0,r.bN)(i,s)});d.displayName="MemoizedFormattedMessage";let o=d},14397:(e,t,l)=>{l.d(t,{A:()=>i});var n=l(14232);let i=n.forwardRef(function(e,t){let{title:l,titleId:i,...r}=e;return n.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:t,"aria-labelledby":i},r),l?n.createElement("title",{id:i},l):null,n.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m19.5 8.25-7.5 7.5-7.5-7.5"}))})},29939:(e,t,l)=>{l.d(t,{A:()=>r});var n=l(96427);function i(){let e=(0,n._)(["\n fragment LanguageFragment on Language {\n _id\n isoCode\n isActive\n isBase\n name\n }\n"]);return i=function(){return e},e}let r=(0,l(79350).J1)(i())},32578:(e,t,l)=>{l.r(t),l.d(t,{default:()=>eb});var n=l(37876),i=l(89099),r=l(77742),a=l(4301),s=l(92436),d=l(17703),o=l(40817),u=l(13437),c=l(92797),f=l(21162),m=l(77569),x=l(57204),g=l(42415),v=l(6388),p=l(14232),h=l(8733),b=l(79027),j=l(76309),A=l(67360),y=l(72460),w=l(96427),_=l(79350),F=l(53588);function k(){let e=(0,w._)(["\n fragment FilterTextsFragment on FilterTexts {\n _id\n locale\n title\n subtitle\n }\n"]);return k=function(){return e},e}let N=(0,_.J1)(k());function I(){let e=(0,w._)(["\n mutation UpdateFilterTexts(\n $filterId: ID!\n $filterOptionValue: String\n $texts: [FilterTextInput!]!\n ) {\n updateFilterTexts(\n filterId: $filterId\n filterOptionValue: $filterOptionValue\n texts: $texts\n ) {\n ...FilterTextsFragment\n }\n }\n ","\n"]);return I=function(){return e},e}let C=(0,_.J1)(I(),N),M=()=>{let[e]=(0,F.n)(C);return{updateFilterTexts:async t=>{let{filterId:l,filterOptionValue:n,texts:i}=t;return e({variables:{filterOptionValue:n,filterId:l,texts:i},refetchQueries:["TranslatedFilterTexts"]})}}};var $=l(54431);function T(){let e=(0,w._)(["\n query TranslatedFilterTexts($filterId: ID!, $filterOptionValue: String) {\n translatedFilterTexts(\n filterId: $filterId\n filterOptionValue: $filterOptionValue\n ) {\n ...FilterTextsFragment\n }\n }\n ","\n"]);return T=function(){return e},e}let O=(0,_.J1)(T(),N),S=e=>{let{filterId:t=null,filterOptionValue:l=null}=e,{data:n,loading:i,error:r}=(0,$.IT)(O,{variables:{filterId:t,filterOptionValue:l}});return{translatedFilterTexts:(null==n?void 0:n.translatedFilterTexts)||[],loading:i,error:r}};var L=l(35533),E=l(14866);let V=e=>{let{filterId:t,selectedLocale:l=null}=e,{formatMessage:i}=(0,r.A)(),{translatedFilterTexts:a,loading:d}=S({filterId:t}),{hasRole:o}=(0,s.A)(),u=i({id:"saved",defaultMessage:"Saved"}),{updateFilterTexts:c}=M(),f=async e=>{let{title:n,subtitle:i}=e;return await c({filterId:t,texts:[{locale:l||"de",title:n,subtitle:i}]}),{success:!0}},m=(0,y.A)({submit:f,successMessage:u,initialValues:{title:"",subtitle:"",...!d&&(null==a?void 0:a.find(e=>e.locale===l))||{}}});return(0,p.useEffect)(()=>{let e=null==a?void 0:a.find(e=>e.locale===l);m.formik.setValues({title:"",subtitle:"",...e||{}})},[a,l]),(0,n.jsx)(L.A,{documentationLabel:i({id:"text",defaultMessage:"Text"}),documentation:(0,n.jsx)(h.A,{id:"filter_text_form_description",defaultMessage:"<ul> <li>You can change the language of filter using the dropdown found at top right corner</li> </ul>",values:{ul:e=>(0,n.jsxs)("ul",{className:"space-y-1",children:[e," "]}),li:e=>(0,n.jsxs)("li",{children:[e," "]})}}),children:(0,n.jsx)(E.A,{children:(0,n.jsxs)(b.A,{form:m,className:"border-slate-300 dark:border-slate-800 pt-2 lg:shadow-sm",children:[(0,n.jsx)("div",{children:(0,n.jsx)(A.A,{name:"title",id:"title",label:i({id:"title",defaultMessage:"Title"}),autoComplete:"on",className:"mt-2 px-4 text-sm"})}),(0,n.jsx)("div",{children:(0,n.jsx)(A.A,{name:"subtitle",id:"subtitle",label:i({id:"subtitle",defaultMessage:"Subtitle"}),autoComplete:"on",className:"mt-2 px-4 text-sm"})}),(0,n.jsx)("div",{className:"flex",children:(0,n.jsx)(j.A,{hidden:!o("editFilterTexts"),label:i({id:"update_filter",defaultMessage:"Update filter"}),className:"my-4 ml-auto mr-4"})})]})})})};var q=l(89819);function D(){let e=(0,w._)(["\n mutation CreateFilterOption(\n $filterId: ID!\n $option: String!\n $texts: [FilterTextInput!]\n ) {\n createFilterOption(filterId: $filterId, option: $option, texts: $texts) {\n _id\n }\n }\n"]);return D=function(){return e},e}let J=(0,_.J1)(D()),B=()=>{let[e]=(0,F.n)(J);return{createFilterOption:async t=>{let{filterId:l,option:n,texts:i}=t;return e({variables:{filterId:l,option:n,texts:i},refetchQueries:["FilterOptions"]})}}};function R(){let e=(0,w._)(["\n fragment FilterOptionFragment on FilterOption {\n _id\n texts(forceLocale: $forceLocale) {\n _id\n title\n subtitle\n locale\n }\n value\n }\n"]);return R=function(){return e},e}let W=(0,_.J1)(R());function H(){let e=(0,w._)(["\n query FilterOptions($filterId: ID, $forceLocale: Locale) {\n filter(filterId: $filterId) {\n _id\n options {\n ...FilterOptionFragment\n }\n }\n }\n ","\n"]);return H=function(){return e},e}let U=(0,_.J1)(H(),W),Z=function(){var e;let{filterId:t=null,locale:l}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{data:n,loading:i,error:r}=(0,$.IT)(U,{skip:!t,variables:{filterId:t,forceLocale:l}});return{filterOptions:(null==n||null==(e=n.filter)?void 0:e.options)||[],loading:i,error:r}},Q=e=>{let{onCancel:t,onSubmit:l}=e,{formatMessage:i}=(0,r.A)(),{hasRole:a}=(0,s.A)(),d=i({id:"filter_option_added_success",defaultMessage:"Filter option added successfully"}),o=(0,y.A)({submit:l,successMessage:d,initialValues:{title:"",value:""}});return(0,n.jsxs)(b.A,{form:o,children:[(0,n.jsxs)("div",{className:"flex gap-2",children:[(0,n.jsx)(A.A,{name:"value",label:i({id:"filter_option_value",defaultMessage:"Value"}),placeholder:i({id:"filter_option_value",defaultMessage:"Value"}),required:!0}),(0,n.jsx)(A.A,{name:"title",label:i({id:"filter_option_title",defaultMessage:"Title"}),placeholder:i({id:"filter_option_title",defaultMessage:"Title"}),required:!0})]}),(0,n.jsxs)("div",{className:"flex justify-end",children:[(0,n.jsx)("button",{onClick:t,type:"button",className:"mb-5 mt-5 mr-2 h-9 rounded-md border border-transparent border-slate-300 bg-white px-3 py-1 text-sm font-medium leading-5 text-slate-700 shadow-xs",children:i({id:"cancel",defaultMessage:"Cancel"})}),(0,n.jsx)("span",{className:"flex items-center",children:(0,n.jsx)(j.A,{className:"m-auto w-full",label:i({id:"add_filter_option",defaultMessage:"Add option"})})})]})]})};function z(){let e=(0,w._)(["\n mutation RemoveFilterOption($filterId: ID!, $filterOptionValue: String!) {\n removeFilterOption(\n filterId: $filterId\n filterOptionValue: $filterOptionValue\n ) {\n _id\n }\n }\n"]);return z=function(){return e},e}let K=(0,_.J1)(z()),P=()=>{let[e]=(0,F.n)(K);return{removeFilterOption:async t=>{let{filterId:l,filterOptionValue:n}=t;return e({variables:{filterOptionValue:n,filterId:l},refetchQueries:["FilterOptions"]})}}};var Y=l(88943),G=l(60358),X=l(89452),ee=l(74464),et=l(93587);let el=e=>{var t,l,i;let{filterId:a,option:s,onDelete:d,selectedLocale:o}=e,{formatMessage:u}=(0,r.A)(),[c,f]=(0,p.useState)(!1),m=u({id:"saved",defaultMessage:"Saved"}),{updateFilterTexts:x}=M(),g=async e=>{let{title:t,value:l,subtitle:n}=e;return await x({filterId:a,filterOptionValue:l,texts:[{locale:o,title:t,subtitle:n}]}),f(!1),{success:!0}},v=(0,y.A)({submit:g,successMessage:m,initialValues:{title:"",subtitle:"",...s,...null==s?void 0:s.texts}});return(0,n.jsx)(b.A,{form:v,children:(0,n.jsx)("div",{className:"mt-2",children:(0,n.jsx)("li",{className:"py-2 px-2",children:(0,n.jsxs)("div",{className:"flex justify-between items-center gap-2",children:[(0,n.jsxs)("div",{className:"flex items-center flex-wrap gap-3",children:[(0,n.jsx)(X.A,{text:null==s?void 0:s.value,color:"slate",square:!0,className:"break-all"}),(0,n.jsxs)("div",{className:"flex flex-wrap gap-3",children:[(0,n.jsx)("div",{className:"truncate text-sm text-slate-900 dark:text-slate-200",children:c?(0,n.jsx)(A.A,{className:"mt-0 mb-1 rounded-xs py-0 px-2",name:"title",required:!0,label:u({id:"title",defaultMessage:"Title"})}):null==s||null==(t=s.texts)?void 0:t.title}),(0,n.jsx)("div",{className:"truncate text-sm text-slate-500 dark:text-slate-200",children:c?(0,n.jsx)(A.A,{className:"mt-0 mb-1 rounded-xs py-0 px-2",name:"subtitle",label:u({id:"subtitle",defaultMessage:"Subtitle"})}):(null==s||null==(l=s.texts)?void 0:l.subtitle)&&(null==s||null==(i=s.texts)?void 0:i.subtitle)})]})]}),(0,n.jsx)("div",{children:c?(0,n.jsxs)("div",{className:"flex gap-2",children:[(0,n.jsx)(et.A,{variant:"secondary",onClick:()=>f(!c),text:u({id:"cancel",defaultMessage:"Cancel"})}),(0,n.jsx)(et.A,{variant:"primary",disabled:!v.formik.isValid,onClick:v.formik.handleSubmit,text:u({id:"save",defaultMessage:"Save"})})]}):(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[(0,n.jsx)("button",{onClick:()=>f(!c),type:"button",className:"p-1 rounded-full text-slate-500 hover:text-slate-700 hover:bg-slate-100 dark:text-slate-400 dark:hover:text-slate-200 dark:hover:bg-slate-700 transition-colors","aria-label":u({id:"edit",defaultMessage:"Edit"}),children:(0,n.jsx)(ee.A,{})}),(0,n.jsx)(G.A,{onClick:()=>d(null==s?void 0:s.value),className:"ml-1 mr-1"})]})})]})})})})},en=e=>{let{filterId:t,options:l,selectedLocale:i=null}=e,{formatMessage:s}=(0,r.A)(),{setModal:d}=(0,q.A)(),{removeFilterOption:o}=P(),u=async e=>{await d((0,n.jsx)(Y.A,{onCancelClick:async()=>d(""),message:s({id:"delete_filter_option_confirmation",defaultMessage:"This action might cause inconsistencies with other data that relates to it. Are you sure you want to delete this filter option? "}),onOkClick:async()=>{d(""),await o({filterId:t,filterOptionValue:e}),a.oR.success(s({id:"filter_deleted",defaultMessage:"Filter deleted successfully"}))},okText:s({id:"delete_filter_option",defaultMessage:"Delete option"})}))};return(0,n.jsx)("div",{children:(0,n.jsx)("ul",{className:"-my-5 divide-y divide-slate-200 dark:divide-slate-700 pb-3 ",children:l.map(e=>(0,n.jsx)(el,{filterId:t,option:e,onDelete:u,selectedLocale:i},"".concat(e._id).concat(i)))})})},ei=e=>{let{filterId:t,selectedLocale:l=null}=e,{formatMessage:i}=(0,r.A)(),{filterOptions:a}=Z({filterId:t,locale:l}),{setModal:d}=(0,q.A)(),{createFilterOption:o}=B(),{hasRole:u}=(0,s.A)(),c=async e=>{let{value:n,title:i,subtitle:r}=e;return await o({filterId:t,option:n,texts:[{title:i,locale:l,subtitle:r}]}),d(""),{success:!0}};return(0,n.jsx)(L.A,{documentationLabel:i({id:"filer_options",defaultMessage:"Filter options"}),sideComponents:u("addFilterOption")?(0,n.jsx)("button",{type:"button",onClick:()=>d((0,n.jsx)(Q,{onSubmit:c,onCancel:()=>d("")})),className:"fixed top-0 right-0 z-10 mb-5 mt-5 mr-2 h-9 rounded-md border border-transparent bg-slate-800 dark:bg-slate-600 px-3 py-1 text-sm font-medium leading-5 text-white shadow-xs hover:bg-slate-950 dark:hover:bg-slate-500 focus:outline-hidden focus:ring-2 focus:ring-slate-800 dark:focus:ring-slate-400 sm:fixed sm:top-auto sm:right-auto",children:i({id:"add_filter_option",defaultMessage:"Add option"})}):null,children:(0,n.jsx)("div",{className:"mt-8 w-full border-slate-300 dark:border-slate-800 p-3 sm:mt-0 shadow-md bg-white dark:bg-slate-900",children:(0,n.jsx)(en,{filterId:t,options:a,selectedLocale:l})})})},er=e=>{let{filterKey:t,filterType:l}=e,{formatMessage:i}=(0,r.A)();return(0,n.jsxs)("div",{className:"mt-5 space-y-2 lg:flex lg:space-y-0 lg:space-x-3",children:[(0,n.jsxs)("div",{className:"flex items-center space-x-1",children:[(0,n.jsx)("div",{className:"text-sm",children:i({id:"key",defaultMessage:"Key"})}),(0,n.jsx)("div",{className:"rounded-md bg-slate-200 py-1 px-2 text-sm dark:text-slate-600",children:t})]}),(0,n.jsxs)("div",{className:"flex items-center space-x-1",children:[(0,n.jsx)("div",{className:"text-sm",children:i({id:"filter_type",defaultMessage:"Filter Type"})}),(0,n.jsx)("div",{className:"rounded-md bg-slate-200 py-1 px-2 text-sm dark:text-slate-600",children:l})]})]})};var ea=l(40159);function es(){let e=(0,w._)(["\n mutation UpdateFilter($filter: UpdateFilterInput!, $filterId: ID!) {\n updateFilter(filter: $filter, filterId: $filterId) {\n ...FilterFragment\n }\n }\n ","\n"]);return es=function(){return e},e}let ed=(0,_.J1)(es(),ea.A),eo=()=>{let[e]=(0,F.n)(ed);return{updateFilter:async t=>{let{filterId:l,filter:n}=t;return e({variables:{filter:n,filterId:l}})}}};var eu=l(34775),ec=l(67686);let ef=e=>{let{selectedView:t,id:l,...i}=e;return"text"===t?(0,n.jsx)(ec.A,{children:(0,n.jsx)(V,{filterId:l})}):"options"===t?(0,n.jsx)(ec.A,{children:(0,n.jsx)(ei,{filterId:l})}):"extended"===t?(0,n.jsx)(eu.A,{data:i}):(0,n.jsx)(ec.A,{children:(0,n.jsx)(V,{filterId:l})})},em=e=>{let{filter:t,extendedData:l}=e,{_id:i,isActive:s,key:d,type:o,created:u,updated:c}=t||{},{formatMessage:p,formatDate:h}=(0,r.A)(),{updateFilter:b}=eo(),j=[{id:"text",texts:p({id:"text",defaultMessage:"Text"}),Icon:(0,n.jsx)(f.A,{className:"h-4 w-5"})},{id:"options",options:p({id:"options",defaultMessage:"Options"}),Icon:(0,n.jsx)(m.A,{className:"h-4 w-5"})},null!==l&&{id:"extended",title:p({id:"extended-fields",defaultMessage:"Extended"}),Icon:(0,n.jsx)(x.A,{className:"h-4 w-5"})}].filter(Boolean),A=[{id:"activate",title:p({id:"activate",defaultMessage:"Activate"}),selectedTitle:p({id:"active",defaultMessage:"Active"}),onClick:async()=>{await b({filterId:i,filter:{isActive:!0}}),a.oR.success(p({id:"filter_activated",defaultMessage:"Filter activated!",description:"shown on successful toggle of filter status"}))},current:s,bgColor:"green"},{id:"deactivate",title:p({id:"deactivate",defaultMessage:"Deactivate"}),onClick:async()=>{await b({filterId:i,filter:{isActive:!1}}),a.oR.success(p({id:"filter_deactivated",defaultMessage:"Filter deactivated!",description:"shown on successful toggle of filter status"}))},selectedTitle:p({id:"deactivated",defaultMessage:"Deactivated"}),current:!s,bgColor:"slate"}];return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)("div",{className:"flex items-center justify-between",children:[(0,n.jsx)("div",{children:(0,n.jsx)(er,{filterKey:d,filterType:o})}),(0,n.jsx)("div",{className:"self-end",children:(0,n.jsx)(g.A,{options:A,type:p({id:"filter",defaultMessage:"Filter"})})})]}),(0,n.jsx)(v.A,{tabItems:j,defaultTab:"text",children:(0,n.jsx)(ef,{id:null==t?void 0:t._id,...l})})]})};var ex=l(66400);function eg(){let e=(0,w._)(["\n query Filter($filterId: ID) {\n filter(filterId: $filterId) {\n ...FilterFragment\n ","\n texts {\n _id\n title\n subtitle\n locale\n }\n }\n }\n ","\n"]);return eg=function(){return e},e}let ev=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return(0,_.J1)(eg(),e,ea.A)},ep=function(){let{filterId:e=null}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{customProperties:t,hydrateFragment:l}=(0,ex.A)(),{data:n,loading:i,error:r}=(0,$.IT)(ev(null==t?void 0:t.Filter),{skip:!e,variables:{filterId:e}}),a=null==n?void 0:n.filter,s=l(null==t?void 0:t.Filter,a);return{filter:a,loading:i,error:r,extendedData:s}};var eh=l(66587);let eb=e=>{let{filterId:t}=e,{formatMessage:l}=(0,r.A)(),{setModal:f}=(0,q.A)(),m=(0,i.useRouter)(),{filter:x,loading:g,extendedData:v}=ep({filterId:t}),{hasRole:p}=(0,s.A)(),{removeFilter:h}=(0,eh.A)(),b=async()=>{await f((0,n.jsx)(Y.A,{onCancelClick:async()=>f(""),message:l({id:"delete_filter_confirmation",defaultMessage:"This action might cause inconsistencies with other data that relates to it. Are you sure you want to delete this filter? "}),onOkClick:async()=>{f(""),await h({filterId:t}),a.oR.success(l({id:"filter_deleted",defaultMessage:"Filter deleted successfully"})),m.push("/filters")},okText:l({id:"delete_filter",defaultMessage:"Delete filter"})}))};return(0,n.jsxs)("div",{className:"mt-5 max-w-full",children:[(0,n.jsx)(d.A,{currentPageTitle:null==x?void 0:x.key}),(0,n.jsxs)("div",{className:"items-center flex min-w-full justify-between gap-3 flex-wrap",children:[(0,n.jsx)(c.A,{headerText:l({id:"filter_detail",defaultMessage:"Filter Detail"}),title:l({id:"filter_detail_title",defaultMessage:"Filter {id}"},{id:null==x?void 0:x._id})}),p("removeFilter")&&(0,n.jsx)(o.A,{onClick:b})]}),g?(0,n.jsx)(u.A,{}):(0,n.jsx)(em,{filter:x,extendedData:v})]})}},36925:(e,t,l)=>{l.d(t,{A:()=>r});var n=l(96427);function i(){let e=(0,n._)(["\n fragment CountryFragment on Country {\n _id\n isoCode\n isActive\n isBase\n\n defaultCurrency {\n _id\n isoCode\n }\n }\n"]);return i=function(){return e},e}let r=(0,l(79350).J1)(i())},40159:(e,t,l)=>{l.d(t,{A:()=>r});var n=l(96427);function i(){let e=(0,n._)(["\n fragment FilterFragment on Filter {\n _id\n updated\n created\n key\n isActive\n type\n options {\n _id\n texts {\n _id\n title\n subtitle\n locale\n }\n value\n }\n }\n"]);return i=function(){return e},e}let r=(0,l(79350).J1)(i())},40817:(e,t,l)=>{l.d(t,{A:()=>a});var n=l(37876),i=l(21671),r=l(77742);let a=e=>{let{onClick:t,text:l=null,Icon:a=null}=e,{formatMessage:s}=(0,r.A)();return(0,n.jsxs)("button",{type:"button",onClick:t,"aria-describedby":"header-delete-button",className:"inline-flex items-center gap-2 justify-center rounded-md border border-rose-500 px-4 py-2 text-sm font-medium leading-5 text-rose-600 shadow-sm hover:border-rose-600 hover:bg-rose-600 hover:text-white focus:outline-hidden focus:ring-2 focus:ring-rose-500 focus:ring-offset-2 h-[38px]",children:[(0,n.jsx)("span",{children:a||(0,n.jsx)(i.A,{className:"h-5 w-5"})}),l||s({id:"delete",defaultMessage:"Delete"})]})}},42415:(e,t,l)=>{l.d(t,{A:()=>f});var n=l(37876),i=l(14232),r=l(92837),a=l(26129),s=l(33178),d=l(14397),o=l(77742);function u(){for(var e=arguments.length,t=Array(e),l=0;l<e;l++)t[l]=arguments[l];return t.filter(Boolean).join(" ")}let c={green:{button:"bg-emerald-50 text-emerald-700 border border-emerald-200",hover:"hover:bg-emerald-100",focus:"focus:ring-emerald-500",dropdown:"text-emerald-700 bg-emerald-50 border border-emerald-200",description:"text-emerald-600"},amber:{button:"bg-amber-50 text-amber-700 border border-amber-200",hover:"hover:bg-amber-100",focus:"focus:ring-amber-500",dropdown:"text-amber-700 bg-amber-50 border border-amber-200",description:"text-amber-600"},slate:{button:"bg-slate-50 text-slate-700 border border-slate-200",hover:"hover:bg-slate-100",focus:"focus:ring-slate-500",dropdown:"text-slate-700 bg-slate-50 border border-slate-200",description:"text-slate-600"},stone:{button:"bg-stone-50 text-stone-700 border border-stone-200",hover:"hover:bg-stone-100",focus:"focus:ring-stone-500",dropdown:"text-stone-700 bg-stone-50 border border-stone-200",description:"text-stone-600"},emerald:{button:"bg-emerald-50 text-emerald-700 border border-emerald-200",hover:"hover:bg-emerald-100",focus:"focus:ring-emerald-500",dropdown:"text-emerald-700 bg-emerald-50 border border-emerald-200",description:"text-emerald-600"}},f=e=>{let{options:t,type:l}=e,[f,m]=(0,i.useState)(!1),[x,g]=(0,i.useState)((null==t?void 0:t.filter(e=>{let{current:t}=e;return t})[0])||(null==t?void 0:t[0])),{formatMessage:v}=(0,o.A)();if(!(null==x?void 0:x.id)||!(null==t?void 0:t.length))return null;let p=c[x.bgColor]||c.emerald,h=()=>{if(!f)return"";switch(x.bgColor){case"green":case"emerald":return"bg-emerald-100";case"amber":return"bg-amber-100";case"stone":return"bg-stone-100";default:return"bg-slate-100"}},b=e=>(c[e.bgColor]||c.emerald).dropdown;return(0,n.jsx)(r.WF,{value:x,onChange:g,children:e=>{let{open:o}=e;return(0,n.jsxs)("div",{id:x.id,children:[(0,n.jsx)(r.WF.Label,{className:"sr-only",children:v({id:"select_options_toggle",defaultMessage:"Change {type} status"},{type:l})}),(0,n.jsxs)("div",{className:"relative",children:[(0,n.jsxs)(r.WF.Button,{onMouseEnter:()=>m(!0),onMouseLeave:()=>m(!1),className:u("inline-flex items-center gap-2 rounded-md px-3 py-2 text-sm font-medium shadow-sm transition-colors focus:outline-none focus:ring-2 focus:ring-offset-2 h-[38px]",p.button,p.hover,p.focus,h()),children:[(0,n.jsx)(s.A,{className:"h-4 w-4","aria-hidden":"true"}),(0,n.jsx)("span",{children:(null==x?void 0:x.selectedTitle)||x.title}),(0,n.jsx)(d.A,{className:u("h-4 w-4 -mr-1 transition-transform duration-200",o&&"rotate-180"),"aria-hidden":"true"})]}),(0,n.jsx)(a.e,{show:o,as:i.Fragment,leave:"transition ease-in duration-100",leaveFrom:"opacity-100",leaveTo:"opacity-0",children:(0,n.jsx)(r.WF.Options,{className:"mt-1 absolute right-0 z-10 w-64 origin-top-right divide-y divide-slate-200 overflow-hidden rounded-md bg-white shadow-lg ring-1 ring-black ring-opacity-5 focus:outline-hidden",children:t.map(e=>(0,n.jsx)(r.WF.Option,{className:()=>u("group",(null==e?void 0:e.disable)&&"cursor-not-allowed","relative cursor-default select-none p-3 text-sm"),value:e,disabled:e.disable,children:(0,n.jsx)("div",{className:"".concat((null==e?void 0:e.disable)&&"pointer-events-none"),onClick:null==e?void 0:e.onClick,children:(0,n.jsx)("div",{className:"flex items-start justify-between gap-3",children:(0,n.jsxs)("div",{className:"flex-1",children:[(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[(0,n.jsx)("span",{className:u("inline-flex items-center rounded-md px-2 py-1 text-xs font-medium",b(e)),children:e.title}),e.id===x.id&&(0,n.jsx)(s.A,{className:"h-4 w-4 text-slate-600","aria-hidden":"true"})]}),(0,n.jsx)("div",{className:u("mt-2 ms-1 text-sm text-slate-600"),children:null==e?void 0:e.description})]})})})},e.title))})})]})]})}})}},46624:(e,t,l)=>{l.d(t,{A:()=>i});var n=l(14232);let i=n.forwardRef(function(e,t){let{title:l,titleId:i,...r}=e;return n.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:t,"aria-labelledby":i},r),l?n.createElement("title",{id:i},l):null,n.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m14.74 9-.346 9m-4.788 0L9.26 9m9.968-3.21c.342.052.682.107 1.022.166m-1.022-.165L18.16 19.673a2.25 2.25 0 0 1-2.244 2.077H8.084a2.25 2.25 0 0 1-2.244-2.077L4.772 5.79m14.456 0a48.108 48.108 0 0 0-3.478-.397m-12 .562c.34-.059.68-.114 1.022-.165m0 0a48.11 48.11 0 0 1 3.478-.397m7.5 0v-.916c0-1.18-.91-2.164-2.09-2.201a51.964 51.964 0 0 0-3.32 0c-1.18.037-2.09 1.022-2.09 2.201v.916m7.5 0a48.667 48.667 0 0 0-7.5 0"}))})},57204:(e,t,l)=>{l.d(t,{A:()=>i});var n=l(14232);let i=n.forwardRef(function(e,t){let{title:l,titleId:i,...r}=e;return n.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:t,"aria-labelledby":i},r),l?n.createElement("title",{id:i},l):null,n.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M14.25 6.087c0-.355.186-.676.401-.959.221-.29.349-.634.349-1.003 0-1.036-1.007-1.875-2.25-1.875s-2.25.84-2.25 1.875c0 .369.128.713.349 1.003.215.283.401.604.401.959v0a.64.64 0 0 1-.657.643 48.39 48.39 0 0 1-4.163-.3c.186 1.613.293 3.25.315 4.907a.656.656 0 0 1-.658.663v0c-.355 0-.676-.186-.959-.401a1.647 1.647 0 0 0-1.003-.349c-1.036 0-1.875 1.007-1.875 2.25s.84 2.25 1.875 2.25c.369 0 .713-.128 1.003-.349.283-.215.604-.401.959-.401v0c.31 0 .555.26.532.57a48.039 48.039 0 0 1-.642 5.056c1.518.19 3.058.309 4.616.354a.64.64 0 0 0 .657-.643v0c0-.355-.186-.676-.401-.959a1.647 1.647 0 0 1-.349-1.003c0-1.035 1.008-1.875 2.25-1.875 1.243 0 2.25.84 2.25 1.875 0 .369-.128.713-.349 1.003-.215.283-.4.604-.4.959v0c0 .333.277.599.61.58a48.1 48.1 0 0 0 5.427-.63 48.05 48.05 0 0 0 .582-4.717.532.532 0 0 0-.533-.57v0c-.355 0-.676.186-.959.401-.29.221-.634.349-1.003.349-1.035 0-1.875-1.007-1.875-2.25s.84-2.25 1.875-2.25c.37 0 .713.128 1.003.349.283.215.604.401.96.401v0a.656.656 0 0 0 .658-.663 48.422 48.422 0 0 0-.37-5.36c-1.886.342-3.81.574-5.766.689a.578.578 0 0 1-.61-.58v0Z"}))})},64405:(e,t,l)=>{l.d(t,{A:()=>o});var n=l(96427),i=l(79350),r=l(54431),a=l(36925);function s(){let e=(0,n._)(["\n query Countries(\n $queryString: String\n $limit: Int\n $offset: Int\n $includeInactive: Boolean\n $sort: [SortOptionInput!]\n ) {\n countries(\n queryString: $queryString\n limit: $limit\n offset: $offset\n includeInactive: $includeInactive\n sort: $sort\n ) {\n ...CountryFragment\n }\n countriesCount(includeInactive: $includeInactive, queryString: $queryString)\n }\n\n ","\n"]);return s=function(){return e},e}let d=(0,i.J1)(s(),a.A),o=function(){let{queryString:e="",limit:t=20,offset:l=0,includeInactive:n=!0,sort:i=[]}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{data:a,loading:s,error:o,fetchMore:u}=(0,r.IT)(d,{variables:{queryString:e,limit:t,offset:l,includeInactive:n,sort:i}}),c=(null==a?void 0:a.countries)||[],f=null==a?void 0:a.countriesCount,m=(null==c?void 0:c.length)<f;return{countries:c,countriesCount:f,hasMore:m,loading:s,error:o,loadMore:()=>{u({variables:{offset:null==c?void 0:c.length}})}}}},66587:(e,t,l)=>{l.d(t,{A:()=>d});var n=l(96427),i=l(79350),r=l(53588);function a(){let e=(0,n._)(["\n mutation RemoveFilter($filterId: ID!) {\n removeFilter(filterId: $filterId) {\n _id\n }\n }\n"]);return a=function(){return e},e}let s=(0,i.J1)(a()),d=()=>{let[e]=(0,r.n)(s);return{removeFilter:async t=>{let{filterId:l}=t;return e({variables:{filterId:l},refetchQueries:["Filters"]})}}}},67686:(e,t,l)=>{l.d(t,{A:()=>u});var n=l(37876),i=l(14232),r=l(77742),a=l(4492),s=l(64405),d=l(25602);let o=(e,t)=>{let l=[];return e.forEach(e=>{let{_id:n,isoCode:i}=e;l.push({_id:n,isoCode:i}),t.forEach(e=>{let{isoCode:t,_id:r}=e,a="".concat(i,"-").concat(t.toUpperCase());l.push({_id:"".concat(r,"-").concat(n),isoCode:a})})}),l},u=e=>{let{children:t,onlyFull:l=!1}=e,{languages:u}=(0,a.A)(),{shopInfo:c,loading:f}=(0,d.A)(),{countries:m}=(0,s.A)(),{locale:x}=(0,r.A)(),[g,v]=(0,i.useState)(null);(0,i.useEffect)(()=>{if(!f){var e,t,l;v((null==c||null==(e=c.language)?void 0:e.isoCode)+"-"+(null==c||null==(l=c.country)||null==(t=l.isoCode)?void 0:t.toUpperCase()))}},[c,f,x]);let p=o(u,m).filter(e=>!l||e.isoCode.includes("-"));return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("div",{className:"w-fit mt-5 mb-3",children:(0,n.jsx)("select",{id:"locale-wrapper",className:"cursor-pointer rounded-md border-1 border-slate-300 dark:border-slate-700 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-slate-800",value:g||"",onChange:e=>{e.stopPropagation(),v(e.target.value)},children:null==p?void 0:p.map(e=>(0,n.jsx)("option",{value:e.isoCode,children:e.isoCode},e._id))})}),(0,n.jsx)("div",{children:i.cloneElement(t,{selectedLocale:g||""})})]})}},74464:(e,t,l)=>{l.d(t,{A:()=>r});var n=l(37876),i=l(59454);let r=()=>(0,n.jsx)("div",{id:"edit__icon_button",className:"rounded-full bg-white dark:bg-slate-800 dark:hover:bg-slate-600 p-2 text-sm text-slate-900 dark:text-slate-200 hover:bg-slate-50 focus:outline-hidden focus:ring-0 focus:ring-rose-500 focus:ring-offset-2",children:(0,n.jsx)(i.A,{className:"h-5 w-5"})})},77569:(e,t,l)=>{l.d(t,{A:()=>i});var n=l(14232);let i=n.forwardRef(function(e,t){let{title:l,titleId:i,...r}=e;return n.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:t,"aria-labelledby":i},r),l?n.createElement("title",{id:i},l):null,n.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 12h3.75M9 15h3.75M9 18h3.75m3 .75H18a2.25 2.25 0 0 0 2.25-2.25V6.108c0-1.135-.845-2.098-1.976-2.192a48.424 48.424 0 0 0-1.123-.08m-5.801 0c-.065.21-.1.433-.1.664 0 .414.336.75.75.75h4.5a.75.75 0 0 0 .75-.75 2.25 2.25 0 0 0-.1-.664m-5.8 0A2.251 2.251 0 0 1 13.5 2.25H15c1.012 0 1.867.668 2.15 1.586m-5.8 0c-.376.023-.75.05-1.124.08C9.095 4.01 8.25 4.973 8.25 6.108V8.25m0 0H4.875c-.621 0-1.125.504-1.125 1.125v11.25c0 .621.504 1.125 1.125 1.125h9.75c.621 0 1.125-.504 1.125-1.125V9.375c0-.621-.504-1.125-1.125-1.125H8.25ZM6.75 12h.008v.008H6.75V12Zm0 3h.008v.008H6.75V15Zm0 3h.008v.008H6.75V18Z"}))})}}]);
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4103],{9529:(e,t,r)=>{r.d(t,{A:()=>i});var a=r(37876),s=r(15039),d=r.n(s),l=r(59455),n=r(38168),o=r(68516);let i=e=>{let{maxLength:t,validators:r=[],...s}=e,i=(0,n.A)({validators:[...r,t&&(0,l.Rr)(t)],...s});return(0,a.jsx)(o.A,{...i,children:(0,a.jsx)("textarea",{className:d()("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-slate-300 dark:border-slate-700 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-slate-800",i.className,{"border-rose-700 placeholder:text-rose-300 placeholder-rose-300":!!i.error}),disabled:i.disabled,id:i.name,name:i.name,rows:i.rows||10,onChange:i.onChange,onBlur:i.onBlur,placeholder:i.placeholder,autoComplete:i.autoComplete||"off",value:i.value})})}},15845:(e,t,r)=>{r.d(t,{A:()=>S});var a=r(37876),s=r(42032),d=r(2161),l=r(40458),n=r(77742),o=r(4301),i=r(15039),c=r.n(i),u=r(60358),m=r(10561),v=r(88943),x=r(89819),h=r(96427),p=r(79350),b=r(53588);function w(){let e=(0,h._)(["\n mutation RemoveProductReview($productReviewId: ID!) {\n removeProductReview(productReviewId: $productReviewId) {\n _id\n }\n }\n"]);return w=function(){return e},e}let g=(0,p.J1)(w()),f=()=>{let[e]=(0,b.n)(g);return{removeProductReview:async t=>{let{productReviewId:r}=t;return e({variables:{productReviewId:r},refetchQueries:["ProductReviewByProduct","ProductReviewByUser"]})}}};var R=r(89452),k=r(59863),y=r(32783),j=r(70057);function N(){let e=(0,h._)(["\n mutation AddProductReviewVote(\n $productReviewId: ID!\n $type: ProductReviewVoteType!\n $meta: JSON\n ) {\n addProductReviewVote(\n productReviewId: $productReviewId\n type: $type\n meta: $meta\n ) {\n ...ProductReviewDetailFragment\n }\n }\n ","\n"]);return N=function(){return e},e}let P=(0,p.J1)(N(),j.A),A=()=>{let[e]=(0,b.n)(P);return{addProductReviewVote:async t=>{let{productReviewId:r,type:a,meta:s}=t;return e({variables:{productReviewId:r,type:a,meta:s},refetchQueries:["ProductReviewByProduct","ProductReviewByUser"]})}}};function _(){let e=(0,h._)(["\n mutation RemoveProductReviewVote(\n $productReviewId: ID!\n $type: ProductReviewVoteType!\n ) {\n removeProductReviewVote(productReviewId: $productReviewId, type: $type) {\n ...ProductReviewDetailFragment\n }\n }\n ","\n"]);return _=function(){return e},e}let O=(0,p.J1)(_(),j.A),V=()=>{let[e]=(0,b.n)(O);return{removeProductReviewVote:async t=>{let{productReviewId:r,type:a}=t;return e({variables:{productReviewId:r,type:a},refetchQueries:["ProductReviewByProduct","ProductReviewByUser"]})}}};var T=r(92436),E=r(65163),C=r(79027),D=r(76309),I=r(9529),$=r(72460);let B=e=>{let{onSubmit:t,onSubmitSuccess:r=async()=>!0}=e,{formatMessage:s}=(0,n.A)(),d=s({id:"product_review_added",defaultMessage:"Review added successfully!"}),l=(0,$.A)({submit:t,successMessage:d,onSubmitSuccess:r,initialValues:{message:""}});return(0,a.jsxs)(C.A,{form:l,children:[(0,a.jsx)(I.A,{rows:3,required:!0,name:"message",id:"message",label:s({id:"message",defaultMessage:"Message"})}),(0,a.jsx)("div",{className:"-mx-6 -mb-6 mt-6 border-t-slate-100 border-t dark:border-t-slate-700 space-y-6 rounded-b-md bg-slate-50 dark:bg-slate-900 p-5 text-right",children:(0,a.jsx)(D.A,{label:s({id:"report-submit",defaultMessage:"Submit"})})})]})};var U=r(92709);let M={UPVOTE:"UPVOTE",DOWNVOTE:"DOWNVOTE",REPORT:"REPORT"},S=e=>{var t,r,i,h,p,b,w,g;let{review:j,enableDelete:N=!0,showProduct:P=!1}=e,{formatMessage:_}=(0,n.A)(),{currentUser:O}=(0,E.A)(),{formatDateTime:C}=(0,m.A)(),{setModal:D}=(0,x.A)(),{addProductReviewVote:I}=A(),{removeProductReviewVote:$}=V(),{hasRole:S,isAdmin:W}=(0,T.A)(),q=e=>!!j.ownVotes.find(t=>t.type===e),J=async e=>{let t=async t=>{let{message:r}=t;try{return await I({productReviewId:j._id,type:e,meta:{message:r}}),{success:!0}}catch(e){if(e instanceof U.A)return{success:!1,error:null==e?void 0:e.message};return{success:!1,error:e}}};q(e)?await $({productReviewId:j._id,type:e}):e===M.REPORT?await D((0,a.jsx)(B,{onSubmit:t,onSubmitSuccess:async()=>D(null)})):await I({productReviewId:j._id,type:e})},{removeProductReview:F}=f(),Q=!j.deleted&&S("voteProductReview")&&N&&(null==j||null==(t=j.author)?void 0:t._id)===(null==O?void 0:O._id)||W()&&!j.deleted,G=!j.deleted&&S("voteProductReview"),z=null==j?void 0:j.product,H=async e=>{await D((0,a.jsx)(v.A,{onCancelClick:async()=>D(""),message:_({id:"delete_review_confirmation",defaultMessage:"This action might cause inconsistencies with other data that relates to it. Are you sure you want to delete this review? "}),onOkClick:async()=>{D(""),await F({productReviewId:e}),o.oR.success(_({id:"review_deleted",defaultMessage:"Review deleted successfully"}))},okText:_({id:"delete_review",defaultMessage:"Delete review"})}))};return(0,a.jsxs)("div",{className:c()("mb-4 rounded-lg shadow-sm bg-white dark:bg-slate-800 p-4",{"border-rose-200 bg-rose-50 dark:bg-rose-950":j.deleted},{"border-slate-200 dark:border-slate-700":!j.deleted}),children:[(0,a.jsxs)("div",{className:"flex items-center",children:[P?(0,a.jsx)(k.A,{src:null==z||null==(i=z.media[0])||null==(r=i.file)?void 0:r.url,alt:null==j||null==(h=j.author)?void 0:h.username,width:48,height:48,className:"h-12 w-12 rounded-full aspect-square object-cover object-center"}):(0,a.jsx)(k.A,{src:null==j||null==(b=j.author)||null==(p=b.avatar)?void 0:p.url,alt:null==j||null==(w=j.author)?void 0:w.username,width:48,height:48,className:"h-12 w-12 rounded-full aspect-square object-cover object-center"}),(0,a.jsxs)("div",{className:"ml-4 flex-1",children:[(0,a.jsx)("h4",{className:"text-sm font-semibold text-slate-900 dark:text-slate-100",children:P?(null==z||null==(g=z.texts)?void 0:g.title)||(0,a.jsxs)(a.Fragment,{children:[z._id," ",(0,a.jsx)(R.A,{color:"yellow",text:_({id:"title_not_found",defaultMessage:"Title not found"})})]}):(0,y.A)(null==j?void 0:j.author)}),(0,a.jsx)("p",{className:"text-xs text-slate-500 dark:text-slate-400",children:(0,a.jsx)("time",{dateTime:j.updated||j.created,children:C(j.updated||j.created,{dateStyle:"short",timeStyle:"short"})})})]}),(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[(0,a.jsxs)("button",{type:"button",disabled:!G,onClick:async()=>J(M.UPVOTE),className:"flex items-center gap-1 px-2 py-1 rounded-md transition-colors disabled:opacity-50 ".concat(q(M.UPVOTE)?"bg-emerald-100 dark:bg-emerald-900 hover:bg-emerald-200 dark:hover:bg-emerald-800":"hover:bg-slate-100 dark:hover:bg-slate-700"),children:[(0,a.jsx)(s.A,{className:"h-5 w-5 ".concat(q(M.UPVOTE)?"text-emerald-600 dark:text-emerald-400":"text-slate-400 dark:text-slate-500")}),(0,a.jsx)("span",{className:"text-sm font-medium ".concat(q(M.UPVOTE)?"text-emerald-700 dark:text-emerald-300":"text-slate-700 dark:text-slate-300"),children:j.upVote})]}),(0,a.jsxs)("button",{type:"button",disabled:!G,onClick:async()=>J(M.DOWNVOTE),className:"flex items-center gap-1 px-2 py-1 rounded-md transition-colors disabled:opacity-50 ".concat(q(M.DOWNVOTE)?"bg-rose-100 dark:bg-rose-900 hover:bg-rose-200 dark:hover:bg-rose-800":"hover:bg-slate-100 dark:hover:bg-slate-700"),children:[(0,a.jsx)(d.A,{className:"h-5 w-5 ".concat(q(M.DOWNVOTE)?"text-rose-600 dark:text-rose-400":"text-slate-400 dark:text-slate-500")}),(0,a.jsx)("span",{className:"text-sm font-medium ".concat(q(M.DOWNVOTE)?"text-rose-700 dark:text-rose-300":"text-slate-700 dark:text-slate-300"),children:j.downVote})]})]}),(0,a.jsxs)("div",{className:"flex items-center gap-2 ml-4",children:[S("voteProductReview")&&(0,a.jsx)("button",{type:"button",disabled:!G,onClick:async()=>J(M.REPORT),className:"p-2 rounded-md transition-colors disabled:opacity-50 ".concat(q(M.REPORT)?"bg-orange-100 dark:bg-orange-900 hover:bg-orange-200 dark:hover:bg-orange-800":"hover:bg-slate-100 dark:hover:bg-slate-700"),title:"Report review",children:(0,a.jsx)(l.A,{className:c()("h-4 w-4",{"text-orange-600 dark:text-orange-400":q(M.REPORT),"text-slate-400 dark:text-slate-500":!q(M.REPORT)})})}),Q&&(0,a.jsx)(u.A,{onClick:()=>H(j._id),className:""}),j.deleted&&(0,a.jsx)(R.A,{text:_({id:"deleted_text",defaultMessage:"Deleted"}),color:"red",className:"ml-2"})]})]}),(0,a.jsxs)("div",{className:"mt-4 space-y-3",children:[(0,a.jsx)("h3",{className:"text-base font-semibold text-slate-900 dark:text-slate-100",children:j.title}),(0,a.jsx)("p",{className:"text-sm text-slate-700 dark:text-slate-300 leading-relaxed",children:j.review})]})]},j._id)}},27821:(e,t,r)=>{r.d(t,{A:()=>n});var a=r(37876),s=r(74418),d=r(15039),l=r.n(d);let n=e=>{let{className:t="",containerClassName:r="",Icon:d=null}=e;return(0,a.jsx)("span",{className:l()("text-slate-400",r),children:d||(0,a.jsx)(s.A,{className:l()(t)})})}},61835:(e,t,r)=>{r.d(t,{A:()=>o});var a=r(37876),s=r(15039),d=r.n(s),l=r(38168),n=r(68516);let o=e=>{let{options:t,...r}=(0,l.A)(e),{className:s}=e||{className:""};return(0,a.jsx)(n.A,{...r,children:(0,a.jsx)("div",{className:"select-wrap",children:(0,a.jsxs)("select",{className:d()("block w-full dark:bg-slate-900 dark:text-white rounded-md border-1 border-slate-300 dark:border-slate-700 py-2.5 pl-3 pr-10 text-base text-black shadow-xs focus:outline-hidden focus:ring-2 focus:ring-slate-800 sm:text-sm",s,{"border-rose-700 text-rose-600 dark:border-rose-500 dark:text-rose-400":!!r.error}),disabled:r.disabled,id:r.name,name:r.name,onChange:r.onChange,onBlur:r.onBlur,value:r.value,children:[(!!r.placeholder||!r.required)&&(0,a.jsx)("option",{className:"dark:text-slate-200",value:"",disabled:r.required,hidden:r.required,children:r.placeholder||r.label}),Object.entries(t).map(e=>{let[t,r]=e;return(0,a.jsx)("option",{className:"dark:text-slate-200",value:t,children:r},t)})]})})})}},70057:(e,t,r)=>{r.d(t,{A:()=>d});var a=r(96427);function s(){let e=(0,a._)(["\n fragment ProductReviewDetailFragment on ProductReview {\n _id\n created\n updated\n deleted\n author {\n _id\n username\n name\n profile {\n displayName\n address {\n firstName\n lastName\n }\n }\n isGuest\n avatar {\n _id\n\n url\n }\n }\n product {\n _id\n texts {\n _id\n title\n subtitle\n }\n media {\n _id\n file {\n _id\n url\n }\n }\n }\n rating\n title\n review\n upVote: voteCount(type: UPVOTE)\n downVote: voteCount(type: DOWNVOTE)\n voteReport: voteCount(type: REPORT)\n ownVotes {\n timestamp\n type\n }\n }\n"]);return s=function(){return e},e}let d=(0,r(79350).J1)(s())},92709:(e,t,r)=>{r.d(t,{A:()=>a});class a extends Error{constructor(e){super(e),this.name="CustomError"}}}}]);
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4525],{38824:(e,t,l)=>{l.d(t,{A:()=>a});var s=l(37876),n=l(33178);let a=e=>{let{onOkClick:t,buttonText:l,headerText:a,message:r,icon:d=null}=e;return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("div",{children:[d||(0,s.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,s.jsx)(n.A,{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,s.jsxs)("div",{className:"mt-3 text-center sm:mt-5",children:[(0,s.jsx)("h3",{className:"text-lg font-medium leading-6 text-slate-900 dark:text-slate-200",id:"modal-title",children:a}),(0,s.jsx)("div",{className:"mt-2",children:(0,s.jsx)("p",{className:"text-sm text-slate-500 dark:text-slate-200",children:r})})]})]}),(0,s.jsx)("div",{className:"mt-5 sm:mt-6",children:(0,s.jsx)("button",{id:"alert_ok",onClick:t,type:"button",className:"inline-flex w-full justify-center rounded-md border border-transparent bg-slate-800 dark:bg-slate-600 px-4 py-2 text-base font-medium text-white shadow-xs hover:bg-slate-950 dark:hover:bg-slate-500 focus:outline-hidden focus:ring-2 focus:ring-slate-800 dark:focus:ring-slate-400 focus:ring-offset-2 sm:text-sm",children:l})})]})}},44054:(e,t,l)=>{l.d(t,{A:()=>i});var s=l(96427),n=l(79350),a=l(54431);function r(){let e=(0,s._)(['\n query EnrollmentStatus {\n enrollmentStatusTypes: __type(name: "EnrollmentStatus") {\n options: enumValues {\n value: name\n label: description\n }\n }\n }\n']);return r=function(){return e},e}let d=(0,n.J1)(r()),i=()=>{var e;let{data:t,loading:l,error:s}=(0,a.IT)(d);return{enrollmentStatusTypes:(null==t||null==(e=t.enrollmentStatusTypes)?void 0:e.options)||[],loading:l,error:s}}},44525:(e,t,l)=>{l.r(t),l.d(t,{default:()=>G});var s=l(37876),n=l(77742),a=l(17703),r=l(13437),d=l(92797),i=l(48230),o=l.n(i),c=l(4301),u=l(17830),m=l(44054),x=l(58864),f=l(59335),g=l(46477),b=l(70874),h=l(50970),v=l(89452),p=l(78474),j=l(10561);let y=e=>{var t,l;let{periods:a}=e,{formatMessage:r}=(0,n.A)(),{formatDateTime:d}=(0,j.A)();return(0,s.jsx)("section",{className:"mt-3",children:(null==a?void 0:a.length)?(0,s.jsxs)(p.A,{className:"mt-0 min-w-full rounded-t-none",children:[null==(t=a||[])?void 0:t.map(e=>(0,s.jsxs)(p.A.Row,{className:"bg-white ",header:!0,children:[(0,s.jsx)(p.A.Cell,{children:r({id:"order",defaultMessage:"Order"})}),(0,s.jsx)(p.A.Cell,{className:"text-left",children:r({id:"start",defaultMessage:"Start"})}),(0,s.jsx)(p.A.Cell,{children:r({id:"end",defaultMessage:"End"})})]},"".concat(e.start).concat(e.end))),null==(l=a||[])?void 0:l.map(e=>{var t,l;return(0,s.jsxs)(p.A.Row,{children:[(0,s.jsx)(p.A.Cell,{children:(0,s.jsxs)("div",{className:"flex items-center text-sm text-slate-900",children:[(null==e||null==(t=e.order)?void 0:t.orderNumber)?null==e||null==(l=e.order)?void 0:l.orderNumber:"n/a",(null==e?void 0:e.isTrial)&&(0,s.jsx)(v.A,{text:r({id:"trial",defaultMessage:"Trial"}),color:"pink",className:"ml-2 rounded-full py-1 text-sm font-semibold leading-5",square:!0})]})}),(0,s.jsx)(p.A.Cell,{children:d(null==e?void 0:e.start,{dateStyle:"medium",timeStyle:"medium"})}),(0,s.jsx)(p.A.Cell,{children:d(null==e?void 0:e.end,{dateStyle:"medium",timeStyle:"medium"})})]},"".concat(e.start))})]}):(0,s.jsx)(h.A,{message:r({id:"subscription_message",defaultMessage:"Subscription"})})})};var N=l(93587),k=l(96427),A=l(79350),w=l(53588);function _(){let e=(0,k._)(["\n mutation ActivateEnrollment($enrollmentId: ID!) {\n activateEnrollment(enrollmentId: $enrollmentId) {\n _id\n }\n }\n"]);return _=function(){return e},e}let C=(0,A.J1)(_()),E=()=>{let[e]=(0,w.n)(C);return{activateEnrollment:async t=>{let{enrollmentId:l}=t;return e({variables:{enrollmentId:l},refetchQueries:["Enrollments","Enrollment"]})}}};var M=l(89819),S=l(38824);function T(){let e=(0,k._)(["\n mutation TerminateEnrollment($enrollmentId: ID!) {\n terminateEnrollment(enrollmentId: $enrollmentId) {\n _id\n }\n }\n"]);return T=function(){return e},e}let I=(0,A.J1)(T()),D=()=>{let[e]=(0,w.n)(I);return{terminateEnrollment:async t=>{let{enrollmentId:l}=t;return e({variables:{enrollmentId:l},refetchQueries:["Enrollments","Enrollment"]})}}};var P=l(82655),L=l(88943),q=l(16499);let R=e=>{var t,l,a,r;let{enrollment:d}=e,{formatMessage:i,locale:o}=(0,n.A)(),{formatDateTime:c}=(0,j.A)();return(0,s.jsxs)("section",{children:[(0,s.jsx)(q.A,{user:null==d?void 0:d.user,contact:null==d?void 0:d.contact}),(0,s.jsxs)("div",{className:"mt-2 flex border-b border-slate-300 dark:border-slate-800 pb-2 text-sm",children:[(0,s.jsxs)("dl",{className:"flex flex-wrap items-center gap-1",children:[(0,s.jsxs)("dt",{className:"hidden capitalize text-slate-500 sm:block",children:[i({id:"enrollment",defaultMessage:"enrollment"}),"# \xa0"]}),(0,s.jsxs)("dd",{className:"inline-flex text-lg font-medium text-slate-900 sm:flex-none sm:text-xl sm:font-bold",children:[(0,s.jsx)("span",{className:"sm:hidden",children:"#\xa0"}),(null==d?void 0:d.enrollmentNumber)?(0,s.jsx)(v.A,{color:"slate",text:null==d?void 0:d.enrollmentNumber,className:"p-0 text-lg font-medium sm:text-xl sm:font-bold"}):(0,s.jsx)(v.A,{text:i({id:"initial",defaultMessage:"Initial"}),color:"yellow",className:"p-0 text-lg font-medium sm:text-xl sm:font-bold"})]}),(0,s.jsx)("dt",{children:(0,s.jsx)("span",{className:"sr-only",children:i({id:"date",defaultMessage:"Date"})})}),(0,s.jsx)("dd",{className:"font-medium text-slate-900",children:(null==d?void 0:d.ordered)?c(null==d?void 0:d.ordered):null})]}),(0,s.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,s.jsx)("span",{children:null==d||null==(t=d.country)?void 0:t.flagEmoji}),(0,s.jsx)("span",{children:(0,g.t4)(o,null==d||null==(l=d.currency)?void 0:l.isoCode)}),(0,s.jsx)("span",{children:(null==d||null==(a=d.currency)?void 0:a.isoCode)&&(0,s.jsx)(v.A,{text:null==d||null==(r=d.currency)?void 0:r.isoCode,color:"amber",className:"px-2 py-0 sm:py-1",square:!0})})]})]})]})};var $=l(68526),F=l(59863);let J=e=>{var t,l,a,r,d,i,h,v,p,j,k,A,w,_,C,T,I,q,J,B,O,z,W,Q,U,V,G,H;let{enrollment:K}=e,{formatMessage:X}=(0,n.A)(),{setModal:Y}=(0,M.A)(),{enrollmentStatusTypes:Z}=(0,m.A)(),{activateEnrollment:ee}=E(),{terminateEnrollment:et}=D(),{sendEnrollmentEmail:el}=(0,P.A)();if(!K)return null;let es=async()=>{await Y((0,s.jsx)(S.A,{buttonText:X({id:"activate_button",defaultMessage:"Activate"}),headerText:X({id:"activate_header_title",defaultMessage:"Activate subscription."}),message:X({id:"activate_header_conformation",defaultMessage:"Are you sure you want to this subscription?"}),onOkClick:async()=>{Y(""),await ee({enrollmentId:null==K?void 0:K._id}),c.oR.success(X({id:"success_message",defaultMessage:"Subscription successfully activated."}))}}))},en=(0,s.jsx)("div",{className:"flex w-full items-center justify-center",children:(0,s.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,s.jsx)(u.A,{className:"h-6 w-6 text-slate-900 dark:text-blue-400","aria-hidden":"true"})})}),ea=async()=>{await Y((0,s.jsx)(S.A,{icon:en,buttonText:X({id:"send_button",defaultMessage:"Send"}),headerText:X({id:"send_activation_email_header",defaultMessage:"Send Email."}),message:X({id:"send_activation_email_confirm",defaultMessage:"Are you sure you want to send email?"}),onOkClick:async()=>{var e;Y("");let{data:t}=await el({email:null==K?void 0:K.contact.emailAddress});(null==t||null==(e=t.sendEnrollmentEmail)?void 0:e.success)?c.oR.success(X({id:"enrollment_success_message",defaultMessage:"Subscription activation email sent"})):c.oR.error(X({id:"terminate_enrollment_error",defaultMessage:"Failed when sending subscription activation email, please try again"}))}}))},er=async()=>{await Y((0,s.jsx)(L.A,{onCancelClick:async()=>Y(""),message:X({id:"terminate_enrollment_confirmation",defaultMessage:"Are you sure you want to terminate this subscription? "}),onOkClick:async()=>{Y(""),await et({enrollmentId:null==K?void 0:K._id}),c.oR.success(X({id:"terminate_enrollment_success",defaultMessage:"Subscription terminated successfully"}))},okText:X({id:"terminate_subscription",defaultMessage:"Terminate subscription"})}))},ed={INITIAL:{id:1,content:"created",visible:!0},ACTIVE:{id:2,content:"updated",visible:!0},PAUSED:{id:3,content:"updated",visible:!0,Component:(null==K?void 0:K.status)==="PAUSED"&&(0,s.jsx)(N.A,{text:X({id:"activate",defaultMessage:"Activate"}),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 dark:focus:border-slate-400 focus:outline-hidden focus:ring-0 focus:ring-slate-800 dark:focus:ring-slate-400"})},TERMINATED:{id:4,content:"updated",visible:!0,Component:(null==K?void 0:K.status)!=="TERMINATED"&&(0,s.jsx)(N.A,{text:X({id:"terminate_enrollment",defaultMessage:"Terminate Enrollment"}),onClick:er,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"})}},ei={header:(0,s.jsx)("span",{className:"flex",children:X({id:"periods",defaultMessage:"Periods"})}),body:(0,s.jsx)(y,{periods:null==K?void 0:K.periods})};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(R,{enrollment:K}),(0,s.jsx)(x.A,{data:K,statusTypes:Z,timeline:ed}),(0,s.jsx)("section",{className:"rounded-md border border-slate-300 bg-white",children:(0,s.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,s.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,s.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,s.jsxs)("div",{className:"flex flex-auto flex-col gap-y-8 pt-4 lg:col-span-6",children:[(0,s.jsx)("span",{className:"h relative h-48 w-full rounded-lg",children:(0,s.jsx)(F.A,{loader:b.A,src:null==K||null==(d=K.plan)||null==(r=d.product)||null==(a=r.media)||null==(l=a[0])||null==(t=l.file)?void 0:t.url,alt:null==K||null==(v=K.plan)||null==(h=v.product)||null==(i=h.texts)?void 0:i.title,layout:"fill",objectFit:"contain"})}),(0,s.jsxs)("div",{className:"flex flex-col",children:[(0,s.jsx)("dt",{className:"font-medium text-slate-900",children:X({id:"product_title",defaultMessage:"Product"})}),(0,s.jsx)("dd",{className:"my-2 text-sm text-slate-500",children:null==K?void 0:K.plan.product.texts.title}),(0,s.jsx)("dt",{className:"font-medium text-slate-900",children:X({id:"product_quantity",defaultMessage:"Quantity"})}),(0,s.jsx)("dd",{className:"my-2 text-sm text-slate-500",children:null==K||null==(p=K.plan)?void 0:p.quantity})]})]}),(0,s.jsx)("div",{className:"flex-auto border-t border-slate-300 dark:border-slate-800 pt-4 lg:col-span-6 lg:border-0",children:(0,s.jsx)($.A,{disabled:!0,className:"bg-white dark:bg-slate-900 dark:text-slate-200 mt-1 block w-full max-w-full rounded-md border-1 resize-none border-slate-300 dark:border-slate-800 shadow-xs sm:text-sm",value:JSON.stringify(((null==K?void 0:K.plan.configuration)||[]).map(e=>{let{__typename:t,...l}=e;return l}),null,2)})})]}),(0,s.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,s.jsxs)("div",{className:"border-t border-slate-300 dark:border-slate-800 pt-4",children:[(0,s.jsx)("dt",{className:"font-medium text-slate-900",children:X({id:"payment_provider",defaultMessage:"Payment provider"})}),(0,s.jsx)("dd",{className:"mt-2 text-sm text-slate-500",children:(0,s.jsx)(o(),{href:"/payment-provider?paymentProviderId=".concat(null==K||null==(k=K.payment)||null==(j=k.provider)?void 0:j._id),className:"text-slate-900 dark:text-slate-300",children:(0,g.SS)(null==K||null==(w=K.payment)||null==(A=w.provider)?void 0:A.interface)})})]}),(0,s.jsxs)("div",{className:"border-t border-slate-300 dark:border-slate-800 pt-4",children:[(0,s.jsx)("dt",{className:"font-medium text-slate-900",children:X({id:"delivery_provider",defaultMessage:"Delivery Provider"})}),(0,s.jsx)("dd",{className:"mt-2 text-sm text-slate-500",children:(0,s.jsx)(o(),{href:"/delivery-provider?deliveryProviderId=".concat(null==K||null==(_=K.delivery)?void 0:_.provider._id),className:"text-slate-900 dark:text-slate-300",children:(0,g.SS)(null==K||null==(T=K.delivery)||null==(C=T.provider)?void 0:C.interface)})})]}),(null==K?void 0:K.contact)&&(0,s.jsxs)("div",{className:"col-span-1 border-t border-slate-300 dark:border-slate-800 pt-4",children:[(0,s.jsx)("div",{className:"font-medium text-slate-900",children:X({id:"contact",defaultMessage:"Contact"})}),(0,s.jsx)("div",{className:"mt-2 text-sm text-slate-500",children:null==K||null==(I=K.contact)?void 0:I.telNumber}),(0,s.jsx)("div",{className:"mt-2 text-sm text-slate-500",children:null==K||null==(q=K.contact)?void 0:q.emailAddress}),(null==K||null==(J=K.contact)?void 0:J.emailAddress)&&(0,s.jsx)(N.A,{text:X({id:"send_email_button",defaultMessage:"Send Email"}),className:"px-2 py-1",onClick:ea})]})]}),(0,s.jsxs)("div",{className:"border-t border-slate-300 dark:border-slate-800 pt-4",children:[(0,s.jsx)("dt",{className:"font-medium text-slate-900",children:X({id:"billing_address",defaultMessage:"Billing address"})}),(0,s.jsxs)("dd",{className:"mt-2 text-sm text-slate-500",children:[null==K||null==(B=K.billingAddress)?void 0:B.firstName,"\xa0\xa0",null==K||null==(O=K.billingAddress)?void 0:O.lastName]}),(0,s.jsx)("dd",{className:"mt-2 text-sm text-slate-500",children:null==K||null==(z=K.billingAddress)?void 0:z.company}),(0,s.jsx)("dd",{className:"mt-2 text-sm text-slate-500",children:null==K||null==(W=K.billingAddress)?void 0:W.addressLine}),(0,s.jsx)("dd",{className:"mt-2 text-sm text-slate-500",children:null==K||null==(Q=K.billingAddress)?void 0:Q.addressLine2}),(0,s.jsx)("dd",{className:"mt-2 text-sm text-slate-500",children:null==K||null==(U=K.billingAddress)?void 0:U.postalCode}),(0,s.jsxs)("dd",{className:"mt-2 text-sm text-slate-500",children:[null==K||null==(V=K.billingAddress)?void 0:V.city,"\xa0\xa0",null==K||null==(G=K.billingAddress)?void 0:G.regionCode,"\xa0\xa0",null==K||null==(H=K.billingAddress)?void 0:H.countryCode]})]})]})})}),(0,s.jsx)(f.A,{data:[ei],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-slate-800 "})]})};var B=l(54431),O=l(66400);function z(){let e=(0,k._)(["\n fragment EnrollmentDetailFragment on Enrollment {\n _id\n country {\n _id\n isoCode\n }\n enrollmentNumber\n updated\n status\n created\n expires\n billingAddress {\n addressLine\n addressLine2\n city\n company\n countryCode\n firstName\n lastName\n postalCode\n regionCode\n }\n contact {\n emailAddress\n telNumber\n }\n currency {\n _id\n contractAddress\n decimals\n isActive\n isoCode\n }\n delivery {\n provider {\n _id\n configuration\n configurationError\n interface {\n _id\n label\n version\n }\n isActive\n\n simulatedPrice {\n amount\n currencyCode\n isNetPrice\n isTaxable\n }\n type\n }\n }\n payment {\n provider {\n _id\n configuration\n configurationError\n interface {\n _id\n label\n version\n }\n isActive\n type\n }\n }\n periods {\n end\n isTrial\n start\n order {\n _id\n }\n }\n\n isExpired\n periods {\n start\n end\n isTrial\n }\n plan {\n configuration {\n key\n value\n }\n product {\n _id\n texts {\n _id\n title\n }\n }\n quantity\n }\n user {\n _id\n username\n name\n avatar {\n _id\n url\n }\n }\n }\n"]);return z=function(){return e},e}let W=(0,A.J1)(z());function Q(){let e=(0,k._)(["\n query Enrollment($enrollmentId: ID!) {\n enrollment(enrollmentId: $enrollmentId) {\n ...EnrollmentDetailFragment\n ","\n\n }\n }\n ","\n"]);return Q=function(){return e},e}let U=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return(0,A.J1)(Q(),e,W)},V=e=>{let{enrollmentId:t=null}=e,{customProperties:l}=(0,O.A)(),{data:s,loading:n,error:a}=(0,B.IT)(U(null==l?void 0:l.Enrollment),{skip:!t,variables:{enrollmentId:t}});return{enrollment:null==s?void 0:s.enrollment,loading:n,error:a}},G=e=>{let{enrollmentId:t}=e,{formatMessage:l}=(0,n.A)(),{enrollment:i,loading:o}=V({enrollmentId:t});return(0,s.jsxs)("div",{className:"mt-5 max-w-full",children:[(0,s.jsx)(a.A,{currentPageTitle:(null==i?void 0:i.enrollmentNumber)?"#".concat(null==i?void 0:i.enrollmentNumber):""}),(0,s.jsx)("div",{className:"items-center flex min-w-full justify-between gap-3 flex-wrap",children:(0,s.jsx)(d.A,{headerText:l({id:"enrollment_detail",defaultMessage:"Enrollment Detail"}),title:l({id:"enrollment_detail_title",defaultMessage:"Enrollment {id}"},{id:null==i?void 0:i._id})})}),o?(0,s.jsx)(r.A,{}):(0,s.jsx)(J,{enrollment:i})]})}},59335:(e,t,l)=>{l.d(t,{A:()=>c});var s=l(37876),n=l(15039),a=l.n(n),r=l(22660),d=l(14397),i=l(14232);let o=e=>{let{header:t,body:l,headerCSS:n="",bodyCSS:o="",itemContainerCSS:c="",itemindex:u=1}=e,[m,x]=(0,i.useState)(!1);return(0,s.jsxs)("div",{className:a()("mt-3",c),"data-itemindex":u,children:[(0,s.jsxs)("button",{type:"button",onClick:()=>x(!m),className:a()("relative cursor-pointer border dark:border-slate-700 bg-white dark:bg-slate-900 text-slate-500 dark:text-slate-200 hover:bg-slate-50 dark:hover:bg-slate-700 w-full",n),children:[(0,s.jsx)("div",{className:"w-full",children:t}),(0,s.jsx)("span",{className:"px-2",children:m?(0,s.jsx)(r.A,{className:"h-6 w-6",fill:"none",viewBox:"0 0 24 24",strokeWidth:2}):(0,s.jsx)(d.A,{className:"h-6 w-6",fill:"none",viewBox:"0 0 24 24",strokeWidth:2})})]}),m?(0,s.jsx)("div",{className:a()("rounded-lg p-0 text-slate-400 dark:text-slate-200 ",o),children:l}):""]})},c=e=>{let{data:t,containerCSS:l="",headerCSS:n="",bodyCSS:r="",itemContainerCSS:d="",...i}=e;return(0,s.jsx)("div",{className:a()("my-3",l),...i,children:t.map((e,t)=>{let{header:l,body:a}=e;return(0,s.jsx)(o,{itemindex:t,header:l,body:a,headerCSS:n,bodyCSS:r,itemContainerCSS:d},t)})})}},68526:(e,t,l)=>{l.d(t,{A:()=>r});var s=l(37876),n=l(15039),a=l.n(n);let r=e=>{var t;let{value:l,className:n,onChange:r=()=>{},...d}=e;return(0,s.jsx)("textarea",{className:a()("text-black dark:bg-slate-900 dark:text-slate-200 border-transparent border-t border-t-slate-200 dark:border-t-slate-800",n),value:l,onChange:r,rows:Math.max(((null==(t=l||" ")?void 0:t.split(" "))||[]).length/2,7),...d})}},82655:(e,t,l)=>{l.d(t,{A:()=>i});var s=l(96427),n=l(79350),a=l(53588);function r(){let e=(0,s._)(["\n mutation SendEnrollmentEmail($email: String!) {\n sendEnrollmentEmail(email: $email) {\n success\n }\n }\n"]);return r=function(){return e},e}let d=(0,n.J1)(r()),i=()=>{let[e]=(0,a.n)(d);return{sendEnrollmentEmail:async t=>{let{email:l}=t;return e({variables:{email:l}})}}}},88943:(e,t,l)=>{l.d(t,{A:()=>a});var s=l(37876),n=l(77742);let a=e=>{let{onOkClick:t,onCancelClick:l,okText:a=null,cancelText:r=null,headerText:d=null,message:i=null,icon:o=null,close:c=null}=e,{formatMessage:u}=(0,n.A)();return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("div",{className:"sm:flex sm:items-start",children:[o||(0,s.jsx)("div",{className:"mx-auto flex h-12 w-12 shrink-0 items-center justify-center rounded-full bg-rose-100 dark:bg-rose-900/30 sm:mx-0 sm:h-10 sm:w-10",children:(0,s.jsx)("svg",{className:"h-6 w-6 text-rose-600 dark:text-rose-400",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","aria-hidden":"true",children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"})})}),(0,s.jsxs)("div",{className:"mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left",children:[(0,s.jsx)("h3",{className:"text-lg font-medium leading-6 text-slate-900 dark:text-slate-200",id:"modal-title",children:d||u({id:"warning",defaultMessage:"Warning!"})}),(0,s.jsx)("div",{className:"mt-2",children:(0,s.jsx)("p",{className:"text-sm text-slate-500 dark:text-slate-200",children:i||u({id:"are_you_sure",defaultMessage:"Are you sure?"})})})]})]}),(0,s.jsxs)("div",{className:"mt-5 sm:mt-4 sm:flex sm:flex-row-reverse",children:[(0,s.jsx)("button",{id:"danger_continue",onClick:t,type:"button",className:"inline-flex w-full justify-center rounded-md border border-transparent bg-rose-600 px-4 py-2 text-base font-medium text-white shadow-xs hover:bg-rose-700 focus:outline-hidden focus:ring-2 focus:ring-rose-500 focus:ring-offset-2 sm:ml-3 sm:w-auto sm:text-sm",children:a||u({id:"continue",defaultMessage:"Continue"})}),(0,s.jsx)("button",{id:"danger_cancel",onClick:l||c,type:"button",className:"mt-3 inline-flex w-full justify-center rounded-md border border-slate-300 bg-white px-4 py-2 text-base font-medium text-slate-700 shadow-xs hover:bg-slate-50 focus:outline-hidden focus:ring-2 focus:ring-slate-800 focus:ring-offset-2 sm:mt-0 sm:ml-3 sm:w-auto sm:text-sm",children:r||u({id:"cancel",defaultMessage:"Cancel"})})]})]})}},93587:(e,t,l)=>{l.d(t,{A:()=>r});var s=l(37876),n=l(15039),a=l.n(n);let r=e=>{let{text:t,onClick:l,className:n="",disabled:r=!1,id:d="",variant:i="primary"}=e;return(0,s.jsx)("button",{id:d,type:"button",disabled:r,onClick:l,className:a()("inline-flex items-center rounded-md text-sm font-medium shadow-md focus:outline-hidden focus:ring-2 focus:ring-offset-2 px-6 py-2 leading-5 h-[38px]",{primary:"border border-slate-800 dark:border-slate-600 bg-slate-800 dark:bg-slate-600 text-white hover:bg-slate-950 dark:hover:bg-slate-500 focus:ring-slate-800 dark:focus:ring-slate-400",secondary:"border border-slate-600 dark:border-slate-600 bg-white dark:bg-slate-800 text-slate-700 dark:text-slate-200 hover:bg-slate-50 dark:hover:bg-slate-700 focus:ring-slate-500",tertiary:"border border-slate-300 dark:border-slate-600 bg-white dark:bg-slate-800 text-slate-700 dark:text-slate-200 hover:bg-slate-50 dark:hover:bg-slate-700 focus:ring-slate-500 shadow-xs",quaternary:"bg-white dark:bg-slate-800 text-slate-700 dark:text-slate-200 hover:bg-slate-50 dark:hover:bg-slate-700 focus:ring-2"}[i],n),children:(0,s.jsx)("span",{children:t})})}}}]);
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3386,4574,5702],{2606:(e,t,r)=>{r.d(t,{A:()=>o});var n=r(14232);let o=n.forwardRef(function(e,t){let{title:r,titleId:o,...a}=e;return n.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:t,"aria-labelledby":o},a),r?n.createElement("title",{id:o},r):null,n.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 12.75 11.25 15 15 9.75M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z"}))})},7527:(e,t,r)=>{r.d(t,{A:()=>o});var n=r(14232);let o=n.forwardRef(function(e,t){let{title:r,titleId:o,...a}=e;return n.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:t,"aria-labelledby":o},a),r?n.createElement("title",{id:o},r):null,n.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M18.364 18.364A9 9 0 0 0 5.636 5.636m12.728 12.728A9 9 0 0 1 5.636 5.636m12.728 12.728L5.636 5.636"}))})},8733:(e,t,r)=>{r.d(t,{A:()=>u});var n=r(4902),o=r(14232),a=r(37154),i=r(77742);function l(e){var t=(0,i.A)(),r=t.formatMessage,n=t.textComponent,a=void 0===n?o.Fragment:n,l=e.id,s=e.description,u=e.defaultMessage,d=e.values,c=e.children,f=e.tagName,m=void 0===f?a:f,v=r({id:l,description:s,defaultMessage:u},d,{ignoreTag:e.ignoreTag});return"function"==typeof c?c(Array.isArray(v)?v:[v]):m?o.createElement(m,null,v):o.createElement(o.Fragment,null,v)}l.displayName="FormattedMessage";var s=o.memo(l,function(e,t){var r=e.values,o=(0,n.__rest)(e,["values"]),i=t.values,l=(0,n.__rest)(t,["values"]);return(0,a.bN)(i,r)&&(0,a.bN)(o,l)});s.displayName="MemoizedFormattedMessage";let u=s},14397:(e,t,r)=>{r.d(t,{A:()=>o});var n=r(14232);let o=n.forwardRef(function(e,t){let{title:r,titleId:o,...a}=e;return n.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:t,"aria-labelledby":o},a),r?n.createElement("title",{id:o},r):null,n.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m19.5 8.25-7.5 7.5-7.5-7.5"}))})},15506:(e,t,r)=>{r.d(t,{A:()=>o});var n=r(14232);let o=n.forwardRef(function(e,t){let{title:r,titleId:o,...a}=e;return n.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:t,"aria-labelledby":o},a),r?n.createElement("title",{id:o},r):null,n.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m9.75 9.75 4.5 4.5m0-4.5-4.5 4.5M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z"}))})},21671:(e,t,r)=>{r.d(t,{A:()=>o});var n=r(14232);let o=n.forwardRef(function(e,t){let{title:r,titleId:o,...a}=e;return n.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:t,"aria-labelledby":o},a),r?n.createElement("title",{id:o},r):null,n.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18 18 6M6 6l12 12"}))})},22660:(e,t,r)=>{r.d(t,{A:()=>o});var n=r(14232);let o=n.forwardRef(function(e,t){let{title:r,titleId:o,...a}=e;return n.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:t,"aria-labelledby":o},a),r?n.createElement("title",{id:o},r):null,n.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m4.5 15.75 7.5-7.5 7.5 7.5"}))})},33162:(e,t,r)=>{r.d(t,{w:()=>o});var n=r(86994);function o(e,t){return"function"==typeof e?e(t):e&&"object"==typeof e&&n._P in e?e[n._P](t):e instanceof Date?new e.constructor(t):new Date(t)}},33178:(e,t,r)=>{r.d(t,{A:()=>o});var n=r(14232);let o=n.forwardRef(function(e,t){let{title:r,titleId:o,...a}=e;return n.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:t,"aria-labelledby":o},a),r?n.createElement("title",{id:o},r):null,n.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m4.5 12.75 6 6 9-13.5"}))})},37180:(e,t,r)=>{r.d(t,{o:()=>o});var n=r(70568);function o(e,t){let r=(0,n.a)(e,null==t?void 0:t.in);return r.setHours(0,0,0,0),r}},53588:(e,t,r)=>{r.d(t,{n:()=>c});var n=r(4902),o=r(60427),a=r(18877),i=r(20996),l=r(37510),s=r(83070),u=r(67994),d=r(80542).Sw?o.useLayoutEffect:o.useEffect;function c(e,t){var r=(0,u.m)(null==t?void 0:t.client);(0,l.D$)(e,l.KG.Mutation);var c=o.useState({called:!1,loading:!1,client:r}),f=c[0],m=c[1],v=o.useRef({result:f,mutationId:0,isMounted:!0,client:r,mutation:e,options:t});d(function(){Object.assign(v.current,{client:r,options:t,mutation:e})});var g=o.useCallback(function(e){void 0===e&&(e={});var t=v.current,r=t.options,o=t.mutation,l=(0,n.__assign)((0,n.__assign)({},r),{mutation:o}),u=e.client||v.current.client;v.current.result.loading||l.ignoreResults||!v.current.isMounted||m(v.current.result={loading:!0,error:void 0,data:void 0,called:!0,client:u});var d=++v.current.mutationId,c=(0,a.l)(l,e);return u.mutate(c).then(function(t){var r,n,o=t.data,a=t.errors,l=a&&a.length>0?new s.K4({graphQLErrors:a}):void 0,f=e.onError||(null==(r=v.current.options)?void 0:r.onError);if(l&&f&&f(l,c),d===v.current.mutationId&&!c.ignoreResults){var g={called:!0,loading:!1,data:o,error:l,client:u};v.current.isMounted&&!(0,i.L)(v.current.result,g)&&m(v.current.result=g)}var w=e.onCompleted||(null==(n=v.current.options)?void 0:n.onCompleted);return l||null==w||w(t.data,c),t},function(t){if(d===v.current.mutationId&&v.current.isMounted){var r,n={loading:!1,error:t,data:void 0,called:!0,client:u};(0,i.L)(v.current.result,n)||m(v.current.result=n)}var o=e.onError||(null==(r=v.current.options)?void 0:r.onError);if(o)return o(t,c),{data:void 0,errors:t};throw t})},[]),w=o.useCallback(function(){if(v.current.isMounted){var e={called:!1,loading:!1,client:v.current.client};Object.assign(v.current,{mutationId:0,result:e}),m(e)}},[]);return o.useEffect(function(){var e=v.current;return e.isMounted=!0,function(){e.isMounted=!1}},[]),[g,(0,n.__assign)({reset:w},f)]}},62852:(e,t,r)=>{r.d(t,{f:()=>o});var n=r(70568);function o(e){return!(!(e instanceof Date||"object"==typeof e&&"[object Date]"===Object.prototype.toString.call(e))&&"number"!=typeof e||isNaN(+(0,n.a)(e)))}},70568:(e,t,r)=>{r.d(t,{a:()=>o});var n=r(33162);function o(e,t){return(0,n.w)(t||e,e)}},76442:(e,t,r)=>{r.d(t,{A:()=>o});var n=r(14232);let o=n.forwardRef(function(e,t){let{title:r,titleId:o,...a}=e;return n.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:t,"aria-labelledby":o},a),r?n.createElement("title",{id:o},r):null,n.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M10.5 1.5H8.25A2.25 2.25 0 0 0 6 3.75v16.5a2.25 2.25 0 0 0 2.25 2.25h7.5A2.25 2.25 0 0 0 18 20.25V3.75a2.25 2.25 0 0 0-2.25-2.25H13.5m-3 0V3h3V1.5m-3 0h3m-3 18.75h3"}))})},83992:(e,t,r)=>{r.d(t,{A:()=>o});var n=r(14232);let o=n.forwardRef(function(e,t){let{title:r,titleId:o,...a}=e;return n.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:t,"aria-labelledby":o},a),r?n.createElement("title",{id:o},r):null,n.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 4.5v15m7.5-7.5h-15"}))})},86994:(e,t,r)=>{r.d(t,{Cg:()=>a,F6:()=>s,Ks:()=>i,Nw:()=>l,_P:()=>u,my:()=>n,w4:()=>o});let n=6048e5,o=864e5,a=6e4,i=525600,l=43200,s=1440,u=Symbol.for("constructDateFrom")}}]);
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5145],{1906:(e,t,a)=>{a.d(t,{A:()=>o});var l=a(37876),r=a(14232),n=a(17521);let s=e=>()=>{let t=document.getElementById(e);t&&t.focus()},d=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return Object.fromEntries(Object.entries(e).reduce(function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],[a,l]=arguments.length>1?arguments[1]:void 0;return"string"==typeof l||r.isValidElement(l)?[...e,["".concat(t).concat(a),l]]:[...Object.entries(d(Object.assign({},...l),"".concat(t).concat(a,"."))),...e]},[]))},i=e=>{let{submitError:t="",fieldErrors:a=[]}=e;return(0,l.jsx)("div",{className:"mx-6 mb-5 text-rose-700",children:(0,l.jsxs)("ul",{className:"space-y-1",children:[t&&(0,l.jsx)("li",{className:"disabled",children:(0,l.jsx)("span",{dangerouslySetInnerHTML:{__html:t}})},"submitError"),Object.entries(d(a)).map(e=>{let[t,a]=e;return(0,l.jsx)("li",{className:"disabled",children:(0,l.jsx)("button",{type:"button",className:"no-button text-rose-600 dark:text-rose-400","aria-label":"Error button",onClick:s(t),children:r.isValidElement(a)?a:(0,l.jsx)("span",{dangerouslySetInnerHTML:{__html:a}})})},t)})]})})},o=e=>{let{displayFieldErrors:t=!1}=e,{submitError:a,formik:r}=(0,n.A)(),s=null==r?void 0:r.errors;return(a||t)&&(0,l.jsx)(i,{submitError:a,fieldErrors:t&&s})}},13150:(e,t,a)=>{a.d(t,{Ay:()=>n,dF:()=>r,id:()=>l});let l=e=>{if(!e)return null;let t=null==e?void 0:e.split("_id_");return null==t?void 0:t.pop()},r=e=>{if(!e)return null;let[t]=(null==e?void 0:e.split("_id_"))||[];return t},n=e=>{var t;let{_id:a,texts:l}=e;return"".concat(null==l||null==(t=l.slug)?void 0:t.split("/").join(""),"_id_").concat(a)}},16615:(e,t,a)=>{a.d(t,{A:()=>r});var l=void 0;let r=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:500;return t=>{let a;return function(){for(var r=arguments.length,n=Array(r),s=0;s<r;s++)n[s]=arguments[s];clearTimeout(a),a=setTimeout(()=>t.apply(l,n),e)}}}},32271:(e,t,a)=>{a.d(t,{A:()=>u});var l=a(37876),r=a(14232),n=a(15039),s=a.n(n),d=a(77742),i=a(89452),o=a(93587);let c=e=>{if(e){var t,a;return Array.isArray(e)?e:null==(a=e.toString())||null==(t=a.split(","))?void 0:t.map(e=>e.trim())}return[]},u=e=>{let{tagList:t,onChange:a,buttonText:n="",disabled:u=!1,name:m="tag-input",id:p="tag-input",className:x="",placeholder:g=""}=e,{formatMessage:f}=(0,d.A)(),[h,b]=(0,r.useState)(c(t)),[v,j]=(0,r.useState)(""),A=e=>{let t=h.indexOf(e);if(-1!==t){let e=[...h];e.splice(t,1),a(e),b(e)}},k=()=>{if(!h.includes(v)&&v){let e=[...h,v];b(e),a(e),j("")}};return(0,r.useMemo)(()=>{b(c(t))},[t]),(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)("div",{className:"flex items-center h-11 max-w-full gap-2",children:[(0,l.jsx)("div",{className:"relative flex grow items-stretch focus-within:z-10",children:(0,l.jsx)("input",{type:"text",id:p||m,name:m,onKeyUp:e=>{e.stopPropagation(),e.preventDefault(),"Enter"===e.key&&k()},onKeyDown:e=>{e.stopPropagation(),"Enter"===e.key&&e.preventDefault()},onChange:e=>j(e.target.value),className:s()("block w-full rounded-md border-1 border-slate-300 dark:border-slate-700 text-slate-900 dark:bg-slate-900 dark:text-slate-200 py-3 px-4 shadow-xs placeholder:text-slate-400 dark:placeholder:text-slate-400 focus:ring-2 focus:ring-slate-800 focus:outline-hidden sm:text-sm",x),placeholder:g,value:v,disabled:u,autoComplete:"off"})}),(0,l.jsx)(o.A,{id:"add-tag",onClick:k,className:"py-5.5",variant:"tertiary",text:n||f({id:"add_tag",defaultMessage:"Add tag"})})]}),(0,l.jsx)("div",{className:s()("flex items-center flex-wrap gap-5",h.length>0&&"mt-4"),children:null==h?void 0:h.map(e=>(0,l.jsx)(i.A,{text:e,color:"slate",onClick:()=>A(e)},e))})]})}},48124:(e,t,a)=>{a.d(t,{A:()=>i});var l=a(37876),r=a(15039),n=a.n(r),s=a(77742),d=a(76309);let i=e=>{let{cancelText:t=null,showCancel:a=!0,submitText:r=null,showSubmit:i=!0,onCancel:o,className:c=""}=e,{formatMessage:u}=(0,s.A)();return(0,l.jsxs)("span",{className:n()("flex shrink-0 items-center space-x-4 py-5 pl-1",c),children:[a?(0,l.jsx)("button",{onClick:o,"data-id":"cancel_update",type:"button",className:n()("focus:ring-slate-800","inline-flex items-center rounded-md border border-slate-300 dark:border-slate-700 bg-white dark:bg-slate-800 px-4 py-2 text-sm font-medium text-slate-700 dark:text-slate-300 shadow-xs hover:bg-slate-50 dark:hover:bg-slate-700 focus:outline-hidden focus:ring-2 focus:ring-slate-800 focus:ring-offset-2"),children:t||u({id:"cancel",defaultMessage:"Cancel"})}):null,i?(0,l.jsx)(d.A,{label:r||u({id:"save",defaultMessage:"Save"})}):null]})}},53074:(e,t,a)=>{a.d(t,{A:()=>m});var l=a(37876),r=a(77742),n=a(89819),s=a(89452),d=a(79027),i=a(71063),o=a(72460),c=a(48124);let u=e=>{let{tags:t,onSubmit:a,onCancel:n}=e,{formatMessage:s}=(0,r.A)(),u=s({id:"tags_updated",defaultMessage:"Tags updated successfully"}),m=(0,o.A)({submit:a,successMessage:u,onSubmitSuccess:n,initialValues:{tags:t}});return(0,l.jsxs)(d.A,{form:m,id:"add_tag_form",children:[(0,l.jsx)("div",{children:(0,l.jsx)(i.A,{name:"tags",id:"tags",label:s({id:"tags",defaultMessage:"Tags"}),tagList:t})}),(0,l.jsx)("div",{className:"border border-t-slate-100 bg-slate-50 mt-6 -mx-6 -mb-6 px-6 dark:bg-slate-900 dark:border-0",children:(0,l.jsx)(c.A,{onCancel:n,className:"justify-end "})})]})},m=e=>{let{defaultValue:t,onSubmit:a,enableEdit:d}=e,{formatMessage:i}=(0,r.A)(),{setModal:o}=(0,n.A)();return(0,l.jsxs)("div",{className:"flex items-center mr-auto gap-2",children:[(0,l.jsx)("div",{className:"flex flex-wrap items-center gap-2",children:(null==t?void 0:t.length)?t.map((e,t)=>(0,l.jsx)("span",{children:(0,l.jsx)(s.A,{text:e,color:"slate"})},"".concat(e).concat(t+1))):(0,l.jsx)("span",{children:(0,l.jsx)(s.A,{text:i({id:"no_tag",defaultMessage:"No Tag"}),color:"slate"})})}),d&&(0,l.jsx)("button",{id:"add_tag",type:"button",className:"rounded-sm hover:shadow-sm px-3 py-2 text-xs inline-flex items-center justify-center text-slate-800 hover:text-slate-900 hover:bg-slate-50 hover:border border-transparent border-1 hover:border-slate-300 dark:text-slate-400 dark:hover:text-slate-200 dark:hover:bg-slate-800 transition-colors focus:outline-hidden focus:ring-2 focus:ring-slate-800",onClick:()=>o((0,l.jsx)(u,{tags:t||[],onCancel:()=>o(""),onSubmit:a})),children:i({id:"edit_tags",defaultMessage:"Edit tags"})})]})}},60968:(e,t,a)=>{a.d(t,{A:()=>b});var l=a(37876),r=a(15039),n=a.n(r),s=a(77742),d=a(65209),i=a(14647),o=a(14741),c=a(67688),u=a(87979),m=a(22266),p=a(59455),x=a(38168),g=a(68516),f=a(6388);let h=e=>{let{selectedView:t="edit",...a}=e;return"preview"===t?(0,l.jsx)("div",{className:"prose dark:prose-invert",children:(0,l.jsx)(o.oz,{rehypePlugins:[c.A,u.A,m.A],children:a.value})}):(0,l.jsx)("textarea",{className:n()("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-slate-300 dark:border-slate-700 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-slate-800",a.className,{"border-rose-700 placeholder:text-rose-300 placeholder-rose-300":!!a.error}),disabled:a.disabled,id:a.name,name:a.name,rows:a.rows||10,onChange:a.onChange,onBlur:a.onBlur,placeholder:a.placeholder,autoComplete:a.autoComplete||"off",value:a.value})},b=e=>{let{maxLength:t,validators:a=[],...r}=e,{formatMessage:n}=(0,s.A)(),o=(0,x.A)({validators:[...a,t&&(0,p.Rr)(t)],...r}),c=[{id:"editor",title:n({id:"editor",defaultMessage:"Editor"}),Icon:(0,l.jsx)(d.A,{className:"h-4 w-5"})},{id:"preview",title:n({id:"preview",defaultMessage:"preview"}),Icon:(0,l.jsx)(i.A,{className:"h-4 w-5"})}];return(0,l.jsx)(g.A,{...o,children:(0,l.jsx)(f.A,{tabItems:c,defaultTab:"editor",children:(0,l.jsx)(h,{...o})})})}},61347:(e,t,a)=>{a.d(t,{A:()=>l});let l=async(e,t)=>{let a=await fetch(t,{method:"PUT",body:e});return a.ok?Promise.resolve({}):Promise.reject(Error(a.statusText))}},70935:(e,t,a)=>{a.d(t,{A:()=>i});var l=a(96427),r=a(79350),n=a(53588);function s(){let e=(0,l._)(["\n mutation ConfirmMediaUpload(\n $mediaUploadTicketId: ID!\n $size: Int!\n $type: String!\n ) {\n confirmMediaUpload(\n mediaUploadTicketId: $mediaUploadTicketId\n size: $size\n type: $type\n ) {\n _id\n name\n type\n size\n url\n }\n }\n"]);return s=function(){return e},e}let d=(0,r.J1)(s()),i=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},[t]=(0,n.n)(d,e);return{confirmMediaUpload:async e=>{let{mediaUploadTicketId:a,size:l,type:r}=e;return t({variables:{mediaUploadTicketId:a,size:l,type:r}})}}}},71063:(e,t,a)=>{a.d(t,{A:()=>c});var l=a(37876),r=a(15039),n=a.n(r),s=a(32271),d=a(38168),i=a(59455),o=a(68516);let c=e=>{let{buttonText:t="",validators:a=[],...r}=e,c=(0,d.A)({validators:[...a,(0,i.mX)(null==r?void 0:r.required)],label:"Tags",...r});return(0,l.jsx)(o.A,{...c,children:(0,l.jsx)(s.A,{disabled:c.disabled,id:c.id,name:c.name,className:n()({"border-rose-300":!!c.error}),onChange:e=>c.setValue(e),placeholder:c.placeholder,tagList:c.value,buttonText:t})})}},94783:(e,t,a)=>{a.d(t,{A:()=>n});var l=a(96427);function r(){let e=(0,l._)(["\n fragment ProductBriefFragment on Product {\n texts {\n _id\n slug\n title\n subtitle\n description\n vendor\n brand\n labels\n }\n _id\n sequence\n status\n tags\n sequence\n updated\n published\n media {\n _id\n tags\n file {\n _id\n url\n }\n }\n ... on SimpleProduct {\n catalogPrice {\n amount\n currencyCode\n }\n }\n ... on PlanProduct {\n catalogPrice {\n amount\n currencyCode\n }\n }\n }\n"]);return r=function(){return e},e}let n=(0,a(79350).J1)(r())}}]);