@ozdao/prometheus-framework 0.1.31 → 0.1.32

Sign up to get free protection for your applications and to get access to all the features.
Files changed (44) hide show
  1. package/dist/CardOrganization-26714a5e.mjs +297 -0
  2. package/dist/CardOrganization-88c6d479.js +1 -0
  3. package/dist/Chips-0e5bdd54.js +1 -0
  4. package/dist/Chips-5e32c8cb.mjs +200 -0
  5. package/dist/Feed-275a14d8.mjs +371 -0
  6. package/dist/Feed-505b3fa8.mjs +383 -0
  7. package/dist/Feed-d0da2943.js +1 -0
  8. package/dist/Feed-ee36f80b.js +1 -0
  9. package/dist/IconEdit-1b7b5874.js +1 -0
  10. package/dist/IconEdit-680dc269.mjs +339 -0
  11. package/dist/Image-2d2e606a.js +9 -0
  12. package/dist/Image-95c0fb07.mjs +480 -0
  13. package/dist/Product-6aa1c9ee.mjs +844 -0
  14. package/dist/Product-6ca8d04d.js +7 -0
  15. package/dist/ProductEdit-2e309add.js +1 -0
  16. package/dist/ProductEdit-6abcc97b.mjs +306 -0
  17. package/dist/ProfileBlogposts-62d5e809.mjs +70 -0
  18. package/dist/ProfileBlogposts-c31917ec.js +1 -0
  19. package/dist/ProfileEvents-89471c05.js +1 -0
  20. package/dist/ProfileEvents-e070d9d4.mjs +62 -0
  21. package/dist/ProfileOrganizations-bee6a3ae.js +1 -0
  22. package/dist/ProfileOrganizations-db313b5e.mjs +219 -0
  23. package/dist/Publics-24f055eb.js +1 -0
  24. package/dist/Publics-b1cbfd97.mjs +45 -0
  25. package/dist/Socials-9b2d27a6.js +1 -0
  26. package/dist/Socials-becde7dc.mjs +275 -0
  27. package/dist/auth.client.cjs +7 -7
  28. package/dist/auth.client.js +165 -162
  29. package/dist/community.client.cjs +1 -1
  30. package/dist/community.client.js +7 -7
  31. package/dist/events.client.cjs +1 -1
  32. package/dist/events.client.js +5 -5
  33. package/dist/events.server.js +9 -1
  34. package/dist/events.server.mjs +9 -1
  35. package/dist/organizations.client-6a69b54a.js +3 -0
  36. package/dist/organizations.client-c288ff44.mjs +3072 -0
  37. package/dist/organizations.client.cjs +1 -1
  38. package/dist/organizations.client.js +8 -8
  39. package/dist/users.client.cjs +1 -1
  40. package/dist/users.client.js +5 -5
  41. package/package.json +1 -1
  42. package/src/modules/auth/router/auth.js +1 -1
  43. package/src/modules/events/controllers/events.controller.js +12 -2
  44. package/src/modules/reports/components/sections/FormReport.vue +3 -1
