@ozdao/prometheus-framework 0.2.103 → 0.2.104

Sign up to get free protection for your applications and to get access to all the features.
Files changed (103) hide show
  1. package/dist/main-CXObXjv-.js +92 -0
  2. package/dist/main-DPsHxX0l.mjs +13633 -0
  3. package/dist/organizations.server.js +14 -3
  4. package/dist/organizations.server.mjs +14 -3
  5. package/dist/prometheus-framework/src/components/Block/Block.vue.cjs +1 -1
  6. package/dist/prometheus-framework/src/components/Block/Block.vue.js +1 -1
  7. package/dist/prometheus-framework/src/components/Feed/Feed.vue.cjs +1 -1
  8. package/dist/prometheus-framework/src/components/Feed/Feed.vue.js +33 -33
  9. package/dist/prometheus-framework/src/components/Popup/Popup.vue.cjs +1 -1
  10. package/dist/prometheus-framework/src/components/Popup/Popup.vue.js +1 -73
  11. package/dist/prometheus-framework/src/components/Popup/Popup.vue2.cjs +1 -1
  12. package/dist/prometheus-framework/src/components/Popup/Popup.vue2.js +73 -1
  13. package/dist/prometheus-framework/src/components/Select/Select.vue.cjs +1 -1
  14. package/dist/prometheus-framework/src/components/Select/Select.vue.js +1 -103
  15. package/dist/prometheus-framework/src/components/Select/Select.vue2.cjs +1 -1
  16. package/dist/prometheus-framework/src/components/Select/Select.vue2.js +103 -1
  17. package/dist/prometheus-framework/src/components/Tooltip/Tooltip.vue.cjs +1 -1
  18. package/dist/prometheus-framework/src/components/Tooltip/Tooltip.vue.js +45 -1
  19. package/dist/prometheus-framework/src/components/Tooltip/Tooltip.vue2.cjs +1 -1
  20. package/dist/prometheus-framework/src/components/Tooltip/Tooltip.vue2.js +1 -45
  21. package/dist/prometheus-framework/src/modules/backoffice/components/pages/Dashboard.vue.cjs +1 -1
  22. package/dist/prometheus-framework/src/modules/backoffice/components/pages/Dashboard.vue.js +1 -1
  23. package/dist/prometheus-framework/src/modules/community/components/layouts/Community.vue.cjs +1 -1
  24. package/dist/prometheus-framework/src/modules/community/components/layouts/Community.vue.js +1 -1
  25. package/dist/prometheus-framework/src/modules/community/components/pages/Community.vue.cjs +1 -1
  26. package/dist/prometheus-framework/src/modules/community/components/pages/Community.vue.js +1 -1
  27. package/dist/prometheus-framework/src/modules/community/components/pages/CreateBlogPost.vue.cjs +1 -1
  28. package/dist/prometheus-framework/src/modules/community/components/pages/CreateBlogPost.vue.js +2 -2
  29. package/dist/prometheus-framework/src/modules/constructor/components/elements/Textarea.vue.cjs +1 -5
  30. package/dist/prometheus-framework/src/modules/constructor/components/elements/Textarea.vue.js +0 -66
  31. package/dist/prometheus-framework/src/modules/constructor/components/elements/Textarea.vue2.cjs +5 -1
  32. package/dist/prometheus-framework/src/modules/constructor/components/elements/Textarea.vue2.js +66 -0
  33. package/dist/prometheus-framework/src/modules/constructor/components/sections/Constructor.vue.cjs +1 -1
  34. package/dist/prometheus-framework/src/modules/constructor/components/sections/Constructor.vue.js +1 -1
  35. package/dist/prometheus-framework/src/modules/events/components/elements/ButtonCheck.vue.cjs +1 -1
  36. package/dist/prometheus-framework/src/modules/events/components/elements/ButtonCheck.vue.js +1 -1
  37. package/dist/prometheus-framework/src/modules/events/components/pages/EditEvent.vue.cjs +1 -1
  38. package/dist/prometheus-framework/src/modules/events/components/pages/EditEvent.vue.js +2 -2
  39. package/dist/prometheus-framework/src/modules/events/components/pages/EditEventTickets.vue.cjs +1 -1
  40. package/dist/prometheus-framework/src/modules/events/components/pages/EditEventTickets.vue.js +1 -1
  41. package/dist/prometheus-framework/src/modules/gallery/components/sections/BackofficeGallery.vue.cjs +1 -1
  42. package/dist/prometheus-framework/src/modules/gallery/components/sections/BackofficeGallery.vue.js +1 -1
  43. package/dist/prometheus-framework/src/modules/gallery/components/sections/GalleryWithCategories.vue.cjs +1 -1
  44. package/dist/prometheus-framework/src/modules/gallery/components/sections/GalleryWithCategories.vue.js +1 -1
  45. package/dist/prometheus-framework/src/modules/globals/components/blocks/CardHeader.vue.cjs +1 -1
  46. package/dist/prometheus-framework/src/modules/globals/components/blocks/CardHeader.vue.js +1 -1
  47. package/dist/prometheus-framework/src/modules/legal/components/pages/Legal.vue.cjs +1 -1
  48. package/dist/prometheus-framework/src/modules/legal/components/pages/Legal.vue.js +1 -1
  49. package/dist/prometheus-framework/src/modules/mobile/components/Menu/Menu.vue.cjs +1 -1
  50. package/dist/prometheus-framework/src/modules/mobile/components/Menu/Menu.vue.js +1 -13
  51. package/dist/prometheus-framework/src/modules/mobile/components/Menu/Menu.vue2.cjs +1 -1
  52. package/dist/prometheus-framework/src/modules/mobile/components/Menu/Menu.vue2.js +13 -1
  53. package/dist/prometheus-framework/src/modules/orders/components/pages/OrderBackoffice.vue.cjs +1 -1
  54. package/dist/prometheus-framework/src/modules/orders/components/pages/OrderBackoffice.vue.js +1 -1
  55. package/dist/prometheus-framework/src/modules/orders/components/pages/OrderCreateBackoffice.vue.cjs +1 -1
  56. package/dist/prometheus-framework/src/modules/orders/components/pages/OrderCreateBackoffice.vue.js +2 -2
  57. package/dist/prometheus-framework/src/modules/orders/components/sections/FormAddCustomer.vue.cjs +1 -1
  58. package/dist/prometheus-framework/src/modules/orders/components/sections/FormAddCustomer.vue.js +1 -1
  59. package/dist/prometheus-framework/src/modules/orders/components/sections/FormCustomerDetails.vue.cjs +1 -1
  60. package/dist/prometheus-framework/src/modules/orders/components/sections/FormCustomerDetails.vue.js +1 -1
  61. package/dist/prometheus-framework/src/modules/orders/components/sections/FormPayment.vue.cjs +1 -1
  62. package/dist/prometheus-framework/src/modules/orders/components/sections/FormPayment.vue.js +1 -1
  63. package/dist/prometheus-framework/src/modules/organizations/components/pages/DepartmentEdit.vue.cjs +1 -1
  64. package/dist/prometheus-framework/src/modules/organizations/components/pages/DepartmentEdit.vue.js +2 -2
  65. package/dist/prometheus-framework/src/modules/organizations/components/pages/Members.vue.cjs +1 -1
  66. package/dist/prometheus-framework/src/modules/organizations/components/pages/Members.vue.js +21 -21
  67. package/dist/prometheus-framework/src/modules/organizations/components/pages/Organization.vue.cjs +1 -1
  68. package/dist/prometheus-framework/src/modules/organizations/components/pages/Organization.vue.js +1 -1
  69. package/dist/prometheus-framework/src/modules/organizations/components/pages/OrganizationEdit.vue.cjs +1 -1
  70. package/dist/prometheus-framework/src/modules/organizations/components/pages/OrganizationEdit.vue.js +2 -2
  71. package/dist/prometheus-framework/src/modules/organizations/components/sections/Documents.vue.cjs +1 -1
  72. package/dist/prometheus-framework/src/modules/organizations/components/sections/Documents.vue.js +1 -1
  73. package/dist/prometheus-framework/src/modules/organizations/components/sections/MembersAdd.vue.cjs +1 -1
  74. package/dist/prometheus-framework/src/modules/organizations/components/sections/MembersAdd.vue.js +1 -1
  75. package/dist/prometheus-framework/src/modules/organizations/components/sections/Organizations.vue.cjs +1 -1
  76. package/dist/prometheus-framework/src/modules/organizations/components/sections/Organizations.vue.js +2 -2
  77. package/dist/prometheus-framework/src/modules/products/components/blocks/CardPosition.vue.cjs +1 -1
  78. package/dist/prometheus-framework/src/modules/products/components/blocks/CardPosition.vue.js +1 -1
  79. package/dist/prometheus-framework/src/modules/products/components/blocks/ImagesThumbnails.vue.cjs +1 -1
  80. package/dist/prometheus-framework/src/modules/products/components/blocks/ImagesThumbnails.vue.js +1 -1
  81. package/dist/prometheus-framework/src/modules/products/components/pages/CategoryEdit.vue.cjs +1 -1
  82. package/dist/prometheus-framework/src/modules/products/components/pages/CategoryEdit.vue.js +1 -1
  83. package/dist/prometheus-framework/src/modules/products/components/pages/EditLeftover.vue.cjs +1 -1
  84. package/dist/prometheus-framework/src/modules/products/components/pages/EditLeftover.vue.js +2 -2
  85. package/dist/prometheus-framework/src/modules/products/components/pages/ProductEdit.vue.cjs +1 -1
  86. package/dist/prometheus-framework/src/modules/products/components/pages/ProductEdit.vue.js +1 -1
  87. package/dist/prometheus-framework/src/modules/products/components/sections/EditProductInfo.vue.cjs +1 -1
  88. package/dist/prometheus-framework/src/modules/products/components/sections/EditProductInfo.vue.js +1 -1
  89. package/dist/prometheus-framework/src/modules/reports/components/sections/FormReport.vue.cjs +1 -1
  90. package/dist/prometheus-framework/src/modules/reports/components/sections/FormReport.vue.js +2 -2
  91. package/dist/prometheus-framework/src/modules/users/components/pages/Profile.vue.cjs +1 -1
  92. package/dist/prometheus-framework/src/modules/users/components/pages/Profile.vue.js +1 -1
  93. package/dist/prometheus-framework/src/modules/wallet/views/components/pages/Wallet.vue.cjs +1 -1
  94. package/dist/prometheus-framework/src/modules/wallet/views/components/pages/Wallet.vue.js +3 -3
  95. package/dist/prometheus-framework.cjs.js +1 -1
  96. package/dist/prometheus-framework.es.js +1 -1
  97. package/dist/style.css +1 -1
  98. package/dist/web-BNKN7kk3.mjs +54 -0
  99. package/dist/web-Douq6xn6.js +1 -0
  100. package/package.json +1 -1
  101. package/src/components/Feed/Feed.vue +2 -0
  102. package/src/modules/organizations/components/pages/Members.vue +1 -1
  103. package/src/modules/organizations/controllers/memberships.controller.js +22 -10
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue");require("../../../constructor/components/elements/Textarea.vue2.cjs");const B=require("../../../constructor/components/sections/Constructor.vue.cjs"),T=require("../../../../../node_modules/@vuepic/vue-datepicker/dist/vue-datepicker.cjs");require("../../../../../node_modules/@vuepic/vue-datepicker/dist/main.css.cjs");const k=require("../../../../components/Block/Block.vue.cjs"),C=require("../../../../components/Popup/Popup.vue.cjs"),n=require("../../../../components/Field/Field.vue2.cjs"),P=require("../../../../components/FieldTags/BlockTags.vue.cjs"),V=require("../../../../components/Checkbox/Checkbox.vue.cjs"),_=require("../../../../components/SelectMulti/SelectMulti.vue.cjs"),f=require("../../../../components/Upload/Upload.vue.cjs"),b=require("../../../../components/UploadImage/UploadImage.vue.cjs"),L=require("../../../../components/EditImages/EditImages.vue.cjs"),q=require("../../../../components/Button/Button.vue2.cjs"),N=require("../../../icons/navigation/IconDelete.vue.cjs"),D=require("vue-router"),u=require("../../store/events.cjs"),i=require("../../../auth/store/auth.cjs"),M=require("../../../organizations/store/organizations.cjs");require("./EditEvent.vue2.cjs");const O={key:0,class:"h-100 pd-thin"},R={class:"mn-b-thin radius-small w-100 h-10r bg-grey flex-center flex-column flex"},S=e.createElementVNode("h4",null,"Upload Event Cover",-1),F={key:0,class:"mn-b-small"},G={key:2,class:"mn-b-small"},I={key:4,class:"mn-b-semi"},A=e.createElementVNode("h4",{class:"mn-b-thin"}," Hero Section ",-1),z=e.createElementVNode("h5",{class:"mn-b-thin"}," Video in Hero Section ",-1),H=e.createElementVNode("p",null,"Need to upload in webm format because of needs of optimization",-1),$=e.createElementVNode("h5",{class:"mn-b-thin"}," Ticket ",-1),Y={class:"mn-b-small gap-small cols-2-fit-content"},j={class:"gap-thin flex-nowrap flex w-100"},J=e.createElementVNode("hr",{class:"bg-black-transp-10 mn-b-semi mn-t-semi d-block"},null,-1),K=e.createElementVNode("h4",{class:"mn-b-thin"}," Guest Section ",-1),Q={class:"gap-thin cols-3"},W=e.createElementVNode("h5",{class:"mn-b-thin"}," Video in Guests Section ",-1),X={class:"gap-thin flex-nowrap flex w-100"},Z={class:"w-100"},ee={class:"radius-small h-100 i-big flex-center flex aspect-1x1 bg-red"},te=e.createElementVNode("hr",{class:"bg-black-transp-10 mn-b-semi mn-t-semi d-block"},null,-1),le=e.createElementVNode("h4",{class:"mn-b-thin"}," Lineup Section ",-1),ae={class:"radius-small h-100 i-big flex-center flex aspect-1x1 bg-red"},se=e.createElementVNode("h5",{class:"mn-b-thin"}," Background in Lineup Section ",-1),ne=e.createElementVNode("hr",{class:"bg-black-transp-10 mn-b-semi mn-t-semi d-block"},null,-1),ie=e.createElementVNode("h4",{class:"mn-b-thin"}," Previous Party Section ",-1),oe=e.createElementVNode("h5",{class:"mn-b-thin"}," Video in Previous Partys Section ",-1),re=e.createElementVNode("h3",{class:"mn-b-small"},"Date",-1),de=e.createElementVNode("h3",{class:"mn-b-small"},"Description",-1),ue={key:5,class:"pd-b-extra w-100 bg-grey pd-big radius-big"},ce={key:6,class:"pd-thin pos-sticky pos-l-0 pos-b-0 w-100"},pe={class:"pd-thin radius-big bg-main w-100 flex-nowrap flex"},me=e.createElementVNode("h3",{class:"mn-b-small"},"Final Touches",-1),fe=e.createElementVNode("h5",{class:"mn-b-thin"},"Add to public:",-1),ge={key:0,class:"mn-b-thin"},be={key:1,class:"mn-b-medium br-grey br-2px br-solid pd-small radius-big"},he={__name:"EditEvent",setup(ve){const p=D.useRoute(),m=D.useRouter();let t=e.ref(null),h=e.ref(null);const v=e.ref([]),o=e.ref(null),r=e.ref(new Date);e.onMounted(async()=>{if(p.params.url){const a=await u.read({user:i.state.user._id,url:p.params.url});t.value=a.pop(),console.log(t.value);const l=t.value.date.start,c=t.value.date.end;r.value=[l,c]}else{u.clean(),t.value=u.state.current;const a=new Date,l=new Date;r.value=[a,l]}t.value.owner||(t.value.owner={target:i.state.user._id,type:"user"}),t.value.creator||(t.value.creator={target:i.state.user._id,type:"user",hidden:!1}),t.value.owner.type==="organization"&&(o.value={_id:t.value.owner.target._id,name:t.value.owner.target.profile.name,photo:t.value.owner.target.profile.photo});const s=await M.actions.read({user:i.state.user._id,postable:i.state.user._id,limit:100});h.value=s.map(a=>({name:a.profile.name,_id:a._id,photo:a.profile.photo}))});const g=e.ref(!1);function w(){g.value=!0}function y(){g.value=!1}function E(){v.value.length>0&&v.value.map(s=>s.text),t.value.status="draft",t.value.date={start:r.value[0],end:r.value[1]},p.params.url?u.update(t.value).then(s=>{m.push({name:"Event",params:{url:s.url}})}).catch(s=>{console.error(s)}):u.create(t.value).then(s=>{m.push({name:"Event",params:{url:s.url}})}).catch(s=>{console.error(s)})}function U(){o.value&&(t.value.owner={target:o.value._id,type:"organization"}),o.value||(t.value.creator.hidden=!1),o.value||(t.value.organization=t.value.creator),t.value.status="published",t.value.date={start:r.value[0],end:r.value[1]},console.log(r.value),p.params.url?(console.log(t.value),u.update(t.value).then(s=>{m.push({name:"Event",params:{url:s.url}})}).catch(s=>{console.log(s)})):u.create(t.value).then(s=>{m.push({name:"Event",params:{url:s.url}})}).catch(s=>{console.log(s)})}function x(){confirm("Are you sure you want to delete this event?")&&u.remove(t.value._id).then(s=>{m.push({name:"User Events",params:{_id:t.value.creator.target._id}})}).catch(s=>{console.error(s)})}return(s,a)=>e.unref(t)?(e.openBlock(),e.createElementBlock("article",O,[e.createElementVNode("div",R,[e.createVNode(b.default,{photo:e.unref(t).cover,"onUpdate:photo":a[0]||(a[0]=l=>e.unref(t).cover=l),uploadPath:"specials",class:"h-4r w-4r aspect-1x1 o-hidden mn-b-thin radius-extra"},null,8,["photo"]),S]),e.createVNode(n.default,{field:e.unref(t).name,"onUpdate:field":a[1]||(a[1]=l=>e.unref(t).name=l),placeholder:"Event name",class:"mn-b-thin w-100 bg-grey pd-medium radius-small"},null,8,["field"]),e.createVNode(n.default,{field:e.unref(t).description,"onUpdate:field":a[2]||(a[2]=l=>e.unref(t).description=l),type:"textfield",placeholder:"Enter short description",class:"mn-b-semi w-100 bg-grey pd-medium radius-small"},null,8,["field"]),i.state.access.roles&&(i.state.access.roles.includes("ROLE_MODERATOR")||i.state.access.roles.includes("ROLE_ADMIN"))?(e.openBlock(),e.createElementBlock("h3",F," Tickets ")):e.createCommentVNode("",!0),i.state.access.roles&&(i.state.access.roles.includes("ROLE_MODERATOR")||i.state.access.roles.includes("ROLE_ADMIN"))?(e.openBlock(),e.createElementBlock("div",{key:1,class:"mn-b-semi w-100 bg-grey pd-medium radius-small",onClick:a[3]||(a[3]=l=>e.unref(m).push({name:"Edit Event Tickets",params:{url:e.unref(p).params.url}}))}," Edit tickets ")):e.createCommentVNode("",!0),i.state.access.roles&&(i.state.access.roles.includes("ROLE_MODERATOR")||i.state.access.roles.includes("ROLE_ADMIN"))?(e.openBlock(),e.createElementBlock("h3",G," Special Details ")):e.createCommentVNode("",!0),i.state.access.roles&&(i.state.access.roles.includes("ROLE_MODERATOR")||i.state.access.roles.includes("ROLE_ADMIN"))?(e.openBlock(),e.createBlock(V.default,{key:3,label:"Special",radio:e.unref(t).special,"onUpdate:radio":a[4]||(a[4]=l=>e.unref(t).special=!e.unref(t).special),class:"mn-b-semi w-100 bg-black t-white pd-medium radius-small"},null,8,["radio"])):e.createCommentVNode("",!0),e.unref(t).special?(e.openBlock(),e.createElementBlock("div",I,[A,e.createVNode(n.default,{field:e.unref(t).specialData.subtitle,"onUpdate:field":a[5]||(a[5]=l=>e.unref(t).specialData.subtitle=l),placeholder:"Event subtitle",class:"mn-b-thin w-100 bg-grey pd-medium radius-small"},null,8,["field"]),e.createVNode(L.default,{images:e.unref(t).specialData.logos,uploadPath:"/specials",text:{title:"Drag & Drop Your Logos Here",subtitle:"Files supported: JPG, PNG, GIF"},options:{showTitle:!0,showText:!1},"onUpdate:images":a[6]||(a[6]=l=>e.unref(t).specialData.logos=l),class:"mn-b-thin bg-grey radius-small"},null,8,["images"]),z,H,e.createVNode(f.default,{field:e.unref(t).specialData.video,"onUpdate:field":a[7]||(a[7]=l=>e.unref(t).specialData.video=l),placeholder:"Upload video",onFileChange:a[8]||(a[8]=l=>e.unref(t).specialData.video=l),uploadPath:"specials",type:"file",class:"mn-b-thin w-100 bg-grey pd-medium radius-small t-black"},null,8,["field"]),$,e.createElementVNode("div",Y,[e.createVNode(b.default,{photo:e.unref(t).specialData.ticketImage,"onUpdate:photo":a[9]||(a[9]=l=>e.unref(t).specialData.ticketImage=l),uploadPath:"/specials",class:"aspect-1x1 w-4r o-hidden radius-extra"},null,8,["photo"]),e.createElementVNode("div",j,[e.createVNode(n.default,{field:e.unref(t).specialData.ticketPrice,"onUpdate:field":a[10]||(a[10]=l=>e.unref(t).specialData.ticketPrice=l),type:"number",placeholder:"Ticket price in baht",class:"mn-b-thin w-100 bg-grey pd-medium radius-small"},null,8,["field"]),e.createVNode(n.default,{field:e.unref(t).specialData.ticketText,"onUpdate:field":a[11]||(a[11]=l=>e.unref(t).specialData.ticketText=l),placeholder:"Promotion text for ticket in hero ",class:"w-100 bg-grey radius-small pd-medium"},null,8,["field"]),e.createVNode(n.default,{field:e.unref(t).specialData.ticketTextButton,"onUpdate:field":a[12]||(a[12]=l=>e.unref(t).specialData.ticketTextButton=l),placeholder:"Text on 'Buy Ticket' button ",class:"w-100 bg-grey radius-small pd-medium"},null,8,["field"])])]),J,K,e.createVNode(n.default,{field:e.unref(t).specialData.guestTitle,"onUpdate:field":a[13]||(a[13]=l=>e.unref(t).specialData.guestTitle=l),placeholder:"Title for Main Guest section",class:"mn-b-thin w-100 bg-grey pd-medium radius-small"},null,8,["field"]),e.createVNode(n.default,{field:e.unref(t).specialData.guestDescription,"onUpdate:field":a[14]||(a[14]=l=>e.unref(t).specialData.guestDescription=l),placeholder:"Description for Main Guest section",class:"mn-b-thin w-100 bg-grey pd-medium radius-small"},null,8,["field"]),e.createElementVNode("div",Q,[e.createVNode(n.default,{field:e.unref(t).specialData.guestFacebook,"onUpdate:field":a[15]||(a[15]=l=>e.unref(t).specialData.guestFacebook=l),placeholder:"Facebook of Main Guest",class:"mn-b-thin w-100 bg-grey pd-medium radius-small"},null,8,["field"]),e.createVNode(n.default,{field:e.unref(t).specialData.guestInstagram,"onUpdate:field":a[16]||(a[16]=l=>e.unref(t).specialData.guestInstagram=l),placeholder:"Instagram of Main Guest",class:"mn-b-thin w-100 bg-grey pd-medium radius-small"},null,8,["field"]),e.createVNode(n.default,{field:e.unref(t).specialData.guestTwitter,"onUpdate:field":a[17]||(a[17]=l=>e.unref(t).specialData.guestTwitter=l),placeholder:"Twitter of Main Guest",class:"mn-b-thin w-100 bg-grey pd-medium radius-small"},null,8,["field"]),e.createVNode(n.default,{field:e.unref(t).specialData.guestTelegram,"onUpdate:field":a[18]||(a[18]=l=>e.unref(t).specialData.guestTelegram=l),placeholder:"Telegram of Main Guest",class:"mn-b-thin w-100 bg-grey pd-medium radius-small"},null,8,["field"]),e.createVNode(n.default,{field:e.unref(t).specialData.guestSoundcloud,"onUpdate:field":a[19]||(a[19]=l=>e.unref(t).specialData.guestSoundcloud=l),placeholder:"Link to Main Guest soundcloud track",class:"mn-b-thin w-100 bg-grey pd-medium radius-small"},null,8,["field"]),e.createVNode(n.default,{field:e.unref(t).specialData.guestSpotify,"onUpdate:field":a[20]||(a[20]=l=>e.unref(t).specialData.guestSpotify=l),placeholder:"Link to Main guest spotify track",class:"mn-b-thin w-100 bg-grey pd-medium radius-small"},null,8,["field"]),e.createVNode(n.default,{field:e.unref(t).specialData.guestYoutube,"onUpdate:field":a[21]||(a[21]=l=>e.unref(t).specialData.guestYoutube=l),placeholder:"Link to Main guest youtube video",class:"mn-b-thin w-100 bg-grey pd-medium radius-small"},null,8,["field"])]),W,e.createVNode(f.default,{field:e.unref(t).specialData.guestVideo,"onUpdate:field":a[22]||(a[22]=l=>e.unref(t).specialData.guestVideo=l),placeholder:"Upload video",onFileChange:a[23]||(a[23]=l=>e.unref(t).specialData.guestVideo=l),uploadPath:"/specials",type:"file",class:"mn-b-thin w-100 bg-grey pd-medium radius-small t-black"},null,8,["field"]),e.createVNode(k.default,{title:"Guests",placeholder:"No guests added yet",actions:[{label:"+",function:()=>e.unref(t).specialData.guests.push({name:null,description:null,photo:null,main:!1})}],class:"cols-1 mn-b-thin t-black gap-thin"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(t).specialData.guests,(l,c)=>(e.openBlock(),e.createElementBlock("div",{class:"mn-b-small gap-small cols-2-fit-content",key:c},[e.createVNode(b.default,{photo:l.photo,"onUpdate:photo":d=>l.photo=d,uploadPath:"/specials",class:"aspect-1x1 w-8r o-hidden radius-extra"},null,8,["photo","onUpdate:photo"]),e.createElementVNode("div",X,[e.createElementVNode("div",Z,[e.createVNode(n.default,{field:l.name,"onUpdate:field":d=>l.name=d,placeholder:"Name",class:"w-100 mn-b-thin bg-white radius-small pd-medium"},null,8,["field","onUpdate:field"]),e.createVNode(n.default,{field:l.description,"onUpdate:field":d=>l.description=d,placeholder:"Description",class:"w-100 mn-b-thin bg-white radius-small pd-medium"},null,8,["field","onUpdate:field"])]),e.createElementVNode("div",ee,[e.createVNode(N.default,{onClick:()=>e.unref(t).specialData.guests.splice(c,1),class:"i-medium"},null,8,["onClick"])])])]))),128))]),_:1},8,["actions"]),te,le,e.createVNode(k.default,{title:"Line Up",placeholder:"No line ups added yet",actions:[{label:"+",function:()=>e.unref(t).specialData.lineup.push({name:null,description:null,photo:null,main:!1})}],class:"cols-1 t-black gap-thin"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(t).specialData.lineup,(l,c)=>(e.openBlock(),e.createElementBlock("div",{class:"mn-b-thin gap-small flex-nowrap flex",key:c},[e.createVNode(n.default,{field:l.name,"onUpdate:field":d=>l.name=d,placeholder:"Name",class:"w-100 bg-grey radius-small pd-medium"},null,8,["field","onUpdate:field"]),e.createVNode(n.default,{field:l.time,"onUpdate:field":d=>l.time=d,placeholder:"Time",class:"w-100 bg-grey radius-small pd-medium"},null,8,["field","onUpdate:field"]),e.createElementVNode("div",ae,[e.createVNode(N.default,{onClick:()=>e.unref(t).specialData.lineup.splice(c,1),class:"i-medium"},null,8,["onClick"])])]))),128))]),_:1},8,["actions"]),se,e.createVNode(f.default,{field:e.unref(t).specialData.lineupBackground,"onUpdate:field":a[24]||(a[24]=l=>e.unref(t).specialData.lineupBackground=l),placeholder:"Upload image",onFileChange:a[25]||(a[25]=l=>e.unref(t).specialData.lineupBackground=l),uploadPath:"/specials",type:"file",class:"mn-b-thin w-100 bg-grey pd-medium radius-small t-black"},null,8,["field"]),ne,ie,oe,e.createVNode(n.default,{field:e.unref(t).specialData.previousTitle,"onUpdate:field":a[26]||(a[26]=l=>e.unref(t).specialData.previousTitle=l),placeholder:"Title",value:"Explore our exclusive party archive",class:"w-100 bg-grey radius-small pd-medium"},null,8,["field"]),e.createVNode(n.default,{field:e.unref(t).specialData.previousDescription,"onUpdate:field":a[27]||(a[27]=l=>e.unref(t).specialData.previousDescription=l),label:"Description",value:"Experience the ultimate party vibe at The Commune! Elevate your evening with distinctive and exhilarating activities, ensuring an unforgettable time. Dive into the excitement and make every moment special.",class:"w-100 bg-grey radius-small pd-medium"},null,8,["field"]),e.createVNode(n.default,{field:e.unref(t).specialData.previousLinkText,"onUpdate:field":a[28]||(a[28]=l=>e.unref(t).specialData.previousLinkText=l),label:"Button",value:"Check In Instagram",class:"w-100 bg-grey radius-small pd-medium"},null,8,["field"]),e.createVNode(n.default,{field:e.unref(t).specialData.previousLink,"onUpdate:field":a[29]||(a[29]=l=>e.unref(t).specialData.previousLink=l),label:"Link",value:"https://www.instagram.com/thecommune.phuket/",class:"w-100 bg-grey radius-small pd-medium"},null,8,["field"]),e.createVNode(f.default,{field:e.unref(t).specialData.previousVideo,"onUpdate:field":a[30]||(a[30]=l=>e.unref(t).specialData.previousVideo=l),placeholder:"Upload image",onFileChange:a[31]||(a[31]=l=>e.unref(t).specialData.previousVideo=l),uploadPath:"/specials",type:"file",class:"mn-b-thin w-100 bg-grey pd-medium radius-small t-black"},null,8,["field"])])):e.createCommentVNode("",!0),re,e.createVNode(e.unref(T.default),{modelValue:r.value,"onUpdate:modelValue":a[32]||(a[32]=l=>r.value=l),range:"",class:"z-index-3 mn-b-semi"},null,8,["modelValue"]),de,e.unref(t)?(e.openBlock(),e.createElementBlock("section",ue,[e.createVNode(B.default,{content:e.unref(t).content,onUpdate:a[33]||(a[33]=l=>e.unref(t).content=l)},null,8,["content"])])):e.createCommentVNode("",!0),e.unref(t)?(e.openBlock(),e.createElementBlock("section",ce,[e.createElementVNode("div",pe,[e.unref(p).params.url?(e.openBlock(),e.createElementBlock("a",{key:0,onClick:a[34]||(a[34]=l=>x()),class:"mn-r-auto bg-red t-white t-black button"},"Delete")):e.createCommentVNode("",!0),e.createElementVNode("a",{onClick:a[35]||(a[35]=l=>E()),class:"mn-l-auto bg-white t-black button"},"To Drafts"),e.createElementVNode("a",{onClick:a[36]||(a[36]=l=>w()),class:"mn-l-thin bg-black t-white button"},"Publish")])])):e.createCommentVNode("",!0),e.createVNode(C.default,{title:"Добавить участника",onClosePopup:y,isPopupOpen:g.value,class:"w-m-33r t-left pd-big bg-white radius-big"},{default:e.withCtx(()=>[me,e.createVNode(P.default,{onTagsChanged:a[37]||(a[37]=l=>e.unref(t).tags=l),tags:e.unref(t).tags},null,8,["tags"]),fe,e.createVNode(_.default,{modelValue:o.value,"onUpdate:modelValue":a[38]||(a[38]=l=>o.value=l),options:e.unref(h),multiple:!1,taggable:!1,placeholder:"Type to search or add tag",label:"name","track-by":"_id",class:"mn-b-medium bg-grey radius-medium pd-small"},null,8,["modelValue","options"]),o.value?(e.openBlock(),e.createElementBlock("h5",ge,"Options:")):e.createCommentVNode("",!0),o.value?(e.openBlock(),e.createElementBlock("div",be,[e.createVNode(V.default,{label:"Hide Author",radio:e.unref(t).creator.hidden,"onUpdate:radio":a[39]||(a[39]=l=>e.unref(t).creator.hidden=l),name:"prices",class:"w-100"},null,8,["radio"])])):e.createCommentVNode("",!0),e.createVNode(q.default,{submit:U,callback:s.redirectTo,class:"w-100 bg-black t-white"},{default:e.withCtx(()=>[e.createTextVNode("Publish")]),_:1},8,["callback"])]),_:1},8,["isPopupOpen"])])):e.createCommentVNode("",!0)}};exports.default=he;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue");require("../../../constructor/components/elements/Textarea.vue.cjs");const B=require("../../../constructor/components/sections/Constructor.vue.cjs"),T=require("../../../../../node_modules/@vuepic/vue-datepicker/dist/vue-datepicker.cjs");require("../../../../../node_modules/@vuepic/vue-datepicker/dist/main.css.cjs");const k=require("../../../../components/Block/Block.vue.cjs"),C=require("../../../../components/Popup/Popup.vue2.cjs"),n=require("../../../../components/Field/Field.vue2.cjs"),P=require("../../../../components/FieldTags/BlockTags.vue.cjs"),V=require("../../../../components/Checkbox/Checkbox.vue.cjs"),_=require("../../../../components/SelectMulti/SelectMulti.vue.cjs"),f=require("../../../../components/Upload/Upload.vue.cjs"),b=require("../../../../components/UploadImage/UploadImage.vue.cjs"),L=require("../../../../components/EditImages/EditImages.vue.cjs"),q=require("../../../../components/Button/Button.vue2.cjs"),N=require("../../../icons/navigation/IconDelete.vue.cjs"),D=require("vue-router"),u=require("../../store/events.cjs"),i=require("../../../auth/store/auth.cjs"),M=require("../../../organizations/store/organizations.cjs");require("./EditEvent.vue2.cjs");const O={key:0,class:"h-100 pd-thin"},R={class:"mn-b-thin radius-small w-100 h-10r bg-grey flex-center flex-column flex"},S=e.createElementVNode("h4",null,"Upload Event Cover",-1),F={key:0,class:"mn-b-small"},G={key:2,class:"mn-b-small"},I={key:4,class:"mn-b-semi"},A=e.createElementVNode("h4",{class:"mn-b-thin"}," Hero Section ",-1),z=e.createElementVNode("h5",{class:"mn-b-thin"}," Video in Hero Section ",-1),H=e.createElementVNode("p",null,"Need to upload in webm format because of needs of optimization",-1),$=e.createElementVNode("h5",{class:"mn-b-thin"}," Ticket ",-1),Y={class:"mn-b-small gap-small cols-2-fit-content"},j={class:"gap-thin flex-nowrap flex w-100"},J=e.createElementVNode("hr",{class:"bg-black-transp-10 mn-b-semi mn-t-semi d-block"},null,-1),K=e.createElementVNode("h4",{class:"mn-b-thin"}," Guest Section ",-1),Q={class:"gap-thin cols-3"},W=e.createElementVNode("h5",{class:"mn-b-thin"}," Video in Guests Section ",-1),X={class:"gap-thin flex-nowrap flex w-100"},Z={class:"w-100"},ee={class:"radius-small h-100 i-big flex-center flex aspect-1x1 bg-red"},te=e.createElementVNode("hr",{class:"bg-black-transp-10 mn-b-semi mn-t-semi d-block"},null,-1),le=e.createElementVNode("h4",{class:"mn-b-thin"}," Lineup Section ",-1),ae={class:"radius-small h-100 i-big flex-center flex aspect-1x1 bg-red"},se=e.createElementVNode("h5",{class:"mn-b-thin"}," Background in Lineup Section ",-1),ne=e.createElementVNode("hr",{class:"bg-black-transp-10 mn-b-semi mn-t-semi d-block"},null,-1),ie=e.createElementVNode("h4",{class:"mn-b-thin"}," Previous Party Section ",-1),oe=e.createElementVNode("h5",{class:"mn-b-thin"}," Video in Previous Partys Section ",-1),re=e.createElementVNode("h3",{class:"mn-b-small"},"Date",-1),de=e.createElementVNode("h3",{class:"mn-b-small"},"Description",-1),ue={key:5,class:"pd-b-extra w-100 bg-grey pd-big radius-big"},ce={key:6,class:"pd-thin pos-sticky pos-l-0 pos-b-0 w-100"},pe={class:"pd-thin radius-big bg-main w-100 flex-nowrap flex"},me=e.createElementVNode("h3",{class:"mn-b-small"},"Final Touches",-1),fe=e.createElementVNode("h5",{class:"mn-b-thin"},"Add to public:",-1),ge={key:0,class:"mn-b-thin"},be={key:1,class:"mn-b-medium br-grey br-2px br-solid pd-small radius-big"},he={__name:"EditEvent",setup(ve){const p=D.useRoute(),m=D.useRouter();let t=e.ref(null),h=e.ref(null);const v=e.ref([]),o=e.ref(null),r=e.ref(new Date);e.onMounted(async()=>{if(p.params.url){const a=await u.read({user:i.state.user._id,url:p.params.url});t.value=a.pop(),console.log(t.value);const l=t.value.date.start,c=t.value.date.end;r.value=[l,c]}else{u.clean(),t.value=u.state.current;const a=new Date,l=new Date;r.value=[a,l]}t.value.owner||(t.value.owner={target:i.state.user._id,type:"user"}),t.value.creator||(t.value.creator={target:i.state.user._id,type:"user",hidden:!1}),t.value.owner.type==="organization"&&(o.value={_id:t.value.owner.target._id,name:t.value.owner.target.profile.name,photo:t.value.owner.target.profile.photo});const s=await M.actions.read({user:i.state.user._id,postable:i.state.user._id,limit:100});h.value=s.map(a=>({name:a.profile.name,_id:a._id,photo:a.profile.photo}))});const g=e.ref(!1);function w(){g.value=!0}function y(){g.value=!1}function E(){v.value.length>0&&v.value.map(s=>s.text),t.value.status="draft",t.value.date={start:r.value[0],end:r.value[1]},p.params.url?u.update(t.value).then(s=>{m.push({name:"Event",params:{url:s.url}})}).catch(s=>{console.error(s)}):u.create(t.value).then(s=>{m.push({name:"Event",params:{url:s.url}})}).catch(s=>{console.error(s)})}function U(){o.value&&(t.value.owner={target:o.value._id,type:"organization"}),o.value||(t.value.creator.hidden=!1),o.value||(t.value.organization=t.value.creator),t.value.status="published",t.value.date={start:r.value[0],end:r.value[1]},console.log(r.value),p.params.url?(console.log(t.value),u.update(t.value).then(s=>{m.push({name:"Event",params:{url:s.url}})}).catch(s=>{console.log(s)})):u.create(t.value).then(s=>{m.push({name:"Event",params:{url:s.url}})}).catch(s=>{console.log(s)})}function x(){confirm("Are you sure you want to delete this event?")&&u.remove(t.value._id).then(s=>{m.push({name:"User Events",params:{_id:t.value.creator.target._id}})}).catch(s=>{console.error(s)})}return(s,a)=>e.unref(t)?(e.openBlock(),e.createElementBlock("article",O,[e.createElementVNode("div",R,[e.createVNode(b.default,{photo:e.unref(t).cover,"onUpdate:photo":a[0]||(a[0]=l=>e.unref(t).cover=l),uploadPath:"specials",class:"h-4r w-4r aspect-1x1 o-hidden mn-b-thin radius-extra"},null,8,["photo"]),S]),e.createVNode(n.default,{field:e.unref(t).name,"onUpdate:field":a[1]||(a[1]=l=>e.unref(t).name=l),placeholder:"Event name",class:"mn-b-thin w-100 bg-grey pd-medium radius-small"},null,8,["field"]),e.createVNode(n.default,{field:e.unref(t).description,"onUpdate:field":a[2]||(a[2]=l=>e.unref(t).description=l),type:"textfield",placeholder:"Enter short description",class:"mn-b-semi w-100 bg-grey pd-medium radius-small"},null,8,["field"]),i.state.access.roles&&(i.state.access.roles.includes("ROLE_MODERATOR")||i.state.access.roles.includes("ROLE_ADMIN"))?(e.openBlock(),e.createElementBlock("h3",F," Tickets ")):e.createCommentVNode("",!0),i.state.access.roles&&(i.state.access.roles.includes("ROLE_MODERATOR")||i.state.access.roles.includes("ROLE_ADMIN"))?(e.openBlock(),e.createElementBlock("div",{key:1,class:"mn-b-semi w-100 bg-grey pd-medium radius-small",onClick:a[3]||(a[3]=l=>e.unref(m).push({name:"Edit Event Tickets",params:{url:e.unref(p).params.url}}))}," Edit tickets ")):e.createCommentVNode("",!0),i.state.access.roles&&(i.state.access.roles.includes("ROLE_MODERATOR")||i.state.access.roles.includes("ROLE_ADMIN"))?(e.openBlock(),e.createElementBlock("h3",G," Special Details ")):e.createCommentVNode("",!0),i.state.access.roles&&(i.state.access.roles.includes("ROLE_MODERATOR")||i.state.access.roles.includes("ROLE_ADMIN"))?(e.openBlock(),e.createBlock(V.default,{key:3,label:"Special",radio:e.unref(t).special,"onUpdate:radio":a[4]||(a[4]=l=>e.unref(t).special=!e.unref(t).special),class:"mn-b-semi w-100 bg-black t-white pd-medium radius-small"},null,8,["radio"])):e.createCommentVNode("",!0),e.unref(t).special?(e.openBlock(),e.createElementBlock("div",I,[A,e.createVNode(n.default,{field:e.unref(t).specialData.subtitle,"onUpdate:field":a[5]||(a[5]=l=>e.unref(t).specialData.subtitle=l),placeholder:"Event subtitle",class:"mn-b-thin w-100 bg-grey pd-medium radius-small"},null,8,["field"]),e.createVNode(L.default,{images:e.unref(t).specialData.logos,uploadPath:"/specials",text:{title:"Drag & Drop Your Logos Here",subtitle:"Files supported: JPG, PNG, GIF"},options:{showTitle:!0,showText:!1},"onUpdate:images":a[6]||(a[6]=l=>e.unref(t).specialData.logos=l),class:"mn-b-thin bg-grey radius-small"},null,8,["images"]),z,H,e.createVNode(f.default,{field:e.unref(t).specialData.video,"onUpdate:field":a[7]||(a[7]=l=>e.unref(t).specialData.video=l),placeholder:"Upload video",onFileChange:a[8]||(a[8]=l=>e.unref(t).specialData.video=l),uploadPath:"specials",type:"file",class:"mn-b-thin w-100 bg-grey pd-medium radius-small t-black"},null,8,["field"]),$,e.createElementVNode("div",Y,[e.createVNode(b.default,{photo:e.unref(t).specialData.ticketImage,"onUpdate:photo":a[9]||(a[9]=l=>e.unref(t).specialData.ticketImage=l),uploadPath:"/specials",class:"aspect-1x1 w-4r o-hidden radius-extra"},null,8,["photo"]),e.createElementVNode("div",j,[e.createVNode(n.default,{field:e.unref(t).specialData.ticketPrice,"onUpdate:field":a[10]||(a[10]=l=>e.unref(t).specialData.ticketPrice=l),type:"number",placeholder:"Ticket price in baht",class:"mn-b-thin w-100 bg-grey pd-medium radius-small"},null,8,["field"]),e.createVNode(n.default,{field:e.unref(t).specialData.ticketText,"onUpdate:field":a[11]||(a[11]=l=>e.unref(t).specialData.ticketText=l),placeholder:"Promotion text for ticket in hero ",class:"w-100 bg-grey radius-small pd-medium"},null,8,["field"]),e.createVNode(n.default,{field:e.unref(t).specialData.ticketTextButton,"onUpdate:field":a[12]||(a[12]=l=>e.unref(t).specialData.ticketTextButton=l),placeholder:"Text on 'Buy Ticket' button ",class:"w-100 bg-grey radius-small pd-medium"},null,8,["field"])])]),J,K,e.createVNode(n.default,{field:e.unref(t).specialData.guestTitle,"onUpdate:field":a[13]||(a[13]=l=>e.unref(t).specialData.guestTitle=l),placeholder:"Title for Main Guest section",class:"mn-b-thin w-100 bg-grey pd-medium radius-small"},null,8,["field"]),e.createVNode(n.default,{field:e.unref(t).specialData.guestDescription,"onUpdate:field":a[14]||(a[14]=l=>e.unref(t).specialData.guestDescription=l),placeholder:"Description for Main Guest section",class:"mn-b-thin w-100 bg-grey pd-medium radius-small"},null,8,["field"]),e.createElementVNode("div",Q,[e.createVNode(n.default,{field:e.unref(t).specialData.guestFacebook,"onUpdate:field":a[15]||(a[15]=l=>e.unref(t).specialData.guestFacebook=l),placeholder:"Facebook of Main Guest",class:"mn-b-thin w-100 bg-grey pd-medium radius-small"},null,8,["field"]),e.createVNode(n.default,{field:e.unref(t).specialData.guestInstagram,"onUpdate:field":a[16]||(a[16]=l=>e.unref(t).specialData.guestInstagram=l),placeholder:"Instagram of Main Guest",class:"mn-b-thin w-100 bg-grey pd-medium radius-small"},null,8,["field"]),e.createVNode(n.default,{field:e.unref(t).specialData.guestTwitter,"onUpdate:field":a[17]||(a[17]=l=>e.unref(t).specialData.guestTwitter=l),placeholder:"Twitter of Main Guest",class:"mn-b-thin w-100 bg-grey pd-medium radius-small"},null,8,["field"]),e.createVNode(n.default,{field:e.unref(t).specialData.guestTelegram,"onUpdate:field":a[18]||(a[18]=l=>e.unref(t).specialData.guestTelegram=l),placeholder:"Telegram of Main Guest",class:"mn-b-thin w-100 bg-grey pd-medium radius-small"},null,8,["field"]),e.createVNode(n.default,{field:e.unref(t).specialData.guestSoundcloud,"onUpdate:field":a[19]||(a[19]=l=>e.unref(t).specialData.guestSoundcloud=l),placeholder:"Link to Main Guest soundcloud track",class:"mn-b-thin w-100 bg-grey pd-medium radius-small"},null,8,["field"]),e.createVNode(n.default,{field:e.unref(t).specialData.guestSpotify,"onUpdate:field":a[20]||(a[20]=l=>e.unref(t).specialData.guestSpotify=l),placeholder:"Link to Main guest spotify track",class:"mn-b-thin w-100 bg-grey pd-medium radius-small"},null,8,["field"]),e.createVNode(n.default,{field:e.unref(t).specialData.guestYoutube,"onUpdate:field":a[21]||(a[21]=l=>e.unref(t).specialData.guestYoutube=l),placeholder:"Link to Main guest youtube video",class:"mn-b-thin w-100 bg-grey pd-medium radius-small"},null,8,["field"])]),W,e.createVNode(f.default,{field:e.unref(t).specialData.guestVideo,"onUpdate:field":a[22]||(a[22]=l=>e.unref(t).specialData.guestVideo=l),placeholder:"Upload video",onFileChange:a[23]||(a[23]=l=>e.unref(t).specialData.guestVideo=l),uploadPath:"/specials",type:"file",class:"mn-b-thin w-100 bg-grey pd-medium radius-small t-black"},null,8,["field"]),e.createVNode(k.default,{title:"Guests",placeholder:"No guests added yet",actions:[{label:"+",function:()=>e.unref(t).specialData.guests.push({name:null,description:null,photo:null,main:!1})}],class:"cols-1 mn-b-thin t-black gap-thin"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(t).specialData.guests,(l,c)=>(e.openBlock(),e.createElementBlock("div",{class:"mn-b-small gap-small cols-2-fit-content",key:c},[e.createVNode(b.default,{photo:l.photo,"onUpdate:photo":d=>l.photo=d,uploadPath:"/specials",class:"aspect-1x1 w-8r o-hidden radius-extra"},null,8,["photo","onUpdate:photo"]),e.createElementVNode("div",X,[e.createElementVNode("div",Z,[e.createVNode(n.default,{field:l.name,"onUpdate:field":d=>l.name=d,placeholder:"Name",class:"w-100 mn-b-thin bg-white radius-small pd-medium"},null,8,["field","onUpdate:field"]),e.createVNode(n.default,{field:l.description,"onUpdate:field":d=>l.description=d,placeholder:"Description",class:"w-100 mn-b-thin bg-white radius-small pd-medium"},null,8,["field","onUpdate:field"])]),e.createElementVNode("div",ee,[e.createVNode(N.default,{onClick:()=>e.unref(t).specialData.guests.splice(c,1),class:"i-medium"},null,8,["onClick"])])])]))),128))]),_:1},8,["actions"]),te,le,e.createVNode(k.default,{title:"Line Up",placeholder:"No line ups added yet",actions:[{label:"+",function:()=>e.unref(t).specialData.lineup.push({name:null,description:null,photo:null,main:!1})}],class:"cols-1 t-black gap-thin"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(t).specialData.lineup,(l,c)=>(e.openBlock(),e.createElementBlock("div",{class:"mn-b-thin gap-small flex-nowrap flex",key:c},[e.createVNode(n.default,{field:l.name,"onUpdate:field":d=>l.name=d,placeholder:"Name",class:"w-100 bg-grey radius-small pd-medium"},null,8,["field","onUpdate:field"]),e.createVNode(n.default,{field:l.time,"onUpdate:field":d=>l.time=d,placeholder:"Time",class:"w-100 bg-grey radius-small pd-medium"},null,8,["field","onUpdate:field"]),e.createElementVNode("div",ae,[e.createVNode(N.default,{onClick:()=>e.unref(t).specialData.lineup.splice(c,1),class:"i-medium"},null,8,["onClick"])])]))),128))]),_:1},8,["actions"]),se,e.createVNode(f.default,{field:e.unref(t).specialData.lineupBackground,"onUpdate:field":a[24]||(a[24]=l=>e.unref(t).specialData.lineupBackground=l),placeholder:"Upload image",onFileChange:a[25]||(a[25]=l=>e.unref(t).specialData.lineupBackground=l),uploadPath:"/specials",type:"file",class:"mn-b-thin w-100 bg-grey pd-medium radius-small t-black"},null,8,["field"]),ne,ie,oe,e.createVNode(n.default,{field:e.unref(t).specialData.previousTitle,"onUpdate:field":a[26]||(a[26]=l=>e.unref(t).specialData.previousTitle=l),placeholder:"Title",value:"Explore our exclusive party archive",class:"w-100 bg-grey radius-small pd-medium"},null,8,["field"]),e.createVNode(n.default,{field:e.unref(t).specialData.previousDescription,"onUpdate:field":a[27]||(a[27]=l=>e.unref(t).specialData.previousDescription=l),label:"Description",value:"Experience the ultimate party vibe at The Commune! Elevate your evening with distinctive and exhilarating activities, ensuring an unforgettable time. Dive into the excitement and make every moment special.",class:"w-100 bg-grey radius-small pd-medium"},null,8,["field"]),e.createVNode(n.default,{field:e.unref(t).specialData.previousLinkText,"onUpdate:field":a[28]||(a[28]=l=>e.unref(t).specialData.previousLinkText=l),label:"Button",value:"Check In Instagram",class:"w-100 bg-grey radius-small pd-medium"},null,8,["field"]),e.createVNode(n.default,{field:e.unref(t).specialData.previousLink,"onUpdate:field":a[29]||(a[29]=l=>e.unref(t).specialData.previousLink=l),label:"Link",value:"https://www.instagram.com/thecommune.phuket/",class:"w-100 bg-grey radius-small pd-medium"},null,8,["field"]),e.createVNode(f.default,{field:e.unref(t).specialData.previousVideo,"onUpdate:field":a[30]||(a[30]=l=>e.unref(t).specialData.previousVideo=l),placeholder:"Upload image",onFileChange:a[31]||(a[31]=l=>e.unref(t).specialData.previousVideo=l),uploadPath:"/specials",type:"file",class:"mn-b-thin w-100 bg-grey pd-medium radius-small t-black"},null,8,["field"])])):e.createCommentVNode("",!0),re,e.createVNode(e.unref(T.default),{modelValue:r.value,"onUpdate:modelValue":a[32]||(a[32]=l=>r.value=l),range:"",class:"z-index-3 mn-b-semi"},null,8,["modelValue"]),de,e.unref(t)?(e.openBlock(),e.createElementBlock("section",ue,[e.createVNode(B.default,{content:e.unref(t).content,onUpdate:a[33]||(a[33]=l=>e.unref(t).content=l)},null,8,["content"])])):e.createCommentVNode("",!0),e.unref(t)?(e.openBlock(),e.createElementBlock("section",ce,[e.createElementVNode("div",pe,[e.unref(p).params.url?(e.openBlock(),e.createElementBlock("a",{key:0,onClick:a[34]||(a[34]=l=>x()),class:"mn-r-auto bg-red t-white t-black button"},"Delete")):e.createCommentVNode("",!0),e.createElementVNode("a",{onClick:a[35]||(a[35]=l=>E()),class:"mn-l-auto bg-white t-black button"},"To Drafts"),e.createElementVNode("a",{onClick:a[36]||(a[36]=l=>w()),class:"mn-l-thin bg-black t-white button"},"Publish")])])):e.createCommentVNode("",!0),e.createVNode(C.default,{title:"Добавить участника",onClosePopup:y,isPopupOpen:g.value,class:"w-m-33r t-left pd-big bg-white radius-big"},{default:e.withCtx(()=>[me,e.createVNode(P.default,{onTagsChanged:a[37]||(a[37]=l=>e.unref(t).tags=l),tags:e.unref(t).tags},null,8,["tags"]),fe,e.createVNode(_.default,{modelValue:o.value,"onUpdate:modelValue":a[38]||(a[38]=l=>o.value=l),options:e.unref(h),multiple:!1,taggable:!1,placeholder:"Type to search or add tag",label:"name","track-by":"_id",class:"mn-b-medium bg-grey radius-medium pd-small"},null,8,["modelValue","options"]),o.value?(e.openBlock(),e.createElementBlock("h5",ge,"Options:")):e.createCommentVNode("",!0),o.value?(e.openBlock(),e.createElementBlock("div",be,[e.createVNode(V.default,{label:"Hide Author",radio:e.unref(t).creator.hidden,"onUpdate:radio":a[39]||(a[39]=l=>e.unref(t).creator.hidden=l),name:"prices",class:"w-100"},null,8,["radio"])])):e.createCommentVNode("",!0),e.createVNode(q.default,{submit:U,callback:s.redirectTo,class:"w-100 bg-black t-white"},{default:e.withCtx(()=>[e.createTextVNode("Publish")]),_:1},8,["callback"])]),_:1},8,["isPopupOpen"])])):e.createCommentVNode("",!0)}};exports.default=he;
@@ -1,10 +1,10 @@
1
1
  import { ref as v, onMounted as G, unref as t, openBlock as r, createElementBlock as u, createElementVNode as i, createVNode as s, createCommentVNode as p, createBlock as $, withCtx as D, Fragment as T, renderList as _, createTextVNode as F } from "vue";
