@ozdao/prometheus-framework 0.2.253 → 0.2.254

Sign up to get free protection for your applications and to get access to all the features.
Files changed (33) hide show
  1. package/dist/chats.server.js +110 -0
  2. package/dist/chats.server.mjs +111 -0
  3. package/dist/files.server.js +12 -3
  4. package/dist/files.server.mjs +12 -3
  5. package/dist/prometheus-framework/src/modules/chats/chats.client.cjs +31 -0
  6. package/dist/prometheus-framework/src/modules/chats/chats.client.cjs.map +1 -0
  7. package/dist/prometheus-framework/src/modules/chats/chats.client.js +31 -0
  8. package/dist/prometheus-framework/src/modules/chats/chats.client.js.map +1 -0
  9. package/dist/prometheus-framework/src/modules/pages/pages.client.cjs +330 -330
  10. package/dist/prometheus-framework/src/modules/pages/pages.client.js +330 -330
  11. package/dist/prometheus-framework/src/modules/products/components/layouts/Marketplace.vue.cjs +3 -2
  12. package/dist/prometheus-framework/src/modules/products/components/layouts/Marketplace.vue.cjs.map +1 -1
  13. package/dist/prometheus-framework/src/modules/products/components/layouts/Marketplace.vue.js +4 -3
  14. package/dist/prometheus-framework/src/modules/products/components/layouts/Marketplace.vue.js.map +1 -1
  15. package/dist/prometheus-framework/src/modules/products/components/pages/Catalog.vue.cjs +7 -5
  16. package/dist/prometheus-framework/src/modules/products/components/pages/Catalog.vue.cjs.map +1 -1
  17. package/dist/prometheus-framework/src/modules/products/components/pages/Catalog.vue.js +7 -5
  18. package/dist/prometheus-framework/src/modules/products/components/pages/Catalog.vue.js.map +1 -1
  19. package/dist/prometheus-framework/src/modules/reports/reports.client.cjs +21 -2
  20. package/dist/prometheus-framework/src/modules/reports/reports.client.cjs.map +1 -1
  21. package/dist/prometheus-framework/src/modules/reports/reports.client.js +20 -1
  22. package/dist/prometheus-framework/src/modules/reports/reports.client.js.map +1 -1
  23. package/dist/reports.server.js +21 -8
  24. package/dist/reports.server.mjs +21 -8
  25. package/package.json +9 -1
  26. package/src/modules/chats/chats.client.js +48 -0
  27. package/src/modules/chats/chats.server.js +32 -0
  28. package/src/modules/files/files.server.js +17 -7
  29. package/src/modules/products/components/layouts/Marketplace.vue +1 -0
  30. package/src/modules/products/components/pages/Catalog.vue +5 -3
  31. package/src/modules/reports/models/report.model.js +4 -4
  32. package/src/modules/reports/reports.client.js +35 -14
  33. package/src/modules/reports/reports.server.js +27 -8
@@ -5,6 +5,7 @@ const vueRouter = require("vue-router");
5
5
  const vueI18n = require("vue-i18n");
6
6
  const BlockFilter = require("../../../globals/views/components/blocks/BlockFilter.vue.cjs");
7
7
  const marketplace = require("../../store/marketplace.cjs");
8
+ const globals = require("../../../globals/views/store/globals.cjs");
8
9
  const categories = require("../../store/categories.cjs");
