UNPKG

converse.js

Version:
2 lines 1.3 MB
/*! For license information please see converse.min.js.LICENSE.txt */ (()=>{var e,t,n,r,i={33:(e,t,n)=>{"use strict";n.d(t,{A:()=>a});var r=n(5307),i=n.n(r),s=n(3241),o=n.n(s)()(i());o.push([e.id,"","",{version:3,sources:[],names:[],mappings:"",sourceRoot:""}]);const a=o},134:(e,t,n)=>{var r=n(4776),i=n(3884);e.exports=function(e,t,n,s,o){return new i(r().w(e,t,n,s),o||Promise)},e.exports.__esModule=!0,e.exports.default=e.exports},152:e=>{e.exports=function(e){var t=Object(e),n=[];for(var r in t)n.unshift(r);return function e(){for(;n.length;)if((r=n.pop())in t)return e.value=r,e.done=!1,e;return e.done=!0,e}},e.exports.__esModule=!0,e.exports.default=e.exports},182:(e,t,n)=>{var r=n(5361);e.exports=function(e,t,n){return(t=r(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e},e.exports.__esModule=!0,e.exports.default=e.exports},216:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>GH});var r={};n.r(r),n.d(r,{isError:()=>Gr,isErrorObject:()=>Kr,isFunction:()=>Wr,isPersistableModel:()=>Jr,isUndefined:()=>Vr,merge:()=>Hr});var i={};n.r(i),n.d(i,{clearSession:()=>ci,getUnloadEvent:()=>ii,isTestEnv:()=>ri,isUniView:()=>ni,replacePromise:()=>si,shouldClearCache:()=>oi,tearDown:()=>ai});var s={};n.r(s),n.d(s,{ACTIVE:()=>so,ANONYMOUS:()=>Js,BOSH_WAIT:()=>qs,CHATROOMS_TYPE:()=>uo,CHAT_STATES:()=>go,CLOSED:()=>Ys,COMPOSING:()=>oo,CONNECTION_STATUS:()=>po,CONTROLBOX_TYPE:()=>fo,CORE_PLUGINS:()=>mo,EXTERNAL:()=>Xs,FAILURE:()=>ro,GONE:()=>co,HEADLINES_TYPE:()=>ho,INACTIVE:()=>io,KEYCODES:()=>yo,LOGIN:()=>Qs,LOGOUT:()=>Zs,MARKER_TYPES:()=>vo,METADATA_ATTRIBUTES:()=>Ks,OPENED:()=>eo,PAUSED:()=>ao,PREBIND:()=>to,PRES_SHOW_VALUES:()=>Gs,PRES_TYPE_VALUES:()=>Ws,PRIVATE_CHAT_TYPE:()=>lo,STATUS_WEIGHTS:()=>Vs,SUCCESS:()=>no,VERSION_NAME:()=>Hs,XFORM_TYPE_MAP:()=>bo,XFORM_VALIDATE_TYPE_MAP:()=>_o});var o={};n.r(o),n.d(o,{createStore:()=>tl,getDefaultStore:()=>Zc,initStorage:()=>nl});var a={};n.r(a),n.d(a,{getJIDFromURI:()=>cl,isOwnJID:()=>ll,isSameBareJID:()=>ol,isSameDomain:()=>al,isValidJID:()=>il,isValidMUCJID:()=>sl});var c={};n.r(c),n.d(c,{attemptNonPreboundSession:()=>Sl,cleanup:()=>_l,initClientConfig:()=>fl,initPersistentStorage:()=>ml,initPlugins:()=>hl,initSession:()=>yl,initSessionStorage:()=>pl,registerGlobalEventHandlers:()=>bl,safeSave:()=>jl,savedLoginInfo:()=>xl,setUserJID:()=>vl});var l={};n.r(l),n.d(l,{debounce:()=>Il,getOpenPromise:()=>ue,waitUntil:()=>Dl});var u={};n.r(u),n.d(u,{BadRequestError:()=>Fl,ConflictError:()=>ql,FeatureNotImplementedError:()=>Hl,ForbiddenError:()=>Gl,GoneError:()=>Wl,InternalServerError:()=>Vl,ItemNotFoundError:()=>Kl,JIDMalformedError:()=>Jl,MethodNotImplementedError:()=>zl,NotAcceptableError:()=>Yl,NotAllowedError:()=>Xl,NotAuthorizedError:()=>Ql,PaymentRequiredError:()=>Zl,RecipientUnavailableError:()=>eu,RedirectError:()=>tu,RegistrationRequiredError:()=>nu,RemoteServerNotFoundError:()=>ru,RemoteServerTimeoutError:()=>iu,ResourceConstraintError:()=>su,ServiceUnavailableError:()=>ou,StanzaError:()=>Ul,StanzaParseError:()=>Bl,SubscriptionRequiredError:()=>au,TimeoutError:()=>Ll,UndefinedConditionError:()=>cu,UnexpectedRequestError:()=>lu});var d={};n.r(d),n.d(d,{decodeHTMLEntities:()=>ih,isElement:()=>Qd,isTagEqual:()=>Zd,queryChildren:()=>th,siblingIndex:()=>nh,stringToElement:()=>eh});var h={};n.r(h),n.d(h,{getAttributes:()=>ch,isErrorStanza:()=>sh,isForbiddenError:()=>oh,isServiceUnavailableError:()=>ah,toStanza:()=>Fs});var f={};n.r(f),n.d(f,{unique:()=>Hf});var p={};n.r(p),n.d(p,{appendArrayBuffer:()=>Gf,arrayBufferToBase64:()=>Jf,arrayBufferToHex:()=>Wf,arrayBufferToString:()=>Vf,base64ToArrayBuffer:()=>Yf,hexToArrayBuffer:()=>Xf,stringToArrayBuffer:()=>Kf});var m={};n.r(m),n.d(m,{colorize:()=>tp});var g={};n.r(g),n.d(g,{getCurrentWord:()=>op,getSelectValues:()=>ip,isMentionBoundary:()=>ap,placeCaretAtEnd:()=>lp,replaceCurrentWord:()=>cp,webForm2xForm:()=>sp});var v={};n.r(v),n.d(v,{firstCharToUpperCase:()=>up,getLongestSubstring:()=>dp,isString:()=>hp});var y={};n.r(y),n.d(y,{addMediaURLsOffset:()=>Ip,checkFileTypes:()=>Sp,getHeaders:()=>kp,getMediaURLs:()=>Mp,getMediaURLsMetadata:()=>Np,getMetadataForURL:()=>Tp,getURL:()=>wp,isAudioURL:()=>jp,isEncryptedFileURL:()=>Op,isGIFURL:()=>Ap,isImageURL:()=>Ep,isURLWithImageExtension:()=>xp,isValidURL:()=>_p,isVideoURL:()=>$p,withinString:()=>Cp});var b={};n.r(b),n.d(b,{ACTION_INFO_CODES:()=>nv,ADMIN_COMMANDS:()=>iv,AFFILIATIONS:()=>sv,AFFILIATION_CHANGES:()=>fv,AFFILIATION_CHANGES_LIST:()=>pv,DISCONNECT_CODES:()=>ov,INFO_CODES:()=>bv,MODERATOR_COMMANDS:()=>av,MUC_NICK_CHANGED_CODE:()=>Sv,MUC_ROLE_CHANGES:()=>vv,MUC_ROLE_CHANGES_LIST:()=>yv,MUC_ROLE_WEIGHTS:()=>hv,MUC_TRAFFIC_STATES:()=>mv,MUC_TRAFFIC_STATES_LIST:()=>gv,NEW_NICK_CODES:()=>rv,OWNER_COMMANDS:()=>cv,ROLES:()=>lv,ROOMSTATUS:()=>_v,ROOM_FEATURES:()=>wv,STATUS_CODE_STANZAS:()=>dv,VISITOR_COMMANDS:()=>uv});var _={};n.r(_),n.d(_,{addClass:()=>sj,ancestor:()=>cj,default:()=>gj,getFileName:()=>nj,getHyperlinkTemplate:()=>lj,getNameAndValue:()=>tj,getOuterWidth:()=>fj,getRootElement:()=>mj,hasClass:()=>ij,removeClass:()=>oj,removeElement:()=>aj,slideIn:()=>dj,slideOut:()=>uj,xFormField2TemplateResult:()=>hj});var w={};n.r(w),n.d(w,{afterMain:()=>Bj,afterRead:()=>zj,afterWrite:()=>Hj,applyStyles:()=>Xj,arrow:()=>v$,auto:()=>$j,basePlacements:()=>Ej,beforeMain:()=>Lj,beforeRead:()=>Dj,beforeWrite:()=>Fj,bottom:()=>xj,clippingParents:()=>kj,computeStyles:()=>w$,createPopper:()=>X$,createPopperBase:()=>Y$,createPopperLite:()=>Q$,detectOverflow:()=>R$,end:()=>Cj,eventListeners:()=>x$,flip:()=>z$,hide:()=>B$,left:()=>jj,main:()=>Uj,modifierPhases:()=>Gj,offset:()=>F$,placements:()=>Pj,popper:()=>Nj,popperGenerator:()=>J$,popperOffsets:()=>q$,preventOverflow:()=>H$,read:()=>Rj,reference:()=>Mj,right:()=>Aj,start:()=>Oj,top:()=>Sj,variationPlacements:()=>Ij,viewport:()=>Tj,write:()=>qj});var S={};n.r(S),n.d(S,{getAuthorStyle:()=>eC});var x={};n.r(x),n.d(x,{MIMETYPES_MAP:()=>sC,compressImage:()=>aC,isImageWithAlphaChannel:()=>oC});var A={};n.r(A),n.d(A,{filterQueryParamsFromURL:()=>hC,isDomainAllowed:()=>lC,isDomainWhitelisted:()=>cC,isMediaURLDomainAllowed:()=>uC,shouldRenderMediaFromURL:()=>dC});var j=n(5072),$=n.n(j),E=n(7825),O=n.n(E),C=n(7659),k=n.n(C),T=n(5056),N=n.n(T),M=n(540),I=n.n(M),P=n(1113),D=n.n(P),R=n(845),z={};z.styleTagTransform=D(),z.setAttributes=N(),z.insert=k().bind(null,"head"),z.domAPI=O(),z.insertStyleElement=I();$()(R.A,z);R.A&&R.A.locals&&R.A.locals;var L,U,B,F,q=n(3968),H=n.n(q),G=n(2978),W=n.n(G),V=n(9144),K=n.n(V);const J={debug:0,info:1,warn:2,error:3,fatal:4},Y=Object.assign({debug:(null===(L=console)||void 0===L?void 0:L.log)?console.log.bind(console):function(){},error:(null===(U=console)||void 0===U?void 0:U.log)?console.log.bind(console):function(){},info:(null===(B=console)||void 0===B?void 0:B.log)?console.log.bind(console):function(){},warn:(null===(F=console)||void 0===F?void 0:F.log)?console.log.bind(console):function(){}},console),X={loglevel:"info",setLogLevel(e){if(!["debug","info","warn","error","fatal"].includes(e))throw new Error(`Invalid loglevel: ${e}`);this.loglevel=e},log(e,t,n=""){if(J[t]<J[this.loglevel])return;var r;"error"===t||"fatal"===t?n=n||"color: maroon":"debug"===t&&(n=n||"color: green"),e instanceof Error?e=e.stack:((r=e)instanceof Element||r instanceof Document)&&(e=e.outerHTML);const i=n?"%c":"";"error"===t?Y.error(`${i} ERROR: ${e}`,n):"warn"===t?Y.warn(`${i} ${(new Date).toISOString()} WARNING: ${e}`,n):"fatal"===t?Y.error(`${i} FATAL: ${e}`,n):"debug"===t?Y.debug(`${i} ${(new Date).toISOString()} DEBUG: ${e}`,n):Y.info(`${i} ${(new Date).toISOString()} INFO: ${e}`,n)},debug(e,t){this.log(e,"debug",t)},error(e,t){this.log(e,"error",t)},info(e,t){this.log(e,"info",t)},warn(e,t){this.log(e,"warn",t)},fatal(e,t){this.log(e,"fatal",t)}};const Q=X;var Z=n(5357),ee=n.n(Z),te=n(7181);function ne(e,t,n,r,i,s,o){try{var a=e[s](o),c=a.value}catch(e){return void n(e)}a.done?t(c):Promise.resolve(c).then(r,i)}const re={initialize(){return(e=function*(){},function(){var t=this,n=arguments;return new Promise((function(r,i){var s=e.apply(t,n);function o(e){ne(s,r,i,o,a,"next",e)}function a(e){ne(s,r,i,o,a,"throw",e)}o(void 0)}))})();var e},__:(...e)=>(0,te.sprintf)(...e)};function ie(e,t,n,r,...i){return"function"==typeof n&&(void 0===this.__super__&&(this.__super__=r),this.__super__[e]=n.bind(this)),t.apply(this,i)}class se{_overrideAttribute(e,t){const n=t.overrides[e];if("function"==typeof n){const t={};t[this.name]=this.plugged;const r=this.plugged[e];this.plugged[e]=function(...i){return ie.apply(this,[e,n,r,t,...i])}}else this.plugged[e]=n}_extendObject(e,t){e.prototype.__super__||(e.prototype.__super__={},e.prototype.__super__[this.name]=this.plugged);for(const[n,r]of Object.entries(t))if("events"===n)e.prototype[n]=Object.assign(r,e.prototype[n]);else if("function"==typeof r){const t={};t[this.name]=this.plugged;const i=e.prototype[n];e.prototype[n]=function(...e){return ie.apply(this,[n,r,i,t,...e])}}else e.prototype[n]=r}loadPluginDependencies(e){var t;null===(t=e.dependencies)||void 0===t||t.forEach((t=>{const n=this.plugins[t];if(n){var r;if(null===(r=n.dependencies)||void 0===r?void 0:r.includes(e.__name__))throw'Found a circular dependency between the plugins "'+e.__name__+'" and "'+t+'"';this.initializePlugin(n)}else this.throwUndefinedDependencyError('Could not find dependency "'+t+'" for the plugin "'+e.__name__+"\". If it's needed, make sure it's loaded by require.js")}))}throwUndefinedDependencyError(e){if(this.plugged.strict_plugin_dependencies)throw e;console.warn?console.warn(e):console.log(e)}applyOverrides(e){Object.keys(e.overrides||{}).forEach((t=>{const n=e.overrides[t];"object"==typeof n?void 0===this.plugged[t]?this.throwUndefinedDependencyError(`Plugin "${e.__name__}" tried to override "${t}" but it's not found.`):this._extendObject(this.plugged[t],n):this._overrideAttribute(t,e)}))}initializePlugin(e){var t;Object.keys(this.allowed_plugins).includes(e.__name__)&&(this.initialized_plugins.includes(e.__name__)||("boolean"==typeof e.enabled&&e.enabled||(null===(t=e.enabled)||void 0===t?void 0:t.call(e,this.plugged))||null==e.enabled)&&(Object.assign(e,this.properties),e.dependencies&&this.loadPluginDependencies(e),this.applyOverrides(e),"function"==typeof e.initialize&&e.initialize.bind(e)(this),this.initialized_plugins.push(e.__name__)))}registerPlugin(e,t){if(e in this.plugins)throw new Error("Error: Plugin name "+e+" is already taken");t.__name__=e,this.plugins[e]=t}initializePlugins(e={},t=[],n=[]){if(Object.keys(this.plugins).length){this.properties=e,this.allowed_plugins={};for(const[e,r]of Object.entries(this.plugins))t.length&&!t.includes(e)||n.includes(e)||(this.allowed_plugins[e]=r);Object.values(this.allowed_plugins).forEach((e=>this.initializePlugin(e)))}}constructor(e,t){this.name=t,this.plugged=e,void 0===this.plugged.__super__?this.plugged.__super__={}:"string"==typeof this.plugged.__super__&&(this.plugged.__super__={__string__:this.plugged.__super__}),this.plugged.__super__[t]=this.plugged,this.plugins={},this.initialized_plugins=[]}}const oe={enable:function(e,t,n){return void 0===n&&(n="pluginSocket"),void 0===t&&(t="plugged"),e[n]=new se(e,t),e}};var ae=n(1263);function ce(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function le(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})),e}function ue(){let e,t=()=>{},n=()=>{};if("function"==typeof Promise.withResolvers){const{promise:r,resolve:i,reject:s}=Promise.withResolvers();e=r,t=i,n=s}else e=new Promise(((e,r)=>{t=e,n=r}));return Object.assign(e,le(function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){ce(e,t,n[t])}))}return e}({},{isResolved:!1,isPending:!0,isRejected:!1}),{resolve:t,reject:n})),e.then((t=>(e.isResolved=!0,e.isPending=!1,e.isRejected=!1,t)),(t=>{throw e.isResolved=!1,e.isPending=!1,e.isRejected=!0,t})),e}const de=function(){this.__data__=[],this.size=0};const he=function(e,t){return e===t||e!=e&&t!=t};const fe=function(e,t){for(var n=e.length;n--;)if(he(e[n][0],t))return n;return-1};var pe=Array.prototype.splice;const me=function(e){var t=this.__data__,n=fe(t,e);return!(n<0)&&(n==t.length-1?t.pop():pe.call(t,n,1),--this.size,!0)};const ge=function(e){var t=this.__data__,n=fe(t,e);return n<0?void 0:t[n][1]};const ve=function(e){return fe(this.__data__,e)>-1};const ye=function(e,t){var n=this.__data__,r=fe(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this};function be(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}be.prototype.clear=de,be.prototype.delete=me,be.prototype.get=ge,be.prototype.has=ve,be.prototype.set=ye;const _e=be;const we=function(){this.__data__=new _e,this.size=0};const Se=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n};const xe=function(e){return this.__data__.get(e)};const Ae=function(e){return this.__data__.has(e)};const je="object"==typeof global&&global&&global.Object===Object&&global;var $e="object"==typeof self&&self&&self.Object===Object&&self;const Ee=je||$e||Function("return this")();const Oe=Ee.Symbol;var Ce=Object.prototype,ke=Ce.hasOwnProperty,Te=Ce.toString,Ne=Oe?Oe.toStringTag:void 0;const Me=function(e){var t=ke.call(e,Ne),n=e[Ne];try{e[Ne]=void 0;var r=!0}catch(e){}var i=Te.call(e);return r&&(t?e[Ne]=n:delete e[Ne]),i};var Ie=Object.prototype.toString;const Pe=function(e){return Ie.call(e)};var De=Oe?Oe.toStringTag:void 0;const Re=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":De&&De in Object(e)?Me(e):Pe(e)};const ze=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)};const Le=function(e){if(!ze(e))return!1;var t=Re(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t};const Ue=Ee["__core-js_shared__"];var Be,Fe=(Be=/[^.]+$/.exec(Ue&&Ue.keys&&Ue.keys.IE_PROTO||""))?"Symbol(src)_1."+Be:"";const qe=function(e){return!!Fe&&Fe in e};var He=Function.prototype.toString;const Ge=function(e){if(null!=e){try{return He.call(e)}catch(e){}try{return e+""}catch(e){}}return""};var We=/^\[object .+?Constructor\]$/,Ve=Function.prototype,Ke=Object.prototype,Je=Ve.toString,Ye=Ke.hasOwnProperty,Xe=RegExp("^"+Je.call(Ye).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");const Qe=function(e){return!(!ze(e)||qe(e))&&(Le(e)?Xe:We).test(Ge(e))};const Ze=function(e,t){return null==e?void 0:e[t]};const et=function(e,t){var n=Ze(e,t);return Qe(n)?n:void 0};const tt=et(Ee,"Map");const nt=et(Object,"create");const rt=function(){this.__data__=nt?nt(null):{},this.size=0};const it=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t};var st=Object.prototype.hasOwnProperty;const ot=function(e){var t=this.__data__;if(nt){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return st.call(t,e)?t[e]:void 0};var at=Object.prototype.hasOwnProperty;const ct=function(e){var t=this.__data__;return nt?void 0!==t[e]:at.call(t,e)};const lt=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=nt&&void 0===t?"__lodash_hash_undefined__":t,this};function ut(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}ut.prototype.clear=rt,ut.prototype.delete=it,ut.prototype.get=ot,ut.prototype.has=ct,ut.prototype.set=lt;const dt=ut;const ht=function(){this.size=0,this.__data__={hash:new dt,map:new(tt||_e),string:new dt}};const ft=function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e};const pt=function(e,t){var n=e.__data__;return ft(t)?n["string"==typeof t?"string":"hash"]:n.map};const mt=function(e){var t=pt(this,e).delete(e);return this.size-=t?1:0,t};const gt=function(e){return pt(this,e).get(e)};const vt=function(e){return pt(this,e).has(e)};const yt=function(e,t){var n=pt(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this};function bt(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}bt.prototype.clear=ht,bt.prototype.delete=mt,bt.prototype.get=gt,bt.prototype.has=vt,bt.prototype.set=yt;const _t=bt;const wt=function(e,t){var n=this.__data__;if(n instanceof _e){var r=n.__data__;if(!tt||r.length<199)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new _t(r)}return n.set(e,t),this.size=n.size,this};function St(e){var t=this.__data__=new _e(e);this.size=t.size}St.prototype.clear=we,St.prototype.delete=Se,St.prototype.get=xe,St.prototype.has=Ae,St.prototype.set=wt;const xt=St;const At=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this};const jt=function(e){return this.__data__.has(e)};function $t(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new _t;++t<n;)this.add(e[t])}$t.prototype.add=$t.prototype.push=At,$t.prototype.has=jt;const Et=$t;const Ot=function(e,t){for(var n=-1,r=null==e?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1};const Ct=function(e,t){return e.has(t)};const kt=function(e,t,n,r,i,s){var o=1&n,a=e.length,c=t.length;if(a!=c&&!(o&&c>a))return!1;var l=s.get(e),u=s.get(t);if(l&&u)return l==t&&u==e;var d=-1,h=!0,f=2&n?new Et:void 0;for(s.set(e,t),s.set(t,e);++d<a;){var p=e[d],m=t[d];if(r)var g=o?r(m,p,d,t,e,s):r(p,m,d,e,t,s);if(void 0!==g){if(g)continue;h=!1;break}if(f){if(!Ot(t,(function(e,t){if(!Ct(f,t)&&(p===e||i(p,e,n,r,s)))return f.push(t)}))){h=!1;break}}else if(p!==m&&!i(p,m,n,r,s)){h=!1;break}}return s.delete(e),s.delete(t),h};const Tt=Ee.Uint8Array;const Nt=function(e){var t=-1,n=Array(e.size);return e.forEach((function(e,r){n[++t]=[r,e]})),n};const Mt=function(e){var t=-1,n=Array(e.size);return e.forEach((function(e){n[++t]=e})),n};var It=Oe?Oe.prototype:void 0,Pt=It?It.valueOf:void 0;const Dt=function(e,t,n,r,i,s,o){switch(n){case"[object DataView]":if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case"[object ArrayBuffer]":return!(e.byteLength!=t.byteLength||!s(new Tt(e),new Tt(t)));case"[object Boolean]":case"[object Date]":case"[object Number]":return he(+e,+t);case"[object Error]":return e.name==t.name&&e.message==t.message;case"[object RegExp]":case"[object String]":return e==t+"";case"[object Map]":var a=Nt;case"[object Set]":var c=1&r;if(a||(a=Mt),e.size!=t.size&&!c)return!1;var l=o.get(e);if(l)return l==t;r|=2,o.set(e,t);var u=kt(a(e),a(t),r,i,s,o);return o.delete(e),u;case"[object Symbol]":if(Pt)return Pt.call(e)==Pt.call(t)}return!1};const Rt=function(e,t){for(var n=-1,r=t.length,i=e.length;++n<r;)e[i+n]=t[n];return e};const zt=Array.isArray;const Lt=function(e,t,n){var r=t(e);return zt(e)?r:Rt(r,n(e))};const Ut=function(e,t){for(var n=-1,r=null==e?0:e.length,i=0,s=[];++n<r;){var o=e[n];t(o,n,e)&&(s[i++]=o)}return s};const Bt=function(){return[]};var Ft=Object.prototype.propertyIsEnumerable,qt=Object.getOwnPropertySymbols;const Ht=qt?function(e){return null==e?[]:(e=Object(e),Ut(qt(e),(function(t){return Ft.call(e,t)})))}:Bt;const Gt=function(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r};const Wt=function(e){return null!=e&&"object"==typeof e};const Vt=function(e){return Wt(e)&&"[object Arguments]"==Re(e)};var Kt=Object.prototype,Jt=Kt.hasOwnProperty,Yt=Kt.propertyIsEnumerable;const Xt=Vt(function(){return arguments}())?Vt:function(e){return Wt(e)&&Jt.call(e,"callee")&&!Yt.call(e,"callee")};const Qt=function(){return!1};var Zt="object"==typeof exports&&exports&&!exports.nodeType&&exports,en=Zt&&"object"==typeof module&&module&&!module.nodeType&&module,tn=en&&en.exports===Zt?Ee.Buffer:void 0;const nn=(tn?tn.isBuffer:void 0)||Qt;var rn=/^(?:0|[1-9]\d*)$/;const sn=function(e,t){var n=typeof e;return!!(t=null==t?9007199254740991:t)&&("number"==n||"symbol"!=n&&rn.test(e))&&e>-1&&e%1==0&&e<t};const on=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991};var an={};an["[object Float32Array]"]=an["[object Float64Array]"]=an["[object Int8Array]"]=an["[object Int16Array]"]=an["[object Int32Array]"]=an["[object Uint8Array]"]=an["[object Uint8ClampedArray]"]=an["[object Uint16Array]"]=an["[object Uint32Array]"]=!0,an["[object Arguments]"]=an["[object Array]"]=an["[object ArrayBuffer]"]=an["[object Boolean]"]=an["[object DataView]"]=an["[object Date]"]=an["[object Error]"]=an["[object Function]"]=an["[object Map]"]=an["[object Number]"]=an["[object Object]"]=an["[object RegExp]"]=an["[object Set]"]=an["[object String]"]=an["[object WeakMap]"]=!1;const cn=function(e){return Wt(e)&&on(e.length)&&!!an[Re(e)]};const ln=function(e){return function(t){return e(t)}};var un="object"==typeof exports&&exports&&!exports.nodeType&&exports,dn=un&&"object"==typeof module&&module&&!module.nodeType&&module,hn=dn&&dn.exports===un&&je.process;const fn=function(){try{var e=dn&&dn.require&&dn.require("util").types;return e||hn&&hn.binding&&hn.binding("util")}catch(e){}}();var pn=fn&&fn.isTypedArray;const mn=pn?ln(pn):cn;var gn=Object.prototype.hasOwnProperty;const vn=function(e,t){var n=zt(e),r=!n&&Xt(e),i=!n&&!r&&nn(e),s=!n&&!r&&!i&&mn(e),o=n||r||i||s,a=o?Gt(e.length,String):[],c=a.length;for(var l in e)!t&&!gn.call(e,l)||o&&("length"==l||i&&("offset"==l||"parent"==l)||s&&("buffer"==l||"byteLength"==l||"byteOffset"==l)||sn(l,c))||a.push(l);return a};var yn=Object.prototype;const bn=function(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||yn)};const _n=function(e,t){return function(n){return e(t(n))}};const wn=_n(Object.keys,Object);var Sn=Object.prototype.hasOwnProperty;const xn=function(e){if(!bn(e))return wn(e);var t=[];for(var n in Object(e))Sn.call(e,n)&&"constructor"!=n&&t.push(n);return t};const An=function(e){return null!=e&&on(e.length)&&!Le(e)};const jn=function(e){return An(e)?vn(e):xn(e)};const $n=function(e){return Lt(e,jn,Ht)};var En=Object.prototype.hasOwnProperty;const On=function(e,t,n,r,i,s){var o=1&n,a=$n(e),c=a.length;if(c!=$n(t).length&&!o)return!1;for(var l=c;l--;){var u=a[l];if(!(o?u in t:En.call(t,u)))return!1}var d=s.get(e),h=s.get(t);if(d&&h)return d==t&&h==e;var f=!0;s.set(e,t),s.set(t,e);for(var p=o;++l<c;){var m=e[u=a[l]],g=t[u];if(r)var v=o?r(g,m,u,t,e,s):r(m,g,u,e,t,s);if(!(void 0===v?m===g||i(m,g,n,r,s):v)){f=!1;break}p||(p="constructor"==u)}if(f&&!p){var y=e.constructor,b=t.constructor;y==b||!("constructor"in e)||!("constructor"in t)||"function"==typeof y&&y instanceof y&&"function"==typeof b&&b instanceof b||(f=!1)}return s.delete(e),s.delete(t),f};const Cn=et(Ee,"DataView");const kn=et(Ee,"Promise");const Tn=et(Ee,"Set");const Nn=et(Ee,"WeakMap");var Mn="[object Map]",In="[object Promise]",Pn="[object Set]",Dn="[object WeakMap]",Rn="[object DataView]",zn=Ge(Cn),Ln=Ge(tt),Un=Ge(kn),Bn=Ge(Tn),Fn=Ge(Nn),qn=Re;(Cn&&qn(new Cn(new ArrayBuffer(1)))!=Rn||tt&&qn(new tt)!=Mn||kn&&qn(kn.resolve())!=In||Tn&&qn(new Tn)!=Pn||Nn&&qn(new Nn)!=Dn)&&(qn=function(e){var t=Re(e),n="[object Object]"==t?e.constructor:void 0,r=n?Ge(n):"";if(r)switch(r){case zn:return Rn;case Ln:return Mn;case Un:return In;case Bn:return Pn;case Fn:return Dn}return t});const Hn=qn;var Gn="[object Arguments]",Wn="[object Array]",Vn="[object Object]",Kn=Object.prototype.hasOwnProperty;const Jn=function(e,t,n,r,i,s){var o=zt(e),a=zt(t),c=o?Wn:Hn(e),l=a?Wn:Hn(t),u=(c=c==Gn?Vn:c)==Vn,d=(l=l==Gn?Vn:l)==Vn,h=c==l;if(h&&nn(e)){if(!nn(t))return!1;o=!0,u=!1}if(h&&!u)return s||(s=new xt),o||mn(e)?kt(e,t,n,r,i,s):Dt(e,t,c,n,r,i,s);if(!(1&n)){var f=u&&Kn.call(e,"__wrapped__"),p=d&&Kn.call(t,"__wrapped__");if(f||p){var m=f?e.value():e,g=p?t.value():t;return s||(s=new xt),i(m,g,n,r,s)}}return!!h&&(s||(s=new xt),On(e,t,n,r,i,s))};const Yn=function e(t,n,r,i,s){return t===n||(null==t||null==n||!Wt(t)&&!Wt(n)?t!=t&&n!=n:Jn(t,n,r,i,e,s))};const Xn=function(e,t){return Yn(e,t)};const Qn=function(e){return"symbol"==typeof e||Wt(e)&&"[object Symbol]"==Re(e)};var Zn=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,er=/^\w*$/;const tr=function(e,t){if(zt(e))return!1;var n=typeof e;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=e&&!Qn(e))||(er.test(e)||!Zn.test(e)||null!=t&&e in Object(t))};function nr(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError("Expected a function");var n=function(){var r=arguments,i=t?t.apply(this,r):r[0],s=n.cache;if(s.has(i))return s.get(i);var o=e.apply(this,r);return n.cache=s.set(i,o)||s,o};return n.cache=new(nr.Cache||_t),n}nr.Cache=_t;const rr=nr;const ir=function(e){var t=rr(e,(function(e){return 500===n.size&&n.clear(),e})),n=t.cache;return t};var sr=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,or=/\\(\\)?/g;const ar=ir((function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(sr,(function(e,n,r,i){t.push(r?i.replace(or,"$1"):n||e)})),t}));const cr=function(e,t){for(var n=-1,r=null==e?0:e.length,i=Array(r);++n<r;)i[n]=t(e[n],n,e);return i};var lr=Oe?Oe.prototype:void 0,ur=lr?lr.toString:void 0;const dr=function e(t){if("string"==typeof t)return t;if(zt(t))return cr(t,e)+"";if(Qn(t))return ur?ur.call(t):"";var n=t+"";return"0"==n&&1/t==-1/0?"-0":n};const hr=function(e){return null==e?"":dr(e)};const fr=function(e,t){return zt(e)?e:tr(e,t)?[e]:ar(hr(e))};const pr=function(e){if("string"==typeof e||Qn(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t};const mr=function(e,t){for(var n=0,r=(t=fr(t,e)).length;null!=e&&n<r;)e=e[pr(t[n++])];return n&&n==r?e:void 0};var gr=function(){try{var e=et(Object,"defineProperty");return e({},"",{}),e}catch(e){}}();const vr=gr;const yr=function(e,t,n){"__proto__"==t&&vr?vr(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n};var br=Object.prototype.hasOwnProperty;const _r=function(e,t,n){var r=e[t];br.call(e,t)&&he(r,n)&&(void 0!==n||t in e)||yr(e,t,n)};const wr=function(e,t,n,r){if(!ze(e))return e;for(var i=-1,s=(t=fr(t,e)).length,o=s-1,a=e;null!=a&&++i<s;){var c=pr(t[i]),l=n;if("__proto__"===c||"constructor"===c||"prototype"===c)return e;if(i!=o){var u=a[c];void 0===(l=r?r(u,c,a):void 0)&&(l=ze(u)?u:sn(t[i+1])?[]:{})}_r(a,c,l),a=a[c]}return e};const Sr=function(e,t,n){for(var r=-1,i=t.length,s={};++r<i;){var o=t[r],a=mr(e,o);n(a,o)&&wr(s,fr(o,e),a)}return s};const xr=function(e,t){return null!=e&&t in Object(e)};const Ar=function(e,t,n){for(var r=-1,i=(t=fr(t,e)).length,s=!1;++r<i;){var o=pr(t[r]);if(!(s=null!=e&&n(e,o)))break;e=e[o]}return s||++r!=i?s:!!(i=null==e?0:e.length)&&on(i)&&sn(o,i)&&(zt(e)||Xt(e))};const jr=function(e,t){return null!=e&&Ar(e,t,xr)};const $r=function(e,t){return Sr(e,t,(function(t,n){return jr(e,n)}))};var Er=Oe?Oe.isConcatSpreadable:void 0;const Or=function(e){return zt(e)||Xt(e)||!!(Er&&e&&e[Er])};const Cr=function e(t,n,r,i,s){var o=-1,a=t.length;for(r||(r=Or),s||(s=[]);++o<a;){var c=t[o];n>0&&r(c)?n>1?e(c,n-1,r,i,s):Rt(s,c):i||(s[s.length]=c)}return s};const kr=function(e){return(null==e?0:e.length)?Cr(e,1):[]};const Tr=function(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)};var Nr=Math.max;const Mr=function(e,t,n){return t=Nr(void 0===t?e.length-1:t,0),function(){for(var r=arguments,i=-1,s=Nr(r.length-t,0),o=Array(s);++i<s;)o[i]=r[t+i];i=-1;for(var a=Array(t+1);++i<t;)a[i]=r[i];return a[t]=n(o),Tr(e,this,a)}};const Ir=function(e){return function(){return e}};const Pr=function(e){return e};var Dr=vr?function(e,t){return vr(e,"toString",{configurable:!0,enumerable:!1,value:Ir(t),writable:!0})}:Pr;const Rr=Dr;var zr=Date.now;const Lr=function(e){var t=0,n=0;return function(){var r=zr(),i=16-(r-n);if(n=r,i>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(void 0,arguments)}};const Ur=Lr(Rr);const Br=function(e){return Ur(Mr(e,void 0,kr),e+"")};const Fr=Br((function(e,t){return null==e?{}:$r(e,t)})),qr={allow_non_roster_messaging:!0,allow_url_history_change:!0,assets_path:"/dist",authentication:"login",auto_login:!1,auto_reconnect:!0,blacklisted_plugins:[],clear_cache_on_logout:!1,connection_options:{},credentials_url:null,disable_effects:!1,discover_connection_methods:!0,embed_3rd_party_media_players:!0,geouri_regex:/https\:\/\/www.openstreetmap.org\/.*#map=[0-9]+\/([\-0-9.]+)\/([\-0-9.]+)\S*/g,geouri_replacement:"https://www.openstreetmap.org/?mlat=$1&mlon=$2#map=18/$1/$2",i18n:void 0,jid:void 0,reuse_scram_keys:!0,keepalive:!0,loglevel:"info",locales:["af","ar","bg","ca","cs","da","de","el","en","eo","es","eu","fa","fi","fr","gl","he","hi","hu","id","it","ja","lt","mr","nb","nl","oc","pl","pt","pt_BR","ro","ru","sv","ta","th","tr","ug","uk","vi","zh_CN","zh_TW"],nickname:void 0,password:void 0,persistent_store:"IndexedDB",rid:void 0,root:window.document,sid:void 0,singleton:!1,strict_plugin_dependencies:!1,stanza_timeout:6e4,view_mode:"fullscreen",websocket_url:void 0,whitelisted_plugins:[]};function Hr(e,t){for(const n in t)Object.prototype.hasOwnProperty.call(t,n)&&"__proto__"!==n&&"constructor"!==n&&(e[n]instanceof Object?Hr(e[n],t[n]):e[n]=t[n])}function Gr(e){return"[object Error]"===Object.prototype.toString.call(e)}function Wr(e){return"function"==typeof e}function Vr(e){return void 0===e}function Kr(e){return e instanceof Error}function Jr(e){var t;return e.browserStorage||(null===(t=e.collection)||void 0===t?void 0:t.browserStorage)}let Yr,Xr={};class Qr extends((0,ae.EventEmitter)(Object)){}const Zr={extend:e=>function(e){Hr(qr,e);const t=Object.keys(e).filter((e=>e in qr)),n=Fr(Xr,t),r=Object.assign(Fr(e,t),n);Hr(Yr,r)}(e),get:e=>e?function(e){if(Object.keys(qr).includes(e))return Yr[e]}(e):Yr,set(e,t){!function(e,t){if(null==e)return this;let n;e instanceof Object?n=e:"string"==typeof e&&(n={},n[e]=t);const r=Object.keys(n).filter((e=>e in qr)),i={};r.forEach((e=>{const t=n[e];Xn(Yr[e],t)||(i[e]=t,Yr[e]=t)})),Object.keys(i).forEach((e=>Yr.trigger("change:"+e,i[e]))),Yr.trigger("change",i)}(e,t)},listen:{on(e,t,n){!function(e,t,n){Yr.on(e,t,n)}(e,t,n)},not(e,t){!function(e,t){Yr.off(e,t)}(e,t)}}};function ei(e,t,n,r,i,s,o){try{var a=e[s](o),c=a.value}catch(e){return void n(e)}a.done?t(c):Promise.resolve(c).then(r,i)}const ti=Zr;function ni(){return["fullscreen","embedded"].includes(ti.get("view_mode"))}function ri(){return"montague.lit/http-bind"===Xr.bosh_service_url}function ii(){return"onpagehide"in window?"pagehide":"onbeforeunload"in window?"beforeunload":"unload"}function si(e,t){const n=e.promises[t];if(!n)throw new Error(`Tried to replace non-existing promise: ${t}`);if(n.replace){const r=ue();r.replace=n.replace,e.promises[t]=r}else Q.debug(`Not replacing promise "${t}"`)}function oi(e){const{api:t}=e;return!e.state.config.get("trusted")||t.settings.get("clear_cache_on_logout")||ri()}function ai(e){return(t=function*(){const{api:t}=e;return yield t.trigger("beforeTearDown",{synchronous:!0}),t.trigger("afterTearDown"),e},function(){var e=this,n=arguments;return new Promise((function(r,i){var s=t.apply(e,n);function o(e){ei(s,r,i,o,a,"next",e)}function a(e){ei(s,r,i,o,a,"throw",e)}o(void 0)}))})();var t}function ci(e){var t;oi(e)&&(e.api.user.settings.clear(),null===(t=e.state.login_info)||void 0===t||t.destroy());return e.initSession(),e.api.trigger("clearSession",{synchronous:!0})}function li(e,t,n,r,i,s,o){try{var a=e[s](o),c=a.value}catch(e){return void n(e)}a.done?t(c):Promise.resolve(c).then(r,i)}function ui(e){return function(){var t=this,n=arguments;return new Promise((function(r,i){var s=e.apply(t,n);function o(e){li(s,r,i,o,a,"next",e)}function a(e){li(s,r,i,o,a,"throw",e)}o(void 0)}))}}function di(e,t,n){if(!t.has(e))throw new TypeError("attempted to "+n+" private field on non-instance");return t.get(e)}function hi(e,t){return function(e,t){return t.get?t.get.call(e):t.value}(e,di(e,t,"get"))}function fi(e,t,n){!function(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}(e,t),t.set(e,n)}function pi(e,t,n){return function(e,t,n){if(t.set)t.set.call(e,n);else{if(!t.writable)throw new TypeError("attempted to set read only private field");t.value=n}}(e,di(e,t,"set"),n),n}function mi(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function gi(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){mi(e,t,n[t])}))}return e}function vi(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})),e}const yi={HTTPBIND:"http://jabber.org/protocol/httpbind",BOSH:"urn:xmpp:xbosh",CLIENT:"jabber:client",SERVER:"jabber:server",AUTH:"jabber:iq:auth",ROSTER:"jabber:iq:roster",PROFILE:"jabber:iq:profile",DISCO_INFO:"http://jabber.org/protocol/disco#info",DISCO_ITEMS:"http://jabber.org/protocol/disco#items",MUC:"http://jabber.org/protocol/muc",SASL:"urn:ietf:params:xml:ns:xmpp-sasl",STREAM:"http://etherx.jabber.org/streams",FRAMING:"urn:ietf:params:xml:ns:xmpp-framing",BIND:"urn:ietf:params:xml:ns:xmpp-bind",SESSION:"urn:ietf:params:xml:ns:xmpp-session",VERSION:"jabber:iq:version",STANZAS:"urn:ietf:params:xml:ns:xmpp-stanzas",XHTML_IM:"http://jabber.org/protocol/xhtml-im",XHTML:"http://www.w3.org/1999/xhtml"},bi={tags:["a","blockquote","br","cite","em","img","li","ol","p","span","strong","ul","body"],attributes:{a:["href"],blockquote:["style"],br:[],cite:["style"],em:[],img:["src","alt","style","height","width"],li:["style"],ol:["style"],p:["style"],span:["style"],strong:[],ul:["style"],body:[]},css:["background-color","color","font-family","font-size","font-style","font-weight","margin-left","margin-right","text-align","text-decoration"]},_i={ERROR:0,CONNECTING:1,CONNFAIL:2,AUTHENTICATING:3,AUTHFAIL:4,CONNECTED:5,DISCONNECTED:6,DISCONNECTING:7,ATTACHED:8,REDIRECT:9,CONNTIMEOUT:10,BINDREQUIRED:11,ATTACHFAIL:12,RECONNECTING:13},wi={BAD_FORMAT:"bad-format",CONFLICT:"conflict",MISSING_JID_NODE:"x-strophe-bad-non-anon-jid",NO_AUTH_MECH:"no-auth-mech",UNKNOWN_REASON:"unknown"},Si={DEBUG:0,INFO:1,WARN:2,ERROR:3,FATAL:4},xi={NORMAL:1,TEXT:3,CDATA:4,FRAGMENT:11};let Ai=Si.DEBUG;const ji={setLogLevel(e){if(e<Si.DEBUG||e>Si.FATAL)throw new Error("Invalid log level supplied to setLogLevel");Ai=e},log(e,t){var n;if(!(e<Ai))if(e>=Si.ERROR)null===(n=console)||void 0===n||n.error(t);else if(e===Si.INFO){var r;null===(r=console)||void 0===r||r.info(t)}else if(e===Si.WARN){var i;null===(i=console)||void 0===i||i.warn(t)}else if(e===Si.DEBUG){var s;null===(s=console)||void 0===s||s.debug(t)}},debug(e){this.log(Si.DEBUG,e)},info(e){this.log(Si.INFO,e)},warn(e){this.log(Si.WARN,e)},error(e){this.log(Si.ERROR,e)},fatal(e){this.log(Si.FATAL,e)}};function $i(e,t){const n=zi(e),r=Li(n);if(r)throw new Error(`Parser Error: ${r}`);const i=Ui(n);if(["message","iq","presence"].includes(i.nodeName.toLowerCase())&&"jabber:client"!==i.namespaceURI&&"jabber:server"!==i.namespaceURI){const e=`Invalid namespaceURI ${i.namespaceURI}`;if(t)throw new Error(e);ji.error(e)}return i}function Ei(e){void 0!==e.stack&&ji.fatal(e.stack),ji.fatal("error: "+e.message)}function Oi(e){let t="";const n=e.length;for(let r=0;r<n;r++){const n=e.charCodeAt(r);n>=0&&n<=127?t+=e.charAt(r):n>2047?(t+=String.fromCharCode(224|n>>12&15),t+=String.fromCharCode(128|n>>6&63),t+=String.fromCharCode(128|63&n)):(t+=String.fromCharCode(192|n>>6&31),t+=String.fromCharCode(128|63&n))}return t}function Ci(e,t){const n=new Uint8Array(e),r=new Uint8Array(t),i=new Uint8Array(e.byteLength);for(let t=0;t<e.byteLength;t++)i[t]=n[t]^r[t];return i.buffer}function ki(e){let t="";const n=new Uint8Array(e),r=n.byteLength;for(let e=0;e<r;e++)t+=String.fromCharCode(n[e]);return btoa(t)}function Ti(e){var t;return null===(t=Uint8Array.from(atob(e),(e=>e.charCodeAt(0))))||void 0===t?void 0:t.buffer}function Ni(e){return(new TextEncoder).encode(e).buffer}function Mi(e){"undefined"==typeof document&&ji.error("addCookies: not adding any cookies, since there's no document object"),e=e||{};for(const t in e)if(Object.prototype.hasOwnProperty.call(e,t)){let n="",r="",i="";const s=e[t],o="object"==typeof s,a=escape(unescape(o?s.value:s));o&&(n=s.expires?";expires="+s.expires:"",r=s.domain?";domain="+s.domain:"",i=s.path?";path="+s.path:""),document.cookie=t+"="+a+n+r+i}}let Ii=null;function Pi(){return Ii||(Ii=document.implementation.createDocument("jabber:client","strophe",null)),Ii}function Di(e){return Pi().createTextNode(e)}function Ri(e){const t=Array.from(e.childNodes);return 1===t.length&&t[0].nodeType===xi.TEXT||t.forEach((t=>{"body"!==t.nodeName.toLowerCase()&&(t.nodeType!==xi.TEXT||/\S/.test(t.nodeValue)?t.nodeType===xi.NORMAL&&Ri(t):e.removeChild(t))})),e}function zi(e){return(new DOMParser).parseFromString(e,"text/xml")}function Li(e){var t;const n="parsererror"===(null===(t=e.firstElementChild)||void 0===t?void 0:t.nodeName)?e.firstElementChild:e.getElementsByTagNameNS("http://www.w3.org/1999/xhtml","parsererror")[0];return"parsererror"===(null==n?void 0:n.nodeName)?null==n?void 0:n.textContent:null}function Ui(e){if(e.firstElementChild)return e.firstElementChild;let t,n=0;const r=e.childNodes;for(;t=r[n++];)if(1===t.nodeType)return t;return null}function Bi(e,t,n){if(!e)return null;const r=Pi().createElement(e);if(!n||"string"!=typeof n&&"number"!=typeof n){if("string"==typeof t||"number"==typeof t)return r.appendChild(Di(t.toString())),r}else r.appendChild(Di(n.toString()));if(!t)return r;if(Array.isArray(t))for(const e of t)Array.isArray(e)&&null!=e[0]&&null!=e[1]&&r.setAttribute(e[0],e[1]);else if("object"==typeof t)for(const e of Object.keys(t))e&&null!=t[e]&&r.setAttribute(e,t[e].toString());return r}function Fi(e){for(let t=0;t<bi.tags.length;t++)if(e===bi.tags[t])return!0;return!1}function qi(e,t){const n=bi.attributes[e];if((null==n?void 0:n.length)>0)for(let e=0;e<n.length;e++)if(t===n[e])return!0;return!1}function Hi(e){for(let t=0;t<bi.css.length;t++)if(e===bi.css[t])return!0;return!1}function Gi(e){if(e.nodeType===xi.NORMAL)return function(e){let t;const n=e.nodeName.toLowerCase();if(Fi(n))try{if(t=Bi(n),n in bi.attributes){const i=bi.attributes[n];for(let n=0;n<i.length;n++){const s=i[n];let o=e.getAttribute(s);var r;if(null!=o&&""!==o)if("style"===s&&"object"==typeof o&&(o=null!==(r=o.cssText)&&void 0!==r?r:o),"style"===s){const e=[],n=o.split(";");for(let t=0;t<n.length;t++){const r=n[t].split(":"),i=r[0].replace(/^\s*/,"").replace(/\s*$/,"").toLowerCase();if(Hi(i)){const t=r[1].replace(/^\s*/,"").replace(/\s*$/,"");e.push(i+": "+t)}}e.length>0&&(o=e.join("; "),t.setAttribute(s,o))}else t.setAttribute(s,o)}for(let n=0;n<e.childNodes.length;n++)t.appendChild(Gi(e.childNodes[n]))}}catch(e){t=Di("")}else{t=Pi().createDocumentFragment();for(let n=0;n<e.childNodes.length;n++)t.appendChild(Gi(e.childNodes[n]))}return t}(e);if(e.nodeType===xi.FRAGMENT){const t=Pi().createDocumentFragment();for(let n=0;n<e.childNodes.length;n++)t.appendChild(Gi(e.childNodes[n]));return t}return e.nodeType===xi.TEXT?Di(e.nodeValue):void 0}function Wi(e){let t;if(e.nodeType===xi.NORMAL){const n=e;t=Bi(n.tagName);for(let e=0;e<n.attributes.length;e++)t.setAttribute(n.attributes[e].nodeName,n.attributes[e].value);for(let e=0;e<n.childNodes.length;e++)t.appendChild(Wi(n.childNodes[e]))}else e.nodeType===xi.TEXT&&(t=Pi().createTextNode(e.nodeValue));return t}function Vi(e){return e=(e=(e=(e=(e=e.replace(/\&/g,"&amp;")).replace(/</g,"&lt;")).replace(/>/g,"&gt;")).replace(/'/g,"&apos;")).replace(/"/g,"&quot;")}function Ki(e,t,n){for(let r=0;r<e.childNodes.length;r++){const i=e.childNodes[r];i.nodeType!==xi.NORMAL||t&&!this.isTagEqual(i,t)||n(i)}}function Ji(e,t){return e.tagName===t}function Yi(e){if(!e)return null;let t="";e.childNodes.length||e.nodeType!==xi.TEXT||(t+=e.nodeValue);for(const n of e.childNodes)n.nodeType===xi.TEXT&&(t+=n.nodeValue);return Vi(t)}function Xi(e){return e.indexOf("@")<0?null:e.split("@")[0]}function Qi(e){const t=es(e);if(t.indexOf("@")<0)return t;{const e=t.split("@");return e.splice(0,1),e.join("@")}}function Zi(e){if(!e)return null;const t=e.split("/");return t.length<2?null:(t.splice(0,1),t.join("/"))}function es(e){return e?e.split("/")[0]:null}const ts={utf16to8:Oi,xorArrayBuffers:Ci,arrayBufToBase64:ki,base64ToArrayBuf:Ti,stringToArrayBuf:Ni,addCookies:Mi};var ns=Object.freeze({__proto__:null,toElement:$i,handleError:Ei,utf16to8:Oi,xorArrayBuffers:Ci,arrayBufToBase64:ki,base64ToArrayBuf:Ti,stringToArrayBuf:Ni,addCookies:Mi,xmlGenerator:Pi,xmlTextNode:Di,stripWhitespace:Ri,xmlHtmlNode:zi,getParserError:Li,getFirstElementChild:Ui,xmlElement:Bi,validTag:Fi,validAttribute:qi,validCSS:Hi,createHtml:Gi,copyElement:Wi,xmlescape:Vi,xmlunescape:function(e){return e=(e=(e=(e=(e=e.replace(/\&amp;/g,"&")).replace(/&lt;/g,"<")).replace(/&gt;/g,">")).replace(/&apos;/g,"'")).replace(/&quot;/g,'"')},forEachChild:Ki,isTagEqual:Ji,getText:Yi,escapeNode:function(e){return"string"!=typeof e?e:e.replace(/^\s+|\s+$/g,"").replace(/\\/g,"\\5c").replace(/ /g,"\\20").replace(/\"/g,"\\22").replace(/\&/g,"\\26").replace(/\'/g,"\\27").replace(/\//g,"\\2f").replace(/:/g,"\\3a").replace(/</g,"\\3c").replace(/>/g,"\\3e").replace(/@/g,"\\40")},unescapeNode:function(e){return"string"!=typeof e?e:e.replace(/\\20/g," ").replace(/\\22/g,'"').replace(/\\26/g,"&").replace(/\\27/g,"'").replace(/\\2f/g,"/").replace(/\\3a/g,":").replace(/\\3c/g,"<").replace(/\\3e/g,">").replace(/\\40/g,"@").replace(/\\5c/g,"\\")},getNodeFromJid:Xi,getDomainFromJid:Qi,getResourceFromJid:Zi,getBareJidFromJid:es,default:ts});function rs(e,t){return new ds(e,t)}function is(e){return new ds("message",e)}function ss(e){return new ds("iq",e)}function os(e){return new ds("presence",e)}var as=new WeakMap,cs=new WeakMap,ls=new WeakMap,us=new WeakMap;class ds{static fromString(e){const t=$i(e,!0),n=new ds("");return pi(n,as,t),n}buildTree(){return Bi(hi(this,ls),hi(this,us))}get nodeTree(){return hi(this,as)||pi(this,as,this.buildTree()),hi(this,as)}get node(){return hi(this,cs)||pi(this,cs,this.tree()),hi(this,cs)}set node(e){pi(this,cs,e)}static serialize(e){if(!e)return null;const t=e instanceof ds?e.tree():e,n=[...Array(t.attributes.length).keys()].map((e=>t.attributes[e].nodeName));n.sort();let r=n.reduce(((e,n)=>`${e} ${n}="${Vi(t.attributes.getNamedItem(n).value)}"`),`<${t.nodeName}`);if(t.childNodes.length>0){r+=">";for(let e=0;e<t.childNodes.length;e++){const n=t.childNodes[e];switch(n.nodeType){case xi.NORMAL:r+=ds.serialize(n);break;case xi.TEXT:r+=Vi(n.nodeValue);break;case xi.CDATA:r+="<![CDATA["+n.nodeValue+"]]>"}}r+="</"+t.nodeName+">"}else r+="/>";return r}tree(){return this.nodeTree}toString(){return ds.serialize(this.tree())}up(){return this.node=this.node.parentElement?this.node.parentElement:this.node.parentNode,this}root(){return this.node=this.tree(),this}attrs(e){for(const t in e)Object.prototype.hasOwnProperty.call(e,t)&&(null!=e[t]?this.node.setAttribute(t,e[t].toString()):this.node.removeAttribute(t));return this}c(e,t,n){const r=Bi(e,t,n);return this.node.appendChild(r),"string"!=typeof n&&"number"!=typeof n&&(this.node=r),this}cnode(e){let t;e instanceof ds&&(e=e.tree());const n=Pi();try{t=void 0!==n.importNode}catch(e){t=!1}const r=t?n.importNode(e,!0):Wi(e);return this.node.appendChild(r),this.node=r,this}t(e){const t=Di(e);return this.node.appendChild(t),this}h(e){const t=Pi().createElement("body");t.innerHTML=e;const n=Gi(t);for(;n.childNodes.length>0;)this.node.appendChild(n.childNodes[0]);return this}constructor(e,t){fi(this,as,{writable:!0,value:void 0}),fi(this,cs,{writable:!0,value:void 0}),fi(this,ls,{writable:!0,value:void 0}),fi(this,us,{writable:!0,value:void 0}),"presence"!==e&&"message"!==e&&"iq"!==e||(t&&!t.xmlns?t.xmlns=yi.CLIENT:t||(t={xmlns:yi.CLIENT})),pi(this,ls,e),pi(this,us,t)}}let hs=0;class fs{getResponse(){var e;const t=null===(e=this.xhr.responseXML)||void 0===e?void 0:e.documentElement;if(t){if("parsererror"===t.tagName)throw ji.error("invalid response received"),ji.error("responseText: "+this.xhr.responseText),ji.error("responseXML: "+ds.serialize(t)),new Error("parsererror")}else if(this.xhr.responseText){ji.debug("Got responseText but no responseXML; attempting to parse it with DOMParser...");const e=zi(this.xhr.responseText),t=Li(e);if(!e||t){t&&(ji.error("invalid response received: "+t),ji.error("responseText: "+this.xhr.responseText));const e=new Error;throw e.name=wi.BAD_FORMAT,e}}return t}_newXHR(){const e=new XMLHttpRequest;return e.overrideMimeType&&e.overrideMimeType("text/xml; charset=utf-8"),e.onreadystatechange=this.func.bind(null,this),e}constructor(e,t,n,r=0){this.id=++hs,this.xmlData=e,this.data=ds.serialize(e),this.origFunc=t,this.func=t,this.rid=n,this.date=NaN,this.sends=r,this.abort=!1,this.dead=null,this.age=()=>this.date?((new Date).valueOf()-this.date.valueOf())/1e3:0,this.timeDead=()=>this.dead?((new Date).valueOf()-this.dead.valueOf())/1e3:0,this.xhr=this._newXHR()}}let ps=1.1,ms=.1;class gs{static setTimeoutMultiplier(e){ps=e}static getTimeoutMultplier(){return ps}static setSecondaryTimeoutMultiplier(e){ms=e}static getSecondaryTimeoutMultplier(){return ms}_buildBody(){const e=rs("body",{rid:this.rid++,xmlns:yi.HTTPBIND});return null!==this.sid&&e.attrs({sid:this.sid}),this._conn.options.keepalive&&this._conn._sessionCachingSupported()&&this._cacheSession(),e}_reset(){this.rid=Math.floor(4294967295*Math.random()),this.sid=null,this.errors=0,this._conn._sessionCachingSupported()&&sessionStorage.removeItem("strophe-bosh-session"),this._conn.nextValidRid(this.rid)}_connect(e,t,n){this.wait=e||this.wait,this.hold=t||this.hold,this.errors=0;const r=this._buildBody().attrs({to:this._conn.domain,"xml:lang":"en",wait:this.wait,hold:this.hold,content:"text/xml; charset=utf-8",ver:"1.6","xmpp:version":"1.0","xmlns:xmpp":yi.BOSH});n&&r.attrs({route:n});const i=this._conn._connect_cb;this._requests.push(new fs(r.tree(),this._onRequestStateChange.bind(this,i.bind(this._conn)),Number(r.tree().getAttribute("rid")))),this._throttledRequestHandler()}_attach(e,t,n,r,i,s,o){this._conn.jid=e,this.sid=t,this.rid=n,this._conn.connect_callback=r,this._conn.domain=Qi(this._conn.jid),this._conn.authenticated=!0,this._conn.connected=!0,this.wait=i||this.wait,this.hold=s||this.hold,this.window=o||this.window,this._conn._changeConnectStatus(_i.ATTACHED,null)}_restore(e,t,n,r,i){const s=JSON.parse(sessionStorage.getItem("strophe-bosh-session"));if(!(null!=s&&s.rid&&s.sid&&s.jid&&(null==e||es(s.jid)===es(e)||null===Xi(e)&&Qi(s.jid)===e))){const e=new Error("_restore: no restoreable session.");throw e.name="StropheSessionError",e}this._conn.restored=!0,this._attach(s.jid,s.sid,s.rid,t,n,r,i)}_cacheSession(){this._conn.authenticated?this._conn.jid&&this.rid&&this.sid&&sessionStorage.setItem("strophe-bosh-session",JSON.stringify({jid:this._conn.jid,rid:this.rid,sid:this.sid})):sessionStorage.removeItem("strophe-bosh-session")}_connect_cb(e){const t=e.getAttribute("type");if(null!==t&&"terminate"===t){let t=e.getAttribute("condition");ji.error("BOSH-Connection failed: "+t);const n=e.getElementsByTagName("conflict");return null!==t?("remote-stream-error"===t&&n.length>0&&(t="conflict"),this._conn._changeConnectStatus(_i.CONNFAIL,t)):this._conn._changeConnectStatus(_i.CONNFAIL,"unknown"),this._conn._doDisconnect(t),_i.CONNFAIL}this.sid||(this.sid=e.getAttribute("sid"));const n=e.getAttribute("requests");n&&(this.window=parseInt(n,10));const r=e.getAttribute("hold");r&&(this.hold=parseInt(r,10));const i=e.getAttribute("wait");i&&(this.wait=parseInt(i,10));const s=e.getAttribute("inactivity");s&&(this.inactivity=parseInt(s,10))}_disconnect(e){this._sendTerminate(e)}_doDisconnect(){this.sid=null,this.rid=Math.floor(4294967295*Math.random()),this._conn._sessionCachingSupported()&&sessionStorage.removeItem("strophe-bosh-session"),this._conn.nextValidRid(this.rid)}_emptyQueue(){return 0===this._requests.length}_callProtocolErrorHandlers(e){const t=gs._getRequestStatus(e),n=this._conn.protocolErrorHandlers.HTTP[t];n&&n.call(this,t)}_hitError(e){this.errors++,ji.warn("request errored, status: "+e+", number of errors: "+this.errors),this.errors>4&&this._conn._onDisconnectTimeout()}_no_auth_received(e){ji.warn("Server did not yet offer a supported authentication mechanism. Sending a blank poll request."),e=e?e.bind(this._conn):this._conn._connect_cb.bind(this._conn);const t=this._buildBody();this._requests.push(new fs(t.tree(),this._onRequestStateChange.bind(this,e),Number(t.tree().getAttribute("rid")))),this._throttledRequestHandler()}_onDisconnectTimeout(){this._abortAllRequests()}_abortAllRequests(){for(;this._requests.length>0;){const e=this._requests.pop();e.abort=!0,e.xhr.abort(),e.xhr.onreadystatechange=function(){}}}_onIdle(){const e=this._conn._data;if(this._conn.authenticated&&0===this._requests.length&&0===e.length&&!this._conn.disconnecting&&(ji.debug("no requests during idle cycle, sending blank request"),e.push(null)),!this._conn.paused){if(this._requests.length<2&&e.length>0){co