1"use strict";(self["webpackChunktjing"]=self["webpackChunktjing"]||[]).push([[3646],{76038:function(e,t,s){s.d(t,{A:function(){return d}});var a=function(){var e=this,t=e._self._c;return t("svg",{attrs:{xmlns:"http://www.w3.org/2000/svg",width:"15",height:"10",viewBox:"0 0 15 10"}},[t("g",{attrs:{id:"Comments_icon_mobile_","data-name":"Comments icon (mobile)",transform:"translate(0.5 0.5)"}},[t("line",{attrs:{id:"Line_367","data-name":"Line 367",x2:"6",transform:"translate(5.001 3)",fill:"none",stroke:"#7d8296","stroke-width":"1"}}),t("line",{attrs:{id:"Line_368","data-name":"Line 368",x2:"4",transform:"translate(5.001 6)",fill:"none",stroke:"#7d8296","stroke-width":"1"}}),t("path",{attrs:{id:"Union_5","data-name":"Union 5",d:"M3.789,9a1,1,0,0,1-1-1V2.667L.788,0h13a1,1,0,0,1,1,1V8a1,1,0,0,1-1,1Z",transform:"translate(-0.788)",fill:"none",stroke:"#7d8296","stroke-linejoin":"round","stroke-width":"1"}}),t("path",{attrs:{id:"Path_1992","data-name":"Path 1992",d:"M0,0",transform:"translate(8.698 6.311) rotate(-90)",fill:"none",stroke:"#7d8296","stroke-width":"1"}})])])},n=[],r={name:"Comments"},i=r,o=s(81656),l=(0,o.A)(i,a,n,!1,null,"31f1cd66",null),d=l.exports},60894:function(e,t,s){s.d(t,{A:function(){return f}});var a=function(){var e=this,t=e._self._c;return t("div",{staticClass:"comment-field-container"},[null!==e.messageReply&&e.messageReply.eventMessageId==e.eventMessage.id?t("div",{staticClass:"reply-to"},[t("p",[t("b",[e._v("Replying to "+e._s(e.messageReply.createdBy.firstName))])]),t("p",{staticClass:"cancel",on:{click:function(t){return e.cancelReply()}}},[e._v("Cancel")])]):e._e(),t("UserProfileAvatar",{attrs:{profileImageUrl:this.userInfo.sessionInfo.profileImageUrl,backgroundColor:e.avatarBackgroundColor,initials:this.userInfo.firstName.charAt(0)+this.userInfo.lastName.charAt(0)}}),t("div",{staticClass:"comment-box"},[t("p",{ref:e.eventMessage.id+"commentbox",staticClass:"editor",attrs:{placeholder:e.showPlaceholder?e.messageReply?"Write a reply":"Write a comment":"",id:e.eventMessage.id+"commentfield",contenteditable:"true"},on:{blur:function(t){return e.commentValidation()},input:function(t){return e.updateComment(t)},keydown:function(t){if(!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter"))return null;t.preventDefault()}}})]),t("span",{staticClass:"send-icon",on:{click:function(t){return e.sendMessage()}}},[t("Send",{attrs:{enabled:e.comment.length>=2}})],1)],1)},n=[],r=function(){var e=this,t=e._self._c;return t("svg",{class:{enabled:e.enabled},attrs:{id:"Component_80_2","data-name":"Component 80 â 2",xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32",viewBox:"0 0 32 32"}},[t("circle",{attrs:{id:"Ellipse_266","data-name":"Ellipse 266",cx:"16",cy:"16",r:"16",fill:"#fafafa"}}),t("path",{attrs:{id:"Path_2112","data-name":"Path 2112",d:"M15.528,7.147,1.447.107A1,1,0,0,0,0,1V6.2L9,7.55v1L0,9.9v5.182a1,1,0,0,0,1.447.894l14.081-7.04a1,1,0,0,0,0-1.789",transform:"translate(8.959 7.958)",fill:"#d2d7dc"}})])},i=[],o={props:["enabled"],name:"Send"},l=o,d=s(81656),c=(0,d.A)(l,r,i,!1,null,"709bde2c",null),m=c.exports,u=s(36498),p={name:"CommentField",props:["placeholder","eventMessage","messageReply","messageReplyId","avatarBackgroundColor"],components:{Send:m,UserProfileAvatar:u.A},data(){return{showPlaceholder:!0,comment:"",placeHolderOverride:null}},watch:{messageReplyId:function(e,t){null!==e&&this.$nextTick((()=>{this.placeHolderOverride=`Reply to ${this.messageReply.createdBy.firstName}`,e===this.messageReply.id&&document.getElementById(this.messageReply.eventMessageId+"commentfield").focus()}))}},computed:{userInfo(){return this.$store.getters.userInfo}},methods:{cancelReply(){this.resetCommentField(),this.$emit("cancelReply")},sendMessage(){this.comment.length>=2&&(null!==this.messageReplyId?this.$emit("sendNestedMessage",this.comment):this.$emit("sendMessage",this.comment),this.resetCommentField(),this.$emit("cancelReply"))},updateComment(e){this.showPlaceholder=!1,this.$nextTick((()=>{this.comment=e.target.innerText}))},resetCommentField(){this.comment="",this.$refs[this.eventMessage.id+"commentbox"].innerText=this.comment,this.showPlaceholder=!0},commentValidation(){""===this.comment&&(this.showPlaceholder=!0)}},mounted(){},beforeCreate(){},destroyed(){}},h=p,g=(0,d.A)(h,a,n,!1,null,"2999b2ac",null),f=g.exports},53646:function(e,t,s){s.r(t),s.d(t,{default:function(){return y}});var a=function(){var e=this,t=e._self._c;return e.loaded?t("div",{staticClass:"event-messages"},[0==e.eventMessages.length?t("div",{staticClass:"no-messages"},[t("h4",[e._v("No messages yet")]),t("p",{staticClass:"large"},[e._v(" Messages sent by the Tournament Director will be listed here. Players using Tjing for iOS or Android will recieve a push notification when a message is posted. ")])]):e._l(e.eventMessages,(function(s){return[t("div",{staticClass:"event-message"},[t("div",{staticClass:"message-header"},[t("p",[t("b",[e._v(e._s(s.subject))])]),e.isUserLoggedIn&&e.userRegisteredToThisEvent&&!s.userReadReceipt?t("div",{staticClass:"read-marker"}):e._e()]),t("div",{staticClass:"time-audience"},[t("p",{staticClass:"since-posted"},[e._v(e._s(e.timeSince(s.createdAt)))]),"WAITING"==s.audience?[t("p",{staticClass:"round-separator"}),t("p",{staticClass:"target-audience"},[e._v("For waiting players")])]:e._e(),"ACCEPTED"==s.audience?[t("p",{staticClass:"round-separator"}),t("p",{staticClass:"target-audience"},[e._v("For confirmed players")])]:e._e()],2),t("vue-markdown",{staticClass:"message-body",attrs:{source:s.message}}),t("div",{staticClass:"message-info",class:{"extra-padding":!e.isUserLoggedIn}},[t("Comments"),t("p",{staticClass:"message-comments-count"},[e._v(" "+e._s(s.repliesCount)+" "+e._s(e.singularPlural("comment",1==s.repliesCount))+" ")]),e.isUserLoggedIn&&e.userRegisteredToThisEvent?[s.userReadReceipt?t("p",{staticClass:"mark-as-read",on:{click:function(t){return e.unMarkAsRead(s)}}},[e._v(" Mark as unread ")]):t("p",{staticClass:"mark-as-read",on:{click:function(t){return e.markAsRead(s)}}},[e._v(" Mark as read ")])]:e._e()],2),t("div",{staticClass:"message-comments"},e._l(s.replies,(function(s){return t("div",{staticClass:"comment"},[t("UserProfileAvatar",{attrs:{profileImageUrl:s.createdBy.profile.profileImageUrl,backgroundColor:e.adminUserIds.includes(s.createdBy.id)?"ocean":"twilight",initials:s.createdBy.firstName.charAt(0)+s.createdBy.lastName.charAt(0)}}),t("div",{staticClass:"comment-body"},[t("p",{staticClass:"author"},[t("b",[e._v(e._s(s.createdBy.firstName)+" "+e._s(s.createdBy.lastName))]),e.adminUserIds.includes(s.createdBy.id)?t("span",{staticClass:"admin-suffix"}
1,[e._v(" (admin)")]):e._e()]),s.isDeleted?t("p",{staticClass:"comment-message deleted"},[e._v(" This comment has been removed. ")]):t("p",{staticClass:"comment-message"},[e._v(e._s(s.message))])]),t("div",{staticClass:"comment-footer"},[t("div",{staticClass:"time-wrapper"},[t("TjingToolTip",{attrs:{text:e.formattedDate(s.createdAt),hideOnDesktop:!1,bottomOffset:24}},[t("p",{staticClass:"time"},[e._v(e._s(e.timeSince(s.createdAt)))])]),s.isDeleted?e._e():[t("p",{staticClass:"round-separator"}),t("p",{staticClass:"reply",on:{click:function(t){e.commentToReplyTo=s}}},[e._v("Reply")])]],2),s.isDeleted?e._e():[s.repliesCount>s.replies.length&&!1===s.showReplies?t("div",{staticClass:"show-more",on:{click:function(t){return e.loadReplies(s)}}},[t("p",[t("b",[e._v("Show replies")]),e._v(" ("+e._s(s.repliesCount-s.replies.length)+") ")])]):s.repliesCount>0&&!1===s.showReplies?t("div",{staticClass:"show-more",on:{click:function(e){s.showReplies=!0}}},[t("p",[t("b",[e._v("Show replies")]),e._v(" ("+e._s(s.repliesCount)+")")])]):e._e(),s.replies.length>0&&!0===s.showReplies?t("div",{staticClass:"show-more",on:{click:function(e){s.showReplies=!1}}},[e._m(0,!0)]):e._e()]],2),s.showReplies&&!s.isDeleted?t("div",{staticClass:"sub-replies"},e._l(s.replies,(function(a){return t("div",{staticClass:"sub-reply"},[t("UserProfileAvatar",{attrs:{profileImageUrl:a.createdBy.profile.profileImageUrl,backgroundColor:e.adminUserIds.includes(a.createdBy.id)?"ocean":"twilight",initials:a.createdBy.firstName.charAt(0)+a.createdBy.lastName.charAt(0)}}),t("div",{staticClass:"sub-reply-body"},[t("p",{staticClass:"author"},[t("b",[e._v(e._s(a.createdBy.firstName)+" "+e._s(a.createdBy.lastName))]),e.adminUserIds.includes(s.createdBy.id)?t("span",{staticClass:"admin-suffix"},[e._v(" (admin)")]):e._e()]),a.isDeleted?t("p",{staticClass:"message deleted"},[e._v(" This reply has been removed. ")]):t("p",{staticClass:"message"},[e._v(e._s(a.message))])]),t("div",{staticClass:"sub-reply-footer"},[t("div",{staticClass:"time-wrapper"},[t("p",[e._v(e._s(e.timeSince(a.createdAt)))])])])],1)})),0):e._e(),s.repliesCount>s.replies.length&&!0===s.showReplies?t("div",{staticClass:"show-more base-padding",on:{click:function(t){return e.loadReplies(s)}}},[t("p",[t("b",[e._v("Show more replies")]),e._v(" ("+e._s(s.repliesCount-s.replies.length)+") ")])]):e._e()],1)})),0),s.replies.length<s.repliesCount?t("div",{staticClass:"load-more-comments",class:{space:!e.isUserLoggedIn},on:{click:function(t){return e.loadComments(s)}}},[e._m(1,!0)]):e._e(),e.isUserLoggedIn?t("div",{staticClass:"comment-section"},[t("CommentField",{attrs:{placeholder:"Write a comment",eventMessage:s,messageReply:e.commentToReplyTo,messageReplyId:e.commentToReplyTo?e.commentToReplyTo.id:null,avatarBackgroundColor:e.adminUserIds.includes(e.loggedInUserId)?"ocean":"twilight"},on:{cancelReply:function(t){e.commentToReplyTo=null},sendMessage:function(t){return e.createComment(s,t)},sendNestedMessage:function(t){return e.createNestedReply(s.id,e.commentToReplyTo,t)}}})],1):e._e()],1)]}))],2):e._e()},n=[function(){var e=this,t=e._self._c;return t("p",[t("b",[e._v("Hide replies")])])},function(){var e=this,t=e._self._c;return t("p",{staticClass:"small"},[t("b",[e._v("Show more comments")])])}],r=s(95093),i=s.n(r),o=s(59181),l=s.n(o),d=s(76038),c=s(60894),m=s(36498),u=s(49834),p=s(24077),h={components:{VueMarkdown:l(),Comments:d.A,CommentField:c.A,UserProfileAvatar:m.A},mixins:[u.A,p.A],name:"PublicEventMessages",data(){return{eventMessages:null,commentToReplyTo:null,adminUserIds:[],loaded:!1}},computed:{userRegisteredToThisEvent(){for(var e=0;e<this.$store.getters.registrations.length;e++)if(this.$store.getters.registrations[e].event.id==this.$router.currentRoute.params.eventId&&("ACCEPTED"==this.$store.getters.registrations[e].status||"PENDING"==this.$store.getters.registrations[e].status))return this.$store.getters.registrations[e];return null},isUserLoggedIn(){return this.$store.getters.isUserLoggedIn},loggedInUserId(){return this.$store.getters.userInfo.sessionInfo.userId}},methods:{async createNestedReply(e,t,s){try{await this.$axios({headers:{Authorization:this.$store.state.user.sessionInfo.token},data:{query:`\n mutation CreateEventMessageReply($message: String!){\n CreateEventMessageReply(\n eventMessageId:"${e}",\n parentMessageId: "${t.id}",\n message: $message){\n id\n }\n }\n `,variables:{message:s}}});this.loadReplies(t)}catch(a){this.$store.dispatch("showMessage",{show:!0,message:"Something went wrong",type:"error"})}},async createComment(e,t){try{await this.$axios({headers:{Authorization:this.$store.state.user.sessionInfo.token},data:{query:`\n mutation CreateEventMessageReply($message: String!){\n CreateEventMessageReply(\n eventMessageId:"${e.
1id}",\n message: $message){\n id\n }\n }\n `,variables:{message:t}}});this.loadData()}catch(s){this.$store.dispatch("showMessage",{show:!0,message:"Something went wrong",type:"error"})}},async loadComments(e){const t=e.replies?e.replies.length:0,s=10;try{const a=await this.$axios({headers:{Authorization:this.$store.state.user.sessionInfo.token},data:{query:`\n {\n eventMessageComments(eventMessageId:"${e.id}", first: ${s}, skip: ${t}) {\n id\n eventMessageId\n message\n isDeleted\n createdAt\n createdBy {\n id\n firstName\n lastName\n profile{\n profileImageUrl\n }\n }\n updatedAt\n updatedBy {\n id\n }\n repliesCount\n replies{\n id\n message\n isDeleted\n createdAt\n updatedAt\n createdBy{\n id\n firstName\n lastName\n profile{\n profileImageUrl\n }\n }\n }\n }\n }\n `}});e.replies=[...e.replies,...a.data.data.eventMessageComments]}catch(a){this.$store.dispatch("showMessage",{show:!0,message:"Something went wrong",type:"error"})}},async loadReplies(e){const t=e.replies?e.replies.length:0,s=10;try{const a=await this.$axios({headers:{Authorization:this.$store.state.user.sessionInfo.token},data:{query:`\n {\n eventMessageCommentReplies(replyId:"${e.id}",first:${s},skip:${t}){\n id\n message\n isDeleted\n createdAt\n updatedAt\n createdBy{\n id\n firstName\n lastName\n profile{\n profileImageUrl\n }\n }\n }\n }\n `}});e.showReplies=!0,e.replies=[...e.replies,...a.data.data.eventMessageCommentReplies]}catch(a){this.$store.dispatch("showMessage",{show:!0,message:"Something went wrong",type:"error"})}},async loadData(){const e=await this.$axios({headers:{Authorization:this.$store.state.user.sessionInfo.token},data:{query:`\n {\n event(eventId: "${this.$router.currentRoute.params.eventId}") {\n tour{\n administrators{\n userId\n }\n }\n eventMessages{\n id\n eventId\n subject\n message\n audience\n createdAt\n updatedAt\n userReadReceipt {\n id\n userId\n messageId\n readAt\n }\n repliesCount\n replies{\n id\n eventMessageId\n message\n isDeleted\n createdAt\n createdBy{\n id\n firstName\n lastName\n profile{\n profileImageUrl\n }\n }\n updatedAt\n updatedBy{\n id\n }\n repliesCount\n }\n }\n }\n }\n `}});e.data.data.event.eventMessages.forEach((e=>{e.replies.forEach((e=>{e.replies=[],e.showReplies=!1}))})),this.eventMessages=e.data.data.event.eventMessages,this.adminUserIds=[...e.data.data.event.tour.administrators.map((e=>
1e.userId))],this.loaded=!0},formattedDate(e){return i()(e).format("D MMM YYYY HH:mm")},async unMarkAsRead(e){try{await this.$axios({headers:{Authorization:this.$store.state.user.sessionInfo.token},data:{query:`\n mutation{\n DeleteEventMessageReadReceipt(messageId:"${e.id}")\n }\n `}});e.userReadReceipt=null,this.updateEventMessageMeta()}catch(t){this.$store.dispatch("showMessage",{show:!0,message:"Something went wrong",type:"error"})}},async updateEventMessageMeta(){const e=await this.$axios({headers:{Authorization:this.$store.state.user.sessionInfo.token},data:{query:`\n {\n event(eventId: "${this.$router.currentRoute.params.eventId}") {\n eventMessageMeta {\n accepted\n pending\n public\n readByUser\n availableToUser\n }\n }\n }\n `}});this.$store.dispatch("setEventMessagesMeta",e.data.data.event.eventMessageMeta)},async markAsRead(e){try{let t=await this.$axios({headers:{Authorization:this.$store.state.user.sessionInfo.token},data:{query:`\n mutation{\n CreateEventMessageReadReceipt(messageId:"${e.id}"){\n id\n }\n }\n `}});e.userReadReceipt=t.data.data.CreateEventMessageReadReceipt,this.updateEventMessageMeta()}catch(t){this.$store.dispatch("showMessage",{show:!0,message:"Something went wrong",type:"error"})}},dateFormatter(e){return i()(e).format("D MMM HH:mm")}},beforeMount(){this.loadData()},beforeCreate(){},destroyed(){}},g=h,f=s(81656),v=(0,f.A)(g,a,n,!1,null,"2d63711a",null),y=v.exports},49834:function(e,t,s){var a=s(95093),n=s.n(a);t.A={computed:{},methods:{dateFormatter(e,t){return n()(e).format(t)},utcDateFormatter(e,t){return n().utc(e).format(t)},timeSince(e){const t=n()();return n()().subtract(1,"minutes").isBefore(e)?"Just now":n()().subtract(1,"hours").isBefore(e)?`${Math.round(n().duration(t.diff(e)).asMinutes())} m`:n()().subtract(1,"days").isBefore(e)?`${Math.round(n().duration(t.diff(e)).asHours())} h`:n()(e).format("D MMM")}}}},24077:function(e,t){t.A={computed:{},methods:{singularPlural(e,t){return t?e:e+"s"},teamVsPlayerWording(e,t,s){return e?t&&s?"Players":t?"players":s?"Player":"player":t&&s?"Teams":t?"teams":s?"Team":"team"}}}}}]); 2//# sourceMappingURL=3646.018cf6c4.js.map
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.