@ozdao/prometheus-framework 0.0.82 → 0.0.84

Sign up to get free protection for your applications and to get access to all the features.
Files changed (44) hide show
  1. package/README.md +59 -50
  2. package/dist/CardOrganization-21de52b3.js +1 -0
  3. package/dist/CardOrganization-3c42e14f.mjs +320 -0
  4. package/dist/CardOrganization-4859370e.mjs +320 -0
  5. package/dist/CardOrganization-a05f3a19.js +1 -0
  6. package/dist/Product-b440df7f.js +7 -0
  7. package/dist/Product-c3a77d07.mjs +837 -0
  8. package/dist/Product-eb2b6725.js +7 -0
  9. package/dist/Product-f4dbd969.mjs +837 -0
  10. package/dist/ProfileOrganizations-b83f6720.js +1 -0
  11. package/dist/ProfileOrganizations-c58a4fb9.js +1 -0
  12. package/dist/ProfileOrganizations-dbc8a6cd.mjs +214 -0
  13. package/dist/ProfileOrganizations-f6e00809.mjs +214 -0
  14. package/dist/Publics-17009745.mjs +1926 -0
  15. package/dist/Publics-450a6715.mjs +1926 -0
  16. package/dist/Publics-8d94ee66.js +1 -0
  17. package/dist/Publics-c6f6b824.js +1 -0
  18. package/dist/community.client.cjs +7 -7
  19. package/dist/community.client.js +591 -1413
  20. package/dist/community.server.js +1 -0
  21. package/dist/community.server.mjs +1 -0
  22. package/dist/components/FieldTags/BlockTags.vue.d.ts +7 -0
  23. package/dist/modules/users/components/sections/ProfileCompletion.vue.d.ts +3 -2
  24. package/dist/organizations.client.cjs +3 -3
  25. package/dist/organizations.client.js +890 -896
  26. package/dist/organizations.server.js +3 -1
  27. package/dist/organizations.server.mjs +3 -1
  28. package/dist/style.css +1 -1
  29. package/dist/users.client.cjs +1 -1
  30. package/dist/users.client.js +182 -170
  31. package/package.json +1 -1
  32. package/src/components/FieldTags/BlockTags.vue +93 -0
  33. package/src/modules/community/components/pages/CreateBlogPost.vue +6 -41
  34. package/src/modules/community/controllers/blog.controller.js +1 -0
  35. package/src/modules/organizations/components/pages/Organization.vue +17 -6
  36. package/src/modules/organizations/components/pages/OrganizationEdit.vue +49 -51
  37. package/src/modules/organizations/components/sections/DetailsTab.vue +3 -7
  38. package/src/modules/organizations/components/sections/Feed.vue +1 -1
  39. package/src/modules/organizations/controllers/organizations.controller.js +2 -0
  40. package/src/modules/organizations/models/organization.model.js +1 -1
  41. package/src/modules/organizations/store/organizations.js +2 -2
  42. package/src/modules/users/components/pages/Profile.vue +1 -0
  43. package/src/modules/users/components/pages/ProfileEdit.vue +1 -0
  44. package/src/modules/users/components/sections/ProfileCompletion.vue +43 -16
package/README.md CHANGED
@@ -1,5 +1,5 @@
1
1
  # Prometheus Framework – Empowering Web3 Development
2
- Prometheus is a comprehensive Web3 framework designed for an optimal user experience and easy development. This library, built on Vue 3 with Server-Side Rendering (SSR) and Web3 support, provides a plethora of components, methods, styles, and more for robust frontend development.
2
+ Prometheus is a comprehensive Web3 framework designed for an optimal user experience and easy development. This library, built on Vue 3 with Server-Side Rendering (SSR) and Web3 support, provides a plethora of components, methods, styles, and more for robust fullstack development.
3
3
 
4
4
  ⚠️ **WARNING**: This library is under active development. Expect changes in the module structure. Use only if you're prepared to contribute. Use at your own risk. ⚠️
5
5
 
@@ -24,15 +24,15 @@ In Greek mythology, Prometheus is a Titan god of fire. Prometheus is best known
24
24
 
25
25
  ## What's inside?
