2021-11-11 22:06:49 +01:00
/*! For license information please see converse.min.js.LICENSE.txt */
2022-01-03 11:54:10 +01:00
( ( ) => { var e , t , n , s , i = { 4567 : ( e , t , n ) => { "use strict" ; const s = n ( 4095 ) , i = n ( 257 ) ; e . exports = { atob : s , btoa : i } } , 4095 : e => { "use strict" ; function t ( e ) { const t = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/" . indexOf ( e ) ; return t < 0 ? void 0 : t } e . exports = function ( e ) { if ( ( e = ( e = ` ${ e } ` ) . replace ( /[ \t\n\f\r]/g , "" ) ) . length % 4 == 0 && ( e = e . replace ( /==?$/ , "" ) ) , e . length % 4 == 1 || /[^+/0-9A-Za-z]/ . test ( e ) ) return null ; let n = "" , s = 0 , i = 0 ; for ( let r = 0 ; r < e . length ; r ++ ) s <<= 6 , s |= t ( e [ r ] ) , i += 6 , 24 === i && ( n += String . fromCharCode ( ( 16711680 & s ) >> 16 ) , n += String . fromCharCode ( ( 65280 & s ) >> 8 ) , n += String . fromCharCode ( 255 & s ) , s = i = 0 ) ; return 12 === i ? ( s >>= 4 , n += String . fromCharCode ( s ) ) : 18 === i && ( s >>= 2 , n += String . fromCharCode ( ( 65280 & s ) >> 8 ) , n += String . fromCharCode ( 255 & s ) ) , n } } , 257 : e => { "use strict" ; function t ( e ) { if ( e >= 0 && e < 64 ) return "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/" [ e ] } e . exports = function ( e ) { let n ; for ( e = ` ${ e } ` , n = 0 ; n < e . length ; n ++ ) if ( e . charCodeAt ( n ) > 255 ) return null ; let s = "" ; for ( n = 0 ; n < e . length ; n += 3 ) { const i = [ void 0 , void 0 , void 0 , void 0 ] ; i [ 0 ] = e . charCodeAt ( n ) >> 2 , i [ 1 ] = ( 3 & e . charCodeAt ( n ) ) << 4 , e . length > n + 1 && ( i [ 1 ] |= e . charCodeAt ( n + 1 ) >> 4 , i [ 2 ] = ( 15 & e . charCodeAt ( n + 1 ) ) << 2 ) , e . length > n + 2 && ( i [ 2 ] |= e . charCodeAt ( n + 2 ) >> 6 , i [ 3 ] = 63 & e . charCodeAt ( n + 2 ) ) ; for ( let e = 0 ; e < i . length ; e ++ ) void 0 === i [ e ] ? s += "=" : s += t ( i [ e ] ) } return s } } , 6561 : ( e , t , n ) => { e . exports = { default : n ( 1966 ) , _ _esModule : ! 0 } } , 5460 : ( e , t , n ) => { e . exports = { default : n ( 4064 ) , _ _esModule : ! 0 } } , 9251 : ( e , t , n ) => { e . exports = { default : n ( 9791 ) , _ _esModule : ! 0 } } , 1683 : ( e , t , n ) => { "use strict" ; t . _ _esModule = ! 0 ; var s , i = ( s = n ( 9251 ) ) && s . _ _esModule ? s : { default : s } ; t . default = function ( e ) { return function ( ) { var t = e . apply ( this , arguments ) ; return new i . default ( ( function ( e , n ) { return function s ( r , o ) { try { var a = t [ r ] ( o ) , c = a . value } catch ( e ) { return void n ( e ) } if ( ! a . done ) return i . default . resolve ( c ) . then ( ( function ( e ) { s ( "next" , e ) } ) , ( function ( e ) { s ( "throw" , e ) } ) ) ; e ( c ) } ( "next" ) } ) ) } } } , 8339 : ( e , t , n ) => { "use strict" ; t . _ _esModule = ! 0 ; var s , i = ( s = n ( 6561 ) ) && s . _ _esModule ? s : { default : s } ; t . default = function ( e , t , n ) { return t in e ? ( 0 , i . default ) ( e , t , { value : n , enumerable : ! 0 , configurable : ! 0 , writable : ! 0 } ) : e [ t ] = n , e } } , 342 : ( e , t , n ) => { var s = function ( ) { return this } ( ) || Function ( "return this" ) ( ) , i = s . regeneratorRuntime && Object . getOwnPropertyNames ( s ) . indexOf ( "regeneratorRuntime" ) >= 0 , r = i && s . regeneratorRuntime ; if ( s . regeneratorRuntime = void 0 , e . exports = n ( 5987 ) , i ) s . regeneratorRuntime = r ; else try { delete s . regeneratorRuntime } catch ( e ) { s . regeneratorRuntime = void 0 } } , 5987 : e => { ! function ( t ) { "use strict" ; var n , s = Object . prototype , i = s . hasOwnProperty , r = "function" == typeof Symbol ? Symbol : { } , o = r . iterator || "@@iterator" , a = r . asyncIterator || "@@asyncIterator" , c = r . toStringTag || "@@toStringTag" , l = t . regeneratorRuntime ; if ( l ) e . exports = l ; else { ( l = t . regeneratorRuntime = e . exports ) . wrap = b ; var d = "suspendedStart" , u = "suspendedYield" , h = "executing" , f = "completed" , m = { } , g = { } ; g [ o ] = function ( ) { return this } ; var p = Object . getPrototypeOf , v = p && p ( p ( N ( [ ] ) ) ) ; v && v !== s && i . call ( v , o ) && ( g = v ) ; var y = x . prototype = w . prototype = Object . create ( g ) ; S . prototype = y . constructor = x , x . constructor = S , x [ c ] = S . displayName = "GeneratorFunction" , l . isGeneratorFunction = function ( e ) { var t = "function" == typeof e && e . constructor ; return ! ! t && ( t === S || "GeneratorFunction" === ( t . displayName || t . name ) ) } , l . mark = function ( e ) { return Object . setPrototypeOf ? Object . setPrototypeOf ( e , x ) : ( e . _ _proto _ _ = x , c in e || ( e [ c ] = "GeneratorFunction" ) ) , e . prototype = Object . create ( y ) , e } , l . awrap = function ( e ) { return { _ _await : e } } , E ( A . prototype ) , A . prototype [ a ] = function ( ) { return this } , l . AsyncIterator = A , l . async = function ( e , t , n , s ) { var i = new A ( b ( e , t , n , s ) ) ; return l . isGeneratorFunction ( t ) ? i : i . next ( ) . then ( ( function ( e ) { return e . done ? e . value : i . next ( ) } ) ) } , E ( y ) , y [ c ] = "Generator" , y [ o ] = function ( ) { return this } , y . toString = function ( ) { return "[object Generator]" } , l . keys = function ( e ) { var t = [ ] ; for ( var n in e ) t . push ( n ) ; return t . reverse ( ) , function n ( ) { for ( ; t . length ; ) { var s = t . pop ( ) ; if ( s in e ) return n . value = s , n . done = ! 1 , n } return n . done = ! 0 , n } } , l . values = N , j . prototype = { constructor : j , reset : function ( e ) { if ( this . prev = 0 , this . next = 0 , this . sent = this . _sent = n , this . done = ! 1 , this . delegate = null , this . method = "next" , this . arg = n , this . tryEntries . forEach ( k ) , ! e ) for ( var t in this ) "t" === t . charAt ( 0 ) && i . call ( this
2021-03-19 19:26:15 +01:00
draggable = "false"
2021-11-11 22:06:49 +01:00
title = "${s}"
2021-03-19 19:26:15 +01:00
alt = "${n}"
2022-01-03 11:54:10 +01:00
src = "${t}/72x72/${e.cp}.png" / > ` }}return t.unicode_only?s:el ` < img class = "emoji"
2021-03-19 19:26:15 +01:00
draggable = "false"
2021-11-11 22:06:49 +01:00
title = "${s}"
alt = "${s}"
2022-01-03 11:54:10 +01:00
src = "${$l.emojis.by_sn[s].url}" > ` }function fu(e){if(! $ l.emojis.initialized)throw new Error("getShortnameReferences called before emojis are initialized. To avoid this problem, first await the converse.emojis.initilaized_promise.");return[...e.matchAll( $ l.emojis.shortnames_regex)].filter((e=>e[0].length>0)).map((e=>{const t= $ l.emojis.by_sn[e[0]].cp;return{cp:t,begin:e.index,end:e.index+e[0].length,shortname:e[0],emoji:t?du(t):null}}))}function mu(e){const t=[];return function(e,n){const s=/ \u FE0F/g,i=String.fromCharCode(8205);String(e).replace(au,((e,n,r)=>{const o=function(e){const t=[];let n=0,s=0;for(;s<e.length;){const i=e.charCodeAt(s++);n?(t.push((65536+(n-55296<<10)+(i-56320)).toString(16)),n=0):55296<=i&&i<=56319?n=i:t.push(i.toString(16))}return t.join("-")}(e.indexOf(i)<0?e.replace(s,""):e);o&&((e,n,s)=>{var i;t.push({begin:s,cp:e,emoji:n,end:s+n.length,shortname:(null===(i=cu.getEmojisByAtrribute("cp")[e])||void 0===i?void 0:i.sn)||""})})(o,e,r)}))}(e),t} $ l.plugins.add("converse-emoji",{initialize(){const{___:e}=wa;jl.settings.extend({emoji_image_path:"https://twemoji.maxcdn.com/v/12.1.6/",emoji_categories:{smileys:":grinning:",people:":thumbsup:",activity:":soccer:",travel:":motorcycle:",objects:":bomb:",nature:":rainbow:",food:":hotdog:",symbols:":musical_note:",flags:":flag_ac:",custom:null},emoji_category_labels:{smileys:e("Smileys and emotions"),people:e("People"),activity:e("Activities"),travel:e("Travel"),objects:e("Objects"),nature:e("Animals and nature"),food:e("Food and drink"),symbols:e("Symbols"),flags:e("Flags"),custom:e("Stickers")}}),wa.EmojiPicker=Xo.extend({defaults:{current_category:"smileys",current_skintone:"",scroll_position:0}});const t={};Object.assign(cu,{shortnamesToEmojis:(e,t={unicode_only:!1,add_title_wrapper:!1})=>function(e,t){let n=[e];return[...fu(e),...mu(e)].sort(((e,t)=>t.begin-e.begin)).forEach((e=>{const s=n.shift(),i=hu(e,t);n="string"==typeof i?[s.slice(0,e.begin)+i+s.slice(e.end),...n]:[s.slice(0,e.begin),i,s.slice(e.end),...n]})),n}(e=uu(e),t),shortnamesToUnicode:e=>cu.shortnamesToEmojis(e,{unicode_only:!0})[0],isOnlyEmojis(e){const t=e.trim().split(/ \s +/);return!(0===t.length||t.length>3)&&t.filter((e=>{const t=mu(cu.shortnamesToUnicode(e));return 1===t.length&&(e===t[0].shortname||e===t[0].emoji)})).length===t.length},getEmojisByAtrribute(e){if(t[e])return t[e];if("category"===e)return $ l.emojis.json;const n= $ l.emojis.list.map((t=>t[e])).filter(((e,t,n)=>n.indexOf(e)==t));return t[e]={},n.forEach((n=>t[e][n]= $ l.emojis.list.find((t=>t[e]===n)))),t[e]}}),Object.assign(jl,{emojis:{async initialize(){if(! $ l.emojis.initialized){ $ l.emojis.initialized=!0;const{default:t}=await n.e(4610).then(n.t.bind(n,7530,19)); $ l.emojis.json=t, $ l.emojis.by_sn=Object.keys(t).reduce(((e,n)=>Object.assign(e,t[n])),{}), $ l.emojis.list=Object.values( $ l.emojis.by_sn), $ l.emojis.list.sort(((e,t)=>e.sn<t.sn?-1:e.sn>t.sn?1:0)), $ l.emojis.shortnames= $ l.emojis.list.map((e=>e.sn));const s=()=> $ l.emojis.shortnames.map((e=>e.replace(/[+]/g," \\ $ &"))).join("|"); $ l.emojis.shortnames_regex=new RegExp(s(),"gi"), $ l.emojis.toned=( $ l.emojis.toned||( $ l.emojis.toned=(e=Object.values( $ l.emojis.json.people).filter((e=>e.sn.includes("_tone"))).map((e=>e.sn.replace(/_tone[1-5]/,""))),[...new Set(e)])), $ l.emojis.toned), $ l.emojis.initialized_promise.resolve()}var e;return $ l.emojis.initialized_promise}}})}});const gu={initialize(){this.checkValidity()&&(this.get("file")&&this.on("change:put",this.uploadFile,this),this.setTimerForEphemeralMessage()||this.setOccupant(),jl.trigger("chatRoomMessageInitialized",this))},getDisplayName(){var e;return(null===(e=this.occupant)||void 0===e?void 0:e.getDisplayName())||this.get("nick")},mayBeModerated(){if(void 0!==this.get("from_muc"))return["all","moderator"].includes(jl.settings.get("allow_message_retraction"))&&this.get( ` stanza _id $ { this . get ( "from_muc" ) } ` )&&this.collection.chatbox.canModerateMessages()},checkValidity(){const e=wa.Message.prototype.checkValidity.call(this);return!e&&this.collection.chatbox.debouncedRejoin(),e},onOccupantRemoved(){var e;this.stopListeni
2021-03-19 19:26:15 +01:00
< form class = "converse-form chatroom-form" @ submit = $ { e . onSubmit } >
< legend > $ { t } < / l e g e n d >
< fieldset class = "form-group" >
< label for = "converse_muc_bookmark_name" > $ { i } < / l a b e l >
< input class = "form-control" type = "text" value = "${e.name}" name = "name" required = "required" id = "converse_muc_bookmark_name" / >
< / f i e l d s e t >
< fieldset class = "form-group" >
2021-11-11 22:06:49 +01:00
< label for = "converse_muc_bookmark_nick" > $ { r } < / l a b e l >
2021-03-19 19:26:15 +01:00
< input class = "form-control" type = "text" name = "nick" value = "${e.nick||" "}" id = "converse_muc_bookmark_nick" / >
< / f i e l d s e t >
< fieldset class = "form-group form-check" >
< input class = "form-check-input" id = "converse_muc_bookmark_autojoin" type = "checkbox" name = "autojoin" / >
< label class = "form-check-label" for = "converse_muc_bookmark_autojoin" > $ { n } < / l a b e l >
< / f i e l d s e t >
< fieldset class = "form-group" >
< input class = "btn btn-primary" type = "submit" value = "${o}" >
2021-11-11 22:06:49 +01:00
< input class = "btn btn-secondary button-cancel" type = "button" value = "${s}" @ click = $ { e . onCancel } >
2021-03-19 19:26:15 +01:00
< / f i e l d s e t >
< / f o r m >
2022-01-03 11:54:10 +01:00
` })(Object.assign(this.model.toJSON(),{onCancel:e=>this.closeBookmarkForm(e),onSubmit:e=>this.onBookmarkFormSubmitted(e)}))}onBookmarkFormSubmitted(e){var t,n,s;e.preventDefault(),wa.bookmarks.createBookmark({jid:this.model.get("jid"),autojoin:(null===(t=e.target.querySelector('input[name="autojoin"]'))||void 0===t?void 0:t.checked)||!1,name:null===(n=e.target.querySelector("input[name=name]"))||void 0===n?void 0:n.value,nick:null===(s=e.target.querySelector("input[name=nick]"))||void 0===s?void 0:s.value}),this.closeBookmarkForm(e)}closeBookmarkForm(e){e.preventDefault(),this.model.session.save("view",null)}}jl.elements.define("converse-muc-bookmark-form",_g);const wg=_g,Sg=Je((function(e,t,n){var s=-1,i="function"==typeof t,r=Ze(e)?Array(e.length):[];return ls(e,(function(e){r[++s]=i?ze(t,e,n):Ca(e,t,n)})),r}));function xg(e,t){if(jl.settings.get("allow_bookmarks")&&e.model.get("type")===wa.CHATROOMS_TYPE){const n=e.model.get("bookmarked"),s={i18n_title:Eh(n?"Unbookmark this groupchat":"Bookmark this groupchat"),i18n_text:Eh(n?"Unbookmark":"Bookmark"),handler:t=>e.toggleBookmark(t),a_class:"toggle-bookmark",icon_class:"fa-bookmark",name:"bookmark"},i=t.map((e=>e.name)).indexOf("details"),r=Nh().then((e=>e?s:null));return i>-1?[...t.slice(0,i),r,...t.slice(i)]:[r,...t]}return t}function Eg(e){e.preventDefault();const t=e.target.getAttribute("data-bookmark-name"),n=e.target.getAttribute("data-room-jid");confirm(Eh('Are you sure you want to remove the bookmark "%1 $ s"?',t))&&Sg(wa.bookmarks.where({jid:n}),Xo.prototype.destroy)}async function Ag(e){e.preventDefault();const t=e.target.getAttribute("data-room-jid");(await jl.rooms.open(t,{bring_to_foreground:!0})).session.save("view", $ l.MUC.VIEWS.BOOKMARK)}function Cg(e){e.preventDefault();const{Strophe:t}= $ l.env,n=e.target.textContent,s=e.target.getAttribute("data-room-jid"),i={name:n||t.unescapeNode(t.getNodeFromJid(s))||s};jl.rooms.open(s,i,!0)}const Tg=e=>{const t=e.bm.get("jid"),n=!(!jl.settings.get("hide_open_bookmarks")||!wa.chatboxes.get(t)),s=Eh("Unbookmark this groupchat"),i=Eh("Click to open this groupchat");return el `
2021-11-11 22:06:49 +01:00
< div class = "list-item controlbox-padded room-item available-chatroom d-flex flex-row ${n?" hidden ":" "}" data - room - jid = "${t}" >
< a class = "list-item-link open-room w-100" data - room - jid = "${t}"
title = "${i}"
2022-01-03 11:54:10 +01:00
@ click = $ { Cg } > $ { e . bm . getDisplayName ( ) } < / a >
2021-11-11 22:06:49 +01:00
< a class = "list-item-action remove-bookmark fa fa-bookmark align-self-center ${e.bm.get(" bookmarked ")?" button - on ":" "}"
data - room - jid = "${t}"
data - bookmark - name = "${e.bm.getDisplayName()}"
title = "${s}"
2022-01-03 11:54:10 +01:00
@ click = $ { Eg } > < / a >
2021-11-11 22:06:49 +01:00
< / d i v >
2022-01-03 11:54:10 +01:00
` };"undefined"!=typeof Element&&Element.prototype;const kg=/^( \S +) \s *(.*) $ /,jg=["model","collection","events"];class Ng extends HTMLElement{constructor(e){var t,n,s;super(),s={},(n="events")in(t=this)?Object.defineProperty(t,n,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[n]=s,this.cid=Ts("view"),this._domEvents=[],Ct(this,jo(e,jg))}createRenderRoot(){return this}connectedCallback(){this._initialized||(this.preinitialize.apply(this,arguments),this.initialize.apply(this,arguments),this._initialized=!0),this.delegateEvents()}disconnectedCallback(){this.undelegateEvents(),this.stopListening()}preinitialize(){}initialize(){}render(){return ve(this.beforeRender)&&this.beforeRender(),ve(this.toHTML)&&il(this.toHTML(),this),ve(this.afterRender)&&this.afterRender(),this}delegateEvents(){if(!this.events)return this;this.undelegateEvents();for(const e in this.events){let t=this.events[e];if(ve(t)||(t=this[t]),!t)continue;const n=e.match(kg);this.delegate(n[1],n[2],t.bind(this))}return this}delegate(e,t,n){const s=this;if(!s)return this;if("function"==typeof t&&(n=t,t=null),-1!==["focus","blur"].indexOf(e)){const s=this.querySelectorAll(t);for(let t=0,i=s.length;t<i;t++){const i=s[t];i.addEventListener(e,n,!1),this._domEvents.push({el:i,eventName:e,handler:n})}return n}const i=t?function(e){let i=e.target||e.srcElement;for(;i&&i!=s;i=i.parentNode)i.matches(t)&&(e.delegateTarget=i,n(e))}:n;return this.addEventListener(e,i,!1),this._domEvents.push({el:this,eventName:e,handler:i,listener:n,selector:t}),this}undelegateEvents(){if(this){for(let e=0,t=this._domEvents.length;e<t;e++){const t=this._domEvents[e];t.el.removeEventListener(t.eventName,t.handler,!1)}this._domEvents.length=0}return this}undelegate(e,t,n){if("function"==typeof t&&(n=t,t=null),this){const s=this._domEvents.slice();let i=s.length;for(;i--;){const r=s[i];!(r.eventName!==e||n&&r.listener!==n||t&&r.selector!==t)&&(r.el.removeEventListener(r.eventName,r.handler,!1),this._domEvents.splice(i,1))}}return this}}Object.assign(Ng.prototype,ks);const Og= $ l.env.utils;class $ g extends Ng{async initialize(){await jl.waitUntil("bookmarksInitialized"),this.listenTo(wa.bookmarks,"add",this.render),this.listenTo(wa.bookmarks,"remove",this.render),this.listenTo(wa.chatboxes,"add",this.render),this.listenTo(wa.chatboxes,"remove",this.render);const e= ` converse . bookmarks - list - model - $ { wa . bare _jid } ` ;this.model=new wa.BookmarksList({id:e}),_o(this.model,e),this.model.fetch({success:()=>this.render(),error:(e,t)=>{M.error(t),this.render()}})}render(){il((e=>{const t=!!wa.bookmarks.getUnopenedBookmarks().length,n=Eh("Click to toggle the bookmarks list"),s=Eh("Bookmarks");return el `
2021-11-11 22:06:49 +01:00
< div class = "list-container list-container--bookmarks ${t?" ":" hidden "}" >
< a class = "list-toggle bookmarks-toggle controlbox-padded"
title = "${n}"
@ click = $ { e . toggleBookmarksList } >
2022-01-03 11:54:10 +01:00
< span class = "fa ${e.toggle_state===wa.OPENED?" fa - caret - down ":" fa - caret - right "}" >
2021-11-11 22:06:49 +01:00
< / s p a n > $ { s } < / a >
2022-01-03 11:54:10 +01:00
< div class = "items-list bookmarks rooms-list ${e.toggle_state!==wa.OPENED?" hidden ":" "}" >
$ { wa . bookmarks . map ( ( t => Tg ( Object . assign ( { bm : t } , e ) ) ) ) }
2021-11-11 22:06:49 +01:00
< / d i v >
< / d i v >
2022-01-03 11:54:10 +01:00
` })({toggleBookmarksList:e=>this.toggleBookmarksList(e),toggle_state:this.model.get("toggle-state")}),this)}toggleBookmarksList(e){var t;null==e||null===(t=e.preventDefault)||void 0===t||t.call(e);const n=e.target.matches(".fa")?e.target:e.target.querySelector(".fa");Og.hasClass("fa-caret-down",n)?(Og.slideIn(this.querySelector(".bookmarks")),this.model.save({"toggle-state":wa.CLOSED}),n.classList.remove("fa-caret-down"),n.classList.add("fa-caret-right")):(n.classList.remove("fa-caret-right"),n.classList.add("fa-caret-down"),Og.slideOut(this.querySelector(".bookmarks")),this.model.save({"toggle-state":wa.OPENED}))}}jl.elements.define("converse-bookmarks", $ g);const{u:Ig}= $ l.env,Mg={setBookmarkState(){void 0!==wa.bookmarks&&(wa.bookmarks.where({jid:this.model.get("jid")}).length?this.model.save("bookmarked",!0):this.model.save("bookmarked",!1))},renderBookmarkForm(){this.bookmark_form||(this.bookmark_form=new wa.MUCBookmarkForm({model:this.model,chatroomview:this}),this.querySelector(".chatroom-body").insertAdjacentElement("beforeend",this.bookmark_form.el)),Ig.showElement(this.bookmark_form.el)},toggleBookmark(e){null==e||e.preventDefault();const t=wa.bookmarks.where({jid:this.model.get("jid")});t.length?t.forEach((e=>e.destroy())):this.model.session.set("view", $ l.MUC.VIEWS.BOOKMARK)}};var Rg=n(5251),Dg={};Dg.styleTagTransform=vg(),Dg.setAttributes=fg(),Dg.insert=ug().bind(null,"head"),Dg.domAPI=lg(),Dg.insertStyleElement=gg(),ag()(Rg.Z,Dg),Rg.Z&&Rg.Z.locals&&Rg.Z.locals, $ l.plugins.add("converse-bookmark-views",{dependencies:["converse-chatboxes","converse-muc","converse-muc-views"],initialize(){jl.settings.extend({hide_open_bookmarks:!0}),wa.removeBookmarkViaEvent=Eg,wa.addBookmarkViaEvent=Ag,Object.assign(wa.ChatRoomView.prototype,Mg),wa.MUCBookmarkForm=wg,wa.BookmarksView= $ g,jl.listen.on("getHeadingButtons",xg),jl.listen.on("chatRoomViewInitialized",(e=>e.setBookmarkState()))}});const Lg=e=>(...t)=>({_ $ litDirective $ :e,values:t});class zg{constructor(e){}T(e,t,n){this.Σdt=e,this.M=t,this.Σct=n}S(e,t){return this.update(e,t)}update(e,t){return this.render(...t)}}const{et:Pg}=pl,Fg=()=>document.createComment(""),Ug=(e,t,n)=>{var s;const i=e.A.parentNode,r=void 0===t?e.B:t.A;if(void 0===n){const t=i.insertBefore(Fg(),r),s=i.insertBefore(Fg(),r);n=new Pg(t,s,e,e.options)}else{const t=n.B.nextSibling,o=n.M!==e;if(o&&(null===(s=n.Q)||void 0===s||s.call(n,e),n.M=e),t!==r||o){let e=n.A;for(;e!==t;){const t=e.nextSibling;i.insertBefore(e,r),e=t}}}return n},Bg=(e,t,n=e)=>(e.I(t,n),e),qg={},Hg=e=>{var t;null===(t=e.P)||void 0===t||t.call(e,!1,!0);let n=e.A;const s=e.B.nextSibling;for(;n!==s;){const e=n.nextSibling;n.remove(),n=e}},Gg=(e,t,n)=>{const s=new Map;for(let i=t;i<=n;i++)s.set(e[i],i);return s},Wg=Lg(class extends zg{constructor(e){if(super(e),2!==e.type)throw Error("repeat() can only be used in text expressions")}Mt(e,t,n){let s;void 0===n?n=t:void 0!==t&&(s=t);const i=[],r=[];let o=0;for(const t of e)i[o]=s?s(t,o):o,r[o]=n(t,o),o++;return{values:r,keys:i}}render(e,t,n){return this.Mt(e,t,n).values}update(e,[t,n,s]){var i;const r=(e=>e.H)(e),{values:o,keys:a}=this.Mt(t,n,s);if(!r)return this.Pt=a,o;const c=null!==(i=this.Pt)&&void 0!==i?i:this.Pt=[],l=[];let d,u,h=0,f=r.length-1,m=0,g=o.length-1;for(;h<=f&&m<=g;)if(null===r[h])h++;else if(null===r[f])f--;else if(c[h]===a[m])l[m]=Bg(r[h],o[m]),h++,m++;else if(c[f]===a[g])l[g]=Bg(r[f],o[g]),f--,g--;else if(c[h]===a[g])l[g]=Bg(r[h],o[g]),Ug(e,l[g+1],r[h]),h++,g--;else if(c[f]===a[m])l[m]=Bg(r[f],o[m]),Ug(e,r[h],r[f]),f--,m++;else if(void 0===d&&(d=Gg(a,m,g),u=Gg(c,h,f)),d.has(c[h]))if(d.has(c[f])){const t=u.get(a[m]),n=void 0!==t?r[t]:null;if(null===n){const t=Ug(e,r[h]);Bg(t,o[m]),l[m]=t}else l[m]=Bg(n,o[m]),Ug(e,r[h],n),r[t]=null;m++}else Hg(r[f]),f--;else Hg(r[h]),h++;for(;m<=g;){const t=Ug(e,l[g+1]);Bg(t,o[m]),l[m++]=t}for(;h<=f;){const e=r[h++];null!==e&&Hg(e)}return this.Pt=a,((e,t=qg)=>{e.H=t})(e,l),tl}});function Vg(e){const{CONTROLBOX_TYPE:t}=wa,n="overlayed"===jl.settings.get("view_mode")&&e.get("minimized");return e.get("type")===t||!(e.get("hidden")||n)}j
2021-11-11 22:06:49 +01:00
< div class = "inner-content converse-brand row" >
< div class = "converse-brand__padding" > < / d i v >
< div class = "converse-brand__heading" >
< svg height = "200px"
xmlns = "http://www.w3.org/2000/svg"
xmlns : xlink = "http://www.w3.org/1999/xlink"
viewBox = "0 0 364 364"
version = "1.1" >
< title > Logo Converse < / t i t l e >
< defs >
< linearGradient id = "gradient" x1 = "92.14" y1 = "27.64" x2 = "267.65" y2 = "331.62" gradientUnits = "userSpaceOnUse" >
< stop offset = "0" stop - color = "#fff1d1" / >
< stop offset = "0.05" stop - color = "#fae8c1" / >
< stop offset = "0.15" stop - color = "#f0d5a1" / >
< stop offset = "0.27" stop - color = "#e7c687" / >
< stop offset = "0.4" stop - color = "#e1bb72" / >
< stop offset = "0.54" stop - color = "#dcb264" / >
< stop offset = "0.71" stop - color = "#daad5c" / >
< stop offset = "1" stop - color = "#d9ac59" / >
< / l i n e a r G r a d i e n t >
< filter id = "shadow" >
< feGaussianBlur in = "SourceAlpha" stdDeviation = "2.3" result = "blur1" / >
< feOffset in = "blur1" dx = "3" dy = "3" result = "blur2" / >
< feColorMatrix in = "blur2" type = "matrix" result = "blur3"
values = " 1 0 0 0 0.1
0 1 0 0 0.1
0 0 1 0 0.1
0 0 0 1 0 " / >
< feMerge >
< feMergeNode in = "blur3" / >
< feMergeNode in = "SourceGraphic" / >
< / f e M e r g e >
< / f i l t e r >
< / d e f s >
< g filter = "url(#shadow)" >
< path d = "M221.46,103.71c0,18.83-29.36,18.83-29.12,0C192.1,84.88,221.46,84.88,221.46,103.71Z" fill = "#d9ac59" / >
< path d = "M179.9,4.15A175.48,175.48,0,1,0,355.38,179.63,175.48,175.48,0,0,0,179.9,4.15Zm-40.79,264.5c-.23-17.82,27.58-17.82,27.58,0S138.88,286.48,139.11,268.65ZM218.6,168.24A79.65,79.65,0,0,1,205.15,174a12.76,12.76,0,0,0-6.29,4.65L167.54,222a1.36,1.36,0,0,1-2.46-.8v-35.8a2.58,2.58,0,0,0-3.06-2.53c-15.43,3-30.23,7.7-42.73,19.94-38.8,38-29.42,105.69,16.09,133.16a162.25,162.25,0,0,1-91.47-67.27C-3.86,182.26,34.5,47.25,138.37,25.66c46.89-9.75,118.25,5.16,123.73,62.83C265.15,120.64,246.56,152.89,218.6,168.24Z" fill = "url(#gradient)" / >
< / g >
< / s v g >
< span class = "converse-brand__text" >
< span > converse < span class = "subdued" > . js < / s p a n > < / s p a n >
< p class = "byline" > messaging freedom < / p >
< / s p a n >
< / d i v >
2022-01-03 11:54:10 +01:00
$ { "overlayed" === jl . settings . get ( "view_mode" ) ? el ` <div class="converse-brand__padding"></div> ` : "" }
< / d i v > ` , t ) , d o c u m e n t . q u e r y S e l e c t o r ( " b o d y " ) . c l a s s L i s t . a d d ( ` c o n v e r s e - $ { j l . s e t t i n g s . g e t ( " v i e w _ m o d e " ) } ` ) , j l . t r i g g e r ( " c h a t B o x V i e w s I n i t i a l i z e d " ) } r e n d e r ( ) { r e t u r n ( ( ) = > { c o n s t { c h a t b o x e s : e , C O N T R O L B O X _ T Y P E : t , C H A T R O O M S _ T Y P E : n , H E A D L I N E S _ T Y P E : s } = w a , i = j l . s e t t i n g s . g e t ( " v i e w _ m o d e " ) , r = n u l l = = w a ? v o i d 0 : w a . c o n n e c t i o n , o = ! ( n u l l ! = r & & r . c o n n e c t e d ) | | ! ( n u l l ! = r & & r . a u t h e n t i c a t e d ) | | ( n u l l = = r ? v o i d 0 : r . d i s c o n n e c t i n g ) ; r e t u r n e l `
$ { o || "overlayed" !== i ? "" : el ` <converse-minimized-chats></converse-minimized-chats> ` }
$ { Wg ( e . filter ( Vg ) , ( e => e . get ( "jid" ) ) , ( e => e . get ( "type" ) === t ? el `
$ { "overlayed" === i ? el ` <converse-controlbox-toggle class=" ${ e . get ( "closed" ) ? "" : "hidden" } "></converse-controlbox-toggle> ` : "" }
2021-11-11 22:06:49 +01:00
< converse - controlbox
id = "controlbox"
2022-01-03 11:54:10 +01:00
class = "chatbox ${" overlayed "===i&&e.get(" closed ")?" hidden ":" "} ${o?" logged - out ":" "}"
2021-11-11 22:06:49 +01:00
style = "${e.get(" width ")?`width: ${e.get(" width ")}`:" "}" > < / c o n v e r s e - c o n t r o l b o x >
2022-01-03 11:54:10 +01:00
` :e.get("type")===n?el `
2021-11-11 22:06:49 +01:00
< converse - muc jid = "${e.get(" jid ")}" class = "chatbox chatroom" > < / c o n v e r s e - m u c >
2022-01-03 11:54:10 +01:00
` :e.get("type")===s?el `
2021-11-11 22:06:49 +01:00
< converse - headlines jid = "${e.get(" jid ")}" class = "chatbox headlines" > < / c o n v e r s e - h e a d l i n e s >
2022-01-03 11:54:10 +01:00
` :el `
2021-11-11 22:06:49 +01:00
< converse - chat jid = "${e.get(" jid ")}" class = "chatbox" > < / c o n v e r s e - c h a t >
` ))}
2022-01-03 11:54:10 +01:00
` })()}});function Jg(){const e=.01*window.innerHeight;document.documentElement.style.setProperty("--vh", ` $ { e } px ` )}var Qg=n(6931),Zg={};Zg.styleTagTransform=vg(),Zg.setAttributes=fg(),Zg.insert=ug().bind(null,"head"),Zg.domAPI=lg(),Zg.insertStyleElement=gg(),ag()(Qg.Z,Zg),Qg.Z&&Qg.Z.locals&&Qg.Z.locals, $ l.plugins.add("converse-chatboxviews",{dependencies:["converse-chatboxes","converse-vcard"],initialize(){jl.promises.add(["chatBoxViewsInitialized"]),jl.settings.extend({animate:!0,theme:"default"}),wa.chatboxviews=new class{constructor(){this.views={}}add(e,t){this.views[e]=t}get(e){return this.views[e]}xget(e){return this.keys().filter((t=>t!==e)).reduce(((e,t)=>(e[t]=this.views[t],e)),{})}getAll(){return Object.values(this.views)}keys(){return Object.keys(this.views)}remove(e){delete this.views[e]}map(e){return Object.values(this.views).map(e)}forEach(e){return Object.values(this.views).forEach(e)}filter(e){return Object.values(this.views).filter(e)}closeAllChatBoxes(){return Promise.all(Object.values(this.views).map((e=>e.close({name:"closeAllChatBoxes"}))))}},jl.listen.on("chatBoxesInitialized",(()=>{wa.chatboxes.on("destroy",(e=>wa.chatboxviews.remove(e.get("jid"))))})),jl.listen.on("cleanup",(()=>delete wa.chatboxviews)),jl.listen.on("clearSession",(()=>wa.chatboxviews.closeAllChatBoxes())),jl.listen.on("chatBoxViewsInitialized",Jg),window.addEventListener("resize",Jg),Object.assign( $ l,{insertInto(e){var t;const n=null===(t=wa.chatboxviews)||void 0===t?void 0:t.el;if(n&&!e.contains(n))e.insertAdjacentElement("afterBegin",n);else if(!n)throw new Error("Cannot insert non-existing #conversejs element into the DOM")}})}});var Kg=n(1505),Yg=n.n(Kg);const Xg=/^ \s *</,ep=("undefined"!=typeof Element&&Element.prototype,function(e){this.cid=Ts("view"),this._domEvents=[],this.preinitialize.apply(this,arguments),Ct(this,jo(e,np)),this._ensureElement(),this.initialize.apply(this,arguments)});ep.extend=Ws;const tp=/^( \S +) \s *(.*) $ /,np=["model","collection","el","id","attributes","className","tagName","events"];Object.assign(ep.prototype,ks,{tagName:"div", $ :function(e){return this.el.querySelectorAll(e)},preinitialize:function(){},initialize:function(){},render:function(){return ve(this.beforeRender)&&this.beforeRender(),ve(this.toHTML)&&il(this.toHTML(),this.el),ve(this.afterRender)&&this.afterRender(),this},remove:function(){return this._removeElement(),this.stopListening(),this},_removeElement:function(){this.undelegateEvents(),this.el.parentNode&&this.el.parentNode.removeChild(this.el)},setElement:function(e){return this.undelegateEvents(),this._setElement(e),this.delegateEvents(),this},_setElement:function(e){if("string"==typeof e)if(Xg.test(e)){const t=document.createElement("div");t.innerHTML=e,this.el=t.firstChild}else this.el=document.querySelector(e);else e&&!T(e)&&e.length?this.el=e[0]:this.el=e},delegateEvents:function(e){if(e||(e=Gs(this,"events")),!e)return this;this.undelegateEvents();for(const t in e){let n=e[t];if(ve(n)||(n=this[n]),!n)continue;const s=t.match(tp);this.delegate(s[1],s[2],n.bind(this))}return this},delegate:function(e,t,n){const s=this.el;if(!s)return this;if("function"==typeof t&&(n=t,t=null),-1!==["focus","blur"].indexOf(e)){const s=this.el.querySelectorAll(t);for(let t=0,i=s.length;t<i;t++){const i=s[t];i.addEventListener(e,n,!1),this._domEvents.push({el:i,eventName:e,handler:n})}return n}const i=t?function(e){let i=e.target||e.srcElement;for(;i&&i!=s;i=i.parentNode)i.matches(t)&&(e.delegateTarget=i,n(e))}:n;return this.el.addEventListener(e,i,!1),this._domEvents.push({el:this.el,eventName:e,handler:i,listener:n,selector:t}),this},undelegateEvents:function(){if(this.el){for(let e=0,t=this._domEvents.length;e<t;e++){const t=this._domEvents[e];t.el.removeEventListener(t.eventName,t.handler,!1)}this._domEvents.length=0}return this},undelegate:function(e,t,n){if("function"==typeof t&&(n=t,t=null),this.el){const s=this._domEvents.slice();let i=s.length;for(;i--;){const r=s[i];!(r.eventName!==e||n&&r.listener!==n||t&&r.selector!==t)&&(r.el.removeEventListener(r.eventName,r.handler,!1),this._domEve
2021-11-11 22:06:49 +01:00
< div class = "modal-dialog" role = "document" >
< div class = "modal-content" >
< div class = "modal-header ${e.level}" >
< h5 class = "modal-title" > $ { e . title } < / h 5 >
2022-01-03 11:54:10 +01:00
$ { lp }
2021-11-11 22:06:49 +01:00
< / d i v >
< div class = "modal-body" >
< span class = "modal-alert" > < / s p a n >
2022-01-03 11:54:10 +01:00
$ { e . messages . map ( ( e => el ` <p> ${ e } </p> ` ) ) }
2021-11-11 22:06:49 +01:00
< / d i v >
< / d i v >
2022-01-03 11:54:10 +01:00
< / d i v > ` ) ( O b j e c t . a s s i g n ( { _ _ : E h } , t h i s . m o d e l . t o J S O N ( ) ) ) } } ) , u p = a p . e x t e n d ( { i d : " c o n f i r m - m o d a l " , e v e n t s : { " s u b m i t . c o n f i r m " : " o n C o n f i m a t i o n " } , i n i t i a l i z e ( ) { t h i s . c o n f i r m a t i o n = j i ( ) , a p . p r o t o t y p e . i n i t i a l i z e . a p p l y ( t h i s , a r g u m e n t s ) , t h i s . l i s t e n T o ( t h i s . m o d e l , " c h a n g e " , t h i s . r e n d e r ) , t h i s . e l . a d d E v e n t L i s t e n e r ( " c l o s e d . b s . m o d a l " , ( ( ) = > t h i s . c o n f i r m a t i o n . r e j e c t ( ) ) , ! 1 ) } , t o H T M L ( ) { r e t u r n ( e = > e l `
2021-03-19 19:26:15 +01:00
< div class = "modal-dialog" role = "document" >
< div class = "modal-content" >
< div class = "modal-header ${e.level||" "}" >
< h5 class = "modal-title" > $ { e . title } < / h 5 >
< button type = "button" class = "close" data - dismiss = "modal" aria - label = "Close" >
< span aria - hidden = "true" > × < / s p a n >
< / b u t t o n >
< / d i v >
< div class = "modal-body" >
< span class = "modal-alert" > < / s p a n >
< form class = "converse-form converse-form--modal confirm" action = "#" >
< div class = "form-group" >
2022-01-03 11:54:10 +01:00
$ { e . messages . map ( ( e => el ` <p> ${ e } </p> ` ) ) }
2021-03-19 19:26:15 +01:00
< / d i v >
2022-01-03 11:54:10 +01:00
$ { e . fields . map ( ( e => ( e => el `
2021-03-19 19:26:15 +01:00
< div class = "form-group" >
< label >
$ { e . label || "" }
< input type = "text"
name = "${e.name}"
class = "${e.challenge_failed?" error ":" "} form-control form-control--labeled"
? required = "${e.required}"
placeholder = "${e.placeholder}" / >
< / l a b e l >
< / d i v >
2021-11-11 22:06:49 +01:00
` )(e)))}
2021-03-19 19:26:15 +01:00
< div class = "form-group" >
2022-01-03 11:54:10 +01:00
< button type = "submit" class = "btn btn-primary" > $ { Eh ( "OK" ) } < / b u t t o n >
< input type = "button" class = "btn btn-secondary" data - dismiss = "modal" value = "${Eh(" Cancel ")}" / >
2021-03-19 19:26:15 +01:00
< / d i v >
< / f o r m >
< / d i v >
< / d i v >
< / d i v >
2022-01-03 11:54:10 +01:00
` )(this.model.toJSON())},afterRender(){this.close_handler_registered||(this.el.addEventListener("closed.bs.modal",(()=>{this.confirmation.isResolved||this.confirmation.reject()}),!1),this.close_handler_registered=!0)},onConfimation(e){e.preventDefault();const t=new FormData(e.target),n=(this.model.get("fields")||[]).map((e=>{const n=t.get(e.name).trim();return e.value=n,e.challenge&&(e.challenge_failed=n!==e.challenge),e}));if(n.filter((e=>e.challenge_failed)).length)return this.model.set("fields",n),void this.model.trigger("change");this.confirmation.resolve(n),this.modal.hide()}});let hp=[];const fp={modal:{show(e,t,n){const s=this.get(e.id)||this.create(e,t);return s.show(n),s},get:e=>hp.filter((t=>t.id==e)).pop(),create(e,t){const n=new e(t);return hp.push(n),n},remove(e){hp=hp.filter((t=>t!==e)),e.remove()},removeAll(){hp.forEach((e=>e.remove())),hp=[]}},async confirm(e,t=[],n=[]){"string"==typeof t&&(t=[t]);const s=new Xo({title:e,messages:t,fields:n,type:"confirm"}),i=new up({model:s});let r;i.show();try{r=await i.confirmation}catch(e){r=!1}return i.remove(),r},async prompt(e,t=[],n=""){"string"==typeof t&&(t=[t]);const s=new Xo({title:e,messages:t,fields:[{name:"reason",placeholder:n}],type:"prompt"}),i=new up({model:s});let r;i.show();try{var o;r=null===(o=(await i.confirmation).pop())||void 0===o?void 0:o.value}catch(e){r=!1}return i.remove(),r},alert(e,t,n){let s;"string"==typeof n&&(n=[n]),"error"===e?s="alert-danger":"info"===e?s="alert-info":"warn"===e&&(s="alert-warning");const i=new Xo({title:t,messages:n,level:s,type:"alert"});fp.modal.show(dp,{model:i})}},mp=fp; $ l.env.BootstrapModal=ap, $ l.plugins.add("converse-modal",{initialize(){jl.listen.on("disconnect",(()=>{const e=document.querySelector("#converse-modals");e&&(e.innerHTML="")})),jl.listen.on("clearSession",(()=>jl.modal.removeAll())),Object.assign(wa.api,mp)}});const gp=(e,t)=>{var n,s;const i=e.N;if(void 0===i)return!1;for(const e of i)null===(s=(n=e).O)||void 0===s||s.call(n,t,!1),gp(e,t);return!0},pp=e=>{let t,n;do{if(void 0===(t=e.M))break;n=t.N,n.delete(e),e=t}while(0===(null==n?void 0:n.size))},vp=e=>{for(let t;t=e.M;e=t){let n=t.N;if(void 0===n)t.N=n=new Set;else if(n.has(e))break;n.add(e),_p(t)}};function yp(e){void 0!==this.N?(pp(this),this.M=e,vp(this)):this.M=e}function bp(e,t=!1,n=0){const s=this.H,i=this.N;if(void 0!==i&&0!==i.size)if(t)if(Array.isArray(s))for(let e=n;e<s.length;e++)gp(s[e],!1),pp(s[e]);else null!=s&&(gp(s,!1),pp(s));else gp(this,e)}const _p=e=>{var t,n,s,i;2==e.type&&(null!==(t=(s=e).P)&&void 0!==t||(s.P=bp),null!==(n=(i=e).Q)&&void 0!==n||(i.Q=yp))};class wp extends zg{constructor(){super(...arguments),this.isConnected=!0,this.ut=tl,this.N=void 0}T(e,t,n){super.T(e,t,n),vp(this)}O(e,t=!0){this.at(e),t&&(gp(this,e),pp(this))}at(e){var t,n;e!==this.isConnected&&(e?(this.isConnected=!0,this.ut!==tl&&(this.setValue(this.ut),this.ut=tl),null===(t=this.reconnected)||void 0===t||t.call(this)):(this.isConnected=!1,null===(n=this.disconnected)||void 0===n||n.call(this)))}S(e,t){if(!this.isConnected)throw Error( ` AsyncDirective $ { this . constructor . name } was rendered while its tree was disconnected . ` );return super.S(e,t)}setValue(e){if(this.isConnected)if((e=>void 0===this.Σdt.strings)())this.Σdt.I(e,this);else{const t=[...this.Σdt.H];t[this.Σct]=e,this.Σdt.I(t,this,0)}else this.ut=e}disconnected(){}reconnected(){}}const Sp=e=>!(e=>null===e||"object"!=typeof e&&"function"!=typeof e)(e)&&"function"==typeof e.then,xp=Lg(class extends wp{constructor(){super(...arguments),this.Ct=2147483647,this.Rt=[]}render(...e){var t;return null!==(t=e.find((e=>!Sp(e))))&&void 0!==t?t:tl}update(e,t){const n=this.Rt;let s=n.length;this.Rt=t;for(let e=0;e<t.length&&!(e>this.Ct);e++){const i=t[e];if(!Sp(i))return this.Ct=e,i;e<s&&i===n[e]||(this.Ct=2147483647,s=0,Promise.resolve(i).then((e=>{const t=this.Rt.indexOf(i);t>-1&&t<this.Ct&&(this.Ct=t,this.setValue(e))})))}return tl}});var Ep=n(4166),Ap={};Ap.styleTagTransform=vg(),Ap.setAttributes=fg(),Ap.insert=ug().bind(null,"head"),Ap.domAPI=lg(),Ap.insertStyleElement=gg(),ag()(Ep.Z,Ap),Ep.Z&&Ep
2021-11-11 22:06:49 +01:00
class = "chat-msg__actions ${e?" dropup dropup -- left ":" dropleft "}"
. items = $ { t }
2022-01-03 11:54:10 +01:00
> < / c o n v e r s e - d r o p d o w n > ` : " " } s t a t i c g e t A c t i o n s D r o p d o w n I t e m ( e ) { r e t u r n e l `
2021-11-11 22:06:49 +01:00
< button class = "chat-msg__action ${e.button_class}" @ click = $ { e . handler } >
< converse - icon
class = "${e.icon_class}"
2022-01-03 11:54:10 +01:00
path - prefix = "${jl.settings.get(" assets _path ")}"
2021-11-11 22:06:49 +01:00
color = "var(--text-color-lighten-15-percent)"
size = "1em"
> < / c o n v e r s e - i c o n >
$ { e . i18n _text }
< / b u t t o n >
2022-01-03 11:54:10 +01:00
` }onMessageEditButtonClicked(e){var t,n;e.preventDefault();const s=this.model.collection.findWhere("correcting"),i=null===(t=Tp.ancestor(this,".chatbox"))||void 0===t||null===(n=t.querySelector(".chat-textarea"))||void 0===n?void 0:n.value;(!i||s&&s.get("message")===i||confirm(Eh("You have an unsent message which will be lost if you continue. Are you sure?")))&&(s!==this.model?(null==s||s.save("correcting",!1),this.model.save("correcting",!0)):this.model.save("correcting",!1))}async onDirectMessageRetractButtonClicked(){if("me"!==this.model.get("sender"))return M.error("onMessageRetractButtonClicked called for someone else's message!");const e=Eh("Be aware that other XMPP/Jabber clients (and servers) may not yet support retractions and that this message may not be removed everywhere."),t=[Eh("Are you sure you want to retract this message?")];jl.settings.get("show_retraction_warning")&&(t[1]=e),await jl.confirm(Eh("Confirm"),t)&&this.model.collection.chatbox.retractOwnMessage(this.model)}async retractOtherMessage(e){const t=this.model.collection.chatbox,n=await t.retractOtherMessage(this.model,e);if(null===n){const e=Eh("A timeout occurred while trying to retract the message");jl.alert("error",Eh("Error"),e),M(e,Cp.LogLevel.WARN)}else if(Tp.isErrorStanza(n)){const e=Eh("Sorry, you're not allowed to retract this message.");jl.alert("error",Eh("Error"),e),M(e,Cp.LogLevel.WARN),M(n,Cp.LogLevel.WARN)}}async onMUCMessageRetractButtonClicked(){const e=Eh("Be aware that other XMPP/Jabber clients (and servers) may not yet support retractions and that this message may not be removed everywhere.");if(this.model.mayBeRetracted()){const t=[Eh("Are you sure you want to retract this message?")];jl.settings.get("show_retraction_warning")&&(t[1]=e),await jl.confirm(Eh("Confirm"),t)&&this.model.collection.chatbox.retractOwnMessage(this.model)}else if(await this.model.mayBeModerated())if("me"===this.model.get("sender")){let t=[Eh("Are you sure you want to retract this message?")];jl.settings.get("show_retraction_warning")&&(t=[t[0],e,t[1]]),await jl.confirm(Eh("Confirm"),t)&&this.retractOtherMessage()}else{let t=[Eh("You are about to retract this message."),Eh("You may optionally include a message, explaining the reason for the retraction.")];jl.settings.get("show_retraction_warning")&&(t=[t[0],e,t[1]]);const n=await jl.prompt(Eh("Message Retraction"),t,Eh("Optional reason"));!1!==n&&this.retractOtherMessage(n)}else{const e=Eh("Sorry, you're not allowed to retract this message");jl.alert("error",Eh("Error"),e)}}onMessageRetractButtonClicked(e){var t;null==e||null===(t=e.preventDefault)||void 0===t||t.call(e),this.model.collection.chatbox.get("type")===wa.CHATROOMS_TYPE?this.onMUCMessageRetractButtonClicked():this.onDirectMessageRetractButtonClicked()}onMediaToggleClicked(e){var t;null==e||null===(t=e.preventDefault)||void 0===t||t.call(e),this.hasHiddenMedia(this.getMediaURLs())?this.model.save({hide_url_previews:!1,url_preview_transition:"fade-in"}):(this.model.get("ogp_metadata")||[]).length?this.model.set("url_preview_transition","fade-out"):this.model.save({hide_url_previews:!0,url_preview_transition:"fade-in"})}hasHiddenMedia(e){if("boolean"==typeof this.model.get("hide_url_previews"))return this.model.get("hide_url_previews");const t=jl.settings.get("render_media");return Array.isArray(t)?e.reduce(((e,n)=>e||!zl(t,n)),!1):!t}getMediaURLs(){const e=(this.model.get("ogp_metadata")||[]).map((e=>({url:e["og:image"],is_image:!0}))).filter((e=>Bl(e))),t=Ed(this.model.get("media_urls")||[],this.model.get("body")).filter((e=>Bl(e)));return[...new Set([...t.map((e=>e.url)),...e.map((e=>e.url))])]}addMediaRenderingToggle(e){const t=this.getMediaURLs();if(t.length){const n=this.hasHiddenMedia(t);e.push({i18n_text:Eh(n?"Show media":"Hide media"),handler:e=>this.onMediaToggleClicked(e),button_class:"chat-msg__action-hide-previews",icon_class:n?"fas fa-eye":"fas fa-eye-slash",name:"hide"})}}async getActionButtons(){const e=[];this.model.get("editable")&&e.push({i18n_text:this.model.get("correcting")?Eh("Cancel Editing"):Eh("Edit"),handler
2021-03-19 19:26:15 +01:00
< div class = "modal-dialog fit-content" role = "document" >
< div class = "modal-content fit-content" >
< div class = "modal-header" >
2022-01-03 11:54:10 +01:00
< h4 class = "modal-title" id = "message-versions-modal-label" > $ { Eh ( "Image: " ) } < a target = "_blank" rel = "noopener" href = "${e.src}" > $ { e . src } < / a > < / h 4 >
$ { lp }
2021-03-19 19:26:15 +01:00
< / d i v >
< div class = "modal-body modal-body--image fit-content" >
< img class = "chat-image" src = "${e.src}" @ load = $ { e . onload } >
< / d i v >
2022-01-03 11:54:10 +01:00
< div class = "modal-footer" > $ { cp } < / d i v >
2021-11-11 22:06:49 +01:00
< / d i v >
2022-01-03 11:54:10 +01:00
< / d i v > ` ) ( { s r c : t h i s . s r c , o n l o a d : e = > e . t a r g e t . p a r e n t E l e m e n t . s t y l e . h e i g h t = ` $ { e . t a r g e t . h e i g h t } p x ` } ) } } ) , N p = ( e , t ) = > e l ` < a u d i o c o n t r o l s s r c = " $ { e } " > < / a u d i o > $ { t ? " " : e l ` < a t a r g e t = " _ b l a n k " r e l = " n o o p e n e r " h r e f = " $ { e } " > $ { e } < / a > ` } ` ; c l a s s O p { c o n s t r u c t o r ( e ) { e . t o S t r i n g ( ) . i n d e x O f ( " A r r a y B u f f e r " ) > 0 & & ( e = n e w U i n t 8 A r r a y ( e ) ) , t h i s . d a t a = e , t h i s . l e n = t h i s . d a t a . l e n g t h , t h i s . p o s = 0 } r e a d B y t e ( ) { i f ( t h i s . p o s > = t h i s . d a t a . l e n g t h ) t h r o w n e w E r r o r ( " A t t e m p t e d t o r e a d p a s t e n d o f s t r e a m . " ) ; r e t u r n t h i s . d a t a i n s t a n c e o f U i n t 8 A r r a y ? t h i s . d a t a [ t h i s . p o s + + ] : 2 5 5 & t h i s . d a t a . c h a r C o d e A t ( t h i s . p o s + + ) } r e a d B y t e s ( e ) { c o n s t t = [ ] ; f o r ( l e t n = 0 ; n < e ; n + + ) t . p u s h ( t h i s . r e a d B y t e ( ) ) ; r e t u r n t } r e a d ( e ) { l e t t = " " ; f o r ( l e t n = 0 ; n < e ; n + + ) t + = S t r i n g . f r o m C h a r C o d e ( t h i s . r e a d B y t e ( ) ) ; r e t u r n t } r e a d U n s i g n e d ( ) { c o n s t e = t h i s . r e a d B y t e s ( 2 ) ; r e t u r n ( e [ 1 ] < < 8 ) + e [ 0 ] } } f u n c t i o n $ p ( e ) { r e t u r n e . r e d u c e ( ( f u n c t i o n ( e , t ) { r e t u r n 2 * e + t } ) , 0 ) } f u n c t i o n I p ( e ) { c o n s t t = [ ] ; f o r ( l e t n = 7 ; n > = 0 ; n - - ) t . p u s h ( ! ! ( e & 1 < < n ) ) ; r e t u r n t } f u n c t i o n M p ( e ) { l e t t , n ; n = " " ; d o { t = e . r e a d B y t e ( ) , n + = e . r e a d ( t ) } w h i l e ( 0 ! = = t ) ; r e t u r n n } f u n c t i o n R p ( e , t ) { c o n s t n = [ ] ; f o r ( l e t s = 0 ; s < t ; s + + ) n . p u s h ( e . r e a d B y t e s ( 3 ) ) ; r e t u r n n } f u n c t i o n D p ( e , t ) { c o n s t n = { } ; s w i t c h ( n . s e n t i n e l = e . r e a d B y t e ( ) , S t r i n g . f r o m C h a r C o d e ( n . s e n t i n e l ) ) { c a s e " ! " : n . t y p e = " e x t " , f u n c t i o n ( e , t , n ) { s w i t c h ( t . l a b e l = e . r e a d B y t e ( ) , t . l a b e l ) { c a s e 2 4 9 : t . e x t T y p e = " g c e " , f u n c t i o n ( t ) { e . r e a d B y t e ( ) ; c o n s t s = I p ( e . r e a d B y t e ( ) ) ; t . r e s e r v e d = s . s p l i c e ( 0 , 3 ) , t . d i s p o s a l M e t h o d = $ p ( s . s p l i c e ( 0 , 3 ) ) , t . u s e r I n p u t = s . s h i f t ( ) , t . t r a n s p a r e n c y G i v e n = s . s h i f t ( ) , t . d e l a y T i m e = e . r e a d U n s i g n e d ( ) , t . t r a n s p a r e n c y I n d e x = e . r e a d B y t e ( ) , t . t e r m i n a t o r = e . r e a d B y t e ( ) , n u l l = = n | | n . g c e ( t ) } ( t ) ; b r e a k ; c a s e 2 5 4 : t . e x t T y p e = " c o m " , f u n c t i o n ( t ) { t . c o m m e n t = M p ( e ) , n . c o m & & n . c o m ( t ) } ( t ) ; b r e a k ; c a s e 1 : t . e x t T y p e = " p t e " , f u n c t i o n ( t ) { e . r e a d B y t e ( ) , t . p t H e a d e r = e . r e a d B y t e s ( 1 2 ) , t . p t D a t a = M p ( e ) , n . p t e & & n . p t e ( t ) } ( t ) ; b r e a k ; c a s e 2 5 5 : t . e x t T y p e = " a p p " , f u n c t i o n ( t ) { s w i t c h ( e . r e a d B y t e ( ) , t . i d e n t i f i e r = e . r e a d ( 8 ) , t . a u t h C o d e = e . r e a d ( 3 ) , t . i d e n t i f i e r ) { c a s e " N E T S C A P E " : ! f u n c t i o n ( t ) { e . r e a d B y t e ( ) , t . u n k n o w n = e . r e a d B y t e ( ) , t . i t e r a t i o n s = e . r e a d U n s i g n e d ( ) , t . t e r m i n a t o r = e . r e a d B y t e ( ) , n . a p p & & n . a p p . N E T S C A P E & & n . a p p . N E T S C A P E ( t ) } ( t ) ; b r e a k ; d e f a u l t : ! f u n c t i o n ( t ) { t . a p p D a t a = M p ( e ) , n . a p p & & n . a p p [ t . i d e n t i f i e r ] & & n . a p p [ t . i d e n t i f i e r ] ( t ) } ( t ) } } ( t ) ; b r e a k ; d e f a u l t : t . e x t T y p e = " u n k n o w n " , f u n c t i o n ( t ) { t . d a t a = M p ( e ) , n . u n k n o w n & & n . u n k n o w n ( t ) } ( t ) } } ( e , n , t ) ; b r e a k ; c a s e " , " : n . t y p e = " i m g " , f u n c t i o n ( e , t , n ) { t . l e f t P o s = e . r e a d U n s i g n e d ( ) , t . t o p P o s = e . r e a d U n s i g n e d ( ) , t . w i d t h = e . r e a d U n s i g n e d ( ) , t . h e i g h t = e . r e a d U n s i g n e d ( ) ; c o n s t s = I p ( e . r e a d B y t e ( ) ) ; t . l c t F l a g = s . s h i f t ( ) , t . i n t e r l a c e d = s . s h i f t ( ) , t . s o r t e d = s . s h i f t ( ) , t . r e s e r v e d = s . s p l i c e ( 0 , 2 ) , t . l c t S i z e = $ p ( s . s p l i c e ( 0 , 3 ) ) , t . l c t F l a g & & ( t . l c t = R p ( e , 1 < < t . l c t S i z e + 1 ) ) , t . l z w M i n C o d e S i z e = e . r e a d B y t e ( ) ; c o n s t i = M p ( e ) ; t . p i x e l s = f u n c t i o n ( e , t ) { l e t n = 0 ; f u n c t i o n s ( e ) { l e t s = 0 ; f o r ( l e t i = 0 ; i < e ; i + + ) t . c h a r C o d e A t ( n > > 3 ) & 1 < < ( 7 & n ) & & ( s | = 1 < < i ) , n + + ; r e t u r n s } c o n s t i = [ ] , r = 1 < < e , o = r + 1 ; l e t a = e + 1 , c = [ ] ; c o n s t l = f u n c t i o n ( ) { c = [ ] , a = e + 1 ; f o r ( l e t e = 0 ; e < r ; e + + ) c [ e ] = [ e ] ; c [ r ] = [ ] , c [ o ] = n u l l } ; l e t d , u ; f o r ( ; ; ) i f ( u = d , d = s ( a ) , d ! = = r ) { i f ( d = = = o ) b r e a k ; i f ( d < c . l e n g t h ) u ! = = r & & c . p u s h ( c [ u ] . c o n c a t ( c [ d ] [ 0 ] ) ) ; e l s e { i f ( d ! = = c . l e n g t h ) t h r o w n e w E r r o r ( " I n v a l i d L Z W c o d e . " ) ; c . p u s h ( c [ u ] . c o n c a t ( c [ u ] [ 0 ] ) ) } i . p u s h . a p p l y ( i , c [ d ] ) , c . l e n g t h = = = 1 < < a & & a < 1 2 & & a + + } e l s e l ( ) ; r e t u r n i } ( t . l z w M i n C o d e S i z e , i ) , t . i n t e r l a c e d & & ( t . p i x e l s = f u n c t i o n ( e , t ) { c o n s t n = n e w A r r a y ( e . l e n g t h ) , s = e . l e n g t h / t ; f u n c t i o n i ( s , i ) { c o n s t r = e . s l i c e ( i * t , ( i + 1 ) * t ) ; n . s p l i c e . a p p l y ( n , [ s * t , t ] . c o n c a t ( r ) ) } c o n s t r = [ 0 , 4 , 2 , 1 ] , o = [ 8 , 8 , 4 , 2 ] ; l e t a = 0 ; f o r ( l e t e = 0 ; e < 4 ; e + + ) f o r ( l e t t = r [ e ] ; t < s ; t + = o [ e ] ) i ( t , a ) , a + + ; r e t u r n n } ( t . p i x e l s , t . w i d t h ) ) , n u l l = = n | | n ( t ) } ( e , n , n u l l = = t ? v o i d 0 : t . i m g ) ; b r e a k ; c a s e " ; " : n . t y p e = " e o f " , n u l l = = t | | t . e o f ( n ) ; b r e a k ; d e f a u l t : t h r o w n e w E r r o r ( " U n k n o w n b l o c k : 0 x " + n . s e n t i n e l . t o S t r i n g ( 1 6 ) ) } " e o f " ! = = n . t y p e & & s e t T i m e o u t ( ( ( ) = > D p ( e , t ) ) , 0 ) } c l a s s L p { c o n s t r u c t o r ( e , t ) { t h i s . o p t i o n s = O b j e c t . a s s i g n ( { w i d t h : n u l l , h e i g h t : n u l l , a u t o p l a y : ! 0 , l o o p : ! 0 , s h o w _ p r o g r e s s _ b a r : ! 0 , p r o g r e s s _ b g _ c o l o r : " r g b a ( 0 , 0 , 0 , 0 . 4 ) " , p r o g r e s s _ c o l o r : " r g b a ( 2 5 5 , 0 , 2 2 , . 8 ) " , p r o g r e s s _ b a r _ h e i g h t : 5 } , t ) , t h i s . e l = e , t h i s . g i f _ e l = e . q u e r y S e l e c t o r ( " i m g " ) , t h i s . c a n v a s = e . q u e r y S e l e c t o r ( " c a n v a s " ) , t h i s . c t x = t h i s . c a n v a s . g e t C o n t e x t ( " 2 d " ) , t h i s . o f f s c r e e n C a n v a s = d o c u m e n t . c r e a t e E l e m e n t ( " c a n v a s " ) , t h i s . c t x _ s c a l e d = ! 1 , t h i s . d i s p o s a l _ m e t h o d = n u l l , t h i s . d i s p o s a l _ r e s t o r e _ f r o m _ i d x = n u l l , t h i s . f r a m e = n u l l , t h i s . f r a m e
2021-11-11 22:06:49 +01:00
< div class = "form-group" >
2022-01-03 11:54:10 +01:00
$ { "hidden" !== e . type ? el ` <label for=" ${ e . id } "> ${ e . label } </label> ` : "" }
2021-11-11 22:06:49 +01:00
<!-- This is a hack to prevent Chrome from auto - filling the username in
any of the other input fields in the MUC configuration form . -- >
2022-01-03 11:54:10 +01:00
$ { "password" === e . type && e . fixed _username ? el `
2021-11-11 22:06:49 +01:00
< input class = "hidden-username" type = "text" autocomplete = "username" value = "${e.fixed_username}" > < / i n p u t >
` :""}
< input
autocomplete = "${e.autocomplete||" "}"
class = "form-control"
id = "${e.id}"
name = "${e.name}"
placeholder = "${e.placeholder||" "}"
type = "${e.type}"
value = "${e.value||" "}"
? required = $ { e . required } / >
2022-01-03 11:54:10 +01:00
< / d i v > ` , F p = e = > e l `
2021-11-11 22:06:49 +01:00
< label > $ { e . label }
< a class = "form-url" target = "_blank" rel = "noopener" href = "${e.value}" > $ { e . value } < / a >
2022-01-03 11:54:10 +01:00
< / l a b e l > ` , U p = e = > e l `
2021-11-11 22:06:49 +01:00
< div class = "form-group" >
2022-01-03 11:54:10 +01:00
$ { e . label ? el ` <label> ${ e . label } </label> ` : "" }
2021-11-11 22:06:49 +01:00
< div class = "input-group" >
< div class = "input-group-prepend" >
< input name = "${e.name}"
type = "${e.type}"
value = "${e.value||" "}"
? required = "${e.required}" / >
< div class = "input-group-text col" title = "${e.domain}" > $ { e . domain } < / d i v >
2021-03-19 19:26:15 +01:00
< / d i v >
2021-11-11 22:06:49 +01:00
< / d i v >
2022-01-03 11:54:10 +01:00
< /div>`;function Bp(e){e.preventDefault(),jl.rooms.open(e.target.href)}const qp=(e,t)=>{let n;try{n=e.normalize()._string}catch(e){return M.error(e),t}const s=e._parts.urn?n:e.readable(),i=t||s;return e._parts.protocol||n.startsWith("http:/ / ")||n.startsWith(" https : //")||(n="http://"+n),"xmpp"===e._parts.protocol&&"join"===e._parts.query?el`
2021-03-19 19:26:15 +01:00
< a target = "_blank"
rel = "noopener"
2022-01-03 11:54:10 +01:00
@ click = $ { Bp }
href = "${n}" > $ { i } < / a > ` : e l ` < a t a r g e t = " _ b l a n k " r e l = " n o o p e n e r " h r e f = " $ { n } " > $ { i } < / a > ` } , H p = ( e , t ) = > e l ` < v i d e o c o n t r o l s p r e l o a d = " m e t a d a t a " s r c = " $ { e } " > < / v i d e o > $ { t ? " " : e l ` < a t a r g e t = " _ b l a n k " r e l = " n o o p e n e r " h r e f = " $ { e } " > $ { e } < / a > ` } ` , { s i z z l e : G p } = $ l . e n v , W p = [ " h t t p " , " h t t p s " , " x m p p " , " m a i l t o " ] ; f u n c t i o n V p ( e , t ) { r e t u r n { " m u c # r o o m c o n f i g _ l a n g " : " l a n g u a g e " , " m u c # r o o m c o n f i g _ r o o m s e c r e t " : n u l l ! = t & & t . n e w _ p a s s w o r d ? " n e w - p a s s w o r d " : " c u r r e n t - p a s s w o r d " } [ e ] } c o n s t J p = { " t e x t - p r i v a t e " : " p a s s w o r d " , " t e x t - s i n g l e " : " t e x t " , f i x e d : " l a b e l " , b o o l e a n : " c h e c k b o x " , h i d d e n : " h i d d e n " , " j i d - m u l t i " : " t e x t a r e a " , " l i s t - s i n g l e " : " d r o p d o w n " , " l i s t - m u l t i " : " d r o p d o w n " } , Q p = { " x s : a n y U R I " : " u r l " , " x s : b y t e " : " n u m b e r " , " x s : d a t e " : " d a t e " , " x s : d a t e T i m e " : " d a t e t i m e " , " x s : i n t " : " n u m b e r " , " x s : i n t e g e r " : " n u m b e r " , " x s : t i m e " : " t i m e " } ; f u n c t i o n Z p ( e ) { c o n s t t = J p [ e . g e t A t t r i b u t e ( " t y p e " ) ] ; i f ( " t e x t " = = t ) { c o n s t n = e . g e t E l e m e n t s B y T a g N a m e N S ( " h t t p : / / j a b b e r . o r g / p r o t o c o l / x d a t a - v a l i d a t e " , " v a l i d a t e " ) ; i f ( 1 = = = n . l e n g t h ) { c o n s t e = n [ 0 ] . g e t A t t r i b u t e ( " d a t a t y p e " ) ; r e t u r n Q p [ e ] | | t } } r e t u r n t } f u n c t i o n K p ( e ) { c o n s t t = D l ( e ) ; r e t u r n n u l l = = = t ? e : W l ( t ) ? H p ( e ) : G l ( t ) ? N p ( e ) : ( V l ( t ) , z p ( t . t o S t r i n g ( ) , f u n c t i o n ( e ) { t r y { r e t u r n d e c o d e U R I ( e . f i l e n a m e ( ) ) } c a t c h ( t ) { r e t u r n M . d e b u g ( t ) , e . f i l e n a m e ( ) } } ( t ) ) ) } f u n c t i o n Y p ( e ) { c o n s t t = R e g E x p ( " ^ w { 3 } . " , " i g " ) . t e s t ( e ) ? ` h t t p : / / $ { e } ` : e , n = D l ( e ) ; r e t u r n n u l l = = = n | | ! f u n c t i o n ( e ) { t r y { r e t u r n ! ! n e w U R L ( e ) } c a t c h ( e ) { r e t u r n ! 1 } } ( t ) | | ! f u n c t i o n ( e , t = W p ) { r e t u r n ! ! t . i n c l u d e s ( e ) } ( n . _ p a r t s . p r o t o c o l ) & & n . _ p a r t s . p r o t o c o l ? e : q p ( n , e ) } f u n c t i o n X p ( e , t ) { e . c l a s s L i s t . r e m o v e ( " v i s i b l e " ) , v e ( t ) & & t ( ) } h a . c a l c u l a t e E l e m e n t H e i g h t = f u n c t i o n ( e ) { r e t u r n A r r a y . f r o m ( e . c h i l d r e n ) . r e d u c e ( ( ( e , t ) = > e + t . o f f s e t H e i g h t ) , 0 ) } , h a . g e t N e x t E l e m e n t = f u n c t i o n ( e , t = " * " ) { l e t n = e . n e x t E l e m e n t S i b l i n g ; f o r ( ; n u l l ! = = n & & ! G p . m a t c h e s S e l e c t o r ( n , t ) ; ) n = n . n e x t E l e m e n t S i b l i n g ; r e t u r n n } , h a . g e t P r e v i o u s E l e m e n t = f u n c t i o n ( e , t = " * " ) { l e t n = e . p r e v i o u s E l e m e n t S i b l i n g ; f o r ( ; n u l l ! = = n & & ! G p . m a t c h e s S e l e c t o r ( n , t ) ; ) n = n . p r e v i o u s E l e m e n t S i b l i n g ; r e t u r n n } , h a . g e t F i r s t C h i l d E l e m e n t = f u n c t i o n ( e , t = " * " ) { l e t n = e . f i r s t E l e m e n t C h i l d ; f o r ( ; n u l l ! = = n & & ! G p . m a t c h e s S e l e c t o r ( n , t ) ; ) n = n . n e x t E l e m e n t S i b l i n g ; r e t u r n n } , h a . g e t L a s t C h i l d E l e m e n t = f u n c t i o n ( e , t = " * " ) { l e t n = e . l a s t E l e m e n t C h i l d ; f o r ( ; n u l l ! = = n & & ! G p . m a t c h e s S e l e c t o r ( n , t ) ; ) n = n . p r e v i o u s E l e m e n t S i b l i n g ; r e t u r n n } , h a . h a s C l a s s = f u n c t i o n ( e , t ) { r e t u r n t i n s t a n c e o f E l e m e n t & & t . c l a s s L i s t . c o n t a i n s ( e ) } , h a . t o g g l e C l a s s = f u n c t i o n ( e , t ) { h a . h a s C l a s s ( e , t ) ? h a . r e m o v e C l a s s ( e , t ) : h a . a d d C l a s s ( e , t ) } , h a . a d d C l a s s = f u n c t i o n ( e , t ) { r e t u r n t i n s t a n c e o f E l e m e n t & & t . c l a s s L i s t . a d d ( e ) , t } , h a . r e m o v e C l a s s = f u n c t i o n ( e , t ) { r e t u r n t i n s t a n c e o f E l e m e n t & & t . c l a s s L i s t . r e m o v e ( e ) , t } , h a . r e m o v e E l e m e n t = f u n c t i o n ( e ) { r e t u r n e i n s t a n c e o f E l e m e n t & & e . p a r e n t N o d e & & e . p a r e n t N o d e . r e m o v e C h i l d ( e ) , e } , h a . g e t E l e m e n t F r o m T e m p l a t e R e s u l t = f u n c t i o n ( e ) { c o n s t t = d o c u m e n t . c r e a t e E l e m e n t ( " d i v " ) ; r e t u r n i l ( e , t ) , t . f i r s t E l e m e n t C h i l d } , h a . s h o w E l e m e n t = e = > { h a . r e m o v e C l a s s ( " c o l l a p s e d " , e ) , h a . r e m o v e C l a s s ( " h i d d e n " , e ) } , h a . h i d e E l e m e n t = f u n c t i o n ( e ) { r e t u r n e i n s t a n c e o f E l e m e n t & & e . c l a s s L i s t . a d d ( " h i d d e n " ) , e } , h a . a n c e s t o r = f u n c t i o n ( e , t ) { l e t n = e ; f o r ( ; n u l l ! = = n & & ! G p . m a t c h e s S e l e c t o r ( n , t ) ; ) n = n . p a r e n t E l e m e n t ; r e t u r n n } , h a . n e x t U n t i l = f u n c t i o n ( e , t ) { c o n s t n = [ ] ; l e t s = e . n e x t E l e m e n t S i b l i n g ; f o r ( ; n u l l ! = = s & & ! s . m a t c h e s ( t ) ; ) n . p u s h ( s ) , s = s . n e x t E l e m e n t S i b l i n g ; r e t u r n n } , h a . u n e s c a p e H T M L = f u n c t i o n ( e ) { v a r t = d o c u m e n t . c r e a t e E l e m e n t ( " d i v " ) ; r e t u r n t . i n n e r H T M L = e , t . i n n e r T e x t } , h a . e s c a p e H T M L = f u n c t i o n ( e ) { r e t u r n e . r e p l a c e ( / & / g , " & a m p ; " ) . r e p l a c e ( / < / g , " & l t ; " ) . r e p l a c e ( / > / g , " & g t ; " ) . r e p l a c e ( / " / g , " & q u o t ; " ) } , h a . s l i d e I n A l l E l e m e n t s = f u n c t i o n ( e , t = 3 0 0 ) { r e t u r n P r o m i s e . a l l ( A r r a y . f r o m ( e ) . m a p ( ( e = > h a . s l i d e I n ( e , t ) ) ) ) } , h a . s l i d e T o g g l e E l e m e n t = f u n c t i o n ( e , t ) { r e t u r n h a . h a s C l a s s ( " c o l l a p s e d " , e ) | | h a . h a s C l a s s ( " h i d d e n " , e ) ? h a . s l i d e O u t ( e , t ) : h a . s l i d e I n ( e , t ) } , h a . s l i d e O u t = f u n c t i o n ( e , t = 2 0 0 ) { r e t u r n n e w P r o m i s e ( ( ( n , s ) = > { i f ( ! e ) { c o n s t e = " A n e l e m e n t n e e d s t o b e p a s s e d i n t o s l i d e O u t " ; r e t u r n M . w a r n ( e ) , v o i d s ( n e w E r r o r ( e ) ) } c o n s t i = e . g e t A t t r i b u t e ( " d a t a - s l i d e r - m a r k e r " ) ; i & & ( e . r e m o v e A t t r i b u t e ( " d a t a - s l i d e r - m a r k e r " ) , w i n d o w . c a n c e l A n i m a t i o n F r a m e ( i ) ) ; c o n s t r = h a . c a l c u l a t e E l e m e n t H e i g h t ( e ) ; i f ( w i n d o w . c o n v e r s e _ d i s a b l e _ e f f e c t s ) r e t u r n e . s t y l e . h e i g h t = r + " p x " , f u n c t i o n ( e ) { e . r e m o v e A t t r i b u t e ( " d a t a - s l i d e r - m a r k e r " ) , e . c l a s s L i s t . r e m o v e ( " c o l l a p s e d " ) , e . s t y l e . o v e r f l o w = " " , e . s t y l e . h e i g h t = " " } ( e ) , v o i d n ( ) ; i f ( ! h a . h a s C l a s s ( " c o l l a p s e d "
2021-11-11 22:06:49 +01:00
< div class = "form-group" >
< label for = "${e.id}" > $ { e . label } < / l a b e l >
< select class = "form-control" id = "${e.id}" name = "${e.name}" ? multiple = "${e.multiple}" >
2022-01-03 11:54:10 +01:00
$ { null === ( t = e . options ) || void 0 === t ? void 0 : t . map ( ( e => ( e => el ` <option value=" ${ e . value } " ?selected=" ${ e . selected } "> ${ e . label } </option> ` ) ( e ) ) ) }
2021-11-11 22:06:49 +01:00
< / s e l e c t >
2022-01-03 11:54:10 +01:00
< / d i v > ` } ) ( { o p t i o n s : h a . q u e r y C h i l d r e n ( e , " o p t i o n " ) . m a p ( ( n = > { v a r s ; c o n s t i = n u l l = = = ( s = n . q u e r y S e l e c t o r ( " v a l u e " ) ) | | v o i d 0 = = = s ? v o i d 0 : s . t e x t C o n t e n t ; r e t u r n { v a l u e : i , l a b e l : n . g e t A t t r i b u t e ( " l a b e l " ) , s e l e c t e d : t . i n c l u d e s ( i ) , r e q u i r e d : ! ! e . q u e r y S e l e c t o r ( " r e q u i r e d " ) } } ) ) , i d : h a . g e t U n i q u e I d ( ) , l a b e l : e . g e t A t t r i b u t e ( " l a b e l " ) , m u l t i p l e : " l i s t - m u l t i " = = = e . g e t A t t r i b u t e ( " t y p e " ) , n a m e : e . g e t A t t r i b u t e ( " v a r " ) , r e q u i r e d : ! ! e . q u e r y S e l e c t o r ( " r e q u i r e d " ) } ) } v a r s , i , r , o ; i f ( " f i x e d " = = = e . g e t A t t r i b u t e ( " t y p e " ) ) r e t u r n ( e = > e l ` < p c l a s s = " f o r m - h e l p " > $ { e . t e x t } < / p > ` ) ( { t e x t : n u l l = = = ( s = e . q u e r y S e l e c t o r ( " v a l u e " ) ) | | v o i d 0 = = = s ? v o i d 0 : s . t e x t C o n t e n t } ) ; i f ( " j i d - m u l t i " = = = e . g e t A t t r i b u t e ( " t y p e " ) ) r e t u r n ( e = > e l `
2021-11-11 22:06:49 +01:00
< label class = "label-ta" > $ { e . label } < / l a b e l >
< textarea name = "${e.name}" > $ { e . value } < / t e x t a r e a >
2022-01-03 11:54:10 +01:00
` )({name:e.getAttribute("var"),label:e.getAttribute("label")||"",value:null===(i=e.querySelector("value"))||void 0===i?void 0:i.textContent,required:!!e.querySelector("required")});if("boolean"===e.getAttribute("type")){var a;const t=null===(a=e.querySelector("value"))||void 0===a?void 0:a.textContent;return(e=>el `
2021-11-11 22:06:49 +01:00
< fieldset class = "form-group" >
< input id = "${e.id}" name = "${e.name}" type = "checkbox" ? checked = $ { e . checked } ? required = $ { e . required } / >
< label class = "form-check-label" for = "${e.id}" > $ { e . label } < / l a b e l >
2022-01-03 11:54:10 +01:00
< / f i e l d s e t > ` ) ( { i d : h a . g e t U n i q u e I d ( ) , n a m e : e . g e t A t t r i b u t e ( " v a r " ) , l a b e l : e . g e t A t t r i b u t e ( " l a b e l " ) | | " " , c h e c k e d : " 1 " = = = t | | " t r u e " = = = t ? ' c h e c k e d = " 1 " ' : " " , r e q u i r e d : ! ! e . q u e r y S e l e c t o r ( " r e q u i r e d " ) } ) } i f ( " u r l " = = = e . g e t A t t r i b u t e ( " v a r " ) ) r e t u r n F p ( { l a b e l : e . g e t A t t r i b u t e ( " l a b e l " ) | | " " , v a l u e : n u l l = = = ( r = e . q u e r y S e l e c t o r ( " v a l u e " ) ) | | v o i d 0 = = = r ? v o i d 0 : r . t e x t C o n t e n t } ) ; i f ( " u s e r n a m e " = = = e . g e t A t t r i b u t e ( " v a r " ) ) r e t u r n U p ( { d o m a i n : " @ " + n . d o m a i n , n a m e : e . g e t A t t r i b u t e ( " v a r " ) , t y p e : Z p ( e ) , l a b e l : e . g e t A t t r i b u t e ( " l a b e l " ) | | " " , v a l u e : n u l l = = = ( o = e . q u e r y S e l e c t o r ( " v a l u e " ) ) | | v o i d 0 = = = o ? v o i d 0 : o . t e x t C o n t e n t , r e q u i r e d : ! ! e . q u e r y S e l e c t o r ( " r e q u i r e d " ) } ) ; i f ( " o c r " = = = e . g e t A t t r i b u t e ( " v a r " ) ) { c o n s t n = e . q u e r y S e l e c t o r ( " u r i " ) , s = G p ( ' d a t a [ c i d = " ' + n . t e x t C o n t e n t . r e p l a c e ( / ^ c i d : / , " " ) + ' " ] ' , t ) [ 0 ] ; r e t u r n ( e = > e l `
2021-11-11 22:06:49 +01:00
< fieldset class = "form-group" >
2022-01-03 11:54:10 +01:00
$ { e . label ? el ` <label> ${ e . label } </label> ` : "" }
2021-11-11 22:06:49 +01:00
< img src = "data:${e.type};base64,${e.data}" >
< input name = "${e.name}" type = "text" ? required = "${e.required}" / >
< / f i e l d s e t >
2022-01-03 11:54:10 +01:00
` )({label:e.getAttribute("label"),name:e.getAttribute("var"),data:null==s?void 0:s.textContent,type:n.getAttribute("type"),required:!!e.querySelector("required")})}{var c;const t=e.getAttribute("var");return Pp({id:ha.getUniqueId(),label:e.getAttribute("label")||"",name:t,fixed_username:null==n?void 0:n.fixed_username,autocomplete:Vp(t,n),placeholder:null,required:!!e.querySelector("required"),type:Zp(e),value:null===(c=e.querySelector("value"))||void 0===c?void 0:c.textContent})}},Object.assign(ha,{getOOBURLMarkup:Kp});const ev=ha;var tv=n(4903),nv={};nv.styleTagTransform=vg(),nv.setAttributes=fg(),nv.insert=ug().bind(null,"head"),nv.domAPI=lg(),nv.insertStyleElement=gg(),ag()(tv.Z,nv),tv.Z&&tv.Z.locals&&tv.Z.locals,jl.elements.define("converse-gif",class extends ig{static get properties(){return{autoplay:{type:Boolean},noloop:{type:Boolean},progress_color:{type:String},fallback:{type:String},src:{type:String}}}constructor(){super(),this.autoplay=!1,this.noloop=!1,this.fallback="url"}initGIF(){const e={autoplay:this.autoplay,loop:!this.noloop};this.progress_color&&(e.progress_color=this.progress_color),this.supergif=new Lp(this,e)}updated(e){this.supergif&&!e.has("src")?(e.has("autoplay")&&(this.supergif.options.autoplay=this.autoplay),e.has("noloop")&&(this.supergif.options.loop=!this.noloop),e.has("progress_color")&&(this.supergif.options.progress_color=this.progress_color)):this.initGIF()}render(){var e;return null!==(e=this.supergif)&&void 0!==e&&e.load_error&&["url","empty"].includes(this.fallback)?this.renderErrorFallback():el ` < canvas class = "gif-canvas"
2021-11-11 22:06:49 +01:00
@ mouseover = $ { ( ) => this . setHover ( ) }
@ mouseleave = $ { ( ) => this . unsetHover ( ) }
2022-01-03 11:54:10 +01:00
@ click = $ { e => this . onControlsClicked ( e ) } > < img class = "gif" src = "${this.src}" > < / a > < / c a n v a s > ` } r e n d e r E r r o r F a l l b a c k ( ) { r e t u r n " u r l " = = = t h i s . f a l l b a c k ? Y p ( t h i s . s r c ) : " e m p t y " = = = t h i s . f a l l b a c k ? " " : v o i d 0 } s e t H o v e r ( ) { t h i s . s u p e r g i f & & ( t h i s . s u p e r g i f . h o v e r i n g = ! 0 , t h i s . h o v e r _ t i m e o u t & & c l e a r T i m e o u t ( t h i s . h o v e r _ t i m e o u t ) , t h i s . h o v e r _ t i m e o u t = s e t T i m e o u t ( ( ( ) = > t h i s . u n s e t H o v e r ( ) ) , 2 e 3 ) ) } u n s e t H o v e r ( ) { t h i s . s u p e r g i f & & ( t h i s . s u p e r g i f . h o v e r i n g = ! 1 ) } o n C o n t r o l s C l i c k e d ( e ) { e . p r e v e n t D e f a u l t ( ) , t h i s . s u p e r g i f . p l a y i n g ? t h i s . s u p e r g i f . p a u s e ( ) : ( t h i s . s u p e r g i f . o p t i o n s . l o o p = ! 0 , t h i s . s u p e r g i f . p l a y ( ) ) } } ) ; c o n s t s v = ( e , t ) = > e l ` < c o n v e r s e - g i f a u t o p l a y n o l o o p f a l l b a c k = ' e m p t y ' s r c = $ { e } > < / c o n v e r s e - g i f > $ { t ? " " : e l ` < a t a r g e t = " _ b l a n k " r e l = " n o o p e n e r " h r e f = " $ { e } " > $ { e } < / a > ` } ` , { U R I : i v } = $ l . e n v , r v = L g ( c l a s s e x t e n d s w p { r e n d e r ( e , t , n , s ) { r e t u r n t ? e l ` < a h r e f = " $ { t } " c l a s s = " c h a t - i m a g e _ _ l i n k " t a r g e t = " _ b l a n k " r e l = " n o o p e n e r " > $ { t h i s . r e n d e r I m a g e ( e , t , n , s ) } < / a > ` : t h i s . r e n d e r I m a g e ( e , t , n , s ) } r e n d e r I m a g e ( e , t , n , s ) { r e t u r n e l ` < i m g c l a s s = " c h a t - i m a g e i m g - t h u m b n a i l "
2021-11-11 22:06:49 +01:00
src = "${e}"
@ click = $ { s }
@ error = $ { ( ) => this . onError ( e , t , n , s ) }
2022-01-03 11:54:10 +01:00
@ load = $ { n } / > < / a > ` } o n E r r o r ( e , t , n , s ) { i f ( q l ( e ) ) t & & t h i s . s e t V a l u e ( Y p ( t ) ) ; e l s e { c o n s t i = n e w i v ( e ) , r = i . f i l e n a m e ( ) ; i . f i l e n a m e ( ` $ { r } . p n g ` ) , t h i s . s e t V a l u e ( r v ( i . t o S t r i n g ( ) , t , n , s ) ) } } } ) , o v = e = > e l ` $ { r v ( e . u r l , e . h r e f , e . o n L o a d , e . o n C l i c k ) } ` , a v = L g ( c l a s s e x t e n d s z g { r e n d e r ( e , t , n ) { c o n s t s = n e w y v ( e , t , O b j e c t . a s s i g n ( n , { s h o w _ i m a g e s : ! 1 , e m b e d _ v i d e o s : ! 1 , e m b e d _ a u d i o : ! 1 } ) ) ; r e t u r n e l ` $ { x p ( a s y n c f u n c t i o n ( e ) { t r y { a w a i t e . a d d T e m p l a t e s ( ) } c a t c h ( e ) { M . e r r o r ( e ) } r e t u r n e . p a y l o a d } ( s ) , e l ` $ { s } ` ) } ` } } ) , c v = [ " * " , " _ " , " ~ " , " ` " ] , l v = [ . . . c v , " ` ` ` " , " > " ] , d v = { " * " : { n a m e : " s t r o n g " , t y p e : " s p a n " } , _ : { n a m e : " e m p h a s i s " , t y p e : " s p a n " } , " ~ " : { n a m e : " s t r i k e " , t y p e : " s p a n " } , " ` " : { n a m e : " p r e f o r m a t t e d " , t y p e : " s p a n " } , " ` ` ` " : { n a m e : " p r e f o r m a t t e d _ b l o c k " , t y p e : " b l o c k " } , " > " : { n a m e : " q u o t e " , t y p e : " b l o c k " } } , u v = [ " _ " , " > " , " ` " , " ~ " ] , h v = { e m p h a s i s : ( e , t , n ) = > e l ` < s p a n c l a s s = " s t y l i n g - d i r e c t i v e " > _ < / s p a n > < i > $ { a v ( e , t , n ) } < / i > < s p a n c l a s s = " s t y l i n g - d i r e c t i v e " > _ < / s p a n > ` , p r e f o r m a t t e d : e = > e l ` < s p a n c l a s s = " s t y l i n g - d i r e c t i v e " > \ ` < / s p a n > < c o d e > $ { e } < / c o d e > < s p a n c l a s s = " s t y l i n g - d i r e c t i v e " > \ ` < / s p a n > ` , p r e f o r m a t t e d _ b l o c k : e = > e l ` < d i v c l a s s = " s t y l i n g - d i r e c t i v e " > \ ` \ ` \ ` < / d i v > < c o d e c l a s s = " b l o c k " > $ { e } < / c o d e > < d i v c l a s s = " s t y l i n g - d i r e c t i v e " > \ ` \ ` \ ` < / d i v > ` , q u o t e : ( e , t , n ) = > e l ` < b l o c k q u o t e > $ { a v ( e , t , n ) } < / b l o c k q u o t e > ` , s t r i k e : ( e , t , n ) = > e l ` < s p a n c l a s s = " s t y l i n g - d i r e c t i v e " > ~ < / s p a n > < d e l > $ { a v ( e , t , n ) } < / d e l > < s p a n c l a s s = " s t y l i n g - d i r e c t i v e " > ~ < / s p a n > ` , s t r o n g : ( e , t , n ) = > e l ` < s p a n c l a s s = " s t y l i n g - d i r e c t i v e " > * < / s p a n > < b > $ { a v ( e , t , n ) } < / b > < s p a n c l a s s = " s t y l i n g - d i r e c t i v e " > * < / s p a n > ` } ; f u n c t i o n f v ( e , t , n = ! 0 ) { l e t s ; i f ( ! / ( ^ ` ` ` \ s * \ n | ^ ` ` ` \ s * $ ) / . t e s t ( e . s l i c e ( t ) ) | | 0 ! = = t & & " \ n " ! = = e [ t - 1 ] & & " > " ! = = e [ t - 1 ] ) { i f ( ! l v . i n c l u d e s ( e . s l i c e ( t , t + 1 ) ) ) r e t u r n n u l l ; i f ( s = e . s l i c e ( t , t + 1 ) , ! f u n c t i o n ( e , t , n , s ) { i f ( s ) { c o n s t s = R e g E x p ( u v . i n c l u d e s ( e ) ? ` ^ ( \ \ p { L } | \ \ p { N } ) $ { e } ` : ` ^ ( \ \ p { L } | \ \ p { N } ) \ \ $ { e } ` , " u " ) ; i f ( n > 1 & & s . t e s t ( t . s l i c e ( n - 1 ) ) ) r e t u r n ! 1 ; i f ( g v ( e ) & & n > 0 & & " \ n " ! = = t [ n - 1 ] ) r e t u r n ! 1 ; i f ( c v . i n c l u d e s ( e ) & & t [ n + 1 ] = = = e ) r e t u r n ! 1 } e l s e { c o n s t s = R e g E x p ( u v . i n c l u d e s ( e ) ? ` ^ $ { e } ( \ \ p { L } | \ \ p { N } ) ` : ` ^ \ \ $ { e } ( \ \ p { L } | \ \ p { N } ) ` , " u " ) ; i f ( n < t . l e n g t h - 1 & & s . t e s t ( t . s l i c e ( n ) ) ) r e t u r n ! 1 ; i f ( c v . i n c l u d e s ( e ) & & t [ n - 1 ] = = = e ) r e t u r n ! 1 } r e t u r n ! 0 } ( s , e , t , n ) ) r e t u r n n u l l } e l s e s = e . s l i c e ( t , t + 3 ) ; r e t u r n s } f u n c t i o n m v ( e , t ) { c o n s t n = f v ( e , t ) , s = n ? f u n c t i o n ( e , t , n ) { i f ( ! e ) r e t u r n 0 ; c o n s t s = n ; i f ( n + = e . l e n g t h , g v ( e ) ) r e t u r n ( n + = t . s l i c e ( n ) . s p l i t ( / \ n [ ^ > ] / ) . s h i f t ( ) . l e n g t h ) - s ; i f ( " s p a n " = = = d v [ e ] . t y p e ) { c o n s t s = t . s l i c e ( n ) . s p l i t ( " \ n " ) . s h i f t ( ) ; l e t i = 0 , r = s . i n d e x O f ( e ) ; f o r ( ; - 1 ! = = r ; ) { i f ( f v ( t , n + r , ! 1 ) = = = e ) r e t u r n r + 2 * e . l e n g t h ; r = s . i n d e x O f ( e , i + + ) } r e t u r n 0 } { c o n s t s = t . s l i c e ( n + 1 ) ; l e t i = 0 , r = s . i n d e x O f ( e ) ; f o r ( ; - 1 ! = = r ; ) { i f ( f v ( t , n + 1 + r , ! 1 ) = = = e ) r e t u r n r + 1 + 2 * e . l e n g t h ; r = s . i n d e x O f ( e , i + + ) } r e t u r n 0 } } ( n , e , t ) : 0 ; r e t u r n s > 0 ? { d : n , l e n g t h : s } : { } } c o n s t g v = e = > [ " > " , " & g t ; " ] . i n c l u d e s ( e ) ; f u n c t i o n p v ( e , t , n , s ) { c o n s t i = h v [ d v [ e ] . n a m e ] ; r e t u r n g v ( e ) ? i ( t . r e p l a c e ( / \ n > / g , " \ n " ) . r e p l a c e ( / \ n $ / , " " ) , n , s ) : i ( t , n , s ) } c o n s t v v = e = > " s t r i n g " = = t y p e o f e ; c l a s s y v e x t e n d s S t r i n g { c o n s t r u c t o r ( e , t = 0 , n = { } ) { s u p e r ( e ) , t h i s . e m b e d _ a u d i o = n u l l = = n ? v o i d 0 : n . e m b e d _ a u d i o , t h i s . e m b e d _ v i d e o s = n u l l = = n ? v o i d 0 : n . e m b e d _ v i d e o s , t h i s . m e n t i o n s = ( n u l l = = n ? v o i d 0 : n . m e n t i o n s ) | | [ ] , t h i s . m e d i a _ u r l s = n u l l = = n ? v o i d 0 : n . m e d i a _ u r l s , t h i s . n i c k = n u l l = = n ? v o i d 0 : n . n i c k , t h i s . o f f s e t = t , t h i s . o n I m g C l i c k = n u l l = = n ? v o i d 0 : n . o n I m g C l i c k , t h i s . o n I m g L o a d = n u l l = = n ? v o i d 0 : n . o n I m g L o a d , t h i s . o p t i o n s = n , t h i s . p a y l o a d = [ ] , t h i s . r e f e r e n c e s = [ ] , t h i s . r e n d e r _ s t y l i n g = n u l l = = n ? v o i d 0 : n . r e n d e r _ s t y l i n g , t h i s . s h o w _ i m a g e s = n u l l = = n ? v o i d 0 : n . s h o w _ i m a g e s , t h i s . h i d e _ m e d i a _ u r l s = n u l l = = n ? v o i d 0 : n . h i d e _ m e d i a _ u r l s } s h o u l d R e n d e r M e d i a ( e , t ) { l e t n ; r e t u r n " i m a g e " = = = t ? n = t h i s . s h o w _ i m a g e s : " a u d i o " = = = t ? n = t h i s . e m b e d _ a u d i o : " v i d e o " = = = t & & ( n = t h i s . e m b e d _ v i d e o s ) , " b o o l e a n " = = t y p e o f n ? n : P l ( e , t ) } a d d H y p e r l i n k s ( e , t ) { c o n s t n = t + t h i s . o f f s e t ; E d ( t h i s . m e d i a _ u r l s | | e d ( e ) . m e d i a _ u r l s | | [ ] , e , n ) . f i l t e r ( ( e = > ! e . i s _ e n c r y p t e d ) ) . f o r E a c h ( ( e = > { c o n s t n = e . u r l , s = F l ( n ) ; l e t i ; i = H l ( n ) & & t h i s . s h o u l d R e n d e r M e d i a ( n , " i m a g e " ) ? s v ( s , t h i s . h i d e _ m e d i a _ u r l s ) : V l ( n ) & & t h i s . s h o u l d R e n d e r M e d i a ( n , " i m a g e " ) ? o v ( { u r l : s , h r e f : t h i s . h i d e _ m e d i a _ u r l s ? n u l l : s , o n C l i c k : t h i s . o n I m g C l i c k , o n L o a d : t h i s . o n I m g L o a d } ) : W l ( n ) & & t h i s . s h o u l d R e n d e r M e d i a ( n , " v i d e o " ) ? H p ( s , t h i s . h i d e _ m e d i a _ u r l s ) : G l ( n ) & & t h i s . s h o u l d R e n d e r M e d i a ( n , " a u d i o " ) ? N p ( s , t h i s . h i d e _ m e d i a _ u r l s ) : Y p ( s ) , t h i s . a d d T e m p l a t e R e s u l t ( e . s t a r t + t , e . e n d + t , i ) } ) ) } a d d M a p U R L s ( e , t ) { c o n s t n = / g e o : ( [ \ - 0 - 9 . ] + ) , ( [ \ - 0 - 9 . ] + ) ( ? : , ( [
2021-11-11 22:06:49 +01:00
< button type = "button" class = "btn btn--transparent btn--standalone" data - toggle = "dropdown" aria - haspopup = "true" aria - expanded = "false" >
< converse - icon color = "${this.color}" size = "1em" class = "${this.icon_classes}" >
2021-03-19 19:26:15 +01:00
< / b u t t o n >
2021-11-11 22:06:49 +01:00
< div class = "dropdown-menu" >
2022-01-03 11:54:10 +01:00
$ { this . items . map ( ( e => xp ( e , "" ) ) ) }
2021-11-11 22:06:49 +01:00
< / d i v >
2022-01-03 11:54:10 +01:00
` }firstUpdated(){super.firstUpdated(),this.initArrowNavigation()}hideMenu(){var e;super.hideMenu(),null===(e=this.navigator)||void 0===e||e.disable()}initArrowNavigation(){if(!this.navigator){const e={selector:".dropdown-item",onSelected:e=>e.focus()};this.navigator=new jv(this.menu,e)}}enableArrowNavigation(e){e&&(e.preventDefault(),e.stopPropagation()),this.navigator.enable(),this.navigator.select(this.menu.firstElementChild)}handleKeyUp(e){super.handleKeyUp(e),e.keyCode!== $ l.keycodes.DOWN_ARROW||this.navigator.enabled||this.enableArrowNavigation(e)}}jl.elements.define("converse-dropdown",Mv);const Rv=e=>{return e.image?el `
< svg xmlns = "http://www.w3.org/2000/svg" class = "avatar ${e.classes}" width = "${e.width}" height = "${e.height}" >
< image width = "${e.width}" height = "${e.height}" preserveAspectRatio = "xMidYMid meet" href = "${t=e.image,n=e.image_type,t.startsWith(" data : ")?t:`data:${n};base64,${t}`}" / >
< / s v g > ` : " " ; v a r t , n } ; v a r D v = n ( 5 2 2 2 ) , L v = { } ; L v . s t y l e T a g T r a n s f o r m = v g ( ) , L v . s e t A t t r i b u t e s = f g ( ) , L v . i n s e r t = u g ( ) . b i n d ( n u l l , " h e a d " ) , L v . d o m A P I = l g ( ) , L v . i n s e r t S t y l e E l e m e n t = g g ( ) , a g ( ) ( D v . Z , L v ) , D v . Z & & D v . Z . l o c a l s & & D v . Z . l o c a l s , j l . e l e m e n t s . d e f i n e ( " c o n v e r s e - a v a t a r " , c l a s s e x t e n d s i g { s t a t i c g e t p r o p e r t i e s ( ) { r e t u r n { d a t a : { t y p e : O b j e c t } , w i d t h : { t y p e : S t r i n g } , h e i g h t : { t y p e : S t r i n g } , n o n c e : { t y p e : S t r i n g } } } c o n s t r u c t o r ( ) { s u p e r ( ) , t h i s . w i d t h = 3 6 , t h i s . h e i g h t = 3 6 } r e n d e r ( ) { v a r e , t ; c o n s t n = ( n u l l = = = ( e = t h i s . d a t a ) | | v o i d 0 = = = e ? v o i d 0 : e . i m a g e _ t y p e ) | | w a . D E F A U L T _ I M A G E _ T Y P E ; l e t s ; v a r i , r ; n u l l ! = = ( t = t h i s . d a t a ) & & v o i d 0 ! = = t & & t . d a t a _ u r i ? s = n u l l = = = ( i = t h i s . d a t a ) | | v o i d 0 = = = i ? v o i d 0 : i . d a t a _ u r i : s = " d a t a : " + n + " ; b a s e 6 4 , " + ( ( n u l l = = = ( r = t h i s . d a t a ) | | v o i d 0 = = = r ? v o i d 0 : r . i m a g e ) | | w a . D E F A U L T _ I M A G E ) ; r e t u r n R v ( { c l a s s e s : t h i s . g e t A t t r i b u t e ( " c l a s s " ) , h e i g h t : t h i s . h e i g h t , w i d t h : t h i s . w i d t h , i m a g e : s , i m a g e _ t y p e : n } ) } } ) ; c o n s t { d a y j s : z v } = $ l . e n v ; j l . e l e m e n t s . d e f i n e ( " c o n v e r s e - m e s s a g e - v e r s i o n s " , c l a s s e x t e n d s i g { s t a t i c g e t p r o p e r t i e s ( ) { r e t u r n { m o d e l : { t y p e : O b j e c t } } } r e n d e r ( ) { c o n s t e = t h i s . m o d e l . g e t ( " o l d e r _ v e r s i o n s " ) , t = t h i s . m o d e l . g e t ( " m e s s a g e " ) ; r e t u r n e l `
2021-11-11 22:06:49 +01:00
< h4 > Older versions < / h 4 >
2022-01-03 11:54:10 +01:00
$ { Object . keys ( e ) . map ( ( t => el ` <p class="older-msg"><time> ${ zv ( t ) . format ( "MMM D, YYYY, HH:mm:ss" ) } </time>: ${ e [ t ] } </p> ` ) ) }
2021-11-11 22:06:49 +01:00
< hr / >
< h4 > Current version < / h 4 >
2022-01-03 11:54:10 +01:00
< p > $ { t } < / p > ` } } ) ; c o n s t P v = a p . e x t e n d ( { i d : " m e s s a g e - v e r s i o n s - m o d a l " , t o H T M L ( ) { r e t u r n ( e = > e l `
2021-03-19 19:26:15 +01:00
< div class = "modal-dialog" role = "document" >
< div class = "modal-content" >
< div class = "modal-header" >
2022-01-03 11:54:10 +01:00
< h4 class = "modal-title" id = "message-versions-modal-label" > $ { Eh ( "Message versions" ) } < / h 4 >
$ { lp }
2021-03-19 19:26:15 +01:00
< / d i v >
< div class = "modal-body" >
2021-11-11 22:06:49 +01:00
< converse - message - versions . model = $ { e } > < / c o n v e r s e - m e s s a g e - v e r s i o n s >
2021-03-19 19:26:15 +01:00
< / d i v >
2022-01-03 11:54:10 +01:00
< div class = "modal-footer" > $ { cp } < / d i v >
2021-03-19 19:26:15 +01:00
< / d i v >
< / d i v >
2022-01-03 11:54:10 +01:00
` )(this.model)}});var Fv=n(1551),Uv={};Uv.styleTagTransform=vg(),Uv.setAttributes=fg(),Uv.insert=ug().bind(null,"head"),Uv.domAPI=lg(),Uv.insertStyleElement=gg(),ag()(Fv.Z,Uv),Fv.Z&&Fv.Z.locals&&Fv.Z.locals;const Bv=ap.extend({id:"muc-occupant",initialize(){ap.prototype.initialize.apply(this,arguments),this.model&&this.listenTo(this.model,"change",this.render),jl.trigger("occupantModalInitialized",{model:this.model,message:this.message})},toHTML(){var e,t,n,s;const i=this.model??this.message,r=null==i?void 0:i.get("jid");return(e=>{var t,n;return el `
2021-11-11 22:06:49 +01:00
< div class = "modal-dialog" role = "document" >
< div class = "modal-content" >
< div class = "modal-header" >
< h5 class = "modal-title" id = "user-details-modal-label" > $ { e . display _name } < / h 5 >
2022-01-03 11:54:10 +01:00
$ { lp }
2021-11-11 22:06:49 +01:00
< / d i v >
2022-01-03 11:54:10 +01:00
< div class = "modal-body" class = "d-flex" >
< div class = "row" >
< div class = "col-auto" >
< converse - avatar
class = "avatar modal-avatar"
. data = $ { null === ( t = e . vcard ) || void 0 === t ? void 0 : t . attributes }
nonce = $ { null === ( n = e . vcard ) || void 0 === n ? void 0 : n . get ( "vcard_updated" ) }
height = "120" width = "120" > < / c o n v e r s e - a v a t a r >
< / d i v >
< div class = "col" >
< ul class = "occupant-details" >
< li >
$ { e . nick ? el ` <div class="row"><strong> ${ Eh ( "Nickname" ) } :</strong></div><div class="row"> ${ e . nick } </div> ` : "" }
< / l i >
< li >
$ { e . jid ? el ` <div class="row"><strong> ${ Eh ( "XMPP Address" ) } :</strong></div><div class="row"> ${ e . jid } </div> ` : "" }
< / l i >
< li >
$ { e . affiliation ? el ` <div class="row"><strong> ${ Eh ( "Affiliation" ) } :</strong></div><div class="row"> ${ e . affiliation } </div> ` : "" }
< / l i >
< li >
$ { e . role ? el ` <div class="row"><strong> ${ Eh ( "Roles" ) } :</strong></div><div class="row"> ${ e . role } </div> ` : "" }
< / l i >
< li >
$ { e . hats ? el ` <div class="row"><strong> ${ Eh ( "Hats" ) } :</strong></div><div class="row"> ${ e . hats } </div> ` : "" }
< / l i >
< li >
$ { e . occupant _id ? el ` <div class="row"><strong> ${ Eh ( "Occupant Id" ) } :</strong></div><div class="row"> ${ e . occupant _id } </div> ` : "" }
< / l i >
< / u l >
< / d i v >
< / d i v >
2021-11-11 22:06:49 +01:00
< / d i v >
< div class = "modal-footer" >
2022-01-03 11:54:10 +01:00
$ { cp }
2021-11-11 22:06:49 +01:00
< / d i v >
< / d i v >
< / d i v >
2022-01-03 11:54:10 +01:00
` })({jid:r,vcard:wa.vcards.findWhere({jid:r}),display_name:null==i?void 0:i.getDisplayName(),nick:i.get("nick"),occupant_id:i.get("occupant_id"),role:null===(e=this.model)||void 0===e?void 0:e.get("role"),affiliation:null===(t=this.model)||void 0===t?void 0:t.get("affiliation"),hats:null!==(n=this.model)&&void 0!==n&&null!==(s=n.get("hats"))&&void 0!==s&&s.length?this.model.get("hats"):null})}});wa.OccupantModal=Bv;const qv=Bv,Hv= $ l.env.utils,Gv=ap.extend({id:"user-details-modal",persistent:!0,events:{"click button.refresh-contact":"refreshContact"},initialize(){ap.prototype.initialize.apply(this,arguments),this.model.rosterContactAdded.then((()=>this.registerContactEventHandlers())),this.listenTo(this.model,"change",this.render),this.registerContactEventHandlers(),jl.trigger("userDetailsModalInitialized",this.model)},toHTML(){var e;const t=null===(e=this.model)||void 0===e?void 0:e.vcard,n=t?t.toJSON():{};return(e=>{const t=Eh("XMPP Address"),n=Eh("Email"),s=Eh("Full Name"),i=Eh("Nickname"),r=Eh("The User's Profile Image"),o=Eh("Refresh"),a=Eh("Role"),c=Eh("URL"),l={alt_text:r,extra_classes:"mb-3",height:"120",width:"120"};return el `
2021-11-11 22:06:49 +01:00
< div class = "modal-dialog" role = "document" >
< div class = "modal-content" >
< div class = "modal-header" >
< h5 class = "modal-title" id = "user-details-modal-label" > $ { e . display _name } < / h 5 >
2022-01-03 11:54:10 +01:00
$ { lp }
2021-11-11 22:06:49 +01:00
< / d i v >
< div class = "modal-body" >
2022-01-03 11:54:10 +01:00
$ { e . image ? el ` <div class="mb-4"> ${ Rv ( Object . assign ( e , l ) ) } </div> ` : "" }
$ { e . fullname ? el ` <p><label> ${ s } :</label> ${ e . fullname } </p> ` : "" }
2021-11-11 22:06:49 +01:00
< p > < label > $ { t } : < / l a b e l > < a h r e f = " x m p p : $ { e . j i d } " > $ { e . j i d } < / a > < / p >
2022-01-03 11:54:10 +01:00
$ { e . nickname ? el ` <p><label> ${ i } :</label> ${ e . nickname } </p> ` : "" }
$ { e . url ? el ` <p><label> ${ c } :</label> <a target="_blank" rel="noopener" href=" ${ e . url } "> ${ e . url } </a></p> ` : "" }
$ { e . email ? el ` <p><label> ${ n } :</label> <a href="mailto: ${ e . email } "> ${ e . email } </a></p> ` : "" }
$ { e . role ? el ` <p><label> ${ a } :</label> ${ e . role } </p> ` : "" }
2021-11-11 22:06:49 +01:00
2022-01-03 11:54:10 +01:00
< converse - omemo - fingerprints jid = $ { e . jid } > < / c o n v e r s e - o m e m o - f i n g e r p r i n t s >
2021-11-11 22:06:49 +01:00
< / d i v >
< div class = "modal-footer" >
2022-01-03 11:54:10 +01:00
$ { cp }
2021-11-11 22:06:49 +01:00
< button type = "button" class = "btn btn-info refresh-contact" > < i class = "fa fa-refresh" > < / i > $ { o } < / b u t t o n >
2022-01-03 11:54:10 +01:00
$ { e . allow _contact _removal && e . is _roster _contact ? ( e => { const t = Eh ( "Remove as contact" ) ; return el `
2021-11-11 22:06:49 +01:00
< button type = "button" @ click = "${e.removeContact}" class = "btn btn-danger remove-contact" >
< i class = "far fa-trash-alt" > < / i > $ { t }
< / b u t t o n >
` })(e):""}
2021-03-19 19:26:15 +01:00
< / d i v >
< / d i v >
2021-11-11 22:06:49 +01:00
< / d i v >
2022-01-03 11:54:10 +01:00
` })(Object.assign(this.model.toJSON(),n,{_converse:wa,allow_contact_removal:jl.settings.get("allow_contact_removal"),display_name:this.model.getDisplayName(),is_roster_contact:void 0!==this.model.contact,removeContact:e=>this.removeContact(e),view:this,utils:Hv}))},registerContactEventHandlers(){void 0!==this.model.contact&&(this.listenTo(this.model.contact,"change",this.render),this.listenTo(this.model.contact.vcard,"change",this.render),this.model.contact.on("destroy",(()=>{delete this.model.contact,this.render()})))},async refreshContact(e){e&&e.preventDefault&&e.preventDefault();const t=this.el.querySelector(".fa-refresh");Hv.addClass("fa-spin",t);try{await jl.vcard.update(this.model.contact.vcard,!0)}catch(e){M.fatal(e),this.alert(Eh("Sorry, something went wrong while trying to refresh"),"danger")}Hv.removeClass("fa-spin",t)},removeContact(e){var t;null==e||null===(t=e.preventDefault)||void 0===t||t.call(e),jl.settings.get("allow_contact_removal")&&!0===confirm(Eh("Are you sure you want to remove this contact?"))&&(setTimeout((()=>function(e){e.removeFromRoster((()=>e.destroy()),(t=>{t&&M.error(t),jl.alert("error",Eh("Error"),[Eh("Sorry, there was an error while trying to remove %1 $ s as a contact.",e.getDisplayName())])}))}(this.model.contact)),1),this.modal.hide())}});wa.UserDetailsModal=Gv;const Wv=Gv,{dayjs:Vv}= $ l.env,{dayjs:Jv}= $ l.env;function Qv(e){return!!Dl(e).host()}jl.elements.define("converse-image",class extends ig{static get properties(){return{href:{type:String},onImgLoad:{type:Function},text:{type:String}}}render(){const e=Fl(this.href);return Hl(this.text)&&this.shouldRenderMedia(this.text,"image")?sv(e):ov({url:this.text,href:e,onClick:this.onImgClick,onLoad:this.onImgLoad})}});const Zv=(e,t)=>e.url&&Qv(e.url)&&!Hl(e.image)?el ` < a href = "${e.url}" target = "_blank" rel = "noopener" > $ { t ( e ) } < / a > ` : t ( e ) , K v = e = > e l ` < c o n v e r s e - i m a g e c l a s s = " c a r d - i m g - t o p " t e x t = " $ { e . i m a g e } " h r e f = " $ { e . u r l } " . o n I m g L o a d = $ { e . o n l o a d } > < / c o n v e r s e - i m a g e > ` ; v a r Y v = n ( 5 0 4 6 ) , X v = { } ; X v . s t y l e T a g T r a n s f o r m = v g ( ) , X v . s e t A t t r i b u t e s = f g ( ) , X v . i n s e r t = u g ( ) . b i n d ( n u l l , " h e a d " ) , X v . d o m A P I = l g ( ) , X v . i n s e r t S t y l e E l e m e n t = g g ( ) , a g ( ) ( Y v . Z , X v ) , Y v . Z & & Y v . Z . l o c a l s & & Y v . Z . l o c a l s , j l . e l e m e n t s . d e f i n e ( " c o n v e r s e - m e s s a g e - u n f u r l " , c l a s s e x t e n d s i g { s t a t i c g e t p r o p e r t i e s ( ) { r e t u r n { d e s c r i p t i o n : { t y p e : S t r i n g } , i m a g e : { t y p e : S t r i n g } , j i d : { t y p e : S t r i n g } , t i t l e : { t y p e : S t r i n g } , u r l : { t y p e : S t r i n g } } } i n i t i a l i z e ( ) { c o n s t e = v a ( ) ; t h i s . l i s t e n T o ( e , " c h a n g e : a l l o w e d _ i m a g e _ d o m a i n s " , ( ( ) = > t h i s . r e q u e s t U p d a t e ( ) ) ) , t h i s . l i s t e n T o ( e , " c h a n g e : r e n d e r _ m e d i a " , ( ( ) = > t h i s . r e q u e s t U p d a t e ( ) ) ) } r e n d e r ( ) { r e t u r n ( e = > { c o n s t t = ( n = e . i m a g e ) & & U l ( n , " a l l o w e d _ i m a g e _ d o m a i n s " ) & & Q v ( n ) ; v a r n ; c o n s t s = e . t i t l e | | e . d e s c r i p t i o n | | e . u r l ; r e t u r n t | | s ? e l ` < d i v c l a s s = " c a r d c a r d - - u n f u r l " >
$ { t ? Zv ( e , Kv ) : "" }
$ { s ? el ` <div class="card-body">
$ { e . title ? Zv ( e , ( e => el ` <h5 class="card-title"> ${ e . title } </h5> ` ) ) : "" }
$ { e . description ? el ` <p class="card-text">
< converse - rich - text text = $ { e . description } > < / c o n v e r s e - r i c h - t e x t >
< / p > ` : " " }
$ { e . url ? el ` <p class="card-text">
< a href = "${e.url}" target = "_blank" rel = "noopener" > $ { Dl ( e . url ) . domain ( ) } < / a >
< / p > ` : " " }
< / d i v > ` : " " }
< /div>`:""})(Object.assign({onload:()=>this.onImageLoad()},{description:this.description||"",image:this.image||"",title:this.title||"",url:this.url||""}))}onImageLoad(){this.dispatchEvent(new CustomEvent("imageLoaded",{detail:this,bubbles:!0}))}});var ey=n(9523),ty={};ty.styleTagTransform=vg(),ty.setAttributes=fg(),ty.insert=ug().bind(null,"head"),ty.domAPI=lg(),ty.insertStyleElement=gg(),ag()(ey.Z,ty),ey.Z&&ey.Z.locals&&ey.Z.locals;const ny=(e={})=>{var t;return null!==(t=e.classes)&&void 0!==t&&t.includes("hor_centered")?el`<div class="spinner__container"><span class="spinner fa fa-spinner centered ${e.classes||""}"/ > < /div>`:el`<span class="spinner fa fa-spinner centered ${e.classes||""}"/ > ` };var sy=n(7272),iy=n.n(sy);const{dayjs:ry}= $ l.env;function oy(e){if(!e.isHidden()&&jl.settings.get("allow_url_history_change")){const t=window.location.hash;t&&e.messages.get(t.slice(1))&&wa.router.history.navigate()}}const ay=iy()((e=>function(e){const t=e.target;if("converse-chat-content"!==t.nodeName.toLowerCase())return;let n=!0;const s=0===Math.floor(t.scrollTop),i=Math.ceil(t.clientHeight-t.scrollTop)>=t.scrollHeight-Math.ceil(t.scrollHeight/20);s?(n=!1,oy(t.model)):i&&jl.trigger("chatBoxScrolledUp",t),t.model.get("scolled")!==n&&t.model.ui.set({scrolled:n})}(e)),50);function cy(e){if("groupchat"===e.get("type")){var t;const n=jl.settings.get("muc_hats").filter((e=>e)).map((e=>e.toLowerCase()));let s=[];n.includes("vcard_roles")&&(s=e.vcard?e.vcard.get("role"):null,s=s?s.split(",").filter((e=>e)).map((e=>({title:e}))):[]);const i=[...e.occupant?[e.occupant.get("role")]:[],...e.occupant?[e.occupant.get("affiliation")]:[]].filter((e=>e)).filter((e=>n.includes(e.toLowerCase()))).map((e=>({title:e})));return[...n.includes("xep317")&&(null===(t=e.occupant)||void 0===t?void 0:t.get("hats"))||[],...s,...i]}return[]}const{Strophe:ly,dayjs:dy}= $ l.env;jl.elements.define("converse-chat-message",class extends ig{static get properties(){return{jid:{type:String},mid:{type:String}}}async initialize(){if(await this.setModels(),!this.model)return void M.error("Could not find module for converse-chat-message");const e=va();this.listenTo(e,"change:render_media",(()=>{this.model.save("hide_url_previews",void 0),this.requestUpdate()})),this.listenTo(this.chatbox,"change:first_unread_id",(()=>this.requestUpdate())),this.listenTo(this.model,"change",(()=>this.requestUpdate())),this.model.vcard&&this.listenTo(this.model.vcard,"change",(()=>this.requestUpdate())),"groupchat"===this.model.get("type")&&(this.model.occupant?this.listenTo(this.model.occupant,"change",(()=>this.requestUpdate())):this.listenTo(this.model,"occupantAdded",(()=>{this.requestUpdate(),this.listenTo(this.model.occupant,"change",(()=>this.requestUpdate()))})))}async setModels(){this.chatbox=await jl.chatboxes.get(this.jid),await this.chatbox.initialized,await this.chatbox.messages.fetched,this.model=this.chatbox.messages.get(this.mid),this.model&&this.requestUpdate()}render(){return this.model?this.show_spinner?ny():this.model.get("file")&&this.model.get("upload")!==wa.SUCCESS?this.renderFileProgress():["mep"].includes(this.model.get("type"))?this.renderMEPMessage():["error","info"].includes(this.model.get("type"))?this.renderInfoMessage():this.renderChatMessage():""}getProps(){return Object.assign(this.model.toJSON(),this.getDerivedMessageProps())}renderRetraction(){return(e=>{const t=e.isRetracted()?e.getRetractionText():null;return el `
< div class = "retraction" > $ { t } < / d i v >
$ { e . model . get ( "moderation_reason" ) ? el ` <q class="chat-msg--retracted__reason"> ${ e . model . get ( "moderation_reason" ) } </q> ` : "" } ` })(this)}renderMessageText(){return(e=>{const t=Eh("Show more"),n="groupchat"===e.model.get("type"),s=Eh("Show less"),i=el `
< div class = "chat-msg__spoiler-hint" >
< span class = "spoiler-hint" > $ { e . model . get ( "spoiler_hint" ) } < / s p a n >
< a class = "badge badge-info spoiler-toggle" href = "#" @ click = $ { e . toggleSpoilerMessage } >
< i class = "fa ${e.model.get(" is _spoiler _visible ")?" fa - eye - slash ":" fa - eye "}" > < / i >
$ { e . model . get ( "is_spoiler_visible" ) ? s : t }
< / a >
< / d i v >
` ,r=e.model.get("is_spoiler")?"spoiler "+(e.model.get("is_spoiler_visible")?"":"hidden"):"",o=e.model.getMessageText(),a=e.model.get("oob_url")&&o!==e.model.get("oob_url");return el `
$ { e . model . get ( "is_spoiler" ) ? i : "" }
$ { e . model . get ( "subject" ) ? el ` <div class="chat-msg__subject"> ${ e . model . get ( "subject" ) } </div> ` : "" }
< span >
< converse - chat - message - body
class = "chat-msg__text ${e.model.get(" is _only _emojis ")?" chat - msg _ _text -- larger ":" "} ${r}"
. model = "${e.model}"
hide _url _previews = $ { e . model . get ( "hide_url_previews" ) }
? is _me _message = $ { e . model . isMeCommand ( ) }
text = "${o}" > < / c o n v e r s e - c h a t - m e s s a g e - b o d y >
$ { ! e . model . get ( "received" ) || e . model . isMeCommand ( ) || n ? "" : el ` <span class="fa fa-check chat-msg__receipt"></span> ` }
$ { e . model . get ( "edited" ) ? ( e => { const t = Eh ( "This message has been edited" ) ; return el ` <converse-icon title=" ${ t } " class="fa fa-edit chat-msg__edit-modal" @click= ${ e . showMessageVersionsModal } size="1em"></converse-icon> ` } ) ( e ) : "" }
< / s p a n >
$ { a ? el ` <div class="chat-msg__media"> ${ Kp ( e . model . get ( "oob_url" ) ) } </div> ` : "" }
< div class = "chat-msg__error" > $ { e . model . get ( "error_text" ) || e . model . get ( "error" ) } < / d i v >
` })(this)}renderMEPMessage(){return(e=>{const t=Jv(e.model.get("time")).toISOString();return el `
< div class = "message chat-info message--mep ${e.getExtraMessageClasses()}"
data - isodate = "${t}"
data - type = "${e.data_name}"
data - value = "${e.data_value}" >
< div class = "chat-msg__content" >
< div class = "chat-msg__body chat-msg__body--${e.model.get(" type ")} ${e.model.get(" is _delayed ")?" chat - msg _ _body -- delayed ":" "}" >
< div class = "chat-info__message" >
$ { e . isRetracted ( ) ? e . renderRetraction ( ) : el `
< converse - rich - text
. mentions = $ { e . model . get ( "references" ) }
render _styling
text = $ { e . model . getMessageText ( ) } >
< / c o n v e r s e - r i c h - t e x t >
$ { e . model . get ( "reason" ) ? el ` <q class="reason"><converse-rich-text text= ${ e . model . get ( "reason" ) } ></converse-rich-text></q> ` : "" }
` }
< / d i v >
< converse - message - actions
? is _retracted = $ { e . isRetracted ( ) }
. model = $ { e . model } > < / c o n v e r s e - m e s s a g e - a c t i o n s >
< / d i v >
< / d i v >
< / d i v > ` } ) ( t h i s ) } r e n d e r I n f o M e s s a g e ( ) { r e t u r n ( e = > { c o n s t t = V v ( e . m o d e l . g e t ( " t i m e " ) ) . t o I S O S t r i n g ( ) , n = E h ( " R e t r y " ) ; r e t u r n e l `
2021-11-11 22:06:49 +01:00
< div class = "message chat-info chat-${e.model.get(" type ")}"
data - isodate = "${t}"
data - type = "${e.data_name}"
data - value = "${e.data_value}" >
< div class = "chat-info__message" >
< converse - rich - text
. mentions = $ { e . model . get ( "references" ) }
render _styling
text = $ { e . model . getMessageText ( ) } >
< / c o n v e r s e - r i c h - t e x t >
< / d i v >
2022-01-03 11:54:10 +01:00
$ { e . model . get ( "reason" ) ? el ` <q class="reason"> ${ e . model . get ( "reason" ) } </q> ` : "" }
$ { e . model . get ( "error_text" ) ? el ` <q class="reason"> ${ e . model . get ( "error_text" ) } </q> ` : "" }
$ { e . model . get ( "retry_event_id" ) ? el ` <a class="retry" @click= ${ e . onRetryClicked } > ${ n } </a> ` : "" }
< / d i v > ` } ) ( t h i s ) } r e n d e r F i l e P r o g r e s s ( ) { r e t u r n t h i s . m o d e l . f i l e ? ( e = > { v a r t , n ; c o n s t s = E h ( " U p l o a d i n g f i l e : " ) , i = e . m o d e l . f i l e . n a m e , r = w d ( ) ( e . m o d e l . f i l e . s i z e ) ; r e t u r n e l `
< div class = "message chat-msg" >
$ { e . shouldShowAvatar ( ) ? el ` <a class="show-msg-author-modal" @click= ${ e . showUserModal } >
< converse - avatar class = "avatar align-self-center"
. data = $ { null === ( t = e . model . vcard ) || void 0 === t ? void 0 : t . attributes }
nonce = $ { null === ( n = e . model . vcard ) || void 0 === n ? void 0 : n . get ( "vcard_updated" ) }
height = "40" width = "40" > < / c o n v e r s e - a v a t a r >
< / a > ` : " " }
< div class = "chat-msg__content" >
< span class = "chat-msg__text" > $ { s } < strong > $ { i } < / s t r o n g > , $ { r } < / s p a n >
< progress value = "${e.model.get(" progress ")}" / >
< / d i v >
< / d i v > ` } ) ( t h i s ) : " " } r e n d e r C h a t M e s s a g e ( ) { r e t u r n ( ( e , t ) = > { v a r n , s , i ; c o n s t r = E h ( " N e w m e s s a g e s " ) , o = e . m o d e l . i s F o l l o w u p ( ) ; r e t u r n e l `
$ { t . is _first _unread ? el ` <div class="message separator"><hr class="separator"><span class="separator-text"> ${ r } </span></div> ` : "" }
2021-03-19 19:26:15 +01:00
< div class = "message chat-msg ${e.getExtraMessageClasses()}"
2021-11-11 22:06:49 +01:00
data - isodate = "${t.time}"
data - msgid = "${t.msgid}"
data - from = "${t.from}"
data - encrypted = "${t.is_encrypted}" >
2021-03-19 19:26:15 +01:00
<!-- Anchor to allow us to scroll the message into view -- >
2021-11-11 22:06:49 +01:00
< a id = "${t.msgid}" > < / a >
2021-03-19 19:26:15 +01:00
2022-01-03 11:54:10 +01:00
$ { t . should _show _avatar && ! o ? el ` <a class="show-msg-author-modal" @click= ${ e . showUserModal } >
< converse - avatar
class = "avatar align-self-center"
. data = $ { null === ( n = e . model . vcard ) || void 0 === n ? void 0 : n . attributes }
nonce = $ { null === ( s = e . model . vcard ) || void 0 === s ? void 0 : s . get ( "vcard_updated" ) }
height = "40" width = "40" > < / c o n v e r s e - a v a t a r >
< / a > ` : " " }
2021-03-19 19:26:15 +01:00
2022-01-03 11:54:10 +01:00
< div class = "chat-msg__content chat-msg__content--${t.sender} ${t.is_me_message?" chat - msg _ _content -- action ":" "}" >
$ { t . is _me _message || o ? "" : el `
2021-03-19 19:26:15 +01:00
< span class = "chat-msg__heading" >
2021-11-11 22:06:49 +01:00
< span class = "chat-msg__author" > < a class = "show-msg-author-modal" @ click = $ { e . showUserModal } > $ { t . username } < / a > < / s p a n >
2022-01-03 11:54:10 +01:00
$ { t . hats . map ( ( e => el ` <span class="badge badge-secondary"> ${ e . title } </span> ` ) ) }
2021-11-11 22:06:49 +01:00
< time timestamp = "${e.model.get(" edited ")||e.model.get(" time ")}" class = "chat-msg__time" > $ { t . pretty _time } < / t i m e >
2022-01-03 11:54:10 +01:00
$ { t . is _encrypted ? el ` <span class="fa fa-lock"></span> ` : "" }
2021-03-19 19:26:15 +01:00
< / s p a n > ` }
2022-01-03 11:54:10 +01:00
2021-11-11 22:06:49 +01:00
< div class = "chat-msg__body chat-msg__body--${t.message_type} ${t.received?" chat - msg _ _body -- received ":" "} ${t.is_delayed?" chat - msg _ _body -- delayed ":" "}" >
2021-03-19 19:26:15 +01:00
< div class = "chat-msg__message" >
2022-01-03 11:54:10 +01:00
$ { t . is _me _message ? el `
2021-11-11 22:06:49 +01:00
< time timestamp = "${t.edited||t.time}" class = "chat-msg__time" > $ { t . pretty _time } < / t i m e > & n b s p ;
< span class = "chat-msg__author" > $ { t . is _me _message ? "**" : "" } $ { t . username } < / s p a n > & n b s p ; ` : " " }
$ { t . is _retracted ? e . renderRetraction ( ) : e . renderMessageText ( ) }
2021-03-19 19:26:15 +01:00
< / d i v >
< converse - message - actions
. model = $ { e . model }
2022-01-03 11:54:10 +01:00
? is _retracted = $ { t . is _retracted } > < / c o n v e r s e - m e s s a g e - a c t i o n s >
2021-03-19 19:26:15 +01:00
< / d i v >
2021-11-11 22:06:49 +01:00
2022-01-03 11:54:10 +01:00
$ { null === ( i = e . model . get ( "ogp_metadata" ) ) || void 0 === i ? void 0 : i . map ( ( t => { var n ; return ! 0 === e . model . get ( "hide_url_previews" ) ? "" : Pl ( t [ "og:image" ] , "image" ) ? el ` <converse-message-unfurl
2021-11-11 22:06:49 +01:00
@ animationend = "${e.onUnfurlAnimationEnd}"
class = "${e.model.get(" url _preview _transition ")}"
jid = "${null===(n=e.chatbox)||void 0===n?void 0:n.get(" jid ")}"
description = "${t[" og : description "]||" "}"
title = "${t[" og : title "]||" "}"
image = "${t[" og : image "]||" "}"
2022-01-03 11:54:10 +01:00
url = "${t[" og : url "]||" "}" > < / c o n v e r s e - m e s s a g e - u n f u r l > ` : " " } ) ) }
2021-03-19 19:26:15 +01:00
< / d i v >
2022-01-03 11:54:10 +01:00
< / d i v > ` } ) ( t h i s , t h i s . g e t P r o p s ( ) ) } s h o u l d S h o w A v a t a r ( ) { r e t u r n j l . s e t t i n g s . g e t ( " s h o w _ m e s s a g e _ a v a t a r " ) & & ! t h i s . m o d e l . i s M e C o m m a n d ( ) & & [ " c h a t " , " g r o u p c h a t " ] . i n c l u d e s ( t h i s . m o d e l . g e t ( " t y p e " ) ) } o n U n f u r l A n i m a t i o n E n d ( ) { " f a d e - o u t " = = = t h i s . m o d e l . g e t ( " u r l _ p r e v i e w _ t r a n s i t i o n " ) & & t h i s . m o d e l . s a v e ( { h i d e _ u r l _ p r e v i e w s : ! 0 , u r l _ p r e v i e w _ t r a n s i t i o n : " f a d e - i n " } ) } a s y n c o n R e t r y C l i c k e d ( ) { t h i s . s h o w _ s p i n n e r = ! 0 , t h i s . r e q u e s t U p d a t e ( ) , a w a i t j l . t r i g g e r ( t h i s . m o d e l . g e t ( " r e t r y _ e v e n t _ i d " ) , { s y n c h r o n o u s : ! 0 } ) , t h i s . m o d e l . d e s t r o y ( ) , t h i s . p a r e n t E l e m e n t . r e m o v e C h i l d ( t h i s ) } i s R e t r a c t e d ( ) { r e t u r n t h i s . m o d e l . g e t ( " r e t r a c t e d " ) | | " r e t r a c t e d " = = = t h i s . m o d e l . g e t ( " m o d e r a t e d " ) } h a s M e n t i o n s ( ) { r e t u r n " g r o u p c h a t " = = = t h i s . m o d e l . g e t ( " t y p e " ) & & " t h e m " = = = t h i s . m o d e l . g e t ( " s e n d e r " ) & & t h i s . c h a t b o x . i s U s e r M e n t i o n e d ( t h i s . m o d e l ) } g e t O c c u p a n t A f f i l i a t i o n ( ) { v a r e ; r e t u r n n u l l = = = ( e = t h i s . m o d e l . o c c u p a n t ) | | v o i d 0 = = = e ? v o i d 0 : e . g e t ( " a f f i l i a t i o n " ) } g e t O c c u p a n t R o l e ( ) { v a r e ; r e t u r n n u l l = = = ( e = t h i s . m o d e l . o c c u p a n t ) | | v o i d 0 = = = e ? v o i d 0 : e . g e t ( " r o l e " ) } g e t E x t r a M e s s a g e C l a s s e s ( ) { c o n s t e = [ t h i s . m o d e l . i s F o l l o w u p ( ) ? " c h a t - m s g - - f o l l o w u p " : n u l l , t h i s . m o d e l . g e t ( " i s _ d e l a y e d " ) ? " d e l a y e d " : n u l l , t h i s . m o d e l . i s M e C o m m a n d ( ) ? " c h a t - m s g - - a c t i o n " : n u l l , t h i s . i s R e t r a c t e d ( ) ? " c h a t - m s g - - r e t r a c t e d " : n u l l , t h i s . m o d e l . g e t ( " t y p e " ) , t h i s . s h o u l d S h o w A v a t a r ( ) ? " c h a t - m s g - - w i t h - a v a t a r " : n u l l ] . m a p ( ( e = > e ) ) ; r e t u r n " g r o u p c h a t " = = = t h i s . m o d e l . g e t ( " t y p e " ) & & ( e . p u s h ( t h i s . g e t O c c u p a n t R o l e ( ) ? ? " " ) , e . p u s h ( t h i s . g e t O c c u p a n t A f f i l i a t i o n ( ) ? ? " " ) , " t h e m " = = = t h i s . m o d e l . g e t ( " s e n d e r " ) & & t h i s . h a s M e n t i o n s ( ) & & e . p u s h ( " m e n t i o n e d " ) ) , t h i s . m o d e l . g e t ( " c o r r e c t i n g " ) & & e . p u s h ( " c o r r e c t i n g " ) , e . f i l t e r ( ( e = > e ) ) . j o i n ( " " ) } g e t D e r i v e d M e s s a g e P r o p s ( ) { c o n s t e = j l . s e t t i n g s . g e t ( " t i m e _ f o r m a t " ) ; r e t u r n { p r e t t y _ t i m e : d y ( t h i s . m o d e l . g e t ( " e d i t e d " ) | | t h i s . m o d e l . g e t ( " t i m e " ) ) . f o r m a t ( e ) , h a s _ m e n t i o n s : t h i s . h a s M e n t i o n s ( ) , h a t s : c y ( t h i s . m o d e l ) , i s _ f i r s t _ u n r e a d : t h i s . c h a t b o x . g e t ( " f i r s t _ u n r e a d _ i d " ) = = = t h i s . m o d e l . g e t ( " i d " ) , i s _ m e _ m e s s a g e : t h i s . m o d e l . i s M e C o m m a n d ( ) , i s _ r e t r a c t e d : t h i s . i s R e t r a c t e d ( ) , u s e r n a m e : t h i s . m o d e l . g e t D i s p l a y N a m e ( ) , s h o u l d _ s h o w _ a v a t a r : t h i s . s h o u l d S h o w A v a t a r ( ) } } g e t R e t r a c t i o n T e x t ( ) { i f ( [ " g r o u p c h a t " , " m e p " ] . i n c l u d e s ( t h i s . m o d e l . g e t ( " t y p e " ) ) & & t h i s . m o d e l . g e t ( " m o d e r a t e d _ b y " ) ) { c o n s t e = t h i s . m o d e l . g e t ( " m o d e r a t e d _ b y " ) , t = t h i s . m o d e l . c o l l e c t i o n . c h a t b o x ; t h i s . m o d e l . m o d | | ( t h i s . m o d e l . m o d = t . o c c u p a n t s . f i n d O c c u p a n t ( { j i d : e } ) | | t . o c c u p a n t s . f i n d O c c u p a n t ( { n i c k : l y . g e t R e s o u r c e F r o m J i d ( e ) } ) ) ; c o n s t n = t h i s . m o d e l . m o d ? t h i s . m o d e l . m o d . g e t D i s p l a y N a m e ( ) : " A m o d e r a t o r " ; r e t u r n E h ( " % 1 $ s h a s r e m o v e d t h i s m e s s a g e " , n ) } r e t u r n E h ( " % 1 $ s h a s r e m o v e d t h i s m e s s a g e " , t h i s . m o d e l . g e t D i s p l a y N a m e ( ) ) } s h o w U s e r M o d a l ( e ) { i f ( " m e " = = = t h i s . m o d e l . g e t ( " s e n d e r " ) ) j l . m o d a l . s h o w ( w a . P r o f i l e M o d a l , { m o d e l : t h i s . m o d e l } , e ) ; e l s e i f ( " g r o u p c h a t " = = = t h i s . m o d e l . g e t ( " t y p e " ) ) e . p r e v e n t D e f a u l t ( ) , j l . m o d a l . s h o w ( q v , { m o d e l : t h i s . m o d e l . o c c u p a n t , m e s s a g e : t h i s . m o d e l } , e ) ; e l s e { e . p r e v e n t D e f a u l t ( ) ; c o n s t t = t h i s . m o d e l . c o l l e c t i o n . c h a t b o x ; j l . m o d a l . s h o w ( W v , { m o d e l : t } , e ) } } s h o w M e s s a g e V e r s i o n s M o d a l ( e ) { e . p r e v e n t D e f a u l t ( ) , j l . m o d a l . s h o w ( P v , { m o d e l : t h i s . m o d e l } , e ) } t o g g l e S p o i l e r M e s s a g e ( e ) { n u l l = = e | | e . p r e v e n t D e f a u l t ( ) , t h i s . m o d e l . s a v e ( { i s _ s p o i l e r _ v i s i b l e : ! t h i s . m o d e l . g e t ( " i s _ s p o i l e r _ v i s i b l e " ) } ) } } ) , j l . e l e m e n t s . d e f i n e ( " c o n v e r s e - m e s s a g e - h i s t o r y " , c l a s s e x t e n d s i g { s t a t i c g e t p r o p e r t i e s ( ) { r e t u r n { m o d e l : { t y p e : O b j e c t } , m e s s a g e s : { t y p e : A r r a y } } } r e n d e r ( ) { c o n s t e = t h i s . m e s s a g e s ; r e t u r n e . l e n g t h ? W g ( e , ( e = > e . g e t ( " i d " ) ) , ( e = > e l ` $ { t h i s . r e n d e r M e s s a g e ( e ) } ` ) ) : " " } r e n d e r M e s s a g e ( e ) { i f ( e . g e t ( " d a n g l i n g _ r e t r a c t i o n " ) | | e . g e t ( " i s _ o n l y _ k e y " ) ) r e t u r n " " ; c o n s t t = e . g e t ( " t e m p l a t e _ h o o k " ) ; i f ( " s t r i n g " = = t y p e o f t ) { c o n s t n = j l . h o o k ( t , e , " " ) ; r e t u r n x p ( n , " " ) } { c o n s t t = e l ` < c o n v e r s e - c h a t - m e s s a g e
2021-11-11 22:06:49 +01:00
jid = "${this.model.get(" jid ")}"
2022-01-03 11:54:10 +01:00
mid = "${e.get(" id ")}" > < / c o n v e r s e - c h a t - m e s s a g e > ` , n = f u n c t i o n ( e ) { v a r t ; c o n s t n = n u l l = = = ( t = e . c o l l e c t i o n ) | | v o i d 0 = = = t ? v o i d 0 : t . m o d e l s ; i f ( ! n ) r e t u r n ; c o n s t s = n . i n d e x O f ( e ) , i = n [ s - 1 ] ; i f ( ! i | | r y ( e . g e t ( " t i m e " ) ) . i s A f t e r ( r y ( i . g e t ( " t i m e " ) ) , " d a y " ) ) { c o n s t t = r y ( e . g e t ( " t i m e " ) ) . s t a r t O f ( " d a y " ) ; r e t u r n ( e = > e l `
2021-11-11 22:06:49 +01:00
< div class = "message date-separator" data - isodate = "${e.time}" >
2021-03-19 19:26:15 +01:00
< hr class = "separator" / >
2021-11-11 22:06:49 +01:00
< time class = "separator-text" datetime = "${e.time}" > < span > $ { e . datestring } < / s p a n > < / t i m e >
2021-03-19 19:26:15 +01:00
< / d i v >
2022-01-03 11:54:10 +01:00
` )({type:"date",time:t.toISOString(),datestring:t.format("dddd MMM Do YYYY")})}}(e);return n?[n,t]:t}}});var uy=n(8054),hy={};hy.styleTagTransform=vg(),hy.setAttributes=fg(),hy.insert=ug().bind(null,"head"),hy.domAPI=lg(),hy.insertStyleElement=gg(),ag()(uy.Z,hy),uy.Z&&uy.Z.locals&&uy.Z.locals,jl.elements.define("converse-chat-content",class extends ig{static get properties(){return{jid:{type:String}}}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("scroll",ay)}async initialize(){await this.setModels(),this.listenTo(this.model,"change:hidden_occupants",this.requestUpdate),this.listenTo(this.model.messages,"add",this.requestUpdate),this.listenTo(this.model.messages,"change",this.requestUpdate),this.listenTo(this.model.messages,"remove",this.requestUpdate),this.listenTo(this.model.messages,"rendered",this.requestUpdate),this.listenTo(this.model.messages,"reset",this.requestUpdate),this.listenTo(this.model.notifications,"change",this.requestUpdate),this.listenTo(this.model.ui,"change",this.requestUpdate),this.listenTo(this.model.ui,"change:scrolled",this.scrollDown),this.model.occupants&&this.listenTo(this.model.occupants,"change",this.requestUpdate),this.addEventListener("scroll",ay)}async setModels(){this.model=await jl.chatboxes.get(this.jid),await this.model.initialized,this.requestUpdate()}render(){var e;return this.model?el `
2021-11-11 22:06:49 +01:00
< div class = "chat-content__notifications" > $ { this . model . getNotificationsText ( ) } < / d i v >
2021-03-19 19:26:15 +01:00
< converse - message - history
2021-11-11 22:06:49 +01:00
. model = $ { this . model }
. messages = $ { [ ... this . model . messages . models ] } >
2021-03-19 19:26:15 +01:00
< / c o n v e r s e - m e s s a g e - h i s t o r y >
2022-01-03 11:54:10 +01:00
$ { null !== ( e = this . model . ui ) && void 0 !== e && e . get ( "chat-content-spinner-top" ) ? el ` <span class="spinner fa fa-spinner centered"></span> ` : "" }
` :""}scrollDown(){if(!this.model.ui.get("scrolled")){if(this.scrollTo){const e=this.scrollTop?"smooth":"auto";this.scrollTo({top:0,behavior:e})}else this.scrollTop=0;jl.trigger("chatBoxScrolledDown",{chatbox:this.model})}}});class fy extends zg{constructor(e){if(super(e),this.vt=nl,2!==e.type)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(e){if(e===nl)return this.Vt=void 0,this.vt=e;if(e===tl)return e;if("string"!=typeof e)throw Error(this.constructor.directiveName+"() called with a non-string value");if(e===this.vt)return this.Vt;this.vt=e;const t=[e];return t.raw=t,this.Vt={_ $ litType $ :this.constructor.resultType,strings:t,values:[]}}}fy.directiveName="unsafeHTML",fy.resultType=1;const my=Lg(fy);jl.elements.define("converse-chat-help",class extends ig{static get properties(){return{chat_type:{type:String},messages:{type:Array},model:{type:Object},type:{type:String}}}render(){const e=(new Date).toISOString();return[el ` < converse - icon class = "fas fa-times close-chat-help"
2021-03-19 19:26:15 +01:00
@ click = $ { this . close }
2022-01-03 11:54:10 +01:00
path - prefix = "${jl.settings.get(" assets _path ")}"
size = "1em" > < / c o n v e r s e - i c o n > ` , . . . t h i s . m e s s a g e s . m a p ( ( t = > t h i s . r e n d e r H e l p M e s s a g e ( { i s o d a t e : e , m a r k u p : O o ( ) . s a n i t i z e ( t , { A L L O W E D _ T A G S : [ " s t r o n g " ] } ) } ) ) ) ] } c l o s e ( ) { t h i s . m o d e l . s e t ( { s h o w _ h e l p _ m e s s a g e s : ! 1 } ) } r e n d e r H e l p M e s s a g e ( e ) { r e t u r n e l ` < d i v c l a s s = " m e s s a g e c h a t - $ { t h i s . t y p e } " d a t a - i s o d a t e = " $ { e . i s o d a t e } " > $ { m y ( e . m a r k u p ) } < / d i v > ` } } ) ; c o n s t g y = $ l . e n v . u t i l s , p y = e = > e l `
2021-03-19 19:26:15 +01:00
< li class = "emoji insert-emoji ${e.shouldBeHidden(e.emoji.sn)?" hidden ":" "}" data - emoji = "${e.emoji.sn}" title = "${e.emoji.sn}" >
2022-01-03 11:54:10 +01:00
< a href = "#" @ click = $ { e . insertEmoji } data - emoji = "${e.emoji.sn}" > $ { gy . shortnamesToEmojis ( e . emoji . sn ) } < / a >
2021-03-19 19:26:15 +01:00
< / l i >
2022-01-03 11:54:10 +01:00
` ,vy=e=>{const t=Eh("Search");return el `
2021-03-19 19:26:15 +01:00
< div class = "emoji-picker__header" >
< input class = "form-control emoji-search" name = "emoji-search" placeholder = "${t}"
. value = $ { e . query || "" }
@ keydown = $ { e . onSearchInputKeyDown }
@ blur = $ { e . onSearchInputBlurred }
@ focus = $ { e . onSearchInputFocus } >
2022-01-03 11:54:10 +01:00
$ { e . query ? "" : ( e => { const t = jl . settings . get ( "emoji_categories" ) ; return el ` <ul> ${ Object . keys ( t ) . map ( ( n => t [ n ] ? ( e => el `
2021-11-11 22:06:49 +01:00
< li data - category = "${e.category}"
class = "emoji-category ${e.category} ${e.current_category===e.category?" picked ":" "}"
2022-01-03 11:54:10 +01:00
title = "${Eh(jl.settings.get(" emoji _category _labels ")[e.category])}" >
2021-11-11 22:06:49 +01:00
< a class = "pick-category"
@ click = $ { e . onCategoryPicked }
href = "#emoji-picker-${e.category}"
data - category = "${e.category}" > $ { e . emoji } < / a >
< / l i >
` )(Object.assign({category:n,emoji:e.sn2Emoji(t[n])},e)):""))}</ul> ` } ) ( e ) }
2021-03-19 19:26:15 +01:00
< / d i v >
2022-01-03 11:54:10 +01:00
$ { e . render _emojis ? el ` <converse-emoji-picker-content
2021-03-19 19:26:15 +01:00
. chatview = $ { e . chatview }
. model = $ { e . model }
. search _results = "${e.search_results}"
current _skintone = "${e.current_skintone}"
query = "${e.query}" > < / c o n v e r s e - e m o j i - p i c k e r - c o n t e n t > ` : " " }
< div class = "emoji-skintone-picker" >
< label > Skin tone < / l a b e l >
2022-01-03 11:54:10 +01:00
< ul > $ { [ "tone1" , "tone2" , "tone3" , "tone4" , "tone5" ] . map ( ( t => ( e => el `
2021-03-19 19:26:15 +01:00
< li data - skintone = "${e.skintone}" class = "emoji-skintone ${e.current_skintone===e.skintone?" picked ":" "}" >
2022-01-03 11:54:10 +01:00
< a class = "pick-skintone" href = "#" data - skintone = "${e.skintone}" @ click = $ { e . onSkintonePicked } > $ { gy . shortnamesToEmojis ( ":" + e . skintone + ":" ) } < / a >
2021-11-11 22:06:49 +01:00
< / l i > ` ) ( O b j e c t . a s s i g n ( { s k i n t o n e : t } , e ) ) ) ) } < / u l >
2022-01-03 11:54:10 +01:00
< / d i v > ` } , { s i z z l e : y y } = $ l . e n v ; j l . e l e m e n t s . d e f i n e ( " c o n v e r s e - e m o j i - p i c k e r - c o n t e n t " , c l a s s e x t e n d s i g { s t a t i c g e t p r o p e r t i e s ( ) { r e t u r n { c h a t v i e w : { t y p e : O b j e c t } , s e a r c h _ r e s u l t s : { t y p e : A r r a y } , c u r r e n t _ s k i n t o n e : { t y p e : S t r i n g } , m o d e l : { t y p e : O b j e c t } , q u e r y : { t y p e : S t r i n g } } } r e n d e r ( ) { c o n s t e = { c u r r e n t _ s k i n t o n e : t h i s . c u r r e n t _ s k i n t o n e , i n s e r t E m o j i : e = > t h i s . i n s e r t E m o j i ( e ) , q u e r y : t h i s . q u e r y , s e a r c h _ r e s u l t s : t h i s . s e a r c h _ r e s u l t s , s h o u l d B e H i d d e n : e = > t h i s . s h o u l d B e H i d d e n ( e ) } ; r e t u r n e l `
2021-03-19 19:26:15 +01:00
< div class = "emoji-picker__lists" >
2022-01-03 11:54:10 +01:00
$ { ( e => { const t = Eh ( "Search results" ) ; return el `
2021-03-19 19:26:15 +01:00
< span ? hidden = $ { ! e . query } class = "emoji-lists__container emojis-lists__container--search" >
< a id = "emoji-picker-search-results" class = "emoji-category__heading" > $ { t } < / a >
< ul class = "emoji-picker" >
2022-01-03 11:54:10 +01:00
$ { e . search _results . map ( ( t => py ( Object . assign ( { emoji : t } , e ) ) ) ) }
2021-03-19 19:26:15 +01:00
< / u l >
< / s p a n >
` })(e)}
2022-01-03 11:54:10 +01:00
$ { ( e => { const t = jl . settings . get ( "emoji_categories" ) ; return el `
2021-11-11 22:06:49 +01:00
< span ? hidden = $ { e . query } class = "emoji-lists__container emoji-lists__container--browse" >
2022-01-03 11:54:10 +01:00
$ { Object . keys ( t ) . map ( ( n => t [ n ] ? ( e => el `
< a id = "emoji-picker-${e.category}" class = "emoji-category__heading" data - category = "${e.category}" > $ { Eh ( jl . settings . get ( "emoji_category_labels" ) [ e . category ] ) } < / a >
2021-11-11 22:06:49 +01:00
< ul class = "emoji-picker" data - category = "${e.category}" >
2022-01-03 11:54:10 +01:00
$ { Object . values ( $l . emojis . json [ e . category ] ) . map ( ( t => py ( Object . assign ( { emoji : t } , e ) ) ) ) }
2021-11-11 22:06:49 +01:00
< / u l > ` ) ( O b j e c t . a s s i g n ( { c a t e g o r y : n } , e ) ) : " " ) ) }
< / s p a n > ` } ) ( e ) }
2021-03-19 19:26:15 +01:00
< / d i v >
2022-01-03 11:54:10 +01:00
` }firstUpdated(){this.initIntersectionObserver()}initIntersectionObserver(){if(window.IntersectionObserver){if(this.observer)this.observer.disconnect();else{const e={root:this.querySelector(".emoji-picker__lists"),threshold:[.1]},t=e=>this.setCategoryOnVisibilityChange(e);this.observer=new IntersectionObserver(t,e)}yy(".emoji-picker",this).forEach((e=>this.observer.observe(e)))}}setCategoryOnVisibilityChange(e){const t=this.parentElement.navigator.selected;let n;if(n=e.filter((e=>e.target.contains(t))).pop()||e.reduce(((e,t)=>t.intersectionRatio>=((null==e?void 0:e.intersectionRatio)||0)?t:e),null),n&&n.isIntersecting){const e=n.target.getAttribute("data-category");e!==this.model.get("current_category")&&(this.parentElement.preserve_scroll=!0,this.model.save({current_category:e}))}}insertEmoji(e){e.preventDefault(),e.stopPropagation();const t="IMG"===e.target.nodeName?e.target.parentElement:e.target;this.parentElement.insertIntoTextArea(t.getAttribute("data-emoji"))}shouldBeHidden(e){if(e.includes("_tone")){if(!this.current_skintone||!e.includes(this.current_skintone))return!0}else if(this.current_skintone&& $ l.emojis.toned.includes(e))return!0;return!(!this.query||wa.FILTER_CONTAINS(e,this.query))}});const by= $ l.env.utils;jl.elements.define("converse-emoji-dropdown",class extends Mv{static get properties(){return{chatview:{type:Object}}}constructor(){super(),this.render_emojis=!1}initModel(){return this.init_promise||(this.init_promise=(async()=>{await jl.emojis.initialize();const e= ` converse . emoji - $ { wa . bare _jid } - $ { this . chatview . model . get ( "jid" ) } ` ;this.model=new wa.EmojiPicker({id:e}),_o(this.model,e),await new Promise((e=>this.model.fetch({success:e,error:e}))),this.model.set({autocompleting:null,ac_position:null})})()),this.init_promise}render(){return el `
2021-03-19 19:26:15 +01:00
< div class = "dropup" >
< button class = "toggle-emojis"
2022-01-03 11:54:10 +01:00
title = "${Eh(" Insert emojis ")}"
2021-03-19 19:26:15 +01:00
data - toggle = "dropdown"
aria - haspopup = "true"
aria - expanded = "false" >
< converse - icon
class = "fa fa-smile "
2022-01-03 11:54:10 +01:00
path - prefix = "${jl.settings.get(" assets _path ")}"
2021-03-19 19:26:15 +01:00
size = "1em" > < / c o n v e r s e - i c o n >
< / b u t t o n >
< div class = "dropdown-menu" >
2022-01-03 11:54:10 +01:00
$ { xp ( this . initModel ( ) . then ( ( ( ) => el `
2021-03-19 19:26:15 +01:00
< converse - emoji - picker
. chatview = $ { this . chatview }
. model = $ { this . model }
? render _emojis = $ { this . render _emojis }
current _category = "${this.model.get(" current _category ")||" "}"
current _skintone = "${this.model.get(" current _skintone ")||" "}"
query = "${this.model.get(" query ")||" "}"
2021-11-11 22:06:49 +01:00
> < / c o n v e r s e - e m o j i - p i c k e r > ` ) ) , " " ) }
2021-03-19 19:26:15 +01:00
< / d i v >
2022-01-03 11:54:10 +01:00
< / d i v > ` } c o n n e c t e d C a l l b a c k ( ) { s u p e r . c o n n e c t e d C a l l b a c k ( ) , t h i s . r e n d e r _ e m o j i s = ! 1 } t o g g l e M e n u ( e ) { e . s t o p P r o p a g a t i o n ( ) , e . p r e v e n t D e f a u l t ( ) , b y . h a s C l a s s ( " s h o w " , t h i s . m e n u ) ? b y . a n c e s t o r ( e . t a r g e t , " . t o g g l e - e m o j i s " ) & & t h i s . h i d e M e n u ( ) : t h i s . s h o w M e n u ( ) } a s y n c s h o w M e n u ( ) { a w a i t t h i s . i n i t M o d e l ( ) , t h i s . r e n d e r _ e m o j i s | | ( t h i s . r e n d e r _ e m o j i s = ! 0 , a w a i t t h i s . r e q u e s t U p d a t e ( ) ) , s u p e r . s h o w M e n u ( ) , s e t T i m e o u t ( ( ( ) = > { v a r e ; r e t u r n n u l l = = = ( e = t h i s . q u e r y S e l e c t o r ( " . e m o j i - s e a r c h " ) ) | | v o i d 0 = = = e ? v o i d 0 : e . f o c u s ( ) } ) ) } } ) ; v a r _ y = n ( 8 1 2 5 ) , w y = { } ; w y . s t y l e T a g T r a n s f o r m = v g ( ) , w y . s e t A t t r i b u t e s = f g ( ) , w y . i n s e r t = u g ( ) . b i n d ( n u l l , " h e a d " ) , w y . d o m A P I = l g ( ) , w y . i n s e r t S t y l e E l e m e n t = g g ( ) , a g ( ) ( _ y . Z , w y ) , _ y . Z & & _ y . Z . l o c a l s & & _ y . Z . l o c a l s ; c o n s t S y = $ l . e n v . u t i l s ; j l . e l e m e n t s . d e f i n e ( " c o n v e r s e - e m o j i - p i c k e r " , c l a s s e x t e n d s i g { s t a t i c g e t p r o p e r t i e s ( ) { r e t u r n { c h a t v i e w : { t y p e : O b j e c t } , c u r r e n t _ c a t e g o r y : { t y p e : S t r i n g , r e f l e c t : ! 0 } , c u r r e n t _ s k i n t o n e : { t y p e : S t r i n g , r e f l e c t : ! 0 } , m o d e l : { t y p e : O b j e c t } , q u e r y : { t y p e : S t r i n g , r e f l e t : ! 0 } , r e n d e r _ e m o j i s : { t y p e : B o o l e a n } } } f i r s t U p d a t e d ( ) { s u p e r . f i r s t U p d a t e d ( ) , t h i s . l i s t e n T o ( t h i s . m o d e l , " c h a n g e " , ( e = > t h i s . o n M o d e l C h a n g e d ( e . c h a n g e d ) ) ) , t h i s . i n i t A r r o w N a v i g a t i o n ( ) } c o n s t r u c t o r ( ) { s u p e r ( ) , t h i s . _ s e a r c h _ r e s u l t s = [ ] , t h i s . d e b o u n c e d F i l t e r = g c ( ( e = > t h i s . m o d e l . s e t ( { q u e r y : e . v a l u e } ) ) , 2 5 0 ) } g e t s e a r c h _ r e s u l t s ( ) { r e t u r n t h i s . _ s e a r c h _ r e s u l t s } s e t s e a r c h _ r e s u l t s ( e ) { t h i s . _ s e a r c h _ r e s u l t s = e , t h i s . r e q u e s t U p d a t e ( ) } r e n d e r ( ) { r e t u r n v y ( { c h a t v i e w : t h i s . c h a t v i e w , c u r r e n t _ c a t e g o r y : t h i s . c u r r e n t _ c a t e g o r y , c u r r e n t _ s k i n t o n e : t h i s . c u r r e n t _ s k i n t o n e , m o d e l : t h i s . m o d e l , o n C a t e g o r y P i c k e d : e = > t h i s . c h o o s e C a t e g o r y ( e ) , o n S e a r c h I n p u t B l u r r e d : e = > t h i s . c h a t v i e w . e m i t F o c u s e d ( e ) , o n S e a r c h I n p u t F o c u s : e = > t h i s . o n S e a r c h I n p u t F o c u s ( e ) , o n S e a r c h I n p u t K e y D o w n : e = > t h i s . o n K e y D o w n ( e ) , o n S k i n t o n e P i c k e d : e = > t h i s . c h o o s e S k i n T o n e ( e ) , q u e r y : t h i s . q u e r y , s e a r c h _ r e s u l t s : t h i s . s e a r c h _ r e s u l t s , r e n d e r _ e m o j i s : t h i s . r e n d e r _ e m o j i s , s n 2 E m o j i : e = > S y . s h o r t n a m e s T o E m o j i s ( t h i s . g e t T o n e d S h o r t n a m e ( e ) ) } ) } u p d a t e d ( e ) { e . h a s ( " q u e r y " ) & & t h i s . u p d a t e S e a r c h R e s u l t s ( e ) , e . h a s ( " c u r r e n t _ c a t e g o r y " ) & & t h i s . s e t S c r o l l P o s i t i o n ( ) } o n M o d e l C h a n g e d ( e ) { " c u r r e n t _ c a t e g o r y " i n e & & ( t h i s . c u r r e n t _ c a t e g o r y = e . c u r r e n t _ c a t e g o r y ) , " c u r r e n t _ s k i n t o n e " i n e & & ( t h i s . c u r r e n t _ s k i n t o n e = e . c u r r e n t _ s k i n t o n e ) , " q u e r y " i n e & & ( t h i s . q u e r y = e . q u e r y ) } s e t S c r o l l P o s i t i o n ( ) { i f ( t h i s . p r e s e r v e _ s c r o l l ) r e t u r n v o i d ( t h i s . p r e s e r v e _ s c r o l l = ! 1 ) ; c o n s t e = t h i s . q u e r y S e l e c t o r ( " . e m o j i - l i s t s _ _ c o n t a i n e r - - b r o w s e " ) , t = t h i s . q u e r y S e l e c t o r ( ` # e m o j i - p i c k e r - $ { t h i s . c u r r e n t _ c a t e g o r y } ` ) ; t & & ( e . s c r o l l T o p = t . o f f s e t T o p - 3 * t . o f f s e t H e i g h t + 4 ) } u p d a t e S e a r c h R e s u l t s ( e ) { c o n s t t = e . g e t ( " q u e r y " ) , n = w a . F I L T E R _ C O N T A I N S ; i f ( t h i s . q u e r y ) { i f ( t h i s . q u e r y = = = t ) r e t u r n t h i s . s e a r c h _ r e s u l t s ; t & & t h i s . q u e r y . i n c l u d e s ( t ) ? t h i s . s e a r c h _ r e s u l t s = t h i s . s e a r c h _ r e s u l t s . f i l t e r ( ( e = > n ( e . s n , t h i s . q u e r y ) ) ) : t h i s . s e a r c h _ r e s u l t s = $ l . e m o j i s . l i s t . f i l t e r ( ( e = > n ( e . s n , t h i s . q u e r y ) ) ) } e l s e t h i s . s e a r c h _ r e s u l t s . l e n g t h & & ( t h i s . s e a r c h _ r e s u l t s = [ ] ) ; t h i s . r e q u e s t U p d a t e ( ) } r e g i s t e r E v e n t s ( ) { t h i s . o n G l o b a l K e y D o w n = e = > t h i s . _ o n G l o b a l K e y D o w n ( e ) , d o c u m e n t . q u e r y S e l e c t o r ( " b o d y " ) . a d d E v e n t L i s t e n e r ( " k e y d o w n " , t h i s . o n G l o b a l K e y D o w n ) } c o n n e c t e d C a l l b a c k ( ) { s u p e r . c o n n e c t e d C a l l b a c k ( ) , t h i s . r e g i s t e r E v e n t s ( ) } d i s c o n n e c t e d C a l l b a c k ( ) { d o c u m e n t . q u e r y S e l e c t o r ( " b o d y " ) . r e m o v e E v e n t L i s t e n e r ( " k e y d o w n " , t h i s . o n G l o b a l K e y D o w n ) , s u p e r . d i s c o n n e c t e d C a l l b a c k ( ) } _ o n G l o b a l K e y D o w n ( e ) { t h i s . n a v i g a t o r & & ( e . k e y C o d e = = = $ l . k e y c o d e s . E N T E R & & t h i s . n a v i g a t o r . s e l e c t e d & & S y . i s V i s i b l e ( t h i s ) ? t h i s . o n E n t e r P r e s s e d ( e ) : e . k e y C o d e = = = $ l . k e y c o d e s . D O W N _ A R R O W & & ! t h i s . n a v i g a t o r . e n a b l e d & & S y . i s V i s i b l e ( t h i s ) & & t h i s . e n a b l e A r r o w N a v i g a t i o n ( e ) ) } s e t C a t e g o r y F o r E l e m e n t ( e ) { c o n s t t = t h i s . c u r r e n t _ c a t e g o r y , n = ( n u l l = = e ? v o i d 0 : e . g e t A t t r i b u t e ( " d a t a - c a t e g o r y " ) ) | | t ; t ! = = n & & t h i s . m o d e l . s a v e ( { c u r r e n t _ c a t e g o r y : n } ) } i n s e r t I n t o T e x t A r e a ( e ) { c o n s t t = t h i s . m o d e l . g e t ( " a u t o c o m p l e t i n g " ) , n = t h i s . m o d e l . g e t ( " a c _ p o s i t i o n " ) ; t h i s . c h a t v i e w . g e t M e s s a g e F o r m ( ) . i n s e r t I n t o T e x t A r e a ( e , t , ! 1 , n ) , t h i s . m o d e l . s e t ( { a u t o c o m p l e t i n g : n u l l , q u e r y : " " , a c _ p o s i t i o n : n u l l } ) } c h o o s e S k i n T o n e ( e ) { e . p r e v e n t D e f a u l t ( ) , e . s t o p P r o p a g a t i o n ( ) ; c o n s t t = ( " I M G " = = = e . t a r g e t . n o d e N a m e ? e . t a r g e t . p a r e n t E l e m e n t : e . t a r g e t ) . g e t A t t r i b u t e ( " d a t a - s k i n t o n e " ) . t r i m ( ) ; t h i s . c u r r e n t _ s k i n t o n e = = = t ? t h i s . m o d e l . s a v e ( { c u r r e n t _ s k i n t o n e : " " } ) : t h i s . m o d e l . s a v e ( { c u r r e n t _ s k i n t o n e : t } ) } c h o o s e C a t e g o r y ( e ) { e . p r e v e n t D e f a u l t & & e . p r e v e n t D e f a u l t ( ) , e . s t o p P r o p a g a t i o n & & e . s t o p P r o p a g a t i o n ( ) ;
2021-11-11 22:06:49 +01:00
< a href = "#" class = "dropdown-item ${t.a_class}" @ click = $ { t . handler } title = "${t.i18n_title}" >
< converse - icon size = "1em" color = "var(--text-color-lighten-15-percent)" class = "fa ${t.icon_class}" > < / c o n v e r s e - i c o n >
$ { t . i18n _text }
< / a >
2022-01-03 11:54:10 +01:00
` :""}async function Ty(e){const t=await e;return el `
2021-11-11 22:06:49 +01:00
< a
href = "#"
class = "chatbox-btn ${t.a_class} fa ${t.icon_class}"
@ click = $ { t . handler }
title = "${t.i18n_title}"
> < / a >
2022-01-03 11:54:10 +01:00
` }async function ky(e){!0===confirm(Eh("Are you sure you want to clear the messages from this conversation?"))&&await e.clearMessages()}function jy(e,t){const n=t.replace(/^ \s */,"").match(/^ \/ (.*) \s * $ /);if(n){if("clear"===n[1])return ky(e),!0;var s;if("close"===n[1])return null===(s=wa.chatboxviews.get(e.get("jid")))||void 0===s||s.close(),!0;if("help"===n[1])return e.set({show_help_messages:!1},{silent:!0}),e.set({show_help_messages:!0}),!0}}function Ny(e){if(e.target.value){const t=e.target.scrollHeight+"px";e.target.style.height!=t&&(e.target.style.height="auto",e.target.style.height=t)}else e.target.style=""}window.customElements.define("converse-chat-toolbar",class extends ig{static get properties(){return{composing_spoiler:{type:Boolean},hidden_occupants:{type:Boolean},is_groupchat:{type:Boolean},message_limit:{type:Number},model:{type:Object},show_call_button:{type:Boolean},show_emoji_button:{type:Boolean},show_send_button:{type:Boolean},show_spoiler_button:{type:Boolean}}}connectedCallback(){super.connectedCallback(),this.listenTo(this.model,"change:composing_spoiler",this.requestUpdate)}render(){return el `
< span class = "toolbar-buttons" > $ { xp ( ( e = this ) . getButtons ( ) , "" ) } < / s p a n >
$ { e . show _send _button ? function ( ) { const e = Eh ( "Send the message" ) ; return el ` <button type="submit" class="btn send-button" title=" ${ e } ">
< converse - icon color = "var(--toolbar-btn-text-color)" class = "fa fa-paper-plane" size = "1em" > < / c o n v e r s e - i c o n >
< / b u t t o n > ` } ( ) : " " }
` ;var e}firstUpdated(){jl.trigger("renderToolbar",this)}getButtons(){var e;const t=[];if(this.show_emoji_button){const e=wa.chatboxviews.get(this.model.get("jid"));t.push(el ` < converse - emoji - dropdown . chatview = $ { e } > < / c o n v e r s e - e m o j i - d r o p d o w n > ` ) } i f ( t h i s . s h o w _ c a l l _ b u t t o n ) { c o n s t e = E h ( " S t a r t a c a l l " ) ; t . p u s h ( e l `
2021-11-11 22:06:49 +01:00
< button class = "toggle-call" @ click = $ { this . toggleCall } title = "${e}" >
2021-03-19 19:26:15 +01:00
< converse - icon class = "fa fa-phone" path - prefix = "/dist" size = "1em" > < / c o n v e r s e - i c o n >
2022-01-03 11:54:10 +01:00
< / b u t t o n > ` ) } j l . s e t t i n g s . g e t ( " m e s s a g e _ l i m i t " ) & & t . p u s h ( e l `
2021-11-11 22:06:49 +01:00
< converse - message - limit - indicator . model = $ { this . model } class = "right" >
2022-01-03 11:54:10 +01:00
< / c o n v e r s e - m e s s a g e - l i m i t - i n d i c a t o r > ` ) , t h i s . s h o w _ s p o i l e r _ b u t t o n & & t . p u s h ( t h i s . g e t S p o i l e r B u t t o n ( ) ) ; c o n s t n = j l . d i s c o . s u p p o r t s ( A y . N S . H T T P U P L O A D , w a . d o m a i n ) ; i f ( t . p u s h ( e l ` $ { x p ( n . t h e n ( ( e = > t h i s . g e t H T T P U p l o a d B u t t o n ( e ) ) ) , " " ) } ` ) , t h i s . i s _ g r o u p c h a t & & n u l l ! = = ( e = j l . s e t t i n g s . g e t ( " v i s i b l e _ t o o l b a r _ b u t t o n s " ) ) & & v o i d 0 ! = = e & & e . t o g g l e _ o c c u p a n t s ) { c o n s t e = E h ( " H i d e p a r t i c i p a n t s " ) , n = E h ( " S h o w p a r t i c i p a n t s " ) ; t . p u s h ( e l `
2021-03-19 19:26:15 +01:00
< button class = "toggle_occupants right"
2021-11-11 22:06:49 +01:00
title = "${this.hidden_occupants?n:e}"
2021-03-19 19:26:15 +01:00
@ click = $ { this . toggleOccupants } >
< converse - icon class = "fa ${this.hidden_occupants?" fa - angle - double - left ":" fa - angle - double - right "}"
2022-01-03 11:54:10 +01:00
path - prefix = "${jl.settings.get(" assets _path ")}" size = "1em" > < / c o n v e r s e - i c o n >
< / b u t t o n > ` ) } r e t u r n w a . a p i . h o o k ( " g e t T o o l b a r B u t t o n s " , t h i s , t ) } g e t H T T P U p l o a d B u t t o n ( e ) { i f ( e ) { c o n s t e = E h ( " C h o o s e a f i l e t o s e n d " ) ; r e t u r n e l `
2021-03-19 19:26:15 +01:00
< button title = "${e}" @ click = $ { this . toggleFileUpload } >
< converse - icon class = "fa fa-paperclip"
2022-01-03 11:54:10 +01:00
path - prefix = "${jl.settings.get(" assets _path ")}"
2021-03-19 19:26:15 +01:00
size = "1em" > < / c o n v e r s e - i c o n >
< / b u t t o n >
2022-01-03 11:54:10 +01:00
< input type = "file" @ change = $ { this . onFileSelection } class = "fileupload" multiple = "" style = "display:none" / > ` }return""}getSpoilerButton(){var e;const t=this.model;if(!(this.is_groupchat||null!==(e=t.presence)&&void 0!==e&&e.resources.length))return;let n;n=this.composing_spoiler?Eh("Click to write as a normal (non-spoiler) message"):Eh("Click to write your message as a spoiler");const s=el `
2021-03-19 19:26:15 +01:00
< button class = "toggle-compose-spoiler"
2021-11-11 22:06:49 +01:00
title = "${n}"
2021-03-19 19:26:15 +01:00
@ click = $ { this . toggleComposeSpoilerMessage } >
< converse - icon class = "fa ${this.composing_spoiler?" fa - eye - slash ":" fa - eye "}"
2022-01-03 11:54:10 +01:00
path - prefix = "${jl.settings.get(" assets _path ")}"
2021-03-19 19:26:15 +01:00
size = "1em" > < / c o n v e r s e - i c o n >
2022-01-03 11:54:10 +01:00
< /button>`;if(this.is_groupchat)return s;{const e=t.get("jid"),n=Promise.all(t.presence.resources.map((t=>jl.disco.supports(Ay.NS.SPOILER,`${e}/ $ { t . get ( "name" ) } ` )))).then((e=>e.reduce(((e,t)=>e&&t),!0)));return el ` $ { xp ( n . then ( ( ( ) => s ) ) , "" ) } ` }}toggleFileUpload(e){var t,n;null==e||null===(t=e.preventDefault)||void 0===t||t.call(e),null==e||null===(n=e.stopPropagation)||void 0===n||n.call(e),this.querySelector(".fileupload").click()}onFileSelection(e){this.model.sendFiles(e.target.files)}toggleComposeSpoilerMessage(e){var t,n;null==e||null===(t=e.preventDefault)||void 0===t||t.call(e),null==e||null===(n=e.stopPropagation)||void 0===n||n.call(e),this.model.set("composing_spoiler",!this.model.get("composing_spoiler"))}toggleOccupants(e){var t,n;null==e||null===(t=e.preventDefault)||void 0===t||t.call(e),null==e||null===(n=e.stopPropagation)||void 0===n||n.call(e),this.model.save({hidden_occupants:!this.model.get("hidden_occupants")})}toggleCall(e){var t,n;null==e||null===(t=e.preventDefault)||void 0===t||t.call(e),null==e||null===(n=e.stopPropagation)||void 0===n||n.call(e),jl.trigger("callButtonClicked",{connection:wa.connection,model:this.model})}});var Oy=n(7802), $ y={}; $ y.styleTagTransform=vg(), $ y.setAttributes=fg(), $ y.insert=ug().bind(null,"head"), $ y.domAPI=lg(), $ y.insertStyleElement=gg(),ag()(Oy.Z, $ y),Oy.Z&&Oy.Z.locals&&Oy.Z.locals,jl.elements.define("converse-chat-heading",class extends ig{initialize(){var e;this.model=wa.chatboxes.get(this.getAttribute("jid")),this.listenTo(this.model,"change:status",this.requestUpdate),this.listenTo(this.model,"vcard:add",this.requestUpdate),this.listenTo(this.model,"vcard:change",this.requestUpdate),this.model.contact&&this.listenTo(this.model.contact,"destroy",this.requestUpdate),null===(e=this.model.rosterContactAdded)||void 0===e||e.then((()=>{this.listenTo(this.model.contact,"change:nickname",this.requestUpdate),this.requestUpdate()}))}render(){return(e=>{var t,n;const s=Eh("The User's Profile Image"),i=el ` < span title = "${s}" >
< converse - avatar
class = "avatar chat-msg__avatar"
. data = $ { null === ( t = e . model . vcard ) || void 0 === t ? void 0 : t . attributes }
nonce = $ { null === ( n = e . model . vcard ) || void 0 === n ? void 0 : n . get ( "vcard_updated" ) }
height = "40" width = "40" > < / c o n v e r s e - a v a t a r > < / s p a n > ` , r = e . m o d e l . g e t D i s p l a y N a m e ( ) ; r e t u r n e l `
2021-11-11 22:06:49 +01:00
< div class = "chatbox-title ${e.status?" ":" chatbox - title -- no - desc "}" >
< div class = "chatbox-title--row" >
2022-01-03 11:54:10 +01:00
$ { wa . api . settings . get ( "singleton" ) ? "" : el ` <converse-controlbox-navback jid=" ${ e . jid } "></converse-controlbox-navback> ` }
$ { e . type !== wa . HEADLINES _TYPE ? el ` <a class="show-msg-author-modal" @click= ${ e . showUserDetailsModal } > ${ i } </a> ` : "" }
2021-11-11 22:06:49 +01:00
< div class = "chatbox-title__text" title = "${e.jid}" >
2022-01-03 11:54:10 +01:00
$ { e . type !== wa . HEADLINES _TYPE ? el ` <a class="user show-msg-author-modal" @click= ${ e . showUserDetailsModal } > ${ r } </a> ` : r }
2021-11-11 22:06:49 +01:00
< / d i v >
2021-03-19 19:26:15 +01:00
< / d i v >
2021-11-11 22:06:49 +01:00
< div class = "chatbox-title__buttons row no-gutters" >
2022-01-03 11:54:10 +01:00
$ { xp ( async function ( e ) { return ( await e ) . filter ( ( e => ! e . standalone ) ) . map ( ( e => Cy ( e ) ) ) } ( e . heading _buttons _promise ) . then ( ( e => e . length ? el ` <converse-dropdown class="dropleft" color="var(--chat-head-text-color)" .items= ${ e } ></converse-dropdown> ` : "" ) ) , "" ) }
$ { xp ( async function ( e ) { return ( await e ) . filter ( ( e => e . standalone ) ) . map ( ( e => Ty ( e ) ) ) } ( e . heading _buttons _promise ) . then ( ( e => e . reverse ( ) . map ( ( e => xp ( e , "" ) ) ) ) ) , "" ) }
2021-03-19 19:26:15 +01:00
< / d i v >
< / d i v >
2022-01-03 11:54:10 +01:00
$ { e . status ? el ` <p class="chat-head__desc"> ${ e . status } </p> ` : "" }
` })(Object.assign(this.model.toJSON(),{heading_buttons_promise:this.getHeadingButtons(),model:this.model,showUserDetailsModal:e=>this.showUserDetailsModal(e)}))}showUserDetailsModal(e){e.preventDefault(),jl.modal.show(Wv,{model:this.model},e)}close(e){e.preventDefault(),this.model.close()}getHeadingButtons(){const e=[{a_class:"show-user-details-modal",handler:e=>this.showUserDetailsModal(e),i18n_text:Eh("Details"),i18n_title:Eh("See more information about this person"),icon_class:"fa-id-card",name:"details",standalone:"overlayed"===jl.settings.get("view_mode")}];jl.settings.get("singleton")||e.push({a_class:"close-chatbox-button",handler:e=>this.close(e),i18n_text:Eh("Close"),i18n_title:Eh("Close and end this conversation"),icon_class:"fa-times",name:"close",standalone:"overlayed"===jl.settings.get("view_mode")});const t=wa.chatboxviews.get(this.getAttribute("jid"));return t?wa.api.hook("getHeadingButtons",t,e):e}});const{u:Iy}= $ l.env;class My extends Ng{async connectedCallback(){super.connectedCallback(),this.model=wa.chatboxes.get(this.getAttribute("jid")),await this.model.initialized,this.listenTo(this.model.messages,"change:correcting",this.onMessageCorrecting),this.render()}toHTML(){var e,t;return(e=>{const t=e.composing_spoiler?Eh("Hidden message"):Eh("Message"),n=Eh("Optional hint"),s=jl.settings.get("show_send_button");return el `
2021-11-11 22:06:49 +01:00
< form class = "sendXMPPMessage" >
< input type = "text" placeholder = "${n||" "}" value = "${e.hint_value||" "}" class = "${e.composing_spoiler?" ":" hidden "} spoiler-hint" / >
< textarea
autofocus
type = "text"
@ drop = $ { e . onDrop }
2022-01-03 11:54:10 +01:00
@ input = $ { Ny }
2021-11-11 22:06:49 +01:00
@ keydown = $ { e . onKeyDown }
@ keyup = $ { e . onKeyUp }
@ paste = $ { e . onPaste }
@ change = $ { e . onChange }
class = " chat - textarea
$ { s ? "chat-textarea-send-button" : "" }
$ { e . composing _spoiler ? "spoiler" : "" } "
placeholder = "${t}" > $ { e . message _value || "" } < / t e x t a r e a >
2022-01-03 11:54:10 +01:00
< / f o r m > ` } ) ( O b j e c t . a s s i g n ( t h i s . m o d e l . t o J S O N ( ) , { o n D r o p : e = > t h i s . o n D r o p ( e ) , h i n t _ v a l u e : n u l l = = = ( e = t h i s . q u e r y S e l e c t o r ( " . s p o i l e r - h i n t " ) ) | | v o i d 0 = = = e ? v o i d 0 : e . v a l u e , m e s s a g e _ v a l u e : n u l l = = = ( t = t h i s . q u e r y S e l e c t o r ( " . c h a t - t e x t a r e a " ) ) | | v o i d 0 = = = t ? v o i d 0 : t . v a l u e , o n C h a n g e : e = > t h i s . m o d e l . s e t ( { d r a f t : e . t a r g e t . v a l u e } ) , o n K e y D o w n : e = > t h i s . o n K e y D o w n ( e ) , o n K e y U p : e = > t h i s . o n K e y U p ( e ) , o n P a s t e : e = > t h i s . o n P a s t e ( e ) , v i e w U n r e a d M e s s a g e s : e = > t h i s . v i e w U n r e a d M e s s a g e s ( e ) } ) ) } i n s e r t I n t o T e x t A r e a ( e , t = ! 1 , n = ! 1 , s ) { c o n s t i = t h i s . q u e r y S e l e c t o r ( " . c h a t - t e x t a r e a " ) ; i f ( n ? I y . a d d C l a s s ( " c o r r e c t i n g " , i ) : I y . r e m o v e C l a s s ( " c o r r e c t i n g " , i ) , t ) i . v a l u e = s & & " s t r i n g " = = t y p e o f t ? i . v a l u e . r e p l a c e ( n e w R e g E x p ( t , " g " ) , ( ( n , i ) = > i = = s - t . l e n g t h ? e + " " : n ) ) : e ; e l s e { l e t t = i . v a l u e ; t & & " " ! = = t [ t . l e n g t h - 1 ] & & ( t + = " " ) , i . v a l u e = t + e + " " } c o n s t r = d o c u m e n t . c r e a t e E v e n t ( " H T M L E v e n t s " ) ; r . i n i t E v e n t ( " c h a n g e " , ! 1 , ! 0 ) , i . d i s p a t c h E v e n t ( r ) , I y . p l a c e C a r e t A t E n d ( i ) } o n M e s s a g e C o r r e c t i n g ( e ) { i f ( e . g e t ( " c o r r e c t i n g " ) ) t h i s . i n s e r t I n t o T e x t A r e a ( I y . p r e f i x M e n t i o n s ( e ) , ! 0 , ! 0 ) ; e l s e { c o n s t t = t h i s . m o d e l . m e s s a g e s . f i n d W h e r e ( " c o r r e c t i n g " ) ; t & & t ! = = e ? t h i s . i n s e r t I n t o T e x t A r e a ( I y . p r e f i x M e n t i o n s ( e ) , ! 0 , ! 0 ) : t h i s . i n s e r t I n t o T e x t A r e a ( " " , ! 0 , ! 1 ) } } o n E s c a p e P r e s s e d ( e ) { e . p r e v e n t D e f a u l t ( ) ; c o n s t t = t h i s . m o d e l . m e s s a g e s . f i n d L a s t I n d e x ( " c o r r e c t i n g " ) , n = t > = 0 ? t h i s . m o d e l . m e s s a g e s . a t ( t ) : n u l l ; n & & n . s a v e ( " c o r r e c t i n g " , ! 1 ) , t h i s . i n s e r t I n t o T e x t A r e a ( " " , ! 0 , ! 1 ) } o n P a s t e ( e ) { i f ( e . s t o p P r o p a g a t i o n ( ) , 0 ! = = e . c l i p b o a r d D a t a . f i l e s . l e n g t h ) r e t u r n e . p r e v e n t D e f a u l t ( ) , v o i d t h i s . m o d e l . s e n d F i l e s ( A r r a y . f r o m ( e . c l i p b o a r d D a t a . f i l e s ) ) ; t h i s . m o d e l . s e t ( { d r a f t : e . c l i p b o a r d D a t a . g e t D a t a ( " t e x t / p l a i n " ) } ) } o n K e y U p ( e ) { t h i s . m o d e l . s e t ( { d r a f t : e . t a r g e t . v a l u e } ) } o n K e y D o w n ( e ) { i f ( ! e . c t r l K e y ) { i f ( ! e . s h i f t K e y & & ! e . a l t K e y & & ! e . m e t a K e y ) i f ( e . k e y C o d e = = = $ l . k e y c o d e s . T A B ) { c o n s t t = I y . g e t C u r r e n t W o r d ( e . t a r g e t , n u l l , / ( : . * ? : ) / g ) ; t . s t a r t s W i t h ( " : " ) & & ( e . p r e v e n t D e f a u l t ( ) , e . s t o p P r o p a g a t i o n ( ) , t h i s . m o d e l . t r i g g e r ( " e m o j i - p i c k e r - a u t o c o m p l e t e " , e . t a r g e t , t ) ) } e l s e { i f ( e . k e y C o d e = = = $ l . k e y c o d e s . F O R W A R D _ S L A S H ) r e t u r n ; i f ( e . k e y C o d e = = = $ l . k e y c o d e s . E S C A P E ) r e t u r n t h i s . o n E s c a p e P r e s s e d ( e , t h i s ) ; i f ( e . k e y C o d e = = = $ l . k e y c o d e s . E N T E R ) r e t u r n t h i s . o n F o r m S u b m i t t e d ( e ) ; i f ( e . k e y C o d e ! = = $ l . k e y c o d e s . U P _ A R R O W | | e . t a r g e t . s e l e c t i o n E n d ) { i f ( e . k e y C o d e = = = $ l . k e y c o d e s . D O W N _ A R R O W & & e . t a r g e t . s e l e c t i o n E n d = = = e . t a r g e t . v a l u e . l e n g t h & & I y . h a s C l a s s ( " c o r r e c t i n g " , t h i s . q u e r y S e l e c t o r ( " . c h a t - t e x t a r e a " ) ) ) r e t u r n t h i s . m o d e l . e d i t L a t e r M e s s a g e ( ) } e l s e { c o n s t e = t h i s . q u e r y S e l e c t o r ( " . c h a t - t e x t a r e a " ) ; i f ( ! e . v a l u e | | I y . h a s C l a s s ( " c o r r e c t i n g " , e ) ) r e t u r n t h i s . m o d e l . e d i t E a r l i e r M e s s a g e ( ) } } [ $ l . k e y c o d e s . S H I F T , $ l . k e y c o d e s . M E T A , $ l . k e y c o d e s . M E T A _ R I G H T , $ l . k e y c o d e s . E S C A P E , $ l . k e y c o d e s . A L T ] . i n c l u d e s ( e . k e y C o d e ) | | t h i s . m o d e l . g e t ( " c h a t _ s t a t e " ) ! = = w a . C O M P O S I N G & & t h i s . m o d e l . s e t C h a t S t a t e ( w a . C O M P O S I N G ) } } p a r s e M e s s a g e F o r C o m m a n d s ( e ) { r e t u r n j y ( t h i s . m o d e l , e ) } a s y n c o n F o r m S u b m i t t e d ( e ) { v a r t , n ; n u l l = = e | | n u l l = = = ( t = e . p r e v e n t D e f a u l t ) | | v o i d 0 = = = t | | t . c a l l ( e ) ; c o n s t s = t h i s . q u e r y S e l e c t o r ( " . c h a t - t e x t a r e a " ) , i = s . v a l u e . t r i m ( ) ; i f ( j l . s e t t i n g s . g e t ( " m e s s a g e _ l i m i t " ) & & i . l e n g t h > j l . s e t t i n g s . g e t ( " m e s s a g e _ l i m i t " ) | | ! i . r e p l a c e ( / \ s / g , " " ) . l e n g t h ) r e t u r n ; i f ( ! w a . c o n n e c t i o n . a u t h e n t i c a t e d ) { c o n s t e = E h ( " S o r r y , t h e c o n n e c t i o n h a s b e e n l o s t , a n d y o u r m e s s a g e c o u l d n o t b e s e n t " ) ; r e t u r n j l . a l e r t ( " e r r o r " , E h ( " E r r o r " ) , e ) , v o i d j l . c o n n e c t i o n . r e c o n n e c t ( ) } l e t r , o = { } ; t h i s . m o d e l . g e t ( " c o m p o s i n g _ s p o i l e r " ) & & ( o = t h i s . q u e r y S e l e c t o r ( " f o r m . s e n d X M P P M e s s a g e i n p u t . s p o i l e r - h i n t " ) , r = o . v a l u e ) , I y . a d d C l a s s ( " d i s a b l e d " , s ) , s . s e t A t t r i b u t e ( " d i s a b l e d " , " d i s a b l e d " ) , n u l l = = = ( n = t h i s . q u e r y S e l e c t o r ( " c o n v e r s e - e m o j i - d r o p d o w n " ) ) | | v o i d 0 = = = n | | n . h i d e M e n u ( ) ; c o n s t a = t h i s . p a r s e M e s s a g e F o r C o m m a n d s ( i ) , c = a ? n u l l : a w a i t t h i s . m o d e l . s e n d M e s s a g e ( { b o d y : i , s p o i l e r _ h i n t : r } ) ; ( a | | c ) & & ( o . v a l u e = " " , s . v a l u e = " " , I y . r e m o v e C l a s s ( " c o r r e c t i n g " , s ) , s . s t y l e . h e i g h t = " a u t o " , t h i s . m o d e l . s e t ( { d r a f t : " " } ) ) , " o v e r l a y e d " = = = j l . s e t t i n g s . g e t ( " v i e w _ m o d e " ) & & ( w a . c h a t b o x v i e w s . g e t ( t h i s . g e t A t t r i b u t e ( " j i d " ) ) . q u e r y S e l e c t o r ( " . c h a t - c o n t e n t _ _ m e s s a g e s " ) . p a r e n t E l e m e n t . s t y l e . d i s p l a y = " n o n e " ) , s . r e m o v e A t t r i b u t e ( " d i s a b l e d " ) , I y . r e m o v e C l a s s ( " d i s a b l e d " , s ) , " o v e r l a y e d " = = = j l . s e t t i n g s . g e t ( " v i e w _ m o d e " ) & & ( w a . c h a t b o x v i e w s . g e t ( t h i s . g e t A t t r i b u t e ( " j i d " ) ) . q u e r y S e l e c t o r ( " . c h a t - c o n t e n t _ _ m e s s a g e s " ) . p a r e n t E l e m e n t . s t y l e . d i s p l a y = " " ) , t h i s . m o d e l . s e t C h a t S t a t e ( w a . A C T I V E , { s i l e n t : ! 0 } ) , s . f o c u s ( ) } } j l . e l e m e n t s . d e f i n e ( " c o n v e r s e - m e s s a g e - f o r m " ,
$ { e . model . ui . get ( "scrolled" ) && e . model . get ( "num_unread" ) ? el ` <div class="new-msgs-indicator" @click= ${ t => e . viewUnreadMessages ( t ) } >▼ ${ t } ▼</div> ` : "" }
$ { jl . settings . get ( "show_toolbar" ) ? el `
2021-11-11 22:06:49 +01:00
< converse - chat - toolbar
class = "chat-toolbar no-text-select"
. model = $ { e . model }
? composing _spoiler = "${e.model.get(" composing _spoiler ")}"
? show _call _button = "${s}"
? show _emoji _button = "${i}"
? show _send _button = "${r}"
? show _spoiler _button = "${o}"
? show _toolbar = "${a}"
message _limit = "${n}" > < / c o n v e r s e - c h a t - t o o l b a r > ` : " " }
< converse - message - form jid = "${e.model.get(" jid ")}" > < / c o n v e r s e - m e s s a g e - f o r m >
2022-01-03 11:54:10 +01:00
` })({model:this.model,viewUnreadMessages:e=>this.viewUnreadMessages(e)}),this)}sendButtonClicked(e){var t;null===(t=this.querySelector("converse-message-form"))||void 0===t||t.onFormSubmitted(e)}viewUnreadMessages(e){var t;null==e||null===(t=e.preventDefault)||void 0===t||t.call(e),this.model.ui.set({scrolled:!1})}emitFocused(e){var t;null===(t=wa.chatboxviews.get(this.getAttribute("jid")))||void 0===t||t.emitFocused(e)}emitBlurred(e){var t;null===(t=wa.chatboxviews.get(this.getAttribute("jid")))||void 0===t||t.emitBlurred(e)}onDrop(e){0!=e.dataTransfer.files.length&&(e.preventDefault(),this.model.sendFiles(e.dataTransfer.files))}onDragOver(e){e.preventDefault()}clearMessages(e){var t;null==e||null===(t=e.preventDefault)||void 0===t||t.call(e),ky(this.model)}async autocompleteInPicker(e,t){await jl.emojis.initialize();const n=this.querySelector("converse-emoji-picker");if(n){n.model.set({ac_position:e.selectionStart,autocompleting:t,query:t});const s=this.querySelector("converse-emoji-dropdown");null==s||s.showMenu()}}}jl.elements.define("converse-chat-bottom-panel",Ly);class zy extends ig{static get properties(){return{jid:{type:String}}}disconnectedCallback(){super.disconnectedCallback(),wa.chatboxviews.remove(this.jid,this)}updated(){this.model&&this.jid!==this.model.get("jid")&&(this.stopListening(),wa.chatboxviews.remove(this.model.get("jid"),this),delete this.model,this.requestUpdate(),this.initialize())}close(e){var t;return null==e||null===(t=e.preventDefault)||void 0===t||t.call(e),this.model.close(e)}maybeFocus(){jl.settings.get("auto_focus")&&this.focus()}focus(){const e=this.getElementsByClassName("chat-textarea")[0];return e&&document.activeElement!==e&&e.focus(),this}emitBlurred(e){this.contains(document.activeElement)||this.contains(e.relatedTarget)||jl.trigger("chatBoxBlurred",this,e)}emitFocused(e){this.contains(e.relatedTarget)||jl.trigger("chatBoxFocused",this,e)}getBottomPanel(){return this.model.get("type")===wa.CHATROOMS_TYPE?this.querySelector("converse-muc-bottom-panel"):this.querySelector("converse-chat-bottom-panel")}getMessageForm(){return this.model.get("type")===wa.CHATROOMS_TYPE?this.querySelector("converse-muc-message-form"):this.querySelector("converse-message-form")}scrollDown(e){var t,n;null==e||null===(t=e.preventDefault)||void 0===t||t.call(e),null==e||null===(n=e.stopPropagation)||void 0===n||n.call(e),this.model.ui.get("scrolled")&&this.model.ui.set({scrolled:!1}),oy(this.model)}onWindowStateChanged(e){"visible"===e.state?this.model.isHidden()||this.model.clearUnreadMsgCounter():"hidden"===e.state&&(this.model.setChatState(wa.INACTIVE,{silent:!0}),this.model.sendChatState())}}class Py extends zy{constructor(...e){var t,n;super(...e),(n="length")in(t=this)?Object.defineProperty(t,n,{value:200,enumerable:!0,configurable:!0,writable:!0}):t[n]=200}async initialize(){wa.chatboxviews.add(this.jid,this),this.model=wa.chatboxes.get(this.jid),this.listenTo(wa,"windowStateChanged",this.onWindowStateChanged),this.listenTo(this.model,"change:hidden",(()=>!this.model.get("hidden")&&this.afterShown())),this.listenTo(this.model,"change:show_help_messages",this.requestUpdate),await this.model.messages.fetched,!this.model.get("hidden")&&this.afterShown(),jl.trigger("chatBoxViewInitialized",this)}render(){return(e=>el `
2021-11-11 22:06:49 +01:00
< div class = "flyout box-flyout" >
< converse - dragresize > < / c o n v e r s e - d r a g r e s i z e >
2022-01-03 11:54:10 +01:00
$ { e . model ? el `
2021-11-11 22:06:49 +01:00
< converse - chat - heading jid = "${e.jid}" class = "chat-head chat-head-chatbox row no-gutters" > < / c o n v e r s e - c h a t - h e a d i n g >
< div class = "chat-body" >
< div class = "chat-content ${e.show_send_button?" chat - content - sendbutton ":" "}" aria - live = "polite" >
< converse - chat - content
class = "chat-content__messages"
jid = "${e.jid}" > < / c o n v e r s e - c h a t - c o n t e n t >
2021-03-19 19:26:15 +01:00
2022-01-03 11:54:10 +01:00
$ { e . show _help _messages ? el ` <div class="chat-content__help">
2021-11-11 22:06:49 +01:00
< converse - chat - help
. model = $ { e . model }
. messages = $ { e . help _messages }
? hidden = $ { ! e . show _help _messages }
type = "info"
2022-01-03 11:54:10 +01:00
chat _type = "${wa.CHATROOMS_TYPE}"
2021-11-11 22:06:49 +01:00
> < / c o n v e r s e - c h a t - h e l p > < / d i v > ` : " " }
2021-03-19 19:26:15 +01:00
< / d i v >
2021-11-11 22:06:49 +01:00
< converse - chat - bottom - panel jid = "${e.jid}" class = "bottom-panel" > < / c o n v e r s e - c h a t - b o t t o m - p a n e l >
2021-03-19 19:26:15 +01:00
< / d i v >
2021-11-11 22:06:49 +01:00
` :""}
< / d i v >
2022-01-03 11:54:10 +01:00
` )(Object.assign({model:this.model,help_messages:this.getHelpMessages(),show_help_messages:this.model.get("show_help_messages")},this.model.toJSON()))}getHelpMessages(){return[ ` < strong > / c l e a r < / s t r o n g > : $ { E h ( " R e m o v e m e s s a g e s " ) } ` , ` < s t r o n g > / c l o s e < / s t r o n g > : $ { E h ( " C l o s e t h i s c h a t " ) } ` , ` < s t r o n g > / m e < / s t r o n g > : $ { E h ( " W r i t e i n t h e t h i r d p e r s o n " ) } ` , ` < s t r o n g > / h e l p < / s t r o n g > : $ { E h ( " S h o w t h i s m e n u " ) } ` ] } s h o w C o n t r o l B o x ( ) { v a r e ; n u l l = = = ( e = w a . c h a t b o x v i e w s . g e t ( " c o n t r o l b o x " ) ) | | v o i d 0 = = = e | | e . s h o w ( ) } a f t e r S h o w n ( ) { t h i s . m o d e l . s e t C h a t S t a t e ( w a . A C T I V E ) , t h i s . m o d e l . c l e a r U n r e a d M s g C o u n t e r ( ) , t h i s . m a y b e F o c u s ( ) } } j l . e l e m e n t s . d e f i n e ( " c o n v e r s e - c h a t " , P y ) ; v a r F y = n ( 5 5 9 9 ) , U y = { } ; U y . s t y l e T a g T r a n s f o r m = v g ( ) , U y . s e t A t t r i b u t e s = f g ( ) , U y . i n s e r t = u g ( ) . b i n d ( n u l l , " h e a d " ) , U y . d o m A P I = l g ( ) , U y . i n s e r t S t y l e E l e m e n t = g g ( ) , a g ( ) ( F y . Z , U y ) , F y . Z & & F y . Z . l o c a l s & & F y . Z . l o c a l s ; c o n s t { S t r o p h e : B y } = $ l . e n v ; $ l . p l u g i n s . a d d ( " c o n v e r s e - c h a t v i e w " , { d e p e n d e n c i e s : [ " c o n v e r s e - c h a t b o x v i e w s " , " c o n v e r s e - c h a t " , " c o n v e r s e - d i s c o " , " c o n v e r s e - m o d a l " ] , i n i t i a l i z e ( ) { j l . s e t t i n g s . e x t e n d ( { a l l o w e d _ a u d i o _ d o m a i n s : n u l l , a l l o w e d _ i m a g e _ d o m a i n s : n u l l , a l l o w e d _ v i d e o _ d o m a i n s : n u l l , a u t o _ f o c u s : ! 0 , d e b o u n c e d _ c o n t e n t _ r e n d e r i n g : ! 0 , f i l t e r _ u r l _ q u e r y _ p a r a m s : n u l l , i m a g e _ u r l s _ r e g e x : n u l l , m e s s a g e _ l i m i t : 0 , m u c _ h a t s : [ " x e p 3 1 7 " ] , r e n d e r _ m e d i a : ! 0 , s h o w _ m e s s a g e _ a v a t a r : ! 0 , s h o w _ r e t r a c t i o n _ w a r n i n g : ! 0 , s h o w _ s e n d _ b u t t o n : ! 0 , s h o w _ t o o l b a r : ! 0 , t i m e _ f o r m a t : " H H : m m " , u s e _ s y s t e m _ e m o j i s : ! 0 , v i s i b l e _ t o o l b a r _ b u t t o n s : { c a l l : ! 1 , c l e a r : ! 0 , e m o j i : ! 0 , s p o i l e r : ! 0 } } ) , w a . C h a t B o x V i e w = P y , j l . l i s t e n . o n ( " c o n n e c t e d " , ( ( ) = > j l . d i s c o . o w n . f e a t u r e s . a d d ( B y . N S . S P O I L E R ) ) ) , j l . l i s t e n . o n ( " c h a t B o x C l o s e d " , ( e = > { r e t u r n t = e . g e t ( " j i d " ) , v o i d ( w a . r o u t e r . h i s t o r y . g e t F r a g m e n t ( ) = = = ` c o n v e r s e / c h a t ? j i d = $ { t } ` & & w a . r o u t e r . n a v i g a t e ( " " ) ) ; v a r t } ) ) } } ) , j l . e l e m e n t s . d e f i n e ( " c o n v e r s e - b r a n d - b y l i n e " , c l a s s e x t e n d s i g { r e n d e r ( ) { c o n s t e = " f u l l s c r e e n " = = = j l . s e t t i n g s . g e t ( " v i e w _ m o d e " ) ; r e t u r n e l `
$ { e ? el `
< p class = "brand-subtitle" > $ { wa . VERSION _NAME } < / p >
2021-11-11 22:06:49 +01:00
< p class = "brand-subtitle" >
< a target = "_blank" rel = "nofollow" href = "https://conversejs.org" > Open Source < / a > X M P P c h a t c l i e n t
brought to you by < a target = "_blank" rel = "nofollow" href = "https://opkode.com" > Opkode < / a >
< / p >
< p class = "brand-subtitle" >
< a target = "_blank" rel = "nofollow" href = "https://hosted.weblate.org/projects/conversejs/#languages"
> Translate < / a
>
it into your own language
< / p >
` :""}
2022-01-03 11:54:10 +01:00
` }}),jl.elements.define("converse-brand-logo",class extends ig{render(){const e="fullscreen"===jl.settings.get("view_mode");return el `
2021-11-11 22:06:49 +01:00
< a class = "brand-heading" href = "https://conversejs.org" target = "_blank" rel = "noopener" >
< span class = "brand-name-wrapper ${e?" brand - name - wrapper -- fullscreen ":" "}" >
< svg
class = "converse-svg-logo"
xmlns : svg = "http://www.w3.org/2000/svg"
xmlns = "http://www.w3.org/2000/svg"
xmlns : xlink = "http://www.w3.org/1999/xlink"
viewBox = "0 0 364 364" >
2021-03-19 19:26:15 +01:00
2021-11-11 22:06:49 +01:00
< title > Converse < / t i t l e >
< g class = "cls-1" id = "g904" >
< g data - name = "Layer 2" >
< g data - name = "Layer 7" >
< path
class = "cls-3"
d = "M221.46,103.71c0,18.83-29.36,18.83-29.12,0C192.1,84.88,221.46,84.88,221.46,103.71Z"
/ >
< path
class = "cls-4"
d = "M179.9,4.15A175.48,175.48,0,1,0,355.38,179.63,175.48,175.48,0,0,0,179.9,4.15Zm-40.79,264.5c-.23-17.82,27.58-17.82,27.58,0S138.88,286.48,139.11,268.65ZM218.6,168.24A79.65,79.65,0,0,1,205.15,174a12.76,12.76,0,0,0-6.29,4.65L167.54,222a1.36,1.36,0,0,1-2.46-.8v-35.8a2.58,2.58,0,0,0-3.06-2.53c-15.43,3-30.23,7.7-42.73,19.94-38.8,38-29.42,105.69,16.09,133.16a162.25,162.25,0,0,1-91.47-67.27C-3.86,182.26,34.5,47.25,138.37,25.66c46.89-9.75,118.25,5.16,123.73,62.83C265.15,120.64,246.56,152.89,218.6,168.24Z"
/ >
< / g >
2021-03-19 19:26:15 +01:00
< / g >
< / g >
2021-11-11 22:06:49 +01:00
< / s v g >
< span class = "brand-name" >
< span class = "brand-name__text" > converse < span class = "subdued" > . js < / s p a n > < / s p a n >
2022-01-03 11:54:10 +01:00
$ { e ? el `
2021-11-11 22:06:49 +01:00
< p class = "byline" > messaging freedom < / p >
` :""}
< / s p a n >
2021-03-19 19:26:15 +01:00
< / s p a n >
2021-11-11 22:06:49 +01:00
< / a >
2022-01-03 11:54:10 +01:00
` }}),jl.elements.define("converse-brand-heading",class extends ig{render(){return el `
2021-11-11 22:06:49 +01:00
< converse - brand - logo > < / c o n v e r s e - b r a n d - l o g o >
< converse - brand - byline > < / c o n v e r s e - b r a n d - b y l i n e >
2022-01-03 11:54:10 +01:00
` }});const qy=e=>el `
2021-11-11 22:06:49 +01:00
< converse - brand - heading > < / c o n v e r s e - b r a n d - h e a d i n g >
< form id = "converse-login" class = "converse-form" method = "post" >
< div class = "conn-feedback fade-in ${e.conn_feedback_subject?e.conn_feedback_class:" hidden "}" >
< p class = "feedback-subject" > $ { e . conn _feedback _subject } < / p >
< p class = "feedback-message ${e.conn_feedback_message?" ":" hidden "}" > $ { e . conn _feedback _message } < / p >
< / d i v >
2022-01-03 11:54:10 +01:00
$ { "CONNECTING" === wa . CONNECTION _STATUS [ e . connection _status ] ? ny ( { classes : "hor_centered" } ) : ( e => { const t = Eh ( "Disconnected" ) , n = Eh ( "Click here to log in anonymously" ) ; return el `
$ { e . authentication == e . LOGIN || e . authentication == e . EXTERNAL ? ( e => { const t = Eh ( "Log in" ) , n = Eh ( "XMPP Address" ) ; return el `
2021-03-19 19:26:15 +01:00
< div class = "form-group" >
< label for = "converse-login-jid" > $ { n } : < / l a b e l >
< input id = "converse-login-jid"
2022-01-03 11:54:10 +01:00
? autofocus = $ { ! ! jl . settings . get ( "auto_focus" ) }
2021-03-19 19:26:15 +01:00
required
class = "form-control"
type = "text"
name = "jid"
placeholder = "${e.placeholder_username}" / >
< / d i v >
2022-01-03 11:54:10 +01:00
$ { e . authentication !== e . EXTERNAL ? ( ( ) => { const e = Eh ( "Password" ) ; return el `
2021-03-19 19:26:15 +01:00
< div class = "form-group" >
< label for = "converse-login-password" > $ { e } < / l a b e l >
< input id = "converse-login-password" class = "form-control" required = "required" type = "password" name = "password" placeholder = "${e}" / >
< / d i v >
` })():""}
2022-01-03 11:54:10 +01:00
$ { e . show _trust _checkbox ? ( e => { const t = Eh ( "To improve performance, we cache your data in this browser. Uncheck this box if this is a public computer or if you want your data to be deleted when you log out. It's important that you explicitly log out, otherwise not all cached data might be deleted. Please note, when using an untrusted device, OMEMO encryption is NOT available." ) , n = Eh ( "This is a trusted device" ) ; return el `
2021-03-19 19:26:15 +01:00
< div class = "form-group form-check login-trusted" >
< input id = "converse-login-trusted" type = "checkbox" class = "form-check-input" name = "trusted" ? checked = $ { e } >
< label for = "converse-login-trusted" class = "form-check-label login-trusted__desc" > $ { n } < / l a b e l >
< i class = "fa fa-info-circle" data - toggle = "popover"
data - title = "Trusted device?"
data - content = "${t}" > < / i >
< / d i v >
` })("off"!==e.show_trust_checkbox):""}
2021-11-11 22:06:49 +01:00
< fieldset class = "form-group buttons" >
2021-03-19 19:26:15 +01:00
< input class = "btn btn-primary" type = "submit" value = "${t}" / >
< / f i e l d s e t >
2022-01-03 11:54:10 +01:00
$ { jl . settings . get ( "allow_registration" ) && ! jl . settings . get ( "auto_login" ) && wa . pluggable . plugins [ "converse-register" ] . enabled ( wa ) ? ( ( ) => { const e = Eh ( "Create an account" ) , t = Eh ( "Don't have a chat account?" ) ; return el `
2021-03-19 19:26:15 +01:00
< fieldset class = "switch-form" >
< p > $ { t } < / p >
< p > < a class = "register-account toggle-register-login" href = "#converse/register" > $ { e } < / a > < / p >
< / f i e l d s e t >
` })():""}
2021-11-11 22:06:49 +01:00
` })(e):""}
2022-01-03 11:54:10 +01:00
$ { e . authentication == e . ANONYMOUS ? el ` <input class="btn btn-primary login-anon" type="submit" value=" ${ n } "> ` : "" }
$ { e . authentication == e . PREBIND ? el ` <p> ${ t } </p> ` : "" }
2021-03-19 19:26:15 +01:00
` })(e)}
< / f o r m >
2022-01-03 11:54:10 +01:00
` ;function Hy(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Gy= $ l.env.utils,{Strophe:Wy}= $ l.env,Vy=[0,1,2,3,4,7,10],Jy={0:"Error",1:"Connecting",2:"Connection failure",3:"Authenticating",4:"Authentication failure",5:"Connected",6:"Disconnected",7:"Disconnecting",8:"Attached",9:"Redirect",10:"Reconnecting"},Qy={Error:"error",Connecting:"info","Connection failure":"error",Authenticating:"info","Authentication failure":"error",Connected:"info",Disconnected:"error",Disconnecting:"warn",Attached:"info",Redirect:"info",Reconnecting:"warn"},Zy=Xo.extend({defaults:{errors:[]}});jl.elements.define("converse-login-panel",class extends Ng{constructor(...e){super(...e),Hy(this,"id","converse-login-panel"),Hy(this,"className","controlbox-pane fade-in row no-gutters"),Hy(this,"events",{"submit form#converse-login":"authenticate","change input":"validate"})}initialize(){this.model=new Zy,this.listenTo(this.model,"change",this.render),this.listenTo(wa.connfeedback,"change",this.render),this.render(),this.initPopovers()}render(){const e=wa.connfeedback.get("connection_status");let t,n;Vy.includes(e)&&(n=Jy[e],t=Qy[n]),il(qy(Object.assign(this.model.toJSON(),{_converse:wa,ANONYMOUS:wa.ANONYMOUS,EXTERNAL:wa.EXTERNAL,LOGIN:wa.LOGIN,PREBIND:wa.PREBIND,auto_login:jl.settings.get("auto_login"),authentication:jl.settings.get("authentication"),connection_status:e,conn_feedback_class:t,conn_feedback_subject:n,conn_feedback_message:wa.connfeedback.get("message"),placeholder_username:(jl.settings.get("locked_domain")||jl.settings.get("default_domain"))&&Eh("Username")||Eh("user@domain"),show_trust_checkbox:jl.settings.get("allow_user_trust_override")})),this)}initPopovers(){Array.from(this.querySelectorAll("[data-title]")).forEach((e=>{new(Yg().Popover)(e,{trigger:"mobile"===jl.settings.get("view_mode")?"click":"hover",dismissible:"mobile"===jl.settings.get("view_mode"),container:this.parentElement.parentElement.parentElement})}))}validate(){const e=this.querySelector("form").querySelector("input[name=jid]");return!e.value||jl.settings.get("locked_domain")||jl.settings.get("default_domain")||Gy.isValidJID(e.value)?(e.setCustomValidity(""),!0):(e.setCustomValidity(Eh("Please enter a valid XMPP address")),!1)}authenticate(e){if(null==e||e.preventDefault(),jl.settings.get("authentication")===wa.ANONYMOUS)return this.connect(wa.jid,null);if(!this.validate())return;const t=new FormData(e.target);wa.config.save({trusted:!!t.get("trusted")});let n=t.get("jid");if(jl.settings.get("locked_domain")){const e="@"+jl.settings.get("locked_domain");n.endsWith(e)&&(n=n.substr(0,n.length-e.length)),n=Wy.escapeNode(n)+e}else jl.settings.get("default_domain")&&!n.includes("@")&&(n=n+"@"+jl.settings.get("default_domain"));this.connect(n,t.get("password"))}connect(e,t){["converse/login","converse/register"].includes(wa.router.history.getFragment())&&wa.router.navigate("",{replace:!0}),wa.connection&&wa.connection.reset(),jl.user.login(e,t)}});const Ky= $ l.env.utils;function Yy(){var e;const t=wa.chatboxes.add(new wa.ControlBox({id:"controlbox"}));return null===(e=wa.chatboxviews.get("controlbox"))||void 0===e||e.setModel(),t}function Xy(e){var t;null==e||null===(t=e.preventDefault)||void 0===t||t.call(e);const n=wa.chatboxes.get("controlbox")||Yy();Ky.safeSave(n,{closed:!1})}function eb(){const e=wa.chatboxviews.get("controlbox");return e.model.set({connected:!1}),e}function tb(){const e=null==wa?void 0:wa.chatboxviews,t=e&&e.get("controlbox");t&&(Ky.safeSave(t.model,{connected:!1}),null!=t&&t.controlbox_pane&&(t.controlbox_pane.remove(),delete t.controlbox_pane))}function nb(){(wa.chatboxes.get("controlbox")||Yy()).save({connected:!0})}jl.elements.define("converse-controlbox-navback",class extends ig{static get properties(){return{jid:{type:String}}}render(){return e=this.jid,el ` < i class = "fa fa-arrow-left" @ click = $ { ( ) => function ( e ) { Xy ( ) ; const t = wa . chatboxes . get ( e ) ; Ky . safeSave ( t , { hidden : ! 0 } ) } ( e ) } > < / i > ` ; v a r e } } ) ; c o n s t { d a y j s : s b } = $ l . e n v , i b = X o . e x t e n d ( { d e f a u l t s : ( ) = > ( { b o o k m a r k e d : ! 1 , b o x _ i d : " c o n t r o l b o x " , c h a t _ s
2021-03-19 19:26:15 +01:00
< div class = "flyout box-flyout" >
2021-11-11 22:06:49 +01:00
< converse - dragresize > < / c o n v e r s e - d r a g r e s i z e >
2021-03-19 19:26:15 +01:00
< div class = "chat-head controlbox-head" >
2022-01-03 11:54:10 +01:00
$ { e . sticky _controlbox ? "" : el `
2021-11-11 22:06:49 +01:00
< a class = "chatbox-btn close-chatbox-button fa fa-times" @ click = $ { e . close } > < / a >
` }
2021-03-19 19:26:15 +01:00
< / d i v >
2021-11-11 22:06:49 +01:00
< div class = "controlbox-panes" >
< div class = "controlbox-pane" >
2022-01-03 11:54:10 +01:00
$ { e . connected ? el `
2021-11-11 22:06:49 +01:00
< converse - user - profile > < / c o n v e r s e - u s e r - p r o f i l e >
< converse - headlines - panel class = "controlbox-section" > < / c o n v e r s e - h e a d l i n e s - p a n e l >
< div id = "chatrooms" class = "controlbox-section" >
< converse - rooms - list > < / c o n v e r s e - r o o m s - l i s t >
< converse - bookmarks > < / c o n v e r s e - b o o k m a r k s >
< / d i v >
2022-01-03 11:54:10 +01:00
$ { jl . settings . get ( "authentication" ) === wa . ANONYMOUS ? "" : el ` <div id="converse-roster" class="controlbox-section"><converse-roster></converse-roster></div> ` } ` :"register"===e["active-form"]?el ` < converse - register - panel > < / c o n v e r s e - r e g i s t e r - p a n e l > ` : e l ` < c o n v e r s e - l o g i n - p a n e l > < / c o n v e r s e - l o g i n - p a n e l > ` }
2021-11-11 22:06:49 +01:00
< / d i v >
< / d i v >
< / d i v >
2022-01-03 11:54:10 +01:00
` )({sticky_controlbox:jl.settings.get("sticky_controlbox"),...this.model.toJSON(),close:e=>this.close(e)}),this)}afterRender(){this.model.get("connected")&&void 0===this.model.get("closed")&&this.model.set("closed",!jl.settings.get("show_controlbox_by_default"))}close(e){var t;if(null==e||null===(t=e.preventDefault)||void 0===t||t.call(e),("closeAllChatBoxes"!==(null==e?void 0:e.name)||wa.disconnection_cause===wa.LOGOUT&&!jl.settings.get("show_controlbox_by_default"))&&!jl.settings.get("sticky_controlbox"))return ab.safeSave(this.model,{closed:!0}),jl.trigger("controlBoxClosed",this),this}afterShown(){return jl.trigger("controlBoxOpened",this),this}showHelpMessages(){}}jl.elements.define("converse-controlbox",cb);const lb=cb,{u:db}= $ l.env,ub={controlbox:{async open(){await jl.waitUntil("chatBoxesFetched");const e=await jl.chatboxes.get("controlbox")||jl.chatboxes.create("controlbox",{},wa.Controlbox);return db.safeSave(e,{closed:!1}),e},get:()=>wa.chatboxviews.get("controlbox")}};var hb=n(1875),fb={};fb.styleTagTransform=vg(),fb.setAttributes=fg(),fb.insert=ug().bind(null,"head"),fb.domAPI=lg(),fb.insertStyleElement=gg(),ag()(hb.Z,fb),hb.Z&&hb.Z.locals&&hb.Z.locals, $ l.plugins.add("converse-controlbox",{dependencies:["converse-modal","converse-chatboxes","converse-chat","converse-rosterview","converse-chatview"],enabled:e=>!e.api.settings.get("singleton"),overrides:{ChatBoxes:{model(e,t){return e&&"controlbox"==e.id?new ib(e,t):this.__super__.model.apply(this,arguments)}}},initialize(){jl.settings.extend({allow_logout:!0,allow_user_trust_override:!0,default_domain:void 0,locked_domain:void 0,show_controlbox_by_default:!1,sticky_controlbox:!1}),jl.promises.add("controlBoxInitialized"),Object.assign(jl,ub),wa.ControlBoxView=lb,wa.ControlBox=ib,wa.ControlBoxToggle=ob,jl.listen.on("chatBoxesFetched",nb),jl.listen.on("clearSession",tb),jl.listen.on("will-reconnect",eb),jl.waitUntil("chatBoxViewsInitialized").then(Yy).catch((e=>M.fatal(e)))}});const{u:mb}= $ l.env;function gb(e,t=!0){if(!jl.settings.get("allow_dragresize"))return!0;e.preventDefault();const n=mb.ancestor(e.target,".box-flyout"),s=window.getComputedStyle(n),i=n.parentElement;i.height=parseInt(s.height.replace(/px $ /,""),10),wa.resizing={chatbox:i,direction:"top"},i.prev_pageY=e.pageY,t&&jl.trigger("startVerticalResize",i)}function pb(e,t=!0){if(!jl.settings.get("allow_dragresize"))return!0;e.preventDefault();const n=mb.ancestor(e.target,".box-flyout"),s=window.getComputedStyle(n),i=n.parentElement;i.width=parseInt(s.width.replace(/px $ /,""),10),wa.resizing={chatbox:i,direction:"left"},i.prev_pageX=e.pageX,t&&jl.trigger("startHorizontalResize",i)}function vb(e){pb(e,!1),gb(e,!1),wa.resizing.direction="topleft",jl.trigger("startDiagonalResize",this)}function yb(e,t){if(void 0!==e)return void 0===t?e:e!==t&&Math.abs(e-t)<10?t:e}function bb(e){if(!wa.resizing||!jl.settings.get("allow_dragresize"))return!0;e.preventDefault(),wa.resizing.chatbox.resizeChatBox(e)}function _b(e){if(!wa.resizing||!jl.settings.get("allow_dragresize"))return!0;e.preventDefault();const t=yb(wa.resizing.chatbox.height,wa.resizing.chatbox.model.get("default_height")),n=yb(wa.resizing.chatbox.width,wa.resizing.chatbox.model.get("default_width"));jl.connection.connected()?(wa.resizing.chatbox.model.save({height:t}),wa.resizing.chatbox.model.save({width:n})):(wa.resizing.chatbox.model.set({height:t}),wa.resizing.chatbox.model.set({width:n})),wa.resizing=null}const wb=()=>el `
< div class = "dragresize dragresize-top" @ mousedown = "${gb}" > < / d i v >
< div class = "dragresize dragresize-topleft" @ mousedown = "${vb}" > < / d i v >
< div class = "dragresize dragresize-left" @ mousedown = "${pb}" > < / d i v >
` ;customElements.define("converse-dragresize",class extends ig{render(){return wb()}});const Sb={initDragResize(){var e;const t=this,n=gc((()=>t.setDimensions()));window.addEventListener("resize",t.debouncedSetDimensions),this.listenTo(this.model,"destroy",(()=>window.removeEventListener("resize",n)));const s=this.querySelector(".box-flyout"),i=window.getComputedStyle(s);if(void 0===this.model.get("height")){const e=parseInt(i.height.replace(/px $ /,""),10),t=parseInt(i.width.replace(/px $ /,""),10);this.model.set("height",e),this.model.set("default_height",e),this.model.set("width",t),this.model.set("default_width",t)}const r=i["min-width"],o=i["min-height"];return this.model.set("min_width",r.endsWith("px")?Number(r.replace(/px $ /,"")):0),this.model.set("min_height",o.endsWith("px")?Number(o.replace(/px $ /,"")):0),this.prev_pageY=0,this.prev_pageX=0,null!==(e=wa.connection)&&void 0!==e&&e.connected&&(this.height=this.model.get("height"),this.width=this.model.get("width")),this},resizeChatBox(e){let t;0===wa.resizing.direction.indexOf("top")&&(t=e.pageY-this.prev_pageY,t&&(this.height=this.height-t>(this.model.get("min_height")||0)?this.height-t:this.model.get("min_height"),this.prev_pageY=e.pageY,this.setChatBoxHeight(this.height))),wa.resizing.direction.includes("left")&&(t=this.prev_pageX-e.pageX,t&&(this.width=this.width+t>(this.model.get("min_width")||0)?this.width+t:this.model.get("min_width"),this.prev_pageX=e.pageX,this.setChatBoxWidth(this.width)))},setDimensions(){this.adjustToViewport(),this.setChatBoxHeight(this.model.get("height")),this.setChatBoxWidth(this.model.get("width"))},setChatBoxHeight(e){e=e?yb(e,this.model.get("default_height"))+"px":"";const t=this.querySelector(".box-flyout");null!==t&&(t.style.height=e)},setChatBoxWidth(e){e=e?yb(e,this.model.get("default_width"))+"px":"",this.style.width=e;const t=this.querySelector(".box-flyout");null!==t&&(t.style.width=e)},adjustToViewport(){const e=Math.max(document.documentElement.clientWidth,window.innerWidth||0),t=Math.max(document.documentElement.clientHeight,window.innerHeight||0);e<=480?(this.model.set("height",void 0),this.model.set("width",void 0)):e<=this.model.get("width")?this.model.set("width",void 0):t<=this.model.get("height")&&this.model.set("height",void 0)}}; $ l.plugins.add("converse-dragresize",{dependencies:["converse-chatview","converse-headlines-view","converse-muc-views"],enabled:e=>"overlayed"==e.api.settings.get("view_mode"),overrides:{ChatBox:{initialize(){const e=this.__super__.initialize.apply(this,arguments),t=this.get("height"),n=this.get("width");return("controlbox"===this.get("id")?e=>this.set(e):e=>this.save(e))({height:yb(t,this.get("default_height")),width:yb(n,this.get("default_width"))}),e}}},initialize(){jl.settings.extend({allow_dragresize:!0}),Object.assign(wa.ChatBoxView.prototype,Sb),Object.assign(wa.ChatRoomView.prototype,Sb),Object.assign(wa.ControlBoxView.prototype,Sb),jl.listen.on("registeredGlobalEventHandlers",(function(){document.addEventListener("mousemove",bb),document.addEventListener("mouseup",_b)})),jl.listen.on("unregisteredGlobalEventHandlers",(function(){document.removeEventListener("mousemove",bb),document.removeEventListener("mouseup",_b)})),jl.listen.on("beforeShowingChatView",(e=>e.initDragResize().setDimensions()))}});var xb=n(1833),Eb={};Eb.styleTagTransform=vg(),Eb.setAttributes=fg(),Eb.insert=ug().bind(null,"head"),Eb.domAPI=lg(),Eb.insertStyleElement=gg(),ag()(xb.Z,Eb),xb.Z&&xb.Z.locals&&xb.Z.locals, $ l.plugins.add("converse-singleton",{enabled:e=>e.api.settings.get("singleton"),initialize(){if(jl.settings.extend({allow_logout:!1,allow_muc_invitations:!1,hide_muc_server:!0}),!Array.isArray(jl.settings.get("auto_join_rooms"))&&!Array.isArray(jl.settings.get("auto_join_private_chats")))throw new Error("converse-singleton: auto_join_rooms must be an Array");if(jl.settings.get("auto_join_rooms").length>1||jl.settings.get("auto_join_private_chats").length>1)throw new Error("It doesn't make sense to have singleton set to true and auto_join_rooms or auto_join_private_chats set to more then one, since only
2021-11-11 22:06:49 +01:00
< div class = "chatbox-title ${e.status?" ":" chatbox - title -- no - desc "}" >
< div class = "chatbox-title--row" >
2022-01-03 11:54:10 +01:00
$ { wa . api . settings . get ( "singleton" ) ? "" : el ` <converse-controlbox-navback jid=" ${ e . jid } "></converse-controlbox-navback> ` }
2021-11-11 22:06:49 +01:00
< div class = "chatbox-title__text" title = "${e.jid}" > $ { e . display _name } < / d i v >
< / d i v >
< div class = "chatbox-title__buttons row no-gutters" >
2022-01-03 11:54:10 +01:00
$ { e . dropdown _btns . length ? el ` <converse-dropdown class="dropleft" .items= ${ e . dropdown _btns } ></converse-dropdown> ` : "" }
$ { e . standalone _btns . length ? ( e => e . standalone _btns . reverse ( ) . map ( ( e => xp ( e , "" ) ) ) ) ( e ) : "" }
2021-11-11 22:06:49 +01:00
< / d i v >
< / d i v >
2022-01-03 11:54:10 +01:00
$ { e . status ? el ` <p class="chat-head__desc"> ${ e . status } </p> ` : "" }
` )(Object.assign(this.model.toJSON(),{display_name:this.model.getDisplayName(),dropdown_btns:n.map((e=>Cy(e))),standalone_btns:t.map((e=>Ty(e)))}))}getHeadingButtons(){const e=[];return jl.settings.get("singleton")||e.push({a_class:"close-chatbox-button",handler:e=>this.close(e),i18n_text:Eh("Close"),i18n_title:Eh("Close these announcements"),icon_class:"fa-times",name:"close",standalone:"overlayed"===jl.settings.get("view_mode")}),wa.api.hook("getHeadingButtons",this,e)}close(e){e.preventDefault(),this.model.close()}}),jl.elements.define("converse-headlines",class extends zy{async initialize(){wa.chatboxviews.add(this.jid,this),this.model=wa.chatboxes.get(this.jid),this.model.disable_mam=!0,this.listenTo(wa,"windowStateChanged",this.onWindowStateChanged),this.listenTo(this.model,"change:hidden",(()=>this.afterShown())),this.listenTo(this.model,"destroy",this.remove),this.listenTo(this.model.messages,"add",this.requestUpdate),this.listenTo(this.model.messages,"remove",this.requestUpdate),this.listenTo(this.model.messages,"reset",this.requestUpdate),await this.model.messages.fetched,this.model.maybeShow(),jl.trigger("headlinesBoxViewInitialized",this)}render(){return(e=>el `
2021-11-11 22:06:49 +01:00
< div class = "flyout box-flyout" >
< converse - dragresize > < / c o n v e r s e - d r a g r e s i z e >
2022-01-03 11:54:10 +01:00
$ { e ? el `
2021-11-11 22:06:49 +01:00
< converse - headlines - heading jid = "${e.get(" jid ")}" class = "chat-head chat-head-chatbox row no-gutters" >
< / c o n v e r s e - h e a d l i n e s - h e a d i n g >
< div class = "chat-body" >
< div class = "chat-content" aria - live = "polite" >
< converse - chat - content
class = "chat-content__messages"
jid = "${e.get(" jid ")}" > < / c o n v e r s e - c h a t - c o n t e n t >
< / d i v >
< / d i v > ` : " " }
< / d i v >
2022-01-03 11:54:10 +01:00
` )(this.model)}async close(e){var t;return null==e||null===(t=e.preventDefault)||void 0===t||t.call(e),wa.router.history.getFragment()==="converse/chat?jid="+this.model.get("jid")&&wa.router.navigate(""),await this.model.close(e),this}getNotifications(){return[]}afterShown(){this.model.clearUnreadMsgCounter()}});class Tb extends Ng{constructor(...e){var t,n,s;super(...e),s={"click .open-headline":"openHeadline"},(n="events")in(t=this)?Object.defineProperty(t,n,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[n]=s}initialize(){this.model=wa.chatboxes,this.listenTo(this.model,"add",this.renderIfHeadline),this.listenTo(this.model,"remove",this.renderIfHeadline),this.listenTo(this.model,"destroy",this.renderIfHeadline),this.render()}toHTML(){return(e=>el `
2021-11-11 22:06:49 +01:00
< div class = "controlbox-section" id = "headline" >
< div class = "d-flex controlbox-padded ${e.headlineboxes.length?" ":" hidden "}" >
< span class = "w-100 controlbox-heading controlbox-heading--headline" > $ { e . heading _headline } < / s p a n >
< / d i v >
< / d i v >
2022-01-03 11:54:10 +01:00
$ { ( e => el `
2021-11-11 22:06:49 +01:00
< div class = "list-container list-container--headline ${e.headlineboxes.length?" ":" hidden "}" >
< div class = "items-list rooms-list headline-list" >
2022-01-03 11:54:10 +01:00
$ { e . headlineboxes . map ( ( t => ( e => el `
2021-11-11 22:06:49 +01:00
< div class = "list-item controlbox-padded d-flex flex-row"
data - headline - jid = "${e.headlinebox.get(" jid ")}" >
< a class = "list-item-link open-headline available-room w-100"
data - headline - jid = "${e.headlinebox.get(" jid ")}"
title = "${e.open_title}" href = "#" > $ { e . headlinebox . get ( "jid" ) } < / a >
< / d i v >
` )(Object.assign({headlinebox:t},e))))}
< / d i v >
< / d i v >
` )(e)}
2022-01-03 11:54:10 +01:00
` )({heading_headline:Eh("Announcements"),headlineboxes:this.model.filter((e=>e.get("type")===wa.HEADLINES_TYPE)),open_title:Eh("Click to open this server message")})}renderIfHeadline(e){return e&&e.get("type")===wa.HEADLINES_TYPE&&this.render()}openHeadline(e){e.preventDefault();const t=e.target.getAttribute("data-headline-jid");wa.chatboxes.get(t).maybeShow(!0)}}jl.elements.define("converse-headlines-panel",Tb);var kb=n(5956),jb={};jb.styleTagTransform=vg(),jb.setAttributes=fg(),jb.insert=ug().bind(null,"head"),jb.domAPI=lg(),jb.insertStyleElement=gg(),ag()(kb.Z,jb),kb.Z&&kb.Z.locals&&kb.Z.locals, $ l.plugins.add("converse-headlines-view",{dependencies:["converse-headlines","converse-chatview"],initialize(){wa.HeadlinesPanel=Tb}});var Nb=n(9679),Ob={};function $ b(e,t){return e instanceof Qh?el ` < converse - mam - placeholder . model = $ { e } > < / c o n v e r s e - m a m - p l a c e h o l d e r > ` : t } a s y n c f u n c t i o n I b ( e ) { i f ( ! e . m o d e l . u i . g e t ( " c h a t - c o n t e n t - s p i n n e r - t o p " ) & & e . m o d e l . m e s s a g e s . l e n g t h ) { c o n s t t = e . m o d e l . g e t ( " t y p e " ) = = = w a . C H A T R O O M S _ T Y P E , n = e . m o d e l . g e t O l d e s t M e s s a g e ( ) ; i f ( n ) { c o n s t s = t ? e . m o d e l . g e t ( " j i d " ) : w a . b a r e _ j i d , i = n & & n . g e t ( ` s t a n z a _ i d $ { s } ` ) ; e . m o d e l . u i . s e t ( " c h a t - c o n t e n t - s p i n n e r - t o p " , ! 0 ) ; t r y { i ? a w a i t w f ( e . m o d e l , { b e f o r e : i } ) : a w a i t w f ( e . m o d e l , { e n d : n . g e t ( " t i m e " ) } ) } c a t c h ( t ) { r e t u r n M . e r r o r ( t ) , v o i d e . m o d e l . u i . s e t ( " c h a t - c o n t e n t - s p i n n e r - t o p " , ! 1 ) } j l . s e t t i n g s . g e t ( " a l l o w _ u r l _ h i s t o r y _ c h a n g e " ) & & w a . r o u t e r . h i s t o r y . n a v i g a t e ( ` # $ { n . g e t ( " m s g i d " ) } ` ) , s e t T i m e o u t ( ( ( ) = > e . m o d e l . u i . s e t ( " c h a t - c o n t e n t - s p i n n e r - t o p " , ! 1 ) ) , 2 5 0 ) } } } O b . s t y l e T a g T r a n s f o r m = v g ( ) , O b . s e t A t t r i b u t e s = f g ( ) , O b . i n s e r t = u g ( ) . b i n d ( n u l l , " h e a d " ) , O b . d o m A P I = l g ( ) , O b . i n s e r t S t y l e E l e m e n t = g g ( ) , a g ( ) ( N b . Z , O b ) , N b . Z & & N b . Z . l o c a l s & & N b . Z . l o c a l s , j l . e l e m e n t s . d e f i n e ( " c o n v e r s e - m a m - p l a c e h o l d e r " , c l a s s e x t e n d s i g { s t a t i c g e t p r o p e r t i e s ( ) { r e t u r n { m o d e l : { t y p e : O b j e c t } } } r e n d e r ( ) { r e t u r n ( e = t h i s ) . m o d e l . g e t ( " f e t c h i n g " ) ? n y ( { c l a s s e s : " h o r _ c e n t e r e d " } ) : e l ` < a @ c l i c k = " $ { t = > e . f e t c h M i s s i n g M e s s a g e s ( t ) } " t i t l e = " $ { E h ( " C l i c k t o l o a d m i s s i n g m e s s a g e s " ) } " >
2021-11-11 22:06:49 +01:00
< div class = "message mam-placeholder" > < / d i v >
2022-01-03 11:54:10 +01:00
< / a > ` ; v a r e } a s y n c f e t c h M i s s i n g M e s s a g e s ( e ) { v a r t ; n u l l = = e | | n u l l = = = ( t = e . p r e v e n t D e f a u l t ) | | v o i d 0 = = = t | | t . c a l l ( e ) , t h i s . m o d e l . s e t ( " f e t c h i n g " , ! 0 ) ; c o n s t n = { b e f o r e : t h i s . m o d e l . g e t ( " b e f o r e " ) , s t a r t : t h i s . m o d e l . g e t ( " s t a r t " ) } ; a w a i t w f ( t h i s . m o d e l . c o l l e c t i o n . c h a t b o x , n ) , t h i s . m o d e l . d e s t r o y ( ) } } ) , $ l . p l u g i n s . a d d ( " c o n v e r s e - m a m - v i e w s " , { d e p e n d e n c i e s : [ " c o n v e r s e - m a m " , " c o n v e r s e - c h a t v i e w " , " c o n v e r s e - m u c - v i e w s " ] , i n i t i a l i z e ( ) { j l . l i s t e n . o n ( " c h a t B o x S c r o l l e d U p " , I b ) , j l . l i s t e n . o n ( " g e t M e s s a g e T e m p l a t e " , $ b ) } } ) ; c o n s t M b = X o . e x t e n d ( { d e f a u l t s : { c o l l a p s e d : ! 1 } } ) ; j l . e l e m e n t s . d e f i n e ( " c o n v e r s e - m i n i m i z e d - c h a t s " , c l a s s e x t e n d s i g { a s y n c i n i t i a l i z e ( ) { t h i s . m o d e l = w a . c h a t b o x e s , a w a i t t h i s . i n i t T o g g l e ( ) , t h i s . l i s t e n T o ( t h i s . m i n c h a t s , " c h a n g e : c o l l a p s e d " , t h i s . r e q u e s t U p d a t e ) , t h i s . l i s t e n T o ( t h i s . m o d e l , " a d d " , t h i s . r e q u e s t U p d a t e ) , t h i s . l i s t e n T o ( t h i s . m o d e l , " c h a n g e : f u l l n a m e " , t h i s . r e q u e s t U p d a t e ) , t h i s . l i s t e n T o ( t h i s . m o d e l , " c h a n g e : j i d " , t h i s . r e q u e s t U p d a t e ) , t h i s . l i s t e n T o ( t h i s . m o d e l , " c h a n g e : m i n i m i z e d " , t h i s . r e q u e s t U p d a t e ) , t h i s . l i s t e n T o ( t h i s . m o d e l , " c h a n g e : n a m e " , t h i s . r e q u e s t U p d a t e ) , t h i s . l i s t e n T o ( t h i s . m o d e l , " c h a n g e : n u m _ u n r e a d " , t h i s . r e q u e s t U p d a t e ) , t h i s . l i s t e n T o ( t h i s . m o d e l , " r e m o v e " , t h i s . r e q u e s t U p d a t e ) , t h i s . l i s t e n T o ( w a , " c o n n e c t e d " , t h i s . r e q u e s t U p d a t e ) , t h i s . l i s t e n T o ( w a , " r e c o n n e c t e d " , t h i s . r e q u e s t U p d a t e ) , t h i s . l i s t e n T o ( w a , " d i s c o n n e c t e d " , t h i s . r e q u e s t U p d a t e ) } r e n d e r ( ) { c o n s t e = t h i s . m o d e l . w h e r e ( { m i n i m i z e d : ! 0 } ) , t = e . r e d u c e ( ( ( e , t ) = > e + t . g e t ( " n u m _ u n r e a d " ) ) , 0 ) , n = e . r e d u c e ( ( ( e , t ) = > e + ( t . g e t ( " m i n i m i z e d " ) ? 1 : 0 ) ) , 0 ) , s = { c h a t s : e , n u m _ u n r e a d : t , n u m _ m i n i m i z e d : n , c o l l a p s e d : t h i s . m i n c h a t s . g e t ( " c o l l a p s e d " ) } ; r e t u r n s . t o g g l e = e = > t h i s . t o g g l e ( e ) , ( e = > e l ` < d i v i d = " m i n i m i z e d - c h a t s " c l a s s = " $ { e . c h a t s . l e n g t h ? " " : " h i d d e n " } " >
2021-11-11 22:06:49 +01:00
< a id = "toggle-minimized-chats" class = "row no-gutters" @ click = $ { e . toggle } >
2022-01-03 11:54:10 +01:00
$ { e . num _minimized } $ { Eh ( "Minimized" ) }
2021-11-11 22:06:49 +01:00
< span class = "unread-message-count ${e.num_unread?" ":" unread - message - count - hidden "}" href = "#" > $ { e . num _unread } < / s p a n >
< / a >
< div class = "flyout minimized-chats-flyout row no-gutters ${e.collapsed?" hidden ":" "}" >
2022-01-03 11:54:10 +01:00
$ { e . chats . map ( ( e => el ` <converse-minimized-chat
2021-03-19 19:26:15 +01:00
. model = $ { e }
title = $ { e . getDisplayName ( ) }
type = $ { e . get ( "type" ) }
2021-11-11 22:06:49 +01:00
num _unread = $ { e . get ( "num_unread" ) } > < / c o n v e r s e - m i n i m i z e d - c h a t > ` ) ) }
2021-03-19 19:26:15 +01:00
< / d i v >
2022-01-03 11:54:10 +01:00
< / d i v > ` ) ( s ) } a s y n c i n i t T o g g l e ( ) { c o n s t e = ` c o n v e r s e . m i n c h a t s t o g g l e - $ { w a . b a r e _ j i d } ` ; t h i s . m i n c h a t s = n e w M b ( { i d : e } ) , _ o ( t h i s . m i n c h a t s , e , " s e s s i o n " ) , a w a i t n e w P r o m i s e ( ( e = > t h i s . m i n c h a t s . f e t c h ( { s u c c e s s : e , e r r o r : e } ) ) ) } t o g g l e ( e ) { n u l l = = e | | e . p r e v e n t D e f a u l t ( ) , t h i s . m i n c h a t s . s a v e ( { c o l l a p s e d : ! t h i s . m i n c h a t s . g e t ( " c o l l a p s e d " ) } ) } } ) ; c o n s t R b = $ l . e n v . u t i l s ; f u n c t i o n D b ( e ) { i f ( " c o n t r o l b o x " = = = e . m o d e l . g e t ( " i d " ) ) { i f ( R b . i s V i s i b l e ( e ) ) r e t u r n R b . g e t O u t e r W i d t h ( e , ! 0 ) ; { c o n s t e = d o c u m e n t . q u e r y S e l e c t o r ( " c o n v e r s e - c o n t r o l b o x - t o g g l e " ) ; r e t u r n e ? R b . g e t O u t e r W i d t h ( e , ! 0 ) : 0 } } r e t u r n ! e . m o d e l . g e t ( " m i n i m i z e d " ) & & R b . i s V i s i b l e ( e ) ? R b . g e t O u t e r W i d t h ( e , ! 0 ) : 0 } f u n c t i o n L b ( ) { c o n s t e = d o c u m e n t . q u e r y S e l e c t o r ( " c o n v e r s e - m i n i m i z e d - c h a t s " ) ; r e t u r n w a . c h a t b o x e s . p l u c k ( " m i n i m i z e d " ) . i n c l u d e s ( ! 0 ) ? R b . g e t O u t e r W i d t h ( e , ! 0 ) : 0 } f u n c t i o n z b ( e ) { c o n s t t = e ? e . m o d e l . g e t ( " i d " ) : n u l l , n = e ? R b . g e t O u t e r W i d t h ( e , ! 0 ) : 0 ; r e t u r n O b j e c t . v a l u e s ( w a . c h a t b o x v i e w s . x g e t ( t ) ) . r e d u c e ( ( ( e , t ) = > e + D b ( t ) ) , n ) } f u n c t i o n P b ( e ) { i f ( w a . i s T e s t E n v ( ) | | j l . s e t t i n g s . g e t ( " n o _ t r i m m i n g " ) | | " o v e r l a y e d " ! = = j l . s e t t i n g s . g e t ( " v i e w _ m o d e " ) ) r e t u r n ; c o n s t t = w a . c h a t b o x v i e w s . f i l t e r ( ( e = > ! e . m o d e l . g e t ( " m i n i m i z e d " ) & & ! e . m o d e l . g e t ( " c l o s e d " ) & & R b . i s V i s i b l e ( e ) ) ) ; i f ( t . l e n g t h < = 1 ) r e t u r n ; c o n s t n = R b . g e t O u t e r W i d t h ( d o c u m e n t . q u e r y S e l e c t o r ( " b o d y " ) , ! 0 ) ; i f ( D b ( t [ 0 ] ) ! = = n & & d o c u m e n t . q u e r y S e l e c t o r ( " c o n v e r s e - m i n i m i z e d - c h a t s " ) ) f o r ( ; L b ( ) + z b ( e ) > n ; ) { c o n s t t = F b ( [ e ? e . m o d e l . g e t ( " i d " ) : n u l l ] ) ; i f ( ! t ) b r e a k ; { c o n s t e = w a . c h a t b o x e s . g e t ( t . g e t ( " i d " ) ) ; n u l l = = e | | e . s a v e ( " h i d d e n " , ! 0 ) , B b ( t ) } } } f u n c t i o n F b ( e ) { e . p u s h ( " c o n t r o l b o x " ) ; l e t t = 0 , n = w a . c h a t b o x e s . s o r t ( ) . a t ( t ) ; f o r ( ; e . i n c l u d e s ( n . g e t ( " i d " ) ) | | ! 0 = = = n . g e t ( " m i n i m i z e d " ) ; ) i f ( t + + , n = w a . c h a t b o x e s . a t ( t ) , ! n ) r e t u r n n u l l ; r e t u r n n } f u n c t i o n U b ( e , t ) { n u l l ! = e & & e . p r e v e n t D e f a u l t ? e . p r e v e n t D e f a u l t ( ) : t = e , R b . s a f e S a v e ( t , { h i d d e n : ! 1 , m i n i m i z e d : ! 1 , t i m e _ o p e n e d : ( n e w D a t e ) . g e t T i m e ( ) } ) } f u n c t i o n B b ( e , t ) { n u l l ! = e & & e . p r e v e n t D e f a u l t ? e . p r e v e n t D e f a u l t ( ) : t = e , t . s e t C h a t S t a t e ( w a . I N A C T I V E ) , R b . s a f e S a v e ( t , { h i d d e n : ! 0 , m i n i m i z e d : ! 0 , t i m e _ m i n i m i z e d : ( n e w D a t e ) . t o I S O S t r i n g ( ) } ) } j l . e l e m e n t s . d e f i n e ( " c o n v e r s e - m i n i m i z e d - c h a t " , c l a s s e x t e n d s i g { s t a t i c g e t p r o p e r t i e s ( ) { r e t u r n { m o d e l : { t y p e : O b j e c t } , t i t l e : { t y p e : S t r i n g } , t y p e : { t y p e : S t r i n g } , n u m _ u n r e a d : { t y p e : N u m b e r } } } r e n d e r ( ) { r e t u r n ( e = > { c o n s t t = E h ( " C l i c k t o r e s t o r e t h i s c h a t " ) ; r e t u r n e l `
< div class = "chat-head-${e.type} chat-head row no-gutters" >
< a class = "restore-chat w-100 align-self-center" title = "${t}" @ click = $ { e . restore } >
$ { e . num _unread ? el ` <span class="message-count badge badge-light"> ${ e . num _unread } </span> ` : "" }
$ { e . title }
< / a >
< a class = "chatbox-btn close-chatbox-button" @ click = $ { e . close } >
< converse - icon color = $ { "chatroom" === e . type ? "var(--chatroom-head-color)" : "var(--chat-head-text-color)" } class = "fas fa-times" @ click = $ { e . close } size = "1em" > < / c o n v e r s e - i c o n >
< / a >
< /div>`})({close:e=>this.close(e),num_unread:this.num_unread,restore:e=>this.restore(e),title:this.title,type:this.type})}close(e){null==e||e.preventDefault(),this.model.close()}restore(e){null==e||e.preventDefault(),Ub(this.model)}});var qb=n(4915),Hb={};Hb.styleTagTransform=vg(),Hb.setAttributes=fg(),Hb.insert=ug().bind(null,"head"),Hb.domAPI=lg(),Hb.insertStyleElement=gg(),ag()(qb.Z,Hb),qb.Z&&qb.Z.locals&&qb.Z.locals;const{dayjs:Gb}=$l.env;$l.plugins.add("converse-minimize",{dependencies:["converse-chatview","converse-controlbox","converse-muc-views","converse-headlines-view","converse-dragresize"],enabled:e=>"overlayed"===e.api.settings.get("view_mode"),overrides:{ChatBox:{initialize(){this.__super__.initialize.apply(this,arguments),this.on("change:hidden",(e=>!e.get("hidden")&&Ub(this)),this),"controlbox"!==this.get("id")&&this.save({minimized:this.get("minimized")||!1,time_minimized:this.get("time_minimized")||Gb()})},maybeShow(e){return!e&&this.get("minimized")?this:this.__super__.maybeShow.apply(this,arguments)},isHidden(){return this.__super__.isHidden.call(this)||this.get("minimized")}},ChatBoxView:{isNewMessageHidden(){return this.model.get("minimized")||this.__super__.isNewMessageHidden.apply(this,arguments)},setChatBoxHeight(e){if(!this.model.get("minimized"))return this.__super__.setChatBoxHeight.call(this,e)},setChatBoxWidth(e){if(!this.model.get("minimized"))return this.__super__.setChatBoxWidth.call(this,e)}}},initialize(){function e(e){e.on("change:minimized",(()=>function(e){e.get("minimized")?function(e){jl.trigger("chatBoxMinimized",e)}(e):function(e){e.isScrolledUp()||e.clearUnreadMsgCounter(),e.setChatState(wa.ACTIVE),jl.trigger("chatBoxMaximized",e)}(e)}(e)))}jl.settings.extend({no_trimming:!1}),jl.promises.add("minimizedChatsInitialized"),wa.MinimizedChatsToggle=Mb,wa.minimize={trimChats:Pb,minimize:Bb,maximize:Ub},jl.listen.on("chatBoxViewInitialized",(e=>wa.minimize.trimChats(e))),jl.listen.on("chatRoomViewInitialized",(e=>wa.minimize.trimChats(e))),jl.listen.on("controlBoxOpened",(e=>wa.minimize.trimChats(e))),jl.listen.on("chatBoxInitialized",e),jl.listen.on("chatRoomInitialized",e),jl.listen.on("getHeadingButtons",((e,t)=>e.model.get("type")===wa.CHATROOMS_TYPE?function(e,t){const n={a_class:"toggle-chatbox-button",handler:t=>Bb(t,e.model),i18n_text:Eh("Minimize"),i18n_title:Eh("Minimize this groupchat"),icon_class:"fa-minus",name:"minimize",standalone:"overlayed"===wa.api.settings.get("view_mode")},s=t.map((e=>e.name)).indexOf("signout");return s>-1?[...t.slice(0,s),n,...t.slice(s)]:[n,...t]}(e,t):function(e,t){const n={a_class:"toggle-chatbox-button",handler:t=>Bb(t,e.model),i18n_text:Eh("Minimize"),i18n_title:Eh("Minimize this chat"),icon_class:"fa-minus",name:"minimize",standalone:"overlayed"===wa.api.settings.get("view_mode")},s=t.map((e=>e.name)).indexOf("close");return s>-1?[...t.slice(0,s),n,...t.slice(s)]:[n,...t]}(e,t)));const t=gc((()=>wa.minimize.trimChats()),250);jl.listen.on("registeredGlobalEventHandlers",(()=>window.addEventListener("resize",t))),jl.listen.on("unregisteredGlobalEventHandlers",(()=>window.removeEventListener("resize",t)))}});const Wb=$l.env.utils,Vb={getElement:(e,t)=>"string"==typeof e?(t||document).querySelector(e):e||null,bind(e,t){if(e)for(var n in t){if(!Object.prototype.hasOwnProperty.call(t,n))continue;const s=t[n];n.split(/ \ s + /).forEach((t=>e.addEventListener(t,s)))}},unbind(e,t){if(e)for(var n in t){if(!Object.prototype.hasOwnProperty.call(t,n))continue;const s=t[n];n.split(/ \ s + /).forEach((t=>e.removeEventListener(t,s)))}},regExpEscape:e=>e.replace(/ [ - \ \ ^ $ * + ? . ( ) | [ \ ] { } ] / g , "\\$&" ) , isMention : ( e , t ) => t . includes ( e [ 0 ] ) || Wb . isMentionBoundary ( e [ 0 ] ) && t . includes ( e [ 1 ] ) } , Jb = function ( e , t ) { return RegExp ( Vb . regExpEscape ( t . trim ( ) ) , "i" ) . test ( e ) } , Qb = function ( e , t ) { return RegExp ( "^" + Vb . regExpEscape ( t . trim ( ) ) , "i" ) . test ( e ) } , Zb = function ( e , t ) { const n = e . query . toLowerCase ( ) , s = e . label . toLowerCase ( ) . indexOf ( n ) , i = t . label . toLowerCase ( ) . indexOf ( n ) ; return s === i ? function ( e , t ) { return e . length !== t . length ? e . length - t . length : e < t ? - 1 : 1 } ( e , t ) : ( - 1 === s ? 1 / 0 : s ) < ( - 1 === i ? 1 / 0 : i ) ? - 1 : 1 } , Kb = ( e , t ) =
2021-03-19 19:26:15 +01:00
< div class = "suggestion-box suggestion-box__name" >
< ul class = "suggestion-box__results suggestion-box__results--above" hidden = "" > < / u l >
2021-11-11 22:06:49 +01:00
< input
type = "text"
name = "${this.name}"
autocomplete = "off"
@ keydown = $ { this . onKeyDown }
@ keyup = $ { this . onKeyUp }
class = "form-control suggestion-box__input"
placeholder = "${this.placeholder}"
/ >
< span
class = "suggestion-box__additions visually-hidden"
role = "status"
aria - live = "assertive"
aria - relevant = "additions"
> < / s p a n >
2021-03-19 19:26:15 +01:00
< / d i v >
2022-01-03 11:54:10 +01:00
` }firstUpdated(){this.auto_complete=new t_(this.firstElementChild,{ac_triggers:this.triggers.split(" "),auto_evaluate:this.auto_evaluate,auto_first:this.auto_first,filter:"contains"==this.filter?Jb:Qb,include_triggers:[],list:()=>this.getAutoCompleteList(),match_current_word:!0,max_items:this.max_items,min_chars:this.min_chars}),this.auto_complete.on("suggestion-box-selectcomplete",(()=>this.auto_completing=!1))}onKeyDown(e){this.auto_complete.onKeyDown(e)}onKeyUp(e){this.auto_complete.evaluate(e)}});var n_=n(4921),s_={};s_.styleTagTransform=vg(),s_.setAttributes=fg(),s_.insert=ug().bind(null,"head"),s_.domAPI=lg(),s_.insertStyleElement=gg(),ag()(n_.Z,s_),n_.Z&&n_.Z.locals&&n_.Z.locals,wa.FILTER_CONTAINS=Jb,wa.FILTER_STARTSWITH=Qb,wa.AutoComplete=t_;function i_(e){return"moderator"===e?Eh("Moderators are privileged users who can change the roles of other users (except those with admin or owner affiliations."):"participant"===e?Eh("The default role, implies that you can read and write messages."):"visitor"==e?Eh("Visitors aren't allowed to write messages in a moderated multi-user chat."):void 0}function r_(e){return"owner"===e?Eh("Owner is the highest affiliation. Owners can modify roles and affiliations of all other users."):"admin"===e?Eh("Admin is the 2nd highest affiliation. Admins can modify roles and affiliations of all other users except owners."):"outcast"===e?Eh('To ban a user, you give them the affiliation of "outcast".'):void 0}const o_=e=>{const t=Eh("Affiliation"),n=Eh("No users with that affiliation found."),s=Eh("No users with that role found."),i=Eh("Type here to filter the search results"),r=Eh("Role"),o=Eh("Show users"),a=Eh("Roles are assigned to users to grant or deny them certain abilities in a multi-user chat. They're assigned either explicitly or implicitly as part of an affiliation. A role that's not due to an affiliation, is only valid for the duration of the user's session."),c=Eh("An affiliation is a long-lived entitlement which typically implies a certain role and which grants privileges and responsibilities. For example admins and owners automatically have the moderator role."),l=e.queryable_roles.length&&e.queryable_affiliations.length;return el `
$ { e . alert _message ? el ` <div class="alert alert- ${ e . alert _type } " role="alert"> ${ e . alert _message } </div> ` : "" }
$ { l ? el `
2021-11-11 22:06:49 +01:00
< ul class = "nav nav-pills justify-content-center" >
< li role = "presentation" class = "nav-item" >
< a class = "nav-link active" id = "affiliations-tab" href = "#affiliations-tabpanel" aria - controls = "affiliations-tabpanel" role = "tab" data - toggle = "tab" > Affiliations < / a >
2021-03-19 19:26:15 +01:00
< / l i >
2021-11-11 22:06:49 +01:00
< li role = "presentation" class = "nav-item" >
< a class = "nav-link" id = "roles-tab" href = "#roles-tabpanel" aria - controls = "roles-tabpanel" role = "tab" data - toggle = "tab" > Roles < / a >
< / l i >
< / u l >
` :""}
< div class = "tab-content" >
2022-01-03 11:54:10 +01:00
$ { e . queryable _affiliations . length ? el `
2021-11-11 22:06:49 +01:00
< div class = "tab-pane tab-pane--columns ${e.queryable_affiliations.length?" active ":" "}" id = "affiliations-tabpanel" role = "tabpanel" aria - labelledby = "affiliations-tab" >
< form class = "converse-form query-affiliation" @ submit = $ { e . queryAffiliation } >
< p class = "helptext pb-3" > $ { c } < / p >
< div class = "form-group" >
< label for = "affiliation" >
< strong > $ { t } : < / s t r o n g >
< / l a b e l >
< div class = "row" >
< div class = "col" >
< select class = "custom-select select-affiliation" name = "affiliation" >
2022-01-03 11:54:10 +01:00
$ { e . queryable _affiliations . map ( ( t => ( e => el `
2021-11-11 22:06:49 +01:00
< option value = "${e.item||" "}"
? selected = $ { e . item === e . affiliation }
2022-01-03 11:54:10 +01:00
title = "${r_(e.item)}" > $ { e . item } < / o p t i o n >
2021-11-11 22:06:49 +01:00
` )(Object.assign({item:t},e))))}
< / s e l e c t >
2021-03-19 19:26:15 +01:00
< / d i v >
2021-11-11 22:06:49 +01:00
< div class = "col" >
< input type = "submit" class = "btn btn-primary" name = "users_with_affiliation" value = "${o}" / >
2021-03-19 19:26:15 +01:00
< / d i v >
2021-11-11 22:06:49 +01:00
< / d i v >
< div class = "row" >
< div class = "col mt-3" >
2022-01-03 11:54:10 +01:00
$ { Array . isArray ( e . users _with _affiliation ) && e . users _with _affiliation . length > 5 ? el ` <input class="form-control" .value=" ${ e . affiliations _filter } " @keyup= ${ e . filterAffiliationResults } type="text" name="filter" placeholder=" ${ i } "/> ` : "" }
2021-03-19 19:26:15 +01:00
< / d i v >
2021-11-11 22:06:49 +01:00
< / d i v >
2022-01-03 11:54:10 +01:00
$ { r _ ( e . affiliation ) ? el ` <div class="row"><div class="col pt-2"><p class="helptext pb-3"> ${ r _ ( e . affiliation ) } </p></div></div> ` : "" }
2021-03-19 19:26:15 +01:00
< / d i v >
2021-11-11 22:06:49 +01:00
< / f o r m >
< div class = "scrollable-container" >
< ul class = "list-group list-group--users" >
2022-01-03 11:54:10 +01:00
$ { e . loading _users _with _affiliation ? el ` <li class="list-group-item"> ${ ny ( ) } </li> ` : "" }
$ { Array . isArray ( e . users _with _affiliation ) && 0 === e . users _with _affiliation . length ? el ` <li class="list-group-item"> ${ n } </li> ` : "" }
2021-11-11 22:06:49 +01:00
2022-01-03 11:54:10 +01:00
$ { e . users _with _affiliation instanceof Error ? el ` <li class="list-group-item"> ${ e . users _with _affiliation . message } </li> ` : ( e . users _with _affiliation || [ ] ) . map ( ( t => ( t . nick || t . jid ) . match ( new RegExp ( e . affiliations _filter , "i" ) ) ? ( e => el `
2021-03-19 19:26:15 +01:00
< li class = "list-group-item" data - nick = "${e.item.nick}" >
< ul class = "list-group" >
< li class = "list-group-item active" >
< div > < strong > JID : < / s t r o n g > $ { e . i t e m . j i d } < / d i v >
< / l i >
< li class = "list-group-item" >
< div > < strong > Nickname : < / s t r o n g > $ { e . i t e m . n i c k } < / d i v >
< / l i >
< li class = "list-group-item" >
2022-01-03 11:54:10 +01:00
< div > < strong > Affiliation : < / s t r o n g > $ { e . i t e m . a f f i l i a t i o n } $ { e . a s s i g n a b l e _ a f f i l i a t i o n s . l e n g t h ? ( e = > e l `
2021-11-11 22:06:49 +01:00
< a href = "#" data - form = "affiliation-form" class = "toggle-form right" color = "var(--subdued-color)" @ click = $ { e . toggleForm } >
< converse - icon class = "fa fa-wrench" size = "1em" > < / c o n v e r s e - i c o n >
< / a > ` ) ( e ) : " " } < / d i v >
2022-01-03 11:54:10 +01:00
$ { e . assignable _affiliations . length ? ( e => { const t = Eh ( "Change affiliation" ) , n = Eh ( "New affiliation" ) , s = Eh ( "Reason" ) ; return el `
2021-11-11 22:06:49 +01:00
< form class = "affiliation-form hidden" @ submit = $ { e . assignAffiliation } >
2021-03-19 19:26:15 +01:00
< div class = "form-group" >
< input type = "hidden" name = "jid" value = "${e.item.jid}" / >
< input type = "hidden" name = "nick" value = "${e.item.nick}" / >
< div class = "row" >
< div class = "col" >
< label > < strong > $ { n } : < / s t r o n g > < / l a b e l >
2021-11-11 22:06:49 +01:00
< select class = "custom-select select-affiliation" name = "affiliation" >
2022-01-03 11:54:10 +01:00
$ { e . assignable _affiliations . map ( ( t => el ` <option value=" ${ t } " ?selected= ${ t === e . item . affiliation } > ${ t } </option> ` ) ) }
2021-03-19 19:26:15 +01:00
< / s e l e c t >
< / d i v >
< div class = "col" >
2021-11-11 22:06:49 +01:00
< label > < strong > $ { s } : < / s t r o n g > < / l a b e l >
2021-03-19 19:26:15 +01:00
< input class = "form-control" type = "text" name = "reason" / >
< / d i v >
< / d i v >
< / d i v >
< div class = "form-group" >
2021-11-11 22:06:49 +01:00
< input type = "submit" class = "btn btn-primary" name = "change" value = "${t}" / >
2021-03-19 19:26:15 +01:00
< / d i v >
< / f o r m >
` })(e):""}
< / l i >
< / u l >
< / l i >
2021-11-11 22:06:49 +01:00
` )(Object.assign({item:t},e)):""))}
< / u l >
< / d i v >
< / d i v > ` : " " }
2022-01-03 11:54:10 +01:00
$ { e . queryable _roles . length ? el `
2021-11-11 22:06:49 +01:00
< div class = "tab-pane tab-pane--columns ${!l&&e.queryable_roles.length?" active ":" "}" id = "roles-tabpanel" role = "tabpanel" aria - labelledby = "roles-tab" >
< form class = "converse-form query-role" @ submit = $ { e . queryRole } >
< p class = "helptext pb-3" > $ { a } < / p >
< div class = "form-group" >
< label for = "role" > < strong > $ { r } : < / s t r o n g > < / l a b e l >
< div class = "row" >
< div class = "col" >
< select class = "custom-select select-role" name = "role" >
2022-01-03 11:54:10 +01:00
$ { e . queryable _roles . map ( ( t => ( e => el `
2021-11-11 22:06:49 +01:00
< option value = "${e.item||" "}"
? selected = $ { e . item === e . role }
2022-01-03 11:54:10 +01:00
title = "${i_(e.item)}" > $ { e . item } < / o p t i o n >
2021-11-11 22:06:49 +01:00
` )(Object.assign({item:t},e))))}
< / s e l e c t >
< / d i v >
< div class = "col" >
< input type = "submit" class = "btn btn-primary" name = "users_with_role" value = "${o}" / >
< / d i v >
< / d i v >
< div class = "row" >
< div class = "col mt-3" >
2022-01-03 11:54:10 +01:00
$ { Array . isArray ( e . users _with _role ) && e . users _with _role . length > 5 ? el ` <input class="form-control" .value=" ${ e . roles _filter } " @keyup= ${ e . filterRoleResults } type="text" name="filter" placeholder=" ${ i } "/> ` : "" }
2021-11-11 22:06:49 +01:00
< / d i v >
< / d i v >
2022-01-03 11:54:10 +01:00
$ { i _ ( e . role ) ? el ` <div class="row"><div class="col pt-2"><p class="helptext pb-3"> ${ i _ ( e . role ) } </p></div></div> ` : "" }
2021-11-11 22:06:49 +01:00
< / d i v >
< / f o r m >
< div class = "scrollable-container" >
< ul class = "list-group list-group--users" >
2022-01-03 11:54:10 +01:00
$ { e . loading _users _with _role ? el ` <li class="list-group-item"> ${ ny ( ) } </li> ` : "" }
$ { e . users _with _role && 0 === e . users _with _role . length ? el ` <li class="list-group-item"> ${ s } </li> ` : "" }
$ { ( e . users _with _role || [ ] ) . map ( ( t => t . nick . match ( e . roles _filter ) ? ( e => el `
2021-03-19 19:26:15 +01:00
< li class = "list-group-item" data - nick = "${e.item.nick}" >
< ul class = "list-group" >
< li class = "list-group-item active" >
< div > < strong > JID : < / s t r o n g > $ { e . i t e m . j i d } < / d i v >
< / l i >
< li class = "list-group-item" >
< div > < strong > Nickname : < / s t r o n g > $ { e . i t e m . n i c k } < / d i v >
< / l i >
< li class = "list-group-item" >
2022-01-03 11:54:10 +01:00
< div > < strong > Role : < / s t r o n g > $ { e . i t e m . r o l e } $ { e . a s s i g n a b l e _ r o l e s . l e n g t h ? ( e = > e l `
2021-11-11 22:06:49 +01:00
< a href = "#" data - form = "role-form" class = "toggle-form right" color = "var(--subdued-color)" @ click = $ { e . toggleForm } >
< converse - icon class = "fa fa-wrench" size = "1em" > < / c o n v e r s e - i c o n >
< / a > ` ) ( e ) : " " } < / d i v >
2022-01-03 11:54:10 +01:00
$ { e . assignable _roles . length ? ( e => { const t = Eh ( "Change role" ) , n = Eh ( "New Role" ) , s = Eh ( "Reason" ) ; return el `
2021-11-11 22:06:49 +01:00
< form class = "role-form hidden" @ submit = $ { e . assignRole } >
2021-03-19 19:26:15 +01:00
< div class = "form-group" >
< input type = "hidden" name = "jid" value = "${e.item.jid}" / >
< input type = "hidden" name = "nick" value = "${e.item.nick}" / >
< div class = "row" >
< div class = "col" >
< label > < strong > $ { n } : < / s t r o n g > < / l a b e l >
2021-11-11 22:06:49 +01:00
< select class = "custom-select select-role" name = "role" >
2022-01-03 11:54:10 +01:00
$ { e . assignable _roles . map ( ( t => el ` <option value=" ${ t } " ?selected= ${ t === e . item . role } > ${ t } </option> ` ) ) }
2021-03-19 19:26:15 +01:00
< / s e l e c t >
< / d i v >
< div class = "col" >
2021-11-11 22:06:49 +01:00
< label > < strong > $ { s } : < / s t r o n g > < / l a b e l >
2021-03-19 19:26:15 +01:00
< input class = "form-control" type = "text" name = "reason" / >
< / d i v >
< / d i v >
< / d i v >
< div class = "form-group" >
2021-11-11 22:06:49 +01:00
< input type = "submit" class = "btn btn-primary" value = "${t}" / >
2021-03-19 19:26:15 +01:00
< / d i v >
< / f o r m >
` })(e):""}
< / l i >
< / u l >
< / l i >
2021-11-11 22:06:49 +01:00
` )(Object.assign({item:t},e)):""))}
< / u l >
2021-03-19 19:26:15 +01:00
< / d i v >
2021-11-11 22:06:49 +01:00
< / d i v > ` : " " }
2022-01-03 11:54:10 +01:00
< / d i v > ` } , { S t r o p h e : a _ , s i z z l e : c _ , u : l _ } = $ l . e n v ; j l . e l e m e n t s . d e f i n e ( " c o n v e r s e - m o d t o o l s " , c l a s s e x t e n d s i g { s t a t i c g e t p r o p e r t i e s ( ) { r e t u r n { a f f i l i a t i o n : { t y p e : S t r i n g } , a f f i l i a t i o n s _ f i l t e r : { t y p e : S t r i n g , a t t r i b u t e : ! 1 } , a l e r t _ m e s s a g e : { t y p e : S t r i n g , a t t r i b u t e : ! 1 } , a l e r t _ t y p e : { t y p e : S t r i n g , a t t r i b u t e : ! 1 } , j i d : { t y p e : S t r i n g } , m u c : { t y p e : O b j e c t , a t t r i b u t e : ! 1 } , r o l e : { t y p e : S t r i n g } , r o l e s _ f i l t e r : { t y p e : S t r i n g , a t t r i b u t e : ! 1 } , u s e r s _ w i t h _ a f f i l i a t i o n : { t y p e : A r r a y , a t t r i b u t e : ! 1 } , u s e r s _ w i t h _ r o l e : { t y p e : A r r a y , a t t r i b u t e : ! 1 } } } c o n s t r u c t o r ( ) { s u p e r ( ) , t h i s . a f f i l i a t i o n = " " , t h i s . a f f i l i a t i o n s _ f i l t e r = " " , t h i s . r o l e = " " , t h i s . r o l e s _ f i l t e r = " " } u p d a t e d ( e ) { e . h a s ( " r o l e " ) & & t h i s . o n S e a r c h R o l e C h a n g e ( ) , e . h a s ( " a f f i l i a t i o n " ) & & t h i s . o n S e a r c h A f f i l i a t i o n C h a n g e ( ) , e . h a s ( " j i d " ) & & e . g e t ( " j i d " ) & & t h i s . i n i t i a l i z e ( ) } a s y n c i n i t i a l i z e ( ) { t h i s . i n i t i a l i z e d = j i ( ) ; c o n s t e = a w a i t j l . r o o m s . g e t ( t h i s . j i d ) ; a w a i t e . i n i t i a l i z e d , t h i s . m u c = e , t h i s . i n i t i a l i z e d . r e s o l v e ( ) } r e n d e r ( ) { v a r e ; i f ( n u l l ! = = ( e = t h i s . m u c ) & & v o i d 0 ! = = e & & e . o c c u p a n t s ) { c o n s t e = t h i s . m u c . o c c u p a n t s . f i n d W h e r e ( { j i d : w a . b a r e _ j i d } ) ; r e t u r n o _ ( { a f f i l i a t i o n s _ f i l t e r : t h i s . a f f i l i a t i o n s _ f i l t e r , a l e r t _ m e s s a g e : t h i s . a l e r t _ m e s s a g e , a l e r t _ t y p e : t h i s . a l e r t _ t y p e , a s s i g n A f f i l i a t i o n : e = > t h i s . a s s i g n A f f i l i a t i o n ( e ) , a s s i g n R o l e : e = > t h i s . a s s i g n R o l e ( e ) , a s s i g n a b l e _ a f f i l i a t i o n s : I u ( e ) , a s s i g n a b l e _ r o l e s : X u ( e ) , f i l t e r A f f i l i a t i o n R e s u l t s : e = > t h i s . f i l t e r A f f i l i a t i o n R e s u l t s ( e ) , f i l t e r R o l e R e s u l t s : e = > t h i s . f i l t e r R o l e R e s u l t s ( e ) , l o a d i n g _ u s e r s _ w i t h _ a f f i l i a t i o n : t h i s . l o a d i n g _ u s e r s _ w i t h _ a f f i l i a t i o n , q u e r y A f f i l i a t i o n : e = > t h i s . q u e r y A f f i l i a t i o n ( e ) , q u e r y R o l e : e = > t h i s . q u e r y R o l e ( e ) , q u e r y a b l e _ a f f i l i a t i o n s : f h . f i l t e r ( ( e = > ! j l . s e t t i n g s . g e t ( " m o d t o o l s _ d i s a b l e _ q u e r y " ) . i n c l u d e s ( e ) ) ) , q u e r y a b l e _ r o l e s : h h . f i l t e r ( ( e = > ! j l . s e t t i n g s . g e t ( " m o d t o o l s _ d i s a b l e _ q u e r y " ) . i n c l u d e s ( e ) ) ) , r o l e s _ f i l t e r : t h i s . r o l e s _ f i l t e r , s w i t c h T a b : e = > t h i s . s w i t c h T a b ( e ) , t o g g l e F o r m : e = > t h i s . t o g g l e F o r m ( e ) , u s e r s _ w i t h _ a f f i l i a t i o n : t h i s . u s e r s _ w i t h _ a f f i l i a t i o n , u s e r s _ w i t h _ r o l e : t h i s . u s e r s _ w i t h _ r o l e } ) } r e t u r n " " } a s y n c o n S e a r c h A f f i l i a t i o n C h a n g e ( ) { i f ( t h i s . a f f i l i a t i o n ) { i f ( a w a i t t h i s . i n i t i a l i z e d , t h i s . c l e a r A l e r t ( ) , t h i s . l o a d i n g _ u s e r s _ w i t h _ a f f i l i a t i o n = ! 0 , t h i s . u s e r s _ w i t h _ a f f i l i a t i o n = n u l l , t h i s . s h o u l d F e t c h A f f i l i a t i o n s L i s t ( ) ) { c o n s t e = a w a i t $ u ( t h i s . a f f i l i a t i o n , t h i s . j i d ) ; e i n s t a n c e o f E r r o r ? ( t h i s . a l e r t ( e . m e s s a g e , " d a n g e r " ) , t h i s . u s e r s _ w i t h _ a f f i l i a t i o n = [ ] ) : t h i s . u s e r s _ w i t h _ a f f i l i a t i o n = e } e l s e t h i s . u s e r s _ w i t h _ a f f i l i a t i o n = t h i s . m u c . g e t O c c u p a n t s W i t h A f f i l i a t i o n ( t h i s . a f f i l i a t i o n ) ; t h i s . l o a d i n g _ u s e r s _ w i t h _ a f f i l i a t i o n = ! 1 } } a s y n c o n S e a r c h R o l e C h a n g e ( ) { t h i s . r o l e & & ( a w a i t t h i s . i n i t i a l i z e d , t h i s . c l e a r A l e r t ( ) , t h i s . u s e r s _ w i t h _ r o l e = t h i s . m u c . g e t O c c u p a n t s W i t h R o l e ( t h i s . r o l e ) ) } s h o u l d F e t c h A f f i l i a t i o n s L i s t ( ) { c o n s t e = t h i s . a f f i l i a t i o n ; r e t u r n " n o n e " ! = = e & & ! t h i s . m u c . o c c u p a n t s . g e t A u t o F e t c h e d A f f i l i a t i o n L i s t s ( ) . i n c l u d e s ( e ) } t o g g l e F o r m ( e ) { e . s t o p P r o p a g a t i o n ( ) , e . p r e v e n t D e f a u l t ( ) ; c o n s t t = l _ . a n c e s t o r ( e . t a r g e t , " . t o g g l e - f o r m " ) , n = t . g e t A t t r i b u t e ( " d a t a - f o r m " ) , s = l _ . a n c e s t o r ( t , " . l i s t - g r o u p - i t e m " ) . q u e r y S e l e c t o r ( ` . $ { n } ` ) ; l _ . h a s C l a s s ( " h i d d e n " , s ) ? l _ . r e m o v e C l a s s ( " h i d d e n " , s ) : l _ . a d d C l a s s ( " h i d d e n " , s ) } f i l t e r R o l e R e s u l t s ( e ) { t h i s . r o l e s _ f i l t e r = e . t a r g e t . v a l u e , t h i s . r e n d e r ( ) } f i l t e r A f f i l i a t i o n R e s u l t s ( e ) { t h i s . a f f i l i a t i o n s _ f i l t e r = e . t a r g e t . v a l u e } q u e r y R o l e ( e ) { e . s t o p P r o p a g a t i o n ( ) , e . p r e v e n t D e f a u l t ( ) ; c o n s t t = n e w F o r m D a t a ( e . t a r g e t ) . g e t ( " r o l e " ) ; t h i s . r o l e = n u l l , t h i s . r o l e = t } q u e r y A f f i l i a t i o n ( e ) { e . s t o p P r o p a g a t i o n ( ) , e . p r e v e n t D e f a u l t ( ) ; c o n s t t = n e w F o r m D a t a ( e . t a r g e t ) . g e t ( " a f f i l i a t i o n " ) ; t h i s . a f f i l i a t i o n = n u l l , t h i s . a f f i l i a t i o n = t } a l e r t ( e , t ) { t h i s . a l e r t _ m e s s a g e = e , t h i s . a l e r t _ t y p e = t } c l e a r A l e r t ( ) { t h i s . a l e r t _ m e s s a g e = v o i d 0 , t h i s . a l e r t _ t y p e = v o i d 0 } a s y n c a s s i g n A f f i l i a t i o n ( e ) { e . s t o p P r o p a g a t i o n ( ) , e . p r e v e n t D e f a u l t ( ) , t h i s . c l e a r A l e r t ( ) ; c o n s t t = n e w F o r m D a t a ( e . t a r g e t ) , n = t . g e t ( " a f f i l i a t i o n " ) , s = { j i d : t . g e t ( " j i d " ) , r e a s o n : t . g e t ( " r e a s o n " ) } , i = t h i s . a f f i l i a t i o n , r = t h i s . m u c . g e t ( " j i d " ) ; t r y { a w a i t R u ( n , r , [ s ] ) } c a t c h ( e ) { r e t u r n n u l l = = = e ? t h i s . a l e r t ( E h ( " T i m e o u t e r r o r w h i l e t r y i n g t o s e t t h e a f f i l i a t i o n " ) , " d a n g e r " ) : c _ ( ` n o t - a l l o w e d [ x m l n s = " $ { a _ . N S . S T A N Z A S } " ] ` , e ) . l e n g t h ? t h i s . a l e r t ( E h ( " S o r r y , y o u ' r e n o t a l l o w e d t o m a k e t h a t c h a n g e " ) , " d a n g e r " ) : t h i s . a l e r t ( E h ( " S o r r y , s o m e t h i n g w e n t w r o n g w h i l e t r y i n g t o s e t t h e a f f i l i a t i o n " ) , " d a n g e r " ) , v o i d M . e r r o r ( e ) } a w a i t t h i s . m u c . o c c u p a n t s . f e t c h M e m b e r s ( ) , t h i s . a f f i l i a t i o n = n u l l , t h i s . a f f i l i a t i o n = i ,
2021-03-19 19:26:15 +01:00
< div class = "modal-dialog" role = "document" >
< div class = "modal-content" >
< div class = "modal-header" >
2021-11-11 22:06:49 +01:00
< h5 class = "modal-title" id = "converse-modtools-modal-label" > $ { t } < / h 5 >
2022-01-03 11:54:10 +01:00
$ { lp }
2021-03-19 19:26:15 +01:00
< / d i v >
2021-11-11 22:06:49 +01:00
< div class = "modal-body d-flex flex-column" >
< converse - modtools jid = $ { e . jid } affiliation = $ { e . affiliation } > < / c o n v e r s e - m o d t o o l s >
2021-03-19 19:26:15 +01:00
< / d i v >
< / d i v >
2022-01-03 11:54:10 +01:00
< / d i v > ` } ) ( t h i s ) } } ) , { S t r o p h e : u _ , $ i q : h _ , s i z z l e : f _ , u : m _ } = $ l . e n v , g _ = { a d m i n : " a d m i n " , b a n : " o u t c a s t " , m e m b e r : " m e m b e r " , o w n e r : " o w n e r " , r e v o k e : " n o n e " } , p _ = { d e o p : " p a r t i c i p a n t " , k i c k : " n o n e " , m u t e : " v i s i t o r " , o p : " m o d e r a t o r " , v o i c e : " p a r t i c i p a n t " } ; a s y n c f u n c t i o n v _ ( e ) { c o n s t t = [ E h ( " A r e y o u s u r e y o u w a n t t o d e s t r o y t h i s g r o u p c h a t ? " ) ] ; l e t n = [ { n a m e : " c h a l l e n g e " , l a b e l : E h ( " P l e a s e e n t e r t h e X M P P a d d r e s s o f t h i s g r o u p c h a t t o c o n f i r m " ) , c h a l l e n g e : e . g e t ( " j i d " ) , p l a c e h o l d e r : E h ( " n a m e @ e x a m p l e . o r g " ) , r e q u i r e d : ! 0 } , { n a m e : " r e a s o n " , l a b e l : E h ( " O p t i o n a l r e a s o n f o r d e s t r o y i n g t h i s g r o u p c h a t " ) , p l a c e h o l d e r : E h ( " R e a s o n " ) } , { n a m e : " n e w j i d " , l a b e l : E h ( " O p t i o n a l X M P P a d d r e s s f o r a n e w g r o u p c h a t t h a t r e p l a c e s t h i s o n e " ) , p l a c e h o l d e r : E h ( " r e p l a c e m e n t @ e x a m p l e . o r g " ) } ] ; t r y { v a r s , i ; n = a w a i t j l . c o n f i r m ( E h ( " C o n f i r m " ) , t , n ) ; c o n s t r = n u l l = = = ( s = n . f i l t e r ( ( e = > " r e a s o n " = = = e . n a m e ) ) . p o p ( ) ) | | v o i d 0 = = = s ? v o i d 0 : s . v a l u e , o = n u l l = = = ( i = n . f i l t e r ( ( e = > " n e w j i d " = = = e . n a m e ) ) . p o p ( ) ) | | v o i d 0 = = = i ? v o i d 0 : i . v a l u e ; r e t u r n e . s e n d D e s t r o y I Q ( r , o ) . t h e n ( ( ( ) = > e . c l o s e ( ) ) ) } c a t c h ( e ) { M . e r r o r ( e ) } } f u n c t i o n y _ ( e , t ) { t . q u e r y S e l e c t o r ( " c o n v e r s e - r o o m s - l i s t " ) . m o d e l . s a v e ( " m u c _ d o m a i n " , u _ . g e t D o m a i n F r o m J i d ( e ) ) } f u n c t i o n b _ ( e ) { e . m o d e l . g e t ( " c o n n e c t e d " ) & & ( e . q u e r y S e l e c t o r ( " c o n v e r s e - r o o m s - l i s t " ) . m o d e l . g e t ( " m u c _ d o m a i n " ) | | ( v o i d 0 = = = j l . s e t t i n g s . g e t ( " m u c _ d o m a i n " ) ? f u n c t i o n ( e ) { f u n c t i o n t ( t ) { t & & t . g e t ( " v a r " ) = = = u _ . N S . M U C & & t . e n t i t y . g e t I d e n t i t y ( " c o n f e r e n c e " , " t e x t " ) . t h e n ( ( n = > { n & & y _ ( t . g e t ( " f r o m " ) , e ) } ) ) } j l . w a i t U n t i l ( " d i s c o I n i t i a l i z e d " ) . t h e n ( ( ( ) = > { j l . l i s t e n . o n ( " s e r v i c e D i s c o v e r e d " , t ) , w a . d i s c o _ e n t i t i e s . e a c h ( ( e = > t ( e . f e a t u r e s . f i n d W h e r e ( { v a r : u _ . N S . M U C } ) ) ) ) } ) ) . c a t c h ( ( e = > M . e r r o r ( e ) ) ) } ( e ) : y _ ( j l . s e t t i n g s . g e t ( " m u c _ d o m a i n " ) , e ) ) ) } f u n c t i o n _ _ ( e , t ) { t = t . t r i m ( ) ; c o n s t n = d o c u m e n t . c r e a t e E l e m e n t ( " l i " ) ; i f ( n . s e t A t t r i b u t e ( " a r i a - s e l e c t e d " , " f a l s e " ) , j l . s e t t i n g s . g e t ( " m u c _ m e n t i o n _ a u t o c o m p l e t e _ s h o w _ a v a t a r " ) ) { c o n s t t = d o c u m e n t . c r e a t e E l e m e n t ( " i m g " ) ; l e t s = " d a t a : " + w a . D E F A U L T _ I M A G E _ T Y P E + " ; b a s e 6 4 , " + w a . D E F A U L T _ I M A G E ; i f ( w a . v c a r d s ) { c o n s t t = w a . v c a r d s . f i n d W h e r e ( { n i c k n a m e : e } ) ; t & & ( s = " d a t a : " + t . g e t ( " i m a g e _ t y p e " ) + " ; b a s e 6 4 , " + t . g e t ( " i m a g e " ) ) } t . s e t A t t r i b u t e ( " s r c " , s ) , t . s e t A t t r i b u t e ( " w i d t h " , " 2 2 " ) , t . s e t A t t r i b u t e ( " c l a s s " , " a v a t a r a v a t a r - a u t o c o m p l e t e " ) , n . a p p e n d C h i l d ( t ) } c o n s t s = n e w R e g E x p ( " ( " + t + " ) " , " i g " ) ; r e t u r n ( t ? e . s p l i t ( s ) : [ e ] ) . f o r E a c h ( ( e = > { i f ( t & & e . m a t c h ( s ) ) { c o n s t t = d o c u m e n t . c r e a t e E l e m e n t ( " m a r k " ) ; t . t e x t C o n t e n t = e , n . a p p e n d C h i l d ( t ) } e l s e n . a p p e n d C h i l d ( d o c u m e n t . c r e a t e T e x t N o d e ( e ) ) } ) ) , n } a s y n c f u n c t i o n w _ ( ) { c o n s t e = [ . . . a w a i t j l . r o o m s . g e t ( ) , . . . a w a i t j l . c o n t a c t s . g e t ( ) ] ; r e t u r n [ . . . n e w S e t ( e . m a p ( ( e = > u _ . g e t D o m a i n F r o m J i d ( e . g e t ( " j i d " ) ) ) ) ) ] } f u n c t i o n S _ ( e , t , n , s = [ ] , i = [ ] ) { c o n s t r = p _ [ t ] ; i f ( ! r ) t h r o w E r r o r ( ` C h a t R o o m V i e w # s e t R o l e c a l l e d w i t h i n v a l i d c o m m a n d : $ { t } ` ) ; i f ( ! e . v e r i f y A f f i l i a t i o n s ( s ) | | ! e . v e r i f y R o l e s ( i ) ) r e t u r n ! 1 ; i f ( ! e . v a l i d a t e R o l e O r A f f i l i a t i o n C h a n g e A r g s ( t , n ) ) r e t u r n ! 1 ; c o n s t o = e . g e t N i c k O r J I D F r o m C o m m a n d A r g s ( n ) ; i f ( ! o ) r e t u r n ! 1 ; c o n s t a = n . s p l i t ( o , 2 ) [ 1 ] . t r i m ( ) , c = e . g e t O c c u p a n t ( o ) ; r e t u r n e . s e t R o l e ( c , r , a , v o i d 0 , ( t = > e . o n C o m m a n d E r r o r ( t ) ) ) , ! 0 } f u n c t i o n x _ ( e , t , n , s ) { c o n s t i = g _ [ t ] ; i f ( ! i ) t h r o w E r r o r ( ` v e r i f y A f f i l i a t i o n s c a l l e d w i t h i n v a l i d c o m m a n d : $ { t } ` ) ; i f ( ! e . v e r i f y A f f i l i a t i o n s ( s ) ) r e t u r n ! 1 ; i f ( ! e . v a l i d a t e R o l e O r A f f i l i a t i o n C h a n g e A r g s ( t , n ) ) r e t u r n ! 1 ; c o n s t r = e . g e t N i c k O r J I D F r o m C o m m a n d A r g s ( n ) ; i f ( ! r ) r e t u r n ! 1 ; l e t o ; c o n s t a = n . s p l i t ( r , 2 ) [ 1 ] . t r i m ( ) , c = e . g e t O c c u p a n t ( r ) ; i f ( c ) o = c . g e t ( " j i d " ) ; e l s e { i f ( ! m _ . i s V a l i d J I D ( r ) ) { c o n s t t = E h ( " C o u l d n ' t f i n d a p a r t i c i p a n t w i t h t h a t n i c k n a m e . T h e y m i g h t h a v e l e f t t h e g r o u p c h a t . " ) ; r e t u r n v o i d e . c r e a t e M e s s a g e ( { m e s s a g e : t , t y p e : " e r r o r " } ) } o = r } c o n s t l = { j i d : o , r e a s o n : a } ; c & & j l . s e t t i n g s . g e t ( " a u t o _ r e g i s t e r _ m u c _ n i c k n a m e " ) & & ( l . n i c k = c . g e t ( " n i c k " ) ) , R u ( i , e . g e t ( " j i d " ) , [ l ] ) . t h e n ( ( ( ) = > e . o c c u p a n t s . f e t c h M e m b e r s ( ) ) ) . c a t c h ( ( t = > e . o n C o m m a n d E r r o r ( t ) ) ) } f u n c t i o n E _ ( e , t ) { i f ( ! e . v e r i f y R o l e s ( [ " m o d e r a t o r " ] ) ) r e t u r n ; l e t n = j l . m o d a l . g e t ( d _ . i d ) ; n ? ( n . a f f i l i a t i o n = t , n . r e n d e r ( ) ) : n = j l . m o d a l . c r e a t e ( d _ , { a f f i l i a t i o n : t , j i d : e . g e t ( " j i d " ) } ) , n . s h o w ( ) } c o n s t A _ = e = > { c o n s t t = E h ( " O n w h i c h e n t i t y d o y o u w a n t t o r u n c o m m a n d s ? " ) , n = E h ( " C e r t a i n X M P P s e r v i c e s a n d e n t i t i e s a l l o w p r i v i l e g e d u s e r s t o e x e c u t e a d - h o c c o m m a n d s o n t h e m . " ) , s = E h ( " C o m m a n d s f o u n d " ) , i = E h ( " L i s t a v a i l a b l e c o m m a n d s " ) , r = E h ( " X M P P A d d r e s s " ) , o = E h ( " N o c o m m a n d s f o u n d " ) ; r e t u r n e l `
$ { e . alert ? el ` <div class="alert alert- ${ e . alert _type } " role="alert"> ${ e . alert } </div> ` : "" }
2021-11-11 22:06:49 +01:00
< form class = "converse-form" @ submit = $ { e . fetchCommands } >
2021-03-19 19:26:15 +01:00
< fieldset class = "form-group" >
2021-11-11 22:06:49 +01:00
< label >
$ { t }
< p class = "form-help" > $ { n } < / p >
< converse - autocomplete
2022-01-03 11:54:10 +01:00
. getAutoCompleteList = "${w_}"
2021-11-11 22:06:49 +01:00
placeholder = "${r}"
name = "jid" / >
< / l a b e l >
2021-03-19 19:26:15 +01:00
< / f i e l d s e t >
< fieldset class = "form-group" >
2021-11-11 22:06:49 +01:00
< input type = "submit" class = "btn btn-primary" value = "${i}" >
2021-03-19 19:26:15 +01:00
< / f i e l d s e t >
2022-01-03 11:54:10 +01:00
$ { "list-commands" === e . view ? el `
2021-03-19 19:26:15 +01:00
< fieldset class = "form-group" >
2021-11-11 22:06:49 +01:00
< ul class = "list-group" >
< li class = "list-group-item active" > $ { e . commands . length ? s : o } : < / l i >
2022-01-03 11:54:10 +01:00
$ { e . commands . map ( ( t => ( ( e , t ) => el `
2021-03-19 19:26:15 +01:00
< li class = "room-item list-group-item" >
< div class = "available-chatroom d-flex flex-row" >
< a class = "open-room available-room w-100"
@ click = $ { e . toggleCommandForm }
data - command - node = "${t.node}"
data - command - jid = "${t.jid}"
data - command - name = "${t.name}"
title = "${t.name}"
href = "#" > $ { t . name || t . jid } < / a >
< / d i v >
2022-01-03 11:54:10 +01:00
$ { t . node === e . showform ? ( ( e , t ) => { const n = Eh ( "Hide" ) , s = Eh ( "Execute" ) ; return el `
2021-03-19 19:26:15 +01:00
< form @ submit = $ { e . runCommand } >
2022-01-03 11:54:10 +01:00
$ { t . alert ? el ` <div class="alert alert- ${ t . alert _type } " role="alert"> ${ t . alert } </div> ` : "" }
2021-03-19 19:26:15 +01:00
< fieldset class = "form-group" >
< input type = "hidden" name = "command_node" value = "${t.node}" / >
< input type = "hidden" name = "command_jid" value = "${t.jid}" / >
< p class = "form-help" > $ { t . instructions } < / p >
2021-11-11 22:06:49 +01:00
$ { t . fields }
2021-03-19 19:26:15 +01:00
< / f i e l d s e t >
< fieldset >
2021-11-11 22:06:49 +01:00
< input type = "submit" class = "btn btn-primary" value = "${s}" >
2021-03-19 19:26:15 +01:00
< input type = "button" class = "btn btn-secondary button-cancel" value = "${n}" @ click = $ { e . hideCommandForm } >
< / f i e l d s e t >
< / f o r m >
` })(e,t):""}
< / l i >
2021-11-11 22:06:49 +01:00
` )(e,t)))}
< / u l >
< / f i e l d s e t > ` : " " }
< / f o r m >
2022-01-03 11:54:10 +01:00
` },{Strophe:C_, $ iq:T_,sizzle:k_,u:j_}= $ l.env;jl.elements.define("converse-adhoc-commands",class extends ig{static get properties(){return{alert:{type:String},alert_type:{type:String},nonce:{type:String},showform:{type:String},view:{type:String}}}constructor(){super(),this.view="choose-service",this.showform="",this.commands=[]}render(){return A_({alert:this.alert,alert_type:this.alert_type,commands:this.commands,fetchCommands:e=>this.fetchCommands(e),hideCommandForm:e=>this.hideCommandForm(e),runCommand:e=>this.runCommand(e),showform:this.showform,toggleCommandForm:e=>this.toggleCommandForm(e),view:this.view})}async fetchCommands(e){e.preventDefault(),delete this.alert_type,delete this.alert;const t=new FormData(e.target).get("jid").trim();let n;try{n=await jl.disco.supports(C_.NS.ADHOC,t)}catch(e){M.error(e)}if(n)try{this.commands=await jl.adhoc.getCommands(t),this.view="list-commands"}catch(e){return M.error(e),this.alert_type="danger",this.alert=Eh("Sorry, an error occurred while looking for commands on that entity."),this.commands=[],void M.error(e)}else this.alert_type="danger",this.alert=Eh("The specified entity doesn't support ad-hoc commands")}async toggleCommandForm(e){e.preventDefault();const t=e.target.getAttribute("data-command-node"),n=this.commands.filter((e=>e.node===t))[0];this.showform!==t&&await async function(e){const t=e.node,n=e.jid,s=h_({type:"set",to:n}).c("command",{xmlns:u_.NS.ADHOC,node:t,action:"execute"});try{var i;const t=await jl.sendIQ(s),n=f_( ` command [ xmlns = "${u_.NS.ADHOC}" ] ` ,t).pop();e.sessionid=n.getAttribute("sessionid"),e.instructions=null===(i=f_('x[type="form"][xmlns="jabber:x:data"] instructions',n).pop())||void 0===i?void 0:i.textContent,e.fields=f_('x[type="form"][xmlns="jabber:x:data"] field',n).map((e=>m_.xForm2TemplateResult(e,n)))}catch(t){null===t?M.error( ` Error : timeout while trying to execute command for $ { n } ` ):(M.error( ` Error while trying to execute command for $ { n } ` ),M.error(t)),e.fields=[]}}(n),this.showform=t}hideCommandForm(e){e.preventDefault(),this.showform=""}async runCommand(e){e.preventDefault();const t=new FormData(e.target),n=t.get("command_jid").trim(),s=t.get("command_node").trim(),i=this.commands.filter((e=>e.node===s))[0];i.alert=null,this.nonce=j_.getUniqueId();const r=k_(":input:not([type=button]):not([type=submit])",e.target).filter((e=>!["command_jid","command_node"].includes(e.getAttribute("name")))).map(j_.webForm2xForm).filter((e=>e)),o=T_({to:n,type:"set"}).c("command",{sessionid:i.sessionid,node:i.node,xmlns:C_.NS.ADHOC}).c("x",{xmlns:C_.NS.XFORM,type:"submit"});let a;r.forEach((e=>o.cnode(e).up()));try{a=await jl.sendIQ(o)}catch(e){i.alert_type="danger",i.alert=Eh("Sorry, an error occurred while trying to execute the command. See the developer console for details"),M.error("Error while trying to execute an ad-hoc command"),M.error(e)}var c;i.alert=a?null===(c=a.querySelector("note"))||void 0===c?void 0:c.textContent:"Done",i.alert_type="primary",this.nonce=j_.getUniqueId()}}),jl.elements.define("converse-muc-message-form",class extends My{toHTML(){var e,t;return(e=>{const t=e.composing_spoiler?Eh("Hidden message"):Eh("Message"),n=Eh("Optional hint"),s=jl.settings.get("show_send_button");return el `
2021-11-11 22:06:49 +01:00
< form class = "setNicknameButtonForm hidden" >
< input type = "submit" class = "btn btn-primary" name = "join" value = "Join" / >
< / f o r m >
< form class = "sendXMPPMessage" >
< input type = "text" placeholder = "${n||" "}" value = "${e.hint_value||" "}" class = "${e.composing_spoiler?" ":" hidden "} spoiler-hint" / >
< div class = "suggestion-box" >
< ul class = "suggestion-box__results suggestion-box__results--above" hidden = "" > < / u l >
< textarea
autofocus
type = "text"
@ drop = $ { e . onDrop }
2022-01-03 11:54:10 +01:00
@ input = $ { Ny }
2021-11-11 22:06:49 +01:00
@ keydown = $ { e . onKeyDown }
@ keyup = $ { e . onKeyUp }
@ paste = $ { e . onPaste }
@ change = $ { e . onChange }
class = " chat - textarea suggestion - box _ _input
$ { s ? "chat-textarea-send-button" : "" }
$ { e . composing _spoiler ? "spoiler" : "" } "
placeholder = "${t}" > $ { e . message _value || "" } < / t e x t a r e a >
< span class = "suggestion-box__additions visually-hidden" role = "status" aria - live = "assertive" aria - relevant = "additions" > < / s p a n >
< / d i v >
2022-01-03 11:54:10 +01:00
< /form>`})(Object.assign(this.model.toJSON(),{hint_value:null===(e=this.querySelector(".spoiler-hint"))||void 0===e?void 0:e.value,message_value:null===(t=this.querySelector(".chat-textarea"))||void 0===t?void 0:t.value,onChange:e=>this.model.set({draft:e.target.value}),onDrop:e=>this.onDrop(e),onKeyDown:e=>this.onKeyDown(e),onKeyUp:e=>this.onKeyUp(e),onPaste:e=>this.onPaste(e),scrolled:this.model.ui.get("scrolled"),viewUnreadMessages:e=>this.viewUnreadMessages(e)}))}afterRender(){const e=this.model.session.get("connection_status")===$l.ROOMSTATUS.ENTERED,t=e&&!(this.model.features.get("moderated")&&"visitor"===this.model.getOwnRole());e&&t&&this.initMentionAutoComplete()}initMentionAutoComplete(){this.mention_auto_complete=new wa.AutoComplete(this,{auto_first:!0,auto_evaluate:!1,min_chars:jl.settings.get("muc_mention_autocomplete_min_chars"),match_current_word:!0,list:()=>this.getAutoCompleteList(),filter:"contains"==jl.settings.get("muc_mention_autocomplete_filter")?wa.FILTER_CONTAINS:wa.FILTER_STARTSWITH,ac_triggers:["Tab","@"],include_triggers:[],item:__}),this.mention_auto_complete.on("suggestion-box-selectcomplete",(()=>this.auto_completing=!1))}parseMessageForCommands(e){return function(e,t){if(jl.settings.get("muc_disable_slash_commands")&&!Array.isArray(jl.settings.get("muc_disable_slash_commands")))return jy(e,t);const n=((t=t.replace(/ ^ \ s * /,"")).match(/ ^ \ / ( [ a - zA - Z ] * ) ? /)||[""]).pop().toLowerCase();if(!n)return!1;const s=t.slice(("/ "+n).length+1).trim();if(!e.getAllowedCommands().includes(n))return!1;switch(n){case" admin ":x_(e,n,s,[" owner "]);break;case" ban ":x_(e,n,s,[" admin "," owner "]);break;case" modtools ":E_(e,s);break;case" deop ":S_(e,n,s,[" admin "," owner "]);break;case" destroy ":if(!e.verifyAffiliations([" owner "]))break;v_(e).catch((t=>e.onCommandError(t)));break;case" help ":e.set({show_help_messages:!1},{silent:!0}),e.set({show_help_messages:!0});break;case" kick ":case" mute ":S_(e,n,s,[],[" moderator "]);break;case" member ":x_(e,n,s,[" admin "," owner "]);break;case" nick ":if(!e.verifyRoles([" visitor "," participant "," moderator "]))break;if(0===s.length){const t=Eh('Your nickname is " % 1 $s "',e.get(" nick "));e.createMessage({message:t,type:" error "})}else e.setNickname(s);break;case" owner ":x_(e,n,s,[" owner "]);break;case" op ":S_(e,n,s,[" admin "," owner "]);break;case" register ":s.length>1?e.createMessage({message:Eh(" Error : invalid number of arguments "),type:" error "}):e.registerNickname().then((t=>{t&&e.createMessage({message:t,type:" error "})}));break;case" revoke ":x_(e,n,s,[" admin "," owner "]);break;case" topic ":case" subject ":e.setSubject(s);break;case" voice ":S_(e,n,s,[],[" moderator "]);break;default:return jy(e,t)}return!0}(this.model,e)}getAutoCompleteList(){return this.model.getAllKnownNicknames().map((e=>({label:e,value:`@${e}`})))}onKeyDown(e){this.mention_auto_complete.onKeyDown(e)||super.onKeyDown(e)}onKeyUp(e){this.mention_auto_complete.evaluate(e),super.onKeyUp(e)}});const N_=e=>{const t=Eh(" Nickname "),n=Eh(" Enter groupchat "),s=jl.settings.get(" muc _show _logs _before _join ")?Eh(" Choose a nickname to enter "):Eh(" Please choose your nickname "),i=e.get(" nickname _validation _message " ) ; return el `
2021-11-11 22:06:49 +01:00
< div class = "chatroom-form-container muc-nickname-form"
@ submit = $ { t => function ( e , t ) { e . preventDefault ( ) ; const n = e . target . nick . value . trim ( ) ; n && t . join ( n ) } ( t , e ) } >
< form class = "converse-form chatroom-form converse-centered-form" >
< fieldset class = "form-group" >
< label > $ { s } < / l a b e l >
< p class = "validation-message" > $ { i } < / p >
< input type = "text"
required = "required"
name = "nick"
value = "${e.get(" nick ")||" "}"
class = "form-control ${i?" error ":" "}"
placeholder = "${t}" / >
< / f i e l d s e t >
< fieldset class = "form-group" >
< input type = "submit" class = "btn btn-primary" name = "join" value = "${n}" / >
< / f i e l d s e t >
< / f o r m >
2022-01-03 11:54:10 +01:00
< / d i v > ` } ; v a r O _ = n ( 5 6 5 5 ) , $ _ = { } ; $ _ . s t y l e T a g T r a n s f o r m = v g ( ) , $ _ . s e t A t t r i b u t e s = f g ( ) , $ _ . i n s e r t = u g ( ) . b i n d ( n u l l , " h e a d " ) , $ _ . d o m A P I = l g ( ) , $ _ . i n s e r t S t y l e E l e m e n t = g g ( ) , a g ( ) ( O _ . Z , $ _ ) , O _ . Z & & O _ . Z . l o c a l s & & O _ . Z . l o c a l s , j l . e l e m e n t s . d e f i n e ( " c o n v e r s e - m u c - b o t t o m - p a n e l " , c l a s s e x t e n d s L y { c o n s t r u c t o r ( . . . e ) { v a r t , n , s ; s u p e r ( . . . e ) , s = { " c l i c k . h i d e - o c c u p a n t s " : " h i d e O c c u p a n t s " , " c l i c k . s e n d - b u t t o n " : " s e n d B u t t o n C l i c k e d " } , ( n = " e v e n t s " ) i n ( t = t h i s ) ? O b j e c t . d e f i n e P r o p e r t y ( t , n , { v a l u e : s , e n u m e r a b l e : ! 0 , c o n f i g u r a b l e : ! 0 , w r i t a b l e : ! 0 } ) : t [ n ] = s } a s y n c i n i t i a l i z e ( ) { a w a i t s u p e r . i n i t i a l i z e ( ) , t h i s . l i s t e n T o ( t h i s . m o d e l , " c h a n g e : h i d d e n _ o c c u p a n t s " , t h i s . d e b o u n c e d R e n d e r ) , t h i s . l i s t e n T o ( t h i s . m o d e l , " c h a n g e : n u m _ u n r e a d _ g e n e r a l " , t h i s . d e b o u n c e d R e n d e r ) , t h i s . l i s t e n T o ( t h i s . m o d e l . f e a t u r e s , " c h a n g e : m o d e r a t e d " , t h i s . d e b o u n c e d R e n d e r ) , t h i s . l i s t e n T o ( t h i s . m o d e l . o c c u p a n t s , " a d d " , t h i s . r e n d e r I f O w n O c c u p a n t ) , t h i s . l i s t e n T o ( t h i s . m o d e l . o c c u p a n t s , " c h a n g e : r o l e " , t h i s . r e n d e r I f O w n O c c u p a n t ) , t h i s . l i s t e n T o ( t h i s . m o d e l . s e s s i o n , " c h a n g e : c o n n e c t i o n _ s t a t u s " , t h i s . d e b o u n c e d R e n d e r ) } r e n d e r ( ) { c o n s t e = t h i s . m o d e l . s e s s i o n . g e t ( " c o n n e c t i o n _ s t a t u s " ) = = = $ l . R O O M S T A T U S . E N T E R E D , t = e & & ! ( t h i s . m o d e l . f e a t u r e s . g e t ( " m o d e r a t e d " ) & & " v i s i t o r " = = = t h i s . m o d e l . g e t O w n R o l e ( ) ) ; i l ( ( e = > { c o n s t t = E h ( " Y o u h a v e u n r e a d m e s s a g e s " ) , n = e . m o d e l . s e s s i o n . g e t ( " c o n n e c t i o n _ s t a t u s " ) , s = E h ( " Y o u ' r e n o t a l l o w e d t o s e n d m e s s a g e s i n t h i s r o o m " ) ; r e t u r n n = = = $ l . R O O M S T A T U S . E N T E R E D ? e l `
$ { e . model . ui . get ( "scrolled" ) && e . model . get ( "num_unread_general" ) ? el ` <div class="new-msgs-indicator" @click= ${ t => e . viewUnreadMessages ( t ) } >▼ ${ t } ▼</div> ` : "" }
$ { e . can _edit ? ( e => { const t = Eh ( "You have unread messages" ) , n = jl . settings . get ( "message_limit" ) , s = jl . settings . get ( "visible_toolbar_buttons" ) . call , i = jl . settings . get ( "visible_toolbar_buttons" ) . emoji , r = jl . settings . get ( "show_send_button" ) , o = jl . settings . get ( "visible_toolbar_buttons" ) . spoiler , a = jl . settings . get ( "show_toolbar" ) ; return el `
$ { e . model . ui . get ( "scrolled" ) && e . model . get ( "num_unread" ) ? el ` <div class="new-msgs-indicator" @click= ${ t => e . viewUnreadMessages ( t ) } >▼ ${ t } ▼</div> ` : "" }
$ { a ? el `
2021-11-11 22:06:49 +01:00
< converse - chat - toolbar
class = "chat-toolbar no-text-select"
. model = $ { e . model }
? composing _spoiler = "${e.model.get(" composing _spoiler ")}"
? hidden _occupants = "${e.model.get(" hidden _occupants ")}"
? is _groupchat = "${e.is_groupchat}"
? show _call _button = "${s}"
? show _emoji _button = "${i}"
? show _send _button = "${r}"
? show _spoiler _button = "${o}"
? show _toolbar = "${a}"
message _limit = "${n}" > < / c o n v e r s e - c h a t - t o o l b a r > ` : " " }
2022-01-03 11:54:10 +01:00
< converse - muc - message - form jid = $ { e . model . get ( "jid" ) } > < / c o n v e r s e - m u c - m e s s a g e - f o r m > ` } ) ( e ) : e l ` < s p a n c l a s s = " m u c - b o t t o m - p a n e l m u c - b o t t o m - p a n e l - - m u t e d " > $ { s } < / s p a n > ` } ` : n ! = $ l . R O O M S T A T U S . N I C K N A M E _ R E Q U I R E D ? " " : j l . s e t t i n g s . g e t ( " m u c _ s h o w _ l o g s _ b e f o r e _ j o i n " ) ? e l ` < s p a n c l a s s = " m u c - b o t t o m - p a n e l m u c - b o t t o m - p a n e l - - n i c k n a m e " > $ { N _ ( e . m o d e l ) } < / s p a n > ` : v o i d 0 } ) ( { c a n _ e d i t : t , e n t e r e d : e , m o d e l : t h i s . m o d e l , i s _ g r o u p c h a t : ! 0 , v i e w U n r e a d M e s s a g e s : e = > t h i s . v i e w U n r e a d M e s s a g e s ( e ) } ) , t h i s ) } r e n d e r I f O w n O c c u p a n t ( e ) { e . g e t ( " j i d " ) = = = w a . b a r e _ j i d & & t h i s . d e b o u n c e d R e n d e r ( ) } s e n d B u t t o n C l i c k e d ( e ) { v a r t ; n u l l = = = ( t = t h i s . q u e r y S e l e c t o r ( " c o n v e r s e - m u c - m e s s a g e - f o r m " ) ) | | v o i d 0 = = = t | | t . o n F o r m S u b m i t t e d ( e ) } h i d e O c c u p a n t s ( e ) { v a r t , n ; n u l l = = e | | n u l l = = = ( t = e . p r e v e n t D e f a u l t ) | | v o i d 0 = = = t | | t . c a l l ( e ) , n u l l = = e | | n u l l = = = ( n = e . s t o p P r o p a g a t i o n ) | | v o i d 0 = = = n | | n . c a l l ( e ) , t h i s . m o d e l . s a v e ( { h i d d e n _ o c c u p a n t s : ! 0 } ) } } ) ; c o n s t I _ = { o f f l i n e : " O f f l i n e " , u n a v a i l a b l e : " U n a v a i l a b l e " , x a : " E x t e n d e d A w a y " , a w a y : " A w a y " , d n d : " D o n o t d i s t u r b " , c h a t : " C h a t t t y " , o n l i n e : " O n l i n e " } , M _ = ( e , t ) = > { v a r n , s ; c o n s t i = e . g e t ( " a f f i l i a t i o n " ) , r = I _ [ e . g e t ( " s h o w " ) ] , o = E h ( " A d m i n " ) , a = E h ( " M e m b e r " ) , c = E h ( " M o d e r a t o r " ) , l = E h ( " O w n e r " ) , d = E h ( " V i s i t o r " ) , u = e . g e t ( " r o l e " ) , h = e . g e t ( " s h o w " ) ; l e t f , m ; r e t u r n [ f , m ] = " o n l i n e " = = = h ? [ " f a f a - c i r c l e " , " c h a t - s t a t u s - o n l i n e " ] : " d n d " = = = h ? [ " f a f a - m i n u s - c i r c l e " , " c h a t - s t a t u s - b u s y " ] : " a w a y " = = = h ? [ " f a f a - c i r c l e " , " c h a t - s t a t u s - a w a y " ] : [ " f a f a - c i r c l e " , " s u b d u e d - c o l o r " ] , e l `
< li class = "occupant" id = "${e.id}" title = "${(e=>{const t=e.get(" role "),n=(e=>Eh(" Click to mention % 1 $s in your message . ",e.get(" nick ")))(e),s=Eh(" This user is a moderator . "),i=Eh(" This user can send messages in this groupchat . "),r=Eh(" This user can NOT send messages in this groupchat . "),o=e.get(" jid ")?`${e.get(" jid ")} `:" ";return" moderator "===t?`${o}${s} ${n}`:" participant "===t?`${o}${i} ${n}`:" visitor "===t?`${o}${r} ${n}`:[" visitor "," participant "," moderator "].includes(t)?void 0:`${o}${n}`})(e)}" >
2021-11-11 22:06:49 +01:00
< div class = "row no-gutters" >
< div class = "col-auto" >
2022-01-03 11:54:10 +01:00
< a class = "show-msg-author-modal" @ click = $ { t => function ( e , t ) { jl . modal . show ( qv , { model : t } , e ) } ( t , e ) } >
< converse - avatar
class = "avatar chat-msg__avatar"
. data = $ { null === ( n = e . vcard ) || void 0 === n ? void 0 : n . attributes }
nonce = $ { null === ( s = e . vcard ) || void 0 === s ? void 0 : s . get ( "vcard_updated" ) }
height = "30" width = "30" > < / c o n v e r s e - a v a t a r >
< converse - icon
title = "${r}"
color = "var(--${m})"
style = "margin-top: -0.1em"
size = "0.82em"
class = "${f} chat-status chat-status--avatar" > < / c o n v e r s e - i c o n >
< / a >
2021-11-11 22:06:49 +01:00
< / d i v >
< div class = "col occupant-nick-badge" >
2022-01-03 11:54:10 +01:00
< span class = "occupant-nick" @ click = $ { t . onOccupantClicked } > $ { e . getDisplayName ( ) } < / s p a n >
2021-11-11 22:06:49 +01:00
< span class = "occupant-badges" >
2022-01-03 11:54:10 +01:00
$ { "owner" === i ? el ` <span class="badge badge-groupchat"> ${ l } </span> ` : "" }
$ { "admin" === i ? el ` <span class="badge badge-info"> ${ o } </span> ` : "" }
$ { "member" === i ? el ` <span class="badge badge-info"> ${ a } </span> ` : "" }
$ { "moderator" === u ? el ` <span class="badge badge-info"> ${ c } </span> ` : "" }
$ { "visitor" === u ? el ` <span class="badge badge-secondary"> ${ d } </span> ` : "" }
2021-11-11 22:06:49 +01:00
< / s p a n >
< / d i v >
< / d i v >
< / l i >
2022-01-03 11:54:10 +01:00
` };var R_=n(9959),D_={};D_.styleTagTransform=vg(),D_.setAttributes=fg(),D_.insert=ug().bind(null,"head"),D_.domAPI=lg(),D_.insertStyleElement=gg(),ag()(R_.Z,D_),R_.Z&&R_.Z.locals&&R_.Z.locals;var L_=n(902),z_={};z_.styleTagTransform=vg(),z_.setAttributes=fg(),z_.insert=ug().bind(null,"head"),z_.domAPI=lg(),z_.insertStyleElement=gg(),ag()(L_.Z,z_),L_.Z&&L_.Z.locals&&L_.Z.locals;const{u:P_}= $ l.env;jl.elements.define("converse-muc-sidebar",class extends ig{static get properties(){return{jid:{type:String}}}connectedCallback(){super.connectedCallback(),this.model=wa.chatboxes.get(this.jid),this.listenTo(this.model.occupants,"add",this.requestUpdate),this.listenTo(this.model.occupants,"remove",this.requestUpdate),this.listenTo(this.model.occupants,"change",this.requestUpdate),this.listenTo(this.model.occupants,"vcard:change",this.requestUpdate),this.listenTo(this.model.occupants,"vcard:add",this.requestUpdate),this.model.initialized.then((()=>this.requestUpdate()))}render(){return(e=>{const t=Eh("Participants");return el `
2021-11-11 22:06:49 +01:00
< div class = "occupants-header" >
2022-01-03 11:54:10 +01:00
< i class = "hide-occupants" @ click = $ { e . closeSidebar } >
< converse - icon color = "var(--text-color)" class = "fa fa-times" size = "1em" > < / c o n v e r s e - i c o n >
< / i >
2021-11-11 22:06:49 +01:00
< div class = "occupants-header--title" >
2022-01-03 11:54:10 +01:00
< span class = "occupants-heading" > $ { t } < / s p a n >
2021-11-11 22:06:49 +01:00
< / d i v >
< / d i v >
< div class = "dragresize dragresize-occupants-left" > < / d i v >
2022-01-03 11:54:10 +01:00
< ul class = "occupant-list" > $ { e . occupants . map ( ( t => M _ ( t , e ) ) ) } < / u l >
` })(Object.assign(this.model.toJSON(),{occupants:[...this.model.occupants.models],closeSidebar:e=>this.closeSidebar(e),onOccupantClicked:e=>this.onOccupantClicked(e)}))}closeSidebar(e){var t,n;null==e||null===(t=e.preventDefault)||void 0===t||t.call(e),null==e||null===(n=e.stopPropagation)||void 0===n||n.call(e),P_.safeSave(this.model,{hidden_occupants:!0})}onOccupantClicked(e){var t;null==e||null===(t=e.preventDefault)||void 0===t||t.call(e);const n=wa.chatboxviews.get(this.getAttribute("jid"));null==n||n.getMessageForm().insertIntoTextArea( ` @ $ { e . target . textContent } ` )}});const{u:F_}= $ l.env;jl.elements.define("converse-muc-chatarea",class extends ig{static get properties(){return{jid:{type:String},show_help_messages:{type:Boolean},type:{type:String}}}async initialize(){this.model=await jl.rooms.get(this.jid),this.listenTo(this.model,"change:show_help_messages",(()=>this.requestUpdate())),this.listenTo(this.model,"change:hidden_occupants",(()=>this.requestUpdate())),this.listenTo(this.model.session,"change:connection_status",(()=>this.requestUpdate())),this.onMouseMove=this._onMouseMove.bind(this),this.onMouseUp=this._onMouseUp.bind(this),this.requestUpdate()}render(){return(e=>{var t;return el `
2021-11-11 22:06:49 +01:00
< div class = "chat-area" >
< div class = "chat-content ${e.show_send_button?" chat - content - sendbutton ":" "}" aria - live = "polite" >
< converse - chat - content
class = "chat-content__messages"
jid = "${e.jid}" > < / c o n v e r s e - c h a t - c o n t e n t >
2022-01-03 11:54:10 +01:00
$ { null !== ( t = e . model ) && void 0 !== t && t . get ( "show_help_messages" ) ? el ` <div class="chat-content__help">
2021-11-11 22:06:49 +01:00
< converse - chat - help
. model = $ { e . model }
. messages = $ { e . getHelpMessages ( ) }
type = "info"
2022-01-03 11:54:10 +01:00
chat _type = "${wa.CHATROOMS_TYPE}"
2021-11-11 22:06:49 +01:00
> < / c o n v e r s e - c h a t - h e l p > < / d i v > ` : " " }
< / d i v >
< converse - muc - bottom - panel jid = "${e.jid}" class = "bottom-panel" > < / c o n v e r s e - m u c - b o t t o m - p a n e l >
< / d i v >
< div class = "disconnect-container hidden" > < / d i v >
2022-01-03 11:54:10 +01:00
$ { e . model ? el `
2021-11-11 22:06:49 +01:00
< converse - muc - sidebar
class = "occupants col-md-3 col-4 ${e.shouldShowSidebar()?" ":" hidden "}"
style = "flex: 0 0 ${e.model.get(" occupants _width ")}px"
jid = $ { e . jid }
@ mousedown = $ { e . onMousedown } > < / c o n v e r s e - m u c - s i d e b a r > ` : " " }
2022-01-03 11:54:10 +01:00
` })({getHelpMessages:()=>this.getHelpMessages(),jid:this.jid,model:this.model,onMousedown:e=>this.onMousedown(e),show_send_button:jl.settings.get("show_send_button"),shouldShowSidebar:()=>this.shouldShowSidebar(),type:this.type})}shouldShowSidebar(){return!this.model.get("hidden_occupants")&&this.model.session.get("connection_status")=== $ l.ROOMSTATUS.ENTERED}getHelpMessages(){const e=jl.settings.get("muc_disable_slash_commands"),t=Array.isArray(e)?e:[];return[ ` < strong > / a d m i n < / s t r o n g > : $ { E h ( " C h a n g e u s e r ' s a f f i l i a t i o n t o a d m i n " ) } ` , ` < s t r o n g > / b a n < / s t r o n g > : $ { E h ( " B a n u s e r b y c h a n g i n g t h e i r a f f i l i a t i o n t o o u t c a s t " ) } ` , ` < s t r o n g > / c l e a r < / s t r o n g > : $ { E h ( " C l e a r t h e c h a t a r e a " ) } ` , ` < s t r o n g > / c l o s e < / s t r o n g > : $ { E h ( " C l o s e t h i s g r o u p c h a t " ) } ` , ` < s t r o n g > / d e o p < / s t r o n g > : $ { E h ( " C h a n g e u s e r r o l e t o p a r t i c i p a n t " ) } ` , ` < s t r o n g > / d e s t r o y < / s t r o n g > : $ { E h ( " R e m o v e t h i s g r o u p c h a t " ) } ` , ` < s t r o n g > / h e l p < / s t r o n g > : $ { E h ( " S h o w t h i s m e n u " ) } ` , ` < s t r o n g > / k i c k < / s t r o n g > : $ { E h ( " K i c k u s e r f r o m g r o u p c h a t " ) } ` , ` < s t r o n g > / m e < / s t r o n g > : $ { E h ( " W r i t e i n 3 r d p e r s o n " ) } ` , ` < s t r o n g > / m e m b e r < / s t r o n g > : $ { E h ( " G r a n t m e m b e r s h i p t o a u s e r " ) } ` , ` < s t r o n g > / m o d t o o l s < / s t r o n g > : $ { E h ( " O p e n s u p t h e m o d e r a t o r t o o l s G U I " ) } ` , ` < s t r o n g > / m u t e < / s t r o n g > : $ { E h ( " R e m o v e u s e r ' s a b i l i t y t o p o s t m e s s a g e s " ) } ` , ` < s t r o n g > / n i c k < / s t r o n g > : $ { E h ( " C h a n g e y o u r n i c k n a m e " ) } ` , ` < s t r o n g > / o p < / s t r o n g > : $ { E h ( " G r a n t m o d e r a t o r r o l e t o u s e r " ) } ` , ` < s t r o n g > / o w n e r < / s t r o n g > : $ { E h ( " G r a n t o w n e r s h i p o f t h i s g r o u p c h a t " ) } ` , ` < s t r o n g > / r e g i s t e r < / s t r o n g > : $ { E h ( " R e g i s t e r y o u r n i c k n a m e " ) } ` , ` < s t r o n g > / r e v o k e < / s t r o n g > : $ { E h ( " R e v o k e t h e u s e r ' s c u r r e n t a f f i l i a t i o n " ) } ` , ` < s t r o n g > / s u b j e c t < / s t r o n g > : $ { E h ( " S e t g r o u p c h a t s u b j e c t " ) } ` , ` < s t r o n g > / t o p i c < / s t r o n g > : $ { E h ( " S e t g r o u p c h a t s u b j e c t ( a l i a s f o r / s u b j e c t ) " ) } ` , ` < s t r o n g > / v o i c e < / s t r o n g > : $ { E h ( " A l l o w m u t e d u s e r t o p o s t m e s s a g e s " ) } ` ] . f i l t e r ( ( e = > t . e v e r y ( ( t = > ! e . s t a r t s W i t h ( t + " < " , 9 ) ) ) ) ) . f i l t e r ( ( e = > t h i s . m o d e l . g e t A l l o w e d C o m m a n d s ( ) . s o m e ( ( t = > e . s t a r t s W i t h ( t + " < " , 9 ) ) ) ) ) } o n M o u s e d o w n ( e ) { F _ . h a s C l a s s ( " d r a g r e s i z e - o c c u p a n t s - l e f t " , e . t a r g e t ) & & t h i s . o n S t a r t R e s i z e O c c u p a n t s ( e ) } o n S t a r t R e s i z e O c c u p a n t s ( e ) { t h i s . r e s i z i n g = ! 0 , t h i s . a d d E v e n t L i s t e n e r ( " m o u s e m o v e " , t h i s . o n M o u s e M o v e ) , t h i s . a d d E v e n t L i s t e n e r ( " m o u s e u p " , t h i s . o n M o u s e U p ) ; c o n s t t = t h i s . q u e r y S e l e c t o r ( " c o n v e r s e - m u c - s i d e b a r " ) , n = w i n d o w . g e t C o m p u t e d S t y l e ( t ) ; t h i s . w i d t h = p a r s e I n t ( n . w i d t h . r e p l a c e ( / p x $ / , " " ) , 1 0 ) , t h i s . p r e v _ p a g e X = e . p a g e X } _ o n M o u s e M o v e ( e ) { i f ( t h i s . r e s i z i n g ) { e . p r e v e n t D e f a u l t ( ) ; c o n s t t = t h i s . p r e v _ p a g e X - e . p a g e X ; t h i s . r e s i z e S i d e b a r V i e w ( t , e . p a g e X ) , t h i s . p r e v _ p a g e X = e . p a g e X } } _ o n M o u s e U p ( e ) { i f ( t h i s . r e s i z i n g ) { e . p r e v e n t D e f a u l t ( ) , t h i s . r e s i z i n g = ! 1 , t h i s . r e m o v e E v e n t L i s t e n e r ( " m o u s e m o v e " , t h i s . o n M o u s e M o v e ) , t h i s . r e m o v e E v e n t L i s t e n e r ( " m o u s e u p " , t h i s . o n M o u s e U p ) ; c o n s t t = t h i s . q u e r y S e l e c t o r ( " c o n v e r s e - m u c - s i d e b a r " ) . g e t B o u n d i n g C l i e n t R e c t ( ) , n = t h i s . c a l c u l a t e S i d e b a r W i d t h ( t , 0 ) ; F _ . s a f e S a v e ( t h i s . m o d e l , { o c c u p a n t s _ w i d t h : n } ) } } c a l c u l a t e S i d e b a r W i d t h ( e , t ) { l e t n = e . w i d t h + t ; c o n s t s = t h i s . c l i e n t W i d t h ; r e t u r n n < . 2 * s ? ( n = . 2 * s , t h i s . i s _ m i n i m u m = ! 0 ) : n > . 7 5 * s ? ( n = . 7 5 * s , t h i s . i s _ m a x i m u m = ! 0 ) : s - n < 2 5 0 ? ( n = s - 2 5 0 , t h i s . i s _ m a x i m u m = ! 0 ) : ( t h i s . i s _ m a x i m u m = ! 1 , t h i s . i s _ m i n i m u m = ! 1 ) , n } r e s i z e S i d e b a r V i e w ( e , t ) { c o n s t n = t h i s . q u e r y S e l e c t o r ( " c o n v e r s e - m u c - s i d e b a r " ) , s = n . g e t B o u n d i n g C l i e n t R e c t ( ) ; i f ( t h i s . i s _ m i n i m u m ) t h i s . i s _ m i n i m u m = s . l e f t < t ; e l s e i f ( t h i s . i s _ m a x i m u m ) t h i s . i s _ m a x i m u m = s . l e f t > t ; e l s e { c o n s t t = t h i s . c a l c u l a t e S i d e b a r W i d t h ( s , e ) ; n . s t y l e . f l e x = " 0 0 " + t + " p x " } } } ) ; c o n s t { s i z z l e : U _ } = $ l . e n v , B _ = $ l . e n v . u t i l s , { s i z z l e : q _ } = $ l . e n v , H _ = $ l . e n v . u t i l s ; j l . e l e m e n t s . d e f i n e ( " c o n v e r s e - m u c - c o n f i g - f o r m " , c l a s s e x t e n d s i g { s t a t i c g e t p r o p e r t i e s ( ) { r e t u r n { j i d : { t y p e : S t r i n g } } } c o n n e c t e d C a l l b a c k ( ) { s u p e r . c o n n e c t e d C a l l b a c k ( ) , t h i s . m o d e l = w a . c h a t b o x e s . g e t ( t h i s . j i d ) , t h i s . l i s t e n T o ( t h i s . m o d e l . f e a t u r e s , " c h a n g e : p a s s w o r d p r o t e c t e d " , t h i s . r e q u e s t U p d a t e ) , t h i s . l i s t e n T o ( t h i s . m o d e l . s e s s i o n , " c h a n g e : c o n f i g _ s t a n z a " , t h i s . r e q u e s t U p d a t e ) , t h i s . g e t C o n f i g ( ) } r e n d e r ( ) { r e t u r n ( e = > { c o n s t t = j l . s e t t i n g s . g e t ( " r o o m c o n f i g _ w h i t e l i s t " ) , n = e . m o d e l . s e s s i o n . g e t ( " c o n f i g _ s t a n z a " ) ; l e t s , i = [ ] , r = " " ; i f ( n ) { v a r o , a ; c o n s t c = B _ . t o S t a n z a ( n ) ; i = U _ ( " f i e l d " , c ) , t . l e n g t h & & ( i = i . f i l t e r ( ( e = > t . i n c l u d e s ( e . g e t A t t r i b u t e ( " v a r " ) ) ) ) ) ; c o n s t l = { n e w _ p a s s w o r d : ! e . m o d e l . f e a t u r e s . g e t ( " p a s s w o r d p r o t e c t e d " ) , f i x e d _ u s e r n a m e : e . m o d e l . g e t ( " j i d " ) } ; i = i . m a p ( ( e = > B _ . x F o r m 2 T e m p l a t e R e s u l t ( e , c , l ) ) ) , r = n u l l =
2021-11-11 22:06:49 +01:00
< form class = "converse-form chatroom-form ${i.length?" ":" converse - form -- spinner "}"
autocomplete = "off"
@ submit = $ { e . submitConfigForm } >
2021-03-19 19:26:15 +01:00
< fieldset class = "form-group" >
2021-11-11 22:06:49 +01:00
< legend class = "centered" > $ { s } < / l e g e n d >
2022-01-03 11:54:10 +01:00
$ { s !== r ? el ` <p class="form-help"> ${ r } </p> ` : "" }
$ { i . length ? i : ny ( { classes : "hor_centered" } ) }
2021-03-19 19:26:15 +01:00
< / f i e l d s e t >
2022-01-03 11:54:10 +01:00
$ { i . length ? el `
2021-11-11 22:06:49 +01:00
< fieldset >
< input type = "submit" class = "btn btn-primary" value = "${c}" >
< input type = "button" class = "btn btn-secondary button-cancel" value = "${l}" @ click = $ { e . closeConfigForm } >
< / f i e l d s e t > ` : " " }
< / f o r m >
2022-01-03 11:54:10 +01:00
` })({model:this.model,closeConfigForm:e=>this.closeForm(e),submitConfigForm:e=>this.submitConfigForm(e)})}async getConfig(){const e=await this.model.fetchRoomConfiguration();this.model.session.set("config_stanza",e.outerHTML)}async submitConfigForm(e){e.preventDefault();const t=q_(":input:not([type=button]):not([type=submit])",e.target).map(H_.webForm2xForm).filter((e=>e));try{await this.model.sendConfiguration(t)}catch(e){M.error(e);const t=Eh("Sorry, an error occurred while trying to submit the config form.")+" "+Eh("Check your browser's developer console for details.");jl.alert("error",Eh("Error"),t)}await this.model.refreshDiscoInfo(),this.closeForm()}closeForm(e){var t;null==e||null===(t=e.preventDefault)||void 0===t||t.call(e),this.model.session.set("view",null)}});jl.elements.define("converse-muc-destroyed",class extends ig{static get properties(){return{jid:{type:String}}}connectedCallback(){super.connectedCallback(),this.model=wa.chatboxes.get(this.jid)}render(){const e=this.model.get("destroyed_reason");return(e=>{const t=Eh("This groupchat no longer exists"),n=Eh('The following reason was given: "%1 $ s"',e.reason||"");return el `
2021-11-11 22:06:49 +01:00
< div class = "alert alert-danger" >
< h3 class = "alert-heading disconnect-msg" > $ { t } < / h 3 >
< / d i v >
2022-01-03 11:54:10 +01:00
$ { e . reason ? el ` <p class="destroyed-reason"> ${ n } </p> ` : "" }
$ { e . moved _jid ? ( e => { const t = Eh ( "The conversation has moved to a new address. Click the link below to enter." ) ; return el `
2021-11-11 22:06:49 +01:00
< p class = "moved-label" > $ { t } < / p >
< p class = "moved-link" >
< a class = "switch-chat" @ click = $ { t => e . onSwitch ( t ) } > $ { e . moved _jid } < / a >
< / p > ` } ) ( e ) : " " }
2022-01-03 11:54:10 +01:00
` })({moved_jid:this.model.get("moved_jid"),reason:e,onSwitch:e=>this.onSwitch(e)})}async onSwitch(e){e.preventDefault();const t=this.model.get("moved_jid");(await jl.rooms.get(t,{},!0)).maybeShow(!0),this.model.destroy()}}),jl.elements.define("converse-muc-disconnected",class extends ig{static get properties(){return{jid:{type:String}}}connectedCallback(){super.connectedCallback(),this.model=wa.chatboxes.get(this.jid)}render(){const e=this.model.session.get("disconnection_message");if(!e)return;const t=[e],n=this.model.session.get("disconnection_actor");n&&t.push(Eh("This action was done by %1 $ s.",n));const s=this.model.session.get("disconnection_reason");return s&&t.push(Eh('The reason given is: "%1 $ s".',s)),(e=>el `
2021-11-11 22:06:49 +01:00
< div class = "alert alert-danger" >
< h3 class = "alert-heading disconnect-msg" > $ { e [ 0 ] } < / h 3 >
2022-01-03 11:54:10 +01:00
$ { e . slice ( 1 ) . map ( ( e => el ` <p class="disconnect-msg"> ${ e } </p> ` ) ) }
< / d i v > ` ) ( t ) } } ) ; c o n s t G _ = $ l . e n v . u t i l s , W _ = a p . e x t e n d ( { i d : " m u c - i n v i t e - m o d a l " , i n i t i a l i z e ( ) { a p . p r o t o t y p e . i n i t i a l i z e . a p p l y ( t h i s , a r g u m e n t s ) , t h i s . l i s t e n T o ( t h i s . m o d e l , " c h a n g e " , t h i s . r e n d e r ) , t h i s . i n i t I n v i t e W i d g e t ( ) } , t o H T M L ( ) { r e t u r n ( e = > { c o n s t t = E h ( " I n v i t e " ) , n = E h ( " I n v i t e s o m e o n e t o t h i s g r o u p c h a t " ) , s = E h ( " u s e r @ e x a m p l e . o r g " ) , i = E h ( " P l e a s e e n t e r a v a l i d X M P P a d d r e s s " ) , r = E h ( " X M P P A d d r e s s " ) , o = E h ( " O p t i o n a l r e a s o n f o r t h e i n v i t a t i o n " ) ; r e t u r n e l `
2021-11-11 22:06:49 +01:00
< div class = "modal-dialog" role = "document" >
< div class = "modal-content" >
< div class = "modal-header" >
< h5 class = "modal-title" id = "add-chatroom-modal-label" > $ { n } < / h 5 >
2022-01-03 11:54:10 +01:00
$ { lp }
2021-11-11 22:06:49 +01:00
< / d i v >
< div class = "modal-body" >
< span class = "modal-alert" > < / s p a n >
< div class = "suggestion-box room-invite" >
< form @ submit = $ { e . submitInviteForm } >
< div class = "form-group" >
< label class = "clearfix" for = "invitee_jids" > $ { r } : < / l a b e l >
2022-01-03 11:54:10 +01:00
$ { e . invalid _invite _jid ? el ` <div class="error error-feedback"> ${ i } </div> ` : "" }
2021-11-11 22:06:49 +01:00
< input class = "form-control suggestion-box__input"
required = "required"
name = "invitee_jids"
id = "invitee_jids"
placeholder = "${s}"
type = "text" / >
< span class = "suggestion-box__additions visually-hidden" role = "status" aria - live = "assertive" aria - relevant = "additions" > < / s p a n >
< ul class = "suggestion-box__results suggestion-box__results--below" hidden = "" > < / u l >
< / d i v >
< div class = "form-group" >
< label > $ { o } : < / l a b e l >
< textarea class = "form-control" name = "reason" > < / t e x t a r e a >
< / d i v >
< div class = "form-group" >
< button type = "submit" class = "btn btn-primary" > $ { t } < / b u t t o n >
< / d i v >
< / f o r m >
< / d i v >
< / d i v >
< / d i v >
< / d i v >
2022-01-03 11:54:10 +01:00
` })(Object.assign(this.model.toJSON(),{submitInviteForm:e=>this.submitInviteForm(e)}))},initInviteWidget(){this.invite_auto_complete&&this.invite_auto_complete.destroy();const e=wa.roster.map((e=>({label:e.getDisplayName(),value:e.get("jid")}))),t=this.el.querySelector(".suggestion-box").parentElement;this.invite_auto_complete=new wa.AutoComplete(t,{min_chars:1,list:e})},submitInviteForm(e){e.preventDefault();const t=new FormData(e.target),n=t.get("invitee_jids"),s=t.get("reason");G_.isValidJID(n)?(this.chatroomview.model.directInvite(n,s),this.modal.hide()):this.model.set({invalid_invite_jid:!0})}}),V_=ap.extend({id:"muc-details-modal",initialize(){ap.prototype.initialize.apply(this,arguments),this.listenTo(this.model,"change",this.render),this.listenTo(this.model.features,"change",this.render),this.listenTo(this.model.occupants,"add",this.render),this.listenTo(this.model.occupants,"change",this.render)},toHTML(){return(e=>{const t=Eh("Groupchat XMPP address"),n=Eh("Message archiving"),s=Eh("Messages are archived on the server"),i=Eh("Description"),r=Eh("Features"),o=Eh("Hidden"),a=Eh("This groupchat is not publicly searchable"),c=Eh("This groupchat is restricted to members only"),l=Eh("Members only"),d=Eh("Moderated"),u=Eh("Participants entering this groupchat need to request permission to write"),h=Eh("Name"),f=Eh("This groupchat does not require a password upon entry"),m=Eh("No password required"),g=Eh("Not anonymous"),p=Eh("All other groupchat participants can see your XMPP address"),v=Eh("Not moderated"),y=Eh("Participants entering this groupchat can write right away"),b=Eh("Online users"),_=Eh("Open"),w=Eh("Anyone can join this groupchat"),S=Eh("This groupchat requires a password before entry"),x=Eh("Password protected"),E=Eh("Persistent"),A=Eh("This groupchat persists even if it's unoccupied"),C=Eh("Public"),T=Eh("Semi-anonymous"),k=Eh("Only moderators can see your XMPP address"),j=Eh("Temporary"),N=Eh("This groupchat will disappear once the last person leaves");return el `
2021-11-11 22:06:49 +01:00
< div class = "modal-dialog" role = "document" >
< div class = "modal-content" >
< div class = "modal-header" >
< h5 class = "modal-title" id = "muc-details-modal-label" > $ { e . display _name } < / h 5 >
2022-01-03 11:54:10 +01:00
$ { lp }
2021-11-11 22:06:49 +01:00
< / d i v >
< div class = "modal-body" >
< span class = "modal-alert" > < / s p a n >
< div class = "room-info" >
< p class = "room-info" > < strong > $ { h } < / s t r o n g > : $ { e . n a m e } < / p >
< p class = "room-info" > < strong > $ { t } < / s t r o n g > : $ { e . j i d } < / p >
< p class = "room-info" > < strong > $ { i } < / s t r o n g > : $ { e . c o n f i g . d e s c r i p t i o n } < / p >
2022-01-03 11:54:10 +01:00
$ { e . subject ? ( e => { const t = Eh ( "Topic" ) , n = Eh ( "Topic author" ) ; return el `
2021-11-11 22:06:49 +01:00
< p class = "room-info" > < strong > $ { t } < / s t r o n g > : $ { e . s u b j e c t . t e x t } < / p >
< p class = "room-info" > < strong > $ { n } < / s t r o n g > : $ { e . s u b j e c t & & e . s u b j e c t . a u t h o r } < / p >
` })(e):""}
2022-01-03 11:54:10 +01:00
< p class = "room-info" > < strong > $ { b } < / s t r o n g > : $ { e . n u m _ o c c u p a n t s } < / p >
2021-11-11 22:06:49 +01:00
< p class = "room-info" > < strong > $ { r } < / s t r o n g > :
< div class = "chatroom-features" >
< ul class = "features-list" >
2022-01-03 11:54:10 +01:00
$ { e . features . passwordprotected ? el ` <li class="feature" ><span class="fa fa-lock"></span> ${ x } - <em> ${ S } </em></li> ` : "" }
$ { e . features . unsecured ? el ` <li class="feature" ><span class="fa fa-unlock"></span> ${ m } - <em> ${ f } </em></li> ` : "" }
$ { e . features . hidden ? el ` <li class="feature" ><span class="fa fa-eye-slash"></span> ${ o } - <em> ${ a } </em></li> ` : "" }
$ { e . features . public _room ? el ` <li class="feature" ><span class="fa fa-eye"></span> ${ C } - <em> ${ e . _ _ ( "This groupchat is publicly searchable" ) } </em></li> ` : "" }
$ { e . features . membersonly ? el ` <li class="feature" ><span class="fa fa-address-book"></span> ${ l } - <em> ${ c } </em></li> ` : "" }
$ { e . features . open ? el ` <li class="feature" ><span class="fa fa-globe"></span> ${ _ } - <em> ${ w } </em></li> ` : "" }
$ { e . features . persistent ? el ` <li class="feature" ><span class="fa fa-save"></span> ${ E } - <em> ${ A } </em></li> ` : "" }
$ { e . features . temporary ? el ` <li class="feature" ><span class="fa fa-snowflake-o"></span> ${ j } - <em> ${ N } </em></li> ` : "" }
$ { e . features . nonanonymous ? el ` <li class="feature" ><span class="fa fa-id-card"></span> ${ g } - <em> ${ p } </em></li> ` : "" }
$ { e . features . semianonymous ? el ` <li class="feature" ><span class="fa fa-user-secret"></span> ${ T } - <em> ${ k } </em></li> ` : "" }
$ { e . features . moderated ? el ` <li class="feature" ><span class="fa fa-gavel"></span> ${ d } - <em> ${ u } </em></li> ` : "" }
$ { e . features . unmoderated ? el ` <li class="feature" ><span class="fa fa-info-circle"></span> ${ v } - <em> ${ y } </em></li> ` : "" }
$ { e . features . mam _enabled ? el ` <li class="feature" ><span class="fa fa-database"></span> ${ n } - <em> ${ s } </em></li> ` : "" }
2021-11-11 22:06:49 +01:00
< / u l >
< / d i v >
< / p >
< / d i v >
< / d i v >
2022-01-03 11:54:10 +01:00
< div class = "modal-footer" > $ { cp } < / d i v >
2021-11-11 22:06:49 +01:00
< / d i v >
< / d i v >
2022-01-03 11:54:10 +01:00
` })(Object.assign(this.model.toJSON(),{config:this.model.config.toJSON(),display_name:Eh("Groupchat info for %1 $ s",this.model.getDisplayName()),features:this.model.features.toJSON(),num_occupants:this.model.occupants.length}))}});var J_=n(307),Q_={};Q_.styleTagTransform=vg(),Q_.setAttributes=fg(),Q_.insert=ug().bind(null,"head"),Q_.domAPI=lg(),Q_.insertStyleElement=gg(),ag()(J_.Z,Q_),J_.Z&&J_.Z.locals&&J_.Z.locals,jl.elements.define("converse-rich-text",class extends ig{static get properties(){return{embed_audio:{type:Boolean},embed_videos:{type:Boolean},mentions:{type:Array},nick:{type:String},offset:{type:Number},onImgClick:{type:Function},onImgLoad:{type:Function},render_styling:{type:Boolean},show_images:{type:Boolean},hide_media_urls:{type:Boolean},show_me_message:{type:Boolean},text:{type:String}}}constructor(){super(),this.embed_audio=!1,this.embed_videos=!1,this.hide_media_urls=!1,this.mentions=[],this.offset=0,this.render_styling=!1,this.show_image_urls=!0,this.show_images=!1,this.show_me_message=!1}render(){const e={embed_audio:this.embed_audio,embed_videos:this.embed_videos,hide_media_urls:this.hide_media_urls,mentions:this.mentions,nick:this.nick,onImgClick:this.onImgClick,onImgLoad:this.onImgLoad,render_styling:this.render_styling,show_images:this.show_images,show_me_message:this.show_me_message};return _v(this.text,this.offset,e)}});var Z_=n(3288),K_={};K_.styleTagTransform=vg(),K_.setAttributes=fg(),K_.insert=ug().bind(null,"head"),K_.domAPI=lg(),K_.insertStyleElement=gg(),ag()(Z_.Z,K_),Z_.Z&&Z_.Z.locals&&Z_.Z.locals,jl.elements.define("converse-muc-heading",class extends Ng{async connectedCallback(){super.connectedCallback(),this.model=wa.chatboxes.get(this.getAttribute("jid")),this.debouncedRender=gc(this.render,100),this.listenTo(this.model,"change",this.debouncedRender);const e=await wa.api.user.settings.getModel();this.listenTo(e,"change:mucs_with_hidden_subject",this.debouncedRender),await this.model.initialized,this.listenTo(this.model.features,"change:open",this.debouncedRender),this.model.occupants.forEach((e=>this.onOccupantAdded(e))),this.listenTo(this.model.occupants,"add",this.onOccupantAdded),this.listenTo(this.model.occupants,"change:affiliation",this.onOccupantAffiliationChanged),this.render()}async render(){const e=await this.generateHeadingTemplate();il(e,this)}onOccupantAdded(e){e.get("jid")===wa.bare_jid&&this.debouncedRender()}onOccupantAffiliationChanged(e){e.get("jid")===wa.bare_jid&&this.debouncedRender()}showRoomDetailsModal(e){e.preventDefault(),jl.modal.show(V_,{model:this.model},e)}showInviteModal(e){e.preventDefault(),jl.modal.show(W_,{model:new Xo,chatroomview:this},e)}toggleTopic(e){var t;null==e||null===(t=e.preventDefault)||void 0===t||t.call(e),this.model.toggleSubjectHiddenState()}getAndRenderConfigurationForm(){this.model.session.set("view", $ l.MUC.VIEWS.CONFIG)}close(e){e.preventDefault(),this.model.close()}destroy(e){e.preventDefault(),v_(this.model)}getHeadingButtons(e){const t=[];t.push({i18n_text:Eh("Details"),i18n_title:Eh("Show more information about this groupchat"),handler:e=>this.showRoomDetailsModal(e),a_class:"show-muc-details-modal",icon_class:"fa-info-circle",name:"details"}),"owner"===this.model.getOwnAffiliation()&&t.push({i18n_text:Eh("Configure"),i18n_title:Eh("Configure this groupchat"),handler:()=>this.getAndRenderConfigurationForm(),a_class:"configure-chatroom-button",icon_class:"fa-wrench",name:"configure"}),this.model.invitesAllowed()&&t.push({i18n_text:Eh("Invite"),i18n_title:Eh("Invite someone to join this groupchat"),handler:e=>this.showInviteModal(e),a_class:"open-invite-modal",icon_class:"fa-user-plus",name:"invite"});const n=this.model.get("subject");if(n&&n.text&&t.push({i18n_text:Eh(e?"Show topic":"Hide topic"),i18n_title:Eh(e?"Show the topic message in the heading":"Hide the topic in the heading"),handler:e=>this.toggleTopic(e),a_class:"hide-topic",icon_class:"fa-minus-square",name:"toggle-topic"}),this.model.session.get("connection_status")=== $ l.ROOMSTATUS.ENTERED){const e=this.model.getAllowedCommands();e.includes("modtools")&&t.push
2021-11-11 22:06:49 +01:00
< div class = "chatbox-title ${i?" ":" chatbox - title -- no - desc "}" >
2022-01-03 11:54:10 +01:00
$ { wa . api . settings . get ( "singleton" ) ? "" : el ` <converse-controlbox-navback jid=" ${ e . jid } "></converse-controlbox-navback> ` }
< div class = "chatbox-title__text" title = "${" hidden "!==jl.settings.get(" locked _muc _domain ")?e.jid:" "}" > $ { e . title }
$ { e . bookmarked ? el ` <i class="fa fa-bookmark chatbox-title__text--bookmarked" title=" ${ n } "></i> ` : "" }
2021-11-11 22:06:49 +01:00
< / d i v >
< div class = "chatbox-title__buttons row no-gutters" >
2022-01-03 11:54:10 +01:00
$ { e . standalone _btns . length ? ( e => e . standalone _btns . reverse ( ) . map ( ( e => xp ( e , "" ) ) ) ) ( e ) : "" }
$ { e . dropdown _btns . length ? el ` <converse-dropdown class="dropleft" color="var(--chatroom-head-color)" .items= ${ e . dropdown _btns } ></converse-dropdown> ` : "" }
2021-11-11 22:06:49 +01:00
< / d i v >
< / d i v >
2022-01-03 11:54:10 +01:00
$ { i ? el ` <p class="chat-head__desc" title=" ${ t } ">
2021-11-11 22:06:49 +01:00
< converse - rich - text text = $ { s } render _styling > < / c o n v e r s e - r i c h - t e x t >
< / p > ` : " " }
2022-01-03 11:54:10 +01:00
` })(Object.assign(this.model.toJSON(),{_converse:wa,subject_hidden:e,dropdown_btns:s.map((e=>Cy(e))),standalone_btns:n.map((e=>Ty(e))),title:this.model.getDisplayName()}))}});var Y_=n(6233),X_={};X_.styleTagTransform=vg(),X_.setAttributes=fg(),X_.insert=ug().bind(null,"head"),X_.domAPI=lg(),X_.insertStyleElement=gg(),ag()(Y_.Z,X_),Y_.Z&&Y_.Z.locals&&Y_.Z.locals;jl.elements.define("converse-muc-nickname-form",class extends ig{static get properties(){return{jid:{type:String}}}connectedCallback(){super.connectedCallback(),this.model=wa.chatboxes.get(this.jid)}render(){return N_(this.model)}});function ew(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}jl.elements.define("converse-muc-password-form",class extends ig{static get properties(){return{jid:{type:String}}}connectedCallback(){super.connectedCallback(),this.model=wa.chatboxes.get(this.jid),this.listenTo(this.model,"change:password_validation_message",this.render),this.render()}render(){return(e=>{const t=Eh("This groupchat requires a password"),n=Eh("Password: "),s=Eh("Submit");return el `
2021-11-11 22:06:49 +01:00
< form class = "converse-form chatroom-form converse-centered-form" @ submit = $ { e . submitPassword } >
2021-03-19 19:26:15 +01:00
< fieldset class = "form-group" >
2021-11-11 22:06:49 +01:00
< label > $ { t } < / l a b e l >
< p class = "validation-message" > $ { e . validation _message } < / p >
< input class = "hidden-username" type = "text" autocomplete = "username" value = "${e.jid}" > < / i n p u t >
< input type = "password"
name = "password"
required = "required"
class = "form-control ${e.validation_message?" error ":" "}"
placeholder = "${n}" / >
2021-03-19 19:26:15 +01:00
< / f i e l d s e t >
< fieldset class = "form-group" >
2021-11-11 22:06:49 +01:00
< input class = "btn btn-primary" type = "submit" value = "${s}" / >
< / f i e l d s e t >
2021-03-19 19:26:15 +01:00
< / f o r m >
2022-01-03 11:54:10 +01:00
` })({jid:this.model.get("jid"),submitPassword:e=>this.submitPassword(e),validation_message:this.model.get("password_validation_message")})}submitPassword(e){e.preventDefault();const t=this.querySelector("input[type=password]").value;this.model.join(this.model.get("nick"),t),this.model.set("password_validation_message",null)}});class tw extends zy{constructor(...e){super(...e),ew(this,"length",300),ew(this,"is_chatroom",!0)}async initialize(){this.model=await jl.rooms.get(this.jid),wa.chatboxviews.add(this.jid,this),this.setAttribute("id",this.model.get("box_id")),this.listenTo(wa,"windowStateChanged",this.onWindowStateChanged),this.listenTo(this.model,"change:composing_spoiler",this.requestUpdateMessageForm),this.listenTo(this.model.session,"change:connection_status",this.onConnectionStatusChanged),this.listenTo(this.model.session,"change:view",this.requestUpdate),this.onConnectionStatusChanged(),this.model.maybeShow(),jl.trigger("chatRoomViewInitialized",this)}render(){return(e=>el `
2021-11-11 22:06:49 +01:00
< div class = "flyout box-flyout" >
< converse - dragresize > < / c o n v e r s e - d r a g r e s i z e >
2022-01-03 11:54:10 +01:00
$ { e . model ? el `
2021-11-11 22:06:49 +01:00
< converse - muc - heading jid = "${e.model.get(" jid ")}" class = "chat-head chat-head-chatroom row no-gutters" >
< / c o n v e r s e - m u c - h e a d i n g >
2022-01-03 11:54:10 +01:00
< div class = "chat-body chatroom-body row no-gutters" > $ { function ( e ) { const t = e . model . session . get ( "view" ) , n = e . model . get ( "jid" ) , s = $l . ROOMSTATUS , i = e . model . session . get ( "connection_status" ) ; return t === $l . MUC . VIEWS . CONFIG ? el ` <converse-muc-config-form class="muc-form-container" jid=" ${ n } "></converse-muc-config-form> ` : t === $l . MUC . VIEWS . BOOKMARK ? el ` <converse-muc-bookmark-form class="muc-form-container" jid=" ${ n } "></converse-muc-bookmark-form> ` : el `
$ { i == s . PASSWORD _REQUIRED ? el ` <converse-muc-password-form class="muc-form-container" jid=" ${ n } "></converse-muc-password-form> ` : "" }
$ { i == s . ENTERED ? el ` <converse-muc-chatarea jid=" ${ n } "></converse-muc-chatarea> ` : "" }
$ { i == s . CONNECTING ? ny ( ) : "" }
$ { i == s . NICKNAME _REQUIRED ? function ( e ) { const t = e . get ( "jid" ) ; return jl . settings . get ( "muc_show_logs_before_join" ) ? el ` <converse-muc-chatarea jid=" ${ t } "></converse-muc-chatarea> ` : el ` <converse-muc-nickname-form jid=" ${ t } "></converse-muc-nickname-form> ` } ( e . model ) : "" }
$ { i == s . DISCONNECTED ? el ` <converse-muc-disconnected jid=" ${ n } "></converse-muc-disconnected> ` : "" }
$ { i == s . BANNED ? el ` <converse-muc-disconnected jid=" ${ n } "></converse-muc-disconnected> ` : "" }
$ { i == s . DESTROYED ? el ` <converse-muc-destroyed jid=" ${ n } "></converse-muc-destroyed> ` : "" }
2021-11-11 22:06:49 +01:00
` }(e)}</div>
` :""}
2022-01-03 11:54:10 +01:00
< / d i v > ` ) ( { m o d e l : t h i s . m o d e l } ) } o n C o n n e c t i o n S t a t u s C h a n g e d ( ) { t h i s . m o d e l . s e s s i o n . g e t ( " c o n n e c t i o n _ s t a t u s " ) = = = $ l . R O O M S T A T U S . C O N N E C T I N G & & ( t h i s . m o d e l . s e s s i o n . s a v e ( { d i s c o n n e c t i o n _ a c t o r : v o i d 0 , d i s c o n n e c t i o n _ m e s s a g e : v o i d 0 , d i s c o n n e c t i o n _ r e a s o n : v o i d 0 } ) , t h i s . m o d e l . s a v e ( { m o v e d _ j i d : v o i d 0 , p a s s w o r d _ v a l i d a t i o n _ m e s s a g e : v o i d 0 , r e a s o n : v o i d 0 } ) ) , t h i s . r e q u e s t U p d a t e ( ) } } j l . e l e m e n t s . d e f i n e ( " c o n v e r s e - m u c " , t w ) ; v a r n w = n ( 3 0 7 6 ) , s w = { } ; s w . s t y l e T a g T r a n s f o r m = v g ( ) , s w . s e t A t t r i b u t e s = f g ( ) , s w . i n s e r t = u g ( ) . b i n d ( n u l l , " h e a d " ) , s w . d o m A P I = l g ( ) , s w . i n s e r t S t y l e E l e m e n t = g g ( ) , a g ( ) ( n w . Z , s w ) , n w . Z & & n w . Z . l o c a l s & & n w . Z . l o c a l s , $ l . M U C . V I E W S = { C O N F I G : " c o n f i g - f o r m " , B O O K M A R K : " b o o k m a r k - f o r m " } , $ l . p l u g i n s . a d d ( " c o n v e r s e - m u c - v i e w s " , { d e p e n d e n c i e s : [ " c o n v e r s e - m o d a l " , " c o n v e r s e - c o n t r o l b o x " , " c o n v e r s e - c h a t v i e w " ] , i n i t i a l i z e ( ) { c o n s t { _ c o n v e r s e : e } = t h i s ; j l . s e t t i n g s . e x t e n d ( { a u t o _ l i s t _ r o o m s : ! 1 , c a c h e _ m u c _ m e s s a g e s : ! 0 , l o c k e d _ m u c _ n i c k n a m e : ! 1 , m o d t o o l s _ d i s a b l e _ q u e r y : [ ] , m u c _ d i s a b l e _ s l a s h _ c o m m a n d s : ! 1 , m u c _ m e n t i o n _ a u t o c o m p l e t e _ f i l t e r : " c o n t a i n s " , m u c _ m e n t i o n _ a u t o c o m p l e t e _ m i n _ c h a r s : 0 , m u c _ m e n t i o n _ a u t o c o m p l e t e _ s h o w _ a v a t a r : ! 0 , m u c _ r o o m i d _ p o l i c y : n u l l , m u c _ r o o m i d _ p o l i c y _ h i n t : n u l l , r o o m c o n f i g _ w h i t e l i s t : [ ] , s h o w _ r e t r a c t i o n _ w a r n i n g : ! 0 , v i s i b l e _ t o o l b a r _ b u t t o n s : { t o g g l e _ o c c u p a n t s : ! 0 } } ) , e . C h a t R o o m V i e w = t w , j l . l i s t e n . o n ( " c l e a r s e s s i o n " , ( ( ) = > { c o n s t t = e . c h a t b o x v i e w s . g e t ( " c o n t r o l b o x " ) ; t & & t . r o o m s p a n e l & & ( t . r o o m s p a n e l . m o d e l . d e s t r o y ( ) , t . r o o m s p a n e l . r e m o v e ( ) , d e l e t e t . r o o m s p a n e l ) } ) ) , j l . l i s t e n . o n ( " c o n t r o l B o x I n i t i a l i z e d " , ( e = > { j l . s e t t i n g s . g e t ( " a l l o w _ m u c " ) & & ( b _ ( e ) , e . m o d e l . o n ( " c h a n g e : c o n n e c t e d " , ( ( ) = > b _ ( e ) ) ) ) } ) ) , j l . l i s t e n . o n ( " c h a t B o x C l o s e d " , ( t = > { v a r n ; t . g e t ( " t y p e " ) = = = e . C H A T R O O M S _ T Y P E & & ( n = t . g e t ( " j i d " ) , w a . r o u t e r . h i s t o r y . g e t F r a g m e n t ( ) = = = ` c o n v e r s e / r o o m ? j i d = $ { n } ` & & w a . r o u t e r . n a v i g a t e ( " " ) ) } ) ) } } ) ; v a r i w = n ( 5 4 0 2 ) , r w = n . n ( i w ) ; c o n s t { S t r o p h e : o w } = $ l . e n v , a w = " N o t i f i c a t i o n " i n w i n d o w ; l e t c w ; f u n c t i o n l w ( e ) { v a r t ; r e t u r n w a . i s T e s t E n v ( ) | | ( ( n u l l = = = ( t = w a . c h a t b o x e s . g e t ( e . f r o m ) ) | | v o i d 0 = = = t ? v o i d 0 : t . i s H i d d e n ( ) ) ? ? ! 1 ) } f u n c t i o n d w ( ) { r e t u r n w a . i s T e s t E n v ( ) | | a w & & j l . s e t t i n g s . g e t ( " s h o w _ d e s k t o p _ n o t i f i c a t i o n s " ) & & " g r a n t e d " = = = N o t i f i c a t i o n . p e r m i s s i o n } f u n c t i o n u w ( ) { v a r e , t ; c w = n u l l , n u l l = = = ( e = ( t = n a v i g a t o r ) . c l e a r A p p B a d g e ) | | v o i d 0 = = = e | | e . c a l l ( t ) . c a t c h ( ( e = > M . e r r o r ( " C o u l d n o t c l e a r u n r e a d c o u n t i n a p p b a d g e " + e ) ) ) } f u n c t i o n h w ( ) { i f ( j l . s e t t i n g s . g e t ( " s h o w _ t a b _ n o t i f i c a t i o n s " ) ) { v a r e , t ; c w = c w ? ? n e w $ l . e n v . F a v i c o ( { t y p e : " c i r c l e " , a n i m a t i o n : " p o p " } ) ; c o n s t n = w a . c h a t b o x e s . m o d e l s . r e d u c e ( ( ( e , t ) = > e + ( t . g e t ( " n u m _ u n r e a d " ) | | 0 ) ) , 0 ) ; c w . b a d g e ( n ) , n u l l = = = ( e = ( t = n a v i g a t o r ) . s e t A p p B a d g e ) | | v o i d 0 = = = e | | e . c a l l ( t , n ) . c a t c h ( ( e = > M . e r r o r ( " C o u l d s e t u n r e a d c o u n t i n a p p b a d g e - " + e ) ) ) } } f u n c t i o n f w ( e , t , n ) { r e t u r n e . r e d u c e ( ( ( e , s ) = > e | | ( e = > [ w a . b a r e _ j i d , ` $ { t } / $ { n } ` ] . i n c l u d e s ( e . u r i . r e p l a c e ( / ^ x m p p : / , " " ) ) ) ( s ) ) , ! 1 ) } a s y n c f u n c t i o n m w ( e ) { i f ( ! a w a i t f u n c t i o n ( e ) { c o n s t { a t t r s : t } = e ; i f ( ! t | | t . i s _ f o r w a r d e d ) r e t u r n ! 1 ; i f ( " g r o u p c h a t " = = = t . t y p e ) r e t u r n a s y n c f u n c t i o n ( e ) { i f ( ! ( n u l l ! = e & & e . b o d y | | n u l l ! = e & & e . m e s s a g e ) ) r e t u r n ! 1 ; c o n s t t = e . f r o m , n = e . f r o m _ m u c , s = j l . s e t t i n g s . g e t ( " n o t i f y _ a l l _ r o o m _ m e s s a g e s " ) , i = w a . c h a t b o x e s . g e t ( n ) , r = o w . g e t R e s o u r c e F r o m J i d ( t ) , o = r & & o w . u n e s c a p e N o d e ( r ) | | " " ; l e t a = ! 1 ; c o n s t c = i . g e t ( " n i c k " ) ; j l . s e t t i n g s . g e t ( " n o t i f y _ n i c k n a m e s _ w i t h o u t _ r e f e r e n c e s " ) & & ( a = n e w R e g E x p ( ` \ \ b $ { c } \ \ b ` ) . t e s t ( e . b o d y ) ) ; c o n s t l = o ! = = c , d = ! 0 = = = s | | A r r a y . i s A r r a y ( s ) & & s . i n c l u d e s ( n ) | | f w ( e . r e f e r e n c e s , n , c ) | | a ; r e t u r n ! ( ! l | | ! d ) & & a w a i t j l . h o o k ( " s h o u l d N o t i f y O f G r o u p M e s s a g e " , e , ! 0 ) } ( t ) ; i f ( " i n f o " = = = t . t y p e ) r e t u r n a s y n c f u n c t i o n ( e ) { i f ( ! e . f r o m _ m u c ) r e t u r n ! 1 ; c o n s t t = a w a i t j l . r o o m s . g e t ( e . f r o m _ m u c ) ; i f ( ! t ) r e t u r n ! 1 ; c o n s t n = t . g e t ( " n i c k " ) , s = e . f r o m _ m u c , i = j l . s e t t i n g s . g e t ( " n o t i f y _ a l l _ r o o m _ m e s s a g e s " ) ; r e t u r n ! 0 = = = i | | A r r a y . i s A r r a y ( i ) & & i . i n c l u d e s ( s ) | | f w ( e . r e f e r e n c e s , s , n ) } ( t ) ; i f ( t . i s _ h e a d l i n e ) r e t u r n l w ( t ) ; c o n s t n = o w . g e t B a r e J i d F r o m J i d ( t . f r o m ) = = = w a . b a r e _ j i d ; r e t u r n ! n a ( t ) & & ! n & & ( " a l l " = = = j l . s e t t i n g s . g e t ( " s h o w _ d e s k t o p _ n o t i f i c a t i o n s " ) | | l w ( t ) ) } ( e ) ) r e t u r n ! 1 ; j l . t r i g g e r ( " m e s s a g e N o t i f i c a t i o n " , e ) , f u n c t i o n ( ) { i f ( j l . s e t t i n g s . g e t ( " p l a y _ s o u n d s " ) & & v o i d 0 ! = = w i n d o w . A u d i o ) { c o n s t e = n e w A u d i o ( j l . s e t t i n g s . g e t ( " s o u n d s _ p a t h " ) + " m s g _ r e c e i v e d . o g g " ) , t = e . c a n P l a y T y p e ( " a u d i o / o g g " ) ; i f ( " p r o b a b l y " = = = t ) r e t u r n e . p l a y ( ) ; c o n s t n = n e w A u d i o ( j l . s e t t i n g s . g e t ( " s o u n d s _ p a t h " ) + " m s g _ r e c e i v e d . m p 3 " ) , s = n . c a n P l a y T y p e ( " a u d i o / m p 3 " ) ; " p r o b a b l y " = = = s ? n . p l a y ( ) : " m a y b e " = = = t ? e . p l a y (
< button class = "toggle-omemo" title = "${i}" data - disabled = $ { ! n . get ( "omemo_supported" ) } @ click = $ { Kw } >
< converse - icon
class = "fa ${n.get(" omemo _active ")?" fa - lock ":" fa - unlock "}"
path - prefix = "${jl.settings.get(" assets _path ")}"
size = "1em"
color = "${r}"
> < / c o n v e r s e - i c o n >
< / b u t t o n >
` ),t}const Xw={decryptMessage:async function(e){const t=await crypto.subtle.importKey("raw",e.key,_w,!0,["encrypt","decrypt"]),n=Sw(Tw(e.payload),e.tag),s={name:"AES-GCM",iv:Tw(e.iv),tagLength:128};return Ew(await crypto.subtle.decrypt(s,t,n))},encryptMessage:async function(e){const t=crypto.getRandomValues(new window.Uint8Array(12)),n=await crypto.subtle.generateKey(_w,!0,["encrypt","decrypt"]),s={name:"AES-GCM",iv:t,tagLength:128},i=await crypto.subtle.encrypt(s,n,Aw(e)),r=i.byteLength-16,o=i.slice(0,r),a=i.slice(r),c=await crypto.subtle.exportKey("raw",n);return{key:c,tag:a,key_and_tag:Sw(c,a),payload:Cw(o),iv:Cw(t)}},formatFingerprint:Mw};jl.elements.define("converse-omemo-fingerprints",class extends ig{static get properties(){return{jid:{type:String}}}async initialize(){this.devicelist=await wa.devicelists.getDeviceList(this.jid),this.listenTo(this.devicelist.devices,"change:bundle",this.requestUpdate),this.listenTo(this.devicelist.devices,"change:trusted",this.requestUpdate),this.listenTo(this.devicelist.devices,"remove",this.requestUpdate),this.listenTo(this.devicelist.devices,"add",this.requestUpdate),this.listenTo(this.devicelist.devices,"reset",this.requestUpdate),this.requestUpdate()}render(){return this.devicelist?(e=>{const t=Eh("OMEMO Fingerprints"),n=Eh("No OMEMO-enabled devices found"),s=e.devicelist.devices;return el `
< hr / >
< ul class = "list-group fingerprints" >
< li class = "list-group-item active" > $ { t } < / l i >
$ { s . length ? s . map ( ( t => ( ( e , t ) => { const n = Eh ( "Trusted" ) , s = Eh ( "Untrusted" ) ; return t . get ( "bundle" ) && t . get ( "bundle" ) . fingerprint ? el `
< li class = "list-group-item" >
< form class = "fingerprint-trust" >
< div class = "btn-group btn-group-toggle" >
< label class = "btn btn--small ${1===t.get(" trusted ")?" btn - primary active ":" btn - secondary "}"
@ click = $ { e . toggleDeviceTrust } >
< input type = "radio" name = "${t.get(" id ")}" value = "1"
? checked = $ { - 1 !== t . get ( "trusted" ) } > $ { n }
< / l a b e l >
< label class = "btn btn--small ${-1===t.get(" trusted ")?" btn - primary active ":" btn - secondary "}"
@ click = $ { e . toggleDeviceTrust } >
< input type = "radio" name = "${t.get(" id ")}" value = "-1"
? checked = $ { - 1 === t . get ( "trusted" ) } > $ { s }
< / l a b e l >
< / d i v >
< code class = "fingerprint" > $ { Mw ( t . get ( "bundle" ) . fingerprint ) } < / c o d e >
< / f o r m >
< / l i >
` :""})(e,t))):el ` < li class = "list-group-item" > $ { n } < / l i > ` }
< / u l >
` })(this):""}toggleDeviceTrust(e){const t=e.target;this.devicelist.devices.get(t.getAttribute("name")).save("trusted",parseInt(t.value,10))}});const eS=e=>{var t;const n=Eh("This device's OMEMO fingerprint"),s=Eh("Generate new keys and fingerprint");return el `
< form class = "converse-form fingerprint-removal" @ submit = $ { e . removeSelectedFingerprints } >
< ul class = "list-group fingerprints" >
< li class = "list-group-item active" > $ { n } < / l i >
< li class = "list-group-item" >
$ { e . current _device && e . current _device . get ( "bundle" ) && e . current _device . get ( "bundle" ) . fingerprint ? ( e => el `
< span class = "fingerprint" > $ { Mw ( e . current _device . get ( "bundle" ) . fingerprint ) } < / s p a n > ` ) ( e ) : n y ( ) }
< / l i >
< / u l >
< div class = "form-group" >
< button type = "button" class = "generate-bundle btn btn-danger" @ click = $ { e . generateOMEMODeviceBundle } > $ { s } < / b u t t o n >
< / d i v >
$ { null !== ( t = e . other _devices ) && void 0 !== t && t . length ? ( e => { var t ; const n = Eh ( "Other OMEMO-enabled devices" ) , s = Eh ( "Checkbox to select fingerprints of all other OMEMO devices" ) , i = Eh ( "Remove checked devices and close" ) , r = Eh ( "Select all" ) ; return el `
< ul class = "list-group fingerprints" >
< li class = "list-group-item nopadding active" >
< label >
< input type = "checkbox" class = "select-all" @ change = $ { e . selectAll } title = "${r}" aria - label = "${s}" / >
$ { n }
< / l a b e l >
< / l i >
$ { null === ( t = e . other _devices ) || void 0 === t ? void 0 : t . map ( ( t => ( e => el `
$ { e . device . get ( "bundle" ) && e . device . get ( "bundle" ) . fingerprint ? ( e => { const t = Eh ( "Checkbox for selecting the following fingerprint" ) ; return el `
< li class = "fingerprint-removal-item list-group-item nopadding" >
< label >
< input type = "checkbox" value = "${e.device.get(" id ")}"
aria - label = "${t}" / >
< span class = "fingerprint" > $ { Mw ( e . device . get ( "bundle" ) . fingerprint ) } < / s p a n >
< / l a b e l >
< / l i >
` })(e):(e=>{const t=Eh("Device without a fingerprint"),n=Eh("Checkbox for selecting the following device");return el `
< li class = "fingerprint-removal-item list-group-item nopadding" >
< label >
< input type = "checkbox" value = "${e.device.get(" id ")}"
aria - label = "${n}" / >
< span > $ { t } < / s p a n >
< / l a b e l >
< / l i >
` })(e)}
` )(Object.assign({device:t},e))))}
< / u l >
< div class = "form-group" > < button type = "submit" class = "save-form btn btn-primary" > $ { i } < / b u t t o n > < / d i v >
` })(e):""}
< /form>`},{Strophe:tS,sizzle:nS,u:sS}=$l.env;jl.elements.define("converse-omemo-profile",class extends ig{async initialize(){this.devicelist=await wa.devicelists.getDeviceList(wa.bare_jid),await this.setAttributes(),this.listenTo(this.devicelist.devices,"change:bundle",(()=>this.requestUpdate())),this.listenTo(this.devicelist.devices,"reset",(()=>this.requestUpdate())),this.listenTo(this.devicelist.devices,"reset",(()=>this.requestUpdate())),this.listenTo(this.devicelist.devices,"remove",(()=>this.requestUpdate())),this.listenTo(this.devicelist.devices,"add",(()=>this.requestUpdate())),this.requestUpdate()}async setAttributes(){this.device_id=await jl.omemo.getDeviceID(),this.current_device=this.devicelist.devices.get(this.device_id),this.other_devices=this.devicelist.devices.filter((e=>e.get("id")!==this.device_id))}render(){return this.devicelist?eS(this):""}selectAll(e){let t=sS.ancestor(e.target,"li");for(;t;)t.querySelector('input[type="checkbox"]').checked=e.target.checked,t=t.nextElementSibling}async removeSelectedFingerprints(e){e.preventDefault(),e.stopPropagation(),e.target.querySelector(".select-all").checked=!1;const t=nS('.fingerprint-removal-item input[type="checkbox"]:checked',e.target).map((e=>e.value));try{await this.devicelist.removeOwnDevices(t)}catch(e){M.error(e),wa.api.alert(tS.LogLevel.ERROR,Eh("Error"),[Eh("Sorry, an error occurred while trying to remove the devices.")])}await this.setAttributes(),this.requestUpdate()}async generateOMEMODeviceBundle(e){e.preventDefault(),confirm(Eh("Are you sure you want to generate new OMEMO keys? This will remove your old keys and all previously encrypted messages will no longer be decryptable on this device."))&&(await jl.omemo.bundle.generate(),await this.setAttributes(),this.requestUpdate())}});let iS;const rS=ap.extend({id:"converse-client-info-modal",initialize(e){iS=e._converse,ap.prototype.initialize.apply(this,arguments)},toHTML(){return(e=>{const t=Eh("Settings"),n=Eh("%1$s Open Source %2$s XMPP chat client brought to you by %3$s Opkode %2$s",'<a target="_blank" rel="nofollow" href="https:/ / conversejs . org ">'," < /a>",'<a target="_blank" rel="nofollow" href="https:/ / opkode . com ">'),s=Eh(" % 1 $s Translate % 2 $s it into your own language ",'<a target=" _blank " rel=" nofollow " href=" https : //hosted.weblate.org/projects/conversejs/#languages">',"</a>"),i=jl.settings.get("show_client_info"),r=jl.settings.get("allow_adhoc_commands");return el`
2021-03-19 19:26:15 +01:00
< div class = "modal-dialog" role = "document" >
< div class = "modal-content" >
< div class = "modal-header" >
< h5 class = "modal-title" id = "converse-modtools-modal-label" > $ { t } < / h 5 >
2022-01-03 11:54:10 +01:00
$ { lp }
2021-03-19 19:26:15 +01:00
< / d i v >
< div class = "modal-body" >
2022-01-03 11:54:10 +01:00
$ { i && r ? ( e => { const t = Eh ( "About" ) , n = Eh ( "Commands" ) ; return el `
2021-03-19 19:26:15 +01:00
< ul class = "nav nav-pills justify-content-center" >
< li role = "presentation" class = "nav-item" >
< a class = "nav-link active" id = "about-tab" href = "#about-tabpanel" aria - controls = "about-tabpanel" role = "tab" data - toggle = "tab" @ click = $ { e . switchTab } > $ { t } < / a >
< / l i >
< li role = "presentation" class = "nav-item" >
< a class = "nav-link" id = "commands-tab" href = "#commands-tabpanel" aria - controls = "commands-tabpanel" role = "tab" data - toggle = "tab" @ click = $ { e . switchTab } > $ { n } < / a >
< / l i >
< / u l >
` })(e):""}
< div class = "tab-content" >
< div class = "tab-pane tab-pane--columns ${i?" active ":" "}"
id = "about-tabpanel" role = "tabpanel" aria - labelledby = "about-tab" >
< span class = "modal-alert" > < / s p a n >
< br / >
< div class = "container" >
< h6 class = "brand-heading" > Converse < / h 6 >
< p class = "brand-subtitle" > $ { e . version _name } < / p >
2022-01-03 11:54:10 +01:00
< p class = "brand-subtitle" > $ { my ( Oo ( ) . sanitize ( n ) ) } < / p >
< p class = "brand-subtitle" > $ { my ( Oo ( ) . sanitize ( s ) ) } < / p >
2021-03-19 19:26:15 +01:00
< / d i v >
< / d i v >
2021-11-11 22:06:49 +01:00
< div class = "tab-pane tab-pane--columns ${!i&&r?" active ":" "}"
2021-03-19 19:26:15 +01:00
id = "commands-tabpanel"
role = "tabpanel"
aria - labelledby = "commands-tab" >
< converse - adhoc - commands / >
< / d i v >
< / d i v >
< / d i v >
< / d i v >
< / d i v >
2022-01-03 11:54:10 +01:00
` })(Object.assign(this.model.toJSON(),this.model.vcard.toJSON(),{version_name:iS.VERSION_NAME}))}});jl.elements.define("converse-user-profile",class extends ig{initialize(){this.model=wa.xmppstatus,this.listenTo(this.model,"vcard:add",this.requestUpdate),this.listenTo(this.model,"change",this.requestUpdate),this.listenTo(this.model,"vcard:change",this.requestUpdate)}render(){return(e=>{var t,n,s;const i=e.model.get("status")||"offline",r=(null===(t=e.model.vcard)||void 0===t?void 0:t.get("fullname"))||wa.bare_jid,o=e.model.get("status_message")||Eh("I am %1 $ s","chat"===(a=i)?Eh("online"):"dnd"===a?Eh("busy"):"xa"===a?Eh("away for long"):"away"===a?Eh("away"):"offline"===a?Eh("offline"):Eh(a)||Eh("online"));var a;const c=Eh("Click to change your chat status"),l=jl.settings.get("show_client_info")||jl.settings.get("allow_adhoc_commands");let d,u;return[d,u]="online"===i?["fa fa-circle chat-status","chat-status-online"]:"dnd"===i?["fa fa-minus-circle chat-status","chat-status-busy"]:"away"===i?["fa fa-circle chat-status","chat-status-away"]:["fa fa-circle chat-status","subdued-color"],el `
< div class = "userinfo controlbox-padded" >
< div class = "controlbox-section profile d-flex" >
< a class = "show-profile" href = "#" @ click = $ { e . showProfileModal } >
< converse - avatar class = "avatar align-self-center"
. data = $ { null === ( n = e . model . vcard ) || void 0 === n ? void 0 : n . attributes }
nonce = $ { null === ( s = e . model . vcard ) || void 0 === s ? void 0 : s . get ( "vcard_updated" ) }
height = "40" width = "40" > < / c o n v e r s e - a v a t a r >
< / a >
< span class = "username w-100 align-self-center" > $ { r } < / s p a n >
$ { l ? function ( e ) { const t = Eh ( "Show details about this chat client" ) ; return el ` <a class="controlbox-heading__btn show-client-info align-self-center" title=" ${ t } " @click= ${ e . showUserSettingsModal } >
< converse - icon color = "var(--subdued-color)" class = "fa fa-cog" size = "1em" > < / c o n v e r s e - i c o n >
< / a > ` } ( e ) : " " }
$ { jl . settings . get ( "allow_logout" ) ? function ( e ) { const t = Eh ( "Log out" ) ; return el ` <a class="controlbox-heading__btn logout align-self-center" title=" ${ t } " @click= ${ e . logout } >
< converse - icon color = "var(--subdued-color)" class = "fa fa-sign-out-alt" size = "1em" > < / c o n v e r s e - i c o n >
< / a > ` } ( e ) : " " }
< / d i v >
< div class = "d-flex xmpp-status" >
< a class = "change-status" title = "${c}" data - toggle = "modal" data - target = "#changeStatusModal" @ click = $ { e . showStatusChangeModal } >
< span class = "${i} w-100 align-self-center" data - value = "${i}" >
< converse - icon color = "var(--${u})" style = "margin-top: -0.1em" size = "0.82em" class = "${d}" > < / c o n v e r s e - i c o n > $ { o } < / s p a n >
< / a >
< / d i v >
< / d i v > ` } ) ( t h i s ) } s h o w P r o f i l e M o d a l ( e ) { n u l l = = e | | e . p r e v e n t D e f a u l t ( ) , j l . m o d a l . s h o w ( w a . P r o f i l e M o d a l , { m o d e l : t h i s . m o d e l } , e ) } s h o w S t a t u s C h a n g e M o d a l ( e ) { n u l l = = e | | e . p r e v e n t D e f a u l t ( ) , j l . m o d a l . s h o w ( w a . C h a t S t a t u s M o d a l , { m o d e l : t h i s . m o d e l } , e ) } s h o w U s e r S e t t i n g s M o d a l ( e ) { n u l l = = e | | e . p r e v e n t D e f a u l t ( ) , j l . m o d a l . s h o w ( r S , { m o d e l : t h i s . m o d e l , _ c o n v e r s e : w a } , e ) } l o g o u t ( e ) { n u l l = = e | | e . p r e v e n t D e f a u l t ( ) , ! 0 = = = c o n f i r m ( E h ( " A r e y o u s u r e y o u w a n t t o l o g o u t ? " ) ) & & j l . u s e r . l o g o u t ( ) } } ) ; c o n s t o S = $ l . e n v . u t i l s , a S = a p . e x t e n d ( { i d : " m o d a l - s t a t u s - c h a n g e " , e v e n t s : { " s u b m i t f o r m # s e t - x m p p - s t a t u s " : " o n F o r m S u b m i t t e d " , " c l i c k . c l e a r - i n p u t " : " c l e a r S t a t u s M e s s a g e " } , t o H T M L ( ) { r e t u r n ( e = > e l `
2021-11-11 22:06:49 +01:00
< div class = "modal-dialog" role = "document" >
< div class = "modal-content" >
< div class = "modal-header" >
< h5 class = "modal-title" id = "changeStatusModalLabel" > $ { e . modal _title } < / h 5 >
2022-01-03 11:54:10 +01:00
$ { lp }
2021-11-11 22:06:49 +01:00
< / d i v >
< div class = "modal-body" >
< span class = "modal-alert" > < / s p a n >
< form class = "converse-form set-xmpp-status" id = "set-xmpp-status" >
< div class = "form-group" >
< div class = "custom-control custom-radio" >
< input ? checked = $ { "online" === e . status }
type = "radio" id = "radio-online" value = "online" name = "chat_status" class = "custom-control-input" / >
< label class = "custom-control-label" for = "radio-online" >
< span class = "fa fa-circle chat-status chat-status--online" > < / s p a n > $ { e . l a b e l _ o n l i n e } < / l a b e l >
< / d i v >
< div class = "custom-control custom-radio" >
< input ? checked = $ { "busy" === e . status }
type = "radio" id = "radio-busy" value = "dnd" name = "chat_status" class = "custom-control-input" / >
< label class = "custom-control-label" for = "radio-busy" >
< span class = "fa fa-minus-circle chat-status chat-status--busy" > < / s p a n > $ { e . l a b e l _ b u s y } < / l a b e l >
< / d i v >
< div class = "custom-control custom-radio" >
< input ? checked = $ { "away" === e . status }
type = "radio" id = "radio-away" value = "away" name = "chat_status" class = "custom-control-input" / >
< label class = "custom-control-label" for = "radio-away" >
< span class = "fa fa-circle chat-status chat-status--away" > < / s p a n > $ { e . l a b e l _ a w a y } < / l a b e l >
< / d i v >
< div class = "custom-control custom-radio" >
< input ? checked = $ { "xa" === e . status }
type = "radio" id = "radio-xa" value = "xa" name = "chat_status" class = "custom-control-input" / >
< label class = "custom-control-label" for = "radio-xa" >
< span class = "far fa-circle chat-status chat-status--xa" > < / s p a n > $ { e . l a b e l _ x a } < / l a b e l >
< / d i v >
< / d i v >
< div class = "form-group" >
< div class = "btn-group w-100" >
< input name = "status_message" type = "text" class = "form-control"
value = "${e.status_message||" "}" placeholder = "${e.placeholder_status_message}" / >
< span class = "clear-input fa fa-times ${e.status_message?" ":" hidden "}" > < / s p a n >
< / d i v >
< / d i v >
< button type = "submit" class = "btn btn-primary" > $ { e . label _save } < / b u t t o n >
< / f o r m >
< / d i v >
< / d i v >
< / d i v >
2022-01-03 11:54:10 +01:00
` )(Object.assign(this.model.toJSON(),this.model.vcard.toJSON(),{label_away:Eh("Away"),label_busy:Eh("Busy"),label_cancel:Eh("Cancel"),label_close:Eh("Close"),label_custom_status:Eh("Custom status"),label_offline:Eh("Offline"),label_online:Eh("Online"),label_save:Eh("Save"),label_xa:Eh("Away for long"),modal_title:Eh("Change chat status"),placeholder_status_message:Eh("Personal status message")}))},afterRender(){this.el.addEventListener("shown.bs.modal",(()=>{this.el.querySelector('input[name="status_message"]').focus()}),!1)},clearStatusMessage(e){e&&e.preventDefault&&(e.preventDefault(),oS.hideElement(this.el.querySelector(".clear-input"))),this.el.querySelector('input[name="status_message"]').value=""},onFormSubmitted(e){e.preventDefault();const t=new FormData(e.target);this.model.save({status_message:t.get("status_message"),status:t.get("chat_status")}),this.modal.hide()}});wa.ChatStatusModal=aS;const cS=Eh("Your profile picture");jl.elements.define("converse-image-picker",class extends ig{static get properties(){return{height:{type:Number},data:{type:Object},width:{type:Number}}}render(){return el `
< a class = "change-avatar" @ click = $ { this . openFileSelection } title = "${cS}" >
< converse - avatar class = "avatar" . data = $ { this . data } height = "${this.height}" width = "${this.width}" > < / c o n v e r s e - a v a t a r >
2021-03-19 19:26:15 +01:00
< / a >
< input @ change = $ { this . updateFilePreview } class = "hidden" name = "image" type = "file" / >
2022-01-03 11:54:10 +01:00
` }openFileSelection(e){e.preventDefault(),this.querySelector('input[type="file"]').click()}updateFilePreview(e){const t=e.target.files[0],n=new FileReader;n.onloadend=()=>{this.data={data_uri:n.result,image_type:t.type}},n.readAsDataURL(t)}});var lS=n(2234),dS=n.n(lS);const{sizzle:uS}= $ l.env,hS=new(dS())({targetSize:.1,quality:.75,maxWidth:256,maxHeight:256}),fS=ap.extend({id:"user-profile-modal",events:{"submit .profile-form":"onFormSubmitted"},initialize(){this.listenTo(this.model,"change",this.render),ap.prototype.initialize.apply(this,arguments),jl.trigger("profileModalInitialized",this.model)},toHTML(){return(e=>{var t,n;const s=Eh("Your Profile"),i=Eh("Email"),r=Eh("Full Name"),o=Eh("XMPP Address"),a=Eh("Nickname"),c=Eh("Role"),l=Eh("Save and close"),d=Eh("Use commas to separate multiple roles. Your roles are shown next to your name on your chat messages."),u=Eh("URL"),h=Eh("OMEMO"),f=Eh("Profile"),m=el ` < ul class = "nav nav-pills justify-content-center" >
2021-03-19 19:26:15 +01:00
< li role = "presentation" class = "nav-item" >
2022-01-03 11:54:10 +01:00
< a class = "nav-link active" id = "profile-tab" href = "#profile-tabpanel" aria - controls = "profile-tabpanel" role = "tab" data - toggle = "tab" > $ { f } < / a >
2021-03-19 19:26:15 +01:00
< / l i >
< li role = "presentation" class = "nav-item" >
2022-01-03 11:54:10 +01:00
< a class = "nav-link" id = "omemo-tab" href = "#omemo-tabpanel" aria - controls = "omemo-tabpanel" role = "tab" data - toggle = "tab" > $ { h } < / a >
2021-03-19 19:26:15 +01:00
< / l i >
2022-01-03 11:54:10 +01:00
< / u l > ` ; r e t u r n e l `
2021-03-19 19:26:15 +01:00
< div class = "modal-dialog" role = "document" >
< div class = "modal-content" >
< div class = "modal-header" >
2022-01-03 11:54:10 +01:00
< h5 class = "modal-title" id = "user-profile-modal-label" > $ { s } < / h 5 >
$ { lp }
2021-03-19 19:26:15 +01:00
< / d i v >
< div class = "modal-body" >
< span class = "modal-alert" > < / s p a n >
2022-01-03 11:54:10 +01:00
$ { null !== ( t = wa . pluggable . plugins [ "converse-omemo" ] ) && void 0 !== t && t . enabled ( wa ) ? m : "" }
2021-03-19 19:26:15 +01:00
< div class = "tab-content" >
< div class = "tab-pane active" id = "profile-tabpanel" role = "tabpanel" aria - labelledby = "profile-tab" >
< form class = "converse-form converse-form--modal profile-form" action = "#" >
< div class = "row" >
< div class = "col-auto" >
2022-01-03 11:54:10 +01:00
< converse - image - picker . data = "${{image:e.image,image_type:e.image_type}}" width = "128" height = "128" > < / c o n v e r s e - i m a g e - p i c k e r >
2021-03-19 19:26:15 +01:00
< / d i v >
< div class = "col" >
< div class = "form-group" >
2022-01-03 11:54:10 +01:00
< label class = "col-form-label" > $ { o } : < / l a b e l >
2021-03-19 19:26:15 +01:00
< div > $ { e . jid } < / d i v >
< / d i v >
< / d i v >
< / d i v >
< div class = "form-group" >
2022-01-03 11:54:10 +01:00
< label for = "vcard-fullname" class = "col-form-label" > $ { r } : < / l a b e l >
2021-03-19 19:26:15 +01:00
< input id = "vcard-fullname" type = "text" class = "form-control" name = "fn" value = "${e.fullname||" "}" / >
< / d i v >
< div class = "form-group" >
2022-01-03 11:54:10 +01:00
< label for = "vcard-nickname" class = "col-form-label" > $ { a } : < / l a b e l >
2021-03-19 19:26:15 +01:00
< input id = "vcard-nickname" type = "text" class = "form-control" name = "nickname" value = "${e.nickname||" "}" / >
< / d i v >
< div class = "form-group" >
2022-01-03 11:54:10 +01:00
< label for = "vcard-url" class = "col-form-label" > $ { u } : < / l a b e l >
2021-03-19 19:26:15 +01:00
< input id = "vcard-url" type = "url" class = "form-control" name = "url" value = "${e.url||" "}" / >
< / d i v >
< div class = "form-group" >
2022-01-03 11:54:10 +01:00
< label for = "vcard-email" class = "col-form-label" > $ { i } : < / l a b e l >
2021-03-19 19:26:15 +01:00
< input id = "vcard-email" type = "email" class = "form-control" name = "email" value = "${e.email||" "}" / >
< / d i v >
< div class = "form-group" >
2022-01-03 11:54:10 +01:00
< label for = "vcard-role" class = "col-form-label" > $ { c } : < / l a b e l >
2021-03-19 19:26:15 +01:00
< input id = "vcard-role" type = "text" class = "form-control" name = "role" value = "${e.role||" "}" aria - describedby = "vcard-role-help" / >
2022-01-03 11:54:10 +01:00
< small id = "vcard-role-help" class = "form-text text-muted" > $ { d } < / s m a l l >
2021-03-19 19:26:15 +01:00
< / d i v >
< hr / >
< div class = "form-group" >
2022-01-03 11:54:10 +01:00
< button type = "submit" class = "save-form btn btn-primary" > $ { l } < / b u t t o n >
2021-03-19 19:26:15 +01:00
< / d i v >
< / f o r m >
< / d i v >
2022-01-03 11:54:10 +01:00
$ { null !== ( n = wa . pluggable . plugins [ "converse-omemo" ] ) && void 0 !== n && n . enabled ( wa ) ? el `
< div class = "tab-pane" id = "omemo-tabpanel" role = "tabpanel" aria - labelledby = "omemo-tab" >
< converse - omemo - profile > < / c o n v e r s e - o m e m o - p r o f i l e >
< / d i v > ` : " " }
2021-03-19 19:26:15 +01:00
< / d i v >
< / d i v >
< / d i v >
< / d i v >
2022-01-03 11:54:10 +01:00
` })(Object.assign(this.model.toJSON(),this.model.vcard.toJSON(),{view:this}))},afterRender(){this.tabs=uS(".nav-item .nav-link",this.el).map((e=>new(Yg().Tab)(e)))},async setVCard(e){try{await jl.vcard.set(wa.bare_jid,e)}catch(e){return M.fatal(e),void this.alert([Eh("Sorry, an error happened while trying to save your profile data."),Eh("You can check your browser's developer console for any error output.")].join(" "))}this.modal.hide()},onFormSubmitted(e){e.preventDefault();const t=new FileReader,n=new FormData(e.target),s=n.get("image"),i={fn:n.get("fn"),nickname:n.get("nickname"),role:n.get("role"),email:n.get("email"),url:n.get("url")};if(s.size){const e=[s];hS.compress(e).then((e=>{const{photo:n}=e[0];t.onloadend=()=>{Object.assign(i,{image:btoa(t.result),image_type:s.type}),this.setVCard(i)},t.readAsBinaryString(n.data)}))}else Object.assign(i,{image:this.model.vcard.get("image"),image_type:this.model.vcard.get("image_type")}),this.setVCard(i)}});wa.ProfileModal=fS, $ l.plugins.add("converse-profile",{dependencies:["converse-status","converse-modal","converse-vcard","converse-chatboxviews"],initialize(){jl.settings.extend({allow_adhoc_commands:!0,show_client_info:!0})}});const mS={async sendMessage(e){var t;if(this.get("omemo_active")&&null!==(t=e)&&void 0!==t&&t.body){var n;const t=null===(n=e)||void 0===n?void 0:n.body;let s,i;(e=this.getOutgoingMessageAttributes(e)).is_encrypted=!0,e.plaintext=t;try{const t=await async function(e){const t=Eh("Sorry, no devices found to which we can send an OMEMO encrypted message.");let n;if(e.get("type")===wa.CHATROOMS_TYPE){const t=await Promise.all(e.occupants.map((e=>Ww(e.get("jid")))));n=t.reduce(((e,t)=>function(){var e=arguments.length;if(!e)return[];for(var t=Array(e-1),n=arguments[0],s=e;s--;)t[s-1]=arguments[s];return Yt(ot(n)?_i(n):[n],Co(t,1))}(e,t.models)),[])}else if(e.get("type")===wa.PRIVATE_CHAT_TYPE){const s=await Ww(e.get("jid"));if(0===s.length){const e=new Error(t);throw e.user_facing=!0,e}const i=wa.devicelists.get(wa.bare_jid).devices;n=[...i.models,...s.models]}const s=wa.omemo_store.get("device_id");n=n.filter((e=>e.get("id")!==s)),await Promise.all(n.map((e=>e.getBundle())));const i=n.filter((e=>e)).map((e=>async function(e){if(!e.get("bundle"))return M.error( ` Could not build an OMEMO session for device $ { e . get ( "id" ) } because we don ' t have its bundle ` ),null;const t=new libsignal.SignalProtocolAddress(e.get("jid"),e.get("id")),n=await wa.omemo_store.loadSession(t.toString());if(n)return n;try{return await async function(e){const t=new libsignal.SignalProtocolAddress(e.get("jid"),e.get("id")),n=new libsignal.SessionBuilder(wa.omemo_store,t),s=e.getRandomPreKey(),i=await e.getBundle();return n.processPreKey({registrationId:parseInt(e.get("id"),10),identityKey:Tw(i.identity_key),signedPreKey:{keyId:i.signed_prekey.id,publicKey:Tw(i.signed_prekey.public_key),signature:Tw(i.signed_prekey.signature)},preKey:{keyId:s.id,publicKey:Tw(s.key)}})}(e)}catch(t){return M.error( ` Could not build an OMEMO session for device $ { e . get ( "id" ) } ` ),M.error(t),null}}(e)));if(await Promise.all(i),i.includes(null)&&(n=n.filter((e=>i[n.indexOf(e)])),0===n.length)){const e=new Error(t);throw e.user_facing=!0,e}return n}(this);s=await this.createMessage(e),i=await function(e,t,n){const s=Eh("This is an OMEMO encrypted message which your client doesn’ t seem to support. Find more information on https://conversations.im/omemo");if(!t.get("message"))throw new Error("No message body to encrypt!");const i=jw({from:wa.connection.jid,to:e.get("jid"),type:e.get("message_type"),id:t.get("msgid")}).c("body").t(s).up();return"chat"===t.get("type")&&i.c("request",{xmlns:Nw.NS.RECEIPTS}).up(),i.c("encrypted",{xmlns:Nw.NS.OMEMO}).c("header",{sid:wa.omemo_store.get("device_id")}),Xw.encryptMessage(t.get("message")).then((t=>{const s=n.filter((e=>-1!=e.get("trusted")&&e.get("active"))).map((n=>e.encryptKey(t.key_and_tag,n)));return Promise.all(s).then((e=>function(e,t,n){for(const s in t)if(Object.prototype.hasOwnProperty.call(t,s)){const i=t[s].payload,r=t[s].device,o=3==parseInt(i.type,10);e.c(
2021-11-11 22:06:49 +01:00
< converse - brand - logo > < / c o n v e r s e - b r a n d - l o g o >
2022-01-03 11:54:10 +01:00
$ { 0 === e . model . get ( "registration_status" ) ? ( ( ) => { const e = jl . settings . get ( "registration_domain" ) , t = Eh ( "Create your account" ) , n = Eh ( "Please enter the XMPP provider to register with:" ) ; return el `
2021-11-11 22:06:49 +01:00
< form id = "converse-register" class = "converse-form" >
< legend class = "col-form-label" > $ { t } < / l e g e n d >
< div class = "form-group" >
< label > $ { n } < / l a b e l >
< div class = "form-errors hidden" > < / d i v >
2022-01-03 11:54:10 +01:00
$ { e || ( ( ) => { const e = jl . settings . get ( "domain_placeholder" ) , t = Eh ( "Tip: A list of public XMPP providers is available" ) , n = Eh ( "here" ) , s = jl . settings . get ( "providers_link" ) ; return el `
2021-11-11 22:06:49 +01:00
< input class = "form-control" required = "required" type = "text" name = "domain" placeholder = "${e}" / >
< p class = "form-text text-muted" >
$ { t }
< a href = "${s}" class = "url" target = "_blank" rel = "noopener" > $ { n } < / a > .
< / p >
` })()}
2021-03-19 19:26:15 +01:00
< / d i v >
2022-01-03 11:54:10 +01:00
$ { e ? "" : ( ( ) => { const e = Eh ( "Fetch registration form" ) , t = Eh ( "Already have a chat account?" ) , n = Eh ( "Log in here" ) ; return el `
2021-11-11 22:06:49 +01:00
< fieldset class = "form-group buttons" >
< input class = "btn btn-primary" type = "submit" value = "${e}" / >
< / f i e l d s e t >
< div class = "switch-form" >
< p > $ { t } < / p >
< p > < a class = "login-here toggle-register-login" href = "#converse/login" > $ { n } < / a > < / p >
< / d i v >
` })()}
< / f o r m >
` })():""}
2022-01-03 11:54:10 +01:00
$ { 1 === e . model . get ( "registration_status" ) ? ( ( ) => { const e = jl . settings . get ( "registration_domain" ) , t = Eh ( "Hold tight, we're fetching the registration form…" ) , n = Eh ( "Cancel" ) ; return el `
2021-11-11 22:06:49 +01:00
< form id = "converse-register" class = "converse-form no-scrolling" >
2022-01-03 11:54:10 +01:00
$ { ny ( { classes : "hor_centered" } ) }
2021-11-11 22:06:49 +01:00
< p class = "info" > $ { t } < / p >
2022-01-03 11:54:10 +01:00
$ { e ? "" : el `
2021-11-11 22:06:49 +01:00
< button class = "btn btn-secondary button-cancel hor_centered" > $ { n } < / b u t t o n >
` }
< / f o r m >
` })():""}
2022-01-03 11:54:10 +01:00
$ { 2 === e . model . get ( "registration_status" ) ? ( e => { const t = Eh ( "Choose a different provider" ) , n = Eh ( "Already have a chat account?" ) , s = Eh ( "Account Registration:" ) , i = Eh ( "Log in here" ) , r = Eh ( "Register" ) , o = jl . settings . get ( "registration_domain" ) ; return el `
2021-11-11 22:06:49 +01:00
< form id = "converse-register" class = "converse-form" >
< legend class = "col-form-label" > $ { s } $ { e . domain } < / l e g e n d >
< p class = "title" > $ { e . title } < / p >
< p class = "form-help instructions" > $ { e . instructions } < / p >
< div class = "form-errors hidden" > < / d i v >
$ { e . form _fields }
< fieldset class = "buttons form-group" >
2022-01-03 11:54:10 +01:00
$ { e . fields ? el `
2021-11-11 22:06:49 +01:00
< input type = "submit" class = "btn btn-primary" value = "${r}" / >
` :""}
2022-01-03 11:54:10 +01:00
$ { o ? "" : el `
2021-11-11 22:06:49 +01:00
< input
type = "button"
class = "btn btn-secondary button-cancel"
value = "${t}"
/ >
` }
< div class = "switch-form" >
< p > $ { n } < / p >
< p > < a class = "login-here toggle-register-login" href = "#converse/login" > $ { i } < / a > < / p >
< / d i v >
< / f i e l d s e t >
< / f o r m >
` })(e):""}
2022-01-03 11:54:10 +01:00
` ;function VS(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const{Strophe:JS,sizzle:QS, $ iq:ZS}= $ l.env,KS= $ l.env.utils,YS=1,XS=2;jl.elements.define("converse-register-panel",class extends Ng{constructor(...e){super(...e),VS(this,"id","converse-register-panel"),VS(this,"className","controlbox-pane fade-in"),VS(this,"events",{"submit form#converse-register":"onFormSubmission","click .button-cancel":"renderProviderChoiceForm"})}initialize(){this.reset();const e=wa.chatboxes.get("controlbox");this.model=e,this.listenTo(wa,"connectionInitialized",this.registerHooks),this.listenTo(this.model,"change:registration_status",this.render);const t=jl.settings.get("registration_domain");t?this.fetchRegistrationForm(t):this.model.set("registration_status",0)}render(){il(WS({domain:this.domain,fields:this.fields,form_fields:this.form_fields,instructions:this.instructions,model:this.model,title:this.title}),this)}registerHooks(){const e=wa.connection,t=e._connect_cb.bind(e);e._connect_cb=(e,n,s)=>{this._registering?this.getRegistrationFields(e,n)&&(this._registering=!1):t(e,n,s)}}connectedCallback(){super.connectedCallback(),this.render()}getRegistrationFields(e,t){const n=wa.connection;n.connected=!0;const s=n._proto._reqToData(e);if(!s)return;if(n._proto._connect_cb(s)===JS.Status.CONNFAIL)return this.showValidationError(Eh("Sorry, we're unable to connect to your chosen provider.")),!1;const i=s.getElementsByTagName("register"),r=s.getElementsByTagName("mechanism");if(0===i.length&&0===r.length)return n._proto._no_auth_received(t),!1;if(0===i.length)return n._changeConnectStatus(JS.Status.REGIFAIL),this.showValidationError(Eh("Sorry, the given provider does not support in band account registration. Please try with a different provider.")),!0;n._addSysHandler(this.onRegistrationFields.bind(this),null,"iq",null,null);const o=ZS({type:"get"}).c("query",{xmlns:JS.NS.REGISTER}).tree();return o.setAttribute("id",n.getUniqueId("sendIQ")),n.send(o),n.connected=!1,!0}onRegistrationFields(e){return"error"===e.getAttribute("type")?(wa.connection._changeConnectStatus(JS.Status.REGIFAIL,Eh('Something went wrong while establishing a connection with "%1 $ s". Are you sure it exists?',this.domain)),!1):1!==e.getElementsByTagName("query").length?(wa.connection._changeConnectStatus(JS.Status.REGIFAIL,"unknown"),!1):(this.setFields(e),this.model.get("registration_status")===YS&&this.renderRegistrationForm(e),!1)}reset(e){const t={fields:{},urls:[],title:"",instructions:"",registered:!1,_registering:!1,domain:null,form_type:null};Object.assign(this,t),e&&Object.assign(this,jo(e,Object.keys(t)))}onFormSubmission(e){e&&e.preventDefault&&e.preventDefault(),null===e.target.querySelector("input[name=domain]")?this.submitRegistrationForm(e.target):this.onProviderChosen(e.target)}onProviderChosen(e){const t=e.querySelector("input[name=domain]"),n=null==t?void 0:t.value;n?(e.querySelector("input[type=submit]").classList.add("hidden"),this.fetchRegistrationForm(n.trim())):t.classList.add("error")}async fetchRegistrationForm(e){var t;return this.model.set("registration_status",YS),this.reset({domain:JS.getDomainFromJid(e),_registering:!0}),await wa.initConnection(this.domain),null===(t=wa.connection)||void 0===t||t.connect(this.domain,"",(e=>this.onConnectStatusChanged(e))),!1}giveFeedback(e,t){let n=this.querySelector(".reg-feedback");null!==n&&n.parentNode.removeChild(n);const s=this.querySelector("form");s.insertAdjacentHTML("afterbegin",'<span class="reg-feedback"></span>'),n=s.querySelector(".reg-feedback"),n.textContent=e,t&&n.classList.add(t)}showSpinner(){const e=this.querySelector("form");return il(ny(),e),this}onConnectStatusChanged(e){M.debug("converse-register: onConnectStatusChanged"),[JS.Status.DISCONNECTED,JS.Status.CONNFAIL,JS.Status.REGIFAIL,JS.Status.NOTACCEPTABLE,JS.Status.CONFLICT].includes(e)?(M.error( ` Problem during registration : Strophe . Status is $ { wa . CONNECTION _STATUS [ e ] } ` ),this.abortRegistration()):e===JS.Status.REGISTERED&&(M.debug("Registered successfully."),wa.connection.re
2021-11-11 22:06:49 +01:00
< div class = "modal-dialog" role = "document" >
< div class = "modal-content" >
< div class = "modal-header" >
< h5 class = "modal-title" id = "add-chatroom-modal-label" > $ { n } < / h 5 >
2022-01-03 11:54:10 +01:00
$ { lp }
2021-11-11 22:06:49 +01:00
< / d i v >
< div class = "modal-body" >
< span class = "modal-alert" > < / s p a n >
< form class = "converse-form add-chatroom" >
< div class = "form-group" >
< label for = "chatroom" > $ { e . label _room _address } : < / l a b e l >
2022-01-03 11:54:10 +01:00
$ { e . muc _roomid _policy _error _msg ? el ` <label class="roomid-policy-error"> ${ e . muc _roomid _policy _error _msg } </label> ` : "" }
2021-11-11 22:06:49 +01:00
< input type = "text" required = "required" name = "chatroom" class = "form-control roomjid-input" placeholder = "${e.chatroom_placeholder}" / >
2021-03-19 19:26:15 +01:00
< / d i v >
2022-01-03 11:54:10 +01:00
$ { e . muc _roomid _policy _hint ? el ` <div class="form-group"> ${ my ( Oo ( ) . sanitize ( e . muc _roomid _policy _hint , { ALLOWED _TAGS : [ "b" , "br" , "em" ] } ))}</div> ` : "" }
$ { jl . settings . get ( "locked_muc_nickname" ) ? "" : ( e => { const t = Eh ( "Nickname" ) , n = Eh ( "This field is required" ) ; return el `
2021-11-11 22:06:49 +01:00
< div class = "form-group" >
< label for = "nickname" > $ { t } : < / l a b e l >
< input type = "text" title = "${n}" required = "required" name = "nickname" value = "${e.nick||" "}" class = "form-control" / >
< / d i v >
` })(e)}
< input type = "submit" class = "btn btn-primary" name = "join" value = "${t||" "}" ? disabled = $ { e . muc _roomid _policy _error _msg } >
< / f o r m >
< / d i v >
< / d i v >
< / d i v >
2022-01-03 11:54:10 +01:00
` })(Object.assign(this.model.toJSON(),{_converse:wa,label_room_address:jl.settings.get("muc_domain")?Eh("Groupchat name"):Eh("Groupchat address"),chatroom_placeholder:e,muc_roomid_policy_error_msg:this.muc_roomid_policy_error_msg,muc_roomid_policy_hint:jl.settings.get("muc_roomid_policy_hint")}))},afterRender(){this.el.addEventListener("shown.bs.modal",(()=>{this.el.querySelector('input[name="chatroom"]').focus()}),!1)},parseRoomDataFromEvent(e){const t=new FormData(e),n=t.get("chatroom");let s;if(jl.settings.get("locked_muc_nickname")){if(s=wa.getDefaultMUCNickname(),!s)throw new Error("Using locked_muc_nickname but no nickname found!")}else s=t.get("nickname").trim();return{jid:n,nick:s}},openChatRoom(e){e.preventDefault();const t=this.parseRoomDataFromEvent(e.target);let n;""===t.nick&&(t.nick=void 0),jl.settings.get("locked_muc_domain")||jl.settings.get("muc_domain")&&!ix.isValidJID(t.jid)?n= ` $ { rx . escapeNode ( t . jid ) } @ $ { jl . settings . get ( "muc_domain" ) } ` :(n=t.jid,this.model.setDomain(n)),jl.rooms.open(n,Object.assign(t,{jid:n}),!0),this.modal.hide(),e.target.reset()},checkRoomidPolicy(){if(jl.settings.get("muc_roomid_policy")&&jl.settings.get("muc_domain")){let e=this.el.querySelector(".roomjid-input").value;!jl.settings.get("locked_muc_domain")&&ix.isValidJID(e)||(e= ` $ { rx . escapeNode ( e ) } @ $ { jl . settings . get ( "muc_domain" ) } ` );const t=rx.getNodeFromJid(e),n=rx.getDomainFromJid(e);jl.settings.get("muc_domain")!==n||jl.settings.get("muc_roomid_policy").test(t)?this.muc_roomid_policy_error_msg=null:this.muc_roomid_policy_error_msg=Eh("Groupchat id is invalid."),this.render()}}}),ax=function(e){return e&&e.length?e[0]:void 0},{Strophe:cx, $ iq:lx,sizzle:dx}= $ l.env,ux= $ l.env.utils;const hx=ap.extend({id:"muc-list-modal",persistent:!0,initialize(){this.items=[],this.loading_items=!1,ap.prototype.initialize.apply(this,arguments),jl.settings.get("muc_domain")&&!this.model.get("muc_domain")&&this.model.save("muc_domain",jl.settings.get("muc_domain")),this.listenTo(this.model,"change:muc_domain",this.onDomainChange),this.el.addEventListener("shown.bs.modal",(()=>jl.settings.get("locked_muc_domain")?this.updateRoomsList():this.el.querySelector('input[name="server"]').focus()))},toHTML(){const e=this.model.get("muc_domain")||jl.settings.get("muc_domain");return(e=>{const t=Eh("Query for Groupchats");return el `
2021-11-11 22:06:49 +01:00
< div class = "modal-dialog" role = "document" >
< div class = "modal-content" >
< div class = "modal-header" >
< h5 class = "modal-title" id = "muc-list-modal-label" > $ { t } < / h 5 >
2022-01-03 11:54:10 +01:00
$ { lp }
2021-11-11 22:06:49 +01:00
< / d i v >
< div class = "modal-body d-flex flex-column" >
< span class = "modal-alert" > < / s p a n >
2022-01-03 11:54:10 +01:00
$ { e . show _form ? ( e => { const t = Eh ( "Show groupchats" ) , n = Eh ( "Server address" ) ; return el `
2021-11-11 22:06:49 +01:00
< form class = "converse-form list-chatrooms"
@ submit = $ { e . submitForm } >
< div class = "form-group" >
< label for = "chatroom" > $ { n } : < / l a b e l >
< input type = "text"
@ change = $ { e . setDomainFromEvent }
value = "${e.muc_domain||" "}"
required = "required"
name = "server"
class = "form-control"
placeholder = "${e.server_placeholder}" / >
< / d i v >
< input type = "submit" class = "btn btn-primary" name = "list" value = "${t}" / >
< / f o r m >
` })(e):""}
< ul class = "available-chatrooms list-group" >
2022-01-03 11:54:10 +01:00
$ { e . loading _items ? el ` <li class="list-group-item"> ${ ny ( ) } </li> ` : "" }
$ { e . feedback _text ? el ` <li class="list-group-item active"> ${ e . feedback _text } </li> ` : "" }
$ { Wg ( e . items , ( e => e . jid ) , ( t => ( ( e , t ) => { const n = Eh ( "Show more information on this groupchat" ) , s = Eh ( "Click to open this groupchat" ) ; return el `
2021-11-11 22:06:49 +01:00
< li class = "room-item list-group-item" >
< div class = "available-chatroom d-flex flex-row" >
< a class = "open-room available-room w-100"
@ click = $ { e . openRoom }
data - room - jid = "${t.jid}"
data - room - name = "${t.name}"
title = "${s}"
href = "#" > $ { t . name || t . jid } < / a >
< a class = "right room-info icon-room-info"
@ click = $ { e . toggleRoomInfo }
data - room - jid = "${t.jid}"
title = "${n}"
href = "#" > < / a >
< / d i v >
< / l i >
` })(e,t)))}
< / u l >
< / d i v >
2022-01-03 11:54:10 +01:00
< div class = "modal-footer" > $ { cp } < / d i v >
2021-03-19 19:26:15 +01:00
< / d i v >
< / d i v >
2022-01-03 11:54:10 +01:00
` })(Object.assign(this.model.toJSON(),{show_form:!jl.settings.get("locked_muc_domain"),server_placeholder:e||Eh("conference.example.org"),items:this.items,loading_items:this.loading_items,openRoom:e=>this.openRoom(e),setDomainFromEvent:e=>this.setDomainFromEvent(e),submitForm:e=>this.showRooms(e),toggleRoomInfo:e=>this.toggleRoomInfo(e)}))},openRoom(e){e.preventDefault();const t=e.target.getAttribute("data-room-jid"),n=e.target.getAttribute("data-room-name");this.modal.hide(),jl.rooms.open(t,{name:n},!0)},toggleRoomInfo(e){e.preventDefault(),function(e){const t=ux.ancestor(e.target,".room-item"),n=t.querySelector("div.room-info");n?(ux.slideIn(n).then(ux.removeElement),t.querySelector("a.room-info").classList.remove("selected")):(t.insertAdjacentElement("beforeend",ux.getElementFromTemplateResult(ny())),jl.disco.info(e.target.getAttribute("data-room-jid"),null).then((e=>function(e,t){var n,s;e.querySelector("span.spinner").remove(),e.querySelector("a.room-info").classList.add("selected"),e.insertAdjacentHTML("beforeEnd",ux.getElementFromTemplateResult((e=>{const t=Eh("Description:"),n=Eh("Groupchat XMPP Address:"),s=Eh("Participants:"),i=Eh("Features:"),r=Eh("Requires authentication"),o=Eh("Hidden"),a=Eh("Requires an invitation"),c=Eh("Moderated"),l=Eh("Non-anonymous"),d=Eh("Open"),u=Eh("Permanent"),h=Eh("Public"),f=Eh("Semi-anonymous"),m=Eh("Temporary"),g=Eh("Unmoderated");return el `
2021-11-11 22:06:49 +01:00
< div class = "room-info" >
< p class = "room-info" > < strong > $ { n } < / s t r o n g > $ { e . j i d } < / p >
< p class = "room-info" > < strong > $ { t } < / s t r o n g > $ { e . d e s c } < / p >
< p class = "room-info" > < strong > $ { s } < / s t r o n g > $ { e . o c c } < / p >
< p class = "room-info" > < strong > $ { i } < / s t r o n g >
< ul >
2022-01-03 11:54:10 +01:00
$ { e . passwordprotected ? el ` <li class="room-info locked"> ${ r } </li> ` : "" }
$ { e . hidden ? el ` <li class="room-info"> ${ o } </li> ` : "" }
$ { e . membersonly ? el ` <li class="room-info"> ${ a } </li> ` : "" }
$ { e . moderated ? el ` <li class="room-info"> ${ c } </li> ` : "" }
$ { e . nonanonymous ? el ` <li class="room-info"> ${ l } </li> ` : "" }
$ { e . open ? el ` <li class="room-info"> ${ d } </li> ` : "" }
$ { e . persistent ? el ` <li class="room-info"> ${ u } </li> ` : "" }
$ { e . publicroom ? el ` <li class="room-info"> ${ h } </li> ` : "" }
$ { e . semianonymous ? el ` <li class="room-info"> ${ f } </li> ` : "" }
$ { e . temporary ? el ` <li class="room-info"> ${ m } </li> ` : "" }
$ { e . unmoderated ? el ` <li class="room-info"> ${ g } </li> ` : "" }
2021-11-11 22:06:49 +01:00
< / u l >
< / p >
2021-03-19 19:26:15 +01:00
< / d i v >
2022-01-03 11:54:10 +01:00
` })({jid:t.getAttribute("from"),desc:null===(n=ax(dx('field[var="muc#roominfo_description"] value',t)))||void 0===n?void 0:n.textContent,occ:null===(s=ax(dx('field[var="muc#roominfo_occupants"] value',t)))||void 0===s?void 0:s.textContent,hidden:dx('feature[var="muc_hidden"]',t).length,membersonly:dx('feature[var="muc_membersonly"]',t).length,moderated:dx('feature[var="muc_moderated"]',t).length,nonanonymous:dx('feature[var="muc_nonanonymous"]',t).length,open:dx('feature[var="muc_open"]',t).length,passwordprotected:dx('feature[var="muc_passwordprotected"]',t).length,persistent:dx('feature[var="muc_persistent"]',t).length,publicroom:dx('feature[var="muc_publicroom"]',t).length,semianonymous:dx('feature[var="muc_semianonymous"]',t).length,temporary:dx('feature[var="muc_temporary"]',t).length,unmoderated:dx('feature[var="muc_unmoderated"]',t).length})))}(t,e))).catch((e=>M.error(e))))}(e)},onDomainChange(){jl.settings.get("auto_list_rooms")&&this.updateRoomsList()},onRoomsFound(e){this.loading_items=!1;const t=e?dx("query item",e):[];return t.length?(this.model.set({feedback_text:Eh("Groupchats found")},{silent:!0}),this.items=t.map(md)):(this.items=[],this.model.set({feedback_text:Eh("No groupchats found")},{silent:!0})),this.render(),!0},updateRoomsList(){const e=lx({to:this.model.get("muc_domain"),from:wa.connection.jid,type:"get"}).c("query",{xmlns:cx.NS.DISCO_ITEMS});jl.sendIQ(e).then((e=>this.onRoomsFound(e))).catch((()=>this.onRoomsFound()))},showRooms(e){e.preventDefault(),this.loading_items=!0,this.render();const t=new FormData(e.target);this.model.setDomain(t.get("server")),this.updateRoomsList()},setDomainFromEvent(e){this.model.setDomain(e.target.value)},setNick(e){this.model.save({nick:e.target.value})}}),{Strophe:fx,u:mx}= $ l.env;jl.elements.define("converse-rooms-list",class extends Ng{initialize(){const e= ` converse . roomspanel$ { wa . bare _jid } ` ;this.model=new sx({id:e}),_o(this.model,e),this.model.fetch(),this.listenTo(wa.chatboxes,"add",this.renderIfChatRoom),this.listenTo(wa.chatboxes,"remove",this.renderIfChatRoom),this.listenTo(wa.chatboxes,"destroy",this.renderIfChatRoom),this.listenTo(wa.chatboxes,"change",this.renderIfRelevantChange),this.render()}renderIfChatRoom(e){mx.isChatRoom(e)&&this.render()}renderIfRelevantChange(e){const t=["bookmarked","hidden","name","num_unread","num_unread_general","has_activity"],n=e.changed||{};mx.isChatRoom(e)&&Object.keys(n).filter((e=>t.includes(e))).length&&this.render()}render(){il((e=>{const t=Eh("Click to toggle the list of open groupchats"),n=Eh("Groupchats"),s=Eh("Query for groupchats"),i=Eh("Add a new groupchat");return el `
2021-11-11 22:06:49 +01:00
< div class = "d-flex controlbox-padded" >
< span class = "w-100 controlbox-heading controlbox-heading--groupchats" > $ { n } < / s p a n >
< a class = "controlbox-heading__btn show-list-muc-modal"
2022-01-03 11:54:10 +01:00
@ click = $ { t => jl . modal . show ( hx , { model : e . model } , t ) }
2021-11-11 22:06:49 +01:00
title = "${s}" data - toggle = "modal" data - target = "#muc-list-modal" >
< converse - icon class = "fa fa-list-ul right" color = "var(--subdued-color)" path - prefix = "/dist" size = "1em" > < / c o n v e r s e - i c o n >
2021-03-19 19:26:15 +01:00
< / a >
2021-11-11 22:06:49 +01:00
< a class = "controlbox-heading__btn show-add-muc-modal"
2022-01-03 11:54:10 +01:00
@ click = $ { t => jl . modal . show ( ox , { model : e . model } , t ) }
2021-11-11 22:06:49 +01:00
title = "${i}" data - toggle = "modal" data - target = "#add-chatrooms-modal" >
< converse - icon class = "fa fa-plus right" color = "var(--subdued-color)" path - prefix = "/dist" size = "1em" > < / c o n v e r s e - i c o n >
2021-03-19 19:26:15 +01:00
< / a >
< / d i v >
2021-11-11 22:06:49 +01:00
< div class = "list-container list-container--openrooms ${e.rooms.length?" ":" hidden "}" >
< a class = "list-toggle open-rooms-toggle controlbox-padded" title = "${t}" @ click = $ { e . toggleRoomsList } >
2022-01-03 11:54:10 +01:00
< span class = "fa ${e.toggle_state===wa.OPENED?" fa - caret - down ":" fa - caret - right "}" > < / s p a n > $ { E h ( " O p e n G r o u p c h a t s " ) } < / a >
2021-11-11 22:06:49 +01:00
< div class = "items-list rooms-list open-rooms-list ${e.collapsed&&" collapsed "}" >
2022-01-03 11:54:10 +01:00
$ { e . rooms . map ( ( t => ( e => { const t = Eh ( "Leave this groupchat" ) , n = e . room . get ( "num_unread_general" ) || e . room . get ( "has_activity" ) ; return el `
2021-11-11 22:06:49 +01:00
< div class = "list-item controlbox-padded available-chatroom d-flex flex-row ${e.currently_open(e.room)?" open ":" "} ${n?" unread - msgs ":" "}"
2021-03-19 19:26:15 +01:00
data - room - jid = "${e.room.get(" jid ")}" >
2022-01-03 11:54:10 +01:00
$ { e . room . get ( "num_unread" ) ? ( e => el ` <span class="list-item-badge badge badge--muc msgs-indicator"> ${ e . room . get ( "num_unread" ) } </span> ` ) ( e ) : e . room . get ( "has_activity" ) ? el ` <span class="list-item-badge badge badge--muc msgs-indicator"></span> ` : "" }
2021-11-11 22:06:49 +01:00
2021-03-19 19:26:15 +01:00
< a class = "list-item-link open-room available-room w-100"
2021-11-11 22:06:49 +01:00
data - room - jid = "${e.room.get(" jid ")}"
2022-01-03 11:54:10 +01:00
title = "${Eh(" Click to open this groupchat ")}"
2021-11-11 22:06:49 +01:00
@ click = $ { e . openRoom } > $ { e . room . getDisplayName ( ) } < / a >
2021-03-19 19:26:15 +01:00
2022-01-03 11:54:10 +01:00
$ { jl . settings . get ( "allow_bookmarks" ) ? ( e => { const t = Eh ( "Bookmark this groupchat" ) , n = Eh ( "Unbookmark this groupchat" ) ; return e . bookmarked ? el `
2021-03-19 19:26:15 +01:00
< a class = "list-item-action fa fa-bookmark remove-bookmark button-on"
data - room - jid = "${e.room.get(" jid ")}"
data - bookmark - name = "${e.room.getDisplayName()}"
@ click = $ { e . removeBookmark }
2022-01-03 11:54:10 +01:00
title = "${e.bookmarked?n:t}" > < / a > ` : e l `
2021-03-19 19:26:15 +01:00
< a class = "list-item-action fa fa-bookmark add-bookmark"
data - room - jid = "${e.room.get(" jid ")}"
data - bookmark - name = "${e.room.getDisplayName()}"
@ click = $ { e . addBookmark }
title = "${e.bookmarked?n:t}" > < / a > ` } ) ( e ) : " " }
< a class = "list-item-action room-info fa fa-info-circle"
2021-11-11 22:06:49 +01:00
data - room - jid = "${e.room.get(" jid ")}"
2022-01-03 11:54:10 +01:00
title = "${Eh(" Show more information on this groupchat ")}"
2021-11-11 22:06:49 +01:00
@ click = $ { e . showRoomDetailsModal } > < / a >
2021-03-19 19:26:15 +01:00
< a class = "list-item-action fa fa-sign-out-alt close-room"
2021-11-11 22:06:49 +01:00
data - room - jid = "${e.room.get(" jid ")}"
data - room - name = "${e.room.getDisplayName()}"
title = "${t}"
@ click = $ { e . closeRoom } > < / a >
< / d i v > ` } ) ( O b j e c t . a s s i g n ( { r o o m : t } , e ) ) ) ) }
2021-03-19 19:26:15 +01:00
< / d i v >
2022-01-03 11:54:10 +01:00
< / d i v > ` } ) ( { a d d B o o k m a r k : e = > t h i s . a d d B o o k m a r k ( e ) , a l l o w _ b o o k m a r k s : j l . s e t t i n g s . g e t ( " a l l o w _ b o o k m a r k s " ) & & w a . b o o k m a r k s , c l o s e R o o m : e = > t h i s . c l o s e R o o m ( e ) , c o l l a p s e d : t h i s . m o d e l . g e t ( " t o g g l e - s t a t e " ) ! = = w a . O P E N E D , c u r r e n t l y _ o p e n : e = > s a ( ) & & ! e . g e t ( " h i d d e n " ) , m o d e l : t h i s . m o d e l , o p e n R o o m : e = > t h i s . o p e n R o o m ( e ) , r e m o v e B o o k m a r k : e = > t h i s . r e m o v e B o o k m a r k ( e ) , r o o m s : w a . c h a t b o x e s . f i l t e r ( ( e = > e . g e t ( " t y p e " ) = = = w a . C H A T R O O M S _ T Y P E ) ) , s h o w R o o m D e t a i l s M o d a l : e = > t h i s . s h o w R o o m D e t a i l s M o d a l ( e ) , t o g g l e R o o m s L i s t : e = > t h i s . t o g g l e R o o m s L i s t ( e ) , t o g g l e _ s t a t e : t h i s . m o d e l . g e t ( " t o g g l e - s t a t e " ) } ) , t h i s ) } s h o w R o o m D e t a i l s M o d a l ( e ) { c o n s t t = e . t a r g e t . g e t A t t r i b u t e ( " d a t a - r o o m - j i d " ) , n = w a . c h a t b o x e s . g e t ( t ) ; e . p r e v e n t D e f a u l t ( ) , j l . m o d a l . s h o w ( V _ , { m o d e l : n } , e ) } a s y n c o p e n R o o m ( e ) { e . p r e v e n t D e f a u l t ( ) ; c o n s t t = e . t a r g e t . t e x t C o n t e n t , n = e . t a r g e t . g e t A t t r i b u t e ( " d a t a - r o o m - j i d " ) , s = { n a m e : t | | f x . u n e s c a p e N o d e ( f x . g e t N o d e F r o m J i d ( n ) ) | | n } ; a w a i t j l . r o o m s . o p e n ( n , s , ! 0 ) } a s y n c c l o s e R o o m ( e ) { e . p r e v e n t D e f a u l t ( ) ; c o n s t t = e . t a r g e t . g e t A t t r i b u t e ( " d a t a - r o o m - n a m e " ) ; i f ( c o n f i r m ( E h ( " A r e y o u s u r e y o u w a n t t o l e a v e t h e g r o u p c h a t % 1 $ s ? " , t ) ) ) { c o n s t t = e . t a r g e t . g e t A t t r i b u t e ( " d a t a - r o o m - j i d " ) ; ( a w a i t j l . r o o m s . g e t ( t ) ) . c l o s e ( ) } } r e m o v e B o o k m a r k ( e ) { w a . r e m o v e B o o k m a r k V i a E v e n t ( e ) } a d d B o o k m a r k ( e ) { w a . a d d B o o k m a r k V i a E v e n t ( e ) } t o g g l e R o o m s L i s t ( e ) { v a r t ; n u l l = = e | | n u l l = = = ( t = e . p r e v e n t D e f a u l t ) | | v o i d 0 = = = t | | t . c a l l ( e ) ; c o n s t n = e . t a r g e t . m a t c h e s ( " . f a " ) ? e . t a r g e t : e . t a r g e t . q u e r y S e l e c t o r ( " . f a " ) ; n . c l a s s L i s t . c o n t a i n s ( " f a - c a r e t - d o w n " ) ? m x . s l i d e I n ( t h i s . q u e r y S e l e c t o r ( " . o p e n - r o o m s - l i s t " ) ) . t h e n ( ( ( ) = > { t h i s . m o d e l . s a v e ( { " t o g g l e - s t a t e " : w a . C L O S E D } ) , n . c l a s s L i s t . r e m o v e ( " f a - c a r e t - d o w n " ) , n . c l a s s L i s t . a d d ( " f a - c a r e t - r i g h t " ) } ) ) : m x . s l i d e O u t ( t h i s . q u e r y S e l e c t o r ( " . o p e n - r o o m s - l i s t " ) ) . t h e n ( ( ( ) = > { t h i s . m o d e l . s a v e ( { " t o g g l e - s t a t e " : w a . O P E N E D } ) , n . c l a s s L i s t . r e m o v e ( " f a - c a r e t - r i g h t " ) , n . c l a s s L i s t . a d d ( " f a - c a r e t - d o w n " ) } ) ) } } ) , $ l . p l u g i n s . a d d ( " c o n v e r s e - r o o m s l i s t " , { d e p e n d e n c i e s : [ " c o n v e r s e - s i n g l e t o n " , " c o n v e r s e - c o n t r o l b o x " , " c o n v e r s e - m u c " , " c o n v e r s e - b o o k m a r k s " ] , i n i t i a l i z e ( ) { j l . l i s t e n . o n ( " c o n n e c t e d " , ( a s y n c ( ) = > { j l . s e t t i n g s . g e t ( " a l l o w _ b o o k m a r k s " ) ? a w a i t j l . w a i t U n t i l ( " b o o k m a r k s I n i t i a l i z e d " ) : a w a i t P r o m i s e . a l l ( [ j l . w a i t U n t i l ( " c h a t B o x e s F e t c h e d " ) ] ) } ) ) } } ) , w i n d o w . c u s t o m E l e m e n t s . d e f i n e ( " c o n v e r s e - f o n t a w e s o m e " , c l a s s e x t e n d s i g { r e n d e r ( ) { r e t u r n e l `
2021-11-11 22:06:49 +01:00
< ? xml version = "1.0" encoding = "UTF-8" ? >
<!--
Font Awesome Free 5.13 . 0 by @ fontawesome - https : //fontawesome.com
License - https : //fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License)
-- >
< svg xmlns = "http://www.w3.org/2000/svg" style = "display: none;" >
< symbol id = "icon-address-book" viewBox = "0 0 448 512" >
< path d = "M436 160c6.6 0 12-5.4 12-12v-40c0-6.6-5.4-12-12-12h-20V48c0-26.5-21.5-48-48-48H48C21.5 0 0 21.5 0 48v416c0 26.5 21.5 48 48 48h320c26.5 0 48-21.5 48-48v-48h20c6.6 0 12-5.4 12-12v-40c0-6.6-5.4-12-12-12h-20v-64h20c6.6 0 12-5.4 12-12v-40c0-6.6-5.4-12-12-12h-20v-64h20zm-228-32c35.3 0 64 28.7 64 64s-28.7 64-64 64-64-28.7-64-64 28.7-64 64-64zm112 236.8c0 10.6-10 19.2-22.4 19.2H118.4C106 384 96 375.4 96 364.8v-19.2c0-31.8 30.1-57.6 67.2-57.6h5c12.3 5.1 25.7 8 39.8 8s27.6-2.9 39.8-8h5c37.1 0 67.2 25.8 67.2 57.6v19.2z" > < / p a t h >
< / s y m b o l >
< symbol id = "icon-angle-double-down" viewBox = "0 0 320 512" >
< path d = "M143 256.3L7 120.3c-9.4-9.4-9.4-24.6 0-33.9l22.6-22.6c9.4-9.4 24.6-9.4 33.9 0l96.4 96.4 96.4-96.4c9.4-9.4 24.6-9.4 33.9 0L313 86.3c9.4 9.4 9.4 24.6 0 33.9l-136 136c-9.4 9.5-24.6 9.5-34 .1zm34 192l136-136c9.4-9.4 9.4-24.6 0-33.9l-22.6-22.6c-9.4-9.4-24.6-9.4-33.9 0L160 352.1l-96.4-96.4c-9.4-9.4-24.6-9.4-33.9 0L7 278.3c-9.4 9.4-9.4 24.6 0 33.9l136 136c9.4 9.5 24.6 9.5 34 .1z" > < / p a t h >
< / s y m b o l >
< symbol id = "icon-angle-double-left" viewBox = "0 0 448 512" >
< path d = "M223.7 239l136-136c9.4-9.4 24.6-9.4 33.9 0l22.6 22.6c9.4 9.4 9.4 24.6 0 33.9L319.9 256l96.4 96.4c9.4 9.4 9.4 24.6 0 33.9L393.7 409c-9.4 9.4-24.6 9.4-33.9 0l-136-136c-9.5-9.4-9.5-24.6-.1-34zm-192 34l136 136c9.4 9.4 24.6 9.4 33.9 0l22.6-22.6c9.4-9.4 9.4-24.6 0-33.9L127.9 256l96.4-96.4c9.4-9.4 9.4-24.6 0-33.9L201.7 103c-9.4-9.4-24.6-9.4-33.9 0l-136 136c-9.5 9.4-9.5 24.6-.1 34z" > < / p a t h >
< / s y m b o l >
< symbol id = "icon-angle-double-right" viewBox = "0 0 448 512" >
< path d = "M224.3 273l-136 136c-9.4 9.4-24.6 9.4-33.9 0l-22.6-22.6c-9.4-9.4-9.4-24.6 0-33.9l96.4-96.4-96.4-96.4c-9.4-9.4-9.4-24.6 0-33.9L54.3 103c9.4-9.4 24.6-9.4 33.9 0l136 136c9.5 9.4 9.5 24.6.1 34zm192-34l-136-136c-9.4-9.4-24.6-9.4-33.9 0l-22.6 22.6c-9.4 9.4-9.4 24.6 0 33.9l96.4 96.4-96.4 96.4c-9.4 9.4-9.4 24.6 0 33.9l22.6 22.6c9.4 9.4 24.6 9.4 33.9 0l136-136c9.4-9.2 9.4-24.4 0-33.8z" > < / p a t h >
< / s y m b o l >
< symbol id = "icon-angle-double-up" viewBox = "0 0 320 512" >
< path d = "M177 255.7l136 136c9.4 9.4 9.4 24.6 0 33.9l-22.6 22.6c-9.4 9.4-24.6 9.4-33.9 0L160 351.9l-96.4 96.4c-9.4 9.4-24.6 9.4-33.9 0L7 425.7c-9.4-9.4-9.4-24.6 0-33.9l136-136c9.4-9.5 24.6-9.5 34-.1zm-34-192L7 199.7c-9.4 9.4-9.4 24.6 0 33.9l22.6 22.6c9.4 9.4 24.6 9.4 33.9 0l96.4-96.4 96.4 96.4c9.4 9.4 24.6 9.4 33.9 0l22.6-22.6c9.4-9.4 9.4-24.6 0-33.9l-136-136c-9.2-9.4-24.4-9.4-33.8 0z" > < / p a t h >
< / s y m b o l >
< symbol id = "icon-angle-down" viewBox = "0 0 320 512" >
< path d = "M143 352.3L7 216.3c-9.4-9.4-9.4-24.6 0-33.9l22.6-22.6c9.4-9.4 24.6-9.4 33.9 0l96.4 96.4 96.4-96.4c9.4-9.4 24.6-9.4 33.9 0l22.6 22.6c9.4 9.4 9.4 24.6 0 33.9l-136 136c-9.2 9.4-24.4 9.4-33.8 0z" > < / p a t h >
< / s y m b o l >
< symbol id = "icon-angle-left" viewBox = "0 0 256 512" >
< path d = "M31.7 239l136-136c9.4-9.4 24.6-9.4 33.9 0l22.6 22.6c9.4 9.4 9.4 24.6 0 33.9L127.9 256l96.4 96.4c9.4 9.4 9.4 24.6 0 33.9L201.7 409c-9.4 9.4-24.6 9.4-33.9 0l-136-136c-9.5-9.4-9.5-24.6-.1-34z" > < / p a t h >
< / s y m b o l >
< symbol id = "icon-angle-right" viewBox = "0 0 256 512" >
< path d = "M224.3 273l-136 136c-9.4 9.4-24.6 9.4-33.9 0l-22.6-22.6c-9.4-9.4-9.4-24.6 0-33.9l96.4-96.4-96.4-96.4c-9.4-9.4-9.4-24.6 0-33.9L54.3 103c9.4-9.4 24.6-9.4 33.9 0l136 136c9.5 9.4 9.5 24.6.1 34z" > < / p a t h >
< / s y m b o l >
< symbol id = "icon-angle-up" viewBox = "0 0 320 512" >
< path d = "M177 159.7l136 136c9.4 9.4 9.4 24.6 0 33.9l-22.6 22.6c-9.4 9.4-24.6 9.4-33.9 0L160 255.9l-96.4 96.4c-9.4 9.4-24.6 9.4-33.9 0L7 329.7c-9.4-9.4-9.4-24.6 0-33.9l136-136c9.4-9.5 24.6-9.5 34-.1z" > < / p a t h >
< / s y m b o l >
< symbol id = "icon-arrow-alt-circle-down" viewBox = "0 0 512 512" >
< path d = "M504 256c0 137-111 248-248 248S8 393 8 256 119 8 256 8s248 111 248 248zM212 140v116h-70.9c-10.7 0-16.1 13-8.5 20.5l114.9 114.3c4.7 4.7 12.2 4.7 16.9 0l114.9-114.3c7.6-7.6 2.2-20.5-8.5-20.5H300V140c0-6.6-5.4-12-12-12h-64c-6.6 0-12 5.4-12 12z" > < / p a t h >
< / s y m b o l >
< symbol id = "icon-arrow-alt-circle-left" viewBox = "0 0 512 512" >
< path d = "M256 504C119 504 8 393 8 256S119 8 256 8s248 111 248 248-111 248-248 248zm116-292H256v-70.9c0-10.7-13-16.1-20.5-8.5L121.2 247.5c-4.7 4.7-4.7 12.2 0 16.9l114.3 114.9c7.6 7.6 20.5 2.2 20.5-8.5V300h116c6.6 0 12-5.4 12-12v-64c0-6.6-5.4-12-12-12z" > < / p a t h >
< / s y m b o l >
< symbol id = "icon-arrow-alt-circle-right" viewBox = "0 0 512 512" >
< path d = "M256 8c137 0 248 111 248 248S393 504 256 504 8 393 8 256 119 8 256 8zM140 300h116v70.9c0 10.7 13 16.1 20.5 8.5l114.3-114.9c4.7-4.7 4.7-12.2 0-16.9l-114.3-115c-7.6-7.6-20.5-2.2-20.5 8.5V212H140c-6.6 0-12 5.4-12 12v64c0 6.6 5.4 12 12 12z" > < / p a t h >
< / s y m b o l >
< symbol id = "icon-arrow-alt-circle-up" viewBox = "0 0 512 512" >
< path d = "M8 256C8 119 119 8 256 8s248 111 248 248-111 248-248 248S8 393 8 256zm292 116V256h70.9c10.7 0 16.1-13 8.5-20.5L264.5 121.2c-4.7-4.7-12.2-4.7-16.9 0l-115 114.3c-7.6 7.6-2.2 20.5 8.5 20.5H212v116c0 6.6 5.4 12 12 12h64c6.6 0 12-5.4 12-12z" > < / p a t h >
< / s y m b o l >
< symbol id = "icon-arrow-circle-down" viewBox = "0 0 512 512" >
< path d = "M504 256c0 137-111 248-248 248S8 393 8 256 119 8 256 8s248 111 248 248zm-143.6-28.9L288 302.6V120c0-13.3-10.7-24-24-24h-16c-13.3 0-24 10.7-24 24v182.6l-72.4-75.5c-9.3-9.7-24.8-9.9-34.3-.4l-10.9 11c-9.4 9.4-9.4 24.6 0 33.9L239 404.3c9.4 9.4 24.6 9.4 33.9 0l132.7-132.7c9.4-9.4 9.4-24.6 0-33.9l-10.9-11c-9.5-9.5-25-9.3-34.3.4z" > < / p a t h >
< / s y m b o l >
< symbol id = "icon-arrow-circle-left" viewBox = "0 0 512 512" >
< path d = "M256 504C119 504 8 393 8 256S119 8 256 8s248 111 248 248-111 248-248 248zm28.9-143.6L209.4 288H392c13.3 0 24-10.7 24-24v-16c0-13.3-10.7-24-24-24H209.4l75.5-72.4c9.7-9.3 9.9-24.8.4-34.3l-11-10.9c-9.4-9.4-24.6-9.4-33.9 0L107.7 239c-9.4 9.4-9.4 24.6 0 33.9l132.7 132.7c9.4 9.4 24.6 9.4 33.9 0l11-10.9c9.5-9.5 9.3-25-.4-34.3z" > < / p a t h >
< / s y m b o l >
< symbol id = "icon-arrow-circle-right" viewBox = "0 0 512 512" >
< path d = "M256 8c137 0 248 111 248 248S393 504 256 504 8 393 8 256 119 8 256 8zm-28.9 143.6l75.5 72.4H120c-13.3 0-24 10.7-24 24v16c0 13.3 10.7 24 24 24h182.6l-75.5 72.4c-9.7 9.3-9.9 24.8-.4 34.3l11 10.9c9.4 9.4 24.6 9.4 33.9 0L404.3 273c9.4-9.4 9.4-24.6 0-33.9L271.6 106.3c-9.4-9.4-24.6-9.4-33.9 0l-11 10.9c-9.5 9.6-9.3 25.1.4 34.4z" > < / p a t h >
< / s y m b o l >
< symbol id = "icon-arrow-circle-up" viewBox = "0 0 512 512" >
< path d = "M8 256C8 119 119 8 256 8s248 111 248 248-111 248-248 248S8 393 8 256zm143.6 28.9l72.4-75.5V392c0 13.3 10.7 24 24 24h16c13.3 0 24-10.7 24-24V209.4l72.4 75.5c9.3 9.7 24.8 9.9 34.3.4l10.9-11c9.4-9.4 9.4-24.6 0-33.9L273 107.7c-9.4-9.4-24.6-9.4-33.9 0L106.3 240.4c-9.4 9.4-9.4 24.6 0 33.9l10.9 11c9.6 9.5 25.1 9.3 34.4-.4z" > < / p a t h >
< / s y m b o l >
< symbol id = "icon-arrow-down" viewBox = "0 0 448 512" >
< path d = "M413.1 222.5l22.2 22.2c9.4 9.4 9.4 24.6 0 33.9L241 473c-9.4 9.4-24.6 9.4-33.9 0L12.7 278.6c-9.4-9.4-9.4-24.6 0-33.9l22.2-22.2c9.5-9.5 25-9.3 34.3.4L184 343.4V56c0-13.3 10.7-24 24-24h32c13.3 0 24 10.7 24 24v287.4l114.8-120.5c9.3-9.8 24.8-10 34.3-.4z" > < / p a t h >
< / s y m b o l >
< symbol id = "icon-arrow-left" viewBox = "0 0 448 512" >
< path d = "M257.5 445.1l-22.2 22.2c-9.4 9.4-24.6 9.4-33.9 0L7 273c-9.4-9.4-9.4-24.6 0-33.9L201.4 44.7c9.4-9.4 24.6-9.4 33.9 0l22.2 22.2c9.5 9.5 9.3 25-.4 34.3L136.6 216H424c13.3 0 24 10.7 24 24v32c0 13.3-10.7 24-24 24H136.6l120.5 114.8c9.8 9.3 10 24.8.4 34.3z" > < / p a t h >
< / s y m b o l >
< symbol id = "icon-arrow-right" viewBox = "0 0 448 512" >
< path d = "M190.5 66.9l22.2-22.2c9.4-9.4 24.6-9.4 33.9 0L441 239c9.4 9.4 9.4 24.6 0 33.9L246.6 467.3c-9.4 9.4-24.6 9.4-33.9 0l-22.2-22.2c-9.5-9.5-9.3-25 .4-34.3L311.4 296H24c-13.3 0-24-10.7-24-24v-32c0-13.3 10.7-24 24-24h287.4L190.9 101.2c-9.8-9.3-10-24.8-.4-34.3z" > < / p a t h >
< / s y m b o l >
< symbol id = "icon-arrow-up" viewBox = "0 0 448 512" >
< path d = "M34.9 289.5l-22.2-22.2c-9.4-9.4-9.4-24.6 0-33.9L207 39c9.4-9.4 24.6-9.4 33.9 0l194.3 194.3c9.4 9.4 9.4 24.6 0 33.9L413 289.4c-9.5 9.5-25 9.3-34.3-.4L264 168.6V456c0 13.3-10.7 24-24 24h-32c-13.3 0-24-10.7-24-24V168.6L69.2 289.1c-9.3 9.8-24.8 10-34.3.4z" > < / p a t h >
< / s y m b o l >
< symbol id = "icon-arrows-alt" viewBox = "0 0 512 512" >
< path d = "M352.201 425.775l-79.196 79.196c-9.373 9.373-24.568 9.373-33.941 0l-79.196-79.196c-15.119-15.119-4.411-40.971 16.971-40.97h51.162L228 284H127.196v51.162c0 21.382-25.851 32.09-40.971 16.971L7.029 272.937c-9.373-9.373-9.373-24.569 0-33.941L86.225 159.8c15.119-15.119 40.971-4.411 40.971 16.971V228H228V127.196h-51.23c-21.382 0-32.09-25.851-16.971-40.971l79.196-79.196c9.373-9.373 24.568-9.373 33.941 0l79.196 79.196c15.119 15.119 4.411 40.971-16.971 40.971h-51.162V228h100.804v-51.162c0-21.382 25.851-32.09 40.97-16.971l79.196 79.196c9.373 9.373 9.373 24.569 0 33.941L425.773 352.2c-15.119 15.119-40.971 4.411-40.97-16.971V284H284v100.804h51.23c21.382 0 32.09 25.851 16.971 40.971z" > < / p a t h >
< / s y m b o l >
< symbol id = "icon-arrows-alt-h" viewBox = "0 0 512 512" >
< path d = "M377.941 169.941V216H134.059v-46.059c0-21.382-25.851-32.09-40.971-16.971L7.029 239.029c-9.373 9.373-9.373 24.568 0 33.941l86.059 86.059c15.119 15.119 40.971 4.411 40.971-16.971V296h243.882v46.059c0 21.382 25.851 32.09 40.971 16.971l86.059-86.059c9.373-9.373 9.373-24.568 0-33.941l-86.059-86.059c-15.119-15.12-40.971-4.412-40.971 16.97z" > < / p a t h >
< / s y m b o l >
< symbol id = "icon-arrows-alt-v" viewBox = "0 0 256 512" >
< path d = "M214.059 377.941H168V134.059h46.059c21.382 0 32.09-25.851 16.971-40.971L144.971 7.029c-9.373-9.373-24.568-9.373-33.941 0L24.971 93.088c-15.119 15.119-4.411 40.971 16.971 40.971H88v243.882H41.941c-21.382 0-32.09 25.851-16.971 40.971l86.059 86.059c9.373 9.373 24.568 9.373 33.941 0l86.059-86.059c15.12-15.119 4.412-40.971-16.97-40.971z" > < / p a t h >
< / s y m b o l >
< symbol id = "icon-bars" viewBox = "0 0 448 512" >
< path d = "M16 132h416c8.837 0 16-7.163 16-16V76c0-8.837-7.163-16-16-16H16C7.163 60 0 67.163 0 76v40c0 8.837 7.163 16 16 16zm0 160h416c8.837 0 16-7.163 16-16v-40c0-8.837-7.163-16-16-16H16c-8.837 0-16 7.163-16 16v40c0 8.837 7.163 16 16 16zm0 160h416c8.837 0 16-7.163 16-16v-40c0-8.837-7.163-16-16-16H16c-8.837 0-16 7.163-16 16v40c0 8.837 7.163 16 16 16z" > < / p a t h >
< / s y m b o l >
< symbol id = "icon-bookmark" viewBox = "0 0 384 512" >
< path d = "M0 512V48C0 21.49 21.49 0 48 0h288c26.51 0 48 21.49 48 48v464L192 400 0 512z" > < / p a t h >
< / s y m b o l >
< symbol id = "icon-caret-down" viewBox = "0 0 320 512" >
< path d = "M31.3 192h257.3c17.8 0 26.7 21.5 14.1 34.1L174.1 354.8c-7.8 7.8-20.5 7.8-28.3 0L17.2 226.1C4.6 213.5 13.5 192 31.3 192z" > < / p a t h >
< / s y m b o l >
< symbol id = "icon-caret-right" viewBox = "0 0 192 512" >
< path d = "M0 384.662V127.338c0-17.818 21.543-26.741 34.142-14.142l128.662 128.662c7.81 7.81 7.81 20.474 0 28.284L34.142 398.804C21.543 411.404 0 402.48 0 384.662z" > < / p a t h >
< / s y m b o l >
< symbol id = "icon-check" viewBox = "0 0 512 512" >
< path d = "M173.898 439.404l-166.4-166.4c-9.997-9.997-9.997-26.206 0-36.204l36.203-36.204c9.997-9.998 26.207-9.998 36.204 0L192 312.69 432.095 72.596c9.997-9.997 26.207-9.997 36.204 0l36.203 36.204c9.997 9.997 9.997 26.206 0 36.204l-294.4 294.401c-9.998 9.997-26.207 9.997-36.204-.001z" > < / p a t h >
< / s y m b o l >
< symbol id = "icon-circle" viewBox = "0 0 512 512" >
< path d = "M256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8z" > < / p a t h >
< / s y m b o l >
< symbol id = "icon-cog" viewBox = "0 0 512 512" >
< path d = "M487.4 315.7l-42.6-24.6c4.3-23.2 4.3-47 0-70.2l42.6-24.6c4.9-2.8 7.1-8.6 5.5-14-11.1-35.6-30-67.8-54.7-94.6-3.8-4.1-10-5.1-14.8-2.3L380.8 110c-17.9-15.4-38.5-27.3-60.8-35.1V25.8c0-5.6-3.9-10.5-9.4-11.7-36.7-8.2-74.3-7.8-109.2 0-5.5 1.2-9.4 6.1-9.4 11.7V75c-22.2 7.9-42.8 19.8-60.8 35.1L88.7 85.5c-4.9-2.8-11-1.9-14.8 2.3-24.7 26.7-43.6 58.9-54.7 94.6-1.7 5.4.6 11.2 5.5 14L67.3 221c-4.3 23.2-4.3 47 0 70.2l-42.6 24.6c-4.9 2.8-7.1 8.6-5.5 14 11.1 35.6 30 67.8 54.7 94.6 3.8 4.1 10 5.1 14.8 2.3l42.6-24.6c17.9 15.4 38.5 27.3 60.8 35.1v49.2c0 5.6 3.9 10.5 9.4 11.7 36.7 8.2 74.3 7.8 109.2 0 5.5-1.2 9.4-6.1 9.4-11.7v-49.2c22.2-7.9 42.8-19.8 60.8-35.1l42.6 24.6c4.9 2.8 11 1.9 14.8-2.3 24.7-26.7 43.6-58.9 54.7-94.6 1.5-5.5-.7-11.3-5.6-14.1zM256 336c-44.1 0-80-35.9-80-80s35.9-80 80-80 80 35.9 80 80-35.9 80-80 80z" > < / p a t h >
< / s y m b o l >
< symbol id = "icon-database" viewBox = "0 0 448 512" >
< path d = "M448 73.143v45.714C448 159.143 347.667 192 224 192S0 159.143 0 118.857V73.143C0 32.857 100.333 0 224 0s224 32.857 224 73.143zM448 176v102.857C448 319.143 347.667 352 224 352S0 319.143 0 278.857V176c48.125 33.143 136.208 48.572 224 48.572S399.874 209.143 448 176zm0 160v102.857C448 479.143 347.667 512 224 512S0 479.143 0 438.857V336c48.125 33.143 136.208 48.572 224 48.572S399.874 369.143 448 336z" > < / p a t h >
< / s y m b o l >
< symbol id = "icon-edit" viewBox = "0 0 576 512" >
< path d = "M402.6 83.2l90.2 90.2c3.8 3.8 3.8 10 0 13.8L274.4 405.6l-92.8 10.3c-12.4 1.4-22.9-9.1-21.5-21.5l10.3-92.8L388.8 83.2c3.8-3.8 10-3.8 13.8 0zm162-22.9l-48.8-48.8c-15.2-15.2-39.9-15.2-55.2 0l-35.4 35.4c-3.8 3.8-3.8 10 0 13.8l90.2 90.2c3.8 3.8 10 3.8 13.8 0l35.4-35.4c15.2-15.3 15.2-40 0-55.2zM384 346.2V448H64V128h229.8c3.2 0 6.2-1.3 8.5-3.5l40-40c7.6-7.6 2.2-20.5-8.5-20.5H48C21.5 64 0 85.5 0 112v352c0 26.5 21.5 48 48 48h352c26.5 0 48-21.5 48-48V306.2c0-10.7-12.9-16-20.5-8.5l-40 40c-2.2 2.3-3.5 5.3-3.5 8.5z" > < / p a t h >
< / s y m b o l >
< symbol id = "icon-eye" viewBox = "0 0 576 512" >
< path d = "M572.52 241.4C518.29 135.59 410.93 64 288 64S57.68 135.64 3.48 241.41a32.35 32.35 0 0 0 0 29.19C57.71 376.41 165.07 448 288 448s230.32-71.64 284.52-177.41a32.35 32.35 0 0 0 0-29.19zM288 400a144 144 0 1 1 144-144 143.93 143.93 0 0 1-144 144zm0-240a95.31 95.31 0 0 0-25.31 3.79 47.85 47.85 0 0 1-66.9 66.9A95.78 95.78 0 1 0 288 160z" > < / p a t h >
< / s y m b o l >
< symbol id = "icon-eye-slash" viewBox = "0 0 640 512" >
< path d = "M320 400c-75.85 0-137.25-58.71-142.9-133.11L72.2 185.82c-13.79 17.3-26.48 35.59-36.72 55.59a32.35 32.35 0 0 0 0 29.19C89.71 376.41 197.07 448 320 448c26.91 0 52.87-4 77.89-10.46L346 397.39a144.13 144.13 0 0 1-26 2.61zm313.82 58.1l-110.55-85.44a331.25 331.25 0 0 0 81.25-102.07 32.35 32.35 0 0 0 0-29.19C550.29 135.59 442.93 64 320 64a308.15 308.15 0 0 0-147.32 37.7L45.46 3.37A16 16 0 0 0 23 6.18L3.37 31.45A16 16 0 0 0 6.18 53.9l588.36 454.73a16 16 0 0 0 22.46-2.81l19.64-25.27a16 16 0 0 0-2.82-22.45zm-183.72-142l-39.3-30.38A94.75 94.75 0 0 0 416 256a94.76 94.76 0 0 0-121.31-92.21A47.65 47.65 0 0 1 304 192a46.64 46.64 0 0 1-1.54 10l-73.61-56.89A142.31 142.31 0 0 1 320 112a143.92 143.92 0 0 1 144 144c0 21.63-5.29 41.79-13.9 60.11z" > < / p a t h >
< / s y m b o l >
< symbol id = "icon-gavel" viewBox = "0 0 512 512" >
< path d = "M504.971 199.362l-22.627-22.627c-9.373-9.373-24.569-9.373-33.941 0l-5.657 5.657L329.608 69.255l5.657-5.657c9.373-9.373 9.373-24.569 0-33.941L312.638 7.029c-9.373-9.373-24.569-9.373-33.941 0L154.246 131.48c-9.373 9.373-9.373 24.569 0 33.941l22.627 22.627c9.373 9.373 24.569 9.373 33.941 0l5.657-5.657 39.598 39.598-81.04 81.04-5.657-5.657c-12.497-12.497-32.758-12.497-45.255 0L9.373 412.118c-12.497 12.497-12.497 32.758 0 45.255l45.255 45.255c12.497 12.497 32.758 12.497 45.255 0l114.745-114.745c12.497-12.497 12.497-32.758 0-45.255l-5.657-5.657 81.04-81.04 39.598 39.598-5.657 5.657c-9.373 9.373-9.373 24.569 0 33.941l22.627 22.627c9.373 9.373 24.569 9.373 33.941 0l124.451-124.451c9.372-9.372 9.372-24.568 0-33.941z" > < / p a t h >
< / s y m b o l >
< symbol id = "icon-globe" viewBox = "0 0 496 512" >
< path d = "M336.5 160C322 70.7 287.8 8 248 8s-74 62.7-88.5 152h177zM152 256c0 22.2 1.2 43.5 3.3 64h185.3c2.1-20.5 3.3-41.8 3.3-64s-1.2-43.5-3.3-64H155.3c-2.1 20.5-3.3 41.8-3.3 64zm324.7-96c-28.6-67.9-86.5-120.4-158-141.6 24.4 33.8 41.2 84.7 50 141.6h108zM177.2 18.4C105.8 39.6 47.8 92.1 19.3 160h108c8.7-56.9 25.5-107.8 49.9-141.6zM487.4 192H372.7c2.1 21 3.3 42.5 3.3 64s-1.2 43-3.3 64h114.6c5.5-20.5 8.6-41.8 8.6-64s-3.1-43.5-8.5-64zM120 256c0-21.5 1.2-43 3.3-64H8.6C3.2 212.5 0 233.8 0 256s3.2 43.5 8.6 64h114.6c-2-21-3.2-42.5-3.2-64zm39.5 96c14.5 89.3 48.7 152 88.5 152s74-62.7 88.5-152h-177zm159.3 141.6c71.4-21.2 129.4-73.7 158-141.6h-108c-8.8 56.9-25.6 107.8-50 141.6zM19.3 352c28.6 67.9 86.5 120.4 158 141.6-24.4-33.8-41.2-84.7-50-141.6h-108z" > < / p a t h >
< / s y m b o l >
< symbol id = "icon-id-card" viewBox = "0 0 576 512" >
< path d = "M528 32H48C21.5 32 0 53.5 0 80v16h576V80c0-26.5-21.5-48-48-48zM0 432c0 26.5 21.5 48 48 48h480c26.5 0 48-21.5 48-48V128H0v304zm352-232c0-4.4 3.6-8 8-8h144c4.4 0 8 3.6 8 8v16c0 4.4-3.6 8-8 8H360c-4.4 0-8-3.6-8-8v-16zm0 64c0-4.4 3.6-8 8-8h144c4.4 0 8 3.6 8 8v16c0 4.4-3.6 8-8 8H360c-4.4 0-8-3.6-8-8v-16zm0 64c0-4.4 3.6-8 8-8h144c4.4 0 8 3.6 8 8v16c0 4.4-3.6 8-8 8H360c-4.4 0-8-3.6-8-8v-16zM176 192c35.3 0 64 28.7 64 64s-28.7 64-64 64-64-28.7-64-64 28.7-64 64-64zM67.1 396.2C75.5 370.5 99.6 352 128 352h8.2c12.3 5.1 25.7 8 39.8 8s27.6-2.9 39.8-8h8.2c28.4 0 52.5 18.5 60.9 44.2 3.2 9.9-5.2 19.8-15.6 19.8H82.7c-10.4 0-18.8-10-15.6-19.8z" > < / p a t h >
< / s y m b o l >
< symbol id = "icon-id-card-alt" viewBox = "0 0 576 512" >
< path d = "M528 64H384v96H192V64H48C21.5 64 0 85.5 0 112v352c0 26.5 21.5 48 48 48h480c26.5 0 48-21.5 48-48V112c0-26.5-21.5-48-48-48zM288 224c35.3 0 64 28.7 64 64s-28.7 64-64 64-64-28.7-64-64 28.7-64 64-64zm93.3 224H194.7c-10.4 0-18.8-10-15.6-19.8 8.3-25.6 32.4-44.2 60.9-44.2h8.2c12.3 5.1 25.7 8 39.8 8s27.6-2.9 39.8-8h8.2c28.4 0 52.5 18.5 60.9 44.2 3.2 9.8-5.2 19.8-15.6 19.8zM352 32c0-17.7-14.3-32-32-32h-64c-17.7 0-32 14.3-32 32v96h128V32z" > < / p a t h >
< / s y m b o l >
< symbol id = "icon-info" viewBox = "0 0 192 512" >
< path d = "M20 424.229h20V279.771H20c-11.046 0-20-8.954-20-20V212c0-11.046 8.954-20 20-20h112c11.046 0 20 8.954 20 20v212.229h20c11.046 0 20 8.954 20 20V492c0 11.046-8.954 20-20 20H20c-11.046 0-20-8.954-20-20v-47.771c0-11.046 8.954-20 20-20zM96 0C56.235 0 24 32.235 24 72s32.235 72 72 72 72-32.235 72-72S135.764 0 96 0z" > < / p a t h >
< / s y m b o l >
< symbol id = "icon-info-circle" viewBox = "0 0 512 512" >
< path d = "M256 8C119.043 8 8 119.083 8 256c0 136.997 111.043 248 248 248s248-111.003 248-248C504 119.083 392.957 8 256 8zm0 110c23.196 0 42 18.804 42 42s-18.804 42-42 42-42-18.804-42-42 18.804-42 42-42zm56 254c0 6.627-5.373 12-12 12h-88c-6.627 0-12-5.373-12-12v-24c0-6.627 5.373-12 12-12h12v-64h-12c-6.627 0-12-5.373-12-12v-24c0-6.627 5.373-12 12-12h64c6.627 0 12 5.373 12 12v100h12c6.627 0 12 5.373 12 12v24z" > < / p a t h >
< / s y m b o l >
< symbol id = "icon-list-ul" viewBox = "0 0 512 512" >
< path d = "M48 48a48 48 0 1 0 48 48 48 48 0 0 0-48-48zm0 160a48 48 0 1 0 48 48 48 48 0 0 0-48-48zm0 160a48 48 0 1 0 48 48 48 48 0 0 0-48-48zm448 16H176a16 16 0 0 0-16 16v32a16 16 0 0 0 16 16h320a16 16 0 0 0 16-16v-32a16 16 0 0 0-16-16zm0-320H176a16 16 0 0 0-16 16v32a16 16 0 0 0 16 16h320a16 16 0 0 0 16-16V80a16 16 0 0 0-16-16zm0 160H176a16 16 0 0 0-16 16v32a16 16 0 0 0 16 16h320a16 16 0 0 0 16-16v-32a16 16 0 0 0-16-16z" > < / p a t h >
< / s y m b o l >
< symbol id = "icon-lock" viewBox = "0 0 448 512" >
< path d = "M400 224h-24v-72C376 68.2 307.8 0 224 0S72 68.2 72 152v72H48c-26.5 0-48 21.5-48 48v192c0 26.5 21.5 48 48 48h352c26.5 0 48-21.5 48-48V272c0-26.5-21.5-48-48-48zm-104 0H152v-72c0-39.7 32.3-72 72-72s72 32.3 72 72v72z" > < / p a t h >
< / s y m b o l >
< symbol id = "icon-lock-open" viewBox = "0 0 576 512" >
< path d = "M423.5 0C339.5.3 272 69.5 272 153.5V224H48c-26.5 0-48 21.5-48 48v192c0 26.5 21.5 48 48 48h352c26.5 0 48-21.5 48-48V272c0-26.5-21.5-48-48-48h-48v-71.1c0-39.6 31.7-72.5 71.3-72.9 40-.4 72.7 32.1 72.7 72v80c0 13.3 10.7 24 24 24h32c13.3 0 24-10.7 24-24v-80C576 68 507.5-.3 423.5 0z" > < / p a t h >
< / s y m b o l >
< symbol id = "icon-minus" viewBox = "0 0 448 512" >
< path d = "M416 208H32c-17.67 0-32 14.33-32 32v32c0 17.67 14.33 32 32 32h384c17.67 0 32-14.33 32-32v-32c0-17.67-14.33-32-32-32z" > < / p a t h >
< / s y m b o l >
< symbol id = "icon-minus-circle" viewBox = "0 0 512 512" >
< path d = "M256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8zM124 296c-6.6 0-12-5.4-12-12v-56c0-6.6 5.4-12 12-12h264c6.6 0 12 5.4 12 12v56c0 6.6-5.4 12-12 12H124z" > < / p a t h >
< / s y m b o l >
< symbol id = "icon-minus-square" viewBox = "0 0 448 512" >
< path d = "M400 32H48C21.5 32 0 53.5 0 80v352c0 26.5 21.5 48 48 48h352c26.5 0 48-21.5 48-48V80c0-26.5-21.5-48-48-48zM92 296c-6.6 0-12-5.4-12-12v-56c0-6.6 5.4-12 12-12h264c6.6 0 12 5.4 12 12v56c0 6.6-5.4 12-12 12H92z" > < / p a t h >
< / s y m b o l >
< symbol id = "icon-paper-plane" viewBox = "0 0 512 512" >
< path d = "M476 3.2L12.5 270.6c-18.1 10.4-15.8 35.6 2.2 43.2L121 358.4l287.3-253.2c5.5-4.9 13.3 2.6 8.6 8.3L176 407v80.5c0 23.6 28.5 32.9 42.5 15.8L282 426l124.6 52.2c14.2 6 30.4-2.9 33-18.2l72-432C515 7.8 493.3-6.8 476 3.2z" > < / p a t h >
< / s y m b o l >
< symbol id = "icon-paperclip" viewBox = "0 0 448 512" >
< path d = "M43.246 466.142c-58.43-60.289-57.341-157.511 1.386-217.581L254.392 34c44.316-45.332 116.351-45.336 160.671 0 43.89 44.894 43.943 117.329 0 162.276L232.214 383.128c-29.855 30.537-78.633 30.111-107.982-.998-28.275-29.97-27.368-77.473 1.452-106.953l143.743-146.835c6.182-6.314 16.312-6.422 22.626-.241l22.861 22.379c6.315 6.182 6.422 16.312.241 22.626L171.427 319.927c-4.932 5.045-5.236 13.428-.648 18.292 4.372 4.634 11.245 4.711 15.688.165l182.849-186.851c19.613-20.062 19.613-52.725-.011-72.798-19.189-19.627-49.957-19.637-69.154 0L90.39 293.295c-34.763 35.56-35.299 93.12-1.191 128.313 34.01 35.093 88.985 35.137 123.058.286l172.06-175.999c6.177-6.319 16.307-6.433 22.626-.256l22.877 22.364c6.319 6.177 6.434 16.307.256 22.626l-172.06 175.998c-59.576 60.938-155.943 60.216-214.77-.485z" > < / p a t h >
< / s y m b o l >
< symbol id = "icon-pencil-alt" viewBox = "0 0 512 512" >
< path d = "M497.9 142.1l-46.1 46.1c-4.7 4.7-12.3 4.7-17 0l-111-111c-4.7-4.7-4.7-12.3 0-17l46.1-46.1c18.7-18.7 49.1-18.7 67.9 0l60.1 60.1c18.8 18.7 18.8 49.1 0 67.9zM284.2 99.8L21.6 362.4.4 483.9c-2.9 16.4 11.4 30.6 27.8 27.8l121.5-21.3 262.6-262.6c4.7-4.7 4.7-12.3 0-17l-111-111c-4.8-4.7-12.4-4.7-17.1 0zM124.1 339.9c-5.5-5.5-5.5-14.3 0-19.8l154-154c5.5-5.5 14.3-5.5 19.8 0s5.5 14.3 0 19.8l-154 154c-5.5 5.5-14.3 5.5-19.8 0zM88 424h48v36.3l-64.5 11.3-31.1-31.1L51.7 376H88v48z" > < / p a t h >
< / s y m b o l >
< symbol id = "icon-phone" viewBox = "0 0 512 512" >
< path d = "M493.4 24.6l-104-24c-11.3-2.6-22.9 3.3-27.5 13.9l-48 112c-4.2 9.8-1.4 21.3 6.9 28l60.6 49.6c-36 76.7-98.9 140.5-177.2 177.2l-49.6-60.6c-6.8-8.3-18.2-11.1-28-6.9l-112 48C3.9 366.5-2 378.1.6 389.4l24 104C27.1 504.2 36.7 512 48 512c256.1 0 464-207.5 464-464 0-11.2-7.7-20.9-18.6-23.4z" > < / p a t h >
< / s y m b o l >
< symbol id = "icon-plus" viewBox = "0 0 448 512" >
< path d = "M416 208H272V64c0-17.67-14.33-32-32-32h-32c-17.67 0-32 14.33-32 32v144H32c-17.67 0-32 14.33-32 32v32c0 17.67 14.33 32 32 32h144v144c0 17.67 14.33 32 32 32h32c17.67 0 32-14.33 32-32V304h144c17.67 0 32-14.33 32-32v-32c0-17.67-14.33-32-32-32z" > < / p a t h >
< / s y m b o l >
< symbol id = "icon-plus-circle" viewBox = "0 0 512 512" >
< path d = "M256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8zm144 276c0 6.6-5.4 12-12 12h-92v92c0 6.6-5.4 12-12 12h-56c-6.6 0-12-5.4-12-12v-92h-92c-6.6 0-12-5.4-12-12v-56c0-6.6 5.4-12 12-12h92v-92c0-6.6 5.4-12 12-12h56c6.6 0 12 5.4 12 12v92h92c6.6 0 12 5.4 12 12v56z" > < / p a t h >
< / s y m b o l >
< symbol id = "icon-plus-square" viewBox = "0 0 448 512" >
< path d = "M400 32H48C21.5 32 0 53.5 0 80v352c0 26.5 21.5 48 48 48h352c26.5 0 48-21.5 48-48V80c0-26.5-21.5-48-48-48zm-32 252c0 6.6-5.4 12-12 12h-92v92c0 6.6-5.4 12-12 12h-56c-6.6 0-12-5.4-12-12v-92H92c-6.6 0-12-5.4-12-12v-56c0-6.6 5.4-12 12-12h92v-92c0-6.6 5.4-12 12-12h56c6.6 0 12 5.4 12 12v92h92c6.6 0 12 5.4 12 12v56z" > < / p a t h >
< / s y m b o l >
< symbol id = "icon-save" viewBox = "0 0 448 512" >
< path d = "M433.941 129.941l-83.882-83.882A48 48 0 0 0 316.118 32H48C21.49 32 0 53.49 0 80v352c0 26.51 21.49 48 48 48h352c26.51 0 48-21.49 48-48V163.882a48 48 0 0 0-14.059-33.941zM224 416c-35.346 0-64-28.654-64-64 0-35.346 28.654-64 64-64s64 28.654 64 64c0 35.346-28.654 64-64 64zm96-304.52V212c0 6.627-5.373 12-12 12H76c-6.627 0-12-5.373-12-12V108c0-6.627 5.373-12 12-12h228.52c3.183 0 6.235 1.264 8.485 3.515l3.48 3.48A11.996 11.996 0 0 1 320 111.48z" > < / p a t h >
< / s y m b o l >
< symbol id = "icon-sign-out-alt" viewBox = "0 0 512 512" >
< path d = "M497 273L329 441c-15 15-41 4.5-41-17v-96H152c-13.3 0-24-10.7-24-24v-96c0-13.3 10.7-24 24-24h136V88c0-21.4 25.9-32 41-17l168 168c9.3 9.4 9.3 24.6 0 34zM192 436v-40c0-6.6-5.4-12-12-12H96c-17.7 0-32-14.3-32-32V160c0-17.7 14.3-32 32-32h84c6.6 0 12-5.4 12-12V76c0-6.6-5.4-12-12-12H96c-53 0-96 43-96 96v192c0 53 43 96 96 96h84c6.6 0 12-5.4 12-12z" > < / p a t h >
< / s y m b o l >
< symbol id = "icon-smile" viewBox = "0 0 496 512" >
< path d = "M248 8C111 8 0 119 0 256s111 248 248 248 248-111 248-248S385 8 248 8zm80 168c17.7 0 32 14.3 32 32s-14.3 32-32 32-32-14.3-32-32 14.3-32 32-32zm-160 0c17.7 0 32 14.3 32 32s-14.3 32-32 32-32-14.3-32-32 14.3-32 32-32zm194.8 170.2C334.3 380.4 292.5 400 248 400s-86.3-19.6-114.8-53.8c-13.6-16.3 11-36.7 24.6-20.5 22.4 26.9 55.2 42.2 90.2 42.2s67.8-15.4 90.2-42.2c13.4-16.2 38.1 4.2 24.6 20.5z" > < / p a t h >
< / s y m b o l >
< symbol id = "icon-snowflake" viewBox = "0 0 448 512" >
< path d = "M440.3 345.2l-33.8-19.5 26-7c8.2-2.2 13.1-10.7 10.9-18.9l-4-14.9c-2.2-8.2-10.7-13.1-18.9-10.9l-70.8 19-63.9-37 63.8-36.9 70.8 19c8.2 2.2 16.7-2.7 18.9-10.9l4-14.9c2.2-8.2-2.7-16.7-10.9-18.9l-26-7 33.8-19.5c7.4-4.3 9.9-13.7 5.7-21.1L430.4 119c-4.3-7.4-13.7-9.9-21.1-5.7l-33.8 19.5 7-26c2.2-8.2-2.7-16.7-10.9-18.9l-14.9-4c-8.2-2.2-16.7 2.7-18.9 10.9l-19 70.8-62.8 36.2v-77.5l53.7-53.7c6.2-6.2 6.2-16.4 0-22.6l-11.3-11.3c-6.2-6.2-16.4-6.2-22.6 0L256 56.4V16c0-8.8-7.2-16-16-16h-32c-8.8 0-16 7.2-16 16v40.4l-19.7-19.7c-6.2-6.2-16.4-6.2-22.6 0L138.3 48c-6.3 6.2-6.3 16.4 0 22.6l53.7 53.7v77.5l-62.8-36.2-19-70.8c-2.2-8.2-10.7-13.1-18.9-10.9l-14.9 4c-8.2 2.2-13.1 10.7-10.9 18.9l7 26-33.8-19.5c-7.4-4.3-16.8-1.7-21.1 5.7L2.1 145.7c-4.3 7.4-1.7 16.8 5.7 21.1l33.8 19.5-26 7c-8.3 2.2-13.2 10.7-11 19l4 14.9c2.2 8.2 10.7 13.1 18.9 10.9l70.8-19 63.8 36.9-63.8 36.9-70.8-19c-8.2-2.2-16.7 2.7-18.9 10.9l-4 14.9c-2.2 8.2 2.7 16.7 10.9 18.9l26 7-33.8 19.6c-7.4 4.3-9.9 13.7-5.7 21.1l15.5 26.8c4.3 7.4 13.7 9.9 21.1 5.7l33.8-19.5-7 26c-2.2 8.2 2.7 16.7 10.9 18.9l14.9 4c8.2 2.2 16.7-2.7 18.9-10.9l19-70.8 62.8-36.2v77.5l-53.7 53.7c-6.3 6.2-6.3 16.4 0 22.6l11.3 11.3c6.2 6.2 16.4 6.2 22.6 0l19.7-19.7V496c0 8.8 7.2 16 16 16h32c8.8 0 16-7.2 16-16v-40.4l19.7 19.7c6.2 6.2 16.4 6.2 22.6 0l11.3-11.3c6.2-6.2 6.2-16.4 0-22.6L256 387.7v-77.5l62.8 36.2 19 70.8c2.2 8.2 10.7 13.1 18.9 10.9l14.9-4c8.2-2.2 13.1-10.7 10.9-18.9l-7-26 33.8 19.5c7.4 4.3 16.8 1.7 21.1-5.7l15.5-26.8c4.3-7.3 1.8-16.8-5.6-21z" > < / p a t h >
< / s y m b o l >
< symbol id = "icon-spinner" viewBox = "0 0 512 512" >
< path d = "M304 48c0 26.51-21.49 48-48 48s-48-21.49-48-48 21.49-48 48-48 48 21.49 48 48zm-48 368c-26.51 0-48 21.49-48 48s21.49 48 48 48 48-21.49 48-48-21.49-48-48-48zm208-208c-26.51 0-48 21.49-48 48s21.49 48 48 48 48-21.49 48-48-21.49-48-48-48zM96 256c0-26.51-21.49-48-48-48S0 229.49 0 256s21.49 48 48 48 48-21.49 48-48zm12.922 99.078c-26.51 0-48 21.49-48 48s21.49 48 48 48 48-21.49 48-48c0-26.509-21.491-48-48-48zm294.156 0c-26.51 0-48 21.49-48 48s21.49 48 48 48 48-21.49 48-48c0-26.509-21.49-48-48-48zM108.922 60.922c-26.51 0-48 21.49-48 48s21.49 48 48 48 48-21.49 48-48-21.491-48-48-48z" > < / p a t h >
< / s y m b o l >
< symbol id = "icon-sync" viewBox = "0 0 512 512" >
< path d = "M440.65 12.57l4 82.77A247.16 247.16 0 0 0 255.83 8C134.73 8 33.91 94.92 12.29 209.82A12 12 0 0 0 24.09 224h49.05a12 12 0 0 0 11.67-9.26 175.91 175.91 0 0 1 317-56.94l-101.46-4.86a12 12 0 0 0-12.57 12v47.41a12 12 0 0 0 12 12H500a12 12 0 0 0 12-12V12a12 12 0 0 0-12-12h-47.37a12 12 0 0 0-11.98 12.57zM255.83 432a175.61 175.61 0 0 1-146-77.8l101.8 4.87a12 12 0 0 0 12.57-12v-47.4a12 12 0 0 0-12-12H12a12 12 0 0 0-12 12V500a12 12 0 0 0 12 12h47.35a12 12 0 0 0 12-12.6l-4.15-82.57A247.17 247.17 0 0 0 255.83 504c121.11 0 221.93-86.92 243.55-201.82a12 12 0 0 0-11.8-14.18h-49.05a12 12 0 0 0-11.67 9.26A175.86 175.86 0 0 1 255.83 432z" > < / p a t h >
< / s y m b o l >
< symbol id = "icon-times" viewBox = "0 0 352 512" >
< path d = "M242.72 256l100.07-100.07c12.28-12.28 12.28-32.19 0-44.48l-22.24-22.24c-12.28-12.28-32.19-12.28-44.48 0L176 189.28 75.93 89.21c-12.28-12.28-32.19-12.28-44.48 0L9.21 111.45c-12.28 12.28-12.28 32.19 0 44.48L109.28 256 9.21 356.07c-12.28 12.28-12.28 32.19 0 44.48l22.24 22.24c12.28 12.28 32.2 12.28 44.48 0L176 322.72l100.07 100.07c12.28 12.28 32.2 12.28 44.48 0l22.24-22.24c12.28-12.28 12.28-32.19 0-44.48L242.72 256z" > < / p a t h >
< / s y m b o l >
< symbol id = "icon-times-circle" viewBox = "0 0 512 512" >
< path d = "M256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8zm121.6 313.1c4.7 4.7 4.7 12.3 0 17L338 377.6c-4.7 4.7-12.3 4.7-17 0L256 312l-65.1 65.6c-4.7 4.7-12.3 4.7-17 0L134.4 338c-4.7-4.7-4.7-12.3 0-17l65.6-65-65.6-65.1c-4.7-4.7-4.7-12.3 0-17l39.6-39.6c4.7-4.7 12.3-4.7 17 0l65 65.7 65.1-65.6c4.7-4.7 12.3-4.7 17 0l39.6 39.6c4.7 4.7 4.7 12.3 0 17L312 256l65.6 65.1z" > < / p a t h >
< / s y m b o l >
< symbol id = "icon-trash" viewBox = "0 0 448 512" >
< path d = "M432 32H312l-9.4-18.7A24 24 0 0 0 281.1 0H166.8a23.72 23.72 0 0 0-21.4 13.3L136 32H16A16 16 0 0 0 0 48v32a16 16 0 0 0 16 16h416a16 16 0 0 0 16-16V48a16 16 0 0 0-16-16zM53.2 467a48 48 0 0 0 47.9 45h245.8a48 48 0 0 0 47.9-45L416 128H32z" > < / p a t h >
< / s y m b o l >
< symbol id = "icon-trash-alt" viewBox = "0 0 448 512" >
< path d = "M32 464a48 48 0 0 0 48 48h288a48 48 0 0 0 48-48V128H32zm272-256a16 16 0 0 1 32 0v224a16 16 0 0 1-32 0zm-96 0a16 16 0 0 1 32 0v224a16 16 0 0 1-32 0zm-96 0a16 16 0 0 1 32 0v224a16 16 0 0 1-32 0zM432 32H312l-9.4-18.7A24 24 0 0 0 281.1 0H166.8a23.72 23.72 0 0 0-21.4 13.3L136 32H16A16 16 0 0 0 0 48v32a16 16 0 0 0 16 16h416a16 16 0 0 0 16-16V48a16 16 0 0 0-16-16z" > < / p a t h >
< / s y m b o l >
< symbol id = "icon-unlock" viewBox = "0 0 448 512" >
< path d = "M400 256H152V152.9c0-39.6 31.7-72.5 71.3-72.9 40-.4 72.7 32.1 72.7 72v16c0 13.3 10.7 24 24 24h32c13.3 0 24-10.7 24-24v-16C376 68 307.5-.3 223.5 0 139.5.3 72 69.5 72 153.5V256H48c-26.5 0-48 21.5-48 48v160c0 26.5 21.5 48 48 48h352c26.5 0 48-21.5 48-48V304c0-26.5-21.5-48-48-48z" > < / p a t h >
< / s y m b o l >
< symbol id = "icon-user" viewBox = "0 0 448 512" >
< path d = "M224 256c70.7 0 128-57.3 128-128S294.7 0 224 0 96 57.3 96 128s57.3 128 128 128zm89.6 32h-16.7c-22.2 10.2-46.9 16-72.9 16s-50.6-5.8-72.9-16h-16.7C60.2 288 0 348.2 0 422.4V464c0 26.5 21.5 48 48 48h352c26.5 0 48-21.5 48-48v-41.6c0-74.2-60.2-134.4-134.4-134.4z" > < / p a t h >
< / s y m b o l >
< symbol id = "icon-user-cog" viewBox = "0 0 640 512" >
< path d = "M610.5 373.3c2.6-14.1 2.6-28.5 0-42.6l25.8-14.9c3-1.7 4.3-5.2 3.3-8.5-6.7-21.6-18.2-41.2-33.2-57.4-2.3-2.5-6-3.1-9-1.4l-25.8 14.9c-10.9-9.3-23.4-16.5-36.9-21.3v-29.8c0-3.4-2.4-6.4-5.7-7.1-22.3-5-45-4.8-66.2 0-3.3.7-5.7 3.7-5.7 7.1v29.8c-13.5 4.8-26 12-36.9 21.3l-25.8-14.9c-2.9-1.7-6.7-1.1-9 1.4-15 16.2-26.5 35.8-33.2 57.4-1 3.3.4 6.8 3.3 8.5l25.8 14.9c-2.6 14.1-2.6 28.5 0 42.6l-25.8 14.9c-3 1.7-4.3 5.2-3.3 8.5 6.7 21.6 18.2 41.1 33.2 57.4 2.3 2.5 6 3.1 9 1.4l25.8-14.9c10.9 9.3 23.4 16.5 36.9 21.3v29.8c0 3.4 2.4 6.4 5.7 7.1 22.3 5 45 4.8 66.2 0 3.3-.7 5.7-3.7 5.7-7.1v-29.8c13.5-4.8 26-12 36.9-21.3l25.8 14.9c2.9 1.7 6.7 1.1 9-1.4 15-16.2 26.5-35.8 33.2-57.4 1-3.3-.4-6.8-3.3-8.5l-25.8-14.9zM496 400.5c-26.8 0-48.5-21.8-48.5-48.5s21.8-48.5 48.5-48.5 48.5 21.8 48.5 48.5-21.7 48.5-48.5 48.5zM224 256c70.7 0 128-57.3 128-128S294.7 0 224 0 96 57.3 96 128s57.3 128 128 128zm201.2 226.5c-2.3-1.2-4.6-2.6-6.8-3.9l-7.9 4.6c-6 3.4-12.8 5.3-19.6 5.3-10.9 0-21.4-4.6-28.9-12.6-18.3-19.8-32.3-43.9-40.2-69.6-5.5-17.7 1.9-36.4 17.9-45.7l7.9-4.6c-.1-2.6-.1-5.2 0-7.8l-7.9-4.6c-16-9.2-23.4-28-17.9-45.7.9-2.9 2.2-5.8 3.2-8.7-3.8-.3-7.5-1.2-11.4-1.2h-16.7c-22.2 10.2-46.9 16-72.9 16s-50.6-5.8-72.9-16h-16.7C60.2 288 0 348.2 0 422.4V464c0 26.5 21.5 48 48 48h352c10.1 0 19.5-3.2 27.2-8.5-1.2-3.8-2-7.7-2-11.8v-9.2z" > < / p a t h >
< / s y m b o l >
< symbol id = "icon-user-plus" viewBox = "0 0 640 512" >
< path d = "M624 208h-64v-64c0-8.8-7.2-16-16-16h-32c-8.8 0-16 7.2-16 16v64h-64c-8.8 0-16 7.2-16 16v32c0 8.8 7.2 16 16 16h64v64c0 8.8 7.2 16 16 16h32c8.8 0 16-7.2 16-16v-64h64c8.8 0 16-7.2 16-16v-32c0-8.8-7.2-16-16-16zm-400 48c70.7 0 128-57.3 128-128S294.7 0 224 0 96 57.3 96 128s57.3 128 128 128zm89.6 32h-16.7c-22.2 10.2-46.9 16-72.9 16s-50.6-5.8-72.9-16h-16.7C60.2 288 0 348.2 0 422.4V464c0 26.5 21.5 48 48 48h352c26.5 0 48-21.5 48-48v-41.6c0-74.2-60.2-134.4-134.4-134.4z" > < / p a t h >
< / s y m b o l >
< symbol id = "icon-user-secret" viewBox = "0 0 448 512" >
< path d = "M383.9 308.3l23.9-62.6c4-10.5-3.7-21.7-15-21.7h-58.5c11-18.9 17.8-40.6 17.8-64v-.3c39.2-7.8 64-19.1 64-31.7 0-13.3-27.3-25.1-70.1-33-9.2-32.8-27-65.8-40.6-82.8-9.5-11.9-25.9-15.6-39.5-8.8l-27.6 13.8c-9 4.5-19.6 4.5-28.6 0L182.1 3.4c-13.6-6.8-30-3.1-39.5 8.8-13.5 17-31.4 50-40.6 82.8-42.7 7.9-70 19.7-70 33 0 12.6 24.8 23.9 64 31.7v.3c0 23.4 6.8 45.1 17.8 64H56.3c-11.5 0-19.2 11.7-14.7 22.3l25.8 60.2C27.3 329.8 0 372.7 0 422.4v44.8C0 491.9 20.1 512 44.8 512h358.4c24.7 0 44.8-20.1 44.8-44.8v-44.8c0-48.4-25.8-90.4-64.1-114.1zM176 480l-41.6-192 49.6 32 24 40-32 120zm96 0l-32-120 24-40 49.6-32L272 480zm41.7-298.5c-3.9 11.9-7 24.6-16.5 33.4-10.1 9.3-48 22.4-64-25-2.8-8.4-15.4-8.4-18.3 0-17 50.2-56 32.4-64 25-9.5-8.8-12.7-21.5-16.5-33.4-.8-2.5-6.3-5.7-6.3-5.8v-10.8c28.3 3.6 61 5.8 96 5.8s67.7-2.1 96-5.8v10.8c-.1.1-5.6 3.2-6.4 5.8z" > < / p a t h >
< / s y m b o l >
< symbol id = "icon-users" viewBox = "0 0 640 512" >
< path d = "M96 224c35.3 0 64-28.7 64-64s-28.7-64-64-64-64 28.7-64 64 28.7 64 64 64zm448 0c35.3 0 64-28.7 64-64s-28.7-64-64-64-64 28.7-64 64 28.7 64 64 64zm32 32h-64c-17.6 0-33.5 7.1-45.1 18.6 40.3 22.1 68.9 62 75.1 109.4h66c17.7 0 32-14.3 32-32v-32c0-35.3-28.7-64-64-64zm-256 0c61.9 0 112-50.1 112-112S381.9 32 320 32 208 82.1 208 144s50.1 112 112 112zm76.8 32h-8.3c-20.8 10-43.9 16-68.5 16s-47.6-6-68.5-16h-8.3C179.6 288 128 339.6 128 403.2V432c0 26.5 21.5 48 48 48h288c26.5 0 48-21.5 48-48v-28.8c0-63.6-51.6-115.2-115.2-115.2zm-223.7-13.4C161.5 263.1 145.6 256 128 256H64c-35.3 0-64 28.7-64 64v32c0 17.7 14.3 32 32 32h65.9c6.3-47.4 34.9-87.3 75.2-109.4z" > < / p a t h >
< / s y m b o l >
< symbol id = "icon-wrench" viewBox = "0 0 512 512" >
< path d = "M507.73 109.1c-2.24-9.03-13.54-12.09-20.12-5.51l-74.36 74.36-67.88-11.31-11.31-67.88 74.36-74.36c6.62-6.62 3.43-17.9-5.66-20.16-47.38-11.74-99.55.91-136.58 37.93-39.64 39.64-50.55 97.1-34.05 147.2L18.74 402.76c-24.99 24.99-24.99 65.51 0 90.5 24.99 24.99 65.51 24.99 90.5 0l213.21-213.21c50.12 16.71 107.47 5.68 147.37-34.22 37.07-37.07 49.7-89.32 37.91-136.73zM64 472c-13.25 0-24-10.75-24-24 0-13.26 10.75-24 24-24s24 10.74 24 24c0 13.25-10.75 24-24 24z" > < / p a t h >
< / s y m b o l >
< / s v g >
2022-01-03 11:54:10 +01:00
` }});var gx=n(1513),px={};px.styleTagTransform=vg(),px.setAttributes=fg(),px.insert=ug().bind(null,"head"),px.domAPI=lg(),px.insertStyleElement=gg(),ag()(gx.Z,px),gx.Z&&gx.Z.locals&&gx.Z.locals;class vx extends ig{render(){return(()=>{const e=jl.settings.get("singleton")?["converse-singleton"]:[];return e.push( ` converse - $ { jl . settings . get ( "view_mode" ) } ` ),el `
< converse - chats class = "converse-chatboxes row no-gutters ${e.join(" ")}" > < / c o n v e r s e - c h a t s >
2021-11-11 22:06:49 +01:00
< div id = "converse-modals" class = "modals" > < / d i v >
< converse - fontawesome > < / c o n v e r s e - f o n t a w e s o m e >
2022-01-03 11:54:10 +01:00
` })()}initialize(){this.setAttribute("id","conversejs"),this.setClasses();const e=va();this.listenTo(e,"change:view_mode",(()=>this.setClasses())),this.listenTo(e,"change:singleton",(()=>this.setClasses()))}setClasses(){this.className="",this.classList.add("conversejs"),this.classList.add( ` converse - $ { jl . settings . get ( "view_mode" ) } ` ),this.classList.add( ` theme - $ { jl . settings . get ( "theme" ) } ` ),this.requestUpdate()}}function yx(){if(!jl.settings.get("auto_insert"))return;const e=jl.settings.get("root");if(!e.querySelector("converse-root")){const t=document.createElement("converse-root"),n=e.querySelector("body");n?n.appendChild(t):e.appendChild(t)}} $ l.plugins.add("converse-rootview",{initialize(){jl.settings.extend({auto_insert:!0}),jl.listen.on("chatBoxesInitialized",yx),jl.elements.define("converse-root",vx)}});const{Strophe:bx}= $ l.env,_x= $ l.env.utils,wx=ap.extend({id:"add-contact-modal",events:{"submit form":"addContactFromForm"},initialize(){ap.prototype.initialize.apply(this,arguments),this.listenTo(this.model,"change",this.render)},toHTML(){const e=jl.settings.get("xhr_user_search_url")?Eh("Contact name"):Eh("Optional nickname");return(e=>{const t=Eh("name@example.org"),n=Eh("Add"),s=Eh("Please enter a valid XMPP address"),i=Eh("Add a Contact"),r=Eh("XMPP Address"),o=Eh("Nickname");return el `
2021-03-19 19:26:15 +01:00
< div class = "modal-dialog" role = "document" >
< div class = "modal-content" >
< div class = "modal-header" >
< h5 class = "modal-title" id = "addContactModalLabel" > $ { i } < / h 5 >
2022-01-03 11:54:10 +01:00
$ { lp }
2021-03-19 19:26:15 +01:00
< / d i v >
< form class = "converse-form add-xmpp-contact" >
< div class = "modal-body" >
< span class = "modal-alert" > < / s p a n >
< div class = "form-group add-xmpp-contact__jid" >
2021-11-11 22:06:49 +01:00
< label class = "clearfix" for = "jid" > $ { r } : < / l a b e l >
2021-03-19 19:26:15 +01:00
< div class = "suggestion-box suggestion-box__jid" >
< ul class = "suggestion-box__results suggestion-box__results--above" hidden = "" > < / u l >
2022-01-03 11:54:10 +01:00
< input type = "text" name = "jid" ? required = $ { ! jl . settings . get ( "xhr_user_search_url" ) }
2021-03-19 19:26:15 +01:00
value = "${e.jid||" "}"
class = "form-control suggestion-box__input"
placeholder = "${t}" / >
< span class = "suggestion-box__additions visually-hidden" role = "status" aria - live = "assertive" aria - relevant = "additions" > < / s p a n >
< / d i v >
< / d i v >
< div class = "form-group add-xmpp-contact__name" >
< label class = "clearfix" for = "name" > $ { o } : < / l a b e l >
< div class = "suggestion-box suggestion-box__name" >
< ul class = "suggestion-box__results suggestion-box__results--above" hidden = "" > < / u l >
< input type = "text" name = "name" value = "${e.nickname||" "}"
class = "form-control suggestion-box__input"
placeholder = "${o}" / >
< span class = "suggestion-box__additions visually-hidden" role = "status" aria - live = "assertive" aria - relevant = "additions" > < / s p a n >
< / d i v >
< / d i v >
< div class = "form-group" >
2021-11-11 22:06:49 +01:00
< div class = "invalid-feedback" > $ { s } < / d i v >
2021-03-19 19:26:15 +01:00
< / d i v >
< button type = "submit" class = "btn btn-primary" > $ { n } < / b u t t o n >
< / d i v >
< / f o r m >
< / d i v >
< / d i v >
2022-01-03 11:54:10 +01:00
` })(Object.assign(this.model.toJSON(),{_converse:wa,label_nickname:e}))},afterRender(){"string"==typeof jl.settings.get("xhr_user_search_url")?this.initXHRAutoComplete():this.initJIDAutoComplete();const e=this.el.querySelector('input[name="jid"]');this.el.addEventListener("shown.bs.modal",(()=>e.focus()),!1)},initJIDAutoComplete(){if(!jl.settings.get("autocomplete_add_contact"))return;const e=this.el.querySelector(".suggestion-box__jid").parentElement;this.jid_auto_complete=new wa.AutoComplete(e,{data:(e,t)=> ` $ { t . slice ( 0 , t . indexOf ( "@" ) ) } @ $ { e } ` ,filter:wa.FILTER_STARTSWITH,list:[...new Set(wa.roster.map((e=>bx.getDomainFromJid(e.get("jid")))))]})},initXHRAutoComplete(){if(!jl.settings.get("autocomplete_add_contact"))return this.initXHRFetch();const e=this.el.querySelector(".suggestion-box__name").parentElement;this.name_auto_complete=new wa.AutoComplete(e,{auto_evaluate:!1,filter:wa.FILTER_STARTSWITH,list:[]});const t=new window.XMLHttpRequest;t.onload=()=>{if(t.responseText){const e=t.responseText;this.name_auto_complete.list=JSON.parse(e).map((e=>({label:e.fullname||e.jid,value:e.jid}))),this.name_auto_complete.auto_completing=!0,this.name_auto_complete.evaluate()}};const n=this.el.querySelector('input[name="name"]');n.addEventListener("input",gc((()=>{t.open("GET", ` $ { jl . settings . get ( "xhr_user_search_url" ) } q = $ { encodeURIComponent ( n . value ) } ` ,!0),t.send()}),300)),this.name_auto_complete.on("suggestion-box-selectcomplete",(e=>{this.el.querySelector('input[name="name"]').value=e.text.label,this.el.querySelector('input[name="jid"]').value=e.text.value}))},initXHRFetch(){this.xhr=new window.XMLHttpRequest,this.xhr.onload=()=>{if(this.xhr.responseText){const e=this.xhr.responseText,t=JSON.parse(e).map((e=>({label:e.fullname||e.jid,value:e.jid})));if(1!==t.length){const e=this.el.querySelector(".invalid-feedback");return e.textContent=Eh("Sorry, could not find a contact with that name"),void _x.addClass("d-block",e)}const n=t[0].value;if(this.validateSubmission(n)){const e=this.el.querySelector("form"),s=t[0].label;this.afterSubmission(e,n,s)}}}},validateSubmission(e){const t=this.el.querySelector(".invalid-feedback");return!e|| $ o(e.split("@")).length<2?(_x.addClass("is-invalid",this.el.querySelector('input[name="jid"]')),_x.addClass("d-block",t),!1):wa.roster.get(bx.getBareJidFromJid(e))?(t.textContent=Eh("This contact has already been added"),_x.addClass("d-block",t),!1):(_x.removeClass("d-block",t),!0)},afterSubmission(e,t,n){wa.roster.addAndSubscribe(t,n),this.model.clear(),this.modal.hide()},addContactFromForm(e){e.preventDefault();const t=new FormData(e.target),n=(t.get("jid")||"").trim();if(!n&&"string"==typeof jl.settings.get("xhr_user_search_url")){const e=this.el.querySelector('input[name="name"]');return this.xhr.open("GET", ` $ { jl . settings . get ( "xhr_user_search_url" ) } q = $ { encodeURIComponent ( e . value ) } ` ,!0),void this.xhr.send()}this.validateSubmission(n)&&this.afterSubmission(e.target,n,t.get("name"))}});function Sx(e){var t,n;null===(t=wa.roster)||void 0===t||null===(n=t.findWhere({jid:e.get("jid")}))||void 0===n||n.trigger("highlight")}function xx(e,t){const n=wa.roster_filter,s=n.get("filter_type"),i="state"===s?n.get("chat_state").toLowerCase():n.get("filter_text").toLowerCase();return!!i&&("state"===s?![wa.HEADER_REQUESTING_CONTACTS,wa.HEADER_UNREAD].includes(t)&&("unread_messages"===i?0===e.get("num_unread"):"online"===i?["offline","unavailable"].includes(e.presence.get("show")):!e.presence.get("show").includes(i)):"contacts"===s?!e.getFilterCriteria().includes(i):void 0)}function Ex(e){const t=wa.roster_filter;if("groups"===t.get("filter_type")){var n;const s=null===(n=t.get("filter_text"))||void 0===n?void 0:n.toLowerCase();if(!s)return!0;if(!e.toLowerCase().includes(s))return!1}return!0}wa.AddContactModal=wx;const{u:Ax}= $ l.env;function Cx(e){const t=e.get("jid"),n=[];if(sa()){const e=wa.chatboxes.get(t);e&&!e.get("hidden")&&n.push("open")}const s=e.get("ask"),i=e.get("requesting"),r=e.get("subscription");return"subscribe"===s||"from"===r?n.push("pending-xmpp-contact"):!0===i?n.push("requesting-xmpp-contact"):(
2021-11-11 22:06:49 +01:00
< li class = "list-item d-flex controlbox-padded ${n.join(" ")}" data - status = "${e.presence.get(" show ")}" >
< converse - roster - contact . model = $ { e } > < / c o n v e r s e - r o s t e r - c o n t a c t >
2022-01-03 11:54:10 +01:00
< / l i > ` } c o n s t T x = e = > { c o n s t t = E h ( " C o n t a c t s " ) , n = E h ( " A d d a c o n t a c t " ) , s = E h ( " R e - s y n c y o u r c o n t a c t s " ) , i = ( w a . r o s t e r | | [ ] ) . r e d u c e ( ( ( e , t ) = > f u n c t i o n ( e , t ) { i f ( " s u b s c r i b e " = = = t . g e t ( " a s k " ) ) { c o n s t n = w a . H E A D E R _ P E N D I N G _ C O N T A C T S ; e [ n ] ? e [ n ] . p u s h ( t ) : e [ n ] = [ t ] } e l s e i f ( t . g e t ( " r e q u e s t i n g " ) ) { c o n s t n = w a . H E A D E R _ R E Q U E S T I N G _ C O N T A C T S ; e [ n ] ? e [ n ] . p u s h ( t ) : e [ n ] = [ t ] } e l s e { l e t n ; j l . s e t t i n g s . g e t ( " r o s t e r _ g r o u p s " ) ? ( n = t . g e t ( " g r o u p s " ) , n = 0 = = = n . l e n g t h ? [ w a . H E A D E R _ U N G R O U P E D ] : n ) : n = [ w a . H E A D E R _ C U R R E N T _ C O N T A C T S ] ; f o r ( c o n s t s o f n ) e [ s ] ? e [ s ] . p u s h ( t ) : e [ s ] = [ t ] } i f ( t . g e t ( " n u m _ u n r e a d " ) ) { c o n s t n = w a . H E A D E R _ U N R E A D ; e [ n ] ? e [ n ] . p u s h ( t ) : e [ n ] = [ t ] } r e t u r n e } ( e , t ) ) , { } ) , r = O b j e c t . k e y s ( i ) . f i l t e r ( E x ) ; r e t u r n r . s o r t ( l m ) , e l `
2021-11-11 22:06:49 +01:00
< div class = "d-flex controlbox-padded" >
< span class = "w-100 controlbox-heading controlbox-heading--contacts" > $ { t } < / s p a n >
< a class = "controlbox-heading__btn sync-contacts" @ click = $ { t => e . syncContacts ( t ) } title = "${s}" >
< converse - icon class = "fa fa-sync right ${e.syncing_contacts?" fa - spin ":" "}" color = "var(--subdued-color)" path - prefix = "/dist" size = "1em" > < / c o n v e r s e - i c o n >
< / a >
2022-01-03 11:54:10 +01:00
$ { jl . settings . get ( "allow_contact_requests" ) ? el `
2021-11-11 22:06:49 +01:00
< a class = "controlbox-heading__btn add-contact"
@ click = $ { t => e . showAddContactModal ( t ) }
title = "${n}"
data - toggle = "modal"
data - target = "#add-contact-modal" >
< converse - icon class = "fa fa-user-plus right" color = "var(--subdued-color)" path - prefix = "/dist" size = "1.25em" > < / c o n v e r s e - i c o n >
< / a > ` : " " }
2021-03-19 19:26:15 +01:00
< / d i v >
2021-11-11 22:06:49 +01:00
< converse - roster - filter > < / c o n v e r s e - r o s t e r - f i l t e r >
< div class = "list-container roster-contacts" >
2022-01-03 11:54:10 +01:00
$ { Wg ( r , ( e => e ) , ( e => { const t = i [ e ] . filter ( ( t => function ( e , t ) { const n = e . presence . get ( "show" ) ; return jl . settings . get ( "hide_offline_users" ) && "offline" === n ? ( "subscribe" === e . get ( "ask" ) || "from" === e . get ( "subscription" ) || ! 0 === e . get ( "requesting" ) ) && ! xx ( e , t ) : ! xx ( e , t ) } ( t , e ) ) ) ; return t . sort ( cm ) , t . length ? ( e => { const t = Eh ( "Click to hide these contacts" ) , n = wa . roster . state . get ( "collapsed_groups" ) ; return el `
2021-11-11 22:06:49 +01:00
< div class = "roster-group" data - group = "${e.name}" >
2022-01-03 11:54:10 +01:00
< a href = "#" class = "list-toggle group-toggle controlbox-padded" title = "${t}" @ click = $ { t => function ( e , t ) { var n ; null == e || null === ( n = e . preventDefault ) || void 0 === n || n . call ( e ) ; const s = wa . roster . state . get ( "collapsed_groups" ) ; s . includes ( t ) ? wa . roster . state . save ( "collapsed_groups" , s . filter ( ( e => e !== t ) ) ) : wa . roster . state . save ( "collapsed_groups" , [ ... s , t ] ) } ( t , e . name ) } >
2021-11-11 22:06:49 +01:00
< converse - icon color = "var(--chat-head-color)" size = "1em" class = "fa ${n.includes(e.name)?" fa - caret - right ":" fa - caret - down "}" > < / c o n v e r s e - i c o n > $ { e . n a m e }
< / a >
< ul class = "items-list roster-group-contacts ${n.includes(e.name)?" collapsed ":" "}" data - group = "${e.name}" >
2022-01-03 11:54:10 +01:00
$ { e . contacts . map ( Cx ) }
2021-11-11 22:06:49 +01:00
< / u l >
< / d i v > ` } ) ( { c o n t a c t s : t , n a m e : e } ) : " " } ) ) }
< / d i v >
2022-01-03 11:54:10 +01:00
` };jl.elements.define("converse-roster",class extends ig{async initialize(){await jl.waitUntil("rosterInitialized"),this.listenTo(wa,"rosterContactsFetched",this.requestUpdate),this.listenTo(wa.presences,"change:show",this.requestUpdate),this.listenTo(wa.roster,"add",this.requestUpdate),this.listenTo(wa.roster,"destroy",this.requestUpdate),this.listenTo(wa.roster,"remove",this.requestUpdate),this.listenTo(wa.roster,"change",this.requestUpdate),this.listenTo(wa.roster.state,"change",this.requestUpdate),jl.trigger("rosterViewInitialized")}firstUpdated(){this.listenToRosterFilter()}render(){return Tx(this)}listenToRosterFilter(){this.filter_view=this.querySelector("converse-roster-filter"),this.filter_view.addEventListener("update",(()=>this.requestUpdate()))}showAddContactModal(e){jl.modal.show(wa.AddContactModal,{model:new Xo},e)}async syncContacts(e){e.preventDefault(),this.syncing_contacts=!0,this.requestUpdate(),wa.roster.data.save("version",null),await wa.roster.fetchFromServer(),jl.user.presence.send(),this.syncing_contacts=!1,this.requestUpdate()}});const kx=e=>el ` < span class = "pending-contact-name" title = "JID: ${e.jid}" > $ { e . display _name } < / s p a n > ` , j x = e = > e l ` < s p a n c l a s s = " r e q - c o n t a c t - n a m e w - 1 0 0 " t i t l e = " J I D : $ { e . j i d } " > $ { e . d i s p l a y _ n a m e } < / s p a n > ` , N x = { d n d : E h ( " T h i s c o n t a c t i s b u s y " ) , o n l i n e : E h ( " T h i s c o n t a c t i s o n l i n e " ) , o f f l i n e : E h ( " T h i s c o n t a c t i s o f f l i n e " ) , u n a v a i l a b l e : E h ( " T h i s c o n t a c t i s u n a v a i l a b l e " ) , x a : E h ( " T h i s c o n t a c t i s a w a y f o r a n e x t e n d e d p e r i o d " ) , a w a y : E h ( " T h i s c o n t a c t i s a w a y " ) } , O x = $ l . e n v . u t i l s ; c l a s s $ x e x t e n d s i g { s t a t i c g e t p r o p e r t i e s ( ) { r e t u r n { m o d e l : { t y p e : O b j e c t } } } c o n n e c t e d C a l l b a c k ( ) { s u p e r . c o n n e c t e d C a l l b a c k ( ) , t h i s . l i s t e n T o ( t h i s . m o d e l , " c h a n g e " , t h i s . r e q u e s t U p d a t e ) , t h i s . l i s t e n T o ( t h i s . m o d e l , " h i g h l i g h t " , t h i s . r e q u e s t U p d a t e ) , t h i s . l i s t e n T o ( t h i s . m o d e l , " v c a r d : c h a n g e " , t h i s . r e q u e s t U p d a t e ) } r e n d e r ( ) { c o n s t e = t h i s . m o d e l . g e t ( " a s k " ) , t = t h i s . m o d e l . g e t ( " r e q u e s t i n g " ) , n = t h i s . m o d e l . g e t ( " s u b s c r i p t i o n " ) , s = t h i s . m o d e l . g e t ( " j i d " ) ; i f ( " s u b s c r i b e " = = = e | | " f r o m " = = = n ) { c o n s t e = t h i s . m o d e l . g e t D i s p l a y N a m e ( ) ; r e t u r n ( e = > { c o n s t t = E h ( " C l i c k t o r e m o v e % 1 $ s a s a c o n t a c t " , e . d i s p l a y _ n a m e ) ; r e t u r n e l `
$ { jl . settings . get ( "allow_chat_pending_contacts" ) ? el ` <a class="list-item-link open-chat w-100" href="#" @click= ${ e . openChat } > ${ kx ( e ) } </a> ` : kx ( e ) }
< a class = "list-item-action remove-xmpp-contact far fa-trash-alt" @ click = $ { e . removeContact } title = "${t}" href = "#" > < / a > ` } ) ( O b j e c t . a s s i g n ( t h i s . m o d e l . t o J S O N ( ) , { d i s p l a y _ n a m e : e , o p e n C h a t : e = > t h i s . o p e n C h a t ( e ) , r e m o v e C o n t a c t : e = > t h i s . r e m o v e C o n t a c t ( e ) } ) ) } i f ( ! 0 = = = t ) { c o n s t e = t h i s . m o d e l . g e t D i s p l a y N a m e ( ) ; r e t u r n ( e = > e l `
$ { jl . settings . get ( "allow_chat_pending_contacts" ) ? el ` <a class="open-chat w-100" href="#" @click= ${ e . openChat } > ${ jx ( e ) } </a> ` : jx ( e ) }
2021-11-11 22:06:49 +01:00
< a class = "accept-xmpp-request list-item-action list-item-action--visible fa fa-check"
@ click = $ { e . acceptRequest }
aria - label = "${e.desc_accept}" title = "${e.desc_accept}" href = "#" > < / a >
< a class = "decline-xmpp-request list-item-action list-item-action--visible fa fa-times"
@ click = $ { e . declineRequest }
2022-01-03 11:54:10 +01:00
aria - label = "${e.desc_decline}" title = "${e.desc_decline}" href = "#" > < / a > ` ) ( O b j e c t . a s s i g n ( t h i s . m o d e l . t o J S O N ( ) , { d i s p l a y _ n a m e : e , o p e n C h a t : e = > t h i s . o p e n C h a t ( e ) , a c c e p t R e q u e s t : e = > t h i s . a c c e p t R e q u e s t ( e ) , d e c l i n e R e q u e s t : e = > t h i s . d e c l i n e R e q u e s t ( e ) , d e s c _ a c c e p t : E h ( " C l i c k t o a c c e p t t h e c o n t a c t r e q u e s t f r o m % 1 $ s " , e ) , d e s c _ d e c l i n e : E h ( " C l i c k t o d e c l i n e t h e c o n t a c t r e q u e s t f r o m % 1 $ s " , e ) , a l l o w _ c h a t _ p e n d i n g _ c o n t a c t s : j l . s e t t i n g s . g e t ( " a l l o w _ c h a t _ p e n d i n g _ c o n t a c t s " ) } ) ) } i f ( " b o t h " = = = n | | " t o " = = = n | | O x . i s S a m e B a r e J I D ( s , w a . c o n n e c t i o n . j i d ) ) r e t u r n t h i s . r e n d e r R o s t e r I t e m ( t h i s . m o d e l ) } r e n d e r R o s t e r I t e m ( e ) { r e t u r n ( ( e , t ) = > { v a r n , s ; c o n s t i = t . p r e s e n c e . g e t ( " s h o w " ) | | " o f f l i n e " ; l e t r , o ; [ r , o ] = " o n l i n e " = = = i ? [ " f a f a - c i r c l e " , " c h a t - s t a t u s - o n l i n e " ] : " d n d " = = = i ? [ " f a f a - m i n u s - c i r c l e " , " c h a t - s t a t u s - b u s y " ] : " a w a y " = = = i ? [ " f a f a - c i r c l e " , " c h a t - s t a t u s - a w a y " ] : [ " f a f a - c i r c l e " , " s u b d u e d - c o l o r " ] ; c o n s t a = t . g e t D i s p l a y N a m e ( ) , c = N x [ i ] , l = t . g e t ( " n u m _ u n r e a d " ) | | 0 , d = E h ( " C l i c k t o c h a t w i t h % 1 $ s ( X M P P a d d r e s s : % 2 $ s ) " , a , e . m o d e l . g e t ( " j i d " ) ) , u = E h ( " C l i c k t o r e m o v e % 1 $ s a s a c o n t a c t " , a ) ; r e t u r n e l `
< a class = "list-item-link cbox-list-item open-chat ${l?" unread - msgs ":" "}" title = "${d}" href = "#" @ click = $ { e . openChat } >
< span >
< converse - avatar
class = "avatar"
. data = $ { null === ( n = e . model . vcard ) || void 0 === n ? void 0 : n . attributes }
nonce = $ { null === ( s = e . model . vcard ) || void 0 === s ? void 0 : s . get ( "vcard_updated" ) }
height = "30" width = "30" > < / c o n v e r s e - a v a t a r >
< converse - icon
title = "${c}"
color = "var(--${o})"
size = "1em"
class = "${r} chat-status chat-status--avatar" > < / c o n v e r s e - i c o n >
< / s p a n >
$ { l ? el ` <span class="msgs-indicator"> ${ l } </span> ` : "" }
< span class = "contact-name contact-name--${e.show} ${l?" unread - msgs ":" "}" > $ { a } < / s p a n >
2021-11-11 22:06:49 +01:00
< / a >
2022-01-03 11:54:10 +01:00
$ { jl . settings . get ( "allow_contact_removal" ) ? el ` <a class="list-item-action remove-xmpp-contact far fa-trash-alt" @click= ${ e . removeContact } title=" ${ u } " href="#"></a> ` : "" } ` })(this,e)}openChat(e){var t;null==e||null===(t=e.preventDefault)||void 0===t||t.call(e),this.model.openChat()}removeContact(e){var t;if(null==e||null===(t=e.preventDefault)||void 0===t||t.call(e),jl.settings.get("allow_contact_removal")&&confirm(Eh("Are you sure you want to remove this contact?")))try{this.model.removeFromRoster(),this.model.collection&&this.model.destroy()}catch(e){M.error(e),jl.alert("error",Eh("Error"),[Eh("Sorry, there was an error while trying to remove %1 $ s as a contact.",this.model.getDisplayName())])}}async acceptRequest(e){var t;null==e||null===(t=e.preventDefault)||void 0===t||t.call(e),await wa.roster.sendContactAddIQ(this.model.get("jid"),this.model.getFullname(),[]),this.model.authorize().subscribe()}declineRequest(e){return e&&e.preventDefault&&e.preventDefault(),!0===confirm(Eh("Are you sure you want to decline this contact request?"))&&this.model.unauthorize().destroy(),this}}jl.elements.define("converse-roster-contact", $ x);const Ix=Xo.extend({initialize(){this.set({filter_text:"",filter_type:"contacts",chat_state:"online"})}});class Mx extends ig{initialize(){const e=new wa.RosterFilter;e.id= ` _converse . rosterfilter - $ { wa . bare _jid } ` ,_o(e,e.id),this.model=e,wa.roster_filter=e,this.liveFilter=gc((()=>{this.model.save({filter_text:this.querySelector(".roster-filter").value})}),250),this.listenTo(wa,"rosterContactsFetched",this.requestUpdate),this.listenTo(wa.presences,"change:show",this.requestUpdate),this.listenTo(wa.roster,"add",this.requestUpdate),this.listenTo(wa.roster,"destroy",this.requestUpdate),this.listenTo(wa.roster,"remove",this.requestUpdate),this.listenTo(this.model,"change",this.dispatchUpdateEvent),this.listenTo(this.model,"change",this.requestUpdate),this.model.fetch()}render(){return(e=>{const t=Eh("Filter"),n=Eh("Filter by contact name"),s=Eh("Filter by group name"),i=Eh("Filter by status"),r=Eh("Any"),o=Eh("Unread"),a=Eh("Online"),c=Eh("Chatty"),l=Eh("Busy"),d=Eh("Away"),u=Eh("Extended Away"),h=Eh("Offline");return el `
2021-11-11 22:06:49 +01:00
< form class = "controlbox-padded roster-filter-form input-button-group ${e.visible?" fade - in ":" hidden "}"
@ submit = $ { e . submitFilter } >
< div class = "form-inline flex-nowrap" >
< div class = "filter-by d-flex flex-nowrap" >
< span @ click = $ { e . changeTypeFilter } class = "fa fa-user ${" contacts "===e.filter_type?" selected ":" "}" data - type = "contacts" title = "${n}" > < / s p a n >
< span @ click = $ { e . changeTypeFilter } class = "fa fa-users ${" groups "===e.filter_type?" selected ":" "}" data - type = "groups" title = "${s}" > < / s p a n >
< span @ click = $ { e . changeTypeFilter } class = "fa fa-circle ${" state "===e.filter_type?" selected ":" "}" data - type = "state" title = "${i}" > < / s p a n >
< / d i v >
< div class = "btn-group" >
< input . value = "${e.filter_text||" "}"
@ keydown = $ { e . liveFilter }
class = "roster-filter form-control ${" state "===e.filter_type?" hidden ":" "}"
placeholder = "${t}" / >
< span class = "clear-input fa fa-times ${e.filter_text&&" state "!==e.filter_type?" ":" hidden "}"
@ click = $ { e . clearFilter } >
< / s p a n >
< / d i v >
< select class = "form-control state-type ${" state "!==e.filter_type?" hidden ":" "}"
@ change = $ { e . changeChatStateFilter } >
< option value = "" > $ { r } < / o p t i o n >
< option ? selected = $ { "unread_messages" === e . chat _state } value = "unread_messages" > $ { o } < / o p t i o n >
< option ? selected = $ { "online" === e . chat _state } value = "online" > $ { a } < / o p t i o n >
< option ? selected = $ { "chat" === e . chat _state } value = "chat" > $ { c } < / o p t i o n >
< option ? selected = $ { "dnd" === e . chat _state } value = "dnd" > $ { l } < / o p t i o n >
< option ? selected = $ { "away" === e . chat _state } value = "away" > $ { d } < / o p t i o n >
< option ? selected = $ { "xa" === e . chat _state } value = "xa" > $ { u } < / o p t i o n >
< option ? selected = $ { "offline" === e . chat _state } value = "offline" > $ { h } < / o p t i o n >
< / s e l e c t >
< / d i v >
2022-01-03 11:54:10 +01:00
< / f o r m > ` } ) ( O b j e c t . a s s i g n ( t h i s . m o d e l . t o J S O N ( ) , { v i s i b l e : t h i s . s h o u l d B e V i s i b l e ( ) , c h a n g e C h a t S t a t e F i l t e r : e = > t h i s . c h a n g e C h a t S t a t e F i l t e r ( e ) , c h a n g e T y p e F i l t e r : e = > t h i s . c h a n g e T y p e F i l t e r ( e ) , c l e a r F i l t e r : e = > t h i s . c l e a r F i l t e r ( e ) , l i v e F i l t e r : e = > t h i s . l i v e F i l t e r ( e ) , s u b m i t F i l t e r : e = > t h i s . s u b m i t F i l t e r ( e ) } ) ) } d i s p a t c h U p d a t e E v e n t ( ) { t h i s . d i s p a t c h E v e n t ( n e w C u s t o m E v e n t ( " u p d a t e " , { d e t a i l : t h i s . m o d e l . c h a n g e d } ) ) } c h a n g e C h a t S t a t e F i l t e r ( e ) { e & & e . p r e v e n t D e f a u l t ( ) , t h i s . m o d e l . s a v e ( { c h a t _ s t a t e : t h i s . q u e r y S e l e c t o r ( " . s t a t e - t y p e " ) . v a l u e } ) } c h a n g e T y p e F i l t e r ( e ) { e & & e . p r e v e n t D e f a u l t ( ) ; c o n s t t = e . t a r g e t . d a t a s e t . t y p e ; " s t a t e " = = = t ? t h i s . m o d e l . s a v e ( { f i l t e r _ t y p e : t , c h a t _ s t a t e : t h i s . q u e r y S e l e c t o r ( " . s t a t e - t y p e " ) . v a l u e } ) : t h i s . m o d e l . s a v e ( { f i l t e r _ t y p e : t , f i l t e r _ t e x t : t h i s . q u e r y S e l e c t o r ( " . r o s t e r - f i l t e r " ) . v a l u e } ) } s u b m i t F i l t e r ( e ) { e & & e . p r e v e n t D e f a u l t ( ) , t h i s . l i v e F i l t e r ( ) } i s A c t i v e ( ) { r e t u r n " s t a t e " = = = t h i s . m o d e l . g e t ( " f i l t e r _ t y p e " ) | | t h i s . m o d e l . g e t ( " f i l t e r _ t e x t " ) } s h o u l d B e V i s i b l e ( ) { v a r e ; r e t u r n ( n u l l = = = ( e = w a . r o s t e r ) | | v o i d 0 = = = e ? v o i d 0 : e . l e n g t h ) > = 5 | | t h i s . i s A c t i v e ( ) } c l e a r F i l t e r ( e ) { e & & e . p r e v e n t D e f a u l t ( ) , t h i s . m o d e l . s a v e ( { f i l t e r _ t e x t : " " } ) } } j l . e l e m e n t s . d e f i n e ( " c o n v e r s e - r o s t e r - f i l t e r " , M x ) ; v a r R x = n ( 1 9 8 4 ) , D x = { } ; D x . s t y l e T a g T r a n s f o r m = v g ( ) , D x . s e t A t t r i b u t e s = f g ( ) , D x . i n s e r t = u g ( ) . b i n d ( n u l l , " h e a d " ) , D x . d o m A P I = l g ( ) , D x . i n s e r t S t y l e E l e m e n t = g g ( ) , a g ( ) ( R x . Z , D x ) , R x . Z & & R x . Z . l o c a l s & & R x . Z . l o c a l s , $ l . p l u g i n s . a d d ( " c o n v e r s e - r o s t e r v i e w " , { d e p e n d e n c i e s : [ " c o n v e r s e - r o s t e r " , " c o n v e r s e - m o d a l " , " c o n v e r s e - c h a t b o x v i e w s " ] , i n i t i a l i z e ( ) { j l . s e t t i n g s . e x t e n d ( { a u t o c o m p l e t e _ a d d _ c o n t a c t : ! 0 , a l l o w _ c h a t _ p e n d i n g _ c o n t a c t s : ! 0 , a l l o w _ c o n t a c t _ r e m o v a l : ! 0 , h i d e _ o f f l i n e _ u s e r s : ! 1 , r o s t e r _ g r o u p s : ! 0 , x h r _ u s e r _ s e a r c h _ u r l : n u l l } ) , j l . p r o m i s e s . a d d ( " r o s t e r V i e w I n i t i a l i z e d " ) , w a . R o s t e r F i l t e r = I x , w a . R o s t e r F i l t e r V i e w = M x , w a . R o s t e r C o n t a c t V i e w = $ x , j l . l i s t e n . o n ( " c h a t B o x e s I n i t i a l i z e d " , ( ( ) = > { w a . c h a t b o x e s . o n ( " d e s t r o y " , ( e = > S x ( e ) ) ) , w a . c h a t b o x e s . o n ( " c h a n g e : h i d d e n " , ( e = > S x ( e ) ) ) } ) ) , j l . l i s t e n . o n ( " a f t e r T e a r D o w n " , ( ( ) = > { v a r e ; r e t u r n n u l l = = = ( e = w a . r o t e r g r o u p s ) | | v o i d 0 = = = e ? v o i d 0 : e . o f f ( ) . r e s e t ( ) } ) ) } } ) , w a . C u s t o m E l e m e n t = i g ; c o n s t L x = $ l . i n i t i a l i z e ; $ l . i n i t i a l i z e = f u n c t i o n ( e , t ) { r e t u r n A r r a y . i s A r r a y ( e . w h i t e l i s t e d _ p l u g i n s ) ? e . w h i t e l i s t e d _ p l u g i n s = e . w h i t e l i s t e d _ p l u g i n s . c o n c a t ( r g ) : e . w h i t e l i s t e d _ p l u g i n s = r g , L x ( e , t ) } ; c o n s t z x = $ l } , 1 5 5 1 : ( e , t , n ) = > { " u s e s t r i c t " ; n . d ( t , { Z : ( ) = > a } ) ; v a r s = n ( 8 5 3 1 ) , i = n . n ( s ) , r = n ( 7 1 8 0 ) , o = n . n ( r ) ( ) ( i ( ) ) ; o . p u s h ( [ e . i d , " " , " " , { v e r s i o n : 3 , s o u r c e s : [ ] , n a m e s : [ ] , m a p p i n g s : " " , s o u r c e R o o t : " " } ] ) ; c o n s t a = o } , 5 2 5 1 : ( e , t , n ) = > { " u s e s t r i c t " ; n . d ( t , { Z : ( ) = > a } ) ; v a r s = n ( 8 5 3 1 ) , i = n . n ( s ) , r = n ( 7 1 8 0 ) , o = n . n ( r ) ( ) ( i ( ) ) ; o . p u s h ( [ e . i d , " " , " " , { v e r s i o n : 3 , s o u r c e s : [ ] , n a m e s : [ ] , m a p p i n g s : " " , s o u r c e R o o t : " " } ] ) ; c o n s t a = o } , 6 9 3 1 : ( e , t , n ) = > { " u s e s t r i c t " ; n . d ( t , { Z : ( ) = > a } ) ; v a r s = n ( 8 5 3 1 ) , i = n . n ( s ) , r = n ( 7 1 8 0 ) , o = n . n ( r ) ( ) ( i ( ) ) ; o . p u s h ( [ e . i d , " " , " " , { v e r s i o n : 3 , s o u r c e s : [ ] , n a m e s : [ ] , m a p p i n g s : " " , s o u r c e R o o t : " " } ] ) ; c o n s t a = o } , 3 5 2 : ( e , t , n ) = > { " u s e s t r i c t " ; n . d ( t , { Z : ( ) = > a } ) ; v a r s = n ( 8 5 3 1 ) , i = n . n ( s ) , r = n ( 7 1 8 0 ) , o = n . n ( r ) ( ) ( i ( ) ) ; o . p u s h ( [ e . i d , " " , " " , { v e r s i o n : 3 , s o u r c e s : [ ] , n a m e s : [ ] , m a p p i n g s : " " , s o u r c e R o o t : " " } ] ) ; c o n s t a = o } , 7 8 0 2 : ( e , t , n ) = > { " u s e s t r i c t " ; n . d ( t , { Z : ( ) = > a } ) ; v a r s = n ( 8 5 3 1 ) , i = n . n ( s ) , r = n ( 7 1 8 0 ) , o = n . n ( r ) ( ) ( i ( ) ) ; o . p u s h ( [ e . i d , " " , " " , { v e r s i o n : 3 , s o u r c e s : [ ] , n a m e s : [ ] , m a p p i n g s : " " , s o u r c e R o o t : " " } ] ) ; c o n s t a = o } , 5 5 9 9 : ( e , t , n ) = > { " u s e s t r i c t " ; n . d ( t , { Z : ( ) = > a } ) ; v a r s = n ( 8 5 3 1 ) , i = n . n ( s ) , r = n ( 7 1 8 0 ) , o = n . n ( r ) ( ) ( i ( ) ) ; o . p u s h ( [ e . i d , " " , " " , { v e r s i o n : 3 , s o u r c e s : [ ] , n a m e s : [ ] , m a p p i n g s : " " , s o u r c e R o o t : " " } ] ) ; c o n s t a = o } , 1 8 7 5 : ( e , t , n ) = > { " u s e s t r i c t " ; n . d ( t , { Z : ( ) = > a } ) ; v a r s = n ( 8 5 3 1 ) , i = n . n ( s ) , r = n ( 7 1 8 0 ) , o = n . n ( r ) ( ) ( i ( ) ) ; o . p u s h ( [ e . i d , " " , " " , { v e r s i o n : 3 , s o u r c e s : [ ] , n a m e s : [ ] , m a p p i n g s : " " , s o u r c e R o o t : " " } ] ) ; c o n s t a = o } , 8 0 4 1 : ( e , t , n ) = > { " u s e s t r i c t " ; n . d ( t , { Z : ( ) = > a } ) ; v a r s = n ( 8 5 3 1 ) , i = n . n ( s ) , r = n ( 7 1 8 0 ) , o = n . n ( r ) ( ) ( i ( ) ) ; o . p u s h ( [ e . i d , " " , " " , { v e r s i o n : 3 , s o u r c e s : [ ] , n a m e s : [ ] , m a p p i n g s : " " , s o u r c e R o o t : " " } ] ) ; c o n s t a = o } , 5 9 5 6 : ( e , t , n ) = > { " u s e s t r i c t " ; n . d ( t , { Z : ( ) = > a } ) ; v a r s = n ( 8 5 3 1 ) , i = n . n ( s ) , r = n ( 7 1 8 0 ) , o = n . n ( r ) ( ) ( i ( ) ) ; o . p u s h ( [ e . i d , " " , " " , { v e r s i o n : 3 , s o u r c e s : [ ] , n a m e s : [ ] , m a p p i n g s : " " , s o u r c e R o o t : " " } ] ) ; c o n s t a = o } , 9 6 7 9 : ( e , t , n ) = > { " u s e s t r i c t " ; n . d ( t , { Z : ( ) = > a } ) ; v a r s = n ( 8 5 3 1 ) , i = n . n ( s ) , r = n ( 7 1 8 0 ) , o = n . n ( r ) ( ) ( i ( ) ) ; o . p u s h ( [ e . i d , " " , " " , { v e r s i o n : 3 , s o u r c e s : [ ] , n a m e s : [ ] , m a p p i n g s : " " , s o u r c e R o o t : " " } ] ) ; c o n s t a = o } , 4 9 1 5 : ( e , t , n ) = > { " u s e s t r i c t " ; n . d ( t , { Z : ( ) = > a } ) ; v a r s = n ( 8 5 3 1 ) , i = n . n ( s ) , r = n ( 7 1 8 0 ) , o
2021-01-29 23:34:36 +01:00
//# sourceMappingURL=converse.min.js.map