*/!function(s,a){"use strict";e.exports?e.exports=a(n(155),n(156),n(157)):(i=[n(155),n(156),n(157)],void 0===(o="function"==typeof(r=a)?r.apply(t,i):r)||(e.exports=o))}(0,(function(e,t,n,r){"use strict";var i=r&&r.URI;function o(e,t){var n=arguments.length>=1,r=arguments.length>=2;if(!(this instanceof o))return n?r?new o(e,t):new o(e):new o;if(void 0===e){if(n)throw new TypeError("undefined is not a valid argument for URI");e="undefined"!=typeof location?location.href+"":""}if(null===e&&n)throw new TypeError("null is not a valid argument for URI");return this.href(e),void 0!==t?this.absoluteTo(t):this}o.version="1.19.2";var s=o.prototype,a=Object.prototype.hasOwnProperty;function c(e){return e.replace(/([.*+?^=!:${}()|[\]\/\\])/g,"\\$1")}functionl(e){returnvoid0===e?"Undefined":String(Object.prototype.toString.call(e)).slice(8,-1)}functionu(e){return"Array"===l(e)}functiond(e,t){varn,r,i={};if("RegExp"===l(t))i=null;elseif(u(t))for(n=0,r=t.length;n<r;n++)i[t[n]]=!0;elsei[t]=!0;for(n=0,r=e.length;n<r;n++){(i&&void0!==i[e[n]]||!i&&t.test(e[n]))&&(e.splice(n,1),r--,n--)}returne}functionh(e,t){varn,r;if(u(t)){for(n=0,r=t.length;n<r;n++)if(!h(e,t[n]))return!1;return!0}vari=l(t);for(n=0,r=e.length;n<r;n++)if("RegExp"===i){if("string"==typeofe[n]&&e[n].match(t))return!0}elseif(e[n]===t)return!0;return!1}functionf(e,t){if(!u(e)||!u(t))return!1;if(e.length!==t.length)return!1;e.sort(),t.sort();for(varn=0,r=e.length;n<r;n++)if(e[n]!==t[n])return!1;return!0}functionp(e){returne.replace(/^\/+|\/+$/g,"")}functiong(e){returnescape(e)}functionm(e){returnencodeURIComponent(e).replace(/[!'()*]/g,g).replace(/\*/g,"%2A")}o._parts=function(){return{protocol:null,username:null,password:null,hostname:null,urn:null,port:null,path:null,query:null,fragment:null,preventInvalidHostname:o.preventInvalidHostname,duplicateQueryParameters:o.duplicateQueryParameters,escapeQuerySpace:o.escapeQuerySpace}},o.preventInvalidHostname=!1,o.duplicateQueryParameters=!1,o.escapeQuerySpace=!0,o.protocol_expression=/^[a-z][a-z0-9.+-]*$/i,o.idn_expression=/[^a-z0-9\._-]/i,o.punycode_expression=/(xn--)/i,o.ip4_expression=/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/,o.ip6_expression=/^\s*((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(%.+)?\s*$/,o.find_uri_expression=/\b((?:[a-z][\w-]+:(?:\/{1,3}|[a-z0-9%])|www\d{0,3}[.]|[a-z0-9.\-]+[.][a-z]{2,4}\/)(?:[^\s()<>]+|\(([^\s()<>]+|(\([^\s()<>]+\)))*\))+(?:\(([^\s()<>]+|(\([^\s()<>]+\)))*\)|[^\s`!()\[\]{};:'".,<>?«»“”‘’]))/gi,o.findUri={start:/\b(?:([a-z][a-z0-9.+-]*:\/\/)|www\.)/gi,end:/[\s\r\n]|$/,trim:/[`!()\[\]{};:'".,<>?«»“”„‘’]+$/,parens:/(\([^\)]*\)|\[[^\]]*\]|\{[^}]*\}|<[^>]*>)/g},o.defaultPorts={http:"80",https:"443",ftp:"21",gopher:"70",ws:"80",wss:"443"},o.hostProtocols=["http","https"],o.invalid_hostname_characters=/[^a-zA-Z0-9\.\-:_]/,o.domAttributes={a:"href",blockquote:"cite",link:"href",base:"href",script:"src",form:"action",img:"src",area:"href",iframe:"src",embed:"src",source:"src",track:"src",input:"src",audio:"src",video:"src"},o.getDomAttribute=function(e){if(e&&e
!function(n,r){vari=Array.prototype,o=Object.prototype,s=i.slice,a=o.hasOwnProperty,c=i.forEach,l={},u={forEach:function(e,t,n){varr,i,o;if(null!==e)if(c&&e.forEach===c)e.forEach(t,n);elseif(e.length===+e.length){for(r=0,i=e.length;r<i;r++)if(rine&&t.call(n,e[r],r,e)===l)return}elsefor(oine)if(a.call(e,o)&&t.call(n,e[o],o,e)===l)return},extend:function(e){returnthis.forEach(s.call(arguments,1),(function(t){for(varnint)e[n]=t[n]})),e}},d=function(e){if(this.defaults={locale_data:{messages:{"":{domain:"messages",lang:"en",plural_forms:"nplurals=2; plural=(n != 1);"}}},domain:"messages",debug:!1},this.options=u.extend({},this.defaults,e),this.textdomain(this.options.domain),e.domain&&!this.options.locale_data[this.options.domain])thrownewError("Text domain set to non-existent domain: `"+e.domain+"`")};functionh(e){returnd.PF.compile(e||"nplurals=2; plural=(n != 1);")}functionf(e,t){this._key=e,this._i18n=t}d.context_delimiter=String.fromCharCode(4),u.extend(f.prototype,{onDomain:function(e){returnthis._domain=e,this},withContext:function(e){returnthis._context=e,this},ifPlural:function(e,t){returnthis._val=e,this._pkey=t,this},fetch:function(e){return"[object Array]"!={}.toString.call(e)&&(e=[].slice.call(arguments,0)),(e&&e.length?d.sprintf:function(e){returne})(this._i18n.dcnpgettext(this._domain,this._context,this._key,this._pkey,this._val),e)}}),u.extend(d.prototype,{translate:function(e){returnnewf(e,this)},textdomain:function(e){if(!e)returnthis._textdomain;this._textdomain=e},gettext:function(e){returnthis.dcnpgettext.call(this,void0,void0,e)},dgettext:function(e,t){returnthis.dcnpgettext.call(this,e,void0,t)},dcgettext:function(e,t){returnthis.dcnpgettext.call(this,e,void0,t)},ngettext:function(e,t,n){returnthis.dcnpgettext.call(this,void0,void0,e,t,n)},dngettext:function(e,t,n,r){returnthis.dcnpgettext.call(this,e,void0,t,n,r)},dcngettext:function(e,t,n,r){returnthis.dcnpgettext.call(this,e,void0,t,n,r)},pgettext:function(e,t){returnthis.dcnpgettext.call(this,void0,e,t)},dpgettext:function(e,t,n){returnthis.dcnpgettext.call(this,e,t,n)},dcpgettext:function(e,t,n){returnthis.dcnpgettext.call(this,e,t,n)},npgettext:function(e,t,n,r){returnthis.dcnpgettext.call(this,void0,e,t,n,r)},dnpgettext:function(e,t,n,r,i){returnthis.dcnpgettext.call(this,e,t,n,r,i)},dcnpgettext:function(e,t,n,r,i){varo;if(r=r||n,e=e||this._textdomain,!this.options)return(o=newd).dcnpgettext.call(o,void0,void0,n,r,i);if(!this.options.locale_data)thrownewError("No locale data provided.");if(!this.options.locale_data[e])thrownewError("Domain `"+e+"` was not found.");if(!this.options.locale_data[e][""])thrownewError("No locale meta information provided.");if(!n)thrownewError("No translation key found.");vars,a,c,l=t?t+d.context_delimiter+n:n,u=this.options.locale_data,f=u[e],p=(u.messages||this.defaults.locale_data.messages)[""],g=f[""].plural_forms||f[""]["Plural-Forms"]||f[""]["plural-forms"]||p.plural_forms||p["Plural-Forms"]||p["plural-forms"];if(void0===i)c=0;else{if("number"!=typeofi&&(i=parseInt(i,10),isNaN(i)))thrownewError("The number that was passed in is not a number.");c=h(g)(i)}if(!f)thrownewError("No domain named `"+e+"` could be found.");return!(s=f[l])||c>s.length?(this.options.missing_key_callback&&this.options.missing_key_callback(l,e),a=[n,r],!0===this.options.debug&&console.log(a[h(g)(i)]),a[h()(i)]):(a=s[c])||(a=[n,r])[h()(i)]}});varp,g,m=function(){functione(e){returnObject.prototype.toString.call(e).slice(8,-1).toLowerCase()}functiont(e,t){for(varn=[];t>0;n[--t]=e);returnn.join("")}varn=functione(){returne.cache.hasOwnProperty(arguments[0])||(e.cache[arguments[0]]=e.parse(arguments[0])),e.format.call(null,e.cache[arguments[0]],arguments)};returnn.format=function(n,r){vari,o,s,a,c,l,u,d=1,h=n.length,f="",p=[];for(o=0;o<h;o++)if("string"===(f=e(n[o])))p.push(n[o]);elseif("array"===f){if((a=n[o])[2])for(i=r[d],s=0;s<a[2].length;s++){if(!i.hasOwnProperty(a[2][s]))throwm('[sprintf] property "%s" does not exist',a[2][s]);i=i[a[2][s]]}elsei=a[1]?r[a[1]]:r
*/Ho.getJIDFromURI=function(e){return e.startsWith("xmpp:")&&e.endsWith("?join")?e.replace(/^xmpp:/,"").replace(/\?join$/,""):e},Ho.toStanza=function(e){constt=Uo.parseFromString(e,"text/xml");if(t.getElementsByTagNameNS($o,"parsererror").length)thrownewError("Parser Error: ".concat(e));returnt.firstElementChild},Ho.getLongestSubstring=function(e,t){returnt.reduce((function(t,n){returne.startsWith(n)&&n.length>t.length?n:t}),"")},Ho.prefixMentions=function(e){lett=e.get("message");return(e.get("references")||[]).sort((e,t)=>t.begin-e.begin).forEach(e=>{t="".concat(t.slice(0,e.begin),"@").concat(t.slice(e.begin))}),t},Ho.isValidJID=function(e){return"string"==typeofe&&(2===Bo(e.split("@")).length&&!e.startsWith("@")&&!e.endsWith("@"))},Ho.isValidMUCJID=function(e){return!e.startsWith("@")&&!e.endsWith("@")},Ho.isSameBareJID=function(e,t){return"string"==typeofe&&"string"==typeoft&&qo.getBareJidFromJid(e).toLowerCase()===qo.getBareJidFromJid(t).toLowerCase()},Ho.isSameDomain=function(e,t){return"string"==typeofe&&"string"==typeoft&&qo.getDomainFromJid(e).toLowerCase()===qo.getDomainFromJid(t).toLowerCase()},Ho.isNewMessage=function(e){returneinstanceofElement?!(pr()('result[xmlns="'.concat(qo.NS.MAM,'"]'),e).length&&pr()('delay[xmlns="'.concat(qo.NS.DELAY,'"]'),e).length):(einstanceofFo&&(e=e.attributes),!(e.is_delayed&&e.is_archived))},Ho.shouldCreateMessage=function(e){returne.retracted||!Ho.isEmptyMessage(e)},Ho.shouldCreateGroupchatMessage=function(e){returne.nick&&(Ho.shouldCreateMessage(e)||e.is_tombstone)},Ho.isEmptyMessage=function(e){returneinstanceofFo&&(e=e.attributes),!(e.oob_url||e.file||e.is_encrypted&&e.plaintext||e.message)},Ho.isOnlyChatStateNotification=function(e){returneinstanceofElement?null===e.querySelector("body")&&(null!==e.querySelector("active")||null!==e.querySelector("composing")||null!==e.querySelector("inactive")||null!==e.querySelector("paused")||null!==e.querySelector("gone")):(einstanceofFo&&(e=e.attributes),e.chat_state&&Ho.isEmptyMessage(e))},Ho.isOnlyMessageDeliveryReceipt=function(e){returneinstanceofElement?null===e.querySelector("body")&&null!==e.querySelector("received"):(einstanceofFo&&(e=e.attributes),e.received&&Ho.isEmptyMessage(e))},Ho.isChatRoom=function(e){returne&&"chatroom"===e.get("type")},Ho.isErrorObject=function(e){returneinstanceofError},Ho.isErrorStanza=function(e){return!!Mn(e)&&"error"===e.getAttribute("type")},Ho.isForbiddenError=function(e){return!!Mn(e)&&pr()('error[type="auth"] forbidden[xmlns="'.concat(qo.NS.STANZAS,'"]'),e).length>0},Ho.isServiceUnavailableError=function(e){return!!Mn(e)&&pr()('error[type="cancel"] service-unavailable[xmlns="'.concat(qo.NS.STANZAS,'"]'),e).length>0},Ho.merge=functione(t,n){for(constrinn)N(t[r])?e(t[r],n[r]):t[r]=n[r]},Ho.getOuterWidth=function(e,t=!1){letn=e.offsetWidth;if(!t)returnn;constr=window.getComputedStyle(e);returnn+=parseInt(r.marginLeft?r.marginLeft:0,10)+parseInt(r.marginRight?r.marginRight:0,10),n},Ho.stringToElement=function(e){vart=document.createElement("div");returnt.innerHTML=e,t.firstElementChild},Ho.matchesSelector=function(e,t){constn=e.matches||e.matchesSelector||e.msMatchesSelector||e.mozMatchesSelector||e.webkitMatchesSelector||e.oMatchesSelector;return!!n&&n.call(e,t)},Ho.queryChildren=function(e,t){returnArray.from(e.childNodes).filter(e=>Ho.matchesSelector(e,t))},Ho.contains=function(e,t){constn=(e,n)=>e.get(n).toLowerCase().includes(t.toLowerCase());returnfunction(t){if("object"==typeofe)returnObject.keys(e).reduce((e,r)=>e||n(t,r),!1);if("string"==typeofe)returnn(t,e);thrownewTypeError("contains: wrong attribute type. Must be string or array.")}},Ho.isOfType=function(e,t){returnt.get("type")==e},Ho.isInstance=function(e,t){returntinstanceofe},Ho.getAttribute=function(e,t){returnt.get(e)},Ho.contains.not=function(e,t){returnfunction(n){return!Ho.contains(e,t)(n)}},Ho.rootContains=function(e,t){returne!==document||e.contains?e.contains?e.contains(t):window.HTMLElement.prototype.contains.call(e,t):document.head.contains(t)||document.body
constDa=e=>null===e||!("object"==typeofe||"function"==typeofe),Pa=e=>Array.isArray(e)||!(!e||!e[Symbol.iterator]);classLa{constructor(e,t,n){this.dirty=!0,this.element=e,this.name=t,this.strings=n,this.parts=[];for(lete=0;e<n.length-1;e++)this.parts[e]=this._createPart()}_createPart(){returnnewza(this)}_getValue(){conste=this.strings,t=e.length-1;letn="";for(letr=0;r<t;r++){n+=e[r];constt=this.parts[r];if(void0!==t){conste=t.value;if(Da(e)||!Pa(e))n+="string"==typeofe?e:String(e);elsefor(consttofe)n+="string"==typeoft?t:String(t)}}returnn+=e[t],n}commit(){this.dirty&&(this.dirty=!1,this.element.setAttribute(this.name,this._getValue()))}}classza{constructor(e){this.value=void0,this.committer=e}setValue(e){e===ka||Da(e)&&e===this.value||(this.value=e,Ta(e)||(this.committer.dirty=!0))}commit(){for(;Ta(this.value);){conste=this.value;this.value=ka,e(this)}this.value!==ka&&this.committer.commit()}}classFa{constructor(e){this.value=void0,this.__pendingValue=void0,this.options=e}appendInto(e){this.startNode=e.appendChild(Sa()),this.endNode=e.appendChild(Sa())}insertAfterNode(e){this.startNode=e,this.endNode=e.nextSibling}appendIntoPart(e){e.__insert(this.startNode=Sa()),e.__insert(this.endNode=Sa())}insertAfterPart(e){e.__insert(this.startNode=Sa()),this.endNode=e.endNode,e.endNode=this.startNode}setValue(e){this.__pendingValue=e}commit(){if(null===this.startNode.parentNode)return;for(;Ta(this.__pendingValue);){conste=this.__pendingValue;this.__pendingValue=ka,e(this)}conste=this.__pendingValue;e!==ka&&(Da(e)?e!==this.value&&this.__commitText(e):einstanceofRa?this.__commitTemplateResult(e):einstanceofNode?this.__commitNode(e):Pa(e)?this.__commitIterable(e):e===Na?(this.value=Na,this.clear()):this.__commitText(e))}__insert(e){this.endNode.parentNode.insertBefore(e,this.endNode)}__commitNode(e){this.value!==e&&(this.clear(),this.__insert(e),this.value=e)}__commitText(e){constt=this.startNode.nextSibling,n="string"==typeof(e=null==e?"":e)?e:String(e);t===this.endNode.previousSibling&&3===t.nodeType?t.data=n:this.__commitNode(document.createTextNode(n)),this.value=e}__commitTemplateResult(e){constt=this.options.templateFactory(e);if(this.valueinstanceofIa&&this.value.template===t)this.value.update(e.values);else{constn=newIa(t,e.processor,this.options),r=n._clone();n.update(e.values),this.__commitNode(r),this.value=n}}__commitIterable(e){Array.isArray(this.value)||(this.value=[],this.clear());constt=this.value;letn,r=0;for(constiofe)n=t[r],void0===n&&(n=newFa(this.options),t.push(n),0===r?n.appendIntoPart(this):n.insertAfterPart(t[r-1])),n.setValue(i),n.commit(),r++;r<t.length&&(t.length=r,this.clear(n&&n.endNode))}clear(e=this.startNode){ga(this.startNode.parentNode,e.nextSibling,this.endNode)}}classBa{constructor(e,t,n){if(this.value=void0,this.__pendingValue=void0,2!==n.length||""!==n[0]||""!==n[1])thrownewError("Boolean attributes can only contain a single expression");this.element=e,this.name=t,this.strings=n}setValue(e){this.__pendingValue=e}commit(){for(;Ta(this.__pendingValue);){conste=this.__pendingValue;this.__pendingValue=ka,e(this)}if(this.__pendingValue===ka)return;conste=!!this.__pendingValue;this.value!==e&&(e?this.element.setAttribute(this.name,""):this.element.removeAttribute(this.name),this.value=e),this.__pendingValue=ka}}classqaextendsLa{constructor(e,t,n){super(e,t,n),this.single=2===n.length&&""===n[0]&&""===n[1]}_createPart(){returnnewHa(this)}_getValue(){returnthis.single?this.parts[0].value:super._getValue()}commit(){this.dirty&&(this.dirty=!1,this.element[this.name]=this._getValue())}}classHaextendsza{}letUa=!1;(()=>{try{conste={getcapture(){returnUa=!0,!1}};window.addEventListener("test",e,e),window.removeEventListener("test",e,e)}catch(e){}})();class$a{constructor(e,t,n){this.value=void0,this.__pendingValue=void0,this.element=e,this.eventName=t,this.eventContext=n,this.__boundHandleEvent=e=>this.handleEvent(e)}setValue(e){this.__pendingValue=e}commit(){for(;Ta(this.__pendingValue);){conste=this.__pendingValue;this.__pendingValue=ka,e(t
constcc="adoptedStyleSheets"inDocument.prototype&&"replace"inCSSStyleSheet.prototype,lc=Symbol();classuc{constructor(e,t){if(t!==lc)thrownewError("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e}getstyleSheet(){returnvoid0===this._styleSheet&&(cc?(this._styleSheet=newCSSStyleSheet,this._styleSheet.replaceSync(this.cssText)):this._styleSheet=null),this._styleSheet}toString(){returnthis.cssText}}constdc=(e,...t)=>{constn=t.reduce((t,n,r)=>t+(e=>{if(einstanceofuc)returne.cssText;if("number"==typeofe)returne;thrownewError("Value passed to 'css' function must be a 'css' function result: ".concat(e,". Use 'unsafeCSS' to pass non-literal values, but\n take care to ensure page security."))})(n)+e[r+1],e[0]);returnnewuc(n,lc)};
(window.litElementVersions||(window.litElementVersions=[])).push("2.3.1");consthc={};classfcextendsac{staticgetStyles(){returnthis.styles}static_getUniqueStyles(){if(this.hasOwnProperty(JSCompiler_renameProperty("_styles",this)))return;conste=this.getStyles();if(void0===e)this._styles=[];elseif(Array.isArray(e)){constt=(e,n)=>e.reduceRight((e,n)=>Array.isArray(n)?t(n,e):(e.add(n),e),n),n=t(e,newSet),r=[];n.forEach(e=>r.unshift(e)),this._styles=r}elsethis._styles=[e]}initialize(){super.initialize(),this.constructor._getUniqueStyles(),this.renderRoot=this.createRenderRoot(),window.ShadowRoot&&this.renderRootinstanceofwindow.ShadowRoot&&this.adoptStyles()}createRenderRoot(){returnthis.attachShadow({mode:"open"})}adoptStyles(){conste=this.constructor._styles;0!==e.length&&(void0===window.ShadyCSS||window.ShadyCSS.nativeShadow?cc?this.renderRoot.adoptedStyleSheets=e.map(e=>e.styleSheet):this._needsShimAdoptedStyleSheets=!0:window.ShadyCSS.ScopingShim.prepareAdoptedCssText(e.map(e=>e.cssText),this.localName))}connectedCallback(){super.connectedCallback(),this.hasUpdated&&void0!==window.ShadyCSS&&window.ShadyCSS.styleElement(this)}update(e){constt=this.render();super.update(e),t!==hc&&this.constructor.render(t,this.renderRoot,{scopeName:this.localName,eventContext:this}),this._needsShimAdoptedStyleSheets&&(this._needsShimAdoptedStyleSheets=!1,this.constructor._styles.forEach(e=>{constt=document.createElement("style");t.textContent=e.cssText,this.renderRoot.appendChild(t)}))}render(){returnhc}}fc.finalized=!0,fc.render=(e,t,n)=>{if(!n||"object"!=typeofn||!n.scopeName)thrownewError("The `scopeName` option is required.");constr=n.scopeName,i=Ja.has(t),o=Za&&11===t.nodeType&&!!t.host,s=o&&!nc.has(r),a=s?document.createDocumentFragment():t;if(Xa(e,a,Object.assign({templateFactory:ec(r)},n)),s){conste=Ja.get(a);Ja.delete(a);constn=e.valueinstanceofIa?e.value.template:void0;rc(r,a,n),ga(t,t.firstChild),t.appendChild(a),Ja.set(t,e)}!i&&o&&window.ShadyCSS.styleElement(t.host)};classpcextendsfc{constructor(){super(),Object.assign(this,mi)}createRenderRoot(){returnthis}disconnectedCallback(){super.disconnectedCallback(),this.stopListening()}}constgc=function(){this.handlers=[],this.checkUrl=this.checkUrl.bind(this),"undefined"!=typeofwindow&&(this.location=window.location,this.history=window.history)};gc.extend=Xr;constmc=/^[#\/]|\s+$/g,vc=/^\/+|\/+$/g,_c=/#.*$/;gc.started=!1,Object.assign(gc.prototype,mi,{interval:50,atRoot:function(){returnthis.location.pathname.replace(/[^\/]$/,"$&/")===this.root&&!this.getSearch()},matchRoot:function(){returnthis.decodeFragment(this.location.pathname).slice(0,this.root.length-1)+"/"===this.root},decodeFragment:function(e){returndecodeURI(e.replace(/%25/g,"%2525"))},getSearch:function(){conste=this.location.href.replace(/#.*/,"").match(/\?.+/);returne?e[0]:""},getHash:function(e){constt=(e||this).location.href.match(/#(.*)$/);returnt?t[1]:""},getPath:function(){conste=this.decodeFragment(this.location.pathname+this.getSearch()).slice(this.root.length-1);return"/"===e.charAt(0)?e.slice(1):e},getFragment:function(e){returnnull==e&&(e=this._usePushState||!this._wantsHashChange?this.getPath():this.getHash()),e.replace(mc,"")},start:function(e){if(gc.started)thrownewError("history has already been started");if(gc.started=!0,this.options=jr({root:"/"},this.options,e),this.root=this.options.root,this._wantsHashChange=!1!==this.options.hashChange,this._hasHashChange="onhashchange"inwindow&&(void0===document.documentMode||document.documentMode>7),this._useHashChange=this._wantsHashChange&&this._hasHashChange,this._wantsPushState=!!this.options.pushState,this._hasPushState=!(!this.history||!this.history.pushState),this._usePushState=this._wantsPushState&&this._hasPushState,this.fragment=this.getFragment(),this.root=("/"+this.root+"/").replace(vc,"/"),this._wantsHashChange&&this._wantsPushState){if(!this._hasPushState&&!this.atRoot()){conste=this.root.slice(0,-1)||"/";returnthis.location.replace(e+"#"+this.getPath()),!0}this._hasPushState&&this.atRoot()&&this.
const{Strophe:ml,$iq:vl,utils:_l}=tl.env;tl.plugins.add("converse-disco",{initialize(){functione(){if(!qc.stream_features){conste=ml.getBareJidFromJid(qc.jid),t="converse.stream-features-".concat(e);Wc.promises.add("streamFeaturesAdded"),qc.stream_features=newta,qc.stream_features.browserStorage=qc.createStore(t,"session")}}functiont(){Wc.trigger("streamFeaturesAdded")}Wc.promises.add("discoInitialized"),Wc.promises.add("streamFeaturesAdded"),qc.DiscoEntity=Fo.extend({idAttribute:"jid",initialize(e,t){this.waitUntilFeaturesDiscovered=_l.getResolveablePromise(),this.dataforms=newta;letn="converse.dataforms-".concat(this.get("jid"));this.dataforms.browserStorage=qc.createStore(n,"session"),this.features=newta,n="converse.features-".concat(this.get("jid")),this.features.browserStorage=qc.createStore(n,"session"),this.listenTo(this.features,"add",this.onFeatureAdded),this.fields=newta,n="converse.fields-".concat(this.get("jid")),this.fields.browserStorage=qc.createStore(n,"session"),this.listenTo(this.fields,"add",this.onFieldAdded),this.identities=newta,n="converse.identities-".concat(this.get("jid")),this.identities.browserStorage=qc.createStore(n,"session"),this.fetchFeatures(t),this.items=newqc.DiscoEntities,n="converse.disco-items-".concat(this.get("jid")),this.items.browserStorage=qc.createStore(n,"session"),this.items.fetch()},asyncgetIdentity(e,t){returnawaitthis.waitUntilFeaturesDiscovered,this.identities.findWhere({category:e,type:t})},asynchasFeature(e){if(awaitthis.waitUntilFeaturesDiscovered,this.features.findWhere({var:e}))returnthis},onFeatureAdded(e){e.entity=this,Wc.trigger("serviceDiscovered",e)},onFieldAdded(e){e.entity=this,Wc.trigger("discoExtensionFieldDiscovered",e)},asyncfetchFeatures(e){if(e.ignore_cache)this.queryInfo();else{conste=this.features.browserStorage.name,t=awaitthis.features.browserStorage.store.getItem(e);t&&0===t.length||null===t?this.queryInfo():(this.features.fetch({add:!0,success:()=>{this.waitUntilFeaturesDiscovered.resolve(this),this.trigger("featuresDiscovered")}}),this.identities.fetch({add:!0}))}},asyncqueryInfo(){lete;try{e=awaitWc.disco.info(this.get("jid"),null)}catch(e){returnnull===e?Pn.error("Timeout for disco#info query for ".concat(this.get("jid"))):Pn.error(e),voidthis.waitUntilFeaturesDiscovered.resolve(this)}this.onInfo(e)},onDiscoItems(e){pr()('query[xmlns="'.concat(ml.NS.DISCO_ITEMS,'"] item'),e).forEach(e=>{if(e.getAttribute("node"))return;constt=e.getAttribute("jid");if(void0===this.items.get(t)){conste=qc.disco_entities.get(t);e?this.items.add(e):this.items.create({jid:t})}})},asyncqueryForItems(){if(0===this.identities.where({category:"server"}).length)return;conste=awaitWc.disco.items(this.get("jid"));this.onDiscoItems(e)},onInfo(e){Array.from(e.querySelectorAll("identity")).forEach(e=>{this.identities.create({category:e.getAttribute("category"),type:e.getAttribute("type"),name:e.getAttribute("name")})}),pr()('x[type="result"][xmlns="'.concat(ml.NS.XFORM,'"]'),e).forEach(e=>{constt={};pr()("field",e).forEach(e=>{varn;t[e.getAttribute("var")]={value:null===(n=e.querySelector("value"))||void0===n?void0:n.textContent,type:e.getAttribute("type")}}),this.dataforms.create(t)}),e.querySelector('feature[var="'.concat(ml.NS.DISCO_ITEMS,'"]'))&&this.queryForItems(),Array.from(e.querySelectorAll("feature")).forEach(t=>{this.features.create({var:t.getAttribute("var"),from:e.getAttribute("from")})}),pr()('x[type="result"][xmlns="jabber:x:data"] field',e).forEach(t=>{varn;this.fields.create({var:t.getAttribute("var"),value:null===(n=t.querySelector("value"))||void0===n?void0:n.textContent,from:e.getAttribute("from")})}),this.waitUntilFeaturesDiscovered.resolve(this),this.trigger("featuresDiscovered")}}),qc.DiscoEntities=ta.extend({model:qc.DiscoEntity,fetchEntities(){returnnewPromise((e,t)=>{this.fetch({add:!0,success:e,error(e,n){Pn.error(n),t(newError("Could not fetch disco entities"))}})})}});constn=this;functionr(e){constt=e.getElementsByTagName("query")[0].getAttribute("node"),r={xmlns:ml.NS.DISCO_INFO};t&&(r.node=t);consti=v
const{Strophe:cu,$iq:lu,sizzle:uu}=tl.env,du=tl.env.utils;functionhu(e){returnuu('event[xmlns="'.concat(cu.NS.PUBSUB,'#event"] items[node="').concat(cu.NS.BOOKMARKS,'"]'),e).length&&Wc.waitUntil("bookmarksInitialized").then(()=>qc.bookmarks.createBookmarksFromStanza(e)).catch(e=>Pn.fatal(e)),!0}cu.addNamespace("BOOKMARKS","storage:bookmarks"),tl.plugins.add("converse-bookmarks",{dependencies:["converse-chatboxes","converse-muc"],overrides:{ChatRoom:{getDisplayName(){const{_converse:e}=this.__super__;if(this.get("bookmarked")&&e.bookmarks){constt=e.bookmarks.findWhere({jid:this.get("jid")});if(t)returnt.get("name")}returnthis.__super__.getDisplayName.apply(this,arguments)},getAndPersistNickname(e){const{_converse:t}=this.__super__;returne=e||t.getNicknameFromBookmark(this.get("jid")),this.__super__.getAndPersistNickname.call(this,e)}}},initialize(){const{__:e}=qc;Wc.settings.extend({allow_bookmarks:!0,allow_public_bookmarks:!1,muc_respect_autojoin:!0}),Wc.promises.add("bookmarksInitialized"),qc.getNicknameFromBookmark=function(e){if(!qc.bookmarks||!Wc.settings.get("allow_bookmarks"))returnnull;constt=qc.bookmarks.findWhere({jid:e});returnt?t.get("nick"):void0},qc.Bookmark=Fo.extend({idAttribute:"jid",getDisplayName(){returncu.xmlunescape(this.get("name"))}}),qc.Bookmarks=ta.extend({model:qc.Bookmark,comparator:e=>e.get("name").toLowerCase(),initialize(){this.on("add",e=>this.openBookmarkedRoom(e).then(e=>this.markRoomAsBookmarked(e)).catch(e=>Pn.fatal(e))),this.on("remove",this.markRoomAsUnbookmarked,this),this.on("remove",this.sendBookmarkStanza,this);conste="converse.room-bookmarks".concat(qc.bare_jid);this.fetched_flag=e+"fetched",this.browserStorage=qc.createStore(e)},asyncopenBookmarkedRoom(e){if(Wc.settings.get("muc_respect_autojoin")&&e.get("autojoin")){(awaitWc.rooms.create(e.get("jid"),{nick:e.get("nick")})).maybeShow()}returne},fetchBookmarks(){conste=du.getResolveablePromise();returnwindow.sessionStorage.getItem(this.fetched_flag)?this.fetch({success:()=>e.resolve(),error:()=>e.resolve()}):this.fetchBookmarksFromServer(e),e},createBookmark(e){this.create(e),this.sendBookmarkStanza().catch(t=>this.onBookmarkError(t,e))},sendBookmarkStanza(){conste=lu({type:"set",from:qc.connection.jid}).c("pubsub",{xmlns:cu.NS.PUBSUB}).c("publish",{node:cu.NS.BOOKMARKS}).c("item",{id:"current"}).c("storage",{xmlns:cu.NS.BOOKMARKS});returnthis.forEach(t=>{e.c("conference",{name:t.get("name"),autojoin:t.get("autojoin"),jid:t.get("jid")}).c("nick").t(t.get("nick")).up().up()}),e.up().up().up(),e.c("publish-options").c("x",{xmlns:cu.NS.XFORM,type:"submit"}).c("field",{var:"FORM_TYPE",type:"hidden"}).c("value").t("http://jabber.org/protocol/pubsub#publish-options").up().up().c("field",{var:"pubsub#persist_items"}).c("value").t("true").up().up().c("field",{var:"pubsub#access_model"}).c("value").t("whitelist"),Wc.sendIQ(e)},onBookmarkError(t,n){Pn.error("Error while trying to add bookmark"),Pn.error(t),Wc.alert("error",e("Error"),[e("Sorry, something went wrong while trying to save your bookmark.")]),this.findWhere({jid:n.jid}).destroy()},fetchBookmarksFromServer(e){constt=lu({from:qc.connection.jid,type:"get"}).c("pubsub",{xmlns:cu.NS.PUBSUB}).c("items",{node:cu.NS.BOOKMARKS});Wc.sendIQ(t).then(t=>this.onBookmarksReceived(e,t)).catch(t=>this.onBookmarksReceivedError(e,t))},markRoomAsBookmarked(e){constt=qc.chatboxes.get(e.get("jid"));void0!==t&&t.save("bookmarked",!0)},markRoomAsUnbookmarked(e){constt=qc.chatboxes.get(e.get("jid"));void0!==t&&t.save("bookmarked",!1)},createBookmarksFromStanza(e){constt=cu.NS.BOOKMARKS,n='items[node="'.concat(t,'"] item storage[xmlns="').concat(t,'"] conference');uu(n,e).forEach(e=>{vart;constn=e.getAttribute("jid"),r=this.get(n),i={jid:n,name:e.getAttribute("name")||n,autojoin:"true"===e.getAttribute("autojoin"),nick:(null===(t=e.querySelector("nick"))||void0===t?void0:t.textContent)||""};r?r.save(i):this.create(i)})},onBookmarksReceived(e,t){if(this.createBookmarksFromStanza(t),window.sessionStorage.setItem(this.fetched_flag,!0),void0!==e)returne.resolve()},onBookmarks
functionbu(e){vart,n;e&&(null===(n=qc.session)||void0===n||n.set({carbons_enabled:!1}));if(!Wc.settings.get("message_carbons")||(null===(t=qc.session)||void0===t?void0:t.get("carbons_enabled")))return;constr=newOc.e.Builder("iq",{from:qc.connection.jid,id:"enablecarbons",type:"set"}).c("enable",{xmlns:Oc.e.NS.CARBONS});qc.connection.addHandler(e=>{e.querySelectorAll("error").length>0?Pn.warn("An error occurred while trying to enable message carbons."):(qc.session.set({carbons_enabled:!0}),Pn.debug("Message carbons have been enabled.")),qc.session.save()},null,"iq",null,"enablecarbons"),qc.connection.send(r)}gu.addNamespace("CAPS","http://jabber.org/protocol/caps"),tl.plugins.add("converse-caps",{overrides:{XMPPStatus:{constructPresence(){conste=this.__super__.constructPresence.apply(this,arguments);vart;returne.root().cnode((t=this.__super__._converse,mu("c",{xmlns:gu.NS.CAPS,hash:"sha-1",node:"https://conversejs.org",ver:_u(t)}).nodeTree)),e}}}}),tl.plugins.add("converse-carbons",{initialize(){Wc.settings.extend({message_carbons:!0}),Wc.listen.on("afterResourceBinding",bu)}});
const{Strophe:Fu,$iq:Bu}=tl.env,qu=tl.env.utils;Fu.addNamespace("PING","urn:xmpp:ping"),tl.plugins.add("converse-ping",{initialize(){lete;functiont(t){e=newDate;constn=t.getAttribute("from"),r=t.getAttribute("id"),i=Bu({type:"result",to:n,id:r});returnqc.connection.sendIQ(i),!0}Wc.settings.extend({ping_interval:60}),setTimeout(()=>{if(Wc.settings.get("ping_interval")>0){constt=newDate;returne||(e=t),!((t-e)/1e3>Wc.settings.get("ping_interval"))||Wc.ping()}},1e3);constn=function(){void0!==qc.connection.disco&&Wc.disco.own.features.add(Fu.NS.PING),qc.connection.addHandler(t,Fu.NS.PING,"iq","get"),qc.connection.addHandler(()=>{if(Wc.settings.get("ping_interval")>0)returne=newDate,!0})};Wc.listen.on("connected",n),Wc.listen.on("reconnected",n),Wc.listen.on("windowStateChanged",(function(e){"visible"===e.state&&Wc.connection.connected()&&Wc.ping(null,5e3)})),Object.assign(Wc,{asyncping(t,n){if(e=newDate,t=t||Fu.getDomainFromJid(qc.bare_jid),qc.connection){conste=Bu({type:"get",to:t,id:qu.getUniqueId("ping")}).c("ping",{xmlns:Fu.NS.PING}),r=awaitWc.sendIQ(e,n||1e4,!1);returnnull===r?(Pn.warn("Timeout while pinging ".concat(t)),t===Fu.getDomainFromJid(qc.bare_jid)&&Wc.connection.reconnect()):qu.isErrorStanza(r)&&(Pn.error("Error while pinging ".concat(t)),Pn.error(r)),!0}return!1}})}});
const{Strophe:Hu,$iq:Uu}=tl.env;Hu.addNamespace("PUBSUB_ERROR",Hu.NS.PUBSUB+"#errors"),tl.plugins.add("converse-pubsub",{dependencies:["converse-disco"],initialize(){Object.assign(qc.api,{pubsub:{asyncpublish(e,t,n,r,i=!0){consto=Uu({from:qc.bare_jid,type:"set",to:e}).c("pubsub",{xmlns:Hu.NS.PUBSUB}).c("publish",{node:t}).cnode(n.tree()).up().up();r&&(e=e||qc.bare_jid,awaitWc.disco.supports(Hu.NS.PUBSUB+"#publish-options",e)?(o.c("publish-options").c("x",{xmlns:Hu.NS.XFORM,type:"submit"}).c("field",{var:"FORM_TYPE",type:"hidden"}).c("value").t("".concat(Hu.NS.PUBSUB,"#publish-options")).up().up(),Object.keys(r).forEach(e=>o.c("field",{var:e}).c("value").t(r[e]).up().up())):Pn.warn("_converse.api.publish: ".concat(e," does not support #publish-options, ")+"so we didn't set them even though they were provided."));try{awaitWc.sendIQ(o)}catch(e){if(!(einstanceofElement&&i&&e.querySelector('precondition-not-met[xmlns="'.concat(Hu.NS.PUBSUB_ERROR,'"]'))))throwe;{conste=o.nodeTree;e.querySelector("publish-options").outerHTML="",Pn.warn("PubSub: Republishing without publish options. ".concat(e.outerHTML)),awaitWc.sendIQ(e)}}}}})}});var$u=function(e){return"number"==typeofe||Ee(e)&&"[object Number]"==k(e)};varWu=function(e){return$u(e)&&e!=+e};
const{Strophe:bd,$iq:yd,dayjs:wd}=tl.env,Sd=tl.env.utils;tl.plugins.add("converse-vcard",{dependencies:["converse-status","converse-roster"],overrides:{XMPPStatus:{getNickname(){const{_converse:e}=this.__super__,t=this.__super__.getNickname.apply(this);return!t&&e.xmppstatus.vcard?e.xmppstatus.vcard.get("nickname"):t},getFullname(){const{_converse:e}=this.__super__,t=this.__super__.getFullname.apply(this);return!t&&e.xmppstatus.vcard?e.xmppstatus.vcard.get("fullname"):t}},RosterContact:{getDisplayName(){return!this.get("nickname")&&this.vcard?this.vcard.getDisplayName():this.__super__.getDisplayName.apply(this)},getFullname(){returnthis.vcard?this.vcard.get("fullname"):this.__super__.getFullname.apply(this)}}},initialize(){functione(e,t,n){constr=yd(t?{type:e,to:t}:{type:e});returnn?r.cnode(n):r.c("vCard",{xmlns:bd.NS.VCARD}),r}asyncfunctiont(t,n){constr=bd.getBareJidFromJid(n)===t.bare_jid?null:n;leti;try{i=awaitWc.sendIQ(e("get",r))}catch(i){return{stanza:i,jid:n,vcard_error:(newDate).toISOString()}}returnasyncfunction(e,t){constn=t.querySelector("vCard");letr={};vari,o,s,a,c,l,u;if(null!==n&&(r={stanza:t,fullname:null===(i=n.querySelector("FN"))||void0===i?void0:i.textContent,nickname:null===(o=n.querySelector("NICKNAME"))||void0===o?void0:o.textContent,image:null===(s=n.querySelector("PHOTO BINVAL"))||void0===s?void0:s.textContent,image_type:null===(a=n.querySelector("PHOTO TYPE"))||void0===a?void0:a.textContent,url:null===(c=n.querySelector("URL"))||void0===c?void0:c.textContent,role:null===(l=n.querySelector("ROLE"))||void0===l?void0:l.textContent,email:null===(u=n.querySelector("EMAIL USERID"))||void0===u?void0:u.textContent,vcard_updated:(newDate).toISOString(),vcard_error:void0}),r.image){conste=Sd.base64ToArrayBuffer(r.image),t=awaitcrypto.subtle.digest("SHA-1",e);r.image_hash=Sd.arrayBufferToHex(t)}returnr}(0,i)}asyncfunctionn(e){lett;if(einstanceofqc.Message){if("error"===e.get("type"))return;t=e.get("from")}elset=e.get("jid");awaitWc.waitUntil("VCardsInitialized"),e.vcard=qc.vcards.findWhere({jid:t}),e.vcard||(e.vcard=qc.vcards.create({jid:t})),e.vcard.on("change",()=>e.trigger("vcard:change"))}asyncfunctionr(e){awaitWc.waitUntil("VCardsInitialized"),["error","info"].includes(e.get("type"))||(e.vcard=function(e){vart;constn=null==e||null===(t=e.collection)||void0===t?void0:t.chatbox,r=bd.getResourceFromJid(e.get("from"));if(n&&n.get("nick")===r)returnqc.xmppstatus.vcard;{constt=e.occupant&&e.occupant.get("jid")||e.get("from");returnt?qc.vcards.findWhere({jid:t})||qc.vcards.create({jid:t}):voidPn.error("Could not assign VCard for message because no JID found! msgid: ".concat(e.get("msgid")))}}(e))}Wc.promises.add("VCardsInitialized"),qc.VCard=Fo.extend({defaults:{image:qc.DEFAULT_IMAGE,image_type:qc.DEFAULT_IMAGE_TYPE},set(e,t,n){letr;return"object"==typeofe?(r=e,n=t):(r={})[e]=t,"image"inr&&!r.image?(r.image=qc.DEFAULT_IMAGE,r.image_type=qc.DEFAULT_IMAGE_TYPE,Fo.prototype.set.call(this,r,n)):Fo.prototype.set.apply(this,arguments)},getDisplayName(){returnthis.get("nickname")||this.get("fullname")||this.get("jid")}}),qc.VCards=ta.extend({model:qc.VCard,initialize(){this.on("add",e=>e.get("jid")&&Wc.vcard.update(e))}}),qc.initVCardCollection=asyncfunction(){qc.vcards=newqc.VCards,qc.vcards.browserStorage=qc.createStore("".concat(qc.bare_jid,"-converse.vcards")),awaitnewPromise(e=>{qc.vcards.fetch({success:e,error:e},{silent:!0})});conste=qc.vcards;if(qc.session){constt=qc.session.get("bare_jid");qc.xmppstatus.vcard=e.findWhere({jid:t})||e.create({jid:t})}Wc.trigger("VCardsInitialized")},Wc.listen.on("chatBoxInitialized",e=>n(e)),Wc.listen.on("chatRoomInitialized",e=>n(e)),Wc.listen.on("chatRoomMessageInitialized",e=>r(e)),Wc.listen.on("addClientFeatures",()=>Wc.disco.own.features.add(bd.NS.VCARD)),Wc.listen.on("clearSession",()=>{qc.shouldClearCache()&&(Wc.promises.add("VCardsInitialized"),qc.vcards&&(qc.vcards.clearStore(),deleteqc.vcards))}),Wc.listen.on("messageInitialized",e=>n(e)),Wc.listen.on("rosterContactInitialized",e=>n(e)),Wc.listen.on("
const{Strophe:Xd}=tl.env,Qd=tl.env.utils;tl.plugins.add("converse-bookmark-views",{dependencies:["converse-chatboxes","converse-muc","converse-muc-views"],initialize(){Wc.settings.extend({hide_open_bookmarks:!0}),Object.assign(qc,{removeBookmarkViaEvent(e){e.preventDefault();constt=e.target.getAttribute("data-bookmark-name"),n=e.target.getAttribute("data-room-jid");confirm(Td('Are you sure you want to remove the bookmark "%1$s"?',t))&&Jd(qc.bookmarks.where({jid:n}),Fo.prototype.destroy)},addBookmarkViaEvent(e){e.preventDefault();constt=e.target.getAttribute("data-room-jid");Wc.rooms.open(t,{bring_to_foreground:!0}),qc.chatboxviews.get(t).renderBookmarkForm()}});conste={setBookmarkState(){if(void0!==qc.bookmarks){qc.bookmarks.where({jid:this.model.get("jid")}).length?this.model.save("bookmarked",!0):this.model.save("bookmarked",!1)}},renderBookmarkForm(){if(this.hideChatRoomContents(),!this.bookmark_form){this.bookmark_form=newqc.MUCBookmarkForm({model:this.model,chatroomview:this}),this.el.querySelector(".chatroom-body").insertAdjacentElement("beforeend",this.bookmark_form.el)}Qd.showElement(this.bookmark_form.el)},toggleBookmark(e){null==e||e.preventDefault();constt=qc.bookmarks.where({jid:this.model.get("jid")});t.length?t.forEach(e=>e.destroy()):this.renderBookmarkForm()}};Object.assign(qc.ChatRoomView.prototype,e),qc.MUCBookmarkForm=Wd.extend({className:"muc-bookmark-form chatroom-form-container",initialize(e){this.chatroomview=e.chatroomview,this.render()},toHTML(){return(e=>{constt=Td("Bookmark this groupchat"),n=Td("Would you like this groupchat to be automatically joined upon startup?"),r=Td("Cancel"),i=Td("The name for this bookmark:"),o=Td("What should your nickname for this groupchat be?"),s=Td("Save");returnYa(Ud(),e.onSubmit,t,i,e.name,o,e.nick||"",n,s,r,e.onCancel)})(Object.assign(this.model.toJSON(),{onCancel:e=>this.closeBookmarkForm(e),onSubmit:e=>this.onBookmarkFormSubmitted(e)}))},onBookmarkFormSubmitted(e){vart,n,r;e.preventDefault(),qc.bookmarks.createBookmark({jid:this.model.get("jid"),autojoin:(null===(t=e.target.querySelector('input[name="autojoin"]'))||void0===t?void0:t.checked)||!1,name:null===(n=e.target.querySelector("input[name=name]"))||void0===n?void0:n.value,nick:null===(r=e.target.querySelector("input[name=nick]"))||void0===r?void0:r.value}),this.closeBookmarkForm(e)},closeBookmarkForm(e){e.preventDefault(),this.chatroomview.closeForm()}}),qc.BookmarksView=Wd.extend({tagName:"span",initialize(){this.listenTo(this.model,"add",this.render),this.listenTo(this.model,"remove",this.render),this.listenTo(qc.chatboxes,"add",this.render),this.listenTo(qc.chatboxes,"remove",this.render);conste="converse.room-bookmarks".concat(qc.bare_jid,"-list-model");this.list_model=newqc.BookmarksList({id:e}),this.list_model.browserStorage=qc.createStore(e);constt=()=>{this.render(),this.insertIntoControlBox()};this.list_model.fetch({success:t,error:t})},toHTML(){returnHd({_converse:qc,bookmarks:this.model,hidden:this.model.getUnopenedBookmarks().length&&!0,is_hidden:e=>!(!Wc.settings.get("hide_open_bookmarks")||!qc.chatboxes.get(e.get("jid"))),openRoom:e=>this.openRoom(e),removeBookmark:e=>this.removeBookmark(e),toggleBookmarksList:e=>this.toggleBookmarksList(e),toggle_state:this.list_model.get("toggle-state")})},insertIntoControlBox(){conste=qc.chatboxviews.get("controlbox");if(void0!==e&&!Qd.rootContains(qc.root,this.el)){constt=e.el.querySelector(".list-container--bookmarks");t&&t.parentNode.replaceChild(this.el,t)}},openRoom(e){e.preventDefault();constt=e.target.textContent,n=e.target.getAttribute("data-room-jid"),r={name:t||Xd.unescapeNode(Xd.getNodeFromJid(n))||n};Wc.rooms.open(n,r,!0)},removeBookmark:qc.removeBookmarkViaEvent,toggleBookmarksList(e){e&&e.preventDefault&&e.preventDefault();constt=e.target.matches(".fa")?e.target:e.target.querySelector(".fa");Qd.hasClass("fa-caret-down",t)?(Qd.slideIn(this.el.querySelector(".bookmarks")),this.list_model.save({"toggle-state":qc.CLOSED}),t.classList.remove("fa-caret-down"),t.classList.add("fa-caret-right")):(t.classList.remove("fa-car
constkp=newWeakMap,Np=Oa(e=>t=>{if(!(tinstanceofFa))thrownewError("unsafeHTML can only be used in text bindings");constn=kp.get(t);if(void0!==n&&Da(e)&&e===n.value&&t.value===n.fragment)return;constr=document.createElement("template");r.innerHTML=e;consti=document.importNode(r.content,!0);t.setValue(i),kp.set(t,{value:e,fragment:i})});functionIp(){conste=function(e,t){t||(t=e.slice(0));returnObject.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}(["\n <converse-message-history\n .chatview=","\n .messages=",'>\n </converse-message-history>\n <div class="chat-content__notifications">',"</div>\n "]);returnIp=function(){returne},e}functionMp(){conste=Dp(['<svg .style="','"> <use href="','"> </use> </svg>']);returnMp=function(){returne},e}functionRp(){conste=Dp(["\n :host {\n display: inline-block;\n padding: 0;\n margin: 0;\n }\n "]);returnRp=function(){returne},e}functionDp(e,t){returnt||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}
constyg=newWeakMap,wg=Oa(e=>t=>{if(!(tinstanceofFa))thrownewError("unsafeSVG can only be used in text bindings");constn=yg.get(t);if(void0!==n&&Da(e)&&e===n.value&&t.value===n.fragment)return;constr=document.createElement("template");r.innerHTML="<svg>".concat(e,"</svg>");consti=r.content,o=i.firstChild;i.removeChild(o),pa(i,o.firstChild);consts=document.importNode(i,!0);t.setValue(s),yg.set(t,{value:e,fragment:s})});functionSg(){conste=Eg(["",""]);returnSg=function(){returne},e}functionxg(){conste=Eg(["",""]);returnxg=function(){returne},e}functionEg(e,t){returnt||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}functionAg(){conste=function(e,t){t||(t=e.slice(0));returnObject.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}(['\n <div class="converse-chatboxes row no-gutters"></div>\n <div id="converse-modals" class="modals"></div>\n <converse-fontawesome></converse-fontawesome>\n']);returnAg=function(){returne},e}window.customElements.define("converse-fontawesome",classextendspc{constructor(){super();conste=n.e(138).then(n.t.bind(null,548,7));this.data=e.then(e=>Ya(xg(),wg(e.default())))}render(){returnYa(Sg(),Eh(this.data,""))}});varCg=function(e,t,n){varr=null==e?0:e.length;returnr?(t=n||void0===t?1:di(t),Ao(e,t<0?0:t,r)):[]};varjg=function(e,t){varn=[];returngs(e,(function(e,r,i){t(e,r,i)&&n.push(e)})),n};varOg=function(e,t){return(ke(e)?ot:jg)(e,So(t,3))};varTg=function(e){returne&&e.length?e[0]:void0};varkg=function(e){return"function"==typeofe?e:vr};varNg=function(e,t){return(ke(e)?ve:gs)(e,kg(t))};varIg=function(e,t){returnFr(t,(function(t){returne[t]}))};varMg=function(e){returnnull==e?[]:Ig(e,Qe(e))},Rg=Math.max;varDg=function(e,t,n,r){e=Xe(e)?e:Mg(e),n=n&&!r?di(n):0;vari=e.length;returnn<0&&(n=Rg(i+n,0)),Zt(e)?n<=i&&e.indexOf(t,n)>-1:!!i&&xs(e,t,n)>-1};varPg=function(e){return(null==e?0:e.length)?Ao(e,0,-1):[]};varLg=function(e,t){return(ke(e)?Fr:Js)(e,So(t,3))};varzg=function(e,t,n){for(varr=-1,i=e.length;++r<i;){varo=e[r],s=t(o);if(null!=s&&(void0===a?s==s&&!kr(s):n(s,a)))vara=s,c=o}returnc};varFg=function(e,t){returne>t};varBg=function(e){returne&&e.length?zg(e,vr,Fg):void0};varqg=function(e,t){returne<t};varHg=function(e){returne&&e.length?zg(e,vr,qg):void0};varUg=function(e,t,n,r){vari=-1,o=null==e?0:e.length;for(r&&o&&(n=e[++i]);++i<o;)n=t(n,e[i],i,e);returnn};var$g=function(e,t,n,r,i){returni(e,(function(e,i,o){n=r?(r=!1,e):t(n,e,i,o)})),n};varWg=function(e,t,n){varr=ke(e)?Ug:$g,i=arguments.length<3;returnr(e,So(t,4),n,i,gs)};varGg=function(e,t,n,r){vari=null==e?0:e.length;for(r&&i&&(n=e[--i]);i--;)n=t(n,e[i],i,e);returnn},Vg=Li(!0);varJg=ps((function(e,t){returne&&Vg(e,t,Qe)}),!0);varXg=function(e,t,n){varr=ke(e)?Gg:$g,i=arguments.length<3;returnr(e,So(t,4),n,i,Jg)};varQg=function(e){if("function"!=typeofe)thrownewTypeError("Expected a function");returnfunction(){vart=arguments;switch(t.length){case0:return!e.call(this);case1:return!e.call(this,t[0]);case2:return!e.call(this,t[0],t[1]);case3:return!e.call(this,t[0],t[1],t[2])}return!e.apply(this,t)}};varYg=function(e,t){return(ke(e)?ot:jg)(e,Qg(So(t,3)))};varKg=function(e,t){if("function"!=typeofe)thrownewTypeError("Expected a function");returnt=void0===t?t:di(t),Ar(e,t)},Zg=Math.floor,em=Math.random;vartm=function(e,t){returne+Zg(em()*(t-e+1))};varnm=function(e){vart=e.length;returnt?e[tm(0,t-1)]:void0};varrm=function(e){returnnm(Mg(e))};varim=function(e){return(ke(e)?nm:rm)(e)};varom=function(e,t){varn=-1,r=e.length,i=r-1;for(t=void0===t?r:t;++n<t;){varo=tm(n,i),s=e[o];e[o]=e[n],e[n]=s}returne.length=t,e};varsm=function(e){returnom(it(e))};varam=function(e){returnom(Mg(e))};varcm=function(e){return(ke(e)?sm:am)(e)},lm=bo("length"),um=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]");vardm=function(e){returnum.test(e)},hm="[\\ud800-\\udfff]",fm="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",pm="\\ud83c[\\udffb-\\udfff
tl.plugins.add("converse-singleton",{enabled:e=>e.api.settings.get("singleton"),initialize(){if(Wc.settings.extend({allow_logout:!1,allow_muc_invitations:!1,hide_muc_server:!0}),!Array.isArray(Wc.settings.get("auto_join_rooms"))&&!Array.isArray(Wc.settings.get("auto_join_private_chats")))thrownewError("converse-singleton: auto_join_rooms must be an Array");if(Wc.settings.get("auto_join_rooms").length>1||Wc.settings.get("auto_join_private_chats").length>1)thrownewError("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 one chat room may be open at any time.")}}),
constgw=tl.env.utils,mw=kv.extend({className:"chatbox headlines hidden",events:{"click .close-chatbox-button":"close","click .toggle-chatbox-button":"minimize","keypress textarea.chat-textarea":"onKeyDown"},asyncinitialize(){this.initDebounced(),this.model.disable_mam=!0,this.listenTo(this.model,"change:hidden",e=>e.get("hidden")?this.hide():this.show()),this.listenTo(this.model,"destroy",this.remove),this.listenTo(this.model,"show",this.show),this.render(),this.listenTo(this.model.messages,"add",this.onMessageAdded),this.listenTo(this.model.messages,"remove",this.renderChatHistory),this.listenTo(this.model.messages,"rendered",this.maybeScrollDown),this.listenTo(this.model.messages,"reset",this.renderChatHistory),awaitthis.model.messages.fetched,this.insertIntoDOM(),this.model.maybeShow(),this.scrollDown(),Wc.trigger("headlinesBoxViewInitialized",this)},render(){this.el.setAttribute("id",this.model.get("box_id"));conste=Km(Object.assign(this.model.toJSON(),{info_close:"",label_personal_message:"",show_send_button:!1,show_toolbar:!1,unread_msgs:""}));returnXa(e,this.el),this.content=this.el.querySelector(".chat-content"),this.msgs_container=this.el.querySelector(".chat-content__messages"),this.renderChatContent(),this.renderHeading(),this},getNotifications:()=>[],getHeadingButtons(){conste=[];returnWc.settings.get("singleton")||e.push({a_class:"close-chatbox-button",handler:e=>this.close(e),i18n_text:Td("Close"),i18n_title:Td("Close these announcements"),icon_class:"fa-times",name:"close",standalone:"overlayed"===Wc.settings.get("view_mode")}),qc.api.hook("getHeadingButtons",this,e)},renderMessageForm:function(){},afterShown:function(){}}),vw=Wd.extend({tagName:"div",className:"controlbox-section",id:"headline",events:{"click .open-headline":"openHeadline"},initialize(){this.listenTo(this.model,"add",this.renderIfHeadline),this.listenTo(this.model,"remove",this.renderIfHeadline),this.listenTo(this.model,"destroy",this.renderIfHeadline),this.render(),this.insertIntoDOM()},toHTML(){returne={heading_headline:Td("Announcements"),headlineboxes:this.model.filter(e=>e.get("type")===qc.HEADLINES_TYPE),open_title:Td("Click to open this server message")},Ya(pw(),e.headlineboxes.length?"":"hidden",e.heading_headline,fw(e));vare},renderIfHeadline(e){returne&&e.get("type")===qc.HEADLINES_TYPE&&this.render()},openHeadline(e){e.preventDefault();constt=e.target.getAttribute("data-headline-jid");qc.chatboxes.get(t).maybeShow(!0)},insertIntoDOM(){conste=qc.chatboxviews.get("controlbox");e&&e.el.querySelector(".controlbox-pane").insertAdjacentElement("beforeEnd",this.el)}});tl.plugins.add("converse-headlines-view",{dependencies:["converse-headlines","converse-chatview"],overrides:{ControlBoxView:{renderControlBoxPane(){this.__super__.renderControlBoxPane.apply(this,arguments),this.renderHeadlinesPanel()}}},initialize(){conste={renderHeadlinesPanel(){returnthis.headlinepanel&&gw.isInDOM(this.headlinepanel.el)||(this.headlinepanel=newqc.HeadlinesPanel({model:qc.chatboxes}),Wc.trigger("headlinesPanelRendered")),this.headlinepanel}};qc.ControlBoxView&&Object.assign(qc.ControlBoxView.prototype,e),qc.HeadlinesBoxView=mw,qc.HeadlinesPanel=vw,Wc.listen.on("chatBoxViewsInitialized",()=>{conste=qc.chatboxviews;qc.chatboxes.on("add",t=>{e.get(t.get("id"))||t.get("type")!==qc.HEADLINES_TYPE||e.add(t.get("id"),newqc.HeadlinesBoxView({model:t}))})})}});var_w=n(180),bw=n.n(_w);
constcS=tl.env.utils;tl.plugins.add("converse-profile",{dependencies:["converse-status","converse-modal","converse-vcard","converse-chatboxviews"],initialize(){Wc.settings.extend({allow_adhoc_commands:!0,show_client_info:!0}),qc.ProfileModal=mh.extend({id:"user-profile-modal",events:{"submit .profile-form":"onFormSubmitted"},initialize(){this.listenTo(this.model,"change",this.render),mh.prototype.initialize.apply(this,arguments),Wc.trigger("profileModalInitialized",this.model)},toHTML(){return(e=>{constt=Td("Your Profile"),n=Td("Email"),r=Td("Full Name"),i=Td("XMPP Address (JID)"),o=Td("Nickname"),s=Td("Role"),a=Td("Save and close"),c=Td("Use commas to separate multiple roles. Your roles are shown next to your name on your chat messages."),l=Td("URL"),u=Td("OMEMO"),d=Td("Profile"),h=Ya(Yw(),d,u);returnYa(Qw(),t,ih,qc.pluggable.plugins["converse-omemo"].enabled(qc)&&h||"",e.image,e.width,e.height,i,e.jid,r,e.fullname||"",o,e.nickname||"",l,e.url||"",n,e.email||"",s,e.role||"",c,a,qc.pluggable.plugins["converse-omemo"].enabled(qc)&&aS(e)||"")})(Object.assign(this.model.toJSON(),this.model.vcard.toJSON(),this.getAvatarData(),{view:this}))},getAvatarData(){return{height:128,width:128,image:"data:"+this.model.vcard.get("image_type")+";base64,"+this.model.vcard.get("image")}},afterRender(){this.tabs=pr()(".nav-item .nav-link",this.el).map(e=>newKd.a.Tab(e))},asyncsetVCard(e){try{awaitWc.vcard.set(qc.bare_jid,e)}catch(e){returnPn.fatal(e),voidthis.alert([Td("Sorry, an error happened while trying to save your profile data."),Td("You can check your browser's developer console for any error output.")].join(" "))}this.modal.hide()},onFormSubmitted(e){e.preventDefault();constt=newFileReader,n=newFormData(e.target),r=n.get("image"),i={fn:n.get("fn"),nickname:n.get("nickname"),role:n.get("role"),email:n.get("email"),url:n.get("url")};r.size?(t.onloadend=()=>{Object.assign(i,{image:btoa(t.result),image_type:r.type}),this.setVCard(i)},t.readAsBinaryString(r)):(Object.assign(i,{image:this.model.vcard.get("image"),image_type:this.model.vcard.get("image_type")}),this.setVCard(i))}}),qc.ChatStatusModal=mh.extend({id:"modal-status-change",events:{"submit form#set-xmpp-status":"onFormSubmitted","click .clear-input":"clearStatusMessage"},toHTML(){returne=Object.assign(this.model.toJSON(),this.model.vcard.toJSON(),{label_away:Td("Away"),label_busy:Td("Busy"),label_cancel:Td("Cancel"),label_close:Td("Close"),label_custom_status:Td("Custom status"),label_offline:Td("Offline"),label_online:Td("Online"),label_save:Td("Save"),label_xa:Td("Away for long"),modal_title:Td("Change chat status"),placeholder_status_message:Td("Personal status message")}),Ya(Uw(),e.modal_title,ih,"online"===e.status,e.label_online,"busy"===e.status,e.label_busy,"away"===e.status,e.label_away,"xa"===e.status,e.label_xa,e.status_message||"",e.placeholder_status_message,e.status_message?"":"hidden",e.label_save);vare},afterRender(){this.el.addEventListener("shown.bs.modal",()=>{this.el.querySelector('input[name="status_message"]').focus()},!1)},clearStatusMessage(e){e&&e.preventDefault&&(e.preventDefault(),cS.hideElement(this.el.querySelector(".clear-input"))),this.el.querySelector('input[name="status_message"]').value=""},onFormSubmitted(e){e.preventDefault();constt=newFormData(e.target);this.model.save({status_message:t.get("status_message"),status:t.get("chat_status")}),this.modal.hide()}}),qc.XMPPStatusView=qc.ViewWithAvatar.extend({tagName:"div",events:{"click a.show-profile":"showProfileModal","click a.change-status":"showStatusChangeModal","click .logout":"logOut"},initialize(){this.listenTo(this.model,"change",this.render),this.listenTo(this.model.vcard,"change",this.render)},toHTML(){conste=this.model.get("status")||"offline";return(e=>{constt=Td("Log out"),n=Td("Click to change your chat status"),r=Td("Show details about this chat client"),i=Wc.settings.get("show_client_info")||Wc.settings.get("allow_adhoc_commands");returnYa(Gw(),e.fullname,i?Ya(Ww(),r,e.showUserSettingsModal):"",Wc.settings.get("allow_logout")?Ya($w(),t):"",n,e.chat_status,e.cha
const{Strophe:HS,$iq:US}=tl.env;HS.addNamespace("PUSH","urn:xmpp:push:0"),tl.plugins.add("converse-push",{initialize(){asyncfunctione(e){e=e||qc.bare_jid;constt=qc.session.get("push_enabled")||[];if(t.includes(e))return;constn=Wc.settings.get("push_app_servers").filter(e=>!e.disable),r=Wc.settings.get("push_app_servers").filter(e=>e.disable),i=n.map(t=>asyncfunction(e,t){if(!t.jid||!t.node)return;if(!awaitWc.disco.getIdentity("pubsub","push",t.jid))returnPn.warn('Not enabling push the service "'.concat(t.jid,"\", it doesn't have the right disco identtiy."));constn=awaitPromise.all([Wc.disco.supports(HS.NS.PUSH,t.jid),Wc.disco.supports(HS.NS.PUSH,e)]);if(!n[0]&&!n[1])returnvoidPn.warn('Not enabling push app server "'.concat(t.jid,'", no disco support from your server.'));constr=US({type:"set"});returne!==qc.bare_jid&&r.attrs({to:e}),r.c("enable",{xmlns:HS.NS.PUSH,jid:t.jid,node:t.node}),t.secret&&r.c("x",{xmlns:HS.NS.XFORM,type:"submit"}).c("field",{var:"FORM_TYPE"}).c("value").t("".concat(HS.NS.PUBSUB,"#publish-options")).up().up().c("field",{var:"secret"}).c("value").t(t.secret),Wc.sendIQ(r)}(e,t)),o=r.map(t=>asyncfunction(e,t){if(!t.jid)return;if(!awaitWc.disco.supports(HS.NS.PUSH,e||qc.bare_jid))returnvoidPn.warn('Not disabling push app server "'.concat(t.jid,'", no disco support from your server.'));constn=US({type:"set"});e!==qc.bare_jid&&n.attrs({to:e}),n.c("disable",{xmlns:HS.NS.PUSH,jid:t.jid}),t.node&&n.attrs({node:t.node}),Wc.sendIQ(n).catch(e=>{Pn.error("Could not disable push app server for ".concat(t.jid)),Pn.error(e)})}(e,t));try{awaitPromise.all(i.concat(o))}catch(e){Pn.error("Could not enable or disable push App Server"),e&&Pn.error(e)}finally{t.push(e)}qc.session.save("push_enabled",t)}functiont(t){t.get("type")==qc.CHATROOMS_TYPE&&e(HS.getDomainFromJid(t.get("jid")))}Wc.settings.extend({push_app_servers:[],enable_muc_push:!1}),Wc.listen.on("statusInitialized",()=>e()),Wc.settings.get("enable_muc_push")&&Wc.listen.on("chatBoxesInitialized",()=>qc.chatboxes.on("add",t))}});var$S=n(181),WS=n.n($S),GS=n(182),VS=n.n(GS),JS=n(183),XS=n.n(JS);
const{Strophe:Sx}=tl.env,xx=tl.env.utils;tl.plugins.add("converse-rosterview",{dependencies:["converse-roster","converse-modal","converse-chatboxviews"],initialize(){Wc.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}),Wc.promises.add("rosterViewInitialized");conste={dnd:Td("This contact is busy"),online:Td("This contact is online"),offline:Td("This contact is offline"),unavailable:Td("This contact is unavailable"),xa:Td("This contact is away for an extended period"),away:Td("This contact is away")};functiont(){Wc.settings.get("authentication")!==qc.ANONYMOUS&&(qc.rosterview=newqc.RosterView({model:qc.rostergroups}),qc.rosterview.render(),Wc.trigger("rosterViewInitialized"))}qc.AddContactModal=mh.extend({id:"add-contact-modal",events:{"submit form":"addContactFromForm"},initialize(){mh.prototype.initialize.apply(this,arguments),this.listenTo(this.model,"change",this.render)},toHTML(){conste=Wc.settings.get("xhr_user_search_url")?Td("Contact name"):Td("Optional nickname");return(e=>{constt=Td("name@example.org"),n=Td("Add"),r=Td("Please enter a valid XMPP address"),i=Td("Add a Contact"),o=Td("XMPP Address"),s=Td("Nickname");returnYa(ux(),i,ih,o,!e._converse.xhr_user_search_url,e.jid||"",t,s,e.nickname||"",s,r,n)})(Object.assign(this.model.toJSON(),{_converse:qc,label_nickname:e}))},afterRender(){"string"==typeofWc.settings.get("xhr_user_search_url")?this.initXHRAutoComplete():this.initJIDAutoComplete();conste=this.el.querySelector('input[name="jid"]');this.el.addEventListener("shown.bs.modal",()=>e.focus(),!1)},initJIDAutoComplete(){if(!Wc.settings.get("autocomplete_add_contact"))return;conste=this.el.querySelector(".suggestion-box__jid").parentElement;this.jid_auto_complete=newqc.AutoComplete(e,{data:(e,t)=>"".concat(t.slice(0,t.indexOf("@")),"@").concat(e),filter:qc.FILTER_STARTSWITH,list:[...newSet(qc.roster.map(e=>Sx.getDomainFromJid(e.get("jid"))))]})},initXHRAutoComplete(){if(!Wc.settings.get("autocomplete_add_contact"))returnthis.initXHRFetch();conste=this.el.querySelector(".suggestion-box__name").parentElement;this.name_auto_complete=newqc.AutoComplete(e,{auto_evaluate:!1,filter:qc.FILTER_STARTSWITH,list:[]});constt=newwindow.XMLHttpRequest;t.onload=()=>{if(t.responseText){conste=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()}};constn=this.el.querySelector('input[name="name"]');n.addEventListener("input",Ic(()=>{t.open("GET","".concat(Wc.settings.get("xhr_user_search_url"),"q=").concat(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=newwindow.XMLHttpRequest,this.xhr.onload=()=>{if(this.xhr.responseText){conste=this.xhr.responseText,t=JSON.parse(e).map(e=>({label:e.fullname||e.jid,value:e.jid}));if(1!==t.length){conste=this.el.querySelector(".invalid-feedback");returne.textContent=Td("Sorry, could not find a contact with that name"),voidxx.addClass("d-block",e)}constn=t[0].value;if(this.validateSubmission(n)){conste=this.el.querySelector("form"),r=t[0].label;this.afterSubmission(e,n,r)}}}},validateSubmission(e){constt=this.el.querySelector(".invalid-feedback");return!e||Bo(e.split("@")).length<2?(xx.addClass("is-invalid",this.el.querySelector('input[name="jid"]')),xx.addClass("d-block",t),!1):qc.roster.get(Sx.getBareJidFromJid(e))?(t.textContent=Td("This contact has already been added"),xx.addClass("d-block",t),!1):(xx.removeClass("d-block",t),!0)},afterSubmission(e,t,n){qc.roster.addAndSubscribe(t,n),this.model.clear(),this.modal.hide()},addContactFromForm(e){e.preventDefault();constt=newFormData(e.target),n=(t.get("jid")||"").trim();if(!n&&"string"==typeofWc.settings.get("xhr_user_search_url")){conste=this.el.querySelecto