@ozdao/prometheus-framework 0.2.188 → 0.2.189

Sign up to get free protection for your applications and to get access to all the features.
Files changed (298) hide show
  1. package/dist/builder.js +6 -3
  2. package/dist/builder.mjs +6 -3
  3. package/dist/node_modules/@unhead/vue/dist/shared/vue.cf295fb1.cjs +1 -0
  4. package/dist/node_modules/@unhead/vue/dist/shared/vue.cf295fb1.js +26 -0
  5. package/dist/node_modules/@unhead/vue/dist/shared/vue.f36acd1f.cjs +1 -0
  6. package/dist/node_modules/@unhead/vue/dist/shared/vue.f36acd1f.js +26 -0
  7. package/dist/node_modules/unhead/dist/index.cjs +1 -0
  8. package/dist/node_modules/unhead/dist/index.js +7 -0
  9. package/dist/prometheus-framework/src/components/Feed/Feed.vue.cjs +1 -1
  10. package/dist/prometheus-framework/src/components/Feed/Feed.vue.js +5 -5
  11. package/dist/prometheus-framework/src/modules/auth/views/components/pages/EnterCode.vue.cjs +1 -1
  12. package/dist/prometheus-framework/src/modules/auth/views/components/pages/EnterCode.vue.js +1 -1
  13. package/dist/prometheus-framework/src/modules/auth/views/store/auth.cjs +1 -1
  14. package/dist/prometheus-framework/src/modules/auth/views/store/auth.js +1 -1
  15. package/dist/prometheus-framework/src/modules/auth/views/store/twofa.cjs +1 -1
  16. package/dist/prometheus-framework/src/modules/auth/views/store/twofa.js +1 -1
  17. package/dist/prometheus-framework/src/modules/community/components/blocks/CardBlogpost.vue.cjs +1 -1
  18. package/dist/prometheus-framework/src/modules/community/components/blocks/CardBlogpost.vue.js +1 -1
  19. package/dist/prometheus-framework/src/modules/community/components/pages/BlogPost.vue.cjs +1 -1
  20. package/dist/prometheus-framework/src/modules/community/components/pages/BlogPost.vue.js +73 -42
  21. package/dist/prometheus-framework/src/modules/community/components/sections/Comment.vue.cjs +1 -1
  22. package/dist/prometheus-framework/src/modules/community/components/sections/Comment.vue.js +1 -1
  23. package/dist/prometheus-framework/src/modules/community/store/blogposts.cjs +1 -1
  24. package/dist/prometheus-framework/src/modules/community/store/blogposts.js +1 -1
  25. package/dist/prometheus-framework/src/modules/community/store/reactions.cjs +1 -1
  26. package/dist/prometheus-framework/src/modules/community/store/reactions.js +1 -1
  27. package/dist/prometheus-framework/src/modules/events/components/blocks/CardEvent.vue.cjs +1 -1
  28. package/dist/prometheus-framework/src/modules/events/components/blocks/CardEvent.vue.js +1 -1
  29. package/dist/prometheus-framework/src/modules/events/store/events.cjs +1 -1
  30. package/dist/prometheus-framework/src/modules/events/store/events.js +1 -1
  31. package/dist/prometheus-framework/src/modules/events/store/tickets.cjs +1 -1
  32. package/dist/prometheus-framework/src/modules/events/store/tickets.js +1 -1
  33. package/dist/prometheus-framework/src/modules/gallery/components/pages/Gallery.vue.cjs +1 -1
  34. package/dist/prometheus-framework/src/modules/gallery/components/pages/Gallery.vue.js +1 -1
  35. package/dist/prometheus-framework/src/modules/gallery/components/sections/BackofficeGallery.vue.cjs +1 -1
  36. package/dist/prometheus-framework/src/modules/gallery/components/sections/BackofficeGallery.vue.js +2 -2
  37. package/dist/prometheus-framework/src/modules/gallery/store/gallery.cjs +1 -1
  38. package/dist/prometheus-framework/src/modules/gallery/store/gallery.js +1 -1
  39. package/dist/prometheus-framework/src/modules/globals/globals.client.cjs +1 -1
  40. package/dist/prometheus-framework/src/modules/globals/globals.client.js +34 -10
  41. package/dist/prometheus-framework/src/modules/globals/views/classes/globals.store.cjs +1 -0
  42. package/dist/prometheus-framework/src/modules/globals/views/classes/globals.store.js +72 -0
  43. package/dist/prometheus-framework/src/modules/globals/views/components/blocks/BlockFilter.vue.cjs +1 -0
  44. package/dist/prometheus-framework/src/modules/globals/views/components/blocks/BlockFilter.vue.js +57 -0
  45. package/dist/prometheus-framework/src/modules/globals/views/components/blocks/BlockSearch.vue.cjs +1 -0
  46. package/dist/prometheus-framework/src/modules/globals/views/components/blocks/BlockSearch.vue.js +35 -0
  47. package/dist/prometheus-framework/src/modules/globals/views/components/blocks/BlockSorting.vue.cjs +1 -0
  48. package/dist/prometheus-framework/src/modules/globals/views/components/blocks/BlockSorting.vue.js +75 -0
  49. package/dist/prometheus-framework/src/modules/globals/views/components/blocks/CardHeader.vue.cjs +1 -0
  50. package/dist/prometheus-framework/src/modules/globals/views/components/blocks/CardHeader.vue.js +194 -0
  51. package/dist/prometheus-framework/src/modules/globals/views/components/elements/ButtonDate.vue.cjs +1 -0
  52. package/dist/prometheus-framework/src/modules/globals/views/components/elements/ButtonDate.vue.js +38 -0
  53. package/dist/prometheus-framework/src/modules/globals/views/components/elements/ButtonSort.vue.cjs +1 -0
  54. package/dist/prometheus-framework/src/modules/globals/views/components/elements/ButtonSort.vue.js +31 -0
  55. package/dist/prometheus-framework/src/modules/globals/views/components/layouts/App.vue.cjs +1 -0
  56. package/dist/prometheus-framework/src/modules/globals/views/components/layouts/App.vue.js +66 -0
  57. package/dist/prometheus-framework/src/modules/globals/views/components/layouts/Empty.vue.cjs +1 -0
  58. package/dist/prometheus-framework/src/modules/globals/views/components/layouts/Empty.vue.js +16 -0
  59. package/dist/prometheus-framework/src/modules/globals/views/components/sections/SectionPageTitle.vue.cjs +1 -0
  60. package/dist/prometheus-framework/src/modules/globals/views/components/sections/SectionPageTitle.vue.js +54 -0
  61. package/dist/prometheus-framework/src/modules/globals/views/localization/get-browser-locale.cjs +1 -0
  62. package/dist/prometheus-framework/src/modules/globals/views/localization/get-browser-locale.js +7 -0
  63. package/dist/prometheus-framework/src/modules/globals/views/mixins/mixins.cjs +1 -0
  64. package/dist/prometheus-framework/src/modules/globals/views/mixins/mixins.js +47 -0
  65. package/dist/prometheus-framework/src/modules/globals/views/router/scrollBehavior.cjs +1 -0
  66. package/dist/prometheus-framework/src/modules/globals/views/router/scrollBehavior.js +18 -0
  67. package/dist/prometheus-framework/src/modules/globals/views/store/globals.cjs +1 -0
  68. package/dist/prometheus-framework/src/modules/globals/views/store/globals.js +83 -0
  69. package/dist/prometheus-framework/src/modules/landing/components/sections/SubscribeNewsletter.vue.cjs +1 -1
  70. package/dist/prometheus-framework/src/modules/landing/components/sections/SubscribeNewsletter.vue.js +11 -11
  71. package/dist/prometheus-framework/src/modules/orders/components/pages/Order.vue.cjs +1 -1
  72. package/dist/prometheus-framework/src/modules/orders/components/pages/Order.vue.js +3 -3
  73. package/dist/prometheus-framework/src/modules/orders/components/pages/OrderBackoffice.vue.cjs +1 -1
  74. package/dist/prometheus-framework/src/modules/orders/components/pages/OrderBackoffice.vue.js +3 -3
  75. package/dist/prometheus-framework/src/modules/orders/components/pages/OrderCreate.vue.cjs +1 -1
  76. package/dist/prometheus-framework/src/modules/orders/components/pages/OrderCreate.vue.js +1 -1
  77. package/dist/prometheus-framework/src/modules/orders/components/pages/OrderCreateBackoffice.vue.cjs +1 -1
  78. package/dist/prometheus-framework/src/modules/orders/components/pages/OrderCreateBackoffice.vue.js +1 -1
  79. package/dist/prometheus-framework/src/modules/orders/components/pages/Orders.vue.cjs +1 -1
  80. package/dist/prometheus-framework/src/modules/orders/components/pages/Orders.vue.js +2 -2
  81. package/dist/prometheus-framework/src/modules/orders/components/sections/FormAddCustomer.vue.cjs +1 -1
  82. package/dist/prometheus-framework/src/modules/orders/components/sections/FormAddCustomer.vue.js +2 -2
  83. package/dist/prometheus-framework/src/modules/orders/components/sections/FormDelivery.vue.cjs +1 -1
  84. package/dist/prometheus-framework/src/modules/orders/components/sections/FormDelivery.vue.js +1 -1
  85. package/dist/prometheus-framework/src/modules/orders/router/orders.backoffice.router.cjs +1 -1
  86. package/dist/prometheus-framework/src/modules/orders/router/orders.backoffice.router.js +1 -1
  87. package/dist/prometheus-framework/src/modules/orders/router/orders.router.cjs +1 -1
  88. package/dist/prometheus-framework/src/modules/orders/router/orders.router.js +1 -1
  89. package/dist/prometheus-framework/src/modules/orders/store/applications.cjs +1 -1
  90. package/dist/prometheus-framework/src/modules/orders/store/applications.js +1 -1
  91. package/dist/prometheus-framework/src/modules/orders/store/customers.store.cjs +1 -1
  92. package/dist/prometheus-framework/src/modules/orders/store/customers.store.js +1 -1
  93. package/dist/prometheus-framework/src/modules/orders/store/orders.cjs +1 -1
  94. package/dist/prometheus-framework/src/modules/orders/store/orders.js +1 -1
  95. package/dist/prometheus-framework/src/modules/orders/store/shopcart.cjs +1 -1
  96. package/dist/prometheus-framework/src/modules/orders/store/shopcart.js +1 -1
  97. package/dist/prometheus-framework/src/modules/organizations/components/pages/DepartmentEdit.vue.cjs +1 -1
  98. package/dist/prometheus-framework/src/modules/organizations/components/pages/DepartmentEdit.vue.js +1 -1
  99. package/dist/prometheus-framework/src/modules/organizations/components/pages/Members.vue.cjs +1 -1
  100. package/dist/prometheus-framework/src/modules/organizations/components/pages/Members.vue.js +2 -2
  101. package/dist/prometheus-framework/src/modules/organizations/components/sections/MembersAdd.vue.cjs +1 -1
  102. package/dist/prometheus-framework/src/modules/organizations/components/sections/MembersAdd.vue.js +1 -1
  103. package/dist/prometheus-framework/src/modules/organizations/router/backoffice.router.cjs +1 -1
  104. package/dist/prometheus-framework/src/modules/organizations/router/backoffice.router.js +1 -1
  105. package/dist/prometheus-framework/src/modules/organizations/router/organizations.cjs +1 -1
  106. package/dist/prometheus-framework/src/modules/organizations/router/organizations.js +1 -1
  107. package/dist/prometheus-framework/src/modules/organizations/store/departments.cjs +1 -1
  108. package/dist/prometheus-framework/src/modules/organizations/store/departments.js +1 -1
  109. package/dist/prometheus-framework/src/modules/organizations/store/invites.cjs +1 -1
  110. package/dist/prometheus-framework/src/modules/organizations/store/invites.js +1 -1
  111. package/dist/prometheus-framework/src/modules/organizations/store/memberships.cjs +1 -1
  112. package/dist/prometheus-framework/src/modules/organizations/store/memberships.js +1 -1
  113. package/dist/prometheus-framework/src/modules/organizations/store/organizations.cjs +1 -1
  114. package/dist/prometheus-framework/src/modules/organizations/store/organizations.js +1 -1
  115. package/dist/prometheus-framework/src/modules/pages/views/components/pages/Page.vue.cjs +1 -1
  116. package/dist/prometheus-framework/src/modules/pages/views/components/pages/Page.vue.js +1 -1
  117. package/dist/prometheus-framework/src/modules/pages/views/components/pages/PageEdit.vue.cjs +1 -1
  118. package/dist/prometheus-framework/src/modules/pages/views/components/pages/PageEdit.vue.js +1 -1
  119. package/dist/prometheus-framework/src/modules/pages/views/components/pages/Pages.vue.cjs +1 -1
  120. package/dist/prometheus-framework/src/modules/pages/views/components/pages/Pages.vue.js +2 -2
  121. package/dist/prometheus-framework/src/modules/pages/views/components/partials/SidebarPages.vue.cjs +1 -1
  122. package/dist/prometheus-framework/src/modules/pages/views/components/partials/SidebarPages.vue.js +1 -1
  123. package/dist/prometheus-framework/src/modules/pages/views/router/pages.backoffice.router.cjs +1 -1
  124. package/dist/prometheus-framework/src/modules/pages/views/router/pages.backoffice.router.js +1 -1
  125. package/dist/prometheus-framework/src/modules/pages/views/router/pages.router.cjs +1 -1
  126. package/dist/prometheus-framework/src/modules/pages/views/router/pages.router.js +1 -1
  127. package/dist/prometheus-framework/src/modules/pages/views/store/pages.cjs +1 -1
  128. package/dist/prometheus-framework/src/modules/pages/views/store/pages.js +1 -1
  129. package/dist/prometheus-framework/src/modules/products/components/blocks/CardLeftover.vue.cjs +1 -1
  130. package/dist/prometheus-framework/src/modules/products/components/blocks/CardLeftover.vue.js +3 -3
  131. package/dist/prometheus-framework/src/modules/products/components/pages/EditLeftover.vue.cjs +1 -1
  132. package/dist/prometheus-framework/src/modules/products/components/pages/EditLeftover.vue.js +1 -1
  133. package/dist/prometheus-framework/src/modules/products/components/pages/ProductEdit.vue.cjs +1 -1
  134. package/dist/prometheus-framework/src/modules/products/components/pages/ProductEdit.vue.js +1 -1
  135. package/dist/prometheus-framework/src/modules/products/components/pages/Products.vue.cjs +1 -1
  136. package/dist/prometheus-framework/src/modules/products/components/pages/Products.vue.js +1 -1
  137. package/dist/prometheus-framework/src/modules/products/store/categories.cjs +1 -1
  138. package/dist/prometheus-framework/src/modules/products/store/categories.js +1 -1
  139. package/dist/prometheus-framework/src/modules/products/store/leftovers.cjs +1 -1
  140. package/dist/prometheus-framework/src/modules/products/store/leftovers.js +1 -1
  141. package/dist/prometheus-framework/src/modules/products/store/products.cjs +1 -1
  142. package/dist/prometheus-framework/src/modules/products/store/products.js +1 -1
  143. package/dist/prometheus-framework/src/modules/reports/store/reports.cjs +1 -1
  144. package/dist/prometheus-framework/src/modules/reports/store/reports.js +1 -1
  145. package/dist/prometheus-framework/src/modules/spots/components/layouts/Spots.vue.cjs +1 -1
  146. package/dist/prometheus-framework/src/modules/spots/components/layouts/Spots.vue.js +1 -1
  147. package/dist/prometheus-framework/src/modules/spots/components/pages/Map.vue.cjs +1 -1
  148. package/dist/prometheus-framework/src/modules/spots/components/pages/Map.vue.js +3 -3
  149. package/dist/prometheus-framework/src/modules/spots/router/spots.cjs +1 -1
  150. package/dist/prometheus-framework/src/modules/spots/router/spots.js +1 -1
  151. package/dist/prometheus-framework/src/modules/spots/store/spots.cjs +1 -1
  152. package/dist/prometheus-framework/src/modules/spots/store/spots.js +1 -1
  153. package/dist/prometheus-framework/src/modules/wallet/views/components/pages/Payments.vue.cjs +1 -1
  154. package/dist/prometheus-framework/src/modules/wallet/views/components/pages/Payments.vue.js +1 -1
  155. package/dist/prometheus-framework/src/modules/wallet/views/store/payments.store.cjs +1 -1
  156. package/dist/prometheus-framework/src/modules/wallet/views/store/payments.store.js +1 -1
  157. package/dist/prometheus-framework/src/modules/wallet/views/store/wallet.store.cjs +1 -1
  158. package/dist/prometheus-framework/src/modules/wallet/views/store/wallet.store.js +1 -1
  159. package/dist/style.css +1 -1
  160. package/package.json +1 -1
  161. package/src/builder/modes/ssr.dev.js +4 -1
  162. package/src/builder/templates/page.js +1 -1
  163. package/src/builder/webpack/webpack.config.base.js +2 -1
  164. package/src/builder/webpack/webpack.config.spa.js +0 -1
  165. package/src/components/Feed/Feed.vue +5 -5
  166. package/src/components/Sidebar/Sidebar.vue +1 -1
  167. package/src/modules/auth/controllers/services/twofa.service.js +1 -1
  168. package/src/modules/auth/views/components/pages/EnterCode.vue +1 -1
  169. package/src/modules/auth/views/store/auth.js +1 -1
  170. package/src/modules/auth/views/store/twofa.js +1 -1
  171. package/src/modules/auth/views/validations/inputs.validation.js +1 -1
  172. package/src/modules/backoffice/router/backoffice.js +1 -1
  173. package/src/modules/chats/controllers/chats.controller.js +1 -1
  174. package/src/modules/community/components/blocks/CardBlogpost.vue +1 -1
  175. package/src/modules/community/components/pages/BlogPost.vue +63 -2
  176. package/src/modules/community/components/sections/Comment.vue +1 -1
  177. package/src/modules/community/models/blogpost.model.js +4 -4
  178. package/src/modules/community/store/blogposts.js +1 -1
  179. package/src/modules/community/store/reactions.js +1 -1
  180. package/src/modules/events/components/blocks/CardEvent.vue +2 -2
  181. package/src/modules/events/controllers/events.controller.js +1 -1
  182. package/src/modules/events/controllers/tickets.controller.js +1 -1
  183. package/src/modules/events/models/event.model.js +4 -4
  184. package/src/modules/events/store/events.js +1 -1
  185. package/src/modules/events/store/tickets.js +1 -1
  186. package/src/modules/gallery/components/pages/Gallery.vue +2 -2
  187. package/src/modules/gallery/components/sections/BackofficeGallery.vue +2 -2
  188. package/src/modules/gallery/models/photo.model.js +3 -3
  189. package/src/modules/gallery/store/gallery.js +1 -1
  190. package/src/modules/globals/{services → controllers/classes}/globals.crud.js +2 -2
  191. package/src/modules/globals/globals.client.js +78 -8
  192. package/src/modules/globals/globals.server.js +3 -3
  193. package/src/modules/globals/models/{metadata.schema.js → schemas/metadata.schema.js} +1 -1
  194. package/src/modules/globals/{services → views/classes}/globals.store.js +1 -1
  195. package/src/modules/globals/{components → views/components}/blocks/BlockSorting.vue +1 -1
  196. package/src/modules/globals/views/components/layouts/App.vue +83 -0
  197. package/src/modules/globals/{components → views/components}/layouts/Client.vue +8 -8
  198. package/src/modules/globals/{components → views/components}/partials/Header.vue +1 -1
  199. package/src/modules/globals/views/middlewares/localization.js +16 -0
  200. package/src/modules/integrations/stripe/controllers/webhooks/stripe.webhook.js +2 -2
  201. package/src/modules/landing/components/sections/SubscribeNewsletter.vue +1 -1
  202. package/src/modules/marketplace/components/layouts/Marketplace.vue +1 -1
  203. package/src/modules/marketplace/router/marketplace.js +1 -1
  204. package/src/modules/orders/components/pages/Order.vue +1 -1
  205. package/src/modules/orders/components/pages/OrderBackoffice.vue +2 -2
  206. package/src/modules/orders/components/pages/OrderCreate.vue +1 -1
  207. package/src/modules/orders/components/pages/OrderCreateBackoffice.vue +2 -2
  208. package/src/modules/orders/components/pages/Orders.vue +2 -2
  209. package/src/modules/orders/components/sections/FormAddCustomer.vue +2 -2
  210. package/src/modules/orders/components/sections/FormDelivery.vue +1 -1
  211. package/src/modules/orders/controllers/applications.controller.js +1 -1
  212. package/src/modules/orders/controllers/orders.controller.js +1 -1
  213. package/src/modules/orders/models/customer.model.js +3 -3
  214. package/src/modules/orders/models/order.model.js +1 -1
  215. package/src/modules/orders/orders.server.js +1 -1
  216. package/src/modules/orders/router/orders.backoffice.router.js +1 -1
  217. package/src/modules/orders/router/orders.router.js +1 -1
  218. package/src/modules/orders/store/applications.js +1 -1
  219. package/src/modules/orders/store/customers.store.js +1 -1
  220. package/src/modules/orders/store/orders.js +1 -1
  221. package/src/modules/orders/store/shopcart.js +1 -1
  222. package/src/modules/organizations/components/pages/DepartmentEdit.vue +1 -1
  223. package/src/modules/organizations/components/pages/Members.vue +2 -2
  224. package/src/modules/organizations/components/sections/MembersAdd.vue +1 -1
  225. package/src/modules/organizations/controllers/invites.controller.js +1 -1
  226. package/src/modules/organizations/controllers/organizations.controller.js +1 -1
  227. package/src/modules/organizations/models/invite.model.js +2 -2
  228. package/src/modules/organizations/models/organization.model.js +1 -1
  229. package/src/modules/organizations/router/backoffice.router.js +1 -1
  230. package/src/modules/organizations/router/organizations.js +1 -1
  231. package/src/modules/organizations/store/departments.js +1 -1
  232. package/src/modules/organizations/store/invites.js +1 -1
  233. package/src/modules/organizations/store/memberships.js +1 -1
  234. package/src/modules/organizations/store/organizations.js +1 -1
  235. package/src/modules/pages/pages.server.js +1 -1
  236. package/src/modules/pages/views/components/pages/Page.vue +1 -1
  237. package/src/modules/pages/views/components/pages/PageEdit.vue +1 -1
  238. package/src/modules/pages/views/components/pages/Pages.vue +2 -2
  239. package/src/modules/pages/views/components/partials/SidebarPages.vue +1 -1
  240. package/src/modules/pages/views/router/pages.backoffice.router.js +1 -1
  241. package/src/modules/pages/views/router/pages.router.js +1 -1
  242. package/src/modules/pages/views/store/pages.js +1 -1
  243. package/src/modules/pages/views/store/pages.store.js +1 -1
  244. package/src/modules/products/components/blocks/CardLeftover.vue +1 -1
  245. package/src/modules/products/components/pages/EditLeftover.vue +1 -1
  246. package/src/modules/products/components/pages/ProductEdit.vue +1 -1
  247. package/src/modules/products/components/pages/Products.vue +1 -1
  248. package/src/modules/products/models/leftover.model.js +1 -1
  249. package/src/modules/products/store/categories.js +1 -1
  250. package/src/modules/products/store/leftovers.js +1 -1
  251. package/src/modules/products/store/products.js +1 -1
  252. package/src/modules/projects/store/projects.js +1 -1
  253. package/src/modules/reports/store/reports.js +1 -1
  254. package/src/modules/spots/components/layouts/Spots.vue +1 -1
  255. package/src/modules/spots/components/pages/Map.vue +1 -1
  256. package/src/modules/spots/router/spots.js +1 -1
  257. package/src/modules/spots/spots.server.js +1 -1
  258. package/src/modules/spots/store/spots.js +1 -1
  259. package/src/modules/users/models/user.model.js +3 -3
  260. package/src/modules/wallet/controllers/routes/payments.routes.js +1 -1
  261. package/src/modules/wallet/views/components/pages/Payments.vue +1 -1
  262. package/src/modules/wallet/views/store/payments.store.js +1 -1
  263. package/src/modules/wallet/views/store/wallet.store.js +1 -1
  264. package/src/modules/globals/router/routerGuards.js +0 -29
  265. /package/src/modules/globals/{services → controllers/classes}/globals.cache.js +0 -0
  266. /package/src/modules/globals/{services → controllers/classes}/globals.logger.js +0 -0
  267. /package/src/modules/globals/{services → controllers/classes}/globals.observer.js +0 -0
  268. /package/src/modules/globals/{services → controllers/classes}/globals.webhook.js +0 -0
  269. /package/src/modules/globals/{utils → controllers/utils}/mailing.js +0 -0
  270. /package/src/modules/globals/{utils → controllers/utils}/parseCookie.js +0 -0
  271. /package/src/modules/globals/{utils → controllers/utils}/seo-friendly-url.js +0 -0
  272. /package/src/modules/globals/{utils → controllers/utils}/sitemap.js +0 -0
  273. /package/src/modules/globals/models/{common.schema.js → schemas/common.schema.js} +0 -0
  274. /package/src/modules/globals/models/{credentials.schema.js → schemas/credentials.schema.js} +0 -0
  275. /package/src/modules/globals/models/{engagement.schema.js → schemas/engagement.schema.js} +0 -0
  276. /package/src/modules/globals/models/{ownership.schema.js → schemas/ownership.schema.js} +0 -0
  277. /package/src/modules/globals/models/{profile.schema.js → schemas/profile.schema.js} +0 -0
  278. /package/src/modules/globals/models/{socials.schema.js → schemas/socials.schema.js} +0 -0
  279. /package/src/modules/globals/{components → views/components}/blocks/BlockFilter.vue +0 -0
  280. /package/src/modules/globals/{components → views/components}/blocks/BlockSearch.vue +0 -0
  281. /package/src/modules/globals/{components → views/components}/blocks/CardFooter.vue +0 -0
  282. /package/src/modules/globals/{components → views/components}/blocks/CardHeader.vue +0 -0
  283. /package/src/modules/globals/{components → views/components}/elements/ButtonDate.vue +0 -0
  284. /package/src/modules/globals/{components → views/components}/elements/ButtonSort.vue +0 -0
  285. /package/src/modules/globals/{components → views/components}/layouts/Empty.vue +0 -0
  286. /package/src/modules/globals/{components → views/components}/pages/401.vue +0 -0
  287. /package/src/modules/globals/{components → views/components}/pages/404.vue +0 -0
  288. /package/src/modules/globals/{components → views/components}/partials/BottomNavigation.vue +0 -0
  289. /package/src/modules/globals/{components → views/components}/partials/Footer.vue +0 -0
  290. /package/src/modules/globals/{components → views/components}/partials/Navigation.vue +0 -0
  291. /package/src/modules/globals/{components → views/components}/partials/NavigationBar.vue +0 -0
  292. /package/src/modules/globals/{components → views/components}/sections/SectionPageTitle.vue +0 -0
  293. /package/src/modules/globals/{components → views/components}/sections/Title.vue +0 -0
  294. /package/src/modules/globals/{components → views/components}/sections/Walkthrough.vue +0 -0
  295. /package/src/modules/globals/{localization → views/localization}/get-browser-locale.js +0 -0
  296. /package/src/modules/globals/{mixins → views/mixins}/mixins.js +0 -0
  297. /package/src/modules/globals/{router → views/router}/scrollBehavior.js +0 -0
  298. /package/src/modules/globals/{store → views/store}/globals.js +0 -0
