@ozdao/prometheus-framework 0.2.48 → 0.2.50

Sign up to get free protection for your applications and to get access to all the features.
Files changed (227) hide show
  1. package/dist/auth.server.js +27 -25
  2. package/dist/auth.server.mjs +27 -25
  3. package/dist/community.server.js +1 -1
  4. package/dist/community.server.mjs +1 -1
  5. package/dist/events.server.js +1 -1
  6. package/dist/events.server.mjs +1 -1
  7. package/dist/files.server.js +1 -1
  8. package/dist/files.server.mjs +1 -1
  9. package/dist/gallery.server.js +1 -1
  10. package/dist/gallery.server.mjs +1 -1
  11. package/dist/index-3981e903.mjs +217 -0
  12. package/dist/index-4eecfdb9.js +216 -0
  13. package/dist/main-203b36b6.mjs +13628 -0
  14. package/dist/main-_b1_i8mt.mjs +13606 -0
  15. package/dist/main-a7ae4ce5.js +91 -0
  16. package/dist/main-uiQFxEks.js +91 -0
  17. package/dist/middlewares.server.js +1 -1
  18. package/dist/middlewares.server.mjs +1 -1
  19. package/dist/node_modules/vue-select/dist/vue-select.es.cjs +1 -3
  20. package/dist/node_modules/vue-select/dist/vue-select.es.js +49 -645
  21. package/dist/organizations.server.js +13 -27
  22. package/dist/organizations.server.mjs +13 -27
  23. package/dist/products.server.js +95 -15
  24. package/dist/products.server.mjs +95 -15
  25. package/dist/prometheus-framework/src/components/Button/Button.vue.cjs +1 -1
  26. package/dist/prometheus-framework/src/components/Button/Button.vue.js +2 -225
  27. package/dist/prometheus-framework/src/components/Button/Button.vue2.cjs +1 -1
  28. package/dist/prometheus-framework/src/components/Button/Button.vue2.js +225 -2
  29. package/dist/prometheus-framework/src/components/Checkbox/Checkbox.vue.cjs +1 -1
  30. package/dist/prometheus-framework/src/components/Checkbox/Checkbox.vue.js +61 -2
  31. package/dist/prometheus-framework/src/components/Checkbox/Checkbox.vue2.cjs +1 -1
  32. package/dist/prometheus-framework/src/components/Checkbox/Checkbox.vue2.js +2 -61
  33. package/dist/prometheus-framework/src/components/Field/Field.vue.cjs +1 -1
  34. package/dist/prometheus-framework/src/components/Field/Field.vue.js +2 -76
  35. package/dist/prometheus-framework/src/components/Field/Field.vue2.cjs +1 -1
  36. package/dist/prometheus-framework/src/components/Field/Field.vue2.js +76 -2
  37. package/dist/prometheus-framework/src/components/FieldBig/FieldBig.vue.cjs +1 -1
  38. package/dist/prometheus-framework/src/components/FieldBig/FieldBig.vue.js +1 -1
  39. package/dist/prometheus-framework/src/components/SelectMulti/SelectMulti.vue.cjs +1 -1
  40. package/dist/prometheus-framework/src/components/SelectMulti/SelectMulti.vue.js +6 -6
  41. package/dist/prometheus-framework/src/components/Tab/Tab.vue.cjs +1 -1
  42. package/dist/prometheus-framework/src/components/Tab/Tab.vue.js +2 -44
  43. package/dist/prometheus-framework/src/components/Tab/Tab.vue2.cjs +1 -1
  44. package/dist/prometheus-framework/src/components/Tab/Tab.vue2.js +44 -2
  45. package/dist/prometheus-framework/src/modules/auth/components/layouts/Auth.vue.cjs +1 -1
  46. package/dist/prometheus-framework/src/modules/auth/components/layouts/Auth.vue.js +3 -3
  47. package/dist/prometheus-framework/src/modules/auth/components/pages/EnterCode.vue.cjs +1 -1
  48. package/dist/prometheus-framework/src/modules/auth/components/pages/EnterCode.vue.js +1 -1
  49. package/dist/prometheus-framework/src/modules/auth/components/pages/EnterPassword.vue.cjs +1 -1
  50. package/dist/prometheus-framework/src/modules/auth/components/pages/EnterPassword.vue.js +3 -3
  51. package/dist/prometheus-framework/src/modules/auth/components/pages/Invite.vue.cjs +1 -1
  52. package/dist/prometheus-framework/src/modules/auth/components/pages/Invite.vue.js +44 -32
  53. package/dist/prometheus-framework/src/modules/auth/components/pages/ResetPassword.vue.cjs +1 -1
  54. package/dist/prometheus-framework/src/modules/auth/components/pages/ResetPassword.vue.js +3 -3
  55. package/dist/prometheus-framework/src/modules/auth/components/pages/SignIn.vue.cjs +1 -1
  56. package/dist/prometheus-framework/src/modules/auth/components/pages/SignIn.vue.js +3 -3
  57. package/dist/prometheus-framework/src/modules/auth/components/pages/SignUp.vue.cjs +1 -1
  58. package/dist/prometheus-framework/src/modules/auth/components/pages/SignUp.vue.js +3 -3
  59. package/dist/prometheus-framework/src/modules/auth/store/auth.cjs +1 -1
  60. package/dist/prometheus-framework/src/modules/auth/store/auth.js +45 -44
  61. package/dist/prometheus-framework/src/modules/auth/store/invites.cjs +1 -1
  62. package/dist/prometheus-framework/src/modules/auth/store/invites.js +5 -5
  63. package/dist/prometheus-framework/src/modules/backoffice/components/pages/Dashboard.vue.cjs +1 -1
  64. package/dist/prometheus-framework/src/modules/backoffice/components/pages/Dashboard.vue.js +1 -1
  65. package/dist/prometheus-framework/src/modules/community/components/pages/CreateBlogPost.vue.cjs +1 -1
  66. package/dist/prometheus-framework/src/modules/community/components/pages/CreateBlogPost.vue.js +3 -3
  67. package/dist/prometheus-framework/src/modules/constructor/components/elements/Embed.vue.cjs +1 -1
  68. package/dist/prometheus-framework/src/modules/constructor/components/elements/Embed.vue.js +1 -1
  69. package/dist/prometheus-framework/src/modules/events/components/elements/ButtonJoin.vue.cjs +1 -1
  70. package/dist/prometheus-framework/src/modules/events/components/elements/ButtonJoin.vue.js +1 -1
  71. package/dist/prometheus-framework/src/modules/events/components/pages/EditEvent.vue.cjs +1 -1
  72. package/dist/prometheus-framework/src/modules/events/components/pages/EditEvent.vue.js +3 -3
  73. package/dist/prometheus-framework/src/modules/events/components/pages/Events.vue.cjs +1 -1
  74. package/dist/prometheus-framework/src/modules/events/components/pages/Events.vue.js +1 -1
  75. package/dist/prometheus-framework/src/modules/gallery/components/sections/BackofficeGallery.vue.cjs +1 -1
  76. package/dist/prometheus-framework/src/modules/gallery/components/sections/BackofficeGallery.vue.js +2 -2
  77. package/dist/prometheus-framework/src/modules/gallery/components/sections/GalleryWithCategories.vue.cjs +1 -1
  78. package/dist/prometheus-framework/src/modules/gallery/components/sections/GalleryWithCategories.vue.js +2 -2
  79. package/dist/prometheus-framework/src/modules/globals/components/blocks/CardHeader.vue.cjs +1 -1
  80. package/dist/prometheus-framework/src/modules/globals/components/blocks/CardHeader.vue.js +1 -1
  81. package/dist/prometheus-framework/src/modules/globals/store/globals.cjs +1 -1
  82. package/dist/prometheus-framework/src/modules/globals/store/globals.js +22 -21
  83. package/dist/prometheus-framework/src/modules/legal/components/pages/Legal.vue.cjs +1 -1
  84. package/dist/prometheus-framework/src/modules/legal/components/pages/Legal.vue.js +3 -3
  85. package/dist/prometheus-framework/src/modules/mobile/components/Menu/Menu.vue.cjs +1 -1
  86. package/dist/prometheus-framework/src/modules/mobile/components/Menu/Menu.vue.js +11 -2
  87. package/dist/prometheus-framework/src/modules/mobile/components/Menu/Menu.vue2.cjs +1 -1
  88. package/dist/prometheus-framework/src/modules/mobile/components/Menu/Menu.vue2.js +2 -11
  89. package/dist/prometheus-framework/src/modules/orders/components/pages/EditOrder.vue.cjs +1 -1
  90. package/dist/prometheus-framework/src/modules/orders/components/pages/EditOrder.vue.js +1 -1
  91. package/dist/prometheus-framework/src/modules/orders/components/pages/Orders.vue.cjs +1 -1
  92. package/dist/prometheus-framework/src/modules/orders/components/pages/Orders.vue.js +1 -1
  93. package/dist/prometheus-framework/src/modules/orders/components/sections/FormOrderDetails.vue.cjs +1 -1
  94. package/dist/prometheus-framework/src/modules/orders/components/sections/FormOrderDetails.vue.js +1 -1
  95. package/dist/prometheus-framework/src/modules/organizations/components/blocks/CardDepartment.vue.cjs +1 -1
  96. package/dist/prometheus-framework/src/modules/organizations/components/blocks/CardDepartment.vue.js +17 -17
  97. package/dist/prometheus-framework/src/modules/organizations/components/blocks/DepartmentMemberModify.vue.cjs +1 -1
  98. package/dist/prometheus-framework/src/modules/organizations/components/blocks/DepartmentMemberModify.vue.js +49 -42
  99. package/dist/prometheus-framework/src/modules/organizations/components/blocks/User.vue.cjs +1 -1
  100. package/dist/prometheus-framework/src/modules/organizations/components/blocks/User.vue.js +47 -15
  101. package/dist/prometheus-framework/src/modules/organizations/components/elements/ButtonToggleMembership.vue.cjs +1 -1
  102. package/dist/prometheus-framework/src/modules/organizations/components/elements/ButtonToggleMembership.vue.js +1 -1
  103. package/dist/prometheus-framework/src/modules/organizations/components/pages/Department.vue.cjs +1 -1
  104. package/dist/prometheus-framework/src/modules/organizations/components/pages/Department.vue.js +38 -37
  105. package/dist/prometheus-framework/src/modules/organizations/components/pages/DepartmentEdit.vue.cjs +1 -1
  106. package/dist/prometheus-framework/src/modules/organizations/components/pages/DepartmentEdit.vue.js +249 -61
  107. package/dist/prometheus-framework/src/modules/organizations/components/pages/Members.vue.cjs +1 -1
  108. package/dist/prometheus-framework/src/modules/organizations/components/pages/Members.vue.js +78 -45
  109. package/dist/prometheus-framework/src/modules/organizations/components/pages/Organization.vue.cjs +1 -1
  110. package/dist/prometheus-framework/src/modules/organizations/components/pages/Organization.vue.js +161 -86
  111. package/dist/prometheus-framework/src/modules/organizations/components/pages/OrganizationEdit.vue.cjs +1 -1
  112. package/dist/prometheus-framework/src/modules/organizations/components/pages/OrganizationEdit.vue.js +3 -3
  113. package/dist/prometheus-framework/src/modules/organizations/components/pages/Organizations.vue.cjs +1 -1
  114. package/dist/prometheus-framework/src/modules/organizations/components/pages/Organizations.vue.js +1 -1
  115. package/dist/prometheus-framework/src/modules/organizations/components/sections/Documents.vue.cjs +1 -1
  116. package/dist/prometheus-framework/src/modules/organizations/components/sections/Documents.vue.js +2 -2
  117. package/dist/prometheus-framework/src/modules/organizations/components/sections/MembersAdd.vue.cjs +1 -1
  118. package/dist/prometheus-framework/src/modules/organizations/components/sections/MembersAdd.vue.js +52 -54
  119. package/dist/prometheus-framework/src/modules/organizations/components/sections/Organizations.vue.cjs +1 -1
  120. package/dist/prometheus-framework/src/modules/organizations/components/sections/Organizations.vue.js +20 -26
  121. package/dist/prometheus-framework/src/modules/organizations/organizations.client.cjs +1 -1
  122. package/dist/prometheus-framework/src/modules/organizations/organizations.client.js +40 -46
  123. package/dist/prometheus-framework/src/modules/organizations/store/departments.cjs +1 -1
  124. package/dist/prometheus-framework/src/modules/organizations/store/departments.js +34 -30
  125. package/dist/prometheus-framework/src/modules/organizations/store/memberships.cjs +1 -1
  126. package/dist/prometheus-framework/src/modules/organizations/store/memberships.js +30 -28
  127. package/dist/prometheus-framework/src/modules/products/components/blocks/CardPosition.vue.cjs +1 -1
  128. package/dist/prometheus-framework/src/modules/products/components/blocks/CardPosition.vue.js +18 -18
  129. package/dist/prometheus-framework/src/modules/products/components/blocks/LeftoverPositions.vue.cjs +1 -1
  130. package/dist/prometheus-framework/src/modules/products/components/blocks/LeftoverPositions.vue.js +1 -1
  131. package/dist/prometheus-framework/src/modules/products/components/blocks/ListPositions.vue.cjs +1 -1
  132. package/dist/prometheus-framework/src/modules/products/components/blocks/ListPositions.vue.js +1 -1
  133. package/dist/prometheus-framework/src/modules/products/components/pages/EditLeftover.vue.cjs +1 -1
  134. package/dist/prometheus-framework/src/modules/products/components/pages/EditLeftover.vue.js +1 -1
  135. package/dist/prometheus-framework/src/modules/products/components/pages/Leftovers.vue.cjs +1 -1
  136. package/dist/prometheus-framework/src/modules/products/components/pages/Leftovers.vue.js +1 -1
  137. package/dist/prometheus-framework/src/modules/products/components/pages/Product.vue.cjs +1 -1
  138. package/dist/prometheus-framework/src/modules/products/components/pages/Product.vue.js +33 -28
  139. package/dist/prometheus-framework/src/modules/products/components/pages/ProductEdit.vue.cjs +1 -1
  140. package/dist/prometheus-framework/src/modules/products/components/pages/ProductEdit.vue.js +123 -113
  141. package/dist/prometheus-framework/src/modules/products/components/pages/ProductsBackoffice.vue.cjs +1 -1
  142. package/dist/prometheus-framework/src/modules/products/components/pages/ProductsBackoffice.vue.js +1 -1
  143. package/dist/prometheus-framework/src/modules/products/components/sections/EditModifications.vue.cjs +1 -1
  144. package/dist/prometheus-framework/src/modules/products/components/sections/EditModifications.vue.js +1 -1
  145. package/dist/prometheus-framework/src/modules/products/components/sections/EditProductInfo.vue.cjs +1 -1
  146. package/dist/prometheus-framework/src/modules/products/components/sections/EditProductInfo.vue.js +2 -2
  147. package/dist/prometheus-framework/src/modules/products/components/sections/FilterProducts.vue.cjs +1 -1
  148. package/dist/prometheus-framework/src/modules/products/components/sections/FilterProducts.vue.js +1 -1
  149. package/dist/prometheus-framework/src/modules/products/components/sections/SectionProduct.vue.cjs +1 -1
  150. package/dist/prometheus-framework/src/modules/products/components/sections/SectionProduct.vue.js +1 -1
  151. package/dist/prometheus-framework/src/modules/products/store/products.cjs +1 -1
  152. package/dist/prometheus-framework/src/modules/products/store/products.js +1 -1
  153. package/dist/prometheus-framework/src/modules/reports/components/sections/FormReport.vue.cjs +1 -1
  154. package/dist/prometheus-framework/src/modules/reports/components/sections/FormReport.vue.js +1 -1
  155. package/dist/prometheus-framework/src/modules/users/components/pages/Profile.vue.cjs +1 -1
  156. package/dist/prometheus-framework/src/modules/users/components/pages/Profile.vue.js +3 -3
  157. package/dist/prometheus-framework/src/modules/users/components/pages/ProfileBlogposts.vue.cjs +1 -1
  158. package/dist/prometheus-framework/src/modules/users/components/pages/ProfileBlogposts.vue.js +1 -1
  159. package/dist/prometheus-framework/src/modules/users/components/pages/ProfileEdit.vue.cjs +1 -1
  160. package/dist/prometheus-framework/src/modules/users/components/pages/ProfileEdit.vue.js +3 -3
  161. package/dist/prometheus-framework/src/modules/users/components/pages/ProfileEvents.vue.cjs +1 -1
  162. package/dist/prometheus-framework/src/modules/users/components/pages/ProfileEvents.vue.js +1 -1
  163. package/dist/prometheus-framework/src/modules/wallet/components/pages/Wallet.vue.cjs +1 -1
  164. package/dist/prometheus-framework/src/modules/wallet/components/pages/Wallet.vue.js +1 -1
  165. package/dist/prometheus-framework.cjs.js +1 -1
  166. package/dist/prometheus-framework.es.js +1 -1
  167. package/dist/reports.server.js +1 -1
  168. package/dist/reports.server.mjs +1 -1
  169. package/dist/style.css +1 -1
  170. package/dist/web-7p76PGnO.mjs +55 -0
  171. package/dist/web-c63f0ecc.js +1 -0
  172. package/dist/web-d8173758.mjs +55 -0
  173. package/dist/web-dn8vgptQ.js +1 -0
  174. package/package.json +1 -1
  175. package/src/components/SelectMulti/SelectMulti.vue +1 -1
  176. package/src/modules/auth/components/pages/Invite.vue +17 -6
  177. package/src/modules/auth/controllers/auth.controller.js +24 -16
  178. package/src/modules/auth/controllers/invites.controller.js +17 -8
  179. package/src/modules/auth/store/auth.js +8 -1
  180. package/src/modules/auth/store/invites.js +1 -0
  181. package/src/modules/globals/store/globals.js +5 -1
  182. package/src/modules/landing/components/blocks/MapBlock.vue +37 -0
  183. package/src/modules/landing/components/pages/404.vue +3 -0
  184. package/src/modules/landing/components/pages/Governance.vue +155 -0
  185. package/src/modules/landing/components/pages/Home.vue +52 -0
  186. package/src/modules/landing/components/pages/Hotel.vue +54 -0
  187. package/src/modules/landing/components/pages/Page.vue +184 -0
  188. package/src/modules/landing/components/sections/AboutSection.vue +69 -0
  189. package/src/modules/landing/components/sections/Examples.vue +90 -0
  190. package/src/modules/landing/components/sections/FeatureSection.vue +80 -0
  191. package/src/modules/landing/components/sections/GiftSection.vue +63 -0
  192. package/src/modules/landing/components/sections/HeroSection.vue +74 -0
  193. package/src/modules/landing/components/sections/HowItWorksSection.vue +88 -0
  194. package/src/modules/landing/components/sections/HowToBuyWDR.vue +131 -0
  195. package/src/modules/landing/components/sections/InstagramSection.vue +181 -0
  196. package/src/modules/landing/components/sections/MapSection.vue +91 -0
  197. package/src/modules/landing/components/sections/SectionsSection.vue +69 -0
  198. package/src/modules/landing/components/sections/SliderFeatures.vue +131 -0
  199. package/src/modules/landing/components/sections/WhatIsWDRSection.vue +116 -0
  200. package/src/modules/landing/router/landing.js +34 -0
  201. package/src/modules/middlewares/server/verifySignUp.js +4 -0
  202. package/src/modules/organizations/components/blocks/CardDepartment.vue +3 -3
  203. package/src/modules/organizations/components/blocks/DepartmentMemberModify.vue +52 -44
  204. package/src/modules/organizations/components/blocks/User.vue +42 -10
  205. package/src/modules/organizations/components/pages/Department.vue +7 -6
  206. package/src/modules/organizations/components/pages/DepartmentEdit.vue +110 -134
  207. package/src/modules/organizations/components/pages/Members.vue +85 -26
  208. package/src/modules/organizations/components/pages/Organization.vue +60 -4
  209. package/src/modules/organizations/components/sections/MembersAdd.vue +27 -34
  210. package/src/modules/organizations/components/sections/Organizations.vue +0 -1
  211. package/src/modules/organizations/controllers/memberships.controller.js +6 -2
  212. package/src/modules/organizations/controllers/organizations.controller.js +1 -1
  213. package/src/modules/organizations/models/department.model.js +0 -19
  214. package/src/modules/organizations/models/membership.model.js +4 -0
  215. package/src/modules/organizations/organizations.client.js +1 -6
  216. package/src/modules/organizations/store/departments.js +48 -44
  217. package/src/modules/organizations/store/memberships.js +11 -3
  218. package/src/modules/products/components/blocks/CardPosition.vue +2 -2
  219. package/src/modules/products/components/pages/Product.vue +6 -1
  220. package/src/modules/products/components/pages/ProductEdit.vue +48 -28
  221. package/src/modules/products/controllers/products.controller.js +87 -24
  222. package/src/modules/products/models/product.model.js +16 -1
  223. package/src/modules/products/store/products.js +1 -1
  224. package/src/modules/users/components/pages/ProfileOrganizations.vue +41 -7
  225. package/src/modules/organizations/components/sections/FeedDepartments.vue +0 -64
  226. package/src/modules/organizations/components/sections/MembersList.vue +0 -85
  227. package/src/modules/organizations/store/invites.js +0 -93