2
- import "../../../constructor/components/elements/Textarea.vue2.js";
2
+ import "../../../constructor/components/elements/Textarea.vue.js";
3
3
  import A from "../../../constructor/components/sections/Constructor.vue.js";
4
4
  import B from "../../../../../node_modules/@vuepic/vue-datepicker/dist/vue-datepicker.js";
5
5
  import "../../../../../node_modules/@vuepic/vue-datepicker/dist/main.css.js";
6
6
  import E from "../../../../components/Block/Block.vue.js";
7
- import I from "../../../../components/Popup/Popup.vue.js";
7
+ import I from "../../../../components/Popup/Popup.vue2.js";
8
8
  import n from "../../../../components/Field/Field.vue2.js";
9
9
  import z from "../../../../components/FieldTags/BlockTags.vue.js";
10
10
  import P from "../../../../components/Checkbox/Checkbox.vue.js";
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),y=require("../../../../components/Feed/Feed.vue.cjs"),N=require("../../../../components/Block/Block.vue.cjs"),x=require("../../../../components/Popup/Popup.vue.cjs"),u=require("../../../../components/Field/Field.vue2.cjs"),d=require("../../../../components/Button/Button.vue2.cjs"),V=require("../elements/ButtonCheck.vue.cjs"),q=require("../../../icons/navigation/IconDelete.vue.cjs"),B=require("../../../icons/navigation/IconAdd.vue.cjs"),b=require("vue-router"),E=require("../../store/events.cjs"),C=require("../../../auth/store/auth.cjs");require("../../../organizations/store/organizations.cjs");const m=require("../../store/tickets.cjs");require("./EditEventTickets.vue2.cjs");const T={key:0,class:"h-100 pd-thin"},P={class:"mn-b-medium flex-v-center flex-nowrap flex"},S=e.createElementVNode("h2",{class:"mn-r-medium"},"Tickets",-1),D=["onClick"],U={class:"radius-big bg-grey gap-small pd-medium flex-v-center flex-nowrap flex pos-relative mn-b-thin"},A=["href"],F=["src"],O={class:"mn-r-auto"},M={class:"h4"},R={class:"h5 t-transp mn-b-thin"},I={class:"pd-r-thin pd-l-thin pd-b-nano pd-t-nano bg-second radius-extra t-white t-medium d-block w-max uppercase"},L={__name:"EditEventTickets",setup(Q){var h;const g=b.useRoute();b.useRouter();let n=e.ref(null);const c=e.ref([{name:"",email:"",target:(h=n.value)==null?void 0:h._id,type:"event",quantity:1}]),i=e.ref(!1);function _(r){var l;i.value=!0,c.value=[{name:"",email:"",target:(l=n.value)==null?void 0:l._id,type:"event",quantity:1}]}function p(){i.value=!1}const s=e.ref(!1);e.onMounted(async()=>{const r=await E.read({user:C.state.user._id,url:g.params.url});n.value=r.pop()});async function w(){try{const r=await m.actions.create(c.value);s.value=!s.value}catch(r){console.log(r)}}async function f(r,l){if(confirm("Are you sure you want to deactivate this event?"))try{const t=await m.actions.update({...r,status:l});s.value=!s.value}catch(t){console.error(t)}}return(r,l)=>e.unref(n)?(e.openBlock(),e.createElementBlock("article",T,[e.createElementVNode("header",P,[S,e.createElementVNode("button",{onClick:l[0]||(l[0]=t=>_()),class:"radius-extra uppercase button-small flex-child flex-child-shrink-0 hover-scale-1 cursor-pointer t-white bg-second"}," Add Tickets "),e.createVNode(V.default,{onQrcodecheck:l[1]||(l[1]=t=>s.value=!s.value),class:"w-100 pd-medium mn-auto"})]),e.createVNode(x.default,{title:"Добавить участника",onClosePopup:p,isPopupOpen:i.value,class:"w-max-40r"},{default:e.withCtx(()=>[e.createVNode(N.default,{title:"Add tickets",placeholder:"No parameters added yet",class:"cols-1 mn-b-thin gap-thin"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c.value,(t,a)=>(e.openBlock(),e.createElementBlock("div",{class:"gap-thin flex-nowrap flex",key:a},[e.createVNode(u.default,{field:t.name,"onUpdate:field":o=>t.name=o,placeholder:"Name",class:"w-50 bg-white radius-small pd-medium"},null,8,["field","onUpdate:field"]),e.createVNode(u.default,{field:t.email,"onUpdate:field":o=>t.email=o,placeholder:"Email",class:"w-100 bg-white radius-small pd-medium"},null,8,["field","onUpdate:field"]),e.createVNode(u.default,{field:t.quantity,"onUpdate:field":o=>t.quantity=o,placeholder:"Quantity",type:"number",class:"w-25 bg-white radius-small pd-medium"},null,8,["field","onUpdate:field"]),a<1?(e.openBlock(),e.createElementBlock("div",{key:0,onClick:l[2]||(l[2]=()=>c.value.push({name:"",value:"",target:e.unref(n)._id,type:"event",quantity:1})),class:"radius-small h-100 i-big flex-center flex aspect-1x1 bg-green"},[e.createVNode(B.default,{class:"i-medium",fill:"rgb(var(--white)"})])):(e.openBlock(),e.createElementBlock("div",{key:1,onClick:()=>c.value.splice(a,1),class:"radius-small h-100 i-big flex-center flex aspect-1x1 bg-red"},[e.createVNode(q.default,{class:"i-medium",fill:"rgb(var(--white)"})],8,D))]))),128)),e.createVNode(d.default,{submit:w,callback:p,class:"w-100 bg-black t-white"},{default:e.withCtx(()=>[e.createTextVNode(" Create Tickets ")]),_:1})]),_:1})]),_:1},8,["isPopupOpen"]),e.createVNode(y.default,{search:!0,states:{empty:{title:"No Tickets Found",description:"Currently, there are no tickets."}},store:{read:t=>m.actions.read(t),state:null},options:{target:e.unref(n)._id},external:s.value},{default:e.withCtx(({items:t})=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t,(a,o)=>{var v,k;return e.openBlock(),e.createElementBlock("div",U,[e.createElementVNode("a",{href:a.image,target:"_blank"},[e.createElementVNode("img",{src:a.qrcode,class:"radius-small h-5r w-5r"},null,8,F)],8,A),e.createElementVNode("div",O,[e.createElementVNode("p",M,e.toDisplayString(((v=a.client_refactor)==null?void 0:v.name)||"No name")+", "+e.toDisplayString(a.role),1),e.createElementVNode("p",R,e.toDisplayString(((k=a.client_refactor)==null?void 0:k.email)||"No email"),1),e.createElementVNode("span",I,e.toDisplayString(a.status),1)]),a.status!=="deactivated"?(e.openBlock(),e.createBlock(d.default,{key:0,submit:()=>f(a,"deactivated"),callback:r.redirectTo,class:"w-min h-min pd-small bg-black t-white"},{default:e.withCtx(()=>[e.createTextVNode(" Deactivate ")]),_:2},1032,["submit","callback"])):e.createCommentVNode("",!0),a.status==="deactivated"||a.status==="used"?(e.openBlock(),e.createBlock(d.default,{key:1,submit:()=>f(a,"unused"),callback:r.redirectTo,class:"w-min h-min pd-small bg-green t-white"},{default:e.withCtx(()=>[e.createTextVNode(" Activate ")]),_:2},1032,["submit","callback"])):e.createCommentVNode("",!0)])}),256))]),_:1},8,["store","options","external"])])):e.createCommentVNode("",!0)}};exports.default=L;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),y=require("../../../../components/Feed/Feed.vue.cjs"),N=require("../../../../components/Block/Block.vue.cjs"),x=require("../../../../components/Popup/Popup.vue2.cjs"),u=require("../../../../components/Field/Field.vue2.cjs"),d=require("../../../../components/Button/Button.vue2.cjs"),V=require("../elements/ButtonCheck.vue.cjs"),q=require("../../../icons/navigation/IconDelete.vue.cjs"),B=require("../../../icons/navigation/IconAdd.vue.cjs"),b=require("vue-router"),E=require("../../store/events.cjs"),C=require("../../../auth/store/auth.cjs");require("../../../organizations/store/organizations.cjs");const m=require("../../store/tickets.cjs");require("./EditEventTickets.vue2.cjs");const T={key:0,class:"h-100 pd-thin"},P={class:"mn-b-medium flex-v-center flex-nowrap flex"},S=e.createElementVNode("h2",{class:"mn-r-medium"},"Tickets",-1),D=["onClick"],U={class:"radius-big bg-grey gap-small pd-medium flex-v-center flex-nowrap flex pos-relative mn-b-thin"},A=["href"],F=["src"],O={class:"mn-r-auto"},M={class:"h4"},R={class:"h5 t-transp mn-b-thin"},I={class:"pd-r-thin pd-l-thin pd-b-nano pd-t-nano bg-second radius-extra t-white t-medium d-block w-max uppercase"},L={__name:"EditEventTickets",setup(Q){var h;const g=b.useRoute();b.useRouter();let n=e.ref(null);const c=e.ref([{name:"",email:"",target:(h=n.value)==null?void 0:h._id,type:"event",quantity:1}]),i=e.ref(!1);function _(r){var l;i.value=!0,c.value=[{name:"",email:"",target:(l=n.value)==null?void 0:l._id,type:"event",quantity:1}]}function p(){i.value=!1}const s=e.ref(!1);e.onMounted(async()=>{const r=await E.read({user:C.state.user._id,url:g.params.url});n.value=r.pop()});async function w(){try{const r=await m.actions.create(c.value);s.value=!s.value}catch(r){console.log(r)}}async function f(r,l){if(confirm("Are you sure you want to deactivate this event?"))try{const t=await m.actions.update({...r,status:l});s.value=!s.value}catch(t){console.error(t)}}return(r,l)=>e.unref(n)?(e.openBlock(),e.createElementBlock("article",T,[e.createElementVNode("header",P,[S,e.createElementVNode("button",{onClick:l[0]||(l[0]=t=>_()),class:"radius-extra uppercase button-small flex-child flex-child-shrink-0 hover-scale-1 cursor-pointer t-white bg-second"}," Add Tickets "),e.createVNode(V.default,{onQrcodecheck:l[1]||(l[1]=t=>s.value=!s.value),class:"w-100 pd-medium mn-auto"})]),e.createVNode(x.default,{title:"Добавить участника",onClosePopup:p,isPopupOpen:i.value,class:"w-max-40r"},{default:e.withCtx(()=>[e.createVNode(N.default,{title:"Add tickets",placeholder:"No parameters added yet",class:"cols-1 mn-b-thin gap-thin"},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c.value,(t,a)=>(e.openBlock(),e.createElementBlock("div",{class:"gap-thin flex-nowrap flex",key:a},[e.createVNode(u.default,{field:t.name,"onUpdate:field":o=>t.name=o,placeholder:"Name",class:"w-50 bg-white radius-small pd-medium"},null,8,["field","onUpdate:field"]),e.createVNode(u.default,{field:t.email,"onUpdate:field":o=>t.email=o,placeholder:"Email",class:"w-100 bg-white radius-small pd-medium"},null,8,["field","onUpdate:field"]),e.createVNode(u.default,{field:t.quantity,"onUpdate:field":o=>t.quantity=o,placeholder:"Quantity",type:"number",class:"w-25 bg-white radius-small pd-medium"},null,8,["field","onUpdate:field"]),a<1?(e.openBlock(),e.createElementBlock("div",{key:0,onClick:l[2]||(l[2]=()=>c.value.push({name:"",value:"",target:e.unref(n)._id,type:"event",quantity:1})),class:"radius-small h-100 i-big flex-center flex aspect-1x1 bg-green"},[e.createVNode(B.default,{class:"i-medium",fill:"rgb(var(--white)"})])):(e.openBlock(),e.createElementBlock("div",{key:1,onClick:()=>c.value.splice(a,1),class:"radius-small h-100 i-big flex-center flex aspect-1x1 bg-red"},[e.createVNode(q.default,{class:"i-medium",fill:"rgb(var(--white)"})],8,D))]))),128)),e.createVNode(d.default,{submit:w,callback:p,class:"w-100 bg-black t-white"},{default:e.withCtx(()=>[e.createTextVNode(" Create Tickets ")]),_:1})]),_:1})]),_:1},8,["isPopupOpen"]),e.createVNode(y.default,{search:!0,states:{empty:{title:"No Tickets Found",description:"Currently, there are no tickets."}},store:{read:t=>m.actions.read(t),state:null},options:{target:e.unref(n)._id},external:s.value},{default:e.withCtx(({items:t})=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t,(a,o)=>{var v,k;return e.openBlock(),e.createElementBlock("div",U,[e.createElementVNode("a",{href:a.image,target:"_blank"},[e.createElementVNode("img",{src:a.qrcode,class:"radius-small h-5r w-5r"},null,8,F)],8,A),e.createElementVNode("div",O,[e.createElementVNode("p",M,e.toDisplayString(((v=a.client_refactor)==null?void 0:v.name)||"No name")+", "+e.toDisplayString(a.role),1),e.createElementVNode("p",R,e.toDisplayString(((k=a.client_refactor)==null?void 0:k.email)||"No email"),1),e.createElementVNode("span",I,e.toDisplayString(a.status),1)]),a.status!=="deactivated"?(e.openBlock(),e.createBlock(d.default,{key:0,submit:()=>f(a,"deactivated"),callback:r.redirectTo,class:"w-min h-min pd-small bg-black t-white"},{default:e.withCtx(()=>[e.createTextVNode(" Deactivate ")]),_:2},1032,["submit","callback"])):e.createCommentVNode("",!0),a.status==="deactivated"||a.status==="used"?(e.openBlock(),e.createBlock(d.default,{key:1,submit:()=>f(a,"unused"),callback:r.redirectTo,class:"w-min h-min pd-small bg-green t-white"},{default:e.withCtx(()=>[e.createTextVNode(" Activate ")]),_:2},1032,["submit","callback"])):e.createCommentVNode("",!0)])}),256))]),_:1},8,["store","options","external"])])):e.createCommentVNode("",!0)}};exports.default=L;
@@ -1,7 +1,7 @@
1
1
  import { ref as p, onMounted as B, unref as _, openBlock as i, createElementBlock as o, createElementVNode as r, createVNode as l, withCtx as u, Fragment as $, renderList as q, createTextVNode as v, toDisplayString as f, createBlock as P, createCommentVNode as b } from "vue";
