1import{u as V,d as m,y as A,M as b,e as n,a as s,t as a,l as g,C as f,h as i,b as B,w as F,x as q,F as x,i as y,f as D,G as L,o as c,p as w,g as C}from"./app.1c75f29f.js";const S={class:"grid grid-cols-12 min-h-screen gap-5 px-10 justify-center"},T={class:"col-span-8 col-start-3 flex items-center w-full"},U={class:"bg-white py-7 px-8 border border-gray-30 rounded-lg w-full"},z={class:"flex items-center justify-between pb-4 border-b border-gray-30"},E={class:"text-18-medium text-gray-90"},G={class:"mt-8"},H={class:"text-14-regular text-gray-60"},I={class:"error"},J={class:"mt-8"},K={class:"flex justify-between items-center"},O={class:"text-14-regular text-gray-60"},P=["onClick"],Q=["onClick"],W=["placeholder"],X={class:"error"},Y={key:0,class:"relative z-10"},Z={class:"border bg-white border-gray-30 rounded-lg overflow-auto absolute w-full max-h-48 px-5"},ee=["onClick"],te=["src"],se={class:"text-sm"},oe=s("br",null,null,-1),le={class:"text-sm text-gray-60"},ae={class:"flex gap-2 flex-wrap mt-5"},re=["onClick"],ne={class:"border-t border-gray-30 mt-8 pt-8 flex items-center justify-end gap-3"},ue={__name:"Create",emits:["close"],setup(ie,{emit:k}){const p=V({name:"",members:[]}),d=m(null),r=m(null),o=m([]);m(!1);const R=t=>{o.value.filter(e=>e.id===t.id).length===0&&o.value.push(t),d.value="",r.value=[]},$=t=>{o.value=o.value.filter(e=>e.id!==t.id)},M=()=>{p.transform(t=>({...t,members:o.value.map(e=>e.id)})).post(route("discussion-boards.store"),{onSuccess:()=>{k("close")}})};A(d,_.debounce(t=>{if(t.length<2){r.value=null;return}let e="/discussion-boards/member/search?term="+t;o.value&&o.value.length>0&&(e+="&exclude="+o.value.map(u=>u.id)),b.get(e).then(u=>{r.value=u.data.users})},500));const j=()=>{let t="discussion-boards/members/get/all";o.value&&o.value.length>0&&(t+="?exclude="+o.value.map(e=>e.id)),b.get(t).then(e=>{e.data.members&&e.data.members.length>0?r.value=e.data.members:alert("No other members to invite!")}).catch(e=>{console.log(e)})},N=()=>{let t="discussion-boards/members/get/all";o.value&&o.value.length>0&&(t+="?exclude="+o.value.map(e=>e.id)),b.get(t).then(e=>{e.data.members&&e.data.members.length>0?o.value=e.data.members:alert("No other members to invite!")}).catch(e=>{console.log(e)})};return(t,e)=>{var v;const u=L("flex");return c(),n("div",S,[s("div",T,[s("div",U,[s("div",z,[s("div",E,a(t.__("chatRoom.create.new_chat")),1),s("i",{class:"icon-close-square text-xl cursor-pointer",onClick:e[0]||(e[0]=l=>t.$emit("close"))})]),s("div",G,[s("div",H,a(t.__("chatRoom.create.group_name")),1),g(s("input",{type:"text",class:"input w-full mt-3","onUpdate:modelValue":e[1]||(e[1]=l=>i(p).name=l)},null,512),[[f,i(p).name]]),s("p",I,a(t.$page.props.errors.name),1)]),s("div",J,[s("section",K,[s("div",O,a(t.__("chatRoom.invite_people")),1),B(u,{class:"flex justify-end items-center gap-2"},{default:F(()=>[s("button",{class:"btn btn-secondary p-2",onClick:w(j,["prevent"])},a(t.__("chatRoom.invite_member.view_all_members")),9,P),s("button",{class:"btn btn-secondary p-2",onClick:w(N,["prevent"])},a(t.__("chatRoom.invite_member.add_all_members")),9,Q)]),_:1})]),g(s("input",{"onUpdate:modelValue":e[2]||(e[2]=l=>q(d)?d.value=l:null),type:"text",class:"input w-full mt-3",placeholder:t.__("chatRoom.create.search_name_or_email")},null,8,W),[[f,i(d)]]),s("p",X,a(t.$page.props.errors.members),1)]),((v=i(r))==null?void 0:v.length)>0?(c(),n("div",Y,[s("div",Z,[(c(!0),n(x,null,y(i(r),(l,h)=>(c(),n("div",{class:"py-4 cursor-pointer rounded-sm flex items-center gap-2 border-b border-gray-30 last:border-0",key:h,onClick:ce=>R(l)},[s("img",{src:l.profile_photo_url,class:"h-9 w-9 rounded-full object-cover",alt:""},null,8,te),s("div",null,[s("span",se,a(l.full_name),1),C(),oe,s("span",le,a(l.email),1)])],8,ee))),128))])])):D("",!0),s("div",ae,[(c(!0),n(x,null,y(i(o),l=>(c(),n("div",{key:l.id,class:"bg-indigo-10 rounded py-2 px-2.5 text-14-regular"},[C(a(l.full_name)+" ",1),s("i",{class:"icon-close-square text-sm cursor-pointer",onClick:h=>$(l)},null,8,re)]))),128))]),s("div",ne,[s("button",{class:"btn btn-secondary",onClick:e[3]||(e[3]=l=>t.$emit("close"))},a(t.__("chatRoom.create.cancel")),1),s("button",{class:"btn btn-primary",onClick:e[4]||(e[4]=l=>M())},a(t.__("chatRoom.create.create")),1)])])])])}}};export{ue as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.