@@ -72,7 +72,7 @@ const controllerFactory$5 = (db) => {
72
72
  };
73
73
  var departments_controller = controllerFactory$5;
74
74
  const jwt = require$$0$1;
75
- const ObjectId$1 = require$$0.Types.ObjectId;
75
+ const ObjectId$2 = require$$0.Types.ObjectId;
76
76
  const { Client } = require$$5;
77
77
  const client = new Client({});
78
78
  const addUserStatusFields = addMembersQuantity$1.addUserStatusFields_1;
@@ -116,15 +116,15 @@ const controllerFactory$4 = (db) => {
116
116
  }));
117
117
  }
118
118
  const matchConditions = [
119
- ...req.query._id ? [{ _id: new ObjectId$1(req.query._id) }] : [],
120
- ...req.query.owner ? [{ owner: new ObjectId$1(req.query.owner) }] : [],
121
- ...req.query.member ? [{ "memberships.user": new ObjectId$1(req.query.member), "memberships.role": { $nin: ["subscriber", "owner"] } }] : [],
122
- ...req.query.subscriber ? [{ "memberships.user": new ObjectId$1(req.query.subscriber), "memberships.role": "subscriber" }] : [],
123
- ...req.query.postable ? [{ $or: [{ $and: [{ types: { $elemMatch: { $eq: "public" } } }, { "memberships.user": new ObjectId$1(req.query.postable) }] }, { $and: [{ types: { $elemMatch: { $in: ["exclusive", "hidden"] } } }, { "memberships.user": new ObjectId$1(req.query.postable) }, { "memberships.role": { $ne: "subscriber" } }] }] }] : [],
119
+ ...req.query._id ? [{ _id: new ObjectId$2(req.query._id) }] : [],
120
+ ...req.query.owner ? [{ owner: new ObjectId$2(req.query.owner) }] : [],
121
+ ...req.query.member ? [{ "memberships.user": new ObjectId$2(req.query.member), "memberships.role": "member" }] : [],
122
+ ...req.query.subscriber ? [{ "memberships.user": new ObjectId$2(req.query.subscriber), "memberships.role": "subscriber" }] : [],
123
+ ...req.query.postable ? [{ $or: [{ $and: [{ types: { $elemMatch: { $eq: "public" } } }, { "memberships.user": new ObjectId$2(req.query.postable) }] }, { $and: [{ types: { $elemMatch: { $in: ["exclusive", "hidden"] } } }, { "memberships.user": new ObjectId$2(req.query.postable) }, { "memberships.role": { $ne: "subscriber" } }] }] }] : [],
124
124
  ...req.query.types ? [{ types: { $in: req.query.types } }] : [],
125
125
  // Если req.query.types - строка
126
126
  // to remove
127
- ...req.query.onlyuser ? [{ "memberships.user": new ObjectId$1(req.query.onlyuser) }] : [],
127
+ ...req.query.onlyuser ? [{ "memberships.user": new ObjectId$2(req.query.onlyuser) }] : [],
128
128
  ...categories.length > 0 ? [{ "products.category": { $in: categories } }] : [],
129
129
  ...delivery.length > 0 ? [{ "spots.delivery": { $all: delivery } }] : [],
130
130
  ...priceConditions.length > 0 ? [{ $or: priceConditions }] : [],
@@ -425,6 +425,7 @@ const controllerFactory$4 = (db) => {
425
425
  };
426
426
  };
