@ozdao/prometheus-framework 0.2.118 → 0.2.120

Sign up to get free protection for your applications and to get access to all the features.
Files changed (175) hide show
  1. package/dist/community.server.js +1 -1
  2. package/dist/community.server.mjs +1 -1
  3. package/dist/events.server.js +1 -1
  4. package/dist/events.server.mjs +1 -1
  5. package/dist/gallery.server.js +13 -3
  6. package/dist/gallery.server.mjs +13 -3
  7. package/dist/main-DL3vRQCi.js +92 -0
  8. package/dist/main-Ds3Z5x5d.mjs +14206 -0
  9. package/dist/main.css +1 -1
  10. package/dist/orders.server.js +1 -1
  11. package/dist/orders.server.mjs +1 -1
  12. package/dist/organizations.server.js +1 -1
  13. package/dist/organizations.server.mjs +1 -1
  14. package/dist/products.server.js +1 -1
  15. package/dist/products.server.mjs +1 -1
  16. package/dist/prometheus-framework/src/components/Button/Button.vue.cjs +1 -1
  17. package/dist/prometheus-framework/src/components/Button/Button.vue.js +94 -1
  18. package/dist/prometheus-framework/src/components/Button/Button.vue2.cjs +1 -1
  19. package/dist/prometheus-framework/src/components/Button/Button.vue2.js +1 -94
  20. package/dist/prometheus-framework/src/components/DatePicker/Calendar.vue2.cjs +1 -1
  21. package/dist/prometheus-framework/src/components/DatePicker/Calendar.vue2.js +116 -117
  22. package/dist/prometheus-framework/src/components/Feed/Feed.vue.cjs +1 -1
  23. package/dist/prometheus-framework/src/components/Feed/Feed.vue.js +123 -109
  24. package/dist/prometheus-framework/src/components/Field/Field.vue.cjs +1 -1
  25. package/dist/prometheus-framework/src/components/Field/Field.vue.js +84 -1
  26. package/dist/prometheus-framework/src/components/Field/Field.vue2.cjs +1 -1
  27. package/dist/prometheus-framework/src/components/Field/Field.vue2.js +1 -84
  28. package/dist/prometheus-framework/src/components/FieldBig/FieldBig.vue.cjs +1 -1
  29. package/dist/prometheus-framework/src/components/FieldBig/FieldBig.vue.js +1 -1
  30. package/dist/prometheus-framework/src/components/FieldTags/BlockTags.vue.cjs +1 -1
  31. package/dist/prometheus-framework/src/components/FieldTags/BlockTags.vue.js +32 -26
  32. package/dist/prometheus-framework/src/components/Popup/Popup.vue.cjs +1 -1
  33. package/dist/prometheus-framework/src/components/Popup/Popup.vue.js +30 -26
  34. package/dist/prometheus-framework/src/modules/auth/components/layouts/Auth.vue.cjs +1 -1
  35. package/dist/prometheus-framework/src/modules/auth/components/layouts/Auth.vue.js +2 -2
  36. package/dist/prometheus-framework/src/modules/auth/components/pages/EnterCode.vue.cjs +1 -1
  37. package/dist/prometheus-framework/src/modules/auth/components/pages/EnterCode.vue.js +1 -1
  38. package/dist/prometheus-framework/src/modules/auth/components/pages/EnterPassword.vue.cjs +1 -1
  39. package/dist/prometheus-framework/src/modules/auth/components/pages/EnterPassword.vue.js +2 -2
  40. package/dist/prometheus-framework/src/modules/auth/components/pages/Invite.vue.cjs +1 -1
  41. package/dist/prometheus-framework/src/modules/auth/components/pages/Invite.vue.js +2 -2
  42. package/dist/prometheus-framework/src/modules/auth/components/pages/ResetPassword.vue.cjs +1 -1
  43. package/dist/prometheus-framework/src/modules/auth/components/pages/ResetPassword.vue.js +2 -2
  44. package/dist/prometheus-framework/src/modules/auth/components/pages/SignIn.vue.cjs +1 -1
  45. package/dist/prometheus-framework/src/modules/auth/components/pages/SignIn.vue.js +2 -2
  46. package/dist/prometheus-framework/src/modules/auth/components/pages/SignUp.vue.cjs +1 -1
  47. package/dist/prometheus-framework/src/modules/auth/components/pages/SignUp.vue.js +2 -2
  48. package/dist/prometheus-framework/src/modules/community/components/pages/Community.vue.cjs +1 -1
  49. package/dist/prometheus-framework/src/modules/community/components/pages/Community.vue.js +2 -2
  50. package/dist/prometheus-framework/src/modules/community/components/pages/CreateBlogPost.vue.cjs +1 -1
  51. package/dist/prometheus-framework/src/modules/community/components/pages/CreateBlogPost.vue.js +2 -2
  52. package/dist/prometheus-framework/src/modules/community/components/sections/HotPosts.vue.cjs +1 -1
  53. package/dist/prometheus-framework/src/modules/community/components/sections/HotPosts.vue.js +16 -17
  54. package/dist/prometheus-framework/src/modules/constructor/components/elements/Embed.vue.cjs +1 -1
  55. package/dist/prometheus-framework/src/modules/constructor/components/elements/Embed.vue.js +1 -1
  56. package/dist/prometheus-framework/src/modules/events/components/elements/ButtonCheck.vue.cjs +1 -1
  57. package/dist/prometheus-framework/src/modules/events/components/elements/ButtonCheck.vue.js +1 -1
  58. package/dist/prometheus-framework/src/modules/events/components/elements/ButtonJoin.vue.cjs +1 -1
  59. package/dist/prometheus-framework/src/modules/events/components/elements/ButtonJoin.vue.js +1 -1
  60. package/dist/prometheus-framework/src/modules/events/components/pages/EditEvent.vue.cjs +1 -1
  61. package/dist/prometheus-framework/src/modules/events/components/pages/EditEvent.vue.js +2 -2
  62. package/dist/prometheus-framework/src/modules/events/components/pages/EditEventTickets.vue.cjs +1 -1
  63. package/dist/prometheus-framework/src/modules/events/components/pages/EditEventTickets.vue.js +2 -2
  64. package/dist/prometheus-framework/src/modules/events/components/pages/Events.vue.cjs +1 -1
  65. package/dist/prometheus-framework/src/modules/events/components/pages/Events.vue.js +44 -69
  66. package/dist/prometheus-framework/src/modules/gallery/components/blocks/PhotoViewer.vue.cjs +1 -0
  67. package/dist/prometheus-framework/src/modules/gallery/components/blocks/PhotoViewer.vue.js +64 -0
  68. package/dist/prometheus-framework/src/modules/gallery/components/blocks/PhotoViewer.vue2.cjs +1 -0
  69. package/dist/prometheus-framework/src/modules/gallery/components/blocks/PhotoViewer.vue2.js +1 -0
  70. package/dist/prometheus-framework/src/modules/gallery/components/pages/Gallery.vue.cjs +1 -1
  71. package/dist/prometheus-framework/src/modules/gallery/components/pages/Gallery.vue.js +101 -14
  72. package/dist/prometheus-framework/src/modules/gallery/components/sections/BackofficeGallery.vue.cjs +1 -1
  73. package/dist/prometheus-framework/src/modules/gallery/components/sections/BackofficeGallery.vue.js +166 -103
  74. package/dist/prometheus-framework/src/modules/globals/components/blocks/BlockSearch.vue.cjs +1 -1
  75. package/dist/prometheus-framework/src/modules/globals/components/blocks/BlockSearch.vue.js +1 -1
  76. package/dist/prometheus-framework/src/modules/globals/components/blocks/CardHeader.vue.cjs +1 -1
  77. package/dist/prometheus-framework/src/modules/globals/components/blocks/CardHeader.vue.js +2 -2
  78. package/dist/prometheus-framework/src/modules/globals/components/elements/ButtonDate.vue.cjs +1 -1
  79. package/dist/prometheus-framework/src/modules/globals/components/elements/ButtonDate.vue.js +38 -1
  80. package/dist/prometheus-framework/src/modules/globals/components/sections/SectionPageTitle.vue.cjs +1 -1
  81. package/dist/prometheus-framework/src/modules/globals/components/sections/SectionPageTitle.vue.js +3 -3
  82. package/dist/prometheus-framework/src/modules/globals/services/globals.store.cjs +1 -1
  83. package/dist/prometheus-framework/src/modules/globals/services/globals.store.js +21 -21
  84. package/dist/prometheus-framework/src/modules/icons/skeletons/SkeletonBlogpost.vue.cjs +1 -1
  85. package/dist/prometheus-framework/src/modules/icons/skeletons/SkeletonBlogpost.vue.js +3 -3
  86. package/dist/prometheus-framework/src/modules/icons/skeletons/SkeletonEvent.vue.cjs +1 -1
  87. package/dist/prometheus-framework/src/modules/icons/skeletons/SkeletonEvent.vue.js +1 -1
  88. package/dist/prometheus-framework/src/modules/icons/skeletons/SkeletonEventShort.vue.cjs +1 -1
  89. package/dist/prometheus-framework/src/modules/icons/skeletons/SkeletonEventShort.vue.js +5 -5
  90. package/dist/prometheus-framework/src/modules/icons/skeletons/SkeletonOrganization.vue.cjs +1 -1
  91. package/dist/prometheus-framework/src/modules/icons/skeletons/SkeletonOrganization.vue.js +1 -1
  92. package/dist/prometheus-framework/src/modules/legal/components/pages/Legal.vue.cjs +1 -1
  93. package/dist/prometheus-framework/src/modules/legal/components/pages/Legal.vue.js +2 -2
  94. package/dist/prometheus-framework/src/modules/orders/components/pages/OrderCreateBackoffice.vue.cjs +1 -1
  95. package/dist/prometheus-framework/src/modules/orders/components/pages/OrderCreateBackoffice.vue.js +2 -2
  96. package/dist/prometheus-framework/src/modules/orders/components/sections/FormAddCustomer.vue.cjs +1 -1
  97. package/dist/prometheus-framework/src/modules/orders/components/sections/FormAddCustomer.vue.js +2 -2
  98. package/dist/prometheus-framework/src/modules/orders/components/sections/FormCustomerDetails.vue.cjs +1 -1
  99. package/dist/prometheus-framework/src/modules/orders/components/sections/FormCustomerDetails.vue.js +1 -1
  100. package/dist/prometheus-framework/src/modules/orders/components/sections/FormDelivery.vue.cjs +1 -1
  101. package/dist/prometheus-framework/src/modules/orders/components/sections/FormDelivery.vue.js +1 -1
  102. package/dist/prometheus-framework/src/modules/organizations/components/elements/ButtonToggleMembership.vue.cjs +1 -1
  103. package/dist/prometheus-framework/src/modules/organizations/components/elements/ButtonToggleMembership.vue.js +1 -1
  104. package/dist/prometheus-framework/src/modules/organizations/components/pages/DepartmentEdit.vue.cjs +1 -1
  105. package/dist/prometheus-framework/src/modules/organizations/components/pages/DepartmentEdit.vue.js +2 -2
  106. package/dist/prometheus-framework/src/modules/organizations/components/pages/OrganizationEdit.vue.cjs +1 -1
  107. package/dist/prometheus-framework/src/modules/organizations/components/pages/OrganizationEdit.vue.js +2 -2
  108. package/dist/prometheus-framework/src/modules/organizations/components/sections/Documents.vue.cjs +1 -1
  109. package/dist/prometheus-framework/src/modules/organizations/components/sections/Documents.vue.js +2 -2
  110. package/dist/prometheus-framework/src/modules/organizations/components/sections/MembersAdd.vue.cjs +1 -1
  111. package/dist/prometheus-framework/src/modules/organizations/components/sections/MembersAdd.vue.js +2 -2
  112. package/dist/prometheus-framework/src/modules/organizations/components/sections/Organizations.vue.cjs +1 -1
  113. package/dist/prometheus-framework/src/modules/organizations/components/sections/Organizations.vue.js +2 -2
  114. package/dist/prometheus-framework/src/modules/products/components/blocks/CardPosition.vue.cjs +1 -1
  115. package/dist/prometheus-framework/src/modules/products/components/blocks/CardPosition.vue.js +1 -1
  116. package/dist/prometheus-framework/src/modules/products/components/blocks/LeftoverPositions.vue.cjs +1 -1
  117. package/dist/prometheus-framework/src/modules/products/components/blocks/LeftoverPositions.vue.js +1 -1
  118. package/dist/prometheus-framework/src/modules/products/components/blocks/ListPositions.vue.cjs +1 -1
  119. package/dist/prometheus-framework/src/modules/products/components/blocks/ListPositions.vue.js +1 -1
  120. package/dist/prometheus-framework/src/modules/products/components/pages/Categories.vue.cjs +1 -1
  121. package/dist/prometheus-framework/src/modules/products/components/pages/Categories.vue.js +1 -1
  122. package/dist/prometheus-framework/src/modules/products/components/pages/CategoryEdit.vue.cjs +1 -1
  123. package/dist/prometheus-framework/src/modules/products/components/pages/CategoryEdit.vue.js +2 -2
  124. package/dist/prometheus-framework/src/modules/products/components/pages/EditLeftover.vue.cjs +1 -1
  125. package/dist/prometheus-framework/src/modules/products/components/pages/EditLeftover.vue.js +1 -1
  126. package/dist/prometheus-framework/src/modules/products/components/pages/ProductEdit.vue.cjs +1 -1
  127. package/dist/prometheus-framework/src/modules/products/components/pages/ProductEdit.vue.js +2 -2
  128. package/dist/prometheus-framework/src/modules/products/components/sections/EditModifications.vue.cjs +1 -1
  129. package/dist/prometheus-framework/src/modules/products/components/sections/EditModifications.vue.js +1 -1
  130. package/dist/prometheus-framework/src/modules/products/components/sections/EditProductInfo.vue.cjs +1 -1
  131. package/dist/prometheus-framework/src/modules/products/components/sections/EditProductInfo.vue.js +2 -2
  132. package/dist/prometheus-framework/src/modules/products/components/sections/FilterProducts.vue.cjs +1 -1
  133. package/dist/prometheus-framework/src/modules/products/components/sections/FilterProducts.vue.js +31 -32
  134. package/dist/prometheus-framework/src/modules/products/components/sections/SectionProduct.vue.cjs +1 -1
  135. package/dist/prometheus-framework/src/modules/products/components/sections/SectionProduct.vue.js +1 -1
  136. package/dist/prometheus-framework/src/modules/reports/components/sections/FormReport.vue.cjs +1 -1
  137. package/dist/prometheus-framework/src/modules/reports/components/sections/FormReport.vue.js +1 -1
  138. package/dist/prometheus-framework/src/modules/users/components/pages/Profile.vue.cjs +1 -1
  139. package/dist/prometheus-framework/src/modules/users/components/pages/Profile.vue.js +2 -2
  140. package/dist/prometheus-framework/src/modules/users/components/pages/ProfileEdit.vue.cjs +1 -1
  141. package/dist/prometheus-framework/src/modules/users/components/pages/ProfileEdit.vue.js +2 -2
  142. package/dist/prometheus-framework/src/modules/wallet/views/components/pages/Wallet.vue.cjs +1 -1
  143. package/dist/prometheus-framework/src/modules/wallet/views/components/pages/Wallet.vue.js +1 -1
  144. package/dist/prometheus-framework.cjs.js +1 -1
  145. package/dist/prometheus-framework.es.js +1 -1
  146. package/dist/queryProcessor-g8208K6g.mjs +178 -0
  147. package/dist/queryProcessor-haY_gPGg.js +177 -0
  148. package/dist/style.css +1 -1
  149. package/dist/wallet.server.js +1 -1
  150. package/dist/wallet.server.mjs +1 -1
  151. package/dist/web-B8tq3Fda.mjs +54 -0
  152. package/dist/web-ByJkgGrt.js +1 -0
  153. package/package.json +1 -1
  154. package/src/components/DatePicker/Calendar.vue +82 -55
  155. package/src/components/Feed/Feed.vue +45 -16
  156. package/src/components/FieldTags/BlockTags.vue +30 -23
  157. package/src/components/Popup/Popup.vue +2 -2
  158. package/src/modules/events/components/pages/Events.vue +2 -48
  159. package/src/modules/gallery/components/blocks/PhotoViewer.vue +115 -0
  160. package/src/modules/gallery/components/pages/Gallery.vue +103 -6
  161. package/src/modules/gallery/components/sections/BackofficeGallery.vue +100 -32
  162. package/src/modules/gallery/controllers/gallery.controller.js +45 -38
  163. package/src/modules/gallery/models/photo.model.js +4 -0
  164. package/src/modules/globals/components/blocks/CardHeader.vue +1 -1
  165. package/src/modules/globals/components/elements/ButtonDate.vue +37 -43
  166. package/src/modules/globals/components/layouts/Client.vue +1 -1
  167. package/src/modules/globals/components/sections/SectionPageTitle.vue +1 -1
  168. package/src/modules/globals/controllers/utils/queryProcessor.js +21 -2
  169. package/src/modules/globals/services/globals.store.js +13 -17
  170. package/src/modules/icons/skeletons/SkeletonBlogpost.vue +1 -1
  171. package/src/modules/icons/skeletons/SkeletonEvent.vue +1 -1
  172. package/src/modules/icons/skeletons/SkeletonEventShort.vue +1 -1
  173. package/src/modules/icons/skeletons/SkeletonOrganization.vue +1 -1
  174. package/src/modules/products/components/sections/FilterProducts.vue +2 -1
  175. package/src/modules/gallery/components/sections/GalleryWithCategories.vue +0 -176
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),t=require("../../store/wallet.store.cjs"),s=require("../../../../../../../node_modules/web3/lib/esm/web3.cjs");require("../../../../../../../node_modules/web3-core/lib/esm/web3_config.cjs");require("../../../../../../../node_modules/web3-core/lib/esm/web3_request_manager.cjs");require("../../../../../../../node_modules/web3-core/lib/esm/web3_subscription_manager.cjs");require("../../../../../../../node_modules/web3-core/lib/esm/web3_subscriptions.cjs");require("../../../../../../../node_modules/web3-core/lib/esm/web3_context.cjs");require("../../../../../../../node_modules/web3-core/lib/esm/web3_batch_request.cjs");require("../../../../../../../node_modules/web3-types/lib/esm/data_format_types.cjs");require("../../../../../../../node_modules/web3-types/lib/esm/eth_types.cjs");require("../../../../../../../node_modules/web3-types/lib/esm/web3_base_provider.cjs");require("../../../../../../../node_modules/web3-errors/lib/esm/errors/rpc_errors.cjs");require("../../../../../../../node_modules/web3-eth-iban/lib/esm/iban.cjs");require("../../../../../../../node_modules/web3-validator/lib/esm/formats.cjs");require("../../../../../../../node_modules/web3-validator/lib/esm/default_validator.cjs");require("../../../../../../../node_modules/web3-core/lib/esm/web3_promi_event.cjs");require("../../../../../../../node_modules/setimmediate/setImmediate.cjs");require("../../../../../../../node_modules/web3-eth/lib/esm/web3_eth.cjs");require("../../../../../../../node_modules/web3-eth-abi/lib/esm/coders/base/number.cjs");require("../../../../../../../node_modules/web3-eth/lib/esm/schemas.cjs");require("../../../../../../../node_modules/web3-eth/lib/esm/constants.cjs");require("../../../../../../../node_modules/web3-eth/lib/esm/rpc_method_wrappers.cjs");require("../../../../../../../node_modules/web3-eth/lib/esm/utils/prepare_transaction_for_signing.cjs");require("../../../../../../../node_modules/web3-eth/lib/esm/utils/transaction_builder.cjs");require("../../../../../../../node_modules/web3-eth/lib/esm/utils/wait_for_transaction_receipt.cjs");require("../../../../../../../node_modules/web3-eth/lib/esm/utils/try_send_transaction.cjs");require("../../../../../../../node_modules/web3-eth/lib/esm/utils/send_tx_helper.cjs");require("../../../../../../../node_modules/web3-eth-contract/lib/esm/contract.cjs");require("../../../../../../../node_modules/web3-eth-personal/lib/esm/personal.cjs");require("../../../../../../../node_modules/web3-net/lib/esm/net.cjs");require("../../../../../../../node_modules/web3-net/lib/esm/rpc_method_wrappers.cjs");require("../../../../../../../node_modules/web3-providers-http/lib/esm/index.cjs");require("../../../../../../../node_modules/isomorphic-ws/browser.cjs");require("../../../../../../../node_modules/web3-eth-accounts/lib/esm/wallet.cjs");require("../../../../../../../node_modules/web3-eth-accounts/lib/esm/account.cjs");require("../../../../../../../node_modules/crc-32/crc32.cjs");require("../../../../../../../node_modules/web3-eth-accounts/lib/esm/common/types.cjs");require("../../../../../../../node_modules/web3-eth-accounts/lib/esm/tx/constants.cjs");require("../../../../../../../node_modules/web3-eth-accounts/lib/esm/common/enums.cjs");require("../../../../../../../node_modules/web3-eth-accounts/lib/esm/tx/eip1559Transaction.cjs");require("../../../../../../../node_modules/web3-eth-accounts/lib/esm/tx/eip2930Transaction.cjs");require("../../../../../../../node_modules/@ethereumjs/rlp/dist/index.cjs");require("../../../../../../../node_modules/web3-eth-accounts/lib/esm/tx/types.cjs");require("../../../../../../../node_modules/web3-eth-ens/lib/esm/ens.cjs");require("../../../../../../../node_modules/web3/lib/esm/web3_eip6963.cjs");require("../../../../../../../node_modules/web3-rpc-methods/lib/esm/eth_rpc_methods.cjs");require("../../../../../../../node_modules/web3-rpc-methods/lib/esm/net_rpc_methods.cjs");require("../../../../../../../node_modules/web3-rpc-methods/lib/esm/personal_rpc_methods.cjs");require("vue-router");require("vue-i18n");require("../../../../../components/Popup/Popup.vue2.cjs");require("../../../../../components/Loader/Loader.vue.cjs");require("../../../../../components/Button/Button.vue.cjs");require("../../../../../components/Select/Select.vue2.cjs");require("../../../../reports/store/reports.cjs");require("../../../../../components/Tooltip/Tooltip.vue2.cjs");require("../../../../../components/Dropdown/Dropdown.vue.cjs");require("../../../../auth/store/auth.cjs");require("../../../../organizations/store/memberships.cjs");require("../../../../community/store/reactions.cjs");require("../../../../../components/Chips/Chips.vue2.cjs");const a={class:"pd-thin"},l={class:"bg-black t-white mn-b-thin radius-big pd-big"},i=e.createElementVNode("h1",{class:"mn-b-medium"},"Your Wallet",-1),c=e.createElementVNode("p",{class:"mn-b-semi t-transp p-big"}," Earn Weeder Tokens by purchasing our weed or contributing to the community. ",-1),u={key:0,class:"gap-thin flex-nowrap bg-black radius-extra t-white br-solid br-white-transp-10 br-1px flex-v-center flex pd-medium"},d={class:"flex-v-center flex-nowrap flex mn-r-auto"},m=e.createElementVNode("button",{class:"w-max bg-main t-medium button"},"Get More",-1),p={key:0,class:"mn-b-semi cols-2 gap-thin"},b=e.createElementVNode("div",{class:"w-100 pd-medium radius-medium t-center bg-light"},[e.createElementVNode("h3",{class:"mn-b-small"},"Make first order and start earning Weeder Token"),e.createElementVNode("button",{class:"mn-l-auto mn-r-auto bg-main button"},"Explore marketplace")],-1),q={class:"w-100 pd-medium flex-center flex flex-column radius-medium t-center bg-light"},h={key:0,class:"mn-b-small"},_={key:1,class:"w-100 mn-b-semi flex-column flex pd-big radius-big bg-main t-black"},k=e.createElementVNode("p",{class:"t-transp t-medium mn-b-thin"},"You own:",-1),f={class:"h1 mn-b-small"},g=e.createElementVNode("p",{class:"t-white p-big t-medium mn-b-semi"},"of all shares",-1),E={class:"flex-v-center mn-b-small flex-nowrap flex pd-small bg-black-transp-5 radius-extra"},w={key:0,class:"t-transp t-medium"},N=e.createElementVNode("span",{class:"uppercase p-small t-medium t-transp"},"Connected Metamask",-1),V=e.createElementVNode("br",null,null,-1),x={key:2,class:"mn-b-small"},B={class:"cols-3 gap-thin"},y={class:"radius-medium bg-light"},v={class:"flex-nowrap br-b br-black-transp-10 br-solid flex pd-medium"},C={class:"t-semi mn-r-auto"},W={class:"pd-t-nano pd-b-nano pd-l-thin pd-r-thin bg-main flex flex-center radius-extra t-semi p-small"},D={class:"pd-medium"},S={class:"t-regular mn-b-thin"},M={__name:"Wallet",setup(R){return window.ethereum.on("accountsChanged",o=>{o.length<1&&(t.state.account=null)}),t.state.web3=new s.Web3(window.ethereum||"http://localhost:8080"),e.onMounted(()=>{t.actions.listRewards(),t.actions.tryReconnectWallet()}),(o,n)=>(e.openBlock(),e.createElementBlock("section",a,[e.createElementVNode("section",l,[i,c,e.unref(t.state).account?(e.openBlock(),e.createElementBlock("div",u,[e.createElementVNode("div",d,[e.createElementVNode("h2",null,e.toDisplayString(e.unref(t.state).tokenBalance)+" WDT",1)]),m,e.createElementVNode("button",{class:"w-max bg-white t-black t-medium button",onClick:n[0]||(n[0]=(...r)=>e.unref(t.actions).collectRewards&&e.unref(t.actions).collectRewards(...r))},"Withdraw")])):e.createCommentVNode("",!0)]),e.unref(t.state).account?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",p,[b,e.createElementVNode("div",q,[e.unref(t.state).account?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("h3",h," Connect Metamask to withdrawal your earnings. ")),e.unref(t.state).account?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("button",{key:1,onClick:n[1]||(n[1]=(...r)=>e.unref(t.actions).connectWallet&&e.unref(t.actions).connectWallet(...r)),class:"br-solid br-2px br-black-transp-10 t-black button"}," Connect Wallet "))])])),e.unref(t.state).account?(e.openBlock(),e.createElementBlock("div",_,[k,e.createElementVNode("p",f,e.toDisplayString(e.unref(t.state).share)+"%",1),g,e.createElementVNode("div",E,[e.unref(t.state).account?(e.openBlock(),e.createElementBlock("p",w,[N,V,e.createElementVNode("span",null,e.toDisplayString(e.unref(t.state).account),1)])):e.createCommentVNode("",!0),e.unref(t.state).account?(e.openBlock(),e.createElementBlock("button",{key:1,onClick:n[2]||(n[2]=(...r)=>e.unref(t.actions).disconnectWallet&&e.unref(t.actions).disconnectWallet(...r)),class:"mn-l-auto bg-red button"}," Disconnect Wallet ")):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0),e.unref(t.state).rewards.length>0?(e.openBlock(),e.createElementBlock("h2",x,"Latest Rewards ")):e.createCommentVNode("",!0),e.createElementVNode("section",B,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(t.state).rewards,r=>(e.openBlock(),e.createElementBlock("div",y,[e.createElementVNode("div",v,[e.createElementVNode("p",C,e.toDisplayString(r.amount)+" WDT",1),e.createElementVNode("span",W,e.toDisplayString(r.type==="blogpost"?"Community Reward":r.type),1)]),e.createElementVNode("div",D,[e.createElementVNode("h4",S,e.toDisplayString(r.name),1)])]))),256))])]))}};exports.default=M;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),t=require("../../store/wallet.store.cjs"),s=require("../../../../../../../node_modules/web3/lib/esm/web3.cjs");require("../../../../../../../node_modules/web3-core/lib/esm/web3_config.cjs");require("../../../../../../../node_modules/web3-core/lib/esm/web3_request_manager.cjs");require("../../../../../../../node_modules/web3-core/lib/esm/web3_subscription_manager.cjs");require("../../../../../../../node_modules/web3-core/lib/esm/web3_subscriptions.cjs");require("../../../../../../../node_modules/web3-core/lib/esm/web3_context.cjs");require("../../../../../../../node_modules/web3-core/lib/esm/web3_batch_request.cjs");require("../../../../../../../node_modules/web3-types/lib/esm/data_format_types.cjs");require("../../../../../../../node_modules/web3-types/lib/esm/eth_types.cjs");require("../../../../../../../node_modules/web3-types/lib/esm/web3_base_provider.cjs");require("../../../../../../../node_modules/web3-errors/lib/esm/errors/rpc_errors.cjs");require("../../../../../../../node_modules/web3-eth-iban/lib/esm/iban.cjs");require("../../../../../../../node_modules/web3-validator/lib/esm/formats.cjs");require("../../../../../../../node_modules/web3-validator/lib/esm/default_validator.cjs");require("../../../../../../../node_modules/web3-core/lib/esm/web3_promi_event.cjs");require("../../../../../../../node_modules/setimmediate/setImmediate.cjs");require("../../../../../../../node_modules/web3-eth/lib/esm/web3_eth.cjs");require("../../../../../../../node_modules/web3-eth-abi/lib/esm/coders/base/number.cjs");require("../../../../../../../node_modules/web3-eth/lib/esm/schemas.cjs");require("../../../../../../../node_modules/web3-eth/lib/esm/constants.cjs");require("../../../../../../../node_modules/web3-eth/lib/esm/rpc_method_wrappers.cjs");require("../../../../../../../node_modules/web3-eth/lib/esm/utils/prepare_transaction_for_signing.cjs");require("../../../../../../../node_modules/web3-eth/lib/esm/utils/transaction_builder.cjs");require("../../../../../../../node_modules/web3-eth/lib/esm/utils/wait_for_transaction_receipt.cjs");require("../../../../../../../node_modules/web3-eth/lib/esm/utils/try_send_transaction.cjs");require("../../../../../../../node_modules/web3-eth/lib/esm/utils/send_tx_helper.cjs");require("../../../../../../../node_modules/web3-eth-contract/lib/esm/contract.cjs");require("../../../../../../../node_modules/web3-eth-personal/lib/esm/personal.cjs");require("../../../../../../../node_modules/web3-net/lib/esm/net.cjs");require("../../../../../../../node_modules/web3-net/lib/esm/rpc_method_wrappers.cjs");require("../../../../../../../node_modules/web3-providers-http/lib/esm/index.cjs");require("../../../../../../../node_modules/isomorphic-ws/browser.cjs");require("../../../../../../../node_modules/web3-eth-accounts/lib/esm/wallet.cjs");require("../../../../../../../node_modules/web3-eth-accounts/lib/esm/account.cjs");require("../../../../../../../node_modules/crc-32/crc32.cjs");require("../../../../../../../node_modules/web3-eth-accounts/lib/esm/common/types.cjs");require("../../../../../../../node_modules/web3-eth-accounts/lib/esm/tx/constants.cjs");require("../../../../../../../node_modules/web3-eth-accounts/lib/esm/common/enums.cjs");require("../../../../../../../node_modules/web3-eth-accounts/lib/esm/tx/eip1559Transaction.cjs");require("../../../../../../../node_modules/web3-eth-accounts/lib/esm/tx/eip2930Transaction.cjs");require("../../../../../../../node_modules/@ethereumjs/rlp/dist/index.cjs");require("../../../../../../../node_modules/web3-eth-accounts/lib/esm/tx/types.cjs");require("../../../../../../../node_modules/web3-eth-ens/lib/esm/ens.cjs");require("../../../../../../../node_modules/web3/lib/esm/web3_eip6963.cjs");require("../../../../../../../node_modules/web3-rpc-methods/lib/esm/eth_rpc_methods.cjs");require("../../../../../../../node_modules/web3-rpc-methods/lib/esm/net_rpc_methods.cjs");require("../../../../../../../node_modules/web3-rpc-methods/lib/esm/personal_rpc_methods.cjs");require("vue-router");require("vue-i18n");require("../../../../../components/Popup/Popup.vue2.cjs");require("../../../../../components/Loader/Loader.vue.cjs");require("../../../../../components/Button/Button.vue2.cjs");require("../../../../../components/Select/Select.vue2.cjs");require("../../../../reports/store/reports.cjs");require("../../../../../components/Tooltip/Tooltip.vue2.cjs");require("../../../../../components/Dropdown/Dropdown.vue.cjs");require("../../../../auth/store/auth.cjs");require("../../../../organizations/store/memberships.cjs");require("../../../../community/store/reactions.cjs");require("../../../../../components/Chips/Chips.vue2.cjs");const a={class:"pd-thin"},l={class:"bg-black t-white mn-b-thin radius-big pd-big"},i=e.createElementVNode("h1",{class:"mn-b-medium"},"Your Wallet",-1),c=e.createElementVNode("p",{class:"mn-b-semi t-transp p-big"}," Earn Weeder Tokens by purchasing our weed or contributing to the community. ",-1),u={key:0,class:"gap-thin flex-nowrap bg-black radius-extra t-white br-solid br-white-transp-10 br-1px flex-v-center flex pd-medium"},d={class:"flex-v-center flex-nowrap flex mn-r-auto"},m=e.createElementVNode("button",{class:"w-max bg-main t-medium button"},"Get More",-1),p={key:0,class:"mn-b-semi cols-2 gap-thin"},b=e.createElementVNode("div",{class:"w-100 pd-medium radius-medium t-center bg-light"},[e.createElementVNode("h3",{class:"mn-b-small"},"Make first order and start earning Weeder Token"),e.createElementVNode("button",{class:"mn-l-auto mn-r-auto bg-main button"},"Explore marketplace")],-1),q={class:"w-100 pd-medium flex-center flex flex-column radius-medium t-center bg-light"},h={key:0,class:"mn-b-small"},_={key:1,class:"w-100 mn-b-semi flex-column flex pd-big radius-big bg-main t-black"},k=e.createElementVNode("p",{class:"t-transp t-medium mn-b-thin"},"You own:",-1),f={class:"h1 mn-b-small"},g=e.createElementVNode("p",{class:"t-white p-big t-medium mn-b-semi"},"of all shares",-1),E={class:"flex-v-center mn-b-small flex-nowrap flex pd-small bg-black-transp-5 radius-extra"},w={key:0,class:"t-transp t-medium"},N=e.createElementVNode("span",{class:"uppercase p-small t-medium t-transp"},"Connected Metamask",-1),V=e.createElementVNode("br",null,null,-1),x={key:2,class:"mn-b-small"},B={class:"cols-3 gap-thin"},y={class:"radius-medium bg-light"},v={class:"flex-nowrap br-b br-black-transp-10 br-solid flex pd-medium"},C={class:"t-semi mn-r-auto"},W={class:"pd-t-nano pd-b-nano pd-l-thin pd-r-thin bg-main flex flex-center radius-extra t-semi p-small"},D={class:"pd-medium"},S={class:"t-regular mn-b-thin"},M={__name:"Wallet",setup(R){return window.ethereum.on("accountsChanged",o=>{o.length<1&&(t.state.account=null)}),t.state.web3=new s.Web3(window.ethereum||"http://localhost:8080"),e.onMounted(()=>{t.actions.listRewards(),t.actions.tryReconnectWallet()}),(o,n)=>(e.openBlock(),e.createElementBlock("section",a,[e.createElementVNode("section",l,[i,c,e.unref(t.state).account?(e.openBlock(),e.createElementBlock("div",u,[e.createElementVNode("div",d,[e.createElementVNode("h2",null,e.toDisplayString(e.unref(t.state).tokenBalance)+" WDT",1)]),m,e.createElementVNode("button",{class:"w-max bg-white t-black t-medium button",onClick:n[0]||(n[0]=(...r)=>e.unref(t.actions).collectRewards&&e.unref(t.actions).collectRewards(...r))},"Withdraw")])):e.createCommentVNode("",!0)]),e.unref(t.state).account?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",p,[b,e.createElementVNode("div",q,[e.unref(t.state).account?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("h3",h," Connect Metamask to withdrawal your earnings. ")),e.unref(t.state).account?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("button",{key:1,onClick:n[1]||(n[1]=(...r)=>e.unref(t.actions).connectWallet&&e.unref(t.actions).connectWallet(...r)),class:"br-solid br-2px br-black-transp-10 t-black button"}," Connect Wallet "))])])),e.unref(t.state).account?(e.openBlock(),e.createElementBlock("div",_,[k,e.createElementVNode("p",f,e.toDisplayString(e.unref(t.state).share)+"%",1),g,e.createElementVNode("div",E,[e.unref(t.state).account?(e.openBlock(),e.createElementBlock("p",w,[N,V,e.createElementVNode("span",null,e.toDisplayString(e.unref(t.state).account),1)])):e.createCommentVNode("",!0),e.unref(t.state).account?(e.openBlock(),e.createElementBlock("button",{key:1,onClick:n[2]||(n[2]=(...r)=>e.unref(t.actions).disconnectWallet&&e.unref(t.actions).disconnectWallet(...r)),class:"mn-l-auto bg-red button"}," Disconnect Wallet ")):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0),e.unref(t.state).rewards.length>0?(e.openBlock(),e.createElementBlock("h2",x,"Latest Rewards ")):e.createCommentVNode("",!0),e.createElementVNode("section",B,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(t.state).rewards,r=>(e.openBlock(),e.createElementBlock("div",y,[e.createElementVNode("div",v,[e.createElementVNode("p",C,e.toDisplayString(r.amount)+" WDT",1),e.createElementVNode("span",W,e.toDisplayString(r.type==="blogpost"?"Community Reward":r.type),1)]),e.createElementVNode("div",D,[e.createElementVNode("h4",S,e.toDisplayString(r.name),1)])]))),256))])]))}};exports.default=M;
@@ -51,7 +51,7 @@ import "vue-router";
51
51
  import "vue-i18n";
52
52
  import "../../../../../components/Popup/Popup.vue2.js";
53
53
  import "../../../../../components/Loader/Loader.vue.js";
54
- import "../../../../../components/Button/Button.vue.js";
54
+ import "../../../../../components/Button/Button.vue2.js";
55
55
  import "../../../../../components/Select/Select.vue2.js";
56
56
  import "../../../../reports/store/reports.js";
57
57
  import "../../../../../components/Tooltip/Tooltip.vue2.js";
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./main-VcxO-jAt.js");exports.Address=e.Address;exports.Breadcrumbs=e._sfc_main$10;exports.Button=e._sfc_main;exports.Checkbox=e._sfc_main$1;exports.Chips=e.Chips;exports.Countdown=e._sfc_main$11;exports.DatePicker=e._sfc_main$12;exports.Dropdown=e.Dropdown;exports.EmptyState=e._sfc_main$13;exports.Error=e._sfc_main$2;exports.Feed=e._sfc_main$14;exports.Field=e.Field;exports.FieldBig=e._sfc_main$15;exports.FieldPhone=e.FieldPhone;exports.FieldTags=e.FieldTags;exports.Loader=e.Loader;exports.LocationMarker=e.LocationMarker;exports.Magnifier=e.Magnifier;exports.Map=e.Map;exports.Marquee=e._sfc_main$19;exports.Popup=e._sfc_main$3;exports.Radio=e._sfc_main$4;exports.Select=e.Select;exports.SelectMulti=e.SelectMulti;exports.Shader=e.Shader;exports.Sidebar=e._sfc_main$16;exports.Slider=e._sfc_main$17;exports.Spoiler=e._sfc_main$5;exports.Status=e._sfc_main$18;exports.Tab=e._sfc_main$6;exports.Text=e._sfc_main$7;exports.Tooltip=e.Tooltip;exports.Upload=e.Upload;exports.UploadImage=e._sfc_main$8;exports.UploadImageMultiple=e._sfc_main$9;exports.default=e.main;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./main-DL3vRQCi.js");exports.Address=e.Address;exports.Breadcrumbs=e._sfc_main$10;exports.Button=e._sfc_main;exports.Checkbox=e._sfc_main$1;exports.Chips=e.Chips;exports.Countdown=e._sfc_main$11;exports.DatePicker=e._sfc_main$12;exports.Dropdown=e.Dropdown;exports.EmptyState=e._sfc_main$13;exports.Error=e._sfc_main$2;exports.Feed=e._sfc_main$14;exports.Field=e.Field;exports.FieldBig=e._sfc_main$15;exports.FieldPhone=e.FieldPhone;exports.FieldTags=e.FieldTags;exports.Loader=e.Loader;exports.LocationMarker=e.LocationMarker;exports.Magnifier=e.Magnifier;exports.Map=e.Map;exports.Marquee=e._sfc_main$19;exports.Popup=e._sfc_main$3;exports.Radio=e._sfc_main$4;exports.Select=e.Select;exports.SelectMulti=e.SelectMulti;exports.Shader=e.Shader;exports.Sidebar=e._sfc_main$16;exports.Slider=e._sfc_main$17;exports.Spoiler=e._sfc_main$5;exports.Status=e._sfc_main$18;exports.Tab=e._sfc_main$6;exports.Text=e._sfc_main$7;exports.Tooltip=e.Tooltip;exports.Upload=e.Upload;exports.UploadImage=e._sfc_main$8;exports.UploadImageMultiple=e._sfc_main$9;exports.default=e.main;
@@ -1,4 +1,4 @@
1
- import { A as e, l as o, _ as d, a as r, C as t, n as i, o as l, D as p, p as u, b as S, q as n, F as c, r as M, c as g, s as m, t as F, L as b, u as h, M as T, z as f, d as k, e as x, S as C, f as U, v as w, w as B, x as D, g as L, y as P, h as q, i as y, T as A, U as E, j as I, k as j, m as v } from "./main-8APITHuW.mjs";
1
+ import { A as e, l as o, _ as d, a as r, C as t, n as i, o as l, D as p, p as u, b as S, q as n, F as c, r as M, c as g, s as m, t as F, L as b, u as h, M as T, z as f, d as k, e as x, S as C, f as U, v as w, w as B, x as D, g as L, y as P, h as q, i as y, T as A, U as E, j as I, k as j, m as v } from "./main-Ds3Z5x5d.mjs";
2
2
  export {
3
3
  e as Address,
4
4
  o as Breadcrumbs,
@@ -0,0 +1,178 @@
1
+ import require$$0 from "mongoose";
2
+ const ObjectId = require$$0.Types.ObjectId;
3
+ function getBasicOptions(query) {
4
+ const { _id, url, status, type, owner, creator } = query;
5
+ const conditions = [];
6
+ if (_id) {
7
+ conditions.push({ _id: new ObjectId(_id) });
8
+ }
9
+ if (url) {
10
+ conditions.push({ url });
11
+ }
12
+ if (status) {
13
+ conditions.push({ status });
14
+ }
15
+ if (type) {
16
+ conditions.push({ type });
17
+ }
18
+ if (owner) {
19
+ conditions.push({ "owner.target": new ObjectId(owner) });
20
+ }
21
+ if (creator) {
22
+ conditions.push({ "creator.target": new ObjectId(creator) });
23
+ }
24
+ if (conditions.length > 0) {
25
+ return [{ $match: { $and: conditions } }];
26
+ } else {
27
+ return [];
28
+ }
29
+ }
30
+ function getFilterDate(start, end) {
31
+ let filter = {};
32
+ if (start !== null) {
33
+ filter.$gte = new Date(start);
34
+ }
35
+ if (end !== null) {
36
+ filter.$lte = new Date(end);
37
+ }
38
+ if (start === "null" && end === "null") {
39
+ return [];
40
+ } else {
41
+ return [{ $match: { createdAt: filter } }];
42
+ }
43
+ }
44
+ function getTagsOptions(tags) {
45
+ if (tags) {
46
+ const tagsArray = Array.isArray(tags) ? tags : [tags];
47
+ return [{ $match: { tags: { $in: tagsArray } } }];
48
+ } else {
49
+ return [];
50
+ }
51
+ }
52
+ function getSortingOptions(param = "createdAt", order = "desc") {
53
+ let sort = {
54
+ [param]: order === "desc" ? -1 : 1,
55
+ "_id": 1
56
+ };
57
+ return [{ $sort: sort }];
58
+ }
59
+ function getPaginationOptions(skip, limit) {
60
+ let pagination = {
61
+ skip: parseInt(skip) || 0,
62
+ limit: parseInt(limit) || 20
63
+ };
64
+ return [{ $skip: pagination.skip }, { $limit: pagination.limit }];
65
+ }
66
+ function getCreatorUserLookupStage() {
67
+ return {
68
+ $lookup: {
69
+ from: "users",
70
+ localField: "creator.target",
71
+ foreignField: "_id",
72
+ as: "creatorUser"
73
+ }
74
+ };
75
+ }
76
+ function getCreatorOrganizationLookupStage() {
77
+ return {
78
+ $lookup: {
79
+ from: "organizations",
80
+ localField: "creator.target",
81
+ foreignField: "_id",
82
+ as: "creatorOrganization"
83
+ }
84
+ };
85
+ }
86
+ function getCreatorCustomerLookupStage() {
87
+ return {
88
+ $lookup: {
89
+ from: "customers",
90
+ localField: "creator.target",
91
+ foreignField: "_id",
92
+ as: "creatorCustomer"
93
+ }
94
+ };
95
+ }
96
+ function getOwnerUserLookupStage() {
97
+ return {
98
+ $lookup: {
99
+ from: "users",
100
+ localField: "owner.target",
101
+ foreignField: "_id",
102
+ as: "ownerUser"
103
+ }
104
+ };
105
+ }
106
+ function getOwnerOrganizationLookupStage() {
107
+ return {
108
+ $lookup: {
109
+ from: "organizations",
110
+ localField: "owner.target",
111
+ foreignField: "_id",
112
+ as: "ownerOrganization"
113
+ }
114
+ };
115
+ }
116
+ function getAddFieldsCreatorOwnerStage() {
117
+ return {
118
+ $addFields: {
119
+ "creator.target": {
120
+ $switch: {
121
+ branches: [
122
+ {
123
+ case: { $eq: [{ $toLower: "$creator.type" }, "user"] },
124
+ then: { $arrayElemAt: ["$creatorUser", 0] }
125
+ },
126
+ {
127
+ case: { $eq: [{ $toLower: "$creator.type" }, "organization"] },
128
+ then: { $arrayElemAt: ["$creatorOrganization", 0] }
129
+ },
130
+ {
131
+ case: { $eq: [{ $toLower: "$creator.type" }, "customer"] },
132
+ then: { $arrayElemAt: ["$creatorCustomer", 0] }
133
+ }
134
+ ],
135
+ default: "Unknown type"
136
+ // или любое другое значение по умолчанию, которое вы хотите использовать
137
+ }
138
+ },
139
+ "owner.target": {
140
+ $cond: [
141
+ { $eq: ["$owner.type", "user"] },
142
+ { $arrayElemAt: ["$ownerUser", 0] },
143
+ { $arrayElemAt: ["$ownerOrganization", 0] }
144
+ ]
145
+ }
146
+ }
147
+ };
148
+ }
149
+ function removeTempPropeties() {
150
+ return {
151
+ $project: {
152
+ creatorOrganization: 0,
153
+ creatorUser: 0,
154
+ ownerOrganization: 0,
155
+ ownerUser: 0,
156
+ creatorCustomer: 0,
157
+ ownerCustomer: 0
158
+ }
159
+ };
160
+ }
161
+ var queryProcessor = {
162
+ getBasicOptions,
163
+ getSortingOptions,
164
+ getPaginationOptions,
165
+ getTagsOptions,
166
+ getFilterDate,
167
+ // Creator and Owner
168
+ getCreatorUserLookupStage,
169
+ getCreatorOrganizationLookupStage,
170
+ getCreatorCustomerLookupStage,
171
+ getOwnerUserLookupStage,
172
+ getOwnerOrganizationLookupStage,
173
+ getAddFieldsCreatorOwnerStage,
174
+ removeTempPropeties
175
+ };
176
+ export {
177
+ queryProcessor as q
178
+ };
@@ -0,0 +1,177 @@
1
+ "use strict";
2
+ const require$$0 = require("mongoose");
3
+ const ObjectId = require$$0.Types.ObjectId;
4
+ function getBasicOptions(query) {
5
+ const { _id, url, status, type, owner, creator } = query;
6
+ const conditions = [];
7
+ if (_id) {
8
+ conditions.push({ _id: new ObjectId(_id) });
9
+ }
10
+ if (url) {
11
+ conditions.push({ url });
12
+ }
13
+ if (status) {
14
+ conditions.push({ status });
15
+ }
16
+ if (type) {
17
+ conditions.push({ type });
18
+ }
19
+ if (owner) {
20
+ conditions.push({ "owner.target": new ObjectId(owner) });
21
+ }
22
+ if (creator) {
23
+ conditions.push({ "creator.target": new ObjectId(creator) });
24
+ }
25
+ if (conditions.length > 0) {
26
+ return [{ $match: { $and: conditions } }];
27
+ } else {
28
+ return [];
29
+ }
30
+ }
31
+ function getFilterDate(start, end) {
32
+ let filter = {};
33
+ if (start !== null) {
34
+ filter.$gte = new Date(start);
35
+ }
36
+ if (end !== null) {
37
+ filter.$lte = new Date(end);
38
+ }
39
+ if (start === "null" && end === "null") {
40
+ return [];
41
+ } else {
42
+ return [{ $match: { createdAt: filter } }];
43
+ }
44
+ }
45
+ function getTagsOptions(tags) {
46
+ if (tags) {
47
+ const tagsArray = Array.isArray(tags) ? tags : [tags];
48
+ return [{ $match: { tags: { $in: tagsArray } } }];
49
+ } else {
50
+ return [];
51
+ }
52
+ }
53
+ function getSortingOptions(param = "createdAt", order = "desc") {
54
+ let sort = {
55
+ [param]: order === "desc" ? -1 : 1,
56
+ "_id": 1
57
+ };
58
+ return [{ $sort: sort }];
59
+ }
60
+ function getPaginationOptions(skip, limit) {
61
+ let pagination = {
62
+ skip: parseInt(skip) || 0,
63
+ limit: parseInt(limit) || 20
64
+ };
65
+ return [{ $skip: pagination.skip }, { $limit: pagination.limit }];
66
+ }
67
+ function getCreatorUserLookupStage() {
68
+ return {
69
+ $lookup: {
70
+ from: "users",
71
+ localField: "creator.target",
72
+ foreignField: "_id",
73
+ as: "creatorUser"
74
+ }
75
+ };
76
+ }
77
+ function getCreatorOrganizationLookupStage() {
78
+ return {
79
+ $lookup: {
80
+ from: "organizations",
81
+ localField: "creator.target",
82
+ foreignField: "_id",
83
+ as: "creatorOrganization"
84
+ }
85
+ };
86
+ }
87
+ function getCreatorCustomerLookupStage() {
88
+ return {
89
+ $lookup: {
90
+ from: "customers",
91
+ localField: "creator.target",
92
+ foreignField: "_id",
93
+ as: "creatorCustomer"
94
+ }
95
+ };
96
+ }
97
+ function getOwnerUserLookupStage() {
98
+ return {
99
+ $lookup: {
100
+ from: "users",
101
+ localField: "owner.target",
102
+ foreignField: "_id",
103
+ as: "ownerUser"
104
+ }
105
+ };
106
+ }
107
+ function getOwnerOrganizationLookupStage() {
108
+ return {
109
+ $lookup: {
110
+ from: "organizations",
111
+ localField: "owner.target",
112
+ foreignField: "_id",
113
+ as: "ownerOrganization"
114
+ }
115
+ };
116
+ }
117
+ function getAddFieldsCreatorOwnerStage() {
118
+ return {
119
+ $addFields: {
120
+ "creator.target": {
121
+ $switch: {
122
+ branches: [
123
+ {
124
+ case: { $eq: [{ $toLower: "$creator.type" }, "user"] },
125
+ then: { $arrayElemAt: ["$creatorUser", 0] }
126
+ },
127
+ {
128
+ case: { $eq: [{ $toLower: "$creator.type" }, "organization"] },
129
+ then: { $arrayElemAt: ["$creatorOrganization", 0] }
130
+ },
131
+ {
132
+ case: { $eq: [{ $toLower: "$creator.type" }, "customer"] },
133
+ then: { $arrayElemAt: ["$creatorCustomer", 0] }
134
+ }
135
+ ],
136
+ default: "Unknown type"
137
+ // или любое другое значение по умолчанию, которое вы хотите использовать
138
+ }
139
+ },
140
+ "owner.target": {
141
+ $cond: [
142
+ { $eq: ["$owner.type", "user"] },
143
+ { $arrayElemAt: ["$ownerUser", 0] },
144
+ { $arrayElemAt: ["$ownerOrganization", 0] }
145
+ ]
146
+ }
147
+ }
148
+ };
149
+ }
150
+ function removeTempPropeties() {
151
+ return {
152
+ $project: {
153
+ creatorOrganization: 0,
154
+ creatorUser: 0,
155
+ ownerOrganization: 0,
156
+ ownerUser: 0,
157
+ creatorCustomer: 0,
158
+ ownerCustomer: 0
159
+ }
160
+ };
161
+ }
162
+ var queryProcessor = {
163
+ getBasicOptions,
164
+ getSortingOptions,
165
+ getPaginationOptions,
166
+ getTagsOptions,
167
+ getFilterDate,
168
+ // Creator and Owner
169
+ getCreatorUserLookupStage,
170
+ getCreatorOrganizationLookupStage,
171
+ getCreatorCustomerLookupStage,
172
+ getOwnerUserLookupStage,
173
+ getOwnerOrganizationLookupStage,
174
+ getAddFieldsCreatorOwnerStage,
175
+ removeTempPropeties
176
+ };
177
+ exports.queryProcessor = queryProcessor;