2
2
  import V from "../../../../components/Feed/Feed.vue.js";
3
3
  import F from "../../../../components/Block/Block.vue.js";
4
- import O from "../../../../components/Popup/Popup.vue.js";
4
+ import O from "../../../../components/Popup/Popup.vue2.js";
5
5
  import g from "../../../../components/Field/Field.vue2.js";
6
6
  import w from "../../../../components/Button/Button.vue2.js";
7
7
  import S from "../elements/ButtonCheck.vue.js";
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),I=require("../../../../components/Field/Field.vue2.cjs"),q=require("../../../../components/Button/Button.vue2.cjs"),M=require("../../../../components/Select/Select.vue.cjs"),s=require("../../store/gallery.cjs"),P=require("../../../../components/EditImages/EditImages.vue.cjs");require("./BackofficeGallery.vue2.cjs");const j=require("../../../../../../_virtual/_plugin-vue_export-helper.cjs"),c=i=>(e.pushScopeId("data-v-99e559ad"),i=i(),e.popScopeId(),i),G={class:"pos-relative w-100"},U={class:"mn-b-semi flex-v-center flex-nowrap flex"},D=c(()=>e.createElementVNode("h1",{class:"mn-r-small"},"Manage Gallery",-1)),T=["data-id"],F=["src","onClick"],L={key:1,class:"radius-small bg-white"},R=["src","onClick"],$={class:"t-black p-small mn-b-thin"},O=c(()=>e.createElementVNode("span",{class:"uppercase t-transp"},"Size",-1)),A=c(()=>e.createElementVNode("br",null,null,-1)),H={class:"pd-2px radius-big d-inline-block bg-grey"},J={class:"t-black p-small mn-b-small uppe"},K=c(()=>e.createElementVNode("span",{class:"uppercase t-transp"},"Categories",-1)),Q=c(()=>e.createElementVNode("br",null,null,-1)),W={class:"pd-2px radius-big d-inline-block bg-grey t-semi"},X={class:"flex-nowrap flex"},Y=["onClick"],Z={class:"modal pd-thin"},ee={class:"modal-content radius-big"},te={class:""},le=["src"],ae={key:0,class:"flex-v-center flex m modal pd-big"},oe={class:"modal-content radius-small pd-medium bg-white"},se=["src"],ne=["src"],y=10,ce={__name:"BackofficeGallery",setup(i){const r=e.ref(!0),h=e.ref(null);let v=1,f=e.ref(null),_=e.ref(!1);const d=e.ref([]),E=a=>{d.value=a},V=e.computed(()=>k.value==="all"?s.state.gallery:s.state.gallery.filter(a=>a.categories.includes(k.value))),w=async()=>{_.value=!0,await s.actions.fetchGallery(v,y),_.value=!1},u=e.ref(null),t=e.ref({categories:"",size:"",image:!1}),m=e.ref(null),g=a=>{console.log(r.value),r.value?N(a):(u.value="modal",t.value.image=a,b())},N=a=>{u.value="edit-modal",t.value=a||{categories:"",size:"",image:null},b()},n=()=>{t.value={categories:"",size:"",image:!1},m.value=null,B()},b=()=>{document.body.style.overflow="hidden",document.documentElement.style.overflow="hidden"},B=()=>{document.body.style.overflow="",document.documentElement.style.overflow=""},C=[{name:"Small",value:""},{name:"Regular",value:"grid-item--width1 grid-item--height1"},{name:"Medium",value:"grid-item--width2 grid-item--height2"},{name:"Big",value:"grid-item--width3 grid-item--height3"}],x=async a=>{await s.actions.deletePhoto(a)},S=async()=>{await s.actions.updatePhoto(t.value),n()},z=async a=>{if(d.length<1||!t.value.categories||!t.value.size){console.error("All fields are required.");return}await s.actions.createPhoto({images:d.value,size:t.value.size,categories:typeof t.value.categories=="string"?t.value.categories.split(",").map(o=>o.trim()):t.value.categories}),n()};let k=e.ref("all");return e.onMounted(async()=>{await s.actions.fetchGallery(v,y),typeof window<"u"&&new IntersectionObserver(o=>{o.some(l=>l.isIntersecting)&&(v+=1,w())}).observe(f.value)}),(a,o)=>(e.openBlock(),e.createElementBlock("div",G,[e.createElementVNode("div",U,[D,r.value?(e.openBlock(),e.createElementBlock("button",{key:0,onClick:o[0]||(o[0]=l=>g(null)),class:"t-white t-black bg-second i-big radius-extra"},"+")):e.createCommentVNode("",!0)]),e.createElementVNode("div",{ref_key:"grid",ref:h,class:"cols-4 gap-thin"},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(V.value,(l,re)=>(e.openBlock(),e.createElementBlock("div",{key:l.id,"data-id":l.id},[e.createVNode(e.Transition,{name:"scaleIn",mode:"in-out"},{default:e.withCtx(()=>[!r.value&&h.value?(e.openBlock(),e.createElementBlock("img",{key:0,src:"https://thecommunephuket.com/photos/"+l.cover,class:"w-100 h-100 o-hidden radius-medium object-fit-cover",onClick:p=>g(l.image)},null,8,F)):(e.openBlock(),e.createElementBlock("div",L,[e.createElementVNode("img",{src:"https://thecommunephuket.com/photos/"+l.cover,class:"w-100 radius-small mn-b-small h-10r object-fit-cover",onClick:p=>g(l)},null,8,R),e.createElementVNode("p",$,[O,A,e.createElementVNode("span",H,e.toDisplayString(l.size.name),1)]),e.createElementVNode("p",J,[K,Q,(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.categories,p=>(e.openBlock(),e.createElementBlock("span",W,e.toDisplayString(p),1))),256))]),e.createElementVNode("div",X,[e.createElementVNode("button",{class:"button-small w-100 button",onClick:p=>x(l._id)},"Delete",8,Y)])]))]),_:2},1024)],8,T))),128)),e.createElementVNode("div",{ref_key:"sentinel",ref:f,class:"sentinel"},null,512),e.createVNode(e.Transition,{name:"modal"},{default:e.withCtx(()=>[e.withDirectives(e.createElementVNode("div",Z,[e.createElementVNode("div",ee,[e.createElementVNode("div",te,[e.createElementVNode("span",{class:"close",onClick:n},"×"),e.createElementVNode("img",{src:(a.FILE_SERVER_URL||"")+t.value.image},null,8,le)])])],512),[[e.vShow,t.value.image!==!1&&u.value==="modal"]])]),_:1}),e.createVNode(e.Transition,{name:"modal"},{default:e.withCtx(()=>[t.value.image!==!1&&u.value==="edit-modal"?(e.openBlock(),e.createElementBlock("div",ae,[e.createElementVNode("div",oe,[e.createElementVNode("span",{class:"close",onClick:n},"×"),typeof m.value=="string"?(e.openBlock(),e.createElementBlock("img",{key:0,src:m.value,class:"radius-small w-100 mn-b-small h-20r object-fit-cover"},null,8,se)):e.createCommentVNode("",!0),typeof m.value=="object"&&t.value.image!==null?(e.openBlock(),e.createElementBlock("img",{key:1,class:"radius-small w-100 mn-b-small h-20r object-fit-cover",src:"/photos/"+t.value.cover},null,8,ne)):e.createCommentVNode("",!0),e.createVNode(M.default,{options:C,label:"Size",select:t.value.size,"onUpdate:select":o[1]||(o[1]=l=>t.value.size=l),placeholder:"Select Size",class:"bg-grey pd-thin radius-small mn-b-thin t-black"},null,8,["select"]),e.createVNode(I.default,{field:t.value.categories,"onUpdate:field":o[2]||(o[2]=l=>t.value.categories=l),type:"text",label:"Categories",placeholder:"Enter categories for image (comma separated)",class:"bg-grey pd-thin radius-small mn-b-medium t-black"},null,8,["field"]),e.createVNode(P.default,{images:d.value,"onUpdate:images":E,uploadPath:"photos",class:"mn-b-semi"},null,8,["images"]),e.createVNode(q.default,{submit:t.value._id?S:z,callback:n,class:"mn-b-thin"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.value._id?"Update":"Create"),1)]),_:1},8,["submit"])])])):e.createCommentVNode("",!0)]),_:1})],512)]))}},ie=j.default(ce,[["__scopeId","data-v-99e559ad"]]);exports.default=ie;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),I=require("../../../../components/Field/Field.vue2.cjs"),q=require("../../../../components/Button/Button.vue2.cjs"),M=require("../../../../components/Select/Select.vue2.cjs"),s=require("../../store/gallery.cjs"),P=require("../../../../components/EditImages/EditImages.vue.cjs");require("./BackofficeGallery.vue2.cjs");const j=require("../../../../../../_virtual/_plugin-vue_export-helper.cjs"),c=i=>(e.pushScopeId("data-v-99e559ad"),i=i(),e.popScopeId(),i),G={class:"pos-relative w-100"},U={class:"mn-b-semi flex-v-center flex-nowrap flex"},D=c(()=>e.createElementVNode("h1",{class:"mn-r-small"},"Manage Gallery",-1)),T=["data-id"],F=["src","onClick"],L={key:1,class:"radius-small bg-white"},R=["src","onClick"],$={class:"t-black p-small mn-b-thin"},O=c(()=>e.createElementVNode("span",{class:"uppercase t-transp"},"Size",-1)),A=c(()=>e.createElementVNode("br",null,null,-1)),H={class:"pd-2px radius-big d-inline-block bg-grey"},J={class:"t-black p-small mn-b-small uppe"},K=c(()=>e.createElementVNode("span",{class:"uppercase t-transp"},"Categories",-1)),Q=c(()=>e.createElementVNode("br",null,null,-1)),W={class:"pd-2px radius-big d-inline-block bg-grey t-semi"},X={class:"flex-nowrap flex"},Y=["onClick"],Z={class:"modal pd-thin"},ee={class:"modal-content radius-big"},te={class:""},le=["src"],ae={key:0,class:"flex-v-center flex m modal pd-big"},oe={class:"modal-content radius-small pd-medium bg-white"},se=["src"],ne=["src"],y=10,ce={__name:"BackofficeGallery",setup(i){const r=e.ref(!0),h=e.ref(null);let v=1,f=e.ref(null),_=e.ref(!1);const d=e.ref([]),E=a=>{d.value=a},V=e.computed(()=>k.value==="all"?s.state.gallery:s.state.gallery.filter(a=>a.categories.includes(k.value))),w=async()=>{_.value=!0,await s.actions.fetchGallery(v,y),_.value=!1},u=e.ref(null),t=e.ref({categories:"",size:"",image:!1}),m=e.ref(null),g=a=>{console.log(r.value),r.value?N(a):(u.value="modal",t.value.image=a,b())},N=a=>{u.value="edit-modal",t.value=a||{categories:"",size:"",image:null},b()},n=()=>{t.value={categories:"",size:"",image:!1},m.value=null,B()},b=()=>{document.body.style.overflow="hidden",document.documentElement.style.overflow="hidden"},B=()=>{document.body.style.overflow="",document.documentElement.style.overflow=""},C=[{name:"Small",value:""},{name:"Regular",value:"grid-item--width1 grid-item--height1"},{name:"Medium",value:"grid-item--width2 grid-item--height2"},{name:"Big",value:"grid-item--width3 grid-item--height3"}],x=async a=>{await s.actions.deletePhoto(a)},S=async()=>{await s.actions.updatePhoto(t.value),n()},z=async a=>{if(d.length<1||!t.value.categories||!t.value.size){console.error("All fields are required.");return}await s.actions.createPhoto({images:d.value,size:t.value.size,categories:typeof t.value.categories=="string"?t.value.categories.split(",").map(o=>o.trim()):t.value.categories}),n()};let k=e.ref("all");return e.onMounted(async()=>{await s.actions.fetchGallery(v,y),typeof window<"u"&&new IntersectionObserver(o=>{o.some(l=>l.isIntersecting)&&(v+=1,w())}).observe(f.value)}),(a,o)=>(e.openBlock(),e.createElementBlock("div",G,[e.createElementVNode("div",U,[D,r.value?(e.openBlock(),e.createElementBlock("button",{key:0,onClick:o[0]||(o[0]=l=>g(null)),class:"t-white t-black bg-second i-big radius-extra"},"+")):e.createCommentVNode("",!0)]),e.createElementVNode("div",{ref_key:"grid",ref:h,class:"cols-4 gap-thin"},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(V.value,(l,re)=>(e.openBlock(),e.createElementBlock("div",{key:l.id,"data-id":l.id},[e.createVNode(e.Transition,{name:"scaleIn",mode:"in-out"},{default:e.withCtx(()=>[!r.value&&h.value?(e.openBlock(),e.createElementBlock("img",{key:0,src:"https://thecommunephuket.com/photos/"+l.cover,class:"w-100 h-100 o-hidden radius-medium object-fit-cover",onClick:p=>g(l.image)},null,8,F)):(e.openBlock(),e.createElementBlock("div",L,[e.createElementVNode("img",{src:"https://thecommunephuket.com/photos/"+l.cover,class:"w-100 radius-small mn-b-small h-10r object-fit-cover",onClick:p=>g(l)},null,8,R),e.createElementVNode("p",$,[O,A,e.createElementVNode("span",H,e.toDisplayString(l.size.name),1)]),e.createElementVNode("p",J,[K,Q,(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.categories,p=>(e.openBlock(),e.createElementBlock("span",W,e.toDisplayString(p),1))),256))]),e.createElementVNode("div",X,[e.createElementVNode("button",{class:"button-small w-100 button",onClick:p=>x(l._id)},"Delete",8,Y)])]))]),_:2},1024)],8,T))),128)),e.createElementVNode("div",{ref_key:"sentinel",ref:f,class:"sentinel"},null,512),e.createVNode(e.Transition,{name:"modal"},{default:e.withCtx(()=>[e.withDirectives(e.createElementVNode("div",Z,[e.createElementVNode("div",ee,[e.createElementVNode("div",te,[e.createElementVNode("span",{class:"close",onClick:n},"×"),e.createElementVNode("img",{src:(a.FILE_SERVER_URL||"")+t.value.image},null,8,le)])])],512),[[e.vShow,t.value.image!==!1&&u.value==="modal"]])]),_:1}),e.createVNode(e.Transition,{name:"modal"},{default:e.withCtx(()=>[t.value.image!==!1&&u.value==="edit-modal"?(e.openBlock(),e.createElementBlock("div",ae,[e.createElementVNode("div",oe,[e.createElementVNode("span",{class:"close",onClick:n},"×"),typeof m.value=="string"?(e.openBlock(),e.createElementBlock("img",{key:0,src:m.value,class:"radius-small w-100 mn-b-small h-20r object-fit-cover"},null,8,se)):e.createCommentVNode("",!0),typeof m.value=="object"&&t.value.image!==null?(e.openBlock(),e.createElementBlock("img",{key:1,class:"radius-small w-100 mn-b-small h-20r object-fit-cover",src:"/photos/"+t.value.cover},null,8,ne)):e.createCommentVNode("",!0),e.createVNode(M.default,{options:C,label:"Size",select:t.value.size,"onUpdate:select":o[1]||(o[1]=l=>t.value.size=l),placeholder:"Select Size",class:"bg-grey pd-thin radius-small mn-b-thin t-black"},null,8,["select"]),e.createVNode(I.default,{field:t.value.categories,"onUpdate:field":o[2]||(o[2]=l=>t.value.categories=l),type:"text",label:"Categories",placeholder:"Enter categories for image (comma separated)",class:"bg-grey pd-thin radius-small mn-b-medium t-black"},null,8,["field"]),e.createVNode(P.default,{images:d.value,"onUpdate:images":E,uploadPath:"photos",class:"mn-b-semi"},null,8,["images"]),e.createVNode(q.default,{submit:t.value._id?S:z,callback:n,class:"mn-b-thin"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.value._id?"Update":"Create"),1)]),_:1},8,["submit"])])])):e.createCommentVNode("",!0)]),_:1})],512)]))}},ie=j.default(ce,[["__scopeId","data-v-99e559ad"]]);exports.default=ie;
@@ -1,7 +1,7 @@
1
1
  import { ref as n, computed as O, onMounted as T, openBlock as a, createElementBlock as o, createElementVNode as l, createCommentVNode as f, Fragment as P, renderList as M, createVNode as c, Transition as w, withCtx as b, toDisplayString as x, withDirectives as q, vShow as A, createTextVNode as H, pushScopeId as J, popScopeId as K } from "vue";
