1(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["inbox"],{"42e5":function(t,e,s){"use strict";s.d(e,"a",(function(){return o})),s.d(e,"b",(function(){return l}));var a=s("ff63");let i=null,r=null;function n(){return Boolean("adee038349b113d6c6512ff4797dbff0")}async function d(){const[{default:t},e]=await Promise.all([s.e("echo").then(s.bind(null,"5638a")),s.e("echo").then(s.t.bind(null,"782e",7))]);window.Pusher=e.default||e;"https://messaging-api.jangolo.com".replace(/\/$/,"");const i="https://messaging-api.jangolo.com/broadcasting/auth";return new t({broadcaster:"reverb",key:"adee038349b113d6c6512ff4797dbff0",wsHost:"messaging-ws.jangolo.com",wsPort:Number("443"),wssPort:Number("443"),forceTLS:!0,enabledTransports:["ws","wss"],authEndpoint:i,auth:{headers:{get Authorization(){const t=a["a"].getAccessToken();return t?"Bearer "+t:""},Accept:"application/json"}}})}async function o(){return n()?i||(r||(r=d().then(t=>(i=t,t)).catch(t=>(console.warn("[echo] init failed, falling back to polling:",t&&t.message),r=null,null)),r)):null}async function l(t){i&&i.leave(t)}},"51d8":function(t,e,s){"use strict";s("7666")},7666:function(t,e,s){},ccac:function(t,e,s){"use strict";var a=s("bc3a"),i=s.n(a),r=s("ff63");const n=i.a.create({baseURL:"https://messaging-api.jangolo.com",timeout:3e4});n.interceptors.request.use(t=>{const e=r["a"].getAccessToken();return e?t.headers.Authorization="Bearer "+e:t.headers&&delete t.headers.Authorization,t},t=>Promise.reject(t));class d{listThreads(t){return n.get("/threads",{params:t}).then(t=>t.data)}getThread(t){return n.get("/threads/"+t).then(t=>t.data)}createThread(t){return n.post("/threads",t).then(t=>t.data)}resolveThread({counterpartyId:t,contextType:e,contextId:s}){return n.post("/threads/resolve",{counterparty_id:t,context_type:e,context_id:s}).then(t=>t.data)}markRead(t,e){return n.post(`/threads/${t}/read`,{last_read_message_id:e}).then(t=>t.data)}archiveThread(t,e=!0){return n.post(`/threads/${t}/archive`,{archived:e}).then(t=>t.data)}muteThread(t,e=null){return n.post(`/threads/${t}/mute`,{until:e}).then(t=>t.data)}leaveThread(t){return n.post(`/threads/${t}/leave`).then(t=>t.data)}listMessages(t,{beforeId:e,limit:s=30}={}){const a={limit:s};return e&&(a.before_id=e),n.get(`/threads/${t}/messages`,{params:a}).then(t=>t.data)}sendMessage(t,{body:e,replyToId:s,attachments:a}){return n.post(`/threads/${t}/messages`,{body:e,reply_to_id:s,attachments:a}).then(t=>t.data)}editMessage(t,e){return n.patch("/messages/"+t,{body:e}).then(t=>t.data)}deleteMessage(t){return n.delete("/messages/"+t).then(t=>t.data)}addParticipant(t,e,s="member"){return n.post(`/threads/${t}/participants`,{user_id:e,role:s}).then(t=>t.data)}removeParticipant(t,e){return n.delete(`/threads/${t}/participants/${e}`).then(t=>t.data)}unreadCount(){return n.get("/unread-count").then(t=>t.data)}}e["a"]=new d},d9c2:function(t,e,s){"use strict";s.r(e);var a=function(){var t=this,e=t._self._c;return e("div",{staticClass:"ix-page"},[e("div",{staticClass:"ix-shell"},[e("header",{staticClass:"masthead"},[e("span",{staticClass:"masthead__kicker"},[e("span",{staticClass:"masthead__kicker-mark"}),t._v(" "+t._s(t.t("kicker"))+" ")]),e("div",{staticClass:"masthead__row"},[e("h1",{staticClass:"masthead__title"},[e("span",{staticClass:"masthead__title-a"},[t._v(t._s(t.t("title_a")))]),e("span",{staticClass:"masthead__title-b"},[t._v("Â "+t._s(t.t("title_b"))),e("span",{staticClass:"masthead__dot"},[t._v(".")])])]),e("button",{staticClass:"ix-refresh",class:{"is-spinning":t.loadingThreads},attrs:{type:"button","aria-label":t.t("refresh"),title:t.t("refresh")},on:{click:t.refreshThreads}},[e("svg",{attrs:{viewBox:"0 0 24 24",fill:"none","aria-hidden":"true"}},[e("path",{attrs:{d:"M3 12a9 9 0 0115-6.7L21 8M21 3v5h-5M21 12a9 9 0 01-15 6.7L3 16M3 21v-5h5",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","stroke-linejoin":"round"}})])])]),e("p",{staticClass:"masthead__tagline"},[t._v(t._s(t.t("tagline")))])]),e("div",{staticClass:"desk"},[e("aside",{staticClass:"rail",attrs:{"aria-busy":t.loadingThreads}},[e("div",{staticClass:"rail__header"}
1,[t.threads.length?e("span",{staticClass:"rail__count"},[e("span",{staticClass:"rail__count-num"},[t._v(t._s(t.threads.length))]),e("span",{staticClass:"rail__count-lbl"},[t._v(t._s(t.totalUnread)+" "+t._s(t.t("unread_label")))])]):t._e()]),t.threads.length?e("ul",{staticClass:"rail__list"},t._l(t.threads,(function(s){return e("li",{key:s.id,class:["thread",{"is-active":s.id===t.activeThreadId,"is-unread":s.unread_count>0,["thread--"+(s.type||"direct")]:!0}],attrs:{tabindex:"0"},on:{click:function(e){return t.selectThread(s)},keydown:function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:t.selectThread(s)}}},[e("div",{staticClass:"thread__avatar",attrs:{"data-init":t.threadInitials(s)}},["group"===s.type?e("svg",{attrs:{viewBox:"0 0 24 24",fill:"none","aria-hidden":"true"}},[e("circle",{attrs:{cx:"9",cy:"8",r:"3.4",stroke:"currentColor","stroke-width":"1.6"}}),e("circle",{attrs:{cx:"17",cy:"9",r:"2.6",stroke:"currentColor","stroke-width":"1.6"}}),e("path",{attrs:{d:"M2 20c0-3 3-5.4 7-5.4s7 2.4 7 5.4M16 20c0-2.4 1.8-4 4-4",stroke:"currentColor","stroke-width":"1.6","stroke-linecap":"round"}})]):"support"===s.type?e("svg",{attrs:{viewBox:"0 0 24 24",fill:"none","aria-hidden":"true"}},[e("circle",{attrs:{cx:"12",cy:"12",r:"9",stroke:"currentColor","stroke-width":"1.6"}}),e("path",{attrs:{d:"M5 5l3.5 3.5M19 5l-3.5 3.5M5 19l3.5-3.5M19 19l-3.5-3.5",stroke:"currentColor","stroke-width":"1.6","stroke-linecap":"round"}})]):e("span",{staticClass:"thread__avatar-init"},[t._v(t._s(t.threadInitials(s)))])]),e("div",{staticClass:"thread__body"},[e("div",{staticClass:"thread__top"},[e("span",{staticClass:"thread__title"},[t._v(t._s(t.threadTitle(s)))]),s.last_message_at?e("time",{staticClass:"thread__time"},[t._v(t._s(t.formatRelative(s.last_message_at)))]):t._e()]),e("p",{staticClass:"thread__preview"},[t._v(t._s(s.last_message_preview||"â"))])]),s.unread_count>0?e("span",{staticClass:"thread__badge"},[t._v(t._s(s.unread_count))]):t._e()])})),0):t.loadingThreads?e("div",{staticClass:"rail__loading"},[e("span",{staticClass:"rail__loading-bar"}),e("span",{staticClass:"rail__loading-bar"}),e("span",{staticClass:"rail__loading-bar"})]):e("div",{staticClass:"rail__empty"},[e("svg",{attrs:{viewBox:"0 0 48 48",fill:"none","aria-hidden":"true"}},[e("path",{attrs:{d:"M8 12h32v22a4 4 0 01-4 4H12a4 4 0 01-4-4V12z",stroke:"currentColor","stroke-width":"1.8","stroke-linejoin":"round"}}),e("path",{attrs:{d:"M8 12l16 12 16-12",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","stroke-linejoin":"round"}})]),e("p",{staticClass:"rail__empty-title"},[t._v(t._s(t.t("empty_threads")))]),e("p",{staticClass:"rail__empty-hint"},[t._v(t._s(t.t("empty_threads_hint")))])])]),e("section",{staticClass:"pane"},[t.activeThread?[e("header",{staticClass:"pane__head"},[e("div",{staticClass:"pane__head-info"},[e("div",{staticClass:"pane__head-avatar",attrs:{"data-init":t.threadInitials(t.activeThread)}},[e("span",[t._v(t._s(t.threadInitials(t.activeThread)))])]),e("div",[e("h2",{staticClass:"pane__head-title"},[t._v(t._s(t.threadTitle(t.activeThread)))]),e("span",{staticClass:"pane__head-meta"},[t._v(t._s(t.threadTypeLabel(t.activeThread)))])])]),e("div",{staticClass:"pane__head-actions"},[e("button",{staticClass:"pane__icon-btn",attrs:{type:"button","aria-label":t.activeThread.muted?t.t("unmute"):t.t("mute"),title:t.activeThread.muted?t.t("unmute"):t.t("mute")},on:{click:t.toggleMute}},[e("svg",{attrs:{viewBox:"0 0 24 24",fill:"none","aria-hidden":"true"}},[t.activeThread.muted?e("path",{attrs:{d:"M6 8a6 6 0 0112 0v6l2 3H4l2-3V8zM10 21a2 2 0 004 0M3 3l18 18",stroke:"currentColor","stroke-width":"1.6","stroke-linejoin":"round","stroke-linecap":"round"}}):e("path",{attrs:{d:"M6 8a6 6 0 0112 0v6l2 3H4l2-3V8zM10 21a2 2 0 004 0",stroke:"currentColor","stroke-width":"1.6","stroke-linejoin":"round","stroke-linecap":"round"}})])]),e("button",{staticClass:"pane__icon-btn",attrs:{type:"button","aria-label":t.t("archive"),title:t.t("archive")},on:{click:t.archive}},[e("svg",{attrs:{viewBox:"0 0 24 24",fill:"none","aria-hidden":"true"}},[e("path",{attrs:{d:"M3 6h18v4H3zM5 10h14v10a2 2 0 01-2 2H7a2 2 0 01-2-2V10zM10 14h4",stroke:"currentColor","stroke-width":"1.6","stroke-linejoin":"round","stroke-linecap":"round"}})])])])]),e("div",{ref:"messagesScroll",staticClass:"pane__scroll"},[t.hasMoreMessages?e("button",{staticClass:"pane__load-older",attrs:{type:"button",disabled:t.loadingMore},on:{click:t.loadOlder}},[t.loadingMore?t._e():e("svg",{attrs:{viewBox:"0 0 24 24",fill:"none","aria-hidden":"true"}},[e("path",{attrs:{d:"M5 15l7-7 7 7",stroke:"currentColor","stroke-width":"1.6","stroke-linecap":"round","stroke-linejoin":"round"}})]),t.loadingMore?e("span",{staticClass:"pane__load-spin"}):t._e(),t._v(" "+t._s(t.t("load_older"))+" ")]):t._e(),t.messages.length?e("div",{staticClass:"pane__day-divider"},[e("span"),e("em",[t._v("·")]),e("span")]):t._e(),e("ol",{staticClass:"msgs",attrs:{role:"list"}},t._l(t.messages,(function(s){return e("li",{key:s.id,class:["msg",{"msg--mine":s.sender_id===t.currentUserId}]},[e("div",{staticClass:"msg__bubble"},[e("p",{staticClass:"msg__body"},[t._v(t._s(s.body))]),e("div",{staticClass:"msg__meta"},[e("time",[t._v(t._s(t.formatTime(s.created_at)))]),s.edited_at?e("span",{staticClass:"msg__edited"},[t._v("· "+t._s(t.t("edited")))]):t._e()])])])})),0)]),e("footer",{staticClass:"composer"},[e("div",{staticClass:"composer__input-wrap",class:{"has-text":t.draft.trim().length>0,"is-focused":t.composerFocused}},[e("textarea",{directives:[{name:"model",rawName:"v-model",value:t.draft,expression:"draft"}],ref:"composerInput",staticClass:"composer__input",attrs:{rows:"1",placeholder:t.t("write_placeholder")},domProps:{value:t.draft},on:{focus:function(e){t.composerFocused=!0},blur:function(e){t.composerFocused=!1}
1,keydown:function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")||e.ctrlKey||e.shiftKey||e.altKey||e.metaKey?null:(e.preventDefault(),t.send.apply(null,arguments))},input:[function(e){e.target.composing||(t.draft=e.target.value)},t.autoGrow]}})]),e("button",{staticClass:"composer__send",attrs:{type:"button",disabled:!t.canSend},on:{click:t.send}},[t.sending?t._e():e("span",{staticClass:"composer__send-label"},[t._v(t._s(t.t("send")))]),t.sending?e("span",{staticClass:"composer__send-spin"}):e("svg",{attrs:{viewBox:"0 0 24 24",fill:"none","aria-hidden":"true"}},[e("path",{attrs:{d:"M3 11l18-7-7 18-2-8-9-3z",stroke:"currentColor","stroke-width":"1.7","stroke-linejoin":"round",fill:"currentColor","fill-opacity":"0.15"}})])])])]:e("div",{staticClass:"pane__empty"},[e("div",{staticClass:"pane__empty-art",attrs:{"aria-hidden":"true"}},[e("svg",{attrs:{viewBox:"0 0 120 120"}},[e("defs",[e("pattern",{attrs:{id:"ix-grid",width:"10",height:"10",patternUnits:"userSpaceOnUse"}},[e("path",{attrs:{d:"M 10 0 L 0 0 0 10",fill:"none",stroke:"currentColor","stroke-width":"0.4",opacity:"0.3"}})])]),e("rect",{attrs:{x:"10",y:"20",width:"100",height:"78",rx:"8",fill:"url(#ix-grid)",stroke:"currentColor","stroke-width":"1.2"}}),e("path",{attrs:{d:"M14 28l46 32 46-32",fill:"none",stroke:"currentColor","stroke-width":"1.2","stroke-linejoin":"round"}}),e("path",{attrs:{d:"M44 70h32M44 78h22",stroke:"currentColor","stroke-width":"1.2","stroke-linecap":"round"}}),e("circle",{attrs:{cx:"92",cy:"32",r:"6",fill:"currentColor",opacity:"0.85"}})])]),e("h3",{staticClass:"pane__empty-title"},[t._v(t._s(t.t("empty_view_title")))]),e("p",{staticClass:"pane__empty-hint"},[t._v(t._s(t.t("empty_view_hint")))])])],2)])])])},i=[],r=(s("14d9"),s("13d5"),s("e9f5"),s("910d"),s("f665"),s("ab43"),s("9485"),s("a732"),s("ccac")),n=s("42e5"),d={name:"JangoloInbox",props:{initialThreadId:{type:[Number,String],default:null},contextType:{type:String,default:null},contextId:{type:[Number,String],default:null},pollIntervalMs:{type:Number,default:15e3}},data(){return{threads:[],loadingThreads:!1,activeThreadId:null,activeThread:null,messages:[],hasMoreMessages:!1,loadingMore:!1,draft:"",sending:!1,pollTimer:null,echo:null,subscribedThreadId:null,composerFocused:!1}},computed:{currentUserId(){const t=this.$store&&this.$store.state&&this.$store.state.auth&&this.$store.state.auth.user;return t?t.id:null},canSend(){return this.activeThread&&this.draft.trim().length>0&&!this.sending},totalUnread(){return this.threads.reduce((t,e)=>t+(e.unread_count||0),0)}},mounted(){this.refreshThreads().then(()=>{if(this.initialThreadId){const t=this.threads.find(t=>String(t.id)===String(this.initialThreadId));t&&this.selectThread(t)}}),Object(n["a"])().then(t=>{this.echo=t}),this.startPolling()},beforeDestroy(){this.stopPolling(),this.unsubscribeActiveThread()},methods:{t(t){return this.$vuetify.lang.t("$vuetify.inbox."+t)},async refreshThreads(){this.loadingThreads=!0;try{const t={};this.contextType&&(t.context_type=this.contextType),this.contextId&&(t.context_id=this.contextId);const e=await r["a"].listThreads(t);this.threads=e.data||[]}finally{this.loadingThreads=!1}},async selectThread(t){this.unsubscribeActiveThread(),this.activeThreadId=t.id,this.activeThread=t,this.messages=[],this.hasMoreMessages=!1;const e=await r["a"].listMessages(t.id);this.messages=(e.data||[]).slice().reverse(),this.hasMoreMessages=e.has_more,this.$nextTick(()=>this.scrollToBottom());const s=this.messages[this.messages.length-1];s&&(!t.last_read_message_id||s.id>t.last_read_message_id)&&(await r["a"].markRead(t.id,s.id),t.unread_count=0),this.subscribeToActiveThread()},subscribeToActiveThread(){if(!this.echo||!this.activeThread)return;const t="messaging.thread."+this.activeThread.id;this.subscribedThreadId=this.activeThread.id,this.echo.private(t).listen(".message.sent",t=>this.onRealtimeMessage(t)).listen(".message.edited",t=>this.onRealtimeEdit(t)).listen(".message.deleted",t=>this.onRealtimeDelete(t)).listen(".thread.read",t=>this.onRealtimeRead(t))},unsubscribeActiveThread(){this.echo&&this.subscribedThreadId&&(Object(n["b"])("private-messaging.thread."+this.subscribedThreadId),this.subscribedThreadId=null)},onRealtimeMessage(t){this.activeThread&&t.thread_id===this.activeThread.id&&(this.messages.some(e=>e.id===t.id)||(this.messages.push(t),this.$nextTick(()=>this.scrollToBottom()),t.sender_id!==this.currentUserId&&r["a"].markRead(this.activeThread.id,t.id)))},onRealtimeEdit(t){const e=this.messages.findIndex(e=>e.id===t.id);-1!==e&&this.$set(this.messages,e,{...this.messages[e],body:t.body,edited_at:t.edited_at})},onRealtimeDelete(t){this.messages=this.messages.filter(e=>e.id!==t.id)},onRealtimeRead(){},async loadOlder(){if(this.activeThread&&this.messages.length){this.loadingMore=!0;try{const t=this.messages[0],e=await r["a"].listMessages(this.activeThread.id,{beforeId:t.id}),s=(e.data||[]).slice().reverse();this.messages=[...s,...this.messages],this.hasMoreMessages=e.has_more}finally{this.loadingMore=!1}}},async send(){if(!this.canSend)return;this.sending=!0;const t=this.draft.trim();try{const e=await r["a"].sendMessage(this.activeThread.id,{body:t});this.messages.push(e),this.draft="",this.autoGrow(),this.$nextTick(()=>this.scrollToBottom()),this.activeThread.last_message_preview=e.body,this.activeThread.last_message_at=e.created_at}finally{this.sending=!1}},async archive(){this.activeThread&&(await r["a"].archiveThread(this.activeThread.id,!this.activeThread.archived),this.activeThread.archived=!this.activeThread.archived,this.threads=this.threads.filter(t=>t.id!==this.activeThread.id),this.activeThread=null,this.activeThreadI
1d=null)},async toggleMute(){if(!this.activeThread)return;const t=this.activeThread.muted?null:new Date(Date.now()+6048e5).toISOString();await r["a"].muteThread(this.activeThread.id,t),this.activeThread.muted=!this.activeThread.muted},threadTitle(t){if(t.subject)return t.subject;if(t.context_type)return`${t.context_type} #${t.context_id}`;const e=(t.participants||[]).filter(t=>t.user_id!==this.currentUserId);return e.length?e.map(t=>"User #"+t.user_id).join(", "):this.t("thread_direct")},threadTypeLabel(t){return"group"===t.type?this.t("thread_group"):"support"===t.type?this.t("thread_support"):this.t("thread_direct")},threadInitials(t){const e=this.threadTitle(t);return e.replace(/[^a-zA-Z0-9 ]/g,"").split(" ").filter(Boolean).slice(0,2).map(t=>t.charAt(0).toUpperCase()).join("")||"·"},formatTime(t){if(!t)return"";const e=new Date(t);return e.toLocaleString(void 0,{hour:"2-digit",minute:"2-digit"})},formatRelative(t){if(!t)return"";const e=new Date(t),s=new Date,a=e.toDateString()===s.toDateString();if(a)return e.toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"});const i=(s-e)/864e5;return i<7?e.toLocaleDateString(void 0,{weekday:"short"}):e.toLocaleDateString(void 0,{day:"2-digit",month:"short"})},scrollToBottom(){const t=this.$refs.messagesScroll;t&&(t.scrollTop=t.scrollHeight)},autoGrow(){const t=this.$refs.composerInput;t&&(t.style.height="auto",t.style.height=Math.min(t.scrollHeight,140)+"px")},startPolling(){!this.pollTimer&&this.pollIntervalMs&&(this.pollTimer=setInterval(()=>{this.refreshThreads(),this.activeThread&&this.pollActiveMessages()},this.pollIntervalMs))},stopPolling(){this.pollTimer&&(clearInterval(this.pollTimer),this.pollTimer=null)},async pollActiveMessages(){if(!this.activeThread||!this.messages.length)return;const t=this.messages[this.messages.length-1],e=await r["a"].listMessages(this.activeThread.id,{limit:30}),s=(e.data||[]).slice().reverse(),a=s.filter(e=>e.id>t.id);if(a.length){this.messages.push(...a),this.$nextTick(()=>this.scrollToBottom());const t=a[a.length-1];await r["a"].markRead(this.activeThread.id,t.id)}}}},o=d,l=(s("51d8"),s("2877")),h=Object(l["a"])(o,a,i,!1,null,"54ba6b87",null);e["default"]=h.exports}}]);
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.