@ozdao/prometheus-framework 0.1.68 → 0.1.69

Sign up to get free protection for your applications and to get access to all the features.
Files changed (161) hide show
  1. package/dist/BackofficeGallery-59a591ab.js +1 -0
  2. package/dist/BackofficeGallery-be6f69a9.mjs +307 -0
  3. package/dist/BackofficeReports-06166952.js +1 -0
  4. package/dist/BackofficeReports-50fd799c.mjs +44 -0
  5. package/dist/BlockTags-00325fa0.mjs +853 -0
  6. package/dist/BlockTags-58f95c8a.js +1 -0
  7. package/dist/ButtonToggleMembership-84d0e018.mjs +90 -0
  8. package/dist/ButtonToggleMembership-b905812f.js +1 -0
  9. package/dist/CardBlogpost-1b81b54e.mjs +246 -0
  10. package/dist/CardBlogpost-7107e04a.js +1 -0
  11. package/dist/CardOrganization-49ab5190.mjs +234 -0
  12. package/dist/CardOrganization-e6ac27f1.js +1 -0
  13. package/dist/CardProduct-4c0cb9a1.js +1 -0
  14. package/dist/CardProduct-ea0e1f84.mjs +192 -0
  15. package/dist/Chips-817cf959.js +1 -0
  16. package/dist/Chips-8c836ba6.mjs +213 -0
  17. package/dist/Community-8c4e011b.js +1 -0
  18. package/dist/Community-bd6f0cbb.mjs +131 -0
  19. package/dist/Dashboard-73b50724.js +1 -0
  20. package/dist/Dashboard-bc81b5f6.mjs +151 -0
  21. package/dist/Dropdown-60e3dc6c.js +1 -0
  22. package/dist/Dropdown-d1c81d45.mjs +169 -0
  23. package/dist/EditOrder-2b746caf.mjs +221 -0
  24. package/dist/EditOrder-e632f0cc.js +1 -0
  25. package/dist/Events-999cc8ed.js +1 -0
  26. package/dist/Events-ad8bbf27.mjs +134 -0
  27. package/dist/Feed-35e13c22.mjs +156 -0
  28. package/dist/Feed-53d96b18.mjs +361 -0
  29. package/dist/Feed-694a2fad.js +1 -0
  30. package/dist/Feed-ac4bb6ea.js +1 -0
  31. package/dist/Feed-d1d01771.js +1 -0
  32. package/dist/Feed-f7c04014.mjs +124 -0
  33. package/dist/Image-61cfd52d.js +9 -0
  34. package/dist/Image-e8be4acc.mjs +480 -0
  35. package/dist/LeftoverAdd-a268a95c.js +1 -0
  36. package/dist/LeftoverAdd-e4d93760.mjs +229 -0
  37. package/dist/Leftovers-6976802d.mjs +135 -0
  38. package/dist/Leftovers-d8f1d152.js +1 -0
  39. package/dist/Members-aeb2bca1.mjs +109 -0
  40. package/dist/Members-b9664e83.js +1 -0
  41. package/dist/Menu-93d34d9f.js +1 -0
  42. package/dist/Menu-eaf6b44c.mjs +13 -0
  43. package/dist/MenuItem-4a5881bd.mjs +85 -0
  44. package/dist/MenuItem-f35cad93.js +1 -0
  45. package/dist/Orders-8bc8963c.js +1 -0
  46. package/dist/Orders-eb262d8c.mjs +75 -0
  47. package/dist/Organizations-9926aa51.mjs +72 -0
  48. package/dist/Organizations-c653d814.js +1 -0
  49. package/dist/Payments-98328000.js +1 -0
  50. package/dist/Payments-a9066cdf.mjs +11 -0
  51. package/dist/Popup-0d8e1392.mjs +96 -0
  52. package/dist/Popup-eb11fa82.js +1 -0
  53. package/dist/Product-15043af7.mjs +651 -0
  54. package/dist/Product-82c022a4.js +7 -0
  55. package/dist/ProductEdit-05da9866.mjs +258 -0
  56. package/dist/ProductEdit-2f075296.js +1 -0
  57. package/dist/ProductsBackoffice-8462f626.js +1 -0
  58. package/dist/ProductsBackoffice-8d0f0ee8.mjs +85 -0
  59. package/dist/ProfileBlogposts-43855cb9.js +1 -0
  60. package/dist/ProfileBlogposts-f32170a3.mjs +78 -0
  61. package/dist/ProfileEvents-54be2d43.mjs +69 -0
  62. package/dist/ProfileEvents-ab69e27e.js +1 -0
  63. package/dist/ProfileOrganizations-0787cf34.mjs +72 -0
  64. package/dist/ProfileOrganizations-eb62dde4.js +1 -0
  65. package/dist/Publics-8e726d20.mjs +45 -0
  66. package/dist/Publics-ae589bf1.js +1 -0
  67. package/dist/Select-95f4701a.js +1 -0
  68. package/dist/Select-dab17282.mjs +80 -0
  69. package/dist/Select.vue_vue_type_style_index_0_scoped_dfe03dc2_lang-0ea8fbf8.js +1 -0
  70. package/dist/Select.vue_vue_type_style_index_0_scoped_dfe03dc2_lang-4ed993c7.mjs +1 -0
  71. package/dist/Socials-43293869.js +1 -0
  72. package/dist/Socials-8193477c.mjs +189 -0
  73. package/dist/UploadImage-0e8e4278.mjs +83 -0
  74. package/dist/UploadImage-8c71bda6.js +1 -0
  75. package/dist/UploadImageMultiple-c34a6c6f.mjs +58 -0
  76. package/dist/UploadImageMultiple-d1316df5.js +1 -0
  77. package/dist/Wallet-727195d9.mjs +21700 -0
  78. package/dist/Wallet-f4dda407.js +10 -0
  79. package/dist/auth-04684a60.js +7 -0
  80. package/dist/auth-7e39361f.mjs +633 -0
  81. package/dist/auth.client.cjs +1 -1
  82. package/dist/auth.client.js +5 -5
  83. package/dist/auth.server.js +1 -1
  84. package/dist/auth.server.mjs +1 -1
  85. package/dist/auth.validation-d614130d.js +1 -0
  86. package/dist/auth.validation-f4bf1deb.mjs +24 -0
  87. package/dist/axios-33aeb810.mjs +1435 -0
  88. package/dist/axios-ceccf20e.js +5 -0
  89. package/dist/backoffice.client.cjs +1 -1
  90. package/dist/backoffice.client.js +20 -20
  91. package/dist/categories-7e17a7eb.js +1 -0
  92. package/dist/categories-b7f9e8c0.mjs +122 -0
  93. package/dist/community.client.cjs +1 -1
  94. package/dist/community.client.js +209 -202
  95. package/dist/components/Upload/Upload.vue.d.ts.map +1 -1
  96. package/dist/events.client.cjs +2 -2
  97. package/dist/events.client.js +24 -27
  98. package/dist/landing.client.cjs +1 -1
  99. package/dist/landing.client.js +64 -40
  100. package/dist/leftovers-86e7d438.mjs +67 -0
  101. package/dist/leftovers-c9f70579.js +1 -0
  102. package/dist/legal.client.cjs +1 -1
  103. package/dist/legal.client.js +6 -7
  104. package/dist/main.css +1 -1
  105. package/dist/memberships-559590ad.mjs +68 -0
  106. package/dist/memberships-58af22e0.js +1 -0
  107. package/dist/modules/constructor/components/elements/H2.vue.d.ts +1 -1
  108. package/dist/modules/constructor/components/elements/Textarea.vue.d.ts +1 -1
  109. package/dist/modules/products/components/sections/EditProductInfo.vue.d.ts +1 -5
  110. package/dist/orders-1325c51b.js +1 -0
  111. package/dist/orders-c7cbe706.mjs +85 -0
  112. package/dist/organizations-71777b32.js +1 -0
  113. package/dist/organizations-93f7b610.mjs +122 -0
  114. package/dist/organizations.client-6ca27fb3.js +3 -0
  115. package/dist/organizations.client-bd63a7b2.mjs +2997 -0
  116. package/dist/organizations.client.cjs +1 -1
  117. package/dist/organizations.client.js +56 -61
  118. package/dist/products-61d83d74.js +1 -0
  119. package/dist/products-7f1e5a75.mjs +108 -0
  120. package/dist/prometheus-framework.cjs.js +21 -21
  121. package/dist/prometheus-framework.es.js +682 -690
  122. package/dist/reports-a67b4fb4.js +1 -0
  123. package/dist/reports-c579b02a.mjs +91 -0
  124. package/dist/reports.client.cjs +1 -1
  125. package/dist/reports.client.js +2 -2
  126. package/dist/states.validation-3b4604bc.mjs +13 -0
  127. package/dist/states.validation-9b43a097.js +1 -0
  128. package/dist/style.css +1 -1
  129. package/dist/users.client.cjs +1 -1
  130. package/dist/users.client.js +279 -208
  131. package/package.json +30 -35
  132. package/src/components/Button/Button.vue +1 -1
  133. package/src/components/Sidebar/Sidebar.vue +10 -8
  134. package/src/components/Upload/Upload.vue +8 -28
  135. package/src/modules/auth/controllers/auth.controller.js +1 -1
  136. package/src/modules/auth/store/auth.js +21 -24
  137. package/src/modules/backoffice/components/admin/ProductEdit.vue +2 -0
  138. package/src/modules/constructor/components/sections/Constructor.vue +7 -54
  139. package/src/modules/gallery/components/pages/Gallery.vue +7 -1
  140. package/src/modules/gallery/components/sections/GalleryWithCategories.vue +24 -8
  141. package/src/modules/gallery/gallery.client.js +5 -1
  142. package/src/modules/marketplace/components/layouts/Marketplace.vue +1 -0
  143. package/src/modules/organizations/components/pages/Organization.vue +2 -2
  144. package/src/modules/payments/components/pages/Payments.vue +4 -3
  145. package/src/modules/products/components/blocks/CardLeftover.vue +0 -1
  146. package/src/modules/products/components/blocks/CardProduct.vue +15 -1
  147. package/src/modules/products/components/sections/EditProductInfo.vue +16 -14
  148. package/src/modules/products/components/sections/FilterProducts.vue +0 -2
  149. package/src/modules/products/components/sections/SectionProduct.vue +1 -0
  150. package/src/modules/products/components/sections/SortProducts.vue +2 -0
  151. package/src/modules/products/store/categories.js +9 -9
  152. package/src/modules/products/store/leftovers.js +6 -9
  153. package/src/modules/products/store/products.js +2 -0
  154. package/src/modules/users/components/pages/Profile.vue +3 -5
  155. package/src/modules/wallet/components/pages/Wallet.vue +1 -1
  156. package/src/styles/components/button.scss +253 -0
  157. package/src/styles/theme.scss +1 -0
  158. package/src/modules/constructor/components/elements/Audio.vue +0 -82
  159. package/src/modules/constructor/components/elements/Embed.vue +0 -85
  160. package/src/modules/globals/mixins/mixins.js +0 -52
  161. package/src/modules/globals/router/routerGuards.js +0 -28