@@ -1,17 +1,17 @@
1
- import { ref as n, openBlock as u, createElementBlock as b, createElementVNode as e, toDisplayString as c, unref as o, createVNode as _, isRef as v, pushScopeId as f, popScopeId as h } from "vue";
1
+ import { ref as n, openBlock as u, createElementBlock as b, createElementVNode as e, toDisplayString as c, unref as a, createVNode as _, isRef as f, pushScopeId as v, popScopeId as h } from "vue";
2
2
  import { useI18n as g } from "vue-i18n";
3
3
  import w from "../../localization/SubscribeNewsletter.json.js";
4
4
  import S from "../../../../components/FieldBig/FieldBig.vue.js";
5
- import { setError as p } from "../../../globals/store/globals.js";
5
+ import { setError as p } from "../../../globals/views/store/globals.js";
6
6
  import { create as x } from "../../../orders/store/applications.js";
7
7
  import { validateInputs as y, validateEmail as N } from "../../../auth/views/validations/inputs.validation.js";
8
8
  /* empty css */
9
9
  import I from "../../../../../../_virtual/_plugin-vue_export-helper.js";
10
- const E = (a) => (f("data-v-e66544d0"), a = a(), h(), a), k = { class: "pd-thin" }, z = { class: "pos-relative o-hidden t-black bg-main pd-big radius-big" }, P = { class: "pos-relative z-index-1" }, T = { class: "t-center z-index-1 mn-b-big" }, V = { class: "mn-l-auto mn-r-auto mn-b-medium" }, A = { class: "t-transp p-big" }, B = { class: "z-index-1 w-100 flex-nowrap flex" }, j = /* @__PURE__ */ E(() => /* @__PURE__ */ e("div", { class: "w-100 h-100 pos-absolute pos-b-50-negative pos-r-0 z-index-0 grid" }, [
10
+ const E = (o) => (v("data-v-4a28df5c"), o = o(), h(), o), k = { class: "pd-thin" }, z = { class: "pos-relative o-hidden t-black bg-main pd-big radius-big" }, P = { class: "pos-relative z-index-1" }, T = { class: "t-center z-index-1 mn-b-big" }, V = { class: "mn-l-auto mn-r-auto mn-b-medium" }, A = { class: "t-transp p-big" }, B = { class: "z-index-1 w-100 flex-nowrap flex" }, j = /* @__PURE__ */ E(() => /* @__PURE__ */ e("div", { class: "w-100 h-100 pos-absolute pos-b-50-negative pos-r-0 z-index-0 grid" }, [
11
11
  /* @__PURE__ */ e("div", { class: "spiral" })
12
12
  ], -1)), D = {
13
13
  __name: "SubscribeNewsletter",
14
- setup(a) {
14
+ setup(o) {
15
15
  const { t: i } = g({
16
16
  useScope: "global",
17
17
  ...w
@@ -56,18 +56,18 @@ const E = (a) => (f("data-v-e66544d0"), a = a(), h(), a), k = { class: "pd-thin"
56
56
  e("div", z, [
57
57
  e("div", P, [
58
58
  e("header", T, [
59
- e("h2", V, c(o(i)("SubscribeNewsletter.title")), 1),
60
- e("p", A, c(o(i)("SubscribeNewsletter.subtitle")), 1)
59
+ e("h2", V, c(a(i)("SubscribeNewsletter.title")), 1),
60
+ e("p", A, c(a(i)("SubscribeNewsletter.subtitle")), 1)
61
61
  ]),
62
62
  e("div", B, [
63
63
  _(S, {
64
- input: o(s),
64
+ input: a(s),
65
65
  typingSpeed: 75,
66
66
  loopTyping: !1,
67
67
  enableTyping: !1,
68
- placeholder: o(i)("SubscribeNewsletter.placeholder"),
69
- action: o(i)("SubscribeNewsletter.action"),
70
- "onUpdate:input": r[0] || (r[0] = (l) => v(s) ? s.value = l : s = l),
68
+ placeholder: a(i)("SubscribeNewsletter.placeholder"),
69
+ action: a(i)("SubscribeNewsletter.action"),
70
+ "onUpdate:input": r[0] || (r[0] = (l) => f(s) ? s.value = l : s = l),
71
71
  onAction: m,
72
72
  class: "mn-l-auto mn-r-auto bg-white t-black w-100 w-max-30r"
73
73
  }, null, 8, ["input", "placeholder", "action"])
@@ -77,7 +77,7 @@ const E = (a) => (f("data-v-e66544d0"), a = a(), h(), a), k = { class: "pd-thin"
77
77
  ])
78
78
  ]));
79
79
  }
80
- }, K = /* @__PURE__ */ I(D, [["__scopeId", "data-v-e66544d0"]]);
80
+ }, K = /* @__PURE__ */ I(D, [["__scopeId", "data-v-4a28df5c"]]);
81
81
  export {
82
82
  K as default
83
83
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),D=require("vue-router"),C=require("../blocks/CardOrderItem.vue.cjs"),B=require("../../../organizations/components/blocks/CardOrganization.vue.cjs"),q=require("../../../chats/components/pages/ChatPage.vue.cjs"),z=require("../blocks/StatusHistory.vue.cjs"),I=require("../../../globals/store/globals.cjs"),m=require("../../store/orders.cjs"),M=require("../../../products/store/products.cjs"),T=require("../../../organizations/store/organizations.cjs");;/* empty css */const P=require("../../../../../../_virtual/_plugin-vue_export-helper.cjs"),n=c=>(e.pushScopeId("data-v-804d49cd"),c=c(),e.popScopeId(),c),R={key:0,class:"pd-thin"},F={key:0,class:"mn-b-thin pos-relative w-100 bg-main radius-big pd-big"},H={class:"mn-b-small"},A=n(()=>e.createElementVNode("p",{class:"mn-b-medium w-m-40r p-medium"},"Your order has been successfully created. Our manager will contact you within five minutes to confirm your order.",-1)),U={class:"radius-extra mn-b-medium flex-nowrap flex h-1r pos-relativew-40r"},W={class:"pos-absolute pos-t-medium pos-r-medium t-medium p-medium"},Y={class:"p-small t-transp"},j={key:1,class:"gap-thin cols-2"},L={class:"w-100"},G={class:"mn-b-thin bg-light w-100 o-hidden radius-medium"},J={class:"pd-small flex-nowrap flex"},K={class:"mn-r-auto"},Q=n(()=>e.createElementVNode("span",{class:"d-block t-medium p-medium"},"Your order is",-1)),X={class:"t-lh-075 h2 d-block mn-b-small"},Z=n(()=>e.createElementVNode("p",{class:"pd-t-nano pd-b-nano pd-r-thin pd-l-thin radius-extra bg-black t-white w-max"},"as on 29 aug 2021, Friday",-1)),$={class:"pd-small cols-2 br-t br-black-transp-10 br-solid"},ee=n(()=>e.createElementVNode("p",{class:"w-100 t-medium p-medium"}," Phone ",-1)),te={class:"w-100 t-right"},ae={key:0,class:"pd-small cols-2 br-t br-black-transp-10 br-solid"},se={class:"w-100 t-medium p-medium"},re={class:"w-100 t-right"},le={class:"pd-small cols-2 br-t br-black-transp-10 br-solid"},ne=n(()=>e.createElementVNode("p",{class:"t-medium p-medium"}," Address ",-1)),ie={class:"w-100 t-right"},oe={class:"pd-small cols-2 br-t br-black-transp-10 br-solid"},de=n(()=>e.createElementVNode("p",{class:"mn-b-small t-medium p-medium"}," Delivery ",-1)),ce={class:"w-100 t-right mn-b-small"},ue={key:2,class:"t-transp"},me={class:"bg-light radius-big pd-medium mn-r-bold pd-r-big br-right-dark w-100"},pe=n(()=>e.createElementVNode("h3",{class:"mn-b-small"},"Order Summary",-1)),ve={class:"flex gap-thin flex-column mn-b-semi"},he={class:"mn-b-medium radius-small br-solid br-1px br-black-transp-10 w-100"},be={class:"pd-small br-solid br-b br-black-transp-10 flex"},_e=n(()=>e.createElementVNode("p",{class:"mn-r-auto t-transp"},"In total",-1)),ge={class:"pd-small br-solid br-b br-black-transp-10 flex"},ye=n(()=>e.createElementVNode("p",{class:"mn-r-auto t-transp"},"Delivery",-1)),Ne={class:"pd-small flex-bottom flex"},Ve=n(()=>e.createElementVNode("p",{class:"mn-r-auto t-transp"},"In total to pay",-1)),Ee={class:"p-big t-semi"},fe=n(()=>e.createElementVNode("h3",{class:"mn-b-small"},"Chat With Us",-1)),we={__name:"Order",setup(c){D.useRouter();const u=D.useRoute(),t=e.ref(null),p=e.ref(null),r=e.ref(null);e.onMounted(async()=>{var a,l,s;t.value=await m.actions.read({_id:u.params.order}),t.value=t.value[0],p.value=await M.actions.read({organization:(a=t.value)==null?void 0:a.owner.target._id}),r.value=await T.actions.read({_id:(l=t.value)==null?void 0:l.owner.target._id,location:(s=I.state.position)==null?void 0:s.location})});let v=e.computed(()=>{var a;return Number((a=t.value)==null?void 0:a.positions.reduce((l,s)=>l+s.price*s.quantity,0))});e.computed(()=>{var a;return Number((a=t.value)==null?void 0:a.positions.reduce((l,s)=>l+s.quantity,0))});let S=e.computed(()=>{var a;return(a=t.value)==null?void 0:a.positions.map(({_id:l,quantity:s})=>{const i=p.value.find(o=>o._id===l);return{name:i.name,images:i.images,price:i.price,_id:i._id,quantity:s}})});function O(a,l){if(!a)return null;const s=10*60*1e3,i=Math.ceil((20+3*a)/5)*5*60*1e3,o=new Date(l).getTime(),d=new Date(o+s+i);return console.log(l),console.log(d),d}return(a,l)=>{var s,i,o,d,h,b,_,g,y,N,V,E,f,w,k;return t.value&&r.value?(e.openBlock(),e.createElementBlock("div",R,[t.value?(e.openBlock(),e.createElementBlock("div",F,[e.createElementVNode("h2",H,"Order is "+e.toDisplayString(t.value.status),1),A,e.createElementVNode("div",U,[e.createElementVNode("div",{class:e.normalizeClass(["bg-light br-anim br-glow radius-extra mn-r-thin h-100 w-20",{"br-anim br-glow br-glow-anim":["created","confirmed","packing","in delivery","delivered"].indexOf(t.value.status)===0}])},null,2),e.createElementVNode("div",{class:e.normalizeClass(["bg-light br-anim br-glow radius-extra mn-r-thin h-100 w-20",{"br-anim br-glow br-glow-anim":["created","confirmed","packing","in delivery","delivered"].indexOf(t.value.status)===0},{"t-transp":["created","confirmed","packing","in delivery","delivered"].indexOf(t.value.status)===-1},{blink:t.value.status==="created"}])},null,2),e.createElementVNode("div",{class:e.normalizeClass([{"br-anim br-glow br-glow-anim":["confirmed","packing","in delivery","delivered"].indexOf(t.value.status)===0},{"t-transp":["confirmed","packing","in delivery","delivered"].indexOf(t.value.status)===-1},{blink:t.value.status==="confirmed"},"bg-light radius-extra mn-r-thin h-100 w-40"])},null,2),e.createElementVNode("div",{class:e.normalizeClass(["bg-light radius-extra mn-r-thin h-100 w-40",{"br-anim br-glow br-glow-anim":["packing","in delivery","delivered"].indexOf(t.value.status)===0},{"t-transp":["packing","in delivery","delivered"].indexOf(t.value.status)===-1},{blink:t.value.status==="packing"}])},null,2),e.createElementVNode("div",{class:e.normalizeClass(["bg-light radius-extra h-100 w-20",{"br-anim br-glow br-glow-anim":["in delivery","delivered"].indexOf(t.value.status)===0},{"t-transp":["in delivery","delivered"].indexOf(t.value.status)===-1},{blink:t.value.status==="in delivery"}])},null,2)]),e.createElementVNode("p",null,"Estimated Arrival "+e.toDisplayString(a.formatDate(O((s=r.value[0])==null?void 0:s.distance,t.value.createdAt))),1),e.createElementVNode("h3",null,e.toDisplayString((i=r.value[0])!=null&&i.distance?Math.ceil((10+3*((o=r.value[0])==null?void 0:o.distance))/5)*5+"-"+Math.ceil((20+3*((d=r.value[0])==null?void 0:d.distance))/5)*5+" MIN":"Unavailable"),1),e.createElementVNode("p",W,[e.createTextVNode(" Order No: "),e.createElementVNode("span",Y,"#"+e.toDisplayString(t.value._id),1)])])):e.createCommentVNode("",!0),t.value?(e.openBlock(),e.createElementBlock("div",j,[e.createElementVNode("div",L,[r.value[0]?(e.openBlock(),e.createBlock(B.default,{key:0,organization:r.value[0],showRating:!0,showFollowers:!1,showProducts:!1,class:"bg-light mn-b-thin w-100 o-hidden radius-big pd-small"},null,8,["organization"])):e.createCommentVNode("",!0),e.createElementVNode("div",G,[e.createElementVNode("div",J,[e.createElementVNode("div",K,[Q,e.createElementVNode("span",X,e.toDisplayString(t.value.status),1),Z])]),e.createElementVNode("div",$,[ee,e.createElementVNode("p",te,e.toDisplayString((h=t.value.user)==null?void 0:h.number),1)]),(b=t.value.user)!=null&&b.messenger.type?(e.openBlock(),e.createElementBlock("div",ae,[e.createElementVNode("p",se,e.toDisplayString((_=t.value.user)==null?void 0:_.messenger.type),1),e.createElementVNode("p",re,e.toDisplayString((g=t.value.user)==null?void 0:g.messenger.value),1)])):e.createCommentVNode("",!0),e.createElementVNode("div",le,[ne,e.createElementVNode("p",ie,e.toDisplayString((y=t.value.delivery)==null?void 0:y.address.slice(0,64)),1)]),e.createElementVNode("div",oe,[de,e.createElementVNode("p",ce,e.toDisplayString((N=t.value.delivery)==null?void 0:N.type),1)])]),m.state.current.status_history?(e.openBlock(),e.createBlock(z.default,{key:1,statusHistory:m.state.current.status_history,statusCurrent:m.state.current.status,edit:e.unref(u).name==="Order Edit"},null,8,["statusHistory","statusCurrent","edit"])):e.createCommentVNode("",!0),a.payment&&a.payment.Status==="CONFIRMED"?(e.openBlock(),e.createElementBlock("span",ue,"Paid")):e.createCommentVNode("",!0)]),e.createElementVNode("div",me,[pe,e.createElementVNode("ul",ve,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(S),(x,xe)=>(e.openBlock(),e.createBlock(C.default,{key:x._id,editable:!1,product:x},null,8,["product"]))),128))]),e.createElementVNode("div",he,[e.createElementVNode("div",be,[_e,e.createElementVNode("p",null,e.toDisplayString(e.unref(v))+" "+e.toDisplayString(a.returnCurrency()),1)]),e.createElementVNode("div",ge,[ye,e.createElementVNode("p",null,e.toDisplayString(a.returnCurrency())+" "+e.toDisplayString(Math.trunc(100+20*((V=r.value[0])==null?void 0:V.distance)-7,5*(((E=r.value[0])==null?void 0:E.distance)/10))),1)]),e.createElementVNode("div",Ne,[Ve,e.createElementVNode("p",Ee,e.toDisplayString(a.returnCurrency())+" "+e.toDisplayString(Math.trunc(100+20*((f=r.value[0])==null?void 0:f.distance)-7,5*(((w=r.value[0])==null?void 0:w.distance)/10))+e.unref(v)),1)])]),fe,e.createVNode(q.default,{username:e.unref(u).name==="Order Status"?((k=t.value.user)==null?void 0:k.name)||"User":"Weeder Support",chatID:e.unref(u).params.order,class:"radius-semi bg-white o-hidden"},null,8,["username","chatID"])])])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)}}},ke=P.default(we,[["__scopeId","data-v-804d49cd"]]);exports.default=ke;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),D=require("vue-router"),C=require("../blocks/CardOrderItem.vue.cjs"),B=require("../../../organizations/components/blocks/CardOrganization.vue.cjs"),q=require("../../../chats/components/pages/ChatPage.vue.cjs"),z=require("../blocks/StatusHistory.vue.cjs"),I=require("../../../globals/views/store/globals.cjs"),m=require("../../store/orders.cjs"),M=require("../../../products/store/products.cjs"),T=require("../../../organizations/store/organizations.cjs");;/* empty css */const P=require("../../../../../../_virtual/_plugin-vue_export-helper.cjs"),n=c=>(e.pushScopeId("data-v-d2db1c69"),c=c(),e.popScopeId(),c),R={key:0,class:"pd-thin"},F={key:0,class:"mn-b-thin pos-relative w-100 bg-main radius-big pd-big"},H={class:"mn-b-small"},A=n(()=>e.createElementVNode("p",{class:"mn-b-medium w-m-40r p-medium"},"Your order has been successfully created. Our manager will contact you within five minutes to confirm your order.",-1)),U={class:"radius-extra mn-b-medium flex-nowrap flex h-1r pos-relativew-40r"},W={class:"pos-absolute pos-t-medium pos-r-medium t-medium p-medium"},Y={class:"p-small t-transp"},j={key:1,class:"gap-thin cols-2"},L={class:"w-100"},G={class:"mn-b-thin bg-light w-100 o-hidden radius-medium"},J={class:"pd-small flex-nowrap flex"},K={class:"mn-r-auto"},Q=n(()=>e.createElementVNode("span",{class:"d-block t-medium p-medium"},"Your order is",-1)),X={class:"t-lh-075 h2 d-block mn-b-small"},Z=n(()=>e.createElementVNode("p",{class:"pd-t-nano pd-b-nano pd-r-thin pd-l-thin radius-extra bg-black t-white w-max"},"as on 29 aug 2021, Friday",-1)),$={class:"pd-small cols-2 br-t br-black-transp-10 br-solid"},ee=n(()=>e.createElementVNode("p",{class:"w-100 t-medium p-medium"}," Phone ",-1)),te={class:"w-100 t-right"},ae={key:0,class:"pd-small cols-2 br-t br-black-transp-10 br-solid"},se={class:"w-100 t-medium p-medium"},re={class:"w-100 t-right"},le={class:"pd-small cols-2 br-t br-black-transp-10 br-solid"},ne=n(()=>e.createElementVNode("p",{class:"t-medium p-medium"}," Address ",-1)),ie={class:"w-100 t-right"},oe={class:"pd-small cols-2 br-t br-black-transp-10 br-solid"},de=n(()=>e.createElementVNode("p",{class:"mn-b-small t-medium p-medium"}," Delivery ",-1)),ce={class:"w-100 t-right mn-b-small"},ue={key:2,class:"t-transp"},me={class:"bg-light radius-big pd-medium mn-r-bold pd-r-big br-right-dark w-100"},pe=n(()=>e.createElementVNode("h3",{class:"mn-b-small"},"Order Summary",-1)),ve={class:"flex gap-thin flex-column mn-b-semi"},be={class:"mn-b-medium radius-small br-solid br-1px br-black-transp-10 w-100"},he={class:"pd-small br-solid br-b br-black-transp-10 flex"},_e=n(()=>e.createElementVNode("p",{class:"mn-r-auto t-transp"},"In total",-1)),ge={class:"pd-small br-solid br-b br-black-transp-10 flex"},ye=n(()=>e.createElementVNode("p",{class:"mn-r-auto t-transp"},"Delivery",-1)),Ne={class:"pd-small flex-bottom flex"},Ve=n(()=>e.createElementVNode("p",{class:"mn-r-auto t-transp"},"In total to pay",-1)),Ee={class:"p-big t-semi"},fe=n(()=>e.createElementVNode("h3",{class:"mn-b-small"},"Chat With Us",-1)),we={__name:"Order",setup(c){D.useRouter();const u=D.useRoute(),t=e.ref(null),p=e.ref(null),r=e.ref(null);e.onMounted(async()=>{var a,l,s;t.value=await m.actions.read({_id:u.params.order}),t.value=t.value[0],p.value=await M.actions.read({organization:(a=t.value)==null?void 0:a.owner.target._id}),r.value=await T.actions.read({_id:(l=t.value)==null?void 0:l.owner.target._id,location:(s=I.state.position)==null?void 0:s.location})});let v=e.computed(()=>{var a;return Number((a=t.value)==null?void 0:a.positions.reduce((l,s)=>l+s.price*s.quantity,0))});e.computed(()=>{var a;return Number((a=t.value)==null?void 0:a.positions.reduce((l,s)=>l+s.quantity,0))});let S=e.computed(()=>{var a;return(a=t.value)==null?void 0:a.positions.map(({_id:l,quantity:s})=>{const i=p.value.find(o=>o._id===l);return{name:i.name,images:i.images,price:i.price,_id:i._id,quantity:s}})});function O(a,l){if(!a)return null;const s=10*60*1e3,i=Math.ceil((20+3*a)/5)*5*60*1e3,o=new Date(l).getTime(),d=new Date(o+s+i);return console.log(l),console.log(d),d}return(a,l)=>{var s,i,o,d,b,h,_,g,y,N,V,E,f,w,k;return t.value&&r.value?(e.openBlock(),e.createElementBlock("div",R,[t.value?(e.openBlock(),e.createElementBlock("div",F,[e.createElementVNode("h2",H,"Order is "+e.toDisplayString(t.value.status),1),A,e.createElementVNode("div",U,[e.createElementVNode("div",{class:e.normalizeClass(["bg-light br-anim br-glow radius-extra mn-r-thin h-100 w-20",{"br-anim br-glow br-glow-anim":["created","confirmed","packing","in delivery","delivered"].indexOf(t.value.status)===0}])},null,2),e.createElementVNode("div",{class:e.normalizeClass(["bg-light br-anim br-glow radius-extra mn-r-thin h-100 w-20",{"br-anim br-glow br-glow-anim":["created","confirmed","packing","in delivery","delivered"].indexOf(t.value.status)===0},{"t-transp":["created","confirmed","packing","in delivery","delivered"].indexOf(t.value.status)===-1},{blink:t.value.status==="created"}])},null,2),e.createElementVNode("div",{class:e.normalizeClass([{"br-anim br-glow br-glow-anim":["confirmed","packing","in delivery","delivered"].indexOf(t.value.status)===0},{"t-transp":["confirmed","packing","in delivery","delivered"].indexOf(t.value.status)===-1},{blink:t.value.status==="confirmed"},"bg-light radius-extra mn-r-thin h-100 w-40"])},null,2),e.createElementVNode("div",{class:e.normalizeClass(["bg-light radius-extra mn-r-thin h-100 w-40",{"br-anim br-glow br-glow-anim":["packing","in delivery","delivered"].indexOf(t.value.status)===0},{"t-transp":["packing","in delivery","delivered"].indexOf(t.value.status)===-1},{blink:t.value.status==="packing"}])},null,2),e.createElementVNode("div",{class:e.normalizeClass(["bg-light radius-extra h-100 w-20",{"br-anim br-glow br-glow-anim":["in delivery","delivered"].indexOf(t.value.status)===0},{"t-transp":["in delivery","delivered"].indexOf(t.value.status)===-1},{blink:t.value.status==="in delivery"}])},null,2)]),e.createElementVNode("p",null,"Estimated Arrival "+e.toDisplayString(a.formatDate(O((s=r.value[0])==null?void 0:s.distance,t.value.createdAt))),1),e.createElementVNode("h3",null,e.toDisplayString((i=r.value[0])!=null&&i.distance?Math.ceil((10+3*((o=r.value[0])==null?void 0:o.distance))/5)*5+"-"+Math.ceil((20+3*((d=r.value[0])==null?void 0:d.distance))/5)*5+" MIN":"Unavailable"),1),e.createElementVNode("p",W,[e.createTextVNode(" Order No: "),e.createElementVNode("span",Y,"#"+e.toDisplayString(t.value._id),1)])])):e.createCommentVNode("",!0),t.value?(e.openBlock(),e.createElementBlock("div",j,[e.createElementVNode("div",L,[r.value[0]?(e.openBlock(),e.createBlock(B.default,{key:0,organization:r.value[0],showRating:!0,showFollowers:!1,showProducts:!1,class:"bg-light mn-b-thin w-100 o-hidden radius-big pd-small"},null,8,["organization"])):e.createCommentVNode("",!0),e.createElementVNode("div",G,[e.createElementVNode("div",J,[e.createElementVNode("div",K,[Q,e.createElementVNode("span",X,e.toDisplayString(t.value.status),1),Z])]),e.createElementVNode("div",$,[ee,e.createElementVNode("p",te,e.toDisplayString((b=t.value.user)==null?void 0:b.number),1)]),(h=t.value.user)!=null&&h.messenger.type?(e.openBlock(),e.createElementBlock("div",ae,[e.createElementVNode("p",se,e.toDisplayString((_=t.value.user)==null?void 0:_.messenger.type),1),e.createElementVNode("p",re,e.toDisplayString((g=t.value.user)==null?void 0:g.messenger.value),1)])):e.createCommentVNode("",!0),e.createElementVNode("div",le,[ne,e.createElementVNode("p",ie,e.toDisplayString((y=t.value.delivery)==null?void 0:y.address.slice(0,64)),1)]),e.createElementVNode("div",oe,[de,e.createElementVNode("p",ce,e.toDisplayString((N=t.value.delivery)==null?void 0:N.type),1)])]),m.state.current.status_history?(e.openBlock(),e.createBlock(z.default,{key:1,statusHistory:m.state.current.status_history,statusCurrent:m.state.current.status,edit:e.unref(u).name==="Order Edit"},null,8,["statusHistory","statusCurrent","edit"])):e.createCommentVNode("",!0),a.payment&&a.payment.Status==="CONFIRMED"?(e.openBlock(),e.createElementBlock("span",ue,"Paid")):e.createCommentVNode("",!0)]),e.createElementVNode("div",me,[pe,e.createElementVNode("ul",ve,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(S),(x,xe)=>(e.openBlock(),e.createBlock(C.default,{key:x._id,editable:!1,product:x},null,8,["product"]))),128))]),e.createElementVNode("div",be,[e.createElementVNode("div",he,[_e,e.createElementVNode("p",null,e.toDisplayString(e.unref(v))+" "+e.toDisplayString(a.returnCurrency()),1)]),e.createElementVNode("div",ge,[ye,e.createElementVNode("p",null,e.toDisplayString(a.returnCurrency())+" "+e.toDisplayString(Math.trunc(100+20*((V=r.value[0])==null?void 0:V.distance)-7,5*(((E=r.value[0])==null?void 0:E.distance)/10))),1)]),e.createElementVNode("div",Ne,[Ve,e.createElementVNode("p",Ee,e.toDisplayString(a.returnCurrency())+" "+e.toDisplayString(Math.trunc(100+20*((f=r.value[0])==null?void 0:f.distance)-7,5*(((w=r.value[0])==null?void 0:w.distance)/10))+e.unref(v)),1)])]),fe,e.createVNode(q.default,{username:e.unref(u).name==="Order Status"?((k=t.value.user)==null?void 0:k.name)||"User":"Weeder Support",chatID:e.unref(u).params.order,class:"radius-semi bg-white o-hidden"},null,8,["username","chatID"])])])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)}}},ke=P.default(we,[["__scopeId","data-v-d2db1c69"]]);exports.default=ke;
@@ -4,13 +4,13 @@ import j from "../blocks/CardOrderItem.vue.js";
4
4
  import G from "../../../organizations/components/blocks/CardOrganization.vue.js";
5
5
  import J from "../../../chats/components/pages/ChatPage.vue.js";
6
6
  import K from "../blocks/StatusHistory.vue.js";
7
- import { state as Q } from "../../../globals/store/globals.js";
7
+ import { state as Q } from "../../../globals/views/store/globals.js";
8
8
  import { actions as X, state as y } from "../../store/orders.js";
9
9
  import { actions as Z } from "../../../products/store/products.js";
10
10
  import { actions as ee } from "../../../organizations/store/organizations.js";
11
11
  /* empty css */
12
12
  import se from "../../../../../../_virtual/_plugin-vue_export-helper.js";
13
- const n = (h) => (H("data-v-804d49cd"), h = h(), W(), h), te = {
13
+ const n = (h) => (H("data-v-d2db1c69"), h = h(), W(), h), te = {
14
14
  key: 0,
15
15
  class: "pd-thin"
16
16
  }, ae = {
@@ -196,7 +196,7 @@ const n = (h) => (H("data-v-804d49cd"), h = h(), W(), h), te = {
196
196
  ])) : u("", !0);
197
197
  };
198
198
  }
199
- }, ts = /* @__PURE__ */ se(qe, [["__scopeId", "data-v-804d49cd"]]);
199
+ }, ts = /* @__PURE__ */ se(qe, [["__scopeId", "data-v-d2db1c69"]]);
200
200
  export {
201
201
  ts as default
202
202
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),C=require("vue-router"),O=require("../../../../../node_modules/@vuepic/vue-datepicker/dist/vue-datepicker.cjs");;/* empty css */;/* empty css */const P=require("../../../../components/Popup/Popup.vue2.cjs"),I=require("../../../icons/entities/IconTime.vue.cjs"),B=require("../blocks/CardOrderItem.vue.cjs"),z=require("../../../organizations/components/blocks/CardOrganization.vue.cjs"),M=require("../../../chats/components/pages/ChatPage.vue.cjs"),F=require("../blocks/StatusHistory.vue.cjs"),L=require("../../../globals/store/globals.cjs"),d=require("../../store/orders.cjs"),R=require("../../../products/store/products.cjs"),T=require("../../../organizations/store/organizations.cjs");;/* empty css */const A=require("../../../../../../_virtual/_plugin-vue_export-helper.cjs"),l=b=>(e.pushScopeId("data-v-75357432"),b=b(),e.popScopeId(),b),H={key:0,class:"pd-thin"},U={key:0,class:"mn-b-thin pos-relative w-100 bg-main radius-big pd-medium"},W={class:"mn-b-small flex-nowrap flex"},j={class:"t-medium p-medium"},G={class:"p-small t-transp"},J={class:"flex-nowrap flex gap-thin pos-relative"},K={class:"bg-light mn-b-thin pd-thin radius-extra flex-nowrap flex"},Q={class:"w-max flex-v-center gap-thin flex-nowrap flex pd-thin radius-small bg-white-transp-20"},X={class:"t-medium mn-r-auto"},Y=l(()=>e.createElementVNode("span",{class:"p-small t-transp"},"Estimated Arrival",-1)),Z=l(()=>e.createElementVNode("br",null,null,-1)),$=l(()=>e.createElementVNode("p",{class:"t-medium p-medium mn-b-thin"}," Positions ",-1)),ee={class:"bg-light pd-small radius-small flex gap-thin flex-column mn-b-semi"},te={key:1,class:"gap-thin cols-2"},se={class:"w-100"},ae={class:"mn-b-thin bg-light w-100 o-hidden radius-medium"},le={class:"pd-small flex-nowrap flex"},re={class:"mn-r-auto"},ne=l(()=>e.createElementVNode("span",{class:"d-block t-medium p-medium"},"Order is",-1)),oe=l(()=>e.createElementVNode("span",{class:"t-lh-075 h2 d-block mn-b-small"},"created",-1)),ie={class:"pd-t-nano pd-b-nano pd-r-thin pd-l-thin radius-extra bg-black t-white w-max"},ce={class:"pd-small cols-2 br-t br-black-transp-10 br-solid"},de=l(()=>e.createElementVNode("p",{class:"w-100 t-medium p-medium"}," Phone ",-1)),ue={class:"w-100 t-right"},me={class:"pd-small cols-2 br-t br-black-transp-10 br-solid"},pe=l(()=>e.createElementVNode("p",{class:"t-medium p-medium"}," Address ",-1)),he={class:"w-100 t-right"},_e={class:"pd-small cols-2 br-t br-black-transp-10 br-solid"},be=l(()=>e.createElementVNode("p",{class:"mn-b-small t-medium p-medium"}," Delivery ",-1)),ve={class:"w-100 t-right mn-b-small"},ge={key:2,class:"t-transp"},fe={class:"bg-light radius-big pd-medium mn-r-bold pd-r-big br-right-dark w-100"},Ne=l(()=>e.createElementVNode("h3",{class:"mn-b-small"},"Order Summary",-1)),Ve={class:"flex gap-thin flex-column mn-b-semi"},Ee={class:"mn-b-medium radius-small br-solid br-1px br-black-transp-10 w-100"},ke={class:"pd-small br-solid br-b br-black-transp-10 flex"},ye=l(()=>e.createElementVNode("p",{class:"mn-r-auto t-transp"},"In total",-1)),we={class:"pd-small br-solid br-b br-black-transp-10 flex"},Se=l(()=>e.createElementVNode("p",{class:"mn-r-auto t-transp"},"Delivery",-1)),xe={class:"pd-small flex-bottom flex"},Ce=l(()=>e.createElementVNode("p",{class:"mn-r-auto t-transp"},"In total to pay",-1)),Be={class:"p-big t-semi"},De=l(()=>e.createElementVNode("h3",{class:"mn-b-small"},"Chat With Us",-1)),qe={__name:"OrderBackoffice",setup(b){C.useRouter();const h=C.useRoute(),s=e.ref(null),v=e.ref(null),n=e.ref(null),o=["created","confirmed","packing","in delivery","delivered"],V=["Created","Confirmed","Packing","In Delivery","Delivered"],g=t=>o.slice(t).includes(s.value.status),f=e.ref(!1),E=e.ref(null),N=e.ref([]);function D(t){f.value=!0,typeof t=="number"&&(E.value=t)}function k(){f.value=!1,E.value=null}e.onMounted(async()=>{var a,r;s.value=await d.actions.read({_id:h.params.order}),s.value=s.value[0],v.value=await R.actions.read({organization:s.value.owner.target._id,limit:1e3}),console.log(v.value);const t=v.value.reduce((u,m)=>(u[m._id]=m,u),{});console.log(t),N.value=s.value.positions.map(({_id:u,quantity:m})=>{const p=t[u];return{name:p.name,images:p.images,price:p.price,_id:p._id,quantity:m}}),n.value=await T.actions.read({_id:(a=s.value)==null?void 0:a.owner.target._id,location:(r=L.state.position)==null?void 0:r.location})});let y=e.computed(()=>{var t;return Number((t=s.value)==null?void 0:t.positions.reduce((a,r)=>a+r.price*r.quantity,0))});e.computed(()=>{var t;return Number((t=s.value)==null?void 0:t.positions.reduce((a,r)=>a+r.quantity,0))});function _(t){const a=o.indexOf(t);return a!==-1&&a+1<o.length?o[a+1]:null}function w(t){const a=o.indexOf(t);return t?V[a]:""}async function q(){const t=_(d.state.current.status);t?(d.state.current.status=t,await d.actions.update(d.state.current)):console.error("Next status is void. Must handle somehow."),k()}return(t,a)=>{var r,u,m,p,S,x;return s.value&&n.value?(e.openBlock(),e.createElementBlock("div",H,[s.value?(e.openBlock(),e.createElementBlock("div",U,[e.createElementVNode("div",W,[e.createElementVNode("p",j,[e.createTextVNode(" Order No: "),e.createElementVNode("span",G,"#"+e.toDisplayString(s.value._id),1)])]),e.createElementVNode("div",J,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(o,(i,c)=>e.createElementVNode("div",{key:c,class:"w-20"},[e.createElementVNode("div",{class:e.normalizeClass(["bg-light br-anim br-glow radius-extra h-1r w-100",{"br-glow-anim":g(c)},{"t-transp":!g(c)},{blink:s.value.status===o[c]&&_(s.value.status)}])},null,2),e.createElementVNode("div",{class:e.normalizeClass([{"t-transp":!g(c)},"mn-t-thin p-small t-medium uppercase"])},e.toDisplayString(V[c]),3)])),64))])])):e.createCommentVNode("",!0),e.createElementVNode("div",K,[e.createElementVNode("div",Q,[e.createVNode(I.default,{class:"i-semi t-transp",fill:"rgb(var(--black)"}),e.createElementVNode("p",X,[Y,Z,e.createTextVNode(e.toDisplayString(t.formatDate(s.value.deadline)),1)])]),_(s.value.status)&&e.unref(h).name==="Order Edit"?(e.openBlock(),e.createElementBlock("button",{key:0,onClick:D,class:"mn-l-auto bg-black t-white button"}," Mark as "+e.toDisplayString(w(_(s.value.status))),1)):e.createCommentVNode("",!0)]),e.createVNode(P.default,{title:"Change status",onClosePopup:k,isPopupOpen:f.value,class:"bg-white w-min-30r w-max-30r radius-big pd-big"},{default:e.withCtx(()=>[e.createVNode(e.unref(O.default),{modelValue:s.value.deadline,"onUpdate:modelValue":a[0]||(a[0]=i=>s.value.deadline=i),"hide-navigation":["calendar"],flow:["time"],class:"z-index-3 bg-light radius-small pd-small mn-b-thin mn-b-semi"},null,8,["modelValue"]),$,e.createElementVNode("ul",ee,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(N.value,(i,c)=>(e.openBlock(),e.createBlock(B.default,{key:i._id,editable:!1,product:i},null,8,["product"]))),128))]),e.createElementVNode("button",{onClick:q,class:"w-100 bg-black-small t-white button"},e.toDisplayString("Confirm Changing to "+w(_(s.value.status))),1)]),_:1},8,["isPopupOpen"]),s.value?(e.openBlock(),e.createElementBlock("div",te,[e.createElementVNode("div",se,[n.value[0]?(e.openBlock(),e.createBlock(z.default,{key:0,organization:n.value[0],showRating:!0,showFollowers:!1,showProducts:!1,class:"bg-light mn-b-thin w-100 o-hidden radius-big pd-small"},null,8,["organization"])):e.createCommentVNode("",!0),e.createElementVNode("div",ae,[e.createElementVNode("div",le,[e.createElementVNode("div",re,[ne,oe,e.createElementVNode("p",ie,e.toDisplayString(t.formatDate(s.value.createdAt)),1)])]),e.createElementVNode("div",ce,[de,e.createElementVNode("p",ue,e.toDisplayString(((r=s.value.customer.target)==null?void 0:r.number)||"Not specified"),1)]),e.createElementVNode("div",me,[pe,e.createElementVNode("p",he,e.toDisplayString(s.value.delivery.address?s.value.delivery.address.slice(0,64):"Not specified"),1)]),e.createElementVNode("div",_e,[be,e.createElementVNode("p",ve,e.toDisplayString(s.value.delivery.type?s.value.delivery.type:"Not specified"),1)])]),d.state.current.status_history?(e.openBlock(),e.createBlock(F.default,{key:1,statuses:o,statusHistory:d.state.current.status_history,statusCurrent:d.state.current.status,edit:e.unref(h).name==="Order Edit"},null,8,["statusHistory","statusCurrent","edit"])):e.createCommentVNode("",!0),t.payment&&t.payment.Status==="CONFIRMED"?(e.openBlock(),e.createElementBlock("span",ge,"Paid")):e.createCommentVNode("",!0)]),e.createElementVNode("div",fe,[Ne,e.createElementVNode("ul",Ve,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(N.value,(i,c)=>(e.openBlock(),e.createBlock(B.default,{key:i._id,editable:!1,product:i},null,8,["product"]))),128))]),e.createElementVNode("div",Ee,[e.createElementVNode("div",ke,[ye,e.createElementVNode("p",null,e.toDisplayString(e.unref(y))+" "+e.toDisplayString(t.returnCurrency()),1)]),e.createElementVNode("div",we,[Se,e.createElementVNode("p",null,e.toDisplayString(t.returnCurrency())+" "+e.toDisplayString(Math.trunc(100+20*((u=n.value[0])==null?void 0:u.distance)-7,5*(((m=n.value[0])==null?void 0:m.distance)/10))),1)]),e.createElementVNode("div",xe,[Ce,e.createElementVNode("p",Be,e.toDisplayString(t.returnCurrency())+" "+e.toDisplayString(Math.trunc(100+20*((p=n.value[0])==null?void 0:p.distance)-7,5*(((S=n.value[0])==null?void 0:S.distance)/10))+e.unref(y)),1)])]),De,e.createVNode(M.default,{username:e.unref(h).name==="Order Status"?((x=s.value.user)==null?void 0:x.name)||"User":"Weeder Support",chatID:e.unref(h).params.order,class:"radius-semi bg-white o-hidden"},null,8,["username","chatID"])])])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)}}},Oe=A.default(qe,[["__scopeId","data-v-75357432"]]);exports.default=Oe;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),C=require("vue-router"),O=require("../../../../../node_modules/@vuepic/vue-datepicker/dist/vue-datepicker.cjs");;/* empty css */;/* empty css */const P=require("../../../../components/Popup/Popup.vue2.cjs"),I=require("../../../icons/entities/IconTime.vue.cjs"),B=require("../blocks/CardOrderItem.vue.cjs"),z=require("../../../organizations/components/blocks/CardOrganization.vue.cjs"),M=require("../../../chats/components/pages/ChatPage.vue.cjs"),F=require("../blocks/StatusHistory.vue.cjs"),L=require("../../../globals/views/store/globals.cjs"),d=require("../../store/orders.cjs"),R=require("../../../products/store/products.cjs"),T=require("../../../organizations/store/organizations.cjs");;/* empty css */const A=require("../../../../../../_virtual/_plugin-vue_export-helper.cjs"),l=b=>(e.pushScopeId("data-v-ad498447"),b=b(),e.popScopeId(),b),H={key:0,class:"pd-thin"},U={key:0,class:"mn-b-thin pos-relative w-100 bg-main radius-big pd-medium"},W={class:"mn-b-small flex-nowrap flex"},j={class:"t-medium p-medium"},G={class:"p-small t-transp"},J={class:"flex-nowrap flex gap-thin pos-relative"},K={class:"bg-light mn-b-thin pd-thin radius-extra flex-nowrap flex"},Q={class:"w-max flex-v-center gap-thin flex-nowrap flex pd-thin radius-small bg-white-transp-20"},X={class:"t-medium mn-r-auto"},Y=l(()=>e.createElementVNode("span",{class:"p-small t-transp"},"Estimated Arrival",-1)),Z=l(()=>e.createElementVNode("br",null,null,-1)),$=l(()=>e.createElementVNode("p",{class:"t-medium p-medium mn-b-thin"}," Positions ",-1)),ee={class:"bg-light pd-small radius-small flex gap-thin flex-column mn-b-semi"},te={key:1,class:"gap-thin cols-2"},se={class:"w-100"},ae={class:"mn-b-thin bg-light w-100 o-hidden radius-medium"},le={class:"pd-small flex-nowrap flex"},re={class:"mn-r-auto"},ne=l(()=>e.createElementVNode("span",{class:"d-block t-medium p-medium"},"Order is",-1)),oe=l(()=>e.createElementVNode("span",{class:"t-lh-075 h2 d-block mn-b-small"},"created",-1)),ie={class:"pd-t-nano pd-b-nano pd-r-thin pd-l-thin radius-extra bg-black t-white w-max"},ce={class:"pd-small cols-2 br-t br-black-transp-10 br-solid"},de=l(()=>e.createElementVNode("p",{class:"w-100 t-medium p-medium"}," Phone ",-1)),ue={class:"w-100 t-right"},me={class:"pd-small cols-2 br-t br-black-transp-10 br-solid"},pe=l(()=>e.createElementVNode("p",{class:"t-medium p-medium"}," Address ",-1)),he={class:"w-100 t-right"},_e={class:"pd-small cols-2 br-t br-black-transp-10 br-solid"},be=l(()=>e.createElementVNode("p",{class:"mn-b-small t-medium p-medium"}," Delivery ",-1)),ve={class:"w-100 t-right mn-b-small"},ge={key:2,class:"t-transp"},fe={class:"bg-light radius-big pd-medium mn-r-bold pd-r-big br-right-dark w-100"},Ne=l(()=>e.createElementVNode("h3",{class:"mn-b-small"},"Order Summary",-1)),Ve={class:"flex gap-thin flex-column mn-b-semi"},Ee={class:"mn-b-medium radius-small br-solid br-1px br-black-transp-10 w-100"},ke={class:"pd-small br-solid br-b br-black-transp-10 flex"},ye=l(()=>e.createElementVNode("p",{class:"mn-r-auto t-transp"},"In total",-1)),we={class:"pd-small br-solid br-b br-black-transp-10 flex"},Se=l(()=>e.createElementVNode("p",{class:"mn-r-auto t-transp"},"Delivery",-1)),xe={class:"pd-small flex-bottom flex"},Ce=l(()=>e.createElementVNode("p",{class:"mn-r-auto t-transp"},"In total to pay",-1)),Be={class:"p-big t-semi"},De=l(()=>e.createElementVNode("h3",{class:"mn-b-small"},"Chat With Us",-1)),qe={__name:"OrderBackoffice",setup(b){C.useRouter();const h=C.useRoute(),s=e.ref(null),v=e.ref(null),n=e.ref(null),o=["created","confirmed","packing","in delivery","delivered"],V=["Created","Confirmed","Packing","In Delivery","Delivered"],g=t=>o.slice(t).includes(s.value.status),f=e.ref(!1),E=e.ref(null),N=e.ref([]);function D(t){f.value=!0,typeof t=="number"&&(E.value=t)}function k(){f.value=!1,E.value=null}e.onMounted(async()=>{var a,r;s.value=await d.actions.read({_id:h.params.order}),s.value=s.value[0],v.value=await R.actions.read({organization:s.value.owner.target._id,limit:1e3}),console.log(v.value);const t=v.value.reduce((u,m)=>(u[m._id]=m,u),{});console.log(t),N.value=s.value.positions.map(({_id:u,quantity:m})=>{const p=t[u];return{name:p.name,images:p.images,price:p.price,_id:p._id,quantity:m}}),n.value=await T.actions.read({_id:(a=s.value)==null?void 0:a.owner.target._id,location:(r=L.state.position)==null?void 0:r.location})});let y=e.computed(()=>{var t;return Number((t=s.value)==null?void 0:t.positions.reduce((a,r)=>a+r.price*r.quantity,0))});e.computed(()=>{var t;return Number((t=s.value)==null?void 0:t.positions.reduce((a,r)=>a+r.quantity,0))});function _(t){const a=o.indexOf(t);return a!==-1&&a+1<o.length?o[a+1]:null}function w(t){const a=o.indexOf(t);return t?V[a]:""}async function q(){const t=_(d.state.current.status);t?(d.state.current.status=t,await d.actions.update(d.state.current)):console.error("Next status is void. Must handle somehow."),k()}return(t,a)=>{var r,u,m,p,S,x;return s.value&&n.value?(e.openBlock(),e.createElementBlock("div",H,[s.value?(e.openBlock(),e.createElementBlock("div",U,[e.createElementVNode("div",W,[e.createElementVNode("p",j,[e.createTextVNode(" Order No: "),e.createElementVNode("span",G,"#"+e.toDisplayString(s.value._id),1)])]),e.createElementVNode("div",J,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(o,(i,c)=>e.createElementVNode("div",{key:c,class:"w-20"},[e.createElementVNode("div",{class:e.normalizeClass(["bg-light br-anim br-glow radius-extra h-1r w-100",{"br-glow-anim":g(c)},{"t-transp":!g(c)},{blink:s.value.status===o[c]&&_(s.value.status)}])},null,2),e.createElementVNode("div",{class:e.normalizeClass([{"t-transp":!g(c)},"mn-t-thin p-small t-medium uppercase"])},e.toDisplayString(V[c]),3)])),64))])])):e.createCommentVNode("",!0),e.createElementVNode("div",K,[e.createElementVNode("div",Q,[e.createVNode(I.default,{class:"i-semi t-transp",fill:"rgb(var(--black)"}),e.createElementVNode("p",X,[Y,Z,e.createTextVNode(e.toDisplayString(t.formatDate(s.value.deadline)),1)])]),_(s.value.status)&&e.unref(h).name==="Order Edit"?(e.openBlock(),e.createElementBlock("button",{key:0,onClick:D,class:"mn-l-auto bg-black t-white button"}," Mark as "+e.toDisplayString(w(_(s.value.status))),1)):e.createCommentVNode("",!0)]),e.createVNode(P.default,{title:"Change status",onClosePopup:k,isPopupOpen:f.value,class:"bg-white w-min-30r w-max-30r radius-big pd-big"},{default:e.withCtx(()=>[e.createVNode(e.unref(O.default),{modelValue:s.value.deadline,"onUpdate:modelValue":a[0]||(a[0]=i=>s.value.deadline=i),"hide-navigation":["calendar"],flow:["time"],class:"z-index-3 bg-light radius-small pd-small mn-b-thin mn-b-semi"},null,8,["modelValue"]),$,e.createElementVNode("ul",ee,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(N.value,(i,c)=>(e.openBlock(),e.createBlock(B.default,{key:i._id,editable:!1,product:i},null,8,["product"]))),128))]),e.createElementVNode("button",{onClick:q,class:"w-100 bg-black-small t-white button"},e.toDisplayString("Confirm Changing to "+w(_(s.value.status))),1)]),_:1},8,["isPopupOpen"]),s.value?(e.openBlock(),e.createElementBlock("div",te,[e.createElementVNode("div",se,[n.value[0]?(e.openBlock(),e.createBlock(z.default,{key:0,organization:n.value[0],showRating:!0,showFollowers:!1,showProducts:!1,class:"bg-light mn-b-thin w-100 o-hidden radius-big pd-small"},null,8,["organization"])):e.createCommentVNode("",!0),e.createElementVNode("div",ae,[e.createElementVNode("div",le,[e.createElementVNode("div",re,[ne,oe,e.createElementVNode("p",ie,e.toDisplayString(t.formatDate(s.value.createdAt)),1)])]),e.createElementVNode("div",ce,[de,e.createElementVNode("p",ue,e.toDisplayString(((r=s.value.customer.target)==null?void 0:r.number)||"Not specified"),1)]),e.createElementVNode("div",me,[pe,e.createElementVNode("p",he,e.toDisplayString(s.value.delivery.address?s.value.delivery.address.slice(0,64):"Not specified"),1)]),e.createElementVNode("div",_e,[be,e.createElementVNode("p",ve,e.toDisplayString(s.value.delivery.type?s.value.delivery.type:"Not specified"),1)])]),d.state.current.status_history?(e.openBlock(),e.createBlock(F.default,{key:1,statuses:o,statusHistory:d.state.current.status_history,statusCurrent:d.state.current.status,edit:e.unref(h).name==="Order Edit"},null,8,["statusHistory","statusCurrent","edit"])):e.createCommentVNode("",!0),t.payment&&t.payment.Status==="CONFIRMED"?(e.openBlock(),e.createElementBlock("span",ge,"Paid")):e.createCommentVNode("",!0)]),e.createElementVNode("div",fe,[Ne,e.createElementVNode("ul",Ve,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(N.value,(i,c)=>(e.openBlock(),e.createBlock(B.default,{key:i._id,editable:!1,product:i},null,8,["product"]))),128))]),e.createElementVNode("div",Ee,[e.createElementVNode("div",ke,[ye,e.createElementVNode("p",null,e.toDisplayString(e.unref(y))+" "+e.toDisplayString(t.returnCurrency()),1)]),e.createElementVNode("div",we,[Se,e.createElementVNode("p",null,e.toDisplayString(t.returnCurrency())+" "+e.toDisplayString(Math.trunc(100+20*((u=n.value[0])==null?void 0:u.distance)-7,5*(((m=n.value[0])==null?void 0:m.distance)/10))),1)]),e.createElementVNode("div",xe,[Ce,e.createElementVNode("p",Be,e.toDisplayString(t.returnCurrency())+" "+e.toDisplayString(Math.trunc(100+20*((p=n.value[0])==null?void 0:p.distance)-7,5*(((S=n.value[0])==null?void 0:S.distance)/10))+e.unref(y)),1)])]),De,e.createVNode(M.default,{username:e.unref(h).name==="Order Status"?((x=s.value.user)==null?void 0:x.name)||"User":"Weeder Support",chatID:e.unref(h).params.order,class:"radius-semi bg-white o-hidden"},null,8,["username","chatID"])])])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)}}},Oe=A.default(qe,[["__scopeId","data-v-ad498447"]]);exports.default=Oe;
@@ -9,13 +9,13 @@ import L from "../blocks/CardOrderItem.vue.js";
9
9
  import tt from "../../../organizations/components/blocks/CardOrganization.vue.js";