2
2
  import Q from "../../../../components/Field/Field.vue2.js";
3
3
  import W from "../../../../components/Button/Button.vue2.js";
4
- import X from "../../../../components/Select/Select.vue.js";
4
+ import X from "../../../../components/Select/Select.vue2.js";
5
5
  import { state as G, actions as d } from "../../store/gallery.js";
6
6
  import Y from "../../../../components/EditImages/EditImages.vue.js";
7
7
  import "./BackofficeGallery.vue2.js";
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),x=require("vue-router"),z=require("../../../../components/Field/Field.vue2.cjs"),S=require("../../../../components/Button/Button.vue2.cjs"),q=require("../../../../components/Select/Select.vue.cjs"),M=require("../../../../components/Upload/Upload.vue.cjs"),s=require("../../store/gallery.cjs");require("./GalleryWithCategories.vue2.cjs");const F=require("../../../../../../_virtual/_plugin-vue_export-helper.cjs"),I={class:"pd-medium flex-v-center gap-big flex-nowrap flex pd-t-thin pd-b-thin o-scroll"},P=["onClick"],j=["data-id"],G=["src","onClick"],R={class:"modal pd-thin"},T={class:"modal-content radius-big"},U={class:""},D=["src"],L={key:0,class:"flex-v-center flex m modal pd-big"},O={class:"modal-content radius-small pd-medium bg-white"},$=["src"],A=["src"],W=!1,f=10,H={__name:"GalleryWithCategories",setup(K){x.useRoute();const m=e.ref(null),h=["all","place","drinks","people","events"];let d=1,v=e.ref(null),g=e.ref(!1);const _=e.computed(()=>r.value==="all"?s.state.gallery:s.state.gallery.filter(a=>a.categories.includes(r.value))),b=async()=>{g.value=!0,await s.actions.fetchGallery(d,f),g.value=!1},c=e.ref(null),t=e.ref({categories:"",size:"",image:!1}),i=e.ref(null),k=a=>{W.value?y(a):(c.value="modal",t.value.image=a,p())},y=a=>{c.value="edit-modal",t.value=a||{categories:"",size:"",image:null},p()},n=()=>{t.value={categories:"",size:"",image:!1},i.value=null,w()},p=()=>{document.body.style.overflow="hidden",document.documentElement.style.overflow="hidden"},w=()=>{document.body.style.overflow="",document.documentElement.style.overflow=""},V=[{name:"Small",value:""},{name:"Regular",value:"grid-item--width1 grid-item--height1"},{name:"Medium",value:"grid-item--width2 grid-item--height2"},{name:"Big",value:"grid-item--width3 grid-item--height3"}],C=async()=>{await s.actions.updatePhoto(t.value),n()},E=a=>{const o=a.files;if(t.value.image=o,o&&o.length>0){const l=new FileReader;l.onload=u=>{i.value=u.target.result},l.readAsDataURL(o[0])}},N=async a=>{if(!t.value.image||!t.value.categories||!t.value.size){console.error("All fields are required.");return}await s.actions.createPhoto({...t.value,size:t.value.size,categories:typeof t.value.categories=="string"?t.value.categories.split(",").map(o=>o.trim()):t.value.categories}),n()};let r=e.ref("all");const B=a=>{r.value=a};return e.onMounted(async()=>{await s.actions.fetchGallery(d,f),typeof window<"u"&&new IntersectionObserver(o=>{o.some(l=>l.isIntersecting)&&(d+=1,b())}).observe(v.value)}),(a,o)=>(e.openBlock(),e.createElementBlock("div",null,[e.createElementVNode("div",I,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(h,l=>e.createElementVNode("a",{key:l,onClick:u=>B(l),class:e.normalizeClass(["h3 uppercase",{"t-transp":e.unref(r)!==l,"pd-thin bg-main radius-small":e.unref(r)===l}])},e.toDisplayString(a.$t("gallery.categories."+l)),11,P)),64)),e.createCommentVNode("",!0)]),e.createElementVNode("div",{ref_key:"grid",ref:m,class:"pd-medium cols-4 gap-thin"},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(_.value,(l,u)=>(e.openBlock(),e.createElementBlock("div",{key:l.id,"data-id":l.id},[e.createVNode(e.Transition,{name:"scaleIn",mode:"in-out"},{default:e.withCtx(()=>[m.value?(e.openBlock(),e.createElementBlock("img",{key:0,src:"https://thecommunephuket.com/photos/"+l.cover,class:"w-100 h-100 o-hidden radius-big object-fit-cover",onClick:Q=>k(l.image)},null,8,G)):e.createCommentVNode("",!0)]),_:2},1024)],8,j))),128)),e.createElementVNode("div",{ref_key:"sentinel",ref:v,class:"sentinel"},null,512),e.createVNode(e.Transition,{name:"modal"},{default:e.withCtx(()=>[e.withDirectives(e.createElementVNode("div",R,[e.createElementVNode("div",T,[e.createElementVNode("div",U,[e.createElementVNode("span",{class:"close",onClick:n},"×"),e.createElementVNode("img",{src:"https://thecommunephuket.com/photos/"+t.value.image},null,8,D)])])],512),[[e.vShow,t.value.image!==!1&&c.value==="modal"]])]),_:1}),e.createVNode(e.Transition,{name:"modal"},{default:e.withCtx(()=>[t.value.image!==!1&&c.value==="edit-modal"?(e.openBlock(),e.createElementBlock("div",L,[e.createElementVNode("div",O,[e.createElementVNode("span",{class:"close",onClick:n},"×"),typeof i.value=="string"?(e.openBlock(),e.createElementBlock("img",{key:0,src:i.value,class:"radius-small w-100 mn-b-small h-20r object-fit-cover"},null,8,$)):e.createCommentVNode("",!0),typeof i.value=="object"&&t.value.image!==null?(e.openBlock(),e.createElementBlock("img",{key:1,class:"radius-small w-100 mn-b-small h-20r object-fit-cover",src:"/photos/"+t.value.cover},null,8,A)):e.createCommentVNode("",!0),t.value._id?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(M.default,{key:2,id:"photo",name:"photo",type:"file",class:"t-black bg-grey pd-thin radius-small mn-b-thin",onFileChange:E,multiple:"true"})),e.createVNode(q.default,{options:V,label:"Size",select:t.value.size,"onUpdate:select":o[1]||(o[1]=l=>t.value.size=l),placeholder:"Select Size",class:"bg-grey pd-thin radius-small mn-b-thin t-black"},null,8,["select"]),e.createVNode(z.default,{field:t.value.categories,"onUpdate:field":o[2]||(o[2]=l=>t.value.categories=l),type:"text",label:"Categories",placeholder:"Enter categories for image (comma separated)",class:"bg-grey pd-thin radius-small mn-b-medium t-black"},null,8,["field"]),e.createVNode(S.default,{submit:t.value._id?C:N,callback:n,class:"mn-b-thin"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.value._id?"Update":"Create"),1)]),_:1},8,["submit"])])])):e.createCommentVNode("",!0)]),_:1})],512)]))}},J=F.default(H,[["__scopeId","data-v-4c5bced8"]]);exports.default=J;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),x=require("vue-router"),z=require("../../../../components/Field/Field.vue2.cjs"),S=require("../../../../components/Button/Button.vue2.cjs"),q=require("../../../../components/Select/Select.vue2.cjs"),M=require("../../../../components/Upload/Upload.vue.cjs"),s=require("../../store/gallery.cjs");require("./GalleryWithCategories.vue2.cjs");const F=require("../../../../../../_virtual/_plugin-vue_export-helper.cjs"),I={class:"pd-medium flex-v-center gap-big flex-nowrap flex pd-t-thin pd-b-thin o-scroll"},P=["onClick"],j=["data-id"],G=["src","onClick"],R={class:"modal pd-thin"},T={class:"modal-content radius-big"},U={class:""},D=["src"],L={key:0,class:"flex-v-center flex m modal pd-big"},O={class:"modal-content radius-small pd-medium bg-white"},$=["src"],A=["src"],W=!1,f=10,H={__name:"GalleryWithCategories",setup(K){x.useRoute();const m=e.ref(null),h=["all","place","drinks","people","events"];let d=1,v=e.ref(null),g=e.ref(!1);const _=e.computed(()=>r.value==="all"?s.state.gallery:s.state.gallery.filter(a=>a.categories.includes(r.value))),b=async()=>{g.value=!0,await s.actions.fetchGallery(d,f),g.value=!1},c=e.ref(null),t=e.ref({categories:"",size:"",image:!1}),i=e.ref(null),k=a=>{W.value?y(a):(c.value="modal",t.value.image=a,p())},y=a=>{c.value="edit-modal",t.value=a||{categories:"",size:"",image:null},p()},n=()=>{t.value={categories:"",size:"",image:!1},i.value=null,w()},p=()=>{document.body.style.overflow="hidden",document.documentElement.style.overflow="hidden"},w=()=>{document.body.style.overflow="",document.documentElement.style.overflow=""},V=[{name:"Small",value:""},{name:"Regular",value:"grid-item--width1 grid-item--height1"},{name:"Medium",value:"grid-item--width2 grid-item--height2"},{name:"Big",value:"grid-item--width3 grid-item--height3"}],C=async()=>{await s.actions.updatePhoto(t.value),n()},E=a=>{const o=a.files;if(t.value.image=o,o&&o.length>0){const l=new FileReader;l.onload=u=>{i.value=u.target.result},l.readAsDataURL(o[0])}},N=async a=>{if(!t.value.image||!t.value.categories||!t.value.size){console.error("All fields are required.");return}await s.actions.createPhoto({...t.value,size:t.value.size,categories:typeof t.value.categories=="string"?t.value.categories.split(",").map(o=>o.trim()):t.value.categories}),n()};let r=e.ref("all");const B=a=>{r.value=a};return e.onMounted(async()=>{await s.actions.fetchGallery(d,f),typeof window<"u"&&new IntersectionObserver(o=>{o.some(l=>l.isIntersecting)&&(d+=1,b())}).observe(v.value)}),(a,o)=>(e.openBlock(),e.createElementBlock("div",null,[e.createElementVNode("div",I,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(h,l=>e.createElementVNode("a",{key:l,onClick:u=>B(l),class:e.normalizeClass(["h3 uppercase",{"t-transp":e.unref(r)!==l,"pd-thin bg-main radius-small":e.unref(r)===l}])},e.toDisplayString(a.$t("gallery.categories."+l)),11,P)),64)),e.createCommentVNode("",!0)]),e.createElementVNode("div",{ref_key:"grid",ref:m,class:"pd-medium cols-4 gap-thin"},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(_.value,(l,u)=>(e.openBlock(),e.createElementBlock("div",{key:l.id,"data-id":l.id},[e.createVNode(e.Transition,{name:"scaleIn",mode:"in-out"},{default:e.withCtx(()=>[m.value?(e.openBlock(),e.createElementBlock("img",{key:0,src:"https://thecommunephuket.com/photos/"+l.cover,class:"w-100 h-100 o-hidden radius-big object-fit-cover",onClick:Q=>k(l.image)},null,8,G)):e.createCommentVNode("",!0)]),_:2},1024)],8,j))),128)),e.createElementVNode("div",{ref_key:"sentinel",ref:v,class:"sentinel"},null,512),e.createVNode(e.Transition,{name:"modal"},{default:e.withCtx(()=>[e.withDirectives(e.createElementVNode("div",R,[e.createElementVNode("div",T,[e.createElementVNode("div",U,[e.createElementVNode("span",{class:"close",onClick:n},"×"),e.createElementVNode("img",{src:"https://thecommunephuket.com/photos/"+t.value.image},null,8,D)])])],512),[[e.vShow,t.value.image!==!1&&c.value==="modal"]])]),_:1}),e.createVNode(e.Transition,{name:"modal"},{default:e.withCtx(()=>[t.value.image!==!1&&c.value==="edit-modal"?(e.openBlock(),e.createElementBlock("div",L,[e.createElementVNode("div",O,[e.createElementVNode("span",{class:"close",onClick:n},"×"),typeof i.value=="string"?(e.openBlock(),e.createElementBlock("img",{key:0,src:i.value,class:"radius-small w-100 mn-b-small h-20r object-fit-cover"},null,8,$)):e.createCommentVNode("",!0),typeof i.value=="object"&&t.value.image!==null?(e.openBlock(),e.createElementBlock("img",{key:1,class:"radius-small w-100 mn-b-small h-20r object-fit-cover",src:"/photos/"+t.value.cover},null,8,A)):e.createCommentVNode("",!0),t.value._id?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(M.default,{key:2,id:"photo",name:"photo",type:"file",class:"t-black bg-grey pd-thin radius-small mn-b-thin",onFileChange:E,multiple:"true"})),e.createVNode(q.default,{options:V,label:"Size",select:t.value.size,"onUpdate:select":o[1]||(o[1]=l=>t.value.size=l),placeholder:"Select Size",class:"bg-grey pd-thin radius-small mn-b-thin t-black"},null,8,["select"]),e.createVNode(z.default,{field:t.value.categories,"onUpdate:field":o[2]||(o[2]=l=>t.value.categories=l),type:"text",label:"Categories",placeholder:"Enter categories for image (comma separated)",class:"bg-grey pd-thin radius-small mn-b-medium t-black"},null,8,["field"]),e.createVNode(S.default,{submit:t.value._id?C:N,callback:n,class:"mn-b-thin"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.value._id?"Update":"Create"),1)]),_:1},8,["submit"])])])):e.createCommentVNode("",!0)]),_:1})],512)]))}},J=F.default(H,[["__scopeId","data-v-4c5bced8"]]);exports.default=J;
@@ -2,7 +2,7 @@ import { ref as n, computed as D, onMounted as A, openBlock as o, createElementB
2
2
  import { useRoute as H } from "vue-router";
3
3
  import J from "../../../../components/Field/Field.vue2.js";
4
4
  import K from "../../../../components/Button/Button.vue2.js";
5
- import Q from "../../../../components/Select/Select.vue.js";
5
+ import Q from "../../../../components/Select/Select.vue2.js";
6
6
  import X from "../../../../components/Upload/Upload.vue.js";
7
7
  import { state as E, actions as g } from "../../store/gallery.js";
8
8
  import "./GalleryWithCategories.vue2.js";
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),p=require("vue-router"),E=require("../../../icons/placeholders/PlaceholderUserpic.vue.cjs"),x=require("../../../reports/components/sections/FormReport.vue.cjs"),C=require("../../../../components/Tooltip/Tooltip.vue2.cjs"),N=require("../../../../components/Dropdown/Dropdown.vue.cjs");require("../../../../components/Loader/Loader.vue.cjs");require("../../../../components/Button/Button.vue.cjs");require("../../../auth/store/auth.cjs");require("../../../organizations/store/memberships.cjs");const v=require("../../../icons/navigation/IconEllipsis.vue.cjs"),$={key:0,class:"pd-b-zero"},M={class:"w-100 flex-v-center flex-nojustify flex"},q={class:"w-100 flex-nowrap flex-v-center flex"},R=["src"],S={key:2,class:"t-semi"},z={key:1,class:"pos-relative"},D={key:2},F={class:"d-block mn-l-auto flex-nowrap flex flex-v-center"},P={key:0,class:"w-4r pos-relative i-thin"},U={style:{position:"absolute",top:"0px",right:"0px"},class:"br-solid br-2px br-white z-index-1 radius-big i-thin bg-second flex flex-center t-white p-small t-semi"},T=["src"],I={class:"bg-black pd-thin radius-small"},L=e.createElementVNode("button",{class:"w-100 bg-black br-solid br-1px br-white-transp-20 t-white button-small button"}," Report ",-1),O={__name:"CardHeader",props:["user","entity","entityType","date","dateFormatted","owner","creator","members","membersPhotos","type"],setup(t){p.useRouter();function V(o){const r=new Date,d=new Date(o),u=Math.abs(r-d),m=Math.floor(u/1e3),a=Math.floor(m/60),l=Math.floor(a/60),i=Math.floor(l/24),s=Math.floor(i/7);return s>0?`${s} week${s>1?"s":""} ago`:i>0?`${i} day${i>1?"s":""} ago`:l>0?`${l} hour${l>1?"s":""} ago`:a>0?`${a} minute${a>1?"s":""} ago`:"Just now"}return(o,r)=>{var d,u,m,a,l,i,s,h,f,g,k,y,b,w,B;return t.owner?(e.openBlock(),e.createElementBlock("header",$,[e.createElementVNode("div",M,[e.createElementVNode("div",q,[((m=(u=(d=t.owner.target)==null?void 0:d.profile)==null?void 0:u.photo)==null?void 0:m.length)>0&&t.type!=="short"?(e.openBlock(),e.createElementBlock("img",{key:0,src:(o.FILE_SERVER_URL||"")+t.owner.target.profile.photo,class:"radius-medium object-fit-cover mn-r-thin i-thin",onClick:r[0]||(r[0]=e.withModifiers(c=>o.$router.push({name:t.owner.type==="user"?"User Profile":"Organization",params:{_id:t.owner.target._id}}),["stop"]))},null,8,R)):e.createCommentVNode("",!0),!((l=(a=t.owner.target)==null?void 0:a.profile)!=null&&l.photo)&&t.type!=="short"?(e.openBlock(),e.createBlock(E.default,{key:1,class:"radius-medium mn-r-thin i-thin",onClick:r[1]||(r[1]=e.withModifiers(c=>o.$router.push({name:t.owner.type==="user"?"User Profile":"Organization",params:{_id:t.owner.target._id}}),["stop"]))})):e.createCommentVNode("",!0),t.type!=="short"?(e.openBlock(),e.createElementBlock("span",S,[e.createElementVNode("span",{onClick:r[2]||(r[2]=e.withModifiers(c=>o.$router.push({name:t.owner.type==="user"?"User Profile":"Organization",params:{_id:t.owner.target._id}}),["stop"]))},e.toDisplayString(((s=(i=t.owner.target)==null?void 0:i.profile)==null?void 0:s.name)||((h=t.creator.target)==null?void 0:h.username)||"Anonymous"),1),!t.creator.hidden&&((g=(f=t.owner.target)==null?void 0:f.profile)==null?void 0:g.name)!==((y=(k=t.creator.target)==null?void 0:k.profile)==null?void 0:y.name)?(e.openBlock(),e.createElementBlock("span",{key:0,onClick:r[3]||(r[3]=e.withModifiers(c=>{var n;return o.$router.push({name:"User Profile",params:{_id:(n=t.creator.target)==null?void 0:n._id}})},["stop"]))}," · by "+e.toDisplayString(((w=(b=t.creator.target)==null?void 0:b.profile)==null?void 0:w.name)||((B=t.creator.target)==null?void 0:B.username)||"Anonymous"),1)):e.createCommentVNode("",!0),t.date?(e.openBlock(),e.createElementBlock("span",z,[t.date?(e.openBlock(),e.createBlock(C.default,{key:0,text:o.formatDate(t.date)},{default:e.withCtx(()=>[e.createTextVNode(" · "+e.toDisplayString(V(t.date)),1)]),_:1},8,["text"])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),t.dateFormatted?(e.openBlock(),e.createElementBlock("span",D," · "+e.toDisplayString(t.dateFormatted),1)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.createElementVNode("div",F,[t.members?(e.openBlock(),e.createElementBlock("div",P,[e.createElementVNode("span",U,e.toDisplayString(t.members),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.membersPhotos.slice(0,2),(c,n)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[c?(e.openBlock(),e.createElementBlock("img",{key:n,src:(o.FILE_SERVER_URL||"")+c,style:e.normalizeStyle({position:"absolute",top:"0px",right:n*20+20+"%",zIndex:1-n}),class:"br-solid br-2px br-white i-thin bg-grey radius-big"},null,12,T)):(e.openBlock(),e.createBlock(E.default,{key:1,style:e.normalizeStyle({position:"absolute",top:"0px",right:n*20+20+"%",zIndex:1-n}),class:"br-solid br-2px br-white i-thin bg-grey radius-big"},null,8,["style"]))],64))),256))])):e.createCommentVNode("",!0)]),t.type!=="short"&&t.user&&t.user!=t.creator.target._id?(e.openBlock(),e.createBlock(N.default,{key:3,label:{component:v.default,class:"t-transp i-regular"},align:"right",class:"cursor-pointer z-index-2"},{default:e.withCtx(()=>[e.createElementVNode("section",I,[t.user!==t.creator.target._id?(e.openBlock(),e.createBlock(x.default,{key:0,user:t.user,type:t.entityType,target:t.entity._id,text:"Report",class:"w-100"},{default:e.withCtx(()=>[L]),_:1},8,["user","type","target"])):e.createCommentVNode("",!0)])]),_:1},8,["label"])):e.createCommentVNode("",!0)])])])):e.createCommentVNode("",!0)}}};exports.default=O;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),p=require("vue-router"),E=require("../../../icons/placeholders/PlaceholderUserpic.vue.cjs"),x=require("../../../reports/components/sections/FormReport.vue.cjs"),C=require("../../../../components/Tooltip/Tooltip.vue.cjs"),N=require("../../../../components/Dropdown/Dropdown.vue.cjs");require("../../../../components/Loader/Loader.vue.cjs");require("../../../../components/Button/Button.vue.cjs");require("../../../auth/store/auth.cjs");require("../../../organizations/store/memberships.cjs");const v=require("../../../icons/navigation/IconEllipsis.vue.cjs"),$={key:0,class:"pd-b-zero"},M={class:"w-100 flex-v-center flex-nojustify flex"},q={class:"w-100 flex-nowrap flex-v-center flex"},R=["src"],S={key:2,class:"t-semi"},z={key:1,class:"pos-relative"},D={key:2},F={class:"d-block mn-l-auto flex-nowrap flex flex-v-center"},P={key:0,class:"w-4r pos-relative i-thin"},U={style:{position:"absolute",top:"0px",right:"0px"},class:"br-solid br-2px br-white z-index-1 radius-big i-thin bg-second flex flex-center t-white p-small t-semi"},T=["src"],I={class:"bg-black pd-thin radius-small"},L=e.createElementVNode("button",{class:"w-100 bg-black br-solid br-1px br-white-transp-20 t-white button-small button"}," Report ",-1),O={__name:"CardHeader",props:["user","entity","entityType","date","dateFormatted","owner","creator","members","membersPhotos","type"],setup(t){p.useRouter();function V(o){const r=new Date,d=new Date(o),u=Math.abs(r-d),m=Math.floor(u/1e3),a=Math.floor(m/60),l=Math.floor(a/60),i=Math.floor(l/24),s=Math.floor(i/7);return s>0?`${s} week${s>1?"s":""} ago`:i>0?`${i} day${i>1?"s":""} ago`:l>0?`${l} hour${l>1?"s":""} ago`:a>0?`${a} minute${a>1?"s":""} ago`:"Just now"}return(o,r)=>{var d,u,m,a,l,i,s,h,f,g,k,y,b,w,B;return t.owner?(e.openBlock(),e.createElementBlock("header",$,[e.createElementVNode("div",M,[e.createElementVNode("div",q,[((m=(u=(d=t.owner.target)==null?void 0:d.profile)==null?void 0:u.photo)==null?void 0:m.length)>0&&t.type!=="short"?(e.openBlock(),e.createElementBlock("img",{key:0,src:(o.FILE_SERVER_URL||"")+t.owner.target.profile.photo,class:"radius-medium object-fit-cover mn-r-thin i-thin",onClick:r[0]||(r[0]=e.withModifiers(c=>o.$router.push({name:t.owner.type==="user"?"User Profile":"Organization",params:{_id:t.owner.target._id}}),["stop"]))},null,8,R)):e.createCommentVNode("",!0),!((l=(a=t.owner.target)==null?void 0:a.profile)!=null&&l.photo)&&t.type!=="short"?(e.openBlock(),e.createBlock(E.default,{key:1,class:"radius-medium mn-r-thin i-thin",onClick:r[1]||(r[1]=e.withModifiers(c=>o.$router.push({name:t.owner.type==="user"?"User Profile":"Organization",params:{_id:t.owner.target._id}}),["stop"]))})):e.createCommentVNode("",!0),t.type!=="short"?(e.openBlock(),e.createElementBlock("span",S,[e.createElementVNode("span",{onClick:r[2]||(r[2]=e.withModifiers(c=>o.$router.push({name:t.owner.type==="user"?"User Profile":"Organization",params:{_id:t.owner.target._id}}),["stop"]))},e.toDisplayString(((s=(i=t.owner.target)==null?void 0:i.profile)==null?void 0:s.name)||((h=t.creator.target)==null?void 0:h.username)||"Anonymous"),1),!t.creator.hidden&&((g=(f=t.owner.target)==null?void 0:f.profile)==null?void 0:g.name)!==((y=(k=t.creator.target)==null?void 0:k.profile)==null?void 0:y.name)?(e.openBlock(),e.createElementBlock("span",{key:0,onClick:r[3]||(r[3]=e.withModifiers(c=>{var n;return o.$router.push({name:"User Profile",params:{_id:(n=t.creator.target)==null?void 0:n._id}})},["stop"]))}," · by "+e.toDisplayString(((w=(b=t.creator.target)==null?void 0:b.profile)==null?void 0:w.name)||((B=t.creator.target)==null?void 0:B.username)||"Anonymous"),1)):e.createCommentVNode("",!0),t.date?(e.openBlock(),e.createElementBlock("span",z,[t.date?(e.openBlock(),e.createBlock(C.default,{key:0,text:o.formatDate(t.date)},{default:e.withCtx(()=>[e.createTextVNode(" · "+e.toDisplayString(V(t.date)),1)]),_:1},8,["text"])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),t.dateFormatted?(e.openBlock(),e.createElementBlock("span",D," · "+e.toDisplayString(t.dateFormatted),1)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),e.createElementVNode("div",F,[t.members?(e.openBlock(),e.createElementBlock("div",P,[e.createElementVNode("span",U,e.toDisplayString(t.members),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.membersPhotos.slice(0,2),(c,n)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[c?(e.openBlock(),e.createElementBlock("img",{key:n,src:(o.FILE_SERVER_URL||"")+c,style:e.normalizeStyle({position:"absolute",top:"0px",right:n*20+20+"%",zIndex:1-n}),class:"br-solid br-2px br-white i-thin bg-grey radius-big"},null,12,T)):(e.openBlock(),e.createBlock(E.default,{key:1,style:e.normalizeStyle({position:"absolute",top:"0px",right:n*20+20+"%",zIndex:1-n}),class:"br-solid br-2px br-white i-thin bg-grey radius-big"},null,8,["style"]))],64))),256))])):e.createCommentVNode("",!0)]),t.type!=="short"&&t.user&&t.user!=t.creator.target._id?(e.openBlock(),e.createBlock(N.default,{key:3,label:{component:v.default,class:"t-transp i-regular"},align:"right",class:"cursor-pointer z-index-2"},{default:e.withCtx(()=>[e.createElementVNode("section",I,[t.user!==t.creator.target._id?(e.openBlock(),e.createBlock(x.default,{key:0,user:t.user,type:t.entityType,target:t.entity._id,text:"Report",class:"w-100"},{default:e.withCtx(()=>[L]),_:1},8,["user","type","target"])):e.createCommentVNode("",!0)])]),_:1},8,["label"])):e.createCommentVNode("",!0)])])])):e.createCommentVNode("",!0)}}};exports.default=O;
@@ -2,7 +2,7 @@ import { openBlock as t, createElementBlock as i, createElementVNode as m, withM
2
2
  import { useRouter as T } from "vue-router";
3
3
  import U from "../../../icons/placeholders/PlaceholderUserpic.vue.js";
4
4
  import V from "../../../reports/components/sections/FormReport.vue.js";
5
- import I from "../../../../components/Tooltip/Tooltip.vue2.js";
5
+ import I from "../../../../components/Tooltip/Tooltip.vue.js";
6
6
  import S from "../../../../components/Dropdown/Dropdown.vue.js";
7
7
  import "../../../../components/Loader/Loader.vue.js";
8
8
  import "../../../../components/Button/Button.vue.js";
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue");require("../../../../components/Field/Field.vue.cjs");require("../../../../components/Loader/Loader.vue.cjs");require("../../../../components/Button/Button.vue.cjs");const a=require("../../../mobile/components/Menu/Menu.vue.cjs"),r=require("../../../mobile/components/Menu/MenuItem.vue.cjs"),n=require("vue-router");require("../../../auth/store/auth.cjs");require("./Legal.vue2.cjs");const u={class:"for-transition w-100 pd-medium"},l=e.createStaticVNode('<div class="bg-grey radius-medium pd-medium mn-b-small"><h2 class="mn-b-small">About No More Snow CO., LTD.</h2><p class="mn-b-small"> Welcome to NO MORE SNOW CO., LTD.! We are dedicated to providing top-notch services and creating a trustworthy environment for our users. Your trust and safety are our priority, and we are committed to being transparent about our policies and practices. </p><p class="mn-b-small"> If you have any questions, concerns, or feedback, please do not hesitate to contact us through the following details. Our team is always here to assist you! </p><p class="mn-b-small"> Address: 10/3 Laemsai Rd, Karon, Mueang Phuket District, Phuket 83100<br> Telephone: +660803202142<br> Email: <a href="mailto:hello@thecommunephuket.com">hello@thecommunephuket.com</a><br> Website: <a href="https://thecommunephuket.com" target="_blank">https://thecommunephuket.com</a></p></div>',1),i=e.createElementVNode("span",null,"Terms of Use",-1),c=e.createElementVNode("span",null,"Privacy Policy",-1),d=e.createElementVNode("span",null,"Cookie Policy",-1),m=e.createElementVNode("span",null,"EULA",-1),p={__name:"Legal",setup(h){n.useRoute();const o=n.useRouter();return e.ref(!1),(f,t)=>(e.openBlock(),e.createElementBlock("div",u,[l,e.createVNode(a.default,{class:"bg-grey"},{default:e.withCtx(()=>[e.createVNode(r.default,{onClick:t[0]||(t[0]=s=>e.unref(o).push({name:"Terms of Use"})),class:"cursor-pointer"},{default:e.withCtx(()=>[i]),_:1}),e.createVNode(r.default,{onClick:t[1]||(t[1]=s=>e.unref(o).push({name:"Privacy Policy"})),class:"cursor-pointer"},{default:e.withCtx(()=>[c]),_:1}),e.createVNode(r.default,{onClick:t[2]||(t[2]=s=>e.unref(o).push({name:"Cookie Policy"})),class:"cursor-pointer"},{default:e.withCtx(()=>[d]),_:1}),e.createVNode(r.default,{onClick:t[3]||(t[3]=s=>e.unref(o).push({name:"EULA"})),class:"cursor-pointer"},{default:e.withCtx(()=>[m]),_:1})]),_:1})]))}};exports.default=p;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue");require("../../../../components/Field/Field.vue.cjs");require("../../../../components/Loader/Loader.vue.cjs");require("../../../../components/Button/Button.vue.cjs");const a=require("../../../mobile/components/Menu/Menu.vue2.cjs"),r=require("../../../mobile/components/Menu/MenuItem.vue.cjs"),n=require("vue-router");require("../../../auth/store/auth.cjs");require("./Legal.vue2.cjs");const u={class:"for-transition w-100 pd-medium"},l=e.createStaticVNode('<div class="bg-grey radius-medium pd-medium mn-b-small"><h2 class="mn-b-small">About No More Snow CO., LTD.</h2><p class="mn-b-small"> Welcome to NO MORE SNOW CO., LTD.! We are dedicated to providing top-notch services and creating a trustworthy environment for our users. Your trust and safety are our priority, and we are committed to being transparent about our policies and practices. </p><p class="mn-b-small"> If you have any questions, concerns, or feedback, please do not hesitate to contact us through the following details. Our team is always here to assist you! </p><p class="mn-b-small"> Address: 10/3 Laemsai Rd, Karon, Mueang Phuket District, Phuket 83100<br> Telephone: +660803202142<br> Email: <a href="mailto:hello@thecommunephuket.com">hello@thecommunephuket.com</a><br> Website: <a href="https://thecommunephuket.com" target="_blank">https://thecommunephuket.com</a></p></div>',1),i=e.createElementVNode("span",null,"Terms of Use",-1),c=e.createElementVNode("span",null,"Privacy Policy",-1),d=e.createElementVNode("span",null,"Cookie Policy",-1),m=e.createElementVNode("span",null,"EULA",-1),p={__name:"Legal",setup(h){n.useRoute();const o=n.useRouter();return e.ref(!1),(f,t)=>(e.openBlock(),e.createElementBlock("div",u,[l,e.createVNode(a.default,{class:"bg-grey"},{default:e.withCtx(()=>[e.createVNode(r.default,{onClick:t[0]||(t[0]=s=>e.unref(o).push({name:"Terms of Use"})),class:"cursor-pointer"},{default:e.withCtx(()=>[i]),_:1}),e.createVNode(r.default,{onClick:t[1]||(t[1]=s=>e.unref(o).push({name:"Privacy Policy"})),class:"cursor-pointer"},{default:e.withCtx(()=>[c]),_:1}),e.createVNode(r.default,{onClick:t[2]||(t[2]=s=>e.unref(o).push({name:"Cookie Policy"})),class:"cursor-pointer"},{default:e.withCtx(()=>[d]),_:1}),e.createVNode(r.default,{onClick:t[3]||(t[3]=s=>e.unref(o).push({name:"EULA"})),class:"cursor-pointer"},{default:e.withCtx(()=>[m]),_:1})]),_:1})]))}};exports.default=p;
@@ -2,7 +2,7 @@ import { ref as l, openBlock as m, createElementBlock as u, createVNode as t, wi
2
2
  import "../../../../components/Field/Field.vue.js";
3
3
  import "../../../../components/Loader/Loader.vue.js";
4
4
  import "../../../../components/Button/Button.vue.js";
5
- import p from "../../../mobile/components/Menu/Menu.vue.js";
5
+ import p from "../../../mobile/components/Menu/Menu.vue2.js";
6
6
  import n from "../../../mobile/components/Menu/MenuItem.vue.js";
7
7
  import { useRoute as d, useRouter as h } from "vue-router";
8
8
  import "../../../auth/store/auth.js";
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue");require("./Menu.vue2.cjs");const r={class:"mobile-menu-section pd-r-zero pd-t-thin pd-b-thin pd-medium radius-medium"},o={__name:"Menu",setup(u){return(t,n)=>(e.openBlock(),e.createElementBlock("section",r,[e.renderSlot(t.$slots,"default")]))}};exports.default=o;
1
+ "use strict";
@@ -1,13 +1 @@
1
- import { openBlock as t, createElementBlock as o, renderSlot as n } from "vue";
2
- import "./Menu.vue2.js";
3
- const r = { class: "mobile-menu-section pd-r-zero pd-t-thin pd-b-thin pd-medium radius-medium" }, d = {
4
- __name: "Menu",
5
- setup(s) {
6
- return (e, i) => (t(), o("section", r, [
7
- n(e.$slots, "default")
8
- ]));
9
- }
10
- };
11
- export {
12
- d as default
13
- };
1
+
@@ -1 +1 @@
1
- "use strict";
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue");require("./Menu.vue.cjs");const r={class:"mobile-menu-section pd-r-zero pd-t-thin pd-b-thin pd-medium radius-medium"},o={__name:"Menu",setup(u){return(t,n)=>(e.openBlock(),e.createElementBlock("section",r,[e.renderSlot(t.$slots,"default")]))}};exports.default=o;
@@ -1 +1,13 @@
1
-
1
+ import { openBlock as t, createElementBlock as o, renderSlot as n } from "vue";
2
+ import "./Menu.vue.js";
3
+ const r = { class: "mobile-menu-section pd-r-zero pd-t-thin pd-b-thin pd-medium radius-medium" }, d = {
4
+ __name: "Menu",
5
+ setup(s) {
6
+ return (e, i) => (t(), o("section", r, [
7
+ n(e.$slots, "default")
8
+ ]));
9
+ }
10
+ };
11
+ export {
12
+ d as default
13
+ };
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),C=require("vue-router"),O=require("../../../../../node_modules/@vuepic/vue-datepicker/dist/vue-datepicker.cjs");require("../../../../../node_modules/@vuepic/vue-datepicker/dist/main.css.cjs");require("../../../../components/Tab/Tab.vue.cjs");const P=require("../../../../components/Popup/Popup.vue.cjs"),I=require("../../../icons/entities/IconTime.vue.cjs"),B=require("../blocks/CardOrderItem.vue.cjs"),z=require("../../../organizations/components/blocks/CardOrganization.vue.cjs"),M=require("../../../chats/components/pages/ChatPage.vue.cjs"),F=require("../blocks/StatusHistory.vue.cjs"),L=require("../../../globals/store/globals.cjs"),d=require("../../store/orders.cjs"),R=require("../../../products/store/products.cjs"),T=require("../../../organizations/store/organizations.cjs");require("./OrderBackoffice.vue2.cjs");const A=require("../../../../../../_virtual/_plugin-vue_export-helper.cjs"),r=b=>(e.pushScopeId("data-v-ec5fc79c"),b=b(),e.popScopeId(),b),H={key:0,class:"pd-thin"},U={key:0,class:"mn-b-thin pos-relative w-100 bg-main radius-big pd-medium"},W={class:"mn-b-small flex-nowrap flex"},j={class:"t-medium p-medium"},G={class:"p-small t-transp"},J={class:"flex-nowrap flex gap-thin pos-relative"},K={class:"bg-grey mn-b-thin pd-thin radius-extra flex-nowrap flex"},Q={class:"w-max flex-v-center gap-thin flex-nowrap flex pd-thin radius-small bg-white-transp-20"},X={class:"t-medium mn-r-auto"},Y=r(()=>e.createElementVNode("span",{class:"p-small t-transp"},"Estimated Arrival",-1)),Z=r(()=>e.createElementVNode("br",null,null,-1)),$=r(()=>e.createElementVNode("p",{class:"t-medium p-medium mn-b-thin"}," Positions ",-1)),ee={class:"bg-grey pd-small radius-small flex gap-thin flex-column mn-b-semi"},te={key:1,class:"gap-thin cols-2"},se={class:"w-100"},ae={class:"mn-b-thin bg-grey w-100 o-hidden radius-medium"},re={class:"pd-small flex-nowrap flex"},le={class:"mn-r-auto"},ne=r(()=>e.createElementVNode("span",{class:"d-block t-medium p-medium"},"Order is",-1)),oe=r(()=>e.createElementVNode("span",{class:"t-lh-075 h2 d-block mn-b-small"},"created",-1)),ie={class:"pd-t-nano pd-b-nano pd-r-thin pd-l-thin radius-extra bg-black t-white w-max"},ce={class:"pd-small cols-2 br-t br-black-transp-10 br-solid"},de=r(()=>e.createElementVNode("p",{class:"w-100 t-medium p-medium"}," Phone ",-1)),ue={class:"w-100 t-right"},me={class:"pd-small cols-2 br-t br-black-transp-10 br-solid"},pe=r(()=>e.createElementVNode("p",{class:"t-medium p-medium"}," Address ",-1)),_e={class:"w-100 t-right"},he={class:"pd-small cols-2 br-t br-black-transp-10 br-solid"},be=r(()=>e.createElementVNode("p",{class:"mn-b-small t-medium p-medium"}," Delivery ",-1)),ve={class:"w-100 t-right mn-b-small"},ge={key:2,class:"t-transp"},fe={class:"bg-grey radius-big pd-medium mn-r-bold pd-r-big br-right-dark w-100"},Ne=r(()=>e.createElementVNode("h3",{class:"mn-b-small"},"Order Summary",-1)),Ve={class:"flex gap-thin flex-column mn-b-semi"},ye={class:"mn-b-medium radius-small br-solid br-1px br-black-transp-10 w-100"},Ee={class:"pd-small br-solid br-b br-black-transp-10 flex"},ke=r(()=>e.createElementVNode("p",{class:"mn-r-auto t-transp"},"In total",-1)),we={class:"pd-small br-solid br-b br-black-transp-10 flex"},Se=r(()=>e.createElementVNode("p",{class:"mn-r-auto t-transp"},"Delivery",-1)),xe={class:"pd-small flex-bottom flex"},Ce=r(()=>e.createElementVNode("p",{class:"mn-r-auto t-transp"},"In total to pay",-1)),Be={class:"p-big t-semi"},De=r(()=>e.createElementVNode("h3",{class:"mn-b-small"},"Chat With Us",-1)),qe={__name:"OrderBackoffice",setup(b){C.useRouter();const _=C.useRoute(),s=e.ref(null),v=e.ref(null),n=e.ref(null),o=["created","confirmed","packing","in delivery","delivered"],V=["Created","Confirmed","Packing","In Delivery","Delivered"],g=t=>o.slice(t).includes(s.value.status),f=e.ref(!1),y=e.ref(null),N=e.ref([]);function D(t){f.value=!0,typeof t=="number"&&(y.value=t)}function E(){f.value=!1,y.value=null}e.onMounted(async()=>{var a,l;s.value=await d.actions.read({_id:_.params.order}),s.value=s.value[0],v.value=await R.actions.read({organization:s.value.owner.target._id,limit:1e3}),console.log(v.value);const t=v.value.reduce((u,m)=>(u[m._id]=m,u),{});console.log(t),N.value=s.value.positions.map(({_id:u,quantity:m})=>{const p=t[u];return{name:p.name,images:p.images,price:p.price,_id:p._id,quantity:m}}),n.value=await T.actions.read({_id:(a=s.value)==null?void 0:a.owner.target._id,location:(l=L.state.position)==null?void 0:l.location})});let k=e.computed(()=>{var t;return Number((t=s.value)==null?void 0:t.positions.reduce((a,l)=>a+l.price*l.quantity,0))});e.computed(()=>{var t;return Number((t=s.value)==null?void 0:t.positions.reduce((a,l)=>a+l.quantity,0))});function h(t){const a=o.indexOf(t);return a!==-1&&a+1<o.length?o[a+1]:null}function w(t){const a=o.indexOf(t);return t?V[a]:""}async function q(){const t=h(d.state.current.status);t?(d.state.current.status=t,await d.actions.update(d.state.current)):console.error("Next status is void. Must handle somehow."),E()}return(t,a)=>{var l,u,m,p,S,x;return s.value&&n.value?(e.openBlock(),e.createElementBlock("div",H,[s.value?(e.openBlock(),e.createElementBlock("div",U,[e.createElementVNode("div",W,[e.createElementVNode("p",j,[e.createTextVNode(" Order No: "),e.createElementVNode("span",G,"#"+e.toDisplayString(s.value._id),1)])]),e.createElementVNode("div",J,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(o,(i,c)=>e.createElementVNode("div",{key:c,class:"w-20"},[e.createElementVNode("div",{class:e.normalizeClass(["bg-grey br-anim br-glow radius-extra h-1r w-100",{"br-glow-anim":g(c)},{"t-transp":!g(c)},{blink:s.value.status===o[c]&&h(s.value.status)}])},null,2),e.createElementVNode("div",{class:e.normalizeClass([{"t-transp":!g(c)},"mn-t-thin p-small t-medium uppercase"])},e.toDisplayString(V[c]),3)])),64))])])):e.createCommentVNode("",!0),e.createElementVNode("div",K,[e.createElementVNode("div",Q,[e.createVNode(I.default,{class:"i-semi t-transp",fill:"rgb(var(--black)"}),e.createElementVNode("p",X,[Y,Z,e.createTextVNode(e.toDisplayString(t.formatDate(s.value.deadline)),1)])]),h(s.value.status)&&e.unref(_).name==="Order Edit"?(e.openBlock(),e.createElementBlock("button",{key:0,onClick:D,class:"mn-l-auto bg-black t-white button"}," Mark as "+e.toDisplayString(w(h(s.value.status))),1)):e.createCommentVNode("",!0)]),e.createVNode(P.default,{title:"Change status",onClosePopup:E,isPopupOpen:f.value,class:"bg-white w-min-30r w-max-30r radius-big pd-big"},{default:e.withCtx(()=>[e.createVNode(e.unref(O.default),{modelValue:s.value.deadline,"onUpdate:modelValue":a[0]||(a[0]=i=>s.value.deadline=i),"hide-navigation":["calendar"],flow:["time"],class:"z-index-3 bg-grey radius-small pd-small mn-b-thin mn-b-semi"},null,8,["modelValue"]),$,e.createElementVNode("ul",ee,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(N.value,(i,c)=>(e.openBlock(),e.createBlock(B.default,{key:i._id,editable:!1,product:i},null,8,["product"]))),128))]),e.createElementVNode("button",{onClick:q,class:"w-100 bg-black-small t-white button"},e.toDisplayString("Confirm Changing to "+w(h(s.value.status))),1)]),_:1},8,["isPopupOpen"]),s.value?(e.openBlock(),e.createElementBlock("div",te,[e.createElementVNode("div",se,[n.value[0]?(e.openBlock(),e.createBlock(z.default,{key:0,organization:n.value[0],showRating:!0,showFollowers:!1,showProducts:!1,class:"bg-grey mn-b-thin w-100 o-hidden radius-big pd-small"},null,8,["organization"])):e.createCommentVNode("",!0),e.createElementVNode("div",ae,[e.createElementVNode("div",re,[e.createElementVNode("div",le,[ne,oe,e.createElementVNode("p",ie,e.toDisplayString(t.formatDate(s.value.createdAt)),1)])]),e.createElementVNode("div",ce,[de,e.createElementVNode("p",ue,e.toDisplayString(((l=s.value.customer.target)==null?void 0:l.number)||"Not specified"),1)]),e.createElementVNode("div",me,[pe,e.createElementVNode("p",_e,e.toDisplayString(s.value.delivery.address?s.value.delivery.address.slice(0,64):"Not specified"),1)]),e.createElementVNode("div",he,[be,e.createElementVNode("p",ve,e.toDisplayString(s.value.delivery.type?s.value.delivery.type:"Not specified"),1)])]),d.state.current.status_history?(e.openBlock(),e.createBlock(F.default,{key:1,statuses:o,statusHistory:d.state.current.status_history,statusCurrent:d.state.current.status,edit:e.unref(_).name==="Order Edit"},null,8,["statusHistory","statusCurrent","edit"])):e.createCommentVNode("",!0),t.payment&&t.payment.Status==="CONFIRMED"?(e.openBlock(),e.createElementBlock("span",ge,"Paid")):e.createCommentVNode("",!0)]),e.createElementVNode("div",fe,[Ne,e.createElementVNode("ul",Ve,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(N.value,(i,c)=>(e.openBlock(),e.createBlock(B.default,{key:i._id,editable:!1,product:i},null,8,["product"]))),128))]),e.createElementVNode("div",ye,[e.createElementVNode("div",Ee,[ke,e.createElementVNode("p",null,e.toDisplayString(e.unref(k))+" "+e.toDisplayString(t.returnCurrency()),1)]),e.createElementVNode("div",we,[Se,e.createElementVNode("p",null,e.toDisplayString(t.returnCurrency())+" "+e.toDisplayString(Math.trunc(100+20*((u=n.value[0])==null?void 0:u.distance)-7,5*(((m=n.value[0])==null?void 0:m.distance)/10))),1)]),e.createElementVNode("div",xe,[Ce,e.createElementVNode("p",Be,e.toDisplayString(t.returnCurrency())+" "+e.toDisplayString(Math.trunc(100+20*((p=n.value[0])==null?void 0:p.distance)-7,5*(((S=n.value[0])==null?void 0:S.distance)/10))+e.unref(k)),1)])]),De,e.createVNode(M.default,{username:e.unref(_).name==="Order Status"?((x=s.value.user)==null?void 0:x.name)||"User":"Weeder Support",chatID:e.unref(_).params.order,class:"radius-semi bg-white o-hidden"},null,8,["username","chatID"])])])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)}}},Oe=A.default(qe,[["__scopeId","data-v-ec5fc79c"]]);exports.default=Oe;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),C=require("vue-router"),O=require("../../../../../node_modules/@vuepic/vue-datepicker/dist/vue-datepicker.cjs");require("../../../../../node_modules/@vuepic/vue-datepicker/dist/main.css.cjs");require("../../../../components/Tab/Tab.vue.cjs");const P=require("../../../../components/Popup/Popup.vue2.cjs"),I=require("../../../icons/entities/IconTime.vue.cjs"),B=require("../blocks/CardOrderItem.vue.cjs"),z=require("../../../organizations/components/blocks/CardOrganization.vue.cjs"),M=require("../../../chats/components/pages/ChatPage.vue.cjs"),F=require("../blocks/StatusHistory.vue.cjs"),L=require("../../../globals/store/globals.cjs"),d=require("../../store/orders.cjs"),R=require("../../../products/store/products.cjs"),T=require("../../../organizations/store/organizations.cjs");require("./OrderBackoffice.vue2.cjs");const A=require("../../../../../../_virtual/_plugin-vue_export-helper.cjs"),r=b=>(e.pushScopeId("data-v-ec5fc79c"),b=b(),e.popScopeId(),b),H={key:0,class:"pd-thin"},U={key:0,class:"mn-b-thin pos-relative w-100 bg-main radius-big pd-medium"},W={class:"mn-b-small flex-nowrap flex"},j={class:"t-medium p-medium"},G={class:"p-small t-transp"},J={class:"flex-nowrap flex gap-thin pos-relative"},K={class:"bg-grey mn-b-thin pd-thin radius-extra flex-nowrap flex"},Q={class:"w-max flex-v-center gap-thin flex-nowrap flex pd-thin radius-small bg-white-transp-20"},X={class:"t-medium mn-r-auto"},Y=r(()=>e.createElementVNode("span",{class:"p-small t-transp"},"Estimated Arrival",-1)),Z=r(()=>e.createElementVNode("br",null,null,-1)),$=r(()=>e.createElementVNode("p",{class:"t-medium p-medium mn-b-thin"}," Positions ",-1)),ee={class:"bg-grey pd-small radius-small flex gap-thin flex-column mn-b-semi"},te={key:1,class:"gap-thin cols-2"},se={class:"w-100"},ae={class:"mn-b-thin bg-grey w-100 o-hidden radius-medium"},re={class:"pd-small flex-nowrap flex"},le={class:"mn-r-auto"},ne=r(()=>e.createElementVNode("span",{class:"d-block t-medium p-medium"},"Order is",-1)),oe=r(()=>e.createElementVNode("span",{class:"t-lh-075 h2 d-block mn-b-small"},"created",-1)),ie={class:"pd-t-nano pd-b-nano pd-r-thin pd-l-thin radius-extra bg-black t-white w-max"},ce={class:"pd-small cols-2 br-t br-black-transp-10 br-solid"},de=r(()=>e.createElementVNode("p",{class:"w-100 t-medium p-medium"}," Phone ",-1)),ue={class:"w-100 t-right"},me={class:"pd-small cols-2 br-t br-black-transp-10 br-solid"},pe=r(()=>e.createElementVNode("p",{class:"t-medium p-medium"}," Address ",-1)),_e={class:"w-100 t-right"},he={class:"pd-small cols-2 br-t br-black-transp-10 br-solid"},be=r(()=>e.createElementVNode("p",{class:"mn-b-small t-medium p-medium"}," Delivery ",-1)),ve={class:"w-100 t-right mn-b-small"},ge={key:2,class:"t-transp"},fe={class:"bg-grey radius-big pd-medium mn-r-bold pd-r-big br-right-dark w-100"},Ne=r(()=>e.createElementVNode("h3",{class:"mn-b-small"},"Order Summary",-1)),Ve={class:"flex gap-thin flex-column mn-b-semi"},ye={class:"mn-b-medium radius-small br-solid br-1px br-black-transp-10 w-100"},Ee={class:"pd-small br-solid br-b br-black-transp-10 flex"},ke=r(()=>e.createElementVNode("p",{class:"mn-r-auto t-transp"},"In total",-1)),we={class:"pd-small br-solid br-b br-black-transp-10 flex"},Se=r(()=>e.createElementVNode("p",{class:"mn-r-auto t-transp"},"Delivery",-1)),xe={class:"pd-small flex-bottom flex"},Ce=r(()=>e.createElementVNode("p",{class:"mn-r-auto t-transp"},"In total to pay",-1)),Be={class:"p-big t-semi"},De=r(()=>e.createElementVNode("h3",{class:"mn-b-small"},"Chat With Us",-1)),qe={__name:"OrderBackoffice",setup(b){C.useRouter();const _=C.useRoute(),s=e.ref(null),v=e.ref(null),n=e.ref(null),o=["created","confirmed","packing","in delivery","delivered"],V=["Created","Confirmed","Packing","In Delivery","Delivered"],g=t=>o.slice(t).includes(s.value.status),f=e.ref(!1),y=e.ref(null),N=e.ref([]);function D(t){f.value=!0,typeof t=="number"&&(y.value=t)}function E(){f.value=!1,y.value=null}e.onMounted(async()=>{var a,l;s.value=await d.actions.read({_id:_.params.order}),s.value=s.value[0],v.value=await R.actions.read({organization:s.value.owner.target._id,limit:1e3}),console.log(v.value);const t=v.value.reduce((u,m)=>(u[m._id]=m,u),{});console.log(t),N.value=s.value.positions.map(({_id:u,quantity:m})=>{const p=t[u];return{name:p.name,images:p.images,price:p.price,_id:p._id,quantity:m}}),n.value=await T.actions.read({_id:(a=s.value)==null?void 0:a.owner.target._id,location:(l=L.state.position)==null?void 0:l.location})});let k=e.computed(()=>{var t;return Number((t=s.value)==null?void 0:t.positions.reduce((a,l)=>a+l.price*l.quantity,0))});e.computed(()=>{var t;return Number((t=s.value)==null?void 0:t.positions.reduce((a,l)=>a+l.quantity,0))});function h(t){const a=o.indexOf(t);return a!==-1&&a+1<o.length?o[a+1]:null}function w(t){const a=o.indexOf(t);return t?V[a]:""}async function q(){const t=h(d.state.current.status);t?(d.state.current.status=t,await d.actions.update(d.state.current)):console.error("Next status is void. Must handle somehow."),E()}return(t,a)=>{var l,u,m,p,S,x;return s.value&&n.value?(e.openBlock(),e.createElementBlock("div",H,[s.value?(e.openBlock(),e.createElementBlock("div",U,[e.createElementVNode("div",W,[e.createElementVNode("p",j,[e.createTextVNode(" Order No: "),e.createElementVNode("span",G,"#"+e.toDisplayString(s.value._id),1)])]),e.createElementVNode("div",J,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(o,(i,c)=>e.createElementVNode("div",{key:c,class:"w-20"},[e.createElementVNode("div",{class:e.normalizeClass(["bg-grey br-anim br-glow radius-extra h-1r w-100",{"br-glow-anim":g(c)},{"t-transp":!g(c)},{blink:s.value.status===o[c]&&h(s.value.status)}])},null,2),e.createElementVNode("div",{class:e.normalizeClass([{"t-transp":!g(c)},"mn-t-thin p-small t-medium uppercase"])},e.toDisplayString(V[c]),3)])),64))])])):e.createCommentVNode("",!0),e.createElementVNode("div",K,[e.createElementVNode("div",Q,[e.createVNode(I.default,{class:"i-semi t-transp",fill:"rgb(var(--black)"}),e.createElementVNode("p",X,[Y,Z,e.createTextVNode(e.toDisplayString(t.formatDate(s.value.deadline)),1)])]),h(s.value.status)&&e.unref(_).name==="Order Edit"?(e.openBlock(),e.createElementBlock("button",{key:0,onClick:D,class:"mn-l-auto bg-black t-white button"}," Mark as "+e.toDisplayString(w(h(s.value.status))),1)):e.createCommentVNode("",!0)]),e.createVNode(P.default,{title:"Change status",onClosePopup:E,isPopupOpen:f.value,class:"bg-white w-min-30r w-max-30r radius-big pd-big"},{default:e.withCtx(()=>[e.createVNode(e.unref(O.default),{modelValue:s.value.deadline,"onUpdate:modelValue":a[0]||(a[0]=i=>s.value.deadline=i),"hide-navigation":["calendar"],flow:["time"],class:"z-index-3 bg-grey radius-small pd-small mn-b-thin mn-b-semi"},null,8,["modelValue"]),$,e.createElementVNode("ul",ee,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(N.value,(i,c)=>(e.openBlock(),e.createBlock(B.default,{key:i._id,editable:!1,product:i},null,8,["product"]))),128))]),e.createElementVNode("button",{onClick:q,class:"w-100 bg-black-small t-white button"},e.toDisplayString("Confirm Changing to "+w(h(s.value.status))),1)]),_:1},8,["isPopupOpen"]),s.value?(e.openBlock(),e.createElementBlock("div",te,[e.createElementVNode("div",se,[n.value[0]?(e.openBlock(),e.createBlock(z.default,{key:0,organization:n.value[0],showRating:!0,showFollowers:!1,showProducts:!1,class:"bg-grey mn-b-thin w-100 o-hidden radius-big pd-small"},null,8,["organization"])):e.createCommentVNode("",!0),e.createElementVNode("div",ae,[e.createElementVNode("div",re,[e.createElementVNode("div",le,[ne,oe,e.createElementVNode("p",ie,e.toDisplayString(t.formatDate(s.value.createdAt)),1)])]),e.createElementVNode("div",ce,[de,e.createElementVNode("p",ue,e.toDisplayString(((l=s.value.customer.target)==null?void 0:l.number)||"Not specified"),1)]),e.createElementVNode("div",me,[pe,e.createElementVNode("p",_e,e.toDisplayString(s.value.delivery.address?s.value.delivery.address.slice(0,64):"Not specified"),1)]),e.createElementVNode("div",he,[be,e.createElementVNode("p",ve,e.toDisplayString(s.value.delivery.type?s.value.delivery.type:"Not specified"),1)])]),d.state.current.status_history?(e.openBlock(),e.createBlock(F.default,{key:1,statuses:o,statusHistory:d.state.current.status_history,statusCurrent:d.state.current.status,edit:e.unref(_).name==="Order Edit"},null,8,["statusHistory","statusCurrent","edit"])):e.createCommentVNode("",!0),t.payment&&t.payment.Status==="CONFIRMED"?(e.openBlock(),e.createElementBlock("span",ge,"Paid")):e.createCommentVNode("",!0)]),e.createElementVNode("div",fe,[Ne,e.createElementVNode("ul",Ve,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(N.value,(i,c)=>(e.openBlock(),e.createBlock(B.default,{key:i._id,editable:!1,product:i},null,8,["product"]))),128))]),e.createElementVNode("div",ye,[e.createElementVNode("div",Ee,[ke,e.createElementVNode("p",null,e.toDisplayString(e.unref(k))+" "+e.toDisplayString(t.returnCurrency()),1)]),e.createElementVNode("div",we,[Se,e.createElementVNode("p",null,e.toDisplayString(t.returnCurrency())+" "+e.toDisplayString(Math.trunc(100+20*((u=n.value[0])==null?void 0:u.distance)-7,5*(((m=n.value[0])==null?void 0:m.distance)/10))),1)]),e.createElementVNode("div",xe,[Ce,e.createElementVNode("p",Be,e.toDisplayString(t.returnCurrency())+" "+e.toDisplayString(Math.trunc(100+20*((p=n.value[0])==null?void 0:p.distance)-7,5*(((S=n.value[0])==null?void 0:S.distance)/10))+e.unref(k)),1)])]),De,e.createVNode(M.default,{username:e.unref(_).name==="Order Status"?((x=s.value.user)==null?void 0:x.name)||"User":"Weeder Support",chatID:e.unref(_).params.order,class:"radius-semi bg-white o-hidden"},null,8,["username","chatID"])])])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)}}},Oe=A.default(qe,[["__scopeId","data-v-ec5fc79c"]]);exports.default=Oe;
@@ -3,7 +3,7 @@ import { useRouter as K, useRoute as Q } from "vue-router";
3
3
  import X from "../../../../../node_modules/@vuepic/vue-datepicker/dist/vue-datepicker.js";