@@ -0,0 +1 @@
1
+ "use strict";const s=require("vue"),E=require("./auth-04684a60.js"),T=require("./_plugin-vue_export-helper-f246444f.js");var C=function e(t,a){if(t===a)return!0;if(t&&a&&typeof t=="object"&&typeof a=="object"){if(t.constructor!==a.constructor)return!1;var i,n,l;if(Array.isArray(t)){if(i=t.length,i!=a.length)return!1;for(n=i;n--!==0;)if(!e(t[n],a[n]))return!1;return!0}if(t.constructor===RegExp)return t.source===a.source&&t.flags===a.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===a.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===a.toString();if(l=Object.keys(t),i=l.length,i!==Object.keys(a).length)return!1;for(n=i;n--!==0;)if(!Object.prototype.hasOwnProperty.call(a,l[n]))return!1;for(n=i;n--!==0;){var d=l[n];if(!e(t[d],a[d]))return!1}return!0}return t!==t&&a!==a};const B=E.getDefaultExportFromCjs(C),S=(e,t)=>t.filter(a=>{const{text:i}=e;if(typeof a.rule=="string")return!new RegExp(a.rule).test(i);if(a.rule instanceof RegExp)return!a.rule.test(i);if({}.toString.call(a.rule)==="[object Function]")return a.rule(e)}).map(a=>a.classes),c=e=>JSON.parse(JSON.stringify(e)),w=(e,t)=>{let a=0;for(;a<e.length;){if(t(e[a],a,e))return a;a++}return-1},k=(e,t,a=[],i)=>{e.text===void 0&&(e={text:e});const n=S(e,a),l=w(t,u=>u===e),d=c(t),o=l!==-1?d.splice(l,1)[0]:c(e);return(i?i(d,o):d.map(u=>u.text).indexOf(o.text)!==-1)&&n.push("ti-duplicate"),n.length===0?n.push("ti-valid"):n.push("ti-invalid"),n},m=(e,...t)=>{e.text===void 0&&(e={text:e});const a=c(e);return a.tiClasses=k(e,...t),a},$=(e,...t)=>e.map(a=>m(a,e,...t));const D={name:"TagInput",props:{scope:{type:Object}}},O=["maxlength"];function I(e,t,a,i,n,l){return a.scope.edit?s.withDirectives((s.openBlock(),s.createElementBlock("input",{key:0,"onUpdate:modelValue":t[0]||(t[0]=d=>a.scope.tag.text=d),maxlength:a.scope.maxlength,type:"text",class:"ti-tag-input",size:"1",onInput:t[1]||(t[1]=d=>a.scope.validateTag(a.scope.index,d)),onBlur:t[2]||(t[2]=d=>a.scope.performCancelEdit(a.scope.index)),onKeydown:t[3]||(t[3]=d=>a.scope.performSaveEdit(a.scope.index,d))},null,40,O)),[[s.vModelText,a.scope.tag.text]]):s.createCommentVNode("",!0)}const A=T._export_sfc(D,[["render",I],["__scopeId","data-v-a1f1c345"]]),h=e=>!e.some(t=>{const a=!t.text;a&&console.warn('Missing property "text"',t);let i=!1;return t.classes&&(i=typeof t.classes!="string"),i&&console.warn('Property "classes" must be type of string',t),a||i}),y=e=>!e.some(t=>{if(typeof t=="number"){const a=isFinite(t)&&Math.floor(t)===t;return a||console.warn("Only numerics are allowed for this prop. Found:",t),!a}else if(typeof t=="string"){const a=/\W|[a-z]|!\d/i.test(t);return a||console.warn("Only alpha strings are allowed for this prop. Found:",t),!a}else return console.warn("Only numeric and string values are allowed. Found:",t),!1}),b={modelValue:{type:String,default:"",required:!0},tags:{type:Array,default:()=>[],validator:h},autocompleteItems:{type:Array,default:()=>[],validator:h},allowEditTags:{type:Boolean,default:!1},autocompleteFilterDuplicates:{default:!0,type:Boolean},addOnlyFromAutocomplete:{type:Boolean,default:!1},autocompleteMinLength:{type:Number,default:1},autocompleteAlwaysOpen:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},placeholder:{type:String,default:"Add Tag"},addOnKey:{type:Array,default:()=>[13],validator:y},saveOnKey:{type:Array,default:()=>[13],validator:y},maxTags:{type:Number},maxlength:{type:Number},validation:{type:Array,default:()=>[],validator(e){return!e.some(t=>{const a=!t.rule;a&&console.warn('Property "rule" is missing',t);const i=t.rule&&(typeof t.rule=="string"||t.rule instanceof RegExp||{}.toString.call(t.rule)==="[object Function]");i||console.warn("A rule must be type of string, RegExp or function. Found:",JSON.stringify(t.rule));const n=!t.classes;n&&console.warn('Property "classes" is missing',t);const l=t.type&&typeof t.type!="string";return l&&console.warn('Property "type" must be type of string. Found:',t),!i||a||n||l})}},separators:{type:Array,default:()=>[";"],validator(e){return!e.some(t=>{const a=typeof t!="string";return a&&console.warn("Separators must be type of string. Found:",t),a})}},avoidAddingDuplicates:{type:Boolean,default:!0},addOnBlur:{type:Boolean,default:!0},isDuplicate:{type:Function,default:null},addFromPaste:{type:Boolean,default:!0},deleteOnBackspace:{default:!0,type:Boolean},onBeforeAddingTag:Function,onBeforeDeletingTag:Function,onBeforeEditingTag:Function,onBeforeSavingTag:Function},F={name:"VueTagsInput",components:{TagInput:A},props:b,emits:["adding-duplicate","before-adding-tag","before-deleting-tag","before-editing-tag","before-saving-tag","max-tags-reached","saving-duplicate","tags-changed","tag-clicked","update:modelValue","update:tags"],inheritAttrs:!1,data(){return{tagCenter:[],newTag:null,tagsCopy:[],tagsEditStatus:null,deletionMark:null,deletionMarkTime:null,selectedItem:null,focused:null}},computed:{autocompleteOpen(){return this.autocompleteAlwaysOpen?!0:this.newTag!==null&&this.newTag.length>=this.autocompleteMinLength&&this.filteredAutocompleteItems.length>0&&this.focused},filteredAutocompleteItems(){const e=this.autocompleteItems.map(t=>m(t,this.tags,this.validation,this.isDuplicate));return this.autocompleteFilterDuplicates?e.filter(this.duplicateFilter):e}},methods:{createClasses:k,getSelectedIndex(e){const t=this.filteredAutocompleteItems,a=this.selectedItem,i=t.length-1;if(t.length!==0)return a===null?0:e==="before"&&a===0?i:e==="after"&&a===i?0:e==="after"?a+1:a-1},selectDefaultItem(){this.addOnlyFromAutocomplete&&this.filteredAutocompleteItems.length>0?this.selectedItem=0:this.selectedItem=null},selectItem(e,t){e.preventDefault(),this.selectedItem=this.getSelectedIndex(t)},isSelected(e){return this.selectedItem===e},isMarked(e){return this.deletionMark===e},setTagCenter(e){e&&this.tagCenter.push(e)},invokeDelete(){if(!this.deleteOnBackspace||this.newTag.length>0)return;const e=this.tagsCopy.length-1;this.deletionMark===null?(this.deletionMarkTime=setTimeout(()=>this.deletionMark=null,1e3),this.deletionMark=e):this.performDeleteTag(e)},addTagsFromPaste(){this.addFromPaste&&setTimeout(()=>this.performAddTags(this.newTag),10)},performEditTag(e){this.allowEditTags&&(this.onBeforeAddingTag||this.editTag(e),this.$emit("before-editing-tag",{index:e,tag:this.tagsCopy[e],editTag:()=>this.editTag(e)}))},editTag(e){this.allowEditTags&&(this.toggleEditMode(e),this.focus(e))},toggleEditMode(e){!this.allowEditTags||this.disabled||(this.tagsEditStatus[e]=!this.tagsEditStatus[e])},createChangedTag(e,t){const a=this.tagsCopy[e];a.text=t?t.target.value:this.tagsCopy[e].text,this.tagsCopy[e]=m(a,this.tagsCopy,this.validation,this.isDuplicate)},focus(e){this.$nextTick(()=>{const t=this.tagCenter[e].querySelector("input.ti-tag-input");t&&t.focus()})},quote(e){return e.replace(/([()[{*+.$^\\|?])/g,"\\$1")},cancelEdit(e){this.tags[e]&&(this.tagsCopy[e]=c(m(this.tags[e],this.tags,this.validation,this.isDuplicate)),this.tagsEditStatus[e]=!1)},hasForbiddingAddRule(e){return e.some(t=>{const a=this.validation.find(i=>t===i.classes);return a?a.disableAdd:!1})},createTagTexts(e){const t=new RegExp(this.separators.map(a=>this.quote(a)).join("|"));return e.split(t).map(a=>({text:a}))},performDeleteTag(e){this.onBeforeDeletingTag||this.deleteTag(e),this.$emit("before-deleting-tag",{index:e,tag:this.tagsCopy[e],deleteTag:()=>this.deleteTag(e)})},deleteTag(e){this.disabled||(this.deletionMark=null,clearTimeout(this.deletionMarkTime),this.tagsCopy.splice(e,1),this.$emit("update:tags",this.tagsCopy),this.$emit("tags-changed",this.tagsCopy))},noTriggerKey(e,t){const a=this[t].indexOf(e.keyCode)!==-1||this[t].indexOf(e.key)!==-1;return a&&e.preventDefault(),!a},performAddTags(e,t,a){if(this.disabled||t&&this.noTriggerKey(t,"addOnKey"))return;let i=[];typeof e=="object"&&(i=[e]),typeof e=="string"&&(i=this.createTagTexts(e)),i=i.filter(n=>n.text.trim().length>0),i.forEach(n=>{n=m(n,this.tags,this.validation,this.isDuplicate),this.onBeforeAddingTag||this.addTag(n,a),this.$emit("before-adding-tag",{tag:n,addTag:()=>this.addTag(n,a)})})},duplicateFilter(e){return this.isDuplicate?!this.isDuplicate(this.tagsCopy,e):!this.tagsCopy.find(t=>t.text===e.text)},addTag(e,t="new-tag-input"){const a=this.filteredAutocompleteItems.map(i=>i.text);this.addOnlyFromAutocomplete&&a.indexOf(e.text)===-1||this.$nextTick(()=>{if(this.maxTags&&this.maxTags<=this.tagsCopy.length)return this.$emit("max-tags-reached",e);if(this.avoidAddingDuplicates&&!this.duplicateFilter(e))return this.$emit("adding-duplicate",e);this.hasForbiddingAddRule(e.tiClasses)||(this.newTag="",this.tagsCopy.push(e),this.$emit("update:tags",this.tagsCopy),t==="autocomplete"&&this.$refs.newTagInput.focus(),this.$emit("tags-changed",this.tagsCopy))})},performSaveTag(e,t){const a=this.tagsCopy[e];this.disabled||t&&this.noTriggerKey(t,"addOnKey")||a.text.trim().length!==0&&(this["on-before-saving-tag"]||this.saveTag(e,a),this.$emit("before-saving-tag",{index:e,tag:a,saveTag:()=>this.saveTag(e,a)}))},saveTag(e,t){if(this.avoidAddingDuplicates){const a=c(this.tagsCopy),i=a.splice(e,1)[0];if(this.isDuplicate?this.isDuplicate(a,i):a.map(l=>l.text).indexOf(i.text)!==-1)return this.$emit("saving-duplicate",t)}this.hasForbiddingAddRule(t.tiClasses)||(this.tagsCopy[e]=t,this.toggleEditMode(e),this.$emit("update:tags",this.tagsCopy),this.$emit("tags-changed",this.tagsCopy))},tagsEqual(){return!this.tagsCopy.some((e,t)=>!B(e,this.tags[t]))},updateNewTag(e){const t=e.target.value;this.newTag=t,this.$emit("update:modelValue",t)},initTags(){this.tagsCopy=$(this.tags,this.validation,this.isDuplicate),this.tagsEditStatus=c(this.tags).map(()=>!1),this.tagsEqual()||this.$emit("update:tags",this.tagsCopy)},blurredOnClick(e){this.$el.contains(e.target)||this.$el.contains(document.activeElement)||this.performBlur(e)},performBlur(){this.addOnBlur&&this.focused&&this.performAddTags(this.newTag),this.focused=!1}},watch:{modelValue(e){this.addOnlyFromAutocomplete||(this.selectedItem=null),this.newTag=e},tags:{handler(){this.initTags()},deep:!0},autocompleteOpen:"selectDefaultItem"},created(){this.newTag=this.modelValue,this.initTags()},mounted(){this.selectDefaultItem(),document.addEventListener("click",this.blurredOnClick)},beforeUpdate(){this.tagCenter=[]},unmounted(){document.removeEventListener("click",this.blurredOnClick)}};const V={class:"ti-input"},N={key:0,class:"ti-tags"},M=["onClick"],K={class:"ti-content"},R={key:0,class:"ti-tag-left"},j=["onClick"],q={key:1,class:"ti-tag-right"},P={class:"ti-actions"},z=["onClick"],L=["onClick"],U={class:"ti-new-tag-input-wrapper"},J=["placeholder","value","maxlength","disabled"],H=["onMouseover"],W=["onClick"];function Y(e,t,a,i,n,l){const d=s.resolveComponent("tag-input");return s.openBlock(),s.createElementBlock("div",{class:s.normalizeClass(["vue-tags-input",[{"ti-disabled":e.disabled},{"ti-focus":e.focused},e.$attrs.class]]),style:s.normalizeStyle(e.$attrs.style)},[s.createElementVNode("div",V,[e.tagsCopy?(s.openBlock(),s.createElementBlock("ul",N,[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(e.tagsCopy,(o,r)=>(s.openBlock(),s.createElementBlock("li",{key:r,style:s.normalizeStyle(o.style),class:s.normalizeClass([[{"ti-editing":e.tagsEditStatus[r]},o.tiClasses,o.classes,{"ti-deletion-mark":e.isMarked(r)}],"ti-tag"]),tabindex:"0",onClick:u=>e.$emit("tag-clicked",{tag:o,index:r})},[s.createElementVNode("div",K,[e.$slots["tag-left"]?(s.openBlock(),s.createElementBlock("div",R,[s.renderSlot(e.$slots,"tag-left",{tag:o,index:r,edit:e.tagsEditStatus[r],performSaveEdit:e.performSaveTag,performDelete:e.performDeleteTag,performCancelEdit:e.cancelEdit,performOpenEdit:e.performEditTag,deletionMark:e.isMarked(r)},void 0,!0)])):s.createCommentVNode("",!0),s.createElementVNode("div",{ref_for:!0,ref:e.setTagCenter,class:"ti-tag-center"},[e.$slots["tag-center"]?s.createCommentVNode("",!0):(s.openBlock(),s.createElementBlock("span",{key:0,class:s.normalizeClass({"ti-hidden":e.tagsEditStatus[r]}),onClick:u=>e.performEditTag(r)},s.toDisplayString(o.text),11,j)),e.$slots["tag-center"]?s.createCommentVNode("",!0):(s.openBlock(),s.createBlock(d,{key:1,scope:{edit:e.tagsEditStatus[r],maxlength:e.maxlength,tag:o,index:r,validateTag:e.createChangedTag,performCancelEdit:e.cancelEdit,performSaveEdit:e.performSaveTag}},null,8,["scope"])),s.renderSlot(e.$slots,"tag-center",{tag:o,index:r,maxlength:e.maxlength,edit:e.tagsEditStatus[r],performSaveEdit:e.performSaveTag,performDelete:e.performDeleteTag,performCancelEdit:e.cancelEdit,validateTag:e.createChangedTag,performOpenEdit:e.performEditTag,deletionMark:e.isMarked(r)},void 0,!0)],512),e.$slots["tag-right"]?(s.openBlock(),s.createElementBlock("div",q,[s.renderSlot(e.$slots,"tag-right",{tag:o,index:r,edit:e.tagsEditStatus[r],performSaveEdit:e.performSaveTag,performDelete:e.performDeleteTag,performCancelEdit:e.cancelEdit,performOpenEdit:e.performEditTag,deletionMark:e.isMarked(r)},void 0,!0)])):s.createCommentVNode("",!0)]),s.createElementVNode("div",P,[e.$slots["tag-actions"]?s.createCommentVNode("",!0):s.withDirectives((s.openBlock(),s.createElementBlock("i",{key:0,class:"ti-icon-undo",onClick:u=>e.cancelEdit(r)},null,8,z)),[[s.vShow,e.tagsEditStatus[r]]]),e.$slots["tag-actions"]?s.createCommentVNode("",!0):s.withDirectives((s.openBlock(),s.createElementBlock("i",{key:1,class:"ti-icon-close",onClick:u=>e.performDeleteTag(r)},null,8,L)),[[s.vShow,!e.tagsEditStatus[r]]]),e.$slots["tag-actions"]?s.renderSlot(e.$slots,"tag-actions",{key:2,tag:o,index:r,edit:e.tagsEditStatus[r],performSaveEdit:e.performSaveTag,performDelete:e.performDeleteTag,performCancelEdit:e.cancelEdit,performOpenEdit:e.performEditTag,deletionMark:e.isMarked(r)},void 0,!0):s.createCommentVNode("",!0)])],14,M))),128)),s.createElementVNode("li",U,[s.createElementVNode("input",s.mergeProps({ref:"newTagInput"},e.$attrs,{class:[[e.createClasses(e.newTag,e.tags,e.validation,e.isDuplicate)],"ti-new-tag-input"],placeholder:e.placeholder,value:e.newTag,maxlength:e.maxlength,disabled:e.disabled,type:"text",size:"1",onKeydown:[t[0]||(t[0]=o=>e.performAddTags(e.filteredAutocompleteItems[e.selectedItem]||e.newTag,o)),t[2]||(t[2]=s.withKeys((...o)=>e.invokeDelete&&e.invokeDelete(...o),["delete"])),t[3]||(t[3]=s.withKeys((...o)=>e.performBlur&&e.performBlur(...o),["tab"])),t[4]||(t[4]=s.withKeys(o=>e.selectItem(o,"before"),["up"])),t[5]||(t[5]=s.withKeys(o=>e.selectItem(o,"after"),["down"]))],onPaste:t[1]||(t[1]=(...o)=>e.addTagsFromPaste&&e.addTagsFromPaste(...o)),onInput:t[6]||(t[6]=(...o)=>e.updateNewTag&&e.updateNewTag(...o)),onFocus:t[7]||(t[7]=o=>e.focused=!0),onClick:t[8]||(t[8]=o=>e.addOnlyFromAutocomplete?!1:e.selectedItem=null)}),null,16,J)])])):s.createCommentVNode("",!0)]),s.renderSlot(e.$slots,"between-elements",{},void 0,!0),e.autocompleteOpen?(s.openBlock(),s.createElementBlock("div",{key:0,class:s.normalizeClass(["ti-autocomplete",e.$attrs.class]),onMouseout:t[9]||(t[9]=o=>e.selectedItem=null)},[s.renderSlot(e.$slots,"autocomplete-header",{},void 0,!0),s.createElementVNode("ul",null,[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(e.filteredAutocompleteItems,(o,r)=>(s.openBlock(),s.createElementBlock("li",{key:r,style:s.normalizeStyle(o.style),class:s.normalizeClass([[o.tiClasses,o.classes,{"ti-selected-item":e.isSelected(r)}],"ti-item"]),onMouseover:u=>e.disabled?!1:e.selectedItem=r},[e.$slots["autocomplete-item"]?s.renderSlot(e.$slots,"autocomplete-item",{key:1,item:o,index:r,performAdd:u=>e.performAddTags(u,void 0,"autocomplete"),selected:e.isSelected(r)},void 0,!0):(s.openBlock(),s.createElementBlock("div",{key:0,onClick:u=>e.performAddTags(o,void 0,"autocomplete")},s.toDisplayString(o.text),9,W))],46,H))),128))]),s.renderSlot(e.$slots,"autocomplete-footer",{},void 0,!0)],34)):s.createCommentVNode("",!0)],6)}const G=T._export_sfc(F,[["render",Y],["__scopeId","data-v-d14eec25"]]);const Q=s.createElementVNode("h5",{class:"mn-thin"},"Tags (maximum 20):",-1),X={class:"mn-medium"},Z=s.createElementVNode("p",{class:"p-small mn-thin"},"Suggested:",-1),_=["onClick"],x={key:1},ee={__name:"BlockTags",props:["tags"],emits:["tags-changed"],setup(e,{emit:t}){const a=e,i=s.ref(""),n=s.ref([]),l=s.ref([{text:"story"},{text:"news"},{text:"guide"},{text:"discussion"},{text:"photos"}]);a.tags&&(n.value=a.tags.map(p=>({text:p})));const d=s.computed(()=>l.value.filter(p=>p.text.toLowerCase().includes(i.value.toLowerCase()))),o=s.computed(()=>l.value.filter(p=>!n.value.some(g=>g.text===p.text)));function r(p){n.value.push(p),t("tags-changed",n.value.map(g=>g.text))}function u(p){n.value=p,t("tags-changed",n.value.map(g=>g.text))}return(p,g)=>(s.openBlock(),s.createElementBlock("div",null,[Q,s.createVNode(G,{modelValue:i.value,"onUpdate:modelValue":g[0]||(g[0]=f=>i.value=f),tags:n.value,"autocomplete-items":s.unref(d),"add-on-key":[13,":",";",","],"save-on-key":[13,":",";",","],separators:[";",","],"max-tags":20,maxlength:20,placeholder:"Please add tags","add-from-paste":!0,"allow-edit-tags":!0,onTagsChanged:u,class:"mn-thin bg-grey radius-medium pd-small"},null,8,["modelValue","tags","autocomplete-items"]),s.createElementVNode("p",X,[Z,s.unref(o).length>0?(s.openBlock(!0),s.createElementBlock(s.Fragment,{key:0},s.renderList(s.unref(o),(f,v)=>(s.openBlock(),s.createElementBlock("span",{onClick:te=>r(f),class:s.normalizeClass(["cursor-pointer ti-tag-toDefactor",{"mn-r-micro":v!==s.unref(o).length-1}])},s.toDisplayString(f.text),11,_))),256)):(s.openBlock(),s.createElementBlock("span",x,"You added all suggested tags"))])]))}};exports._sfc_main=ee;
@@ -0,0 +1,90 @@
1
+ import { openBlock as u, createBlock as m, withCtx as l, createTextVNode as g, toDisplayString as h } from "vue";
2
+ import { _ as y } from "./Button-9e1a9284.mjs";
3
+ import "./auth-7e39361f.mjs";
4
+ import { a as i } from "./memberships-559590ad.mjs";
5
+ const w = {
6
+ __name: "ButtonToggleMembership",
7
+ props: {
8
+ user: {
9
+ type: String,
10
+ required: !0
11
+ },
12
+ type: {
13
+ type: String,
14
+ required: !0
15
+ },
16
+ role: {
17
+ type: String,
18
+ required: !1
19
+ },
20
+ target: {
21
+ type: String,
22
+ required: !0
23
+ },
24
+ text: {
25
+ type: Object,
26
+ default: {
27
+ create: "join",
28
+ remove: "leave"
29
+ }
30
+ },
31
+ status: {
32
+ type: Boolean,
33
+ required: !0
34
+ }
35
+ },
36
+ emits: ["updateMembership"],
37
+ setup(a, { emit: o }) {
38
+ const e = a, p = async () => {
39
+ e.status ? await n() : await c();
40
+ };
41
+ async function c() {
42
+ try {
43
+ const t = {
44
+ user: e.user,
45
+ type: e.type,
46
+ role: e.role,
47
+ target: e.target
48
+ }, r = await i.create(t);
49
+ o("updateMembership", {
50
+ membership: r,
51
+ target: e.target,
52
+ status: !0
53
+ });
54
+ } catch (t) {
55
+ throw console.log(t), t;
56
+ }
57
+ }
58
+ async function n(t) {
59
+ const r = {
60
+ user: e.user,
61
+ type: e.type,
62
+ role: e.role,
63
+ target: e.target
64
+ };
65
+ try {
66
+ const s = await i.delete(r);
67
+ o("updateMembership", {
68
+ membership: s,
69
+ target: e.target,
70
+ status: !1
71
+ });
72
+ } catch (s) {
73
+ throw console.log(s), s;
74
+ }
75
+ }
76
+ return (t, r) => (u(), m(y, {
77
+ submit: p,
78
+ showSucces: !1,
79
+ class: "button-small button"
80
+ }, {
81
+ default: l(() => [
82
+ g(h(a.status ? e.text.remove : e.text.create), 1)
83
+ ]),
84
+ _: 1
85
+ }));
86
+ }
87
+ };
88
+ export {
89
+ w as _
90
+ };
@@ -0,0 +1 @@
1
+ "use strict";const r=require("vue"),m=require("./Button-7643c9aa.js");require("./auth-04684a60.js");const c=require("./memberships-58af22e0.js"),l={__name:"ButtonToggleMembership",props:{user:{type:String,required:!0},type:{type:String,required:!0},role:{type:String,required:!1},target:{type:String,required:!0},text:{type:Object,default:{create:"join",remove:"leave"}},status:{type:Boolean,required:!0}},emits:["updateMembership"],setup(o,{emit:i}){const e=o,u=async()=>{e.status?await p():await n()};async function n(){try{const t={user:e.user,type:e.type,role:e.role,target:e.target},s=await c.actions.create(t);i("updateMembership",{membership:s,target:e.target,status:!0})}catch(t){throw console.log(t),t}}async function p(t){const s={user:e.user,type:e.type,role:e.role,target:e.target};try{const a=await c.actions.delete(s);i("updateMembership",{membership:a,target:e.target,status:!1})}catch(a){throw console.log(a),a}}return(t,s)=>(r.openBlock(),r.createBlock(m._sfc_main,{submit:u,showSucces:!1,class:"button-small button"},{default:r.withCtx(()=>[r.createTextVNode(r.toDisplayString(o.status?e.text.remove:e.text.create),1)]),_:1}))}};exports._sfc_main=l;
@@ -0,0 +1,246 @@
1
+ import { a as C } from "./axios-33aeb810.mjs";
2
+ import { reactive as j, watch as E, ref as w, openBlock as r, createElementBlock as c, createTextVNode as k, toDisplayString as i, createElementVNode as f, createCommentVNode as n, computed as P, createBlock as x, withModifiers as I, createVNode as $, normalizeClass as B, unref as m, renderSlot as S } from "vue";
3
+ import { s as v } from "./globals-96ba60e4.mjs";
4
+ import { a as R, _ as z, b as N } from "./Chips-8c836ba6.mjs";
5
+ import { useRouter as T } from "vue-router";
6
+ import { I as V } from "./IconEdit-9edfd74d.mjs";
7
+ const b = C.create({ baseURL: process.env.API_URL, withCredentials: !0 });
8
+ b.defaults.withCredentials = !0;
9
+ const u = j({
10
+ all: [],
11
+ filter: {
12
+ // query
13
+ tags: [],
14
+ period: ""
15
+ // pagination
16
+ },
17
+ pagination: {
18
+ page: 1,
19
+ perPage: 18
20
+ },
21
+ // Sort
22
+ sort: {
23
+ current: "popularity",
24
+ ascending: !1
25
+ },
26
+ current: {
27
+ _id: "",
28
+ url: "",
29
+ status: "",
30
+ name: "",
31
+ tags: [],
32
+ owner: {},
33
+ date: "",
34
+ views: 0,
35
+ content: []
36
+ }
37
+ });
38
+ async function L(e = {}) {
39
+ e.params = e.params || {}, e.params.skip = e.skip || 0, e.params.limit = e.limit || 9, e.params.tags = e.tags || [], e.period && (e.params.period = e.period), e.url && (e.params = { url: e.url }), e.category && (e.params.category = e.category), e.owner && (e.params.owner = e.owner), e.following && (e.params.following = e.following), e.creator && (e.params.creator = e.creator), e.status && (e.params.status = e.status), e.user && (e.params.user = e.user), e.params.skip = e.skip || 0, e.params.limit = e.limit || 10;
40
+ try {
41
+ console.log("Request params:" + e.params);
42
+ const t = await b.get("/api/blog/read", { params: e.params });
43
+ return e.url ? p(t.data, "current") : p(t.data, "all"), Promise.resolve(t.data);
44
+ } catch (t) {
45
+ return v(t), Promise.reject(t);
46
+ }
47
+ }
48
+ async function O(e) {
49
+ return b.post("/api/blog/create", e).then(
50
+ (t) => (p(t.data, "current"), Promise.resolve(t.data)),
51
+ (t) => (v(t), Promise.reject(t))
52
+ );
53
+ }
54
+ async function U(e) {
55
+ return b.post("/api/blog/update", e).then(
56
+ (t) => (p(t.data, "current"), Promise.resolve(t.data)),
57
+ (t) => (v(t), Promise.reject(t))
58
+ );
59
+ }
60
+ async function A(e) {
61
+ return await b.delete(`/api/blog/delete/${e}`).then(
62
+ (t) => {
63
+ const l = u.all.findIndex((s) => s._id === e);
64
+ return l !== -1 && u.all.splice(l, 1), Promise.resolve(t.data);
65
+ },
66
+ (t) => (v(t), Promise.reject(t))
67
+ );
68
+ }
69
+ function p(e, t) {
70
+ u[t] = e;
71
+ }
72
+ function F() {
73
+ u.current = {
74
+ _id: "",
75
+ url: "",
76
+ status: "",
77
+ name: "",
78
+ tags: [],
79
+ author: "",
80
+ owner: "",
81
+ date: "",
82
+ views: 0,
83
+ content: []
84
+ };
85
+ }
86
+ function M(e) {
87
+ const t = {
88
+ order: u.project.content.length + 1,
89
+ type: e.type,
90
+ data: e.data,
91
+ class: e.class,
92
+ content: e.content
93
+ };
94
+ u.project.content.push(t);
95
+ }
96
+ E(u, (e, t) => {
97
+ });
98
+ const oe = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
99
+ __proto__: null,
100
+ blockAdd: M,
101
+ clean: F,
102
+ create: O,
103
+ read: L,
104
+ remove: A,
105
+ set: p,
106
+ state: u,
107
+ update: U
108
+ }, Symbol.toStringTag, { value: "Module" })), q = { class: "t-semi br-top-dark flex-nowrap flex-nojustify flex" }, D = /* @__PURE__ */ f("span", { class: "mn-r-small mn-l-small d-block" }, "·", -1), G = { class: "cursor-pointer" }, H = /* @__PURE__ */ f("span", { class: "mn-r-small mn-l-small d-block" }, "·", -1), J = {
109
+ __name: "FooterBlogpost",
110
+ props: ["blogpost", "owner", "user"],
111
+ setup(e) {
112
+ const t = e, l = w(t.blogpost.numberOfReactions), s = w(t.blogpost.isReacted), d = w(t.blogpost.reactionId);
113
+ async function o(y) {
114
+ if (!t.user) {
115
+ alert("Please login to add a reaction");
116
+ return;
117
+ }
118
+ try {
119
+ const a = {
120
+ target: t.blogpost._id,
121
+ type: "blogpost",
122
+ user: t.user,
123
+ class: "like"
124
+ }, h = await R.create(a);
125
+ h.reaction.class === "like" && (l.value += 1, s.value = !0, d.value = h.reaction._id);
126
+ } catch (a) {
127
+ console.error(a), alert("Error adding reaction. Please try again later.");
128
+ }
129
+ }
130
+ async function g(y) {
131
+ if (!t.user) {
132
+ alert("Please login to add a reaction");
133
+ return;
134
+ }
135
+ try {
136
+ const a = { _id: d.value };
137
+ await R.delete(a), l.value -= 1, s.value = !1, d.value = null;
138
+ } catch {
139
+ alert("Error adding reaction. Please try again later.");
140
+ }
141
+ }
142
+ return (y, a) => (r(), c("footer", q, [
143
+ k(" 👁️ " + i(e.blogpost.views) + " ", 1),
144
+ D,
145
+ f("div", G, [
146
+ s.value ? n("", !0) : (r(), c("div", {
147
+ key: 0,
148
+ class: "cursor-pointer",
149
+ onClick: a[0] || (a[0] = (h) => o())
150
+ }, " 👍 " + i(l.value), 1)),
151
+ s.value ? (r(), c("div", {
152
+ key: 1,
153
+ class: "cursor-pointer",
154
+ onClick: a[1] || (a[1] = (h) => g())
155
+ }, " 👍 " + i(l.value), 1)) : n("", !0)
156
+ ]),
157
+ H,
158
+ k(" 💬 " + i(e.blogpost.numberOfComments), 1)
159
+ ]));
160
+ }
161
+ }, K = { class: "pos-relative bg-grey radius-big" }, Q = ["src"], W = { class: "pd-t-zero pd-medium" }, X = {
162
+ key: 0,
163
+ class: "cursor-pointer mn-thin flex-nowrap flex w-100"
164
+ }, Y = {
165
+ key: 0,
166
+ class: "pd-micro t-white uppercase t-semi p-small flex-center flex pd-r-small pd-l-small mn-l-thin w-min bg-second radius-extra"
167
+ }, Z = {
168
+ key: 1,
169
+ class: "mn-small t-transp p-big"
170
+ }, _ = {
171
+ key: 2,
172
+ class: "mn-small h2"
173
+ }, ne = {
174
+ __name: "CardBlogpost",
175
+ props: ["blogpost", "user", "type"],
176
+ setup(e) {
177
+ const t = e, l = T(), s = P(() => t.blogpost.content.find((o) => o.type === "ImageUpload")), d = P(() => t.blogpost.content.find((o) => o.type === "Textarea"));
178
+ return (o, g) => (r(), c("article", K, [
179
+ e.user && e.user === e.blogpost.creator.target._id ? (r(), x(V, {
180
+ key: 0,
181
+ onClick: g[0] || (g[0] = I((y) => o.$router.push({
182
+ name: "Edit BlogPost",
183
+ params: {
184
+ url: e.blogpost.url
185
+ }
186
+ }), ["stop"])),
187
+ class: "z-index-2 pos-absolute pos-t-regular pos-r-regular i-regular t-transp"
188
+ })) : n("", !0),
189
+ $(z, {
190
+ class: B({
191
+ "mn-small pd-medium": e.type !== "short",
192
+ "flex-child-order-last flex-child mn-l-small": e.type === "short"
193
+ }),
194
+ entity: e.blogpost,
195
+ entityType: "blogpost",
196
+ user: e.user,
197
+ owner: e.blogpost.owner,
198
+ creator: e.blogpost.creator,
199
+ date: e.blogpost.createdAt
200
+ }, null, 8, ["class", "entity", "user", "owner", "creator", "date"]),
201
+ m(s) && m(s).content && e.type !== "blogpostPage" ? (r(), c("img", {
202
+ key: 1,
203
+ src: (o.FILE_SERVER_URL || "") + m(s).content,
204
+ alt: "Blog post image",
205
+ class: "mn-medium object-fit-cover w-100 h-20r"
206
+ }, null, 8, Q)) : n("", !0),
207
+ f("section", W, [
208
+ e.type !== "blogpostPage" ? (r(), c("div", X, [
209
+ f("h3", {
210
+ onClick: g[1] || (g[1] = (y) => m(l).push({
211
+ name: "BlogPost",
212
+ params: {
213
+ url: e.blogpost.url
214
+ }
215
+ })),
216
+ class: ""
217
+ }, i(e.blogpost.name), 1),
218
+ e.blogpost.status === "draft" ? (r(), c("div", Y, i(e.blogpost.status), 1)) : n("", !0)
219
+ ])) : n("", !0),
220
+ m(d) && m(d).content && e.type !== "blogpostPage" ? (r(), c("p", Z, i(m(d).content.slice(0, 120)) + "... ", 1)) : n("", !0),
221
+ e.type === "blogpostPage" ? (r(), c("h3", _, i(e.blogpost.name), 1)) : n("", !0),
222
+ S(o.$slots, "default"),
223
+ e.type !== "short" && e.blogpost.tags.length > 0 ? (r(), x(N, {
224
+ key: 3,
225
+ chips: e.blogpost.tags
226
+ }, null, 8, ["chips"])) : n("", !0)
227
+ ]),
228
+ $(J, {
229
+ class: "pd-t-zero pd-medium",
230
+ blogpost: e.blogpost,
231
+ user: e.user
232
+ }, null, 8, ["blogpost", "user"])
233
+ ]));
234
+ }
235
+ };
236
+ export {
237
+ ne as _,
238
+ A as a,
239
+ O as b,
240
+ F as c,
241
+ J as d,
242
+ oe as e,
243
+ L as r,
244
+ u as s,
245
+ U as u
246
+ };
@@ -0,0 +1 @@
1
+ "use strict";const B=require("./axios-ceccf20e.js"),t=require("vue"),f=require("./globals-928eb13c.js"),p=require("./Chips-817cf959.js"),E=require("vue-router"),P=require("./IconEdit-c0469b45.js"),d=B.axios.create({baseURL:process.env.API_URL,withCredentials:!0});d.defaults.withCredentials=!0;const n=t.reactive({all:[],filter:{tags:[],period:""},pagination:{page:1,perPage:18},sort:{current:"popularity",ascending:!1},current:{_id:"",url:"",status:"",name:"",tags:[],owner:{},date:"",views:0,content:[]}});async function y(e={}){e.params=e.params||{},e.params.skip=e.skip||0,e.params.limit=e.limit||9,e.params.tags=e.tags||[],e.period&&(e.params.period=e.period),e.url&&(e.params={url:e.url}),e.category&&(e.params.category=e.category),e.owner&&(e.params.owner=e.owner),e.following&&(e.params.following=e.following),e.creator&&(e.params.creator=e.creator),e.status&&(e.params.status=e.status),e.user&&(e.params.user=e.user),e.params.skip=e.skip||0,e.params.limit=e.limit||10;try{console.log("Request params:"+e.params);const r=await d.get("/api/blog/read",{params:e.params});return e.url?u(r.data,"current"):u(r.data,"all"),Promise.resolve(r.data)}catch(r){return f.setError(r),Promise.reject(r)}}async function b(e){return d.post("/api/blog/create",e).then(r=>(u(r.data,"current"),Promise.resolve(r.data)),r=>(f.setError(r),Promise.reject(r)))}async function k(e){return d.post("/api/blog/update",e).then(r=>(u(r.data,"current"),Promise.resolve(r.data)),r=>(f.setError(r),Promise.reject(r)))}async function h(e){return await d.delete(`/api/blog/delete/${e}`).then(r=>{const o=n.all.findIndex(s=>s._id===e);return o!==-1&&n.all.splice(o,1),Promise.resolve(r.data)},r=>(f.setError(r),Promise.reject(r)))}function u(e,r){n[r]=e}function v(){n.current={_id:"",url:"",status:"",name:"",tags:[],author:"",owner:"",date:"",views:0,content:[]}}function C(e){const r={order:n.project.content.length+1,type:e.type,data:e.data,class:e.class,content:e.content};n.project.content.push(r)}t.watch(n,(e,r)=>{});const x=Object.freeze(Object.defineProperty({__proto__:null,blockAdd:C,clean:v,create:b,read:y,remove:h,set:u,state:n,update:k},Symbol.toStringTag,{value:"Module"})),N={class:"t-semi br-top-dark flex-nowrap flex-nojustify flex"},V=t.createElementVNode("span",{class:"mn-r-small mn-l-small d-block"},"·",-1),$={class:"cursor-pointer"},S=t.createElementVNode("span",{class:"mn-r-small mn-l-small d-block"},"·",-1),w={__name:"FooterBlogpost",props:["blogpost","owner","user"],setup(e){const r=e,o=t.ref(r.blogpost.numberOfReactions),s=t.ref(r.blogpost.isReacted),c=t.ref(r.blogpost.reactionId);async function l(m){if(!r.user){alert("Please login to add a reaction");return}try{const a={target:r.blogpost._id,type:"blogpost",user:r.user,class:"like"},g=await p.actions.create(a);g.reaction.class==="like"&&(o.value+=1,s.value=!0,c.value=g.reaction._id)}catch(a){console.error(a),alert("Error adding reaction. Please try again later.")}}async function i(m){if(!r.user){alert("Please login to add a reaction");return}try{const a={_id:c.value};await p.actions.delete(a),o.value-=1,s.value=!1,c.value=null}catch{alert("Error adding reaction. Please try again later.")}}return(m,a)=>(t.openBlock(),t.createElementBlock("footer",N,[t.createTextVNode(" 👁️ "+t.toDisplayString(e.blogpost.views)+" ",1),V,t.createElementVNode("div",$,[s.value?t.createCommentVNode("",!0):(t.openBlock(),t.createElementBlock("div",{key:0,class:"cursor-pointer",onClick:a[0]||(a[0]=g=>l())}," 👍 "+t.toDisplayString(o.value),1)),s.value?(t.openBlock(),t.createElementBlock("div",{key:1,class:"cursor-pointer",onClick:a[1]||(a[1]=g=>i())}," 👍 "+t.toDisplayString(o.value),1)):t.createCommentVNode("",!0)]),S,t.createTextVNode(" 💬 "+t.toDisplayString(e.blogpost.numberOfComments),1)]))}},R={class:"pos-relative bg-grey radius-big"},j=["src"],I={class:"pd-t-zero pd-medium"},q={key:0,class:"cursor-pointer mn-thin flex-nowrap flex w-100"},D={key:0,class:"pd-micro t-white uppercase t-semi p-small flex-center flex pd-r-small pd-l-small mn-l-thin w-min bg-second radius-extra"},T={key:1,class:"mn-small t-transp p-big"},z={key:2,class:"mn-small h2"},L={__name:"CardBlogpost",props:["blogpost","user","type"],setup(e){const r=e,o=E.useRouter(),s=t.computed(()=>r.blogpost.content.find(l=>l.type==="ImageUpload")),c=t.computed(()=>r.blogpost.content.find(l=>l.type==="Textarea"));return(l,i)=>(t.openBlock(),t.createElementBlock("article",R,[e.user&&e.user===e.blogpost.creator.target._id?(t.openBlock(),t.createBlock(P.IconEdit,{key:0,onClick:i[0]||(i[0]=t.withModifiers(m=>l.$router.push({name:"Edit BlogPost",params:{url:e.blogpost.url}}),["stop"])),class:"z-index-2 pos-absolute pos-t-regular pos-r-regular i-regular t-transp"})):t.createCommentVNode("",!0),t.createVNode(p._sfc_main,{class:t.normalizeClass({"mn-small pd-medium":e.type!=="short","flex-child-order-last flex-child mn-l-small":e.type==="short"}),entity:e.blogpost,entityType:"blogpost",user:e.user,owner:e.blogpost.owner,creator:e.blogpost.creator,date:e.blogpost.createdAt},null,8,["class","entity","user","owner","creator","date"]),t.unref(s)&&t.unref(s).content&&e.type!=="blogpostPage"?(t.openBlock(),t.createElementBlock("img",{key:1,src:(l.FILE_SERVER_URL||"")+t.unref(s).content,alt:"Blog post image",class:"mn-medium object-fit-cover w-100 h-20r"},null,8,j)):t.createCommentVNode("",!0),t.createElementVNode("section",I,[e.type!=="blogpostPage"?(t.openBlock(),t.createElementBlock("div",q,[t.createElementVNode("h3",{onClick:i[1]||(i[1]=m=>t.unref(o).push({name:"BlogPost",params:{url:e.blogpost.url}})),class:""},t.toDisplayString(e.blogpost.name),1),e.blogpost.status==="draft"?(t.openBlock(),t.createElementBlock("div",D,t.toDisplayString(e.blogpost.status),1)):t.createCommentVNode("",!0)])):t.createCommentVNode("",!0),t.unref(c)&&t.unref(c).content&&e.type!=="blogpostPage"?(t.openBlock(),t.createElementBlock("p",T,t.toDisplayString(t.unref(c).content.slice(0,120))+"... ",1)):t.createCommentVNode("",!0),e.type==="blogpostPage"?(t.openBlock(),t.createElementBlock("h3",z,t.toDisplayString(e.blogpost.name),1)):t.createCommentVNode("",!0),t.renderSlot(l.$slots,"default"),e.type!=="short"&&e.blogpost.tags.length>0?(t.openBlock(),t.createBlock(p._sfc_main$1,{key:3,chips:e.blogpost.tags},null,8,["chips"])):t.createCommentVNode("",!0)]),t.createVNode(w,{class:"pd-t-zero pd-medium",blogpost:e.blogpost,user:e.user},null,8,["blogpost","user"])]))}};exports._sfc_main=L;exports._sfc_main$1=w;exports.blogposts=x;exports.clean=v;exports.create=b;exports.read=y;exports.remove=h;exports.state=n;exports.update=k;
@@ -0,0 +1,234 @@
1
+ import { openBlock as n, createElementBlock as i, createCommentVNode as a, createElementVNode as e, createTextVNode as h, toDisplayString as o, ref as p, computed as d, unref as m, createVNode as y, Fragment as f, renderList as x, createBlock as v, withModifiers as z } from "vue";
2
+ import { useRouter as b } from "vue-router";
3
+ import { _ as $ } from "./ButtonToggleMembership-84d0e018.mjs";
4
+ const _ = { class: "flex-stretch flex-nojustify flex-nowrap flex shop-cart-item" }, k = ["src"], L = {
5
+ key: 1,
6
+ width: "524",
7
+ height: "345",
8
+ viewBox: "0 0 524 345",
9
+ fill: "none",
10
+ xmlns: "http://www.w3.org/2000/svg",
11
+ class: "i-extra"
12
+ }, S = /* @__PURE__ */ e("rect", {
13
+ width: "524",
14
+ height: "345",
15
+ fill: "white"
16
+ }, null, -1), V = /* @__PURE__ */ e("rect", {
17
+ width: "524",
18
+ height: "345",
19
+ fill: "white"
20
+ }, null, -1), M = /* @__PURE__ */ e("circle", {
21
+ cx: "262",
22
+ cy: "172",
23
+ r: "56",
24
+ fill: "#00ff88",
25
+ "fill-opacity": "0.1"
26
+ }, null, -1), T = /* @__PURE__ */ e("path", {
27
+ fill: "#00ff88",
28
+ d: "M229.348 186.819C230.243 191.884 233.393 194.231 238.458 193.273V193.644C238.458 198.832 241.206 201.581 246.364 201.581H291.545C296.733 201.581 299.481 198.74 299.481 193.644V162.576C299.481 157.481 296.733 154.64 291.545 154.64H285.677L284.071 145.653C283.175 140.619 279.995 138.303 274.899 139.198L230.398 147.043C225.302 147.969 223.048 151.15 223.943 156.246L229.348 186.819ZM230.83 186.479L225.456 156.06C224.715 151.86 226.537 149.266 230.737 148.525L275.084 140.712C279.13 140.001 281.848 141.762 282.62 145.993L284.102 154.64H246.364C241.206 154.64 238.458 157.419 238.458 162.576V191.729L238.365 191.76C234.165 192.532 231.571 190.679 230.83 186.479ZM239.971 162.669C239.971 158.376 242.164 156.153 246.456 156.153H291.483C295.59 156.153 297.968 158.376 297.968 162.669V190.093L284.565 177.894C283.145 176.597 281.662 175.856 279.809 175.856C277.987 175.856 276.628 176.566 275.146 177.863L262.052 189.073L257.142 184.565C255.875 183.36 254.764 182.743 253.158 182.743C251.675 182.743 250.656 183.36 249.39 184.503L239.971 193.212V162.669ZM257.636 178.419C261.373 178.419 264.43 175.3 264.43 171.471C264.43 167.734 261.373 164.584 257.636 164.584C253.806 164.584 250.718 167.734 250.718 171.471C250.718 175.3 253.806 178.419 257.636 178.419Z"
29
+ }, null, -1), O = [
30
+ S,
31
+ V,
32
+ M,
33
+ T
34
+ ], E = { class: "text-left" }, F = { class: "name" }, B = {
35
+ key: 0,
36
+ class: "t-transp"
37
+ }, R = {
38
+ key: 1,
39
+ class: "t-transp"
40
+ }, q = {
41
+ key: 2,
42
+ class: "t-transp"
43
+ }, H = { class: "t-main t-demi price mn-small" }, Z = { key: 0 }, N = {
44
+ key: 0,
45
+ class: "flex-nojustify flex"
46
+ }, U = { class: "flex-nowrap flex" }, j = /* @__PURE__ */ e("svg", {
47
+ fill: "none",
48
+ height: "20",
49
+ viewBox: "0 0 20 20",
50
+ width: "20",
51
+ xmlns: "http://www.w3.org/2000/svg"
52
+ }, [
53
+ /* @__PURE__ */ e("path", {
54
+ "clip-rule": "evenodd",
55
+ d: "m7.27124 0h5.45456c1.0041 0 1.8182.814027 1.8182 1.81818v.90899h2.7278c1.0042 0 1.8182.81402 1.8182 1.81818v1.81818c0 1.00415-.814 1.81818-1.8182 1.81818h-.0735l-.8363 10.00009c0 1.0042-.814 1.8182-1.8182 1.8182h-9.09087c-1.00416 0-1.81818-.814-1.81504-1.7427l-.83964-10.07559h-.07187c-1.00415 0-1.818177-.81403-1.818177-1.81818v-1.81818c0-1.00416.814027-1.81818 1.818177-1.81818h2.72668v-.90899c0-1.004153.81402-1.81818 1.81818-1.81818zm-1.81889 18.1819-.83047-10h10.75152l-.827 9.9245-.0031.0755zm-2.72612-11.81799v-1.81818h14.54547v1.81818zm10.00137-4.54571v.90909h-5.45456v-.90909z",
56
+ fill: "#8a8a8a",
57
+ "fill-rule": "evenodd"
58
+ })
59
+ ], -1), I = [
60
+ j
61
+ ], D = {
62
+ __name: "CardOrderItem",
63
+ props: {
64
+ product: Object,
65
+ editable: String,
66
+ increase: Function,
67
+ decrease: Function,
68
+ remove: Function
69
+ },
70
+ setup(t) {
71
+ return b(), (r, s) => (n(), i("div", _, [
72
+ t.product.images[0] ? (n(), i("img", {
73
+ key: 0,
74
+ class: "bg-grey aspect-1x1",
75
+ src: (r.FILE_SERVER_URL || "") + t.product.images[0]
76
+ }, null, 8, k)) : a("", !0),
77
+ t.product.images[0] ? a("", !0) : (n(), i("svg", L, O)),
78
+ e("div", E, [
79
+ e("p", F, [
80
+ h(o(t.product.name) + " ", 1),
81
+ t.product.size ? (n(), i("span", B, ", " + o(t.product.size), 1)) : a("", !0),
82
+ typeof t.product.color == "string" && t.product.size ? (n(), i("span", R, ", ")) : a("", !0),
83
+ typeof t.product.color == "string" ? (n(), i("span", q, o(t.product.color), 1)) : a("", !0)
84
+ ]),
85
+ e("p", H, [
86
+ t.editable ? (n(), i("span", Z, o(t.product.quantity) + " x ", 1)) : a("", !0),
87
+ h(o(t.product.price) + " " + o(r.returnCurrency()), 1)
88
+ ]),
89
+ t.editable ? (n(), i("div", N, [
90
+ e("div", U, [
91
+ e("button", {
92
+ onClick: s[0] || (s[0] = (c) => t.decrease(t.product)),
93
+ class: "mn-r-thin bg-grey button-square button"
94
+ }, "-"),
95
+ e("button", {
96
+ onClick: s[1] || (s[1] = (c) => t.increase(t.product)),
97
+ class: "mn-r-thin bg-grey button-square button"
98
+ }, "+")
99
+ ]),
100
+ e("button", {
101
+ onClick: s[2] || (s[2] = (c) => t.remove(t.product)),
102
+ class: "hover_br-transp hover_br-l-dark bg-transp button-square button"
103
+ }, I)
104
+ ])) : a("", !0)
105
+ ])
106
+ ]));
107
+ }
108
+ }, P = {
109
+ key: 0,
110
+ class: "cursor-pointer t-second"
111
+ }, A = {
112
+ __name: "Text",
113
+ props: {
114
+ maxLen: { type: Number, required: !0 },
115
+ text: { type: String, required: !0 },
116
+ showToggleText: { type: Boolean, default: !1 }
117
+ },
118
+ setup(t) {
119
+ const r = t, s = p(!1), c = d(() => r.text.length > r.maxLen ? r.text.slice(0, r.maxLen) + "..." : r.text), u = d(() => r.text), l = () => {
120
+ s.value = !s.value;
121
+ }, g = d(() => s.value ? u.value : c.value), w = d(() => r.text.length > r.maxLen), C = d(() => s.value ? "Hide" : "Show more");
122
+ return (gt, ft) => (n(), i("span", {
123
+ onClick: l,
124
+ class: ""
125
+ }, [
126
+ h(o(m(g)) + " ", 1),
127
+ m(w) && t.showToggleText ? (n(), i("span", P, o(m(C)), 1)) : a("", !0)
128
+ ]));
129
+ }
130
+ }, G = { class: "pd-medium flex-v-center flex-nowrap flex" }, J = ["src"], K = {
131
+ key: 1,
132
+ class: "h-4r w-4r radius-extra",
133
+ width: "42",
134
+ height: "42",
135
+ viewBox: "0 0 42 42",
136
+ fill: "none",
137
+ xmlns: "http://www.w3.org/2000/svg"
138
+ }, Q = /* @__PURE__ */ e("circle", {
139
+ fill: "rgb(var(--main))",
140
+ cx: "21",
141
+ cy: "21",
142
+ r: "21"
143
+ }, null, -1), W = /* @__PURE__ */ e("path", {
144
+ fill: "#242424",
145
+ "fill-opacity": "0.1",
146
+ "fill-rule": "evenodd",
147
+ "clip-rule": "evenodd",
148
+ d: "M8.00233 37.4954C8.00078 37.4458 8 37.3961 8 37.3462C8 32.9066 11.5673 29.3077 15.9677 29.3077H26.0323C30.4328 29.3077 34 32.9066 34 37.3462C34 37.3961 33.9992 37.4458 33.9977 37.4954C30.4223 40.3165 25.9078 42 21 42C16.0922 42 11.5777 40.3164 8.00233 37.4954ZM21 9C16.5995 9 13.0323 12.5989 13.0323 17.0385C13.0323 21.478 16.5995 25.0769 21 25.0769C25.4005 25.0769 28.9677 21.478 28.9677 17.0385C28.9677 12.5989 25.4005 9 21 9Z"
149
+ }, null, -1), X = [
150
+ Q,
151
+ W
152
+ ], Y = { class: "flex-child-1 flex-child mn-l-small w-100" }, tt = { class: "h3 mn-r-semi mn-thin" }, et = {
153
+ key: 0,
154
+ class: "w-max star-container flex-v-center flex"
155
+ }, nt = { class: "mn-r-thin pd-r-thin pd-l-thin pd-micro radius-small t-semi uppercase bg-main p-small" }, it = ["src"], st = { class: "p-small t-semi mn-r-thin" }, ot = { class: "p-small" }, rt = { class: "mn-thin" }, at = {
156
+ key: 0,
157
+ class: "pd-medium"
158
+ }, lt = { class: "mn-small w-100 flex-nowrap flex flex-v-center pd-small bg-white radius-medium" }, ct = { class: "t-black p-medium t-semi" }, dt = /* @__PURE__ */ e("span", { class: "mn-r-small" }, "30-60min", -1), ut = /* @__PURE__ */ e("span", { class: "mn-r-auto" }, "$50 min", -1), mt = { class: "d-block o-scroll flex-nowrap flex" }, ht = /* @__PURE__ */ e("button", { class: "flex-center flex-nowrap flex shop-cart-item pd-thin radius-medium w-15r bg-main button" }, "View menu", -1), wt = {
159
+ __name: "CardOrganization",
160
+ props: {
161
+ user: String,
162
+ organization: Object
163
+ },
164
+ emits: ["updateMembership"],
165
+ setup(t, { emit: r }) {
166
+ return b(), (s, c) => {
167
+ var u;
168
+ return n(), i("div", {
169
+ class: "bg-grey radius-big o-hidden",
170
+ onClick: c[1] || (c[1] = (l) => s.$router.push({ name: "Organization", params: { _id: t.organization._id } }))
171
+ }, [
172
+ e("div", G, [
173
+ t.organization.profile.photo && t.organization.profile.photo.length > 0 ? (n(), i("img", {
174
+ key: 0,
175
+ src: (s.FILE_SERVER_URL || "") + t.organization.profile.photo,
176
+ class: "h-4r w-4r radius-extra bg-white"
177
+ }, null, 8, J)) : (n(), i("svg", K, X)),
178
+ e("div", Y, [
179
+ e("p", tt, [
180
+ y(A, {
181
+ text: t.organization.profile.name ? t.organization.profile.name : "",
182
+ maxLen: 16
183
+ }, null, 8, ["text"])
184
+ ]),
185
+ t.organization.ratingS ? (n(), i("div", et, [
186
+ e("span", nt, o(t.organization.types[0]), 1),
187
+ (n(), i(f, null, x(5, (l) => e("img", {
188
+ class: "i-small mn-r-thin",
189
+ src: l <= t.organization.rating.median ? "/icons/star.svg" : "/icons/star-stroke.svg"
190
+ }, null, 8, it)), 64)),
191
+ e("span", st, o(t.organization.rating.median), 1),
192
+ e("span", ot, "(" + o(t.organization.rating.amount) + ")", 1)
193
+ ])) : a("", !0),
194
+ e("div", null, [
195
+ e("p", rt, o(t.organization.numberOfSubscribers) + " followers", 1),
196
+ (u = t.user) != null && u._id && t.organization.owner !== t.user._id ? (n(), v($, {
197
+ key: 0,
198
+ user: t.user._id,
199
+ type: "organization",
200
+ role: "subscriber",
201
+ target: t.organization._id,
202
+ status: t.organization.isSubscriber,
203
+ text: { create: "Follow", remove: "Unfollow" },
204
+ onUpdateMembership: c[0] || (c[0] = (l) => s.handleMembershipUpdate(l, "isSubscriber", "numberOfSubscribers")),
205
+ class: "w-min"
206
+ }, null, 8, ["user", "target", "status"])) : a("", !0)
207
+ ])
208
+ ])
209
+ ]),
210
+ t.organization.products.length > 0 ? (n(), i("div", at, [
211
+ e("div", lt, [
212
+ e("p", ct, o(t.organization.products.length) + " items: ", 1),
213
+ dt,
214
+ ut
215
+ ]),
216
+ e("div", mt, [
217
+ (n(!0), i(f, null, x(t.organization.products, (l) => (n(), v(D, {
218
+ onClick: z((g) => s.$router.push({ name: "Product Organization", params: { _id: t.organization._id, product: l._id } }), ["stop"]),
219
+ key: l._id,
220
+ editable: !1,
221
+ product: l,
222
+ class: "pd-thin radius-medium w-15r br-solid br-grey br-1px bg-white mn-r-thin"
223
+ }, null, 8, ["onClick", "product"]))), 128)),
224
+ ht
225
+ ])
226
+ ])) : a("", !0)
227
+ ]);
228
+ };
229
+ }
230
+ };
231
+ export {
232
+ wt as _,
233
+ A as a
234
+ };
@@ -0,0 +1 @@
1
+ "use strict";const e=require("vue"),a=require("vue-router"),u=require("./ButtonToggleMembership-b905812f.js");const h={class:"flex-stretch flex-nojustify flex-nowrap flex shop-cart-item"},g=["src"],p={key:1,width:"524",height:"345",viewBox:"0 0 524 345",fill:"none",xmlns:"http://www.w3.org/2000/svg",class:"i-extra"},f=e.createElementVNode("rect",{width:"524",height:"345",fill:"white"},null,-1),k=e.createElementVNode("rect",{width:"524",height:"345",fill:"white"},null,-1),x=e.createElementVNode("circle",{cx:"262",cy:"172",r:"56",fill:"#00ff88","fill-opacity":"0.1"},null,-1),v=e.createElementVNode("path",{fill:"#00ff88",d:"M229.348 186.819C230.243 191.884 233.393 194.231 238.458 193.273V193.644C238.458 198.832 241.206 201.581 246.364 201.581H291.545C296.733 201.581 299.481 198.74 299.481 193.644V162.576C299.481 157.481 296.733 154.64 291.545 154.64H285.677L284.071 145.653C283.175 140.619 279.995 138.303 274.899 139.198L230.398 147.043C225.302 147.969 223.048 151.15 223.943 156.246L229.348 186.819ZM230.83 186.479L225.456 156.06C224.715 151.86 226.537 149.266 230.737 148.525L275.084 140.712C279.13 140.001 281.848 141.762 282.62 145.993L284.102 154.64H246.364C241.206 154.64 238.458 157.419 238.458 162.576V191.729L238.365 191.76C234.165 192.532 231.571 190.679 230.83 186.479ZM239.971 162.669C239.971 158.376 242.164 156.153 246.456 156.153H291.483C295.59 156.153 297.968 158.376 297.968 162.669V190.093L284.565 177.894C283.145 176.597 281.662 175.856 279.809 175.856C277.987 175.856 276.628 176.566 275.146 177.863L262.052 189.073L257.142 184.565C255.875 183.36 254.764 182.743 253.158 182.743C251.675 182.743 250.656 183.36 249.39 184.503L239.971 193.212V162.669ZM257.636 178.419C261.373 178.419 264.43 175.3 264.43 171.471C264.43 167.734 261.373 164.584 257.636 164.584C253.806 164.584 250.718 167.734 250.718 171.471C250.718 175.3 253.806 178.419 257.636 178.419Z"},null,-1),b=[f,k,x,v],E={class:"text-left"},V={class:"name"},w={key:0,class:"t-transp"},C={key:1,class:"t-transp"},y={key:2,class:"t-transp"},N={class:"t-main t-demi price mn-small"},B={key:0},$={key:0,class:"flex-nojustify flex"},z={class:"flex-nowrap flex"},_=e.createElementVNode("svg",{fill:"none",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{"clip-rule":"evenodd",d:"m7.27124 0h5.45456c1.0041 0 1.8182.814027 1.8182 1.81818v.90899h2.7278c1.0042 0 1.8182.81402 1.8182 1.81818v1.81818c0 1.00415-.814 1.81818-1.8182 1.81818h-.0735l-.8363 10.00009c0 1.0042-.814 1.8182-1.8182 1.8182h-9.09087c-1.00416 0-1.81818-.814-1.81504-1.7427l-.83964-10.07559h-.07187c-1.00415 0-1.818177-.81403-1.818177-1.81818v-1.81818c0-1.00416.814027-1.81818 1.818177-1.81818h2.72668v-.90899c0-1.004153.81402-1.81818 1.81818-1.81818zm-1.81889 18.1819-.83047-10h10.75152l-.827 9.9245-.0031.0755zm-2.72612-11.81799v-1.81818h14.54547v1.81818zm10.00137-4.54571v.90909h-5.45456v-.90909z",fill:"#8a8a8a","fill-rule":"evenodd"})],-1),S=[_],L={__name:"CardOrderItem",props:{product:Object,editable:String,increase:Function,decrease:Function,remove:Function},setup(t){return a.useRouter(),(o,n)=>(e.openBlock(),e.createElementBlock("div",h,[t.product.images[0]?(e.openBlock(),e.createElementBlock("img",{key:0,class:"bg-grey aspect-1x1",src:(o.FILE_SERVER_URL||"")+t.product.images[0]},null,8,g)):e.createCommentVNode("",!0),t.product.images[0]?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("svg",p,b)),e.createElementVNode("div",E,[e.createElementVNode("p",V,[e.createTextVNode(e.toDisplayString(t.product.name)+" ",1),t.product.size?(e.openBlock(),e.createElementBlock("span",w,", "+e.toDisplayString(t.product.size),1)):e.createCommentVNode("",!0),typeof t.product.color=="string"&&t.product.size?(e.openBlock(),e.createElementBlock("span",C,", ")):e.createCommentVNode("",!0),typeof t.product.color=="string"?(e.openBlock(),e.createElementBlock("span",y,e.toDisplayString(t.product.color),1)):e.createCommentVNode("",!0)]),e.createElementVNode("p",N,[t.editable?(e.openBlock(),e.createElementBlock("span",B,e.toDisplayString(t.product.quantity)+" x ",1)):e.createCommentVNode("",!0),e.createTextVNode(e.toDisplayString(t.product.price)+" "+e.toDisplayString(o.returnCurrency()),1)]),t.editable?(e.openBlock(),e.createElementBlock("div",$,[e.createElementVNode("div",z,[e.createElementVNode("button",{onClick:n[0]||(n[0]=r=>t.decrease(t.product)),class:"mn-r-thin bg-grey button-square button"},"-"),e.createElementVNode("button",{onClick:n[1]||(n[1]=r=>t.increase(t.product)),class:"mn-r-thin bg-grey button-square button"},"+")]),e.createElementVNode("button",{onClick:n[2]||(n[2]=r=>t.remove(t.product)),class:"hover_br-transp hover_br-l-dark bg-transp button-square button"},S)])):e.createCommentVNode("",!0)])]))}},T={key:0,class:"cursor-pointer t-second"},c={__name:"Text",props:{maxLen:{type:Number,required:!0},text:{type:String,required:!0},showToggleText:{type:Boolean,default:!1}},setup(t){const o=t,n=e.ref(!1),r=e.computed(()=>o.text.length>o.maxLen?o.text.slice(0,o.maxLen)+"...":o.text),i=e.computed(()=>o.text),l=()=>{n.value=!n.value},s=e.computed(()=>n.value?i.value:r.value),d=e.computed(()=>o.text.length>o.maxLen),m=e.computed(()=>n.value?"Hide":"Show more");return(ne,oe)=>(e.openBlock(),e.createElementBlock("span",{onClick:l,class:""},[e.createTextVNode(e.toDisplayString(e.unref(s))+" ",1),e.unref(d)&&t.showToggleText?(e.openBlock(),e.createElementBlock("span",T,e.toDisplayString(e.unref(m)),1)):e.createCommentVNode("",!0)]))}},D={class:"pd-medium flex-v-center flex-nowrap flex"},M=["src"],q={key:1,class:"h-4r w-4r radius-extra",width:"42",height:"42",viewBox:"0 0 42 42",fill:"none",xmlns:"http://www.w3.org/2000/svg"},F=e.createElementVNode("circle",{fill:"rgb(var(--main))",cx:"21",cy:"21",r:"21"},null,-1),O=e.createElementVNode("path",{fill:"#242424","fill-opacity":"0.1","fill-rule":"evenodd","clip-rule":"evenodd",d:"M8.00233 37.4954C8.00078 37.4458 8 37.3961 8 37.3462C8 32.9066 11.5673 29.3077 15.9677 29.3077H26.0323C30.4328 29.3077 34 32.9066 34 37.3462C34 37.3961 33.9992 37.4458 33.9977 37.4954C30.4223 40.3165 25.9078 42 21 42C16.0922 42 11.5777 40.3164 8.00233 37.4954ZM21 9C16.5995 9 13.0323 12.5989 13.0323 17.0385C13.0323 21.478 16.5995 25.0769 21 25.0769C25.4005 25.0769 28.9677 21.478 28.9677 17.0385C28.9677 12.5989 25.4005 9 21 9Z"},null,-1),R=[F,O],H={class:"flex-child-1 flex-child mn-l-small w-100"},Z={class:"h3 mn-r-semi mn-thin"},U={key:0,class:"w-max star-container flex-v-center flex"},j={class:"mn-r-thin pd-r-thin pd-l-thin pd-micro radius-small t-semi uppercase bg-main p-small"},I=["src"],P={class:"p-small t-semi mn-r-thin"},A={class:"p-small"},G={class:"mn-thin"},J={key:0,class:"pd-medium"},K={class:"mn-small w-100 flex-nowrap flex flex-v-center pd-small bg-white radius-medium"},Q={class:"t-black p-medium t-semi"},W=e.createElementVNode("span",{class:"mn-r-small"},"30-60min",-1),X=e.createElementVNode("span",{class:"mn-r-auto"},"$50 min",-1),Y={class:"d-block o-scroll flex-nowrap flex"},ee=e.createElementVNode("button",{class:"flex-center flex-nowrap flex shop-cart-item pd-thin radius-medium w-15r bg-main button"},"View menu",-1),te={__name:"CardOrganization",props:{user:String,organization:Object},emits:["updateMembership"],setup(t,{emit:o}){return a.useRouter(),(n,r)=>{var i;return e.openBlock(),e.createElementBlock("div",{class:"bg-grey radius-big o-hidden",onClick:r[1]||(r[1]=l=>n.$router.push({name:"Organization",params:{_id:t.organization._id}}))},[e.createElementVNode("div",D,[t.organization.profile.photo&&t.organization.profile.photo.length>0?(e.openBlock(),e.createElementBlock("img",{key:0,src:(n.FILE_SERVER_URL||"")+t.organization.profile.photo,class:"h-4r w-4r radius-extra bg-white"},null,8,M)):(e.openBlock(),e.createElementBlock("svg",q,R)),e.createElementVNode("div",H,[e.createElementVNode("p",Z,[e.createVNode(c,{text:t.organization.profile.name?t.organization.profile.name:"",maxLen:16},null,8,["text"])]),t.organization.ratingS?(e.openBlock(),e.createElementBlock("div",U,[e.createElementVNode("span",j,e.toDisplayString(t.organization.types[0]),1),(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(5,l=>e.createElementVNode("img",{class:"i-small mn-r-thin",src:l<=t.organization.rating.median?"/icons/star.svg":"/icons/star-stroke.svg"},null,8,I)),64)),e.createElementVNode("span",P,e.toDisplayString(t.organization.rating.median),1),e.createElementVNode("span",A,"("+e.toDisplayString(t.organization.rating.amount)+")",1)])):e.createCommentVNode("",!0),e.createElementVNode("div",null,[e.createElementVNode("p",G,e.toDisplayString(t.organization.numberOfSubscribers)+" followers",1),(i=t.user)!=null&&i._id&&t.organization.owner!==t.user._id?(e.openBlock(),e.createBlock(u._sfc_main,{key:0,user:t.user._id,type:"organization",role:"subscriber",target:t.organization._id,status:t.organization.isSubscriber,text:{create:"Follow",remove:"Unfollow"},onUpdateMembership:r[0]||(r[0]=l=>n.handleMembershipUpdate(l,"isSubscriber","numberOfSubscribers")),class:"w-min"},null,8,["user","target","status"])):e.createCommentVNode("",!0)])])]),t.organization.products.length>0?(e.openBlock(),e.createElementBlock("div",J,[e.createElementVNode("div",K,[e.createElementVNode("p",Q,e.toDisplayString(t.organization.products.length)+" items: ",1),W,X]),e.createElementVNode("div",Y,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.organization.products,l=>(e.openBlock(),e.createBlock(L,{onClick:e.withModifiers(s=>n.$router.push({name:"Product Organization",params:{_id:t.organization._id,product:l._id}}),["stop"]),key:l._id,editable:!1,product:l,class:"pd-thin radius-medium w-15r br-solid br-grey br-1px bg-white mn-r-thin"},null,8,["onClick","product"]))),128)),ee])])):e.createCommentVNode("",!0)])}}};exports._sfc_main=te;exports._sfc_main$1=c;