@@ -0,0 +1,383 @@
1
+ import { reactive as B, watch as E, openBlock as r, createElementBlock as o, toDisplayString as d, createCommentVNode as i, createElementVNode as f, ref as g, createTextVNode as S, computed as R, createBlock as v, withModifiers as z, createVNode as h, normalizeClass as I, unref as m, renderSlot as L, onMounted as T, Transition as P, withCtx as $, Fragment as N, renderList as F } from "vue";
2
+ import { _ as M } from "./EmptyState-34d85f10.mjs";
3
+ import { _ as V } from "./_plugin-vue_export-helper-dad06003.mjs";
4
+ import { b as j, _ as O, a as U } from "./Chips-5e32c8cb.mjs";
5
+ import { useRouter as A } from "vue-router";
6
+ import { I as q } from "./IconEdit-680dc269.mjs";
7
+ import { a as D } from "./index-a661083c.mjs";
8
+ import { s as x } from "./globals-96ba60e4.mjs";
9
+ const k = D.create({ baseURL: process.env.API_URL, withCredentials: !0 });
10
+ k.defaults.withCredentials = !0;
11
+ const p = B({
12
+ all: [],
13
+ filter: {
14
+ // query
15
+ tags: [],
16
+ period: ""
17
+ // pagination
18
+ },
19
+ pagination: {
20
+ page: 1,
21
+ perPage: 18
22
+ },
23
+ // Sort
24
+ sort: {
25
+ current: "popularity",
26
+ ascending: !1
27
+ },
28
+ current: {
29
+ _id: "",
30
+ url: "",
31
+ status: "",
32
+ name: "",
33
+ tags: [],
34
+ owner: {},
35
+ date: "",
36
+ views: 0,
37
+ content: []
38
+ }
39
+ });
40
+ async function _(e = {}) {
41
+ e.params = e.params || {}, e.params.skip = e.skip || 0, e.params.limit = e.limit || 9, e.params.tags = e.tags || [], e.period && (e.params.period = e.period), e.url && (e.params = { url: e.url }), e.category && (e.params.category = e.category), e.organization && (e.params.organization = e.organization), e.owner && (e.params.owner = e.owner), e.creator && (e.params.creator = e.creator), e.status && (e.params.status = e.status), e.user && (e.params.user = e.user), e.params.skip = e.skip || 0, e.params.limit = e.limit || 10;
42
+ try {
43
+ console.log("Request params:" + e.params);
44
+ const t = await k.get("/api/blog/read", { params: e.params });
45
+ return e.url ? w(t.data, "current") : w(t.data, "all"), Promise.resolve(t.data);
46
+ } catch (t) {
47
+ return x(t), Promise.reject(t);
48
+ }
49
+ }
50
+ async function G(e) {
51
+ return k.post("/api/blog/create", e).then(
52
+ (t) => (w(t.data, "current"), Promise.resolve(t.data)),
53
+ (t) => (x(t), Promise.reject(t))
54
+ );
55
+ }
56
+ async function H(e) {
57
+ return k.post("/api/blog/update", e).then(
58
+ (t) => (w(t.data, "current"), Promise.resolve(t.data)),
59
+ (t) => (x(t), Promise.reject(t))
60
+ );
61
+ }
62
+ async function J(e) {
63
+ return await k.delete(`/api/blog/delete/${e}`).then(
64
+ (t) => {
65
+ const a = p.all.findIndex((l) => l._id === e);
66
+ return a !== -1 && p.all.splice(a, 1), Promise.resolve(t.data);
67
+ },
68
+ (t) => (x(t), Promise.reject(t))
69
+ );
70
+ }
71
+ function w(e, t) {
72
+ p[t] = e;
73
+ }
74
+ function K() {
75
+ p.current = {
76
+ _id: "",
77
+ url: "",
78
+ status: "",
79
+ name: "",
80
+ tags: [],
81
+ author: "",
82
+ owner: "",
83
+ date: "",
84
+ views: 0,
85
+ content: []
86
+ };
87
+ }
88
+ function Q(e) {
89
+ const t = {
90
+ order: p.project.content.length + 1,
91
+ type: e.type,
92
+ data: e.data,
93
+ class: e.class,
94
+ content: e.content
95
+ };
96
+ p.project.content.push(t);
97
+ }
98
+ E(p, (e, t) => {
99
+ });
100
+ const Ce = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
101
+ __proto__: null,
102
+ blockAdd: Q,
103
+ clean: K,
104
+ create: G,
105
+ read: _,
106
+ remove: J,
107
+ set: w,
108
+ state: p,
109
+ update: H
110
+ }, Symbol.toStringTag, { value: "Module" })), W = {
111
+ props: {
112
+ progress: {
113
+ type: Number,
114
+ default: null
115
+ },
116
+ status: {
117
+ type: String,
118
+ default: null
119
+ }
120
+ }
121
+ }, X = { class: "circular-loader" }, Y = /* @__PURE__ */ f("svg", { viewBox: "25 25 50 50" }, [
122
+ /* @__PURE__ */ f("circle", {
123
+ cx: "50",
124
+ cy: "50",
125
+ r: "20",
126
+ fill: "none",
127
+ "stroke-width": "4",
128
+ "stroke-miterlimit": "10"
129
+ })
130
+ ], -1), Z = {
131
+ key: 0,
132
+ class: "progress-text"
133
+ }, ee = {
134
+ key: 1,
135
+ class: "uppercase t-semi w-m-10r status-text"
136
+ };
137
+ function te(e, t, a, l, c, n) {
138
+ return r(), o("div", X, [
139
+ Y,
140
+ a.progress ? (r(), o("div", Z, d(a.progress), 1)) : i("", !0),
141
+ a.status ? (r(), o("div", ee, d(a.status), 1)) : i("", !0)
142
+ ]);
143
+ }
144
+ const ae = /* @__PURE__ */ V(W, [["render", te]]), re = { class: "t-semi br-top-dark flex-nowrap flex-nojustify flex" }, se = /* @__PURE__ */ f("span", { class: "mn-r-small mn-l-small d-block" }, "·", -1), le = { class: "cursor-pointer" }, oe = /* @__PURE__ */ f("span", { class: "mn-r-small mn-l-small d-block" }, "·", -1), ne = {
145
+ __name: "FooterBlogpost",
146
+ props: ["blogpost", "owner", "user"],
147
+ setup(e) {
148
+ const t = e, a = g(t.blogpost.numberOfReactions), l = g(t.blogpost.isReacted), c = g(t.blogpost.reactionId);
149
+ async function n(y) {
150
+ if (!t.user) {
151
+ alert("Please login to add a reaction");
152
+ return;
153
+ }
154
+ try {
155
+ const s = {
156
+ target: t.blogpost._id,
157
+ type: "blogpost",
158
+ user: t.user,
159
+ class: "like"
160
+ }, b = await j.create(s);
161
+ b.reaction.class === "like" && (a.value += 1, l.value = !0, c.value = b.reaction._id);
162
+ } catch (s) {
163
+ console.error(s), alert("Error adding reaction. Please try again later.");
164
+ }
165
+ }
166
+ async function u(y) {
167
+ if (!t.user) {
168
+ alert("Please login to add a reaction");
169
+ return;
170
+ }
171
+ try {
172
+ const s = { _id: c.value };
173
+ await j.delete(s), a.value -= 1, l.value = !1, c.value = null;
174
+ } catch {
175
+ alert("Error adding reaction. Please try again later.");
176
+ }
177
+ }
178
+ return (y, s) => (r(), o("footer", re, [
179
+ S(" 👁️ " + d(e.blogpost.views) + " ", 1),
180
+ se,
181
+ f("div", le, [
182
+ l.value ? i("", !0) : (r(), o("div", {
183
+ key: 0,
184
+ class: "cursor-pointer",
185
+ onClick: s[0] || (s[0] = (b) => n())
186
+ }, " 👍 " + d(a.value), 1)),
187
+ l.value ? (r(), o("div", {
188
+ key: 1,
189
+ class: "cursor-pointer",
190
+ onClick: s[1] || (s[1] = (b) => u())
191
+ }, " 👍 " + d(a.value), 1)) : i("", !0)
192
+ ]),
193
+ oe,
194
+ S(" 💬 " + d(e.blogpost.numberOfComments), 1)
195
+ ]));
196
+ }
197
+ }, ie = { class: "pos-relative bg-grey radius-big" }, ce = ["src"], ue = { class: "pd-t-zero pd-medium" }, de = {
198
+ key: 0,
199
+ class: "cursor-pointer mn-thin flex-nowrap flex w-100"
200
+ }, me = {
201
+ key: 0,
202
+ class: "pd-micro t-white uppercase t-semi p-small flex-center flex pd-r-small pd-l-small mn-l-thin w-min bg-second radius-extra"
203
+ }, ge = {
204
+ key: 1,
205
+ class: "mn-small t-transp p-big"
206
+ }, pe = {
207
+ key: 2,
208
+ class: "mn-small h2"
209
+ }, fe = {
210
+ __name: "CardBlogpost",
211
+ props: ["blogpost", "user", "type"],
212
+ setup(e) {
213
+ const t = e, a = A(), l = R(() => t.blogpost.content.find((n) => n.type === "ImageUpload")), c = R(() => t.blogpost.content.find((n) => n.type === "Textarea"));
214
+ return (n, u) => (r(), o("article", ie, [
215
+ e.user === e.blogpost.creator.target._id ? (r(), v(q, {
216
+ key: 0,
217
+ onClick: u[0] || (u[0] = z((y) => n.$router.push({
218
+ name: "Edit BlogPost",
219
+ params: {
220
+ url: e.blogpost.url
221
+ }
222
+ }), ["stop"])),
223
+ class: "z-index-2 pos-absolute pos-t-regular pos-r-regular i-regular t-transp"
224
+ })) : i("", !0),
225
+ h(O, {
226
+ class: I({
227
+ "mn-small pd-medium": e.type !== "short",
228
+ "flex-child-order-last flex-child mn-l-small": e.type === "short"
229
+ }),
230
+ entity: e.blogpost,
231
+ entityType: "blogpost",
232
+ user: e.user,
233
+ owner: e.blogpost.owner,
234
+ creator: e.blogpost.creator,
235
+ date: e.blogpost.createdAt
236
+ }, null, 8, ["class", "entity", "user", "owner", "creator", "date"]),
237
+ m(l) && m(l).content && e.type !== "blogpostPage" ? (r(), o("img", {
238
+ key: 1,
239
+ src: (n.FILE_SERVER_URL || "") + m(l).content,
240
+ alt: "Blog post image",
241
+ class: "mn-medium object-fit-cover w-100 h-20r"
242
+ }, null, 8, ce)) : i("", !0),
243
+ f("section", ue, [
244
+ e.type !== "blogpostPage" ? (r(), o("div", de, [
245
+ f("h3", {
246
+ onClick: u[1] || (u[1] = (y) => m(a).push({
247
+ name: "BlogPost",
248
+ params: {
249
+ url: e.blogpost.url
250
+ }
251
+ })),
252
+ class: ""
253
+ }, d(e.blogpost.name), 1),
254
+ e.blogpost.status === "draft" ? (r(), o("div", me, d(e.blogpost.status), 1)) : i("", !0)
255
+ ])) : i("", !0),
256
+ m(c) && m(c).content && e.type !== "blogpostPage" ? (r(), o("p", ge, d(m(c).content.slice(0, 120)) + "... ", 1)) : i("", !0),
257
+ e.type === "blogpostPage" ? (r(), o("h3", pe, d(e.blogpost.name), 1)) : i("", !0),
258
+ L(n.$slots, "default"),
259
+ e.type !== "short" && e.blogpost.tags.length > 0 ? (r(), v(U, {
260
+ key: 3,
261
+ chips: e.blogpost.tags
262
+ }, null, 8, ["chips"])) : i("", !0)
263
+ ]),
264
+ h(ne, {
265
+ class: "pd-t-zero pd-medium",
266
+ blogpost: e.blogpost,
267
+ user: e.user
268
+ }, null, 8, ["blogpost", "user"])
269
+ ]));
270
+ }
271
+ }, ye = { class: "feed" }, be = { key: 1 }, Se = {
272
+ __name: "Feed",
273
+ props: {
274
+ category: {
275
+ type: String,
276
+ default: null
277
+ },
278
+ owner: {
279
+ type: String,
280
+ default: null
281
+ },
282
+ creator: {
283
+ type: String,
284
+ default: null
285
+ },
286
+ status: {
287
+ type: String,
288
+ default: "published"
289
+ },
290
+ user: {
291
+ type: [String, Number],
292
+ default: null
293
+ },
294
+ period: {
295
+ type: String,
296
+ default: null
297
+ }
298
+ },
299
+ setup(e) {
300
+ const t = e, a = g([]), l = g(!0);
301
+ let c = g(!0), n = g(0), u = g(7);
302
+ const y = async () => {
303
+ if (l.value) {
304
+ n.value += u.value;
305
+ const s = await _({
306
+ skip: n.value,
307
+ limit: u.value,
308
+ category: t.category,
309
+ user: t.user,
310
+ owner: t.owner,
311
+ creator: t.creator,
312
+ status: t.status,
313
+ period: t.period
314
+ });
315
+ s.length === 0 && (l.value = !1), a.value = [...a.value, ...s];
316
+ }
317
+ };
318
+ return T(async () => {
319
+ const s = await _({
320
+ skip: n.value,
321
+ limit: u.value,
322
+ category: t.category,
323
+ user: t.user,
324
+ owner: t.owner,
325
+ status: t.status,
326
+ creator: t.creator,
327
+ period: t.period
328
+ });
329
+ s.length === 0 ? l.value = !1 : l.value = !0, a.value = s, c.value = !1;
330
+ }), (s, b) => (r(), o("section", ye, [
331
+ h(P, { name: "scaleTransition" }, {
332
+ default: $(() => [
333
+ m(c) ? (r(), v(ae, {
334
+ key: 0,
335
+ class: "z-index-5 pos-t-50 left-t-50 pos-absolute"
336
+ })) : i("", !0)
337
+ ]),
338
+ _: 1
339
+ }),
340
+ h(P, { name: "scaleTransition" }, {
341
+ default: $(() => [
342
+ !m(c) && a.value.length < 1 ? (r(), v(M, {
343
+ key: 0,
344
+ title: "No Blog Posts Found",
345
+ description: "Currently, there are no posts available in this blog. Please check back later.",
346
+ class: "pd-medium mn-thin bg-grey radius-big"
347
+ })) : (r(), o("div", be, [
348
+ (r(!0), o(N, null, F(a.value, (C) => (r(), v(fe, {
349
+ key: C._id,
350
+ blogpost: C,
351
+ user: e.user,
352
+ class: "mn-medium"
353
+ }, null, 8, ["blogpost", "user"]))), 128)),
354
+ h(P, { name: "scaleTransition" }, {
355
+ default: $(() => [
356
+ l.value && a.value.length > 0 ? (r(), o("button", {
357
+ key: 0,
358
+ onClick: y,
359
+ class: "w-100 bg-main button"
360
+ }, " Load more ")) : i("", !0)
361
+ ]),
362
+ _: 1
363
+ })
364
+ ]))
365
+ ]),
366
+ _: 1
367
+ })
368
+ ]));
369
+ }
370
+ };
371
+ export {
372
+ ae as L,
373
+ Se as _,
374
+ G as a,
375
+ J as b,
376
+ K as c,
377
+ fe as d,
378
+ ne as e,
379
+ Ce as f,
380
+ _ as r,
381
+ p as s,
382
+ H as u
383
+ };
@@ -0,0 +1 @@
1
+ "use strict";const e=require("vue"),N=require("./EmptyState-7658d7d6.js"),C=require("./_plugin-vue_export-helper-f246444f.js"),p=require("./Chips-0e5bdd54.js"),V=require("vue-router"),_=require("./IconEdit-1b7b5874.js"),P=require("./index-b41aac19.js"),y=require("./globals-928eb13c.js"),g=P.axios.create({baseURL:process.env.API_URL,withCredentials:!0});g.defaults.withCredentials=!0;const i=e.reactive({all:[],filter:{tags:[],period:""},pagination:{page:1,perPage:18},sort:{current:"popularity",ascending:!1},current:{_id:"",url:"",status:"",name:"",tags:[],owner:{},date:"",views:0,content:[]}});async function f(t={}){t.params=t.params||{},t.params.skip=t.skip||0,t.params.limit=t.limit||9,t.params.tags=t.tags||[],t.period&&(t.params.period=t.period),t.url&&(t.params={url:t.url}),t.category&&(t.params.category=t.category),t.organization&&(t.params.organization=t.organization),t.owner&&(t.params.owner=t.owner),t.creator&&(t.params.creator=t.creator),t.status&&(t.params.status=t.status),t.user&&(t.params.user=t.user),t.params.skip=t.skip||0,t.params.limit=t.limit||10;try{console.log("Request params:"+t.params);const r=await g.get("/api/blog/read",{params:t.params});return t.url?m(r.data,"current"):m(r.data,"all"),Promise.resolve(r.data)}catch(r){return y.setError(r),Promise.reject(r)}}async function b(t){return g.post("/api/blog/create",t).then(r=>(m(r.data,"current"),Promise.resolve(r.data)),r=>(y.setError(r),Promise.reject(r)))}async function v(t){return g.post("/api/blog/update",t).then(r=>(m(r.data,"current"),Promise.resolve(r.data)),r=>(y.setError(r),Promise.reject(r)))}async function h(t){return await g.delete(`/api/blog/delete/${t}`).then(r=>{const a=i.all.findIndex(s=>s._id===t);return a!==-1&&i.all.splice(a,1),Promise.resolve(r.data)},r=>(y.setError(r),Promise.reject(r)))}function m(t,r){i[r]=t}function B(){i.current={_id:"",url:"",status:"",name:"",tags:[],author:"",owner:"",date:"",views:0,content:[]}}function S(t){const r={order:i.project.content.length+1,type:t.type,data:t.data,class:t.class,content:t.content};i.project.content.push(r)}e.watch(i,(t,r)=>{});const $=Object.freeze(Object.defineProperty({__proto__:null,blockAdd:S,clean:B,create:b,read:f,remove:h,set:m,state:i,update:v},Symbol.toStringTag,{value:"Module"})),R={props:{progress:{type:Number,default:null},status:{type:String,default:null}}},T={class:"circular-loader"},j=e.createElementVNode("svg",{viewBox:"25 25 50 50"},[e.createElementVNode("circle",{cx:"50",cy:"50",r:"20",fill:"none","stroke-width":"4","stroke-miterlimit":"10"})],-1),D={key:0,class:"progress-text"},q={key:1,class:"uppercase t-semi w-m-10r status-text"};function z(t,r,a,s,n,l){return e.openBlock(),e.createElementBlock("div",T,[j,a.progress?(e.openBlock(),e.createElementBlock("div",D,e.toDisplayString(a.progress),1)):e.createCommentVNode("",!0),a.status?(e.openBlock(),e.createElementBlock("div",q,e.toDisplayString(a.status),1)):e.createCommentVNode("",!0)])}const w=C._export_sfc(R,[["render",z]]),I={class:"t-semi br-top-dark flex-nowrap flex-nojustify flex"},L=e.createElementVNode("span",{class:"mn-r-small mn-l-small d-block"},"·",-1),F={class:"cursor-pointer"},M=e.createElementVNode("span",{class:"mn-r-small mn-l-small d-block"},"·",-1),E={__name:"FooterBlogpost",props:["blogpost","owner","user"],setup(t){const r=t,a=e.ref(r.blogpost.numberOfReactions),s=e.ref(r.blogpost.isReacted),n=e.ref(r.blogpost.reactionId);async function l(u){if(!r.user){alert("Please login to add a reaction");return}try{const o={target:r.blogpost._id,type:"blogpost",user:r.user,class:"like"},d=await p.actions.create(o);d.reaction.class==="like"&&(a.value+=1,s.value=!0,n.value=d.reaction._id)}catch(o){console.error(o),alert("Error adding reaction. Please try again later.")}}async function c(u){if(!r.user){alert("Please login to add a reaction");return}try{const o={_id:n.value};await p.actions.delete(o),a.value-=1,s.value=!1,n.value=null}catch{alert("Error adding reaction. Please try again later.")}}return(u,o)=>(e.openBlock(),e.createElementBlock("footer",I,[e.createTextVNode(" 👁️ "+e.toDisplayString(t.blogpost.views)+" ",1),L,e.createElementVNode("div",F,[s.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",{key:0,class:"cursor-pointer",onClick:o[0]||(o[0]=d=>l())}," 👍 "+e.toDisplayString(a.value),1)),s.value?(e.openBlock(),e.createElementBlock("div",{key:1,class:"cursor-pointer",onClick:o[1]||(o[1]=d=>c())}," 👍 "+e.toDisplayString(a.value),1)):e.createCommentVNode("",!0)]),M,e.createTextVNode(" 💬 "+e.toDisplayString(t.blogpost.numberOfComments),1)]))}},O={class:"pos-relative bg-grey radius-big"},U=["src"],A={class:"pd-t-zero pd-medium"},H={key:0,class:"cursor-pointer mn-thin flex-nowrap flex w-100"},G={key:0,class:"pd-micro t-white uppercase t-semi p-small flex-center flex pd-r-small pd-l-small mn-l-thin w-min bg-second radius-extra"},J={key:1,class:"mn-small t-transp p-big"},K={key:2,class:"mn-small h2"},x={__name:"CardBlogpost",props:["blogpost","user","type"],setup(t){const r=t,a=V.useRouter(),s=e.computed(()=>r.blogpost.content.find(l=>l.type==="ImageUpload")),n=e.computed(()=>r.blogpost.content.find(l=>l.type==="Textarea"));return(l,c)=>(e.openBlock(),e.createElementBlock("article",O,[t.user===t.blogpost.creator.target._id?(e.openBlock(),e.createBlock(_.IconEdit,{key:0,onClick:c[0]||(c[0]=e.withModifiers(u=>l.$router.push({name:"Edit BlogPost",params:{url:t.blogpost.url}}),["stop"])),class:"z-index-2 pos-absolute pos-t-regular pos-r-regular i-regular t-transp"})):e.createCommentVNode("",!0),e.createVNode(p._sfc_main,{class:e.normalizeClass({"mn-small pd-medium":t.type!=="short","flex-child-order-last flex-child mn-l-small":t.type==="short"}),entity:t.blogpost,entityType:"blogpost",user:t.user,owner:t.blogpost.owner,creator:t.blogpost.creator,date:t.blogpost.createdAt},null,8,["class","entity","user","owner","creator","date"]),e.unref(s)&&e.unref(s).content&&t.type!=="blogpostPage"?(e.openBlock(),e.createElementBlock("img",{key:1,src:(l.FILE_SERVER_URL||"")+e.unref(s).content,alt:"Blog post image",class:"mn-medium object-fit-cover w-100 h-20r"},null,8,U)):e.createCommentVNode("",!0),e.createElementVNode("section",A,[t.type!=="blogpostPage"?(e.openBlock(),e.createElementBlock("div",H,[e.createElementVNode("h3",{onClick:c[1]||(c[1]=u=>e.unref(a).push({name:"BlogPost",params:{url:t.blogpost.url}})),class:""},e.toDisplayString(t.blogpost.name),1),t.blogpost.status==="draft"?(e.openBlock(),e.createElementBlock("div",G,e.toDisplayString(t.blogpost.status),1)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.unref(n)&&e.unref(n).content&&t.type!=="blogpostPage"?(e.openBlock(),e.createElementBlock("p",J,e.toDisplayString(e.unref(n).content.slice(0,120))+"... ",1)):e.createCommentVNode("",!0),t.type==="blogpostPage"?(e.openBlock(),e.createElementBlock("h3",K,e.toDisplayString(t.blogpost.name),1)):e.createCommentVNode("",!0),e.renderSlot(l.$slots,"default"),t.type!=="short"&&t.blogpost.tags.length>0?(e.openBlock(),e.createBlock(p._sfc_main$1,{key:3,chips:t.blogpost.tags},null,8,["chips"])):e.createCommentVNode("",!0)]),e.createVNode(E,{class:"pd-t-zero pd-medium",blogpost:t.blogpost,user:t.user},null,8,["blogpost","user"])]))}},Q={class:"feed"},W={key:1},X={__name:"Feed",props:{category:{type:String,default:null},owner:{type:String,default:null},creator:{type:String,default:null},status:{type:String,default:"published"},user:{type:[String,Number],default:null},period:{type:String,default:null}},setup(t){const r=t,a=e.ref([]),s=e.ref(!0);let n=e.ref(!0),l=e.ref(0),c=e.ref(7);const u=async()=>{if(s.value){l.value+=c.value;const o=await f({skip:l.value,limit:c.value,category:r.category,user:r.user,owner:r.owner,creator:r.creator,status:r.status,period:r.period});o.length===0&&(s.value=!1),a.value=[...a.value,...o]}};return e.onMounted(async()=>{const o=await f({skip:l.value,limit:c.value,category:r.category,user:r.user,owner:r.owner,status:r.status,creator:r.creator,period:r.period});o.length===0?s.value=!1:s.value=!0,a.value=o,n.value=!1}),(o,d)=>(e.openBlock(),e.createElementBlock("section",Q,[e.createVNode(e.Transition,{name:"scaleTransition"},{default:e.withCtx(()=>[e.unref(n)?(e.openBlock(),e.createBlock(w,{key:0,class:"z-index-5 pos-t-50 left-t-50 pos-absolute"})):e.createCommentVNode("",!0)]),_:1}),e.createVNode(e.Transition,{name:"scaleTransition"},{default:e.withCtx(()=>[!e.unref(n)&&a.value.length<1?(e.openBlock(),e.createBlock(N._sfc_main,{key:0,title:"No Blog Posts Found",description:"Currently, there are no posts available in this blog. Please check back later.",class:"pd-medium mn-thin bg-grey radius-big"})):(e.openBlock(),e.createElementBlock("div",W,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.value,k=>(e.openBlock(),e.createBlock(x,{key:k._id,blogpost:k,user:t.user,class:"mn-medium"},null,8,["blogpost","user"]))),128)),e.createVNode(e.Transition,{name:"scaleTransition"},{default:e.withCtx(()=>[s.value&&a.value.length>0?(e.openBlock(),e.createElementBlock("button",{key:0,onClick:u,class:"w-100 bg-main button"}," Load more ")):e.createCommentVNode("",!0)]),_:1})]))]),_:1})]))}};exports.Loader=w;exports._sfc_main=X;exports._sfc_main$1=x;exports._sfc_main$2=E;exports.blogposts=$;exports.clean=B;exports.create=b;exports.read=f;exports.remove=h;exports.state=i;exports.update=v;
@@ -0,0 +1 @@
1
+ "use strict";const e=require("vue"),N=require("./EmptyState-7658d7d6.js"),C=require("./Chips-0e5bdd54.js"),V=require("./IconEdit-1b7b5874.js"),D=require("vue-router"),U=require("./_plugin-vue_export-helper-f246444f.js"),$=require("./index-b41aac19.js"),h=require("./globals-928eb13c.js"),z={key:0,class:"o-hidden pos-relative bg-grey mn-small w-100"},P=["src"],M=["src"],I={class:"w-max mn-r-thin pd-thin radius-small t-semi bg-main"},F={key:0,class:"t-semi"},L={class:"t-semi"},R={key:0,class:"t-semi uppercase"},O={key:1,class:"cursor-pointer mn-thin flex-nowrap flex w-100"},q={key:0,class:""},_={key:1,class:"pd-micro t-white uppercase t-semi p-small flex-center flex pd-r-small pd-l-small mn-l-thin w-min bg-second radius-extra"},j={key:2,class:"mn-small p-big"},b={__name:"CardEvent",props:["event","user","short","type"],setup(t){const r=t;e.ref(new Date),D.useRouter(),e.computed(()=>r.event.content.find(a=>a.type.name==="ImageUpload")),e.computed(()=>r.event.content.find(a=>a.type.name==="Textarea"));const s=e.computed(()=>{const a=new Date,c=Date.UTC(a.getUTCFullYear(),a.getUTCMonth(),a.getUTCDate(),a.getUTCHours(),a.getUTCMinutes(),a.getUTCSeconds()),n=new Date(r.event.date.start),o=Date.UTC(n.getUTCFullYear(),n.getUTCMonth(),n.getUTCDate(),n.getUTCHours(),n.getUTCMinutes(),n.getUTCSeconds())-c;if(o<0)return"Finished";if(o===0)return"Starting Now";{const f=Math.floor(o/1e3),g=Math.floor(f/60),k=Math.floor(g/60),w=Math.floor(k/24);return w>0?`${w} days until event`:k>0?`${k} hours until event`:g>0?`${g} minutes until event`:`${f} seconds until event`}}),l=e.computed(()=>{const a=new Date(r.event.date.start),c={day:"2-digit",month:"2-digit"};return a.toLocaleDateString(void 0,c)}),i=e.computed(()=>{console.log(r.event.date.start),console.log(r.event.date.end);const a=new Date(r.event.date.start),c=new Date(r.event.date.end),n=new Intl.DateTimeFormat(void 0,{hour:"2-digit",minute:"2-digit",hourCycle:"h23"}).format(a),p=new Intl.DateTimeFormat(void 0,{hour:"2-digit",minute:"2-digit",hourCycle:"h23"}).format(c);return`${n}-${p}`}),d=e.computed(()=>{const a=r.event.name;return a.length>26?`${a.substring(0,22)}…`:a});return(a,c)=>(e.openBlock(),e.createElementBlock("article",{class:e.normalizeClass([{"flex-nowrap flex-v-center flex":t.type==="short"},"pos-relative"])},[e.createVNode(C._sfc_main,{class:e.normalizeClass({"mn-small pd-medium":t.type!=="short","flex-child-order-last flex-child mn-l-small":t.type==="short"}),entity:t.event,entityType:"event",user:t.user,owner:t.event.owner,creator:t.event.creator,members:t.event.numberOfTickets,membersPhotos:t.event.participantsPhotos,type:t.type,dateFormatted:e.unref(s)},null,8,["class","entity","user","owner","creator","members","membersPhotos","type","dateFormatted"]),t.event.cover&&t.type!=="short"?(e.openBlock(),e.createElementBlock("div",z,[e.createElementVNode("img",{src:(a.FILE_SERVER_URL||"")+t.event.cover,alt:"Event image",class:"pos-relative z-index-1 d-block mn-auto h-20r"},null,8,P),e.createElementVNode("img",{src:(a.FILE_SERVER_URL||"")+t.event.cover,alt:"Event Background",class:"z-index-0 pos-absolute w-100 h-100 pos-t-0 pos-r-0",style:{transform:"scale(1.5)",filter:"blur(2rem)","-webkit-filter":"blur(2rem)"}},null,8,M)])):e.createCommentVNode("",!0),e.createElementVNode("section",{class:e.normalizeClass(["pos-relative w-100",{"pd-t-zero pd-medium":t.type!=="short"}])},[t.user===t.event.creator.target._id?(e.openBlock(),e.createBlock(V.IconEdit,{key:0,onClick:c[0]||(c[0]=e.withModifiers(n=>a.$router.push({name:"Edit Event",params:{url:t.event.url}}),["stop"])),class:"z-index-2 pos-absolute pos-t-regular pos-r-regular i-regular t-transp"})):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass([{"mn-small":t.type!=="short"},"flex-v-center flex-nowrap flex"])},[e.createElementVNode("div",I,[t.type!=="short"?(e.openBlock(),e.createElementBlock("span",F,e.toDisplayString(e.unref(l))+" | ",1)):e.createCommentVNode("",!0),e.createElementVNode("span",L,e.toDisplayString(e.unref(i)),1)]),t.type==="short"?(e.openBlock(),e.createElementBlock("span",R,e.toDisplayString(e.unref(d)),1)):e.createCommentVNode("",!0)],2),t.type!=="short"?(e.openBlock(),e.createElementBlock("div",O,[t.type!=="short"?(e.openBlock(),e.createElementBlock("h3",q,e.toDisplayString(t.event.name),1)):e.createCommentVNode("",!0),t.event.status==="draft"?(e.openBlock(),e.createElementBlock("div",_,e.toDisplayString(t.event.status),1)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),t.type!=="short"?(e.openBlock(),e.createElementBlock("p",j,e.toDisplayString(t.event.description),1)):e.createCommentVNode("",!0),e.renderSlot(a.$slots,"default"),t.type!=="short"&&t.event.tags.length>0?(e.openBlock(),e.createBlock(C._sfc_main$1,{key:3,chips:t.event.tags},null,8,["chips"])):e.createCommentVNode("",!0)],2)],2))}},H={},G={width:"100%",height:"20rem",xmlns:"http://www.w3.org/2000/svg"},Y=e.createStaticVNode('<rect x="0" y="0" rx="5" ry="5" width="100%" height="100%" fill="rgb(var(--grey))"></rect><rect x="15" y="15" rx="4" ry="4" width="40%" height="20" fill="rgba(var(--black),0.05)"></rect><rect x="15" y="45" rx="5" ry="5" width="70%" height="50" fill="rgba(var(--black),0.05)"></rect><rect x="15" y="110" rx="3" ry="3" width="90%" height="6" fill="rgba(var(--black),0.05)"></rect><rect x="15" y="130" rx="3" ry="3" width="70%" height="6" fill="rgba(var(--black),0.05)"></rect><rect x="-25%" y="0" width="25%" height="100%" fill="#fff" mask="url(#myMask)" opacity="0.3"><animate attributeName="x" from="-25%" to="100%" dur="2s" repeatCount="indefinite"></animate></rect>',6),A=[Y];function J(t,r){return e.openBlock(),e.createElementBlock("svg",G,A)}const E=U._export_sfc(H,[["render",J]]),y=$.axios.create({baseURL:process.env.API_URL,withCredentials:!0}),u=e.reactive({all:[],filter:{tags:[],period:"",date:null},pagination:{page:1,perPage:18},sort:{current:"popularity",ascending:!1},current:{_id:"",cover:"",url:"",status:"",name:"",tags:[],date:{start:null,false:null},views:0,content:[]}});async function v(t={}){t.params=t.params||{},t.params.skip=t.skip||0,t.params.limit=t.limit||9,t.params.tags=t.tags||[],t.status&&(t.params={status:t.status}),t.url&&(t.params={url:t.url}),t.period&&(t.params.period=t.period),t.category&&(t.params.category=t.category),t.organization&&(t.params.organization=t.organization),t.date&&(t.params.date=t.date),t.participant&&(t.params.participant=t.participant),t.owner&&(t.params.owner=t.owner),t.creator&&(t.params.creator=t.creator),t.user&&(t.params.user=t.user),t.sortOrder&&(t.params.sortOrder=t.sortOrder),t.sortParam&&(t.params.sortParam=t.sortParam),t.params.skip=t.skip||0,t.params.limit=t.limit||10;try{console.log("Request params:"+t.params);const r=await y.get("/api/events/read",{params:t.params});return console.log(t.params),t.url?m(r.data,"current"):m(r.data,"all"),Promise.resolve(r.data)}catch(r){return h.setError(r),Promise.reject(r)}}async function x(t){return y.post("/api/events/create",t).then(r=>(m(r.data,"current"),Promise.resolve(r.data)),r=>(h.setError(r),Promise.reject(r)))}async function B(t){return y.post("/api/events/update",t).then(r=>(m(r.data,"current"),Promise.resolve(r.data)),r=>(h.setError(r),Promise.reject(r)))}async function T(t){return await y.post("/api/events/delete",{_id:t}).then(r=>{const s=u.all.findIndex(l=>l._id===t);return s!==-1&&u.all.splice(s,1),Promise.resolve(r.data)},r=>(h.setError(r),Promise.reject(r)))}function m(t,r){u[r]=t}function S(){u.current={_id:"",cover:"",url:"",status:"",name:"",tags:[],date:{start:null,false:null},views:0,content:[]}}e.watch(u,(t,r)=>{});const K=Object.freeze(Object.defineProperty({__proto__:null,clean:S,create:x,read:v,remove:T,set:m,state:u,update:B},Symbol.toStringTag,{value:"Module"})),Q={class:"feed"},W={__name:"Feed",props:{category:{type:String,default:null},selectedDate:{type:String,default:null},organization:{type:String,default:null},owner:{type:String,default:null},creator:{type:String,default:null},user:{type:[String,Number],default:null},sortOrder:{type:String,default:"desc"},participant:{type:String,default:null},period:{type:String,default:null},status:{type:String,default:null}},setup(t){const r=t,s=e.ref([]),l=e.ref(!1),i=e.ref(!0),d=e.ref(0),a=e.ref(20),c=async()=>{if(l.value){d.value+=a.value;const n=await v({skip:d.value,limit:a.value,category:r.category,sortOrder:r.sortOrder,participant:r.participant,creator:r.creator,user:r.user,date:r.selectedDate,owner:r.owner,organization:r.organization,period:r.period,status:r.status});n.length===0?l.value=!1:l.value=!0,s.value=[...s.value,...n]}};return e.onMounted(async()=>{i.value=!0,console.log(r.selectedDate);const n=await v({skip:d.value,limit:a.value,category:r.category,participant:r.participant,sortOrder:r.sortOrder,user:r.user,owner:r.owner,creator:r.creator,date:r.selectedDate,organization:r.organization,period:r.period,status:r.status});n.length===0?l.value=!1:l.value=!0,s.value=n,i.value=!1}),(n,p)=>(e.openBlock(),e.createElementBlock("section",Q,[e.createVNode(e.TransitionGroup,{tag:"ul",name:"scaleTransition",class:"o-hidden bg-grey radius-big"},{default:e.withCtx(()=>[i.value?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(a.value,o=>(e.openBlock(),e.createBlock(E,{key:o}))),128)):e.createCommentVNode("",!0)]),_:1}),e.createVNode(e.Transition,{name:"scaleTransition"},{default:e.withCtx(()=>[!i.value&&s.value.length<1?(e.openBlock(),e.createBlock(N._sfc_main,{key:0,title:"No Events Found",description:"Currently, there are no events available. Please check back later.",class:"pd-medium mn-thin bg-grey radius-big"})):e.createCommentVNode("",!0)]),_:1}),e.createVNode(e.TransitionGroup,{tag:"ul",name:"scaleTransition",class:"container"},{default:e.withCtx(()=>[!i.value&&s.value.length>0?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:0},e.renderList(s.value,(o,f)=>(e.openBlock(),e.createBlock(b,{onClick:g=>n.$router.push({name:"Event",params:{url:o.url}}),key:o._id,event:o,user:t.user,type:"normal",class:e.normalizeClass(["bg-grey radius-big mn-medium",{"br-b br-solid br-black-transp-10":f!==s.value.length-1}])},null,8,["onClick","event","user","class"]))),128)):e.createCommentVNode("",!0),l.value&&s.value.length>0?(e.openBlock(),e.createElementBlock("button",{key:1,onClick:c,class:"w-100 bg-main button"},"Load more")):e.createCommentVNode("",!0)]),_:1})]))}};exports.SkeletonEvent=E;exports._sfc_main=W;exports._sfc_main$1=b;exports.clean=S;exports.create=x;exports.events=K;exports.read=v;exports.remove=T;exports.state=u;exports.update=B;
@@ -0,0 +1 @@
1
+ "use strict";const e=require("vue"),m=require("./_plugin-vue_export-helper-f246444f.js"),f=require("vue-router"),w=require("vue-i18n"),y=require("./Button-2ca405bd.js"),b=require("./Select-3ca5ab39.js"),C=require("./reports-270f69df.js"),k=require("./click-outside-0b0727d1.js"),x=require("./index-b41aac19.js"),u=require("./globals-928eb13c.js"),L={},P={width:"26",height:"26",viewBox:"0 0 26 26",fill:"none",xmlns:"http://www.w3.org/2000/svg"},$=e.createElementVNode("rect",{width:"24",height:"24",transform:"translate(1 1)"},null,-1),E=e.createElementVNode("path",{fill:"rgb(var(--black))","fill-rule":"evenodd","clip-rule":"evenodd",d:"M12.9996 10.8L22.8994 0.900244L25.0993 3.1002L15.1995 13L25.0993 22.8998L22.8994 25.0998L12.9996 15.2L3.09976 25.0998L0.899801 22.8998L10.7996 13L0.899801 3.1002L3.09976 0.900244L12.9996 10.8Z"},null,-1),V=[$,E];function N(r,t){return e.openBlock(),e.createElementBlock("svg",P,V)}const S=m._export_sfc(L,[["render",N]]);const B={key:"popup-content",class:"pd-small popup-wrapper"},h={__name:"Popup",props:{isPopupOpen:{type:Boolean,default:!1},style:String},emits:["close-popup"],setup(r,{emit:t}){const s=r;function l(){t("close-popup")}e.watch(()=>s.isPopupOpen,i=>{i?document.body.classList.add("no-scroll"):document.body.classList.remove("no-scroll")}),f.useRoute(),f.useRouter();const n={messages:{en:{},ru:{}}};return w.useI18n(n),(i,o)=>r.isPopupOpen?(e.openBlock(),e.createBlock(e.Teleport,{key:0,to:"body"},[e.createVNode(e.Transition,{name:"TransitionTranslateY",appear:""},{default:e.withCtx(()=>[r.isPopupOpen?(e.openBlock(),e.createElementBlock("div",B,[e.createVNode(e.Transition,{name:"TransitionTranslateY",mode:"out-in"},{default:e.withCtx(()=>[r.isPopupOpen?(e.openBlock(),e.createElementBlock("section",e.mergeProps({key:0,class:"pos-relative z-index-4"},i.$attrs),[e.createElementVNode("button",{onClick:o[0]||(o[0]=a=>l()),class:"pd-regular hover-scale-1 z-index-5 button-close-popup button"},[e.createVNode(S)]),e.renderSlot(i.$slots,"default")],16)):e.createCommentVNode("",!0)]),_:3}),e.createElementVNode("div",{onClick:o[1]||(o[1]=a=>l()),class:e.normalizeClass([{active:r.isPopupOpen===!0},"color-overlay z-index-3"])},null,2)])):e.createCommentVNode("",!0)]),_:3})])):e.createCommentVNode("",!0)}},O={},q={viewBox:"0 0 42 42",fill:"none",xmlns:"http://www.w3.org/2000/svg"},T=e.createElementVNode("circle",{fill:"rgb(var(--main))",cx:"21",cy:"21",r:"21"},null,-1),R=e.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),M=[T,R];function I(r,t){return e.openBlock(),e.createElementBlock("svg",q,M)}const j=m._export_sfc(O,[["render",I]]),D=e.createElementVNode("h3",{class:"mn-small"}," Report Content ",-1),Z=e.createElementVNode("p",{class:"p-medium mn-small"}," We strive to maintain a safe and comfortable environment for all users. If you encounter content that you believe violates our guidelines, please report it: ",-1),z=e.createElementVNode("p",{class:"p-medium mn-small"},"Our moderators will review your report within 24 hours and take action if it violates our policies.",-1),U={__name:"FormReport",props:{user:{type:String,required:!1},type:{type:String,required:!1},reason:{type:String,required:!1},target:{type:String,required:!0},text:{type:String,default:"!"},status:{type:String,default:"new"}},setup(r){const t=r,s=e.reactive({user:t.user,type:t.type,reason:t.reason,target:t.target,status:t.status});function l(){s.user===null&&delete s.user,C.actions.create(s)}const n=e.ref(!1);function i(){n.value=!0}function o(){n.value=!1}return(a,p)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",{onClick:p[0]||(p[0]=_=>i())},[e.renderSlot(a.$slots,"default")]),e.createVNode(h,{onClosePopup:o,isPopupOpen:n.value,class:"w-m-33r t-left pd-big bg-white radius-big"},{default:e.withCtx(()=>[D,Z,e.createVNode(b.Select,{select:s.reason,"onUpdate:select":p[1]||(p[1]=_=>s.reason=_),options:["harassment","spam","inappropriate","misinformation","copyright","other"],placeholder:"Select reason",class:"mn-small bg-white br-solid br-black-transp br-1px uppercase pd-medium t-semi bg-white t-black radius-medium"},null,8,["select"]),z,e.createVNode(y._sfc_main,{submit:l,callback:o,class:"w-100 bg-black t-white"},{default:e.withCtx(()=>[e.createTextVNode(" Report ")]),_:1})]),_:1},8,["isPopupOpen"])],64))}};const A={__name:"Dropdown",props:{label:{type:String,default:"Open"},align:{type:String,default:"left"}},setup(r){let t=k.clickOutside;const s=e.ref(!1);function l(){s.value=!1}return(n,i)=>e.withDirectives((e.openBlock(),e.createElementBlock("div",{class:"dropdown pos-relative",onClick:i[0]||(i[0]=e.withModifiers(o=>s.value=!s.value,["stop"]))},[e.createTextVNode(e.toDisplayString(r.label)+" ",1),e.createVNode(e.Transition,{name:"TransitionTranslateY",mode:"out-in"},{default:e.withCtx(()=>[e.withDirectives(e.createElementVNode("div",{style:e.normalizeStyle({left:r.align==="left"?"0":"auto",right:r.align==="right"?"0":"auto"}),class:"dropdown-content w-15r radius-big"},[e.renderSlot(n.$slots,"default",{},void 0,!0)],4),[[e.vShow,s.value]])]),_:3})])),[[e.unref(t),l]])}},H=m._export_sfc(A,[["__scopeId","data-v-5646d77f"]]),d=x.axios.create({baseURL:process.env.API_URL,withCredentials:!0}),c=e.reactive({memberships:[],error:null}),v={async read({user:r,type:t,target:s,role:l}){try{const n=await d.get("/api/memberships",{params:{user:r,type:t,target:s,role:l}});return c.error=null,c.memberships=n.data,Promise.resolve(n.data)}catch(n){return u.setError(n),Promise.reject(n)}},async create(r){try{const t=await d.post("/api/memberships/create",r);return c.error=null,Promise.resolve(t.data)}catch(t){return u.setError(t),Promise.reject(t)}},async update(r){try{const t=await d.post("/api/memberships/update",r);return c.error=null,Promise.resolve(t.data)}catch(t){return u.setError(t),Promise.reject(t)}},async delete(r){try{const t=await d.post("/api/memberships/delete",r);return c.error=null,Promise.resolve(t.data)}catch(t){return u.setError(t),Promise.reject(t)}}},g={handleMembershipUpdate(r,t,s,l,n,i){let o;if(Array.isArray(r)?o=r.find(a=>a._id===t.target):typeof r=="object"&&r._id===t.target&&(o=r),o)if(o[n]=s,s)o.memberships.push(t),o[i]+=1;else{const a=o.memberships.findIndex(p=>p._id===t._id);a!==-1&&(o.memberships.splice(a,1),o[i]-=1)}}};e.watch(c,r=>{});const Y=Object.freeze(Object.defineProperty({__proto__:null,actions:v,mutations:g,state:c},Symbol.toStringTag,{value:"Module"})),F={},W={width:"652",height:"652",viewBox:"0 0 652 652",fill:"none",xmlns:"http://www.w3.org/2000/svg"},G=e.createElementVNode("path",{fill:"rgb(var(--black))",d:"M515.693 9.52082C510.095 3.91669 502.49 0.765625 494.563 0.765625C486.635 0.765625 479.036 3.91669 473.432 9.52082L48.7255 434.307C44.8244 438.214 42.0848 443.125 40.8088 448.496L0.939444 615.069C-1.47202 625.168 1.528 635.788 8.86652 643.132C16.2103 650.47 26.8305 653.47 36.9292 651.059L203.516 611.261H203.511C208.88 609.985 213.792 607.246 217.699 603.35L642.485 178.496C648.089 172.892 651.241 165.293 651.241 157.366C651.241 149.439 648.089 141.835 642.485 136.235L515.693 9.52082ZM113.76 453.708L388.307 179.161L472.828 263.682L198.281 538.229L113.76 453.708ZM87.1041 511.5L140.416 564.812L70.3014 581.614L87.1041 511.5ZM515.091 221.793L430.195 136.897L494.184 72.9075L579.08 157.429L515.091 221.793Z"},null,-1),J=[G];function K(r,t){return e.openBlock(),e.createElementBlock("svg",W,J)}const Q=m._export_sfc(F,[["render",K]]);exports.Dropdown=H;exports.IconEdit=Q;exports.PlaceholderUserpic=j;exports._sfc_main=U;exports._sfc_main$1=h;exports.actions=v;exports.memberships=Y;exports.mutations=g;exports.state=c;