4
4
  import "../../../../../node_modules/@vuepic/vue-datepicker/dist/main.css.js";
5
5
  import "../../../../components/Tab/Tab.vue.js";
6
- import Y from "../../../../components/Popup/Popup.vue.js";
6
+ import Y from "../../../../components/Popup/Popup.vue2.js";
7
7
  import Z from "../../../icons/entities/IconTime.vue.js";
8
8
  import T from "../blocks/CardOrderItem.vue.js";
9
9
  import tt from "../../../organizations/components/blocks/CardOrganization.vue.js";
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),h=require("vue-router");require("../../../../components/Field/Field.vue.cjs");const P=require("../../../../components/Button/Button.vue2.cjs"),q=require("../../../../components/Tab/Tab.vue2.cjs"),k=require("../../../../components/Popup/Popup.vue.cjs"),u=require("../../../../components/Block/Block.vue.cjs"),b=require("../../../../components/Feed/Feed.vue.cjs"),_=require("../blocks/CardOrderItem.vue.cjs");require("../../../../components/Select/Select.vue2.cjs");require("../../../../components/SelectMulti/SelectMulti.vue2.cjs");const C=require("../../../users/components/blocks/CardUser.vue.cjs"),V=require("../sections/FormAddCustomer.vue.cjs"),O=require("../sections/FormDelivery.vue.cjs"),E=require("../sections/FormPayment.vue.cjs"),l=require("../../../globals/store/globals.cjs"),F=require("../../../auth/store/auth.cjs"),t=require("../../store/orders.cjs"),S=require("../../../products/store/products.cjs"),D=require("../../store/customers.store.cjs");require("./OrderCreateBackoffice.vue2.cjs");const R={class:"h-100 flex flex-column pd-thin"},T={class:"flex-v-center flex-nowrap flex"},A=e.createElementVNode("h2",{class:"mn-r-auto"},"Create Order",-1),I=e.createElementVNode("h3",{class:"mn-b-small"},"Add to order",-1),z={class:"bg-grey h-max-100 mn-b-thin o-scroll pd-medium radius-big"},L={key:0,class:"w-100"},M={class:"h3 flex"},U=e.createElementVNode("span",{class:"mn-r-auto t-transp"},"In total",-1),j={__name:"OrderCreateBackoffice",setup(G){const a=h.useRoute(),y=h.useRouter();t.mutations.resetOrder(t.state.current);let g=e.computed(()=>Number(t.state.current.positions.reduce((d,n)=>d+n.price*n.quantity,0)));const s=e.ref("positions"),c=e.ref(!1);function v(){c.value=!0}function m(){c.value=!1}const i=e.ref(!1);function B(){i.value=!0}function p(){i.value=!1}e.ref(null);function w(){t.state.current.creator={type:"User",target:F.state.user._id},t.state.current.owner={type:"Organization",target:a.params._id},t.state.current.customer={type:"Customer",target:t.state.current.customer._id||null},t.actions.create(t.state.current)}function x(){y.push({name:"Backoffice Orders",params:{_id:a.params._id}})}return e.onMounted(()=>{}),(d,n)=>(e.openBlock(),e.createElementBlock("div",R,[e.createVNode(u.default,{class:"mn-b-thin"},{default:e.withCtx(()=>[e.createElementVNode("header",T,[A,e.createVNode(P.default,{submit:w,callback:x,class:"pd-small radius-big bg-main t-black uppercase t-medium"},{default:e.withCtx(()=>[e.createTextVNode(" Add Order ")]),_:1})])]),_:1}),e.createVNode(q.default,{selected:s.value,"onUpdate:selected":n[0]||(n[0]=r=>s.value=r),tabs:[{name:"Positions",value:"positions"},{name:"Customer",value:"customer"},{name:"Delivery",value:"delivery"},{name:"Payment",value:"payment"}],class:"t-medium radius-medium bg-grey mn-b-small"},null,8,["selected"]),e.createVNode(k.default,{onClosePopup:m,isPopupOpen:c.value,class:"bg-white w-min-30r w-max-30r h-max-100 flex flex-column radius-big pd-medium pos-relative"},{default:e.withCtx(()=>[I,e.createElementVNode("div",z,[e.createVNode(b.default,{search:{placeholder:"Search products...",class:"bg-white mn-b-thin"},states:{empty:{title:"No Products Found",description:"Currently, there are no such products available."}},store:{read:r=>S.actions.read(r),state:null},options:{organization:e.unref(a).params._id},class:""},{default:e.withCtx(({items:r})=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r,(o,N)=>(e.openBlock(),e.createBlock(_.default,{key:o._id,editable:!1,product:o,onClick:()=>{let f={...o};f.quantity=1,l.actions.add(t.state.current.positions,f),m()},class:"bg-white pd-thin radius-medium w-100 mn-b-thin"},null,8,["product","onClick"]))),128))]),_:1},8,["store","options"])])]),_:1},8,["isPopupOpen"]),s.value==="positions"?(e.openBlock(),e.createBlock(u.default,{key:0,title:"Positions",actions:[{label:"+",function:()=>v()}],class:"mn-b-small"},{default:e.withCtx(()=>[t.state.current.positions.length===0?(e.openBlock(),e.createElementBlock("span",L," No positions added yet ")):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.state.current.positions,(r,o)=>(e.openBlock(),e.createBlock(_.default,{key:r._id,editable:!0,product:r,onIncrease:()=>{l.actions.increment(t.state.current.positions,r)},onDecrease:()=>{l.actions.decrement(t.state.current.positions,r)},onRemove:()=>{l.actions.delete(t.state.current.positions,r)},class:"mn-b-thin pd-thin radius-medium bg-white"},null,8,["product","onIncrease","onDecrease","onRemove"]))),128))]),_:1},8,["actions"])):e.createCommentVNode("",!0),s.value==="customer"?(e.openBlock(),e.createBlock(u.default,{key:1,title:"Customer",class:"mn-b-semi",actions:[{label:"+",function:()=>B()}]},{default:e.withCtx(()=>[t.state.current.customer._id?(e.openBlock(),e.createBlock(C.default,{key:0,user:t.state.current.customer,photo:t.state.current.customer.profile.photo,name:t.state.current.customer.profile.name||t.state.current.customer.phone||t.state.current.customer.email,onClick:n[1]||(n[1]=()=>{t.mutations.resetCustomer(t.state.current.customer)}),class:"bg-white pd-thin radius-medium w-100 mn-b-thin"},null,8,["user","photo","name"])):(e.openBlock(),e.createBlock(b.default,{key:1,search:{placeholder:"Search customer...",class:"bg-white mn-b-thin"},states:{empty:{title:"No Products Found",description:"Currently, there are no such products available."}},store:{read:r=>e.unref(D.default).read(r),state:null},options:{owner:e.unref(a).params._id},class:"bg-grey h-max-20r o-scroll"},{default:e.withCtx(({items:r})=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r,(o,N)=>(e.openBlock(),e.createBlock(C.default,{key:o._id,user:o,photo:o.profile.photo,name:o.profile.name||o.phone||o.email,onClick:()=>{t.state.current.customer=o},class:"bg-white pd-thin radius-medium w-100 mn-b-thin"},null,8,["user","photo","name","onClick"]))),128))]),_:1},8,["store","options"]))]),_:1},8,["actions"])):e.createCommentVNode("",!0),s.value==="delivery"?(e.openBlock(),e.createBlock(O.default,{key:2,order:t.state.current},null,8,["order"])):e.createCommentVNode("",!0),s.value==="payment"?(e.openBlock(),e.createBlock(E.default,{key:3,order:t.state.current},null,8,["order"])):e.createCommentVNode("",!0),e.createVNode(k.default,{title:"Add customer",onClosePopup:p,isPopupOpen:i.value,class:e.normalizeClass("bg-white w-min-30r w-max-30r radius-big pd-medium")},{default:e.withCtx(()=>[e.createVNode(V.default,{onCallbackCustomer:p})]),_:1},8,["isPopupOpen"]),e.createVNode(u.default,{class:"mn-b-semi"},{default:e.withCtx(()=>[e.createElementVNode("div",M,[U,e.createElementVNode("span",null,e.toDisplayString(e.unref(g))+" "+e.toDisplayString(d.returnCurrency()),1)])]),_:1})]))}};exports.default=j;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),h=require("vue-router");require("../../../../components/Field/Field.vue.cjs");const P=require("../../../../components/Button/Button.vue2.cjs"),q=require("../../../../components/Tab/Tab.vue2.cjs"),k=require("../../../../components/Popup/Popup.vue2.cjs"),u=require("../../../../components/Block/Block.vue.cjs"),b=require("../../../../components/Feed/Feed.vue.cjs"),_=require("../blocks/CardOrderItem.vue.cjs");require("../../../../components/Select/Select.vue.cjs");require("../../../../components/SelectMulti/SelectMulti.vue2.cjs");const C=require("../../../users/components/blocks/CardUser.vue.cjs"),V=require("../sections/FormAddCustomer.vue.cjs"),O=require("../sections/FormDelivery.vue.cjs"),E=require("../sections/FormPayment.vue.cjs"),l=require("../../../globals/store/globals.cjs"),F=require("../../../auth/store/auth.cjs"),t=require("../../store/orders.cjs"),S=require("../../../products/store/products.cjs"),D=require("../../store/customers.store.cjs");require("./OrderCreateBackoffice.vue2.cjs");const R={class:"h-100 flex flex-column pd-thin"},T={class:"flex-v-center flex-nowrap flex"},A=e.createElementVNode("h2",{class:"mn-r-auto"},"Create Order",-1),I=e.createElementVNode("h3",{class:"mn-b-small"},"Add to order",-1),z={class:"bg-grey h-max-100 mn-b-thin o-scroll pd-medium radius-big"},L={key:0,class:"w-100"},M={class:"h3 flex"},U=e.createElementVNode("span",{class:"mn-r-auto t-transp"},"In total",-1),j={__name:"OrderCreateBackoffice",setup(G){const a=h.useRoute(),y=h.useRouter();t.mutations.resetOrder(t.state.current);let g=e.computed(()=>Number(t.state.current.positions.reduce((d,n)=>d+n.price*n.quantity,0)));const s=e.ref("positions"),c=e.ref(!1);function v(){c.value=!0}function m(){c.value=!1}const i=e.ref(!1);function B(){i.value=!0}function p(){i.value=!1}e.ref(null);function w(){t.state.current.creator={type:"User",target:F.state.user._id},t.state.current.owner={type:"Organization",target:a.params._id},t.state.current.customer={type:"Customer",target:t.state.current.customer._id||null},t.actions.create(t.state.current)}function x(){y.push({name:"Backoffice Orders",params:{_id:a.params._id}})}return e.onMounted(()=>{}),(d,n)=>(e.openBlock(),e.createElementBlock("div",R,[e.createVNode(u.default,{class:"mn-b-thin"},{default:e.withCtx(()=>[e.createElementVNode("header",T,[A,e.createVNode(P.default,{submit:w,callback:x,class:"pd-small radius-big bg-main t-black uppercase t-medium"},{default:e.withCtx(()=>[e.createTextVNode(" Add Order ")]),_:1})])]),_:1}),e.createVNode(q.default,{selected:s.value,"onUpdate:selected":n[0]||(n[0]=r=>s.value=r),tabs:[{name:"Positions",value:"positions"},{name:"Customer",value:"customer"},{name:"Delivery",value:"delivery"},{name:"Payment",value:"payment"}],class:"t-medium radius-medium bg-grey mn-b-small"},null,8,["selected"]),e.createVNode(k.default,{onClosePopup:m,isPopupOpen:c.value,class:"bg-white w-min-30r w-max-30r h-max-100 flex flex-column radius-big pd-medium pos-relative"},{default:e.withCtx(()=>[I,e.createElementVNode("div",z,[e.createVNode(b.default,{search:{placeholder:"Search products...",class:"bg-white mn-b-thin"},states:{empty:{title:"No Products Found",description:"Currently, there are no such products available."}},store:{read:r=>S.actions.read(r),state:null},options:{organization:e.unref(a).params._id},class:""},{default:e.withCtx(({items:r})=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r,(o,N)=>(e.openBlock(),e.createBlock(_.default,{key:o._id,editable:!1,product:o,onClick:()=>{let f={...o};f.quantity=1,l.actions.add(t.state.current.positions,f),m()},class:"bg-white pd-thin radius-medium w-100 mn-b-thin"},null,8,["product","onClick"]))),128))]),_:1},8,["store","options"])])]),_:1},8,["isPopupOpen"]),s.value==="positions"?(e.openBlock(),e.createBlock(u.default,{key:0,title:"Positions",actions:[{label:"+",function:()=>v()}],class:"mn-b-small"},{default:e.withCtx(()=>[t.state.current.positions.length===0?(e.openBlock(),e.createElementBlock("span",L," No positions added yet ")):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.state.current.positions,(r,o)=>(e.openBlock(),e.createBlock(_.default,{key:r._id,editable:!0,product:r,onIncrease:()=>{l.actions.increment(t.state.current.positions,r)},onDecrease:()=>{l.actions.decrement(t.state.current.positions,r)},onRemove:()=>{l.actions.delete(t.state.current.positions,r)},class:"mn-b-thin pd-thin radius-medium bg-white"},null,8,["product","onIncrease","onDecrease","onRemove"]))),128))]),_:1},8,["actions"])):e.createCommentVNode("",!0),s.value==="customer"?(e.openBlock(),e.createBlock(u.default,{key:1,title:"Customer",class:"mn-b-semi",actions:[{label:"+",function:()=>B()}]},{default:e.withCtx(()=>[t.state.current.customer._id?(e.openBlock(),e.createBlock(C.default,{key:0,user:t.state.current.customer,photo:t.state.current.customer.profile.photo,name:t.state.current.customer.profile.name||t.state.current.customer.phone||t.state.current.customer.email,onClick:n[1]||(n[1]=()=>{t.mutations.resetCustomer(t.state.current.customer)}),class:"bg-white pd-thin radius-medium w-100 mn-b-thin"},null,8,["user","photo","name"])):(e.openBlock(),e.createBlock(b.default,{key:1,search:{placeholder:"Search customer...",class:"bg-white mn-b-thin"},states:{empty:{title:"No Products Found",description:"Currently, there are no such products available."}},store:{read:r=>e.unref(D.default).read(r),state:null},options:{owner:e.unref(a).params._id},class:"bg-grey h-max-20r o-scroll"},{default:e.withCtx(({items:r})=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r,(o,N)=>(e.openBlock(),e.createBlock(C.default,{key:o._id,user:o,photo:o.profile.photo,name:o.profile.name||o.phone||o.email,onClick:()=>{t.state.current.customer=o},class:"bg-white pd-thin radius-medium w-100 mn-b-thin"},null,8,["user","photo","name","onClick"]))),128))]),_:1},8,["store","options"]))]),_:1},8,["actions"])):e.createCommentVNode("",!0),s.value==="delivery"?(e.openBlock(),e.createBlock(O.default,{key:2,order:t.state.current},null,8,["order"])):e.createCommentVNode("",!0),s.value==="payment"?(e.openBlock(),e.createBlock(E.default,{key:3,order:t.state.current},null,8,["order"])):e.createCommentVNode("",!0),e.createVNode(k.default,{title:"Add customer",onClosePopup:p,isPopupOpen:i.value,class:e.normalizeClass("bg-white w-min-30r w-max-30r radius-big pd-medium")},{default:e.withCtx(()=>[e.createVNode(V.default,{onCallbackCustomer:p})]),_:1},8,["isPopupOpen"]),e.createVNode(u.default,{class:"mn-b-semi"},{default:e.withCtx(()=>[e.createElementVNode("div",M,[U,e.createElementVNode("span",null,e.toDisplayString(e.unref(g))+" "+e.toDisplayString(d.returnCurrency()),1)])]),_:1})]))}};exports.default=j;
@@ -3,11 +3,11 @@ import { useRoute as L, useRouter as M } from "vue-router";
3
3
  import "../../../../components/Field/Field.vue.js";