10
10
  import st from "../../../chats/components/pages/ChatPage.vue.js";
11
11
  import et from "../blocks/StatusHistory.vue.js";
12
- import { state as at } from "../../../globals/store/globals.js";
12
+ import { state as at } from "../../../globals/views/store/globals.js";
13
13
  import { actions as T, state as g } from "../../store/orders.js";
14
14
  import { actions as lt } from "../../../products/store/products.js";
15
15
  import { actions as it } from "../../../organizations/store/organizations.js";
16
16
  /* empty css */
17
17
  import nt from "../../../../../../_virtual/_plugin-vue_export-helper.js";
18
- const i = (k) => (G("data-v-75357432"), k = k(), J(), k), ot = {
18
+ const i = (k) => (G("data-v-ad498447"), k = k(), J(), k), ot = {
19
19
  key: 0,
20
20
  class: "pd-thin"
21
21
  }, rt = {
@@ -229,7 +229,7 @@ const i = (k) => (G("data-v-75357432"), k = k(), J(), k), ot = {
229
229
  ])) : b("", !0);
230
230
  };
231
231
  }
232
- }, _s = /* @__PURE__ */ nt(Qt, [["__scopeId", "data-v-75357432"]]);
232
+ }, _s = /* @__PURE__ */ nt(Qt, [["__scopeId", "data-v-ad498447"]]);
233
233
  export {
234
234
  _s as default
235
235
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),C=require("../blocks/CardOrderItem.vue.cjs"),N=require("../sections/AskToLogin.vue.cjs"),q=require("../sections/Succes.vue.cjs"),E=require("../sections/EmptyState.vue.cjs"),S=require("../sections/FormCustomerDetails.vue.cjs"),w=require("../sections/FormDelivery.vue.cjs"),P=require("../sections/FormPayment.vue.cjs"),g=require("vue-router"),D=require("../../../globals/store/globals.cjs"),i=require("../../../auth/views/store/auth.cjs"),s=require("../../store/shopcart.cjs"),y=require("../../../organizations/store/organizations.cjs"),t=require("../../store/orders.cjs"),O=require("../../../users/store/users.cjs");;/* empty css */const T={class:"pd-thin"},M={class:"gap-small mn-b-thin cols-2"},z={key:2,class:"order-form col"},F={key:3,class:"bg-light pd-medium radius-big"},I=e.createElementVNode("h4",{class:"font-second mn-b-thin"},"Your Order",-1),R={class:"flex gap-thin flex-wrap mn-b-thin"},A={class:"bg-main pd-thin radius-medium mn-b-thin"},L={class:"pd-small br-b br-solid br-black-transp-10"},Q={class:"pd-small br-b br-solid br-black-transp-10"},U={class:"pd-small h3"},j=["disabled"],Y=e.createElementVNode("p",{class:"mn-b-thin"},[e.createTextVNode(" I agree that placing the order places me under an obligation to make a payment in accordance with "),e.createElementVNode("a",{class:"t-semi font-second t-second",href:"/legal/terms-of-use",target:"_blank"},"Terms of Use.")],-1),$=e.createElementVNode("p",null,null,-1),x={__name:"OrderCreate",setup(G){g.useRoute();const v=g.useRouter(),d=e.computed(()=>t.state.current);e.computed(()=>O.state.current);const c=e.computed(()=>s.getters.cartTotalPrice),l=e.computed(()=>{var r;if(t.state.current.delivery.type==="pickup")return 0;if(t.state.current.delivery.type==="mail")return 350;if(t.state.current.delivery.type==="courier"){const o=((r=u.value[0])==null?void 0:r.distance)||0;return Math.trunc(100+20*o-7.5*(o/10))}return 0});e.computed(()=>l.value+c.value.value);const u=e.ref({});e.onMounted(async()=>{var r;u.value=await y.actions.read({_id:s.state.organization,location:(r=D.state.position)==null?void 0:r.location})}),e.watch(()=>t.state.current.delivery.address,async(r,o)=>{u.value=await y.actions.read({_id:s.state.organization,location:t.state.current.delivery.location})},{deep:!0});const _=e.computed(()=>{var r;return((r=t.state.current.customer.name)==null?void 0:r.length)<2}),k=e.computed(()=>{var a,m,p,h;const r=(a=t.state.current.customer.messenger)==null?void 0:a.type,o=((p=(m=t.state.current.customer.messenger)==null?void 0:m.value)==null?void 0:p.length)>2;return!(((h=t.state.current.customer.number)==null?void 0:h.length)>0)&&!(r&&o)}),f=e.computed(()=>t.state.current.delivery.type!=="Pickup"&&t.state.current.delivery.address<2),b=e.computed(()=>!t.state.current.delivery.type),V=e.computed(()=>!t.state.current.payment.type);async function B(){t.state.current.status="created",t.state.current.owner={target:s.state.organization,type:"organization"},i.state.user._id&&(t.state.current.creator={target:i.state.user._id,type:"User"}),t.state.current.positions=s.state.positions;const r=localStorage.getItem("referalCode");r&&(t.state.current.referralCode=r);let o=await t.actions.create(t.state.current);o?(s.actions.resetShopcart(),v.push({name:"Order Status",params:{order:o._id}})):alert("something wrong")}return(r,o)=>(e.openBlock(),e.createElementBlock("section",T,[i.state.access.status===!1?(e.openBlock(),e.createBlock(N.default,{key:0,class:"mn-b-thin"})):e.createCommentVNode("",!0),e.createElementVNode("div",M,[s.state.positions<1?(e.openBlock(),e.createBlock(E.default,{key:0})):e.createCommentVNode("",!0),d.value.status===!0&&s.state.positions.length>0?(e.openBlock(),e.createBlock(q.default,{key:1,order:d.value},null,8,["order"])):e.createCommentVNode("",!0),t.state.current.status!==!0&&s.state.positions.length>0?(e.openBlock(),e.createElementBlock("div",z,[e.createVNode(S.default,{customer:t.state.current.customer},null,8,["customer"]),t.state.current.status!==!0&&s.state.positions.length>0?(e.openBlock(),e.createBlock(w.default,{key:0,order:t.state.current},null,8,["order"])):e.createCommentVNode("",!0),t.state.current.status!==!0&&s.state.positions.length>0?(e.openBlock(),e.createBlock(P.default,{key:1,order:t.state.current},null,8,["order"])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),s.state.positions.length>0?(e.openBlock(),e.createElementBlock("div",F,[I,e.createElementVNode("ul",R,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.state.positions,n=>(e.openBlock(),e.createBlock(C.default,{key:n._id,editable:!0,product:n,increase:a=>s.actions.incrementItemQuantity(a._id),decrease:a=>s.actions.decrementItemQuantity(a._id),remove:a=>s.actions.removeProduct(a._id),class:"w-100 bg-white pd-small radius-medium"},null,8,["product","increase","decrease","remove"]))),128))]),e.createElementVNode("div",A,[e.createElementVNode("p",L," Subtotal: "+e.toDisplayString(r.returnCurrency())+" "+e.toDisplayString(c.value),1),e.createElementVNode("p",Q," Delivery: "+e.toDisplayString(r.returnCurrency())+" "+e.toDisplayString(l.value),1),e.createElementVNode("p",U," Total: "+e.toDisplayString(r.returnCurrency())+" "+e.toDisplayString(l.value+c.value.value),1)]),t.state.current.status!==!0&&s.state.positions.length>0?(e.openBlock(),e.createElementBlock("button",{key:0,disabled:_.value||k.value||r.errorCity||f.value||b.value||V.value,onClick:o[0]||(o[0]=n=>B()),class:"bg-main mn-b-small pd-small radius-big w-100 button"}," Place an Order ",8,j)):e.createCommentVNode("",!0),Y,$])):e.createCommentVNode("",!0)])]))}};exports.default=x;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),C=require("../blocks/CardOrderItem.vue.cjs"),N=require("../sections/AskToLogin.vue.cjs"),q=require("../sections/Succes.vue.cjs"),E=require("../sections/EmptyState.vue.cjs"),S=require("../sections/FormCustomerDetails.vue.cjs"),w=require("../sections/FormDelivery.vue.cjs"),P=require("../sections/FormPayment.vue.cjs"),g=require("vue-router"),D=require("../../../globals/views/store/globals.cjs"),i=require("../../../auth/views/store/auth.cjs"),s=require("../../store/shopcart.cjs"),y=require("../../../organizations/store/organizations.cjs"),t=require("../../store/orders.cjs"),O=require("../../../users/store/users.cjs");;/* empty css */const T={class:"pd-thin"},M={class:"gap-small mn-b-thin cols-2"},z={key:2,class:"order-form col"},F={key:3,class:"bg-light pd-medium radius-big"},I=e.createElementVNode("h4",{class:"font-second mn-b-thin"},"Your Order",-1),R={class:"flex gap-thin flex-wrap mn-b-thin"},A={class:"bg-main pd-thin radius-medium mn-b-thin"},L={class:"pd-small br-b br-solid br-black-transp-10"},Q={class:"pd-small br-b br-solid br-black-transp-10"},U={class:"pd-small h3"},j=["disabled"],Y=e.createElementVNode("p",{class:"mn-b-thin"},[e.createTextVNode(" I agree that placing the order places me under an obligation to make a payment in accordance with "),e.createElementVNode("a",{class:"t-semi font-second t-second",href:"/legal/terms-of-use",target:"_blank"},"Terms of Use.")],-1),$=e.createElementVNode("p",null,null,-1),x={__name:"OrderCreate",setup(G){g.useRoute();const v=g.useRouter(),d=e.computed(()=>t.state.current);e.computed(()=>O.state.current);const c=e.computed(()=>s.getters.cartTotalPrice),l=e.computed(()=>{var r;if(t.state.current.delivery.type==="pickup")return 0;if(t.state.current.delivery.type==="mail")return 350;if(t.state.current.delivery.type==="courier"){const o=((r=u.value[0])==null?void 0:r.distance)||0;return Math.trunc(100+20*o-7.5*(o/10))}return 0});e.computed(()=>l.value+c.value.value);const u=e.ref({});e.onMounted(async()=>{var r;u.value=await y.actions.read({_id:s.state.organization,location:(r=D.state.position)==null?void 0:r.location})}),e.watch(()=>t.state.current.delivery.address,async(r,o)=>{u.value=await y.actions.read({_id:s.state.organization,location:t.state.current.delivery.location})},{deep:!0});const _=e.computed(()=>{var r;return((r=t.state.current.customer.name)==null?void 0:r.length)<2}),k=e.computed(()=>{var a,m,p,h;const r=(a=t.state.current.customer.messenger)==null?void 0:a.type,o=((p=(m=t.state.current.customer.messenger)==null?void 0:m.value)==null?void 0:p.length)>2;return!(((h=t.state.current.customer.number)==null?void 0:h.length)>0)&&!(r&&o)}),f=e.computed(()=>t.state.current.delivery.type!=="Pickup"&&t.state.current.delivery.address<2),b=e.computed(()=>!t.state.current.delivery.type),V=e.computed(()=>!t.state.current.payment.type);async function B(){t.state.current.status="created",t.state.current.owner={target:s.state.organization,type:"organization"},i.state.user._id&&(t.state.current.creator={target:i.state.user._id,type:"User"}),t.state.current.positions=s.state.positions;const r=localStorage.getItem("referalCode");r&&(t.state.current.referralCode=r);let o=await t.actions.create(t.state.current);o?(s.actions.resetShopcart(),v.push({name:"Order Status",params:{order:o._id}})):alert("something wrong")}return(r,o)=>(e.openBlock(),e.createElementBlock("section",T,[i.state.access.status===!1?(e.openBlock(),e.createBlock(N.default,{key:0,class:"mn-b-thin"})):e.createCommentVNode("",!0),e.createElementVNode("div",M,[s.state.positions<1?(e.openBlock(),e.createBlock(E.default,{key:0})):e.createCommentVNode("",!0),d.value.status===!0&&s.state.positions.length>0?(e.openBlock(),e.createBlock(q.default,{key:1,order:d.value},null,8,["order"])):e.createCommentVNode("",!0),t.state.current.status!==!0&&s.state.positions.length>0?(e.openBlock(),e.createElementBlock("div",z,[e.createVNode(S.default,{customer:t.state.current.customer},null,8,["customer"]),t.state.current.status!==!0&&s.state.positions.length>0?(e.openBlock(),e.createBlock(w.default,{key:0,order:t.state.current},null,8,["order"])):e.createCommentVNode("",!0),t.state.current.status!==!0&&s.state.positions.length>0?(e.openBlock(),e.createBlock(P.default,{key:1,order:t.state.current},null,8,["order"])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),s.state.positions.length>0?(e.openBlock(),e.createElementBlock("div",F,[I,e.createElementVNode("ul",R,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.state.positions,n=>(e.openBlock(),e.createBlock(C.default,{key:n._id,editable:!0,product:n,increase:a=>s.actions.incrementItemQuantity(a._id),decrease:a=>s.actions.decrementItemQuantity(a._id),remove:a=>s.actions.removeProduct(a._id),class:"w-100 bg-white pd-small radius-medium"},null,8,["product","increase","decrease","remove"]))),128))]),e.createElementVNode("div",A,[e.createElementVNode("p",L," Subtotal: "+e.toDisplayString(r.returnCurrency())+" "+e.toDisplayString(c.value),1),e.createElementVNode("p",Q," Delivery: "+e.toDisplayString(r.returnCurrency())+" "+e.toDisplayString(l.value),1),e.createElementVNode("p",U," Total: "+e.toDisplayString(r.returnCurrency())+" "+e.toDisplayString(l.value+c.value.value),1)]),t.state.current.status!==!0&&s.state.positions.length>0?(e.openBlock(),e.createElementBlock("button",{key:0,disabled:_.value||k.value||r.errorCity||f.value||b.value||V.value,onClick:o[0]||(o[0]=n=>B()),class:"bg-main mn-b-small pd-small radius-big w-100 button"}," Place an Order ",8,j)):e.createCommentVNode("",!0),Y,$])):e.createCommentVNode("",!0)])]))}};exports.default=x;
@@ -7,7 +7,7 @@ import x from "../sections/FormCustomerDetails.vue.js";
7
7
  import A from "../sections/FormDelivery.vue.js";