427
427
  var organizations_controller = controllerFactory$4;
428
+ const ObjectId$1 = require$$0.Types.ObjectId;
428
429
  const controllerFactory$3 = (db) => {
429
430
  const Membership = db.membership;
430
431
  const read = async (req, res) => {
@@ -480,10 +481,9 @@ const controllerFactory$3 = (db) => {
480
481
  }
481
482
  };
482
483
  const deleteMembership = async (req, res) => {
483
- const { type, target, user: user2, role } = req.body;
484
484
  console.log(req.body);
485
485
  try {
486
- const membership = await Membership.findOne({ type, target, user: user2, role });
486
+ const membership = await Membership.findOneAndDelete({ _id: new ObjectId$1(req.body._id) });
487
487
  if (!membership) {
488
488
  return res.status(404).send({ errorCode: "MEMBERSHIP_NOT_FOUND" });
489
489
  } else {
@@ -592,23 +592,6 @@ var department_model = (mongoose) => {
592
592
  description: { type: String },
593
593
  categories: [String]
594
594
  },
595
- // Working hours
596
- address: String,
597
- // Position on map
598
- location: {
599
- lat: Number,
600
- lng: Number,
601
- type: {
602
- type: String,
603
- enum: ["Point"],
604
- // 'location.type' must be 'Point'
605
- required: true
606
- },
607
- coordinates: {
608
- type: [Number],
609
- required: true
610
- }
611
- },
612
595
  worktime: [{
613
596
  day: String,
614
597
  time: {
@@ -639,7 +622,6 @@ var department_model = (mongoose) => {
639
622
  ]
640
623
  });
641
624
  departmentSchema.index({ organization: 1 });
642
- departmentSchema.index({ location: "2dsphere" });
643
625
  const Department = mongoose.model("Department", departmentSchema);
644
626
  return Department;
645
627
  };
@@ -727,6 +709,10 @@ var membership_model = (mongoose) => {
727
709
  type: String,
728
710
  default: "subscriber"
729
711
  },
712
+ label: {
713
+ type: String,
714
+ default: "subscriber"
715
+ },
730
716
  target: {
731
717
  // заменяем 'organization' на 'target', так как это может быть или User, или Organization
732
718
  type: mongoose.Schema.Types.ObjectId,
@@ -71,7 +71,7 @@ const controllerFactory$5 = (db) => {
71
71
  };
72
72
  var departments_controller = controllerFactory$5;
73
73
  const jwt = require$$0$1;
74
- const ObjectId$1 = require$$0.Types.ObjectId;
74
+ const ObjectId$2 = require$$0.Types.ObjectId;
75
75
  const { Client } = require$$5;
76
76
  const client = new Client({});
77
77
  const addUserStatusFields = addUserStatusFields_1;
@@ -115,15 +115,15 @@ const controllerFactory$4 = (db) => {
115
115
  }));
116
116
  }
117
117
  const matchConditions = [
118
- ...req.query._id ? [{ _id: new ObjectId$1(req.query._id) }] : [],
119
- ...req.query.owner ? [{ owner: new ObjectId$1(req.query.owner) }] : [],
120
- ...req.query.member ? [{ "memberships.user": new ObjectId$1(req.query.member), "memberships.role": { $nin: ["subscriber", "owner"] } }] : [],
121
- ...req.query.subscriber ? [{ "memberships.user": new ObjectId$1(req.query.subscriber), "memberships.role": "subscriber" }] : [],
122
- ...req.query.postable ? [{ $or: [{ $and: [{ types: { $elemMatch: { $eq: "public" } } }, { "memberships.user": new ObjectId$1(req.query.postable) }] }, { $and: [{ types: { $elemMatch: { $in: ["exclusive", "hidden"] } } }, { "memberships.user": new ObjectId$1(req.query.postable) }, { "memberships.role": { $ne: "subscriber" } }] }] }] : [],
118
+ ...req.query._id ? [{ _id: new ObjectId$2(req.query._id) }] : [],
119
+ ...req.query.owner ? [{ owner: new ObjectId$2(req.query.owner) }] : [],
120
+ ...req.query.member ? [{ "memberships.user": new ObjectId$2(req.query.member), "memberships.role": "member" }] : [],
121
+ ...req.query.subscriber ? [{ "memberships.user": new ObjectId$2(req.query.subscriber), "memberships.role": "subscriber" }] : [],
122
+ ...req.query.postable ? [{ $or: [{ $and: [{ types: { $elemMatch: { $eq: "public" } } }, { "memberships.user": new ObjectId$2(req.query.postable) }] }, { $and: [{ types: { $elemMatch: { $in: ["exclusive", "hidden"] } } }, { "memberships.user": new ObjectId$2(req.query.postable) }, { "memberships.role": { $ne: "subscriber" } }] }] }] : [],
123
123
  ...req.query.types ? [{ types: { $in: req.query.types } }] : [],
124
124
  // Если req.query.types - строка
125
125
  // to remove
126
- ...req.query.onlyuser ? [{ "memberships.user": new ObjectId$1(req.query.onlyuser) }] : [],
126
+ ...req.query.onlyuser ? [{ "memberships.user": new ObjectId$2(req.query.onlyuser) }] : [],
127
127
  ...categories.length > 0 ? [{ "products.category": { $in: categories } }] : [],
128
128
  ...delivery.length > 0 ? [{ "spots.delivery": { $all: delivery } }] : [],
129
129
  ...priceConditions.length > 0 ? [{ $or: priceConditions }] : [],
@@ -424,6 +424,7 @@ const controllerFactory$4 = (db) => {
424
424
  };
425
425
  };
426
426
  var organizations_controller = controllerFactory$4;
427
+ const ObjectId$1 = require$$0.Types.ObjectId;
427
428
  const controllerFactory$3 = (db) => {
428
429
  const Membership = db.membership;
429
430
  const read = async (req, res) => {
@@ -479,10 +480,9 @@ const controllerFactory$3 = (db) => {
479
480
  }
480
481
  };
481
482
  const deleteMembership = async (req, res) => {
482
- const { type, target, user: user2, role } = req.body;
483
483
  console.log(req.body);
484
484
  try {
485
- const membership = await Membership.findOne({ type, target, user: user2, role });
485
+ const membership = await Membership.findOneAndDelete({ _id: new ObjectId$1(req.body._id) });
486
486
  if (!membership) {
487
487
  return res.status(404).send({ errorCode: "MEMBERSHIP_NOT_FOUND" });
488
488
  } else {
@@ -591,23 +591,6 @@ var department_model = (mongoose) => {
591
591
  description: { type: String },
592
592
  categories: [String]
593
593
  },
594
- // Working hours
595
- address: String,
596
- // Position on map
597
- location: {
598
- lat: Number,
599
- lng: Number,
600
- type: {
601
- type: String,
602
- enum: ["Point"],
603
- // 'location.type' must be 'Point'
604
- required: true
605
- },
606
- coordinates: {
607
- type: [Number],
608
- required: true
609
- }
610
- },
611
594
  worktime: [{
612
595
  day: String,
613
596
  time: {
@@ -638,7 +621,6 @@ var department_model = (mongoose) => {
638
621
  ]
639
622
  });
640
623
  departmentSchema.index({ organization: 1 });
641
- departmentSchema.index({ location: "2dsphere" });
642
624
  const Department = mongoose.model("Department", departmentSchema);
643
625
  return Department;
644
626
  };
@@ -726,6 +708,10 @@ var membership_model = (mongoose) => {
726
708
  type: String,
727
709
  default: "subscriber"
728
710
  },
711
+ label: {
712
+ type: String,
713
+ default: "subscriber"
714
+ },
729
715
  target: {
730
716
  // заменяем 'organization' на 'target', так как это может быть или User, или Organization
731
717
  type: mongoose.Schema.Types.ObjectId,
@@ -5,7 +5,7 @@ require("uuid");
5
5
  const require$$0 = require("mongoose");
6
6
  require("path");
7
7
  const require$$3 = require("openai");
8
- const index = require("./index-a8dffc0c.js");
8
+ const index = require("./index-4eecfdb9.js");
9
9
  require("jsonwebtoken");
10
10
  require("mongodb");
11
11
  var product_model = (mongoose) => {
@@ -27,7 +27,22 @@ var product_model = (mongoose) => {
27
27
  images: { type: Array },
28
28
  popularity: { type: Number },
29
29
  localization: { type: Array },
30
- ingredients: { type: Array },
30
+ ingredients: [{
31
+ _id: {
32
+ type: mongoose.Schema.Types.ObjectId,
33
+ ref: "Product"
34
+ },
35
+ price: {
36
+ type: Number,
37
+ required: true,
38
+ min: [0, "Price cannot be less than 0"]
39
+ },
40
+ quantity: {
41
+ type: Number,
42
+ required: true,
43
+ min: [1, "Quantity cannot be less than 1"]
44
+ }
45
+ }],
31
46
  information: [{
32
47
  name: { type: String },
33
48
  value: { type: String }
@@ -293,7 +308,7 @@ const controllerFactory$5 = (db) => {
293
308
  const Update = async (req, res) => {
294
309
  try {
295
310
  const { _id } = req.params;
296
- console.log(_id);
311
+ console.log(req.body.ingredients);
297
312
  const updatedProduct = await Product.findOneAndUpdate(
298
313
  { _id },
299
314
  {
@@ -307,7 +322,8 @@ const controllerFactory$5 = (db) => {
307
322
  information: req.body.information,
308
323
  localization: req.body.localization,
309
324
  quantity: req.body.quantity,
310
- quantityDiscount: req.body.quantityDiscount
325
+ quantityDiscount: req.body.quantityDiscount,
326
+ ingredients: req.body.ingredients
311
327
  },
312
328
  { new: true }
313
329
  );
@@ -338,19 +354,19 @@ const controllerFactory$5 = (db) => {
338
354
  "withIngredients": [
339
355
  {
340
356
  $match: {
341
- ingridients: { $exists: true, $not: { $size: 0 } }
357
+ ingredients: { $exists: true, $not: { $size: 0 } }
342
358
  // Продукты с ингредиентами
343
359
  }
344
360
  },
345
361
  {
346
362
  $lookup: {
347
363
  from: "products",
348
- localField: "ingridients",
364
+ localField: "ingredients",
349
365
  foreignField: "_id",
350
366
  as: "ingredientDetails"
351
367
  }
352
368
  },
353
- { $unwind: "$ingredientDetails" },
369
+ // { $unwind: "$ingredientDetails" },
354
370
  {
355
371
  $lookup: {
356
372
  from: "leftovers",
@@ -385,9 +401,9 @@ const controllerFactory$5 = (db) => {
385
401
  {
386
402
  $match: {
387
403
  $or: [
388
- { ingridients: { $exists: false } },
404
+ { ingredients: { $exists: false } },
389
405
  // Продукты без ингредиентов
390
- { ingridients: { $size: 0 } }
406
+ { ingredients: { $size: 0 } }
391
407
  ]
392
408
  }
393
409
  },
@@ -521,13 +537,21 @@ const controllerFactory$5 = (db) => {
521
537
  {
522
538
  $lookup: {
523
539
  from: "leftovers",
524
- let: { productId: "$_id", ingredients: { $ifNull: ["$ingredients", []] } },
540
+ let: { productId: "$_id", ingredientsIds: "$ingredients._id" },
525
541
  pipeline: [
526
542
  {
527
543
  $unwind: "$positions"
528
544
  },
529
545
  {
530
- "$match": { "$expr": { "$eq": ["$positions._id", "$$productId"] } }
546
+ $match: {
547
+ $expr: {
548
+ $or: [
549
+ { $eq: ["$positions._id", "$$productId"] },
550
+ { $in: ["$positions._id", { $ifNull: ["$$ingredientsIds", []] }] }
551
+ // Исправлено
552
+ ]
553
+ }
554
+ }
531
555
  },
532
556
  {
533
557
  "$addFields": {
@@ -548,18 +572,75 @@ const controllerFactory$5 = (db) => {
548
572
  }
549
573
  }
550
574
  ],
551
- as: "variants"
575
+ as: "leftovers"
576
+ }
577
+ },
578
+ {
579
+ $addFields: {
580
+ ingredientsQuantities: {
581
+ $cond: {
582
+ if: { $isArray: "$ingredients" },
583
+ then: {
584
+ $map: {
585
+ input: "$ingredients",
586
+ as: "ingredient",
587
+ in: {
588
+ $let: {
589
+ vars: {
590
+ ingredientId: "$$ingredient._id",
591
+ ingredientQuantity: { $ifNull: ["$$ingredient.quantity", 0] }
592
+ },
593
+ in: {
594
+ $divide: [
595
+ {
596
+ $sum: {
597
+ $map: {
598
+ input: "$leftovers",
599
+ as: "leftover",
600
+ in: {
601
+ $cond: {
602
+ if: { $eq: ["$$leftover._id", "$$ingredientId"] },
603
+ then: "$$leftover.quantity",
604
+ else: 0
605
+ }
606
+ }
607
+ }
608
+ }
609
+ },
610
+ {
611
+ $cond: {
612
+ if: { $eq: ["$$ingredientQuantity", 0] },
613
+ then: 1,
614
+ else: "$$ingredientQuantity"
615
+ }
616
+ }
617
+ ]
618
+ }
619
+ }
620
+ }
621
+ }
622
+ },
623
+ else: []
624
+ }
625
+ }
552
626
  }
553
627
  },
554
628
  {
555
629
  $set: {
556
630
  quantity: {
557
- $sum: ["$quantity", { $sum: "$variants.quantity" }]
631
+ $cond: {
632
+ if: { $gt: [{ $size: { $ifNull: ["$ingredients", []] } }, 0] },
633
+ // Снова проверяем, не пустой ли массив ингредиентов
634
+ then: { $floor: { $min: "$ingredientsQuantities" } },
635
+ else: { $sum: "$leftovers.quantity" }
636
+ // Просто суммируем quantity из leftovers, если ингредиентов нет
637
+ }
558
638
  }
559
639
  }
560
640
  },
561
- { $unset: "variants" }
641
+ { $unset: ["leftovers", "ingredientsQuantities"] }
562
642
  ]);
643
+ console.log(product);
563
644
  if (!product || product.length < 1) {
564
645
  return res.status(404).send({ message: "Product not found." });
565
646
  }
@@ -568,7 +649,6 @@ const controllerFactory$5 = (db) => {
568
649
  { $inc: { popularity: 1 } },
569
650
  { new: true }
570
651
  );
571
- console.log("Popularity updated:", updatedProduct);
572
652
  res.status(200).send(product);
573
653
  } catch (err) {
574
654
  console.error("Error:", err);
@@ -3,7 +3,7 @@ import "uuid";
3
3
  import require$$0 from "mongoose";
4
4
  import "path";
5
5
  import require$$3 from "openai";
6
- import { s as server } from "./index-d769324d.mjs";
6
+ import { s as server } from "./index-3981e903.mjs";
7
7
  import "jsonwebtoken";
8
8
  import "mongodb";
9
9
  var product_model = (mongoose) => {
@@ -25,7 +25,22 @@ var product_model = (mongoose) => {
25
25
  images: { type: Array },
26
26
  popularity: { type: Number },
27
27
  localization: { type: Array },
28
- ingredients: { type: Array },
28
+ ingredients: [{
29
+ _id: {
30
+ type: mongoose.Schema.Types.ObjectId,
31
+ ref: "Product"
32
+ },
33
+ price: {
34
+ type: Number,
35
+ required: true,
36
+ min: [0, "Price cannot be less than 0"]
37
+ },
38
+ quantity: {
39
+ type: Number,
40
+ required: true,
41
+ min: [1, "Quantity cannot be less than 1"]
42
+ }
43
+ }],
29
44
  information: [{
30
45
  name: { type: String },
31
46
  value: { type: String }
@@ -291,7 +306,7 @@ const controllerFactory$5 = (db) => {
291
306
  const Update = async (req, res) => {
292
307
  try {
293
308
  const { _id } = req.params;
294
- console.log(_id);
309
+ console.log(req.body.ingredients);
295
310
  const updatedProduct = await Product.findOneAndUpdate(
296
311
  { _id },
297
312
  {
@@ -305,7 +320,8 @@ const controllerFactory$5 = (db) => {
305
320
  information: req.body.information,
306
321
  localization: req.body.localization,
307
322
  quantity: req.body.quantity,
308
- quantityDiscount: req.body.quantityDiscount
323
+ quantityDiscount: req.body.quantityDiscount,
324
+ ingredients: req.body.ingredients
309
325
  },
310
326
  { new: true }
311
327
  );
@@ -336,19 +352,19 @@ const controllerFactory$5 = (db) => {
336
352
  "withIngredients": [
337
353
  {
338
354
  $match: {
339
- ingridients: { $exists: true, $not: { $size: 0 } }
355
+ ingredients: { $exists: true, $not: { $size: 0 } }
340
356
  // Продукты с ингредиентами
341
357
  }
342
358
  },
343
359
  {
344
360
  $lookup: {
345
361
  from: "products",
346
- localField: "ingridients",
362
+ localField: "ingredients",
347
363
  foreignField: "_id",
348
364
  as: "ingredientDetails"
349
365
  }
350
366
  },
351
- { $unwind: "$ingredientDetails" },
367
+ // { $unwind: "$ingredientDetails" },
352
368
  {
353
369
  $lookup: {
354
370
  from: "leftovers",
@@ -383,9 +399,9 @@ const controllerFactory$5 = (db) => {
383
399
  {
384
400
  $match: {
385
401
  $or: [
386
- { ingridients: { $exists: false } },
402
+ { ingredients: { $exists: false } },
387
403
  // Продукты без ингредиентов
388
- { ingridients: { $size: 0 } }
404
+ { ingredients: { $size: 0 } }
389
405
  ]
390
406
  }
391
407
  },
@@ -519,13 +535,21 @@ const controllerFactory$5 = (db) => {
519
535
  {
520
536
  $lookup: {
521
537
  from: "leftovers",
522
- let: { productId: "$_id", ingredients: { $ifNull: ["$ingredients", []] } },
538
+ let: { productId: "$_id", ingredientsIds: "$ingredients._id" },
523
539
  pipeline: [
524
540
  {
525
541
  $unwind: "$positions"
526
542
  },
527
543
  {
528
- "$match": { "$expr": { "$eq": ["$positions._id", "$$productId"] } }
544
+ $match: {
545
+ $expr: {
546
+ $or: [
547
+ { $eq: ["$positions._id", "$$productId"] },
548
+ { $in: ["$positions._id", { $ifNull: ["$$ingredientsIds", []] }] }
549
+ // Исправлено
550
+ ]
551
+ }
552
+ }
529
553
  },
530
554
  {
531
555
  "$addFields": {
@@ -546,18 +570,75 @@ const controllerFactory$5 = (db) => {
546
570
  }
547
571
  }
548
572
  ],
549
- as: "variants"
573
+ as: "leftovers"
574
+ }
575
+ },
576
+ {
577
+ $addFields: {
578
+ ingredientsQuantities: {
579
+ $cond: {
580
+ if: { $isArray: "$ingredients" },
581
+ then: {
582
+ $map: {
583
+ input: "$ingredients",
584
+ as: "ingredient",
585
+ in: {
586
+ $let: {
587
+ vars: {
588
+ ingredientId: "$$ingredient._id",
589
+ ingredientQuantity: { $ifNull: ["$$ingredient.quantity", 0] }
590
+ },
591
+ in: {
592
+ $divide: [
593
+ {
594
+ $sum: {
595
+ $map: {
596
+ input: "$leftovers",
597
+ as: "leftover",
598
+ in: {
599
+ $cond: {
600
+ if: { $eq: ["$$leftover._id", "$$ingredientId"] },
601
+ then: "$$leftover.quantity",
602
+ else: 0
603
+ }
604
+ }
605
+ }
606
+ }
607
+ },
608
+ {
609
+ $cond: {
610
+ if: { $eq: ["$$ingredientQuantity", 0] },
611
+ then: 1,
612
+ else: "$$ingredientQuantity"
613
+ }
614
+ }
615
+ ]
616
+ }
617
+ }
618
+ }
619
+ }
620
+ },
621
+ else: []
622
+ }
623
+ }
550
624
  }
551
625
  },
552
626
  {
553
627
  $set: {
554
628
  quantity: {
555
- $sum: ["$quantity", { $sum: "$variants.quantity" }]
629
+ $cond: {
630
+ if: { $gt: [{ $size: { $ifNull: ["$ingredients", []] } }, 0] },
631
+ // Снова проверяем, не пустой ли массив ингредиентов
632
+ then: { $floor: { $min: "$ingredientsQuantities" } },
633
+ else: { $sum: "$leftovers.quantity" }
634
+ // Просто суммируем quantity из leftovers, если ингредиентов нет
635
+ }
556
636
  }
557
637
  }
558
638
  },
559
- { $unset: "variants" }
639
+ { $unset: ["leftovers", "ingredientsQuantities"] }
560
640
  ]);
641
+ console.log(product);
561
642
  if (!product || product.length < 1) {
562
643
  return res.status(404).send({ message: "Product not found." });
563
644
  }
@@ -566,7 +647,6 @@ const controllerFactory$5 = (db) => {
566
647
  { $inc: { popularity: 1 } },
567
648
  { new: true }
568
649
  );
569
- console.log("Popularity updated:", updatedProduct);
570
650
  res.status(200).send(product);
571
651
  } catch (err) {
572
652
  console.error("Error:", err);
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue");require("./Button.vue2.cjs");const u=["disabled"],d={key:0},m={key:1,class:"loading"},b=e.createElementVNode("svg",{class:"i-regular",width:"135",height:"140",viewBox:"0 0 135 140",xmlns:"http://www.w3.org/2000/svg",fill:"#fff"},[e.createElementVNode("rect",{y:"10",width:"15",height:"120",rx:"6"},[e.createElementVNode("animate",{attributeName:"height",begin:"0.5s",dur:"1s",values:"120;110;100;90;80;70;60;50;40;140;120",calcMode:"linear",repeatCount:"indefinite"}),e.createTextVNode(),e.createElementVNode("animate",{attributeName:"y",begin:"0.5s",dur:"1s",values:"10;15;20;25;30;35;40;45;50;0;10",calcMode:"linear",repeatCount:"indefinite"})]),e.createElementVNode("rect",{x:"30",y:"10",width:"15",height:"120",rx:"6"},[e.createElementVNode("animate",{attributeName:"height",begin:"0.25s",dur:"1s",values:"120;110;100;90;80;70;60;50;40;140;120",calcMode:"linear",repeatCount:"indefinite"}),e.createTextVNode(),e.createElementVNode("animate",{attributeName:"y",begin:"0.25s",dur:"1s",values:"10;15;20;25;30;35;40;45;50;0;10",calcMode:"linear",repeatCount:"indefinite"})]),e.createElementVNode("rect",{x:"60",width:"15",height:"140",rx:"6"},[e.createElementVNode("animate",{attributeName:"height",begin:"0s",dur:"1s",values:"120;110;100;90;80;70;60;50;40;140;120",calcMode:"linear",repeatCount:"indefinite"}),e.createTextVNode(),e.createElementVNode("animate",{attributeName:"y",begin:"0s",dur:"1s",values:"10;15;20;25;30;35;40;45;50;0;10",calcMode:"linear",repeatCount:"indefinite"})]),e.createElementVNode("rect",{x:"90",y:"10",width:"15",height:"120",rx:"6"},[e.createElementVNode("animate",{attributeName:"height",begin:"0.25s",dur:"1s",values:"120;110;100;90;80;70;60;50;40;140;120",calcMode:"linear",repeatCount:"indefinite"}),e.createTextVNode(),e.createElementVNode("animate",{attributeName:"y",begin:"0.25s",dur:"1s",values:"10;15;20;25;30;35;40;45;50;0;10",calcMode:"linear",repeatCount:"indefinite"})]),e.createElementVNode("rect",{x:"120",y:"10",width:"15",height:"120",rx:"6"},[e.createElementVNode("animate",{attributeName:"height",begin:"0.5s",dur:"1s",values:"120;110;100;90;80;70;60;50;40;140;120",calcMode:"linear",repeatCount:"indefinite"}),e.createTextVNode(),e.createElementVNode("animate",{attributeName:"y",begin:"0.5s",dur:"1s",values:"10;15;20;25;30;35;40;45;50;0;10",calcMode:"linear",repeatCount:"indefinite"})])],-1),h=[b],f={key:2,class:"t-semi loading t-black"},g={key:3,class:"error"},v={key:0,class:"button-counter"},y={__name:"Button",props:{submit:{type:Function,default:async()=>{console.log("Button click.")}},text:{type:Object,default:t=>(console.log(t),t={...t.text,success:"✔",error:"✖"})},counter:{type:Object},callback:{type:Function,default:async()=>{console.log("Button callback.")}},callbackDelay:{type:Number,default:750},showSucces:{type:Boolean,default:!0},showLoader:{type:Boolean,default:!0},validation:{type:Boolean,default:!1}},setup(t){const n=t,a=e.ref(null),l=e.ref(null),o=e.ref(!1),c=e.ref(!1);async function r(){a.value.style["pointer-events"]="none",l.value=null,o.value=!0;const i=()=>{a.value&&(a.value.classList.replace("bg-second","bg-main"),a.value.style.pointerEvents="auto",o.value=!1,c.value=!1,l.value=null)};try{await n.submit(),a.value.classList.replace("bg-main","bg-second"),o.value=!1,n.showSucces?(c.value=!0,setTimeout(i,500)):i(),n.callback&&setTimeout(()=>n.callback(),n.callbackDelay)}catch{a.value.classList.replace("bg-main","bg-fourth-nano"),l.value=n.error,setTimeout(()=>{i(),a.value.classList.replace("bg-fourth-nano","bg-main")},1330)}}return(i,s)=>(e.openBlock(),e.createElementBlock("button",{onClick:e.withModifiers(r,["stop"]),disabled:t.validation,ref_key:"button",ref:a,class:"button"},[e.createVNode(e.Transition,{name:"moveFromTopAbsolute"},{default:e.withCtx(()=>[!o.value&&!l.value&&!c.value||!t.showLoader?(e.openBlock(),e.createElementBlock("span",d,[e.renderSlot(i.$slots,"default")])):o.value&&!l.value&&t.showLoader?(e.openBlock(),e.createElementBlock("span",m,h)):c.value&&t.showSucces?(e.openBlock(),e.createElementBlock("span",f,e.toDisplayString(t.text.success),1)):l.value?(e.openBlock(),e.createElementBlock("span",g,e.toDisplayString(l.value),1)):e.createCommentVNode("",!0)]),_:3}),t.counter?(e.openBlock(),e.createElementBlock("p",v,e.toDisplayString(t.counter),1)):e.createCommentVNode("",!0)],8,u))}};exports.default=y;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e="";exports.default=e;