4
4
  import j from "../../../../components/Button/Button.vue2.js";
5
5
  import G from "../../../../components/Tab/Tab.vue2.js";
6
- import O from "../../../../components/Popup/Popup.vue.js";
6
+ import O from "../../../../components/Popup/Popup.vue2.js";
7
7
  import _ from "../../../../components/Block/Block.vue.js";
8
8
  import $ from "../../../../components/Feed/Feed.vue.js";
9
9
  import N from "../blocks/CardOrderItem.vue.js";
10
- import "../../../../components/Select/Select.vue2.js";
10
+ import "../../../../components/Select/Select.vue.js";
11
11
  import "../../../../components/SelectMulti/SelectMulti.vue2.js";
12
12
  import B from "../../../users/components/blocks/CardUser.vue.js";
13
13
  import H from "../sections/FormAddCustomer.vue.js";
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),h=require("vue-router"),k=require("../../../../components/Block/Block.vue.cjs");require("../../../../components/Field/Field.vue.cjs");const b=require("../../../../components/FieldPhone/click-outside.cjs");require("../../../../components/Select/Select.vue2.cjs");const g=require("../../../../components/Feed/Feed.vue.cjs"),v=require("../../../../components/Button/Button.vue2.cjs"),C=require("../../../globals/components/blocks/BlockSearch.vue.cjs"),n=require("../../../users/components/blocks/CardUser.vue.cjs"),q=require("./FormCustomerDetails.vue.cjs"),_=require("../../../users/store/users.cjs"),w=require("../../../auth/store/auth.cjs"),y=require("../../../globals/store/globals.cjs"),B=require("../../store/customers.store.cjs"),x=require("../../store/models/customer.cjs"),E={key:2,class:"mn-t-thin pos-absolute w-100 pos-t-100 pos-l-0 z-index-3 bg-grey pd-small radius-small"},N={__name:"FormAddCustomer",props:{order:Object},emits:["callbackCustomer"],setup(V,{emit:i}){let c=b.default;const d=i,m=h.useRoute();let r=e.ref(x.default),u=e.ref(null),l=e.ref(!1);async function f(){let a={identity:{type:r.value.user?"User":"Visitor",target:r.value.user?r.value.user._id:null},owner:{type:"Organization",target:m.params._id},creator:{type:"User",target:w.state.user._id},phone:r.value.phone,email:r.value.email,profile:r.value.profile,socials:r.value.socials};try{let o=await B.default.create(a);r.value=o}catch(o){console.log(o)}}function p(){d("callbackCustomer",r.value)}return(a,o)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createVNode(k.default,{class:"pos-relative mn-b-thin"},{default:e.withCtx(()=>[e.unref(r).user?(e.openBlock(),e.createBlock(n.default,{key:1,user:e.unref(r).user,photo:e.unref(r).user.profile.photo,name:e.unref(r).user.profile.name||e.unref(r).user.phone||e.unref(r).user.email,onClick:o[1]||(o[1]=()=>{e.unref(r).user=null}),class:"bg-white pd-thin radius-medium w-100"},null,8,["user","photo","name"])):e.withDirectives((e.openBlock(),e.createBlock(C.default,{key:0,onSearch:o[0]||(o[0]=s=>{e.isRef(u)?u.value=s:u=s,e.isRef(l)?l.value=!0:l=!0}),placeholder:"Enter name, phone or email",class:"bg-white"},null,512)),[[e.unref(c),()=>{e.isRef(l)?l.value=!1:l=!1}]]),e.unref(u)&&e.unref(l)&&!e.unref(r).user?(e.openBlock(),e.createElementBlock("div",E,[e.createVNode(g.default,{states:{empty:{title:"No User Found",description:"Currently, there are no such user."}},store:{read:s=>_.actions.read(s),state:null},options:{search:e.unref(u)},showLoadMore:!1,class:"h-max-20r o-scroll"},{default:e.withCtx(({items:s})=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s,(t,F)=>(e.openBlock(),e.createBlock(n.default,{key:t._id,user:t,photo:t.profile.photo,name:t.profile.name||t.phone||t.email,onClick:()=>{e.unref(r).user=t,e.unref(r).profile=t.profile,e.unref(r).phone=t.phone,e.unref(r).email=t.email,e.unref(r).socials=t.socials},class:"bg-white pd-thin radius-medium w-100 mn-b-thin"},null,8,["user","photo","name","onClick"]))),128))]),_:1},8,["store","options"])])):e.createCommentVNode("",!0)]),_:1}),e.createVNode(q.default,{customer:e.unref(r),class:"mn-b-thin bg-grey"},null,8,["customer"]),e.createVNode(v.default,{submit:f,callback:p,onError:e.unref(y.setError),class:"w-100 pd-small radius-big bg-main t-black uppercase t-medium"},{default:e.withCtx(()=>[e.createTextVNode(" Add Customer ")]),_:1},8,["onError"])],64))}};exports.default=N;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),h=require("vue-router"),k=require("../../../../components/Block/Block.vue.cjs");require("../../../../components/Field/Field.vue.cjs");const b=require("../../../../components/FieldPhone/click-outside.cjs");require("../../../../components/Select/Select.vue.cjs");const g=require("../../../../components/Feed/Feed.vue.cjs"),v=require("../../../../components/Button/Button.vue2.cjs"),C=require("../../../globals/components/blocks/BlockSearch.vue.cjs"),n=require("../../../users/components/blocks/CardUser.vue.cjs"),q=require("./FormCustomerDetails.vue.cjs"),_=require("../../../users/store/users.cjs"),w=require("../../../auth/store/auth.cjs"),y=require("../../../globals/store/globals.cjs"),B=require("../../store/customers.store.cjs"),x=require("../../store/models/customer.cjs"),E={key:2,class:"mn-t-thin pos-absolute w-100 pos-t-100 pos-l-0 z-index-3 bg-grey pd-small radius-small"},N={__name:"FormAddCustomer",props:{order:Object},emits:["callbackCustomer"],setup(V,{emit:i}){let c=b.default;const d=i,m=h.useRoute();let r=e.ref(x.default),u=e.ref(null),l=e.ref(!1);async function f(){let a={identity:{type:r.value.user?"User":"Visitor",target:r.value.user?r.value.user._id:null},owner:{type:"Organization",target:m.params._id},creator:{type:"User",target:w.state.user._id},phone:r.value.phone,email:r.value.email,profile:r.value.profile,socials:r.value.socials};try{let o=await B.default.create(a);r.value=o}catch(o){console.log(o)}}function p(){d("callbackCustomer",r.value)}return(a,o)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createVNode(k.default,{class:"pos-relative mn-b-thin"},{default:e.withCtx(()=>[e.unref(r).user?(e.openBlock(),e.createBlock(n.default,{key:1,user:e.unref(r).user,photo:e.unref(r).user.profile.photo,name:e.unref(r).user.profile.name||e.unref(r).user.phone||e.unref(r).user.email,onClick:o[1]||(o[1]=()=>{e.unref(r).user=null}),class:"bg-white pd-thin radius-medium w-100"},null,8,["user","photo","name"])):e.withDirectives((e.openBlock(),e.createBlock(C.default,{key:0,onSearch:o[0]||(o[0]=s=>{e.isRef(u)?u.value=s:u=s,e.isRef(l)?l.value=!0:l=!0}),placeholder:"Enter name, phone or email",class:"bg-white"},null,512)),[[e.unref(c),()=>{e.isRef(l)?l.value=!1:l=!1}]]),e.unref(u)&&e.unref(l)&&!e.unref(r).user?(e.openBlock(),e.createElementBlock("div",E,[e.createVNode(g.default,{states:{empty:{title:"No User Found",description:"Currently, there are no such user."}},store:{read:s=>_.actions.read(s),state:null},options:{search:e.unref(u)},showLoadMore:!1,class:"h-max-20r o-scroll"},{default:e.withCtx(({items:s})=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s,(t,F)=>(e.openBlock(),e.createBlock(n.default,{key:t._id,user:t,photo:t.profile.photo,name:t.profile.name||t.phone||t.email,onClick:()=>{e.unref(r).user=t,e.unref(r).profile=t.profile,e.unref(r).phone=t.phone,e.unref(r).email=t.email,e.unref(r).socials=t.socials},class:"bg-white pd-thin radius-medium w-100 mn-b-thin"},null,8,["user","photo","name","onClick"]))),128))]),_:1},8,["store","options"])])):e.createCommentVNode("",!0)]),_:1}),e.createVNode(q.default,{customer:e.unref(r),class:"mn-b-thin bg-grey"},null,8,["customer"]),e.createVNode(v.default,{submit:f,callback:p,onError:e.unref(y.setError),class:"w-100 pd-small radius-big bg-main t-black uppercase t-medium"},{default:e.withCtx(()=>[e.createTextVNode(" Add Customer ")]),_:1},8,["onError"])],64))}};exports.default=N;
@@ -3,7 +3,7 @@ import { useRoute as U } from "vue-router";
3
3
  import N from "../../../../components/Block/Block.vue.js";