8
8
  import L from "../sections/FormPayment.vue.js";
9
9
  import { useRoute as Y, useRouter as j } from "vue-router";
10
- import { state as q } from "../../../globals/store/globals.js";
10
+ import { state as q } from "../../../globals/views/store/globals.js";
11
11
  import { state as y } from "../../../auth/views/store/auth.js";
12
12
  import { getters as G, state as t, actions as p } from "../../store/shopcart.js";
13
13
  import { actions as $ } from "../../../organizations/store/organizations.js";
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),f=require("vue-router");;/* empty css */const P=require("../../../../components/Button/Button.vue2.cjs"),q=require("../../../../components/Tab/Tab.vue2.cjs"),k=require("../../../../components/Popup/Popup.vue2.cjs"),u=require("../../../../components/Block/Block.vue.cjs"),b=require("../../../../components/Feed/Feed.vue.cjs"),_=require("../blocks/CardOrderItem.vue.cjs");;/* empty css */;/* empty css */const C=require("../../../users/components/blocks/CardUser.vue.cjs"),V=require("../sections/FormAddCustomer.vue.cjs"),O=require("../sections/FormDelivery.vue.cjs"),E=require("../sections/FormPayment.vue.cjs"),l=require("../../../globals/store/globals.cjs"),F=require("../../../auth/views/store/auth.cjs"),t=require("../../store/orders.cjs"),S=require("../../../products/store/products.cjs"),D=require("../../store/customers.store.cjs");;/* empty css */const R={class:"h-100 flex flex-column pd-thin"},T={class:"flex-v-center flex-nowrap flex"},A=e.createElementVNode("h2",{class:"mn-r-auto"},"Create Order",-1),I=e.createElementVNode("h3",{class:"mn-b-small"},"Add to order",-1),z={class:"bg-light h-max-100 mn-b-thin o-scroll pd-medium radius-big"},L={key:0,class:"w-100"},M={class:"h3 flex"},U=e.createElementVNode("span",{class:"mn-r-auto t-transp"},"In total",-1),j={__name:"OrderCreateBackoffice",setup(G){const a=f.useRoute(),g=f.useRouter();t.mutations.resetOrder(t.state.current);let v=e.computed(()=>Number(t.state.current.positions.reduce((d,n)=>d+n.price*n.quantity,0)));const s=e.ref("positions"),c=e.ref(!1);function y(){c.value=!0}function m(){c.value=!1}const i=e.ref(!1);function B(){i.value=!0}function p(){i.value=!1}e.ref(null);function w(){t.state.current.creator={type:"User",target:F.state.user._id},t.state.current.owner={type:"Organization",target:a.params._id},t.state.current.customer={type:"Customer",target:t.state.current.customer._id||null},t.actions.create(t.state.current)}function x(){g.push({name:"Backoffice Orders",params:{_id:a.params._id}})}return e.onMounted(()=>{}),(d,n)=>(e.openBlock(),e.createElementBlock("div",R,[e.createVNode(u.default,{class:"mn-b-thin"},{default:e.withCtx(()=>[e.createElementVNode("header",T,[A,e.createVNode(P.default,{submit:w,callback:x,class:"pd-small radius-big bg-main t-black uppercase t-medium"},{default:e.withCtx(()=>[e.createTextVNode(" Add Order ")]),_:1})])]),_:1}),e.createVNode(q.default,{selected:s.value,"onUpdate:selected":n[0]||(n[0]=r=>s.value=r),tabs:[{name:"Positions",value:"positions"},{name:"Customer",value:"customer"},{name:"Delivery",value:"delivery"},{name:"Payment",value:"payment"}],class:"t-medium radius-medium bg-light mn-b-small"},null,8,["selected"]),e.createVNode(k.default,{onClosePopup:m,isPopupOpen:c.value,class:"bg-white w-min-30r w-max-30r h-max-100 flex flex-column radius-big pd-medium pos-relative"},{default:e.withCtx(()=>[I,e.createElementVNode("div",z,[e.createVNode(b.default,{search:{placeholder:"Search products...",class:"bg-white mn-b-thin"},states:{empty:{title:"No Products Found",description:"Currently, there are no such products available."}},store:{read:r=>S.actions.read(r),state:null},options:{organization:e.unref(a).params._id},class:""},{default:e.withCtx(({items:r})=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r,(o,N)=>(e.openBlock(),e.createBlock(_.default,{key:o._id,editable:!1,product:o,onClick:()=>{let h={...o};h.quantity=1,l.actions.add(t.state.current.positions,h),m()},class:"bg-white pd-thin radius-medium w-100 mn-b-thin"},null,8,["product","onClick"]))),128))]),_:1},8,["store","options"])])]),_:1},8,["isPopupOpen"]),s.value==="positions"?(e.openBlock(),e.createBlock(u.default,{key:0,title:"Positions",actions:[{label:"+",function:()=>y()}],class:"mn-b-small"},{default:e.withCtx(()=>[t.state.current.positions.length===0?(e.openBlock(),e.createElementBlock("span",L," No positions added yet ")):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.state.current.positions,(r,o)=>(e.openBlock(),e.createBlock(_.default,{key:r._id,editable:!0,product:r,onIncrease:()=>{l.actions.increment(t.state.current.positions,r)},onDecrease:()=>{l.actions.decrement(t.state.current.positions,r)},onRemove:()=>{l.actions.delete(t.state.current.positions,r)},class:"mn-b-thin pd-thin radius-medium bg-white"},null,8,["product","onIncrease","onDecrease","onRemove"]))),128))]),_:1},8,["actions"])):e.createCommentVNode("",!0),s.value==="customer"?(e.openBlock(),e.createBlock(u.default,{key:1,title:"Customer",class:"mn-b-semi",actions:[{label:"+",function:()=>B()}]},{default:e.withCtx(()=>[t.state.current.customer._id?(e.openBlock(),e.createBlock(C.default,{key:0,user:t.state.current.customer,photo:t.state.current.customer.profile.photo,name:t.state.current.customer.profile.name||t.state.current.customer.phone||t.state.current.customer.email,onClick:n[1]||(n[1]=()=>{t.mutations.resetCustomer(t.state.current.customer)}),class:"bg-white pd-thin h-4r radius-medium w-100 mn-b-thin"},null,8,["user","photo","name"])):(e.openBlock(),e.createBlock(b.default,{key:1,search:{placeholder:"Search customer...",class:"bg-white mn-b-thin"},states:{empty:{title:"No Products Found",description:"Currently, there are no such products available."}},store:{read:r=>e.unref(D.default).read(r),state:null},options:{owner:e.unref(a).params._id},class:"bg-light h-max-20r o-scroll"},{default:e.withCtx(({items:r})=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r,(o,N)=>(e.openBlock(),e.createBlock(C.default,{key:o._id,user:o,photo:o.profile.photo,name:o.profile.name||o.phone||o.email,onClick:()=>{t.state.current.customer=o},class:"bg-white pd-thin h-4r radius-medium w-100 mn-b-thin"},null,8,["user","photo","name","onClick"]))),128))]),_:1},8,["store","options"]))]),_:1},8,["actions"])):e.createCommentVNode("",!0),s.value==="delivery"?(e.openBlock(),e.createBlock(O.default,{key:2,order:t.state.current},null,8,["order"])):e.createCommentVNode("",!0),s.value==="payment"?(e.openBlock(),e.createBlock(E.default,{key:3,order:t.state.current},null,8,["order"])):e.createCommentVNode("",!0),e.createVNode(k.default,{title:"Add customer",onClosePopup:p,isPopupOpen:i.value,class:e.normalizeClass("bg-white w-min-30r w-max-30r radius-big pd-medium")},{default:e.withCtx(()=>[e.createVNode(V.default,{onCallbackCustomer:p})]),_:1},8,["isPopupOpen"]),e.createVNode(u.default,{class:"mn-b-semi"},{default:e.withCtx(()=>[e.createElementVNode("div",M,[U,e.createElementVNode("span",null,e.toDisplayString(e.unref(v))+" "+e.toDisplayString(d.returnCurrency()),1)])]),_:1})]))}};exports.default=j;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),f=require("vue-router");;/* empty css */const P=require("../../../../components/Button/Button.vue2.cjs"),q=require("../../../../components/Tab/Tab.vue2.cjs"),k=require("../../../../components/Popup/Popup.vue2.cjs"),u=require("../../../../components/Block/Block.vue.cjs"),b=require("../../../../components/Feed/Feed.vue.cjs"),_=require("../blocks/CardOrderItem.vue.cjs");;/* empty css */;/* empty css */const C=require("../../../users/components/blocks/CardUser.vue.cjs"),V=require("../sections/FormAddCustomer.vue.cjs"),O=require("../sections/FormDelivery.vue.cjs"),E=require("../sections/FormPayment.vue.cjs"),l=require("../../../globals/views/store/globals.cjs"),F=require("../../../auth/views/store/auth.cjs"),t=require("../../store/orders.cjs"),S=require("../../../products/store/products.cjs"),D=require("../../store/customers.store.cjs");;/* empty css */const R={class:"h-100 flex flex-column pd-thin"},T={class:"flex-v-center flex-nowrap flex"},A=e.createElementVNode("h2",{class:"mn-r-auto"},"Create Order",-1),I=e.createElementVNode("h3",{class:"mn-b-small"},"Add to order",-1),z={class:"bg-light h-max-100 mn-b-thin o-scroll pd-medium radius-big"},L={key:0,class:"w-100"},M={class:"h3 flex"},U=e.createElementVNode("span",{class:"mn-r-auto t-transp"},"In total",-1),j={__name:"OrderCreateBackoffice",setup(G){const a=f.useRoute(),g=f.useRouter();t.mutations.resetOrder(t.state.current);let v=e.computed(()=>Number(t.state.current.positions.reduce((d,n)=>d+n.price*n.quantity,0)));const s=e.ref("positions"),c=e.ref(!1);function y(){c.value=!0}function m(){c.value=!1}const i=e.ref(!1);function B(){i.value=!0}function p(){i.value=!1}e.ref(null);function w(){t.state.current.creator={type:"User",target:F.state.user._id},t.state.current.owner={type:"Organization",target:a.params._id},t.state.current.customer={type:"Customer",target:t.state.current.customer._id||null},t.actions.create(t.state.current)}function x(){g.push({name:"Backoffice Orders",params:{_id:a.params._id}})}return e.onMounted(()=>{}),(d,n)=>(e.openBlock(),e.createElementBlock("div",R,[e.createVNode(u.default,{class:"mn-b-thin"},{default:e.withCtx(()=>[e.createElementVNode("header",T,[A,e.createVNode(P.default,{submit:w,callback:x,class:"pd-small radius-big bg-main t-black uppercase t-medium"},{default:e.withCtx(()=>[e.createTextVNode(" Add Order ")]),_:1})])]),_:1}),e.createVNode(q.default,{selected:s.value,"onUpdate:selected":n[0]||(n[0]=r=>s.value=r),tabs:[{name:"Positions",value:"positions"},{name:"Customer",value:"customer"},{name:"Delivery",value:"delivery"},{name:"Payment",value:"payment"}],class:"t-medium radius-medium bg-light mn-b-small"},null,8,["selected"]),e.createVNode(k.default,{onClosePopup:m,isPopupOpen:c.value,class:"bg-white w-min-30r w-max-30r h-max-100 flex flex-column radius-big pd-medium pos-relative"},{default:e.withCtx(()=>[I,e.createElementVNode("div",z,[e.createVNode(b.default,{search:{placeholder:"Search products...",class:"bg-white mn-b-thin"},states:{empty:{title:"No Products Found",description:"Currently, there are no such products available."}},store:{read:r=>S.actions.read(r),state:null},options:{organization:e.unref(a).params._id},class:""},{default:e.withCtx(({items:r})=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r,(o,N)=>(e.openBlock(),e.createBlock(_.default,{key:o._id,editable:!1,product:o,onClick:()=>{let h={...o};h.quantity=1,l.actions.add(t.state.current.positions,h),m()},class:"bg-white pd-thin radius-medium w-100 mn-b-thin"},null,8,["product","onClick"]))),128))]),_:1},8,["store","options"])])]),_:1},8,["isPopupOpen"]),s.value==="positions"?(e.openBlock(),e.createBlock(u.default,{key:0,title:"Positions",actions:[{label:"+",function:()=>y()}],class:"mn-b-small"},{default:e.withCtx(()=>[t.state.current.positions.length===0?(e.openBlock(),e.createElementBlock("span",L," No positions added yet ")):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.state.current.positions,(r,o)=>(e.openBlock(),e.createBlock(_.default,{key:r._id,editable:!0,product:r,onIncrease:()=>{l.actions.increment(t.state.current.positions,r)},onDecrease:()=>{l.actions.decrement(t.state.current.positions,r)},onRemove:()=>{l.actions.delete(t.state.current.positions,r)},class:"mn-b-thin pd-thin radius-medium bg-white"},null,8,["product","onIncrease","onDecrease","onRemove"]))),128))]),_:1},8,["actions"])):e.createCommentVNode("",!0),s.value==="customer"?(e.openBlock(),e.createBlock(u.default,{key:1,title:"Customer",class:"mn-b-semi",actions:[{label:"+",function:()=>B()}]},{default:e.withCtx(()=>[t.state.current.customer._id?(e.openBlock(),e.createBlock(C.default,{key:0,user:t.state.current.customer,photo:t.state.current.customer.profile.photo,name:t.state.current.customer.profile.name||t.state.current.customer.phone||t.state.current.customer.email,onClick:n[1]||(n[1]=()=>{t.mutations.resetCustomer(t.state.current.customer)}),class:"bg-white pd-thin h-4r radius-medium w-100 mn-b-thin"},null,8,["user","photo","name"])):(e.openBlock(),e.createBlock(b.default,{key:1,search:{placeholder:"Search customer...",class:"bg-white mn-b-thin"},states:{empty:{title:"No Products Found",description:"Currently, there are no such products available."}},store:{read:r=>e.unref(D.default).read(r),state:null},options:{owner:e.unref(a).params._id},class:"bg-light h-max-20r o-scroll"},{default:e.withCtx(({items:r})=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r,(o,N)=>(e.openBlock(),e.createBlock(C.default,{key:o._id,user:o,photo:o.profile.photo,name:o.profile.name||o.phone||o.email,onClick:()=>{t.state.current.customer=o},class:"bg-white pd-thin h-4r radius-medium w-100 mn-b-thin"},null,8,["user","photo","name","onClick"]))),128))]),_:1},8,["store","options"]))]),_:1},8,["actions"])):e.createCommentVNode("",!0),s.value==="delivery"?(e.openBlock(),e.createBlock(O.default,{key:2,order:t.state.current},null,8,["order"])):e.createCommentVNode("",!0),s.value==="payment"?(e.openBlock(),e.createBlock(E.default,{key:3,order:t.state.current},null,8,["order"])):e.createCommentVNode("",!0),e.createVNode(k.default,{title:"Add customer",onClosePopup:p,isPopupOpen:i.value,class:e.normalizeClass("bg-white w-min-30r w-max-30r radius-big pd-medium")},{default:e.withCtx(()=>[e.createVNode(V.default,{onCallbackCustomer:p})]),_:1},8,["isPopupOpen"]),e.createVNode(u.default,{class:"mn-b-semi"},{default:e.withCtx(()=>[e.createElementVNode("div",M,[U,e.createElementVNode("span",null,e.toDisplayString(e.unref(v))+" "+e.toDisplayString(d.returnCurrency()),1)])]),_:1})]))}};exports.default=j;
@@ -13,7 +13,7 @@ import B from "../../../users/components/blocks/CardUser.vue.js";
13
13
  import H from "../sections/FormAddCustomer.vue.js";