9
10
  const _hoisted_1 = {
10
11
  style: { "min-height": "100%" },
@@ -126,7 +127,7 @@ const _sfc_main = {
126
127
  localPosition.value.city || localPosition.value.state || localPosition.value.country ? (vue.openBlock(), vue.createElementBlock("span", {
127
128
  key: 0,
128
129
  onClick: _cache[0] || (_cache[0] = (a) => {
129
- _ctx.globals.state.isOpenLocationPopup = true;
130
+ globals.state.isOpenLocationPopup = true;
130
131
  }),
131
132
  class: "t-main t-semi cursor-pointer"
132
133
  }, [
@@ -142,7 +143,7 @@ const _sfc_main = {
142
143
  ])) : (vue.openBlock(), vue.createElementBlock("span", {
143
144
  key: 1,
144
145
  onClick: _cache[1] || (_cache[1] = (a) => {
145
- _ctx.globals.state.isOpenLocationPopup = true;
146
+ globals.state.isOpenLocationPopup = true;
146
147
  }),
147
148
  class: "h2 pd-l-small pd-r-small pd-t-micro pd-b-micro d-inline-block t-semi radius-extra bg-main t-black cursor-pointer"
148
149
  }, " The World "))
@@ -1 +1 @@
1
- {"version":3,"file":"Marketplace.vue.cjs","sources":["../../../../../../../src/modules/products/components/layouts/Marketplace.vue"],"sourcesContent":["<template>\n\t<div style=\"min-height: 100%;\" class=\"h-min-100 pd-thin\">\n\t\t<header class=\"pd-semi radius-big bg-light mn-b-small\">\n \t<h2 class=\"\">\n \t\t<span class=\"\">Weed in </span>\n\n \t\t<span \n \t\t\tv-if=\"localPosition.city || localPosition.state || localPosition.country\"\n \t\t\t@click=\"a => { globals.state.isOpenLocationPopup = true }\" \n \t\t\tclass=\"t-main t-semi cursor-pointer \"\n \t\t>\n \t\t\t\t<template v-if=\"localPosition.city\">{{localPosition.city}}, </template>\n \t\t\t\t<template v-if=\"localPosition.state\">{{localPosition.state}}, </template>\n \t\t\t\t<template v-if=\"localPosition.country\">{{localPosition.country}}</template>\n \t\t</span>\n\n \t\t<span v-else @click=\"a => { globals.state.isOpenLocationPopup = true }\" class=\"h2 pd-l-small pd-r-small pd-t-micro pd-b-micro d-inline-block t-semi radius-extra bg-main t-black cursor-pointer\">\n\t\t\t\t\t\tThe World\n \t\t</span>\n \t</h2>\n\t\t</header>\n\n\t\t<div class=\"gap-thin \tcols-2-1_3\">\n\t\t\t<div class=\"desktop-only radius-big o-hidden\">\n\t <BlockFilter\n v-model:filter=\"marketplace.state.filter\"\n :options=\"marketplace.state.filter.options\"\n class=\"h-100 w-100 pd-small bg-light\"\n />\n </div>\n\t\t\t<!-- Catalog wrapper -->\n\t\t\t<div class=\"rows-1 gap-thin\">\n\t\t\t\t<router-view v-slot=\"{ Component, route }\">\n\t\t\t\t\t<component ref=\"page\" :key=\"route\" :localPosition=\"localPosition\" :is=\"Component\" />\n\t\t\t\t</router-view>\n\t\t\t</div>\n\t\t</div>\n\t</div>\n</template>\n\n\n<script setup=\"props\">\n\t// Import libs\n\timport { computed, onMounted, watch, ref } from 'vue'\n\timport { useRoute, useRouter,onBeforeRouteLeave } from 'vue-router'\n\timport { useI18n } from 'vue-i18n'\n\n\timport BlockFilter from '@pf/src/modules/globals/views/components/blocks/BlockFilter.vue'\n\n\timport * as marketplace from '@pf/src/modules/products/store/marketplace';\n import * as categories from '@pf/src/modules/products/store/categories';\n\n\t// Accessing router and store\n\tconst route = useRoute()\n\tconst router = useRouter()\n\n\tconst localPosition = ref({\n\t\tcity: null,\n\t\tstate: null,\n\t\tcountry: null\n\t});\n\n\tconst desktopFilters = ref(null)\n\n\tfunction denormalizeUrlParam(param) {\n\t return param\n\t .replace(/-/g, ' ') // Замена дефисов на пробелы\n\t .replace(/\\b\\w/g, l => l.toUpperCase()); // Преобразование первой буквы каждого слова в заглавную\n\t}\n\n\tfunction normalizeUrlParam(param) {\n\t return param\n\t .toLowerCase()\n\t .replace(/ /g, '-')\n\t .replace(/[^a-z0-9-]/g, '');\n\t}\n\n\tif (route.params) {\n // Загружаем новые значения из параметров маршрута в состояние\n let newState = {\n country: denormalizeUrlParam(route.params.country),\n state: denormalizeUrlParam(route.params.state),\n city: denormalizeUrlParam(route.params.city),\n };\n\n\t // Обновляем глобальное состояние\n\t localPosition.value = newState;\n\t}\n\n\tif (route.query) {\n\t \tconst query = route.query;\n\n\t\tmarketplace.state.filter.selected.categories = query.categories ? query.categories.split(',') : [];\n\t\tmarketplace.state.filter.selected.prices = query.prices ? query.prices.split(',') : [];\n\t\tmarketplace.state.filter.selected.delivery = query.delivery ? query.delivery.split(',') : [];\n\t}\n\n\tif (route.query.sortParam) marketplace.state.sort.param = route.query.sortParam\n\tif (route.query.sortOrder) marketplace.state.sort.order = route.query.sortOrder\n\n\tonMounted(async () => {\n\t let options = {\n status: 'published'\n }\n\n let categoriesFilter = await categories.actions.fetchCategories(options);\n\n categoriesFilter = categoriesFilter.map(category => ({\n value: category.url,\n label: category.name\n }));\n\n const index = marketplace.state.filter.options.findIndex(option => option.value === 'categories');\n\n const categoryOption = {\n title: 'Categories',\n value: 'categories',\n options: categoriesFilter\n };\n\n if (index !== -1) {\n marketplace.state.filter.options[index] = categoryOption;\n } else {\n marketplace.state.filter.options.unshift(categoryOption);\n }\n\t})\n\n\twatch(() => marketplace.state.sort, (newSortValue, oldSortValue) => {\n\t\tlet query = { ...route.query}\n\t\t\n\t\tquery.sortParam = newSortValue.param\n\t\tquery.sortOrder = newSortValue.order\n\t \n\t // replace the current route\n\t router.replace({ query });\n\t}, { deep: true });\n\n\n\twatch(() => marketplace.state.filter.selected, (newFilterValue, oldFilterValue) => {\n\t // Переводим фильтр в формат query\n\t const query = { ...route.query };\n\n\t // Удаляем старые значения фильтра из query\n\t Object.keys(oldFilterValue).forEach(key => {\n\t if (query[key]) {\n\t delete query[key];\n\t }\n\t });\n\n\t // Добавляем новые значения фильтра в query\n\t const newQueryValues = Object.fromEntries(\n\t Object.entries(newFilterValue)\n\t .filter(([key, value]) => Array.isArray(value) && value.length > 0)\n\t .map(([key, value]) => [key, value.join(',')])\n\t );\n\n\t delete query.options;\n\t Object.assign(query, newQueryValues);\n\n\t // Обновляем маршрут с новым query\n\t router.replace({ query });\n\t}, { deep: true })\n\n\twatch(() => globals.state.position, (newPosition) => {\n\t // get the current route\n\t const currentRoute = { ...router.currentRoute.value };\n\t \n\t // create new parameters based on globals state position\n\t let newParams = {\n\t country: normalizeUrlParam(newPosition.country),\n\t state: normalizeUrlParam(newPosition.state),\n\t city: normalizeUrlParam(newPosition.city),\n\t };\n\t \n\t // update route params\n\t currentRoute.params = newParams;\n\t \n\t // replace the current route\n\t router.replace(currentRoute);\n\t}, { deep: true });\n\n const text = {\n locale: 'en',\n messages: {\n en: {\n\t \tmeta: {\n title: \"Marketplace – Shop Our Wide Selection of Quality Weed for Delivery\",\n description: \"Browse our marketplace of top-grade weed strains and choose from a variety of delivery options. Order now and have your favorite strains delivered straight to your door. Safe, fast, and reliable.\",\n }\n },\n ru: {\n\t meta: {\n title: \"Маркетплейс – Выбирайте из нашего ассортимента качественной травки для доставки\",\n description: \"Маркетплейс – Изучите наши продукты высокого качества и выбирайте из различных вариантов доставки. Закажите сейчас и получите свои любимые сорта на дом. Безопасно, быстро и надежно.\",\n }\n }\n }\n }\n\n \tconst { t } = useI18n(text)\n</script>\n\n<style lang=\"scss\">\n\n\n</style>\n"],"names":["useRoute","useRouter","ref","marketplace.state","onMounted","categories.actions","watch","useI18n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAqDC,UAAM,QAAQA,UAAAA,SAAU;AACxB,UAAM,SAASC,UAAAA,UAAW;AAE1B,UAAM,gBAAgBC,IAA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,QAAQ,MAAM,UAAU,CAAC,gBAAgB;AAEnD,YAAM,eAAe,EAAE,GAAG,OAAO,aAAa,MAAK;AAGnD,UAAI,YAAY;AAAA,QACd,SAAS,kBAAkB,YAAY,OAAO;AAAA,QAC9C,OAAO,kBAAkB,YAAY,KAAK;AAAA,QAC1C,MAAM,kBAAkB,YAAY,IAAI;AAAA,MAC7C;AAGG,mBAAa,SAAS;AAGtB,aAAO,QAAQ,YAAY;AAAA,IAC9B,GAAI,EAAE,MAAM,KAAI,CAAE;AAEhB,UAAM,OAAO;AAAA,MACX,QAAQ;AAAA,MACR,UAAU;AAAA,QACR,IAAI;AAAA,UACH,MAAM;AAAA,YACH,OAAO;AAAA,YACP,aAAa;AAAA,UACd;AAAA,QACF;AAAA,QACD,IAAI;AAAA,UACH,MAAM;AAAA,YACH,OAAO;AAAA,YACP,aAAa;AAAA,UACd;AAAA,QACF;AAAA,MACF;AAAA,IACF;AAEaC,YAAAA,QAAQ,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"Marketplace.vue.cjs","sources":["../../../../../../../src/modules/products/components/layouts/Marketplace.vue"],"sourcesContent":["<template>\n\t<div style=\"min-height: 100%;\" class=\"h-min-100 pd-thin\">\n\t\t<header class=\"pd-semi radius-big bg-light mn-b-small\">\n \t<h2 class=\"\">\n \t\t<span class=\"\">Weed in </span>\n\n \t\t<span \n \t\t\tv-if=\"localPosition.city || localPosition.state || localPosition.country\"\n \t\t\t@click=\"a => { globals.state.isOpenLocationPopup = true }\" \n \t\t\tclass=\"t-main t-semi cursor-pointer \"\n \t\t>\n \t\t\t\t<template v-if=\"localPosition.city\">{{localPosition.city}}, </template>\n \t\t\t\t<template v-if=\"localPosition.state\">{{localPosition.state}}, </template>\n \t\t\t\t<template v-if=\"localPosition.country\">{{localPosition.country}}</template>\n \t\t</span>\n\n \t\t<span v-else @click=\"a => { globals.state.isOpenLocationPopup = true }\" class=\"h2 pd-l-small pd-r-small pd-t-micro pd-b-micro d-inline-block t-semi radius-extra bg-main t-black cursor-pointer\">\n\t\t\t\t\t\tThe World\n \t\t</span>\n \t</h2>\n\t\t</header>\n\n\t\t<div class=\"gap-thin \tcols-2-1_3\">\n\t\t\t<div class=\"desktop-only radius-big o-hidden\">\n\t <BlockFilter\n v-model:filter=\"marketplace.state.filter\"\n :options=\"marketplace.state.filter.options\"\n class=\"h-100 w-100 pd-small bg-light\"\n />\n </div>\n\t\t\t<!-- Catalog wrapper -->\n\t\t\t<div class=\"rows-1 gap-thin\">\n\t\t\t\t<router-view v-slot=\"{ Component, route }\">\n\t\t\t\t\t<component ref=\"page\" :key=\"route\" :localPosition=\"localPosition\" :is=\"Component\" />\n\t\t\t\t</router-view>\n\t\t\t</div>\n\t\t</div>\n\t</div>\n</template>\n\n\n<script setup=\"props\">\n\t// Import libs\n\timport { computed, onMounted, watch, ref } from 'vue'\n\timport { useRoute, useRouter,onBeforeRouteLeave } from 'vue-router'\n\timport { useI18n } from 'vue-i18n'\n\n\timport BlockFilter from '@pf/src/modules/globals/views/components/blocks/BlockFilter.vue'\n\n\timport * as marketplace from '@pf/src/modules/products/store/marketplace';\n\timport * as globals from '@pf/src/modules/globals/views/store/globals'\n import * as categories from '@pf/src/modules/products/store/categories';\n\n\t// Accessing router and store\n\tconst route = useRoute()\n\tconst router = useRouter()\n\n\tconst localPosition = ref({\n\t\tcity: null,\n\t\tstate: null,\n\t\tcountry: null\n\t});\n\n\tconst desktopFilters = ref(null)\n\n\tfunction denormalizeUrlParam(param) {\n\t return param\n\t .replace(/-/g, ' ') // Замена дефисов на пробелы\n\t .replace(/\\b\\w/g, l => l.toUpperCase()); // Преобразование первой буквы каждого слова в заглавную\n\t}\n\n\tfunction normalizeUrlParam(param) {\n\t return param\n\t .toLowerCase()\n\t .replace(/ /g, '-')\n\t .replace(/[^a-z0-9-]/g, '');\n\t}\n\n\tif (route.params) {\n // Загружаем новые значения из параметров маршрута в состояние\n let newState = {\n country: denormalizeUrlParam(route.params.country),\n state: denormalizeUrlParam(route.params.state),\n city: denormalizeUrlParam(route.params.city),\n };\n\n\t // Обновляем глобальное состояние\n\t localPosition.value = newState;\n\t}\n\n\tif (route.query) {\n\t \tconst query = route.query;\n\n\t\tmarketplace.state.filter.selected.categories = query.categories ? query.categories.split(',') : [];\n\t\tmarketplace.state.filter.selected.prices = query.prices ? query.prices.split(',') : [];\n\t\tmarketplace.state.filter.selected.delivery = query.delivery ? query.delivery.split(',') : [];\n\t}\n\n\tif (route.query.sortParam) marketplace.state.sort.param = route.query.sortParam\n\tif (route.query.sortOrder) marketplace.state.sort.order = route.query.sortOrder\n\n\tonMounted(async () => {\n\t let options = {\n status: 'published'\n }\n\n let categoriesFilter = await categories.actions.fetchCategories(options);\n\n categoriesFilter = categoriesFilter.map(category => ({\n value: category.url,\n label: category.name\n }));\n\n const index = marketplace.state.filter.options.findIndex(option => option.value === 'categories');\n\n const categoryOption = {\n title: 'Categories',\n value: 'categories',\n options: categoriesFilter\n };\n\n if (index !== -1) {\n marketplace.state.filter.options[index] = categoryOption;\n } else {\n marketplace.state.filter.options.unshift(categoryOption);\n }\n\t})\n\n\twatch(() => marketplace.state.sort, (newSortValue, oldSortValue) => {\n\t\tlet query = { ...route.query}\n\t\t\n\t\tquery.sortParam = newSortValue.param\n\t\tquery.sortOrder = newSortValue.order\n\t \n\t // replace the current route\n\t router.replace({ query });\n\t}, { deep: true });\n\n\n\twatch(() => marketplace.state.filter.selected, (newFilterValue, oldFilterValue) => {\n\t // Переводим фильтр в формат query\n\t const query = { ...route.query };\n\n\t // Удаляем старые значения фильтра из query\n\t Object.keys(oldFilterValue).forEach(key => {\n\t if (query[key]) {\n\t delete query[key];\n\t }\n\t });\n\n\t // Добавляем новые значения фильтра в query\n\t const newQueryValues = Object.fromEntries(\n\t Object.entries(newFilterValue)\n\t .filter(([key, value]) => Array.isArray(value) && value.length > 0)\n\t .map(([key, value]) => [key, value.join(',')])\n\t );\n\n\t delete query.options;\n\t Object.assign(query, newQueryValues);\n\n\t // Обновляем маршрут с новым query\n\t router.replace({ query });\n\t}, { deep: true })\n\n\twatch(() => globals.state.position, (newPosition) => {\n\t // get the current route\n\t const currentRoute = { ...router.currentRoute.value };\n\t \n\t // create new parameters based on globals state position\n\t let newParams = {\n\t country: normalizeUrlParam(newPosition.country),\n\t state: normalizeUrlParam(newPosition.state),\n\t city: normalizeUrlParam(newPosition.city),\n\t };\n\t \n\t // update route params\n\t currentRoute.params = newParams;\n\t \n\t // replace the current route\n\t router.replace(currentRoute);\n\t}, { deep: true });\n\n const text = {\n locale: 'en',\n messages: {\n en: {\n\t \tmeta: {\n title: \"Marketplace – Shop Our Wide Selection of Quality Weed for Delivery\",\n description: \"Browse our marketplace of top-grade weed strains and choose from a variety of delivery options. Order now and have your favorite strains delivered straight to your door. Safe, fast, and reliable.\",\n }\n },\n ru: {\n\t meta: {\n title: \"Маркетплейс – Выбирайте из нашего ассортимента качественной травки для доставки\",\n description: \"Маркетплейс – Изучите наши продукты высокого качества и выбирайте из различных вариантов доставки. Закажите сейчас и получите свои любимые сорта на дом. Безопасно, быстро и надежно.\",\n }\n }\n }\n }\n\n \tconst { t } = useI18n(text)\n</script>\n\n<style lang=\"scss\">\n\n\n</style>\n"],"names":["useRoute","useRouter","ref","marketplace.state","onMounted","categories.actions","watch","globals.state","useI18n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAsDC,UAAM,QAAQA,UAAAA,SAAU;AACxB,UAAM,SAASC,UAAAA,UAAW;AAE1B,UAAM,gBAAgBC,IAAAA,IAAI;AAAA,MACzB,MAAM;AAAA,MACN,OAAO;AAAA,MACP,SAAS;AAAA,IACX,CAAE;AAEsBA,QAAAA,IAAI,IAAI;AAE/B,aAAS,oBAAoB,OAAO;AAClC,aAAO,MACJ,QAAQ,MAAM,GAAG,EACjB,QAAQ,SAAS,OAAK,EAAE,YAAa,CAAA;AAAA,IACzC;AAED,aAAS,kBAAkB,OAAO;A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;AAGtB,aAAO,QAAQ,YAAY;AAAA,IAC9B,GAAI,EAAE,MAAM,KAAI,CAAE;AAEhB,UAAM,OAAO;AAAA,MACX,QAAQ;AAAA,MACR,UAAU;AAAA,QACR,IAAI;AAAA,UACH,MAAM;AAAA,YACH,OAAO;AAAA,YACP,aAAa;AAAA,UACd;AAAA,QACF;AAAA,QACD,IAAI;AAAA,UACH,MAAM;AAAA,YACH,OAAO;AAAA,YACP,aAAa;AAAA,UACd;AAAA,QACF;AAAA,MACF;AAAA,IACF;AAEaC,YAAAA,QAAQ,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -3,6 +3,7 @@ import { useRoute, useRouter } from "vue-router";
3
3
  import { useI18n } from "vue-i18n";
4
4
  import _sfc_main$1 from "../../../globals/views/components/blocks/BlockFilter.vue.js";
5
5
  import { state } from "../../store/marketplace.js";
6
+ import { state as state$1 } from "../../../globals/views/store/globals.js";
6
7
  import { actions } from "../../store/categories.js";
7
8
  const _hoisted_1 = {
8
9
  style: { "min-height": "100%" },
@@ -87,7 +88,7 @@ const _sfc_main = {
87
88
  Object.assign(query, newQueryValues);
88
89
  router.replace({ query });
89
90
  }, { deep: true });
90
- watch(() => globals.state.position, (newPosition) => {
91
+ watch(() => state$1.position, (newPosition) => {
91
92
  const currentRoute = { ...router.currentRoute.value };
92
93
  let newParams = {
93
94
  country: normalizeUrlParam(newPosition.country),
@@ -124,7 +125,7 @@ const _sfc_main = {
124
125
  localPosition.value.city || localPosition.value.state || localPosition.value.country ? (openBlock(), createElementBlock("span", {
125
126
  key: 0,
126
127
  onClick: _cache[0] || (_cache[0] = (a) => {
127
- _ctx.globals.state.isOpenLocationPopup = true;
128
+ state$1.isOpenLocationPopup = true;
128
129
  }),
129
130
  class: "t-main t-semi cursor-pointer"
130
131
  }, [
@@ -140,7 +141,7 @@ const _sfc_main = {
140
141
  ])) : (openBlock(), createElementBlock("span", {
141
142
  key: 1,
142
143
  onClick: _cache[1] || (_cache[1] = (a) => {
143
- _ctx.globals.state.isOpenLocationPopup = true;
144
+ state$1.isOpenLocationPopup = true;
144
145
  }),
145
146
  class: "h2 pd-l-small pd-r-small pd-t-micro pd-b-micro d-inline-block t-semi radius-extra bg-main t-black cursor-pointer"
146
147
  }, " The World "))
@@ -1 +1 @@
1
- {"version":3,"file":"Marketplace.vue.js","sources":["../../../../../../../src/modules/products/components/layouts/Marketplace.vue"],"sourcesContent":["<template>\n\t<div style=\"min-height: 100%;\" class=\"h-min-100 pd-thin\">\n\t\t<header class=\"pd-semi radius-big bg-light mn-b-small\">\n \t<h2 class=\"\">\n \t\t<span class=\"\">Weed in </span>\n\n \t\t<span \n \t\t\tv-if=\"localPosition.city || localPosition.state || localPosition.country\"\n \t\t\t@click=\"a => { globals.state.isOpenLocationPopup = true }\" \n \t\t\tclass=\"t-main t-semi cursor-pointer \"\n \t\t>\n \t\t\t\t<template v-if=\"localPosition.city\">{{localPosition.city}}, </template>\n \t\t\t\t<template v-if=\"localPosition.state\">{{localPosition.state}}, </template>\n \t\t\t\t<template v-if=\"localPosition.country\">{{localPosition.country}}</template>\n \t\t</span>\n\n \t\t<span v-else @click=\"a => { globals.state.isOpenLocationPopup = true }\" class=\"h2 pd-l-small pd-r-small pd-t-micro pd-b-micro d-inline-block t-semi radius-extra bg-main t-black cursor-pointer\">\n\t\t\t\t\t\tThe World\n \t\t</span>\n \t</h2>\n\t\t</header>\n\n\t\t<div class=\"gap-thin \tcols-2-1_3\">\n\t\t\t<div class=\"desktop-only radius-big o-hidden\">\n\t <BlockFilter\n v-model:filter=\"marketplace.state.filter\"\n :options=\"marketplace.state.filter.options\"\n class=\"h-100 w-100 pd-small bg-light\"\n />\n </div>\n\t\t\t<!-- Catalog wrapper -->\n\t\t\t<div class=\"rows-1 gap-thin\">\n\t\t\t\t<router-view v-slot=\"{ Component, route }\">\n\t\t\t\t\t<component ref=\"page\" :key=\"route\" :localPosition=\"localPosition\" :is=\"Component\" />\n\t\t\t\t</router-view>\n\t\t\t</div>\n\t\t</div>\n\t</div>\n</template>\n\n\n<script setup=\"props\">\n\t// Import libs\n\timport { computed, onMounted, watch, ref } from 'vue'\n\timport { useRoute, useRouter,onBeforeRouteLeave } from 'vue-router'\n\timport { useI18n } from 'vue-i18n'\n\n\timport BlockFilter from '@pf/src/modules/globals/views/components/blocks/BlockFilter.vue'\n\n\timport * as marketplace from '@pf/src/modules/products/store/marketplace';\n import * as categories from '@pf/src/modules/products/store/categories';\n\n\t// Accessing router and store\n\tconst route = useRoute()\n\tconst router = useRouter()\n\n\tconst localPosition = ref({\n\t\tcity: null,\n\t\tstate: null,\n\t\tcountry: null\n\t});\n\n\tconst desktopFilters = ref(null)\n\n\tfunction denormalizeUrlParam(param) {\n\t return param\n\t .replace(/-/g, ' ') // Замена дефисов на пробелы\n\t .replace(/\\b\\w/g, l => l.toUpperCase()); // Преобразование первой буквы каждого слова в заглавную\n\t}\n\n\tfunction normalizeUrlParam(param) {\n\t return param\n\t .toLowerCase()\n\t .replace(/ /g, '-')\n\t .replace(/[^a-z0-9-]/g, '');\n\t}\n\n\tif (route.params) {\n // Загружаем новые значения из параметров маршрута в состояние\n let newState = {\n country: denormalizeUrlParam(route.params.country),\n state: denormalizeUrlParam(route.params.state),\n city: denormalizeUrlParam(route.params.city),\n };\n\n\t // Обновляем глобальное состояние\n\t localPosition.value = newState;\n\t}\n\n\tif (route.query) {\n\t \tconst query = route.query;\n\n\t\tmarketplace.state.filter.selected.categories = query.categories ? query.categories.split(',') : [];\n\t\tmarketplace.state.filter.selected.prices = query.prices ? query.prices.split(',') : [];\n\t\tmarketplace.state.filter.selected.delivery = query.delivery ? query.delivery.split(',') : [];\n\t}\n\n\tif (route.query.sortParam) marketplace.state.sort.param = route.query.sortParam\n\tif (route.query.sortOrder) marketplace.state.sort.order = route.query.sortOrder\n\n\tonMounted(async () => {\n\t let options = {\n status: 'published'\n }\n\n let categoriesFilter = await categories.actions.fetchCategories(options);\n\n categoriesFilter = categoriesFilter.map(category => ({\n value: category.url,\n label: category.name\n }));\n\n const index = marketplace.state.filter.options.findIndex(option => option.value === 'categories');\n\n const categoryOption = {\n title: 'Categories',\n value: 'categories',\n options: categoriesFilter\n };\n\n if (index !== -1) {\n marketplace.state.filter.options[index] = categoryOption;\n } else {\n marketplace.state.filter.options.unshift(categoryOption);\n }\n\t})\n\n\twatch(() => marketplace.state.sort, (newSortValue, oldSortValue) => {\n\t\tlet query = { ...route.query}\n\t\t\n\t\tquery.sortParam = newSortValue.param\n\t\tquery.sortOrder = newSortValue.order\n\t \n\t // replace the current route\n\t router.replace({ query });\n\t}, { deep: true });\n\n\n\twatch(() => marketplace.state.filter.selected, (newFilterValue, oldFilterValue) => {\n\t // Переводим фильтр в формат query\n\t const query = { ...route.query };\n\n\t // Удаляем старые значения фильтра из query\n\t Object.keys(oldFilterValue).forEach(key => {\n\t if (query[key]) {\n\t delete query[key];\n\t }\n\t });\n\n\t // Добавляем новые значения фильтра в query\n\t const newQueryValues = Object.fromEntries(\n\t Object.entries(newFilterValue)\n\t .filter(([key, value]) => Array.isArray(value) && value.length > 0)\n\t .map(([key, value]) => [key, value.join(',')])\n\t );\n\n\t delete query.options;\n\t Object.assign(query, newQueryValues);\n\n\t // Обновляем маршрут с новым query\n\t router.replace({ query });\n\t}, { deep: true })\n\n\twatch(() => globals.state.position, (newPosition) => {\n\t // get the current route\n\t const currentRoute = { ...router.currentRoute.value };\n\t \n\t // create new parameters based on globals state position\n\t let newParams = {\n\t country: normalizeUrlParam(newPosition.country),\n\t state: normalizeUrlParam(newPosition.state),\n\t city: normalizeUrlParam(newPosition.city),\n\t };\n\t \n\t // update route params\n\t currentRoute.params = newParams;\n\t \n\t // replace the current route\n\t router.replace(currentRoute);\n\t}, { deep: true });\n\n const text = {\n locale: 'en',\n messages: {\n en: {\n\t \tmeta: {\n title: \"Marketplace – Shop Our Wide Selection of Quality Weed for Delivery\",\n description: \"Browse our marketplace of top-grade weed strains and choose from a variety of delivery options. Order now and have your favorite strains delivered straight to your door. Safe, fast, and reliable.\",\n }\n },\n ru: {\n\t meta: {\n title: \"Маркетплейс – Выбирайте из нашего ассортимента качественной травки для доставки\",\n description: \"Маркетплейс – Изучите наши продукты высокого качества и выбирайте из различных вариантов доставки. Закажите сейчас и получите свои любимые сорта на дом. Безопасно, быстро и надежно.\",\n }\n }\n }\n }\n\n \tconst { t } = useI18n(text)\n</script>\n\n<style lang=\"scss\">\n\n\n</style>\n"],"names":["marketplace.state","categories.actions"],"mappings":";;;;;;;;;;;;;;;;;;AAqDC,UAAM,QAAQ,SAAU;AACxB,UAAM,SAAS,UAAW;AAE1B,UAAM,gBAAgB,IAAI;AAAA,MACzB,MAAM;AAAA,MACN,OAAO;AAAA,MACP,SAAS;AAAA,IACX,CAAE;AAEsB,QAAI,IAAI;AAE/B,aAAS,oBAAoB,OAAO;AAClC,aAAO,MACJ,QAAQ,MAAM,GAAG,EACjB,QAAQ,SAAS,OAAK,EAAE,YAAa,CAAA;AAAA,IACzC;AAED,aAAS,kBAAkB,OAAO;AAChC,aAAO,MACJ,YAAa,EACb,QAAQ,MAAM,GAAG,EACjB,QAAQ,eAAe,EAAE;AAAA,IAC7B;AAED,QAAI,MAAM,QAAQ;AAEf,UAAI,WAAW;AAAA,QACb,SAAS,oBAAoB,MAAM,OAAO,OAAO;AAAA,QACjD,OAAO,oBAAoB,MAAM,OAAO,KAAK;AAAA,QAC7C,MAAM,oBAAoB,MAAM,OAAO,IAAI;AAAA,MACjD;AAGG,oBAAc,QAAQ;AAAA,IACvB;AAED,QAAI,MAAM,OAAO;AACf,YAAM,QAAQ,MAAM;AAErBA,YAAkB,OAAO,SAAS,aAAa,MAAM,aAAa,MAAM,WAAW,MAAM,GAAG,IAAI,CAAA;AAChGA,YAAkB,OAAO,SAAS,SAAS,MAAM,SAAS,MAAM,OAAO,MAAM,GAAG,IAAI,CAAA;AACpFA,YAAkB,OAAO,SAAS,WAAW,MAAM,WAAW,MAAM,SAAS,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AAK,KAAK,MAAM,MAAM,QAAQ,KAAK,KAAK,MAAM,SAAS,CAAC,EACjE,IAAI,CAAC,CAAC,KAAK,KAAK,MAAM,CAAC,KAAK,MAAM,KAAK,GAAG,CAAC,CAAC;AAAA,MACpD;AAEG,aAAO,MAAM;AACb,aAAO,OAAO,OAAO,cAAc;AAGnC,aAAO,QAAQ,EAAE,MAAK,CAAE;AAAA,IAC3B,GAAI,EAAE,MAAM,MAAM;AAEjB,UAAM,MAAM,QAAQ,MAAM,UAAU,CAAC,gBAAgB;AAEnD,YAAM,eAAe,EAAE,GAAG,OAAO,aAAa,MAAK;AAGnD,UAAI,YAAY;AAAA,QACd,SAAS,kBAAkB,YAAY,OAAO;AAAA,QAC9C,OAAO,kBAAkB,YAAY,KAAK;AAAA,QAC1C,MAAM,kBAAkB,YAAY,IAAI;AAAA,MAC7C;AAGG,mBAAa,SAAS;AAGtB,aAAO,QAAQ,YAAY;AAAA,IAC9B,GAAI,EAAE,MAAM,KAAI,CAAE;AAEhB,UAAM,OAAO;AAAA,MACX,QAAQ;AAAA,MACR,UAAU;AAAA,QACR,IAAI;AAAA,UACH,MAAM;AAAA,YACH,OAAO;AAAA,YACP,aAAa;AAAA,UACd;AAAA,QACF;AAAA,QACD,IAAI;AAAA,UACH,MAAM;AAAA,YACH,OAAO;AAAA,YACP,aAAa;AAAA,UACd;AAAA,QACF;AAAA,MACF;AAAA,IACF;AAEa,YAAQ,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"Marketplace.vue.js","sources":["../../../../../../../src/modules/products/components/layouts/Marketplace.vue"],"sourcesContent":["<template>\n\t<div style=\"min-height: 100%;\" class=\"h-min-100 pd-thin\">\n\t\t<header class=\"pd-semi radius-big bg-light mn-b-small\">\n \t<h2 class=\"\">\n \t\t<span class=\"\">Weed in </span>\n\n \t\t<span \n \t\t\tv-if=\"localPosition.city || localPosition.state || localPosition.country\"\n \t\t\t@click=\"a => { globals.state.isOpenLocationPopup = true }\" \n \t\t\tclass=\"t-main t-semi cursor-pointer \"\n \t\t>\n \t\t\t\t<template v-if=\"localPosition.city\">{{localPosition.city}}, </template>\n \t\t\t\t<template v-if=\"localPosition.state\">{{localPosition.state}}, </template>\n \t\t\t\t<template v-if=\"localPosition.country\">{{localPosition.country}}</template>\n \t\t</span>\n\n \t\t<span v-else @click=\"a => { globals.state.isOpenLocationPopup = true }\" class=\"h2 pd-l-small pd-r-small pd-t-micro pd-b-micro d-inline-block t-semi radius-extra bg-main t-black cursor-pointer\">\n\t\t\t\t\t\tThe World\n \t\t</span>\n \t</h2>\n\t\t</header>\n\n\t\t<div class=\"gap-thin \tcols-2-1_3\">\n\t\t\t<div class=\"desktop-only radius-big o-hidden\">\n\t <BlockFilter\n v-model:filter=\"marketplace.state.filter\"\n :options=\"marketplace.state.filter.options\"\n class=\"h-100 w-100 pd-small bg-light\"\n />\n </div>\n\t\t\t<!-- Catalog wrapper -->\n\t\t\t<div class=\"rows-1 gap-thin\">\n\t\t\t\t<router-view v-slot=\"{ Component, route }\">\n\t\t\t\t\t<component ref=\"page\" :key=\"route\" :localPosition=\"localPosition\" :is=\"Component\" />\n\t\t\t\t</router-view>\n\t\t\t</div>\n\t\t</div>\n\t</div>\n</template>\n\n\n<script setup=\"props\">\n\t// Import libs\n\timport { computed, onMounted, watch, ref } from 'vue'\n\timport { useRoute, useRouter,onBeforeRouteLeave } from 'vue-router'\n\timport { useI18n } from 'vue-i18n'\n\n\timport BlockFilter from '@pf/src/modules/globals/views/components/blocks/BlockFilter.vue'\n\n\timport * as marketplace from '@pf/src/modules/products/store/marketplace';\n\timport * as globals from '@pf/src/modules/globals/views/store/globals'\n import * as categories from '@pf/src/modules/products/store/categories';\n\n\t// Accessing router and store\n\tconst route = useRoute()\n\tconst router = useRouter()\n\n\tconst localPosition = ref({\n\t\tcity: null,\n\t\tstate: null,\n\t\tcountry: null\n\t});\n\n\tconst desktopFilters = ref(null)\n\n\tfunction denormalizeUrlParam(param) {\n\t return param\n\t .replace(/-/g, ' ') // Замена дефисов на пробелы\n\t .replace(/\\b\\w/g, l => l.toUpperCase()); // Преобразование первой буквы каждого слова в заглавную\n\t}\n\n\tfunction normalizeUrlParam(param) {\n\t return param\n\t .toLowerCase()\n\t .replace(/ /g, '-')\n\t .replace(/[^a-z0-9-]/g, '');\n\t}\n\n\tif (route.params) {\n // Загружаем новые значения из параметров маршрута в состояние\n let newState = {\n country: denormalizeUrlParam(route.params.country),\n state: denormalizeUrlParam(route.params.state),\n city: denormalizeUrlParam(route.params.city),\n };\n\n\t // Обновляем глобальное состояние\n\t localPosition.value = newState;\n\t}\n\n\tif (route.query) {\n\t \tconst query = route.query;\n\n\t\tmarketplace.state.filter.selected.categories = query.categories ? query.categories.split(',') : [];\n\t\tmarketplace.state.filter.selected.prices = query.prices ? query.prices.split(',') : [];\n\t\tmarketplace.state.filter.selected.delivery = query.delivery ? query.delivery.split(',') : [];\n\t}\n\n\tif (route.query.sortParam) marketplace.state.sort.param = route.query.sortParam\n\tif (route.query.sortOrder) marketplace.state.sort.order = route.query.sortOrder\n\n\tonMounted(async () => {\n\t let options = {\n status: 'published'\n }\n\n let categoriesFilter = await categories.actions.fetchCategories(options);\n\n categoriesFilter = categoriesFilter.map(category => ({\n value: category.url,\n label: category.name\n }));\n\n const index = marketplace.state.filter.options.findIndex(option => option.value === 'categories');\n\n const categoryOption = {\n title: 'Categories',\n value: 'categories',\n options: categoriesFilter\n };\n\n if (index !== -1) {\n marketplace.state.filter.options[index] = categoryOption;\n } else {\n marketplace.state.filter.options.unshift(categoryOption);\n }\n\t})\n\n\twatch(() => marketplace.state.sort, (newSortValue, oldSortValue) => {\n\t\tlet query = { ...route.query}\n\t\t\n\t\tquery.sortParam = newSortValue.param\n\t\tquery.sortOrder = newSortValue.order\n\t \n\t // replace the current route\n\t router.replace({ query });\n\t}, { deep: true });\n\n\n\twatch(() => marketplace.state.filter.selected, (newFilterValue, oldFilterValue) => {\n\t // Переводим фильтр в формат query\n\t const query = { ...route.query };\n\n\t // Удаляем старые значения фильтра из query\n\t Object.keys(oldFilterValue).forEach(key => {\n\t if (query[key]) {\n\t delete query[key];\n\t }\n\t });\n\n\t // Добавляем новые значения фильтра в query\n\t const newQueryValues = Object.fromEntries(\n\t Object.entries(newFilterValue)\n\t .filter(([key, value]) => Array.isArray(value) && value.length > 0)\n\t .map(([key, value]) => [key, value.join(',')])\n\t );\n\n\t delete query.options;\n\t Object.assign(query, newQueryValues);\n\n\t // Обновляем маршрут с новым query\n\t router.replace({ query });\n\t}, { deep: true })\n\n\twatch(() => globals.state.position, (newPosition) => {\n\t // get the current route\n\t const currentRoute = { ...router.currentRoute.value };\n\t \n\t // create new parameters based on globals state position\n\t let newParams = {\n\t country: normalizeUrlParam(newPosition.country),\n\t state: normalizeUrlParam(newPosition.state),\n\t city: normalizeUrlParam(newPosition.city),\n\t };\n\t \n\t // update route params\n\t currentRoute.params = newParams;\n\t \n\t // replace the current route\n\t router.replace(currentRoute);\n\t}, { deep: true });\n\n const text = {\n locale: 'en',\n messages: {\n en: {\n\t \tmeta: {\n title: \"Marketplace – Shop Our Wide Selection of Quality Weed for Delivery\",\n description: \"Browse our marketplace of top-grade weed strains and choose from a variety of delivery options. Order now and have your favorite strains delivered straight to your door. Safe, fast, and reliable.\",\n }\n },\n ru: {\n\t meta: {\n title: \"Маркетплейс – Выбирайте из нашего ассортимента качественной травки для доставки\",\n description: \"Маркетплейс – Изучите наши продукты высокого качества и выбирайте из различных вариантов доставки. Закажите сейчас и получите свои любимые сорта на дом. Безопасно, быстро и надежно.\",\n }\n }\n }\n }\n\n \tconst { t } = useI18n(text)\n</script>\n\n<style lang=\"scss\">\n\n\n</style>\n"],"names":["marketplace.state","categories.actions","globals.state"],"mappings":";;;;;;;;;;;;;;;;;;;AAsDC,UAAM,QAAQ,SAAU;AACxB,UAAM,SAAS,UAAW;AAE1B,UAAM,gBAAgB,IAAI;AAAA,MACzB,MA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C,OAAO,kBAAkB,YAAY,KAAK;AAAA,QAC1C,MAAM,kBAAkB,YAAY,IAAI;AAAA,MAC7C;AAGG,mBAAa,SAAS;AAGtB,aAAO,QAAQ,YAAY;AAAA,IAC9B,GAAI,EAAE,MAAM,KAAI,CAAE;AAEhB,UAAM,OAAO;AAAA,MACX,QAAQ;AAAA,MACR,UAAU;AAAA,QACR,IAAI;AAAA,UACH,MAAM;AAAA,YACH,OAAO;AAAA,YACP,aAAa;AAAA,UACd;AAAA,QACF;AAAA,QACD,IAAI;AAAA,UACH,MAAM;AAAA,YACH,OAAO;AAAA,YACP,aAAa;AAAA,UACd;AAAA,QACF;AAAA,MACF;AAAA,IACF;AAEa,YAAQ,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -3,6 +3,8 @@ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toString
3
3
  const vue = require("vue");
4
4
  const vueRouter = require("vue-router");
5
5
  const organizations = require("../../../organizations/store/organizations.cjs");
6
+ const marketplace = require("../../store/marketplace.cjs");
7
+ const globals = require("../../../globals/views/store/globals.cjs");
6
8
  const Feed = require("../../../../components/Feed/Feed.vue.cjs");
7
9
  const CardOrganization = require("../../../organizations/components/blocks/CardOrganization.vue.cjs");
8
10
  const _sfc_main = {
@@ -12,10 +14,10 @@ const _sfc_main = {
12
14
  return (_ctx, _cache) => {
13
15
  var _a;
14
16
  return vue.openBlock(), vue.createBlock(Feed.default, {
15
- sort: _ctx.store.marketplace.state.sort,
16
- "onUpdate:sort": _cache[0] || (_cache[0] = ($event) => _ctx.store.marketplace.state.sort = $event),
17
- filter: _ctx.store.marketplace.state.filter,
18
- "onUpdate:filter": _cache[1] || (_cache[1] = ($event) => _ctx.store.marketplace.state.filter = $event),
17
+ sort: marketplace.state.sort,
18
+ "onUpdate:sort": _cache[0] || (_cache[0] = ($event) => marketplace.state.sort = $event),
19
+ filter: marketplace.state.filter,
20
+ "onUpdate:filter": _cache[1] || (_cache[1] = ($event) => marketplace.state.filter = $event),
19
21
  search: true,
20
22
  showLoadMore: false,
21
23
  states: {
@@ -34,7 +36,7 @@ const _sfc_main = {
34
36
  categories: vue.unref(route).query.categories,
35
37
  prices: vue.unref(route).query.prices,
36
38
  delivery: vue.unref(route).query.delivery,
37
- location: (_a = _ctx.store.globals.state.position) == null ? void 0 : _a.location,
39
+ location: (_a = globals.state.position) == null ? void 0 : _a.location,
38
40
  contain: ["products"]
39
41
  },
40
42
  class: "rows-1 gap-thin"
@@ -1 +1 @@
1
- {"version":3,"file":"Catalog.vue.cjs","sources":["../../../../../../../src/modules/products/components/pages/Catalog.vue"],"sourcesContent":["<template>\n\t<Feed\n\t\tv-model:sort=\"store.marketplace.state.sort\"\n\t\tv-model:filter=\"store.marketplace.state.filter\"\n :search=\"true\"\n :showLoadMore=\"false\"\n :states=\"{\n empty: {\n title: 'No Shops Found',\n description: 'Currently, there are no shops.'\n },\n }\"\n :store=\"{\n read: (options) => organization.actions.read(options)\n }\"\n :options=\"{\n country: route.params.country,\n\t state: route.params.state,\n\t city: route.params.city,\n\t categories: route.query.categories,\n\t prices: route.query.prices,\n\t delivery: route.query.delivery,\n\t location: store.globals.state.position?.location,\n\t contain: ['products'],\n }\"\n v-slot=\"{ \n items \n }\"\n class=\"rows-1 gap-thin\"\n >\n <CardOrganization \n\t v-for=\"organization in items\" \n\t :key=\"organization._id\"\n\t :organization=\"organization\"\n\t :showRating=\"true\"\n\t :showFollowers=\"false\"\n\t :showProducts=\"true\"\n\t class=\"bg-light w-100 o-hidden radius-big pd-small \"\n\t />\n </Feed>\n</template>\n\n<script setup>\n\timport { computed,reactive,ref, onMounted,watch } from 'vue'\n\timport { useRoute } from 'vue-router'\n\t\n\timport * as organization from '@pf/src/modules/organizations/store/organizations'\n\n\timport Feed from '@pf/src/components/Feed/Feed.vue'\n\n\timport CardOrganization from '@pf/src/modules/organizations/components/blocks/CardOrganization.vue'\n\t\n\tconst route = useRoute()\n</script>\n\n<style lang=\"scss\">\n</style>\n"],"names":["useRoute"],"mappings":";;;;;;;;;;AAoDC,UAAM,QAAQA,UAAAA,SAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"Catalog.vue.cjs","sources":["../../../../../../../src/modules/products/components/pages/Catalog.vue"],"sourcesContent":["<template>\n\t<Feed\n\t\tv-model:sort=\"marketplace.state.sort\"\n\t\tv-model:filter=\"marketplace.state.filter\"\n :search=\"true\"\n :showLoadMore=\"false\"\n :states=\"{\n empty: {\n title: 'No Shops Found',\n description: 'Currently, there are no shops.'\n },\n }\"\n :store=\"{\n read: (options) => organization.actions.read(options)\n }\"\n :options=\"{\n country: route.params.country,\n\t state: route.params.state,\n\t city: route.params.city,\n\t categories: route.query.categories,\n\t prices: route.query.prices,\n\t delivery: route.query.delivery,\n\t location: globals.state.position?.location,\n\t contain: ['products'],\n }\"\n v-slot=\"{ \n items \n }\"\n class=\"rows-1 gap-thin\"\n >\n <CardOrganization \n\t v-for=\"organization in items\" \n\t :key=\"organization._id\"\n\t :organization=\"organization\"\n\t :showRating=\"true\"\n\t :showFollowers=\"false\"\n\t :showProducts=\"true\"\n\t class=\"bg-light w-100 o-hidden radius-big pd-small \"\n\t />\n </Feed>\n</template>\n\n<script setup>\n\timport { computed,reactive,ref, onMounted,watch } from 'vue'\n\timport { useRoute } from 'vue-router'\n\t\n\timport * as organization from '@pf/src/modules/organizations/store/organizations'\n\timport * as marketplace from '@pf/src/modules/products/store/marketplace';\n\timport * as globals from '@pf/src/modules/globals/views/store/globals'\n\n\timport Feed from '@pf/src/components/Feed/Feed.vue'\n\n\timport CardOrganization from '@pf/src/modules/organizations/components/blocks/CardOrganization.vue'\n\t\n\tconst route = useRoute()\n</script>\n\n<style lang=\"scss\">\n</style>\n"],"names":["useRoute"],"mappings":";;;;;;;;;;;;AAsDC,UAAM,QAAQA,UAAAA,SAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -1,6 +1,8 @@
1
1
  import { openBlock, createBlock, unref, withCtx, createElementBlock, Fragment, renderList } from "vue";
2
2
  import { useRoute } from "vue-router";
3
3
  import { actions } from "../../../organizations/store/organizations.js";
4
+ import { state } from "../../store/marketplace.js";
5
+ import { state as state$1 } from "../../../globals/views/store/globals.js";
4
6
  import _sfc_main$1 from "../../../../components/Feed/Feed.vue.js";
5
7
  import _sfc_main$2 from "../../../organizations/components/blocks/CardOrganization.vue.js";
6
8
  const _sfc_main = {
@@ -10,10 +12,10 @@ const _sfc_main = {
10
12
  return (_ctx, _cache) => {
11
13
  var _a;
12
14
  return openBlock(), createBlock(_sfc_main$1, {
13
- sort: _ctx.store.marketplace.state.sort,
14
- "onUpdate:sort": _cache[0] || (_cache[0] = ($event) => _ctx.store.marketplace.state.sort = $event),
15
- filter: _ctx.store.marketplace.state.filter,
16
- "onUpdate:filter": _cache[1] || (_cache[1] = ($event) => _ctx.store.marketplace.state.filter = $event),
15
+ sort: state.sort,
16
+ "onUpdate:sort": _cache[0] || (_cache[0] = ($event) => state.sort = $event),
17
+ filter: state.filter,
18
+ "onUpdate:filter": _cache[1] || (_cache[1] = ($event) => state.filter = $event),
17
19
  search: true,
18
20
  showLoadMore: false,
19
21
  states: {
@@ -32,7 +34,7 @@ const _sfc_main = {
32
34
  categories: unref(route).query.categories,
33
35
  prices: unref(route).query.prices,
34
36
  delivery: unref(route).query.delivery,
35
- location: (_a = _ctx.store.globals.state.position) == null ? void 0 : _a.location,
37
+ location: (_a = state$1.position) == null ? void 0 : _a.location,
36
38
  contain: ["products"]
37
39
  },
38
40
  class: "rows-1 gap-thin"
@@ -1 +1 @@
1
- {"version":3,"file":"Catalog.vue.js","sources":["../../../../../../../src/modules/products/components/pages/Catalog.vue"],"sourcesContent":["<template>\n\t<Feed\n\t\tv-model:sort=\"store.marketplace.state.sort\"\n\t\tv-model:filter=\"store.marketplace.state.filter\"\n :search=\"true\"\n :showLoadMore=\"false\"\n :states=\"{\n empty: {\n title: 'No Shops Found',\n description: 'Currently, there are no shops.'\n },\n }\"\n :store=\"{\n read: (options) => organization.actions.read(options)\n }\"\n :options=\"{\n country: route.params.country,\n\t state: route.params.state,\n\t city: route.params.city,\n\t categories: route.query.categories,\n\t prices: route.query.prices,\n\t delivery: route.query.delivery,\n\t location: store.globals.state.position?.location,\n\t contain: ['products'],\n }\"\n v-slot=\"{ \n items \n }\"\n class=\"rows-1 gap-thin\"\n >\n <CardOrganization \n\t v-for=\"organization in items\" \n\t :key=\"organization._id\"\n\t :organization=\"organization\"\n\t :showRating=\"true\"\n\t :showFollowers=\"false\"\n\t :showProducts=\"true\"\n\t class=\"bg-light w-100 o-hidden radius-big pd-small \"\n\t />\n </Feed>\n</template>\n\n<script setup>\n\timport { computed,reactive,ref, onMounted,watch } from 'vue'\n\timport { useRoute } from 'vue-router'\n\t\n\timport * as organization from '@pf/src/modules/organizations/store/organizations'\n\n\timport Feed from '@pf/src/components/Feed/Feed.vue'\n\n\timport CardOrganization from '@pf/src/modules/organizations/components/blocks/CardOrganization.vue'\n\t\n\tconst route = useRoute()\n</script>\n\n<style lang=\"scss\">\n</style>\n"],"names":[],"mappings":";;;;;;;;AAoDC,UAAM,QAAQ,SAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"Catalog.vue.js","sources":["../../../../../../../src/modules/products/components/pages/Catalog.vue"],"sourcesContent":["<template>\n\t<Feed\n\t\tv-model:sort=\"marketplace.state.sort\"\n\t\tv-model:filter=\"marketplace.state.filter\"\n :search=\"true\"\n :showLoadMore=\"false\"\n :states=\"{\n empty: {\n title: 'No Shops Found',\n description: 'Currently, there are no shops.'\n },\n }\"\n :store=\"{\n read: (options) => organization.actions.read(options)\n }\"\n :options=\"{\n country: route.params.country,\n\t state: route.params.state,\n\t city: route.params.city,\n\t categories: route.query.categories,\n\t prices: route.query.prices,\n\t delivery: route.query.delivery,\n\t location: globals.state.position?.location,\n\t contain: ['products'],\n }\"\n v-slot=\"{ \n items \n }\"\n class=\"rows-1 gap-thin\"\n >\n <CardOrganization \n\t v-for=\"organization in items\" \n\t :key=\"organization._id\"\n\t :organization=\"organization\"\n\t :showRating=\"true\"\n\t :showFollowers=\"false\"\n\t :showProducts=\"true\"\n\t class=\"bg-light w-100 o-hidden radius-big pd-small \"\n\t />\n </Feed>\n</template>\n\n<script setup>\n\timport { computed,reactive,ref, onMounted,watch } from 'vue'\n\timport { useRoute } from 'vue-router'\n\t\n\timport * as organization from '@pf/src/modules/organizations/store/organizations'\n\timport * as marketplace from '@pf/src/modules/products/store/marketplace';\n\timport * as globals from '@pf/src/modules/globals/views/store/globals'\n\n\timport Feed from '@pf/src/components/Feed/Feed.vue'\n\n\timport CardOrganization from '@pf/src/modules/organizations/components/blocks/CardOrganization.vue'\n\t\n\tconst route = useRoute()\n</script>\n\n<style lang=\"scss\">\n</style>\n"],"names":[],"mappings":";;;;;;;;;;AAsDC,UAAM,QAAQ,SAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -1,5 +1,24 @@
1
1
  "use strict";
2
- Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
+ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
3
3
  const reports = require("./store/reports.cjs");
4
- exports.reportsStore = reports;
4
+ function initializeReports(app, store, router, options = {}) {
5
+ options.route || "Home";
6
+ store.addStore("reports", reports);
7
+ }
8
+ const ModuleReports = {
9
+ initialize: initializeReports,
10
+ views: {
11
+ store: {
12
+ storeReports: reports
13
+ },
14
+ router: {
15
+ // createReportsRoutes
16
+ },
17
+ components: {
18
+ // Pages
19
+ // ReportPage
20
+ }
21
+ }
22
+ };
23
+ exports.default = ModuleReports;
5
24
  //# sourceMappingURL=reports.client.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"reports.client.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;"}
1
+ {"version":3,"file":"reports.client.cjs","sources":["../../../../../src/modules/reports/reports.client.js"],"sourcesContent":["// Store\nimport * as storeReports from './store/reports.js';\n\n// Router\n// import { createReportsRoutes } from './router/reports';\n\n// Views\n// Предполагаем, что у нас есть компонент для отображения отчетов\n// import ReportPage from './components/pages/ReportPage.vue';\n\n// Пример функции инициализации для модуля отчетов\nfunction initializeReports(app, store, router, options = {}) {\n const route = options.route || 'Home';\n\n // const routesReports = createReportsRoutes();\n \n // router.addRoute(route, routesReports);\n \n store.addStore('reports', storeReports);\n}\n\nconst ModuleReports = {\n initialize: initializeReports,\n views: {\n store: {\n storeReports\n },\n router: {\n // createReportsRoutes\n },\n components: {\n // Pages\n // ReportPage\n }\n }\n}\n\nexport default ModuleReports;"],"names":["storeReports"],"mappings":";;;AAWA,SAAS,kBAAkB,KAAK,OAAO,QAAQ,UAAU,CAAA,GAAI;AAC7C,UAAQ,SAAS;AAM/B,QAAM,SAAS,WAAWA,OAAY;AACxC;AAEK,MAAC,gBAAgB;AAAA,EACpB,YAAY;AAAA,EACZ,OAAO;AAAA,IACL,OAAO;AAAA,MACX,cAAMA;AAAAA,IACD;AAAA,IACD,QAAQ;AAAA;AAAA,IAEP;AAAA,IACD,YAAY;AAAA;AAAA;AAAA,IAGX;AAAA,EACF;AACH;;"}
@@ -1,5 +1,24 @@
1
1
  import * as reports from "./store/reports.js";
2
+ function initializeReports(app, store, router, options = {}) {
3
+ options.route || "Home";
4
+ store.addStore("reports", reports);
5
+ }
6
+ const ModuleReports = {
7
+ initialize: initializeReports,
8
+ views: {
9
+ store: {
10
+ storeReports: reports
11
+ },
12
+ router: {
13
+ // createReportsRoutes
14
+ },
15
+ components: {
16
+ // Pages
17
+ // ReportPage
18
+ }
19
+ }
20
+ };
2
21
  export {
3
- reports as reportsStore
22
+ ModuleReports as default
4
23
  };
5
24
  //# sourceMappingURL=reports.client.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"reports.client.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
1
+ {"version":3,"file":"reports.client.js","sources":["../../../../../src/modules/reports/reports.client.js"],"sourcesContent":["// Store\nimport * as storeReports from './store/reports.js';\n\n// Router\n// import { createReportsRoutes } from './router/reports';\n\n// Views\n// Предполагаем, что у нас есть компонент для отображения отчетов\n// import ReportPage from './components/pages/ReportPage.vue';\n\n// Пример функции инициализации для модуля отчетов\nfunction initializeReports(app, store, router, options = {}) {\n const route = options.route || 'Home';\n\n // const routesReports = createReportsRoutes();\n \n // router.addRoute(route, routesReports);\n \n store.addStore('reports', storeReports);\n}\n\nconst ModuleReports = {\n initialize: initializeReports,\n views: {\n store: {\n storeReports\n },\n router: {\n // createReportsRoutes\n },\n components: {\n // Pages\n // ReportPage\n }\n }\n}\n\nexport default ModuleReports;"],"names":["storeReports"],"mappings":";AAWA,SAAS,kBAAkB,KAAK,OAAO,QAAQ,UAAU,CAAA,GAAI;AAC7C,UAAQ,SAAS;AAM/B,QAAM,SAAS,WAAWA,OAAY;AACxC;AAEK,MAAC,gBAAgB;AAAA,EACpB,YAAY;AAAA,EACZ,OAAO;AAAA,IACL,OAAO;AAAA,MACX,cAAMA;AAAAA,IACD;AAAA,IACD,QAAQ;AAAA;AAAA,IAEP;AAAA,IACD,YAAY;AAAA;AAAA;AAAA,IAGX;AAAA,EACF;AACH;"}
@@ -75,8 +75,8 @@ var reports_routes = function(app, db, origins) {
75
75
  controller.delete
76
76
  );
77
77
  };
78
- var report_model = (mongoose) => {
79
- const ReportSchema = new mongoose.Schema({
78
+ var report_model = (db) => {
79
+ const ReportSchema = new db.mongoose.Schema({
80
80
  status: {
81
81
  type: String,
82
82
  enum: [
@@ -119,7 +119,7 @@ var report_model = (mongoose) => {
119
119
  },
120
120
  target: {
121
121
  // заменяем 'organization' на 'target', так как это может быть или User, или Organization
122
- type: mongoose.Schema.Types.ObjectId,
122
+ type: db.mongoose.Schema.Types.ObjectId,
123
123
  ref: function(value) {
124
124
  if (this.type === "user") return "User";
125
125
  if (this.type === "organization") return "Organization";
@@ -129,16 +129,29 @@ var report_model = (mongoose) => {
129
129
  }, {
130
130
  timestamps: { currentTime: () => Date.now() }
131
131
  });
132
- const Report = mongoose.model("Report", ReportSchema);
132
+ const Report = db.mongoose.model("Report", ReportSchema);
133
133
  return Report;
134
134
  };
135
- const reportsController = reports_controller;
135
+ const ReportsController = reports_controller;
136
136
  const reportsRoutes = reports_routes;
137
137
  const ReportModel = report_model;
138
+ function initializeReports(app, db, origins, publicPath) {
139
+ db.report = ReportModel(db);
140
+ if (app) {
141
+ reportsRoutes(app, db);
142
+ }
143
+ }
138
144
  var reports_server = {
139
- reportsController,
140
- reportsRoutes,
141
- ReportModel
145
+ initialize: initializeReports,
146
+ models: {
147
+ ReportModel
148
+ },
149
+ routes: {
150
+ reportsRoutes
151
+ },
152
+ controllers: {
153
+ ReportsController
154
+ }
142
155
  };
143
156
  const reports_server$1 = /* @__PURE__ */ _commonjsHelpers.getDefaultExportFromCjs(reports_server);
144
157
  module.exports = reports_server$1;
@@ -74,8 +74,8 @@ var reports_routes = function(app, db, origins) {
74
74
  controller.delete
75
75
  );
76
76
  };
77
- var report_model = (mongoose) => {
78
- const ReportSchema = new mongoose.Schema({
77
+ var report_model = (db) => {
78
+ const ReportSchema = new db.mongoose.Schema({
79
79
  status: {
80
80
  type: String,
81
81
  enum: [
@@ -118,7 +118,7 @@ var report_model = (mongoose) => {
118
118
  },
119
119
  target: {
120
120
  // заменяем 'organization' на 'target', так как это может быть или User, или Organization
121
- type: mongoose.Schema.Types.ObjectId,
121
+ type: db.mongoose.Schema.Types.ObjectId,
122
122
  ref: function(value) {
123
123
  if (this.type === "user") return "User";
124
124
  if (this.type === "organization") return "Organization";
@@ -128,16 +128,29 @@ var report_model = (mongoose) => {
128
128
  }, {
129
129
  timestamps: { currentTime: () => Date.now() }
130
130
  });
131
- const Report = mongoose.model("Report", ReportSchema);
131
+ const Report = db.mongoose.model("Report", ReportSchema);
132
132
  return Report;
133
133
  };
134
- const reportsController = reports_controller;
134
+ const ReportsController = reports_controller;
135
135
  const reportsRoutes = reports_routes;
136
136
  const ReportModel = report_model;
137
+ function initializeReports(app, db, origins, publicPath) {
138
+ db.report = ReportModel(db);
139
+ if (app) {
140
+ reportsRoutes(app, db);
141
+ }
142
+ }
137
143
  var reports_server = {
138
- reportsController,
139
- reportsRoutes,
140
- ReportModel
144
+ initialize: initializeReports,
145
+ models: {
146
+ ReportModel
147
+ },
148
+ routes: {
149
+ reportsRoutes
150
+ },
151
+ controllers: {
152
+ ReportsController
153
+ }
141
154
  };
142
155
  const reports_server$1 = /* @__PURE__ */ getDefaultExportFromCjs(reports_server);
143
156
  export {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ozdao/prometheus-framework",
3
- "version": "0.2.253",
3
+ "version": "0.2.254",
4
4
  "description": "Web3 Framework focused on user experience and ease of development.",
5
5
  "author": "OZ DAO <hello@ozdao.dev>",
6
6
  "license": "GPL-3.0-or-later",
@@ -124,6 +124,14 @@
124
124
  "import": "./dist/files.server.mjs",
125
125
  "require": "./dist/files.server.js"
126
126
  },
127
+ "./modules/chats/client": {
128
+ "import": "./dist/prometheus-framework/src/modules/chats/chats.client.js",
129
+ "require": "./dist/prometheus-framework/src/modules/chats/chats.client.cjs"
130
+ },
131
+ "./modules/chats/server": {
132
+ "import": "./dist/chats.server.mjs",
133
+ "require": "./dist/chats.server.js"
134
+ },
127
135
  "./modules/landing/client": {
128
136
  "import": "./dist/prometheus-framework/src/modules/landing/landing.client.js",
129
137
  "require": "./dist/prometheus-framework/src/modules/landing/landing.client.cjs"
@@ -0,0 +1,48 @@
1
+ // Store
2
+ import * as storeChatModule from './store/chat.store.js';
3
+
4
+ // Router
5
+ // import { createChatRoutes } from './router/chat.router';
6
+
7
+ // Views
8
+ // Pages
9
+ import ChatPage from './components/pages/ChatPage.vue';
10
+
11
+ // Sections
12
+ import ChatWindow from './components/sections/ChatWindow.vue';
13
+
14
+ // Blocks
15
+ import ChatMessage from './components/blocks/ChatMessage.vue';
16
+
17
+ // Пример функции инициализации для модуля чатов
18
+ function initializeChats(app, store, router, options = {}) {
19
+ const route = options.route || 'Home';
20
+
21
+ // const routesChat = createChatRoutes();
22
+
23
+ // router.addRoute(route, routesChat);
24
+
25
+ store.addStore('chat', storeChatModule);
26
+ }
27
+
28
+ const ModuleChats = {
29
+ initialize: initializeChats,
30
+ views: {
31
+ store: {
32
+ storeChatModule
33
+ },
34
+ router: {
35
+ // createChatRoutes
36
+ },
37
+ components: {
38
+ // Pages
39
+ ChatPage,
40
+ // Sections
41
+ ChatWindow,
42
+ // Blocks
43
+ ChatMessage
44
+ }
45
+ }
46
+ }
47
+
48
+ export default ModuleChats;
@@ -0,0 +1,32 @@
1
+ // Импортируем контроллеры
2
+ const ChatsController = require('./controllers/chats.controller.js');
3
+
4
+ // Импортируем роуты
5
+ const chatsRoutes = require('./routes/chats.routes.js');
6
+
7
+ // Импортируем модели
8
+ const ChatModel = require('./models/chat.model.js');
9
+
10
+ function initializeChats(app, db, wss, origins, publicPath) {
11
+ // Настраиваем модели в объекте базы данных
12
+ db.chat = ChatModel(db);
13
+
14
+ // Настраиваем маршруты, если объект приложения передан
15
+ if (app) {
16
+ chatsRoutes(app, db, wss, origins, publicPath);
17
+ }
18
+ }
19
+
20
+ // Экспортируем функцию инициализации, контроллеры, роуты и модели
21
+ module.exports = {
22
+ initialize: initializeChats,
23
+ models: {
24
+ ChatModel,
25
+ },
26
+ routes: {
27
+ chatsRoutes,
28
+ },
29
+ controllers: {
30
+ ChatsController,
31
+ }
32
+ }
@@ -2,12 +2,22 @@
2
2
  const filesController = require('./controllers/files.controller.js');
3
3
  // Importing routes from the routes directory
4
4
  const filesRoutes = require('./routes/files.routes.js');
5
- // Models
6
- // const FileModel = require('./models/file.model.js');
7
5
 
8
- // Exporting controllers, routes, and models
6
+ function initializeFiles(app, db, origins, publicPath) {
7
+ // Настраиваем маршруты, если объект приложения передан
8
+ if (app) {
9
+ filesRoutes(app, db, origins, publicPath);
10
+ }
11
+ }
12
+
13
+ // Экспортируем функцию инициализации, контроллеры, роуты и модели
9
14
  module.exports = {
10
- filesController,
11
- filesRoutes,
12
- // FileModel
13
- };
15
+ initialize: initializeFiles,
16
+
17
+ routes: {
18
+ filesRoutes
19
+ },
20
+ controllers: {
21
+ filesController
22
+ }
23
+ };
@@ -48,6 +48,7 @@
48
48
  import BlockFilter from '@pf/src/modules/globals/views/components/blocks/BlockFilter.vue'
49
49
 
50
50
  import * as marketplace from '@pf/src/modules/products/store/marketplace';
51
+ import * as globals from '@pf/src/modules/globals/views/store/globals'
51
52
  import * as categories from '@pf/src/modules/products/store/categories';
52
53
 
53
54
  // Accessing router and store
@@ -1,7 +1,7 @@
1
1
  <template>
2
2
  <Feed
3
- v-model:sort="store.marketplace.state.sort"
4
- v-model:filter="store.marketplace.state.filter"
3
+ v-model:sort="marketplace.state.sort"
4
+ v-model:filter="marketplace.state.filter"
5
5
  :search="true"
6
6
  :showLoadMore="false"
7
7
  :states="{
@@ -20,7 +20,7 @@
20
20
  categories: route.query.categories,
21
21
  prices: route.query.prices,
22
22
  delivery: route.query.delivery,
23
- location: store.globals.state.position?.location,
23
+ location: globals.state.position?.location,
24
24
  contain: ['products'],
25
25
  }"
26
26
  v-slot="{
@@ -45,6 +45,8 @@
45
45
  import { useRoute } from 'vue-router'
46
46
 
47
47
  import * as organization from '@pf/src/modules/organizations/store/organizations'
48
+ import * as marketplace from '@pf/src/modules/products/store/marketplace';
49
+ import * as globals from '@pf/src/modules/globals/views/store/globals'
48
50
 
49
51
  import Feed from '@pf/src/components/Feed/Feed.vue'
50
52