PageSourceSearch

https://assets.devpost.team/build/InviteCoworkersForm-B3zXY7h2.js

js devpost.team collected 2026-09-24 12:55:36 UTC 5,158 bytes, 1 lines download raw bytes

1import{z as B,ax as O,a3 as F,B as V,p as E,i as U,a5 as D,I as $,a6 as W,a7 as G,H as J,o as g,a8 as C,g as s,K as d,j as o,f as N,w as f,a9 as K,aa as L,M as T,k as u,ab as Q,ac as P,ad as X,ae as Y,A as q,X as z,Y as H,a as Z,a1 as ee,bF as ae,c as te,bG as se,U as ne,l as ie,bH as oe}from"./application-DqOcU3py.js";import"./quill-DOA7X4PN.js";const le={sendInvites({hackathonId:n,new_users_emails:r,existing_users:t}){return B(Routes.send_invites_api_organization_hackathon_invites_path(O({hackathon_id:n})),{invite:{new_users_emails:r,existing_users:t}})}},M=F("inviteCoworkersToHackathonStore",le),re=n=>(z("data-v-25a0e2b9"),n=n(),H(),n),ce={class:"field mb-0"},de=re(()=>s("label",{class:"label has-text-weight-medium",for:"emails_to_invite"}," Names or email addresses * ",-1)),ue={class:"is-block mb-4 is-size-7"},me={key:0,class:"multiselect-option"},ve={class:"columns is-gapless py-1 is-mobile"},he={class:"avatar-wrapper column is-2 is-flex is-align-items-center is-justify-content-center"},_e=["src"],pe={class:"column is-10 is-size-7"},ge={class:"full-name column is-12 py-0"},fe={class:"mr-2"},be={class:"column is-12 py-0 text-ellipsis has-text-grey-dark"},Se={__name:"InviteToHackathonViaEmailSelect",props:{labelSubText:{type:String,default:"We'll send invitations via email"},hackathonId:{type:Number,required:!0}},setup(n){const r=n,t=M(),m=E(null),S=U("currentUserId"),l=E([]),{isEmailAddressValid:c,addEmailAddressOption:v,addEmailAddressTagsOnPaste:k,invitationsSentMessageType:I,invitationsSentMessage:x,updateValidationState:h,isErrorMessageLong:w}=D(t,m);$(async()=>{await W(t),t.resetInvitationResult()});const j=async i=>{if(!i||i.length<2)return[];try{const e={organization_slug:q(),exclude_user_ids:[S],include_guests:!0,not_registered_hackathon_ids:[r.hackathonId],q:i},a=Routes.api_organization_search_users_path(e);return(await(await fetch(a)).json()).users.map(p=>({value:p.id,label:p.email,fullName:p.full_name,avatarUrl:p.avatar_url}))}catch(e){return console.error("Error searching users:",e),[]}},R=i=>v(i),A=i=>{k(i,()=>l.value.map(e=>e.value),e=>{l.value=[...l.value,...e]})};let y=!1;return G(()=>{if(y)return;const i=l.value.map(e=>typeof e=="object"?e.value:e);t.setEmailsToInvite(i)}),J(()=>t.emailsToInvite,(i,e)=>{e&&i.length<e.length&&(y=!0,l.value=l.value.filter(a=>{const _=typeof a=="object"?a.value:a;return i.includes(_)}),y=!1)},{deep:!0}),(i,e)=>(g(),C("div",ce,[de,s("span",ue,d(n.labelSubText),1),o(t).invitationResult?(g(),N(L,{key:0,class:"mb-4","message-type":o(I)},{default:f(()=>[K(d(o(x)),1)]),_:1},8,["message-type"])):T("",!0),u(o(X),{id:"emails_to_invite",ref_key:"multiSelectTemplateRef",ref:m,modelValue:l.value,"onUpdate:modelValue":e[0]||(e[0]=a=>l.value=a),mode:"tags",searchable:!0,"filter-results":!1,"resolve-on-load":!1,delay:300,options:j,"create-option":!0,placeholder:"Search by name or email","data-testid":"invite-to-hackathon-email-input","clear-on-blur":!1,object:!0,onSearchChange:o(h),onPaste:P(A,["prevent"]),onCreate:R},{tag:f(({option:a,handleTagRemove:_})=>[u(Q,{invalid:!o(c)(a.value),label:a.label,value:String(a.value),"handle-tag-remove":_,"default-tag-color":"primary"},null,8,["invalid","label","value","handle-tag-remove"])]),option:f(({option:a})=>[a.fullName&&a.avatarUrl?(g(),C("div",me,[s("div",ve,[s("div",he,[s("img",{src:a.avatarUrl,class:"avatar is-small"},null,8,_e)]),s("div",pe,[s("div",ge,[s("span",fe,d(a.fullName),1)]),s("div",be,d(a.label),1)])])])):T("",!0)]),_:1},8,["modelValue","onSearchChange","onPaste"]),u(Y,{"has-validation-errors":o(t).hasValidationErrors,"email-validation-errors":o(t).emailValidationErrors,"is-error-message-long":o(w),onClearErrors:e[1]||(e[1]=a=>o(t).resetValidationErrors())},null,8,["has-validation-errors","email-validation-errors","is-error-message-long"])]))}},ke=V(Se,[["__scopeId","data-v-25a0e2b9"]]),b=n=>(z("data-v-54b49591"),n=n(),H(),n),Ie=b(()=>s("h2",{class:"title is-2 mb-6"},"Invite participants",-1)),ye=b(()=>s("label",{class:"is-block has-text-weight-bold mb-4 email-invitation-label"}," Send an email invitation ",-1)),xe=b(()=>s("hr",{class:"mb-6 mt-6"},null,-1)),we=b(()=>s("label",{class:"label"},"Or share a link",-1)),Ee={class:"ml-3"},Ce={__name:"InviteCoworkersForm",setup(n){const{closeSidePanel:r}=Z(),t=M(),m=ee(),S=ae(),l=te(()=>m.title||"this hackathon"),c=parseInt(U("hackathonId"),10),{copyInviteUsersToHackathonUrl:v}=se({organizationUid:S.uid,hackathonId:c});$(()=>{t.resetInvitationResult()});const k=async()=>
1{t.validEmailsToInvite.length!==0&&await t.sendInvites({hackathonId:c})},I=()=>r(oe);return(x,h)=>(g(),N(ie,{"on-save":k,"on-cancel":I,"save-button-text":"Send invites","cancel-button-text":"Close"},{default:f(()=>[Ie,ye,u(ke,{"label-sub-text":`We'll send email invitations to register for ${l.value}`,"hackathon-id":o(c)},null,8,["label-sub-text","hackathon-id"]),xe,we,s("a",{id:"copy-invite-link",href:"#",class:"is-flex is-align-items-center",onClick:h[0]||(h[0]=P(w=>o(v).action(),["prevent"]))},[u(ne,{"is-small":"",icon:"link",class:"has-text-primary"}),s("span",Ee,d(o(v).name),1)])]),_:1}))}},$e=V(Ce,[["__scopeId","data-v-54b49591"]]);export{$e 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.