14
14
  import J from "../sections/FormDelivery.vue.js";
15
15
  import K from "../sections/FormPayment.vue.js";
16
- import { actions as _ } from "../../../globals/store/globals.js";
16
+ import { actions as _ } from "../../../globals/views/store/globals.js";
17
17
  import { state as Q } from "../../../auth/views/store/auth.js";
18
18
  import { mutations as D, state as e, actions as W } from "../../store/orders.js";
19
19
  import { actions as X } from "../../../products/store/products.js";
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),p=require("vue-router");require("../../../../../node_modules/@vuepic/vue-datepicker/dist/vue-datepicker.cjs");;/* empty css */;/* empty css */const f=require("../../../../components/Block/Block.vue.cjs"),d=require("../../store/orders.cjs"),y=require("../../../auth/views/store/auth.cjs");;/* empty css */const N=require("../../../globals/components/blocks/CardHeader.vue.cjs"),b=require("../../../globals/components/sections/SectionPageTitle.vue.cjs"),V=require("../../../../components/Feed/Feed.vue.cjs"),E=require("../../../icons/entities/IconTime.vue.cjs"),k={class:"pd-thin"},w={class:"gap-micro flex-nowrap flex"},S={class:"w-100 bg-white radius-small pd-small"},D=e.createElementVNode("p",{class:"mn-b-thin"},"Total",-1),B={class:"w-100 bg-white radius-small pd-small"},x=e.createElementVNode("p",{class:"mn-b-thin"},"Paid",-1),C={class:"w-100 bg-white radius-small pd-small"},q=e.createElementVNode("p",{class:"mn-b-thin"},"Unpaid",-1),P={class:"mn-b-small pd-small bg-white radius-small flex-nowrap flex"},T={class:"w-100"},O={class:"mn-b-thin"},F={class:"t-truncate"},A={class:"w-100 t-right"},M={class:"mn-b-thin"},U={class:"cols-1 mn-b-small gap-thin pd-small bg-white radius-small"},L={class:"mn-r-auto"},R={class:"t-right"},z={class:"t-transp"},H={key:0},I={class:"mn-r-auto"},$={class:"t-right"},j={class:"t-transp"},G={class:"pd-small bg-white radius-small gap-micro flex-v-center flex-nowrap flex"},J={class:"t-medium mn-r-auto"},K={class:"flex-child flex-child-shrink-0 capitalize w-max t-medium radius-big pd-b-nano pd-t-nano pd-r-thin pd-l-thin bg-main"},Q=e.createElementVNode("span",{class:"flex-child flex-child-shrink-0 capitalize w-max t-medium radius-big pd-b-nano pd-t-nano pd-r-thin pd-l-thin t-white bg-red"}," Unpaid ",-1),W={key:0,class:"pos-relative radius-small bg-fifth-transp-10 mn-t-thin pd-small"},X=e.createElementVNode("p",{class:"mn-b-thin t-transp uppercase p-small t-medium"},"Comment",-1),Y={__name:"Orders",setup(Z){const h=p.useRoute();p.useRouter();const i=e.ref(!1),o=e.ref("all"),m=e.computed(()=>g(d.state.all)),_=e.computed(()=>v(d.state.all,"unpaid"));function g(a){return a.reduce((s,r)=>s+r.positions.reduce((l,t)=>l+t.price,0),0)}function v(a,s){return a.reduce((r,l)=>l.payment.status===s?r+l.positions.reduce((t,c)=>t+c.price,0):r,0)}return e.onMounted(async()=>{}),(a,s)=>{const r=e.resolveComponent("router-link");return e.openBlock(),e.createElementBlock("div",k,[e.createVNode(b.default,{title:"Orders","onUpdate:tabs_current":s[0]||(s[0]=l=>o.value=l),tabs_current:o.value,tabs:[{name:"All",value:"all"},{name:"Created",value:"created"},{name:"Confirmed",value:"confirmed"},{name:"Preparing",value:"preparing"},{name:"Prepared",value:"prepared"},{name:"In delivery",value:"in delivery"},{name:"Delivered",value:"delivered"},{name:"Closed",value:"closed"}],actions:[{to:{name:"AdminOrderAdd"},label:"Create Order"}],class:"mn-b-small bg-light bg-light radius-big"},null,8,["tabs_current"]),e.createVNode(f.default,{title:"Balance",class:"mn-b-thin"},{default:e.withCtx(()=>[e.createElementVNode("div",w,[e.createElementVNode("div",S,[D,e.createElementVNode("h3",null,e.toDisplayString(a.formatPrice(m.value)),1)]),e.createElementVNode("div",B,[x,e.createElementVNode("h3",null,e.toDisplayString(a.formatPrice(_.value)),1)]),e.createElementVNode("div",C,[q,e.createElementVNode("h3",null,e.toDisplayString(a.formatPrice(m.value)),1)])])]),_:1}),e.createVNode(V.default,{search:!0,states:{empty:{title:"No Orders Found",description:"Currently, there are no orders."}},store:{read:l=>d.actions.read(l)},options:{limit:15,owner:e.unref(h).params._id,...o.value!=="all"&&{status:o.value}},class:"gap-thin cols-3"},{default:e.withCtx(({items:l})=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l,t=>(e.openBlock(),e.createBlock(r,{to:{name:"Order Edit",params:{order:t._id}},class:"bg-light pos-relative pd-medium radius-big"},{default:e.withCtx(()=>{var c;return[e.createVNode(N.default,{entity:t,entityType:"order",user:y.state.user,owner:t.creator,creator:t.creator,date:t.createdAt,class:"mn-b-small"},null,8,["entity","user","owner","creator","date"]),e.createElementVNode("div",P,[e.createElementVNode("div",T,[e.createElementVNode("h3",O,e.toDisplayString(((c=t.customer.target.profile)==null?void 0:c.name)||t.customer.target.phone||t.customer.target.email||"No name"),1),e.createElementVNode("p",F,e.toDisplayString(t.delivery.address||"Not specified"),1)]),e.createElementVNode("div",A,[e.createElementVNode("h3",M,e.toDisplayString(a.returnCurrency())+e.toDisplayString(d.getters.getTotal(t.positions)),1),e.createElementVNode("p",null,"#"+e.toDisplayString(t._id.slice(0,4)+"..."+t._id.slice(-4)),1)])]),e.createElementVNode("div",U,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.positions.slice(0,2),(n,u)=>(e.openBlock(),e.createElementBlock("div",{key:u,class:"w-100 flex"},[e.createElementVNode("p",L,e.toDisplayString(n.name),1),e.createElementVNode("p",R,[e.createTextVNode(e.toDisplayString(n.quantity)+" "+e.toDisplayString(n.type)+" x "+e.toDisplayString(n.price)+" ",1),e.createElementVNode("span",z,e.toDisplayString(a.returnCurrency()),1)])]))),128)),e.createVNode(e.Transition,{name:"fade"},{default:e.withCtx(()=>[i.value&&t.positions.length>2?(e.openBlock(),e.createElementBlock("div",H,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.positions.slice(2),(n,u)=>(e.openBlock(),e.createElementBlock("div",{key:u+2,class:"w-100 flex"},[e.createElementVNode("p",I,e.toDisplayString(n.name),1),e.createElementVNode("p",$,[e.createTextVNode(e.toDisplayString(n.quantity)+" "+e.toDisplayString(n.type)+" x "+e.toDisplayString(n.price)+" ",1),e.createElementVNode("span",j,e.toDisplayString(a.returnCurrency()),1)])]))),128))])):e.createCommentVNode("",!0)]),_:2},1024),t.positions.length>2?(e.openBlock(),e.createElementBlock("button",{key:0,onClick:s[1]||(s[1]=e.withModifiers(n=>i.value=!i.value,["prevent"])),class:"radius-big bg-light-transp-50 pd-nano w-100 flex-center flex"},e.toDisplayString(i.value?"Hide":`+${t.positions.length-2} more`),1)):e.createCommentVNode("",!0)]),e.createElementVNode("div",G,[e.createVNode(E.default,{class:"i-semi t-transp",fill:"rgb(var(--black)"}),e.createElementVNode("p",J,e.toDisplayString(a.formatDate(t.deadline)),1),e.createElementVNode("span",K,e.toDisplayString(t.status),1),Q]),t.comment?(e.openBlock(),e.createElementBlock("div",W,[X,e.createElementVNode("p",null,e.toDisplayString(t.comment),1)])):e.createCommentVNode("",!0)]}),_:2},1032,["to"]))),256))]),_:1},8,["store","options"])])}}};exports.default=Y;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),p=require("vue-router");require("../../../../../node_modules/@vuepic/vue-datepicker/dist/vue-datepicker.cjs");;/* empty css */;/* empty css */const f=require("../../../../components/Block/Block.vue.cjs"),d=require("../../store/orders.cjs"),y=require("../../../auth/views/store/auth.cjs");;/* empty css */const N=require("../../../globals/views/components/blocks/CardHeader.vue.cjs"),b=require("../../../globals/views/components/sections/SectionPageTitle.vue.cjs"),V=require("../../../../components/Feed/Feed.vue.cjs"),E=require("../../../icons/entities/IconTime.vue.cjs"),k={class:"pd-thin"},w={class:"gap-micro flex-nowrap flex"},S={class:"w-100 bg-white radius-small pd-small"},D=e.createElementVNode("p",{class:"mn-b-thin"},"Total",-1),B={class:"w-100 bg-white radius-small pd-small"},x=e.createElementVNode("p",{class:"mn-b-thin"},"Paid",-1),C={class:"w-100 bg-white radius-small pd-small"},q=e.createElementVNode("p",{class:"mn-b-thin"},"Unpaid",-1),P={class:"mn-b-small pd-small bg-white radius-small flex-nowrap flex"},T={class:"w-100"},O={class:"mn-b-thin"},F={class:"t-truncate"},A={class:"w-100 t-right"},M={class:"mn-b-thin"},U={class:"cols-1 mn-b-small gap-thin pd-small bg-white radius-small"},L={class:"mn-r-auto"},R={class:"t-right"},z={class:"t-transp"},H={key:0},I={class:"mn-r-auto"},$={class:"t-right"},j={class:"t-transp"},G={class:"pd-small bg-white radius-small gap-micro flex-v-center flex-nowrap flex"},J={class:"t-medium mn-r-auto"},K={class:"flex-child flex-child-shrink-0 capitalize w-max t-medium radius-big pd-b-nano pd-t-nano pd-r-thin pd-l-thin bg-main"},Q=e.createElementVNode("span",{class:"flex-child flex-child-shrink-0 capitalize w-max t-medium radius-big pd-b-nano pd-t-nano pd-r-thin pd-l-thin t-white bg-red"}," Unpaid ",-1),W={key:0,class:"pos-relative radius-small bg-fifth-transp-10 mn-t-thin pd-small"},X=e.createElementVNode("p",{class:"mn-b-thin t-transp uppercase p-small t-medium"},"Comment",-1),Y={__name:"Orders",setup(Z){const h=p.useRoute();p.useRouter();const i=e.ref(!1),o=e.ref("all"),m=e.computed(()=>g(d.state.all)),_=e.computed(()=>v(d.state.all,"unpaid"));function g(a){return a.reduce((s,r)=>s+r.positions.reduce((l,t)=>l+t.price,0),0)}function v(a,s){return a.reduce((r,l)=>l.payment.status===s?r+l.positions.reduce((t,c)=>t+c.price,0):r,0)}return e.onMounted(async()=>{}),(a,s)=>{const r=e.resolveComponent("router-link");return e.openBlock(),e.createElementBlock("div",k,[e.createVNode(b.default,{title:"Orders","onUpdate:tabs_current":s[0]||(s[0]=l=>o.value=l),tabs_current:o.value,tabs:[{name:"All",value:"all"},{name:"Created",value:"created"},{name:"Confirmed",value:"confirmed"},{name:"Preparing",value:"preparing"},{name:"Prepared",value:"prepared"},{name:"In delivery",value:"in delivery"},{name:"Delivered",value:"delivered"},{name:"Closed",value:"closed"}],actions:[{to:{name:"AdminOrderAdd"},label:"Create Order"}],class:"mn-b-small bg-light bg-light radius-big"},null,8,["tabs_current"]),e.createVNode(f.default,{title:"Balance",class:"mn-b-thin"},{default:e.withCtx(()=>[e.createElementVNode("div",w,[e.createElementVNode("div",S,[D,e.createElementVNode("h3",null,e.toDisplayString(a.formatPrice(m.value)),1)]),e.createElementVNode("div",B,[x,e.createElementVNode("h3",null,e.toDisplayString(a.formatPrice(_.value)),1)]),e.createElementVNode("div",C,[q,e.createElementVNode("h3",null,e.toDisplayString(a.formatPrice(m.value)),1)])])]),_:1}),e.createVNode(V.default,{search:!0,states:{empty:{title:"No Orders Found",description:"Currently, there are no orders."}},store:{read:l=>d.actions.read(l)},options:{limit:15,owner:e.unref(h).params._id,...o.value!=="all"&&{status:o.value}},class:"gap-thin cols-3"},{default:e.withCtx(({items:l})=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l,t=>(e.openBlock(),e.createBlock(r,{to:{name:"Order Edit",params:{order:t._id}},class:"bg-light pos-relative pd-medium radius-big"},{default:e.withCtx(()=>{var c;return[e.createVNode(N.default,{entity:t,entityType:"order",user:y.state.user,owner:t.creator,creator:t.creator,date:t.createdAt,class:"mn-b-small"},null,8,["entity","user","owner","creator","date"]),e.createElementVNode("div",P,[e.createElementVNode("div",T,[e.createElementVNode("h3",O,e.toDisplayString(((c=t.customer.target.profile)==null?void 0:c.name)||t.customer.target.phone||t.customer.target.email||"No name"),1),e.createElementVNode("p",F,e.toDisplayString(t.delivery.address||"Not specified"),1)]),e.createElementVNode("div",A,[e.createElementVNode("h3",M,e.toDisplayString(a.returnCurrency())+e.toDisplayString(d.getters.getTotal(t.positions)),1),e.createElementVNode("p",null,"#"+e.toDisplayString(t._id.slice(0,4)+"..."+t._id.slice(-4)),1)])]),e.createElementVNode("div",U,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.positions.slice(0,2),(n,u)=>(e.openBlock(),e.createElementBlock("div",{key:u,class:"w-100 flex"},[e.createElementVNode("p",L,e.toDisplayString(n.name),1),e.createElementVNode("p",R,[e.createTextVNode(e.toDisplayString(n.quantity)+" "+e.toDisplayString(n.type)+" x "+e.toDisplayString(n.price)+" ",1),e.createElementVNode("span",z,e.toDisplayString(a.returnCurrency()),1)])]))),128)),e.createVNode(e.Transition,{name:"fade"},{default:e.withCtx(()=>[i.value&&t.positions.length>2?(e.openBlock(),e.createElementBlock("div",H,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.positions.slice(2),(n,u)=>(e.openBlock(),e.createElementBlock("div",{key:u+2,class:"w-100 flex"},[e.createElementVNode("p",I,e.toDisplayString(n.name),1),e.createElementVNode("p",$,[e.createTextVNode(e.toDisplayString(n.quantity)+" "+e.toDisplayString(n.type)+" x "+e.toDisplayString(n.price)+" ",1),e.createElementVNode("span",j,e.toDisplayString(a.returnCurrency()),1)])]))),128))])):e.createCommentVNode("",!0)]),_:2},1024),t.positions.length>2?(e.openBlock(),e.createElementBlock("button",{key:0,onClick:s[1]||(s[1]=e.withModifiers(n=>i.value=!i.value,["prevent"])),class:"radius-big bg-light-transp-50 pd-nano w-100 flex-center flex"},e.toDisplayString(i.value?"Hide":`+${t.positions.length-2} more`),1)):e.createCommentVNode("",!0)]),e.createElementVNode("div",G,[e.createVNode(E.default,{class:"i-semi t-transp",fill:"rgb(var(--black)"}),e.createElementVNode("p",J,e.toDisplayString(a.formatDate(t.deadline)),1),e.createElementVNode("span",K,e.toDisplayString(t.status),1),Q]),t.comment?(e.openBlock(),e.createElementBlock("div",W,[X,e.createElementVNode("p",null,e.toDisplayString(t.comment),1)])):e.createCommentVNode("",!0)]}),_:2},1032,["to"]))),256))]),_:1},8,["store","options"])])}}};exports.default=Y;
@@ -7,8 +7,8 @@ import q from "../../../../components/Block/Block.vue.js";
7
7
  import { state as k, actions as z, getters as F } from "../../store/orders.js";