4
4
  import "../../../../components/Field/Field.vue.js";
5
5
  import O from "../../../../components/FieldPhone/click-outside.js";
6
- import "../../../../components/Select/Select.vue2.js";
6
+ import "../../../../components/Select/Select.vue.js";
7
7
  import V from "../../../../components/Feed/Feed.vue.js";
8
8
  import B from "../../../../components/Button/Button.vue2.js";
9
9
  import F from "../../../globals/components/blocks/BlockSearch.vue.js";
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),r=require("../../../../components/Block/Block.vue.cjs"),n=require("../../../../components/Field/Field.vue2.cjs"),o=require("../../../../components/FieldPhone/FieldPhone.vue.cjs"),u=require("../../../../components/Select/Select.vue.cjs"),i={class:"gap-thin flex-justify-between flex-nowrap flex"},d={__name:"FormCustomerDetails",props:{customer:Object,title:{type:String,default:"Personal Data"}},setup(a){let s=e.ref("instagram");return(m,l)=>(e.openBlock(),e.createBlock(r.default,{title:a.title,class:"mn-b-thin"},{default:e.withCtx(()=>[e.createVNode(n.default,{field:a.customer.profile.name,"onUpdate:field":l[0]||(l[0]=t=>a.customer.profile.name=t),label:"Name",placeholder:"Enter name",class:"bg-white pd-small radius-small mn-b-thin"},null,8,["field"]),e.createVNode(o.default,{modelValue:a.customer.phone,"onUpdate:modelValue":l[1]||(l[1]=t=>a.customer.phone=t),onCountry:l[2]||(l[2]=t=>{a.customer.number=t}),inputOptions:{placeholder:"Enter phone number",type:"tel"},defaultCountry:"TH",validCharactersOnly:!0,dropdownOptions:{showDialCodeInSelection:!0,showFlags:!0,showDialCodeInList:!0},mode:"national",class:"w-100 bg-white pd-small mn-b-thin radius-small"},null,8,["modelValue"]),e.createElementVNode("div",i,[e.createVNode(u.default,{select:e.unref(s),options:[{name:"Instagram",value:"instagram"},{name:"Telegram",value:"telegram"},{name:"WhatsApp",value:"whatsapp"}],"onUpdate:select":l[3]||(l[3]=t=>e.isRef(s)?s.value=t:s=t),placeholder:"Messenger",size:"small",class:"bg-white pd-small radius-small"},null,8,["select"]),e.createVNode(n.default,{field:a.customer.socials[e.unref(s)],"onUpdate:field":l[4]||(l[4]=t=>a.customer.socials[e.unref(s)]=t),label:"@",placeholder:"Enter username",class:"bg-white pd-small radius-small w-100"},null,8,["field"])])]),_:1},8,["title"]))}};exports.default=d;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),r=require("../../../../components/Block/Block.vue.cjs"),n=require("../../../../components/Field/Field.vue2.cjs"),o=require("../../../../components/FieldPhone/FieldPhone.vue.cjs"),u=require("../../../../components/Select/Select.vue2.cjs"),i={class:"gap-thin flex-justify-between flex-nowrap flex"},d={__name:"FormCustomerDetails",props:{customer:Object,title:{type:String,default:"Personal Data"}},setup(a){let s=e.ref("instagram");return(m,l)=>(e.openBlock(),e.createBlock(r.default,{title:a.title,class:"mn-b-thin"},{default:e.withCtx(()=>[e.createVNode(n.default,{field:a.customer.profile.name,"onUpdate:field":l[0]||(l[0]=t=>a.customer.profile.name=t),label:"Name",placeholder:"Enter name",class:"bg-white pd-small radius-small mn-b-thin"},null,8,["field"]),e.createVNode(o.default,{modelValue:a.customer.phone,"onUpdate:modelValue":l[1]||(l[1]=t=>a.customer.phone=t),onCountry:l[2]||(l[2]=t=>{a.customer.number=t}),inputOptions:{placeholder:"Enter phone number",type:"tel"},defaultCountry:"TH",validCharactersOnly:!0,dropdownOptions:{showDialCodeInSelection:!0,showFlags:!0,showDialCodeInList:!0},mode:"national",class:"w-100 bg-white pd-small mn-b-thin radius-small"},null,8,["modelValue"]),e.createElementVNode("div",i,[e.createVNode(u.default,{select:e.unref(s),options:[{name:"Instagram",value:"instagram"},{name:"Telegram",value:"telegram"},{name:"WhatsApp",value:"whatsapp"}],"onUpdate:select":l[3]||(l[3]=t=>e.isRef(s)?s.value=t:s=t),placeholder:"Messenger",size:"small",class:"bg-white pd-small radius-small"},null,8,["select"]),e.createVNode(n.default,{field:a.customer.socials[e.unref(s)],"onUpdate:field":l[4]||(l[4]=t=>a.customer.socials[e.unref(s)]=t),label:"@",placeholder:"Enter username",class:"bg-white pd-small radius-small w-100"},null,8,["field"])])]),_:1},8,["title"]))}};exports.default=d;
@@ -2,7 +2,7 @@ import { ref as r, openBlock as m, createBlock as i, withCtx as u, createVNode a
2
2
  import p from "../../../../components/Block/Block.vue.js";
3
3
  import o from "../../../../components/Field/Field.vue2.js";
4
4
  import c from "../../../../components/FieldPhone/FieldPhone.vue.js";
5
- import h from "../../../../components/Select/Select.vue.js";
5
+ import h from "../../../../components/Select/Select.vue2.js";
6
6
  const g = { class: "gap-thin flex-justify-between flex-nowrap flex" }, V = {
7
7
  __name: "FormCustomerDetails",
8
8
  props: {
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),r=require("../../../../components/Block/Block.vue.cjs"),n=require("../../../../components/Select/Select.vue.cjs"),o={class:"mn-b-small flex-nowrap flex"},s={__name:"FormPayment",props:{order:Object},setup(t){return(c,l)=>(e.openBlock(),e.createBlock(r.default,{title:"Payment"},{default:e.withCtx(()=>[e.createElementVNode("div",o,[e.createVNode(n.default,{select:t.order.payment.type,"onUpdate:select":l[0]||(l[0]=a=>t.order.payment.type=a),property:"value",options:[{name:"Cash On Delivery",value:"cash"},{name:"Bank Transfer",value:"bank"},{name:"Crypto",value:"crypto"}],placeholder:"Select type of payment",size:"small",class:"bg-white pd-medium radius-small w-100"},null,8,["select"])])]),_:1}))}};exports.default=s;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),r=require("../../../../components/Block/Block.vue.cjs"),n=require("../../../../components/Select/Select.vue2.cjs"),o={class:"mn-b-small flex-nowrap flex"},s={__name:"FormPayment",props:{order:Object},setup(t){return(c,l)=>(e.openBlock(),e.createBlock(r.default,{title:"Payment"},{default:e.withCtx(()=>[e.createElementVNode("div",o,[e.createVNode(n.default,{select:t.order.payment.type,"onUpdate:select":l[0]||(l[0]=a=>t.order.payment.type=a),property:"value",options:[{name:"Cash On Delivery",value:"cash"},{name:"Bank Transfer",value:"bank"},{name:"Crypto",value:"crypto"}],placeholder:"Select type of payment",size:"small",class:"bg-white pd-medium radius-small w-100"},null,8,["select"])])]),_:1}))}};exports.default=s;