This repository has been archived on 2022-09-21. You can view files and clone it, but cannot push or open issues or pull requests.
converse.js-dist/dist/converse.min.js

2263 lines
1.0 MiB
JavaScript
Raw Permalink Normal View History

/*! For license information please see converse.min.js.LICENSE.txt */
2021-12-23 22:20:17 +01:00
(()=>{var e,t,n,s,i={9494:(e,t,n)=>{"use strict";const s=n(7672),i=n(4817);e.exports={atob:s,btoa:i}},7672: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}},4817: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}},4223:(e,t,n)=>{var s;!function(){"use strict";var i={not_string:/[^s]/,not_bool:/[^t]/,not_type:/[^T]/,not_primitive:/[^v]/,number:/[diefg]/,numeric_arg:/[bcdiefguxX]/,json:/[j]/,not_json:/[^j]/,text:/^[^\x25]+/,modulo:/^\x25{2}/,placeholder:/^\x25(?:([1-9]\d*)\$|\(([^)]+)\))?(\+)?(0|'[^$])?(-)?(\d+)?(?:\.(\d+))?([b-gijostTuvxX])/,key:/^([a-z_][a-z_\d]*)/i,key_access:/^\.([a-z_][a-z_\d]*)/i,index_access:/^\[(\d+)\]/,sign:/^[+-]/};function r(e){return a(l(e),arguments)}function o(e,t){return r.apply(null,[e].concat(t||[]))}function a(e,t){var n,s,o,a,c,l,d,u,h,f=1,m=e.length,g="";for(s=0;s<m;s++)if("string"==typeof e[s])g+=e[s];else if("object"==typeof e[s]){if((a=e[s]).keys)for(n=t[f],o=0;o<a.keys.length;o++){if(null==n)throw new Error(r('[sprintf] Cannot access property "%s" of undefined value "%s"',a.keys[o],a.keys[o-1]));n=n[a.keys[o]]}else n=a.param_no?t[a.param_no]:t[f++];if(i.not_type.test(a.type)&&i.not_primitive.test(a.type)&&n instanceof Function&&(n=n()),i.numeric_arg.test(a.type)&&"number"!=typeof n&&isNaN(n))throw new TypeError(r("[sprintf] expecting number but found %T",n));switch(i.number.test(a.type)&&(u=n>=0),a.type){case"b":n=parseInt(n,10).toString(2);break;case"c":n=String.fromCharCode(parseInt(n,10));break;case"d":case"i":n=parseInt(n,10);break;case"j":n=JSON.stringify(n,null,a.width?parseInt(a.width):0);break;case"e":n=a.precision?parseFloat(n).toExponential(a.precision):parseFloat(n).toExponential();break;case"f":n=a.precision?parseFloat(n).toFixed(a.precision):parseFloat(n);break;case"g":n=a.precision?String(Number(n.toPrecision(a.precision))):parseFloat(n);break;case"o":n=(parseInt(n,10)>>>0).toString(8);break;case"s":n=String(n),n=a.precision?n.substring(0,a.precision):n;break;case"t":n=String(!!n),n=a.precision?n.substring(0,a.precision):n;break;case"T":n=Object.prototype.toString.call(n).slice(8,-1).toLowerCase(),n=a.precision?n.substring(0,a.precision):n;break;case"u":n=parseInt(n,10)>>>0;break;case"v":n=n.valueOf(),n=a.precision?n.substring(0,a.precision):n;break;case"x":n=(parseInt(n,10)>>>0).toString(16);break;case"X":n=(parseInt(n,10)>>>0).toString(16).toUpperCase()}i.json.test(a.type)?g+=n:(!i.number.test(a.type)||u&&!a.sign?h="":(h=u?"+":"-",n=n.toString().replace(i.sign,"")),l=a.pad_char?"0"===a.pad_char?"0":a.pad_char.charAt(1):" ",d=a.width-(h+n).length,c=a.width&&d>0?l.repeat(d):"",g+=a.align?h+n+c:"0"===l?h+c+n:c+h+n)}return g}var c=Object.create(null);function l(e){if(c[e])return c[e];for(var t,n=e,s=[],r=0;n;){if(null!==(t=i.text.exec(n)))s.push(t[0]);else if(null!==(t=i.modulo.exec(n)))s.push("%");else{if(null===(t=i.placeholder.exec(n)))throw new SyntaxError("[sprintf] unexpected placeholder");if(t[2]){r|=1;var o=[],a=t[2],l=[];if(null===(l=i.key.exec(a)))throw new SyntaxError("[sprintf] failed to parse named argument
draggable="false"
title="${s}"
alt="${n}"
2021-12-23 22:20:17 +01:00
src="${t}/72x72/${e.cp}.png"/>`}}return t.unicode_only?s:ol`<img class="emoji"
draggable="false"
title="${s}"
alt="${s}"
2021-12-23 22:20:17 +01:00
src="${Il.emojis.by_sn[s].url}">`}function mu(e){if(!Il.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(Il.emojis.shortnames_regex)].filter((e=>e[0].length>0)).map((e=>{const t=Il.emojis.by_sn[e[0]].cp;return{cp:t,begin:e.index,end:e.index+e[0].length,shortname:e[0],emoji:t?uu(t):null}}))}function gu(e){const t=[];return function(e,n){const s=/\uFE0F/g,i=String.fromCharCode(8205);String(e).replace(cu,((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=lu.getEmojisByAtrribute("cp")[e])||void 0===i?void 0:i.sn)||""})})(o,e,r)}))}(e),t}Il.plugins.add("converse-emoji",{initialize(){const{___:e}=wa;Nl.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(lu,{shortnamesToEmojis:(e,t={unicode_only:!1,add_title_wrapper:!1})=>function(e,t){let n=[e];return[...mu(e),...gu(e)].sort(((e,t)=>t.begin-e.begin)).forEach((e=>{const s=n.shift(),i=fu(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=hu(e),t),shortnamesToUnicode:e=>lu.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=gu(lu.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 Il.emojis.json;const n=Il.emojis.list.map((t=>t[e])).filter(((e,t,n)=>n.indexOf(e)==t));return t[e]={},n.forEach((n=>t[e][n]=Il.emojis.list.find((t=>t[e]===n)))),t[e]}}),Object.assign(Nl,{emojis:{async initialize(){if(!Il.emojis.initialized){Il.emojis.initialized=!0;const{default:t}=await n.e(4610).then(n.t.bind(n,7530,19));Il.emojis.json=t,Il.emojis.by_sn=Object.keys(t).reduce(((e,n)=>Object.assign(e,t[n])),{}),Il.emojis.list=Object.values(Il.emojis.by_sn),Il.emojis.list.sort(((e,t)=>e.sn<t.sn?-1:e.sn>t.sn?1:0)),Il.emojis.shortnames=Il.emojis.list.map((e=>e.sn));const s=()=>Il.emojis.shortnames.map((e=>e.replace(/[+]/g,"\\$&"))).join("|");Il.emojis.shortnames_regex=new RegExp(s(),"gi"),Il.emojis.toned=(Il.emojis.toned||(Il.emojis.toned=(e=Object.values(Il.emojis.json.people).filter((e=>e.sn.includes("_tone"))).map((e=>e.sn.replace(/_tone[1-5]/,""))),[...new Set(e)])),Il.emojis.toned),Il.emojis.initialized_promise.resolve()}var e;return Il.emojis.initialized_promise}}})}});const pu={initialize(){this.checkValidity()&&(this.get("file")&&this.on("change:put",this.uploadFile,this),this.setTimerForEphemeralMessage()||this.setOccupant(),Nl.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(Nl.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
<form class="converse-form chatroom-form" @submit=${e.onSubmit}>
<legend>${t}</legend>
<fieldset class="form-group">
<label for="converse_muc_bookmark_name">${i}</label>
<input class="form-control" type="text" value="${e.name}" name="name" required="required" id="converse_muc_bookmark_name"/>
</fieldset>
<fieldset class="form-group">
<label for="converse_muc_bookmark_nick">${r}</label>
<input class="form-control" type="text" name="nick" value="${e.nick||""}" id="converse_muc_bookmark_nick"/>
</fieldset>
<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}</label>
</fieldset>
<fieldset class="form-group">
<input class="btn btn-primary" type="submit" value="${o}">
<input class="btn btn-secondary button-cancel" type="button" value="${s}" @click=${e.onCancel}>
</fieldset>
</form>
2021-12-23 22:20:17 +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)}}Nl.elements.define("converse-muc-bookmark-form",wg);const Sg=wg,xg=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 Eg(e,t){if(Nl.settings.get("allow_bookmarks")&&e.model.get("type")===wa.CHATROOMS_TYPE){const n=e.model.get("bookmarked"),s={i18n_title:Ah(n?"Unbookmark this groupchat":"Bookmark this groupchat"),i18n_text:Ah(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=Oh().then((e=>e?s:null));return i>-1?[...t.slice(0,i),r,...t.slice(i)]:[r,...t]}return t}function Ag(e){e.preventDefault();const t=e.target.getAttribute("data-bookmark-name"),n=e.target.getAttribute("data-room-jid");confirm(Ah('Are you sure you want to remove the bookmark "%1$s"?',t))&&xg(wa.bookmarks.where({jid:n}),Xo.prototype.destroy)}async function Cg(e){e.preventDefault();const t=e.target.getAttribute("data-room-jid");(await Nl.rooms.open(t,{bring_to_foreground:!0})).session.save("view",Il.MUC.VIEWS.BOOKMARK)}function Tg(e){e.preventDefault();const{Strophe:t}=Il.env,n=e.target.textContent,s=e.target.getAttribute("data-room-jid"),i={name:n||t.unescapeNode(t.getNodeFromJid(s))||s};Nl.rooms.open(s,i,!0)}const kg=e=>{const t=e.bm.get("jid"),n=!(!Nl.settings.get("hide_open_bookmarks")||!wa.chatboxes.get(t)),s=Ah("Unbookmark this groupchat"),i=Ah("Click to open this groupchat");return ol`
<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}"
2021-12-23 22:20:17 +01:00
@click=${Tg}>${e.bm.getDisplayName()}</a>
<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}"
2021-12-23 22:20:17 +01:00
@click=${Ag}></a>
</div>
2021-12-23 22:20:17 +01:00
`};"undefined"!=typeof Element&&Element.prototype;const jg=/^(\S+)\s*(.*)$/,Ng=["model","collection","events"];class Og 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,Ng))}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)&&dl(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(jg);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(Og.prototype,ks);const $g=Il.env.utils;class Ig extends Og{async initialize(){await Nl.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(){dl((e=>{const t=!!wa.bookmarks.getUnopenedBookmarks().length,n=Ah("Click to toggle the bookmarks list"),s=Ah("Bookmarks");return ol`
<div class="list-container list-container--bookmarks ${t?"":"hidden"}">
<a class="list-toggle bookmarks-toggle controlbox-padded"
title="${n}"
@click=${e.toggleBookmarksList}>
<span class="fa ${e.toggle_state===wa.OPENED?"fa-caret-down":"fa-caret-right"}">
</span> ${s}</a>
<div class="items-list bookmarks rooms-list ${e.toggle_state!==wa.OPENED?"hidden":""}">
2021-12-23 22:20:17 +01:00
${wa.bookmarks.map((t=>kg(Object.assign({bm:t},e))))}
</div>
</div>
2021-12-23 22:20:17 +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");$g.hasClass("fa-caret-down",n)?($g.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"),$g.slideOut(this.querySelector(".bookmarks")),this.model.save({"toggle-state":wa.OPENED}))}}Nl.elements.define("converse-bookmarks",Ig);const{u:Mg}=Il.env,Rg={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)),Mg.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",Il.MUC.VIEWS.BOOKMARK)}};var Dg=n(5251),Lg={};Lg.styleTagTransform=yg(),Lg.setAttributes=mg(),Lg.insert=hg().bind(null,"head"),Lg.domAPI=dg(),Lg.insertStyleElement=pg(),cg()(Dg.Z,Lg),Dg.Z&&Dg.Z.locals&&Dg.Z.locals,Il.plugins.add("converse-bookmark-views",{dependencies:["converse-chatboxes","converse-muc","converse-muc-views"],initialize(){Nl.settings.extend({hide_open_bookmarks:!0}),wa.removeBookmarkViaEvent=Ag,wa.addBookmarkViaEvent=Cg,Object.assign(wa.ChatRoomView.prototype,Rg),wa.MUCBookmarkForm=Sg,wa.BookmarksView=Ig,Nl.listen.on("getHeadingButtons",Eg),Nl.listen.on("chatRoomViewInitialized",(e=>e.setBookmarkState()))}});const zg=e=>(...t)=>({_$litDirective$:e,values:t});class Pg{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:Fg}=Sl,Ug=()=>document.createComment(""),Bg=(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(Ug(),r),s=i.insertBefore(Ug(),r);n=new Fg(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},qg=(e,t,n=e)=>(e.I(t,n),e),Hg={},Gg=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}},Wg=(e,t,n)=>{const s=new Map;for(let i=t;i<=n;i++)s.set(e[i],i);return s},Vg=zg(class extends Pg{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]=qg(r[h],o[m]),h++,m++;else if(c[f]===a[g])l[g]=qg(r[f],o[g]),f--,g--;else if(c[h]===a[g])l[g]=qg(r[h],o[g]),Bg(e,l[g+1],r[h]),h++,g--;else if(c[f]===a[m])l[m]=qg(r[f],o[m]),Bg(e,r[h],r[f]),f--,m++;else if(void 0===d&&(d=Wg(a,m,g),u=Wg(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=Bg(e,r[h]);qg(t,o[m]),l[m]=t}else l[m]=qg(n,o[m]),Bg(e,r[h],n),r[t]=null;m++}else Gg(r[f]),f--;else Gg(r[h]),h++;for(;m<=g;){const t=Bg(e,l[g+1]);qg(t,o[m]),l[m++]=t}for(;h<=f;){const e=r[h++];null!==e&&Gg(e)}return this.Pt=a,((e,t=Hg)=>{e.H=t})(e,l),al}});function Jg(e){const{CONTROLBOX_TYPE:t}=wa,n="overlayed"===Nl.settings.get("view_mode")&&e.get("minimized");return e.get("type")===t||!(e.get("hidden")||n)}N
<div class="inner-content converse-brand row">
<div class="converse-brand__padding"></div>
<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</title>
<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"/>
</linearGradient>
<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"/>
</feMerge>
</filter>
</defs>
<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>
</svg>
<span class="converse-brand__text">
<span>converse<span class="subdued">.js</span></span>
<p class="byline">messaging freedom</p>
</span>
</div>
2021-12-23 22:20:17 +01:00
${"overlayed"===Nl.settings.get("view_mode")?ol`<div class="converse-brand__padding"></div>`:""}
</div>`,t),document.querySelector("body").classList.add(`converse-${Nl.settings.get("view_mode")}`),Nl.trigger("chatBoxViewsInitialized")}render(){return(()=>{const{chatboxes:e,CONTROLBOX_TYPE:t,CHATROOMS_TYPE:n,HEADLINES_TYPE:s}=wa,i=Nl.settings.get("view_mode"),r=null==wa?void 0:wa.connection,o=!(null!=r&&r.connected)||!(null!=r&&r.authenticated)||(null==r?void 0:r.disconnecting);return ol`
${o||"overlayed"!==i?"":ol`<converse-minimized-chats></converse-minimized-chats>`}
${Vg(e.filter(Jg),(e=>e.get("jid")),(e=>e.get("type")===t?ol`
${"overlayed"===i?ol`<converse-controlbox-toggle class="${e.get("closed")?"":"hidden"}"></converse-controlbox-toggle>`:""}
<converse-controlbox
id="controlbox"
class="chatbox ${"overlayed"===i&&e.get("closed")?"hidden":""} ${o?"logged-out":""}"
style="${e.get("width")?`width: ${e.get("width")}`:""}"></converse-controlbox>
2021-12-23 22:20:17 +01:00
`:e.get("type")===n?ol`
<converse-muc jid="${e.get("jid")}" class="chatbox chatroom"></converse-muc>
2021-12-23 22:20:17 +01:00
`:e.get("type")===s?ol`
<converse-headlines jid="${e.get("jid")}" class="chatbox headlines"></converse-headlines>
2021-12-23 22:20:17 +01:00
`:ol`
<converse-chat jid="${e.get("jid")}" class="chatbox"></converse-chat>
`))}
2021-12-23 22:20:17 +01:00
`})()}});function Qg(){const e=.01*window.innerHeight;document.documentElement.style.setProperty("--vh",`${e}px`)}var Zg=n(6931),Kg={};Kg.styleTagTransform=yg(),Kg.setAttributes=mg(),Kg.insert=hg().bind(null,"head"),Kg.domAPI=dg(),Kg.insertStyleElement=pg(),cg()(Zg.Z,Kg),Zg.Z&&Zg.Z.locals&&Zg.Z.locals,Il.plugins.add("converse-chatboxviews",{dependencies:["converse-chatboxes","converse-vcard"],initialize(){Nl.promises.add(["chatBoxViewsInitialized"]),Nl.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"}))))}},Nl.listen.on("chatBoxesInitialized",(()=>{wa.chatboxes.on("destroy",(e=>wa.chatboxviews.remove(e.get("jid"))))})),Nl.listen.on("cleanup",(()=>delete wa.chatboxviews)),Nl.listen.on("clearSession",(()=>wa.chatboxviews.closeAllChatBoxes())),Nl.listen.on("chatBoxViewsInitialized",Qg),window.addEventListener("resize",Qg),Object.assign(Il,{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 Yg=n(6151),Xg=n.n(Yg);const ep=/^\s*</,tp=("undefined"!=typeof Element&&Element.prototype,function(e){this.cid=Ts("view"),this._domEvents=[],this.preinitialize.apply(this,arguments),Ct(this,jo(e,sp)),this._ensureElement(),this.initialize.apply(this,arguments)});tp.extend=Ws;const np=/^(\S+)\s*(.*)$/,sp=["model","collection","el","id","attributes","className","tagName","events"];Object.assign(tp.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)&&dl(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(ep.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(np);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
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header ${e.level}">
<h5 class="modal-title">${e.title}</h5>
2021-12-23 22:20:17 +01:00
${dp}
</div>
<div class="modal-body">
<span class="modal-alert"></span>
2021-12-23 22:20:17 +01:00
${e.messages.map((e=>ol`<p>${e}</p>`))}
</div>
</div>
2021-12-23 22:20:17 +01:00
</div>`)(Object.assign({__:Ah},this.model.toJSON()))}}),hp=cp.extend({id:"confirm-modal",events:{"submit .confirm":"onConfimation"},initialize(){this.confirmation=ji(),cp.prototype.initialize.apply(this,arguments),this.listenTo(this.model,"change",this.render),this.el.addEventListener("closed.bs.modal",(()=>this.confirmation.reject()),!1)},toHTML(){return(e=>ol`
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header ${e.level||""}">
<h5 class="modal-title">${e.title}</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body">
<span class="modal-alert"></span>
<form class="converse-form converse-form--modal confirm" action="#">
<div class="form-group">
2021-12-23 22:20:17 +01:00
${e.messages.map((e=>ol`<p>${e}</p>`))}
</div>
2021-12-23 22:20:17 +01:00
${e.fields.map((e=>(e=>ol`
<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}" />
</label>
</div>
`)(e)))}
<div class="form-group">
2021-12-23 22:20:17 +01:00
<button type="submit" class="btn btn-primary">${Ah("OK")}</button>
<input type="button" class="btn btn-secondary" data-dismiss="modal" value="${Ah("Cancel")}"/>
</div>
</form>
</div>
</div>
</div>
2021-12-23 22:20:17 +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 fp=[];const mp={modal:{show(e,t,n){const s=this.get(e.id)||this.create(e,t);return s.show(n),s},get:e=>fp.filter((t=>t.id==e)).pop(),create(e,t){const n=new e(t);return fp.push(n),n},remove(e){fp=fp.filter((t=>t!==e)),e.remove()},removeAll(){fp.forEach((e=>e.remove())),fp=[]}},async confirm(e,t=[],n=[]){"string"==typeof t&&(t=[t]);const s=new Xo({title:e,messages:t,fields:n,type:"confirm"}),i=new hp({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 hp({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"});mp.modal.show(up,{model:i})}},gp=mp;Il.env.BootstrapModal=cp,Il.plugins.add("converse-modal",{initialize(){Nl.listen.on("disconnect",(()=>{const e=document.querySelector("#converse-modals");e&&(e.innerHTML="")})),Nl.listen.on("clearSession",(()=>Nl.modal.removeAll())),Object.assign(wa.api,gp)}});const pp=(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),pp(e,t);return!0},vp=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))},yp=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),wp(t)}};function bp(e){void 0!==this.N?(vp(this),this.M=e,yp(this)):this.M=e}function _p(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++)pp(s[e],!1),vp(s[e]);else null!=s&&(pp(s,!1),vp(s));else pp(this,e)}const wp=e=>{var t,n,s,i;2==e.type&&(null!==(t=(s=e).P)&&void 0!==t||(s.P=_p),null!==(n=(i=e).Q)&&void 0!==n||(i.Q=bp))};class Sp extends Pg{constructor(){super(...arguments),this.isConnected=!0,this.ut=al,this.N=void 0}T(e,t,n){super.T(e,t,n),yp(this)}O(e,t=!0){this.at(e),t&&(pp(this,e),vp(this))}at(e){var t,n;e!==this.isConnected&&(e?(this.isConnected=!0,this.ut!==al&&(this.setValue(this.ut),this.ut=al),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 xp=e=>!(e=>null===e||"object"!=typeof e&&"function"!=typeof e)(e)&&"function"==typeof e.then,Ep=zg(class extends Sp{constructor(){super(...arguments),this.Ct=2147483647,this.Rt=[]}render(...e){var t;return null!==(t=e.find((e=>!xp(e))))&&void 0!==t?t:al}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(!xp(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 al}});var Ap=n(4166),Cp={};Cp.styleTagTransform=yg(),Cp.setAttributes=mg(),Cp.insert=hg().bind(null,"head"),Cp.domAPI=dg(),Cp.insertStyleElement=pg(),cg()(Ap.Z,Cp),Ap.Z&&Ap
class="chat-msg__actions ${e?"dropup dropup--left":"dropleft"}"
.items=${t}
2021-12-23 22:20:17 +01:00
></converse-dropdown>`:""}static getActionsDropdownItem(e){return ol`
<button class="chat-msg__action ${e.button_class}" @click=${e.handler}>
<converse-icon
class="${e.icon_class}"
2021-12-23 22:20:17 +01:00
path-prefix="${Nl.settings.get("assets_path")}"
color="var(--text-color-lighten-15-percent)"
size="1em"
></converse-icon>
${e.i18n_text}
</button>
2021-12-23 22:20:17 +01:00
`}onMessageEditButtonClicked(e){var t,n;e.preventDefault();const s=this.model.collection.findWhere("correcting"),i=null===(t=kp.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(Ah("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=Ah("Be aware that other XMPP/Jabber clients (and servers) may not yet support retractions and that this message may not be removed everywhere."),t=[Ah("Are you sure you want to retract this message?")];Nl.settings.get("show_retraction_warning")&&(t[1]=e),await Nl.confirm(Ah("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=Ah("A timeout occurred while trying to retract the message");Nl.alert("error",Ah("Error"),e),M(e,Tp.LogLevel.WARN)}else if(kp.isErrorStanza(n)){const e=Ah("Sorry, you're not allowed to retract this message.");Nl.alert("error",Ah("Error"),e),M(e,Tp.LogLevel.WARN),M(n,Tp.LogLevel.WARN)}}async onMUCMessageRetractButtonClicked(){const e=Ah("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=[Ah("Are you sure you want to retract this message?")];Nl.settings.get("show_retraction_warning")&&(t[1]=e),await Nl.confirm(Ah("Confirm"),t)&&this.model.collection.chatbox.retractOwnMessage(this.model)}else if(await this.model.mayBeModerated())if("me"===this.model.get("sender")){let t=[Ah("Are you sure you want to retract this message?")];Nl.settings.get("show_retraction_warning")&&(t=[t[0],e,t[1]]),await Nl.confirm(Ah("Confirm"),t)&&this.retractOtherMessage()}else{let t=[Ah("You are about to retract this message."),Ah("You may optionally include a message, explaining the reason for the retraction.")];Nl.settings.get("show_retraction_warning")&&(t=[t[0],e,t[1]]);const n=await Nl.prompt(Ah("Message Retraction"),t,Ah("Optional reason"));!1!==n&&this.retractOtherMessage(n)}else{const e=Ah("Sorry, you're not allowed to retract this message");Nl.alert("error",Ah("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=Nl.settings.get("render_media");return Array.isArray(t)?e.reduce(((e,n)=>e||!Pl(t,n)),!1):!t}getMediaURLs(){const e=(this.model.get("ogp_metadata")||[]).map((e=>({url:e["og:image"],is_image:!0}))).filter((e=>ql(e))),t=Ad(this.model.get("media_urls")||[],this.model.get("body")).filter((e=>ql(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:Ah(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")?Ah("Cancel Editing"):Ah("Edit"),handler
<div class="modal-dialog fit-content" role="document">
<div class="modal-content fit-content">
<div class="modal-header">
2021-12-23 22:20:17 +01:00
<h4 class="modal-title" id="message-versions-modal-label">${Ah("Image: ")}<a target="_blank" rel="noopener" href="${e.src}">${e.src}</a></h4>
${dp}
</div>
<div class="modal-body modal-body--image fit-content">
<img class="chat-image" src="${e.src}" @load=${e.onload}>
</div>
2021-12-23 22:20:17 +01:00
<div class="modal-footer">${lp}</div>
</div>
2021-12-23 22:20:17 +01:00
</div>`)({src:this.src,onload:e=>e.target.parentElement.style.height=`${e.target.height}px`})}}),Op=(e,t)=>ol`<audio controls src="${e}"></audio>${t?"":ol`<a target="_blank" rel="noopener" href="${e}">${e}</a>`}`;class $p{constructor(e){e.toString().indexOf("ArrayBuffer")>0&&(e=new Uint8Array(e)),this.data=e,this.len=this.data.length,this.pos=0}readByte(){if(this.pos>=this.data.length)throw new Error("Attempted to read past end of stream.");return this.data instanceof Uint8Array?this.data[this.pos++]:255&this.data.charCodeAt(this.pos++)}readBytes(e){const t=[];for(let n=0;n<e;n++)t.push(this.readByte());return t}read(e){let t="";for(let n=0;n<e;n++)t+=String.fromCharCode(this.readByte());return t}readUnsigned(){const e=this.readBytes(2);return(e[1]<<8)+e[0]}}function Ip(e){return e.reduce((function(e,t){return 2*e+t}),0)}function Mp(e){const t=[];for(let n=7;n>=0;n--)t.push(!!(e&1<<n));return t}function Rp(e){let t,n;n="";do{t=e.readByte(),n+=e.read(t)}while(0!==t);return n}function Dp(e,t){const n=[];for(let s=0;s<t;s++)n.push(e.readBytes(3));return n}function Lp(e,t){const n={};switch(n.sentinel=e.readByte(),String.fromCharCode(n.sentinel)){case"!":n.type="ext",function(e,t,n){switch(t.label=e.readByte(),t.label){case 249:t.extType="gce",function(t){e.readByte();const s=Mp(e.readByte());t.reserved=s.splice(0,3),t.disposalMethod=Ip(s.splice(0,3)),t.userInput=s.shift(),t.transparencyGiven=s.shift(),t.delayTime=e.readUnsigned(),t.transparencyIndex=e.readByte(),t.terminator=e.readByte(),null==n||n.gce(t)}(t);break;case 254:t.extType="com",function(t){t.comment=Rp(e),n.com&&n.com(t)}(t);break;case 1:t.extType="pte",function(t){e.readByte(),t.ptHeader=e.readBytes(12),t.ptData=Rp(e),n.pte&&n.pte(t)}(t);break;case 255:t.extType="app",function(t){switch(e.readByte(),t.identifier=e.read(8),t.authCode=e.read(3),t.identifier){case"NETSCAPE":!function(t){e.readByte(),t.unknown=e.readByte(),t.iterations=e.readUnsigned(),t.terminator=e.readByte(),n.app&&n.app.NETSCAPE&&n.app.NETSCAPE(t)}(t);break;default:!function(t){t.appData=Rp(e),n.app&&n.app[t.identifier]&&n.app[t.identifier](t)}(t)}}(t);break;default:t.extType="unknown",function(t){t.data=Rp(e),n.unknown&&n.unknown(t)}(t)}}(e,n,t);break;case",":n.type="img",function(e,t,n){t.leftPos=e.readUnsigned(),t.topPos=e.readUnsigned(),t.width=e.readUnsigned(),t.height=e.readUnsigned();const s=Mp(e.readByte());t.lctFlag=s.shift(),t.interlaced=s.shift(),t.sorted=s.shift(),t.reserved=s.splice(0,2),t.lctSize=Ip(s.splice(0,3)),t.lctFlag&&(t.lct=Dp(e,1<<t.lctSize+1)),t.lzwMinCodeSize=e.readByte();const i=Rp(e);t.pixels=function(e,t){let n=0;function s(e){let s=0;for(let i=0;i<e;i++)t.charCodeAt(n>>3)&1<<(7&n)&&(s|=1<<i),n++;return s}const i=[],r=1<<e,o=r+1;let a=e+1,c=[];const l=function(){c=[],a=e+1;for(let e=0;e<r;e++)c[e]=[e];c[r]=[],c[o]=null};let d,u;for(;;)if(u=d,d=s(a),d!==r){if(d===o)break;if(d<c.length)u!==r&&c.push(c[u].concat(c[d][0]));else{if(d!==c.length)throw new Error("Invalid LZW code.");c.push(c[u].concat(c[u][0]))}i.push.apply(i,c[d]),c.length===1<<a&&a<12&&a++}else l();return i}(t.lzwMinCodeSize,i),t.interlaced&&(t.pixels=function(e,t){const n=new Array(e.length),s=e.length/t;function i(s,i){const r=e.slice(i*t,(i+1)*t);n.splice.apply(n,[s*t,t].concat(r))}const r=[0,4,2,1],o=[8,8,4,2];let a=0;for(let e=0;e<4;e++)for(let t=r[e];t<s;t+=o[e])i(t,a),a++;return n}(t.pixels,t.width)),null==n||n(t)}(e,n,null==t?void 0:t.img);break;case";":n.type="eof",null==t||t.eof(n);break;default:throw new Error("Unknown block: 0x"+n.sentinel.toString(16))}"eof"!==n.type&&setTimeout((()=>Lp(e,t)),0)}class zp{constructor(e,t){this.options=Object.assign({width:null,height:null,autoplay:!0,loop:!0,show_progress_bar:!0,progress_bg_color:"rgba(0,0,0,0.4)",progress_color:"rgba(255,0,22,.8)",progress_bar_height:5},t),this.el=e,this.gif_el=e.querySelector("img"),this.canvas=e.querySelector("canvas"),this.ctx=this.canvas.getContext("2d"),this.offscreenCanvas=document.createElement("canvas"),this.ctx_scaled=!1,this.disposal_method=null,this.disposal_restore_from_idx=null,this.frame=null,this.frame
<div class="form-group">
2021-12-23 22:20:17 +01:00
${"hidden"!==e.type?ol`<label for="${e.id}">${e.label}</label>`:""}
<!-- This is a hack to prevent Chrome from auto-filling the username in
any of the other input fields in the MUC configuration form. -->
2021-12-23 22:20:17 +01:00
${"password"===e.type&&e.fixed_username?ol`
<input class="hidden-username" type="text" autocomplete="username" value="${e.fixed_username}"></input>
`:""}
<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} />
2021-12-23 22:20:17 +01:00
</div>`,Up=e=>ol`
<label>${e.label}
<a class="form-url" target="_blank" rel="noopener" href="${e.value}">${e.value}</a>
2021-12-23 22:20:17 +01:00
</label>`,Bp=e=>ol`
<div class="form-group">
2021-12-23 22:20:17 +01:00
${e.label?ol`<label>${e.label}</label>`:""}
<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}</div>
</div>
</div>
2021-12-23 22:20:17 +01:00
</div>`;function qp(e){e.preventDefault(),Nl.rooms.open(e.target.href)}const Hp=(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?ol`
<a target="_blank"
rel="noopener"
2021-12-23 22:20:17 +01:00
@click=${qp}
href="${n}">${i}</a>`:ol`<a target="_blank" rel="noopener" href="${n}">${i}</a>`},Gp=(e,t)=>ol`<video controls preload="metadata" src="${e}"></video>${t?"":ol`<a target="_blank" rel="noopener" href="${e}">${e}</a>`}`,{sizzle:Wp}=Il.env,Vp=["http","https","xmpp","mailto"];function Jp(e,t){return{"muc#roomconfig_lang":"language","muc#roomconfig_roomsecret":null!=t&&t.new_password?"new-password":"current-password"}[e]}const Qp={"text-private":"password","text-single":"text",fixed:"label",boolean:"checkbox",hidden:"hidden","jid-multi":"textarea","list-single":"dropdown","list-multi":"dropdown"},Zp={"xs:anyURI":"url","xs:byte":"number","xs:date":"date","xs:dateTime":"datetime","xs:int":"number","xs:integer":"number","xs:time":"time"};function Kp(e){const t=Qp[e.getAttribute("type")];if("text"==t){const n=e.getElementsByTagNameNS("http://jabber.org/protocol/xdata-validate","validate");if(1===n.length){const e=n[0].getAttribute("datatype");return Zp[e]||t}}return t}function Yp(e){const t=Ll(e);return null===t?e:Vl(t)?Gp(e):Wl(t)?Op(e):(Jl(t),Pp(t.toString(),function(e){try{return decodeURI(e.filename())}catch(t){return M.debug(t),e.filename()}}(t)))}function Xp(e){const t=RegExp("^w{3}.","ig").test(e)?`http://${e}`:e,n=Ll(e);return null===n||!function(e){try{return!!new URL(e)}catch(e){return!1}}(t)||!function(e,t=Vp){return!!t.includes(e)}(n._parts.protocol)&&n._parts.protocol?e:Hp(n,e)}function ev(e,t){e.classList.remove("visible"),ve(t)&&t()}ha.calculateElementHeight=function(e){return Array.from(e.children).reduce(((e,t)=>e+t.offsetHeight),0)},ha.getNextElement=function(e,t="*"){let n=e.nextElementSibling;for(;null!==n&&!Wp.matchesSelector(n,t);)n=n.nextElementSibling;return n},ha.getPreviousElement=function(e,t="*"){let n=e.previousElementSibling;for(;null!==n&&!Wp.matchesSelector(n,t);)n=n.previousElementSibling;return n},ha.getFirstChildElement=function(e,t="*"){let n=e.firstElementChild;for(;null!==n&&!Wp.matchesSelector(n,t);)n=n.nextElementSibling;return n},ha.getLastChildElement=function(e,t="*"){let n=e.lastElementChild;for(;null!==n&&!Wp.matchesSelector(n,t);)n=n.previousElementSibling;return n},ha.hasClass=function(e,t){return t instanceof Element&&t.classList.contains(e)},ha.toggleClass=function(e,t){ha.hasClass(e,t)?ha.removeClass(e,t):ha.addClass(e,t)},ha.addClass=function(e,t){return t instanceof Element&&t.classList.add(e),t},ha.removeClass=function(e,t){return t instanceof Element&&t.classList.remove(e),t},ha.removeElement=function(e){return e instanceof Element&&e.parentNode&&e.parentNode.removeChild(e),e},ha.getElementFromTemplateResult=function(e){const t=document.createElement("div");return dl(e,t),t.firstElementChild},ha.showElement=e=>{ha.removeClass("collapsed",e),ha.removeClass("hidden",e)},ha.hideElement=function(e){return e instanceof Element&&e.classList.add("hidden"),e},ha.ancestor=function(e,t){let n=e;for(;null!==n&&!Wp.matchesSelector(n,t);)n=n.parentElement;return n},ha.nextUntil=function(e,t){const n=[];let s=e.nextElementSibling;for(;null!==s&&!s.matches(t);)n.push(s),s=s.nextElementSibling;return n},ha.unescapeHTML=function(e){var t=document.createElement("div");return t.innerHTML=e,t.innerText},ha.escapeHTML=function(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")},ha.slideInAllElements=function(e,t=300){return Promise.all(Array.from(e).map((e=>ha.slideIn(e,t))))},ha.slideToggleElement=function(e,t){return ha.hasClass("collapsed",e)||ha.hasClass("hidden",e)?ha.slideOut(e,t):ha.slideIn(e,t)},ha.slideOut=function(e,t=200){return new Promise(((n,s)=>{if(!e){const e="An element needs to be passed in to slideOut";return M.warn(e),void s(new Error(e))}const i=e.getAttribute("data-slider-marker");i&&(e.removeAttribute("data-slider-marker"),window.cancelAnimationFrame(i));const r=ha.calculateElementHeight(e);if(window.converse_disable_effects)return e.style.height=r+"px",function(e){e.removeAttribute("data-slider-marker"),e.classList.remove("collapsed"),e.style.overflow="",e.style.height=""}(e),void n();if(!ha.hasClass("collapsed"
<div class="form-group">
<label for="${e.id}">${e.label}</label>
<select class="form-control" id="${e.id}" name="${e.name}" ?multiple="${e.multiple}">
2021-12-23 22:20:17 +01:00
${null===(t=e.options)||void 0===t?void 0:t.map((e=>(e=>ol`<option value="${e.value}" ?selected="${e.selected}">${e.label}</option>`)(e)))}
</select>
2021-12-23 22:20:17 +01:00
</div>`})({options:ha.queryChildren(e,"option").map((n=>{var s;const i=null===(s=n.querySelector("value"))||void 0===s?void 0:s.textContent;return{value:i,label:n.getAttribute("label"),selected:t.includes(i),required:!!e.querySelector("required")}})),id:ha.getUniqueId(),label:e.getAttribute("label"),multiple:"list-multi"===e.getAttribute("type"),name:e.getAttribute("var"),required:!!e.querySelector("required")})}var s,i,r,o;if("fixed"===e.getAttribute("type"))return(e=>ol`<p class="form-help">${e.text}</p>`)({text:null===(s=e.querySelector("value"))||void 0===s?void 0:s.textContent});if("jid-multi"===e.getAttribute("type"))return(e=>ol`
<label class="label-ta">${e.label}</label>
<textarea name="${e.name}">${e.value}</textarea>
2021-12-23 22:20:17 +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=>ol`
<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}</label>
2021-12-23 22:20:17 +01:00
</fieldset>`)({id:ha.getUniqueId(),name:e.getAttribute("var"),label:e.getAttribute("label")||"",checked:"1"===t||"true"===t?'checked="1"':"",required:!!e.querySelector("required")})}if("url"===e.getAttribute("var"))return Up({label:e.getAttribute("label")||"",value:null===(r=e.querySelector("value"))||void 0===r?void 0:r.textContent});if("username"===e.getAttribute("var"))return Bp({domain:" @"+n.domain,name:e.getAttribute("var"),type:Kp(e),label:e.getAttribute("label")||"",value:null===(o=e.querySelector("value"))||void 0===o?void 0:o.textContent,required:!!e.querySelector("required")});if("ocr"===e.getAttribute("var")){const n=e.querySelector("uri"),s=Wp('data[cid="'+n.textContent.replace(/^cid:/,"")+'"]',t)[0];return(e=>ol`
<fieldset class="form-group">
2021-12-23 22:20:17 +01:00
${e.label?ol`<label>${e.label}</label>`:""}
<img src="data:${e.type};base64,${e.data}">
<input name="${e.name}" type="text" ?required="${e.required}" />
</fieldset>
2021-12-23 22:20:17 +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 Fp({id:ha.getUniqueId(),label:e.getAttribute("label")||"",name:t,fixed_username:null==n?void 0:n.fixed_username,autocomplete:Jp(t,n),placeholder:null,required:!!e.querySelector("required"),type:Kp(e),value:null===(c=e.querySelector("value"))||void 0===c?void 0:c.textContent})}},Object.assign(ha,{getOOBURLMarkup:Yp});const tv=ha;var nv=n(4903),sv={};sv.styleTagTransform=yg(),sv.setAttributes=mg(),sv.insert=hg().bind(null,"head"),sv.domAPI=dg(),sv.insertStyleElement=pg(),cg()(nv.Z,sv),nv.Z&&nv.Z.locals&&nv.Z.locals,Nl.elements.define("converse-gif",class extends rg{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 zp(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():ol`<canvas class="gif-canvas"
@mouseover=${()=>this.setHover()}
@mouseleave=${()=>this.unsetHover()}
2021-12-23 22:20:17 +01:00
@click=${e=>this.onControlsClicked(e)}><img class="gif" src="${this.src}"></a></canvas>`}renderErrorFallback(){return"url"===this.fallback?Xp(this.src):"empty"===this.fallback?"":void 0}setHover(){this.supergif&&(this.supergif.hovering=!0,this.hover_timeout&&clearTimeout(this.hover_timeout),this.hover_timeout=setTimeout((()=>this.unsetHover()),2e3))}unsetHover(){this.supergif&&(this.supergif.hovering=!1)}onControlsClicked(e){e.preventDefault(),this.supergif.playing?this.supergif.pause():(this.supergif.options.loop=!0,this.supergif.play())}});const iv=(e,t)=>ol`<converse-gif autoplay noloop fallback='empty' src=${e}></converse-gif>${t?"":ol`<a target="_blank" rel="noopener" href="${e}">${e}</a>`}`,{URI:rv}=Il.env,ov=zg(class extends Sp{render(e,t,n,s){return t?ol`<a href="${t}" class="chat-image__link" target="_blank" rel="noopener">${this.renderImage(e,t,n,s)}</a>`:this.renderImage(e,t,n,s)}renderImage(e,t,n,s){return ol`<img class="chat-image img-thumbnail"
src="${e}"
@click=${s}
@error=${()=>this.onError(e,t,n,s)}
2021-12-23 22:20:17 +01:00
@load=${n}/></a>`}onError(e,t,n,s){if(Hl(e))t&&this.setValue(Xp(t));else{const i=new rv(e),r=i.filename();i.filename(`${r}.png`),this.setValue(ov(i.toString(),t,n,s))}}}),av=e=>ol`${ov(e.url,e.href,e.onLoad,e.onClick)}`,cv=zg(class extends Pg{render(e,t,n){const s=new bv(e,t,Object.assign(n,{show_images:!1,embed_videos:!1,embed_audio:!1}));return ol`${Ep(async function(e){try{await e.addTemplates()}catch(e){M.error(e)}return e.payload}(s),ol`${s}`)}`}}),lv=["*","_","~","`"],dv=[...lv,"```",">"],uv={"*":{name:"strong",type:"span"},_:{name:"emphasis",type:"span"},"~":{name:"strike",type:"span"},"`":{name:"preformatted",type:"span"},"```":{name:"preformatted_block",type:"block"},">":{name:"quote",type:"block"}},hv=["_",">","`","~"],fv={emphasis:(e,t,n)=>ol`<span class="styling-directive">_</span><i>${cv(e,t,n)}</i><span class="styling-directive">_</span>`,preformatted:e=>ol`<span class="styling-directive">\`</span><code>${e}</code><span class="styling-directive">\`</span>`,preformatted_block:e=>ol`<div class="styling-directive">\`\`\`</div><code class="block">${e}</code><div class="styling-directive">\`\`\`</div>`,quote:(e,t,n)=>ol`<blockquote>${cv(e,t,n)}</blockquote>`,strike:(e,t,n)=>ol`<span class="styling-directive">~</span><del>${cv(e,t,n)}</del><span class="styling-directive">~</span>`,strong:(e,t,n)=>ol`<span class="styling-directive">*</span><b>${cv(e,t,n)}</b><span class="styling-directive">*</span>`};function mv(e,t,n=!0){let s;if(!/(^```\s*\n|^```\s*$)/.test(e.slice(t))||0!==t&&"\n"!==e[t-1]&&">"!==e[t-1]){if(!dv.includes(e.slice(t,t+1)))return null;if(s=e.slice(t,t+1),!function(e,t,n,s){if(s){const s=RegExp(hv.includes(e)?`^(\\p{L}|\\p{N})${e}`:`^(\\p{L}|\\p{N})\\${e}`,"u");if(n>1&&s.test(t.slice(n-1)))return!1;if(pv(e)&&n>0&&"\n"!==t[n-1])return!1;if(lv.includes(e)&&t[n+1]===e)return!1}else{const s=RegExp(hv.includes(e)?`^${e}(\\p{L}|\\p{N})`:`^\\${e}(\\p{L}|\\p{N})`,"u");if(n<t.length-1&&s.test(t.slice(n)))return!1;if(lv.includes(e)&&t[n-1]===e)return!1}return!0}(s,e,t,n))return null}else s=e.slice(t,t+3);return s}function gv(e,t){const n=mv(e,t),s=n?function(e,t,n){if(!e)return 0;const s=n;if(n+=e.length,pv(e))return(n+=t.slice(n).split(/\n[^>]/).shift().length)-s;if("span"===uv[e].type){const s=t.slice(n).split("\n").shift();let i=0,r=s.indexOf(e);for(;-1!==r;){if(mv(t,n+r,!1)===e)return r+2*e.length;r=s.indexOf(e,i++)}return 0}{const s=t.slice(n+1);let i=0,r=s.indexOf(e);for(;-1!==r;){if(mv(t,n+1+r,!1)===e)return r+1+2*e.length;r=s.indexOf(e,i++)}return 0}}(n,e,t):0;return s>0?{d:n,length:s}:{}}const pv=e=>[">","&gt;"].includes(e);function vv(e,t,n,s){const i=fv[uv[e].name];return pv(e)?i(t.replace(/\n>/g,"\n").replace(/\n$/,""),n,s):i(t,n,s)}const yv=e=>"string"==typeof e;class bv extends String{constructor(e,t=0,n={}){super(e),this.embed_audio=null==n?void 0:n.embed_audio,this.embed_videos=null==n?void 0:n.embed_videos,this.mentions=(null==n?void 0:n.mentions)||[],this.media_urls=null==n?void 0:n.media_urls,this.nick=null==n?void 0:n.nick,this.offset=t,this.onImgClick=null==n?void 0:n.onImgClick,this.onImgLoad=null==n?void 0:n.onImgLoad,this.options=n,this.payload=[],this.references=[],this.render_styling=null==n?void 0:n.render_styling,this.show_images=null==n?void 0:n.show_images,this.hide_media_urls=null==n?void 0:n.hide_media_urls}shouldRenderMedia(e,t){let n;return"image"===t?n=this.show_images:"audio"===t?n=this.embed_audio:"video"===t&&(n=this.embed_videos),"boolean"==typeof n?n:Fl(e,t)}addHyperlinks(e,t){const n=t+this.offset;Ad(this.media_urls||td(e).media_urls||[],e,n).filter((e=>!e.is_encrypted)).forEach((e=>{const n=e.url,s=Ul(n);let i;i=Gl(n)&&this.shouldRenderMedia(n,"image")?iv(s,this.hide_media_urls):Jl(n)&&this.shouldRenderMedia(n,"image")?av({url:s,href:this.hide_media_urls?null:s,onClick:this.onImgClick,onLoad:this.onImgLoad}):Vl(n)&&this.shouldRenderMedia(n,"video")?Gp(s,this.hide_media_urls):Wl(n)&&this.shouldRenderMedia(n,"audio")?Op(s,this.hide_media_urls):Xp(s),this.addTemplateResult(e.start+t,e.end+t,i)}))}addMapURLs(e,t){const n=/geo:([\-0-9.]+),([\-0-9.]+)(?:,([
<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}">
</button>
<div class="dropdown-menu">
2021-12-23 22:20:17 +01:00
${this.items.map((e=>Ep(e,"")))}
</div>
2021-12-23 22:20:17 +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 Nv(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!==Il.keycodes.DOWN_ARROW||this.navigator.enabled||this.enableArrowNavigation(e)}}Nl.elements.define("converse-dropdown",Rv);const Dv=e=>{return e.image?ol`
<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 slice" href="${t=e.image,n=e.image_type,t.startsWith("data:")?t:`data:${n};base64,${t}`}"/>
</svg>`:"";var t,n};var Lv=n(5222),zv={};zv.styleTagTransform=yg(),zv.setAttributes=mg(),zv.insert=hg().bind(null,"head"),zv.domAPI=dg(),zv.insertStyleElement=pg(),cg()(Lv.Z,zv),Lv.Z&&Lv.Z.locals&&Lv.Z.locals,Nl.elements.define("converse-avatar",class extends rg{static get properties(){return{data:{type:Object},width:{type:String},height:{type:String},nonce:{type:String}}}constructor(){super(),this.width=36,this.height=36}render(){var e,t;const n=(null===(e=this.data)||void 0===e?void 0:e.image_type)||wa.DEFAULT_IMAGE_TYPE;let s;var i,r;null!==(t=this.data)&&void 0!==t&&t.data_uri?s=null===(i=this.data)||void 0===i?void 0:i.data_uri:s="data:"+n+";base64,"+((null===(r=this.data)||void 0===r?void 0:r.image)||wa.DEFAULT_IMAGE);return Dv({classes:this.getAttribute("class"),height:this.height,width:this.width,image:s,image_type:n})}});const{dayjs:Pv}=Il.env;Nl.elements.define("converse-message-versions",class extends rg{static get properties(){return{model:{type:Object}}}render(){const e=this.model.get("older_versions"),t=this.model.get("message");return ol`
<h4>Older versions</h4>
2021-12-23 22:20:17 +01:00
${Object.keys(e).map((t=>ol`<p class="older-msg"><time>${Pv(t).format("MMM D, YYYY, HH:mm:ss")}</time>: ${e[t]}</p>`))}
<hr/>
<h4>Current version</h4>
2021-12-23 22:20:17 +01:00
<p>${t}</p>`}});const Fv=cp.extend({id:"message-versions-modal",toHTML(){return(e=>ol`
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
2021-12-23 22:20:17 +01:00
<h4 class="modal-title" id="message-versions-modal-label">${Ah("Message versions")}</h4>
${dp}
</div>
<div class="modal-body">
<converse-message-versions .model=${e}></converse-message-versions>
</div>
2021-12-23 22:20:17 +01:00
<div class="modal-footer">${lp}</div>
</div>
</div>
2021-12-23 22:20:17 +01:00
`)(this.model)}});var Uv=n(1551),Bv={};Bv.styleTagTransform=yg(),Bv.setAttributes=mg(),Bv.insert=hg().bind(null,"head"),Bv.domAPI=dg(),Bv.insertStyleElement=pg(),cg()(Uv.Z,Bv),Uv.Z&&Uv.Z.locals&&Uv.Z.locals;const qv=cp.extend({id:"muc-occupant",initialize(){cp.prototype.initialize.apply(this,arguments),this.model&&this.listenTo(this.model,"change",this.render),Nl.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 ol`
<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}</h5>
2021-12-23 22:20:17 +01:00
${dp}
</div>
2021-12-23 22:20:17 +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"></converse-avatar>
</div>
<div class="col">
<ul class="occupant-details">
<li>
${e.nick?ol`<div class="row"><strong>${Ah("Nickname")}:</strong></div><div class="row">${e.nick}</div>`:""}
</li>
<li>
${e.jid?ol`<div class="row"><strong>${Ah("XMPP Address")}:</strong></div><div class="row">${e.jid}</div>`:""}
</li>
<li>
${e.affiliation?ol`<div class="row"><strong>${Ah("Affiliation")}:</strong></div><div class="row">${e.affiliation}</div>`:""}
</li>
<li>
${e.role?ol`<div class="row"><strong>${Ah("Roles")}:</strong></div><div class="row">${e.role}</div>`:""}
</li>
<li>
${e.hats?ol`<div class="row"><strong>${Ah("Hats")}:</strong></div><div class="row">${e.hats}</div>`:""}
</li>
<li>
${e.occupant_id?ol`<div class="row"><strong>${Ah("Occupant Id")}:</strong></div><div class="row">${e.occupant_id}</div>`:""}
</li>
</ul>
</div>
</div>
</div>
<div class="modal-footer">
2021-12-23 22:20:17 +01:00
${lp}
</div>
</div>
</div>
2021-12-23 22:20:17 +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=qv;const Hv=qv,Gv=Il.env.utils,Wv=cp.extend({id:"user-details-modal",persistent:!0,events:{"click button.refresh-contact":"refreshContact"},initialize(){cp.prototype.initialize.apply(this,arguments),this.model.rosterContactAdded.then((()=>this.registerContactEventHandlers())),this.listenTo(this.model,"change",this.render),this.registerContactEventHandlers(),Nl.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=Ah("XMPP Address"),n=Ah("Email"),s=Ah("Full Name"),i=Ah("Nickname"),r=Ah("The User's Profile Image"),o=Ah("Refresh"),a=Ah("Role"),c=Ah("URL"),l={alt_text:r,extra_classes:"mb-3",height:"120",width:"120"};return ol`
<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}</h5>
2021-12-23 22:20:17 +01:00
${dp}
</div>
<div class="modal-body">
2021-12-23 22:20:17 +01:00
${e.image?ol`<div class="mb-4">${Dv(Object.assign(e,l))}</div>`:""}
${e.fullname?ol`<p><label>${s}:</label> ${e.fullname}</p>`:""}
<p><label>${t}:</label> <a href="xmpp:${e.jid}">${e.jid}</a></p>
2021-12-23 22:20:17 +01:00
${e.nickname?ol`<p><label>${i}:</label> ${e.nickname}</p>`:""}
${e.url?ol`<p><label>${c}:</label> <a target="_blank" rel="noopener" href="${e.url}">${e.url}</a></p>`:""}
${e.email?ol`<p><label>${n}:</label> <a href="mailto:${e.email}">${e.email}</a></p>`:""}
${e.role?ol`<p><label>${a}:</label> ${e.role}</p>`:""}
2021-12-23 22:20:17 +01:00
<converse-omemo-fingerprints jid=${e.jid}></converse-omemo-fingerprints>
</div>
<div class="modal-footer">
2021-12-23 22:20:17 +01:00
${lp}
<button type="button" class="btn btn-info refresh-contact"><i class="fa fa-refresh"> </i>${o}</button>
2021-12-23 22:20:17 +01:00
${e.allow_contact_removal&&e.is_roster_contact?(e=>{const t=Ah("Remove as contact");return ol`
<button type="button" @click="${e.removeContact}" class="btn btn-danger remove-contact">
<i class="far fa-trash-alt"></i>${t}
</button>
`})(e):""}
</div>
</div>
</div>
2021-12-23 22:20:17 +01:00
`})(Object.assign(this.model.toJSON(),n,{_converse:wa,allow_contact_removal:Nl.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:Gv}))},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");Gv.addClass("fa-spin",t);try{await Nl.vcard.update(this.model.contact.vcard,!0)}catch(e){M.fatal(e),this.alert(Ah("Sorry, something went wrong while trying to refresh"),"danger")}Gv.removeClass("fa-spin",t)},removeContact(e){var t;null==e||null===(t=e.preventDefault)||void 0===t||t.call(e),Nl.settings.get("allow_contact_removal")&&!0===confirm(Ah("Are you sure you want to remove this contact?"))&&(setTimeout((()=>function(e){e.removeFromRoster((()=>e.destroy()),(t=>{t&&M.error(t),Nl.alert("error",Ah("Error"),[Ah("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=Wv;const Vv=Wv,{dayjs:Jv}=Il.env,{dayjs:Qv}=Il.env;function Zv(e){return!!Ll(e).host()}Nl.elements.define("converse-image",class extends rg{static get properties(){return{href:{type:String},onImgLoad:{type:Function},text:{type:String}}}render(){const e=Ul(this.href);return Gl(this.text)&&this.shouldRenderMedia(this.text,"image")?iv(e):av({url:this.text,href:e,onClick:this.onImgClick,onLoad:this.onImgLoad})}});const Kv=(e,t)=>e.url&&Zv(e.url)&&!Gl(e.image)?ol`<a href="${e.url}" target="_blank" rel="noopener">${t(e)}</a>`:t(e),Yv=e=>ol`<converse-image class="card-img-top" text="${e.image}" href="${e.url}" .onImgLoad=${e.onload}></converse-image>`;var Xv=n(5046),ey={};ey.styleTagTransform=yg(),ey.setAttributes=mg(),ey.insert=hg().bind(null,"head"),ey.domAPI=dg(),ey.insertStyleElement=pg(),cg()(Xv.Z,ey),Xv.Z&&Xv.Z.locals&&Xv.Z.locals,Nl.elements.define("converse-message-unfurl",class extends rg{static get properties(){return{description:{type:String},image:{type:String},jid:{type:String},title:{type:String},url:{type:String}}}initialize(){const e=va();this.listenTo(e,"change:allowed_image_domains",(()=>this.requestUpdate())),this.listenTo(e,"change:render_media",(()=>this.requestUpdate()))}render(){return(e=>{const t=(n=e.image)&&Bl(n,"allowed_image_domains")&&Zv(n);var n;const s=e.title||e.description||e.url;return t||s?ol`<div class="card card--unfurl">
${t?Kv(e,Yv):""}
${s?ol` <div class="card-body">
${e.title?Kv(e,(e=>ol`<h5 class="card-title">${e.title}</h5>`)):""}
${e.description?ol`<p class="card-text">
<converse-rich-text text=${e.description}></converse-rich-text>
</p>`:""}
2021-12-23 22:20:17 +01:00
${e.url?ol`<p class="card-text">
<a href="${e.url}" target="_blank" rel="noopener">${Ll(e.url).domain()}</a>
</p>`:""}
</div>`:""}
2021-12-23 22:20:17 +01:00
</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 ty=n(9523),ny={};ny.styleTagTransform=yg(),ny.setAttributes=mg(),ny.insert=hg().bind(null,"head"),ny.domAPI=dg(),ny.insertStyleElement=pg(),cg()(ty.Z,ny),ty.Z&&ty.Z.locals&&ty.Z.locals;const sy=(e={})=>{var t;return null!==(t=e.classes)&&void 0!==t&&t.includes("hor_centered")?ol`<div class="spinner__container"><span class="spinner fa fa-spinner centered ${e.classes||""}"/></div>`:ol`<span class="spinner fa fa-spinner centered ${e.classes||""}"/>`};var iy=n(3279),ry=n.n(iy);const{dayjs:oy}=Il.env;function ay(e){if(!e.isHidden()&&Nl.settings.get("allow_url_history_change")){const t=window.location.hash;t&&e.messages.get(t.slice(1))&&wa.router.history.navigate()}}const cy=ry()((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,ay(t.model)):i&&Nl.trigger("chatBoxScrolledUp",t),t.model.get("scolled")!==n&&t.model.ui.set({scrolled:n})}(e)),50);function ly(e){if("groupchat"===e.get("type")){var t;const n=Nl.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:dy,dayjs:uy}=Il.env;Nl.elements.define("converse-chat-message",class extends rg{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 Nl.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?sy():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 ol`
<div class="retraction">${t}</div>
2021-12-23 22:20:17 +01:00
${e.model.get("moderation_reason")?ol`<q class="chat-msg--retracted__reason">${e.model.get("moderation_reason")}</q>`:""}`})(this)}renderMessageText(){return(e=>{const t=Ah("Show more"),n="groupchat"===e.model.get("type"),s=Ah("Show less"),i=ol`
<div class="chat-msg__spoiler-hint">
<span class="spoiler-hint">${e.model.get("spoiler_hint")}</span>
<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>
</div>
2021-12-23 22:20:17 +01:00
`,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 ol`
${e.model.get("is_spoiler")?i:""}
2021-12-23 22:20:17 +01:00
${e.model.get("subject")?ol`<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}"></converse-chat-message-body>
2021-12-23 22:20:17 +01:00
${!e.model.get("received")||e.model.isMeCommand()||n?"":ol`<span class="fa fa-check chat-msg__receipt"></span>`}
${e.model.get("edited")?(e=>{const t=Ah("This message has been edited");return ol`<converse-icon title="${t}" class="fa fa-edit chat-msg__edit-modal" @click=${e.showMessageVersionsModal} size="1em"></converse-icon>`})(e):""}
</span>
2021-12-23 22:20:17 +01:00
${a?ol`<div class="chat-msg__media">${Yp(e.model.get("oob_url"))}</div>`:""}
<div class="chat-msg__error">${e.model.get("error_text")||e.model.get("error")}</div>
2021-12-23 22:20:17 +01:00
`})(this)}renderMEPMessage(){return(e=>{const t=Qv(e.model.get("time")).toISOString();return ol`
<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">
2021-12-23 22:20:17 +01:00
${e.isRetracted()?e.renderRetraction():ol`
<converse-rich-text
.mentions=${e.model.get("references")}
render_styling
text=${e.model.getMessageText()}>
</converse-rich-text>
2021-12-23 22:20:17 +01:00
${e.model.get("reason")?ol`<q class="reason"><converse-rich-text text=${e.model.get("reason")}></converse-rich-text></q>`:""}
`}
</div>
<converse-message-actions
?is_retracted=${e.isRetracted()}
.model=${e.model}></converse-message-actions>
</div>
</div>
2021-12-23 22:20:17 +01:00
</div>`})(this)}renderInfoMessage(){return(e=>{const t=Jv(e.model.get("time")).toISOString(),n=Ah("Retry");return ol`
<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()}>
</converse-rich-text>
</div>
2021-12-23 22:20:17 +01:00
${e.model.get("reason")?ol`<q class="reason">${e.model.get("reason")}</q>`:""}
${e.model.get("error_text")?ol`<q class="reason">${e.model.get("error_text")}</q>`:""}
${e.model.get("retry_event_id")?ol`<a class="retry" @click=${e.onRetryClicked}>${n}</a>`:""}
</div>`})(this)}renderFileProgress(){return this.model.file?(e=>{var t,n;const s=Ah("Uploading file:"),i=e.model.file.name,r=Sd()(e.model.file.size);return ol`
<div class="message chat-msg">
${e.shouldShowAvatar()?ol`<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"></converse-avatar>
</a>`:""}
<div class="chat-msg__content">
<span class="chat-msg__text">${s} <strong>${i}</strong>, ${r}</span>
<progress value="${e.model.get("progress")}"/>
</div>
</div>`})(this):""}renderChatMessage(){return((e,t)=>{var n,s,i;const r=Ah("New messages"),o=e.model.isFollowup();return ol`
${t.is_first_unread?ol`<div class="message separator"><hr class="separator"><span class="separator-text">${r}</span></div>`:""}
<div class="message chat-msg ${e.getExtraMessageClasses()}"
data-isodate="${t.time}"
data-msgid="${t.msgid}"
data-from="${t.from}"
data-encrypted="${t.is_encrypted}">
<!-- Anchor to allow us to scroll the message into view -->
<a id="${t.msgid}"></a>
2021-12-23 22:20:17 +01:00
${t.should_show_avatar&&!o?ol`<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"></converse-avatar>
</a>`:""}
2021-12-23 22:20:17 +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?"":ol`
<span class="chat-msg__heading">
<span class="chat-msg__author"><a class="show-msg-author-modal" @click=${e.showUserModal}>${t.username}</a></span>
2021-12-23 22:20:17 +01:00
${t.hats.map((e=>ol`<span class="badge badge-secondary">${e.title}</span>`))}
<time timestamp="${e.model.get("edited")||e.model.get("time")}" class="chat-msg__time">${t.pretty_time}</time>
2021-12-23 22:20:17 +01:00
${t.is_encrypted?ol`<span class="fa fa-lock"></span>`:""}
</span>`}
2021-12-23 22:20:17 +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":""}">
<div class="chat-msg__message">
2021-12-23 22:20:17 +01:00
${t.is_me_message?ol`
<time timestamp="${t.edited||t.time}" class="chat-msg__time">${t.pretty_time}</time>&nbsp;
<span class="chat-msg__author">${t.is_me_message?"**":""}${t.username}</span>&nbsp;`:""}
${t.is_retracted?e.renderRetraction():e.renderMessageText()}
</div>
<converse-message-actions
.model=${e.model}
?is_retracted=${t.is_retracted}></converse-message-actions>
</div>
2021-12-23 22:20:17 +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")?"":Fl(t["og:image"],"image")?ol`<converse-message-unfurl
@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"]||""}"
url="${t["og:url"]||""}"></converse-message-unfurl>`:""}))}
</div>
2021-12-23 22:20:17 +01:00
</div>`})(this,this.getProps())}shouldShowAvatar(){return Nl.settings.get("show_message_avatar")&&!this.model.isMeCommand()&&["chat","groupchat"].includes(this.model.get("type"))}onUnfurlAnimationEnd(){"fade-out"===this.model.get("url_preview_transition")&&this.model.save({hide_url_previews:!0,url_preview_transition:"fade-in"})}async onRetryClicked(){this.show_spinner=!0,this.requestUpdate(),await Nl.trigger(this.model.get("retry_event_id"),{synchronous:!0}),this.model.destroy(),this.parentElement.removeChild(this)}isRetracted(){return this.model.get("retracted")||"retracted"===this.model.get("moderated")}hasMentions(){return"groupchat"===this.model.get("type")&&"them"===this.model.get("sender")&&this.chatbox.isUserMentioned(this.model)}getOccupantAffiliation(){var e;return null===(e=this.model.occupant)||void 0===e?void 0:e.get("affiliation")}getOccupantRole(){var e;return null===(e=this.model.occupant)||void 0===e?void 0:e.get("role")}getExtraMessageClasses(){const e=[this.model.isFollowup()?"chat-msg--followup":null,this.model.get("is_delayed")?"delayed":null,this.model.isMeCommand()?"chat-msg--action":null,this.isRetracted()?"chat-msg--retracted":null,this.model.get("type"),this.shouldShowAvatar()?"chat-msg--with-avatar":null].map((e=>e));return"groupchat"===this.model.get("type")&&(e.push(this.getOccupantRole()??""),e.push(this.getOccupantAffiliation()??""),"them"===this.model.get("sender")&&this.hasMentions()&&e.push("mentioned")),this.model.get("correcting")&&e.push("correcting"),e.filter((e=>e)).join(" ")}getDerivedMessageProps(){const e=Nl.settings.get("time_format");return{pretty_time:uy(this.model.get("edited")||this.model.get("time")).format(e),has_mentions:this.hasMentions(),hats:ly(this.model),is_first_unread:this.chatbox.get("first_unread_id")===this.model.get("id"),is_me_message:this.model.isMeCommand(),is_retracted:this.isRetracted(),username:this.model.getDisplayName(),should_show_avatar:this.shouldShowAvatar()}}getRetractionText(){if(["groupchat","mep"].includes(this.model.get("type"))&&this.model.get("moderated_by")){const e=this.model.get("moderated_by"),t=this.model.collection.chatbox;this.model.mod||(this.model.mod=t.occupants.findOccupant({jid:e})||t.occupants.findOccupant({nick:dy.getResourceFromJid(e)}));const n=this.model.mod?this.model.mod.getDisplayName():"A moderator";return Ah("%1$s has removed this message",n)}return Ah("%1$s has removed this message",this.model.getDisplayName())}showUserModal(e){if("me"===this.model.get("sender"))Nl.modal.show(wa.ProfileModal,{model:this.model},e);else if("groupchat"===this.model.get("type"))e.preventDefault(),Nl.modal.show(Hv,{model:this.model.occupant,message:this.model},e);else{e.preventDefault();const t=this.model.collection.chatbox;Nl.modal.show(Vv,{model:t},e)}}showMessageVersionsModal(e){e.preventDefault(),Nl.modal.show(Fv,{model:this.model},e)}toggleSpoilerMessage(e){null==e||e.preventDefault(),this.model.save({is_spoiler_visible:!this.model.get("is_spoiler_visible")})}}),Nl.elements.define("converse-message-history",class extends rg{static get properties(){return{model:{type:Object},messages:{type:Array}}}render(){const e=this.messages;return e.length?Vg(e,(e=>e.get("id")),(e=>ol`${this.renderMessage(e)}`)):""}renderMessage(e){if(e.get("dangling_retraction")||e.get("is_only_key"))return"";const t=e.get("template_hook");if("string"==typeof t){const n=Nl.hook(t,e,"");return Ep(n,"")}{const t=ol`<converse-chat-message
jid="${this.model.get("jid")}"
2021-12-23 22:20:17 +01:00
mid="${e.get("id")}"></converse-chat-message>`,n=function(e){var t;const n=null===(t=e.collection)||void 0===t?void 0:t.models;if(!n)return;const s=n.indexOf(e),i=n[s-1];if(!i||oy(e.get("time")).isAfter(oy(i.get("time")),"day")){const t=oy(e.get("time")).startOf("day");return(e=>ol`
<div class="message date-separator" data-isodate="${e.time}">
<hr class="separator"/>
<time class="separator-text" datetime="${e.time}"><span>${e.datestring}</span></time>
</div>
2021-12-23 22:20:17 +01:00
`)({type:"date",time:t.toISOString(),datestring:t.format("dddd MMM Do YYYY")})}}(e);return n?[n,t]:t}}});var hy=n(8054),fy={};fy.styleTagTransform=yg(),fy.setAttributes=mg(),fy.insert=hg().bind(null,"head"),fy.domAPI=dg(),fy.insertStyleElement=pg(),cg()(hy.Z,fy),hy.Z&&hy.Z.locals&&hy.Z.locals,Nl.elements.define("converse-chat-content",class extends rg{static get properties(){return{jid:{type:String}}}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("scroll",cy)}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",cy)}async setModels(){this.model=await Nl.chatboxes.get(this.jid),await this.model.initialized,this.requestUpdate()}render(){var e;return this.model?ol`
<div class="chat-content__notifications">${this.model.getNotificationsText()}</div>
<converse-message-history
.model=${this.model}
.messages=${[...this.model.messages.models]}>
</converse-message-history>
2021-12-23 22:20:17 +01:00
${null!==(e=this.model.ui)&&void 0!==e&&e.get("chat-content-spinner-top")?ol`<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;Nl.trigger("chatBoxScrolledDown",{chatbox:this.model})}}});class my extends Pg{constructor(e){if(super(e),this.vt=cl,2!==e.type)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(e){if(e===cl)return this.Vt=void 0,this.vt=e;if(e===al)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:[]}}}my.directiveName="unsafeHTML",my.resultType=1;const gy=zg(my);Nl.elements.define("converse-chat-help",class extends rg{static get properties(){return{chat_type:{type:String},messages:{type:Array},model:{type:Object},type:{type:String}}}render(){const e=(new Date).toISOString();return[ol`<converse-icon class="fas fa-times close-chat-help"
@click=${this.close}
2021-12-23 22:20:17 +01:00
path-prefix="${Nl.settings.get("assets_path")}"
size="1em"></converse-icon>`,...this.messages.map((t=>this.renderHelpMessage({isodate:e,markup:Oo().sanitize(t,{ALLOWED_TAGS:["strong"]})})))]}close(){this.model.set({show_help_messages:!1})}renderHelpMessage(e){return ol`<div class="message chat-${this.type}" data-isodate="${e.isodate}">${gy(e.markup)}</div>`}});const py=Il.env.utils,vy=e=>ol`
<li class="emoji insert-emoji ${e.shouldBeHidden(e.emoji.sn)?"hidden":""}" data-emoji="${e.emoji.sn}" title="${e.emoji.sn}">
2021-12-23 22:20:17 +01:00
<a href="#" @click=${e.insertEmoji} data-emoji="${e.emoji.sn}">${py.shortnamesToEmojis(e.emoji.sn)}</a>
</li>
2021-12-23 22:20:17 +01:00
`,yy=e=>{const t=Ah("Search");return ol`
<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}>
2021-12-23 22:20:17 +01:00
${e.query?"":(e=>{const t=Nl.settings.get("emoji_categories");return ol`<ul>${Object.keys(t).map((n=>t[n]?(e=>ol`
<li data-category="${e.category}"
class="emoji-category ${e.category} ${e.current_category===e.category?"picked":""}"
2021-12-23 22:20:17 +01:00
title="${Ah(Nl.settings.get("emoji_category_labels")[e.category])}">
<a class="pick-category"
@click=${e.onCategoryPicked}
href="#emoji-picker-${e.category}"
data-category="${e.category}">${e.emoji} </a>
</li>
`)(Object.assign({category:n,emoji:e.sn2Emoji(t[n])},e)):""))}</ul>`})(e)}
</div>
2021-12-23 22:20:17 +01:00
${e.render_emojis?ol`<converse-emoji-picker-content
.chatview=${e.chatview}
.model=${e.model}
.search_results="${e.search_results}"
current_skintone="${e.current_skintone}"
query="${e.query}"></converse-emoji-picker-content>`:""}
<div class="emoji-skintone-picker">
<label>Skin tone</label>
2021-12-23 22:20:17 +01:00
<ul>${["tone1","tone2","tone3","tone4","tone5"].map((t=>(e=>ol`
<li data-skintone="${e.skintone}" class="emoji-skintone ${e.current_skintone===e.skintone?"picked":""}">
2021-12-23 22:20:17 +01:00
<a class="pick-skintone" href="#" data-skintone="${e.skintone}" @click=${e.onSkintonePicked}>${py.shortnamesToEmojis(":"+e.skintone+":")}</a>
</li>`)(Object.assign({skintone:t},e))))}</ul>
2021-12-23 22:20:17 +01:00
</div>`},{sizzle:by}=Il.env;Nl.elements.define("converse-emoji-picker-content",class extends rg{static get properties(){return{chatview:{type:Object},search_results:{type:Array},current_skintone:{type:String},model:{type:Object},query:{type:String}}}render(){const e={current_skintone:this.current_skintone,insertEmoji:e=>this.insertEmoji(e),query:this.query,search_results:this.search_results,shouldBeHidden:e=>this.shouldBeHidden(e)};return ol`
<div class="emoji-picker__lists">
2021-12-23 22:20:17 +01:00
${(e=>{const t=Ah("Search results");return ol`
<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">
2021-12-23 22:20:17 +01:00
${e.search_results.map((t=>vy(Object.assign({emoji:t},e))))}
</ul>
</span>
`})(e)}
2021-12-23 22:20:17 +01:00
${(e=>{const t=Nl.settings.get("emoji_categories");return ol`
<span ?hidden=${e.query} class="emoji-lists__container emoji-lists__container--browse">
2021-12-23 22:20:17 +01:00
${Object.keys(t).map((n=>t[n]?(e=>ol`
<a id="emoji-picker-${e.category}" class="emoji-category__heading" data-category="${e.category}">${Ah(Nl.settings.get("emoji_category_labels")[e.category])}</a>
<ul class="emoji-picker" data-category="${e.category}">
2021-12-23 22:20:17 +01:00
${Object.values(Il.emojis.json[e.category]).map((t=>vy(Object.assign({emoji:t},e))))}
</ul>`)(Object.assign({category:n},e)):""))}
</span>`})(e)}
</div>
2021-12-23 22:20:17 +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)}by(".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&&Il.emojis.toned.includes(e))return!0;return!(!this.query||wa.FILTER_CONTAINS(e,this.query))}});const _y=Il.env.utils;Nl.elements.define("converse-emoji-dropdown",class extends Rv{static get properties(){return{chatview:{type:Object}}}constructor(){super(),this.render_emojis=!1}initModel(){return this.init_promise||(this.init_promise=(async()=>{await Nl.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 ol`
<div class="dropup">
<button class="toggle-emojis"
2021-12-23 22:20:17 +01:00
title="${Ah("Insert emojis")}"
data-toggle="dropdown"
aria-haspopup="true"
aria-expanded="false">
<converse-icon
class="fa fa-smile "
2021-12-23 22:20:17 +01:00
path-prefix="${Nl.settings.get("assets_path")}"
size="1em"></converse-icon>
</button>
<div class="dropdown-menu">
2021-12-23 22:20:17 +01:00
${Ep(this.initModel().then((()=>ol`
<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")||""}"
></converse-emoji-picker>`)),"")}
</div>
2021-12-23 22:20:17 +01:00
</div>`}connectedCallback(){super.connectedCallback(),this.render_emojis=!1}toggleMenu(e){e.stopPropagation(),e.preventDefault(),_y.hasClass("show",this.menu)?_y.ancestor(e.target,".toggle-emojis")&&this.hideMenu():this.showMenu()}async showMenu(){await this.initModel(),this.render_emojis||(this.render_emojis=!0,await this.requestUpdate()),super.showMenu(),setTimeout((()=>{var e;return null===(e=this.querySelector(".emoji-search"))||void 0===e?void 0:e.focus()}))}});var wy=n(8125),Sy={};Sy.styleTagTransform=yg(),Sy.setAttributes=mg(),Sy.insert=hg().bind(null,"head"),Sy.domAPI=dg(),Sy.insertStyleElement=pg(),cg()(wy.Z,Sy),wy.Z&&wy.Z.locals&&wy.Z.locals;const xy=Il.env.utils;Nl.elements.define("converse-emoji-picker",class extends rg{static get properties(){return{chatview:{type:Object},current_category:{type:String,reflect:!0},current_skintone:{type:String,reflect:!0},model:{type:Object},query:{type:String,reflet:!0},render_emojis:{type:Boolean}}}firstUpdated(){super.firstUpdated(),this.listenTo(this.model,"change",(e=>this.onModelChanged(e.changed))),this.initArrowNavigation()}constructor(){super(),this._search_results=[],this.debouncedFilter=gc((e=>this.model.set({query:e.value})),250)}get search_results(){return this._search_results}set search_results(e){this._search_results=e,this.requestUpdate()}render(){return yy({chatview:this.chatview,current_category:this.current_category,current_skintone:this.current_skintone,model:this.model,onCategoryPicked:e=>this.chooseCategory(e),onSearchInputBlurred:e=>this.chatview.emitFocused(e),onSearchInputFocus:e=>this.onSearchInputFocus(e),onSearchInputKeyDown:e=>this.onKeyDown(e),onSkintonePicked:e=>this.chooseSkinTone(e),query:this.query,search_results:this.search_results,render_emojis:this.render_emojis,sn2Emoji:e=>xy.shortnamesToEmojis(this.getTonedShortname(e))})}updated(e){e.has("query")&&this.updateSearchResults(e),e.has("current_category")&&this.setScrollPosition()}onModelChanged(e){"current_category"in e&&(this.current_category=e.current_category),"current_skintone"in e&&(this.current_skintone=e.current_skintone),"query"in e&&(this.query=e.query)}setScrollPosition(){if(this.preserve_scroll)return void(this.preserve_scroll=!1);const e=this.querySelector(".emoji-lists__container--browse"),t=this.querySelector(`#emoji-picker-${this.current_category}`);t&&(e.scrollTop=t.offsetTop-3*t.offsetHeight+4)}updateSearchResults(e){const t=e.get("query"),n=wa.FILTER_CONTAINS;if(this.query){if(this.query===t)return this.search_results;t&&this.query.includes(t)?this.search_results=this.search_results.filter((e=>n(e.sn,this.query))):this.search_results=Il.emojis.list.filter((e=>n(e.sn,this.query)))}else this.search_results.length&&(this.search_results=[]);this.requestUpdate()}registerEvents(){this.onGlobalKeyDown=e=>this._onGlobalKeyDown(e),document.querySelector("body").addEventListener("keydown",this.onGlobalKeyDown)}connectedCallback(){super.connectedCallback(),this.registerEvents()}disconnectedCallback(){document.querySelector("body").removeEventListener("keydown",this.onGlobalKeyDown),super.disconnectedCallback()}_onGlobalKeyDown(e){this.navigator&&(e.keyCode===Il.keycodes.ENTER&&this.navigator.selected&&xy.isVisible(this)?this.onEnterPressed(e):e.keyCode===Il.keycodes.DOWN_ARROW&&!this.navigator.enabled&&xy.isVisible(this)&&this.enableArrowNavigation(e))}setCategoryForElement(e){const t=this.current_category,n=(null==e?void 0:e.getAttribute("data-category"))||t;t!==n&&this.model.save({current_category:n})}insertIntoTextArea(e){const t=this.model.get("autocompleting"),n=this.model.get("ac_position");this.chatview.getMessageForm().insertIntoTextArea(e,t,!1,n),this.model.set({autocompleting:null,query:"",ac_position:null})}chooseSkinTone(e){e.preventDefault(),e.stopPropagation();const t=("IMG"===e.target.nodeName?e.target.parentElement:e.target).getAttribute("data-skintone").trim();this.current_skintone===t?this.model.save({current_skintone:""}):this.model.save({current_skintone:t})}chooseCategory(e){e.preventDefault&&e.preventDefault(),e.stopPropagation&&e.stopPropagation();
<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}"></converse-icon>
${t.i18n_text}
</a>
2021-12-23 22:20:17 +01:00
`:""}async function ky(e){const t=await e;return ol`
<a
href="#"
class="chatbox-btn ${t.a_class} fa ${t.icon_class}"
@click=${t.handler}
title="${t.i18n_title}"
></a>
2021-12-23 22:20:17 +01:00
`}async function jy(e){!0===confirm(Ah("Are you sure you want to clear the messages from this conversation?"))&&await e.clearMessages()}function Ny(e,t){const n=t.replace(/^\s*/,"").match(/^\/(.*)\s*$/);if(n){if("clear"===n[1])return jy(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 Oy(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 rg{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 ol`
<span class="toolbar-buttons">${Ep((e=this).getButtons(),"")}</span>
${e.show_send_button?function(){const e=Ah("Send the message");return ol`<button type="submit" class="btn send-button" title="${e}">
<converse-icon color="var(--toolbar-btn-text-color)" class="fa fa-paper-plane" size="1em"></converse-icon>
</button>`}():""}
`;var e}firstUpdated(){Nl.trigger("renderToolbar",this)}getButtons(){var e;const t=[];if(this.show_emoji_button){const e=wa.chatboxviews.get(this.model.get("jid"));t.push(ol`<converse-emoji-dropdown .chatview=${e}></converse-emoji-dropdown>`)}if(this.show_call_button){const e=Ah("Start a call");t.push(ol`
<button class="toggle-call" @click=${this.toggleCall} title="${e}">
<converse-icon class="fa fa-phone" path-prefix="/dist" size="1em"></converse-icon>
2021-12-23 22:20:17 +01:00
</button>`)}Nl.settings.get("message_limit")&&t.push(ol`
<converse-message-limit-indicator .model=${this.model} class="right">
2021-12-23 22:20:17 +01:00
</converse-message-limit-indicator>`),this.show_spoiler_button&&t.push(this.getSpoilerButton());const n=Nl.disco.supports(Cy.NS.HTTPUPLOAD,wa.domain);if(t.push(ol`${Ep(n.then((e=>this.getHTTPUploadButton(e))),"")}`),this.is_groupchat&&null!==(e=Nl.settings.get("visible_toolbar_buttons"))&&void 0!==e&&e.toggle_occupants){const e=Ah("Hide participants"),n=Ah("Show participants");t.push(ol`
<button class="toggle_occupants right"
title="${this.hidden_occupants?n:e}"
@click=${this.toggleOccupants}>
<converse-icon class="fa ${this.hidden_occupants?"fa-angle-double-left":"fa-angle-double-right"}"
2021-12-23 22:20:17 +01:00
path-prefix="${Nl.settings.get("assets_path")}" size="1em"></converse-icon>
</button>`)}return wa.api.hook("getToolbarButtons",this,t)}getHTTPUploadButton(e){if(e){const e=Ah("Choose a file to send");return ol`
<button title="${e}" @click=${this.toggleFileUpload}>
<converse-icon class="fa fa-paperclip"
2021-12-23 22:20:17 +01:00
path-prefix="${Nl.settings.get("assets_path")}"
size="1em"></converse-icon>
</button>
2021-12-23 22:20:17 +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?Ah("Click to write as a normal (non-spoiler) message"):Ah("Click to write your message as a spoiler");const s=ol`
<button class="toggle-compose-spoiler"
title="${n}"
@click=${this.toggleComposeSpoilerMessage}>
<converse-icon class="fa ${this.composing_spoiler?"fa-eye-slash":"fa-eye"}"
2021-12-23 22:20:17 +01:00
path-prefix="${Nl.settings.get("assets_path")}"
size="1em"></converse-icon>
2021-12-23 22:20:17 +01:00
</button>`;if(this.is_groupchat)return s;{const e=t.get("jid"),n=Promise.all(t.presence.resources.map((t=>Nl.disco.supports(Cy.NS.SPOILER,`${e}/${t.get("name")}`)))).then((e=>e.reduce(((e,t)=>e&&t),!0)));return ol`${Ep(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),Nl.trigger("callButtonClicked",{connection:wa.connection,model:this.model})}});var $y=n(7802),Iy={};Iy.styleTagTransform=yg(),Iy.setAttributes=mg(),Iy.insert=hg().bind(null,"head"),Iy.domAPI=dg(),Iy.insertStyleElement=pg(),cg()($y.Z,Iy),$y.Z&&$y.Z.locals&&$y.Z.locals,Nl.elements.define("converse-chat-heading",class extends rg{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=Ah("The User's Profile Image"),i=ol`<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"></converse-avatar></span>`,r=e.model.getDisplayName();return ol`
<div class="chatbox-title ${e.status?"":"chatbox-title--no-desc"}">
<div class="chatbox-title--row">
2021-12-23 22:20:17 +01:00
${wa.api.settings.get("singleton")?"":ol`<converse-controlbox-navback jid="${e.jid}"></converse-controlbox-navback>`}
${e.type!==wa.HEADLINES_TYPE?ol`<a class="show-msg-author-modal" @click=${e.showUserDetailsModal}>${i}</a>`:""}
<div class="chatbox-title__text" title="${e.jid}">
2021-12-23 22:20:17 +01:00
${e.type!==wa.HEADLINES_TYPE?ol`<a class="user show-msg-author-modal" @click=${e.showUserDetailsModal}>${r}</a>`:r}
</div>
</div>
<div class="chatbox-title__buttons row no-gutters">
2021-12-23 22:20:17 +01:00
${Ep(async function(e){return(await e).filter((e=>!e.standalone)).map((e=>Ty(e)))}(e.heading_buttons_promise).then((e=>e.length?ol`<converse-dropdown class="dropleft" color="var(--chat-head-text-color)" .items=${e}></converse-dropdown>`:"")),"")}
${Ep(async function(e){return(await e).filter((e=>e.standalone)).map((e=>ky(e)))}(e.heading_buttons_promise).then((e=>e.reverse().map((e=>Ep(e,""))))),"")}
</div>
</div>
2021-12-23 22:20:17 +01:00
${e.status?ol`<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(),Nl.modal.show(Vv,{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:Ah("Details"),i18n_title:Ah("See more information about this person"),icon_class:"fa-id-card",name:"details",standalone:"overlayed"===Nl.settings.get("view_mode")}];Nl.settings.get("singleton")||e.push({a_class:"close-chatbox-button",handler:e=>this.close(e),i18n_text:Ah("Close"),i18n_title:Ah("Close and end this conversation"),icon_class:"fa-times",name:"close",standalone:"overlayed"===Nl.settings.get("view_mode")});const t=wa.chatboxviews.get(this.getAttribute("jid"));return t?wa.api.hook("getHeadingButtons",t,e):e}});const{u:My}=Il.env;class Ry extends Og{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?Ah("Hidden message"):Ah("Message"),n=Ah("Optional hint"),s=Nl.settings.get("show_send_button");return ol`
<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}
2021-12-23 22:20:17 +01:00
@input=${Oy}
@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||""}</textarea>
2021-12-23 22:20:17 +01:00
</form>`})(Object.assign(this.model.toJSON(),{onDrop:e=>this.onDrop(e),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}),onKeyDown:e=>this.onKeyDown(e),onKeyUp:e=>this.onKeyUp(e),onPaste:e=>this.onPaste(e),viewUnreadMessages:e=>this.viewUnreadMessages(e)}))}insertIntoTextArea(e,t=!1,n=!1,s){const i=this.querySelector(".chat-textarea");if(n?My.addClass("correcting",i):My.removeClass("correcting",i),t)i.value=s&&"string"==typeof t?i.value.replace(new RegExp(t,"g"),((n,i)=>i==s-t.length?e+" ":n)):e;else{let t=i.value;t&&" "!==t[t.length-1]&&(t+=" "),i.value=t+e+" "}const r=document.createEvent("HTMLEvents");r.initEvent("change",!1,!0),i.dispatchEvent(r),My.placeCaretAtEnd(i)}onMessageCorrecting(e){if(e.get("correcting"))this.insertIntoTextArea(My.prefixMentions(e),!0,!0);else{const t=this.model.messages.findWhere("correcting");t&&t!==e?this.insertIntoTextArea(My.prefixMentions(e),!0,!0):this.insertIntoTextArea("",!0,!1)}}onEscapePressed(e){e.preventDefault();const t=this.model.messages.findLastIndex("correcting"),n=t>=0?this.model.messages.at(t):null;n&&n.save("correcting",!1),this.insertIntoTextArea("",!0,!1)}onPaste(e){if(e.stopPropagation(),0!==e.clipboardData.files.length)return e.preventDefault(),void this.model.sendFiles(Array.from(e.clipboardData.files));this.model.set({draft:e.clipboardData.getData("text/plain")})}onKeyUp(e){this.model.set({draft:e.target.value})}onKeyDown(e){if(!e.ctrlKey){if(!e.shiftKey&&!e.altKey&&!e.metaKey)if(e.keyCode===Il.keycodes.TAB){const t=My.getCurrentWord(e.target,null,/(:.*?:)/g);t.startsWith(":")&&(e.preventDefault(),e.stopPropagation(),this.model.trigger("emoji-picker-autocomplete",e.target,t))}else{if(e.keyCode===Il.keycodes.FORWARD_SLASH)return;if(e.keyCode===Il.keycodes.ESCAPE)return this.onEscapePressed(e,this);if(e.keyCode===Il.keycodes.ENTER)return this.onFormSubmitted(e);if(e.keyCode!==Il.keycodes.UP_ARROW||e.target.selectionEnd){if(e.keyCode===Il.keycodes.DOWN_ARROW&&e.target.selectionEnd===e.target.value.length&&My.hasClass("correcting",this.querySelector(".chat-textarea")))return this.model.editLaterMessage()}else{const e=this.querySelector(".chat-textarea");if(!e.value||My.hasClass("correcting",e))return this.model.editEarlierMessage()}}[Il.keycodes.SHIFT,Il.keycodes.META,Il.keycodes.META_RIGHT,Il.keycodes.ESCAPE,Il.keycodes.ALT].includes(e.keyCode)||this.model.get("chat_state")!==wa.COMPOSING&&this.model.setChatState(wa.COMPOSING)}}parseMessageForCommands(e){return Ny(this.model,e)}async onFormSubmitted(e){var t,n;null==e||null===(t=e.preventDefault)||void 0===t||t.call(e);const s=this.querySelector(".chat-textarea"),i=s.value.trim();if(Nl.settings.get("message_limit")&&i.length>Nl.settings.get("message_limit")||!i.replace(/\s/g,"").length)return;if(!wa.connection.authenticated){const e=Ah("Sorry, the connection has been lost, and your message could not be sent");return Nl.alert("error",Ah("Error"),e),void Nl.connection.reconnect()}let r,o={};this.model.get("composing_spoiler")&&(o=this.querySelector("form.sendXMPPMessage input.spoiler-hint"),r=o.value),My.addClass("disabled",s),s.setAttribute("disabled","disabled"),null===(n=this.querySelector("converse-emoji-dropdown"))||void 0===n||n.hideMenu();const a=this.parseMessageForCommands(i),c=a?null:await this.model.sendMessage({body:i,spoiler_hint:r});(a||c)&&(o.value="",s.value="",My.removeClass("correcting",s),s.style.height="auto",this.model.set({draft:""})),"overlayed"===Nl.settings.get("view_mode")&&(wa.chatboxviews.get(this.getAttribute("jid")).querySelector(".chat-content__messages").parentElement.style.display="none"),s.removeAttribute("disabled"),My.removeClass("disabled",s),"overlayed"===Nl.settings.get("view_mode")&&(wa.chatboxviews.get(this.getAttribute("jid")).querySelector(".chat-content__messages").parentElement.style.display=""),this.model.setChatState(wa.ACTIVE,{silent:!0}),s.focus()}}Nl.elements.define("converse-message-form",
${e.model.ui.get("scrolled")&&e.model.get("num_unread")?ol`<div class="new-msgs-indicator" @click=${t=>e.viewUnreadMessages(t)}>▼ ${t} ▼</div>`:""}
${Nl.settings.get("show_toolbar")?ol`
<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}"></converse-chat-toolbar>`:""}
<converse-message-form jid="${e.model.get("jid")}"></converse-message-form>
2021-12-23 22:20:17 +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),jy(this.model)}async autocompleteInPicker(e,t){await Nl.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()}}}Nl.elements.define("converse-chat-bottom-panel",zy);class Py extends rg{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(){Nl.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)||Nl.trigger("chatBoxBlurred",this,e)}emitFocused(e){this.contains(e.relatedTarget)||Nl.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}),ay(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 Fy extends Py{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(),Nl.trigger("chatBoxViewInitialized",this)}render(){return(e=>ol`
<div class="flyout box-flyout">
<converse-dragresize></converse-dragresize>
2021-12-23 22:20:17 +01:00
${e.model?ol`
<converse-chat-heading jid="${e.jid}" class="chat-head chat-head-chatbox row no-gutters"></converse-chat-heading>
<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}"></converse-chat-content>
2021-12-23 22:20:17 +01:00
${e.show_help_messages?ol`<div class="chat-content__help">
<converse-chat-help
.model=${e.model}
.messages=${e.help_messages}
?hidden=${!e.show_help_messages}
type="info"
chat_type="${wa.CHATROOMS_TYPE}"
></converse-chat-help></div>`:""}
</div>
<converse-chat-bottom-panel jid="${e.jid}" class="bottom-panel"> </converse-chat-bottom-panel>
</div>
`:""}
</div>
2021-12-23 22:20:17 +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>/clear</strong>: ${Ah("Remove messages")}`,`<strong>/close</strong>: ${Ah("Close this chat")}`,`<strong>/me</strong>: ${Ah("Write in the third person")}`,`<strong>/help</strong>: ${Ah("Show this menu")}`]}showControlBox(){var e;null===(e=wa.chatboxviews.get("controlbox"))||void 0===e||e.show()}afterShown(){this.model.setChatState(wa.ACTIVE),this.model.clearUnreadMsgCounter(),this.maybeFocus()}}Nl.elements.define("converse-chat",Fy);var Uy=n(5599),By={};By.styleTagTransform=yg(),By.setAttributes=mg(),By.insert=hg().bind(null,"head"),By.domAPI=dg(),By.insertStyleElement=pg(),cg()(Uy.Z,By),Uy.Z&&Uy.Z.locals&&Uy.Z.locals;const{Strophe:qy}=Il.env;Il.plugins.add("converse-chatview",{dependencies:["converse-chatboxviews","converse-chat","converse-disco","converse-modal"],initialize(){Nl.settings.extend({allowed_audio_domains:null,allowed_image_domains:null,allowed_video_domains:null,auto_focus:!0,debounced_content_rendering:!0,filter_url_query_params:null,image_urls_regex:null,message_limit:0,muc_hats:["xep317"],render_media:!0,show_message_avatar:!0,show_retraction_warning:!0,show_send_button:!0,show_toolbar:!0,time_format:"HH:mm",use_system_emojis:!0,visible_toolbar_buttons:{call:!1,clear:!0,emoji:!0,spoiler:!0}}),wa.ChatBoxView=Fy,Nl.listen.on("connected",(()=>Nl.disco.own.features.add(qy.NS.SPOILER))),Nl.listen.on("chatBoxClosed",(e=>{return t=e.get("jid"),void(wa.router.history.getFragment()===`converse/chat?jid=${t}`&&wa.router.navigate(""));var t}))}}),Nl.elements.define("converse-brand-byline",class extends rg{render(){const e="fullscreen"===Nl.settings.get("view_mode");return ol`
${e?ol`
<p class="brand-subtitle">${wa.VERSION_NAME}</p>
<p class="brand-subtitle">
<a target="_blank" rel="nofollow" href="https://conversejs.org">Open Source</a> XMPP chat client
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>
`:""}
2021-12-23 22:20:17 +01:00
`}}),Nl.elements.define("converse-brand-logo",class extends rg{render(){const e="fullscreen"===Nl.settings.get("view_mode");return ol`
<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">
<title>Converse</title>
<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>
</g>
</g>
</svg>
<span class="brand-name">
<span class="brand-name__text">converse<span class="subdued">.js</span></span>
2021-12-23 22:20:17 +01:00
${e?ol`
<p class="byline">messaging freedom</p>
`:""}
</span>
</span>
</a>
2021-12-23 22:20:17 +01:00
`}}),Nl.elements.define("converse-brand-heading",class extends rg{render(){return ol`
<converse-brand-logo></converse-brand-logo>
<converse-brand-byline></converse-brand-byline>
2021-12-23 22:20:17 +01:00
`}});const Hy=[0,1,2,3,4,7,10],Gy={0:"Error",1:"Connecting",2:"Connection failure",3:"Authenticating",4:"Authentication failure",5:"Connected",6:"Disconnected",7:"Disconnecting",8:"Attached",9:"Redirect",10:"Reconnecting"},Wy={Error:"error",Connecting:"info","Connection failure":"error",Authenticating:"info","Authentication failure":"error",Connected:"info",Disconnected:"error",Disconnecting:"warn",Attached:"info",Redirect:"info",Reconnecting:"warn"},Vy=e=>{const t=wa.connfeedback.get("connection_status");let n,s;Hy.includes(t)&&(s=Gy[t],n=Wy[s]);const i=wa.connfeedback.get("message");return ol`
<converse-brand-heading></converse-brand-heading>
<form id="converse-login" class="converse-form" method="post" @submit=${e.onLoginFormSubmitted}>
<div class="conn-feedback fade-in ${s?n:"hidden"}">
<p class="feedback-subject">${s}</p>
<p class="feedback-message ${i?"":"hidden"}">${i}</p>
</div>
${"CONNECTING"===wa.CONNECTION_STATUS[t]?sy({classes:"hor_centered"}):(e=>{const t=Nl.settings.get("authentication"),{ANONYMOUS:n,EXTERNAL:s,LOGIN:i,PREBIND:r}=wa,o=Ah("Disconnected"),a=Ah("Click here to log in anonymously");return ol`
${t==i||t==s?(e=>{const t=Nl.settings.get("authentication"),n=Ah("Log in"),s=Ah("XMPP Address"),i=Nl.settings.get("locked_domain"),r=Nl.settings.get("default_domain"),o=(i||r)&&Ah("Username")||Ah("user@domain"),a=Nl.settings.get("allow_user_trust_override");return ol`
<div class="form-group">
2021-12-23 22:20:17 +01:00
<label for="converse-login-jid">${s}:</label>
<input id="converse-login-jid"
2021-12-23 22:20:17 +01:00
?autofocus=${!!Nl.settings.get("auto_focus")}
@changed=${e.validate}
required
class="form-control"
type="text"
name="jid"
2021-12-23 22:20:17 +01:00
placeholder="${o}"/>
</div>
2021-12-23 22:20:17 +01:00
${t!==wa.EXTERNAL?(()=>{const e=Ah("Password");return ol`
<div class="form-group">
<label for="converse-login-password">${e}</label>
<input id="converse-login-password" class="form-control" required="required" type="password" name="password" placeholder="${e}"/>
</div>
`})():""}
2021-12-23 22:20:17 +01:00
${e.model.get("show_connection_url_input")?(()=>{const e=Ah("Connection URL"),t=Ah("HTTP or websocket URL that is used to connect to your XMPP server"),n=Ah("e.g. wss://example.org/xmpp-websocket");return ol`
<div class="form-group fade-in">
<label for="converse-conn-url">${e}</label>
<p class="form-help instructions">${t}</p>
<input id="converse-conn-url"
class="form-control"
required="required"
type="url"
name="connection-url"
placeholder="${n}"/>
</div>
`})():""}
${a?(e=>{const t=Ah("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=Ah("This is a trusted device");return ol`
<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}</label>
<i class="fa fa-info-circle" data-toggle="popover"
data-title="Trusted device?"
data-content="${t}"></i>
</div>
2021-12-23 22:20:17 +01:00
`})("off"!==a):""}
<fieldset class="form-group buttons">
2021-12-23 22:20:17 +01:00
<input class="btn btn-primary" type="submit" value="${n}"/>
</fieldset>
2021-12-23 22:20:17 +01:00
${Nl.settings.get("allow_registration")&&!Nl.settings.get("auto_login")&&wa.pluggable.plugins["converse-register"].enabled(wa)?(()=>{const e=Ah("Create an account"),t=Ah("Don't have a chat account?");return ol`
<fieldset class="switch-form">
<p>${t}</p>
<p><a class="register-account toggle-register-login" href="#converse/register">${e}</a></p>
</fieldset>
`})():""}
`})(e):""}
2021-12-23 22:20:17 +01:00
${t==n?ol`<input class="btn btn-primary login-anon" type="submit" value="${a}">`:""}
${t==r?ol`<p>${o}</p>`:""}
`})(e)}
2021-12-23 22:20:17 +01:00
</form>`},{Strophe:Jy,u:Qy}=Il.env;Nl.elements.define("converse-login-panel",class extends rg{initialize(){this.model=new Xo,this.listenTo(wa.connfeedback,"change",(()=>this.requestUpdate())),this.listenTo(this.model,"change",(()=>this.requestUpdate()))}render(){return Vy(this)}firstUpdated(){this.initPopovers()}async onLoginFormSubmitted(e){null==e||e.preventDefault(),Nl.settings.get("bosh_service_url")||Nl.settings.get("websocket_url")||this.model.get("show_connection_url_input")?this.authenticate(e):(await this.discoverConnectionMethods(e),Nl.settings.get("bosh_service_url")||Nl.settings.get("websocket_url")?this.authenticate(e):this.model.set("show_connection_url_input",!0))}async discoverConnectionMethods(e){var t;if(!Nl.settings.get("discover_connection_methods"))return;const n=new FormData(e.target).get("jid"),s=Jy.getDomainFromJid(n);return(null===(t=wa.connection)||void 0===t||!t.jid||n&&!Qy.isSameDomain(wa.connection.jid,n))&&await wa.initConnection(),wa.connection.discoverConnectionMethods(s)}initPopovers(){Array.from(this.querySelectorAll("[data-title]")).forEach((e=>{new(Xg().Popover)(e,{trigger:"mobile"===Nl.settings.get("view_mode")?"click":"hover",dismissible:"mobile"===Nl.settings.get("view_mode"),container:this.parentElement.parentElement.parentElement})}))}validate(){const e=this.querySelector("form").querySelector("input[name=jid]");return!e.value||Nl.settings.get("locked_domain")||Nl.settings.get("default_domain")||Qy.isValidJID(e.value)?(e.setCustomValidity(""),!0):(e.setCustomValidity(Ah("Please enter a valid XMPP address")),!1)}authenticate(e){if(Nl.settings.get("authentication")===wa.ANONYMOUS)return this.connect(wa.jid,null);if(!this.validate())return;const t=new FormData(e.target),n=t.get("connection-url");null!=n&&n.startsWith("ws")?Nl.settings.set("websocket_url",n):null!=n&&n.startsWith("http")&&Nl.settings.set("bosh_service_url",n),wa.config.save({trusted:!!t.get("trusted")});let s=t.get("jid");if(Nl.settings.get("locked_domain")){const e="@"+Nl.settings.get("locked_domain");s.endsWith(e)&&(s=s.substr(0,s.length-e.length)),s=Jy.escapeNode(s)+e}else Nl.settings.get("default_domain")&&!s.includes("@")&&(s=s+"@"+Nl.settings.get("default_domain"));this.connect(s,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(),Nl.user.login(e,t)}});const Zy=Il.env.utils;function Ky(){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 Yy(e){var t;null==e||null===(t=e.preventDefault)||void 0===t||t.call(e);const n=wa.chatboxes.get("controlbox")||Ky();Zy.safeSave(n,{closed:!1})}function Xy(){const e=wa.chatboxviews.get("controlbox");return e.model.set({connected:!1}),e}function eb(){const e=null==wa?void 0:wa.chatboxviews,t=e&&e.get("controlbox");t&&(Zy.safeSave(t.model,{connected:!1}),null!=t&&t.controlbox_pane&&(t.controlbox_pane.remove(),delete t.controlbox_pane))}function tb(){(wa.chatboxes.get("controlbox")||Ky()).save({connected:!0})}Nl.elements.define("converse-controlbox-navback",class extends rg{static get properties(){return{jid:{type:String}}}render(){return e=this.jid,ol`<i class="fa fa-arrow-left" @click=${()=>function(e){Yy();const t=wa.chatboxes.get(e);Zy.safeSave(t,{hidden:!0})}(e)}></i>`;var e}});const{dayjs:nb}=Il.env,sb=Xo.extend({defaults:()=>({bookmarked:!1,box_id:"controlbox",chat_state:void 0,closed:!Nl.settings.get("show_controlbox_by_default"),num_unread:0,time_opened:nb(0).valueOf(),type:wa.CONTROLBOX_TYPE,url:""}),validate(e){return e.type===wa.CONTROLBOX_TYPE?"embedded"===Nl.settings.get("view_mode")&&Nl.settings.get("singleton")?"Controlbox not relevant in embedded view mode":void 0:wa.ChatBox.prototype.validate.call(this,e)},maybeShow(e){return e||"controlbox"!==this.get("id")?wa.ChatBox.prototype.maybeShow.call(this,e):this},onReconnection(){this.save("connected",!0)}});class ib extends rg{async connectedCallback(){super.connectedCall
<div class="flyout box-flyout">
<converse-dragresize></converse-dragresize>
<div class="chat-head controlbox-head">
2021-12-23 22:20:17 +01:00
${e.sticky_controlbox?"":ol`
<a class="chatbox-btn close-chatbox-button fa fa-times" @click=${e.close}></a>
`}
</div>
<div class="controlbox-panes">
<div class="controlbox-pane">
2021-12-23 22:20:17 +01:00
${e.connected?ol`
<converse-user-profile></converse-user-profile>
<converse-headlines-panel class="controlbox-section"></converse-headlines-panel>
<div id="chatrooms" class="controlbox-section">
<converse-rooms-list></converse-rooms-list>
<converse-bookmarks></converse-bookmarks>
</div>
2021-12-23 22:20:17 +01:00
${Nl.settings.get("authentication")===wa.ANONYMOUS?"":ol`<div id="converse-roster" class="controlbox-section"><converse-roster></converse-roster></div>`}`:"register"===e["active-form"]?ol`<converse-register-panel></converse-register-panel>`:ol`<converse-login-panel id="converse-login-panel" class="controlbox-pane fade-in row no-gutters">
</converse-login-panel>`}
</div>
</div>
</div>
2021-12-23 22:20:17 +01:00
`)({sticky_controlbox:Nl.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",!Nl.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&&!Nl.settings.get("show_controlbox_by_default"))&&!Nl.settings.get("sticky_controlbox"))return ob.safeSave(this.model,{closed:!0}),Nl.trigger("controlBoxClosed",this),this}afterShown(){return Nl.trigger("controlBoxOpened",this),this}showHelpMessages(){}}Nl.elements.define("converse-controlbox",ab);const cb=ab,{u:lb}=Il.env,db={controlbox:{async open(){await Nl.waitUntil("chatBoxesFetched");const e=await Nl.chatboxes.get("controlbox")||Nl.chatboxes.create("controlbox",{},wa.Controlbox);return lb.safeSave(e,{closed:!1}),e},get:()=>wa.chatboxviews.get("controlbox")}};var ub=n(1875),hb={};hb.styleTagTransform=yg(),hb.setAttributes=mg(),hb.insert=hg().bind(null,"head"),hb.domAPI=dg(),hb.insertStyleElement=pg(),cg()(ub.Z,hb),ub.Z&&ub.Z.locals&&ub.Z.locals,Il.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 sb(e,t):this.__super__.model.apply(this,arguments)}}},initialize(){Nl.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}),Nl.promises.add("controlBoxInitialized"),Object.assign(Nl,db),wa.ControlBoxView=cb,wa.ControlBox=sb,wa.ControlBoxToggle=rb,Nl.listen.on("chatBoxesFetched",tb),Nl.listen.on("clearSession",eb),Nl.listen.on("will-reconnect",Xy),Nl.waitUntil("chatBoxViewsInitialized").then(Ky).catch((e=>M.fatal(e)))}});const{u:fb}=Il.env;function mb(e,t=!0){if(!Nl.settings.get("allow_dragresize"))return!0;e.preventDefault();const n=fb.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&&Nl.trigger("startVerticalResize",i)}function gb(e,t=!0){if(!Nl.settings.get("allow_dragresize"))return!0;e.preventDefault();const n=fb.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&&Nl.trigger("startHorizontalResize",i)}function pb(e){gb(e,!1),mb(e,!1),wa.resizing.direction="topleft",Nl.trigger("startDiagonalResize",this)}function vb(e,t){if(void 0!==e)return void 0===t?e:e!==t&&Math.abs(e-t)<10?t:e}function yb(e){if(!wa.resizing||!Nl.settings.get("allow_dragresize"))return!0;e.preventDefault(),wa.resizing.chatbox.resizeChatBox(e)}function bb(e){if(!wa.resizing||!Nl.settings.get("allow_dragresize"))return!0;e.preventDefault();const t=vb(wa.resizing.chatbox.height,wa.resizing.chatbox.model.get("default_height")),n=vb(wa.resizing.chatbox.width,wa.resizing.chatbox.model.get("default_width"));Nl.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 _b=()=>ol`
<div class="dragresize dragresize-top" @mousedown="${mb}"></div>
<div class="dragresize dragresize-topleft" @mousedown="${pb}"></div>
<div class="dragresize dragresize-left" @mousedown="${gb}"></div>
`;customElements.define("converse-dragresize",class extends rg{render(){return _b()}});const wb={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?vb(e,this.model.get("default_height"))+"px":"";const t=this.querySelector(".box-flyout");null!==t&&(t.style.height=e)},setChatBoxWidth(e){e=e?vb(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)}};Il.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:vb(t,this.get("default_height")),width:vb(n,this.get("default_width"))}),e}}},initialize(){Nl.settings.extend({allow_dragresize:!0}),Object.assign(wa.ChatBoxView.prototype,wb),Object.assign(wa.ChatRoomView.prototype,wb),Object.assign(wa.ControlBoxView.prototype,wb),Nl.listen.on("registeredGlobalEventHandlers",(function(){document.addEventListener("mousemove",yb),document.addEventListener("mouseup",bb)})),Nl.listen.on("unregisteredGlobalEventHandlers",(function(){document.removeEventListener("mousemove",yb),document.removeEventListener("mouseup",bb)})),Nl.listen.on("beforeShowingChatView",(e=>e.initDragResize().setDimensions()))}});var Sb=n(1833),xb={};xb.styleTagTransform=yg(),xb.setAttributes=mg(),xb.insert=hg().bind(null,"head"),xb.domAPI=dg(),xb.insertStyleElement=pg(),cg()(Sb.Z,xb),Sb.Z&&Sb.Z.locals&&Sb.Z.locals,Il.plugins.add("converse-singleton",{enabled:e=>e.api.settings.get("singleton"),initialize(){if(Nl.settings.extend({allow_logout:!1,allow_muc_invitations:!1,hide_muc_server:!0}),!Array.isArray(Nl.settings.get("auto_join_rooms"))&&!Array.isArray(Nl.settings.get("auto_join_private_chats")))throw new Error("converse-singleton: auto_join_rooms must be an Array");if(Nl.settings.get("auto_join_rooms").length>1||Nl.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
<div class="chatbox-title ${e.status?"":"chatbox-title--no-desc"}">
<div class="chatbox-title--row">
2021-12-23 22:20:17 +01:00
${wa.api.settings.get("singleton")?"":ol`<converse-controlbox-navback jid="${e.jid}"></converse-controlbox-navback>`}
<div class="chatbox-title__text" title="${e.jid}">${e.display_name}</div>
</div>
<div class="chatbox-title__buttons row no-gutters">
2021-12-23 22:20:17 +01:00
${e.dropdown_btns.length?ol`<converse-dropdown class="dropleft" .items=${e.dropdown_btns}></converse-dropdown>`:""}
${e.standalone_btns.length?(e=>e.standalone_btns.reverse().map((e=>Ep(e,""))))(e):""}
</div>
</div>
2021-12-23 22:20:17 +01:00
${e.status?ol`<p class="chat-head__desc">${e.status}</p>`:""}
`)(Object.assign(this.model.toJSON(),{display_name:this.model.getDisplayName(),dropdown_btns:n.map((e=>Ty(e))),standalone_btns:t.map((e=>ky(e)))}))}getHeadingButtons(){const e=[];return Nl.settings.get("singleton")||e.push({a_class:"close-chatbox-button",handler:e=>this.close(e),i18n_text:Ah("Close"),i18n_title:Ah("Close these announcements"),icon_class:"fa-times",name:"close",standalone:"overlayed"===Nl.settings.get("view_mode")}),wa.api.hook("getHeadingButtons",this,e)}close(e){e.preventDefault(),this.model.close()}}),Nl.elements.define("converse-headlines",class extends Py{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(),Nl.trigger("headlinesBoxViewInitialized",this)}render(){return(e=>ol`
<div class="flyout box-flyout">
<converse-dragresize></converse-dragresize>
2021-12-23 22:20:17 +01:00
${e?ol`
<converse-headlines-heading jid="${e.get("jid")}" class="chat-head chat-head-chatbox row no-gutters">
</converse-headlines-heading>
<div class="chat-body">
<div class="chat-content" aria-live="polite">
<converse-chat-content
class="chat-content__messages"
jid="${e.get("jid")}"></converse-chat-content>
</div>
</div>`:""}
</div>
2021-12-23 22:20:17 +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 Cb extends Og{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=>ol`
<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}</span>
</div>
</div>
2021-12-23 22:20:17 +01:00
${(e=>ol`
<div class="list-container list-container--headline ${e.headlineboxes.length?"":"hidden"}">
<div class="items-list rooms-list headline-list">
2021-12-23 22:20:17 +01:00
${e.headlineboxes.map((t=>(e=>ol`
<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>
</div>
`)(Object.assign({headlinebox:t},e))))}
</div>
</div>
`)(e)}
2021-12-23 22:20:17 +01:00
`)({heading_headline:Ah("Announcements"),headlineboxes:this.model.filter((e=>e.get("type")===wa.HEADLINES_TYPE)),open_title:Ah("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)}}Nl.elements.define("converse-headlines-panel",Cb);var Tb=n(5956),kb={};kb.styleTagTransform=yg(),kb.setAttributes=mg(),kb.insert=hg().bind(null,"head"),kb.domAPI=dg(),kb.insertStyleElement=pg(),cg()(Tb.Z,kb),Tb.Z&&Tb.Z.locals&&Tb.Z.locals,Il.plugins.add("converse-headlines-view",{dependencies:["converse-headlines","converse-chatview"],initialize(){wa.HeadlinesPanel=Cb}});var jb=n(9679),Nb={};function Ob(e,t){return e instanceof Zh?ol`<converse-mam-placeholder .model=${e}></converse-mam-placeholder>`:t}async function $b(e){if(!e.model.ui.get("chat-content-spinner-top")&&e.model.messages.length){const t=e.model.get("type")===wa.CHATROOMS_TYPE,n=e.model.getOldestMessage();if(n){const s=t?e.model.get("jid"):wa.bare_jid,i=n&&n.get(`stanza_id ${s}`);e.model.ui.set("chat-content-spinner-top",!0);try{i?await Sf(e.model,{before:i}):await Sf(e.model,{end:n.get("time")})}catch(t){return M.error(t),void e.model.ui.set("chat-content-spinner-top",!1)}Nl.settings.get("allow_url_history_change")&&wa.router.history.navigate(`#${n.get("msgid")}`),setTimeout((()=>e.model.ui.set("chat-content-spinner-top",!1)),250)}}}Nb.styleTagTransform=yg(),Nb.setAttributes=mg(),Nb.insert=hg().bind(null,"head"),Nb.domAPI=dg(),Nb.insertStyleElement=pg(),cg()(jb.Z,Nb),jb.Z&&jb.Z.locals&&jb.Z.locals,Nl.elements.define("converse-mam-placeholder",class extends rg{static get properties(){return{model:{type:Object}}}render(){return(e=this).model.get("fetching")?sy({classes:"hor_centered"}):ol`<a @click="${t=>e.fetchMissingMessages(t)}" title="${Ah("Click to load missing messages")}">
<div class="message mam-placeholder"></div>
2021-12-23 22:20:17 +01:00
</a>`;var e}async fetchMissingMessages(e){var t;null==e||null===(t=e.preventDefault)||void 0===t||t.call(e),this.model.set("fetching",!0);const n={before:this.model.get("before"),start:this.model.get("start")};await Sf(this.model.collection.chatbox,n),this.model.destroy()}}),Il.plugins.add("converse-mam-views",{dependencies:["converse-mam","converse-chatview","converse-muc-views"],initialize(){Nl.listen.on("chatBoxScrolledUp",$b),Nl.listen.on("getMessageTemplate",Ob)}});const Ib=Xo.extend({defaults:{collapsed:!1}});Nl.elements.define("converse-minimized-chats",class extends rg{async initialize(){this.model=wa.chatboxes,await this.initToggle(),this.listenTo(this.minchats,"change:collapsed",this.requestUpdate),this.listenTo(this.model,"add",this.requestUpdate),this.listenTo(this.model,"change:fullname",this.requestUpdate),this.listenTo(this.model,"change:jid",this.requestUpdate),this.listenTo(this.model,"change:minimized",this.requestUpdate),this.listenTo(this.model,"change:name",this.requestUpdate),this.listenTo(this.model,"change:num_unread",this.requestUpdate),this.listenTo(this.model,"remove",this.requestUpdate),this.listenTo(wa,"connected",this.requestUpdate),this.listenTo(wa,"reconnected",this.requestUpdate),this.listenTo(wa,"disconnected",this.requestUpdate)}render(){const e=this.model.where({minimized:!0}),t=e.reduce(((e,t)=>e+t.get("num_unread")),0),n=e.reduce(((e,t)=>e+(t.get("minimized")?1:0)),0),s={chats:e,num_unread:t,num_minimized:n,collapsed:this.minchats.get("collapsed")};return s.toggle=e=>this.toggle(e),(e=>ol`<div id="minimized-chats" class="${e.chats.length?"":"hidden"}">
<a id="toggle-minimized-chats" class="row no-gutters" @click=${e.toggle}>
2021-12-23 22:20:17 +01:00
${e.num_minimized} ${Ah("Minimized")}
<span class="unread-message-count ${e.num_unread?"":"unread-message-count-hidden"}" href="#">${e.num_unread}</span>
</a>
<div class="flyout minimized-chats-flyout row no-gutters ${e.collapsed?"hidden":""}">
2021-12-23 22:20:17 +01:00
${e.chats.map((e=>ol`<converse-minimized-chat
.model=${e}
title=${e.getDisplayName()}
type=${e.get("type")}
num_unread=${e.get("num_unread")}></converse-minimized-chat>`))}
</div>
2021-12-23 22:20:17 +01:00
</div>`)(s)}async initToggle(){const e=`converse.minchatstoggle-${wa.bare_jid}`;this.minchats=new Ib({id:e}),_o(this.minchats,e,"session"),await new Promise((e=>this.minchats.fetch({success:e,error:e})))}toggle(e){null==e||e.preventDefault(),this.minchats.save({collapsed:!this.minchats.get("collapsed")})}});const Mb=Il.env.utils;function Rb(e){if("controlbox"===e.model.get("id")){if(Mb.isVisible(e))return Mb.getOuterWidth(e,!0);{const e=document.querySelector("converse-controlbox-toggle");return e?Mb.getOuterWidth(e,!0):0}}return!e.model.get("minimized")&&Mb.isVisible(e)?Mb.getOuterWidth(e,!0):0}function Db(){const e=document.querySelector("converse-minimized-chats");return wa.chatboxes.pluck("minimized").includes(!0)?Mb.getOuterWidth(e,!0):0}function Lb(e){const t=e?e.model.get("id"):null,n=e?Mb.getOuterWidth(e,!0):0;return Object.values(wa.chatboxviews.xget(t)).reduce(((e,t)=>e+Rb(t)),n)}function zb(e){if(wa.isTestEnv()||Nl.settings.get("no_trimming")||"overlayed"!==Nl.settings.get("view_mode"))return;const t=wa.chatboxviews.filter((e=>!e.model.get("minimized")&&!e.model.get("closed")&&Mb.isVisible(e)));if(t.length<=1)return;const n=Mb.getOuterWidth(document.querySelector("body"),!0);if(Rb(t[0])!==n&&document.querySelector("converse-minimized-chats"))for(;Db()+Lb(e)>n;){const t=Pb([e?e.model.get("id"):null]);if(!t)break;{const e=wa.chatboxes.get(t.get("id"));null==e||e.save("hidden",!0),Ub(t)}}}function Pb(e){e.push("controlbox");let t=0,n=wa.chatboxes.sort().at(t);for(;e.includes(n.get("id"))||!0===n.get("minimized");)if(t++,n=wa.chatboxes.at(t),!n)return null;return n}function Fb(e,t){null!=e&&e.preventDefault?e.preventDefault():t=e,Mb.safeSave(t,{hidden:!1,minimized:!1,time_opened:(new Date).getTime()})}function Ub(e,t){null!=e&&e.preventDefault?e.preventDefault():t=e,t.setChatState(wa.INACTIVE),Mb.safeSave(t,{hidden:!0,minimized:!0,time_minimized:(new Date).toISOString()})}Nl.elements.define("converse-minimized-chat",class extends rg{static get properties(){return{model:{type:Object},title:{type:String},type:{type:String},num_unread:{type:Number}}}render(){return(e=>{const t=Ah("Click to restore this chat");return ol`
<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}>
2021-12-23 22:20:17 +01:00
${e.num_unread?ol`<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"></converse-icon>
</a>
2021-12-23 22:20:17 +01:00
</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(),Fb(this.model)}});var Bb=n(4915),qb={};qb.styleTagTransform=yg(),qb.setAttributes=mg(),qb.insert=hg().bind(null,"head"),qb.domAPI=dg(),qb.insertStyleElement=pg(),cg()(Bb.Z,qb),Bb.Z&&Bb.Z.locals&&Bb.Z.locals;const{dayjs:Hb}=Il.env;Il.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")&&Fb(this)),this),"controlbox"!==this.get("id")&&this.save({minimized:this.get("minimized")||!1,time_minimized:this.get("time_minimized")||Hb()})},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){Nl.trigger("chatBoxMinimized",e)}(e):function(e){e.isScrolledUp()||e.clearUnreadMsgCounter(),e.setChatState(wa.ACTIVE),Nl.trigger("chatBoxMaximized",e)}(e)}(e)))}Nl.settings.extend({no_trimming:!1}),Nl.promises.add("minimizedChatsInitialized"),wa.MinimizedChatsToggle=Ib,wa.minimize={trimChats:zb,minimize:Ub,maximize:Fb},Nl.listen.on("chatBoxViewInitialized",(e=>wa.minimize.trimChats(e))),Nl.listen.on("chatRoomViewInitialized",(e=>wa.minimize.trimChats(e))),Nl.listen.on("controlBoxOpened",(e=>wa.minimize.trimChats(e))),Nl.listen.on("chatBoxInitialized",e),Nl.listen.on("chatRoomInitialized",e),Nl.listen.on("getHeadingButtons",((e,t)=>e.model.get("type")===wa.CHATROOMS_TYPE?function(e,t){const n={a_class:"toggle-chatbox-button",handler:t=>Ub(t,e.model),i18n_text:Ah("Minimize"),i18n_title:Ah("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=>Ub(t,e.model),i18n_text:Ah("Minimize"),i18n_title:Ah("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);Nl.listen.on("registeredGlobalEventHandlers",(()=>window.addEventListener("resize",t))),Nl.listen.on("unregisteredGlobalEventHandlers",(()=>window.removeEventListener("resize",t)))}});const Gb=Il.env.utils,Wb={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])||Gb.isMentionBoundary(e[0])&&t.includes(e[1])},Vb=function(e,t){return RegExp(Wb.regExpEscape(t.trim()),"i").test(e)},Jb=function(e,t){return RegExp("^"+Wb.regExpEscape(t.trim()),"i").test(e)},Qb=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},Zb=(e,t)=
<div class="suggestion-box suggestion-box__name">
<ul class="suggestion-box__results suggestion-box__results--above" hidden=""></ul>
<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"
></span>
</div>
2021-12-23 22:20:17 +01:00
`}firstUpdated(){this.auto_complete=new e_(this.firstElementChild,{ac_triggers:this.triggers.split(" "),auto_evaluate:this.auto_evaluate,auto_first:this.auto_first,filter:"contains"==this.filter?Vb:Jb,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 t_=n(4921),n_={};n_.styleTagTransform=yg(),n_.setAttributes=mg(),n_.insert=hg().bind(null,"head"),n_.domAPI=dg(),n_.insertStyleElement=pg(),cg()(t_.Z,n_),t_.Z&&t_.Z.locals&&t_.Z.locals,wa.FILTER_CONTAINS=Vb,wa.FILTER_STARTSWITH=Jb,wa.AutoComplete=e_;function s_(e){return"moderator"===e?Ah("Moderators are privileged users who can change the roles of other users (except those with admin or owner affiliations."):"participant"===e?Ah("The default role, implies that you can read and write messages."):"visitor"==e?Ah("Visitors aren't allowed to write messages in a moderated multi-user chat."):void 0}function i_(e){return"owner"===e?Ah("Owner is the highest affiliation. Owners can modify roles and affiliations of all other users."):"admin"===e?Ah("Admin is the 2nd highest affiliation. Admins can modify roles and affiliations of all other users except owners."):"outcast"===e?Ah('To ban a user, you give them the affiliation of "outcast".'):void 0}const r_=e=>{const t=Ah("Affiliation"),n=Ah("No users with that affiliation found."),s=Ah("No users with that role found."),i=Ah("Type here to filter the search results"),r=Ah("Role"),o=Ah("Show users"),a=Ah("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=Ah("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 ol`
${e.alert_message?ol`<div class="alert alert-${e.alert_type}" role="alert">${e.alert_message}</div>`:""}
${l?ol`
<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>
</li>
<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>
</li>
</ul>
`:""}
<div class="tab-content">
2021-12-23 22:20:17 +01:00
${e.queryable_affiliations.length?ol`
<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}:</strong>
</label>
<div class="row">
<div class="col">
<select class="custom-select select-affiliation" name="affiliation">
2021-12-23 22:20:17 +01:00
${e.queryable_affiliations.map((t=>(e=>ol`
<option value="${e.item||""}"
?selected=${e.item===e.affiliation}
2021-12-23 22:20:17 +01:00
title="${i_(e.item)}">${e.item}</option>
`)(Object.assign({item:t},e))))}
</select>
</div>
<div class="col">
<input type="submit" class="btn btn-primary" name="users_with_affiliation" value="${o}"/>
</div>
</div>
<div class="row">
<div class="col mt-3">
2021-12-23 22:20:17 +01:00
${Array.isArray(e.users_with_affiliation)&&e.users_with_affiliation.length>5?ol`<input class="form-control" .value="${e.affiliations_filter}" @keyup=${e.filterAffiliationResults} type="text" name="filter" placeholder="${i}"/>`:""}
</div>
</div>
2021-12-23 22:20:17 +01:00
${i_(e.affiliation)?ol`<div class="row"><div class="col pt-2"><p class="helptext pb-3">${i_(e.affiliation)}</p></div></div>`:""}
</div>
</form>
<div class="scrollable-container">
<ul class="list-group list-group--users">
2021-12-23 22:20:17 +01:00
${e.loading_users_with_affiliation?ol`<li class="list-group-item"> ${sy()} </li>`:""}
${Array.isArray(e.users_with_affiliation)&&0===e.users_with_affiliation.length?ol`<li class="list-group-item">${n}</li>`:""}
2021-12-23 22:20:17 +01:00
${e.users_with_affiliation instanceof Error?ol`<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=>ol`
<li class="list-group-item" data-nick="${e.item.nick}">
<ul class="list-group">
<li class="list-group-item active">
<div><strong>JID:</strong> ${e.item.jid}</div>
</li>
<li class="list-group-item">
<div><strong>Nickname:</strong> ${e.item.nick}</div>
</li>
<li class="list-group-item">
2021-12-23 22:20:17 +01:00
<div><strong>Affiliation:</strong> ${e.item.affiliation} ${e.assignable_affiliations.length?(e=>ol`
<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"></converse-icon>
</a>`)(e):""}</div>
2021-12-23 22:20:17 +01:00
${e.assignable_affiliations.length?(e=>{const t=Ah("Change affiliation"),n=Ah("New affiliation"),s=Ah("Reason");return ol`
<form class="affiliation-form hidden" @submit=${e.assignAffiliation}>
<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}:</strong></label>
<select class="custom-select select-affiliation" name="affiliation">
2021-12-23 22:20:17 +01:00
${e.assignable_affiliations.map((t=>ol`<option value="${t}" ?selected=${t===e.item.affiliation}>${t}</option>`))}
</select>
</div>
<div class="col">
<label><strong>${s}:</strong></label>
<input class="form-control" type="text" name="reason"/>
</div>
</div>
</div>
<div class="form-group">
<input type="submit" class="btn btn-primary" name="change" value="${t}"/>
</div>
</form>
`})(e):""}
</li>
</ul>
</li>
`)(Object.assign({item:t},e)):""))}
</ul>
</div>
</div>`:""}
2021-12-23 22:20:17 +01:00
${e.queryable_roles.length?ol`
<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}:</strong></label>
<div class="row">
<div class="col">
<select class="custom-select select-role" name="role">
2021-12-23 22:20:17 +01:00
${e.queryable_roles.map((t=>(e=>ol`
<option value="${e.item||""}"
?selected=${e.item===e.role}
2021-12-23 22:20:17 +01:00
title="${s_(e.item)}">${e.item}</option>
`)(Object.assign({item:t},e))))}
</select>
</div>
<div class="col">
<input type="submit" class="btn btn-primary" name="users_with_role" value="${o}"/>
</div>
</div>
<div class="row">
<div class="col mt-3">
2021-12-23 22:20:17 +01:00
${Array.isArray(e.users_with_role)&&e.users_with_role.length>5?ol`<input class="form-control" .value="${e.roles_filter}" @keyup=${e.filterRoleResults} type="text" name="filter" placeholder="${i}"/>`:""}
</div>
</div>
2021-12-23 22:20:17 +01:00
${s_(e.role)?ol`<div class="row"><div class="col pt-2"><p class="helptext pb-3">${s_(e.role)}</p></div></div>`:""}
</div>
</form>
<div class="scrollable-container">
<ul class="list-group list-group--users">
2021-12-23 22:20:17 +01:00
${e.loading_users_with_role?ol`<li class="list-group-item"> ${sy()} </li>`:""}
${e.users_with_role&&0===e.users_with_role.length?ol`<li class="list-group-item">${s}</li>`:""}
${(e.users_with_role||[]).map((t=>t.nick.match(e.roles_filter)?(e=>ol`
<li class="list-group-item" data-nick="${e.item.nick}">
<ul class="list-group">
<li class="list-group-item active">
<div><strong>JID:</strong> ${e.item.jid}</div>
</li>
<li class="list-group-item">
<div><strong>Nickname:</strong> ${e.item.nick}</div>
</li>
<li class="list-group-item">
2021-12-23 22:20:17 +01:00
<div><strong>Role:</strong> ${e.item.role} ${e.assignable_roles.length?(e=>ol`
<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"></converse-icon>
</a>`)(e):""}</div>
2021-12-23 22:20:17 +01:00
${e.assignable_roles.length?(e=>{const t=Ah("Change role"),n=Ah("New Role"),s=Ah("Reason");return ol`
<form class="role-form hidden" @submit=${e.assignRole}>
<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}:</strong></label>
<select class="custom-select select-role" name="role">
2021-12-23 22:20:17 +01:00
${e.assignable_roles.map((t=>ol`<option value="${t}" ?selected=${t===e.item.role}>${t}</option>`))}
</select>
</div>
<div class="col">
<label><strong>${s}:</strong></label>
<input class="form-control" type="text" name="reason"/>
</div>
</div>
</div>
<div class="form-group">
<input type="submit" class="btn btn-primary" value="${t}"/>
</div>
</form>
`})(e):""}
</li>
</ul>
</li>
`)(Object.assign({item:t},e)):""))}
</ul>
</div>
</div>`:""}
2021-12-23 22:20:17 +01:00
</div>`},{Strophe:o_,sizzle:a_,u:c_}=Il.env;Nl.elements.define("converse-modtools",class extends rg{static get properties(){return{affiliation:{type:String},affiliations_filter:{type:String,attribute:!1},alert_message:{type:String,attribute:!1},alert_type:{type:String,attribute:!1},jid:{type:String},muc:{type:Object,attribute:!1},role:{type:String},roles_filter:{type:String,attribute:!1},users_with_affiliation:{type:Array,attribute:!1},users_with_role:{type:Array,attribute:!1}}}constructor(){super(),this.affiliation="",this.affiliations_filter="",this.role="",this.roles_filter=""}updated(e){e.has("role")&&this.onSearchRoleChange(),e.has("affiliation")&&this.onSearchAffiliationChange(),e.has("jid")&&e.get("jid")&&this.initialize()}async initialize(){this.initialized=ji();const e=await Nl.rooms.get(this.jid);await e.initialized,this.muc=e,this.initialized.resolve()}render(){var e;if(null!==(e=this.muc)&&void 0!==e&&e.occupants){const e=this.muc.occupants.findWhere({jid:wa.bare_jid});return r_({affiliations_filter:this.affiliations_filter,alert_message:this.alert_message,alert_type:this.alert_type,assignAffiliation:e=>this.assignAffiliation(e),assignRole:e=>this.assignRole(e),assignable_affiliations:Mu(e),assignable_roles:eh(e),filterAffiliationResults:e=>this.filterAffiliationResults(e),filterRoleResults:e=>this.filterRoleResults(e),loading_users_with_affiliation:this.loading_users_with_affiliation,queryAffiliation:e=>this.queryAffiliation(e),queryRole:e=>this.queryRole(e),queryable_affiliations:mh.filter((e=>!Nl.settings.get("modtools_disable_query").includes(e))),queryable_roles:fh.filter((e=>!Nl.settings.get("modtools_disable_query").includes(e))),roles_filter:this.roles_filter,switchTab:e=>this.switchTab(e),toggleForm:e=>this.toggleForm(e),users_with_affiliation:this.users_with_affiliation,users_with_role:this.users_with_role})}return""}async onSearchAffiliationChange(){if(this.affiliation){if(await this.initialized,this.clearAlert(),this.loading_users_with_affiliation=!0,this.users_with_affiliation=null,this.shouldFetchAffiliationsList()){const e=await Iu(this.affiliation,this.jid);e instanceof Error?(this.alert(e.message,"danger"),this.users_with_affiliation=[]):this.users_with_affiliation=e}else this.users_with_affiliation=this.muc.getOccupantsWithAffiliation(this.affiliation);this.loading_users_with_affiliation=!1}}async onSearchRoleChange(){this.role&&(await this.initialized,this.clearAlert(),this.users_with_role=this.muc.getOccupantsWithRole(this.role))}shouldFetchAffiliationsList(){const e=this.affiliation;return"none"!==e&&!this.muc.occupants.getAutoFetchedAffiliationLists().includes(e)}toggleForm(e){e.stopPropagation(),e.preventDefault();const t=c_.ancestor(e.target,".toggle-form"),n=t.getAttribute("data-form"),s=c_.ancestor(t,".list-group-item").querySelector(`.${n}`);c_.hasClass("hidden",s)?c_.removeClass("hidden",s):c_.addClass("hidden",s)}filterRoleResults(e){this.roles_filter=e.target.value,this.render()}filterAffiliationResults(e){this.affiliations_filter=e.target.value}queryRole(e){e.stopPropagation(),e.preventDefault();const t=new FormData(e.target).get("role");this.role=null,this.role=t}queryAffiliation(e){e.stopPropagation(),e.preventDefault();const t=new FormData(e.target).get("affiliation");this.affiliation=null,this.affiliation=t}alert(e,t){this.alert_message=e,this.alert_type=t}clearAlert(){this.alert_message=void 0,this.alert_type=void 0}async assignAffiliation(e){e.stopPropagation(),e.preventDefault(),this.clearAlert();const t=new FormData(e.target),n=t.get("affiliation"),s={jid:t.get("jid"),reason:t.get("reason")},i=this.affiliation,r=this.muc.get("jid");try{await Du(n,r,[s])}catch(e){return null===e?this.alert(Ah("Timeout error while trying to set the affiliation"),"danger"):a_(`not-allowed[xmlns="${o_.NS.STANZAS}"]`,e).length?this.alert(Ah("Sorry, you're not allowed to make that change"),"danger"):this.alert(Ah("Sorry, something went wrong while trying to set the affiliation"),"danger"),void M.error(e)}await this.muc.occupants.fetchMembers(),this.affiliation=null,this.affiliation=i,
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="converse-modtools-modal-label">${t}</h5>
2021-12-23 22:20:17 +01:00
${dp}
</div>
<div class="modal-body d-flex flex-column">
<converse-modtools jid=${e.jid} affiliation=${e.affiliation}></converse-modtools>
</div>
</div>
2021-12-23 22:20:17 +01:00
</div>`})(this)}}),{Strophe:d_,$iq:u_,sizzle:h_,u:f_}=Il.env,m_={admin:"admin",ban:"outcast",member:"member",owner:"owner",revoke:"none"},g_={deop:"participant",kick:"none",mute:"visitor",op:"moderator",voice:"participant"};async function p_(e){const t=[Ah("Are you sure you want to destroy this groupchat?")];let n=[{name:"challenge",label:Ah("Please enter the XMPP address of this groupchat to confirm"),challenge:e.get("jid"),placeholder:Ah("name@example.org"),required:!0},{name:"reason",label:Ah("Optional reason for destroying this groupchat"),placeholder:Ah("Reason")},{name:"newjid",label:Ah("Optional XMPP address for a new groupchat that replaces this one"),placeholder:Ah("replacement@example.org")}];try{var s,i;n=await Nl.confirm(Ah("Confirm"),t,n);const r=null===(s=n.filter((e=>"reason"===e.name)).pop())||void 0===s?void 0:s.value,o=null===(i=n.filter((e=>"newjid"===e.name)).pop())||void 0===i?void 0:i.value;return e.sendDestroyIQ(r,o).then((()=>e.close()))}catch(e){M.error(e)}}function v_(e,t){t.querySelector("converse-rooms-list").model.save("muc_domain",d_.getDomainFromJid(e))}function y_(e){e.model.get("connected")&&(e.querySelector("converse-rooms-list").model.get("muc_domain")||(void 0===Nl.settings.get("muc_domain")?function(e){function t(t){t&&t.get("var")===d_.NS.MUC&&t.entity.getIdentity("conference","text").then((n=>{n&&v_(t.get("from"),e)}))}Nl.waitUntil("discoInitialized").then((()=>{Nl.listen.on("serviceDiscovered",t),wa.disco_entities.each((e=>t(e.features.findWhere({var:d_.NS.MUC}))))})).catch((e=>M.error(e)))}(e):v_(Nl.settings.get("muc_domain"),e)))}function b_(e,t){t=t.trim();const n=document.createElement("li");if(n.setAttribute("aria-selected","false"),Nl.settings.get("muc_mention_autocomplete_show_avatar")){const t=document.createElement("img");let s="data:"+wa.DEFAULT_IMAGE_TYPE+";base64,"+wa.DEFAULT_IMAGE;if(wa.vcards){const t=wa.vcards.findWhere({nickname:e});t&&(s="data:"+t.get("image_type")+";base64,"+t.get("image"))}t.setAttribute("src",s),t.setAttribute("width","22"),t.setAttribute("class","avatar avatar-autocomplete"),n.appendChild(t)}const s=new RegExp("("+t+")","ig");return(t?e.split(s):[e]).forEach((e=>{if(t&&e.match(s)){const t=document.createElement("mark");t.textContent=e,n.appendChild(t)}else n.appendChild(document.createTextNode(e))})),n}async function __(){const e=[...await Nl.rooms.get(),...await Nl.contacts.get()];return[...new Set(e.map((e=>d_.getDomainFromJid(e.get("jid")))))]}function w_(e,t,n,s=[],i=[]){const r=g_[t];if(!r)throw Error(`ChatRoomView#setRole called with invalid command: ${t}`);if(!e.verifyAffiliations(s)||!e.verifyRoles(i))return!1;if(!e.validateRoleOrAffiliationChangeArgs(t,n))return!1;const o=e.getNickOrJIDFromCommandArgs(n);if(!o)return!1;const a=n.split(o,2)[1].trim(),c=e.getOccupant(o);return e.setRole(c,r,a,void 0,(t=>e.onCommandError(t))),!0}function S_(e,t,n,s){const i=m_[t];if(!i)throw Error(`verifyAffiliations called with invalid command: ${t}`);if(!e.verifyAffiliations(s))return!1;if(!e.validateRoleOrAffiliationChangeArgs(t,n))return!1;const r=e.getNickOrJIDFromCommandArgs(n);if(!r)return!1;let o;const a=n.split(r,2)[1].trim(),c=e.getOccupant(r);if(c)o=c.get("jid");else{if(!f_.isValidJID(r)){const t=Ah("Couldn't find a participant with that nickname. They might have left the groupchat.");return void e.createMessage({message:t,type:"error"})}o=r}const l={jid:o,reason:a};c&&Nl.settings.get("auto_register_muc_nickname")&&(l.nick=c.get("nick")),Du(i,e.get("jid"),[l]).then((()=>e.occupants.fetchMembers())).catch((t=>e.onCommandError(t)))}function x_(e,t){if(!e.verifyRoles(["moderator"]))return;let n=Nl.modal.get(l_.id);n?(n.affiliation=t,n.render()):n=Nl.modal.create(l_,{affiliation:t,jid:e.get("jid")}),n.show()}const E_=e=>{const t=Ah("On which entity do you want to run commands?"),n=Ah("Certain XMPP services and entities allow privileged users to execute ad-hoc commands on them."),s=Ah("Commands found"),i=Ah("List available commands"),r=Ah("XMPP Address"),o=Ah("No commands found");return ol`
${e.alert?ol`<div class="alert alert-${e.alert_type}" role="alert">${e.alert}</div>`:""}
<form class="converse-form" @submit=${e.fetchCommands}>
<fieldset class="form-group">
<label>
${t}
<p class="form-help">${n}</p>
<converse-autocomplete
2021-12-23 22:20:17 +01:00
.getAutoCompleteList="${__}"
placeholder="${r}"
name="jid"/>
</label>
</fieldset>
<fieldset class="form-group">
<input type="submit" class="btn btn-primary" value="${i}">
</fieldset>
2021-12-23 22:20:17 +01:00
${"list-commands"===e.view?ol`
<fieldset class="form-group">
<ul class="list-group">
<li class="list-group-item active">${e.commands.length?s:o}:</li>
2021-12-23 22:20:17 +01:00
${e.commands.map((t=>((e,t)=>ol`
<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>
</div>
2021-12-23 22:20:17 +01:00
${t.node===e.showform?((e,t)=>{const n=Ah("Hide"),s=Ah("Execute");return ol`
<form @submit=${e.runCommand}>
2021-12-23 22:20:17 +01:00
${t.alert?ol`<div class="alert alert-${t.alert_type}" role="alert">${t.alert}</div>`:""}
<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>
${t.fields}
</fieldset>
<fieldset>
<input type="submit" class="btn btn-primary" value="${s}">
<input type="button" class="btn btn-secondary button-cancel" value="${n}" @click=${e.hideCommandForm}>
</fieldset>
</form>
`})(e,t):""}
</li>
`)(e,t)))}
</ul>
</fieldset>`:""}
</form>
2021-12-23 22:20:17 +01:00
`},{Strophe:A_,$iq:C_,sizzle:T_,u:k_}=Il.env;Nl.elements.define("converse-adhoc-commands",class extends rg{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 E_({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 Nl.disco.supports(A_.NS.ADHOC,t)}catch(e){M.error(e)}if(n)try{this.commands=await Nl.adhoc.getCommands(t),this.view="list-commands"}catch(e){return M.error(e),this.alert_type="danger",this.alert=Ah("Sorry, an error occurred while looking for commands on that entity."),this.commands=[],void M.error(e)}else this.alert_type="danger",this.alert=Ah("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=u_({type:"set",to:n}).c("command",{xmlns:d_.NS.ADHOC,node:t,action:"execute"});try{var i;const t=await Nl.sendIQ(s),n=h_(`command[xmlns="${d_.NS.ADHOC}"]`,t).pop();e.sessionid=n.getAttribute("sessionid"),e.instructions=null===(i=h_('x[type="form"][xmlns="jabber:x:data"] instructions',n).pop())||void 0===i?void 0:i.textContent,e.fields=h_('x[type="form"][xmlns="jabber:x:data"] field',n).map((e=>f_.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=k_.getUniqueId();const r=T_(":input:not([type=button]):not([type=submit])",e.target).filter((e=>!["command_jid","command_node"].includes(e.getAttribute("name")))).map(k_.webForm2xForm).filter((e=>e)),o=C_({to:n,type:"set"}).c("command",{sessionid:i.sessionid,node:i.node,xmlns:A_.NS.ADHOC}).c("x",{xmlns:A_.NS.XFORM,type:"submit"});let a;r.forEach((e=>o.cnode(e).up()));try{a=await Nl.sendIQ(o)}catch(e){i.alert_type="danger",i.alert=Ah("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=k_.getUniqueId()}}),Nl.elements.define("converse-muc-message-form",class extends Ry{toHTML(){var e,t;return(e=>{const t=e.composing_spoiler?Ah("Hidden message"):Ah("Message"),n=Ah("Optional hint"),s=Nl.settings.get("show_send_button");return ol`
<form class="setNicknameButtonForm hidden">
<input type="submit" class="btn btn-primary" name="join" value="Join"/>
</form>
<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=""></ul>
<textarea
autofocus
type="text"
@drop=${e.onDrop}
2021-12-23 22:20:17 +01:00
@input=${Oy}
@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||""}</textarea>
<span class="suggestion-box__additions visually-hidden" role="status" aria-live="assertive" aria-relevant="additions"></span>
</div>
2021-12-23 22:20:17 +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")===Il.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:Nl.settings.get("muc_mention_autocomplete_min_chars"),match_current_word:!0,list:()=>this.getAutoCompleteList(),filter:"contains"==Nl.settings.get("muc_mention_autocomplete_filter")?wa.FILTER_CONTAINS:wa.FILTER_STARTSWITH,ac_triggers:["Tab","@"],include_triggers:[],item:b_}),this.mention_auto_complete.on("suggestion-box-selectcomplete",(()=>this.auto_completing=!1))}parseMessageForCommands(e){return function(e,t){if(Nl.settings.get("muc_disable_slash_commands")&&!Array.isArray(Nl.settings.get("muc_disable_slash_commands")))return Ny(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":S_(e,n,s,["owner"]);break;case"ban":S_(e,n,s,["admin","owner"]);break;case"modtools":x_(e,s);break;case"deop":w_(e,n,s,["admin","owner"]);break;case"destroy":if(!e.verifyAffiliations(["owner"]))break;p_(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":w_(e,n,s,[],["moderator"]);break;case"member":S_(e,n,s,["admin","owner"]);break;case"nick":if(!e.verifyRoles(["visitor","participant","moderator"]))break;if(0===s.length){const t=Ah('Your nickname is "%1$s"',e.get("nick"));e.createMessage({message:t,type:"error"})}else e.setNickname(s);break;case"owner":S_(e,n,s,["owner"]);break;case"op":w_(e,n,s,["admin","owner"]);break;case"register":s.length>1?e.createMessage({message:Ah("Error: invalid number of arguments"),type:"error"}):e.registerNickname().then((t=>{t&&e.createMessage({message:t,type:"error"})}));break;case"revoke":S_(e,n,s,["admin","owner"]);break;case"topic":case"subject":e.setSubject(s);break;case"voice":w_(e,n,s,[],["moderator"]);break;default:return Ny(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 j_=e=>{const t=Ah("Nickname"),n=Ah("Enter groupchat"),s=Nl.settings.get("muc_show_logs_before_join")?Ah("Choose a nickname to enter"):Ah("Please choose your nickname"),i=e.get("nickname_validation_message");return ol`
<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}</label>
<p class="validation-message">${i}</p>
<input type="text"
required="required"
name="nick"
value="${e.get("nick")||""}"
class="form-control ${i?"error":""}"
placeholder="${t}"/>
</fieldset>
<fieldset class="form-group">
<input type="submit" class="btn btn-primary" name="join" value="${n}"/>
</fieldset>
</form>
2021-12-23 22:20:17 +01:00
</div>`};var N_=n(6916),O_={};O_.styleTagTransform=yg(),O_.setAttributes=mg(),O_.insert=hg().bind(null,"head"),O_.domAPI=dg(),O_.insertStyleElement=pg(),cg()(N_.Z,O_),N_.Z&&N_.Z.locals&&N_.Z.locals,Nl.elements.define("converse-muc-bottom-panel",class extends zy{constructor(...e){var t,n,s;super(...e),s={"click .hide-occupants":"hideOccupants","click .send-button":"sendButtonClicked"},(n="events")in(t=this)?Object.defineProperty(t,n,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[n]=s}async initialize(){await super.initialize(),this.listenTo(this.model,"change:hidden_occupants",this.debouncedRender),this.listenTo(this.model,"change:num_unread_general",this.debouncedRender),this.listenTo(this.model.features,"change:moderated",this.debouncedRender),this.listenTo(this.model.occupants,"add",this.renderIfOwnOccupant),this.listenTo(this.model.occupants,"change:role",this.renderIfOwnOccupant),this.listenTo(this.model.session,"change:connection_status",this.debouncedRender)}render(){const e=this.model.session.get("connection_status")===Il.ROOMSTATUS.ENTERED,t=e&&!(this.model.features.get("moderated")&&"visitor"===this.model.getOwnRole());dl((e=>{const t=Ah("You have unread messages"),n=e.model.session.get("connection_status"),s=Ah("You're not allowed to send messages in this room");return n===Il.ROOMSTATUS.ENTERED?ol`
${e.model.ui.get("scrolled")&&e.model.get("num_unread_general")?ol`<div class="new-msgs-indicator" @click=${t=>e.viewUnreadMessages(t)}>▼ ${t} ▼</div>`:""}
${e.can_edit?(e=>{const t=Ah("You have unread messages"),n=Nl.settings.get("message_limit"),s=Nl.settings.get("visible_toolbar_buttons").call,i=Nl.settings.get("visible_toolbar_buttons").emoji,r=Nl.settings.get("show_send_button"),o=Nl.settings.get("visible_toolbar_buttons").spoiler,a=Nl.settings.get("show_toolbar");return ol`
${e.model.ui.get("scrolled")&&e.model.get("num_unread")?ol`<div class="new-msgs-indicator" @click=${t=>e.viewUnreadMessages(t)}>▼ ${t} ▼</div>`:""}
${a?ol`
<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}"></converse-chat-toolbar>`:""}
2021-12-23 22:20:17 +01:00
<converse-muc-message-form jid=${e.model.get("jid")}></converse-muc-message-form>`})(e):ol`<span class="muc-bottom-panel muc-bottom-panel--muted">${s}</span>`}`:n!=Il.ROOMSTATUS.NICKNAME_REQUIRED?"":Nl.settings.get("muc_show_logs_before_join")?ol`<span class="muc-bottom-panel muc-bottom-panel--nickname">${j_(e.model)}</span>`:void 0})({can_edit:t,entered:e,model:this.model,is_groupchat:!0,viewUnreadMessages:e=>this.viewUnreadMessages(e)}),this)}renderIfOwnOccupant(e){e.get("jid")===wa.bare_jid&&this.debouncedRender()}sendButtonClicked(e){var t;null===(t=this.querySelector("converse-muc-message-form"))||void 0===t||t.onFormSubmitted(e)}hideOccupants(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:!0})}});const $_={offline:"Offline",unavailable:"Unavailable",xa:"Extended Away",away:"Away",dnd:"Do not disturb",chat:"Chattty",online:"Online"},I_=(e,t)=>{var n,s;const i=e.get("affiliation"),r=$_[e.get("show")],o=Ah("Admin"),a=Ah("Member"),c=Ah("Moderator"),l=Ah("Owner"),d=Ah("Visitor"),u=e.get("role"),h=e.get("show");let f,m;return[f,m]="online"===h?["fa fa-circle","chat-status-online"]:"dnd"===h?["fa fa-minus-circle","chat-status-busy"]:"away"===h?["fa fa-circle","chat-status-away"]:["fa fa-circle","subdued-color"],ol`
<li class="occupant" id="${e.id}" title="${(e=>{const t=e.get("role"),n=(e=>Ah("Click to mention %1$s in your message.",e.get("nick")))(e),s=Ah("This user is a moderator."),i=Ah("This user can send messages in this groupchat."),r=Ah("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)}">
<div class="row no-gutters">
<div class="col-auto">
2021-12-23 22:20:17 +01:00
<a class="show-msg-author-modal" @click=${t=>function(e,t){Nl.modal.show(Hv,{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"></converse-avatar>
<converse-icon
title="${r}"
color="var(--${m})"
style="margin-top: -0.1em"
size="0.82em"
class="${f} chat-status chat-status--avatar"></converse-icon>
</a>
</div>
<div class="col occupant-nick-badge">
2021-12-23 22:20:17 +01:00
<span class="occupant-nick" @click=${t.onOccupantClicked}>${e.getDisplayName()}</span>
<span class="occupant-badges">
2021-12-23 22:20:17 +01:00
${"owner"===i?ol`<span class="badge badge-groupchat">${l}</span>`:""}
${"admin"===i?ol`<span class="badge badge-info">${o}</span>`:""}
${"member"===i?ol`<span class="badge badge-info">${a}</span>`:""}
${"moderator"===u?ol`<span class="badge badge-info">${c}</span>`:""}
${"visitor"===u?ol`<span class="badge badge-secondary">${d}</span>`:""}
</span>
</div>
</div>
</li>
2021-12-23 22:20:17 +01:00
`};var M_=n(9959),R_={};R_.styleTagTransform=yg(),R_.setAttributes=mg(),R_.insert=hg().bind(null,"head"),R_.domAPI=dg(),R_.insertStyleElement=pg(),cg()(M_.Z,R_),M_.Z&&M_.Z.locals&&M_.Z.locals;var D_=n(902),L_={};L_.styleTagTransform=yg(),L_.setAttributes=mg(),L_.insert=hg().bind(null,"head"),L_.domAPI=dg(),L_.insertStyleElement=pg(),cg()(D_.Z,L_),D_.Z&&D_.Z.locals&&D_.Z.locals;const{u:z_}=Il.env;Nl.elements.define("converse-muc-sidebar",class extends rg{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=Ah("Participants");return ol`
<div class="occupants-header">
2021-12-23 22:20:17 +01:00
<i class="hide-occupants" @click=${e.closeSidebar}>
<converse-icon color="var(--text-color)" class="fa fa-times" size="1em"></converse-icon>
</i>
<div class="occupants-header--title">
2021-12-23 22:20:17 +01:00
<span class="occupants-heading">${t}</span>
</div>
</div>
<div class="dragresize dragresize-occupants-left"></div>
2021-12-23 22:20:17 +01:00
<ul class="occupant-list">${e.occupants.map((t=>I_(t,e)))}</ul>
`})(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),z_.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:P_}=Il.env;Nl.elements.define("converse-muc-chatarea",class extends rg{static get properties(){return{jid:{type:String},show_help_messages:{type:Boolean},type:{type:String}}}async initialize(){this.model=await Nl.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 ol`
<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}"></converse-chat-content>
2021-12-23 22:20:17 +01:00
${null!==(t=e.model)&&void 0!==t&&t.get("show_help_messages")?ol`<div class="chat-content__help">
<converse-chat-help
.model=${e.model}
.messages=${e.getHelpMessages()}
type="info"
chat_type="${wa.CHATROOMS_TYPE}"
></converse-chat-help></div>`:""}
</div>
<converse-muc-bottom-panel jid="${e.jid}" class="bottom-panel"></converse-muc-bottom-panel>
</div>
<div class="disconnect-container hidden"></div>
2021-12-23 22:20:17 +01:00
${e.model?ol`
<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}></converse-muc-sidebar>`:""}
2021-12-23 22:20:17 +01:00
`})({getHelpMessages:()=>this.getHelpMessages(),jid:this.jid,model:this.model,onMousedown:e=>this.onMousedown(e),show_send_button:Nl.settings.get("show_send_button"),shouldShowSidebar:()=>this.shouldShowSidebar(),type:this.type})}shouldShowSidebar(){return!this.model.get("hidden_occupants")&&this.model.session.get("connection_status")===Il.ROOMSTATUS.ENTERED}getHelpMessages(){const e=Nl.settings.get("muc_disable_slash_commands"),t=Array.isArray(e)?e:[];return[`<strong>/admin</strong>: ${Ah("Change user's affiliation to admin")}`,`<strong>/ban</strong>: ${Ah("Ban user by changing their affiliation to outcast")}`,`<strong>/clear</strong>: ${Ah("Clear the chat area")}`,`<strong>/close</strong>: ${Ah("Close this groupchat")}`,`<strong>/deop</strong>: ${Ah("Change user role to participant")}`,`<strong>/destroy</strong>: ${Ah("Remove this groupchat")}`,`<strong>/help</strong>: ${Ah("Show this menu")}`,`<strong>/kick</strong>: ${Ah("Kick user from groupchat")}`,`<strong>/me</strong>: ${Ah("Write in 3rd person")}`,`<strong>/member</strong>: ${Ah("Grant membership to a user")}`,`<strong>/modtools</strong>: ${Ah("Opens up the moderator tools GUI")}`,`<strong>/mute</strong>: ${Ah("Remove user's ability to post messages")}`,`<strong>/nick</strong>: ${Ah("Change your nickname")}`,`<strong>/op</strong>: ${Ah("Grant moderator role to user")}`,`<strong>/owner</strong>: ${Ah("Grant ownership of this groupchat")}`,`<strong>/register</strong>: ${Ah("Register your nickname")}`,`<strong>/revoke</strong>: ${Ah("Revoke the user's current affiliation")}`,`<strong>/subject</strong>: ${Ah("Set groupchat subject")}`,`<strong>/topic</strong>: ${Ah("Set groupchat subject (alias for /subject)")}`,`<strong>/voice</strong>: ${Ah("Allow muted user to post messages")}`].filter((e=>t.every((t=>!e.startsWith(t+"<",9))))).filter((e=>this.model.getAllowedCommands().some((t=>e.startsWith(t+"<",9)))))}onMousedown(e){P_.hasClass("dragresize-occupants-left",e.target)&&this.onStartResizeOccupants(e)}onStartResizeOccupants(e){this.resizing=!0,this.addEventListener("mousemove",this.onMouseMove),this.addEventListener("mouseup",this.onMouseUp);const t=this.querySelector("converse-muc-sidebar"),n=window.getComputedStyle(t);this.width=parseInt(n.width.replace(/px$/,""),10),this.prev_pageX=e.pageX}_onMouseMove(e){if(this.resizing){e.preventDefault();const t=this.prev_pageX-e.pageX;this.resizeSidebarView(t,e.pageX),this.prev_pageX=e.pageX}}_onMouseUp(e){if(this.resizing){e.preventDefault(),this.resizing=!1,this.removeEventListener("mousemove",this.onMouseMove),this.removeEventListener("mouseup",this.onMouseUp);const t=this.querySelector("converse-muc-sidebar").getBoundingClientRect(),n=this.calculateSidebarWidth(t,0);P_.safeSave(this.model,{occupants_width:n})}}calculateSidebarWidth(e,t){let n=e.width+t;const s=this.clientWidth;return n<.2*s?(n=.2*s,this.is_minimum=!0):n>.75*s?(n=.75*s,this.is_maximum=!0):s-n<250?(n=s-250,this.is_maximum=!0):(this.is_maximum=!1,this.is_minimum=!1),n}resizeSidebarView(e,t){const n=this.querySelector("converse-muc-sidebar"),s=n.getBoundingClientRect();if(this.is_minimum)this.is_minimum=s.left<t;else if(this.is_maximum)this.is_maximum=s.left>t;else{const t=this.calculateSidebarWidth(s,e);n.style.flex="0 0 "+t+"px"}}});const{sizzle:F_}=Il.env,U_=Il.env.utils,{sizzle:B_}=Il.env,q_=Il.env.utils;Nl.elements.define("converse-muc-config-form",class extends rg{static get properties(){return{jid:{type:String}}}connectedCallback(){super.connectedCallback(),this.model=wa.chatboxes.get(this.jid),this.listenTo(this.model.features,"change:passwordprotected",this.requestUpdate),this.listenTo(this.model.session,"change:config_stanza",this.requestUpdate),this.getConfig()}render(){return(e=>{const t=Nl.settings.get("roomconfig_whitelist"),n=e.model.session.get("config_stanza");let s,i=[],r="";if(n){var o,a;const c=U_.toStanza(n);i=F_("field",c),t.length&&(i=i.filter((e=>t.includes(e.getAttribute("var")))));const l={new_password:!e.model.features.get("passwordprotected"),fixed_username:e.model.get("jid")};i=i.map((e=>U_.xForm2TemplateResult(e,c,l))),r=null=
<form class="converse-form chatroom-form ${i.length?"":"converse-form--spinner"}"
autocomplete="off"
@submit=${e.submitConfigForm}>
<fieldset class="form-group">
<legend class="centered">${s}</legend>
2021-12-23 22:20:17 +01:00
${s!==r?ol`<p class="form-help">${r}</p>`:""}
${i.length?i:sy({classes:"hor_centered"})}
</fieldset>
2021-12-23 22:20:17 +01:00
${i.length?ol`
<fieldset>
<input type="submit" class="btn btn-primary" value="${c}">
<input type="button" class="btn btn-secondary button-cancel" value="${l}" @click=${e.closeConfigForm}>
</fieldset>`:""}
</form>
2021-12-23 22:20:17 +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=B_(":input:not([type=button]):not([type=submit])",e.target).map(q_.webForm2xForm).filter((e=>e));try{await this.model.sendConfiguration(t)}catch(e){M.error(e);const t=Ah("Sorry, an error occurred while trying to submit the config form.")+" "+Ah("Check your browser's developer console for details.");Nl.alert("error",Ah("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)}});Nl.elements.define("converse-muc-destroyed",class extends rg{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=Ah("This groupchat no longer exists"),n=Ah('The following reason was given: "%1$s"',e.reason||"");return ol`
<div class="alert alert-danger">
<h3 class="alert-heading disconnect-msg">${t}</h3>
</div>
2021-12-23 22:20:17 +01:00
${e.reason?ol`<p class="destroyed-reason">${n}</p>`:""}
${e.moved_jid?(e=>{const t=Ah("The conversation has moved to a new address. Click the link below to enter.");return ol`
<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):""}
2021-12-23 22:20:17 +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 Nl.rooms.get(t,{},!0)).maybeShow(!0),this.model.destroy()}}),Nl.elements.define("converse-muc-disconnected",class extends rg{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(Ah("This action was done by %1$s.",n));const s=this.model.session.get("disconnection_reason");return s&&t.push(Ah('The reason given is: "%1$s".',s)),(e=>ol`
<div class="alert alert-danger">
<h3 class="alert-heading disconnect-msg">${e[0]}</h3>
2021-12-23 22:20:17 +01:00
${e.slice(1).map((e=>ol`<p class="disconnect-msg">${e}</p>`))}
</div>`)(t)}});const H_=Il.env.utils,G_=cp.extend({id:"muc-invite-modal",initialize(){cp.prototype.initialize.apply(this,arguments),this.listenTo(this.model,"change",this.render),this.initInviteWidget()},toHTML(){return(e=>{const t=Ah("Invite"),n=Ah("Invite someone to this groupchat"),s=Ah("user@example.org"),i=Ah("Please enter a valid XMPP address"),r=Ah("XMPP Address"),o=Ah("Optional reason for the invitation");return ol`
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="add-chatroom-modal-label">${n}</h5>
2021-12-23 22:20:17 +01:00
${dp}
</div>
<div class="modal-body">
<span class="modal-alert"></span>
<div class="suggestion-box room-invite">
<form @submit=${e.submitInviteForm}>
<div class="form-group">
<label class="clearfix" for="invitee_jids">${r}:</label>
2021-12-23 22:20:17 +01:00
${e.invalid_invite_jid?ol`<div class="error error-feedback">${i}</div>`:""}
<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"></span>
<ul class="suggestion-box__results suggestion-box__results--below" hidden=""></ul>
</div>
<div class="form-group">
<label>${o}:</label>
<textarea class="form-control" name="reason"></textarea>
</div>
<div class="form-group">
<button type="submit" class="btn btn-primary">${t}</button>
</div>
</form>
</div>
</div>
</div>
</div>
2021-12-23 22:20:17 +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");H_.isValidJID(n)?(this.chatroomview.model.directInvite(n,s),this.modal.hide()):this.model.set({invalid_invite_jid:!0})}}),W_=cp.extend({id:"muc-details-modal",initialize(){cp.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=Ah("Groupchat XMPP address"),n=Ah("Message archiving"),s=Ah("Messages are archived on the server"),i=Ah("Description"),r=Ah("Features"),o=Ah("Hidden"),a=Ah("This groupchat is not publicly searchable"),c=Ah("This groupchat is restricted to members only"),l=Ah("Members only"),d=Ah("Moderated"),u=Ah("Participants entering this groupchat need to request permission to write"),h=Ah("Name"),f=Ah("This groupchat does not require a password upon entry"),m=Ah("No password required"),g=Ah("Not anonymous"),p=Ah("All other groupchat participants can see your XMPP address"),v=Ah("Not moderated"),y=Ah("Participants entering this groupchat can write right away"),b=Ah("Online users"),_=Ah("Open"),w=Ah("Anyone can join this groupchat"),S=Ah("This groupchat requires a password before entry"),x=Ah("Password protected"),E=Ah("Persistent"),A=Ah("This groupchat persists even if it's unoccupied"),C=Ah("Public"),T=Ah("Semi-anonymous"),k=Ah("Only moderators can see your XMPP address"),j=Ah("Temporary"),N=Ah("This groupchat will disappear once the last person leaves");return ol`
<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}</h5>
2021-12-23 22:20:17 +01:00
${dp}
</div>
<div class="modal-body">
<span class="modal-alert"></span>
<div class="room-info">
<p class="room-info"><strong>${h}</strong>: ${e.name}</p>
<p class="room-info"><strong>${t}</strong>: ${e.jid}</p>
<p class="room-info"><strong>${i}</strong>: ${e.config.description}</p>
2021-12-23 22:20:17 +01:00
${e.subject?(e=>{const t=Ah("Topic"),n=Ah("Topic author");return ol`
<p class="room-info"><strong>${t}</strong>: ${e.subject.text}</p>
<p class="room-info"><strong>${n}</strong>: ${e.subject&&e.subject.author}</p>
`})(e):""}
2021-12-23 22:20:17 +01:00
<p class="room-info"><strong>${b}</strong>: ${e.num_occupants}</p>
<p class="room-info"><strong>${r}</strong>:
<div class="chatroom-features">
<ul class="features-list">
2021-12-23 22:20:17 +01:00
${e.features.passwordprotected?ol`<li class="feature" ><span class="fa fa-lock"></span>${x} - <em>${S}</em></li>`:""}
${e.features.unsecured?ol`<li class="feature" ><span class="fa fa-unlock"></span>${m} - <em>${f}</em></li>`:""}
${e.features.hidden?ol`<li class="feature" ><span class="fa fa-eye-slash"></span>${o} - <em>${a}</em></li>`:""}
${e.features.public_room?ol`<li class="feature" ><span class="fa fa-eye"></span>${C} - <em>${e.__("This groupchat is publicly searchable")}</em></li>`:""}
${e.features.membersonly?ol`<li class="feature" ><span class="fa fa-address-book"></span>${l} - <em>${c}</em></li>`:""}
${e.features.open?ol`<li class="feature" ><span class="fa fa-globe"></span>${_} - <em>${w}</em></li>`:""}
${e.features.persistent?ol`<li class="feature" ><span class="fa fa-save"></span>${E} - <em>${A}</em></li>`:""}
${e.features.temporary?ol`<li class="feature" ><span class="fa fa-snowflake-o"></span>${j} - <em>${N}</em></li>`:""}
${e.features.nonanonymous?ol`<li class="feature" ><span class="fa fa-id-card"></span>${g} - <em>${p}</em></li>`:""}
${e.features.semianonymous?ol`<li class="feature" ><span class="fa fa-user-secret"></span>${T} - <em>${k}</em></li>`:""}
${e.features.moderated?ol`<li class="feature" ><span class="fa fa-gavel"></span>${d} - <em>${u}</em></li>`:""}
${e.features.unmoderated?ol`<li class="feature" ><span class="fa fa-info-circle"></span>${v} - <em>${y}</em></li>`:""}
${e.features.mam_enabled?ol`<li class="feature" ><span class="fa fa-database"></span>${n} - <em>${s}</em></li>`:""}
</ul>
</div>
</p>
</div>
</div>
2021-12-23 22:20:17 +01:00
<div class="modal-footer">${lp}</div>
</div>
</div>
2021-12-23 22:20:17 +01:00
`})(Object.assign(this.model.toJSON(),{config:this.model.config.toJSON(),display_name:Ah("Groupchat info for %1$s",this.model.getDisplayName()),features:this.model.features.toJSON(),num_occupants:this.model.occupants.length}))}});var V_=n(307),J_={};J_.styleTagTransform=yg(),J_.setAttributes=mg(),J_.insert=hg().bind(null,"head"),J_.domAPI=dg(),J_.insertStyleElement=pg(),cg()(V_.Z,J_),V_.Z&&V_.Z.locals&&V_.Z.locals,Nl.elements.define("converse-rich-text",class extends rg{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 wv(this.text,this.offset,e)}});var Q_=n(3288),Z_={};Z_.styleTagTransform=yg(),Z_.setAttributes=mg(),Z_.insert=hg().bind(null,"head"),Z_.domAPI=dg(),Z_.insertStyleElement=pg(),cg()(Q_.Z,Z_),Q_.Z&&Q_.Z.locals&&Q_.Z.locals,Nl.elements.define("converse-muc-heading",class extends Og{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();dl(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(),Nl.modal.show(W_,{model:this.model},e)}showInviteModal(e){e.preventDefault(),Nl.modal.show(G_,{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",Il.MUC.VIEWS.CONFIG)}close(e){e.preventDefault(),this.model.close()}destroy(e){e.preventDefault(),p_(this.model)}getHeadingButtons(e){const t=[];t.push({i18n_text:Ah("Details"),i18n_title:Ah("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:Ah("Configure"),i18n_title:Ah("Configure this groupchat"),handler:()=>this.getAndRenderConfigurationForm(),a_class:"configure-chatroom-button",icon_class:"fa-wrench",name:"configure"}),this.model.invitesAllowed()&&t.push({i18n_text:Ah("Invite"),i18n_title:Ah("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:Ah(e?"Show topic":"Hide topic"),i18n_title:Ah(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")===Il.ROOMSTATUS.ENTERED){const e=this.model.getAllowedCommands();e.includes("modtools")&&t.push
<div class="chatbox-title ${i?"":"chatbox-title--no-desc"}">
2021-12-23 22:20:17 +01:00
${wa.api.settings.get("singleton")?"":ol`<converse-controlbox-navback jid="${e.jid}"></converse-controlbox-navback>`}
<div class="chatbox-title__text" title="${"hidden"!==Nl.settings.get("locked_muc_domain")?e.jid:""}">${e.title}
${e.bookmarked?ol`<i class="fa fa-bookmark chatbox-title__text--bookmarked" title="${n}"></i>`:""}
</div>
<div class="chatbox-title__buttons row no-gutters">
2021-12-23 22:20:17 +01:00
${e.standalone_btns.length?(e=>e.standalone_btns.reverse().map((e=>Ep(e,""))))(e):""}
${e.dropdown_btns.length?ol`<converse-dropdown class="dropleft" color="var(--chatroom-head-color)" .items=${e.dropdown_btns}></converse-dropdown>`:""}
</div>
</div>
2021-12-23 22:20:17 +01:00
${i?ol`<p class="chat-head__desc" title="${t}">
<converse-rich-text text=${s} render_styling></converse-rich-text>
</p>`:""}
2021-12-23 22:20:17 +01:00
`})(Object.assign(this.model.toJSON(),{_converse:wa,subject_hidden:e,dropdown_btns:s.map((e=>Ty(e))),standalone_btns:n.map((e=>ky(e))),title:this.model.getDisplayName()}))}});var K_=n(6233),Y_={};Y_.styleTagTransform=yg(),Y_.setAttributes=mg(),Y_.insert=hg().bind(null,"head"),Y_.domAPI=dg(),Y_.insertStyleElement=pg(),cg()(K_.Z,Y_),K_.Z&&K_.Z.locals&&K_.Z.locals;Nl.elements.define("converse-muc-nickname-form",class extends rg{static get properties(){return{jid:{type:String}}}connectedCallback(){super.connectedCallback(),this.model=wa.chatboxes.get(this.jid)}render(){return j_(this.model)}});function X_(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}Nl.elements.define("converse-muc-password-form",class extends rg{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=Ah("This groupchat requires a password"),n=Ah("Password: "),s=Ah("Submit");return ol`
<form class="converse-form chatroom-form converse-centered-form" @submit=${e.submitPassword}>
<fieldset class="form-group">
<label>${t}</label>
<p class="validation-message">${e.validation_message}</p>
<input class="hidden-username" type="text" autocomplete="username" value="${e.jid}"></input>
<input type="password"
name="password"
required="required"
class="form-control ${e.validation_message?"error":""}"
placeholder="${n}"/>
</fieldset>
<fieldset class="form-group">
<input class="btn btn-primary" type="submit" value="${s}"/>
</fieldset>
</form>
2021-12-23 22:20:17 +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 ew extends Py{constructor(...e){super(...e),X_(this,"length",300),X_(this,"is_chatroom",!0)}async initialize(){this.model=await Nl.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(),Nl.trigger("chatRoomViewInitialized",this)}render(){return(e=>ol`
<div class="flyout box-flyout">
<converse-dragresize></converse-dragresize>
2021-12-23 22:20:17 +01:00
${e.model?ol`
<converse-muc-heading jid="${e.model.get("jid")}" class="chat-head chat-head-chatroom row no-gutters">
</converse-muc-heading>
2021-12-23 22:20:17 +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=Il.ROOMSTATUS,i=e.model.session.get("connection_status");return t===Il.MUC.VIEWS.CONFIG?ol`<converse-muc-config-form class="muc-form-container" jid="${n}"></converse-muc-config-form>`:t===Il.MUC.VIEWS.BOOKMARK?ol`<converse-muc-bookmark-form class="muc-form-container" jid="${n}"></converse-muc-bookmark-form>`:ol`
${i==s.PASSWORD_REQUIRED?ol`<converse-muc-password-form class="muc-form-container" jid="${n}"></converse-muc-password-form>`:""}
${i==s.ENTERED?ol`<converse-muc-chatarea jid="${n}"></converse-muc-chatarea>`:""}
${i==s.CONNECTING?sy():""}
${i==s.NICKNAME_REQUIRED?function(e){const t=e.get("jid");return Nl.settings.get("muc_show_logs_before_join")?ol`<converse-muc-chatarea jid="${t}"></converse-muc-chatarea>`:ol`<converse-muc-nickname-form jid="${t}"></converse-muc-nickname-form>`}(e.model):""}
${i==s.DISCONNECTED?ol`<converse-muc-disconnected jid="${n}"></converse-muc-disconnected>`:""}
${i==s.BANNED?ol`<converse-muc-disconnected jid="${n}"></converse-muc-disconnected>`:""}
${i==s.DESTROYED?ol`<converse-muc-destroyed jid="${n}"></converse-muc-destroyed>`:""}
`}(e)}</div>
`:""}
2021-12-23 22:20:17 +01:00
</div>`)({model:this.model})}onConnectionStatusChanged(){this.model.session.get("connection_status")===Il.ROOMSTATUS.CONNECTING&&(this.model.session.save({disconnection_actor:void 0,disconnection_message:void 0,disconnection_reason:void 0}),this.model.save({moved_jid:void 0,password_validation_message:void 0,reason:void 0})),this.requestUpdate()}}Nl.elements.define("converse-muc",ew);var tw=n(3076),nw={};nw.styleTagTransform=yg(),nw.setAttributes=mg(),nw.insert=hg().bind(null,"head"),nw.domAPI=dg(),nw.insertStyleElement=pg(),cg()(tw.Z,nw),tw.Z&&tw.Z.locals&&tw.Z.locals,Il.MUC.VIEWS={CONFIG:"config-form",BOOKMARK:"bookmark-form"},Il.plugins.add("converse-muc-views",{dependencies:["converse-modal","converse-controlbox","converse-chatview"],initialize(){const{_converse:e}=this;Nl.settings.extend({auto_list_rooms:!1,cache_muc_messages:!0,locked_muc_nickname:!1,modtools_disable_query:[],muc_disable_slash_commands:!1,muc_mention_autocomplete_filter:"contains",muc_mention_autocomplete_min_chars:0,muc_mention_autocomplete_show_avatar:!0,muc_roomid_policy:null,muc_roomid_policy_hint:null,roomconfig_whitelist:[],show_retraction_warning:!0,visible_toolbar_buttons:{toggle_occupants:!0}}),e.ChatRoomView=ew,Nl.listen.on("clearsession",(()=>{const t=e.chatboxviews.get("controlbox");t&&t.roomspanel&&(t.roomspanel.model.destroy(),t.roomspanel.remove(),delete t.roomspanel)})),Nl.listen.on("controlBoxInitialized",(e=>{Nl.settings.get("allow_muc")&&(y_(e),e.model.on("change:connected",(()=>y_(e))))})),Nl.listen.on("chatBoxClosed",(t=>{var n;t.get("type")===e.CHATROOMS_TYPE&&(n=t.get("jid"),wa.router.history.getFragment()===`converse/room?jid=${n}`&&wa.router.navigate(""))}))}});var sw=n(4023),iw=n.n(sw);const{Strophe:rw}=Il.env,ow="Notification"in window;let aw;function cw(e){var t;return wa.isTestEnv()||((null===(t=wa.chatboxes.get(e.from))||void 0===t?void 0:t.isHidden())??!1)}function lw(){return wa.isTestEnv()||ow&&Nl.settings.get("show_desktop_notifications")&&"granted"===Notification.permission}function dw(){var e,t;aw=null,null===(e=(t=navigator).clearAppBadge)||void 0===e||e.call(t).catch((e=>M.error("Could not clear unread count in app badge "+e)))}function uw(){if(Nl.settings.get("show_tab_notifications")){var e,t;aw=aw??new Il.env.Favico({type:"circle",animation:"pop"});const n=wa.chatboxes.models.reduce(((e,t)=>e+(t.get("num_unread")||0)),0);aw.badge(n),null===(e=(t=navigator).setAppBadge)||void 0===e||e.call(t,n).catch((e=>M.error("Could set unread count in app badge - "+e)))}}function hw(e,t,n){return e.reduce(((e,s)=>e||(e=>[wa.bare_jid,`${t}/${n}`].includes(e.uri.replace(/^xmpp:/,"")))(s)),!1)}async function fw(e){if(!await function(e){const{attrs:t}=e;if(!t||t.is_forwarded)return!1;if("groupchat"===t.type)return async function(e){if(!(null!=e&&e.body||null!=e&&e.message))return!1;const t=e.from,n=e.from_muc,s=Nl.settings.get("notify_all_room_messages"),i=wa.chatboxes.get(n),r=rw.getResourceFromJid(t),o=r&&rw.unescapeNode(r)||"";let a=!1;const c=i.get("nick");Nl.settings.get("notify_nicknames_without_references")&&(a=new RegExp(`\\b${c}\\b`).test(e.body));const l=o!==c,d=!0===s||Array.isArray(s)&&s.includes(n)||hw(e.references,n,c)||a;return!(!l||!d)&&await Nl.hook("shouldNotifyOfGroupMessage",e,!0)}(t);if("info"===t.type)return async function(e){if(!e.from_muc)return!1;const t=await Nl.rooms.get(e.from_muc);if(!t)return!1;const n=t.get("nick"),s=e.from_muc,i=Nl.settings.get("notify_all_room_messages");return!0===i||Array.isArray(i)&&i.includes(s)||hw(e.references,s,n)}(t);if(t.is_headline)return cw(t);const n=rw.getBareJidFromJid(t.from)===wa.bare_jid;return!na(t)&&!n&&("all"===Nl.settings.get("show_desktop_notifications")||cw(t))}(e))return!1;Nl.trigger("messageNotification",e),function(){if(Nl.settings.get("play_sounds")&&void 0!==window.Audio){const e=new Audio(Nl.settings.get("sounds_path")+"msg_received.ogg"),t=e.canPlayType("audio/ogg");if("probably"===t)return e.play();const n=new Audio(Nl.settings.get("sounds_path")+"msg_received.mp3"),s=n.canPlayType("audio/mp3");"probably"===s?n.play():"maybe"===t?e.play(
<button class="toggle-omemo" title="${i}" data-disabled=${!n.get("omemo_supported")} @click=${Zw}>
<converse-icon
class="fa ${n.get("omemo_active")?"fa-lock":"fa-unlock"}"
path-prefix="${Nl.settings.get("assets_path")}"
size="1em"
color="${r}"
></converse-icon>
</button>
`),t}const Yw={decryptMessage:async function(e){const t=await crypto.subtle.importKey("raw",e.key,bw,!0,["encrypt","decrypt"]),n=ww(Cw(e.payload),e.tag),s={name:"AES-GCM",iv:Cw(e.iv),tagLength:128};return xw(await crypto.subtle.decrypt(s,t,n))},encryptMessage:async function(e){const t=crypto.getRandomValues(new window.Uint8Array(12)),n=await crypto.subtle.generateKey(bw,!0,["encrypt","decrypt"]),s={name:"AES-GCM",iv:t,tagLength:128},i=await crypto.subtle.encrypt(s,n,Ew(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:ww(c,a),payload:Aw(o),iv:Aw(t)}},formatFingerprint:Iw};Nl.elements.define("converse-omemo-fingerprints",class extends rg{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=Ah("OMEMO Fingerprints"),n=Ah("No OMEMO-enabled devices found"),s=e.devicelist.devices;return ol`
<hr/>
<ul class="list-group fingerprints">
<li class="list-group-item active">${t}</li>
${s.length?s.map((t=>((e,t)=>{const n=Ah("Trusted"),s=Ah("Untrusted");return t.get("bundle")&&t.get("bundle").fingerprint?ol`
<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}
</label>
<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}
</label>
</div>
<code class="fingerprint">${Iw(t.get("bundle").fingerprint)}</code>
</form>
</li>
`:""})(e,t))):ol`<li class="list-group-item"> ${n} </li>`}
</ul>
`})(this):""}toggleDeviceTrust(e){const t=e.target;this.devicelist.devices.get(t.getAttribute("name")).save("trusted",parseInt(t.value,10))}});const Xw=e=>{var t;const n=Ah("This device's OMEMO fingerprint"),s=Ah("Generate new keys and fingerprint");return ol`
<form class="converse-form fingerprint-removal" @submit=${e.removeSelectedFingerprints}>
<ul class="list-group fingerprints">
<li class="list-group-item active">${n}</li>
<li class="list-group-item">
${e.current_device&&e.current_device.get("bundle")&&e.current_device.get("bundle").fingerprint?(e=>ol`
<span class="fingerprint">${Iw(e.current_device.get("bundle").fingerprint)}</span>`)(e):sy()}
</li>
</ul>
<div class="form-group">
<button type="button" class="generate-bundle btn btn-danger" @click=${e.generateOMEMODeviceBundle}>${s}</button>
</div>
${null!==(t=e.other_devices)&&void 0!==t&&t.length?(e=>{var t;const n=Ah("Other OMEMO-enabled devices"),s=Ah("Checkbox to select fingerprints of all other OMEMO devices"),i=Ah("Remove checked devices and close"),r=Ah("Select all");return ol`
<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}
</label>
</li>
${null===(t=e.other_devices)||void 0===t?void 0:t.map((t=>(e=>ol`
${e.device.get("bundle")&&e.device.get("bundle").fingerprint?(e=>{const t=Ah("Checkbox for selecting the following fingerprint");return ol`
<li class="fingerprint-removal-item list-group-item nopadding">
<label>
<input type="checkbox" value="${e.device.get("id")}"
aria-label="${t}"/>
<span class="fingerprint">${Iw(e.device.get("bundle").fingerprint)}</span>
</label>
</li>
`})(e):(e=>{const t=Ah("Device without a fingerprint"),n=Ah("Checkbox for selecting the following device");return ol`
<li class="fingerprint-removal-item list-group-item nopadding">
<label>
<input type="checkbox" value="${e.device.get("id")}"
aria-label="${n}"/>
<span>${t}</span>
</label>
</li>
`})(e)}
`)(Object.assign({device:t},e))))}
</ul>
<div class="form-group"><button type="submit" class="save-form btn btn-primary">${i}</button></div>
`})(e):""}
</form>`},{Strophe:eS,sizzle:tS,u:nS}=Il.env;Nl.elements.define("converse-omemo-profile",class extends rg{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 Nl.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?Xw(this):""}selectAll(e){let t=nS.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=tS('.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(eS.LogLevel.ERROR,Ah("Error"),[Ah("Sorry, an error occurred while trying to remove the devices.")])}await this.setAttributes(),this.requestUpdate()}async generateOMEMODeviceBundle(e){e.preventDefault(),confirm(Ah("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 Nl.omemo.bundle.generate(),await this.setAttributes(),this.requestUpdate())}});let sS;const iS=cp.extend({id:"converse-client-info-modal",initialize(e){sS=e._converse,cp.prototype.initialize.apply(this,arguments)},toHTML(){return(e=>{const t=Ah("Settings"),n=Ah("%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=Ah("%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=Nl.settings.get("show_client_info"),r=Nl.settings.get("allow_adhoc_commands");return ol`
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="converse-modtools-modal-label">${t}</h5>
2021-12-23 22:20:17 +01:00
${dp}
</div>
<div class="modal-body">
2021-12-23 22:20:17 +01:00
${i&&r?(e=>{const t=Ah("About"),n=Ah("Commands");return ol`
<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>
</li>
<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>
</li>
</ul>
`})(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"></span>
<br/>
<div class="container">
<h6 class="brand-heading">Converse</h6>
<p class="brand-subtitle">${e.version_name}</p>
2021-12-23 22:20:17 +01:00
<p class="brand-subtitle">${gy(Oo().sanitize(n))}</p>
<p class="brand-subtitle">${gy(Oo().sanitize(s))}</p>
</div>
</div>
<div class="tab-pane tab-pane--columns ${!i&&r?"active":""}"
id="commands-tabpanel"
role="tabpanel"
aria-labelledby="commands-tab">
<converse-adhoc-commands/>
</div>
</div>
</div>
</div>
</div>
2021-12-23 22:20:17 +01:00
`})(Object.assign(this.model.toJSON(),this.model.vcard.toJSON(),{version_name:sS.VERSION_NAME}))}});Nl.elements.define("converse-user-profile",class extends rg{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")||Ah("I am %1$s","chat"===(a=i)?Ah("online"):"dnd"===a?Ah("busy"):"xa"===a?Ah("away for long"):"away"===a?Ah("away"):"offline"===a?Ah("offline"):Ah(a)||Ah("online"));var a;const c=Ah("Click to change your chat status"),l=Nl.settings.get("show_client_info")||Nl.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"],ol`
<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"></converse-avatar>
</a>
<span class="username w-100 align-self-center">${r}</span>
${l?function(e){const t=Ah("Show details about this chat client");return ol`<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"></converse-icon>
</a>`}(e):""}
${Nl.settings.get("allow_logout")?function(e){const t=Ah("Log out");return ol`<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"></converse-icon>
</a>`}(e):""}
</div>
<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}"></converse-icon> ${o}</span>
</a>
</div>
</div>`})(this)}showProfileModal(e){null==e||e.preventDefault(),Nl.modal.show(wa.ProfileModal,{model:this.model},e)}showStatusChangeModal(e){null==e||e.preventDefault(),Nl.modal.show(wa.ChatStatusModal,{model:this.model},e)}showUserSettingsModal(e){null==e||e.preventDefault(),Nl.modal.show(iS,{model:this.model,_converse:wa},e)}logout(e){null==e||e.preventDefault(),!0===confirm(Ah("Are you sure you want to log out?"))&&Nl.user.logout()}});const rS=Il.env.utils,oS=cp.extend({id:"modal-status-change",events:{"submit form#set-xmpp-status":"onFormSubmitted","click .clear-input":"clearStatusMessage"},toHTML(){return(e=>ol`
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="changeStatusModalLabel">${e.modal_title}</h5>
2021-12-23 22:20:17 +01:00
${dp}
</div>
<div class="modal-body">
<span class="modal-alert"></span>
<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"></span>${e.label_online}</label>
</div>
<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"></span>${e.label_busy}</label>
</div>
<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"></span>${e.label_away}</label>
</div>
<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"></span>${e.label_xa}</label>
</div>
</div>
<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"}"></span>
</div>
</div>
<button type="submit" class="btn btn-primary">${e.label_save}</button>
</form>
</div>
</div>
</div>
2021-12-23 22:20:17 +01:00
`)(Object.assign(this.model.toJSON(),this.model.vcard.toJSON(),{label_away:Ah("Away"),label_busy:Ah("Busy"),label_cancel:Ah("Cancel"),label_close:Ah("Close"),label_custom_status:Ah("Custom status"),label_offline:Ah("Offline"),label_online:Ah("Online"),label_save:Ah("Save"),label_xa:Ah("Away for long"),modal_title:Ah("Change chat status"),placeholder_status_message:Ah("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(),rS.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=oS;const aS=Ah("Your profile picture");Nl.elements.define("converse-image-picker",class extends rg{static get properties(){return{height:{type:Number},data:{type:Object},width:{type:Number}}}render(){return ol`
<a class="change-avatar" @click=${this.openFileSelection} title="${aS}">
<converse-avatar class="avatar" .data=${this.data} height="${this.height}" width="${this.width}"></converse-avatar>
</a>
<input @change=${this.updateFilePreview} class="hidden" name="image" type="file"/>
2021-12-23 22:20:17 +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 cS=n(577),lS=n.n(cS);const{sizzle:dS}=Il.env,uS=new(lS())({targetSize:.1,quality:.75,maxWidth:256,maxHeight:256}),hS=cp.extend({id:"user-profile-modal",events:{"submit .profile-form":"onFormSubmitted"},initialize(){this.listenTo(this.model,"change",this.render),cp.prototype.initialize.apply(this,arguments),Nl.trigger("profileModalInitialized",this.model)},toHTML(){return(e=>{var t,n;const s=Ah("Your Profile"),i=Ah("Email"),r=Ah("Full Name"),o=Ah("XMPP Address"),a=Ah("Nickname"),c=Ah("Role"),l=Ah("Save and close"),d=Ah("Use commas to separate multiple roles. Your roles are shown next to your name on your chat messages."),u=Ah("URL"),h=Ah("OMEMO"),f=Ah("Profile"),m=ol`<ul class="nav nav-pills justify-content-center">
<li role="presentation" class="nav-item">
2021-12-23 22:20:17 +01:00
<a class="nav-link active" id="profile-tab" href="#profile-tabpanel" aria-controls="profile-tabpanel" role="tab" data-toggle="tab">${f}</a>
</li>
<li role="presentation" class="nav-item">
2021-12-23 22:20:17 +01:00
<a class="nav-link" id="omemo-tab" href="#omemo-tabpanel" aria-controls="omemo-tabpanel" role="tab" data-toggle="tab">${h}</a>
</li>
2021-12-23 22:20:17 +01:00
</ul>`;return ol`
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
2021-12-23 22:20:17 +01:00
<h5 class="modal-title" id="user-profile-modal-label">${s}</h5>
${dp}
</div>
<div class="modal-body">
<span class="modal-alert"></span>
2021-12-23 22:20:17 +01:00
${null!==(t=wa.pluggable.plugins["converse-omemo"])&&void 0!==t&&t.enabled(wa)?m:""}
<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">
2021-12-23 22:20:17 +01:00
<converse-image-picker .data="${{image:e.image,image_type:e.image_type}}" width="128" height="128"></converse-image-picker>
</div>
<div class="col">
<div class="form-group">
2021-12-23 22:20:17 +01:00
<label class="col-form-label">${o}:</label>
<div>${e.jid}</div>
</div>
</div>
</div>
<div class="form-group">
2021-12-23 22:20:17 +01:00
<label for="vcard-fullname" class="col-form-label">${r}:</label>
<input id="vcard-fullname" type="text" class="form-control" name="fn" value="${e.fullname||""}"/>
</div>
<div class="form-group">
2021-12-23 22:20:17 +01:00
<label for="vcard-nickname" class="col-form-label">${a}:</label>
<input id="vcard-nickname" type="text" class="form-control" name="nickname" value="${e.nickname||""}"/>
</div>
<div class="form-group">
2021-12-23 22:20:17 +01:00
<label for="vcard-url" class="col-form-label">${u}:</label>
<input id="vcard-url" type="url" class="form-control" name="url" value="${e.url||""}"/>
</div>
<div class="form-group">
2021-12-23 22:20:17 +01:00
<label for="vcard-email" class="col-form-label">${i}:</label>
<input id="vcard-email" type="email" class="form-control" name="email" value="${e.email||""}"/>
</div>
<div class="form-group">
2021-12-23 22:20:17 +01:00
<label for="vcard-role" class="col-form-label">${c}:</label>
<input id="vcard-role" type="text" class="form-control" name="role" value="${e.role||""}" aria-describedby="vcard-role-help"/>
2021-12-23 22:20:17 +01:00
<small id="vcard-role-help" class="form-text text-muted">${d}</small>
</div>
<hr/>
<div class="form-group">
2021-12-23 22:20:17 +01:00
<button type="submit" class="save-form btn btn-primary">${l}</button>
</div>
</form>
</div>
2021-12-23 22:20:17 +01:00
${null!==(n=wa.pluggable.plugins["converse-omemo"])&&void 0!==n&&n.enabled(wa)?ol`
<div class="tab-pane" id="omemo-tabpanel" role="tabpanel" aria-labelledby="omemo-tab">
<converse-omemo-profile></converse-omemo-profile>
</div>`:""}
</div>
</div>
</div>
</div>
2021-12-23 22:20:17 +01:00
`})(Object.assign(this.model.toJSON(),this.model.vcard.toJSON(),{view:this}))},afterRender(){this.tabs=dS(".nav-item .nav-link",this.el).map((e=>new(Xg().Tab)(e)))},async setVCard(e){try{await Nl.vcard.set(wa.bare_jid,e)}catch(e){return M.fatal(e),void this.alert([Ah("Sorry, an error happened while trying to save your profile data."),Ah("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];uS.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=hS,Il.plugins.add("converse-profile",{dependencies:["converse-status","converse-modal","converse-vcard","converse-chatboxviews"],initialize(){Nl.settings.extend({allow_adhoc_commands:!0,show_client_info:!0})}});const fS={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=Ah("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=>Gw(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 Gw(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:Cw(i.identity_key),signedPreKey:{keyId:i.signed_prekey.id,publicKey:Cw(i.signed_prekey.public_key),signature:Cw(i.signed_prekey.signature)},preKey:{keyId:s.id,publicKey:Cw(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=Ah("This is an OMEMO encrypted message which your client doesnt 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=kw({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:jw.NS.RECEIPTS}).up(),i.c("encrypted",{xmlns:jw.NS.OMEMO}).c("header",{sid:wa.omemo_store.get("device_id")}),Yw.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(
<converse-brand-logo></converse-brand-logo>
2021-12-23 22:20:17 +01:00
${0===e.model.get("registration_status")?(()=>{const e=Nl.settings.get("registration_domain"),t=Ah("Create your account"),n=Ah("Please enter the XMPP provider to register with:");return ol`
<form id="converse-register" class="converse-form">
<legend class="col-form-label">${t}</legend>
<div class="form-group">
<label>${n}</label>
<div class="form-errors hidden"></div>
2021-12-23 22:20:17 +01:00
${e||(()=>{const e=Nl.settings.get("domain_placeholder"),t=Ah("Tip: A list of public XMPP providers is available"),n=Ah("here"),s=Nl.settings.get("providers_link");return ol`
<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>
`})()}
</div>
2021-12-23 22:20:17 +01:00
${e?"":(()=>{const e=Ah("Fetch registration form"),t=Ah("Already have a chat account?"),n=Ah("Log in here");return ol`
<fieldset class="form-group buttons">
<input class="btn btn-primary" type="submit" value="${e}" />
</fieldset>
<div class="switch-form">
<p>${t}</p>
<p><a class="login-here toggle-register-login" href="#converse/login">${n}</a></p>
</div>
`})()}
</form>
`})():""}
2021-12-23 22:20:17 +01:00
${1===e.model.get("registration_status")?(()=>{const e=Nl.settings.get("registration_domain"),t=Ah("Hold tight, we're fetching the registration form…"),n=Ah("Cancel");return ol`
<form id="converse-register" class="converse-form no-scrolling">
2021-12-23 22:20:17 +01:00
${sy({classes:"hor_centered"})}
<p class="info">${t}</p>
2021-12-23 22:20:17 +01:00
${e?"":ol`
<button class="btn btn-secondary button-cancel hor_centered">${n}</button>
`}
</form>
`})():""}
2021-12-23 22:20:17 +01:00
${2===e.model.get("registration_status")?(e=>{const t=Ah("Choose a different provider"),n=Ah("Already have a chat account?"),s=Ah("Account Registration:"),i=Ah("Log in here"),r=Ah("Register"),o=Nl.settings.get("registration_domain");return ol`
<form id="converse-register" class="converse-form">
<legend class="col-form-label">${s} ${e.domain}</legend>
<p class="title">${e.title}</p>
<p class="form-help instructions">${e.instructions}</p>
<div class="form-errors hidden"></div>
${e.form_fields}
<fieldset class="buttons form-group">
2021-12-23 22:20:17 +01:00
${e.fields?ol`
<input type="submit" class="btn btn-primary" value="${r}" />
`:""}
2021-12-23 22:20:17 +01:00
${o?"":ol`
<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>
</div>
</fieldset>
</form>
`})(e):""}
2021-12-23 22:20:17 +01:00
`;function WS(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:VS,sizzle:JS,$iq:QS}=Il.env,ZS=Il.env.utils,KS=1,YS=2;Nl.elements.define("converse-register-panel",class extends Og{constructor(...e){super(...e),WS(this,"id","converse-register-panel"),WS(this,"className","controlbox-pane fade-in"),WS(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=Nl.settings.get("registration_domain");t?this.fetchRegistrationForm(t):this.model.set("registration_status",0)}render(){dl(GS({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)===VS.Status.CONNFAIL)return this.showValidationError(Ah("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(VS.Status.REGIFAIL),this.showValidationError(Ah("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=QS({type:"get"}).c("query",{xmlns:VS.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(VS.Status.REGIFAIL,Ah('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(VS.Status.REGIFAIL,"unknown"),!1):(this.setFields(e),this.model.get("registration_status")===KS&&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",KS),this.reset({domain:VS.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 dl(sy(),e),this}onConnectStatusChanged(e){M.debug("converse-register: onConnectStatusChanged"),[VS.Status.DISCONNECTED,VS.Status.CONNFAIL,VS.Status.REGIFAIL,VS.Status.NOTACCEPTABLE,VS.Status.CONFLICT].includes(e)?(M.error(`Problem during registration: Strophe.Status is ${wa.CONNECTION_STATUS[e]}`),this.abortRegistration()):e===VS.Status.REGISTERED&&(M.debug("Registered successfully."),wa.connection.re
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="add-chatroom-modal-label">${n}</h5>
2021-12-23 22:20:17 +01:00
${dp}
</div>
<div class="modal-body">
<span class="modal-alert"></span>
<form class="converse-form add-chatroom">
<div class="form-group">
<label for="chatroom">${e.label_room_address}:</label>
2021-12-23 22:20:17 +01:00
${e.muc_roomid_policy_error_msg?ol`<label class="roomid-policy-error">${e.muc_roomid_policy_error_msg}</label>`:""}
<input type="text" required="required" name="chatroom" class="form-control roomjid-input" placeholder="${e.chatroom_placeholder}"/>
</div>
2021-12-23 22:20:17 +01:00
${e.muc_roomid_policy_hint?ol`<div class="form-group">${gy(Oo().sanitize(e.muc_roomid_policy_hint,{ALLOWED_TAGS:["b","br","em"]}))}</div>`:""}
${Nl.settings.get("locked_muc_nickname")?"":(e=>{const t=Ah("Nickname"),n=Ah("This field is required");return ol`
<div class="form-group" >
<label for="nickname">${t}:</label>
<input type="text" title="${n}" required="required" name="nickname" value="${e.nick||""}" class="form-control"/>
</div>
`})(e)}
<input type="submit" class="btn btn-primary" name="join" value="${t||""}" ?disabled=${e.muc_roomid_policy_error_msg}>
</form>
</div>
</div>
</div>
2021-12-23 22:20:17 +01:00
`})(Object.assign(this.model.toJSON(),{_converse:wa,label_room_address:Nl.settings.get("muc_domain")?Ah("Groupchat name"):Ah("Groupchat address"),chatroom_placeholder:e,muc_roomid_policy_error_msg:this.muc_roomid_policy_error_msg,muc_roomid_policy_hint:Nl.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(Nl.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),Nl.settings.get("locked_muc_domain")||Nl.settings.get("muc_domain")&&!sx.isValidJID(t.jid)?n=`${ix.escapeNode(t.jid)}@${Nl.settings.get("muc_domain")}`:(n=t.jid,this.model.setDomain(n)),Nl.rooms.open(n,Object.assign(t,{jid:n}),!0),this.modal.hide(),e.target.reset()},checkRoomidPolicy(){if(Nl.settings.get("muc_roomid_policy")&&Nl.settings.get("muc_domain")){let e=this.el.querySelector(".roomjid-input").value;!Nl.settings.get("locked_muc_domain")&&sx.isValidJID(e)||(e=`${ix.escapeNode(e)}@${Nl.settings.get("muc_domain")}`);const t=ix.getNodeFromJid(e),n=ix.getDomainFromJid(e);Nl.settings.get("muc_domain")!==n||Nl.settings.get("muc_roomid_policy").test(t)?this.muc_roomid_policy_error_msg=null:this.muc_roomid_policy_error_msg=Ah("Groupchat id is invalid."),this.render()}}}),ox=function(e){return e&&e.length?e[0]:void 0},{Strophe:ax,$iq:cx,sizzle:lx}=Il.env,dx=Il.env.utils;const ux=cp.extend({id:"muc-list-modal",persistent:!0,initialize(){this.items=[],this.loading_items=!1,cp.prototype.initialize.apply(this,arguments),Nl.settings.get("muc_domain")&&!this.model.get("muc_domain")&&this.model.save("muc_domain",Nl.settings.get("muc_domain")),this.listenTo(this.model,"change:muc_domain",this.onDomainChange),this.el.addEventListener("shown.bs.modal",(()=>Nl.settings.get("locked_muc_domain")?this.updateRoomsList():this.el.querySelector('input[name="server"]').focus()))},toHTML(){const e=this.model.get("muc_domain")||Nl.settings.get("muc_domain");return(e=>{const t=Ah("Query for Groupchats");return ol`
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="muc-list-modal-label">${t}</h5>
2021-12-23 22:20:17 +01:00
${dp}
</div>
<div class="modal-body d-flex flex-column">
<span class="modal-alert"></span>
2021-12-23 22:20:17 +01:00
${e.show_form?(e=>{const t=Ah("Show groupchats"),n=Ah("Server address");return ol`
<form class="converse-form list-chatrooms"
@submit=${e.submitForm}>
<div class="form-group">
<label for="chatroom">${n}:</label>
<input type="text"
@change=${e.setDomainFromEvent}
value="${e.muc_domain||""}"
required="required"
name="server"
class="form-control"
placeholder="${e.server_placeholder}"/>
</div>
<input type="submit" class="btn btn-primary" name="list" value="${t}"/>
</form>
`})(e):""}
<ul class="available-chatrooms list-group">
2021-12-23 22:20:17 +01:00
${e.loading_items?ol`<li class="list-group-item"> ${sy()} </li>`:""}
${e.feedback_text?ol`<li class="list-group-item active">${e.feedback_text}</li>`:""}
${Vg(e.items,(e=>e.jid),(t=>((e,t)=>{const n=Ah("Show more information on this groupchat"),s=Ah("Click to open this groupchat");return ol`
<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>
</div>
</li>
`})(e,t)))}
</ul>
</div>
2021-12-23 22:20:17 +01:00
<div class="modal-footer">${lp}</div>
</div>
</div>
2021-12-23 22:20:17 +01:00
`})(Object.assign(this.model.toJSON(),{show_form:!Nl.settings.get("locked_muc_domain"),server_placeholder:e||Ah("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(),Nl.rooms.open(t,{name:n},!0)},toggleRoomInfo(e){e.preventDefault(),function(e){const t=dx.ancestor(e.target,".room-item"),n=t.querySelector("div.room-info");n?(dx.slideIn(n).then(dx.removeElement),t.querySelector("a.room-info").classList.remove("selected")):(t.insertAdjacentElement("beforeend",dx.getElementFromTemplateResult(sy())),Nl.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",dx.getElementFromTemplateResult((e=>{const t=Ah("Description:"),n=Ah("Groupchat XMPP Address:"),s=Ah("Participants:"),i=Ah("Features:"),r=Ah("Requires authentication"),o=Ah("Hidden"),a=Ah("Requires an invitation"),c=Ah("Moderated"),l=Ah("Non-anonymous"),d=Ah("Open"),u=Ah("Permanent"),h=Ah("Public"),f=Ah("Semi-anonymous"),m=Ah("Temporary"),g=Ah("Unmoderated");return ol`
<div class="room-info">
<p class="room-info"><strong>${n}</strong> ${e.jid}</p>
<p class="room-info"><strong>${t}</strong> ${e.desc}</p>
<p class="room-info"><strong>${s}</strong> ${e.occ}</p>
<p class="room-info"><strong>${i}</strong>
<ul>
2021-12-23 22:20:17 +01:00
${e.passwordprotected?ol`<li class="room-info locked">${r}</li>`:""}
${e.hidden?ol`<li class="room-info">${o}</li>`:""}
${e.membersonly?ol`<li class="room-info">${a}</li>`:""}
${e.moderated?ol`<li class="room-info">${c}</li>`:""}
${e.nonanonymous?ol`<li class="room-info">${l}</li>`:""}
${e.open?ol`<li class="room-info">${d}</li>`:""}
${e.persistent?ol`<li class="room-info">${u}</li>`:""}
${e.publicroom?ol`<li class="room-info">${h}</li>`:""}
${e.semianonymous?ol`<li class="room-info">${f}</li>`:""}
${e.temporary?ol`<li class="room-info">${m}</li>`:""}
${e.unmoderated?ol`<li class="room-info">${g}</li>`:""}
</ul>
</p>
</div>
2021-12-23 22:20:17 +01:00
`})({jid:t.getAttribute("from"),desc:null===(n=ox(lx('field[var="muc#roominfo_description"] value',t)))||void 0===n?void 0:n.textContent,occ:null===(s=ox(lx('field[var="muc#roominfo_occupants"] value',t)))||void 0===s?void 0:s.textContent,hidden:lx('feature[var="muc_hidden"]',t).length,membersonly:lx('feature[var="muc_membersonly"]',t).length,moderated:lx('feature[var="muc_moderated"]',t).length,nonanonymous:lx('feature[var="muc_nonanonymous"]',t).length,open:lx('feature[var="muc_open"]',t).length,passwordprotected:lx('feature[var="muc_passwordprotected"]',t).length,persistent:lx('feature[var="muc_persistent"]',t).length,publicroom:lx('feature[var="muc_publicroom"]',t).length,semianonymous:lx('feature[var="muc_semianonymous"]',t).length,temporary:lx('feature[var="muc_temporary"]',t).length,unmoderated:lx('feature[var="muc_unmoderated"]',t).length})))}(t,e))).catch((e=>M.error(e))))}(e)},onDomainChange(){Nl.settings.get("auto_list_rooms")&&this.updateRoomsList()},onRoomsFound(e){this.loading_items=!1;const t=e?lx("query item",e):[];return t.length?(this.model.set({feedback_text:Ah("Groupchats found")},{silent:!0}),this.items=t.map(gd)):(this.items=[],this.model.set({feedback_text:Ah("No groupchats found")},{silent:!0})),this.render(),!0},updateRoomsList(){const e=cx({to:this.model.get("muc_domain"),from:wa.connection.jid,type:"get"}).c("query",{xmlns:ax.NS.DISCO_ITEMS});Nl.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:hx,u:fx}=Il.env;Nl.elements.define("converse-rooms-list",class extends Og{initialize(){const e=`converse.roomspanel${wa.bare_jid}`;this.model=new nx({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){fx.isChatRoom(e)&&this.render()}renderIfRelevantChange(e){const t=["bookmarked","hidden","name","num_unread","num_unread_general","has_activity"],n=e.changed||{};fx.isChatRoom(e)&&Object.keys(n).filter((e=>t.includes(e))).length&&this.render()}render(){dl((e=>{const t=Ah("Click to toggle the list of open groupchats"),n=Ah("Groupchats"),s=Ah("Query for groupchats"),i=Ah("Add a new groupchat");return ol`
<div class="d-flex controlbox-padded">
<span class="w-100 controlbox-heading controlbox-heading--groupchats">${n}</span>
<a class="controlbox-heading__btn show-list-muc-modal"
2021-12-23 22:20:17 +01:00
@click=${t=>Nl.modal.show(ux,{model:e.model},t)}
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"></converse-icon>
</a>
<a class="controlbox-heading__btn show-add-muc-modal"
2021-12-23 22:20:17 +01:00
@click=${t=>Nl.modal.show(rx,{model:e.model},t)}
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"></converse-icon>
</a>
</div>
<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}>
2021-12-23 22:20:17 +01:00
<span class="fa ${e.toggle_state===wa.OPENED?"fa-caret-down":"fa-caret-right"}"></span> ${Ah("Open Groupchats")}</a>
<div class="items-list rooms-list open-rooms-list ${e.collapsed&&"collapsed"}">
2021-12-23 22:20:17 +01:00
${e.rooms.map((t=>(e=>{const t=Ah("Leave this groupchat"),n=e.room.get("num_unread_general")||e.room.get("has_activity");return ol`
<div class="list-item controlbox-padded available-chatroom d-flex flex-row ${e.currently_open(e.room)?"open":""} ${n?"unread-msgs":""}"
data-room-jid="${e.room.get("jid")}">
2021-12-23 22:20:17 +01:00
${e.room.get("num_unread")?(e=>ol`<span class="list-item-badge badge badge--muc msgs-indicator">${e.room.get("num_unread")}</span>`)(e):e.room.get("has_activity")?ol`<span class="list-item-badge badge badge--muc msgs-indicator"></span>`:""}
<a class="list-item-link open-room available-room w-100"
data-room-jid="${e.room.get("jid")}"
2021-12-23 22:20:17 +01:00
title="${Ah("Click to open this groupchat")}"
@click=${e.openRoom}>${e.room.getDisplayName()}</a>
2021-12-23 22:20:17 +01:00
${Nl.settings.get("allow_bookmarks")?(e=>{const t=Ah("Bookmark this groupchat"),n=Ah("Unbookmark this groupchat");return e.bookmarked?ol`
<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}
2021-12-23 22:20:17 +01:00
title="${e.bookmarked?n:t}"></a>`:ol`
<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"
data-room-jid="${e.room.get("jid")}"
2021-12-23 22:20:17 +01:00
title="${Ah("Show more information on this groupchat")}"
@click=${e.showRoomDetailsModal}></a>
<a class="list-item-action fa fa-sign-out-alt close-room"
data-room-jid="${e.room.get("jid")}"
data-room-name="${e.room.getDisplayName()}"
title="${t}"
@click=${e.closeRoom}></a>
</div>`})(Object.assign({room:t},e))))}
</div>
2021-12-23 22:20:17 +01:00
</div>`})({addBookmark:e=>this.addBookmark(e),allow_bookmarks:Nl.settings.get("allow_bookmarks")&&wa.bookmarks,closeRoom:e=>this.closeRoom(e),collapsed:this.model.get("toggle-state")!==wa.OPENED,currently_open:e=>sa()&&!e.get("hidden"),model:this.model,openRoom:e=>this.openRoom(e),removeBookmark:e=>this.removeBookmark(e),rooms:wa.chatboxes.filter((e=>e.get("type")===wa.CHATROOMS_TYPE)),showRoomDetailsModal:e=>this.showRoomDetailsModal(e),toggleRoomsList:e=>this.toggleRoomsList(e),toggle_state:this.model.get("toggle-state")}),this)}showRoomDetailsModal(e){const t=e.target.getAttribute("data-room-jid"),n=wa.chatboxes.get(t);e.preventDefault(),Nl.modal.show(W_,{model:n},e)}async openRoom(e){e.preventDefault();const t=e.target.textContent,n=e.target.getAttribute("data-room-jid"),s={name:t||hx.unescapeNode(hx.getNodeFromJid(n))||n};await Nl.rooms.open(n,s,!0)}async closeRoom(e){e.preventDefault();const t=e.target.getAttribute("data-room-name");if(confirm(Ah("Are you sure you want to leave the groupchat %1$s?",t))){const t=e.target.getAttribute("data-room-jid");(await Nl.rooms.get(t)).close()}}removeBookmark(e){wa.removeBookmarkViaEvent(e)}addBookmark(e){wa.addBookmarkViaEvent(e)}toggleRoomsList(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");n.classList.contains("fa-caret-down")?fx.slideIn(this.querySelector(".open-rooms-list")).then((()=>{this.model.save({"toggle-state":wa.CLOSED}),n.classList.remove("fa-caret-down"),n.classList.add("fa-caret-right")})):fx.slideOut(this.querySelector(".open-rooms-list")).then((()=>{this.model.save({"toggle-state":wa.OPENED}),n.classList.remove("fa-caret-right"),n.classList.add("fa-caret-down")}))}}),Il.plugins.add("converse-roomslist",{dependencies:["converse-singleton","converse-controlbox","converse-muc","converse-bookmarks"],initialize(){Nl.listen.on("connected",(async()=>{Nl.settings.get("allow_bookmarks")?await Nl.waitUntil("bookmarksInitialized"):await Promise.all([Nl.waitUntil("chatBoxesFetched")])}))}}),window.customElements.define("converse-fontawesome",class extends rg{render(){return ol`
<?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"></path>
</symbol>
<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"></path>
</symbol>
<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"></path>
</symbol>
<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"></path>
</symbol>
<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"></path>
</symbol>
<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"></path>
</symbol>
<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"></path>
</symbol>
<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"></path>
</symbol>
<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"></path>
</symbol>
<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"></path>
</symbol>
<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"></path>
</symbol>
<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"></path>
</symbol>
<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"></path>
</symbol>
<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"></path>
</symbol>
<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"></path>
</symbol>
<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"></path>
</symbol>
<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"></path>
</symbol>
<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"></path>
</symbol>
<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"></path>
</symbol>
<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"></path>
</symbol>
<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"></path>
</symbol>
<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"></path>
</symbol>
<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"></path>
</symbol>
<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"></path>
</symbol>
<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"></path>
</symbol>
<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"></path>
</symbol>
<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"></path>
</symbol>
<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"></path>
</symbol>
<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"></path>
</symbol>
<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"></path>
</symbol>
<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"></path>
</symbol>
<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"></path>
</symbol>
<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"></path>
</symbol>
<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"></path>
</symbol>
<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"></path>
</symbol>
<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"></path>
</symbol>
<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"></path>
</symbol>
<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"></path>
</symbol>
<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"></path>
</symbol>
<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"></path>
</symbol>
<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"></path>
</symbol>
<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"></path>
</symbol>
<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"></path>
</symbol>
<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"></path>
</symbol>
<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"></path>
</symbol>
<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"></path>
</symbol>
<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"></path>
</symbol>
<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"></path>
</symbol>
<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"></path>
</symbol>
<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"></path>
</symbol>
<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"></path>
</symbol>
<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"></path>
</symbol>
<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"></path>
</symbol>
<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"></path>
</symbol>
<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"></path>
</symbol>
<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"></path>
</symbol>
<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"></path>
</symbol>
<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"></path>
</symbol>
<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"></path>
</symbol>
<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"></path>
</symbol>
<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"></path>
</symbol>
<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"></path>
</symbol>
<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"></path>
</symbol>
<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"></path>
</symbol>
<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"></path>
</symbol>
<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"></path>
</symbol>
<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"></path>
</symbol>
<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"></path>
</symbol>
<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"></path>
</symbol>
<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"></path>
</symbol>
<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"></path>
</symbol>
</svg>
2021-12-23 22:20:17 +01:00
`}});var mx=n(1513),gx={};gx.styleTagTransform=yg(),gx.setAttributes=mg(),gx.insert=hg().bind(null,"head"),gx.domAPI=dg(),gx.insertStyleElement=pg(),cg()(mx.Z,gx),mx.Z&&mx.Z.locals&&mx.Z.locals;class px extends rg{render(){return(()=>{const e=Nl.settings.get("singleton")?["converse-singleton"]:[];return e.push(`converse-${Nl.settings.get("view_mode")}`),ol`
<converse-chats class="converse-chatboxes row no-gutters ${e.join(" ")}"></converse-chats>
<div id="converse-modals" class="modals"></div>
<converse-fontawesome></converse-fontawesome>
2021-12-23 22:20:17 +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-${Nl.settings.get("view_mode")}`),this.classList.add(`theme-${Nl.settings.get("theme")}`),this.requestUpdate()}}function vx(){if(!Nl.settings.get("auto_insert"))return;const e=Nl.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)}}Il.plugins.add("converse-rootview",{initialize(){Nl.settings.extend({auto_insert:!0}),Nl.listen.on("chatBoxesInitialized",vx),Nl.elements.define("converse-root",px)}});const{Strophe:yx}=Il.env,bx=Il.env.utils,_x=cp.extend({id:"add-contact-modal",events:{"submit form":"addContactFromForm"},initialize(){cp.prototype.initialize.apply(this,arguments),this.listenTo(this.model,"change",this.render)},toHTML(){const e=Nl.settings.get("xhr_user_search_url")?Ah("Contact name"):Ah("Optional nickname");return(e=>{const t=Ah("name@example.org"),n=Ah("Add"),s=Ah("Please enter a valid XMPP address"),i=Ah("Add a Contact"),r=Ah("XMPP Address"),o=Ah("Nickname");return ol`
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="addContactModalLabel">${i}</h5>
2021-12-23 22:20:17 +01:00
${dp}
</div>
<form class="converse-form add-xmpp-contact">
<div class="modal-body">
<span class="modal-alert"></span>
<div class="form-group add-xmpp-contact__jid">
<label class="clearfix" for="jid">${r}:</label>
<div class="suggestion-box suggestion-box__jid">
<ul class="suggestion-box__results suggestion-box__results--above" hidden=""></ul>
2021-12-23 22:20:17 +01:00
<input type="text" name="jid" ?required=${!Nl.settings.get("xhr_user_search_url")}
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"></span>
</div>
</div>
<div class="form-group add-xmpp-contact__name">
<label class="clearfix" for="name">${o}:</label>
<div class="suggestion-box suggestion-box__name">
<ul class="suggestion-box__results suggestion-box__results--above" hidden=""></ul>
<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"></span>
</div>
</div>
<div class="form-group">
<div class="invalid-feedback">${s}</div>
</div>
<button type="submit" class="btn btn-primary">${n}</button>
</div>
</form>
</div>
</div>
2021-12-23 22:20:17 +01:00
`})(Object.assign(this.model.toJSON(),{_converse:wa,label_nickname:e}))},afterRender(){"string"==typeof Nl.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(!Nl.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=>yx.getDomainFromJid(e.get("jid")))))]})},initXHRAutoComplete(){if(!Nl.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",`${Nl.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=Ah("Sorry, could not find a contact with that name"),void bx.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?(bx.addClass("is-invalid",this.el.querySelector('input[name="jid"]')),bx.addClass("d-block",t),!1):wa.roster.get(yx.getBareJidFromJid(e))?(t.textContent=Ah("This contact has already been added"),bx.addClass("d-block",t),!1):(bx.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 Nl.settings.get("xhr_user_search_url")){const e=this.el.querySelector('input[name="name"]');return this.xhr.open("GET",`${Nl.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 wx(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 Sx(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 xx(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=_x;const{u:Ex}=Il.env;function Ax(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"):(
<li class="list-item d-flex controlbox-padded ${n.join(" ")}" data-status="${e.presence.get("show")}">
<converse-roster-contact .model=${e}></converse-roster-contact>
2021-12-23 22:20:17 +01:00
</li>`}const Cx=e=>{const t=Ah("Contacts"),n=Ah("Add a contact"),s=Ah("Re-sync your contacts"),i=(wa.roster||[]).reduce(((e,t)=>function(e,t){if("subscribe"===t.get("ask")){const n=wa.HEADER_PENDING_CONTACTS;e[n]?e[n].push(t):e[n]=[t]}else if(t.get("requesting")){const n=wa.HEADER_REQUESTING_CONTACTS;e[n]?e[n].push(t):e[n]=[t]}else{let n;Nl.settings.get("roster_groups")?(n=t.get("groups"),n=0===n.length?[wa.HEADER_UNGROUPED]:n):n=[wa.HEADER_CURRENT_CONTACTS];for(const s of n)e[s]?e[s].push(t):e[s]=[t]}if(t.get("num_unread")){const n=wa.HEADER_UNREAD;e[n]?e[n].push(t):e[n]=[t]}return e}(e,t)),{}),r=Object.keys(i).filter(xx);return r.sort(dm),ol`
<div class="d-flex controlbox-padded">
<span class="w-100 controlbox-heading controlbox-heading--contacts">${t}</span>
<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"></converse-icon>
</a>
2021-12-23 22:20:17 +01:00
${Nl.settings.get("allow_contact_requests")?ol`
<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"></converse-icon>
</a>`:""}
</div>
<converse-roster-filter></converse-roster-filter>
<div class="list-container roster-contacts">
2021-12-23 22:20:17 +01:00
${Vg(r,(e=>e),(e=>{const t=i[e].filter((t=>function(e,t){const n=e.presence.get("show");return Nl.settings.get("hide_offline_users")&&"offline"===n?("subscribe"===e.get("ask")||"from"===e.get("subscription")||!0===e.get("requesting"))&&!Sx(e,t):!Sx(e,t)}(t,e)));return t.sort(lm),t.length?(e=>{const t=Ah("Click to hide these contacts"),n=wa.roster.state.get("collapsed_groups");return ol`
<div class="roster-group" data-group="${e.name}">
<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)}>
<converse-icon color="var(--chat-head-color)" size="1em" class="fa ${n.includes(e.name)?"fa-caret-right":"fa-caret-down"}"></converse-icon> ${e.name}
</a>
<ul class="items-list roster-group-contacts ${n.includes(e.name)?"collapsed":""}" data-group="${e.name}">
2021-12-23 22:20:17 +01:00
${e.contacts.map(Ax)}
</ul>
</div>`})({contacts:t,name:e}):""}))}
</div>
2021-12-23 22:20:17 +01:00
`};Nl.elements.define("converse-roster",class extends rg{async initialize(){await Nl.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),Nl.trigger("rosterViewInitialized")}firstUpdated(){this.listenToRosterFilter()}render(){return Cx(this)}listenToRosterFilter(){this.filter_view=this.querySelector("converse-roster-filter"),this.filter_view.addEventListener("update",(()=>this.requestUpdate()))}showAddContactModal(e){Nl.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(),Nl.user.presence.send(),this.syncing_contacts=!1,this.requestUpdate()}});const Tx=e=>ol`<span class="pending-contact-name" title="JID: ${e.jid}">${e.display_name}</span>`,kx=e=>ol`<span class="req-contact-name w-100" title="JID: ${e.jid}">${e.display_name}</span>`,jx={dnd:Ah("This contact is busy"),online:Ah("This contact is online"),offline:Ah("This contact is offline"),unavailable:Ah("This contact is unavailable"),xa:Ah("This contact is away for an extended period"),away:Ah("This contact is away")},Nx=Il.env.utils;class Ox extends rg{static get properties(){return{model:{type:Object}}}connectedCallback(){super.connectedCallback(),this.listenTo(this.model,"change",this.requestUpdate),this.listenTo(this.model,"highlight",this.requestUpdate),this.listenTo(this.model,"vcard:change",this.requestUpdate)}render(){const e=this.model.get("ask"),t=this.model.get("requesting"),n=this.model.get("subscription"),s=this.model.get("jid");if("subscribe"===e||"from"===n){const e=this.model.getDisplayName();return(e=>{const t=Ah("Click to remove %1$s as a contact",e.display_name);return ol`
${Nl.settings.get("allow_chat_pending_contacts")?ol`<a class="list-item-link open-chat w-100" href="#" @click=${e.openChat}>${Tx(e)}</a>`:Tx(e)}
<a class="list-item-action remove-xmpp-contact far fa-trash-alt" @click=${e.removeContact} title="${t}" href="#"></a>`})(Object.assign(this.model.toJSON(),{display_name:e,openChat:e=>this.openChat(e),removeContact:e=>this.removeContact(e)}))}if(!0===t){const e=this.model.getDisplayName();return(e=>ol`
${Nl.settings.get("allow_chat_pending_contacts")?ol`<a class="open-chat w-100" href="#" @click=${e.openChat}>${kx(e)}</a>`:kx(e)}
<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}
2021-12-23 22:20:17 +01:00
aria-label="${e.desc_decline}" title="${e.desc_decline}" href="#"></a>`)(Object.assign(this.model.toJSON(),{display_name:e,openChat:e=>this.openChat(e),acceptRequest:e=>this.acceptRequest(e),declineRequest:e=>this.declineRequest(e),desc_accept:Ah("Click to accept the contact request from %1$s",e),desc_decline:Ah("Click to decline the contact request from %1$s",e),allow_chat_pending_contacts:Nl.settings.get("allow_chat_pending_contacts")}))}if("both"===n||"to"===n||Nx.isSameBareJID(s,wa.connection.jid))return this.renderRosterItem(this.model)}renderRosterItem(e){return((e,t)=>{var n,s;const i=t.presence.get("show")||"offline";let r,o;[r,o]="online"===i?["fa fa-circle","chat-status-online"]:"dnd"===i?["fa fa-minus-circle","chat-status-busy"]:"away"===i?["fa fa-circle","chat-status-away"]:["fa fa-circle","subdued-color"];const a=t.getDisplayName(),c=jx[i],l=t.get("num_unread")||0,d=Ah("Click to chat with %1$s (XMPP address: %2$s)",a,e.model.get("jid")),u=Ah("Click to remove %1$s as a contact",a);return ol`
<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"></converse-avatar>
<converse-icon
title="${c}"
color="var(--${o})"
size="1em"
class="${r} chat-status chat-status--avatar"></converse-icon>
</span>
${l?ol`<span class="msgs-indicator">${l}</span>`:""}
<span class="contact-name contact-name--${e.show} ${l?"unread-msgs":""}">${a}</span>
</a>
2021-12-23 22:20:17 +01:00
${Nl.settings.get("allow_contact_removal")?ol`<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),Nl.settings.get("allow_contact_removal")&&confirm(Ah("Are you sure you want to remove this contact?")))try{this.model.removeFromRoster(),this.model.collection&&this.model.destroy()}catch(e){M.error(e),Nl.alert("error",Ah("Error"),[Ah("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(Ah("Are you sure you want to decline this contact request?"))&&this.model.unauthorize().destroy(),this}}Nl.elements.define("converse-roster-contact",Ox);const $x=Xo.extend({initialize(){this.set({filter_text:"",filter_type:"contacts",chat_state:"online"})}});class Ix extends rg{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=Ah("Filter"),n=Ah("Filter by contact name"),s=Ah("Filter by group name"),i=Ah("Filter by status"),r=Ah("Any"),o=Ah("Unread"),a=Ah("Online"),c=Ah("Chatty"),l=Ah("Busy"),d=Ah("Away"),u=Ah("Extended Away"),h=Ah("Offline");return ol`
<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}"></span>
<span @click=${e.changeTypeFilter} class="fa fa-users ${"groups"===e.filter_type?"selected":""}" data-type="groups" title="${s}"></span>
<span @click=${e.changeTypeFilter} class="fa fa-circle ${"state"===e.filter_type?"selected":""}" data-type="state" title="${i}"></span>
</div>
<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}>
</span>
</div>
<select class="form-control state-type ${"state"!==e.filter_type?"hidden":""}"
@change=${e.changeChatStateFilter}>
<option value="">${r}</option>
<option ?selected=${"unread_messages"===e.chat_state} value="unread_messages">${o}</option>
<option ?selected=${"online"===e.chat_state} value="online">${a}</option>
<option ?selected=${"chat"===e.chat_state} value="chat">${c}</option>
<option ?selected=${"dnd"===e.chat_state} value="dnd">${l}</option>
<option ?selected=${"away"===e.chat_state} value="away">${d}</option>
<option ?selected=${"xa"===e.chat_state} value="xa">${u}</option>
<option ?selected=${"offline"===e.chat_state} value="offline">${h}</option>
</select>
</div>
2021-12-23 22:20:17 +01:00
</form>`})(Object.assign(this.model.toJSON(),{visible:this.shouldBeVisible(),changeChatStateFilter:e=>this.changeChatStateFilter(e),changeTypeFilter:e=>this.changeTypeFilter(e),clearFilter:e=>this.clearFilter(e),liveFilter:e=>this.liveFilter(e),submitFilter:e=>this.submitFilter(e)}))}dispatchUpdateEvent(){this.dispatchEvent(new CustomEvent("update",{detail:this.model.changed}))}changeChatStateFilter(e){e&&e.preventDefault(),this.model.save({chat_state:this.querySelector(".state-type").value})}changeTypeFilter(e){e&&e.preventDefault();const t=e.target.dataset.type;"state"===t?this.model.save({filter_type:t,chat_state:this.querySelector(".state-type").value}):this.model.save({filter_type:t,filter_text:this.querySelector(".roster-filter").value})}submitFilter(e){e&&e.preventDefault(),this.liveFilter()}isActive(){return"state"===this.model.get("filter_type")||this.model.get("filter_text")}shouldBeVisible(){var e;return(null===(e=wa.roster)||void 0===e?void 0:e.length)>=5||this.isActive()}clearFilter(e){e&&e.preventDefault(),this.model.save({filter_text:""})}}Nl.elements.define("converse-roster-filter",Ix);var Mx=n(1984),Rx={};Rx.styleTagTransform=yg(),Rx.setAttributes=mg(),Rx.insert=hg().bind(null,"head"),Rx.domAPI=dg(),Rx.insertStyleElement=pg(),cg()(Mx.Z,Rx),Mx.Z&&Mx.Z.locals&&Mx.Z.locals,Il.plugins.add("converse-rosterview",{dependencies:["converse-roster","converse-modal","converse-chatboxviews"],initialize(){Nl.settings.extend({autocomplete_add_contact:!0,allow_chat_pending_contacts:!0,allow_contact_removal:!0,hide_offline_users:!1,roster_groups:!0,xhr_user_search_url:null}),Nl.promises.add("rosterViewInitialized"),wa.RosterFilter=$x,wa.RosterFilterView=Ix,wa.RosterContactView=Ox,Nl.listen.on("chatBoxesInitialized",(()=>{wa.chatboxes.on("destroy",(e=>wx(e))),wa.chatboxes.on("change:hidden",(e=>wx(e)))})),Nl.listen.on("afterTearDown",(()=>{var e;return null===(e=wa.rotergroups)||void 0===e?void 0:e.off().reset()}))}}),wa.CustomElement=rg;const Dx=Il.initialize;Il.initialize=function(e,t){return Array.isArray(e.whitelisted_plugins)?e.whitelisted_plugins=e.whitelisted_plugins.concat(og):e.whitelisted_plugins=og,Dx(e,t)};const Lx=Il},2242:(e,t,n)=>{e.exports={default:n(3391),__esModule:!0}},8902:(e,t,n)=>{e.exports={default:n(8613),__esModule:!0}},6593:(e,t,n)=>{e.exports={default:n(112),__esModule:!0}},6803:(e,t,n)=>{"use strict";t.__esModule=!0;var s,i=(s=n(6593))&&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")}))}}},8106:(e,t,n)=>{"use strict";t.__esModule=!0;var s,i=(s=n(2242))&&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}},2548:(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(8544),i)s.regeneratorRuntime=r;else try{delete s.regeneratorRuntime}catch(e){s.regeneratorRuntime=void 0}},8544: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.setProtot
2020-12-01 06:40:41 +01:00
//# sourceMappingURL=converse.min.js.map