8
8
  import { state as I } from "../../../auth/views/store/auth.js";
9
9
  /* empty css */
10
- import M from "../../../globals/components/blocks/CardHeader.vue.js";
11
- import R from "../../../globals/components/sections/SectionPageTitle.vue.js";
10
+ import M from "../../../globals/views/components/blocks/CardHeader.vue.js";
11
+ import R from "../../../globals/views/components/sections/SectionPageTitle.vue.js";
12
12
  import S from "../../../../components/Feed/Feed.vue.js";
13
13
  import H from "../../../icons/entities/IconTime.vue.js";
14
14
  const L = { class: "pd-thin" }, j = { class: "gap-micro flex-nowrap flex" }, G = { class: "w-100 bg-white radius-small pd-small" }, J = /* @__PURE__ */ e("p", { class: "mn-b-thin" }, "Total", -1), K = { class: "w-100 bg-white radius-small pd-small" }, Q = /* @__PURE__ */ e("p", { class: "mn-b-thin" }, "Paid", -1), W = { class: "w-100 bg-white radius-small pd-small" }, X = /* @__PURE__ */ e("p", { class: "mn-b-thin" }, "Unpaid", -1), Y = { class: "mn-b-small pd-small bg-white radius-small flex-nowrap flex" }, Z = { class: "w-100" }, ee = { class: "mn-b-thin" }, te = { class: "t-truncate" }, se = { class: "w-100 t-right" }, ae = { class: "mn-b-thin" }, ne = { class: "cols-1 mn-b-small gap-thin pd-small bg-white radius-small" }, le = { class: "mn-r-auto" }, ie = { class: "t-right" }, re = { class: "t-transp" }, oe = { key: 0 }, ce = { class: "mn-r-auto" }, de = { class: "t-right" }, me = { class: "t-transp" }, ue = { class: "pd-small bg-white radius-small gap-micro flex-v-center flex-nowrap flex" }, pe = { class: "t-medium mn-r-auto" }, _e = { class: "flex-child flex-child-shrink-0 capitalize w-max t-medium radius-big pd-b-nano pd-t-nano pd-r-thin pd-l-thin bg-main" }, he = /* @__PURE__ */ e("span", { class: "flex-child flex-child-shrink-0 capitalize w-max t-medium radius-big pd-b-nano pd-t-nano pd-r-thin pd-l-thin t-white bg-red" }, " Unpaid ", -1), fe = {
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),h=require("vue-router"),k=require("../../../../components/Block/Block.vue.cjs");;/* empty css */const b=require("../../../../components/FieldPhone/click-outside.cjs");;/* empty css */const g=require("../../../../components/Feed/Feed.vue.cjs"),v=require("../../../../components/Button/Button.vue2.cjs"),C=require("../../../globals/components/blocks/BlockSearch.vue.cjs"),n=require("../../../users/components/blocks/CardUser.vue.cjs"),q=require("./FormCustomerDetails.vue.cjs"),_=require("../../../users/store/users.cjs"),w=require("../../../auth/views/store/auth.cjs"),B=require("../../../globals/store/globals.cjs"),y=require("../../store/customers.store.cjs"),x=require("../../store/models/customer.cjs"),E={key:2,class:"mn-t-thin pos-absolute w-100 pos-t-100 pos-l-0 z-index-3 bg-light pd-small radius-small"},N={__name:"FormAddCustomer",props:{order:Object},emits:["callbackCustomer"],setup(V,{emit:i}){let c=b.default;const d=i,m=h.useRoute();let r=e.ref(x.default),u=e.ref(null),l=e.ref(!1);async function f(){let a={identity:{type:r.value.user?"User":"Visitor",target:r.value.user?r.value.user._id:null},owner:{type:"Organization",target:m.params._id},creator:{type:"User",target:w.state.user._id},phone:r.value.phone,email:r.value.email,profile:r.value.profile,socials:r.value.socials};try{let o=await y.default.create(a);r.value=o}catch(o){console.log(o)}}function p(){d("callbackCustomer",r.value)}return(a,o)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createVNode(k.default,{class:"pos-relative mn-b-thin"},{default:e.withCtx(()=>[e.unref(r).user?(e.openBlock(),e.createBlock(n.default,{key:1,user:e.unref(r).user,photo:e.unref(r).user.profile.photo,name:e.unref(r).user.profile.name||e.unref(r).user.phone||e.unref(r).user.email,onClick:o[1]||(o[1]=()=>{e.unref(r).user=null}),class:"bg-white h-2r pd-thin radius-medium w-100"},null,8,["user","photo","name"])):e.withDirectives((e.openBlock(),e.createBlock(C.default,{key:0,onSearch:o[0]||(o[0]=s=>{e.isRef(u)?u.value=s:u=s,e.isRef(l)?l.value=!0:l=!0}),placeholder:"Enter name, phone or email",class:"bg-white"},null,512)),[[e.unref(c),()=>{e.isRef(l)?l.value=!1:l=!1}]]),e.unref(u)&&e.unref(l)&&!e.unref(r).user?(e.openBlock(),e.createElementBlock("div",E,[e.createVNode(g.default,{states:{empty:{title:"No User Found",description:"Currently, there are no such user."}},store:{read:s=>_.actions.read(s),state:null},options:{search:e.unref(u)},showLoadMore:!1,class:"h-max-20r o-scroll"},{default:e.withCtx(({items:s})=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s,(t,F)=>(e.openBlock(),e.createBlock(n.default,{key:t._id,user:t,photo:t.profile.photo,name:t.profile.name||t.phone||t.email,onClick:()=>{e.unref(r).user=t,e.unref(r).profile=t.profile,e.unref(r).phone=t.phone,e.unref(r).email=t.email,e.unref(r).socials=t.socials},class:"bg-white h-2r pd-thin radius-medium w-100 mn-b-thin"},null,8,["user","photo","name","onClick"]))),128))]),_:1},8,["store","options"])])):e.createCommentVNode("",!0)]),_:1}),e.createVNode(q.default,{customer:e.unref(r),class:"mn-b-thin bg-light"},null,8,["customer"]),e.createVNode(v.default,{submit:f,callback:p,onError:e.unref(B.setError),class:"w-100 pd-small radius-big bg-main t-black uppercase t-medium"},{default:e.withCtx(()=>[e.createTextVNode(" Add Customer ")]),_:1},8,["onError"])],64))}};exports.default=N;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),h=require("vue-router"),k=require("../../../../components/Block/Block.vue.cjs");;/* empty css */const b=require("../../../../components/FieldPhone/click-outside.cjs");;/* empty css */const g=require("../../../../components/Feed/Feed.vue.cjs"),v=require("../../../../components/Button/Button.vue2.cjs"),C=require("../../../globals/views/components/blocks/BlockSearch.vue.cjs"),n=require("../../../users/components/blocks/CardUser.vue.cjs"),q=require("./FormCustomerDetails.vue.cjs"),_=require("../../../users/store/users.cjs"),w=require("../../../auth/views/store/auth.cjs"),B=require("../../../globals/views/store/globals.cjs"),y=require("../../store/customers.store.cjs"),x=require("../../store/models/customer.cjs"),E={key:2,class:"mn-t-thin pos-absolute w-100 pos-t-100 pos-l-0 z-index-3 bg-light pd-small radius-small"},N={__name:"FormAddCustomer",props:{order:Object},emits:["callbackCustomer"],setup(V,{emit:i}){let c=b.default;const d=i,m=h.useRoute();let r=e.ref(x.default),u=e.ref(null),l=e.ref(!1);async function f(){let a={identity:{type:r.value.user?"User":"Visitor",target:r.value.user?r.value.user._id:null},owner:{type:"Organization",target:m.params._id},creator:{type:"User",target:w.state.user._id},phone:r.value.phone,email:r.value.email,profile:r.value.profile,socials:r.value.socials};try{let o=await y.default.create(a);r.value=o}catch(o){console.log(o)}}function p(){d("callbackCustomer",r.value)}return(a,o)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createVNode(k.default,{class:"pos-relative mn-b-thin"},{default:e.withCtx(()=>[e.unref(r).user?(e.openBlock(),e.createBlock(n.default,{key:1,user:e.unref(r).user,photo:e.unref(r).user.profile.photo,name:e.unref(r).user.profile.name||e.unref(r).user.phone||e.unref(r).user.email,onClick:o[1]||(o[1]=()=>{e.unref(r).user=null}),class:"bg-white h-2r pd-thin radius-medium w-100"},null,8,["user","photo","name"])):e.withDirectives((e.openBlock(),e.createBlock(C.default,{key:0,onSearch:o[0]||(o[0]=s=>{e.isRef(u)?u.value=s:u=s,e.isRef(l)?l.value=!0:l=!0}),placeholder:"Enter name, phone or email",class:"bg-white"},null,512)),[[e.unref(c),()=>{e.isRef(l)?l.value=!1:l=!1}]]),e.unref(u)&&e.unref(l)&&!e.unref(r).user?(e.openBlock(),e.createElementBlock("div",E,[e.createVNode(g.default,{states:{empty:{title:"No User Found",description:"Currently, there are no such user."}},store:{read:s=>_.actions.read(s),state:null},options:{search:e.unref(u)},showLoadMore:!1,class:"h-max-20r o-scroll"},{default:e.withCtx(({items:s})=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s,(t,F)=>(e.openBlock(),e.createBlock(n.default,{key:t._id,user:t,photo:t.profile.photo,name:t.profile.name||t.phone||t.email,onClick:()=>{e.unref(r).user=t,e.unref(r).profile=t.profile,e.unref(r).phone=t.phone,e.unref(r).email=t.email,e.unref(r).socials=t.socials},class:"bg-white h-2r pd-thin radius-medium w-100 mn-b-thin"},null,8,["user","photo","name","onClick"]))),128))]),_:1},8,["store","options"])])):e.createCommentVNode("",!0)]),_:1}),e.createVNode(q.default,{customer:e.unref(r),class:"mn-b-thin bg-light"},null,8,["customer"]),e.createVNode(v.default,{submit:f,callback:p,onError:e.unref(B.setError),class:"w-100 pd-small radius-big bg-main t-black uppercase t-medium"},{default:e.withCtx(()=>[e.createTextVNode(" Add Customer ")]),_:1},8,["onError"])],64))}};exports.default=N;
@@ -6,12 +6,12 @@ import O from "../../../../components/FieldPhone/click-outside.js";
6
6
  /* empty css */