26
26
  - [Vue 3](https://vuejs.org/)
27
- - [Vite](https://vitejs.dev/)
28
- - [Vue SFC Setup](https://vuejs.org/api/sfc-script-setup.html)
27
+ - [Express](https://expressjs.com/)
28
+ - [Mongoose](https://mongoosejs.com/)
29
29
 
30
30
  ## Motivation
31
31
  Why create another UI framework when there are a huge number of solutions that have been developed and supported for a long time, with a large community?
32
32
 
33
- - Prometheus managed by OZ DAO
34
- - WEB3 and UX oriented
35
- - Easy to redefine
33
+ - Prometheus Unchained by OZ DAO - Look, we're just gonna do it, okay? Our own thing, bugs and all. It's like building a treehouse, but for code.
34
+ - Global Vision Quest - This ain't just any framework. We're aiming for the stars, man! Big dreams, big web 3.0 projects, worldwide. Like the Avengers, but nerdier.
35
+ - Simple Swag - We've got those dope tranisition, some nifty fonts (Ave to Adrian Frutiger), and, oh boy, those ROUNDINGS that'll make everything pop. Because who doesn't love some good curve appeal?
36
36
 
37
37
  ## Installation
38
38
  Use npm to install the Prometheus Framework:
@@ -42,40 +42,37 @@ npm install '@ozdao/prometheus-framework'
42
42
  ```
43
43
 
44
44
  ## Usage
45
- ### Global Import
46
- For a global import of all components:
47
45
 
48
- ```js
49
- import PrometheusFramework from '@ozdao/prometheus-framework'
50
- // App initialization...
51
- app.use(PrometheusFramework)
52
- ```
46
+ Prometheus Framework is organized as a fullstack monorepo, containing modules each comprising both client-side and server-side code. Here is a breakdown of the typical structure within each module:
53
47
 
54
- ### Individual Import
55
- To import specific components:
48
+ - **Models**: These are the backend models utilized within the module.
49
+ - **Routes**: The pathways to the module's endpoints.
50
+ - **Controllers**: Controllers for the backend side of the module.
51
+ - **Store**: The store for managing client-side state.
52
+ - **Router**: The router for managing client-side navigation.
53
+ - **Components**: The views or components in the MVC paradigm.
56
54
 
57
- ```js
58
- import { createApp } from 'vue'
59
- import { Address, Button } from '@ozdao/prometheus-framework'
60
- // App initialization...
61
- app.component('Address', Address)
62
- app.component('Button', Button)
63
- ```
55
+ Here's how you can use and navigate the Prometheus Framework:
64
56
 
65
- ### Local Import
66
- For a localized component use:
57
+ ### Modules
58
+ The framework also encompasses the following modules:
67
59
 
68
- ```html
69
- <template>
70
- <Address></Address>
71
- </template>
60
+ - auth
61
+ - community
62
+ - events
63
+ - global
64
+ - icons
65
+ - marketplace
66
+ - middlewares
67
+ - mobile
68
+ - orders
69
+ - organizations
70
+ - products
71
+ - spots
72
+ - users
72
73
 
73
- <script setup>
74
- import { Address } from '@ozdao/prometheus-framework'
75
- </script>
76
- ```
77
74
 
78
- ## Components
75
+ ### Components
79
76
  Prometheus Framework includes a broad array of UI components:
80
77
 
81
78
  - Address
@@ -112,31 +109,43 @@ Prometheus Framework includes a broad array of UI components:
112
109
  - UploadImageMultiple
113
110
  - index.ts
114
111
 
115
- For component-specific documentation, consult the [official documentation](https://docs.ozdao.dev/docs/components/).
112
+ The styling in Prometheus Framework is meticulously organized to ensure a seamless development experience and an optimal user interface. Based on the given folder structure, here's how you can understand and utilize the styling resources provided:
116
113
 
117
- ## Modules
118
- The framework also encompasses the following modules:
114
+ ### Styles
115
+ The styles are organized in a hierarchical folder and file structure, providing a clear separation of concerns and making it easy to locate and manage style definitions. Here's a breakdown:
116
+
117
+ - **Base Styles**:
118
+ - **reset.scss**: Resets the default styling of HTML elements to a consistent baseline.
119
+ - **layout.scss**: Contains general layout styles, grid system, and utility classes.
120
+ - **config.scss**: Contains configuration variables, like colors, breakpoints, and font definitions.
121
+
122
+ - **Components Styles** (located in `components` folder):
123
+ - Styles for individual UI components are isolated into their own files, like `button.scss`, `card.scss`, `popup.scss`, etc. This makes it easy to find and edit styles for a specific component.
124
+
125
+ - **Typography**:
126
+ - **typography.scss**: Contains style definitions for text elements, including font sizes, line heights, font weights, and other typography-related styles.
127
+
128
+ - **Responsive Styles**:
129
+ - **responsive.scss**: Contains media queries and responsive style definitions to ensure a good appearance across various screen sizes.
130
+
131
+ - **Theme Styles**:
132
+ - **theme.scss**: Contains theme-related styles, which could include color schemes, background images, and other styles related to the visual theme of the application.
133
+
134
+ - **Base Utility Styles** (located in `base` folder):
135
+ - Sub-folders like `transitions`, `cursors`, `borders`, etc., contain utility styles and common design tokens that can be reused across the application.
136
+
137
+ For component-specific documentation, consult the [official documentation](https://docs.ozdao.dev/docs/components/).
119
138
 
120
- - auth
121
- - community
122
- - events
123
- - global
124
- - icons
125
- - marketplace
126
- - middlewares
127
- - mobile
128
- - orders
129
- - organizations
130
- - products
131
- - spots
132
- - users
133
139
 
134
140
  ## Contributing
135
141
  Community contributions are encouraged. For guidelines, see the [contributing guide](https://docs.ozdao.dev/docs/contribution/).
136
142
 
137
143
  ## Special Thanks
138
- For [Sipec][https://github.com/sipec] for his [vue-tags-input](https://github.com/sipec/vue-tags-input)
144
+ During the work process, we study a vast amount of open-source code and are grateful to all the programmers who have shared it. Without you, all of this would have been impossible. Special attention is deserved by the authors whose code we have fully utilized, your names will forever be in the history of OZ:
145
+
146
+ For [sipec][https://github.com/sipec] for his [vue-tags-input](https://github.com/sipec/vue-tags-input)
139
147
  For [VictorNico][https://github.com/VictorNico] for his [vue3-reactive-tel-input](https://github.com/VictorNico/vue3-reactive-tel-input)
148
+ For [shentao][https://github.com/shentao] for his [vue-multiselect](https://github.com/shentao/vue-multiselect)
140
149
 
141
150
  ## License
142
151
  Prometheus Framework is licensed under the [GNU GPLv3](https://www.gnu.org/licenses/gpl-3.0.txt).
@@ -0,0 +1 @@
1
+ "use strict";const o=require("./auth-5aa8e90c.js"),t=require("vue"),c=require("./globals-928eb13c.js"),m=require("vue-router"),u=require("./ButtonFollow-2ce169ca.js"),i=o.axios.create({baseURL:process.env.API_URL,withCredentials:!0}),s=t.reactive({all:[],current:{_id:null,profile:{tags:[],photo:"",name:"",description:""},structure:[],owner:null,types:"",contacts:{email:"",website:"",phone:"",address:""},social:{telegram:"",line:"",facebook:"",instagram:""},rating:{popularity:0,median:0,amount:0}}}),d={async create(e,a){e.owner=a;try{const r=await i.post("/api/organizations/create",e);return console.log("Organization created successfully"),s.current=r.data,r.data}catch(r){throw console.log("Organization creation failed"),c.setError(r),r}},async read(e={}){console.log(e),e.params=e.params||{},e.location&&(e.params.location=e.location),e.country&&(e.params.country=e.country),e.state&&(e.params.state=e.state),e.city&&(e.params.city=e.city),e.categories&&(e.params.categories=e.categories),e.prices&&(e.params.prices=e.prices),e.delivery&&(e.params.delivery=e.delivery),e._id&&(e.params=e.params||{},e.params._id=e._id),e.types&&(e.params=e.params||[],e.params.types=e.types),e.owner&&(e.params=e.params||{},e.params.owner=e.owner),e.user&&(e.params=e.params||{},e.params.user=e.user),e.member&&(e.params=e.params||{},e.params.member=e.member),e.subscriber&&(e.params=e.params||{},e.params.subscriber=e.subscriber),e.onlyuser&&(e.params=e.params||{},e.params.onlyuser=e.onlyuser),e.params=e.params||{},e.params.skip=e.skip||0,e.params.limit=e.limit||9,e.params.sortParam=e.sort;try{console.log("Request params:"+e.params);const a=await i.get("/api/organizations",{params:e.params});return e._id?(console.log(a.data),Object.assign(s.current||{},a.data[0]),console.log(s.current)):console.log(a.data),Promise.resolve(a.data)}catch(a){return c.setError(a),Promise.reject(a)}},async update(e,a){return console.log(e,a),await i.post(`/api/organizations/${e}/update`,a).then(r=>(console.log("Organization updated successfully"),Promise.resolve(r.data)),r=>(console.log("Updating organization failed"),Promise.reject(r)))},async remove(e){await i.delete(`/api/organizations/${e}/delete`).then(a=>{s.error=null;let r=o.Cookies.get("user"),n=JSON.parse(r);return n.organization=null,o.Cookies.set("user",JSON.stringify(n),{expires:7,domain:".osi.plus",sameSite:"none",secure:!0}),Promise.resolve(a.data)},a=>(c.setError(a),Promise.reject(a))).catch(a=>{c.setError(a)})},async reset(){s.current={_id:null,profile:{categories:[],photo:"",name:"",description:""},structure:[],owner:null,types:"",contacts:{email:"",website:"",phone:"",address:""},social:{telegram:"",line:"",facebook:"",instagram:""},rating:{popularity:0,median:0,amount:0}}}};t.watch(s,(e,a)=>{});const g=Object.freeze(Object.defineProperty({__proto__:null,actions:d,state:s},Symbol.toStringTag,{value:"Module"}));const h={class:"flex-stretch flex-nojustify flex-nowrap flex shop-cart-item"},f=["src"],y={key:1,width:"524",height:"345",viewBox:"0 0 524 345",fill:"none",xmlns:"http://www.w3.org/2000/svg",class:"aspect-1x1",style:{"object-fit":"cover"}},p=t.createElementVNode("rect",{width:"524",height:"345",fill:"white"},null,-1),b=t.createElementVNode("rect",{width:"524",height:"345",fill:"white"},null,-1),k=t.createElementVNode("circle",{cx:"262",cy:"172",r:"56",fill:"#00ff88","fill-opacity":"0.1"},null,-1),v=t.createElementVNode("path",{fill:"#00ff88",d:"M229.348 186.819C230.243 191.884 233.393 194.231 238.458 193.273V193.644C238.458 198.832 241.206 201.581 246.364 201.581H291.545C296.733 201.581 299.481 198.74 299.481 193.644V162.576C299.481 157.481 296.733 154.64 291.545 154.64H285.677L284.071 145.653C283.175 140.619 279.995 138.303 274.899 139.198L230.398 147.043C225.302 147.969 223.048 151.15 223.943 156.246L229.348 186.819ZM230.83 186.479L225.456 156.06C224.715 151.86 226.537 149.266 230.737 148.525L275.084 140.712C279.13 140.001 281.848 141.762 282.62 145.993L284.102 154.64H246.364C241.206 154.64 238.458 157.419 238.458 162.576V191.729L238.365 191.76C234.165 192.532 231.571 190.679 230.83 186.479ZM239.971 162.669C239.971 158.376 242.164 156.153 246.456 156.153H291.483C295.59 156.153 297.968 158.376 297.968 162.669V190.093L284.565 177.894C283.145 176.597 281.662 175.856 279.809 175.856C277.987 175.856 276.628 176.566 275.146 177.863L262.052 189.073L257.142 184.565C255.875 183.36 254.764 182.743 253.158 182.743C251.675 182.743 250.656 183.36 249.39 184.503L239.971 193.212V162.669ZM257.636 178.419C261.373 178.419 264.43 175.3 264.43 171.471C264.43 167.734 261.373 164.584 257.636 164.584C253.806 164.584 250.718 167.734 250.718 171.471C250.718 175.3 253.806 178.419 257.636 178.419Z"},null,-1),w=[p,b,k,v],C={class:"text-left"},E={class:"name"},V={key:0,class:"t-transp"},N={key:1,class:"t-transp"},x={key:2,class:"t-transp"},z={class:"t-main t-demi price mn-small"},B={key:0},_={key:0,class:"flex-nojustify flex"},$={class:"flex-nowrap flex"},S=t.createElementVNode("svg",{fill:"none",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg"},[t.createElementVNode("path",{"clip-rule":"evenodd",d:"m7.27124 0h5.45456c1.0041 0 1.8182.814027 1.8182 1.81818v.90899h2.7278c1.0042 0 1.8182.81402 1.8182 1.81818v1.81818c0 1.00415-.814 1.81818-1.8182 1.81818h-.0735l-.8363 10.00009c0 1.0042-.814 1.8182-1.8182 1.8182h-9.09087c-1.00416 0-1.81818-.814-1.81504-1.7427l-.83964-10.07559h-.07187c-1.00415 0-1.818177-.81403-1.818177-1.81818v-1.81818c0-1.00416.814027-1.81818 1.818177-1.81818h2.72668v-.90899c0-1.004153.81402-1.81818 1.81818-1.81818zm-1.81889 18.1819-.83047-10h10.75152l-.827 9.9245-.0031.0755zm-2.72612-11.81799v-1.81818h14.54547v1.81818zm10.00137-4.54571v.90909h-5.45456v-.90909z",fill:"#8a8a8a","fill-rule":"evenodd"})],-1),O=[S],L={__name:"CardOrderItem",props:{product:Object,editable:String,increase:Function,decrease:Function,remove:Function},setup(e){return m.useRouter(),(a,r)=>(t.openBlock(),t.createElementBlock("div",h,[e.product.images[0]?(t.openBlock(),t.createElementBlock("img",{key:0,class:"bg-grey aspect-1x1",src:e.product.images[0]},null,8,f)):t.createCommentVNode("",!0),e.product.images[0]?t.createCommentVNode("",!0):(t.openBlock(),t.createElementBlock("svg",y,w)),t.createElementVNode("div",C,[t.createElementVNode("p",E,[t.createTextVNode(t.toDisplayString(e.product.name)+" ",1),e.product.size?(t.openBlock(),t.createElementBlock("span",V,", "+t.toDisplayString(e.product.size),1)):t.createCommentVNode("",!0),typeof e.product.color=="string"&&e.product.size?(t.openBlock(),t.createElementBlock("span",N,", ")):t.createCommentVNode("",!0),typeof e.product.color=="string"?(t.openBlock(),t.createElementBlock("span",x,t.toDisplayString(e.product.color),1)):t.createCommentVNode("",!0)]),t.createElementVNode("p",z,[e.editable?(t.openBlock(),t.createElementBlock("span",B,t.toDisplayString(e.product.quantity)+" x ",1)):t.createCommentVNode("",!0),t.createTextVNode(t.toDisplayString(e.product.price)+" "+t.toDisplayString(a.returnCurrency()),1)]),e.editable?(t.openBlock(),t.createElementBlock("div",_,[t.createElementVNode("div",$,[t.createElementVNode("button",{onClick:r[0]||(r[0]=n=>e.decrease(e.product)),class:"mn-r-thin bg-grey button-square button"},"-"),t.createElementVNode("button",{onClick:r[1]||(r[1]=n=>e.increase(e.product)),class:"mn-r-thin bg-grey button-square button"},"+")]),t.createElementVNode("button",{onClick:r[2]||(r[2]=n=>e.remove(e.product)),class:"hover_br-transp hover_br-l-dark bg-transp button-square button"},O)])):t.createCommentVNode("",!0)])]))}},M={class:"pd-medium br-b br-solid br-black-transp flex-v-center flex-nowrap flex"},j=["src"],D={key:1,class:"h-4r w-4r radius-extra",width:"42",height:"42",viewBox:"0 0 42 42",fill:"none",xmlns:"http://www.w3.org/2000/svg"},q=t.createElementVNode("circle",{fill:"rgb(var(--main))",cx:"21",cy:"21",r:"21"},null,-1),P=t.createElementVNode("path",{fill:"#242424","fill-opacity":"0.1","fill-rule":"evenodd","clip-rule":"evenodd",d:"M8.00233 37.4954C8.00078 37.4458 8 37.3961 8 37.3462C8 32.9066 11.5673 29.3077 15.9677 29.3077H26.0323C30.4328 29.3077 34 32.9066 34 37.3462C34 37.3961 33.9992 37.4458 33.9977 37.4954C30.4223 40.3165 25.9078 42 21 42C16.0922 42 11.5777 40.3164 8.00233 37.4954ZM21 9C16.5995 9 13.0323 12.5989 13.0323 17.0385C13.0323 21.478 16.5995 25.0769 21 25.0769C25.4005 25.0769 28.9677 21.478 28.9677 17.0385C28.9677 12.5989 25.4005 9 21 9Z"},null,-1),F=[q,P],I={class:"mn-l-small"},R={class:"h3 mn-r-semi mn-thin"},Z={key:0,class:"w-max star-container flex-v-center flex"},H={class:"mn-r-thin pd-r-thin pd-l-thin pd-micro radius-small t-semi uppercase bg-main p-small"},U=["src"],T={class:"p-small t-semi mn-r-thin"},J={class:"p-small"},A={class:"mn-thin"},G={key:0,class:"pd-medium"},K={class:"mn-small w-100 flex-nowrap flex flex-v-center pd-small bg-white radius-medium"},Q={class:"t-black p-medium t-semi"},W=t.createElementVNode("span",{class:"mn-r-small"},"30-60min",-1),X=t.createElementVNode("span",{class:"mn-r-auto"},"$50 min",-1),Y={class:"d-block o-scroll flex-nowrap flex"},ee=t.createElementVNode("button",{class:"flex-center flex-nowrap flex shop-cart-item pd-thin radius-medium w-15r bg-main button"},"View menu",-1),te={__name:"CardOrganization",props:{user:String,organization:Object},emits:["updateMembership"],setup(e,{emit:a}){return m.useRouter(),(r,n)=>(t.openBlock(),t.createElementBlock("div",{class:"bg-grey radius-big o-hidden",onClick:n[1]||(n[1]=l=>r.$router.push({name:"Organization",params:{_id:e.organization._id}}))},[t.createElementVNode("div",M,[e.organization.profile.photo&&e.organization.profile.photo.length>0?(t.openBlock(),t.createElementBlock("img",{key:0,src:e.organization.profile.photo,class:"h-4r w-4r radius-extra"},null,8,j)):(t.openBlock(),t.createElementBlock("svg",D,F)),t.createElementVNode("div",I,[t.createElementVNode("p",R,t.toDisplayString(e.organization.profile.name),1),e.organization.rating?(t.openBlock(),t.createElementBlock("div",Z,[t.createElementVNode("span",H,t.toDisplayString(e.organization.types[0]),1),(t.openBlock(),t.createElementBlock(t.Fragment,null,t.renderList(5,l=>t.createElementVNode("img",{class:"i-small mn-r-thin",src:l<=e.organization.rating.median?"/icons/star.svg":"/icons/star-stroke.svg"},null,8,U)),64)),t.createElementVNode("span",T,t.toDisplayString(e.organization.rating.median),1),t.createElementVNode("span",J,"("+t.toDisplayString(e.organization.rating.amount)+")",1)])):t.createCommentVNode("",!0),t.createElementVNode("div",null,[t.createElementVNode("p",A,t.toDisplayString(e.organization.numberOfMemberships)+" followers",1),e.user._id?(t.openBlock(),t.createBlock(u.ButtonFollow,{key:0,type:"organization",isMember:e.organization.isMember,targetId:e.organization._id,userId:e.user,class:"radius-big w-100",onUpdateMembership:n[0]||(n[0]=l=>a("updateMembership",l))},null,8,["isMember","targetId","userId"])):t.createCommentVNode("",!0)])])]),e.organization.products.length>0?(t.openBlock(),t.createElementBlock("div",G,[t.createElementVNode("div",K,[t.createElementVNode("p",Q,t.toDisplayString(e.organization.products.length)+" items: ",1),W,X]),t.createElementVNode("div",Y,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.organization.products,l=>(t.openBlock(),t.createBlock(L,{onClick:t.withModifiers(ae=>r.$router.push({name:"Product Organization",params:{_id:e.organization._id,product:l._id}}),["stop"]),key:l._id,editable:!1,product:l,class:"pd-thin radius-medium w-15r br-solid br-grey br-1px bg-white mn-r-thin"},null,8,["onClick","product"]))),128)),ee])])):t.createCommentVNode("",!0)]))}};exports._sfc_main=te;exports.actions=d;exports.organizations=g;exports.state=s;
@@ -0,0 +1,320 @@
1
+ import { a as w, C as g } from "./auth-8b5aac7a.mjs";
2
+ import { reactive as p, watch as C, openBlock as s, createElementBlock as i, createCommentVNode as c, createElementVNode as t, createTextVNode as h, toDisplayString as n, Fragment as f, renderList as b, createBlock as y, withModifiers as x } from "vue";
3
+ import { s as m } from "./globals-96ba60e4.mjs";
4
+ import { useRouter as v } from "vue-router";
5
+ import { B as z } from "./ButtonFollow-c9484003.mjs";
6
+ const u = w.create({ baseURL: process.env.API_URL, withCredentials: !0 }), d = p({
7
+ all: [],
8
+ current: {
9
+ _id: null,
10
+ profile: {
11
+ tags: [],
12
+ photo: "",
13
+ name: "",
14
+ description: ""
15
+ },
16
+ structure: [],
17
+ owner: null,
18
+ types: "",
19
+ contacts: {
20
+ email: "",
21
+ website: "",
22
+ phone: "",
23
+ address: ""
24
+ },
25
+ social: {
26
+ telegram: "",
27
+ line: "",
28
+ facebook: "",
29
+ instagram: ""
30
+ },
31
+ rating: {
32
+ popularity: 0,
33
+ median: 0,
34
+ amount: 0
35
+ }
36
+ }
37
+ }), k = {
38
+ // Create
39
+ async create(e, a) {
40
+ e.owner = a;
41
+ try {
42
+ const r = await u.post("/api/organizations/create", e);
43
+ return console.log("Organization created successfully"), d.current = r.data, r.data;
44
+ } catch (r) {
45
+ throw console.log("Organization creation failed"), m(r), r;
46
+ }
47
+ },
48
+ // Read
49
+ async read(e = {}) {
50
+ console.log(e), e.params = e.params || {}, e.location && (e.params.location = e.location), e.country && (e.params.country = e.country), e.state && (e.params.state = e.state), e.city && (e.params.city = e.city), e.categories && (e.params.categories = e.categories), e.prices && (e.params.prices = e.prices), e.delivery && (e.params.delivery = e.delivery), e._id && (e.params = e.params || {}, e.params._id = e._id), e.types && (e.params = e.params || [], e.params.types = e.types), e.owner && (e.params = e.params || {}, e.params.owner = e.owner), e.user && (e.params = e.params || {}, e.params.user = e.user), e.member && (e.params = e.params || {}, e.params.member = e.member), e.subscriber && (e.params = e.params || {}, e.params.subscriber = e.subscriber), e.onlyuser && (e.params = e.params || {}, e.params.onlyuser = e.onlyuser), e.params = e.params || {}, e.params.skip = e.skip || 0, e.params.limit = e.limit || 9, e.params.sortParam = e.sort;
51
+ try {
52
+ console.log("Request params:" + e.params);
53
+ const a = await u.get("/api/organizations", { params: e.params });
54
+ return e._id ? (console.log(a.data[0]), Object.assign(d.current || {}, a.data[0]), console.log(d.current)) : console.log(a.data), Promise.resolve(a.data);
55
+ } catch (a) {
56
+ return m(a), Promise.reject(a);
57
+ }
58
+ },
59
+ // Update
60
+ async update(e, a) {
61
+ return console.log(e, a), await u.post(`/api/organizations/${e}/update`, a).then(
62
+ (r) => (console.log("Organization updated successfully"), Promise.resolve(r.data)),
63
+ (r) => (console.log("Updating organization failed"), Promise.reject(r))
64
+ );
65
+ },
66
+ // Remove
67
+ async remove(e) {
68
+ await u.delete(`/api/organizations/${e}/delete`).then(
69
+ (a) => {
70
+ d.error = null;
71
+ let r = g.get("user"), l = JSON.parse(r);
72
+ return l.organization = null, g.set("user", JSON.stringify(l), { expires: 7, domain: ".osi.plus", sameSite: "none", secure: !0 }), Promise.resolve(a.data);
73
+ },
74
+ (a) => (m(a), Promise.reject(a))
75
+ ).catch((a) => {
76
+ m(a);
77
+ });
78
+ },
79
+ // Reset
80
+ async reset() {
81
+ d.current = {
82
+ _id: null,
83
+ profile: {
84
+ categories: [],
85
+ photo: "",
86
+ name: "",
87
+ description: ""
88
+ },
89
+ structure: [],
90
+ owner: null,
91
+ types: "",
92
+ contacts: {
93
+ email: "",
94
+ website: "",
95
+ phone: "",
96
+ address: ""
97
+ },
98
+ social: {
99
+ telegram: "",
100
+ line: "",
101
+ facebook: "",
102
+ instagram: ""
103
+ },
104
+ rating: {
105
+ popularity: 0,
106
+ median: 0,
107
+ amount: 0
108
+ }
109
+ };
110
+ }
111
+ };
112
+ C(d, (e, a) => {
113
+ });
114
+ const ve = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
115
+ __proto__: null,
116
+ actions: k,
117
+ state: d
118
+ }, Symbol.toStringTag, { value: "Module" }));
119
+ const _ = { class: "flex-stretch flex-nojustify flex-nowrap flex shop-cart-item" }, $ = ["src"], O = {
120
+ key: 1,
121
+ width: "524",
122
+ height: "345",
123
+ viewBox: "0 0 524 345",
124
+ fill: "none",
125
+ xmlns: "http://www.w3.org/2000/svg",
126
+ class: "aspect-1x1",
127
+ style: { "object-fit": "cover" }
128
+ }, M = /* @__PURE__ */ t("rect", {
129
+ width: "524",
130
+ height: "345",
131
+ fill: "white"
132
+ }, null, -1), L = /* @__PURE__ */ t("rect", {
133
+ width: "524",
134
+ height: "345",
135
+ fill: "white"
136
+ }, null, -1), j = /* @__PURE__ */ t("circle", {
137
+ cx: "262",
138
+ cy: "172",
139
+ r: "56",
140
+ fill: "#00ff88",
141
+ "fill-opacity": "0.1"
142
+ }, null, -1), P = /* @__PURE__ */ t("path", {
143
+ fill: "#00ff88",
144
+ d: "M229.348 186.819C230.243 191.884 233.393 194.231 238.458 193.273V193.644C238.458 198.832 241.206 201.581 246.364 201.581H291.545C296.733 201.581 299.481 198.74 299.481 193.644V162.576C299.481 157.481 296.733 154.64 291.545 154.64H285.677L284.071 145.653C283.175 140.619 279.995 138.303 274.899 139.198L230.398 147.043C225.302 147.969 223.048 151.15 223.943 156.246L229.348 186.819ZM230.83 186.479L225.456 156.06C224.715 151.86 226.537 149.266 230.737 148.525L275.084 140.712C279.13 140.001 281.848 141.762 282.62 145.993L284.102 154.64H246.364C241.206 154.64 238.458 157.419 238.458 162.576V191.729L238.365 191.76C234.165 192.532 231.571 190.679 230.83 186.479ZM239.971 162.669C239.971 158.376 242.164 156.153 246.456 156.153H291.483C295.59 156.153 297.968 158.376 297.968 162.669V190.093L284.565 177.894C283.145 176.597 281.662 175.856 279.809 175.856C277.987 175.856 276.628 176.566 275.146 177.863L262.052 189.073L257.142 184.565C255.875 183.36 254.764 182.743 253.158 182.743C251.675 182.743 250.656 183.36 249.39 184.503L239.971 193.212V162.669ZM257.636 178.419C261.373 178.419 264.43 175.3 264.43 171.471C264.43 167.734 261.373 164.584 257.636 164.584C253.806 164.584 250.718 167.734 250.718 171.471C250.718 175.3 253.806 178.419 257.636 178.419Z"
145
+ }, null, -1), S = [
146
+ M,
147
+ L,
148
+ j,
149
+ P
150
+ ], V = { class: "text-left" }, B = { class: "name" }, I = {
151
+ key: 0,
152
+ class: "t-transp"
153
+ }, Z = {
154
+ key: 1,
155
+ class: "t-transp"
156
+ }, q = {
157
+ key: 2,
158
+ class: "t-transp"
159
+ }, F = { class: "t-main t-demi price mn-small" }, H = { key: 0 }, N = {
160
+ key: 0,
161
+ class: "flex-nojustify flex"
162
+ }, R = { class: "flex-nowrap flex" }, U = /* @__PURE__ */ t("svg", {
163
+ fill: "none",
164
+ height: "20",
165
+ viewBox: "0 0 20 20",
166
+ width: "20",
167
+ xmlns: "http://www.w3.org/2000/svg"
168
+ }, [
169
+ /* @__PURE__ */ t("path", {
170
+ "clip-rule": "evenodd",
171
+ d: "m7.27124 0h5.45456c1.0041 0 1.8182.814027 1.8182 1.81818v.90899h2.7278c1.0042 0 1.8182.81402 1.8182 1.81818v1.81818c0 1.00415-.814 1.81818-1.8182 1.81818h-.0735l-.8363 10.00009c0 1.0042-.814 1.8182-1.8182 1.8182h-9.09087c-1.00416 0-1.81818-.814-1.81504-1.7427l-.83964-10.07559h-.07187c-1.00415 0-1.818177-.81403-1.818177-1.81818v-1.81818c0-1.00416.814027-1.81818 1.818177-1.81818h2.72668v-.90899c0-1.004153.81402-1.81818 1.81818-1.81818zm-1.81889 18.1819-.83047-10h10.75152l-.827 9.9245-.0031.0755zm-2.72612-11.81799v-1.81818h14.54547v1.81818zm10.00137-4.54571v.90909h-5.45456v-.90909z",
172
+ fill: "#8a8a8a",
173
+ "fill-rule": "evenodd"
174
+ })
175
+ ], -1), E = [
176
+ U
177
+ ], J = {
178
+ __name: "CardOrderItem",
179
+ props: {
180
+ product: Object,
181
+ editable: String,
182
+ increase: Function,
183
+ decrease: Function,
184
+ remove: Function
185
+ },
186
+ setup(e) {
187
+ return v(), (a, r) => (s(), i("div", _, [
188
+ e.product.images[0] ? (s(), i("img", {
189
+ key: 0,
190
+ class: "bg-grey aspect-1x1",
191
+ src: e.product.images[0]
192
+ }, null, 8, $)) : c("", !0),
193
+ e.product.images[0] ? c("", !0) : (s(), i("svg", O, S)),
194
+ t("div", V, [
195
+ t("p", B, [
196
+ h(n(e.product.name) + " ", 1),
197
+ e.product.size ? (s(), i("span", I, ", " + n(e.product.size), 1)) : c("", !0),
198
+ typeof e.product.color == "string" && e.product.size ? (s(), i("span", Z, ", ")) : c("", !0),
199
+ typeof e.product.color == "string" ? (s(), i("span", q, n(e.product.color), 1)) : c("", !0)
200
+ ]),
201
+ t("p", F, [
202
+ e.editable ? (s(), i("span", H, n(e.product.quantity) + " x ", 1)) : c("", !0),
203
+ h(n(e.product.price) + " " + n(a.returnCurrency()), 1)
204
+ ]),
205
+ e.editable ? (s(), i("div", N, [
206
+ t("div", R, [
207
+ t("button", {
208
+ onClick: r[0] || (r[0] = (l) => e.decrease(e.product)),
209
+ class: "mn-r-thin bg-grey button-square button"
210
+ }, "-"),
211
+ t("button", {
212
+ onClick: r[1] || (r[1] = (l) => e.increase(e.product)),
213
+ class: "mn-r-thin bg-grey button-square button"
214
+ }, "+")
215
+ ]),
216
+ t("button", {
217
+ onClick: r[2] || (r[2] = (l) => e.remove(e.product)),
218
+ class: "hover_br-transp hover_br-l-dark bg-transp button-square button"
219
+ }, E)
220
+ ])) : c("", !0)
221
+ ])
222
+ ]));
223
+ }
224
+ }, T = { class: "pd-medium br-b br-solid br-black-transp flex-v-center flex-nowrap flex" }, A = ["src"], D = {
225
+ key: 1,
226
+ class: "h-4r w-4r radius-extra",
227
+ width: "42",
228
+ height: "42",
229
+ viewBox: "0 0 42 42",
230
+ fill: "none",
231
+ xmlns: "http://www.w3.org/2000/svg"
232
+ }, G = /* @__PURE__ */ t("circle", {
233
+ fill: "rgb(var(--main))",
234
+ cx: "21",
235
+ cy: "21",
236
+ r: "21"
237
+ }, null, -1), K = /* @__PURE__ */ t("path", {
238
+ fill: "#242424",
239
+ "fill-opacity": "0.1",
240
+ "fill-rule": "evenodd",
241
+ "clip-rule": "evenodd",
242
+ d: "M8.00233 37.4954C8.00078 37.4458 8 37.3961 8 37.3462C8 32.9066 11.5673 29.3077 15.9677 29.3077H26.0323C30.4328 29.3077 34 32.9066 34 37.3462C34 37.3961 33.9992 37.4458 33.9977 37.4954C30.4223 40.3165 25.9078 42 21 42C16.0922 42 11.5777 40.3164 8.00233 37.4954ZM21 9C16.5995 9 13.0323 12.5989 13.0323 17.0385C13.0323 21.478 16.5995 25.0769 21 25.0769C25.4005 25.0769 28.9677 21.478 28.9677 17.0385C28.9677 12.5989 25.4005 9 21 9Z"
243
+ }, null, -1), Q = [
244
+ G,
245
+ K
246
+ ], W = { class: "mn-l-small" }, X = { class: "h3 mn-r-semi mn-thin" }, Y = {
247
+ key: 0,
248
+ class: "w-max star-container flex-v-center flex"
249
+ }, ee = { class: "mn-r-thin pd-r-thin pd-l-thin pd-micro radius-small t-semi uppercase bg-main p-small" }, te = ["src"], ae = { class: "p-small t-semi mn-r-thin" }, re = { class: "p-small" }, se = { class: "mn-thin" }, ie = {
250
+ key: 0,
251
+ class: "pd-medium"
252
+ }, ne = { class: "mn-small w-100 flex-nowrap flex flex-v-center pd-small bg-white radius-medium" }, le = { class: "t-black p-medium t-semi" }, ce = /* @__PURE__ */ t("span", { class: "mn-r-small" }, "30-60min", -1), oe = /* @__PURE__ */ t("span", { class: "mn-r-auto" }, "$50 min", -1), de = { class: "d-block o-scroll flex-nowrap flex" }, me = /* @__PURE__ */ t("button", { class: "flex-center flex-nowrap flex shop-cart-item pd-thin radius-medium w-15r bg-main button" }, "View menu", -1), we = {
253
+ __name: "CardOrganization",
254
+ props: {
255
+ user: String,
256
+ organization: Object
257
+ },
258
+ emits: ["updateMembership"],
259
+ setup(e, { emit: a }) {
260
+ return v(), (r, l) => (s(), i("div", {
261
+ class: "bg-grey radius-big o-hidden",
262
+ onClick: l[1] || (l[1] = (o) => r.$router.push({ name: "Organization", params: { _id: e.organization._id } }))
263
+ }, [
264
+ t("div", T, [
265
+ e.organization.profile.photo && e.organization.profile.photo.length > 0 ? (s(), i("img", {
266
+ key: 0,
267
+ src: e.organization.profile.photo,
268
+ class: "h-4r w-4r radius-extra"
269
+ }, null, 8, A)) : (s(), i("svg", D, Q)),
270
+ t("div", W, [
271
+ t("p", X, n(e.organization.profile.name), 1),
272
+ e.organization.rating ? (s(), i("div", Y, [
273
+ t("span", ee, n(e.organization.types[0]), 1),
274
+ (s(), i(f, null, b(5, (o) => t("img", {
275
+ class: "i-small mn-r-thin",
276
+ src: o <= e.organization.rating.median ? "/icons/star.svg" : "/icons/star-stroke.svg"
277
+ }, null, 8, te)), 64)),
278
+ t("span", ae, n(e.organization.rating.median), 1),
279
+ t("span", re, "(" + n(e.organization.rating.amount) + ")", 1)
280
+ ])) : c("", !0),
281
+ t("div", null, [
282
+ t("p", se, n(e.organization.numberOfMemberships) + " followers", 1),
283
+ e.user._id ? (s(), y(z, {
284
+ key: 0,
285
+ type: "organization",
286
+ isMember: e.organization.isMember,
287
+ targetId: e.organization._id,
288
+ userId: e.user,
289
+ class: "radius-big w-100",
290
+ onUpdateMembership: l[0] || (l[0] = (o) => a("updateMembership", o))
291
+ }, null, 8, ["isMember", "targetId", "userId"])) : c("", !0)
292
+ ])
293
+ ])
294
+ ]),
295
+ e.organization.products.length > 0 ? (s(), i("div", ie, [
296
+ t("div", ne, [
297
+ t("p", le, n(e.organization.products.length) + " items: ", 1),
298
+ ce,
299
+ oe
300
+ ]),
301
+ t("div", de, [
302
+ (s(!0), i(f, null, b(e.organization.products, (o) => (s(), y(J, {
303
+ onClick: x((ue) => r.$router.push({ name: "Product Organization", params: { _id: e.organization._id, product: o._id } }), ["stop"]),
304
+ key: o._id,
305
+ editable: !1,
306
+ product: o,
307
+ class: "pd-thin radius-medium w-15r br-solid br-grey br-1px bg-white mn-r-thin"
308
+ }, null, 8, ["onClick", "product"]))), 128)),
309
+ me
310
+ ])
311
+ ])) : c("", !0)
312
+ ]));
313
+ }
314
+ };
315
+ export {
316
+ we as _,
317
+ k as a,
318
+ ve as o,
319
+ d as s
320
+ };