@ozdao/prometheus-framework 0.1.19 → 0.1.21
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/BackofficeGallery-3bb55ea2.mjs +357 -0
- package/dist/BackofficeGallery-7ae8fbba.mjs +307 -0
- package/dist/BackofficeGallery-e54a33a3.js +1 -0
- package/dist/BackofficeGallery-fe39cff3.js +1 -0
- package/dist/Breadcrumbs.vue_vue_type_style_index_0_lang-8660f9cb.js +1 -0
- package/dist/Breadcrumbs.vue_vue_type_style_index_0_lang-bd3889ee.mjs +1945 -0
- package/dist/ButtonFollow-81508d85.mjs +132 -0
- package/dist/ButtonFollow-df6317f0.js +1 -0
- package/dist/CardOrganization-d8f209ee.js +1 -0
- package/dist/CardOrganization-de8ec36e.mjs +230 -0
- package/dist/Feed-a75d053e.js +1 -0
- package/dist/Feed-c4084664.mjs +368 -0
- package/dist/Feed-fea84ce7.mjs +439 -0
- package/dist/Feed-ff3b96b2.js +1 -0
- package/dist/Image-1281bc48.mjs +477 -0
- package/dist/Image-8e67dd2d.js +9 -0
- package/dist/Popup-b7609baa.js +1 -0
- package/dist/Popup-d5c4cb46.mjs +76 -0
- package/dist/Product-3c7b2921.mjs +841 -0
- package/dist/Product-6df77924.js +7 -0
- package/dist/ProductEdit-737e2a5a.mjs +302 -0
- package/dist/ProductEdit-c99ab559.js +1 -0
- package/dist/ProfileBlogposts-4293a1e3.js +1 -0
- package/dist/ProfileBlogposts-4c326fed.mjs +65 -0
- package/dist/ProfileComments-03f88b54.mjs +44 -0
- package/dist/ProfileComments-761ce00e.js +1 -0
- package/dist/ProfileEvents-0bdd36e4.mjs +57 -0
- package/dist/ProfileEvents-a9b96fec.js +1 -0
- package/dist/ProfileLikes-3edf6fb8.mjs +44 -0
- package/dist/ProfileLikes-51729962.js +1 -0
- package/dist/ProfileOrganizations-8961aaee.mjs +213 -0
- package/dist/ProfileOrganizations-f52e62e1.js +1 -0
- package/dist/Publics-70a0ca9c.mjs +45 -0
- package/dist/Publics-bbab7a79.js +1 -0
- package/dist/Select-90d4b7c8.mjs +81 -0
- package/dist/Select-b9299fb6.js +1 -0
- package/dist/Select.vue_vue_type_style_index_0_scoped_a78dbba1_lang-0ea8fbf8.js +1 -0
- package/dist/Select.vue_vue_type_style_index_0_scoped_a78dbba1_lang-4ed993c7.mjs +1 -0
- package/dist/UploadImage-c9711af2.js +1 -0
- package/dist/UploadImage-ec3714e8.mjs +83 -0
- package/dist/UploadImageMultiple-b4c8d627.js +1 -0
- package/dist/UploadImageMultiple-ebcc51e6.mjs +58 -0
- package/dist/auth-78d9392a.mjs +612 -0
- package/dist/auth-96449d96.js +7 -0
- package/dist/auth.client.cjs +8 -8
- package/dist/auth.client.js +8 -8
- package/dist/auth.validation-9e493d2f.mjs +20 -0
- package/dist/auth.validation-d4795c25.js +1 -0
- package/dist/backoffice.client.cjs +1 -1
- package/dist/backoffice.client.js +44 -49
- package/dist/community.client.cjs +1 -1
- package/dist/community.client.js +44 -42
- package/dist/events.client.cjs +2 -2
- package/dist/events.client.js +25 -24
- package/dist/index-2a0269fc.js +2 -0
- package/dist/index-9128ade5.mjs +1228 -0
- package/dist/landing.client.cjs +1 -1
- package/dist/modules/backoffice/components/layouts/Backoffice.vue.d.ts +2 -0
- package/dist/modules/gallery/components/sections/BackofficeGallery.vue.d.ts +2 -0
- package/dist/organizations-0fb56927.mjs +122 -0
- package/dist/organizations-195ec134.js +1 -0
- package/dist/organizations.client-b39db194.js +3 -0
- package/dist/organizations.client-df5e8a6f.mjs +3020 -0
- package/dist/organizations.client.cjs +1 -1
- package/dist/organizations.client.js +46 -44
- package/dist/style.css +1 -1
- package/dist/users.client.cjs +1 -1
- package/dist/users.client.js +23 -23
- package/package.json +1 -1
- package/src/modules/backoffice/components/layouts/{Account.vue → Backoffice.vue} +0 -11
- package/src/modules/backoffice/router/account.js +64 -43
- package/src/modules/backoffice/router/admin.js +105 -84
- package/src/modules/backoffice/router/backoffice.js +3 -3
- package/src/modules/gallery/components/sections/{Gallery.vue → BackofficeGallery.vue} +3 -1
@@ -0,0 +1 @@
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("vue"),q=require("./index-b41aac19.js"),R=require("./vue-draggable-next.esm-bundler-21a209c6.js"),G=require("./UploadImageMultiple-eddaac87.js"),A=require("vue-router"),O=require("./_plugin-vue_export-helper-f246444f.js");var z={};(function(n){Object.defineProperties(n,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});var e=t;const i={class:"flex-nowrap flex-v-center flex pd-medium bg-white"},r={key:0,class:"t-left mn-r-small w-33"},c={class:"w-100"},N=["value","placeholder"],_=e.defineComponent({__name:"Field",props:{label:{default:"Label"},placeholder:{default:"Enter something here"},field:{default:null},validation:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(l,{emit:o}){const a=l,d=e.ref(a.field);return(u,f)=>(e.openBlock(),e.createElementBlock("div",i,[l.label?(e.openBlock(),e.createElementBlock("div",r,[e.createElementVNode("label",null,e.toDisplayString(l.label),1)])):e.createCommentVNode("",!0),e.createElementVNode("div",c,[e.createElementVNode("input",{onInput:f[0]||(f[0]=x=>{var p;return d.value=o("update:modelValue",(p=x.target)==null?void 0:p.value)}),type:"text",class:"w-100",value:l.field,placeholder:l.placeholder},null,40,N)])]))}}),m={class:"input-wrapper"},E={class:"t-transp p-small"},y={key:0,class:"flex-nojustify flex-v-center flex-nowrap flex w-100"},w={key:1,class:"w-100"},b=["onClick"],s={__name:"Select",props:["obj","label","prop","value","options","content","textarea","placeholder","size"],setup(l){const o=l,a=e.ref(null),d=e.ref(!1);e.ref("Please select an item");let u=e.computed(()=>{if(o.prop[o.content]){var p=o.options.indexOf(o.prop[o.content]),h=o.options.map(g=>g);return p!=-1&&h.splice(p,1),h}else return o.options});o.prop[o.content]&&(a.value=o.prop[o.content]);function f(){d.value=!d.value}function x(p,h,g){var j=g;a.value=j,d.value=!d.value,p[h]=j}return(p,h)=>(e.openBlock(),e.createElementBlock("div",m,[e.createElementVNode("span",E,e.toDisplayString(l.label),1),e.createElementVNode("li",{onClick:h[0]||(h[0]=e.withModifiers(g=>f(),["stop"])),class:e.normalizeClass([{"input-small":l.size==="small"},"pd-small flex-center flex-nowrap flex bg-grey input-select input"])},[a.value?(e.openBlock(),e.createElementBlock("span",y,[e.createElementVNode("span",null,e.toDisplayString(a.value.name?a.value.name:a.value),1)])):(e.openBlock(),e.createElementBlock("span",w,e.toDisplayString(l.placeholder?l.placeholder:"Please select"),1))],2),d.value?(e.openBlock(),e.createElementBlock("ul",{key:0,class:e.normalizeClass([{"dropdown-small":l.size==="small"},"bg-grey dropdown-menu"])},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(u),g=>(e.openBlock(),e.createElementBlock("li",{class:e.normalizeClass([{"input-small":l.size==="small"},"pd-small bg-grey input-select input"])},[g?(e.openBlock(),e.createElementBlock("span",{key:0,onClick:j=>x(l.prop,l.content,g),class:"flex-nojustify flex-v-center flex-nowrap flex w-100"},[e.createElementVNode("span",null,e.toDisplayString(g.name?g.name:g),1)],8,b)):e.createCommentVNode("",!0)],2))),256))],2)):e.createCommentVNode("",!0)]))}},V=["disabled"],B={key:0},T={key:0,class:"loading"},k=e.createElementVNode("span",null,[e.createElementVNode("svg",{class:"i-default",width:"135",height:"140",viewBox:"0 0 135 140",xmlns:"http://www.w3.org/2000/svg",fill:"#fff"},[e.createElementVNode("rect",{y:"10",width:"15",height:"120",rx:"6"},[e.createElementVNode("animate",{attributeName:"height",begin:"0.5s",dur:"1s",values:"120;110;100;90;80;70;60;50;40;140;120",calcMode:"linear",repeatCount:"indefinite"}),e.createTextVNode(),e.createElementVNode("animate",{attributeName:"y",begin:"0.5s",dur:"1s",values:"10;15;20;25;30;35;40;45;50;0;10",calcMode:"linear",repeatCount:"indefinite"})]),e.createElementVNode("rect",{x:"30",y:"10",width:"15",height:"120",rx:"6"},[e.createElementVNode("animate",{attributeName:"height",begin:"0.25s",dur:"1s",values:"120;110;100;90;80;70;60;50;40;140;120",calcMode:"linear",repeatCount:"indefinite"}),e.createTextVNode(),e.createElementVNode("animate",{attributeName:"y",begin:"0.25s",dur:"1s",values:"10;15;20;25;30;35;40;45;50;0;10",calcMode:"linear",repeatCount:"indefinite"})]),e.createElementVNode("rect",{x:"60",width:"15",height:"140",rx:"6"},[e.createElementVNode("animate",{attributeName:"height",begin:"0s",dur:"1s",values:"120;110;100;90;80;70;60;50;40;140;120",calcMode:"linear",repeatCount:"indefinite"}),e.createTextVNode(),e.createElementVNode("animate",{attributeName:"y",begin:"0s",dur:"1s",values:"10;15;20;25;30;35;40;45;50;0;10",calcMode:"linear",repeatCount:"indefinite"})]),e.createElementVNode("rect",{x:"90",y:"10",width:"15",height:"120",rx:"6"},[e.createElementVNode("animate",{attributeName:"height",begin:"0.25s",dur:"1s",values:"120;110;100;90;80;70;60;50;40;140;120",calcMode:"linear",repeatCount:"indefinite"}),e.createTextVNode(),e.createElementVNode("animate",{attributeName:"y",begin:"0.25s",dur:"1s",values:"10;15;20;25;30;35;40;45;50;0;10",calcMode:"linear",repeatCount:"indefinite"})]),e.createElementVNode("rect",{x:"120",y:"10",width:"15",height:"120",rx:"6"},[e.createElementVNode("animate",{attributeName:"height",begin:"0.5s",dur:"1s",values:"120;110;100;90;80;70;60;50;40;140;120",calcMode:"linear",repeatCount:"indefinite"}),e.createTextVNode(),e.createElementVNode("animate",{attributeName:"y",begin:"0.5s",dur:"1s",values:"10;15;20;25;30;35;40;45;50;0;10",calcMode:"linear",repeatCount:"indefinite"})])])],-1),S=[k],P={key:0,class:"h4 loading"},L=e.createElementVNode("span",{class:"t-white"},"✔",-1),D=[L],U={key:0,class:"error"},I=e.defineComponent({__name:"Button",props:{submit:{type:Function,default:async()=>{console.log("Button click.")}},callback:{type:Function,default:async()=>{console.log("Button callback.")}},validation:{type:Boolean,default:!1}},setup(l){const o=l,a=e.ref(null),d=e.ref(null),u=e.ref(!1),f=e.ref(!1);async function x(){a.value.style["pointer-events"]="none",d.value=null,u.value=!0;try{await o.submit(),a.value.classList.add("bg-light-blue"),a.value.classList.remove("bg-blue"),u.value=!1,f.value=!0,setTimeout(()=>o.callback(),750)}catch{a.value.classList.add("bg-light-red"),a.value.classList.remove("bg-blue"),d.value="❌",setTimeout(()=>{a.value.classList.add("bg-blue"),a.value.classList.remove("bg-light-red"),a.value.style.pointerEvents="auto",u.value=!1,f.value=!1,d.value=null},1e3)}}return(p,h)=>(e.openBlock(),e.createElementBlock("button",{onClick:x,disabled:l.validation,ref_key:"button",ref:a,class:"w-100 t-white bg-blue button"},[e.createVNode(e.Transition,{mode:"out-in",name:"fadeIn"},{default:e.withCtx(()=>[!u.value&&!d.value&&!f.value?(e.openBlock(),e.createElementBlock("span",B,[e.renderSlot(p.$slots,"default")])):e.createCommentVNode("",!0)]),_:3}),e.createVNode(e.Transition,{mode:"out-in",name:"fadeIn"},{default:e.withCtx(()=>[u.value&&!d.value?(e.openBlock(),e.createElementBlock("div",T,S)):e.createCommentVNode("",!0)]),_:1}),e.createVNode(e.Transition,{mode:"out-in",name:"fadeIn"},{default:e.withCtx(()=>[f.value?(e.openBlock(),e.createElementBlock("div",P,D)):e.createCommentVNode("",!0)]),_:1}),e.createVNode(e.Transition,{mode:"out-in",name:"fadeIn"},{default:e.withCtx(()=>[d.value?(e.openBlock(),e.createElementBlock("div",U,[e.createElementVNode("span",null,e.toDisplayString(d.value),1)])):e.createCommentVNode("",!0)]),_:1})],8,V))}});var M={install:l=>{l.component("Field",_),l.component("Button",I),l.component("Select",s)}};n.Button=I,n.Field=_,n.Select=s,n.default=M})(z);const H=process.env.API_URL,F=q.axios.create({baseURL:H,withCredentials:!0}),v=t.reactive({gallery:[]}),C={async fetchGallery(n,e){const i=[];n&&i.push(`page=${n}`),e&&i.push(`limit=${e}`);const r=`/api/gallery${i.length?`?${i.join("&")}`:""}`;try{const c=await F.get(r);if(console.log(c),c&&c.data)return v.gallery=[...v.gallery,...c.data],c.data}catch(c){throw console.error("Error fetching gallery:",c),c}},async createPhoto(n){try{const e=await F.post("/api/gallery/create",n);console.log(e.data),v.gallery=[...e.data,...v.gallery]}catch(e){console.error(e)}},async updatePhoto(n){try{const e={...n,categories:typeof n.categories=="string"?n.categories.split(",").map(c=>c.trim()):n.categories},i=await q.axios.post("/api/gallery/update",e),r=v.gallery.findIndex(c=>c._id===n._id);r!==-1&&(v.gallery[r]=i.data)}catch(e){console.error(e)}},async deletePhoto(n){try{const e=await F.post(`/api/gallery/delete/${n}`),i=v.gallery.findIndex(r=>r._id===n);i!==-1&&v.gallery.splice(i,1)}catch(e){console.error(e)}}};const X={class:"pos-relative"},J=["src"],K=["onClick"],Q={__name:"EditImages",props:{images:Array},emits:["update"],setup(n,{emit:e}){const i=n,r=t.ref([...i.images]);t.watchEffect(()=>{r.value=[...i.images]});const c=()=>{e("update:images",r.value)},N=m=>{r.value=[...r.value,...m],c()},_=m=>{r.value.splice(m,1),c()};return(m,E)=>(t.openBlock(),t.createElementBlock("div",null,[t.createVNode(G._sfc_main,{"onUpdate:images":N,uploadPath:"photos",class:"mn-semi pd-small w-100 button bg-black t-white"}),t.createVNode(t.unref(R.VueDraggableNext),{class:"gap-small flex dragArea list-group w-full",modelValue:r.value,"onUpdate:modelValue":E[0]||(E[0]=y=>r.value=y),onChange:c},{default:t.withCtx(()=>[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(r.value,(y,w)=>(t.openBlock(),t.createElementBlock("div",X,[t.createElementVNode("img",{class:"i-extra radius-small o-hidden mn-thin",src:(m.FILE_SERVER_URL||"")+y},null,8,J),t.createElementVNode("a",{onClick:b=>_(w),class:"pos-absolute t-center radius-extra i-medium bg-red pos-t-0 pos-r-0"},"X",8,K)]))),256))]),_:1},8,["modelValue"])]))}};const $=n=>(t.pushScopeId("data-v-f1c3938d"),n=n(),t.popScopeId(),n),W={class:"pos-relative w-100"},Y={class:"w-100 o-hidden"},Z={class:"pd-medium flex-nowrap flex pd-t-thin pd-b-thin o-scroll"},ee=["data-id"],te=["src","onClick"],le={key:1,class:"pd-small radius-small bg-white"},ae=["src","onClick"],oe={class:"t-black p-small mn-small"},ne=$(()=>t.createElementVNode("span",{class:"uppercase t-transp"},"Size",-1)),se=$(()=>t.createElementVNode("br",null,null,-1)),re={class:"pd-2px radius-big d-inline-block bg-grey"},ce={class:"t-black p-small mn-small uppe"},ie=$(()=>t.createElementVNode("span",{class:"uppercase t-transp"},"Categories",-1)),de=$(()=>t.createElementVNode("br",null,null,-1)),ue={class:"pd-2px radius-big d-inline-block bg-grey t-semi"},me={class:"flex-nowrap flex"},pe=["onClick"],ge={class:"modal pd-thin"},ve={class:"modal-content radius-big"},fe={class:""},he=["src"],_e={key:0,class:"flex-v-center flex m modal pd-big"},ye={class:"modal-content radius-small pd-medium bg-white"},be=["src"],ke=["src"],Ne={__name:"BackofficeGallery",setup(n){A.useRoute();const e=t.ref(!0),i=t.ref(null);let r=1;const c=10;let N=t.ref(null),_=t.ref(!1);const m=t.ref([]),E=l=>{m.value=l},y=t.computed(()=>M.value==="all"?v.gallery:v.gallery.filter(l=>l.categories.includes(M.value))),w=async()=>{_.value=!0,await C.fetchGallery(r,c),_.value=!1},b=t.ref(null),s=t.ref({categories:"",size:"",image:!1}),V=t.ref(null),B=l=>{console.log(e.value),e.value?T(l):(b.value="modal",s.value.image=l,S())},T=l=>{b.value="edit-modal",s.value=l||{categories:"",size:"",image:null},S()},k=()=>{s.value={categories:"",size:"",image:!1},V.value=null,P()},S=()=>{document.body.style.overflow="hidden",document.documentElement.style.overflow="hidden"},P=()=>{document.body.style.overflow="",document.documentElement.style.overflow=""},L=[{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"}],D=async l=>{await C.deletePhoto(l)},U=async()=>{await C.updatePhoto(s.value),k()},I=async l=>{if(m.length<1||!s.value.categories||!s.value.size){console.error("All fields are required.");return}await C.createPhoto({images:m.value,size:s.value.size,categories:typeof s.value.categories=="string"?s.value.categories.split(",").map(o=>o.trim()):s.value.categories}),k()};let M=t.ref("all");return t.onMounted(async()=>{await C.fetchGallery(r,c),typeof window<"u"&&new IntersectionObserver(o=>{o.some(a=>a.isIntersecting)&&(r+=1,w())}).observe(N.value)}),(l,o)=>(t.openBlock(),t.createElementBlock("div",W,[t.createElementVNode("div",Y,[t.createElementVNode("div",Z,[e.value?(t.openBlock(),t.createElementBlock("button",{key:0,onClick:o[0]||(o[0]=a=>B(null)),class:"mn-r-small t-white t-black bg-second button-small button"},"Add photos +")):t.createCommentVNode("",!0)])]),t.createElementVNode("div",{ref_key:"grid",ref:i,class:"pd-medium cols-4 gap-thin"},[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(t.unref(y),(a,d)=>(t.openBlock(),t.createElementBlock("div",{key:a.id,"data-id":a.id},[t.createVNode(t.Transition,{name:"scaleIn",mode:"in-out"},{default:t.withCtx(()=>[!e.value&&i.value?(t.openBlock(),t.createElementBlock("img",{key:0,src:"https://thecommunephuket.com/photos/"+a.cover,class:"w-100 h-100 o-hidden radius-medium object-fit-cover",onClick:u=>B(a.image)},null,8,te)):(t.openBlock(),t.createElementBlock("div",le,[t.createTextVNode(t.toDisplayString(a._id)+" ",1),t.createElementVNode("img",{src:"https://thecommunephuket.com/photos/"+a.cover,class:"w-100 radius-small mn-small h-10r object-fit-cover",onClick:u=>B(a)},null,8,ae),t.createElementVNode("p",oe,[ne,se,t.createElementVNode("span",re,t.toDisplayString(a.size.name),1)]),t.createElementVNode("p",ce,[ie,de,(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(a.categories,u=>(t.openBlock(),t.createElementBlock("span",ue,t.toDisplayString(u),1))),256))]),t.createElementVNode("div",me,[t.createElementVNode("button",{class:"button-small w-100 button",onClick:u=>D(a._id)},"Delete",8,pe)])]))]),_:2},1024)],8,ee))),128)),t.createElementVNode("div",{ref_key:"sentinel",ref:N,class:"sentinel"},null,512),t.createVNode(t.Transition,{name:"modal"},{default:t.withCtx(()=>[t.withDirectives(t.createElementVNode("div",ge,[t.createElementVNode("div",ve,[t.createElementVNode("div",fe,[t.createElementVNode("span",{class:"close",onClick:k},"×"),t.createElementVNode("img",{src:"https://thecommunephuket.com/photos/"+s.value.image},null,8,he)])])],512),[[t.vShow,s.value.image!==!1&&b.value==="modal"]])]),_:1}),t.createVNode(t.Transition,{name:"modal"},{default:t.withCtx(()=>[s.value.image!==!1&&b.value==="edit-modal"?(t.openBlock(),t.createElementBlock("div",_e,[t.createElementVNode("div",ye,[t.createElementVNode("span",{class:"close",onClick:k},"×"),typeof V.value=="string"?(t.openBlock(),t.createElementBlock("img",{key:0,src:V.value,class:"radius-small w-100 mn-small h-20r object-fit-cover"},null,8,be)):t.createCommentVNode("",!0),typeof V.value=="object"&&s.value.image!==null?(t.openBlock(),t.createElementBlock("img",{key:1,class:"radius-small w-100 mn-small h-20r object-fit-cover",src:"/photos/"+s.value.cover},null,8,ke)):t.createCommentVNode("",!0),t.createVNode(t.unref(z.Select),{options:L,label:"Size",select:s.value.size,"onUpdate:select":o[1]||(o[1]=a=>s.value.size=a),placeholder:"Select Size",class:"bg-grey pd-thin radius-small mn-thin t-black"},null,8,["select"]),t.createVNode(t.unref(z.Field),{field:s.value.categories,"onUpdate:field":o[2]||(o[2]=a=>s.value.categories=a),type:"text",label:"Categories",placeholder:"Enter categories for image (comma separated)",class:"bg-grey pd-thin radius-small mn-medium t-black"},null,8,["field"]),t.createVNode(Q,{images:m.value,"onUpdate:images":E,uploadPath:"photos",class:"mn-semi"},null,8,["images"]),t.createVNode(t.unref(z.Button),{submit:s.value._id?U:I,callback:k,class:"mn-thin"},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(s.value._id?"Update":"Create"),1)]),_:1},8,["submit"])])])):t.createCommentVNode("",!0)]),_:1})],512)]))}},Ee=O._export_sfc(Ne,[["__scopeId","data-v-f1c3938d"]]);exports.default=Ee;
|
@@ -0,0 +1 @@
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),b=require("./index-2a0269fc.js"),U=require("./Select-b9299fb6.js"),q=require("./vue-draggable-next.esm-bundler-80731ae0.js"),D=require("./UploadImageMultiple-b4c8d627.js"),M=require("vue-router"),R=require("./_plugin-vue_export-helper-f246444f.js");require("./Select.vue_vue_type_style_index_0_scoped_a78dbba1_lang-0ea8fbf8.js");const j=process.env.API_URL,N=b.axios.create({baseURL:j,withCredentials:!0}),u=e.reactive({gallery:[]}),v={async fetchGallery(a,t){const c=[];a&&c.push(`page=${a}`),t&&c.push(`limit=${t}`);const o=`/api/gallery${c.length?`?${c.join("&")}`:""}`;try{const s=await N.get(o);if(console.log(s),s&&s.data)return u.gallery=[...u.gallery,...s.data],s.data}catch(s){throw console.error("Error fetching gallery:",s),s}},async createPhoto(a){try{const t=await N.post("/api/gallery/create",a);console.log(t.data),u.gallery=[...t.data,...u.gallery]}catch(t){console.error(t)}},async updatePhoto(a){try{const t={...a,categories:typeof a.categories=="string"?a.categories.split(",").map(s=>s.trim()):a.categories},c=await b.axios.post("/api/gallery/update",t),o=u.gallery.findIndex(s=>s._id===a._id);o!==-1&&(u.gallery[o]=c.data)}catch(t){console.error(t)}},async deletePhoto(a){try{const t=await N.post(`/api/gallery/delete/${a}`),c=u.gallery.findIndex(o=>o._id===a);c!==-1&&u.gallery.splice(c,1)}catch(t){console.error(t)}}};const G={class:"pos-relative"},L=["src"],T=["onClick"],A={__name:"EditImages",props:{images:Array},emits:["update"],setup(a,{emit:t}){const c=a,o=e.ref([...c.images]);e.watchEffect(()=>{o.value=[...c.images]});const s=()=>{t("update:images",o.value)},_=i=>{o.value=[...o.value,...i],s()},h=i=>{o.value.splice(i,1),s()};return(i,f)=>(e.openBlock(),e.createElementBlock("div",null,[e.createVNode(D._sfc_main,{"onUpdate:images":_,uploadPath:"photos",class:"mn-semi pd-small w-100 button bg-black t-white"}),e.createVNode(e.unref(q.VueDraggableNext),{class:"gap-small flex dragArea list-group w-full",modelValue:o.value,"onUpdate:modelValue":f[0]||(f[0]=m=>o.value=m),onChange:s},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.value,(m,w)=>(e.openBlock(),e.createElementBlock("div",G,[e.createElementVNode("img",{class:"i-extra radius-small o-hidden mn-thin",src:(i.FILE_SERVER_URL||"")+m},null,8,L),e.createElementVNode("a",{onClick:p=>h(w),class:"pos-absolute t-center radius-extra i-medium bg-red pos-t-0 pos-r-0"},"X",8,T)]))),256))]),_:1},8,["modelValue"])]))}};const E=a=>(e.pushScopeId("data-v-e82aa4af"),a=a(),e.popScopeId(),a),F={class:"pos-relative w-100"},O={class:"w-100 o-hidden"},H={class:"pd-medium flex-nowrap flex pd-t-thin pd-b-thin o-scroll"},X=["data-id"],J=["src","onClick"],K={key:1,class:"pd-small radius-small bg-white"},Q=["src","onClick"],W={class:"t-black p-small mn-small"},Y=E(()=>e.createElementVNode("span",{class:"uppercase t-transp"},"Size",-1)),Z=E(()=>e.createElementVNode("br",null,null,-1)),ee={class:"pd-2px radius-big d-inline-block bg-grey"},te={class:"t-black p-small mn-small uppe"},le=E(()=>e.createElementVNode("span",{class:"uppercase t-transp"},"Categories",-1)),ae=E(()=>e.createElementVNode("br",null,null,-1)),oe={class:"pd-2px radius-big d-inline-block bg-grey t-semi"},se={class:"flex-nowrap flex"},ne=["onClick"],ce={class:"modal pd-thin"},re={class:"modal-content radius-big"},ie={class:""},de=["src"],ue={key:0,class:"flex-v-center flex m modal pd-big"},me={class:"modal-content radius-small pd-medium bg-white"},pe=["src"],ge=["src"],ve={__name:"BackofficeGallery",setup(a){M.useRoute();const t=e.ref(!0),c=e.ref(null);let o=1;const s=10;let _=e.ref(null),h=e.ref(!1);const i=e.ref([]),f=r=>{i.value=r},m=e.computed(()=>B.value==="all"?u.gallery:u.gallery.filter(r=>r.categories.includes(B.value))),w=async()=>{h.value=!0,await v.fetchGallery(o,s),h.value=!1},p=e.ref(null),l=e.ref({categories:"",size:"",image:!1}),y=e.ref(null),V=r=>{console.log(t.value),t.value?C(r):(p.value="modal",l.value.image=r,x())},C=r=>{p.value="edit-modal",l.value=r||{categories:"",size:"",image:null},x()},g=()=>{l.value={categories:"",size:"",image:!1},y.value=null,I()},x=()=>{document.body.style.overflow="hidden",document.documentElement.style.overflow="hidden"},I=()=>{document.body.style.overflow="",document.documentElement.style.overflow=""},S=[{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"}],$=async r=>{await v.deletePhoto(r)},P=async()=>{await v.updatePhoto(l.value),g()},z=async r=>{if(i.length<1||!l.value.categories||!l.value.size){console.error("All fields are required.");return}await v.createPhoto({images:i.value,size:l.value.size,categories:typeof l.value.categories=="string"?l.value.categories.split(",").map(d=>d.trim()):l.value.categories}),g()};let B=e.ref("all");return e.onMounted(async()=>{await v.fetchGallery(o,s),typeof window<"u"&&new IntersectionObserver(d=>{d.some(n=>n.isIntersecting)&&(o+=1,w())}).observe(_.value)}),(r,d)=>(e.openBlock(),e.createElementBlock("div",F,[e.createElementVNode("div",O,[e.createElementVNode("div",H,[t.value?(e.openBlock(),e.createElementBlock("button",{key:0,onClick:d[0]||(d[0]=n=>V(null)),class:"mn-r-small t-white t-black bg-second button-small button"},"Add photos +")):e.createCommentVNode("",!0)])]),e.createElementVNode("div",{ref_key:"grid",ref:c,class:"pd-medium cols-4 gap-thin"},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(m),(n,he)=>(e.openBlock(),e.createElementBlock("div",{key:n.id,"data-id":n.id},[e.createVNode(e.Transition,{name:"scaleIn",mode:"in-out"},{default:e.withCtx(()=>[!t.value&&c.value?(e.openBlock(),e.createElementBlock("img",{key:0,src:"https://thecommunephuket.com/photos/"+n.cover,class:"w-100 h-100 o-hidden radius-medium object-fit-cover",onClick:k=>V(n.image)},null,8,J)):(e.openBlock(),e.createElementBlock("div",K,[e.createTextVNode(e.toDisplayString(n._id)+" ",1),e.createElementVNode("img",{src:"https://thecommunephuket.com/photos/"+n.cover,class:"w-100 radius-small mn-small h-10r object-fit-cover",onClick:k=>V(n)},null,8,Q),e.createElementVNode("p",W,[Y,Z,e.createElementVNode("span",ee,e.toDisplayString(n.size.name),1)]),e.createElementVNode("p",te,[le,ae,(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.categories,k=>(e.openBlock(),e.createElementBlock("span",oe,e.toDisplayString(k),1))),256))]),e.createElementVNode("div",se,[e.createElementVNode("button",{class:"button-small w-100 button",onClick:k=>$(n._id)},"Delete",8,ne)])]))]),_:2},1024)],8,X))),128)),e.createElementVNode("div",{ref_key:"sentinel",ref:_,class:"sentinel"},null,512),e.createVNode(e.Transition,{name:"modal"},{default:e.withCtx(()=>[e.withDirectives(e.createElementVNode("div",ce,[e.createElementVNode("div",re,[e.createElementVNode("div",ie,[e.createElementVNode("span",{class:"close",onClick:g},"×"),e.createElementVNode("img",{src:"https://thecommunephuket.com/photos/"+l.value.image},null,8,de)])])],512),[[e.vShow,l.value.image!==!1&&p.value==="modal"]])]),_:1}),e.createVNode(e.Transition,{name:"modal"},{default:e.withCtx(()=>[l.value.image!==!1&&p.value==="edit-modal"?(e.openBlock(),e.createElementBlock("div",ue,[e.createElementVNode("div",me,[e.createElementVNode("span",{class:"close",onClick:g},"×"),typeof y.value=="string"?(e.openBlock(),e.createElementBlock("img",{key:0,src:y.value,class:"radius-small w-100 mn-small h-20r object-fit-cover"},null,8,pe)):e.createCommentVNode("",!0),typeof y.value=="object"&&l.value.image!==null?(e.openBlock(),e.createElementBlock("img",{key:1,class:"radius-small w-100 mn-small h-20r object-fit-cover",src:"/photos/"+l.value.cover},null,8,ge)):e.createCommentVNode("",!0),e.createVNode(U.Select,{options:S,label:"Size",select:l.value.size,"onUpdate:select":d[1]||(d[1]=n=>l.value.size=n),placeholder:"Select Size",class:"bg-grey pd-thin radius-small mn-thin t-black"},null,8,["select"]),e.createVNode(b.Field,{field:l.value.categories,"onUpdate:field":d[2]||(d[2]=n=>l.value.categories=n),type:"text",label:"Categories",placeholder:"Enter categories for image (comma separated)",class:"bg-grey pd-thin radius-small mn-medium t-black"},null,8,["field"]),e.createVNode(A,{images:i.value,"onUpdate:images":f,uploadPath:"photos",class:"mn-semi"},null,8,["images"]),e.createVNode(b._sfc_main,{submit:l.value._id?P:z,callback:g,class:"mn-thin"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(l.value._id?"Update":"Create"),1)]),_:1},8,["submit"])])])):e.createCommentVNode("",!0)]),_:1})],512)]))}},_e=R._export_sfc(ve,[["__scopeId","data-v-e82aa4af"]]);exports.default=_e;
|
@@ -0,0 +1 @@
|
|
1
|
+
"use strict";const t=require("vue"),V=require("./index-2a0269fc.js"),g=require("./_plugin-vue_export-helper-f246444f.js");var $=function e(i,s){if(i===s)return!0;if(i&&s&&typeof i=="object"&&typeof s=="object"){if(i.constructor!==s.constructor)return!1;var n,r,o;if(Array.isArray(i)){if(n=i.length,n!=s.length)return!1;for(r=n;r--!==0;)if(!e(i[r],s[r]))return!1;return!0}if(i.constructor===RegExp)return i.source===s.source&&i.flags===s.flags;if(i.valueOf!==Object.prototype.valueOf)return i.valueOf()===s.valueOf();if(i.toString!==Object.prototype.toString)return i.toString()===s.toString();if(o=Object.keys(i),n=o.length,n!==Object.keys(s).length)return!1;for(r=n;r--!==0;)if(!Object.prototype.hasOwnProperty.call(s,o[r]))return!1;for(r=n;r--!==0;){var l=o[r];if(!e(i[l],s[l]))return!1}return!0}return i!==i&&s!==s};const O=V.getDefaultExportFromCjs($),B=(e,i)=>i.filter(s=>{const{text:n}=e;if(typeof s.rule=="string")return!new RegExp(s.rule).test(n);if(s.rule instanceof RegExp)return!s.rule.test(n);if({}.toString.call(s.rule)==="[object Function]")return s.rule(e)}).map(s=>s.classes),c=e=>JSON.parse(JSON.stringify(e)),C=(e,i)=>{let s=0;for(;s<e.length;){if(i(e[s],s,e))return s;s++}return-1},k=(e,i,s=[],n)=>{e.text===void 0&&(e={text:e});const r=B(e,s),o=C(i,d=>d===e),l=c(i),a=o!==-1?l.splice(o,1)[0]:c(e);return(n?n(l,a):l.map(d=>d.text).indexOf(a.text)!==-1)&&r.push("ti-duplicate"),r.length===0?r.push("ti-valid"):r.push("ti-invalid"),r},m=(e,...i)=>{e.text===void 0&&(e={text:e});const s=c(e);return s.tiClasses=k(e,...i),s},D=(e,...i)=>e.map(s=>m(s,e,...i));const L={name:"TagInput",props:{scope:{type:Object}}},A=["maxlength"];function N(e,i,s,n,r,o){return s.scope.edit?t.withDirectives((t.openBlock(),t.createElementBlock("input",{key:0,"onUpdate:modelValue":i[0]||(i[0]=l=>s.scope.tag.text=l),maxlength:s.scope.maxlength,type:"text",class:"ti-tag-input",size:"1",onInput:i[1]||(i[1]=l=>s.scope.validateTag(s.scope.index,l)),onBlur:i[2]||(i[2]=l=>s.scope.performCancelEdit(s.scope.index)),onKeydown:i[3]||(i[3]=l=>s.scope.performSaveEdit(s.scope.index,l))},null,40,A)),[[t.vModelText,s.scope.tag.text]]):t.createCommentVNode("",!0)}const M=g._export_sfc(L,[["render",N],["__scopeId","data-v-a1f1c345"]]),b=e=>!e.some(i=>{const s=!i.text;s&&console.warn('Missing property "text"',i);let n=!1;return i.classes&&(n=typeof i.classes!="string"),n&&console.warn('Property "classes" must be type of string',i),s||n}),w=e=>!e.some(i=>{if(typeof i=="number"){const s=isFinite(i)&&Math.floor(i)===i;return s||console.warn("Only numerics are allowed for this prop. Found:",i),!s}else if(typeof i=="string"){const s=/\W|[a-z]|!\d/i.test(i);return s||console.warn("Only alpha strings are allowed for this prop. Found:",i),!s}else return console.warn("Only numeric and string values are allowed. Found:",i),!1}),F={modelValue:{type:String,default:"",required:!0},tags:{type:Array,default:()=>[],validator:b},autocompleteItems:{type:Array,default:()=>[],validator:b},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:w},saveOnKey:{type:Array,default:()=>[13],validator:w},maxTags:{type:Number},maxlength:{type:Number},validation:{type:Array,default:()=>[],validator(e){return!e.some(i=>{const s=!i.rule;s&&console.warn('Property "rule" is missing',i);const n=i.rule&&(typeof i.rule=="string"||i.rule instanceof RegExp||{}.toString.call(i.rule)==="[object Function]");n||console.warn("A rule must be type of string, RegExp or function. Found:",JSON.stringify(i.rule));const r=!i.classes;r&&console.warn('Property "classes" is missing',i);const o=i.type&&typeof i.type!="string";return o&&console.warn('Property "type" must be type of string. Found:',i),!n||s||r||o})}},separators:{type:Array,default:()=>[";"],validator(e){return!e.some(i=>{const s=typeof i!="string";return s&&console.warn("Separators must be type of string. Found:",i),s})}},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},I={name:"VueTagsInput",components:{TagInput:M},props:F,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(i=>m(i,this.tags,this.validation,this.isDuplicate));return this.autocompleteFilterDuplicates?e.filter(this.duplicateFilter):e}},methods:{createClasses:k,getSelectedIndex(e){const i=this.filteredAutocompleteItems,s=this.selectedItem,n=i.length-1;if(i.length!==0)return s===null?0:e==="before"&&s===0?n:e==="after"&&s===n?0:e==="after"?s+1:s-1},selectDefaultItem(){this.addOnlyFromAutocomplete&&this.filteredAutocompleteItems.length>0?this.selectedItem=0:this.selectedItem=null},selectItem(e,i){e.preventDefault(),this.selectedItem=this.getSelectedIndex(i)},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,i){const s=this.tagsCopy[e];s.text=i?i.target.value:this.tagsCopy[e].text,this.tagsCopy[e]=m(s,this.tagsCopy,this.validation,this.isDuplicate)},focus(e){this.$nextTick(()=>{const i=this.tagCenter[e].querySelector("input.ti-tag-input");i&&i.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(i=>{const s=this.validation.find(n=>i===n.classes);return s?s.disableAdd:!1})},createTagTexts(e){const i=new RegExp(this.separators.map(s=>this.quote(s)).join("|"));return e.split(i).map(s=>({text:s}))},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,i){const s=this[i].indexOf(e.keyCode)!==-1||this[i].indexOf(e.key)!==-1;return s&&e.preventDefault(),!s},performAddTags(e,i,s){if(this.disabled||i&&this.noTriggerKey(i,"addOnKey"))return;let n=[];typeof e=="object"&&(n=[e]),typeof e=="string"&&(n=this.createTagTexts(e)),n=n.filter(r=>r.text.trim().length>0),n.forEach(r=>{r=m(r,this.tags,this.validation,this.isDuplicate),this.onBeforeAddingTag||this.addTag(r,s),this.$emit("before-adding-tag",{tag:r,addTag:()=>this.addTag(r,s)})})},duplicateFilter(e){return this.isDuplicate?!this.isDuplicate(this.tagsCopy,e):!this.tagsCopy.find(i=>i.text===e.text)},addTag(e,i="new-tag-input"){const s=this.filteredAutocompleteItems.map(n=>n.text);this.addOnlyFromAutocomplete&&s.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),i==="autocomplete"&&this.$refs.newTagInput.focus(),this.$emit("tags-changed",this.tagsCopy))})},performSaveTag(e,i){const s=this.tagsCopy[e];this.disabled||i&&this.noTriggerKey(i,"addOnKey")||s.text.trim().length!==0&&(this["on-before-saving-tag"]||this.saveTag(e,s),this.$emit("before-saving-tag",{index:e,tag:s,saveTag:()=>this.saveTag(e,s)}))},saveTag(e,i){if(this.avoidAddingDuplicates){const s=c(this.tagsCopy),n=s.splice(e,1)[0];if(this.isDuplicate?this.isDuplicate(s,n):s.map(o=>o.text).indexOf(n.text)!==-1)return this.$emit("saving-duplicate",i)}this.hasForbiddingAddRule(i.tiClasses)||(this.tagsCopy[e]=i,this.toggleEditMode(e),this.$emit("update:tags",this.tagsCopy),this.$emit("tags-changed",this.tagsCopy))},tagsEqual(){return!this.tagsCopy.some((e,i)=>!O(e,this.tags[i]))},updateNewTag(e){const i=e.target.value;this.newTag=i,this.$emit("update:modelValue",i)},initTags(){this.tagsCopy=D(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 K={class:"ti-input"},P={key:0,class:"ti-tags"},z=["onClick"],R={class:"ti-content"},H={key:0,class:"ti-tag-left"},G=["onClick"],j={key:1,class:"ti-tag-right"},q={class:"ti-actions"},U=["onClick"],J=["onClick"],W={class:"ti-new-tag-input-wrapper"},Y=["placeholder","value","maxlength","disabled"],Q=["onMouseover"],X=["onClick"];function Z(e,i,s,n,r,o){const l=t.resolveComponent("tag-input");return t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(["vue-tags-input",[{"ti-disabled":e.disabled},{"ti-focus":e.focused},e.$attrs.class]]),style:t.normalizeStyle(e.$attrs.style)},[t.createElementVNode("div",K,[e.tagsCopy?(t.openBlock(),t.createElementBlock("ul",P,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.tagsCopy,(a,u)=>(t.openBlock(),t.createElementBlock("li",{key:u,style:t.normalizeStyle(a.style),class:t.normalizeClass([[{"ti-editing":e.tagsEditStatus[u]},a.tiClasses,a.classes,{"ti-deletion-mark":e.isMarked(u)}],"ti-tag"]),tabindex:"0",onClick:d=>e.$emit("tag-clicked",{tag:a,index:u})},[t.createElementVNode("div",R,[e.$slots["tag-left"]?(t.openBlock(),t.createElementBlock("div",H,[t.renderSlot(e.$slots,"tag-left",{tag:a,index:u,edit:e.tagsEditStatus[u],performSaveEdit:e.performSaveTag,performDelete:e.performDeleteTag,performCancelEdit:e.cancelEdit,performOpenEdit:e.performEditTag,deletionMark:e.isMarked(u)},void 0,!0)])):t.createCommentVNode("",!0),t.createElementVNode("div",{ref_for:!0,ref:e.setTagCenter,class:"ti-tag-center"},[e.$slots["tag-center"]?t.createCommentVNode("",!0):(t.openBlock(),t.createElementBlock("span",{key:0,class:t.normalizeClass({"ti-hidden":e.tagsEditStatus[u]}),onClick:d=>e.performEditTag(u)},t.toDisplayString(a.text),11,G)),e.$slots["tag-center"]?t.createCommentVNode("",!0):(t.openBlock(),t.createBlock(l,{key:1,scope:{edit:e.tagsEditStatus[u],maxlength:e.maxlength,tag:a,index:u,validateTag:e.createChangedTag,performCancelEdit:e.cancelEdit,performSaveEdit:e.performSaveTag}},null,8,["scope"])),t.renderSlot(e.$slots,"tag-center",{tag:a,index:u,maxlength:e.maxlength,edit:e.tagsEditStatus[u],performSaveEdit:e.performSaveTag,performDelete:e.performDeleteTag,performCancelEdit:e.cancelEdit,validateTag:e.createChangedTag,performOpenEdit:e.performEditTag,deletionMark:e.isMarked(u)},void 0,!0)],512),e.$slots["tag-right"]?(t.openBlock(),t.createElementBlock("div",j,[t.renderSlot(e.$slots,"tag-right",{tag:a,index:u,edit:e.tagsEditStatus[u],performSaveEdit:e.performSaveTag,performDelete:e.performDeleteTag,performCancelEdit:e.cancelEdit,performOpenEdit:e.performEditTag,deletionMark:e.isMarked(u)},void 0,!0)])):t.createCommentVNode("",!0)]),t.createElementVNode("div",q,[e.$slots["tag-actions"]?t.createCommentVNode("",!0):t.withDirectives((t.openBlock(),t.createElementBlock("i",{key:0,class:"ti-icon-undo",onClick:d=>e.cancelEdit(u)},null,8,U)),[[t.vShow,e.tagsEditStatus[u]]]),e.$slots["tag-actions"]?t.createCommentVNode("",!0):t.withDirectives((t.openBlock(),t.createElementBlock("i",{key:1,class:"ti-icon-close",onClick:d=>e.performDeleteTag(u)},null,8,J)),[[t.vShow,!e.tagsEditStatus[u]]]),e.$slots["tag-actions"]?t.renderSlot(e.$slots,"tag-actions",{key:2,tag:a,index:u,edit:e.tagsEditStatus[u],performSaveEdit:e.performSaveTag,performDelete:e.performDeleteTag,performCancelEdit:e.cancelEdit,performOpenEdit:e.performEditTag,deletionMark:e.isMarked(u)},void 0,!0):t.createCommentVNode("",!0)])],14,z))),128)),t.createElementVNode("li",W,[t.createElementVNode("input",t.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:[i[0]||(i[0]=a=>e.performAddTags(e.filteredAutocompleteItems[e.selectedItem]||e.newTag,a)),i[2]||(i[2]=t.withKeys((...a)=>e.invokeDelete&&e.invokeDelete(...a),["delete"])),i[3]||(i[3]=t.withKeys((...a)=>e.performBlur&&e.performBlur(...a),["tab"])),i[4]||(i[4]=t.withKeys(a=>e.selectItem(a,"before"),["up"])),i[5]||(i[5]=t.withKeys(a=>e.selectItem(a,"after"),["down"]))],onPaste:i[1]||(i[1]=(...a)=>e.addTagsFromPaste&&e.addTagsFromPaste(...a)),onInput:i[6]||(i[6]=(...a)=>e.updateNewTag&&e.updateNewTag(...a)),onFocus:i[7]||(i[7]=a=>e.focused=!0),onClick:i[8]||(i[8]=a=>e.addOnlyFromAutocomplete?!1:e.selectedItem=null)}),null,16,Y)])])):t.createCommentVNode("",!0)]),t.renderSlot(e.$slots,"between-elements",{},void 0,!0),e.autocompleteOpen?(t.openBlock(),t.createElementBlock("div",{key:0,class:t.normalizeClass(["ti-autocomplete",e.$attrs.class]),onMouseout:i[9]||(i[9]=a=>e.selectedItem=null)},[t.renderSlot(e.$slots,"autocomplete-header",{},void 0,!0),t.createElementVNode("ul",null,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.filteredAutocompleteItems,(a,u)=>(t.openBlock(),t.createElementBlock("li",{key:u,style:t.normalizeStyle(a.style),class:t.normalizeClass([[a.tiClasses,a.classes,{"ti-selected-item":e.isSelected(u)}],"ti-item"]),onMouseover:d=>e.disabled?!1:e.selectedItem=u},[e.$slots["autocomplete-item"]?t.renderSlot(e.$slots,"autocomplete-item",{key:1,item:a,index:u,performAdd:d=>e.performAddTags(d,void 0,"autocomplete"),selected:e.isSelected(u)},void 0,!0):(t.openBlock(),t.createElementBlock("div",{key:0,onClick:d=>e.performAddTags(a,void 0,"autocomplete")},t.toDisplayString(a.text),9,X))],46,Q))),128))]),t.renderSlot(e.$slots,"autocomplete-footer",{},void 0,!0)],34)):t.createCommentVNode("",!0)],6)}const x=g._export_sfc(I,[["render",Z],["__scopeId","data-v-d14eec25"]]);const _=t.createElementVNode("h5",{class:"mn-thin"},"Tags (maximum 20):",-1),ee={class:"mn-medium"},te=t.createElementVNode("p",{class:"p-small mn-thin"},"Suggested:",-1),ie=["onClick"],se={key:1},le={__name:"BlockTags",props:["tags"],emits:["tags-changed"],setup(e,{emit:i}){const s=e,n=t.ref(""),r=t.ref([]),o=t.ref([{text:"story"},{text:"news"},{text:"guide"},{text:"discussion"},{text:"photos"}]);s.tags&&(r.value=s.tags.map(h=>({text:h})));const l=t.computed(()=>o.value.filter(h=>h.text.toLowerCase().includes(n.value.toLowerCase()))),a=t.computed(()=>o.value.filter(h=>!r.value.some(p=>p.text===h.text)));function u(h){r.value.push(h),i("tags-changed",r.value.map(p=>p.text))}function d(h){r.value=h,i("tags-changed",r.value.map(p=>p.text))}return(h,p)=>(t.openBlock(),t.createElementBlock("div",null,[_,t.createVNode(x,{modelValue:n.value,"onUpdate:modelValue":p[0]||(p[0]=f=>n.value=f),tags:r.value,"autocomplete-items":t.unref(l),"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:d,class:"mn-thin bg-grey radius-medium pd-small"},null,8,["modelValue","tags","autocomplete-items"]),t.createElementVNode("p",ee,[te,t.unref(a).length>0?(t.openBlock(!0),t.createElementBlock(t.Fragment,{key:0},t.renderList(t.unref(a),(f,E)=>(t.openBlock(),t.createElementBlock("span",{onClick:Fe=>u(f),class:t.normalizeClass(["cursor-pointer ti-tag-toDefactor",{"mn-r-micro":E!==t.unref(a).length-1}])},t.toDisplayString(f.text),11,ie))),256)):(t.openBlock(),t.createElementBlock("span",se,"You added all suggested tags"))])]))}};const ne={class:"flex-v-center flex-nowrap flex"},re={key:0,class:"mn-r-auto t-transp mn-r-small"},ae=["name","value","checked"],oe={__name:"Checkbox",props:{label:String,name:String,value:String,radio:{type:[Array,Boolean,Object],default:()=>[]}},emits:["update:radio"],setup(e,{emit:i}){const s=e,n=r=>{if(Array.isArray(s.radio)){let o=[...s.radio];if(r.target.checked)o.push(s.value);else{const l=o.indexOf(s.value);l!==-1&&o.splice(l,1)}i("update:radio",o)}else typeof s.radio=="boolean"&&i("update:radio",r.target.checked)};return(r,o)=>(t.openBlock(),t.createElementBlock("label",ne,[e.label?(t.openBlock(),t.createElementBlock("div",re,[t.createElementVNode("span",null,t.toDisplayString(e.label),1)])):t.createCommentVNode("",!0),t.createElementVNode("input",{onChange:n,class:"round radiobutton",type:"checkbox",name:e.name,value:e.value,checked:Array.isArray(e.radio)?e.radio.includes(e.value):e.radio},null,40,ae),t.createElementVNode("div",{class:t.normalizeClass(["transition-elastic pd-thin h-2r w-4r radius-extra",{"bg-grey":!(Array.isArray(e.radio)?e.radio.includes(e.value):e.radio),"bg-main":Array.isArray(e.radio)?e.radio.includes(e.value):e.radio}])},[t.createElementVNode("div",{class:t.normalizeClass(["transition-linear w-1r h-1r radius-extra h-100 bg-white",{"mn-r-auto":!(Array.isArray(e.radio)?e.radio.includes(e.value):e.radio),"mn-l-auto":Array.isArray(e.radio)?e.radio.includes(e.value):e.radio}])},null,2)],2)]))}},ue=g._export_sfc(oe,[["__scopeId","data-v-f641f618"]]);function y(e){return e===0?!1:Array.isArray(e)&&e.length===0?!0:!e}function de(e){return(...i)=>!e(...i)}function he(e,i){return e===void 0&&(e="undefined"),e===null&&(e="null"),e===!1&&(e="false"),e.toString().toLowerCase().indexOf(i.trim())!==-1}function T(e,i,s,n){return i?e.filter(r=>he(n(r,s),i)).sort((r,o)=>n(r,s).length-n(o,s).length):e}function pe(e){return e.filter(i=>!i.$isLabel)}function v(e,i){return s=>s.reduce((n,r)=>r[e]&&r[e].length?(n.push({$groupLabel:r[i],$isLabel:!0}),n.concat(r[e])):n,[])}function ce(e,i,s,n,r){return o=>o.map(l=>{if(!l[s])return console.warn("Options passed to vue-multiselect do not contain groups, despite the config."),[];const a=T(l[s],e,i,r);return a.length?{[n]:l[n],[s]:a}:[]})}const S=(...e)=>i=>e.reduce((s,n)=>n(s),i),me={data(){return{search:"",isOpen:!1,preferredOpenDirection:"below",optimizedHeight:this.maxHeight}},props:{internalSearch:{type:Boolean,default:!0},options:{type:Array,required:!0},multiple:{type:Boolean,default:!1},trackBy:{type:String},label:{type:String},searchable:{type:Boolean,default:!0},clearOnSelect:{type:Boolean,default:!0},hideSelected:{type:Boolean,default:!1},placeholder:{type:String,default:"Select option"},allowEmpty:{type:Boolean,default:!0},resetAfter:{type:Boolean,default:!1},closeOnSelect:{type:Boolean,default:!0},customLabel:{type:Function,default(e,i){return y(e)?"":i?e[i]:e}},taggable:{type:Boolean,default:!1},tagPlaceholder:{type:String,default:"Press enter to create a tag"},tagPosition:{type:String,default:"top"},max:{type:[Number,Boolean],default:!1},id:{default:null},optionsLimit:{type:Number,default:1e3},groupValues:{type:String},groupLabel:{type:String},groupSelect:{type:Boolean,default:!1},blockKeys:{type:Array,default(){return[]}},preserveSearch:{type:Boolean,default:!1},preselectFirst:{type:Boolean,default:!1},preventAutofocus:{type:Boolean,default:!1}},mounted(){!this.multiple&&this.max&&console.warn("[Vue-Multiselect warn]: Max prop should not be used when prop Multiple equals false."),this.preselectFirst&&!this.internalValue.length&&this.options.length&&this.select(this.filteredOptions[0])},computed:{internalValue(){return this.modelValue||this.modelValue===0?Array.isArray(this.modelValue)?this.modelValue:[this.modelValue]:[]},filteredOptions(){const e=this.search||"",i=e.toLowerCase().trim();let s=this.options.concat();return this.internalSearch?s=this.groupValues?this.filterAndFlat(s,i,this.label):T(s,i,this.label,this.customLabel):s=this.groupValues?v(this.groupValues,this.groupLabel)(s):s,s=this.hideSelected?s.filter(de(this.isSelected)):s,this.taggable&&i.length&&!this.isExistingOption(i)&&(this.tagPosition==="bottom"?s.push({isTag:!0,label:e}):s.unshift({isTag:!0,label:e})),s.slice(0,this.optionsLimit)},valueKeys(){return this.trackBy?this.internalValue.map(e=>e[this.trackBy]):this.internalValue},optionKeys(){return(this.groupValues?this.flatAndStrip(this.options):this.options).map(i=>this.customLabel(i,this.label).toString().toLowerCase())},currentOptionLabel(){return this.multiple?this.searchable?"":this.placeholder:this.internalValue.length?this.getOptionLabel(this.internalValue[0]):this.searchable?"":this.placeholder}},watch:{internalValue:{handler(){this.resetAfter&&this.internalValue.length&&(this.search="",this.$emit("update:modelValue",this.multiple?[]:null))},deep:!0},search(){this.$emit("search-change",this.search)}},emits:["open","search-change","close","select","update:modelValue","remove","tag"],methods:{getValue(){return this.multiple?this.internalValue:this.internalValue.length===0?null:this.internalValue[0]},filterAndFlat(e,i,s){return S(ce(i,s,this.groupValues,this.groupLabel,this.customLabel),v(this.groupValues,this.groupLabel))(e)},flatAndStrip(e){return S(v(this.groupValues,this.groupLabel),pe)(e)},updateSearch(e){this.search=e},isExistingOption(e){return this.options?this.optionKeys.indexOf(e)>-1:!1},isSelected(e){const i=this.trackBy?e[this.trackBy]:e;return this.valueKeys.indexOf(i)>-1},isOptionDisabled(e){return!!e.$isDisabled},getOptionLabel(e){if(y(e))return"";if(e.isTag)return e.label;if(e.$isLabel)return e.$groupLabel;const i=this.customLabel(e,this.label);return y(i)?"":i},select(e,i){if(e.$isLabel&&this.groupSelect){this.selectGroup(e);return}if(!(this.blockKeys.indexOf(i)!==-1||this.disabled||e.$isDisabled||e.$isLabel)&&!(this.max&&this.multiple&&this.internalValue.length===this.max)&&!(i==="Tab"&&!this.pointerDirty)){if(e.isTag)this.$emit("tag",e.label,this.id),this.search="",this.closeOnSelect&&!this.multiple&&this.deactivate();else{if(this.isSelected(e)){i!=="Tab"&&this.removeElement(e);return}this.multiple?this.$emit("update:modelValue",this.internalValue.concat([e])):this.$emit("update:modelValue",e),this.$emit("select",e,this.id),this.clearOnSelect&&(this.search="")}this.closeOnSelect&&this.deactivate()}},selectGroup(e){const i=this.options.find(s=>s[this.groupLabel]===e.$groupLabel);if(i){if(this.wholeGroupSelected(i)){this.$emit("remove",i[this.groupValues],this.id);const s=this.internalValue.filter(n=>i[this.groupValues].indexOf(n)===-1);this.$emit("update:modelValue",s)}else{let s=i[this.groupValues].filter(n=>!(this.isOptionDisabled(n)||this.isSelected(n)));this.max&&s.splice(this.max-this.internalValue.length),this.$emit("select",s,this.id),this.$emit("update:modelValue",this.internalValue.concat(s))}this.closeOnSelect&&this.deactivate()}},wholeGroupSelected(e){return e[this.groupValues].every(i=>this.isSelected(i)||this.isOptionDisabled(i))},wholeGroupDisabled(e){return e[this.groupValues].every(this.isOptionDisabled)},removeElement(e,i=!0){if(this.disabled||e.$isDisabled)return;if(!this.allowEmpty&&this.internalValue.length<=1){this.deactivate();return}const s=typeof e=="object"?this.valueKeys.indexOf(e[this.trackBy]):this.valueKeys.indexOf(e);if(this.multiple){const n=this.internalValue.slice(0,s).concat(this.internalValue.slice(s+1));this.$emit("update:modelValue",n)}else this.$emit("update:modelValue",null);this.$emit("remove",e,this.id),this.closeOnSelect&&i&&this.deactivate()},removeLastElement(){this.blockKeys.indexOf("Delete")===-1&&this.search.length===0&&Array.isArray(this.internalValue)&&this.internalValue.length&&this.removeElement(this.internalValue[this.internalValue.length-1],!1)},activate(){this.isOpen||this.disabled||(this.adjustPosition(),this.groupValues&&this.pointer===0&&this.filteredOptions.length&&(this.pointer=1),this.isOpen=!0,this.searchable?(this.preserveSearch||(this.search=""),this.preventAutofocus||this.$nextTick(()=>this.$refs.search&&this.$refs.search.focus())):this.preventAutofocus||typeof this.$el<"u"&&this.$el.focus(),this.$emit("open",this.id))},deactivate(){this.isOpen&&(this.isOpen=!1,this.searchable?typeof this.$refs.search<"u"&&this.$refs.search.blur():typeof this.$el<"u"&&this.$el.blur(),this.preserveSearch||(this.search=""),this.$emit("close",this.getValue(),this.id))},toggle(){this.isOpen?this.deactivate():this.activate()},adjustPosition(){if(typeof window>"u")return;const e=this.$el.getBoundingClientRect().top,i=window.innerHeight-this.$el.getBoundingClientRect().bottom;i>this.maxHeight||i>e||this.openDirection==="below"||this.openDirection==="bottom"?(this.preferredOpenDirection="below",this.optimizedHeight=Math.min(i-40,this.maxHeight)):(this.preferredOpenDirection="above",this.optimizedHeight=Math.min(e-40,this.maxHeight))}}},fe={data(){return{pointer:0,pointerDirty:!1}},props:{showPointer:{type:Boolean,default:!0},optionHeight:{type:Number,default:40}},computed:{pointerPosition(){return this.pointer*this.optionHeight},visibleElements(){return this.optimizedHeight/this.optionHeight}},watch:{filteredOptions(){this.pointerAdjust()},isOpen(){this.pointerDirty=!1},pointer(){this.$refs.search&&this.$refs.search.setAttribute("aria-activedescendant",this.id+"-"+this.pointer.toString())}},methods:{optionHighlight(e,i){return{"multiselect__option--highlight":e===this.pointer&&this.showPointer,"multiselect__option--selected":this.isSelected(i)}},groupHighlight(e,i){if(!this.groupSelect)return["multiselect__option--disabled",{"multiselect__option--group":i.$isLabel}];const s=this.options.find(n=>n[this.groupLabel]===i.$groupLabel);return s&&!this.wholeGroupDisabled(s)?["multiselect__option--group",{"multiselect__option--highlight":e===this.pointer&&this.showPointer},{"multiselect__option--group-selected":this.wholeGroupSelected(s)}]:"multiselect__option--disabled"},addPointerElement({key:e}="Enter"){this.filteredOptions.length>0&&this.select(this.filteredOptions[this.pointer],e),this.pointerReset()},pointerForward(){this.pointer<this.filteredOptions.length-1&&(this.pointer++,this.$refs.list.scrollTop<=this.pointerPosition-(this.visibleElements-1)*this.optionHeight&&(this.$refs.list.scrollTop=this.pointerPosition-(this.visibleElements-1)*this.optionHeight),this.filteredOptions[this.pointer]&&this.filteredOptions[this.pointer].$isLabel&&!this.groupSelect&&this.pointerForward()),this.pointerDirty=!0},pointerBackward(){this.pointer>0?(this.pointer--,this.$refs.list.scrollTop>=this.pointerPosition&&(this.$refs.list.scrollTop=this.pointerPosition),this.filteredOptions[this.pointer]&&this.filteredOptions[this.pointer].$isLabel&&!this.groupSelect&&this.pointerBackward()):this.filteredOptions[this.pointer]&&this.filteredOptions[0].$isLabel&&!this.groupSelect&&this.pointerForward(),this.pointerDirty=!0},pointerReset(){this.closeOnSelect&&(this.pointer=0,this.$refs.list&&(this.$refs.list.scrollTop=0))},pointerAdjust(){this.pointer>=this.filteredOptions.length-1&&(this.pointer=this.filteredOptions.length?this.filteredOptions.length-1:0),this.filteredOptions.length>0&&this.filteredOptions[this.pointer].$isLabel&&!this.groupSelect&&this.pointerForward()},pointerSet(e){this.pointer=e,this.pointerDirty=!0}}};const ge={name:"vue-multiselect",mixins:[me,fe],compatConfig:{MODE:3,ATTR_ENUMERATED_COERCION:!1},props:{name:{type:String,default:""},modelValue:{type:null,default(){return[]}},selectLabel:{type:String,default:"Press enter to select"},selectGroupLabel:{type:String,default:"Press enter to select group"},selectedLabel:{type:String,default:"Selected"},deselectLabel:{type:String,default:"Press enter to remove"},deselectGroupLabel:{type:String,default:"Press enter to deselect group"},showLabels:{type:Boolean,default:!0},limit:{type:Number,default:99999},maxHeight:{type:Number,default:300},limitText:{type:Function,default:e=>`and ${e} more`},loading:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},openDirection:{type:String,default:""},showNoOptions:{type:Boolean,default:!0},showNoResults:{type:Boolean,default:!0},tabindex:{type:Number,default:0}},computed:{hasOptionGroup(){return this.groupValues&&this.groupLabel&&this.groupSelect},isSingleLabelVisible(){return(this.singleValue||this.singleValue===0)&&(!this.isOpen||!this.searchable)&&!this.visibleValues.length},isPlaceholderVisible(){return!this.internalValue.length&&(!this.searchable||!this.isOpen)},visibleValues(){return this.multiple?this.internalValue.slice(0,this.limit):[]},singleValue(){return this.internalValue[0]},deselectLabelText(){return this.showLabels?this.deselectLabel:""},deselectGroupLabelText(){return this.showLabels?this.deselectGroupLabel:""},selectLabelText(){return this.showLabels?this.selectLabel:""},selectGroupLabelText(){return this.showLabels?this.selectGroupLabel:""},selectedLabelText(){return this.showLabels?this.selectedLabel:""},inputStyle(){return this.searchable||this.multiple&&this.modelValue&&this.modelValue.length?this.isOpen?{width:"100%"}:{width:"0",position:"absolute",padding:"0"}:""},contentStyle(){return this.options.length?{display:"inline-block"}:{display:"block"}},isAbove(){return this.openDirection==="above"||this.openDirection==="top"?!0:this.openDirection==="below"||this.openDirection==="bottom"?!1:this.preferredOpenDirection==="above"},showSearchInput(){return this.searchable&&(this.hasSingleSelectedSlot&&(this.visibleSingleValue||this.visibleSingleValue===0)?this.isOpen:!0)}}},ye=["tabindex","aria-owns"],ve={ref:"tags",class:"multiselect__tags"},be={class:"multiselect__tags-wrap"},we=["textContent"],Se=["onKeypress","onMousedown"],ke=["textContent"],Te={class:"multiselect__spinner"},Ee=["name","id","placeholder","value","disabled","tabindex","aria-controls"],Ve=["id"],$e={key:0},Oe={class:"multiselect__option"},Be=["id","role"],Ce=["onClick","onMouseenter","data-select","data-selected","data-deselect"],De=["data-select","data-deselect","onMouseenter","onMousedown"],Le={class:"multiselect__option"},Ae={class:"multiselect__option"};function Ne(e,i,s,n,r,o){return t.openBlock(),t.createElementBlock("div",{tabindex:e.searchable?-1:s.tabindex,class:t.normalizeClass([{"multiselect--active":e.isOpen,"multiselect--disabled":s.disabled,"multiselect--above":o.isAbove,"multiselect--has-options-group":o.hasOptionGroup},"multiselect"]),onFocus:i[13]||(i[13]=l=>e.activate()),onBlur:i[14]||(i[14]=l=>e.searchable?!1:e.deactivate()),onKeydown:[i[15]||(i[15]=t.withKeys(t.withModifiers(l=>e.pointerForward(),["self","prevent"]),["down"])),i[16]||(i[16]=t.withKeys(t.withModifiers(l=>e.pointerBackward(),["self","prevent"]),["up"]))],onKeypress:i[17]||(i[17]=t.withKeys(t.withModifiers(l=>e.addPointerElement(l),["stop","self"]),["enter","tab"])),onKeyup:i[18]||(i[18]=t.withKeys(l=>e.deactivate(),["esc"])),role:"combobox","aria-owns":"listbox-"+e.id},[t.renderSlot(e.$slots,"caret",{toggle:e.toggle},()=>[t.createElementVNode("div",{onMousedown:i[0]||(i[0]=t.withModifiers(l=>e.toggle(),["prevent","stop"])),class:"multiselect__select"},null,32)]),t.renderSlot(e.$slots,"clear",{search:e.search}),t.createElementVNode("div",ve,[t.renderSlot(e.$slots,"selection",{search:e.search,remove:e.removeElement,values:o.visibleValues,isOpen:e.isOpen},()=>[t.withDirectives(t.createElementVNode("div",be,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(o.visibleValues,(l,a)=>t.renderSlot(e.$slots,"tag",{option:l,search:e.search,remove:e.removeElement},()=>[(t.openBlock(),t.createElementBlock("span",{class:"multiselect__tag",key:a},[t.createElementVNode("span",{textContent:t.toDisplayString(e.getOptionLabel(l))},null,8,we),t.createElementVNode("i",{tabindex:"1",onKeypress:t.withKeys(t.withModifiers(u=>e.removeElement(l),["prevent"]),["enter"]),onMousedown:t.withModifiers(u=>e.removeElement(l),["prevent"]),class:"multiselect__tag-icon"},null,40,Se)]))])),256))],512),[[t.vShow,o.visibleValues.length>0]]),e.internalValue&&e.internalValue.length>s.limit?t.renderSlot(e.$slots,"limit",{key:0},()=>[t.createElementVNode("strong",{class:"multiselect__strong",textContent:t.toDisplayString(s.limitText(e.internalValue.length-s.limit))},null,8,ke)]):t.createCommentVNode("",!0)]),t.createVNode(t.Transition,{name:"multiselect__loading"},{default:t.withCtx(()=>[t.renderSlot(e.$slots,"loading",{},()=>[t.withDirectives(t.createElementVNode("div",Te,null,512),[[t.vShow,s.loading]])])]),_:3}),e.searchable?(t.openBlock(),t.createElementBlock("input",{key:0,ref:"search",name:s.name,id:e.id,type:"text",autocomplete:"off",spellcheck:"false",placeholder:e.placeholder,style:t.normalizeStyle(o.inputStyle),value:e.search,disabled:s.disabled,tabindex:s.tabindex,onInput:i[1]||(i[1]=l=>e.updateSearch(l.target.value)),onFocus:i[2]||(i[2]=t.withModifiers(l=>e.activate(),["prevent"])),onBlur:i[3]||(i[3]=t.withModifiers(l=>e.deactivate(),["prevent"])),onKeyup:i[4]||(i[4]=t.withKeys(l=>e.deactivate(),["esc"])),onKeydown:[i[5]||(i[5]=t.withKeys(t.withModifiers(l=>e.pointerForward(),["prevent"]),["down"])),i[6]||(i[6]=t.withKeys(t.withModifiers(l=>e.pointerBackward(),["prevent"]),["up"])),i[8]||(i[8]=t.withKeys(t.withModifiers(l=>e.removeLastElement(),["stop"]),["delete"]))],onKeypress:i[7]||(i[7]=t.withKeys(t.withModifiers(l=>e.addPointerElement(l),["prevent","stop","self"]),["enter"])),class:"multiselect__input","aria-controls":"listbox-"+e.id},null,44,Ee)):t.createCommentVNode("",!0),o.isSingleLabelVisible?(t.openBlock(),t.createElementBlock("span",{key:1,class:"multiselect__single",onMousedown:i[9]||(i[9]=t.withModifiers((...l)=>e.toggle&&e.toggle(...l),["prevent"]))},[t.renderSlot(e.$slots,"singleLabel",{option:o.singleValue},()=>[t.createTextVNode(t.toDisplayString(e.currentOptionLabel),1)])],32)):t.createCommentVNode("",!0),o.isPlaceholderVisible?(t.openBlock(),t.createElementBlock("span",{key:2,class:"multiselect__placeholder",onMousedown:i[10]||(i[10]=t.withModifiers((...l)=>e.toggle&&e.toggle(...l),["prevent"]))},[t.renderSlot(e.$slots,"placeholder",{},()=>[t.createTextVNode(t.toDisplayString(e.placeholder),1)])],32)):t.createCommentVNode("",!0)],512),t.createVNode(t.Transition,{name:"multiselect"},{default:t.withCtx(()=>[t.withDirectives(t.createElementVNode("div",{class:t.normalizeClass(["multiselect__content-wrapper",e.$attrs.class]),onFocus:i[11]||(i[11]=(...l)=>e.activate&&e.activate(...l)),tabindex:"-1",onMousedown:i[12]||(i[12]=t.withModifiers(()=>{},["prevent"])),style:t.normalizeStyle({maxHeight:e.optimizedHeight+"px"}),ref:"list"},[t.createElementVNode("ul",{class:"multiselect__content",style:t.normalizeStyle(o.contentStyle),role:"listbox",id:"listbox-"+e.id},[t.renderSlot(e.$slots,"beforeList"),e.multiple&&e.max===e.internalValue.length?(t.openBlock(),t.createElementBlock("li",$e,[t.createElementVNode("span",Oe,[t.renderSlot(e.$slots,"maxElements",{},()=>[t.createTextVNode("Maximum of "+t.toDisplayString(e.max)+" options selected. First remove a selected option to select another.",1)])])])):t.createCommentVNode("",!0),!e.max||e.internalValue.length<e.max?(t.openBlock(!0),t.createElementBlock(t.Fragment,{key:1},t.renderList(e.filteredOptions,(l,a)=>(t.openBlock(),t.createElementBlock("li",{class:"multiselect__element",key:a,id:e.id+"-"+a,role:l&&(l.$isLabel||l.$isDisabled)?null:"option"},[l&&(l.$isLabel||l.$isDisabled)?t.createCommentVNode("",!0):(t.openBlock(),t.createElementBlock("span",{key:0,class:t.normalizeClass([e.optionHighlight(a,l),"multiselect__option"]),onClick:t.withModifiers(u=>e.select(l),["stop"]),onMouseenter:t.withModifiers(u=>e.pointerSet(a),["self"]),"data-select":l&&l.isTag?e.tagPlaceholder:o.selectLabelText,"data-selected":o.selectedLabelText,"data-deselect":o.deselectLabelText},[t.renderSlot(e.$slots,"option",{option:l,search:e.search,index:a},()=>[t.createElementVNode("span",null,t.toDisplayString(e.getOptionLabel(l)),1)])],42,Ce)),l&&(l.$isLabel||l.$isDisabled)?(t.openBlock(),t.createElementBlock("span",{key:1,"data-select":e.groupSelect&&o.selectGroupLabelText,"data-deselect":e.groupSelect&&o.deselectGroupLabelText,class:t.normalizeClass([e.groupHighlight(a,l),"multiselect__option"]),onMouseenter:t.withModifiers(u=>e.groupSelect&&e.pointerSet(a),["self"]),onMousedown:t.withModifiers(u=>e.selectGroup(l),["prevent"])},[t.renderSlot(e.$slots,"option",{option:l,search:e.search,index:a},()=>[t.createElementVNode("span",null,t.toDisplayString(e.getOptionLabel(l)),1)])],42,De)):t.createCommentVNode("",!0)],8,Be))),128)):t.createCommentVNode("",!0),t.withDirectives(t.createElementVNode("li",null,[t.createElementVNode("span",Le,[t.renderSlot(e.$slots,"noResult",{search:e.search},()=>[t.createTextVNode("No elements found. Consider changing the search query.")])])],512),[[t.vShow,s.showNoResults&&e.filteredOptions.length===0&&e.search&&!s.loading]]),t.withDirectives(t.createElementVNode("li",null,[t.createElementVNode("span",Ae,[t.renderSlot(e.$slots,"noOptions",{},()=>[t.createTextVNode("List is empty.")])])],512),[[t.vShow,s.showNoOptions&&(e.options.length===0||o.hasOptionGroup===!0&&e.filteredOptions.length===0)&&!e.search&&!s.loading]]),t.renderSlot(e.$slots,"afterList")],12,Ve)],38),[[t.vShow,e.isOpen]])]),_:3})],42,ye)}const Me=g._export_sfc(ge,[["render",Ne]]);exports.Checkbox=ue;exports.SelectMulti=Me;exports._sfc_main=le;
|