7
7
  import V from "../../../../components/Feed/Feed.vue.js";
8
8
  import B from "../../../../components/Button/Button.vue2.js";
9
- import F from "../../../globals/components/blocks/BlockSearch.vue.js";
9
+ import F from "../../../globals/views/components/blocks/BlockSearch.vue.js";
10
10
  import _ from "../../../users/components/blocks/CardUser.vue.js";
11
11
  import S from "./FormCustomerDetails.vue.js";
12
12
  import { actions as z } from "../../../users/store/users.js";
13
13
  import { state as A } from "../../../auth/views/store/auth.js";
14
- import { setError as D } from "../../../globals/store/globals.js";
14
+ import { setError as D } from "../../../globals/views/store/globals.js";
15
15
  import L from "../../store/customers.store.js";
16
16
  import R from "../../store/models/customer.js";
17
17
  const j = {
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("vue"),l=require("../../../globals/store/globals.cjs"),s=require("../../../../components/Block/Block.vue.cjs"),n=require("../../../../components/Address/Address.vue2.cjs"),u=require("../../../../components/LocationMarker/LocationMarker.vue2.cjs"),i=require("../../../../components/Radio/Radio.vue.cjs"),m=require("../../../../components/Field/Field.vue2.cjs"),y=t.createElementVNode("h4",{class:"font-second mn-b-thin"},"Select deliverty type",-1),c={class:"mn-b-small flex-nowrap flex"},v=t.createElementVNode("h4",{class:"font-second mn-b-thin"},"Address",-1),b={__name:"FormDelivery",props:{order:Object},setup(e){const o=e;return t.onMounted(()=>{l.state.position&&(o.order.delivery.address=l.state.position.address),l.state.position&&(o.order.delivery.location=l.state.position.location)}),(a,d)=>(t.openBlock(),t.createBlock(s.default,{title:"Delivery",class:"mn-b-thin",tooltip:"Delivery by mail takes 3-5 days."},{default:t.withCtx(()=>[y,t.createElementVNode("div",c,[t.createVNode(i.default,{radio:e.order.delivery.type,"onUpdate:radio":d[0]||(d[0]=r=>e.order.delivery.type=r),label:"Pickup",value:"pickup",class:"bg-white pd-medium radius-small w-100 mn-r-small"},null,8,["radio"]),t.createVNode(i.default,{radio:e.order.delivery.type,"onUpdate:radio":d[1]||(d[1]=r=>e.order.delivery.type=r),label:"Courier",value:"courier",class:"bg-white pd-medium radius-small w-100 mn-r-small"},null,8,["radio"]),t.createVNode(i.default,{radio:e.order.delivery.type,"onUpdate:radio":d[2]||(d[2]=r=>e.order.delivery.type=r),label:"Post",value:"mail",class:"bg-white pd-medium radius-small w-100"},null,8,["radio"])]),v,t.createVNode(n.default,{label:"Location",apiKey:a.GOOGLE_MAPS_API_KEY,address:e.order.delivery.address,location:e.order.delivery.location,placeholder:"Enter your address",class:"bg-white radius-tl-medium radius-tr-medium t-black pd-medium","onUpdate:location":d[3]||(d[3]=r=>{e.order.delivery.location=r}),"onUpdate:address":d[4]||(d[4]=r=>{e.order.delivery.address=r})},null,8,["apiKey","address","location"]),t.createVNode(u.default,{apiKey:a.GOOGLE_MAPS_API_KEY,address:e.order.delivery.address,location:e.order.delivery.location,class:"mn-b-thin radius-bl-medium radius-br-medium h-15r o-hidden","onUpdate:location":d[5]||(d[5]=r=>{e.order.delivery.location=r}),"onUpdate:address":d[6]||(d[6]=r=>{e.order.delivery.address=r})},null,8,["apiKey","address","location"]),t.createVNode(m.default,{field:e.order.comment,"onUpdate:field":d[7]||(d[7]=r=>e.order.comment=r),placeholder:"Comments regarding the address (apartment unit, floor level, building section)",type:"textarea",class:"bg-white pd-medium radius-small"},null,8,["field"])]),_:1}))}};exports.default=b;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("vue"),l=require("../../../globals/views/store/globals.cjs"),s=require("../../../../components/Block/Block.vue.cjs"),n=require("../../../../components/Address/Address.vue2.cjs"),u=require("../../../../components/LocationMarker/LocationMarker.vue2.cjs"),i=require("../../../../components/Radio/Radio.vue.cjs"),m=require("../../../../components/Field/Field.vue2.cjs"),y=t.createElementVNode("h4",{class:"font-second mn-b-thin"},"Select deliverty type",-1),c={class:"mn-b-small flex-nowrap flex"},v=t.createElementVNode("h4",{class:"font-second mn-b-thin"},"Address",-1),b={__name:"FormDelivery",props:{order:Object},setup(e){const o=e;return t.onMounted(()=>{l.state.position&&(o.order.delivery.address=l.state.position.address),l.state.position&&(o.order.delivery.location=l.state.position.location)}),(a,d)=>(t.openBlock(),t.createBlock(s.default,{title:"Delivery",class:"mn-b-thin",tooltip:"Delivery by mail takes 3-5 days."},{default:t.withCtx(()=>[y,t.createElementVNode("div",c,[t.createVNode(i.default,{radio:e.order.delivery.type,"onUpdate:radio":d[0]||(d[0]=r=>e.order.delivery.type=r),label:"Pickup",value:"pickup",class:"bg-white pd-medium radius-small w-100 mn-r-small"},null,8,["radio"]),t.createVNode(i.default,{radio:e.order.delivery.type,"onUpdate:radio":d[1]||(d[1]=r=>e.order.delivery.type=r),label:"Courier",value:"courier",class:"bg-white pd-medium radius-small w-100 mn-r-small"},null,8,["radio"]),t.createVNode(i.default,{radio:e.order.delivery.type,"onUpdate:radio":d[2]||(d[2]=r=>e.order.delivery.type=r),label:"Post",value:"mail",class:"bg-white pd-medium radius-small w-100"},null,8,["radio"])]),v,t.createVNode(n.default,{label:"Location",apiKey:a.GOOGLE_MAPS_API_KEY,address:e.order.delivery.address,location:e.order.delivery.location,placeholder:"Enter your address",class:"bg-white radius-tl-medium radius-tr-medium t-black pd-medium","onUpdate:location":d[3]||(d[3]=r=>{e.order.delivery.location=r}),"onUpdate:address":d[4]||(d[4]=r=>{e.order.delivery.address=r})},null,8,["apiKey","address","location"]),t.createVNode(u.default,{apiKey:a.GOOGLE_MAPS_API_KEY,address:e.order.delivery.address,location:e.order.delivery.location,class:"mn-b-thin radius-bl-medium radius-br-medium h-15r o-hidden","onUpdate:location":d[5]||(d[5]=r=>{e.order.delivery.location=r}),"onUpdate:address":d[6]||(d[6]=r=>{e.order.delivery.address=r})},null,8,["apiKey","address","location"]),t.createVNode(m.default,{field:e.order.comment,"onUpdate:field":d[7]||(d[7]=r=>e.order.comment=r),placeholder:"Comments regarding the address (apartment unit, floor level, building section)",type:"textarea",class:"bg-white pd-medium radius-small"},null,8,["field"])]),_:1}))}};exports.default=b;
@@ -1,5 +1,5 @@
1
1
  import { onMounted as n, openBlock as m, createBlock as u, withCtx as y, createElementVNode as t, createVNode as i } from "vue";
2
- import { state as o } from "../../../globals/store/globals.js";
2
+ import { state as o } from "../../../globals/views/store/globals.js";
3
3
  import v from "../../../../components/Block/Block.vue.js";
4
4
  import f from "../../../../components/Address/Address.vue2.js";
5
5
  import b from "../../../../components/LocationMarker/LocationMarker.vue2.js";
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("../../globals/components/layouts/Empty.vue.cjs"),r=[{path:"orders",meta:{title:{en:"Backoffice Orders",ru:"Управление Заказами"}},component:e.default,children:[{path:"",name:"Backoffice Orders",meta:{title:{en:"Backoffice Orders",ru:"Управление Заказами"}},component:()=>Promise.resolve().then(()=>require("../components/pages/Orders.vue.cjs"))},{path:"add",name:"AdminOrderAdd",component:()=>Promise.resolve().then(()=>require("../components/pages/OrderCreateBackoffice.vue.cjs"))},{path:":order",name:"AdminOrderEdit",component:()=>Promise.resolve().then(()=>require("../components/pages/OrderBackoffice.vue.cjs"))}]}];exports.default=r;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("../../globals/views/components/layouts/Empty.vue.cjs"),r=[{path:"orders",meta:{title:{en:"Backoffice Orders",ru:"Управление Заказами"}},component:e.default,children:[{path:"",name:"Backoffice Orders",meta:{title:{en:"Backoffice Orders",ru:"Управление Заказами"}},component:()=>Promise.resolve().then(()=>require("../components/pages/Orders.vue.cjs"))},{path:"add",name:"AdminOrderAdd",component:()=>Promise.resolve().then(()=>require("../components/pages/OrderCreateBackoffice.vue.cjs"))},{path:":order",name:"AdminOrderEdit",component:()=>Promise.resolve().then(()=>require("../components/pages/OrderBackoffice.vue.cjs"))}]}];exports.default=r;
@@ -1,4 +1,4 @@
1
- import e from "../../globals/components/layouts/Empty.vue.js";
1
+ import e from "../../globals/views/components/layouts/Empty.vue.js";
2
2
  const t = [
3
3
  {
4
4
  path: "orders",
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("../../globals/components/layouts/Empty.vue.cjs"),r={path:"orders",component:e.default,name:"Orders",meta:{title:{en:"Orders",ru:"Заказы"}},children:[{path:"form",name:"Form Order",meta:{title:{en:"Order",ru:"Заказ"}},component:()=>Promise.resolve().then(()=>require("../components/pages/OrderCreate.vue.cjs"))},{path:":order",name:"Order Status",meta:{title:{en:"Order",ru:"Заказ"}},component:()=>Promise.resolve().then(()=>require("../components/pages/OrderBackoffice.vue.cjs"))},{path:":order/edit",name:"Order Edit",meta:{title:{en:"Order",ru:"Заказ"}},component:()=>Promise.resolve().then(()=>require("../components/pages/OrderBackoffice.vue.cjs"))}]};exports.default=r;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("../../globals/views/components/layouts/Empty.vue.cjs"),r={path:"orders",component:e.default,name:"Orders",meta:{title:{en:"Orders",ru:"Заказы"}},children:[{path:"form",name:"Form Order",meta:{title:{en:"Order",ru:"Заказ"}},component:()=>Promise.resolve().then(()=>require("../components/pages/OrderCreate.vue.cjs"))},{path:":order",name:"Order Status",meta:{title:{en:"Order",ru:"Заказ"}},component:()=>Promise.resolve().then(()=>require("../components/pages/OrderBackoffice.vue.cjs"))},{path:":order/edit",name:"Order Edit",meta:{title:{en:"Order",ru:"Заказ"}},component:()=>Promise.resolve().then(()=>require("../components/pages/OrderBackoffice.vue.cjs"))}]};exports.default=r;
@@ -1,4 +1,4 @@
1
- import r from "../../globals/components/layouts/Empty.vue.js";
1
+ import r from "../../globals/views/components/layouts/Empty.vue.js";
2
2
  const t = {
3
3
  path: "orders",
4
4
  component: r,
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("vue"),s=require("../../globals/store/globals.cjs"),o=require("axios");process.env.NODE_ENV;const c=o.create({baseURL:process.env.API_URL}),a=t.reactive({all:[],current:{_id:"",status:"",name:"",email:"",chat:"",text:""},form:{status:!1,data:{name:"",phone:"",chat:"",text:""}}});async function n(r){return await c.post("/applications",r).then(e=>Promise.resolve(e.data),e=>(s.setError(e),Promise.reject(e)))}t.computed(()=>a.all);t.watch(a,(r,e)=>{});exports.create=n;exports.state=a;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("vue"),s=require("../../globals/views/store/globals.cjs"),o=require("axios");process.env.NODE_ENV;const c=o.create({baseURL:process.env.API_URL}),a=t.reactive({all:[],current:{_id:"",status:"",name:"",email:"",chat:"",text:""},form:{status:!1,data:{name:"",phone:"",chat:"",text:""}}});async function n(r){return await c.post("/applications",r).then(e=>Promise.resolve(e.data),e=>(s.setError(e),Promise.reject(e)))}t.computed(()=>a.all);t.watch(a,(r,e)=>{});exports.create=n;exports.state=a;
@@ -1,5 +1,5 @@
1
1
  import { reactive as r, computed as o, watch as s } from "vue";
2
- import { setError as n } from "../../globals/store/globals.js";
2
+ import { setError as n } from "../../globals/views/store/globals.js";
3
3
  import c from "axios";
4
4
  process.env.NODE_ENV;
5
5
  const i = c.create({ baseURL: process.env.API_URL }), a = r({
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("../../globals/services/globals.store.cjs"),s=new e.default(`${process.env.API_URL}/api/customers`);exports.default=s;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("../../globals/views/classes/globals.store.cjs"),s=new e.default(`${process.env.API_URL}/api/customers`);exports.default=s;
@@ -1,4 +1,4 @@
1
- import e from "../../globals/services/globals.store.js";
1
+ import e from "../../globals/views/classes/globals.store.js";
2
2
  const s = new e(`${process.env.API_URL}/api/customers`);
3
3
  export {
4
4
  s as default
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("vue"),u=require("axios"),s=require("../../globals/store/globals.cjs"),d=require("./models/order.cjs"),n=u.create({baseURL:process.env.API_URL,withCredentials:!0}),r=i.reactive({all:[],current:{...d.default}}),p={async create(e){try{const t=await n.post("/api/orders/create",e);return r.all.push(t.data),t.data}catch(t){s.setError(t)}},async read(e={}){try{const t=await n.get("/api/orders/read",{params:e});return e._id?o(t.data[0],"current"):o(t.data,"all"),t.data}catch(t){throw s.setError(t),t}},async update(e){try{const t=await n.post("/api/orders/update",e),a=r.all.findIndex(c=>c._id===e._id);return a!==-1&&(r.all[a]=t.data),t.data}catch(t){s.setError(t)}},async delete(e){try{await n.delete(`/api/orders/${e}`),r.all=r.all.filter(t=>t._id!==e)}catch(t){s.setError(t)}},async changePaymentStatus(e,t){try{const a=await n.post(`/api/orders/payment/${e}`,{status:t}),c=r.all.findIndex(l=>l._id===e);c!==-1&&(r.all[c]=a.data)}catch(a){s.setError(a)}}},y={resetCustomer(e){Object.assign(e,customerInitState)},resetOrder(e){r.current={...d.default}}},f={getTotal(e){return e.reduce((t,a)=>t+a.price*a.quantity,0)}};function o(e,t){r[t]=e}i.watch(r,(e,t)=>{});exports.actions=p;exports.getters=f;exports.mutations=y;exports.state=r;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("vue"),u=require("axios"),s=require("../../globals/views/store/globals.cjs"),d=require("./models/order.cjs"),n=u.create({baseURL:process.env.API_URL,withCredentials:!0}),r=i.reactive({all:[],current:{...d.default}}),p={async create(e){try{const t=await n.post("/api/orders/create",e);return r.all.push(t.data),t.data}catch(t){s.setError(t)}},async read(e={}){try{const t=await n.get("/api/orders/read",{params:e});return e._id?o(t.data[0],"current"):o(t.data,"all"),t.data}catch(t){throw s.setError(t),t}},async update(e){try{const t=await n.post("/api/orders/update",e),a=r.all.findIndex(c=>c._id===e._id);return a!==-1&&(r.all[a]=t.data),t.data}catch(t){s.setError(t)}},async delete(e){try{await n.delete(`/api/orders/${e}`),r.all=r.all.filter(t=>t._id!==e)}catch(t){s.setError(t)}},async changePaymentStatus(e,t){try{const a=await n.post(`/api/orders/payment/${e}`,{status:t}),c=r.all.findIndex(l=>l._id===e);c!==-1&&(r.all[c]=a.data)}catch(a){s.setError(a)}}},y={resetCustomer(e){Object.assign(e,customerInitState)},resetOrder(e){r.current={...d.default}}},f={getTotal(e){return e.reduce((t,a)=>t+a.price*a.quantity,0)}};function o(e,t){r[t]=e}i.watch(r,(e,t)=>{});exports.actions=p;exports.getters=f;exports.mutations=y;exports.state=r;
@@ -1,6 +1,6 @@
1
1
  import { reactive as l, watch as p } from "vue";
2
2
  import u from "axios";
3
- import { setError as s } from "../../globals/store/globals.js";
3
+ import { setError as s } from "../../globals/views/store/globals.js";
4
4
  import i from "./models/order.js";
5
5
  const n = u.create({ baseURL: process.env.API_URL, withCredentials: !0 }), a = l({
6
6
  all: [],
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("vue");require("../../../../../node_modules/js-cookie/dist/js.cookie.cjs");require("../../globals/store/globals.cjs");const t=r.reactive({organization:null,positions:[],currentState:!1}),s={toggleShopcart(){t.currentState=!t.currentState},setShopcart(){try{const o=localStorage.getItem("shopcart");if(o){const i=JSON.parse(o);t.positions=i.positions,t.organization=i.organization}}catch(o){throw console.error(o),o}},addProductToCart(o,i){const e=t.positions.find(n=>n._id===o._id);e?e.quantity++:t.positions.push({_id:o._id,images:o.images,name:o.name,price:o.price,quantity:1,org_id:i}),localStorage.setItem("shopcart",JSON.stringify({positions:t.positions,organization:i}))},removeProduct(o){const i=t.positions.find(n=>n._id===o),e=t.positions.indexOf(i);e>-1&&(t.positions.splice(e,1),localStorage.setItem("shopcart",JSON.stringify({positions:t.positions,organization:t.organization})))},decrementItemQuantity(o){const i=t.positions.find(n=>n._id===o),e=t.positions.indexOf(i);e>-1&&(i.quantity--,i.quantity<1&&t.positions.splice(e,1),localStorage.setItem("shopcart",JSON.stringify({positions:t.positions,organization:t.organization})))},incrementItemQuantity(o){const i=t.positions.find(e=>e._id===o);i&&(i.quantity++,localStorage.setItem("shopcart",JSON.stringify({positions:t.positions,organization:t.organization})))},resetShopcart(){t.positions=[],localStorage.removeItem("shopcart")}},a={cartTotalPrice:r.computed(()=>Number(t.positions.reduce((o,i)=>o+i.price*i.quantity,0))),cartTotalAmount:r.computed(()=>Number(t.positions.reduce((o,i)=>o+i.quantity,0))),getStoreCartState:r.computed(()=>Number(t.currentState))};r.watch(t,(o,i)=>{});exports.actions=s;exports.getters=a;exports.state=t;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("vue");require("../../../../../node_modules/js-cookie/dist/js.cookie.cjs");require("../../globals/views/store/globals.cjs");const t=r.reactive({organization:null,positions:[],currentState:!1}),s={toggleShopcart(){t.currentState=!t.currentState},setShopcart(){try{const o=localStorage.getItem("shopcart");if(o){const i=JSON.parse(o);t.positions=i.positions,t.organization=i.organization}}catch(o){throw console.error(o),o}},addProductToCart(o,i){const e=t.positions.find(n=>n._id===o._id);e?e.quantity++:t.positions.push({_id:o._id,images:o.images,name:o.name,price:o.price,quantity:1,org_id:i}),localStorage.setItem("shopcart",JSON.stringify({positions:t.positions,organization:i}))},removeProduct(o){const i=t.positions.find(n=>n._id===o),e=t.positions.indexOf(i);e>-1&&(t.positions.splice(e,1),localStorage.setItem("shopcart",JSON.stringify({positions:t.positions,organization:t.organization})))},decrementItemQuantity(o){const i=t.positions.find(n=>n._id===o),e=t.positions.indexOf(i);e>-1&&(i.quantity--,i.quantity<1&&t.positions.splice(e,1),localStorage.setItem("shopcart",JSON.stringify({positions:t.positions,organization:t.organization})))},incrementItemQuantity(o){const i=t.positions.find(e=>e._id===o);i&&(i.quantity++,localStorage.setItem("shopcart",JSON.stringify({positions:t.positions,organization:t.organization})))},resetShopcart(){t.positions=[],localStorage.removeItem("shopcart")}},a={cartTotalPrice:r.computed(()=>Number(t.positions.reduce((o,i)=>o+i.price*i.quantity,0))),cartTotalAmount:r.computed(()=>Number(t.positions.reduce((o,i)=>o+i.quantity,0))),getStoreCartState:r.computed(()=>Number(t.currentState))};r.watch(t,(o,i)=>{});exports.actions=s;exports.getters=a;exports.state=t;
@@ -1,6 +1,6 @@
1
1
  import { reactive as s, computed as r, watch as a } from "vue";
2
2
  import "../../../../../node_modules/js-cookie/dist/js.cookie.js";
3
- import "../../globals/store/globals.js";
3
+ import "../../globals/views/store/globals.js";
4
4
  const t = s({
5
5
  organization: null,
6
6
  positions: [],