webpackJsonp([16],{2003:function(e,n,s){"use strict";function View_AddonMessagesDiscussionPage_1(e){return t._57(0,[(e()(),t._31(0,0,null,null,1,"img",[["class","core-bar-button-image"],["core-external-content",""],["onError","this.src='assets/img/group-avatar.png'"],["role","presentation"]],[[8,"alt",0]],null,null,null,null)),t._30(1,4734976,null,0,H.a,[t.t,h.b,z.a,G.a,a.a,g.a,X.b,_.b,m.b],{siteId:[0,"siteId"],src:[1,"src"]},null)],function(e,n){var s=n.component;e(n,1,0,s.siteId||null,s.conversationImage)},function(e,n){e(n,0,0,n.component.title)})}function View_AddonMessagesDiscussionPage_2(e){return t._57(0,[(e()(),t._31(0,0,null,null,2,"ion-avatar",[["class","core-bar-button-image"],["core-user-avatar",""],["item-start",""]],null,[[null,"click"]],function(e,n,s){var t=!0,o=e.component;if("click"===n){t=!1!==(o.showInfo&&o.viewInfo())&&t}return t},K.b,K.a)),t._30(1,770048,null,0,W.a,[Y.a,a.a,m.b,_.b,i.b,[2,v.a]],{user:[0,"user"],linkProfile:[1,"linkProfile"],checkOnline:[2,"checkOnline"]},null),t._30(2,16384,null,0,J.a,[],null,null)],function(e,n){var s=n.component;e(n,1,0,s.otherMember,!1,s.otherMember.showonlinestatus)},null)}function View_AddonMessagesDiscussionPage_3(e){return t._57(0,[(e()(),t._31(0,0,null,null,2,"core-icon",[["name","fa-star"]],null,null,null,Q.b,Q.a)),t._30(1,704512,null,0,Z.a,[t.t,ee.a],{name:[0,"name"],ariaLabel:[1,"ariaLabel"]},null),t._47(131072,ne.a,[se.a,t.j])],function(e,n){e(n,1,0,"fa-star",t._56(n,1,1,t._44(n,2).transform("core.favourites")))},null)}function View_AddonMessagesDiscussionPage_4(e){return t._57(0,[(e()(),t._31(0,0,null,null,2,"core-icon",[["name","volume-off"]],null,null,null,Q.b,Q.a)),t._30(1,704512,null,0,Z.a,[t.t,ee.a],{name:[0,"name"],ariaLabel:[1,"ariaLabel"]},null),t._47(131072,ne.a,[se.a,t.j])],function(e,n){e(n,1,0,"volume-off",t._56(n,1,1,t._44(n,2).transform("addon.messages.mutedconversation")))},null)}function View_AddonMessagesDiscussionPage_5(e){return t._57(0,[(e()(),t._31(0,0,null,null,10,null,null,null,null,null,null,null)),(e()(),t._55(-1,null,["\n            "])),(e()(),t._31(2,0,null,null,2,"p",[["text-center",""]],null,null,null,null,null)),(e()(),t._55(3,null,["",""])),t._47(131072,ne.a,[se.a,t.j]),(e()(),t._55(-1,null,["\n            "])),(e()(),t._31(6,0,null,null,3,"p",[["text-center",""]],null,null,null,null,null)),(e()(),t._31(7,0,null,null,2,"i",[],null,null,null,null,null)),(e()(),t._55(8,null,["",""])),t._47(131072,ne.a,[se.a,t.j]),(e()(),t._55(-1,null,["\n        "]))],null,function(e,n){e(n,3,0,t._56(n,3,0,t._44(n,4).transform("addon.messages.selfconversation")));e(n,8,0,t._56(n,8,0,t._44(n,9).transform("addon.messages.selfconversationdefaultmessage")))})}function View_AddonMessagesDiscussionPage_7(e){return t._57(0,[(e()(),t._31(0,0,null,null,2,"h6",[["class","addon-messages-date"],["text-center",""]],null,null,null,null,null)),(e()(),t._55(1,null,["\n                    ","\n                "])),t._49(2,2)],null,function(e,n){e(n,1,0,t._56(n,1,0,e(n,2,0,t._44(n.parent.parent,0),n.parent.context.$implicit.timecreated,"strftimedayshort")))})}function View_AddonMessagesDiscussionPage_8(e){return t._57(0,[(e()(),t._31(0,0,null,null,10,"ion-chip",[["class","addon-messages-unreadfrom"],["color","light"]],null,null,null,null,null)),t._30(1,16384,null,0,te.a,[ee.a,t.t,t.V],{color:[0,"color"]},null),(e()(),t._55(-1,null,["\n                    "])),(e()(),t._31(3,0,null,null,3,"ion-label",[],null,null,null,null,null)),t._30(4,16384,null,0,oe.a,[ee.a,t.t,t.V,[8,null],[8,null],[8,null],[8,null]],null,null),(e()(),t._55(5,null,["",""])),t._47(131072,ne.a,[se.a,t.j]),(e()(),t._55(-1,null,["\n                    "])),(e()(),t._31(8,0,null,null,1,"ion-icon",[["name","arrow-round-down"],["role","img"]],[[2,"hide",null]],null,null,null,null)),t._30(9,147456,null,0,le.a,[ee.a,t.t,t.V],{name:[0,"name"]},null),(e()(),t._55(-1,null,["\n                "]))],function(e,n){e(n,1,0,"light");e(n,9,0,"arrow-round-down")},function(e,n){e(n,5,0,t._56(n,5,0,t._44(n,6).transform("addon.messages.newmessages")));e(n,8,0,t._44(n,9)._hidden)})}function View_AddonMessagesDiscussionPage_9(e){return t._57(0,[(e()(),t._31(0,0,null,null,2,"ion-avatar",[["core-user-avatar",""],["item-start",""]],null,null,null,K.b,K.a)),t._30(1,770048,null,0,W.a,[Y.a,a.a,m.b,_.b,i.b,[2,v.a]],{user:[0,"user"],linkProfile:[1,"linkProfile"]},null),t._30(2,16384,null,0,J.a,[],null,null)],function(e,n){e(n,1,0,n.component.members[n.parent.context.$implicit.useridfrom],!1)},null)}function View_AddonMessagesDiscussionPage_10(e){return t._57(0,[(e()(),t._31(0,0,null,null,1,"div",[],null,null,null,null,null)),(e()(),t._55(1,null,["",""]))],null,function(e,n){e(n,1,0,n.component.members[n.parent.context.$implicit.useridfrom].fullname)})}function View_AddonMessagesDiscussionPage_11(e){return t._57(0,[(e()(),t._31(0,0,null,null,3,"ion-note",[],null,null,null,null,null)),t._30(1,16384,null,0,ie.a,[ee.a,t.t,t.V],null,null),(e()(),t._55(2,null,["",""])),t._49(3,2)],null,function(e,n){e(n,2,0,t._56(n,2,0,e(n,3,0,t._44(n.parent.parent,0),n.parent.context.$implicit.timecreated,"strftimetime")))})}function View_AddonMessagesDiscussionPage_12(e){return t._57(0,[(e()(),t._31(0,0,null,null,3,"ion-note",[],null,null,null,null,null)),t._30(1,16384,null,0,ie.a,[ee.a,t.t,t.V],null,null),(e()(),t._31(2,0,null,null,1,"ion-icon",[["name","time"],["role","img"]],[[2,"hide",null]],null,null,null,null)),t._30(3,147456,null,0,le.a,[ee.a,t.t,t.V],{name:[0,"name"]},null)],function(e,n){e(n,3,0,"time")},function(e,n){e(n,2,0,t._44(n,3)._hidden)})}function View_AddonMessagesDiscussionPage_13(e){return t._57(0,[(e()(),t._31(0,0,null,null,6,"button",[["class","addon-messages-delete-button"],["clear","true"],["icon-only",""],["ion-button",""]],[[24,"@coreSlideInOut",0],[1,"aria-label",0]],[[null,"click"]],function(e,n,s){var t=!0;if("click"===n){t=!1!==e.component.deleteMessage(e.parent.context.$implicit,e.parent.context.index)&&t}return t},ae.b,ae.a)),t._30(1,1097728,[[6,4]],0,re.a,[[8,""],ee.a,t.t,t.V],{clear:[0,"clear"]},null),t._47(131072,ne.a,[se.a,t.j]),(e()(),t._55(-1,0,["\n                        "])),(e()(),t._31(4,0,null,0,1,"ion-icon",[["color","danger"],["name","trash"],["role","img"]],[[2,"hide",null]],null,null,null,null)),t._30(5,147456,null,0,le.a,[ee.a,t.t,t.V],{color:[0,"color"],name:[1,"name"]},null),(e()(),t._55(-1,0,["\n                    "]))],function(e,n){e(n,1,0,"true");e(n,5,0,"danger","trash")},function(e,n){e(n,0,0,"fromRight",t._56(n,0,1,t._44(n,2).transform("addon.messages.deletemessage")));e(n,4,0,t._44(n,5)._hidden)})}function View_AddonMessagesDiscussionPage_14(e){return t._57(0,[(e()(),t._31(0,0,null,null,0,"div",[["class","tail"]],null,null,null,null,null))],null,null)}function View_AddonMessagesDiscussionPage_6(e){return t._57(0,[(e()(),t._31(0,0,null,null,45,null,null,null,null,null,null,null)),(e()(),t._55(-1,null,["\n                "])),(e()(),t._26(16777216,null,null,1,null,View_AddonMessagesDiscussionPage_7)),t._30(3,16384,null,0,ue.k,[t._11,t._6],{ngIf:[0,"ngIf"]},null),(e()(),t._55(-1,null,["\n\n                "])),(e()(),t._26(16777216,null,null,1,null,View_AddonMessagesDiscussionPage_8)),t._30(6,16384,null,0,ue.k,[t._11,t._6],{ngIf:[0,"ngIf"]},null),(e()(),t._55(-1,null,["\n\n                "])),(e()(),t._31(8,0,null,null,36,"ion-item",[["class","addon-message item item-block"],["text-wrap",""]],[[2,"addon-message-mine",null],[2,"addon-message-not-mine",null],[2,"addon-message-no-user",null],[24,"@coreSlideInOut",0]],[[null,"longPress"]],function(e,n,s){var t=!0;if("longPress"===n){t=!1!==e.component.copyMessage(e.context.$implicit)&&t}return t},ce.b,ce.a)),t._30(9,212992,null,0,de.a,[t.t],null,{longPress:"longPress"}),t._30(10,1097728,null,3,ge.a,[me.a,ee.a,t.t,t.V,[2,fe.a]],null,null),t._52(335544320,5,{contentLabel:0}),t._52(603979776,6,{_buttons:1}),t._52(603979776,7,{_icons:1}),t._30(14,16384,null,0,he.a,[],null,null),(e()(),t._55(-1,2,["\n                    "])),(e()(),t._55(-1,2,["\n                    "])),(e()(),t._31(17,0,null,2,13,"h2",[["class","addon-message-user"]],null,null,null,null,null)),(e()(),t._55(-1,null,["\n                        "])),(e()(),t._26(16777216,null,null,1,null,View_AddonMessagesDiscussionPage_9)),t._30(20,16384,null,0,ue.k,[t._11,t._6],{ngIf:[0,"ngIf"]},null),(e()(),t._55(-1,null,["\n\n                        "])),(e()(),t._26(16777216,null,null,1,null,View_AddonMessagesDiscussionPage_10)),t._30(23,16384,null,0,ue.k,[t._11,t._6],{ngIf:[0,"ngIf"]},null),(e()(),t._55(-1,null,["\n\n                        "])),(e()(),t._26(16777216,null,null,1,null,View_AddonMessagesDiscussionPage_11)),t._30(26,16384,null,0,ue.k,[t._11,t._6],{ngIf:[0,"ngIf"]},null),(e()(),t._55(-1,null,["\n                        "])),(e()(),t._26(16777216,null,null,1,null,View_AddonMessagesDiscussionPage_12)),t._30(29,16384,null,0,ue.k,[t._11,t._6],{ngIf:[0,"ngIf"]},null),(e()(),t._55(-1,null,["\n                    "])),(e()(),t._55(-1,2,["\n\n                    "])),(e()(),t._55(-1,2,["\n                    "])),(e()(),t._31(33,0,null,2,4,"p",[["class","addon-message-text"]],null,null,null,null,null)),(e()(),t._55(-1,null,["\n                        "])),(e()(),t._31(35,16777216,null,null,1,"core-format-text",[["contextLevel","system"]],null,[[null,"afterRender"]],function(e,n,s){var t=!0;if("afterRender"===n){t=!1!==(e.context.last&&e.component.scrollToBottom())&&t}return t},null,null)),t._30(36,540672,null,0,_e.a,[t.t,a.a,g.a,f.b,se.a,G.a,m.b,X.b,h.b,z.a,_.b,pe.a,[2,Y.a],[2,ve.a],[2,v.a],be.a,i.b,Me.a,ye.a,Ie.a,t._11,we.a],{text:[0,"text"],contextLevel:[1,"contextLevel"],contextInstanceId:[2,"contextInstanceId"]},{afterRender:"afterRender"}),(e()(),t._55(-1,null,["\n                    "])),(e()(),t._55(-1,2,["\n\n                    "])),(e()(),t._26(16777216,null,2,1,null,View_AddonMessagesDiscussionPage_13)),t._30(40,16384,null,0,ue.k,[t._11,t._6],{ngIf:[0,"ngIf"]},null),(e()(),t._55(-1,2,["\n                    "])),(e()(),t._26(16777216,null,2,1,null,View_AddonMessagesDiscussionPage_14)),t._30(43,16384,null,0,ue.k,[t._11,t._6],{ngIf:[0,"ngIf"]},null),(e()(),t._55(-1,2,["\n                "])),(e()(),t._55(-1,null,["\n            "]))],function(e,n){var s=n.component;e(n,3,0,n.context.$implicit.showDate);e(n,6,0,s.unreadMessageFrom&&n.context.$implicit.id==s.unreadMessageFrom),e(n,9,0);e(n,20,0,n.context.$implicit.showUserData);e(n,23,0,n.context.$implicit.showUserData);e(n,26,0,!n.context.$implicit.pending);e(n,29,0,n.context.$implicit.pending);e(n,36,0,n.context.$implicit.text,"system",0);e(n,40,0,!n.context.$implicit.sending&&s.showDelete);e(n,43,0,n.context.$implicit.showTail)},function(e,n){var s=n.component;e(n,8,0,n.context.$implicit.useridfrom==s.currentUserId,n.context.$implicit.useridfrom!=s.currentUserId,!n.context.$implicit.showUserData,n.context.$implicit.useridfrom==s.currentUserId?"":"fromLeft")})}function View_AddonMessagesDiscussionPage_15(e){return t._57(0,[(e()(),t._31(0,0,null,null,16,"ion-fab",[["bottom",""],["core-fab",""],["end",""]],null,null,null,Pe.b,Pe.a)),t._30(1,212992,null,0,De.a,[t.t,ve.a],null,null),t._30(2,1228800,null,2,Ae.a,[G.a],null,null),t._52(335544320,8,{_mainButton:0}),t._52(603979776,9,{_fabLists:1}),(e()(),t._55(-1,0,["\n            "])),(e()(),t._31(6,0,null,0,9,"button",[["color","light"],["ion-fab",""],["mini",""]],[[1,"aria-label",0]],[[null,"click"]],function(e,n,s){var t=!0;if("click"===n){t=!1!==e.component.scrollToFirstUnreadMessage(!0)&&t}return t},ke.b,ke.a)),t._30(7,49152,[[8,4]],0,Ce.a,[ee.a,t.t,t.V],{color:[0,"color"]},null),t._47(131072,ne.a,[se.a,t.j]),(e()(),t._55(-1,0,["\n                "])),(e()(),t._31(10,0,null,0,1,"ion-icon",[["name","arrow-round-down"],["role","img"]],[[2,"hide",null]],null,null,null,null)),t._30(11,147456,null,0,le.a,[ee.a,t.t,t.V],{name:[0,"name"]},null),(e()(),t._55(-1,0,["\n                "])),(e()(),t._31(13,0,null,0,1,"span",[["class","core-discussion-messages-badge"]],null,null,null,null,null)),(e()(),t._55(14,null,["",""])),(e()(),t._55(-1,0,["\n            "])),(e()(),t._55(-1,0,["\n        "]))],function(e,n){e(n,1,0);e(n,7,0,"light");e(n,11,0,"arrow-round-down")},function(e,n){var s=n.component;e(n,6,0,t._56(n,6,0,t._44(n,8).transform("addon.messages.newmessages")));e(n,10,0,t._44(n,11)._hidden);e(n,14,0,s.newMessages)})}function View_AddonMessagesDiscussionPage_16(e){return t._57(0,[(e()(),t._31(0,0,null,null,2,"core-empty-box",[["icon","chatbubbles"]],null,null,null,Ee.b,Ee.a)),t._30(1,49152,null,0,Ve.a,[],{message:[0,"message"],icon:[1,"icon"]},null),t._47(131072,ne.a,[se.a,t.j])],function(e,n){e(n,1,0,t._56(n,1,0,t._44(n,2).transform("addon.messages.nomessagesfound")),"chatbubbles")},null)}function View_AddonMessagesDiscussionPage_18(e){return t._57(0,[(e()(),t._31(0,0,null,null,2,"p",[["margin-horizontal",""],["text-center",""]],null,null,null,null,null)),(e()(),t._55(1,null,["",""])),t._47(131072,ne.a,[se.a,t.j])],null,function(e,n){e(n,1,0,t._56(n,1,0,t._44(n,2).transform("addon.messages.unabletomessage")))})}function View_AddonMessagesDiscussionPage_19(e){return t._57(0,[(e()(),t._31(0,0,null,null,10,"div",[["padding-horizontal",""]],null,null,null,null,null)),(e()(),t._55(-1,null,["\n            "])),(e()(),t._31(2,0,null,null,2,"p",[["text-center",""]],null,null,null,null,null)),(e()(),t._55(3,null,["",""])),t._47(131072,ne.a,[se.a,t.j]),(e()(),t._55(-1,null,["\n            "])),(e()(),t._31(6,0,null,null,3,"button",[["block",""],["ion-button",""],["margin-bottom",""],["text-wrap",""]],null,[[null,"click"]],function(e,n,s){var t=!0;if("click"===n){t=!1!==e.component.unblockUser()&&t}return t},ae.b,ae.a)),t._30(7,1097728,null,0,re.a,[[8,""],ee.a,t.t,t.V],{block:[0,"block"]},null),(e()(),t._55(8,0,["",""])),t._47(131072,ne.a,[se.a,t.j]),(e()(),t._55(-1,null,["\n        "]))],function(e,n){e(n,7,0,"")},function(e,n){e(n,3,0,t._56(n,3,0,t._44(n,4).transform("addon.messages.youhaveblockeduser")));e(n,8,0,t._56(n,8,0,t._44(n,9).transform("addon.messages.unblockuser")))})}function View_AddonMessagesDiscussionPage_20(e){return t._57(0,[(e()(),t._31(0,0,null,null,17,"div",[["padding-horizontal",""]],null,null,null,null,null)),(e()(),t._55(-1,null,["\n            "])),(e()(),t._31(2,0,null,null,4,"p",[["text-center",""]],null,null,null,null,null)),(e()(),t._31(3,0,null,null,3,"strong",[],null,null,null,null,null)),(e()(),t._55(4,null,["",""])),t._48(5,{$a:0}),t._47(131072,ne.a,[se.a,t.j]),(e()(),t._55(-1,null,["\n            "])),(e()(),t._31(8,0,null,null,3,"p",[["text-center",""]],null,null,null,null,null)),(e()(),t._55(9,null,["",""])),t._48(10,{$a:0}),t._47(131072,ne.a,[se.a,t.j]),(e()(),t._55(-1,null,["\n            "])),(e()(),t._31(13,0,null,null,3,"button",[["block",""],["ion-button",""],["margin-bottom",""],["text-wrap",""]],null,[[null,"click"]],function(e,n,s){var t=!0;if("click"===n){t=!1!==e.component.createContactRequest()&&t}return t},ae.b,ae.a)),t._30(14,1097728,null,0,re.a,[[8,""],ee.a,t.t,t.V],{block:[0,"block"]},null),(e()(),t._55(15,0,["",""])),t._47(131072,ne.a,[se.a,t.j]),(e()(),t._55(-1,null,["\n        "]))],function(e,n){e(n,14,0,"")},function(e,n){var s=n.component;e(n,4,0,t._56(n,4,0,t._44(n,6).transform("addon.messages.isnotinyourcontacts",e(n,5,0,s.otherMember.fullname))));e(n,9,0,t._56(n,9,0,t._44(n,11).transform("addon.messages.requirecontacttomessage",e(n,10,0,s.otherMember.fullname))));e(n,15,0,t._56(n,15,0,t._44(n,16).transform("addon.messages.sendcontactrequest")))})}function View_AddonMessagesDiscussionPage_21(e){return t._57(0,[(e()(),t._31(0,0,null,null,16,"div",[["padding-horizontal",""]],null,null,null,null,null)),(e()(),t._55(-1,null,["\n            "])),(e()(),t._31(2,0,null,null,3,"p",[["text-center",""]],null,null,null,null,null)),(e()(),t._55(3,null,["",""])),t._48(4,{$a:0}),t._47(131072,ne.a,[se.a,t.j]),(e()(),t._55(-1,null,["\n            "])),(e()(),t._31(7,0,null,null,3,"button",[["block",""],["ion-button",""],["margin-bottom",""],["text-wrap",""]],null,[[null,"click"]],function(e,n,s){var t=!0;if("click"===n){t=!1!==e.component.confirmContactRequest()&&t}return t},ae.b,ae.a)),t._30(8,1097728,null,0,re.a,[[8,""],ee.a,t.t,t.V],{block:[0,"block"]},null),(e()(),t._55(9,0,["",""])),t._47(131072,ne.a,[se.a,t.j]),(e()(),t._55(-1,null,["\n            "])),(e()(),t._31(12,0,null,null,3,"button",[["block",""],["color","light"],["ion-button",""],["margin-bottom",""],["text-wrap",""]],null,[[null,"click"]],function(e,n,s){var t=!0;if("click"===n){t=!1!==e.component.declineContactRequest()&&t}return t},ae.b,ae.a)),t._30(13,1097728,null,0,re.a,[[8,""],ee.a,t.t,t.V],{color:[0,"color"],block:[1,"block"]},null),(e()(),t._55(14,0,["",""])),t._47(131072,ne.a,[se.a,t.j]),(e()(),t._55(-1,null,["\n        "]))],function(e,n){e(n,8,0,"");e(n,13,0,"light","")},function(e,n){var s=n.component;e(n,3,0,t._56(n,3,0,t._44(n,5).transform("addon.messages.userwouldliketocontactyou",e(n,4,0,s.otherMember.fullname))));e(n,9,0,t._56(n,9,0,t._44(n,10).transform("addon.messages.acceptandaddcontact")));e(n,14,0,t._56(n,14,0,t._44(n,15).transform("addon.messages.decline")))})}function View_AddonMessagesDiscussionPage_22(e){return t._57(0,[(e()(),t._31(0,0,null,null,11,"div",[["padding-horizontal",""]],null,null,null,null,null)),(e()(),t._55(-1,null,["\n            "])),(e()(),t._31(2,0,null,null,3,"p",[["text-center",""]],null,null,null,null,null)),(e()(),t._31(3,0,null,null,2,"strong",[],null,null,null,null,null)),(e()(),t._55(4,null,["",""])),t._47(131072,ne.a,[se.a,t.j]),(e()(),t._55(-1,null,["\n            "])),(e()(),t._31(7,0,null,null,3,"p",[["text-center",""]],null,null,null,null,null)),(e()(),t._55(8,null,["",""])),t._48(9,{$a:0}),t._47(131072,ne.a,[se.a,t.j]),(e()(),t._55(-1,null,["\n        "]))],null,function(e,n){var s=n.component;e(n,4,0,t._56(n,4,0,t._44(n,5).transform("addon.messages.contactrequestsent")));e(n,8,0,t._56(n,8,0,t._44(n,10).transform("addon.messages.yourcontactrequestpending",e(n,9,0,s.otherMember.fullname))))})}function View_AddonMessagesDiscussionPage_23(e){return t._57(0,[(e()(),t._31(0,0,null,null,2,"core-send-message-form",[],null,[[null,"onSubmit"],[null,"onResize"]],function(e,n,s){var t=!0,o=e.component;if("onSubmit"===n){t=!1!==o.sendMessage(s)&&t}if("onResize"===n){t=!1!==o.resizeContent()&&t}return t},xe.b,xe.a)),t._30(1,114688,null,0,Se.a,[m.b,f.b,Ue.b,i.b,a.a,_.b,g.a],{placeholder:[0,"placeholder"],showKeyboard:[1,"showKeyboard"]},{onSubmit:"onSubmit",onResize:"onResize"}),t._47(131072,ne.a,[se.a,t.j])],function(e,n){var s=n.component;e(n,1,0,t._56(n,1,0,t._44(n,2).transform("addon.messages.newmessage")),s.showKeyboard)},null)}function View_AddonMessagesDiscussionPage_17(e){return t._57(0,[(e()(),t._31(0,0,null,null,24,"ion-footer",[["class","footer-adjustable"],["color","light"]],null,null,null,null,null)),t._30(1,16384,null,0,Le.a,[ee.a,t.t,t.V,[2,Re.a]],{color:[0,"color"]},null),(e()(),t._55(-1,null,["\n    "])),(e()(),t._31(3,0,null,null,20,"ion-toolbar",[["class","toolbar"],["color","light"],["position","bottom"]],[[2,"statusbar-padding",null]],null,null,Te.b,Te.a)),t._30(4,49152,null,0,je.a,[ee.a,t.t,t.V],{color:[0,"color"]},null),(e()(),t._55(-1,3,["\n        "])),(e()(),t._26(16777216,null,3,1,null,View_AddonMessagesDiscussionPage_18)),t._30(7,16384,null,0,ue.k,[t._11,t._6],{ngIf:[0,"ngIf"]},null),(e()(),t._55(-1,3,["\n        "])),(e()(),t._26(16777216,null,3,1,null,View_AddonMessagesDiscussionPage_19)),t._30(10,16384,null,0,ue.k,[t._11,t._6],{ngIf:[0,"ngIf"]},null),(e()(),t._55(-1,3,["\n        "])),(e()(),t._26(16777216,null,3,1,null,View_AddonMessagesDiscussionPage_20)),t._30(13,16384,null,0,ue.k,[t._11,t._6],{ngIf:[0,"ngIf"]},null),(e()(),t._55(-1,3,["\n        "])),(e()(),t._26(16777216,null,3,1,null,View_AddonMessagesDiscussionPage_21)),t._30(16,16384,null,0,ue.k,[t._11,t._6],{ngIf:[0,"ngIf"]},null),(e()(),t._55(-1,3,["\n        "])),(e()(),t._26(16777216,null,3,1,null,View_AddonMessagesDiscussionPage_22)),t._30(19,16384,null,0,ue.k,[t._11,t._6],{ngIf:[0,"ngIf"]},null),(e()(),t._55(-1,3,["\n        "])),(e()(),t._26(16777216,null,3,1,null,View_AddonMessagesDiscussionPage_23)),t._30(22,16384,null,0,ue.k,[t._11,t._6],{ngIf:[0,"ngIf"]},null),(e()(),t._55(-1,3,["\n    "])),(e()(),t._55(-1,null,["\n"]))],function(e,n){var s=n.component;e(n,1,0,"light");e(n,4,0,"light");e(n,7,0,"unable"==s.footerType);e(n,10,0,"blocked"==s.footerType);e(n,13,0,"requiresContact"==s.footerType);e(n,16,0,"requestReceived"==s.footerType);e(n,19,0,"requestSent"==s.footerType||"message"==s.footerType&&s.requestContactSent);e(n,22,0,"message"==s.footerType)},function(e,n){e(n,3,0,t._44(n,4)._sbPadding)})}function View_AddonMessagesDiscussionPage_0(e){return t._57(0,[t._47(0,Oe.a,[h.b,qe.a]),t._52(402653184,1,{content:0}),t._52(402653184,2,{infinite:0}),(e()(),t._31(3,0,null,null,80,"ion-header",[],null,null,null,null,null)),t._30(4,16384,null,0,Fe.a,[ee.a,t.t,t.V,[2,Re.a]],null,null),(e()(),t._55(-1,null,["\n    "])),(e()(),t._31(6,0,null,null,26,"ion-navbar",[["class","toolbar"],["core-back-button",""]],[[8,"hidden",0],[2,"statusbar-padding",null]],null,null,Ne.b,Ne.a)),t._30(7,49152,null,0,$e.a,[Be.a,[2,Re.a],[2,Y.a],ee.a,t.t,t.V],null,null),t._30(8,212992,null,0,He.a,[$e.a,G.a,se.a,i.b],null,null),(e()(),t._55(-1,3,["\n        "])),(e()(),t._31(10,0,null,3,17,"ion-title",[],null,null,null,ze.b,ze.a)),t._30(11,49152,null,0,Ge.a,[ee.a,t.t,t.V,[2,je.a],[2,$e.a]],null,null),(e()(),t._55(-1,0,["\n            "])),(e()(),t._26(16777216,null,0,1,null,View_AddonMessagesDiscussionPage_1)),t._30(14,16384,null,0,ue.k,[t._11,t._6],{ngIf:[0,"ngIf"]},null),(e()(),t._55(-1,0,["\n            "])),(e()(),t._26(16777216,null,0,1,null,View_AddonMessagesDiscussionPage_2)),t._30(17,16384,null,0,ue.k,[t._11,t._6],{ngIf:[0,"ngIf"]},null),(e()(),t._55(-1,0,["\n            "])),(e()(),t._31(19,16777216,null,0,1,"core-format-text",[["contextLevel","system"]],null,[[null,"click"]],function(e,n,s){var t=!0,o=e.component;if("click"===n){t=!1!==(o.showInfo&&!o.isGroup&&o.viewInfo())&&t}return t},null,null)),t._30(20,540672,null,0,_e.a,[t.t,a.a,g.a,f.b,se.a,G.a,m.b,X.b,h.b,z.a,_.b,pe.a,[2,Y.a],[2,ve.a],[2,v.a],be.a,i.b,Me.a,ye.a,Ie.a,t._11,we.a],{text:[0,"text"],contextLevel:[1,"contextLevel"],contextInstanceId:[2,"contextInstanceId"]},null),(e()(),t._55(-1,0,["\n            "])),(e()(),t._26(16777216,null,0,1,null,View_AddonMessagesDiscussionPage_3)),t._30(23,16384,null,0,ue.k,[t._11,t._6],{ngIf:[0,"ngIf"]},null),(e()(),t._55(-1,0,["\n            "])),(e()(),t._26(16777216,null,0,1,null,View_AddonMessagesDiscussionPage_4)),t._30(26,16384,null,0,ue.k,[t._11,t._6],{ngIf:[0,"ngIf"]},null),(e()(),t._55(-1,0,["\n        "])),(e()(),t._55(-1,3,["\n        "])),(e()(),t._31(29,0,null,2,2,"ion-buttons",[["end",""]],null,null,null,null,null)),t._30(30,16384,null,1,Xe.a,[ee.a,t.t,t.V,[2,je.a],[2,$e.a]],null,null),t._52(603979776,3,{_buttons:1}),(e()(),t._55(-1,3,["\n    "])),(e()(),t._55(-1,null,["\n    "])),(e()(),t._31(34,0,null,null,48,"core-navbar-buttons",[["end",""]],null,null,null,Ke.b,Ke.a)),t._30(35,245760,null,1,We.a,[t.t,h.b,g.a],null,null),t._52(603979776,4,{buttons:1}),(e()(),t._55(-1,0,["\n        "])),(e()(),t._31(38,0,null,0,43,"core-context-menu",[],null,null,null,Ye.b,Ye.a)),t._30(39,245760,null,0,Je.a,[se.a,Qe.a,t.t,g.a,[2,Ze.a],m.b],{ariaLabel:[0,"ariaLabel"]},null),t._47(131072,ne.a,[se.a,t.j]),(e()(),t._55(-1,0,["\n            "])),(e()(),t._31(42,0,null,0,2,"core-context-menu-item",[["iconAction","information-circle"]],null,[[null,"action"]],function(e,n,s){var t=!0;if("action"===n){t=!1!==e.component.viewInfo()&&t}return t},en.b,en.a)),t._30(43,770048,null,0,nn.a,[Je.a],{content:[0,"content"],iconAction:[1,"iconAction"],priority:[2,"priority"],hidden:[3,"hidden"]},{action:"action"}),t._47(131072,ne.a,[se.a,t.j]),(e()(),t._55(-1,0,["\n            "])),(e()(),t._31(46,0,null,0,2,"core-context-menu-item",[["iconAction","information-circle"]],null,[[null,"action"]],function(e,n,s){var t=!0;if("action"===n){t=!1!==e.component.viewInfo()&&t}return t},en.b,en.a)),t._30(47,770048,null,0,nn.a,[Je.a],{content:[0,"content"],iconAction:[1,"iconAction"],priority:[2,"priority"],hidden:[3,"hidden"]},{action:"action"}),t._47(131072,ne.a,[se.a,t.j]),(e()(),t._55(-1,0,["\n            "])),(e()(),t._31(50,0,null,0,2,"core-context-menu-item",[],null,[[null,"action"]],function(e,n,s){var t=!0;if("action"===n){t=!1!==e.component.changeFavourite(s)&&t}return t},en.b,en.a)),t._30(51,770048,null,0,nn.a,[Je.a],{content:[0,"content"],iconAction:[1,"iconAction"],iconSlash:[2,"iconSlash"],closeOnClick:[3,"closeOnClick"],priority:[4,"priority"],hidden:[5,"hidden"]},{action:"action"}),t._47(131072,ne.a,[se.a,t.j]),(e()(),t._55(-1,0,["\n            "])),(e()(),t._31(54,0,null,0,2,"core-context-menu-item",[],null,[[null,"action"]],function(e,n,s){var t=!0;if("action"===n){t=!1!==e.component.blockUser()&&t}return t},en.b,en.a)),t._30(55,770048,null,0,nn.a,[Je.a],{content:[0,"content"],iconAction:[1,"iconAction"],priority:[2,"priority"],hidden:[3,"hidden"]},{action:"action"}),t._47(131072,ne.a,[se.a,t.j]),(e()(),t._55(-1,0,["\n            "])),(e()(),t._31(58,0,null,0,2,"core-context-menu-item",[],null,[[null,"action"]],function(e,n,s){var t=!0;if("action"===n){t=!1!==e.component.unblockUser()&&t}return t},en.b,en.a)),t._30(59,770048,null,0,nn.a,[Je.a],{content:[0,"content"],iconAction:[1,"iconAction"],priority:[2,"priority"],hidden:[3,"hidden"]},{action:"action"}),t._47(131072,ne.a,[se.a,t.j]),(e()(),t._55(-1,0,["\n            "])),(e()(),t._31(62,0,null,0,2,"core-context-menu-item",[],null,[[null,"action"]],function(e,n,s){var t=!0;if("action"===n){t=!1!==e.component.changeMute(s)&&t}return t},en.b,en.a)),t._30(63,770048,null,0,nn.a,[Je.a],{content:[0,"content"],iconAction:[1,"iconAction"],closeOnClick:[2,"closeOnClick"],priority:[3,"priority"],hidden:[4,"hidden"]},{action:"action"}),t._47(131072,ne.a,[se.a,t.j]),(e()(),t._55(-1,0,["\n            "])),(e()(),t._31(66,0,null,0,2,"core-context-menu-item",[],null,[[null,"action"]],function(e,n,s){var t=!0;if("action"===n){t=!1!==e.component.toggleDelete()&&t}return t},en.b,en.a)),t._30(67,770048,null,0,nn.a,[Je.a],{content:[0,"content"],iconAction:[1,"iconAction"],priority:[2,"priority"],hidden:[3,"hidden"]},{action:"action"}),t._47(131072,ne.a,[se.a,t.j]),(e()(),t._55(-1,0,["\n            "])),(e()(),t._31(70,0,null,0,2,"core-context-menu-item",[],null,[[null,"action"]],function(e,n,s){var t=!0;if("action"===n){t=!1!==e.component.deleteConversation(s)&&t}return t},en.b,en.a)),t._30(71,770048,null,0,nn.a,[Je.a],{content:[0,"content"],iconAction:[1,"iconAction"],closeOnClick:[2,"closeOnClick"],priority:[3,"priority"],hidden:[4,"hidden"]},{action:"action"}),t._47(131072,ne.a,[se.a,t.j]),(e()(),t._55(-1,0,["\n            "])),(e()(),t._31(74,0,null,0,2,"core-context-menu-item",[],null,[[null,"action"]],function(e,n,s){var t=!0;if("action"===n){t=!1!==e.component.createContactRequest()&&t}return t},en.b,en.a)),t._30(75,770048,null,0,nn.a,[Je.a],{content:[0,"content"],iconAction:[1,"iconAction"],priority:[2,"priority"],hidden:[3,"hidden"]},{action:"action"}),t._47(131072,ne.a,[se.a,t.j]),(e()(),t._55(-1,0,["\n            "])),(e()(),t._31(78,0,null,0,2,"core-context-menu-item",[],null,[[null,"action"]],function(e,n,s){var t=!0;if("action"===n){t=!1!==e.component.removeContact()&&t}return t},en.b,en.a)),t._30(79,770048,null,0,nn.a,[Je.a],{content:[0,"content"],iconAction:[1,"iconAction"],iconSlash:[2,"iconSlash"],priority:[3,"priority"],hidden:[4,"hidden"]},{action:"action"}),t._47(131072,ne.a,[se.a,t.j]),(e()(),t._55(-1,0,["\n        "])),(e()(),t._55(-1,0,["\n    "])),(e()(),t._55(-1,null,["\n"])),(e()(),t._55(-1,null,["\n"])),(e()(),t._31(85,0,null,null,27,"ion-content",[["class","has-footer"]],[[2,"statusbar-padding",null],[2,"has-refresher",null]],null,null,sn.b,sn.a)),t._30(86,4374528,[[1,4]],0,ve.a,[ee.a,G.a,tn.a,t.t,t.V,Be.a,on.a,t.M,[2,Re.a],[2,Y.a]],null,null),(e()(),t._55(-1,1,["\n    "])),(e()(),t._31(88,0,null,1,23,"core-loading",[["class","safe-area-page"]],null,null,null,ln.b,ln.a)),t._30(89,638976,null,0,an.a,[se.a,t.t,i.b,m.b],{hideUntil:[0,"hideUntil"]},null),(e()(),t._55(-1,0,["\n        "])),(e()(),t._55(-1,0,["\n        "])),(e()(),t._31(92,0,null,0,1,"core-infinite-loading",[["position","top"]],null,[[null,"action"]],function(e,n,s){var t=!0;if("action"===n){t=!1!==e.component.loadPrevious(s)&&t}return t},rn.b,rn.a)),t._30(93,573440,[[2,4]],0,b.a,[[2,ve.a],g.a],{enabled:[0,"enabled"],error:[1,"error"],position:[2,"position"]},{action:"action"}),(e()(),t._55(-1,0,["\n\n        "])),(e()(),t._26(16777216,null,0,1,null,View_AddonMessagesDiscussionPage_5)),t._30(96,16384,null,0,ue.k,[t._11,t._6],{ngIf:[0,"ngIf"]},null),(e()(),t._55(-1,0,["\n\n        "])),(e()(),t._31(98,0,null,0,5,"ion-list",[["class","addon-messages-discussion-container"]],[[2,"addon-messages-discussion-group",null],[1,"aria-live",0]],null,null,null,null)),t._30(99,16384,null,0,un.a,[ee.a,t.t,t.V,G.a,cn.l,tn.a],null,null),(e()(),t._55(-1,null,["\n            "])),(e()(),t._26(16777216,null,null,1,null,View_AddonMessagesDiscussionPage_6)),t._30(102,802816,null,0,ue.j,[t._11,t._6,t.E],{ngForOf:[0,"ngForOf"]},null),(e()(),t._55(-1,null,["\n        "])),(e()(),t._55(-1,0,["\n        "])),(e()(),t._55(-1,0,["\n        "])),(e()(),t._26(16777216,null,0,1,null,View_AddonMessagesDiscussionPage_15)),t._30(107,16384,null,0,ue.k,[t._11,t._6],{ngIf:[0,"ngIf"]},null),(e()(),t._55(-1,0,["\n        "])),(e()(),t._26(16777216,null,0,1,null,View_AddonMessagesDiscussionPage_16)),t._30(110,16384,null,0,ue.k,[t._11,t._6],{ngIf:[0,"ngIf"]},null),(e()(),t._55(-1,0,["\n    "])),(e()(),t._55(-1,1,["\n"])),(e()(),t._55(-1,null,["\n"])),(e()(),t._26(16777216,null,null,1,null,View_AddonMessagesDiscussionPage_17)),t._30(115,16384,null,0,ue.k,[t._11,t._6],{ngIf:[0,"ngIf"]},null),(e()(),t._55(-1,null,["\n"]))],function(e,n){var s=n.component;e(n,8,0);e(n,14,0,s.loaded&&!s.otherMember&&s.conversationImage);e(n,17,0,s.loaded&&s.otherMember);e(n,20,0,s.title,"system",0);e(n,23,0,s.conversation&&s.conversation.isfavourite);e(n,26,0,s.conversation&&s.conversation.ismuted),e(n,35,0);e(n,39,0,t._56(n,39,0,t._44(n,40).transform("addon.messages.conversationactions")));e(n,43,0,t._56(n,43,0,t._44(n,44).transform("addon.messages.info")),"information-circle",1e3,s.isSelf||!s.showInfo||s.isGroup);e(n,47,0,t._56(n,47,0,t._44(n,48).transform("addon.messages.groupinfo")),"information-circle",1e3,s.isSelf||!s.showInfo||!s.isGroup);e(n,51,0,t._56(n,51,0,t._44(n,52).transform(s.conversation&&s.conversation.isfavourite?"addon.messages.removefromfavourites":"addon.messages.addtofavourites")),s.favouriteIcon,s.favouriteIconSlash,!1,800,!s.groupMessagingEnabled||!s.conversation);e(n,55,0,t._56(n,55,0,t._44(n,56).transform("addon.messages.blockuser")),s.blockIcon,700,s.isSelf||!s.otherMember||s.otherMember.isblocked);e(n,59,0,t._56(n,59,0,t._44(n,60).transform("addon.messages.unblockuser")),s.blockIcon,700,s.isSelf||!s.otherMember||!s.otherMember.isblocked);e(n,63,0,t._56(n,63,0,t._44(n,64).transform(s.conversation&&s.conversation.ismuted?"addon.messages.unmuteconversation":"addon.messages.muteconversation")),s.muteIcon,!1,600,s.isSelf||!s.muteEnabled||!s.conversation);e(n,67,0,t._56(n,67,0,t._44(n,68).transform("addon.messages.showdeletemessages")),s.showDelete?"checkbox-outline":"square-outline",400,!s.canDelete||!s.messages||!s.messages.length);e(n,71,0,t._56(n,71,0,t._44(n,72).transform("addon.messages.deleteconversation")),s.deleteIcon,!1,200,!s.groupMessagingEnabled||!s.conversationId||s.isGroup||!s.messages||!s.messages.length);e(n,75,0,t._56(n,75,0,t._44(n,76).transform("addon.messages.addtoyourcontacts")),s.addRemoveIcon,100,s.isSelf||!s.otherMember||s.otherMember.iscontact||s.requestContactSent||s.requestContactReceived);e(n,79,0,t._56(n,79,0,t._44(n,80).transform("addon.messages.removefromyourcontacts")),s.addRemoveIcon,!0,100,s.isSelf||!s.otherMember||!s.otherMember.iscontact);e(n,89,0,s.loaded);e(n,93,0,s.canLoadMore,s.loadMoreError,"top");e(n,96,0,s.isSelf&&!s.canLoadMore);e(n,102,0,s.messages);e(n,107,0,s.newMessages>0);e(n,110,0,!s.messages||s.messages.length<=0);e(n,115,0,s.loaded&&(!s.conversationId||s.conversation))},function(e,n){var s=n.component;e(n,6,0,t._44(n,7)._hidden,t._44(n,7)._sbPadding);e(n,85,0,t._44(n,86).statusbarPadding,t._44(n,86)._hasRefresher);e(n,98,0,s.isGroup,"polite")})}Object.defineProperty(n,"__esModule",{value:!0});var t=s(0),o=s(5),l=s(3),i=s(9),a=s(1),r=s(163),u=s(383),c=s(495),d=s(46),g=s(4),m=s(2),f=s(11),h=s(6),_=s(10),p=s(745),v=s(28),b=s(275),M=s(196),y=s(13),I=this&&this.__decorate||function(e,n,s,t){var o,l=arguments.length,i=l<3?n:null===t?t=Object.getOwnPropertyDescriptor(n,s):t;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(e,n,s,t);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(i=(l<3?o(i):l>3?o(n,s,i):o(n,s))||i);return l>3&&i&&Object.defineProperty(n,s,i),i},w=this&&this.__metadata||function(e,n){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,n)},P=this&&this.__param||function(e,n){return function(s,t){n(s,t,e)}},D=function(){function AddonMessagesDiscussionPage(e,n,s,t,o,l,i,a,u,d,g,m,f,h,_,p){var v=this;this.eventsProvider=e,this.userProvider=t,this.navCtrl=o,this.messagesSync=l,this.domUtils=i,this.messagesProvider=a,this.utils=d,this.appProvider=g,this.translate=m,this.svComponent=f,this.messagesOffline=h,this.modalCtrl=_,this.textUtils=p,this.unreadMessageFrom=0,this.messagesBeingSent=0,this.pagesLoaded=1,this.lastMessage={text:"",timecreated:0},this.keepMessageMap={},this.oldContentHeight=0,this.scrollBottom=!0,this.viewDestroyed=!1,this.showLoadingModal=!1,this.loaded=!1,this.showKeyboard=!1,this.canLoadMore=!1,this.loadMoreError=!1,this.messages=[],this.showDelete=!1,this.canDelete=!1,this.isGroup=!1,this.members={},this.favouriteIcon="fa-star",this.favouriteIconSlash=!1,this.deleteIcon="trash",this.blockIcon="close-circle",this.addRemoveIcon="person",this.requestContactSent=!1,this.requestContactReceived=!1,this.isSelf=!1,this.muteEnabled=!1,this.muteIcon="volume-off",this.newMessages=0,this.siteId=n.getCurrentSiteId(),this.currentUserId=n.getCurrentSiteUserId(),this.groupMessagingEnabled=this.messagesProvider.isGroupMessagingEnabled(),this.muteEnabled=this.messagesProvider.isMuteConversationEnabled(),this.logger=u.getInstance("AddonMessagesDiscussionPage"),this.conversationId=s.get("conversationId"),this.userId=s.get("userId"),this.showKeyboard=s.get("showKeyboard"),this.syncObserver=e.on(c.a.AUTO_SYNCED,function(e){(e.userId&&e.userId==v.userId||e.conversationId&&e.conversationId==v.conversationId)&&(v.fetchMessages(),e.warnings&&e.warnings[0]&&v.domUtils.showErrorModal(e.warnings[0]))},this.siteId),this.memberInfoObserver=e.on(r.a.MEMBER_INFO_CHANGED_EVENT,function(e){e.userId&&(v.members[e.userId]||v.otherMember&&e.userId==v.otherMember.id)&&v.fetchData()},this.siteId),this.scrollListener=this.scrollListenerFunction.bind(this)}return AddonMessagesDiscussionPage.prototype.addMessage=function(e,n){void 0===n&&(n=!0),e.hash=M.Md5.hashAsciiStr(String(e.id||e.text||""))+"#"+e.timecreated+"#"+e.useridfrom;var s=!1;return void 0===this.keepMessageMap[e.hash]&&(this.messages.push(e),s=e.useridfrom!=this.currentUserId),this.keepMessageMap[e.hash]=n,s},AddonMessagesDiscussionPage.prototype.removeMessage=function(e){if(this.keepMessageMap[e])this.keepMessageMap[e]=!1;else{delete this.keepMessageMap[e];var n=this.messages.findIndex(function(n){return n.hash==e});n>=0&&this.messages.splice(n,1)}},AddonMessagesDiscussionPage.prototype.ionViewDidLoad=function(){var e=this,n=this.navCtrl.getPrevious()&&this.navCtrl.getPrevious().component.name;this.showInfo=!n||"CoreUserProfilePage"!==n,this.keyboardObserver=this.eventsProvider.on(i.b.KEYBOARD_CHANGE,function(n){e.content.resize()}),this.fetchData()},AddonMessagesDiscussionPage.prototype.fetchData=function(){var e,n=this;return this.showLoadingModal&&(e=this.domUtils.showModalLoading()),!this.groupMessagingEnabled&&this.userId&&this.userProvider.getProfile(this.userId,void 0,!0).then(function(e){n.title||(n.title=e.fullname),n.conversationImage=e.profileimageurl}),this.messagesSync.syncDiscussion(this.conversationId,this.userId).catch(function(){}).then(function(e){return e&&e[0]&&n.domUtils.showErrorModal(e[0]),n.groupMessagingEnabled?n.getConversation(n.conversationId,n.userId).then(function(e){var s=[];return e&&s.push(n.fetchMessages()),n.userId?s.push(n.messagesProvider.invalidateMemberInfo(n.userId).catch(function(){}).then(function(){return n.messagesProvider.getMemberInfo(n.userId)}).then(function(s){n.otherMember=s,!e&&s&&(n.conversationImage=s.profileimageurl,n.title=s.fullname),n.blockIcon=n.otherMember&&n.otherMember.isblocked?"checkmark-circle":"close-circle"})):n.otherMember=null,Promise.all(s)}):(n.otherMember=null,n.fetchMessages().then(function(){if(!n.title&&n.messages.length){var e=n.messages[0];n.title=e.useridto!=n.currentUserId?e.usertofullname||"":e.userfromfullname||""}}))}).catch(function(e){n.domUtils.showErrorModalDefault(e,"addon.messages.errorwhileretrievingmessages",!0)}).finally(function(){n.checkCanDelete(),n.resizeContent(),n.loaded=!0,n.setPolling(),n.setContactRequestInfo(),n.setFooterType(),e&&e.dismiss()})},AddonMessagesDiscussionPage.prototype.ionViewDidEnter=function(){this.setPolling()},AddonMessagesDiscussionPage.prototype.ionViewWillLeave=function(){this.unsetPolling()},AddonMessagesDiscussionPage.prototype.fetchMessages=function(e){var n=this;return void 0===e&&(e=!0),this.loadMoreError=!1,this.messagesBeingSent>0?Promise.reject(null):this.fetching?Promise.reject(null):this.groupMessagingEnabled&&!this.conversationId?Promise.reject(null):(this.logger.debug(this.conversationId?"Polling new messages for conversation '"+this.conversationId+"'":"Polling new messages for discussion with user '"+this.userId+"'"),this.fetching=!0,this.messagesSync.waitForSyncConversation(this.conversationId,this.userId).then(function(){return n.groupMessagingEnabled?n.messagesProvider.invalidateConversationMessages(n.conversationId).catch(function(){}).then(function(){return n.getConversationMessages(n.pagesLoaded)}):n.messagesProvider.invalidateDiscussionCache(n.userId).catch(function(){}).then(function(){return n.getDiscussionMessages(n.pagesLoaded)})}).then(function(s){n.loadMessages(s,e)}).finally(function(){n.fetching=!1}))},AddonMessagesDiscussionPage.prototype.loadMessages=function(e,n){var s=this;if(void 0===n&&(n=!0),!this.viewDestroyed){var t=this.content&&this.content.getScrollElement()?this.content.getScrollElement().scrollHeight:0;if(this.scrollBottom=Math.abs(t-this.domUtils.getScrollTop(this.content)-this.domUtils.getContentHeight(this.content))<5,!(this.messagesBeingSent>0)){var o=e.reduce(function(e,n){return e+(s.addMessage(n)?1:0)},0);n&&this.setNewMessagesBadge(this.newMessages+o);for(var l in this.keepMessageMap)this.removeMessage(l);this.messagesProvider.sortMessages(this.messages),this.messages.forEach(function(e,n){e.showDate=s.showDate(e,s.messages[n-1]),e.showUserData=s.showUserData(e,s.messages[n-1]),e.showTail=s.showTail(e,s.messages[n+1])}),this.content&&this.content.resize();var i=this.messages[this.messages.length-1],a=this.groupMessagingEnabled&&i&&i.useridfrom!=this.currentUserId&&""!=this.lastMessage.text&&(i.text!==this.lastMessage.text||i.timecreated!==this.lastMessage.timecreated);this.notifyNewMessage(),this.markMessagesAsRead(a)}}},AddonMessagesDiscussionPage.prototype.setNewMessagesBadge=function(e){0==this.newMessages&&e>0?(this.content.getScrollElement().addEventListener("scroll",this.scrollListener),this.scrollListenerFunction()):this.newMessages>0&&0==e&&this.content.getScrollElement().removeEventListener("scroll",this.scrollListener),this.newMessages=e},AddonMessagesDiscussionPage.prototype.scrollListenerFunction=function(){if(this.newMessages>0){if(this.domUtils.getScrollTop(this.content)+this.domUtils.getContentHeight(this.content)>this.domUtils.getScrollHeight(this.content)-40)return void this.setNewMessagesBadge(0);var e=this.content.getScrollElement().getBoundingClientRect(),n=e&&e.bottom||0;if(0==n)return;var s=Array.from(document.querySelectorAll(".addon-message-not-mine")).slice(-this.newMessages).reverse().findIndex(function(e,s){var t=e.getBoundingClientRect();return!!t&&t.bottom<=n});s>0&&s<this.newMessages&&this.setNewMessagesBadge(s)}},AddonMessagesDiscussionPage.prototype.getConversation=function(e,n){var s,t,o=this;if(e)s=Promise.resolve(e);else{s=(n==this.currentUserId&&this.messagesProvider.isSelfConversationEnabled()?this.messagesProvider.getSelfConversation():this.messagesProvider.getConversationBetweenUsers(n,void 0,!0)).then(function(e){return t=e,e.id})}return s.then(function(e){return o.messagesProvider.invalidateConversation(e).catch(function(){}).then(function(){return o.messagesProvider.getConversation(e,void 0,!0)}).catch(function(e){return t||Promise.reject(e)}).then(function(e){return o.conversation=e,!!e&&(o.conversationId=e.id,o.title=e.name,o.conversationImage=e.imageurl,o.isGroup=e.type==r.a.MESSAGE_CONVERSATION_TYPE_GROUP,o.favouriteIcon="fa-star",o.favouriteIconSlash=e.isfavourite,o.muteIcon=e.ismuted?"volume-up":"volume-off",o.isGroup||(o.userId=e.userid),o.isSelf=e.type==r.a.MESSAGE_CONVERSATION_TYPE_SELF,!0)})},function(e){return o.isSelf=n==o.currentUserId,o.messagesOffline.getMessages(n).then(function(n){if(n&&n.length)n.forEach(function(e){e.pending=!0,e.text=e.smallmessage}),o.loadMessages(n);else if("errorconversationdoesnotexist"!=e.errorcode)return Promise.reject(e);return!1})})},AddonMessagesDiscussionPage.prototype.getConversationMessages=function(e,n){var s=this;void 0===n&&(n=0);return this.messagesProvider.getConversationMessages(this.conversationId,n>0,n).then(function(t){return e--,t.members&&t.members.forEach(function(e){s.members[e.id]=e}),e>0&&t.canLoadMore?(n+=r.a.LIMIT_MESSAGES,s.getConversationMessages(e,n).then(function(e){return t.messages.concat(e)})):(s.canLoadMore=t.canLoadMore,t.messages)})},AddonMessagesDiscussionPage.prototype.getDiscussionMessages=function(e,n,s,t,o){var l=this;void 0===n&&(n=0),void 0===s&&(s=0),void 0===t&&(t=0),void 0===o&&(o=0);return this.messagesProvider.getDiscussion(this.userId,n>0||s>0||t>0||o>0,n,s,t,o).then(function(i){return--e>0&&i.canLoadMore?(i.messages.forEach(function(e){e.pending||(e.useridfrom==l.userId?e.read?s++:n++:e.read?o++:t++)}),l.getDiscussionMessages(e,n,s,t,o).then(function(e){return i.messages.concat(e)})):(l.canLoadMore=i.canLoadMore,i.messages)})},AddonMessagesDiscussionPage.prototype.markMessagesAsRead=function(e){var n=this,s=!1,t=[];if(this.messagesProvider.isMarkAllMessagesReadEnabled()){var o=!1;if(e)o=!0;else if(this.groupMessagingEnabled)o=this.conversation&&this.conversation.unreadcount>0&&this.conversationId>0;else for(var l in this.messages){var i=this.messages[l];if(i.useridfrom!=this.currentUserId&&0==i.read){o=!0;break}}if(o){this.setUnreadLabelPosition();var a=void 0;a=this.groupMessagingEnabled?this.messagesProvider.markAllConversationMessagesRead(this.conversationId):this.messagesProvider.markAllMessagesRead(this.userId).then(function(){n.messages.forEach(function(e){e.read=1})}),t.push(a.then(function(){s=!0}))}}else this.setUnreadLabelPosition(),this.messages.forEach(function(e){e.useridfrom!=n.currentUserId&&0==e.read&&t.push(n.messagesProvider.markMessageRead(e.id).then(function(){s=!0,e.read=1}))});Promise.all(t).finally(function(){s&&n.eventsProvider.trigger(r.a.READ_CHANGED_EVENT,{conversationId:n.conversationId,userId:n.userId},n.siteId)})},AddonMessagesDiscussionPage.prototype.notifyNewMessage=function(){var e=this.messages[this.messages.length-1],n=!1;if(e?e.text===this.lastMessage.text&&e.timecreated===this.lastMessage.timecreated||(this.lastMessage={text:e.text,timecreated:e.timecreated},n=!0):(this.lastMessage={text:"",timecreated:0},n=!0),n){this.eventsProvider.trigger(r.a.NEW_MESSAGE_EVENT,{conversationId:this.conversationId,userId:this.userId,message:this.lastMessage.text,timecreated:this.lastMessage.timecreated,isfavourite:this.conversation&&this.conversation.isfavourite,type:this.conversation&&this.conversation.type},this.siteId);this.canDelete!=(e&&e.id&&1==this.messages.length||this.messages.length>1)&&this.checkCanDelete()}},AddonMessagesDiscussionPage.prototype.setUnreadLabelPosition=function(){if(0==this.unreadMessageFrom){if(this.groupMessagingEnabled){if(this.conversation&&this.conversation.unreadcount>0&&this.messages)for(var e=0,n=this.messages.length-1;n>=0;n--){if(!(o=this.messages[n]).pending&&o.useridfrom!=this.currentUserId&&++e==this.conversation.unreadcount){this.unreadMessageFrom=Number(o.id);break}}}else{var s=!1;for(var t in this.messages){var o;if((o=this.messages[t]).useridfrom!=this.currentUserId){if(0==o.read&&s){this.unreadMessageFrom=Number(o.id);break}s=0!=o.read}}}0==this.unreadMessageFrom&&(this.unreadMessageFrom=-1)}},AddonMessagesDiscussionPage.prototype.checkCanDelete=function(){var e=this.messages[0];this.canDelete=e&&!e.sending},AddonMessagesDiscussionPage.prototype.hideUnreadLabel=function(){this.unreadMessageFrom>0&&(this.unreadMessageFrom=-1)},AddonMessagesDiscussionPage.prototype.waitForFetch=function(){var e=this;if(!this.fetching)return Promise.resolve();var n=this.utils.promiseDefer();return setTimeout(function(){return e.waitForFetch().finally(function(){n.resolve()})},400),n.promise},AddonMessagesDiscussionPage.prototype.setPolling=function(){var e=this;this.groupMessagingEnabled&&!this.conversationId||this.polling||(this.polling=setInterval(function(){e.fetchMessages().catch(function(){})},r.a.POLL_INTERVAL))},AddonMessagesDiscussionPage.prototype.unsetPolling=function(){this.polling&&(this.logger.debug("Cancelling polling for conversation with user '"+this.userId+"'"),clearInterval(this.polling),this.polling=void 0)},AddonMessagesDiscussionPage.prototype.copyMessage=function(e){var n=this.textUtils.decodeHTMLEntities(e.smallmessage||e.text||"");this.utils.copyToClipboard(n)},AddonMessagesDiscussionPage.prototype.deleteMessage=function(e,n){var s=this,t=this.conversation&&this.conversation.candeletemessagesforallusers,o=e.pending||t||this.isSelf?"core.areyousure":"addon.messages.deletemessageconfirmation",l={};t&&!e.pending&&(l.inputs=[{type:"checkbox",name:"deleteforall",checked:!1,value:!0,label:this.translate.instant("addon.messages.deleteforeveryone")}]),this.domUtils.showConfirm(this.translate.instant(o),void 0,void 0,void 0,l).then(function(t){var o=s.domUtils.showModalLoading("core.deleting",!0);return s.messagesProvider.deleteMessage(e,t&&t[0]).then(function(){s.messages.splice(n,1),s.removeMessage(e.hash),s.notifyNewMessage(),s.fetchMessages()}).finally(function(){o.dismiss()})}).catch(function(e){s.domUtils.showErrorModalDefault(e,"addon.messages.errordeletemessage",!0)})},AddonMessagesDiscussionPage.prototype.loadPrevious=function(e){var n=this,s=this.infinite?this.infinite.getHeight():0,t=this.domUtils.getScrollHeight(this.content);return this.waitForFetch().finally(function(){n.pagesLoaded++,n.fetchMessages(!1).then(function(){var e=t-n.domUtils.getScrollTop(n.content);n.canLoadMore&&s&&n.infinite?s-=n.infinite.getHeight():n.canLoadMore||(s=s||(n.infinite?n.infinite.getHeight():0)),n.keepScroll(t,e,s)}).catch(function(e){n.loadMoreError=!0,n.pagesLoaded--,n.domUtils.showErrorModalDefault(e,"addon.messages.errorwhileretrievingmessages",!0)}).finally(function(){e&&e()})})},AddonMessagesDiscussionPage.prototype.keepScroll=function(e,n,s,t){var o=this;t=t||0,setTimeout(function(){var l=o.domUtils.getScrollHeight(o.content);if(l!=e){o.domUtils.scrollTo(o.content,0,l-n+s,0)}else t<=10&&o.keepScroll(e,n,s,t+1)},30)},AddonMessagesDiscussionPage.prototype.resizeContent=function(){var e=this,n=this.content.getContentDimensions().scrollTop;this.content.resize(),setTimeout(function(){!e.viewDestroyed&&e.content&&e.domUtils.getContentHeight(e.content)!=e.oldContentHeight&&(n||(n=e.content.getContentDimensions().scrollTop),n+=e.oldContentHeight-e.domUtils.getContentHeight(e.content),e.oldContentHeight=e.domUtils.getContentHeight(e.content),e.domUtils.scrollTo(e.content,0,n,0))})},AddonMessagesDiscussionPage.prototype.scrollToBottom=function(){var e=this;this.scrollBottom&&(setTimeout(function(){e.viewDestroyed||e.domUtils.scrollToBottom(e.content,0)}),this.scrollBottom=!1,this.setNewMessagesBadge(0))},AddonMessagesDiscussionPage.prototype.scrollToFirstUnreadMessage=function(){if(this.newMessages>0){var e=Array.from(document.querySelectorAll(".addon-message-not-mine"));this.domUtils.scrollToElement(this.content,e[e.length-this.newMessages])}},AddonMessagesDiscussionPage.prototype.sendMessage=function(e){var n,s=this;this.hideUnreadLabel(),this.showDelete=!1,this.scrollBottom=!0,this.setNewMessagesBadge(0),(n={id:null,pending:!0,sending:!0,useridfrom:this.currentUserId,smallmessage:e,text:e,timecreated:(new Date).getTime()}).showDate=this.showDate(n,this.messages[this.messages.length-1]),this.addMessage(n,!1),this.messagesBeingSent++,this.waitForFetch().finally(function(){(s.conversationId?s.messagesProvider.sendMessageToConversation(s.conversation,e):s.messagesProvider.sendMessage(s.userId,e)).then(function(e){s.messagesBeingSent--,(e.sent?!s.conversationId&&e.message&&e.message.conversationid?s.getConversation(e.message.conversationid,s.userId).then(function(){return s.fetchMessages()}).finally(function(){s.setPolling()}):s.fetchMessages():Promise.reject(null)).catch(function(){n.sending=!1,e.sent?n.pending=!1:e.message&&(n.timecreated=e.message.timecreated),s.notifyNewMessage()})}).catch(function(e){s.messagesBeingSent--,s.appProvider.closeKeyboard(),s.domUtils.showErrorModalDefault(e,"addon.messages.messagenotsent",!0),s.removeMessage(n.hash)})})},AddonMessagesDiscussionPage.prototype.showDate=function(e,n){return!n||!y(e.timecreated).isSame(n.timecreated,"day")},AddonMessagesDiscussionPage.prototype.showUserData=function(e,n){return this.isGroup&&e.useridfrom!=this.currentUserId&&this.members[e.useridfrom]&&(!n||n.useridfrom!=e.useridfrom||e.showDate)},AddonMessagesDiscussionPage.prototype.showTail=function(e,n){return!n||n.useridfrom!=e.useridfrom||n.showDate},AddonMessagesDiscussionPage.prototype.toggleDelete=function(){this.showDelete=!this.showDelete},AddonMessagesDiscussionPage.prototype.viewInfo=function(){var e=this;if(this.isGroup){var n=this.modalCtrl.create("AddonMessagesConversationInfoPage",{conversationId:this.conversationId});n.present(),n.onDidDismiss(function(n){void 0!==n&&(e.svComponent?e.eventsProvider.trigger(r.a.OPEN_CONVERSATION_EVENT,{userId:n},e.siteId):e.navCtrl.push("AddonMessagesDiscussionPage",{userId:n}))})}else{(this.svComponent?this.svComponent.getMasterNav():this.navCtrl).push("CoreUserProfilePage",{userId:this.userId})}},AddonMessagesDiscussionPage.prototype.changeFavourite=function(e){var n=this;this.favouriteIcon="spinner",this.messagesProvider.setFavouriteConversation(this.conversation.id,!this.conversation.isfavourite).then(function(){n.conversation.isfavourite=!n.conversation.isfavourite,n.messagesProvider.getConversation(n.conversation.id,void 0,!0),n.eventsProvider.trigger(r.a.UPDATE_CONVERSATION_LIST_EVENT,{conversationId:n.conversation.id,action:"favourite",value:n.conversation.isfavourite},n.siteId)}).catch(function(e){n.domUtils.showErrorModalDefault(e,"Error changing favourite state.")}).finally(function(){n.favouriteIcon="fa-star",n.favouriteIconSlash=n.conversation.isfavourite,e&&e()})},AddonMessagesDiscussionPage.prototype.changeMute=function(e){var n=this;this.muteIcon="spinner",this.messagesProvider.muteConversation(this.conversation.id,!this.conversation.ismuted).then(function(){n.conversation.ismuted=!n.conversation.ismuted,n.messagesProvider.getConversation(n.conversation.id,void 0,!0),n.eventsProvider.trigger(r.a.UPDATE_CONVERSATION_LIST_EVENT,{conversationId:n.conversation.id,action:"mute",value:n.conversation.ismuted},n.siteId)}).catch(function(e){n.domUtils.showErrorModalDefault(e,"Error changing muted state.")}).finally(function(){n.muteIcon=n.conversation.ismuted?"volume-up":"volume-off",e&&e()})},AddonMessagesDiscussionPage.prototype.setContactRequestInfo=function(){var e=this;this.requestContactSent=!1,this.requestContactReceived=!1,this.otherMember&&!this.otherMember.iscontact&&(this.requestContactSent=this.otherMember.contactrequests.some(function(n){return n.userid==e.currentUserId&&n.requesteduserid==e.otherMember.id}),this.requestContactReceived=this.otherMember.contactrequests.some(function(n){return n.userid==e.otherMember.id&&n.requesteduserid==e.currentUserId}))},AddonMessagesDiscussionPage.prototype.setFooterType=function(){this.footerType=this.otherMember?this.otherMember.isblocked?"blocked":this.requestContactReceived?"requestReceived":this.otherMember.canmessage?"message":this.requestContactSent?"requestSent":this.otherMember.requirescontact?"requiresContact":"unable":"message"},AddonMessagesDiscussionPage.prototype.blockUser=function(){var e=this;if(!this.otherMember)return Promise.reject(null);var n=this.translate.instant("addon.messages.blockuserconfirm",{$a:this.otherMember.fullname}),s=this.translate.instant("addon.messages.blockuser");return this.domUtils.showConfirm(n,void 0,s).then(function(){e.blockIcon="spinner";var n=e.domUtils.showModalLoading("core.sending",!0);return e.showLoadingModal=!0,e.messagesProvider.blockContact(e.otherMember.id).finally(function(){n.dismiss(),e.showLoadingModal=!1})}).catch(function(n){e.domUtils.showErrorModalDefault(n,"core.error",!0)}).finally(function(){e.blockIcon=e.otherMember.isblocked?"close-circle":"checkmark-circle"})},AddonMessagesDiscussionPage.prototype.deleteConversation=function(e){var n=this;this.domUtils.showDeleteConfirm("addon.messages."+(this.isSelf?"deleteallselfconfirm":"deleteallconfirm")).then(function(){return n.deleteIcon="spinner",n.messagesProvider.deleteConversation(n.conversation.id).then(function(){n.eventsProvider.trigger(r.a.UPDATE_CONVERSATION_LIST_EVENT,{conversationId:n.conversation.id,action:"delete"},n.siteId),n.messages=[]}).finally(function(){n.deleteIcon="trash",e&&e()})}).catch(function(e){n.domUtils.showErrorModalDefault(e,"Error deleting conversation.")})},AddonMessagesDiscussionPage.prototype.unblockUser=function(){var e=this;if(!this.otherMember)return Promise.reject(null);var n=this.translate.instant("addon.messages.unblockuserconfirm",{$a:this.otherMember.fullname}),s=this.translate.instant("addon.messages.unblockuser");return this.domUtils.showConfirm(n,void 0,s).then(function(){e.blockIcon="spinner";var n=e.domUtils.showModalLoading("core.sending",!0);return e.showLoadingModal=!0,e.messagesProvider.unblockContact(e.otherMember.id).finally(function(){n.dismiss(),e.showLoadingModal=!1})}).catch(function(n){e.domUtils.showErrorModalDefault(n,"core.error",!0)}).finally(function(){e.blockIcon=e.otherMember.isblocked?"close-circle":"checkmark-circle"})},AddonMessagesDiscussionPage.prototype.createContactRequest=function(){var e=this;if(!this.otherMember)return Promise.reject(null);var n=this.translate.instant("addon.messages.addcontactconfirm",{$a:this.otherMember.fullname}),s=this.translate.instant("core.add");return this.domUtils.showConfirm(n,void 0,s).then(function(){e.addRemoveIcon="spinner";var n=e.domUtils.showModalLoading("core.sending",!0);return e.showLoadingModal=!0,e.messagesProvider.createContactRequest(e.otherMember.id).finally(function(){n.dismiss(),e.showLoadingModal=!1})}).catch(function(n){e.domUtils.showErrorModalDefault(n,"core.error",!0)}).finally(function(){e.addRemoveIcon="person"})},AddonMessagesDiscussionPage.prototype.confirmContactRequest=function(){var e=this;if(!this.otherMember)return Promise.reject(null);var n=this.domUtils.showModalLoading("core.sending",!0);return this.showLoadingModal=!0,this.messagesProvider.confirmContactRequest(this.otherMember.id).finally(function(){n.dismiss(),e.showLoadingModal=!1}).catch(function(n){e.domUtils.showErrorModalDefault(n,"core.error",!0)})},AddonMessagesDiscussionPage.prototype.declineContactRequest=function(){var e=this;if(!this.otherMember)return Promise.reject(null);var n=this.domUtils.showModalLoading("core.sending",!0);return this.showLoadingModal=!0,this.messagesProvider.declineContactRequest(this.otherMember.id).finally(function(){n.dismiss(),e.showLoadingModal=!1}).catch(function(n){e.domUtils.showErrorModalDefault(n,"core.error",!0)})},AddonMessagesDiscussionPage.prototype.removeContact=function(){var e=this;if(!this.otherMember)return Promise.reject(null);var n=this.translate.instant("addon.messages.removecontactconfirm",{$a:this.otherMember.fullname}),s=this.translate.instant("core.remove");return this.domUtils.showConfirm(n,void 0,s).then(function(){e.addRemoveIcon="spinner";var n=e.domUtils.showModalLoading("core.sending",!0);return e.showLoadingModal=!0,e.messagesProvider.removeContact(e.otherMember.id).finally(function(){n.dismiss(),e.showLoadingModal=!1})}).catch(function(n){e.domUtils.showErrorModalDefault(n,"core.error",!0)}).finally(function(){e.addRemoveIcon="person"})},AddonMessagesDiscussionPage.prototype.ngOnDestroy=function(){this.unsetPolling(),this.syncObserver&&this.syncObserver.off(),this.keyboardObserver&&this.keyboardObserver.off(),this.memberInfoObserver&&this.memberInfoObserver.off(),this.viewDestroyed=!0},I([Object(t._9)(o.f),w("design:type",o.f)],AddonMessagesDiscussionPage.prototype,"content",void 0),I([Object(t._9)(b.a),w("design:type",b.a)],AddonMessagesDiscussionPage.prototype,"infinite",void 0),AddonMessagesDiscussionPage=I([Object(t.m)({selector:"page-addon-messages-discussion",templateUrl:"discussion.html",animations:[p.b]}),P(12,Object(t.N)()),w("design:paramtypes",[i.b,a.a,o.t,d.a,o.s,c.a,g.a,r.a,h.b,m.b,_.b,l.c,v.a,u.a,o.q,f.b])],AddonMessagesDiscussionPage)}(),A=s(26),k=s(32),C=s(108),E=this&&this.__decorate||function(e,n,s,t){var o,l=arguments.length,i=l<3?n:null===t?t=Object.getOwnPropertyDescriptor(n,s):t;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(e,n,s,t);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(i=(l<3?o(i):l>3?o(n,s,i):o(n,s))||i);return l>3&&i&&Object.defineProperty(n,s,i),i},V=function(){function AddonMessagesDiscussionPageModule(){}return AddonMessagesDiscussionPageModule=E([Object(t.I)({declarations:[D],imports:[A.a,k.a,C.a,o.l.forChild(D),l.b.forChild()]})],AddonMessagesDiscussionPageModule)}(),x=s(1528),S=s(1529),U=s(1530),L=s(1531),R=s(1532),T=s(1533),j=s(1534),O=s(1535),q=s(1536),F=s(1537),N=s(1538),$=s(1539),B=s(1540),H=s(231),z=s(17),G=s(15),X=s(22),K=s(216),W=s(184),Y=s(20),J=s(162),Q=s(84),Z=s(77),ee=s(8),ne=s(25),se=s(18),te=s(772),oe=s(68),le=s(48),ie=s(251),ae=s(47),re=s(44),ue=s(7),ce=s(31),de=s(1586),ge=s(21),me=s(19),fe=s(27),he=s(33),_e=s(49),pe=s(14),ve=s(29),be=s(43),Me=s(41),ye=s(30),Ie=s(36),we=s(39),Pe=s(283),De=s(257),Ae=s(220),ke=s(284),Ce=s(192),Ee=s(126),Ve=s(117),xe=s(2140),Se=s(1556),Ue=s(128),Le=s(739),Re=s(40),Te=s(2136),je=s(250),Oe=s(230),qe=s(24),Fe=s(373),Ne=s(723),$e=s(214),Be=s(35),He=s(472),ze=s(724),Ge=s(317),Xe=s(374),Ke=s(99),We=s(90),Ye=s(93),Je=s(81),Qe=s(71),Ze=s(79),en=s(94),nn=s(86),sn=s(183),tn=s(34),on=s(109),ln=s(56),an=s(53),rn=s(375),un=s(89),cn=s(45),dn=s(70),gn=s(164),mn=t._29({encapsulation:2,styles:[],data:{animation:[{type:7,name:"coreSlideInOut",definitions:[{type:1,expr:"void => fromLeft",animation:[{type:6,styles:{transform:"translateX(0)",opacity:1},offset:null},{type:4,styles:{type:5,steps:[{type:6,styles:{opacity:0,transform:"translateX(-100%)",offset:0},offset:null},{type:6,styles:{opacity:1,transform:"translateX(5%)",offset:.7},offset:null},{type:6,styles:{opacity:1,transform:"translateX(0)",offset:1},offset:null}]},timings:300}],options:null},{type:1,expr:"fromLeft => void",animation:[{type:6,styles:{transform:"translateX(-100%)",opacity:0},offset:null},{type:4,styles:{type:5,steps:[{type:6,styles:{opacity:1,transform:"translateX(0)",offset:0},offset:null},{type:6,styles:{opacity:1,transform:"translateX(5%)",offset:.3},offset:null},{type:6,styles:{opacity:0,transform:"translateX(-100%)",offset:1},offset:null}]},timings:300}],options:null},{type:1,expr:"void => fromRight",animation:[{type:6,styles:{transform:"translateX(0)",opacity:1},offset:null},{type:4,styles:{type:5,steps:[{type:6,styles:{opacity:0,transform:"translateX(100%)",offset:0},offset:null},{type:6,styles:{opacity:1,transform:"translateX(-5%)",offset:.7},offset:null},{type:6,styles:{opacity:1,transform:"translateX(0)",offset:1},offset:null}]},timings:300}],options:null},{type:1,expr:"fromRight => void",animation:[{type:6,styles:{transform:"translateX(-100%)",opacity:0},offset:null},{type:4,styles:{type:5,steps:[{type:6,styles:{opacity:1,transform:"translateX(0)",offset:0},offset:null},{type:6,styles:{opacity:1,transform:"translateX(-5%)",offset:.3},offset:null},{type:6,styles:{opacity:0,transform:"translateX(100%)",offset:1},offset:null}]},timings:300}],options:null}],options:{}}]}}),fn=t._27("page-addon-messages-discussion",D,function View_AddonMessagesDiscussionPage_Host_0(e){return t._57(0,[(e()(),t._31(0,0,null,null,1,"page-addon-messages-discussion",[],null,null,null,View_AddonMessagesDiscussionPage_0,mn)),t._30(1,180224,null,0,D,[i.b,a.a,dn.a,d.a,Y.a,c.a,g.a,r.a,h.b,m.b,_.b,se.a,[2,v.a],u.a,gn.a,f.b],null,null)],null,null)},{},{},[]),hn=s(23),_n=s(369),pn=s(370),vn=s(372),bn=s(371),Mn=s(471),yn=s(722),In=s(272);s.d(n,"AddonMessagesDiscussionPageModuleNgFactory",function(){return wn});var wn=t._28(V,[],function(e){return t._40([t._41(512,t.o,t._21,[[8,[x.a,S.a,U.a,L.a,R.a,T.a,j.a,O.a,q.a,F.a,N.a,$.a,B.a,fn]],[3,t.o],t.K]),t._41(4608,ue.m,ue.l,[t.G,[2,ue.w]]),t._41(4608,hn.x,hn.x,[]),t._41(4608,hn.d,hn.d,[]),t._41(4608,_n.b,_n.a,[]),t._41(4608,pn.a,pn.b,[]),t._41(4608,vn.b,vn.a,[]),t._41(4608,bn.b,bn.a,[]),t._41(4608,se.a,se.a,[Mn.a,_n.b,pn.a,vn.b,bn.b,se.b,se.c]),t._41(512,ue.b,ue.b,[]),t._41(512,hn.v,hn.v,[]),t._41(512,hn.i,hn.i,[]),t._41(512,hn.s,hn.s,[]),t._41(512,yn.a,yn.a,[]),t._41(512,l.b,l.b,[]),t._41(512,k.a,k.a,[]),t._41(512,C.a,C.a,[]),t._41(512,A.a,A.a,[]),t._41(512,yn.b,yn.b,[]),t._41(512,V,V,[]),t._41(256,se.c,void 0,[]),t._41(256,se.b,void 0,[]),t._41(256,In.a,D,[])])})},2136:function(e,n,s){"use strict";function View_Toolbar_0(e){return t._57(2,[(e()(),t._31(0,0,null,null,1,"div",[["class","toolbar-background"]],null,null,null,null,null)),t._30(1,278528,null,0,o.i,[t.E,t.F,t.t,t.W],{klass:[0,"klass"],ngClass:[1,"ngClass"]},null),t._43(null,0),t._43(null,1),t._43(null,2),(e()(),t._31(5,0,null,null,2,"div",[["class","toolbar-content"]],null,null,null,null,null)),t._30(6,278528,null,0,o.i,[t.E,t.F,t.t,t.W],{klass:[0,"klass"],ngClass:[1,"ngClass"]},null),t._43(null,3)],function(e,n){var s=n.component;e(n,1,0,"toolbar-background","toolbar-background-"+s._mode);e(n,6,0,"toolbar-content","toolbar-content-"+s._mode)},null)}s.d(n,"a",function(){return a}),n.b=View_Toolbar_0;var t=s(0),o=s(7),l=s(250),i=s(8),a=t._29({encapsulation:2,styles:[],data:{}});t._27("ion-toolbar",l.a,function View_Toolbar_Host_0(e){return t._57(0,[(e()(),t._31(0,0,null,null,1,"ion-toolbar",[["class","toolbar"]],[[2,"statusbar-padding",null]],null,null,View_Toolbar_0,a)),t._30(1,49152,null,0,l.a,[i.a,t.t,t.V],null,null)],null,function(e,n){e(n,0,0,t._44(n,1)._sbPadding)})},{color:"color",mode:"mode"},{},["[menuToggle],ion-buttons[left]","ion-buttons[start]","ion-buttons[end],ion-buttons[right]","*"])},2140:function(e,n,s){"use strict";function View_CoreSendMessageFormComponent_0(e){return t._57(0,[t._52(402653184,1,{formElement:0}),(e()(),t._31(1,0,[[1,0],["messageForm",1]],null,28,"form",[["novalidate",""]],[[2,"ng-untouched",null],[2,"ng-touched",null],[2,"ng-pristine",null],[2,"ng-dirty",null],[2,"ng-valid",null],[2,"ng-invalid",null],[2,"ng-pending",null]],[[null,"submit"],[null,"reset"]],function(e,n,s){var o=!0;if("submit"===n){o=!1!==t._44(e,3).onSubmit(s)&&o}if("reset"===n){o=!1!==t._44(e,3).onReset()&&o}return o},null,null)),t._30(2,16384,null,0,o.w,[],null,null),t._30(3,4210688,null,0,o.p,[[8,null],[8,null]],null,null),t._50(2048,null,o.b,null,[o.p]),t._30(5,16384,null,0,o.o,[o.b],null,null),(e()(),t._55(-1,null,["\n    "])),(e()(),t._31(7,0,null,null,7,"textarea",[["aria-multiline","true"],["class","core-send-message-input"],["core-auto-rows",""],["name","message"],["rows","1"]],[[8,"placeholder",0],[2,"ng-untouched",null],[2,"ng-touched",null],[2,"ng-pristine",null],[2,"ng-dirty",null],[2,"ng-valid",null],[2,"ng-invalid",null],[2,"ng-pending",null]],[[null,"ngModelChange"],[null,"onResize"],[null,"keydown.enter"],[null,"keydown.control.enter"],[null,"keydown.meta.enter"],[null,"input"],[null,"blur"],[null,"compositionstart"],[null,"compositionend"],[null,"change"]],function(e,n,s){var o=!0,l=e.component;if("input"===n){o=!1!==t._44(e,8)._handleInput(s.target.value)&&o}if("blur"===n){o=!1!==t._44(e,8).onTouched()&&o}if("compositionstart"===n){o=!1!==t._44(e,8)._compositionStart()&&o}if("compositionend"===n){o=!1!==t._44(e,8)._compositionEnd(s.target.value)&&o}if("input"===n){o=!1!==t._44(e,14).onInput()&&o}if("change"===n){o=!1!==t._44(e,14).onChange()&&o}if("ngModelChange"===n){o=!1!==(l.message=s)&&o}if("onResize"===n){o=!1!==l.textareaResized()&&o}if("keydown.enter"===n){o=!1!==l.enterClicked(s)&&o}if("keydown.control.enter"===n){o=!1!==l.enterClicked(s,"control")&&o}if("keydown.meta.enter"===n){o=!1!==l.enterClicked(s,"meta")&&o}return o},null,null)),t._30(8,16384,null,0,o.c,[t.W,t.t,[2,o.a]],null,null),t._50(1024,null,o.l,function(e){return[e]},[o.c]),t._30(10,671744,null,0,o.q,[[2,o.b],[8,null],[8,null],[2,o.l]],{name:[0,"name"],model:[1,"model"]},{update:"ngModelChange"}),t._50(2048,null,o.m,null,[o.q]),t._30(12,16384,null,0,o.n,[o.m],null,null),t._30(13,81920,null,0,l.a,[t.t,i.a,a.b,[2,r.a]],{coreAutoFocus:[0,"coreAutoFocus"]},null),t._30(14,4210688,null,0,u.a,[t.t],null,{onResize:"onResize"}),(e()(),t._55(-1,null,["\n    "])),(e()(),t._31(16,0,null,null,12,"ion-buttons",[["end",""]],null,null,null,null,null)),t._30(17,16384,null,1,c.a,[d.a,t.t,t.V,[2,g.a],[2,m.a]],null,null),t._52(603979776,2,{_buttons:1}),(e()(),t._55(-1,null,["\n        "])),(e()(),t._31(20,0,null,null,7,"button",[["clear","true"],["icon-only",""],["ion-button",""],["type","submit"]],[[8,"disabled",0],[1,"aria-label",0]],[[null,"onClick"]],function(e,n,s){var t=!0;if("onClick"===n){t=!1!==e.component.submitForm(s)&&t}return t},f.b,f.a)),t._30(21,1097728,[[2,4]],0,h.a,[[8,""],d.a,t.t,t.V],{clear:[0,"clear"]},null),t._30(22,81920,null,0,_.a,[t.t],null,{onClick:"onClick"}),t._47(131072,p.a,[v.a,t.j]),(e()(),t._55(-1,0,["\n            "])),(e()(),t._31(25,0,null,0,1,"ion-icon",[["color","dark"],["name","send"],["role","img"]],[[2,"hide",null]],null,null,null,null)),t._30(26,147456,null,0,b.a,[d.a,t.t,t.V],{color:[0,"color"],name:[1,"name"]},null),(e()(),t._55(-1,0,["\n        "])),(e()(),t._55(-1,null,["\n    "])),(e()(),t._55(-1,null,["\n"])),(e()(),t._55(-1,null,["\n"]))],function(e,n){var s=n.component;e(n,10,0,"message",s.message);e(n,13,0,s.showKeyboard);e(n,21,0,"true"),e(n,22,0);e(n,26,0,"dark","send")},function(e,n){var s=n.component;e(n,1,0,t._44(n,5).ngClassUntouched,t._44(n,5).ngClassTouched,t._44(n,5).ngClassPristine,t._44(n,5).ngClassDirty,t._44(n,5).ngClassValid,t._44(n,5).ngClassInvalid,t._44(n,5).ngClassPending);e(n,7,0,s.placeholder,t._44(n,12).ngClassUntouched,t._44(n,12).ngClassTouched,t._44(n,12).ngClassPristine,t._44(n,12).ngClassDirty,t._44(n,12).ngClassValid,t._44(n,12).ngClassInvalid,t._44(n,12).ngClassPending);e(n,20,0,!s.message||s.sendDisabled,t._56(n,20,1,t._44(n,23).transform("core.send")));e(n,25,0,t._44(n,26)._hidden)})}s.d(n,"a",function(){return A}),n.b=View_CoreSendMessageFormComponent_0;var t=s(0),o=s(23),l=s(378),i=s(4),a=s(2),r=s(20),u=s(382),c=s(374),d=s(8),g=s(250),m=s(214),f=s(47),h=s(44),_=s(490),p=s(25),v=s(18),b=s(48),M=s(1556),y=s(11),I=s(128),w=s(9),P=s(1),D=s(10),A=t._29({encapsulation:2,styles:[],data:{}});t._27("core-send-message-form",M.a,function View_CoreSendMessageFormComponent_Host_0(e){return t._57(0,[(e()(),t._31(0,0,null,null,1,"core-send-message-form",[],null,null,null,View_CoreSendMessageFormComponent_0,A)),t._30(1,114688,null,0,M.a,[a.b,y.b,I.b,w.b,P.a,D.b,i.a],null,null)],function(e,n){e(n,1,0)},null)},{message:"message",placeholder:"placeholder",showKeyboard:"showKeyboard",sendDisabled:"sendDisabled"},{onSubmit:"onSubmit",onResize:"onResize"},[])}});