@element-hq/element-call-embedded 0.19.0-rc2 → 0.19.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,5 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./index-1UwnBL6q.js","./matrix-sdk-crypto-wasm-DF8P9UDp.js"])))=>i.map(i=>d[i]);
2
- try{let t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},e=new t.Error().stack;e&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[e]="34d846e7-c629-41da-8bde-b71202bacc1f",t._sentryDebugIdIdentifier="sentry-dbid-34d846e7-c629-41da-8bde-b71202bacc1f")}catch{}function Qge(t,e){for(var n=0;n<e.length;n++){const r=e[n];if(typeof r!="string"&&!Array.isArray(r)){for(const i in r)if(i!=="default"&&!(i in t)){const s=Object.getOwnPropertyDescriptor(r,i);s&&Object.defineProperty(t,i,s.get?s:{enumerable:!0,get:()=>r[i]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}{let t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{};t.SENTRY_RELEASE={id:"embedded-v0.19.0-rc2"}}(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const s of i)if(s.type==="childList")for(const o of s.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&r(o)}).observe(document,{childList:!0,subtree:!0});function n(i){const s={};return i.integrity&&(s.integrity=i.integrity),i.referrerPolicy&&(s.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?s.credentials="include":i.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function r(i){if(i.ep)return;i.ep=!0;const s=n(i);fetch(i.href,s)}})();function Dl(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function cat(t){if(Object.prototype.hasOwnProperty.call(t,"__esModule"))return t;var e=t.default;if(typeof e=="function"){var n=function r(){var i=!1;try{i=this instanceof r}catch{}return i?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};n.prototype=e.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(t).forEach(function(r){var i=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(n,r,i.get?i:{enumerable:!0,get:function(){return t[r]}})}),n}var WI={exports:{}},N0={};var YF;function Zge(){if(YF)return N0;YF=1;var t=Symbol.for("react.transitional.element"),e=Symbol.for("react.fragment");function n(r,i,s){var o=null;if(s!==void 0&&(o=""+s),i.key!==void 0&&(o=""+i.key),"key"in i){s={};for(var a in i)a!=="key"&&(s[a]=i[a])}else s=i;return i=s.ref,{$$typeof:t,type:r,key:o,ref:i!==void 0?i:null,props:s}}return N0.Fragment=e,N0.jsx=n,N0.jsxs=n,N0}var JF;function eve(){return JF||(JF=1,WI.exports=Zge()),WI.exports}var S=eve();function XF(t,e,n,r,i,s,o){try{var a=t[s](o),c=a.value}catch(l){return void n(l)}a.done?e(c):Promise.resolve(c).then(r,i)}function B(t){return function(){var e=this,n=arguments;return new Promise(function(r,i){var s=t.apply(e,n);function o(c){XF(s,r,i,o,a,"next",c)}function a(c){XF(s,r,i,o,a,"throw",c)}o(void 0)})}}function Ib(t){"@babel/helpers - typeof";return Ib=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ib(t)}function tve(t,e){if(Ib(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(Ib(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function nve(t){var e=tve(t,"string");return Ib(e)=="symbol"?e:e+""}function L(t,e,n){return(e=nve(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}const rve="l",ive="rn",sve={0:"O",1:"l","֭":"֖","֮":"֘","֨":"֙","֤":"֚","᪴":"ۛ","⃛":"ۛ","ؙ":"̓","ࣳ":"̓","̓":"̓","̕":"̓","ُ":"̓","ٝ":"̔","֜":"́","֝":"́","ؘ":"́","݇":"́","́":"́","॔":"́","َ":"́","̀":"̀","॓":"̀","̌":"̆","꙼":"̆","٘":"̆","ٚ":"̆","ͮ":"̆","ۨ":"̆̇","̐":"̆̇","ँ":"̆̇","ঁ":"̆̇","ઁ":"̆̇","ଁ":"̆̇","ఀ":"̆̇","ಁ":"̆̇","ഁ":"̆̇","𑒿":"̆̇","᳐":"̂","̑":"̂","ٛ":"̂","߮":"̂","꛰":"̂","֯":"̊","۟":"̊","៓":"̊","゚":"̊","ْ":"̊","ஂ":"̊","ံ":"̊","ំ":"̊","𑌀":"̊","ํ":"̊","ໍ":"̊","ͦ":"̊","ⷪ":"̊","࣫":"̈","߳":"̈","ً":"̋","ࣰ":"̋","͂":"̃","ٓ":"̃","ׄ":"̇","۬":"̇","݀":"̇","࣪":"̇","݁":"̇","͘":"̇","ֹ":"̇","ֺ":"̇","ׂ":"̇","ׁ":"̇","߭":"̇","ं":"̇","ਂ":"̇","ં":"̇","்":"̇","̷":"̸","᪷":"̨","̢":"̨","ͅ":"̨","᳒":"̄","̅":"̄","ٙ":"̄","߫":"̄","꛱":"̄","᳚":"̎","ٗ":"̒","͗":"͐","ࣿ":"͐","ࣸ":"͐","ऀ":"͒","᳭":"̖","᳜":"̩","ٖ":"̩","᳕":"̫","͇":"̳","ࣹ":"͔","ࣺ":"͕","゛":"゙","゜":"゚","̶":"̵","〬":"̉","ׅ":"̣","࣭":"̣","᳝":"̣","ִ":"̣","ٜ":"̣","़":"̣","়":"̣","਼":"̣","઼":"̣","଼":"̣","𑇊":"̣","𑓃":"̣","𐨺":"̣","࣮":"̤","᳞":"̤","༷":"̥","〭":"̥","̧":"̦","̡":"̦","̹":"̦","᳙":"̭","᳘":"̮","॒":"̱","̠":"̱","ࣱ":"ٌ","ࣨ":"ٌ","ࣥ":"ٌ",ﱞ:"ﹲّ","ࣲ":"ٍ",ﱟ:"ﹴّ",ﳲ:"ﹷّ",ﱠ:"ﹶّ",ﳳ:"ﹹّ",ﱡ:"ﹸّ","ؚ":"ِ","̗":"ِ",ﳴ:"ﹻّ",ﱢ:"ﹺّ",ﱣ:"ﹼٰ","ٟ":"ٕ","̍":"ٰ","݂":"ܼ","ਃ":"ঃ","ః":"ঃ","ಃ":"ঃ","ഃ":"ঃ","ඃ":"ঃ","း":"ঃ","𑓁":"ঃ","់":"่","່":"่","້":"้","໊":"๊","໋":"๋","꙯":"⃩","\u2028":" ","\u2029":" "," ":" "," ":" "," ":" "," ":" "," ":" "," ":" "," ":" "," ":" "," ":" "," ":" "," ":" "," ":" "," ":" "," ":" "," ":" ","ߺ":"_","﹍":"_","﹎":"_","﹏":"_","‐":"-","‑":"-","‒":"-","–":"-","﹘":"-","۔":"-","⁃":"-","˗":"-","−":"-","➖":"-","Ⲻ":"-","⨩":"-̓","⸚":"-̈","﬩":"-̇","∸":"-̇","⨪":"-̣","꓾":"-.","~":"〜","؍":",","٫":",","‚":",","¸":",","ꓹ":",","⸲":"،","٬":"،",";":";","⸵":"؛","ः":":","ઃ":":",":":":","։":":","܃":":","܄":":","᛬":":","︰":":","᠃":":","᠉":":","⁚":":","׃":":","˸":":","꞉":":","∶":":",ː:":","ꓽ":":","⩴":"::=","⧴":":→","!":"!",ǃ:"!","ⵑ":"!","‼":"!!","⁉":"!?",ʔ:"?","Ɂ":"?","ॽ":"?",Ꭾ:"?","ꛫ":"?","⁈":"?!","⁇":"??","⸮":"؟","𝅭":".","․":".","܁":".","܂":".","꘎":".","𐩐":".","٠":".","۰":".","ꓸ":".","ꓻ":".,","‥":"..","ꓺ":"..","…":"...","꛴":"꛳꛳","・":"·","・":"·","᛫":"·","·":"·","⸱":"·","𐄁":"·","•":"·","‧":"·","∙":"·","⋅":"·","ꞏ":"·",ᐧ:"·","⋯":"···","ⵈ":"···",ᑄ:"·<","⋗":"·>",ᐷ:"·>",ᑀ:"·>",ᔯ:"·4",ᑾ:"·b",ᒀ:"·ḃ",ᑺ:"·d",ᒘ:"·J",ᒶ:"·L",ᑶ:"·P",ᑗ:"·U",ᐺ:"·V",ᐼ:"·Ʌ",ᒮ:"·Γ",ᐎ:"·Δ",ᑙ:"·Ո",ᐌ:"·ᐁ",ᐐ:"·ᐄ",ᐒ:"·ᐅ",ᐔ:"·ᐆ",ᐗ:"·ᐊ",ᐙ:"·ᐋ",ᐾ:"·ᐲ",ᑂ:"·ᐴ",ᑆ:"·ᐹ",ᑛ:"·ᑏ",ᑔ:"·ᑐ",ᑝ:"·ᑐ",ᑟ:"·ᑑ",ᑡ:"·ᑕ",ᑣ:"·ᑖ",ᑴ:"·ᑫ",ᑸ:"·ᑮ",ᑼ:"·ᑰ",ᒒ:"·ᒉ",ᒔ:"·ᒋ",ᒖ:"·ᒌ",ᒚ:"·ᒎ",ᒜ:"·ᒐ",ᒞ:"·ᒑ",ᒬ:"·ᒣ",ᒰ:"·ᒦ",ᒲ:"·ᒧ",ᒴ:"·ᒨ",ᒸ:"·ᒫ",ᓉ:"·ᓀ","ᣆ":"·ᓂ","ᣈ":"·ᓃ","ᣊ":"·ᓄ","ᣌ":"·ᓅ",ᓋ:"·ᓇ",ᓍ:"·ᓈ",ᓜ:"·ᓓ",ᓞ:"·ᓕ",ᓠ:"·ᓖ",ᓢ:"·ᓗ",ᓤ:"·ᓘ",ᓦ:"·ᓚ",ᓨ:"·ᓛ",ᓶ:"·ᓭ",ᓸ:"·ᓯ",ᓺ:"·ᓰ",ᓼ:"·ᓱ",ᓾ:"·ᓲ",ᔀ:"·ᓴ",ᔂ:"·ᓵ",ᔗ:"·ᔐ",ᔙ:"·ᔑ",ᔛ:"·ᔒ",ᔝ:"·ᔓ",ᔟ:"·ᔔ",ᔡ:"·ᔕ",ᔣ:"·ᔖ",ᔱ:"·ᔨ",ᔳ:"·ᔩ",ᔵ:"·ᔪ",ᔷ:"·ᔫ",ᔹ:"·ᔭ",ᔻ:"·ᔮ","ᣎ":"·ᕃ","ᣏ":"·ᕆ","ᣐ":"·ᕇ","ᣑ":"·ᕈ","ᣒ":"·ᕉ","ᣓ":"·ᕋ",ᕎ:"·ᕌ",ᕛ:"·ᕚ",ᕨ:"·ᕧ","ᢳ":"·ᢱ","ᢶ":"·ᢴ","ᢹ":"·ᢸ","ᣂ":"·ᣀ","꠰":"।","॥":"।।","᰼":"᰻᰻","။":"၊၊","᪩":"᪨᪨","᪫":"᪪᪨","᭟":"᭞᭞","𐩗":"𐩖𐩖","𑑌":"𑑋𑑋","𑙂":"𑙁𑙁","𑱂":"𑱁𑱁","᱿":"᱾᱾","՝":"'","'":"'","‘":"'","’":"'","‛":"'","′":"'","‵":"'","՚":"'","׳":"'","`":"'","`":"'","`":"'","´":"'","΄":"'","´":"'","᾽":"'","᾿":"'","῾":"'","ʹ":"'","ʹ":"'","ˈ":"'","ˊ":"'","ˋ":"'","˴":"'",ʻ:"'",ʽ:"'",ʼ:"'",ʾ:"'","ꞌ":"'",י:"'","ߴ":"'","ߵ":"'",ᑊ:"'",ᛌ:"'","𖽑":"'","𖽒":"'","᳓":"''",'"':"''",""":"''","“":"''","”":"''","‟":"''","″":"''","‶":"''","〃":"''","״":"''","˝":"''","ʺ":"''","˶":"''",ˮ:"''",ײ:"''","‴":"'''","‷":"'''","⁗":"''''",Ɓ:"'B",Ɗ:"'D",ʼn:"'n",Ƥ:"'P",Ƭ:"'T",Ƴ:"'Y","[":"(","❨":"(","❲":"(","〔":"(","﴾":"(","⸨":"((","㈠":"(ー)","⑵":"(2)","⒇":"(2O)","⑶":"(3)","⑷":"(4)","⑸":"(5)","⑹":"(6)","⑺":"(7)","⑻":"(8)","⑼":"(9)","⒜":"(a)","🄐":"(A)","⒝":"(b)","🄑":"(B)","⒞":"(c)","🄒":"(C)","⒟":"(d)","🄓":"(D)","⒠":"(e)","🄔":"(E)","⒡":"(f)","🄕":"(F)","⒢":"(g)","🄖":"(G)","⒣":"(h)","🄗":"(H)","⒤":"(i)","⒥":"(j)","🄙":"(J)","⒦":"(k)","🄚":"(K)","⑴":"(l)","🄘":"(l)","⒧":"(l)","🄛":"(L)","⑿":"(l2)","⒀":"(l3)","⒁":"(l4)","⒂":"(l5)","⒃":"(l6)","⒄":"(l7)","⒅":"(l8)","⒆":"(l9)","⑾":"(ll)","⑽":"(lO)","🄜":"(M)","⒩":"(n)","🄝":"(N)","⒪":"(o)","🄞":"(O)","⒫":"(p)","🄟":"(P)","⒬":"(q)","🄠":"(Q)","⒭":"(r)","🄡":"(R)","⒨":"(rn)","⒮":"(s)","🄢":"(S)","🄪":"(S)","⒯":"(t)","🄣":"(T)","⒰":"(u)","🄤":"(U)","⒱":"(v)","🄥":"(V)","⒲":"(w)","🄦":"(W)","⒳":"(x)","🄧":"(X)","⒴":"(y)","🄨":"(Y)","⒵":"(z)","🄩":"(Z)","㈀":"(ᄀ)","㈎":"(가)","㈁":"(ᄂ)","㈏":"(나)","㈂":"(ᄃ)","㈐":"(다)","㈃":"(ᄅ)","㈑":"(라)","㈄":"(ᄆ)","㈒":"(마)","㈅":"(ᄇ)","㈓":"(바)","㈆":"(ᄉ)","㈔":"(사)","㈇":"(ᄋ)","㈕":"(아)","㈝":"(오전)","㈞":"(오후)","㈈":"(ᄌ)","㈖":"(자)","㈜":"(주)","㈉":"(ᄎ)","㈗":"(차)","㈊":"(ᄏ)","㈘":"(카)","㈋":"(ᄐ)","㈙":"(타)","㈌":"(ᄑ)","㈚":"(파)","㈍":"(ᄒ)","㈛":"(하)","㈦":"(七)","㈢":"(三)","🉁":"(三)","㈨":"(九)","㈡":"(二)","🉂":"(二)","㈤":"(五)","㈹":"(代)","㈽":"(企)","㉁":"(休)","㈧":"(八)","㈥":"(六)","㈸":"(労)","🉇":"(勝)","㈩":"(十)","㈿":"(協)","㈴":"(名)","㈺":"(呼)","㈣":"(四)","㈯":"(土)","㈻":"(学)","🉃":"(安)","🉅":"(打)","🉈":"(敗)","㈰":"(日)","㈪":"(月)","㈲":"(有)","㈭":"(木)","🉀":"(本)","㈱":"(株)","㈬":"(水)","㈫":"(火)","🉄":"(点)","㈵":"(特)","🉆":"(盗)","㈼":"(監)","㈳":"(社)","㈷":"(祝)","㉀":"(祭)","㉂":"(自)","㉃":"(至)","㈶":"(財)","㈾":"(資)","㈮":"(金)","]":")","❩":")","❳":")","〕":")","﴿":")","⸩":"))","❴":"{","𝄔":"{","❵":"}","〚":"⟦","〛":"⟧","⟨":"❬","〈":"❬","〈":"❬","㇛":"❬",く:"❬","𡿨":"❬","⟩":"❭","〉":"❭","〉":"❭","^":"︿","⸿":"¶","⁎":"*","٭":"*","∗":"*","𐌟":"*","᜵":"/","⁁":"/","∕":"/","⁄":"/","╱":"/","⟋":"/","⧸":"/","𝈺":"/","㇓":"/",〳:"/","Ⳇ":"/",ノ:"/",丿:"/","⼃":"/","⧶":"/̄","⫽":"//","⫻":"///","\":"\\","﹨":"\\","∖":"\\","⟍":"\\","⧵":"\\","⧹":"\\","𝈏":"\\","𝈻":"\\","㇔":"\\",丶:"\\","⼂":"\\","⳹":"\\\\","⑊":"\\\\","⟈":"\\ᑕ","ꝸ":"&","૰":"॰","𑂻":"॰","𑇇":"॰","⚬":"॰","𑇛":"꣼","៙":"๏","៕":"๚","៚":"๛","༌":"་","༎":"།།","˄":"^","ˆ":"^","꙾":"ˇ","˘":"ˇ","‾":"ˉ","﹉":"ˉ","﹊":"ˉ","﹋":"ˉ","﹌":"ˉ","¯":"ˉ"," ̄":"ˉ","▔":"ˉ",ъ:"ˉb","ꙑ":"ˉbi","͵":"ˏ","˻":"˪","꜖":"˪","꜔":"˫","。":"˳","⸰":"°","˚":"°","∘":"°","○":"°","◦":"°","⍜":"°̲","⍤":"°̈","℃":"°C","℉":"°F","௵":"௳","༛":"༚༚","༟":"༚༝","࿎":"༝༚","༞":"༝༝","Ⓒ":"©","Ⓡ":"®","Ⓟ":"℗","𝈛":"⅄","⯬":"↞","⯭":"↟","⯮":"↠","⯯":"↡","↵":"↲","⥥":"⇃⇂","⥯":"⇃ᛚ","𝛛":"∂","𝜕":"∂","𝝏":"∂","𝞉":"∂","𝟃":"∂","𞣌":"∂","𞣍":"∂̵",ð:"∂̵","⌀":"∅","𝛁":"∇","𝛻":"∇","𝜵":"∇","𝝯":"∇","𝞩":"∇","𑢨":"∇","⍢":"∇̈","⍫":"∇̴","█":"∎","■":"∎","⨿":"∐","᛭":"+","➕":"+","𐊛":"+","⨣":"+̂","⨢":"+̊","⨤":"+̃","∔":"+̇","⨥":"+̣","⨦":"+̰","⨧":"+₂","➗":"÷","‹":"<","❮":"<","˂":"<","𝈶":"<",ᐸ:"<",ᚲ:"<","⋖":"<·","Ⲵ":"<·",ᑅ:"<·","≪":"<<","⋘":"<<<","᐀":"=","⹀":"=","゠":"=","꓿":"=","≚":"=̆","≙":"=̂","≗":"=̊","≐":"=̇","≑":"=̣̇","⩮":"=⃰","⩵":"==","⩶":"===","≞":"=ͫ","›":">","❯":">","˃":">","𝈷":">",ᐳ:">","𖼿":">",ᑁ:">·","⪥":"><","≫":">>","⨠":">>","⋙":">>>","⁓":"~","˜":"~","῀":"~","∼":"~","⍨":"~̈","⸞":"~̇","⩪":"~̇","⸟":"~̣","𞣈":"∠","⋀":"∧","∯":"∮∮","∰":"∮∮∮","⸫":"∴","⸪":"∵","⸬":"∷","𑇞":"≈","♎":"≏","🝞":"≏","≣":"≡","⨃":"⊍","⨄":"⊎","𝈸":"⊏","𝈹":"⊐","⨅":"⊓","⨆":"⊔","⨂":"⊗","⍟":"⊛","🝱":"⊠","🝕":"⊡","◁":"⊲","▷":"⊳","⍣":"⋆̈","︴":"⌇","◠":"⌒","⨽":"⌙","⌥":"⌤","⧇":"⌻","◎":"⌾","⦾":"⌾","⧅":"⍂","⦰":"⍉","⏃":"⍋","⏂":"⍎","⏁":"⍕","⏆":"⍭","☸":"⎈","︵":"⏜","︶":"⏝","︷":"⏞","︸":"⏟","︹":"⏠","︺":"⏡","▱":"⏥","⏼":"⏻","︱":"│","|":"│","┃":"│","┏":"┌","┣":"├","▐":"▌","▗":"▖","▝":"▘","☐":"□","■":"▪","▸":"▶","►":"▶","⳩":"☧","🜊":"☩","🌒":"☽","🌙":"☽","⏾":"☾","🌘":"☾","⧙":"⦚","🜺":"⧟","⨾":"⨟","𐆠":"⳨","♩":"𝅘𝅥","♪":"𝅘𝅥𝅮","⓪":"🄍","↺":"🄎","˙":"ॱ","ൎ":"ॱ","-":"ー","—":"ー","―":"ー","─":"ー","━":"ー","㇐":"ー","ꟷ":"ー",ᅳ:"ー",ㅡ:"ー",一:"ー","⼀":"ー",ᆖ:"ーー","ힹ":"ーᅡ","ힺ":"ーᅥ","ힻ":"ーᅥ丨","ힼ":"ーᅩ",ᆕ:"ーᅮ",ᅴ:"ー丨",ㅢ:"ー丨",ᆗ:"ー丨ᅮ","🄏":"$⃠","₤":"£","〒":"₸","〶":"₸","᭜":"᭐","꧆":"꧐","𑓑":"১","೧":"౧","ၥ":"၁","①":"➀","⑩":"➉","⏨":"₁₀","𝟐":"2","𝟚":"2","𝟤":"2","𝟮":"2","𝟸":"2","🯲":"2","Ꝛ":"2",Ƨ:"2",Ϩ:"2","Ꙅ":"2",ᒿ:"2","ꛯ":"2","ꧏ":"٢","۲":"٢","૨":"२","𑓒":"২","೨":"౨","②":"➁",ƻ:"2̵","🄃":"2,","⒉":"2.","㏵":"22日","㍮":"22点","㏶":"23日","㍯":"23点","㏷":"24日","㍰":"24点","㏸":"25日","㏹":"26日","㏺":"27日","㏻":"28日","㏼":"29日","㏴":"2l日","㍭":"2l点","⒛":"2O.","㏳":"2O日","㍬":"2O点","෩":"෨ා","෯":"෨ී","㏡":"2日","㋁":"2月","㍚":"2点","𝈆":"3","𝟑":"3","𝟛":"3","𝟥":"3","𝟯":"3","𝟹":"3","🯳":"3","Ɜ":"3",Ȝ:"3",Ʒ:"3","Ꝫ":"3","Ⳍ":"3",З:"3",Ӡ:"3","𖼻":"3","𑣊":"3","۳":"٣","𞣉":"٣","૩":"३","③":"➂",Ҙ:"3̦","🄄":"3,","⒊":"3.","㏾":"3l日","㏽":"3O日","㏢":"3日","㋂":"3月","㍛":"3点","𝟒":"4","𝟜":"4","𝟦":"4","𝟰":"4","𝟺":"4","🯴":"4",Ꮞ:"4","𑢯":"4","۴":"٤","૪":"४","④":"➃","🄅":"4,","⒋":"4.",ᔰ:"4·","㏣":"4日","㋃":"4月","㍜":"4点","𝟓":"5","𝟝":"5","𝟧":"5","𝟱":"5","𝟻":"5","🯵":"5",Ƽ:"5","𑢻":"5","⑤":"➄","🄆":"5,","⒌":"5.","㏤":"5日","㋄":"5月","㍝":"5点","𝟔":"6","𝟞":"6","𝟨":"6","𝟲":"6","𝟼":"6","🯶":"6","Ⳓ":"6",б:"6",Ꮾ:"6","𑣕":"6","۶":"٦","𑓖":"৬","⑥":"➅","🄇":"6,","⒍":"6.","㏥":"6日","㋅":"6月","㍞":"6点","𝈒":"7","𝟕":"7","𝟟":"7","𝟩":"7","𝟳":"7","𝟽":"7","🯷":"7","𐓒":"7","𑣆":"7","⑦":"➆","🄈":"7,","⒎":"7.","㏦":"7日","㋆":"7月","㍟":"7点","ଃ":"8","৪":"8","੪":"8","𞣋":"8","𝟖":"8","𝟠":"8","𝟪":"8","𝟴":"8","𝟾":"8","🯸":"8",ȣ:"8",Ȣ:"8","𐌚":"8","૮":"८","⑧":"➇","🄉":"8,","⒏":"8.","㏧":"8日","㋇":"8月","㍠":"8点","੧":"9","୨":"9","৭":"9","൭":"9","𝟗":"9","𝟡":"9","𝟫":"9","𝟵":"9","𝟿":"9","🯹":"9","Ꝯ":"9","Ⳋ":"9","𑣌":"9","𑢬":"9","𑣖":"9","१":"٩","𑣤":"٩","۹":"٩","೯":"౯","⑨":"➈","🄊":"9,","⒐":"9.","㏨":"9日","㋈":"9月","㍡":"9点","⍺":"a",a:"a","𝐚":"a","𝑎":"a","𝒂":"a","𝒶":"a","𝓪":"a","𝔞":"a","𝕒":"a","𝖆":"a","𝖺":"a","𝗮":"a","𝘢":"a","𝙖":"a","𝚊":"a",ɑ:"a",α:"a","𝛂":"a","𝛼":"a","𝜶":"a","𝝰":"a","𝞪":"a",а:"a","ⷶ":"ͣ",A:"A","𝐀":"A","𝐴":"A","𝑨":"A","𝒜":"A","𝓐":"A","𝔄":"A","𝔸":"A","𝕬":"A","𝖠":"A","𝗔":"A","𝘈":"A","𝘼":"A","𝙰":"A",Α:"A","𝚨":"A","𝛢":"A","𝜜":"A","𝝖":"A","𝞐":"A",А:"A",Ꭺ:"A",ᗅ:"A","ꓮ":"A","𖽀":"A","𐊠":"A","⍶":"a̲",ǎ:"ă",Ǎ:"Ă",ȧ:"å",Ȧ:"Å",ẚ:"ả","℀":"a/c","℁":"a/s","ꜳ":"aa","Ꜳ":"AA",æ:"ae",ӕ:"ae",Æ:"AE",Ӕ:"AE","ꜵ":"ao","Ꜵ":"AO","🜇":"AR","ꜷ":"au","Ꜷ":"AU","ꜹ":"av","ꜻ":"av","Ꜹ":"AV","Ꜻ":"AV","ꜽ":"ay","Ꜽ":"AY","ꭺ":"ᴀ","∀":"Ɐ","𝈗":"Ɐ",ᗄ:"Ɐ","ꓯ":"Ɐ","𐐟":"Ɒ","𝐛":"b","𝑏":"b","𝒃":"b","𝒷":"b","𝓫":"b","𝔟":"b","𝕓":"b","𝖇":"b","𝖻":"b","𝗯":"b","𝘣":"b","𝙗":"b","𝚋":"b",Ƅ:"b",Ь:"b",Ꮟ:"b",ᑲ:"b",ᖯ:"b",B:"B",ℬ:"B","𝐁":"B","𝐵":"B","𝑩":"B","𝓑":"B","𝔅":"B","𝔹":"B","𝕭":"B","𝖡":"B","𝗕":"B","𝘉":"B","𝘽":"B","𝙱":"B","Ꞵ":"B",Β:"B","𝚩":"B","𝛣":"B","𝜝":"B","𝝗":"B","𝞑":"B",В:"B",Ᏼ:"B",ᗷ:"B","ꓐ":"B","𐊂":"B","𐊡":"B","𐌁":"B",ɓ:"b̔",ᑳ:"ḃ",ƃ:"b̄",Ƃ:"b̄",Б:"b̄",ƀ:"b̵",ҍ:"b̵",Ҍ:"b̵",ѣ:"b̵",Ѣ:"b̵",ᑿ:"b·",ᒁ:"ḃ·",ᒈ:"b'",Ы:"bl",в:"ʙ","ᏼ":"ʙ",c:"c","ⅽ":"c","𝐜":"c","𝑐":"c","𝒄":"c","𝒸":"c","𝓬":"c","𝔠":"c","𝕔":"c","𝖈":"c","𝖼":"c","𝗰":"c","𝘤":"c","𝙘":"c","𝚌":"c","ᴄ":"c",ϲ:"c","ⲥ":"c",с:"c","ꮯ":"c","𐐽":"c","ⷭ":"ͨ","🝌":"C","𑣲":"C","𑣩":"C",C:"C","Ⅽ":"C",ℂ:"C",ℭ:"C","𝐂":"C","𝐶":"C","𝑪":"C","𝒞":"C","𝓒":"C","𝕮":"C","𝖢":"C","𝗖":"C","𝘊":"C","𝘾":"C","𝙲":"C","Ϲ":"C","Ⲥ":"C",С:"C",Ꮯ:"C","ꓚ":"C","𐊢":"C","𐌂":"C","𐐕":"C","𐔜":"C","¢":"c̸","ȼ":"c̸","₡":"C⃫","🅮":"C⃠",ç:"c̦",ҫ:"c̦",Ç:"C̦",Ҫ:"C̦",Ƈ:"C'","℅":"c/o","℆":"c/u","🅭":"㏄ ⃝","⋴":"ꞓ",ɛ:"ꞓ",ε:"ꞓ","ϵ":"ꞓ","𝛆":"ꞓ","𝛜":"ꞓ","𝜀":"ꞓ","𝜖":"ꞓ","𝜺":"ꞓ","𝝐":"ꞓ","𝝴":"ꞓ","𝞊":"ꞓ","𝞮":"ꞓ","𝟄":"ꞓ","ⲉ":"ꞓ",є:"ꞓ","ԑ":"ꞓ","ꮛ":"ꞓ","𑣎":"ꞓ","𐐩":"ꞓ","€":"Ꞓ","Ⲉ":"Ꞓ",Є:"Ꞓ","⍷":"ꞓ̲","ͽ":"ꜿ","Ͽ":"Ꜿ","ⅾ":"d","ⅆ":"d","𝐝":"d","𝑑":"d","𝒅":"d","𝒹":"d","𝓭":"d","𝔡":"d","𝕕":"d","𝖉":"d","𝖽":"d","𝗱":"d","𝘥":"d","𝙙":"d","𝚍":"d","ԁ":"d",Ꮷ:"d",ᑯ:"d","ꓒ":"d","Ⅾ":"D","ⅅ":"D","𝐃":"D","𝐷":"D","𝑫":"D","𝒟":"D","𝓓":"D","𝔇":"D","𝔻":"D","𝕯":"D","𝖣":"D","𝗗":"D","𝘋":"D","𝘿":"D","𝙳":"D",Ꭰ:"D",ᗞ:"D",ᗪ:"D","ꓓ":"D",ɗ:"d̔",ɖ:"d̨",ƌ:"d̄",đ:"d̵",Đ:"D̵",Ð:"D̵",Ɖ:"D̵","₫":"ḏ̵","ꝺ":"Ꝺ",ᑻ:"d·",ᒇ:"d'",ʤ:"dȝ",dz:"dz",ʣ:"dz",Dz:"Dz",DZ:"DZ",dž:"dž",Dž:"Dž",DŽ:"DŽ",ʥ:"dʑ","ꭰ":"ᴅ","⸹":"ẟ",δ:"ẟ","𝛅":"ẟ","𝛿":"ẟ","𝜹":"ẟ","𝝳":"ẟ","𝞭":"ẟ",ծ:"ẟ",ᕷ:"ẟ","℮":"e",e:"e",ℯ:"e","ⅇ":"e","𝐞":"e","𝑒":"e","𝒆":"e","𝓮":"e","𝔢":"e","𝕖":"e","𝖊":"e","𝖾":"e","𝗲":"e","𝘦":"e","𝙚":"e","𝚎":"e","ꬲ":"e",е:"e",ҽ:"e","ⷷ":"ͤ","⋿":"E",E:"E",ℰ:"E","𝐄":"E","𝐸":"E","𝑬":"E","𝓔":"E","𝔈":"E","𝔼":"E","𝕰":"E","𝖤":"E","𝗘":"E","𝘌":"E","𝙀":"E","𝙴":"E",Ε:"E","𝚬":"E","𝛦":"E","𝜠":"E","𝝚":"E","𝞔":"E",Е:"E","ⴹ":"E",Ꭼ:"E","ꓰ":"E","𑢦":"E","𑢮":"E","𐊆":"E",ě:"ĕ",Ě:"Ĕ","ɇ":"e̸","Ɇ":"E̸",ҿ:"ę","ꭼ":"ᴇ",ə:"ǝ",ә:"ǝ","∃":"Ǝ","ⴺ":"Ǝ","ꓱ":"Ǝ",ɚ:"ǝ˞","ᴔ":"ǝo","ꭁ":"ǝo̸","ꭂ":"ǝo̵",Ә:"Ə","𝈡":"Ɛ",ℇ:"Ɛ","Ԑ":"Ɛ",Ꮛ:"Ɛ","𖼭":"Ɛ","𐐁":"Ɛ","ᶟ":"ᵋ","ᴈ":"ɜ",з:"ɜ",ҙ:"ɜ̦","𐑂":"ɞ","ꞝ":"ʚ","𐐪":"ʚ","𝐟":"f","𝑓":"f","𝒇":"f","𝒻":"f","𝓯":"f","𝔣":"f","𝕗":"f","𝖋":"f","𝖿":"f","𝗳":"f","𝘧":"f","𝙛":"f","𝚏":"f","ꬵ":"f","ꞙ":"f",ſ:"f","ẝ":"f",ք:"f","𝈓":"F",ℱ:"F","𝐅":"F","𝐹":"F","𝑭":"F","𝓕":"F","𝔉":"F","𝔽":"F","𝕱":"F","𝖥":"F","𝗙":"F","𝘍":"F","𝙁":"F","𝙵":"F","Ꞙ":"F",Ϝ:"F","𝟊":"F",ᖴ:"F","ꓝ":"F","𑣂":"F","𑢢":"F","𐊇":"F","𐊥":"F","𐔥":"F",ƒ:"f̦",Ƒ:"F̦","ᵮ":"f̴","℻":"FAX",ff:"ff",ffi:"ffi",ffl:"ffl",fi:"fi",fl:"fl",ʩ:"fŋ",ᖵ:"Ⅎ","ꓞ":"Ⅎ","𝈰":"ꟻ",ᖷ:"ꟻ",g:"g",ℊ:"g","𝐠":"g","𝑔":"g","𝒈":"g","𝓰":"g","𝔤":"g","𝕘":"g","𝖌":"g","𝗀":"g","𝗴":"g","𝘨":"g","𝙜":"g","𝚐":"g",ɡ:"g","ᶃ":"g",ƍ:"g",ց:"g","𝐆":"G","𝐺":"G","𝑮":"G","𝒢":"G","𝓖":"G","𝔊":"G","𝔾":"G","𝕲":"G","𝖦":"G","𝗚":"G","𝘎":"G","𝙂":"G","𝙶":"G","Ԍ":"G",Ꮐ:"G",Ᏻ:"G","ꓖ":"G","ᶢ":"ᵍ",ɠ:"g̔",ǧ:"ğ",Ǧ:"Ğ",ǵ:"ģ",ǥ:"g̵",Ǥ:"G̵",Ɠ:"G'","ԍ":"ɢ","ꮐ":"ɢ","ᏻ":"ɢ",h:"h",ℎ:"h","𝐡":"h","𝒉":"h","𝒽":"h","𝓱":"h","𝔥":"h","𝕙":"h","𝖍":"h","𝗁":"h","𝗵":"h","𝘩":"h","𝙝":"h","𝚑":"h",һ:"h",հ:"h",Ꮒ:"h",H:"H",ℋ:"H",ℌ:"H",ℍ:"H","𝐇":"H","𝐻":"H","𝑯":"H","𝓗":"H","𝕳":"H","𝖧":"H","𝗛":"H","𝘏":"H","𝙃":"H","𝙷":"H",Η:"H","𝚮":"H","𝛨":"H","𝜢":"H","𝝜":"H","𝞖":"H","Ⲏ":"H",Н:"H",Ꮋ:"H",ᕼ:"H","ꓧ":"H","𐋏":"H","ᵸ":"ᴴ",ɦ:"h̔","ꚕ":"h̔",Ᏺ:"h̔","Ⱨ":"H̩",Ң:"H̩",ħ:"h̵",ℏ:"h̵",ћ:"h̵",Ħ:"H̵","Ӊ":"H̦",Ӈ:"H̦",н:"ʜ","ꮋ":"ʜ",ң:"ʜ̩","ӊ":"ʜ̦",ӈ:"ʜ̦","Ԋ":"Ƕ","ꮀ":"ⱶ","Ͱ":"Ⱶ",Ꭸ:"Ⱶ",Ꮀ:"Ⱶ","ꚱ":"Ⱶ","ꞕ":"ꜧ","˛":"i","⍳":"i",i:"i","ⅰ":"i",ℹ:"i","ⅈ":"i","𝐢":"i","𝑖":"i","𝒊":"i","𝒾":"i","𝓲":"i","𝔦":"i","𝕚":"i","𝖎":"i","𝗂":"i","𝗶":"i","𝘪":"i","𝙞":"i","𝚒":"i",ı:"i","𝚤":"i",ɪ:"i",ɩ:"i",ι:"i",ι:"i",ͺ:"i","𝛊":"i","𝜄":"i","𝜾":"i","𝝸":"i","𝞲":"i",і:"i","ꙇ":"i","ӏ":"i","ꭵ":"i",Ꭵ:"i","𑣃":"i","ⓛ":"Ⓘ","⍸":"i̲",ǐ:"ĭ",Ǐ:"Ĭ",ɨ:"i̵","ᵻ":"i̵","ᵼ":"i̵","ⅱ":"ii","ⅲ":"iii",ij:"ij","ⅳ":"iv","ⅸ":"ix",j:"j","ⅉ":"j","𝐣":"j","𝑗":"j","𝒋":"j","𝒿":"j","𝓳":"j","𝔧":"j","𝕛":"j","𝖏":"j","𝗃":"j","𝗷":"j","𝘫":"j","𝙟":"j","𝚓":"j",ϳ:"j",ј:"j",J:"J","𝐉":"J","𝐽":"J","𝑱":"J","𝒥":"J","𝓙":"J","𝔍":"J","𝕁":"J","𝕵":"J","𝖩":"J","𝗝":"J","𝘑":"J","𝙅":"J","𝙹":"J","Ʝ":"J","Ϳ":"J",Ј:"J",Ꭻ:"J",ᒍ:"J","ꓙ":"J","ɉ":"j̵","Ɉ":"J̵",ᒙ:"J·","𝚥":"ȷ",յ:"ȷ","ꭻ":"ᴊ","𝐤":"k","𝑘":"k","𝒌":"k","𝓀":"k","𝓴":"k","𝔨":"k","𝕜":"k","𝖐":"k","𝗄":"k","𝗸":"k","𝘬":"k","𝙠":"k","𝚔":"k",K:"K",K:"K","𝐊":"K","𝐾":"K","𝑲":"K","𝒦":"K","𝓚":"K","𝔎":"K","𝕂":"K","𝕶":"K","𝖪":"K","𝗞":"K","𝘒":"K","𝙆":"K","𝙺":"K",Κ:"K","𝚱":"K","𝛫":"K","𝜥":"K","𝝟":"K","𝞙":"K","Ⲕ":"K",К:"K",Ꮶ:"K",ᛕ:"K","ꓗ":"K","𐔘":"K",ƙ:"k̔","Ⱪ":"K̩",Қ:"K̩","₭":"K̵","Ꝁ":"K̵",Ҟ:"K̵",Ƙ:"K'","׀":"l","|":"l","∣":"l","⏽":"l","│":"l","١":"l","۱":"l","𐌠":"l","𞣇":"l","𝟏":"l","𝟙":"l","𝟣":"l","𝟭":"l","𝟷":"l","🯱":"l",I:rve,I:"l","Ⅰ":"l",ℐ:"l",ℑ:"l","𝐈":"l","𝐼":"l","𝑰":"l","𝓘":"l","𝕀":"l","𝕴":"l","𝖨":"l","𝗜":"l","𝘐":"l","𝙄":"l","𝙸":"l",Ɩ:"l",l:"l","ⅼ":"l",ℓ:"l","𝐥":"l","𝑙":"l","𝒍":"l","𝓁":"l","𝓵":"l","𝔩":"l","𝕝":"l","𝖑":"l","𝗅":"l","𝗹":"l","𝘭":"l","𝙡":"l","𝚕":"l",ǀ:"l",Ι:"l","𝚰":"l","𝛪":"l","𝜤":"l","𝝞":"l","𝞘":"l","Ⲓ":"l",І:"l",Ӏ:"l",ו:"l",ן:"l",ا:"l","𞸀":"l","𞺀":"l",ﺎ:"l",ﺍ:"l","ߊ":"l","ⵏ":"l",ᛁ:"l","ꓲ":"l","𖼨":"l","𐊊":"l","𐌉":"l","𝈪":"L","Ⅼ":"L",ℒ:"L","𝐋":"L","𝐿":"L","𝑳":"L","𝓛":"L","𝔏":"L","𝕃":"L","𝕷":"L","𝖫":"L","𝗟":"L","𝘓":"L","𝙇":"L","𝙻":"L","Ⳑ":"L",Ꮮ:"L",ᒪ:"L","ꓡ":"L","𖼖":"L","𑢣":"L","𑢲":"L","𐐛":"L","𐔦":"L",ﴼ:"l̋",ﴽ:"l̋",ł:"l̸",Ł:"L̸",ɭ:"l̨",Ɨ:"l̵",ƚ:"l̵",ɫ:"l̴",إ:"lٕ",ﺈ:"lٕ",ﺇ:"lٕ",ٳ:"lٕ",ŀ:"l·",Ŀ:"l·",ᒷ:"l·","🄂":"l,","⒈":"l.",ױ:"l'","⒓":"l2.","㏫":"l2日","㋋":"l2月","㍤":"l2点","⒔":"l3.","㏬":"l3日","㍥":"l3点","⒕":"l4.","㏭":"l4日","㍦":"l4点","⒖":"l5.","㏮":"l5日","㍧":"l5点","⒗":"l6.","㏯":"l6日","㍨":"l6点","⒘":"l7.","㏰":"l7日","㍩":"l7点","⒙":"l8.","㏱":"l8日","㍪":"l8点","⒚":"l9.","㏲":"l9日","㍫":"l9点",lj:"lj",IJ:"lJ",Lj:"Lj",LJ:"LJ","‖":"ll","∥":"ll","Ⅱ":"ll",ǁ:"ll",װ:"ll","𐆙":"l̵l̵","⒒":"ll.","Ⅲ":"lll","𐆘":"l̵l̵S̵","㏪":"ll日","㋊":"ll月","㍣":"ll点",Ю:"lO","⒑":"lO.","㏩":"lO日","㋉":"lO月","㍢":"lO点",ʪ:"ls","₶":"lt","Ⅳ":"lV","Ⅸ":"lX",ɮ:"lȝ",ʫ:"lz",أ:"lٴ",ﺄ:"lٴ",ﺃ:"lٴ",ٲ:"lٴ",ٵ:"lٴ",ﷳ:"lكبر",ﷲ:"lللّٰo","㏠":"l日","㋀":"l月","㍙":"l点","ⳑ":"ʟ","ꮮ":"ʟ","𐑃":"ʟ",M:"M","Ⅿ":"M",ℳ:"M","𝐌":"M","𝑀":"M","𝑴":"M","𝓜":"M","𝔐":"M","𝕄":"M","𝕸":"M","𝖬":"M","𝗠":"M","𝘔":"M","𝙈":"M","𝙼":"M",Μ:"M","𝚳":"M","𝛭":"M","𝜧":"M","𝝡":"M","𝞛":"M","Ϻ":"M","Ⲙ":"M",М:"M",Ꮇ:"M",ᗰ:"M",ᛖ:"M","ꓟ":"M","𐊰":"M","𐌑":"M","Ӎ":"M̦","🝫":"MB","ⷨ":"ᷟ","𝐧":"n","𝑛":"n","𝒏":"n","𝓃":"n","𝓷":"n","𝔫":"n","𝕟":"n","𝖓":"n","𝗇":"n","𝗻":"n","𝘯":"n","𝙣":"n","𝚗":"n",ո:"n",ռ:"n",N:"N",ℕ:"N","𝐍":"N","𝑁":"N","𝑵":"N","𝒩":"N","𝓝":"N","𝔑":"N","𝕹":"N","𝖭":"N","𝗡":"N","𝘕":"N","𝙉":"N","𝙽":"N",Ν:"N","𝚴":"N","𝛮":"N","𝜨":"N","𝝢":"N","𝞜":"N","Ⲛ":"N","ꓠ":"N","𐔓":"N","𐆎":"N̊",ɳ:"n̨",ƞ:"n̩",η:"n̩","𝛈":"n̩","𝜂":"n̩","𝜼":"n̩","𝝶":"n̩","𝞰":"n̩",Ɲ:"N̦","ᵰ":"n̴",nj:"nj",Nj:"Nj",NJ:"NJ","№":"No","ͷ":"ᴎ",и:"ᴎ","𐑍":"ᴎ",ņ:"ɲ","ం":"o","ಂ":"o","ം":"o","ං":"o","०":"o","੦":"o","૦":"o","௦":"o","౦":"o","೦":"o","൦":"o","๐":"o","໐":"o","၀":"o","٥":"o","۵":"o",o:"o",ℴ:"o","𝐨":"o","𝑜":"o","𝒐":"o","𝓸":"o","𝔬":"o","𝕠":"o","𝖔":"o","𝗈":"o","𝗼":"o","𝘰":"o","𝙤":"o","𝚘":"o","ᴏ":"o","ᴑ":"o","ꬽ":"o",ο:"o","𝛐":"o","𝜊":"o","𝝄":"o","𝝾":"o","𝞸":"o",σ:"o","𝛔":"o","𝜎":"o","𝝈":"o","𝞂":"o","𝞼":"o","ⲟ":"o",о:"o","ჿ":"o",օ:"o",ס:"o",ه:"o","𞸤":"o","𞹤":"o","𞺄":"o",ﻫ:"o",ﻬ:"o",ﻪ:"o",ﻩ:"o",ھ:"o",ﮬ:"o",ﮭ:"o",ﮫ:"o",ﮪ:"o",ہ:"o",ﮨ:"o",ﮩ:"o",ﮧ:"o",ﮦ:"o",ە:"o",ഠ:"o",ဝ:"o","𐓪":"o","𑣈":"o","𑣗":"o","𐐬":"o","߀":"O","০":"O","୦":"O","〇":"O","𑓐":"O","𑣠":"O","𝟎":"O","𝟘":"O","𝟢":"O","𝟬":"O","𝟶":"O","🯰":"O",O:"O","𝐎":"O","𝑂":"O","𝑶":"O","𝒪":"O","𝓞":"O","𝔒":"O","𝕆":"O","𝕺":"O","𝖮":"O","𝗢":"O","𝘖":"O","𝙊":"O","𝙾":"O",Ο:"O","𝚶":"O","𝛰":"O","𝜪":"O","𝝤":"O","𝞞":"O","Ⲟ":"O",О:"O",Օ:"O","ⵔ":"O",ዐ:"O",ଠ:"O","𐓂":"O","ꓳ":"O","𑢵":"O","𐊒":"O","𐊫":"O","𐐄":"O","𐔖":"O","⁰":"º","ᵒ":"º",ǒ:"ŏ",Ǒ:"Ŏ","ۿ":"ô",Ő:"Ö",ø:"o̸","ꬾ":"o̸",Ø:"O̸","ⵁ":"O̸",Ǿ:"Ó̸",ɵ:"o̵","ꝋ":"o̵",ө:"o̵",ѳ:"o̵","ꮎ":"o̵","ꮻ":"o̵","⊖":"O̵","⊝":"O̵","⍬":"O̵","𝈚":"O̵","🜔":"O̵",Ɵ:"O̵","Ꝋ":"O̵",θ:"O̵",ϑ:"O̵","𝛉":"O̵","𝛝":"O̵","𝜃":"O̵","𝜗":"O̵","𝜽":"O̵","𝝑":"O̵","𝝷":"O̵","𝞋":"O̵","𝞱":"O̵","𝟅":"O̵",Θ:"O̵","ϴ":"O̵","𝚯":"O̵","𝚹":"O̵","𝛩":"O̵","𝛳":"O̵","𝜣":"O̵","𝜭":"O̵","𝝝":"O̵","𝝧":"O̵","𝞗":"O̵","𝞡":"O̵",Ө:"O̵",Ѳ:"O̵","ⴱ":"O̵",Ꮎ:"O̵",Ꮻ:"O̵","ꭴ":"ơ",ﳙ:"oٰ","🄁":"O,","🄀":"O.",ơ:"o'",Ơ:"O'",Ꭴ:"O'","%":"º/₀","٪":"º/₀","⁒":"º/₀","‰":"º/₀₀","؉":"º/₀₀","‱":"º/₀₀₀","؊":"º/₀₀₀",œ:"oe",Œ:"OE",ɶ:"oᴇ","∞":"oo","ꝏ":"oo","ꚙ":"oo","Ꝏ":"OO","Ꚙ":"OO",ﳗ:"oج",ﱑ:"oج",ﳘ:"oم",ﱒ:"oم",ﶓ:"oمج",ﶔ:"oمم",ﱓ:"oى",ﱔ:"oى","ൟ":"oരo",တ:"oာ","㍘":"O点","ↄ":"ɔ","ᴐ":"ɔ","ͻ":"ɔ","𐑋":"ɔ","Ↄ":"Ɔ","Ͻ":"Ɔ","ꓛ":"Ɔ","𐐣":"Ɔ","ꬿ":"ɔ̸","ꭢ":"ɔe","𐐿":"ɷ","⍴":"p",p:"p","𝐩":"p","𝑝":"p","𝒑":"p","𝓅":"p","𝓹":"p","𝔭":"p","𝕡":"p","𝖕":"p","𝗉":"p","𝗽":"p","𝘱":"p","𝙥":"p","𝚙":"p",ρ:"p",ϱ:"p","𝛒":"p","𝛠":"p","𝜌":"p","𝜚":"p","𝝆":"p","𝝔":"p","𝞀":"p","𝞎":"p","𝞺":"p","𝟈":"p","ⲣ":"p",р:"p",P:"P",ℙ:"P","𝐏":"P","𝑃":"P","𝑷":"P","𝒫":"P","𝓟":"P","𝔓":"P","𝕻":"P","𝖯":"P","𝗣":"P","𝘗":"P","𝙋":"P","𝙿":"P",Ρ:"P","𝚸":"P","𝛲":"P","𝜬":"P","𝝦":"P","𝞠":"P","Ⲣ":"P",Р:"P",Ꮲ:"P",ᑭ:"P","ꓑ":"P","𐊕":"P",ƥ:"p̔","ᵽ":"p̵",ᑷ:"p·",ᒆ:"P'","ᴩ":"ᴘ","ꮲ":"ᴘ",φ:"ɸ",ϕ:"ɸ","𝛗":"ɸ","𝛟":"ɸ","𝜑":"ɸ","𝜙":"ɸ","𝝋":"ɸ","𝝓":"ɸ","𝞅":"ɸ","𝞍":"ɸ","𝞿":"ɸ","𝟇":"ɸ","ⲫ":"ɸ",ф:"ɸ","𝐪":"q","𝑞":"q","𝒒":"q","𝓆":"q","𝓺":"q","𝔮":"q","𝕢":"q","𝖖":"q","𝗊":"q","𝗾":"q","𝘲":"q","𝙦":"q","𝚚":"q","ԛ":"q",գ:"q",զ:"q",ℚ:"Q","𝐐":"Q","𝑄":"Q","𝑸":"Q","𝒬":"Q","𝓠":"Q","𝔔":"Q","𝕼":"Q","𝖰":"Q","𝗤":"Q","𝘘":"Q","𝙌":"Q","𝚀":"Q","ⵕ":"Q",ʠ:"q̔","🜀":"QE","ᶐ":"ɋ","ᴋ":"ĸ",κ:"ĸ",ϰ:"ĸ","𝛋":"ĸ","𝛞":"ĸ","𝜅":"ĸ","𝜘":"ĸ","𝜿":"ĸ","𝝒":"ĸ","𝝹":"ĸ","𝞌":"ĸ","𝞳":"ĸ","𝟆":"ĸ","ⲕ":"ĸ",к:"ĸ","ꮶ":"ĸ",қ:"ĸ̩",ҟ:"ĸ̵","𝐫":"r","𝑟":"r","𝒓":"r","𝓇":"r","𝓻":"r","𝔯":"r","𝕣":"r","𝖗":"r","𝗋":"r","𝗿":"r","𝘳":"r","𝙧":"r","𝚛":"r","ꭇ":"r","ꭈ":"r","ᴦ":"r","ⲅ":"r",г:"r","ꮁ":"r","𝈖":"R",ℛ:"R",ℜ:"R",ℝ:"R","𝐑":"R","𝑅":"R","𝑹":"R","𝓡":"R","𝕽":"R","𝖱":"R","𝗥":"R","𝘙":"R","𝙍":"R","𝚁":"R",Ʀ:"R",Ꭱ:"R",Ꮢ:"R","𐒴":"R",ᖇ:"R","ꓣ":"R","𖼵":"R",ɽ:"r̨",ɼ:"r̩","ɍ":"r̵",ғ:"r̵","ᵲ":"r̴",ґ:"r'","𑣣":"rn",m:ive,"ⅿ":"rn","𝐦":"rn","𝑚":"rn","𝒎":"rn","𝓂":"rn","𝓶":"rn","𝔪":"rn","𝕞":"rn","𝖒":"rn","𝗆":"rn","𝗺":"rn","𝘮":"rn","𝙢":"rn","𝚖":"rn","𑜀":"rn","₥":"rn̸",ɱ:"rn̦","ᵯ":"rn̴","₨":"Rs","ꭱ":"ʀ","ꮢ":"ʀ",я:"ᴙ","ᵳ":"ɾ̴","℩":"ɿ",s:"s","𝐬":"s","𝑠":"s","𝒔":"s","𝓈":"s","𝓼":"s","𝔰":"s","𝕤":"s","𝖘":"s","𝗌":"s","𝘀":"s","𝘴":"s","𝙨":"s","𝚜":"s","ꜱ":"s",ƽ:"s",ѕ:"s","ꮪ":"s","𑣁":"s","𐑈":"s",S:"S","𝐒":"S","𝑆":"S","𝑺":"S","𝒮":"S","𝓢":"S","𝔖":"S","𝕊":"S","𝕾":"S","𝖲":"S","𝗦":"S","𝘚":"S","𝙎":"S","𝚂":"S",Ѕ:"S",Տ:"S",Ꮥ:"S",Ꮪ:"S","ꓢ":"S","𖼺":"S","𐊖":"S","𐐠":"S",ʂ:"s̨","ᵴ":"s̴","ꞵ":"ß",β:"ß",ϐ:"ß","𝛃":"ß","𝛽":"ß","𝜷":"ß","𝝱":"ß","𝞫":"ß",Ᏸ:"ß","🝜":"sss",st:"st","∫":"ʃ","ꭍ":"ʃ","∑":"Ʃ","⅀":"Ʃ",Σ:"Ʃ","𝚺":"Ʃ","𝛴":"Ʃ","𝜮":"Ʃ","𝝨":"Ʃ","𝞢":"Ʃ","ⵉ":"Ʃ","∬":"ʃʃ","∭":"ʃʃʃ","⨌":"ʃʃʃʃ","𝐭":"t","𝑡":"t","𝒕":"t","𝓉":"t","𝓽":"t","𝔱":"t","𝕥":"t","𝖙":"t","𝗍":"t","𝘁":"t","𝘵":"t","𝙩":"t","𝚝":"t","⊤":"T","⟙":"T","🝨":"T",T:"T","𝐓":"T","𝑇":"T","𝑻":"T","𝒯":"T","𝓣":"T","𝔗":"T","𝕋":"T","𝕿":"T","𝖳":"T","𝗧":"T","𝘛":"T","𝙏":"T","𝚃":"T",Τ:"T","𝚻":"T","𝛵":"T","𝜯":"T","𝝩":"T","𝞣":"T","Ⲧ":"T",Т:"T",Ꭲ:"T","ꓔ":"T","𖼊":"T","𑢼":"T","𐊗":"T","𐊱":"T","𐌕":"T",ƭ:"t̔","⍡":"T̈","Ⱦ":"T̸",Ț:"Ţ",Ʈ:"T̨",Ҭ:"T̩","₮":"T⃫",ŧ:"t̵",Ŧ:"T̵","ᵵ":"t̴",Ⴀ:"Ꞇ","Ꜩ":"T3",ʨ:"tɕ","℡":"TEL","ꝷ":"tf",ʦ:"ts",ʧ:"tʃ","ꜩ":"tȝ",τ:"ᴛ","𝛕":"ᴛ","𝜏":"ᴛ","𝝉":"ᴛ","𝞃":"ᴛ","𝞽":"ᴛ",т:"ᴛ","ꭲ":"ᴛ",ҭ:"ᴛ̩",ţ:"ƫ",ț:"ƫ",Ꮏ:"ƫ","𝐮":"u","𝑢":"u","𝒖":"u","𝓊":"u","𝓾":"u","𝔲":"u","𝕦":"u","𝖚":"u","𝗎":"u","𝘂":"u","𝘶":"u","𝙪":"u","𝚞":"u","ꞟ":"u","ᴜ":"u","ꭎ":"u","ꭒ":"u",ʋ:"u",υ:"u","𝛖":"u","𝜐":"u","𝝊":"u","𝞄":"u","𝞾":"u",ս:"u","𐓶":"u","𑣘":"u","∪":"U","⋃":"U","𝐔":"U","𝑈":"U","𝑼":"U","𝒰":"U","𝓤":"U","𝔘":"U","𝕌":"U","𝖀":"U","𝖴":"U","𝗨":"U","𝘜":"U","𝙐":"U","𝚄":"U",Ս:"U",ሀ:"U","𐓎":"U",ᑌ:"U","ꓴ":"U","𖽂":"U","𑢸":"U",ǔ:"ŭ",Ǔ:"Ŭ","ᵾ":"u̵","ꮜ":"u̵","Ʉ":"U̵",Ꮜ:"U̵",ᑘ:"U·",ᑧ:"U'","ᵫ":"ue","ꭣ":"uo",ṃ:"ꭑ",պ:"ɰ",ሣ:"ɰ","℧":"Ʊ",ᘮ:"Ʊ",ᘴ:"Ʊ","ᵿ":"ʊ̵","∨":"v","⋁":"v",v:"v","ⅴ":"v","𝐯":"v","𝑣":"v","𝒗":"v","𝓋":"v","𝓿":"v","𝔳":"v","𝕧":"v","𝖛":"v","𝗏":"v","𝘃":"v","𝘷":"v","𝙫":"v","𝚟":"v","ᴠ":"v",ν:"v","𝛎":"v","𝜈":"v","𝝂":"v","𝝼":"v","𝞶":"v",ѵ:"v",ט:"v","𑜆":"v","ꮩ":"v","𑣀":"v","𝈍":"V","٧":"V","۷":"V","Ⅴ":"V","𝐕":"V","𝑉":"V","𝑽":"V","𝒱":"V","𝓥":"V","𝔙":"V","𝕍":"V","𝖁":"V","𝖵":"V","𝗩":"V","𝘝":"V","𝙑":"V","𝚅":"V",Ѵ:"V","ⴸ":"V",Ꮩ:"V",ᐯ:"V","ꛟ":"V","ꓦ":"V","𖼈":"V","𑢠":"V","𐔝":"V","𐆗":"V̵",ᐻ:"V·","🝬":"VB","ⅵ":"vi","ⅶ":"vii","ⅷ":"viii","Ⅵ":"Vl","Ⅶ":"Vll","Ⅷ":"Vlll","🜈":"Vᷤ","ᴧ":"ʌ","𐓘":"ʌ","٨":"Ʌ","۸":"Ʌ",Λ:"Ʌ","𝚲":"Ʌ","𝛬":"Ʌ","𝜦":"Ʌ","𝝠":"Ʌ","𝞚":"Ʌ",Л:"Ʌ","ⴷ":"Ʌ","𐒰":"Ʌ",ᐱ:"Ʌ","ꛎ":"Ʌ","ꓥ":"Ʌ","𖼽":"Ʌ","𐊍":"Ʌ","Ӆ":"Ʌ̦",ᐽ:"Ʌ·",ɯ:"w","𝐰":"w","𝑤":"w","𝒘":"w","𝓌":"w","𝔀":"w","𝔴":"w","𝕨":"w","𝖜":"w","𝗐":"w","𝘄":"w","𝘸":"w","𝙬":"w","𝚠":"w","ᴡ":"w",ѡ:"w","ԝ":"w",ա:"w","𑜊":"w","𑜎":"w","𑜏":"w","ꮃ":"w","𑣯":"W","𑣦":"W","𝐖":"W","𝑊":"W","𝑾":"W","𝒲":"W","𝓦":"W","𝔚":"W","𝕎":"W","𝖂":"W","𝖶":"W","𝗪":"W","𝘞":"W","𝙒":"W","𝚆":"W","Ԝ":"W",Ꮃ:"W",Ꮤ:"W","ꓪ":"W",ѽ:"w҆҇","𑓅":"ẇ","₩":"W̵","ꝡ":"w̦","ᴍ":"ʍ",м:"ʍ","ꮇ":"ʍ","ӎ":"ʍ̦","᙮":"x","×":"x","⤫":"x","⤬":"x","⨯":"x",x:"x","ⅹ":"x","𝐱":"x","𝑥":"x","𝒙":"x","𝓍":"x","𝔁":"x","𝔵":"x","𝕩":"x","𝖝":"x","𝗑":"x","𝘅":"x","𝘹":"x","𝙭":"x","𝚡":"x",х:"x",ᕁ:"x",ᕽ:"x","ⷯ":"ͯ","᙭":"X","╳":"X","𐌢":"X","𑣬":"X",X:"X","Ⅹ":"X","𝐗":"X","𝑋":"X","𝑿":"X","𝒳":"X","𝓧":"X","𝔛":"X","𝕏":"X","𝖃":"X","𝖷":"X","𝗫":"X","𝘟":"X","𝙓":"X","𝚇":"X","Ꭓ":"X",Χ:"X","𝚾":"X","𝛸":"X","𝜲":"X","𝝬":"X","𝞦":"X","Ⲭ":"X",Х:"X","ⵝ":"X",ᚷ:"X","ꓫ":"X","𐊐":"X","𐊴":"X","𐌗":"X","𐔧":"X","⨰":"ẋ",Ҳ:"X̩","𐆖":"X̵","ⅺ":"xi","ⅻ":"xii","Ⅺ":"Xl","Ⅻ":"Xll",ɣ:"y","ᶌ":"y",y:"y","𝐲":"y","𝑦":"y","𝒚":"y","𝓎":"y","𝔂":"y","𝔶":"y","𝕪":"y","𝖞":"y","𝗒":"y","𝘆":"y","𝘺":"y","𝙮":"y","𝚢":"y",ʏ:"y","ỿ":"y","ꭚ":"y",γ:"y","ℽ":"y","𝛄":"y","𝛾":"y","𝜸":"y","𝝲":"y","𝞬":"y",у:"y",ү:"y",ყ:"y","𑣜":"y",Y:"Y","𝐘":"Y","𝑌":"Y","𝒀":"Y","𝒴":"Y","𝓨":"Y","𝔜":"Y","𝕐":"Y","𝖄":"Y","𝖸":"Y","𝗬":"Y","𝘠":"Y","𝙔":"Y","𝚈":"Y",Υ:"Y",ϒ:"Y","𝚼":"Y","𝛶":"Y","𝜰":"Y","𝝪":"Y","𝞤":"Y","Ⲩ":"Y",У:"Y",Ү:"Y",Ꭹ:"Y",Ꮍ:"Y","ꓬ":"Y","𖽃":"Y","𑢤":"Y","𐊲":"Y",ƴ:"y̔","ɏ":"y̵",ұ:"y̵","¥":"Y̵","Ɏ":"Y̵",Ұ:"Y̵",ʒ:"ȝ","ꝫ":"ȝ","ⳍ":"ȝ",ӡ:"ȝ",ჳ:"ȝ","𝐳":"z","𝑧":"z","𝒛":"z","𝓏":"z","𝔃":"z","𝔷":"z","𝕫":"z","𝖟":"z","𝗓":"z","𝘇":"z","𝘻":"z","𝙯":"z","𝚣":"z","ᴢ":"z","ꮓ":"z","𑣄":"z","𐋵":"Z","𑣥":"Z",Z:"Z",ℤ:"Z",ℨ:"Z","𝐙":"Z","𝑍":"Z","𝒁":"Z","𝒵":"Z","𝓩":"Z","𝖅":"Z","𝖹":"Z","𝗭":"Z","𝘡":"Z","𝙕":"Z","𝚉":"Z",Ζ:"Z","𝚭":"Z","𝛧":"Z","𝜡":"Z","𝝛":"Z","𝞕":"Z",Ꮓ:"Z","ꓜ":"Z","𑢩":"Z",ʐ:"z̨",ƶ:"z̵",Ƶ:"Z̵",ȥ:"z̦",Ȥ:"Z̦","ᵶ":"z̴",ƿ:"þ","ϸ":"þ","Ϸ":"Þ","𐓄":"Þ","⁹":"ꝰ","ᴤ":"ƨ",ϩ:"ƨ","ꙅ":"ƨ",ь:"ƅ","ꮟ":"ƅ",ы:"ƅi","ꭾ":"ɂ",ˤ:"ˁ","ꛍ":"ʡ","⊙":"ʘ","☉":"ʘ","⨀":"ʘ","Ꙩ":"ʘ","ⵙ":"ʘ","𐓃":"ʘ","ℾ":"Γ","𝚪":"Γ","𝛤":"Γ","𝜞":"Γ","𝝘":"Γ","𝞒":"Γ","Ⲅ":"Γ",Г:"Γ",Ꮁ:"Γ",ᒥ:"Γ","𖼇":"Γ",Ғ:"Γ̵",ᒯ:"Γ·",Ґ:"Γ'","∆":"Δ","△":"Δ","🜂":"Δ","𝚫":"Δ","𝛥":"Δ","𝜟":"Δ","𝝙":"Δ","𝞓":"Δ","Ⲇ":"Δ","ⵠ":"Δ",ᐃ:"Δ","𖼚":"Δ","𐊅":"Δ","𐊣":"Δ","⍙":"Δ̲",ᐏ:"Δ·",ᐬ:"Δᐠ","𝟋":"ϝ","𝛇":"ζ","𝜁":"ζ","𝜻":"ζ","𝝵":"ζ","𝞯":"ζ","ⳤ":"ϗ","𝛌":"λ","𝜆":"λ","𝝀":"λ","𝝺":"λ","𝞴":"λ","Ⲗ":"λ","𐓛":"λ",µ:"μ","𝛍":"μ","𝜇":"μ","𝝁":"μ","𝝻":"μ","𝞵":"μ","𝛏":"ξ","𝜉":"ξ","𝝃":"ξ","𝝽":"ξ","𝞷":"ξ","𝚵":"Ξ","𝛯":"Ξ","𝜩":"Ξ","𝝣":"Ξ","𝞝":"Ξ",ϖ:"π","ℼ":"π","𝛑":"π","𝛡":"π","𝜋":"π","𝜛":"π","𝝅":"π","𝝕":"π","𝝿":"π","𝞏":"π","𝞹":"π","𝟉":"π","ᴨ":"π",п:"π","∏":"Π","ℿ":"Π","𝚷":"Π","𝛱":"Π","𝜫":"Π","𝝥":"Π","𝞟":"Π","Ⲡ":"Π",П:"Π","ꛛ":"Π","𐊭":"Ϙ","𐌒":"Ϙ",ϛ:"ς","𝛓":"ς","𝜍":"ς","𝝇":"ς","𝞁":"ς","𝞻":"ς","𝚽":"Φ","𝛷":"Φ","𝜱":"Φ","𝝫":"Φ","𝞥":"Φ","Ⲫ":"Φ",Ф:"Φ",Փ:"Φ",ቀ:"Φ","ᛰ":"Φ","𐊳":"Φ","ꭓ":"χ","ꭕ":"χ","𝛘":"χ","𝜒":"χ","𝝌":"χ","𝞆":"χ","𝟀":"χ","ⲭ":"χ","𝛙":"ψ","𝜓":"ψ","𝝍":"ψ","𝞇":"ψ","𝟁":"ψ",ѱ:"ψ","𐓹":"ψ","𝚿":"Ψ","𝛹":"Ψ","𝜳":"Ψ","𝝭":"Ψ","𝞧":"Ψ","Ⲯ":"Ψ",Ѱ:"Ψ","𐓑":"Ψ",ᛘ:"Ψ","𐊵":"Ψ","⍵":"ω","ꞷ":"ω","𝛚":"ω","𝜔":"ω","𝝎":"ω","𝞈":"ω","𝟂":"ω","ⲱ":"ω","ꙍ":"ω",Ω:"Ω","𝛀":"Ω","𝛺":"Ω","𝜴":"Ω","𝝮":"Ω","𝞨":"Ω",ᘯ:"Ω",ᘵ:"Ω","𐊶":"Ω","⍹":"ω̲",ώ:"ῴ","☰":"Ⲷ","Ⳝ":"Ϭ",җ:"ж̩",Җ:"Ж̩","𝈋":"И","Ͷ":"И","ꚡ":"И","𐐥":"И",Й:"Ѝ","Ҋ":"Ѝ̦",ѝ:"й","ҋ":"й̦","𐒼":"Ӄ","ᴫ":"л","ӆ":"л̦","ꭠ":"љ","𐓫":"ꙩ","ᷮ":"ⷬ","𐓍":"Ћ","𝈂":"Ӿ","𝈢":"Ѡ",Ꮗ:"Ѡ",ᗯ:"Ѡ",Ѽ:"Ѡ҆҇","ᣭ":"Ѡ·","Ꞷ":"Ꙍ",ӌ:"ҷ",Ӌ:"Ҷ",Ҿ:"Ҽ̨","ⲽ":"ш","Ⲽ":"Ш","Ꙑ":"Ъl","℈":"Э","🜁":"Ꙙ","𖼜":"Ꙙ","ꦒ":"ⰿ",և:"եւ",ኔ:"ձ",ﬔ:"մե",ﬕ:"մի",ﬗ:"մխ",ﬓ:"մն","∩":"Ո","⋂":"Ո","𝉅":"Ո",በ:"Ո",ᑎ:"Ո","ꓵ":"Ո",ᑚ:"Ո·",ᑨ:"Ո'",ﬖ:"վն","₽":"Ք","˓":"ՙ",ʿ:"ՙ",ℵ:"א",ﬡ:"א",אָ:"אַ",אּ:"אַ",ﭏ:"אל",ℶ:"ב",ℷ:"ג",ℸ:"ד",ﬢ:"ד",ﬣ:"ה",יּ:"יִ",ﬤ:"כ",ﬥ:"ל",ﬦ:"ם",ﬠ:"ע",ﬧ:"ר",שׂ:"שׁ",שּ:"שׁ",שּׂ:"שּׁ",ﬨ:"ת",ﺀ:"ء","۽":"ء͈",ﺂ:"آ",ﺁ:"آ",ﭑ:"ٱ",ﭐ:"ٱ","𞸁":"ب","𞸡":"ب","𞹡":"ب","𞺁":"ب","𞺡":"ب",ﺑ:"ب",ﺒ:"ب",ﺐ:"ب",ﺏ:"ب","ݑ":"بۛ","ࢶ":"بۢ","ࢡ":"بٔ",ﲠ:"بo",ﳢ:"بo",ﲜ:"بج",ﰅ:"بج",ﲝ:"بح",ﰆ:"بح",ﷂ:"بحى",ﲞ:"بخ",ﰇ:"بخ",ﳒ:"بخ",ﱋ:"بخ",ﶞ:"بخى",ﱪ:"بر",ﱫ:"بز",ﲟ:"بم",ﳡ:"بم",ﱬ:"بم",ﰈ:"بم",ﱭ:"بن",ﱮ:"بى",ﰉ:"بى",ﱯ:"بى",ﰊ:"بى",ﭔ:"ٻ",ﭕ:"ٻ",ﭓ:"ٻ",ﭒ:"ٻ",ې:"ٻ",ﯦ:"ٻ",ﯧ:"ٻ",ﯥ:"ٻ",ﯤ:"ٻ",ﭜ:"ڀ",ﭝ:"ڀ",ﭛ:"ڀ",ﭚ:"ڀ","ࢩ":"ݔ","ݧ":"ݔ","⍥":"ة",ö:"ة",ﺔ:"ة",ﺓ:"ة",ۃ:"ة","𞸕":"ت","𞸵":"ت","𞹵":"ت","𞺕":"ت","𞺵":"ت",ﺗ:"ت",ﺘ:"ت",ﺖ:"ت",ﺕ:"ت",ﲥ:"تo",ﳤ:"تo",ﲡ:"تج",ﰋ:"تج",ﵐ:"تجم",ﶠ:"تجى",ﶟ:"تجى",ﲢ:"تح",ﰌ:"تح",ﵒ:"تحج",ﵑ:"تحج",ﵓ:"تحم",ﲣ:"تخ",ﰍ:"تخ",ﵔ:"تخم",ﶢ:"تخى",ﶡ:"تخى",ﱰ:"تر",ﱱ:"تز",ﲤ:"تم",ﳣ:"تم",ﱲ:"تم",ﰎ:"تم",ﵕ:"تمج",ﵖ:"تمح",ﵗ:"تمخ",ﶤ:"تمى",ﶣ:"تمى",ﱳ:"تن",ﱴ:"تى",ﰏ:"تى",ﱵ:"تى",ﰐ:"تى",ﭠ:"ٺ",ﭡ:"ٺ",ﭟ:"ٺ",ﭞ:"ٺ",ﭤ:"ٿ",ﭥ:"ٿ",ﭣ:"ٿ",ﭢ:"ٿ","𞸂":"ج","𞸢":"ج","𞹂":"ج","𞹢":"ج","𞺂":"ج","𞺢":"ج",ﺟ:"ج",ﺠ:"ج",ﺞ:"ج",ﺝ:"ج",ﲧ:"جح",ﰕ:"جح",ﶦ:"جحى",ﶾ:"جحى",ﷻ:"جل جلlلo",ﲨ:"جم",ﰖ:"جم",ﵙ:"جمح",ﵘ:"جمح",ﶧ:"جمى",ﶥ:"جمى",ﴝ:"جى",ﴁ:"جى",ﴞ:"جى",ﴂ:"جى",ﭸ:"ڃ",ﭹ:"ڃ",ﭷ:"ڃ",ﭶ:"ڃ",ﭴ:"ڄ",ﭵ:"ڄ",ﭳ:"ڄ",ﭲ:"ڄ",ﭼ:"چ",ﭽ:"چ",ﭻ:"چ",ﭺ:"چ",ﮀ:"ڇ",ﮁ:"ڇ",ﭿ:"ڇ",ﭾ:"ڇ","𞸇":"ح","𞸧":"ح","𞹇":"ح","𞹧":"ح","𞺇":"ح","𞺧":"ح",ﺣ:"ح",ﺤ:"ح",ﺢ:"ح",ﺡ:"ح",څ:"حۛ",ځ:"حٔ","ݲ":"حٔ",ﲩ:"حج",ﰗ:"حج",ﶿ:"حجى",ﲪ:"حم",ﰘ:"حم",ﵛ:"حمى",ﵚ:"حمى",ﴛ:"حى",ﳿ:"حى",ﴜ:"حى",ﴀ:"حى","𞸗":"خ","𞸷":"خ","𞹗":"خ","𞹷":"خ","𞺗":"خ","𞺷":"خ",ﺧ:"خ",ﺨ:"خ",ﺦ:"خ",ﺥ:"خ",ﲫ:"خج",ﰙ:"خج",ﰚ:"خح",ﲬ:"خم",ﰛ:"خم",ﴟ:"خى",ﴃ:"خى",ﴠ:"خى",ﴄ:"خى","𐋡":"د","𞸃":"د","𞺃":"د","𞺣":"د",ﺪ:"د",ﺩ:"د",ڈ:"دؕ",ﮉ:"دؕ",ﮈ:"دؕ",ڎ:"دۛ",ﮇ:"دۛ",ﮆ:"دۛ","ۮ":"د̂","ࢮ":"د̤̣","𞸘":"ذ","𞺘":"ذ","𞺸":"ذ",ﺬ:"ذ",ﺫ:"ذ",ﱛ:"ذٰ",ڋ:"ڊؕ",ﮅ:"ڌ",ﮄ:"ڌ",ﮃ:"ڍ",ﮂ:"ڍ","𞸓":"ر","𞺓":"ر","𞺳":"ر",ﺮ:"ر",ﺭ:"ر",ڑ:"رؕ",ﮍ:"رؕ",ﮌ:"رؕ",ژ:"رۛ",ﮋ:"رۛ",ﮊ:"رۛ",ڒ:"ر̆","ࢹ":"ر̆̇","ۯ":"ر̂","ݬ":"رٔ",ﱜ:"رٰ",ﷶ:"رسول","﷼":"رىlل","𞸆":"ز","𞺆":"ز","𞺦":"ز",ﺰ:"ز",ﺯ:"ز","ࢲ":"ز̂","ݱ":"ڗؕ","𞸎":"س","𞸮":"س","𞹎":"س","𞹮":"س","𞺎":"س","𞺮":"س",ﺳ:"س",ﺴ:"س",ﺲ:"س",ﺱ:"س",ش:"سۛ","𞸔":"سۛ","𞸴":"سۛ","𞹔":"سۛ","𞹴":"سۛ","𞺔":"سۛ","𞺴":"سۛ",ﺷ:"سۛ",ﺸ:"سۛ",ﺶ:"سۛ",ﺵ:"سۛ","ݾ":"س̂",ﴱ:"سo",ﳨ:"سo",ﴲ:"سۛo",ﳪ:"سۛo",ﲭ:"سج",ﴴ:"سج",ﰜ:"سج",ﴭ:"سۛج",ﴷ:"سۛج",ﴥ:"سۛج",ﴉ:"سۛج",ﵝ:"سجح",ﵞ:"سجى",ﵩ:"سۛجى",ﲮ:"سح",ﴵ:"سح",ﰝ:"سح",ﴮ:"سۛح",ﴸ:"سۛح",ﴦ:"سۛح",ﴊ:"سۛح",ﵜ:"سحج",ﵨ:"سۛحم",ﵧ:"سۛحم",ﶪ:"سۛحى",ﲯ:"سخ",ﴶ:"سخ",ﰞ:"سخ",ﴯ:"سۛخ",ﴹ:"سۛخ",ﴧ:"سۛخ",ﴋ:"سۛخ",ﶨ:"سخى",ﷆ:"سخى",ﴪ:"سر",ﴎ:"سر",ﴩ:"سۛر",ﴍ:"سۛر",ﲰ:"سم",ﳧ:"سم",ﰟ:"سم",ﴰ:"سۛم",ﳩ:"سۛم",ﴨ:"سۛم",ﴌ:"سۛم",ﵡ:"سمج",ﵠ:"سمح",ﵟ:"سمح",ﵫ:"سۛمخ",ﵪ:"سۛمخ",ﵣ:"سمم",ﵢ:"سمم",ﵭ:"سۛمم",ﵬ:"سۛمم",ﴗ:"سى",ﳻ:"سى",ﴘ:"سى",ﳼ:"سى",ﴙ:"سۛى",ﳽ:"سۛى",ﴚ:"سۛى",ﳾ:"سۛى","𐋲":"ص","𞸑":"ص","𞸱":"ص","𞹑":"ص","𞹱":"ص","𞺑":"ص","𞺱":"ص",ﺻ:"ص",ﺼ:"ص",ﺺ:"ص",ﺹ:"ص",ڞ:"صۛ","ࢯ":"ص̤̣",ﲱ:"صح",ﰠ:"صح",ﵥ:"صحح",ﵤ:"صحح",ﶩ:"صحى",ﲲ:"صخ",ﴫ:"صر",ﴏ:"صر",ﷵ:"صلعم",ﷹ:"صلى",ﷰ:"صلى",ﷺ:"صلى lللo علىo وسلم",ﲳ:"صم",ﰡ:"صم",ﷅ:"صمم",ﵦ:"صمم",ﴡ:"صى",ﴅ:"صى",ﴢ:"صى",ﴆ:"صى","𞸙":"ض","𞸹":"ض","𞹙":"ض","𞹹":"ض","𞺙":"ض","𞺹":"ض",ﺿ:"ض",ﻀ:"ض",ﺾ:"ض",ﺽ:"ض",ﲴ:"ضج",ﰢ:"ضج",ﲵ:"ضح",ﰣ:"ضح",ﵮ:"ضحى",ﶫ:"ضحى",ﲶ:"ضخ",ﰤ:"ضخ",ﵰ:"ضخم",ﵯ:"ضخم",ﴬ:"ضر",ﴐ:"ضر",ﲷ:"ضم",ﰥ:"ضم",ﴣ:"ضى",ﴇ:"ضى",ﴤ:"ضى",ﴈ:"ضى","𐋨":"ط","𞸈":"ط","𞹨":"ط","𞺈":"ط","𞺨":"ط",ﻃ:"ط",ﻄ:"ط",ﻂ:"ط",ﻁ:"ط",ڟ:"طۛ",ﲸ:"طح",ﰦ:"طح",ﴳ:"طم",ﴺ:"طم",ﰧ:"طم",ﵲ:"طمح",ﵱ:"طمح",ﵳ:"طمم",ﵴ:"طمى",ﴑ:"طى",ﳵ:"طى",ﴒ:"طى",ﳶ:"طى","𞸚":"ظ","𞹺":"ظ","𞺚":"ظ","𞺺":"ظ",ﻇ:"ظ",ﻈ:"ظ",ﻆ:"ظ",ﻅ:"ظ",ﲹ:"ظم",ﴻ:"ظم",ﰨ:"ظم","؏":"ع","𞸏":"ع","𞸯":"ع","𞹏":"ع","𞹯":"ع","𞺏":"ع","𞺯":"ع",ﻋ:"ع",ﻌ:"ع",ﻊ:"ع",ﻉ:"ع",ﲺ:"عج",ﰩ:"عج",ﷄ:"عجم",ﵵ:"عجم",ﷷ:"علىo",ﲻ:"عم",ﰪ:"عم",ﵷ:"عمم",ﵶ:"عمم",ﵸ:"عمى",ﶶ:"عمى",ﴓ:"عى",ﳷ:"عى",ﴔ:"عى",ﳸ:"عى","𞸛":"غ","𞸻":"غ","𞹛":"غ","𞹻":"غ","𞺛":"غ","𞺻":"غ",ﻏ:"غ",ﻐ:"غ",ﻎ:"غ",ﻍ:"غ",ﲼ:"غج",ﰫ:"غج",ﲽ:"غم",ﰬ:"غم",ﵹ:"غمم",ﵻ:"غمى",ﵺ:"غمى",ﴕ:"غى",ﳹ:"غى",ﴖ:"غى",ﳺ:"غى","𞸐":"ف","𞸰":"ف","𞹰":"ف","𞺐":"ف","𞺰":"ف",ﻓ:"ف",ﻔ:"ف",ﻒ:"ف",ﻑ:"ف",ڧ:"ف",ﲾ:"فج",ﰭ:"فج",ﲿ:"فح",ﰮ:"فح",ﳀ:"فخ",ﰯ:"فخ",ﵽ:"فخم",ﵼ:"فخم",ﳁ:"فم",ﰰ:"فم",ﷁ:"فمى",ﱼ:"فى",ﰱ:"فى",ﱽ:"فى",ﰲ:"فى","𞸞":"ڡ","𞹾":"ڡ","ࢻ":"ڡ","ٯ":"ڡ","𞸟":"ڡ","𞹟":"ڡ","ࢼ":"ڡ",ڤ:"ڡۛ",ﭬ:"ڡۛ",ﭭ:"ڡۛ",ﭫ:"ڡۛ",ﭪ:"ڡۛ",ڨ:"ڡۛ","ࢤ":"ڢۛ",ﭰ:"ڦ",ﭱ:"ڦ",ﭯ:"ڦ",ﭮ:"ڦ","𞸒":"ق","𞸲":"ق","𞹒":"ق","𞹲":"ق","𞺒":"ق","𞺲":"ق",ﻗ:"ق",ﻘ:"ق",ﻖ:"ق",ﻕ:"ق",ﳂ:"قح",ﰳ:"قح",ﷱ:"قلى",ﳃ:"قم",ﰴ:"قم",ﶴ:"قمح",ﵾ:"قمح",ﵿ:"قمم",ﶲ:"قمى",ﱾ:"قى",ﰵ:"قى",ﱿ:"قى",ﰶ:"قى","𞸊":"ك","𞸪":"ك","𞹪":"ك",ﻛ:"ك",ﻜ:"ك",ﻚ:"ك",ﻙ:"ك",ک:"ك",ﮐ:"ك",ﮑ:"ك",ﮏ:"ك",ﮎ:"ك",ڪ:"ك",ڭ:"كۛ",ﯕ:"كۛ",ﯖ:"كۛ",ﯔ:"كۛ",ﯓ:"كۛ","ݣ":"كۛ",ﲀ:"كl",ﰷ:"كl",ﳄ:"كج",ﰸ:"كج",ﳅ:"كح",ﰹ:"كح",ﳆ:"كخ",ﰺ:"كخ",ﳇ:"كل",ﳫ:"كل",ﲁ:"كل",ﰻ:"كل",ﳈ:"كم",ﳬ:"كم",ﲂ:"كم",ﰼ:"كم",ﷃ:"كمم",ﶻ:"كمم",ﶷ:"كمى",ﲃ:"كى",ﰽ:"كى",ﲄ:"كى",ﰾ:"كى","ݢ":"ڬ",ﮔ:"گ",ﮕ:"گ",ﮓ:"گ",ﮒ:"گ","ࢰ":"گ",ڴ:"گۛ",ﮜ:"ڱ",ﮝ:"ڱ",ﮛ:"ڱ",ﮚ:"ڱ",ﮘ:"ڳ",ﮙ:"ڳ",ﮗ:"ڳ",ﮖ:"ڳ","𞸋":"ل","𞸫":"ل","𞹋":"ل","𞺋":"ل","𞺫":"ل",ﻟ:"ل",ﻠ:"ل",ﻞ:"ل",ﻝ:"ل",ڷ:"لۛ",ڵ:"ل̆",ﻼ:"لl",ﻻ:"لl",ﻺ:"لlٕ",ﻹ:"لlٕ",ﻸ:"لlٴ",ﻷ:"لlٴ",ﳍ:"لo",ﻶ:"لآ",ﻵ:"لآ",ﳉ:"لج",ﰿ:"لج",ﶃ:"لجج",ﶄ:"لجج",ﶺ:"لجم",ﶼ:"لجم",ﶬ:"لجى",ﳊ:"لح",ﱀ:"لح",ﶵ:"لحم",ﶀ:"لحم",ﶂ:"لحى",ﶁ:"لحى",ﳋ:"لخ",ﱁ:"لخ",ﶆ:"لخم",ﶅ:"لخم",ﳌ:"لم",ﳭ:"لم",ﲅ:"لم",ﱂ:"لم",ﶈ:"لمح",ﶇ:"لمح",ﶭ:"لمى",ﲆ:"لى",ﱃ:"لى",ﲇ:"لى",ﱄ:"لى","𞸌":"م","𞸬":"م","𞹬":"م","𞺌":"م","𞺬":"م",ﻣ:"م",ﻤ:"م",ﻢ:"م",ﻡ:"م","ࢧ":"مۛ","۾":"م͈",ﲈ:"مl",ﳎ:"مج",ﱅ:"مج",ﶌ:"مجح",ﶒ:"مجخ",ﶍ:"مجم",ﷀ:"مجى",ﳏ:"مح",ﱆ:"مح",ﶉ:"محج",ﶊ:"محم",ﷴ:"محمد",ﶋ:"محى",ﳐ:"مخ",ﱇ:"مخ",ﶎ:"مخج",ﶏ:"مخم",ﶹ:"مخى",ﳑ:"مم",ﲉ:"مم",ﱈ:"مم",ﶱ:"ممى",ﱉ:"مى",ﱊ:"مى","𞸍":"ن","𞸭":"ن","𞹍":"ن","𞹭":"ن","𞺍":"ن","𞺭":"ن",ﻧ:"ن",ﻨ:"ن",ﻦ:"ن",ﻥ:"ن","ݨ":"نؕ","ݩ":"ن̆",ﳖ:"نo",ﳯ:"نo",ﶸ:"نجح",ﶽ:"نجح",ﶘ:"نجم",ﶗ:"نجم",ﶙ:"نجى",ﷇ:"نجى",ﳓ:"نح",ﱌ:"نح",ﶕ:"نحم",ﶖ:"نحى",ﶳ:"نحى",ﳔ:"نخ",ﱍ:"نخ",ﲊ:"نر",ﲋ:"نز",ﳕ:"نم",ﳮ:"نم",ﲌ:"نم",ﱎ:"نم",ﶛ:"نمى",ﶚ:"نمى",ﲍ:"نن",ﲎ:"نى",ﱏ:"نى",ﲏ:"نى",ﱐ:"نى",ۂ:"ۀ",ﮥ:"ۀ",ﮤ:"ۀ","𐋤":"و","𞸅":"و","𞺅":"و","𞺥":"و",ﻮ:"و",ﻭ:"و","ࢱ":"و",ۋ:"وۛ",ﯟ:"وۛ",ﯞ:"وۛ",ۇ:"و̓",ﯘ:"و̓",ﯗ:"و̓",ۆ:"و̆",ﯚ:"و̆",ﯙ:"و̆",ۉ:"و̂",ﯣ:"و̂",ﯢ:"و̂",ۈ:"وٰ",ﯜ:"وٰ",ﯛ:"وٰ",ؤ:"وٴ",ﺆ:"وٴ",ﺅ:"وٴ",ٶ:"وٴ",ٷ:"و̓ٴ",ﯝ:"و̓ٴ",ﷸ:"وسلم",ﯡ:"ۅ",ﯠ:"ۅ","ٮ":"ى","𞸜":"ى","𞹼":"ى",ں:"ى","𞸝":"ى","𞹝":"ى",ﮟ:"ى",ﮞ:"ى","ࢽ":"ى",ﯨ:"ى",ﯩ:"ى",ﻰ:"ى",ﻯ:"ى",ي:"ى","𞸉":"ى","𞸩":"ى","𞹉":"ى","𞹩":"ى","𞺉":"ى","𞺩":"ى",ﻳ:"ى",ﻴ:"ى",ﻲ:"ى",ﻱ:"ى",ی:"ى",ﯾ:"ى",ﯿ:"ى",ﯽ:"ى",ﯼ:"ى",ے:"ى",ﮯ:"ى",ﮮ:"ى",ٹ:"ىؕ",ﭨ:"ىؕ",ﭩ:"ىؕ",ﭧ:"ىؕ",ﭦ:"ىؕ",ڻ:"ىؕ",ﮢ:"ىؕ",ﮣ:"ىؕ",ﮡ:"ىؕ",ﮠ:"ىؕ",پ:"ىۛ",ﭘ:"ىۛ",ﭙ:"ىۛ",ﭗ:"ىۛ",ﭖ:"ىۛ",ث:"ىۛ","𞸖":"ىۛ","𞸶":"ىۛ","𞹶":"ىۛ","𞺖":"ىۛ","𞺶":"ىۛ",ﺛ:"ىۛ",ﺜ:"ىۛ",ﺚ:"ىۛ",ﺙ:"ىۛ",ڽ:"ىۛ",ۑ:"ىۛ","ؿ":"ىۛ","ࢷ":"ىۛۢ","ݖ":"ى̆",ێ:"ى̆","ࢺ":"ى̆̇","ؽ":"ى̂","ࢨ":"ىٔ",ﲐ:"ىٰ",ﱝ:"ىٰ",ﳞ:"ىo",ﳱ:"ىo",ﳦ:"ىۛo",ئ:"ىٴ",ﺋ:"ىٴ",ﺌ:"ىٴ",ﺊ:"ىٴ",ﺉ:"ىٴ",ٸ:"ىٴ",ﯫ:"ىٴl",ﯪ:"ىٴl",ﲛ:"ىٴo",ﳠ:"ىٴo",ﯭ:"ىٴo",ﯬ:"ىٴo",ﯸ:"ىٴٻ",ﯷ:"ىٴٻ",ﯶ:"ىٴٻ",ﲗ:"ىٴج",ﰀ:"ىٴج",ﲘ:"ىٴح",ﰁ:"ىٴح",ﲙ:"ىٴخ",ﱤ:"ىٴر",ﱥ:"ىٴز",ﲚ:"ىٴم",ﳟ:"ىٴم",ﱦ:"ىٴم",ﰂ:"ىٴم",ﱧ:"ىٴن",ﯯ:"ىٴو",ﯮ:"ىٴو",ﯱ:"ىٴو̓",ﯰ:"ىٴو̓",ﯳ:"ىٴو̆",ﯲ:"ىٴو̆",ﯵ:"ىٴوٰ",ﯴ:"ىٴوٰ",ﯻ:"ىٴى",ﯺ:"ىٴى",ﱨ:"ىٴى",ﯹ:"ىٴى",ﰃ:"ىٴى",ﱩ:"ىٴى",ﰄ:"ىٴى",ﳚ:"ىج",ﱕ:"ىج",ﰑ:"ىۛج",ﶯ:"ىجى",ﳛ:"ىح",ﱖ:"ىح",ﶮ:"ىحى",ﳜ:"ىخ",ﱗ:"ىخ",ﲑ:"ىر",ﱶ:"ىۛر",ﲒ:"ىز",ﱷ:"ىۛز",ﳝ:"ىم",ﳰ:"ىم",ﲓ:"ىم",ﱘ:"ىم",ﲦ:"ىۛم",ﳥ:"ىۛم",ﱸ:"ىۛم",ﰒ:"ىۛم",ﶝ:"ىمم",ﶜ:"ىمم",ﶰ:"ىمى",ﲔ:"ىن",ﱹ:"ىۛن",ﲕ:"ىى",ﱙ:"ىى",ﲖ:"ىى",ﱚ:"ىى",ﱺ:"ىۛى",ﰓ:"ىۛى",ﱻ:"ىۛى",ﰔ:"ىۛى",ﮱ:"ۓ",ﮰ:"ۓ","𐊸":"ⵀ","⁞":"ⵂ","⸽":"ⵂ","⦙":"ⵂ","︙":"ⵗ","⁝":"ⵗ","⋮":"ⵗ",Մ:"ሆ",Ռ:"ቡ",Ի:"ኮ",Պ:"ጣ",आ:"अा",ऒ:"अाॆ",ओ:"अाे",औ:"अाै","ऄ":"अॆ",ऑ:"अॉ",ऍ:"एॅ",ऎ:"एॆ",ऐ:"एे",ई:"र्इ",ઽ:"ऽ","𑇜":"ꣻ","𑇋":"ऺ","ુ":"ु","ૂ":"ू","ੋ":"ॆ","੍":"्","્":"्",আ:"অা",ৠ:"ঋৃ",ৡ:"ঋৃ","𑒒":"ঘ","𑒔":"চ","𑒖":"জ","𑒘":"ঞ","𑒙":"ট","𑒛":"ড","𑒪":"ণ","𑒞":"ত","𑒟":"থ","𑒠":"দ","𑒡":"ধ","𑒢":"ন","𑒣":"প","𑒩":"ব","𑒧":"ম","𑒨":"য","𑒫":"র","𑒝":"ল","𑒭":"ষ","𑒮":"স","𑓄":"ঽ","𑒰":"া","𑒱":"ি","𑒹":"ে","𑒼":"ো","𑒾":"ৌ","𑓂":"্","𑒽":"ৗ",ਉ:"ੳੁ",ਊ:"ੳੂ",ਆ:"ਅਾ",ਐ:"ਅੈ",ਔ:"ਅੌ",ਇ:"ੲਿ",ਈ:"ੲੀ",ਏ:"ੲੇ",આ:"અા",ઑ:"અાૅ",ઓ:"અાે",ઔ:"અાૈ",ઍ:"અૅ",એ:"અે",ઐ:"અૈ",ଆ:"ଅା","௮":"அ",ர:"ஈ","ா":"ஈ","௫":"ஈு","௨":"உ",ഉ:"உ",ஊ:"உள",ഊ:"உൗ","௭":"எ","௷":"எவ",ஜ:"ஐ",ജ:"ஐ","௧":"க","௪":"ச","௬":"சு","௲":"சூ","ഺ":"டி",ണ:"ண","௺":"நீ","௴":"மீ","௰":"ய",ഴ:"ழ","ௗ":"ள","ை":"ன",ശ:"ஶ","௸":"ஷ","ി":"ி","ീ":"ி","ொ":"ெஈ","ௌ":"ெள","ோ":"ேஈ",ಅ:"అ",ಆ:"ఆ",ಇ:"ఇ",ౠ:"ఋా",ౡ:"ఌా",ಒ:"ఒ",ఔ:"ఒౌ",ಔ:"ఒౌ",ఓ:"ఒౕ",ಓ:"ఒౕ",ಜ:"జ",ಞ:"ఞ",ఢ:"డ̣",ಣ:"ణ",థ:"ధּ",భ:"బ̣",ಯ:"య",ఠ:"రּ",ಱ:"ఱ",ಲ:"ల",ష:"వ̣",హ:"వా",మ:"వు","ూ":"ుా","ౄ":"ృా",ೡ:"ಌಾ",ഈ:"ഇൗ",ഐ:"എെ",ഓ:"ഒാ",ഔ:"ഒൗ",ൡ:"ഞ","൫":"ദ്ര","൹":"നു",ഌ:"നു",ങ:"നു","൯":"ന്","ൻ":"ന്","൬":"ന്ന","൚":"ന്മ",റ:"ര","൪":"ര്","ർ":"ര്","൮":"വ്ര","൶":"ഹ്മ","ൂ":"ു","ൃ":"ു","ൈ":"െെ","෪":"ජ","෫":"ද","𑐓":"𑐴𑑂𑐒","𑐙":"𑐴𑑂𑐘","𑐤":"𑐴𑑂𑐣","𑐪":"𑐴𑑂𑐩","𑐭":"𑐴𑑂𑐬","𑐯":"𑐴𑑂𑐮","𑗘":"𑖂","𑗙":"𑖂","𑗚":"𑖃","𑗛":"𑖄","𑗜":"𑖲","𑗝":"𑖳",ฃ:"ข",ด:"ค",ต:"ค",ม:"ฆ",ຈ:"จ",ซ:"ช",ฏ:"ฎ",ท:"ฑ",ບ:"บ",ປ:"ป",ຝ:"ฝ",ພ:"พ",ຟ:"ฟ",ฦ:"ภ",ຍ:"ย","។":"ฯ",ๅ:"า",ำ:"̊า","ិ":"ิ","ី":"ี","ឹ":"ึ","ឺ":"ื","ຸ":"ุ","ູ":"ู",แ:"เเ",ໜ:"ຫນ",ໝ:"ຫມ",ຳ:"̊າ","༂":"འུྂཿ","༃":"འུྂ༔",ཪ:"ར",ༀ:"ཨོཾ","ཷ":"ྲཱྀ","ཹ":"ླཱྀ","𑲲":"𑲪","ႁ":"ဂှ",က:"ဂာ","ၰ":"ဃှ","ၦ":"ပှ",ဟ:"ပာ","ၯ":"ပာှ","ၾ":"ၽှ",ဩ:"သြ",ဪ:"သြော်","႞":"ႃ̊",ឣ:"អ","᧐":"ᦞ","᧑":"ᦱ","᪀":"ᩅ","᪐":"ᩅ","꩓":"ꨁ","꩖":"ꨣ","᭒":"ᬍ","᭓":"ᬑ","᭘":"ᬨ","ꦣ":"ꦝ",ᢖ:"ᡜ",ᡕ:"ᠵ",ῶ:"Ꮿ",ᐍ:"ᐁ·",ᐫ:"ᐁᐠ",ᐑ:"ᐄ·",ᐓ:"ᐅ·",ᐭ:"ᐅᐠ",ᐕ:"ᐆ·",ᐘ:"ᐊ·",ᐮ:"ᐊᐠ",ᐚ:"ᐋ·","ᣝ":"ᐞᣟ",ᓑ:"ᐡ",ᕀ:"ᐩ",ᐿ:"ᐲ·",ᑃ:"ᐴ·","⍩":"ᐵ",ᑇ:"ᐹ·",ᑜ:"ᑏ·","⸧":"ᑐ","⊃":"ᑐ",ᑞ:"ᑐ·",ᑩ:"ᑐ'","⟉":"ᑐ/","⫗":"ᑐᑕ",ᑠ:"ᑑ·","⸦":"ᑕ","⊂":"ᑕ",ᑢ:"ᑕ·",ᑪ:"ᑕ'",ᑤ:"ᑖ·",ᑵ:"ᑫ·",ᒅ:"ᑫ'",ᑹ:"ᑮ·",ᑽ:"ᑰ·",ᘃ:"ᒉ",ᒓ:"ᒉ·",ᒕ:"ᒋ·",ᒗ:"ᒌ·",ᒛ:"ᒎ·",ᘂ:"ᒐ",ᒝ:"ᒐ·",ᒟ:"ᒑ·",ᒭ:"ᒣ·",ᒱ:"ᒦ·",ᒳ:"ᒧ·",ᒵ:"ᒨ·",ᒹ:"ᒫ·",ᓊ:"ᓀ·","ᣇ":"ᓂ·","ᣉ":"ᓃ·","ᣋ":"ᓄ·","ᣍ":"ᓅ·",ᓌ:"ᓇ·",ᓎ:"ᓈ·",ᘄ:"ᓓ",ᓝ:"ᓓ·",ᓟ:"ᓕ·",ᓡ:"ᓖ·",ᓣ:"ᓗ·",ᓥ:"ᓘ·",ᘇ:"ᓚ",ᓧ:"ᓚ·",ᓩ:"ᓛ·",ᓷ:"ᓭ·",ᓹ:"ᓯ·",ᓻ:"ᓰ·",ᓽ:"ᓱ·",ᓿ:"ᓲ·",ᔁ:"ᓴ·",ᔃ:"ᓵ·",ᔌ:"ᔋ<",ᔎ:"ᔋb",ᔍ:"ᔋᑕ",ᔏ:"ᔋᒐ",ᔘ:"ᔐ·",ᔚ:"ᔑ·",ᔜ:"ᔒ·",ᔞ:"ᔓ·",ᔠ:"ᔔ·",ᔢ:"ᔕ·",ᔤ:"ᔖ·",ᔲ:"ᔨ·",ᔴ:"ᔩ·",ᔶ:"ᔪ·",ᔸ:"ᔫ·",ᔺ:"ᔭ·",ᔼ:"ᔮ·",ᘢ:"ᕃ","ᣠ":"ᕃ·",ᘣ:"ᕆ",ᘤ:"ᕊ",ᕏ:"ᕌ·",ᖃ:"ᕐb",ᖄ:"ᕐḃ",ᖁ:"ᕐd",ᕿ:"ᕐP",ᙯ:"ᕐᑫ",ᕾ:"ᕐᑬ",ᖀ:"ᕐᑮ",ᖂ:"ᕐᑰ",ᖅ:"ᕐᒃ",ᕜ:"ᕚ·","ᣣ":"ᕞ·","ᣤ":"ᕦ·",ᕩ:"ᕧ·","ᣥ":"ᕫ·","ᣨ":"ᖆ·",ᖑ:"ᖕJ",ᙰ:"ᖕᒉ",ᖎ:"ᖕᒊ",ᖏ:"ᖕᒋ",ᖐ:"ᖕᒌ",ᖒ:"ᖕᒎ",ᖓ:"ᖕᒐ",ᖔ:"ᖕᒑ",ᙳ:"ᖖJ",ᙱ:"ᖖᒋ",ᙲ:"ᖖᒌ",ᙴ:"ᖖᒎ",ᙵ:"ᖖᒐ",ᙶ:"ᖖᒑ","ᣪ":"ᖗ·","ᙷ":"ᖧ·","ᙸ":"ᖨ·","ᙹ":"ᖩ·","ᙺ":"ᖪ·","ᙻ":"ᖫ·","ᙼ":"ᖬ·","ᙽ":"ᖭ·","⪫":"ᗒ","⪪":"ᗕ","ꓷ":"ᗡ","ᣰ":"ᗴ·","ᣲ":"ᘛ·","ᶻ":"ᙆ","ꓭ":"ᙠ","ᶺ":"ᣔ","ᴾ":"ᣖ","ᣜ":"ᣟᐞ",ˡ:"ᣳ",ʳ:"ᣴ",ˢ:"ᣵ","ᣛ":"ᣵ","ꚰ":"ᚹ",ᛡ:"ᚼ","⍿":"ᚽ",ᛂ:"ᚽ","𝈿":"ᛋ","↑":"ᛏ","↿":"ᛐ","⥮":"ᛐ⇂","⥣":"ᛐᛚ","ⵣ":"ᛯ","↾":"ᛚ","⨡":"ᛚ","⋄":"ᛜ","◇":"ᛜ","◊":"ᛜ","♢":"ᛜ","🝔":"ᛜ","𑢷":"ᛜ","𐊔":"ᛜ","⍚":"ᛜ̲","⋈":"ᛞ","⨝":"ᛞ","𐓐":"ᛦ","↕":"ᛨ","𐳼":"𐲂","𐳺":"𐲥",ㄱ:"ᄀ",ᆨ:"ᄀ",ᄁ:"ᄀᄀ",ㄲ:"ᄀᄀ",ᆩ:"ᄀᄀ","ᇺ":"ᄀᄂ","ᅚ":"ᄀᄃ",ᇃ:"ᄀᄅ","ᇻ":"ᄀᄇ",ᆪ:"ᄀᄉ",ㄳ:"ᄀᄉ",ᇄ:"ᄀᄉᄀ","ᇼ":"ᄀᄎ","ᇽ":"ᄀᄏ","ᇾ":"ᄀᄒ",ㄴ:"ᄂ",ᆫ:"ᄂ",ᄓ:"ᄂᄀ",ᇅ:"ᄂᄀ",ᄔ:"ᄂᄂ",ㅥ:"ᄂᄂ","ᇿ":"ᄂᄂ",ᄕ:"ᄂᄃ",ㅦ:"ᄂᄃ",ᇆ:"ᄂᄃ","ퟋ":"ᄂᄅ",ᄖ:"ᄂᄇ","ᅛ":"ᄂᄉ",ᇇ:"ᄂᄉ",ㅧ:"ᄂᄉ","ᅜ":"ᄂᄌ",ᆬ:"ᄂᄌ",ㄵ:"ᄂᄌ","ퟌ":"ᄂᄎ",ᇉ:"ᄂᄐ","ᅝ":"ᄂᄒ",ᆭ:"ᄂᄒ",ㄶ:"ᄂᄒ",ᇈ:"ᄂᅀ",ㅨ:"ᄂᅀ",ㄷ:"ᄃ",ᆮ:"ᄃ",ᄗ:"ᄃᄀ",ᇊ:"ᄃᄀ",ᄄ:"ᄃᄃ",ㄸ:"ᄃᄃ","ퟍ":"ᄃᄃ","ퟎ":"ᄃᄃᄇ","ᅞ":"ᄃᄅ",ᇋ:"ᄃᄅ","ꥠ":"ᄃᄆ","ꥡ":"ᄃᄇ","ퟏ":"ᄃᄇ","ꥢ":"ᄃᄉ","ퟐ":"ᄃᄉ","ퟑ":"ᄃᄉᄀ","ꥣ":"ᄃᄌ","ퟒ":"ᄃᄌ","ퟓ":"ᄃᄎ","ퟔ":"ᄃᄐ",ㄹ:"ᄅ",ᆯ:"ᄅ","ꥤ":"ᄅᄀ",ᆰ:"ᄅᄀ",ㄺ:"ᄅᄀ","ꥥ":"ᄅᄀᄀ","ퟕ":"ᄅᄀᄀ",ᇌ:"ᄅᄀᄉ",ㅩ:"ᄅᄀᄉ","ퟖ":"ᄅᄀᄒ",ᄘ:"ᄅᄂ",ᇍ:"ᄅᄂ","ꥦ":"ᄅᄃ",ᇎ:"ᄅᄃ",ㅪ:"ᄅᄃ","ꥧ":"ᄅᄃᄃ",ᇏ:"ᄅᄃᄒ",ᄙ:"ᄅᄅ",ᇐ:"ᄅᄅ","ퟗ":"ᄅᄅᄏ","ꥨ":"ᄅᄆ",ᆱ:"ᄅᄆ",ㄻ:"ᄅᄆ",ᇑ:"ᄅᄆᄀ",ᇒ:"ᄅᄆᄉ","ퟘ":"ᄅᄆᄒ","ꥩ":"ᄅᄇ",ᆲ:"ᄅᄇ",ㄼ:"ᄅᄇ","ퟙ":"ᄅᄇᄃ","ꥪ":"ᄅᄇᄇ",ᇓ:"ᄅᄇᄉ",ㅫ:"ᄅᄇᄉ","ꥫ":"ᄅᄇᄋ",ᇕ:"ᄅᄇᄋ","ퟚ":"ᄅᄇᄑ",ᇔ:"ᄅᄇᄒ","ꥬ":"ᄅᄉ",ᆳ:"ᄅᄉ",ㄽ:"ᄅᄉ",ᇖ:"ᄅᄉᄉ",ᄛ:"ᄅᄋ","ퟝ":"ᄅᄋ","ꥭ":"ᄅᄌ","ꥮ":"ᄅᄏ",ᇘ:"ᄅᄏ",ᆴ:"ᄅᄐ",ㄾ:"ᄅᄐ",ᆵ:"ᄅᄑ",ㄿ:"ᄅᄑ",ᄚ:"ᄅᄒ",ㅀ:"ᄅᄒ",ᄻ:"ᄅᄒ",ᆶ:"ᄅᄒ","ퟲ":"ᄅᄒ",ᇗ:"ᄅᅀ",ㅬ:"ᄅᅀ","ퟛ":"ᄅᅌ",ᇙ:"ᄅᅙ",ㅭ:"ᄅᅙ","ퟜ":"ᄅᅙᄒ",ㅁ:"ᄆ",ᆷ:"ᄆ","ꥯ":"ᄆᄀ",ᇚ:"ᄆᄀ","ퟞ":"ᄆᄂ","ퟟ":"ᄆᄂᄂ","ꥰ":"ᄆᄃ",ᇛ:"ᄆᄅ","ퟠ":"ᄆᄆ",ᄜ:"ᄆᄇ",ㅮ:"ᄆᄇ",ᇜ:"ᄆᄇ","ퟡ":"ᄆᄇᄉ","ꥱ":"ᄆᄉ",ᇝ:"ᄆᄉ",ㅯ:"ᄆᄉ",ᇞ:"ᄆᄉᄉ",ᄝ:"ᄆᄋ",ㅱ:"ᄆᄋ",ᇢ:"ᄆᄋ","ퟢ":"ᄆᄌ",ᇠ:"ᄆᄎ",ᇡ:"ᄆᄒ",ᇟ:"ᄆᅀ",ㅰ:"ᄆᅀ",ㅂ:"ᄇ",ᆸ:"ᄇ",ᄞ:"ᄇᄀ",ㅲ:"ᄇᄀ",ᄟ:"ᄇᄂ",ᄠ:"ᄇᄃ",ㅳ:"ᄇᄃ","ퟣ":"ᄇᄃ",ᇣ:"ᄇᄅ","ퟤ":"ᄇᄅᄑ","ퟥ":"ᄇᄆ",ᄈ:"ᄇᄇ",ㅃ:"ᄇᄇ","ퟦ":"ᄇᄇ",ᄬ:"ᄇᄇᄋ",ㅹ:"ᄇᄇᄋ",ᄡ:"ᄇᄉ",ㅄ:"ᄇᄉ",ᆹ:"ᄇᄉ",ᄢ:"ᄇᄉᄀ",ㅴ:"ᄇᄉᄀ",ᄣ:"ᄇᄉᄃ",ㅵ:"ᄇᄉᄃ","ퟧ":"ᄇᄉᄃ",ᄤ:"ᄇᄉᄇ",ᄥ:"ᄇᄉᄉ",ᄦ:"ᄇᄉᄌ","ꥲ":"ᄇᄉᄐ",ᄫ:"ᄇᄋ",ㅸ:"ᄇᄋ",ᇦ:"ᄇᄋ",ᄧ:"ᄇᄌ",ㅶ:"ᄇᄌ","ퟨ":"ᄇᄌ",ᄨ:"ᄇᄎ","ퟩ":"ᄇᄎ","ꥳ":"ᄇᄏ",ᄩ:"ᄇᄐ",ㅷ:"ᄇᄐ",ᄪ:"ᄇᄑ",ᇤ:"ᄇᄑ","ꥴ":"ᄇᄒ",ᇥ:"ᄇᄒ",ㅅ:"ᄉ",ᆺ:"ᄉ",ᄭ:"ᄉᄀ",ㅺ:"ᄉᄀ",ᇧ:"ᄉᄀ",ᄮ:"ᄉᄂ",ㅻ:"ᄉᄂ",ᄯ:"ᄉᄃ",ㅼ:"ᄉᄃ",ᇨ:"ᄉᄃ",ᄰ:"ᄉᄅ",ᇩ:"ᄉᄅ",ᄱ:"ᄉᄆ","ퟪ":"ᄉᄆ",ᄲ:"ᄉᄇ",ㅽ:"ᄉᄇ",ᇪ:"ᄉᄇ",ᄳ:"ᄉᄇᄀ","ퟫ":"ᄉᄇᄋ",ᄊ:"ᄉᄉ",ㅆ:"ᄉᄉ",ᆻ:"ᄉᄉ","ퟬ":"ᄉᄉᄀ","ퟭ":"ᄉᄉᄃ","ꥵ":"ᄉᄉᄇ",ᄴ:"ᄉᄉᄉ",ᄵ:"ᄉᄋ",ᄶ:"ᄉᄌ",ㅾ:"ᄉᄌ","ퟯ":"ᄉᄌ",ᄷ:"ᄉᄎ","ퟰ":"ᄉᄎ",ᄸ:"ᄉᄏ",ᄹ:"ᄉᄐ","ퟱ":"ᄉᄐ",ᄺ:"ᄉᄑ","ퟮ":"ᄉᅀ",ㅇ:"ᄋ",ᆼ:"ᄋ",ᅁ:"ᄋᄀ",ᇬ:"ᄋᄀ",ᇭ:"ᄋᄀᄀ",ᅂ:"ᄋᄃ","ꥶ":"ᄋᄅ",ᅃ:"ᄋᄆ",ᅄ:"ᄋᄇ",ᅅ:"ᄋᄉ",ᇱ:"ᄋᄉ",ㆂ:"ᄋᄉ",ᅇ:"ᄋᄋ",ㆀ:"ᄋᄋ",ᇮ:"ᄋᄋ",ᅈ:"ᄋᄌ",ᅉ:"ᄋᄎ",ᇯ:"ᄋᄏ",ᅊ:"ᄋᄐ",ᅋ:"ᄋᄑ","ꥷ":"ᄋᄒ",ᅆ:"ᄋᅀ",ᇲ:"ᄋᅀ",ㆃ:"ᄋᅀ",ㅈ:"ᄌ",ᆽ:"ᄌ","ퟷ":"ᄌᄇ","ퟸ":"ᄌᄇᄇ",ᅍ:"ᄌᄋ",ᄍ:"ᄌᄌ",ㅉ:"ᄌᄌ","ퟹ":"ᄌᄌ","ꥸ":"ᄌᄌᄒ",ㅊ:"ᄎ",ᆾ:"ᄎ",ᅒ:"ᄎᄏ",ᅓ:"ᄎᄒ",ㅋ:"ᄏ",ᆿ:"ᄏ",ㅌ:"ᄐ",ᇀ:"ᄐ","ꥹ":"ᄐᄐ",ㅍ:"ᄑ",ᇁ:"ᄑ",ᅖ:"ᄑᄇ",ᇳ:"ᄑᄇ","ퟺ":"ᄑᄉ",ᅗ:"ᄑᄋ",ㆄ:"ᄑᄋ",ᇴ:"ᄑᄋ","ퟻ":"ᄑᄐ","ꥺ":"ᄑᄒ",ㅎ:"ᄒ",ᇂ:"ᄒ",ᇵ:"ᄒᄂ",ᇶ:"ᄒᄅ",ᇷ:"ᄒᄆ",ᇸ:"ᄒᄇ","ꥻ":"ᄒᄉ",ᅘ:"ᄒᄒ",ㆅ:"ᄒᄒ",ᄽ:"ᄼᄼ",ᄿ:"ᄾᄾ",ㅿ:"ᅀ",ᇫ:"ᅀ","ퟳ":"ᅀᄇ","ퟴ":"ᅀᄇᄋ",ㆁ:"ᅌ",ᇰ:"ᅌ","ퟵ":"ᅌᄆ","ퟶ":"ᅌᄒ",ᅏ:"ᅎᅎ",ᅑ:"ᅐᅐ",ㆆ:"ᅙ",ᇹ:"ᅙ","ꥼ":"ᅙᅙ",ㅤ:"ᅠ",ㅏ:"ᅡ","ᆣ":"ᅡー",ᅶ:"ᅡᅩ",ᅷ:"ᅡᅮ",ᅢ:"ᅡ丨",ㅐ:"ᅡ丨",ㅑ:"ᅣ",ᅸ:"ᅣᅩ",ᅹ:"ᅣᅭ","ᆤ":"ᅣᅮ",ᅤ:"ᅣ丨",ㅒ:"ᅣ丨",ㅓ:"ᅥ",ᅼ:"ᅥー",ᅺ:"ᅥᅩ",ᅻ:"ᅥᅮ",ᅦ:"ᅥ丨",ㅔ:"ᅥ丨",ㅕ:"ᅧ","ᆥ":"ᅧᅣ",ᅽ:"ᅧᅩ",ᅾ:"ᅧᅮ",ᅨ:"ᅧ丨",ㅖ:"ᅧ丨",ㅗ:"ᅩ",ᅪ:"ᅩᅡ",ㅘ:"ᅩᅡ",ᅫ:"ᅩᅡ丨",ㅙ:"ᅩᅡ丨","ᆦ":"ᅩᅣ","ᆧ":"ᅩᅣ丨",ᅿ:"ᅩᅥ",ᆀ:"ᅩᅥ丨","ힰ":"ᅩᅧ",ᆁ:"ᅩᅧ丨",ᆂ:"ᅩᅩ","ힱ":"ᅩᅩ丨",ᆃ:"ᅩᅮ",ᅬ:"ᅩ丨",ㅚ:"ᅩ丨",ㅛ:"ᅭ","ힲ":"ᅭᅡ","ힳ":"ᅭᅡ丨",ᆄ:"ᅭᅣ",ㆇ:"ᅭᅣ",ᆆ:"ᅭᅣ",ᆅ:"ᅭᅣ丨",ㆈ:"ᅭᅣ丨","ힴ":"ᅭᅥ",ᆇ:"ᅭᅩ",ᆈ:"ᅭ丨",ㆉ:"ᅭ丨",ㅜ:"ᅮ",ᆉ:"ᅮᅡ",ᆊ:"ᅮᅡ丨",ᅯ:"ᅮᅥ",ㅝ:"ᅮᅥ",ᆋ:"ᅮᅥー",ᅰ:"ᅮᅥ丨",ㅞ:"ᅮᅥ丨","ힵ":"ᅮᅧ",ᆌ:"ᅮᅧ丨",ᆍ:"ᅮᅮ",ᅱ:"ᅮ丨",ㅟ:"ᅮ丨","ힶ":"ᅮ丨丨",ㅠ:"ᅲ",ᆎ:"ᅲᅡ","ힷ":"ᅲᅡ丨",ᆏ:"ᅲᅥ",ᆐ:"ᅲᅥ丨",ᆑ:"ᅲᅧ",ㆊ:"ᅲᅧ",ᆒ:"ᅲᅧ丨",ㆋ:"ᅲᅧ丨","ힸ":"ᅲᅩ",ᆓ:"ᅲᅮ",ᆔ:"ᅲ丨",ㆌ:"ᅲ丨",ㆍ:"ᆞ","ퟅ":"ᆞᅡ",ᆟ:"ᆞᅥ","ퟆ":"ᆞᅥ丨",ᆠ:"ᆞᅮ",ᆢ:"ᆞᆞ",ᆡ:"ᆞ丨",ㆎ:"ᆞ丨",ヘ:"へ","⍁":"〼","⧄":"〼","꒞":"ꁊ","꒬":"ꁐ","꒜":"ꃀ","꒨":"ꄲ","꒿":"ꉙ","꒾":"ꊱ","꒔":"ꋍ","꓀":"ꎫ","꓂":"ꎵ","꒺":"ꎿ","꒰":"ꏂ","꒧":"ꑘ","⊥":"ꓕ","⟂":"ꓕ","𝈜":"ꓕ","Ʇ":"ꓕ","Ꞟ":"ꓤ","⅁":"ꓨ","⅂":"ꓶ","𝈕":"ꓶ","𝈫":"ꓶ","𖼦":"ꓶ","𐐑":"ꓶ","⅃":"𖼀","𑫦":"𑫥𑫯","𑫨":"𑫥𑫥","𑫩":"𑫥𑫥𑫯","𑫪":"𑫥𑫥𑫰","𑫧":"𑫥𑫰","𑫴":"𑫳𑫯","𑫶":"𑫳𑫳","𑫷":"𑫳𑫳𑫯","𑫸":"𑫳𑫳𑫰","𑫵":"𑫳𑫰","𑫬":"𑫫𑫯","𑫭":"𑫫𑫫","𑫮":"𑫫𑫫𑫯","⊕":"𐊨","⨁":"𐊨","🜨":"𐊨","Ꚛ":"𐊨","▽":"𐊼","𝈔":"𐊼","🜄":"𐊼","⧖":"𐋀","ꞛ":"𐐺","Ꞛ":"𐐒","𐒠":"𐒆","𐏑":"𐎂","𐏓":"𐎓","𒀸":"𐎚","☥":"𐦞","𓋹":"𐦞","〹":"卄",不:"不","丽":"丽","並":"並","⎜":"丨","⎟":"丨","⎢":"丨","⎥":"丨","⎪":"丨","⎮":"丨","㇑":"丨",ᅵ:"丨",ㅣ:"丨","⼁":"丨",ᆜ:"丨ー",ᆘ:"丨ᅡ",ᆙ:"丨ᅣ","ힽ":"丨ᅣᅩ","ힾ":"丨ᅣ丨","ힿ":"丨ᅧ","ퟀ":"丨ᅧ丨",ᆚ:"丨ᅩ","ퟁ":"丨ᅩ丨","ퟂ":"丨ᅭ",ᆛ:"丨ᅮ","ퟃ":"丨ᅲ",ᆝ:"丨ᆞ","ퟄ":"丨丨",串:"串","丸":"丸",丹:"丹","乁":"乁","㇠":"乙","⼄":"乙","㇟":"乚","⺃":"乚","㇖":"乛","⺂":"乛","⻲":"亀",亂:"亂","㇚":"亅","⼅":"亅",了:"了",ニ:"二","⼆":"二","𠄢":"𠄢","⼇":"亠",亮:"亮","⼈":"人",イ:"亻","⺅":"亻",什:"什","仌":"仌",令:"令","你":"你",倂:"併","倂":"併","侀":"侀",來:"來",例:"例","侮":"侮","侮":"侮","侻":"侻",便:"便",值:"値",倫:"倫","偺":"偺","備":"備","像":"像",僚:"僚","僧":"僧","僧":"僧","㒞":"㒞","⼉":"儿",兀:"兀","⺎":"兀","充":"充","免":"免","免":"免","兔":"兔","兤":"兤","⼊":"入","內":"內","全":"全",兩:"兩",ハ:"八","⼋":"八",六:"六","具":"具","𠔜":"𠔜","𠔥":"𠔥","冀":"冀","㒹":"㒹","⼌":"冂","再":"再","𠕋":"𠕋","冒":"冒","冕":"冕","㒻":"㒻","最":"最","⼍":"冖","冗":"冗","冤":"冤","⼎":"冫","冬":"冬","况":"况","况":"况",冷:"冷",凉:"凉",凌:"凌",凜:"凜",凞:"凞","⼏":"几","𠘺":"𠘺","凵":"凵","⼐":"凵","⼑":"刀","⺉":"刂","刃":"刃",切:"切","切":"切",列:"列",利:"利","㓟":"㓟",刺:"刺","刻":"刻","剆":"剆","割":"割","剷":"剷",劉:"劉","𠠄":"𠠄",カ:"力",力:"力","⼒":"力",劣:"劣","㔕":"㔕","劳":"劳","勇":"勇","勇":"勇","勉":"勉","勉":"勉",勒:"勒",勞:"勞","勤":"勤","勤":"勤",勵:"勵","⼓":"勹","勺":"勺","勺":"勺","包":"包","匆":"匆","𠣞":"𠣞","⼔":"匕",北:"北","北":"北","⼕":"匚","⼖":"匸",匿:"匿","⼗":"十","〸":"十","〺":"卅","卉":"卉","࿖":"卍","࿕":"卐","卑":"卑","卑":"卑","博":"博",ト:"卜","⼘":"卜","⼙":"卩","⺋":"㔾","即":"即",卵:"卵","卽":"卽","卿":"卿","卿":"卿","卿":"卿","⼚":"厂","𠨬":"𠨬","⼛":"厶",參:"參","⼜":"又","及":"及","叟":"叟","𠭣":"𠭣",ロ:"口","⼝":"口",囗:"口","⼞":"口",句:"句","叫":"叫","叱":"叱","吆":"吆",吏:"吏",吝:"吝","吸":"吸",呂:"呂","呈":"呈","周":"周","咞":"咞","咢":"咢",咽:"咽",䎛:"㖈","哶":"哶","唐":"唐","啓":"啓",啟:"啓","啕":"啕","啣":"啣","善":"善","善":"善",喇:"喇","喙":"喙","喙":"喙","喝":"喝","喝":"喝","喫":"喫","喳":"喳",嗀:"嗀","嗂":"嗂","嗢":"嗢","嘆":"嘆","嘆":"嘆","噑":"噑","噴":"噴","器":"器",囹:"囹","圖":"圖","圗":"圗","⼟":"土",士:"土","⼠":"土","型":"型","城":"城",㦳:"㘽","埴":"埴","堍":"堍","報":"報","堲":"堲","塀":"塀",塚:"塚","塚":"塚",塞:"塞",填:"塡",壿:"墫","墬":"墬","墳":"墳",壘:"壘",壟:"壟","𡓤":"𡓤","壮":"壮","売":"売","壷":"壷","⼡":"夂","夆":"夆","⼢":"夊",タ:"夕","⼣":"夕","多":"多","夢":"夢","⼤":"大","奄":"奄",奈:"奈",契:"契","奔":"奔","奢":"奢",女:"女","⼥":"女","𡚨":"𡚨","𡛪":"𡛪","姘":"姘","姬":"姬","娛":"娛","娧":"娧","婢":"婢","婦":"婦",嬀:"媯","㛮":"㛮","㛼":"㛼","媵":"媵","嬈":"嬈","嬨":"嬨","嬾":"嬾","嬾":"嬾","⼦":"子","⼧":"宀",宅:"宅","𡧈":"𡧈","寃":"寃","寘":"寘",寧:"寧",寧:"寧","寧":"寧",寮:"寮","寳":"寳","𡬘":"𡬘","⼨":"寸","寿":"寿","将":"将","⼩":"小","尢":"尢","⺐":"尢","⼪":"尢","⺏":"尣","㞁":"㞁","⼫":"尸",尿:"尿","屠":"屠",屢:"屢","層":"層",履:"履","屮":"屮","屮":"屮","⼬":"屮","𡴋":"𡴋","⼭":"山","峀":"峀","岍":"岍","𡷤":"𡷤","𡷦":"𡷦",崙:"崙","嵃":"嵃",嵐:"嵐","嵫":"嵫","嵮":"嵮","嵼":"嵼","嶲":"嶲",嶺:"嶺","⼮":"巛","巢":"巢",エ:"工","⼯":"工","⼰":"己","⺒":"巳","㠯":"㠯","巽":"巽","⼱":"巾",帲:"帡","帨":"帨","帽":"帽","幩":"幩","㡢":"㡢","𢆃":"𢆃","⼲":"干",年:"年","𢆟":"𢆟","⺓":"幺","⼳":"幺","⼴":"广",度:"度","㡼":"㡼","庰":"庰","庳":"庳","庶":"庶",廊:"廊","廊":"廊",廉:"廉","廒":"廒",廓:"廓","廙":"廙",廬:"廬","⼵":"廴","廾":"廾","⼶":"廾","𢌱":"𢌱","𢌱":"𢌱",弄:"弄","⼷":"弋","⼸":"弓","弢":"弢","弢":"弢","⼹":"彐","⺔":"彑","当":"当","㣇":"㣇","⼺":"彡","形":"形","彩":"彩","彫":"彫","⼻":"彳",律:"律","㣣":"㣣","徚":"徚",復:"復","徭":"徭","⼼":"心","⺖":"忄","⺗":"㣺","忍":"忍","志":"志",念:"念","忹":"忹",怒:"怒",怜:"怜","恵":"恵","㤜":"㤜","㤺":"㤺","悁":"悁","悔":"悔","悔":"悔","惇":"惇","惘":"惘",惡:"惡","𢛔":"𢛔","愈":"愈","慨":"慨",慄:"慄","慈":"慈","慌":"慌","慌":"慌","慎":"慎","慎":"慎","慠":"慠","慺":"慺","憎":"憎","憎":"憎","憎":"憎",憐:"憐","憤":"憤","憯":"憯","憲":"憲","𢡄":"𢡄","𢡊":"𢡊","懞":"懞","懲":"懲","懲":"懲","懲":"懲",懶:"懶","懶":"懶",戀:"戀","⼽":"戈","成":"成","戛":"戛",戮:"戮","戴":"戴","⼾":"戶",戸:"戶","⼿":"手","⺘":"扌","扝":"扝","抱":"抱",拉:"拉",拏:"拏",拓:"拓","拔":"拔","拼":"拼",拾:"拾","𢬌":"𢬌","挽":"挽","捐":"捐","捨":"捨",捻:"捻","掃":"掃",掠:"掠","掩":"掩","揄":"揄","揤":"揤","摒":"摒","𢯱":"𢯱","搜":"搜","搢":"搢","揅":"揅","摩":"摩","摷":"摷","摾":"摾","㨮":"㨮",搉:"㩁",撚:"撚","撝":"撝",擄:"擄","㩬":"㩬","⽀":"支","⽁":"攴","⺙":"攵","敏":"敏","敏":"敏","敖":"敖","敬":"敬",數:"數","𣀊":"𣀊","⽂":"文","⻫":"斉","⽃":"斗",料:"料","⽄":"斤","⽅":"方",旅:"旅","⽆":"无","⺛":"旡","既":"既","旣":"旣","⽇":"日",易:"易",曶:"㫚","㫤":"㫤","晉":"晉",晩:"晚",晴:"晴","晴":"晴","暑":"暑","暑":"暑",暈:"暈","㬈":"㬈","暜":"暜",暴:"暴",曆:"曆","㬙":"㬙","𣊸":"𣊸","⽈":"曰",更:"更","書":"書","⽉":"月","𣍟":"𣍟",肦:"朌",胐:"朏",胊:"朐",脁:"朓",胶:"㬵",朗:"朗","朗":"朗","朗":"朗",脧:"朘","望":"望","望":"望",幐:"㬺",䐠:"㬻","𣎓":"𣎓",膧:"朣","𣎜":"𣎜","⽊":"木",李:"李","杓":"杓","杖":"杖","杞":"杞","𣏃":"𣏃",柿:"杮",杻:"杻","枅":"枅",林:"林","㭉":"㭉","𣏕":"𣏕",柳:"柳","柺":"柺",栗:"栗","栟":"栟","桒":"桒","𣑭":"𣑭",梁:"梁","梅":"梅","梅":"梅","梎":"梎",梨:"梨","椔":"椔","楂":"楂","㮝":"㮝","㮝":"㮝",槩:"㮣",樧:"榝","榣":"榣","槪":"槪",樂:"樂",樂:"樂",樂:"樂",樓:"樓","𣚣":"𣚣","檨":"檨",櫓:"櫓","櫛":"櫛",欄:"欄","㰘":"㰘","⽋":"欠","次":"次","𣢧":"𣢧","歔":"歔","㱎":"㱎","⽌":"止","⻭":"歯","歲":"歲",歷:"歷","歹":"歹","⽍":"歹","⺞":"歺","殟":"殟",殮:"殮","⽎":"殳",殺:"殺","殺":"殺","殺":"殺","殻":"殻","𣪍":"𣪍","⽏":"毋","⺟":"母","𣫺":"𣫺","⽐":"比","⽑":"毛","⽒":"氏","⺠":"民","⽓":"气","⽔":"水","⺡":"氵","⺢":"氺","汎":"汎","汧":"汧",沈:"沈","沿":"沿",泌:"泌","泍":"泍",泥:"泥","𣲼":"𣲼",洛:"洛",洞:"洞","洴":"洴","派":"派",流:"流","流":"流","流":"流","洖":"洖","浩":"浩",浪:"浪","海":"海","海":"海","浸":"浸","涅":"涅","𣴞":"𣴞",淋:"淋",淚:"淚",淪:"淪","淹":"淹","渚":"渚","港":"港","湮":"湮",潙:"溈","滋":"滋","滋":"滋",溜:"溜",溺:"溺","滇":"滇",滑:"滑","滛":"滛","㴳":"㴳",漏:"漏","漢":"漢","漢":"漢",漣:"漣","𣻑":"𣻑","潮":"潮","𣽞":"𣽞","𣾎":"𣾎","濆":"濆",濫:"濫",濾:"濾","瀛":"瀛","瀞":"瀞","瀞":"瀞","瀹":"瀹","灊":"灊","㶖":"㶖","⽕":"火","⺣":"灬","灰":"灰","灷":"灷","災":"災",炙:"炙","炭":"炭",烈:"烈",烙:"烙","煮":"煮","煮":"煮","𤉣":"𤉣","煅":"煅",煉:"煉","𤋮":"𤋮","熜":"熜",燎:"燎",燐:"燐","𤎫":"𤎫",爐:"爐",爛:"爛","爨":"爨","⽖":"爪","爫":"爫","⺤":"爫","爵":"爵","爵":"爵","⽗":"父","⽘":"爻","⺦":"丬","⽙":"爿","⽚":"片","牐":"牐","⽛":"牙","𤘈":"𤘈","⽜":"牛",牢:"牢","犀":"犀","犕":"犕","⽝":"犬","⺨":"犭","犯":"犯",狀:"狀","𤜵":"𤜵",狼:"狼",猪:"猪","猪":"猪","𤠔":"𤠔",獵:"獵","獺":"獺","⽞":"玄",率:"率",率:"率","⽟":"玉","王":"王","㺬":"㺬","玥":"玥",玲:"玲","㺸":"㺸","㺸":"㺸",珞:"珞",琉:"琉",理:"理","琢":"琢","瑇":"瑇","瑜":"瑜",瑩:"瑩","瑱":"瑱","瑱":"瑱","璅":"璅",璉:"璉",璘:"璘","瓊":"瓊","⽠":"瓜","⽡":"瓦","㼛":"㼛","甆":"甆","⽢":"甘","⽣":"生","甤":"甤","⽤":"用","⽥":"田","画":"画","甾":"甾","𤰶":"𤰶",留:"留",略:"略",異:"異","異":"異","𤲒":"𤲒","⽦":"疋","⽧":"疒",痢:"痢","瘐":"瘐","瘟":"瘟","瘝":"瘝",療:"療",癩:"癩","⽨":"癶","⽩":"白","𤾡":"𤾡","𤾸":"𤾸","⽪":"皮","⽫":"皿","𥁄":"𥁄","㿼":"㿼",益:"益","益":"益","盛":"盛",盧:"盧","䀈":"䀈","⽬":"目","直":"直","直":"直","𥃲":"𥃲","𥃳":"𥃳",省:"省","䀘":"䀘","𥄙":"𥄙","眞":"眞","真":"真","真":"真","𥄳":"𥄳","着":"着","睊":"睊","睊":"睊","鿃":"䀹","䀹":"䀹","䀹":"䀹",晣:"䀿","䁆":"䁆","瞋":"瞋","𥉉":"𥉉","瞧":"瞧","⽭":"矛","⽮":"矢","⽯":"石","䂖":"䂖","𥐝":"𥐝",硏:"研","硎":"硎",硫:"硫",碌:"碌","碌":"碌","碑":"碑",磊:"磊","磌":"磌","磌":"磌",磻:"磻","䃣":"䃣",礪:"礪","⽰":"示","⺭":"礻",礼:"礼","社":"社","祈":"祈","祉":"祉","𥘦":"𥘦","祐":"祐","祖":"祖","祖":"祖","祝":"祝",神:"神",祥:"祥","視":"視","視":"視",祿:"祿","𥚚":"𥚚","禍":"禍","禎":"禎",福:"福","福":"福","𥛅":"𥛅",禮:"禮","⽱":"禸","⽲":"禾",秊:"秊","䄯":"䄯","秫":"秫",稜:"稜","穊":"穊","穀":"穀","穀":"穀","穏":"穏","⽳":"穴","突":"突","𥥼":"𥥼","窱":"窱",立:"立","⽴":"立","⻯":"竜","𥪧":"𥪧","𥪧":"𥪧","竮":"竮","⽵":"竹",笠:"笠","節":"節","節":"節","䈂":"䈂","𥮫":"𥮫","篆":"篆","䈧":"䈧","築":"築","𥲀":"𥲀","𥳐":"𥳐",簾:"簾",籠:"籠","⽶":"米","类":"类",粒:"粒",精:"精","糒":"糒",糖:"糖","糨":"糨","䊠":"䊠","糣":"糣",糧:"糧","⽷":"糸","⺯":"糹","𥾆":"𥾆","紀":"紀",紐:"紐",索:"索",累:"累",絶:"絕","絣":"絣","絛":"絛",綠:"綠",綾:"綾","緇":"緇",練:"練","練":"練","練":"練","縂":"縂","䌁":"䌁","縉":"縉",縷:"縷","繁":"繁","繅":"繅","𦇚":"𦇚","䌴":"䌴","⽸":"缶","𦈨":"𦈨","缾":"缾","𦉇":"𦉇","⽹":"网","⺫":"罒","⺲":"罒","⺱":"罓","䍙":"䍙","署":"署","𦋙":"𦋙",罹:"罹","罺":"罺",羅:"羅","𦌾":"𦌾","⽺":"羊","羕":"羕",羚:"羚",羽:"羽","⽻":"羽","翺":"翺",老:"老","⽼":"老","⺹":"耂","者":"者","者":"者","者":"者","⽽":"而","𦓚":"𦓚","⽾":"耒","𦔣":"𦔣","⽿":"耳",聆:"聆","聠":"聠","𦖨":"𦖨",聯:"聯","聰":"聰",聾:"聾","⾀":"聿","⺺":"肀","⾁":"肉",肋:"肋","肭":"肭","育":"育","䏕":"䏕","䏙":"䏙",腁:"胼","脃":"脃","脾":"脾","䐋":"䐋","朡":"朡","𦞧":"𦞧","𦞵":"𦞵",朦:"䑃",臘:"臘","⾂":"臣",臨:"臨","⾃":"自","臭":"臭","⾄":"至","⾅":"臼","舁":"舁","舁":"舁","舄":"舄","⾆":"舌","舘":"舘","⾇":"舛","⾈":"舟","䑫":"䑫","⾉":"艮",良:"良","⾊":"色","⾋":"艸","艹":"艹","艹":"艹","⺾":"艹","⺿":"艹","⻀":"艹","芋":"芋","芑":"芑","芝":"芝","花":"花","芳":"芳","芽":"芽",若:"若","若":"若","苦":"苦","𦬼":"𦬼",茶:"茶","荒":"荒","荣":"荣","茝":"茝","茣":"茣","莽":"莽","荓":"荓",菉:"菉","菊":"菊","菌":"菌","菜":"菜","菧":"菧","華":"華",菱:"菱","著":"著","著":"著","𦰶":"𦰶","莭":"莭",落:"落",葉:"葉",蔿:"蒍","𦳕":"𦳕","𦵫":"𦵫",蓮:"蓮","蓱":"蓱","蓳":"蓳",蓼:"蓼","蔖":"蔖","䔫":"䔫","蕤":"蕤","𦼬":"𦼬",藍:"藍","䕝":"䕝","𦾱":"𦾱","䕡":"䕡",藺:"藺",蘆:"蘆","䕫":"䕫",蘒:"蘒",蘭:"蘭","𧃒":"𧃒",虁:"蘷",蘿:"蘿","⾌":"虍","⻁":"虎","虐":"虐",虜:"虜","虜":"虜","虧":"虧","虩":"虩","⾍":"虫","蚩":"蚩","蚈":"蚈","蛢":"蛢","蜎":"蜎","蜨":"蜨","蝫":"蝫","蟡":"蟡","蝹":"蝹","蝹":"蝹","螆":"螆","䗗":"䗗","𧏊":"𧏊",螺:"螺","蠁":"蠁","䗹":"䗹",蠟:"蠟","⾎":"血",行:"行","⾏":"行","衠":"衠","衣":"衣","⾐":"衣","⻂":"衤",裂:"裂","𧙧":"𧙧",裏:"裏","裗":"裗","裞":"裞",裡:"裡",裸:"裸","裺":"裺","䘵":"䘵","褐":"褐","襁":"襁",襤:"襤","⾑":"襾","⻄":"西","⻃":"覀","覆":"覆",見:"見","⾒":"見","𧢮":"𧢮","⻅":"见","⾓":"角","⾔":"言","𧥦":"𧥦",詽:"訮",訞:"䚶","䚾":"䚾","䛇":"䛇","誠":"誠",說:"說",說:"說","調":"調","請":"請",諒:"諒",論:"論","諭":"諭","諭":"諭",諸:"諸","諸":"諸",諾:"諾","諾":"諾","謁":"謁","謁":"謁","謹":"謹","謹":"謹",識:"識",讀:"讀",讏:"讆","變":"變","變":"變","⻈":"讠","⾕":"谷","⾖":"豆",豈:"豈","豕":"豕","⾗":"豕",豣:"豜","⾘":"豸","𧲨":"𧲨","⾙":"貝","貫":"貫","賁":"賁",賂:"賂",賈:"賈","賓":"賓","贈":"贈","贈":"贈","贛":"贛","⻉":"贝","⾚":"赤","⾛":"走","起":"起",趆:"赿","𧻓":"𧻓","𧼯":"𧼯","⾜":"足","跋":"跋","趼":"趼",跺:"跥",路:"路","跰":"跰",躛:"躗","⾝":"身",車:"車","⾞":"車","軔":"軔",輧:"軿",輦:"輦",輪:"輪","輸":"輸","輸":"輸",輻:"輻",轢:"轢","⻋":"车","⾟":"辛","辞":"辞",辰:"辰","⾠":"辰","⾡":"辵","辶":"辶","⻌":"辶","⻍":"辶","巡":"巡",連:"連",逸:"逸","逸":"逸","遲":"遲",遼:"遼","𨗒":"𨗒","𨗭":"𨗭",邏:"邏","⾢":"邑","邔":"邔",郎:"郎",郞:"郎","郞":"郎","郱":"郱",都:"都","𨜮":"𨜮","鄑":"鄑","鄛":"鄛","⾣":"酉",酪:"酪","醙":"醙",醴:"醴","⾤":"釆",里:"里","⾥":"里",量:"量",金:"金","⾦":"金",鈴:"鈴","鈸":"鈸","鉶":"鉶","鋗":"鋗","鋘":"鋘","鉼":"鉼",錄:"錄",鍊:"鍊",鎮:"鎭","鏹":"鏹","鐕":"鐕","𨯺":"𨯺","⻐":"钅","⻑":"長","⾧":"長","⻒":"镸","⻓":"长","⾨":"門","開":"開","䦕":"䦕",閭:"閭","閷":"閷","𨵷":"𨵷","⻔":"门","⾩":"阜","⻏":"阝","⻖":"阝",阮:"阮",陋:"陋",降:"降",陵:"陵",陸:"陸","陼":"陼",隆:"隆",隣:"隣","䧦":"䧦","⾪":"隶","隷":"隷",隸:"隷",隸:"隷","⾫":"隹","雃":"雃",離:"離","難":"難","難":"難","⾬":"雨",零:"零",雷:"雷","霣":"霣","𩅅":"𩅅",露:"露",靈:"靈","⾭":"靑","⻘":"青",靖:"靖","靖":"靖","𩇟":"𩇟","⾮":"非","⾯":"面","𩈚":"𩈚","⾰":"革","䩮":"䩮","䩶":"䩶","⾱":"韋","韛":"韛","韠":"韠","⻙":"韦","⾲":"韭","𩐊":"𩐊","⾳":"音","響":"響","響":"響","⾴":"頁","䪲":"䪲","頋":"頋","頋":"頋","頋":"頋",領:"領","頩":"頩","𩒖":"𩒖","頻":"頻","頻":"頻",類:"類","⻚":"页","⾵":"風","𩖶":"𩖶","⻛":"风","⾶":"飛","⻜":"飞","⻝":"食","⾷":"食","⻟":"飠","飢":"飢",飯:"飯",飼:"飼","䬳":"䬳",館:"館","餩":"餩","⻠":"饣","⾸":"首","⾹":"香","馧":"馧","⾺":"馬","駂":"駂",駱:"駱","駾":"駾",驪:"驪","⻢":"马","⾻":"骨","䯎":"䯎","⾼":"高","⾽":"髟","𩬰":"𩬰","鬒":"鬒","鬒":"鬒","⾾":"鬥","⾿":"鬯","⿀":"鬲","⿁":"鬼","⻤":"鬼","⿂":"魚",魯:"魯","鱀":"鱀",鱗:"鱗","⻥":"鱼","⿃":"鳥","鳽":"鳽","䳎":"䳎","鵧":"鵧","䳭":"䳭","𪃎":"𪃎",鶴:"鶴","𪄅":"𪄅","䳸":"䳸",鷺:"鷺","𪈎":"𪈎",鸞:"鸞",鹃:"鹂","⿄":"鹵",鹿:"鹿","⿅":"鹿","𪊑":"𪊑",麗:"麗",麟:"麟","⿆":"麥","⻨":"麦","麻":"麻","⿇":"麻","𪎒":"𪎒","⿈":"黃","⻩":"黄","⿉":"黍",黎:"黎","䵖":"䵖","⿊":"黑",黒:"黑","墨":"墨","黹":"黹","⿋":"黹","⿌":"黽","鼅":"鼅","黾":"黾","⿍":"鼎","鼏":"鼏","⿎":"鼓","鼖":"鼖","⿏":"鼠","鼻":"鼻","⿐":"鼻","齃":"齃","⿑":"齊","⻬":"齐","⿒":"齒","𪘀":"𪘀","⻮":"齿",龍:"龍","⿓":"龍","龎":"龎","⻰":"龙",龜:"龜",龜:"龜","龜":"龜","⿔":"龜","⻳":"龟","⿕":"龠"};var YI,QF;function ove(){if(QF)return YI;QF=1;var t=sve;function e(s){return s.replace(/([.?*+^$[\]\\(){}|-])/g,"\\$1")}var n=RegExp(Object.keys(t).map(e).join("|"),"g");function r(s){return t[s]}function i(s){return s.replace(n,r)}return YI=i,YI}var ave=ove();const cve=Dl(ave),lve=Object.prototype.toString,uve=t=>lve.call(t)==="[object Error]",dve=new Set(["network error","Failed to fetch","NetworkError when attempting to fetch resource.","The Internet connection appears to be offline.","Network request failed","fetch failed","terminated"," A network error occurred.","Network connection lost"]);function fve(t){if(!(t&&uve(t)&&t.name==="TypeError"&&typeof t.message=="string"))return!1;const{message:n,stack:r}=t;return n==="Load failed"?r===void 0||"__sentry_captured__"in t:n.startsWith("error sending request for url")?!0:dve.has(n)}function hve(t){if(typeof t=="number"){if(t<0)throw new TypeError("Expected `retries` to be a non-negative number.");if(Number.isNaN(t))throw new TypeError("Expected `retries` to be a valid number or Infinity, got NaN.")}else if(t!==void 0)throw new TypeError("Expected `retries` to be a number or Infinity.")}function J2(t,e,{min:n=0,allowInfinity:r=!1}={}){if(e!==void 0){if(typeof e!="number"||Number.isNaN(e))throw new TypeError(`Expected \`${t}\` to be a number${r?" or Infinity":""}.`);if(!r&&!Number.isFinite(e))throw new TypeError(`Expected \`${t}\` to be a finite number.`);if(e<n)throw new TypeError(`Expected \`${t}\` to be ≥ ${n}.`)}}class MJ extends Error{constructor(e){super(),e instanceof Error?(this.originalError=e,{message:e}=e):(this.originalError=new Error(e),this.originalError.stack=this.stack),this.name="AbortError",this.message=e}}const pve=(t,e,n)=>{const r=n.retries-(e-1);return Object.freeze({error:t,attemptNumber:e,retriesLeft:r})};function mve(t,e){const n=e.randomize?Math.random()+1:1;let r=Math.round(n*Math.max(e.minTimeout,1)*e.factor**(t-1));return r=Math.min(r,e.maxTimeout),r}async function gve(t,e,n,r,i){let s=t;if(s instanceof Error||(s=new TypeError(`Non-error was thrown: "${s}". You should only throw errors.`)),s instanceof MJ)throw s.originalError;if(s instanceof TypeError&&!fve(s))throw s;const o=pve(s,e,n);await n.onFailedAttempt(o);const a=Date.now();if(a-r>=i||e>=n.retries+1||!await n.shouldRetry(o))throw s;const c=mve(e,n),l=i-(a-r);if(l<=0)throw s;const d=Math.min(c,l);d>0&&await new Promise((h,m)=>{const g=()=>{clearTimeout(y),n.signal?.removeEventListener("abort",g),m(n.signal.reason)},y=setTimeout(()=>{n.signal?.removeEventListener("abort",g),h()},d);n.unref&&y.unref?.(),n.signal?.addEventListener("abort",g,{once:!0})}),n.signal?.throwIfAborted()}async function vve(t,e={}){if(e={...e},hve(e.retries),Object.hasOwn(e,"forever"))throw new Error("The `forever` option is no longer supported. For many use-cases, you can set `retries: Infinity` instead.");e.retries??=10,e.factor??=2,e.minTimeout??=1e3,e.maxTimeout??=Number.POSITIVE_INFINITY,e.randomize??=!1,e.onFailedAttempt??=()=>{},e.shouldRetry??=()=>!0,J2("factor",e.factor,{min:0,allowInfinity:!1}),J2("minTimeout",e.minTimeout,{min:0,allowInfinity:!1}),J2("maxTimeout",e.maxTimeout,{min:0,allowInfinity:!0});const n=e.maxRetryTime??Number.POSITIVE_INFINITY;J2("maxRetryTime",n,{min:0,allowInfinity:!0}),e.factor>0||(e.factor=1),e.signal?.throwIfAborted();let r=0;const i=Date.now(),s=n;for(;r<e.retries+1;){r++;try{e.signal?.throwIfAborted();const o=await t(r);return e.signal?.throwIfAborted(),o}catch(o){await gve(o,r,e,i,s)}}throw new Error("Retry attempts exhausted without throwing an error.")}let sy=class{constructor(e,n){if(this.stable=e,this.unstable=n,!this.unstable&&!this.stable)throw new Error("One of stable or unstable values must be supplied")}get name(){return this.stable?this.stable:this.unstable}get altName(){return this.stable?this.unstable:null}get names(){var e=[this.name],n=this.altName;return n&&e.push(n),e}matches(e){return this.name===e||this.altName===e}findIn(e){var n=void 0;return this.name&&(n=e?.[this.name]),!n&&this.altName&&(n=e?.[this.altName]),n}includedIn(e){var n=!1;return this.name&&(n=e.includes(this.name)),!n&&this.altName&&(n=e.includes(this.altName)),n}};class gT extends sy{constructor(){super(...arguments),L(this,"preferUnstable",!1)}setPreferUnstable(e){this.preferUnstable=e}get name(){return this.stable&&!this.preferUnstable?this.stable:this.unstable}}class qr extends sy{constructor(e,n){if(super(e,n),!this.unstable)throw new Error("Unstable value must be supplied")}get name(){return this.unstable}get altName(){return this.stable}}var _v=(function(t){return t.Self="m.self",t.Pin="m.pin",t})({}),N_=new qr("m.asset","org.matrix.msc3488.asset"),sh=new qr("m.ts","org.matrix.msc3488.ts"),U_=new qr("m.location","org.matrix.msc3488.location"),Ps=(function(t){return t.Read="m.read",t.FullyRead="m.fully_read",t.ReadPrivate="m.read.private",t})({}),j_="main";function ZF(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function e$(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?ZF(Object(n),!0).forEach(function(r){L(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):ZF(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}var JI=new Map;function XI(t){return t instanceof String&&(t=t.toString()),JI.has(t)||JI.set(t,t),JI.get(t)}function dA(t,e){var n=e??new URLSearchParams,r=function(a){s!=null&&(Array.isArray(s)?s.forEach(c=>{n.append(a,String(c))}):n.append(a,String(s)))};for(var[i,s]of Object.entries(t))r(i);return n}function t$(t,e,n){var r=e$(e$({},n),{},{[e]:n[t]});return delete r[t],r}function Pe(t,e){for(var n in e)if(e.hasOwnProperty(n)){var r=e[n];r!=null&&(t=t.replace(n,encodeURIComponent(r)))}return t}function SC(t,e,n){var r;if(n){for(r=t.length-1;r>=0;r--)if(e(t[r],r,t))return t.splice(r,1),!0}else for(r=0;r<t.length;r++)if(e(t[r],r,t))return t.splice(r,1),!0;return!1}function LJ(t,e){for(var n of e)if(!t.hasOwnProperty(n))throw new Error("Missing required key: "+n)}function F_(t){return JSON.parse(JSON.stringify(t))}function kp(t,e){if(t===e)return!0;if(typeof t!=typeof e)return!1;if(typeof t=="number"&&isNaN(t)&&isNaN(e))return!0;if(t===null||e===null)return t===e;if(t.constructor.name!=="Object"&&t.constructor.name!=="RegExp"&&t.constructor.name!=="Date"&&t.constructor.name!=="Array"||t.prototype!==e.prototype)return!1;if(t instanceof RegExp||t instanceof Date)return t.toString()===e.toString();if(Array.isArray(t)){if(t.length!==e.length)return!1;for(var n=0;n<t.length;n++)if(!kp(t[n],e[n]))return!1}else{for(var r in e)if(e.hasOwnProperty(r)!==t.hasOwnProperty(r))return!1;for(var i in t)if(e.hasOwnProperty(i)!==t.hasOwnProperty(i)||!kp(t[i],e[i]))return!1}return!0}function fA(t){if(typeof t!="object"||t==null||Array.isArray(t))return t;var e=[];for(var[n,r]of Object.entries(t))e.push([n,fA(r)]);return e.sort((i,s)=>pE(i[0],s[0])),e}function n$(t){return typeof t=="number"&&isFinite(t)}function Tf(t){return typeof t=="string"?cve(t.normalize("NFD").replace(bve,"")):""}function wC(t){return typeof t=="string"?t.replace(/[\u202d-\u202e]/g,""):""}function yve(t){return Tf(t.toLowerCase()).replace(/[\\'!"#$%&()*+,\-./:;<=>?@[\]^_`{|}~\u2000-\u206f\u2e00-\u2e7f]/g,"").toLowerCase()}var bve=/[\u2000-\u200F\u202A-\u202F\u0300-\u036F\uFEFF\u061C\u2800\u2062-\u2063\s]/g;function OJ(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function PJ(t){return OJ(t).replace(/\\\*/g,".*").replace(/\?/g,".")}function QI(t){return t!=null&&t.endsWith("/")?t.slice(0,-1):t}function Wp(t,e){return new Promise(n=>{setTimeout(n,t,e)})}function uat(t,e,n){return hA.apply(this,arguments)}function hA(){return hA=B(function*(t,e,n){var r=Date.now();try{return yield n()}finally{var i=Date.now();t.debug("[Perf]: ".concat(e," took ").concat(i-r,"ms"))}}),hA.apply(this,arguments)}function _ve(t,e,n){var r=Date.now();try{return n()}finally{var i=Date.now();t.debug("[Perf]: ".concat(e," took ").concat(i-r,"ms"))}}function DJ(t){return t==null}function r$(t,e){return pA.apply(this,arguments)}function pA(){return pA=B(function*(t,e){for(var n of t)yield e(yield n)}),pA.apply(this,arguments)}function og(t){return Promise.resolve(t())}function Sve(t,e){return vve(n=>t(n),{retries:1/0,shouldRetry:e?n=>{var{error:r}=n;return e(r)}:void 0,factor:2,minTimeout:3e3,maxTimeout:15e3})}var $f=(()=>{for(var t="",e=32;e<=126;e++)t+=String.fromCharCode(e);return t})();function i$(t,e){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:$f;return t.padEnd(e,n[0])}function xb(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:$f,n=BigInt(e.length);if(t<=n){var r;return(r=e[Number(t)-1])!==null&&r!==void 0?r:""}var i=t/n,s=Number(t%n)-1;return s<0&&(i-=BigInt(Math.abs(s)),s=Number(n)-1),xb(i,e)+e[s]}function EC(t){for(var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:$f,n=BigInt(e.length),r=BigInt(0),i=t.length-1,s=BigInt(0);i>=0;i--,s++){var o=t.charCodeAt(i)-e.charCodeAt(0);r+=BigInt(1+o)*n**s}return r}function wve(t,e){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:$f,r=Math.max(t.length,e.length),i=EC(i$(t,r,n),n),s=EC(i$(e,r,n),n),o=(i+s)/BigInt(2);return o===i||o==s?xb(o,n)+n[0]:xb(o,n)}function U0(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:$f;return xb(EC(t,e)+BigInt(1),e)}function s$(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:$f;return xb(EC(t,e)-BigInt(1),e)}function pE(t,e){return t<e?-1:t>e?1:0}function NJ(t,e){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;for(var[r,i]of Object.entries(e)){if(t[r]instanceof Object&&i){NJ(t[r],i);continue}if(i!=null||!n){CC(t,r,i);continue}}return t}function o$(t){var e;return(e=sh.findIn(t.getContent()))!==null&&e!==void 0?e:-1}function Eve(t,e){return o$(e)-o$(t)}function YO(t){return[Ps.Read,Ps.ReadPrivate].includes(t)}function a$(t,e){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:(o,a)=>o===a;if(t.size!==e.size)return!1;for(var[r,i]of t){var s=e.get(r);if(s===void 0||!n(i,s))return!1}return!0}function UJ(t){return t instanceof Map?ip(t):Array.isArray(t)?t.map(e=>UJ(e)):t}function ip(t){var e=new Map;for(var[n,r]of t)e.set(n,UJ(r));return Object.fromEntries(e.entries())}function V1(t){return t==="__proto__"||t==="prototype"||t==="constructor"}function CC(t,e,n){if(V1(e))throw new Error("Trying to modify prototype or constructor");t[e]=n}function Ec(t){return!(V1(t.room_id)||V1(t.sender)||V1(t.event_id))}class Bu extends Map{constructor(e){super(),this.createDefault=e}getOrCreate(e){return this.has(e)||this.set(e,this.createDefault()),this.get(e)}}var mA="migrationState",Sv=(function(t){return t[t.NOT_STARTED=0]="NOT_STARTED",t[t.INITIAL_DATA_MIGRATED=1]="INITIAL_DATA_MIGRATED",t[t.OLM_SESSIONS_MIGRATED=2]="OLM_SESSIONS_MIGRATED",t[t.MEGOLM_SESSIONS_MIGRATED=3]="MEGOLM_SESSIONS_MIGRATED",t[t.ROOM_SETTINGS_MIGRATED=4]="ROOM_SETTINGS_MIGRATED",t[t.INITIAL_OWN_KEY_QUERY_DONE=5]="INITIAL_OWN_KEY_QUERY_DONE",t})({}),wv=50;function c$(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function l$(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?c$(Object(n),!0).forEach(function(r){L(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):c$(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function X2(t,e){return encodeURIComponent(t)+"/"+encodeURIComponent(e)}function Cve(t){var e=t.split("/"),n=decodeURIComponent(e[0]),r=decodeURIComponent(e[1]);return{senderKey:n,sessionId:r}}class vT{constructor(){L(this,"migrationState",Sv.NOT_STARTED),L(this,"account",null),L(this,"crossSigningKeys",null),L(this,"privateKeys",{}),L(this,"sessions",{}),L(this,"inboundGroupSessions",{}),L(this,"inboundGroupSessionsWithheld",{}),L(this,"rooms",{}),L(this,"sessionsNeedingBackup",{})}containsData(){var e=this;return B(function*(){return e.account!==null})()}startup(){var e=this;return B(function*(){return e})()}deleteAllData(){return Promise.resolve()}getMigrationState(){var e=this;return B(function*(){return e.migrationState})()}setMigrationState(e){var n=this;return B(function*(){n.migrationState=e})()}getAccount(e,n){n(this.account)}storeAccount(e,n){this.account=n}getCrossSigningKeys(e,n){n(this.crossSigningKeys)}getSecretStorePrivateKey(e,n,r){var i=this.privateKeys[r];n(i||null)}storeSecretStorePrivateKey(e,n,r){this.privateKeys[n]=r}countEndToEndSessions(e,n){var r=0;for(var i of Object.values(this.sessions))r+=Object.keys(i).length;n(r)}getEndToEndSession(e,n,r,i){var s=this.sessions[e]||{};i(s[n]||null)}getEndToEndSessions(e,n,r){r(this.sessions[e]||{})}storeEndToEndSession(e,n,r,i){var s=this.sessions[e];s===void 0&&(s={},this.sessions[e]=s),CC(s,n,r)}getEndToEndSessionsBatch(){var e=this;return B(function*(){var n=[];for(var r of Object.values(e.sessions))for(var i of Object.values(r))if(n.push(i),n.length>=wv)return n;return n.length===0?null:n})()}deleteEndToEndSessionsBatch(e){var n=this;return B(function*(){for(var{deviceKey:r,sessionId:i}of e){var s=n.sessions[r]||{};delete s[i],Object.keys(s).length===0&&delete n.sessions[r]}})()}getEndToEndInboundGroupSession(e,n,r,i){var s=X2(e,n);i(this.inboundGroupSessions[s]||null,this.inboundGroupSessionsWithheld[s]||null)}storeEndToEndInboundGroupSession(e,n,r,i){var s=X2(e,n);this.inboundGroupSessions[s]=r}countEndToEndInboundGroupSessions(){var e=this;return B(function*(){return Object.keys(e.inboundGroupSessions).length})()}getEndToEndInboundGroupSessionsBatch(){var e=this;return B(function*(){var n=[];for(var[r,i]of Object.entries(e.inboundGroupSessions))if(n.push(l$(l$({},Cve(r)),{},{sessionData:i,needsBackup:r in e.sessionsNeedingBackup})),n.length>=wv)return n;return n.length===0?null:n})()}deleteEndToEndInboundGroupSessionsBatch(e){var n=this;return B(function*(){for(var{senderKey:r,sessionId:i}of e){var s=X2(r,i);delete n.inboundGroupSessions[s]}})()}getEndToEndRooms(e,n){n(this.rooms)}markSessionsNeedingBackup(e){for(var n of e){var r=X2(n.senderKey,n.sessionId);this.sessionsNeedingBackup[r]=!0}return Promise.resolve()}doTxn(e,n,r){return Promise.resolve(r(null))}}var Tve=/^(?:(?:\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})|(?:\[[\dA-Fa-f:.]{2,45}])|(?:[A-Za-z\d\-.]{1,255}))(?::\d{1,5})?$/;function Rve(t){var e=Tve.exec(t);return e?.[0]===t}var kve=/^[\w-]+$/;function Ive(t){var e=kve.exec(t);return e?.[0]===t}function yT(t,e,n,r,i){var s=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!1,o=arguments.length>6?arguments[6]:void 0,a=arguments.length>7?arguments[7]:void 0;if(typeof e!="string"||!e)return"";if(!e.startsWith("mxc://"))return s?e:"";var[c,l,...d]=e.slice(6).split("/");if(d.length>0||!Rve(c)||!Ive(l))return"";a&&(o=!0);var h,m=!!n||!!r||!!i,g=m?"thumbnail":"download";a?h="/_matrix/client/v1/media/".concat(g):h="/_matrix/media/v3/".concat(g);var y=new URL("".concat(h,"/").concat(c,"/").concat(l),t);return n&&y.searchParams.set("width",Math.round(n).toString()),r&&y.searchParams.set("height",Math.round(r).toString()),i&&y.searchParams.set("method",i),typeof o=="boolean"&&y.searchParams.set("allow_redirect",JSON.stringify(o)),y.href}var mE={exports:{}},xve=mE.exports,u$;function Ave(){return u$||(u$=1,(function(t){(function(e,n){t.exports?t.exports=n():e.log=n()})(xve,function(){var e=function(){},n="undefined",r=typeof window!==n&&typeof window.navigator!==n&&/Trident\/|MSIE /.test(window.navigator.userAgent),i=["trace","debug","info","warn","error"],s={},o=null;function a(v,E){var w=v[E];if(typeof w.bind=="function")return w.bind(v);try{return Function.prototype.bind.call(w,v)}catch{return function(){return Function.prototype.apply.apply(w,[v,arguments])}}}function c(){console.log&&(console.log.apply?console.log.apply(console,arguments):Function.prototype.apply.apply(console.log,[console,arguments])),console.trace&&console.trace()}function l(v){return v==="debug"&&(v="log"),typeof console===n?!1:v==="trace"&&r?c:console[v]!==void 0?a(console,v):console.log!==void 0?a(console,"log"):e}function d(){for(var v=this.getLevel(),E=0;E<i.length;E++){var w=i[E];this[w]=E<v?e:this.methodFactory(w,v,this.name)}if(this.log=this.debug,typeof console===n&&v<this.levels.SILENT)return"No console available for logging"}function h(v){return function(){typeof console!==n&&(d.call(this),this[v].apply(this,arguments))}}function m(v,E,w){return l(v)||h.apply(this,arguments)}function g(v,E){var w=this,k,x,C,R="loglevel";typeof v=="string"?R+=":"+v:typeof v=="symbol"&&(R=void 0);function T(j){var $=(i[j]||"silent").toUpperCase();if(!(typeof window===n||!R)){try{window.localStorage[R]=$;return}catch{}try{window.document.cookie=encodeURIComponent(R)+"="+$+";"}catch{}}}function M(){var j;if(!(typeof window===n||!R)){try{j=window.localStorage[R]}catch{}if(typeof j===n)try{var $=window.document.cookie,q=encodeURIComponent(R),Y=$.indexOf(q+"=");Y!==-1&&(j=/^([^;]+)/.exec($.slice(Y+q.length+1))[1])}catch{}return w.levels[j]===void 0&&(j=void 0),j}}function O(){if(!(typeof window===n||!R)){try{window.localStorage.removeItem(R)}catch{}try{window.document.cookie=encodeURIComponent(R)+"=; expires=Thu, 01 Jan 1970 00:00:00 UTC"}catch{}}}function P(j){var $=j;if(typeof $=="string"&&w.levels[$.toUpperCase()]!==void 0&&($=w.levels[$.toUpperCase()]),typeof $=="number"&&$>=0&&$<=w.levels.SILENT)return $;throw new TypeError("log.setLevel() called with invalid level: "+j)}w.name=v,w.levels={TRACE:0,DEBUG:1,INFO:2,WARN:3,ERROR:4,SILENT:5},w.methodFactory=E||m,w.getLevel=function(){return C??x??k},w.setLevel=function(j,$){return C=P(j),$!==!1&&T(C),d.call(w)},w.setDefaultLevel=function(j){x=P(j),M()||w.setLevel(j,!1)},w.resetLevel=function(){C=null,O(),d.call(w)},w.enableAll=function(j){w.setLevel(w.levels.TRACE,j)},w.disableAll=function(j){w.setLevel(w.levels.SILENT,j)},w.rebuild=function(){if(o!==w&&(k=P(o.getLevel())),d.call(w),o===w)for(var j in s)s[j].rebuild()},k=P(o?o.getLevel():"WARN");var D=M();D!=null&&(C=P(D)),d.call(w)}o=new g,o.getLogger=function(E){if(typeof E!="symbol"&&typeof E!="string"||E==="")throw new TypeError("You must supply a name when creating a logger.");var w=s[E];return w||(w=s[E]=new g(E,o.methodFactory)),w};var y=typeof window!==n?window.log:void 0;return o.noConflict=function(){return typeof window!==n&&window.log===o&&(window.log=y),o},o.getLoggers=function(){return s},o.default=o,o})})(mE)),mE.exports}var Mve=Ave();const gA=Dl(Mve);var Lve="matrix";gA.methodFactory=function(t,e,n){return function(){for(var r=arguments.length,i=new Array(r),s=0;s<r;s++)i[s]=arguments[s];this.prefix&&i.unshift(this.prefix);var o=t==="error"||t==="warn"||t==="trace"||t==="info"||t==="debug";return o?console[t](...i):console.log(...i)}};function jJ(t){var e=Lve+(t===void 0?"":"-".concat(t)),n=gA.getLogger(e);return n.getChild===void 0&&(n.prefix=t,n.getChild=r=>{var i=jJ((t??"")+r);return i.methodFactory=n.methodFactory,i.rebuild(),i},n.setLevel(gA.levels.DEBUG,!1)),n}var N=jJ();class dat{constructor(e,n){this.parent=e,L(this,"name",void 0),this.name=n+":"}trace(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];this.parent.trace(this.name,...n)}debug(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];this.parent.debug(this.name,...n)}info(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];this.parent.info(this.name,...n)}warn(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];this.parent.warn(this.name,...n)}error(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];this.parent.error(this.name,...n)}}class JO{constructor(e){this.debugInstance=e}trace(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];this.debugWithPrefix("[TRACE]",...n)}debug(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];this.debugWithPrefix("[DEBUG]",...n)}info(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];this.debugWithPrefix("[INFO]",...n)}warn(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];this.debugWithPrefix("[WARN]",...n)}error(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];this.debugWithPrefix("[ERROR]",...n)}getChild(e){return new JO(this.debugInstance.extend(e))}debugWithPrefix(e){for(var n,r=arguments.length,i=new Array(r>1?r-1:0),s=1;s<r;s++)i[s-1]=arguments[s];if(i.length===0)n="";else if(i[0]instanceof Error){var o=i.shift();n=o.stack||o.message}else typeof i[0]=="string"?n=i.shift():n="%O";this.debugInstance(e+" "+n,...i)}}var Q2={exports:{}},d$;function Ove(){if(d$)return Q2.exports;d$=1;var t=typeof Reflect=="object"?Reflect:null,e=t&&typeof t.apply=="function"?t.apply:function(R,T,M){return Function.prototype.apply.call(R,T,M)},n;t&&typeof t.ownKeys=="function"?n=t.ownKeys:Object.getOwnPropertySymbols?n=function(R){return Object.getOwnPropertyNames(R).concat(Object.getOwnPropertySymbols(R))}:n=function(R){return Object.getOwnPropertyNames(R)};function r(C){console&&console.warn&&console.warn(C)}var i=Number.isNaN||function(R){return R!==R};function s(){s.init.call(this)}Q2.exports=s,Q2.exports.once=w,s.EventEmitter=s,s.prototype._events=void 0,s.prototype._eventsCount=0,s.prototype._maxListeners=void 0;var o=10;function a(C){if(typeof C!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof C)}Object.defineProperty(s,"defaultMaxListeners",{enumerable:!0,get:function(){return o},set:function(C){if(typeof C!="number"||C<0||i(C))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+C+".");o=C}}),s.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},s.prototype.setMaxListeners=function(R){if(typeof R!="number"||R<0||i(R))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+R+".");return this._maxListeners=R,this};function c(C){return C._maxListeners===void 0?s.defaultMaxListeners:C._maxListeners}s.prototype.getMaxListeners=function(){return c(this)},s.prototype.emit=function(R){for(var T=[],M=1;M<arguments.length;M++)T.push(arguments[M]);var O=R==="error",P=this._events;if(P!==void 0)O=O&&P.error===void 0;else if(!O)return!1;if(O){var D;if(T.length>0&&(D=T[0]),D instanceof Error)throw D;var j=new Error("Unhandled error."+(D?" ("+D.message+")":""));throw j.context=D,j}var $=P[R];if($===void 0)return!1;if(typeof $=="function")e($,this,T);else for(var q=$.length,Y=y($,q),M=0;M<q;++M)e(Y[M],this,T);return!0};function l(C,R,T,M){var O,P,D;if(a(T),P=C._events,P===void 0?(P=C._events=Object.create(null),C._eventsCount=0):(P.newListener!==void 0&&(C.emit("newListener",R,T.listener?T.listener:T),P=C._events),D=P[R]),D===void 0)D=P[R]=T,++C._eventsCount;else if(typeof D=="function"?D=P[R]=M?[T,D]:[D,T]:M?D.unshift(T):D.push(T),O=c(C),O>0&&D.length>O&&!D.warned){D.warned=!0;var j=new Error("Possible EventEmitter memory leak detected. "+D.length+" "+String(R)+" listeners added. Use emitter.setMaxListeners() to increase limit");j.name="MaxListenersExceededWarning",j.emitter=C,j.type=R,j.count=D.length,r(j)}return C}s.prototype.addListener=function(R,T){return l(this,R,T,!1)},s.prototype.on=s.prototype.addListener,s.prototype.prependListener=function(R,T){return l(this,R,T,!0)};function d(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function h(C,R,T){var M={fired:!1,wrapFn:void 0,target:C,type:R,listener:T},O=d.bind(M);return O.listener=T,M.wrapFn=O,O}s.prototype.once=function(R,T){return a(T),this.on(R,h(this,R,T)),this},s.prototype.prependOnceListener=function(R,T){return a(T),this.prependListener(R,h(this,R,T)),this},s.prototype.removeListener=function(R,T){var M,O,P,D,j;if(a(T),O=this._events,O===void 0)return this;if(M=O[R],M===void 0)return this;if(M===T||M.listener===T)--this._eventsCount===0?this._events=Object.create(null):(delete O[R],O.removeListener&&this.emit("removeListener",R,M.listener||T));else if(typeof M!="function"){for(P=-1,D=M.length-1;D>=0;D--)if(M[D]===T||M[D].listener===T){j=M[D].listener,P=D;break}if(P<0)return this;P===0?M.shift():v(M,P),M.length===1&&(O[R]=M[0]),O.removeListener!==void 0&&this.emit("removeListener",R,j||T)}return this},s.prototype.off=s.prototype.removeListener,s.prototype.removeAllListeners=function(R){var T,M,O;if(M=this._events,M===void 0)return this;if(M.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):M[R]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete M[R]),this;if(arguments.length===0){var P=Object.keys(M),D;for(O=0;O<P.length;++O)D=P[O],D!=="removeListener"&&this.removeAllListeners(D);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(T=M[R],typeof T=="function")this.removeListener(R,T);else if(T!==void 0)for(O=T.length-1;O>=0;O--)this.removeListener(R,T[O]);return this};function m(C,R,T){var M=C._events;if(M===void 0)return[];var O=M[R];return O===void 0?[]:typeof O=="function"?T?[O.listener||O]:[O]:T?E(O):y(O,O.length)}s.prototype.listeners=function(R){return m(this,R,!0)},s.prototype.rawListeners=function(R){return m(this,R,!1)},s.listenerCount=function(C,R){return typeof C.listenerCount=="function"?C.listenerCount(R):g.call(C,R)},s.prototype.listenerCount=g;function g(C){var R=this._events;if(R!==void 0){var T=R[C];if(typeof T=="function")return 1;if(T!==void 0)return T.length}return 0}s.prototype.eventNames=function(){return this._eventsCount>0?n(this._events):[]};function y(C,R){for(var T=new Array(R),M=0;M<R;++M)T[M]=C[M];return T}function v(C,R){for(;R+1<C.length;R++)C[R]=C[R+1];C.pop()}function E(C){for(var R=new Array(C.length),T=0;T<R.length;++T)R[T]=C[T].listener||C[T];return R}function w(C,R){return new Promise(function(T,M){function O(D){C.removeListener(R,P),M(D)}function P(){typeof C.removeListener=="function"&&C.removeListener("error",O),T([].slice.call(arguments))}x(C,R,P,{once:!0}),R!=="error"&&k(C,O,{once:!0})})}function k(C,R,T){typeof C.on=="function"&&x(C,"error",R,T)}function x(C,R,T,M){if(typeof C.on=="function")M.once?C.once(R,T):C.on(R,T);else if(typeof C.addEventListener=="function")C.addEventListener(R,function O(P){M.once&&C.removeEventListener(R,O),T(P)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof C)}return Q2.exports}var bT=Ove();const FJ=Dl(bT);var $J=(function(t){return t.NewListener="newListener",t.RemoveListener="removeListener",t.Error="error",t})({});class Kn extends bT.EventEmitter{addListener(e,n){return super.addListener(e,n)}emit(e){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return super.emit(e,...r)}emitPromised(e){var n=arguments,r=this;return B(function*(){for(var i=n.length,s=new Array(i>1?i-1:0),o=1;o<i;o++)s[o-1]=n[o];var a=r.listeners(e);return Promise.allSettled(a.map(c=>c(...s))).then(()=>a.length>0)})()}listenerCount(e){return super.listenerCount(e)}listeners(e){return super.listeners(e)}off(e,n){return super.off(e,n)}on(e,n){return super.on(e,n)}once(e,n){return super.once(e,n)}prependListener(e,n){return super.prependListener(e,n)}prependOnceListener(e,n){return super.prependOnceListener(e,n)}removeAllListeners(e){return e===void 0?super.removeAllListeners():super.removeAllListeners(e)}removeListener(e,n){return super.removeListener(e,n)}rawListeners(e){return super.rawListeners(e)}}var Z=(function(t){return t.RoomCanonicalAlias="m.room.canonical_alias",t.RoomCreate="m.room.create",t.RoomJoinRules="m.room.join_rules",t.RoomMember="m.room.member",t.RoomThirdPartyInvite="m.room.third_party_invite",t.RoomPowerLevels="m.room.power_levels",t.RoomName="m.room.name",t.RoomTopic="m.room.topic",t.RoomAvatar="m.room.avatar",t.RoomPinnedEvents="m.room.pinned_events",t.RoomEncryption="m.room.encryption",t.RoomHistoryVisibility="m.room.history_visibility",t.RoomGuestAccess="m.room.guest_access",t.RoomServerAcl="m.room.server_acl",t.RoomTombstone="m.room.tombstone",t.RoomPredecessor="org.matrix.msc3946.room_predecessor",t.PolicyRuleUser="m.policy.rule.user",t.PolicyRuleRoom="m.policy.rule.room",t.PolicyRuleServer="m.policy.rule.server",t.SpaceChild="m.space.child",t.SpaceParent="m.space.parent",t.RoomRedaction="m.room.redaction",t.RoomMessage="m.room.message",t.RoomMessageEncrypted="m.room.encrypted",t.Sticker="m.sticker",t.CallInvite="m.call.invite",t.CallCandidates="m.call.candidates",t.CallAnswer="m.call.answer",t.CallHangup="m.call.hangup",t.CallReject="m.call.reject",t.CallSelectAnswer="m.call.select_answer",t.CallNegotiate="m.call.negotiate",t.CallSDPStreamMetadataChanged="m.call.sdp_stream_metadata_changed",t.CallSDPStreamMetadataChangedPrefix="org.matrix.call.sdp_stream_metadata_changed",t.CallReplaces="m.call.replaces",t.CallAssertedIdentity="m.call.asserted_identity",t.CallAssertedIdentityPrefix="org.matrix.call.asserted_identity",t.CallEncryptionKeysPrefix="io.element.call.encryption_keys",t.KeyVerificationRequest="m.key.verification.request",t.KeyVerificationStart="m.key.verification.start",t.KeyVerificationCancel="m.key.verification.cancel",t.KeyVerificationMac="m.key.verification.mac",t.KeyVerificationDone="m.key.verification.done",t.KeyVerificationKey="m.key.verification.key",t.KeyVerificationAccept="m.key.verification.accept",t.KeyVerificationReady="m.key.verification.ready",t.RoomMessageFeedback="m.room.message.feedback",t.Reaction="m.reaction",t.PollStart="org.matrix.msc3381.poll.start",t.Typing="m.typing",t.Receipt="m.receipt",t.Presence="m.presence",t.FullyRead="m.fully_read",t.Tag="m.tag",t.SpaceOrder="org.matrix.msc3230.space_order",t.PushRules="m.push_rules",t.Direct="m.direct",t.IgnoredUserList="m.ignored_user_list",t.InvitePermissionConfig="m.invite_permission_config",t.RoomKey="m.room_key",t.RoomKeyRequest="m.room_key_request",t.ForwardedRoomKey="m.forwarded_room_key",t.Dummy="m.dummy",t.SecretRequest="m.secret.request",t.SecretSend="m.secret.send",t.GroupCallPrefix="org.matrix.msc3401.call",t.GroupCallMemberPrefix="org.matrix.msc3401.call.member",t.RTCMembership="org.matrix.msc4143.rtc.member",t.CallNotify="org.matrix.msc4075.call.notify",t.RTCNotification="org.matrix.msc4075.rtc.notification",t.RTCDecline="org.matrix.msc4310.rtc.decline",t.RoomPolicy="org.matrix.msc4284.policy",t})({}),bn=(function(t){return t.Annotation="m.annotation",t.Replace="m.replace",t.Reference="m.reference",t.Thread="m.thread",t})({}),Nl=(function(t){return t.Text="m.text",t.Emote="m.emote",t.Notice="m.notice",t.Image="m.image",t.File="m.file",t.Audio="m.audio",t.Location="m.location",t.Video="m.video",t.KeyVerificationRequest="m.key.verification.request",t})({}),TC="type",zg=(function(t){return t.Space="m.space",t.UnstableCall="org.matrix.msc3417.call",t.ElementVideo="io.element.video",t})({}),_T="org.matrix.msgid",vA=new qr("m.room.purpose","org.matrix.msc3088.purpose"),yA=new qr("m.enabled","org.matrix.msc3088.enabled"),bA=new qr("m.data_tree","org.matrix.msc3089.data_tree"),BJ=new qr("m.leaf","org.matrix.msc3089.leaf"),Iu=new qr("m.branch","org.matrix.msc3089.branch"),HJ=new qr("m.room.marker","org.matrix.msc2716.marker"),_A=new qr("with_rel_types","org.matrix.msc3912.with_relations"),qJ=new qr("io.element.functional_members","io.element.functional_members"),sp=new qr("m.visibility","org.matrix.msc3531.visibility"),SA=new qr("enabled","org.matrix.msc3881.enabled"),Pve=new qr("device_id","org.matrix.msc3881.device_id"),VJ=new qr("m.local_notification_settings","org.matrix.msc3890.local_notification_settings"),RC=new qr("thread_id","org.matrix.msc4023.thread_id"),KJ=new sy("membership","io.element.msc4115.membership"),Ve=(function(t){return t.Ban="ban",t.Invite="invite",t.Join="join",t.Knock="knock",t.Leave="leave",t})({}),fo=(function(t){return t.Membership="RoomMember.membership",t.Name="RoomMember.name",t.PowerLevel="RoomMember.powerLevel",t.Typing="RoomMember.typing",t})({});class Ab extends Kn{constructor(e,n){super(),this.roomId=e,this.userId=n,L(this,"_isOutOfBand",!1),L(this,"modified",-1),L(this,"requestedProfileInfo",!1),L(this,"typing",!1),L(this,"name",void 0),L(this,"rawDisplayName",void 0),L(this,"powerLevel",0),L(this,"user",void 0),L(this,"membership",void 0),L(this,"disambiguate",!1),L(this,"events",{}),this.name=n,this.rawDisplayName=n,this.updateModifiedTime()}markOutOfBand(){this._isOutOfBand=!0}isOutOfBand(){return this._isOutOfBand}setMembershipEvent(e,n){var r,i,s=(r=e.getDirectionalContent().displayname)!==null&&r!==void 0?r:"";if(e.getType()===Z.RoomMember){this._isOutOfBand=!1,this.events.member=e;var o=this.membership;this.membership=e.getDirectionalContent().membership,this.membership===void 0&&N.trace("membership event with membership undefined (forwardLooking: ".concat(e.forwardLooking,")!"),e.getContent(),"prevcontent is ",e.getPrevContent()),this.disambiguate=Nve(this.userId,s,n);var a=this.name;this.name=Uve(this.userId,s,this.disambiguate),this.rawDisplayName=wC((i=e.getDirectionalContent().displayname)!==null&&i!==void 0?i:""),(!this.rawDisplayName||!Tf(this.rawDisplayName))&&(this.rawDisplayName=this.userId),o!==this.membership&&(this.updateModifiedTime(),this.emit(fo.Membership,e,this,o)),a!==this.name&&(this.updateModifiedTime(),this.emit(fo.Name,e,this,a))}}setPowerLevel(e,n){var r=this.powerLevel;this.powerLevel=e,r!==this.powerLevel&&(this.updateModifiedTime(),this.emit(fo.PowerLevel,n,this))}setTypingEvent(e){if(e.getType()==="m.typing"){var n=this.typing;this.typing=!1;var r=e.getContent().user_ids;Array.isArray(r)&&(r.indexOf(this.userId)!==-1&&(this.typing=!0),n!==this.typing&&(this.updateModifiedTime(),this.emit(fo.Typing,e,this)))}}updateModifiedTime(){this.modified=Date.now()}getLastModifiedTime(){return this.modified}isKicked(){return this.membership===Ve.Leave&&this.events.member!==void 0&&this.events.member.getSender()!==this.events.member.getStateKey()}getDMInviter(){if(this.events.member){var e=this.events.member,n=e.getContent(),r=e.getSender();if(n.membership===Ve.Join&&(n=e.getPrevContent(),r=e.getUnsigned().prev_sender),n.membership===Ve.Invite&&n.is_direct)return r}}getAvatarUrl(e,n,r,i){var s=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,o=arguments.length>5?arguments[5]:void 0,a=arguments.length>6&&arguments[6]!==void 0?arguments[6]:!1,c=this.getMxcAvatarUrl();if(!c&&!s)return null;var l=yT(e,c,n,r,i,o,void 0,a);return l||null}getMxcAvatarUrl(){if(this.events.member)return this.events.member.getDirectionalContent().avatar_url;if(this.user)return this.user.avatarUrl}}var XO=/@.+:.+/,Dve=/[\u200E\u200F\u202A-\u202F]/;function Nve(t,e,n){if(!e||e===t||!n)return!1;var r=Tf(e);if(!r)return!1;if(XO.test(r)||Dve.test(e))return!0;var i=n.getUserIdsWithDisplayName(e);return!!i.some(s=>s!==t)}function Uve(t,e,n){return!e||e===t?t:n?wC(e)+" ("+t+")":Tf(e)?wC(e):t}var ZI={},j0={},F0={},f$;function GJ(){if(f$)return F0;f$=1,Object.defineProperty(F0,"__esModule",{value:!0}),F0.NamespacedMap=void 0;function t(c,l){var d=typeof Symbol<"u"&&c[Symbol.iterator]||c["@@iterator"];if(!d){if(Array.isArray(c)||(d=e(c))||l){d&&(c=d);var h=0,m=function(){};return{s:m,n:function(){return h>=c.length?{done:!0}:{done:!1,value:c[h++]}},e:function(w){throw w},f:m}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./index-CoTEFHCo.js","./matrix-sdk-crypto-wasm-DF8P9UDp.js"])))=>i.map(i=>d[i]);
2
+ try{let t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},e=new t.Error().stack;e&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[e]="dcaec0a4-8ebd-4507-8b99-d0587b35a53b",t._sentryDebugIdIdentifier="sentry-dbid-dcaec0a4-8ebd-4507-8b99-d0587b35a53b")}catch{}function Qge(t,e){for(var n=0;n<e.length;n++){const r=e[n];if(typeof r!="string"&&!Array.isArray(r)){for(const i in r)if(i!=="default"&&!(i in t)){const s=Object.getOwnPropertyDescriptor(r,i);s&&Object.defineProperty(t,i,s.get?s:{enumerable:!0,get:()=>r[i]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}{let t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{};t.SENTRY_RELEASE={id:"embedded-v0.19.0"}}(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const s of i)if(s.type==="childList")for(const o of s.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&r(o)}).observe(document,{childList:!0,subtree:!0});function n(i){const s={};return i.integrity&&(s.integrity=i.integrity),i.referrerPolicy&&(s.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?s.credentials="include":i.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function r(i){if(i.ep)return;i.ep=!0;const s=n(i);fetch(i.href,s)}})();function Dl(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function cat(t){if(Object.prototype.hasOwnProperty.call(t,"__esModule"))return t;var e=t.default;if(typeof e=="function"){var n=function r(){var i=!1;try{i=this instanceof r}catch{}return i?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};n.prototype=e.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(t).forEach(function(r){var i=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(n,r,i.get?i:{enumerable:!0,get:function(){return t[r]}})}),n}var WI={exports:{}},N0={};var YF;function Zge(){if(YF)return N0;YF=1;var t=Symbol.for("react.transitional.element"),e=Symbol.for("react.fragment");function n(r,i,s){var o=null;if(s!==void 0&&(o=""+s),i.key!==void 0&&(o=""+i.key),"key"in i){s={};for(var a in i)a!=="key"&&(s[a]=i[a])}else s=i;return i=s.ref,{$$typeof:t,type:r,key:o,ref:i!==void 0?i:null,props:s}}return N0.Fragment=e,N0.jsx=n,N0.jsxs=n,N0}var JF;function eve(){return JF||(JF=1,WI.exports=Zge()),WI.exports}var S=eve();function XF(t,e,n,r,i,s,o){try{var a=t[s](o),c=a.value}catch(l){return void n(l)}a.done?e(c):Promise.resolve(c).then(r,i)}function B(t){return function(){var e=this,n=arguments;return new Promise(function(r,i){var s=t.apply(e,n);function o(c){XF(s,r,i,o,a,"next",c)}function a(c){XF(s,r,i,o,a,"throw",c)}o(void 0)})}}function Ib(t){"@babel/helpers - typeof";return Ib=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ib(t)}function tve(t,e){if(Ib(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(Ib(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function nve(t){var e=tve(t,"string");return Ib(e)=="symbol"?e:e+""}function L(t,e,n){return(e=nve(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}const rve="l",ive="rn",sve={0:"O",1:"l","֭":"֖","֮":"֘","֨":"֙","֤":"֚","᪴":"ۛ","⃛":"ۛ","ؙ":"̓","ࣳ":"̓","̓":"̓","̕":"̓","ُ":"̓","ٝ":"̔","֜":"́","֝":"́","ؘ":"́","݇":"́","́":"́","॔":"́","َ":"́","̀":"̀","॓":"̀","̌":"̆","꙼":"̆","٘":"̆","ٚ":"̆","ͮ":"̆","ۨ":"̆̇","̐":"̆̇","ँ":"̆̇","ঁ":"̆̇","ઁ":"̆̇","ଁ":"̆̇","ఀ":"̆̇","ಁ":"̆̇","ഁ":"̆̇","𑒿":"̆̇","᳐":"̂","̑":"̂","ٛ":"̂","߮":"̂","꛰":"̂","֯":"̊","۟":"̊","៓":"̊","゚":"̊","ْ":"̊","ஂ":"̊","ံ":"̊","ំ":"̊","𑌀":"̊","ํ":"̊","ໍ":"̊","ͦ":"̊","ⷪ":"̊","࣫":"̈","߳":"̈","ً":"̋","ࣰ":"̋","͂":"̃","ٓ":"̃","ׄ":"̇","۬":"̇","݀":"̇","࣪":"̇","݁":"̇","͘":"̇","ֹ":"̇","ֺ":"̇","ׂ":"̇","ׁ":"̇","߭":"̇","ं":"̇","ਂ":"̇","ં":"̇","்":"̇","̷":"̸","᪷":"̨","̢":"̨","ͅ":"̨","᳒":"̄","̅":"̄","ٙ":"̄","߫":"̄","꛱":"̄","᳚":"̎","ٗ":"̒","͗":"͐","ࣿ":"͐","ࣸ":"͐","ऀ":"͒","᳭":"̖","᳜":"̩","ٖ":"̩","᳕":"̫","͇":"̳","ࣹ":"͔","ࣺ":"͕","゛":"゙","゜":"゚","̶":"̵","〬":"̉","ׅ":"̣","࣭":"̣","᳝":"̣","ִ":"̣","ٜ":"̣","़":"̣","়":"̣","਼":"̣","઼":"̣","଼":"̣","𑇊":"̣","𑓃":"̣","𐨺":"̣","࣮":"̤","᳞":"̤","༷":"̥","〭":"̥","̧":"̦","̡":"̦","̹":"̦","᳙":"̭","᳘":"̮","॒":"̱","̠":"̱","ࣱ":"ٌ","ࣨ":"ٌ","ࣥ":"ٌ",ﱞ:"ﹲّ","ࣲ":"ٍ",ﱟ:"ﹴّ",ﳲ:"ﹷّ",ﱠ:"ﹶّ",ﳳ:"ﹹّ",ﱡ:"ﹸّ","ؚ":"ِ","̗":"ِ",ﳴ:"ﹻّ",ﱢ:"ﹺّ",ﱣ:"ﹼٰ","ٟ":"ٕ","̍":"ٰ","݂":"ܼ","ਃ":"ঃ","ః":"ঃ","ಃ":"ঃ","ഃ":"ঃ","ඃ":"ঃ","း":"ঃ","𑓁":"ঃ","់":"่","່":"่","້":"้","໊":"๊","໋":"๋","꙯":"⃩","\u2028":" ","\u2029":" "," ":" "," ":" "," ":" "," ":" "," ":" "," ":" "," ":" "," ":" "," ":" "," ":" "," ":" "," ":" "," ":" "," ":" "," ":" ","ߺ":"_","﹍":"_","﹎":"_","﹏":"_","‐":"-","‑":"-","‒":"-","–":"-","﹘":"-","۔":"-","⁃":"-","˗":"-","−":"-","➖":"-","Ⲻ":"-","⨩":"-̓","⸚":"-̈","﬩":"-̇","∸":"-̇","⨪":"-̣","꓾":"-.","~":"〜","؍":",","٫":",","‚":",","¸":",","ꓹ":",","⸲":"،","٬":"،",";":";","⸵":"؛","ः":":","ઃ":":",":":":","։":":","܃":":","܄":":","᛬":":","︰":":","᠃":":","᠉":":","⁚":":","׃":":","˸":":","꞉":":","∶":":",ː:":","ꓽ":":","⩴":"::=","⧴":":→","!":"!",ǃ:"!","ⵑ":"!","‼":"!!","⁉":"!?",ʔ:"?","Ɂ":"?","ॽ":"?",Ꭾ:"?","ꛫ":"?","⁈":"?!","⁇":"??","⸮":"؟","𝅭":".","․":".","܁":".","܂":".","꘎":".","𐩐":".","٠":".","۰":".","ꓸ":".","ꓻ":".,","‥":"..","ꓺ":"..","…":"...","꛴":"꛳꛳","・":"·","・":"·","᛫":"·","·":"·","⸱":"·","𐄁":"·","•":"·","‧":"·","∙":"·","⋅":"·","ꞏ":"·",ᐧ:"·","⋯":"···","ⵈ":"···",ᑄ:"·<","⋗":"·>",ᐷ:"·>",ᑀ:"·>",ᔯ:"·4",ᑾ:"·b",ᒀ:"·ḃ",ᑺ:"·d",ᒘ:"·J",ᒶ:"·L",ᑶ:"·P",ᑗ:"·U",ᐺ:"·V",ᐼ:"·Ʌ",ᒮ:"·Γ",ᐎ:"·Δ",ᑙ:"·Ո",ᐌ:"·ᐁ",ᐐ:"·ᐄ",ᐒ:"·ᐅ",ᐔ:"·ᐆ",ᐗ:"·ᐊ",ᐙ:"·ᐋ",ᐾ:"·ᐲ",ᑂ:"·ᐴ",ᑆ:"·ᐹ",ᑛ:"·ᑏ",ᑔ:"·ᑐ",ᑝ:"·ᑐ",ᑟ:"·ᑑ",ᑡ:"·ᑕ",ᑣ:"·ᑖ",ᑴ:"·ᑫ",ᑸ:"·ᑮ",ᑼ:"·ᑰ",ᒒ:"·ᒉ",ᒔ:"·ᒋ",ᒖ:"·ᒌ",ᒚ:"·ᒎ",ᒜ:"·ᒐ",ᒞ:"·ᒑ",ᒬ:"·ᒣ",ᒰ:"·ᒦ",ᒲ:"·ᒧ",ᒴ:"·ᒨ",ᒸ:"·ᒫ",ᓉ:"·ᓀ","ᣆ":"·ᓂ","ᣈ":"·ᓃ","ᣊ":"·ᓄ","ᣌ":"·ᓅ",ᓋ:"·ᓇ",ᓍ:"·ᓈ",ᓜ:"·ᓓ",ᓞ:"·ᓕ",ᓠ:"·ᓖ",ᓢ:"·ᓗ",ᓤ:"·ᓘ",ᓦ:"·ᓚ",ᓨ:"·ᓛ",ᓶ:"·ᓭ",ᓸ:"·ᓯ",ᓺ:"·ᓰ",ᓼ:"·ᓱ",ᓾ:"·ᓲ",ᔀ:"·ᓴ",ᔂ:"·ᓵ",ᔗ:"·ᔐ",ᔙ:"·ᔑ",ᔛ:"·ᔒ",ᔝ:"·ᔓ",ᔟ:"·ᔔ",ᔡ:"·ᔕ",ᔣ:"·ᔖ",ᔱ:"·ᔨ",ᔳ:"·ᔩ",ᔵ:"·ᔪ",ᔷ:"·ᔫ",ᔹ:"·ᔭ",ᔻ:"·ᔮ","ᣎ":"·ᕃ","ᣏ":"·ᕆ","ᣐ":"·ᕇ","ᣑ":"·ᕈ","ᣒ":"·ᕉ","ᣓ":"·ᕋ",ᕎ:"·ᕌ",ᕛ:"·ᕚ",ᕨ:"·ᕧ","ᢳ":"·ᢱ","ᢶ":"·ᢴ","ᢹ":"·ᢸ","ᣂ":"·ᣀ","꠰":"।","॥":"।।","᰼":"᰻᰻","။":"၊၊","᪩":"᪨᪨","᪫":"᪪᪨","᭟":"᭞᭞","𐩗":"𐩖𐩖","𑑌":"𑑋𑑋","𑙂":"𑙁𑙁","𑱂":"𑱁𑱁","᱿":"᱾᱾","՝":"'","'":"'","‘":"'","’":"'","‛":"'","′":"'","‵":"'","՚":"'","׳":"'","`":"'","`":"'","`":"'","´":"'","΄":"'","´":"'","᾽":"'","᾿":"'","῾":"'","ʹ":"'","ʹ":"'","ˈ":"'","ˊ":"'","ˋ":"'","˴":"'",ʻ:"'",ʽ:"'",ʼ:"'",ʾ:"'","ꞌ":"'",י:"'","ߴ":"'","ߵ":"'",ᑊ:"'",ᛌ:"'","𖽑":"'","𖽒":"'","᳓":"''",'"':"''",""":"''","“":"''","”":"''","‟":"''","″":"''","‶":"''","〃":"''","״":"''","˝":"''","ʺ":"''","˶":"''",ˮ:"''",ײ:"''","‴":"'''","‷":"'''","⁗":"''''",Ɓ:"'B",Ɗ:"'D",ʼn:"'n",Ƥ:"'P",Ƭ:"'T",Ƴ:"'Y","[":"(","❨":"(","❲":"(","〔":"(","﴾":"(","⸨":"((","㈠":"(ー)","⑵":"(2)","⒇":"(2O)","⑶":"(3)","⑷":"(4)","⑸":"(5)","⑹":"(6)","⑺":"(7)","⑻":"(8)","⑼":"(9)","⒜":"(a)","🄐":"(A)","⒝":"(b)","🄑":"(B)","⒞":"(c)","🄒":"(C)","⒟":"(d)","🄓":"(D)","⒠":"(e)","🄔":"(E)","⒡":"(f)","🄕":"(F)","⒢":"(g)","🄖":"(G)","⒣":"(h)","🄗":"(H)","⒤":"(i)","⒥":"(j)","🄙":"(J)","⒦":"(k)","🄚":"(K)","⑴":"(l)","🄘":"(l)","⒧":"(l)","🄛":"(L)","⑿":"(l2)","⒀":"(l3)","⒁":"(l4)","⒂":"(l5)","⒃":"(l6)","⒄":"(l7)","⒅":"(l8)","⒆":"(l9)","⑾":"(ll)","⑽":"(lO)","🄜":"(M)","⒩":"(n)","🄝":"(N)","⒪":"(o)","🄞":"(O)","⒫":"(p)","🄟":"(P)","⒬":"(q)","🄠":"(Q)","⒭":"(r)","🄡":"(R)","⒨":"(rn)","⒮":"(s)","🄢":"(S)","🄪":"(S)","⒯":"(t)","🄣":"(T)","⒰":"(u)","🄤":"(U)","⒱":"(v)","🄥":"(V)","⒲":"(w)","🄦":"(W)","⒳":"(x)","🄧":"(X)","⒴":"(y)","🄨":"(Y)","⒵":"(z)","🄩":"(Z)","㈀":"(ᄀ)","㈎":"(가)","㈁":"(ᄂ)","㈏":"(나)","㈂":"(ᄃ)","㈐":"(다)","㈃":"(ᄅ)","㈑":"(라)","㈄":"(ᄆ)","㈒":"(마)","㈅":"(ᄇ)","㈓":"(바)","㈆":"(ᄉ)","㈔":"(사)","㈇":"(ᄋ)","㈕":"(아)","㈝":"(오전)","㈞":"(오후)","㈈":"(ᄌ)","㈖":"(자)","㈜":"(주)","㈉":"(ᄎ)","㈗":"(차)","㈊":"(ᄏ)","㈘":"(카)","㈋":"(ᄐ)","㈙":"(타)","㈌":"(ᄑ)","㈚":"(파)","㈍":"(ᄒ)","㈛":"(하)","㈦":"(七)","㈢":"(三)","🉁":"(三)","㈨":"(九)","㈡":"(二)","🉂":"(二)","㈤":"(五)","㈹":"(代)","㈽":"(企)","㉁":"(休)","㈧":"(八)","㈥":"(六)","㈸":"(労)","🉇":"(勝)","㈩":"(十)","㈿":"(協)","㈴":"(名)","㈺":"(呼)","㈣":"(四)","㈯":"(土)","㈻":"(学)","🉃":"(安)","🉅":"(打)","🉈":"(敗)","㈰":"(日)","㈪":"(月)","㈲":"(有)","㈭":"(木)","🉀":"(本)","㈱":"(株)","㈬":"(水)","㈫":"(火)","🉄":"(点)","㈵":"(特)","🉆":"(盗)","㈼":"(監)","㈳":"(社)","㈷":"(祝)","㉀":"(祭)","㉂":"(自)","㉃":"(至)","㈶":"(財)","㈾":"(資)","㈮":"(金)","]":")","❩":")","❳":")","〕":")","﴿":")","⸩":"))","❴":"{","𝄔":"{","❵":"}","〚":"⟦","〛":"⟧","⟨":"❬","〈":"❬","〈":"❬","㇛":"❬",く:"❬","𡿨":"❬","⟩":"❭","〉":"❭","〉":"❭","^":"︿","⸿":"¶","⁎":"*","٭":"*","∗":"*","𐌟":"*","᜵":"/","⁁":"/","∕":"/","⁄":"/","╱":"/","⟋":"/","⧸":"/","𝈺":"/","㇓":"/",〳:"/","Ⳇ":"/",ノ:"/",丿:"/","⼃":"/","⧶":"/̄","⫽":"//","⫻":"///","\":"\\","﹨":"\\","∖":"\\","⟍":"\\","⧵":"\\","⧹":"\\","𝈏":"\\","𝈻":"\\","㇔":"\\",丶:"\\","⼂":"\\","⳹":"\\\\","⑊":"\\\\","⟈":"\\ᑕ","ꝸ":"&","૰":"॰","𑂻":"॰","𑇇":"॰","⚬":"॰","𑇛":"꣼","៙":"๏","៕":"๚","៚":"๛","༌":"་","༎":"།།","˄":"^","ˆ":"^","꙾":"ˇ","˘":"ˇ","‾":"ˉ","﹉":"ˉ","﹊":"ˉ","﹋":"ˉ","﹌":"ˉ","¯":"ˉ"," ̄":"ˉ","▔":"ˉ",ъ:"ˉb","ꙑ":"ˉbi","͵":"ˏ","˻":"˪","꜖":"˪","꜔":"˫","。":"˳","⸰":"°","˚":"°","∘":"°","○":"°","◦":"°","⍜":"°̲","⍤":"°̈","℃":"°C","℉":"°F","௵":"௳","༛":"༚༚","༟":"༚༝","࿎":"༝༚","༞":"༝༝","Ⓒ":"©","Ⓡ":"®","Ⓟ":"℗","𝈛":"⅄","⯬":"↞","⯭":"↟","⯮":"↠","⯯":"↡","↵":"↲","⥥":"⇃⇂","⥯":"⇃ᛚ","𝛛":"∂","𝜕":"∂","𝝏":"∂","𝞉":"∂","𝟃":"∂","𞣌":"∂","𞣍":"∂̵",ð:"∂̵","⌀":"∅","𝛁":"∇","𝛻":"∇","𝜵":"∇","𝝯":"∇","𝞩":"∇","𑢨":"∇","⍢":"∇̈","⍫":"∇̴","█":"∎","■":"∎","⨿":"∐","᛭":"+","➕":"+","𐊛":"+","⨣":"+̂","⨢":"+̊","⨤":"+̃","∔":"+̇","⨥":"+̣","⨦":"+̰","⨧":"+₂","➗":"÷","‹":"<","❮":"<","˂":"<","𝈶":"<",ᐸ:"<",ᚲ:"<","⋖":"<·","Ⲵ":"<·",ᑅ:"<·","≪":"<<","⋘":"<<<","᐀":"=","⹀":"=","゠":"=","꓿":"=","≚":"=̆","≙":"=̂","≗":"=̊","≐":"=̇","≑":"=̣̇","⩮":"=⃰","⩵":"==","⩶":"===","≞":"=ͫ","›":">","❯":">","˃":">","𝈷":">",ᐳ:">","𖼿":">",ᑁ:">·","⪥":"><","≫":">>","⨠":">>","⋙":">>>","⁓":"~","˜":"~","῀":"~","∼":"~","⍨":"~̈","⸞":"~̇","⩪":"~̇","⸟":"~̣","𞣈":"∠","⋀":"∧","∯":"∮∮","∰":"∮∮∮","⸫":"∴","⸪":"∵","⸬":"∷","𑇞":"≈","♎":"≏","🝞":"≏","≣":"≡","⨃":"⊍","⨄":"⊎","𝈸":"⊏","𝈹":"⊐","⨅":"⊓","⨆":"⊔","⨂":"⊗","⍟":"⊛","🝱":"⊠","🝕":"⊡","◁":"⊲","▷":"⊳","⍣":"⋆̈","︴":"⌇","◠":"⌒","⨽":"⌙","⌥":"⌤","⧇":"⌻","◎":"⌾","⦾":"⌾","⧅":"⍂","⦰":"⍉","⏃":"⍋","⏂":"⍎","⏁":"⍕","⏆":"⍭","☸":"⎈","︵":"⏜","︶":"⏝","︷":"⏞","︸":"⏟","︹":"⏠","︺":"⏡","▱":"⏥","⏼":"⏻","︱":"│","|":"│","┃":"│","┏":"┌","┣":"├","▐":"▌","▗":"▖","▝":"▘","☐":"□","■":"▪","▸":"▶","►":"▶","⳩":"☧","🜊":"☩","🌒":"☽","🌙":"☽","⏾":"☾","🌘":"☾","⧙":"⦚","🜺":"⧟","⨾":"⨟","𐆠":"⳨","♩":"𝅘𝅥","♪":"𝅘𝅥𝅮","⓪":"🄍","↺":"🄎","˙":"ॱ","ൎ":"ॱ","-":"ー","—":"ー","―":"ー","─":"ー","━":"ー","㇐":"ー","ꟷ":"ー",ᅳ:"ー",ㅡ:"ー",一:"ー","⼀":"ー",ᆖ:"ーー","ힹ":"ーᅡ","ힺ":"ーᅥ","ힻ":"ーᅥ丨","ힼ":"ーᅩ",ᆕ:"ーᅮ",ᅴ:"ー丨",ㅢ:"ー丨",ᆗ:"ー丨ᅮ","🄏":"$⃠","₤":"£","〒":"₸","〶":"₸","᭜":"᭐","꧆":"꧐","𑓑":"১","೧":"౧","ၥ":"၁","①":"➀","⑩":"➉","⏨":"₁₀","𝟐":"2","𝟚":"2","𝟤":"2","𝟮":"2","𝟸":"2","🯲":"2","Ꝛ":"2",Ƨ:"2",Ϩ:"2","Ꙅ":"2",ᒿ:"2","ꛯ":"2","ꧏ":"٢","۲":"٢","૨":"२","𑓒":"২","೨":"౨","②":"➁",ƻ:"2̵","🄃":"2,","⒉":"2.","㏵":"22日","㍮":"22点","㏶":"23日","㍯":"23点","㏷":"24日","㍰":"24点","㏸":"25日","㏹":"26日","㏺":"27日","㏻":"28日","㏼":"29日","㏴":"2l日","㍭":"2l点","⒛":"2O.","㏳":"2O日","㍬":"2O点","෩":"෨ා","෯":"෨ී","㏡":"2日","㋁":"2月","㍚":"2点","𝈆":"3","𝟑":"3","𝟛":"3","𝟥":"3","𝟯":"3","𝟹":"3","🯳":"3","Ɜ":"3",Ȝ:"3",Ʒ:"3","Ꝫ":"3","Ⳍ":"3",З:"3",Ӡ:"3","𖼻":"3","𑣊":"3","۳":"٣","𞣉":"٣","૩":"३","③":"➂",Ҙ:"3̦","🄄":"3,","⒊":"3.","㏾":"3l日","㏽":"3O日","㏢":"3日","㋂":"3月","㍛":"3点","𝟒":"4","𝟜":"4","𝟦":"4","𝟰":"4","𝟺":"4","🯴":"4",Ꮞ:"4","𑢯":"4","۴":"٤","૪":"४","④":"➃","🄅":"4,","⒋":"4.",ᔰ:"4·","㏣":"4日","㋃":"4月","㍜":"4点","𝟓":"5","𝟝":"5","𝟧":"5","𝟱":"5","𝟻":"5","🯵":"5",Ƽ:"5","𑢻":"5","⑤":"➄","🄆":"5,","⒌":"5.","㏤":"5日","㋄":"5月","㍝":"5点","𝟔":"6","𝟞":"6","𝟨":"6","𝟲":"6","𝟼":"6","🯶":"6","Ⳓ":"6",б:"6",Ꮾ:"6","𑣕":"6","۶":"٦","𑓖":"৬","⑥":"➅","🄇":"6,","⒍":"6.","㏥":"6日","㋅":"6月","㍞":"6点","𝈒":"7","𝟕":"7","𝟟":"7","𝟩":"7","𝟳":"7","𝟽":"7","🯷":"7","𐓒":"7","𑣆":"7","⑦":"➆","🄈":"7,","⒎":"7.","㏦":"7日","㋆":"7月","㍟":"7点","ଃ":"8","৪":"8","੪":"8","𞣋":"8","𝟖":"8","𝟠":"8","𝟪":"8","𝟴":"8","𝟾":"8","🯸":"8",ȣ:"8",Ȣ:"8","𐌚":"8","૮":"८","⑧":"➇","🄉":"8,","⒏":"8.","㏧":"8日","㋇":"8月","㍠":"8点","੧":"9","୨":"9","৭":"9","൭":"9","𝟗":"9","𝟡":"9","𝟫":"9","𝟵":"9","𝟿":"9","🯹":"9","Ꝯ":"9","Ⳋ":"9","𑣌":"9","𑢬":"9","𑣖":"9","१":"٩","𑣤":"٩","۹":"٩","೯":"౯","⑨":"➈","🄊":"9,","⒐":"9.","㏨":"9日","㋈":"9月","㍡":"9点","⍺":"a",a:"a","𝐚":"a","𝑎":"a","𝒂":"a","𝒶":"a","𝓪":"a","𝔞":"a","𝕒":"a","𝖆":"a","𝖺":"a","𝗮":"a","𝘢":"a","𝙖":"a","𝚊":"a",ɑ:"a",α:"a","𝛂":"a","𝛼":"a","𝜶":"a","𝝰":"a","𝞪":"a",а:"a","ⷶ":"ͣ",A:"A","𝐀":"A","𝐴":"A","𝑨":"A","𝒜":"A","𝓐":"A","𝔄":"A","𝔸":"A","𝕬":"A","𝖠":"A","𝗔":"A","𝘈":"A","𝘼":"A","𝙰":"A",Α:"A","𝚨":"A","𝛢":"A","𝜜":"A","𝝖":"A","𝞐":"A",А:"A",Ꭺ:"A",ᗅ:"A","ꓮ":"A","𖽀":"A","𐊠":"A","⍶":"a̲",ǎ:"ă",Ǎ:"Ă",ȧ:"å",Ȧ:"Å",ẚ:"ả","℀":"a/c","℁":"a/s","ꜳ":"aa","Ꜳ":"AA",æ:"ae",ӕ:"ae",Æ:"AE",Ӕ:"AE","ꜵ":"ao","Ꜵ":"AO","🜇":"AR","ꜷ":"au","Ꜷ":"AU","ꜹ":"av","ꜻ":"av","Ꜹ":"AV","Ꜻ":"AV","ꜽ":"ay","Ꜽ":"AY","ꭺ":"ᴀ","∀":"Ɐ","𝈗":"Ɐ",ᗄ:"Ɐ","ꓯ":"Ɐ","𐐟":"Ɒ","𝐛":"b","𝑏":"b","𝒃":"b","𝒷":"b","𝓫":"b","𝔟":"b","𝕓":"b","𝖇":"b","𝖻":"b","𝗯":"b","𝘣":"b","𝙗":"b","𝚋":"b",Ƅ:"b",Ь:"b",Ꮟ:"b",ᑲ:"b",ᖯ:"b",B:"B",ℬ:"B","𝐁":"B","𝐵":"B","𝑩":"B","𝓑":"B","𝔅":"B","𝔹":"B","𝕭":"B","𝖡":"B","𝗕":"B","𝘉":"B","𝘽":"B","𝙱":"B","Ꞵ":"B",Β:"B","𝚩":"B","𝛣":"B","𝜝":"B","𝝗":"B","𝞑":"B",В:"B",Ᏼ:"B",ᗷ:"B","ꓐ":"B","𐊂":"B","𐊡":"B","𐌁":"B",ɓ:"b̔",ᑳ:"ḃ",ƃ:"b̄",Ƃ:"b̄",Б:"b̄",ƀ:"b̵",ҍ:"b̵",Ҍ:"b̵",ѣ:"b̵",Ѣ:"b̵",ᑿ:"b·",ᒁ:"ḃ·",ᒈ:"b'",Ы:"bl",в:"ʙ","ᏼ":"ʙ",c:"c","ⅽ":"c","𝐜":"c","𝑐":"c","𝒄":"c","𝒸":"c","𝓬":"c","𝔠":"c","𝕔":"c","𝖈":"c","𝖼":"c","𝗰":"c","𝘤":"c","𝙘":"c","𝚌":"c","ᴄ":"c",ϲ:"c","ⲥ":"c",с:"c","ꮯ":"c","𐐽":"c","ⷭ":"ͨ","🝌":"C","𑣲":"C","𑣩":"C",C:"C","Ⅽ":"C",ℂ:"C",ℭ:"C","𝐂":"C","𝐶":"C","𝑪":"C","𝒞":"C","𝓒":"C","𝕮":"C","𝖢":"C","𝗖":"C","𝘊":"C","𝘾":"C","𝙲":"C","Ϲ":"C","Ⲥ":"C",С:"C",Ꮯ:"C","ꓚ":"C","𐊢":"C","𐌂":"C","𐐕":"C","𐔜":"C","¢":"c̸","ȼ":"c̸","₡":"C⃫","🅮":"C⃠",ç:"c̦",ҫ:"c̦",Ç:"C̦",Ҫ:"C̦",Ƈ:"C'","℅":"c/o","℆":"c/u","🅭":"㏄ ⃝","⋴":"ꞓ",ɛ:"ꞓ",ε:"ꞓ","ϵ":"ꞓ","𝛆":"ꞓ","𝛜":"ꞓ","𝜀":"ꞓ","𝜖":"ꞓ","𝜺":"ꞓ","𝝐":"ꞓ","𝝴":"ꞓ","𝞊":"ꞓ","𝞮":"ꞓ","𝟄":"ꞓ","ⲉ":"ꞓ",є:"ꞓ","ԑ":"ꞓ","ꮛ":"ꞓ","𑣎":"ꞓ","𐐩":"ꞓ","€":"Ꞓ","Ⲉ":"Ꞓ",Є:"Ꞓ","⍷":"ꞓ̲","ͽ":"ꜿ","Ͽ":"Ꜿ","ⅾ":"d","ⅆ":"d","𝐝":"d","𝑑":"d","𝒅":"d","𝒹":"d","𝓭":"d","𝔡":"d","𝕕":"d","𝖉":"d","𝖽":"d","𝗱":"d","𝘥":"d","𝙙":"d","𝚍":"d","ԁ":"d",Ꮷ:"d",ᑯ:"d","ꓒ":"d","Ⅾ":"D","ⅅ":"D","𝐃":"D","𝐷":"D","𝑫":"D","𝒟":"D","𝓓":"D","𝔇":"D","𝔻":"D","𝕯":"D","𝖣":"D","𝗗":"D","𝘋":"D","𝘿":"D","𝙳":"D",Ꭰ:"D",ᗞ:"D",ᗪ:"D","ꓓ":"D",ɗ:"d̔",ɖ:"d̨",ƌ:"d̄",đ:"d̵",Đ:"D̵",Ð:"D̵",Ɖ:"D̵","₫":"ḏ̵","ꝺ":"Ꝺ",ᑻ:"d·",ᒇ:"d'",ʤ:"dȝ",dz:"dz",ʣ:"dz",Dz:"Dz",DZ:"DZ",dž:"dž",Dž:"Dž",DŽ:"DŽ",ʥ:"dʑ","ꭰ":"ᴅ","⸹":"ẟ",δ:"ẟ","𝛅":"ẟ","𝛿":"ẟ","𝜹":"ẟ","𝝳":"ẟ","𝞭":"ẟ",ծ:"ẟ",ᕷ:"ẟ","℮":"e",e:"e",ℯ:"e","ⅇ":"e","𝐞":"e","𝑒":"e","𝒆":"e","𝓮":"e","𝔢":"e","𝕖":"e","𝖊":"e","𝖾":"e","𝗲":"e","𝘦":"e","𝙚":"e","𝚎":"e","ꬲ":"e",е:"e",ҽ:"e","ⷷ":"ͤ","⋿":"E",E:"E",ℰ:"E","𝐄":"E","𝐸":"E","𝑬":"E","𝓔":"E","𝔈":"E","𝔼":"E","𝕰":"E","𝖤":"E","𝗘":"E","𝘌":"E","𝙀":"E","𝙴":"E",Ε:"E","𝚬":"E","𝛦":"E","𝜠":"E","𝝚":"E","𝞔":"E",Е:"E","ⴹ":"E",Ꭼ:"E","ꓰ":"E","𑢦":"E","𑢮":"E","𐊆":"E",ě:"ĕ",Ě:"Ĕ","ɇ":"e̸","Ɇ":"E̸",ҿ:"ę","ꭼ":"ᴇ",ə:"ǝ",ә:"ǝ","∃":"Ǝ","ⴺ":"Ǝ","ꓱ":"Ǝ",ɚ:"ǝ˞","ᴔ":"ǝo","ꭁ":"ǝo̸","ꭂ":"ǝo̵",Ә:"Ə","𝈡":"Ɛ",ℇ:"Ɛ","Ԑ":"Ɛ",Ꮛ:"Ɛ","𖼭":"Ɛ","𐐁":"Ɛ","ᶟ":"ᵋ","ᴈ":"ɜ",з:"ɜ",ҙ:"ɜ̦","𐑂":"ɞ","ꞝ":"ʚ","𐐪":"ʚ","𝐟":"f","𝑓":"f","𝒇":"f","𝒻":"f","𝓯":"f","𝔣":"f","𝕗":"f","𝖋":"f","𝖿":"f","𝗳":"f","𝘧":"f","𝙛":"f","𝚏":"f","ꬵ":"f","ꞙ":"f",ſ:"f","ẝ":"f",ք:"f","𝈓":"F",ℱ:"F","𝐅":"F","𝐹":"F","𝑭":"F","𝓕":"F","𝔉":"F","𝔽":"F","𝕱":"F","𝖥":"F","𝗙":"F","𝘍":"F","𝙁":"F","𝙵":"F","Ꞙ":"F",Ϝ:"F","𝟊":"F",ᖴ:"F","ꓝ":"F","𑣂":"F","𑢢":"F","𐊇":"F","𐊥":"F","𐔥":"F",ƒ:"f̦",Ƒ:"F̦","ᵮ":"f̴","℻":"FAX",ff:"ff",ffi:"ffi",ffl:"ffl",fi:"fi",fl:"fl",ʩ:"fŋ",ᖵ:"Ⅎ","ꓞ":"Ⅎ","𝈰":"ꟻ",ᖷ:"ꟻ",g:"g",ℊ:"g","𝐠":"g","𝑔":"g","𝒈":"g","𝓰":"g","𝔤":"g","𝕘":"g","𝖌":"g","𝗀":"g","𝗴":"g","𝘨":"g","𝙜":"g","𝚐":"g",ɡ:"g","ᶃ":"g",ƍ:"g",ց:"g","𝐆":"G","𝐺":"G","𝑮":"G","𝒢":"G","𝓖":"G","𝔊":"G","𝔾":"G","𝕲":"G","𝖦":"G","𝗚":"G","𝘎":"G","𝙂":"G","𝙶":"G","Ԍ":"G",Ꮐ:"G",Ᏻ:"G","ꓖ":"G","ᶢ":"ᵍ",ɠ:"g̔",ǧ:"ğ",Ǧ:"Ğ",ǵ:"ģ",ǥ:"g̵",Ǥ:"G̵",Ɠ:"G'","ԍ":"ɢ","ꮐ":"ɢ","ᏻ":"ɢ",h:"h",ℎ:"h","𝐡":"h","𝒉":"h","𝒽":"h","𝓱":"h","𝔥":"h","𝕙":"h","𝖍":"h","𝗁":"h","𝗵":"h","𝘩":"h","𝙝":"h","𝚑":"h",һ:"h",հ:"h",Ꮒ:"h",H:"H",ℋ:"H",ℌ:"H",ℍ:"H","𝐇":"H","𝐻":"H","𝑯":"H","𝓗":"H","𝕳":"H","𝖧":"H","𝗛":"H","𝘏":"H","𝙃":"H","𝙷":"H",Η:"H","𝚮":"H","𝛨":"H","𝜢":"H","𝝜":"H","𝞖":"H","Ⲏ":"H",Н:"H",Ꮋ:"H",ᕼ:"H","ꓧ":"H","𐋏":"H","ᵸ":"ᴴ",ɦ:"h̔","ꚕ":"h̔",Ᏺ:"h̔","Ⱨ":"H̩",Ң:"H̩",ħ:"h̵",ℏ:"h̵",ћ:"h̵",Ħ:"H̵","Ӊ":"H̦",Ӈ:"H̦",н:"ʜ","ꮋ":"ʜ",ң:"ʜ̩","ӊ":"ʜ̦",ӈ:"ʜ̦","Ԋ":"Ƕ","ꮀ":"ⱶ","Ͱ":"Ⱶ",Ꭸ:"Ⱶ",Ꮀ:"Ⱶ","ꚱ":"Ⱶ","ꞕ":"ꜧ","˛":"i","⍳":"i",i:"i","ⅰ":"i",ℹ:"i","ⅈ":"i","𝐢":"i","𝑖":"i","𝒊":"i","𝒾":"i","𝓲":"i","𝔦":"i","𝕚":"i","𝖎":"i","𝗂":"i","𝗶":"i","𝘪":"i","𝙞":"i","𝚒":"i",ı:"i","𝚤":"i",ɪ:"i",ɩ:"i",ι:"i",ι:"i",ͺ:"i","𝛊":"i","𝜄":"i","𝜾":"i","𝝸":"i","𝞲":"i",і:"i","ꙇ":"i","ӏ":"i","ꭵ":"i",Ꭵ:"i","𑣃":"i","ⓛ":"Ⓘ","⍸":"i̲",ǐ:"ĭ",Ǐ:"Ĭ",ɨ:"i̵","ᵻ":"i̵","ᵼ":"i̵","ⅱ":"ii","ⅲ":"iii",ij:"ij","ⅳ":"iv","ⅸ":"ix",j:"j","ⅉ":"j","𝐣":"j","𝑗":"j","𝒋":"j","𝒿":"j","𝓳":"j","𝔧":"j","𝕛":"j","𝖏":"j","𝗃":"j","𝗷":"j","𝘫":"j","𝙟":"j","𝚓":"j",ϳ:"j",ј:"j",J:"J","𝐉":"J","𝐽":"J","𝑱":"J","𝒥":"J","𝓙":"J","𝔍":"J","𝕁":"J","𝕵":"J","𝖩":"J","𝗝":"J","𝘑":"J","𝙅":"J","𝙹":"J","Ʝ":"J","Ϳ":"J",Ј:"J",Ꭻ:"J",ᒍ:"J","ꓙ":"J","ɉ":"j̵","Ɉ":"J̵",ᒙ:"J·","𝚥":"ȷ",յ:"ȷ","ꭻ":"ᴊ","𝐤":"k","𝑘":"k","𝒌":"k","𝓀":"k","𝓴":"k","𝔨":"k","𝕜":"k","𝖐":"k","𝗄":"k","𝗸":"k","𝘬":"k","𝙠":"k","𝚔":"k",K:"K",K:"K","𝐊":"K","𝐾":"K","𝑲":"K","𝒦":"K","𝓚":"K","𝔎":"K","𝕂":"K","𝕶":"K","𝖪":"K","𝗞":"K","𝘒":"K","𝙆":"K","𝙺":"K",Κ:"K","𝚱":"K","𝛫":"K","𝜥":"K","𝝟":"K","𝞙":"K","Ⲕ":"K",К:"K",Ꮶ:"K",ᛕ:"K","ꓗ":"K","𐔘":"K",ƙ:"k̔","Ⱪ":"K̩",Қ:"K̩","₭":"K̵","Ꝁ":"K̵",Ҟ:"K̵",Ƙ:"K'","׀":"l","|":"l","∣":"l","⏽":"l","│":"l","١":"l","۱":"l","𐌠":"l","𞣇":"l","𝟏":"l","𝟙":"l","𝟣":"l","𝟭":"l","𝟷":"l","🯱":"l",I:rve,I:"l","Ⅰ":"l",ℐ:"l",ℑ:"l","𝐈":"l","𝐼":"l","𝑰":"l","𝓘":"l","𝕀":"l","𝕴":"l","𝖨":"l","𝗜":"l","𝘐":"l","𝙄":"l","𝙸":"l",Ɩ:"l",l:"l","ⅼ":"l",ℓ:"l","𝐥":"l","𝑙":"l","𝒍":"l","𝓁":"l","𝓵":"l","𝔩":"l","𝕝":"l","𝖑":"l","𝗅":"l","𝗹":"l","𝘭":"l","𝙡":"l","𝚕":"l",ǀ:"l",Ι:"l","𝚰":"l","𝛪":"l","𝜤":"l","𝝞":"l","𝞘":"l","Ⲓ":"l",І:"l",Ӏ:"l",ו:"l",ן:"l",ا:"l","𞸀":"l","𞺀":"l",ﺎ:"l",ﺍ:"l","ߊ":"l","ⵏ":"l",ᛁ:"l","ꓲ":"l","𖼨":"l","𐊊":"l","𐌉":"l","𝈪":"L","Ⅼ":"L",ℒ:"L","𝐋":"L","𝐿":"L","𝑳":"L","𝓛":"L","𝔏":"L","𝕃":"L","𝕷":"L","𝖫":"L","𝗟":"L","𝘓":"L","𝙇":"L","𝙻":"L","Ⳑ":"L",Ꮮ:"L",ᒪ:"L","ꓡ":"L","𖼖":"L","𑢣":"L","𑢲":"L","𐐛":"L","𐔦":"L",ﴼ:"l̋",ﴽ:"l̋",ł:"l̸",Ł:"L̸",ɭ:"l̨",Ɨ:"l̵",ƚ:"l̵",ɫ:"l̴",إ:"lٕ",ﺈ:"lٕ",ﺇ:"lٕ",ٳ:"lٕ",ŀ:"l·",Ŀ:"l·",ᒷ:"l·","🄂":"l,","⒈":"l.",ױ:"l'","⒓":"l2.","㏫":"l2日","㋋":"l2月","㍤":"l2点","⒔":"l3.","㏬":"l3日","㍥":"l3点","⒕":"l4.","㏭":"l4日","㍦":"l4点","⒖":"l5.","㏮":"l5日","㍧":"l5点","⒗":"l6.","㏯":"l6日","㍨":"l6点","⒘":"l7.","㏰":"l7日","㍩":"l7点","⒙":"l8.","㏱":"l8日","㍪":"l8点","⒚":"l9.","㏲":"l9日","㍫":"l9点",lj:"lj",IJ:"lJ",Lj:"Lj",LJ:"LJ","‖":"ll","∥":"ll","Ⅱ":"ll",ǁ:"ll",װ:"ll","𐆙":"l̵l̵","⒒":"ll.","Ⅲ":"lll","𐆘":"l̵l̵S̵","㏪":"ll日","㋊":"ll月","㍣":"ll点",Ю:"lO","⒑":"lO.","㏩":"lO日","㋉":"lO月","㍢":"lO点",ʪ:"ls","₶":"lt","Ⅳ":"lV","Ⅸ":"lX",ɮ:"lȝ",ʫ:"lz",أ:"lٴ",ﺄ:"lٴ",ﺃ:"lٴ",ٲ:"lٴ",ٵ:"lٴ",ﷳ:"lكبر",ﷲ:"lللّٰo","㏠":"l日","㋀":"l月","㍙":"l点","ⳑ":"ʟ","ꮮ":"ʟ","𐑃":"ʟ",M:"M","Ⅿ":"M",ℳ:"M","𝐌":"M","𝑀":"M","𝑴":"M","𝓜":"M","𝔐":"M","𝕄":"M","𝕸":"M","𝖬":"M","𝗠":"M","𝘔":"M","𝙈":"M","𝙼":"M",Μ:"M","𝚳":"M","𝛭":"M","𝜧":"M","𝝡":"M","𝞛":"M","Ϻ":"M","Ⲙ":"M",М:"M",Ꮇ:"M",ᗰ:"M",ᛖ:"M","ꓟ":"M","𐊰":"M","𐌑":"M","Ӎ":"M̦","🝫":"MB","ⷨ":"ᷟ","𝐧":"n","𝑛":"n","𝒏":"n","𝓃":"n","𝓷":"n","𝔫":"n","𝕟":"n","𝖓":"n","𝗇":"n","𝗻":"n","𝘯":"n","𝙣":"n","𝚗":"n",ո:"n",ռ:"n",N:"N",ℕ:"N","𝐍":"N","𝑁":"N","𝑵":"N","𝒩":"N","𝓝":"N","𝔑":"N","𝕹":"N","𝖭":"N","𝗡":"N","𝘕":"N","𝙉":"N","𝙽":"N",Ν:"N","𝚴":"N","𝛮":"N","𝜨":"N","𝝢":"N","𝞜":"N","Ⲛ":"N","ꓠ":"N","𐔓":"N","𐆎":"N̊",ɳ:"n̨",ƞ:"n̩",η:"n̩","𝛈":"n̩","𝜂":"n̩","𝜼":"n̩","𝝶":"n̩","𝞰":"n̩",Ɲ:"N̦","ᵰ":"n̴",nj:"nj",Nj:"Nj",NJ:"NJ","№":"No","ͷ":"ᴎ",и:"ᴎ","𐑍":"ᴎ",ņ:"ɲ","ం":"o","ಂ":"o","ം":"o","ං":"o","०":"o","੦":"o","૦":"o","௦":"o","౦":"o","೦":"o","൦":"o","๐":"o","໐":"o","၀":"o","٥":"o","۵":"o",o:"o",ℴ:"o","𝐨":"o","𝑜":"o","𝒐":"o","𝓸":"o","𝔬":"o","𝕠":"o","𝖔":"o","𝗈":"o","𝗼":"o","𝘰":"o","𝙤":"o","𝚘":"o","ᴏ":"o","ᴑ":"o","ꬽ":"o",ο:"o","𝛐":"o","𝜊":"o","𝝄":"o","𝝾":"o","𝞸":"o",σ:"o","𝛔":"o","𝜎":"o","𝝈":"o","𝞂":"o","𝞼":"o","ⲟ":"o",о:"o","ჿ":"o",օ:"o",ס:"o",ه:"o","𞸤":"o","𞹤":"o","𞺄":"o",ﻫ:"o",ﻬ:"o",ﻪ:"o",ﻩ:"o",ھ:"o",ﮬ:"o",ﮭ:"o",ﮫ:"o",ﮪ:"o",ہ:"o",ﮨ:"o",ﮩ:"o",ﮧ:"o",ﮦ:"o",ە:"o",ഠ:"o",ဝ:"o","𐓪":"o","𑣈":"o","𑣗":"o","𐐬":"o","߀":"O","০":"O","୦":"O","〇":"O","𑓐":"O","𑣠":"O","𝟎":"O","𝟘":"O","𝟢":"O","𝟬":"O","𝟶":"O","🯰":"O",O:"O","𝐎":"O","𝑂":"O","𝑶":"O","𝒪":"O","𝓞":"O","𝔒":"O","𝕆":"O","𝕺":"O","𝖮":"O","𝗢":"O","𝘖":"O","𝙊":"O","𝙾":"O",Ο:"O","𝚶":"O","𝛰":"O","𝜪":"O","𝝤":"O","𝞞":"O","Ⲟ":"O",О:"O",Օ:"O","ⵔ":"O",ዐ:"O",ଠ:"O","𐓂":"O","ꓳ":"O","𑢵":"O","𐊒":"O","𐊫":"O","𐐄":"O","𐔖":"O","⁰":"º","ᵒ":"º",ǒ:"ŏ",Ǒ:"Ŏ","ۿ":"ô",Ő:"Ö",ø:"o̸","ꬾ":"o̸",Ø:"O̸","ⵁ":"O̸",Ǿ:"Ó̸",ɵ:"o̵","ꝋ":"o̵",ө:"o̵",ѳ:"o̵","ꮎ":"o̵","ꮻ":"o̵","⊖":"O̵","⊝":"O̵","⍬":"O̵","𝈚":"O̵","🜔":"O̵",Ɵ:"O̵","Ꝋ":"O̵",θ:"O̵",ϑ:"O̵","𝛉":"O̵","𝛝":"O̵","𝜃":"O̵","𝜗":"O̵","𝜽":"O̵","𝝑":"O̵","𝝷":"O̵","𝞋":"O̵","𝞱":"O̵","𝟅":"O̵",Θ:"O̵","ϴ":"O̵","𝚯":"O̵","𝚹":"O̵","𝛩":"O̵","𝛳":"O̵","𝜣":"O̵","𝜭":"O̵","𝝝":"O̵","𝝧":"O̵","𝞗":"O̵","𝞡":"O̵",Ө:"O̵",Ѳ:"O̵","ⴱ":"O̵",Ꮎ:"O̵",Ꮻ:"O̵","ꭴ":"ơ",ﳙ:"oٰ","🄁":"O,","🄀":"O.",ơ:"o'",Ơ:"O'",Ꭴ:"O'","%":"º/₀","٪":"º/₀","⁒":"º/₀","‰":"º/₀₀","؉":"º/₀₀","‱":"º/₀₀₀","؊":"º/₀₀₀",œ:"oe",Œ:"OE",ɶ:"oᴇ","∞":"oo","ꝏ":"oo","ꚙ":"oo","Ꝏ":"OO","Ꚙ":"OO",ﳗ:"oج",ﱑ:"oج",ﳘ:"oم",ﱒ:"oم",ﶓ:"oمج",ﶔ:"oمم",ﱓ:"oى",ﱔ:"oى","ൟ":"oരo",တ:"oာ","㍘":"O点","ↄ":"ɔ","ᴐ":"ɔ","ͻ":"ɔ","𐑋":"ɔ","Ↄ":"Ɔ","Ͻ":"Ɔ","ꓛ":"Ɔ","𐐣":"Ɔ","ꬿ":"ɔ̸","ꭢ":"ɔe","𐐿":"ɷ","⍴":"p",p:"p","𝐩":"p","𝑝":"p","𝒑":"p","𝓅":"p","𝓹":"p","𝔭":"p","𝕡":"p","𝖕":"p","𝗉":"p","𝗽":"p","𝘱":"p","𝙥":"p","𝚙":"p",ρ:"p",ϱ:"p","𝛒":"p","𝛠":"p","𝜌":"p","𝜚":"p","𝝆":"p","𝝔":"p","𝞀":"p","𝞎":"p","𝞺":"p","𝟈":"p","ⲣ":"p",р:"p",P:"P",ℙ:"P","𝐏":"P","𝑃":"P","𝑷":"P","𝒫":"P","𝓟":"P","𝔓":"P","𝕻":"P","𝖯":"P","𝗣":"P","𝘗":"P","𝙋":"P","𝙿":"P",Ρ:"P","𝚸":"P","𝛲":"P","𝜬":"P","𝝦":"P","𝞠":"P","Ⲣ":"P",Р:"P",Ꮲ:"P",ᑭ:"P","ꓑ":"P","𐊕":"P",ƥ:"p̔","ᵽ":"p̵",ᑷ:"p·",ᒆ:"P'","ᴩ":"ᴘ","ꮲ":"ᴘ",φ:"ɸ",ϕ:"ɸ","𝛗":"ɸ","𝛟":"ɸ","𝜑":"ɸ","𝜙":"ɸ","𝝋":"ɸ","𝝓":"ɸ","𝞅":"ɸ","𝞍":"ɸ","𝞿":"ɸ","𝟇":"ɸ","ⲫ":"ɸ",ф:"ɸ","𝐪":"q","𝑞":"q","𝒒":"q","𝓆":"q","𝓺":"q","𝔮":"q","𝕢":"q","𝖖":"q","𝗊":"q","𝗾":"q","𝘲":"q","𝙦":"q","𝚚":"q","ԛ":"q",գ:"q",զ:"q",ℚ:"Q","𝐐":"Q","𝑄":"Q","𝑸":"Q","𝒬":"Q","𝓠":"Q","𝔔":"Q","𝕼":"Q","𝖰":"Q","𝗤":"Q","𝘘":"Q","𝙌":"Q","𝚀":"Q","ⵕ":"Q",ʠ:"q̔","🜀":"QE","ᶐ":"ɋ","ᴋ":"ĸ",κ:"ĸ",ϰ:"ĸ","𝛋":"ĸ","𝛞":"ĸ","𝜅":"ĸ","𝜘":"ĸ","𝜿":"ĸ","𝝒":"ĸ","𝝹":"ĸ","𝞌":"ĸ","𝞳":"ĸ","𝟆":"ĸ","ⲕ":"ĸ",к:"ĸ","ꮶ":"ĸ",қ:"ĸ̩",ҟ:"ĸ̵","𝐫":"r","𝑟":"r","𝒓":"r","𝓇":"r","𝓻":"r","𝔯":"r","𝕣":"r","𝖗":"r","𝗋":"r","𝗿":"r","𝘳":"r","𝙧":"r","𝚛":"r","ꭇ":"r","ꭈ":"r","ᴦ":"r","ⲅ":"r",г:"r","ꮁ":"r","𝈖":"R",ℛ:"R",ℜ:"R",ℝ:"R","𝐑":"R","𝑅":"R","𝑹":"R","𝓡":"R","𝕽":"R","𝖱":"R","𝗥":"R","𝘙":"R","𝙍":"R","𝚁":"R",Ʀ:"R",Ꭱ:"R",Ꮢ:"R","𐒴":"R",ᖇ:"R","ꓣ":"R","𖼵":"R",ɽ:"r̨",ɼ:"r̩","ɍ":"r̵",ғ:"r̵","ᵲ":"r̴",ґ:"r'","𑣣":"rn",m:ive,"ⅿ":"rn","𝐦":"rn","𝑚":"rn","𝒎":"rn","𝓂":"rn","𝓶":"rn","𝔪":"rn","𝕞":"rn","𝖒":"rn","𝗆":"rn","𝗺":"rn","𝘮":"rn","𝙢":"rn","𝚖":"rn","𑜀":"rn","₥":"rn̸",ɱ:"rn̦","ᵯ":"rn̴","₨":"Rs","ꭱ":"ʀ","ꮢ":"ʀ",я:"ᴙ","ᵳ":"ɾ̴","℩":"ɿ",s:"s","𝐬":"s","𝑠":"s","𝒔":"s","𝓈":"s","𝓼":"s","𝔰":"s","𝕤":"s","𝖘":"s","𝗌":"s","𝘀":"s","𝘴":"s","𝙨":"s","𝚜":"s","ꜱ":"s",ƽ:"s",ѕ:"s","ꮪ":"s","𑣁":"s","𐑈":"s",S:"S","𝐒":"S","𝑆":"S","𝑺":"S","𝒮":"S","𝓢":"S","𝔖":"S","𝕊":"S","𝕾":"S","𝖲":"S","𝗦":"S","𝘚":"S","𝙎":"S","𝚂":"S",Ѕ:"S",Տ:"S",Ꮥ:"S",Ꮪ:"S","ꓢ":"S","𖼺":"S","𐊖":"S","𐐠":"S",ʂ:"s̨","ᵴ":"s̴","ꞵ":"ß",β:"ß",ϐ:"ß","𝛃":"ß","𝛽":"ß","𝜷":"ß","𝝱":"ß","𝞫":"ß",Ᏸ:"ß","🝜":"sss",st:"st","∫":"ʃ","ꭍ":"ʃ","∑":"Ʃ","⅀":"Ʃ",Σ:"Ʃ","𝚺":"Ʃ","𝛴":"Ʃ","𝜮":"Ʃ","𝝨":"Ʃ","𝞢":"Ʃ","ⵉ":"Ʃ","∬":"ʃʃ","∭":"ʃʃʃ","⨌":"ʃʃʃʃ","𝐭":"t","𝑡":"t","𝒕":"t","𝓉":"t","𝓽":"t","𝔱":"t","𝕥":"t","𝖙":"t","𝗍":"t","𝘁":"t","𝘵":"t","𝙩":"t","𝚝":"t","⊤":"T","⟙":"T","🝨":"T",T:"T","𝐓":"T","𝑇":"T","𝑻":"T","𝒯":"T","𝓣":"T","𝔗":"T","𝕋":"T","𝕿":"T","𝖳":"T","𝗧":"T","𝘛":"T","𝙏":"T","𝚃":"T",Τ:"T","𝚻":"T","𝛵":"T","𝜯":"T","𝝩":"T","𝞣":"T","Ⲧ":"T",Т:"T",Ꭲ:"T","ꓔ":"T","𖼊":"T","𑢼":"T","𐊗":"T","𐊱":"T","𐌕":"T",ƭ:"t̔","⍡":"T̈","Ⱦ":"T̸",Ț:"Ţ",Ʈ:"T̨",Ҭ:"T̩","₮":"T⃫",ŧ:"t̵",Ŧ:"T̵","ᵵ":"t̴",Ⴀ:"Ꞇ","Ꜩ":"T3",ʨ:"tɕ","℡":"TEL","ꝷ":"tf",ʦ:"ts",ʧ:"tʃ","ꜩ":"tȝ",τ:"ᴛ","𝛕":"ᴛ","𝜏":"ᴛ","𝝉":"ᴛ","𝞃":"ᴛ","𝞽":"ᴛ",т:"ᴛ","ꭲ":"ᴛ",ҭ:"ᴛ̩",ţ:"ƫ",ț:"ƫ",Ꮏ:"ƫ","𝐮":"u","𝑢":"u","𝒖":"u","𝓊":"u","𝓾":"u","𝔲":"u","𝕦":"u","𝖚":"u","𝗎":"u","𝘂":"u","𝘶":"u","𝙪":"u","𝚞":"u","ꞟ":"u","ᴜ":"u","ꭎ":"u","ꭒ":"u",ʋ:"u",υ:"u","𝛖":"u","𝜐":"u","𝝊":"u","𝞄":"u","𝞾":"u",ս:"u","𐓶":"u","𑣘":"u","∪":"U","⋃":"U","𝐔":"U","𝑈":"U","𝑼":"U","𝒰":"U","𝓤":"U","𝔘":"U","𝕌":"U","𝖀":"U","𝖴":"U","𝗨":"U","𝘜":"U","𝙐":"U","𝚄":"U",Ս:"U",ሀ:"U","𐓎":"U",ᑌ:"U","ꓴ":"U","𖽂":"U","𑢸":"U",ǔ:"ŭ",Ǔ:"Ŭ","ᵾ":"u̵","ꮜ":"u̵","Ʉ":"U̵",Ꮜ:"U̵",ᑘ:"U·",ᑧ:"U'","ᵫ":"ue","ꭣ":"uo",ṃ:"ꭑ",պ:"ɰ",ሣ:"ɰ","℧":"Ʊ",ᘮ:"Ʊ",ᘴ:"Ʊ","ᵿ":"ʊ̵","∨":"v","⋁":"v",v:"v","ⅴ":"v","𝐯":"v","𝑣":"v","𝒗":"v","𝓋":"v","𝓿":"v","𝔳":"v","𝕧":"v","𝖛":"v","𝗏":"v","𝘃":"v","𝘷":"v","𝙫":"v","𝚟":"v","ᴠ":"v",ν:"v","𝛎":"v","𝜈":"v","𝝂":"v","𝝼":"v","𝞶":"v",ѵ:"v",ט:"v","𑜆":"v","ꮩ":"v","𑣀":"v","𝈍":"V","٧":"V","۷":"V","Ⅴ":"V","𝐕":"V","𝑉":"V","𝑽":"V","𝒱":"V","𝓥":"V","𝔙":"V","𝕍":"V","𝖁":"V","𝖵":"V","𝗩":"V","𝘝":"V","𝙑":"V","𝚅":"V",Ѵ:"V","ⴸ":"V",Ꮩ:"V",ᐯ:"V","ꛟ":"V","ꓦ":"V","𖼈":"V","𑢠":"V","𐔝":"V","𐆗":"V̵",ᐻ:"V·","🝬":"VB","ⅵ":"vi","ⅶ":"vii","ⅷ":"viii","Ⅵ":"Vl","Ⅶ":"Vll","Ⅷ":"Vlll","🜈":"Vᷤ","ᴧ":"ʌ","𐓘":"ʌ","٨":"Ʌ","۸":"Ʌ",Λ:"Ʌ","𝚲":"Ʌ","𝛬":"Ʌ","𝜦":"Ʌ","𝝠":"Ʌ","𝞚":"Ʌ",Л:"Ʌ","ⴷ":"Ʌ","𐒰":"Ʌ",ᐱ:"Ʌ","ꛎ":"Ʌ","ꓥ":"Ʌ","𖼽":"Ʌ","𐊍":"Ʌ","Ӆ":"Ʌ̦",ᐽ:"Ʌ·",ɯ:"w","𝐰":"w","𝑤":"w","𝒘":"w","𝓌":"w","𝔀":"w","𝔴":"w","𝕨":"w","𝖜":"w","𝗐":"w","𝘄":"w","𝘸":"w","𝙬":"w","𝚠":"w","ᴡ":"w",ѡ:"w","ԝ":"w",ա:"w","𑜊":"w","𑜎":"w","𑜏":"w","ꮃ":"w","𑣯":"W","𑣦":"W","𝐖":"W","𝑊":"W","𝑾":"W","𝒲":"W","𝓦":"W","𝔚":"W","𝕎":"W","𝖂":"W","𝖶":"W","𝗪":"W","𝘞":"W","𝙒":"W","𝚆":"W","Ԝ":"W",Ꮃ:"W",Ꮤ:"W","ꓪ":"W",ѽ:"w҆҇","𑓅":"ẇ","₩":"W̵","ꝡ":"w̦","ᴍ":"ʍ",м:"ʍ","ꮇ":"ʍ","ӎ":"ʍ̦","᙮":"x","×":"x","⤫":"x","⤬":"x","⨯":"x",x:"x","ⅹ":"x","𝐱":"x","𝑥":"x","𝒙":"x","𝓍":"x","𝔁":"x","𝔵":"x","𝕩":"x","𝖝":"x","𝗑":"x","𝘅":"x","𝘹":"x","𝙭":"x","𝚡":"x",х:"x",ᕁ:"x",ᕽ:"x","ⷯ":"ͯ","᙭":"X","╳":"X","𐌢":"X","𑣬":"X",X:"X","Ⅹ":"X","𝐗":"X","𝑋":"X","𝑿":"X","𝒳":"X","𝓧":"X","𝔛":"X","𝕏":"X","𝖃":"X","𝖷":"X","𝗫":"X","𝘟":"X","𝙓":"X","𝚇":"X","Ꭓ":"X",Χ:"X","𝚾":"X","𝛸":"X","𝜲":"X","𝝬":"X","𝞦":"X","Ⲭ":"X",Х:"X","ⵝ":"X",ᚷ:"X","ꓫ":"X","𐊐":"X","𐊴":"X","𐌗":"X","𐔧":"X","⨰":"ẋ",Ҳ:"X̩","𐆖":"X̵","ⅺ":"xi","ⅻ":"xii","Ⅺ":"Xl","Ⅻ":"Xll",ɣ:"y","ᶌ":"y",y:"y","𝐲":"y","𝑦":"y","𝒚":"y","𝓎":"y","𝔂":"y","𝔶":"y","𝕪":"y","𝖞":"y","𝗒":"y","𝘆":"y","𝘺":"y","𝙮":"y","𝚢":"y",ʏ:"y","ỿ":"y","ꭚ":"y",γ:"y","ℽ":"y","𝛄":"y","𝛾":"y","𝜸":"y","𝝲":"y","𝞬":"y",у:"y",ү:"y",ყ:"y","𑣜":"y",Y:"Y","𝐘":"Y","𝑌":"Y","𝒀":"Y","𝒴":"Y","𝓨":"Y","𝔜":"Y","𝕐":"Y","𝖄":"Y","𝖸":"Y","𝗬":"Y","𝘠":"Y","𝙔":"Y","𝚈":"Y",Υ:"Y",ϒ:"Y","𝚼":"Y","𝛶":"Y","𝜰":"Y","𝝪":"Y","𝞤":"Y","Ⲩ":"Y",У:"Y",Ү:"Y",Ꭹ:"Y",Ꮍ:"Y","ꓬ":"Y","𖽃":"Y","𑢤":"Y","𐊲":"Y",ƴ:"y̔","ɏ":"y̵",ұ:"y̵","¥":"Y̵","Ɏ":"Y̵",Ұ:"Y̵",ʒ:"ȝ","ꝫ":"ȝ","ⳍ":"ȝ",ӡ:"ȝ",ჳ:"ȝ","𝐳":"z","𝑧":"z","𝒛":"z","𝓏":"z","𝔃":"z","𝔷":"z","𝕫":"z","𝖟":"z","𝗓":"z","𝘇":"z","𝘻":"z","𝙯":"z","𝚣":"z","ᴢ":"z","ꮓ":"z","𑣄":"z","𐋵":"Z","𑣥":"Z",Z:"Z",ℤ:"Z",ℨ:"Z","𝐙":"Z","𝑍":"Z","𝒁":"Z","𝒵":"Z","𝓩":"Z","𝖅":"Z","𝖹":"Z","𝗭":"Z","𝘡":"Z","𝙕":"Z","𝚉":"Z",Ζ:"Z","𝚭":"Z","𝛧":"Z","𝜡":"Z","𝝛":"Z","𝞕":"Z",Ꮓ:"Z","ꓜ":"Z","𑢩":"Z",ʐ:"z̨",ƶ:"z̵",Ƶ:"Z̵",ȥ:"z̦",Ȥ:"Z̦","ᵶ":"z̴",ƿ:"þ","ϸ":"þ","Ϸ":"Þ","𐓄":"Þ","⁹":"ꝰ","ᴤ":"ƨ",ϩ:"ƨ","ꙅ":"ƨ",ь:"ƅ","ꮟ":"ƅ",ы:"ƅi","ꭾ":"ɂ",ˤ:"ˁ","ꛍ":"ʡ","⊙":"ʘ","☉":"ʘ","⨀":"ʘ","Ꙩ":"ʘ","ⵙ":"ʘ","𐓃":"ʘ","ℾ":"Γ","𝚪":"Γ","𝛤":"Γ","𝜞":"Γ","𝝘":"Γ","𝞒":"Γ","Ⲅ":"Γ",Г:"Γ",Ꮁ:"Γ",ᒥ:"Γ","𖼇":"Γ",Ғ:"Γ̵",ᒯ:"Γ·",Ґ:"Γ'","∆":"Δ","△":"Δ","🜂":"Δ","𝚫":"Δ","𝛥":"Δ","𝜟":"Δ","𝝙":"Δ","𝞓":"Δ","Ⲇ":"Δ","ⵠ":"Δ",ᐃ:"Δ","𖼚":"Δ","𐊅":"Δ","𐊣":"Δ","⍙":"Δ̲",ᐏ:"Δ·",ᐬ:"Δᐠ","𝟋":"ϝ","𝛇":"ζ","𝜁":"ζ","𝜻":"ζ","𝝵":"ζ","𝞯":"ζ","ⳤ":"ϗ","𝛌":"λ","𝜆":"λ","𝝀":"λ","𝝺":"λ","𝞴":"λ","Ⲗ":"λ","𐓛":"λ",µ:"μ","𝛍":"μ","𝜇":"μ","𝝁":"μ","𝝻":"μ","𝞵":"μ","𝛏":"ξ","𝜉":"ξ","𝝃":"ξ","𝝽":"ξ","𝞷":"ξ","𝚵":"Ξ","𝛯":"Ξ","𝜩":"Ξ","𝝣":"Ξ","𝞝":"Ξ",ϖ:"π","ℼ":"π","𝛑":"π","𝛡":"π","𝜋":"π","𝜛":"π","𝝅":"π","𝝕":"π","𝝿":"π","𝞏":"π","𝞹":"π","𝟉":"π","ᴨ":"π",п:"π","∏":"Π","ℿ":"Π","𝚷":"Π","𝛱":"Π","𝜫":"Π","𝝥":"Π","𝞟":"Π","Ⲡ":"Π",П:"Π","ꛛ":"Π","𐊭":"Ϙ","𐌒":"Ϙ",ϛ:"ς","𝛓":"ς","𝜍":"ς","𝝇":"ς","𝞁":"ς","𝞻":"ς","𝚽":"Φ","𝛷":"Φ","𝜱":"Φ","𝝫":"Φ","𝞥":"Φ","Ⲫ":"Φ",Ф:"Φ",Փ:"Φ",ቀ:"Φ","ᛰ":"Φ","𐊳":"Φ","ꭓ":"χ","ꭕ":"χ","𝛘":"χ","𝜒":"χ","𝝌":"χ","𝞆":"χ","𝟀":"χ","ⲭ":"χ","𝛙":"ψ","𝜓":"ψ","𝝍":"ψ","𝞇":"ψ","𝟁":"ψ",ѱ:"ψ","𐓹":"ψ","𝚿":"Ψ","𝛹":"Ψ","𝜳":"Ψ","𝝭":"Ψ","𝞧":"Ψ","Ⲯ":"Ψ",Ѱ:"Ψ","𐓑":"Ψ",ᛘ:"Ψ","𐊵":"Ψ","⍵":"ω","ꞷ":"ω","𝛚":"ω","𝜔":"ω","𝝎":"ω","𝞈":"ω","𝟂":"ω","ⲱ":"ω","ꙍ":"ω",Ω:"Ω","𝛀":"Ω","𝛺":"Ω","𝜴":"Ω","𝝮":"Ω","𝞨":"Ω",ᘯ:"Ω",ᘵ:"Ω","𐊶":"Ω","⍹":"ω̲",ώ:"ῴ","☰":"Ⲷ","Ⳝ":"Ϭ",җ:"ж̩",Җ:"Ж̩","𝈋":"И","Ͷ":"И","ꚡ":"И","𐐥":"И",Й:"Ѝ","Ҋ":"Ѝ̦",ѝ:"й","ҋ":"й̦","𐒼":"Ӄ","ᴫ":"л","ӆ":"л̦","ꭠ":"љ","𐓫":"ꙩ","ᷮ":"ⷬ","𐓍":"Ћ","𝈂":"Ӿ","𝈢":"Ѡ",Ꮗ:"Ѡ",ᗯ:"Ѡ",Ѽ:"Ѡ҆҇","ᣭ":"Ѡ·","Ꞷ":"Ꙍ",ӌ:"ҷ",Ӌ:"Ҷ",Ҿ:"Ҽ̨","ⲽ":"ш","Ⲽ":"Ш","Ꙑ":"Ъl","℈":"Э","🜁":"Ꙙ","𖼜":"Ꙙ","ꦒ":"ⰿ",և:"եւ",ኔ:"ձ",ﬔ:"մե",ﬕ:"մի",ﬗ:"մխ",ﬓ:"մն","∩":"Ո","⋂":"Ո","𝉅":"Ո",በ:"Ո",ᑎ:"Ո","ꓵ":"Ո",ᑚ:"Ո·",ᑨ:"Ո'",ﬖ:"վն","₽":"Ք","˓":"ՙ",ʿ:"ՙ",ℵ:"א",ﬡ:"א",אָ:"אַ",אּ:"אַ",ﭏ:"אל",ℶ:"ב",ℷ:"ג",ℸ:"ד",ﬢ:"ד",ﬣ:"ה",יּ:"יִ",ﬤ:"כ",ﬥ:"ל",ﬦ:"ם",ﬠ:"ע",ﬧ:"ר",שׂ:"שׁ",שּ:"שׁ",שּׂ:"שּׁ",ﬨ:"ת",ﺀ:"ء","۽":"ء͈",ﺂ:"آ",ﺁ:"آ",ﭑ:"ٱ",ﭐ:"ٱ","𞸁":"ب","𞸡":"ب","𞹡":"ب","𞺁":"ب","𞺡":"ب",ﺑ:"ب",ﺒ:"ب",ﺐ:"ب",ﺏ:"ب","ݑ":"بۛ","ࢶ":"بۢ","ࢡ":"بٔ",ﲠ:"بo",ﳢ:"بo",ﲜ:"بج",ﰅ:"بج",ﲝ:"بح",ﰆ:"بح",ﷂ:"بحى",ﲞ:"بخ",ﰇ:"بخ",ﳒ:"بخ",ﱋ:"بخ",ﶞ:"بخى",ﱪ:"بر",ﱫ:"بز",ﲟ:"بم",ﳡ:"بم",ﱬ:"بم",ﰈ:"بم",ﱭ:"بن",ﱮ:"بى",ﰉ:"بى",ﱯ:"بى",ﰊ:"بى",ﭔ:"ٻ",ﭕ:"ٻ",ﭓ:"ٻ",ﭒ:"ٻ",ې:"ٻ",ﯦ:"ٻ",ﯧ:"ٻ",ﯥ:"ٻ",ﯤ:"ٻ",ﭜ:"ڀ",ﭝ:"ڀ",ﭛ:"ڀ",ﭚ:"ڀ","ࢩ":"ݔ","ݧ":"ݔ","⍥":"ة",ö:"ة",ﺔ:"ة",ﺓ:"ة",ۃ:"ة","𞸕":"ت","𞸵":"ت","𞹵":"ت","𞺕":"ت","𞺵":"ت",ﺗ:"ت",ﺘ:"ت",ﺖ:"ت",ﺕ:"ت",ﲥ:"تo",ﳤ:"تo",ﲡ:"تج",ﰋ:"تج",ﵐ:"تجم",ﶠ:"تجى",ﶟ:"تجى",ﲢ:"تح",ﰌ:"تح",ﵒ:"تحج",ﵑ:"تحج",ﵓ:"تحم",ﲣ:"تخ",ﰍ:"تخ",ﵔ:"تخم",ﶢ:"تخى",ﶡ:"تخى",ﱰ:"تر",ﱱ:"تز",ﲤ:"تم",ﳣ:"تم",ﱲ:"تم",ﰎ:"تم",ﵕ:"تمج",ﵖ:"تمح",ﵗ:"تمخ",ﶤ:"تمى",ﶣ:"تمى",ﱳ:"تن",ﱴ:"تى",ﰏ:"تى",ﱵ:"تى",ﰐ:"تى",ﭠ:"ٺ",ﭡ:"ٺ",ﭟ:"ٺ",ﭞ:"ٺ",ﭤ:"ٿ",ﭥ:"ٿ",ﭣ:"ٿ",ﭢ:"ٿ","𞸂":"ج","𞸢":"ج","𞹂":"ج","𞹢":"ج","𞺂":"ج","𞺢":"ج",ﺟ:"ج",ﺠ:"ج",ﺞ:"ج",ﺝ:"ج",ﲧ:"جح",ﰕ:"جح",ﶦ:"جحى",ﶾ:"جحى",ﷻ:"جل جلlلo",ﲨ:"جم",ﰖ:"جم",ﵙ:"جمح",ﵘ:"جمح",ﶧ:"جمى",ﶥ:"جمى",ﴝ:"جى",ﴁ:"جى",ﴞ:"جى",ﴂ:"جى",ﭸ:"ڃ",ﭹ:"ڃ",ﭷ:"ڃ",ﭶ:"ڃ",ﭴ:"ڄ",ﭵ:"ڄ",ﭳ:"ڄ",ﭲ:"ڄ",ﭼ:"چ",ﭽ:"چ",ﭻ:"چ",ﭺ:"چ",ﮀ:"ڇ",ﮁ:"ڇ",ﭿ:"ڇ",ﭾ:"ڇ","𞸇":"ح","𞸧":"ح","𞹇":"ح","𞹧":"ح","𞺇":"ح","𞺧":"ح",ﺣ:"ح",ﺤ:"ح",ﺢ:"ح",ﺡ:"ح",څ:"حۛ",ځ:"حٔ","ݲ":"حٔ",ﲩ:"حج",ﰗ:"حج",ﶿ:"حجى",ﲪ:"حم",ﰘ:"حم",ﵛ:"حمى",ﵚ:"حمى",ﴛ:"حى",ﳿ:"حى",ﴜ:"حى",ﴀ:"حى","𞸗":"خ","𞸷":"خ","𞹗":"خ","𞹷":"خ","𞺗":"خ","𞺷":"خ",ﺧ:"خ",ﺨ:"خ",ﺦ:"خ",ﺥ:"خ",ﲫ:"خج",ﰙ:"خج",ﰚ:"خح",ﲬ:"خم",ﰛ:"خم",ﴟ:"خى",ﴃ:"خى",ﴠ:"خى",ﴄ:"خى","𐋡":"د","𞸃":"د","𞺃":"د","𞺣":"د",ﺪ:"د",ﺩ:"د",ڈ:"دؕ",ﮉ:"دؕ",ﮈ:"دؕ",ڎ:"دۛ",ﮇ:"دۛ",ﮆ:"دۛ","ۮ":"د̂","ࢮ":"د̤̣","𞸘":"ذ","𞺘":"ذ","𞺸":"ذ",ﺬ:"ذ",ﺫ:"ذ",ﱛ:"ذٰ",ڋ:"ڊؕ",ﮅ:"ڌ",ﮄ:"ڌ",ﮃ:"ڍ",ﮂ:"ڍ","𞸓":"ر","𞺓":"ر","𞺳":"ر",ﺮ:"ر",ﺭ:"ر",ڑ:"رؕ",ﮍ:"رؕ",ﮌ:"رؕ",ژ:"رۛ",ﮋ:"رۛ",ﮊ:"رۛ",ڒ:"ر̆","ࢹ":"ر̆̇","ۯ":"ر̂","ݬ":"رٔ",ﱜ:"رٰ",ﷶ:"رسول","﷼":"رىlل","𞸆":"ز","𞺆":"ز","𞺦":"ز",ﺰ:"ز",ﺯ:"ز","ࢲ":"ز̂","ݱ":"ڗؕ","𞸎":"س","𞸮":"س","𞹎":"س","𞹮":"س","𞺎":"س","𞺮":"س",ﺳ:"س",ﺴ:"س",ﺲ:"س",ﺱ:"س",ش:"سۛ","𞸔":"سۛ","𞸴":"سۛ","𞹔":"سۛ","𞹴":"سۛ","𞺔":"سۛ","𞺴":"سۛ",ﺷ:"سۛ",ﺸ:"سۛ",ﺶ:"سۛ",ﺵ:"سۛ","ݾ":"س̂",ﴱ:"سo",ﳨ:"سo",ﴲ:"سۛo",ﳪ:"سۛo",ﲭ:"سج",ﴴ:"سج",ﰜ:"سج",ﴭ:"سۛج",ﴷ:"سۛج",ﴥ:"سۛج",ﴉ:"سۛج",ﵝ:"سجح",ﵞ:"سجى",ﵩ:"سۛجى",ﲮ:"سح",ﴵ:"سح",ﰝ:"سح",ﴮ:"سۛح",ﴸ:"سۛح",ﴦ:"سۛح",ﴊ:"سۛح",ﵜ:"سحج",ﵨ:"سۛحم",ﵧ:"سۛحم",ﶪ:"سۛحى",ﲯ:"سخ",ﴶ:"سخ",ﰞ:"سخ",ﴯ:"سۛخ",ﴹ:"سۛخ",ﴧ:"سۛخ",ﴋ:"سۛخ",ﶨ:"سخى",ﷆ:"سخى",ﴪ:"سر",ﴎ:"سر",ﴩ:"سۛر",ﴍ:"سۛر",ﲰ:"سم",ﳧ:"سم",ﰟ:"سم",ﴰ:"سۛم",ﳩ:"سۛم",ﴨ:"سۛم",ﴌ:"سۛم",ﵡ:"سمج",ﵠ:"سمح",ﵟ:"سمح",ﵫ:"سۛمخ",ﵪ:"سۛمخ",ﵣ:"سمم",ﵢ:"سمم",ﵭ:"سۛمم",ﵬ:"سۛمم",ﴗ:"سى",ﳻ:"سى",ﴘ:"سى",ﳼ:"سى",ﴙ:"سۛى",ﳽ:"سۛى",ﴚ:"سۛى",ﳾ:"سۛى","𐋲":"ص","𞸑":"ص","𞸱":"ص","𞹑":"ص","𞹱":"ص","𞺑":"ص","𞺱":"ص",ﺻ:"ص",ﺼ:"ص",ﺺ:"ص",ﺹ:"ص",ڞ:"صۛ","ࢯ":"ص̤̣",ﲱ:"صح",ﰠ:"صح",ﵥ:"صحح",ﵤ:"صحح",ﶩ:"صحى",ﲲ:"صخ",ﴫ:"صر",ﴏ:"صر",ﷵ:"صلعم",ﷹ:"صلى",ﷰ:"صلى",ﷺ:"صلى lللo علىo وسلم",ﲳ:"صم",ﰡ:"صم",ﷅ:"صمم",ﵦ:"صمم",ﴡ:"صى",ﴅ:"صى",ﴢ:"صى",ﴆ:"صى","𞸙":"ض","𞸹":"ض","𞹙":"ض","𞹹":"ض","𞺙":"ض","𞺹":"ض",ﺿ:"ض",ﻀ:"ض",ﺾ:"ض",ﺽ:"ض",ﲴ:"ضج",ﰢ:"ضج",ﲵ:"ضح",ﰣ:"ضح",ﵮ:"ضحى",ﶫ:"ضحى",ﲶ:"ضخ",ﰤ:"ضخ",ﵰ:"ضخم",ﵯ:"ضخم",ﴬ:"ضر",ﴐ:"ضر",ﲷ:"ضم",ﰥ:"ضم",ﴣ:"ضى",ﴇ:"ضى",ﴤ:"ضى",ﴈ:"ضى","𐋨":"ط","𞸈":"ط","𞹨":"ط","𞺈":"ط","𞺨":"ط",ﻃ:"ط",ﻄ:"ط",ﻂ:"ط",ﻁ:"ط",ڟ:"طۛ",ﲸ:"طح",ﰦ:"طح",ﴳ:"طم",ﴺ:"طم",ﰧ:"طم",ﵲ:"طمح",ﵱ:"طمح",ﵳ:"طمم",ﵴ:"طمى",ﴑ:"طى",ﳵ:"طى",ﴒ:"طى",ﳶ:"طى","𞸚":"ظ","𞹺":"ظ","𞺚":"ظ","𞺺":"ظ",ﻇ:"ظ",ﻈ:"ظ",ﻆ:"ظ",ﻅ:"ظ",ﲹ:"ظم",ﴻ:"ظم",ﰨ:"ظم","؏":"ع","𞸏":"ع","𞸯":"ع","𞹏":"ع","𞹯":"ع","𞺏":"ع","𞺯":"ع",ﻋ:"ع",ﻌ:"ع",ﻊ:"ع",ﻉ:"ع",ﲺ:"عج",ﰩ:"عج",ﷄ:"عجم",ﵵ:"عجم",ﷷ:"علىo",ﲻ:"عم",ﰪ:"عم",ﵷ:"عمم",ﵶ:"عمم",ﵸ:"عمى",ﶶ:"عمى",ﴓ:"عى",ﳷ:"عى",ﴔ:"عى",ﳸ:"عى","𞸛":"غ","𞸻":"غ","𞹛":"غ","𞹻":"غ","𞺛":"غ","𞺻":"غ",ﻏ:"غ",ﻐ:"غ",ﻎ:"غ",ﻍ:"غ",ﲼ:"غج",ﰫ:"غج",ﲽ:"غم",ﰬ:"غم",ﵹ:"غمم",ﵻ:"غمى",ﵺ:"غمى",ﴕ:"غى",ﳹ:"غى",ﴖ:"غى",ﳺ:"غى","𞸐":"ف","𞸰":"ف","𞹰":"ف","𞺐":"ف","𞺰":"ف",ﻓ:"ف",ﻔ:"ف",ﻒ:"ف",ﻑ:"ف",ڧ:"ف",ﲾ:"فج",ﰭ:"فج",ﲿ:"فح",ﰮ:"فح",ﳀ:"فخ",ﰯ:"فخ",ﵽ:"فخم",ﵼ:"فخم",ﳁ:"فم",ﰰ:"فم",ﷁ:"فمى",ﱼ:"فى",ﰱ:"فى",ﱽ:"فى",ﰲ:"فى","𞸞":"ڡ","𞹾":"ڡ","ࢻ":"ڡ","ٯ":"ڡ","𞸟":"ڡ","𞹟":"ڡ","ࢼ":"ڡ",ڤ:"ڡۛ",ﭬ:"ڡۛ",ﭭ:"ڡۛ",ﭫ:"ڡۛ",ﭪ:"ڡۛ",ڨ:"ڡۛ","ࢤ":"ڢۛ",ﭰ:"ڦ",ﭱ:"ڦ",ﭯ:"ڦ",ﭮ:"ڦ","𞸒":"ق","𞸲":"ق","𞹒":"ق","𞹲":"ق","𞺒":"ق","𞺲":"ق",ﻗ:"ق",ﻘ:"ق",ﻖ:"ق",ﻕ:"ق",ﳂ:"قح",ﰳ:"قح",ﷱ:"قلى",ﳃ:"قم",ﰴ:"قم",ﶴ:"قمح",ﵾ:"قمح",ﵿ:"قمم",ﶲ:"قمى",ﱾ:"قى",ﰵ:"قى",ﱿ:"قى",ﰶ:"قى","𞸊":"ك","𞸪":"ك","𞹪":"ك",ﻛ:"ك",ﻜ:"ك",ﻚ:"ك",ﻙ:"ك",ک:"ك",ﮐ:"ك",ﮑ:"ك",ﮏ:"ك",ﮎ:"ك",ڪ:"ك",ڭ:"كۛ",ﯕ:"كۛ",ﯖ:"كۛ",ﯔ:"كۛ",ﯓ:"كۛ","ݣ":"كۛ",ﲀ:"كl",ﰷ:"كl",ﳄ:"كج",ﰸ:"كج",ﳅ:"كح",ﰹ:"كح",ﳆ:"كخ",ﰺ:"كخ",ﳇ:"كل",ﳫ:"كل",ﲁ:"كل",ﰻ:"كل",ﳈ:"كم",ﳬ:"كم",ﲂ:"كم",ﰼ:"كم",ﷃ:"كمم",ﶻ:"كمم",ﶷ:"كمى",ﲃ:"كى",ﰽ:"كى",ﲄ:"كى",ﰾ:"كى","ݢ":"ڬ",ﮔ:"گ",ﮕ:"گ",ﮓ:"گ",ﮒ:"گ","ࢰ":"گ",ڴ:"گۛ",ﮜ:"ڱ",ﮝ:"ڱ",ﮛ:"ڱ",ﮚ:"ڱ",ﮘ:"ڳ",ﮙ:"ڳ",ﮗ:"ڳ",ﮖ:"ڳ","𞸋":"ل","𞸫":"ل","𞹋":"ل","𞺋":"ل","𞺫":"ل",ﻟ:"ل",ﻠ:"ل",ﻞ:"ل",ﻝ:"ل",ڷ:"لۛ",ڵ:"ل̆",ﻼ:"لl",ﻻ:"لl",ﻺ:"لlٕ",ﻹ:"لlٕ",ﻸ:"لlٴ",ﻷ:"لlٴ",ﳍ:"لo",ﻶ:"لآ",ﻵ:"لآ",ﳉ:"لج",ﰿ:"لج",ﶃ:"لجج",ﶄ:"لجج",ﶺ:"لجم",ﶼ:"لجم",ﶬ:"لجى",ﳊ:"لح",ﱀ:"لح",ﶵ:"لحم",ﶀ:"لحم",ﶂ:"لحى",ﶁ:"لحى",ﳋ:"لخ",ﱁ:"لخ",ﶆ:"لخم",ﶅ:"لخم",ﳌ:"لم",ﳭ:"لم",ﲅ:"لم",ﱂ:"لم",ﶈ:"لمح",ﶇ:"لمح",ﶭ:"لمى",ﲆ:"لى",ﱃ:"لى",ﲇ:"لى",ﱄ:"لى","𞸌":"م","𞸬":"م","𞹬":"م","𞺌":"م","𞺬":"م",ﻣ:"م",ﻤ:"م",ﻢ:"م",ﻡ:"م","ࢧ":"مۛ","۾":"م͈",ﲈ:"مl",ﳎ:"مج",ﱅ:"مج",ﶌ:"مجح",ﶒ:"مجخ",ﶍ:"مجم",ﷀ:"مجى",ﳏ:"مح",ﱆ:"مح",ﶉ:"محج",ﶊ:"محم",ﷴ:"محمد",ﶋ:"محى",ﳐ:"مخ",ﱇ:"مخ",ﶎ:"مخج",ﶏ:"مخم",ﶹ:"مخى",ﳑ:"مم",ﲉ:"مم",ﱈ:"مم",ﶱ:"ممى",ﱉ:"مى",ﱊ:"مى","𞸍":"ن","𞸭":"ن","𞹍":"ن","𞹭":"ن","𞺍":"ن","𞺭":"ن",ﻧ:"ن",ﻨ:"ن",ﻦ:"ن",ﻥ:"ن","ݨ":"نؕ","ݩ":"ن̆",ﳖ:"نo",ﳯ:"نo",ﶸ:"نجح",ﶽ:"نجح",ﶘ:"نجم",ﶗ:"نجم",ﶙ:"نجى",ﷇ:"نجى",ﳓ:"نح",ﱌ:"نح",ﶕ:"نحم",ﶖ:"نحى",ﶳ:"نحى",ﳔ:"نخ",ﱍ:"نخ",ﲊ:"نر",ﲋ:"نز",ﳕ:"نم",ﳮ:"نم",ﲌ:"نم",ﱎ:"نم",ﶛ:"نمى",ﶚ:"نمى",ﲍ:"نن",ﲎ:"نى",ﱏ:"نى",ﲏ:"نى",ﱐ:"نى",ۂ:"ۀ",ﮥ:"ۀ",ﮤ:"ۀ","𐋤":"و","𞸅":"و","𞺅":"و","𞺥":"و",ﻮ:"و",ﻭ:"و","ࢱ":"و",ۋ:"وۛ",ﯟ:"وۛ",ﯞ:"وۛ",ۇ:"و̓",ﯘ:"و̓",ﯗ:"و̓",ۆ:"و̆",ﯚ:"و̆",ﯙ:"و̆",ۉ:"و̂",ﯣ:"و̂",ﯢ:"و̂",ۈ:"وٰ",ﯜ:"وٰ",ﯛ:"وٰ",ؤ:"وٴ",ﺆ:"وٴ",ﺅ:"وٴ",ٶ:"وٴ",ٷ:"و̓ٴ",ﯝ:"و̓ٴ",ﷸ:"وسلم",ﯡ:"ۅ",ﯠ:"ۅ","ٮ":"ى","𞸜":"ى","𞹼":"ى",ں:"ى","𞸝":"ى","𞹝":"ى",ﮟ:"ى",ﮞ:"ى","ࢽ":"ى",ﯨ:"ى",ﯩ:"ى",ﻰ:"ى",ﻯ:"ى",ي:"ى","𞸉":"ى","𞸩":"ى","𞹉":"ى","𞹩":"ى","𞺉":"ى","𞺩":"ى",ﻳ:"ى",ﻴ:"ى",ﻲ:"ى",ﻱ:"ى",ی:"ى",ﯾ:"ى",ﯿ:"ى",ﯽ:"ى",ﯼ:"ى",ے:"ى",ﮯ:"ى",ﮮ:"ى",ٹ:"ىؕ",ﭨ:"ىؕ",ﭩ:"ىؕ",ﭧ:"ىؕ",ﭦ:"ىؕ",ڻ:"ىؕ",ﮢ:"ىؕ",ﮣ:"ىؕ",ﮡ:"ىؕ",ﮠ:"ىؕ",پ:"ىۛ",ﭘ:"ىۛ",ﭙ:"ىۛ",ﭗ:"ىۛ",ﭖ:"ىۛ",ث:"ىۛ","𞸖":"ىۛ","𞸶":"ىۛ","𞹶":"ىۛ","𞺖":"ىۛ","𞺶":"ىۛ",ﺛ:"ىۛ",ﺜ:"ىۛ",ﺚ:"ىۛ",ﺙ:"ىۛ",ڽ:"ىۛ",ۑ:"ىۛ","ؿ":"ىۛ","ࢷ":"ىۛۢ","ݖ":"ى̆",ێ:"ى̆","ࢺ":"ى̆̇","ؽ":"ى̂","ࢨ":"ىٔ",ﲐ:"ىٰ",ﱝ:"ىٰ",ﳞ:"ىo",ﳱ:"ىo",ﳦ:"ىۛo",ئ:"ىٴ",ﺋ:"ىٴ",ﺌ:"ىٴ",ﺊ:"ىٴ",ﺉ:"ىٴ",ٸ:"ىٴ",ﯫ:"ىٴl",ﯪ:"ىٴl",ﲛ:"ىٴo",ﳠ:"ىٴo",ﯭ:"ىٴo",ﯬ:"ىٴo",ﯸ:"ىٴٻ",ﯷ:"ىٴٻ",ﯶ:"ىٴٻ",ﲗ:"ىٴج",ﰀ:"ىٴج",ﲘ:"ىٴح",ﰁ:"ىٴح",ﲙ:"ىٴخ",ﱤ:"ىٴر",ﱥ:"ىٴز",ﲚ:"ىٴم",ﳟ:"ىٴم",ﱦ:"ىٴم",ﰂ:"ىٴم",ﱧ:"ىٴن",ﯯ:"ىٴو",ﯮ:"ىٴو",ﯱ:"ىٴو̓",ﯰ:"ىٴو̓",ﯳ:"ىٴو̆",ﯲ:"ىٴو̆",ﯵ:"ىٴوٰ",ﯴ:"ىٴوٰ",ﯻ:"ىٴى",ﯺ:"ىٴى",ﱨ:"ىٴى",ﯹ:"ىٴى",ﰃ:"ىٴى",ﱩ:"ىٴى",ﰄ:"ىٴى",ﳚ:"ىج",ﱕ:"ىج",ﰑ:"ىۛج",ﶯ:"ىجى",ﳛ:"ىح",ﱖ:"ىح",ﶮ:"ىحى",ﳜ:"ىخ",ﱗ:"ىخ",ﲑ:"ىر",ﱶ:"ىۛر",ﲒ:"ىز",ﱷ:"ىۛز",ﳝ:"ىم",ﳰ:"ىم",ﲓ:"ىم",ﱘ:"ىم",ﲦ:"ىۛم",ﳥ:"ىۛم",ﱸ:"ىۛم",ﰒ:"ىۛم",ﶝ:"ىمم",ﶜ:"ىمم",ﶰ:"ىمى",ﲔ:"ىن",ﱹ:"ىۛن",ﲕ:"ىى",ﱙ:"ىى",ﲖ:"ىى",ﱚ:"ىى",ﱺ:"ىۛى",ﰓ:"ىۛى",ﱻ:"ىۛى",ﰔ:"ىۛى",ﮱ:"ۓ",ﮰ:"ۓ","𐊸":"ⵀ","⁞":"ⵂ","⸽":"ⵂ","⦙":"ⵂ","︙":"ⵗ","⁝":"ⵗ","⋮":"ⵗ",Մ:"ሆ",Ռ:"ቡ",Ի:"ኮ",Պ:"ጣ",आ:"अा",ऒ:"अाॆ",ओ:"अाे",औ:"अाै","ऄ":"अॆ",ऑ:"अॉ",ऍ:"एॅ",ऎ:"एॆ",ऐ:"एे",ई:"र्इ",ઽ:"ऽ","𑇜":"ꣻ","𑇋":"ऺ","ુ":"ु","ૂ":"ू","ੋ":"ॆ","੍":"्","્":"्",আ:"অা",ৠ:"ঋৃ",ৡ:"ঋৃ","𑒒":"ঘ","𑒔":"চ","𑒖":"জ","𑒘":"ঞ","𑒙":"ট","𑒛":"ড","𑒪":"ণ","𑒞":"ত","𑒟":"থ","𑒠":"দ","𑒡":"ধ","𑒢":"ন","𑒣":"প","𑒩":"ব","𑒧":"ম","𑒨":"য","𑒫":"র","𑒝":"ল","𑒭":"ষ","𑒮":"স","𑓄":"ঽ","𑒰":"া","𑒱":"ি","𑒹":"ে","𑒼":"ো","𑒾":"ৌ","𑓂":"্","𑒽":"ৗ",ਉ:"ੳੁ",ਊ:"ੳੂ",ਆ:"ਅਾ",ਐ:"ਅੈ",ਔ:"ਅੌ",ਇ:"ੲਿ",ਈ:"ੲੀ",ਏ:"ੲੇ",આ:"અા",ઑ:"અાૅ",ઓ:"અાે",ઔ:"અાૈ",ઍ:"અૅ",એ:"અે",ઐ:"અૈ",ଆ:"ଅା","௮":"அ",ர:"ஈ","ா":"ஈ","௫":"ஈு","௨":"உ",ഉ:"உ",ஊ:"உள",ഊ:"உൗ","௭":"எ","௷":"எவ",ஜ:"ஐ",ജ:"ஐ","௧":"க","௪":"ச","௬":"சு","௲":"சூ","ഺ":"டி",ണ:"ண","௺":"நீ","௴":"மீ","௰":"ய",ഴ:"ழ","ௗ":"ள","ை":"ன",ശ:"ஶ","௸":"ஷ","ി":"ி","ീ":"ி","ொ":"ெஈ","ௌ":"ெள","ோ":"ேஈ",ಅ:"అ",ಆ:"ఆ",ಇ:"ఇ",ౠ:"ఋా",ౡ:"ఌా",ಒ:"ఒ",ఔ:"ఒౌ",ಔ:"ఒౌ",ఓ:"ఒౕ",ಓ:"ఒౕ",ಜ:"జ",ಞ:"ఞ",ఢ:"డ̣",ಣ:"ణ",థ:"ధּ",భ:"బ̣",ಯ:"య",ఠ:"రּ",ಱ:"ఱ",ಲ:"ల",ష:"వ̣",హ:"వా",మ:"వు","ూ":"ుా","ౄ":"ృా",ೡ:"ಌಾ",ഈ:"ഇൗ",ഐ:"എെ",ഓ:"ഒാ",ഔ:"ഒൗ",ൡ:"ഞ","൫":"ദ്ര","൹":"നു",ഌ:"നു",ങ:"നു","൯":"ന്","ൻ":"ന്","൬":"ന്ന","൚":"ന്മ",റ:"ര","൪":"ര്","ർ":"ര്","൮":"വ്ര","൶":"ഹ്മ","ൂ":"ു","ൃ":"ു","ൈ":"െെ","෪":"ජ","෫":"ද","𑐓":"𑐴𑑂𑐒","𑐙":"𑐴𑑂𑐘","𑐤":"𑐴𑑂𑐣","𑐪":"𑐴𑑂𑐩","𑐭":"𑐴𑑂𑐬","𑐯":"𑐴𑑂𑐮","𑗘":"𑖂","𑗙":"𑖂","𑗚":"𑖃","𑗛":"𑖄","𑗜":"𑖲","𑗝":"𑖳",ฃ:"ข",ด:"ค",ต:"ค",ม:"ฆ",ຈ:"จ",ซ:"ช",ฏ:"ฎ",ท:"ฑ",ບ:"บ",ປ:"ป",ຝ:"ฝ",ພ:"พ",ຟ:"ฟ",ฦ:"ภ",ຍ:"ย","។":"ฯ",ๅ:"า",ำ:"̊า","ិ":"ิ","ី":"ี","ឹ":"ึ","ឺ":"ื","ຸ":"ุ","ູ":"ู",แ:"เเ",ໜ:"ຫນ",ໝ:"ຫມ",ຳ:"̊າ","༂":"འུྂཿ","༃":"འུྂ༔",ཪ:"ར",ༀ:"ཨོཾ","ཷ":"ྲཱྀ","ཹ":"ླཱྀ","𑲲":"𑲪","ႁ":"ဂှ",က:"ဂာ","ၰ":"ဃှ","ၦ":"ပှ",ဟ:"ပာ","ၯ":"ပာှ","ၾ":"ၽှ",ဩ:"သြ",ဪ:"သြော်","႞":"ႃ̊",ឣ:"អ","᧐":"ᦞ","᧑":"ᦱ","᪀":"ᩅ","᪐":"ᩅ","꩓":"ꨁ","꩖":"ꨣ","᭒":"ᬍ","᭓":"ᬑ","᭘":"ᬨ","ꦣ":"ꦝ",ᢖ:"ᡜ",ᡕ:"ᠵ",ῶ:"Ꮿ",ᐍ:"ᐁ·",ᐫ:"ᐁᐠ",ᐑ:"ᐄ·",ᐓ:"ᐅ·",ᐭ:"ᐅᐠ",ᐕ:"ᐆ·",ᐘ:"ᐊ·",ᐮ:"ᐊᐠ",ᐚ:"ᐋ·","ᣝ":"ᐞᣟ",ᓑ:"ᐡ",ᕀ:"ᐩ",ᐿ:"ᐲ·",ᑃ:"ᐴ·","⍩":"ᐵ",ᑇ:"ᐹ·",ᑜ:"ᑏ·","⸧":"ᑐ","⊃":"ᑐ",ᑞ:"ᑐ·",ᑩ:"ᑐ'","⟉":"ᑐ/","⫗":"ᑐᑕ",ᑠ:"ᑑ·","⸦":"ᑕ","⊂":"ᑕ",ᑢ:"ᑕ·",ᑪ:"ᑕ'",ᑤ:"ᑖ·",ᑵ:"ᑫ·",ᒅ:"ᑫ'",ᑹ:"ᑮ·",ᑽ:"ᑰ·",ᘃ:"ᒉ",ᒓ:"ᒉ·",ᒕ:"ᒋ·",ᒗ:"ᒌ·",ᒛ:"ᒎ·",ᘂ:"ᒐ",ᒝ:"ᒐ·",ᒟ:"ᒑ·",ᒭ:"ᒣ·",ᒱ:"ᒦ·",ᒳ:"ᒧ·",ᒵ:"ᒨ·",ᒹ:"ᒫ·",ᓊ:"ᓀ·","ᣇ":"ᓂ·","ᣉ":"ᓃ·","ᣋ":"ᓄ·","ᣍ":"ᓅ·",ᓌ:"ᓇ·",ᓎ:"ᓈ·",ᘄ:"ᓓ",ᓝ:"ᓓ·",ᓟ:"ᓕ·",ᓡ:"ᓖ·",ᓣ:"ᓗ·",ᓥ:"ᓘ·",ᘇ:"ᓚ",ᓧ:"ᓚ·",ᓩ:"ᓛ·",ᓷ:"ᓭ·",ᓹ:"ᓯ·",ᓻ:"ᓰ·",ᓽ:"ᓱ·",ᓿ:"ᓲ·",ᔁ:"ᓴ·",ᔃ:"ᓵ·",ᔌ:"ᔋ<",ᔎ:"ᔋb",ᔍ:"ᔋᑕ",ᔏ:"ᔋᒐ",ᔘ:"ᔐ·",ᔚ:"ᔑ·",ᔜ:"ᔒ·",ᔞ:"ᔓ·",ᔠ:"ᔔ·",ᔢ:"ᔕ·",ᔤ:"ᔖ·",ᔲ:"ᔨ·",ᔴ:"ᔩ·",ᔶ:"ᔪ·",ᔸ:"ᔫ·",ᔺ:"ᔭ·",ᔼ:"ᔮ·",ᘢ:"ᕃ","ᣠ":"ᕃ·",ᘣ:"ᕆ",ᘤ:"ᕊ",ᕏ:"ᕌ·",ᖃ:"ᕐb",ᖄ:"ᕐḃ",ᖁ:"ᕐd",ᕿ:"ᕐP",ᙯ:"ᕐᑫ",ᕾ:"ᕐᑬ",ᖀ:"ᕐᑮ",ᖂ:"ᕐᑰ",ᖅ:"ᕐᒃ",ᕜ:"ᕚ·","ᣣ":"ᕞ·","ᣤ":"ᕦ·",ᕩ:"ᕧ·","ᣥ":"ᕫ·","ᣨ":"ᖆ·",ᖑ:"ᖕJ",ᙰ:"ᖕᒉ",ᖎ:"ᖕᒊ",ᖏ:"ᖕᒋ",ᖐ:"ᖕᒌ",ᖒ:"ᖕᒎ",ᖓ:"ᖕᒐ",ᖔ:"ᖕᒑ",ᙳ:"ᖖJ",ᙱ:"ᖖᒋ",ᙲ:"ᖖᒌ",ᙴ:"ᖖᒎ",ᙵ:"ᖖᒐ",ᙶ:"ᖖᒑ","ᣪ":"ᖗ·","ᙷ":"ᖧ·","ᙸ":"ᖨ·","ᙹ":"ᖩ·","ᙺ":"ᖪ·","ᙻ":"ᖫ·","ᙼ":"ᖬ·","ᙽ":"ᖭ·","⪫":"ᗒ","⪪":"ᗕ","ꓷ":"ᗡ","ᣰ":"ᗴ·","ᣲ":"ᘛ·","ᶻ":"ᙆ","ꓭ":"ᙠ","ᶺ":"ᣔ","ᴾ":"ᣖ","ᣜ":"ᣟᐞ",ˡ:"ᣳ",ʳ:"ᣴ",ˢ:"ᣵ","ᣛ":"ᣵ","ꚰ":"ᚹ",ᛡ:"ᚼ","⍿":"ᚽ",ᛂ:"ᚽ","𝈿":"ᛋ","↑":"ᛏ","↿":"ᛐ","⥮":"ᛐ⇂","⥣":"ᛐᛚ","ⵣ":"ᛯ","↾":"ᛚ","⨡":"ᛚ","⋄":"ᛜ","◇":"ᛜ","◊":"ᛜ","♢":"ᛜ","🝔":"ᛜ","𑢷":"ᛜ","𐊔":"ᛜ","⍚":"ᛜ̲","⋈":"ᛞ","⨝":"ᛞ","𐓐":"ᛦ","↕":"ᛨ","𐳼":"𐲂","𐳺":"𐲥",ㄱ:"ᄀ",ᆨ:"ᄀ",ᄁ:"ᄀᄀ",ㄲ:"ᄀᄀ",ᆩ:"ᄀᄀ","ᇺ":"ᄀᄂ","ᅚ":"ᄀᄃ",ᇃ:"ᄀᄅ","ᇻ":"ᄀᄇ",ᆪ:"ᄀᄉ",ㄳ:"ᄀᄉ",ᇄ:"ᄀᄉᄀ","ᇼ":"ᄀᄎ","ᇽ":"ᄀᄏ","ᇾ":"ᄀᄒ",ㄴ:"ᄂ",ᆫ:"ᄂ",ᄓ:"ᄂᄀ",ᇅ:"ᄂᄀ",ᄔ:"ᄂᄂ",ㅥ:"ᄂᄂ","ᇿ":"ᄂᄂ",ᄕ:"ᄂᄃ",ㅦ:"ᄂᄃ",ᇆ:"ᄂᄃ","ퟋ":"ᄂᄅ",ᄖ:"ᄂᄇ","ᅛ":"ᄂᄉ",ᇇ:"ᄂᄉ",ㅧ:"ᄂᄉ","ᅜ":"ᄂᄌ",ᆬ:"ᄂᄌ",ㄵ:"ᄂᄌ","ퟌ":"ᄂᄎ",ᇉ:"ᄂᄐ","ᅝ":"ᄂᄒ",ᆭ:"ᄂᄒ",ㄶ:"ᄂᄒ",ᇈ:"ᄂᅀ",ㅨ:"ᄂᅀ",ㄷ:"ᄃ",ᆮ:"ᄃ",ᄗ:"ᄃᄀ",ᇊ:"ᄃᄀ",ᄄ:"ᄃᄃ",ㄸ:"ᄃᄃ","ퟍ":"ᄃᄃ","ퟎ":"ᄃᄃᄇ","ᅞ":"ᄃᄅ",ᇋ:"ᄃᄅ","ꥠ":"ᄃᄆ","ꥡ":"ᄃᄇ","ퟏ":"ᄃᄇ","ꥢ":"ᄃᄉ","ퟐ":"ᄃᄉ","ퟑ":"ᄃᄉᄀ","ꥣ":"ᄃᄌ","ퟒ":"ᄃᄌ","ퟓ":"ᄃᄎ","ퟔ":"ᄃᄐ",ㄹ:"ᄅ",ᆯ:"ᄅ","ꥤ":"ᄅᄀ",ᆰ:"ᄅᄀ",ㄺ:"ᄅᄀ","ꥥ":"ᄅᄀᄀ","ퟕ":"ᄅᄀᄀ",ᇌ:"ᄅᄀᄉ",ㅩ:"ᄅᄀᄉ","ퟖ":"ᄅᄀᄒ",ᄘ:"ᄅᄂ",ᇍ:"ᄅᄂ","ꥦ":"ᄅᄃ",ᇎ:"ᄅᄃ",ㅪ:"ᄅᄃ","ꥧ":"ᄅᄃᄃ",ᇏ:"ᄅᄃᄒ",ᄙ:"ᄅᄅ",ᇐ:"ᄅᄅ","ퟗ":"ᄅᄅᄏ","ꥨ":"ᄅᄆ",ᆱ:"ᄅᄆ",ㄻ:"ᄅᄆ",ᇑ:"ᄅᄆᄀ",ᇒ:"ᄅᄆᄉ","ퟘ":"ᄅᄆᄒ","ꥩ":"ᄅᄇ",ᆲ:"ᄅᄇ",ㄼ:"ᄅᄇ","ퟙ":"ᄅᄇᄃ","ꥪ":"ᄅᄇᄇ",ᇓ:"ᄅᄇᄉ",ㅫ:"ᄅᄇᄉ","ꥫ":"ᄅᄇᄋ",ᇕ:"ᄅᄇᄋ","ퟚ":"ᄅᄇᄑ",ᇔ:"ᄅᄇᄒ","ꥬ":"ᄅᄉ",ᆳ:"ᄅᄉ",ㄽ:"ᄅᄉ",ᇖ:"ᄅᄉᄉ",ᄛ:"ᄅᄋ","ퟝ":"ᄅᄋ","ꥭ":"ᄅᄌ","ꥮ":"ᄅᄏ",ᇘ:"ᄅᄏ",ᆴ:"ᄅᄐ",ㄾ:"ᄅᄐ",ᆵ:"ᄅᄑ",ㄿ:"ᄅᄑ",ᄚ:"ᄅᄒ",ㅀ:"ᄅᄒ",ᄻ:"ᄅᄒ",ᆶ:"ᄅᄒ","ퟲ":"ᄅᄒ",ᇗ:"ᄅᅀ",ㅬ:"ᄅᅀ","ퟛ":"ᄅᅌ",ᇙ:"ᄅᅙ",ㅭ:"ᄅᅙ","ퟜ":"ᄅᅙᄒ",ㅁ:"ᄆ",ᆷ:"ᄆ","ꥯ":"ᄆᄀ",ᇚ:"ᄆᄀ","ퟞ":"ᄆᄂ","ퟟ":"ᄆᄂᄂ","ꥰ":"ᄆᄃ",ᇛ:"ᄆᄅ","ퟠ":"ᄆᄆ",ᄜ:"ᄆᄇ",ㅮ:"ᄆᄇ",ᇜ:"ᄆᄇ","ퟡ":"ᄆᄇᄉ","ꥱ":"ᄆᄉ",ᇝ:"ᄆᄉ",ㅯ:"ᄆᄉ",ᇞ:"ᄆᄉᄉ",ᄝ:"ᄆᄋ",ㅱ:"ᄆᄋ",ᇢ:"ᄆᄋ","ퟢ":"ᄆᄌ",ᇠ:"ᄆᄎ",ᇡ:"ᄆᄒ",ᇟ:"ᄆᅀ",ㅰ:"ᄆᅀ",ㅂ:"ᄇ",ᆸ:"ᄇ",ᄞ:"ᄇᄀ",ㅲ:"ᄇᄀ",ᄟ:"ᄇᄂ",ᄠ:"ᄇᄃ",ㅳ:"ᄇᄃ","ퟣ":"ᄇᄃ",ᇣ:"ᄇᄅ","ퟤ":"ᄇᄅᄑ","ퟥ":"ᄇᄆ",ᄈ:"ᄇᄇ",ㅃ:"ᄇᄇ","ퟦ":"ᄇᄇ",ᄬ:"ᄇᄇᄋ",ㅹ:"ᄇᄇᄋ",ᄡ:"ᄇᄉ",ㅄ:"ᄇᄉ",ᆹ:"ᄇᄉ",ᄢ:"ᄇᄉᄀ",ㅴ:"ᄇᄉᄀ",ᄣ:"ᄇᄉᄃ",ㅵ:"ᄇᄉᄃ","ퟧ":"ᄇᄉᄃ",ᄤ:"ᄇᄉᄇ",ᄥ:"ᄇᄉᄉ",ᄦ:"ᄇᄉᄌ","ꥲ":"ᄇᄉᄐ",ᄫ:"ᄇᄋ",ㅸ:"ᄇᄋ",ᇦ:"ᄇᄋ",ᄧ:"ᄇᄌ",ㅶ:"ᄇᄌ","ퟨ":"ᄇᄌ",ᄨ:"ᄇᄎ","ퟩ":"ᄇᄎ","ꥳ":"ᄇᄏ",ᄩ:"ᄇᄐ",ㅷ:"ᄇᄐ",ᄪ:"ᄇᄑ",ᇤ:"ᄇᄑ","ꥴ":"ᄇᄒ",ᇥ:"ᄇᄒ",ㅅ:"ᄉ",ᆺ:"ᄉ",ᄭ:"ᄉᄀ",ㅺ:"ᄉᄀ",ᇧ:"ᄉᄀ",ᄮ:"ᄉᄂ",ㅻ:"ᄉᄂ",ᄯ:"ᄉᄃ",ㅼ:"ᄉᄃ",ᇨ:"ᄉᄃ",ᄰ:"ᄉᄅ",ᇩ:"ᄉᄅ",ᄱ:"ᄉᄆ","ퟪ":"ᄉᄆ",ᄲ:"ᄉᄇ",ㅽ:"ᄉᄇ",ᇪ:"ᄉᄇ",ᄳ:"ᄉᄇᄀ","ퟫ":"ᄉᄇᄋ",ᄊ:"ᄉᄉ",ㅆ:"ᄉᄉ",ᆻ:"ᄉᄉ","ퟬ":"ᄉᄉᄀ","ퟭ":"ᄉᄉᄃ","ꥵ":"ᄉᄉᄇ",ᄴ:"ᄉᄉᄉ",ᄵ:"ᄉᄋ",ᄶ:"ᄉᄌ",ㅾ:"ᄉᄌ","ퟯ":"ᄉᄌ",ᄷ:"ᄉᄎ","ퟰ":"ᄉᄎ",ᄸ:"ᄉᄏ",ᄹ:"ᄉᄐ","ퟱ":"ᄉᄐ",ᄺ:"ᄉᄑ","ퟮ":"ᄉᅀ",ㅇ:"ᄋ",ᆼ:"ᄋ",ᅁ:"ᄋᄀ",ᇬ:"ᄋᄀ",ᇭ:"ᄋᄀᄀ",ᅂ:"ᄋᄃ","ꥶ":"ᄋᄅ",ᅃ:"ᄋᄆ",ᅄ:"ᄋᄇ",ᅅ:"ᄋᄉ",ᇱ:"ᄋᄉ",ㆂ:"ᄋᄉ",ᅇ:"ᄋᄋ",ㆀ:"ᄋᄋ",ᇮ:"ᄋᄋ",ᅈ:"ᄋᄌ",ᅉ:"ᄋᄎ",ᇯ:"ᄋᄏ",ᅊ:"ᄋᄐ",ᅋ:"ᄋᄑ","ꥷ":"ᄋᄒ",ᅆ:"ᄋᅀ",ᇲ:"ᄋᅀ",ㆃ:"ᄋᅀ",ㅈ:"ᄌ",ᆽ:"ᄌ","ퟷ":"ᄌᄇ","ퟸ":"ᄌᄇᄇ",ᅍ:"ᄌᄋ",ᄍ:"ᄌᄌ",ㅉ:"ᄌᄌ","ퟹ":"ᄌᄌ","ꥸ":"ᄌᄌᄒ",ㅊ:"ᄎ",ᆾ:"ᄎ",ᅒ:"ᄎᄏ",ᅓ:"ᄎᄒ",ㅋ:"ᄏ",ᆿ:"ᄏ",ㅌ:"ᄐ",ᇀ:"ᄐ","ꥹ":"ᄐᄐ",ㅍ:"ᄑ",ᇁ:"ᄑ",ᅖ:"ᄑᄇ",ᇳ:"ᄑᄇ","ퟺ":"ᄑᄉ",ᅗ:"ᄑᄋ",ㆄ:"ᄑᄋ",ᇴ:"ᄑᄋ","ퟻ":"ᄑᄐ","ꥺ":"ᄑᄒ",ㅎ:"ᄒ",ᇂ:"ᄒ",ᇵ:"ᄒᄂ",ᇶ:"ᄒᄅ",ᇷ:"ᄒᄆ",ᇸ:"ᄒᄇ","ꥻ":"ᄒᄉ",ᅘ:"ᄒᄒ",ㆅ:"ᄒᄒ",ᄽ:"ᄼᄼ",ᄿ:"ᄾᄾ",ㅿ:"ᅀ",ᇫ:"ᅀ","ퟳ":"ᅀᄇ","ퟴ":"ᅀᄇᄋ",ㆁ:"ᅌ",ᇰ:"ᅌ","ퟵ":"ᅌᄆ","ퟶ":"ᅌᄒ",ᅏ:"ᅎᅎ",ᅑ:"ᅐᅐ",ㆆ:"ᅙ",ᇹ:"ᅙ","ꥼ":"ᅙᅙ",ㅤ:"ᅠ",ㅏ:"ᅡ","ᆣ":"ᅡー",ᅶ:"ᅡᅩ",ᅷ:"ᅡᅮ",ᅢ:"ᅡ丨",ㅐ:"ᅡ丨",ㅑ:"ᅣ",ᅸ:"ᅣᅩ",ᅹ:"ᅣᅭ","ᆤ":"ᅣᅮ",ᅤ:"ᅣ丨",ㅒ:"ᅣ丨",ㅓ:"ᅥ",ᅼ:"ᅥー",ᅺ:"ᅥᅩ",ᅻ:"ᅥᅮ",ᅦ:"ᅥ丨",ㅔ:"ᅥ丨",ㅕ:"ᅧ","ᆥ":"ᅧᅣ",ᅽ:"ᅧᅩ",ᅾ:"ᅧᅮ",ᅨ:"ᅧ丨",ㅖ:"ᅧ丨",ㅗ:"ᅩ",ᅪ:"ᅩᅡ",ㅘ:"ᅩᅡ",ᅫ:"ᅩᅡ丨",ㅙ:"ᅩᅡ丨","ᆦ":"ᅩᅣ","ᆧ":"ᅩᅣ丨",ᅿ:"ᅩᅥ",ᆀ:"ᅩᅥ丨","ힰ":"ᅩᅧ",ᆁ:"ᅩᅧ丨",ᆂ:"ᅩᅩ","ힱ":"ᅩᅩ丨",ᆃ:"ᅩᅮ",ᅬ:"ᅩ丨",ㅚ:"ᅩ丨",ㅛ:"ᅭ","ힲ":"ᅭᅡ","ힳ":"ᅭᅡ丨",ᆄ:"ᅭᅣ",ㆇ:"ᅭᅣ",ᆆ:"ᅭᅣ",ᆅ:"ᅭᅣ丨",ㆈ:"ᅭᅣ丨","ힴ":"ᅭᅥ",ᆇ:"ᅭᅩ",ᆈ:"ᅭ丨",ㆉ:"ᅭ丨",ㅜ:"ᅮ",ᆉ:"ᅮᅡ",ᆊ:"ᅮᅡ丨",ᅯ:"ᅮᅥ",ㅝ:"ᅮᅥ",ᆋ:"ᅮᅥー",ᅰ:"ᅮᅥ丨",ㅞ:"ᅮᅥ丨","ힵ":"ᅮᅧ",ᆌ:"ᅮᅧ丨",ᆍ:"ᅮᅮ",ᅱ:"ᅮ丨",ㅟ:"ᅮ丨","ힶ":"ᅮ丨丨",ㅠ:"ᅲ",ᆎ:"ᅲᅡ","ힷ":"ᅲᅡ丨",ᆏ:"ᅲᅥ",ᆐ:"ᅲᅥ丨",ᆑ:"ᅲᅧ",ㆊ:"ᅲᅧ",ᆒ:"ᅲᅧ丨",ㆋ:"ᅲᅧ丨","ힸ":"ᅲᅩ",ᆓ:"ᅲᅮ",ᆔ:"ᅲ丨",ㆌ:"ᅲ丨",ㆍ:"ᆞ","ퟅ":"ᆞᅡ",ᆟ:"ᆞᅥ","ퟆ":"ᆞᅥ丨",ᆠ:"ᆞᅮ",ᆢ:"ᆞᆞ",ᆡ:"ᆞ丨",ㆎ:"ᆞ丨",ヘ:"へ","⍁":"〼","⧄":"〼","꒞":"ꁊ","꒬":"ꁐ","꒜":"ꃀ","꒨":"ꄲ","꒿":"ꉙ","꒾":"ꊱ","꒔":"ꋍ","꓀":"ꎫ","꓂":"ꎵ","꒺":"ꎿ","꒰":"ꏂ","꒧":"ꑘ","⊥":"ꓕ","⟂":"ꓕ","𝈜":"ꓕ","Ʇ":"ꓕ","Ꞟ":"ꓤ","⅁":"ꓨ","⅂":"ꓶ","𝈕":"ꓶ","𝈫":"ꓶ","𖼦":"ꓶ","𐐑":"ꓶ","⅃":"𖼀","𑫦":"𑫥𑫯","𑫨":"𑫥𑫥","𑫩":"𑫥𑫥𑫯","𑫪":"𑫥𑫥𑫰","𑫧":"𑫥𑫰","𑫴":"𑫳𑫯","𑫶":"𑫳𑫳","𑫷":"𑫳𑫳𑫯","𑫸":"𑫳𑫳𑫰","𑫵":"𑫳𑫰","𑫬":"𑫫𑫯","𑫭":"𑫫𑫫","𑫮":"𑫫𑫫𑫯","⊕":"𐊨","⨁":"𐊨","🜨":"𐊨","Ꚛ":"𐊨","▽":"𐊼","𝈔":"𐊼","🜄":"𐊼","⧖":"𐋀","ꞛ":"𐐺","Ꞛ":"𐐒","𐒠":"𐒆","𐏑":"𐎂","𐏓":"𐎓","𒀸":"𐎚","☥":"𐦞","𓋹":"𐦞","〹":"卄",不:"不","丽":"丽","並":"並","⎜":"丨","⎟":"丨","⎢":"丨","⎥":"丨","⎪":"丨","⎮":"丨","㇑":"丨",ᅵ:"丨",ㅣ:"丨","⼁":"丨",ᆜ:"丨ー",ᆘ:"丨ᅡ",ᆙ:"丨ᅣ","ힽ":"丨ᅣᅩ","ힾ":"丨ᅣ丨","ힿ":"丨ᅧ","ퟀ":"丨ᅧ丨",ᆚ:"丨ᅩ","ퟁ":"丨ᅩ丨","ퟂ":"丨ᅭ",ᆛ:"丨ᅮ","ퟃ":"丨ᅲ",ᆝ:"丨ᆞ","ퟄ":"丨丨",串:"串","丸":"丸",丹:"丹","乁":"乁","㇠":"乙","⼄":"乙","㇟":"乚","⺃":"乚","㇖":"乛","⺂":"乛","⻲":"亀",亂:"亂","㇚":"亅","⼅":"亅",了:"了",ニ:"二","⼆":"二","𠄢":"𠄢","⼇":"亠",亮:"亮","⼈":"人",イ:"亻","⺅":"亻",什:"什","仌":"仌",令:"令","你":"你",倂:"併","倂":"併","侀":"侀",來:"來",例:"例","侮":"侮","侮":"侮","侻":"侻",便:"便",值:"値",倫:"倫","偺":"偺","備":"備","像":"像",僚:"僚","僧":"僧","僧":"僧","㒞":"㒞","⼉":"儿",兀:"兀","⺎":"兀","充":"充","免":"免","免":"免","兔":"兔","兤":"兤","⼊":"入","內":"內","全":"全",兩:"兩",ハ:"八","⼋":"八",六:"六","具":"具","𠔜":"𠔜","𠔥":"𠔥","冀":"冀","㒹":"㒹","⼌":"冂","再":"再","𠕋":"𠕋","冒":"冒","冕":"冕","㒻":"㒻","最":"最","⼍":"冖","冗":"冗","冤":"冤","⼎":"冫","冬":"冬","况":"况","况":"况",冷:"冷",凉:"凉",凌:"凌",凜:"凜",凞:"凞","⼏":"几","𠘺":"𠘺","凵":"凵","⼐":"凵","⼑":"刀","⺉":"刂","刃":"刃",切:"切","切":"切",列:"列",利:"利","㓟":"㓟",刺:"刺","刻":"刻","剆":"剆","割":"割","剷":"剷",劉:"劉","𠠄":"𠠄",カ:"力",力:"力","⼒":"力",劣:"劣","㔕":"㔕","劳":"劳","勇":"勇","勇":"勇","勉":"勉","勉":"勉",勒:"勒",勞:"勞","勤":"勤","勤":"勤",勵:"勵","⼓":"勹","勺":"勺","勺":"勺","包":"包","匆":"匆","𠣞":"𠣞","⼔":"匕",北:"北","北":"北","⼕":"匚","⼖":"匸",匿:"匿","⼗":"十","〸":"十","〺":"卅","卉":"卉","࿖":"卍","࿕":"卐","卑":"卑","卑":"卑","博":"博",ト:"卜","⼘":"卜","⼙":"卩","⺋":"㔾","即":"即",卵:"卵","卽":"卽","卿":"卿","卿":"卿","卿":"卿","⼚":"厂","𠨬":"𠨬","⼛":"厶",參:"參","⼜":"又","及":"及","叟":"叟","𠭣":"𠭣",ロ:"口","⼝":"口",囗:"口","⼞":"口",句:"句","叫":"叫","叱":"叱","吆":"吆",吏:"吏",吝:"吝","吸":"吸",呂:"呂","呈":"呈","周":"周","咞":"咞","咢":"咢",咽:"咽",䎛:"㖈","哶":"哶","唐":"唐","啓":"啓",啟:"啓","啕":"啕","啣":"啣","善":"善","善":"善",喇:"喇","喙":"喙","喙":"喙","喝":"喝","喝":"喝","喫":"喫","喳":"喳",嗀:"嗀","嗂":"嗂","嗢":"嗢","嘆":"嘆","嘆":"嘆","噑":"噑","噴":"噴","器":"器",囹:"囹","圖":"圖","圗":"圗","⼟":"土",士:"土","⼠":"土","型":"型","城":"城",㦳:"㘽","埴":"埴","堍":"堍","報":"報","堲":"堲","塀":"塀",塚:"塚","塚":"塚",塞:"塞",填:"塡",壿:"墫","墬":"墬","墳":"墳",壘:"壘",壟:"壟","𡓤":"𡓤","壮":"壮","売":"売","壷":"壷","⼡":"夂","夆":"夆","⼢":"夊",タ:"夕","⼣":"夕","多":"多","夢":"夢","⼤":"大","奄":"奄",奈:"奈",契:"契","奔":"奔","奢":"奢",女:"女","⼥":"女","𡚨":"𡚨","𡛪":"𡛪","姘":"姘","姬":"姬","娛":"娛","娧":"娧","婢":"婢","婦":"婦",嬀:"媯","㛮":"㛮","㛼":"㛼","媵":"媵","嬈":"嬈","嬨":"嬨","嬾":"嬾","嬾":"嬾","⼦":"子","⼧":"宀",宅:"宅","𡧈":"𡧈","寃":"寃","寘":"寘",寧:"寧",寧:"寧","寧":"寧",寮:"寮","寳":"寳","𡬘":"𡬘","⼨":"寸","寿":"寿","将":"将","⼩":"小","尢":"尢","⺐":"尢","⼪":"尢","⺏":"尣","㞁":"㞁","⼫":"尸",尿:"尿","屠":"屠",屢:"屢","層":"層",履:"履","屮":"屮","屮":"屮","⼬":"屮","𡴋":"𡴋","⼭":"山","峀":"峀","岍":"岍","𡷤":"𡷤","𡷦":"𡷦",崙:"崙","嵃":"嵃",嵐:"嵐","嵫":"嵫","嵮":"嵮","嵼":"嵼","嶲":"嶲",嶺:"嶺","⼮":"巛","巢":"巢",エ:"工","⼯":"工","⼰":"己","⺒":"巳","㠯":"㠯","巽":"巽","⼱":"巾",帲:"帡","帨":"帨","帽":"帽","幩":"幩","㡢":"㡢","𢆃":"𢆃","⼲":"干",年:"年","𢆟":"𢆟","⺓":"幺","⼳":"幺","⼴":"广",度:"度","㡼":"㡼","庰":"庰","庳":"庳","庶":"庶",廊:"廊","廊":"廊",廉:"廉","廒":"廒",廓:"廓","廙":"廙",廬:"廬","⼵":"廴","廾":"廾","⼶":"廾","𢌱":"𢌱","𢌱":"𢌱",弄:"弄","⼷":"弋","⼸":"弓","弢":"弢","弢":"弢","⼹":"彐","⺔":"彑","当":"当","㣇":"㣇","⼺":"彡","形":"形","彩":"彩","彫":"彫","⼻":"彳",律:"律","㣣":"㣣","徚":"徚",復:"復","徭":"徭","⼼":"心","⺖":"忄","⺗":"㣺","忍":"忍","志":"志",念:"念","忹":"忹",怒:"怒",怜:"怜","恵":"恵","㤜":"㤜","㤺":"㤺","悁":"悁","悔":"悔","悔":"悔","惇":"惇","惘":"惘",惡:"惡","𢛔":"𢛔","愈":"愈","慨":"慨",慄:"慄","慈":"慈","慌":"慌","慌":"慌","慎":"慎","慎":"慎","慠":"慠","慺":"慺","憎":"憎","憎":"憎","憎":"憎",憐:"憐","憤":"憤","憯":"憯","憲":"憲","𢡄":"𢡄","𢡊":"𢡊","懞":"懞","懲":"懲","懲":"懲","懲":"懲",懶:"懶","懶":"懶",戀:"戀","⼽":"戈","成":"成","戛":"戛",戮:"戮","戴":"戴","⼾":"戶",戸:"戶","⼿":"手","⺘":"扌","扝":"扝","抱":"抱",拉:"拉",拏:"拏",拓:"拓","拔":"拔","拼":"拼",拾:"拾","𢬌":"𢬌","挽":"挽","捐":"捐","捨":"捨",捻:"捻","掃":"掃",掠:"掠","掩":"掩","揄":"揄","揤":"揤","摒":"摒","𢯱":"𢯱","搜":"搜","搢":"搢","揅":"揅","摩":"摩","摷":"摷","摾":"摾","㨮":"㨮",搉:"㩁",撚:"撚","撝":"撝",擄:"擄","㩬":"㩬","⽀":"支","⽁":"攴","⺙":"攵","敏":"敏","敏":"敏","敖":"敖","敬":"敬",數:"數","𣀊":"𣀊","⽂":"文","⻫":"斉","⽃":"斗",料:"料","⽄":"斤","⽅":"方",旅:"旅","⽆":"无","⺛":"旡","既":"既","旣":"旣","⽇":"日",易:"易",曶:"㫚","㫤":"㫤","晉":"晉",晩:"晚",晴:"晴","晴":"晴","暑":"暑","暑":"暑",暈:"暈","㬈":"㬈","暜":"暜",暴:"暴",曆:"曆","㬙":"㬙","𣊸":"𣊸","⽈":"曰",更:"更","書":"書","⽉":"月","𣍟":"𣍟",肦:"朌",胐:"朏",胊:"朐",脁:"朓",胶:"㬵",朗:"朗","朗":"朗","朗":"朗",脧:"朘","望":"望","望":"望",幐:"㬺",䐠:"㬻","𣎓":"𣎓",膧:"朣","𣎜":"𣎜","⽊":"木",李:"李","杓":"杓","杖":"杖","杞":"杞","𣏃":"𣏃",柿:"杮",杻:"杻","枅":"枅",林:"林","㭉":"㭉","𣏕":"𣏕",柳:"柳","柺":"柺",栗:"栗","栟":"栟","桒":"桒","𣑭":"𣑭",梁:"梁","梅":"梅","梅":"梅","梎":"梎",梨:"梨","椔":"椔","楂":"楂","㮝":"㮝","㮝":"㮝",槩:"㮣",樧:"榝","榣":"榣","槪":"槪",樂:"樂",樂:"樂",樂:"樂",樓:"樓","𣚣":"𣚣","檨":"檨",櫓:"櫓","櫛":"櫛",欄:"欄","㰘":"㰘","⽋":"欠","次":"次","𣢧":"𣢧","歔":"歔","㱎":"㱎","⽌":"止","⻭":"歯","歲":"歲",歷:"歷","歹":"歹","⽍":"歹","⺞":"歺","殟":"殟",殮:"殮","⽎":"殳",殺:"殺","殺":"殺","殺":"殺","殻":"殻","𣪍":"𣪍","⽏":"毋","⺟":"母","𣫺":"𣫺","⽐":"比","⽑":"毛","⽒":"氏","⺠":"民","⽓":"气","⽔":"水","⺡":"氵","⺢":"氺","汎":"汎","汧":"汧",沈:"沈","沿":"沿",泌:"泌","泍":"泍",泥:"泥","𣲼":"𣲼",洛:"洛",洞:"洞","洴":"洴","派":"派",流:"流","流":"流","流":"流","洖":"洖","浩":"浩",浪:"浪","海":"海","海":"海","浸":"浸","涅":"涅","𣴞":"𣴞",淋:"淋",淚:"淚",淪:"淪","淹":"淹","渚":"渚","港":"港","湮":"湮",潙:"溈","滋":"滋","滋":"滋",溜:"溜",溺:"溺","滇":"滇",滑:"滑","滛":"滛","㴳":"㴳",漏:"漏","漢":"漢","漢":"漢",漣:"漣","𣻑":"𣻑","潮":"潮","𣽞":"𣽞","𣾎":"𣾎","濆":"濆",濫:"濫",濾:"濾","瀛":"瀛","瀞":"瀞","瀞":"瀞","瀹":"瀹","灊":"灊","㶖":"㶖","⽕":"火","⺣":"灬","灰":"灰","灷":"灷","災":"災",炙:"炙","炭":"炭",烈:"烈",烙:"烙","煮":"煮","煮":"煮","𤉣":"𤉣","煅":"煅",煉:"煉","𤋮":"𤋮","熜":"熜",燎:"燎",燐:"燐","𤎫":"𤎫",爐:"爐",爛:"爛","爨":"爨","⽖":"爪","爫":"爫","⺤":"爫","爵":"爵","爵":"爵","⽗":"父","⽘":"爻","⺦":"丬","⽙":"爿","⽚":"片","牐":"牐","⽛":"牙","𤘈":"𤘈","⽜":"牛",牢:"牢","犀":"犀","犕":"犕","⽝":"犬","⺨":"犭","犯":"犯",狀:"狀","𤜵":"𤜵",狼:"狼",猪:"猪","猪":"猪","𤠔":"𤠔",獵:"獵","獺":"獺","⽞":"玄",率:"率",率:"率","⽟":"玉","王":"王","㺬":"㺬","玥":"玥",玲:"玲","㺸":"㺸","㺸":"㺸",珞:"珞",琉:"琉",理:"理","琢":"琢","瑇":"瑇","瑜":"瑜",瑩:"瑩","瑱":"瑱","瑱":"瑱","璅":"璅",璉:"璉",璘:"璘","瓊":"瓊","⽠":"瓜","⽡":"瓦","㼛":"㼛","甆":"甆","⽢":"甘","⽣":"生","甤":"甤","⽤":"用","⽥":"田","画":"画","甾":"甾","𤰶":"𤰶",留:"留",略:"略",異:"異","異":"異","𤲒":"𤲒","⽦":"疋","⽧":"疒",痢:"痢","瘐":"瘐","瘟":"瘟","瘝":"瘝",療:"療",癩:"癩","⽨":"癶","⽩":"白","𤾡":"𤾡","𤾸":"𤾸","⽪":"皮","⽫":"皿","𥁄":"𥁄","㿼":"㿼",益:"益","益":"益","盛":"盛",盧:"盧","䀈":"䀈","⽬":"目","直":"直","直":"直","𥃲":"𥃲","𥃳":"𥃳",省:"省","䀘":"䀘","𥄙":"𥄙","眞":"眞","真":"真","真":"真","𥄳":"𥄳","着":"着","睊":"睊","睊":"睊","鿃":"䀹","䀹":"䀹","䀹":"䀹",晣:"䀿","䁆":"䁆","瞋":"瞋","𥉉":"𥉉","瞧":"瞧","⽭":"矛","⽮":"矢","⽯":"石","䂖":"䂖","𥐝":"𥐝",硏:"研","硎":"硎",硫:"硫",碌:"碌","碌":"碌","碑":"碑",磊:"磊","磌":"磌","磌":"磌",磻:"磻","䃣":"䃣",礪:"礪","⽰":"示","⺭":"礻",礼:"礼","社":"社","祈":"祈","祉":"祉","𥘦":"𥘦","祐":"祐","祖":"祖","祖":"祖","祝":"祝",神:"神",祥:"祥","視":"視","視":"視",祿:"祿","𥚚":"𥚚","禍":"禍","禎":"禎",福:"福","福":"福","𥛅":"𥛅",禮:"禮","⽱":"禸","⽲":"禾",秊:"秊","䄯":"䄯","秫":"秫",稜:"稜","穊":"穊","穀":"穀","穀":"穀","穏":"穏","⽳":"穴","突":"突","𥥼":"𥥼","窱":"窱",立:"立","⽴":"立","⻯":"竜","𥪧":"𥪧","𥪧":"𥪧","竮":"竮","⽵":"竹",笠:"笠","節":"節","節":"節","䈂":"䈂","𥮫":"𥮫","篆":"篆","䈧":"䈧","築":"築","𥲀":"𥲀","𥳐":"𥳐",簾:"簾",籠:"籠","⽶":"米","类":"类",粒:"粒",精:"精","糒":"糒",糖:"糖","糨":"糨","䊠":"䊠","糣":"糣",糧:"糧","⽷":"糸","⺯":"糹","𥾆":"𥾆","紀":"紀",紐:"紐",索:"索",累:"累",絶:"絕","絣":"絣","絛":"絛",綠:"綠",綾:"綾","緇":"緇",練:"練","練":"練","練":"練","縂":"縂","䌁":"䌁","縉":"縉",縷:"縷","繁":"繁","繅":"繅","𦇚":"𦇚","䌴":"䌴","⽸":"缶","𦈨":"𦈨","缾":"缾","𦉇":"𦉇","⽹":"网","⺫":"罒","⺲":"罒","⺱":"罓","䍙":"䍙","署":"署","𦋙":"𦋙",罹:"罹","罺":"罺",羅:"羅","𦌾":"𦌾","⽺":"羊","羕":"羕",羚:"羚",羽:"羽","⽻":"羽","翺":"翺",老:"老","⽼":"老","⺹":"耂","者":"者","者":"者","者":"者","⽽":"而","𦓚":"𦓚","⽾":"耒","𦔣":"𦔣","⽿":"耳",聆:"聆","聠":"聠","𦖨":"𦖨",聯:"聯","聰":"聰",聾:"聾","⾀":"聿","⺺":"肀","⾁":"肉",肋:"肋","肭":"肭","育":"育","䏕":"䏕","䏙":"䏙",腁:"胼","脃":"脃","脾":"脾","䐋":"䐋","朡":"朡","𦞧":"𦞧","𦞵":"𦞵",朦:"䑃",臘:"臘","⾂":"臣",臨:"臨","⾃":"自","臭":"臭","⾄":"至","⾅":"臼","舁":"舁","舁":"舁","舄":"舄","⾆":"舌","舘":"舘","⾇":"舛","⾈":"舟","䑫":"䑫","⾉":"艮",良:"良","⾊":"色","⾋":"艸","艹":"艹","艹":"艹","⺾":"艹","⺿":"艹","⻀":"艹","芋":"芋","芑":"芑","芝":"芝","花":"花","芳":"芳","芽":"芽",若:"若","若":"若","苦":"苦","𦬼":"𦬼",茶:"茶","荒":"荒","荣":"荣","茝":"茝","茣":"茣","莽":"莽","荓":"荓",菉:"菉","菊":"菊","菌":"菌","菜":"菜","菧":"菧","華":"華",菱:"菱","著":"著","著":"著","𦰶":"𦰶","莭":"莭",落:"落",葉:"葉",蔿:"蒍","𦳕":"𦳕","𦵫":"𦵫",蓮:"蓮","蓱":"蓱","蓳":"蓳",蓼:"蓼","蔖":"蔖","䔫":"䔫","蕤":"蕤","𦼬":"𦼬",藍:"藍","䕝":"䕝","𦾱":"𦾱","䕡":"䕡",藺:"藺",蘆:"蘆","䕫":"䕫",蘒:"蘒",蘭:"蘭","𧃒":"𧃒",虁:"蘷",蘿:"蘿","⾌":"虍","⻁":"虎","虐":"虐",虜:"虜","虜":"虜","虧":"虧","虩":"虩","⾍":"虫","蚩":"蚩","蚈":"蚈","蛢":"蛢","蜎":"蜎","蜨":"蜨","蝫":"蝫","蟡":"蟡","蝹":"蝹","蝹":"蝹","螆":"螆","䗗":"䗗","𧏊":"𧏊",螺:"螺","蠁":"蠁","䗹":"䗹",蠟:"蠟","⾎":"血",行:"行","⾏":"行","衠":"衠","衣":"衣","⾐":"衣","⻂":"衤",裂:"裂","𧙧":"𧙧",裏:"裏","裗":"裗","裞":"裞",裡:"裡",裸:"裸","裺":"裺","䘵":"䘵","褐":"褐","襁":"襁",襤:"襤","⾑":"襾","⻄":"西","⻃":"覀","覆":"覆",見:"見","⾒":"見","𧢮":"𧢮","⻅":"见","⾓":"角","⾔":"言","𧥦":"𧥦",詽:"訮",訞:"䚶","䚾":"䚾","䛇":"䛇","誠":"誠",說:"說",說:"說","調":"調","請":"請",諒:"諒",論:"論","諭":"諭","諭":"諭",諸:"諸","諸":"諸",諾:"諾","諾":"諾","謁":"謁","謁":"謁","謹":"謹","謹":"謹",識:"識",讀:"讀",讏:"讆","變":"變","變":"變","⻈":"讠","⾕":"谷","⾖":"豆",豈:"豈","豕":"豕","⾗":"豕",豣:"豜","⾘":"豸","𧲨":"𧲨","⾙":"貝","貫":"貫","賁":"賁",賂:"賂",賈:"賈","賓":"賓","贈":"贈","贈":"贈","贛":"贛","⻉":"贝","⾚":"赤","⾛":"走","起":"起",趆:"赿","𧻓":"𧻓","𧼯":"𧼯","⾜":"足","跋":"跋","趼":"趼",跺:"跥",路:"路","跰":"跰",躛:"躗","⾝":"身",車:"車","⾞":"車","軔":"軔",輧:"軿",輦:"輦",輪:"輪","輸":"輸","輸":"輸",輻:"輻",轢:"轢","⻋":"车","⾟":"辛","辞":"辞",辰:"辰","⾠":"辰","⾡":"辵","辶":"辶","⻌":"辶","⻍":"辶","巡":"巡",連:"連",逸:"逸","逸":"逸","遲":"遲",遼:"遼","𨗒":"𨗒","𨗭":"𨗭",邏:"邏","⾢":"邑","邔":"邔",郎:"郎",郞:"郎","郞":"郎","郱":"郱",都:"都","𨜮":"𨜮","鄑":"鄑","鄛":"鄛","⾣":"酉",酪:"酪","醙":"醙",醴:"醴","⾤":"釆",里:"里","⾥":"里",量:"量",金:"金","⾦":"金",鈴:"鈴","鈸":"鈸","鉶":"鉶","鋗":"鋗","鋘":"鋘","鉼":"鉼",錄:"錄",鍊:"鍊",鎮:"鎭","鏹":"鏹","鐕":"鐕","𨯺":"𨯺","⻐":"钅","⻑":"長","⾧":"長","⻒":"镸","⻓":"长","⾨":"門","開":"開","䦕":"䦕",閭:"閭","閷":"閷","𨵷":"𨵷","⻔":"门","⾩":"阜","⻏":"阝","⻖":"阝",阮:"阮",陋:"陋",降:"降",陵:"陵",陸:"陸","陼":"陼",隆:"隆",隣:"隣","䧦":"䧦","⾪":"隶","隷":"隷",隸:"隷",隸:"隷","⾫":"隹","雃":"雃",離:"離","難":"難","難":"難","⾬":"雨",零:"零",雷:"雷","霣":"霣","𩅅":"𩅅",露:"露",靈:"靈","⾭":"靑","⻘":"青",靖:"靖","靖":"靖","𩇟":"𩇟","⾮":"非","⾯":"面","𩈚":"𩈚","⾰":"革","䩮":"䩮","䩶":"䩶","⾱":"韋","韛":"韛","韠":"韠","⻙":"韦","⾲":"韭","𩐊":"𩐊","⾳":"音","響":"響","響":"響","⾴":"頁","䪲":"䪲","頋":"頋","頋":"頋","頋":"頋",領:"領","頩":"頩","𩒖":"𩒖","頻":"頻","頻":"頻",類:"類","⻚":"页","⾵":"風","𩖶":"𩖶","⻛":"风","⾶":"飛","⻜":"飞","⻝":"食","⾷":"食","⻟":"飠","飢":"飢",飯:"飯",飼:"飼","䬳":"䬳",館:"館","餩":"餩","⻠":"饣","⾸":"首","⾹":"香","馧":"馧","⾺":"馬","駂":"駂",駱:"駱","駾":"駾",驪:"驪","⻢":"马","⾻":"骨","䯎":"䯎","⾼":"高","⾽":"髟","𩬰":"𩬰","鬒":"鬒","鬒":"鬒","⾾":"鬥","⾿":"鬯","⿀":"鬲","⿁":"鬼","⻤":"鬼","⿂":"魚",魯:"魯","鱀":"鱀",鱗:"鱗","⻥":"鱼","⿃":"鳥","鳽":"鳽","䳎":"䳎","鵧":"鵧","䳭":"䳭","𪃎":"𪃎",鶴:"鶴","𪄅":"𪄅","䳸":"䳸",鷺:"鷺","𪈎":"𪈎",鸞:"鸞",鹃:"鹂","⿄":"鹵",鹿:"鹿","⿅":"鹿","𪊑":"𪊑",麗:"麗",麟:"麟","⿆":"麥","⻨":"麦","麻":"麻","⿇":"麻","𪎒":"𪎒","⿈":"黃","⻩":"黄","⿉":"黍",黎:"黎","䵖":"䵖","⿊":"黑",黒:"黑","墨":"墨","黹":"黹","⿋":"黹","⿌":"黽","鼅":"鼅","黾":"黾","⿍":"鼎","鼏":"鼏","⿎":"鼓","鼖":"鼖","⿏":"鼠","鼻":"鼻","⿐":"鼻","齃":"齃","⿑":"齊","⻬":"齐","⿒":"齒","𪘀":"𪘀","⻮":"齿",龍:"龍","⿓":"龍","龎":"龎","⻰":"龙",龜:"龜",龜:"龜","龜":"龜","⿔":"龜","⻳":"龟","⿕":"龠"};var YI,QF;function ove(){if(QF)return YI;QF=1;var t=sve;function e(s){return s.replace(/([.?*+^$[\]\\(){}|-])/g,"\\$1")}var n=RegExp(Object.keys(t).map(e).join("|"),"g");function r(s){return t[s]}function i(s){return s.replace(n,r)}return YI=i,YI}var ave=ove();const cve=Dl(ave),lve=Object.prototype.toString,uve=t=>lve.call(t)==="[object Error]",dve=new Set(["network error","Failed to fetch","NetworkError when attempting to fetch resource.","The Internet connection appears to be offline.","Network request failed","fetch failed","terminated"," A network error occurred.","Network connection lost"]);function fve(t){if(!(t&&uve(t)&&t.name==="TypeError"&&typeof t.message=="string"))return!1;const{message:n,stack:r}=t;return n==="Load failed"?r===void 0||"__sentry_captured__"in t:n.startsWith("error sending request for url")?!0:dve.has(n)}function hve(t){if(typeof t=="number"){if(t<0)throw new TypeError("Expected `retries` to be a non-negative number.");if(Number.isNaN(t))throw new TypeError("Expected `retries` to be a valid number or Infinity, got NaN.")}else if(t!==void 0)throw new TypeError("Expected `retries` to be a number or Infinity.")}function J2(t,e,{min:n=0,allowInfinity:r=!1}={}){if(e!==void 0){if(typeof e!="number"||Number.isNaN(e))throw new TypeError(`Expected \`${t}\` to be a number${r?" or Infinity":""}.`);if(!r&&!Number.isFinite(e))throw new TypeError(`Expected \`${t}\` to be a finite number.`);if(e<n)throw new TypeError(`Expected \`${t}\` to be ≥ ${n}.`)}}class MJ extends Error{constructor(e){super(),e instanceof Error?(this.originalError=e,{message:e}=e):(this.originalError=new Error(e),this.originalError.stack=this.stack),this.name="AbortError",this.message=e}}const pve=(t,e,n)=>{const r=n.retries-(e-1);return Object.freeze({error:t,attemptNumber:e,retriesLeft:r})};function mve(t,e){const n=e.randomize?Math.random()+1:1;let r=Math.round(n*Math.max(e.minTimeout,1)*e.factor**(t-1));return r=Math.min(r,e.maxTimeout),r}async function gve(t,e,n,r,i){let s=t;if(s instanceof Error||(s=new TypeError(`Non-error was thrown: "${s}". You should only throw errors.`)),s instanceof MJ)throw s.originalError;if(s instanceof TypeError&&!fve(s))throw s;const o=pve(s,e,n);await n.onFailedAttempt(o);const a=Date.now();if(a-r>=i||e>=n.retries+1||!await n.shouldRetry(o))throw s;const c=mve(e,n),l=i-(a-r);if(l<=0)throw s;const d=Math.min(c,l);d>0&&await new Promise((h,m)=>{const g=()=>{clearTimeout(y),n.signal?.removeEventListener("abort",g),m(n.signal.reason)},y=setTimeout(()=>{n.signal?.removeEventListener("abort",g),h()},d);n.unref&&y.unref?.(),n.signal?.addEventListener("abort",g,{once:!0})}),n.signal?.throwIfAborted()}async function vve(t,e={}){if(e={...e},hve(e.retries),Object.hasOwn(e,"forever"))throw new Error("The `forever` option is no longer supported. For many use-cases, you can set `retries: Infinity` instead.");e.retries??=10,e.factor??=2,e.minTimeout??=1e3,e.maxTimeout??=Number.POSITIVE_INFINITY,e.randomize??=!1,e.onFailedAttempt??=()=>{},e.shouldRetry??=()=>!0,J2("factor",e.factor,{min:0,allowInfinity:!1}),J2("minTimeout",e.minTimeout,{min:0,allowInfinity:!1}),J2("maxTimeout",e.maxTimeout,{min:0,allowInfinity:!0});const n=e.maxRetryTime??Number.POSITIVE_INFINITY;J2("maxRetryTime",n,{min:0,allowInfinity:!0}),e.factor>0||(e.factor=1),e.signal?.throwIfAborted();let r=0;const i=Date.now(),s=n;for(;r<e.retries+1;){r++;try{e.signal?.throwIfAborted();const o=await t(r);return e.signal?.throwIfAborted(),o}catch(o){await gve(o,r,e,i,s)}}throw new Error("Retry attempts exhausted without throwing an error.")}let sy=class{constructor(e,n){if(this.stable=e,this.unstable=n,!this.unstable&&!this.stable)throw new Error("One of stable or unstable values must be supplied")}get name(){return this.stable?this.stable:this.unstable}get altName(){return this.stable?this.unstable:null}get names(){var e=[this.name],n=this.altName;return n&&e.push(n),e}matches(e){return this.name===e||this.altName===e}findIn(e){var n=void 0;return this.name&&(n=e?.[this.name]),!n&&this.altName&&(n=e?.[this.altName]),n}includedIn(e){var n=!1;return this.name&&(n=e.includes(this.name)),!n&&this.altName&&(n=e.includes(this.altName)),n}};class gT extends sy{constructor(){super(...arguments),L(this,"preferUnstable",!1)}setPreferUnstable(e){this.preferUnstable=e}get name(){return this.stable&&!this.preferUnstable?this.stable:this.unstable}}class qr extends sy{constructor(e,n){if(super(e,n),!this.unstable)throw new Error("Unstable value must be supplied")}get name(){return this.unstable}get altName(){return this.stable}}var _v=(function(t){return t.Self="m.self",t.Pin="m.pin",t})({}),N_=new qr("m.asset","org.matrix.msc3488.asset"),sh=new qr("m.ts","org.matrix.msc3488.ts"),U_=new qr("m.location","org.matrix.msc3488.location"),Ps=(function(t){return t.Read="m.read",t.FullyRead="m.fully_read",t.ReadPrivate="m.read.private",t})({}),j_="main";function ZF(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function e$(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?ZF(Object(n),!0).forEach(function(r){L(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):ZF(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}var JI=new Map;function XI(t){return t instanceof String&&(t=t.toString()),JI.has(t)||JI.set(t,t),JI.get(t)}function dA(t,e){var n=e??new URLSearchParams,r=function(a){s!=null&&(Array.isArray(s)?s.forEach(c=>{n.append(a,String(c))}):n.append(a,String(s)))};for(var[i,s]of Object.entries(t))r(i);return n}function t$(t,e,n){var r=e$(e$({},n),{},{[e]:n[t]});return delete r[t],r}function Pe(t,e){for(var n in e)if(e.hasOwnProperty(n)){var r=e[n];r!=null&&(t=t.replace(n,encodeURIComponent(r)))}return t}function SC(t,e,n){var r;if(n){for(r=t.length-1;r>=0;r--)if(e(t[r],r,t))return t.splice(r,1),!0}else for(r=0;r<t.length;r++)if(e(t[r],r,t))return t.splice(r,1),!0;return!1}function LJ(t,e){for(var n of e)if(!t.hasOwnProperty(n))throw new Error("Missing required key: "+n)}function F_(t){return JSON.parse(JSON.stringify(t))}function kp(t,e){if(t===e)return!0;if(typeof t!=typeof e)return!1;if(typeof t=="number"&&isNaN(t)&&isNaN(e))return!0;if(t===null||e===null)return t===e;if(t.constructor.name!=="Object"&&t.constructor.name!=="RegExp"&&t.constructor.name!=="Date"&&t.constructor.name!=="Array"||t.prototype!==e.prototype)return!1;if(t instanceof RegExp||t instanceof Date)return t.toString()===e.toString();if(Array.isArray(t)){if(t.length!==e.length)return!1;for(var n=0;n<t.length;n++)if(!kp(t[n],e[n]))return!1}else{for(var r in e)if(e.hasOwnProperty(r)!==t.hasOwnProperty(r))return!1;for(var i in t)if(e.hasOwnProperty(i)!==t.hasOwnProperty(i)||!kp(t[i],e[i]))return!1}return!0}function fA(t){if(typeof t!="object"||t==null||Array.isArray(t))return t;var e=[];for(var[n,r]of Object.entries(t))e.push([n,fA(r)]);return e.sort((i,s)=>pE(i[0],s[0])),e}function n$(t){return typeof t=="number"&&isFinite(t)}function Tf(t){return typeof t=="string"?cve(t.normalize("NFD").replace(bve,"")):""}function wC(t){return typeof t=="string"?t.replace(/[\u202d-\u202e]/g,""):""}function yve(t){return Tf(t.toLowerCase()).replace(/[\\'!"#$%&()*+,\-./:;<=>?@[\]^_`{|}~\u2000-\u206f\u2e00-\u2e7f]/g,"").toLowerCase()}var bve=/[\u2000-\u200F\u202A-\u202F\u0300-\u036F\uFEFF\u061C\u2800\u2062-\u2063\s]/g;function OJ(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function PJ(t){return OJ(t).replace(/\\\*/g,".*").replace(/\?/g,".")}function QI(t){return t!=null&&t.endsWith("/")?t.slice(0,-1):t}function Wp(t,e){return new Promise(n=>{setTimeout(n,t,e)})}function uat(t,e,n){return hA.apply(this,arguments)}function hA(){return hA=B(function*(t,e,n){var r=Date.now();try{return yield n()}finally{var i=Date.now();t.debug("[Perf]: ".concat(e," took ").concat(i-r,"ms"))}}),hA.apply(this,arguments)}function _ve(t,e,n){var r=Date.now();try{return n()}finally{var i=Date.now();t.debug("[Perf]: ".concat(e," took ").concat(i-r,"ms"))}}function DJ(t){return t==null}function r$(t,e){return pA.apply(this,arguments)}function pA(){return pA=B(function*(t,e){for(var n of t)yield e(yield n)}),pA.apply(this,arguments)}function og(t){return Promise.resolve(t())}function Sve(t,e){return vve(n=>t(n),{retries:1/0,shouldRetry:e?n=>{var{error:r}=n;return e(r)}:void 0,factor:2,minTimeout:3e3,maxTimeout:15e3})}var $f=(()=>{for(var t="",e=32;e<=126;e++)t+=String.fromCharCode(e);return t})();function i$(t,e){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:$f;return t.padEnd(e,n[0])}function xb(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:$f,n=BigInt(e.length);if(t<=n){var r;return(r=e[Number(t)-1])!==null&&r!==void 0?r:""}var i=t/n,s=Number(t%n)-1;return s<0&&(i-=BigInt(Math.abs(s)),s=Number(n)-1),xb(i,e)+e[s]}function EC(t){for(var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:$f,n=BigInt(e.length),r=BigInt(0),i=t.length-1,s=BigInt(0);i>=0;i--,s++){var o=t.charCodeAt(i)-e.charCodeAt(0);r+=BigInt(1+o)*n**s}return r}function wve(t,e){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:$f,r=Math.max(t.length,e.length),i=EC(i$(t,r,n),n),s=EC(i$(e,r,n),n),o=(i+s)/BigInt(2);return o===i||o==s?xb(o,n)+n[0]:xb(o,n)}function U0(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:$f;return xb(EC(t,e)+BigInt(1),e)}function s$(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:$f;return xb(EC(t,e)-BigInt(1),e)}function pE(t,e){return t<e?-1:t>e?1:0}function NJ(t,e){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;for(var[r,i]of Object.entries(e)){if(t[r]instanceof Object&&i){NJ(t[r],i);continue}if(i!=null||!n){CC(t,r,i);continue}}return t}function o$(t){var e;return(e=sh.findIn(t.getContent()))!==null&&e!==void 0?e:-1}function Eve(t,e){return o$(e)-o$(t)}function YO(t){return[Ps.Read,Ps.ReadPrivate].includes(t)}function a$(t,e){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:(o,a)=>o===a;if(t.size!==e.size)return!1;for(var[r,i]of t){var s=e.get(r);if(s===void 0||!n(i,s))return!1}return!0}function UJ(t){return t instanceof Map?ip(t):Array.isArray(t)?t.map(e=>UJ(e)):t}function ip(t){var e=new Map;for(var[n,r]of t)e.set(n,UJ(r));return Object.fromEntries(e.entries())}function V1(t){return t==="__proto__"||t==="prototype"||t==="constructor"}function CC(t,e,n){if(V1(e))throw new Error("Trying to modify prototype or constructor");t[e]=n}function Ec(t){return!(V1(t.room_id)||V1(t.sender)||V1(t.event_id))}class Bu extends Map{constructor(e){super(),this.createDefault=e}getOrCreate(e){return this.has(e)||this.set(e,this.createDefault()),this.get(e)}}var mA="migrationState",Sv=(function(t){return t[t.NOT_STARTED=0]="NOT_STARTED",t[t.INITIAL_DATA_MIGRATED=1]="INITIAL_DATA_MIGRATED",t[t.OLM_SESSIONS_MIGRATED=2]="OLM_SESSIONS_MIGRATED",t[t.MEGOLM_SESSIONS_MIGRATED=3]="MEGOLM_SESSIONS_MIGRATED",t[t.ROOM_SETTINGS_MIGRATED=4]="ROOM_SETTINGS_MIGRATED",t[t.INITIAL_OWN_KEY_QUERY_DONE=5]="INITIAL_OWN_KEY_QUERY_DONE",t})({}),wv=50;function c$(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function l$(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?c$(Object(n),!0).forEach(function(r){L(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):c$(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function X2(t,e){return encodeURIComponent(t)+"/"+encodeURIComponent(e)}function Cve(t){var e=t.split("/"),n=decodeURIComponent(e[0]),r=decodeURIComponent(e[1]);return{senderKey:n,sessionId:r}}class vT{constructor(){L(this,"migrationState",Sv.NOT_STARTED),L(this,"account",null),L(this,"crossSigningKeys",null),L(this,"privateKeys",{}),L(this,"sessions",{}),L(this,"inboundGroupSessions",{}),L(this,"inboundGroupSessionsWithheld",{}),L(this,"rooms",{}),L(this,"sessionsNeedingBackup",{})}containsData(){var e=this;return B(function*(){return e.account!==null})()}startup(){var e=this;return B(function*(){return e})()}deleteAllData(){return Promise.resolve()}getMigrationState(){var e=this;return B(function*(){return e.migrationState})()}setMigrationState(e){var n=this;return B(function*(){n.migrationState=e})()}getAccount(e,n){n(this.account)}storeAccount(e,n){this.account=n}getCrossSigningKeys(e,n){n(this.crossSigningKeys)}getSecretStorePrivateKey(e,n,r){var i=this.privateKeys[r];n(i||null)}storeSecretStorePrivateKey(e,n,r){this.privateKeys[n]=r}countEndToEndSessions(e,n){var r=0;for(var i of Object.values(this.sessions))r+=Object.keys(i).length;n(r)}getEndToEndSession(e,n,r,i){var s=this.sessions[e]||{};i(s[n]||null)}getEndToEndSessions(e,n,r){r(this.sessions[e]||{})}storeEndToEndSession(e,n,r,i){var s=this.sessions[e];s===void 0&&(s={},this.sessions[e]=s),CC(s,n,r)}getEndToEndSessionsBatch(){var e=this;return B(function*(){var n=[];for(var r of Object.values(e.sessions))for(var i of Object.values(r))if(n.push(i),n.length>=wv)return n;return n.length===0?null:n})()}deleteEndToEndSessionsBatch(e){var n=this;return B(function*(){for(var{deviceKey:r,sessionId:i}of e){var s=n.sessions[r]||{};delete s[i],Object.keys(s).length===0&&delete n.sessions[r]}})()}getEndToEndInboundGroupSession(e,n,r,i){var s=X2(e,n);i(this.inboundGroupSessions[s]||null,this.inboundGroupSessionsWithheld[s]||null)}storeEndToEndInboundGroupSession(e,n,r,i){var s=X2(e,n);this.inboundGroupSessions[s]=r}countEndToEndInboundGroupSessions(){var e=this;return B(function*(){return Object.keys(e.inboundGroupSessions).length})()}getEndToEndInboundGroupSessionsBatch(){var e=this;return B(function*(){var n=[];for(var[r,i]of Object.entries(e.inboundGroupSessions))if(n.push(l$(l$({},Cve(r)),{},{sessionData:i,needsBackup:r in e.sessionsNeedingBackup})),n.length>=wv)return n;return n.length===0?null:n})()}deleteEndToEndInboundGroupSessionsBatch(e){var n=this;return B(function*(){for(var{senderKey:r,sessionId:i}of e){var s=X2(r,i);delete n.inboundGroupSessions[s]}})()}getEndToEndRooms(e,n){n(this.rooms)}markSessionsNeedingBackup(e){for(var n of e){var r=X2(n.senderKey,n.sessionId);this.sessionsNeedingBackup[r]=!0}return Promise.resolve()}doTxn(e,n,r){return Promise.resolve(r(null))}}var Tve=/^(?:(?:\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})|(?:\[[\dA-Fa-f:.]{2,45}])|(?:[A-Za-z\d\-.]{1,255}))(?::\d{1,5})?$/;function Rve(t){var e=Tve.exec(t);return e?.[0]===t}var kve=/^[\w-]+$/;function Ive(t){var e=kve.exec(t);return e?.[0]===t}function yT(t,e,n,r,i){var s=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!1,o=arguments.length>6?arguments[6]:void 0,a=arguments.length>7?arguments[7]:void 0;if(typeof e!="string"||!e)return"";if(!e.startsWith("mxc://"))return s?e:"";var[c,l,...d]=e.slice(6).split("/");if(d.length>0||!Rve(c)||!Ive(l))return"";a&&(o=!0);var h,m=!!n||!!r||!!i,g=m?"thumbnail":"download";a?h="/_matrix/client/v1/media/".concat(g):h="/_matrix/media/v3/".concat(g);var y=new URL("".concat(h,"/").concat(c,"/").concat(l),t);return n&&y.searchParams.set("width",Math.round(n).toString()),r&&y.searchParams.set("height",Math.round(r).toString()),i&&y.searchParams.set("method",i),typeof o=="boolean"&&y.searchParams.set("allow_redirect",JSON.stringify(o)),y.href}var mE={exports:{}},xve=mE.exports,u$;function Ave(){return u$||(u$=1,(function(t){(function(e,n){t.exports?t.exports=n():e.log=n()})(xve,function(){var e=function(){},n="undefined",r=typeof window!==n&&typeof window.navigator!==n&&/Trident\/|MSIE /.test(window.navigator.userAgent),i=["trace","debug","info","warn","error"],s={},o=null;function a(v,E){var w=v[E];if(typeof w.bind=="function")return w.bind(v);try{return Function.prototype.bind.call(w,v)}catch{return function(){return Function.prototype.apply.apply(w,[v,arguments])}}}function c(){console.log&&(console.log.apply?console.log.apply(console,arguments):Function.prototype.apply.apply(console.log,[console,arguments])),console.trace&&console.trace()}function l(v){return v==="debug"&&(v="log"),typeof console===n?!1:v==="trace"&&r?c:console[v]!==void 0?a(console,v):console.log!==void 0?a(console,"log"):e}function d(){for(var v=this.getLevel(),E=0;E<i.length;E++){var w=i[E];this[w]=E<v?e:this.methodFactory(w,v,this.name)}if(this.log=this.debug,typeof console===n&&v<this.levels.SILENT)return"No console available for logging"}function h(v){return function(){typeof console!==n&&(d.call(this),this[v].apply(this,arguments))}}function m(v,E,w){return l(v)||h.apply(this,arguments)}function g(v,E){var w=this,k,x,C,R="loglevel";typeof v=="string"?R+=":"+v:typeof v=="symbol"&&(R=void 0);function T(j){var $=(i[j]||"silent").toUpperCase();if(!(typeof window===n||!R)){try{window.localStorage[R]=$;return}catch{}try{window.document.cookie=encodeURIComponent(R)+"="+$+";"}catch{}}}function M(){var j;if(!(typeof window===n||!R)){try{j=window.localStorage[R]}catch{}if(typeof j===n)try{var $=window.document.cookie,q=encodeURIComponent(R),Y=$.indexOf(q+"=");Y!==-1&&(j=/^([^;]+)/.exec($.slice(Y+q.length+1))[1])}catch{}return w.levels[j]===void 0&&(j=void 0),j}}function O(){if(!(typeof window===n||!R)){try{window.localStorage.removeItem(R)}catch{}try{window.document.cookie=encodeURIComponent(R)+"=; expires=Thu, 01 Jan 1970 00:00:00 UTC"}catch{}}}function P(j){var $=j;if(typeof $=="string"&&w.levels[$.toUpperCase()]!==void 0&&($=w.levels[$.toUpperCase()]),typeof $=="number"&&$>=0&&$<=w.levels.SILENT)return $;throw new TypeError("log.setLevel() called with invalid level: "+j)}w.name=v,w.levels={TRACE:0,DEBUG:1,INFO:2,WARN:3,ERROR:4,SILENT:5},w.methodFactory=E||m,w.getLevel=function(){return C??x??k},w.setLevel=function(j,$){return C=P(j),$!==!1&&T(C),d.call(w)},w.setDefaultLevel=function(j){x=P(j),M()||w.setLevel(j,!1)},w.resetLevel=function(){C=null,O(),d.call(w)},w.enableAll=function(j){w.setLevel(w.levels.TRACE,j)},w.disableAll=function(j){w.setLevel(w.levels.SILENT,j)},w.rebuild=function(){if(o!==w&&(k=P(o.getLevel())),d.call(w),o===w)for(var j in s)s[j].rebuild()},k=P(o?o.getLevel():"WARN");var D=M();D!=null&&(C=P(D)),d.call(w)}o=new g,o.getLogger=function(E){if(typeof E!="symbol"&&typeof E!="string"||E==="")throw new TypeError("You must supply a name when creating a logger.");var w=s[E];return w||(w=s[E]=new g(E,o.methodFactory)),w};var y=typeof window!==n?window.log:void 0;return o.noConflict=function(){return typeof window!==n&&window.log===o&&(window.log=y),o},o.getLoggers=function(){return s},o.default=o,o})})(mE)),mE.exports}var Mve=Ave();const gA=Dl(Mve);var Lve="matrix";gA.methodFactory=function(t,e,n){return function(){for(var r=arguments.length,i=new Array(r),s=0;s<r;s++)i[s]=arguments[s];this.prefix&&i.unshift(this.prefix);var o=t==="error"||t==="warn"||t==="trace"||t==="info"||t==="debug";return o?console[t](...i):console.log(...i)}};function jJ(t){var e=Lve+(t===void 0?"":"-".concat(t)),n=gA.getLogger(e);return n.getChild===void 0&&(n.prefix=t,n.getChild=r=>{var i=jJ((t??"")+r);return i.methodFactory=n.methodFactory,i.rebuild(),i},n.setLevel(gA.levels.DEBUG,!1)),n}var N=jJ();class dat{constructor(e,n){this.parent=e,L(this,"name",void 0),this.name=n+":"}trace(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];this.parent.trace(this.name,...n)}debug(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];this.parent.debug(this.name,...n)}info(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];this.parent.info(this.name,...n)}warn(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];this.parent.warn(this.name,...n)}error(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];this.parent.error(this.name,...n)}}class JO{constructor(e){this.debugInstance=e}trace(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];this.debugWithPrefix("[TRACE]",...n)}debug(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];this.debugWithPrefix("[DEBUG]",...n)}info(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];this.debugWithPrefix("[INFO]",...n)}warn(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];this.debugWithPrefix("[WARN]",...n)}error(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];this.debugWithPrefix("[ERROR]",...n)}getChild(e){return new JO(this.debugInstance.extend(e))}debugWithPrefix(e){for(var n,r=arguments.length,i=new Array(r>1?r-1:0),s=1;s<r;s++)i[s-1]=arguments[s];if(i.length===0)n="";else if(i[0]instanceof Error){var o=i.shift();n=o.stack||o.message}else typeof i[0]=="string"?n=i.shift():n="%O";this.debugInstance(e+" "+n,...i)}}var Q2={exports:{}},d$;function Ove(){if(d$)return Q2.exports;d$=1;var t=typeof Reflect=="object"?Reflect:null,e=t&&typeof t.apply=="function"?t.apply:function(R,T,M){return Function.prototype.apply.call(R,T,M)},n;t&&typeof t.ownKeys=="function"?n=t.ownKeys:Object.getOwnPropertySymbols?n=function(R){return Object.getOwnPropertyNames(R).concat(Object.getOwnPropertySymbols(R))}:n=function(R){return Object.getOwnPropertyNames(R)};function r(C){console&&console.warn&&console.warn(C)}var i=Number.isNaN||function(R){return R!==R};function s(){s.init.call(this)}Q2.exports=s,Q2.exports.once=w,s.EventEmitter=s,s.prototype._events=void 0,s.prototype._eventsCount=0,s.prototype._maxListeners=void 0;var o=10;function a(C){if(typeof C!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof C)}Object.defineProperty(s,"defaultMaxListeners",{enumerable:!0,get:function(){return o},set:function(C){if(typeof C!="number"||C<0||i(C))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+C+".");o=C}}),s.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},s.prototype.setMaxListeners=function(R){if(typeof R!="number"||R<0||i(R))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+R+".");return this._maxListeners=R,this};function c(C){return C._maxListeners===void 0?s.defaultMaxListeners:C._maxListeners}s.prototype.getMaxListeners=function(){return c(this)},s.prototype.emit=function(R){for(var T=[],M=1;M<arguments.length;M++)T.push(arguments[M]);var O=R==="error",P=this._events;if(P!==void 0)O=O&&P.error===void 0;else if(!O)return!1;if(O){var D;if(T.length>0&&(D=T[0]),D instanceof Error)throw D;var j=new Error("Unhandled error."+(D?" ("+D.message+")":""));throw j.context=D,j}var $=P[R];if($===void 0)return!1;if(typeof $=="function")e($,this,T);else for(var q=$.length,Y=y($,q),M=0;M<q;++M)e(Y[M],this,T);return!0};function l(C,R,T,M){var O,P,D;if(a(T),P=C._events,P===void 0?(P=C._events=Object.create(null),C._eventsCount=0):(P.newListener!==void 0&&(C.emit("newListener",R,T.listener?T.listener:T),P=C._events),D=P[R]),D===void 0)D=P[R]=T,++C._eventsCount;else if(typeof D=="function"?D=P[R]=M?[T,D]:[D,T]:M?D.unshift(T):D.push(T),O=c(C),O>0&&D.length>O&&!D.warned){D.warned=!0;var j=new Error("Possible EventEmitter memory leak detected. "+D.length+" "+String(R)+" listeners added. Use emitter.setMaxListeners() to increase limit");j.name="MaxListenersExceededWarning",j.emitter=C,j.type=R,j.count=D.length,r(j)}return C}s.prototype.addListener=function(R,T){return l(this,R,T,!1)},s.prototype.on=s.prototype.addListener,s.prototype.prependListener=function(R,T){return l(this,R,T,!0)};function d(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function h(C,R,T){var M={fired:!1,wrapFn:void 0,target:C,type:R,listener:T},O=d.bind(M);return O.listener=T,M.wrapFn=O,O}s.prototype.once=function(R,T){return a(T),this.on(R,h(this,R,T)),this},s.prototype.prependOnceListener=function(R,T){return a(T),this.prependListener(R,h(this,R,T)),this},s.prototype.removeListener=function(R,T){var M,O,P,D,j;if(a(T),O=this._events,O===void 0)return this;if(M=O[R],M===void 0)return this;if(M===T||M.listener===T)--this._eventsCount===0?this._events=Object.create(null):(delete O[R],O.removeListener&&this.emit("removeListener",R,M.listener||T));else if(typeof M!="function"){for(P=-1,D=M.length-1;D>=0;D--)if(M[D]===T||M[D].listener===T){j=M[D].listener,P=D;break}if(P<0)return this;P===0?M.shift():v(M,P),M.length===1&&(O[R]=M[0]),O.removeListener!==void 0&&this.emit("removeListener",R,j||T)}return this},s.prototype.off=s.prototype.removeListener,s.prototype.removeAllListeners=function(R){var T,M,O;if(M=this._events,M===void 0)return this;if(M.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):M[R]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete M[R]),this;if(arguments.length===0){var P=Object.keys(M),D;for(O=0;O<P.length;++O)D=P[O],D!=="removeListener"&&this.removeAllListeners(D);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(T=M[R],typeof T=="function")this.removeListener(R,T);else if(T!==void 0)for(O=T.length-1;O>=0;O--)this.removeListener(R,T[O]);return this};function m(C,R,T){var M=C._events;if(M===void 0)return[];var O=M[R];return O===void 0?[]:typeof O=="function"?T?[O.listener||O]:[O]:T?E(O):y(O,O.length)}s.prototype.listeners=function(R){return m(this,R,!0)},s.prototype.rawListeners=function(R){return m(this,R,!1)},s.listenerCount=function(C,R){return typeof C.listenerCount=="function"?C.listenerCount(R):g.call(C,R)},s.prototype.listenerCount=g;function g(C){var R=this._events;if(R!==void 0){var T=R[C];if(typeof T=="function")return 1;if(T!==void 0)return T.length}return 0}s.prototype.eventNames=function(){return this._eventsCount>0?n(this._events):[]};function y(C,R){for(var T=new Array(R),M=0;M<R;++M)T[M]=C[M];return T}function v(C,R){for(;R+1<C.length;R++)C[R]=C[R+1];C.pop()}function E(C){for(var R=new Array(C.length),T=0;T<R.length;++T)R[T]=C[T].listener||C[T];return R}function w(C,R){return new Promise(function(T,M){function O(D){C.removeListener(R,P),M(D)}function P(){typeof C.removeListener=="function"&&C.removeListener("error",O),T([].slice.call(arguments))}x(C,R,P,{once:!0}),R!=="error"&&k(C,O,{once:!0})})}function k(C,R,T){typeof C.on=="function"&&x(C,"error",R,T)}function x(C,R,T,M){if(typeof C.on=="function")M.once?C.once(R,T):C.on(R,T);else if(typeof C.addEventListener=="function")C.addEventListener(R,function O(P){M.once&&C.removeEventListener(R,O),T(P)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof C)}return Q2.exports}var bT=Ove();const FJ=Dl(bT);var $J=(function(t){return t.NewListener="newListener",t.RemoveListener="removeListener",t.Error="error",t})({});class Kn extends bT.EventEmitter{addListener(e,n){return super.addListener(e,n)}emit(e){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return super.emit(e,...r)}emitPromised(e){var n=arguments,r=this;return B(function*(){for(var i=n.length,s=new Array(i>1?i-1:0),o=1;o<i;o++)s[o-1]=n[o];var a=r.listeners(e);return Promise.allSettled(a.map(c=>c(...s))).then(()=>a.length>0)})()}listenerCount(e){return super.listenerCount(e)}listeners(e){return super.listeners(e)}off(e,n){return super.off(e,n)}on(e,n){return super.on(e,n)}once(e,n){return super.once(e,n)}prependListener(e,n){return super.prependListener(e,n)}prependOnceListener(e,n){return super.prependOnceListener(e,n)}removeAllListeners(e){return e===void 0?super.removeAllListeners():super.removeAllListeners(e)}removeListener(e,n){return super.removeListener(e,n)}rawListeners(e){return super.rawListeners(e)}}var Z=(function(t){return t.RoomCanonicalAlias="m.room.canonical_alias",t.RoomCreate="m.room.create",t.RoomJoinRules="m.room.join_rules",t.RoomMember="m.room.member",t.RoomThirdPartyInvite="m.room.third_party_invite",t.RoomPowerLevels="m.room.power_levels",t.RoomName="m.room.name",t.RoomTopic="m.room.topic",t.RoomAvatar="m.room.avatar",t.RoomPinnedEvents="m.room.pinned_events",t.RoomEncryption="m.room.encryption",t.RoomHistoryVisibility="m.room.history_visibility",t.RoomGuestAccess="m.room.guest_access",t.RoomServerAcl="m.room.server_acl",t.RoomTombstone="m.room.tombstone",t.RoomPredecessor="org.matrix.msc3946.room_predecessor",t.PolicyRuleUser="m.policy.rule.user",t.PolicyRuleRoom="m.policy.rule.room",t.PolicyRuleServer="m.policy.rule.server",t.SpaceChild="m.space.child",t.SpaceParent="m.space.parent",t.RoomRedaction="m.room.redaction",t.RoomMessage="m.room.message",t.RoomMessageEncrypted="m.room.encrypted",t.Sticker="m.sticker",t.CallInvite="m.call.invite",t.CallCandidates="m.call.candidates",t.CallAnswer="m.call.answer",t.CallHangup="m.call.hangup",t.CallReject="m.call.reject",t.CallSelectAnswer="m.call.select_answer",t.CallNegotiate="m.call.negotiate",t.CallSDPStreamMetadataChanged="m.call.sdp_stream_metadata_changed",t.CallSDPStreamMetadataChangedPrefix="org.matrix.call.sdp_stream_metadata_changed",t.CallReplaces="m.call.replaces",t.CallAssertedIdentity="m.call.asserted_identity",t.CallAssertedIdentityPrefix="org.matrix.call.asserted_identity",t.CallEncryptionKeysPrefix="io.element.call.encryption_keys",t.KeyVerificationRequest="m.key.verification.request",t.KeyVerificationStart="m.key.verification.start",t.KeyVerificationCancel="m.key.verification.cancel",t.KeyVerificationMac="m.key.verification.mac",t.KeyVerificationDone="m.key.verification.done",t.KeyVerificationKey="m.key.verification.key",t.KeyVerificationAccept="m.key.verification.accept",t.KeyVerificationReady="m.key.verification.ready",t.RoomMessageFeedback="m.room.message.feedback",t.Reaction="m.reaction",t.PollStart="org.matrix.msc3381.poll.start",t.Typing="m.typing",t.Receipt="m.receipt",t.Presence="m.presence",t.FullyRead="m.fully_read",t.Tag="m.tag",t.SpaceOrder="org.matrix.msc3230.space_order",t.PushRules="m.push_rules",t.Direct="m.direct",t.IgnoredUserList="m.ignored_user_list",t.InvitePermissionConfig="m.invite_permission_config",t.RoomKey="m.room_key",t.RoomKeyRequest="m.room_key_request",t.ForwardedRoomKey="m.forwarded_room_key",t.Dummy="m.dummy",t.SecretRequest="m.secret.request",t.SecretSend="m.secret.send",t.GroupCallPrefix="org.matrix.msc3401.call",t.GroupCallMemberPrefix="org.matrix.msc3401.call.member",t.RTCMembership="org.matrix.msc4143.rtc.member",t.CallNotify="org.matrix.msc4075.call.notify",t.RTCNotification="org.matrix.msc4075.rtc.notification",t.RTCDecline="org.matrix.msc4310.rtc.decline",t.RoomPolicy="org.matrix.msc4284.policy",t})({}),bn=(function(t){return t.Annotation="m.annotation",t.Replace="m.replace",t.Reference="m.reference",t.Thread="m.thread",t})({}),Nl=(function(t){return t.Text="m.text",t.Emote="m.emote",t.Notice="m.notice",t.Image="m.image",t.File="m.file",t.Audio="m.audio",t.Location="m.location",t.Video="m.video",t.KeyVerificationRequest="m.key.verification.request",t})({}),TC="type",zg=(function(t){return t.Space="m.space",t.UnstableCall="org.matrix.msc3417.call",t.ElementVideo="io.element.video",t})({}),_T="org.matrix.msgid",vA=new qr("m.room.purpose","org.matrix.msc3088.purpose"),yA=new qr("m.enabled","org.matrix.msc3088.enabled"),bA=new qr("m.data_tree","org.matrix.msc3089.data_tree"),BJ=new qr("m.leaf","org.matrix.msc3089.leaf"),Iu=new qr("m.branch","org.matrix.msc3089.branch"),HJ=new qr("m.room.marker","org.matrix.msc2716.marker"),_A=new qr("with_rel_types","org.matrix.msc3912.with_relations"),qJ=new qr("io.element.functional_members","io.element.functional_members"),sp=new qr("m.visibility","org.matrix.msc3531.visibility"),SA=new qr("enabled","org.matrix.msc3881.enabled"),Pve=new qr("device_id","org.matrix.msc3881.device_id"),VJ=new qr("m.local_notification_settings","org.matrix.msc3890.local_notification_settings"),RC=new qr("thread_id","org.matrix.msc4023.thread_id"),KJ=new sy("membership","io.element.msc4115.membership"),Ve=(function(t){return t.Ban="ban",t.Invite="invite",t.Join="join",t.Knock="knock",t.Leave="leave",t})({}),fo=(function(t){return t.Membership="RoomMember.membership",t.Name="RoomMember.name",t.PowerLevel="RoomMember.powerLevel",t.Typing="RoomMember.typing",t})({});class Ab extends Kn{constructor(e,n){super(),this.roomId=e,this.userId=n,L(this,"_isOutOfBand",!1),L(this,"modified",-1),L(this,"requestedProfileInfo",!1),L(this,"typing",!1),L(this,"name",void 0),L(this,"rawDisplayName",void 0),L(this,"powerLevel",0),L(this,"user",void 0),L(this,"membership",void 0),L(this,"disambiguate",!1),L(this,"events",{}),this.name=n,this.rawDisplayName=n,this.updateModifiedTime()}markOutOfBand(){this._isOutOfBand=!0}isOutOfBand(){return this._isOutOfBand}setMembershipEvent(e,n){var r,i,s=(r=e.getDirectionalContent().displayname)!==null&&r!==void 0?r:"";if(e.getType()===Z.RoomMember){this._isOutOfBand=!1,this.events.member=e;var o=this.membership;this.membership=e.getDirectionalContent().membership,this.membership===void 0&&N.trace("membership event with membership undefined (forwardLooking: ".concat(e.forwardLooking,")!"),e.getContent(),"prevcontent is ",e.getPrevContent()),this.disambiguate=Nve(this.userId,s,n);var a=this.name;this.name=Uve(this.userId,s,this.disambiguate),this.rawDisplayName=wC((i=e.getDirectionalContent().displayname)!==null&&i!==void 0?i:""),(!this.rawDisplayName||!Tf(this.rawDisplayName))&&(this.rawDisplayName=this.userId),o!==this.membership&&(this.updateModifiedTime(),this.emit(fo.Membership,e,this,o)),a!==this.name&&(this.updateModifiedTime(),this.emit(fo.Name,e,this,a))}}setPowerLevel(e,n){var r=this.powerLevel;this.powerLevel=e,r!==this.powerLevel&&(this.updateModifiedTime(),this.emit(fo.PowerLevel,n,this))}setTypingEvent(e){if(e.getType()==="m.typing"){var n=this.typing;this.typing=!1;var r=e.getContent().user_ids;Array.isArray(r)&&(r.indexOf(this.userId)!==-1&&(this.typing=!0),n!==this.typing&&(this.updateModifiedTime(),this.emit(fo.Typing,e,this)))}}updateModifiedTime(){this.modified=Date.now()}getLastModifiedTime(){return this.modified}isKicked(){return this.membership===Ve.Leave&&this.events.member!==void 0&&this.events.member.getSender()!==this.events.member.getStateKey()}getDMInviter(){if(this.events.member){var e=this.events.member,n=e.getContent(),r=e.getSender();if(n.membership===Ve.Join&&(n=e.getPrevContent(),r=e.getUnsigned().prev_sender),n.membership===Ve.Invite&&n.is_direct)return r}}getAvatarUrl(e,n,r,i){var s=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,o=arguments.length>5?arguments[5]:void 0,a=arguments.length>6&&arguments[6]!==void 0?arguments[6]:!1,c=this.getMxcAvatarUrl();if(!c&&!s)return null;var l=yT(e,c,n,r,i,o,void 0,a);return l||null}getMxcAvatarUrl(){if(this.events.member)return this.events.member.getDirectionalContent().avatar_url;if(this.user)return this.user.avatarUrl}}var XO=/@.+:.+/,Dve=/[\u200E\u200F\u202A-\u202F]/;function Nve(t,e,n){if(!e||e===t||!n)return!1;var r=Tf(e);if(!r)return!1;if(XO.test(r)||Dve.test(e))return!0;var i=n.getUserIdsWithDisplayName(e);return!!i.some(s=>s!==t)}function Uve(t,e,n){return!e||e===t?t:n?wC(e)+" ("+t+")":Tf(e)?wC(e):t}var ZI={},j0={},F0={},f$;function GJ(){if(f$)return F0;f$=1,Object.defineProperty(F0,"__esModule",{value:!0}),F0.NamespacedMap=void 0;function t(c,l){var d=typeof Symbol<"u"&&c[Symbol.iterator]||c["@@iterator"];if(!d){if(Array.isArray(c)||(d=e(c))||l){d&&(c=d);var h=0,m=function(){};return{s:m,n:function(){return h>=c.length?{done:!0}:{done:!1,value:c[h++]}},e:function(w){throw w},f:m}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
3
3
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var g=!0,y=!1,v;return{s:function(){d=d.call(c)},n:function(){var w=d.next();return g=w.done,w},e:function(w){y=!0,v=w},f:function(){try{!g&&d.return!=null&&d.return()}finally{if(y)throw v}}}}function e(c,l){if(c){if(typeof c=="string")return n(c,l);var d=Object.prototype.toString.call(c).slice(8,-1);if(d==="Object"&&c.constructor&&(d=c.constructor.name),d==="Map"||d==="Set")return Array.from(c);if(d==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(d))return n(c,l)}}function n(c,l){(l==null||l>c.length)&&(l=c.length);for(var d=0,h=new Array(l);d<l;d++)h[d]=c[d];return h}function r(c,l){if(!(c instanceof l))throw new TypeError("Cannot call a class as a function")}function i(c,l){for(var d=0;d<l.length;d++){var h=l[d];h.enumerable=h.enumerable||!1,h.configurable=!0,"value"in h&&(h.writable=!0),Object.defineProperty(c,h.key,h)}}function s(c,l,d){return l&&i(c.prototype,l),Object.defineProperty(c,"prototype",{writable:!1}),c}function o(c,l,d){return l in c?Object.defineProperty(c,l,{value:d,enumerable:!0,configurable:!0,writable:!0}):c[l]=d,c}var a=(function(){function c(l){if(r(this,c),o(this,"internalMap",new Map),l){var d=t(l),h;try{for(d.s();!(h=d.n()).done;){var m=h.value;this.set(m[0],m[1])}}catch(g){d.e(g)}finally{d.f()}}}return s(c,[{key:"get",value:function(d){return d.name&&this.internalMap.has(d.name)?this.internalMap.get(d.name):d.altName&&this.internalMap.has(d.altName)?this.internalMap.get(d.altName):null}},{key:"set",value:function(d,h){d.name&&this.internalMap.set(d.name,h),d.altName&&this.internalMap.set(d.altName,h)}},{key:"has",value:function(d){return!!this.get(d)}},{key:"delete",value:function(d){d.name&&this.internalMap.delete(d.name),d.altName&&this.internalMap.delete(d.altName)}},{key:"hasNamespaced",value:function(d){return this.internalMap.has(d)}},{key:"getNamespaced",value:function(d){return this.internalMap.get(d)}}]),c})();return F0.NamespacedMap=a,F0}var $0={},h$;function oy(){if(h$)return $0;h$=1;function t(y){"@babel/helpers - typeof";return t=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(v){return typeof v}:function(v){return v&&typeof Symbol=="function"&&v.constructor===Symbol&&v!==Symbol.prototype?"symbol":typeof v},t(y)}Object.defineProperty($0,"__esModule",{value:!0}),$0.InvalidEventError=void 0;function e(y,v,E){return Object.defineProperty(y,"prototype",{writable:!1}),y}function n(y,v){if(!(y instanceof v))throw new TypeError("Cannot call a class as a function")}function r(y,v){if(typeof v!="function"&&v!==null)throw new TypeError("Super expression must either be null or a function");y.prototype=Object.create(v&&v.prototype,{constructor:{value:y,writable:!0,configurable:!0}}),Object.defineProperty(y,"prototype",{writable:!1}),v&&h(y,v)}function i(y){var v=l();return function(){var w=m(y),k;if(v){var x=m(this).constructor;k=Reflect.construct(w,arguments,x)}else k=w.apply(this,arguments);return s(this,k)}}function s(y,v){if(v&&(t(v)==="object"||typeof v=="function"))return v;if(v!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return o(y)}function o(y){if(y===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return y}function a(y){var v=typeof Map=="function"?new Map:void 0;return a=function(w){if(w===null||!d(w))return w;if(typeof w!="function")throw new TypeError("Super expression must either be null or a function");if(typeof v<"u"){if(v.has(w))return v.get(w);v.set(w,k)}function k(){return c(w,arguments,m(this).constructor)}return k.prototype=Object.create(w.prototype,{constructor:{value:k,enumerable:!1,writable:!0,configurable:!0}}),h(k,w)},a(y)}function c(y,v,E){return l()?c=Reflect.construct:c=function(k,x,C){var R=[null];R.push.apply(R,x);var T=Function.bind.apply(k,R),M=new T;return C&&h(M,C.prototype),M},c.apply(null,arguments)}function l(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function d(y){return Function.toString.call(y).indexOf("[native code]")!==-1}function h(y,v){return h=Object.setPrototypeOf||function(w,k){return w.__proto__=k,w},h(y,v)}function m(y){return m=Object.setPrototypeOf?Object.getPrototypeOf:function(E){return E.__proto__||Object.getPrototypeOf(E)},m(y)}var g=(function(y){r(E,y);var v=i(E);function E(w){return n(this,E),v.call(this,w)}return e(E)})(a(Error));return $0.InvalidEventError=g,$0}var ag={},B0={},H0={},p$;function $_(){if(p$)return H0;p$=1,Object.defineProperty(H0,"__esModule",{value:!0}),H0.ExtensibleEvent=void 0;function t(i,s){if(!(i instanceof s))throw new TypeError("Cannot call a class as a function")}function e(i,s){for(var o=0;o<s.length;o++){var a=s[o];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(i,a.key,a)}}function n(i,s,o){return s&&e(i.prototype,s),Object.defineProperty(i,"prototype",{writable:!1}),i}var r=(function(){function i(s){t(this,i),this.wireFormat=s}return n(i,[{key:"wireContent",get:function(){return this.wireFormat.content}}]),i})();return H0.ExtensibleEvent=r,H0}var q0={},m$;function zJ(){if(m$)return q0;m$=1,Object.defineProperty(q0,"__esModule",{value:!0}),q0.isOptionalAString=t,q0.isProvided=e;function t(n){return e(n)&&typeof n=="string"}function e(n){return n!=null}return q0}var No={},Dh={},g$;function ay(){if(g$)return Dh;g$=1;function t(g){"@babel/helpers - typeof";return t=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(y){return typeof y}:function(y){return y&&typeof Symbol=="function"&&y.constructor===Symbol&&y!==Symbol.prototype?"symbol":typeof y},t(g)}Object.defineProperty(Dh,"__esModule",{value:!0}),Dh.UnstableValue=Dh.NamespacedValue=void 0;function e(g,y){if(typeof y!="function"&&y!==null)throw new TypeError("Super expression must either be null or a function");g.prototype=Object.create(y&&y.prototype,{constructor:{value:g,writable:!0,configurable:!0}}),Object.defineProperty(g,"prototype",{writable:!1}),y&&n(g,y)}function n(g,y){return n=Object.setPrototypeOf||function(E,w){return E.__proto__=w,E},n(g,y)}function r(g){var y=o();return function(){var E=a(g),w;if(y){var k=a(this).constructor;w=Reflect.construct(E,arguments,k)}else w=E.apply(this,arguments);return i(this,w)}}function i(g,y){if(y&&(t(y)==="object"||typeof y=="function"))return y;if(y!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return s(g)}function s(g){if(g===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return g}function o(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function a(g){return a=Object.setPrototypeOf?Object.getPrototypeOf:function(v){return v.__proto__||Object.getPrototypeOf(v)},a(g)}function c(g,y){if(!(g instanceof y))throw new TypeError("Cannot call a class as a function")}function l(g,y){for(var v=0;v<y.length;v++){var E=y[v];E.enumerable=E.enumerable||!1,E.configurable=!0,"value"in E&&(E.writable=!0),Object.defineProperty(g,E.key,E)}}function d(g,y,v){return y&&l(g.prototype,y),Object.defineProperty(g,"prototype",{writable:!1}),g}var h=(function(){function g(y,v){if(c(this,g),this.stable=y,this.unstable=v,!this.unstable&&!this.stable)throw new Error("One of stable or unstable values must be supplied")}return d(g,[{key:"name",get:function(){return this.stable?this.stable:this.unstable}},{key:"altName",get:function(){return this.stable?this.unstable:null}},{key:"matches",value:function(v){return!!this.name&&this.name===v||!!this.altName&&this.altName===v}},{key:"findIn",value:function(v){var E;return this.name&&(E=v?.[this.name]),!E&&this.altName&&(E=v?.[this.altName]),E}},{key:"includedIn",value:function(v){var E=!1;return this.name&&(E=v.includes(this.name)),!E&&this.altName&&(E=v.includes(this.altName)),E}}]),g})();Dh.NamespacedValue=h;var m=(function(g){e(v,g);var y=r(v);function v(E,w){var k;if(c(this,v),k=y.call(this,E,w),!k.unstable)throw new Error("Unstable value must be supplied");return k}return d(v,[{key:"name",get:function(){return this.unstable}},{key:"altName",get:function(){return this.stable}}]),v})(h);return Dh.UnstableValue=m,Dh}var v$;function Ul(){if(v$)return No;v$=1,Object.defineProperty(No,"__esModule",{value:!0}),No.M_TEXT=No.M_NOTICE=No.M_MESSAGE=No.M_HTML=No.M_EMOTE=void 0;var t=ay(),e=new t.UnstableValue("m.message","org.matrix.msc1767.message");No.M_MESSAGE=e;var n=new t.UnstableValue("m.text","org.matrix.msc1767.text");No.M_TEXT=n;var r=new t.UnstableValue("m.html","org.matrix.msc1767.html");No.M_HTML=r;var i=new t.UnstableValue("m.emote","org.matrix.msc1767.emote");No.M_EMOTE=i;var s=new t.UnstableValue("m.notice","org.matrix.msc1767.notice");return No.M_NOTICE=s,No}var Z2={},y$;function Yp(){if(y$)return Z2;y$=1,Object.defineProperty(Z2,"__esModule",{value:!0}),Z2.isEventTypeSame=t;function t(e,n){if(typeof e=="string")return typeof n=="string"?n===e:n.matches(e);if(typeof n=="string")return e.matches(n);var r=n,i=e;return r.matches(i.name)||r.matches(i.altName)}return Z2}var b$;function Jp(){if(b$)return B0;b$=1;function t(C){"@babel/helpers - typeof";return t=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(R){return typeof R}:function(R){return R&&typeof Symbol=="function"&&R.constructor===Symbol&&R!==Symbol.prototype?"symbol":typeof R},t(C)}Object.defineProperty(B0,"__esModule",{value:!0}),B0.MessageEvent=void 0;var e=$_(),n=zJ(),r=oy(),i=Ul(),s=Yp();function o(C,R){var T=Object.keys(C);if(Object.getOwnPropertySymbols){var M=Object.getOwnPropertySymbols(C);R&&(M=M.filter(function(O){return Object.getOwnPropertyDescriptor(C,O).enumerable})),T.push.apply(T,M)}return T}function a(C){for(var R=1;R<arguments.length;R++){var T=arguments[R]!=null?arguments[R]:{};R%2?o(Object(T),!0).forEach(function(M){k(C,M,T[M])}):Object.getOwnPropertyDescriptors?Object.defineProperties(C,Object.getOwnPropertyDescriptors(T)):o(Object(T)).forEach(function(M){Object.defineProperty(C,M,Object.getOwnPropertyDescriptor(T,M))})}return C}function c(C,R){if(!(C instanceof R))throw new TypeError("Cannot call a class as a function")}function l(C,R){for(var T=0;T<R.length;T++){var M=R[T];M.enumerable=M.enumerable||!1,M.configurable=!0,"value"in M&&(M.writable=!0),Object.defineProperty(C,M.key,M)}}function d(C,R,T){return R&&l(C.prototype,R),T&&l(C,T),Object.defineProperty(C,"prototype",{writable:!1}),C}function h(C,R){if(typeof R!="function"&&R!==null)throw new TypeError("Super expression must either be null or a function");C.prototype=Object.create(R&&R.prototype,{constructor:{value:C,writable:!0,configurable:!0}}),Object.defineProperty(C,"prototype",{writable:!1}),R&&m(C,R)}function m(C,R){return m=Object.setPrototypeOf||function(M,O){return M.__proto__=O,M},m(C,R)}function g(C){var R=E();return function(){var M=w(C),O;if(R){var P=w(this).constructor;O=Reflect.construct(M,arguments,P)}else O=M.apply(this,arguments);return y(this,O)}}function y(C,R){if(R&&(t(R)==="object"||typeof R=="function"))return R;if(R!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return v(C)}function v(C){if(C===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return C}function E(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function w(C){return w=Object.setPrototypeOf?Object.getPrototypeOf:function(T){return T.__proto__||Object.getPrototypeOf(T)},w(C)}function k(C,R,T){return R in C?Object.defineProperty(C,R,{value:T,enumerable:!0,configurable:!0,writable:!0}):C[R]=T,C}var x=(function(C){h(T,C);var R=g(T);function T(M){var O;c(this,T),O=R.call(this,M),k(v(O),"text",void 0),k(v(O),"html",void 0),k(v(O),"renderings",void 0);var P=i.M_MESSAGE.findIn(O.wireContent),D=i.M_TEXT.findIn(O.wireContent),j=i.M_HTML.findIn(O.wireContent);if((0,n.isProvided)(P)){if(!Array.isArray(P))throw new r.InvalidEventError("m.message contents must be an array");var $=P.find(function(Y){return!(0,n.isProvided)(Y.mimetype)||Y.mimetype==="text/plain"}),q=P.find(function(Y){return Y.mimetype==="text/html"});if(!$)throw new r.InvalidEventError("m.message is missing a plain text representation");O.text=$.body,O.html=q?.body,O.renderings=P}else if((0,n.isOptionalAString)(D))O.text=D,O.html=j,O.renderings=[{body:D,mimetype:"text/plain"}],O.html&&O.renderings.push({body:O.html,mimetype:"text/html"});else throw new r.InvalidEventError("Missing textual representation for event");return O}return d(T,[{key:"isEmote",get:function(){return i.M_EMOTE.matches(this.wireFormat.type)||(0,n.isProvided)(i.M_EMOTE.findIn(this.wireFormat.content))}},{key:"isNotice",get:function(){return i.M_NOTICE.matches(this.wireFormat.type)||(0,n.isProvided)(i.M_NOTICE.findIn(this.wireFormat.content))}},{key:"isEquivalentTo",value:function(O){return(0,s.isEventTypeSame)(O,i.M_MESSAGE)}},{key:"serializeMMessageOnly",value:function(){var O=k({},i.M_MESSAGE.name,this.renderings);if(this.renderings.length===1){var P=this.renderings[0].mimetype;(P===void 0||P==="text/plain")&&(O=k({},i.M_TEXT.name,this.renderings[0].body))}return O}},{key:"serialize",value:function(){var O;return{type:"m.room.message",content:a(a({},this.serializeMMessageOnly()),{},{body:this.text,msgtype:"m.text",format:this.html?"org.matrix.custom.html":void 0,formatted_body:(O=this.html)!==null&&O!==void 0?O:void 0})}}}],[{key:"from",value:function(O,P){var D;return new T({type:i.M_MESSAGE.name,content:(D={},k(D,i.M_TEXT.name,O),k(D,i.M_HTML.name,P),D)})}}]),T})(e.ExtensibleEvent);return B0.MessageEvent=x,B0}var V0={},_$;function QO(){if(_$)return V0;_$=1;function t(k){"@babel/helpers - typeof";return t=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(x){return typeof x}:function(x){return x&&typeof Symbol=="function"&&x.constructor===Symbol&&x!==Symbol.prototype?"symbol":typeof x},t(k)}Object.defineProperty(V0,"__esModule",{value:!0}),V0.NoticeEvent=void 0;var e=Jp(),n=Ul(),r=Yp();function i(k,x,C){return x in k?Object.defineProperty(k,x,{value:C,enumerable:!0,configurable:!0,writable:!0}):k[x]=C,k}function s(k,x){if(!(k instanceof x))throw new TypeError("Cannot call a class as a function")}function o(k,x){for(var C=0;C<x.length;C++){var R=x[C];R.enumerable=R.enumerable||!1,R.configurable=!0,"value"in R&&(R.writable=!0),Object.defineProperty(k,R.key,R)}}function a(k,x,C){return x&&o(k.prototype,x),C&&o(k,C),Object.defineProperty(k,"prototype",{writable:!1}),k}function c(){return typeof Reflect<"u"&&Reflect.get?c=Reflect.get:c=function(x,C,R){var T=l(x,C);if(T){var M=Object.getOwnPropertyDescriptor(T,C);return M.get?M.get.call(arguments.length<3?x:R):M.value}},c.apply(this,arguments)}function l(k,x){for(;!Object.prototype.hasOwnProperty.call(k,x)&&(k=E(k),k!==null););return k}function d(k,x){if(typeof x!="function"&&x!==null)throw new TypeError("Super expression must either be null or a function");k.prototype=Object.create(x&&x.prototype,{constructor:{value:k,writable:!0,configurable:!0}}),Object.defineProperty(k,"prototype",{writable:!1}),x&&h(k,x)}function h(k,x){return h=Object.setPrototypeOf||function(R,T){return R.__proto__=T,R},h(k,x)}function m(k){var x=v();return function(){var R=E(k),T;if(x){var M=E(this).constructor;T=Reflect.construct(R,arguments,M)}else T=R.apply(this,arguments);return g(this,T)}}function g(k,x){if(x&&(t(x)==="object"||typeof x=="function"))return x;if(x!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return y(k)}function y(k){if(k===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return k}function v(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function E(k){return E=Object.setPrototypeOf?Object.getPrototypeOf:function(C){return C.__proto__||Object.getPrototypeOf(C)},E(k)}var w=(function(k){d(C,k);var x=m(C);function C(R){return s(this,C),x.call(this,R)}return a(C,[{key:"isNotice",get:function(){return!0}},{key:"isEquivalentTo",value:function(T){return(0,r.isEventTypeSame)(T,n.M_NOTICE)||c(E(C.prototype),"isEquivalentTo",this).call(this,T)}},{key:"serialize",value:function(){var T=c(E(C.prototype),"serialize",this).call(this);return T.content.msgtype="m.notice",T}}],[{key:"from",value:function(T,M){var O;return new C({type:n.M_NOTICE.name,content:(O={},i(O,n.M_TEXT.name,T),i(O,n.M_HTML.name,M),O)})}}]),C})(e.MessageEvent);return V0.NoticeEvent=w,V0}var K0={},S$;function ZO(){if(S$)return K0;S$=1;function t(k){"@babel/helpers - typeof";return t=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(x){return typeof x}:function(x){return x&&typeof Symbol=="function"&&x.constructor===Symbol&&x!==Symbol.prototype?"symbol":typeof x},t(k)}Object.defineProperty(K0,"__esModule",{value:!0}),K0.EmoteEvent=void 0;var e=Jp(),n=Ul(),r=Yp();function i(k,x,C){return x in k?Object.defineProperty(k,x,{value:C,enumerable:!0,configurable:!0,writable:!0}):k[x]=C,k}function s(k,x){if(!(k instanceof x))throw new TypeError("Cannot call a class as a function")}function o(k,x){for(var C=0;C<x.length;C++){var R=x[C];R.enumerable=R.enumerable||!1,R.configurable=!0,"value"in R&&(R.writable=!0),Object.defineProperty(k,R.key,R)}}function a(k,x,C){return x&&o(k.prototype,x),C&&o(k,C),Object.defineProperty(k,"prototype",{writable:!1}),k}function c(){return typeof Reflect<"u"&&Reflect.get?c=Reflect.get:c=function(x,C,R){var T=l(x,C);if(T){var M=Object.getOwnPropertyDescriptor(T,C);return M.get?M.get.call(arguments.length<3?x:R):M.value}},c.apply(this,arguments)}function l(k,x){for(;!Object.prototype.hasOwnProperty.call(k,x)&&(k=E(k),k!==null););return k}function d(k,x){if(typeof x!="function"&&x!==null)throw new TypeError("Super expression must either be null or a function");k.prototype=Object.create(x&&x.prototype,{constructor:{value:k,writable:!0,configurable:!0}}),Object.defineProperty(k,"prototype",{writable:!1}),x&&h(k,x)}function h(k,x){return h=Object.setPrototypeOf||function(R,T){return R.__proto__=T,R},h(k,x)}function m(k){var x=v();return function(){var R=E(k),T;if(x){var M=E(this).constructor;T=Reflect.construct(R,arguments,M)}else T=R.apply(this,arguments);return g(this,T)}}function g(k,x){if(x&&(t(x)==="object"||typeof x=="function"))return x;if(x!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return y(k)}function y(k){if(k===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return k}function v(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function E(k){return E=Object.setPrototypeOf?Object.getPrototypeOf:function(C){return C.__proto__||Object.getPrototypeOf(C)},E(k)}var w=(function(k){d(C,k);var x=m(C);function C(R){return s(this,C),x.call(this,R)}return a(C,[{key:"isEmote",get:function(){return!0}},{key:"isEquivalentTo",value:function(T){return(0,r.isEventTypeSame)(T,n.M_EMOTE)||c(E(C.prototype),"isEquivalentTo",this).call(this,T)}},{key:"serialize",value:function(){var T=c(E(C.prototype),"serialize",this).call(this);return T.content.msgtype="m.emote",T}}],[{key:"from",value:function(T,M){var O;return new C({type:n.M_EMOTE.name,content:(O={},i(O,n.M_TEXT.name,T),i(O,n.M_HTML.name,M),O)})}}]),C})(e.MessageEvent);return K0.EmoteEvent=w,K0}var w$;function WJ(){if(w$)return ag;w$=1,Object.defineProperty(ag,"__esModule",{value:!0}),ag.LEGACY_M_ROOM_MESSAGE=void 0,ag.parseMRoomMessage=l;var t=Jp(),e=QO(),n=ZO(),r=ay(),i=Ul();function s(d,h){var m=Object.keys(d);if(Object.getOwnPropertySymbols){var g=Object.getOwnPropertySymbols(d);h&&(g=g.filter(function(y){return Object.getOwnPropertyDescriptor(d,y).enumerable})),m.push.apply(m,g)}return m}function o(d){for(var h=1;h<arguments.length;h++){var m=arguments[h]!=null?arguments[h]:{};h%2?s(Object(m),!0).forEach(function(g){a(d,g,m[g])}):Object.getOwnPropertyDescriptors?Object.defineProperties(d,Object.getOwnPropertyDescriptors(m)):s(Object(m)).forEach(function(g){Object.defineProperty(d,g,Object.getOwnPropertyDescriptor(m,g))})}return d}function a(d,h,m){return h in d?Object.defineProperty(d,h,{value:m,enumerable:!0,configurable:!0,writable:!0}):d[h]=m,d}var c=new r.NamespacedValue("m.room.message");ag.LEGACY_M_ROOM_MESSAGE=c;function l(d){var h,m,g;if(i.M_MESSAGE.findIn(d.content)||i.M_TEXT.findIn(d.content))return new t.MessageEvent(d);var y=(h=d.content)===null||h===void 0?void 0:h.msgtype,v=(m=d.content)===null||m===void 0?void 0:m.body,E=((g=d.content)===null||g===void 0?void 0:g.format)==="org.matrix.custom.html"?d.content.formatted_body:null;if(y==="m.text"){var w;return new t.MessageEvent(o(o({},d),{},{content:o(o({},d.content),{},(w={},a(w,i.M_TEXT.name,v),a(w,i.M_HTML.name,E),w))}))}else if(y==="m.notice"){var k;return new e.NoticeEvent(o(o({},d),{},{content:o(o({},d.content),{},(k={},a(k,i.M_TEXT.name,v),a(k,i.M_HTML.name,E),k))}))}else if(y==="m.emote"){var x;return new n.EmoteEvent(o(o({},d),{},{content:o(o({},d.content),{},(x={},a(x,i.M_TEXT.name,v),a(x,i.M_HTML.name,E),x))}))}else return null}return ag}var ew={},E$;function YJ(){if(E$)return ew;E$=1,Object.defineProperty(ew,"__esModule",{value:!0}),ew.parseMMessage=i;var t=Jp(),e=Ul(),n=ZO(),r=QO();function i(s){return e.M_EMOTE.matches(s.type)?new n.EmoteEvent(s):e.M_NOTICE.matches(s.type)?new r.NoticeEvent(s):new t.MessageEvent(s)}return ew}var Uo={},C$;function cy(){if(C$)return Uo;C$=1,Object.defineProperty(Uo,"__esModule",{value:!0}),Uo.M_POLL_START=Uo.M_POLL_RESPONSE=Uo.M_POLL_KIND_UNDISCLOSED=Uo.M_POLL_KIND_DISCLOSED=Uo.M_POLL_END=void 0;var t=ay(),e=new t.UnstableValue("m.poll.disclosed","org.matrix.msc3381.poll.disclosed");Uo.M_POLL_KIND_DISCLOSED=e;var n=new t.UnstableValue("m.poll.undisclosed","org.matrix.msc3381.poll.undisclosed");Uo.M_POLL_KIND_UNDISCLOSED=n;var r=new t.UnstableValue("m.poll.start","org.matrix.msc3381.poll.start");Uo.M_POLL_START=r;var i=new t.UnstableValue("m.poll.response","org.matrix.msc3381.poll.response");Uo.M_POLL_RESPONSE=i;var s=new t.UnstableValue("m.poll.end","org.matrix.msc3381.poll.end");return Uo.M_POLL_END=s,Uo}var tw={},Nh={},T$;function JJ(){if(T$)return Nh;T$=1;function t(W){"@babel/helpers - typeof";return t=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(H){return typeof H}:function(H){return H&&typeof Symbol=="function"&&H.constructor===Symbol&&H!==Symbol.prototype?"symbol":typeof H},t(W)}Object.defineProperty(Nh,"__esModule",{value:!0}),Nh.PollStartEvent=Nh.PollAnswerSubevent=void 0;var e=cy(),n=Jp(),r=Ul(),i=oy(),s=ay(),o=Yp(),a=$_();function c(W){return m(W)||h(W)||d(W)||l()}function l(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
4
4
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function d(W,H){if(W){if(typeof W=="string")return g(W,H);var F=Object.prototype.toString.call(W).slice(8,-1);if(F==="Object"&&W.constructor&&(F=W.constructor.name),F==="Map"||F==="Set")return Array.from(W);if(F==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(F))return g(W,H)}}function h(W){if(typeof Symbol<"u"&&W[Symbol.iterator]!=null||W["@@iterator"]!=null)return Array.from(W)}function m(W){if(Array.isArray(W))return g(W)}function g(W,H){(H==null||H>W.length)&&(H=W.length);for(var F=0,V=new Array(H);F<H;F++)V[F]=W[F];return V}function y(W,H){var F=Object.keys(W);if(Object.getOwnPropertySymbols){var V=Object.getOwnPropertySymbols(W);H&&(V=V.filter(function(G){return Object.getOwnPropertyDescriptor(W,G).enumerable})),F.push.apply(F,V)}return F}function v(W){for(var H=1;H<arguments.length;H++){var F=arguments[H]!=null?arguments[H]:{};H%2?y(Object(F),!0).forEach(function(V){D(W,V,F[V])}):Object.getOwnPropertyDescriptors?Object.defineProperties(W,Object.getOwnPropertyDescriptors(F)):y(Object(F)).forEach(function(V){Object.defineProperty(W,V,Object.getOwnPropertyDescriptor(F,V))})}return W}function E(W,H){if(!(W instanceof H))throw new TypeError("Cannot call a class as a function")}function w(W,H){for(var F=0;F<H.length;F++){var V=H[F];V.enumerable=V.enumerable||!1,V.configurable=!0,"value"in V&&(V.writable=!0),Object.defineProperty(W,V.key,V)}}function k(W,H,F){return H&&w(W.prototype,H),F&&w(W,F),Object.defineProperty(W,"prototype",{writable:!1}),W}function x(W,H){if(typeof H!="function"&&H!==null)throw new TypeError("Super expression must either be null or a function");W.prototype=Object.create(H&&H.prototype,{constructor:{value:W,writable:!0,configurable:!0}}),Object.defineProperty(W,"prototype",{writable:!1}),H&&C(W,H)}function C(W,H){return C=Object.setPrototypeOf||function(V,G){return V.__proto__=G,V},C(W,H)}function R(W){var H=O();return function(){var V=P(W),G;if(H){var ee=P(this).constructor;G=Reflect.construct(V,arguments,ee)}else G=V.apply(this,arguments);return T(this,G)}}function T(W,H){if(H&&(t(H)==="object"||typeof H=="function"))return H;if(H!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return M(W)}function M(W){if(W===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return W}function O(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function P(W){return P=Object.setPrototypeOf?Object.getPrototypeOf:function(F){return F.__proto__||Object.getPrototypeOf(F)},P(W)}function D(W,H,F){return H in W?Object.defineProperty(W,H,{value:F,enumerable:!0,configurable:!0,writable:!0}):W[H]=F,W}var j=(function(W){x(F,W);var H=R(F);function F(V){var G;E(this,F),G=H.call(this,V),D(M(G),"id",void 0);var ee=V.content.id;if(!ee||typeof ee!="string")throw new i.InvalidEventError("Answer ID must be a non-empty string");return G.id=ee,G}return k(F,[{key:"serialize",value:function(){return{type:"org.matrix.sdk.poll.answer",content:v({id:this.id},this.serializeMMessageOnly())}}}],[{key:"from",value:function(G,ee){return new F({type:"org.matrix.sdk.poll.answer",content:D({id:G},r.M_TEXT.name,ee)})}}]),F})(n.MessageEvent);Nh.PollAnswerSubevent=j;var $=(function(W){x(F,W);var H=R(F);function F(V){var G;E(this,F),G=H.call(this,V),D(M(G),"question",void 0),D(M(G),"kind",void 0),D(M(G),"rawKind",void 0),D(M(G),"maxSelections",void 0),D(M(G),"answers",void 0);var ee=e.M_POLL_START.findIn(G.wireContent);if(!ee.question)throw new i.InvalidEventError("A question is required");if(G.question=new n.MessageEvent({type:"org.matrix.sdk.poll.question",content:ee.question}),G.rawKind=ee.kind,e.M_POLL_KIND_DISCLOSED.matches(G.rawKind)?G.kind=e.M_POLL_KIND_DISCLOSED:G.kind=e.M_POLL_KIND_UNDISCLOSED,G.maxSelections=Number.isFinite(ee.max_selections)&&ee.max_selections>0?ee.max_selections:1,!Array.isArray(ee.answers))throw new i.InvalidEventError("Poll answers must be an array");var K=ee.answers.slice(0,20).map(function(Q){return new j({type:"org.matrix.sdk.poll.answer",content:Q})});if(K.length<=0)throw new i.InvalidEventError("No answers available");return G.answers=K,G}return k(F,[{key:"isEquivalentTo",value:function(G){return(0,o.isEventTypeSame)(G,e.M_POLL_START)}},{key:"serialize",value:function(){var G;return{type:e.M_POLL_START.name,content:(G={},D(G,e.M_POLL_START.name,{question:this.question.serialize().content,kind:this.rawKind,max_selections:this.maxSelections,answers:this.answers.map(function(ee){return ee.serialize().content})}),D(G,r.M_TEXT.name,"".concat(this.question.text,`
5
5
  `).concat(this.answers.map(function(ee,K){return"".concat(K+1,". ").concat(ee.text)}).join(`
@@ -21,7 +21,7 @@ event:
21
21
  `+JSON.stringify(i).replaceAll('"',"'");throw Error(`unknown CallMembership data.
22
22
  `+a+c)}get sender(){return this.userId}get userId(){var{kind:e,data:n}=this.membershipData;return e==="rtc"?n.member.user_id:this.matrixEventData.sender}get eventId(){return this.matrixEventData.eventId}get slotId(){var e,{kind:n,data:r}=this.membershipData;if(r.application==="m.call")switch(n){case"rtc":return r.slot_id;default:{var[i,s]=[this.application,r.call_id],o;if(s===""){var a;o="ROOM",(a=this.logger)===null||a===void 0||a.info("use slotId compat hack emptyString -> ROOM")}else o=s;return jb({application:i,id:o})}}if((e=this.logger)===null||e===void 0||e.info("NOT using slotId compat hack emptyString -> ROOM"),n==="rtc")return r.slot_id;var[c,l]=[this.application,r.call_id];return jb({application:c,id:l})}get deviceId(){var{kind:e,data:n}=this.membershipData;return e==="rtc"?n.member.device_id:n.device_id}get callIntent(){var{kind:e,data:n}=this.membershipData;switch(e){case"rtc":{var r,i=n.application["m.call.intent"];if(typeof i=="string")return i;(r=this.logger)===null||r===void 0||r.warn("RTC membership has invalid m.call.intent");return}default:return n["m.call.intent"]}}get slotDescription(){return f1e(this.slotId)}get application(){var{kind:e,data:n}=this.membershipData;return e==="rtc"?n.application.type:n.application}get applicationData(){var{kind:e,data:n}=this.membershipData;return e==="rtc"?n.application:{type:n.application,"m.call.intent":n["m.call.intent"]}}get scope(){var{kind:e,data:n}=this.membershipData;if(e!=="rtc")return n.scope}get membershipID(){return this.memberId}get memberId(){var e,{kind:n,data:r}=this.membershipData;return n==="rtc"?r.member.id:(e=r.membershipID)!==null&&e!==void 0?e:"".concat(this.matrixEventData.sender,":").concat(r.device_id)}createdTs(){var e,{kind:n,data:r}=this.membershipData;return n==="rtc"?this.matrixEventData.ts:(e=r.created_ts)!==null&&e!==void 0?e:this.matrixEventData.ts}getAbsoluteExpiry(){var e,{kind:n,data:r}=this.membershipData;if(n!=="rtc")return this.createdTs()+((e=r.expires)!==null&&e!==void 0?e:GX)}getMsUntilExpiry(){var{kind:e}=this.membershipData;if(e!=="rtc")return this.getAbsoluteExpiry()-Date.now()}isExpired(){var{kind:e}=this.membershipData;return e==="rtc"?!1:this.getMsUntilExpiry()<=0}getTransport(e){var{kind:n,data:r}=this.membershipData;switch(n){case"rtc":return r.rtc_transports[0];case"session":switch(r.focus_active.focus_selection){case"multi_sfu":return r.foci_preferred[0];case"oldest_membership":if(If.equal(this,e))return r.foci_preferred[0];if(e!==void 0)return e.getTransport(e);break}}}getFocusActive(){var{kind:e,data:n}=this.membershipData;if(e==="session")return n.focus_active}get transports(){var{kind:e,data:n}=this.membershipData;return e==="rtc"?n.rtc_transports:n.foci_preferred}get kind(){return this.membershipData.kind}}var Sc=(function(t){return t.Disconnected="Disconnected",t.Connecting="Connecting",t.Connected="Connected",t.Disconnecting="Disconnecting",t.Unknown="Unknown",t})({}),vE=(t,e,n)=>t.sender===e&&t.deviceId===n;class n1e{constructor(e,n){this.membershipLoopHandler=e,L(this,"logger",void 0),L(this,"running",!1),L(this,"wakeup",r=>{this.logger.error("Cannot call wakeup before calling `startWithJoin()`")}),L(this,"_actions",[]),this.logger=(n??N).getChild("[NewMembershipActionScheduler]")}get actions(){return this._actions}startWithJoin(){var e=this;return B(function*(){if(e.running){e.logger.error("Cannot call startWithJoin() on NewMembershipActionScheduler while already running");return}e.running=!0,e._actions=[{ts:Date.now(),type:dt.SendDelayedEvent}];try{for(var n=function*(){e._actions.sort((l,d)=>l.ts-d.ts);var i=e._actions[0],s=void 0,o=new Promise(l=>{e.wakeup=d=>{s=d,l()}});i.ts>Date.now()&&(yield Promise.race([o,Wp(i.ts-Date.now())]));var a={};if(!s){e.logger.debug("Current MembershipManager processing: ".concat(i.type,`
23
23
  Queue:`),e._actions,`
24
- Date.now: "`.concat(Date.now()));try{a=yield e.membershipLoopHandler(i.type)}catch(l){throw Error("The MembershipManager shut down because of the end condition: ".concat(l))}}e._actions.splice(0,1);var c=s??a;"replace"in c?e._actions=c.replace:"insert"in c&&e._actions.push(...c.insert)};e._actions.length>0;)yield*n()}finally{e.running=!1}e.logger.debug("Leave MembershipManager ActionScheduler loop (no more actions)")})()}initiateJoin(){var e;(e=this.wakeup)===null||e===void 0||e.call(this,{replace:[{ts:Date.now(),type:dt.SendDelayedEvent}]})}initiateLeave(){var e;(e=this.wakeup)===null||e===void 0||e.call(this,{replace:[{ts:Date.now(),type:dt.SendScheduledDelayedLeaveEvent}]})}}var bP=(function(t){return t.TooNew="TOO_NEW",t})({});class _P extends Error{constructor(e){var n="Crypto store is invalid because ".concat(e,", ")+"please stop the client, delete all data and start the client again";super(n),this.reason=e,this.name="InvalidCryptoStoreError"}}L(_P,"TOO_NEW",bP.TooNew);class r1e extends Error{constructor(e,n){super(e),this.value=n}}class i1e extends Error{constructor(){super("MatrixClient has been stopped")}}class Wo extends Error{constructor(e,n){super(e),this.clientEndpoint=n,this.name="UnsupportedDelayedEventsEndpointError"}}class VA extends Error{constructor(e,n){super(e),this.clientEndpoint=n,this.name="UnsupportedStickyEventsEndpointError"}}var gl=(function(t){return t.StatusChanged="StatusChanged",t.ProbablyLeft="ProbablyLeft",t.DelayIdChanged="DelayIdChanged",t})({}),kT=t=>t.type==="livekit"&&"livekit_service_url"in t;function wB(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function Ug(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?wB(Object(n),!0).forEach(function(r){L(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):wB(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}var KA=3600*1e3,dt=(function(t){return t.SendDelayedEvent="SendDelayedEvent",t.SendJoinEvent="SendJoinEvent",t.RestartDelayedEvent="RestartDelayedEvent",t.UpdateExpiry="UpdateExpiry",t.SendScheduledDelayedLeaveEvent="SendScheduledDelayedLeaveEvent",t.SendLeaveEvent="SendLeaveEvent",t})({});function ka(t,e){return{insert:[{ts:Date.now()+(e??0),type:t}]}}function fx(t,e){return{replace:[{ts:Date.now()+0,type:t}]}}class Ub extends Kn{isActivated(){return this.activated}isJoined(){return this.isActivated()}join(e,n,r){if(this.scheduler.running){this.logger.error("MembershipManager is already running. Ignoring join request.");return}this.fociPreferred=e,this.rtcTransport=n,this.leavePromiseResolvers=void 0,this.activated=!0,this.oldStatus=this.status,this.state=Ub.defaultState,this.scheduler.startWithJoin().catch(i=>{this.logger.error("MembershipManager stopped because: ",i),r?.(i)}).finally(()=>{if(this.activated=!1,this.oldStatus&&this.oldStatus!==this.status&&this.emit(gl.StatusChanged,this.oldStatus,this.status),!this.scheduler.running){var i;(i=this.leavePromiseResolvers)===null||i===void 0||i.resolve(!0),this.leavePromiseResolvers=void 0}})}leave(e){return this.scheduler.running?(this.leavePromiseResolvers||(this.leavePromiseResolvers=Promise.withResolvers(),this.activated=!1,this.scheduler.initiateLeave(),e&&setTimeout(()=>{var n;return(n=this.leavePromiseResolvers)===null||n===void 0?void 0:n.resolve(!1)},e)),this.leavePromiseResolvers.promise):(this.logger.warn("Called MembershipManager.leave() even though the MembershipManager is not running"),Promise.resolve(!0))}onRTCSessionMemberUpdate(e){if(!this.isActivated())return Promise.resolve();if(this._ownMembership=e.find(r=>vE(r,this.userId,this.deviceId)),!this._ownMembership){var n=[dt.SendDelayedEvent,dt.SendJoinEvent];this.logger.warn("Missing own membership: force re-join"),this.state.hasMemberStateEvent=!1,this.scheduler.actions.some(r=>n.includes(r.type))?this.logger.error("tried adding another `SendDelayedEvent` actions even though we already have one in the Queue\nActionQueueOnMemberUpdate:",this.scheduler.actions):this.scheduler.initiateJoin()}return Promise.resolve()}updateCallIntent(e){var n=this;return B(function*(){if(!n.activated||!n.ownMembership)throw Error("You cannot update your intent before joining the call");n.ownMembership.callIntent!==e&&(n.callIntent=e,yield n.sendJoinEvent())})()}constructor(e,n,r,i,s){super(),this.joinConfig=e,this.room=n,this.client=r,this.slotDescription=i,L(this,"activated",!1),L(this,"logger",void 0),L(this,"callIntent",void 0),L(this,"leavePromiseResolvers",void 0),L(this,"_ownMembership",void 0),L(this,"oldStatus",void 0),L(this,"scheduler",void 0),L(this,"state",void 0),L(this,"deviceId",void 0),L(this,"userId",void 0),L(this,"stateKey",void 0),L(this,"rtcTransport",void 0),L(this,"fociPreferred",void 0),L(this,"delayedLeaveEventDelayMsOverride",void 0),L(this,"clientSendDelayedDisconnectMembership",()=>this.client._unstable_sendDelayedStateEvent(this.room.roomId,{delay:this.delayedLeaveEventDelayMs},Z.GroupCallMemberPrefix,{},this.stateKey)),L(this,"clientSendMembership",c=>this.client.sendStateEvent(this.room.roomId,Z.GroupCallMemberPrefix,c,this.stateKey)),this.logger=(s??N).getChild("[MembershipManager]");var[o,a]=[this.client.getUserId(),this.client.getDeviceId()];if(o===null)throw Error("Missing userId in client");if(a===null)throw Error("Missing deviceId in client");this.deviceId=a,this.userId=o,this.stateKey=this.makeMembershipStateKey(o,a),this.state=Ub.defaultState,this.callIntent=e?.callIntent,this.scheduler=new n1e(c=>(this.oldStatus&&(this.logger.debug("MembershipManager applied action changes. Status: ".concat(this.oldStatus," -> ").concat(this.status)),this.oldStatus!==this.status&&this.emit(gl.StatusChanged,this.oldStatus,this.status)),this.oldStatus=this.status,this.logger.debug("MembershipManager before processing action. status=".concat(this.oldStatus)),this.membershipLoopHandler(c)),this.logger)}get ownMembership(){return this._ownMembership}static get defaultState(){return{hasMemberStateEvent:!1,delayId:void 0,startTime:0,rateLimitRetries:new Map,networkErrorRetries:new Map,expireUpdateIterations:1,probablyLeft:!1}}get networkErrorRetryMs(){var e,n;return(e=(n=this.joinConfig)===null||n===void 0?void 0:n.networkErrorRetryMs)!==null&&e!==void 0?e:3e3}get membershipEventExpiryMs(){var e,n;return(e=(n=this.joinConfig)===null||n===void 0?void 0:n.membershipEventExpiryMs)!==null&&e!==void 0?e:GX}get membershipEventExpiryHeadroomMs(){var e,n;return(e=(n=this.joinConfig)===null||n===void 0?void 0:n.membershipEventExpiryHeadroomMs)!==null&&e!==void 0?e:5e3}computeNextExpiryActionTs(e){return this.state.startTime+Math.min(this.membershipEventExpiryMs,KA)*e-this.membershipEventExpiryHeadroomMs}get delayedLeaveEventDelayMs(){var e,n,r;return(e=(n=this.delayedLeaveEventDelayMsOverride)!==null&&n!==void 0?n:(r=this.joinConfig)===null||r===void 0?void 0:r.delayedLeaveEventDelayMs)!==null&&e!==void 0?e:8e3}get delayedLeaveEventRestartMs(){var e,n;return(e=(n=this.joinConfig)===null||n===void 0?void 0:n.delayedLeaveEventRestartMs)!==null&&e!==void 0?e:5e3}get maximumRateLimitRetryCount(){var e,n;return(e=(n=this.joinConfig)===null||n===void 0?void 0:n.maximumRateLimitRetryCount)!==null&&e!==void 0?e:10}get maximumNetworkErrorRetryCount(){var e,n;return(e=(n=this.joinConfig)===null||n===void 0?void 0:n.maximumNetworkErrorRetryCount)!==null&&e!==void 0?e:10}get delayedLeaveEventRestartLocalTimeoutMs(){var e,n;return(e=(n=this.joinConfig)===null||n===void 0?void 0:n.delayedLeaveEventRestartLocalTimeoutMs)!==null&&e!==void 0?e:2e3}membershipLoopHandler(e){var n=this;return B(function*(){switch(e){case dt.SendDelayedEvent:return n.state.delayId?n.cancelKnownDelayIdBeforeSendDelayedEvent(n.state.delayId):n.sendOrResendDelayedLeaveEvent();case dt.RestartDelayedEvent:return n.state.delayId?n.restartDelayedEvent(n.state.delayId):ka(dt.SendDelayedEvent);case dt.SendScheduledDelayedLeaveEvent:return n.state.hasMemberStateEvent?n.state.delayId?n.sendScheduledDelayedLeaveEventOrFallbackToSendLeaveEvent(n.state.delayId):ka(dt.SendLeaveEvent):{replace:[]};case dt.SendJoinEvent:return n.sendJoinEvent();case dt.UpdateExpiry:return n.updateExpiryOnJoinedEvent();case dt.SendLeaveEvent:return n.state.hasMemberStateEvent?n.sendFallbackLeaveEvent():{replace:[]}}})()}sendOrResendDelayedLeaveEvent(){var e=this;return B(function*(){return yield e.clientSendDelayedDisconnectMembership().then(n=>(e.state.expectedServerDelayLeaveTs=Date.now()+e.delayedLeaveEventDelayMs,e.setAndEmitProbablyLeft(!1),e.resetRateLimitCounter(dt.SendDelayedEvent),e.setAndEmitDelayId(n.delay_id),e.state.hasMemberStateEvent?ka(dt.RestartDelayedEvent,e.delayedLeaveEventRestartMs):ka(dt.SendJoinEvent))).catch(n=>{var r=dt.SendDelayedEvent;if(e.manageMaxDelayExceededSituation(n))return ka(r);var i=e.actionUpdateFromErrors(n,r,"_unstable_sendDelayedStateEvent");if(i)return i;if(e.state.hasMemberStateEvent){if(e.isUnsupportedDelayedEndpoint(n))return{};throw Error("Could not send delayed event, even though delayed events are supported. "+n)}else return e.isUnsupportedDelayedEndpoint(n)?e.logger.info("Not using delayed event because the endpoint is not supported"):e.logger.info("Not using delayed event because: "+n),ka(dt.SendJoinEvent)})})()}cancelKnownDelayIdBeforeSendDelayedEvent(e){var n=this;return B(function*(){return yield n.client._unstable_cancelScheduledDelayedEvent(e).then(()=>(n.setAndEmitDelayId(void 0),n.resetRateLimitCounter(dt.SendDelayedEvent),fx(dt.SendDelayedEvent))).catch(r=>{var i=dt.SendDelayedEvent,s=n.actionUpdateFromErrors(r,i,"cancelScheduledDelayedEvent");if(s)return s;if(n.isNotFoundError(r))return n.setAndEmitDelayId(void 0),fx(i);if(n.isUnsupportedDelayedEndpoint(r))return fx(dt.SendJoinEvent);throw Error("We failed to cancel a delayed event where we already had a delay id with an error we cannot automatically handle")})})()}setAndEmitProbablyLeft(e){this.state.probablyLeft!==e&&(this.state.probablyLeft=e,this.emit(gl.ProbablyLeft,this.state.probablyLeft))}setAndEmitDelayId(e){this.state.delayId!==e&&(this.state.delayId=e,this.emit(gl.DelayIdChanged,this.state.delayId))}restartDelayedEvent(e){var n=this;return B(function*(){var r=n.state.expectedServerDelayLeaveTs?n.state.expectedServerDelayLeaveTs-Date.now():void 0,i=new Promise((s,o)=>{setTimeout(()=>{o(new MJ("Restart delayed event timed out before the HS responded"))},r!==void 0&&!n.state.probablyLeft?Math.min(n.delayedLeaveEventRestartLocalTimeoutMs,r):n.delayedLeaveEventRestartLocalTimeoutMs)});return yield Promise.race([n.client._unstable_restartScheduledDelayedEvent(e),i]).then(()=>(n.state.expectedServerDelayLeaveTs=Date.now()+n.delayedLeaveEventDelayMs,n.resetRateLimitCounter(dt.RestartDelayedEvent),n.setAndEmitProbablyLeft(!1),ka(dt.RestartDelayedEvent,n.delayedLeaveEventRestartMs))).catch(s=>{n.state.expectedServerDelayLeaveTs&&n.state.expectedServerDelayLeaveTs<=Date.now()&&n.setAndEmitProbablyLeft(!0);var o=dt.RestartDelayedEvent;if(n.isNotFoundError(s))return n.setAndEmitDelayId(void 0),ka(dt.SendDelayedEvent);if(n.isUnsupportedDelayedEndpoint(s))return{};var a=n.actionUpdateFromErrors(s,o,"restartScheduledDelayedEvent");if(a)return a;throw Error("Could not restart delayed event, even though delayed events are supported. "+s)})})()}sendScheduledDelayedLeaveEventOrFallbackToSendLeaveEvent(e){var n=this;return B(function*(){return yield n.client._unstable_sendScheduledDelayedEvent(e).then(()=>(n.state.hasMemberStateEvent=!1,n.setAndEmitDelayId(void 0),n.resetRateLimitCounter(dt.SendScheduledDelayedLeaveEvent),{replace:[]})).catch(r=>{var i=dt.SendLeaveEvent;if(n.isUnsupportedDelayedEndpoint(r))return{};if(n.isNotFoundError(r))return n.setAndEmitDelayId(void 0),ka(i);var s=n.actionUpdateFromErrors(r,i,"sendScheduledDelayedEvent");return s||(n.logger.warn("Encountered unexpected error during SendScheduledDelayedLeaveEvent. Falling back to SendLeaveEvent",r),ka(i))})})()}sendJoinEvent(){var e=this;return B(function*(){return yield e.clientSendMembership(e.makeMyMembership(e.membershipEventExpiryMs)).then(()=>{e.setAndEmitProbablyLeft(!1),e.state.startTime=Date.now(),e.state.expireUpdateIterations=1,e.state.hasMemberStateEvent=!0,e.resetRateLimitCounter(dt.SendJoinEvent);var n=e.scheduler.actions.filter(r=>r.type!==dt.UpdateExpiry&&r.type!==dt.SendJoinEvent);return{replace:[...n,{ts:Date.now(),type:dt.RestartDelayedEvent},{ts:e.computeNextExpiryActionTs(e.state.expireUpdateIterations),type:dt.UpdateExpiry}]}}).catch(n=>{var r=e.actionUpdateFromErrors(n,dt.SendJoinEvent,"sendStateEvent");if(r)return r;throw n})})()}updateExpiryOnJoinedEvent(){var e=this;return B(function*(){var n=e.state.expireUpdateIterations+1;return yield e.clientSendMembership(e.makeMyMembership(e.membershipEventExpiryMs*n)).then(()=>(e.resetRateLimitCounter(dt.UpdateExpiry),e.state.expireUpdateIterations=n,{insert:[{ts:e.computeNextExpiryActionTs(n),type:dt.UpdateExpiry}]})).catch(r=>{var i=e.actionUpdateFromErrors(r,dt.UpdateExpiry,"sendStateEvent");if(i)return i;throw r})})()}sendFallbackLeaveEvent(){var e=this;return B(function*(){return yield e.clientSendMembership({}).then(()=>(e.resetRateLimitCounter(dt.SendLeaveEvent),e.state.hasMemberStateEvent=!1,{replace:[]})).catch(n=>{var r=e.actionUpdateFromErrors(n,dt.SendLeaveEvent,"sendStateEvent");if(r)return r;throw n})})()}makeMembershipStateKey(e,n){var r=this.slotDescription.application,i=r==="m.call"&&this.slotDescription.id==="ROOM",s=i?"":this.slotDescription.id,o="".concat(e,"_").concat(n,"_").concat(r).concat(s);return/^org\.matrix\.msc(3757|3779)\b/.exec(this.room.getVersion())?o:"_".concat(o)}makeMyMembership(e){var n,r,i=this.ownMembership,s=this.slotDescription.application==="m.call"&&this.slotDescription.id==="ROOM",o=this.rtcTransport===void 0?{focus_active:{type:"livekit",focus_selection:"oldest_membership"},foci_preferred:(n=this.fociPreferred)!==null&&n!==void 0?n:[]}:{focus_active:{type:"livekit",focus_selection:"multi_sfu"},foci_preferred:[this.rtcTransport,...(r=this.fociPreferred)!==null&&r!==void 0?r:[]]};return Ug(Ug({application:this.slotDescription.application,call_id:s?"":this.slotDescription.id,scope:"m.room",device_id:this.deviceId,membershipID:"".concat(this.userId,":").concat(this.deviceId),expires:e,"m.call.intent":this.callIntent},o),i!==void 0?{created_ts:i.createdTs()}:void 0)}isNotFoundError(e){return e instanceof In&&e.errcode==="M_NOT_FOUND"}manageMaxDelayExceededSituation(e){if(e instanceof In&&e.errcode==="M_UNKNOWN"&&e.data["org.matrix.msc4140.errcode"]==="M_MAX_DELAY_EXCEEDED"){var n=e.data["org.matrix.msc4140.max_delay"];return typeof n=="number"&&this.delayedLeaveEventDelayMs>n&&(this.delayedLeaveEventDelayMsOverride=n),this.logger.warn("Retry sending delayed disconnection event due to server timeout limitations:",e),!0}return!1}actionUpdateFromErrors(e,n,r){var i=this.actionUpdateFromRateLimitError(e,r,n);if(i)return i;var s=this.actionUpdateFromNetworkErrorRetry(e,n);if(s)return s}actionUpdateFromRateLimitError(e,n,r){var i;if((e instanceof Ip||e instanceof In)&&e.isRateLimitError()){var s=(i=this.state.rateLimitRetries.get(r))!==null&&i!==void 0?i:0;if(s<this.maximumRateLimitRetryCount){var o,a=5e3;try{var c;o=(c=e.getRetryAfterMs())!==null&&c!==void 0?c:a,this.logger.info("Rate limited by server, retrying in ".concat(o,"ms"))}catch(l){this.logger.warn("Error while retrieving a rate-limit retry delay, retrying after default delay of ".concat(a),l),o=a}return this.state.rateLimitRetries.set(r,s+1),ka(r,o)}throw Error("Exceeded maximum retries for "+r+" attempts (client."+n+")",{cause:e})}}actionUpdateFromNetworkErrorRetry(e,n){var r,i=(r=this.state.networkErrorRetries.get(n))!==null&&r!==void 0?r:0,s=this.networkErrorRetryMs/1e3+"s",o="("+i+"/"+this.maximumNetworkErrorRetryCount+")",a=this.networkErrorRetryMs;if(e instanceof Error&&e.name==="AbortError")a=0,this.logger.warn("Network local timeout error while sending event, immediate retry ("+o+")",e);else if(e instanceof Error&&e.message.includes("updating delayed event"))this.logger.warn("delayed event update timeout error, retrying in "+s+" "+o,e);else if(e instanceof Xp)this.logger.warn("Network connection error while sending event, retrying in "+s+" "+o,e);else if((e instanceof Ip||e instanceof In)&&typeof e.httpStatus=="number"&&e.httpStatus>=500&&e.httpStatus<600)this.logger.warn("Server error while sending event, retrying in "+s+" "+o,e);else return;if(i<this.maximumNetworkErrorRetryCount)return this.state.networkErrorRetries.set(n,i+1),ka(n,a);throw Error("Reached maximum ("+this.maximumNetworkErrorRetryCount+") retries cause by: "+e)}isUnsupportedDelayedEndpoint(e){return e instanceof Wo}resetRateLimitCounter(e){this.state.rateLimitRetries.set(e,0),this.state.networkErrorRetries.set(e,0)}get status(){var e=this.scheduler.actions;if(e.length===1){var{type:n}=e[0];switch(n){case dt.SendDelayedEvent:case dt.SendJoinEvent:return Sc.Connecting;case dt.UpdateExpiry:return Sc.Connected;case dt.SendScheduledDelayedLeaveEvent:case dt.SendLeaveEvent:return Sc.Disconnecting}}else if(e.length===2){var r=e.map(s=>s.type);if((r.includes(dt.RestartDelayedEvent)||r.includes(dt.SendDelayedEvent)&&this.state.hasMemberStateEvent)&&r.includes(dt.UpdateExpiry))return Sc.Connected}else if(e.length===3){var i=e.map(s=>s.type);if(i.filter(s=>s===dt.RestartDelayedEvent).length===2&&i.includes(dt.UpdateExpiry))return Sc.Connected}return this.scheduler.running?(this.logger.error("MembershipManager has an unknown state. Actions: ",e),Sc.Unknown):Sc.Disconnected}get probablyLeft(){return this.state.probablyLeft}get delayId(){return this.state.delayId}}class IT extends Ub{constructor(e,n,r,i,s,o){super(e,n,r,i,o),this.clientWithSticky=r,this.memberId=s,L(this,"clientSendDelayedDisconnectMembership",()=>this.clientWithSticky._unstable_sendStickyDelayedEvent(this.room.roomId,KA,{delay:this.delayedLeaveEventDelayMs},null,Z.RTCMembership,{msc4354_sticky_key:this.memberId})),L(this,"clientSendMembership",a=>this.clientWithSticky._unstable_sendStickyEvent(this.room.roomId,KA,null,Z.RTCMembership,Ug(Ug({},a),{},{msc4354_sticky_key:this.memberId})))}actionUpdateFromErrors(e,n,r){var i;return super.actionUpdateFromErrors(e,n,(i=IT.nameMap.get(r))!==null&&i!==void 0?i:"unknown")}makeMyMembership(e){var n=this.ownMembership,r=kT(this.rtcTransport)?this.rtcTransport:void 0,i=n!=null&&n.eventId?{"m.relation":{rel_type:bn.Reference,event_id:n?.eventId}}:{};return Ug({application:Ug({type:this.slotDescription.application},this.callIntent?{"m.call.intent":this.callIntent}:{}),slot_id:jb(this.slotDescription),rtc_transports:r?[{type:r.type,livekit_service_url:r.livekit_service_url}]:[],member:{device_id:this.deviceId,user_id:this.userId,id:this.memberId},versions:[]},i)}}L(IT,"nameMap",new Map([["sendStateEvent","_unstable_sendStickyEvent"],["sendDelayedStateEvent","_unstable_sendStickyDelayedEvent"]]));var Cv=(function(t){return t.ReceivedKeys="received_keys",t.NotSupportedError="not_supported_error",t})({});function cf(t){return"".concat(t.userId,":").concat(t.deviceId,"(").concat(t.memberId,")")}class s1e{get updateEncryptionKeyThrottle(){var e,n;return(e=(n=this.joinConfig)===null||n===void 0?void 0:n.updateEncryptionKeyThrottle)!==null&&e!==void 0?e:3e3}get makeKeyDelay(){var e,n;return(e=(n=this.joinConfig)===null||n===void 0?void 0:n.makeKeyDelay)!==null&&e!==void 0?e:3e3}get useKeyDelay(){var e,n;return(e=(n=this.joinConfig)===null||n===void 0?void 0:n.useKeyDelay)!==null&&e!==void 0?e:5e3}constructor(e,n,r,i,s,o){var a=this;this.membership=e,this.getMemberships=n,this.transport=r,this.statistics=i,this.onEncryptionKeysChanged=s,L(this,"manageMediaKeys",!1),L(this,"keysEventUpdateTimeout",void 0),L(this,"makeNewKeyTimeout",void 0),L(this,"setNewKeyTimeouts",new Set),L(this,"encryptionKeys",new Map),L(this,"lastEncryptionKeyUpdateRequest",void 0),L(this,"lastMembershipFingerprints",void 0),L(this,"latestGeneratedKeyIndex",-1),L(this,"joinConfig",void 0),L(this,"logger",void 0),L(this,"joined",!1),L(this,"sendEncryptionKeysEvent",(function(){var c=B(function*(l){if(a.keysEventUpdateTimeout!==void 0&&(clearTimeout(a.keysEventUpdateTimeout),a.keysEventUpdateTimeout=void 0),a.lastEncryptionKeyUpdateRequest=Date.now(),!!a.joined){var d=a.getKeysForParticipant(a.membership);if(!d){a.logger.warn("Tried to send encryption keys event but no keys found!");return}if(typeof l!="number"&&a.latestGeneratedKeyIndex===-1){a.logger.warn("Tried to send encryption keys event but no current key index found!");return}var h=l??a.latestGeneratedKeyIndex;a.logger.info("Try sending encryption keys event. keyIndexToSend=".concat(h," (method parameter: ").concat(l,")"));var m=d[h];try{a.statistics.counters.roomEventEncryptionKeysSent+=1;var g=a.getMemberships().filter(v=>v.sender!=null).map(v=>({userId:v.sender,deviceId:v.deviceId,membershipTs:v.createdTs()}));yield a.transport.sendKey(fP(m),h,g),a.logger.debug("sendEncryptionKeysEvent participantId=".concat(a.membership.userId,":").concat(a.membership.deviceId," numKeys=").concat(d.length," currentKeyIndex=").concat(a.latestGeneratedKeyIndex," keyIndexToSend=").concat(h))}catch(v){if(a.keysEventUpdateTimeout===void 0){var y=sP(v,5e3);a.logger.warn("Failed to send m.call.encryption_key, retrying in ".concat(y),v),a.keysEventUpdateTimeout=setTimeout(()=>{a.sendEncryptionKeysEvent()},y)}else a.logger.info("Not scheduling key resend as another re-send is already pending")}}});return function(l){return c.apply(this,arguments)}})()),L(this,"onNewKeyReceived",(c,l,d,h)=>{this.logger.debug("Received key over key transport ".concat(c.userId,":").concat(c.deviceId," at index ").concat(d)),this.setEncryptionKey(c,d,l,h)}),L(this,"onRotateKeyTimeout",()=>{if(this.manageMediaKeys){this.makeNewKeyTimeout=void 0,this.logger.info("Making new sender key for key rotation");var c=this.makeNewSenderKey(!0);this.sendEncryptionKeysEvent(c)}}),this.logger=(o??N).getChild("[EncryptionManager]")}rtcBackendIdentityFromMembershipParts(e){return"".concat(e.userId,":").concat(e.deviceId)}getEncryptionKeys(){var e=new Map;for(var[n,r]of this.encryptionKeys){var i=r.map((s,o)=>({key:s.key,membership:s.membership,keyIndex:o,rtcBackendIdentity:this.rtcBackendIdentityFromMembershipParts(s.membership)}));e.set(n,i)}return e}join(e){var n,r,i;this.joinConfig=e,this.joined=!0,this.manageMediaKeys=(n=(r=this.joinConfig)===null||r===void 0?void 0:r.manageMediaKeys)!==null&&n!==void 0?n:this.manageMediaKeys,this.transport.on(Cv.ReceivedKeys,this.onNewKeyReceived),this.transport.start(),(i=this.joinConfig)!==null&&i!==void 0&&i.manageMediaKeys&&(this.makeNewSenderKey(),this.requestSendCurrentKey())}leave(){this.encryptionKeys.set(cf(this.membership),[]),this.transport.off(Cv.ReceivedKeys,this.onNewKeyReceived),this.transport.stop(),this.makeNewKeyTimeout!==void 0&&(clearTimeout(this.makeNewKeyTimeout),this.makeNewKeyTimeout=void 0);for(var e of this.setNewKeyTimeouts)clearTimeout(e);this.setNewKeyTimeouts.clear(),this.manageMediaKeys=!1,this.joined=!1}onMembershipsUpdate(e){if(this.manageMediaKeys&&this.joined){var n=new Set(e.filter(l=>!vE(l,this.membership.userId,this.membership.deviceId)).map(cf)),r=new Set(this.getMemberships().filter(l=>!vE(l,this.membership.userId,this.membership.deviceId)).map(cf)),i=Array.from(n).some(l=>!r.has(l)),s=Array.from(r).some(l=>!n.has(l)),o=this.lastMembershipFingerprints;if(this.storeLastMembershipFingerprints(),i)this.makeNewKeyTimeout||(this.logger.debug("Member(s) have left: queueing sender key rotation"),this.makeNewKeyTimeout=setTimeout(this.onRotateKeyTimeout,this.makeKeyDelay));else if(s)this.logger.debug("New member(s) have joined: re-sending keys"),this.requestSendCurrentKey();else if(o){var a=this.lastMembershipFingerprints,c=Array.from(o).some(l=>!a.has(l))||Array.from(a).some(l=>!o.has(l));c&&(this.logger.debug("Member(s) have updated/reconnected: re-sending keys to everyone"),this.requestSendCurrentKey())}}}makeNewSenderKey(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,n=DX(16),r=this.getNewEncryptionKeyIndex();return this.logger.info("Generated new key at index "+r),this.setEncryptionKey(this.membership,r,n,Date.now(),e),r}requestSendCurrentKey(){if(this.manageMediaKeys){if(this.lastEncryptionKeyUpdateRequest&&this.lastEncryptionKeyUpdateRequest+this.updateEncryptionKeyThrottle>Date.now()){this.logger.info("Last encryption key event sent too recently: postponing"),this.keysEventUpdateTimeout===void 0&&(this.keysEventUpdateTimeout=setTimeout(()=>{this.sendEncryptionKeysEvent()},this.updateEncryptionKeyThrottle));return}this.sendEncryptionKeysEvent()}}getKeysForParticipant(e){var n;return(n=this.encryptionKeys.get(cf(e)))===null||n===void 0?void 0:n.map(r=>r.key)}storeLastMembershipFingerprints(){this.lastMembershipFingerprints=new Set(this.getMemberships().filter(e=>!vE(e,this.membership.userId,this.membership.deviceId)).map(e=>"".concat(cf(e),":").concat(e.createdTs())))}getNewEncryptionKeyIndex(){return this.latestGeneratedKeyIndex===-1?0:(this.latestGeneratedKeyIndex+1)%256}setEncryptionKey(e,n,r,i){var s=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!1;this.logger.debug("Setting encryption key for ".concat(e.userId,":").concat(e.deviceId," at index ").concat(n));var o=fp(r),a=cf(e);this.encryptionKeys.has(a)||this.encryptionKeys.set(a,[]);var c=this.encryptionKeys.get(a),l=c[n];if(l){if(l.timestamp>i){this.logger.info("Ignoring new key at index ".concat(n," for ").concat(a," as it is older than existing known key"));return}if(o1e(l.key,o)){l.timestamp=i;return}}if(e.userId===this.membership.userId&&e.deviceId===this.membership.deviceId&&(this.latestGeneratedKeyIndex=n),c[n]={key:o,timestamp:i,membership:e},s){var d=setTimeout(()=>{this.setNewKeyTimeouts.delete(d),this.logger.info("Delayed-emitting key changed event for ".concat(a," index ").concat(n)),this.onEncryptionKeysChanged(o,n,e,this.rtcBackendIdentityFromMembershipParts(e))},this.useKeyDelay);this.setNewKeyTimeouts.add(d)}else this.onEncryptionKeysChanged(o,n,e,this.rtcBackendIdentityFromMembershipParts(e))}}function o1e(t,e){return t===e?!0:!!t&&!!e&&t.length===e.length&&t.every((n,r)=>n===e[r])}class a1e{constructor(){L(this,"tsBuffer",new Map)}isOutdated(e,n){var r,i=cf(e);this.tsBuffer.has(i)||this.tsBuffer.set(i,new Map);var s=(r=this.tsBuffer.get(i))===null||r===void 0?void 0:r.get(n.keyIndex);return s&&s>n.creationTS?!0:(this.tsBuffer.get(i).set(n.keyIndex,n.creationTS),!1)}}class c1e{constructor(e,n,r,i,s,o,a){this.ownMembership=e,this.getMemberships=n,this.transport=r,this.statistics=i,this.onEncryptionKeysChanged=s,L(this,"manageMediaKeys",!1),L(this,"useHashedRtcBackendIdentity",!1),L(this,"ownRtcBackendIdentityCache",void 0),L(this,"participantKeyRings",new Map),L(this,"outboundSession",null),L(this,"currentKeyDistributionPromise",null),L(this,"useKeyDelay",5e3),L(this,"keyRotationGracePeriodMs",1e4),L(this,"needToEnsureKeyAgain",!1),L(this,"keyBuffer",new a1e),L(this,"logger",void 0),L(this,"rtcIdentityProvider",void 0),L(this,"keysWithoutMatchingRTCMembership",[]),L(this,"onNewKeyReceived",(c,l,d,h)=>{var m;if(!this.manageMediaKeys){var g;(g=this.logger)===null||g===void 0||g.warn("Received key over transport ".concat(c.userId,":").concat(c.deviceId," at index ").concat(d," but media keys are disabled"));return}(m=this.logger)===null||m===void 0||m.debug("Received key over transport ".concat(c.userId,":").concat(c.deviceId," at index ").concat(d));var y=fp(l),v={key:y,membership:c,keyIndex:d,creationTS:h},E=this.keyBuffer.isOutdated(c,v);if(!E)this.addKeyToParticipant(v.key,v.keyIndex,v.membership),this.statistics.counters.roomEventEncryptionKeysReceived+=1;else{var w;(w=this.logger)===null||w===void 0||w.info("Received an out of order key for ".concat(c.userId,":").concat(c.deviceId,", dropping it"))}}),this.logger=o?.getChild("[EncryptionManager]"),this.rtcIdentityProvider=a??If.computeRtcIdentityRaw}getOwnRtcBackendIdentity(){var e=this;return B(function*(){if(e.ownRtcBackendIdentityCache)return e.ownRtcBackendIdentityCache;if(e.useHashedRtcBackendIdentity){var n,{userId:r,deviceId:i,memberId:s}=e.ownMembership;(n=e.logger)===null||n===void 0||n.info("Computing RTC backend identity for ".concat(r,":").concat(i,":").concat(s," (SHOULD ONLY BE CALLED ONCE)")),e.ownRtcBackendIdentityCache=yield e.rtcIdentityProvider(r,i,s)}else e.ownRtcBackendIdentityCache="".concat(e.ownMembership.userId,":").concat(e.ownMembership.deviceId);return e.ownRtcBackendIdentityCache})()}getEncryptionKeys(){return new Map(this.participantKeyRings)}checkKeysWithoutMatchingRTCMembership(){var e=this.keysWithoutMatchingRTCMembership;this.keysWithoutMatchingRTCMembership=[],e.forEach(n=>{this.addKeyToParticipant(n.key,n.keyIndex,n.membership)})}addKeyToParticipant(e,n,r){var i=this.getMemberships(),s=i.find(a=>a.userId===r.userId&&a.deviceId===r.deviceId);if(!s){var o;(o=this.logger)===null||o===void 0||o.info("No matching RTC membership for key from ".concat(r.userId,":").concat(r.deviceId,", delaying key addition")),this.keysWithoutMatchingRTCMembership.push({key:e,keyIndex:n,membership:r});return}this.addKeyToParticipantWithBackendIdentity(e,n,r,s.rtcBackendIdentity)}addKeyToParticipantWithBackendIdentity(e,n,r,i){var s=cf(r);this.participantKeyRings.has(s)||this.participantKeyRings.set(s,[]),this.participantKeyRings.get(s).push({key:e,keyIndex:n,membership:r,rtcBackendIdentity:i}),this.onEncryptionKeysChanged(e,n,r,i)}join(e){var n,r,i,s,o;this.manageMediaKeys=(n=e?.manageMediaKeys)!==null&&n!==void 0?n:!0,this.useHashedRtcBackendIdentity=(r=e?.unstableSendStickyEvents)!==null&&r!==void 0?r:!1,this.useKeyDelay=(i=e?.useKeyDelay)!==null&&i!==void 0?i:1e3,this.keyRotationGracePeriodMs=(s=e?.keyRotationGracePeriodMs)!==null&&s!==void 0?s:1e4,this.transport.on(Cv.ReceivedKeys,this.onNewKeyReceived),this.getOwnRtcBackendIdentity(),(o=this.logger)===null||o===void 0||o.info("Joining room"),this.transport.start()}leave(){this.transport.off(Cv.ReceivedKeys,this.onNewKeyReceived),this.transport.stop(),this.participantKeyRings.clear()}ensureKeyDistribution(){if(this.manageMediaKeys)if(this.currentKeyDistributionPromise==null){var e;(e=this.logger)===null||e===void 0||e.debug("No active rollout, start a new one"),this.currentKeyDistributionPromise=this.rolloutOutboundKey().then(()=>{var r;if((r=this.logger)===null||r===void 0||r.debug("Rollout completed"),this.currentKeyDistributionPromise=null,this.needToEnsureKeyAgain){var i;(i=this.logger)===null||i===void 0||i.debug("New Rollout needed"),this.needToEnsureKeyAgain=!1,this.ensureKeyDistribution()}})}else{var n;(n=this.logger)===null||n===void 0||n.debug("Rollout in progress, a new rollout will be started after the current one"),this.needToEnsureKeyAgain=!0}}onMembershipsUpdate(){var e;(e=this.logger)===null||e===void 0||e.trace("onMembershipsUpdate"),this.ensureKeyDistribution(),this.checkKeysWithoutMatchingRTCMembership()}rolloutOutboundKey(){var e=this;return B(function*(){var n,r,i=e.outboundSession==null;if(i){var s={key:e.generateRandomKey(),creationTS:Date.now(),sharedWith:[],keyId:0};e.outboundSession=s,e.addKeyToParticipantWithBackendIdentity(s.key,s.keyId,e.ownMembership,yield e.getOwnRtcBackendIdentity())}var o=e.getMemberships().filter(O=>O.sender!=null).map(O=>({userId:O.sender,deviceId:O.deviceId,membershipTs:O.createdTs()})),a=(n=(r=e.outboundSession)===null||r===void 0?void 0:r.sharedWith)!==null&&n!==void 0?n:[];a=a.filter(O=>!o.some(P=>O.userId==P.userId&&O.deviceId==P.deviceId&&O.membershipTs!=P.membershipTs));var c=a.filter(O=>!o.some(P=>O.userId==P.userId&&O.deviceId==P.deviceId&&O.membershipTs==P.membershipTs)),l=o.filter(O=>!a.some(P=>O.userId==P.userId&&O.deviceId==P.deviceId&&O.membershipTs==P.membershipTs)),d=[],h,m=!1;if(c.length>0){var g=e.createNewOutboundSession();m=!0,d=o,h=g}else if(l.length>0){var y=Date.now(),v=y-e.outboundSession.creationTS;if(v<e.keyRotationGracePeriodMs){var E;(E=e.logger)===null||E===void 0||E.debug("New joiners detected, but the key is recent enough (age:".concat(v,"), keeping it")),d=l,h=e.outboundSession}else{var w;(w=e.logger)===null||w===void 0||w.debug("New joiners detected, rotating the key");var k=e.createNewOutboundSession();m=!0,d=o,h=k}}else return;try{var x,C;if((x=e.logger)===null||x===void 0||x.trace("Sending key..."),yield e.transport.sendKey(G1(h.key),h.keyId,d),e.statistics.counters.roomEventEncryptionKeysSent+=1,h.sharedWith.push(...d),(C=e.logger)===null||C===void 0||C.trace("key index:".concat(h.keyId," sent to ").concat(h.sharedWith.map(O=>"".concat(O.userId,":").concat(O.deviceId)).join(","))),m){var R,T;(R=e.logger)===null||R===void 0||R.trace("Delay Rollout for key:".concat(h.keyId,"...")),yield Wp(e.useKeyDelay),(T=e.logger)===null||T===void 0||T.trace("...Delayed rollout of index:".concat(h.keyId," ")),e.addKeyToParticipantWithBackendIdentity(h.key,h.keyId,e.ownMembership,yield e.getOwnRtcBackendIdentity())}}catch(O){var M;(M=e.logger)===null||M===void 0||M.error("Failed to rollout key",O)}})()}createNewOutboundSession(){var e,n={key:this.generateRandomKey(),creationTS:Date.now(),sharedWith:[],keyId:this.nextKeyIndex()};return(e=this.logger)===null||e===void 0||e.info("creating new outbound key index:".concat(n.keyId)),this.outboundSession=n,n}nextKeyIndex(){return this.outboundSession?(this.outboundSession.keyId+1)%256:0}generateRandomKey(){var e=new Uint8Array(16);return globalThis.crypto.getRandomValues(e),e}}let l1e=class extends Error{constructor(e){super(e)}get name(){return"NotSupportedError"}};class u1e extends Kn{setParentLogger(e){this.logger=e.getChild("[ToDeviceKeyTransport]")}constructor(e,n,r,i,s){super(),this.membership=e,this.roomId=n,this.client=r,this.statistics=i,L(this,"logger",N),L(this,"onToDeviceEvent",o=>{if(o.getType()===Z.CallEncryptionKeysPrefix){var a=this.getValidEventContent(o);a&&o.getSender()&&this.receiveCallKeyEvent(o.getSender(),a)}}),this.setParentLogger(s??N)}start(){this.client.on(De.ToDeviceEvent,this.onToDeviceEvent)}stop(){this.client.off(De.ToDeviceEvent,this.onToDeviceEvent)}sendKey(e,n,r){var i=this;return B(function*(){var s={keys:{index:n,key:e},room_id:i.roomId,member:{claimed_device_id:i.membership.deviceId,id:i.membership.memberId},session:{call_id:"",application:"m.call",scope:"m.room"},sent_ts:Date.now()},o=r.map(a=>({userId:a.userId,deviceId:a.deviceId})).filter(a=>!(a.userId==i.membership.userId&&a.deviceId==i.membership.deviceId));o.length>0?(yield i.client.encryptAndSendToDevice(Z.CallEncryptionKeysPrefix,o,s).catch(a=>{var c=a.message;if(c.includes("unknown variant")&&c.includes("send_to_device")||c.includes("not supported"))throw new l1e("The widget driver does not support to-device encryption")}),i.statistics.counters.roomEventEncryptionKeysSent+=1):i.logger.warn("No targets found for sending key")})()}receiveCallKeyEvent(e,n){var r;this.statistics.counters.roomEventEncryptionKeysReceived+=1;var i=Date.now(),s=i-(typeof n.sent_ts=="number"?n.sent_ts:i);this.statistics.totals.roomEventEncryptionKeysReceivedTotalAge+=s;var o="".concat(e,":").concat(n.member.claimed_device_id);this.emit(Cv.ReceivedKeys,{userId:e,deviceId:n.member.claimed_device_id,memberId:(r=n.member.id)!==null&&r!==void 0?r:o},n.keys.key,n.keys.index,i)}getValidEventContent(e){var n=e.getContent(),r=n.room_id;if(!r){this.logger.warn("Malformed Event: invalid call encryption keys event, no roomId");return}if(r!==this.roomId){this.logger.warn("Malformed Event: Mismatch roomId");return}if(!n.keys||!n.keys.key||typeof n.keys.index!="number"){this.logger.warn("Malformed Event: Missing keys field");return}if(!n.member||!n.member.claimed_device_id){this.logger.warn("Malformed Event: Missing claimed_device_id");return}return n}}class d1e extends Kn{setParentLogger(e){this.logger=e.getChild("[RoomKeyTransport]")}constructor(e,n,r,i){super(),this.room=e,this.client=n,this.statistics=r,L(this,"logger",N),this.setParentLogger(i??N)}start(){this.room.on(Oe.Timeline,e=>{this.consumeCallEncryptionEvent(e)})}stop(){this.room.off(Oe.Timeline,e=>{this.consumeCallEncryptionEvent(e)})}consumeCallEncryptionEvent(e){var n=arguments,r=this;return B(function*(){var i=n.length>1&&n[1]!==void 0?n[1]:!1;if(yield r.client.decryptEventIfNeeded(e),e.isDecryptionFailure()){i?r.logger.warn("Decryption failed for event ".concat(e.getId(),": ").concat(e.decryptionFailureReason)):(r.logger.warn("Decryption failed for event ".concat(e.getId(),": ").concat(e.decryptionFailureReason," will retry once only")),setTimeout(()=>{r.consumeCallEncryptionEvent(e,!0)},1e3));return}else i&&r.logger.info("Decryption succeeded for event ".concat(e.getId()," after retry"));if(e.getType()!==Z.CallEncryptionKeysPrefix)return Promise.resolve();if(!r.room)return r.logger.error("Got room state event for unknown room ".concat(e.getRoomId(),"!")),Promise.resolve();r.onEncryptionEvent(e)})()}sendKey(e,n,r){var i=this;return B(function*(){var s={keys:[{index:n,key:e}],device_id:i.client.getDeviceId(),call_id:"",sent_ts:Date.now()};try{yield i.client.sendEvent(i.room.roomId,Z.CallEncryptionKeysPrefix,s)}catch(a){i.logger.error("Failed to send call encryption keys",a);var o=a;throw o.event&&i.client.cancelPendingEvent(o.event),a}})()}onEncryptionEvent(e){var n=e.getSender(),r=e.getContent(),i=r.device_id,s=r.call_id;if(!n){this.logger.warn("Received m.call.encryption_keys with no userId: callId=".concat(s));return}if(s!==""){this.logger.warn("Received m.call.encryption_keys with unsupported callId: userId=".concat(n,", deviceId=").concat(i,", callId=").concat(s));return}if(!Array.isArray(r.keys)){this.logger.warn("Received m.call.encryption_keys where keys wasn't an array: callId=".concat(s));return}if(n===this.client.getUserId()&&i===this.client.getDeviceId()){this.logger.info("Ignoring our own keys event");return}this.statistics.counters.roomEventEncryptionKeysReceived+=1;var o=Date.now()-(typeof r.sent_ts=="number"?r.sent_ts:e.getTs());this.statistics.totals.roomEventEncryptionKeysReceivedTotalAge+=o;for(var a of r.keys){if(!a){this.logger.info("Ignoring false-y key in keys event");continue}var c=a.key,l=a.index;!c||l===void 0||l===null||s===void 0||s===null||typeof i!="string"||typeof s!="string"||typeof c!="string"||typeof l!="number"?this.logger.warn("Malformed call encryption_key: userId=".concat(n,", deviceId=").concat(i,", encryptionKeyIndex=").concat(l," callId=").concat(s)):(this.logger.debug("onCallEncryption userId=".concat(n,":").concat(i," encryptionKeyIndex=").concat(l," age=").concat(o,"ms")),this.emit(Cv.ReceivedKeys,{userId:n,deviceId:i,memberId:"".concat(n,":").concat(i)},c,l,e.getTs()))}}}function EB(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function CB(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?EB(Object(n),!0).forEach(function(r){L(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):EB(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}var Zi=(function(t){return t.MembershipsChanged="memberships_changed",t.JoinStateChanged="join_state_changed",t.EncryptionKeyChanged="encryption_key_changed",t.MembershipManagerError="membership_manager_error",t.DidSendCallNotification="did_send_call_notification",t})({});function f1e(t){var[e,n]=t.split("#");return{application:e,id:n}}function jb(t){return"".concat(t.application,"#").concat(t.id)}var h1e={listenForStickyEvents:!0,listenForMemberStateEvents:!0};class Fb extends Kn{get membershipStatus(){var e;return(e=this.membershipManager)===null||e===void 0?void 0:e.status}get probablyLeft(){var e;return(e=this.membershipManager)===null||e===void 0?void 0:e.probablyLeft}get delayId(){var e;return(e=this.membershipManager)===null||e===void 0?void 0:e.delayId}get callId(){var e;return(e=this.slotDescription)===null||e===void 0?void 0:e.id}get slotId(){return jb(this.slotDescription)}static sessionMembershipsForSlot(e,n){var r=arguments;return B(function*(){var i=r.length>2&&r[2]!==void 0?r[2]:h1e,s=N.getChild("[MatrixRTCSession ".concat(e.roomId,"]")),o=v1e(e,i,s),a=yield p1e(e,o,n,s);return a.sort((c,l)=>c.createdTs()-l.createdTs()),a.length>1&&s.debug("Call memberships in room ".concat(e.roomId,", in order: "),a.map(c=>[c.createdTs(),c.userId])),a})()}static sessionForSlot(e,n,r,i){return new Fb(e,n,r,i)}get room(){return this.roomSubset}constructor(e,n,r,i){var s;super(),s=this,this.client=e,this.roomSubset=n,this.slotDescription=r,this.calculateMembershipsOpts=i,L(this,"membershipManager",void 0),L(this,"encryptionManager",void 0),L(this,"joinConfig",void 0),L(this,"logger",void 0),L(this,"pendingNotificationToSend",void 0),L(this,"expiryTimeout",void 0),L(this,"memberships",[]),L(this,"statistics",{counters:{roomEventEncryptionKeysSent:0,roomEventEncryptionKeysReceived:0},totals:{roomEventEncryptionKeysReceivedTotalAge:0}}),L(this,"reEmitter",new ly(this)),L(this,"onRoomMemberUpdate",()=>{this.ensureRecalculateSessionMembers()}),L(this,"onStickyEventUpdate",(o,a,c)=>{[...o,...c,...a.flatMap(l=>[l.current,l.previous])].some(l=>l.getType()===Z.RTCMembership)&&this.ensureRecalculateSessionMembers()}),L(this,"_onRTCSessionMemberUpdate",B(function*(){yield s.recalculateSessionMembers()})),L(this,"recalculateSessionMembersDirty",!1),L(this,"recalculateSessionMembersPromise",void 0),L(this,"recalculateSessionMembers",B(function*(){var o,a=s.memberships;s.memberships=yield Fb.sessionMembershipsForSlot(s.room,jb(s.slotDescription),s.calculateMembershipsOpts);var c=a.length!=s.memberships.length||a.some((g,y)=>!If.equal(g,s.memberships[y]));if(c){var l,d;s.logger.info("Memberships for call in room ".concat(s.roomSubset.roomId," have changed: emitting (").concat(s.memberships.length," members)")),_ve(s.logger,"emit MatrixRTCSessionEvent.MembershipsChanged",()=>{s.emit(Zi.MembershipsChanged,a,s.memberships)}),(l=s.membershipManager)===null||l===void 0||l.onRTCSessionMemberUpdate(s.memberships);var h=(d=s.membershipManager)===null||d===void 0?void 0:d.ownMembership;if(s.pendingNotificationToSend&&h&&a.length===0){var m;h.eventId&&(m=s.joinConfig)!==null&&m!==void 0&&m.notificationType?s.sendCallNotify(h.eventId,s.joinConfig.notificationType,h.callIntent):s.logger.warn("Own membership eventId is undefined, cannot send call notification")}s.memberships.length>0&&(s.pendingNotificationToSend=void 0)}else s.logger.debug("No membership changes detected for room ".concat(s.roomSubset.roomId));(o=s.encryptionManager)===null||o===void 0||o.onMembershipsUpdate(a),s.setExpiryTimer()})),this.logger=N.getChild("[MatrixRTCSession ".concat(n.roomId,"]")),this.roomSubset.on(Ct.Members,this.onRoomMemberUpdate),this.roomSubset.on(pf.Update,this.onStickyEventUpdate),this.ensureRecalculateSessionMembers(),this.setExpiryTimer()}isJoined(){var e,n;return(e=(n=this.membershipManager)===null||n===void 0?void 0:n.isJoined())!==null&&e!==void 0?e:!1}stop(){var e=this;return B(function*(){var n;yield(n=e.membershipManager)===null||n===void 0?void 0:n.leave(1e3),e.expiryTimeout&&(clearTimeout(e.expiryTimeout),e.expiryTimeout=void 0),e.roomSubset.off(Ct.Members,e.onRoomMemberUpdate),e.roomSubset.off(pf.Update,e.onStickyEventUpdate)})()}joinRTCSession(e,n,r,i){var s;if(this.isJoined()){this.logger.info("Already joined to session in room ".concat(this.roomSubset.roomId,": ignoring join call"));return}else{this.membershipManager=i!=null&&i.unstableSendStickyEvents?new IT(i,this.roomSubset,this.client,this.slotDescription,e.memberId,this.logger):new Ub(i,this.roomSubset,this.client,this.slotDescription,this.logger),this.reEmitter.reEmit(this.membershipManager,[gl.ProbablyLeft,gl.StatusChanged,gl.DelayIdChanged]);var o;if(i!=null&&i.useExperimentalToDeviceTransport){this.logger.info("Using experimental to-device transport for encryption keys"),this.logger.info("Using to-device with room fallback transport for encryption keys");var[a,c,l]=[this.roomSubset,this.client,this.statistics],d=new u1e(e,a.roomId,c,l);this.encryptionManager=new c1e(e,()=>this.memberships,d,this.statistics,(h,m,g,y)=>{this.emit(Zi.EncryptionKeyChanged,h,m,g,y)},this.logger)}else o=new d1e(this.roomSubset,this.client,this.statistics),this.encryptionManager=new s1e(e,()=>this.memberships,o,this.statistics,(h,m,g,y)=>{this.emit(Zi.EncryptionKeyChanged,h,m,g,y)})}this.joinConfig=i,this.pendingNotificationToSend=(s=this.joinConfig)===null||s===void 0?void 0:s.notificationType,this.membershipManager.join(n,r,h=>{this.logger.error("MembershipManager encountered an unrecoverable error: ",h),this.emit(Zi.MembershipManagerError,h),this.emit(Zi.JoinStateChanged,this.isJoined())}),this.encryptionManager.join(i),this.emit(Zi.JoinStateChanged,!0)}joinRoomSession(e,n,r){var[i,s]=[this.client.getUserId(),this.client.getDeviceId()],o="".concat(i,":").concat(s);this.joinRTCSession({userId:i,deviceId:s,memberId:o},e,n,r)}leaveRoomSession(){var e=arguments,n=this;return B(function*(){var r=e.length>0&&e[0]!==void 0?e[0]:void 0;if(!n.isJoined())return n.logger.info("Not joined to session in room ".concat(n.roomSubset.roomId,": ignoring leave call")),!1;n.logger.info("Leaving call session in room ".concat(n.roomSubset.roomId)),n.encryptionManager.leave();var i=n.membershipManager.leave(r);return n.emit(Zi.JoinStateChanged,!1),yield i})()}getFocusInUse(){var e=this.getOldestMembership();return e?.getTransport(e)}getActiveFocus(){var e;return(e=this.getOldestMembership())===null||e===void 0?void 0:e.getFocusActive()}getOldestMembership(){return this.memberships[0]}getConsensusCallIntent(){var e,n=(e=this.memberships.find(r=>!!r.callIntent))===null||e===void 0?void 0:e.callIntent;if(n&&this.memberships.every(r=>!r.callIntent||r.callIntent===n))return n}updateCallIntent(e){var n=this;return B(function*(){var r,i,s=(r=n.membershipManager)===null||r===void 0?void 0:r.ownMembership;if(!s)throw Error("Not connected yet");yield(i=n.membershipManager)===null||i===void 0?void 0:i.updateCallIntent(e)})()}reemitEncryptionKeys(){var e;(e=this.encryptionManager)===null||e===void 0||e.getEncryptionKeys().forEach((n,r)=>{n.forEach(i=>{this.emit(Zi.EncryptionKeyChanged,i.key,i.keyIndex,i.membership,i.rtcBackendIdentity)})})}setExpiryTimer(){this.expiryTimeout&&(clearTimeout(this.expiryTimeout),this.expiryTimeout=void 0);var e;for(var n of this.memberships){var r=n.getMsUntilExpiry();r!==void 0&&(e===void 0||r<e)&&(e=r)}e!=null&&(this.expiryTimeout=setTimeout(this.ensureRecalculateSessionMembers.bind(this),e))}sendCallNotify(e,n,r){var i=this,s=(function(){var o=B(function*(){var a={"m.mentions":{user_ids:[],room:!0},notification_type:n,"m.relates_to":{event_id:e,rel_type:bn.Reference},sender_ts:Date.now(),lifetime:3e4};r&&(a["m.call.intent"]=r);var c=yield i.client.sendEvent(i.roomSubset.roomId,Z.RTCNotification,a);return{response:c,content:a}});return function(){return o.apply(this,arguments)}})();s().then(o=>{var a=CB(CB({},o.response),o.content);this.emit(Zi.DidSendCallNotification,a)}).catch(o=>{var[a,c]=o;return this.logger.error("Failed to send call notification",a,c)})}ensureRecalculateSessionMembers(){this.recalculateSessionMembersPromise===void 0?this.recalculateSessionMembersPromise=this.recalculateSessionMembers().then(()=>{this.recalculateSessionMembersPromise=void 0,this.recalculateSessionMembersDirty&&(this.ensureRecalculateSessionMembers(),this.recalculateSessionMembersDirty=!1)}):this.recalculateSessionMembersDirty=!0}}function p1e(t,e,n,r){return GA.apply(this,arguments)}function GA(){return GA=B(function*(t,e,n,r){var i=[];for(var s of e){var o=s.getContent();if(m1e(o,r))try{var a=If.membershipDataFromMatrixEvent(s),c=new If(s,a,yield If.computeRtcBackendIdentity(s,a),r);g1e(c,t,n,r)&&i.push(c)}catch(l){r.warn("Couldn't construct call membership: ",l)}}return i}),GA.apply(this,arguments)}function m1e(t,e){var n=Object.keys(t).filter(r=>r!=="msc4354_sticky_key").length;return n===0?!1:n>1&&"application"in t?!0:(n===1&&"memberships"in t&&e.warn("Legacy event found. Those are ignored, they do not contribute to the MatrixRTC session"),!1)}function g1e(t,e,n,r){var i;return t.slotId!==n?(r.info("Ignoring membership of user ".concat(t.userId," for a different slot: user: ").concat(JSON.stringify(t.slotDescription),", slotId: ").concat(n,")")),!1):t.isExpired()?(r.info("Ignoring expired device membership ".concat(t.userId,"/").concat(t.deviceId)),!1):e.hasMembershipState((i=t.userId)!==null&&i!==void 0?i:"",Ve.Join)?!0:(r.info("Ignoring membership of user ".concat(t.userId," who is not in the room.")),!1)}function v1e(t,e,n){var{listenForStickyEvents:r,listenForMemberStateEvents:i}=e,s=[];if(r&&(s=[...t._unstable_getStickyEvents()].filter(c=>c.getType()===Z.RTCMembership)),i){var o=t.getLiveTimeline().getState(Fe.FORWARDS);if(!o)return n.warn("Couldn't get state for room "+t.roomId+"using empty membership array"),[];var a=o.getStateEvents(Z.GroupCallMemberPrefix);s=s.concat(a.filter(c=>!s.some(l=>l.getContent().msc4354_sticky_key===c.getStateKey())))}return s}var OC=(function(t){return t.SessionStarted="session_started",t.SessionEnded="session_ended",t})({});class y1e extends Kn{constructor(e,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{application:"m.call",id:"ROOM"};super(),this.client=n,this.slotDescription=r,L(this,"roomSessions",new Map),L(this,"logger",void 0),L(this,"onRoom",i=>{this.refreshRoom(i)}),L(this,"onEvent",i=>{if(i.unstableStickyExpiresAt&&i.getType()===Z.RTCMembership){var s=this.client.getRoom(i.getRoomId());s&&this.refreshRoom(s)}}),L(this,"onRoomState",i=>{if(i.getType()===Z.GroupCallMemberPrefix){var s=this.client.getRoom(i.getRoomId());if(!s){this.logger.error("Got room state event for unknown room ".concat(i.getRoomId(),"!"));return}this.refreshRoom(s)}}),this.logger=e.getChild("[MatrixRTCSessionManager]")}start(){for(var e of(n=this.client.getRooms())!==null&&n!==void 0?n:[]){var n,r=Fb.sessionForSlot(this.client,e,this.slotDescription);r.memberships.length>0&&this.roomSessions.set(e.roomId,r)}this.client.on(De.Room,this.onRoom),this.client.on(De.Event,this.onEvent),this.client.on(Ct.Events,this.onRoomState)}stop(){for(var e of this.roomSessions.values())e.stop();this.roomSessions.clear(),this.client.off(De.Room,this.onRoom),this.client.off(De.Event,this.onEvent),this.client.off(Ct.Events,this.onRoomState)}getActiveRoomSession(e){return this.roomSessions.get(e.roomId)}getRoomSession(e){return this.roomSessions.has(e.roomId)||this.roomSessions.set(e.roomId,Fb.sessionForSlot(this.client,e,this.slotDescription)),this.roomSessions.get(e.roomId)}refreshRoom(e){var n=this;return B(function*(){var r=!n.roomSessions.has(e.roomId),i=n.getRoomSession(e),s=i.memberships.length>0&&!r;yield i._onRTCSessionMemberUpdate().catch(a=>{n.logger.error("Error updating RTC session members for ".concat(e.roomId,": ").concat(a))});var o=i.memberships.length>0;s&&!o?(n.logger.trace("Session ended for ".concat(e.roomId," (").concat(i.memberships.length," members)")),n.emit(OC.SessionEnded,e.roomId,n.roomSessions.get(e.roomId))):!s&&o&&(n.logger.trace("Session started for ".concat(e.roomId," (").concat(i.memberships.length," members)")),n.emit(OC.SessionStarted,e.roomId,n.roomSessions.get(e.roomId)))})()}}function hx(t){return e=>{var n,r;return((n=e.content)===null||n===void 0||(n=n["m.relates_to"])===null||n===void 0?void 0:n.event_id)!==t||((r=e.content)===null||r===void 0||(r=r["m.relates_to"])===null||r===void 0?void 0:r.rel_type)===Rn.name}}class L1 extends Error{}L1.prototype.name="InvalidTokenError";function b1e(t){return decodeURIComponent(atob(t).replace(/(.)/g,(e,n)=>{let r=n.charCodeAt(0).toString(16).toUpperCase();return r.length<2&&(r="0"+r),"%"+r}))}function _1e(t){let e=t.replace(/-/g,"+").replace(/_/g,"/");switch(e.length%4){case 0:break;case 2:e+="==";break;case 3:e+="=";break;default:throw new Error("base64 string is not of the correct length")}try{return b1e(e)}catch{return atob(e)}}function zX(t,e){if(typeof t!="string")throw new L1("Invalid token specified: must be a string");e||(e={});const n=e.header===!0?0:1,r=t.split(".")[n];if(typeof r!="string")throw new L1(`Invalid token specified: missing part #${n+1}`);let i;try{i=_1e(r)}catch(s){throw new L1(`Invalid token specified: invalid base64 for part #${n+1} (${s.message})`)}try{return JSON.parse(i)}catch(s){throw new L1(`Invalid token specified: invalid json for part #${n+1} (${s.message})`)}}var S1e={debug:()=>{},info:()=>{},warn:()=>{},error:()=>{}},ll,ul,$b=(t=>(t[t.NONE=0]="NONE",t[t.ERROR=1]="ERROR",t[t.WARN=2]="WARN",t[t.INFO=3]="INFO",t[t.DEBUG=4]="DEBUG",t))($b||{});(t=>{function e(){ll=3,ul=S1e}t.reset=e;function n(i){if(!(0<=i&&i<=4))throw new Error("Invalid log level");ll=i}t.setLevel=n;function r(i){ul=i}t.setLogger=r})($b||($b={}));var Hr=class sl{constructor(e){this._name=e}debug(...e){ll>=4&&ul.debug(sl._format(this._name,this._method),...e)}info(...e){ll>=3&&ul.info(sl._format(this._name,this._method),...e)}warn(...e){ll>=2&&ul.warn(sl._format(this._name,this._method),...e)}error(...e){ll>=1&&ul.error(sl._format(this._name,this._method),...e)}throw(e){throw this.error(e),e}create(e){const n=Object.create(this);return n._method=e,n.debug("begin"),n}static createStatic(e,n){const r=new sl(`${e}.${n}`);return r.debug("begin"),r}static _format(e,n){const r=`[${e}]`;return n?`${r} ${n}:`:r}static debug(e,...n){ll>=4&&ul.debug(sl._format(e),...n)}static info(e,...n){ll>=3&&ul.info(sl._format(e),...n)}static warn(e,...n){ll>=2&&ul.warn(sl._format(e),...n)}static error(e,...n){ll>=1&&ul.error(sl._format(e),...n)}};$b.reset();var PC=class{static decode(t){try{return zX(t)}catch(e){throw Hr.error("JwtUtils.decode",e),e}}static async generateSignedJwt(t,e,n){const r=Pc.encodeBase64Url(new TextEncoder().encode(JSON.stringify(t))),i=Pc.encodeBase64Url(new TextEncoder().encode(JSON.stringify(e))),s=`${r}.${i}`,o=await window.crypto.subtle.sign({name:"ECDSA",hash:{name:"SHA-256"}},n,new TextEncoder().encode(s)),a=Pc.encodeBase64Url(new Uint8Array(o));return`${s}.${a}`}},w1e="10000000-1000-4000-8000-100000000000",zA=t=>btoa([...new Uint8Array(t)].map(e=>String.fromCharCode(e)).join("")),WX=class ol{static _randomWord(){const e=new Uint32Array(1);return crypto.getRandomValues(e),e[0]}static generateUUIDv4(){return w1e.replace(/[018]/g,n=>(+n^ol._randomWord()&15>>+n/4).toString(16)).replace(/-/g,"")}static generateCodeVerifier(){return ol.generateUUIDv4()+ol.generateUUIDv4()+ol.generateUUIDv4()}static async generateCodeChallenge(e){if(!crypto.subtle)throw new Error("Crypto.subtle is available only in secure contexts (HTTPS).");try{const r=new TextEncoder().encode(e),i=await crypto.subtle.digest("SHA-256",r);return zA(i).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}catch(n){throw Hr.error("CryptoUtils.generateCodeChallenge",n),n}}static generateBasicAuth(e,n){const i=new TextEncoder().encode([e,n].join(":"));return zA(i)}static async hash(e,n){const r=new TextEncoder().encode(n),i=await crypto.subtle.digest(e,r);return new Uint8Array(i)}static async customCalculateJwkThumbprint(e){let n;switch(e.kty){case"RSA":n={e:e.e,kty:e.kty,n:e.n};break;case"EC":n={crv:e.crv,kty:e.kty,x:e.x,y:e.y};break;case"OKP":n={crv:e.crv,kty:e.kty,x:e.x};break;case"oct":n={crv:e.k,kty:e.kty};break;default:throw new Error("Unknown jwk type")}const r=await ol.hash("SHA-256",JSON.stringify(n));return ol.encodeBase64Url(r)}static async generateDPoPProof({url:e,accessToken:n,httpMethod:r,keyPair:i,nonce:s}){let o,a;const c={jti:window.crypto.randomUUID(),htm:r??"GET",htu:e,iat:Math.floor(Date.now()/1e3)};n&&(o=await ol.hash("SHA-256",n),a=ol.encodeBase64Url(o),c.ath=a),s&&(c.nonce=s);try{const l=await crypto.subtle.exportKey("jwk",i.publicKey),d={alg:"ES256",typ:"dpop+jwt",jwk:{crv:l.crv,kty:l.kty,x:l.x,y:l.y}};return await PC.generateSignedJwt(d,c,i.privateKey)}catch(l){throw l instanceof TypeError?new Error(`Error exporting dpop public key: ${l.message}`):l}}static async generateDPoPJkt(e){try{const n=await crypto.subtle.exportKey("jwk",e.publicKey);return await ol.customCalculateJwkThumbprint(n)}catch(n){throw n instanceof TypeError?new Error(`Could not retrieve dpop keys from storage: ${n.message}`):n}}static async generateDPoPKeys(){return await window.crypto.subtle.generateKey({name:"ECDSA",namedCurve:"P-256"},!1,["sign","verify"])}};WX.encodeBase64Url=t=>zA(t).replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_");var Pc=WX,E1e=class{constructor(e){this._name=e,this._callbacks=[],this._logger=new Hr(`Event('${this._name}')`)}addHandler(e){return this._callbacks.push(e),()=>this.removeHandler(e)}removeHandler(e){const n=this._callbacks.lastIndexOf(e);n>=0&&this._callbacks.splice(n,1)}async raise(...e){this._logger.debug("raise:",...e);for(const n of this._callbacks)await n(...e)}},DC=class yE extends E1e{constructor(){super(...arguments),this._logger=new Hr(`Timer('${this._name}')`),this._timerHandle=null,this._expiration=0,this._callback=()=>{const e=this._expiration-yE.getEpochTime();this._logger.debug("timer completes in",e),this._expiration<=yE.getEpochTime()&&(this.cancel(),super.raise())}}static getEpochTime(){return Math.floor(Date.now()/1e3)}init(e){const n=this._logger.create("init");e=Math.max(Math.floor(e),1);const r=yE.getEpochTime()+e;if(this.expiration===r&&this._timerHandle){n.debug("skipping since already initialized for expiration at",this.expiration);return}this.cancel(),n.debug("using duration",e),this._expiration=r;const i=Math.min(e,5);this._timerHandle=setInterval(this._callback,i*1e3)}get expiration(){return this._expiration}cancel(){this._logger.create("cancel"),this._timerHandle&&(clearInterval(this._timerHandle),this._timerHandle=null)}},TB=class{static readParams(t,e="query"){if(!t)throw new TypeError("Invalid URL");const r=new URL(t,"http://127.0.0.1")[e==="fragment"?"hash":"search"];return new URLSearchParams(r.slice(1))}},WA=";",Tv=class extends Error{constructor(t,e){var n,r,i;if(super(t.error_description||t.error||""),this.form=e,this.name="ErrorResponse",!t.error)throw Hr.error("ErrorResponse","No error passed"),new Error("No error passed");this.error=t.error,this.error_description=(n=t.error_description)!=null?n:null,this.error_uri=(r=t.error_uri)!=null?r:null,this.state=t.userState,this.session_state=(i=t.session_state)!=null?i:null,this.url_state=t.url_state}},C1e=class extends Error{constructor(t){super(t),this.name="ErrorTimeout"}},T1e=class{constructor(){this._logger=new Hr("InMemoryWebStorage"),this._data={}}clear(){this._logger.create("clear"),this._data={}}getItem(t){return this._logger.create(`getItem('${t}')`),this._data[t]}setItem(t,e){this._logger.create(`setItem('${t}')`),this._data[t]=e}removeItem(t){this._logger.create(`removeItem('${t}')`),delete this._data[t]}get length(){return Object.getOwnPropertyNames(this._data).length}key(t){return Object.getOwnPropertyNames(this._data)[t]}},YA=class extends Error{constructor(t,e){super(e),this.name="ErrorDPoPNonce",this.nonce=t}},SP=class{constructor(t=[],e=null,n={}){this._jwtHandler=e,this._extraHeaders=n,this._logger=new Hr("JsonService"),this._contentTypes=[],this._contentTypes.push(...t,"application/json"),e&&this._contentTypes.push("application/jwt")}async fetchWithTimeout(t,e={}){const{timeoutInSeconds:n,...r}=e;if(!n)return await fetch(t,r);const i=new AbortController,s=setTimeout(()=>i.abort(),n*1e3);try{return await fetch(t,{...e,signal:i.signal})}catch(o){throw o instanceof DOMException&&o.name==="AbortError"?new C1e("Network timed out"):o}finally{clearTimeout(s)}}async getJson(t,{token:e,credentials:n,timeoutInSeconds:r}={}){const i=this._logger.create("getJson"),s={Accept:this._contentTypes.join(", ")};e&&(i.debug("token passed, setting Authorization header"),s.Authorization="Bearer "+e),this.appendExtraHeaders(s);let o;try{i.debug("url:",t),o=await this.fetchWithTimeout(t,{method:"GET",headers:s,timeoutInSeconds:r,credentials:n})}catch(l){throw i.error("Network Error"),l}i.debug("HTTP response received, status",o.status);const a=o.headers.get("Content-Type");if(a&&!this._contentTypes.find(l=>a.startsWith(l))&&i.throw(new Error(`Invalid response Content-Type: ${a??"undefined"}, from URL: ${t}`)),o.ok&&this._jwtHandler&&a?.startsWith("application/jwt"))return await this._jwtHandler(await o.text());let c;try{c=await o.json()}catch(l){throw i.error("Error parsing JSON response",l),o.ok?l:new Error(`${o.statusText} (${o.status})`)}if(!o.ok)throw i.error("Error from server:",c),c.error?new Tv(c):new Error(`${o.statusText} (${o.status}): ${JSON.stringify(c)}`);return c}async postForm(t,{body:e,basicAuth:n,timeoutInSeconds:r,initCredentials:i,extraHeaders:s}){const o=this._logger.create("postForm"),a={Accept:this._contentTypes.join(", "),"Content-Type":"application/x-www-form-urlencoded",...s};n!==void 0&&(a.Authorization="Basic "+n),this.appendExtraHeaders(a);let c;try{o.debug("url:",t),c=await this.fetchWithTimeout(t,{method:"POST",headers:a,body:e,timeoutInSeconds:r,credentials:i})}catch(m){throw o.error("Network error"),m}o.debug("HTTP response received, status",c.status);const l=c.headers.get("Content-Type");if(l&&!this._contentTypes.find(m=>l.startsWith(m)))throw new Error(`Invalid response Content-Type: ${l??"undefined"}, from URL: ${t}`);const d=await c.text();let h={};if(d)try{h=JSON.parse(d)}catch(m){throw o.error("Error parsing JSON response",m),c.ok?m:new Error(`${c.statusText} (${c.status})`)}if(!c.ok){if(o.error("Error from server:",h),c.headers.has("dpop-nonce")){const m=c.headers.get("dpop-nonce");throw new YA(m,`${JSON.stringify(h)}`)}throw h.error?new Tv(h,e):new Error(`${c.statusText} (${c.status}): ${JSON.stringify(h)}`)}return h}appendExtraHeaders(t){const e=this._logger.create("appendExtraHeaders"),n=Object.keys(this._extraHeaders),r=["authorization","accept","content-type"];n.length!==0&&n.forEach(i=>{if(r.includes(i.toLocaleLowerCase())){e.warn("Protected header could not be overridden",i,r);return}const s=typeof this._extraHeaders[i]=="function"?this._extraHeaders[i]():this._extraHeaders[i];s&&s!==""&&(t[i]=s)})}},YX=class{constructor(t){this._settings=t,this._logger=new Hr("MetadataService"),this._signingKeys=null,this._metadata=null,this._metadataUrl=this._settings.metadataUrl,this._jsonService=new SP(["application/jwk-set+json"],null,this._settings.extraHeaders),this._settings.signingKeys&&(this._logger.debug("using signingKeys from settings"),this._signingKeys=this._settings.signingKeys),this._settings.metadata&&(this._logger.debug("using metadata from settings"),this._metadata=this._settings.metadata),this._settings.fetchRequestCredentials&&(this._logger.debug("using fetchRequestCredentials from settings"),this._fetchRequestCredentials=this._settings.fetchRequestCredentials)}resetSigningKeys(){this._signingKeys=null}async getMetadata(){const t=this._logger.create("getMetadata");if(this._metadata)return t.debug("using cached values"),this._metadata;if(!this._metadataUrl)throw t.throw(new Error("No authority or metadataUrl configured on settings")),null;t.debug("getting metadata from",this._metadataUrl);const e=await this._jsonService.getJson(this._metadataUrl,{credentials:this._fetchRequestCredentials,timeoutInSeconds:this._settings.requestTimeoutInSeconds});return t.debug("merging remote JSON with seed metadata"),this._metadata=Object.assign({},this._settings.metadataSeed,e),this._metadata}getIssuer(){return this._getMetadataProperty("issuer")}getAuthorizationEndpoint(){return this._getMetadataProperty("authorization_endpoint")}getUserInfoEndpoint(){return this._getMetadataProperty("userinfo_endpoint")}getTokenEndpoint(t=!0){return this._getMetadataProperty("token_endpoint",t)}getCheckSessionIframe(){return this._getMetadataProperty("check_session_iframe",!0)}getEndSessionEndpoint(){return this._getMetadataProperty("end_session_endpoint",!0)}getRevocationEndpoint(t=!0){return this._getMetadataProperty("revocation_endpoint",t)}getKeysEndpoint(t=!0){return this._getMetadataProperty("jwks_uri",t)}async _getMetadataProperty(t,e=!1){const n=this._logger.create(`_getMetadataProperty('${t}')`),r=await this.getMetadata();if(n.debug("resolved"),r[t]===void 0){if(e===!0){n.warn("Metadata does not contain optional property");return}n.throw(new Error("Metadata does not contain property "+t))}return r[t]}async getSigningKeys(){const t=this._logger.create("getSigningKeys");if(this._signingKeys)return t.debug("returning signingKeys from cache"),this._signingKeys;const e=await this.getKeysEndpoint(!1);t.debug("got jwks_uri",e);const n=await this._jsonService.getJson(e,{timeoutInSeconds:this._settings.requestTimeoutInSeconds});if(t.debug("got key set",n),!Array.isArray(n.keys))throw t.throw(new Error("Missing keys on keyset")),null;return this._signingKeys=n.keys,this._signingKeys}},xT=class{constructor({prefix:t="oidc.",store:e=localStorage}={}){this._logger=new Hr("WebStorageStateStore"),this._store=e,this._prefix=t}async set(t,e){this._logger.create(`set('${t}')`),t=this._prefix+t,await this._store.setItem(t,e)}async get(t){return this._logger.create(`get('${t}')`),t=this._prefix+t,await this._store.getItem(t)}async remove(t){this._logger.create(`remove('${t}')`),t=this._prefix+t;const e=await this._store.getItem(t);return await this._store.removeItem(t),e}async getAllKeys(){this._logger.create("getAllKeys");const t=await this._store.length,e=[];for(let n=0;n<t;n++){const r=await this._store.key(n);r&&r.indexOf(this._prefix)===0&&e.push(r.substr(this._prefix.length))}return e}},R1e="code",k1e="openid",I1e="client_secret_post",x1e=900,JA=class{constructor({authority:t,metadataUrl:e,metadata:n,signingKeys:r,metadataSeed:i,client_id:s,client_secret:o,response_type:a=R1e,scope:c=k1e,redirect_uri:l,post_logout_redirect_uri:d,client_authentication:h=I1e,prompt:m,display:g,max_age:y,ui_locales:v,acr_values:E,resource:w,response_mode:k,filterProtocolClaims:x=!0,loadUserInfo:C=!1,requestTimeoutInSeconds:R,staleStateAgeInSeconds:T=x1e,mergeClaimsStrategy:M={array:"replace"},disablePKCE:O=!1,stateStore:P,revokeTokenAdditionalContentTypes:D,fetchRequestCredentials:j,refreshTokenAllowedScope:$,extraQueryParams:q={},extraTokenParams:Y={},extraHeaders:W={},dpop:H,omitScopeWhenRequesting:F=!1}){var V;if(this.authority=t,e?this.metadataUrl=e:(this.metadataUrl=t,t&&(this.metadataUrl.endsWith("/")||(this.metadataUrl+="/"),this.metadataUrl+=".well-known/openid-configuration")),this.metadata=n,this.metadataSeed=i,this.signingKeys=r,this.client_id=s,this.client_secret=o,this.response_type=a,this.scope=c,this.redirect_uri=l,this.post_logout_redirect_uri=d,this.client_authentication=h,this.prompt=m,this.display=g,this.max_age=y,this.ui_locales=v,this.acr_values=E,this.resource=w,this.response_mode=k,this.filterProtocolClaims=x??!0,this.loadUserInfo=!!C,this.staleStateAgeInSeconds=T,this.mergeClaimsStrategy=M,this.omitScopeWhenRequesting=F,this.disablePKCE=!!O,this.revokeTokenAdditionalContentTypes=D,this.fetchRequestCredentials=j||"same-origin",this.requestTimeoutInSeconds=R,P)this.stateStore=P;else{const G=typeof window<"u"?window.localStorage:new T1e;this.stateStore=new xT({store:G})}if(this.refreshTokenAllowedScope=$,this.extraQueryParams=q,this.extraTokenParams=Y,this.extraHeaders=W,this.dpop=H,this.dpop&&!((V=this.dpop)!=null&&V.store))throw new Error("A DPoPStore is required when dpop is enabled")}},A1e=class{constructor(t,e){this._settings=t,this._metadataService=e,this._logger=new Hr("UserInfoService"),this._getClaimsFromJwt=async n=>{const r=this._logger.create("_getClaimsFromJwt");try{const i=PC.decode(n);return r.debug("JWT decoding successful"),i}catch(i){throw r.error("Error parsing JWT response"),i}},this._jsonService=new SP(void 0,this._getClaimsFromJwt,this._settings.extraHeaders)}async getClaims(t){const e=this._logger.create("getClaims");t||this._logger.throw(new Error("No token passed"));const n=await this._metadataService.getUserInfoEndpoint();e.debug("got userinfo url",n);const r=await this._jsonService.getJson(n,{token:t,credentials:this._settings.fetchRequestCredentials,timeoutInSeconds:this._settings.requestTimeoutInSeconds});return e.debug("got claims",r),r}},JX=class{constructor(t,e){this._settings=t,this._metadataService=e,this._logger=new Hr("TokenClient"),this._jsonService=new SP(this._settings.revokeTokenAdditionalContentTypes,null,this._settings.extraHeaders)}async exchangeCode({grant_type:t="authorization_code",redirect_uri:e=this._settings.redirect_uri,client_id:n=this._settings.client_id,client_secret:r=this._settings.client_secret,extraHeaders:i,...s}){const o=this._logger.create("exchangeCode");n||o.throw(new Error("A client_id is required")),e||o.throw(new Error("A redirect_uri is required")),s.code||o.throw(new Error("A code is required"));const a=new URLSearchParams({grant_type:t,redirect_uri:e});for(const[h,m]of Object.entries(s))m!=null&&a.set(h,m);let c;switch(this._settings.client_authentication){case"client_secret_basic":if(!r)throw o.throw(new Error("A client_secret is required")),null;c=Pc.generateBasicAuth(n,r);break;case"client_secret_post":a.append("client_id",n),r&&a.append("client_secret",r);break}const l=await this._metadataService.getTokenEndpoint(!1);o.debug("got token endpoint");const d=await this._jsonService.postForm(l,{body:a,basicAuth:c,timeoutInSeconds:this._settings.requestTimeoutInSeconds,initCredentials:this._settings.fetchRequestCredentials,extraHeaders:i});return o.debug("got response"),d}async exchangeCredentials({grant_type:t="password",client_id:e=this._settings.client_id,client_secret:n=this._settings.client_secret,scope:r=this._settings.scope,...i}){const s=this._logger.create("exchangeCredentials");e||s.throw(new Error("A client_id is required"));const o=new URLSearchParams({grant_type:t});this._settings.omitScopeWhenRequesting||o.set("scope",r);for(const[d,h]of Object.entries(i))h!=null&&o.set(d,h);let a;switch(this._settings.client_authentication){case"client_secret_basic":if(!n)throw s.throw(new Error("A client_secret is required")),null;a=Pc.generateBasicAuth(e,n);break;case"client_secret_post":o.append("client_id",e),n&&o.append("client_secret",n);break}const c=await this._metadataService.getTokenEndpoint(!1);s.debug("got token endpoint");const l=await this._jsonService.postForm(c,{body:o,basicAuth:a,timeoutInSeconds:this._settings.requestTimeoutInSeconds,initCredentials:this._settings.fetchRequestCredentials});return s.debug("got response"),l}async exchangeRefreshToken({grant_type:t="refresh_token",client_id:e=this._settings.client_id,client_secret:n=this._settings.client_secret,timeoutInSeconds:r,extraHeaders:i,...s}){const o=this._logger.create("exchangeRefreshToken");e||o.throw(new Error("A client_id is required")),s.refresh_token||o.throw(new Error("A refresh_token is required"));const a=new URLSearchParams({grant_type:t});for(const[h,m]of Object.entries(s))Array.isArray(m)?m.forEach(g=>a.append(h,g)):m!=null&&a.set(h,m);let c;switch(this._settings.client_authentication){case"client_secret_basic":if(!n)throw o.throw(new Error("A client_secret is required")),null;c=Pc.generateBasicAuth(e,n);break;case"client_secret_post":a.append("client_id",e),n&&a.append("client_secret",n);break}const l=await this._metadataService.getTokenEndpoint(!1);o.debug("got token endpoint");const d=await this._jsonService.postForm(l,{body:a,basicAuth:c,timeoutInSeconds:r,initCredentials:this._settings.fetchRequestCredentials,extraHeaders:i});return o.debug("got response"),d}async revoke(t){var e;const n=this._logger.create("revoke");t.token||n.throw(new Error("A token is required"));const r=await this._metadataService.getRevocationEndpoint(!1);n.debug(`got revocation endpoint, revoking ${(e=t.token_type_hint)!=null?e:"default token type"}`);const i=new URLSearchParams;for(const[s,o]of Object.entries(t))o!=null&&i.set(s,o);i.set("client_id",this._settings.client_id),this._settings.client_secret&&i.set("client_secret",this._settings.client_secret),await this._jsonService.postForm(r,{body:i,timeoutInSeconds:this._settings.requestTimeoutInSeconds}),n.debug("got response")}},M1e=class{constructor(t,e,n){this._settings=t,this._metadataService=e,this._claimsService=n,this._logger=new Hr("ResponseValidator"),this._userInfoService=new A1e(this._settings,this._metadataService),this._tokenClient=new JX(this._settings,this._metadataService)}async validateSigninResponse(t,e,n){const r=this._logger.create("validateSigninResponse");this._processSigninState(t,e),r.debug("state processed"),await this._processCode(t,e,n),r.debug("code processed"),t.isOpenId&&this._validateIdTokenAttributes(t),r.debug("tokens validated"),await this._processClaims(t,e?.skipUserInfo,t.isOpenId),r.debug("claims processed")}async validateCredentialsResponse(t,e){const n=this._logger.create("validateCredentialsResponse");t.isOpenId&&t.id_token&&this._validateIdTokenAttributes(t),n.debug("tokens validated"),await this._processClaims(t,e,t.isOpenId),n.debug("claims processed")}async validateRefreshResponse(t,e){var n,r;const i=this._logger.create("validateRefreshResponse");t.userState=e.data,(n=t.session_state)!=null||(t.session_state=e.session_state),(r=t.scope)!=null||(t.scope=e.scope),t.isOpenId&&t.id_token&&(this._validateIdTokenAttributes(t,e.id_token),i.debug("ID Token validated")),t.id_token||(t.id_token=e.id_token,t.profile=e.profile);const s=t.isOpenId&&!!t.id_token;await this._processClaims(t,!1,s),i.debug("claims processed")}validateSignoutResponse(t,e){const n=this._logger.create("validateSignoutResponse");if(e.id!==t.state&&n.throw(new Error("State does not match")),n.debug("state validated"),t.userState=e.data,t.error)throw n.warn("Response was error",t.error),new Tv(t)}_processSigninState(t,e){var n;const r=this._logger.create("_processSigninState");if(e.id!==t.state&&r.throw(new Error("State does not match")),e.client_id||r.throw(new Error("No client_id on state")),e.authority||r.throw(new Error("No authority on state")),this._settings.authority!==e.authority&&r.throw(new Error("authority mismatch on settings vs. signin state")),this._settings.client_id&&this._settings.client_id!==e.client_id&&r.throw(new Error("client_id mismatch on settings vs. signin state")),r.debug("state validated"),t.userState=e.data,t.url_state=e.url_state,(n=t.scope)!=null||(t.scope=e.scope),t.error)throw r.warn("Response was error",t.error),new Tv(t);e.code_verifier&&!t.code&&r.throw(new Error("Expected code in response"))}async _processClaims(t,e=!1,n=!0){const r=this._logger.create("_processClaims");if(t.profile=this._claimsService.filterProtocolClaims(t.profile),e||!this._settings.loadUserInfo||!t.access_token){r.debug("not loading user info");return}r.debug("loading user info");const i=await this._userInfoService.getClaims(t.access_token);r.debug("user info claims received from user info endpoint"),n&&i.sub!==t.profile.sub&&r.throw(new Error("subject from UserInfo response does not match subject in ID Token")),t.profile=this._claimsService.mergeClaims(t.profile,this._claimsService.filterProtocolClaims(i)),r.debug("user info claims received, updated profile:",t.profile)}async _processCode(t,e,n){const r=this._logger.create("_processCode");if(t.code){r.debug("Validating code");const i=await this._tokenClient.exchangeCode({client_id:e.client_id,client_secret:e.client_secret,code:t.code,redirect_uri:e.redirect_uri,code_verifier:e.code_verifier,extraHeaders:n,...e.extraTokenParams});Object.assign(t,i)}else r.debug("No code to process")}_validateIdTokenAttributes(t,e){var n;const r=this._logger.create("_validateIdTokenAttributes");r.debug("decoding ID Token JWT");const i=PC.decode((n=t.id_token)!=null?n:"");if(i.sub||r.throw(new Error("ID Token is missing a subject claim")),e){const s=PC.decode(e);i.sub!==s.sub&&r.throw(new Error("sub in id_token does not match current sub")),i.auth_time&&i.auth_time!==s.auth_time&&r.throw(new Error("auth_time in id_token does not match original auth_time")),i.azp&&i.azp!==s.azp&&r.throw(new Error("azp in id_token does not match original azp")),!i.azp&&s.azp&&r.throw(new Error("azp not in id_token, but present in original id_token"))}t.profile=i}},NC=class XA{constructor(e){this.id=e.id||Pc.generateUUIDv4(),this.data=e.data,e.created&&e.created>0?this.created=e.created:this.created=DC.getEpochTime(),this.request_type=e.request_type,this.url_state=e.url_state}toStorageString(){return new Hr("State").create("toStorageString"),JSON.stringify({id:this.id,data:this.data,created:this.created,request_type:this.request_type,url_state:this.url_state})}static fromStorageString(e){return Hr.createStatic("State","fromStorageString"),Promise.resolve(new XA(JSON.parse(e)))}static async clearStaleState(e,n){const r=Hr.createStatic("State","clearStaleState"),i=DC.getEpochTime()-n,s=await e.getAllKeys();r.debug("got keys",s);for(let o=0;o<s.length;o++){const a=s[o],c=await e.get(a);let l=!1;if(c)try{const d=await XA.fromStorageString(c);r.debug("got item from key:",a,d.created),d.created<=i&&(l=!0)}catch(d){r.error("Error parsing state for key:",a,d),l=!0}else r.debug("no item in storage for key:",a),l=!0;l&&(r.debug("removed item for key:",a),e.remove(a))}}},wP=class QA extends NC{constructor(e){super(e),this.code_verifier=e.code_verifier,this.code_challenge=e.code_challenge,this.authority=e.authority,this.client_id=e.client_id,this.redirect_uri=e.redirect_uri,this.scope=e.scope,this.client_secret=e.client_secret,this.extraTokenParams=e.extraTokenParams,this.response_mode=e.response_mode,this.skipUserInfo=e.skipUserInfo}static async create(e){const n=e.code_verifier===!0?Pc.generateCodeVerifier():e.code_verifier||void 0,r=n?await Pc.generateCodeChallenge(n):void 0;return new QA({...e,code_verifier:n,code_challenge:r})}toStorageString(){return new Hr("SigninState").create("toStorageString"),JSON.stringify({id:this.id,data:this.data,created:this.created,request_type:this.request_type,url_state:this.url_state,code_verifier:this.code_verifier,authority:this.authority,client_id:this.client_id,redirect_uri:this.redirect_uri,scope:this.scope,client_secret:this.client_secret,extraTokenParams:this.extraTokenParams,response_mode:this.response_mode,skipUserInfo:this.skipUserInfo})}static fromStorageString(e){Hr.createStatic("SigninState","fromStorageString");const n=JSON.parse(e);return QA.create(n)}},XX=class QX{constructor(e){this.url=e.url,this.state=e.state}static async create({url:e,authority:n,client_id:r,redirect_uri:i,response_type:s,scope:o,state_data:a,response_mode:c,request_type:l,client_secret:d,nonce:h,url_state:m,resource:g,skipUserInfo:y,extraQueryParams:v,extraTokenParams:E,disablePKCE:w,dpopJkt:k,omitScopeWhenRequesting:x,...C}){if(!e)throw this._logger.error("create: No url passed"),new Error("url");if(!r)throw this._logger.error("create: No client_id passed"),new Error("client_id");if(!i)throw this._logger.error("create: No redirect_uri passed"),new Error("redirect_uri");if(!s)throw this._logger.error("create: No response_type passed"),new Error("response_type");if(!o)throw this._logger.error("create: No scope passed"),new Error("scope");if(!n)throw this._logger.error("create: No authority passed"),new Error("authority");const R=await wP.create({data:a,request_type:l,url_state:m,code_verifier:!w,client_id:r,authority:n,redirect_uri:i,response_mode:c,client_secret:d,scope:o,extraTokenParams:E,skipUserInfo:y}),T=new URL(e);T.searchParams.append("client_id",r),T.searchParams.append("redirect_uri",i),T.searchParams.append("response_type",s),x||T.searchParams.append("scope",o),h&&T.searchParams.append("nonce",h),k&&T.searchParams.append("dpop_jkt",k);let M=R.id;m&&(M=`${M}${WA}${m}`),T.searchParams.append("state",M),R.code_challenge&&(T.searchParams.append("code_challenge",R.code_challenge),T.searchParams.append("code_challenge_method","S256")),g&&(Array.isArray(g)?g:[g]).forEach(P=>T.searchParams.append("resource",P));for(const[O,P]of Object.entries({response_mode:c,...C,...v}))P!=null&&T.searchParams.append(O,P.toString());return new QX({url:T.href,state:R})}};XX._logger=new Hr("SigninRequest");var L1e=XX,O1e="openid",bE=class{constructor(t){if(this.access_token="",this.token_type="",this.profile={},this.state=t.get("state"),this.session_state=t.get("session_state"),this.state){const e=decodeURIComponent(this.state).split(WA);this.state=e[0],e.length>1&&(this.url_state=e.slice(1).join(WA))}this.error=t.get("error"),this.error_description=t.get("error_description"),this.error_uri=t.get("error_uri"),this.code=t.get("code")}get expires_in(){if(this.expires_at!==void 0)return this.expires_at-DC.getEpochTime()}set expires_in(t){typeof t=="string"&&(t=Number(t)),t!==void 0&&t>=0&&(this.expires_at=Math.floor(t)+DC.getEpochTime())}get isOpenId(){var t;return((t=this.scope)==null?void 0:t.split(" ").includes(O1e))||!!this.id_token}},P1e=class{constructor({url:t,state_data:e,id_token_hint:n,post_logout_redirect_uri:r,extraQueryParams:i,request_type:s,client_id:o}){if(this._logger=new Hr("SignoutRequest"),!t)throw this._logger.error("ctor: No url passed"),new Error("url");const a=new URL(t);n&&a.searchParams.append("id_token_hint",n),o&&a.searchParams.append("client_id",o),r&&(a.searchParams.append("post_logout_redirect_uri",r),e&&(this.state=new NC({data:e,request_type:s}),a.searchParams.append("state",this.state.id)));for(const[c,l]of Object.entries({...i}))l!=null&&a.searchParams.append(c,l.toString());this.url=a.href}},D1e=class{constructor(t){this.state=t.get("state"),this.error=t.get("error"),this.error_description=t.get("error_description"),this.error_uri=t.get("error_uri")}},N1e=["nbf","jti","auth_time","nonce","acr","amr","azp","at_hash"],U1e=["sub","iss","aud","exp","iat"],j1e=class{constructor(t){this._settings=t,this._logger=new Hr("ClaimsService")}filterProtocolClaims(t){const e={...t};if(this._settings.filterProtocolClaims){let n;Array.isArray(this._settings.filterProtocolClaims)?n=this._settings.filterProtocolClaims:n=N1e;for(const r of n)U1e.includes(r)||delete e[r]}return e}mergeClaims(t,e){const n={...t};for(const[r,i]of Object.entries(e))if(n[r]!==i)if(Array.isArray(n[r])||Array.isArray(i))if(this._settings.mergeClaimsStrategy.array=="replace")n[r]=i;else{const s=Array.isArray(n[r])?n[r]:[n[r]];for(const o of Array.isArray(i)?i:[i])s.includes(o)||s.push(o);n[r]=s}else typeof n[r]=="object"&&typeof i=="object"?n[r]=this.mergeClaims(n[r],i):n[r]=i;return n}},F1e=class{constructor(t,e){this.keys=t,this.nonce=e}},EP=class{constructor(t,e){this._logger=new Hr("OidcClient"),this.settings=t instanceof JA?t:new JA(t),this.metadataService=e??new YX(this.settings),this._claimsService=new j1e(this.settings),this._validator=new M1e(this.settings,this.metadataService,this._claimsService),this._tokenClient=new JX(this.settings,this.metadataService)}async createSigninRequest({state:t,request:e,request_uri:n,request_type:r,id_token_hint:i,login_hint:s,skipUserInfo:o,nonce:a,url_state:c,response_type:l=this.settings.response_type,scope:d=this.settings.scope,redirect_uri:h=this.settings.redirect_uri,prompt:m=this.settings.prompt,display:g=this.settings.display,max_age:y=this.settings.max_age,ui_locales:v=this.settings.ui_locales,acr_values:E=this.settings.acr_values,resource:w=this.settings.resource,response_mode:k=this.settings.response_mode,extraQueryParams:x=this.settings.extraQueryParams,extraTokenParams:C=this.settings.extraTokenParams,dpopJkt:R,omitScopeWhenRequesting:T=this.settings.omitScopeWhenRequesting}){const M=this._logger.create("createSigninRequest");if(l!=="code")throw new Error("Only the Authorization Code flow (with PKCE) is supported");const O=await this.metadataService.getAuthorizationEndpoint();M.debug("Received authorization endpoint",O);const P=await L1e.create({url:O,authority:this.settings.authority,client_id:this.settings.client_id,redirect_uri:h,response_type:l,scope:d,state_data:t,url_state:c,prompt:m,display:g,max_age:y,ui_locales:v,id_token_hint:i,login_hint:s,acr_values:E,dpopJkt:R,resource:w,request:e,request_uri:n,extraQueryParams:x,extraTokenParams:C,request_type:r,response_mode:k,client_secret:this.settings.client_secret,skipUserInfo:o,nonce:a,disablePKCE:this.settings.disablePKCE,omitScopeWhenRequesting:T});await this.clearStaleState();const D=P.state;return await this.settings.stateStore.set(D.id,D.toStorageString()),P}async readSigninResponseState(t,e=!1){const n=this._logger.create("readSigninResponseState"),r=new bE(TB.readParams(t,this.settings.response_mode));if(!r.state)throw n.throw(new Error("No state in response")),null;const i=await this.settings.stateStore[e?"remove":"get"](r.state);if(!i)throw n.throw(new Error("No matching state found in storage")),null;return{state:await wP.fromStorageString(i),response:r}}async processSigninResponse(t,e){const n=this._logger.create("processSigninResponse"),{state:r,response:i}=await this.readSigninResponseState(t,!0);if(n.debug("received state from storage; validating response"),this.settings.dpop&&this.settings.dpop.store){const s=await this.getDpopProof(this.settings.dpop.store);e={...e,DPoP:s}}try{await this._validator.validateSigninResponse(i,r,e)}catch(s){if(s instanceof YA&&this.settings.dpop){const o=await this.getDpopProof(this.settings.dpop.store,s.nonce);e.DPoP=o,await this._validator.validateSigninResponse(i,r,e)}else throw s}return i}async getDpopProof(t,e){let n,r;return(await t.getAllKeys()).includes(this.settings.client_id)?(r=await t.get(this.settings.client_id),r.nonce!==e&&e&&(r.nonce=e,await t.set(this.settings.client_id,r))):(n=await Pc.generateDPoPKeys(),r=new F1e(n,e),await t.set(this.settings.client_id,r)),await Pc.generateDPoPProof({url:await this.metadataService.getTokenEndpoint(!1),httpMethod:"POST",keyPair:r.keys,nonce:r.nonce})}async processResourceOwnerPasswordCredentials({username:t,password:e,skipUserInfo:n=!1,extraTokenParams:r={}}){const i=await this._tokenClient.exchangeCredentials({username:t,password:e,...r}),s=new bE(new URLSearchParams);return Object.assign(s,i),await this._validator.validateCredentialsResponse(s,n),s}async useRefreshToken({state:t,redirect_uri:e,resource:n,timeoutInSeconds:r,extraHeaders:i,extraTokenParams:s}){var o;const a=this._logger.create("useRefreshToken");let c;if(this.settings.refreshTokenAllowedScope===void 0)c=t.scope;else{const h=this.settings.refreshTokenAllowedScope.split(" ");c=(((o=t.scope)==null?void 0:o.split(" "))||[]).filter(g=>h.includes(g)).join(" ")}if(this.settings.dpop&&this.settings.dpop.store){const h=await this.getDpopProof(this.settings.dpop.store);i={...i,DPoP:h}}let l;try{l=await this._tokenClient.exchangeRefreshToken({refresh_token:t.refresh_token,scope:c,redirect_uri:e,resource:n,timeoutInSeconds:r,extraHeaders:i,...s})}catch(h){if(h instanceof YA&&this.settings.dpop)i.DPoP=await this.getDpopProof(this.settings.dpop.store,h.nonce),l=await this._tokenClient.exchangeRefreshToken({refresh_token:t.refresh_token,scope:c,redirect_uri:e,resource:n,timeoutInSeconds:r,extraHeaders:i,...s});else throw h}const d=new bE(new URLSearchParams);return Object.assign(d,l),a.debug("validating response",d),await this._validator.validateRefreshResponse(d,{...t,scope:c}),d}async createSignoutRequest({state:t,id_token_hint:e,client_id:n,request_type:r,post_logout_redirect_uri:i=this.settings.post_logout_redirect_uri,extraQueryParams:s=this.settings.extraQueryParams}={}){const o=this._logger.create("createSignoutRequest"),a=await this.metadataService.getEndSessionEndpoint();if(!a)throw o.throw(new Error("No end session endpoint")),null;o.debug("Received end session endpoint",a),!n&&i&&!e&&(n=this.settings.client_id);const c=new P1e({url:a,id_token_hint:e,client_id:n,post_logout_redirect_uri:i,state_data:t,extraQueryParams:s,request_type:r});await this.clearStaleState();const l=c.state;return l&&(o.debug("Signout request has state to persist"),await this.settings.stateStore.set(l.id,l.toStorageString())),c}async readSignoutResponseState(t,e=!1){const n=this._logger.create("readSignoutResponseState"),r=new D1e(TB.readParams(t,this.settings.response_mode));if(!r.state){if(n.debug("No state in response"),r.error)throw n.warn("Response was error:",r.error),new Tv(r);return{state:void 0,response:r}}const i=await this.settings.stateStore[e?"remove":"get"](r.state);if(!i)throw n.throw(new Error("No matching state found in storage")),null;return{state:await NC.fromStorageString(i),response:r}}async processSignoutResponse(t){const e=this._logger.create("processSignoutResponse"),{state:n,response:r}=await this.readSignoutResponseState(t,!0);return n?(e.debug("Received state from storage; validating response"),this._validator.validateSignoutResponse(r,n)):e.debug("No state from storage; skipping response validation"),r}clearStaleState(){return this._logger.create("clearStaleState"),NC.clearStaleState(this.settings.stateStore,this.settings.staleStateAgeInSeconds)}async revokeToken(t,e){return this._logger.create("revokeToken"),await this._tokenClient.revoke({token:t,token_type_hint:e})}},_s=(function(t){return t.NotSupported="OIDC authentication not supported",t.Misconfigured="OIDC is misconfigured",t.General="Something went wrong with OIDC discovery",t.OpSupport="Configured OIDC OP does not support required functions",t.DynamicRegistrationNotSupported="Dynamic registration not supported",t.DynamicRegistrationFailed="Dynamic registration failed",t.DynamicRegistrationInvalid="Dynamic registration invalid response",t.CodeExchangeFailed="Failed to exchange code for token",t.InvalidBearerTokenResponse="Invalid bearer token response",t.InvalidIdToken="Invalid ID token",t.MissingOrInvalidStoredState="State required to finish logging in is not found in storage.",t})({}),CP=t=>!!t&&typeof t=="object"&&!Array.isArray(t),Fu=(t,e)=>!t[e]||!J1(t,e)?(N.error("Missing or invalid property: ".concat(e)),!1):!0,J1=(t,e)=>t[e]&&typeof t[e]!="string"?(N.error("Invalid property: ".concat(e)),!1):!0,RB=(t,e)=>t[e]&&(!Array.isArray(t[e])||!t[e].every(n=>typeof n=="string"))?(N.error("Invalid property: ".concat(e)),!1):!0,px=(t,e,n)=>{var r=t[e];return!r||!Array.isArray(r)||!r.includes(n)?(N.error("Invalid property: ".concat(e,". ").concat(n," is required.")),!1):!0},ZX=t=>{if(!CP(t))throw N.error("Issuer configuration not found or malformed"),new Error(_s.OpSupport);var e=[Fu(t,"issuer"),Fu(t,"authorization_endpoint"),Fu(t,"token_endpoint"),Fu(t,"revocation_endpoint"),J1(t,"registration_endpoint"),J1(t,"account_management_uri"),J1(t,"device_authorization_endpoint"),RB(t,"account_management_actions_supported"),px(t,"response_types_supported","code"),px(t,"grant_types_supported",Bb.AuthorizationCode),px(t,"code_challenge_methods_supported","S256"),RB(t,"prompt_values_supported")].some(n=>!n);if(!e)return t;throw N.error("Issuer configuration not valid"),new Error(_s.OpSupport)},eQ=t=>{try{return zX(t)}catch(e){throw N.error("Could not decode id_token",e),e}},tQ=(t,e,n,r)=>{try{if(!t)throw new Error("No ID token");var i=eQ(t);if(i.iss!==e)throw new Error("Invalid issuer");var s=typeof i.aud=="string"?[i.aud]:i.aud;if(!s.includes(n))throw new Error("Invalid audience");if(r!==void 0&&i.nonce!==r)throw new Error("Invalid nonce");if(!i.exp||Date.now()>i.exp*1e3)throw new Error("Invalid expiry")}catch(o){throw N.error("Invalid ID token",o),new Error(_s.InvalidIdToken)}};function nQ(t){if(!CP(t))throw N.error("Stored user state not found"),new Error(_s.MissingOrInvalidStoredState);var e=[Fu(t,"homeserverUrl"),Fu(t,"nonce"),J1(t,"identityServerUrl")].some(n=>!n);if(e)throw new Error(_s.MissingOrInvalidStoredState)}var $1e=t=>CP(t)&&Fu(t,"token_type")&&t.token_type.toLowerCase()==="bearer"&&Fu(t,"access_token")&&Fu(t,"refresh_token")&&(!("expires_in"in t)||typeof t.expires_in=="number");function rQ(t){if(!$1e(t))throw new Error(_s.InvalidBearerTokenResponse)}function kB(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function UC(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?kB(Object(n),!0).forEach(function(r){L(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):kB(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}var AT=t=>{var e=t??Qo(10);return"openid urn:matrix:org.matrix.msc2967.client:api:* urn:matrix:org.matrix.msc2967.client:device:".concat(e)},B1e=(function(){var t=B(function*(e){if(!globalThis.crypto.subtle)return N.warn("A secure context is required to generate code challenge. Using plain text code challenge"),e;var n=yield yP(e);return ET(n)});return function(n){return t.apply(this,arguments)}})(),H1e=t=>{var{redirectUri:e}=t;return{scope:AT(),redirectUri:e,state:Qo(8),nonce:Qo(8),codeVerifier:Qo(64)}},q1e=(function(){var t=B(function*(e,n,r){var{scope:i,redirectUri:s,state:o,nonce:a,codeVerifier:c}=r,l=new URL(e);return l.searchParams.append("response_mode","query"),l.searchParams.append("response_type","code"),l.searchParams.append("redirect_uri",s),l.searchParams.append("client_id",n),l.searchParams.append("state",o),l.searchParams.append("scope",i),l.searchParams.append("nonce",a),l.searchParams.append("code_challenge_method","S256"),l.searchParams.append("code_challenge",yield B1e(c)),l.toString()});return function(n,r,i){return t.apply(this,arguments)}})(),V1e=(function(){var t=B(function*(e){var{metadata:n,redirectUri:r,clientId:i,homeserverUrl:s,identityServerUrl:o,nonce:a,prompt:c,urlState:l,loginHint:d}=e,h=AT(),m=new EP(UC(UC({},n),{},{client_id:i,redirect_uri:r,authority:n.issuer,response_mode:"query",response_type:"code",scope:h,stateStore:new xT({prefix:"mx_oidc_",store:window.sessionStorage})})),g={homeserverUrl:s,nonce:a,identityServerUrl:o},y=yield m.createSigninRequest({state:g,nonce:a,prompt:c,url_state:l,login_hint:d});return y.url});return function(n){return t.apply(this,arguments)}})(),K1e=t=>({id_token:t.id_token,scope:t.scope,expires_at:t.expires_at,refresh_token:t.refresh_token,access_token:t.access_token,token_type:"Bearer"}),G1e=(function(){var t=B(function*(e,n){var r=new URL(window.location.origin);r.searchParams.append("code",e),r.searchParams.append("state",n),$b.setLogger(N);try{var i=new bE(r.searchParams),s=new xT({prefix:"mx_oidc_",store:window.sessionStorage}),o=yield s.get(i.state);if(!o)throw new Error(_s.MissingOrInvalidStoredState);var a=yield wP.fromStorageString(o),c=new EP(UC(UC({},a),{},{stateStore:s})),l=yield c.processSigninResponse(r.href),d=l.userState;nQ(d),rQ(l),tQ(l.id_token,c.settings.authority,c.settings.client_id,d.nonce);var h=K1e(l);return{oidcClientSettings:{clientId:c.settings.client_id,issuer:c.settings.authority},tokenResponse:h,homeserverUrl:d.homeserverUrl,identityServerUrl:d.identityServerUrl,idTokenClaims:l.profile}}catch(g){N.error("Oidc login failed",g);var m=g.message;throw Object.values(_s).includes(m)?g:new Error(_s.CodeExchangeFailed)}});return function(n,r){return t.apply(this,arguments)}})();function IB(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function xB(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?IB(Object(n),!0).forEach(function(r){L(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):IB(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}var TP=(function(){var t=B(function*(e){var n=new URL(".well-known/openid-configuration",e),r=yield fetch(n,{method:he.Get,signal:ST(5e3)}),i=yield r.json();return RP(i)});return function(n){return t.apply(this,arguments)}})(),RP=(function(){var t=B(function*(e){var n=ZX(e),r=new JA({authority:n.issuer,metadata:n,redirect_uri:"",client_id:""}),i=new YX(r);return xB(xB({},n),{},{signingKeys:yield i.getSigningKeys()})});return function(n){return t.apply(this,arguments)}})(),Bb=(function(t){return t.AuthorizationCode="authorization_code",t.RefreshToken="refresh_token",t.DeviceAuthorization="urn:ietf:params:oauth:grant-type:device_code",t})({}),z1e=Bb.DeviceAuthorization,mx=(t,e)=>{if(!e)return!1;var n=new URL(e);return!(n.protocol!==t.protocol||n.hostname!==t.hostname&&!n.hostname.endsWith(".".concat(t.hostname)))},W1e=(function(){var t=B(function*(e,n){if(!e.registration_endpoint)throw new Error(_s.DynamicRegistrationNotSupported);var r=[Bb.AuthorizationCode,Bb.RefreshToken];if(r.some(d=>!e.grant_types_supported.includes(d)))throw new Error(_s.DynamicRegistrationNotSupported);var i=new URL(n.clientUri),s={client_name:n.clientName,client_uri:n.clientUri,response_types:["code"],grant_types:r,redirect_uris:n.redirectUris,id_token_signed_response_alg:"RS256",token_endpoint_auth_method:"none",application_type:n.applicationType,contacts:n.contacts,logo_uri:mx(i,n.logoUri)?n.logoUri:void 0,policy_uri:mx(i,n.policyUri)?n.policyUri:void 0,tos_uri:mx(i,n.tosUri)?n.tosUri:void 0},o={Accept:"application/json","Content-Type":"application/json"};try{var a=yield fetch(e.registration_endpoint,{method:he.Post,headers:o,body:JSON.stringify(s)});if(a.status>=400)throw new Error(_s.DynamicRegistrationFailed);var c=yield a.json(),l=c.client_id;if(!l||typeof l!="string")throw new Error(_s.DynamicRegistrationInvalid);return l}catch(d){throw Object.values(_s).includes(d.message)?d:(N.error("Dynamic registration request failed",d),new Error(_s.DynamicRegistrationFailed))}});return function(n,r){return t.apply(this,arguments)}})();class Y1e{constructor(e,n,r,i,s){this.issuer=e,this.clientId=n,this.redirectUri=r,this.deviceId=i,this.idTokenClaims=s,L(this,"oidcClientReady",void 0),L(this,"initPromise",void 0),L(this,"oidcClient",void 0),L(this,"inflightRefreshRequest",void 0),this.oidcClientReady=Promise.resolve()}ensureInit(){var e=this;return B(function*(){if(!e.oidcClient){if(e.initPromise)return e.initPromise;e.initPromise=e.initialiseOidcClient(e.issuer,e.clientId,e.deviceId,e.redirectUri);try{yield e.initPromise}finally{e.initPromise=void 0}}})()}initialiseOidcClient(e,n,r,i){var s=this;return B(function*(){try{var o,a=yield TP(e),c=AT(r);s.oidcClient=new EP({metadata:a,signingKeys:(o=a.signingKeys)!==null&&o!==void 0?o:void 0,client_id:n,scope:c,redirect_uri:i,authority:a.issuer,stateStore:new xT({prefix:"mx_oidc_",store:window.sessionStorage})})}catch(l){throw N.error("Failed to initialise OIDC client.",l),new Error("Failed to initialise OIDC client.")}})()}doRefreshAccessToken(e){var n=this;return B(function*(){yield n.ensureInit(),n.inflightRefreshRequest||(n.inflightRefreshRequest=n.getNewTokens(e));try{var r=yield n.inflightRefreshRequest;return r}catch(i){throw i instanceof Tv?new oP(i):i}finally{n.inflightRefreshRequest=void 0}})()}persistTokens(e){return B(function*(){})()}getNewTokens(e){var n=this;return B(function*(){if(!n.oidcClient)throw new Error("Cannot get new token before OIDC client is initialised.");var r={refresh_token:e,session_state:"test",data:void 0,profile:n.idTokenClaims},i=Date.now(),s=yield n.oidcClient.useRefreshToken({state:r,timeoutInSeconds:300}),o={accessToken:s.access_token,refreshToken:s.refresh_token,expiry:s.expires_in?new Date(i+s.expires_in*1e3):void 0};return yield n.persistTokens(o),o})()}}var J1e=["server","limit","since"];function AB(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function Yn(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?AB(Object(n),!0).forEach(function(r){L(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):AB(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}var X1e=3e3,MB=600*1e3,Q1e=new qr("last_seen_user_agent","org.matrix.msc3852.last_seen_user_agent"),Rv=(function(t){return t.Chronological="chronological",t.Detached="detached",t})({}),Z1e=new sy("m.get_login_token","org.matrix.msc3882.get_login_token"),iQ="uk.half-shot.msc2666",sQ="uk.half-shot.msc2666.mutual_rooms",oQ="uk.half-shot.msc2666.query_mutual_rooms",Qi="org.matrix.msc4140",jC="org.matrix.msc4354",aQ="uk.tcpip.msc4133",cQ="uk.tcpip.msc4133.stable",Qc="$",De=(function(t){return t.Sync="sync",t.Event="event",t.ToDeviceEvent="toDeviceEvent",t.ReceivedToDeviceMessage="receivedToDeviceMessage",t.AccountData="accountData",t.Room="Room",t.DeleteRoom="deleteRoom",t.SyncUnexpectedError="sync.unexpectedError",t.ClientWellKnown="WellKnown.client",t.ReceivedVoipEvent="received_voip_event",t.TurnServers="turnServers",t.TurnServersError="turnServers.error",t})({}),LB=new qr("action","org.matrix.msc3824.action");class MT extends Kn{constructor(e){var n,r,i,s,o,a;super(),i=this,L(this,"logger",void 0),L(this,"reEmitter",new ly(this)),L(this,"olmVersion",null),L(this,"usingExternalCrypto",!1),L(this,"_store",void 0),L(this,"deviceId",void 0),L(this,"credentials",void 0),L(this,"legacyPickleKey",void 0),L(this,"scheduler",void 0),L(this,"clientRunning",!1),L(this,"timelineSupport",!1),L(this,"urlPreviewCache",{}),L(this,"identityServer",void 0),L(this,"http",void 0),L(this,"cryptoBackend",void 0),L(this,"enableEncryptedStateEvents",void 0),L(this,"cryptoCallbacks",void 0),L(this,"callEventHandler",void 0),L(this,"groupCallEventHandler",void 0),L(this,"supportsCallTransfer",!1),L(this,"forceTURN",!1),L(this,"iceCandidatePoolSize",0),L(this,"idBaseUrl",void 0),L(this,"baseUrl",void 0),L(this,"isVoipWithNoMediaAllowed",void 0),L(this,"disableVoip",void 0),L(this,"useLivekitForGroupCalls",void 0),L(this,"canSupportVoip",!1),L(this,"peekSync",null),L(this,"isGuestAccount",!1),L(this,"ongoingScrollbacks",{}),L(this,"notifTimelineSet",null),L(this,"legacyCryptoStore",void 0),L(this,"verificationMethods",void 0),L(this,"fallbackICEServerAllowed",!1),L(this,"syncApi",void 0),L(this,"roomNameGenerator",void 0),L(this,"pushRules",void 0),L(this,"syncLeftRoomsPromise",void 0),L(this,"syncedLeftRooms",!1),L(this,"clientOpts",void 0),L(this,"clientWellKnownIntervalID",void 0),L(this,"canResetTimelineCallback",void 0),L(this,"canSupport",new Map),L(this,"pushProcessor",new _c(this)),L(this,"serverVersionsPromise",void 0),L(this,"clientWellKnown",void 0),L(this,"clientWellKnownPromise",void 0),L(this,"turnServers",[]),L(this,"turnServersExpiry",0),L(this,"checkTurnServersIntervalID",void 0),L(this,"txnCtr",0),L(this,"mediaHandler",new N0e(this)),L(this,"sessionId",void 0),L(this,"eventsBeingEncrypted",new Set),L(this,"useE2eForGroupCall",!0),L(this,"toDeviceMessageQueue",void 0),L(this,"livekitServiceURL",void 0),L(this,"_secretStorage",void 0),L(this,"ignoredInvites",void 0),L(this,"matrixRTC",void 0),L(this,"serverCapabilitiesService",void 0),L(this,"startCallEventHandler",()=>{this.isInitialSyncComplete()&&(PA()&&(this.callEventHandler.start(),this.groupCallEventHandler.start()),this.off(De.Sync,this.startCallEventHandler))}),L(this,"startMatrixRTC",()=>{this.isInitialSyncComplete()&&(this.matrixRTC.start(),this.off(De.Sync,this.startMatrixRTC))}),L(this,"fixupRoomNotifications",()=>{if(this.isInitialSyncComplete()){var l,d=((l=this.getRooms())!==null&&l!==void 0?l:[]).filter(g=>g.getUnreadNotificationCount(sn.Total)>0);for(var h of d){var m=this.getSafeUserId();h.fixupNotifications(m)}this.off(De.Sync,this.fixupRoomNotifications)}}),this.logger=(n=e.logger)!==null&&n!==void 0?n:N,e.baseUrl=QI(e.baseUrl),e.idBaseUrl=QI(e.idBaseUrl),this.baseUrl=e.baseUrl,this.idBaseUrl=e.idBaseUrl,this.identityServer=e.identityServer,this.usingExternalCrypto=(r=e.usingExternalCrypto)!==null&&r!==void 0?r:!1,this.store=e.store||new Fye,this.deviceId=e.deviceId||null,this.sessionId=Qo(10);var c=e.userId||null;this.credentials={userId:c},this.http=new TX(this,{fetchFn:e.fetchFn,baseUrl:e.baseUrl,idBaseUrl:e.idBaseUrl,accessToken:e.accessToken,refreshToken:e.refreshToken,tokenRefreshFunction:e.tokenRefreshFunction,prefix:hr.V3,onlyData:!0,extraParams:e.queryParams,localTimeoutMs:e.localTimeoutMs,useAuthorizationHeader:e.useAuthorizationHeader,logger:this.logger}),e.pickleKey&&(this.legacyPickleKey=e.pickleKey),this.useLivekitForGroupCalls=!!e.useLivekitForGroupCalls,this.scheduler=e.scheduler,this.scheduler&&this.scheduler.setProcessFunction((function(){var l=B(function*(d){var h=i.getRoom(d.getRoomId());d.status!==ct.SENDING&&i.updatePendingEventStatus(h,d,ct.SENDING);var m=yield i.sendEventHttpRequest(d);return h&&h.updatePendingEvent(d,ct.SENT,m.event_id),m});return function(d){return l.apply(this,arguments)}})()),this.disableVoip=(s=e.disableVoip)!==null&&s!==void 0?s:!1,!this.disableVoip&&PA()&&(this.callEventHandler=new i0e(this),this.groupCallEventHandler=new s0e(this),this.canSupportVoip=!0,this.on(De.Sync,this.startCallEventHandler)),this.matrixRTC=new y1e(this.logger,this),this.serverCapabilitiesService=new kX(this.logger,this.http),this.on(De.Sync,this.fixupRoomNotifications),this.timelineSupport=!!e.timelineSupport,this.legacyCryptoStore=e.cryptoStore,this.verificationMethods=e.verificationMethods,this.cryptoCallbacks=e.cryptoCallbacks||{},this.enableEncryptedStateEvents=(o=e.enableEncryptedStateEvents)!==null&&o!==void 0?o:!1,this.forceTURN=e.forceTURN||!1,this.iceCandidatePoolSize=e.iceCandidatePoolSize===void 0?0:e.iceCandidatePoolSize,this.supportsCallTransfer=e.supportsCallTransfer||!1,this.fallbackICEServerAllowed=e.fallbackICEServerAllowed||!1,this.isVoipWithNoMediaAllowed=e.isVoipWithNoMediaAllowed||!1,e.useE2eForGroupCall!==void 0&&(this.useE2eForGroupCall=e.useE2eForGroupCall),this.livekitServiceURL=e.livekitServiceURL,this.roomNameGenerator=e.roomNameGenerator,this.toDeviceMessageQueue=new V0e(this,this.logger),this.on(Zt.Decrypted,l=>{lQ(this,l)}),this.ignoredInvites=new K0e(this),this._secretStorage=new KX(this,(a=e.cryptoCallbacks)!==null&&a!==void 0?a:{}),this.setMaxListeners(0)}set store(e){this._store=e,this._store.setUserCreator(n=>Hu.createUser(n,this))}get store(){return this._store}startClient(e){var n=this;return B(function*(){if(!n.clientRunning){n.clientRunning=!0,n.on(De.Sync,n.startMatrixRTC);var r=n.getUserId();r&&n.store.storeUser(new Hu(r)),n.supportsVoip()&&(n.checkTurnServersIntervalID=setInterval(()=>{n.checkTurnServers()},MB),n.checkTurnServers()),n.syncApi&&(n.logger.error("Still have sync object whilst not running: stopping old one"),n.syncApi.stop());try{yield n.getVersions();var{threads:i,list:s,fwdPagination:o}=yield n.doesServerSupportThread();$n.setServerSideSupport(i),$n.setServerSideListSupport(s),$n.setServerSideFwdPaginationSupport(o)}catch(a){n.logger.error("Can't fetch server versions, continuing to initialise sync, this will be retried later",a)}n.clientOpts=e??{},n.clientOpts.slidingSync?n.syncApi=new BX(n.clientOpts.slidingSync,n,n.clientOpts,n.buildSyncApiOptions()):n.syncApi=new yf(n,n.clientOpts,n.buildSyncApiOptions()),n.syncApi.sync().catch(a=>n.logger.info("Sync startup aborted with an error:",a)),n.clientOpts.clientWellKnownPollPeriod!==void 0&&(n.clientWellKnownIntervalID=setInterval(()=>{n.fetchClientWellKnown()},1e3*n.clientOpts.clientWellKnownPollPeriod),n.fetchClientWellKnown()),n.toDeviceMessageQueue.start(),n.serverCapabilitiesService.start()}})()}buildSyncApiOptions(){return{cryptoCallbacks:this.cryptoBackend,canResetEntireTimeline:e=>this.canResetTimelineCallback?this.canResetTimelineCallback(e):!1,logger:this.logger.getChild("sync")}}stopClient(){var e,n,r,i,s;(e=this.cryptoBackend)===null||e===void 0||e.stop(),this.off(De.Sync,this.startMatrixRTC),this.clientRunning&&(this.logger.debug("stopping MatrixClient"),this.clientRunning=!1,(n=this.syncApi)===null||n===void 0||n.stop(),this.syncApi=void 0,(r=this.peekSync)===null||r===void 0||r.stopPeeking(),(i=this.callEventHandler)===null||i===void 0||i.stop(),(s=this.groupCallEventHandler)===null||s===void 0||s.stop(),this.callEventHandler=void 0,this.groupCallEventHandler=void 0,globalThis.clearInterval(this.checkTurnServersIntervalID),this.checkTurnServersIntervalID=void 0,this.clientWellKnownIntervalID!==void 0&&globalThis.clearInterval(this.clientWellKnownIntervalID),this.toDeviceMessageQueue.stop(),this.matrixRTC.stop(),this.serverCapabilitiesService.stop())}clearStores(){var e=this,n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(this.clientRunning)throw new Error("Cannot clear stores while client is running");var r=[];r.push(this.store.deleteAllData()),this.legacyCryptoStore&&r.push(this.legacyCryptoStore.deleteAllData());var i=(function(){var s=B(function*(){var o;try{if(o=globalThis.indexedDB,!o)return}catch{return}var a=function*(m){var g=new Promise((y,v)=>{e.logger.info("Removing IndexedDB instance ".concat(m));var E=o.deleteDatabase(m);E.onsuccess=w=>{e.logger.info("Removed IndexedDB instance ".concat(m)),y(0)},E.onerror=w=>{e.logger.warn("Failed to remove IndexedDB instance ".concat(m,":"),w),y(0)},E.onblocked=w=>{e.logger.info("cannot yet remove IndexedDB instance ".concat(m))}});yield g};for(var c of["".concat((l=n.cryptoDatabasePrefix)!==null&&l!==void 0?l:dx,"::matrix-sdk-crypto"),"".concat((d=n.cryptoDatabasePrefix)!==null&&d!==void 0?d:dx,"::matrix-sdk-crypto-meta")]){var l,d;yield*a(c)}});return function(){return s.apply(this,arguments)}})();return r.push(i()),Promise.all(r).then()}getUserId(){var e,n;return(e=(n=this.credentials)===null||n===void 0?void 0:n.userId)!==null&&e!==void 0?e:null}getSafeUserId(){var e=this.getUserId();if(!e)throw new Error("Expected logged in user but found none.");return e}getDomain(){var e;return(e=this.credentials)!==null&&e!==void 0&&e.userId?this.credentials.userId.replace(/^.*?:/,""):null}getUserIdLocalpart(){var e,n;return(e=(n=this.credentials)===null||n===void 0||(n=n.userId)===null||n===void 0?void 0:n.split(":")[0].substring(1))!==null&&e!==void 0?e:null}getDeviceId(){return this.deviceId}getSessionId(){return this.sessionId}supportsVoip(){return!this.disableVoip&&this.canSupportVoip}getMediaHandler(){return this.mediaHandler}setForceTURN(e){this.forceTURN=e}setSupportsCallTransfer(e){this.supportsCallTransfer=e}getUseE2eForGroupCall(){return this.useE2eForGroupCall}createCall(e){return Db(this,e)}createGroupCall(e,n,r,i,s,o){var a=this;return B(function*(){if(a.getGroupCallForRoom(e))throw new Error("".concat(e," already has an existing group call"));var c=a.getRoom(e);if(!c)throw new Error("Cannot find room ".concat(e));return new hP(a,c,n,r,i,void 0,s||a.isVoipWithNoMediaAllowed,o,a.isVoipWithNoMediaAllowed,a.useLivekitForGroupCalls,a.livekitServiceURL).create()})()}getLivekitServiceURL(){return this.livekitServiceURL}setLivekitServiceURL(e){this.livekitServiceURL=e}waitUntilRoomReadyForGroupCalls(e){return this.groupCallEventHandler.waitUntilRoomReadyForGroupCalls(e)}getGroupCallForRoom(e){return this.groupCallEventHandler.groupCalls.get(e)||null}getSyncState(){var e,n;return(e=(n=this.syncApi)===null||n===void 0?void 0:n.getSyncState())!==null&&e!==void 0?e:null}getSyncStateData(){return this.syncApi?this.syncApi.getSyncStateData():null}isInitialSyncComplete(){var e=this.getSyncState();return e?e===Qt.Prepared||e===Qt.Syncing:!1}isGuest(){return this.isGuestAccount}setGuest(e){this.isGuestAccount=e}getScheduler(){return this.scheduler}retryImmediately(){var e,n;return this.toDeviceMessageQueue.sendQueue(),(e=(n=this.syncApi)===null||n===void 0?void 0:n.retryImmediately())!==null&&e!==void 0?e:!1}getNotifTimelineSet(){return this.notifTimelineSet}setNotifTimelineSet(e){this.notifTimelineSet=e}getCapabilities(){var e=this;return B(function*(){var n=e.serverCapabilitiesService.getCachedCapabilities();return n||e.serverCapabilitiesService.fetchCapabilities()})()}getCachedCapabilities(){return this.serverCapabilitiesService.getCachedCapabilities()}fetchCapabilities(){return this.serverCapabilitiesService.fetchCapabilities()}initRustCrypto(){var e=arguments,n=this;return B(function*(){var r,i,s=e.length>0&&e[0]!==void 0?e[0]:{};if(n.cryptoBackend){n.logger.warn("Attempt to re-initialise e2e encryption on MatrixClient");return}var o=n.getUserId();if(o===null)throw new Error("Cannot enable encryption on MatrixClient with unknown userId: ensure userId is passed in createClient().");var a=n.getDeviceId();if(a===null)throw new Error("Cannot enable encryption on MatrixClient with unknown deviceId: ensure deviceId is passed in createClient().");n.logger.debug("Downloading Rust crypto library");var c=yield Mb(()=>import("./index-1UwnBL6q.js"),__vite__mapDeps([0,1]),import.meta.url),l=yield c.initRustCrypto({logger:n.logger,http:n.http,userId:o,deviceId:a,secretStorage:n.secretStorage,cryptoCallbacks:n.cryptoCallbacks,storePrefix:s.useIndexedDB===!1?null:(r=s.cryptoDatabasePrefix)!==null&&r!==void 0?r:dx,storeKey:s.storageKey,storePassphrase:s.storagePassword,legacyCryptoStore:n.legacyCryptoStore,legacyPickleKey:(i=n.legacyPickleKey)!==null&&i!==void 0?i:"DEFAULT_KEY",legacyMigrationProgressListener:(d,h)=>{n.emit(Ci.LegacyCryptoStoreMigrationProgress,d,h)},enableEncryptedStateEvents:n.enableEncryptedStateEvents});l.setSupportedVerificationMethods(n.verificationMethods),n.cryptoBackend=l,n.on(fo.Membership,l.onRoomMembership.bind(l)),n.on(De.Event,d=>{l.onLiveEventFromSync(d)}),n.reEmitter.reEmit(l,[Ci.VerificationRequestReceived,Ci.UserTrustStatusChanged,Ci.KeyBackupStatus,Ci.KeyBackupSessionsRemaining,Ci.KeyBackupFailed,Ci.KeyBackupDecryptionKeyCached,Ci.KeysChanged,Ci.DevicesUpdated,Ci.WillUpdateDevices,Ci.DehydratedDeviceCreated,Ci.DehydratedDeviceUploaded,Ci.RehydrationStarted,Ci.RehydrationProgress,Ci.RehydrationCompleted,Ci.RehydrationError,Ci.DehydrationKeyCached,Ci.DehydratedDeviceRotationError])})()}get secretStorage(){return this._secretStorage}getCrypto(){return this.cryptoBackend}isRoomEncrypted(e){var n=this.getRoom(e);return n?n.hasEncryptionStateEvent():!1}isKeyBackupKeyStored(){return Promise.resolve(this.secretStorage.isStored("m.megolm_backup.v1"))}makeKeyBackupPath(e,n,r){var i;n!==void 0?i=Pe("/room_keys/keys/$roomId/$sessionId",{$roomId:e,$sessionId:n}):e!==void 0?i=Pe("/room_keys/keys/$roomId",{$roomId:e}):i="/room_keys/keys";var s=r===void 0?void 0:{version:r};return{path:i,queryData:s}}deleteKeysFromBackup(e,n,r){var i=this;return B(function*(){var s=i.makeKeyBackupPath(e,n,r);yield i.http.authedRequest(he.Delete,s.path,s.queryData,void 0,{prefix:hr.V3})})()}getMediaConfig(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,n=e?"/media/config":"/config";return this.http.authedRequest(he.Get,n,void 0,void 0,{prefix:e?hr.V1:Wg.V3})}getRoom(e){return e?this.store.getRoom(e):null}getRooms(){return this.store.getRooms()}getVisibleRooms(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,n=this.store.getRooms(),r=new Set(n);for(var i of r){var s=this.findPredecessorRooms(i,!0,e);for(var o of s)r.delete(o)}return Array.from(r)}getUser(e){return this.store.getUser(e)}getUsers(){return this.store.getUsers()}setAccountData(e,n){var r=this;return B(function*(){if(!r.clientRunning)return r.logger.warn("Calling `setAccountData` before the client is started: `getAccountData` may return inconsistent results."),yield Pb(5,()=>r.setAccountDataRaw(e,n));var i=r.store.getAccountData(e);if(i&&kp(i.event.content,n))return{};var s=Promise.withResolvers();function o(c){c.getType()===e&&s.resolve()}r.addListener(De.AccountData,o);try{var a=yield Pb(5,()=>r.setAccountDataRaw(e,n));return yield s.promise,a}finally{r.removeListener(De.AccountData,o)}})()}setAccountDataRaw(e,n){var r=Pe("/user/$userId/account_data/$type",{$userId:this.credentials.userId,$type:e});return this.http.authedRequest(he.Put,r,void 0,n)}getAccountData(e){return this.store.getAccountData(e)}getAccountDataFromServer(e){var n=this;return B(function*(){if(n.isInitialSyncComplete()){var r=n.store.getAccountData(e);return r?r.getContent():null}var i=Pe("/user/$userId/account_data/$type",{$userId:n.credentials.userId,$type:e});try{return yield n.http.authedRequest(he.Get,i)}catch(o){var s;if(((s=o.data)===null||s===void 0?void 0:s.errcode)==="M_NOT_FOUND")return null;throw o}})()}deleteAccountData(e){var n=this;return B(function*(){var r=n.canSupport.get(di.AccountDataDeletion);if(r===ui.Unsupported){yield n.setAccountData(e,{});return}var i=Pe("/user/$userId/account_data/$type",{$userId:n.getSafeUserId(),$type:e}),s=r===ui.Unstable?{prefix:"/_matrix/client/unstable/org.matrix.msc3391"}:void 0;return yield n.http.authedRequest(he.Delete,i,void 0,void 0,s)})()}getIgnoredUsers(){var e=this.getAccountData(Z.IgnoredUserList);return e!=null&&e.getContent().ignored_users?Object.keys(e.getContent().ignored_users):[]}setIgnoredUsers(e){var n={ignored_users:{}};return e.forEach(r=>{n.ignored_users[r]={}}),this.setAccountData(Z.IgnoredUserList,n)}isUserIgnored(e){return this.getIgnoredUsers().includes(e)}joinRoom(e){var n=arguments,r=this;return B(function*(){var i,s,o=n.length>1&&n[1]!==void 0?n[1]:{},a=r.getRoom(e),c=a?.getMember(r.getSafeUserId()),l=c?.membership,d=l==Ve.Invite&&(i=c==null||(s=c.events.member)===null||s===void 0?void 0:s.getSender())!==null&&i!==void 0?i:null;if(r.logger.debug("joinRoom[".concat(e,"]: preJoinMembership=").concat(l,", inviter=").concat(d,", opts=").concat(JSON.stringify(o))),l==Ve.Join)return a;var h=Promise.resolve();if(o.inviteSignUrl){var m=new URL(o.inviteSignUrl);m.searchParams.set("mxid",r.credentials.userId),h=r.http.requestOtherUrl(he.Post,m)}var g={};o.viaServers&&(g.via=g.server_name=o.viaServers.slice(0,3));var y={},v=yield h;v&&(y.third_party_signed=v);var E=Pe("/join/$roomid",{$roomid:e}),w=yield r.http.authedRequest(he.Post,E,g,y),k=w.room_id;if(o.acceptSharedHistory&&d&&r.cryptoBackend){var x=yield r.cryptoBackend.maybeAcceptKeyBundle(k,d);x||r.cryptoBackend.markRoomAsPendingKeyBundle(k,d)}var C=r.getRoom(k);if(C!=null&&C.hasMembershipState(r.credentials.userId,Ve.Join))return C;var R=new yf(r,r.clientOpts,r.buildSyncApiOptions());return R.createRoom(k)})()}knockRoom(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=this.getRoom(e);if(r!=null&&r.hasMembershipState(this.credentials.userId,Ve.Knock))return Promise.resolve({room_id:r.roomId});var i=Pe("/knock/$roomIdOrAlias",{$roomIdOrAlias:e}),s={};if(n.viaServers){var o=Array.isArray(n.viaServers)?n.viaServers.slice(0,3):[n.viaServers];s.server_name=o,s.via=o}var a={};return n.reason&&(a.reason=n.reason),this.http.authedRequest(he.Post,i,s,a)}resendEvent(e,n){return this.toDeviceMessageQueue.sendQueue(),this.updatePendingEventStatus(n,e,ct.SENDING),this.encryptAndSendEvent(n,e)}cancelPendingEvent(e){if(![ct.QUEUED,ct.NOT_SENT,ct.ENCRYPTING].includes(e.status))throw new Error("cannot cancel an event with status "+e.status);e.status===ct.ENCRYPTING?this.eventsBeingEncrypted.delete(e.getId()):this.scheduler&&e.status===ct.QUEUED&&this.scheduler.removeEventFromQueue(e);var n=this.getRoom(e.getRoomId());this.updatePendingEventStatus(n,e,ct.CANCELLED)}setRoomName(e,n){return this.sendStateEvent(e,Z.RoomName,{name:n})}setRoomTopic(e,n,r){var i=fX(n,r);return this.sendStateEvent(e,Z.RoomTopic,i)}getRoomTags(e){var n=Pe("/user/$userId/rooms/$roomId/tags",{$userId:this.credentials.userId,$roomId:e});return this.http.authedRequest(he.Get,n)}setRoomTag(e,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},i=Pe("/user/$userId/rooms/$roomId/tags/$tag",{$userId:this.credentials.userId,$roomId:e,$tag:n});return this.http.authedRequest(he.Put,i,void 0,r)}deleteRoomTag(e,n){var r=Pe("/user/$userId/rooms/$roomId/tags/$tag",{$userId:this.credentials.userId,$roomId:e,$tag:n});return this.http.authedRequest(he.Delete,r)}setRoomAccountData(e,n,r){var i=Pe("/user/$userId/rooms/$roomId/account_data/$type",{$userId:this.credentials.userId,$roomId:e,$type:n});return this.http.authedRequest(he.Put,i,void 0,r)}setPowerLevel(e,n,r){var i=this;return B(function*(){var s,o;if(i.clientRunning&&i.isInitialSyncComplete()){var a;o=(a=i.getRoom(e))===null||a===void 0||(a=a.currentState)===null||a===void 0||(a=a.getStateEvents(Z.RoomPowerLevels,""))===null||a===void 0?void 0:a.getContent()}if(!o)try{o=yield i.getStateEvent(e,Z.RoomPowerLevels,"")}catch(d){if(d instanceof In&&d.errcode==="M_NOT_FOUND")o={};else throw d}o=F_(o),(s=o)!==null&&s!==void 0&&s.users||(o.users={});var c=Array.isArray(n)?n:[n];for(var l of c)r==null?delete o.users[l]:o.users[l]=r;return i.sendStateEvent(e,Z.RoomPowerLevels,o,"")})()}unstable_createLiveBeacon(e,n){var r=this;return B(function*(){return r.unstable_setLiveBeacon(e,n)})()}unstable_setLiveBeacon(e,n){var r=this;return B(function*(){return r.sendStateEvent(e,vP.name,n,r.getUserId())})()}sendEvent(e,n,r,i,s){var o,a,c,l;return!(n!=null&&n.startsWith(Qc))&&n!==null?(l=i,c=r,a=n,o=null):(l=s,c=i,a=r,o=n),this.addThreadRelationIfNeeded(c,o,e),this.sendCompleteEvent({roomId:e,threadId:o,eventObject:{type:a,content:c},txnId:l})}addThreadRelationIfNeeded(e,n,r){var i;if(n&&!((i=e["m.relates_to"])!==null&&i!==void 0&&i.rel_type)){var s,o,a=!!((s=e["m.relates_to"])!==null&&s!==void 0&&s["m.in_reply_to"]);e["m.relates_to"]=Yn(Yn({},e["m.relates_to"]),{},{rel_type:Rn.name,event_id:n,is_falling_back:!a});var c=(o=this.getRoom(r))===null||o===void 0?void 0:o.getThread(n);if(c&&!a){var l,d;e["m.relates_to"]["m.in_reply_to"]={event_id:(l=(d=c.lastReply(h=>h.isRelation(Rn.name)&&!h.status))===null||d===void 0?void 0:d.getId())!==null&&l!==void 0?l:n}}}}sendCompleteEvent(e){var{roomId:n,threadId:r,eventObject:i,delayOpts:s,queryDict:o,txnId:a}=e;a||(a=this.makeTxnId());var c=new ns(Object.assign(i,{event_id:"~"+n+":"+a,user_id:this.credentials.userId,sender:this.credentials.userId,room_id:n,origin_server_ts:new Date().getTime()})),l=this.getRoom(n),d=r?l?.getThread(r):void 0;d&&c.setThread(d),s||(this.reEmitter.reEmit(c,[Zt.Replaced,Zt.VisibilityChange]),l?.reEmitter.reEmit(c,[Zt.BeforeRedaction]));var h=c.getAssociatedId();if(h!=null&&h.startsWith("~")){var m=l?.getPendingEvents().find(y=>y.getId()===h);m?.once(Zt.LocalEventIdReplaced,()=>{c.updateAssociatedId(m.getId())})}var g=c.getType();return this.logger.debug("sendEvent of type ".concat(g," in ").concat(n," with txnId ").concat(a).concat(s?" (delayed event)":"").concat(o?" query params: "+JSON.stringify(o):"")),c.setTxnId(a),c.setStatus(ct.SENDING),s?this.encryptAndSendEvent(l,c,s,o):(l?.addPendingEvent(c,a),c.status===ct.NOT_SENT?Promise.reject(new Error("Event blocked by other events not yet sent")):this.encryptAndSendEvent(l,c,o))}encryptAndSendEvent(e,n,r,i){var s=this;return B(function*(){var o=i;if(r&&MC(r))return s.sendEventHttpRequest(n,r,o);o||(o=r);try{var a;s.eventsBeingEncrypted.add(n.getId());try{yield s.encryptEventIfNeeded(n,e??void 0)}finally{a=!s.eventsBeingEncrypted.delete(n.getId())}if(a)return{};n.status===ct.ENCRYPTING&&s.updatePendingEventStatus(e,n,ct.SENDING);var c=null;return s.scheduler&&(c=s.scheduler.queueEvent(n),c&&s.scheduler.getQueueForEvent(n).length>1&&s.updatePendingEventStatus(e,n,ct.QUEUED)),c||(c=s.sendEventHttpRequest(n,o),e&&(c=c.then(l=>(e.updatePendingEvent(n,ct.SENT,l.event_id),l)))),yield c}catch(l){s.logger.error("Error sending event",l);try{n.error=l,s.updatePendingEventStatus(e,n,ct.NOT_SENT)}catch(d){s.logger.error("Exception in error handler!",d)}throw l instanceof In&&(l.event=n),l}})()}encryptEventIfNeeded(e,n){var r=this;return B(function*(){if(n&&(yield r.shouldEncryptEventForRoom(e,n))&&!(!r.cryptoBackend&&r.usingExternalCrypto)){if(!r.cryptoBackend)throw new Error("This room is configured to use encryption, but your client does not support encryption.");r.updatePendingEventStatus(n,e,ct.ENCRYPTING),yield r.cryptoBackend.encryptEvent(e,n)}})()}shouldEncryptEventForRoom(e,n){var r=this;return B(function*(){var i;return e.isEncrypted()||e.getType()===Z.Reaction||e.isRedaction()?!1:!!(n.hasEncryptionStateEvent()||(yield(i=r.cryptoBackend)===null||i===void 0?void 0:i.isEncryptionEnabledInRoom(n.roomId)))})()}getEncryptedIfNeededEventType(e,n){var r;return n===Z.Reaction?n:(r=this.getRoom(e))!==null&&r!==void 0&&r.hasEncryptionStateEvent()?Z.RoomMessageEncrypted:n}updatePendingEventStatus(e,n,r){e?e.updatePendingEvent(n,r):n.setStatus(r)}sendEventHttpRequest(e,n,r){var i=e.getTxnId();i||(i=this.makeTxnId(),e.setTxnId(i));var s={$roomId:e.getRoomId(),$eventType:e.getWireType(),$stateKey:e.getStateKey(),$txnId:i},o;if(e.isState()){var a="/rooms/$roomId/state/$eventType";e.getStateKey()&&e.getStateKey().length>0&&(a="/rooms/$roomId/state/$eventType/$stateKey"),o=Pe(a,s)}else if(e.isRedaction()&&e.event.redacts){var c="/rooms/$roomId/redact/$redactsEventId/$txnId";o=Pe(c,Yn({$redactsEventId:e.event.redacts},s))}else o=Pe("/rooms/$roomId/send/$eventType/$txnId",s);var l=n&&MC(n)?n:void 0,d=l?r:n,h=e.getWireContent();return l?this.http.authedRequest(he.Put,o,Yn(Yn({},OB(l)),d),h):this.http.authedRequest(he.Put,o,d,h).then(m=>(this.logger.debug("Event sent to ".concat(e.getRoomId()," with event id ").concat(m.event_id)),m))}redactEvent(e,n,r,i,s){var o,a,c;(o=r)!==null&&o!==void 0&&o.startsWith(Qc)||(s=i,i=r,r=n,n=null);var l=(a=s)===null||a===void 0?void 0:a.reason,d={reason:l};if(((c=s)===null||c===void 0?void 0:c.with_rel_types)!==void 0){if(this.canSupport.get(di.RelationBasedRedactions)===ui.Unsupported)throw new Error("Server does not support relation based redactions "+"roomId ".concat(e," eventId ").concat(r," txnId: ").concat(i," threadId ").concat(n));var h=this.canSupport.get(di.RelationBasedRedactions)===ui.Stable?_A.stable:_A.unstable;d[h]=s.with_rel_types}return this.sendCompleteEvent({roomId:e,threadId:n,eventObject:{type:Z.RoomRedaction,content:d,redacts:r},txnId:i})}sendMessage(e,n,r,i){typeof n!="string"&&n!==null&&(i=r,r=n,n=null);var s=Z.RoomMessage,o=r;return this.sendEvent(e,n,s,o,i)}sendTextMessage(e,n,r,i){var s;!((s=n)!==null&&s!==void 0&&s.startsWith(Qc))&&n!==null&&(i=r,r=n,n=null);var o=aX(r);return this.sendMessage(e,n,o,i)}sendNotice(e,n,r,i){var s;!((s=n)!==null&&s!==void 0&&s.startsWith(Qc))&&n!==null&&(i=r,r=n,n=null);var o=cX(r);return this.sendMessage(e,n,o,i)}sendEmoteMessage(e,n,r,i){var s;!((s=n)!==null&&s!==void 0&&s.startsWith(Qc))&&n!==null&&(i=r,r=n,n=null);var o=lX(r);return this.sendMessage(e,n,o,i)}sendImageMessage(e,n,r,i){var s,o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:"Image";!((s=n)!==null&&s!==void 0&&s.startsWith(Qc))&&n!==null&&(o=i||"Image",i=r,r=n,n=null);var a={msgtype:Nl.Image,url:r,info:i,body:o};return this.sendMessage(e,n,a)}sendStickerMessage(e,n,r,i){var s,o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:"Sticker";!((s=n)!==null&&s!==void 0&&s.startsWith(Qc))&&n!==null&&(o=i||"Sticker",i=r,r=n,n=null);var a={url:r,info:i,body:o};return this.sendEvent(e,n,Z.Sticker,a)}sendHtmlMessage(e,n,r,i){var s;!((s=n)!==null&&s!==void 0&&s.startsWith(Qc))&&n!==null&&(i=r,r=n,n=null);var o=iX(r,i);return this.sendMessage(e,n,o)}sendHtmlNotice(e,n,r,i){var s;!((s=n)!==null&&s!==void 0&&s.startsWith(Qc))&&n!==null&&(i=r,r=n,n=null);var o=sX(r,i);return this.sendMessage(e,n,o)}sendHtmlEmote(e,n,r,i){var s;!((s=n)!==null&&s!==void 0&&s.startsWith(Qc))&&n!==null&&(i=r,r=n,n=null);var o=oX(r,i);return this.sendMessage(e,n,o)}_unstable_sendDelayedEvent(e,n,r,i,s,o){var a=this;return B(function*(){if(!(yield a.doesServerSupportUnstableFeature(Qi)))throw new Wo("Server does not support the delayed events API","sendDelayedEvent");return a.addThreadRelationIfNeeded(s,r,e),a.sendCompleteEvent({roomId:e,threadId:r,eventObject:{type:i,content:s},delayOpts:n,txnId:o})})()}_unstable_sendStickyDelayedEvent(e,n,r,i,s,o,a){var c=this;return B(function*(){if(!(yield c.doesServerSupportUnstableFeature(Qi)))throw new Wo("Server does not support the delayed events API","getDelayedEvents");if(!(yield c.doesServerSupportUnstableFeature(jC)))throw new VA("Server does not support the sticky events","sendStickyEvent");return c.addThreadRelationIfNeeded(o,i,e),c.sendCompleteEvent({roomId:e,threadId:i,eventObject:{type:s,content:o},queryDict:{"org.matrix.msc4354.sticky_duration_ms":n},delayOpts:r,txnId:a})})()}_unstable_sendDelayedStateEvent(e,n,r,i){var s=arguments,o=this;return B(function*(){var a=s.length>4&&s[4]!==void 0?s[4]:"",c=s.length>5&&s[5]!==void 0?s[5]:{};if(!(yield o.doesServerSupportUnstableFeature(Qi)))throw new Wo("Server does not support the delayed events API","sendDelayedStateEvent");var l={$roomId:e,$eventType:r,$stateKey:a},d=Pe("/rooms/$roomId/state/$eventType",l);return a!==void 0&&(d=Pe(d+"/$stateKey",l)),o.http.authedRequest(he.Put,d,OB(n),i,c)})()}_unstable_sendStickyEvent(e,n,r,i,s,o){var a=this;return B(function*(){if(!(yield a.doesServerSupportUnstableFeature(jC)))throw new VA("Server does not support the sticky events","sendStickyEvent");return a.addThreadRelationIfNeeded(s,r,e),a.sendCompleteEvent({roomId:e,threadId:r,eventObject:{type:i,content:s},queryDict:{"org.matrix.msc4354.sticky_duration_ms":n},txnId:o})})()}_unstable_getDelayedEvents(e,n,r){var i=this;return B(function*(){if(!(yield i.doesServerSupportUnstableFeature(Qi)))throw new Wo("Server does not support the delayed events API","getDelayedEvents");var s={from:r,status:e,delay_id:n};return yield i.http.authedRequest(he.Get,"/delayed_events",s,void 0,{prefix:"".concat(hr.Unstable,"/").concat(Qi)})})()}_unstable_updateDelayedEvent(e,n){var r=arguments,i=this;return B(function*(){var s=r.length>2&&r[2]!==void 0?r[2]:{};if(!(yield i.doesServerSupportUnstableFeature(Qi)))throw new Wo("Server does not support the delayed events API","updateDelayedEvent");return yield i.updateScheduledDelayedEventWithActionInBody(e,n,s)})()}_unstable_cancelScheduledDelayedEvent(e){var n=arguments,r=this;return B(function*(){var i=n.length>1&&n[1]!==void 0?n[1]:{};return yield r.updateScheduledDelayedEvent(e,hp.Cancel,i)})()}_unstable_restartScheduledDelayedEvent(e){var n=arguments,r=this;return B(function*(){var i=n.length>1&&n[1]!==void 0?n[1]:{};return yield r.updateScheduledDelayedEvent(e,hp.Restart,i)})()}_unstable_sendScheduledDelayedEvent(e){var n=arguments,r=this;return B(function*(){var i=n.length>1&&n[1]!==void 0?n[1]:{};return yield r.updateScheduledDelayedEvent(e,hp.Send,i)})()}updateScheduledDelayedEvent(e,n){var r=arguments,i=this;return B(function*(){var s=r.length>2&&r[2]!==void 0?r[2]:{};if(!(yield i.doesServerSupportUnstableFeature(Qi)))throw new Wo("Server does not support the delayed events API","".concat(n,"ScheduledDelayedEvent"));try{var o=Pe("/delayed_events/$delayId/$action",{$delayId:e,$action:n});return yield i.http.request(he.Post,o,void 0,void 0,Yn(Yn({},s),{},{prefix:"".concat(hr.Unstable,"/").concat(Qi)}))}catch(a){if(a instanceof In&&a.errcode==="M_UNRECOGNIZED")return yield i.updateScheduledDelayedEventWithActionInBody(e,n,s);throw a}})()}updateScheduledDelayedEventWithActionInBody(e,n){var r=arguments,i=this;return B(function*(){var s=r.length>2&&r[2]!==void 0?r[2]:{},o=Pe("/delayed_events/$delayId",{$delayId:e}),a={action:n};try{return yield i.http.request(he.Post,o,void 0,a,Yn(Yn({},s),{},{prefix:"".concat(hr.Unstable,"/").concat(Qi)}))}catch(c){if(c instanceof In&&c.errcode==="M_MISSING_TOKEN")return yield i.http.authedRequest(he.Post,o,void 0,a,Yn(Yn({},s),{},{prefix:"".concat(hr.Unstable,"/").concat(Qi)}));throw c}})()}sendReceipt(e,n,r){var i=arguments,s=this;return B(function*(){var o=i.length>3&&i[3]!==void 0?i[3]:!1;if(s.isGuest())return Promise.resolve({});var a=Pe("/rooms/$roomId/receipt/$receiptType/$eventId",{$roomId:e.getRoomId(),$receiptType:n,$eventId:e.getId()}),c=!o&&s.supportsThreads(),l=c?Yn(Yn({},r),{},{thread_id:kv(e)}):r,d=s.http.authedRequest(he.Post,a,void 0,l||{}),h=s.getRoom(e.getRoomId());return h&&s.credentials.userId&&h.addLocalEchoReceipt(s.credentials.userId,e,n,o),d})()}sendReadReceipt(e){var n=arguments,r=this;return B(function*(){var i=n.length>1&&n[1]!==void 0?n[1]:Ps.Read,s=n.length>2&&n[2]!==void 0?n[2]:!1;if(e){var o=e.getId(),a=r.getRoom(e.getRoomId());if(a!=null&&a.hasPendingEvent(o))throw new Error("Cannot set read receipt to a pending event (".concat(o,")"));return r.sendReceipt(e,i,{},s)}})()}setRoomReadMarkers(e,n,r,i){var s=this;return B(function*(){var o=s.getRoom(e);if(o!=null&&o.hasPendingEvent(n))throw new Error("Cannot set read marker to a pending event (".concat(n,")"));var a;if(r){if(a=r.getId(),o!=null&&o.hasPendingEvent(a))throw new Error("Cannot set read receipt to a pending event (".concat(a,")"));o?.addLocalEchoReceipt(s.credentials.userId,r,Ps.Read)}var c;if(i){if(c=i.getId(),o!=null&&o.hasPendingEvent(c))throw new Error("Cannot set read receipt to a pending event (".concat(c,")"));o?.addLocalEchoReceipt(s.credentials.userId,i,Ps.ReadPrivate)}return yield s.setRoomReadMarkersHttpRequest(e,n,a,c)})()}sendRtcDecline(e,n){return this.sendEvent(e,Z.RTCDecline,{"m.relates_to":{event_id:n,rel_type:bn.Reference}})}getUrlPreview(e,n){n=Math.floor(n/6e4)*6e4;var r=new URL(e);r.hash="",e=r.toString();var i=n+"_"+e;if(i in this.urlPreviewCache)return this.urlPreviewCache[i];var s=this.http.authedRequest(he.Get,"/preview_url",{url:e,ts:n.toString()},void 0,{prefix:Wg.V3,priority:"low"});return this.urlPreviewCache[i]=s,s}sendTyping(e,n,r){if(this.isGuest())return Promise.resolve({});var i=Pe("/rooms/$roomId/typing/$userId",{$roomId:e,$userId:this.getUserId()}),s={typing:n};return n&&(s.timeout=r||2e4),this.http.authedRequest(he.Put,i,void 0,s)}getRoomUpgradeHistory(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,i=this.getRoom(e);if(!i)return[];var s=this.findPredecessorRooms(i,n,r),o=this.findSuccessorRooms(i,n,r);return[...s,i,...o]}findPredecessorRooms(e,n,r){for(var i,s=[],o=new Set([e.roomId]),a=(i=e.findPredecessor(r))===null||i===void 0?void 0:i.roomId;a!==null;){var c;if(a){if(o.has(a))break;o.add(a)}var l=this.getRoom(a);if(l===null)break;if(n){var d=l.currentState.getStateEvents(Z.RoomTombstone,"");if(!d||d.getContent().replacement_room!==e.roomId)break}s.splice(0,0,l),e=l,a=(c=e.findPredecessor(r))===null||c===void 0?void 0:c.roomId}return s}findSuccessorRooms(e,n,r){for(var i=[],s=e.currentState.getStateEvents(Z.RoomTombstone,"");s;){var o=this.getRoom(s.getContent().replacement_room);if(!o||o.roomId===e.roomId)break;if(n){var a,c=(a=o.findPredecessor(r))===null||a===void 0?void 0:a.roomId;if(!c||c!==e.roomId)break}i.push(o);var l=new Set(i.map(d=>d.roomId));if(l.size<i.length)return i.slice(0,i.length-1);e=o,s=e.currentState.getStateEvents(Z.RoomTombstone,"")}return i}invite(e,n){var r=arguments,i=this;return B(function*(){var s=r.length>2&&r[2]!==void 0?r[2]:{};if(typeof s!="object"&&(s={reason:s}),s.shareEncryptedHistory){var o;yield(o=i.cryptoBackend)===null||o===void 0?void 0:o.shareRoomHistoryWithUser(e,n)}return yield i.membershipChange(e,n,Ve.Invite,s.reason)})()}inviteByEmail(e,n){return this.inviteByThreePid(e,"email",n)}inviteByThreePid(e,n,r){var i=this;return B(function*(){var s,o=Pe("/rooms/$roomId/invite",{$roomId:e}),a=i.getIdentityServerUrl(!0);if(!a)return Promise.reject(new In({error:"No supplied identity server URL",errcode:"ORG.MATRIX.JSSDK_MISSING_PARAM"}));var c={id_server:a,medium:n,address:r};if((s=i.identityServer)!==null&&s!==void 0&&s.getAccessToken){var l=yield i.identityServer.getAccessToken();l&&(c.id_access_token=l)}return i.http.authedRequest(he.Post,o,void 0,c)})()}leave(e){return this.membershipChange(e,void 0,Ve.Leave)}leaveRoomChain(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,r=this.getRoomUpgradeHistory(e,!0),i=r;if(!n){i=[];for(var s of r)if(i.push(s),s.roomId===e)break}var o={},a=[],c=d=>this.leave(d).then(()=>{delete o[d]}).catch(h=>{o[d]=h});for(var l of i)a.push(c(l.roomId));return Promise.all(a).then(()=>o)}ban(e,n,r){return this.membershipChange(e,n,Ve.Ban,r)}forget(e){var n=arguments,r=this;return B(function*(){var i=n.length>1&&n[1]!==void 0?n[1]:!0,s=Pe("/rooms/$room_id/forget",{$room_id:e}),o=yield r.http.authedRequest(he.Post,s);return i&&(r.store.removeRoom(e),r.emit(De.DeleteRoom,e)),o})()}unban(e,n){var r=Pe("/rooms/$roomId/unban",{$roomId:e}),i={user_id:n};return this.http.authedRequest(he.Post,r,void 0,i)}kick(e,n,r){var i=Pe("/rooms/$roomId/kick",{$roomId:e}),s={user_id:n,reason:r};return this.http.authedRequest(he.Post,i,void 0,s)}membershipChange(e,n,r,i){var s=Pe("/rooms/$room_id/$membership",{$room_id:e,$membership:r});return this.http.authedRequest(he.Post,s,void 0,{user_id:n,reason:i})}getPushActionsForEvent(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(!e.getPushActions()||n){var{actions:r,rule:i}=this.pushProcessor.actionsAndRuleForEvent(e);e.setPushDetails(r,i)}return e.getPushActions()}getPushDetailsForEvent(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(!e.getPushDetails()||n){var{actions:r,rule:i}=this.pushProcessor.actionsAndRuleForEvent(e);e.setPushDetails(r,i)}return e.getPushDetails()}setProfileInfo(e,n){var r=Pe("/profile/$userId/$info",{$userId:this.credentials.userId,$info:e});return this.http.authedRequest(he.Put,r,void 0,n)}setDisplayName(e){var n=this;return B(function*(){var r=yield n.setProfileInfo("displayname",{displayname:e}),i=n.getUser(n.getUserId());return i&&(i.displayName=e,i.emit(Xi.DisplayName,i.events.presence,i)),r})()}setAvatarUrl(e){var n=this;return B(function*(){var r=yield n.setProfileInfo("avatar_url",{avatar_url:e}),i=n.getUser(n.getUserId());return i&&(i.avatarUrl=e,i.emit(Xi.AvatarUrl,i.events.presence,i)),r})()}mxcUrlToHttp(e,n,r,i,s,o,a){return yT(this.baseUrl,e,n,r,i,s,o,a)}setSyncPresence(e){var n=this;return B(function*(){var r;(r=n.syncApi)===null||r===void 0||r.setPresence(e)})()}setPresence(e){var n=this;return B(function*(){var r=Pe("/presence/$userId/status",{$userId:n.credentials.userId}),i=["offline","online","unavailable"];if(i.indexOf(e.presence)===-1)throw new Error("Bad presence value: "+e.presence);yield n.http.authedRequest(he.Put,r,void 0,e)})()}getPresence(e){var n=Pe("/presence/$userId/status",{$userId:e});return this.http.authedRequest(he.Get,n)}scrollback(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:30,r=0,i=this.ongoingScrollbacks[e.roomId]||{};if(i.promise)return i.promise;if(i.errorTs){var s=Date.now()-i.errorTs;r=Math.max(X1e-s,0)}if(e.oldState.paginationToken===null)return Promise.resolve(e);var o=this.store.scrollback(e,n).length;if(o===n)return Promise.resolve(e);n=n-o;var a=new Promise((c,l)=>{Wp(r).then(()=>this.createMessagesRequest(e.roomId,e.oldState.paginationToken,n,Et.Backward)).then(d=>{var h,m,g=d.chunk.map(this.getEventMapper());if(d.state){var y=d.state.map(this.getEventMapper());e.currentState.setUnknownStateEvents(y)}var[v,E,w]=e.partitionThreadedEvents(g);this.processAggregatedTimelineEvents(e,v),e.addEventsToTimeline(v,!0,!0,e.getLiveTimeline()),this.processThreadEvents(e,E,!0),w.forEach(k=>e.relations.aggregateChildEvent(k)),e.oldState.paginationToken=(h=d.end)!==null&&h!==void 0?h:null,d.chunk.length===0&&(e.oldState.paginationToken=null),this.store.storeEvents(e,g,(m=d.end)!==null&&m!==void 0?m:null,!0),delete this.ongoingScrollbacks[e.roomId],c(e)}).catch(d=>{this.ongoingScrollbacks[e.roomId]={errorTs:Date.now()},l(d)})});return i={promise:a},this.ongoingScrollbacks[e.roomId]=i,a}getEventMapper(e){return P0e(this,e||{})}getEventContext(e,n){var r=this;return B(function*(){var i,s=Pe("/rooms/$roomId/context/$eventId",{$roomId:e,$eventId:n}),o={limit:"0"};(i=r.clientOpts)!==null&&i!==void 0&&i.lazyLoadMembers&&(o.filter=JSON.stringify(zo.LAZY_LOADING_MESSAGES_FILTER));var a=yield r.http.authedRequest(he.Get,s,o);if(a.event){var c,l,d;return{start:a.start,end:a.end,event:a.event,events_after:(c=a.events_after)!==null&&c!==void 0?c:[],events_before:(l=a.events_before)!==null&&l!==void 0?l:[],state:(d=a.state)!==null&&d!==void 0?d:[]}}throw new Error("'event' not in '/context' result - homeserver too old?")})()}getEventTimeline(e,n){var r=this;return B(function*(){var i,s,o;if(!r.timelineSupport)throw new Error("timeline support is disabled. Set the 'timelineSupport' parameter to true when creating MatrixClient to enable it.");if(!(e!=null&&e.room))throw new Error("getEventTimeline only supports room timelines");if(e.getTimelineForEvent(n))return e.getTimelineForEvent(n);if(e.thread&&r.supportsThreads()){var a;return(a=yield r.getThreadTimeline(e,n))!==null&&a!==void 0?a:null}var c=yield r.getEventContext(e.room.roomId,n);if(e.getTimelineForEvent(n))return e.getTimelineForEvent(n);var l=r.getEventMapper(),d=l(c.event);if(d.isRelation(Rn.name))return r.logger.warn("Tried loading a regular timeline at the position of a thread event"),null;var h=[...c.events_after.reverse().map(l),d,...c.events_before.map(l)],m=e.getTimelineForEvent(h[0].getId());if(m)m.getState(Fe.BACKWARDS).setUnknownStateEvents(c.state.map(l));else{var g;m=e.addTimeline(),m.initialiseState(c.state.map(l)),m.getState(Fe.FORWARDS).paginationToken=(g=c.end)!==null&&g!==void 0?g:null}var[y,v,E]=e.room.partitionThreadedEvents(h);return e.addEventsToTimeline(y,!0,!1,m,c.start),r.processThreadEvents(e.room,v,!0),r.processAggregatedTimelineEvents(e.room,y),E.forEach(w=>e.relations.aggregateChildEvent(w)),(i=(s=e.getTimelineForEvent(n))!==null&&s!==void 0?s:(o=e.room.findThreadForEvent(d))===null||o===void 0?void 0:o.liveTimeline)!==null&&i!==void 0?i:m})()}getThreadTimeline(e,n){var r=this;return B(function*(){if(!r.supportsThreads())throw new Error("could not get thread timeline: no client support");if(!e.room)throw new Error("could not get thread timeline: not a room timeline");if(!e.thread)throw new Error("could not get thread timeline: not a thread timeline");var i=yield r.getEventContext(e.room.roomId,n),s=r.getEventMapper(),o=s(i.event);if(e.canContain(o)){var a=r.canSupport.get(di.RelationsRecursion)!==ui.Unsupported;if($n.hasServerSideSupport)if($n.hasServerSideFwdPaginationSupport){var c,l,d;if(!e.thread)throw new Error("could not get thread timeline: not a thread timeline");var h=e.thread,m=yield r.fetchRelations(e.room.roomId,h.id,null,null,{dir:Et.Backward,from:i.start,recurse:a||void 0}),g=yield r.fetchRelations(e.room.roomId,h.id,null,null,{dir:Et.Forward,from:i.end,recurse:a||void 0}),y=[...g.chunk.reverse().filter(hx(h.id)).map(s),o,...m.chunk.filter(hx(h.id)).map(s)];for(var v of y){var E;yield(E=e.thread)===null||E===void 0?void 0:E.processEvent(v)}var w=e.getTimelineForEvent(o.getId());if(w?w.getState(Fe.BACKWARDS).setUnknownStateEvents(i.state.map(s)):(w=e.addTimeline(),w.initialiseState(i.state.map(s))),e.addEventsToTimeline(y,!0,!1,w,g.next_batch),!m.next_batch){var k=yield r.fetchRoomEvent(e.room.roomId,h.id);e.addEventsToTimeline([s(k)],!0,!1,w,null)}return w.setPaginationToken((c=m.next_batch)!==null&&c!==void 0?c:null,Et.Backward),w.setPaginationToken((l=g.next_batch)!==null&&l!==void 0?l:null,Et.Forward),r.processAggregatedTimelineEvents(e.room,y),(d=e.getTimelineForEvent(n))!==null&&d!==void 0?d:w}else{for(var x,C=e.thread,R=yield r.fetchRelations(e.room.roomId,C.id,Rn.name,null,{dir:Et.Backward,from:i.start,recurse:a||void 0}),T=[],M=i.end;M;){var O=yield r.fetchRelations(e.room.roomId,C.id,Rn.name,null,{dir:Et.Forward,from:M,recurse:a||void 0});M=O.next_batch,T.push(...O.chunk)}var P=[...T.reverse().map(s),o,...R.chunk.map(s)];for(var D of P){var j;yield(j=e.thread)===null||j===void 0?void 0:j.processEvent(D)}var $=e.getLiveTimeline();if($.getState(Fe.BACKWARDS).setUnknownStateEvents(i.state.map(s)),e.addEventsToTimeline(P,!0,!1,$,null),!R.next_batch){var q=yield r.fetchRoomEvent(e.room.roomId,C.id);e.addEventsToTimeline([s(q)],!0,!1,$,null)}return $.setPaginationToken((x=R.next_batch)!==null&&x!==void 0?x:null,Et.Backward),$.setPaginationToken(null,Et.Forward),r.processAggregatedTimelineEvents(e.room,P),$}}})()}getLatestTimeline(e){var n=this;return B(function*(){if(!n.timelineSupport)throw new Error("timeline support is disabled. Set the 'timelineSupport' parameter to true when creating MatrixClient to enable it.");if(!e.room)throw new Error("getLatestTimeline only supports room timelines");var r;if(e.threadListType!==null){var i,s=yield n.createThreadListMessagesRequest(e.room.roomId,null,1,Et.Backward,e.threadListType,e.getFilter());r=(i=s.chunk)===null||i===void 0?void 0:i[0]}else if(e.thread&&$n.hasServerSideSupport){var o,a=n.canSupport.get(di.RelationsRecursion)!==ui.Unsupported,c=yield n.fetchRelations(e.room.roomId,e.thread.id,Rn.name,null,{dir:Et.Backward,limit:1,recurse:a||void 0});r=(o=c.chunk)===null||o===void 0?void 0:o[0]}else{var l,d,h=Pe("/rooms/$roomId/messages",{$roomId:e.room.roomId}),m={dir:"b"};(l=n.clientOpts)!==null&&l!==void 0&&l.lazyLoadMembers&&(m.filter=JSON.stringify(zo.LAZY_LOADING_MESSAGES_FILTER));var g=yield n.http.authedRequest(he.Get,h,m);r=(d=g.chunk)===null||d===void 0?void 0:d[0]}if(!r)throw new Error("No message returned when trying to construct getLatestTimeline");return n.getEventTimeline(e,r.event_id)})()}createMessagesRequest(e,n){var r,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:30,s=arguments.length>3?arguments[3]:void 0,o=arguments.length>4?arguments[4]:void 0,a=Pe("/rooms/$roomId/messages",{$roomId:e}),c={limit:i.toString(),dir:s};n&&(c.from=n);var l=null;if((r=this.clientOpts)!==null&&r!==void 0&&r.lazyLoadMembers&&(l=Object.assign({},zo.LAZY_LOADING_MESSAGES_FILTER)),o){var d;l=l||{},Object.assign(l,(d=o.getRoomTimelineFilterComponent())===null||d===void 0?void 0:d.toJSON())}return l&&(c.filter=JSON.stringify(l)),this.http.authedRequest(he.Get,a,c)}createThreadListMessagesRequest(e,n){var r,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:30,s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:Et.Backward,o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:vc.All,a=arguments.length>5?arguments[5]:void 0,c=Pe("/rooms/$roomId/threads",{$roomId:e}),l={limit:i.toString(),dir:s,include:uQ(o)};n&&(l.from=n);var d={};if((r=this.clientOpts)!==null&&r!==void 0&&r.lazyLoadMembers&&(d=Yn({},zo.LAZY_LOADING_MESSAGES_FILTER)),a){var h;d=Yn(Yn({},d),(h=a.getRoomTimelineFilterComponent())===null||h===void 0?void 0:h.toJSON())}Object.keys(d).length&&(l.filter=JSON.stringify(d));var m={prefix:$n.hasServerSideListSupport===bs.Stable?hr.V1:"/_matrix/client/unstable/org.matrix.msc3856"};return this.http.authedRequest(he.Get,c,l,void 0,m).then(g=>{var y;return Yn(Yn({},g),{},{chunk:(y=g.chunk)===null||y===void 0?void 0:y.reverse(),start:g.prev_batch,end:g.next_batch})})}paginateEventTimeline(e,n){var r=this,i=e.getTimelineSet()===this.notifTimelineSet,s=this.getRoom(e.getRoomId()),o=e.getTimelineSet().threadListType,a=e.getTimelineSet().thread;n=n||{};var c=n.backwards||!1;if(i&&!c)throw new Error("paginateNotifTimeline can only paginate backwards");var l=c?Fe.BACKWARDS:Fe.FORWARDS,d=e.getPaginationToken(l),h=e.paginationRequests[l];if(h)return h;var m,g,y;if(i){var v;m="/notifications",g={limit:((v=n.limit)!==null&&v!==void 0?v:30).toString(),only:"highlight"},d&&d!=="end"&&(g.from=d),y=this.http.authedRequest(he.Get,m,g).then((function(){var C=B(function*(R){var T=R.next_token,M=[];R.notifications=R.notifications.filter(Ec);for(var O=0;O<R.notifications.length;O++){var P=R.notifications[O],D=r.getEventMapper()(P.event);r.getPushDetailsForEvent(D,!0),D.event.room_id=P.room_id,M[O]=D}var j=e.getTimelineSet();return j.addEventsToTimeline(M,c,!1,e,T),r.processAggregatedTimelineEvents(j.room,M),c&&!R.next_token&&e.setPaginationToken(null,l),!!R.next_token});return function(R){return C.apply(this,arguments)}})()).finally(()=>{e.paginationRequests[l]=null}),e.paginationRequests[l]=y}else if(o!==null){if(!s)throw new Error("Unknown room "+e.getRoomId());if(!$n.hasServerSideFwdPaginationSupport&&l===Et.Forward)throw new Error("Cannot paginate threads forwards without server-side support for MSC 3715");y=this.createThreadListMessagesRequest(e.getRoomId(),d,n.limit,l,o,e.getFilter()).then(C=>{if(C.state){var R=e.getState(l),T=C.state.filter(Ec).map(this.getEventMapper());R.setUnknownStateEvents(T)}var M=C.end,O=C.chunk.filter(Ec).map(this.getEventMapper()),P=e.getTimelineSet();return P.addEventsToTimeline(O,c,!1,e,M),this.processAggregatedTimelineEvents(s,O),this.processThreadRoots(s,O,c),c&&C.end==C.start&&e.setPaginationToken(null,l),C.end!==C.start}).finally(()=>{e.paginationRequests[l]=null}),e.paginationRequests[l]=y}else if(a){var E,w,k=this.getRoom((E=e.getRoomId())!==null&&E!==void 0?E:void 0);if(!k)throw new Error("Unknown room "+e.getRoomId());var x=this.canSupport.get(di.RelationsRecursion)!==ui.Unsupported;y=this.fetchRelations((w=e.getRoomId())!==null&&w!==void 0?w:"",a.id,null,null,{dir:l,limit:n.limit,from:d??void 0,recurse:x||void 0}).then((function(){var C=B(function*(R){var T=r.getEventMapper(),M=R.chunk.filter(Ec).filter(hx(a.id)).map(T);for(var O of M.slice().reverse()){yield a?.processEvent(O);var P=O.getSender();(!c||a?.getEventReadUpTo(P)===null)&&k.addLocalEchoReceipt(P,O,Ps.Read)}var D=R.next_batch,j=e.getTimelineSet();if(j.addEventsToTimeline(M,c,!1,e,D??null),!D&&c){var $,q,Y=($=a.rootEvent)!==null&&$!==void 0?$:T(yield r.fetchRoomEvent((q=e.getRoomId())!==null&&q!==void 0?q:"",a.id));j.addEventsToTimeline([Y],!0,!1,e,null)}return r.processAggregatedTimelineEvents(j.room,M),c&&!D&&e.setPaginationToken(null,l),!!D});return function(R){return C.apply(this,arguments)}})()).finally(()=>{e.paginationRequests[l]=null}),e.paginationRequests[l]=y}else{if(!s)throw new Error("Unknown room "+e.getRoomId());y=this.createMessagesRequest(e.getRoomId(),d,n.limit,l,e.getFilter()).then(C=>{if(C.state){var R=e.getState(l),T=C.state.filter(Ec).map(this.getEventMapper());R.setUnknownStateEvents(T)}var M=C.end,O=C.chunk.filter(Ec).map(this.getEventMapper()),P=e.getTimelineSet(),[D,,j]=s.partitionThreadedEvents(O);P.addEventsToTimeline(D,c,!1,e,M),this.processAggregatedTimelineEvents(s,D),this.processThreadRoots(s,D.filter(q=>q.getServerAggregatedRelation(Rn.name)),!1),j.forEach(q=>s.relations.aggregateChildEvent(q));var $=C.end===void 0||C.end===C.start;return c&&$&&e.setPaginationToken(null,l),!$}).finally(()=>{e.paginationRequests[l]=null}),e.paginationRequests[l]=y}return y}resetNotifTimelineSet(){this.notifTimelineSet&&this.notifTimelineSet.resetLiveTimeline("end")}peekInRoom(e){var n,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:20;return(n=this.peekSync)===null||n===void 0||n.stopPeeking(),this.peekSync=new yf(this,this.clientOpts,this.buildSyncApiOptions()),this.peekSync.peek(e,r)}stopPeeking(){this.peekSync&&(this.peekSync.stopPeeking(),this.peekSync=null)}setGuestAccess(e,n){var r=this.sendStateEvent(e,Z.RoomGuestAccess,{guest_access:n.allowJoin?LC.CanJoin:LC.Forbidden},""),i=Promise.resolve();return n.allowRead&&(i=this.sendStateEvent(e,Z.RoomHistoryVisibility,{history_visibility:gP.WorldReadable},"")),Promise.all([i,r]).then()}requestRegisterEmailToken(e,n,r,i){return this.requestTokenFromEndpoint("/register/email/requestToken",{email:e,client_secret:n,send_attempt:r,next_link:i})}requestRegisterMsisdnToken(e,n,r,i,s){return this.requestTokenFromEndpoint("/register/msisdn/requestToken",{country:e,phone_number:n,client_secret:r,send_attempt:i,next_link:s})}requestAdd3pidEmailToken(e,n,r,i){return this.requestTokenFromEndpoint("/account/3pid/email/requestToken",{email:e,client_secret:n,send_attempt:r,next_link:i})}requestAdd3pidMsisdnToken(e,n,r,i,s){return this.requestTokenFromEndpoint("/account/3pid/msisdn/requestToken",{country:e,phone_number:n,client_secret:r,send_attempt:i,next_link:s})}requestPasswordEmailToken(e,n,r,i){return this.requestTokenFromEndpoint("/account/password/email/requestToken",{email:e,client_secret:n,send_attempt:r,next_link:i})}requestPasswordMsisdnToken(e,n,r,i,s){return this.requestTokenFromEndpoint("/account/password/msisdn/requestToken",{country:e,phone_number:n,client_secret:r,send_attempt:i,next_link:s})}requestTokenFromEndpoint(e,n){var r=this;return B(function*(){var i=Object.assign({},n);return r.http.request(he.Post,e,void 0,i)})()}getRoomPushRule(e,n){if(this.pushRules){var r;return(r=this.pushRules[e])===null||r===void 0||(r=r.room)===null||r===void 0?void 0:r.find(i=>i.rule_id===n)}else throw new Error("SyncApi.sync() must be done before accessing to push rules.")}setRoomMutePushRule(e,n,r){var i,s=!1,o=this.getRoomPushRule(e,n);if(o!=null&&o.actions.includes(Rf.DontNotify)&&(s=!0),!r)s&&(i=this.deletePushRule(e,Mi.RoomSpecific,o.rule_id));else if(!o)i=this.addPushRule(e,Mi.RoomSpecific,n,{actions:[Rf.DontNotify]});else if(!s){var a=Promise.withResolvers();this.deletePushRule(e,Mi.RoomSpecific,o.rule_id).then(()=>{this.addPushRule(e,Mi.RoomSpecific,n,{actions:[Rf.DontNotify]}).then(()=>{a.resolve()}).catch(c=>{a.reject(c)})}).catch(c=>{a.reject(c)}),i=a.promise}if(i)return new Promise((c,l)=>{i.then(()=>{this.getPushRules().then(d=>{this.pushRules=d,c()}).catch(d=>{l(d)})}).catch(d=>{this.getPushRules().then(h=>{this.pushRules=h,l(d)}).catch(h=>{l(d)})})})}searchMessageText(e){var n={search_term:e.query};return"keys"in e&&(n.keys=e.keys),this.search({body:{search_categories:{room_events:n}}})}searchRoomEvents(e){var n={search_categories:{room_events:{search_term:e.term,filter:e.filter,order_by:$X.Recent,event_context:{before_limit:1,after_limit:1,include_profile:!0}}}},r={_query:n,results:[],highlights:[]};return this.search({body:n}).then(i=>this.processRoomEventsSearch(r,i))}backPaginateRoomEventsSearch(e){if(!e.next_batch)return Promise.reject(new Error("Cannot backpaginate event search any further"));if(e.pendingRequest)return e.pendingRequest;var n={body:e._query,next_batch:e.next_batch},r=this.search(n,e.abortSignal).then(i=>this.processRoomEventsSearch(e,i)).finally(()=>{e.pendingRequest=void 0});return e.pendingRequest=r,r}processRoomEventsSearch(e,n){var r,i,s=n.search_categories.room_events;e.count=s.count,e.next_batch=s.next_batch;var o=new Set(s.highlights);e.highlights.forEach(g=>{o.add(g)}),e.highlights=Array.from(o);for(var a=this.getEventMapper(),c=(r=(i=s.results)===null||i===void 0?void 0:i.length)!==null&&r!==void 0?r:0,l=0;l<c;l++){var d=TT.fromJson(s.results[l],a),h=this.getRoom(d.context.getEvent().getRoomId());if(h)for(var m of d.context.getTimeline())m.setMetadata(h.currentState,!1);e.results.push(d)}return e}syncLeftRooms(){if(this.syncedLeftRooms)return Promise.resolve([]);if(this.syncLeftRoomsPromise)return this.syncLeftRoomsPromise;var e=new yf(this,this.clientOpts,this.buildSyncApiOptions());return this.syncLeftRoomsPromise=e.syncLeftRooms(),this.syncLeftRoomsPromise.then(()=>{this.logger.debug("Marking success of sync left room request"),this.syncedLeftRooms=!0}).finally(()=>{this.syncLeftRoomsPromise=void 0}),this.syncLeftRoomsPromise}createFilter(e){var n=Pe("/user/$userId/filter",{$userId:this.credentials.userId});return this.http.authedRequest(he.Post,n,void 0,e).then(r=>{var i=zo.fromJson(this.credentials.userId,r.filter_id,e);return this.store.storeFilter(i),i})}getFilter(e,n,r){if(r){var i=this.store.getFilter(e,n);if(i)return Promise.resolve(i)}var s=Pe("/user/$userId/filter/$filterId",{$userId:e,$filterId:n});return this.http.authedRequest(he.Get,s).then(o=>{var a=zo.fromJson(e,n,o);return this.store.storeFilter(a),a})}getOrCreateFilter(e,n){var r=this;return B(function*(){var i=r.store.getFilterIdByName(e),s;if(i){try{var o=yield r.getFilter(r.credentials.userId,i,!0);if(o){var a=o.getDefinition(),c=n.getDefinition();kp(a,c)&&(s=i)}}catch(d){if(d.errcode!=="M_UNKNOWN"&&d.errcode!=="M_NOT_FOUND")throw d}s||r.store.setFilterIdByName(e,void 0)}if(s)return s;var l=yield r.createFilter(n.getDefinition());return r.store.setFilterIdByName(e,l.filterId),l.filterId})()}getOpenIdToken(){var e=Pe("/user/$userId/openid/request_token",{$userId:this.credentials.userId});return this.http.authedRequest(he.Post,e,void 0,{})}turnServer(){return this.http.authedRequest(he.Get,"/voip/turnServer")}getTurnServers(){return this.turnServers||[]}getTurnServersExpiry(){return this.turnServersExpiry}get pollingTurnServers(){return this.checkTurnServersIntervalID!==void 0}checkTurnServers(){var e=this;return B(function*(){if(e.supportsVoip()){var n=!1,r=e.turnServersExpiry-Date.now();if(r>MB)e.logger.debug("TURN creds are valid for another "+r+" ms: not fetching new ones."),n=!0;else{e.logger.debug("Fetching new TURN credentials");try{var i=yield e.turnServer();if(i.uris){e.logger.debug("Got TURN URIs: "+i.uris+" refresh in "+i.ttl+" secs");var s={urls:i.uris,username:i.username,credential:i.password};e.turnServers=[s],e.turnServersExpiry=Date.now()+i.ttl*1e3,n=!0,e.emit(De.TurnServers,e.turnServers)}}catch(o){e.logger.error("Failed to get TURN URIs",o),o.httpStatus===403?(e.logger.info("TURN access unavailable for this account: stopping credentials checks"),e.checkTurnServersIntervalID!==null&&globalThis.clearInterval(e.checkTurnServersIntervalID),e.checkTurnServersIntervalID=void 0,e.emit(De.TurnServersError,o,!0)):e.emit(De.TurnServersError,o,!1)}}return n}})()}setFallbackICEServerAllowed(e){this.fallbackICEServerAllowed=e}isFallbackICEServerAllowed(){return this.fallbackICEServerAllowed}isSynapseAdministrator(){var e=Pe("/_synapse/admin/v1/users/$userId/admin",{$userId:this.getUserId()});return this.http.authedRequest(he.Get,e,void 0,void 0,{prefix:""}).then(n=>n.admin)}whoisSynapseUser(e){var n=Pe("/_synapse/admin/v1/whois/$userId",{$userId:e});return this.http.authedRequest(he.Get,n,void 0,void 0,{prefix:""})}deactivateSynapseUser(e){var n=Pe("/_synapse/admin/v1/deactivate/$userId",{$userId:e});return this.http.authedRequest(he.Post,n,void 0,void 0,{prefix:""})}fetchClientWellKnown(){var e=this;return B(function*(){var n;e.clientWellKnownPromise=ht.getRawClientConfig((n=e.getDomain())!==null&&n!==void 0?n:void 0),e.clientWellKnown=yield e.clientWellKnownPromise,e.emit(De.ClientWellKnown,e.clientWellKnown)})()}getClientWellKnown(){return this.clientWellKnown}waitForClientWellKnown(){if(!this.clientRunning)throw new Error("Client is not running");return this.clientWellKnownPromise}storeClientOptions(){var e=["boolean","string","number"],n=Object.entries(this.clientOpts).filter(r=>{var[i,s]=r;return e.includes(typeof s)}).reduce((r,i)=>{var[s,o]=i;return r[s]=o,r},{});return this.store.storeClientOptions(n)}_unstable_getSharedRooms(e){var n=this;return B(function*(){var r=yield n.doesServerSupportUnstableFeature(iQ),i=yield n.doesServerSupportUnstableFeature(sQ),s=yield n.doesServerSupportUnstableFeature(oQ);if(!r&&!i&&!s)throw Error("Server does not support the Mutual Rooms API");var o,a;s?(o="/uk.half-shot.msc2666/user/mutual_rooms",a={user_id:e}):(o=Pe("/uk.half-shot.msc2666/user/".concat(i?"mutual_rooms":"shared_rooms","/$userId"),{$userId:e}),a={});var c=[],l=null;do{var d={};l!=null&&s&&(d.batch_token=l);var h=yield n.http.authedRequest(he.Get,o,Yn(Yn({},a),d),void 0,{prefix:hr.Unstable});c.push(...h.joined),h.next_batch_token!==void 0?l=h.next_batch_token:l=null}while(l!=null);return c})()}_unstable_getRTCTransports(){var e=this;return B(function*(){return(yield e.http.authedRequest(he.Get,"/rtc/transports",void 0,void 0,{prefix:"".concat(hr.Unstable,"/org.matrix.msc4143")})).rtc_transports})()}getVersions(){var e=this;return B(function*(){if(e.serverVersionsPromise)return e.serverVersionsPromise;e.serverVersionsPromise=e.http.authedRequest(he.Get,"/_matrix/client/versions",void 0,void 0,{prefix:""}).catch(r=>{throw e.serverVersionsPromise=void 0,r});var n=yield e.serverVersionsPromise;return e.canSupport=yield Nye(n),e.serverVersionsPromise})()}isVersionSupported(e){var n=this;return B(function*(){var{versions:r}=yield n.getVersions();return r&&r.includes(e)})()}doesServerSupportUnstableFeature(e){var n=this;return B(function*(){var r=yield n.getVersions();if(!r)return!1;var i=r.unstable_features;return i&&!!i[e]})()}doesServerForceEncryptionForPreset(e){var n=this;return B(function*(){var r=yield n.getVersions();if(!r)return!1;var i=r.unstable_features,s=e.includes("_chat")?e.substring(0,e.indexOf("_chat")):e;return i&&!!i["io.element.e2ee_forced.".concat(s)]})()}doesServerSupportThread(){var e=this;return B(function*(){if(yield e.isVersionSupported("v1.4"))return{threads:bs.Stable,list:bs.Stable,fwdPagination:bs.Stable};try{var[n,r,i,s,o,a]=yield Promise.all([e.doesServerSupportUnstableFeature("org.matrix.msc3440"),e.doesServerSupportUnstableFeature("org.matrix.msc3440.stable"),e.doesServerSupportUnstableFeature("org.matrix.msc3856"),e.doesServerSupportUnstableFeature("org.matrix.msc3856.stable"),e.doesServerSupportUnstableFeature("org.matrix.msc3715"),e.doesServerSupportUnstableFeature("org.matrix.msc3715.stable")]);return{threads:_E(r,n),list:_E(s,i),fwdPagination:_E(a,o)}}catch{return{threads:bs.None,list:bs.None,fwdPagination:bs.None}}})()}hasLazyLoadMembersEnabled(){var e;return!!((e=this.clientOpts)!==null&&e!==void 0&&e.lazyLoadMembers)}setCanResetTimelineCallback(e){this.canResetTimelineCallback=e}getCanResetTimelineCallback(){return this.canResetTimelineCallback}relations(e,n,r,i){var s=arguments,o=this;return B(function*(){var a,c,l=s.length>4&&s[4]!==void 0?s[4]:{dir:Et.Backward},d=i?o.getEncryptedIfNeededEventType(e,i):null,[h,m]=yield Promise.all([o.fetchRoomEvent(e,n),o.fetchRelations(e,n,r,d,l)]),g=o.getEventMapper(),y=h?g(h):void 0,v=m.chunk.map(g);if(d===Z.RoomMessageEncrypted){var E=y?v.concat(y):v;yield Promise.all(E.map(w=>o.decryptEventIfNeeded(w))),i!==null&&(v=v.filter(w=>w.getType()===i))}return y&&r===bn.Replace&&(v=v.filter(w=>w.getSender()===y.getSender())),{originalEvent:y??null,events:v,nextBatch:(a=m.next_batch)!==null&&a!==void 0?a:null,prevBatch:(c=m.prev_batch)!==null&&c!==void 0?c:null}})()}generateClientSecret(){return Qo(32)}decryptEventIfNeeded(e,n){return e.isState()&&!this.enableEncryptedStateEvents?Promise.resolve():(e.shouldAttemptDecryption()&&this.getCrypto()&&e.attemptDecryption(this.cryptoBackend,n),e.isBeingDecrypted()?e.getDecryptionPromise():Promise.resolve())}termsUrlForService(e,n){switch(e){case DA.IS:return this.http.getUrl("/terms",void 0,pu.V2,n);case DA.IM:return this.http.getUrl("/terms",void 0,"/_matrix/integrations/v1",n);default:throw new Error("Unsupported service type")}}getHomeserverUrl(){return this.baseUrl}getIdentityServerUrl(){var e,n,r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;return r&&((e=this.idBaseUrl)!==null&&e!==void 0&&e.startsWith("http://")||(n=this.idBaseUrl)!==null&&n!==void 0&&n.startsWith("https://"))?this.idBaseUrl.split("://")[1]:this.idBaseUrl}setIdentityServerUrl(e){this.idBaseUrl=QI(e),this.http.setIdBaseUrl(this.idBaseUrl)}getAccessToken(){return this.http.opts.accessToken||null}getRefreshToken(){var e;return(e=this.http.opts.refreshToken)!==null&&e!==void 0?e:null}setAccessToken(e){this.http.opts.accessToken=e,this.serverVersionsPromise=void 0}isLoggedIn(){return this.http.opts.accessToken!==void 0}makeTxnId(){return"m"+new Date().getTime()+"."+this.txnCtr++}isUsernameAvailable(e){return this.http.authedRequest(he.Get,"/register/available",{username:e}).then(n=>n.available).catch(n=>n.errcode==="M_USER_IN_USE"?!1:Promise.reject(n))}register(e,n,r,i,s,o,a){r&&(i.session=r);var c={auth:i,refresh_token:!0};return e!=null&&(c.username=e),n!=null&&(c.password=n),o!=null&&(c.guest_access_token=o),a!=null&&(c.inhibit_login=a),this.registerRequest(c)}registerGuest(){var{body:e}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return this.registerRequest(e||{},"guest")}registerRequest(e,n){var r={};return n&&(r.kind=n),this.http.request(he.Post,"/register",r,e)}refreshToken(e){var n=r=>this.http.authedRequest(he.Post,"/refresh",void 0,{refresh_token:e},{prefix:r,inhibitLogoutEmit:!0});return n(hr.V3).catch(r=>{if(r.errcode==="M_UNRECOGNIZED")return n(hr.V1);throw r})}loginFlows(){return this.http.request(he.Get,"/login")}login(e,n){return this.loginRequest(Yn(Yn({},n),{},{type:e})).then(r=>(r.access_token&&r.user_id&&(this.http.opts.accessToken=r.access_token,this.credentials={userId:r.user_id}),r))}loginWithPassword(e,n){return this.login("m.login.password",{user:e,password:n})}getCasLoginUrl(e){return this.getSsoLoginUrl(e,"cas")}getSsoLoginUrl(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"sso",r=arguments.length>2?arguments[2]:void 0,i=arguments.length>3?arguments[3]:void 0,s="/login/"+n+"/redirect";r&&(s+="/"+r);var o={redirectUrl:e,[LB.stable]:i,[LB.unstable]:i};return this.http.getUrl(s,o).href}loginWithToken(e){return this.login("m.login.token",{token:e})}loginRequest(e){var n=this;return B(function*(){return yield n.http.authedRequest(he.Post,"/login",void 0,e)})()}logout(){var e=arguments,n=this;return B(function*(){var r=e.length>0&&e[0]!==void 0?e[0]:!1;return r&&(n.stopClient(),n.http.abort()),n.http.authedRequest(he.Post,"/logout")})()}deactivateAccount(e,n){var r={};return e&&(r.auth=e),n!==void 0&&(r.erase=n),this.http.authedRequest(he.Post,"/account/deactivate",void 0,r)}requestLoginToken(e){var n=this;return B(function*(){var r={auth:e};return n.http.authedRequest(he.Post,"/login/get_token",void 0,r,{prefix:hr.V1})})()}getFallbackAuthUrl(e,n){var r=Pe("/auth/$loginType/fallback/web",{$loginType:e});return this.http.getUrl(r,{session:n}).href}createRoom(e){var n=this;return B(function*(){var r,i=(e.invite_3pid||[]).filter(a=>!a.id_access_token);if(i.length>0&&(r=n.identityServer)!==null&&r!==void 0&&r.getAccessToken){var s=yield n.identityServer.getAccessToken();if(s)for(var o of i)o.id_access_token=s}return n.http.authedRequest(he.Post,"/createRoom",void 0,e)})()}fetchRelations(e,n,r,i){var s=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{dir:Et.Backward},o=s;$n.hasServerSideFwdPaginationSupport===bs.Experimental&&(o=t$("dir","org.matrix.msc3715.dir",o)),this.canSupport.get(di.RelationsRecursion)===ui.Unstable&&(o=t$("recurse","org.matrix.msc3981.recurse",o));var a=dA(o),c="/rooms/$roomId/relations/$eventId";r!==null?(c+="/$relationType",i!==null&&(c+="/$eventType")):i!==null&&(this.logger.warn("eventType: ".concat(i,` ignored when fetching
24
+ Date.now: "`.concat(Date.now()));try{a=yield e.membershipLoopHandler(i.type)}catch(l){throw Error("The MembershipManager shut down because of the end condition: ".concat(l))}}e._actions.splice(0,1);var c=s??a;"replace"in c?e._actions=c.replace:"insert"in c&&e._actions.push(...c.insert)};e._actions.length>0;)yield*n()}finally{e.running=!1}e.logger.debug("Leave MembershipManager ActionScheduler loop (no more actions)")})()}initiateJoin(){var e;(e=this.wakeup)===null||e===void 0||e.call(this,{replace:[{ts:Date.now(),type:dt.SendDelayedEvent}]})}initiateLeave(){var e;(e=this.wakeup)===null||e===void 0||e.call(this,{replace:[{ts:Date.now(),type:dt.SendScheduledDelayedLeaveEvent}]})}}var bP=(function(t){return t.TooNew="TOO_NEW",t})({});class _P extends Error{constructor(e){var n="Crypto store is invalid because ".concat(e,", ")+"please stop the client, delete all data and start the client again";super(n),this.reason=e,this.name="InvalidCryptoStoreError"}}L(_P,"TOO_NEW",bP.TooNew);class r1e extends Error{constructor(e,n){super(e),this.value=n}}class i1e extends Error{constructor(){super("MatrixClient has been stopped")}}class Wo extends Error{constructor(e,n){super(e),this.clientEndpoint=n,this.name="UnsupportedDelayedEventsEndpointError"}}class VA extends Error{constructor(e,n){super(e),this.clientEndpoint=n,this.name="UnsupportedStickyEventsEndpointError"}}var gl=(function(t){return t.StatusChanged="StatusChanged",t.ProbablyLeft="ProbablyLeft",t.DelayIdChanged="DelayIdChanged",t})({}),kT=t=>t.type==="livekit"&&"livekit_service_url"in t;function wB(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function Ug(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?wB(Object(n),!0).forEach(function(r){L(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):wB(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}var KA=3600*1e3,dt=(function(t){return t.SendDelayedEvent="SendDelayedEvent",t.SendJoinEvent="SendJoinEvent",t.RestartDelayedEvent="RestartDelayedEvent",t.UpdateExpiry="UpdateExpiry",t.SendScheduledDelayedLeaveEvent="SendScheduledDelayedLeaveEvent",t.SendLeaveEvent="SendLeaveEvent",t})({});function ka(t,e){return{insert:[{ts:Date.now()+(e??0),type:t}]}}function fx(t,e){return{replace:[{ts:Date.now()+0,type:t}]}}class Ub extends Kn{isActivated(){return this.activated}isJoined(){return this.isActivated()}join(e,n,r){if(this.scheduler.running){this.logger.error("MembershipManager is already running. Ignoring join request.");return}this.fociPreferred=e,this.rtcTransport=n,this.leavePromiseResolvers=void 0,this.activated=!0,this.oldStatus=this.status,this.state=Ub.defaultState,this.scheduler.startWithJoin().catch(i=>{this.logger.error("MembershipManager stopped because: ",i),r?.(i)}).finally(()=>{if(this.activated=!1,this.oldStatus&&this.oldStatus!==this.status&&this.emit(gl.StatusChanged,this.oldStatus,this.status),!this.scheduler.running){var i;(i=this.leavePromiseResolvers)===null||i===void 0||i.resolve(!0),this.leavePromiseResolvers=void 0}})}leave(e){return this.scheduler.running?(this.leavePromiseResolvers||(this.leavePromiseResolvers=Promise.withResolvers(),this.activated=!1,this.scheduler.initiateLeave(),e&&setTimeout(()=>{var n;return(n=this.leavePromiseResolvers)===null||n===void 0?void 0:n.resolve(!1)},e)),this.leavePromiseResolvers.promise):(this.logger.warn("Called MembershipManager.leave() even though the MembershipManager is not running"),Promise.resolve(!0))}onRTCSessionMemberUpdate(e){if(!this.isActivated())return Promise.resolve();if(this._ownMembership=e.find(r=>vE(r,this.userId,this.deviceId)),!this._ownMembership){var n=[dt.SendDelayedEvent,dt.SendJoinEvent];this.logger.warn("Missing own membership: force re-join"),this.state.hasMemberStateEvent=!1,this.scheduler.actions.some(r=>n.includes(r.type))?this.logger.error("tried adding another `SendDelayedEvent` actions even though we already have one in the Queue\nActionQueueOnMemberUpdate:",this.scheduler.actions):this.scheduler.initiateJoin()}return Promise.resolve()}updateCallIntent(e){var n=this;return B(function*(){if(!n.activated||!n.ownMembership)throw Error("You cannot update your intent before joining the call");n.ownMembership.callIntent!==e&&(n.callIntent=e,yield n.sendJoinEvent())})()}constructor(e,n,r,i,s){super(),this.joinConfig=e,this.room=n,this.client=r,this.slotDescription=i,L(this,"activated",!1),L(this,"logger",void 0),L(this,"callIntent",void 0),L(this,"leavePromiseResolvers",void 0),L(this,"_ownMembership",void 0),L(this,"oldStatus",void 0),L(this,"scheduler",void 0),L(this,"state",void 0),L(this,"deviceId",void 0),L(this,"userId",void 0),L(this,"stateKey",void 0),L(this,"rtcTransport",void 0),L(this,"fociPreferred",void 0),L(this,"delayedLeaveEventDelayMsOverride",void 0),L(this,"clientSendDelayedDisconnectMembership",()=>this.client._unstable_sendDelayedStateEvent(this.room.roomId,{delay:this.delayedLeaveEventDelayMs},Z.GroupCallMemberPrefix,{},this.stateKey)),L(this,"clientSendMembership",c=>this.client.sendStateEvent(this.room.roomId,Z.GroupCallMemberPrefix,c,this.stateKey)),this.logger=(s??N).getChild("[MembershipManager]");var[o,a]=[this.client.getUserId(),this.client.getDeviceId()];if(o===null)throw Error("Missing userId in client");if(a===null)throw Error("Missing deviceId in client");this.deviceId=a,this.userId=o,this.stateKey=this.makeMembershipStateKey(o,a),this.state=Ub.defaultState,this.callIntent=e?.callIntent,this.scheduler=new n1e(c=>(this.oldStatus&&(this.logger.debug("MembershipManager applied action changes. Status: ".concat(this.oldStatus," -> ").concat(this.status)),this.oldStatus!==this.status&&this.emit(gl.StatusChanged,this.oldStatus,this.status)),this.oldStatus=this.status,this.logger.debug("MembershipManager before processing action. status=".concat(this.oldStatus)),this.membershipLoopHandler(c)),this.logger)}get ownMembership(){return this._ownMembership}static get defaultState(){return{hasMemberStateEvent:!1,delayId:void 0,startTime:0,rateLimitRetries:new Map,networkErrorRetries:new Map,expireUpdateIterations:1,probablyLeft:!1}}get networkErrorRetryMs(){var e,n;return(e=(n=this.joinConfig)===null||n===void 0?void 0:n.networkErrorRetryMs)!==null&&e!==void 0?e:3e3}get membershipEventExpiryMs(){var e,n;return(e=(n=this.joinConfig)===null||n===void 0?void 0:n.membershipEventExpiryMs)!==null&&e!==void 0?e:GX}get membershipEventExpiryHeadroomMs(){var e,n;return(e=(n=this.joinConfig)===null||n===void 0?void 0:n.membershipEventExpiryHeadroomMs)!==null&&e!==void 0?e:5e3}computeNextExpiryActionTs(e){return this.state.startTime+Math.min(this.membershipEventExpiryMs,KA)*e-this.membershipEventExpiryHeadroomMs}get delayedLeaveEventDelayMs(){var e,n,r;return(e=(n=this.delayedLeaveEventDelayMsOverride)!==null&&n!==void 0?n:(r=this.joinConfig)===null||r===void 0?void 0:r.delayedLeaveEventDelayMs)!==null&&e!==void 0?e:8e3}get delayedLeaveEventRestartMs(){var e,n;return(e=(n=this.joinConfig)===null||n===void 0?void 0:n.delayedLeaveEventRestartMs)!==null&&e!==void 0?e:5e3}get maximumRateLimitRetryCount(){var e,n;return(e=(n=this.joinConfig)===null||n===void 0?void 0:n.maximumRateLimitRetryCount)!==null&&e!==void 0?e:10}get maximumNetworkErrorRetryCount(){var e,n;return(e=(n=this.joinConfig)===null||n===void 0?void 0:n.maximumNetworkErrorRetryCount)!==null&&e!==void 0?e:10}get delayedLeaveEventRestartLocalTimeoutMs(){var e,n;return(e=(n=this.joinConfig)===null||n===void 0?void 0:n.delayedLeaveEventRestartLocalTimeoutMs)!==null&&e!==void 0?e:2e3}membershipLoopHandler(e){var n=this;return B(function*(){switch(e){case dt.SendDelayedEvent:return n.state.delayId?n.cancelKnownDelayIdBeforeSendDelayedEvent(n.state.delayId):n.sendOrResendDelayedLeaveEvent();case dt.RestartDelayedEvent:return n.state.delayId?n.restartDelayedEvent(n.state.delayId):ka(dt.SendDelayedEvent);case dt.SendScheduledDelayedLeaveEvent:return n.state.hasMemberStateEvent?n.state.delayId?n.sendScheduledDelayedLeaveEventOrFallbackToSendLeaveEvent(n.state.delayId):ka(dt.SendLeaveEvent):{replace:[]};case dt.SendJoinEvent:return n.sendJoinEvent();case dt.UpdateExpiry:return n.updateExpiryOnJoinedEvent();case dt.SendLeaveEvent:return n.state.hasMemberStateEvent?n.sendFallbackLeaveEvent():{replace:[]}}})()}sendOrResendDelayedLeaveEvent(){var e=this;return B(function*(){return yield e.clientSendDelayedDisconnectMembership().then(n=>(e.state.expectedServerDelayLeaveTs=Date.now()+e.delayedLeaveEventDelayMs,e.setAndEmitProbablyLeft(!1),e.resetRateLimitCounter(dt.SendDelayedEvent),e.setAndEmitDelayId(n.delay_id),e.state.hasMemberStateEvent?ka(dt.RestartDelayedEvent,e.delayedLeaveEventRestartMs):ka(dt.SendJoinEvent))).catch(n=>{var r=dt.SendDelayedEvent;if(e.manageMaxDelayExceededSituation(n))return ka(r);var i=e.actionUpdateFromErrors(n,r,"_unstable_sendDelayedStateEvent");if(i)return i;if(e.state.hasMemberStateEvent){if(e.isUnsupportedDelayedEndpoint(n))return{};throw Error("Could not send delayed event, even though delayed events are supported. "+n)}else return e.isUnsupportedDelayedEndpoint(n)?e.logger.info("Not using delayed event because the endpoint is not supported"):e.logger.info("Not using delayed event because: "+n),ka(dt.SendJoinEvent)})})()}cancelKnownDelayIdBeforeSendDelayedEvent(e){var n=this;return B(function*(){return yield n.client._unstable_cancelScheduledDelayedEvent(e).then(()=>(n.setAndEmitDelayId(void 0),n.resetRateLimitCounter(dt.SendDelayedEvent),fx(dt.SendDelayedEvent))).catch(r=>{var i=dt.SendDelayedEvent,s=n.actionUpdateFromErrors(r,i,"cancelScheduledDelayedEvent");if(s)return s;if(n.isNotFoundError(r))return n.setAndEmitDelayId(void 0),fx(i);if(n.isUnsupportedDelayedEndpoint(r))return fx(dt.SendJoinEvent);throw Error("We failed to cancel a delayed event where we already had a delay id with an error we cannot automatically handle")})})()}setAndEmitProbablyLeft(e){this.state.probablyLeft!==e&&(this.state.probablyLeft=e,this.emit(gl.ProbablyLeft,this.state.probablyLeft))}setAndEmitDelayId(e){this.state.delayId!==e&&(this.state.delayId=e,this.emit(gl.DelayIdChanged,this.state.delayId))}restartDelayedEvent(e){var n=this;return B(function*(){var r=n.state.expectedServerDelayLeaveTs?n.state.expectedServerDelayLeaveTs-Date.now():void 0,i=new Promise((s,o)=>{setTimeout(()=>{o(new MJ("Restart delayed event timed out before the HS responded"))},r!==void 0&&!n.state.probablyLeft?Math.min(n.delayedLeaveEventRestartLocalTimeoutMs,r):n.delayedLeaveEventRestartLocalTimeoutMs)});return yield Promise.race([n.client._unstable_restartScheduledDelayedEvent(e),i]).then(()=>(n.state.expectedServerDelayLeaveTs=Date.now()+n.delayedLeaveEventDelayMs,n.resetRateLimitCounter(dt.RestartDelayedEvent),n.setAndEmitProbablyLeft(!1),ka(dt.RestartDelayedEvent,n.delayedLeaveEventRestartMs))).catch(s=>{n.state.expectedServerDelayLeaveTs&&n.state.expectedServerDelayLeaveTs<=Date.now()&&n.setAndEmitProbablyLeft(!0);var o=dt.RestartDelayedEvent;if(n.isNotFoundError(s))return n.setAndEmitDelayId(void 0),ka(dt.SendDelayedEvent);if(n.isUnsupportedDelayedEndpoint(s))return{};var a=n.actionUpdateFromErrors(s,o,"restartScheduledDelayedEvent");if(a)return a;throw Error("Could not restart delayed event, even though delayed events are supported. "+s)})})()}sendScheduledDelayedLeaveEventOrFallbackToSendLeaveEvent(e){var n=this;return B(function*(){return yield n.client._unstable_sendScheduledDelayedEvent(e).then(()=>(n.state.hasMemberStateEvent=!1,n.setAndEmitDelayId(void 0),n.resetRateLimitCounter(dt.SendScheduledDelayedLeaveEvent),{replace:[]})).catch(r=>{var i=dt.SendLeaveEvent;if(n.isUnsupportedDelayedEndpoint(r))return{};if(n.isNotFoundError(r))return n.setAndEmitDelayId(void 0),ka(i);var s=n.actionUpdateFromErrors(r,i,"sendScheduledDelayedEvent");return s||(n.logger.warn("Encountered unexpected error during SendScheduledDelayedLeaveEvent. Falling back to SendLeaveEvent",r),ka(i))})})()}sendJoinEvent(){var e=this;return B(function*(){return yield e.clientSendMembership(e.makeMyMembership(e.membershipEventExpiryMs)).then(()=>{e.setAndEmitProbablyLeft(!1),e.state.startTime=Date.now(),e.state.expireUpdateIterations=1,e.state.hasMemberStateEvent=!0,e.resetRateLimitCounter(dt.SendJoinEvent);var n=e.scheduler.actions.filter(r=>r.type!==dt.UpdateExpiry&&r.type!==dt.SendJoinEvent);return{replace:[...n,{ts:Date.now(),type:dt.RestartDelayedEvent},{ts:e.computeNextExpiryActionTs(e.state.expireUpdateIterations),type:dt.UpdateExpiry}]}}).catch(n=>{var r=e.actionUpdateFromErrors(n,dt.SendJoinEvent,"sendStateEvent");if(r)return r;throw n})})()}updateExpiryOnJoinedEvent(){var e=this;return B(function*(){var n=e.state.expireUpdateIterations+1;return yield e.clientSendMembership(e.makeMyMembership(e.membershipEventExpiryMs*n)).then(()=>(e.resetRateLimitCounter(dt.UpdateExpiry),e.state.expireUpdateIterations=n,{insert:[{ts:e.computeNextExpiryActionTs(n),type:dt.UpdateExpiry}]})).catch(r=>{var i=e.actionUpdateFromErrors(r,dt.UpdateExpiry,"sendStateEvent");if(i)return i;throw r})})()}sendFallbackLeaveEvent(){var e=this;return B(function*(){return yield e.clientSendMembership({}).then(()=>(e.resetRateLimitCounter(dt.SendLeaveEvent),e.state.hasMemberStateEvent=!1,{replace:[]})).catch(n=>{var r=e.actionUpdateFromErrors(n,dt.SendLeaveEvent,"sendStateEvent");if(r)return r;throw n})})()}makeMembershipStateKey(e,n){var r=this.slotDescription.application,i=r==="m.call"&&this.slotDescription.id==="ROOM",s=i?"":this.slotDescription.id,o="".concat(e,"_").concat(n,"_").concat(r).concat(s);return/^org\.matrix\.msc(3757|3779)\b/.exec(this.room.getVersion())?o:"_".concat(o)}makeMyMembership(e){var n,r,i=this.ownMembership,s=this.slotDescription.application==="m.call"&&this.slotDescription.id==="ROOM",o=this.rtcTransport===void 0?{focus_active:{type:"livekit",focus_selection:"oldest_membership"},foci_preferred:(n=this.fociPreferred)!==null&&n!==void 0?n:[]}:{focus_active:{type:"livekit",focus_selection:"multi_sfu"},foci_preferred:[this.rtcTransport,...(r=this.fociPreferred)!==null&&r!==void 0?r:[]]};return Ug(Ug({application:this.slotDescription.application,call_id:s?"":this.slotDescription.id,scope:"m.room",device_id:this.deviceId,membershipID:"".concat(this.userId,":").concat(this.deviceId),expires:e,"m.call.intent":this.callIntent},o),i!==void 0?{created_ts:i.createdTs()}:void 0)}isNotFoundError(e){return e instanceof In&&e.errcode==="M_NOT_FOUND"}manageMaxDelayExceededSituation(e){if(e instanceof In&&e.errcode==="M_UNKNOWN"&&e.data["org.matrix.msc4140.errcode"]==="M_MAX_DELAY_EXCEEDED"){var n=e.data["org.matrix.msc4140.max_delay"];return typeof n=="number"&&this.delayedLeaveEventDelayMs>n&&(this.delayedLeaveEventDelayMsOverride=n),this.logger.warn("Retry sending delayed disconnection event due to server timeout limitations:",e),!0}return!1}actionUpdateFromErrors(e,n,r){var i=this.actionUpdateFromRateLimitError(e,r,n);if(i)return i;var s=this.actionUpdateFromNetworkErrorRetry(e,n);if(s)return s}actionUpdateFromRateLimitError(e,n,r){var i;if((e instanceof Ip||e instanceof In)&&e.isRateLimitError()){var s=(i=this.state.rateLimitRetries.get(r))!==null&&i!==void 0?i:0;if(s<this.maximumRateLimitRetryCount){var o,a=5e3;try{var c;o=(c=e.getRetryAfterMs())!==null&&c!==void 0?c:a,this.logger.info("Rate limited by server, retrying in ".concat(o,"ms"))}catch(l){this.logger.warn("Error while retrieving a rate-limit retry delay, retrying after default delay of ".concat(a),l),o=a}return this.state.rateLimitRetries.set(r,s+1),ka(r,o)}throw Error("Exceeded maximum retries for "+r+" attempts (client."+n+")",{cause:e})}}actionUpdateFromNetworkErrorRetry(e,n){var r,i=(r=this.state.networkErrorRetries.get(n))!==null&&r!==void 0?r:0,s=this.networkErrorRetryMs/1e3+"s",o="("+i+"/"+this.maximumNetworkErrorRetryCount+")",a=this.networkErrorRetryMs;if(e instanceof Error&&e.name==="AbortError")a=0,this.logger.warn("Network local timeout error while sending event, immediate retry ("+o+")",e);else if(e instanceof Error&&e.message.includes("updating delayed event"))this.logger.warn("delayed event update timeout error, retrying in "+s+" "+o,e);else if(e instanceof Xp)this.logger.warn("Network connection error while sending event, retrying in "+s+" "+o,e);else if((e instanceof Ip||e instanceof In)&&typeof e.httpStatus=="number"&&e.httpStatus>=500&&e.httpStatus<600)this.logger.warn("Server error while sending event, retrying in "+s+" "+o,e);else return;if(i<this.maximumNetworkErrorRetryCount)return this.state.networkErrorRetries.set(n,i+1),ka(n,a);throw Error("Reached maximum ("+this.maximumNetworkErrorRetryCount+") retries cause by: "+e)}isUnsupportedDelayedEndpoint(e){return e instanceof Wo}resetRateLimitCounter(e){this.state.rateLimitRetries.set(e,0),this.state.networkErrorRetries.set(e,0)}get status(){var e=this.scheduler.actions;if(e.length===1){var{type:n}=e[0];switch(n){case dt.SendDelayedEvent:case dt.SendJoinEvent:return Sc.Connecting;case dt.UpdateExpiry:return Sc.Connected;case dt.SendScheduledDelayedLeaveEvent:case dt.SendLeaveEvent:return Sc.Disconnecting}}else if(e.length===2){var r=e.map(s=>s.type);if((r.includes(dt.RestartDelayedEvent)||r.includes(dt.SendDelayedEvent)&&this.state.hasMemberStateEvent)&&r.includes(dt.UpdateExpiry))return Sc.Connected}else if(e.length===3){var i=e.map(s=>s.type);if(i.filter(s=>s===dt.RestartDelayedEvent).length===2&&i.includes(dt.UpdateExpiry))return Sc.Connected}return this.scheduler.running?(this.logger.error("MembershipManager has an unknown state. Actions: ",e),Sc.Unknown):Sc.Disconnected}get probablyLeft(){return this.state.probablyLeft}get delayId(){return this.state.delayId}}class IT extends Ub{constructor(e,n,r,i,s,o){super(e,n,r,i,o),this.clientWithSticky=r,this.memberId=s,L(this,"clientSendDelayedDisconnectMembership",()=>this.clientWithSticky._unstable_sendStickyDelayedEvent(this.room.roomId,KA,{delay:this.delayedLeaveEventDelayMs},null,Z.RTCMembership,{msc4354_sticky_key:this.memberId})),L(this,"clientSendMembership",a=>this.clientWithSticky._unstable_sendStickyEvent(this.room.roomId,KA,null,Z.RTCMembership,Ug(Ug({},a),{},{msc4354_sticky_key:this.memberId})))}actionUpdateFromErrors(e,n,r){var i;return super.actionUpdateFromErrors(e,n,(i=IT.nameMap.get(r))!==null&&i!==void 0?i:"unknown")}makeMyMembership(e){var n=this.ownMembership,r=kT(this.rtcTransport)?this.rtcTransport:void 0,i=n!=null&&n.eventId?{"m.relation":{rel_type:bn.Reference,event_id:n?.eventId}}:{};return Ug({application:Ug({type:this.slotDescription.application},this.callIntent?{"m.call.intent":this.callIntent}:{}),slot_id:jb(this.slotDescription),rtc_transports:r?[{type:r.type,livekit_service_url:r.livekit_service_url}]:[],member:{device_id:this.deviceId,user_id:this.userId,id:this.memberId},versions:[]},i)}}L(IT,"nameMap",new Map([["sendStateEvent","_unstable_sendStickyEvent"],["sendDelayedStateEvent","_unstable_sendStickyDelayedEvent"]]));var Cv=(function(t){return t.ReceivedKeys="received_keys",t.NotSupportedError="not_supported_error",t})({});function cf(t){return"".concat(t.userId,":").concat(t.deviceId,"(").concat(t.memberId,")")}class s1e{get updateEncryptionKeyThrottle(){var e,n;return(e=(n=this.joinConfig)===null||n===void 0?void 0:n.updateEncryptionKeyThrottle)!==null&&e!==void 0?e:3e3}get makeKeyDelay(){var e,n;return(e=(n=this.joinConfig)===null||n===void 0?void 0:n.makeKeyDelay)!==null&&e!==void 0?e:3e3}get useKeyDelay(){var e,n;return(e=(n=this.joinConfig)===null||n===void 0?void 0:n.useKeyDelay)!==null&&e!==void 0?e:5e3}constructor(e,n,r,i,s,o){var a=this;this.membership=e,this.getMemberships=n,this.transport=r,this.statistics=i,this.onEncryptionKeysChanged=s,L(this,"manageMediaKeys",!1),L(this,"keysEventUpdateTimeout",void 0),L(this,"makeNewKeyTimeout",void 0),L(this,"setNewKeyTimeouts",new Set),L(this,"encryptionKeys",new Map),L(this,"lastEncryptionKeyUpdateRequest",void 0),L(this,"lastMembershipFingerprints",void 0),L(this,"latestGeneratedKeyIndex",-1),L(this,"joinConfig",void 0),L(this,"logger",void 0),L(this,"joined",!1),L(this,"sendEncryptionKeysEvent",(function(){var c=B(function*(l){if(a.keysEventUpdateTimeout!==void 0&&(clearTimeout(a.keysEventUpdateTimeout),a.keysEventUpdateTimeout=void 0),a.lastEncryptionKeyUpdateRequest=Date.now(),!!a.joined){var d=a.getKeysForParticipant(a.membership);if(!d){a.logger.warn("Tried to send encryption keys event but no keys found!");return}if(typeof l!="number"&&a.latestGeneratedKeyIndex===-1){a.logger.warn("Tried to send encryption keys event but no current key index found!");return}var h=l??a.latestGeneratedKeyIndex;a.logger.info("Try sending encryption keys event. keyIndexToSend=".concat(h," (method parameter: ").concat(l,")"));var m=d[h];try{a.statistics.counters.roomEventEncryptionKeysSent+=1;var g=a.getMemberships().filter(v=>v.sender!=null).map(v=>({userId:v.sender,deviceId:v.deviceId,membershipTs:v.createdTs()}));yield a.transport.sendKey(fP(m),h,g),a.logger.debug("sendEncryptionKeysEvent participantId=".concat(a.membership.userId,":").concat(a.membership.deviceId," numKeys=").concat(d.length," currentKeyIndex=").concat(a.latestGeneratedKeyIndex," keyIndexToSend=").concat(h))}catch(v){if(a.keysEventUpdateTimeout===void 0){var y=sP(v,5e3);a.logger.warn("Failed to send m.call.encryption_key, retrying in ".concat(y),v),a.keysEventUpdateTimeout=setTimeout(()=>{a.sendEncryptionKeysEvent()},y)}else a.logger.info("Not scheduling key resend as another re-send is already pending")}}});return function(l){return c.apply(this,arguments)}})()),L(this,"onNewKeyReceived",(c,l,d,h)=>{this.logger.debug("Received key over key transport ".concat(c.userId,":").concat(c.deviceId," at index ").concat(d)),this.setEncryptionKey(c,d,l,h)}),L(this,"onRotateKeyTimeout",()=>{if(this.manageMediaKeys){this.makeNewKeyTimeout=void 0,this.logger.info("Making new sender key for key rotation");var c=this.makeNewSenderKey(!0);this.sendEncryptionKeysEvent(c)}}),this.logger=(o??N).getChild("[EncryptionManager]")}rtcBackendIdentityFromMembershipParts(e){return"".concat(e.userId,":").concat(e.deviceId)}getEncryptionKeys(){var e=new Map;for(var[n,r]of this.encryptionKeys){var i=r.map((s,o)=>({key:s.key,membership:s.membership,keyIndex:o,rtcBackendIdentity:this.rtcBackendIdentityFromMembershipParts(s.membership)}));e.set(n,i)}return e}join(e){var n,r,i;this.joinConfig=e,this.joined=!0,this.manageMediaKeys=(n=(r=this.joinConfig)===null||r===void 0?void 0:r.manageMediaKeys)!==null&&n!==void 0?n:this.manageMediaKeys,this.transport.on(Cv.ReceivedKeys,this.onNewKeyReceived),this.transport.start(),(i=this.joinConfig)!==null&&i!==void 0&&i.manageMediaKeys&&(this.makeNewSenderKey(),this.requestSendCurrentKey())}leave(){this.encryptionKeys.set(cf(this.membership),[]),this.transport.off(Cv.ReceivedKeys,this.onNewKeyReceived),this.transport.stop(),this.makeNewKeyTimeout!==void 0&&(clearTimeout(this.makeNewKeyTimeout),this.makeNewKeyTimeout=void 0);for(var e of this.setNewKeyTimeouts)clearTimeout(e);this.setNewKeyTimeouts.clear(),this.manageMediaKeys=!1,this.joined=!1}onMembershipsUpdate(e){if(this.manageMediaKeys&&this.joined){var n=new Set(e.filter(l=>!vE(l,this.membership.userId,this.membership.deviceId)).map(cf)),r=new Set(this.getMemberships().filter(l=>!vE(l,this.membership.userId,this.membership.deviceId)).map(cf)),i=Array.from(n).some(l=>!r.has(l)),s=Array.from(r).some(l=>!n.has(l)),o=this.lastMembershipFingerprints;if(this.storeLastMembershipFingerprints(),i)this.makeNewKeyTimeout||(this.logger.debug("Member(s) have left: queueing sender key rotation"),this.makeNewKeyTimeout=setTimeout(this.onRotateKeyTimeout,this.makeKeyDelay));else if(s)this.logger.debug("New member(s) have joined: re-sending keys"),this.requestSendCurrentKey();else if(o){var a=this.lastMembershipFingerprints,c=Array.from(o).some(l=>!a.has(l))||Array.from(a).some(l=>!o.has(l));c&&(this.logger.debug("Member(s) have updated/reconnected: re-sending keys to everyone"),this.requestSendCurrentKey())}}}makeNewSenderKey(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,n=DX(16),r=this.getNewEncryptionKeyIndex();return this.logger.info("Generated new key at index "+r),this.setEncryptionKey(this.membership,r,n,Date.now(),e),r}requestSendCurrentKey(){if(this.manageMediaKeys){if(this.lastEncryptionKeyUpdateRequest&&this.lastEncryptionKeyUpdateRequest+this.updateEncryptionKeyThrottle>Date.now()){this.logger.info("Last encryption key event sent too recently: postponing"),this.keysEventUpdateTimeout===void 0&&(this.keysEventUpdateTimeout=setTimeout(()=>{this.sendEncryptionKeysEvent()},this.updateEncryptionKeyThrottle));return}this.sendEncryptionKeysEvent()}}getKeysForParticipant(e){var n;return(n=this.encryptionKeys.get(cf(e)))===null||n===void 0?void 0:n.map(r=>r.key)}storeLastMembershipFingerprints(){this.lastMembershipFingerprints=new Set(this.getMemberships().filter(e=>!vE(e,this.membership.userId,this.membership.deviceId)).map(e=>"".concat(cf(e),":").concat(e.createdTs())))}getNewEncryptionKeyIndex(){return this.latestGeneratedKeyIndex===-1?0:(this.latestGeneratedKeyIndex+1)%256}setEncryptionKey(e,n,r,i){var s=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!1;this.logger.debug("Setting encryption key for ".concat(e.userId,":").concat(e.deviceId," at index ").concat(n));var o=fp(r),a=cf(e);this.encryptionKeys.has(a)||this.encryptionKeys.set(a,[]);var c=this.encryptionKeys.get(a),l=c[n];if(l){if(l.timestamp>i){this.logger.info("Ignoring new key at index ".concat(n," for ").concat(a," as it is older than existing known key"));return}if(o1e(l.key,o)){l.timestamp=i;return}}if(e.userId===this.membership.userId&&e.deviceId===this.membership.deviceId&&(this.latestGeneratedKeyIndex=n),c[n]={key:o,timestamp:i,membership:e},s){var d=setTimeout(()=>{this.setNewKeyTimeouts.delete(d),this.logger.info("Delayed-emitting key changed event for ".concat(a," index ").concat(n)),this.onEncryptionKeysChanged(o,n,e,this.rtcBackendIdentityFromMembershipParts(e))},this.useKeyDelay);this.setNewKeyTimeouts.add(d)}else this.onEncryptionKeysChanged(o,n,e,this.rtcBackendIdentityFromMembershipParts(e))}}function o1e(t,e){return t===e?!0:!!t&&!!e&&t.length===e.length&&t.every((n,r)=>n===e[r])}class a1e{constructor(){L(this,"tsBuffer",new Map)}isOutdated(e,n){var r,i=cf(e);this.tsBuffer.has(i)||this.tsBuffer.set(i,new Map);var s=(r=this.tsBuffer.get(i))===null||r===void 0?void 0:r.get(n.keyIndex);return s&&s>n.creationTS?!0:(this.tsBuffer.get(i).set(n.keyIndex,n.creationTS),!1)}}class c1e{constructor(e,n,r,i,s,o,a){this.ownMembership=e,this.getMemberships=n,this.transport=r,this.statistics=i,this.onEncryptionKeysChanged=s,L(this,"manageMediaKeys",!1),L(this,"useHashedRtcBackendIdentity",!1),L(this,"ownRtcBackendIdentityCache",void 0),L(this,"participantKeyRings",new Map),L(this,"outboundSession",null),L(this,"currentKeyDistributionPromise",null),L(this,"useKeyDelay",5e3),L(this,"keyRotationGracePeriodMs",1e4),L(this,"needToEnsureKeyAgain",!1),L(this,"keyBuffer",new a1e),L(this,"logger",void 0),L(this,"rtcIdentityProvider",void 0),L(this,"keysWithoutMatchingRTCMembership",[]),L(this,"onNewKeyReceived",(c,l,d,h)=>{var m;if(!this.manageMediaKeys){var g;(g=this.logger)===null||g===void 0||g.warn("Received key over transport ".concat(c.userId,":").concat(c.deviceId," at index ").concat(d," but media keys are disabled"));return}(m=this.logger)===null||m===void 0||m.debug("Received key over transport ".concat(c.userId,":").concat(c.deviceId," at index ").concat(d));var y=fp(l),v={key:y,membership:c,keyIndex:d,creationTS:h},E=this.keyBuffer.isOutdated(c,v);if(!E)this.addKeyToParticipant(v.key,v.keyIndex,v.membership),this.statistics.counters.roomEventEncryptionKeysReceived+=1;else{var w;(w=this.logger)===null||w===void 0||w.info("Received an out of order key for ".concat(c.userId,":").concat(c.deviceId,", dropping it"))}}),this.logger=o?.getChild("[EncryptionManager]"),this.rtcIdentityProvider=a??If.computeRtcIdentityRaw}getOwnRtcBackendIdentity(){var e=this;return B(function*(){if(e.ownRtcBackendIdentityCache)return e.ownRtcBackendIdentityCache;if(e.useHashedRtcBackendIdentity){var n,{userId:r,deviceId:i,memberId:s}=e.ownMembership;(n=e.logger)===null||n===void 0||n.info("Computing RTC backend identity for ".concat(r,":").concat(i,":").concat(s," (SHOULD ONLY BE CALLED ONCE)")),e.ownRtcBackendIdentityCache=yield e.rtcIdentityProvider(r,i,s)}else e.ownRtcBackendIdentityCache="".concat(e.ownMembership.userId,":").concat(e.ownMembership.deviceId);return e.ownRtcBackendIdentityCache})()}getEncryptionKeys(){return new Map(this.participantKeyRings)}checkKeysWithoutMatchingRTCMembership(){var e=this.keysWithoutMatchingRTCMembership;this.keysWithoutMatchingRTCMembership=[],e.forEach(n=>{this.addKeyToParticipant(n.key,n.keyIndex,n.membership)})}addKeyToParticipant(e,n,r){var i=this.getMemberships(),s=i.find(a=>a.userId===r.userId&&a.deviceId===r.deviceId);if(!s){var o;(o=this.logger)===null||o===void 0||o.info("No matching RTC membership for key from ".concat(r.userId,":").concat(r.deviceId,", delaying key addition")),this.keysWithoutMatchingRTCMembership.push({key:e,keyIndex:n,membership:r});return}this.addKeyToParticipantWithBackendIdentity(e,n,r,s.rtcBackendIdentity)}addKeyToParticipantWithBackendIdentity(e,n,r,i){var s=cf(r);this.participantKeyRings.has(s)||this.participantKeyRings.set(s,[]),this.participantKeyRings.get(s).push({key:e,keyIndex:n,membership:r,rtcBackendIdentity:i}),this.onEncryptionKeysChanged(e,n,r,i)}join(e){var n,r,i,s,o;this.manageMediaKeys=(n=e?.manageMediaKeys)!==null&&n!==void 0?n:!0,this.useHashedRtcBackendIdentity=(r=e?.unstableSendStickyEvents)!==null&&r!==void 0?r:!1,this.useKeyDelay=(i=e?.useKeyDelay)!==null&&i!==void 0?i:1e3,this.keyRotationGracePeriodMs=(s=e?.keyRotationGracePeriodMs)!==null&&s!==void 0?s:1e4,this.transport.on(Cv.ReceivedKeys,this.onNewKeyReceived),this.getOwnRtcBackendIdentity(),(o=this.logger)===null||o===void 0||o.info("Joining room"),this.transport.start()}leave(){this.transport.off(Cv.ReceivedKeys,this.onNewKeyReceived),this.transport.stop(),this.participantKeyRings.clear()}ensureKeyDistribution(){if(this.manageMediaKeys)if(this.currentKeyDistributionPromise==null){var e;(e=this.logger)===null||e===void 0||e.debug("No active rollout, start a new one"),this.currentKeyDistributionPromise=this.rolloutOutboundKey().then(()=>{var r;if((r=this.logger)===null||r===void 0||r.debug("Rollout completed"),this.currentKeyDistributionPromise=null,this.needToEnsureKeyAgain){var i;(i=this.logger)===null||i===void 0||i.debug("New Rollout needed"),this.needToEnsureKeyAgain=!1,this.ensureKeyDistribution()}})}else{var n;(n=this.logger)===null||n===void 0||n.debug("Rollout in progress, a new rollout will be started after the current one"),this.needToEnsureKeyAgain=!0}}onMembershipsUpdate(){var e;(e=this.logger)===null||e===void 0||e.trace("onMembershipsUpdate"),this.ensureKeyDistribution(),this.checkKeysWithoutMatchingRTCMembership()}rolloutOutboundKey(){var e=this;return B(function*(){var n,r,i=e.outboundSession==null;if(i){var s={key:e.generateRandomKey(),creationTS:Date.now(),sharedWith:[],keyId:0};e.outboundSession=s,e.addKeyToParticipantWithBackendIdentity(s.key,s.keyId,e.ownMembership,yield e.getOwnRtcBackendIdentity())}var o=e.getMemberships().filter(O=>O.sender!=null).map(O=>({userId:O.sender,deviceId:O.deviceId,membershipTs:O.createdTs()})),a=(n=(r=e.outboundSession)===null||r===void 0?void 0:r.sharedWith)!==null&&n!==void 0?n:[];a=a.filter(O=>!o.some(P=>O.userId==P.userId&&O.deviceId==P.deviceId&&O.membershipTs!=P.membershipTs));var c=a.filter(O=>!o.some(P=>O.userId==P.userId&&O.deviceId==P.deviceId&&O.membershipTs==P.membershipTs)),l=o.filter(O=>!a.some(P=>O.userId==P.userId&&O.deviceId==P.deviceId&&O.membershipTs==P.membershipTs)),d=[],h,m=!1;if(c.length>0){var g=e.createNewOutboundSession();m=!0,d=o,h=g}else if(l.length>0){var y=Date.now(),v=y-e.outboundSession.creationTS;if(v<e.keyRotationGracePeriodMs){var E;(E=e.logger)===null||E===void 0||E.debug("New joiners detected, but the key is recent enough (age:".concat(v,"), keeping it")),d=l,h=e.outboundSession}else{var w;(w=e.logger)===null||w===void 0||w.debug("New joiners detected, rotating the key");var k=e.createNewOutboundSession();m=!0,d=o,h=k}}else return;try{var x,C;if((x=e.logger)===null||x===void 0||x.trace("Sending key..."),yield e.transport.sendKey(G1(h.key),h.keyId,d),e.statistics.counters.roomEventEncryptionKeysSent+=1,h.sharedWith.push(...d),(C=e.logger)===null||C===void 0||C.trace("key index:".concat(h.keyId," sent to ").concat(h.sharedWith.map(O=>"".concat(O.userId,":").concat(O.deviceId)).join(","))),m){var R,T;(R=e.logger)===null||R===void 0||R.trace("Delay Rollout for key:".concat(h.keyId,"...")),yield Wp(e.useKeyDelay),(T=e.logger)===null||T===void 0||T.trace("...Delayed rollout of index:".concat(h.keyId," ")),e.addKeyToParticipantWithBackendIdentity(h.key,h.keyId,e.ownMembership,yield e.getOwnRtcBackendIdentity())}}catch(O){var M;(M=e.logger)===null||M===void 0||M.error("Failed to rollout key",O)}})()}createNewOutboundSession(){var e,n={key:this.generateRandomKey(),creationTS:Date.now(),sharedWith:[],keyId:this.nextKeyIndex()};return(e=this.logger)===null||e===void 0||e.info("creating new outbound key index:".concat(n.keyId)),this.outboundSession=n,n}nextKeyIndex(){return this.outboundSession?(this.outboundSession.keyId+1)%256:0}generateRandomKey(){var e=new Uint8Array(16);return globalThis.crypto.getRandomValues(e),e}}let l1e=class extends Error{constructor(e){super(e)}get name(){return"NotSupportedError"}};class u1e extends Kn{setParentLogger(e){this.logger=e.getChild("[ToDeviceKeyTransport]")}constructor(e,n,r,i,s){super(),this.membership=e,this.roomId=n,this.client=r,this.statistics=i,L(this,"logger",N),L(this,"onToDeviceEvent",o=>{if(o.getType()===Z.CallEncryptionKeysPrefix){var a=this.getValidEventContent(o);a&&o.getSender()&&this.receiveCallKeyEvent(o.getSender(),a)}}),this.setParentLogger(s??N)}start(){this.client.on(De.ToDeviceEvent,this.onToDeviceEvent)}stop(){this.client.off(De.ToDeviceEvent,this.onToDeviceEvent)}sendKey(e,n,r){var i=this;return B(function*(){var s={keys:{index:n,key:e},room_id:i.roomId,member:{claimed_device_id:i.membership.deviceId,id:i.membership.memberId},session:{call_id:"",application:"m.call",scope:"m.room"},sent_ts:Date.now()},o=r.map(a=>({userId:a.userId,deviceId:a.deviceId})).filter(a=>!(a.userId==i.membership.userId&&a.deviceId==i.membership.deviceId));o.length>0?(yield i.client.encryptAndSendToDevice(Z.CallEncryptionKeysPrefix,o,s).catch(a=>{var c=a.message;if(c.includes("unknown variant")&&c.includes("send_to_device")||c.includes("not supported"))throw new l1e("The widget driver does not support to-device encryption")}),i.statistics.counters.roomEventEncryptionKeysSent+=1):i.logger.warn("No targets found for sending key")})()}receiveCallKeyEvent(e,n){var r;this.statistics.counters.roomEventEncryptionKeysReceived+=1;var i=Date.now(),s=i-(typeof n.sent_ts=="number"?n.sent_ts:i);this.statistics.totals.roomEventEncryptionKeysReceivedTotalAge+=s;var o="".concat(e,":").concat(n.member.claimed_device_id);this.emit(Cv.ReceivedKeys,{userId:e,deviceId:n.member.claimed_device_id,memberId:(r=n.member.id)!==null&&r!==void 0?r:o},n.keys.key,n.keys.index,i)}getValidEventContent(e){var n=e.getContent(),r=n.room_id;if(!r){this.logger.warn("Malformed Event: invalid call encryption keys event, no roomId");return}if(r!==this.roomId){this.logger.warn("Malformed Event: Mismatch roomId");return}if(!n.keys||!n.keys.key||typeof n.keys.index!="number"){this.logger.warn("Malformed Event: Missing keys field");return}if(!n.member||!n.member.claimed_device_id){this.logger.warn("Malformed Event: Missing claimed_device_id");return}return n}}class d1e extends Kn{setParentLogger(e){this.logger=e.getChild("[RoomKeyTransport]")}constructor(e,n,r,i){super(),this.room=e,this.client=n,this.statistics=r,L(this,"logger",N),this.setParentLogger(i??N)}start(){this.room.on(Oe.Timeline,e=>{this.consumeCallEncryptionEvent(e)})}stop(){this.room.off(Oe.Timeline,e=>{this.consumeCallEncryptionEvent(e)})}consumeCallEncryptionEvent(e){var n=arguments,r=this;return B(function*(){var i=n.length>1&&n[1]!==void 0?n[1]:!1;if(yield r.client.decryptEventIfNeeded(e),e.isDecryptionFailure()){i?r.logger.warn("Decryption failed for event ".concat(e.getId(),": ").concat(e.decryptionFailureReason)):(r.logger.warn("Decryption failed for event ".concat(e.getId(),": ").concat(e.decryptionFailureReason," will retry once only")),setTimeout(()=>{r.consumeCallEncryptionEvent(e,!0)},1e3));return}else i&&r.logger.info("Decryption succeeded for event ".concat(e.getId()," after retry"));if(e.getType()!==Z.CallEncryptionKeysPrefix)return Promise.resolve();if(!r.room)return r.logger.error("Got room state event for unknown room ".concat(e.getRoomId(),"!")),Promise.resolve();r.onEncryptionEvent(e)})()}sendKey(e,n,r){var i=this;return B(function*(){var s={keys:[{index:n,key:e}],device_id:i.client.getDeviceId(),call_id:"",sent_ts:Date.now()};try{yield i.client.sendEvent(i.room.roomId,Z.CallEncryptionKeysPrefix,s)}catch(a){i.logger.error("Failed to send call encryption keys",a);var o=a;throw o.event&&i.client.cancelPendingEvent(o.event),a}})()}onEncryptionEvent(e){var n=e.getSender(),r=e.getContent(),i=r.device_id,s=r.call_id;if(!n){this.logger.warn("Received m.call.encryption_keys with no userId: callId=".concat(s));return}if(s!==""){this.logger.warn("Received m.call.encryption_keys with unsupported callId: userId=".concat(n,", deviceId=").concat(i,", callId=").concat(s));return}if(!Array.isArray(r.keys)){this.logger.warn("Received m.call.encryption_keys where keys wasn't an array: callId=".concat(s));return}if(n===this.client.getUserId()&&i===this.client.getDeviceId()){this.logger.info("Ignoring our own keys event");return}this.statistics.counters.roomEventEncryptionKeysReceived+=1;var o=Date.now()-(typeof r.sent_ts=="number"?r.sent_ts:e.getTs());this.statistics.totals.roomEventEncryptionKeysReceivedTotalAge+=o;for(var a of r.keys){if(!a){this.logger.info("Ignoring false-y key in keys event");continue}var c=a.key,l=a.index;!c||l===void 0||l===null||s===void 0||s===null||typeof i!="string"||typeof s!="string"||typeof c!="string"||typeof l!="number"?this.logger.warn("Malformed call encryption_key: userId=".concat(n,", deviceId=").concat(i,", encryptionKeyIndex=").concat(l," callId=").concat(s)):(this.logger.debug("onCallEncryption userId=".concat(n,":").concat(i," encryptionKeyIndex=").concat(l," age=").concat(o,"ms")),this.emit(Cv.ReceivedKeys,{userId:n,deviceId:i,memberId:"".concat(n,":").concat(i)},c,l,e.getTs()))}}}function EB(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function CB(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?EB(Object(n),!0).forEach(function(r){L(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):EB(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}var Zi=(function(t){return t.MembershipsChanged="memberships_changed",t.JoinStateChanged="join_state_changed",t.EncryptionKeyChanged="encryption_key_changed",t.MembershipManagerError="membership_manager_error",t.DidSendCallNotification="did_send_call_notification",t})({});function f1e(t){var[e,n]=t.split("#");return{application:e,id:n}}function jb(t){return"".concat(t.application,"#").concat(t.id)}var h1e={listenForStickyEvents:!0,listenForMemberStateEvents:!0};class Fb extends Kn{get membershipStatus(){var e;return(e=this.membershipManager)===null||e===void 0?void 0:e.status}get probablyLeft(){var e;return(e=this.membershipManager)===null||e===void 0?void 0:e.probablyLeft}get delayId(){var e;return(e=this.membershipManager)===null||e===void 0?void 0:e.delayId}get callId(){var e;return(e=this.slotDescription)===null||e===void 0?void 0:e.id}get slotId(){return jb(this.slotDescription)}static sessionMembershipsForSlot(e,n){var r=arguments;return B(function*(){var i=r.length>2&&r[2]!==void 0?r[2]:h1e,s=N.getChild("[MatrixRTCSession ".concat(e.roomId,"]")),o=v1e(e,i,s),a=yield p1e(e,o,n,s);return a.sort((c,l)=>c.createdTs()-l.createdTs()),a.length>1&&s.debug("Call memberships in room ".concat(e.roomId,", in order: "),a.map(c=>[c.createdTs(),c.userId])),a})()}static sessionForSlot(e,n,r,i){return new Fb(e,n,r,i)}get room(){return this.roomSubset}constructor(e,n,r,i){var s;super(),s=this,this.client=e,this.roomSubset=n,this.slotDescription=r,this.calculateMembershipsOpts=i,L(this,"membershipManager",void 0),L(this,"encryptionManager",void 0),L(this,"joinConfig",void 0),L(this,"logger",void 0),L(this,"pendingNotificationToSend",void 0),L(this,"expiryTimeout",void 0),L(this,"memberships",[]),L(this,"statistics",{counters:{roomEventEncryptionKeysSent:0,roomEventEncryptionKeysReceived:0},totals:{roomEventEncryptionKeysReceivedTotalAge:0}}),L(this,"reEmitter",new ly(this)),L(this,"onRoomMemberUpdate",()=>{this.ensureRecalculateSessionMembers()}),L(this,"onStickyEventUpdate",(o,a,c)=>{[...o,...c,...a.flatMap(l=>[l.current,l.previous])].some(l=>l.getType()===Z.RTCMembership)&&this.ensureRecalculateSessionMembers()}),L(this,"_onRTCSessionMemberUpdate",B(function*(){yield s.recalculateSessionMembers()})),L(this,"recalculateSessionMembersDirty",!1),L(this,"recalculateSessionMembersPromise",void 0),L(this,"recalculateSessionMembers",B(function*(){var o,a=s.memberships;s.memberships=yield Fb.sessionMembershipsForSlot(s.room,jb(s.slotDescription),s.calculateMembershipsOpts);var c=a.length!=s.memberships.length||a.some((g,y)=>!If.equal(g,s.memberships[y]));if(c){var l,d;s.logger.info("Memberships for call in room ".concat(s.roomSubset.roomId," have changed: emitting (").concat(s.memberships.length," members)")),_ve(s.logger,"emit MatrixRTCSessionEvent.MembershipsChanged",()=>{s.emit(Zi.MembershipsChanged,a,s.memberships)}),(l=s.membershipManager)===null||l===void 0||l.onRTCSessionMemberUpdate(s.memberships);var h=(d=s.membershipManager)===null||d===void 0?void 0:d.ownMembership;if(s.pendingNotificationToSend&&h&&a.length===0){var m;h.eventId&&(m=s.joinConfig)!==null&&m!==void 0&&m.notificationType?s.sendCallNotify(h.eventId,s.joinConfig.notificationType,h.callIntent):s.logger.warn("Own membership eventId is undefined, cannot send call notification")}s.memberships.length>0&&(s.pendingNotificationToSend=void 0)}else s.logger.debug("No membership changes detected for room ".concat(s.roomSubset.roomId));(o=s.encryptionManager)===null||o===void 0||o.onMembershipsUpdate(a),s.setExpiryTimer()})),this.logger=N.getChild("[MatrixRTCSession ".concat(n.roomId,"]")),this.roomSubset.on(Ct.Members,this.onRoomMemberUpdate),this.roomSubset.on(pf.Update,this.onStickyEventUpdate),this.ensureRecalculateSessionMembers(),this.setExpiryTimer()}isJoined(){var e,n;return(e=(n=this.membershipManager)===null||n===void 0?void 0:n.isJoined())!==null&&e!==void 0?e:!1}stop(){var e=this;return B(function*(){var n;yield(n=e.membershipManager)===null||n===void 0?void 0:n.leave(1e3),e.expiryTimeout&&(clearTimeout(e.expiryTimeout),e.expiryTimeout=void 0),e.roomSubset.off(Ct.Members,e.onRoomMemberUpdate),e.roomSubset.off(pf.Update,e.onStickyEventUpdate)})()}joinRTCSession(e,n,r,i){var s;if(this.isJoined()){this.logger.info("Already joined to session in room ".concat(this.roomSubset.roomId,": ignoring join call"));return}else{this.membershipManager=i!=null&&i.unstableSendStickyEvents?new IT(i,this.roomSubset,this.client,this.slotDescription,e.memberId,this.logger):new Ub(i,this.roomSubset,this.client,this.slotDescription,this.logger),this.reEmitter.reEmit(this.membershipManager,[gl.ProbablyLeft,gl.StatusChanged,gl.DelayIdChanged]);var o;if(i!=null&&i.useExperimentalToDeviceTransport){this.logger.info("Using experimental to-device transport for encryption keys"),this.logger.info("Using to-device with room fallback transport for encryption keys");var[a,c,l]=[this.roomSubset,this.client,this.statistics],d=new u1e(e,a.roomId,c,l);this.encryptionManager=new c1e(e,()=>this.memberships,d,this.statistics,(h,m,g,y)=>{this.emit(Zi.EncryptionKeyChanged,h,m,g,y)},this.logger)}else o=new d1e(this.roomSubset,this.client,this.statistics),this.encryptionManager=new s1e(e,()=>this.memberships,o,this.statistics,(h,m,g,y)=>{this.emit(Zi.EncryptionKeyChanged,h,m,g,y)})}this.joinConfig=i,this.pendingNotificationToSend=(s=this.joinConfig)===null||s===void 0?void 0:s.notificationType,this.membershipManager.join(n,r,h=>{this.logger.error("MembershipManager encountered an unrecoverable error: ",h),this.emit(Zi.MembershipManagerError,h),this.emit(Zi.JoinStateChanged,this.isJoined())}),this.encryptionManager.join(i),this.emit(Zi.JoinStateChanged,!0)}joinRoomSession(e,n,r){var[i,s]=[this.client.getUserId(),this.client.getDeviceId()],o="".concat(i,":").concat(s);this.joinRTCSession({userId:i,deviceId:s,memberId:o},e,n,r)}leaveRoomSession(){var e=arguments,n=this;return B(function*(){var r=e.length>0&&e[0]!==void 0?e[0]:void 0;if(!n.isJoined())return n.logger.info("Not joined to session in room ".concat(n.roomSubset.roomId,": ignoring leave call")),!1;n.logger.info("Leaving call session in room ".concat(n.roomSubset.roomId)),n.encryptionManager.leave();var i=n.membershipManager.leave(r);return n.emit(Zi.JoinStateChanged,!1),yield i})()}getFocusInUse(){var e=this.getOldestMembership();return e?.getTransport(e)}getActiveFocus(){var e;return(e=this.getOldestMembership())===null||e===void 0?void 0:e.getFocusActive()}getOldestMembership(){return this.memberships[0]}getConsensusCallIntent(){var e,n=(e=this.memberships.find(r=>!!r.callIntent))===null||e===void 0?void 0:e.callIntent;if(n&&this.memberships.every(r=>!r.callIntent||r.callIntent===n))return n}updateCallIntent(e){var n=this;return B(function*(){var r,i,s=(r=n.membershipManager)===null||r===void 0?void 0:r.ownMembership;if(!s)throw Error("Not connected yet");yield(i=n.membershipManager)===null||i===void 0?void 0:i.updateCallIntent(e)})()}reemitEncryptionKeys(){var e;(e=this.encryptionManager)===null||e===void 0||e.getEncryptionKeys().forEach((n,r)=>{n.forEach(i=>{this.emit(Zi.EncryptionKeyChanged,i.key,i.keyIndex,i.membership,i.rtcBackendIdentity)})})}setExpiryTimer(){this.expiryTimeout&&(clearTimeout(this.expiryTimeout),this.expiryTimeout=void 0);var e;for(var n of this.memberships){var r=n.getMsUntilExpiry();r!==void 0&&(e===void 0||r<e)&&(e=r)}e!=null&&(this.expiryTimeout=setTimeout(this.ensureRecalculateSessionMembers.bind(this),e))}sendCallNotify(e,n,r){var i=this,s=(function(){var o=B(function*(){var a={"m.mentions":{user_ids:[],room:!0},notification_type:n,"m.relates_to":{event_id:e,rel_type:bn.Reference},sender_ts:Date.now(),lifetime:3e4};r&&(a["m.call.intent"]=r);var c=yield i.client.sendEvent(i.roomSubset.roomId,Z.RTCNotification,a);return{response:c,content:a}});return function(){return o.apply(this,arguments)}})();s().then(o=>{var a=CB(CB({},o.response),o.content);this.emit(Zi.DidSendCallNotification,a)}).catch(o=>{var[a,c]=o;return this.logger.error("Failed to send call notification",a,c)})}ensureRecalculateSessionMembers(){this.recalculateSessionMembersPromise===void 0?this.recalculateSessionMembersPromise=this.recalculateSessionMembers().then(()=>{this.recalculateSessionMembersPromise=void 0,this.recalculateSessionMembersDirty&&(this.ensureRecalculateSessionMembers(),this.recalculateSessionMembersDirty=!1)}):this.recalculateSessionMembersDirty=!0}}function p1e(t,e,n,r){return GA.apply(this,arguments)}function GA(){return GA=B(function*(t,e,n,r){var i=[];for(var s of e){var o=s.getContent();if(m1e(o,r))try{var a=If.membershipDataFromMatrixEvent(s),c=new If(s,a,yield If.computeRtcBackendIdentity(s,a),r);g1e(c,t,n,r)&&i.push(c)}catch(l){r.warn("Couldn't construct call membership: ",l)}}return i}),GA.apply(this,arguments)}function m1e(t,e){var n=Object.keys(t).filter(r=>r!=="msc4354_sticky_key").length;return n===0?!1:n>1&&"application"in t?!0:(n===1&&"memberships"in t&&e.warn("Legacy event found. Those are ignored, they do not contribute to the MatrixRTC session"),!1)}function g1e(t,e,n,r){var i;return t.slotId!==n?(r.info("Ignoring membership of user ".concat(t.userId," for a different slot: user: ").concat(JSON.stringify(t.slotDescription),", slotId: ").concat(n,")")),!1):t.isExpired()?(r.info("Ignoring expired device membership ".concat(t.userId,"/").concat(t.deviceId)),!1):e.hasMembershipState((i=t.userId)!==null&&i!==void 0?i:"",Ve.Join)?!0:(r.info("Ignoring membership of user ".concat(t.userId," who is not in the room.")),!1)}function v1e(t,e,n){var{listenForStickyEvents:r,listenForMemberStateEvents:i}=e,s=[];if(r&&(s=[...t._unstable_getStickyEvents()].filter(c=>c.getType()===Z.RTCMembership)),i){var o=t.getLiveTimeline().getState(Fe.FORWARDS);if(!o)return n.warn("Couldn't get state for room "+t.roomId+"using empty membership array"),[];var a=o.getStateEvents(Z.GroupCallMemberPrefix);s=s.concat(a.filter(c=>!s.some(l=>l.getContent().msc4354_sticky_key===c.getStateKey())))}return s}var OC=(function(t){return t.SessionStarted="session_started",t.SessionEnded="session_ended",t})({});class y1e extends Kn{constructor(e,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{application:"m.call",id:"ROOM"};super(),this.client=n,this.slotDescription=r,L(this,"roomSessions",new Map),L(this,"logger",void 0),L(this,"onRoom",i=>{this.refreshRoom(i)}),L(this,"onEvent",i=>{if(i.unstableStickyExpiresAt&&i.getType()===Z.RTCMembership){var s=this.client.getRoom(i.getRoomId());s&&this.refreshRoom(s)}}),L(this,"onRoomState",i=>{if(i.getType()===Z.GroupCallMemberPrefix){var s=this.client.getRoom(i.getRoomId());if(!s){this.logger.error("Got room state event for unknown room ".concat(i.getRoomId(),"!"));return}this.refreshRoom(s)}}),this.logger=e.getChild("[MatrixRTCSessionManager]")}start(){for(var e of(n=this.client.getRooms())!==null&&n!==void 0?n:[]){var n,r=Fb.sessionForSlot(this.client,e,this.slotDescription);r.memberships.length>0&&this.roomSessions.set(e.roomId,r)}this.client.on(De.Room,this.onRoom),this.client.on(De.Event,this.onEvent),this.client.on(Ct.Events,this.onRoomState)}stop(){for(var e of this.roomSessions.values())e.stop();this.roomSessions.clear(),this.client.off(De.Room,this.onRoom),this.client.off(De.Event,this.onEvent),this.client.off(Ct.Events,this.onRoomState)}getActiveRoomSession(e){return this.roomSessions.get(e.roomId)}getRoomSession(e){return this.roomSessions.has(e.roomId)||this.roomSessions.set(e.roomId,Fb.sessionForSlot(this.client,e,this.slotDescription)),this.roomSessions.get(e.roomId)}refreshRoom(e){var n=this;return B(function*(){var r=!n.roomSessions.has(e.roomId),i=n.getRoomSession(e),s=i.memberships.length>0&&!r;yield i._onRTCSessionMemberUpdate().catch(a=>{n.logger.error("Error updating RTC session members for ".concat(e.roomId,": ").concat(a))});var o=i.memberships.length>0;s&&!o?(n.logger.trace("Session ended for ".concat(e.roomId," (").concat(i.memberships.length," members)")),n.emit(OC.SessionEnded,e.roomId,n.roomSessions.get(e.roomId))):!s&&o&&(n.logger.trace("Session started for ".concat(e.roomId," (").concat(i.memberships.length," members)")),n.emit(OC.SessionStarted,e.roomId,n.roomSessions.get(e.roomId)))})()}}function hx(t){return e=>{var n,r;return((n=e.content)===null||n===void 0||(n=n["m.relates_to"])===null||n===void 0?void 0:n.event_id)!==t||((r=e.content)===null||r===void 0||(r=r["m.relates_to"])===null||r===void 0?void 0:r.rel_type)===Rn.name}}class L1 extends Error{}L1.prototype.name="InvalidTokenError";function b1e(t){return decodeURIComponent(atob(t).replace(/(.)/g,(e,n)=>{let r=n.charCodeAt(0).toString(16).toUpperCase();return r.length<2&&(r="0"+r),"%"+r}))}function _1e(t){let e=t.replace(/-/g,"+").replace(/_/g,"/");switch(e.length%4){case 0:break;case 2:e+="==";break;case 3:e+="=";break;default:throw new Error("base64 string is not of the correct length")}try{return b1e(e)}catch{return atob(e)}}function zX(t,e){if(typeof t!="string")throw new L1("Invalid token specified: must be a string");e||(e={});const n=e.header===!0?0:1,r=t.split(".")[n];if(typeof r!="string")throw new L1(`Invalid token specified: missing part #${n+1}`);let i;try{i=_1e(r)}catch(s){throw new L1(`Invalid token specified: invalid base64 for part #${n+1} (${s.message})`)}try{return JSON.parse(i)}catch(s){throw new L1(`Invalid token specified: invalid json for part #${n+1} (${s.message})`)}}var S1e={debug:()=>{},info:()=>{},warn:()=>{},error:()=>{}},ll,ul,$b=(t=>(t[t.NONE=0]="NONE",t[t.ERROR=1]="ERROR",t[t.WARN=2]="WARN",t[t.INFO=3]="INFO",t[t.DEBUG=4]="DEBUG",t))($b||{});(t=>{function e(){ll=3,ul=S1e}t.reset=e;function n(i){if(!(0<=i&&i<=4))throw new Error("Invalid log level");ll=i}t.setLevel=n;function r(i){ul=i}t.setLogger=r})($b||($b={}));var Hr=class sl{constructor(e){this._name=e}debug(...e){ll>=4&&ul.debug(sl._format(this._name,this._method),...e)}info(...e){ll>=3&&ul.info(sl._format(this._name,this._method),...e)}warn(...e){ll>=2&&ul.warn(sl._format(this._name,this._method),...e)}error(...e){ll>=1&&ul.error(sl._format(this._name,this._method),...e)}throw(e){throw this.error(e),e}create(e){const n=Object.create(this);return n._method=e,n.debug("begin"),n}static createStatic(e,n){const r=new sl(`${e}.${n}`);return r.debug("begin"),r}static _format(e,n){const r=`[${e}]`;return n?`${r} ${n}:`:r}static debug(e,...n){ll>=4&&ul.debug(sl._format(e),...n)}static info(e,...n){ll>=3&&ul.info(sl._format(e),...n)}static warn(e,...n){ll>=2&&ul.warn(sl._format(e),...n)}static error(e,...n){ll>=1&&ul.error(sl._format(e),...n)}};$b.reset();var PC=class{static decode(t){try{return zX(t)}catch(e){throw Hr.error("JwtUtils.decode",e),e}}static async generateSignedJwt(t,e,n){const r=Pc.encodeBase64Url(new TextEncoder().encode(JSON.stringify(t))),i=Pc.encodeBase64Url(new TextEncoder().encode(JSON.stringify(e))),s=`${r}.${i}`,o=await window.crypto.subtle.sign({name:"ECDSA",hash:{name:"SHA-256"}},n,new TextEncoder().encode(s)),a=Pc.encodeBase64Url(new Uint8Array(o));return`${s}.${a}`}},w1e="10000000-1000-4000-8000-100000000000",zA=t=>btoa([...new Uint8Array(t)].map(e=>String.fromCharCode(e)).join("")),WX=class ol{static _randomWord(){const e=new Uint32Array(1);return crypto.getRandomValues(e),e[0]}static generateUUIDv4(){return w1e.replace(/[018]/g,n=>(+n^ol._randomWord()&15>>+n/4).toString(16)).replace(/-/g,"")}static generateCodeVerifier(){return ol.generateUUIDv4()+ol.generateUUIDv4()+ol.generateUUIDv4()}static async generateCodeChallenge(e){if(!crypto.subtle)throw new Error("Crypto.subtle is available only in secure contexts (HTTPS).");try{const r=new TextEncoder().encode(e),i=await crypto.subtle.digest("SHA-256",r);return zA(i).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}catch(n){throw Hr.error("CryptoUtils.generateCodeChallenge",n),n}}static generateBasicAuth(e,n){const i=new TextEncoder().encode([e,n].join(":"));return zA(i)}static async hash(e,n){const r=new TextEncoder().encode(n),i=await crypto.subtle.digest(e,r);return new Uint8Array(i)}static async customCalculateJwkThumbprint(e){let n;switch(e.kty){case"RSA":n={e:e.e,kty:e.kty,n:e.n};break;case"EC":n={crv:e.crv,kty:e.kty,x:e.x,y:e.y};break;case"OKP":n={crv:e.crv,kty:e.kty,x:e.x};break;case"oct":n={crv:e.k,kty:e.kty};break;default:throw new Error("Unknown jwk type")}const r=await ol.hash("SHA-256",JSON.stringify(n));return ol.encodeBase64Url(r)}static async generateDPoPProof({url:e,accessToken:n,httpMethod:r,keyPair:i,nonce:s}){let o,a;const c={jti:window.crypto.randomUUID(),htm:r??"GET",htu:e,iat:Math.floor(Date.now()/1e3)};n&&(o=await ol.hash("SHA-256",n),a=ol.encodeBase64Url(o),c.ath=a),s&&(c.nonce=s);try{const l=await crypto.subtle.exportKey("jwk",i.publicKey),d={alg:"ES256",typ:"dpop+jwt",jwk:{crv:l.crv,kty:l.kty,x:l.x,y:l.y}};return await PC.generateSignedJwt(d,c,i.privateKey)}catch(l){throw l instanceof TypeError?new Error(`Error exporting dpop public key: ${l.message}`):l}}static async generateDPoPJkt(e){try{const n=await crypto.subtle.exportKey("jwk",e.publicKey);return await ol.customCalculateJwkThumbprint(n)}catch(n){throw n instanceof TypeError?new Error(`Could not retrieve dpop keys from storage: ${n.message}`):n}}static async generateDPoPKeys(){return await window.crypto.subtle.generateKey({name:"ECDSA",namedCurve:"P-256"},!1,["sign","verify"])}};WX.encodeBase64Url=t=>zA(t).replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_");var Pc=WX,E1e=class{constructor(e){this._name=e,this._callbacks=[],this._logger=new Hr(`Event('${this._name}')`)}addHandler(e){return this._callbacks.push(e),()=>this.removeHandler(e)}removeHandler(e){const n=this._callbacks.lastIndexOf(e);n>=0&&this._callbacks.splice(n,1)}async raise(...e){this._logger.debug("raise:",...e);for(const n of this._callbacks)await n(...e)}},DC=class yE extends E1e{constructor(){super(...arguments),this._logger=new Hr(`Timer('${this._name}')`),this._timerHandle=null,this._expiration=0,this._callback=()=>{const e=this._expiration-yE.getEpochTime();this._logger.debug("timer completes in",e),this._expiration<=yE.getEpochTime()&&(this.cancel(),super.raise())}}static getEpochTime(){return Math.floor(Date.now()/1e3)}init(e){const n=this._logger.create("init");e=Math.max(Math.floor(e),1);const r=yE.getEpochTime()+e;if(this.expiration===r&&this._timerHandle){n.debug("skipping since already initialized for expiration at",this.expiration);return}this.cancel(),n.debug("using duration",e),this._expiration=r;const i=Math.min(e,5);this._timerHandle=setInterval(this._callback,i*1e3)}get expiration(){return this._expiration}cancel(){this._logger.create("cancel"),this._timerHandle&&(clearInterval(this._timerHandle),this._timerHandle=null)}},TB=class{static readParams(t,e="query"){if(!t)throw new TypeError("Invalid URL");const r=new URL(t,"http://127.0.0.1")[e==="fragment"?"hash":"search"];return new URLSearchParams(r.slice(1))}},WA=";",Tv=class extends Error{constructor(t,e){var n,r,i;if(super(t.error_description||t.error||""),this.form=e,this.name="ErrorResponse",!t.error)throw Hr.error("ErrorResponse","No error passed"),new Error("No error passed");this.error=t.error,this.error_description=(n=t.error_description)!=null?n:null,this.error_uri=(r=t.error_uri)!=null?r:null,this.state=t.userState,this.session_state=(i=t.session_state)!=null?i:null,this.url_state=t.url_state}},C1e=class extends Error{constructor(t){super(t),this.name="ErrorTimeout"}},T1e=class{constructor(){this._logger=new Hr("InMemoryWebStorage"),this._data={}}clear(){this._logger.create("clear"),this._data={}}getItem(t){return this._logger.create(`getItem('${t}')`),this._data[t]}setItem(t,e){this._logger.create(`setItem('${t}')`),this._data[t]=e}removeItem(t){this._logger.create(`removeItem('${t}')`),delete this._data[t]}get length(){return Object.getOwnPropertyNames(this._data).length}key(t){return Object.getOwnPropertyNames(this._data)[t]}},YA=class extends Error{constructor(t,e){super(e),this.name="ErrorDPoPNonce",this.nonce=t}},SP=class{constructor(t=[],e=null,n={}){this._jwtHandler=e,this._extraHeaders=n,this._logger=new Hr("JsonService"),this._contentTypes=[],this._contentTypes.push(...t,"application/json"),e&&this._contentTypes.push("application/jwt")}async fetchWithTimeout(t,e={}){const{timeoutInSeconds:n,...r}=e;if(!n)return await fetch(t,r);const i=new AbortController,s=setTimeout(()=>i.abort(),n*1e3);try{return await fetch(t,{...e,signal:i.signal})}catch(o){throw o instanceof DOMException&&o.name==="AbortError"?new C1e("Network timed out"):o}finally{clearTimeout(s)}}async getJson(t,{token:e,credentials:n,timeoutInSeconds:r}={}){const i=this._logger.create("getJson"),s={Accept:this._contentTypes.join(", ")};e&&(i.debug("token passed, setting Authorization header"),s.Authorization="Bearer "+e),this.appendExtraHeaders(s);let o;try{i.debug("url:",t),o=await this.fetchWithTimeout(t,{method:"GET",headers:s,timeoutInSeconds:r,credentials:n})}catch(l){throw i.error("Network Error"),l}i.debug("HTTP response received, status",o.status);const a=o.headers.get("Content-Type");if(a&&!this._contentTypes.find(l=>a.startsWith(l))&&i.throw(new Error(`Invalid response Content-Type: ${a??"undefined"}, from URL: ${t}`)),o.ok&&this._jwtHandler&&a?.startsWith("application/jwt"))return await this._jwtHandler(await o.text());let c;try{c=await o.json()}catch(l){throw i.error("Error parsing JSON response",l),o.ok?l:new Error(`${o.statusText} (${o.status})`)}if(!o.ok)throw i.error("Error from server:",c),c.error?new Tv(c):new Error(`${o.statusText} (${o.status}): ${JSON.stringify(c)}`);return c}async postForm(t,{body:e,basicAuth:n,timeoutInSeconds:r,initCredentials:i,extraHeaders:s}){const o=this._logger.create("postForm"),a={Accept:this._contentTypes.join(", "),"Content-Type":"application/x-www-form-urlencoded",...s};n!==void 0&&(a.Authorization="Basic "+n),this.appendExtraHeaders(a);let c;try{o.debug("url:",t),c=await this.fetchWithTimeout(t,{method:"POST",headers:a,body:e,timeoutInSeconds:r,credentials:i})}catch(m){throw o.error("Network error"),m}o.debug("HTTP response received, status",c.status);const l=c.headers.get("Content-Type");if(l&&!this._contentTypes.find(m=>l.startsWith(m)))throw new Error(`Invalid response Content-Type: ${l??"undefined"}, from URL: ${t}`);const d=await c.text();let h={};if(d)try{h=JSON.parse(d)}catch(m){throw o.error("Error parsing JSON response",m),c.ok?m:new Error(`${c.statusText} (${c.status})`)}if(!c.ok){if(o.error("Error from server:",h),c.headers.has("dpop-nonce")){const m=c.headers.get("dpop-nonce");throw new YA(m,`${JSON.stringify(h)}`)}throw h.error?new Tv(h,e):new Error(`${c.statusText} (${c.status}): ${JSON.stringify(h)}`)}return h}appendExtraHeaders(t){const e=this._logger.create("appendExtraHeaders"),n=Object.keys(this._extraHeaders),r=["authorization","accept","content-type"];n.length!==0&&n.forEach(i=>{if(r.includes(i.toLocaleLowerCase())){e.warn("Protected header could not be overridden",i,r);return}const s=typeof this._extraHeaders[i]=="function"?this._extraHeaders[i]():this._extraHeaders[i];s&&s!==""&&(t[i]=s)})}},YX=class{constructor(t){this._settings=t,this._logger=new Hr("MetadataService"),this._signingKeys=null,this._metadata=null,this._metadataUrl=this._settings.metadataUrl,this._jsonService=new SP(["application/jwk-set+json"],null,this._settings.extraHeaders),this._settings.signingKeys&&(this._logger.debug("using signingKeys from settings"),this._signingKeys=this._settings.signingKeys),this._settings.metadata&&(this._logger.debug("using metadata from settings"),this._metadata=this._settings.metadata),this._settings.fetchRequestCredentials&&(this._logger.debug("using fetchRequestCredentials from settings"),this._fetchRequestCredentials=this._settings.fetchRequestCredentials)}resetSigningKeys(){this._signingKeys=null}async getMetadata(){const t=this._logger.create("getMetadata");if(this._metadata)return t.debug("using cached values"),this._metadata;if(!this._metadataUrl)throw t.throw(new Error("No authority or metadataUrl configured on settings")),null;t.debug("getting metadata from",this._metadataUrl);const e=await this._jsonService.getJson(this._metadataUrl,{credentials:this._fetchRequestCredentials,timeoutInSeconds:this._settings.requestTimeoutInSeconds});return t.debug("merging remote JSON with seed metadata"),this._metadata=Object.assign({},this._settings.metadataSeed,e),this._metadata}getIssuer(){return this._getMetadataProperty("issuer")}getAuthorizationEndpoint(){return this._getMetadataProperty("authorization_endpoint")}getUserInfoEndpoint(){return this._getMetadataProperty("userinfo_endpoint")}getTokenEndpoint(t=!0){return this._getMetadataProperty("token_endpoint",t)}getCheckSessionIframe(){return this._getMetadataProperty("check_session_iframe",!0)}getEndSessionEndpoint(){return this._getMetadataProperty("end_session_endpoint",!0)}getRevocationEndpoint(t=!0){return this._getMetadataProperty("revocation_endpoint",t)}getKeysEndpoint(t=!0){return this._getMetadataProperty("jwks_uri",t)}async _getMetadataProperty(t,e=!1){const n=this._logger.create(`_getMetadataProperty('${t}')`),r=await this.getMetadata();if(n.debug("resolved"),r[t]===void 0){if(e===!0){n.warn("Metadata does not contain optional property");return}n.throw(new Error("Metadata does not contain property "+t))}return r[t]}async getSigningKeys(){const t=this._logger.create("getSigningKeys");if(this._signingKeys)return t.debug("returning signingKeys from cache"),this._signingKeys;const e=await this.getKeysEndpoint(!1);t.debug("got jwks_uri",e);const n=await this._jsonService.getJson(e,{timeoutInSeconds:this._settings.requestTimeoutInSeconds});if(t.debug("got key set",n),!Array.isArray(n.keys))throw t.throw(new Error("Missing keys on keyset")),null;return this._signingKeys=n.keys,this._signingKeys}},xT=class{constructor({prefix:t="oidc.",store:e=localStorage}={}){this._logger=new Hr("WebStorageStateStore"),this._store=e,this._prefix=t}async set(t,e){this._logger.create(`set('${t}')`),t=this._prefix+t,await this._store.setItem(t,e)}async get(t){return this._logger.create(`get('${t}')`),t=this._prefix+t,await this._store.getItem(t)}async remove(t){this._logger.create(`remove('${t}')`),t=this._prefix+t;const e=await this._store.getItem(t);return await this._store.removeItem(t),e}async getAllKeys(){this._logger.create("getAllKeys");const t=await this._store.length,e=[];for(let n=0;n<t;n++){const r=await this._store.key(n);r&&r.indexOf(this._prefix)===0&&e.push(r.substr(this._prefix.length))}return e}},R1e="code",k1e="openid",I1e="client_secret_post",x1e=900,JA=class{constructor({authority:t,metadataUrl:e,metadata:n,signingKeys:r,metadataSeed:i,client_id:s,client_secret:o,response_type:a=R1e,scope:c=k1e,redirect_uri:l,post_logout_redirect_uri:d,client_authentication:h=I1e,prompt:m,display:g,max_age:y,ui_locales:v,acr_values:E,resource:w,response_mode:k,filterProtocolClaims:x=!0,loadUserInfo:C=!1,requestTimeoutInSeconds:R,staleStateAgeInSeconds:T=x1e,mergeClaimsStrategy:M={array:"replace"},disablePKCE:O=!1,stateStore:P,revokeTokenAdditionalContentTypes:D,fetchRequestCredentials:j,refreshTokenAllowedScope:$,extraQueryParams:q={},extraTokenParams:Y={},extraHeaders:W={},dpop:H,omitScopeWhenRequesting:F=!1}){var V;if(this.authority=t,e?this.metadataUrl=e:(this.metadataUrl=t,t&&(this.metadataUrl.endsWith("/")||(this.metadataUrl+="/"),this.metadataUrl+=".well-known/openid-configuration")),this.metadata=n,this.metadataSeed=i,this.signingKeys=r,this.client_id=s,this.client_secret=o,this.response_type=a,this.scope=c,this.redirect_uri=l,this.post_logout_redirect_uri=d,this.client_authentication=h,this.prompt=m,this.display=g,this.max_age=y,this.ui_locales=v,this.acr_values=E,this.resource=w,this.response_mode=k,this.filterProtocolClaims=x??!0,this.loadUserInfo=!!C,this.staleStateAgeInSeconds=T,this.mergeClaimsStrategy=M,this.omitScopeWhenRequesting=F,this.disablePKCE=!!O,this.revokeTokenAdditionalContentTypes=D,this.fetchRequestCredentials=j||"same-origin",this.requestTimeoutInSeconds=R,P)this.stateStore=P;else{const G=typeof window<"u"?window.localStorage:new T1e;this.stateStore=new xT({store:G})}if(this.refreshTokenAllowedScope=$,this.extraQueryParams=q,this.extraTokenParams=Y,this.extraHeaders=W,this.dpop=H,this.dpop&&!((V=this.dpop)!=null&&V.store))throw new Error("A DPoPStore is required when dpop is enabled")}},A1e=class{constructor(t,e){this._settings=t,this._metadataService=e,this._logger=new Hr("UserInfoService"),this._getClaimsFromJwt=async n=>{const r=this._logger.create("_getClaimsFromJwt");try{const i=PC.decode(n);return r.debug("JWT decoding successful"),i}catch(i){throw r.error("Error parsing JWT response"),i}},this._jsonService=new SP(void 0,this._getClaimsFromJwt,this._settings.extraHeaders)}async getClaims(t){const e=this._logger.create("getClaims");t||this._logger.throw(new Error("No token passed"));const n=await this._metadataService.getUserInfoEndpoint();e.debug("got userinfo url",n);const r=await this._jsonService.getJson(n,{token:t,credentials:this._settings.fetchRequestCredentials,timeoutInSeconds:this._settings.requestTimeoutInSeconds});return e.debug("got claims",r),r}},JX=class{constructor(t,e){this._settings=t,this._metadataService=e,this._logger=new Hr("TokenClient"),this._jsonService=new SP(this._settings.revokeTokenAdditionalContentTypes,null,this._settings.extraHeaders)}async exchangeCode({grant_type:t="authorization_code",redirect_uri:e=this._settings.redirect_uri,client_id:n=this._settings.client_id,client_secret:r=this._settings.client_secret,extraHeaders:i,...s}){const o=this._logger.create("exchangeCode");n||o.throw(new Error("A client_id is required")),e||o.throw(new Error("A redirect_uri is required")),s.code||o.throw(new Error("A code is required"));const a=new URLSearchParams({grant_type:t,redirect_uri:e});for(const[h,m]of Object.entries(s))m!=null&&a.set(h,m);let c;switch(this._settings.client_authentication){case"client_secret_basic":if(!r)throw o.throw(new Error("A client_secret is required")),null;c=Pc.generateBasicAuth(n,r);break;case"client_secret_post":a.append("client_id",n),r&&a.append("client_secret",r);break}const l=await this._metadataService.getTokenEndpoint(!1);o.debug("got token endpoint");const d=await this._jsonService.postForm(l,{body:a,basicAuth:c,timeoutInSeconds:this._settings.requestTimeoutInSeconds,initCredentials:this._settings.fetchRequestCredentials,extraHeaders:i});return o.debug("got response"),d}async exchangeCredentials({grant_type:t="password",client_id:e=this._settings.client_id,client_secret:n=this._settings.client_secret,scope:r=this._settings.scope,...i}){const s=this._logger.create("exchangeCredentials");e||s.throw(new Error("A client_id is required"));const o=new URLSearchParams({grant_type:t});this._settings.omitScopeWhenRequesting||o.set("scope",r);for(const[d,h]of Object.entries(i))h!=null&&o.set(d,h);let a;switch(this._settings.client_authentication){case"client_secret_basic":if(!n)throw s.throw(new Error("A client_secret is required")),null;a=Pc.generateBasicAuth(e,n);break;case"client_secret_post":o.append("client_id",e),n&&o.append("client_secret",n);break}const c=await this._metadataService.getTokenEndpoint(!1);s.debug("got token endpoint");const l=await this._jsonService.postForm(c,{body:o,basicAuth:a,timeoutInSeconds:this._settings.requestTimeoutInSeconds,initCredentials:this._settings.fetchRequestCredentials});return s.debug("got response"),l}async exchangeRefreshToken({grant_type:t="refresh_token",client_id:e=this._settings.client_id,client_secret:n=this._settings.client_secret,timeoutInSeconds:r,extraHeaders:i,...s}){const o=this._logger.create("exchangeRefreshToken");e||o.throw(new Error("A client_id is required")),s.refresh_token||o.throw(new Error("A refresh_token is required"));const a=new URLSearchParams({grant_type:t});for(const[h,m]of Object.entries(s))Array.isArray(m)?m.forEach(g=>a.append(h,g)):m!=null&&a.set(h,m);let c;switch(this._settings.client_authentication){case"client_secret_basic":if(!n)throw o.throw(new Error("A client_secret is required")),null;c=Pc.generateBasicAuth(e,n);break;case"client_secret_post":a.append("client_id",e),n&&a.append("client_secret",n);break}const l=await this._metadataService.getTokenEndpoint(!1);o.debug("got token endpoint");const d=await this._jsonService.postForm(l,{body:a,basicAuth:c,timeoutInSeconds:r,initCredentials:this._settings.fetchRequestCredentials,extraHeaders:i});return o.debug("got response"),d}async revoke(t){var e;const n=this._logger.create("revoke");t.token||n.throw(new Error("A token is required"));const r=await this._metadataService.getRevocationEndpoint(!1);n.debug(`got revocation endpoint, revoking ${(e=t.token_type_hint)!=null?e:"default token type"}`);const i=new URLSearchParams;for(const[s,o]of Object.entries(t))o!=null&&i.set(s,o);i.set("client_id",this._settings.client_id),this._settings.client_secret&&i.set("client_secret",this._settings.client_secret),await this._jsonService.postForm(r,{body:i,timeoutInSeconds:this._settings.requestTimeoutInSeconds}),n.debug("got response")}},M1e=class{constructor(t,e,n){this._settings=t,this._metadataService=e,this._claimsService=n,this._logger=new Hr("ResponseValidator"),this._userInfoService=new A1e(this._settings,this._metadataService),this._tokenClient=new JX(this._settings,this._metadataService)}async validateSigninResponse(t,e,n){const r=this._logger.create("validateSigninResponse");this._processSigninState(t,e),r.debug("state processed"),await this._processCode(t,e,n),r.debug("code processed"),t.isOpenId&&this._validateIdTokenAttributes(t),r.debug("tokens validated"),await this._processClaims(t,e?.skipUserInfo,t.isOpenId),r.debug("claims processed")}async validateCredentialsResponse(t,e){const n=this._logger.create("validateCredentialsResponse");t.isOpenId&&t.id_token&&this._validateIdTokenAttributes(t),n.debug("tokens validated"),await this._processClaims(t,e,t.isOpenId),n.debug("claims processed")}async validateRefreshResponse(t,e){var n,r;const i=this._logger.create("validateRefreshResponse");t.userState=e.data,(n=t.session_state)!=null||(t.session_state=e.session_state),(r=t.scope)!=null||(t.scope=e.scope),t.isOpenId&&t.id_token&&(this._validateIdTokenAttributes(t,e.id_token),i.debug("ID Token validated")),t.id_token||(t.id_token=e.id_token,t.profile=e.profile);const s=t.isOpenId&&!!t.id_token;await this._processClaims(t,!1,s),i.debug("claims processed")}validateSignoutResponse(t,e){const n=this._logger.create("validateSignoutResponse");if(e.id!==t.state&&n.throw(new Error("State does not match")),n.debug("state validated"),t.userState=e.data,t.error)throw n.warn("Response was error",t.error),new Tv(t)}_processSigninState(t,e){var n;const r=this._logger.create("_processSigninState");if(e.id!==t.state&&r.throw(new Error("State does not match")),e.client_id||r.throw(new Error("No client_id on state")),e.authority||r.throw(new Error("No authority on state")),this._settings.authority!==e.authority&&r.throw(new Error("authority mismatch on settings vs. signin state")),this._settings.client_id&&this._settings.client_id!==e.client_id&&r.throw(new Error("client_id mismatch on settings vs. signin state")),r.debug("state validated"),t.userState=e.data,t.url_state=e.url_state,(n=t.scope)!=null||(t.scope=e.scope),t.error)throw r.warn("Response was error",t.error),new Tv(t);e.code_verifier&&!t.code&&r.throw(new Error("Expected code in response"))}async _processClaims(t,e=!1,n=!0){const r=this._logger.create("_processClaims");if(t.profile=this._claimsService.filterProtocolClaims(t.profile),e||!this._settings.loadUserInfo||!t.access_token){r.debug("not loading user info");return}r.debug("loading user info");const i=await this._userInfoService.getClaims(t.access_token);r.debug("user info claims received from user info endpoint"),n&&i.sub!==t.profile.sub&&r.throw(new Error("subject from UserInfo response does not match subject in ID Token")),t.profile=this._claimsService.mergeClaims(t.profile,this._claimsService.filterProtocolClaims(i)),r.debug("user info claims received, updated profile:",t.profile)}async _processCode(t,e,n){const r=this._logger.create("_processCode");if(t.code){r.debug("Validating code");const i=await this._tokenClient.exchangeCode({client_id:e.client_id,client_secret:e.client_secret,code:t.code,redirect_uri:e.redirect_uri,code_verifier:e.code_verifier,extraHeaders:n,...e.extraTokenParams});Object.assign(t,i)}else r.debug("No code to process")}_validateIdTokenAttributes(t,e){var n;const r=this._logger.create("_validateIdTokenAttributes");r.debug("decoding ID Token JWT");const i=PC.decode((n=t.id_token)!=null?n:"");if(i.sub||r.throw(new Error("ID Token is missing a subject claim")),e){const s=PC.decode(e);i.sub!==s.sub&&r.throw(new Error("sub in id_token does not match current sub")),i.auth_time&&i.auth_time!==s.auth_time&&r.throw(new Error("auth_time in id_token does not match original auth_time")),i.azp&&i.azp!==s.azp&&r.throw(new Error("azp in id_token does not match original azp")),!i.azp&&s.azp&&r.throw(new Error("azp not in id_token, but present in original id_token"))}t.profile=i}},NC=class XA{constructor(e){this.id=e.id||Pc.generateUUIDv4(),this.data=e.data,e.created&&e.created>0?this.created=e.created:this.created=DC.getEpochTime(),this.request_type=e.request_type,this.url_state=e.url_state}toStorageString(){return new Hr("State").create("toStorageString"),JSON.stringify({id:this.id,data:this.data,created:this.created,request_type:this.request_type,url_state:this.url_state})}static fromStorageString(e){return Hr.createStatic("State","fromStorageString"),Promise.resolve(new XA(JSON.parse(e)))}static async clearStaleState(e,n){const r=Hr.createStatic("State","clearStaleState"),i=DC.getEpochTime()-n,s=await e.getAllKeys();r.debug("got keys",s);for(let o=0;o<s.length;o++){const a=s[o],c=await e.get(a);let l=!1;if(c)try{const d=await XA.fromStorageString(c);r.debug("got item from key:",a,d.created),d.created<=i&&(l=!0)}catch(d){r.error("Error parsing state for key:",a,d),l=!0}else r.debug("no item in storage for key:",a),l=!0;l&&(r.debug("removed item for key:",a),e.remove(a))}}},wP=class QA extends NC{constructor(e){super(e),this.code_verifier=e.code_verifier,this.code_challenge=e.code_challenge,this.authority=e.authority,this.client_id=e.client_id,this.redirect_uri=e.redirect_uri,this.scope=e.scope,this.client_secret=e.client_secret,this.extraTokenParams=e.extraTokenParams,this.response_mode=e.response_mode,this.skipUserInfo=e.skipUserInfo}static async create(e){const n=e.code_verifier===!0?Pc.generateCodeVerifier():e.code_verifier||void 0,r=n?await Pc.generateCodeChallenge(n):void 0;return new QA({...e,code_verifier:n,code_challenge:r})}toStorageString(){return new Hr("SigninState").create("toStorageString"),JSON.stringify({id:this.id,data:this.data,created:this.created,request_type:this.request_type,url_state:this.url_state,code_verifier:this.code_verifier,authority:this.authority,client_id:this.client_id,redirect_uri:this.redirect_uri,scope:this.scope,client_secret:this.client_secret,extraTokenParams:this.extraTokenParams,response_mode:this.response_mode,skipUserInfo:this.skipUserInfo})}static fromStorageString(e){Hr.createStatic("SigninState","fromStorageString");const n=JSON.parse(e);return QA.create(n)}},XX=class QX{constructor(e){this.url=e.url,this.state=e.state}static async create({url:e,authority:n,client_id:r,redirect_uri:i,response_type:s,scope:o,state_data:a,response_mode:c,request_type:l,client_secret:d,nonce:h,url_state:m,resource:g,skipUserInfo:y,extraQueryParams:v,extraTokenParams:E,disablePKCE:w,dpopJkt:k,omitScopeWhenRequesting:x,...C}){if(!e)throw this._logger.error("create: No url passed"),new Error("url");if(!r)throw this._logger.error("create: No client_id passed"),new Error("client_id");if(!i)throw this._logger.error("create: No redirect_uri passed"),new Error("redirect_uri");if(!s)throw this._logger.error("create: No response_type passed"),new Error("response_type");if(!o)throw this._logger.error("create: No scope passed"),new Error("scope");if(!n)throw this._logger.error("create: No authority passed"),new Error("authority");const R=await wP.create({data:a,request_type:l,url_state:m,code_verifier:!w,client_id:r,authority:n,redirect_uri:i,response_mode:c,client_secret:d,scope:o,extraTokenParams:E,skipUserInfo:y}),T=new URL(e);T.searchParams.append("client_id",r),T.searchParams.append("redirect_uri",i),T.searchParams.append("response_type",s),x||T.searchParams.append("scope",o),h&&T.searchParams.append("nonce",h),k&&T.searchParams.append("dpop_jkt",k);let M=R.id;m&&(M=`${M}${WA}${m}`),T.searchParams.append("state",M),R.code_challenge&&(T.searchParams.append("code_challenge",R.code_challenge),T.searchParams.append("code_challenge_method","S256")),g&&(Array.isArray(g)?g:[g]).forEach(P=>T.searchParams.append("resource",P));for(const[O,P]of Object.entries({response_mode:c,...C,...v}))P!=null&&T.searchParams.append(O,P.toString());return new QX({url:T.href,state:R})}};XX._logger=new Hr("SigninRequest");var L1e=XX,O1e="openid",bE=class{constructor(t){if(this.access_token="",this.token_type="",this.profile={},this.state=t.get("state"),this.session_state=t.get("session_state"),this.state){const e=decodeURIComponent(this.state).split(WA);this.state=e[0],e.length>1&&(this.url_state=e.slice(1).join(WA))}this.error=t.get("error"),this.error_description=t.get("error_description"),this.error_uri=t.get("error_uri"),this.code=t.get("code")}get expires_in(){if(this.expires_at!==void 0)return this.expires_at-DC.getEpochTime()}set expires_in(t){typeof t=="string"&&(t=Number(t)),t!==void 0&&t>=0&&(this.expires_at=Math.floor(t)+DC.getEpochTime())}get isOpenId(){var t;return((t=this.scope)==null?void 0:t.split(" ").includes(O1e))||!!this.id_token}},P1e=class{constructor({url:t,state_data:e,id_token_hint:n,post_logout_redirect_uri:r,extraQueryParams:i,request_type:s,client_id:o}){if(this._logger=new Hr("SignoutRequest"),!t)throw this._logger.error("ctor: No url passed"),new Error("url");const a=new URL(t);n&&a.searchParams.append("id_token_hint",n),o&&a.searchParams.append("client_id",o),r&&(a.searchParams.append("post_logout_redirect_uri",r),e&&(this.state=new NC({data:e,request_type:s}),a.searchParams.append("state",this.state.id)));for(const[c,l]of Object.entries({...i}))l!=null&&a.searchParams.append(c,l.toString());this.url=a.href}},D1e=class{constructor(t){this.state=t.get("state"),this.error=t.get("error"),this.error_description=t.get("error_description"),this.error_uri=t.get("error_uri")}},N1e=["nbf","jti","auth_time","nonce","acr","amr","azp","at_hash"],U1e=["sub","iss","aud","exp","iat"],j1e=class{constructor(t){this._settings=t,this._logger=new Hr("ClaimsService")}filterProtocolClaims(t){const e={...t};if(this._settings.filterProtocolClaims){let n;Array.isArray(this._settings.filterProtocolClaims)?n=this._settings.filterProtocolClaims:n=N1e;for(const r of n)U1e.includes(r)||delete e[r]}return e}mergeClaims(t,e){const n={...t};for(const[r,i]of Object.entries(e))if(n[r]!==i)if(Array.isArray(n[r])||Array.isArray(i))if(this._settings.mergeClaimsStrategy.array=="replace")n[r]=i;else{const s=Array.isArray(n[r])?n[r]:[n[r]];for(const o of Array.isArray(i)?i:[i])s.includes(o)||s.push(o);n[r]=s}else typeof n[r]=="object"&&typeof i=="object"?n[r]=this.mergeClaims(n[r],i):n[r]=i;return n}},F1e=class{constructor(t,e){this.keys=t,this.nonce=e}},EP=class{constructor(t,e){this._logger=new Hr("OidcClient"),this.settings=t instanceof JA?t:new JA(t),this.metadataService=e??new YX(this.settings),this._claimsService=new j1e(this.settings),this._validator=new M1e(this.settings,this.metadataService,this._claimsService),this._tokenClient=new JX(this.settings,this.metadataService)}async createSigninRequest({state:t,request:e,request_uri:n,request_type:r,id_token_hint:i,login_hint:s,skipUserInfo:o,nonce:a,url_state:c,response_type:l=this.settings.response_type,scope:d=this.settings.scope,redirect_uri:h=this.settings.redirect_uri,prompt:m=this.settings.prompt,display:g=this.settings.display,max_age:y=this.settings.max_age,ui_locales:v=this.settings.ui_locales,acr_values:E=this.settings.acr_values,resource:w=this.settings.resource,response_mode:k=this.settings.response_mode,extraQueryParams:x=this.settings.extraQueryParams,extraTokenParams:C=this.settings.extraTokenParams,dpopJkt:R,omitScopeWhenRequesting:T=this.settings.omitScopeWhenRequesting}){const M=this._logger.create("createSigninRequest");if(l!=="code")throw new Error("Only the Authorization Code flow (with PKCE) is supported");const O=await this.metadataService.getAuthorizationEndpoint();M.debug("Received authorization endpoint",O);const P=await L1e.create({url:O,authority:this.settings.authority,client_id:this.settings.client_id,redirect_uri:h,response_type:l,scope:d,state_data:t,url_state:c,prompt:m,display:g,max_age:y,ui_locales:v,id_token_hint:i,login_hint:s,acr_values:E,dpopJkt:R,resource:w,request:e,request_uri:n,extraQueryParams:x,extraTokenParams:C,request_type:r,response_mode:k,client_secret:this.settings.client_secret,skipUserInfo:o,nonce:a,disablePKCE:this.settings.disablePKCE,omitScopeWhenRequesting:T});await this.clearStaleState();const D=P.state;return await this.settings.stateStore.set(D.id,D.toStorageString()),P}async readSigninResponseState(t,e=!1){const n=this._logger.create("readSigninResponseState"),r=new bE(TB.readParams(t,this.settings.response_mode));if(!r.state)throw n.throw(new Error("No state in response")),null;const i=await this.settings.stateStore[e?"remove":"get"](r.state);if(!i)throw n.throw(new Error("No matching state found in storage")),null;return{state:await wP.fromStorageString(i),response:r}}async processSigninResponse(t,e){const n=this._logger.create("processSigninResponse"),{state:r,response:i}=await this.readSigninResponseState(t,!0);if(n.debug("received state from storage; validating response"),this.settings.dpop&&this.settings.dpop.store){const s=await this.getDpopProof(this.settings.dpop.store);e={...e,DPoP:s}}try{await this._validator.validateSigninResponse(i,r,e)}catch(s){if(s instanceof YA&&this.settings.dpop){const o=await this.getDpopProof(this.settings.dpop.store,s.nonce);e.DPoP=o,await this._validator.validateSigninResponse(i,r,e)}else throw s}return i}async getDpopProof(t,e){let n,r;return(await t.getAllKeys()).includes(this.settings.client_id)?(r=await t.get(this.settings.client_id),r.nonce!==e&&e&&(r.nonce=e,await t.set(this.settings.client_id,r))):(n=await Pc.generateDPoPKeys(),r=new F1e(n,e),await t.set(this.settings.client_id,r)),await Pc.generateDPoPProof({url:await this.metadataService.getTokenEndpoint(!1),httpMethod:"POST",keyPair:r.keys,nonce:r.nonce})}async processResourceOwnerPasswordCredentials({username:t,password:e,skipUserInfo:n=!1,extraTokenParams:r={}}){const i=await this._tokenClient.exchangeCredentials({username:t,password:e,...r}),s=new bE(new URLSearchParams);return Object.assign(s,i),await this._validator.validateCredentialsResponse(s,n),s}async useRefreshToken({state:t,redirect_uri:e,resource:n,timeoutInSeconds:r,extraHeaders:i,extraTokenParams:s}){var o;const a=this._logger.create("useRefreshToken");let c;if(this.settings.refreshTokenAllowedScope===void 0)c=t.scope;else{const h=this.settings.refreshTokenAllowedScope.split(" ");c=(((o=t.scope)==null?void 0:o.split(" "))||[]).filter(g=>h.includes(g)).join(" ")}if(this.settings.dpop&&this.settings.dpop.store){const h=await this.getDpopProof(this.settings.dpop.store);i={...i,DPoP:h}}let l;try{l=await this._tokenClient.exchangeRefreshToken({refresh_token:t.refresh_token,scope:c,redirect_uri:e,resource:n,timeoutInSeconds:r,extraHeaders:i,...s})}catch(h){if(h instanceof YA&&this.settings.dpop)i.DPoP=await this.getDpopProof(this.settings.dpop.store,h.nonce),l=await this._tokenClient.exchangeRefreshToken({refresh_token:t.refresh_token,scope:c,redirect_uri:e,resource:n,timeoutInSeconds:r,extraHeaders:i,...s});else throw h}const d=new bE(new URLSearchParams);return Object.assign(d,l),a.debug("validating response",d),await this._validator.validateRefreshResponse(d,{...t,scope:c}),d}async createSignoutRequest({state:t,id_token_hint:e,client_id:n,request_type:r,post_logout_redirect_uri:i=this.settings.post_logout_redirect_uri,extraQueryParams:s=this.settings.extraQueryParams}={}){const o=this._logger.create("createSignoutRequest"),a=await this.metadataService.getEndSessionEndpoint();if(!a)throw o.throw(new Error("No end session endpoint")),null;o.debug("Received end session endpoint",a),!n&&i&&!e&&(n=this.settings.client_id);const c=new P1e({url:a,id_token_hint:e,client_id:n,post_logout_redirect_uri:i,state_data:t,extraQueryParams:s,request_type:r});await this.clearStaleState();const l=c.state;return l&&(o.debug("Signout request has state to persist"),await this.settings.stateStore.set(l.id,l.toStorageString())),c}async readSignoutResponseState(t,e=!1){const n=this._logger.create("readSignoutResponseState"),r=new D1e(TB.readParams(t,this.settings.response_mode));if(!r.state){if(n.debug("No state in response"),r.error)throw n.warn("Response was error:",r.error),new Tv(r);return{state:void 0,response:r}}const i=await this.settings.stateStore[e?"remove":"get"](r.state);if(!i)throw n.throw(new Error("No matching state found in storage")),null;return{state:await NC.fromStorageString(i),response:r}}async processSignoutResponse(t){const e=this._logger.create("processSignoutResponse"),{state:n,response:r}=await this.readSignoutResponseState(t,!0);return n?(e.debug("Received state from storage; validating response"),this._validator.validateSignoutResponse(r,n)):e.debug("No state from storage; skipping response validation"),r}clearStaleState(){return this._logger.create("clearStaleState"),NC.clearStaleState(this.settings.stateStore,this.settings.staleStateAgeInSeconds)}async revokeToken(t,e){return this._logger.create("revokeToken"),await this._tokenClient.revoke({token:t,token_type_hint:e})}},_s=(function(t){return t.NotSupported="OIDC authentication not supported",t.Misconfigured="OIDC is misconfigured",t.General="Something went wrong with OIDC discovery",t.OpSupport="Configured OIDC OP does not support required functions",t.DynamicRegistrationNotSupported="Dynamic registration not supported",t.DynamicRegistrationFailed="Dynamic registration failed",t.DynamicRegistrationInvalid="Dynamic registration invalid response",t.CodeExchangeFailed="Failed to exchange code for token",t.InvalidBearerTokenResponse="Invalid bearer token response",t.InvalidIdToken="Invalid ID token",t.MissingOrInvalidStoredState="State required to finish logging in is not found in storage.",t})({}),CP=t=>!!t&&typeof t=="object"&&!Array.isArray(t),Fu=(t,e)=>!t[e]||!J1(t,e)?(N.error("Missing or invalid property: ".concat(e)),!1):!0,J1=(t,e)=>t[e]&&typeof t[e]!="string"?(N.error("Invalid property: ".concat(e)),!1):!0,RB=(t,e)=>t[e]&&(!Array.isArray(t[e])||!t[e].every(n=>typeof n=="string"))?(N.error("Invalid property: ".concat(e)),!1):!0,px=(t,e,n)=>{var r=t[e];return!r||!Array.isArray(r)||!r.includes(n)?(N.error("Invalid property: ".concat(e,". ").concat(n," is required.")),!1):!0},ZX=t=>{if(!CP(t))throw N.error("Issuer configuration not found or malformed"),new Error(_s.OpSupport);var e=[Fu(t,"issuer"),Fu(t,"authorization_endpoint"),Fu(t,"token_endpoint"),Fu(t,"revocation_endpoint"),J1(t,"registration_endpoint"),J1(t,"account_management_uri"),J1(t,"device_authorization_endpoint"),RB(t,"account_management_actions_supported"),px(t,"response_types_supported","code"),px(t,"grant_types_supported",Bb.AuthorizationCode),px(t,"code_challenge_methods_supported","S256"),RB(t,"prompt_values_supported")].some(n=>!n);if(!e)return t;throw N.error("Issuer configuration not valid"),new Error(_s.OpSupport)},eQ=t=>{try{return zX(t)}catch(e){throw N.error("Could not decode id_token",e),e}},tQ=(t,e,n,r)=>{try{if(!t)throw new Error("No ID token");var i=eQ(t);if(i.iss!==e)throw new Error("Invalid issuer");var s=typeof i.aud=="string"?[i.aud]:i.aud;if(!s.includes(n))throw new Error("Invalid audience");if(r!==void 0&&i.nonce!==r)throw new Error("Invalid nonce");if(!i.exp||Date.now()>i.exp*1e3)throw new Error("Invalid expiry")}catch(o){throw N.error("Invalid ID token",o),new Error(_s.InvalidIdToken)}};function nQ(t){if(!CP(t))throw N.error("Stored user state not found"),new Error(_s.MissingOrInvalidStoredState);var e=[Fu(t,"homeserverUrl"),Fu(t,"nonce"),J1(t,"identityServerUrl")].some(n=>!n);if(e)throw new Error(_s.MissingOrInvalidStoredState)}var $1e=t=>CP(t)&&Fu(t,"token_type")&&t.token_type.toLowerCase()==="bearer"&&Fu(t,"access_token")&&Fu(t,"refresh_token")&&(!("expires_in"in t)||typeof t.expires_in=="number");function rQ(t){if(!$1e(t))throw new Error(_s.InvalidBearerTokenResponse)}function kB(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function UC(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?kB(Object(n),!0).forEach(function(r){L(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):kB(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}var AT=t=>{var e=t??Qo(10);return"openid urn:matrix:org.matrix.msc2967.client:api:* urn:matrix:org.matrix.msc2967.client:device:".concat(e)},B1e=(function(){var t=B(function*(e){if(!globalThis.crypto.subtle)return N.warn("A secure context is required to generate code challenge. Using plain text code challenge"),e;var n=yield yP(e);return ET(n)});return function(n){return t.apply(this,arguments)}})(),H1e=t=>{var{redirectUri:e}=t;return{scope:AT(),redirectUri:e,state:Qo(8),nonce:Qo(8),codeVerifier:Qo(64)}},q1e=(function(){var t=B(function*(e,n,r){var{scope:i,redirectUri:s,state:o,nonce:a,codeVerifier:c}=r,l=new URL(e);return l.searchParams.append("response_mode","query"),l.searchParams.append("response_type","code"),l.searchParams.append("redirect_uri",s),l.searchParams.append("client_id",n),l.searchParams.append("state",o),l.searchParams.append("scope",i),l.searchParams.append("nonce",a),l.searchParams.append("code_challenge_method","S256"),l.searchParams.append("code_challenge",yield B1e(c)),l.toString()});return function(n,r,i){return t.apply(this,arguments)}})(),V1e=(function(){var t=B(function*(e){var{metadata:n,redirectUri:r,clientId:i,homeserverUrl:s,identityServerUrl:o,nonce:a,prompt:c,urlState:l,loginHint:d}=e,h=AT(),m=new EP(UC(UC({},n),{},{client_id:i,redirect_uri:r,authority:n.issuer,response_mode:"query",response_type:"code",scope:h,stateStore:new xT({prefix:"mx_oidc_",store:window.sessionStorage})})),g={homeserverUrl:s,nonce:a,identityServerUrl:o},y=yield m.createSigninRequest({state:g,nonce:a,prompt:c,url_state:l,login_hint:d});return y.url});return function(n){return t.apply(this,arguments)}})(),K1e=t=>({id_token:t.id_token,scope:t.scope,expires_at:t.expires_at,refresh_token:t.refresh_token,access_token:t.access_token,token_type:"Bearer"}),G1e=(function(){var t=B(function*(e,n){var r=new URL(window.location.origin);r.searchParams.append("code",e),r.searchParams.append("state",n),$b.setLogger(N);try{var i=new bE(r.searchParams),s=new xT({prefix:"mx_oidc_",store:window.sessionStorage}),o=yield s.get(i.state);if(!o)throw new Error(_s.MissingOrInvalidStoredState);var a=yield wP.fromStorageString(o),c=new EP(UC(UC({},a),{},{stateStore:s})),l=yield c.processSigninResponse(r.href),d=l.userState;nQ(d),rQ(l),tQ(l.id_token,c.settings.authority,c.settings.client_id,d.nonce);var h=K1e(l);return{oidcClientSettings:{clientId:c.settings.client_id,issuer:c.settings.authority},tokenResponse:h,homeserverUrl:d.homeserverUrl,identityServerUrl:d.identityServerUrl,idTokenClaims:l.profile}}catch(g){N.error("Oidc login failed",g);var m=g.message;throw Object.values(_s).includes(m)?g:new Error(_s.CodeExchangeFailed)}});return function(n,r){return t.apply(this,arguments)}})();function IB(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function xB(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?IB(Object(n),!0).forEach(function(r){L(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):IB(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}var TP=(function(){var t=B(function*(e){var n=new URL(".well-known/openid-configuration",e),r=yield fetch(n,{method:he.Get,signal:ST(5e3)}),i=yield r.json();return RP(i)});return function(n){return t.apply(this,arguments)}})(),RP=(function(){var t=B(function*(e){var n=ZX(e),r=new JA({authority:n.issuer,metadata:n,redirect_uri:"",client_id:""}),i=new YX(r);return xB(xB({},n),{},{signingKeys:yield i.getSigningKeys()})});return function(n){return t.apply(this,arguments)}})(),Bb=(function(t){return t.AuthorizationCode="authorization_code",t.RefreshToken="refresh_token",t.DeviceAuthorization="urn:ietf:params:oauth:grant-type:device_code",t})({}),z1e=Bb.DeviceAuthorization,mx=(t,e)=>{if(!e)return!1;var n=new URL(e);return!(n.protocol!==t.protocol||n.hostname!==t.hostname&&!n.hostname.endsWith(".".concat(t.hostname)))},W1e=(function(){var t=B(function*(e,n){if(!e.registration_endpoint)throw new Error(_s.DynamicRegistrationNotSupported);var r=[Bb.AuthorizationCode,Bb.RefreshToken];if(r.some(d=>!e.grant_types_supported.includes(d)))throw new Error(_s.DynamicRegistrationNotSupported);var i=new URL(n.clientUri),s={client_name:n.clientName,client_uri:n.clientUri,response_types:["code"],grant_types:r,redirect_uris:n.redirectUris,id_token_signed_response_alg:"RS256",token_endpoint_auth_method:"none",application_type:n.applicationType,contacts:n.contacts,logo_uri:mx(i,n.logoUri)?n.logoUri:void 0,policy_uri:mx(i,n.policyUri)?n.policyUri:void 0,tos_uri:mx(i,n.tosUri)?n.tosUri:void 0},o={Accept:"application/json","Content-Type":"application/json"};try{var a=yield fetch(e.registration_endpoint,{method:he.Post,headers:o,body:JSON.stringify(s)});if(a.status>=400)throw new Error(_s.DynamicRegistrationFailed);var c=yield a.json(),l=c.client_id;if(!l||typeof l!="string")throw new Error(_s.DynamicRegistrationInvalid);return l}catch(d){throw Object.values(_s).includes(d.message)?d:(N.error("Dynamic registration request failed",d),new Error(_s.DynamicRegistrationFailed))}});return function(n,r){return t.apply(this,arguments)}})();class Y1e{constructor(e,n,r,i,s){this.issuer=e,this.clientId=n,this.redirectUri=r,this.deviceId=i,this.idTokenClaims=s,L(this,"oidcClientReady",void 0),L(this,"initPromise",void 0),L(this,"oidcClient",void 0),L(this,"inflightRefreshRequest",void 0),this.oidcClientReady=Promise.resolve()}ensureInit(){var e=this;return B(function*(){if(!e.oidcClient){if(e.initPromise)return e.initPromise;e.initPromise=e.initialiseOidcClient(e.issuer,e.clientId,e.deviceId,e.redirectUri);try{yield e.initPromise}finally{e.initPromise=void 0}}})()}initialiseOidcClient(e,n,r,i){var s=this;return B(function*(){try{var o,a=yield TP(e),c=AT(r);s.oidcClient=new EP({metadata:a,signingKeys:(o=a.signingKeys)!==null&&o!==void 0?o:void 0,client_id:n,scope:c,redirect_uri:i,authority:a.issuer,stateStore:new xT({prefix:"mx_oidc_",store:window.sessionStorage})})}catch(l){throw N.error("Failed to initialise OIDC client.",l),new Error("Failed to initialise OIDC client.")}})()}doRefreshAccessToken(e){var n=this;return B(function*(){yield n.ensureInit(),n.inflightRefreshRequest||(n.inflightRefreshRequest=n.getNewTokens(e));try{var r=yield n.inflightRefreshRequest;return r}catch(i){throw i instanceof Tv?new oP(i):i}finally{n.inflightRefreshRequest=void 0}})()}persistTokens(e){return B(function*(){})()}getNewTokens(e){var n=this;return B(function*(){if(!n.oidcClient)throw new Error("Cannot get new token before OIDC client is initialised.");var r={refresh_token:e,session_state:"test",data:void 0,profile:n.idTokenClaims},i=Date.now(),s=yield n.oidcClient.useRefreshToken({state:r,timeoutInSeconds:300}),o={accessToken:s.access_token,refreshToken:s.refresh_token,expiry:s.expires_in?new Date(i+s.expires_in*1e3):void 0};return yield n.persistTokens(o),o})()}}var J1e=["server","limit","since"];function AB(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function Yn(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?AB(Object(n),!0).forEach(function(r){L(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):AB(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}var X1e=3e3,MB=600*1e3,Q1e=new qr("last_seen_user_agent","org.matrix.msc3852.last_seen_user_agent"),Rv=(function(t){return t.Chronological="chronological",t.Detached="detached",t})({}),Z1e=new sy("m.get_login_token","org.matrix.msc3882.get_login_token"),iQ="uk.half-shot.msc2666",sQ="uk.half-shot.msc2666.mutual_rooms",oQ="uk.half-shot.msc2666.query_mutual_rooms",Qi="org.matrix.msc4140",jC="org.matrix.msc4354",aQ="uk.tcpip.msc4133",cQ="uk.tcpip.msc4133.stable",Qc="$",De=(function(t){return t.Sync="sync",t.Event="event",t.ToDeviceEvent="toDeviceEvent",t.ReceivedToDeviceMessage="receivedToDeviceMessage",t.AccountData="accountData",t.Room="Room",t.DeleteRoom="deleteRoom",t.SyncUnexpectedError="sync.unexpectedError",t.ClientWellKnown="WellKnown.client",t.ReceivedVoipEvent="received_voip_event",t.TurnServers="turnServers",t.TurnServersError="turnServers.error",t})({}),LB=new qr("action","org.matrix.msc3824.action");class MT extends Kn{constructor(e){var n,r,i,s,o,a;super(),i=this,L(this,"logger",void 0),L(this,"reEmitter",new ly(this)),L(this,"olmVersion",null),L(this,"usingExternalCrypto",!1),L(this,"_store",void 0),L(this,"deviceId",void 0),L(this,"credentials",void 0),L(this,"legacyPickleKey",void 0),L(this,"scheduler",void 0),L(this,"clientRunning",!1),L(this,"timelineSupport",!1),L(this,"urlPreviewCache",{}),L(this,"identityServer",void 0),L(this,"http",void 0),L(this,"cryptoBackend",void 0),L(this,"enableEncryptedStateEvents",void 0),L(this,"cryptoCallbacks",void 0),L(this,"callEventHandler",void 0),L(this,"groupCallEventHandler",void 0),L(this,"supportsCallTransfer",!1),L(this,"forceTURN",!1),L(this,"iceCandidatePoolSize",0),L(this,"idBaseUrl",void 0),L(this,"baseUrl",void 0),L(this,"isVoipWithNoMediaAllowed",void 0),L(this,"disableVoip",void 0),L(this,"useLivekitForGroupCalls",void 0),L(this,"canSupportVoip",!1),L(this,"peekSync",null),L(this,"isGuestAccount",!1),L(this,"ongoingScrollbacks",{}),L(this,"notifTimelineSet",null),L(this,"legacyCryptoStore",void 0),L(this,"verificationMethods",void 0),L(this,"fallbackICEServerAllowed",!1),L(this,"syncApi",void 0),L(this,"roomNameGenerator",void 0),L(this,"pushRules",void 0),L(this,"syncLeftRoomsPromise",void 0),L(this,"syncedLeftRooms",!1),L(this,"clientOpts",void 0),L(this,"clientWellKnownIntervalID",void 0),L(this,"canResetTimelineCallback",void 0),L(this,"canSupport",new Map),L(this,"pushProcessor",new _c(this)),L(this,"serverVersionsPromise",void 0),L(this,"clientWellKnown",void 0),L(this,"clientWellKnownPromise",void 0),L(this,"turnServers",[]),L(this,"turnServersExpiry",0),L(this,"checkTurnServersIntervalID",void 0),L(this,"txnCtr",0),L(this,"mediaHandler",new N0e(this)),L(this,"sessionId",void 0),L(this,"eventsBeingEncrypted",new Set),L(this,"useE2eForGroupCall",!0),L(this,"toDeviceMessageQueue",void 0),L(this,"livekitServiceURL",void 0),L(this,"_secretStorage",void 0),L(this,"ignoredInvites",void 0),L(this,"matrixRTC",void 0),L(this,"serverCapabilitiesService",void 0),L(this,"startCallEventHandler",()=>{this.isInitialSyncComplete()&&(PA()&&(this.callEventHandler.start(),this.groupCallEventHandler.start()),this.off(De.Sync,this.startCallEventHandler))}),L(this,"startMatrixRTC",()=>{this.isInitialSyncComplete()&&(this.matrixRTC.start(),this.off(De.Sync,this.startMatrixRTC))}),L(this,"fixupRoomNotifications",()=>{if(this.isInitialSyncComplete()){var l,d=((l=this.getRooms())!==null&&l!==void 0?l:[]).filter(g=>g.getUnreadNotificationCount(sn.Total)>0);for(var h of d){var m=this.getSafeUserId();h.fixupNotifications(m)}this.off(De.Sync,this.fixupRoomNotifications)}}),this.logger=(n=e.logger)!==null&&n!==void 0?n:N,e.baseUrl=QI(e.baseUrl),e.idBaseUrl=QI(e.idBaseUrl),this.baseUrl=e.baseUrl,this.idBaseUrl=e.idBaseUrl,this.identityServer=e.identityServer,this.usingExternalCrypto=(r=e.usingExternalCrypto)!==null&&r!==void 0?r:!1,this.store=e.store||new Fye,this.deviceId=e.deviceId||null,this.sessionId=Qo(10);var c=e.userId||null;this.credentials={userId:c},this.http=new TX(this,{fetchFn:e.fetchFn,baseUrl:e.baseUrl,idBaseUrl:e.idBaseUrl,accessToken:e.accessToken,refreshToken:e.refreshToken,tokenRefreshFunction:e.tokenRefreshFunction,prefix:hr.V3,onlyData:!0,extraParams:e.queryParams,localTimeoutMs:e.localTimeoutMs,useAuthorizationHeader:e.useAuthorizationHeader,logger:this.logger}),e.pickleKey&&(this.legacyPickleKey=e.pickleKey),this.useLivekitForGroupCalls=!!e.useLivekitForGroupCalls,this.scheduler=e.scheduler,this.scheduler&&this.scheduler.setProcessFunction((function(){var l=B(function*(d){var h=i.getRoom(d.getRoomId());d.status!==ct.SENDING&&i.updatePendingEventStatus(h,d,ct.SENDING);var m=yield i.sendEventHttpRequest(d);return h&&h.updatePendingEvent(d,ct.SENT,m.event_id),m});return function(d){return l.apply(this,arguments)}})()),this.disableVoip=(s=e.disableVoip)!==null&&s!==void 0?s:!1,!this.disableVoip&&PA()&&(this.callEventHandler=new i0e(this),this.groupCallEventHandler=new s0e(this),this.canSupportVoip=!0,this.on(De.Sync,this.startCallEventHandler)),this.matrixRTC=new y1e(this.logger,this),this.serverCapabilitiesService=new kX(this.logger,this.http),this.on(De.Sync,this.fixupRoomNotifications),this.timelineSupport=!!e.timelineSupport,this.legacyCryptoStore=e.cryptoStore,this.verificationMethods=e.verificationMethods,this.cryptoCallbacks=e.cryptoCallbacks||{},this.enableEncryptedStateEvents=(o=e.enableEncryptedStateEvents)!==null&&o!==void 0?o:!1,this.forceTURN=e.forceTURN||!1,this.iceCandidatePoolSize=e.iceCandidatePoolSize===void 0?0:e.iceCandidatePoolSize,this.supportsCallTransfer=e.supportsCallTransfer||!1,this.fallbackICEServerAllowed=e.fallbackICEServerAllowed||!1,this.isVoipWithNoMediaAllowed=e.isVoipWithNoMediaAllowed||!1,e.useE2eForGroupCall!==void 0&&(this.useE2eForGroupCall=e.useE2eForGroupCall),this.livekitServiceURL=e.livekitServiceURL,this.roomNameGenerator=e.roomNameGenerator,this.toDeviceMessageQueue=new V0e(this,this.logger),this.on(Zt.Decrypted,l=>{lQ(this,l)}),this.ignoredInvites=new K0e(this),this._secretStorage=new KX(this,(a=e.cryptoCallbacks)!==null&&a!==void 0?a:{}),this.setMaxListeners(0)}set store(e){this._store=e,this._store.setUserCreator(n=>Hu.createUser(n,this))}get store(){return this._store}startClient(e){var n=this;return B(function*(){if(!n.clientRunning){n.clientRunning=!0,n.on(De.Sync,n.startMatrixRTC);var r=n.getUserId();r&&n.store.storeUser(new Hu(r)),n.supportsVoip()&&(n.checkTurnServersIntervalID=setInterval(()=>{n.checkTurnServers()},MB),n.checkTurnServers()),n.syncApi&&(n.logger.error("Still have sync object whilst not running: stopping old one"),n.syncApi.stop());try{yield n.getVersions();var{threads:i,list:s,fwdPagination:o}=yield n.doesServerSupportThread();$n.setServerSideSupport(i),$n.setServerSideListSupport(s),$n.setServerSideFwdPaginationSupport(o)}catch(a){n.logger.error("Can't fetch server versions, continuing to initialise sync, this will be retried later",a)}n.clientOpts=e??{},n.clientOpts.slidingSync?n.syncApi=new BX(n.clientOpts.slidingSync,n,n.clientOpts,n.buildSyncApiOptions()):n.syncApi=new yf(n,n.clientOpts,n.buildSyncApiOptions()),n.syncApi.sync().catch(a=>n.logger.info("Sync startup aborted with an error:",a)),n.clientOpts.clientWellKnownPollPeriod!==void 0&&(n.clientWellKnownIntervalID=setInterval(()=>{n.fetchClientWellKnown()},1e3*n.clientOpts.clientWellKnownPollPeriod),n.fetchClientWellKnown()),n.toDeviceMessageQueue.start(),n.serverCapabilitiesService.start()}})()}buildSyncApiOptions(){return{cryptoCallbacks:this.cryptoBackend,canResetEntireTimeline:e=>this.canResetTimelineCallback?this.canResetTimelineCallback(e):!1,logger:this.logger.getChild("sync")}}stopClient(){var e,n,r,i,s;(e=this.cryptoBackend)===null||e===void 0||e.stop(),this.off(De.Sync,this.startMatrixRTC),this.clientRunning&&(this.logger.debug("stopping MatrixClient"),this.clientRunning=!1,(n=this.syncApi)===null||n===void 0||n.stop(),this.syncApi=void 0,(r=this.peekSync)===null||r===void 0||r.stopPeeking(),(i=this.callEventHandler)===null||i===void 0||i.stop(),(s=this.groupCallEventHandler)===null||s===void 0||s.stop(),this.callEventHandler=void 0,this.groupCallEventHandler=void 0,globalThis.clearInterval(this.checkTurnServersIntervalID),this.checkTurnServersIntervalID=void 0,this.clientWellKnownIntervalID!==void 0&&globalThis.clearInterval(this.clientWellKnownIntervalID),this.toDeviceMessageQueue.stop(),this.matrixRTC.stop(),this.serverCapabilitiesService.stop())}clearStores(){var e=this,n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(this.clientRunning)throw new Error("Cannot clear stores while client is running");var r=[];r.push(this.store.deleteAllData()),this.legacyCryptoStore&&r.push(this.legacyCryptoStore.deleteAllData());var i=(function(){var s=B(function*(){var o;try{if(o=globalThis.indexedDB,!o)return}catch{return}var a=function*(m){var g=new Promise((y,v)=>{e.logger.info("Removing IndexedDB instance ".concat(m));var E=o.deleteDatabase(m);E.onsuccess=w=>{e.logger.info("Removed IndexedDB instance ".concat(m)),y(0)},E.onerror=w=>{e.logger.warn("Failed to remove IndexedDB instance ".concat(m,":"),w),y(0)},E.onblocked=w=>{e.logger.info("cannot yet remove IndexedDB instance ".concat(m))}});yield g};for(var c of["".concat((l=n.cryptoDatabasePrefix)!==null&&l!==void 0?l:dx,"::matrix-sdk-crypto"),"".concat((d=n.cryptoDatabasePrefix)!==null&&d!==void 0?d:dx,"::matrix-sdk-crypto-meta")]){var l,d;yield*a(c)}});return function(){return s.apply(this,arguments)}})();return r.push(i()),Promise.all(r).then()}getUserId(){var e,n;return(e=(n=this.credentials)===null||n===void 0?void 0:n.userId)!==null&&e!==void 0?e:null}getSafeUserId(){var e=this.getUserId();if(!e)throw new Error("Expected logged in user but found none.");return e}getDomain(){var e;return(e=this.credentials)!==null&&e!==void 0&&e.userId?this.credentials.userId.replace(/^.*?:/,""):null}getUserIdLocalpart(){var e,n;return(e=(n=this.credentials)===null||n===void 0||(n=n.userId)===null||n===void 0?void 0:n.split(":")[0].substring(1))!==null&&e!==void 0?e:null}getDeviceId(){return this.deviceId}getSessionId(){return this.sessionId}supportsVoip(){return!this.disableVoip&&this.canSupportVoip}getMediaHandler(){return this.mediaHandler}setForceTURN(e){this.forceTURN=e}setSupportsCallTransfer(e){this.supportsCallTransfer=e}getUseE2eForGroupCall(){return this.useE2eForGroupCall}createCall(e){return Db(this,e)}createGroupCall(e,n,r,i,s,o){var a=this;return B(function*(){if(a.getGroupCallForRoom(e))throw new Error("".concat(e," already has an existing group call"));var c=a.getRoom(e);if(!c)throw new Error("Cannot find room ".concat(e));return new hP(a,c,n,r,i,void 0,s||a.isVoipWithNoMediaAllowed,o,a.isVoipWithNoMediaAllowed,a.useLivekitForGroupCalls,a.livekitServiceURL).create()})()}getLivekitServiceURL(){return this.livekitServiceURL}setLivekitServiceURL(e){this.livekitServiceURL=e}waitUntilRoomReadyForGroupCalls(e){return this.groupCallEventHandler.waitUntilRoomReadyForGroupCalls(e)}getGroupCallForRoom(e){return this.groupCallEventHandler.groupCalls.get(e)||null}getSyncState(){var e,n;return(e=(n=this.syncApi)===null||n===void 0?void 0:n.getSyncState())!==null&&e!==void 0?e:null}getSyncStateData(){return this.syncApi?this.syncApi.getSyncStateData():null}isInitialSyncComplete(){var e=this.getSyncState();return e?e===Qt.Prepared||e===Qt.Syncing:!1}isGuest(){return this.isGuestAccount}setGuest(e){this.isGuestAccount=e}getScheduler(){return this.scheduler}retryImmediately(){var e,n;return this.toDeviceMessageQueue.sendQueue(),(e=(n=this.syncApi)===null||n===void 0?void 0:n.retryImmediately())!==null&&e!==void 0?e:!1}getNotifTimelineSet(){return this.notifTimelineSet}setNotifTimelineSet(e){this.notifTimelineSet=e}getCapabilities(){var e=this;return B(function*(){var n=e.serverCapabilitiesService.getCachedCapabilities();return n||e.serverCapabilitiesService.fetchCapabilities()})()}getCachedCapabilities(){return this.serverCapabilitiesService.getCachedCapabilities()}fetchCapabilities(){return this.serverCapabilitiesService.fetchCapabilities()}initRustCrypto(){var e=arguments,n=this;return B(function*(){var r,i,s=e.length>0&&e[0]!==void 0?e[0]:{};if(n.cryptoBackend){n.logger.warn("Attempt to re-initialise e2e encryption on MatrixClient");return}var o=n.getUserId();if(o===null)throw new Error("Cannot enable encryption on MatrixClient with unknown userId: ensure userId is passed in createClient().");var a=n.getDeviceId();if(a===null)throw new Error("Cannot enable encryption on MatrixClient with unknown deviceId: ensure deviceId is passed in createClient().");n.logger.debug("Downloading Rust crypto library");var c=yield Mb(()=>import("./index-CoTEFHCo.js"),__vite__mapDeps([0,1]),import.meta.url),l=yield c.initRustCrypto({logger:n.logger,http:n.http,userId:o,deviceId:a,secretStorage:n.secretStorage,cryptoCallbacks:n.cryptoCallbacks,storePrefix:s.useIndexedDB===!1?null:(r=s.cryptoDatabasePrefix)!==null&&r!==void 0?r:dx,storeKey:s.storageKey,storePassphrase:s.storagePassword,legacyCryptoStore:n.legacyCryptoStore,legacyPickleKey:(i=n.legacyPickleKey)!==null&&i!==void 0?i:"DEFAULT_KEY",legacyMigrationProgressListener:(d,h)=>{n.emit(Ci.LegacyCryptoStoreMigrationProgress,d,h)},enableEncryptedStateEvents:n.enableEncryptedStateEvents});l.setSupportedVerificationMethods(n.verificationMethods),n.cryptoBackend=l,n.on(fo.Membership,l.onRoomMembership.bind(l)),n.on(De.Event,d=>{l.onLiveEventFromSync(d)}),n.reEmitter.reEmit(l,[Ci.VerificationRequestReceived,Ci.UserTrustStatusChanged,Ci.KeyBackupStatus,Ci.KeyBackupSessionsRemaining,Ci.KeyBackupFailed,Ci.KeyBackupDecryptionKeyCached,Ci.KeysChanged,Ci.DevicesUpdated,Ci.WillUpdateDevices,Ci.DehydratedDeviceCreated,Ci.DehydratedDeviceUploaded,Ci.RehydrationStarted,Ci.RehydrationProgress,Ci.RehydrationCompleted,Ci.RehydrationError,Ci.DehydrationKeyCached,Ci.DehydratedDeviceRotationError])})()}get secretStorage(){return this._secretStorage}getCrypto(){return this.cryptoBackend}isRoomEncrypted(e){var n=this.getRoom(e);return n?n.hasEncryptionStateEvent():!1}isKeyBackupKeyStored(){return Promise.resolve(this.secretStorage.isStored("m.megolm_backup.v1"))}makeKeyBackupPath(e,n,r){var i;n!==void 0?i=Pe("/room_keys/keys/$roomId/$sessionId",{$roomId:e,$sessionId:n}):e!==void 0?i=Pe("/room_keys/keys/$roomId",{$roomId:e}):i="/room_keys/keys";var s=r===void 0?void 0:{version:r};return{path:i,queryData:s}}deleteKeysFromBackup(e,n,r){var i=this;return B(function*(){var s=i.makeKeyBackupPath(e,n,r);yield i.http.authedRequest(he.Delete,s.path,s.queryData,void 0,{prefix:hr.V3})})()}getMediaConfig(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,n=e?"/media/config":"/config";return this.http.authedRequest(he.Get,n,void 0,void 0,{prefix:e?hr.V1:Wg.V3})}getRoom(e){return e?this.store.getRoom(e):null}getRooms(){return this.store.getRooms()}getVisibleRooms(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,n=this.store.getRooms(),r=new Set(n);for(var i of r){var s=this.findPredecessorRooms(i,!0,e);for(var o of s)r.delete(o)}return Array.from(r)}getUser(e){return this.store.getUser(e)}getUsers(){return this.store.getUsers()}setAccountData(e,n){var r=this;return B(function*(){if(!r.clientRunning)return r.logger.warn("Calling `setAccountData` before the client is started: `getAccountData` may return inconsistent results."),yield Pb(5,()=>r.setAccountDataRaw(e,n));var i=r.store.getAccountData(e);if(i&&kp(i.event.content,n))return{};var s=Promise.withResolvers();function o(c){c.getType()===e&&s.resolve()}r.addListener(De.AccountData,o);try{var a=yield Pb(5,()=>r.setAccountDataRaw(e,n));return yield s.promise,a}finally{r.removeListener(De.AccountData,o)}})()}setAccountDataRaw(e,n){var r=Pe("/user/$userId/account_data/$type",{$userId:this.credentials.userId,$type:e});return this.http.authedRequest(he.Put,r,void 0,n)}getAccountData(e){return this.store.getAccountData(e)}getAccountDataFromServer(e){var n=this;return B(function*(){if(n.isInitialSyncComplete()){var r=n.store.getAccountData(e);return r?r.getContent():null}var i=Pe("/user/$userId/account_data/$type",{$userId:n.credentials.userId,$type:e});try{return yield n.http.authedRequest(he.Get,i)}catch(o){var s;if(((s=o.data)===null||s===void 0?void 0:s.errcode)==="M_NOT_FOUND")return null;throw o}})()}deleteAccountData(e){var n=this;return B(function*(){var r=n.canSupport.get(di.AccountDataDeletion);if(r===ui.Unsupported){yield n.setAccountData(e,{});return}var i=Pe("/user/$userId/account_data/$type",{$userId:n.getSafeUserId(),$type:e}),s=r===ui.Unstable?{prefix:"/_matrix/client/unstable/org.matrix.msc3391"}:void 0;return yield n.http.authedRequest(he.Delete,i,void 0,void 0,s)})()}getIgnoredUsers(){var e=this.getAccountData(Z.IgnoredUserList);return e!=null&&e.getContent().ignored_users?Object.keys(e.getContent().ignored_users):[]}setIgnoredUsers(e){var n={ignored_users:{}};return e.forEach(r=>{n.ignored_users[r]={}}),this.setAccountData(Z.IgnoredUserList,n)}isUserIgnored(e){return this.getIgnoredUsers().includes(e)}joinRoom(e){var n=arguments,r=this;return B(function*(){var i,s,o=n.length>1&&n[1]!==void 0?n[1]:{},a=r.getRoom(e),c=a?.getMember(r.getSafeUserId()),l=c?.membership,d=l==Ve.Invite&&(i=c==null||(s=c.events.member)===null||s===void 0?void 0:s.getSender())!==null&&i!==void 0?i:null;if(r.logger.debug("joinRoom[".concat(e,"]: preJoinMembership=").concat(l,", inviter=").concat(d,", opts=").concat(JSON.stringify(o))),l==Ve.Join)return a;var h=Promise.resolve();if(o.inviteSignUrl){var m=new URL(o.inviteSignUrl);m.searchParams.set("mxid",r.credentials.userId),h=r.http.requestOtherUrl(he.Post,m)}var g={};o.viaServers&&(g.via=g.server_name=o.viaServers.slice(0,3));var y={},v=yield h;v&&(y.third_party_signed=v);var E=Pe("/join/$roomid",{$roomid:e}),w=yield r.http.authedRequest(he.Post,E,g,y),k=w.room_id;if(o.acceptSharedHistory&&d&&r.cryptoBackend){var x=yield r.cryptoBackend.maybeAcceptKeyBundle(k,d);x||r.cryptoBackend.markRoomAsPendingKeyBundle(k,d)}var C=r.getRoom(k);if(C!=null&&C.hasMembershipState(r.credentials.userId,Ve.Join))return C;var R=new yf(r,r.clientOpts,r.buildSyncApiOptions());return R.createRoom(k)})()}knockRoom(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=this.getRoom(e);if(r!=null&&r.hasMembershipState(this.credentials.userId,Ve.Knock))return Promise.resolve({room_id:r.roomId});var i=Pe("/knock/$roomIdOrAlias",{$roomIdOrAlias:e}),s={};if(n.viaServers){var o=Array.isArray(n.viaServers)?n.viaServers.slice(0,3):[n.viaServers];s.server_name=o,s.via=o}var a={};return n.reason&&(a.reason=n.reason),this.http.authedRequest(he.Post,i,s,a)}resendEvent(e,n){return this.toDeviceMessageQueue.sendQueue(),this.updatePendingEventStatus(n,e,ct.SENDING),this.encryptAndSendEvent(n,e)}cancelPendingEvent(e){if(![ct.QUEUED,ct.NOT_SENT,ct.ENCRYPTING].includes(e.status))throw new Error("cannot cancel an event with status "+e.status);e.status===ct.ENCRYPTING?this.eventsBeingEncrypted.delete(e.getId()):this.scheduler&&e.status===ct.QUEUED&&this.scheduler.removeEventFromQueue(e);var n=this.getRoom(e.getRoomId());this.updatePendingEventStatus(n,e,ct.CANCELLED)}setRoomName(e,n){return this.sendStateEvent(e,Z.RoomName,{name:n})}setRoomTopic(e,n,r){var i=fX(n,r);return this.sendStateEvent(e,Z.RoomTopic,i)}getRoomTags(e){var n=Pe("/user/$userId/rooms/$roomId/tags",{$userId:this.credentials.userId,$roomId:e});return this.http.authedRequest(he.Get,n)}setRoomTag(e,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},i=Pe("/user/$userId/rooms/$roomId/tags/$tag",{$userId:this.credentials.userId,$roomId:e,$tag:n});return this.http.authedRequest(he.Put,i,void 0,r)}deleteRoomTag(e,n){var r=Pe("/user/$userId/rooms/$roomId/tags/$tag",{$userId:this.credentials.userId,$roomId:e,$tag:n});return this.http.authedRequest(he.Delete,r)}setRoomAccountData(e,n,r){var i=Pe("/user/$userId/rooms/$roomId/account_data/$type",{$userId:this.credentials.userId,$roomId:e,$type:n});return this.http.authedRequest(he.Put,i,void 0,r)}setPowerLevel(e,n,r){var i=this;return B(function*(){var s,o;if(i.clientRunning&&i.isInitialSyncComplete()){var a;o=(a=i.getRoom(e))===null||a===void 0||(a=a.currentState)===null||a===void 0||(a=a.getStateEvents(Z.RoomPowerLevels,""))===null||a===void 0?void 0:a.getContent()}if(!o)try{o=yield i.getStateEvent(e,Z.RoomPowerLevels,"")}catch(d){if(d instanceof In&&d.errcode==="M_NOT_FOUND")o={};else throw d}o=F_(o),(s=o)!==null&&s!==void 0&&s.users||(o.users={});var c=Array.isArray(n)?n:[n];for(var l of c)r==null?delete o.users[l]:o.users[l]=r;return i.sendStateEvent(e,Z.RoomPowerLevels,o,"")})()}unstable_createLiveBeacon(e,n){var r=this;return B(function*(){return r.unstable_setLiveBeacon(e,n)})()}unstable_setLiveBeacon(e,n){var r=this;return B(function*(){return r.sendStateEvent(e,vP.name,n,r.getUserId())})()}sendEvent(e,n,r,i,s){var o,a,c,l;return!(n!=null&&n.startsWith(Qc))&&n!==null?(l=i,c=r,a=n,o=null):(l=s,c=i,a=r,o=n),this.addThreadRelationIfNeeded(c,o,e),this.sendCompleteEvent({roomId:e,threadId:o,eventObject:{type:a,content:c},txnId:l})}addThreadRelationIfNeeded(e,n,r){var i;if(n&&!((i=e["m.relates_to"])!==null&&i!==void 0&&i.rel_type)){var s,o,a=!!((s=e["m.relates_to"])!==null&&s!==void 0&&s["m.in_reply_to"]);e["m.relates_to"]=Yn(Yn({},e["m.relates_to"]),{},{rel_type:Rn.name,event_id:n,is_falling_back:!a});var c=(o=this.getRoom(r))===null||o===void 0?void 0:o.getThread(n);if(c&&!a){var l,d;e["m.relates_to"]["m.in_reply_to"]={event_id:(l=(d=c.lastReply(h=>h.isRelation(Rn.name)&&!h.status))===null||d===void 0?void 0:d.getId())!==null&&l!==void 0?l:n}}}}sendCompleteEvent(e){var{roomId:n,threadId:r,eventObject:i,delayOpts:s,queryDict:o,txnId:a}=e;a||(a=this.makeTxnId());var c=new ns(Object.assign(i,{event_id:"~"+n+":"+a,user_id:this.credentials.userId,sender:this.credentials.userId,room_id:n,origin_server_ts:new Date().getTime()})),l=this.getRoom(n),d=r?l?.getThread(r):void 0;d&&c.setThread(d),s||(this.reEmitter.reEmit(c,[Zt.Replaced,Zt.VisibilityChange]),l?.reEmitter.reEmit(c,[Zt.BeforeRedaction]));var h=c.getAssociatedId();if(h!=null&&h.startsWith("~")){var m=l?.getPendingEvents().find(y=>y.getId()===h);m?.once(Zt.LocalEventIdReplaced,()=>{c.updateAssociatedId(m.getId())})}var g=c.getType();return this.logger.debug("sendEvent of type ".concat(g," in ").concat(n," with txnId ").concat(a).concat(s?" (delayed event)":"").concat(o?" query params: "+JSON.stringify(o):"")),c.setTxnId(a),c.setStatus(ct.SENDING),s?this.encryptAndSendEvent(l,c,s,o):(l?.addPendingEvent(c,a),c.status===ct.NOT_SENT?Promise.reject(new Error("Event blocked by other events not yet sent")):this.encryptAndSendEvent(l,c,o))}encryptAndSendEvent(e,n,r,i){var s=this;return B(function*(){var o=i;if(r&&MC(r))return s.sendEventHttpRequest(n,r,o);o||(o=r);try{var a;s.eventsBeingEncrypted.add(n.getId());try{yield s.encryptEventIfNeeded(n,e??void 0)}finally{a=!s.eventsBeingEncrypted.delete(n.getId())}if(a)return{};n.status===ct.ENCRYPTING&&s.updatePendingEventStatus(e,n,ct.SENDING);var c=null;return s.scheduler&&(c=s.scheduler.queueEvent(n),c&&s.scheduler.getQueueForEvent(n).length>1&&s.updatePendingEventStatus(e,n,ct.QUEUED)),c||(c=s.sendEventHttpRequest(n,o),e&&(c=c.then(l=>(e.updatePendingEvent(n,ct.SENT,l.event_id),l)))),yield c}catch(l){s.logger.error("Error sending event",l);try{n.error=l,s.updatePendingEventStatus(e,n,ct.NOT_SENT)}catch(d){s.logger.error("Exception in error handler!",d)}throw l instanceof In&&(l.event=n),l}})()}encryptEventIfNeeded(e,n){var r=this;return B(function*(){if(n&&(yield r.shouldEncryptEventForRoom(e,n))&&!(!r.cryptoBackend&&r.usingExternalCrypto)){if(!r.cryptoBackend)throw new Error("This room is configured to use encryption, but your client does not support encryption.");r.updatePendingEventStatus(n,e,ct.ENCRYPTING),yield r.cryptoBackend.encryptEvent(e,n)}})()}shouldEncryptEventForRoom(e,n){var r=this;return B(function*(){var i;return e.isEncrypted()||e.getType()===Z.Reaction||e.isRedaction()?!1:!!(n.hasEncryptionStateEvent()||(yield(i=r.cryptoBackend)===null||i===void 0?void 0:i.isEncryptionEnabledInRoom(n.roomId)))})()}getEncryptedIfNeededEventType(e,n){var r;return n===Z.Reaction?n:(r=this.getRoom(e))!==null&&r!==void 0&&r.hasEncryptionStateEvent()?Z.RoomMessageEncrypted:n}updatePendingEventStatus(e,n,r){e?e.updatePendingEvent(n,r):n.setStatus(r)}sendEventHttpRequest(e,n,r){var i=e.getTxnId();i||(i=this.makeTxnId(),e.setTxnId(i));var s={$roomId:e.getRoomId(),$eventType:e.getWireType(),$stateKey:e.getStateKey(),$txnId:i},o;if(e.isState()){var a="/rooms/$roomId/state/$eventType";e.getStateKey()&&e.getStateKey().length>0&&(a="/rooms/$roomId/state/$eventType/$stateKey"),o=Pe(a,s)}else if(e.isRedaction()&&e.event.redacts){var c="/rooms/$roomId/redact/$redactsEventId/$txnId";o=Pe(c,Yn({$redactsEventId:e.event.redacts},s))}else o=Pe("/rooms/$roomId/send/$eventType/$txnId",s);var l=n&&MC(n)?n:void 0,d=l?r:n,h=e.getWireContent();return l?this.http.authedRequest(he.Put,o,Yn(Yn({},OB(l)),d),h):this.http.authedRequest(he.Put,o,d,h).then(m=>(this.logger.debug("Event sent to ".concat(e.getRoomId()," with event id ").concat(m.event_id)),m))}redactEvent(e,n,r,i,s){var o,a,c;(o=r)!==null&&o!==void 0&&o.startsWith(Qc)||(s=i,i=r,r=n,n=null);var l=(a=s)===null||a===void 0?void 0:a.reason,d={reason:l};if(((c=s)===null||c===void 0?void 0:c.with_rel_types)!==void 0){if(this.canSupport.get(di.RelationBasedRedactions)===ui.Unsupported)throw new Error("Server does not support relation based redactions "+"roomId ".concat(e," eventId ").concat(r," txnId: ").concat(i," threadId ").concat(n));var h=this.canSupport.get(di.RelationBasedRedactions)===ui.Stable?_A.stable:_A.unstable;d[h]=s.with_rel_types}return this.sendCompleteEvent({roomId:e,threadId:n,eventObject:{type:Z.RoomRedaction,content:d,redacts:r},txnId:i})}sendMessage(e,n,r,i){typeof n!="string"&&n!==null&&(i=r,r=n,n=null);var s=Z.RoomMessage,o=r;return this.sendEvent(e,n,s,o,i)}sendTextMessage(e,n,r,i){var s;!((s=n)!==null&&s!==void 0&&s.startsWith(Qc))&&n!==null&&(i=r,r=n,n=null);var o=aX(r);return this.sendMessage(e,n,o,i)}sendNotice(e,n,r,i){var s;!((s=n)!==null&&s!==void 0&&s.startsWith(Qc))&&n!==null&&(i=r,r=n,n=null);var o=cX(r);return this.sendMessage(e,n,o,i)}sendEmoteMessage(e,n,r,i){var s;!((s=n)!==null&&s!==void 0&&s.startsWith(Qc))&&n!==null&&(i=r,r=n,n=null);var o=lX(r);return this.sendMessage(e,n,o,i)}sendImageMessage(e,n,r,i){var s,o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:"Image";!((s=n)!==null&&s!==void 0&&s.startsWith(Qc))&&n!==null&&(o=i||"Image",i=r,r=n,n=null);var a={msgtype:Nl.Image,url:r,info:i,body:o};return this.sendMessage(e,n,a)}sendStickerMessage(e,n,r,i){var s,o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:"Sticker";!((s=n)!==null&&s!==void 0&&s.startsWith(Qc))&&n!==null&&(o=i||"Sticker",i=r,r=n,n=null);var a={url:r,info:i,body:o};return this.sendEvent(e,n,Z.Sticker,a)}sendHtmlMessage(e,n,r,i){var s;!((s=n)!==null&&s!==void 0&&s.startsWith(Qc))&&n!==null&&(i=r,r=n,n=null);var o=iX(r,i);return this.sendMessage(e,n,o)}sendHtmlNotice(e,n,r,i){var s;!((s=n)!==null&&s!==void 0&&s.startsWith(Qc))&&n!==null&&(i=r,r=n,n=null);var o=sX(r,i);return this.sendMessage(e,n,o)}sendHtmlEmote(e,n,r,i){var s;!((s=n)!==null&&s!==void 0&&s.startsWith(Qc))&&n!==null&&(i=r,r=n,n=null);var o=oX(r,i);return this.sendMessage(e,n,o)}_unstable_sendDelayedEvent(e,n,r,i,s,o){var a=this;return B(function*(){if(!(yield a.doesServerSupportUnstableFeature(Qi)))throw new Wo("Server does not support the delayed events API","sendDelayedEvent");return a.addThreadRelationIfNeeded(s,r,e),a.sendCompleteEvent({roomId:e,threadId:r,eventObject:{type:i,content:s},delayOpts:n,txnId:o})})()}_unstable_sendStickyDelayedEvent(e,n,r,i,s,o,a){var c=this;return B(function*(){if(!(yield c.doesServerSupportUnstableFeature(Qi)))throw new Wo("Server does not support the delayed events API","getDelayedEvents");if(!(yield c.doesServerSupportUnstableFeature(jC)))throw new VA("Server does not support the sticky events","sendStickyEvent");return c.addThreadRelationIfNeeded(o,i,e),c.sendCompleteEvent({roomId:e,threadId:i,eventObject:{type:s,content:o},queryDict:{"org.matrix.msc4354.sticky_duration_ms":n},delayOpts:r,txnId:a})})()}_unstable_sendDelayedStateEvent(e,n,r,i){var s=arguments,o=this;return B(function*(){var a=s.length>4&&s[4]!==void 0?s[4]:"",c=s.length>5&&s[5]!==void 0?s[5]:{};if(!(yield o.doesServerSupportUnstableFeature(Qi)))throw new Wo("Server does not support the delayed events API","sendDelayedStateEvent");var l={$roomId:e,$eventType:r,$stateKey:a},d=Pe("/rooms/$roomId/state/$eventType",l);return a!==void 0&&(d=Pe(d+"/$stateKey",l)),o.http.authedRequest(he.Put,d,OB(n),i,c)})()}_unstable_sendStickyEvent(e,n,r,i,s,o){var a=this;return B(function*(){if(!(yield a.doesServerSupportUnstableFeature(jC)))throw new VA("Server does not support the sticky events","sendStickyEvent");return a.addThreadRelationIfNeeded(s,r,e),a.sendCompleteEvent({roomId:e,threadId:r,eventObject:{type:i,content:s},queryDict:{"org.matrix.msc4354.sticky_duration_ms":n},txnId:o})})()}_unstable_getDelayedEvents(e,n,r){var i=this;return B(function*(){if(!(yield i.doesServerSupportUnstableFeature(Qi)))throw new Wo("Server does not support the delayed events API","getDelayedEvents");var s={from:r,status:e,delay_id:n};return yield i.http.authedRequest(he.Get,"/delayed_events",s,void 0,{prefix:"".concat(hr.Unstable,"/").concat(Qi)})})()}_unstable_updateDelayedEvent(e,n){var r=arguments,i=this;return B(function*(){var s=r.length>2&&r[2]!==void 0?r[2]:{};if(!(yield i.doesServerSupportUnstableFeature(Qi)))throw new Wo("Server does not support the delayed events API","updateDelayedEvent");return yield i.updateScheduledDelayedEventWithActionInBody(e,n,s)})()}_unstable_cancelScheduledDelayedEvent(e){var n=arguments,r=this;return B(function*(){var i=n.length>1&&n[1]!==void 0?n[1]:{};return yield r.updateScheduledDelayedEvent(e,hp.Cancel,i)})()}_unstable_restartScheduledDelayedEvent(e){var n=arguments,r=this;return B(function*(){var i=n.length>1&&n[1]!==void 0?n[1]:{};return yield r.updateScheduledDelayedEvent(e,hp.Restart,i)})()}_unstable_sendScheduledDelayedEvent(e){var n=arguments,r=this;return B(function*(){var i=n.length>1&&n[1]!==void 0?n[1]:{};return yield r.updateScheduledDelayedEvent(e,hp.Send,i)})()}updateScheduledDelayedEvent(e,n){var r=arguments,i=this;return B(function*(){var s=r.length>2&&r[2]!==void 0?r[2]:{};if(!(yield i.doesServerSupportUnstableFeature(Qi)))throw new Wo("Server does not support the delayed events API","".concat(n,"ScheduledDelayedEvent"));try{var o=Pe("/delayed_events/$delayId/$action",{$delayId:e,$action:n});return yield i.http.request(he.Post,o,void 0,void 0,Yn(Yn({},s),{},{prefix:"".concat(hr.Unstable,"/").concat(Qi)}))}catch(a){if(a instanceof In&&a.errcode==="M_UNRECOGNIZED")return yield i.updateScheduledDelayedEventWithActionInBody(e,n,s);throw a}})()}updateScheduledDelayedEventWithActionInBody(e,n){var r=arguments,i=this;return B(function*(){var s=r.length>2&&r[2]!==void 0?r[2]:{},o=Pe("/delayed_events/$delayId",{$delayId:e}),a={action:n};try{return yield i.http.request(he.Post,o,void 0,a,Yn(Yn({},s),{},{prefix:"".concat(hr.Unstable,"/").concat(Qi)}))}catch(c){if(c instanceof In&&c.errcode==="M_MISSING_TOKEN")return yield i.http.authedRequest(he.Post,o,void 0,a,Yn(Yn({},s),{},{prefix:"".concat(hr.Unstable,"/").concat(Qi)}));throw c}})()}sendReceipt(e,n,r){var i=arguments,s=this;return B(function*(){var o=i.length>3&&i[3]!==void 0?i[3]:!1;if(s.isGuest())return Promise.resolve({});var a=Pe("/rooms/$roomId/receipt/$receiptType/$eventId",{$roomId:e.getRoomId(),$receiptType:n,$eventId:e.getId()}),c=!o&&s.supportsThreads(),l=c?Yn(Yn({},r),{},{thread_id:kv(e)}):r,d=s.http.authedRequest(he.Post,a,void 0,l||{}),h=s.getRoom(e.getRoomId());return h&&s.credentials.userId&&h.addLocalEchoReceipt(s.credentials.userId,e,n,o),d})()}sendReadReceipt(e){var n=arguments,r=this;return B(function*(){var i=n.length>1&&n[1]!==void 0?n[1]:Ps.Read,s=n.length>2&&n[2]!==void 0?n[2]:!1;if(e){var o=e.getId(),a=r.getRoom(e.getRoomId());if(a!=null&&a.hasPendingEvent(o))throw new Error("Cannot set read receipt to a pending event (".concat(o,")"));return r.sendReceipt(e,i,{},s)}})()}setRoomReadMarkers(e,n,r,i){var s=this;return B(function*(){var o=s.getRoom(e);if(o!=null&&o.hasPendingEvent(n))throw new Error("Cannot set read marker to a pending event (".concat(n,")"));var a;if(r){if(a=r.getId(),o!=null&&o.hasPendingEvent(a))throw new Error("Cannot set read receipt to a pending event (".concat(a,")"));o?.addLocalEchoReceipt(s.credentials.userId,r,Ps.Read)}var c;if(i){if(c=i.getId(),o!=null&&o.hasPendingEvent(c))throw new Error("Cannot set read receipt to a pending event (".concat(c,")"));o?.addLocalEchoReceipt(s.credentials.userId,i,Ps.ReadPrivate)}return yield s.setRoomReadMarkersHttpRequest(e,n,a,c)})()}sendRtcDecline(e,n){return this.sendEvent(e,Z.RTCDecline,{"m.relates_to":{event_id:n,rel_type:bn.Reference}})}getUrlPreview(e,n){n=Math.floor(n/6e4)*6e4;var r=new URL(e);r.hash="",e=r.toString();var i=n+"_"+e;if(i in this.urlPreviewCache)return this.urlPreviewCache[i];var s=this.http.authedRequest(he.Get,"/preview_url",{url:e,ts:n.toString()},void 0,{prefix:Wg.V3,priority:"low"});return this.urlPreviewCache[i]=s,s}sendTyping(e,n,r){if(this.isGuest())return Promise.resolve({});var i=Pe("/rooms/$roomId/typing/$userId",{$roomId:e,$userId:this.getUserId()}),s={typing:n};return n&&(s.timeout=r||2e4),this.http.authedRequest(he.Put,i,void 0,s)}getRoomUpgradeHistory(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,i=this.getRoom(e);if(!i)return[];var s=this.findPredecessorRooms(i,n,r),o=this.findSuccessorRooms(i,n,r);return[...s,i,...o]}findPredecessorRooms(e,n,r){for(var i,s=[],o=new Set([e.roomId]),a=(i=e.findPredecessor(r))===null||i===void 0?void 0:i.roomId;a!==null;){var c;if(a){if(o.has(a))break;o.add(a)}var l=this.getRoom(a);if(l===null)break;if(n){var d=l.currentState.getStateEvents(Z.RoomTombstone,"");if(!d||d.getContent().replacement_room!==e.roomId)break}s.splice(0,0,l),e=l,a=(c=e.findPredecessor(r))===null||c===void 0?void 0:c.roomId}return s}findSuccessorRooms(e,n,r){for(var i=[],s=e.currentState.getStateEvents(Z.RoomTombstone,"");s;){var o=this.getRoom(s.getContent().replacement_room);if(!o||o.roomId===e.roomId)break;if(n){var a,c=(a=o.findPredecessor(r))===null||a===void 0?void 0:a.roomId;if(!c||c!==e.roomId)break}i.push(o);var l=new Set(i.map(d=>d.roomId));if(l.size<i.length)return i.slice(0,i.length-1);e=o,s=e.currentState.getStateEvents(Z.RoomTombstone,"")}return i}invite(e,n){var r=arguments,i=this;return B(function*(){var s=r.length>2&&r[2]!==void 0?r[2]:{};if(typeof s!="object"&&(s={reason:s}),s.shareEncryptedHistory){var o;yield(o=i.cryptoBackend)===null||o===void 0?void 0:o.shareRoomHistoryWithUser(e,n)}return yield i.membershipChange(e,n,Ve.Invite,s.reason)})()}inviteByEmail(e,n){return this.inviteByThreePid(e,"email",n)}inviteByThreePid(e,n,r){var i=this;return B(function*(){var s,o=Pe("/rooms/$roomId/invite",{$roomId:e}),a=i.getIdentityServerUrl(!0);if(!a)return Promise.reject(new In({error:"No supplied identity server URL",errcode:"ORG.MATRIX.JSSDK_MISSING_PARAM"}));var c={id_server:a,medium:n,address:r};if((s=i.identityServer)!==null&&s!==void 0&&s.getAccessToken){var l=yield i.identityServer.getAccessToken();l&&(c.id_access_token=l)}return i.http.authedRequest(he.Post,o,void 0,c)})()}leave(e){return this.membershipChange(e,void 0,Ve.Leave)}leaveRoomChain(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,r=this.getRoomUpgradeHistory(e,!0),i=r;if(!n){i=[];for(var s of r)if(i.push(s),s.roomId===e)break}var o={},a=[],c=d=>this.leave(d).then(()=>{delete o[d]}).catch(h=>{o[d]=h});for(var l of i)a.push(c(l.roomId));return Promise.all(a).then(()=>o)}ban(e,n,r){return this.membershipChange(e,n,Ve.Ban,r)}forget(e){var n=arguments,r=this;return B(function*(){var i=n.length>1&&n[1]!==void 0?n[1]:!0,s=Pe("/rooms/$room_id/forget",{$room_id:e}),o=yield r.http.authedRequest(he.Post,s);return i&&(r.store.removeRoom(e),r.emit(De.DeleteRoom,e)),o})()}unban(e,n){var r=Pe("/rooms/$roomId/unban",{$roomId:e}),i={user_id:n};return this.http.authedRequest(he.Post,r,void 0,i)}kick(e,n,r){var i=Pe("/rooms/$roomId/kick",{$roomId:e}),s={user_id:n,reason:r};return this.http.authedRequest(he.Post,i,void 0,s)}membershipChange(e,n,r,i){var s=Pe("/rooms/$room_id/$membership",{$room_id:e,$membership:r});return this.http.authedRequest(he.Post,s,void 0,{user_id:n,reason:i})}getPushActionsForEvent(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(!e.getPushActions()||n){var{actions:r,rule:i}=this.pushProcessor.actionsAndRuleForEvent(e);e.setPushDetails(r,i)}return e.getPushActions()}getPushDetailsForEvent(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(!e.getPushDetails()||n){var{actions:r,rule:i}=this.pushProcessor.actionsAndRuleForEvent(e);e.setPushDetails(r,i)}return e.getPushDetails()}setProfileInfo(e,n){var r=Pe("/profile/$userId/$info",{$userId:this.credentials.userId,$info:e});return this.http.authedRequest(he.Put,r,void 0,n)}setDisplayName(e){var n=this;return B(function*(){var r=yield n.setProfileInfo("displayname",{displayname:e}),i=n.getUser(n.getUserId());return i&&(i.displayName=e,i.emit(Xi.DisplayName,i.events.presence,i)),r})()}setAvatarUrl(e){var n=this;return B(function*(){var r=yield n.setProfileInfo("avatar_url",{avatar_url:e}),i=n.getUser(n.getUserId());return i&&(i.avatarUrl=e,i.emit(Xi.AvatarUrl,i.events.presence,i)),r})()}mxcUrlToHttp(e,n,r,i,s,o,a){return yT(this.baseUrl,e,n,r,i,s,o,a)}setSyncPresence(e){var n=this;return B(function*(){var r;(r=n.syncApi)===null||r===void 0||r.setPresence(e)})()}setPresence(e){var n=this;return B(function*(){var r=Pe("/presence/$userId/status",{$userId:n.credentials.userId}),i=["offline","online","unavailable"];if(i.indexOf(e.presence)===-1)throw new Error("Bad presence value: "+e.presence);yield n.http.authedRequest(he.Put,r,void 0,e)})()}getPresence(e){var n=Pe("/presence/$userId/status",{$userId:e});return this.http.authedRequest(he.Get,n)}scrollback(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:30,r=0,i=this.ongoingScrollbacks[e.roomId]||{};if(i.promise)return i.promise;if(i.errorTs){var s=Date.now()-i.errorTs;r=Math.max(X1e-s,0)}if(e.oldState.paginationToken===null)return Promise.resolve(e);var o=this.store.scrollback(e,n).length;if(o===n)return Promise.resolve(e);n=n-o;var a=new Promise((c,l)=>{Wp(r).then(()=>this.createMessagesRequest(e.roomId,e.oldState.paginationToken,n,Et.Backward)).then(d=>{var h,m,g=d.chunk.map(this.getEventMapper());if(d.state){var y=d.state.map(this.getEventMapper());e.currentState.setUnknownStateEvents(y)}var[v,E,w]=e.partitionThreadedEvents(g);this.processAggregatedTimelineEvents(e,v),e.addEventsToTimeline(v,!0,!0,e.getLiveTimeline()),this.processThreadEvents(e,E,!0),w.forEach(k=>e.relations.aggregateChildEvent(k)),e.oldState.paginationToken=(h=d.end)!==null&&h!==void 0?h:null,d.chunk.length===0&&(e.oldState.paginationToken=null),this.store.storeEvents(e,g,(m=d.end)!==null&&m!==void 0?m:null,!0),delete this.ongoingScrollbacks[e.roomId],c(e)}).catch(d=>{this.ongoingScrollbacks[e.roomId]={errorTs:Date.now()},l(d)})});return i={promise:a},this.ongoingScrollbacks[e.roomId]=i,a}getEventMapper(e){return P0e(this,e||{})}getEventContext(e,n){var r=this;return B(function*(){var i,s=Pe("/rooms/$roomId/context/$eventId",{$roomId:e,$eventId:n}),o={limit:"0"};(i=r.clientOpts)!==null&&i!==void 0&&i.lazyLoadMembers&&(o.filter=JSON.stringify(zo.LAZY_LOADING_MESSAGES_FILTER));var a=yield r.http.authedRequest(he.Get,s,o);if(a.event){var c,l,d;return{start:a.start,end:a.end,event:a.event,events_after:(c=a.events_after)!==null&&c!==void 0?c:[],events_before:(l=a.events_before)!==null&&l!==void 0?l:[],state:(d=a.state)!==null&&d!==void 0?d:[]}}throw new Error("'event' not in '/context' result - homeserver too old?")})()}getEventTimeline(e,n){var r=this;return B(function*(){var i,s,o;if(!r.timelineSupport)throw new Error("timeline support is disabled. Set the 'timelineSupport' parameter to true when creating MatrixClient to enable it.");if(!(e!=null&&e.room))throw new Error("getEventTimeline only supports room timelines");if(e.getTimelineForEvent(n))return e.getTimelineForEvent(n);if(e.thread&&r.supportsThreads()){var a;return(a=yield r.getThreadTimeline(e,n))!==null&&a!==void 0?a:null}var c=yield r.getEventContext(e.room.roomId,n);if(e.getTimelineForEvent(n))return e.getTimelineForEvent(n);var l=r.getEventMapper(),d=l(c.event);if(d.isRelation(Rn.name))return r.logger.warn("Tried loading a regular timeline at the position of a thread event"),null;var h=[...c.events_after.reverse().map(l),d,...c.events_before.map(l)],m=e.getTimelineForEvent(h[0].getId());if(m)m.getState(Fe.BACKWARDS).setUnknownStateEvents(c.state.map(l));else{var g;m=e.addTimeline(),m.initialiseState(c.state.map(l)),m.getState(Fe.FORWARDS).paginationToken=(g=c.end)!==null&&g!==void 0?g:null}var[y,v,E]=e.room.partitionThreadedEvents(h);return e.addEventsToTimeline(y,!0,!1,m,c.start),r.processThreadEvents(e.room,v,!0),r.processAggregatedTimelineEvents(e.room,y),E.forEach(w=>e.relations.aggregateChildEvent(w)),(i=(s=e.getTimelineForEvent(n))!==null&&s!==void 0?s:(o=e.room.findThreadForEvent(d))===null||o===void 0?void 0:o.liveTimeline)!==null&&i!==void 0?i:m})()}getThreadTimeline(e,n){var r=this;return B(function*(){if(!r.supportsThreads())throw new Error("could not get thread timeline: no client support");if(!e.room)throw new Error("could not get thread timeline: not a room timeline");if(!e.thread)throw new Error("could not get thread timeline: not a thread timeline");var i=yield r.getEventContext(e.room.roomId,n),s=r.getEventMapper(),o=s(i.event);if(e.canContain(o)){var a=r.canSupport.get(di.RelationsRecursion)!==ui.Unsupported;if($n.hasServerSideSupport)if($n.hasServerSideFwdPaginationSupport){var c,l,d;if(!e.thread)throw new Error("could not get thread timeline: not a thread timeline");var h=e.thread,m=yield r.fetchRelations(e.room.roomId,h.id,null,null,{dir:Et.Backward,from:i.start,recurse:a||void 0}),g=yield r.fetchRelations(e.room.roomId,h.id,null,null,{dir:Et.Forward,from:i.end,recurse:a||void 0}),y=[...g.chunk.reverse().filter(hx(h.id)).map(s),o,...m.chunk.filter(hx(h.id)).map(s)];for(var v of y){var E;yield(E=e.thread)===null||E===void 0?void 0:E.processEvent(v)}var w=e.getTimelineForEvent(o.getId());if(w?w.getState(Fe.BACKWARDS).setUnknownStateEvents(i.state.map(s)):(w=e.addTimeline(),w.initialiseState(i.state.map(s))),e.addEventsToTimeline(y,!0,!1,w,g.next_batch),!m.next_batch){var k=yield r.fetchRoomEvent(e.room.roomId,h.id);e.addEventsToTimeline([s(k)],!0,!1,w,null)}return w.setPaginationToken((c=m.next_batch)!==null&&c!==void 0?c:null,Et.Backward),w.setPaginationToken((l=g.next_batch)!==null&&l!==void 0?l:null,Et.Forward),r.processAggregatedTimelineEvents(e.room,y),(d=e.getTimelineForEvent(n))!==null&&d!==void 0?d:w}else{for(var x,C=e.thread,R=yield r.fetchRelations(e.room.roomId,C.id,Rn.name,null,{dir:Et.Backward,from:i.start,recurse:a||void 0}),T=[],M=i.end;M;){var O=yield r.fetchRelations(e.room.roomId,C.id,Rn.name,null,{dir:Et.Forward,from:M,recurse:a||void 0});M=O.next_batch,T.push(...O.chunk)}var P=[...T.reverse().map(s),o,...R.chunk.map(s)];for(var D of P){var j;yield(j=e.thread)===null||j===void 0?void 0:j.processEvent(D)}var $=e.getLiveTimeline();if($.getState(Fe.BACKWARDS).setUnknownStateEvents(i.state.map(s)),e.addEventsToTimeline(P,!0,!1,$,null),!R.next_batch){var q=yield r.fetchRoomEvent(e.room.roomId,C.id);e.addEventsToTimeline([s(q)],!0,!1,$,null)}return $.setPaginationToken((x=R.next_batch)!==null&&x!==void 0?x:null,Et.Backward),$.setPaginationToken(null,Et.Forward),r.processAggregatedTimelineEvents(e.room,P),$}}})()}getLatestTimeline(e){var n=this;return B(function*(){if(!n.timelineSupport)throw new Error("timeline support is disabled. Set the 'timelineSupport' parameter to true when creating MatrixClient to enable it.");if(!e.room)throw new Error("getLatestTimeline only supports room timelines");var r;if(e.threadListType!==null){var i,s=yield n.createThreadListMessagesRequest(e.room.roomId,null,1,Et.Backward,e.threadListType,e.getFilter());r=(i=s.chunk)===null||i===void 0?void 0:i[0]}else if(e.thread&&$n.hasServerSideSupport){var o,a=n.canSupport.get(di.RelationsRecursion)!==ui.Unsupported,c=yield n.fetchRelations(e.room.roomId,e.thread.id,Rn.name,null,{dir:Et.Backward,limit:1,recurse:a||void 0});r=(o=c.chunk)===null||o===void 0?void 0:o[0]}else{var l,d,h=Pe("/rooms/$roomId/messages",{$roomId:e.room.roomId}),m={dir:"b"};(l=n.clientOpts)!==null&&l!==void 0&&l.lazyLoadMembers&&(m.filter=JSON.stringify(zo.LAZY_LOADING_MESSAGES_FILTER));var g=yield n.http.authedRequest(he.Get,h,m);r=(d=g.chunk)===null||d===void 0?void 0:d[0]}if(!r)throw new Error("No message returned when trying to construct getLatestTimeline");return n.getEventTimeline(e,r.event_id)})()}createMessagesRequest(e,n){var r,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:30,s=arguments.length>3?arguments[3]:void 0,o=arguments.length>4?arguments[4]:void 0,a=Pe("/rooms/$roomId/messages",{$roomId:e}),c={limit:i.toString(),dir:s};n&&(c.from=n);var l=null;if((r=this.clientOpts)!==null&&r!==void 0&&r.lazyLoadMembers&&(l=Object.assign({},zo.LAZY_LOADING_MESSAGES_FILTER)),o){var d;l=l||{},Object.assign(l,(d=o.getRoomTimelineFilterComponent())===null||d===void 0?void 0:d.toJSON())}return l&&(c.filter=JSON.stringify(l)),this.http.authedRequest(he.Get,a,c)}createThreadListMessagesRequest(e,n){var r,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:30,s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:Et.Backward,o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:vc.All,a=arguments.length>5?arguments[5]:void 0,c=Pe("/rooms/$roomId/threads",{$roomId:e}),l={limit:i.toString(),dir:s,include:uQ(o)};n&&(l.from=n);var d={};if((r=this.clientOpts)!==null&&r!==void 0&&r.lazyLoadMembers&&(d=Yn({},zo.LAZY_LOADING_MESSAGES_FILTER)),a){var h;d=Yn(Yn({},d),(h=a.getRoomTimelineFilterComponent())===null||h===void 0?void 0:h.toJSON())}Object.keys(d).length&&(l.filter=JSON.stringify(d));var m={prefix:$n.hasServerSideListSupport===bs.Stable?hr.V1:"/_matrix/client/unstable/org.matrix.msc3856"};return this.http.authedRequest(he.Get,c,l,void 0,m).then(g=>{var y;return Yn(Yn({},g),{},{chunk:(y=g.chunk)===null||y===void 0?void 0:y.reverse(),start:g.prev_batch,end:g.next_batch})})}paginateEventTimeline(e,n){var r=this,i=e.getTimelineSet()===this.notifTimelineSet,s=this.getRoom(e.getRoomId()),o=e.getTimelineSet().threadListType,a=e.getTimelineSet().thread;n=n||{};var c=n.backwards||!1;if(i&&!c)throw new Error("paginateNotifTimeline can only paginate backwards");var l=c?Fe.BACKWARDS:Fe.FORWARDS,d=e.getPaginationToken(l),h=e.paginationRequests[l];if(h)return h;var m,g,y;if(i){var v;m="/notifications",g={limit:((v=n.limit)!==null&&v!==void 0?v:30).toString(),only:"highlight"},d&&d!=="end"&&(g.from=d),y=this.http.authedRequest(he.Get,m,g).then((function(){var C=B(function*(R){var T=R.next_token,M=[];R.notifications=R.notifications.filter(Ec);for(var O=0;O<R.notifications.length;O++){var P=R.notifications[O],D=r.getEventMapper()(P.event);r.getPushDetailsForEvent(D,!0),D.event.room_id=P.room_id,M[O]=D}var j=e.getTimelineSet();return j.addEventsToTimeline(M,c,!1,e,T),r.processAggregatedTimelineEvents(j.room,M),c&&!R.next_token&&e.setPaginationToken(null,l),!!R.next_token});return function(R){return C.apply(this,arguments)}})()).finally(()=>{e.paginationRequests[l]=null}),e.paginationRequests[l]=y}else if(o!==null){if(!s)throw new Error("Unknown room "+e.getRoomId());if(!$n.hasServerSideFwdPaginationSupport&&l===Et.Forward)throw new Error("Cannot paginate threads forwards without server-side support for MSC 3715");y=this.createThreadListMessagesRequest(e.getRoomId(),d,n.limit,l,o,e.getFilter()).then(C=>{if(C.state){var R=e.getState(l),T=C.state.filter(Ec).map(this.getEventMapper());R.setUnknownStateEvents(T)}var M=C.end,O=C.chunk.filter(Ec).map(this.getEventMapper()),P=e.getTimelineSet();return P.addEventsToTimeline(O,c,!1,e,M),this.processAggregatedTimelineEvents(s,O),this.processThreadRoots(s,O,c),c&&C.end==C.start&&e.setPaginationToken(null,l),C.end!==C.start}).finally(()=>{e.paginationRequests[l]=null}),e.paginationRequests[l]=y}else if(a){var E,w,k=this.getRoom((E=e.getRoomId())!==null&&E!==void 0?E:void 0);if(!k)throw new Error("Unknown room "+e.getRoomId());var x=this.canSupport.get(di.RelationsRecursion)!==ui.Unsupported;y=this.fetchRelations((w=e.getRoomId())!==null&&w!==void 0?w:"",a.id,null,null,{dir:l,limit:n.limit,from:d??void 0,recurse:x||void 0}).then((function(){var C=B(function*(R){var T=r.getEventMapper(),M=R.chunk.filter(Ec).filter(hx(a.id)).map(T);for(var O of M.slice().reverse()){yield a?.processEvent(O);var P=O.getSender();(!c||a?.getEventReadUpTo(P)===null)&&k.addLocalEchoReceipt(P,O,Ps.Read)}var D=R.next_batch,j=e.getTimelineSet();if(j.addEventsToTimeline(M,c,!1,e,D??null),!D&&c){var $,q,Y=($=a.rootEvent)!==null&&$!==void 0?$:T(yield r.fetchRoomEvent((q=e.getRoomId())!==null&&q!==void 0?q:"",a.id));j.addEventsToTimeline([Y],!0,!1,e,null)}return r.processAggregatedTimelineEvents(j.room,M),c&&!D&&e.setPaginationToken(null,l),!!D});return function(R){return C.apply(this,arguments)}})()).finally(()=>{e.paginationRequests[l]=null}),e.paginationRequests[l]=y}else{if(!s)throw new Error("Unknown room "+e.getRoomId());y=this.createMessagesRequest(e.getRoomId(),d,n.limit,l,e.getFilter()).then(C=>{if(C.state){var R=e.getState(l),T=C.state.filter(Ec).map(this.getEventMapper());R.setUnknownStateEvents(T)}var M=C.end,O=C.chunk.filter(Ec).map(this.getEventMapper()),P=e.getTimelineSet(),[D,,j]=s.partitionThreadedEvents(O);P.addEventsToTimeline(D,c,!1,e,M),this.processAggregatedTimelineEvents(s,D),this.processThreadRoots(s,D.filter(q=>q.getServerAggregatedRelation(Rn.name)),!1),j.forEach(q=>s.relations.aggregateChildEvent(q));var $=C.end===void 0||C.end===C.start;return c&&$&&e.setPaginationToken(null,l),!$}).finally(()=>{e.paginationRequests[l]=null}),e.paginationRequests[l]=y}return y}resetNotifTimelineSet(){this.notifTimelineSet&&this.notifTimelineSet.resetLiveTimeline("end")}peekInRoom(e){var n,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:20;return(n=this.peekSync)===null||n===void 0||n.stopPeeking(),this.peekSync=new yf(this,this.clientOpts,this.buildSyncApiOptions()),this.peekSync.peek(e,r)}stopPeeking(){this.peekSync&&(this.peekSync.stopPeeking(),this.peekSync=null)}setGuestAccess(e,n){var r=this.sendStateEvent(e,Z.RoomGuestAccess,{guest_access:n.allowJoin?LC.CanJoin:LC.Forbidden},""),i=Promise.resolve();return n.allowRead&&(i=this.sendStateEvent(e,Z.RoomHistoryVisibility,{history_visibility:gP.WorldReadable},"")),Promise.all([i,r]).then()}requestRegisterEmailToken(e,n,r,i){return this.requestTokenFromEndpoint("/register/email/requestToken",{email:e,client_secret:n,send_attempt:r,next_link:i})}requestRegisterMsisdnToken(e,n,r,i,s){return this.requestTokenFromEndpoint("/register/msisdn/requestToken",{country:e,phone_number:n,client_secret:r,send_attempt:i,next_link:s})}requestAdd3pidEmailToken(e,n,r,i){return this.requestTokenFromEndpoint("/account/3pid/email/requestToken",{email:e,client_secret:n,send_attempt:r,next_link:i})}requestAdd3pidMsisdnToken(e,n,r,i,s){return this.requestTokenFromEndpoint("/account/3pid/msisdn/requestToken",{country:e,phone_number:n,client_secret:r,send_attempt:i,next_link:s})}requestPasswordEmailToken(e,n,r,i){return this.requestTokenFromEndpoint("/account/password/email/requestToken",{email:e,client_secret:n,send_attempt:r,next_link:i})}requestPasswordMsisdnToken(e,n,r,i,s){return this.requestTokenFromEndpoint("/account/password/msisdn/requestToken",{country:e,phone_number:n,client_secret:r,send_attempt:i,next_link:s})}requestTokenFromEndpoint(e,n){var r=this;return B(function*(){var i=Object.assign({},n);return r.http.request(he.Post,e,void 0,i)})()}getRoomPushRule(e,n){if(this.pushRules){var r;return(r=this.pushRules[e])===null||r===void 0||(r=r.room)===null||r===void 0?void 0:r.find(i=>i.rule_id===n)}else throw new Error("SyncApi.sync() must be done before accessing to push rules.")}setRoomMutePushRule(e,n,r){var i,s=!1,o=this.getRoomPushRule(e,n);if(o!=null&&o.actions.includes(Rf.DontNotify)&&(s=!0),!r)s&&(i=this.deletePushRule(e,Mi.RoomSpecific,o.rule_id));else if(!o)i=this.addPushRule(e,Mi.RoomSpecific,n,{actions:[Rf.DontNotify]});else if(!s){var a=Promise.withResolvers();this.deletePushRule(e,Mi.RoomSpecific,o.rule_id).then(()=>{this.addPushRule(e,Mi.RoomSpecific,n,{actions:[Rf.DontNotify]}).then(()=>{a.resolve()}).catch(c=>{a.reject(c)})}).catch(c=>{a.reject(c)}),i=a.promise}if(i)return new Promise((c,l)=>{i.then(()=>{this.getPushRules().then(d=>{this.pushRules=d,c()}).catch(d=>{l(d)})}).catch(d=>{this.getPushRules().then(h=>{this.pushRules=h,l(d)}).catch(h=>{l(d)})})})}searchMessageText(e){var n={search_term:e.query};return"keys"in e&&(n.keys=e.keys),this.search({body:{search_categories:{room_events:n}}})}searchRoomEvents(e){var n={search_categories:{room_events:{search_term:e.term,filter:e.filter,order_by:$X.Recent,event_context:{before_limit:1,after_limit:1,include_profile:!0}}}},r={_query:n,results:[],highlights:[]};return this.search({body:n}).then(i=>this.processRoomEventsSearch(r,i))}backPaginateRoomEventsSearch(e){if(!e.next_batch)return Promise.reject(new Error("Cannot backpaginate event search any further"));if(e.pendingRequest)return e.pendingRequest;var n={body:e._query,next_batch:e.next_batch},r=this.search(n,e.abortSignal).then(i=>this.processRoomEventsSearch(e,i)).finally(()=>{e.pendingRequest=void 0});return e.pendingRequest=r,r}processRoomEventsSearch(e,n){var r,i,s=n.search_categories.room_events;e.count=s.count,e.next_batch=s.next_batch;var o=new Set(s.highlights);e.highlights.forEach(g=>{o.add(g)}),e.highlights=Array.from(o);for(var a=this.getEventMapper(),c=(r=(i=s.results)===null||i===void 0?void 0:i.length)!==null&&r!==void 0?r:0,l=0;l<c;l++){var d=TT.fromJson(s.results[l],a),h=this.getRoom(d.context.getEvent().getRoomId());if(h)for(var m of d.context.getTimeline())m.setMetadata(h.currentState,!1);e.results.push(d)}return e}syncLeftRooms(){if(this.syncedLeftRooms)return Promise.resolve([]);if(this.syncLeftRoomsPromise)return this.syncLeftRoomsPromise;var e=new yf(this,this.clientOpts,this.buildSyncApiOptions());return this.syncLeftRoomsPromise=e.syncLeftRooms(),this.syncLeftRoomsPromise.then(()=>{this.logger.debug("Marking success of sync left room request"),this.syncedLeftRooms=!0}).finally(()=>{this.syncLeftRoomsPromise=void 0}),this.syncLeftRoomsPromise}createFilter(e){var n=Pe("/user/$userId/filter",{$userId:this.credentials.userId});return this.http.authedRequest(he.Post,n,void 0,e).then(r=>{var i=zo.fromJson(this.credentials.userId,r.filter_id,e);return this.store.storeFilter(i),i})}getFilter(e,n,r){if(r){var i=this.store.getFilter(e,n);if(i)return Promise.resolve(i)}var s=Pe("/user/$userId/filter/$filterId",{$userId:e,$filterId:n});return this.http.authedRequest(he.Get,s).then(o=>{var a=zo.fromJson(e,n,o);return this.store.storeFilter(a),a})}getOrCreateFilter(e,n){var r=this;return B(function*(){var i=r.store.getFilterIdByName(e),s;if(i){try{var o=yield r.getFilter(r.credentials.userId,i,!0);if(o){var a=o.getDefinition(),c=n.getDefinition();kp(a,c)&&(s=i)}}catch(d){if(d.errcode!=="M_UNKNOWN"&&d.errcode!=="M_NOT_FOUND")throw d}s||r.store.setFilterIdByName(e,void 0)}if(s)return s;var l=yield r.createFilter(n.getDefinition());return r.store.setFilterIdByName(e,l.filterId),l.filterId})()}getOpenIdToken(){var e=Pe("/user/$userId/openid/request_token",{$userId:this.credentials.userId});return this.http.authedRequest(he.Post,e,void 0,{})}turnServer(){return this.http.authedRequest(he.Get,"/voip/turnServer")}getTurnServers(){return this.turnServers||[]}getTurnServersExpiry(){return this.turnServersExpiry}get pollingTurnServers(){return this.checkTurnServersIntervalID!==void 0}checkTurnServers(){var e=this;return B(function*(){if(e.supportsVoip()){var n=!1,r=e.turnServersExpiry-Date.now();if(r>MB)e.logger.debug("TURN creds are valid for another "+r+" ms: not fetching new ones."),n=!0;else{e.logger.debug("Fetching new TURN credentials");try{var i=yield e.turnServer();if(i.uris){e.logger.debug("Got TURN URIs: "+i.uris+" refresh in "+i.ttl+" secs");var s={urls:i.uris,username:i.username,credential:i.password};e.turnServers=[s],e.turnServersExpiry=Date.now()+i.ttl*1e3,n=!0,e.emit(De.TurnServers,e.turnServers)}}catch(o){e.logger.error("Failed to get TURN URIs",o),o.httpStatus===403?(e.logger.info("TURN access unavailable for this account: stopping credentials checks"),e.checkTurnServersIntervalID!==null&&globalThis.clearInterval(e.checkTurnServersIntervalID),e.checkTurnServersIntervalID=void 0,e.emit(De.TurnServersError,o,!0)):e.emit(De.TurnServersError,o,!1)}}return n}})()}setFallbackICEServerAllowed(e){this.fallbackICEServerAllowed=e}isFallbackICEServerAllowed(){return this.fallbackICEServerAllowed}isSynapseAdministrator(){var e=Pe("/_synapse/admin/v1/users/$userId/admin",{$userId:this.getUserId()});return this.http.authedRequest(he.Get,e,void 0,void 0,{prefix:""}).then(n=>n.admin)}whoisSynapseUser(e){var n=Pe("/_synapse/admin/v1/whois/$userId",{$userId:e});return this.http.authedRequest(he.Get,n,void 0,void 0,{prefix:""})}deactivateSynapseUser(e){var n=Pe("/_synapse/admin/v1/deactivate/$userId",{$userId:e});return this.http.authedRequest(he.Post,n,void 0,void 0,{prefix:""})}fetchClientWellKnown(){var e=this;return B(function*(){var n;e.clientWellKnownPromise=ht.getRawClientConfig((n=e.getDomain())!==null&&n!==void 0?n:void 0),e.clientWellKnown=yield e.clientWellKnownPromise,e.emit(De.ClientWellKnown,e.clientWellKnown)})()}getClientWellKnown(){return this.clientWellKnown}waitForClientWellKnown(){if(!this.clientRunning)throw new Error("Client is not running");return this.clientWellKnownPromise}storeClientOptions(){var e=["boolean","string","number"],n=Object.entries(this.clientOpts).filter(r=>{var[i,s]=r;return e.includes(typeof s)}).reduce((r,i)=>{var[s,o]=i;return r[s]=o,r},{});return this.store.storeClientOptions(n)}_unstable_getSharedRooms(e){var n=this;return B(function*(){var r=yield n.doesServerSupportUnstableFeature(iQ),i=yield n.doesServerSupportUnstableFeature(sQ),s=yield n.doesServerSupportUnstableFeature(oQ);if(!r&&!i&&!s)throw Error("Server does not support the Mutual Rooms API");var o,a;s?(o="/uk.half-shot.msc2666/user/mutual_rooms",a={user_id:e}):(o=Pe("/uk.half-shot.msc2666/user/".concat(i?"mutual_rooms":"shared_rooms","/$userId"),{$userId:e}),a={});var c=[],l=null;do{var d={};l!=null&&s&&(d.batch_token=l);var h=yield n.http.authedRequest(he.Get,o,Yn(Yn({},a),d),void 0,{prefix:hr.Unstable});c.push(...h.joined),h.next_batch_token!==void 0?l=h.next_batch_token:l=null}while(l!=null);return c})()}_unstable_getRTCTransports(){var e=this;return B(function*(){return(yield e.http.authedRequest(he.Get,"/rtc/transports",void 0,void 0,{prefix:"".concat(hr.Unstable,"/org.matrix.msc4143")})).rtc_transports})()}getVersions(){var e=this;return B(function*(){if(e.serverVersionsPromise)return e.serverVersionsPromise;e.serverVersionsPromise=e.http.authedRequest(he.Get,"/_matrix/client/versions",void 0,void 0,{prefix:""}).catch(r=>{throw e.serverVersionsPromise=void 0,r});var n=yield e.serverVersionsPromise;return e.canSupport=yield Nye(n),e.serverVersionsPromise})()}isVersionSupported(e){var n=this;return B(function*(){var{versions:r}=yield n.getVersions();return r&&r.includes(e)})()}doesServerSupportUnstableFeature(e){var n=this;return B(function*(){var r=yield n.getVersions();if(!r)return!1;var i=r.unstable_features;return i&&!!i[e]})()}doesServerForceEncryptionForPreset(e){var n=this;return B(function*(){var r=yield n.getVersions();if(!r)return!1;var i=r.unstable_features,s=e.includes("_chat")?e.substring(0,e.indexOf("_chat")):e;return i&&!!i["io.element.e2ee_forced.".concat(s)]})()}doesServerSupportThread(){var e=this;return B(function*(){if(yield e.isVersionSupported("v1.4"))return{threads:bs.Stable,list:bs.Stable,fwdPagination:bs.Stable};try{var[n,r,i,s,o,a]=yield Promise.all([e.doesServerSupportUnstableFeature("org.matrix.msc3440"),e.doesServerSupportUnstableFeature("org.matrix.msc3440.stable"),e.doesServerSupportUnstableFeature("org.matrix.msc3856"),e.doesServerSupportUnstableFeature("org.matrix.msc3856.stable"),e.doesServerSupportUnstableFeature("org.matrix.msc3715"),e.doesServerSupportUnstableFeature("org.matrix.msc3715.stable")]);return{threads:_E(r,n),list:_E(s,i),fwdPagination:_E(a,o)}}catch{return{threads:bs.None,list:bs.None,fwdPagination:bs.None}}})()}hasLazyLoadMembersEnabled(){var e;return!!((e=this.clientOpts)!==null&&e!==void 0&&e.lazyLoadMembers)}setCanResetTimelineCallback(e){this.canResetTimelineCallback=e}getCanResetTimelineCallback(){return this.canResetTimelineCallback}relations(e,n,r,i){var s=arguments,o=this;return B(function*(){var a,c,l=s.length>4&&s[4]!==void 0?s[4]:{dir:Et.Backward},d=i?o.getEncryptedIfNeededEventType(e,i):null,[h,m]=yield Promise.all([o.fetchRoomEvent(e,n),o.fetchRelations(e,n,r,d,l)]),g=o.getEventMapper(),y=h?g(h):void 0,v=m.chunk.map(g);if(d===Z.RoomMessageEncrypted){var E=y?v.concat(y):v;yield Promise.all(E.map(w=>o.decryptEventIfNeeded(w))),i!==null&&(v=v.filter(w=>w.getType()===i))}return y&&r===bn.Replace&&(v=v.filter(w=>w.getSender()===y.getSender())),{originalEvent:y??null,events:v,nextBatch:(a=m.next_batch)!==null&&a!==void 0?a:null,prevBatch:(c=m.prev_batch)!==null&&c!==void 0?c:null}})()}generateClientSecret(){return Qo(32)}decryptEventIfNeeded(e,n){return e.isState()&&!this.enableEncryptedStateEvents?Promise.resolve():(e.shouldAttemptDecryption()&&this.getCrypto()&&e.attemptDecryption(this.cryptoBackend,n),e.isBeingDecrypted()?e.getDecryptionPromise():Promise.resolve())}termsUrlForService(e,n){switch(e){case DA.IS:return this.http.getUrl("/terms",void 0,pu.V2,n);case DA.IM:return this.http.getUrl("/terms",void 0,"/_matrix/integrations/v1",n);default:throw new Error("Unsupported service type")}}getHomeserverUrl(){return this.baseUrl}getIdentityServerUrl(){var e,n,r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;return r&&((e=this.idBaseUrl)!==null&&e!==void 0&&e.startsWith("http://")||(n=this.idBaseUrl)!==null&&n!==void 0&&n.startsWith("https://"))?this.idBaseUrl.split("://")[1]:this.idBaseUrl}setIdentityServerUrl(e){this.idBaseUrl=QI(e),this.http.setIdBaseUrl(this.idBaseUrl)}getAccessToken(){return this.http.opts.accessToken||null}getRefreshToken(){var e;return(e=this.http.opts.refreshToken)!==null&&e!==void 0?e:null}setAccessToken(e){this.http.opts.accessToken=e,this.serverVersionsPromise=void 0}isLoggedIn(){return this.http.opts.accessToken!==void 0}makeTxnId(){return"m"+new Date().getTime()+"."+this.txnCtr++}isUsernameAvailable(e){return this.http.authedRequest(he.Get,"/register/available",{username:e}).then(n=>n.available).catch(n=>n.errcode==="M_USER_IN_USE"?!1:Promise.reject(n))}register(e,n,r,i,s,o,a){r&&(i.session=r);var c={auth:i,refresh_token:!0};return e!=null&&(c.username=e),n!=null&&(c.password=n),o!=null&&(c.guest_access_token=o),a!=null&&(c.inhibit_login=a),this.registerRequest(c)}registerGuest(){var{body:e}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return this.registerRequest(e||{},"guest")}registerRequest(e,n){var r={};return n&&(r.kind=n),this.http.request(he.Post,"/register",r,e)}refreshToken(e){var n=r=>this.http.authedRequest(he.Post,"/refresh",void 0,{refresh_token:e},{prefix:r,inhibitLogoutEmit:!0});return n(hr.V3).catch(r=>{if(r.errcode==="M_UNRECOGNIZED")return n(hr.V1);throw r})}loginFlows(){return this.http.request(he.Get,"/login")}login(e,n){return this.loginRequest(Yn(Yn({},n),{},{type:e})).then(r=>(r.access_token&&r.user_id&&(this.http.opts.accessToken=r.access_token,this.credentials={userId:r.user_id}),r))}loginWithPassword(e,n){return this.login("m.login.password",{user:e,password:n})}getCasLoginUrl(e){return this.getSsoLoginUrl(e,"cas")}getSsoLoginUrl(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"sso",r=arguments.length>2?arguments[2]:void 0,i=arguments.length>3?arguments[3]:void 0,s="/login/"+n+"/redirect";r&&(s+="/"+r);var o={redirectUrl:e,[LB.stable]:i,[LB.unstable]:i};return this.http.getUrl(s,o).href}loginWithToken(e){return this.login("m.login.token",{token:e})}loginRequest(e){var n=this;return B(function*(){return yield n.http.authedRequest(he.Post,"/login",void 0,e)})()}logout(){var e=arguments,n=this;return B(function*(){var r=e.length>0&&e[0]!==void 0?e[0]:!1;return r&&(n.stopClient(),n.http.abort()),n.http.authedRequest(he.Post,"/logout")})()}deactivateAccount(e,n){var r={};return e&&(r.auth=e),n!==void 0&&(r.erase=n),this.http.authedRequest(he.Post,"/account/deactivate",void 0,r)}requestLoginToken(e){var n=this;return B(function*(){var r={auth:e};return n.http.authedRequest(he.Post,"/login/get_token",void 0,r,{prefix:hr.V1})})()}getFallbackAuthUrl(e,n){var r=Pe("/auth/$loginType/fallback/web",{$loginType:e});return this.http.getUrl(r,{session:n}).href}createRoom(e){var n=this;return B(function*(){var r,i=(e.invite_3pid||[]).filter(a=>!a.id_access_token);if(i.length>0&&(r=n.identityServer)!==null&&r!==void 0&&r.getAccessToken){var s=yield n.identityServer.getAccessToken();if(s)for(var o of i)o.id_access_token=s}return n.http.authedRequest(he.Post,"/createRoom",void 0,e)})()}fetchRelations(e,n,r,i){var s=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{dir:Et.Backward},o=s;$n.hasServerSideFwdPaginationSupport===bs.Experimental&&(o=t$("dir","org.matrix.msc3715.dir",o)),this.canSupport.get(di.RelationsRecursion)===ui.Unstable&&(o=t$("recurse","org.matrix.msc3981.recurse",o));var a=dA(o),c="/rooms/$roomId/relations/$eventId";r!==null?(c+="/$relationType",i!==null&&(c+="/$eventType")):i!==null&&(this.logger.warn("eventType: ".concat(i,` ignored when fetching
25
25
  relations as relationType is null`)),i=null);var l=Pe(c+"?"+a,{$roomId:e,$eventId:n,$relationType:r,$eventType:i});return this.http.authedRequest(he.Get,l,void 0,void 0,{prefix:hr.V1})}roomState(e){var n=Pe("/rooms/$roomId/state",{$roomId:e});return this.http.authedRequest(he.Get,n)}fetchRoomEvent(e,n){var r=Pe("/rooms/$roomId/event/$eventId",{$roomId:e,$eventId:n});return this.http.authedRequest(he.Get,r)}members(e,n,r,i){var s={};n&&(s.membership=n),r&&(s.not_membership=r),i&&(s.at=i);var o=dA(s),a=Pe("/rooms/$roomId/members?"+o,{$roomId:e});return this.http.authedRequest(he.Get,a)}upgradeRoom(e,n,r){var i=Pe("/rooms/$roomId/upgrade",{$roomId:e});return this.http.authedRequest(he.Post,i,void 0,{new_version:n,additional_creators:r})}getStateEvent(e,n,r){var i={$roomId:e,$eventType:n,$stateKey:r},s=Pe("/rooms/$roomId/state/$eventType",i);return r!==void 0&&(s=Pe(s+"/$stateKey",i)),this.http.authedRequest(he.Get,s)}sendStateEvent(e,n,r){var i=arguments,s=this;return B(function*(){var o=i.length>3&&i[3]!==void 0?i[3]:"",a=i.length>4&&i[4]!==void 0?i[4]:{},c=s.getRoom(e),l=new ns({room_id:e,type:n,state_key:o,content:r});yield s.encryptStateEventIfNeeded(l,c??void 0);var d={$roomId:e,$eventType:l.getWireType(),$stateKey:l.getWireStateKey()},h=Pe("/rooms/$roomId/state/$eventType",d);return o!==void 0&&(h=Pe(h+"/$stateKey",d)),s.http.authedRequest(he.Put,h,void 0,l.getWireContent(),a)})()}encryptStateEventIfNeeded(e,n){var r=this;return B(function*(){if(r.enableEncryptedStateEvents&&n&&!(!r.cryptoBackend&&r.usingExternalCrypto)){if(!r.cryptoBackend)throw new Error("This room is configured to use encryption, but your client does not support encryption.");(yield r.shouldEncryptEventForRoom(e,n))&&(yield r.cryptoBackend.isStateEncryptionEnabledInRoom(n.roomId))&&(["m.room.create","m.room.member","m.room.join_rules","m.room.power_levels","m.room.third_party_invite","m.room.history_visibility","m.room.guest_access","m.room.encryption"].includes(e.getType())||(yield r.cryptoBackend.encryptEvent(e,n)))}})()}roomInitialSync(e,n){var r,i=Pe("/rooms/$roomId/initialSync",{$roomId:e});return this.http.authedRequest(he.Get,i,{limit:(r=n?.toString())!==null&&r!==void 0?r:"30"})}setRoomReadMarkersHttpRequest(e,n,r,i){var s=this;return B(function*(){var o=Pe("/rooms/$roomId/read_markers",{$roomId:e}),a={[Ps.FullyRead]:n,[Ps.Read]:r};return((yield s.doesServerSupportUnstableFeature("org.matrix.msc2285.stable"))||(yield s.isVersionSupported("v1.4")))&&(a[Ps.ReadPrivate]=i),s.http.authedRequest(he.Post,o,void 0,a)})()}getJoinedRooms(){var e=Pe("/joined_rooms",{});return this.http.authedRequest(he.Get,e)}getJoinedRoomMembers(e){var n=Pe("/rooms/$roomId/joined_members",{$roomId:e});return this.http.authedRequest(he.Get,n)}publicRooms(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},{server:n,limit:r,since:i}=e,s=Kve(e,J1e);if(Object.keys(s).length===0){var o={server:n,limit:r,since:i};return this.http.authedRequest(he.Get,"/publicRooms",o)}else{var a={server:n},c=Yn({limit:r,since:i},s);return this.http.authedRequest(he.Post,"/publicRooms",a,c)}}createAlias(e,n){var r=Pe("/directory/room/$alias",{$alias:e}),i={room_id:n};return this.http.authedRequest(he.Put,r,void 0,i)}deleteAlias(e){var n=Pe("/directory/room/$alias",{$alias:e});return this.http.authedRequest(he.Delete,n)}getLocalAliases(e){var n=Pe("/rooms/$roomId/aliases",{$roomId:e}),r=hr.V3;return this.http.authedRequest(he.Get,n,void 0,void 0,{prefix:r})}getRoomIdForAlias(e){var n=Pe("/directory/room/$alias",{$alias:e});return this.http.authedRequest(he.Get,n)}getRoomDirectoryVisibility(e){var n=Pe("/directory/list/room/$roomId",{$roomId:e});return this.http.authedRequest(he.Get,n)}setRoomDirectoryVisibility(e,n){var r=Pe("/directory/list/room/$roomId",{$roomId:e});return this.http.authedRequest(he.Put,r,void 0,{visibility:n})}searchUserDirectory(e){var{term:n,limit:r}=e,i={search_term:n};return r!==void 0&&(i.limit=r),this.http.authedRequest(he.Post,"/user_directory/search",void 0,i)}uploadContent(e,n){return this.http.uploadContent(e,n)}cancelUpload(e){return this.http.cancelUpload(e)}getCurrentUploads(){return this.http.getCurrentUploads()}getProfileInfo(e,n){var r=n?Pe("/profile/$userId/$info",{$userId:e,$info:n}):Pe("/profile/$userId",{$userId:e});return this.http.authedRequest(he.Get,r)}doesServerSupportExtendedProfiles(){var e=this;return B(function*(){return(yield e.isVersionSupported("v1.16"))||(yield e.doesServerSupportUnstableFeature(aQ))||(yield e.doesServerSupportUnstableFeature(cQ))})()}getExtendedProfileRequestPrefix(){var e=this;return B(function*(){return(yield e.isVersionSupported("v1.16"))||(yield e.doesServerSupportUnstableFeature("uk.tcpip.msc4133.stable"))?hr.V3:"/_matrix/client/unstable/uk.tcpip.msc4133"})()}getExtendedProfile(e){var n=this;return B(function*(){if(!(yield n.doesServerSupportExtendedProfiles()))throw new Error("Server does not support extended profiles");return n.http.authedRequest(he.Get,Pe("/profile/$userId",{$userId:e}),void 0,void 0,{prefix:yield n.getExtendedProfileRequestPrefix()})})()}getExtendedProfileProperty(e,n){var r=this;return B(function*(){if(!(yield r.doesServerSupportExtendedProfiles()))throw new Error("Server does not support extended profiles");var i=yield r.http.authedRequest(he.Get,Pe("/profile/$userId/$key",{$userId:e,$key:n}),void 0,void 0,{prefix:yield r.getExtendedProfileRequestPrefix()});return i[n]})()}setExtendedProfileProperty(e,n){var r=this;return B(function*(){if(!(yield r.doesServerSupportExtendedProfiles()))throw new Error("Server does not support extended profiles");var i=r.getUserId();yield r.http.authedRequest(he.Put,Pe("/profile/$userId/$key",{$userId:i,$key:e}),void 0,{[e]:n},{prefix:yield r.getExtendedProfileRequestPrefix()})})()}deleteExtendedProfileProperty(e){var n=this;return B(function*(){if(!(yield n.doesServerSupportExtendedProfiles()))throw new Error("Server does not support extended profiles");var r=n.getUserId();yield n.http.authedRequest(he.Delete,Pe("/profile/$userId/$key",{$userId:r,$key:e}),void 0,void 0,{prefix:yield n.getExtendedProfileRequestPrefix()})})()}patchExtendedProfile(e){var n=this;return B(function*(){if(!(yield n.doesServerSupportExtendedProfiles()))throw new Error("Server does not support extended profiles");var r=n.getUserId();return n.http.authedRequest(he.Patch,Pe("/profile/$userId",{$userId:r}),{},e,{prefix:yield n.getExtendedProfileRequestPrefix()})})()}setExtendedProfile(e){var n=this;return B(function*(){if(!(yield n.doesServerSupportExtendedProfiles()))throw new Error("Server does not support extended profiles");var r=n.getUserId();yield n.http.authedRequest(he.Put,Pe("/profile/$userId",{$userId:r}),{},e,{prefix:yield n.getExtendedProfileRequestPrefix()})})()}getThreePids(){return this.http.authedRequest(he.Get,"/account/3pid")}addThreePidOnly(e){var n=this;return B(function*(){var r="/account/3pid/add";return n.http.authedRequest(he.Post,r,void 0,e)})()}bindThreePid(e){var n=this;return B(function*(){var r="/account/3pid/bind";return n.http.authedRequest(he.Post,r,void 0,e)})()}unbindThreePid(e,n){var r=this;return B(function*(){var i="/account/3pid/unbind",s={medium:e,address:n,id_server:r.getIdentityServerUrl(!0)};return r.http.authedRequest(he.Post,i,void 0,s)})()}deleteThreePid(e,n){var r="/account/3pid/delete";return this.http.authedRequest(he.Post,r,void 0,{medium:e,address:n})}setPassword(e,n,r){var i="/account/password",s={auth:e,new_password:n,logout_devices:r};return this.http.authedRequest(he.Post,i,void 0,s)}getDevices(){return this.http.authedRequest(he.Get,"/devices")}getDevice(e){var n=Pe("/devices/$device_id",{$device_id:e});return this.http.authedRequest(he.Get,n)}setDeviceDetails(e,n){var r=Pe("/devices/$device_id",{$device_id:e});return this.http.authedRequest(he.Put,r,void 0,n)}deleteDevice(e,n){var r=Pe("/devices/$device_id",{$device_id:e}),i={};return n&&(i.auth=n),this.http.authedRequest(he.Delete,r,void 0,i)}deleteMultipleDevices(e,n){var r={devices:e};n&&(r.auth=n);var i="/delete_devices";return this.http.authedRequest(he.Post,i,void 0,r)}getPushers(){var e=this;return B(function*(){var n=yield e.http.authedRequest(he.Get,"/pushers");return(yield e.doesServerSupportUnstableFeature("org.matrix.msc3881"))||(n.pushers=n.pushers.map(r=>(r.hasOwnProperty(SA.name)||(r[SA.name]=!0),r))),n})()}setPusher(e){var n="/pushers/set";return this.http.authedRequest(he.Post,n,void 0,e)}removePusher(e,n){var r="/pushers/set",i={pushkey:e,app_id:n,kind:null};return this.http.authedRequest(he.Post,r,void 0,i)}setLocalNotificationSettings(e,n){var r="".concat(VJ.name,".").concat(e);return this.setAccountData(r,n)}getPushRules(){return this.http.authedRequest(he.Get,"/pushrules/").then(e=>(this.setPushRules(e),this.pushRules))}setPushRules(e){this.pushRules=_c.rewriteDefaultRules(this.logger,e,this.getUserId()),this.pushProcessor.updateCachedPushRuleKeys(this.pushRules)}addPushRule(e,n,r,i){var s=Pe("/pushrules/"+e+"/$kind/$ruleId",{$kind:n,$ruleId:r});return this.http.authedRequest(he.Put,s,void 0,i)}deletePushRule(e,n,r){var i=Pe("/pushrules/"+e+"/$kind/$ruleId",{$kind:n,$ruleId:r});return this.http.authedRequest(he.Delete,i)}setPushRuleEnabled(e,n,r,i){var s=Pe("/pushrules/"+e+"/$kind/$ruleId/enabled",{$kind:n,$ruleId:r});return this.http.authedRequest(he.Put,s,void 0,{enabled:i})}setPushRuleActions(e,n,r,i){var s=Pe("/pushrules/"+e+"/$kind/$ruleId/actions",{$kind:n,$ruleId:r});return this.http.authedRequest(he.Put,s,void 0,{actions:i})}search(e,n){var{body:r,next_batch:i}=e,s={};return i&&(s.next_batch=i),this.http.authedRequest(he.Post,"/search",s,r,{abortSignal:n})}uploadKeysRequest(e,n){return this.http.authedRequest(he.Post,"/keys/upload",void 0,e)}uploadKeySignatures(e){return this.http.authedRequest(he.Post,"/keys/signatures/upload",void 0,e)}downloadKeysForUsers(e){var{token:n}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r={device_keys:{}};return n!==void 0&&(r.token=n),e.forEach(i=>{r.device_keys[i]=[]}),this.http.authedRequest(he.Post,"/keys/query",void 0,r)}claimOneTimeKeys(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"signed_curve25519",r=arguments.length>2?arguments[2]:void 0,i={};n===void 0&&(n="signed_curve25519");for(var[s,o]of e){var a=i[s]||{};CC(i,s,a),CC(a,o,n)}var c={one_time_keys:i};r&&(c.timeout=r);var l="/keys/claim";return this.http.authedRequest(he.Post,l,void 0,c)}getKeyChanges(e,n){var r={from:e,to:n};return this.http.authedRequest(he.Get,"/keys/changes",r)}uploadDeviceSigningKeys(e,n){var r=Object.assign({},n);return e&&Object.assign(r,{auth:e}),this.http.authedRequest(he.Post,"/keys/device_signing/upload",void 0,r,{prefix:hr.Unstable})}registerWithIdentityServer(e){if(!this.idBaseUrl)throw new Error("No identity server base URL set");var n=this.http.getUrl("/account/register",void 0,pu.V2,this.idBaseUrl);return this.http.requestOtherUrl(he.Post,n,e)}requestEmailToken(e,n,r,i,s){var o={client_secret:n,email:e,send_attempt:r?.toString()};return i&&(o.next_link=i),this.http.idServerRequest(he.Post,"/validate/email/requestToken",o,pu.V2,s)}requestMsisdnToken(e,n,r,i,s,o){var a={client_secret:r,country:e,phone_number:n,send_attempt:i?.toString()};return s&&(a.next_link=s),this.http.idServerRequest(he.Post,"/validate/msisdn/requestToken",a,pu.V2,o)}submitMsisdnToken(e,n,r,i){var s={sid:e,client_secret:n,token:r};return this.http.idServerRequest(he.Post,"/validate/msisdn/submitToken",s,pu.V2,i??void 0)}submitMsisdnTokenOtherUrl(e,n,r,i){var s={sid:n,client_secret:r,token:i};return this.http.requestOtherUrl(he.Post,e,s)}getIdentityHashDetails(e){return this.http.idServerRequest(he.Get,"/hash_details",void 0,pu.V2,e)}identityHashedLookup(e,n){var r=this;return B(function*(){var i={},s=yield r.getIdentityHashDetails(n);if(!s||!s.lookup_pepper||!s.algorithms)throw new Error("Unsupported identity server: bad response");i.pepper=s.lookup_pepper;var o={};if(s.algorithms.includes("sha256"))i.addresses=yield Promise.all(e.map((function(){var m=B(function*(g){var y=g[0].toLowerCase(),v=g[1].toLowerCase(),E=yield yP("".concat(y," ").concat(v," ").concat(i.pepper)),w=ET(E);return o[w]=g[0],w});return function(g){return m.apply(this,arguments)}})())),i.algorithm="sha256";else if(s.algorithms.includes("none"))i.addresses=e.map(m=>{var g=m[0].toLowerCase(),y=m[1].toLowerCase(),v="".concat(g," ").concat(y);return o[v]=m[0],v}),i.algorithm="none";else throw new Error("Unsupported identity server: unknown hash algorithm");var a=yield r.http.idServerRequest(he.Post,"/lookup",i,pu.V2,n);if(!(a!=null&&a.mappings))return[];var c=[];for(var l of Object.keys(a.mappings)){var d=a.mappings[l],h=o[l];if(!h)throw new Error("Identity server returned more results than expected");c.push({address:h,mxid:d})}return c})()}lookupThreePid(e,n,r){var i=this;return B(function*(){var s=yield i.identityHashedLookup([[n,e]],r),o=s.find(c=>c.address===n);if(!o)return{};var a={address:n,medium:e,mxid:o.mxid};return a})()}bulkLookupThreePids(e,n){var r=this;return B(function*(){var i=yield r.identityHashedLookup(e.map(c=>[c[1],c[0]]),n),s=[],o=function*(l){var d=e.find(h=>h[1]===l.address);if(!d)throw new Error("Identity sever returned unexpected results");s.push([d[0],l.address,l.mxid])};for(var a of i)yield*o(a);return{threepids:s}})()}getIdentityAccount(e){return this.http.idServerRequest(he.Get,"/account",void 0,pu.V2,e)}sendToDevice(e,n,r){var i=Pe("/sendToDevice/$eventType/$txnId",{$eventType:e,$txnId:r||this.makeTxnId()}),s={messages:ip(n)},o=new Map;for(var[a,c]of n)o.set(a,Array.from(c.keys()));return this.logger.debug("PUT ".concat(i),o),this.http.authedRequest(he.Put,i,void 0,s)}encryptAndSendToDevice(e,n,r){var i=this;return B(function*(){if(!i.cryptoBackend)throw new Error("Cannot encrypt to device event, your client does not support encryption.");var s=yield i.cryptoBackend.encryptToDeviceMessages(e,n,r);yield i.queueToDevice(s)})()}queueToDevice(e){return this.toDeviceMessageQueue.queueBatch(e)}getThirdpartyProtocols(){return this.http.authedRequest(he.Get,"/thirdparty/protocols").then(e=>{if(!e||typeof e!="object")throw new Error("/thirdparty/protocols did not return an object: ".concat(e));return e})}getThirdpartyLocation(e,n){var r=Pe("/thirdparty/location/$protocol",{$protocol:e});return this.http.authedRequest(he.Get,r,n)}getThirdpartyUser(e,n){var r=Pe("/thirdparty/user/$protocol",{$protocol:e});return this.http.authedRequest(he.Get,r,n)}getTerms(e,n){var r=this.termsUrlForService(e,n);return this.http.requestOtherUrl(he.Get,r)}agreeToTerms(e,n,r,i){var s=this.termsUrlForService(e,n),o={Authorization:"Bearer "+r};return this.http.requestOtherUrl(he.Post,s,{user_accepts:i},{headers:o})}reportEvent(e,n,r,i){var s=Pe("/rooms/$roomId/report/$eventId",{$roomId:e,$eventId:n});return this.http.authedRequest(he.Post,s,void 0,{score:r,reason:i})}reportRoom(e,n){var r=Pe("/rooms/$roomId/report",{$roomId:e});return this.http.authedRequest(he.Post,r,void 0,{reason:n})}getRoomHierarchy(e,n,r){var i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1,s=arguments.length>4?arguments[4]:void 0,o=Pe("/rooms/$roomId/hierarchy",{$roomId:e}),a={suggested_only:String(i),max_depth:r?.toString(),from:s,limit:n?.toString()};return this.http.authedRequest(he.Get,o,a,void 0,{prefix:hr.V1}).catch(c=>{if(c.errcode==="M_UNRECOGNIZED")return this.http.authedRequest(he.Get,o,a,void 0,{prefix:"/_matrix/client/unstable/org.matrix.msc2946"});throw c})}unstableCreateFileTree(e){var n=this;return B(function*(){var{room_id:r}=yield n.createRoom({name:e,preset:RT.PrivateChat,power_level_content_override:Yn(Yn({},D0e),{},{users:{[n.getUserId()]:100}}),creation_content:{[TC]:zg.Space},initial_state:[{type:vA.name,state_key:bA.name,content:{[yA.name]:!0}},{type:Z.RoomEncryption,state_key:"",content:{algorithm:"m.megolm.v1.aes-sha2"}}]});return new vB(n,r)})()}unstableGetFileTreeSpace(e){var n,r,i=this.getRoom(e);if(i?.getMyMembership()!==Ve.Join)return null;var s=i.currentState.getStateEvents(Z.RoomCreate,""),o=i.currentState.getStateEvents(vA.name,bA.name);if(!s)throw new Error("Expected single room create event");return!(o!=null&&(n=o.getContent())!==null&&n!==void 0&&n[yA.name])||((r=s.getContent())===null||r===void 0?void 0:r[TC])!==zg.Space?null:new vB(this,e)}slidingSync(e,n,r){var i={};e.pos&&(i.pos=e.pos,delete e.pos),e.timeout&&(i.timeout=e.timeout,delete e.timeout);var s=e.clientTimeout;return delete e.clientTimeout,this.http.authedRequest(he.Post,"/sync",i,e,{prefix:"/_matrix/client/unstable/org.matrix.simplified_msc3575",baseUrl:n,localTimeoutMs:s,abortSignal:r})}supportsThreads(){var e;return((e=this.clientOpts)===null||e===void 0?void 0:e.threadSupport)||!1}supportsIntentionalMentions(){return this.canSupport.get(di.IntentionalMentions)!==ui.Unsupported}getRoomSummary(e,n){var r=this;return B(function*(){var i={prefix:"/_matrix/client/unstable/im.nheko.summary"};try{var s=Pe("/summary/$roomid",{$roomid:e});return yield r.http.authedRequest(he.Get,s,{via:n},void 0,i)}catch(a){if(a instanceof In&&a.errcode==="M_UNRECOGNIZED"){var o=Pe("/rooms/$roomid/summary",{$roomid:e});return yield r.http.authedRequest(he.Get,o,{via:n},void 0,i)}else throw a}})()}processThreadEvents(e,n,r){e.processThreadedEvents(n,r)}processThreadRoots(e,n,r){this.supportsThreads()&&e.processThreadRoots(n,r)}processBeaconEvents(e,n){this.processAggregatedTimelineEvents(e,n)}processAggregatedTimelineEvents(e,n){n!=null&&n.length&&e&&(e.currentState.processBeaconEvents(n,this),e.processPollEvents(n))}whoami(){var e=this;return B(function*(){return e.http.authedRequest(he.Get,"/account/whoami")})()}timestampToEvent(e,n,r){var i=this;return B(function*(){var s=Pe("/rooms/$roomId/timestamp_to_event",{$roomId:e}),o={ts:n.toString(),dir:r};try{return yield i.http.authedRequest(he.Get,s,o,void 0,{prefix:hr.V1})}catch(a){if(a.errcode==="M_UNRECOGNIZED"&&(a.httpStatus===400||a.httpStatus===404||a.httpStatus===405))return yield i.http.authedRequest(he.Get,s,o,void 0,{prefix:"/_matrix/client/unstable/org.matrix.msc3030"});throw a}})()}getAuthMetadata(){var e=this;return B(function*(){var n;try{var r=yield e.isVersionSupported("v1.15");n=yield e.http.request(he.Get,"/auth_metadata",void 0,void 0,{prefix:r?hr.V1:hr.Unstable+"/org.matrix.msc2965"})}catch(s){if(s instanceof In&&s.errcode==="M_UNRECOGNIZED"){var{issuer:i}=yield e.http.request(he.Get,"/auth_issuer",void 0,void 0,{prefix:hr.Unstable+"/org.matrix.msc2965"});return TP(i)}throw s}return RP(n)})()}}L(MT,"RESTORE_BACKUP_ERROR_BAD_KEY","RESTORE_BACKUP_ERROR_BAD_KEY");function OB(t){return Object.fromEntries(Object.entries(t).map(e=>{var[n,r]=e;return["".concat(Qi,".").concat(n),r]}))}function lQ(t,e){var n,r=t.getUserId(),i=e.getId(),s=t.getRoom(e.getRoomId());if(!(!s||!r||!i)){if(!s.findEventById(i)){N.info("Decrypted event ".concat(e.getId()," is not in room ").concat(s.roomId,": ignoring"));return}var o=!!e.threadRootId&&!e.isThreadRoot,a;if(o){var c=s.getThread(e.threadRootId);a=c?c.hasUserReadEvent(r,i):!0}else a=s.hasUserReadEvent(r,i);if(!a){var l=t.getPushActionsForEvent(e,!0),d=!!(l!=null&&(n=l.tweaks)!==null&&n!==void 0&&n.highlight);if(d){var h=s.getUnreadCountForEventContext(sn.Highlight,e)+1;o?s.setThreadUnreadNotificationCount(e.threadRootId,sn.Highlight,h):s.setUnreadNotificationCount(sn.Highlight,h)}var m=!!(l!=null&&l.notify);if(m){var g=s.getUnreadCountForEventContext(sn.Total,e)+1;o?s.setThreadUnreadNotificationCount(e.threadRootId,sn.Total,g):s.setUnreadNotificationCount(sn.Total,g)}}}}function kv(t){return Hb(t)?j_:t.threadRootId}function Hb(t){if(!t.threadRootId||t.isThreadRoot)return!0;if(!t.isRelation())return N.warn("Event is not a relation or a thread root, but still has a threadRootId! id=".concat(t.getId())),!0;if(t.isRelation(Rn.name))return!1;var e=t.relationEventId===t.threadRootId;return e}function PB(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function DB(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?PB(Object(n),!0).forEach(function(r){L(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):PB(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}var Ds=(function(t){return t.New="Thread.new",t.Update="Thread.update",t.NewReply="Thread.newReply",t.ViewThread="Thread.viewThread",t.Delete="Thread.delete",t})({}),bs=(function(t){return t[t.None=0]="None",t[t.Experimental=1]="Experimental",t[t.Stable=2]="Stable",t})({});function _E(t,e){return t?bs.Stable:e?bs.Experimental:bs.None}class $n extends gX{constructor(e,n,r){var i,s;if(super(),i=this,this.id=e,this.rootEvent=n,L(this,"timelineSet",void 0),L(this,"_currentUserParticipated",!1),L(this,"reEmitter",void 0),L(this,"lastEvent",void 0),L(this,"replyCount",0),L(this,"lastPendingEvent",void 0),L(this,"pendingReplyCount",0),L(this,"room",void 0),L(this,"client",void 0),L(this,"pendingEventOrdering",void 0),L(this,"processRootEventPromise",void 0),L(this,"initialEventsFetched",!$n.hasServerSideSupport),L(this,"initalEventFetchProm",void 0),L(this,"replayEvents",[]),L(this,"onTimelineReset",B(function*(){yield i.processRootEventPromise,i.processRootEventPromise=void 0})),L(this,"onBeforeRedaction",(o,a)=>{o!=null&&o.isRelation(Rn.name)&&this.room.eventShouldLiveIn(o).threadId===this.id&&o.getId()!==this.id&&!a.status&&(this.replyCount--,this.updatePendingReplyCount(),this.emit(Ds.Update,this))}),L(this,"onRedaction",(function(){var o=B(function*(a,c,l){if(l===i.id)if(i.replyCount<=0){for(var d of i.timeline)i.clearEventMetadata(d);i.lastEvent=i.rootEvent,i._currentUserParticipated=!1,i.emit(Ds.Delete,i)}else{var h;((h=i.lastEvent)===null||h===void 0?void 0:h.getId())===a.getAssociatedId()&&(yield i.processRootEventPromise,i.processRootEventPromise=void 0),yield i.updateThreadMetadata()}});return function(a,c,l){return o.apply(this,arguments)}})()),L(this,"onTimelineEvent",(o,a,c)=>{if(!c){var l=o.getSender();l&&a&&this.shouldSendLocalEchoReceipt(l,o)&&a.addLocalEchoReceipt(l,o,Ps.Read),o.getId()!==this.id&&o.isRelation(Rn.name)&&this.replyCount++}this.onEcho(o,c??!1)}),L(this,"onLocalEcho",o=>{this.onEcho(o,!1)}),L(this,"onEcho",(function(){var o=B(function*(a,c){a.threadRootId===i.id&&i.lastEvent!==a&&(yield i.updateThreadMetadata(),a.isRelation(Rn.name)&&(c||(i.lastEvent=void 0,i.emit(Ds.NewReply,i,a))))});return function(a,c){return o.apply(this,arguments)}})()),this.setMaxListeners(1e3),!(r!=null&&r.room))throw new Error("element-web#22141: A thread requires a room in order to function");this.room=r.room,this.client=r.client,this.pendingEventOrdering=(s=r.pendingEventOrdering)!==null&&s!==void 0?s:Rv.Chronological,this.timelineSet=new Ng(this.room,{timelineSupport:!0,pendingEvents:!0},this.client,this),this.reEmitter=new ly(this),this.reEmitter.reEmit(this.timelineSet,[Oe.Timeline,Oe.TimelineReset]),this.room.on(Zt.BeforeRedaction,this.onBeforeRedaction),this.room.on(Oe.Redaction,this.onRedaction),this.room.on(Oe.LocalEchoUpdated,this.onLocalEcho),this.room.on(Oe.TimelineReset,this.onTimelineReset),this.timelineSet.on(Oe.Timeline,this.onTimelineEvent),this.processReceipts(r.receipts),this.updateThreadMetadata(),this.setEventMetadata(this.rootEvent)}fetchRootEvent(){var e=this;return B(function*(){try{var n=yield e.client.fetchRoomEvent(e.roomId,e.id),r=e.client.getEventMapper();e.rootEvent=r(n)}catch(i){N.error("Failed to fetch thread root to construct thread with",i)}yield e.processEvent(e.rootEvent)})()}static setServerSideSupport(e){$n.hasServerSideSupport=e,e!==bs.Stable&&(Xg.setPreferUnstable(!0),Qg.setPreferUnstable(!0),Rn.setPreferUnstable(!0))}static setServerSideListSupport(e){$n.hasServerSideListSupport=e}static setServerSideFwdPaginationSupport(e){$n.hasServerSideFwdPaginationSupport=e}shouldSendLocalEchoReceipt(e,n){var r,i=(r=this.client.canSupport.get(di.RelationsRecursion))!==null&&r!==void 0?r:ui.Unsupported;if(i===ui.Unsupported){var s,o=(s=this.getReadReceiptForUserId(e))===null||s===void 0?void 0:s.eventId;if(o){var a=this.findEventById(o);if(a&&a.getTs()>n.getTs())return!1}}return!0}get roomState(){return this.room.getLiveTimeline().getState(Fe.FORWARDS)}addEventToTimeline(e,n){this.findEventById(e.getId())||this.timelineSet.addEventToTimeline(e,this.liveTimeline,{toStartOfTimeline:n,fromCache:!1,roomState:this.roomState,addToState:!1})}insertEventIntoTimeline(e){var n=e.getId();n&&(this.findEventById(n)||this.timelineSet.insertEventIntoTimeline(e,this.liveTimeline,this.roomState,!1))}addEvents(e,n){e.forEach(r=>this.addEvent(r,n,!1)),this.updateThreadMetadata()}addEvent(e,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;this.setEventMetadata(e);var i=this.lastReply(),s=!i||e.localTimestamp>=i.localTimestamp;if(!$n.hasServerSideSupport)this.addEventToTimeline(e,n),this.client.decryptEventIfNeeded(e);else if(e.isRelation(bn.Annotation)||e.isRelation(bn.Replace)){this.addRelatedThreadEvent(e,n);return}else!n&&s?(this.addEventToTimeline(e,!1),this.fetchEditsWhereNeeded(e)):n?this.addEventToTimeline(e,n):this.insertEventIntoTimeline(e);e.getId()!==this.id&&e.isRelation(Rn.name)&&!n&&s&&(this.lastEvent=void 0),r&&(this.emit(Ds.NewReply,this,e),this.updateThreadMetadata())}addRelatedThreadEvent(e,n){if(this.initialEventsFetched){var s,o=(s=this.client.canSupport.get(di.RelationsRecursion))!==null&&s!==void 0?s:ui.Unsupported;o===ui.Unsupported?this.insertEventIntoTimeline(e):this.addEventToTimeline(e,n)}else{var r;if((r=this.replayEvents)===null||r===void 0||r.push(e),e.isRelation(bn.Annotation)){var i;(i=this.timelineSet.relations)===null||i===void 0||i.aggregateChildEvent(e,this.timelineSet)}}}processEvent(e){var n=this;return B(function*(){e&&(n.setEventMetadata(e),yield n.fetchEditsWhereNeeded(e))})()}processReceipts(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];for(var{eventId:n,receiptType:r,userId:i,receipt:s,synthetic:o}of e)this.addReceiptToStructure(n,r,i,s,o)}getRootEventBundledRelationship(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.rootEvent;return e?.getServerAggregatedRelation(Rn.name)}processRootEvent(){var e=this;return B(function*(){var n=e.getRootEventBundledRelationship();if($n.hasServerSideSupport&&n){e.replyCount=n.count,e._currentUserParticipated=!!n.current_user_participated;var r=e.client.getEventMapper();e.lastEvent=r(DB(DB({},n.latest_event),{},{room_id:e.roomId})),e.updatePendingReplyCount(),yield e.processEvent(e.lastEvent)}})()}updatePendingReplyCount(){var e=this.pendingEventOrdering===Rv.Detached?this.room.getPendingEvents():this.events,n=e.filter(r=>{var i;return r.threadRootId===this.id&&r.isRelation(Rn.name)&&r.status!==null&&r.getId()!==((i=this.lastEvent)===null||i===void 0?void 0:i.getId())});this.lastPendingEvent=n.length?n[n.length-1]:void 0,this.pendingReplyCount=n.length}resetLiveTimeline(e,n){var r=this;return B(function*(){var i=r.liveTimeline;r.timelineSet.resetLiveTimeline(e??void 0,n??void 0);var s=r.liveTimeline,o,a;if(e){var c=yield r.client.createMessagesRequest(r.roomId,e,1,Et.Forward);o=c.end}if(n){var l=yield r.client.createMessagesRequest(r.roomId,n,1,Et.Backward);a=l.start}n&&i.getPaginationToken(Et.Forward)===n&&i.setPaginationToken(a??null,Et.Forward),e&&s.getPaginationToken(Et.Backward)===e&&s.setPaginationToken(o??null,Et.Backward)})()}updateThreadFromRootEvent(){var e=this;return B(function*(){$n.hasServerSideSupport&&(!e.initialEventsFetched&&!e.lastEvent&&(yield e.processRootEvent()),yield e.fetchRootEvent()),yield e.processRootEvent()})()}updateThreadMetadata(){var e=this;return B(function*(){if(e.updatePendingReplyCount(),e.processRootEventPromise||(e.processRootEventPromise=e.updateThreadFromRootEvent()),yield e.processRootEventPromise,!e.initialEventsFetched)if(e.initalEventFetchProm)yield e.initalEventFetchProm;else try{e.timelineSet.resetLiveTimeline(),e.replyCount===0&&e.rootEvent?(e.timelineSet.addEventsToTimeline([e.rootEvent],!0,!1,e.liveTimeline,null),e.liveTimeline.setPaginationToken(null,Et.Backward)):(e.initalEventFetchProm=e.client.paginateEventTimeline(e.liveTimeline,{backwards:!0}),yield e.initalEventFetchProm),e.initialEventsFetched=!0;for(var n of e.replayEvents)e.addEvent(n,!1);e.replayEvents=null,e.emit(Oe.TimelineReset,e.room,e.timelineSet,!0)}catch(r){N.error("Failed to load start of newly created thread: ",r),e.initialEventsFetched=!1}e.emit(Ds.Update,e)})()}fetchEditsWhereNeeded(){var e=arguments,n=this;return B(function*(){var r,i=(r=n.client.canSupport.get(di.RelationsRecursion))!==null&&r!==void 0?r:ui.Unsupported;if(i===ui.Unsupported){for(var s=e.length,o=new Array(s),a=0;a<s;a++)o[a]=e[a];return Promise.all(o.filter(ebe).map((function(){var c=B(function*(l){try{var d=yield n.client.relations(n.roomId,l.getId(),bn.Replace,l.getType(),{limit:1});if(d.events.length){var h=d.events[0];l.makeReplaced(h),n.insertEventIntoTimeline(h)}}catch(m){N.error("Failed to load edits for encrypted thread event",m)}});return function(l){return c.apply(this,arguments)}})()))}})()}setEventMetadata(e){e&&(Fe.setEventMetadata(e,this.roomState,!1),e.setThread(this))}clearEventMetadata(e){if(e){var n;e.setThread(void 0),(n=e.event)===null||n===void 0||(n=n.unsigned)===null||n===void 0||(n=n["m.relations"])===null||n===void 0||delete n[Rn.name]}}findEventById(e){return this.timelineSet.findEventById(e)}lastReply(){for(var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:i=>i.isRelation(Rn.name),n=this.timeline.length-1;n>=0;n--){var r=this.timeline[n];if(e(r))return r}return null}get roomId(){return this.room.roomId}get length(){return this.replyCount+this.pendingReplyCount}get replyToEvent(){var e,n;return(e=(n=this.lastPendingEvent)!==null&&n!==void 0?n:this.lastEvent)!==null&&e!==void 0?e:this.lastReply()}get timeline(){return this.events}get events(){return this.liveTimeline.getEvents()}has(e){return this.timelineSet.findEventById(e)instanceof ns}get hasCurrentUserParticipated(){return this._currentUserParticipated}get liveTimeline(){return this.timelineSet.getLiveTimeline()}getUnfilteredTimelineSet(){return this.timelineSet}addReceipt(e,n){throw new Error("Unsupported function on the thread model")}getEventReadUpTo(e,n){var r=e===this.client.getUserId(),i=this.timeline[this.timeline.length-1];if(r&&i){var s=i.getTs()<this.room.getOldestThreadedReceiptTs(),o=i.getId();if(s&&o)return o}var a=super.getEventReadUpTo(e,n);if(i){var c=this.room.getLastUnthreadedReceiptFor(e);if(!c)return a;for(var l=((d=this.timeline)===null||d===void 0?void 0:d.length)-1;l>=0;--l){var d,h,m=this.timeline[l];if(m.getId()===a)return a;if(m.getTs()<c.ts)return(h=m.getId())!==null&&h!==void 0?h:a}}return a}hasUserReadEvent(e,n){if(e===this.client.getUserId()){var r,i,s,o,a,c,l=((r=(i=this.lastReply())===null||i===void 0?void 0:i.getTs())!==null&&r!==void 0?r:0)<this.room.getOldestThreadedReceiptTs(),d=(s=(o=this.room.getLastUnthreadedReceiptFor(e))===null||o===void 0?void 0:o.ts)!==null&&s!==void 0?s:0,h=((a=this===null||this===void 0||(c=this.lastReply())===null||c===void 0?void 0:c.getTs())!==null&&a!==void 0?a:0)<d;if(l||h)return!0}return this.room.hasUserReadEvent(e,n)}setUnread(e,n){return this.room.setThreadUnreadNotificationCount(this.id,e,n)}getLastUnthreadedReceiptFor(e){return this.room.getLastUnthreadedReceiptFor(e)}}L($n,"hasServerSideSupport",bs.None);L($n,"hasServerSideListSupport",bs.None);L($n,"hasServerSideFwdPaginationSupport",bs.None);function ebe(t){return t.isEncrypted()&&(t.isRelation(Rn.name)||t.isThreadRoot)}var Xg=new gT("related_by_senders","io.element.relation_senders"),Qg=new gT("related_by_rel_types","io.element.relation_types"),Rn=new gT("m.thread","io.element.thread"),vc=(function(t){return t[t.My=0]="My",t[t.All=1]="All",t})({});function uQ(t){return t===vc.My?"participated":"all"}class NB extends Error{constructor(e,n,r){super(n),this.code=e,L(this,"detailedString",void 0),this.name="DecryptionError",this.detailedString=tbe(this,r)}}function tbe(t,e){var n=t.name+"[msg: "+t.message;return e&&(n+=", "+Object.keys(e).map(r=>r+": "+e[r]).join(", ")),n+="]",n}var UB=Object.freeze({visible:!0}),kP=36e5,Zt=(function(t){return t.Decrypted="Event.decrypted",t.BeforeRedaction="Event.beforeRedaction",t.VisibilityChange="Event.visibilityChange",t.LocalEventIdReplaced="Event.localEventIdReplaced",t.Status="Event.status",t.Replaced="Event.replaced",t.RelationsCreated="Event.relationsCreated",t.SentinelUpdated="Event.sentinelUpdated",t})({});class ns extends Kn{setMetadata(e,n){var r,i,s=this.isState()&&this.getType()===Z.RoomMember&&this.getSender()===this.getStateKey(),o=!1;if(s||!((r=this.sender)!==null&&r!==void 0&&(r=r.events)!==null&&r!==void 0&&r.member)){var a=e.getSentinelMember(this.getSender());a!==this.sender&&(o=!0),this.sender=a}if(s||!((i=this.target)!==null&&i!==void 0&&(i=i.events)!==null&&i!==void 0&&i.member)&&this.getType()===Z.RoomMember){var c=e.getSentinelMember(this.getStateKey());c!==this.target&&(o=!0),this.target=c}this.isState()&&n&&(this.forwardLooking=!1),o&&this.emit(Zt.SentinelUpdated)}constructor(){var e,n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};super(),this.event=n,L(this,"pushDetails",{}),L(this,"_replacingEvent",null),L(this,"_localRedactionEvent",null),L(this,"_isCancelled",!1),L(this,"clearEvent",void 0),L(this,"visibility",UB),L(this,"_hasCachedExtEv",!1),L(this,"_cachedExtEv",void 0),L(this,"_decryptionFailureReason",null),L(this,"senderCurve25519Key",null),L(this,"claimedEd25519Key",null),L(this,"keyForwardedBy",void 0),L(this,"decryptionPromise",null),L(this,"retryDecryption",!1),L(this,"txnId",void 0),L(this,"thread",void 0),L(this,"threadId",void 0),L(this,"localTimestamp",void 0),L(this,"sender",null),L(this,"target",null),L(this,"status",null),L(this,"error",null),L(this,"forwardLooking",!0),L(this,"reEmitter",void 0),L(this,"unstableStickyExpiresAt",void 0),["state_key","type","sender","room_id","membership"].forEach(s=>{typeof n[s]=="string"&&(n[s]=XI(n[s]))}),["membership","avatar_url","displayname"].forEach(s=>{var o;typeof((o=n.content)===null||o===void 0?void 0:o[s])=="string"&&(n.content[s]=XI(n.content[s]))}),["rel_type"].forEach(s=>{var o;typeof((o=n.content)===null||o===void 0||(o=o["m.relates_to"])===null||o===void 0?void 0:o[s])=="string"&&(n.content["m.relates_to"][s]=XI(n.content["m.relates_to"][s]))}),this.txnId=n.txn_id;var r=this.getAge(),i=Date.now();this.localTimestamp=r!==void 0?i-r:(e=this.getTs())!==null&&e!==void 0?e:i,this.reEmitter=new ly(this),this.unstableStickyInfo&&(this.unstableStickyInfo.duration_ttl_ms?this.unstableStickyExpiresAt=i+this.unstableStickyInfo.duration_ttl_ms:this.unstableStickyExpiresAt=Math.min(i,this.getTs())+this.unstableStickyInfo.duration_ms)}get unstableExtensibleEvent(){if(!this._hasCachedExtEv){var e;this._cachedExtEv=(e=To.ExtensibleEvents.parse(this.getEffectiveEvent()))!==null&&e!==void 0?e:void 0}return this._cachedExtEv}invalidateExtensibleEvent(){this._hasCachedExtEv=!1}getEffectiveEvent(){var e=Object.assign({},this.getContent());if(this.getWireType()===Z.RoomMessageEncrypted)for(var[n,r]of Object.entries(this.getWireContent()))["algorithm","ciphertext","device_id","sender_key","session_id"].includes(n)||e[n]===void 0&&(e[n]=r);return Object.assign({},this.event,this.clearEvent,{content:e})}getId(){return this.event.event_id}getSender(){return this.event.sender}getType(){return this.clearEvent?this.clearEvent.type:this.event.type}getWireType(){return this.event.type}getRoomId(){return this.event.room_id}getTs(){return this.event.origin_server_ts}getDate(){return this.event.origin_server_ts?new Date(this.event.origin_server_ts):null}getDetails(){var e=this.getRoomId();if(e){var n;return"id=".concat(this.getId()," type=").concat(this.getWireType()," sender=").concat(this.getSender()," room=").concat(e," ts=").concat((n=this.getDate())===null||n===void 0?void 0:n.toISOString())}else{var r=this.getContent()[_T];return"msgid=".concat(r," type=").concat(this.getWireType()," sender=").concat(this.getSender())}}getOriginalContent(){var e;if(this._localRedactionEvent)return{};if(this.clearEvent){var n;return(n=this.clearEvent.content)!==null&&n!==void 0?n:{}}return(e=this.event.content)!==null&&e!==void 0?e:{}}getContent(){if(this._localRedactionEvent)return{};if(this._replacingEvent){var e;return(e=this._replacingEvent.getContent()["m.new_content"])!==null&&e!==void 0?e:{}}else return this.getOriginalContent()}getWireContent(){return this.event.content||{}}get threadRootId(){var e;if(!this.isState()){var n=(e=this.getWireContent())===null||e===void 0?void 0:e["m.relates_to"];if(n?.rel_type===Rn.name)return n.event_id;if(this.thread)return this.thread.id;if(this.threadId!==void 0)return this.threadId;var r=this.getUnsigned();if(typeof r[RC.name]=="string")return r[RC.name]}}get isThreadRoot(){if(this.isState())return!1;var e=this.getServerAggregatedRelation(Rn.name);return!!e||this.threadRootId===this.getId()}get replyEventId(){var e;return(e=this.getWireContent()["m.relates_to"])===null||e===void 0||(e=e["m.in_reply_to"])===null||e===void 0?void 0:e.event_id}get relationEventId(){var e;return(e=this.getWireContent())===null||e===void 0||(e=e["m.relates_to"])===null||e===void 0?void 0:e.event_id}getPrevContent(){return this.getUnsigned().prev_content||{}}getDirectionalContent(){return this.forwardLooking?this.getContent():this.getPrevContent()}getAge(){return this.getUnsigned().age}getLocalAge(){return Date.now()-this.localTimestamp}getStateKey(){return this.clearEvent?this.clearEvent.state_key:this.event.state_key}getWireStateKey(){return this.event.state_key}isState(){return this.event.state_key!==void 0}getMembershipAtEvent(){var e=this.getUnsigned();return KJ.findIn(e)}makeEncrypted(e,n,r,i){this.clearEvent={type:this.event.type,content:this.event.content,state_key:this.event.state_key},this.event.type=e,this.event.content=n,this.senderCurve25519Key=r,this.claimedEd25519Key=i,this.isState()&&(this.event.state_key="".concat(this.clearEvent.type,":").concat(this.clearEvent.state_key))}isBeingDecrypted(){return this.decryptionPromise!=null}getDecryptionPromise(){return this.decryptionPromise}isDecryptionFailure(){return this._decryptionFailureReason!==null}get decryptionFailureReason(){return this._decryptionFailureReason}shouldAttemptDecryption(){return!(this.isRedacted()||this.isBeingDecrypted()||this.clearEvent||!this.isEncrypted())}attemptDecryption(e){var n=arguments,r=this;return B(function*(){var i=n.length>1&&n[1]!==void 0?n[1]:{};if(!r.isEncrypted())throw new Error("Attempt to decrypt event which isn't encrypted");var s=r.clearEvent&&!r.isDecryptionFailure();if(s)throw new Error("Attempt to decrypt event which has already been decrypted");return r.decryptionPromise?(N.log("Event ".concat(r.getId()," already being decrypted; queueing a retry")),r.retryDecryption=!0,r.decryptionPromise):(r.decryptionPromise=r.decryptionLoop(e,i),r.decryptionPromise)})()}getKeyRequestRecipients(e){var n=[{userId:e,deviceId:"*"}];return n}decryptionLoop(e){var n=arguments,r=this;return B(function*(){var i=n.length>1&&n[1]!==void 0?n[1]:{};for(yield Promise.resolve();;){r.retryDecryption=!1;var s=void 0;try{var o=yield e.decryptEvent(r);i.isRetry===!0&&N.info("Decrypted event on retry (".concat(r.getDetails(),")")),r.setClearData(o),r._decryptionFailureReason=null}catch(c){var a=c instanceof NB?c.detailedString:String(c);if(s=c,r.retryDecryption){N.log("Error decrypting event (".concat(r.getDetails(),"), but retrying: ").concat(a));continue}N.warn("Error decrypting event (".concat(r.getDetails(),"): ").concat(a)),r.setClearDataForDecryptionFailure(String(c)),r._decryptionFailureReason=c instanceof NB?c.code:W0e.UNKNOWN_ERROR}r.decryptionPromise=null,r.retryDecryption=!1,r.setPushDetails(),i.emit!==!1&&r.emit(Zt.Decrypted,r,s);return}})()}setClearData(e){var n,r;this.clearEvent=e.clearEvent,this.senderCurve25519Key=(n=e.senderCurve25519Key)!==null&&n!==void 0?n:null,this.claimedEd25519Key=(r=e.claimedEd25519Key)!==null&&r!==void 0?r:null,this.keyForwardedBy=e.keyForwardedBy,this.invalidateExtensibleEvent()}setClearDataForDecryptionFailure(e){this.clearEvent={type:Z.RoomMessage,content:{msgtype:"m.bad.encrypted",body:"** Unable to decrypt: ".concat(e," **")}},this.senderCurve25519Key=null,this.claimedEd25519Key=null,this.invalidateExtensibleEvent()}getClearContent(){return this.clearEvent?this.clearEvent.content:null}isEncrypted(){return this.event.type===Z.RoomMessageEncrypted}getSenderKey(){return this.senderCurve25519Key}getKeysClaimed(){return this.claimedEd25519Key?{ed25519:this.claimedEd25519Key}:{}}getClaimedEd25519Key(){return this.claimedEd25519Key}getForwardingCurve25519KeyChain(){return[]}isKeySourceUntrusted(){return!1}getKeyForwardingUser(){return this.keyForwardedBy}getUnsigned(){return this.event.unsigned||{}}setUnsigned(e){this.event.unsigned=e}unmarkLocallyRedacted(){var e=this._localRedactionEvent;return this._localRedactionEvent=null,this.event.unsigned&&(this.event.unsigned.redacted_because=void 0),!!e}markLocallyRedacted(e){this._localRedactionEvent||(this.emit(Zt.BeforeRedaction,this,e),this._localRedactionEvent=e,this.event.unsigned||(this.event.unsigned={}),this.event.unsigned.redacted_because=e.event)}applyVisibilityEvent(e){var n,r,i=(n=e?.visible)!==null&&n!==void 0?n:!0,s=(r=e?.reason)!==null&&r!==void 0?r:null,o=!1;(this.visibility.visible!==i||!this.visibility.visible&&this.visibility.reason!==s)&&(o=!0),o&&(i?this.visibility=UB:this.visibility=Object.freeze({visible:!1,reason:s}),this.emit(Zt.VisibilityChange,this,i))}messageVisibility(){return this.visibility}makeRedacted(e,n){if(!e.event)throw new Error("invalid redactionEvent in makeRedacted");this._localRedactionEvent=null,this.emit(Zt.BeforeRedaction,this,e),this._replacingEvent=null,this.event.unsigned||(this.event.unsigned={}),this.event.unsigned.redacted_because=e.event;for(var r in this.event)this.event.hasOwnProperty(r)&&!nbe.has(r)&&delete this.event[r];this.isEncrypted()&&(this.clearEvent=void 0);var i=this.getType()in jB?jB[this.getType()]:{},s=this.getContent();for(var o in s)s.hasOwnProperty(o)&&!i[o]&&delete s[o];!this.isThreadRoot&&this.threadRootId&&this.threadRootId!==this.getId()&&(this.moveAllRelatedToMainTimeline(n),e.moveToMainTimeline(n)),this.invalidateExtensibleEvent()}moveAllRelatedToMainTimeline(e){var n=this.thread;if(this.moveToMainTimeline(e),n)for(var r of n.events){var i;((i=r.getRelation())===null||i===void 0?void 0:i.event_id)===this.getId()&&r.moveAllRelatedToMainTimeline(e)}}moveToMainTimeline(e){var n;(n=this.thread)===null||n===void 0||n.timelineSet.removeEvent(this.getId()),this.setThread(void 0);var r=e.getLiveTimeline();r.getTimelineSet().insertEventIntoTimeline(this,r,r.getState(Fe.FORWARDS),!1)}isRedacted(){return!!this.getUnsigned().redacted_because}isRedaction(){return this.getType()===Z.RoomRedaction}asVisibilityChange(){if(!sp.matches(this.getType()))return null;var e=this.getRelation();if(!e||e.rel_type!="m.reference")return null;var n=e.event_id;if(!n)return null;var r=this.getWireContent(),i=!!r.visible,s=r.reason;return s&&typeof s!="string"?null:{visible:i,reason:s,eventId:n}}isVisibilityEvent(){return sp.matches(this.getType())}getRedactionEvent(){var e,n;if(!this.isRedacted())return null;if((e=this.clearEvent)!==null&&e!==void 0&&e.unsigned){var r,i;return(r=(i=this.clearEvent)===null||i===void 0?void 0:i.unsigned.redacted_because)!==null&&r!==void 0?r:null}else return(n=this.event.unsigned)!==null&&n!==void 0&&n.redacted_because?this.event.unsigned.redacted_because:{}}getPushActions(){return this.pushDetails.actions||null}getPushDetails(){return this.pushDetails}setPushDetails(e,n){this.pushDetails={actions:e,rule:n}}handleRemoteEcho(e){var n,r=this.getUnsigned(),i=this.getId();this.event=e,r.redacted_because&&(this.event.unsigned||(this.event.unsigned={}),this.event.unsigned.redacted_because=r.redacted_because),this.setStatus(null),this.getId()!==i&&this.emit(Zt.LocalEventIdReplaced,this),this.localTimestamp=Date.now()-((n=this.getAge())!==null&&n!==void 0?n:0)}isSending(){return!!this.status}setStatus(e){this.status=e,this.emit(Zt.Status,this,e)}replaceLocalEventId(e){this.event.event_id=e,this.emit(Zt.LocalEventIdReplaced,this)}isRelation(e){var n,r=(n=this.getWireContent())===null||n===void 0?void 0:n["m.relates_to"];return this.isState()&&(r!=null&&r.rel_type)&&[bn.Replace,bn.Thread].includes(r.rel_type)?!1:!!(r!=null&&r.rel_type&&r.event_id&&(!e||r.rel_type===e))}getRelation(){var e;return this.isRelation()&&(e=this.getWireContent()["m.relates_to"])!==null&&e!==void 0?e:null}makeReplaced(e){this.isRedacted()&&e||this.isState()||this._replacingEvent!==e&&(this._replacingEvent=e??null,this.emit(Zt.Replaced,this),this.invalidateExtensibleEvent())}getAssociatedStatus(){return this._replacingEvent?this._replacingEvent.status:this._localRedactionEvent?this._localRedactionEvent.status:this.status}getServerAggregatedRelation(e){var n;return(n=this.getUnsigned()["m.relations"])===null||n===void 0?void 0:n[e]}replacingEventId(){var e=this.getServerAggregatedRelation(bn.Replace);if(e)return e.event_id;if(this._replacingEvent)return this._replacingEvent.getId()}replacingEvent(){return this._replacingEvent}replacingEventDate(){var e=this.getServerAggregatedRelation(bn.Replace);if(e){var n=e.origin_server_ts;if(Number.isFinite(n))return new Date(n)}else if(this._replacingEvent){var r;return(r=this._replacingEvent.getDate())!==null&&r!==void 0?r:void 0}}localRedactionEvent(){return this._localRedactionEvent}getAssociatedId(){var e=this.getRelation();if(this.replyEventId)return this.replyEventId;if(e)return e.event_id;if(this.isRedaction())return this.event.redacts}hasAssociation(){return!!this.getAssociatedId()}updateAssociatedId(e){var n=this.getRelation();n?n.event_id=e:this.isRedaction()&&(this.event.redacts=e)}flagCancelled(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;this._isCancelled=e}isCancelled(){return this._isCancelled}toSnapshot(){var e=new ns(JSON.parse(JSON.stringify(this.event)));for(var[n,r]of Object.entries(this))n!=="event"&&(e[n]=r);return e}isEquivalentTo(e){if(!e)return!1;if(e===this)return!0;var n=fA(this.event),r=fA(e.event);return JSON.stringify(n)===JSON.stringify(r)}toJSON(){var e=this.getEffectiveEvent();return this.isEncrypted()?{decrypted:e,encrypted:this.event}:e}setTxnId(e){this.txnId=e}getTxnId(){return this.txnId}setThread(e){this.isState()||(this.thread&&this.reEmitter.stopReEmitting(this.thread,[Ds.Update]),this.thread=e,this.setThreadId(e?.id),e&&this.reEmitter.reEmit(e,[Ds.Update]))}getThread(){return this.thread}setThreadId(e){this.threadId=e}get unstableStickyInfo(){var e,n;if((e=this.event.msc4354_sticky)!==null&&e!==void 0&&e.duration_ms)return{duration_ms:Math.min(kP,this.event.msc4354_sticky.duration_ms),duration_ttl_ms:(n=this.event.unsigned)===null||n===void 0?void 0:n.msc4354_sticky_duration_ttl_ms}}}var nbe=new Set(["event_id","type","room_id","user_id","sender","state_key","prev_state","content","unsigned","origin_server_ts"]),jB={[Z.RoomMember]:{membership:1},[Z.RoomJoinRules]:{join_rule:1},[Z.RoomPowerLevels]:{ban:1,events:1,events_default:1,kick:1,redact:1,state_default:1,users:1,users_default:1}},rbe=["1","2","3","4","5","6","7","8","9","10","11"];function ibe(t){return!rbe.includes(t)}var qo=(function(t){return t[t.NotStarted=0]="NotStarted",t[t.InProgress=1]="InProgress",t[t.Finished=2]="Finished",t})(qo||{}),Ct=(function(t){return t.Events="RoomState.events",t.Members="RoomState.members",t.NewMember="RoomState.newMember",t.Update="RoomState.update",t.BeaconLiveness="RoomState.BeaconLiveness",t.Marker="RoomState.Marker",t})({});class qb extends Kn{constructor(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{status:qo.NotStarted};super(),this.roomId=e,this.oobMemberFlags=n,L(this,"reEmitter",new ly(this)),L(this,"sentinels",{}),L(this,"displayNameToUserIds",new Map),L(this,"userIdsToDisplayNames",{}),L(this,"tokenToInvite",{}),L(this,"joinedMemberCount",null),L(this,"summaryJoinedMemberCount",null),L(this,"invitedMemberCount",null),L(this,"summaryInvitedMemberCount",null),L(this,"modified",-1),L(this,"members",{}),L(this,"events",new Map),L(this,"paginationToken",null),L(this,"beacons",new Map),L(this,"_liveBeaconIds",[]),L(this,"getVersionWarning",!1),this.updateModifiedTime()}getRoomVersion(){var e,n=this.getStateEvents(Z.RoomCreate,"");return n?(e=n.getContent().room_version)!==null&&e!==void 0?e:"1":(this.getVersionWarning||(N.warn("[getVersion] Room "+this.roomId+" does not have an m.room.create event"),this.getVersionWarning=!0),"1")}getJoinedMemberCount(){return this.summaryJoinedMemberCount!==null?this.summaryJoinedMemberCount:(this.joinedMemberCount===null&&(this.joinedMemberCount=this.getMembers().reduce((e,n)=>n.membership===Ve.Join?e+1:e,0)),this.joinedMemberCount)}setJoinedMemberCount(e){this.summaryJoinedMemberCount=e}getInvitedMemberCount(){return this.summaryInvitedMemberCount!==null?this.summaryInvitedMemberCount:(this.invitedMemberCount===null&&(this.invitedMemberCount=this.getMembers().reduce((e,n)=>n.membership===Ve.Invite?e+1:e,0)),this.invitedMemberCount)}setInvitedMemberCount(e){this.summaryInvitedMemberCount=e}getMembers(){return Object.values(this.members)}getMembersExcept(e){return this.getMembers().filter(n=>!e.includes(n.userId))}getMember(e){return this.members[e]||null}getSentinelMember(e){if(!e)return null;var n=this.sentinels[e];if(n===void 0){n=new Ab(this.roomId,e);var r=this.members[e];r!=null&&r.events.member&&n.setMembershipEvent(r.events.member,this),this.sentinels[e]=n}return n}getStateEvents(e,n){if(!this.events.has(e))return n===void 0?[]:null;if(n===void 0)return Array.from(this.events.get(e).values());var r=this.events.get(e).get(n);return r||null}get hasLiveBeacons(){var e;return!!((e=this.liveBeaconIds)!==null&&e!==void 0&&e.length)}get liveBeaconIds(){return this._liveBeaconIds}clone(){var e=new qb(this.roomId,this.oobMemberFlags),n=this.oobMemberFlags.status;return this.oobMemberFlags.status=qo.NotStarted,Array.from(this.events.values()).forEach(r=>{e.setStateEvents(Array.from(r.values()))}),this.oobMemberFlags.status=n,this.summaryInvitedMemberCount!==null&&e.setInvitedMemberCount(this.getInvitedMemberCount()),this.summaryJoinedMemberCount!==null&&e.setJoinedMemberCount(this.getJoinedMemberCount()),this.oobMemberFlags.status==qo.Finished&&this.getMembers().forEach(r=>{if(r.isOutOfBand()){var i;(i=e.getMember(r.userId))===null||i===void 0||i.markOutOfBand()}}),e}setUnknownStateEvents(e){var n=e.filter(r=>!this.events.has(r.getType())||!this.events.get(r.getType()).has(r.getStateKey()));this.setStateEvents(n)}setStateEvents(e,n){this.updateModifiedTime(),e.forEach(r=>{if(!(r.getRoomId()!==this.roomId||!r.isState())){vP.matches(r.getType())&&this.setBeacon(r);var i=this.getStateEventMatching(r);if(this.setStateEvent(r),r.getType()===Z.RoomMember){var s;this.updateDisplayNameCache(r.getStateKey(),(s=r.getContent().displayname)!==null&&s!==void 0?s:""),this.updateThirdPartyTokenCache(r)}this.emit(Ct.Events,r,this,i)}}),this.onBeaconLivenessChange(),e.forEach(r=>{if(!(r.getRoomId()!==this.roomId||!r.isState()))if(r.getType()===Z.RoomMember){var i=r.getStateKey();(r.getContent().membership===Ve.Leave||r.getContent().membership===Ve.Ban)&&(r.getContent().avatar_url=r.getContent().avatar_url||r.getPrevContent().avatar_url,r.getContent().displayname=r.getContent().displayname||r.getPrevContent().displayname);var s=this.getOrCreateMember(i,r);s.setMembershipEvent(r,this),this.updateMember(s),this.emit(Ct.Members,r,this,s)}else if(r.getType()===Z.RoomPowerLevels){if(r.getStateKey()!=="")return;var o=Object.values(this.members),a=this.getStateEvents(Z.RoomCreate,""),c=FB(this.getRoomVersion(),a);o.forEach(l=>{var d=l.getLastModifiedTime();if(a){var h=$B(l.userId,r,c);l.setPowerLevel(h,r)}d!==l.getLastModifiedTime()&&this.emit(Ct.Members,r,this,l)}),this.sentinels={}}else HJ.matches(r.getType())&&this.emit(Ct.Marker,r,n)}),this.emit(Ct.Update,this)}processBeaconEvents(e,n){var r=this;return B(function*(){if(!(!e.length||!r.beacons.size)){var i=[...r.beacons.values()].reduce((l,d)=>(l[d.beaconInfoId]=d,l),{}),s=(l,d)=>{if(UA.matches(d.getType())){var h=i[l];h&&h.addLocations([d])}},o=function*(d){var h,m=(h=d.getRelation())===null||h===void 0?void 0:h.event_id;if(!m||!i[m])return{v:void 0};if(!UA.matches(d.getType())&&!d.isEncrypted())return{v:void 0};try{yield n.decryptEventIfNeeded(d),s(m,d)}catch{d.isDecryptionFailure()&&d.once(Zt.Decrypted,B(function*(){s(m,d)}))}},a;for(var c of e)if(a=yield*o(c),a)return a.v}})()}getOrCreateMember(e,n){var r=this.members[e];return r||(r=new Ab(this.roomId,e),this.members[e]=r,this.emit(Ct.NewMember,n,this,r)),r}setStateEvent(e){this.events.has(e.getType())||this.events.set(e.getType(),new Map),this.events.get(e.getType()).set(e.getStateKey(),e)}setBeacon(e){var n=IC(e);if(this.beacons.has(n)){var r=this.beacons.get(n);if(e.isRedacted()){var i;r.beaconInfoId===((i=e.getRedactionEvent())===null||i===void 0?void 0:i.redacts)&&(r.destroy(),this.beacons.delete(n));return}return r.update(e)}if(!e.isRedacted()){var s=new pX(e);this.reEmitter.reEmit(s,[Xn.New,Xn.Update,Xn.Destroy,Xn.LivenessChange]),this.emit(Xn.New,e,s),s.on(Xn.LivenessChange,this.onBeaconLivenessChange.bind(this)),s.on(Xn.Destroy,this.onBeaconLivenessChange.bind(this)),this.beacons.set(s.identifier,s)}}onBeaconLivenessChange(){this._liveBeaconIds=Array.from(this.beacons.values()).filter(e=>e.isLive).map(e=>e.identifier),this.emit(Ct.BeaconLiveness,this,this.hasLiveBeacons)}getStateEventMatching(e){var n,r;return(n=(r=this.events.get(e.getType()))===null||r===void 0?void 0:r.get(e.getStateKey()))!==null&&n!==void 0?n:null}updateMember(e){var n=this.getStateEvents(Z.RoomCreate,""),r=this.getStateEvents(Z.RoomPowerLevels,"");if(r&&n){var i=$B(e.userId,r,FB(this.getRoomVersion(),n));e.setPowerLevel(i,r)}delete this.sentinels[e.userId],this.members[e.userId]=e,this.joinedMemberCount=null,this.invitedMemberCount=null}needsOutOfBandMembers(){return this.oobMemberFlags.status===qo.NotStarted}outOfBandMembersReady(){return this.oobMemberFlags.status===qo.Finished}markOutOfBandMembersStarted(){this.oobMemberFlags.status===qo.NotStarted&&(this.oobMemberFlags.status=qo.InProgress)}markOutOfBandMembersFailed(){this.oobMemberFlags.status===qo.InProgress&&(this.oobMemberFlags.status=qo.NotStarted)}clearOutOfBandMembers(){var e=0;Object.keys(this.members).forEach(n=>{var r=this.members[n];r.isOutOfBand()&&(++e,delete this.members[n])}),N.log("LL: RoomState removed ".concat(e," members...")),this.oobMemberFlags.status=qo.NotStarted}setOutOfBandMembers(e){N.log("LL: RoomState about to set ".concat(e.length," OOB members ...")),this.oobMemberFlags.status===qo.InProgress&&(N.log("LL: RoomState put in finished state ..."),this.oobMemberFlags.status=qo.Finished,e.forEach(n=>this.setOutOfBandMember(n)),this.emit(Ct.Update,this))}setOutOfBandMember(e){if(e.getType()===Z.RoomMember){var n=e.getStateKey(),r=this.getMember(n);if(!(r&&!r.isOutOfBand())){var i=this.getOrCreateMember(n,e);i.setMembershipEvent(e,this),i.markOutOfBand(),this.updateDisplayNameCache(i.userId,i.name),this.setStateEvent(e),this.updateMember(i),this.emit(Ct.Members,e,this,i)}}}setTypingEvent(e){Object.values(this.members).forEach(function(n){n.setTypingEvent(e)})}getInviteForThreePidToken(e){return this.tokenToInvite[e]||null}updateModifiedTime(){this.modified=Date.now()}getLastModifiedTime(){return this.modified}getUserIdsWithDisplayName(e){var n;return(n=this.displayNameToUserIds.get(Tf(e)))!==null&&n!==void 0?n:[]}maySendRedactionForEvent(e,n){var r=this.getMember(n);if(!r||r.membership===Ve.Leave||e.status||e.isRedacted())return!1;var i=this.maySendEvent(Z.RoomRedaction,n);return i?e.getSender()===n?!0:this.hasSufficientPowerLevelFor("redact",r.powerLevel):!1}hasSufficientPowerLevelFor(e,n){var r=this.getStateEvents(Z.RoomPowerLevels,""),i={};r&&(i=r.getContent());var s=50;return n$(i[e])&&(s=i[e]),n>=s}maySendMessage(e){return this.maySendEventOfType(Z.RoomMessage,e,!1)}maySendEvent(e,n){return this.maySendEventOfType(e,n,!1)}mayClientSendStateEvent(e,n){return n.isGuest()||!n.credentials.userId?!1:this.maySendStateEvent(e,n.credentials.userId)}maySendStateEvent(e,n){return this.maySendEventOfType(e,n,!0)}maySendEventOfType(e,n,r){var i,s=this.getStateEvents(Z.RoomPowerLevels,""),o,a={},c=0,l=0;s&&(o=s.getContent(),a=o.events||{},Number.isSafeInteger(o.state_default)?c=o.state_default:c=50,Number.isSafeInteger(o.events_default)&&(l=o.events_default));var d=r?c:l;Number.isSafeInteger(a[e])&&(d=a[e]);var h=this.getMember(n),m=(i=h?.powerLevel)!==null&&i!==void 0?i:0;return m>=d}mayTriggerNotifOfType(e,n){var r=this.getMember(n);if(!r)return!1;var i=this.getStateEvents(Z.RoomPowerLevels,""),s=50;return i&&i.getContent()&&i.getContent().notifications&&n$(i.getContent().notifications[e])&&(s=i.getContent().notifications[e]),r.powerLevel>=s}getJoinRule(){var e,n=this.getStateEvents(Z.RoomJoinRules,""),r=(e=n?.getContent())!==null&&e!==void 0?e:{};return r.join_rule||kf.Invite}getHistoryVisibility(){var e,n=this.getStateEvents(Z.RoomHistoryVisibility,""),r=(e=n?.getContent())!==null&&e!==void 0?e:{};return r.history_visibility||gP.Shared}getGuestAccess(){var e,n=this.getStateEvents(Z.RoomGuestAccess,""),r=(e=n?.getContent())!==null&&e!==void 0?e:{};return r.guest_access||LC.Forbidden}findPredecessor(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;if(e){var n=this.getStateEvents(Z.RoomPredecessor,"");if(n){var r=n.getContent(),i=r.predecessor_room_id,s=r.last_known_event_id;typeof s!="string"&&(s=void 0);var o=r.via_servers;if(Array.isArray(o)||(o=void 0),typeof i=="string")return{roomId:i,eventId:s,viaServers:o}}}var a=this.getStateEvents(Z.RoomCreate,"");if(a){var c=a.getContent().predecessor;if(c){var l=c.room_id;if(typeof l=="string"){var d=c.event_id;return(typeof d!="string"||d==="")&&(d=void 0),{roomId:l,eventId:d}}}}return null}updateThirdPartyTokenCache(e){if(e.getContent().third_party_invite){var n=(e.getContent().third_party_invite.signed||{}).token;if(n){var r=this.getStateEvents(Z.RoomThirdPartyInvite,n);r&&(this.tokenToInvite[n]=e)}}}updateDisplayNameCache(e,n){var r=this.userIdsToDisplayNames[e];if(delete this.userIdsToDisplayNames[e],r){var i=Tf(r),s=this.displayNameToUserIds.get(i);if(s){var o=s.filter(d=>d!==e);this.displayNameToUserIds.set(i,o)}}this.userIdsToDisplayNames[e]=n;var a=n&&Tf(n);if(a){var c,l=(c=this.displayNameToUserIds.get(a))!==null&&c!==void 0?c:[];l.push(e),this.displayNameToUserIds.set(a,l)}}}function FB(t,e){var n=new Set;if(ibe(t)&&e){var r=e.getSender();r&&n.add(r);var i=e.getDirectionalContent().additional_creators;Array.isArray(i)&&i.forEach(s=>n.add(s))}return n}function $B(t,e,n){if(n.has(t))return 1/0;var r=e.getDirectionalContent(),i=r.users||{};return i[t]!==void 0&&Number.isInteger(i[t])?i[t]:r.users_default!==void 0?r.users_default:0}function BB(t){var e=typeof t=="string"&&!!t&&t!=="undefined"&&t!=="null";return e||typeof t=="number"}class Vb{constructor(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};L(this,"rooms",{}),L(this,"users",{}),L(this,"syncToken",null),L(this,"filters",new Bu(()=>new Map)),L(this,"accountData",new Map),L(this,"localStorage",void 0),L(this,"oobMembers",new Map),L(this,"pendingEvents",{}),L(this,"clientOptions",void 0),L(this,"pendingToDeviceBatches",[]),L(this,"nextToDeviceBatchId",0),L(this,"createUser",void 0),L(this,"onRoomMember",(n,r,i)=>{var s;if(i.membership!==Ve.Invite){var o=this.users[i.userId]||((s=this.createUser)===null||s===void 0?void 0:s.call(this,i.userId));i.name&&(o.setDisplayName(i.name),i.events.member&&o.setRawDisplayName(i.events.member.getDirectionalContent().displayname)),i.events.member&&i.events.member.getContent().avatar_url&&o.setAvatarUrl(i.events.member.getContent().avatar_url),this.users[o.userId]=o}}),this.localStorage=e.localStorage}getSyncToken(){return this.syncToken}isNewlyCreated(){return Promise.resolve(!0)}setSyncToken(e){this.syncToken=e}storeRoom(e){this.rooms[e.roomId]=e,e.currentState.on(Ct.Members,this.onRoomMember),e.currentState.getMembers().forEach(n=>{this.onRoomMember(null,e.currentState,n)})}setUserCreator(e){this.createUser=e}getRoom(e){return this.rooms[e]||null}getRooms(){return Object.values(this.rooms)}removeRoom(e){this.rooms[e]&&this.rooms[e].currentState.removeListener(Ct.Members,this.onRoomMember),delete this.rooms[e]}getRoomSummaries(){return Object.values(this.rooms).map(function(e){return e.summary})}storeUser(e){this.users[e.userId]=e}getUser(e){return this.users[e]||null}getUsers(){return Object.values(this.users)}scrollback(e,n){return[]}storeEvents(e,n,r,i){}storeFilter(e){!(e!=null&&e.userId)||!(e!=null&&e.filterId)||this.filters.getOrCreate(e.userId).set(e.filterId,e)}getFilter(e,n){var r;return((r=this.filters.get(e))===null||r===void 0?void 0:r.get(n))||null}getFilterIdByName(e){if(!this.localStorage)return null;var n="mxjssdk_memory_filter_"+e;try{var r=this.localStorage.getItem(n);if(BB(r))return r}catch{}return null}setFilterIdByName(e,n){if(this.localStorage){var r="mxjssdk_memory_filter_"+e;try{BB(n)?this.localStorage.setItem(r,n):this.localStorage.removeItem(r)}catch{}}}storeAccountDataEvents(e){e.forEach(n=>{var r=!Object.keys(n.getContent()).length;r?this.accountData.delete(n.getType()):this.accountData.set(n.getType(),n)})}getAccountData(e){return this.accountData.get(e)}setSyncData(e){return Promise.resolve()}wantsSave(){return!1}save(e){return Promise.resolve()}startup(){return Promise.resolve()}getSavedSync(){return Promise.resolve(null)}getSavedSyncToken(){return Promise.resolve(null)}deleteAllData(){return this.rooms={},this.users={},this.syncToken=null,this.filters=new Bu(()=>new Map),this.accountData=new Map,Promise.resolve()}getOutOfBandMembers(e){return Promise.resolve(this.oobMembers.get(e)||null)}setOutOfBandMembers(e,n){return this.oobMembers.set(e,n),Promise.resolve()}clearOutOfBandMembers(e){return this.oobMembers.delete(e),Promise.resolve()}getClientOptions(){return Promise.resolve(this.clientOptions)}storeClientOptions(e){return this.clientOptions=Object.assign({},e),Promise.resolve()}getPendingEvents(e){var n=this;return B(function*(){var r;return(r=n.pendingEvents[e])!==null&&r!==void 0?r:[]})()}setPendingEvents(e,n){var r=this;return B(function*(){r.pendingEvents[e]=n})()}saveToDeviceBatches(e){for(var n of e)this.pendingToDeviceBatches.push({id:this.nextToDeviceBatchId++,eventType:n.eventType,txnId:n.txnId,batch:n.batch});return Promise.resolve()}getOldestToDeviceBatch(){var e=this;return B(function*(){return e.pendingToDeviceBatches.length===0?null:e.pendingToDeviceBatches[0]})()}removeToDeviceBatch(e){return this.pendingToDeviceBatches=this.pendingToDeviceBatches.filter(n=>n.id!==e),Promise.resolve()}destroy(){return B(function*(){})()}}var dQ=(t=>(t.ToWidget="toWidget",t.FromWidget="fromWidget",t))(dQ||{});function sbe(t){if(t==="toWidget")return"fromWidget";if(t==="fromWidget")return"toWidget";throw new Error("Invalid direction")}var bu=(t=>(t.MSC2762="org.matrix.msc2762",t.MSC2762_UPDATE_STATE="org.matrix.msc2762_update_state",t.MSC2871="org.matrix.msc2871",t.MSC2873="org.matrix.msc2873",t.MSC2931="org.matrix.msc2931",t.MSC2974="org.matrix.msc2974",t.MSC2876="org.matrix.msc2876",t.MSC3819="org.matrix.msc3819",t.MSC3846="town.robin.msc3846",t.MSC3869="org.matrix.msc3869",t.MSC3973="org.matrix.msc3973",t.MSC4039="org.matrix.msc4039",t))(bu||{});const obe=["0.0.1","0.0.2","org.matrix.msc2762","org.matrix.msc2762_update_state","org.matrix.msc2871","org.matrix.msc2873","org.matrix.msc2931","org.matrix.msc2974","org.matrix.msc2876","org.matrix.msc3819","town.robin.msc3846","org.matrix.msc3869","org.matrix.msc3973","org.matrix.msc4039"];class abe extends bT.EventEmitter{constructor(e,n,r,i){super(),this.sendDirection=e,this.transportWindow=r,this.inboundWindow=i,this.strictOriginCheck=!1,this.targetOrigin="*",this.timeoutSeconds=10,this._ready=!1,this.outboundRequests=new Map,this.stopController=new AbortController,this.handleMessage=s=>{if(this.stopController.signal.aborted||!s.data||this.strictOriginCheck&&s.origin!==globalThis.origin)return;const o=s.data;if(!(!o.action||!o.requestId||!o.widgetId))if(o.response){if(o.api!==this.sendDirection)return;this.handleResponse(o)}else{const a=o;if(a.api!==sbe(this.sendDirection))return;this.handleRequest(a)}},this._widgetId=n}get ready(){return this._ready}get widgetId(){return this._widgetId||null}get nextRequestId(){const e=`widgetapi-${Date.now()}`;let n=0,r=e;for(;this.outboundRequests.has(r);)r=`${e}-${n++}`;return this.outboundRequests.set(r,null),r}sendInternal(e){console.log(`[PostmessageTransport] Sending object to ${this.targetOrigin}: `,e),this.transportWindow.postMessage(e,this.targetOrigin)}reply(e,n){return this.sendInternal({...e,response:n})}send(e,n){return this.sendComplete(e,n).then(r=>r.response)}sendComplete(e,n){if(!this.ready||!this.widgetId)return Promise.reject(new Error("Not ready or unknown widget ID"));const r={api:this.sendDirection,widgetId:this.widgetId,requestId:this.nextRequestId,action:e,data:n};return e===Rr.UpdateVisibility&&(r.visible=n.visible),new Promise((i,s)=>{const o=h=>{d(),i(h)},a=h=>{d(),s(h)},c=setTimeout(()=>a(new Error("Request timed out")),(this.timeoutSeconds||1)*1e3),l=()=>a(new Error("Transport stopped"));this.stopController.signal.addEventListener("abort",l);const d=()=>{this.outboundRequests.delete(r.requestId),clearTimeout(c),this.stopController.signal.removeEventListener("abort",l)};this.outboundRequests.set(r.requestId,{request:r,resolve:o,reject:a}),this.sendInternal(r)})}start(){this.inboundWindow.addEventListener("message",this.handleMessage),this._ready=!0}stop(){this._ready=!1,this.stopController.abort(),this.inboundWindow.removeEventListener("message",this.handleMessage)}handleRequest(e){if(this.widgetId){if(this.widgetId!==e.widgetId)return}else this._widgetId=e.widgetId;this.emit("message",new CustomEvent("message",{detail:e}))}handleResponse(e){if(e.widgetId!==this.widgetId)return;const n=this.outboundRequests.get(e.requestId);if(n)if(lbe(e.response)){const{message:r,...i}=e.response.error;n.reject(new FC(r,i))}else n.resolve(e)}}var Rr=(t=>(t.SupportedApiVersions="supported_api_versions",t.Capabilities="capabilities",t.NotifyCapabilities="notify_capabilities",t.ThemeChange="theme_change",t.LanguageChange="language_change",t.TakeScreenshot="screenshot",t.UpdateVisibility="visibility",t.OpenIDCredentials="openid_credentials",t.WidgetConfig="widget_config",t.CloseModalWidget="close_modal",t.ButtonClicked="button_clicked",t.SendEvent="send_event",t.SendToDevice="send_to_device",t.UpdateState="update_state",t.UpdateTurnServers="update_turn_servers",t))(Rr||{}),Fn=(t=>(t.SupportedApiVersions="supported_api_versions",t.ContentLoaded="content_loaded",t.SendSticker="m.sticker",t.UpdateAlwaysOnScreen="set_always_on_screen",t.GetOpenIDCredentials="get_openid",t.CloseModalWidget="close_modal",t.OpenModalWidget="open_modal",t.SetModalButtonEnabled="set_button_enabled",t.SendEvent="send_event",t.SendToDevice="send_to_device",t.WatchTurnServers="watch_turn_servers",t.UnwatchTurnServers="unwatch_turn_servers",t.BeeperReadRoomAccountData="com.beeper.read_room_account_data",t.MSC2876ReadEvents="org.matrix.msc2876.read_events",t.MSC2931Navigate="org.matrix.msc2931.navigate",t.MSC2974RenegotiateCapabilities="org.matrix.msc2974.request_capabilities",t.MSC3869ReadRelations="org.matrix.msc3869.read_relations",t.MSC3973UserDirectorySearch="org.matrix.msc3973.user_directory_search",t.MSC4039GetMediaConfigAction="org.matrix.msc4039.get_media_config",t.MSC4039UploadFileAction="org.matrix.msc4039.upload_file",t.MSC4039DownloadFileAction="org.matrix.msc4039.download_file",t.MSC4157UpdateDelayedEvent="org.matrix.msc4157.update_delayed_event",t))(Fn||{}),Mg=(t=>(t.Allowed="allowed",t.Blocked="blocked",t.PendingUserConfirmation="request",t))(Mg||{}),fQ=(t=>(t.Custom="m.custom",t.JitsiMeet="m.jitsi",t.Stickerpicker="m.stickerpicker",t))(fQ||{}),hQ=(t=>(t.Close="m.close",t))(hQ||{}),al=(t=>(t.Send="send",t.Receive="receive",t))(al||{});class vs{constructor(e,n,r,i,s){this.direction=e,this.eventType=n,this.kind=r,this.keyStr=i,this.raw=s}matchesAsStateEvent(e,n,r){return this.kind!=="state_event"||this.direction!==e||this.eventType!==n?!1:this.keyStr===null||this.keyStr===r}matchesAsToDeviceEvent(e,n){return!(this.kind!=="to_device"||this.direction!==e||this.eventType!==n)}matchesAsRoomEvent(e,n,r=null){if(this.kind!=="event"||this.direction!==e||this.eventType!==n)return!1;if(this.eventType==="m.room.message"){if(this.keyStr===null||this.keyStr===r)return!0}else return!0;return!1}matchesAsRoomAccountData(e,n){return!(this.kind!=="room_account"||this.direction!==e||this.eventType!==n)}static forStateEvent(e,n,r){n=n.replace(/#/g,"\\#"),r=r!=null?`#${r}`:"";const i=`org.matrix.msc2762.${e}.state_event:${n}${r}`;return vs.findEventCapabilities([i])[0]}static forToDeviceEvent(e,n){const r=`org.matrix.msc3819.${e}.to_device:${n}`;return vs.findEventCapabilities([r])[0]}static forRoomEvent(e,n){const r=`org.matrix.msc2762.${e}.event:${n}`;return vs.findEventCapabilities([r])[0]}static forRoomMessageEvent(e,n){n=n??"";const r=`org.matrix.msc2762.${e}.event:m.room.message#${n}`;return vs.findEventCapabilities([r])[0]}static forRoomAccountData(e,n){const r=`com.beeper.capabilities.${e}.room_account_data:${n}`;return vs.findEventCapabilities([r])[0]}static findEventCapabilities(e){const n=[];for(const r of e){let i=null,s,o=null;if(r.startsWith("org.matrix.msc2762.send.event:")?(i="send",o="event",s=r.substring(30)):r.startsWith("org.matrix.msc2762.send.state_event:")?(i="send",o="state_event",s=r.substring(36)):r.startsWith("org.matrix.msc3819.send.to_device:")?(i="send",o="to_device",s=r.substring(34)):r.startsWith("org.matrix.msc2762.receive.event:")?(i="receive",o="event",s=r.substring(33)):r.startsWith("org.matrix.msc2762.receive.state_event:")?(i="receive",o="state_event",s=r.substring(39)):r.startsWith("org.matrix.msc3819.receive.to_device:")?(i="receive",o="to_device",s=r.substring(37)):r.startsWith("com.beeper.capabilities.receive.room_account_data:")&&(i="receive",o="room_account",s=r.substring(50)),i===null||o===null||s===void 0)continue;const a=s.startsWith("m.room.message#")||o==="state_event";let c=null;if(s.includes("#")&&a){const l=s.split("#"),d=l.findIndex(h=>!h.endsWith("\\"));s=l.slice(0,d+1).map(h=>h.endsWith("\\")?h.substring(0,h.length-1):h).join("#"),c=l.slice(d+1).join("#")}n.push(new vs(i,s,o,c,r))}return n}}var Zh=(t=>(t.AnyRoom="*",t))(Zh||{}),SE=(t=>(t.Cancel="cancel",t.Restart="restart",t.Send="send",t))(SE||{});const mT=class mT extends Error{constructor(e,n){super(e),this.data=n}};mT.prototype.name=mT.name;let FC=mT;class cbe extends bT.EventEmitter{constructor(e=null,n=null){if(super(),this.capabilitiesFinished=!1,this.supportsMSC2974Renegotiate=!1,this.requestedCapabilities=[],this.turnServerWatchers=0,!globalThis.parent)throw new Error("No parent window. This widget doesn't appear to be embedded properly.");this.transport=new abe(dQ.FromWidget,e,globalThis.parent,globalThis),this.transport.targetOrigin=n,this.transport.on("message",this.handleMessage.bind(this))}hasCapability(e){return Array.isArray(this.approvedCapabilities)?this.approvedCapabilities.includes(e):this.requestedCapabilities.includes(e)}requestCapability(e){if(this.capabilitiesFinished&&!this.supportsMSC2974Renegotiate)throw new Error("Capabilities have already been negotiated");this.requestedCapabilities.push(e)}requestCapabilities(e){for(const n of e)this.requestCapability(n)}requestCapabilityForRoomTimeline(e){this.requestCapability(`org.matrix.msc2762.timeline:${e}`)}requestCapabilityToSendState(e,n){this.requestCapability(vs.forStateEvent(al.Send,e,n).raw)}requestCapabilityToReceiveState(e,n){this.requestCapability(vs.forStateEvent(al.Receive,e,n).raw)}requestCapabilityToSendToDevice(e){this.requestCapability(vs.forToDeviceEvent(al.Send,e).raw)}requestCapabilityToReceiveToDevice(e){this.requestCapability(vs.forToDeviceEvent(al.Receive,e).raw)}requestCapabilityToSendEvent(e){this.requestCapability(vs.forRoomEvent(al.Send,e).raw)}requestCapabilityToReceiveEvent(e){this.requestCapability(vs.forRoomEvent(al.Receive,e).raw)}requestCapabilityToSendMessage(e){this.requestCapability(vs.forRoomMessageEvent(al.Send,e).raw)}requestCapabilityToReceiveMessage(e){this.requestCapability(vs.forRoomMessageEvent(al.Receive,e).raw)}requestCapabilityToReceiveRoomAccountData(e){this.requestCapability(vs.forRoomAccountData(al.Receive,e).raw)}requestOpenIDConnectToken(){return new Promise((e,n)=>{this.transport.sendComplete(Fn.GetOpenIDCredentials,{}).then(r=>{const i=r.response;if(i.state===Mg.Allowed)e(i);else if(i.state===Mg.Blocked)n(new Error("User declined to verify their identity"));else if(i.state===Mg.PendingUserConfirmation){const s=o=>{o.preventDefault();const a=o.detail;a.data.original_request_id===r.requestId&&(a.data.state===Mg.Allowed?(e(a.data),this.transport.reply(a,{})):a.data.state===Mg.Blocked?(n(new Error("User declined to verify their identity")),this.transport.reply(a,{})):(n(new Error("Invalid state on reply: "+i.state)),this.transport.reply(a,{error:{message:"Invalid state"}})),this.off(`action:${Rr.OpenIDCredentials}`,s))};this.on(`action:${Rr.OpenIDCredentials}`,s)}else n(new Error("Invalid state: "+i.state))}).catch(n)})}updateRequestedCapabilities(){return this.transport.send(Fn.MSC2974RenegotiateCapabilities,{capabilities:this.requestedCapabilities}).then()}sendContentLoaded(){return this.transport.send(Fn.ContentLoaded,{}).then()}sendSticker(e){return this.transport.send(Fn.SendSticker,e).then()}setAlwaysOnScreen(e){return this.transport.send(Fn.UpdateAlwaysOnScreen,{value:e}).then(n=>n.success)}openModalWidget(e,n,r=[],i={},s=fQ.Custom){return this.transport.send(Fn.OpenModalWidget,{type:s,url:e,name:n,buttons:r,data:i}).then()}closeModalWidget(e={}){return this.transport.send(Fn.CloseModalWidget,e).then()}sendRoomEvent(e,n,r,i,s,o){return this.sendEvent(e,void 0,n,r,i,s,o)}sendStateEvent(e,n,r,i,s,o){return this.sendEvent(e,n,r,i,s,o)}sendEvent(e,n,r,i,s,o,a){return this.transport.send(Fn.SendEvent,{type:e,content:r,...n!==void 0&&{state_key:n},...i!==void 0&&{room_id:i},...s!==void 0&&{delay:s},...o!==void 0&&{parent_delay_id:o},...a!==void 0&&{sticky_duration_ms:a}})}cancelScheduledDelayedEvent(e){return this.transport.send(Fn.MSC4157UpdateDelayedEvent,{delay_id:e,action:SE.Cancel})}restartScheduledDelayedEvent(e){return this.transport.send(Fn.MSC4157UpdateDelayedEvent,{delay_id:e,action:SE.Restart})}sendScheduledDelayedEvent(e){return this.transport.send(Fn.MSC4157UpdateDelayedEvent,{delay_id:e,action:SE.Send})}sendToDevice(e,n,r){return this.transport.send(Fn.SendToDevice,{type:e,encrypted:n,messages:r})}readRoomAccountData(e,n){const r={type:e};return n&&(n.includes(Zh.AnyRoom)?r.room_ids=Zh.AnyRoom:r.room_ids=n),this.transport.send(Fn.BeeperReadRoomAccountData,r).then(i=>i.events)}readRoomEvents(e,n,r,i,s){const o={type:e,msgtype:r};return n!==void 0&&(o.limit=n),i&&(i.includes(Zh.AnyRoom)?o.room_ids=Zh.AnyRoom:o.room_ids=i),s&&(o.since=s),this.transport.send(Fn.MSC2876ReadEvents,o).then(a=>a.events)}async readEventRelations(e,n,r,i,s,o,a,c){if(!(await this.getClientVersions()).includes(bu.MSC3869))throw new Error("The read_relations action is not supported by the client.");const d={event_id:e,rel_type:r,event_type:i,room_id:n,to:a,from:o,limit:s,direction:c};return this.transport.send(Fn.MSC3869ReadRelations,d)}readStateEvents(e,n,r,i){const s={type:e,state_key:r===void 0?!0:r};return n!==void 0&&(s.limit=n),i&&(i.includes(Zh.AnyRoom)?s.room_ids=Zh.AnyRoom:s.room_ids=i),this.transport.send(Fn.MSC2876ReadEvents,s).then(o=>o.events)}setModalButtonEnabled(e,n){if(e===hQ.Close)throw new Error("The close button cannot be disabled");return this.transport.send(Fn.SetModalButtonEnabled,{button:e,enabled:n}).then()}navigateTo(e){if(!e||!e.startsWith("https://matrix.to/#"))throw new Error("Invalid matrix.to URI");return this.transport.send(Fn.MSC2931Navigate,{uri:e}).then()}async*getTurnServers(){let e;const n=async r=>{r.preventDefault(),e(r.detail.data),this.transport.reply(r.detail,{})};if(this.on(`action:${Rr.UpdateTurnServers}`,n),this.turnServerWatchers===0)try{await this.transport.send(Fn.WatchTurnServers,{})}catch(r){throw this.off(`action:${Rr.UpdateTurnServers}`,n),r}this.turnServerWatchers++;try{for(;;)yield await new Promise(r=>e=r)}finally{this.off(`action:${Rr.UpdateTurnServers}`,n),this.turnServerWatchers--,this.turnServerWatchers===0&&await this.transport.send(Fn.UnwatchTurnServers,{})}}async searchUserDirectory(e,n){if(!(await this.getClientVersions()).includes(bu.MSC3973))throw new Error("The user_directory_search action is not supported by the client.");const i={search_term:e,limit:n};return this.transport.send(Fn.MSC3973UserDirectorySearch,i)}async getMediaConfig(){if(!(await this.getClientVersions()).includes(bu.MSC4039))throw new Error("The get_media_config action is not supported by the client.");const n={};return this.transport.send(Fn.MSC4039GetMediaConfigAction,n)}async uploadFile(e){if(!(await this.getClientVersions()).includes(bu.MSC4039))throw new Error("The upload_file action is not supported by the client.");const r={file:e};return this.transport.send(Fn.MSC4039UploadFileAction,r)}async downloadFile(e){if(!(await this.getClientVersions()).includes(bu.MSC4039))throw new Error("The download_file action is not supported by the client.");const r={content_uri:e};return this.transport.send(Fn.MSC4039DownloadFileAction,r)}start(){this.transport.start(),this.getClientVersions().then(e=>{e.includes(bu.MSC2974)&&(this.supportsMSC2974Renegotiate=!0)})}handleMessage(e){const n=new CustomEvent(`action:${e.detail.action}`,{detail:e.detail,cancelable:!0});if(this.emit(`action:${e.detail.action}`,n),!n.defaultPrevented)switch(e.detail.action){case Rr.SupportedApiVersions:return this.replyVersions(e.detail);case Rr.Capabilities:return this.handleCapabilities(e.detail);case Rr.UpdateVisibility:return this.transport.reply(e.detail,{});case Rr.NotifyCapabilities:return this.transport.reply(e.detail,{});default:return this.transport.reply(e.detail,{error:{message:"Unknown or unsupported to-widget action: "+e.detail.action}})}}replyVersions(e){this.transport.reply(e,{supported_versions:obe})}getClientVersions(){return Array.isArray(this.cachedClientVersions)?Promise.resolve(this.cachedClientVersions):this.transport.send(Fn.SupportedApiVersions,{}).then(e=>(this.cachedClientVersions=e.supported_versions,e.supported_versions)).catch(e=>(console.warn("non-fatal error getting supported client versions: ",e),[]))}handleCapabilities(e){return this.capabilitiesFinished?this.transport.reply(e,{error:{message:"Capability negotiation already completed"}}):this.getClientVersions().then(n=>(n.includes(bu.MSC2871)?this.once(`action:${Rr.NotifyCapabilities}`,r=>{this.approvedCapabilities=r.detail.data.approved,this.emit("ready")}):this.emit("ready"),this.capabilitiesFinished=!0,this.transport.reply(e,{capabilities:this.requestedCapabilities})))}}var mf=(t=>(t.Screenshots="m.capability.screenshot",t.StickerSending="m.sticker",t.AlwaysOnScreen="m.always_on_screen",t.RequiresClient="io.element.requires_client",t.MSC2931Navigate="org.matrix.msc2931.navigate",t.MSC3846TurnServers="town.robin.msc3846.turn_servers",t.MSC3973UserDirectorySearch="org.matrix.msc3973.user_directory_search",t.MSC4039UploadFile="org.matrix.msc4039.upload_file",t.MSC4039DownloadFile="org.matrix.msc4039.download_file",t.MSC4157SendDelayedEvent="org.matrix.msc4157.send.delayed_event",t.MSC4157UpdateDelayedEvent="org.matrix.msc4157.update_delayed_event",t.MSC4407SendStickyEvent="org.matrix.msc4407.send.sticky_event",t.MSC4407ReceiveStickyEvent="org.matrix.msc4407.receive.sticky_event",t))(mf||{});function lbe(t){const e=t.error;return typeof e=="object"&&e!==null&&"message"in e&&typeof e.message=="string"}function HB(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function cw(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?HB(Object(n),!0).forEach(function(r){L(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):HB(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function ube(t){var e,n,r,i=2;for(typeof Symbol<"u"&&(n=Symbol.asyncIterator,r=Symbol.iterator);i--;){if(n&&(e=t[n])!=null)return e.call(t);if(r&&(e=t[r])!=null)return new wE(e.call(t));n="@@asyncIterator",r="@@iterator"}throw new TypeError("Object is not async iterable")}function wE(t){function e(n){if(Object(n)!==n)return Promise.reject(new TypeError(n+" is not an object."));var r=n.done;return Promise.resolve(n.value).then(function(i){return{value:i,done:r}})}return wE=function(r){this.s=r,this.n=r.next},wE.prototype={s:null,n:null,next:function(){return e(this.n.apply(this.s,arguments))},return:function(r){var i=this.s.return;return i===void 0?Promise.resolve({value:r,done:!0}):e(i.apply(this.s,arguments))},throw:function(r){var i=this.s.return;return i===void 0?Promise.reject(r):e(i.apply(this.s,arguments))}},new wE(t)}var EE=(function(t){return t.PendingEventsChanged="PendingEvent.pendingEventsChanged",t})({});class pQ extends MT{constructor(e,n,r,i,s){var o,a;super(i),o=this,this.widgetApi=e,this.capabilities=n,this.roomId=r,L(this,"room",void 0),L(this,"widgetApiReady",void 0),L(this,"roomStateSynced",void 0),L(this,"lifecycle",void 0),L(this,"syncState",null),L(this,"pendingSendingEventsTxId",[]),L(this,"eventEmitter",new Kn),L(this,"syncApiResolver",Promise.withResolvers()),L(this,"updateTxId",(function(){var d=B(function*(h){if(h.getSender()===o.getUserId()&&o.pendingSendingEventsTxId.some(v=>h.getType()===v.type)){for(var m,g=(m=o.pendingSendingEventsTxId.find(v=>v.id===h.getId()))===null||m===void 0?void 0:m.txId;!g&&o.pendingSendingEventsTxId.length>0;){var y;yield new Promise(v=>o.eventEmitter.once(EE.PendingEventsChanged,()=>v())),g=(y=o.pendingSendingEventsTxId.find(v=>v.id===h.getId()))===null||y===void 0?void 0:y.txId}g&&(h.setTxnId(g),h.setUnsigned(cw(cw({},h.getUnsigned()),{},{transaction_id:g}))),o.pendingSendingEventsTxId=o.pendingSendingEventsTxId.filter(v=>v.id!==h.getId()),o.pendingSendingEventsTxId.length===0&&o.eventEmitter.emit(EE.PendingEventsChanged)}});return function(h){return d.apply(this,arguments)}})()),L(this,"onEvent",(function(){var d=B(function*(h){if(h.preventDefault(),h.detail.data.room_id===o.roomId){var m=new ns(h.detail.data);yield o.updateTxId(m),yield o.syncApiResolver.promise,o.syncApi instanceof yf?(yield o.supportUpdateState())?yield o.syncApi.injectRoomEvents(o.room,void 0,[],[m]):yield o.syncApi.injectRoomEvents(o.room,[],void 0,[m]):(yield o.supportUpdateState())?yield o.syncApi.injectRoomEvents(o.room,[],[m]):N.error("slididng sync cannot be used in widget mode if the client widget driver does not support the version: 'org.matrix.msc2762_update_state'"),o.emit(De.Event,m),m.unstableStickyInfo!==void 0&&o.room._unstable_addStickyEvents([m]),o.setSyncState(Qt.Syncing),N.info("Received event ".concat(m.getId()," ").concat(m.getType()))}else{var{event_id:g,room_id:y}=h.detail.data;N.info("Received event ".concat(g," for a different room ").concat(y,"; discarding"))}yield o.ack(h)});return function(h){return d.apply(this,arguments)}})()),L(this,"onToDevice",(function(){var d=B(function*(h){h.preventDefault();var m=new ns({type:h.detail.data.type,sender:h.detail.data.sender,content:h.detail.data.content});h.detail.data.encrypted&&m.makeEncrypted(Z.RoomMessageEncrypted,{},"",""),o.emit(De.ToDeviceEvent,m),o.setSyncState(Qt.Syncing),yield o.ack(h)});return function(h){return d.apply(this,arguments)}})()),L(this,"onStateUpdate",(function(){var d=B(function*(h){h.preventDefault(),(yield o.supportUpdateState())||N.warn("received update_state widget action but the widget driver did not claim to support 'org.matrix.msc2762_update_state'"),yield o.syncApiResolver.promise;for(var m of h.detail.data.state)if(m.room_id===o.roomId){var g=new ns(m);o.syncApi instanceof yf?yield o.syncApi.injectRoomEvents(o.room,void 0,[g]):yield o.syncApi.injectRoomEvents(o.room,[g]),N.info("Updated state entry ".concat(g.getType()," ").concat(g.getStateKey()," to ").concat(g.getId()))}else{var{event_id:y,room_id:v}=h.detail.data;N.info("Received state entry ".concat(y," for a different room ").concat(v,"; discarding"))}yield o.ack(h)});return function(h){return d.apply(this,arguments)}})());var c=this.widgetApi.transport.send.bind(this.widgetApi.transport);this.widgetApi.transport.send=(function(){var d=B(function*(h,m){try{return yield c(h,m)}catch(g){qB(g)}});return function(h,m){return d.apply(this,arguments)}})();var l=this.widgetApi.transport.sendComplete.bind(this.widgetApi.transport);this.widgetApi.transport.sendComplete=(function(){var d=B(function*(h,m){try{return yield l(h,m)}catch(g){qB(g)}});return function(h,m){return d.apply(this,arguments)}})(),this.widgetApiReady=new Promise(d=>this.widgetApi.once("ready",d)),this.roomStateSynced=(a=n.receiveState)!==null&&a!==void 0&&a.length?new Promise(d=>this.widgetApi.once("action:".concat(Rr.UpdateState),d)):Promise.resolve(),this.requestInitialCapabilities(n,r),e.on("action:".concat(Rr.SendEvent),this.onEvent),e.on("action:".concat(Rr.SendToDevice),this.onToDevice),e.on("action:".concat(Rr.UpdateState),this.onStateUpdate),e.start(),s&&e.sendContentLoaded()}requestInitialCapabilities(e,n){var r,i,s,o,a,c,l,d,h,m,g,y;((r=e.sendEvent)!==null&&r!==void 0&&r.length||(i=e.receiveEvent)!==null&&i!==void 0&&i.length||e.sendMessage===!0||Array.isArray(e.sendMessage)&&e.sendMessage.length||e.receiveMessage===!0||Array.isArray(e.receiveMessage)&&e.receiveMessage.length||(s=e.sendState)!==null&&s!==void 0&&s.length||(o=e.receiveState)!==null&&o!==void 0&&o.length)&&this.widgetApi.requestCapabilityForRoomTimeline(n),(a=e.sendEvent)===null||a===void 0||a.forEach(v=>this.widgetApi.requestCapabilityToSendEvent(v)),(c=e.receiveEvent)===null||c===void 0||c.forEach(v=>this.widgetApi.requestCapabilityToReceiveEvent(v)),e.sendMessage===!0?this.widgetApi.requestCapabilityToSendMessage():Array.isArray(e.sendMessage)&&e.sendMessage.forEach(v=>this.widgetApi.requestCapabilityToSendMessage(v)),e.receiveMessage===!0?this.widgetApi.requestCapabilityToReceiveMessage():Array.isArray(e.receiveMessage)&&e.receiveMessage.forEach(v=>this.widgetApi.requestCapabilityToReceiveMessage(v)),(l=e.sendState)===null||l===void 0||l.forEach(v=>{var{eventType:E,stateKey:w}=v;return this.widgetApi.requestCapabilityToSendState(E,w)}),(d=e.receiveState)===null||d===void 0||d.forEach(v=>{var{eventType:E,stateKey:w}=v;return this.widgetApi.requestCapabilityToReceiveState(E,w)}),(h=e.sendToDevice)===null||h===void 0||h.forEach(v=>this.widgetApi.requestCapabilityToSendToDevice(v)),(m=e.receiveToDevice)===null||m===void 0||m.forEach(v=>this.widgetApi.requestCapabilityToReceiveToDevice(v)),e.sendDelayedEvents&&((g=e.sendEvent)!==null&&g!==void 0&&g.length||e.sendMessage===!0||Array.isArray(e.sendMessage)&&e.sendMessage.length||(y=e.sendState)!==null&&y!==void 0&&y.length)&&this.widgetApi.requestCapability(mf.MSC4157SendDelayedEvent),e.updateDelayedEvents&&this.widgetApi.requestCapability(mf.MSC4157UpdateDelayedEvent),e.sendSticky&&this.widgetApi.requestCapability(mf.MSC4407SendStickyEvent),e.receiveSticky&&this.widgetApi.requestCapability(mf.MSC4407ReceiveStickyEvent),e.turnServers&&this.widgetApi.requestCapability(mf.MSC3846TurnServers)}supportUpdateState(){var e=this;return B(function*(){return(yield e.widgetApi.getClientVersions()).includes(bu.MSC2762_UPDATE_STATE)})()}startClient(){var e=arguments,n=this;return B(function*(){var r=e.length>0&&e[0]!==void 0?e[0]:{};n.lifecycle=new AbortController;var i=n.getUserId();if(i&&n.store.storeUser(new Hu(i)),r.slidingSync?n.syncApi=new BX(r.slidingSync,n,r,n.buildSyncApiOptions()):n.syncApi=new yf(n,r,n.buildSyncApiOptions()),n.syncApiResolver.resolve(),n.room=n.syncApi.createRoom(n.roomId),n.store.storeRoom(n.room),yield n.widgetApiReady,yield n.supportUpdateState())yield n.roomStateSynced;else{var s,o;yield Promise.all((s=(o=n.capabilities.receiveState)===null||o===void 0?void 0:o.map((function(){var a=B(function*(c){var{eventType:l,stateKey:d}=c,h=yield n.widgetApi.readStateEvents(l,void 0,d,[n.roomId]),m=h.map(g=>new ns(g));n.syncApi instanceof yf?yield n.syncApi.injectRoomEvents(n.room,void 0,m):yield n.syncApi.injectRoomEvents(n.room,m),m.forEach(g=>{n.emit(De.Event,g),N.info("Backfilled event ".concat(g.getId()," ").concat(g.getType()," ").concat(g.getStateKey()))})});return function(c){return a.apply(this,arguments)}})()))!==null&&s!==void 0?s:[])}r.clientWellKnownPollPeriod!==void 0&&(n.clientWellKnownIntervalID=setInterval(()=>{n.fetchClientWellKnown()},1e3*r.clientWellKnownPollPeriod),n.fetchClientWellKnown()),n.setSyncState(Qt.Syncing),N.info("Finished initial sync"),n.matrixRTC.start(),n.capabilities.turnServers&&n.watchTurnServers()})()}stopClient(){this.widgetApi.off("action:".concat(Rr.SendEvent),this.onEvent),this.widgetApi.off("action:".concat(Rr.SendToDevice),this.onToDevice),this.widgetApi.off("action:".concat(Rr.UpdateState),this.onStateUpdate),super.stopClient(),this.lifecycle.abort()}joinRoom(e){var n=this;return B(function*(){if(e===n.roomId)return n.room;throw new Error("Unknown room: ".concat(e))})()}encryptAndSendEvent(e,n,r,i){var s=this;return B(function*(){var o,a=i,c;r&&MC(r)?c=r:a||(a=r);var l=(o=a)===null||o===void 0?void 0:o["org.matrix.msc4354.sticky_duration_ms"];if(l!==void 0&&typeof l!="number")throw new Error("Sticky duration must be a number when defined");var d=l,h=n.event.redacts?cw(cw({},n.getContent()),{},{redacts:n.event.redacts}):n.getContent();if(c){var m=yield s.widgetApi.sendRoomEvent(n.getType(),h,e.roomId,"delay"in c?c.delay:void 0,"parent_delay_id"in c?c.parent_delay_id:void 0,d).catch(jo);return s.validateSendDelayedEventResponse(m)}var g=n.getTxnId();g&&s.pendingSendingEventsTxId.push({type:n.getType(),id:void 0,txId:g});var y;try{y=yield s.widgetApi.sendRoomEvent(n.getType(),h,e.roomId,void 0,void 0,d).catch(jo)}catch(v){throw s.updatePendingEventStatus(e,n,ct.NOT_SENT),v}return e.updatePendingEvent(n,ct.SENT,y.event_id),s.pendingSendingEventsTxId.forEach(v=>{v.txId===g&&(v.id=y.event_id)}),s.eventEmitter.emit(EE.PendingEventsChanged),{event_id:y.event_id}})()}sendStateEvent(e,n,r){var i=arguments,s=this;return B(function*(){var o=i.length>3&&i[3]!==void 0?i[3]:"",a=yield s.widgetApi.sendStateEvent(n,o,r,e).catch(jo);if(a.event_id===void 0)throw new Error("'event_id' absent from response to an event request");return{event_id:a.event_id}})()}_unstable_sendDelayedStateEvent(e,n,r,i){var s=arguments,o=this;return B(function*(){var a=s.length>4&&s[4]!==void 0?s[4]:"";if(!(yield o.doesServerSupportUnstableFeature(Qi)))throw new Wo("Server does not support the delayed events API","sendDelayedStateEvent");var c=yield o.widgetApi.sendStateEvent(r,a,i,e,"delay"in n?n.delay:void 0,"parent_delay_id"in n?n.parent_delay_id:void 0).catch(jo);return o.validateSendDelayedEventResponse(c)})()}validateSendDelayedEventResponse(e){if(e.delay_id===void 0)throw new Error("'delay_id' absent from response to a delayed event request");return{delay_id:e.delay_id}}_unstable_updateDelayedEvent(e,n){var r=this;return B(function*(){if(!(yield r.doesServerSupportUnstableFeature(Qi)))throw new Wo("Server does not support the delayed events API","updateDelayedEvent");var i;switch(n){case hp.Cancel:i=r.widgetApi.cancelScheduledDelayedEvent;break;case hp.Restart:i=r.widgetApi.cancelScheduledDelayedEvent;break;case hp.Send:i=r.widgetApi.sendScheduledDelayedEvent;break}return yield i.call(r.widgetApi,e).catch(jo),{}})()}_unstable_cancelScheduledDelayedEvent(e){var n=this;return B(function*(){if(!(yield n.doesServerSupportUnstableFeature(Qi)))throw new Wo("Server does not support the delayed events API","cancelScheduledDelayedEvent");return yield n.widgetApi.cancelScheduledDelayedEvent(e).catch(jo),{}})()}_unstable_restartScheduledDelayedEvent(e){var n=this;return B(function*(){if(!(yield n.doesServerSupportUnstableFeature(Qi)))throw new Wo("Server does not support the delayed events API","restartScheduledDelayedEvent");return yield n.widgetApi.restartScheduledDelayedEvent(e).catch(jo),{}})()}_unstable_sendScheduledDelayedEvent(e){var n=this;return B(function*(){if(!(yield n.doesServerSupportUnstableFeature(Qi)))throw new Wo("Server does not support the delayed events API","sendScheduledDelayedEvent");return yield n.widgetApi.sendScheduledDelayedEvent(e).catch(jo),{}})()}encryptAndSendToDevice(e,n,r){var i=this;return B(function*(){var s=new Bu(()=>new Map);for(var{userId:o,deviceId:a}of n)s.getOrCreate(o).set(a,r);yield i.widgetApi.sendToDevice(e,!0,ip(s)).catch(jo)})()}sendToDevice(e,n){var r=this;return B(function*(){return yield r.widgetApi.sendToDevice(e,!1,ip(n)).catch(jo),{}})()}getOpenIdToken(){var e=this;return B(function*(){var n=yield e.widgetApi.requestOpenIDConnectToken().catch(jo);return{access_token:n.access_token,expires_in:n.expires_in,matrix_server_name:n.matrix_server_name,token_type:n.token_type}})()}queueToDevice(e){var n=this;return B(function*(){var{eventType:r,batch:i}=e,s=new Bu(()=>new Map);for(var{userId:o,deviceId:a,payload:c}of i)s.getOrCreate(o).set(a,c);yield n.widgetApi.sendToDevice(r,!1,ip(s)).catch(jo)})()}sendToDeviceViaWidgetApi(e,n,r){var i=this;return B(function*(){yield i.widgetApi.sendToDevice(e,n,ip(r)).catch(jo)})()}checkTurnServers(){var e=this;return B(function*(){return e.turnServers.length>0})()}getSyncState(){return this.syncState}setSyncState(e){var n=this.syncState;this.syncState=e,this.emit(De.Sync,e,n)}ack(e){var n=this;return B(function*(){yield n.widgetApi.transport.reply(e.detail,{})})()}watchTurnServers(){var e=this;return B(function*(){var n=e.widgetApi.getTurnServers(),r=()=>{n.return(void 0)};e.lifecycle.signal.addEventListener("abort",r);try{var i=!1,s=!1,o;try{for(var a=ube(n),c;i=!(c=yield a.next()).done;i=!1){var l=c.value;e.turnServers=[{urls:l.uris,username:l.username,credential:l.password}],e.emit(De.TurnServers,e.turnServers),N.log("Received TURN server: ".concat(l.uris))}}catch(d){s=!0,o=d}finally{try{i&&a.return!=null&&(yield a.return())}finally{if(s)throw o}}}catch(d){N.warn("Error watching TURN servers",d)}finally{e.lifecycle.signal.removeEventListener("abort",r)}})()}}function qB(t){throw t instanceof FC&&t.data.matrix_api_error?In.fromWidgetApiErrorData(t.data.matrix_api_error):t}function jo(t){throw t instanceof Error&&t.message==="Request timed out"?new Xp("widget api timeout"):t}class dbe{constructor(){L(this,"unthreadedReadReceipts",new Map),L(this,"threadedReadReceipts",new Bu(()=>new Map))}setUnthreaded(e,n){this.unthreadedReadReceipts.set(e,n)}setThreaded(e,n,r){this.threadedReadReceipts.getOrCreate(e).set(n,r)}allUnthreaded(){return this.unthreadedReadReceipts.entries()}*allThreaded(){for(var e of this.threadedReadReceipts.values())for(var n of e.entries())yield n}consumeEphemeralEvents(e){e?.forEach(n=>{n.type!==Z.Receipt||!n.content||Object.keys(n.content).forEach(r=>{Object.entries(n.content[r]).forEach(i=>{var[s,o]=i;if(YO(s))for(var a of Object.keys(o)){var c=n.content[r][s][a],l={data:n.content[r][s][a],type:s,eventId:r};c.thread_id?this.setThreaded(c.thread_id,a,l):this.setUnthreaded(a,l)}})})})}buildAccumulatedReceiptEvent(e){var n={type:Z.Receipt,room_id:e,content:{}},r=new Bu(()=>new Bu(()=>new Map));for(var[i,s]of this.allUnthreaded())r.getOrCreate(s.eventId).getOrCreate(s.type).set(i,s.data);for(var[o,a]of this.allThreaded())r.getOrCreate(a.eventId).getOrCreate(a.type).set(o,a.data);return n.content=ip(r),r.size>0?n:null}}var mu=(function(t){return t.Invite="invite",t.Leave="leave",t.Join="join",t.Knock="knock",t})({});function fbe(t){return"_localTs"in t&&t._localTs!==void 0}class mQ{constructor(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.opts=e,L(this,"accountData",{}),L(this,"inviteRooms",{}),L(this,"knockRooms",{}),L(this,"joinRooms",{}),L(this,"nextBatch",null),this.opts.maxTimelineEntries=this.opts.maxTimelineEntries||50}accumulate(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;this.accumulateRooms(e,n),this.accumulateAccountData(e),this.nextBatch=e.next_batch}accumulateAccountData(e){!e.account_data||!e.account_data.events||e.account_data.events.forEach(n=>{this.accountData[n.type]=n})}accumulateRooms(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;e.rooms&&(e.rooms.invite&&Object.keys(e.rooms.invite).forEach(r=>{this.accumulateRoom(r,mu.Invite,e.rooms.invite[r],n)}),e.rooms.join&&Object.keys(e.rooms.join).forEach(r=>{this.accumulateRoom(r,mu.Join,e.rooms.join[r],n)}),e.rooms.leave&&Object.keys(e.rooms.leave).forEach(r=>{this.accumulateRoom(r,mu.Leave,e.rooms.leave[r],n)}),e.rooms.knock&&Object.keys(e.rooms.knock).forEach(r=>{this.accumulateRoom(r,mu.Knock,e.rooms.knock[r],n)}))}accumulateRoom(e,n,r){var i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;switch(n){case mu.Invite:this.knockRooms[e]&&delete this.knockRooms[e],this.accumulateInviteState(e,r);break;case mu.Knock:this.accumulateKnockState(e,r);break;case mu.Join:this.knockRooms[e]?delete this.knockRooms[e]:this.inviteRooms[e]&&delete this.inviteRooms[e],this.accumulateJoinState(e,r,i);break;case mu.Leave:this.knockRooms[e]?delete this.knockRooms[e]:this.inviteRooms[e]?delete this.inviteRooms[e]:delete this.joinRooms[e];break;default:N.error("Unknown cateogory: ",n)}}accumulateInviteState(e,n){if(!(!n.invite_state||!n.invite_state.events)){if(!this.inviteRooms[e]){this.inviteRooms[e]={invite_state:n.invite_state};return}var r=this.inviteRooms[e];n.invite_state.events.forEach(i=>{for(var s=!1,o=0;o<r.invite_state.events.length;o++){var a=r.invite_state.events[o];a.type===i.type&&a.state_key==i.state_key&&(r.invite_state.events[o]=i,s=!0)}s||r.invite_state.events.push(i)})}}accumulateKnockState(e,n){if(!(!n.knock_state||!n.knock_state.events)){if(!this.knockRooms[e]){this.knockRooms[e]={knock_state:n.knock_state};return}var r=this.knockRooms[e];n.knock_state.events.forEach(i=>{for(var s=!1,o=0;o<r.knock_state.events.length;o++){var a=r.knock_state.events[o];a.type===i.type&&a.state_key==i.state_key&&(r.knock_state.events[o]=i,s=!0)}s||r.knock_state.events.push(i)})}}accumulateJoinState(e,n){var r,i,s,o,a,c,l,d=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,h=Date.now();this.joinRooms[e]||(this.joinRooms[e]={_currentState:Object.create(null),_timeline:[],_accountData:Object.create(null),_unreadNotifications:{},_unreadThreadNotifications:{},_summary:{},_receipts:new dbe,_stickyEvents:[]});var m=this.joinRooms[e];if(n.account_data&&n.account_data.events&&n.account_data.events.forEach(M=>{m._accountData[M.type]=M}),n.unread_notifications&&(m._unreadNotifications=n.unread_notifications),m._unreadThreadNotifications=(r=(i=n[Lb.stable])!==null&&i!==void 0?i:n[Lb.unstable])!==null&&r!==void 0?r:void 0,n.summary){var g,y,v,E="m.heroes",w="m.invited_member_count",k="m.joined_member_count",x=m._summary,C=n.summary;x[E]=(g=C[E])!==null&&g!==void 0?g:x[E],x[k]=(y=C[k])!==null&&y!==void 0?y:x[k],x[w]=(v=C[w])!==null&&v!==void 0?v:x[w]}if(m._receipts.consumeEphemeralEvents((s=n.ephemeral)===null||s===void 0?void 0:s.events),n.timeline&&n.timeline.limited&&(m._timeline=[]),(o=n.state)===null||o===void 0||(o=o.events)===null||o===void 0||o.forEach(M=>{lw(m._currentState,M)}),(a=n["org.matrix.msc4222.state_after"])===null||a===void 0||(a=a.events)===null||a===void 0||a.forEach(M=>{lw(m._currentState,M)}),(c=n.timeline)===null||c===void 0||(c=c.events)===null||c===void 0||c.forEach((M,O)=>{var P;n["org.matrix.msc4222.state_after"]||lw(m._currentState,M);var D;if(d)D=M;else{var j;D=Object.assign({},M),D.unsigned!==void 0&&(D.unsigned=Object.assign({},D.unsigned));var $=(j=M.unsigned)===null||j===void 0?void 0:j.age;$!==void 0&&(D._localTs=Date.now()-$)}m._timeline.push({event:D,token:O===0&&(P=n.timeline.prev_batch)!==null&&P!==void 0?P:null})}),m._stickyEvents=m._stickyEvents.filter(M=>{var{expiresTs:O}=M;return O>h}),(l=n.msc4354_sticky)!==null&&l!==void 0&&l.events&&(m._stickyEvents=m._stickyEvents.concat(n.msc4354_sticky.events.map(M=>{var O=Math.min(M.msc4354_sticky.duration_ms,kP),P=Math.min(M.origin_server_ts,h);return{event:M,expiresTs:O+P}}))),m._timeline.length>this.opts.maxTimelineEntries){for(var R=m._timeline.length-this.opts.maxTimelineEntries,T=R;T<m._timeline.length;T++)if(m._timeline[T].token){m._timeline=m._timeline.slice(T,m._timeline.length);break}}}getJSON(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,n={join:{},invite:{},knock:{},leave:{}};Object.keys(this.inviteRooms).forEach(i=>{n.invite[i]=this.inviteRooms[i]}),Object.keys(this.knockRooms).forEach(i=>{n.knock[i]=this.knockRooms[i]}),Object.keys(this.joinRooms).forEach(i=>{var s,o=this.joinRooms[i],a={ephemeral:{events:[]},account_data:{events:[]},state:{events:[]},"org.matrix.msc4222.state_after":{events:[]},timeline:{events:[],prev_batch:null},unread_notifications:o._unreadNotifications,unread_thread_notifications:o._unreadThreadNotifications,summary:o._summary,msc4354_sticky:(s=o._stickyEvents)!==null&&s!==void 0&&s.length?{events:o._stickyEvents.map(g=>g.event)}:void 0};Object.keys(o._accountData).forEach(g=>{a.account_data.events.push(o._accountData[g])});var c=o._receipts.buildAccumulatedReceiptEvent(i);c&&a.ephemeral.events.push(c),o._timeline.forEach(g=>{if(!a.timeline.prev_batch){if(!g.token)return;a.timeline.prev_batch=g.token}var y;!e&&fbe(g.event)?(y=Object.assign({},g.event),y.unsigned!==void 0&&(y.unsigned=Object.assign({},y.unsigned)),delete y._localTs,y.unsigned=y.unsigned||{},y.unsigned.age=Date.now()-g.event._localTs):y=g.event,a.timeline.events.push(y)});for(var l=Object.create(null),d=a.timeline.events.length-1;d>=0;d--){var h=a.timeline.events[d];if(!(h.state_key===null||h.state_key===void 0)){var m=F_(h);m.unsigned&&(m.unsigned.prev_content&&(m.content=m.unsigned.prev_content),m.unsigned.prev_sender&&(m.sender=m.unsigned.prev_sender)),lw(l,m)}}Object.keys(o._currentState).forEach(g=>{Object.keys(o._currentState[g]).forEach(y=>{var v=o._currentState[g][y];a["org.matrix.msc4222.state_after"].events.push(v),l[g]&&l[g][y]&&(v=l[g][y]),a.state.events.push(v)})}),n.join[i]=a});var r=[];return Object.keys(this.accountData).forEach(i=>{r.push(this.accountData[i])}),{nextBatch:this.nextBatch,roomsData:n,accountData:r}}getNextBatchToken(){return this.nextBatch}}function lw(t,e){e.state_key===null||e.state_key===void 0||!e.type||(t[e.type]||(t[e.type]=Object.create(null)),t[e.type][e.state_key]=e)}var gQ=(function(t){return t[t.Blocked=-1]="Blocked",t[t.Unverified=0]="Unverified",t[t.Verified=1]="Verified",t})({});class hbe{constructor(e){L(this,"deviceId",void 0),L(this,"userId",void 0),L(this,"algorithms",void 0),L(this,"keys",void 0),L(this,"verified",void 0),L(this,"signatures",void 0),L(this,"displayName",void 0),L(this,"dehydrated",!1),this.deviceId=e.deviceId,this.userId=e.userId,this.algorithms=e.algorithms,this.keys=e.keys,this.verified=e.verified||gQ.Unverified,this.signatures=e.signatures||new Map,this.displayName=e.displayName,this.dehydrated=!!e.dehydrated}getFingerprint(){return this.keys.get("ed25519:".concat(this.deviceId))}getIdentityKey(){return this.keys.get("curve25519:".concat(this.deviceId))}}var VB=function(){},pbe=10;class mbe{constructor(e,n){var r,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.client=e,this.timelineSet=n,L(this,"windowLimit",void 0),L(this,"start",void 0),L(this,"end",void 0),L(this,"eventCount",0),this.windowLimit=i.windowLimit||1e3,(r=n.room)===null||r===void 0||r.on(Oe.Timeline,this.onTimelineEvent.bind(this))}load(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:20,r=i=>{if(!i)throw new Error("No timeline given to initFields");var s,o=i.getEvents();if(!e)s=o.length;else if(s=o.findIndex(l=>l.getId()===e),s<0)throw new Error("getEventTimeline result didn't include requested event");var a=Math.min(o.length,s+Math.ceil(n/2)),c=Math.max(0,a-n);this.start=new ZA(i,c-i.getBaseIndex()),this.end=new ZA(i,a-i.getBaseIndex()),this.eventCount=a-c};return this.timelineSet.getTimelineForEvent(e)?(r(this.timelineSet.getTimelineForEvent(e)),Promise.resolve()):e?this.client.getEventTimeline(this.timelineSet,e).then(r):(r(this.timelineSet.getLiveTimeline()),Promise.resolve())}getTimelineIndex(e){if(e==Fe.BACKWARDS){var n;return(n=this.start)!==null&&n!==void 0?n:null}else if(e==Fe.FORWARDS){var r;return(r=this.end)!==null&&r!==void 0?r:null}else throw new Error("Invalid direction '"+e+"'")}extend(e,n){var r=this.getTimelineIndex(e);if(!r)return!1;var i=e==Fe.BACKWARDS?r.retreat(n):r.advance(n);if(i){this.eventCount+=i,VB("TimelineWindow: increased cap by "+i+" (now "+this.eventCount+")");var s=this.eventCount-this.windowLimit;return s>0&&this.unpaginate(s,e!=Fe.BACKWARDS),!0}return!1}onTimelineEvent(e,n,r,i){i&&this.onEventRemoved()}onEventRemoved(){var e=this.getEvents();e.length>0&&e[e.length-1]===void 0&&this.end&&this.end.index--}canPaginate(e){var n=this.getTimelineIndex(e);if(!n)return!1;if(e==Fe.BACKWARDS){if(n.index>n.minIndex())return!0}else if(n.index<n.maxIndex())return!0;var r=n.timeline.getNeighbouringTimeline(e),i=n.timeline.getPaginationToken(e);return!!r||!!i}paginate(e,n){var r=arguments,i=this;return B(function*(){var s=r.length>2&&r[2]!==void 0?r[2]:!0,o=r.length>3&&r[3]!==void 0?r[3]:pbe,a=i.getTimelineIndex(e);if(!a)return!1;if(a.pendingPaginate)return a.pendingPaginate;if(i.extend(e,n))return!0;if(!s||o===0)return!1;var c=a.timeline.getPaginationToken(e);if(!c)return!1;var l=i.client.paginateEventTimeline(a.timeline,{backwards:e==Fe.BACKWARDS,limit:n}).finally(function(){a.pendingPaginate=void 0}).then(d=>d?i.paginate(e,n,!0,o-1):i.paginate(e,n,!1,0));return a.pendingPaginate=l,l})()}unpaginate(e,n){var r=n?this.start:this.end;if(!r)throw new Error("Attempting to unpaginate startOfTimeline=".concat(n," but don't have this direction"));if(e>this.eventCount||e<0)throw new Error("Attemting to unpaginate ".concat(e," events, but only have ").concat(this.eventCount," in the timeline"));for(;e>0;){var i=n?r.advance(e):r.retreat(e);if(i<=0)throw new Error("Unable to unpaginate any further, but still have "+this.eventCount+" events");e-=i,this.eventCount-=i,VB("TimelineWindow.unpaginate: dropped "+i+" (now "+this.eventCount+")")}}getEvents(){if(!this.start)return[];for(var e=[],n=this.start.timeline;n;){var r,i,s=n.getEvents(),o=0,a=s.length;n===this.start.timeline&&(o=this.start.index+n.getBaseIndex()),n===((r=this.end)===null||r===void 0?void 0:r.timeline)&&(a=this.end.index+n.getBaseIndex());for(var c=o;c<a;c++)e.push(s[c]);if(n===((i=this.end)===null||i===void 0?void 0:i.timeline))break;n=n.getNeighbouringTimeline(Fe.FORWARDS)}return e}}class ZA{constructor(e,n){this.timeline=e,this.index=n,L(this,"pendingPaginate",void 0)}minIndex(){return this.timeline.getBaseIndex()*-1}maxIndex(){return this.timeline.getEvents().length-this.timeline.getBaseIndex()}advance(e){if(!e)return 0;var n;if(e<0){if(n=Math.max(e,this.minIndex()-this.index),n<0)return this.index+=n,n}else if(n=Math.min(e,this.maxIndex()-this.index),n>0)return this.index+=n,n;var r=this.timeline.getNeighbouringTimeline(e<0?Fe.BACKWARDS:Fe.FORWARDS);return r?(this.timeline=r,e<0?this.index=this.maxIndex():this.index=this.minIndex(),this.advance(e)):0}retreat(e){return this.advance(e*-1)*-1}}var X0="m.login.email.identity",KB="m.login.msisdn",eM=(function(t){return t.Password="m.login.password",t.Recaptcha="m.login.recaptcha",t.Terms="m.login.terms",t.Email="m.login.email.identity",t.Msisdn="m.login.msisdn",t.Sso="m.login.sso",t.SsoUnstable="org.matrix.login.sso",t.Dummy="m.login.dummy",t.RegistrationToken="m.login.registration_token",t.UnstableRegistrationToken="org.matrix.msc3231.login.registration_token",t.OAuth="m.oauth",t})({});class vQ extends Error{constructor(e,n,r){super(e),this.required_stages=n,this.flows=r,L(this,"name","NoAuthFlowFoundError")}}class IP{constructor(e){var n=this;L(this,"matrixClient",void 0),L(this,"inputs",void 0),L(this,"clientSecret",void 0),L(this,"requestCallback",void 0),L(this,"busyChangedCallback",void 0),L(this,"stateUpdatedCallback",void 0),L(this,"requestEmailTokenCallback",void 0),L(this,"supportedStages",void 0),L(this,"data",void 0),L(this,"emailSid",void 0),L(this,"requestingEmailToken",!1),L(this,"attemptAuthDeferred",null),L(this,"chosenFlow",null),L(this,"currentStage",null),L(this,"emailAttempt",1),L(this,"submitPromise",null),L(this,"requestEmailToken",B(function*(){if(n.requestingEmailToken)N.warn("Could not request email token: Already requesting");else{N.trace("Requesting email token. Attempt: "+n.emailAttempt),n.requestingEmailToken=!0;try{var r=yield n.requestEmailTokenCallback(n.inputs.emailAddress,n.clientSecret,n.emailAttempt++,n.data.session);n.emailSid=r.sid,N.trace("Email token request succeeded")}finally{n.requestingEmailToken=!1}}})),this.matrixClient=e.matrixClient,this.data=e.authData||{flows:[]},this.requestCallback=e.doRequest,this.busyChangedCallback=e.busyChanged,this.stateUpdatedCallback=e.stateUpdated||e.startAuthStage,this.requestEmailTokenCallback=e.requestEmailToken,this.inputs=e.inputs||{},e.sessionId&&(this.data.session=e.sessionId),this.clientSecret=e.clientSecret||this.matrixClient.generateClientSecret(),this.emailSid=e.emailSid,e.supportedStages!==void 0&&(this.supportedStages=new Set(e.supportedStages))}attemptAuth(){var e=this;return B(function*(){var n;e.attemptAuthDeferred=Promise.withResolvers();var r=e.attemptAuthDeferred.promise;if((n=e.data)!==null&&n!==void 0&&(n=n.flows)!==null&&n!==void 0&&n.length)e.startNextAuthStage();else{var i;(i=e.busyChangedCallback)===null||i===void 0||i.call(e,!0);var s=e.data.session?{session:e.data.session}:null;e.doRequest(s).finally(()=>{var o;(o=e.busyChangedCallback)===null||o===void 0||o.call(e,!1)})}return r})()}poll(){var e=this;return B(function*(){if(e.data.session&&e.attemptAuthDeferred&&!e.submitPromise){var n={};if(e.currentStage==X0&&e.emailSid){var r={sid:e.emailSid,client_secret:e.clientSecret},i=e.matrixClient.getIdentityServerUrl();i&&(r.id_server=new URL(i).host),n={type:X0,threepid_creds:r}}e.submitAuthDict(n,!0)}})()}getSessionId(){var e;return(e=this.data)===null||e===void 0?void 0:e.session}getClientSecret(){return this.clientSecret}getStageParams(e){var n;return(n=this.data)===null||n===void 0||(n=n.params)===null||n===void 0?void 0:n[e]}getChosenFlow(){return this.chosenFlow}submitAuthDict(e){var n=arguments,r=this;return B(function*(){var i,s=n.length>1&&n[1]!==void 0?n[1]:!1;if(!r.attemptAuthDeferred)throw new Error("submitAuthDict() called before attemptAuth()");if(!s){var o;(o=r.busyChangedCallback)===null||o===void 0||o.call(r,!0)}for(;r.submitPromise;)try{yield r.submitPromise}catch{}var a;(i=r.data)!==null&&i!==void 0&&i.session?a=Object.assign({session:r.data.session},e):a=e;try{r.submitPromise=r.doRequest(a,s),yield r.submitPromise}finally{if(r.submitPromise=null,!s){var c;(c=r.busyChangedCallback)===null||c===void 0||c.call(r,!1)}}})()}getEmailSid(){return this.emailSid}setEmailSid(e){this.emailSid=e}doRequest(e){var n=arguments,r=this;return B(function*(){var i=n.length>1&&n[1]!==void 0?n[1]:!1;try{var s=yield r.requestCallback(e,i);r.attemptAuthDeferred.resolve(s),r.attemptAuthDeferred=null}catch(y){var o,a,c,l,d=y instanceof In?y:null,h=(o=d==null||(a=d.data)===null||a===void 0?void 0:a.flows)!==null&&o!==void 0?o:null,m=((c=r.data)===null||c===void 0?void 0:c.flows)||!!h;if(!d||d.httpStatus!==401||!d.data||!m)if(i)N.log("Background poll request failed doing UI auth: ignoring",y);else{var g;(g=r.attemptAuthDeferred)===null||g===void 0||g.reject(y)}d&&!d.data&&(d.data={}),d&&!d.data.flows&&!d.data.completed&&!d.data.session&&(d.data.flows=r.data.flows,d.data.completed=r.data.completed,d.data.session=r.data.session),d&&(r.data=d.data);try{r.startNextAuthStage()}catch(v){r.attemptAuthDeferred.reject(v),r.attemptAuthDeferred=null;return}if(!r.emailSid&&(l=r.chosenFlow)!==null&&l!==void 0&&l.stages.includes(eM.Email))try{yield r.requestEmailToken()}catch(v){r.attemptAuthDeferred.reject(v),r.attemptAuthDeferred=null}}})()}startNextAuthStage(){var e,n,r=this.chooseStage();if(!r)throw new Error("No incomplete flows from the server");if(this.currentStage=r,r===eM.Dummy){this.submitAuthDict({type:"m.login.dummy"});return}if((e=this.data)!==null&&e!==void 0&&e.errcode||(n=this.data)!==null&&n!==void 0&&n.error){var i,s;this.stateUpdatedCallback(r,{errcode:((i=this.data)===null||i===void 0?void 0:i.errcode)||"",error:((s=this.data)===null||s===void 0?void 0:s.error)||""});return}this.stateUpdatedCallback(r,r===X0?{emailSid:this.emailSid}:{})}chooseStage(){this.chosenFlow===null&&(this.chosenFlow=this.chooseFlow()),N.log("Active flow => %s",JSON.stringify(this.chosenFlow));var e=this.firstUncompletedStage(this.chosenFlow);return N.log("Next stage: %s",e),e}scoreFlow(e){var n=e.stages.length;return this.supportedStages!==void 0&&(n+=e.stages.filter(r=>!this.supportedStages.has(r)).length*10),n}chooseFlow(){var e,n=((e=this.data)===null||e===void 0?void 0:e.flows)||[],r=!!this.inputs.emailAddress||!!this.emailSid,i=!!this.inputs.phoneCountry&&!!this.inputs.phoneNumber;n.sort((d,h)=>this.scoreFlow(d)-this.scoreFlow(h));for(var s of n){var o=!1,a=!1;for(var c of s.stages)c===X0?o=!0:c==KB&&(a=!0);if(o==r&&a==i)return s}var l=[];throw r&&l.push(X0),i&&l.push(KB),new vQ("No appropriate authentication flow found",l,n)}firstUncompletedStage(e){var n,r=((n=this.data)===null||n===void 0?void 0:n.completed)||[];return e.stages.find(i=>!r.includes(i))}}function yQ(t,e){return new Promise((n,r)=>{var i=!0,s=t.open(e);s.onupgradeneeded=()=>{i=!1},s.onblocked=()=>r(s.error),s.onsuccess=()=>{var o=s.result;o.close(),i||t.deleteDatabase(e),n(i)},s.onerror=()=>r(s.error)})}var bQ=[t=>{t.createObjectStore("users",{keyPath:["userId"]}),t.createObjectStore("accountData",{keyPath:["type"]}),t.createObjectStore("sync",{keyPath:["clobber"]})},t=>{var e=t.createObjectStore("oob_membership_events",{keyPath:["room_id","state_key"]});e.createIndex("room","room_id")},t=>{t.createObjectStore("client_options",{keyPath:["clobber"]})},t=>{t.createObjectStore("to_device_queue",{autoIncrement:!0})}],gbe=bQ.length;function uw(t,e,n){var r=t.openCursor(e);return new Promise((i,s)=>{var o=[];r.onerror=()=>{var a;s(new Error("Query failed: "+((a=r.error)===null||a===void 0?void 0:a.name)))},r.onsuccess=()=>{var a=r.result;if(!a){i(o);return}o.push(n(a)),a.continue()}})}function Fh(t){return new Promise((e,n)=>{t.oncomplete=function(r){e(r)},t.onerror=function(){n(t.error)}})}function _Q(t){return new Promise((e,n)=>{t.onsuccess=function(r){e(r)},t.onerror=function(){n(t.error)}})}function vbe(t){return new Promise((e,n)=>{t.onsuccess=()=>e(t),t.onerror=r=>n(r)})}function gx(t){return _Q(t).then(e=>t.result)}class GB{static exists(e,n){return n="matrix-js-sdk:"+(n||"default"),yQ(e,n)}constructor(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"default";this.indexedDB=e,L(this,"dbName",void 0),L(this,"syncAccumulator",void 0),L(this,"db",void 0),L(this,"disconnected",!0),L(this,"_isNewlyCreated",!1),L(this,"syncToDatabasePromise",void 0),L(this,"pendingUserPresenceData",[]),this.dbName="matrix-js-sdk:"+n,this.syncAccumulator=new mQ}connect(e){var n=this;if(!this.disconnected)return N.log("LocalIndexedDBStoreBackend.connect: already connected or connecting"),Promise.resolve();this.disconnected=!1,N.log("LocalIndexedDBStoreBackend.connect: connecting...");var r=this.indexedDB.open(this.dbName,gbe);return r.onupgradeneeded=i=>{var s=r.result,o=i.oldVersion;N.log("LocalIndexedDBStoreBackend.connect: upgrading from ".concat(o)),o<1&&(this._isNewlyCreated=!0),bQ.forEach((a,c)=>{o<=c&&a(s)})},r.onblocked=()=>{N.log("can't yet open LocalIndexedDBStoreBackend because it is open elsewhere")},N.log("LocalIndexedDBStoreBackend.connect: awaiting connection..."),_Q(r).then(B(function*(){N.log("LocalIndexedDBStoreBackend.connect: connected"),n.db=r.result,n.db.onversionchange=()=>{var i;(i=n.db)===null||i===void 0||i.close(),n.disconnected=!0,n.db=void 0},n.db.onclose=()=>{n.disconnected=!0,n.db=void 0,e?.()},yield n.init()}))}isNewlyCreated(){return Promise.resolve(this._isNewlyCreated)}init(){return Promise.all([this.loadAccountData(),this.loadSyncData()]).then(e=>{var[n,r]=e;N.log("LocalIndexedDBStoreBackend: loaded initial data"),this.syncAccumulator.accumulate({next_batch:r.nextBatch,rooms:r.roomsData,account_data:{events:n}},!0)})}getOutOfBandMembers(e){return new Promise((n,r)=>{var i=this.db.transaction(["oob_membership_events"],"readonly"),s=i.objectStore("oob_membership_events"),o=s.index("room"),a=IDBKeyRange.only(e),c=o.openCursor(a),l=[],d=!1;c.onsuccess=()=>{var h=c.result;if(!h)return!l.length&&!d?n(null):n(l);var m=h.value;m.oob_written?d=!0:l.push(m),h.continue()},c.onerror=h=>{r(h)}}).then(n=>(N.log("LL: got ".concat(n?.length," membershipEvents from storage for room ").concat(e," ...")),n))}setOutOfBandMembers(e,n){var r=this;return B(function*(){N.log("LL: backend about to store ".concat(n.length)+" members for ".concat(e));var i=r.db.transaction(["oob_membership_events"],"readwrite"),s=i.objectStore("oob_membership_events");n.forEach(a=>{s.put(a)});var o={room_id:e,oob_written:!0,state_key:0};s.put(o),yield Fh(i),N.log("LL: backend done storing for ".concat(e,"!"))})()}clearOutOfBandMembers(e){var n=this;return B(function*(){var r=n.db.transaction(["oob_membership_events"],"readonly"),i=r.objectStore("oob_membership_events"),s=i.index("room"),o=IDBKeyRange.only(e),a=gx(s.openKeyCursor(o,"next")).then(y=>(y?.primaryKey)[1]),c=gx(s.openKeyCursor(o,"prev")).then(y=>(y?.primaryKey)[1]),[l,d]=yield Promise.all([a,c]),h=n.db.transaction(["oob_membership_events"],"readwrite"),m=h.objectStore("oob_membership_events"),g=IDBKeyRange.bound([e,l],[e,d]);N.log("LL: Deleting all users + marker in storage for room ".concat(e,", with key range:"),[e,l],[e,d]),yield vbe(m.delete(g))})()}clearDatabase(){return new Promise(e=>{var n;N.log("Removing indexeddb instance: ".concat(this.dbName)),(n=this.db)===null||n===void 0||n.close();var r=this.indexedDB.deleteDatabase(this.dbName);r.onblocked=()=>{N.log("can't yet delete indexeddb ".concat(this.dbName," because it is open elsewhere"))},r.onerror=()=>{var i;N.warn("unable to delete js-sdk store indexeddb: ".concat((i=r.error)===null||i===void 0?void 0:i.name)),e()},r.onsuccess=()=>{N.log("Removed indexeddb instance: ".concat(this.dbName)),e()}})}getSavedSync(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0,n=this.syncAccumulator.getJSON();return n.nextBatch?e?Promise.resolve(F_(n)):Promise.resolve(n):Promise.resolve(null)}getNextBatchToken(){return Promise.resolve(this.syncAccumulator.getNextBatchToken())}setSyncData(e){return Promise.resolve().then(()=>{this.syncAccumulator.accumulate(e)})}syncToDatabase(e){var n=this;return B(function*(){return n.syncToDatabasePromise?(N.warn("Skipping syncToDatabase() as persist already in flight"),n.pendingUserPresenceData.push(...e),n.syncToDatabasePromise):(e.unshift(...n.pendingUserPresenceData),n.syncToDatabasePromise=n.doSyncToDatabase(e),n.syncToDatabasePromise)})()}doSyncToDatabase(e){var n=this;return B(function*(){try{var r=n.syncAccumulator.getJSON(!0);yield Promise.all([n.persistUserPresenceEvents(e),n.persistAccountData(r.accountData),n.persistSyncData(r.nextBatch,r.roomsData)])}finally{n.syncToDatabasePromise=void 0}})()}persistSyncData(e,n){return N.log("Persisting sync data up to",e),og(()=>{var r=this.db.transaction(["sync"],"readwrite"),i=r.objectStore("sync");return i.put({clobber:"-",nextBatch:e,roomsData:n}),Fh(r).then(()=>{N.log("Persisted sync data up to",e)})})}persistAccountData(e){return og(()=>{var n=this.db.transaction(["accountData"],"readwrite"),r=n.objectStore("accountData");for(var i of e)r.put(i);return Fh(n).then()})}persistUserPresenceEvents(e){return og(()=>{var n=this.db.transaction(["users"],"readwrite"),r=n.objectStore("users");for(var i of e)r.put({userId:i[0],event:i[1]});return Fh(n).then()})}getUserPresenceEvents(){return og(()=>{var e=this.db.transaction(["users"],"readonly"),n=e.objectStore("users");return uw(n,void 0,r=>[r.value.userId,r.value.event])})}loadAccountData(){return N.log("LocalIndexedDBStoreBackend: loading account data..."),og(()=>{var e=this.db.transaction(["accountData"],"readonly"),n=e.objectStore("accountData");return uw(n,void 0,r=>r.value).then(r=>(N.log("LocalIndexedDBStoreBackend: loaded account data"),r))})}loadSyncData(){return N.log("LocalIndexedDBStoreBackend: loading sync data..."),og(()=>{var e=this.db.transaction(["sync"],"readonly"),n=e.objectStore("sync");return uw(n,void 0,r=>r.value).then(r=>(N.log("LocalIndexedDBStoreBackend: loaded sync data"),r.length>1&&N.warn("loadSyncData: More than 1 sync row found."),r.length>0?r[0]:{}))})}getClientOptions(){return Promise.resolve().then(()=>{var e=this.db.transaction(["client_options"],"readonly"),n=e.objectStore("client_options");return uw(n,void 0,r=>{var i;return(i=r.value)===null||i===void 0?void 0:i.options}).then(r=>r[0])})}storeClientOptions(e){var n=this;return B(function*(){var r=n.db.transaction(["client_options"],"readwrite"),i=r.objectStore("client_options");i.put({clobber:"-",options:e}),yield Fh(r)})()}saveToDeviceBatches(e){var n=this;return B(function*(){var r=n.db.transaction(["to_device_queue"],"readwrite"),i=r.objectStore("to_device_queue");for(var s of e)i.add(s);yield Fh(r)})()}getOldestToDeviceBatch(){var e=this;return B(function*(){var n=e.db.transaction(["to_device_queue"],"readonly"),r=n.objectStore("to_device_queue"),i=yield gx(r.openCursor());if(!i)return null;var s=i.value;return{id:i.key,txnId:s.txnId,eventType:s.eventType,batch:s.batch}})()}removeToDeviceBatch(e){var n=this;return B(function*(){var r=n.db.transaction(["to_device_queue"],"readwrite"),i=r.objectStore("to_device_queue");i.delete(e),yield Fh(r)})()}destroy(){var e=this;return B(function*(){var n;(n=e.db)===null||n===void 0||n.close()})()}}class ybe{constructor(e,n){this.workerFactory=e,this.dbName=n,L(this,"worker",void 0),L(this,"nextSeq",0),L(this,"inFlight",{}),L(this,"startPromise",void 0),L(this,"onWorkerMessage",r=>{var i=r.data;if(i.command=="closed"){var s;(s=this.onClose)===null||s===void 0||s.call(this)}else if(i.command=="cmd_success"||i.command=="cmd_fail"){if(i.seq===void 0){N.error("Got reply from worker with no seq");return}var o=this.inFlight[i.seq];if(o===void 0){N.error("Got reply for unknown seq "+i.seq);return}if(delete this.inFlight[i.seq],i.command=="cmd_success")o.resolve(i.result);else{var a=new Error(i.error.message);a.name=i.error.name,o.reject(a)}}else N.warn("Unrecognised message from worker: ",i)})}connect(e){return this.onClose=e,this.ensureStarted().then(()=>this.doCmd("connect"))}clearDatabase(){return this.ensureStarted().then(()=>this.doCmd("clearDatabase"))}isNewlyCreated(){return this.doCmd("isNewlyCreated")}getSavedSync(){return this.doCmd("getSavedSync")}getNextBatchToken(){return this.doCmd("getNextBatchToken")}setSyncData(e){return this.doCmd("setSyncData",[e])}syncToDatabase(e){return this.doCmd("syncToDatabase",[e])}getOutOfBandMembers(e){return this.doCmd("getOutOfBandMembers",[e])}setOutOfBandMembers(e,n){return this.doCmd("setOutOfBandMembers",[e,n])}clearOutOfBandMembers(e){return this.doCmd("clearOutOfBandMembers",[e])}getClientOptions(){return this.doCmd("getClientOptions")}storeClientOptions(e){return this.doCmd("storeClientOptions",[e])}getUserPresenceEvents(){return this.doCmd("getUserPresenceEvents")}saveToDeviceBatches(e){var n=this;return B(function*(){return n.doCmd("saveToDeviceBatches",[e])})()}getOldestToDeviceBatch(){var e=this;return B(function*(){return e.doCmd("getOldestToDeviceBatch")})()}removeToDeviceBatch(e){var n=this;return B(function*(){return n.doCmd("removeToDeviceBatch",[e])})()}ensureStarted(){return this.startPromise||(this.worker=this.workerFactory(),this.worker.onmessage=this.onWorkerMessage,this.startPromise=this.doCmd("setupWorker",[this.dbName]).then(()=>{N.log("IndexedDB worker is ready")})),this.startPromise}doCmd(e,n){return Promise.resolve().then(()=>{var r,i=this.nextSeq++,s=Promise.withResolvers();return this.inFlight[i]=s,(r=this.worker)===null||r===void 0||r.postMessage({command:e,seq:i,args:n}),s.promise})}destroy(){var e=this;return B(function*(){var n;(n=e.worker)===null||n===void 0||n.terminate()})()}}var bbe=1e3*60*5;class SQ extends Vb{static exists(e,n){return GB.exists(e,n)}constructor(e){if(super(e),L(this,"backend",void 0),L(this,"startedUp",!1),L(this,"syncTs",0),L(this,"userModifiedMap",{}),L(this,"emitter",new Kn),L(this,"onClose",()=>{this.emitter.emit("closed")}),L(this,"getSavedSync",this.degradable(()=>this.backend.getSavedSync(),"getSavedSync")),L(this,"isNewlyCreated",this.degradable(()=>this.backend.isNewlyCreated(),"isNewlyCreated")),L(this,"getSavedSyncToken",this.degradable(()=>this.backend.getNextBatchToken(),"getSavedSyncToken")),L(this,"deleteAllData",this.degradable(()=>(super.deleteAllData(),this.backend.clearDatabase().then(()=>{N.log("Deleted indexeddb data.")},n=>{throw N.error("Failed to delete indexeddb data: ".concat(n)),n})),null)),L(this,"reallySave",this.degradable(()=>{this.syncTs=Date.now();var n=[];for(var r of this.getUsers())this.userModifiedMap[r.userId]!==r.getLastModifiedTime()&&r.events.presence&&(n.push([r.userId,r.events.presence.event]),this.userModifiedMap[r.userId]=r.getLastModifiedTime());return this.backend.syncToDatabase(n)},null)),L(this,"setSyncData",this.degradable(n=>this.backend.setSyncData(n),"setSyncData")),L(this,"getOutOfBandMembers",this.degradable(n=>this.backend.getOutOfBandMembers(n),"getOutOfBandMembers")),L(this,"setOutOfBandMembers",this.degradable((n,r)=>(super.setOutOfBandMembers(n,r),this.backend.setOutOfBandMembers(n,r)),"setOutOfBandMembers")),L(this,"clearOutOfBandMembers",this.degradable(n=>(super.clearOutOfBandMembers(n),this.backend.clearOutOfBandMembers(n)),"clearOutOfBandMembers")),L(this,"getClientOptions",this.degradable(()=>this.backend.getClientOptions(),"getClientOptions")),L(this,"storeClientOptions",this.degradable(n=>(super.storeClientOptions(n),this.backend.storeClientOptions(n)),"storeClientOptions")),!e.indexedDB)throw new Error("Missing required option: indexedDB");e.workerFactory?this.backend=new ybe(e.workerFactory,e.dbName):this.backend=new GB(e.indexedDB,e.dbName)}on(e,n){this.emitter.on(e,n)}startup(){return this.startedUp?(N.log("IndexedDBStore.startup: already started"),Promise.resolve()):(N.log("IndexedDBStore.startup: connecting to backend"),this.backend.connect(this.onClose).then(()=>(N.log("IndexedDBStore.startup: loading presence events"),this.backend.getUserPresenceEvents())).then(e=>{N.log("IndexedDBStore.startup: processing presence events"),e.forEach(n=>{var[r,i]=n;if(!this.createUser)throw new Error("`IndexedDBStore.startup` must be called after assigning it to the client, not before!");var s=this.createUser(r);i&&s.setPresenceEvent(new ns(i)),this.userModifiedMap[s.userId]=s.getLastModifiedTime(),this.storeUser(s)}),this.startedUp=!0}))}destroy(){return this.backend.destroy()}wantsSave(){var e=Date.now();return e-this.syncTs>bbe}save(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;return e||this.wantsSave()?this.reallySave():Promise.resolve()}degradable(e,n){var r=this,i=n?super[n]:null;return B(function*(){for(var s=arguments.length,o=new Array(s),a=0;a<s;a++)o[a]=arguments[a];try{return yield e.call(r,...o)}catch(c){N.error("IndexedDBStore failure, degrading to MemoryStore",c),r.emitter.emit("degraded",c);try{N.log("IndexedDBStore trying to delete degraded data"),yield r.backend.clearDatabase(),N.log("IndexedDBStore delete after degrading succeeded")}catch(l){N.warn("IndexedDBStore delete after degrading failed",l)}if(i)return i.call(r,...o)}})}getPendingEvents(e){var n=()=>super.getPendingEvents,r=this;return B(function*(){if(!r.localStorage)return n().call(r,e);var i=r.localStorage.getItem(vx(e));if(i)try{return JSON.parse(i)}catch(s){N.error("Could not parse persisted pending events",s)}return[]})()}setPendingEvents(e,n){var r=()=>super.setPendingEvents,i=this;return B(function*(){if(!i.localStorage)return r().call(i,e,n);n.length>0?i.localStorage.setItem(vx(e),JSON.stringify(n)):i.localStorage.removeItem(vx(e))})()}saveToDeviceBatches(e){return this.backend.saveToDeviceBatches(e)}getOldestToDeviceBatch(){return this.backend.getOldestToDeviceBatch()}removeToDeviceBatch(e){return this.backend.removeToDeviceBatch(e)}}function vx(t){return"mx_pending_events_".concat(t)}var Dc="crypto.",zB=Dc+"migration",yx=Dc+"account",_be=Dc+"cross_signing_keys",CE=Dc+"inboundgroupsessions/",Sbe=Dc+"inboundgroupsessions.withheld/",wbe=Dc+"rooms/",bx=Dc+"sessionsneedingbackup";function fg(t){return Dc+"sessions/"+t}function _x(t,e){return CE+t+"/"+e}function Ebe(t,e){return Sbe+t+"/"+e}function Cbe(t){return wbe+t}class LT extends vT{static exists(e){for(var n=e.length,r=0;r<n;r++){var i;if((i=e.key(r))!==null&&i!==void 0&&i.startsWith(Dc))return!0}return!1}constructor(e){super(),this.store=e}containsData(){var e=this;return B(function*(){return LT.exists(e.store)})()}getMigrationState(){var e=this;return B(function*(){var n;return(n=Ia(e.store,zB))!==null&&n!==void 0?n:Sv.NOT_STARTED})()}setMigrationState(e){var n=this;return B(function*(){$h(n.store,zB,e)})()}countEndToEndSessions(e,n){for(var r=0,i=0;i<this.store.length;++i){var s=this.store.key(i);if(s!=null&&s.startsWith(fg(""))){var o=Ia(this.store,s);r+=Object.keys(o??{}).length}}n(r)}_getEndToEndSessions(e){var n=Ia(this.store,fg(e)),r={};for(var[i,s]of Object.entries(n||{}))typeof s=="string"?r[i]={session:s}:r[i]=s;return r}getEndToEndSession(e,n,r,i){var s,o=this._getEndToEndSessions(e);i((s=o[n])!==null&&s!==void 0?s:{})}getEndToEndSessions(e,n,r){var i;r((i=this._getEndToEndSessions(e))!==null&&i!==void 0?i:{})}storeEndToEndSession(e,n,r,i){var s=this._getEndToEndSessions(e)||{};s[n]=r,$h(this.store,fg(e),s)}getEndToEndSessionsBatch(){var e=this;return B(function*(){for(var n=[],r=0;r<e.store.length;++r){var i;if((i=e.store.key(r))!==null&&i!==void 0&&i.startsWith(fg(""))){var s=e.store.key(r).split("/")[1];for(var o of Object.values(e._getEndToEndSessions(s)))if(n.push(o),n.length>=wv)return n}}return n.length===0?null:n})()}deleteEndToEndSessionsBatch(e){var n=this;return B(function*(){for(var{deviceKey:r,sessionId:i}of e){var s=n._getEndToEndSessions(r)||{};delete s[i],Object.keys(s).length===0?n.store.removeItem(fg(r)):$h(n.store,fg(r),s)}})()}getEndToEndInboundGroupSession(e,n,r,i){i(Ia(this.store,_x(e,n)),Ia(this.store,Ebe(e,n)))}storeEndToEndInboundGroupSession(e,n,r,i){$h(this.store,_x(e,n),r)}countEndToEndInboundGroupSessions(){var e=this;return B(function*(){for(var n=0,r=0;r<e.store.length;++r){var i=e.store.key(r);i!=null&&i.startsWith(CE)&&(n+=1)}return n})()}getEndToEndInboundGroupSessionsBatch(){var e=this;return B(function*(){for(var n=Ia(e.store,bx)||{},r=[],i=0;i<e.store.length;++i){var s=e.store.key(i);if(s!=null&&s.startsWith(CE)){var o=s.slice(CE.length);if(r.push({senderKey:o.slice(0,43),sessionId:o.slice(44),sessionData:Ia(e.store,s),needsBackup:o in n}),r.length>=wv)return r}}return r.length===0?null:r})()}deleteEndToEndInboundGroupSessionsBatch(e){var n=this;return B(function*(){for(var{senderKey:r,sessionId:i}of e){var s=_x(r,i);n.store.removeItem(s)}})()}getEndToEndRooms(e,n){for(var r={},i=Cbe(""),s=0;s<this.store.length;++s){var o=this.store.key(s);if(o!=null&&o.startsWith(i)){var a=o.slice(i.length);r[a]=Ia(this.store,o)}}n(r)}markSessionsNeedingBackup(e){var n=Ia(this.store,bx)||{};for(var r of e)n[r.senderKey+"/"+r.sessionId]=!0;return $h(this.store,bx,n),Promise.resolve()}deleteAllData(){return this.store.removeItem(yx),Promise.resolve()}getAccount(e,n){var r=Ia(this.store,yx);n(r)}storeAccount(e,n){$h(this.store,yx,n)}getCrossSigningKeys(e,n){var r=Ia(this.store,_be);n(r)}getSecretStorePrivateKey(e,n,r){var i=Ia(this.store,Dc+"ssss_cache.".concat(r));n(i)}storeSecretStorePrivateKey(e,n,r){$h(this.store,Dc+"ssss_cache.".concat(n),r)}doTxn(e,n,r){return Promise.resolve(r(null))}}function Ia(t,e){try{return JSON.parse(t.getItem(e))}catch(n){N.log("Error: Failed to get key %s: %s",e,n.message),N.log(n.stack)}return null}function $h(t,e,n){t.setItem(e,JSON.stringify(n))}let Tbe=class{constructor(e){this.db=e,L(this,"nextTxnId",0),e.onversionchange=()=>{N.log("versionchange for indexeddb ".concat(this.db.name,": closing")),e.close()}}containsData(){return B(function*(){throw Error("Not implemented for Backend")})()}startup(){var e=this;return B(function*(){return e})()}deleteAllData(){return B(function*(){throw Error("This is not implemented, call IDBFactory::deleteDatabase(dbName) instead.")})()}getMigrationState(){var e=this;return B(function*(){var n=Sv.NOT_STARTED;return yield e.doTxn("readonly",[Xt.STORE_ACCOUNT],r=>{var i=r.objectStore(Xt.STORE_ACCOUNT),s=i.get(mA);s.onsuccess=()=>{var o;n=(o=s.result)!==null&&o!==void 0?o:Sv.NOT_STARTED}}),n})()}setMigrationState(e){var n=this;return B(function*(){yield n.doTxn("readwrite",[Xt.STORE_ACCOUNT],r=>{var i=r.objectStore(Xt.STORE_ACCOUNT);i.put(e,mA)})})()}getAccount(e,n){var r=e.objectStore("account"),i=r.get("-");i.onsuccess=function(){try{n(i.result||null)}catch(s){no(e,s)}}}storeAccount(e,n){var r=e.objectStore("account");r.put(n,"-")}getCrossSigningKeys(e,n){var r=e.objectStore("account"),i=r.get("crossSigningKeys");i.onsuccess=function(){try{n(i.result||null)}catch(s){no(e,s)}}}getSecretStorePrivateKey(e,n,r){var i=e.objectStore("account"),s=i.get("ssss_cache:".concat(r));s.onsuccess=function(){try{n(s.result||null)}catch(o){no(e,o)}}}storeSecretStorePrivateKey(e,n,r){var i=e.objectStore("account");i.put(r,"ssss_cache:".concat(n))}countEndToEndSessions(e,n){var r=e.objectStore("sessions"),i=r.count();i.onsuccess=function(){try{n(i.result)}catch(s){no(e,s)}}}getEndToEndSessions(e,n,r){var i=n.objectStore("sessions"),s=i.index("deviceKey"),o=s.openCursor(e),a={};o.onsuccess=function(){var c=o.result;if(c)a[c.value.sessionId]={session:c.value.session,lastReceivedMessageTs:c.value.lastReceivedMessageTs},c.continue();else try{r(a)}catch(l){no(n,l)}}}getEndToEndSession(e,n,r,i){var s=r.objectStore("sessions"),o=s.get([e,n]);o.onsuccess=function(){try{o.result?i({session:o.result.session,lastReceivedMessageTs:o.result.lastReceivedMessageTs}):i(null)}catch(a){no(r,a)}}}storeEndToEndSession(e,n,r,i){var s=i.objectStore("sessions");s.put({deviceKey:e,sessionId:n,session:r.session,lastReceivedMessageTs:r.lastReceivedMessageTs})}getEndToEndSessionsBatch(){var e=this;return B(function*(){var n=[];return yield e.doTxn("readonly",[Xt.STORE_SESSIONS],r=>{var i=r.objectStore(Xt.STORE_SESSIONS),s=i.openCursor();s.onsuccess=function(){try{var o=s.result;o&&(n.push(o.value),n.length<wv&&o.continue())}catch(a){no(r,a)}}}),n.length===0?null:n})()}deleteEndToEndSessionsBatch(e){var n=this;return B(function*(){yield n.doTxn("readwrite",[Xt.STORE_SESSIONS],(function(){var r=B(function*(i){try{var s=i.objectStore(Xt.STORE_SESSIONS),o=function*(){var d=s.delete([a,c]);yield new Promise(h=>{d.onsuccess=h})};for(var{deviceKey:a,sessionId:c}of e)yield*o()}catch(l){no(i,l)}});return function(i){return r.apply(this,arguments)}})())})()}getEndToEndInboundGroupSession(e,n,r,i){var s=!1,o=!1,a=r.objectStore("inbound_group_sessions"),c=a.get([e,n]);c.onsuccess=function(){try{c.result?s=c.result.session:s=null,o!==!1&&i(s,o)}catch(h){no(r,h)}};var l=r.objectStore("inbound_group_sessions_withheld"),d=l.get([e,n]);d.onsuccess=function(){try{d.result?o=d.result.session:o=null,s!==!1&&i(s,o)}catch(h){no(r,h)}}}storeEndToEndInboundGroupSession(e,n,r,i){var s=i.objectStore("inbound_group_sessions");s.put({senderCurve25519Key:e,sessionId:n,session:r})}countEndToEndInboundGroupSessions(){var e=this;return B(function*(){var n=0;return yield e.doTxn("readonly",[Xt.STORE_INBOUND_GROUP_SESSIONS],r=>{var i=r.objectStore(Xt.STORE_INBOUND_GROUP_SESSIONS),s=i.count();s.onsuccess=()=>{n=s.result}}),n})()}getEndToEndInboundGroupSessionsBatch(){var e=this;return B(function*(){var n=[];return yield e.doTxn("readonly",[Xt.STORE_INBOUND_GROUP_SESSIONS,Xt.STORE_BACKUP],r=>{var i=r.objectStore(Xt.STORE_INBOUND_GROUP_SESSIONS),s=r.objectStore(Xt.STORE_BACKUP),o=i.openCursor();o.onsuccess=function(){try{var a=o.result;if(a){var c=s.get(a.key);c.onsuccess=()=>{n.push({senderKey:a.value.senderCurve25519Key,sessionId:a.value.sessionId,sessionData:a.value.session,needsBackup:c.result!==void 0}),n.length<wv&&a.continue()}}}catch(l){no(r,l)}}}),n.length===0?null:n})()}deleteEndToEndInboundGroupSessionsBatch(e){var n=this;return B(function*(){yield n.doTxn("readwrite",[Xt.STORE_INBOUND_GROUP_SESSIONS],(function(){var r=B(function*(i){try{var s=i.objectStore(Xt.STORE_INBOUND_GROUP_SESSIONS),o=function*(){var d=s.delete([a,c]);yield new Promise(h=>{d.onsuccess=h})};for(var{senderKey:a,sessionId:c}of e)yield*o()}catch(l){no(i,l)}});return function(i){return r.apply(this,arguments)}})())})()}getEndToEndDeviceData(e,n){var r=e.objectStore("device_data"),i=r.get("-");i.onsuccess=function(){try{n(i.result||null)}catch(s){no(e,s)}}}getEndToEndRooms(e,n){var r={},i=e.objectStore("rooms"),s=i.openCursor();s.onsuccess=function(){var o=s.result;if(o)r[o.key]=o.value,o.continue();else try{n(r)}catch(a){no(e,a)}}}markSessionsNeedingBackup(e,n){var r=this;return B(function*(){n||(n=r.db.transaction("sessions_needing_backup","readwrite"));var i=n.objectStore("sessions_needing_backup");yield Promise.all(e.map(s=>new Promise((o,a)=>{var c=i.put({senderCurve25519Key:s.senderKey,sessionId:s.sessionId});c.onsuccess=o,c.onerror=a})))})()}doTxn(e,n,r){var i=this.db.transaction(n,e),s=Ibe(i),o=r(i);return s.then(()=>o)}};var wQ=[t=>{kbe(t)},t=>{t.createObjectStore("account")},t=>{var e=t.createObjectStore("sessions",{keyPath:["deviceKey","sessionId"]});e.createIndex("deviceKey","deviceKey")},t=>{t.createObjectStore("inbound_group_sessions",{keyPath:["senderCurve25519Key","sessionId"]})},t=>{t.createObjectStore("device_data")},t=>{t.createObjectStore("rooms")},t=>{t.createObjectStore("sessions_needing_backup",{keyPath:["senderCurve25519Key","sessionId"]})},t=>{t.createObjectStore("inbound_group_sessions_withheld",{keyPath:["senderCurve25519Key","sessionId"]})},t=>{var e=t.createObjectStore("session_problems",{keyPath:["deviceKey","time"]});e.createIndex("deviceKey","deviceKey"),t.createObjectStore("notified_error_devices",{keyPath:["userId","deviceId"]})},t=>{t.createObjectStore("shared_history_inbound_group_sessions",{keyPath:["roomId"]})},t=>{t.createObjectStore("parked_shared_history",{keyPath:["roomId"]})}],EQ=wQ.length;function Rbe(t,e){N.log("Upgrading IndexedDBCryptoStore from version ".concat(e)+" to ".concat(EQ)),wQ.forEach((n,r)=>{e<=r&&n(t)})}function kbe(t){var e=t.createObjectStore("outgoingRoomKeyRequests",{keyPath:"requestId"});e.createIndex("session",["requestBody.room_id","requestBody.session_id"]),e.createIndex("state","state")}function no(t,e){t._mx_abortexception=e;try{t.abort()}catch{}}function Ibe(t){return new Promise((e,n)=>{t.oncomplete=()=>{t._mx_abortexception!==void 0&&n(t._mx_abortexception),e(null)},t.onerror=r=>{t._mx_abortexception!==void 0?n(t._mx_abortexception):(N.log("Error performing indexeddb txn",r),n(t.error))},t.onabort=r=>{t._mx_abortexception!==void 0?n(t._mx_abortexception):(N.log("Error performing indexeddb txn",r),n(t.error))}})}class Xt{static exists(e,n){return yQ(e,n)}static existsAndIsNotMigrated(e,n){return new Promise((r,i)=>{var s=!0,o=e.open(n);o.onupgradeneeded=()=>{s=!1},o.onblocked=()=>i(o.error),o.onsuccess=()=>{var a=o.result;if(!s)a.close(),e.deleteDatabase(n),r(!1);else{var c=a.transaction([Xt.STORE_ACCOUNT],"readonly"),l=c.objectStore(Xt.STORE_ACCOUNT),d=l.get(mA);d.onsuccess=()=>{var h,m=(h=d.result)!==null&&h!==void 0?h:Sv.NOT_STARTED;r(m===Sv.NOT_STARTED)},d.onerror=()=>{i(d.error)},a.close()}},o.onerror=()=>i(o.error)})}constructor(e,n){this.indexedDB=e,this.dbName=n,L(this,"backendPromise",void 0),L(this,"backend",void 0)}containsData(){var e=this;return B(function*(){return Xt.exists(e.indexedDB,e.dbName)})()}startup(){return this.backendPromise?this.backendPromise:(this.backendPromise=new Promise((e,n)=>{if(!this.indexedDB){n(new Error("no indexeddb support available"));return}N.log("connecting to indexeddb ".concat(this.dbName));var r=this.indexedDB.open(this.dbName,EQ);r.onupgradeneeded=i=>{var s=r.result,o=i.oldVersion;Rbe(s,o)},r.onblocked=()=>{N.log("can't yet open IndexedDBCryptoStore because it is open elsewhere")},r.onerror=i=>{N.log("Error connecting to indexeddb",i),n(r.error)},r.onsuccess=()=>{var i=r.result;N.log("connected to indexeddb ".concat(this.dbName)),e(new Tbe(i))}}).then(e=>e.doTxn("readonly",[Xt.STORE_INBOUND_GROUP_SESSIONS,Xt.STORE_INBOUND_GROUP_SESSIONS_WITHHELD],n=>{e.getEndToEndInboundGroupSession("","",n,()=>{})}).then(()=>e)).catch(e=>{if(e.name==="VersionError")throw N.warn("Crypto DB is too new for us to use!",e),new _P(bP.TooNew);N.warn("unable to connect to indexeddb ".concat(this.dbName)+": falling back to localStorage store: ".concat(e));try{if(!(globalThis.localStorage instanceof Storage))throw new Error("localStorage is not available");return new LT(globalThis.localStorage)}catch(n){return N.warn("Unable to open localStorage: falling back to in-memory store: ".concat(n)),new vT}}).then(e=>(this.backend=e,e)),this.backendPromise)}deleteAllData(){return new Promise((e,n)=>{if(!this.indexedDB){n(new Error("no indexeddb support available"));return}N.log("Removing indexeddb instance: ".concat(this.dbName));var r=this.indexedDB.deleteDatabase(this.dbName);r.onblocked=()=>{N.log("can't yet delete IndexedDBCryptoStore because it is open elsewhere")},r.onerror=i=>{N.log("Error deleting data from indexeddb",i),n(r.error)},r.onsuccess=()=>{N.log("Removed indexeddb instance: ".concat(this.dbName)),e()}}).catch(e=>{N.warn("unable to delete IndexedDBCryptoStore: ".concat(e))})}getMigrationState(){return this.backend.getMigrationState()}setMigrationState(e){return this.backend.setMigrationState(e)}getAccount(e,n){this.backend.getAccount(e,n)}storeAccount(e,n){this.backend.storeAccount(e,n)}getCrossSigningKeys(e,n){this.backend.getCrossSigningKeys(e,n)}getSecretStorePrivateKey(e,n,r){this.backend.getSecretStorePrivateKey(e,n,r)}storeSecretStorePrivateKey(e,n,r){this.backend.storeSecretStorePrivateKey(e,n,r)}countEndToEndSessions(e,n){this.backend.countEndToEndSessions(e,n)}getEndToEndSession(e,n,r,i){this.backend.getEndToEndSession(e,n,r,i)}getEndToEndSessions(e,n,r){this.backend.getEndToEndSessions(e,n,r)}storeEndToEndSession(e,n,r,i){this.backend.storeEndToEndSession(e,n,r,i)}countEndToEndInboundGroupSessions(){return this.backend.countEndToEndInboundGroupSessions()}getEndToEndSessionsBatch(){return this.backend.getEndToEndSessionsBatch()}deleteEndToEndSessionsBatch(e){return this.backend.deleteEndToEndSessionsBatch(e)}getEndToEndInboundGroupSession(e,n,r,i){this.backend.getEndToEndInboundGroupSession(e,n,r,i)}storeEndToEndInboundGroupSession(e,n,r,i){this.backend.storeEndToEndInboundGroupSession(e,n,r,i)}getEndToEndInboundGroupSessionsBatch(){return this.backend.getEndToEndInboundGroupSessionsBatch()}deleteEndToEndInboundGroupSessionsBatch(e){return this.backend.deleteEndToEndInboundGroupSessionsBatch(e)}getEndToEndRooms(e,n){this.backend.getEndToEndRooms(e,n)}markSessionsNeedingBackup(e,n){return this.backend.markSessionsNeedingBackup(e,n)}doTxn(e,n,r,i){return this.backend.doTxn(e,n,r,i)}}L(Xt,"STORE_ACCOUNT","account");L(Xt,"STORE_SESSIONS","sessions");L(Xt,"STORE_INBOUND_GROUP_SESSIONS","inbound_group_sessions");L(Xt,"STORE_INBOUND_GROUP_SESSIONS_WITHHELD","inbound_group_sessions_withheld");L(Xt,"STORE_SHARED_HISTORY_INBOUND_GROUP_SESSIONS","shared_history_inbound_group_sessions");L(Xt,"STORE_PARKED_SHARED_HISTORY","parked_shared_history");L(Xt,"STORE_DEVICE_DATA","device_data");L(Xt,"STORE_ROOMS","rooms");L(Xt,"STORE_BACKUP","sessions_needing_backup");var xbe=(function(t){return t.Email="email",t.Phone="msisdn",t})({}),CQ=new qr("oauth_aware_preferred","org.matrix.msc3824.delegated_oidc_compatibility"),Abe=CQ,Mbe=(function(t){return t.Gitlab="gitlab",t.Github="github",t.Apple="apple",t.Google="google",t.Facebook="facebook",t.Twitter="twitter",t})({}),Lbe=(function(t){return t.LOGIN="login",t.REGISTER="register",t})({}),Obe="m.tz",Pbe="us.cloke.msc4175.tz";class Dbe{constructor(e){L(this,"relations",void 0),this.relations=e.filter(n=>!!n)}getRelations(){return this.relations.reduce((e,n)=>[...e,...n.getRelations()],[])}on(e,n){this.relations.forEach(r=>r.on(e,n))}off(e,n){this.relations.forEach(r=>r.off(e,n))}}var Nbe=(function(t){return t.Global="Global",t.SetItemError="setItem",t.GetItemError="getItem",t.RemoveItemError="removeItem",t.ClearError="clear",t.QuotaExceededError="QuotaExceededError",t})({});class Ube extends Kn{}var jbe=new Ube,TQ=()=>new vT;function RQ(t){TQ=t}function kQ(t){var e,n,r;return t.store=(e=t.store)!==null&&e!==void 0?e:new Vb({localStorage:globalThis.localStorage}),t.scheduler=(n=t.scheduler)!==null&&n!==void 0?n:new Ev,t.cryptoStore=(r=t.cryptoStore)!==null&&r!==void 0?r:TQ(),t}function OT(t){return new MT(kQ(t))}function IQ(t,e,n,r){var i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0;return new pQ(t,e,n,kQ(r),i)}const Fbe=Object.freeze(Object.defineProperty({__proto__:null,AuthType:eM,AutoDiscovery:ht,AutoDiscoveryAction:Go,AutoDiscoveryError:ic,Beacon:pX,BeaconEvent:Xn,CallEvent:It,CallFeedEvent:il,Category:mu,ClientEvent:De,ClientPrefix:hr,ClientStoppedError:i1e,ConditionKind:Jr,ConditionOperator:E0e,ConnectionError:Xp,ContentHelpers:nye,DELEGATED_OIDC_COMPATIBILITY:Abe,DEVICE_CODE_SCOPE:z1e,DMMemberCountCondition:C0e,DebugLogger:JO,Device:hbe,DeviceVerification:gQ,Direction:Et,DuplicateStrategy:K1,EVENT_VISIBILITY_CHANGE_TYPE:sp,EventEmitterEvents:$J,EventStatus:ct,EventTimeline:Fe,EventTimelineSet:Ng,EventType:Z,FILTER_RELATED_BY_REL_TYPES:Qg,FILTER_RELATED_BY_SENDERS:Xg,FeatureSupport:bs,Filter:zo,GET_LOGIN_TOKEN_CAPABILITY:Z1e,GroupCall:hP,GroupCallEvent:Ln,GroupCallIntent:UX,GroupCallState:pr,GroupCallStatsReportEvent:M1,GroupCallType:CT,GuestAccess:LC,HTTPError:Ip,HistoryVisibility:gP,HttpApiEvent:TA,IdentityPrefix:pu,IdentityProviderBrand:Mbe,IndexedDBCryptoStore:Xt,IndexedDBStore:SQ,InteractiveAuth:IP,InvalidCryptoStoreError:_P,InvalidCryptoStoreState:bP,JoinRule:kf,KNOWN_SAFE_ROOM_VERSION:IX,KeySignatureUploadError:r1e,KnownMembership:Ve,LOCAL_NOTIFICATION_SETTINGS_PREFIX:VJ,LocalStorageCryptoStore:LT,LocalStorageErrors:Nbe,LocationAssetType:_v,MAIN_ROOM_TIMELINE:j_,MAXIMUM_MATRIX_VERSION:M0e,MAX_STICKY_DURATION_MS:kP,MINIMUM_MATRIX_VERSION:A0e,MSC3912_RELATION_BASED_REDACTIONS_PROP:_A,MXID_PATTERN:XO,M_ASSET:N_,M_BEACON:UA,M_BEACON_INFO:vP,M_HTML:Yve,M_LOCATION:U_,M_MESSAGE:Wve,M_POLL_END:xC,M_POLL_KIND_DISCLOSED:iye,M_POLL_KIND_UNDISCLOSED:sye,M_POLL_RESPONSE:Ob,M_POLL_START:oye,M_TEXT:nP,M_TIMESTAMP:sh,M_TOPIC:rP,MatrixClient:MT,MatrixError:In,MatrixEvent:ns,MatrixEventEvent:Zt,MatrixHttpApi:TX,MatrixSafetyError:EX,MatrixSafetyErrorCode:wX,MatrixScheduler:Ev,MediaHandlerEvent:Xh,MediaPrefix:Wg,MemoryCryptoStore:vT,MemoryStore:Vb,Method:he,MsgType:Nl,NoAuthFlowFoundError:vQ,NotificationCountType:sn,OAUTH_AWARE_PREFERRED_FLOW_FIELD:CQ,OAuthGrantType:Bb,OidcError:_s,OidcTokenRefresher:Y1e,PUSHER_DEVICE_ID:Pve,PUSHER_ENABLED:SA,PendingEventOrdering:Rv,Poll:vX,PollEvent:of,Preset:RT,ProfileKeyMSC4175Timezone:Pbe,ProfileKeyTimezone:Obe,PushRuleActionName:Rf,PushRuleKind:Mi,REFERENCE_RELATION:rX,ReceiptType:Ps,RelatedRelations:Dbe,RelationType:bn,Relations:tP,RelationsEvent:gE,RestrictedAllowType:O0e,Room:wT,RoomCreateTypeField:TC,RoomEvent:Oe,RoomMember:Ab,RoomMemberEvent:fo,RoomNameType:rl,RoomState:qb,RoomStateEvent:Ct,RoomSummary:tX,RoomType:zg,RoomVersionStability:RX,RoomWidgetClient:pQ,RoomWidgetClientEvent:EE,RuleId:Ai,SERVICE_TYPES:DA,SSOAction:Lbe,STABLE_MSC4133_EXTENDED_PROFILES:cQ,SUPPORTED_MATRIX_VERSIONS:Nb,SearchOrderBy:$X,SearchResult:TT,SecretStorage:Z0e,ServerCapabilities:kX,SetPresence:xX,SlidingSyncEvent:NA,StatsReport:ju,SyncAccumulator:mQ,SyncState:Qt,THREAD_RELATION_TYPE:Rn,Thread:$n,ThreadEvent:Ds,ThreadFilterType:vc,ThreepidMedium:xbe,TimelineIndex:ZA,TimelineWindow:mbe,ToDeviceMessageId:_T,TokenRefreshError:SX,TokenRefreshLogoutError:oP,TweakName:pP,TypedEventEmitter:Kn,UNSIGNED_MEMBERSHIP_FIELD:KJ,UNSIGNED_THREAD_ID_FIELD:RC,UNSTABLE_ELEMENT_FUNCTIONAL_USERS:qJ,UNSTABLE_MSC2666_MUTUAL_ROOMS:sQ,UNSTABLE_MSC2666_QUERY_MUTUAL_ROOMS:oQ,UNSTABLE_MSC2666_SHARED_ROOMS:iQ,UNSTABLE_MSC2716_MARKER:HJ,UNSTABLE_MSC3088_ENABLED:yA,UNSTABLE_MSC3088_PURPOSE:vA,UNSTABLE_MSC3089_BRANCH:Iu,UNSTABLE_MSC3089_LEAF:BJ,UNSTABLE_MSC3089_TREE_SUBTYPE:bA,UNSTABLE_MSC3852_LAST_SEEN_UA:Q1e,UNSTABLE_MSC4133_EXTENDED_PROFILES:aQ,UNSTABLE_MSC4140_DELAYED_EVENTS:Qi,UNSTABLE_MSC4354_STICKY_EVENTS:jC,UnsupportedDelayedEventsEndpointError:Wo,UnsupportedStickyEventsEndpointError:VA,UpdateDelayedEventAction:hp,User:Hu,UserEvent:Xi,Visibility:FX,anySignal:CX,calculateRetryBackoff:cP,completeAuthorizationCodeGrant:G1e,createClient:OT,createNewMatrixCall:Db,createRoomWidgetClient:IQ,decodeBase64:fp,decodeIdToken:eQ,determineFeatureSupport:_E,discoverAndValidateOIDCIssuerWellKnown:TP,encodeBase64:G1,encodeUnpaddedBase64:fP,encodeUnpaddedBase64Url:ET,fixNotificationCountOnDecryption:lQ,generateAuthorizationParams:H1e,generateAuthorizationUrl:q1e,generateOidcAuthorizationUrl:V1e,generateScope:AT,getBeaconInfoIdentifier:IC,getHttpUriForMxc:yT,inMainTimelineForReceipt:Hb,isDmMemberCountCondition:T0e,isEventTypeSame:Jve,isPollEvent:yX,isSendDelayedEventRequestOpts:MC,isTimestampInDuration:EA,localStorageErrorsEventsEmitter:jbe,parseErrorResponse:aP,registerOidcClient:W1e,retryNetworkOperation:Pb,safeGetRetryAfterMs:sP,setCryptoStoreFactory:RQ,threadFilterTypeToFilter:uQ,threadIdForReceipt:kv,timeoutSignal:ST,validateAuthMetadata:ZX,validateAuthMetadataAndKeys:RP,validateBearerTokenResponse:rQ,validateIdToken:tQ,validateStoredUserState:nQ},Symbol.toStringTag,{value:"Module"}));if(globalThis.__js_sdk_entrypoint)throw new Error("Multiple matrix-js-sdk entrypoints detected!");globalThis.__js_sdk_entrypoint=!0;var tM;try{tM=globalThis.indexedDB}catch{}tM&&RQ(()=>new Xt(tM,"matrix-js-sdk:crypto"));globalThis.matrixcs=Fbe;var Sx={exports:{}},bt={};var WB;function $be(){if(WB)return bt;WB=1;var t=Symbol.for("react.transitional.element"),e=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),s=Symbol.for("react.consumer"),o=Symbol.for("react.context"),a=Symbol.for("react.forward_ref"),c=Symbol.for("react.suspense"),l=Symbol.for("react.memo"),d=Symbol.for("react.lazy"),h=Symbol.for("react.activity"),m=Symbol.iterator;function g(K){return K===null||typeof K!="object"?null:(K=m&&K[m]||K["@@iterator"],typeof K=="function"?K:null)}var y={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},v=Object.assign,E={};function w(K,Q,fe){this.props=K,this.context=Q,this.refs=E,this.updater=fe||y}w.prototype.isReactComponent={},w.prototype.setState=function(K,Q){if(typeof K!="object"&&typeof K!="function"&&K!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,K,Q,"setState")},w.prototype.forceUpdate=function(K){this.updater.enqueueForceUpdate(this,K,"forceUpdate")};function k(){}k.prototype=w.prototype;function x(K,Q,fe){this.props=K,this.context=Q,this.refs=E,this.updater=fe||y}var C=x.prototype=new k;C.constructor=x,v(C,w.prototype),C.isPureReactComponent=!0;var R=Array.isArray;function T(){}var M={H:null,A:null,T:null,S:null},O=Object.prototype.hasOwnProperty;function P(K,Q,fe){var de=fe.ref;return{$$typeof:t,type:K,key:Q,ref:de!==void 0?de:null,props:fe}}function D(K,Q){return P(K.type,Q,K.props)}function j(K){return typeof K=="object"&&K!==null&&K.$$typeof===t}function $(K){var Q={"=":"=0",":":"=2"};return"$"+K.replace(/[=:]/g,function(fe){return Q[fe]})}var q=/\/+/g;function Y(K,Q){return typeof K=="object"&&K!==null&&K.key!=null?$(""+K.key):Q.toString(36)}function W(K){switch(K.status){case"fulfilled":return K.value;case"rejected":throw K.reason;default:switch(typeof K.status=="string"?K.then(T,T):(K.status="pending",K.then(function(Q){K.status==="pending"&&(K.status="fulfilled",K.value=Q)},function(Q){K.status==="pending"&&(K.status="rejected",K.reason=Q)})),K.status){case"fulfilled":return K.value;case"rejected":throw K.reason}}throw K}function H(K,Q,fe,de,Te){var we=typeof K;(we==="undefined"||we==="boolean")&&(K=null);var ae=!1;if(K===null)ae=!0;else switch(we){case"bigint":case"string":case"number":ae=!0;break;case"object":switch(K.$$typeof){case t:case e:ae=!0;break;case d:return ae=K._init,H(ae(K._payload),Q,fe,de,Te)}}if(ae)return Te=Te(K),ae=de===""?"."+Y(K,0):de,R(Te)?(fe="",ae!=null&&(fe=ae.replace(q,"$&/")+"/"),H(Te,Q,fe,"",function(Ze){return Ze})):Te!=null&&(j(Te)&&(Te=D(Te,fe+(Te.key==null||K&&K.key===Te.key?"":(""+Te.key).replace(q,"$&/")+"/")+ae)),Q.push(Te)),1;ae=0;var ke=de===""?".":de+":";if(R(K))for(var Ne=0;Ne<K.length;Ne++)de=K[Ne],we=ke+Y(de,Ne),ae+=H(de,Q,fe,we,Te);else if(Ne=g(K),typeof Ne=="function")for(K=Ne.call(K),Ne=0;!(de=K.next()).done;)de=de.value,we=ke+Y(de,Ne++),ae+=H(de,Q,fe,we,Te);else if(we==="object"){if(typeof K.then=="function")return H(W(K),Q,fe,de,Te);throw Q=String(K),Error("Objects are not valid as a React child (found: "+(Q==="[object Object]"?"object with keys {"+Object.keys(K).join(", ")+"}":Q)+"). If you meant to render a collection of children, use an array instead.")}return ae}function F(K,Q,fe){if(K==null)return K;var de=[],Te=0;return H(K,de,"","",function(we){return Q.call(fe,we,Te++)}),de}function V(K){if(K._status===-1){var Q=K._result;Q=Q(),Q.then(function(fe){(K._status===0||K._status===-1)&&(K._status=1,K._result=fe)},function(fe){(K._status===0||K._status===-1)&&(K._status=2,K._result=fe)}),K._status===-1&&(K._status=0,K._result=Q)}if(K._status===1)return K._result.default;throw K._result}var G=typeof reportError=="function"?reportError:function(K){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var Q=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof K=="object"&&K!==null&&typeof K.message=="string"?String(K.message):String(K),error:K});if(!window.dispatchEvent(Q))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",K);return}console.error(K)},ee={map:F,forEach:function(K,Q,fe){F(K,function(){Q.apply(this,arguments)},fe)},count:function(K){var Q=0;return F(K,function(){Q++}),Q},toArray:function(K){return F(K,function(Q){return Q})||[]},only:function(K){if(!j(K))throw Error("React.Children.only expected to receive a single React element child.");return K}};return bt.Activity=h,bt.Children=ee,bt.Component=w,bt.Fragment=n,bt.Profiler=i,bt.PureComponent=x,bt.StrictMode=r,bt.Suspense=c,bt.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=M,bt.__COMPILER_RUNTIME={__proto__:null,c:function(K){return M.H.useMemoCache(K)}},bt.cache=function(K){return function(){return K.apply(null,arguments)}},bt.cacheSignal=function(){return null},bt.cloneElement=function(K,Q,fe){if(K==null)throw Error("The argument must be a React element, but you passed "+K+".");var de=v({},K.props),Te=K.key;if(Q!=null)for(we in Q.key!==void 0&&(Te=""+Q.key),Q)!O.call(Q,we)||we==="key"||we==="__self"||we==="__source"||we==="ref"&&Q.ref===void 0||(de[we]=Q[we]);var we=arguments.length-2;if(we===1)de.children=fe;else if(1<we){for(var ae=Array(we),ke=0;ke<we;ke++)ae[ke]=arguments[ke+2];de.children=ae}return P(K.type,Te,de)},bt.createContext=function(K){return K={$$typeof:o,_currentValue:K,_currentValue2:K,_threadCount:0,Provider:null,Consumer:null},K.Provider=K,K.Consumer={$$typeof:s,_context:K},K},bt.createElement=function(K,Q,fe){var de,Te={},we=null;if(Q!=null)for(de in Q.key!==void 0&&(we=""+Q.key),Q)O.call(Q,de)&&de!=="key"&&de!=="__self"&&de!=="__source"&&(Te[de]=Q[de]);var ae=arguments.length-2;if(ae===1)Te.children=fe;else if(1<ae){for(var ke=Array(ae),Ne=0;Ne<ae;Ne++)ke[Ne]=arguments[Ne+2];Te.children=ke}if(K&&K.defaultProps)for(de in ae=K.defaultProps,ae)Te[de]===void 0&&(Te[de]=ae[de]);return P(K,we,Te)},bt.createRef=function(){return{current:null}},bt.forwardRef=function(K){return{$$typeof:a,render:K}},bt.isValidElement=j,bt.lazy=function(K){return{$$typeof:d,_payload:{_status:-1,_result:K},_init:V}},bt.memo=function(K,Q){return{$$typeof:l,type:K,compare:Q===void 0?null:Q}},bt.startTransition=function(K){var Q=M.T,fe={};M.T=fe;try{var de=K(),Te=M.S;Te!==null&&Te(fe,de),typeof de=="object"&&de!==null&&typeof de.then=="function"&&de.then(T,G)}catch(we){G(we)}finally{Q!==null&&fe.types!==null&&(Q.types=fe.types),M.T=Q}},bt.unstable_useCacheRefresh=function(){return M.H.useCacheRefresh()},bt.use=function(K){return M.H.use(K)},bt.useActionState=function(K,Q,fe){return M.H.useActionState(K,Q,fe)},bt.useCallback=function(K,Q){return M.H.useCallback(K,Q)},bt.useContext=function(K){return M.H.useContext(K)},bt.useDebugValue=function(){},bt.useDeferredValue=function(K,Q){return M.H.useDeferredValue(K,Q)},bt.useEffect=function(K,Q){return M.H.useEffect(K,Q)},bt.useEffectEvent=function(K){return M.H.useEffectEvent(K)},bt.useId=function(){return M.H.useId()},bt.useImperativeHandle=function(K,Q,fe){return M.H.useImperativeHandle(K,Q,fe)},bt.useInsertionEffect=function(K,Q){return M.H.useInsertionEffect(K,Q)},bt.useLayoutEffect=function(K,Q){return M.H.useLayoutEffect(K,Q)},bt.useMemo=function(K,Q){return M.H.useMemo(K,Q)},bt.useOptimistic=function(K,Q){return M.H.useOptimistic(K,Q)},bt.useReducer=function(K,Q,fe){return M.H.useReducer(K,Q,fe)},bt.useRef=function(K){return M.H.useRef(K)},bt.useState=function(K){return M.H.useState(K)},bt.useSyncExternalStore=function(K,Q,fe){return M.H.useSyncExternalStore(K,Q,fe)},bt.useTransition=function(){return M.H.useTransition()},bt.version="19.2.4",bt}var YB;function PT(){return YB||(YB=1,Sx.exports=$be()),Sx.exports}var _=PT();const xe=Dl(_),uy=Qge({__proto__:null,default:xe},[_]);var wx={exports:{}},Q0={},Ex={exports:{}},Cx={};var JB;function Bbe(){return JB||(JB=1,(function(t){function e(H,F){var V=H.length;H.push(F);e:for(;0<V;){var G=V-1>>>1,ee=H[G];if(0<i(ee,F))H[G]=F,H[V]=ee,V=G;else break e}}function n(H){return H.length===0?null:H[0]}function r(H){if(H.length===0)return null;var F=H[0],V=H.pop();if(V!==F){H[0]=V;e:for(var G=0,ee=H.length,K=ee>>>1;G<K;){var Q=2*(G+1)-1,fe=H[Q],de=Q+1,Te=H[de];if(0>i(fe,V))de<ee&&0>i(Te,fe)?(H[G]=Te,H[de]=V,G=de):(H[G]=fe,H[Q]=V,G=Q);else if(de<ee&&0>i(Te,V))H[G]=Te,H[de]=V,G=de;else break e}}return F}function i(H,F){var V=H.sortIndex-F.sortIndex;return V!==0?V:H.id-F.id}if(t.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var s=performance;t.unstable_now=function(){return s.now()}}else{var o=Date,a=o.now();t.unstable_now=function(){return o.now()-a}}var c=[],l=[],d=1,h=null,m=3,g=!1,y=!1,v=!1,E=!1,w=typeof setTimeout=="function"?setTimeout:null,k=typeof clearTimeout=="function"?clearTimeout:null,x=typeof setImmediate<"u"?setImmediate:null;function C(H){for(var F=n(l);F!==null;){if(F.callback===null)r(l);else if(F.startTime<=H)r(l),F.sortIndex=F.expirationTime,e(c,F);else break;F=n(l)}}function R(H){if(v=!1,C(H),!y)if(n(c)!==null)y=!0,T||(T=!0,$());else{var F=n(l);F!==null&&W(R,F.startTime-H)}}var T=!1,M=-1,O=5,P=-1;function D(){return E?!0:!(t.unstable_now()-P<O)}function j(){if(E=!1,T){var H=t.unstable_now();P=H;var F=!0;try{e:{y=!1,v&&(v=!1,k(M),M=-1),g=!0;var V=m;try{t:{for(C(H),h=n(c);h!==null&&!(h.expirationTime>H&&D());){var G=h.callback;if(typeof G=="function"){h.callback=null,m=h.priorityLevel;var ee=G(h.expirationTime<=H);if(H=t.unstable_now(),typeof ee=="function"){h.callback=ee,C(H),F=!0;break t}h===n(c)&&r(c),C(H)}else r(c);h=n(c)}if(h!==null)F=!0;else{var K=n(l);K!==null&&W(R,K.startTime-H),F=!1}}break e}finally{h=null,m=V,g=!1}F=void 0}}finally{F?$():T=!1}}}var $;if(typeof x=="function")$=function(){x(j)};else if(typeof MessageChannel<"u"){var q=new MessageChannel,Y=q.port2;q.port1.onmessage=j,$=function(){Y.postMessage(null)}}else $=function(){w(j,0)};function W(H,F){M=w(function(){H(t.unstable_now())},F)}t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(H){H.callback=null},t.unstable_forceFrameRate=function(H){0>H||125<H?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):O=0<H?Math.floor(1e3/H):5},t.unstable_getCurrentPriorityLevel=function(){return m},t.unstable_next=function(H){switch(m){case 1:case 2:case 3:var F=3;break;default:F=m}var V=m;m=F;try{return H()}finally{m=V}},t.unstable_requestPaint=function(){E=!0},t.unstable_runWithPriority=function(H,F){switch(H){case 1:case 2:case 3:case 4:case 5:break;default:H=3}var V=m;m=H;try{return F()}finally{m=V}},t.unstable_scheduleCallback=function(H,F,V){var G=t.unstable_now();switch(typeof V=="object"&&V!==null?(V=V.delay,V=typeof V=="number"&&0<V?G+V:G):V=G,H){case 1:var ee=-1;break;case 2:ee=250;break;case 5:ee=1073741823;break;case 4:ee=1e4;break;default:ee=5e3}return ee=V+ee,H={id:d++,callback:F,priorityLevel:H,startTime:V,expirationTime:ee,sortIndex:-1},V>G?(H.sortIndex=V,e(l,H),n(c)===null&&H===n(l)&&(v?(k(M),M=-1):v=!0,W(R,V-G))):(H.sortIndex=ee,e(c,H),y||g||(y=!0,T||(T=!0,$()))),H},t.unstable_shouldYield=D,t.unstable_wrapCallback=function(H){var F=m;return function(){var V=m;m=F;try{return H.apply(this,arguments)}finally{m=V}}}})(Cx)),Cx}var XB;function Hbe(){return XB||(XB=1,Ex.exports=Bbe()),Ex.exports}var Tx={exports:{}},ms={};var QB;function qbe(){if(QB)return ms;QB=1;var t=PT();function e(c){var l="https://react.dev/errors/"+c;if(1<arguments.length){l+="?args[]="+encodeURIComponent(arguments[1]);for(var d=2;d<arguments.length;d++)l+="&args[]="+encodeURIComponent(arguments[d])}return"Minified React error #"+c+"; visit "+l+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function n(){}var r={d:{f:n,r:function(){throw Error(e(522))},D:n,C:n,L:n,m:n,X:n,S:n,M:n},p:0,findDOMNode:null},i=Symbol.for("react.portal");function s(c,l,d){var h=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:i,key:h==null?null:""+h,children:c,containerInfo:l,implementation:d}}var o=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function a(c,l){if(c==="font")return"";if(typeof l=="string")return l==="use-credentials"?l:""}return ms.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=r,ms.createPortal=function(c,l){var d=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!l||l.nodeType!==1&&l.nodeType!==9&&l.nodeType!==11)throw Error(e(299));return s(c,l,null,d)},ms.flushSync=function(c){var l=o.T,d=r.p;try{if(o.T=null,r.p=2,c)return c()}finally{o.T=l,r.p=d,r.d.f()}},ms.preconnect=function(c,l){typeof c=="string"&&(l?(l=l.crossOrigin,l=typeof l=="string"?l==="use-credentials"?l:"":void 0):l=null,r.d.C(c,l))},ms.prefetchDNS=function(c){typeof c=="string"&&r.d.D(c)},ms.preinit=function(c,l){if(typeof c=="string"&&l&&typeof l.as=="string"){var d=l.as,h=a(d,l.crossOrigin),m=typeof l.integrity=="string"?l.integrity:void 0,g=typeof l.fetchPriority=="string"?l.fetchPriority:void 0;d==="style"?r.d.S(c,typeof l.precedence=="string"?l.precedence:void 0,{crossOrigin:h,integrity:m,fetchPriority:g}):d==="script"&&r.d.X(c,{crossOrigin:h,integrity:m,fetchPriority:g,nonce:typeof l.nonce=="string"?l.nonce:void 0})}},ms.preinitModule=function(c,l){if(typeof c=="string")if(typeof l=="object"&&l!==null){if(l.as==null||l.as==="script"){var d=a(l.as,l.crossOrigin);r.d.M(c,{crossOrigin:d,integrity:typeof l.integrity=="string"?l.integrity:void 0,nonce:typeof l.nonce=="string"?l.nonce:void 0})}}else l==null&&r.d.M(c)},ms.preload=function(c,l){if(typeof c=="string"&&typeof l=="object"&&l!==null&&typeof l.as=="string"){var d=l.as,h=a(d,l.crossOrigin);r.d.L(c,d,{crossOrigin:h,integrity:typeof l.integrity=="string"?l.integrity:void 0,nonce:typeof l.nonce=="string"?l.nonce:void 0,type:typeof l.type=="string"?l.type:void 0,fetchPriority:typeof l.fetchPriority=="string"?l.fetchPriority:void 0,referrerPolicy:typeof l.referrerPolicy=="string"?l.referrerPolicy:void 0,imageSrcSet:typeof l.imageSrcSet=="string"?l.imageSrcSet:void 0,imageSizes:typeof l.imageSizes=="string"?l.imageSizes:void 0,media:typeof l.media=="string"?l.media:void 0})}},ms.preloadModule=function(c,l){if(typeof c=="string")if(l){var d=a(l.as,l.crossOrigin);r.d.m(c,{as:typeof l.as=="string"&&l.as!=="script"?l.as:void 0,crossOrigin:d,integrity:typeof l.integrity=="string"?l.integrity:void 0})}else r.d.m(c)},ms.requestFormReset=function(c){r.d.r(c)},ms.unstable_batchedUpdates=function(c,l){return c(l)},ms.useFormState=function(c,l,d){return o.H.useFormState(c,l,d)},ms.useFormStatus=function(){return o.H.useHostTransitionStatus()},ms.version="19.2.4",ms}var ZB;function xQ(){if(ZB)return Tx.exports;ZB=1;function t(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(e){console.error(e)}}return t(),Tx.exports=qbe(),Tx.exports}var eH;function Vbe(){if(eH)return Q0;eH=1;var t=Hbe(),e=PT(),n=xQ();function r(u){var f="https://react.dev/errors/"+u;if(1<arguments.length){f+="?args[]="+encodeURIComponent(arguments[1]);for(var p=2;p<arguments.length;p++)f+="&args[]="+encodeURIComponent(arguments[p])}return"Minified React error #"+u+"; visit "+f+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function i(u){return!(!u||u.nodeType!==1&&u.nodeType!==9&&u.nodeType!==11)}function s(u){var f=u,p=u;if(u.alternate)for(;f.return;)f=f.return;else{u=f;do f=u,(f.flags&4098)!==0&&(p=f.return),u=f.return;while(u)}return f.tag===3?p:null}function o(u){if(u.tag===13){var f=u.memoizedState;if(f===null&&(u=u.alternate,u!==null&&(f=u.memoizedState)),f!==null)return f.dehydrated}return null}function a(u){if(u.tag===31){var f=u.memoizedState;if(f===null&&(u=u.alternate,u!==null&&(f=u.memoizedState)),f!==null)return f.dehydrated}return null}function c(u){if(s(u)!==u)throw Error(r(188))}function l(u){var f=u.alternate;if(!f){if(f=s(u),f===null)throw Error(r(188));return f!==u?null:u}for(var p=u,b=f;;){var I=p.return;if(I===null)break;var A=I.alternate;if(A===null){if(b=I.return,b!==null){p=b;continue}break}if(I.child===A.child){for(A=I.child;A;){if(A===p)return c(I),u;if(A===b)return c(I),f;A=A.sibling}throw Error(r(188))}if(p.return!==b.return)p=I,b=A;else{for(var U=!1,z=I.child;z;){if(z===p){U=!0,p=I,b=A;break}if(z===b){U=!0,b=I,p=A;break}z=z.sibling}if(!U){for(z=A.child;z;){if(z===p){U=!0,p=A,b=I;break}if(z===b){U=!0,b=A,p=I;break}z=z.sibling}if(!U)throw Error(r(189))}}if(p.alternate!==b)throw Error(r(190))}if(p.tag!==3)throw Error(r(188));return p.stateNode.current===p?u:f}function d(u){var f=u.tag;if(f===5||f===26||f===27||f===6)return u;for(u=u.child;u!==null;){if(f=d(u),f!==null)return f;u=u.sibling}return null}var h=Object.assign,m=Symbol.for("react.element"),g=Symbol.for("react.transitional.element"),y=Symbol.for("react.portal"),v=Symbol.for("react.fragment"),E=Symbol.for("react.strict_mode"),w=Symbol.for("react.profiler"),k=Symbol.for("react.consumer"),x=Symbol.for("react.context"),C=Symbol.for("react.forward_ref"),R=Symbol.for("react.suspense"),T=Symbol.for("react.suspense_list"),M=Symbol.for("react.memo"),O=Symbol.for("react.lazy"),P=Symbol.for("react.activity"),D=Symbol.for("react.memo_cache_sentinel"),j=Symbol.iterator;function $(u){return u===null||typeof u!="object"?null:(u=j&&u[j]||u["@@iterator"],typeof u=="function"?u:null)}var q=Symbol.for("react.client.reference");function Y(u){if(u==null)return null;if(typeof u=="function")return u.$$typeof===q?null:u.displayName||u.name||null;if(typeof u=="string")return u;switch(u){case v:return"Fragment";case w:return"Profiler";case E:return"StrictMode";case R:return"Suspense";case T:return"SuspenseList";case P:return"Activity"}if(typeof u=="object")switch(u.$$typeof){case y:return"Portal";case x:return u.displayName||"Context";case k:return(u._context.displayName||"Context")+".Consumer";case C:var f=u.render;return u=u.displayName,u||(u=f.displayName||f.name||"",u=u!==""?"ForwardRef("+u+")":"ForwardRef"),u;case M:return f=u.displayName||null,f!==null?f:Y(u.type)||"Memo";case O:f=u._payload,u=u._init;try{return Y(u(f))}catch{}}return null}var W=Array.isArray,H=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,F=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,V={pending:!1,data:null,method:null,action:null},G=[],ee=-1;function K(u){return{current:u}}function Q(u){0>ee||(u.current=G[ee],G[ee]=null,ee--)}function fe(u,f){ee++,G[ee]=u.current,u.current=f}var de=K(null),Te=K(null),we=K(null),ae=K(null);function ke(u,f){switch(fe(we,f),fe(Te,u),fe(de,null),f.nodeType){case 9:case 11:u=(u=f.documentElement)&&(u=u.namespaceURI)?yF(u):0;break;default:if(u=f.tagName,f=f.namespaceURI)f=yF(f),u=bF(f,u);else switch(u){case"svg":u=1;break;case"math":u=2;break;default:u=0}}Q(de),fe(de,u)}function Ne(){Q(de),Q(Te),Q(we)}function Ze(u){u.memoizedState!==null&&fe(ae,u);var f=de.current,p=bF(f,u.type);f!==p&&(fe(Te,u),fe(de,p))}function Ot(u){Te.current===u&&(Q(de),Q(Te)),ae.current===u&&(Q(ae),L0._currentValue=V)}var Mr,Un;function We(u){if(Mr===void 0)try{throw Error()}catch(p){var f=p.stack.trim().match(/\n( *(at )?)/);Mr=f&&f[1]||"",Un=-1<p.stack.indexOf(`
26
26
  at`)?" (<anonymous>)":-1<p.stack.indexOf("@")?"@unknown:0:0":""}return`
27
27
  `+Mr+u+Un}var dr=!1;function zs(u,f){if(!u||dr)return"";dr=!0;var p=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var b={DetermineComponentFrameRoot:function(){try{if(f){var Ee=function(){throw Error()};if(Object.defineProperty(Ee.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(Ee,[])}catch(ve){var ue=ve}Reflect.construct(u,[],Ee)}else{try{Ee.call()}catch(ve){ue=ve}u.call(Ee.prototype)}}else{try{throw Error()}catch(ve){ue=ve}(Ee=u())&&typeof Ee.catch=="function"&&Ee.catch(function(){})}}catch(ve){if(ve&&ue&&typeof ve.stack=="string")return[ve.stack,ue.stack]}return[null,null]}};b.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var I=Object.getOwnPropertyDescriptor(b.DetermineComponentFrameRoot,"name");I&&I.configurable&&Object.defineProperty(b.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var A=b.DetermineComponentFrameRoot(),U=A[0],z=A[1];if(U&&z){var X=U.split(`
@@ -144,7 +144,7 @@ For more information, see https://radix-ui.com/primitives/docs/components/${e.do
144
144
  `,"intent:",a,`
145
145
  properties:`,l,"configuration:",d),{...l,...c,...I$e(d,h=>h!==void 0)}},oc=()=>{const{search:t,hash:e}=cs();return _.useMemo(()=>er(t,e),[t,e])};function D$e(t,e,n){let r=null;t=t.substring(1);const i=t.split("/"),s=i[0]=="room",o=i.length>1;n===""||n.startsWith("#?")?(o&&s&&(r=i[1]),s||(r=i[0])):r=n,r=r?.split("?")[0]??null,r&&(r.length<=1?r=null:(r.startsWith("#")||(r=`#${r}`),r.includes(":")||(r=`${r}:${_n.defaultServerName()}`)));const a=new ice(e,n);let c=a.getParam("roomId");return c!==null&&(c=c.replaceAll(/^[^ -~]+|[^ -~]+$/g,""),c.startsWith("!")&&c.includes("")||(c=null)),{roomAlias:r,roomId:c,viaServers:a.getAllParams("viaServers")}}const N$e=()=>{const{pathname:t,search:e,hash:n}=cs();return _.useMemo(()=>D$e(t,e,n),[t,e,n])};function U$e(t,e,n){const r=new URLSearchParams;switch(e?.kind){case qn.SHARED_KEY:{const i=encodeURIComponent(e.secret);i!==e.secret&&N.info("Encoded call password used non URL-safe chars: buggy client?"),r.set("password",i);break}case qn.PER_PARTICIPANT:r.set("perParticipantE2EE","true");break}return r.set("roomId",t),r}const j$e=""+new URL("cat-4r_NkDcK.ogg",import.meta.url).href,F$e=""+new URL("cat-Dd8bv_2W.mp3",import.meta.url).href,$$e=""+new URL("clap-AxCMZLTd.ogg",import.meta.url).href,B$e=""+new URL("clap-Dxm5qGyl.mp3",import.meta.url).href,H$e=""+new URL("crickets-DUJdcuUa.ogg",import.meta.url).href,q$e=""+new URL("crickets-CcwrRdbq.mp3",import.meta.url).href,V$e=""+new URL("dog-CxIWtkNX.ogg",import.meta.url).href,K$e=""+new URL("dog-BoQdnF-w.mp3",import.meta.url).href,G$e=""+new URL("generic-BBbS3Wph.ogg",import.meta.url).href,z$e=""+new URL("generic-BFeSb6fL.mp3",import.meta.url).href,W$e=""+new URL("lightbulb-BIeJtAR_.ogg",import.meta.url).href,Y$e=""+new URL("lightbulb-BrnY00qi.mp3",import.meta.url).href,J$e=""+new URL("party-D7rIOhAQ.ogg",import.meta.url).href,X$e=""+new URL("party-BZPeTgC3.mp3",import.meta.url).href,Q$e=""+new URL("deer-DPSlVch4.ogg",import.meta.url).href,Z$e=""+new URL("deer-91r1Gyrx.mp3",import.meta.url).href,eBe=""+new URL("rock-BVCJXNC-.ogg",import.meta.url).href,tBe=""+new URL("rock-CHdnB31m.mp3",import.meta.url).href,nBe=""+new URL("wave-FiiOzicp.ogg",import.meta.url).href,rBe=""+new URL("wave-Bzf1LSMH.mp3",import.meta.url).href,iBe=""+new URL("baduntss-Ca1ZuBEK.ogg",import.meta.url).href,sBe=""+new URL("baduntss-DOe0oFuS.mp3",import.meta.url).href,r9="io.element.call.reaction",AL={name:"generic",emoji:"",sound:{mp3:z$e,ogg:G$e}},ML=5,p_=[{emoji:"👍",name:"thumbsup",alias:["+1","yes","thumbs up"]},{emoji:"🎉",name:"party",alias:["hurray","success"],sound:{ogg:J$e,mp3:X$e}},{emoji:"👏",name:"clapping",alias:["celebrate","success"],sound:{ogg:$$e,mp3:B$e}},{emoji:"🐶",name:"dog",alias:["doggo","pupper","woofer","bark"],sound:{ogg:V$e,mp3:K$e}},{emoji:"🐱",name:"cat",alias:["meow","kitty"],sound:{ogg:j$e,mp3:F$e}},{emoji:"💡",name:"lightbulb",alias:["bulb","light","idea","ping"],sound:{ogg:W$e,mp3:Y$e}},{emoji:"🦗",name:"crickets",alias:["awkward","silence"],sound:{ogg:H$e,mp3:q$e}},{emoji:"👎",name:"thumbsdown",alias:["-1","no","thumbs no"]},{emoji:"😵‍💫",name:"dizzy",alias:["dazed","confused"]},{emoji:"👌",name:"ok",alias:["okay","cool"]},{emoji:"🥰",name:"heart",alias:["heart","love","smiling"]},{emoji:"😄",name:"laugh",alias:["giggle","joy","smiling"]},{emoji:"🦌",name:"deer",alias:["stag","doe","bleat"],sound:{ogg:Q$e,mp3:Z$e}},{emoji:"🤘",name:"rock",alias:["cool","horns","guitar"],sound:{ogg:eBe,mp3:tBe}},{emoji:"👋",name:"wave",alias:["hand","waving"],sound:{ogg:nBe,mp3:rBe}},{emoji:"🥁",name:"drum",alias:["joke"],sound:{ogg:iBe,mp3:sBe}}];var Tl=(t=>(t.JoinCall="io.element.join",t.HangupCall="im.vector.hangup",t.Close="io.element.close",t.DeviceMute="io.element.device_mute",t))(Tl||{});let vt;const oBe=(t="m.call",e=!1)=>{try{const{widgetId:n,parentUrl:r,roomId:i,userId:s,deviceId:o,baseUrl:a,e2eEnabled:c,allowIceFallback:l}=er();if(!i)throw new Error("Room ID must be supplied");if(!s)throw new Error("User ID must be supplied");if(!o)throw new Error("Device ID must be supplied");if(!a)throw new Error("Base URL must be supplied");if(n&&r){const d=new URL(r).origin;N.info("Widget API is available");const h=new cbe(n,d);h.requestCapability(mf.AlwaysOnScreen),h.requestCapability(mf.MSC4039DownloadFile);const m=new CNe;[Rr.ThemeChange,"io.element.join","im.vector.hangup","io.element.device_mute"].forEach(C=>{h.on(`action:${C}`,R=>{R.preventDefault(),m.emit(C,R)})});const g=[Z.CallNotify,Z.RTCNotification];e&&g.push(Z.RoomMessage);const y=["org.matrix.rageshake_request",Z.CallEncryptionKeysPrefix,Z.Reaction,Z.RoomRedaction,r9,Z.RTCDecline,Z.RTCMembership],v=[s,`_${s}_${o}_${t}`,`${s}_${o}_${t}`].map(C=>({eventType:Z.GroupCallMemberPrefix,stateKey:C})),E=[{eventType:Z.RoomCreate},{eventType:Z.RoomName},{eventType:Z.RoomMember},{eventType:Z.RoomEncryption},{eventType:Z.GroupCallMemberPrefix}],w=[Z.CallInvite,Z.CallCandidates,Z.CallAnswer,Z.CallHangup,Z.CallReject,Z.CallSelectAnswer,Z.CallNegotiate,Z.CallSDPStreamMetadataChanged,Z.CallSDPStreamMetadataChangedPrefix,Z.CallReplaces,Z.CallEncryptionKeysPrefix],k=IQ(h,{sendEvent:[...g,...y],receiveEvent:y,sendState:v,receiveState:E,sendToDevice:w,receiveToDevice:w,turnServers:!1,sendDelayedEvents:!0,updateDelayedEvents:!0,sendSticky:!0,receiveSticky:!0},i,{baseUrl:a,userId:s,deviceId:o,timelineSupport:!0,useE2eForGroupCall:c,fallbackICEServerAllowed:l},!1);vt={api:h,lazyActions:m,client:(async()=>(await _n.init(),await k.startClient({clientWellKnownPollPeriod:600}),k))()}}else N.info("No widget API available"),vt=null}catch(n){N.warn("Continuing without the widget API",n),vt=null}};var ky=(t=>(t.XS="xs",t.SM="sm",t.MD="md",t.LG="lg",t.XL="xl",t))(ky||{});const aBe=new Map([["xs",22],["sm",32],["md",36],["lg",42],["xl",90]]);function cBe(t,e,n=96){const r=Math.floor(n*window.devicePixelRatio),i=Math.floor(n*window.devicePixelRatio),s=n<=96?"crop":"scale";return e?t.mxcUrlToHttp(e,r,i,s,!1,!0,!0):null}const Iy=({className:t,id:e,name:n,src:r,size:i="md",style:s,...o})=>{const a=xy(),c=_.useMemo(()=>Object.values(ky).includes(i)?aBe.get(i):i,[i]),[l,d]=_.useState(void 0);return _.useEffect(()=>{if(!r){d(void 0);return}let h;if(vt?.api)h=uBe(vt.api,r);else if(a?.state==="valid"&&a.authenticated?.client&&c)h=lBe(a.authenticated.client,r,c);else{d(void 0);return}let m,g=!1;return h.then(y=>{g||(m=URL.createObjectURL(y),d(m))}).catch(y=>{g||d(void 0)}),()=>{g=!0,m&&URL.revokeObjectURL(m)}},[a,r,c]),S.jsx(k5e,{className:t,id:e,name:n,size:`${c}px`,src:l,style:s,...o})};async function lBe(t,e,n){const r=cBe(t,e,n);if(!r)throw new Error("Failed to get http avatar URL");const i=t.getAccessToken();if(!i)throw new Error("Failed to get access token");return await(await fetch(r,{headers:{Authorization:`Bearer ${i}`}})).blob()}async function uBe(t,e){const r=(await t.downloadFile(e)).file;if(!(r instanceof Blob))throw new Error("Downloaded file is not a Blob");return r}const dBe="_lock_zf62g_8",fBe={lock:dBe},hBe=({encrypted:t})=>{const{t:e}=ze(),n=t?XDe:JDe,r=e(t?"common.encrypted":"common.unencrypted");return S.jsx(mi,{label:r,placement:"right",isTriggerInteractive:!1,children:S.jsx(n,{width:16,height:16,className:fBe.lock,"data-encrypted":t})})};function DR(t){const e=_.useMemo(()=>window.matchMedia(t),[t]),n=_.useCallback(i=>(e.addEventListener("change",i),()=>e.removeEventListener("change",i)),[e]),r=_.useCallback(()=>e.matches,[e]);return _.useSyncExternalStore(n,r)}const pBe="_banner_sye6n_8",mBe={banner:pBe},gBe=({children:t,className:e,...n})=>{const{t:r}=ze(),i=xy();let s=!1;return i?.state==="valid"&&(s=i.disconnected),S.jsx(S.Fragment,{children:s&&S.jsxs("div",{className:Le(mBe.banner,e),...n,children:[t,r("disconnected_banner")]})})},hd=({ref:t,children:e,className:n,disconnectedBanner:r=!0,...i})=>S.jsxs(S.Fragment,{children:[S.jsx("header",{ref:t,className:Le(Ka.header,n),...i,children:e}),r&&S.jsx(gBe,{})]});hd.displayName="Header";const fh=({children:t,className:e,hideMobile:n,...r})=>S.jsx("div",{className:Le(Ka.nav,Ka.leftNav,{[Ka.hideMobile]:n},e),...r,children:t}),hh=({children:t,className:e,hideMobile:n,...r})=>S.jsx("div",{className:Le(Ka.nav,Ka.rightNav,{[Ka.hideMobile]:n},e),...r,children:t}),Bp=({className:t})=>{const{t:e}=ze();return S.jsx(KT,{className:Le(Ka.headerLogo,t),to:"/","aria-label":e("header_label"),children:S.jsx(ENe,{})})},sce=({id:t,name:e,avatarUrl:n,encrypted:r,participantCount:i})=>{const{t:s}=ze(),o=DR("(max-width: 550px)")?"sm":"lg";return S.jsxs("div",{className:Ka.roomHeaderInfo,"data-size":o,children:[S.jsx(Iy,{className:Ka.roomAvatar,id:t,name:e,size:o==="sm"?ky.SM:56,src:n??void 0}),S.jsxs("div",{className:Ka.nameLine,children:[S.jsx(qc,{type:o==="sm"?"body":"heading",size:o==="sm"?"lg":"md",weight:"semibold","data-testid":"roomHeader_roomName",children:e}),S.jsx(hBe,{encrypted:r})]}),(i??0)>0&&S.jsxs("div",{className:Ka.participantsLine,children:[S.jsx(wae,{width:20,height:20,"aria-label":s("header_participants_label")}),S.jsx(on,{as:"span",size:"sm",weight:"medium","data-testid":"roomHeader_participants_count",children:s("participant_count",{count:i??0})})]})]})},vBe="_page_fvtgn_8",yBe="_container_fvtgn_20",bBe="_content_fvtgn_28",J6={page:vBe,container:yBe,content:bBe},_Be="_rageshakeControl_65ekp_8",hG={rageshakeControl:_Be},pG=1024*1024*5,SBe=2*1e3,wBe=3;class EBe extends FJ{constructor(){super(...arguments),this.logs="",this.log=(e,...n)=>{const r=new Date().toISOString();n=n.map(s=>{if(s instanceof DOMException)return s.message+` (${s.name} | ${s.code})`;if(s instanceof Error)return s.message+(s.stack?`
146
146
  ${s.stack}`:"");if(typeof s=="object")try{return JSON.stringify(s,xBe())}catch{return"<$ failed to serialize object $>"}else return s});let i=`${r} ${e} ${n.join(" ")}
147
- `;i=i.replace(/token=[a-zA-Z0-9-]+/gm,"token=xxxxx"),this.logs+=i,this.emit("log")}}popLogs(){const e=this.logs;return this.logs="",e}peekLogs(){return this.logs}}class CBe{constructor(e,n){this.indexedDB=e,this.loggerInstance=n,this.index=0,this.onLoggerLog=()=>{this.db&&this.throttledFlush()},this.throttledFlush=A$e(()=>this.flush,SBe,{leading:!1,trailing:!0}),this.flush=async()=>this.flushPromise?this.flushAgainPromise?this.flushAgainPromise:(this.flushAgainPromise=this.flushPromise.then(this.flush).then(()=>{this.flushAgainPromise=void 0}),this.flushAgainPromise):(this.flushPromise=new Promise((r,i)=>{if(!this.db){i(new Error("No connected database"));return}const s=this.loggerInstance.popLogs();if(s.length===0){r();return}const o=this.db.transaction(["logs","logslastmod"],"readwrite"),a=o.objectStore("logs");o.oncomplete=()=>{r()},o.onerror=l=>{N.error("Failed to flush logs : ",l),i(new Error("Failed to write logs: "+o?.error?.message))},a.add(this.generateLogEntry(s)),o.objectStore("logslastmod").put(this.generateLastModifiedTime())}).then(()=>{this.flushPromise=void 0}),this.flushPromise),this.id="instance-"+Qo(16),n.on("log",this.onLoggerLog),window.addEventListener("beforeunload",()=>{this.flush().catch(r=>N.error("Failed to flush logs before unload",r))})}async connect(){const e=this.indexedDB.open("logs");return new Promise((n,r)=>{e.onsuccess=()=>{this.db=e.result,n()},e.onerror=()=>{const i="Failed to open log database: "+e?.error?.name;N.error(i),r(new Error(i))},e.onupgradeneeded=()=>{const i=e.result,s=i.createObjectStore("logs",{keyPath:["id","index"]});s.createIndex("id","id",{unique:!1}),s.add(this.generateLogEntry(new Date+" ::: Log database was created.")),i.createObjectStore("logslastmod",{keyPath:"id"}).add(this.generateLastModifiedTime())}})}async consume(){const e=this.db;if(!e)return Promise.reject(new Error("No connected database"));async function n(l,d){const h=e.transaction("logs","readonly").objectStore("logs");return new Promise((m,g)=>{const y=h.index("id").openCursor(IDBKeyRange.only(l),"prev");let v="";y.onerror=()=>{g(new Error("Query failed: "+y?.error?.message))},y.onsuccess=()=>{const E=y.result;if(!E){m(v);return}v=E.value.lines+v,v.length>=d?m(v):E.continue()}})}async function r(){const l=e.transaction("logslastmod","readonly").objectStore("logslastmod");return TBe(l,void 0,d=>({id:d.value.id,ts:d.value.ts})).then(d=>d.sort((h,m)=>m.ts-h.ts).map(h=>h.id))}async function i(l){return new Promise((d,h)=>{const m=e.transaction(["logs","logslastmod"],"readwrite"),g=m.objectStore("logs"),y=g.index("id").openKeyCursor(IDBKeyRange.only(l));y.onsuccess=()=>{const E=y.result;E&&(g.delete(E.primaryKey),E.continue())},m.oncomplete=()=>{d()},m.onerror=()=>{h(new Error(`Failed to delete logs for '${l}' : ${m?.error?.message}`))},m.objectStore("logslastmod").delete(l)})}const s=await r();let o=[];const a=[];let c=0;for(let l=0;l<s.length;l++){const d=await n(s[l],pG-c);if(a.push({lines:d,id:s[l]}),c+=d.length,c>=pG){o=s.slice(l+1).map(h=>parseInt(h,10));break}}return o.length>0&&(N.log("Removing logs: ",o),Promise.all(o.map(async l=>i(l))).then(()=>{N.log(`Removed ${o.length} old logs.`)},l=>{N.error(l)})),a}generateLogEntry(e){return{id:this.id,lines:e,index:this.index++}}generateLastModifiedTime(){return{id:this.id,ts:Date.now()}}}async function TBe(t,e,n){const r=t.openCursor(e);return new Promise((i,s)=>{const o=[];r.onerror=()=>{s(new Error("Query failed: "+r?.error?.message))},r.onsuccess=()=>{const a=r.result;if(!a){i(o);return}o.push(n(a)),a.continue()}})}async function RBe(){return global.mx_rage_logger=new EBe,ABe(N,global.mx_rage_logger.log),["trace","debug","info","warn","error"].forEach(t=>{const e=window.console[t];if(!e)return;const n=`${t.toUpperCase()} matrix_sdk`;window.console[t]=(...r)=>{e(...r),typeof r[0]=="string"&&r[0].startsWith(n)&&global.mx_rage_logger.log(i9[t],"matrix_sdk",...r)}}),kBe()}async function kBe(){if(global.mx_rage_initStoragePromise)return global.mx_rage_initStoragePromise;N.log("Configuring rageshake persistence...");let t;try{t=window.indexedDB}catch(e){N.warn("Could not get indexDB from window.",e)}return t?(global.mx_rage_store=new CBe(t,global.mx_rage_logger),global.mx_rage_initStoragePromise=global.mx_rage_store.connect(),global.mx_rage_initStoragePromise):(global.mx_rage_initStoragePromise=Promise.resolve(),global.mx_rage_initStoragePromise)}async function IBe(){if(!global.mx_rage_logger)throw new Error("No console logger, did you forget to call init()?");return global.mx_rage_store?(await global.mx_rage_store.flush(),global.mx_rage_store.consume()):[{lines:global.mx_rage_logger.peekLogs(),id:"-"}]}const xBe=()=>{const t=new WeakSet,e=new WeakMap;return function(n,r){if(typeof r=="object"&&r!==null){if(t.has(r))return"<$ cycle-trimmed $>";t.add(r);let i=0;if(this&&(i=e.get(this)??0),e.set(r,i+1),i>wBe)return"<$ object-pruned $>"}return r}};var i9=(t=>(t[t.trace=0]="trace",t[t.debug=1]="debug",t[t.info=2]="info",t[t.warn=3]="warn",t[t.error=4]="error",t[t.silent=5]="silent",t))(i9||{});function ABe(t,e){const n=t,r=n.methodFactory;n.methodFactory=function(i,s,o){const a=r(i,s,o),c=i9[i],l=c>=s&&c<5;return(...d)=>{a.apply(this,d),l&&e(c,o?.toString(),...d)}},n.setLevel(n.getLevel())}const MBe=async t=>{const{gzip:e}=await Mb(async()=>{const{gzip:r}=await import("./pako.esm-DNRuVt5m.js");return{gzip:r}},[],import.meta.url),n=new TextEncoder().encode(t);return new Blob([e(n)])};async function LBe(t,e){e.append("crypto_version",t.getVersion());const n=await t.getOwnDeviceKeys(),r=[`curve25519:${n.curve25519}`,`ed25519:${n.ed25519}`];e.append("device_keys",r.join(", "));const i=await t.getCrossSigningStatus();e.append("cross_signing_ready",String(await t.isCrossSigningReady())),e.append("cross_signing_key",await t.getCrossSigningKeyId()??"n/a"),e.append("cross_signing_privkey_in_secret_storage",String(i.privateKeysInSecretStorage)),e.append("cross_signing_master_privkey_cached",String(i.privateKeysCachedLocally.masterKey)),e.append("cross_signing_self_signing_privkey_cached",String(i.privateKeysCachedLocally.selfSigningKey)),e.append("cross_signing_user_signing_privkey_cached",String(i.privateKeysCachedLocally.userSigningKey))}async function OBe(t,e,n){const r=t.secretStorage;n.append("secret_storage_ready",String(await e.isSecretStorageReady())),n.append("secret_storage_key_in_account",String(await r.hasKey())),n.append("session_backup_key_in_secret_storage",String(!!await t.isKeyBackupKeyStored()));const i=await e.getSessionBackupPrivateKey();n.append("session_backup_key_cached",String(!!i)),n.append("session_backup_key_well_formed",String(i instanceof Uint8Array))}function PBe(){return er().rageshakeSubmitUrl??void 0}function NR(t=PBe){const{client:e}=hm(),[{sending:n,sent:r,error:i},s]=_.useState({sending:!1,sent:!1,error:void 0});return{submitRageshake:_.useCallback(async a=>{const c=t();if(!c)throw new Error("No rageshake URL is configured");if(!n)try{s({sending:!0,sent:!1,error:void 0});let l="UNKNOWN";window.navigator&&window.navigator.userAgent&&(l=window.navigator.userAgent);let d="UNKNOWN";try{d=String(window.matchMedia("(pointer: coarse)").matches)}catch(y){N.warn("Could not get coarse pointer for rageshake submit.",y)}let h=a.rageshakeRequestId?`Rageshake ${a.rageshakeRequestId}`:"";a.description&&(h+=`: ${a.description}`);const m=new FormData;if(m.append("text",h??"User did not supply any additional text."),m.append("app","matrix-video-chat"),m.append("version","embedded-v0.19.0-rc2"),m.append("user_agent",l),m.append("installed_pwa","false"),m.append("touch_input",d),m.append("call_backend","livekit"),m.append("hostname",window.location.hostname),e){const y=e.getUserId(),v=e.getUser(y);m.append("display_name",v?.displayName??""),m.append("user_id",e.credentials.userId??""),m.append("device_id",e.deviceId??""),a.roomId&&m.append("room_id",a.roomId);const E=e.getCrypto();E&&(await LBe(E,m),await OBe(e,E,m))}if(a.label&&m.append("label",a.label),navigator.storage&&navigator.storage.persisted)try{m.append("storageManager_persisted",String(await navigator.storage.persisted()))}catch(y){N.warn("coulr not get navigator peristed storage",y)}else if(document.hasStorageAccess)try{m.append("storageManager_persisted",String(await document.hasStorageAccess()))}catch(y){N.warn("could not get storage access",y)}if(navigator.storage&&navigator.storage.estimate)try{const y=await navigator.storage.estimate();m.append("storageManager_quota",String(y.quota)),m.append("storageManager_usage",String(y.usage)),y.usageDetails&&Object.keys(y.usageDetails).forEach(v=>{m.append(`storageManager_usage_${v}`,String(y.usageDetails[v]))})}catch(y){N.warn("could not obatain storage estimate",y)}if(a.sendLogs){const y=await IBe();for(const v of y)m.append("compressed-log",await MBe(v.lines),v.id)}a.rageshakeRequestId&&m.append("group_call_rageshake_request_id",a.rageshakeRequestId);const g=await fetch(c,{method:"POST",body:m});if(g.status!==200)throw new Error(`Failed to submit feedback: receive HTTP ${g.status} ${g.statusText}`);s({sending:!1,sent:!0,error:void 0})}catch(l){s({sending:!1,sent:!1,error:l}),N.error(l)}},[e,n,t]),sending:n,sent:r,error:i,available:!!t()}}function DBe(){const{client:t}=hm();return _.useCallback((n,r)=>{t.sendEvent(n,"org.matrix.rageshake_request",{request_id:r}).catch(i=>{N.error("Failed to send org.matrix.rageshake_request event",i)})},[t])}function NBe(t){const[e,n]=_.useState(!1),r=_.useCallback(()=>n(!1),[n]),{client:i}=hm(),[s,o]=_.useState();return _.useEffect(()=>{if(!i)return;const a=c=>{c.getType()==="org.matrix.rageshake_request"&&t===c.getRoomId()&&i.getUserId()!==c.getSender()&&(o(c.getContent().request_id),n(!0))};return i.on(De.Event,a),()=>{i.removeListener(De.Event,a)}},[n,t,i]),{rageshakeRequestId:s??"",roomId:t,open:e,onDismiss:r}}const UBe=({description:t})=>{const{submitRageshake:e,sending:n,sent:r,error:i}=NR(),{t:s}=ze(),o=_.useCallback(()=>{e({description:t,sendLogs:!0}).catch(c=>{N.error("Failed to send rageshake",c)})},[e,t]);if(!_n.get().rageshake?.submit_url)return null;let a=null;if(n)a=S.jsx("span",{children:s("rageshake_sending")});else if(r)a=S.jsx("div",{children:s("rageshake_sent")});else{let c=s("rageshake_send_logs");i&&(c=s("rageshake_button_error_caption")),a=S.jsx(Ht,{onClick:o,className:hG.wideButton,disabled:n,children:c})}return S.jsx("div",{className:hG.rageshakeControl,children:a})},jBe="_error_17zfc_1",FBe="_icon_17zfc_9",jw={error:jBe,icon:FBe},$Be="_endCall_bwclo_8",BBe={endCall:$Be},oce=({enabled:t,...e})=>{const{t:n}=ze(),r=t?H8:iae,i=n(t?"mute_microphone_button_label":"unmute_microphone_button_label");return S.jsx(mi,{label:i,children:S.jsx(Ht,{iconOnly:!0,Icon:r,kind:t?"primary":"secondary",role:"switch","aria-checked":t,...e})})},ace=({enabled:t,...e})=>{const{t:n}=ze(),r=t?IR:lNe,i=n(t?"stop_video_button_label":"start_video_button_label");return S.jsx(mi,{label:i,children:S.jsx(Ht,{iconOnly:!0,Icon:r,kind:t?"primary":"secondary",role:"switch","aria-checked":t,...e})})},HBe=({enabled:t,...e})=>{const{t:n}=ze(),r=n(t?"stop_screenshare_button_label":"screenshare_button_label");return S.jsx(mi,{label:r,children:S.jsx(Ht,{iconOnly:!0,Icon:rNe,kind:t?"primary":"secondary",role:"switch","aria-checked":t,...e})})},cce=({className:t,...e})=>{const{t:n}=ze();return S.jsx(mi,{label:n("hangup_button_label"),children:S.jsx(Ht,{className:Le(t,BBe.endCall),iconOnly:!0,Icon:kR,destructive:!0,...e})})},lce=t=>{const{t:e}=ze();return S.jsx(mi,{label:e("common.settings"),children:S.jsx(Ht,{iconOnly:!0,Icon:nNe,kind:"secondary",...t})})},qBe="_external_jhjdf_8",VBe={external:qBe};function uce(t,e){const n=Aee(t),r=Bee(t,{state:e});return[n,r]}const Ll=({ref:t,to:e,state:n,...r})=>{const[i,s]=uce(e,n);return S.jsx(KOe,{ref:t,...r,href:i,onClick:s})},_p=({ref:t,className:e,children:n,...r})=>S.jsx("a",{ref:t,className:Le(e,VBe.external),target:"_blank",rel:"noreferrer noopener",...r,children:n}),s9=({ref:t,to:e,state:n,...r})=>{const[i,s]=uce(e,n);return S.jsx(Ht,{as:"a",ref:t,...r,href:i,onClick:s})};function oC(t,e,n,r){_.useEffect(()=>{if(t)return t.addEventListener(e,n,r),()=>t.removeEventListener(e,n,r)},[t,e,n,r])}function KBe(t,e,n){_.useEffect(()=>(t.on(e,n),()=>{t.off(e,n)}),[t,e,n])}function m_(t,e,n){const r=_.useCallback(i=>(t.on(e,i),()=>{t.off(e,i)}),[t,e]);return _.useSyncExternalStore(r,n)}function dce(t){return m_(t,Zi.MembershipsChanged,_.useCallback(()=>t.memberships,[t]))}function je(t){const e=_.useCallback(r=>{const i=t.subscribe(r);return()=>i.unsubscribe()},[t]),n=_.useCallback(()=>t.value,[t]);return _.useSyncExternalStore(e,n)}const fce=_.createContext(void 0),o9=()=>{const t=_.use(fce);if(!t)throw new Error("useReactions must be used within a ReactionsProvider");return t},GBe=({children:t,rtcSession:e,vm:n})=>{const r=dce(e),i=xy(),s=i?.state==="valid"&&i.supportedFeatures.reactions,o=e.room,a=o.client.getUserId(),c=o.client.getDeviceId(),l=`${a}:${c}`,d=_.useMemo(()=>r.find(w=>w.userId===a&&w.deviceId===c)?.eventId,[r,a,c]),h=je(n.reactions$),m=_.useMemo(()=>l!==void 0?h[l]:void 0,[l,h]),g=je(n.handsRaised$),y=_.useMemo(()=>l!==void 0?g[l]:void 0,[l,g]),v=_.useCallback(async()=>{if(!l)return;const w=y?.reactionEventId;if(w)try{await o.client.redactEvent(e.room.roomId,w),N.debug("Redacted raise hand event")}catch(k){throw N.error("Failed to redact reaction event",w,k),k}else try{if(!d)throw new Error("Cannot find own membership event");const k=await o.client.sendEvent(e.room.roomId,Z.Reaction,{"m.relates_to":{rel_type:bn.Annotation,event_id:d,key:"🖐️"}});N.debug("Sent raise hand event",k.event_id)}catch(k){N.error("Failed to send raised hand",k)}},[d,l,y,e,o]),E=_.useCallback(async w=>{if(!(!l||m)){if(!d)throw new Error("Cannot find own membership event");await o.client.sendEvent(e.room.roomId,r9,{"m.relates_to":{rel_type:bn.Reference,event_id:d},emoji:w.emoji,name:w.name})}},[d,m,o,l,e]);return S.jsx(fce,{value:{supportsReactions:s,toggleRaisedHand:v,sendReaction:E},children:t})},zBe="_raisedButton_unw54_1",WBe="_reactionPopupMenu_unw54_5",YBe="_reactionPopupMenuRoot_unw54_21",JBe="_reactionPopupMenuModal_unw54_21",XBe="_reactionsMenuSection_unw54_47",QBe="_reactionsMenu_unw54_47",ZBe="_reactionButton_unw54_81",eHe="_verticalSeperator_unw54_91",tHe="_alert_unw54_99",yc={raisedButton:zBe,reactionPopupMenu:WBe,reactionPopupMenuRoot:YBe,reactionPopupMenuModal:JBe,reactionsMenuSection:XBe,reactionsMenu:QBe,reactionButton:ZBe,verticalSeperator:eHe,alert:tHe};var nHe=Symbol.for("react.lazy"),A3=uy[" use ".trim().toString()];function rHe(t){return typeof t=="object"&&t!==null&&"then"in t}function hce(t){return t!=null&&typeof t=="object"&&"$$typeof"in t&&t.$$typeof===nHe&&"_payload"in t&&rHe(t._payload)}function iHe(t){const e=sHe(t),n=_.forwardRef((r,i)=>{let{children:s,...o}=r;hce(s)&&typeof A3=="function"&&(s=A3(s._payload));const a=_.Children.toArray(s),c=a.find(aHe);if(c){const l=c.props.children,d=a.map(h=>h===c?_.Children.count(l)>1?_.Children.only(null):_.isValidElement(l)?l.props.children:null:h);return S.jsx(e,{...o,ref:i,children:_.isValidElement(l)?_.cloneElement(l,void 0,d):null})}return S.jsx(e,{...o,ref:i,children:s})});return n.displayName=`${t}.Slot`,n}function sHe(t){const e=_.forwardRef((n,r)=>{let{children:i,...s}=n;if(hce(i)&&typeof A3=="function"&&(i=A3(i._payload)),_.isValidElement(i)){const o=lHe(i),a=cHe(s,i.props);return i.type!==_.Fragment&&(a.ref=r?lR(r,o):o),_.cloneElement(i,a)}return _.Children.count(i)>1?_.Children.only(null):null});return e.displayName=`${t}.SlotClone`,e}var oHe=Symbol("radix.slottable");function aHe(t){return _.isValidElement(t)&&typeof t.type=="function"&&"__radixId"in t.type&&t.type.__radixId===oHe}function cHe(t,e){const n={...e};for(const r in e){const i=t[r],s=e[r];/^on[A-Z]/.test(r)?i&&s?n[r]=(...a)=>{const c=s(...a);return i(...a),c}:i&&(n[r]=i):r==="style"?n[r]={...i,...s}:r==="className"&&(n[r]=[i,s].filter(Boolean).join(" "))}return{...t,...n}}function lHe(t){let e=Object.getOwnPropertyDescriptor(t.props,"ref")?.get,n=e&&"isReactWarning"in e&&e.isReactWarning;return n?t.ref:(e=Object.getOwnPropertyDescriptor(t,"ref")?.get,n=e&&"isReactWarning"in e&&e.isReactWarning,n?t.props.ref:t.props.ref||t.ref)}var uHe=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],dHe=uHe.reduce((t,e)=>{const n=iHe(`Primitive.${e}`),r=_.forwardRef((i,s)=>{const{asChild:o,...a}=i,c=o?n:e;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),S.jsx(c,{...a,ref:s})});return r.displayName=`Primitive.${e}`,{...t,[e]:r}},{}),fHe=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),hHe="VisuallyHidden",LL=_.forwardRef((t,e)=>S.jsx(dHe.span,{...t,ref:e,style:{...fHe,...t.style}}));LL.displayName=hHe;const pHe="_modal_lmgdq_8",mHe="_dialog_lmgdq_14",gHe="_content_lmgdq_21",vHe="_drawer_lmgdq_32",yHe="_close_lmgdq_59",bHe="_header_lmgdq_84",_He="_body_lmgdq_114",SHe="_tabbed_lmgdq_129",wHe="_handle_lmgdq_133",ro={modal:pHe,dialog:mHe,content:gHe,drawer:vHe,close:yHe,header:bHe,body:_He,tabbed:SHe,handle:wHe},EHe="_bg_180k3_8",CHe="_animate_180k3_23",THe="_overlay_180k3_42",Ua={bg:EHe,animate:CHe,overlay:THe},fm=({title:t,hideHeader:e,children:n,className:r,classNameDrawer:i,classNameModal:s,open:o,onDismiss:a,tabbed:c,...l})=>{const{t:d}=ze(),h=DR("(hover: none) or (pointer: coarse)"),m=_.useCallback(g=>{g||a?.()},[a]);if(h)return S.jsx(uo.Root,{open:o,onOpenChange:m,dismissible:a!==void 0,children:S.jsxs(uo.Portal,{children:[S.jsx(uo.Overlay,{className:Le(Ua.bg)}),S.jsx(uo.Content,{className:Le(r,i,Ua.overlay,ro.modal,ro.drawer,{[ro.tabbed]:c}),role:"dialog","aria-describedby":void 0,...l,children:S.jsxs("div",{className:ro.content,children:[S.jsxs("div",{className:ro.header,children:[S.jsx("div",{className:ro.handle}),S.jsx(LL,{asChild:!0,children:S.jsx(uo.Title,{children:t})})]}),S.jsx("div",{className:ro.body,children:n})]})})]})});{const g=S.jsx(m8,{asChild:!0,children:S.jsx(qc,{as:"h2",weight:"semibold",size:"md",children:t})}),y=S.jsxs("div",{className:ro.header,children:[g,a!==void 0&&S.jsx(Hie,{className:ro.close,"data-testid":"modal_close","aria-label":d("action.close"),children:S.jsx(Z_,{width:20,height:20})})]});return S.jsx(d8,{open:o,onOpenChange:m,children:S.jsxs(f8,{children:[S.jsx(h8,{className:Le(Ua.bg,Ua.animate)}),S.jsx(p8,{asChild:!0,"aria-describedby":void 0,role:"dialog",...l,children:S.jsx(ese,{className:Le(r,s,Ua.overlay,Ua.animate,ro.modal,ro.dialog,{[ro.tabbed]:c}),children:S.jsxs("div",{className:ro.content,children:[e?null:y,e?S.jsx(LL,{asChild:!0,children:g}):null,S.jsx("div",{className:ro.body,children:n})]})})})]})})}},RHe=({raised:t,open:e,...n})=>{const{t:r}=ze();return S.jsx(mi,{label:r("common.reactions"),children:S.jsx(Ht,{className:Le(t&&yc.raisedButton),"aria-expanded":e,"aria-haspopup":!0,kind:t||e?"primary":"secondary",iconOnly:!0,Icon:t?fae:tNe,...n})})};function kHe({sendReaction:t,toggleRaisedHand:e,isHandRaised:n,canReact:r,errorText:i}){const{t:s}=ze(),[o,a]=_.useState(!1),c=_.useMemo(()=>o?p_:p_.slice(0,5),[o]),l=s(n?"action.lower_hand":"action.raise_hand");return S.jsxs(S.Fragment,{children:[i&&S.jsx(v5e,{className:yc.alert,type:"critical",title:s("error.generic"),children:i}),S.jsxs("div",{className:yc.reactionPopupMenu,children:[S.jsx("section",{className:yc.handRaiseSection,children:S.jsx(mi,{label:l,caption:"H",children:S.jsx(Ht,{kind:n?"primary":"secondary","aria-keyshortcuts":"H","aria-pressed":n,"aria-label":l,onClick:()=>e(),iconOnly:!0,Icon:fae})})}),S.jsx("div",{className:yc.verticalSeperator}),S.jsx("section",{className:yc.reactionsMenuSection,children:S.jsx("menu",{className:Le(o&&yc.reactionsMenuExpanded,yc.reactionsMenu),children:c.map((d,h)=>S.jsx("li",{children:S.jsx(mi,{label:d.name,caption:h<ML?(h+1).toString():void 0,children:S.jsx(Ht,{kind:"secondary",className:yc.reactionButton,disabled:!r,onClick:()=>t(d),"aria-keyshortcuts":h<ML?(h+1).toString():void 0,children:d.emoji})})},d.name))})}),S.jsx("section",{style:{marginLeft:"var(--cpd-separator-spacing)"},children:S.jsx(mi,{label:s(o?"action.show_less":"action.show_more"),children:S.jsx(Ht,{iconOnly:!0,"aria-label":s(o?"action.show_less":"action.show_more"),Icon:o?VDe:U9e,kind:"tertiary",onClick:()=>a(!o)})})})]})]})}function IHe({identifier:t,vm:e,...n}){const{t:r}=ze(),{toggleRaisedHand:i,sendReaction:s}=o9(),[o,a]=_.useState(!1),[c,l]=_.useState(!1),[d,h]=_.useState(),m=!!je(e.handsRaised$)[t],g=!je(e.reactions$)[t];_.useEffect(()=>{h(void 0)},[c]);const y=_.useCallback(async E=>{try{a(!0),await s(E),h(void 0),l(!1)}catch(w){h(w instanceof Error?w.message:"Unknown error"),N.error("Failed to send reaction",w)}finally{a(!1)}},[s]),v=_.useCallback(()=>{(async()=>{try{a(!0),await i(),l(!1)}catch(w){h(w instanceof Error?w.message:"Unknown error"),N.error("Failed to raise/lower hand",w)}finally{a(!1)}})()},[i]);return S.jsxs(S.Fragment,{children:[S.jsx(RHe,{disabled:o,onClick:()=>l(E=>!E),raised:!!m,open:c,...n}),S.jsx(fm,{open:c,title:r("action.pick_reaction"),hideHeader:!0,classNameModal:yc.reactionPopupMenuModal,className:yc.reactionPopupMenuRoot,onDismiss:()=>l(!1),children:S.jsx(kHe,{errorText:d,isHandRaised:!!m,canReact:!o&&!!g,sendReaction:E=>{y(E)},toggleRaisedHand:v})})]})}const g_=({Icon:t,title:e,rageshake:n,fatal:r,children:i,widget:s})=>{const{t:o}=ze(),{confineToRoom:a}=oc(),c=_.useCallback(()=>{window.location.href="/"},[]),l=({widget:h})=>{const m=()=>{h.api.transport.send(Tl.Close,{}).catch(g=>{N.error("Failed to send close action",g)}).finally(()=>{h.api.transport.stop()})};return S.jsx(Ht,{kind:"primary",onClick:m,children:o("action.close")})},d=()=>r||location.pathname==="/"?S.jsx(Ht,{kind:"tertiary",className:jw.homeLink,onClick:c,children:o("return_home_button")}):S.jsx(s9,{kind:"tertiary",className:jw.homeLink,to:"/",children:o("return_home_button")});return S.jsxs("div",{className:jw.error,children:[S.jsx(Aoe,{className:jw.icon,children:S.jsx(t,{"aria-hidden":!0})}),S.jsx(qc,{as:"h1",weight:"semibold",size:"md",children:e}),i,n&&S.jsx(UBe,{description:`***Error View***: ${e}`}),s?S.jsx(l,{widget:s}):!a&&S.jsx(d,{})]})};class pce extends Error{constructor(e,n){super(e),this.richMessage=n}}const xHe=()=>{const{t}=ze();return S.jsx(g_,{widget:vt,Icon:uae,title:t("error.open_elsewhere"),children:S.jsx("p",{children:t("error.open_elsewhere_description",{brand:"Element Call"})})})};class AHe extends pce{constructor(){super("App opened in another tab",S.jsx(xHe,{}))}}const lv=({className:t,children:e})=>{const{header:n}=oc();return S.jsxs("div",{className:Le(J6.page,t),children:[n==="standard"&&S.jsxs(hd,{children:[S.jsx(fh,{children:S.jsx(Bp,{})}),S.jsx(hh,{})]}),S.jsx("div",{className:J6.container,children:S.jsx("div",{className:J6.content,children:e})})]})},v_=({error:t,widget:e})=>{const{t:n}=ze();return _.useEffect(()=>{N.error(t),eR(t)},[t]),S.jsx(lv,{children:t instanceof pce?t.richMessage:S.jsx(g_,{widget:e,Icon:Q_,title:n("error.generic"),rageshake:!0,fatal:!0,children:S.jsx("p",{children:n("error.generic_description")})})})},UR=()=>{const{t}=ze();return S.jsx(lv,{children:S.jsx("h1",{children:t("common.loading")})})};function mG(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable}))),n.push.apply(n,r)}return n}function Be(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?mG(Object(n),!0).forEach((function(r){be(t,r,n[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):mG(Object(n)).forEach((function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))}))}return t}function y_(t){return y_=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},y_(t)}function ln(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function gG(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function un(t,e,n){return e&&gG(t.prototype,e),n&&gG(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function be(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function MHe(t,e){if(t==null)return{};var n,r,i=(function(o,a){if(o==null)return{};var c,l,d={},h=Object.keys(o);for(l=0;l<h.length;l++)c=h[l],a.indexOf(c)>=0||(d[c]=o[c]);return d})(t,e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);for(r=0;r<s.length;r++)n=s[r],e.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(t,n)&&(i[n]=t[n])}return i}function Us(t,e){return(function(n){if(Array.isArray(n))return n})(t)||(function(n,r){var i=n==null?null:typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(i!=null){var s,o,a=[],c=!0,l=!1;try{for(i=i.call(n);!(c=(s=i.next()).done)&&(a.push(s.value),!r||a.length!==r);c=!0);}catch(d){l=!0,o=d}finally{try{c||i.return==null||i.return()}finally{if(l)throw o}}return a}})(t,e)||a9(t,e)||(function(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
147
+ `;i=i.replace(/token=[a-zA-Z0-9-]+/gm,"token=xxxxx"),this.logs+=i,this.emit("log")}}popLogs(){const e=this.logs;return this.logs="",e}peekLogs(){return this.logs}}class CBe{constructor(e,n){this.indexedDB=e,this.loggerInstance=n,this.index=0,this.onLoggerLog=()=>{this.db&&this.throttledFlush()},this.throttledFlush=A$e(()=>this.flush,SBe,{leading:!1,trailing:!0}),this.flush=async()=>this.flushPromise?this.flushAgainPromise?this.flushAgainPromise:(this.flushAgainPromise=this.flushPromise.then(this.flush).then(()=>{this.flushAgainPromise=void 0}),this.flushAgainPromise):(this.flushPromise=new Promise((r,i)=>{if(!this.db){i(new Error("No connected database"));return}const s=this.loggerInstance.popLogs();if(s.length===0){r();return}const o=this.db.transaction(["logs","logslastmod"],"readwrite"),a=o.objectStore("logs");o.oncomplete=()=>{r()},o.onerror=l=>{N.error("Failed to flush logs : ",l),i(new Error("Failed to write logs: "+o?.error?.message))},a.add(this.generateLogEntry(s)),o.objectStore("logslastmod").put(this.generateLastModifiedTime())}).then(()=>{this.flushPromise=void 0}),this.flushPromise),this.id="instance-"+Qo(16),n.on("log",this.onLoggerLog),window.addEventListener("beforeunload",()=>{this.flush().catch(r=>N.error("Failed to flush logs before unload",r))})}async connect(){const e=this.indexedDB.open("logs");return new Promise((n,r)=>{e.onsuccess=()=>{this.db=e.result,n()},e.onerror=()=>{const i="Failed to open log database: "+e?.error?.name;N.error(i),r(new Error(i))},e.onupgradeneeded=()=>{const i=e.result,s=i.createObjectStore("logs",{keyPath:["id","index"]});s.createIndex("id","id",{unique:!1}),s.add(this.generateLogEntry(new Date+" ::: Log database was created.")),i.createObjectStore("logslastmod",{keyPath:"id"}).add(this.generateLastModifiedTime())}})}async consume(){const e=this.db;if(!e)return Promise.reject(new Error("No connected database"));async function n(l,d){const h=e.transaction("logs","readonly").objectStore("logs");return new Promise((m,g)=>{const y=h.index("id").openCursor(IDBKeyRange.only(l),"prev");let v="";y.onerror=()=>{g(new Error("Query failed: "+y?.error?.message))},y.onsuccess=()=>{const E=y.result;if(!E){m(v);return}v=E.value.lines+v,v.length>=d?m(v):E.continue()}})}async function r(){const l=e.transaction("logslastmod","readonly").objectStore("logslastmod");return TBe(l,void 0,d=>({id:d.value.id,ts:d.value.ts})).then(d=>d.sort((h,m)=>m.ts-h.ts).map(h=>h.id))}async function i(l){return new Promise((d,h)=>{const m=e.transaction(["logs","logslastmod"],"readwrite"),g=m.objectStore("logs"),y=g.index("id").openKeyCursor(IDBKeyRange.only(l));y.onsuccess=()=>{const E=y.result;E&&(g.delete(E.primaryKey),E.continue())},m.oncomplete=()=>{d()},m.onerror=()=>{h(new Error(`Failed to delete logs for '${l}' : ${m?.error?.message}`))},m.objectStore("logslastmod").delete(l)})}const s=await r();let o=[];const a=[];let c=0;for(let l=0;l<s.length;l++){const d=await n(s[l],pG-c);if(a.push({lines:d,id:s[l]}),c+=d.length,c>=pG){o=s.slice(l+1).map(h=>parseInt(h,10));break}}return o.length>0&&(N.log("Removing logs: ",o),Promise.all(o.map(async l=>i(l))).then(()=>{N.log(`Removed ${o.length} old logs.`)},l=>{N.error(l)})),a}generateLogEntry(e){return{id:this.id,lines:e,index:this.index++}}generateLastModifiedTime(){return{id:this.id,ts:Date.now()}}}async function TBe(t,e,n){const r=t.openCursor(e);return new Promise((i,s)=>{const o=[];r.onerror=()=>{s(new Error("Query failed: "+r?.error?.message))},r.onsuccess=()=>{const a=r.result;if(!a){i(o);return}o.push(n(a)),a.continue()}})}async function RBe(){return global.mx_rage_logger=new EBe,ABe(N,global.mx_rage_logger.log),["trace","debug","info","warn","error"].forEach(t=>{const e=window.console[t];if(!e)return;const n=`${t.toUpperCase()} matrix_sdk`;window.console[t]=(...r)=>{e(...r),typeof r[0]=="string"&&r[0].startsWith(n)&&global.mx_rage_logger.log(i9[t],"matrix_sdk",...r)}}),kBe()}async function kBe(){if(global.mx_rage_initStoragePromise)return global.mx_rage_initStoragePromise;N.log("Configuring rageshake persistence...");let t;try{t=window.indexedDB}catch(e){N.warn("Could not get indexDB from window.",e)}return t?(global.mx_rage_store=new CBe(t,global.mx_rage_logger),global.mx_rage_initStoragePromise=global.mx_rage_store.connect(),global.mx_rage_initStoragePromise):(global.mx_rage_initStoragePromise=Promise.resolve(),global.mx_rage_initStoragePromise)}async function IBe(){if(!global.mx_rage_logger)throw new Error("No console logger, did you forget to call init()?");return global.mx_rage_store?(await global.mx_rage_store.flush(),global.mx_rage_store.consume()):[{lines:global.mx_rage_logger.peekLogs(),id:"-"}]}const xBe=()=>{const t=new WeakSet,e=new WeakMap;return function(n,r){if(typeof r=="object"&&r!==null){if(t.has(r))return"<$ cycle-trimmed $>";t.add(r);let i=0;if(this&&(i=e.get(this)??0),e.set(r,i+1),i>wBe)return"<$ object-pruned $>"}return r}};var i9=(t=>(t[t.trace=0]="trace",t[t.debug=1]="debug",t[t.info=2]="info",t[t.warn=3]="warn",t[t.error=4]="error",t[t.silent=5]="silent",t))(i9||{});function ABe(t,e){const n=t,r=n.methodFactory;n.methodFactory=function(i,s,o){const a=r(i,s,o),c=i9[i],l=c>=s&&c<5;return(...d)=>{a.apply(this,d),l&&e(c,o?.toString(),...d)}},n.setLevel(n.getLevel())}const MBe=async t=>{const{gzip:e}=await Mb(async()=>{const{gzip:r}=await import("./pako.esm-DNRuVt5m.js");return{gzip:r}},[],import.meta.url),n=new TextEncoder().encode(t);return new Blob([e(n)])};async function LBe(t,e){e.append("crypto_version",t.getVersion());const n=await t.getOwnDeviceKeys(),r=[`curve25519:${n.curve25519}`,`ed25519:${n.ed25519}`];e.append("device_keys",r.join(", "));const i=await t.getCrossSigningStatus();e.append("cross_signing_ready",String(await t.isCrossSigningReady())),e.append("cross_signing_key",await t.getCrossSigningKeyId()??"n/a"),e.append("cross_signing_privkey_in_secret_storage",String(i.privateKeysInSecretStorage)),e.append("cross_signing_master_privkey_cached",String(i.privateKeysCachedLocally.masterKey)),e.append("cross_signing_self_signing_privkey_cached",String(i.privateKeysCachedLocally.selfSigningKey)),e.append("cross_signing_user_signing_privkey_cached",String(i.privateKeysCachedLocally.userSigningKey))}async function OBe(t,e,n){const r=t.secretStorage;n.append("secret_storage_ready",String(await e.isSecretStorageReady())),n.append("secret_storage_key_in_account",String(await r.hasKey())),n.append("session_backup_key_in_secret_storage",String(!!await t.isKeyBackupKeyStored()));const i=await e.getSessionBackupPrivateKey();n.append("session_backup_key_cached",String(!!i)),n.append("session_backup_key_well_formed",String(i instanceof Uint8Array))}function PBe(){return er().rageshakeSubmitUrl??void 0}function NR(t=PBe){const{client:e}=hm(),[{sending:n,sent:r,error:i},s]=_.useState({sending:!1,sent:!1,error:void 0});return{submitRageshake:_.useCallback(async a=>{const c=t();if(!c)throw new Error("No rageshake URL is configured");if(!n)try{s({sending:!0,sent:!1,error:void 0});let l="UNKNOWN";window.navigator&&window.navigator.userAgent&&(l=window.navigator.userAgent);let d="UNKNOWN";try{d=String(window.matchMedia("(pointer: coarse)").matches)}catch(y){N.warn("Could not get coarse pointer for rageshake submit.",y)}let h=a.rageshakeRequestId?`Rageshake ${a.rageshakeRequestId}`:"";a.description&&(h+=`: ${a.description}`);const m=new FormData;if(m.append("text",h??"User did not supply any additional text."),m.append("app","matrix-video-chat"),m.append("version","embedded-v0.19.0"),m.append("user_agent",l),m.append("installed_pwa","false"),m.append("touch_input",d),m.append("call_backend","livekit"),m.append("hostname",window.location.hostname),e){const y=e.getUserId(),v=e.getUser(y);m.append("display_name",v?.displayName??""),m.append("user_id",e.credentials.userId??""),m.append("device_id",e.deviceId??""),a.roomId&&m.append("room_id",a.roomId);const E=e.getCrypto();E&&(await LBe(E,m),await OBe(e,E,m))}if(a.label&&m.append("label",a.label),navigator.storage&&navigator.storage.persisted)try{m.append("storageManager_persisted",String(await navigator.storage.persisted()))}catch(y){N.warn("coulr not get navigator peristed storage",y)}else if(document.hasStorageAccess)try{m.append("storageManager_persisted",String(await document.hasStorageAccess()))}catch(y){N.warn("could not get storage access",y)}if(navigator.storage&&navigator.storage.estimate)try{const y=await navigator.storage.estimate();m.append("storageManager_quota",String(y.quota)),m.append("storageManager_usage",String(y.usage)),y.usageDetails&&Object.keys(y.usageDetails).forEach(v=>{m.append(`storageManager_usage_${v}`,String(y.usageDetails[v]))})}catch(y){N.warn("could not obatain storage estimate",y)}if(a.sendLogs){const y=await IBe();for(const v of y)m.append("compressed-log",await MBe(v.lines),v.id)}a.rageshakeRequestId&&m.append("group_call_rageshake_request_id",a.rageshakeRequestId);const g=await fetch(c,{method:"POST",body:m});if(g.status!==200)throw new Error(`Failed to submit feedback: receive HTTP ${g.status} ${g.statusText}`);s({sending:!1,sent:!0,error:void 0})}catch(l){s({sending:!1,sent:!1,error:l}),N.error(l)}},[e,n,t]),sending:n,sent:r,error:i,available:!!t()}}function DBe(){const{client:t}=hm();return _.useCallback((n,r)=>{t.sendEvent(n,"org.matrix.rageshake_request",{request_id:r}).catch(i=>{N.error("Failed to send org.matrix.rageshake_request event",i)})},[t])}function NBe(t){const[e,n]=_.useState(!1),r=_.useCallback(()=>n(!1),[n]),{client:i}=hm(),[s,o]=_.useState();return _.useEffect(()=>{if(!i)return;const a=c=>{c.getType()==="org.matrix.rageshake_request"&&t===c.getRoomId()&&i.getUserId()!==c.getSender()&&(o(c.getContent().request_id),n(!0))};return i.on(De.Event,a),()=>{i.removeListener(De.Event,a)}},[n,t,i]),{rageshakeRequestId:s??"",roomId:t,open:e,onDismiss:r}}const UBe=({description:t})=>{const{submitRageshake:e,sending:n,sent:r,error:i}=NR(),{t:s}=ze(),o=_.useCallback(()=>{e({description:t,sendLogs:!0}).catch(c=>{N.error("Failed to send rageshake",c)})},[e,t]);if(!_n.get().rageshake?.submit_url)return null;let a=null;if(n)a=S.jsx("span",{children:s("rageshake_sending")});else if(r)a=S.jsx("div",{children:s("rageshake_sent")});else{let c=s("rageshake_send_logs");i&&(c=s("rageshake_button_error_caption")),a=S.jsx(Ht,{onClick:o,className:hG.wideButton,disabled:n,children:c})}return S.jsx("div",{className:hG.rageshakeControl,children:a})},jBe="_error_17zfc_1",FBe="_icon_17zfc_9",jw={error:jBe,icon:FBe},$Be="_endCall_bwclo_8",BBe={endCall:$Be},oce=({enabled:t,...e})=>{const{t:n}=ze(),r=t?H8:iae,i=n(t?"mute_microphone_button_label":"unmute_microphone_button_label");return S.jsx(mi,{label:i,children:S.jsx(Ht,{iconOnly:!0,Icon:r,kind:t?"primary":"secondary",role:"switch","aria-checked":t,...e})})},ace=({enabled:t,...e})=>{const{t:n}=ze(),r=t?IR:lNe,i=n(t?"stop_video_button_label":"start_video_button_label");return S.jsx(mi,{label:i,children:S.jsx(Ht,{iconOnly:!0,Icon:r,kind:t?"primary":"secondary",role:"switch","aria-checked":t,...e})})},HBe=({enabled:t,...e})=>{const{t:n}=ze(),r=n(t?"stop_screenshare_button_label":"screenshare_button_label");return S.jsx(mi,{label:r,children:S.jsx(Ht,{iconOnly:!0,Icon:rNe,kind:t?"primary":"secondary",role:"switch","aria-checked":t,...e})})},cce=({className:t,...e})=>{const{t:n}=ze();return S.jsx(mi,{label:n("hangup_button_label"),children:S.jsx(Ht,{className:Le(t,BBe.endCall),iconOnly:!0,Icon:kR,destructive:!0,...e})})},lce=t=>{const{t:e}=ze();return S.jsx(mi,{label:e("common.settings"),children:S.jsx(Ht,{iconOnly:!0,Icon:nNe,kind:"secondary",...t})})},qBe="_external_jhjdf_8",VBe={external:qBe};function uce(t,e){const n=Aee(t),r=Bee(t,{state:e});return[n,r]}const Ll=({ref:t,to:e,state:n,...r})=>{const[i,s]=uce(e,n);return S.jsx(KOe,{ref:t,...r,href:i,onClick:s})},_p=({ref:t,className:e,children:n,...r})=>S.jsx("a",{ref:t,className:Le(e,VBe.external),target:"_blank",rel:"noreferrer noopener",...r,children:n}),s9=({ref:t,to:e,state:n,...r})=>{const[i,s]=uce(e,n);return S.jsx(Ht,{as:"a",ref:t,...r,href:i,onClick:s})};function oC(t,e,n,r){_.useEffect(()=>{if(t)return t.addEventListener(e,n,r),()=>t.removeEventListener(e,n,r)},[t,e,n,r])}function KBe(t,e,n){_.useEffect(()=>(t.on(e,n),()=>{t.off(e,n)}),[t,e,n])}function m_(t,e,n){const r=_.useCallback(i=>(t.on(e,i),()=>{t.off(e,i)}),[t,e]);return _.useSyncExternalStore(r,n)}function dce(t){return m_(t,Zi.MembershipsChanged,_.useCallback(()=>t.memberships,[t]))}function je(t){const e=_.useCallback(r=>{const i=t.subscribe(r);return()=>i.unsubscribe()},[t]),n=_.useCallback(()=>t.value,[t]);return _.useSyncExternalStore(e,n)}const fce=_.createContext(void 0),o9=()=>{const t=_.use(fce);if(!t)throw new Error("useReactions must be used within a ReactionsProvider");return t},GBe=({children:t,rtcSession:e,vm:n})=>{const r=dce(e),i=xy(),s=i?.state==="valid"&&i.supportedFeatures.reactions,o=e.room,a=o.client.getUserId(),c=o.client.getDeviceId(),l=`${a}:${c}`,d=_.useMemo(()=>r.find(w=>w.userId===a&&w.deviceId===c)?.eventId,[r,a,c]),h=je(n.reactions$),m=_.useMemo(()=>l!==void 0?h[l]:void 0,[l,h]),g=je(n.handsRaised$),y=_.useMemo(()=>l!==void 0?g[l]:void 0,[l,g]),v=_.useCallback(async()=>{if(!l)return;const w=y?.reactionEventId;if(w)try{await o.client.redactEvent(e.room.roomId,w),N.debug("Redacted raise hand event")}catch(k){throw N.error("Failed to redact reaction event",w,k),k}else try{if(!d)throw new Error("Cannot find own membership event");const k=await o.client.sendEvent(e.room.roomId,Z.Reaction,{"m.relates_to":{rel_type:bn.Annotation,event_id:d,key:"🖐️"}});N.debug("Sent raise hand event",k.event_id)}catch(k){N.error("Failed to send raised hand",k)}},[d,l,y,e,o]),E=_.useCallback(async w=>{if(!(!l||m)){if(!d)throw new Error("Cannot find own membership event");await o.client.sendEvent(e.room.roomId,r9,{"m.relates_to":{rel_type:bn.Reference,event_id:d},emoji:w.emoji,name:w.name})}},[d,m,o,l,e]);return S.jsx(fce,{value:{supportsReactions:s,toggleRaisedHand:v,sendReaction:E},children:t})},zBe="_raisedButton_unw54_1",WBe="_reactionPopupMenu_unw54_5",YBe="_reactionPopupMenuRoot_unw54_21",JBe="_reactionPopupMenuModal_unw54_21",XBe="_reactionsMenuSection_unw54_47",QBe="_reactionsMenu_unw54_47",ZBe="_reactionButton_unw54_81",eHe="_verticalSeperator_unw54_91",tHe="_alert_unw54_99",yc={raisedButton:zBe,reactionPopupMenu:WBe,reactionPopupMenuRoot:YBe,reactionPopupMenuModal:JBe,reactionsMenuSection:XBe,reactionsMenu:QBe,reactionButton:ZBe,verticalSeperator:eHe,alert:tHe};var nHe=Symbol.for("react.lazy"),A3=uy[" use ".trim().toString()];function rHe(t){return typeof t=="object"&&t!==null&&"then"in t}function hce(t){return t!=null&&typeof t=="object"&&"$$typeof"in t&&t.$$typeof===nHe&&"_payload"in t&&rHe(t._payload)}function iHe(t){const e=sHe(t),n=_.forwardRef((r,i)=>{let{children:s,...o}=r;hce(s)&&typeof A3=="function"&&(s=A3(s._payload));const a=_.Children.toArray(s),c=a.find(aHe);if(c){const l=c.props.children,d=a.map(h=>h===c?_.Children.count(l)>1?_.Children.only(null):_.isValidElement(l)?l.props.children:null:h);return S.jsx(e,{...o,ref:i,children:_.isValidElement(l)?_.cloneElement(l,void 0,d):null})}return S.jsx(e,{...o,ref:i,children:s})});return n.displayName=`${t}.Slot`,n}function sHe(t){const e=_.forwardRef((n,r)=>{let{children:i,...s}=n;if(hce(i)&&typeof A3=="function"&&(i=A3(i._payload)),_.isValidElement(i)){const o=lHe(i),a=cHe(s,i.props);return i.type!==_.Fragment&&(a.ref=r?lR(r,o):o),_.cloneElement(i,a)}return _.Children.count(i)>1?_.Children.only(null):null});return e.displayName=`${t}.SlotClone`,e}var oHe=Symbol("radix.slottable");function aHe(t){return _.isValidElement(t)&&typeof t.type=="function"&&"__radixId"in t.type&&t.type.__radixId===oHe}function cHe(t,e){const n={...e};for(const r in e){const i=t[r],s=e[r];/^on[A-Z]/.test(r)?i&&s?n[r]=(...a)=>{const c=s(...a);return i(...a),c}:i&&(n[r]=i):r==="style"?n[r]={...i,...s}:r==="className"&&(n[r]=[i,s].filter(Boolean).join(" "))}return{...t,...n}}function lHe(t){let e=Object.getOwnPropertyDescriptor(t.props,"ref")?.get,n=e&&"isReactWarning"in e&&e.isReactWarning;return n?t.ref:(e=Object.getOwnPropertyDescriptor(t,"ref")?.get,n=e&&"isReactWarning"in e&&e.isReactWarning,n?t.props.ref:t.props.ref||t.ref)}var uHe=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],dHe=uHe.reduce((t,e)=>{const n=iHe(`Primitive.${e}`),r=_.forwardRef((i,s)=>{const{asChild:o,...a}=i,c=o?n:e;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),S.jsx(c,{...a,ref:s})});return r.displayName=`Primitive.${e}`,{...t,[e]:r}},{}),fHe=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),hHe="VisuallyHidden",LL=_.forwardRef((t,e)=>S.jsx(dHe.span,{...t,ref:e,style:{...fHe,...t.style}}));LL.displayName=hHe;const pHe="_modal_lmgdq_8",mHe="_dialog_lmgdq_14",gHe="_content_lmgdq_21",vHe="_drawer_lmgdq_32",yHe="_close_lmgdq_59",bHe="_header_lmgdq_84",_He="_body_lmgdq_114",SHe="_tabbed_lmgdq_129",wHe="_handle_lmgdq_133",ro={modal:pHe,dialog:mHe,content:gHe,drawer:vHe,close:yHe,header:bHe,body:_He,tabbed:SHe,handle:wHe},EHe="_bg_180k3_8",CHe="_animate_180k3_23",THe="_overlay_180k3_42",Ua={bg:EHe,animate:CHe,overlay:THe},fm=({title:t,hideHeader:e,children:n,className:r,classNameDrawer:i,classNameModal:s,open:o,onDismiss:a,tabbed:c,...l})=>{const{t:d}=ze(),h=DR("(hover: none) or (pointer: coarse)"),m=_.useCallback(g=>{g||a?.()},[a]);if(h)return S.jsx(uo.Root,{open:o,onOpenChange:m,dismissible:a!==void 0,children:S.jsxs(uo.Portal,{children:[S.jsx(uo.Overlay,{className:Le(Ua.bg)}),S.jsx(uo.Content,{className:Le(r,i,Ua.overlay,ro.modal,ro.drawer,{[ro.tabbed]:c}),role:"dialog","aria-describedby":void 0,...l,children:S.jsxs("div",{className:ro.content,children:[S.jsxs("div",{className:ro.header,children:[S.jsx("div",{className:ro.handle}),S.jsx(LL,{asChild:!0,children:S.jsx(uo.Title,{children:t})})]}),S.jsx("div",{className:ro.body,children:n})]})})]})});{const g=S.jsx(m8,{asChild:!0,children:S.jsx(qc,{as:"h2",weight:"semibold",size:"md",children:t})}),y=S.jsxs("div",{className:ro.header,children:[g,a!==void 0&&S.jsx(Hie,{className:ro.close,"data-testid":"modal_close","aria-label":d("action.close"),children:S.jsx(Z_,{width:20,height:20})})]});return S.jsx(d8,{open:o,onOpenChange:m,children:S.jsxs(f8,{children:[S.jsx(h8,{className:Le(Ua.bg,Ua.animate)}),S.jsx(p8,{asChild:!0,"aria-describedby":void 0,role:"dialog",...l,children:S.jsx(ese,{className:Le(r,s,Ua.overlay,Ua.animate,ro.modal,ro.dialog,{[ro.tabbed]:c}),children:S.jsxs("div",{className:ro.content,children:[e?null:y,e?S.jsx(LL,{asChild:!0,children:g}):null,S.jsx("div",{className:ro.body,children:n})]})})})]})})}},RHe=({raised:t,open:e,...n})=>{const{t:r}=ze();return S.jsx(mi,{label:r("common.reactions"),children:S.jsx(Ht,{className:Le(t&&yc.raisedButton),"aria-expanded":e,"aria-haspopup":!0,kind:t||e?"primary":"secondary",iconOnly:!0,Icon:t?fae:tNe,...n})})};function kHe({sendReaction:t,toggleRaisedHand:e,isHandRaised:n,canReact:r,errorText:i}){const{t:s}=ze(),[o,a]=_.useState(!1),c=_.useMemo(()=>o?p_:p_.slice(0,5),[o]),l=s(n?"action.lower_hand":"action.raise_hand");return S.jsxs(S.Fragment,{children:[i&&S.jsx(v5e,{className:yc.alert,type:"critical",title:s("error.generic"),children:i}),S.jsxs("div",{className:yc.reactionPopupMenu,children:[S.jsx("section",{className:yc.handRaiseSection,children:S.jsx(mi,{label:l,caption:"H",children:S.jsx(Ht,{kind:n?"primary":"secondary","aria-keyshortcuts":"H","aria-pressed":n,"aria-label":l,onClick:()=>e(),iconOnly:!0,Icon:fae})})}),S.jsx("div",{className:yc.verticalSeperator}),S.jsx("section",{className:yc.reactionsMenuSection,children:S.jsx("menu",{className:Le(o&&yc.reactionsMenuExpanded,yc.reactionsMenu),children:c.map((d,h)=>S.jsx("li",{children:S.jsx(mi,{label:d.name,caption:h<ML?(h+1).toString():void 0,children:S.jsx(Ht,{kind:"secondary",className:yc.reactionButton,disabled:!r,onClick:()=>t(d),"aria-keyshortcuts":h<ML?(h+1).toString():void 0,children:d.emoji})})},d.name))})}),S.jsx("section",{style:{marginLeft:"var(--cpd-separator-spacing)"},children:S.jsx(mi,{label:s(o?"action.show_less":"action.show_more"),children:S.jsx(Ht,{iconOnly:!0,"aria-label":s(o?"action.show_less":"action.show_more"),Icon:o?VDe:U9e,kind:"tertiary",onClick:()=>a(!o)})})})]})]})}function IHe({identifier:t,vm:e,...n}){const{t:r}=ze(),{toggleRaisedHand:i,sendReaction:s}=o9(),[o,a]=_.useState(!1),[c,l]=_.useState(!1),[d,h]=_.useState(),m=!!je(e.handsRaised$)[t],g=!je(e.reactions$)[t];_.useEffect(()=>{h(void 0)},[c]);const y=_.useCallback(async E=>{try{a(!0),await s(E),h(void 0),l(!1)}catch(w){h(w instanceof Error?w.message:"Unknown error"),N.error("Failed to send reaction",w)}finally{a(!1)}},[s]),v=_.useCallback(()=>{(async()=>{try{a(!0),await i(),l(!1)}catch(w){h(w instanceof Error?w.message:"Unknown error"),N.error("Failed to raise/lower hand",w)}finally{a(!1)}})()},[i]);return S.jsxs(S.Fragment,{children:[S.jsx(RHe,{disabled:o,onClick:()=>l(E=>!E),raised:!!m,open:c,...n}),S.jsx(fm,{open:c,title:r("action.pick_reaction"),hideHeader:!0,classNameModal:yc.reactionPopupMenuModal,className:yc.reactionPopupMenuRoot,onDismiss:()=>l(!1),children:S.jsx(kHe,{errorText:d,isHandRaised:!!m,canReact:!o&&!!g,sendReaction:E=>{y(E)},toggleRaisedHand:v})})]})}const g_=({Icon:t,title:e,rageshake:n,fatal:r,children:i,widget:s})=>{const{t:o}=ze(),{confineToRoom:a}=oc(),c=_.useCallback(()=>{window.location.href="/"},[]),l=({widget:h})=>{const m=()=>{h.api.transport.send(Tl.Close,{}).catch(g=>{N.error("Failed to send close action",g)}).finally(()=>{h.api.transport.stop()})};return S.jsx(Ht,{kind:"primary",onClick:m,children:o("action.close")})},d=()=>r||location.pathname==="/"?S.jsx(Ht,{kind:"tertiary",className:jw.homeLink,onClick:c,children:o("return_home_button")}):S.jsx(s9,{kind:"tertiary",className:jw.homeLink,to:"/",children:o("return_home_button")});return S.jsxs("div",{className:jw.error,children:[S.jsx(Aoe,{className:jw.icon,children:S.jsx(t,{"aria-hidden":!0})}),S.jsx(qc,{as:"h1",weight:"semibold",size:"md",children:e}),i,n&&S.jsx(UBe,{description:`***Error View***: ${e}`}),s?S.jsx(l,{widget:s}):!a&&S.jsx(d,{})]})};class pce extends Error{constructor(e,n){super(e),this.richMessage=n}}const xHe=()=>{const{t}=ze();return S.jsx(g_,{widget:vt,Icon:uae,title:t("error.open_elsewhere"),children:S.jsx("p",{children:t("error.open_elsewhere_description",{brand:"Element Call"})})})};class AHe extends pce{constructor(){super("App opened in another tab",S.jsx(xHe,{}))}}const lv=({className:t,children:e})=>{const{header:n}=oc();return S.jsxs("div",{className:Le(J6.page,t),children:[n==="standard"&&S.jsxs(hd,{children:[S.jsx(fh,{children:S.jsx(Bp,{})}),S.jsx(hh,{})]}),S.jsx("div",{className:J6.container,children:S.jsx("div",{className:J6.content,children:e})})]})},v_=({error:t,widget:e})=>{const{t:n}=ze();return _.useEffect(()=>{N.error(t),eR(t)},[t]),S.jsx(lv,{children:t instanceof pce?t.richMessage:S.jsx(g_,{widget:e,Icon:Q_,title:n("error.generic"),rageshake:!0,fatal:!0,children:S.jsx("p",{children:n("error.generic_description")})})})},UR=()=>{const{t}=ze();return S.jsx(lv,{children:S.jsx("h1",{children:t("common.loading")})})};function mG(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable}))),n.push.apply(n,r)}return n}function Be(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?mG(Object(n),!0).forEach((function(r){be(t,r,n[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):mG(Object(n)).forEach((function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))}))}return t}function y_(t){return y_=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},y_(t)}function ln(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function gG(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function un(t,e,n){return e&&gG(t.prototype,e),n&&gG(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function be(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function MHe(t,e){if(t==null)return{};var n,r,i=(function(o,a){if(o==null)return{};var c,l,d={},h=Object.keys(o);for(l=0;l<h.length;l++)c=h[l],a.indexOf(c)>=0||(d[c]=o[c]);return d})(t,e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);for(r=0;r<s.length;r++)n=s[r],e.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(t,n)&&(i[n]=t[n])}return i}function Us(t,e){return(function(n){if(Array.isArray(n))return n})(t)||(function(n,r){var i=n==null?null:typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(i!=null){var s,o,a=[],c=!0,l=!1;try{for(i=i.call(n);!(c=(s=i.next()).done)&&(a.push(s.value),!r||a.length!==r);c=!0);}catch(d){l=!0,o=d}finally{try{c||i.return==null||i.return()}finally{if(l)throw o}}return a}})(t,e)||a9(t,e)||(function(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
148
148
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)})()}function Gu(t){return(function(e){if(Array.isArray(e))return OL(e)})(t)||(function(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)})(t)||a9(t)||(function(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
149
149
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)})()}function a9(t,e){if(t){if(typeof t=="string")return OL(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set"?Array.from(t):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?OL(t,e):void 0}}function OL(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function rc(t,e){var n=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=a9(t))||e){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(c){throw c},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
150
150
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var s,o=!0,a=!1;return{s:function(){n=n.call(t)},n:function(){var c=n.next();return o=c.done,c},e:function(c){a=!0,s=c},f:function(){try{o||n.return==null||n.return()}finally{if(a)throw s}}}}var ja={DEBUG:!1,LIB_VERSION:"1.160.3"},LHe=Array.isArray,mce=Object.prototype,gce=mce.hasOwnProperty,jR=mce.toString,pi=LHe||function(t){return jR.call(t)==="[object Array]"},Ga=function(t){return typeof t=="function"},ts=function(t){return t===Object(t)&&!pi(t)},aC=function(t){if(ts(t)){for(var e in t)if(gce.call(t,e))return!1;return!0}return!1},nt=function(t){return t===void 0},Ss=function(t){return jR.call(t)=="[object String]"},vG=function(t){return Ss(t)&&t.trim().length===0},pd=function(t){return t===null},_o=function(t){return nt(t)||pd(t)},Fa=function(t){return jR.call(t)=="[object Number]"},ap=function(t){return jR.call(t)==="[object Boolean]"},OHe=function(t){return t instanceof FormData},le=typeof window<"u"?window:void 0,po=typeof globalThis<"u"?globalThis:le,vce=Array.prototype,yG=vce.forEach,bG=vce.indexOf,Mc=po?.navigator,Ke=po?.document,so=po?.location,PL=po?.fetch,DL=po!=null&&po.XMLHttpRequest&&"withCredentials"in new po.XMLHttpRequest?po.XMLHttpRequest:void 0,_G=po?.AbortController,ki=Mc?.userAgent,or=le??{},SG="[PostHog.js]",Re={_log:function(t){if(le&&(ja.DEBUG||or.POSTHOG_DEBUG)&&!nt(le.console)&&le.console){for(var e=("__rrweb_original__"in le.console[t])?le.console[t].__rrweb_original__:le.console[t],n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];e.apply(void 0,[SG].concat(r))}},info:function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];Re._log.apply(Re,["log"].concat(e))},warn:function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];Re._log.apply(Re,["warn"].concat(e))},error:function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];Re._log.apply(Re,["error"].concat(e))},critical:function(){for(var t,e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];(t=console).error.apply(t,[SG].concat(n))},uninitializedWarning:function(t){Re.error("You must initialize PostHog before calling ".concat(t))}},M3={},FR=function(t){return t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")};function uv(t,e,n){if(pi(t)){if(yG&&t.forEach===yG)t.forEach(e,n);else if("length"in t&&t.length===+t.length){for(var r=0,i=t.length;r<i;r++)if(r in t&&e.call(n,t[r],r)===M3)return}}}function Dn(t,e,n){if(!_o(t)){if(pi(t))return uv(t,e,n);if(OHe(t)){var r,i=rc(t.entries());try{for(i.s();!(r=i.n()).done;){var s=r.value;if(e.call(n,s[1],s[0])===M3)return}}catch(a){i.e(a)}finally{i.f()}}else for(var o in t)if(gce.call(t,o)&&e.call(n,t[o],o)===M3)return}}var js=function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];return uv(n,(function(i){for(var s in i)i[s]!==void 0&&(t[s]=i[s])})),t};function zt(t,e){return t.indexOf(e)!==-1}function cC(t){for(var e=Object.keys(t),n=e.length,r=new Array(n);n--;)r[n]=[e[n],t[e[n]]];return r}var yce=function(){return Date.now=Date.now||function(){return+new Date},Date.now()},wG=function(t){try{return t()}catch{return}},PHe=function(t){return function(){try{for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return t.apply(this,n)}catch(i){Re.critical("Implementation error. Please turn on debug mode and open a ticket on https://app.posthog.com/home#panel=support%3Asupport%3A."),Re.critical(i)}}},NL=function(t){var e={};return Dn(t,(function(n,r){Ss(n)&&n.length>0&&(e[r]=n)})),e},UL=function(t){return t.replace(/^\$/,"")};function DHe(t,e){return n=t,r=function(s){return Ss(s)&&!pd(e)?s.slice(0,e):s},i=new Set,(function s(o,a){return o!==Object(o)?r?r(o,a):o:i.has(o)?void 0:(i.add(o),pi(o)?(c=[],uv(o,(function(l){c.push(s(l))}))):(c={},Dn(o,(function(l,d){i.has(l)||(c[d]=s(l,d))}))),c);var c})(n);var n,r,i}var xc,NHe=function(t){var e,n,r,i,s="";for(e=n=0,r=(t=(t+"").replace(/\r\n/g,`
@@ -154,7 +154,7 @@ total: ${r}ms
154
154
  peerConnection: ${i}ms
155
155
  websocket: ${s}ms`)}}function An(t){return typeof t=="function"}function g9(t){var e=function(r){Error.call(r),r.stack=new Error().stack},n=t(e);return n.prototype=Object.create(Error.prototype),n.prototype.constructor=n,n}var o5=g9(function(t){return function(n){t(this),this.message=n?n.length+` errors occurred during unsubscription:
156
156
  `+n.map(function(r,i){return i+1+") "+r.toString()}).join(`
157
- `):"",this.name="UnsubscriptionError",this.errors=n}});function q3(t,e){if(t){var n=t.indexOf(e);0<=n&&t.splice(n,1)}}var gS=(function(){function t(e){this.initialTeardown=e,this.closed=!1,this._parentage=null,this._finalizers=null}return t.prototype.unsubscribe=function(){var e,n,r,i,s;if(!this.closed){this.closed=!0;var o=this._parentage;if(o)if(this._parentage=null,Array.isArray(o))try{for(var a=Yf(o),c=a.next();!c.done;c=a.next()){var l=c.value;l.remove(this)}}catch(v){e={error:v}}finally{try{c&&!c.done&&(n=a.return)&&n.call(a)}finally{if(e)throw e.error}}else o.remove(this);var d=this.initialTeardown;if(An(d))try{d()}catch(v){s=v instanceof o5?v.errors:[v]}var h=this._finalizers;if(h){this._finalizers=null;try{for(var m=Yf(h),g=m.next();!g.done;g=m.next()){var y=g.value;try{uz(y)}catch(v){s=s??[],v instanceof o5?s=oa(oa([],sa(s)),sa(v.errors)):s.push(v)}}}catch(v){r={error:v}}finally{try{g&&!g.done&&(i=m.return)&&i.call(m)}finally{if(r)throw r.error}}}if(s)throw new o5(s)}},t.prototype.add=function(e){var n;if(e&&e!==this)if(this.closed)uz(e);else{if(e instanceof t){if(e.closed||e._hasParent(this))return;e._addParent(this)}(this._finalizers=(n=this._finalizers)!==null&&n!==void 0?n:[]).push(e)}},t.prototype._hasParent=function(e){var n=this._parentage;return n===e||Array.isArray(n)&&n.includes(e)},t.prototype._addParent=function(e){var n=this._parentage;this._parentage=Array.isArray(n)?(n.push(e),n):n?[n,e]:e},t.prototype._removeParent=function(e){var n=this._parentage;n===e?this._parentage=null:Array.isArray(n)&&q3(n,e)},t.prototype.remove=function(e){var n=this._finalizers;n&&q3(n,e),e instanceof t&&e._removeParent(this)},t.EMPTY=(function(){var e=new t;return e.closed=!0,e})(),t})(),nle=gS.EMPTY;function rle(t){return t instanceof gS||t&&"closed"in t&&An(t.remove)&&An(t.add)&&An(t.unsubscribe)}function uz(t){An(t)?t():t.unsubscribe()}var yVe={Promise:void 0},bVe={setTimeout:function(t,e){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];return setTimeout.apply(void 0,oa([t,e],sa(n)))},clearTimeout:function(t){return clearTimeout(t)},delegate:void 0};function ile(t){bVe.setTimeout(function(){throw t})}function Bv(){}function uC(t){t()}var v9=(function(t){Bc(e,t);function e(n){var r=t.call(this)||this;return r.isStopped=!1,n?(r.destination=n,rle(n)&&n.add(r)):r.destination=wVe,r}return e.create=function(n,r,i){return new Hv(n,r,i)},e.prototype.next=function(n){this.isStopped||this._next(n)},e.prototype.error=function(n){this.isStopped||(this.isStopped=!0,this._error(n))},e.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},e.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,t.prototype.unsubscribe.call(this),this.destination=null)},e.prototype._next=function(n){this.destination.next(n)},e.prototype._error=function(n){try{this.destination.error(n)}finally{this.unsubscribe()}},e.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},e})(gS),_Ve=(function(){function t(e){this.partialObserver=e}return t.prototype.next=function(e){var n=this.partialObserver;if(n.next)try{n.next(e)}catch(r){Ww(r)}},t.prototype.error=function(e){var n=this.partialObserver;if(n.error)try{n.error(e)}catch(r){Ww(r)}else Ww(e)},t.prototype.complete=function(){var e=this.partialObserver;if(e.complete)try{e.complete()}catch(n){Ww(n)}},t})(),Hv=(function(t){Bc(e,t);function e(n,r,i){var s=t.call(this)||this,o;return An(n)||!n?o={next:n??void 0,error:r??void 0,complete:i??void 0}:o=n,s.destination=new _Ve(o),s}return e})(v9);function Ww(t){ile(t)}function SVe(t){throw t}var wVe={closed:!0,next:Bv,error:SVe,complete:Bv},y9=(function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"})();function md(t){return t}function EVe(t){return t.length===0?md:t.length===1?t[0]:function(n){return t.reduce(function(r,i){return i(r)},n)}}var tr=(function(){function t(e){e&&(this._subscribe=e)}return t.prototype.lift=function(e){var n=new t;return n.source=this,n.operator=e,n},t.prototype.subscribe=function(e,n,r){var i=this,s=TVe(e)?e:new Hv(e,n,r);return uC(function(){var o=i,a=o.operator,c=o.source;s.add(a?a.call(s,c):c?i._subscribe(s):i._trySubscribe(s))}),s},t.prototype._trySubscribe=function(e){try{return this._subscribe(e)}catch(n){e.error(n)}},t.prototype.forEach=function(e,n){var r=this;return n=dz(n),new n(function(i,s){var o=new Hv({next:function(a){try{e(a)}catch(c){s(c),o.unsubscribe()}},error:s,complete:i});r.subscribe(o)})},t.prototype._subscribe=function(e){var n;return(n=this.source)===null||n===void 0?void 0:n.subscribe(e)},t.prototype[y9]=function(){return this},t.prototype.pipe=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return EVe(e)(this)},t.prototype.toPromise=function(e){var n=this;return e=dz(e),new e(function(r,i){var s;n.subscribe(function(o){return s=o},function(o){return i(o)},function(){return r(s)})})},t.create=function(e){return new t(e)},t})();function dz(t){var e;return(e=t??yVe.Promise)!==null&&e!==void 0?e:Promise}function CVe(t){return t&&An(t.next)&&An(t.error)&&An(t.complete)}function TVe(t){return t&&t instanceof v9||CVe(t)&&rle(t)}function RVe(t){return An(t?.lift)}function nr(t){return function(e){if(RVe(e))return e.lift(function(n){try{return t(n,this)}catch(r){this.error(r)}});throw new TypeError("Unable to lift unknown Observable type")}}function Nn(t,e,n,r,i){return new kVe(t,e,n,r,i)}var kVe=(function(t){Bc(e,t);function e(n,r,i,s,o,a){var c=t.call(this,n)||this;return c.onFinalize=o,c.shouldUnsubscribe=a,c._next=r?function(l){try{r(l)}catch(d){n.error(d)}}:t.prototype._next,c._error=s?function(l){try{s(l)}catch(d){n.error(d)}finally{this.unsubscribe()}}:t.prototype._error,c._complete=i?function(){try{i()}catch(l){n.error(l)}finally{this.unsubscribe()}}:t.prototype._complete,c}return e.prototype.unsubscribe=function(){var n;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){var r=this.closed;t.prototype.unsubscribe.call(this),!r&&((n=this.onFinalize)===null||n===void 0||n.call(this))}},e})(v9),IVe=g9(function(t){return function(){t(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}}),sr=(function(t){Bc(e,t);function e(){var n=t.call(this)||this;return n.closed=!1,n.currentObservers=null,n.observers=[],n.isStopped=!1,n.hasError=!1,n.thrownError=null,n}return e.prototype.lift=function(n){var r=new fz(this,this);return r.operator=n,r},e.prototype._throwIfClosed=function(){if(this.closed)throw new IVe},e.prototype.next=function(n){var r=this;uC(function(){var i,s;if(r._throwIfClosed(),!r.isStopped){r.currentObservers||(r.currentObservers=Array.from(r.observers));try{for(var o=Yf(r.currentObservers),a=o.next();!a.done;a=o.next()){var c=a.value;c.next(n)}}catch(l){i={error:l}}finally{try{a&&!a.done&&(s=o.return)&&s.call(o)}finally{if(i)throw i.error}}}})},e.prototype.error=function(n){var r=this;uC(function(){if(r._throwIfClosed(),!r.isStopped){r.hasError=r.isStopped=!0,r.thrownError=n;for(var i=r.observers;i.length;)i.shift().error(n)}})},e.prototype.complete=function(){var n=this;uC(function(){if(n._throwIfClosed(),!n.isStopped){n.isStopped=!0;for(var r=n.observers;r.length;)r.shift().complete()}})},e.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null},Object.defineProperty(e.prototype,"observed",{get:function(){var n;return((n=this.observers)===null||n===void 0?void 0:n.length)>0},enumerable:!1,configurable:!0}),e.prototype._trySubscribe=function(n){return this._throwIfClosed(),t.prototype._trySubscribe.call(this,n)},e.prototype._subscribe=function(n){return this._throwIfClosed(),this._checkFinalizedStatuses(n),this._innerSubscribe(n)},e.prototype._innerSubscribe=function(n){var r=this,i=this,s=i.hasError,o=i.isStopped,a=i.observers;return s||o?nle:(this.currentObservers=null,a.push(n),new gS(function(){r.currentObservers=null,q3(a,n)}))},e.prototype._checkFinalizedStatuses=function(n){var r=this,i=r.hasError,s=r.thrownError,o=r.isStopped;i?n.error(s):o&&n.complete()},e.prototype.asObservable=function(){var n=new tr;return n.source=this,n},e.create=function(n,r){return new fz(n,r)},e})(tr),fz=(function(t){Bc(e,t);function e(n,r){var i=t.call(this)||this;return i.destination=n,i.source=r,i}return e.prototype.next=function(n){var r,i;(i=(r=this.destination)===null||r===void 0?void 0:r.next)===null||i===void 0||i.call(r,n)},e.prototype.error=function(n){var r,i;(i=(r=this.destination)===null||r===void 0?void 0:r.error)===null||i===void 0||i.call(r,n)},e.prototype.complete=function(){var n,r;(r=(n=this.destination)===null||n===void 0?void 0:n.complete)===null||r===void 0||r.call(n)},e.prototype._subscribe=function(n){var r,i;return(i=(r=this.source)===null||r===void 0?void 0:r.subscribe(n))!==null&&i!==void 0?i:nle},e})(sr),cr=(function(t){Bc(e,t);function e(n){var r=t.call(this)||this;return r._value=n,r}return Object.defineProperty(e.prototype,"value",{get:function(){return this.getValue()},enumerable:!1,configurable:!0}),e.prototype._subscribe=function(n){var r=t.prototype._subscribe.call(this,n);return!r.closed&&n.next(this._value),r},e.prototype.getValue=function(){var n=this,r=n.hasError,i=n.thrownError,s=n._value;if(r)throw i;return this._throwIfClosed(),s},e.prototype.next=function(n){t.prototype.next.call(this,this._value=n)},e})(sr),xVe={now:function(){return Date.now()}},AVe=(function(t){Bc(e,t);function e(n,r){return t.call(this)||this}return e.prototype.schedule=function(n,r){return this},e})(gS),hz={setInterval:function(t,e){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];return setInterval.apply(void 0,oa([t,e],sa(n)))},clearInterval:function(t){return clearInterval(t)},delegate:void 0},MVe=(function(t){Bc(e,t);function e(n,r){var i=t.call(this,n,r)||this;return i.scheduler=n,i.work=r,i.pending=!1,i}return e.prototype.schedule=function(n,r){var i;if(r===void 0&&(r=0),this.closed)return this;this.state=n;var s=this.id,o=this.scheduler;return s!=null&&(this.id=this.recycleAsyncId(o,s,r)),this.pending=!0,this.delay=r,this.id=(i=this.id)!==null&&i!==void 0?i:this.requestAsyncId(o,this.id,r),this},e.prototype.requestAsyncId=function(n,r,i){return i===void 0&&(i=0),hz.setInterval(n.flush.bind(n,this),i)},e.prototype.recycleAsyncId=function(n,r,i){if(i===void 0&&(i=0),i!=null&&this.delay===i&&this.pending===!1)return r;r!=null&&hz.clearInterval(r)},e.prototype.execute=function(n,r){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;var i=this._execute(n,r);if(i)return i;this.pending===!1&&this.id!=null&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))},e.prototype._execute=function(n,r){var i=!1,s;try{this.work(n)}catch(o){i=!0,s=o||new Error("Scheduled action threw falsy error")}if(i)return this.unsubscribe(),s},e.prototype.unsubscribe=function(){if(!this.closed){var n=this,r=n.id,i=n.scheduler,s=i.actions;this.work=this.state=this.scheduler=null,this.pending=!1,q3(s,this),r!=null&&(this.id=this.recycleAsyncId(i,r,null)),this.delay=null,t.prototype.unsubscribe.call(this)}},e})(AVe),pz=(function(){function t(e,n){n===void 0&&(n=t.now),this.schedulerActionCtor=e,this.now=n}return t.prototype.schedule=function(e,n,r){return n===void 0&&(n=0),new this.schedulerActionCtor(this,e).schedule(r,n)},t.now=xVe.now,t})(),LVe=(function(t){Bc(e,t);function e(n,r){r===void 0&&(r=pz.now);var i=t.call(this,n,r)||this;return i.actions=[],i._active=!1,i}return e.prototype.flush=function(n){var r=this.actions;if(this._active){r.push(n);return}var i;this._active=!0;do if(i=n.execute(n.state,n.delay))break;while(n=r.shift());if(this._active=!1,i){for(;n=r.shift();)n.unsubscribe();throw i}},e})(pz),$R=new LVe(MVe),OVe=$R,b9=new tr(function(t){return t.complete()});function sle(t){return t&&An(t.schedule)}function _9(t){return t[t.length-1]}function ole(t){return An(_9(t))?t.pop():void 0}function vS(t){return sle(_9(t))?t.pop():void 0}function PVe(t,e){return typeof _9(t)=="number"?t.pop():e}var S9=(function(t){return t&&typeof t.length=="number"&&typeof t!="function"});function ale(t){return An(t?.then)}function cle(t){return An(t[y9])}function lle(t){return Symbol.asyncIterator&&An(t?.[Symbol.asyncIterator])}function ule(t){return new TypeError("You provided "+(t!==null&&typeof t=="object"?"an invalid object":"'"+t+"'")+" where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.")}function DVe(){return typeof Symbol!="function"||!Symbol.iterator?"@@iterator":Symbol.iterator}var dle=DVe();function fle(t){return An(t?.[dle])}function hle(t){return Y7(this,arguments,function(){var n,r,i,s;return dR(this,function(o){switch(o.label){case 0:n=t.getReader(),o.label=1;case 1:o.trys.push([1,,9,10]),o.label=2;case 2:return[4,Ku(n.read())];case 3:return r=o.sent(),i=r.value,s=r.done,s?[4,Ku(void 0)]:[3,5];case 4:return[2,o.sent()];case 5:return[4,Ku(i)];case 6:return[4,o.sent()];case 7:return o.sent(),[3,2];case 8:return[3,10];case 9:return n.releaseLock(),[7];case 10:return[2]}})})}function ple(t){return An(t?.getReader)}function _i(t){if(t instanceof tr)return t;if(t!=null){if(cle(t))return NVe(t);if(S9(t))return UVe(t);if(ale(t))return jVe(t);if(lle(t))return mle(t);if(fle(t))return FVe(t);if(ple(t))return $Ve(t)}throw ule(t)}function NVe(t){return new tr(function(e){var n=t[y9]();if(An(n.subscribe))return n.subscribe(e);throw new TypeError("Provided object does not correctly implement Symbol.observable")})}function UVe(t){return new tr(function(e){for(var n=0;n<t.length&&!e.closed;n++)e.next(t[n]);e.complete()})}function jVe(t){return new tr(function(e){t.then(function(n){e.closed||(e.next(n),e.complete())},function(n){return e.error(n)}).then(null,ile)})}function FVe(t){return new tr(function(e){var n,r;try{for(var i=Yf(t),s=i.next();!s.done;s=i.next()){var o=s.value;if(e.next(o),e.closed)return}}catch(a){n={error:a}}finally{try{s&&!s.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}e.complete()})}function mle(t){return new tr(function(e){BVe(t,e).catch(function(n){return e.error(n)})})}function $Ve(t){return mle(hle(t))}function BVe(t,e){var n,r,i,s;return W7(this,void 0,void 0,function(){var o,a;return dR(this,function(c){switch(c.label){case 0:c.trys.push([0,5,6,11]),n=J7(t),c.label=1;case 1:return[4,n.next()];case 2:if(r=c.sent(),!!r.done)return[3,4];if(o=r.value,e.next(o),e.closed)return[2];c.label=3;case 3:return[3,1];case 4:return[3,11];case 5:return a=c.sent(),i={error:a},[3,11];case 6:return c.trys.push([6,,9,10]),r&&!r.done&&(s=n.return)?[4,s.call(n)]:[3,8];case 7:c.sent(),c.label=8;case 8:return[3,10];case 9:if(i)throw i.error;return[7];case 10:return[7];case 11:return e.complete(),[2]}})})}function Df(t,e,n,r,i){r===void 0&&(r=0),i===void 0&&(i=!1);var s=e.schedule(function(){n(),i?t.add(this.schedule(null,r)):this.unsubscribe()},r);if(t.add(s),!i)return s}function gle(t,e){return e===void 0&&(e=0),nr(function(n,r){n.subscribe(Nn(r,function(i){return Df(r,t,function(){return r.next(i)},e)},function(){return Df(r,t,function(){return r.complete()},e)},function(i){return Df(r,t,function(){return r.error(i)},e)}))})}function vle(t,e){return e===void 0&&(e=0),nr(function(n,r){r.add(t.schedule(function(){return n.subscribe(r)},e))})}function HVe(t,e){return _i(t).pipe(vle(e),gle(e))}function qVe(t,e){return _i(t).pipe(vle(e),gle(e))}function VVe(t,e){return new tr(function(n){var r=0;return e.schedule(function(){r===t.length?n.complete():(n.next(t[r++]),n.closed||this.schedule())})})}function KVe(t,e){return new tr(function(n){var r;return Df(n,e,function(){r=t[dle](),Df(n,e,function(){var i,s,o;try{i=r.next(),s=i.value,o=i.done}catch(a){n.error(a);return}o?n.complete():n.next(s)},0,!0)}),function(){return An(r?.return)&&r.return()}})}function yle(t,e){if(!t)throw new Error("Iterable cannot be null");return new tr(function(n){Df(n,e,function(){var r=t[Symbol.asyncIterator]();Df(n,e,function(){r.next().then(function(i){i.done?n.complete():n.next(i.value)})},0,!0)})})}function GVe(t,e){return yle(hle(t),e)}function zVe(t,e){if(t!=null){if(cle(t))return HVe(t,e);if(S9(t))return VVe(t,e);if(ale(t))return qVe(t,e);if(lle(t))return yle(t,e);if(fle(t))return KVe(t,e);if(ple(t))return GVe(t,e)}throw ule(t)}function Zf(t,e){return e?zVe(t,e):_i(t)}function pt(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=vS(t);return Zf(t,n)}var w9=g9(function(t){return function(){t(this),this.name="EmptyError",this.message="no elements in sequence"}});function WVe(t,e){return new Promise(function(n,r){var i=new Hv({next:function(s){n(s),i.unsubscribe()},error:r,complete:function(){r(new w9)}});t.subscribe(i)})}function YVe(t){return t instanceof Date&&!isNaN(t)}function ge(t,e){return nr(function(n,r){var i=0;n.subscribe(Nn(r,function(s){r.next(t.call(e,s,i++))}))})}var JVe=Array.isArray;function XVe(t,e){return JVe(e)?t.apply(void 0,oa([],sa(e))):t(e)}function ble(t){return ge(function(e){return XVe(t,e)})}var QVe=Array.isArray,ZVe=Object.getPrototypeOf,eKe=Object.prototype,tKe=Object.keys;function nKe(t){if(t.length===1){var e=t[0];if(QVe(e))return{args:e,keys:null};if(rKe(e)){var n=tKe(e);return{args:n.map(function(r){return e[r]}),keys:n}}}return{args:t,keys:null}}function rKe(t){return t&&typeof t=="object"&&ZVe(t)===eKe}function iKe(t,e){return t.reduce(function(n,r,i){return n[r]=e[i],n},{})}function mt(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=vS(t),r=ole(t),i=nKe(t),s=i.args,o=i.keys;if(s.length===0)return Zf([],n);var a=new tr(sKe(s,n,o?function(c){return iKe(o,c)}:md));return r?a.pipe(ble(r)):a}function sKe(t,e,n){return n===void 0&&(n=md),function(r){mz(e,function(){for(var i=t.length,s=new Array(i),o=i,a=i,c=function(d){mz(e,function(){var h=Zf(t[d],e),m=!1;h.subscribe(Nn(r,function(g){s[d]=g,m||(m=!0,a--),a||r.next(n(s.slice()))},function(){--o||r.complete()}))},r)},l=0;l<i;l++)c(l)},r)}}function mz(t,e,n){t?Df(n,t,e):e()}function oKe(t,e,n,r,i,s,o,a){var c=[],l=0,d=0,h=!1,m=function(){h&&!c.length&&!l&&e.complete()},g=function(v){return l<r?y(v):c.push(v)},y=function(v){l++;var E=!1;_i(n(v,d++)).subscribe(Nn(e,function(w){e.next(w)},function(){E=!0},void 0,function(){if(E)try{l--;for(var w=function(){var k=c.shift();o||y(k)};c.length&&l<r;)w();m()}catch(k){e.error(k)}}))};return t.subscribe(Nn(e,g,function(){h=!0,m()})),function(){}}function BR(t,e,n){return n===void 0&&(n=1/0),An(e)?BR(function(r,i){return ge(function(s,o){return e(r,s,i,o)})(_i(t(r,i)))},n):(typeof e=="number"&&(n=e),nr(function(r,i){return oKe(r,i,t,n)}))}function _le(t){return t===void 0&&(t=1/0),BR(md,t)}function aKe(){return _le(1)}function qv(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return aKe()(Zf(t,vS(t)))}function cKe(t){return new tr(function(e){_i(t()).subscribe(e)})}var lKe=["addListener","removeListener"],uKe=["addEventListener","removeEventListener"],dKe=["on","off"];function Es(t,e,n,r){if(An(n)&&(r=n,n=void 0),r)return Es(t,e,n).pipe(ble(r));var i=sa(pKe(t)?uKe.map(function(a){return function(c){return t[a](e,c,n)}}):fKe(t)?lKe.map(gz(t,e)):hKe(t)?dKe.map(gz(t,e)):[],2),s=i[0],o=i[1];if(!s&&S9(t))return BR(function(a){return Es(a,e,n)})(_i(t));if(!s)throw new TypeError("Invalid event target");return new tr(function(a){var c=function(){for(var l=[],d=0;d<arguments.length;d++)l[d]=arguments[d];return a.next(1<l.length?l:l[0])};return s(c),function(){return o(c)}})}function gz(t,e){return function(n){return function(r){return t[n](e,r)}}}function fKe(t){return An(t.addListener)&&An(t.removeListener)}function hKe(t){return An(t.on)&&An(t.off)}function pKe(t){return An(t.addEventListener)&&An(t.removeEventListener)}function Nf(t,e,n){t===void 0&&(t=0),n===void 0&&(n=OVe);var r=-1;return e!=null&&(sle(e)?n=e:r=e),new tr(function(i){var s=YVe(t)?+t-n.now():t;s<0&&(s=0);var o=0;return n.schedule(function(){i.closed||(i.next(o++),0<=r?this.schedule(void 0,r):i.complete())},s)})}function mKe(t,e){return e===void 0&&(e=$R),Nf(t,t,e)}function Nc(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=vS(t),r=PVe(t,1/0),i=t;return i.length?i.length===1?_i(i[0]):_le(r)(Zf(i,n)):b9}var vb=new tr(Bv),gKe=Array.isArray;function vKe(t){return t.length===1&&gKe(t[0])?t[0]:t}function Fr(t,e){return nr(function(n,r){var i=0;n.subscribe(Nn(r,function(s){return t.call(e,s,i++)&&r.next(s)}))})}function yKe(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return t=vKe(t),t.length===1?_i(t[0]):new tr(bKe(t))}function bKe(t){return function(e){for(var n=[],r=function(s){n.push(_i(t[s]).subscribe(Nn(e,function(o){if(n){for(var a=0;a<n.length;a++)a!==s&&n[a].unsubscribe();n=null}e.next(o)})))},i=0;n&&!e.closed&&i<t.length;i++)r(i)}}function Sle(t){return nr(function(e,n){var r=!1,i=null,s=null,o=!1,a=function(){if(s?.unsubscribe(),s=null,r){r=!1;var l=i;i=null,n.next(l)}o&&n.complete()},c=function(){s=null,o&&n.complete()};e.subscribe(Nn(n,function(l){r=!0,i=l,s||_i(t(l)).subscribe(s=Nn(n,a,c))},function(){o=!0,(!r||!s||s.closed)&&n.complete()}))})}function HR(t){return nr(function(e,n){var r=null,i=!1,s;r=e.subscribe(Nn(n,void 0,void 0,function(o){s=_i(t(o,HR(t)(e))),r?(r.unsubscribe(),r=null,s.subscribe(n)):i=!0})),i&&(r.unsubscribe(),r=null,s.subscribe(n))})}function _Ke(t,e,n,r,i){return function(s,o){var a=n,c=e,l=0;s.subscribe(Nn(o,function(d){var h=l++;c=a?t(c,d,h):(a=!0,d),o.next(c)},i))}}function SKe(t){return nr(function(e,n){var r=!1;e.subscribe(Nn(n,function(i){r=!0,n.next(i)},function(){r||n.next(t),n.complete()}))})}function qR(t){return t<=0?function(){return b9}:nr(function(e,n){var r=0;e.subscribe(Nn(n,function(i){++r<=t&&(n.next(i),t<=r&&n.complete())}))})}function wKe(){return nr(function(t,e){t.subscribe(Nn(e,Bv))})}function EKe(t){return ge(function(){return t})}function CKe(t,e){return BR(function(n,r){return _i(t(n,r)).pipe(qR(1),EKe(n))})}function TKe(t,e){e===void 0&&(e=$R);var n=Nf(t,e);return CKe(function(){return n})}function Ni(t,e){return e===void 0&&(e=md),t=t??RKe,nr(function(n,r){var i,s=!0;n.subscribe(Nn(r,function(o){var a=e(o);(s||!t(i,a))&&(s=!1,i=a,r.next(o))}))})}function RKe(t,e){return t===e}function kKe(t){return t===void 0&&(t=IKe),nr(function(e,n){var r=!1;e.subscribe(Nn(n,function(i){r=!0,n.next(i)},function(){return r?n.complete():n.error(t())}))})}function IKe(){return new w9}function wle(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return function(n){return qv(n,pt.apply(void 0,oa([],sa(t))))}}function xKe(t){return nr(function(e,n){try{e.subscribe(n)}finally{n.add(t)}})}function AKe(t,e){var n=arguments.length>=2;return function(r){return r.pipe(t?Fr(function(i,s){return t(i,s,r)}):md,qR(1),n?SKe(e):kKe(function(){return new w9}))}}function Vv(){return nr(function(t,e){var n,r=!1;t.subscribe(Nn(e,function(i){var s=n;n=i,r&&e.next([s,i]),r=!0}))})}function pl(t,e){return nr(_Ke(t,e,arguments.length>=2,!0))}function MKe(t){t===void 0&&(t={});var e=t.connector,n=e===void 0?function(){return new sr}:e,r=t.resetOnError,i=r===void 0?!0:r,s=t.resetOnComplete,o=s===void 0?!0:s,a=t.resetOnRefCountZero,c=a===void 0?!0:a;return function(l){var d,h,m,g=0,y=!1,v=!1,E=function(){h?.unsubscribe(),h=void 0},w=function(){E(),d=m=void 0,y=v=!1},k=function(){var x=d;w(),x?.unsubscribe()};return nr(function(x,C){g++,!v&&!y&&E();var R=m=m??n();C.add(function(){g--,g===0&&!v&&!y&&(h=a5(k,c))}),R.subscribe(C),!d&&g>0&&(d=new Hv({next:function(T){return R.next(T)},error:function(T){v=!0,E(),h=a5(w,i,T),R.error(T)},complete:function(){y=!0,E(),h=a5(w,o),R.complete()}}),_i(x).subscribe(d))})(l)}}function a5(t,e){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];if(e===!0){t();return}if(e!==!1){var i=new Hv({next:function(){i.unsubscribe(),t()}});return _i(e.apply(void 0,oa([],sa(n)))).subscribe(i)}}function Ele(t){return nr(function(e,n){var r=!1,i=0;e.subscribe(Nn(n,function(s){return(r||(r=!t(s,i++)))&&n.next(s)}))})}function pn(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=vS(t);return nr(function(r,i){(n?qv(t,r,n):qv(t,r)).subscribe(i)})}function rt(t,e){return nr(function(n,r){var i=null,s=0,o=!1,a=function(){return o&&!i&&r.complete()};n.subscribe(Nn(r,function(c){i?.unsubscribe();var l=0,d=s++;_i(t(c,d)).subscribe(i=Nn(r,function(h){return r.next(e?e(c,h,d,l++):h)},function(){i=null,a()}))},function(){o=!0,a()}))})}function LKe(){return rt(md)}function OKe(t,e){return nr(function(n,r){var i=e;return rt(function(s,o){return t(i,s,o)},function(s,o){return i=o,o})(n).subscribe(r),function(){i=null}})}function Cle(t){return nr(function(e,n){_i(t).subscribe(Nn(n,function(){return n.complete()},Bv)),!n.closed&&e.subscribe(n)})}function PKe(t,e){return e===void 0&&(e=!1),nr(function(n,r){var i=0;n.subscribe(Nn(r,function(s){var o=t(s,i++);(o||e)&&r.next(s),!o&&r.complete()}))})}function ec(t,e,n){var r=An(t)||e||n?{next:t,error:e,complete:n}:t;return r?nr(function(i,s){var o;(o=r.subscribe)===null||o===void 0||o.call(r);var a=!0;i.subscribe(Nn(s,function(c){var l;(l=r.next)===null||l===void 0||l.call(r,c),s.next(c)},function(){var c;a=!1,(c=r.complete)===null||c===void 0||c.call(r),s.complete()},function(c){var l;a=!1,(l=r.error)===null||l===void 0||l.call(r,c),s.error(c)},function(){var c,l;a&&((c=r.unsubscribe)===null||c===void 0||c.call(r)),(l=r.finalize)===null||l===void 0||l.call(r)}))}):md}function DKe(t,e){return nr(function(n,r){var i=e??{},s=i.leading,o=s===void 0?!0:s,a=i.trailing,c=a===void 0?!1:a,l=!1,d=null,h=null,m=!1,g=function(){h?.unsubscribe(),h=null,c&&(E(),m&&r.complete())},y=function(){h=null,m&&r.complete()},v=function(w){return h=_i(t(w)).subscribe(Nn(r,g,y))},E=function(){if(l){l=!1;var w=d;d=null,r.next(w),!m&&v(w)}};n.subscribe(Nn(r,function(w){l=!0,d=w,!(h&&!h.closed)&&(o?E():v(w))},function(){m=!0,!(c&&l&&h&&!h.closed)&&r.complete()}))})}function sO(t,e,n){e===void 0&&(e=$R);var r=Nf(t,e);return DKe(function(){return r},n)}function Tle(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=ole(t);return nr(function(r,i){for(var s=t.length,o=new Array(s),a=t.map(function(){return!1}),c=!1,l=function(h){_i(t[h]).subscribe(Nn(i,function(m){o[h]=m,!c&&!a[h]&&(a[h]=!0,(c=a.every(md))&&(a=null))},Bv))},d=0;d<s;d++)l(d);r.subscribe(Nn(i,function(h){if(c){var m=oa([h],sa(o));i.next(n?n.apply(void 0,oa([],sa(m))):m)}}))})}class Hi{constructor(e,n){this.defaultValue=n,this.setValue=(s,o)=>{this._value$.next(s),this._lastUpdateReason$.next(o??null),localStorage.setItem(this.key,JSON.stringify(s))},this.getValue=()=>this._value$.getValue(),this.key=`matrix-setting-${e}`;const r=localStorage.getItem(this.key);let i=n;if(r!==null)try{i=JSON.parse(r)}catch(s){N.warn(`Invalid value stored for setting ${e}: ${r}.`,s)}this._value$=new cr(i),this.value$=this._value$,this._lastUpdateReason$=new cr(null),this.lastUpdateReason$=this._lastUpdateReason$}}function Ur(t){return[je(t.value$),t.setValue]}const Rle=new Hi("opt-in-analytics",null),VR=()=>{const t=Ur(Rle);return en.instance.isEnabled()?t:[!1,null]},kle=new Hi("developer-settings-tab",!1),Ile=new Hi("duplicate-tiles",0),E9=new Hi("debug-tile-layout",!1),V3=new Hi("show-connection-stats",!1),vz=new Hi("audio-input",void 0),yz=new Hi("audio-output",void 0),bz=new Hi("video-input",void 0),xle=new Hi("background-blur",!1),Ale=new Hi("hand-raised-show-timer",!1),Mle=new Hi("reactions-show",!0),C9=new Hi("reactions-play-sound",!0),Lle=new Hi("sound-effect-volume",.5),Ole=new Hi("mute-all-audio",!1),_z=new Hi("always-show-self",!0),Ple=new Hi("always-show-iphone-earpiece",!1);var lo=(t=>(t.Legacy="legacy",t.Compatibility="compatibility",t.Matrix_2_0="matrix_2_0",t))(lo||{});const Dle=new Hi("matrix-rtc-mode","legacy"),Nle=new Hi("custom-livekit-url",null);var KR=(t=>(t[t.Guest=0]="Guest",t[t.Registered=1]="Registered",t))(KR||{});const dl=class dl{constructor(e){this.posthog=e,this.enabled=!1,this.anonymity=0,this.platformSuperProperties={},this.registrationType=0,this.optInListener=null,this.sanitizeProperties=(i,s)=>(this.anonymity==1&&(i.$referrer=null,i.$referring_domain=null,i.$initial_referrer=null,i.$initial_referring_domain=null,i.$device_id=null),i.$current_url=i.$current_url.split("/").slice(0,3).join(""),i),this.eventCallEnded=new cVe,this.eventSignup=new uVe,this.eventCallStarted=new lVe,this.eventLogin=new dVe,this.eventMuteMicrophone=new fVe,this.eventMuteCamera=new hVe,this.eventUndecryptableToDevice=new pVe,this.eventQualitySurvey=new mVe,this.eventCallDisconnected=new gVe,this.eventCallConnectDuration=new vVe;let n,r;n=er().posthogApiKey??void 0,r=er().posthogApiHost??void 0,n&&r?(this.posthog.init(n,{api_host:r,autocapture:!1,mask_all_text:!0,mask_all_element_attributes:!0,capture_pageview:!1,sanitize_properties:this.sanitizeProperties,respect_dnt:!0,advanced_disable_decide:!0}),this.enabled=!0):(N.info("Posthog is not enabled because there is no api key or no host given in the config"),this.enabled=!1)}static hasInstance(){return!!this.internalInstance}static get instance(){return this.internalInstance||(this.internalInstance=new dl(aVe)),this.internalInstance}static resetInstance(){this.internalInstance=null}registerSuperProperties(e){this.enabled&&this.posthog.register(e)}static getPlatformProperties(){return{appVersion:"embedded-v0.19.0-rc2",matrixBackend:vt?"embedded":"jssdk",callBackend:"livekit",cryptoVersion:vt?void 0:window.matrixclient?.getCrypto()?.getVersion()}}capture(e,n,r){this.enabled&&this.posthog.capture(e,{...n},r)}isEnabled(){return this.enabled}setAnonymity(e){this.enabled&&(e==0||e==1)&&(this.posthog.reset(),this.updateSuperProperties()),this.anonymity=e}static getRandomAnalyticsId(){return[...crypto.getRandomValues(new Uint8Array(16))].map(e=>e.toString(16)).join("")}async identifyUser(e){if(this.anonymity==2&&this.enabled){let n=await this.getAnalyticsId();try{!n&&!vt&&(n=e(),await this.setAccountAnalyticsId(n))}catch(r){N.log("Unable to identify user for tracking"+r?.toString())}n?this.posthog.identify(n):N.info("No analyticsID is available. Should not try to setup posthog")}}async getAnalyticsId(){const e=window.matrixclient;return vt?er().posthogUserId:(await e.getAccountDataFromServer(dl.ANALYTICS_EVENT_TYPE))?.id??null}async setAccountAnalyticsId(e){if(!vt){const n=window.matrixclient,r=await n.getAccountDataFromServer(dl.ANALYTICS_EVENT_TYPE);await n.setAccountData(dl.ANALYTICS_EVENT_TYPE,Object.assign({id:e},r))}}getAnonymity(){return this.anonymity}logout(){this.enabled&&this.posthog.reset(),this.optInListener?.unsubscribe(),this.optInListener=null,this.setAnonymity(0)}onLoginStatusChanged(){this.maybeIdentifyUser().catch(()=>N.log("Could not identify user on login status change"))}updateSuperProperties(){this.platformSuperProperties=dl.getPlatformProperties(),this.registerSuperProperties({...this.platformSuperProperties,registrationType:this.registrationType==0?"Guest":"Registered"})}userRegisteredInThisSession(){return this.eventSignup.getSignupEndTime()>new Date(0)}async maybeIdentifyUser(){window.matrixclient&&(this.anonymity===2&&(this.setRegistrationType(window.matrixclient.isGuest()||window.passwordlessUser?0:1),this.identificationPromise=this.identifyUser(dl.getRandomAnalyticsId),await this.identificationPromise,this.userRegisteredInThisSession()&&this.eventSignup.track()),this.anonymity!==0&&this.updateSuperProperties())}trackEvent({eventName:e,...n},r){const i=()=>{this.anonymity==0||this.anonymity==1||this.capture(e,n,r)};this.identificationPromise?this.identificationPromise.then(i,s=>{N.error("Failed to identify user for tracking",s)}):i()}startListeningToSettingsChanges(){this.optInListener??=Rle.value$.subscribe(e=>{this.setAnonymity(e?2:0),this.maybeIdentifyUser().catch(()=>N.log("Could not identify user"))})}setRegistrationType(e){this.registrationType=e,!(this.anonymity==0||this.anonymity==1)&&this.updateSuperProperties()}};dl.ANALYTICS_EVENT_TYPE="im.vector.analytics",dl.internalInstance=null;let en=dl;const T9=_.createContext(void 0);T9.Provider;const xy=()=>_.use(T9);function hm(){let t,e;const n=xy();return n?.state==="valid"&&(t=n.authenticated?.client,e=n.setClient),{client:t,setClient:e}}function R9(){const t=xy();let e,n,r=!1,i=!0,s,o=!1,a;return t?.state==="valid"?(e=t.authenticated?.client,n=t.setClient,r=t.authenticated?.isPasswordlessUser??!1,i=!1,o=e!==void 0,a=t.authenticated?.logout):t?.state==="error"&&(s=t.error,i=!1),{client:e,setClient:n,passwordlessUser:r,loading:i,authenticated:o,logout:a,error:s}}const Sz="BroadcastChannel"in window?new BroadcastChannel("load"):null,NKe=({children:t})=>{const e=Fl(),[n,r]=_.useState(void 0),i=_.useRef(!1);_.useEffect(()=>{i.current||(i.current=!0,UKe().then(E=>{r(E),en.instance.isEnabled()&&en.instance.startListeningToSettingsChanges()}).catch(E=>N.error(E)).finally(()=>i.current=!1))},[]);const s=_.useCallback(async E=>{const w=jle();!n?.client||!w||(await n.client.setPassword({type:"m.login.password",identifier:{type:"m.id.user",user:w.user_id},user:w.user_id,password:w.tempPassword},E),wz({...w,passwordlessUser:!1}),r({...n,passwordlessUser:!1}))},[n]),o=_.useCallback((E,w)=>{const k=n?.client;k&&k!==E&&k.stopClient(),wz(w),r({widgetApi:null,client:E,passwordlessUser:w.passwordlessUser}),en.instance.isEnabled()&&en.instance.startListeningToSettingsChanges()},[n?.client]),a=_.useCallback(async()=>{const E=n?.client;E&&(await E.logout(!0),await E.clearStores(),Ule(),r(null),await e("/"),en.instance.logout(),en.instance.setRegistrationType(KR.Guest))},[e,n?.client]);_.useEffect(()=>{vt||Sz?.postMessage({})},[]);const[c,l]=_.useState(void 0);oC(Sz,"message",_.useCallback(()=>{n?.client.stopClient(),l(new AHe)},[n?.client,l]));const[d,h]=_.useState(!1),[m,g]=_.useState(!1),y=_.useMemo(()=>c?{state:"error",error:c}:n===void 0?void 0:{state:"valid",authenticated:n===null?void 0:{client:n.client,isPasswordlessUser:n.passwordlessUser,changePassword:s,logout:a},setClient:o,disconnected:d,supportedFeatures:{reactions:m}},[c,s,n,a,o,d,m]),v=_.useCallback((E,w,k)=>{h(jKe(E,k))},[]);return _.useEffect(()=>{if(n){if(window.matrixclient=n.client,window.passwordlessUser=n.passwordlessUser,en.hasInstance()&&en.instance.onLoginStatusChanged(),n.client&&n.client.on(De.Sync,v),n.widgetApi){const E=n.widgetApi.hasCapability("org.matrix.msc2762.send.event:m.reaction"),w=n.widgetApi.hasCapability("org.matrix.msc2762.send.event:m.room.redaction"),k=n.widgetApi.hasCapability("org.matrix.msc2762.receive.event:m.reaction"),x=n.widgetApi.hasCapability("org.matrix.msc2762.receive.event:m.room.redaction");!E||!k||!w||!x?(N.warn("Widget does not support reactions"),g(!1)):g(!0)}else g(!0);return()=>{n.client&&n.client.removeListener(De.Sync,v)}}},[n,v]),c?S.jsx(v_,{widget:vt,error:c}):S.jsx(T9,{value:y,children:t})};async function UKe(){if(vt){N.log("Using a matryoshka client");const t=await vt.client;return{widgetApi:vt.api,client:t,passwordlessUser:!1}}else{const{initSPA:t}=await Mb(async()=>{const{initSPA:e}=await import("./spa-C6PucnO3.js");return{initSPA:e}},[],import.meta.url);return t(jle,Ule)}}const Ule=()=>localStorage.removeItem("matrix-auth-store"),wz=t=>localStorage.setItem("matrix-auth-store",JSON.stringify(t)),jle=()=>{const t=localStorage.getItem("matrix-auth-store");if(t)return JSON.parse(t)},jKe=(t,e)=>t==="ERROR"&&e?.error?.name==="ConnectionError";function yS(t){const[{success:e,loading:n,displayName:r,avatarUrl:i,error:s},o]=_.useState(()=>{let c;return t&&(c=t.getUser(t.getUserId())??void 0),{success:!1,loading:!1,displayName:c?.rawDisplayName,avatarUrl:c?.avatarUrl,error:void 0}});_.useEffect(()=>{const c=(d,{displayName:h,avatarUrl:m})=>{o({success:!1,loading:!1,displayName:h,avatarUrl:m,error:void 0})};let l;if(t){const d=t.getUserId();l=t.getUser(d),l?.on(Xi.DisplayName,c),l?.on(Xi.AvatarUrl,c)}return()=>{l&&(l.removeListener(Xi.DisplayName,c),l.removeListener(Xi.AvatarUrl,c))}},[t]);const a=_.useCallback(async({displayName:c,avatar:l,removeAvatar:d})=>{if(t){o(h=>({...h,loading:!0,error:void 0,success:!1}));try{await t.setDisplayName(c);let h;d?await t.setAvatarUrl(""):l&&({content_uri:h}=await t.uploadContent(l),await t.setAvatarUrl(h)),o(m=>({...m,displayName:c,avatarUrl:d?void 0:h??m.avatarUrl,loading:!1,success:!0}))}catch(h){o(m=>({...m,loading:!1,error:h instanceof Error?h:Error(h),success:!1}))}}else N.error("Client not initialized before calling saveProfile")},[t]);return{loading:n,error:s,displayName:r,avatarUrl:i,saveProfile:a,success:e}}const FKe="_settingsModal_1dkeq_8",$Ke="_volumeSlider_1dkeq_20",Ez={settingsModal:FKe,volumeSlider:$Ke},BKe="_tabContainer_1nnp9_8",HKe="_tabList_1nnp9_14",Cz={tabContainer:BKe,tabList:HKe};function qKe({label:t,tab:e,onTabChange:n,tabs:r}){const i=_.useId();return S.jsxs("div",{className:Cz.tabContainer,children:[S.jsx(j9e,{role:"tablist","aria-label":t,className:Cz.tabList,children:r.map(({key:s,name:o})=>S.jsx(H9e,{"aria-controls":`${i}[${s}]`,onClick:()=>n(s),active:s===e,children:o},s))}),r.map(({key:s,content:o})=>S.jsx("div",{id:`${i}[${s}]`,style:{display:s===e?void 0:"none"},children:o},s))]})}const VKe="_fieldRow_iwncy_8",KKe="_field_iwncy_8",GKe="_rightAlign_iwncy_21",zKe="_inputField_iwncy_33",WKe="_disabled_iwncy_52",YKe="_prefix_iwncy_110",JKe="_checkboxField_iwncy_131",XKe="_checkbox_iwncy_131",QKe="_description_iwncy_168",ZKe="_errorMessage_iwncy_197",eGe="_noLabel_iwncy_210",Da={fieldRow:VKe,field:KKe,rightAlign:GKe,inputField:zKe,disabled:WKe,prefix:YKe,checkboxField:JKe,checkbox:XKe,description:QKe,errorMessage:ZKe,noLabel:eGe},tGe=(t,e)=>_.createElement("svg",{fill:"none",height:24,stroke:"#000",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,viewBox:"0 0 24 24",width:24,xmlns:"http://www.w3.org/2000/svg",ref:e,...t},_.createElement("path",{d:"m20 6-11 11-5-5"})),nGe=_.forwardRef(tGe);class Fle extends Error{constructor(e,n){super(n(e,{lng:"en"})),this.translatedMessage=n(e)}}class rGe extends Fle{}const Tz=(t,e)=>new rGe(t,e);function Dt({children:t,rightAlign:e,className:n}){return S.jsx("div",{className:Le(Da.fieldRow,{[Da.rightAlign]:e},n),children:t})}function iGe({children:t,className:e}){return S.jsx("div",{className:Le(Da.field,e),children:t})}const Zn=({ref:t,id:e,label:n,className:r,type:i,checked:s,prefix:o,suffix:a,description:c,disabled:l,min:d,...h})=>{const m=_.useId();return S.jsxs(iGe,{className:Le(i==="checkbox"?Da.checkboxField:Da.inputField,{[Da.prefix]:!!o,[Da.disabled]:l},r),children:[o&&S.jsx("span",{children:o}),i==="textarea"?S.jsx("textarea",{id:e,ref:t,disabled:l,"aria-describedby":m,...h}):S.jsx("input",{id:e,ref:t,type:i,checked:s,disabled:l,"aria-describedby":m,min:d,...h}),S.jsxs("label",{htmlFor:e,children:[i==="checkbox"&&S.jsx("div",{className:Da.checkbox,children:S.jsx(nGe,{})}),n]}),a&&S.jsx("span",{children:a}),c&&S.jsx("p",{id:m,className:n?Da.description:Le(Da.description,Da.noLabel),children:c})]})};Zn.displayName="InputField";const ph=({error:t})=>S.jsx("p",{className:Da.errorMessage,children:t instanceof Fle?t.translatedMessage:t.message}),sGe="_avatarInputField_1ep5q_8",oGe="_avatar_1ep5q_8",aGe="_fileInput_1ep5q_17",cGe="_edit_1ep5q_21",Yw={avatarInputField:sGe,avatar:oGe,fileInput:aGe,edit:cGe},$le=({id:t,label:e,className:n,avatarUrl:r,userId:i,displayName:s,onRemoveAvatar:o,...a})=>{const{t:c}=ze(),[l,d]=_.useState(!1),[h,m]=_.useState(void 0),[g,y]=_.useState(!1),v=_.useRef(null);_.useEffect(()=>{const k=v.current,x=C=>{const R=C;R.target.files&&R.target.files.length>0?(m(URL.createObjectURL(R.target.files[0])),d(!1)):m(void 0)};return k.addEventListener("change",x),()=>{k?.removeEventListener("change",x)}});const E=_.useCallback(()=>{v.current.click()},[v]),w=_.useCallback(()=>{d(!0),o()},[o]);return S.jsxs("div",{className:Le(Yw.avatarInputField,n),children:[S.jsx(Iy,{id:i,className:Yw.avatar,name:s,size:ky.XL,src:l?void 0:h||r}),S.jsx("input",{id:t,accept:"image/*",ref:v,type:"file",className:Yw.fileInput,role:"button","aria-label":e,...a}),S.jsx("div",{className:Yw.edit,children:(r||h)&&!l?S.jsxs(wR,{title:c("action.edit"),showTitle:!1,open:g,onOpenChange:y,trigger:S.jsx(Ht,{iconOnly:!0,Icon:$K,kind:"tertiary",size:"sm","aria-label":c("action.edit")}),children:[S.jsx(Fp,{Icon:iNe,label:c("action.upload_file"),onSelect:E}),S.jsx(Fp,{Icon:KDe,label:c("action.remove"),kind:"critical",onSelect:w})]}):S.jsx(Ht,{type:"button",iconOnly:!0,Icon:$K,kind:"tertiary",size:"sm","aria-label":c("action.edit"),onClick:E})})]})};$le.displayName="AvatarInputField";const lGe="_content_gj715_8",uGe="_avatarFieldRow_gj715_15",Rz={content:lGe,avatarFieldRow:uGe},dGe=({client:t})=>{const{t:e}=ze(),{error:n,displayName:r,avatarUrl:i,saveProfile:s}=yS(t),o=_.useMemo(()=>t.getUserId(),[t]),a=_.useRef(null),c=_.useRef(!1),l=_.useCallback(()=>{c.current=!0},[]),d=_.useRef(!1),h=_.useCallback(()=>{d.current=!0,c.current=!0},[]);return _.useEffect(()=>{const m=a.current;return()=>{if(c.current){const g=new FormData(m),y=g.get("displayName"),v=g.get("avatar"),E=typeof v=="string"?v.length:v?.size??0,w=typeof y=="string"?y:y?.name??null;if(!w)return;s({displayName:w,avatar:v&&E>0?v:void 0,removeAvatar:d.current&&(!v||E===0)}).catch(k=>{N.error("Failed to save profile",k)})}}},[s]),S.jsxs("form",{onChange:l,ref:a,className:Rz.content,children:[S.jsx(Dt,{className:Rz.avatarFieldRow,children:o&&r&&S.jsx($le,{id:"avatar",name:"avatar",label:e("common.avatar"),avatarUrl:i,userId:o,displayName:r,onRemoveAvatar:h})}),S.jsx(Dt,{children:S.jsx(Zn,{id:"userId",name:"userId",label:e("common.username"),type:"text",disabled:!0,value:t.getUserId()})}),S.jsx(Dt,{children:S.jsx(Zn,{id:"displayName",name:"displayName",label:e("common.display_name"),type:"text",required:!0,autoComplete:"off",placeholder:e("common.display_name"),defaultValue:r,"data-testid":"profile_displayname"})}),n&&S.jsx(Dt,{children:S.jsx(ph,{error:n})})]})},fGe="_feedback_19yh9_8",Ble={feedback:fGe},Hle=()=>S.jsxs(bo,{i18nKey:"analytics_notice",children:["By participating in this beta, you consent to the collection of anonymous data, which we use to improve the product. You can find more information about which data we track in our"," ",S.jsx(_p,{href:"https://element.io/privacy",children:"Privacy Policy"})," ","and our"," ",S.jsx(_p,{href:"https://element.io/cookie-policy",children:"Cookie Policy"}),"."]}),hGe=({roomId:t})=>{const{t:e}=ze(),{submitRageshake:n,sending:r,sent:i,error:s,available:o}=NR(),a=DBe(),c=_.useCallback(h=>{h.preventDefault();const m=new FormData(h.target),g=m.get("description"),y=typeof g=="string"?g:"",v=!!m.get("sendLogs"),E=Qo(16);n({description:y,sendLogs:v,rageshakeRequestId:E,roomId:t}).catch(w=>{N.error("Failed to send feedback rageshake",w)}),t&&v&&a(t,E)},[n,t,a]);VR();const l=null,d=o?S.jsxs(S.Fragment,{children:[S.jsx("h4",{children:e("settings.feedback_tab_h4")}),S.jsx(on,{children:e("settings.feedback_tab_body")}),S.jsxs("form",{onSubmit:c,children:[S.jsx(Dt,{children:S.jsx(Zn,{className:Ble.feedback,id:"description",name:"description",label:e("settings.feedback_tab_description_label"),placeholder:e("settings.feedback_tab_description_label"),type:"textarea",disabled:r||i})}),!i&&S.jsxs(Dt,{children:[S.jsx(Zn,{id:"sendLogs",name:"sendLogs",label:e("settings.feedback_tab_send_logs_label"),type:"checkbox",defaultChecked:!0}),S.jsx(Ht,{type:"submit",disabled:r,children:e(r?"submitting":"action.submit")})]}),S.jsxs(Dt,{children:[s&&S.jsx(ph,{error:s}),i&&S.jsx(on,{children:e("settings.feedback_tab_thank_you")})]})]})]}):null;return S.jsxs("div",{children:[l,d]})};var dC={exports:{}},pGe=dC.exports,kz;function mGe(){return kz||(kz=1,(function(t){(function(e,n){t.exports?t.exports=n():e.log=n()})(pGe,function(){var e=function(){},n="undefined",r=typeof window!==n&&typeof window.navigator!==n&&/Trident\/|MSIE /.test(window.navigator.userAgent),i=["trace","debug","info","warn","error"],s={},o=null;function a(v,E){var w=v[E];if(typeof w.bind=="function")return w.bind(v);try{return Function.prototype.bind.call(w,v)}catch{return function(){return Function.prototype.apply.apply(w,[v,arguments])}}}function c(){console.log&&(console.log.apply?console.log.apply(console,arguments):Function.prototype.apply.apply(console.log,[console,arguments])),console.trace&&console.trace()}function l(v){return v==="debug"&&(v="log"),typeof console===n?!1:v==="trace"&&r?c:console[v]!==void 0?a(console,v):console.log!==void 0?a(console,"log"):e}function d(){for(var v=this.getLevel(),E=0;E<i.length;E++){var w=i[E];this[w]=E<v?e:this.methodFactory(w,v,this.name)}if(this.log=this.debug,typeof console===n&&v<this.levels.SILENT)return"No console available for logging"}function h(v){return function(){typeof console!==n&&(d.call(this),this[v].apply(this,arguments))}}function m(v,E,w){return l(v)||h.apply(this,arguments)}function g(v,E){var w=this,k,x,C,R="loglevel";typeof v=="string"?R+=":"+v:typeof v=="symbol"&&(R=void 0);function T(j){var $=(i[j]||"silent").toUpperCase();if(!(typeof window===n||!R)){try{window.localStorage[R]=$;return}catch{}try{window.document.cookie=encodeURIComponent(R)+"="+$+";"}catch{}}}function M(){var j;if(!(typeof window===n||!R)){try{j=window.localStorage[R]}catch{}if(typeof j===n)try{var $=window.document.cookie,q=encodeURIComponent(R),Y=$.indexOf(q+"=");Y!==-1&&(j=/^([^;]+)/.exec($.slice(Y+q.length+1))[1])}catch{}return w.levels[j]===void 0&&(j=void 0),j}}function O(){if(!(typeof window===n||!R)){try{window.localStorage.removeItem(R)}catch{}try{window.document.cookie=encodeURIComponent(R)+"=; expires=Thu, 01 Jan 1970 00:00:00 UTC"}catch{}}}function P(j){var $=j;if(typeof $=="string"&&w.levels[$.toUpperCase()]!==void 0&&($=w.levels[$.toUpperCase()]),typeof $=="number"&&$>=0&&$<=w.levels.SILENT)return $;throw new TypeError("log.setLevel() called with invalid level: "+j)}w.name=v,w.levels={TRACE:0,DEBUG:1,INFO:2,WARN:3,ERROR:4,SILENT:5},w.methodFactory=E||m,w.getLevel=function(){return C??x??k},w.setLevel=function(j,$){return C=P(j),$!==!1&&T(C),d.call(w)},w.setDefaultLevel=function(j){x=P(j),M()||w.setLevel(j,!1)},w.resetLevel=function(){C=null,O(),d.call(w)},w.enableAll=function(j){w.setLevel(w.levels.TRACE,j)},w.disableAll=function(j){w.setLevel(w.levels.SILENT,j)},w.rebuild=function(){if(o!==w&&(k=P(o.getLevel())),d.call(w),o===w)for(var j in s)s[j].rebuild()},k=P(o?o.getLevel():"WARN");var D=M();D!=null&&(C=P(D)),d.call(w)}o=new g,o.getLogger=function(E){if(typeof E!="symbol"&&typeof E!="string"||E==="")throw new TypeError("You must supply a name when creating a logger.");var w=s[E];return w||(w=s[E]=new g(E,o.methodFactory)),w};var y=typeof window!==n?window.log:void 0;return o.noConflict=function(){return typeof window!==n&&window.log===o&&(window.log=y),o},o.getLoggers=function(){return s},o.default=o,o})})(dC)),dC.exports}var gGe=mGe();const vGe=Dl(gGe);var yGe=(t,e,n)=>new Promise((r,i)=>{var s=c=>{try{a(n.next(c))}catch(l){i(l)}},o=c=>{try{a(n.throw(c))}catch(l){i(l)}},a=c=>c.done?r(c.value):Promise.resolve(c.value).then(s,o);a((n=n.apply(t,e)).next())});function bGe(t){return typeof t>"u"?!1:_Ge(t)||SGe(t)}function _Ge(t){var e;return t?t.hasOwnProperty("participant")&&t.hasOwnProperty("source")&&t.hasOwnProperty("track")&&typeof((e=t.publication)==null?void 0:e.track)<"u":!1}function SGe(t){return t?t.hasOwnProperty("participant")&&t.hasOwnProperty("source")&&t.hasOwnProperty("publication")&&typeof t.publication<"u":!1}function wGe(t){return t?t.hasOwnProperty("participant")&&t.hasOwnProperty("source")&&typeof t.publication>"u":!1}function EGe(t){if(typeof t=="string"||typeof t=="number")return`${t}`;if(wGe(t))return`${t.participant.identity}_${t.source}_placeholder`;if(bGe(t))return`${t.participant.identity}_${t.publication.source}_${t.publication.trackSid}`;throw new Error(`Can't generate a id for the given track reference: ${t}`)}var CGe=[pe.ConnectionStateChanged,pe.RoomMetadataChanged,pe.ActiveSpeakersChanged,pe.ConnectionQualityChanged,pe.ParticipantConnected,pe.ParticipantDisconnected,pe.ParticipantPermissionsChanged,pe.ParticipantMetadataChanged,pe.ParticipantNameChanged,pe.ParticipantAttributesChanged,pe.TrackMuted,pe.TrackUnmuted,pe.TrackPublished,pe.TrackUnpublished,pe.TrackStreamStateChanged,pe.TrackSubscriptionFailed,pe.TrackSubscriptionPermissionChanged,pe.TrackSubscriptionStatusChanged],TGe=[...CGe,pe.LocalTrackPublished,pe.LocalTrackUnpublished];ce.TrackPublished,ce.TrackUnpublished,ce.TrackMuted,ce.TrackUnmuted,ce.TrackStreamStateChanged,ce.TrackSubscribed,ce.TrackUnsubscribed,ce.TrackSubscriptionPermissionChanged,ce.TrackSubscriptionFailed,ce.LocalTrackPublished,ce.LocalTrackUnpublished;var RGe=[ce.ConnectionQualityChanged,ce.IsSpeakingChanged,ce.ParticipantMetadataChanged,ce.ParticipantPermissionsChanged,ce.TrackMuted,ce.TrackUnmuted,ce.TrackPublished,ce.TrackUnpublished,ce.TrackStreamStateChanged,ce.TrackSubscriptionFailed,ce.TrackSubscriptionPermissionChanged,ce.TrackSubscriptionStatusChanged];[...RGe,ce.LocalTrackPublished,ce.LocalTrackUnpublished];var kGe=vGe.getLogger("lk-components-js");kGe.setDefaultLevel("WARN");function IGe(t,...e){return new tr(r=>{const i=()=>{r.next(t)};return e.forEach(o=>{t.on(o,i)}),()=>{e.forEach(o=>{t.off(o,i)})}}).pipe(pn(t))}function qle(t,e){return new tr(r=>{const i=(...o)=>{r.next(o)};return t.on(e,i),()=>{t.off(e,i)}})}function xGe(t){return qle(t,pe.ConnectionStateChanged).pipe(ge(([e])=>e),pn(t.state))}function Iz(t,e,n=!0){const r=new tr(s=>{Wu.getLocalDevices(t,n).then(o=>{s.next(o),s.complete()}).catch(o=>{e?.(o),s.next([]),s.complete()})}),i=new tr(s=>{var o;const a=()=>yGe(this,null,function*(){try{const c=yield Wu.getLocalDevices(t,n);s.next(c)}catch(c){e?.(c)}});if(typeof window<"u"){if(!window.isSecureContext)throw new Error("Accessing media devices is available only in secure contexts (HTTPS and localhost), in some or all supporting browsers. See: https://developer.mozilla.org/en-US/docs/Web/API/Navigator/mediaDevices");(o=navigator?.mediaDevices)==null||o.addEventListener("devicechange",a)}return()=>{var c;(c=navigator?.mediaDevices)==null||c.removeEventListener("devicechange",a)}});return qv(r,i)}function GR(t,...e){return new tr(r=>{const i=()=>{r.next(t)};return e.forEach(o=>{t.on(o,i)}),()=>{e.forEach(o=>{t.off(o,i)})}}).pipe(pn(t))}function Vle(t){return GR(t,ce.TrackMuted,ce.TrackUnmuted,ce.ParticipantPermissionsChanged,ce.TrackPublished,ce.TrackUnpublished,ce.LocalTrackPublished,ce.LocalTrackUnpublished,ce.MediaDevicesError,ce.TrackSubscriptionStatusChanged).pipe(ge(n=>{const{isMicrophoneEnabled:r,isCameraEnabled:i,isScreenShareEnabled:s}=n,o=n.getTrackPublication(me.Source.Microphone),a=n.getTrackPublication(me.Source.Camera);return{isCameraEnabled:i,isMicrophoneEnabled:r,isScreenShareEnabled:s,cameraTrack:a,microphoneTrack:o,participant:n}}))}function AGe(t,e={}){var n;let r;const i=new tr(c=>(r=c,()=>a.unsubscribe())).pipe(pn(Array.from(t.remoteParticipants.values()))),s=(n=e.additionalRoomEvents)!=null?n:TGe,o=Array.from(new Set([pe.ParticipantConnected,pe.ParticipantDisconnected,pe.ConnectionStateChanged,...s])),a=IGe(t,...o).subscribe(c=>r?.next(Array.from(c.remoteParticipants.values())));return t.remoteParticipants.size>0&&r?.next(Array.from(t.remoteParticipants.values())),i}const Dg=new sr,k9=new sr,Kle=new sr,oO=new sr;let xz=!1;const Gle=()=>{xz||(xz=!0,window.controls.onAudioPlaybackStarted?.())};window.controls={canEnterPip(){return Dg.observed},enablePip(){if(!Dg.observed)throw new Error("No call is running");Dg.next(!0)},disablePip(){if(!Dg.observed)throw new Error("No call is running");Dg.next(!1)},setAvailableAudioDevices(t){N.info("[MediaDevices controls] setAvailableAudioDevices called from native:",t),k9.next(t)},setAudioDevice(t){N.info("[MediaDevices controls] setAudioDevice called from native",t),Kle.next(t)},setAudioEnabled(t){if(N.info("[MediaDevices controls] setAudioEnabled called from native:",t),!oO.observed)throw new Error("Output controls are disabled. No setAudioEnabled$ observer");oO.next(t)},setOutputEnabled(t){this.setAudioEnabled(t)},setAvailableOutputDevices(t){this.setAvailableAudioDevices(t)},setOutputDevice(t){this.setAudioDevice(t)}};const Sg=Symbol("nothing");class bS{constructor(){this.ended$=new cr(!1),this.bindImpl=Cle(this.ended$.pipe(Fr(e=>e))),this.shareImpl=MKe({resetOnError:!1,resetOnComplete:!1,resetOnRefCountZero:!1}),this.share=e=>e.pipe(this.bindImpl,this.shareImpl)}bind(){return this.bindImpl}behavior(e,n=Sg){const r=new cr(n);if(e.pipe(this.bind(),Ni()).subscribe({next(i){r.next(i)},error(i){r.error(i)}}),r.value===Sg)throw new Error("Behavior failed to synchronously emit an initial value");return r}end(){this.ended$.next(!0)}onEnd(e){this.ended$.pipe(Fr(n=>n),qR(1)).subscribe(e)}reconcile(e,n){let r=Sg,i,s,o=Sg;const a=async()=>{for(;r!==o;)await s?.(),o=r,r!==Sg&&(s=await n(r))};e.pipe(HR(()=>b9),this.bind(),wle(Sg)).subscribe(c=>{r=c,!i&&(i=a().finally(()=>{i=void 0}))})}splitBehavior(e){return Object.fromEntries(Object.keys(e.value).map(n=>[`${n}$`,this.behavior(e.pipe(ge(r=>r[n])))]))}}const zle=new bS;class Lc{constructor(e,n){this.value=e,this.epoch=n??0}mapInner(e){return new Lc(e(this.value),this.epoch)}}function aO(t){return ge(e=>e.mapInner(t))}function MGe(){return ge((t,e)=>new Lc(t,e))}const K3=Symbol("nothing");function LGe(t){return e=>cKe(()=>{let n=K3;return e.pipe(ec(r=>n=r),xKe(()=>{n!==K3&&t(n)}))})}function Wle(t,e){return n=>n.pipe(pl(e,t),pn(t))}function OGe(t,e,n){return t.behavior(n.pipe(Wle(e,r=>!r)))}const Az=Symbol("switch");function PGe(t,e){return n=>qv(n.pipe(ge((r,i)=>t(r,i)?Az:r),PKe(r=>r!==Az)),e)}function DGe(t){let e=K3;if(t.subscribe(n=>e=n).unsubscribe(),e===K3)throw new Error("Not a state Observable");return e}function Yle(...t){return mt(t,(...e)=>e.every(n=>n))}function Mz(t){return e=>e.pipe(Tle(t),Sle(([,n])=>n?t.pipe(Fr(r=>!r)):pt(null)),ge(([n])=>n))}function cO(t,e,n){return I9(t,e,n,r=>r)}function Jle(t,e,n){return I9(t,function*(r){yield*e(r.value)},n,(r,i)=>new Lc(r,i.epoch))}function NGe(t){return e=>e.pipe(pl((n,r)=>{if(t(r)){const i=n??new cr(r);return i.next(r),i}return null},null),Ni())}function UGe(t,e,n){return r=>r.pipe(I9(t,function*(i){yield e(i)},n,i=>i),ge(([i])=>i))}function I9(t,e,n,r){return i=>i.pipe(pl(({map:s,items:o},a)=>{const c=new Map,l=new Set;for(const{keys:d,data:h}of e(a)){let m=s;for(const E of d)m=m?.get(E);let g=m;if(g===void 0){const E=new bS,w=new cr(h);N.debug(`[${t}] Creating item with keys ${d.join(", ")}`),g={scope:E,keys:d,data$:w,item:n(E,w,...d)}}else g.data$.next(h);let y=c;for(let E=0;E<d.length-1;E++){let w=y.get(d[E]);w===void 0&&(w=new Map,y.set(d[E],w)),y=w}const v=d[d.length-1];if(y.has(v))throw new Error(`Keys must be unique (tried to generate multiple items for key ${d.join(", ")})`);y.set(d[d.length-1],g),l.add(g)}for(const d of o)l.has(d)||(N.debug(`[${t}] Destroying item with keys ${d.keys.join(", ")}`),d.scope.end());return{map:c,items:l,input:a}},{map:new Map,items:new Set}),LGe(({items:s})=>{N.debug(`[${t}] End of scope, destroying all ${s.size} items…`);for(const o of s)N.debug(`[${t}] Destroying item with keys ${o.keys.join(", ")}`),o.scope.end()}),ge(({items:s,input:o})=>r([...s].map(({item:a})=>a),o)))}function zR(t){return new cr(t)}class jGe{constructor(e,n,r=void 0,i){this.controlledDevices$=e,this.scope=n,this.initialIntent=r,this.logger=N.getChild("[MediaDevices AndroidControlledAudioOutput]"),this.selectDeviceCommand$=new sr,this.controllerState$=this.startObservingState$(),this.selected$=this.effectiveSelectionFromState$(this.controllerState$),this.available$=n.behavior(this.controllerState$.pipe(ge(s=>(this.logger.info("available devices updated:",s.devices),new Map(s.devices.map(o=>[o.id,FGe(o)])))))),this.selected$.pipe(n.bind()).subscribe(s=>{s!==void 0&&(this.logger.info("onAudioDeviceSelect called:",s),i.onAudioDeviceSelect?.(s.id),i.onOutputDeviceSelect?.(s.id))})}select(e){this.logger.info(`select device: ${e}`),this.selectDeviceCommand$.next(e)}startObservingState$(){const e={devices:[],preferredDeviceId:void 0,selectedDeviceId:void 0},n=Nc(this.controlledDevices$.pipe(ge(i=>({type:"deviceUpdated",devices:i}))),this.selectDeviceCommand$.pipe(ge(i=>({type:"selectDevice",deviceId:i})))),r={type:"deviceUpdated",devices:[]};return this.scope.behavior(n.pipe(pn(r),pl((i,s)=>{switch(s.type){case"deviceUpdated":{const o=this.chooseEffectiveSelection({previousDevices:i.devices,availableDevices:s.devices,currentSelectedId:i.selectedDeviceId,preferredDeviceId:i.preferredDeviceId});return{...i,devices:s.devices,selectedDeviceId:o}}case"selectDevice":{const o=this.chooseEffectiveSelection({previousDevices:i.devices,availableDevices:i.devices,currentSelectedId:i.selectedDeviceId,preferredDeviceId:s.deviceId});return{...i,preferredDeviceId:s.deviceId,selectedDeviceId:o}}}},e)))}effectiveSelectionFromState$(e){return this.scope.behavior(e.pipe(ge(n=>{if(n.selectedDeviceId)return{id:n.selectedDeviceId,virtualEarpiece:!1}}),Ni((n,r)=>n?.id===r?.id)).pipe(ec(n=>{this.logger.debug(`selected device: ${n?.id}`)})))}chooseEffectiveSelection(e){const{previousDevices:n,availableDevices:r,currentSelectedId:i,preferredDeviceId:s}=e;this.logger.debug("chooseEffectiveSelection with args:",e);const o=s||i,a=r.some(l=>l.id===o);if(o===void 0||!a)return this.logger.debug("No current device or it is not available, using default selection logic."),this.chooseDefaultDeviceId(r);if(r.some(l=>!n.some(d=>d.id===l.id))){const l=r[0];if(this.logger.debug("A new device was added, checking if we should switch to it.",l),l.id!==o&&l.isExternalHeadset==!0)return this.logger.info(`The currently selected device ${l.id} is not the most preferred one, switching to the most preferred one ${o} instead.`),l.id}return o}chooseDefaultDeviceId(e){if(this.logger.debug(`Android routing logic intent: ${this.initialIntent} finding best default...`),this.initialIntent==="audio"){const n=e[0];if(n?.isSpeaker==!0){const r=e.find(i=>i.isEarpiece==!0);return r?(this.logger.debug("Android routing: Switch to earpiece instead of speaker for voice call"),r.id):(this.logger.debug("Android routing: no earpiece found, cannot switch, use system proposed routing"),n.id)}else return this.logger.debug("Android routing: Use system proposed routing ",n),n?.id}else return e[0]?.id}}function FGe(t){const{name:e,isEarpiece:n,isSpeaker:r}=t;return n?{type:"earpiece"}:r?{type:"speaker"}:{type:"name",name:e}}const c5="earpiece-id";class $Ge{constructor(e,n){this.usingNames$=e,this.scope=n,this.logger=N.getChild("[MediaDevices ControlledAudioOutput]"),this.availableRaw$=WR("audiooutput",this.usingNames$,this.scope,this.logger),this.available$=this.scope.behavior(mt([k9.pipe(pn([])),Xle],(r,i)=>{const s=new Map(r.map(({id:o,name:a,isEarpiece:c,isSpeaker:l})=>{let d;return c?d={type:"earpiece"}:l?d={type:"speaker"}:d={type:"name",name:a},[o,d]}));return i&&r.some(o=>o.forEarpiece)&&(this.logger.info(`IOS Add virtual earpiece device with id ${c5}`),s.set(c5,{type:"earpiece"})),s})),this.deviceSelection$=new sr,this.selected$=this.scope.behavior(mt([this.available$,Nc(Kle.pipe(pn(void 0)),this.deviceSelection$)],(r,i)=>{const s=i??r.keys().next().value;return s===void 0?void 0:{id:s,virtualEarpiece:s===c5}}).pipe(ec(r=>{this.logger.debug(`selected device: ${r?.id}`)}))),this.selected$.subscribe(r=>{r!==void 0&&(this.logger.info("onAudioDeviceSelect called:",r),window.controls.onAudioDeviceSelect?.(r.id),window.controls.onOutputDeviceSelect?.(r.id))}),this.available$.subscribe(r=>{this.logger.debug("available devices:",r)}),this.availableRaw$.subscribe(r=>{this.logger.debug("available raw devices:",r)})}select(e){this.logger.info(`select device: ${e}`),this.deviceSelection$.next(e)}}const Xle=Hs==="ios"?zR(!0):Ple.value$;function WR(t,e,n,r){const i=a=>r.error("Error creating MediaDeviceObserver",a),s=Iz(t,i,!1),o=Iz(t,i,!0);return n.behavior(e.pipe(rt(a=>a?s.pipe(PGe((c,l)=>l===0&&c.every(d=>!d.label),o)):s)),[])}function x9(t){return new Map(t.map((e,n)=>[e.deviceId,e.label?{type:"name",name:e.label}:{type:"number",number:n+1}]))}function A9(t,e){return mt([t,e],(n,r)=>{if(n.size)return r!==void 0&&n.has(r)||n.size===1&&n.has("")?r:n.keys().next().value})}class BGe{constructor(e,n){this.usingNames$=e,this.scope=n,this.logger=N.getChild("[MediaDevices AudioInput]"),this.availableRaw$=WR("audioinput",this.usingNames$,this.scope,this.logger),this.available$=this.scope.behavior(this.availableRaw$.pipe(ge(x9))),this.selected$=this.scope.behavior(A9(this.available$,vz.value$).pipe(ge(r=>r===void 0?void 0:{id:r,hardwareDeviceChange$:this.availableRaw$.pipe(ge(i=>i.find(s=>s.deviceId===r)?.groupId),Vv(),Fr(([i,s])=>i!==s),ge(()=>{}))}))),this.available$.subscribe(r=>{this.logger.info("[audio-input] available devices:",r)})}select(e){vz.setValue(e)}}class HGe{constructor(e,n){this.usingNames$=e,this.scope=n,this.logger=N.getChild("[MediaDevices AudioOutput]"),this.available$=this.scope.behavior(WR("audiooutput",this.usingNames$,this.scope,this.logger).pipe(ge(r=>{let i=x9(r);return i.size&&!i.has("")&&!i.has("default")&&i.set("",{type:"default",name:r[0]?.label||null}),window.GestureEvent&&(i=new Map),i}))),this.selected$=this.scope.behavior(A9(this.available$,yz.value$).pipe(ge(r=>{if(r!==void 0)return{id:r,virtualEarpiece:!1}}))),this.available$.subscribe(r=>{this.logger.info("[audio-output] available devices:",r)})}select(e){yz.setValue(e)}}class qGe{constructor(e,n){this.usingNames$=e,this.scope=n,this.logger=N.getChild("[MediaDevices VideoInput]"),this.available$=this.scope.behavior(WR("videoinput",this.usingNames$,this.scope,this.logger).pipe(ge(x9))),this.selected$=this.scope.behavior(A9(this.available$,bz.value$).pipe(ge(r=>r===void 0?void 0:{id:r}))),this.available$.subscribe(r=>{this.logger.info("[video-input] available devices:",r)})}select(e){bz.setValue(e)}}class VGe{constructor(e){this.scope=e,this.deviceNamesRequest$=new sr,this.usingNames$=this.scope.behavior(this.deviceNamesRequest$.pipe(ge(()=>!0)),!1),this.audioInput=new BGe(this.usingNames$,this.scope),this.audioOutput=er().controlledAudioDevices?Hs=="android"?new jGe(k9,this.scope,er().callIntent,window.controls):new $Ge(this.usingNames$,this.scope):new HGe(this.usingNames$,this.scope),this.videoInput=new qGe(this.usingNames$,this.scope)}requestDeviceNames(){this.deviceNamesRequest$.next()}}function KGe(t,e,n){if(!n)return _.useState(e)[0];const[r]=_.useState(()=>new cr(n)),[i]=_.useState(()=>e(r)),s=_.useRef(!0);return t(()=>{if(s.current){s.current=!1;return}r.next(n)},n),i}function Qle(t,e){return KGe(_.useEffect,t,e)}var GGe=t=>t+1|0,zGe=()=>{const t=_.useState(0)[1];return _.useRef(()=>t(GGe)).current},WGe=typeof window>"u"?_.useEffect:_.useLayoutEffect;function So(t){const e=zGe(),n=_.useRef(t),r=_.useRef(),i=_.useRef(!1),s=_.useRef(!1),[o,a]=_.useState(()=>{let c;return t.subscribe({next:l=>{s.current=!0,c=l},error:l=>{r.current=l}}).unsubscribe(),c});if(WGe(()=>{n.current=t}),_.useEffect(()=>{r.current=null;const c=n.current;let l=o;const d=c.subscribe({next:h=>{c===n.current&&(i.current?a(()=>h):l=h)},error:h=>{c===n.current&&(r.current=h,e())}});return i.current||l!==o&&a(()=>l),i.current=!0,()=>{d.unsubscribe()}},[t]),r.current)throw r.current;if(s.current)return _.useDebugValue(o),o;throw new Error("Observable did not synchronously emit a value.")}function YGe(t){const[e]=_.useState(()=>new cr(t)),[n]=_.useState(()=>({get current(){return e.value},set current(r){e.next(r)}}));return[n,e]}const Zle=_.createContext(void 0);function pm(){const t=_.use(Zle);if(t===void 0)throw new Error("useMediaDevices must be used within a MediaDevices context provider");return t}const eue=()=>{const t=pm(),n=So(t.audioOutput.selected$)?.virtualEarpiece??!1;return{pan:_.useMemo(()=>n?1:0,[n]),volume:_.useMemo(()=>n?.1:1,[n])}},JGe=()=>{const{t}=ze(),[e,n]=Ur(Ale),[r,i]=Ur(Mle),[s,o]=Ur(C9),a=(d,h)=>{h(d.target.checked)},[c,l]=Ur(kle);return S.jsxs("div",{children:[S.jsx(on,{children:t("settings.preferences_tab.introduction")}),S.jsx(Dt,{children:S.jsx(Zn,{id:"showHandRaisedTimer",label:t("settings.preferences_tab.show_hand_raised_timer_label"),description:t("settings.preferences_tab.show_hand_raised_timer_description"),type:"checkbox",checked:e,onChange:d=>a(d,n)})}),S.jsx(Dt,{children:S.jsx(Zn,{id:"showReactions",label:t("settings.preferences_tab.reactions_show_label"),description:t("settings.preferences_tab.reactions_show_description"),type:"checkbox",checked:r,onChange:d=>a(d,i)})}),S.jsx(Dt,{children:S.jsx(Zn,{id:"playReactionSound",label:t("settings.preferences_tab.reactions_play_sound_label"),description:t("settings.preferences_tab.reactions_play_sound_description"),type:"checkbox",checked:s,onChange:d=>a(d,o)})}),S.jsx(Dt,{children:S.jsx(Zn,{id:"developerSettingsTab",type:"checkbox",checked:c,label:t("settings.preferences_tab.developer_mode_label"),description:t("settings.preferences_tab.developer_mode_label_description"),onChange:d=>l(d.target.checked)})})]})};function tue(t,[e,n]){return Math.min(n,Math.max(e,t))}function XGe(t){const e=_.useRef({value:t,previous:t});return _.useMemo(()=>(e.current.value!==t&&(e.current.previous=e.current.value,e.current.value=t),e.current.previous),[t])}var QGe=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],_S=QGe.reduce((t,e)=>{const n=Eo(`Primitive.${e}`),r=_.forwardRef((i,s)=>{const{asChild:o,...a}=i,c=o?n:e;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),S.jsx(c,{...a,ref:s})});return r.displayName=`Primitive.${e}`,{...t,[e]:r}},{}),nue=["PageUp","PageDown"],rue=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],iue={"from-left":["Home","PageDown","ArrowDown","ArrowLeft"],"from-right":["Home","PageDown","ArrowDown","ArrowRight"],"from-bottom":["Home","PageDown","ArrowDown","ArrowLeft"],"from-top":["Home","PageDown","ArrowUp","ArrowLeft"]},Ay="Slider",[lO,ZGe,eze]=F7(Ay),[sue]=im(Ay,[eze]),[tze,YR]=sue(Ay),oue=_.forwardRef((t,e)=>{const{name:n,min:r=0,max:i=100,step:s=1,orientation:o="horizontal",disabled:a=!1,minStepsBetweenThumbs:c=0,defaultValue:l=[r],value:d,onValueChange:h=()=>{},onValueCommit:m=()=>{},inverted:g=!1,form:y,...v}=t,E=_.useRef(new Set),w=_.useRef(0),x=o==="horizontal"?nze:rze,[C=[],R]=G7({prop:d,defaultProp:l,onChange:j=>{[...E.current][w.current]?.focus(),h(j)}}),T=_.useRef(C);function M(j){const $=cze(C,j);D(j,$)}function O(j){D(j,w.current)}function P(){const j=T.current[w.current];C[w.current]!==j&&m(C)}function D(j,$,{commit:q}={commit:!1}){const Y=fze(s),W=hze(Math.round((j-r)/s)*s+r,Y),H=tue(W,[r,i]);R((F=[])=>{const V=oze(F,H,$);if(dze(V,c*s)){w.current=V.indexOf(H);const G=String(V)!==String(F);return G&&q&&m(V),G?V:F}else return F})}return S.jsx(tze,{scope:t.__scopeSlider,name:n,disabled:a,min:r,max:i,valueIndexToChangeRef:w,thumbs:E.current,values:C,orientation:o,form:y,children:S.jsx(lO.Provider,{scope:t.__scopeSlider,children:S.jsx(lO.Slot,{scope:t.__scopeSlider,children:S.jsx(x,{"aria-disabled":a,"data-disabled":a?"":void 0,...v,ref:e,onPointerDown:yt(v.onPointerDown,()=>{a||(T.current=C)}),min:r,max:i,inverted:g,onSlideStart:a?void 0:M,onSlideMove:a?void 0:O,onSlideEnd:a?void 0:P,onHomeKeyDown:()=>!a&&D(r,0,{commit:!0}),onEndKeyDown:()=>!a&&D(i,C.length-1,{commit:!0}),onStepKeyDown:({event:j,direction:$})=>{if(!a){const W=nue.includes(j.key)||j.shiftKey&&rue.includes(j.key)?10:1,H=w.current,F=C[H],V=s*W*$;D(F+V,H,{commit:!0})}}})})})})});oue.displayName=Ay;var[aue,cue]=sue(Ay,{startEdge:"left",endEdge:"right",size:"width",direction:1}),nze=_.forwardRef((t,e)=>{const{min:n,max:r,dir:i,inverted:s,onSlideStart:o,onSlideMove:a,onSlideEnd:c,onStepKeyDown:l,...d}=t,[h,m]=_.useState(null),g=_r(e,x=>m(x)),y=_.useRef(void 0),v=$7(i),E=v==="ltr",w=E&&!s||!E&&s;function k(x){const C=y.current||h.getBoundingClientRect(),R=[0,C.width],M=M9(R,w?[n,r]:[r,n]);return y.current=C,M(x-C.left)}return S.jsx(aue,{scope:t.__scopeSlider,startEdge:w?"left":"right",endEdge:w?"right":"left",direction:w?1:-1,size:"width",children:S.jsx(lue,{dir:v,"data-orientation":"horizontal",...d,ref:g,style:{...d.style,"--radix-slider-thumb-transform":"translateX(-50%)"},onSlideStart:x=>{const C=k(x.clientX);o?.(C)},onSlideMove:x=>{const C=k(x.clientX);a?.(C)},onSlideEnd:()=>{y.current=void 0,c?.()},onStepKeyDown:x=>{const R=iue[w?"from-left":"from-right"].includes(x.key);l?.({event:x,direction:R?-1:1})}})})}),rze=_.forwardRef((t,e)=>{const{min:n,max:r,inverted:i,onSlideStart:s,onSlideMove:o,onSlideEnd:a,onStepKeyDown:c,...l}=t,d=_.useRef(null),h=_r(e,d),m=_.useRef(void 0),g=!i;function y(v){const E=m.current||d.current.getBoundingClientRect(),w=[0,E.height],x=M9(w,g?[r,n]:[n,r]);return m.current=E,x(v-E.top)}return S.jsx(aue,{scope:t.__scopeSlider,startEdge:g?"bottom":"top",endEdge:g?"top":"bottom",size:"height",direction:g?1:-1,children:S.jsx(lue,{"data-orientation":"vertical",...l,ref:h,style:{...l.style,"--radix-slider-thumb-transform":"translateY(50%)"},onSlideStart:v=>{const E=y(v.clientY);s?.(E)},onSlideMove:v=>{const E=y(v.clientY);o?.(E)},onSlideEnd:()=>{m.current=void 0,a?.()},onStepKeyDown:v=>{const w=iue[g?"from-bottom":"from-top"].includes(v.key);c?.({event:v,direction:w?-1:1})}})})}),lue=_.forwardRef((t,e)=>{const{__scopeSlider:n,onSlideStart:r,onSlideMove:i,onSlideEnd:s,onHomeKeyDown:o,onEndKeyDown:a,onStepKeyDown:c,...l}=t,d=YR(Ay,n);return S.jsx(_S.span,{...l,ref:e,onKeyDown:yt(t.onKeyDown,h=>{h.key==="Home"?(o(h),h.preventDefault()):h.key==="End"?(a(h),h.preventDefault()):nue.concat(rue).includes(h.key)&&(c(h),h.preventDefault())}),onPointerDown:yt(t.onPointerDown,h=>{const m=h.target;m.setPointerCapture(h.pointerId),h.preventDefault(),d.thumbs.has(m)?m.focus():r(h)}),onPointerMove:yt(t.onPointerMove,h=>{h.target.hasPointerCapture(h.pointerId)&&i(h)}),onPointerUp:yt(t.onPointerUp,h=>{const m=h.target;m.hasPointerCapture(h.pointerId)&&(m.releasePointerCapture(h.pointerId),s(h))})})}),uue="SliderTrack",due=_.forwardRef((t,e)=>{const{__scopeSlider:n,...r}=t,i=YR(uue,n);return S.jsx(_S.span,{"data-disabled":i.disabled?"":void 0,"data-orientation":i.orientation,...r,ref:e})});due.displayName=uue;var uO="SliderRange",fue=_.forwardRef((t,e)=>{const{__scopeSlider:n,...r}=t,i=YR(uO,n),s=cue(uO,n),o=_.useRef(null),a=_r(e,o),c=i.values.length,l=i.values.map(m=>mue(m,i.min,i.max)),d=c>1?Math.min(...l):0,h=100-Math.max(...l);return S.jsx(_S.span,{"data-orientation":i.orientation,"data-disabled":i.disabled?"":void 0,...r,ref:a,style:{...t.style,[s.startEdge]:d+"%",[s.endEdge]:h+"%"}})});fue.displayName=uO;var dO="SliderThumb",hue=_.forwardRef((t,e)=>{const n=ZGe(t.__scopeSlider),[r,i]=_.useState(null),s=_r(e,a=>i(a)),o=_.useMemo(()=>r?n().findIndex(a=>a.ref.current===r):-1,[n,r]);return S.jsx(ize,{...t,ref:s,index:o})}),ize=_.forwardRef((t,e)=>{const{__scopeSlider:n,index:r,name:i,...s}=t,o=YR(dO,n),a=cue(dO,n),[c,l]=_.useState(null),d=_r(e,k=>l(k)),h=c?o.form||!!c.closest("form"):!0,m=nre(c),g=o.values[r],y=g===void 0?0:mue(g,o.min,o.max),v=aze(r,o.values.length),E=m?.[a.size],w=E?lze(E,y,a.direction):0;return _.useEffect(()=>{if(c)return o.thumbs.add(c),()=>{o.thumbs.delete(c)}},[c,o.thumbs]),S.jsxs("span",{style:{transform:"var(--radix-slider-thumb-transform)",position:"absolute",[a.startEdge]:`calc(${y}% + ${w}px)`},children:[S.jsx(lO.ItemSlot,{scope:t.__scopeSlider,children:S.jsx(_S.span,{role:"slider","aria-label":t["aria-label"]||v,"aria-valuemin":o.min,"aria-valuenow":g,"aria-valuemax":o.max,"aria-orientation":o.orientation,"data-orientation":o.orientation,"data-disabled":o.disabled?"":void 0,tabIndex:o.disabled?void 0:0,...s,ref:d,style:g===void 0?{display:"none"}:t.style,onFocus:yt(t.onFocus,()=>{o.valueIndexToChangeRef.current=r})})}),h&&S.jsx(pue,{name:i??(o.name?o.name+(o.values.length>1?"[]":""):void 0),form:o.form,value:g},r)]})});hue.displayName=dO;var sze="RadioBubbleInput",pue=_.forwardRef(({__scopeSlider:t,value:e,...n},r)=>{const i=_.useRef(null),s=_r(i,r),o=XGe(e);return _.useEffect(()=>{const a=i.current;if(!a)return;const c=window.HTMLInputElement.prototype,d=Object.getOwnPropertyDescriptor(c,"value").set;if(o!==e&&d){const h=new Event("input",{bubbles:!0});d.call(a,e),a.dispatchEvent(h)}},[o,e]),S.jsx(_S.input,{style:{display:"none"},...n,ref:s,defaultValue:e})});pue.displayName=sze;function oze(t=[],e,n){const r=[...t];return r[n]=e,r.sort((i,s)=>i-s)}function mue(t,e,n){const s=100/(n-e)*(t-e);return tue(s,[0,100])}function aze(t,e){return e>2?`Value ${t+1} of ${e}`:e===2?["Minimum","Maximum"][t]:void 0}function cze(t,e){if(t.length===1)return 0;const n=t.map(i=>Math.abs(i-e)),r=Math.min(...n);return n.indexOf(r)}function lze(t,e,n){const r=t/2,s=M9([0,50],[0,r]);return(r-s(e)*n)*n}function uze(t){return t.slice(0,-1).map((e,n)=>t[n+1]-e)}function dze(t,e){if(e>0){const n=uze(t);return Math.min(...n)>=e}return!0}function M9(t,e){return n=>{if(t[0]===t[1]||e[0]===e[1])return e[0];const r=(e[1]-e[0])/(t[1]-t[0]);return e[0]+r*(n-t[0])}}function fze(t){return(String(t).split(".")[1]||"").length}function hze(t,e){const n=Math.pow(10,e);return Math.round(t*n)/n}var pze=oue,mze=due,gze=fue,vze=hue;const yze="_slider_15go1_8",bze="_track_15go1_14",_ze="_highlight_15go1_31",Sze="_handle_15go1_43",Jw={slider:yze,track:bze,highlight:_ze,handle:Sze},L9=({className:t,label:e,value:n,onValueChange:r,onValueCommit:i,min:s,max:o,step:a,disabled:c})=>{const l=_.useCallback(([h])=>r(h),[r]),d=_.useCallback(([h])=>i?.(h),[i]);return S.jsxs(pze,{className:Le(t,Jw.slider),value:[n],onValueChange:l,onValueCommit:d,min:s,max:o,step:a,disabled:c,children:[S.jsx(mze,{className:Jw.track,children:S.jsx(gze,{className:Jw.highlight})}),S.jsx(mi,{placement:"top",label:Math.round(n*100).toString()+"%",children:S.jsx(vze,{className:Jw.handle,"aria-label":e})})]})},wze="_selection_1akwb_1",Eze="_title_1akwb_5",Cze="_separator_1akwb_10",Tze="_options_1akwb_14",Rze="_secondary_1akwb_20",g1={selection:wze,title:Eze,separator:Cze,options:Tze,secondary:Rze},l5=({device:t,title:e,numberedLabel:n})=>{const{t:r}=ze(),i=_.useId(),s=So(t.available$),o=So(t.selected$)?.id,a=_.useCallback(c=>{t.select(c.target.value)},[t]);return s.size<=1?null:S.jsxs("div",{className:g1.selection,children:[S.jsx(qc,{type:"body",weight:"semibold",size:"sm",as:"h4",className:g1.title,children:e}),S.jsx(j8,{className:g1.separator}),S.jsx("div",{className:g1.options,children:[...s].map(([c,l])=>{let d;switch(l.type){case"name":d=l.name;break;case"number":d=n(l.number);break;case"default":d=l.name===null?r("settings.devices.default"):S.jsxs(bo,{i18nKey:"settings.devices.default_named",name:l.name,children:["Default"," ",S.jsxs("span",{className:g1.secondary,children:["(",{name:l.name},")"]})]});break;case"speaker":d=r("settings.devices.loudspeaker");break;case"earpiece":d=r("settings.devices.handset");break}return S.jsx(tC,{name:i,control:S.jsx(eC,{checked:c===o,onChange:a,value:c}),children:S.jsx(cb,{children:d})},c)})})]})};var Kv=typeof self<"u"?self:{};function E_(t,e){e:{for(var n=["CLOSURE_FLAGS"],r=Kv,i=0;i<n.length;i++)if((r=r[n[i]])==null){n=null;break e}n=r}return(t=n&&n[t])!=null?t:e}function Gh(){throw Error("Invalid UTF8")}function Lz(t,e){return e=String.fromCharCode.apply(null,e),t==null?e:t+e}let Xw,u5;const kze=typeof TextDecoder<"u";let Ize;const xze=typeof TextEncoder<"u";function gue(t){if(xze)t=(Ize||=new TextEncoder).encode(t);else{let n=0;const r=new Uint8Array(3*t.length);for(let i=0;i<t.length;i++){var e=t.charCodeAt(i);if(e<128)r[n++]=e;else{if(e<2048)r[n++]=e>>6|192;else{if(e>=55296&&e<=57343){if(e<=56319&&i<t.length){const s=t.charCodeAt(++i);if(s>=56320&&s<=57343){e=1024*(e-55296)+s-56320+65536,r[n++]=e>>18|240,r[n++]=e>>12&63|128,r[n++]=e>>6&63|128,r[n++]=63&e|128;continue}i--}e=65533}r[n++]=e>>12|224,r[n++]=e>>6&63|128}r[n++]=63&e|128}}t=n===r.length?r:r.subarray(0,n)}return t}function vue(t){Kv.setTimeout((()=>{throw t}),0)}var fO,Aze=E_(610401301,!1),Oz=E_(748402147,!0),O9=E_(824648567,!0),P9=E_(824656860,E_(1,!0));function Pz(){var t=Kv.navigator;return t&&(t=t.userAgent)?t:""}const Dz=Kv.navigator;function JR(t){return JR[" "](t),t}fO=Dz&&Dz.userAgentData||null,JR[" "]=function(){};const yue={};let $1=null;function Mze(t){const e=t.length;let n=3*e/4;n%3?n=Math.floor(n):"=.".indexOf(t[e-1])!=-1&&(n="=.".indexOf(t[e-2])!=-1?n-2:n-1);const r=new Uint8Array(n);let i=0;return(function(s,o){function a(l){for(;c<s.length;){const d=s.charAt(c++),h=$1[d];if(h!=null)return h;if(!/^[\s\xa0]*$/.test(d))throw Error("Unknown base64 encoding at char: "+d)}return l}bue();let c=0;for(;;){const l=a(-1),d=a(0),h=a(64),m=a(64);if(m===64&&l===-1)break;o(l<<2|d>>4),h!=64&&(o(d<<4&240|h>>2),m!=64&&o(h<<6&192|m))}})(t,(function(s){r[i++]=s})),i!==n?r.subarray(0,i):r}function bue(){if(!$1){$1={};var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789".split(""),e=["+/=","+/","-_=","-_.","-_"];for(let n=0;n<5;n++){const r=t.concat(e[n].split(""));yue[n]=r;for(let i=0;i<r.length;i++){const s=r[i];$1[s]===void 0&&($1[s]=i)}}}}var Lze=typeof Uint8Array<"u",_ue=!(!(Aze&&fO&&fO.brands.length>0)&&(Pz().indexOf("Trident")!=-1||Pz().indexOf("MSIE")!=-1))&&typeof btoa=="function";const Nz=/[-_.]/g,Oze={"-":"+",_:"/",".":"="};function Pze(t){return Oze[t]||""}function Sue(t){if(!_ue)return Mze(t);t=Nz.test(t)?t.replace(Nz,Pze):t,t=atob(t);const e=new Uint8Array(t.length);for(let n=0;n<t.length;n++)e[n]=t.charCodeAt(n);return e}function D9(t){return Lze&&t!=null&&t instanceof Uint8Array}var Gv={};function qp(){return Dze||=new Rl(null,Gv)}function N9(t){wue(Gv);var e=t.g;return(e=e==null||D9(e)?e:typeof e=="string"?Sue(e):null)==null?e:t.g=e}var Rl=class{h(){return new Uint8Array(N9(this)||0)}constructor(e,n){if(wue(n),this.g=e,e!=null&&e.length===0)throw Error("ByteString should be constructed with non-empty values")}};let Dze,Nze;function wue(t){if(t!==Gv)throw Error("illegal external caller")}function Eue(t,e){t.__closure__error__context__984382||(t.__closure__error__context__984382={}),t.__closure__error__context__984382.severity=e}function hO(t){return Eue(t=Error(t),"warning"),t}function zv(t,e){if(t!=null){var n=Nze??={},r=n[t]||0;r>=e||(n[t]=r+1,Eue(t=Error(),"incident"),vue(t))}}function My(){return typeof BigInt=="function"}var Ly=typeof Symbol=="function"&&typeof Symbol()=="symbol";function Hl(t,e,n=!1){return typeof Symbol=="function"&&typeof Symbol()=="symbol"?n&&Symbol.for&&t?Symbol.for(t):t!=null?Symbol(t):Symbol():e}var Uze=Hl("jas",void 0,!0),Uz=Hl(void 0,"0di"),v1=Hl(void 0,"1oa"),ta=Hl(void 0,Symbol()),jze=Hl(void 0,"0ub"),Fze=Hl(void 0,"0ubs"),pO=Hl(void 0,"0ubsb"),$ze=Hl(void 0,"0actk"),Wv=Hl("m_m","Pa",!0),jz=Hl();const Cue={Ga:{value:0,configurable:!0,writable:!0,enumerable:!1}},Tue=Object.defineProperties,Ye=Ly?Uze:"Ga";var mm;const Fz=[];function SS(t,e){Ly||Ye in t||Tue(t,Cue),t[Ye]|=e}function bi(t,e){Ly||Ye in t||Tue(t,Cue),t[Ye]=e}function wS(t){return SS(t,34),t}function C_(t){return SS(t,8192),t}bi(Fz,7),mm=Object.freeze(Fz);var Yv={};function aa(t,e){return e===void 0?t.h!==Vp&&!!(2&(0|t.v[Ye])):!!(2&e)&&t.h!==Vp}const Vp={};function U9(t,e){if(t!=null){if(typeof t=="string")t=t?new Rl(t,Gv):qp();else if(t.constructor!==Rl)if(D9(t))t=t.length?new Rl(new Uint8Array(t),Gv):qp();else{if(!e)throw Error();t=void 0}}return t}class $z{constructor(e,n,r){this.g=e,this.h=n,this.l=r}next(){const e=this.g.next();return e.done||(e.value=this.h.call(this.l,e.value)),e}[Symbol.iterator](){return this}}var Bze=Object.freeze({});function Rue(t,e,n){const r=128&e?0:-1,i=t.length;var s;(s=!!i)&&(s=(s=t[i-1])!=null&&typeof s=="object"&&s.constructor===Object);const o=i+(s?-1:0);for(e=128&e?1:0;e<o;e++)n(e-r,t[e]);if(s){t=t[i-1];for(const a in t)!isNaN(a)&&n(+a,t[a])}}var kue={};function Oy(t){return 128&t?kue:void 0}function XR(t){return t.Na=!0,t}var Hze=XR((t=>typeof t=="number")),Bz=XR((t=>typeof t=="string")),qze=XR((t=>typeof t=="boolean")),QR=typeof Kv.BigInt=="function"&&typeof Kv.BigInt(0)=="bigint";function na(t){var e=t;if(Bz(e)){if(!/^\s*(?:-?[1-9]\d*|0)?\s*$/.test(e))throw Error(String(e))}else if(Hze(e)&&!Number.isSafeInteger(e))throw Error(String(e));return QR?BigInt(t):t=qze(t)?t?"1":"0":Bz(t)?t.trim()||"0":String(t)}var mO=XR((t=>QR?t>=Kze&&t<=zze:t[0]==="-"?Hz(t,Vze):Hz(t,Gze)));const Vze=Number.MIN_SAFE_INTEGER.toString(),Kze=QR?BigInt(Number.MIN_SAFE_INTEGER):void 0,Gze=Number.MAX_SAFE_INTEGER.toString(),zze=QR?BigInt(Number.MAX_SAFE_INTEGER):void 0;function Hz(t,e){if(t.length>e.length)return!1;if(t.length<e.length||t===e)return!0;for(let n=0;n<t.length;n++){const r=t[n],i=e[n];if(r>i)return!1;if(r<i)return!0}}const Wze=typeof Uint8Array.prototype.slice=="function";let Yze,gr=0,Zr=0;function qz(t){const e=t>>>0;gr=e,Zr=(t-e)/4294967296>>>0}function Jv(t){if(t<0){qz(-t);const[e,n]=B9(gr,Zr);gr=e>>>0,Zr=n>>>0}else qz(t)}function j9(t){const e=Yze||=new DataView(new ArrayBuffer(8));e.setFloat32(0,+t,!0),Zr=0,gr=e.getUint32(0,!0)}function gO(t,e){const n=4294967296*e+(t>>>0);return Number.isSafeInteger(n)?n:T_(t,e)}function Jze(t,e){return na(My()?BigInt.asUintN(64,(BigInt(e>>>0)<<BigInt(32))+BigInt(t>>>0)):T_(t,e))}function F9(t,e){const n=2147483648&e;return n&&(e=~e>>>0,(t=1+~t>>>0)==0&&(e=e+1>>>0)),typeof(t=gO(t,e))=="number"?n?-t:t:n?"-"+t:t}function Iue(t,e){return My()?na(BigInt.asIntN(64,(BigInt.asUintN(32,BigInt(e))<<BigInt(32))+BigInt.asUintN(32,BigInt(t)))):na($9(t,e))}function T_(t,e){if(t>>>=0,(e>>>=0)<=2097151)var n=""+(4294967296*e+t);else My()?n=""+(BigInt(e)<<BigInt(32)|BigInt(t)):(t=(16777215&t)+6777216*(n=16777215&(t>>>24|e<<8))+6710656*(e=e>>16&65535),n+=8147497*e,e*=2,t>=1e7&&(n+=t/1e7>>>0,t%=1e7),n>=1e7&&(e+=n/1e7>>>0,n%=1e7),n=e+Vz(n)+Vz(t));return n}function Vz(t){return t=String(t),"0000000".slice(t.length)+t}function $9(t,e){if(2147483648&e)if(My())t=""+(BigInt(0|e)<<BigInt(32)|BigInt(t>>>0));else{const[n,r]=B9(t,e);t="-"+T_(n,r)}else t=T_(t,e);return t}function ZR(t){if(t.length<16)Jv(Number(t));else if(My())t=BigInt(t),gr=Number(t&BigInt(4294967295))>>>0,Zr=Number(t>>BigInt(32)&BigInt(4294967295));else{const e=+(t[0]==="-");Zr=gr=0;const n=t.length;for(let r=e,i=(n-e)%6+e;i<=n;r=i,i+=6){const s=Number(t.slice(r,i));Zr*=1e6,gr=1e6*gr+s,gr>=4294967296&&(Zr+=Math.trunc(gr/4294967296),Zr>>>=0,gr>>>=0)}if(e){const[r,i]=B9(gr,Zr);gr=r,Zr=i}}}function B9(t,e){return e=~e,t?t=1+~t:e+=1,[t,e]}function Uc(t){return Array.prototype.slice.call(t)}const ES=typeof BigInt=="function"?BigInt.asIntN:void 0,Xze=typeof BigInt=="function"?BigInt.asUintN:void 0,Kp=Number.isSafeInteger,e4=Number.isFinite,Xv=Math.trunc,Qze=na(0);function B1(t){if(t!=null&&typeof t!="number")throw Error(`Value of float/double field must be a number, found ${typeof t}: ${t}`);return t}function _l(t){return t==null||typeof t=="number"?t:t==="NaN"||t==="Infinity"||t==="-Infinity"?Number(t):void 0}function R_(t){if(t!=null&&typeof t!="boolean"){var e=typeof t;throw Error(`Expected boolean but got ${e!="object"?e:t?Array.isArray(t)?"array":e:"null"}: ${t}`)}return t}function xue(t){return t==null||typeof t=="boolean"?t:typeof t=="number"?!!t:void 0}const Zze=/^-?([1-9][0-9]*|0)(\.[0-9]+)?$/;function CS(t){switch(typeof t){case"bigint":return!0;case"number":return e4(t);case"string":return Zze.test(t);default:return!1}}function Py(t){if(t==null)return t;if(typeof t=="string"&&t)t=+t;else if(typeof t!="number")return;return e4(t)?0|t:void 0}function Aue(t){if(t==null)return t;if(typeof t=="string"&&t)t=+t;else if(typeof t!="number")return;return e4(t)?t>>>0:void 0}function Mue(t){const e=t.length;return(t[0]==="-"?e<20||e===20&&t<="-9223372036854775808":e<19||e===19&&t<="9223372036854775807")?t:(ZR(t),$9(gr,Zr))}function H9(t){return t=Xv(t),Kp(t)||(Jv(t),t=F9(gr,Zr)),t}function Lue(t){var e=Xv(Number(t));return Kp(e)?String(e):((e=t.indexOf("."))!==-1&&(t=t.substring(0,e)),Mue(t))}function Oue(t){var e=Xv(Number(t));return Kp(e)?na(e):((e=t.indexOf("."))!==-1&&(t=t.substring(0,e)),My()?na(ES(64,BigInt(t))):na(Mue(t)))}function Pue(t){return Kp(t)?t=na(H9(t)):(t=Xv(t),Kp(t)?t=String(t):(Jv(t),t=$9(gr,Zr)),t=na(t)),t}function eWe(t){return t==null?t:typeof t=="bigint"?(mO(t)?t=Number(t):(t=ES(64,t),t=mO(t)?Number(t):String(t)),t):CS(t)?typeof t=="number"?H9(t):Lue(t):void 0}function G3(t){const e=typeof t;return t==null?t:e==="bigint"?na(ES(64,t)):CS(t)?e==="string"?Oue(t):Pue(t):void 0}function Due(t){if(typeof t!="string")throw Error();return t}function TS(t){if(t!=null&&typeof t!="string")throw Error();return t}function as(t){return t==null||typeof t=="string"?t:void 0}function q9(t,e,n,r){return t!=null&&t[Wv]===Yv?t:Array.isArray(t)?((r=(n=0|t[Ye])|32&r|2&r)!==n&&bi(t,r),new e(t)):(n?2&r?((t=e[Uz])||(wS((t=new e).v),t=e[Uz]=t),e=t):e=new e:e=void 0,e)}function tWe(t,e,n){if(e)e:{if(!CS(e=t))throw hO("int64");switch(typeof e){case"string":e=Oue(e);break e;case"bigint":e=na(ES(64,e));break e;default:e=Pue(e)}}else e=G3(t);return(t=e)==null?n?Qze:void 0:t}const nWe={};let rWe=(function(){try{return JR(new class extends Map{constructor(){super()}}),!1}catch{return!0}})();class d5{constructor(){this.g=new Map}get(e){return this.g.get(e)}set(e,n){return this.g.set(e,n),this.size=this.g.size,this}delete(e){return e=this.g.delete(e),this.size=this.g.size,e}clear(){this.g.clear(),this.size=this.g.size}has(e){return this.g.has(e)}entries(){return this.g.entries()}keys(){return this.g.keys()}values(){return this.g.values()}forEach(e,n){return this.g.forEach(e,n)}[Symbol.iterator](){return this.entries()}}const iWe=rWe?(Object.setPrototypeOf(d5.prototype,Map.prototype),Object.defineProperties(d5.prototype,{size:{value:0,configurable:!0,enumerable:!0,writable:!0}}),d5):class extends Map{constructor(){super()}};function Kz(t){return t}function f5(t){if(2&t.J)throw Error("Cannot mutate an immutable Map")}var id=class extends iWe{constructor(e,n,r=Kz,i=Kz){super(),this.J=0|e[Ye],this.K=n,this.S=r,this.fa=this.K?sWe:i;for(let s=0;s<e.length;s++){const o=e[s],a=r(o[0],!1,!0);let c=o[1];n?c===void 0&&(c=null):c=i(o[1],!1,!0,void 0,void 0,this.J),super.set(a,c)}}V(e){return C_(Array.from(super.entries(),e))}clear(){f5(this),super.clear()}delete(e){return f5(this),super.delete(this.S(e,!0,!1))}entries(){if(this.K){var e=super.keys();e=new $z(e,oWe,this)}else e=super.entries();return e}values(){if(this.K){var e=super.keys();e=new $z(e,id.prototype.get,this)}else e=super.values();return e}forEach(e,n){this.K?super.forEach(((r,i,s)=>{e.call(n,s.get(i),i,s)})):super.forEach(e,n)}set(e,n){return f5(this),(e=this.S(e,!0,!1))==null?this:n==null?(super.delete(e),this):super.set(e,this.fa(n,!0,!0,this.K,!1,this.J))}Ma(e){const n=this.S(e[0],!1,!0);e=e[1],e=this.K?e===void 0?null:e:this.fa(e,!1,!0,void 0,!1,this.J),super.set(n,e)}has(e){return super.has(this.S(e,!1,!1))}get(e){e=this.S(e,!1,!1);const n=super.get(e);if(n!==void 0){var r=this.K;return r?((r=this.fa(n,!1,!0,r,this.ra,this.J))!==n&&super.set(e,r),r):n}}[Symbol.iterator](){return this.entries()}};function sWe(t,e,n,r,i,s){return t=q9(t,r,n,s),i&&(t=K9(t)),t}function oWe(t){return[t,this.get(t)]}let aWe;function Gz(){return aWe||=new id(wS([]),void 0,void 0,void 0,nWe)}function t4(t){return ta?t[ta]:void 0}function z3(t,e){for(const n in t)!isNaN(n)&&e(t,+n,t[n])}id.prototype.toJSON=void 0;var vO=class{};const cWe={Ka:!0};function lWe(t,e){e<100||zv(Fze,1)}function n4(t,e,n,r){const i=r!==void 0;r=!!r;var s,o=ta;!i&&Ly&&o&&(s=t[o])&&z3(s,lWe),o=[];var a=t.length;let c;s=4294967295;let l=!1;const d=!!(64&e),h=d?128&e?0:-1:void 0;1&e||(c=a&&t[a-1],c!=null&&typeof c=="object"&&c.constructor===Object?s=--a:c=void 0,!d||128&e||i||(l=!0,s=s-h+h)),e=void 0;for(var m=0;m<a;m++){let g=t[m];if(g!=null&&(g=n(g,r))!=null)if(d&&m>=s){const y=m-h;(e??={})[y]=g}else o[m]=g}if(c)for(let g in c){if((a=c[g])==null||(a=n(a,r))==null)continue;let y;m=+g,d&&!Number.isNaN(m)&&(y=m+h)<s?o[y]=a:(e??={})[g]=a}return e&&(l?o.push(e):o[s]=e),i&&ta&&(t=t4(t))&&t instanceof vO&&(o[ta]=(function(g){const y=new vO;return z3(g,((v,E,w)=>{y[E]=Uc(w)})),y.da=g.da,y})(t)),o}function uWe(t){return t[0]=k_(t[0]),t[1]=k_(t[1]),t}function k_(t){switch(typeof t){case"number":return Number.isFinite(t)?t:""+t;case"bigint":return mO(t)?Number(t):""+t;case"boolean":return t?1:0;case"object":if(Array.isArray(t)){var e=0|t[Ye];return t.length===0&&1&e?void 0:n4(t,e,k_)}if(t!=null&&t[Wv]===Yv)return Nue(t);if(t instanceof Rl){if((e=t.g)==null)t="";else if(typeof e=="string")t=e;else{if(_ue){for(var n="",r=0,i=e.length-10240;r<i;)n+=String.fromCharCode.apply(null,e.subarray(r,r+=10240));n+=String.fromCharCode.apply(null,r?e.subarray(r):e),e=btoa(n)}else{n===void 0&&(n=0),bue(),n=yue[n],r=Array(Math.floor(e.length/3)),i=n[64]||"";let l=0,d=0;for(;l<e.length-2;l+=3){var s=e[l],o=e[l+1],a=e[l+2],c=n[s>>2];s=n[(3&s)<<4|o>>4],o=n[(15&o)<<2|a>>6],a=n[63&a],r[d++]=c+s+o+a}switch(c=0,a=i,e.length-l){case 2:a=n[(15&(c=e[l+1]))<<2]||i;case 1:e=e[l],r[d]=n[e>>2]+n[(3&e)<<4|c>>4]+a+i}e=r.join("")}t=t.g=e}return t}return t instanceof id?t=t.size!==0?t.V(uWe):void 0:void 0}return t}function Nue(t){return n4(t=t.v,0|t[Ye],k_)}let dWe,fWe;function Sp(t,e){return Uue(t,e[0],e[1])}function Uue(t,e,n,r=0){if(t==null){var i=32;n?(t=[n],i|=128):t=[],e&&(i=-16760833&i|(1023&e)<<14)}else{if(!Array.isArray(t))throw Error("narr");if(i=0|t[Ye],Oz&&1&i)throw Error("rfarr");if(2048&i&&!(2&i)&&(function(){if(Oz)throw Error("carr");zv($ze,5)})(),256&i)throw Error("farr");if(64&i)return(i|r)!==i&&bi(t,i|r),t;if(n&&(i|=128,n!==t[0]))throw Error("mid");e:{i|=64;var s=(n=t).length;if(s){var o=s-1;const c=n[o];if(c!=null&&typeof c=="object"&&c.constructor===Object){if((o-=e=128&i?0:-1)>=1024)throw Error("pvtlmt");for(var a in c)(s=+a)<o&&(n[s+e]=c[a],delete c[a]);i=-16760833&i|(1023&o)<<14;break e}}if(e){if((a=Math.max(e,s-(128&i?0:-1)))>1024)throw Error("spvt");i=-16760833&i|(1023&a)<<14}}}return bi(t,64|i|r),t}function hWe(t,e){if(typeof t!="object")return t;if(Array.isArray(t)){var n=0|t[Ye];return t.length===0&&1&n?void 0:zz(t,n,e)}if(t!=null&&t[Wv]===Yv)return Wz(t);if(t instanceof id){if(2&(e=t.J))return t;if(!t.size)return;if(n=wS(t.V()),t.K)for(t=0;t<n.length;t++){const r=n[t];let i=r[1];i=i==null||typeof i!="object"?void 0:i!=null&&i[Wv]===Yv?Wz(i):Array.isArray(i)?zz(i,0|i[Ye],!!(32&e)):void 0,r[1]=i}return n}return t instanceof Rl?t:void 0}function zz(t,e,n){return 2&e||(!n||4096&e||16&e?t=Dy(t,e,!1,n&&!(16&e)):(SS(t,34),4&e&&Object.freeze(t))),t}function V9(t,e,n){return t=new t.constructor(e),n&&(t.h=Vp),t.m=Vp,t}function Wz(t){const e=t.v,n=0|e[Ye];return aa(t,n)?t:G9(t,e,n)?V9(t,e):Dy(e,n)}function Dy(t,e,n,r){return r??=!!(34&e),t=n4(t,e,hWe,r),r=32,n&&(r|=2),bi(t,e=16769217&e|r),t}function K9(t){const e=t.v,n=0|e[Ye];return aa(t,n)?G9(t,e,n)?V9(t,e,!0):new t.constructor(Dy(e,n,!1)):t}function Ny(t){if(t.h!==Vp)return!1;var e=t.v;return SS(e=Dy(e,0|e[Ye]),2048),t.v=e,t.h=void 0,t.m=void 0,!0}function Uy(t){if(!Ny(t)&&aa(t,0|t.v[Ye]))throw Error()}function gm(t,e){e===void 0&&(e=0|t[Ye]),32&e&&!(4096&e)&&bi(t,4096|e)}function G9(t,e,n){return!!(2&n)||!(!(32&n)||4096&n)&&(bi(e,2|n),t.h=Vp,!0)}const pWe=na(0),Wd={};function lr(t,e,n,r,i){if((e=sd(t.v,e,n,i))!==null||r&&t.m!==Vp)return e}function sd(t,e,n,r){if(e===-1)return null;const i=e+(n?0:-1),s=t.length-1;let o,a;if(!(s<1+(n?0:-1))){if(i>=s)if(o=t[s],o!=null&&typeof o=="object"&&o.constructor===Object)n=o[e],a=!0;else{if(i!==s)return;n=o}else n=t[i];if(r&&n!=null){if((r=r(n))==null)return r;if(!Object.is(r,n))return a?o[e]=r:t[i]=r,r}return n}}function xn(t,e,n,r){Uy(t),gi(t=t.v,0|t[Ye],e,n,r)}function gi(t,e,n,r,i){const s=n+(i?0:-1);var o=t.length-1;if(o>=1+(i?0:-1)&&s>=o){const a=t[o];if(a!=null&&typeof a=="object"&&a.constructor===Object)return a[n]=r,e}return s<=o?(t[s]=r,e):(r!==void 0&&(n>=(o=(e??=0|t[Ye])>>14&1023||536870912)?r!=null&&(t[o+(i?0:-1)]={[n]:r}):t[s]=r),e)}function lp(){return Bze===void 0?2:4}function up(t,e,n,r,i){let s=t.v,o=0|s[Ye];r=aa(t,o)?1:r,i=!!i||r===3,r===2&&Ny(t)&&(s=t.v,o=0|s[Ye]);let a=(t=z9(s,e))===mm?7:0|t[Ye],c=W9(a,o);var l=!(4&c);if(l){4&c&&(t=Uc(t),a=0,c=Ep(c,o),o=gi(s,o,e,t));let d=0,h=0;for(;d<t.length;d++){const m=n(t[d]);m!=null&&(t[h++]=m)}h<d&&(t.length=h),n=-513&(4|c),c=n&=-1025,c&=-4097}return c!==a&&(bi(t,c),2&c&&Object.freeze(t)),jue(t,c,s,o,e,r,l,i)}function jue(t,e,n,r,i,s,o,a){let c=e;return s===1||s===4&&(2&e||!(16&e)&&32&r)?wp(e)||((e|=!t.length||o&&!(4096&e)||32&r&&!(4096&e||16&e)?2:256)!==c&&bi(t,e),Object.freeze(t)):(s===2&&wp(e)&&(t=Uc(t),c=0,e=Ep(e,r),r=gi(n,r,i,t)),wp(e)||(a||(e|=16),e!==c&&bi(t,e))),2&e||!(4096&e||16&e)||gm(n,r),t}function z9(t,e,n){return t=sd(t,e,n),Array.isArray(t)?t:mm}function W9(t,e){return 2&e&&(t|=2),1|t}function wp(t){return!!(2&t)&&!!(4&t)||!!(256&t)}function Fue(t){return U9(t,!0)}function $ue(t){t=Uc(t);for(let e=0;e<t.length;e++){const n=t[e]=Uc(t[e]);Array.isArray(n[1])&&(n[1]=wS(n[1]))}return C_(t)}function hf(t,e,n,r){Uy(t),gi(t=t.v,0|t[Ye],e,(r==="0"?Number(n)===0:n===r)?void 0:n)}function jy(t,e,n){if(2&e)throw Error();const r=Oy(e);let i=z9(t,n,r),s=i===mm?7:0|i[Ye],o=W9(s,e);return(2&o||wp(o)||16&o)&&(o===s||wp(o)||bi(i,o),i=Uc(i),s=0,o=Ep(o,e),gi(t,e,n,i,r)),o&=-13,o!==s&&bi(i,o),i}function h5(t,e){var n=Lde;return J9(Y9(t=t.v),t,void 0,n)===e?e:-1}function Y9(t){if(Ly)return t[v1]??(t[v1]=new Map);if(v1 in t)return t[v1];const e=new Map;return Object.defineProperty(t,v1,{value:e}),e}function Bue(t,e,n,r,i){const s=Y9(t),o=J9(s,t,e,n,i);return o!==r&&(o&&(e=gi(t,e,o,void 0,i)),s.set(n,r)),e}function J9(t,e,n,r,i){let s=t.get(r);if(s!=null)return s;s=0;for(let o=0;o<r.length;o++){const a=r[o];sd(e,a,i)!=null&&(s!==0&&(n=gi(e,n,s,void 0,i)),s=a)}return t.set(r,s),s}function X9(t,e,n){let r=0|t[Ye];const i=Oy(r),s=sd(t,n,i);let o;if(s!=null&&s[Wv]===Yv){if(!aa(s))return Ny(s),s.v;o=s.v}else Array.isArray(s)&&(o=s);if(o){const a=0|o[Ye];2&a&&(o=Dy(o,a))}return o=Sp(o,e),o!==s&&gi(t,r,n,o,i),o}function Hue(t,e,n,r,i){let s=!1;if((r=sd(t,r,i,(o=>{const a=q9(o,n,!1,e);return s=a!==o&&a!=null,a})))!=null)return s&&!aa(r)&&gm(t,e),r}function an(t,e,n,r){let i=t.v,s=0|i[Ye];if((e=Hue(i,s,e,n,r))==null)return e;if(s=0|i[Ye],!aa(t,s)){const o=K9(e);o!==e&&(Ny(t)&&(i=t.v,s=0|i[Ye]),s=gi(i,s,n,e=o,r),gm(i,s))}return e}function que(t,e,n,r,i,s,o,a){var c=aa(t,n);s=c?1:s,o=!!o||s===3,c=a&&!c,(s===2||c)&&Ny(t)&&(n=0|(e=t.v)[Ye]);var l=(t=z9(e,i))===mm?7:0|t[Ye],d=W9(l,n);if(a=!(4&d)){var h=t,m=n;const g=!!(2&d);g&&(m|=2);let y=!g,v=!0,E=0,w=0;for(;E<h.length;E++){const k=q9(h[E],r,!1,m);if(k instanceof r){if(!g){const x=aa(k);y&&=!x,v&&=x}h[w++]=k}}w<E&&(h.length=w),d|=4,d=v?-4097&d:4096|d,d=y?8|d:-9&d}if(d!==l&&(bi(t,d),2&d&&Object.freeze(t)),c&&!(8&d||!t.length&&(s===1||s===4&&(2&d||!(16&d)&&32&n)))){for(wp(d)&&(t=Uc(t),d=Ep(d,n),n=gi(e,n,i,t)),r=t,c=d,l=0;l<r.length;l++)(h=r[l])!==(d=K9(h))&&(r[l]=d);c|=8,bi(t,d=c=r.length?4096|c:-4097&c)}return jue(t,d,e,n,i,s,a,o)}function od(t,e,n){const r=t.v;return que(t,r,0|r[Ye],e,n,lp(),!1,!0)}function Vue(t){return t==null&&(t=void 0),t}function lt(t,e,n,r,i){return xn(t,n,r=Vue(r),i),r&&!aa(r)&&gm(t.v),t}function yb(t,e,n,r){e:{var i=r=Vue(r);Uy(t);const s=t.v;let o=0|s[Ye];if(i==null){const a=Y9(s);if(J9(a,s,o,n)!==e)break e;a.set(n,0)}else o=Bue(s,o,n,e);gi(s,o,e,i)}r&&!aa(r)&&gm(t.v)}function Ep(t,e){return-273&(2&e?2|t:-3&t)}function Q9(t,e,n,r){var i=r;Uy(t),t=que(t,r=t.v,0|r[Ye],n,e,2,!0),i=i??new n,t.push(i),e=n=t===mm?7:0|t[Ye],(i=aa(i))?(n&=-9,t.length===1&&(n&=-4097)):n|=4096,n!==e&&bi(t,n),i||gm(r)}function za(t,e,n){return Py(lr(t,e,void 0,n))}function Kue(t){return(P9?lr(t,2,void 0,void 0,G3):G3(lr(t,2)))??pWe}function Nr(t,e){return lr(t,e,void 0,void 0,_l)??0}function ad(t,e,n){if(n!=null){if(typeof n!="number"||!e4(n))throw hO("int32");n|=0}xn(t,e,n)}function tt(t,e,n){xn(t,e,B1(n))}function ca(t,e,n){hf(t,e,TS(n),"")}function W3(t,e,n){{Uy(t);const o=t.v;let a=0|o[Ye];if(n==null)gi(o,a,e);else{var r=t=n===mm?7:0|n[Ye],i=wp(t),s=i||Object.isFrozen(n);for(i||(t=0),s||(n=Uc(n),r=0,t=Ep(t,a),s=!1),t|=5,t|=(4&t?512&t?512:1024&t?1024:0:void 0)??(P9?1024:0),i=0;i<n.length;i++){const c=n[i],l=Due(c);Object.is(c,l)||(s&&(n=Uc(n),r=0,t=Ep(t,a),s=!1),n[i]=l)}t!==r&&(s&&(n=Uc(n),t=Ep(t,a)),bi(n,t)),gi(o,a,e,n)}}}function r4(t,e,n){Uy(t),up(t,e,as,2,!0).push(Due(n))}var wg=class{constructor(t,e,n){if(this.buffer=t,n&&!e)throw Error();this.g=e}};function Z9(t,e){if(typeof t=="string")return new wg(Sue(t),e);if(Array.isArray(t))return new wg(new Uint8Array(t),e);if(t.constructor===Uint8Array)return new wg(t,!1);if(t.constructor===ArrayBuffer)return t=new Uint8Array(t),new wg(t,!1);if(t.constructor===Rl)return e=N9(t)||new Uint8Array(0),new wg(e,!0,t);if(t instanceof Uint8Array)return t=t.constructor===Uint8Array?t:new Uint8Array(t.buffer,t.byteOffset,t.byteLength),new wg(t,!1);throw Error()}function Qv(t,e){let n,r=0,i=0,s=0;const o=t.h;let a=t.g;do n=o[a++],r|=(127&n)<<s,s+=7;while(s<32&&128&n);if(s>32)for(i|=(127&n)>>4,s=3;s<32&&128&n;s+=7)n=o[a++],i|=(127&n)<<s;if(Cp(t,a),!(128&n))return e(r>>>0,i>>>0);throw Error()}function eD(t){let e=0,n=t.g;const r=n+10,i=t.h;for(;n<r;){const s=i[n++];if(e|=s,(128&s)==0)return Cp(t,n),!!(127&e)}throw Error()}function eh(t){const e=t.h;let n=t.g,r=e[n++],i=127&r;if(128&r&&(r=e[n++],i|=(127&r)<<7,128&r&&(r=e[n++],i|=(127&r)<<14,128&r&&(r=e[n++],i|=(127&r)<<21,128&r&&(r=e[n++],i|=r<<28,128&r&&128&e[n++]&&128&e[n++]&&128&e[n++]&&128&e[n++]&&128&e[n++])))))throw Error();return Cp(t,n),i}function cd(t){return eh(t)>>>0}function Y3(t){var e=t.h;const n=t.g;var r=e[n],i=e[n+1];const s=e[n+2];return e=e[n+3],Cp(t,t.g+4),t=2*((i=(r<<0|i<<8|s<<16|e<<24)>>>0)>>31)+1,r=i>>>23&255,i&=8388607,r==255?i?NaN:t*(1/0):r==0?1401298464324817e-60*t*i:t*Math.pow(2,r-150)*(i+8388608)}function mWe(t){return eh(t)}function Cp(t,e){if(t.g=e,e>t.l)throw Error()}function Gue(t,e){if(e<0)throw Error();const n=t.g;if((e=n+e)>t.l)throw Error();return t.g=e,n}function zue(t,e){if(e==0)return qp();var n=Gue(t,e);return t.Y&&t.j?n=t.h.subarray(n,n+e):(t=t.h,n=n===(e=n+e)?new Uint8Array(0):Wze?t.slice(n,e):new Uint8Array(t.subarray(n,e))),n.length==0?qp():new Rl(n,Gv)}var Yz=[];function Wue(t,e,n,r){if(J3.length){const i=J3.pop();return i.o(r),i.g.init(t,e,n,r),i}return new gWe(t,e,n,r)}function Yue(t){t.g.clear(),t.l=-1,t.h=-1,J3.length<100&&J3.push(t)}function Jue(t){var e=t.g;if(e.g==e.l)return!1;t.m=t.g.g;var n=cd(t.g);if(e=n>>>3,!((n&=7)>=0&&n<=5)||e<1)throw Error();return t.l=e,t.h=n,!0}function fC(t){switch(t.h){case 0:t.h!=0?fC(t):eD(t.g);break;case 1:Cp(t=t.g,t.g+8);break;case 2:if(t.h!=2)fC(t);else{var e=cd(t.g);Cp(t=t.g,t.g+e)}break;case 5:Cp(t=t.g,t.g+4);break;case 3:for(e=t.l;;){if(!Jue(t))throw Error();if(t.h==4){if(t.l!=e)throw Error();break}fC(t)}break;default:throw Error()}}function RS(t,e,n){const r=t.g.l;var i=cd(t.g);let s=(i=t.g.g+i)-r;if(s<=0&&(t.g.l=i,n(e,t,void 0,void 0,void 0),s=i-t.g.g),s)throw Error();return t.g.g=i,t.g.l=r,e}function tD(t){var e=cd(t.g),n=Gue(t=t.g,e);if(t=t.h,kze){var r,i=t;(r=u5)||(r=u5=new TextDecoder("utf-8",{fatal:!0})),e=n+e,i=n===0&&e===i.length?i:i.subarray(n,e);try{var s=r.decode(i)}catch(a){if(Xw===void 0){try{r.decode(new Uint8Array([128]))}catch{}try{r.decode(new Uint8Array([97])),Xw=!0}catch{Xw=!1}}throw!Xw&&(u5=void 0),a}}else{e=(s=n)+e,n=[];let a,c=null;for(;s<e;){var o=t[s++];o<128?n.push(o):o<224?s>=e?Gh():(a=t[s++],o<194||(192&a)!=128?(s--,Gh()):n.push((31&o)<<6|63&a)):o<240?s>=e-1?Gh():(a=t[s++],(192&a)!=128||o===224&&a<160||o===237&&a>=160||(192&(r=t[s++]))!=128?(s--,Gh()):n.push((15&o)<<12|(63&a)<<6|63&r)):o<=244?s>=e-2?Gh():(a=t[s++],(192&a)!=128||a-144+(o<<28)>>30!=0||(192&(r=t[s++]))!=128||(192&(i=t[s++]))!=128?(s--,Gh()):(o=(7&o)<<18|(63&a)<<12|(63&r)<<6|63&i,o-=65536,n.push(55296+(o>>10&1023),56320+(1023&o)))):Gh(),n.length>=8192&&(c=Lz(c,n),n.length=0)}s=Lz(c,n)}return s}function Xue(t){const e=cd(t.g);return zue(t.g,e)}function i4(t,e,n){var r=cd(t.g);for(r=t.g.g+r;t.g.g<r;)n.push(e(t.g))}var gWe=class{constructor(t,e,n,r){if(Yz.length){const i=Yz.pop();i.init(t,e,n,r),t=i}else t=new class{constructor(i,s,o,a){this.h=null,this.j=!1,this.g=this.l=this.m=0,this.init(i,s,o,a)}init(i,s,o,{Y:a=!1,ea:c=!1}={}){this.Y=a,this.ea=c,i&&(i=Z9(i,this.ea),this.h=i.buffer,this.j=i.g,this.m=s||0,this.l=o!==void 0?this.m+o:this.h.length,this.g=this.m)}clear(){this.h=null,this.j=!1,this.g=this.l=this.m=0,this.Y=!1}}(t,e,n,r);this.g=t,this.m=this.g.g,this.h=this.l=-1,this.o(r)}o({ha:t=!1}={}){this.ha=t}},J3=[];function Jz(t){return t?/^\d+$/.test(t)?(ZR(t),new yO(gr,Zr)):null:vWe||=new yO(0,0)}var yO=class{constructor(t,e){this.h=t>>>0,this.g=e>>>0}};let vWe;function Xz(t){return t?/^-?\d+$/.test(t)?(ZR(t),new bO(gr,Zr)):null:yWe||=new bO(0,0)}var bO=class{constructor(t,e){this.h=t>>>0,this.g=e>>>0}};let yWe;function pv(t,e,n){for(;n>0||e>127;)t.g.push(127&e|128),e=(e>>>7|n<<25)>>>0,n>>>=7;t.g.push(e)}function Fy(t,e){for(;e>127;)t.g.push(127&e|128),e>>>=7;t.g.push(e)}function s4(t,e){if(e>=0)Fy(t,e);else{for(let n=0;n<9;n++)t.g.push(127&e|128),e>>=7;t.g.push(1)}}function nD(t){var e=gr;t.g.push(e>>>0&255),t.g.push(e>>>8&255),t.g.push(e>>>16&255),t.g.push(e>>>24&255)}function Zv(t,e){e.length!==0&&(t.l.push(e),t.h+=e.length)}function ac(t,e,n){Fy(t.g,8*e+n)}function rD(t,e){return ac(t,e,2),e=t.g.end(),Zv(t,e),e.push(t.h),e}function iD(t,e){var n=e.pop();for(n=t.h+t.g.length()-n;n>127;)e.push(127&n|128),n>>>=7,t.h++;e.push(n),t.h++}function o4(t,e,n){ac(t,e,2),Fy(t.g,n.length),Zv(t,t.g.end()),Zv(t,n)}function X3(t,e,n,r){n!=null&&(e=rD(t,e),r(n,t),iD(t,e))}function ql(){const t=class{constructor(){throw Error()}};return Object.setPrototypeOf(t,t.prototype),t}var sD=ql(),Que=ql(),oD=ql(),aD=ql(),Zue=ql(),ede=ql(),bWe=ql(),a4=ql(),tde=ql(),nde=ql();function Vl(t,e,n){var r=t.v;ta&&ta in r&&(r=r[ta])&&delete r[e.g],e.h?e.j(t,e.h,e.g,n,e.l):e.j(t,e.g,n,e.l)}var Je=class{constructor(t,e){this.v=Uue(t,e,void 0,2048)}toJSON(){return Nue(this)}j(){var t=tYe,e=this.v,n=t.g,r=ta;if(Ly&&r&&e[r]?.[n]!=null&&zv(jze,3),e=t.g,jz&&ta&&jz===void 0&&(r=(n=this.v)[ta])&&(r=r.da))try{r(n,e,cWe)}catch(i){vue(i)}return t.h?t.m(this,t.h,t.g,t.l):t.m(this,t.g,t.defaultValue,t.l)}clone(){const t=this.v,e=0|t[Ye];return G9(this,t,e)?V9(this,t,!0):new this.constructor(Dy(t,e,!1))}};Je.prototype[Wv]=Yv,Je.prototype.toString=function(){return this.v.toString()};var $y=class{constructor(t,e,n){this.g=t,this.h=e,t=sD,this.l=!!t&&n===t||!1}};function c4(t,e){return new $y(t,e,sD)}function rde(t,e,n,r,i){X3(t,n,ade(e,r),i)}const _We=c4((function(t,e,n,r,i){return t.h===2&&(RS(t,X9(e,r,n),i),!0)}),rde),SWe=c4((function(t,e,n,r,i){return t.h===2&&(RS(t,X9(e,r,n),i),!0)}),rde);var l4=Symbol(),u4=Symbol(),_O=Symbol(),Qz=Symbol(),Zz=Symbol();let ide,sde;function vm(t,e,n,r){var i=r[t];if(i)return i;(i={}).qa=r,i.T=(function(h){switch(typeof h){case"boolean":return dWe||=[0,void 0,!0];case"number":return h>0?void 0:h===0?fWe||=[0,void 0]:[-h,void 0];case"string":return[0,h];case"object":return h}})(r[0]);var s=r[1];let o=1;s&&s.constructor===Object&&(i.ba=s,typeof(s=r[++o])=="function"&&(i.ma=!0,ide??=s,sde??=r[o+1],s=r[o+=2]));const a={};for(;s&&Array.isArray(s)&&s.length&&typeof s[0]=="number"&&s[0]>0;){for(var c=0;c<s.length;c++)a[s[c]]=s;s=r[++o]}for(c=1;s!==void 0;){let h;typeof s=="number"&&(c+=s,s=r[++o]);var l=void 0;if(s instanceof $y?h=s:(h=_We,o--),h?.l){s=r[++o],l=r;var d=o;typeof s=="function"&&(s=s(),l[d]=s),l=s}for(d=c+1,typeof(s=r[++o])=="number"&&s<0&&(d-=s,s=r[++o]);c<d;c++){const m=a[c];l?n(i,c,h,l,m):e(i,c,h,m)}}return r[t]=i}function ode(t){return Array.isArray(t)?t[0]instanceof $y?t:[SWe,t]:[t,void 0]}function ade(t,e){return t instanceof Je?t.v:Array.isArray(t)?Sp(t,e):void 0}function cD(t,e,n,r){const i=n.g;t[e]=r?(s,o,a)=>i(s,o,a,r):i}function lD(t,e,n,r,i){const s=n.g;let o,a;t[e]=(c,l,d)=>s(c,l,d,a||=vm(u4,cD,lD,r).T,o||=uD(r),i)}function uD(t){let e=t[_O];if(e!=null)return e;const n=vm(u4,cD,lD,t);return e=n.ma?(r,i)=>ide(r,i,n):(r,i)=>{for(;Jue(i)&&i.h!=4;){var s=i.l,o=n[s];if(o==null){var a=n.ba;a&&(a=a[s])&&(a=EWe(a))!=null&&(o=n[s]=a)}if(o==null||!o(i,r,s)){if(o=(a=i).m,fC(a),a.ha)var c=void 0;else c=a.g.g-o,a.g.g=o,c=zue(a.g,c);o=void 0,a=r,c&&((o=a[ta]??(a[ta]=new vO))[s]??(o[s]=[])).push(c)}}return(r=t4(r))&&(r.da=n.qa[Zz]),!0},t[_O]=e,t[Zz]=wWe.bind(t),e}function wWe(t,e,n,r){var i=this[u4];const s=this[_O],o=Sp(void 0,i.T),a=t4(t);if(a){var c=!1,l=i.ba;if(l){if(i=(d,h,m)=>{if(m.length!==0)if(l[h])for(const g of m){d=Wue(g);try{c=!0,s(o,d)}finally{Yue(d)}}else r?.(t,h,m)},e==null)z3(a,i);else if(a!=null){const d=a[e];d&&i(a,e,d)}if(c){let d=0|t[Ye];if(2&d&&2048&d&&!n?.Ka)throw Error();const h=Oy(d),m=(g,y)=>{if(sd(t,g,h)!=null){if(n?.Qa===1)return;throw Error()}y!=null&&(d=gi(t,d,g,y,h)),delete a[g]};e==null?Rue(o,0|o[Ye],((g,y)=>{m(g,y)})):m(e,sd(o,e,h))}}}}function EWe(t){const e=(t=ode(t))[0].g;if(t=t[1]){const n=uD(t),r=vm(u4,cD,lD,t).T;return(i,s,o)=>e(i,s,o,r,n)}return e}function d4(t,e,n){t[e]=n.h}function f4(t,e,n,r){let i,s;const o=n.h;t[e]=(a,c,l)=>o(a,c,l,s||=vm(l4,d4,f4,r).T,i||=cde(r))}function cde(t){let e=t[Qz];if(!e){const n=vm(l4,d4,f4,t);e=(r,i)=>lde(r,i,n),t[Qz]=e}return e}function lde(t,e,n){Rue(t,0|t[Ye],((r,i)=>{if(i!=null){var s=(function(o,a){var c=o[a];if(c)return c;if((c=o.ba)&&(c=c[a])){var l=(c=ode(c))[0].h;if(c=c[1]){const d=cde(c),h=vm(l4,d4,f4,c).T;c=o.ma?sde(h,d):(m,g,y)=>l(m,g,y,h,d)}else c=l;return o[a]=c}})(n,r);s?s(e,i,r):r<500||zv(pO,3)}})),(t=t4(t))&&z3(t,((r,i,s)=>{for(Zv(e,e.g.end()),r=0;r<s.length;r++)Zv(e,N9(s[r])||new Uint8Array(0))}))}const CWe=na(0);function By(t,e){if(Array.isArray(e)){var n=0|e[Ye];if(4&n)return e;for(var r=0,i=0;r<e.length;r++){const s=t(e[r]);s!=null&&(e[i++]=s)}return i<r&&(e.length=i),(t=-1537&(5|n))!==n&&bi(e,t),2&t&&Object.freeze(e),e}}function Gs(t,e,n){return new $y(t,e,n)}function Hy(t,e,n){return new $y(t,e,n)}function Bi(t,e,n){gi(t,0|t[Ye],e,n,Oy(0|t[Ye]))}var TWe=c4((function(t,e,n,r,i){if(t.h!==2)return!1;if(t=Uc(t=RS(t,Sp([void 0,void 0],r),i)),i=Oy(r=0|e[Ye]),2&r)throw Error();let s=sd(e,n,i);if(s instanceof id)(2&s.J)!=0?(s=s.V(),s.push(t),gi(e,r,n,s,i)):s.Ma(t);else if(Array.isArray(s)){var o=0|s[Ye];8192&o||bi(s,o|=8192),2&o&&(s=$ue(s),gi(e,r,n,s,i)),s.push(t)}else gi(e,r,n,C_([t]),i);return!0}),(function(t,e,n,r,i){if(e instanceof id)e.forEach(((s,o)=>{X3(t,n,Sp([o,s],r),i)}));else if(Array.isArray(e)){for(let s=0;s<e.length;s++){const o=e[s];Array.isArray(o)&&X3(t,n,Sp(o,r),i)}C_(e)}}));function ude(t,e,n){(e=_l(e))!=null&&(ac(t,n,5),t=t.g,j9(e),nD(t))}function dde(t,e,n){if(e=(function(r){if(r==null)return r;const i=typeof r;if(i==="bigint")return String(ES(64,r));if(CS(r)){if(i==="string")return Lue(r);if(i==="number")return H9(r)}})(e),e!=null&&(typeof e=="string"&&Xz(e),e!=null))switch(ac(t,n,0),typeof e){case"number":t=t.g,Jv(e),pv(t,gr,Zr);break;case"bigint":n=BigInt.asUintN(64,e),n=new bO(Number(n&BigInt(4294967295)),Number(n>>BigInt(32))),pv(t.g,n.h,n.g);break;default:n=Xz(e),pv(t.g,n.h,n.g)}}function fde(t,e,n){(e=Py(e))!=null&&e!=null&&(ac(t,n,0),s4(t.g,e))}function hde(t,e,n){(e=xue(e))!=null&&(ac(t,n,0),t.g.g.push(e?1:0))}function pde(t,e,n){(e=as(e))!=null&&o4(t,n,gue(e))}function mde(t,e,n,r,i){X3(t,n,ade(e,r),i)}function gde(t,e,n){(e=e==null||typeof e=="string"||e instanceof Rl?e:void 0)!=null&&o4(t,n,Z9(e,!0).buffer)}function vde(t,e,n){return(t.h===5||t.h===2)&&(e=jy(e,0|e[Ye],n),t.h==2?i4(t,Y3,e):e.push(Y3(t.g)),!0)}var ei=Gs((function(t,e,n){return t.h===5&&(Bi(e,n,Y3(t.g)),!0)}),ude,a4),RWe=Hy(vde,(function(t,e,n){if((e=By(_l,e))!=null)for(let o=0;o<e.length;o++){var r=t,i=n,s=e[o];s!=null&&(ac(r,i,5),r=r.g,j9(s),nD(r))}}),a4),dD=Hy(vde,(function(t,e,n){if((e=By(_l,e))!=null&&e.length){ac(t,n,2),Fy(t.g,4*e.length);for(let r=0;r<e.length;r++)n=t.g,j9(e[r]),nD(n)}}),a4),kWe=Gs((function(t,e,n){return t.h===5&&(Bi(e,n,(t=Y3(t.g))===0?void 0:t),!0)}),ude,a4),th=Gs((function(t,e,n){return O9?(t.h!==0?t=!1:(Bi(e,n,Qv(t.g,Iue)),t=!0),t):t.h===0&&(Bi(e,n,Qv(t.g,F9)),!0)}),dde,ede),p5=Gs((function(t,e,n){return O9?(t.h!==0?e=!1:(Bi(e,n,(t=Qv(t.g,Iue))===CWe?void 0:t),e=!0),e):t.h===0&&(Bi(e,n,(t=Qv(t.g,F9))===0?void 0:t),!0)}),dde,ede),IWe=Gs((function(t,e,n){return O9?(t.h!==0?t=!1:(Bi(e,n,Qv(t.g,Jze)),t=!0),t):t.h===0&&(Bi(e,n,Qv(t.g,gO)),!0)}),(function(t,e,n){if(e=(function(r){if(r==null)return r;var i=typeof r;if(i==="bigint")return String(Xze(64,r));if(CS(r)){if(i==="string")return i=Xv(Number(r)),Kp(i)&&i>=0?r=String(i):((i=r.indexOf("."))!==-1&&(r=r.substring(0,i)),(i=r[0]!=="-"&&((i=r.length)<20||i===20&&r<="18446744073709551615"))||(ZR(r),r=T_(gr,Zr))),r;if(i==="number")return(r=Xv(r))>=0&&Kp(r)||(Jv(r),r=gO(gr,Zr)),r}})(e),e!=null&&(typeof e=="string"&&Jz(e),e!=null))switch(ac(t,n,0),typeof e){case"number":t=t.g,Jv(e),pv(t,gr,Zr);break;case"bigint":n=BigInt.asUintN(64,e),n=new yO(Number(n&BigInt(4294967295)),Number(n>>BigInt(32))),pv(t.g,n.h,n.g);break;default:n=Jz(e),pv(t.g,n.h,n.g)}}),bWe),Ui=Gs((function(t,e,n){return t.h===0&&(Bi(e,n,eh(t.g)),!0)}),fde,aD),kS=Hy((function(t,e,n){return(t.h===0||t.h===2)&&(e=jy(e,0|e[Ye],n),t.h==2?i4(t,eh,e):e.push(eh(t.g)),!0)}),(function(t,e,n){if((e=By(Py,e))!=null&&e.length){n=rD(t,n);for(let r=0;r<e.length;r++)s4(t.g,e[r]);iD(t,n)}}),aD),Kg=Gs((function(t,e,n){return t.h===0&&(Bi(e,n,(t=eh(t.g))===0?void 0:t),!0)}),fde,aD),Br=Gs((function(t,e,n){return t.h===0&&(Bi(e,n,eD(t.g)),!0)}),hde,Que),Tp=Gs((function(t,e,n){return t.h===0&&(Bi(e,n,(t=eD(t.g))===!1?void 0:t),!0)}),hde,Que),ys=Hy((function(t,e,n){return t.h===2&&(t=tD(t),jy(e,0|e[Ye],n).push(t),!0)}),(function(t,e,n){if((e=By(as,e))!=null)for(let o=0;o<e.length;o++){var r=t,i=n,s=e[o];s!=null&&o4(r,i,gue(s))}}),oD),vf=Gs((function(t,e,n){return t.h===2&&(Bi(e,n,(t=tD(t))===""?void 0:t),!0)}),pde,oD),Hn=Gs((function(t,e,n){return t.h===2&&(Bi(e,n,tD(t)),!0)}),pde,oD),Li=(function(t,e,n=sD){return new $y(t,e,n)})((function(t,e,n,r,i){return t.h===2&&(r=Sp(void 0,r),jy(e,0|e[Ye],n).push(r),RS(t,r,i),!0)}),(function(t,e,n,r,i){if(Array.isArray(e)){for(let s=0;s<e.length;s++)mde(t,e[s],n,r,i);1&(t=0|e[Ye])||bi(e,1|t)}})),Dr=c4((function(t,e,n,r,i,s){if(t.h!==2)return!1;let o=0|e[Ye];return Bue(e,o,s,n,Oy(o)),RS(t,e=X9(e,r,n),i),!0}),mde),yde=Gs((function(t,e,n){return t.h===2&&(Bi(e,n,Xue(t)),!0)}),gde,tde),xWe=Hy((function(t,e,n){return(t.h===0||t.h===2)&&(e=jy(e,0|e[Ye],n),t.h==2?i4(t,cd,e):e.push(cd(t.g)),!0)}),(function(t,e,n){if((e=By(Aue,e))!=null)for(let o=0;o<e.length;o++){var r=t,i=n,s=e[o];s!=null&&(ac(r,i,0),Fy(r.g,s))}}),Zue),AWe=Gs((function(t,e,n){return t.h===0&&(Bi(e,n,(t=cd(t.g))===0?void 0:t),!0)}),(function(t,e,n){(e=Aue(e))!=null&&e!=null&&(ac(t,n,0),Fy(t.g,e))}),Zue),la=Gs((function(t,e,n){return t.h===0&&(Bi(e,n,eh(t.g)),!0)}),(function(t,e,n){(e=Py(e))!=null&&(e=parseInt(e,10),ac(t,n,0),s4(t.g,e))}),nde);class MWe{constructor(e,n){var r=fa;this.g=e,this.h=n,this.m=an,this.j=lt,this.defaultValue=void 0,this.l=r.Oa!=null?kue:void 0}register(){JR(this)}}function Kl(t,e){return new MWe(t,e)}function mh(t,e){return(n,r)=>{{const s={ea:!0};r&&Object.assign(s,r),n=Wue(n,void 0,void 0,s);try{const o=new t,a=o.v;uD(e)(a,n);var i=o}finally{Yue(n)}}return i}}function h4(t){return function(){const e=new class{constructor(){this.l=[],this.h=0,this.g=new class{constructor(){this.g=[]}length(){return this.g.length}end(){const o=this.g;return this.g=[],o}}}};lde(this.v,e,vm(l4,d4,f4,t)),Zv(e,e.g.end());const n=new Uint8Array(e.h),r=e.l,i=r.length;let s=0;for(let o=0;o<i;o++){const a=r[o];n.set(a,s),s+=a.length}return e.l=[n],n}}var eW=class extends Je{constructor(t){super(t)}},tW=[0,vf,Gs((function(t,e,n){return t.h===2&&(Bi(e,n,(t=Xue(t))===qp()?void 0:t),!0)}),(function(t,e,n){if(e!=null){if(e instanceof Je){const r=e.Ra;return void(r?(e=r(e),e!=null&&o4(t,n,Z9(e,!0).buffer)):zv(pO,3))}if(Array.isArray(e))return void zv(pO,3)}gde(t,e,n)}),tde)];let m5,nW=globalThis.trustedTypes;function rW(t){var e;return m5===void 0&&(m5=(function(){let n=null;if(!nW)return n;try{const r=i=>i;n=nW.createPolicy("goog#html",{createHTML:r,createScript:r,createScriptURL:r})}catch{}return n})()),t=(e=m5)?e.createScriptURL(t):t,new class{constructor(n){this.g=n}toString(){return this.g+""}}(t)}function LWe(t,...e){if(e.length===0)return rW(t[0]);let n=t[0];for(let r=0;r<e.length;r++)n+=encodeURIComponent(e[r])+t[r+1];return rW(n)}var bde=[0,Ui,la,Br,-1,kS,la,-1,Br],OWe=class extends Je{constructor(e){super(e)}},_de=[0,Br,Hn,Br,la,-1,Hy((function(t,e,n){return(t.h===0||t.h===2)&&(e=jy(e,0|e[Ye],n),t.h==2?i4(t,mWe,e):e.push(eh(t.g)),!0)}),(function(t,e,n){if((e=By(Py,e))!=null&&e.length){n=rD(t,n);for(let r=0;r<e.length;r++)s4(t.g,e[r]);iD(t,n)}}),nde),Hn,-1,[0,Br,-1],la,Br,-1],Sde=[0,3,Br,-1,2,[0,Ui],[0,la,Br],[0,Hn,-1],[0]],wde=[0,Hn,-2],iW=class extends Je{constructor(e){super(e)}},Ede=[0],Cde=[0,Ui,Br,1,Br,-4],fa=class extends Je{constructor(t){super(t,2)}},vi={};vi[336783863]=[0,Hn,Br,-1,Ui,[0,[1,2,3,4,5,6,7,8,9],Dr,Ede,Dr,_de,Dr,wde,Dr,Cde,Dr,bde,Dr,[0,Hn,-2],Dr,[0,Hn,la],Dr,Sde,Dr,[0,la,-1,Br]],[0,Hn],Br,[0,[1,3],[2,4],Dr,[0,kS],-1,Dr,[0,ys],-1,Li,[0,Hn,-1]],Hn];var sW=[0,p5,-1,Tp,-3,p5,kS,vf,Kg,p5,-1,Tp,Kg,Tp,-2,vf];function ur(t,e){r4(t,3,e)}function Wt(t,e){r4(t,4,e)}var Ro=class extends Je{constructor(t){super(t,500)}o(t){return lt(this,0,7,t)}},bb=[-1,{}],oW=[0,Hn,1,bb],aW=[0,Hn,ys,bb];function cc(t,e){Q9(t,1,Ro,e)}function br(t,e){r4(t,10,e)}function hn(t,e){r4(t,15,e)}var ha=class extends Je{constructor(t){super(t,500)}o(t){return lt(this,0,1001,t)}},Tde=[-500,Li,[-500,vf,-1,ys,-3,[-2,vi,Br],Li,tW,Kg,-1,oW,aW,Li,[0,vf,Tp],vf,sW,Kg,ys,987,ys],4,Li,[-500,Hn,-1,[-1,{}],998,Hn],Li,[-500,Hn,ys,-1,[-2,{},Br],997,ys,-1],Kg,Li,[-500,Hn,ys,bb,998,ys],ys,Kg,oW,aW,Li,[0,vf,-1,bb],ys,-2,sW,vf,-1,Tp,[0,Tp,AWe],978,bb,Li,tW];ha.prototype.g=h4(Tde);var PWe=mh(ha,Tde),DWe=class extends Je{constructor(t){super(t)}},Rde=class extends Je{constructor(e){super(e)}g(){return od(this,DWe,1)}},kde=[0,Li,[0,Ui,ei,Hn,-1]],p4=mh(Rde,kde),NWe=class extends Je{constructor(t){super(t)}},UWe=class extends Je{constructor(t){super(t)}},g5=class extends Je{constructor(t){super(t)}l(){return an(this,NWe,2)}g(){return od(this,UWe,5)}},Ide=mh(class extends Je{constructor(t){super(t)}},[0,ys,kS,dD,[0,la,[0,Ui,-3],[0,ei,-3],[0,Ui,-1,[0,Li,[0,Ui,-2]]],Li,[0,ei,-1,Hn,ei]],Hn,-1,th,Li,[0,Ui,ei],ys,th]),xde=class extends Je{constructor(t){super(t)}},mv=mh(class extends Je{constructor(t){super(t)}},[0,Li,[0,ei,-4]]),Ade=class extends Je{constructor(t){super(t)}},IS=mh(class extends Je{constructor(t){super(t)}},[0,Li,[0,ei,-4]]),jWe=class extends Je{constructor(t){super(t)}},FWe=[0,Ui,-1,dD,la],Mde=class extends Je{constructor(t){super(t)}};Mde.prototype.g=h4([0,ei,-4,th]);var $We=class extends Je{constructor(t){super(t)}},BWe=mh(class extends Je{constructor(t){super(t)}},[0,Li,[0,1,Ui,Hn,kde],th]),cW=class extends Je{constructor(t){super(t)}},HWe=class extends Je{constructor(t){super(t)}na(){const t=lr(this,1,void 0,void 0,Fue);return t??qp()}},qWe=class extends Je{constructor(t){super(t)}},Lde=[1,2],VWe=mh(class extends Je{constructor(t){super(t)}},[0,Li,[0,Lde,Dr,[0,dD],Dr,[0,yde],Ui,Hn],th]),fD=class extends Je{constructor(t){super(t)}},Ode=[0,Hn,Ui,ei,ys,-1],lW=class extends Je{constructor(t){super(t)}},KWe=[0,Br,-1],uW=class extends Je{constructor(t){super(t)}},hC=[1,2,3,4,5,6],Q3=class extends Je{constructor(t){super(t)}g(){return lr(this,1,void 0,void 0,Fue)!=null}l(){return as(lr(this,2))!=null}},Ar=class extends Je{constructor(t){super(t)}g(){return xue(lr(this,2))??!1}},Pde=[0,yde,Hn,[0,Ui,th,-1],[0,IWe,th]],ni=[0,Pde,Br,[0,hC,Dr,Cde,Dr,_de,Dr,bde,Dr,Ede,Dr,wde,Dr,Sde],la],m4=class extends Je{constructor(t){super(t)}},hD=[0,ni,ei,-1,Ui],GWe=Kl(502141897,m4);vi[502141897]=hD;var zWe=mh(class extends Je{constructor(t){super(t)}},[0,[0,la,-1,RWe,xWe],FWe]),Dde=class extends Je{constructor(e){super(e)}},Nde=class extends Je{constructor(t){super(t)}},SO=[0,ni,ei,[0,ni],Br],WWe=Kl(508968150,Nde);vi[508968150]=[0,ni,hD,SO,ei,[0,[0,Pde]]],vi[508968149]=SO;var Eg=class extends Je{constructor(t){super(t)}l(){return an(this,fD,2)}g(){xn(this,2)}},Ude=[0,ni,Ode];vi[478825465]=Ude;var YWe=class extends Je{constructor(t){super(t)}},jde=class extends Je{constructor(e){super(e)}},pD=class extends Je{constructor(t){super(t)}},mD=class extends Je{constructor(e){super(e)}},Fde=class extends Je{constructor(e){super(e)}},dW=[0,ni,[0,ni],Ude,-1],$de=[0,ni,ei,Ui],gD=[0,ni,ei],Bde=[0,ni,$de,gD,ei],JWe=Kl(479097054,Fde);vi[479097054]=[0,ni,Bde,dW],vi[463370452]=dW,vi[464864288]=$de;var XWe=Kl(462713202,mD);vi[462713202]=Bde,vi[474472470]=gD;var QWe=class extends Je{constructor(t){super(t)}},Hde=class extends Je{constructor(t){super(t)}},qde=class extends Je{constructor(t){super(t)}},Vde=class extends Je{constructor(t){super(t)}},vD=[0,ni,ei,-1,Ui],wO=[0,ni,ei,Br];Vde.prototype.g=h4([0,ni,gD,[0,ni],hD,SO,vD,wO]);var Kde=class extends Je{constructor(t){super(t)}},ZWe=Kl(456383383,Kde);vi[456383383]=[0,ni,Ode];var Gde=class extends Je{constructor(t){super(t)}},eYe=Kl(476348187,Gde);vi[476348187]=[0,ni,KWe];var zde=class extends Je{constructor(t){super(t)}},fW=class extends Je{constructor(t){super(t)}},Wde=[0,la,-1],tYe=Kl(458105876,class extends Je{constructor(t){super(t)}g(){let t;var e=this.v;const n=0|e[Ye];return t=aa(this,n),e=(function(r,i,s,o){var a=fW;!o&&Ny(r)&&(s=0|(i=r.v)[Ye]);var c=sd(i,2);if(r=!1,c==null){if(o)return Gz();c=[]}else if(c.constructor===id){if(!(2&c.J)||o)return c;c=c.V()}else Array.isArray(c)?r=!!(2&(0|c[Ye])):c=[];if(o){if(!c.length)return Gz();r||(r=!0,wS(c))}else r&&(r=!1,C_(c),c=$ue(c));return!r&&32&s&&SS(c,32),s=gi(i,s,2,o=new id(c,a,tWe,void 0)),r||gm(i,s),o})(this,e,n,t),!t&&fW&&(e.ra=!0),e}});vi[458105876]=[0,Wde,TWe,[!0,th,[0,Hn,-1,ys]],[0,kS,Br,la]];var yD=class extends Je{constructor(t){super(t)}},Yde=Kl(458105758,yD);vi[458105758]=[0,ni,Hn,Wde];var v5=class extends Je{constructor(t){super(t)}},hW=[0,kWe,-1,Tp],nYe=class extends Je{constructor(t){super(t)}},Jde=class extends Je{constructor(t){super(t)}},EO=[1,2];Jde.prototype.g=h4([0,EO,Dr,hW,Dr,[0,Li,hW]]);var Xde=class extends Je{constructor(t){super(t)}},rYe=Kl(443442058,Xde);vi[443442058]=[0,ni,Hn,Ui,ei,ys,-1,Br,ei],vi[514774813]=vD;var Qde=class extends Je{constructor(t){super(t)}},iYe=Kl(516587230,Qde);function CO(t,e){return e=e?e.clone():new fD,t.displayNamesLocale!==void 0?xn(e,1,TS(t.displayNamesLocale)):t.displayNamesLocale===void 0&&xn(e,1),t.maxResults!==void 0?ad(e,2,t.maxResults):"maxResults"in t&&xn(e,2),t.scoreThreshold!==void 0?tt(e,3,t.scoreThreshold):"scoreThreshold"in t&&xn(e,3),t.categoryAllowlist!==void 0?W3(e,4,t.categoryAllowlist):"categoryAllowlist"in t&&xn(e,4),t.categoryDenylist!==void 0?W3(e,5,t.categoryDenylist):"categoryDenylist"in t&&xn(e,5),e}function Zde(t){const e=Number(t);return Number.isSafeInteger(e)?e:String(t)}function bD(t,e=-1,n=""){return{categories:t.map((r=>({index:za(r,1)??0??-1,score:Nr(r,2)??0,categoryName:as(lr(r,3))??""??"",displayName:as(lr(r,4))??""??""}))),headIndex:e,headName:n}}function sYe(t){const e={classifications:od(t,$We,1).map((n=>bD(an(n,Rde,4)?.g()??[],za(n,2)??0,as(lr(n,3))??"")))};return(function(n){return eWe(P9?lr(n,2,void 0,void 0,G3):lr(n,2))})(t)!=null&&(e.timestampMs=Zde(Kue(t))),e}function efe(t){var e=up(t,3,_l,lp()),n=up(t,2,Py,lp()),r=up(t,1,as,lp()),i=up(t,9,as,lp());const s={categories:[],keypoints:[]};for(let o=0;o<e.length;o++)s.categories.push({score:e[o],index:n[o]??-1,categoryName:r[o]??"",displayName:i[o]??""});if((e=an(t,g5,4)?.l())&&(s.boundingBox={originX:za(e,1,Wd)??0,originY:za(e,2,Wd)??0,width:za(e,3,Wd)??0,height:za(e,4,Wd)??0,angle:0}),an(t,g5,4)?.g().length)for(const o of an(t,g5,4).g())s.keypoints.push({x:lr(o,1,void 0,Wd,_l)??0,y:lr(o,2,void 0,Wd,_l)??0,score:lr(o,4,void 0,Wd,_l)??0,label:as(lr(o,3,void 0,Wd))??""});return s}function g4(t){const e=[];for(const n of od(t,Ade,1))e.push({x:Nr(n,1)??0,y:Nr(n,2)??0,z:Nr(n,3)??0,visibility:Nr(n,4)??0});return e}function _b(t){const e=[];for(const n of od(t,xde,1))e.push({x:Nr(n,1)??0,y:Nr(n,2)??0,z:Nr(n,3)??0,visibility:Nr(n,4)??0});return e}function pW(t){return Array.from(t,(e=>e>127?e-256:e))}function mW(t,e){if(t.length!==e.length)throw Error(`Cannot compute cosine similarity between embeddings of different sizes (${t.length} vs. ${e.length}).`);let n=0,r=0,i=0;for(let s=0;s<t.length;s++)n+=t[s]*e[s],r+=t[s]*t[s],i+=e[s]*e[s];if(r<=0||i<=0)throw Error("Cannot compute cosine similarity on embedding with 0 norm.");return n/Math.sqrt(r*i)}let Qw;vi[516587230]=[0,ni,vD,wO,ei],vi[518928384]=wO;const oYe=new Uint8Array([0,97,115,109,1,0,0,0,1,5,1,96,0,1,123,3,2,1,0,10,10,1,8,0,65,0,253,15,253,98,11]);async function tfe(){if(Qw===void 0)try{await WebAssembly.instantiate(oYe),Qw=!0}catch{Qw=!1}return Qw}async function y1(t,e=LWe``){const n=await tfe()?"wasm_internal":"wasm_nosimd_internal";return{wasmLoaderPath:`${e}/${t}_${n}.js`,wasmBinaryPath:`${e}/${t}_${n}.wasm`}}var np=class{};function nfe(){var t=navigator;return typeof OffscreenCanvas<"u"&&(!(function(e=navigator){return(e=e.userAgent).includes("Safari")&&!e.includes("Chrome")})(t)||!!((t=t.userAgent.match(/Version\/([\d]+).*Safari/))&&t.length>=1&&Number(t[1])>=17))}async function gW(t){if(typeof importScripts!="function"){const e=document.createElement("script");return e.src=t.toString(),e.crossOrigin="anonymous",new Promise(((n,r)=>{e.addEventListener("load",(()=>{n()}),!1),e.addEventListener("error",(i=>{r(i)}),!1),document.body.appendChild(e)}))}try{importScripts(t.toString())}catch(e){if(!(e instanceof TypeError))throw e;await self.import(t.toString())}}function rfe(t){return t.videoWidth!==void 0?[t.videoWidth,t.videoHeight]:t.naturalWidth!==void 0?[t.naturalWidth,t.naturalHeight]:t.displayWidth!==void 0?[t.displayWidth,t.displayHeight]:[t.width,t.height]}function Xe(t,e,n){t.m||console.error("No wasm multistream support detected: ensure dependency inclusion of :gl_graph_runner_internal_multi_input target"),n(e=t.i.stringToNewUTF8(e)),t.i._free(e)}function vW(t,e,n){if(!t.i.canvas)throw Error("No OpenGL canvas configured.");if(n?t.i._bindTextureToStream(n):t.i._bindTextureToCanvas(),!(n=t.i.canvas.getContext("webgl2")||t.i.canvas.getContext("webgl")))throw Error("Failed to obtain WebGL context from the provided canvas. `getContext()` should only be invoked with `webgl` or `webgl2`.");t.i.gpuOriginForWebTexturesIsBottomLeft&&n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL,!0),n.texImage2D(n.TEXTURE_2D,0,n.RGBA,n.RGBA,n.UNSIGNED_BYTE,e),t.i.gpuOriginForWebTexturesIsBottomLeft&&n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL,!1);const[r,i]=rfe(e);return!t.l||r===t.i.canvas.width&&i===t.i.canvas.height||(t.i.canvas.width=r,t.i.canvas.height=i),[r,i]}function yW(t,e,n){t.m||console.error("No wasm multistream support detected: ensure dependency inclusion of :gl_graph_runner_internal_multi_input target");const r=new Uint32Array(e.length);for(let i=0;i<e.length;i++)r[i]=t.i.stringToNewUTF8(e[i]);e=t.i._malloc(4*r.length),t.i.HEAPU32.set(r,e>>2),n(e);for(const i of r)t.i._free(i);t.i._free(e)}function el(t,e,n){t.i.simpleListeners=t.i.simpleListeners||{},t.i.simpleListeners[e]=n}function Yd(t,e,n){let r=[];t.i.simpleListeners=t.i.simpleListeners||{},t.i.simpleListeners[e]=(i,s,o)=>{s?(n(r,o),r=[]):r.push(i)}}np.forVisionTasks=function(t){return y1("vision",t)},np.forTextTasks=function(t){return y1("text",t)},np.forGenAiExperimentalTasks=function(t){return y1("genai_experimental",t)},np.forGenAiTasks=function(t){return y1("genai",t)},np.forAudioTasks=function(t){return y1("audio",t)},np.isSimdSupported=function(){return tfe()};async function aYe(t,e,n,r){return t=await(async(i,s,o,a,c)=>{if(s&&await gW(s),!self.ModuleFactory||o&&(await gW(o),!self.ModuleFactory))throw Error("ModuleFactory not set.");return self.Module&&c&&((s=self.Module).locateFile=c.locateFile,c.mainScriptUrlOrBlob&&(s.mainScriptUrlOrBlob=c.mainScriptUrlOrBlob)),c=await self.ModuleFactory(self.Module||c),self.ModuleFactory=self.Module=void 0,new i(c,a)})(t,n.wasmLoaderPath,n.assetLoaderPath,e,{locateFile:i=>i.endsWith(".wasm")?n.wasmBinaryPath.toString():n.assetBinaryPath&&i.endsWith(".data")?n.assetBinaryPath.toString():i}),await t.o(r),t}function y5(t,e){const n=an(t.baseOptions,Q3,1)||new Q3;typeof e=="string"?(xn(n,2,TS(e)),xn(n,1)):e instanceof Uint8Array&&(xn(n,1,U9(e,!1)),xn(n,2)),lt(t.baseOptions,0,1,n)}function bW(t){try{const e=t.H.length;if(e===1)throw Error(t.H[0].message);if(e>1)throw Error("Encountered multiple errors: "+t.H.map((n=>n.message)).join(", "))}finally{t.H=[]}}function qe(t,e){t.C=Math.max(t.C,e)}function v4(t,e){t.B=new Ro,ca(t.B,2,"PassThroughCalculator"),ur(t.B,"free_memory"),Wt(t.B,"free_memory_unused_out"),br(e,"free_memory"),cc(e,t.B)}function ey(t,e){ur(t.B,e),Wt(t.B,e+"_unused_out")}function y4(t){t.g.addBoolToStream(!0,"free_memory",t.C)}var TO=class{constructor(t){this.g=t,this.H=[],this.C=0,this.g.setAutoRenderToScreen(!1)}l(t,e=!0){if(e){const n=t.baseOptions||{};if(t.baseOptions?.modelAssetBuffer&&t.baseOptions?.modelAssetPath)throw Error("Cannot set both baseOptions.modelAssetPath and baseOptions.modelAssetBuffer");if(!(an(this.baseOptions,Q3,1)?.g()||an(this.baseOptions,Q3,1)?.l()||t.baseOptions?.modelAssetBuffer||t.baseOptions?.modelAssetPath))throw Error("Either baseOptions.modelAssetPath or baseOptions.modelAssetBuffer must be set");if((function(r,i){let s=an(r.baseOptions,uW,3);if(!s){var o=s=new uW,a=new iW;yb(o,4,hC,a)}"delegate"in i&&(i.delegate==="GPU"?(i=s,o=new OWe,yb(i,2,hC,o)):(i=s,o=new iW,yb(i,4,hC,o))),lt(r.baseOptions,0,3,s)})(this,n),n.modelAssetPath)return fetch(n.modelAssetPath.toString()).then((r=>{if(r.ok)return r.arrayBuffer();throw Error(`Failed to fetch model: ${n.modelAssetPath} (${r.status})`)})).then((r=>{try{this.g.i.FS_unlink("/model.dat")}catch{}this.g.i.FS_createDataFile("/","model.dat",new Uint8Array(r),!0,!1,!1),y5(this,"/model.dat"),this.m(),this.L()}));if(n.modelAssetBuffer instanceof Uint8Array)y5(this,n.modelAssetBuffer);else if(n.modelAssetBuffer)return(async function(r){const i=[];for(var s=0;;){const{done:o,value:a}=await r.read();if(o)break;i.push(a),s+=a.length}if(i.length===0)return new Uint8Array(0);if(i.length===1)return i[0];r=new Uint8Array(s),s=0;for(const o of i)r.set(o,s),s+=o.length;return r})(n.modelAssetBuffer).then((r=>{y5(this,r),this.m(),this.L()}))}return this.m(),this.L(),Promise.resolve()}L(){}ca(){let t;if(this.g.ca((e=>{t=PWe(e)})),!t)throw Error("Failed to retrieve CalculatorGraphConfig");return t}setGraph(t,e){this.g.attachErrorListener(((n,r)=>{this.H.push(Error(r))})),this.g.Ja(),this.g.setGraph(t,e),this.B=void 0,bW(this)}finishProcessing(){this.g.finishProcessing(),bW(this)}close(){this.B=void 0,this.g.closeGraph()}};function Uf(t,e){if(!t)throw Error(`Unable to obtain required WebGL resource: ${e}`);return t}TO.prototype.close=TO.prototype.close;class cYe{constructor(e,n,r,i){this.g=e,this.h=n,this.m=r,this.l=i}bind(){this.g.bindVertexArray(this.h)}close(){this.g.deleteVertexArray(this.h),this.g.deleteBuffer(this.m),this.g.deleteBuffer(this.l)}}function _W(t,e,n){const r=t.g;if(n=Uf(r.createShader(n),"Failed to create WebGL shader"),r.shaderSource(n,e),r.compileShader(n),!r.getShaderParameter(n,r.COMPILE_STATUS))throw Error(`Could not compile WebGL shader: ${r.getShaderInfoLog(n)}`);return r.attachShader(t.h,n),n}function SW(t,e){const n=t.g,r=Uf(n.createVertexArray(),"Failed to create vertex array");n.bindVertexArray(r);const i=Uf(n.createBuffer(),"Failed to create buffer");n.bindBuffer(n.ARRAY_BUFFER,i),n.enableVertexAttribArray(t.O),n.vertexAttribPointer(t.O,2,n.FLOAT,!1,0,0),n.bufferData(n.ARRAY_BUFFER,new Float32Array([-1,-1,-1,1,1,1,1,-1]),n.STATIC_DRAW);const s=Uf(n.createBuffer(),"Failed to create buffer");return n.bindBuffer(n.ARRAY_BUFFER,s),n.enableVertexAttribArray(t.L),n.vertexAttribPointer(t.L,2,n.FLOAT,!1,0,0),n.bufferData(n.ARRAY_BUFFER,new Float32Array(e?[0,1,0,0,1,0,1,1]:[0,0,0,1,1,1,1,0]),n.STATIC_DRAW),n.bindBuffer(n.ARRAY_BUFFER,null),n.bindVertexArray(null),new cYe(n,r,i,s)}function _D(t,e){if(t.g){if(e!==t.g)throw Error("Cannot change GL context once initialized")}else t.g=e}function lYe(t,e,n,r){return _D(t,e),t.h||(t.m(),t.D()),n?(t.u||(t.u=SW(t,!0)),n=t.u):(t.A||(t.A=SW(t,!1)),n=t.A),e.useProgram(t.h),n.bind(),t.l(),t=r(),n.g.bindVertexArray(null),t}function ife(t,e,n){return _D(t,e),t=Uf(e.createTexture(),"Failed to create texture"),e.bindTexture(e.TEXTURE_2D,t),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,n??e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,n??e.LINEAR),e.bindTexture(e.TEXTURE_2D,null),t}function sfe(t,e,n){_D(t,e),t.B||(t.B=Uf(e.createFramebuffer(),"Failed to create framebuffe.")),e.bindFramebuffer(e.FRAMEBUFFER,t.B),e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,n,0)}function uYe(t){t.g?.bindFramebuffer(t.g.FRAMEBUFFER,null)}var ofe=class{H(){return`
157
+ `):"",this.name="UnsubscriptionError",this.errors=n}});function q3(t,e){if(t){var n=t.indexOf(e);0<=n&&t.splice(n,1)}}var gS=(function(){function t(e){this.initialTeardown=e,this.closed=!1,this._parentage=null,this._finalizers=null}return t.prototype.unsubscribe=function(){var e,n,r,i,s;if(!this.closed){this.closed=!0;var o=this._parentage;if(o)if(this._parentage=null,Array.isArray(o))try{for(var a=Yf(o),c=a.next();!c.done;c=a.next()){var l=c.value;l.remove(this)}}catch(v){e={error:v}}finally{try{c&&!c.done&&(n=a.return)&&n.call(a)}finally{if(e)throw e.error}}else o.remove(this);var d=this.initialTeardown;if(An(d))try{d()}catch(v){s=v instanceof o5?v.errors:[v]}var h=this._finalizers;if(h){this._finalizers=null;try{for(var m=Yf(h),g=m.next();!g.done;g=m.next()){var y=g.value;try{uz(y)}catch(v){s=s??[],v instanceof o5?s=oa(oa([],sa(s)),sa(v.errors)):s.push(v)}}}catch(v){r={error:v}}finally{try{g&&!g.done&&(i=m.return)&&i.call(m)}finally{if(r)throw r.error}}}if(s)throw new o5(s)}},t.prototype.add=function(e){var n;if(e&&e!==this)if(this.closed)uz(e);else{if(e instanceof t){if(e.closed||e._hasParent(this))return;e._addParent(this)}(this._finalizers=(n=this._finalizers)!==null&&n!==void 0?n:[]).push(e)}},t.prototype._hasParent=function(e){var n=this._parentage;return n===e||Array.isArray(n)&&n.includes(e)},t.prototype._addParent=function(e){var n=this._parentage;this._parentage=Array.isArray(n)?(n.push(e),n):n?[n,e]:e},t.prototype._removeParent=function(e){var n=this._parentage;n===e?this._parentage=null:Array.isArray(n)&&q3(n,e)},t.prototype.remove=function(e){var n=this._finalizers;n&&q3(n,e),e instanceof t&&e._removeParent(this)},t.EMPTY=(function(){var e=new t;return e.closed=!0,e})(),t})(),nle=gS.EMPTY;function rle(t){return t instanceof gS||t&&"closed"in t&&An(t.remove)&&An(t.add)&&An(t.unsubscribe)}function uz(t){An(t)?t():t.unsubscribe()}var yVe={Promise:void 0},bVe={setTimeout:function(t,e){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];return setTimeout.apply(void 0,oa([t,e],sa(n)))},clearTimeout:function(t){return clearTimeout(t)},delegate:void 0};function ile(t){bVe.setTimeout(function(){throw t})}function Bv(){}function uC(t){t()}var v9=(function(t){Bc(e,t);function e(n){var r=t.call(this)||this;return r.isStopped=!1,n?(r.destination=n,rle(n)&&n.add(r)):r.destination=wVe,r}return e.create=function(n,r,i){return new Hv(n,r,i)},e.prototype.next=function(n){this.isStopped||this._next(n)},e.prototype.error=function(n){this.isStopped||(this.isStopped=!0,this._error(n))},e.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},e.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,t.prototype.unsubscribe.call(this),this.destination=null)},e.prototype._next=function(n){this.destination.next(n)},e.prototype._error=function(n){try{this.destination.error(n)}finally{this.unsubscribe()}},e.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},e})(gS),_Ve=(function(){function t(e){this.partialObserver=e}return t.prototype.next=function(e){var n=this.partialObserver;if(n.next)try{n.next(e)}catch(r){Ww(r)}},t.prototype.error=function(e){var n=this.partialObserver;if(n.error)try{n.error(e)}catch(r){Ww(r)}else Ww(e)},t.prototype.complete=function(){var e=this.partialObserver;if(e.complete)try{e.complete()}catch(n){Ww(n)}},t})(),Hv=(function(t){Bc(e,t);function e(n,r,i){var s=t.call(this)||this,o;return An(n)||!n?o={next:n??void 0,error:r??void 0,complete:i??void 0}:o=n,s.destination=new _Ve(o),s}return e})(v9);function Ww(t){ile(t)}function SVe(t){throw t}var wVe={closed:!0,next:Bv,error:SVe,complete:Bv},y9=(function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"})();function md(t){return t}function EVe(t){return t.length===0?md:t.length===1?t[0]:function(n){return t.reduce(function(r,i){return i(r)},n)}}var tr=(function(){function t(e){e&&(this._subscribe=e)}return t.prototype.lift=function(e){var n=new t;return n.source=this,n.operator=e,n},t.prototype.subscribe=function(e,n,r){var i=this,s=TVe(e)?e:new Hv(e,n,r);return uC(function(){var o=i,a=o.operator,c=o.source;s.add(a?a.call(s,c):c?i._subscribe(s):i._trySubscribe(s))}),s},t.prototype._trySubscribe=function(e){try{return this._subscribe(e)}catch(n){e.error(n)}},t.prototype.forEach=function(e,n){var r=this;return n=dz(n),new n(function(i,s){var o=new Hv({next:function(a){try{e(a)}catch(c){s(c),o.unsubscribe()}},error:s,complete:i});r.subscribe(o)})},t.prototype._subscribe=function(e){var n;return(n=this.source)===null||n===void 0?void 0:n.subscribe(e)},t.prototype[y9]=function(){return this},t.prototype.pipe=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return EVe(e)(this)},t.prototype.toPromise=function(e){var n=this;return e=dz(e),new e(function(r,i){var s;n.subscribe(function(o){return s=o},function(o){return i(o)},function(){return r(s)})})},t.create=function(e){return new t(e)},t})();function dz(t){var e;return(e=t??yVe.Promise)!==null&&e!==void 0?e:Promise}function CVe(t){return t&&An(t.next)&&An(t.error)&&An(t.complete)}function TVe(t){return t&&t instanceof v9||CVe(t)&&rle(t)}function RVe(t){return An(t?.lift)}function nr(t){return function(e){if(RVe(e))return e.lift(function(n){try{return t(n,this)}catch(r){this.error(r)}});throw new TypeError("Unable to lift unknown Observable type")}}function Nn(t,e,n,r,i){return new kVe(t,e,n,r,i)}var kVe=(function(t){Bc(e,t);function e(n,r,i,s,o,a){var c=t.call(this,n)||this;return c.onFinalize=o,c.shouldUnsubscribe=a,c._next=r?function(l){try{r(l)}catch(d){n.error(d)}}:t.prototype._next,c._error=s?function(l){try{s(l)}catch(d){n.error(d)}finally{this.unsubscribe()}}:t.prototype._error,c._complete=i?function(){try{i()}catch(l){n.error(l)}finally{this.unsubscribe()}}:t.prototype._complete,c}return e.prototype.unsubscribe=function(){var n;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){var r=this.closed;t.prototype.unsubscribe.call(this),!r&&((n=this.onFinalize)===null||n===void 0||n.call(this))}},e})(v9),IVe=g9(function(t){return function(){t(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}}),sr=(function(t){Bc(e,t);function e(){var n=t.call(this)||this;return n.closed=!1,n.currentObservers=null,n.observers=[],n.isStopped=!1,n.hasError=!1,n.thrownError=null,n}return e.prototype.lift=function(n){var r=new fz(this,this);return r.operator=n,r},e.prototype._throwIfClosed=function(){if(this.closed)throw new IVe},e.prototype.next=function(n){var r=this;uC(function(){var i,s;if(r._throwIfClosed(),!r.isStopped){r.currentObservers||(r.currentObservers=Array.from(r.observers));try{for(var o=Yf(r.currentObservers),a=o.next();!a.done;a=o.next()){var c=a.value;c.next(n)}}catch(l){i={error:l}}finally{try{a&&!a.done&&(s=o.return)&&s.call(o)}finally{if(i)throw i.error}}}})},e.prototype.error=function(n){var r=this;uC(function(){if(r._throwIfClosed(),!r.isStopped){r.hasError=r.isStopped=!0,r.thrownError=n;for(var i=r.observers;i.length;)i.shift().error(n)}})},e.prototype.complete=function(){var n=this;uC(function(){if(n._throwIfClosed(),!n.isStopped){n.isStopped=!0;for(var r=n.observers;r.length;)r.shift().complete()}})},e.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null},Object.defineProperty(e.prototype,"observed",{get:function(){var n;return((n=this.observers)===null||n===void 0?void 0:n.length)>0},enumerable:!1,configurable:!0}),e.prototype._trySubscribe=function(n){return this._throwIfClosed(),t.prototype._trySubscribe.call(this,n)},e.prototype._subscribe=function(n){return this._throwIfClosed(),this._checkFinalizedStatuses(n),this._innerSubscribe(n)},e.prototype._innerSubscribe=function(n){var r=this,i=this,s=i.hasError,o=i.isStopped,a=i.observers;return s||o?nle:(this.currentObservers=null,a.push(n),new gS(function(){r.currentObservers=null,q3(a,n)}))},e.prototype._checkFinalizedStatuses=function(n){var r=this,i=r.hasError,s=r.thrownError,o=r.isStopped;i?n.error(s):o&&n.complete()},e.prototype.asObservable=function(){var n=new tr;return n.source=this,n},e.create=function(n,r){return new fz(n,r)},e})(tr),fz=(function(t){Bc(e,t);function e(n,r){var i=t.call(this)||this;return i.destination=n,i.source=r,i}return e.prototype.next=function(n){var r,i;(i=(r=this.destination)===null||r===void 0?void 0:r.next)===null||i===void 0||i.call(r,n)},e.prototype.error=function(n){var r,i;(i=(r=this.destination)===null||r===void 0?void 0:r.error)===null||i===void 0||i.call(r,n)},e.prototype.complete=function(){var n,r;(r=(n=this.destination)===null||n===void 0?void 0:n.complete)===null||r===void 0||r.call(n)},e.prototype._subscribe=function(n){var r,i;return(i=(r=this.source)===null||r===void 0?void 0:r.subscribe(n))!==null&&i!==void 0?i:nle},e})(sr),cr=(function(t){Bc(e,t);function e(n){var r=t.call(this)||this;return r._value=n,r}return Object.defineProperty(e.prototype,"value",{get:function(){return this.getValue()},enumerable:!1,configurable:!0}),e.prototype._subscribe=function(n){var r=t.prototype._subscribe.call(this,n);return!r.closed&&n.next(this._value),r},e.prototype.getValue=function(){var n=this,r=n.hasError,i=n.thrownError,s=n._value;if(r)throw i;return this._throwIfClosed(),s},e.prototype.next=function(n){t.prototype.next.call(this,this._value=n)},e})(sr),xVe={now:function(){return Date.now()}},AVe=(function(t){Bc(e,t);function e(n,r){return t.call(this)||this}return e.prototype.schedule=function(n,r){return this},e})(gS),hz={setInterval:function(t,e){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];return setInterval.apply(void 0,oa([t,e],sa(n)))},clearInterval:function(t){return clearInterval(t)},delegate:void 0},MVe=(function(t){Bc(e,t);function e(n,r){var i=t.call(this,n,r)||this;return i.scheduler=n,i.work=r,i.pending=!1,i}return e.prototype.schedule=function(n,r){var i;if(r===void 0&&(r=0),this.closed)return this;this.state=n;var s=this.id,o=this.scheduler;return s!=null&&(this.id=this.recycleAsyncId(o,s,r)),this.pending=!0,this.delay=r,this.id=(i=this.id)!==null&&i!==void 0?i:this.requestAsyncId(o,this.id,r),this},e.prototype.requestAsyncId=function(n,r,i){return i===void 0&&(i=0),hz.setInterval(n.flush.bind(n,this),i)},e.prototype.recycleAsyncId=function(n,r,i){if(i===void 0&&(i=0),i!=null&&this.delay===i&&this.pending===!1)return r;r!=null&&hz.clearInterval(r)},e.prototype.execute=function(n,r){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;var i=this._execute(n,r);if(i)return i;this.pending===!1&&this.id!=null&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))},e.prototype._execute=function(n,r){var i=!1,s;try{this.work(n)}catch(o){i=!0,s=o||new Error("Scheduled action threw falsy error")}if(i)return this.unsubscribe(),s},e.prototype.unsubscribe=function(){if(!this.closed){var n=this,r=n.id,i=n.scheduler,s=i.actions;this.work=this.state=this.scheduler=null,this.pending=!1,q3(s,this),r!=null&&(this.id=this.recycleAsyncId(i,r,null)),this.delay=null,t.prototype.unsubscribe.call(this)}},e})(AVe),pz=(function(){function t(e,n){n===void 0&&(n=t.now),this.schedulerActionCtor=e,this.now=n}return t.prototype.schedule=function(e,n,r){return n===void 0&&(n=0),new this.schedulerActionCtor(this,e).schedule(r,n)},t.now=xVe.now,t})(),LVe=(function(t){Bc(e,t);function e(n,r){r===void 0&&(r=pz.now);var i=t.call(this,n,r)||this;return i.actions=[],i._active=!1,i}return e.prototype.flush=function(n){var r=this.actions;if(this._active){r.push(n);return}var i;this._active=!0;do if(i=n.execute(n.state,n.delay))break;while(n=r.shift());if(this._active=!1,i){for(;n=r.shift();)n.unsubscribe();throw i}},e})(pz),$R=new LVe(MVe),OVe=$R,b9=new tr(function(t){return t.complete()});function sle(t){return t&&An(t.schedule)}function _9(t){return t[t.length-1]}function ole(t){return An(_9(t))?t.pop():void 0}function vS(t){return sle(_9(t))?t.pop():void 0}function PVe(t,e){return typeof _9(t)=="number"?t.pop():e}var S9=(function(t){return t&&typeof t.length=="number"&&typeof t!="function"});function ale(t){return An(t?.then)}function cle(t){return An(t[y9])}function lle(t){return Symbol.asyncIterator&&An(t?.[Symbol.asyncIterator])}function ule(t){return new TypeError("You provided "+(t!==null&&typeof t=="object"?"an invalid object":"'"+t+"'")+" where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.")}function DVe(){return typeof Symbol!="function"||!Symbol.iterator?"@@iterator":Symbol.iterator}var dle=DVe();function fle(t){return An(t?.[dle])}function hle(t){return Y7(this,arguments,function(){var n,r,i,s;return dR(this,function(o){switch(o.label){case 0:n=t.getReader(),o.label=1;case 1:o.trys.push([1,,9,10]),o.label=2;case 2:return[4,Ku(n.read())];case 3:return r=o.sent(),i=r.value,s=r.done,s?[4,Ku(void 0)]:[3,5];case 4:return[2,o.sent()];case 5:return[4,Ku(i)];case 6:return[4,o.sent()];case 7:return o.sent(),[3,2];case 8:return[3,10];case 9:return n.releaseLock(),[7];case 10:return[2]}})})}function ple(t){return An(t?.getReader)}function _i(t){if(t instanceof tr)return t;if(t!=null){if(cle(t))return NVe(t);if(S9(t))return UVe(t);if(ale(t))return jVe(t);if(lle(t))return mle(t);if(fle(t))return FVe(t);if(ple(t))return $Ve(t)}throw ule(t)}function NVe(t){return new tr(function(e){var n=t[y9]();if(An(n.subscribe))return n.subscribe(e);throw new TypeError("Provided object does not correctly implement Symbol.observable")})}function UVe(t){return new tr(function(e){for(var n=0;n<t.length&&!e.closed;n++)e.next(t[n]);e.complete()})}function jVe(t){return new tr(function(e){t.then(function(n){e.closed||(e.next(n),e.complete())},function(n){return e.error(n)}).then(null,ile)})}function FVe(t){return new tr(function(e){var n,r;try{for(var i=Yf(t),s=i.next();!s.done;s=i.next()){var o=s.value;if(e.next(o),e.closed)return}}catch(a){n={error:a}}finally{try{s&&!s.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}e.complete()})}function mle(t){return new tr(function(e){BVe(t,e).catch(function(n){return e.error(n)})})}function $Ve(t){return mle(hle(t))}function BVe(t,e){var n,r,i,s;return W7(this,void 0,void 0,function(){var o,a;return dR(this,function(c){switch(c.label){case 0:c.trys.push([0,5,6,11]),n=J7(t),c.label=1;case 1:return[4,n.next()];case 2:if(r=c.sent(),!!r.done)return[3,4];if(o=r.value,e.next(o),e.closed)return[2];c.label=3;case 3:return[3,1];case 4:return[3,11];case 5:return a=c.sent(),i={error:a},[3,11];case 6:return c.trys.push([6,,9,10]),r&&!r.done&&(s=n.return)?[4,s.call(n)]:[3,8];case 7:c.sent(),c.label=8;case 8:return[3,10];case 9:if(i)throw i.error;return[7];case 10:return[7];case 11:return e.complete(),[2]}})})}function Df(t,e,n,r,i){r===void 0&&(r=0),i===void 0&&(i=!1);var s=e.schedule(function(){n(),i?t.add(this.schedule(null,r)):this.unsubscribe()},r);if(t.add(s),!i)return s}function gle(t,e){return e===void 0&&(e=0),nr(function(n,r){n.subscribe(Nn(r,function(i){return Df(r,t,function(){return r.next(i)},e)},function(){return Df(r,t,function(){return r.complete()},e)},function(i){return Df(r,t,function(){return r.error(i)},e)}))})}function vle(t,e){return e===void 0&&(e=0),nr(function(n,r){r.add(t.schedule(function(){return n.subscribe(r)},e))})}function HVe(t,e){return _i(t).pipe(vle(e),gle(e))}function qVe(t,e){return _i(t).pipe(vle(e),gle(e))}function VVe(t,e){return new tr(function(n){var r=0;return e.schedule(function(){r===t.length?n.complete():(n.next(t[r++]),n.closed||this.schedule())})})}function KVe(t,e){return new tr(function(n){var r;return Df(n,e,function(){r=t[dle](),Df(n,e,function(){var i,s,o;try{i=r.next(),s=i.value,o=i.done}catch(a){n.error(a);return}o?n.complete():n.next(s)},0,!0)}),function(){return An(r?.return)&&r.return()}})}function yle(t,e){if(!t)throw new Error("Iterable cannot be null");return new tr(function(n){Df(n,e,function(){var r=t[Symbol.asyncIterator]();Df(n,e,function(){r.next().then(function(i){i.done?n.complete():n.next(i.value)})},0,!0)})})}function GVe(t,e){return yle(hle(t),e)}function zVe(t,e){if(t!=null){if(cle(t))return HVe(t,e);if(S9(t))return VVe(t,e);if(ale(t))return qVe(t,e);if(lle(t))return yle(t,e);if(fle(t))return KVe(t,e);if(ple(t))return GVe(t,e)}throw ule(t)}function Zf(t,e){return e?zVe(t,e):_i(t)}function pt(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=vS(t);return Zf(t,n)}var w9=g9(function(t){return function(){t(this),this.name="EmptyError",this.message="no elements in sequence"}});function WVe(t,e){return new Promise(function(n,r){var i=new Hv({next:function(s){n(s),i.unsubscribe()},error:r,complete:function(){r(new w9)}});t.subscribe(i)})}function YVe(t){return t instanceof Date&&!isNaN(t)}function ge(t,e){return nr(function(n,r){var i=0;n.subscribe(Nn(r,function(s){r.next(t.call(e,s,i++))}))})}var JVe=Array.isArray;function XVe(t,e){return JVe(e)?t.apply(void 0,oa([],sa(e))):t(e)}function ble(t){return ge(function(e){return XVe(t,e)})}var QVe=Array.isArray,ZVe=Object.getPrototypeOf,eKe=Object.prototype,tKe=Object.keys;function nKe(t){if(t.length===1){var e=t[0];if(QVe(e))return{args:e,keys:null};if(rKe(e)){var n=tKe(e);return{args:n.map(function(r){return e[r]}),keys:n}}}return{args:t,keys:null}}function rKe(t){return t&&typeof t=="object"&&ZVe(t)===eKe}function iKe(t,e){return t.reduce(function(n,r,i){return n[r]=e[i],n},{})}function mt(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=vS(t),r=ole(t),i=nKe(t),s=i.args,o=i.keys;if(s.length===0)return Zf([],n);var a=new tr(sKe(s,n,o?function(c){return iKe(o,c)}:md));return r?a.pipe(ble(r)):a}function sKe(t,e,n){return n===void 0&&(n=md),function(r){mz(e,function(){for(var i=t.length,s=new Array(i),o=i,a=i,c=function(d){mz(e,function(){var h=Zf(t[d],e),m=!1;h.subscribe(Nn(r,function(g){s[d]=g,m||(m=!0,a--),a||r.next(n(s.slice()))},function(){--o||r.complete()}))},r)},l=0;l<i;l++)c(l)},r)}}function mz(t,e,n){t?Df(n,t,e):e()}function oKe(t,e,n,r,i,s,o,a){var c=[],l=0,d=0,h=!1,m=function(){h&&!c.length&&!l&&e.complete()},g=function(v){return l<r?y(v):c.push(v)},y=function(v){l++;var E=!1;_i(n(v,d++)).subscribe(Nn(e,function(w){e.next(w)},function(){E=!0},void 0,function(){if(E)try{l--;for(var w=function(){var k=c.shift();o||y(k)};c.length&&l<r;)w();m()}catch(k){e.error(k)}}))};return t.subscribe(Nn(e,g,function(){h=!0,m()})),function(){}}function BR(t,e,n){return n===void 0&&(n=1/0),An(e)?BR(function(r,i){return ge(function(s,o){return e(r,s,i,o)})(_i(t(r,i)))},n):(typeof e=="number"&&(n=e),nr(function(r,i){return oKe(r,i,t,n)}))}function _le(t){return t===void 0&&(t=1/0),BR(md,t)}function aKe(){return _le(1)}function qv(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return aKe()(Zf(t,vS(t)))}function cKe(t){return new tr(function(e){_i(t()).subscribe(e)})}var lKe=["addListener","removeListener"],uKe=["addEventListener","removeEventListener"],dKe=["on","off"];function Es(t,e,n,r){if(An(n)&&(r=n,n=void 0),r)return Es(t,e,n).pipe(ble(r));var i=sa(pKe(t)?uKe.map(function(a){return function(c){return t[a](e,c,n)}}):fKe(t)?lKe.map(gz(t,e)):hKe(t)?dKe.map(gz(t,e)):[],2),s=i[0],o=i[1];if(!s&&S9(t))return BR(function(a){return Es(a,e,n)})(_i(t));if(!s)throw new TypeError("Invalid event target");return new tr(function(a){var c=function(){for(var l=[],d=0;d<arguments.length;d++)l[d]=arguments[d];return a.next(1<l.length?l:l[0])};return s(c),function(){return o(c)}})}function gz(t,e){return function(n){return function(r){return t[n](e,r)}}}function fKe(t){return An(t.addListener)&&An(t.removeListener)}function hKe(t){return An(t.on)&&An(t.off)}function pKe(t){return An(t.addEventListener)&&An(t.removeEventListener)}function Nf(t,e,n){t===void 0&&(t=0),n===void 0&&(n=OVe);var r=-1;return e!=null&&(sle(e)?n=e:r=e),new tr(function(i){var s=YVe(t)?+t-n.now():t;s<0&&(s=0);var o=0;return n.schedule(function(){i.closed||(i.next(o++),0<=r?this.schedule(void 0,r):i.complete())},s)})}function mKe(t,e){return e===void 0&&(e=$R),Nf(t,t,e)}function Nc(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=vS(t),r=PVe(t,1/0),i=t;return i.length?i.length===1?_i(i[0]):_le(r)(Zf(i,n)):b9}var vb=new tr(Bv),gKe=Array.isArray;function vKe(t){return t.length===1&&gKe(t[0])?t[0]:t}function Fr(t,e){return nr(function(n,r){var i=0;n.subscribe(Nn(r,function(s){return t.call(e,s,i++)&&r.next(s)}))})}function yKe(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return t=vKe(t),t.length===1?_i(t[0]):new tr(bKe(t))}function bKe(t){return function(e){for(var n=[],r=function(s){n.push(_i(t[s]).subscribe(Nn(e,function(o){if(n){for(var a=0;a<n.length;a++)a!==s&&n[a].unsubscribe();n=null}e.next(o)})))},i=0;n&&!e.closed&&i<t.length;i++)r(i)}}function Sle(t){return nr(function(e,n){var r=!1,i=null,s=null,o=!1,a=function(){if(s?.unsubscribe(),s=null,r){r=!1;var l=i;i=null,n.next(l)}o&&n.complete()},c=function(){s=null,o&&n.complete()};e.subscribe(Nn(n,function(l){r=!0,i=l,s||_i(t(l)).subscribe(s=Nn(n,a,c))},function(){o=!0,(!r||!s||s.closed)&&n.complete()}))})}function HR(t){return nr(function(e,n){var r=null,i=!1,s;r=e.subscribe(Nn(n,void 0,void 0,function(o){s=_i(t(o,HR(t)(e))),r?(r.unsubscribe(),r=null,s.subscribe(n)):i=!0})),i&&(r.unsubscribe(),r=null,s.subscribe(n))})}function _Ke(t,e,n,r,i){return function(s,o){var a=n,c=e,l=0;s.subscribe(Nn(o,function(d){var h=l++;c=a?t(c,d,h):(a=!0,d),o.next(c)},i))}}function SKe(t){return nr(function(e,n){var r=!1;e.subscribe(Nn(n,function(i){r=!0,n.next(i)},function(){r||n.next(t),n.complete()}))})}function qR(t){return t<=0?function(){return b9}:nr(function(e,n){var r=0;e.subscribe(Nn(n,function(i){++r<=t&&(n.next(i),t<=r&&n.complete())}))})}function wKe(){return nr(function(t,e){t.subscribe(Nn(e,Bv))})}function EKe(t){return ge(function(){return t})}function CKe(t,e){return BR(function(n,r){return _i(t(n,r)).pipe(qR(1),EKe(n))})}function TKe(t,e){e===void 0&&(e=$R);var n=Nf(t,e);return CKe(function(){return n})}function Ni(t,e){return e===void 0&&(e=md),t=t??RKe,nr(function(n,r){var i,s=!0;n.subscribe(Nn(r,function(o){var a=e(o);(s||!t(i,a))&&(s=!1,i=a,r.next(o))}))})}function RKe(t,e){return t===e}function kKe(t){return t===void 0&&(t=IKe),nr(function(e,n){var r=!1;e.subscribe(Nn(n,function(i){r=!0,n.next(i)},function(){return r?n.complete():n.error(t())}))})}function IKe(){return new w9}function wle(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return function(n){return qv(n,pt.apply(void 0,oa([],sa(t))))}}function xKe(t){return nr(function(e,n){try{e.subscribe(n)}finally{n.add(t)}})}function AKe(t,e){var n=arguments.length>=2;return function(r){return r.pipe(t?Fr(function(i,s){return t(i,s,r)}):md,qR(1),n?SKe(e):kKe(function(){return new w9}))}}function Vv(){return nr(function(t,e){var n,r=!1;t.subscribe(Nn(e,function(i){var s=n;n=i,r&&e.next([s,i]),r=!0}))})}function pl(t,e){return nr(_Ke(t,e,arguments.length>=2,!0))}function MKe(t){t===void 0&&(t={});var e=t.connector,n=e===void 0?function(){return new sr}:e,r=t.resetOnError,i=r===void 0?!0:r,s=t.resetOnComplete,o=s===void 0?!0:s,a=t.resetOnRefCountZero,c=a===void 0?!0:a;return function(l){var d,h,m,g=0,y=!1,v=!1,E=function(){h?.unsubscribe(),h=void 0},w=function(){E(),d=m=void 0,y=v=!1},k=function(){var x=d;w(),x?.unsubscribe()};return nr(function(x,C){g++,!v&&!y&&E();var R=m=m??n();C.add(function(){g--,g===0&&!v&&!y&&(h=a5(k,c))}),R.subscribe(C),!d&&g>0&&(d=new Hv({next:function(T){return R.next(T)},error:function(T){v=!0,E(),h=a5(w,i,T),R.error(T)},complete:function(){y=!0,E(),h=a5(w,o),R.complete()}}),_i(x).subscribe(d))})(l)}}function a5(t,e){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];if(e===!0){t();return}if(e!==!1){var i=new Hv({next:function(){i.unsubscribe(),t()}});return _i(e.apply(void 0,oa([],sa(n)))).subscribe(i)}}function Ele(t){return nr(function(e,n){var r=!1,i=0;e.subscribe(Nn(n,function(s){return(r||(r=!t(s,i++)))&&n.next(s)}))})}function pn(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=vS(t);return nr(function(r,i){(n?qv(t,r,n):qv(t,r)).subscribe(i)})}function rt(t,e){return nr(function(n,r){var i=null,s=0,o=!1,a=function(){return o&&!i&&r.complete()};n.subscribe(Nn(r,function(c){i?.unsubscribe();var l=0,d=s++;_i(t(c,d)).subscribe(i=Nn(r,function(h){return r.next(e?e(c,h,d,l++):h)},function(){i=null,a()}))},function(){o=!0,a()}))})}function LKe(){return rt(md)}function OKe(t,e){return nr(function(n,r){var i=e;return rt(function(s,o){return t(i,s,o)},function(s,o){return i=o,o})(n).subscribe(r),function(){i=null}})}function Cle(t){return nr(function(e,n){_i(t).subscribe(Nn(n,function(){return n.complete()},Bv)),!n.closed&&e.subscribe(n)})}function PKe(t,e){return e===void 0&&(e=!1),nr(function(n,r){var i=0;n.subscribe(Nn(r,function(s){var o=t(s,i++);(o||e)&&r.next(s),!o&&r.complete()}))})}function ec(t,e,n){var r=An(t)||e||n?{next:t,error:e,complete:n}:t;return r?nr(function(i,s){var o;(o=r.subscribe)===null||o===void 0||o.call(r);var a=!0;i.subscribe(Nn(s,function(c){var l;(l=r.next)===null||l===void 0||l.call(r,c),s.next(c)},function(){var c;a=!1,(c=r.complete)===null||c===void 0||c.call(r),s.complete()},function(c){var l;a=!1,(l=r.error)===null||l===void 0||l.call(r,c),s.error(c)},function(){var c,l;a&&((c=r.unsubscribe)===null||c===void 0||c.call(r)),(l=r.finalize)===null||l===void 0||l.call(r)}))}):md}function DKe(t,e){return nr(function(n,r){var i=e??{},s=i.leading,o=s===void 0?!0:s,a=i.trailing,c=a===void 0?!1:a,l=!1,d=null,h=null,m=!1,g=function(){h?.unsubscribe(),h=null,c&&(E(),m&&r.complete())},y=function(){h=null,m&&r.complete()},v=function(w){return h=_i(t(w)).subscribe(Nn(r,g,y))},E=function(){if(l){l=!1;var w=d;d=null,r.next(w),!m&&v(w)}};n.subscribe(Nn(r,function(w){l=!0,d=w,!(h&&!h.closed)&&(o?E():v(w))},function(){m=!0,!(c&&l&&h&&!h.closed)&&r.complete()}))})}function sO(t,e,n){e===void 0&&(e=$R);var r=Nf(t,e);return DKe(function(){return r},n)}function Tle(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=ole(t);return nr(function(r,i){for(var s=t.length,o=new Array(s),a=t.map(function(){return!1}),c=!1,l=function(h){_i(t[h]).subscribe(Nn(i,function(m){o[h]=m,!c&&!a[h]&&(a[h]=!0,(c=a.every(md))&&(a=null))},Bv))},d=0;d<s;d++)l(d);r.subscribe(Nn(i,function(h){if(c){var m=oa([h],sa(o));i.next(n?n.apply(void 0,oa([],sa(m))):m)}}))})}class Hi{constructor(e,n){this.defaultValue=n,this.setValue=(s,o)=>{this._value$.next(s),this._lastUpdateReason$.next(o??null),localStorage.setItem(this.key,JSON.stringify(s))},this.getValue=()=>this._value$.getValue(),this.key=`matrix-setting-${e}`;const r=localStorage.getItem(this.key);let i=n;if(r!==null)try{i=JSON.parse(r)}catch(s){N.warn(`Invalid value stored for setting ${e}: ${r}.`,s)}this._value$=new cr(i),this.value$=this._value$,this._lastUpdateReason$=new cr(null),this.lastUpdateReason$=this._lastUpdateReason$}}function Ur(t){return[je(t.value$),t.setValue]}const Rle=new Hi("opt-in-analytics",null),VR=()=>{const t=Ur(Rle);return en.instance.isEnabled()?t:[!1,null]},kle=new Hi("developer-settings-tab",!1),Ile=new Hi("duplicate-tiles",0),E9=new Hi("debug-tile-layout",!1),V3=new Hi("show-connection-stats",!1),vz=new Hi("audio-input",void 0),yz=new Hi("audio-output",void 0),bz=new Hi("video-input",void 0),xle=new Hi("background-blur",!1),Ale=new Hi("hand-raised-show-timer",!1),Mle=new Hi("reactions-show",!0),C9=new Hi("reactions-play-sound",!0),Lle=new Hi("sound-effect-volume",.5),Ole=new Hi("mute-all-audio",!1),_z=new Hi("always-show-self",!0),Ple=new Hi("always-show-iphone-earpiece",!1);var lo=(t=>(t.Legacy="legacy",t.Compatibility="compatibility",t.Matrix_2_0="matrix_2_0",t))(lo||{});const Dle=new Hi("matrix-rtc-mode","legacy"),Nle=new Hi("custom-livekit-url",null);var KR=(t=>(t[t.Guest=0]="Guest",t[t.Registered=1]="Registered",t))(KR||{});const dl=class dl{constructor(e){this.posthog=e,this.enabled=!1,this.anonymity=0,this.platformSuperProperties={},this.registrationType=0,this.optInListener=null,this.sanitizeProperties=(i,s)=>(this.anonymity==1&&(i.$referrer=null,i.$referring_domain=null,i.$initial_referrer=null,i.$initial_referring_domain=null,i.$device_id=null),i.$current_url=i.$current_url.split("/").slice(0,3).join(""),i),this.eventCallEnded=new cVe,this.eventSignup=new uVe,this.eventCallStarted=new lVe,this.eventLogin=new dVe,this.eventMuteMicrophone=new fVe,this.eventMuteCamera=new hVe,this.eventUndecryptableToDevice=new pVe,this.eventQualitySurvey=new mVe,this.eventCallDisconnected=new gVe,this.eventCallConnectDuration=new vVe;let n,r;n=er().posthogApiKey??void 0,r=er().posthogApiHost??void 0,n&&r?(this.posthog.init(n,{api_host:r,autocapture:!1,mask_all_text:!0,mask_all_element_attributes:!0,capture_pageview:!1,sanitize_properties:this.sanitizeProperties,respect_dnt:!0,advanced_disable_decide:!0}),this.enabled=!0):(N.info("Posthog is not enabled because there is no api key or no host given in the config"),this.enabled=!1)}static hasInstance(){return!!this.internalInstance}static get instance(){return this.internalInstance||(this.internalInstance=new dl(aVe)),this.internalInstance}static resetInstance(){this.internalInstance=null}registerSuperProperties(e){this.enabled&&this.posthog.register(e)}static getPlatformProperties(){return{appVersion:"embedded-v0.19.0",matrixBackend:vt?"embedded":"jssdk",callBackend:"livekit",cryptoVersion:vt?void 0:window.matrixclient?.getCrypto()?.getVersion()}}capture(e,n,r){this.enabled&&this.posthog.capture(e,{...n},r)}isEnabled(){return this.enabled}setAnonymity(e){this.enabled&&(e==0||e==1)&&(this.posthog.reset(),this.updateSuperProperties()),this.anonymity=e}static getRandomAnalyticsId(){return[...crypto.getRandomValues(new Uint8Array(16))].map(e=>e.toString(16)).join("")}async identifyUser(e){if(this.anonymity==2&&this.enabled){let n=await this.getAnalyticsId();try{!n&&!vt&&(n=e(),await this.setAccountAnalyticsId(n))}catch(r){N.log("Unable to identify user for tracking"+r?.toString())}n?this.posthog.identify(n):N.info("No analyticsID is available. Should not try to setup posthog")}}async getAnalyticsId(){const e=window.matrixclient;return vt?er().posthogUserId:(await e.getAccountDataFromServer(dl.ANALYTICS_EVENT_TYPE))?.id??null}async setAccountAnalyticsId(e){if(!vt){const n=window.matrixclient,r=await n.getAccountDataFromServer(dl.ANALYTICS_EVENT_TYPE);await n.setAccountData(dl.ANALYTICS_EVENT_TYPE,Object.assign({id:e},r))}}getAnonymity(){return this.anonymity}logout(){this.enabled&&this.posthog.reset(),this.optInListener?.unsubscribe(),this.optInListener=null,this.setAnonymity(0)}onLoginStatusChanged(){this.maybeIdentifyUser().catch(()=>N.log("Could not identify user on login status change"))}updateSuperProperties(){this.platformSuperProperties=dl.getPlatformProperties(),this.registerSuperProperties({...this.platformSuperProperties,registrationType:this.registrationType==0?"Guest":"Registered"})}userRegisteredInThisSession(){return this.eventSignup.getSignupEndTime()>new Date(0)}async maybeIdentifyUser(){window.matrixclient&&(this.anonymity===2&&(this.setRegistrationType(window.matrixclient.isGuest()||window.passwordlessUser?0:1),this.identificationPromise=this.identifyUser(dl.getRandomAnalyticsId),await this.identificationPromise,this.userRegisteredInThisSession()&&this.eventSignup.track()),this.anonymity!==0&&this.updateSuperProperties())}trackEvent({eventName:e,...n},r){const i=()=>{this.anonymity==0||this.anonymity==1||this.capture(e,n,r)};this.identificationPromise?this.identificationPromise.then(i,s=>{N.error("Failed to identify user for tracking",s)}):i()}startListeningToSettingsChanges(){this.optInListener??=Rle.value$.subscribe(e=>{this.setAnonymity(e?2:0),this.maybeIdentifyUser().catch(()=>N.log("Could not identify user"))})}setRegistrationType(e){this.registrationType=e,!(this.anonymity==0||this.anonymity==1)&&this.updateSuperProperties()}};dl.ANALYTICS_EVENT_TYPE="im.vector.analytics",dl.internalInstance=null;let en=dl;const T9=_.createContext(void 0);T9.Provider;const xy=()=>_.use(T9);function hm(){let t,e;const n=xy();return n?.state==="valid"&&(t=n.authenticated?.client,e=n.setClient),{client:t,setClient:e}}function R9(){const t=xy();let e,n,r=!1,i=!0,s,o=!1,a;return t?.state==="valid"?(e=t.authenticated?.client,n=t.setClient,r=t.authenticated?.isPasswordlessUser??!1,i=!1,o=e!==void 0,a=t.authenticated?.logout):t?.state==="error"&&(s=t.error,i=!1),{client:e,setClient:n,passwordlessUser:r,loading:i,authenticated:o,logout:a,error:s}}const Sz="BroadcastChannel"in window?new BroadcastChannel("load"):null,NKe=({children:t})=>{const e=Fl(),[n,r]=_.useState(void 0),i=_.useRef(!1);_.useEffect(()=>{i.current||(i.current=!0,UKe().then(E=>{r(E),en.instance.isEnabled()&&en.instance.startListeningToSettingsChanges()}).catch(E=>N.error(E)).finally(()=>i.current=!1))},[]);const s=_.useCallback(async E=>{const w=jle();!n?.client||!w||(await n.client.setPassword({type:"m.login.password",identifier:{type:"m.id.user",user:w.user_id},user:w.user_id,password:w.tempPassword},E),wz({...w,passwordlessUser:!1}),r({...n,passwordlessUser:!1}))},[n]),o=_.useCallback((E,w)=>{const k=n?.client;k&&k!==E&&k.stopClient(),wz(w),r({widgetApi:null,client:E,passwordlessUser:w.passwordlessUser}),en.instance.isEnabled()&&en.instance.startListeningToSettingsChanges()},[n?.client]),a=_.useCallback(async()=>{const E=n?.client;E&&(await E.logout(!0),await E.clearStores(),Ule(),r(null),await e("/"),en.instance.logout(),en.instance.setRegistrationType(KR.Guest))},[e,n?.client]);_.useEffect(()=>{vt||Sz?.postMessage({})},[]);const[c,l]=_.useState(void 0);oC(Sz,"message",_.useCallback(()=>{n?.client.stopClient(),l(new AHe)},[n?.client,l]));const[d,h]=_.useState(!1),[m,g]=_.useState(!1),y=_.useMemo(()=>c?{state:"error",error:c}:n===void 0?void 0:{state:"valid",authenticated:n===null?void 0:{client:n.client,isPasswordlessUser:n.passwordlessUser,changePassword:s,logout:a},setClient:o,disconnected:d,supportedFeatures:{reactions:m}},[c,s,n,a,o,d,m]),v=_.useCallback((E,w,k)=>{h(jKe(E,k))},[]);return _.useEffect(()=>{if(n){if(window.matrixclient=n.client,window.passwordlessUser=n.passwordlessUser,en.hasInstance()&&en.instance.onLoginStatusChanged(),n.client&&n.client.on(De.Sync,v),n.widgetApi){const E=n.widgetApi.hasCapability("org.matrix.msc2762.send.event:m.reaction"),w=n.widgetApi.hasCapability("org.matrix.msc2762.send.event:m.room.redaction"),k=n.widgetApi.hasCapability("org.matrix.msc2762.receive.event:m.reaction"),x=n.widgetApi.hasCapability("org.matrix.msc2762.receive.event:m.room.redaction");!E||!k||!w||!x?(N.warn("Widget does not support reactions"),g(!1)):g(!0)}else g(!0);return()=>{n.client&&n.client.removeListener(De.Sync,v)}}},[n,v]),c?S.jsx(v_,{widget:vt,error:c}):S.jsx(T9,{value:y,children:t})};async function UKe(){if(vt){N.log("Using a matryoshka client");const t=await vt.client;return{widgetApi:vt.api,client:t,passwordlessUser:!1}}else{const{initSPA:t}=await Mb(async()=>{const{initSPA:e}=await import("./spa-DUaXf-XW.js");return{initSPA:e}},[],import.meta.url);return t(jle,Ule)}}const Ule=()=>localStorage.removeItem("matrix-auth-store"),wz=t=>localStorage.setItem("matrix-auth-store",JSON.stringify(t)),jle=()=>{const t=localStorage.getItem("matrix-auth-store");if(t)return JSON.parse(t)},jKe=(t,e)=>t==="ERROR"&&e?.error?.name==="ConnectionError";function yS(t){const[{success:e,loading:n,displayName:r,avatarUrl:i,error:s},o]=_.useState(()=>{let c;return t&&(c=t.getUser(t.getUserId())??void 0),{success:!1,loading:!1,displayName:c?.rawDisplayName,avatarUrl:c?.avatarUrl,error:void 0}});_.useEffect(()=>{const c=(d,{displayName:h,avatarUrl:m})=>{o({success:!1,loading:!1,displayName:h,avatarUrl:m,error:void 0})};let l;if(t){const d=t.getUserId();l=t.getUser(d),l?.on(Xi.DisplayName,c),l?.on(Xi.AvatarUrl,c)}return()=>{l&&(l.removeListener(Xi.DisplayName,c),l.removeListener(Xi.AvatarUrl,c))}},[t]);const a=_.useCallback(async({displayName:c,avatar:l,removeAvatar:d})=>{if(t){o(h=>({...h,loading:!0,error:void 0,success:!1}));try{await t.setDisplayName(c);let h;d?await t.setAvatarUrl(""):l&&({content_uri:h}=await t.uploadContent(l),await t.setAvatarUrl(h)),o(m=>({...m,displayName:c,avatarUrl:d?void 0:h??m.avatarUrl,loading:!1,success:!0}))}catch(h){o(m=>({...m,loading:!1,error:h instanceof Error?h:Error(h),success:!1}))}}else N.error("Client not initialized before calling saveProfile")},[t]);return{loading:n,error:s,displayName:r,avatarUrl:i,saveProfile:a,success:e}}const FKe="_settingsModal_1dkeq_8",$Ke="_volumeSlider_1dkeq_20",Ez={settingsModal:FKe,volumeSlider:$Ke},BKe="_tabContainer_1nnp9_8",HKe="_tabList_1nnp9_14",Cz={tabContainer:BKe,tabList:HKe};function qKe({label:t,tab:e,onTabChange:n,tabs:r}){const i=_.useId();return S.jsxs("div",{className:Cz.tabContainer,children:[S.jsx(j9e,{role:"tablist","aria-label":t,className:Cz.tabList,children:r.map(({key:s,name:o})=>S.jsx(H9e,{"aria-controls":`${i}[${s}]`,onClick:()=>n(s),active:s===e,children:o},s))}),r.map(({key:s,content:o})=>S.jsx("div",{id:`${i}[${s}]`,style:{display:s===e?void 0:"none"},children:o},s))]})}const VKe="_fieldRow_iwncy_8",KKe="_field_iwncy_8",GKe="_rightAlign_iwncy_21",zKe="_inputField_iwncy_33",WKe="_disabled_iwncy_52",YKe="_prefix_iwncy_110",JKe="_checkboxField_iwncy_131",XKe="_checkbox_iwncy_131",QKe="_description_iwncy_168",ZKe="_errorMessage_iwncy_197",eGe="_noLabel_iwncy_210",Da={fieldRow:VKe,field:KKe,rightAlign:GKe,inputField:zKe,disabled:WKe,prefix:YKe,checkboxField:JKe,checkbox:XKe,description:QKe,errorMessage:ZKe,noLabel:eGe},tGe=(t,e)=>_.createElement("svg",{fill:"none",height:24,stroke:"#000",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,viewBox:"0 0 24 24",width:24,xmlns:"http://www.w3.org/2000/svg",ref:e,...t},_.createElement("path",{d:"m20 6-11 11-5-5"})),nGe=_.forwardRef(tGe);class Fle extends Error{constructor(e,n){super(n(e,{lng:"en"})),this.translatedMessage=n(e)}}class rGe extends Fle{}const Tz=(t,e)=>new rGe(t,e);function Dt({children:t,rightAlign:e,className:n}){return S.jsx("div",{className:Le(Da.fieldRow,{[Da.rightAlign]:e},n),children:t})}function iGe({children:t,className:e}){return S.jsx("div",{className:Le(Da.field,e),children:t})}const Zn=({ref:t,id:e,label:n,className:r,type:i,checked:s,prefix:o,suffix:a,description:c,disabled:l,min:d,...h})=>{const m=_.useId();return S.jsxs(iGe,{className:Le(i==="checkbox"?Da.checkboxField:Da.inputField,{[Da.prefix]:!!o,[Da.disabled]:l},r),children:[o&&S.jsx("span",{children:o}),i==="textarea"?S.jsx("textarea",{id:e,ref:t,disabled:l,"aria-describedby":m,...h}):S.jsx("input",{id:e,ref:t,type:i,checked:s,disabled:l,"aria-describedby":m,min:d,...h}),S.jsxs("label",{htmlFor:e,children:[i==="checkbox"&&S.jsx("div",{className:Da.checkbox,children:S.jsx(nGe,{})}),n]}),a&&S.jsx("span",{children:a}),c&&S.jsx("p",{id:m,className:n?Da.description:Le(Da.description,Da.noLabel),children:c})]})};Zn.displayName="InputField";const ph=({error:t})=>S.jsx("p",{className:Da.errorMessage,children:t instanceof Fle?t.translatedMessage:t.message}),sGe="_avatarInputField_1ep5q_8",oGe="_avatar_1ep5q_8",aGe="_fileInput_1ep5q_17",cGe="_edit_1ep5q_21",Yw={avatarInputField:sGe,avatar:oGe,fileInput:aGe,edit:cGe},$le=({id:t,label:e,className:n,avatarUrl:r,userId:i,displayName:s,onRemoveAvatar:o,...a})=>{const{t:c}=ze(),[l,d]=_.useState(!1),[h,m]=_.useState(void 0),[g,y]=_.useState(!1),v=_.useRef(null);_.useEffect(()=>{const k=v.current,x=C=>{const R=C;R.target.files&&R.target.files.length>0?(m(URL.createObjectURL(R.target.files[0])),d(!1)):m(void 0)};return k.addEventListener("change",x),()=>{k?.removeEventListener("change",x)}});const E=_.useCallback(()=>{v.current.click()},[v]),w=_.useCallback(()=>{d(!0),o()},[o]);return S.jsxs("div",{className:Le(Yw.avatarInputField,n),children:[S.jsx(Iy,{id:i,className:Yw.avatar,name:s,size:ky.XL,src:l?void 0:h||r}),S.jsx("input",{id:t,accept:"image/*",ref:v,type:"file",className:Yw.fileInput,role:"button","aria-label":e,...a}),S.jsx("div",{className:Yw.edit,children:(r||h)&&!l?S.jsxs(wR,{title:c("action.edit"),showTitle:!1,open:g,onOpenChange:y,trigger:S.jsx(Ht,{iconOnly:!0,Icon:$K,kind:"tertiary",size:"sm","aria-label":c("action.edit")}),children:[S.jsx(Fp,{Icon:iNe,label:c("action.upload_file"),onSelect:E}),S.jsx(Fp,{Icon:KDe,label:c("action.remove"),kind:"critical",onSelect:w})]}):S.jsx(Ht,{type:"button",iconOnly:!0,Icon:$K,kind:"tertiary",size:"sm","aria-label":c("action.edit"),onClick:E})})]})};$le.displayName="AvatarInputField";const lGe="_content_gj715_8",uGe="_avatarFieldRow_gj715_15",Rz={content:lGe,avatarFieldRow:uGe},dGe=({client:t})=>{const{t:e}=ze(),{error:n,displayName:r,avatarUrl:i,saveProfile:s}=yS(t),o=_.useMemo(()=>t.getUserId(),[t]),a=_.useRef(null),c=_.useRef(!1),l=_.useCallback(()=>{c.current=!0},[]),d=_.useRef(!1),h=_.useCallback(()=>{d.current=!0,c.current=!0},[]);return _.useEffect(()=>{const m=a.current;return()=>{if(c.current){const g=new FormData(m),y=g.get("displayName"),v=g.get("avatar"),E=typeof v=="string"?v.length:v?.size??0,w=typeof y=="string"?y:y?.name??null;if(!w)return;s({displayName:w,avatar:v&&E>0?v:void 0,removeAvatar:d.current&&(!v||E===0)}).catch(k=>{N.error("Failed to save profile",k)})}}},[s]),S.jsxs("form",{onChange:l,ref:a,className:Rz.content,children:[S.jsx(Dt,{className:Rz.avatarFieldRow,children:o&&r&&S.jsx($le,{id:"avatar",name:"avatar",label:e("common.avatar"),avatarUrl:i,userId:o,displayName:r,onRemoveAvatar:h})}),S.jsx(Dt,{children:S.jsx(Zn,{id:"userId",name:"userId",label:e("common.username"),type:"text",disabled:!0,value:t.getUserId()})}),S.jsx(Dt,{children:S.jsx(Zn,{id:"displayName",name:"displayName",label:e("common.display_name"),type:"text",required:!0,autoComplete:"off",placeholder:e("common.display_name"),defaultValue:r,"data-testid":"profile_displayname"})}),n&&S.jsx(Dt,{children:S.jsx(ph,{error:n})})]})},fGe="_feedback_19yh9_8",Ble={feedback:fGe},Hle=()=>S.jsxs(bo,{i18nKey:"analytics_notice",children:["By participating in this beta, you consent to the collection of anonymous data, which we use to improve the product. You can find more information about which data we track in our"," ",S.jsx(_p,{href:"https://element.io/privacy",children:"Privacy Policy"})," ","and our"," ",S.jsx(_p,{href:"https://element.io/cookie-policy",children:"Cookie Policy"}),"."]}),hGe=({roomId:t})=>{const{t:e}=ze(),{submitRageshake:n,sending:r,sent:i,error:s,available:o}=NR(),a=DBe(),c=_.useCallback(h=>{h.preventDefault();const m=new FormData(h.target),g=m.get("description"),y=typeof g=="string"?g:"",v=!!m.get("sendLogs"),E=Qo(16);n({description:y,sendLogs:v,rageshakeRequestId:E,roomId:t}).catch(w=>{N.error("Failed to send feedback rageshake",w)}),t&&v&&a(t,E)},[n,t,a]);VR();const l=null,d=o?S.jsxs(S.Fragment,{children:[S.jsx("h4",{children:e("settings.feedback_tab_h4")}),S.jsx(on,{children:e("settings.feedback_tab_body")}),S.jsxs("form",{onSubmit:c,children:[S.jsx(Dt,{children:S.jsx(Zn,{className:Ble.feedback,id:"description",name:"description",label:e("settings.feedback_tab_description_label"),placeholder:e("settings.feedback_tab_description_label"),type:"textarea",disabled:r||i})}),!i&&S.jsxs(Dt,{children:[S.jsx(Zn,{id:"sendLogs",name:"sendLogs",label:e("settings.feedback_tab_send_logs_label"),type:"checkbox",defaultChecked:!0}),S.jsx(Ht,{type:"submit",disabled:r,children:e(r?"submitting":"action.submit")})]}),S.jsxs(Dt,{children:[s&&S.jsx(ph,{error:s}),i&&S.jsx(on,{children:e("settings.feedback_tab_thank_you")})]})]})]}):null;return S.jsxs("div",{children:[l,d]})};var dC={exports:{}},pGe=dC.exports,kz;function mGe(){return kz||(kz=1,(function(t){(function(e,n){t.exports?t.exports=n():e.log=n()})(pGe,function(){var e=function(){},n="undefined",r=typeof window!==n&&typeof window.navigator!==n&&/Trident\/|MSIE /.test(window.navigator.userAgent),i=["trace","debug","info","warn","error"],s={},o=null;function a(v,E){var w=v[E];if(typeof w.bind=="function")return w.bind(v);try{return Function.prototype.bind.call(w,v)}catch{return function(){return Function.prototype.apply.apply(w,[v,arguments])}}}function c(){console.log&&(console.log.apply?console.log.apply(console,arguments):Function.prototype.apply.apply(console.log,[console,arguments])),console.trace&&console.trace()}function l(v){return v==="debug"&&(v="log"),typeof console===n?!1:v==="trace"&&r?c:console[v]!==void 0?a(console,v):console.log!==void 0?a(console,"log"):e}function d(){for(var v=this.getLevel(),E=0;E<i.length;E++){var w=i[E];this[w]=E<v?e:this.methodFactory(w,v,this.name)}if(this.log=this.debug,typeof console===n&&v<this.levels.SILENT)return"No console available for logging"}function h(v){return function(){typeof console!==n&&(d.call(this),this[v].apply(this,arguments))}}function m(v,E,w){return l(v)||h.apply(this,arguments)}function g(v,E){var w=this,k,x,C,R="loglevel";typeof v=="string"?R+=":"+v:typeof v=="symbol"&&(R=void 0);function T(j){var $=(i[j]||"silent").toUpperCase();if(!(typeof window===n||!R)){try{window.localStorage[R]=$;return}catch{}try{window.document.cookie=encodeURIComponent(R)+"="+$+";"}catch{}}}function M(){var j;if(!(typeof window===n||!R)){try{j=window.localStorage[R]}catch{}if(typeof j===n)try{var $=window.document.cookie,q=encodeURIComponent(R),Y=$.indexOf(q+"=");Y!==-1&&(j=/^([^;]+)/.exec($.slice(Y+q.length+1))[1])}catch{}return w.levels[j]===void 0&&(j=void 0),j}}function O(){if(!(typeof window===n||!R)){try{window.localStorage.removeItem(R)}catch{}try{window.document.cookie=encodeURIComponent(R)+"=; expires=Thu, 01 Jan 1970 00:00:00 UTC"}catch{}}}function P(j){var $=j;if(typeof $=="string"&&w.levels[$.toUpperCase()]!==void 0&&($=w.levels[$.toUpperCase()]),typeof $=="number"&&$>=0&&$<=w.levels.SILENT)return $;throw new TypeError("log.setLevel() called with invalid level: "+j)}w.name=v,w.levels={TRACE:0,DEBUG:1,INFO:2,WARN:3,ERROR:4,SILENT:5},w.methodFactory=E||m,w.getLevel=function(){return C??x??k},w.setLevel=function(j,$){return C=P(j),$!==!1&&T(C),d.call(w)},w.setDefaultLevel=function(j){x=P(j),M()||w.setLevel(j,!1)},w.resetLevel=function(){C=null,O(),d.call(w)},w.enableAll=function(j){w.setLevel(w.levels.TRACE,j)},w.disableAll=function(j){w.setLevel(w.levels.SILENT,j)},w.rebuild=function(){if(o!==w&&(k=P(o.getLevel())),d.call(w),o===w)for(var j in s)s[j].rebuild()},k=P(o?o.getLevel():"WARN");var D=M();D!=null&&(C=P(D)),d.call(w)}o=new g,o.getLogger=function(E){if(typeof E!="symbol"&&typeof E!="string"||E==="")throw new TypeError("You must supply a name when creating a logger.");var w=s[E];return w||(w=s[E]=new g(E,o.methodFactory)),w};var y=typeof window!==n?window.log:void 0;return o.noConflict=function(){return typeof window!==n&&window.log===o&&(window.log=y),o},o.getLoggers=function(){return s},o.default=o,o})})(dC)),dC.exports}var gGe=mGe();const vGe=Dl(gGe);var yGe=(t,e,n)=>new Promise((r,i)=>{var s=c=>{try{a(n.next(c))}catch(l){i(l)}},o=c=>{try{a(n.throw(c))}catch(l){i(l)}},a=c=>c.done?r(c.value):Promise.resolve(c.value).then(s,o);a((n=n.apply(t,e)).next())});function bGe(t){return typeof t>"u"?!1:_Ge(t)||SGe(t)}function _Ge(t){var e;return t?t.hasOwnProperty("participant")&&t.hasOwnProperty("source")&&t.hasOwnProperty("track")&&typeof((e=t.publication)==null?void 0:e.track)<"u":!1}function SGe(t){return t?t.hasOwnProperty("participant")&&t.hasOwnProperty("source")&&t.hasOwnProperty("publication")&&typeof t.publication<"u":!1}function wGe(t){return t?t.hasOwnProperty("participant")&&t.hasOwnProperty("source")&&typeof t.publication>"u":!1}function EGe(t){if(typeof t=="string"||typeof t=="number")return`${t}`;if(wGe(t))return`${t.participant.identity}_${t.source}_placeholder`;if(bGe(t))return`${t.participant.identity}_${t.publication.source}_${t.publication.trackSid}`;throw new Error(`Can't generate a id for the given track reference: ${t}`)}var CGe=[pe.ConnectionStateChanged,pe.RoomMetadataChanged,pe.ActiveSpeakersChanged,pe.ConnectionQualityChanged,pe.ParticipantConnected,pe.ParticipantDisconnected,pe.ParticipantPermissionsChanged,pe.ParticipantMetadataChanged,pe.ParticipantNameChanged,pe.ParticipantAttributesChanged,pe.TrackMuted,pe.TrackUnmuted,pe.TrackPublished,pe.TrackUnpublished,pe.TrackStreamStateChanged,pe.TrackSubscriptionFailed,pe.TrackSubscriptionPermissionChanged,pe.TrackSubscriptionStatusChanged],TGe=[...CGe,pe.LocalTrackPublished,pe.LocalTrackUnpublished];ce.TrackPublished,ce.TrackUnpublished,ce.TrackMuted,ce.TrackUnmuted,ce.TrackStreamStateChanged,ce.TrackSubscribed,ce.TrackUnsubscribed,ce.TrackSubscriptionPermissionChanged,ce.TrackSubscriptionFailed,ce.LocalTrackPublished,ce.LocalTrackUnpublished;var RGe=[ce.ConnectionQualityChanged,ce.IsSpeakingChanged,ce.ParticipantMetadataChanged,ce.ParticipantPermissionsChanged,ce.TrackMuted,ce.TrackUnmuted,ce.TrackPublished,ce.TrackUnpublished,ce.TrackStreamStateChanged,ce.TrackSubscriptionFailed,ce.TrackSubscriptionPermissionChanged,ce.TrackSubscriptionStatusChanged];[...RGe,ce.LocalTrackPublished,ce.LocalTrackUnpublished];var kGe=vGe.getLogger("lk-components-js");kGe.setDefaultLevel("WARN");function IGe(t,...e){return new tr(r=>{const i=()=>{r.next(t)};return e.forEach(o=>{t.on(o,i)}),()=>{e.forEach(o=>{t.off(o,i)})}}).pipe(pn(t))}function qle(t,e){return new tr(r=>{const i=(...o)=>{r.next(o)};return t.on(e,i),()=>{t.off(e,i)}})}function xGe(t){return qle(t,pe.ConnectionStateChanged).pipe(ge(([e])=>e),pn(t.state))}function Iz(t,e,n=!0){const r=new tr(s=>{Wu.getLocalDevices(t,n).then(o=>{s.next(o),s.complete()}).catch(o=>{e?.(o),s.next([]),s.complete()})}),i=new tr(s=>{var o;const a=()=>yGe(this,null,function*(){try{const c=yield Wu.getLocalDevices(t,n);s.next(c)}catch(c){e?.(c)}});if(typeof window<"u"){if(!window.isSecureContext)throw new Error("Accessing media devices is available only in secure contexts (HTTPS and localhost), in some or all supporting browsers. See: https://developer.mozilla.org/en-US/docs/Web/API/Navigator/mediaDevices");(o=navigator?.mediaDevices)==null||o.addEventListener("devicechange",a)}return()=>{var c;(c=navigator?.mediaDevices)==null||c.removeEventListener("devicechange",a)}});return qv(r,i)}function GR(t,...e){return new tr(r=>{const i=()=>{r.next(t)};return e.forEach(o=>{t.on(o,i)}),()=>{e.forEach(o=>{t.off(o,i)})}}).pipe(pn(t))}function Vle(t){return GR(t,ce.TrackMuted,ce.TrackUnmuted,ce.ParticipantPermissionsChanged,ce.TrackPublished,ce.TrackUnpublished,ce.LocalTrackPublished,ce.LocalTrackUnpublished,ce.MediaDevicesError,ce.TrackSubscriptionStatusChanged).pipe(ge(n=>{const{isMicrophoneEnabled:r,isCameraEnabled:i,isScreenShareEnabled:s}=n,o=n.getTrackPublication(me.Source.Microphone),a=n.getTrackPublication(me.Source.Camera);return{isCameraEnabled:i,isMicrophoneEnabled:r,isScreenShareEnabled:s,cameraTrack:a,microphoneTrack:o,participant:n}}))}function AGe(t,e={}){var n;let r;const i=new tr(c=>(r=c,()=>a.unsubscribe())).pipe(pn(Array.from(t.remoteParticipants.values()))),s=(n=e.additionalRoomEvents)!=null?n:TGe,o=Array.from(new Set([pe.ParticipantConnected,pe.ParticipantDisconnected,pe.ConnectionStateChanged,...s])),a=IGe(t,...o).subscribe(c=>r?.next(Array.from(c.remoteParticipants.values())));return t.remoteParticipants.size>0&&r?.next(Array.from(t.remoteParticipants.values())),i}const Dg=new sr,k9=new sr,Kle=new sr,oO=new sr;let xz=!1;const Gle=()=>{xz||(xz=!0,window.controls.onAudioPlaybackStarted?.())};window.controls={canEnterPip(){return Dg.observed},enablePip(){if(!Dg.observed)throw new Error("No call is running");Dg.next(!0)},disablePip(){if(!Dg.observed)throw new Error("No call is running");Dg.next(!1)},setAvailableAudioDevices(t){N.info("[MediaDevices controls] setAvailableAudioDevices called from native:",t),k9.next(t)},setAudioDevice(t){N.info("[MediaDevices controls] setAudioDevice called from native",t),Kle.next(t)},setAudioEnabled(t){if(N.info("[MediaDevices controls] setAudioEnabled called from native:",t),!oO.observed)throw new Error("Output controls are disabled. No setAudioEnabled$ observer");oO.next(t)},setOutputEnabled(t){this.setAudioEnabled(t)},setAvailableOutputDevices(t){this.setAvailableAudioDevices(t)},setOutputDevice(t){this.setAudioDevice(t)}};const Sg=Symbol("nothing");class bS{constructor(){this.ended$=new cr(!1),this.bindImpl=Cle(this.ended$.pipe(Fr(e=>e))),this.shareImpl=MKe({resetOnError:!1,resetOnComplete:!1,resetOnRefCountZero:!1}),this.share=e=>e.pipe(this.bindImpl,this.shareImpl)}bind(){return this.bindImpl}behavior(e,n=Sg){const r=new cr(n);if(e.pipe(this.bind(),Ni()).subscribe({next(i){r.next(i)},error(i){r.error(i)}}),r.value===Sg)throw new Error("Behavior failed to synchronously emit an initial value");return r}end(){this.ended$.next(!0)}onEnd(e){this.ended$.pipe(Fr(n=>n),qR(1)).subscribe(e)}reconcile(e,n){let r=Sg,i,s,o=Sg;const a=async()=>{for(;r!==o;)await s?.(),o=r,r!==Sg&&(s=await n(r))};e.pipe(HR(()=>b9),this.bind(),wle(Sg)).subscribe(c=>{r=c,!i&&(i=a().finally(()=>{i=void 0}))})}splitBehavior(e){return Object.fromEntries(Object.keys(e.value).map(n=>[`${n}$`,this.behavior(e.pipe(ge(r=>r[n])))]))}}const zle=new bS;class Lc{constructor(e,n){this.value=e,this.epoch=n??0}mapInner(e){return new Lc(e(this.value),this.epoch)}}function aO(t){return ge(e=>e.mapInner(t))}function MGe(){return ge((t,e)=>new Lc(t,e))}const K3=Symbol("nothing");function LGe(t){return e=>cKe(()=>{let n=K3;return e.pipe(ec(r=>n=r),xKe(()=>{n!==K3&&t(n)}))})}function Wle(t,e){return n=>n.pipe(pl(e,t),pn(t))}function OGe(t,e,n){return t.behavior(n.pipe(Wle(e,r=>!r)))}const Az=Symbol("switch");function PGe(t,e){return n=>qv(n.pipe(ge((r,i)=>t(r,i)?Az:r),PKe(r=>r!==Az)),e)}function DGe(t){let e=K3;if(t.subscribe(n=>e=n).unsubscribe(),e===K3)throw new Error("Not a state Observable");return e}function Yle(...t){return mt(t,(...e)=>e.every(n=>n))}function Mz(t){return e=>e.pipe(Tle(t),Sle(([,n])=>n?t.pipe(Fr(r=>!r)):pt(null)),ge(([n])=>n))}function cO(t,e,n){return I9(t,e,n,r=>r)}function Jle(t,e,n){return I9(t,function*(r){yield*e(r.value)},n,(r,i)=>new Lc(r,i.epoch))}function NGe(t){return e=>e.pipe(pl((n,r)=>{if(t(r)){const i=n??new cr(r);return i.next(r),i}return null},null),Ni())}function UGe(t,e,n){return r=>r.pipe(I9(t,function*(i){yield e(i)},n,i=>i),ge(([i])=>i))}function I9(t,e,n,r){return i=>i.pipe(pl(({map:s,items:o},a)=>{const c=new Map,l=new Set;for(const{keys:d,data:h}of e(a)){let m=s;for(const E of d)m=m?.get(E);let g=m;if(g===void 0){const E=new bS,w=new cr(h);N.debug(`[${t}] Creating item with keys ${d.join(", ")}`),g={scope:E,keys:d,data$:w,item:n(E,w,...d)}}else g.data$.next(h);let y=c;for(let E=0;E<d.length-1;E++){let w=y.get(d[E]);w===void 0&&(w=new Map,y.set(d[E],w)),y=w}const v=d[d.length-1];if(y.has(v))throw new Error(`Keys must be unique (tried to generate multiple items for key ${d.join(", ")})`);y.set(d[d.length-1],g),l.add(g)}for(const d of o)l.has(d)||(N.debug(`[${t}] Destroying item with keys ${d.keys.join(", ")}`),d.scope.end());return{map:c,items:l,input:a}},{map:new Map,items:new Set}),LGe(({items:s})=>{N.debug(`[${t}] End of scope, destroying all ${s.size} items…`);for(const o of s)N.debug(`[${t}] Destroying item with keys ${o.keys.join(", ")}`),o.scope.end()}),ge(({items:s,input:o})=>r([...s].map(({item:a})=>a),o)))}function zR(t){return new cr(t)}class jGe{constructor(e,n,r=void 0,i){this.controlledDevices$=e,this.scope=n,this.initialIntent=r,this.logger=N.getChild("[MediaDevices AndroidControlledAudioOutput]"),this.selectDeviceCommand$=new sr,this.controllerState$=this.startObservingState$(),this.selected$=this.effectiveSelectionFromState$(this.controllerState$),this.available$=n.behavior(this.controllerState$.pipe(ge(s=>(this.logger.info("available devices updated:",s.devices),new Map(s.devices.map(o=>[o.id,FGe(o)])))))),this.selected$.pipe(n.bind()).subscribe(s=>{s!==void 0&&(this.logger.info("onAudioDeviceSelect called:",s),i.onAudioDeviceSelect?.(s.id),i.onOutputDeviceSelect?.(s.id))})}select(e){this.logger.info(`select device: ${e}`),this.selectDeviceCommand$.next(e)}startObservingState$(){const e={devices:[],preferredDeviceId:void 0,selectedDeviceId:void 0},n=Nc(this.controlledDevices$.pipe(ge(i=>({type:"deviceUpdated",devices:i}))),this.selectDeviceCommand$.pipe(ge(i=>({type:"selectDevice",deviceId:i})))),r={type:"deviceUpdated",devices:[]};return this.scope.behavior(n.pipe(pn(r),pl((i,s)=>{switch(s.type){case"deviceUpdated":{const o=this.chooseEffectiveSelection({previousDevices:i.devices,availableDevices:s.devices,currentSelectedId:i.selectedDeviceId,preferredDeviceId:i.preferredDeviceId});return{...i,devices:s.devices,selectedDeviceId:o}}case"selectDevice":{const o=this.chooseEffectiveSelection({previousDevices:i.devices,availableDevices:i.devices,currentSelectedId:i.selectedDeviceId,preferredDeviceId:s.deviceId});return{...i,preferredDeviceId:s.deviceId,selectedDeviceId:o}}}},e)))}effectiveSelectionFromState$(e){return this.scope.behavior(e.pipe(ge(n=>{if(n.selectedDeviceId)return{id:n.selectedDeviceId,virtualEarpiece:!1}}),Ni((n,r)=>n?.id===r?.id)).pipe(ec(n=>{this.logger.debug(`selected device: ${n?.id}`)})))}chooseEffectiveSelection(e){const{previousDevices:n,availableDevices:r,currentSelectedId:i,preferredDeviceId:s}=e;this.logger.debug("chooseEffectiveSelection with args:",e);const o=s||i,a=r.some(l=>l.id===o);if(o===void 0||!a)return this.logger.debug("No current device or it is not available, using default selection logic."),this.chooseDefaultDeviceId(r);if(r.some(l=>!n.some(d=>d.id===l.id))){const l=r[0];if(this.logger.debug("A new device was added, checking if we should switch to it.",l),l.id!==o&&l.isExternalHeadset==!0)return this.logger.info(`The currently selected device ${l.id} is not the most preferred one, switching to the most preferred one ${o} instead.`),l.id}return o}chooseDefaultDeviceId(e){if(this.logger.debug(`Android routing logic intent: ${this.initialIntent} finding best default...`),this.initialIntent==="audio"){const n=e[0];if(n?.isSpeaker==!0){const r=e.find(i=>i.isEarpiece==!0);return r?(this.logger.debug("Android routing: Switch to earpiece instead of speaker for voice call"),r.id):(this.logger.debug("Android routing: no earpiece found, cannot switch, use system proposed routing"),n.id)}else return this.logger.debug("Android routing: Use system proposed routing ",n),n?.id}else return e[0]?.id}}function FGe(t){const{name:e,isEarpiece:n,isSpeaker:r}=t;return n?{type:"earpiece"}:r?{type:"speaker"}:{type:"name",name:e}}const c5="earpiece-id";class $Ge{constructor(e,n){this.usingNames$=e,this.scope=n,this.logger=N.getChild("[MediaDevices ControlledAudioOutput]"),this.availableRaw$=WR("audiooutput",this.usingNames$,this.scope,this.logger),this.available$=this.scope.behavior(mt([k9.pipe(pn([])),Xle],(r,i)=>{const s=new Map(r.map(({id:o,name:a,isEarpiece:c,isSpeaker:l})=>{let d;return c?d={type:"earpiece"}:l?d={type:"speaker"}:d={type:"name",name:a},[o,d]}));return i&&r.some(o=>o.forEarpiece)&&(this.logger.info(`IOS Add virtual earpiece device with id ${c5}`),s.set(c5,{type:"earpiece"})),s})),this.deviceSelection$=new sr,this.selected$=this.scope.behavior(mt([this.available$,Nc(Kle.pipe(pn(void 0)),this.deviceSelection$)],(r,i)=>{const s=i??r.keys().next().value;return s===void 0?void 0:{id:s,virtualEarpiece:s===c5}}).pipe(ec(r=>{this.logger.debug(`selected device: ${r?.id}`)}))),this.selected$.subscribe(r=>{r!==void 0&&(this.logger.info("onAudioDeviceSelect called:",r),window.controls.onAudioDeviceSelect?.(r.id),window.controls.onOutputDeviceSelect?.(r.id))}),this.available$.subscribe(r=>{this.logger.debug("available devices:",r)}),this.availableRaw$.subscribe(r=>{this.logger.debug("available raw devices:",r)})}select(e){this.logger.info(`select device: ${e}`),this.deviceSelection$.next(e)}}const Xle=Hs==="ios"?zR(!0):Ple.value$;function WR(t,e,n,r){const i=a=>r.error("Error creating MediaDeviceObserver",a),s=Iz(t,i,!1),o=Iz(t,i,!0);return n.behavior(e.pipe(rt(a=>a?s.pipe(PGe((c,l)=>l===0&&c.every(d=>!d.label),o)):s)),[])}function x9(t){return new Map(t.map((e,n)=>[e.deviceId,e.label?{type:"name",name:e.label}:{type:"number",number:n+1}]))}function A9(t,e){return mt([t,e],(n,r)=>{if(n.size)return r!==void 0&&n.has(r)||n.size===1&&n.has("")?r:n.keys().next().value})}class BGe{constructor(e,n){this.usingNames$=e,this.scope=n,this.logger=N.getChild("[MediaDevices AudioInput]"),this.availableRaw$=WR("audioinput",this.usingNames$,this.scope,this.logger),this.available$=this.scope.behavior(this.availableRaw$.pipe(ge(x9))),this.selected$=this.scope.behavior(A9(this.available$,vz.value$).pipe(ge(r=>r===void 0?void 0:{id:r,hardwareDeviceChange$:this.availableRaw$.pipe(ge(i=>i.find(s=>s.deviceId===r)?.groupId),Vv(),Fr(([i,s])=>i!==s),ge(()=>{}))}))),this.available$.subscribe(r=>{this.logger.info("[audio-input] available devices:",r)})}select(e){vz.setValue(e)}}class HGe{constructor(e,n){this.usingNames$=e,this.scope=n,this.logger=N.getChild("[MediaDevices AudioOutput]"),this.available$=this.scope.behavior(WR("audiooutput",this.usingNames$,this.scope,this.logger).pipe(ge(r=>{let i=x9(r);return i.size&&!i.has("")&&!i.has("default")&&i.set("",{type:"default",name:r[0]?.label||null}),window.GestureEvent&&(i=new Map),i}))),this.selected$=this.scope.behavior(A9(this.available$,yz.value$).pipe(ge(r=>{if(r!==void 0)return{id:r,virtualEarpiece:!1}}))),this.available$.subscribe(r=>{this.logger.info("[audio-output] available devices:",r)})}select(e){yz.setValue(e)}}class qGe{constructor(e,n){this.usingNames$=e,this.scope=n,this.logger=N.getChild("[MediaDevices VideoInput]"),this.available$=this.scope.behavior(WR("videoinput",this.usingNames$,this.scope,this.logger).pipe(ge(x9))),this.selected$=this.scope.behavior(A9(this.available$,bz.value$).pipe(ge(r=>r===void 0?void 0:{id:r}))),this.available$.subscribe(r=>{this.logger.info("[video-input] available devices:",r)})}select(e){bz.setValue(e)}}class VGe{constructor(e){this.scope=e,this.deviceNamesRequest$=new sr,this.usingNames$=this.scope.behavior(this.deviceNamesRequest$.pipe(ge(()=>!0)),!1),this.audioInput=new BGe(this.usingNames$,this.scope),this.audioOutput=er().controlledAudioDevices?Hs=="android"?new jGe(k9,this.scope,er().callIntent,window.controls):new $Ge(this.usingNames$,this.scope):new HGe(this.usingNames$,this.scope),this.videoInput=new qGe(this.usingNames$,this.scope)}requestDeviceNames(){this.deviceNamesRequest$.next()}}function KGe(t,e,n){if(!n)return _.useState(e)[0];const[r]=_.useState(()=>new cr(n)),[i]=_.useState(()=>e(r)),s=_.useRef(!0);return t(()=>{if(s.current){s.current=!1;return}r.next(n)},n),i}function Qle(t,e){return KGe(_.useEffect,t,e)}var GGe=t=>t+1|0,zGe=()=>{const t=_.useState(0)[1];return _.useRef(()=>t(GGe)).current},WGe=typeof window>"u"?_.useEffect:_.useLayoutEffect;function So(t){const e=zGe(),n=_.useRef(t),r=_.useRef(),i=_.useRef(!1),s=_.useRef(!1),[o,a]=_.useState(()=>{let c;return t.subscribe({next:l=>{s.current=!0,c=l},error:l=>{r.current=l}}).unsubscribe(),c});if(WGe(()=>{n.current=t}),_.useEffect(()=>{r.current=null;const c=n.current;let l=o;const d=c.subscribe({next:h=>{c===n.current&&(i.current?a(()=>h):l=h)},error:h=>{c===n.current&&(r.current=h,e())}});return i.current||l!==o&&a(()=>l),i.current=!0,()=>{d.unsubscribe()}},[t]),r.current)throw r.current;if(s.current)return _.useDebugValue(o),o;throw new Error("Observable did not synchronously emit a value.")}function YGe(t){const[e]=_.useState(()=>new cr(t)),[n]=_.useState(()=>({get current(){return e.value},set current(r){e.next(r)}}));return[n,e]}const Zle=_.createContext(void 0);function pm(){const t=_.use(Zle);if(t===void 0)throw new Error("useMediaDevices must be used within a MediaDevices context provider");return t}const eue=()=>{const t=pm(),n=So(t.audioOutput.selected$)?.virtualEarpiece??!1;return{pan:_.useMemo(()=>n?1:0,[n]),volume:_.useMemo(()=>n?.1:1,[n])}},JGe=()=>{const{t}=ze(),[e,n]=Ur(Ale),[r,i]=Ur(Mle),[s,o]=Ur(C9),a=(d,h)=>{h(d.target.checked)},[c,l]=Ur(kle);return S.jsxs("div",{children:[S.jsx(on,{children:t("settings.preferences_tab.introduction")}),S.jsx(Dt,{children:S.jsx(Zn,{id:"showHandRaisedTimer",label:t("settings.preferences_tab.show_hand_raised_timer_label"),description:t("settings.preferences_tab.show_hand_raised_timer_description"),type:"checkbox",checked:e,onChange:d=>a(d,n)})}),S.jsx(Dt,{children:S.jsx(Zn,{id:"showReactions",label:t("settings.preferences_tab.reactions_show_label"),description:t("settings.preferences_tab.reactions_show_description"),type:"checkbox",checked:r,onChange:d=>a(d,i)})}),S.jsx(Dt,{children:S.jsx(Zn,{id:"playReactionSound",label:t("settings.preferences_tab.reactions_play_sound_label"),description:t("settings.preferences_tab.reactions_play_sound_description"),type:"checkbox",checked:s,onChange:d=>a(d,o)})}),S.jsx(Dt,{children:S.jsx(Zn,{id:"developerSettingsTab",type:"checkbox",checked:c,label:t("settings.preferences_tab.developer_mode_label"),description:t("settings.preferences_tab.developer_mode_label_description"),onChange:d=>l(d.target.checked)})})]})};function tue(t,[e,n]){return Math.min(n,Math.max(e,t))}function XGe(t){const e=_.useRef({value:t,previous:t});return _.useMemo(()=>(e.current.value!==t&&(e.current.previous=e.current.value,e.current.value=t),e.current.previous),[t])}var QGe=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],_S=QGe.reduce((t,e)=>{const n=Eo(`Primitive.${e}`),r=_.forwardRef((i,s)=>{const{asChild:o,...a}=i,c=o?n:e;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),S.jsx(c,{...a,ref:s})});return r.displayName=`Primitive.${e}`,{...t,[e]:r}},{}),nue=["PageUp","PageDown"],rue=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],iue={"from-left":["Home","PageDown","ArrowDown","ArrowLeft"],"from-right":["Home","PageDown","ArrowDown","ArrowRight"],"from-bottom":["Home","PageDown","ArrowDown","ArrowLeft"],"from-top":["Home","PageDown","ArrowUp","ArrowLeft"]},Ay="Slider",[lO,ZGe,eze]=F7(Ay),[sue]=im(Ay,[eze]),[tze,YR]=sue(Ay),oue=_.forwardRef((t,e)=>{const{name:n,min:r=0,max:i=100,step:s=1,orientation:o="horizontal",disabled:a=!1,minStepsBetweenThumbs:c=0,defaultValue:l=[r],value:d,onValueChange:h=()=>{},onValueCommit:m=()=>{},inverted:g=!1,form:y,...v}=t,E=_.useRef(new Set),w=_.useRef(0),x=o==="horizontal"?nze:rze,[C=[],R]=G7({prop:d,defaultProp:l,onChange:j=>{[...E.current][w.current]?.focus(),h(j)}}),T=_.useRef(C);function M(j){const $=cze(C,j);D(j,$)}function O(j){D(j,w.current)}function P(){const j=T.current[w.current];C[w.current]!==j&&m(C)}function D(j,$,{commit:q}={commit:!1}){const Y=fze(s),W=hze(Math.round((j-r)/s)*s+r,Y),H=tue(W,[r,i]);R((F=[])=>{const V=oze(F,H,$);if(dze(V,c*s)){w.current=V.indexOf(H);const G=String(V)!==String(F);return G&&q&&m(V),G?V:F}else return F})}return S.jsx(tze,{scope:t.__scopeSlider,name:n,disabled:a,min:r,max:i,valueIndexToChangeRef:w,thumbs:E.current,values:C,orientation:o,form:y,children:S.jsx(lO.Provider,{scope:t.__scopeSlider,children:S.jsx(lO.Slot,{scope:t.__scopeSlider,children:S.jsx(x,{"aria-disabled":a,"data-disabled":a?"":void 0,...v,ref:e,onPointerDown:yt(v.onPointerDown,()=>{a||(T.current=C)}),min:r,max:i,inverted:g,onSlideStart:a?void 0:M,onSlideMove:a?void 0:O,onSlideEnd:a?void 0:P,onHomeKeyDown:()=>!a&&D(r,0,{commit:!0}),onEndKeyDown:()=>!a&&D(i,C.length-1,{commit:!0}),onStepKeyDown:({event:j,direction:$})=>{if(!a){const W=nue.includes(j.key)||j.shiftKey&&rue.includes(j.key)?10:1,H=w.current,F=C[H],V=s*W*$;D(F+V,H,{commit:!0})}}})})})})});oue.displayName=Ay;var[aue,cue]=sue(Ay,{startEdge:"left",endEdge:"right",size:"width",direction:1}),nze=_.forwardRef((t,e)=>{const{min:n,max:r,dir:i,inverted:s,onSlideStart:o,onSlideMove:a,onSlideEnd:c,onStepKeyDown:l,...d}=t,[h,m]=_.useState(null),g=_r(e,x=>m(x)),y=_.useRef(void 0),v=$7(i),E=v==="ltr",w=E&&!s||!E&&s;function k(x){const C=y.current||h.getBoundingClientRect(),R=[0,C.width],M=M9(R,w?[n,r]:[r,n]);return y.current=C,M(x-C.left)}return S.jsx(aue,{scope:t.__scopeSlider,startEdge:w?"left":"right",endEdge:w?"right":"left",direction:w?1:-1,size:"width",children:S.jsx(lue,{dir:v,"data-orientation":"horizontal",...d,ref:g,style:{...d.style,"--radix-slider-thumb-transform":"translateX(-50%)"},onSlideStart:x=>{const C=k(x.clientX);o?.(C)},onSlideMove:x=>{const C=k(x.clientX);a?.(C)},onSlideEnd:()=>{y.current=void 0,c?.()},onStepKeyDown:x=>{const R=iue[w?"from-left":"from-right"].includes(x.key);l?.({event:x,direction:R?-1:1})}})})}),rze=_.forwardRef((t,e)=>{const{min:n,max:r,inverted:i,onSlideStart:s,onSlideMove:o,onSlideEnd:a,onStepKeyDown:c,...l}=t,d=_.useRef(null),h=_r(e,d),m=_.useRef(void 0),g=!i;function y(v){const E=m.current||d.current.getBoundingClientRect(),w=[0,E.height],x=M9(w,g?[r,n]:[n,r]);return m.current=E,x(v-E.top)}return S.jsx(aue,{scope:t.__scopeSlider,startEdge:g?"bottom":"top",endEdge:g?"top":"bottom",size:"height",direction:g?1:-1,children:S.jsx(lue,{"data-orientation":"vertical",...l,ref:h,style:{...l.style,"--radix-slider-thumb-transform":"translateY(50%)"},onSlideStart:v=>{const E=y(v.clientY);s?.(E)},onSlideMove:v=>{const E=y(v.clientY);o?.(E)},onSlideEnd:()=>{m.current=void 0,a?.()},onStepKeyDown:v=>{const w=iue[g?"from-bottom":"from-top"].includes(v.key);c?.({event:v,direction:w?-1:1})}})})}),lue=_.forwardRef((t,e)=>{const{__scopeSlider:n,onSlideStart:r,onSlideMove:i,onSlideEnd:s,onHomeKeyDown:o,onEndKeyDown:a,onStepKeyDown:c,...l}=t,d=YR(Ay,n);return S.jsx(_S.span,{...l,ref:e,onKeyDown:yt(t.onKeyDown,h=>{h.key==="Home"?(o(h),h.preventDefault()):h.key==="End"?(a(h),h.preventDefault()):nue.concat(rue).includes(h.key)&&(c(h),h.preventDefault())}),onPointerDown:yt(t.onPointerDown,h=>{const m=h.target;m.setPointerCapture(h.pointerId),h.preventDefault(),d.thumbs.has(m)?m.focus():r(h)}),onPointerMove:yt(t.onPointerMove,h=>{h.target.hasPointerCapture(h.pointerId)&&i(h)}),onPointerUp:yt(t.onPointerUp,h=>{const m=h.target;m.hasPointerCapture(h.pointerId)&&(m.releasePointerCapture(h.pointerId),s(h))})})}),uue="SliderTrack",due=_.forwardRef((t,e)=>{const{__scopeSlider:n,...r}=t,i=YR(uue,n);return S.jsx(_S.span,{"data-disabled":i.disabled?"":void 0,"data-orientation":i.orientation,...r,ref:e})});due.displayName=uue;var uO="SliderRange",fue=_.forwardRef((t,e)=>{const{__scopeSlider:n,...r}=t,i=YR(uO,n),s=cue(uO,n),o=_.useRef(null),a=_r(e,o),c=i.values.length,l=i.values.map(m=>mue(m,i.min,i.max)),d=c>1?Math.min(...l):0,h=100-Math.max(...l);return S.jsx(_S.span,{"data-orientation":i.orientation,"data-disabled":i.disabled?"":void 0,...r,ref:a,style:{...t.style,[s.startEdge]:d+"%",[s.endEdge]:h+"%"}})});fue.displayName=uO;var dO="SliderThumb",hue=_.forwardRef((t,e)=>{const n=ZGe(t.__scopeSlider),[r,i]=_.useState(null),s=_r(e,a=>i(a)),o=_.useMemo(()=>r?n().findIndex(a=>a.ref.current===r):-1,[n,r]);return S.jsx(ize,{...t,ref:s,index:o})}),ize=_.forwardRef((t,e)=>{const{__scopeSlider:n,index:r,name:i,...s}=t,o=YR(dO,n),a=cue(dO,n),[c,l]=_.useState(null),d=_r(e,k=>l(k)),h=c?o.form||!!c.closest("form"):!0,m=nre(c),g=o.values[r],y=g===void 0?0:mue(g,o.min,o.max),v=aze(r,o.values.length),E=m?.[a.size],w=E?lze(E,y,a.direction):0;return _.useEffect(()=>{if(c)return o.thumbs.add(c),()=>{o.thumbs.delete(c)}},[c,o.thumbs]),S.jsxs("span",{style:{transform:"var(--radix-slider-thumb-transform)",position:"absolute",[a.startEdge]:`calc(${y}% + ${w}px)`},children:[S.jsx(lO.ItemSlot,{scope:t.__scopeSlider,children:S.jsx(_S.span,{role:"slider","aria-label":t["aria-label"]||v,"aria-valuemin":o.min,"aria-valuenow":g,"aria-valuemax":o.max,"aria-orientation":o.orientation,"data-orientation":o.orientation,"data-disabled":o.disabled?"":void 0,tabIndex:o.disabled?void 0:0,...s,ref:d,style:g===void 0?{display:"none"}:t.style,onFocus:yt(t.onFocus,()=>{o.valueIndexToChangeRef.current=r})})}),h&&S.jsx(pue,{name:i??(o.name?o.name+(o.values.length>1?"[]":""):void 0),form:o.form,value:g},r)]})});hue.displayName=dO;var sze="RadioBubbleInput",pue=_.forwardRef(({__scopeSlider:t,value:e,...n},r)=>{const i=_.useRef(null),s=_r(i,r),o=XGe(e);return _.useEffect(()=>{const a=i.current;if(!a)return;const c=window.HTMLInputElement.prototype,d=Object.getOwnPropertyDescriptor(c,"value").set;if(o!==e&&d){const h=new Event("input",{bubbles:!0});d.call(a,e),a.dispatchEvent(h)}},[o,e]),S.jsx(_S.input,{style:{display:"none"},...n,ref:s,defaultValue:e})});pue.displayName=sze;function oze(t=[],e,n){const r=[...t];return r[n]=e,r.sort((i,s)=>i-s)}function mue(t,e,n){const s=100/(n-e)*(t-e);return tue(s,[0,100])}function aze(t,e){return e>2?`Value ${t+1} of ${e}`:e===2?["Minimum","Maximum"][t]:void 0}function cze(t,e){if(t.length===1)return 0;const n=t.map(i=>Math.abs(i-e)),r=Math.min(...n);return n.indexOf(r)}function lze(t,e,n){const r=t/2,s=M9([0,50],[0,r]);return(r-s(e)*n)*n}function uze(t){return t.slice(0,-1).map((e,n)=>t[n+1]-e)}function dze(t,e){if(e>0){const n=uze(t);return Math.min(...n)>=e}return!0}function M9(t,e){return n=>{if(t[0]===t[1]||e[0]===e[1])return e[0];const r=(e[1]-e[0])/(t[1]-t[0]);return e[0]+r*(n-t[0])}}function fze(t){return(String(t).split(".")[1]||"").length}function hze(t,e){const n=Math.pow(10,e);return Math.round(t*n)/n}var pze=oue,mze=due,gze=fue,vze=hue;const yze="_slider_15go1_8",bze="_track_15go1_14",_ze="_highlight_15go1_31",Sze="_handle_15go1_43",Jw={slider:yze,track:bze,highlight:_ze,handle:Sze},L9=({className:t,label:e,value:n,onValueChange:r,onValueCommit:i,min:s,max:o,step:a,disabled:c})=>{const l=_.useCallback(([h])=>r(h),[r]),d=_.useCallback(([h])=>i?.(h),[i]);return S.jsxs(pze,{className:Le(t,Jw.slider),value:[n],onValueChange:l,onValueCommit:d,min:s,max:o,step:a,disabled:c,children:[S.jsx(mze,{className:Jw.track,children:S.jsx(gze,{className:Jw.highlight})}),S.jsx(mi,{placement:"top",label:Math.round(n*100).toString()+"%",children:S.jsx(vze,{className:Jw.handle,"aria-label":e})})]})},wze="_selection_1akwb_1",Eze="_title_1akwb_5",Cze="_separator_1akwb_10",Tze="_options_1akwb_14",Rze="_secondary_1akwb_20",g1={selection:wze,title:Eze,separator:Cze,options:Tze,secondary:Rze},l5=({device:t,title:e,numberedLabel:n})=>{const{t:r}=ze(),i=_.useId(),s=So(t.available$),o=So(t.selected$)?.id,a=_.useCallback(c=>{t.select(c.target.value)},[t]);return s.size<=1?null:S.jsxs("div",{className:g1.selection,children:[S.jsx(qc,{type:"body",weight:"semibold",size:"sm",as:"h4",className:g1.title,children:e}),S.jsx(j8,{className:g1.separator}),S.jsx("div",{className:g1.options,children:[...s].map(([c,l])=>{let d;switch(l.type){case"name":d=l.name;break;case"number":d=n(l.number);break;case"default":d=l.name===null?r("settings.devices.default"):S.jsxs(bo,{i18nKey:"settings.devices.default_named",name:l.name,children:["Default"," ",S.jsxs("span",{className:g1.secondary,children:["(",{name:l.name},")"]})]});break;case"speaker":d=r("settings.devices.loudspeaker");break;case"earpiece":d=r("settings.devices.handset");break}return S.jsx(tC,{name:i,control:S.jsx(eC,{checked:c===o,onChange:a,value:c}),children:S.jsx(cb,{children:d})},c)})})]})};var Kv=typeof self<"u"?self:{};function E_(t,e){e:{for(var n=["CLOSURE_FLAGS"],r=Kv,i=0;i<n.length;i++)if((r=r[n[i]])==null){n=null;break e}n=r}return(t=n&&n[t])!=null?t:e}function Gh(){throw Error("Invalid UTF8")}function Lz(t,e){return e=String.fromCharCode.apply(null,e),t==null?e:t+e}let Xw,u5;const kze=typeof TextDecoder<"u";let Ize;const xze=typeof TextEncoder<"u";function gue(t){if(xze)t=(Ize||=new TextEncoder).encode(t);else{let n=0;const r=new Uint8Array(3*t.length);for(let i=0;i<t.length;i++){var e=t.charCodeAt(i);if(e<128)r[n++]=e;else{if(e<2048)r[n++]=e>>6|192;else{if(e>=55296&&e<=57343){if(e<=56319&&i<t.length){const s=t.charCodeAt(++i);if(s>=56320&&s<=57343){e=1024*(e-55296)+s-56320+65536,r[n++]=e>>18|240,r[n++]=e>>12&63|128,r[n++]=e>>6&63|128,r[n++]=63&e|128;continue}i--}e=65533}r[n++]=e>>12|224,r[n++]=e>>6&63|128}r[n++]=63&e|128}}t=n===r.length?r:r.subarray(0,n)}return t}function vue(t){Kv.setTimeout((()=>{throw t}),0)}var fO,Aze=E_(610401301,!1),Oz=E_(748402147,!0),O9=E_(824648567,!0),P9=E_(824656860,E_(1,!0));function Pz(){var t=Kv.navigator;return t&&(t=t.userAgent)?t:""}const Dz=Kv.navigator;function JR(t){return JR[" "](t),t}fO=Dz&&Dz.userAgentData||null,JR[" "]=function(){};const yue={};let $1=null;function Mze(t){const e=t.length;let n=3*e/4;n%3?n=Math.floor(n):"=.".indexOf(t[e-1])!=-1&&(n="=.".indexOf(t[e-2])!=-1?n-2:n-1);const r=new Uint8Array(n);let i=0;return(function(s,o){function a(l){for(;c<s.length;){const d=s.charAt(c++),h=$1[d];if(h!=null)return h;if(!/^[\s\xa0]*$/.test(d))throw Error("Unknown base64 encoding at char: "+d)}return l}bue();let c=0;for(;;){const l=a(-1),d=a(0),h=a(64),m=a(64);if(m===64&&l===-1)break;o(l<<2|d>>4),h!=64&&(o(d<<4&240|h>>2),m!=64&&o(h<<6&192|m))}})(t,(function(s){r[i++]=s})),i!==n?r.subarray(0,i):r}function bue(){if(!$1){$1={};var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789".split(""),e=["+/=","+/","-_=","-_.","-_"];for(let n=0;n<5;n++){const r=t.concat(e[n].split(""));yue[n]=r;for(let i=0;i<r.length;i++){const s=r[i];$1[s]===void 0&&($1[s]=i)}}}}var Lze=typeof Uint8Array<"u",_ue=!(!(Aze&&fO&&fO.brands.length>0)&&(Pz().indexOf("Trident")!=-1||Pz().indexOf("MSIE")!=-1))&&typeof btoa=="function";const Nz=/[-_.]/g,Oze={"-":"+",_:"/",".":"="};function Pze(t){return Oze[t]||""}function Sue(t){if(!_ue)return Mze(t);t=Nz.test(t)?t.replace(Nz,Pze):t,t=atob(t);const e=new Uint8Array(t.length);for(let n=0;n<t.length;n++)e[n]=t.charCodeAt(n);return e}function D9(t){return Lze&&t!=null&&t instanceof Uint8Array}var Gv={};function qp(){return Dze||=new Rl(null,Gv)}function N9(t){wue(Gv);var e=t.g;return(e=e==null||D9(e)?e:typeof e=="string"?Sue(e):null)==null?e:t.g=e}var Rl=class{h(){return new Uint8Array(N9(this)||0)}constructor(e,n){if(wue(n),this.g=e,e!=null&&e.length===0)throw Error("ByteString should be constructed with non-empty values")}};let Dze,Nze;function wue(t){if(t!==Gv)throw Error("illegal external caller")}function Eue(t,e){t.__closure__error__context__984382||(t.__closure__error__context__984382={}),t.__closure__error__context__984382.severity=e}function hO(t){return Eue(t=Error(t),"warning"),t}function zv(t,e){if(t!=null){var n=Nze??={},r=n[t]||0;r>=e||(n[t]=r+1,Eue(t=Error(),"incident"),vue(t))}}function My(){return typeof BigInt=="function"}var Ly=typeof Symbol=="function"&&typeof Symbol()=="symbol";function Hl(t,e,n=!1){return typeof Symbol=="function"&&typeof Symbol()=="symbol"?n&&Symbol.for&&t?Symbol.for(t):t!=null?Symbol(t):Symbol():e}var Uze=Hl("jas",void 0,!0),Uz=Hl(void 0,"0di"),v1=Hl(void 0,"1oa"),ta=Hl(void 0,Symbol()),jze=Hl(void 0,"0ub"),Fze=Hl(void 0,"0ubs"),pO=Hl(void 0,"0ubsb"),$ze=Hl(void 0,"0actk"),Wv=Hl("m_m","Pa",!0),jz=Hl();const Cue={Ga:{value:0,configurable:!0,writable:!0,enumerable:!1}},Tue=Object.defineProperties,Ye=Ly?Uze:"Ga";var mm;const Fz=[];function SS(t,e){Ly||Ye in t||Tue(t,Cue),t[Ye]|=e}function bi(t,e){Ly||Ye in t||Tue(t,Cue),t[Ye]=e}function wS(t){return SS(t,34),t}function C_(t){return SS(t,8192),t}bi(Fz,7),mm=Object.freeze(Fz);var Yv={};function aa(t,e){return e===void 0?t.h!==Vp&&!!(2&(0|t.v[Ye])):!!(2&e)&&t.h!==Vp}const Vp={};function U9(t,e){if(t!=null){if(typeof t=="string")t=t?new Rl(t,Gv):qp();else if(t.constructor!==Rl)if(D9(t))t=t.length?new Rl(new Uint8Array(t),Gv):qp();else{if(!e)throw Error();t=void 0}}return t}class $z{constructor(e,n,r){this.g=e,this.h=n,this.l=r}next(){const e=this.g.next();return e.done||(e.value=this.h.call(this.l,e.value)),e}[Symbol.iterator](){return this}}var Bze=Object.freeze({});function Rue(t,e,n){const r=128&e?0:-1,i=t.length;var s;(s=!!i)&&(s=(s=t[i-1])!=null&&typeof s=="object"&&s.constructor===Object);const o=i+(s?-1:0);for(e=128&e?1:0;e<o;e++)n(e-r,t[e]);if(s){t=t[i-1];for(const a in t)!isNaN(a)&&n(+a,t[a])}}var kue={};function Oy(t){return 128&t?kue:void 0}function XR(t){return t.Na=!0,t}var Hze=XR((t=>typeof t=="number")),Bz=XR((t=>typeof t=="string")),qze=XR((t=>typeof t=="boolean")),QR=typeof Kv.BigInt=="function"&&typeof Kv.BigInt(0)=="bigint";function na(t){var e=t;if(Bz(e)){if(!/^\s*(?:-?[1-9]\d*|0)?\s*$/.test(e))throw Error(String(e))}else if(Hze(e)&&!Number.isSafeInteger(e))throw Error(String(e));return QR?BigInt(t):t=qze(t)?t?"1":"0":Bz(t)?t.trim()||"0":String(t)}var mO=XR((t=>QR?t>=Kze&&t<=zze:t[0]==="-"?Hz(t,Vze):Hz(t,Gze)));const Vze=Number.MIN_SAFE_INTEGER.toString(),Kze=QR?BigInt(Number.MIN_SAFE_INTEGER):void 0,Gze=Number.MAX_SAFE_INTEGER.toString(),zze=QR?BigInt(Number.MAX_SAFE_INTEGER):void 0;function Hz(t,e){if(t.length>e.length)return!1;if(t.length<e.length||t===e)return!0;for(let n=0;n<t.length;n++){const r=t[n],i=e[n];if(r>i)return!1;if(r<i)return!0}}const Wze=typeof Uint8Array.prototype.slice=="function";let Yze,gr=0,Zr=0;function qz(t){const e=t>>>0;gr=e,Zr=(t-e)/4294967296>>>0}function Jv(t){if(t<0){qz(-t);const[e,n]=B9(gr,Zr);gr=e>>>0,Zr=n>>>0}else qz(t)}function j9(t){const e=Yze||=new DataView(new ArrayBuffer(8));e.setFloat32(0,+t,!0),Zr=0,gr=e.getUint32(0,!0)}function gO(t,e){const n=4294967296*e+(t>>>0);return Number.isSafeInteger(n)?n:T_(t,e)}function Jze(t,e){return na(My()?BigInt.asUintN(64,(BigInt(e>>>0)<<BigInt(32))+BigInt(t>>>0)):T_(t,e))}function F9(t,e){const n=2147483648&e;return n&&(e=~e>>>0,(t=1+~t>>>0)==0&&(e=e+1>>>0)),typeof(t=gO(t,e))=="number"?n?-t:t:n?"-"+t:t}function Iue(t,e){return My()?na(BigInt.asIntN(64,(BigInt.asUintN(32,BigInt(e))<<BigInt(32))+BigInt.asUintN(32,BigInt(t)))):na($9(t,e))}function T_(t,e){if(t>>>=0,(e>>>=0)<=2097151)var n=""+(4294967296*e+t);else My()?n=""+(BigInt(e)<<BigInt(32)|BigInt(t)):(t=(16777215&t)+6777216*(n=16777215&(t>>>24|e<<8))+6710656*(e=e>>16&65535),n+=8147497*e,e*=2,t>=1e7&&(n+=t/1e7>>>0,t%=1e7),n>=1e7&&(e+=n/1e7>>>0,n%=1e7),n=e+Vz(n)+Vz(t));return n}function Vz(t){return t=String(t),"0000000".slice(t.length)+t}function $9(t,e){if(2147483648&e)if(My())t=""+(BigInt(0|e)<<BigInt(32)|BigInt(t>>>0));else{const[n,r]=B9(t,e);t="-"+T_(n,r)}else t=T_(t,e);return t}function ZR(t){if(t.length<16)Jv(Number(t));else if(My())t=BigInt(t),gr=Number(t&BigInt(4294967295))>>>0,Zr=Number(t>>BigInt(32)&BigInt(4294967295));else{const e=+(t[0]==="-");Zr=gr=0;const n=t.length;for(let r=e,i=(n-e)%6+e;i<=n;r=i,i+=6){const s=Number(t.slice(r,i));Zr*=1e6,gr=1e6*gr+s,gr>=4294967296&&(Zr+=Math.trunc(gr/4294967296),Zr>>>=0,gr>>>=0)}if(e){const[r,i]=B9(gr,Zr);gr=r,Zr=i}}}function B9(t,e){return e=~e,t?t=1+~t:e+=1,[t,e]}function Uc(t){return Array.prototype.slice.call(t)}const ES=typeof BigInt=="function"?BigInt.asIntN:void 0,Xze=typeof BigInt=="function"?BigInt.asUintN:void 0,Kp=Number.isSafeInteger,e4=Number.isFinite,Xv=Math.trunc,Qze=na(0);function B1(t){if(t!=null&&typeof t!="number")throw Error(`Value of float/double field must be a number, found ${typeof t}: ${t}`);return t}function _l(t){return t==null||typeof t=="number"?t:t==="NaN"||t==="Infinity"||t==="-Infinity"?Number(t):void 0}function R_(t){if(t!=null&&typeof t!="boolean"){var e=typeof t;throw Error(`Expected boolean but got ${e!="object"?e:t?Array.isArray(t)?"array":e:"null"}: ${t}`)}return t}function xue(t){return t==null||typeof t=="boolean"?t:typeof t=="number"?!!t:void 0}const Zze=/^-?([1-9][0-9]*|0)(\.[0-9]+)?$/;function CS(t){switch(typeof t){case"bigint":return!0;case"number":return e4(t);case"string":return Zze.test(t);default:return!1}}function Py(t){if(t==null)return t;if(typeof t=="string"&&t)t=+t;else if(typeof t!="number")return;return e4(t)?0|t:void 0}function Aue(t){if(t==null)return t;if(typeof t=="string"&&t)t=+t;else if(typeof t!="number")return;return e4(t)?t>>>0:void 0}function Mue(t){const e=t.length;return(t[0]==="-"?e<20||e===20&&t<="-9223372036854775808":e<19||e===19&&t<="9223372036854775807")?t:(ZR(t),$9(gr,Zr))}function H9(t){return t=Xv(t),Kp(t)||(Jv(t),t=F9(gr,Zr)),t}function Lue(t){var e=Xv(Number(t));return Kp(e)?String(e):((e=t.indexOf("."))!==-1&&(t=t.substring(0,e)),Mue(t))}function Oue(t){var e=Xv(Number(t));return Kp(e)?na(e):((e=t.indexOf("."))!==-1&&(t=t.substring(0,e)),My()?na(ES(64,BigInt(t))):na(Mue(t)))}function Pue(t){return Kp(t)?t=na(H9(t)):(t=Xv(t),Kp(t)?t=String(t):(Jv(t),t=$9(gr,Zr)),t=na(t)),t}function eWe(t){return t==null?t:typeof t=="bigint"?(mO(t)?t=Number(t):(t=ES(64,t),t=mO(t)?Number(t):String(t)),t):CS(t)?typeof t=="number"?H9(t):Lue(t):void 0}function G3(t){const e=typeof t;return t==null?t:e==="bigint"?na(ES(64,t)):CS(t)?e==="string"?Oue(t):Pue(t):void 0}function Due(t){if(typeof t!="string")throw Error();return t}function TS(t){if(t!=null&&typeof t!="string")throw Error();return t}function as(t){return t==null||typeof t=="string"?t:void 0}function q9(t,e,n,r){return t!=null&&t[Wv]===Yv?t:Array.isArray(t)?((r=(n=0|t[Ye])|32&r|2&r)!==n&&bi(t,r),new e(t)):(n?2&r?((t=e[Uz])||(wS((t=new e).v),t=e[Uz]=t),e=t):e=new e:e=void 0,e)}function tWe(t,e,n){if(e)e:{if(!CS(e=t))throw hO("int64");switch(typeof e){case"string":e=Oue(e);break e;case"bigint":e=na(ES(64,e));break e;default:e=Pue(e)}}else e=G3(t);return(t=e)==null?n?Qze:void 0:t}const nWe={};let rWe=(function(){try{return JR(new class extends Map{constructor(){super()}}),!1}catch{return!0}})();class d5{constructor(){this.g=new Map}get(e){return this.g.get(e)}set(e,n){return this.g.set(e,n),this.size=this.g.size,this}delete(e){return e=this.g.delete(e),this.size=this.g.size,e}clear(){this.g.clear(),this.size=this.g.size}has(e){return this.g.has(e)}entries(){return this.g.entries()}keys(){return this.g.keys()}values(){return this.g.values()}forEach(e,n){return this.g.forEach(e,n)}[Symbol.iterator](){return this.entries()}}const iWe=rWe?(Object.setPrototypeOf(d5.prototype,Map.prototype),Object.defineProperties(d5.prototype,{size:{value:0,configurable:!0,enumerable:!0,writable:!0}}),d5):class extends Map{constructor(){super()}};function Kz(t){return t}function f5(t){if(2&t.J)throw Error("Cannot mutate an immutable Map")}var id=class extends iWe{constructor(e,n,r=Kz,i=Kz){super(),this.J=0|e[Ye],this.K=n,this.S=r,this.fa=this.K?sWe:i;for(let s=0;s<e.length;s++){const o=e[s],a=r(o[0],!1,!0);let c=o[1];n?c===void 0&&(c=null):c=i(o[1],!1,!0,void 0,void 0,this.J),super.set(a,c)}}V(e){return C_(Array.from(super.entries(),e))}clear(){f5(this),super.clear()}delete(e){return f5(this),super.delete(this.S(e,!0,!1))}entries(){if(this.K){var e=super.keys();e=new $z(e,oWe,this)}else e=super.entries();return e}values(){if(this.K){var e=super.keys();e=new $z(e,id.prototype.get,this)}else e=super.values();return e}forEach(e,n){this.K?super.forEach(((r,i,s)=>{e.call(n,s.get(i),i,s)})):super.forEach(e,n)}set(e,n){return f5(this),(e=this.S(e,!0,!1))==null?this:n==null?(super.delete(e),this):super.set(e,this.fa(n,!0,!0,this.K,!1,this.J))}Ma(e){const n=this.S(e[0],!1,!0);e=e[1],e=this.K?e===void 0?null:e:this.fa(e,!1,!0,void 0,!1,this.J),super.set(n,e)}has(e){return super.has(this.S(e,!1,!1))}get(e){e=this.S(e,!1,!1);const n=super.get(e);if(n!==void 0){var r=this.K;return r?((r=this.fa(n,!1,!0,r,this.ra,this.J))!==n&&super.set(e,r),r):n}}[Symbol.iterator](){return this.entries()}};function sWe(t,e,n,r,i,s){return t=q9(t,r,n,s),i&&(t=K9(t)),t}function oWe(t){return[t,this.get(t)]}let aWe;function Gz(){return aWe||=new id(wS([]),void 0,void 0,void 0,nWe)}function t4(t){return ta?t[ta]:void 0}function z3(t,e){for(const n in t)!isNaN(n)&&e(t,+n,t[n])}id.prototype.toJSON=void 0;var vO=class{};const cWe={Ka:!0};function lWe(t,e){e<100||zv(Fze,1)}function n4(t,e,n,r){const i=r!==void 0;r=!!r;var s,o=ta;!i&&Ly&&o&&(s=t[o])&&z3(s,lWe),o=[];var a=t.length;let c;s=4294967295;let l=!1;const d=!!(64&e),h=d?128&e?0:-1:void 0;1&e||(c=a&&t[a-1],c!=null&&typeof c=="object"&&c.constructor===Object?s=--a:c=void 0,!d||128&e||i||(l=!0,s=s-h+h)),e=void 0;for(var m=0;m<a;m++){let g=t[m];if(g!=null&&(g=n(g,r))!=null)if(d&&m>=s){const y=m-h;(e??={})[y]=g}else o[m]=g}if(c)for(let g in c){if((a=c[g])==null||(a=n(a,r))==null)continue;let y;m=+g,d&&!Number.isNaN(m)&&(y=m+h)<s?o[y]=a:(e??={})[g]=a}return e&&(l?o.push(e):o[s]=e),i&&ta&&(t=t4(t))&&t instanceof vO&&(o[ta]=(function(g){const y=new vO;return z3(g,((v,E,w)=>{y[E]=Uc(w)})),y.da=g.da,y})(t)),o}function uWe(t){return t[0]=k_(t[0]),t[1]=k_(t[1]),t}function k_(t){switch(typeof t){case"number":return Number.isFinite(t)?t:""+t;case"bigint":return mO(t)?Number(t):""+t;case"boolean":return t?1:0;case"object":if(Array.isArray(t)){var e=0|t[Ye];return t.length===0&&1&e?void 0:n4(t,e,k_)}if(t!=null&&t[Wv]===Yv)return Nue(t);if(t instanceof Rl){if((e=t.g)==null)t="";else if(typeof e=="string")t=e;else{if(_ue){for(var n="",r=0,i=e.length-10240;r<i;)n+=String.fromCharCode.apply(null,e.subarray(r,r+=10240));n+=String.fromCharCode.apply(null,r?e.subarray(r):e),e=btoa(n)}else{n===void 0&&(n=0),bue(),n=yue[n],r=Array(Math.floor(e.length/3)),i=n[64]||"";let l=0,d=0;for(;l<e.length-2;l+=3){var s=e[l],o=e[l+1],a=e[l+2],c=n[s>>2];s=n[(3&s)<<4|o>>4],o=n[(15&o)<<2|a>>6],a=n[63&a],r[d++]=c+s+o+a}switch(c=0,a=i,e.length-l){case 2:a=n[(15&(c=e[l+1]))<<2]||i;case 1:e=e[l],r[d]=n[e>>2]+n[(3&e)<<4|c>>4]+a+i}e=r.join("")}t=t.g=e}return t}return t instanceof id?t=t.size!==0?t.V(uWe):void 0:void 0}return t}function Nue(t){return n4(t=t.v,0|t[Ye],k_)}let dWe,fWe;function Sp(t,e){return Uue(t,e[0],e[1])}function Uue(t,e,n,r=0){if(t==null){var i=32;n?(t=[n],i|=128):t=[],e&&(i=-16760833&i|(1023&e)<<14)}else{if(!Array.isArray(t))throw Error("narr");if(i=0|t[Ye],Oz&&1&i)throw Error("rfarr");if(2048&i&&!(2&i)&&(function(){if(Oz)throw Error("carr");zv($ze,5)})(),256&i)throw Error("farr");if(64&i)return(i|r)!==i&&bi(t,i|r),t;if(n&&(i|=128,n!==t[0]))throw Error("mid");e:{i|=64;var s=(n=t).length;if(s){var o=s-1;const c=n[o];if(c!=null&&typeof c=="object"&&c.constructor===Object){if((o-=e=128&i?0:-1)>=1024)throw Error("pvtlmt");for(var a in c)(s=+a)<o&&(n[s+e]=c[a],delete c[a]);i=-16760833&i|(1023&o)<<14;break e}}if(e){if((a=Math.max(e,s-(128&i?0:-1)))>1024)throw Error("spvt");i=-16760833&i|(1023&a)<<14}}}return bi(t,64|i|r),t}function hWe(t,e){if(typeof t!="object")return t;if(Array.isArray(t)){var n=0|t[Ye];return t.length===0&&1&n?void 0:zz(t,n,e)}if(t!=null&&t[Wv]===Yv)return Wz(t);if(t instanceof id){if(2&(e=t.J))return t;if(!t.size)return;if(n=wS(t.V()),t.K)for(t=0;t<n.length;t++){const r=n[t];let i=r[1];i=i==null||typeof i!="object"?void 0:i!=null&&i[Wv]===Yv?Wz(i):Array.isArray(i)?zz(i,0|i[Ye],!!(32&e)):void 0,r[1]=i}return n}return t instanceof Rl?t:void 0}function zz(t,e,n){return 2&e||(!n||4096&e||16&e?t=Dy(t,e,!1,n&&!(16&e)):(SS(t,34),4&e&&Object.freeze(t))),t}function V9(t,e,n){return t=new t.constructor(e),n&&(t.h=Vp),t.m=Vp,t}function Wz(t){const e=t.v,n=0|e[Ye];return aa(t,n)?t:G9(t,e,n)?V9(t,e):Dy(e,n)}function Dy(t,e,n,r){return r??=!!(34&e),t=n4(t,e,hWe,r),r=32,n&&(r|=2),bi(t,e=16769217&e|r),t}function K9(t){const e=t.v,n=0|e[Ye];return aa(t,n)?G9(t,e,n)?V9(t,e,!0):new t.constructor(Dy(e,n,!1)):t}function Ny(t){if(t.h!==Vp)return!1;var e=t.v;return SS(e=Dy(e,0|e[Ye]),2048),t.v=e,t.h=void 0,t.m=void 0,!0}function Uy(t){if(!Ny(t)&&aa(t,0|t.v[Ye]))throw Error()}function gm(t,e){e===void 0&&(e=0|t[Ye]),32&e&&!(4096&e)&&bi(t,4096|e)}function G9(t,e,n){return!!(2&n)||!(!(32&n)||4096&n)&&(bi(e,2|n),t.h=Vp,!0)}const pWe=na(0),Wd={};function lr(t,e,n,r,i){if((e=sd(t.v,e,n,i))!==null||r&&t.m!==Vp)return e}function sd(t,e,n,r){if(e===-1)return null;const i=e+(n?0:-1),s=t.length-1;let o,a;if(!(s<1+(n?0:-1))){if(i>=s)if(o=t[s],o!=null&&typeof o=="object"&&o.constructor===Object)n=o[e],a=!0;else{if(i!==s)return;n=o}else n=t[i];if(r&&n!=null){if((r=r(n))==null)return r;if(!Object.is(r,n))return a?o[e]=r:t[i]=r,r}return n}}function xn(t,e,n,r){Uy(t),gi(t=t.v,0|t[Ye],e,n,r)}function gi(t,e,n,r,i){const s=n+(i?0:-1);var o=t.length-1;if(o>=1+(i?0:-1)&&s>=o){const a=t[o];if(a!=null&&typeof a=="object"&&a.constructor===Object)return a[n]=r,e}return s<=o?(t[s]=r,e):(r!==void 0&&(n>=(o=(e??=0|t[Ye])>>14&1023||536870912)?r!=null&&(t[o+(i?0:-1)]={[n]:r}):t[s]=r),e)}function lp(){return Bze===void 0?2:4}function up(t,e,n,r,i){let s=t.v,o=0|s[Ye];r=aa(t,o)?1:r,i=!!i||r===3,r===2&&Ny(t)&&(s=t.v,o=0|s[Ye]);let a=(t=z9(s,e))===mm?7:0|t[Ye],c=W9(a,o);var l=!(4&c);if(l){4&c&&(t=Uc(t),a=0,c=Ep(c,o),o=gi(s,o,e,t));let d=0,h=0;for(;d<t.length;d++){const m=n(t[d]);m!=null&&(t[h++]=m)}h<d&&(t.length=h),n=-513&(4|c),c=n&=-1025,c&=-4097}return c!==a&&(bi(t,c),2&c&&Object.freeze(t)),jue(t,c,s,o,e,r,l,i)}function jue(t,e,n,r,i,s,o,a){let c=e;return s===1||s===4&&(2&e||!(16&e)&&32&r)?wp(e)||((e|=!t.length||o&&!(4096&e)||32&r&&!(4096&e||16&e)?2:256)!==c&&bi(t,e),Object.freeze(t)):(s===2&&wp(e)&&(t=Uc(t),c=0,e=Ep(e,r),r=gi(n,r,i,t)),wp(e)||(a||(e|=16),e!==c&&bi(t,e))),2&e||!(4096&e||16&e)||gm(n,r),t}function z9(t,e,n){return t=sd(t,e,n),Array.isArray(t)?t:mm}function W9(t,e){return 2&e&&(t|=2),1|t}function wp(t){return!!(2&t)&&!!(4&t)||!!(256&t)}function Fue(t){return U9(t,!0)}function $ue(t){t=Uc(t);for(let e=0;e<t.length;e++){const n=t[e]=Uc(t[e]);Array.isArray(n[1])&&(n[1]=wS(n[1]))}return C_(t)}function hf(t,e,n,r){Uy(t),gi(t=t.v,0|t[Ye],e,(r==="0"?Number(n)===0:n===r)?void 0:n)}function jy(t,e,n){if(2&e)throw Error();const r=Oy(e);let i=z9(t,n,r),s=i===mm?7:0|i[Ye],o=W9(s,e);return(2&o||wp(o)||16&o)&&(o===s||wp(o)||bi(i,o),i=Uc(i),s=0,o=Ep(o,e),gi(t,e,n,i,r)),o&=-13,o!==s&&bi(i,o),i}function h5(t,e){var n=Lde;return J9(Y9(t=t.v),t,void 0,n)===e?e:-1}function Y9(t){if(Ly)return t[v1]??(t[v1]=new Map);if(v1 in t)return t[v1];const e=new Map;return Object.defineProperty(t,v1,{value:e}),e}function Bue(t,e,n,r,i){const s=Y9(t),o=J9(s,t,e,n,i);return o!==r&&(o&&(e=gi(t,e,o,void 0,i)),s.set(n,r)),e}function J9(t,e,n,r,i){let s=t.get(r);if(s!=null)return s;s=0;for(let o=0;o<r.length;o++){const a=r[o];sd(e,a,i)!=null&&(s!==0&&(n=gi(e,n,s,void 0,i)),s=a)}return t.set(r,s),s}function X9(t,e,n){let r=0|t[Ye];const i=Oy(r),s=sd(t,n,i);let o;if(s!=null&&s[Wv]===Yv){if(!aa(s))return Ny(s),s.v;o=s.v}else Array.isArray(s)&&(o=s);if(o){const a=0|o[Ye];2&a&&(o=Dy(o,a))}return o=Sp(o,e),o!==s&&gi(t,r,n,o,i),o}function Hue(t,e,n,r,i){let s=!1;if((r=sd(t,r,i,(o=>{const a=q9(o,n,!1,e);return s=a!==o&&a!=null,a})))!=null)return s&&!aa(r)&&gm(t,e),r}function an(t,e,n,r){let i=t.v,s=0|i[Ye];if((e=Hue(i,s,e,n,r))==null)return e;if(s=0|i[Ye],!aa(t,s)){const o=K9(e);o!==e&&(Ny(t)&&(i=t.v,s=0|i[Ye]),s=gi(i,s,n,e=o,r),gm(i,s))}return e}function que(t,e,n,r,i,s,o,a){var c=aa(t,n);s=c?1:s,o=!!o||s===3,c=a&&!c,(s===2||c)&&Ny(t)&&(n=0|(e=t.v)[Ye]);var l=(t=z9(e,i))===mm?7:0|t[Ye],d=W9(l,n);if(a=!(4&d)){var h=t,m=n;const g=!!(2&d);g&&(m|=2);let y=!g,v=!0,E=0,w=0;for(;E<h.length;E++){const k=q9(h[E],r,!1,m);if(k instanceof r){if(!g){const x=aa(k);y&&=!x,v&&=x}h[w++]=k}}w<E&&(h.length=w),d|=4,d=v?-4097&d:4096|d,d=y?8|d:-9&d}if(d!==l&&(bi(t,d),2&d&&Object.freeze(t)),c&&!(8&d||!t.length&&(s===1||s===4&&(2&d||!(16&d)&&32&n)))){for(wp(d)&&(t=Uc(t),d=Ep(d,n),n=gi(e,n,i,t)),r=t,c=d,l=0;l<r.length;l++)(h=r[l])!==(d=K9(h))&&(r[l]=d);c|=8,bi(t,d=c=r.length?4096|c:-4097&c)}return jue(t,d,e,n,i,s,a,o)}function od(t,e,n){const r=t.v;return que(t,r,0|r[Ye],e,n,lp(),!1,!0)}function Vue(t){return t==null&&(t=void 0),t}function lt(t,e,n,r,i){return xn(t,n,r=Vue(r),i),r&&!aa(r)&&gm(t.v),t}function yb(t,e,n,r){e:{var i=r=Vue(r);Uy(t);const s=t.v;let o=0|s[Ye];if(i==null){const a=Y9(s);if(J9(a,s,o,n)!==e)break e;a.set(n,0)}else o=Bue(s,o,n,e);gi(s,o,e,i)}r&&!aa(r)&&gm(t.v)}function Ep(t,e){return-273&(2&e?2|t:-3&t)}function Q9(t,e,n,r){var i=r;Uy(t),t=que(t,r=t.v,0|r[Ye],n,e,2,!0),i=i??new n,t.push(i),e=n=t===mm?7:0|t[Ye],(i=aa(i))?(n&=-9,t.length===1&&(n&=-4097)):n|=4096,n!==e&&bi(t,n),i||gm(r)}function za(t,e,n){return Py(lr(t,e,void 0,n))}function Kue(t){return(P9?lr(t,2,void 0,void 0,G3):G3(lr(t,2)))??pWe}function Nr(t,e){return lr(t,e,void 0,void 0,_l)??0}function ad(t,e,n){if(n!=null){if(typeof n!="number"||!e4(n))throw hO("int32");n|=0}xn(t,e,n)}function tt(t,e,n){xn(t,e,B1(n))}function ca(t,e,n){hf(t,e,TS(n),"")}function W3(t,e,n){{Uy(t);const o=t.v;let a=0|o[Ye];if(n==null)gi(o,a,e);else{var r=t=n===mm?7:0|n[Ye],i=wp(t),s=i||Object.isFrozen(n);for(i||(t=0),s||(n=Uc(n),r=0,t=Ep(t,a),s=!1),t|=5,t|=(4&t?512&t?512:1024&t?1024:0:void 0)??(P9?1024:0),i=0;i<n.length;i++){const c=n[i],l=Due(c);Object.is(c,l)||(s&&(n=Uc(n),r=0,t=Ep(t,a),s=!1),n[i]=l)}t!==r&&(s&&(n=Uc(n),t=Ep(t,a)),bi(n,t)),gi(o,a,e,n)}}}function r4(t,e,n){Uy(t),up(t,e,as,2,!0).push(Due(n))}var wg=class{constructor(t,e,n){if(this.buffer=t,n&&!e)throw Error();this.g=e}};function Z9(t,e){if(typeof t=="string")return new wg(Sue(t),e);if(Array.isArray(t))return new wg(new Uint8Array(t),e);if(t.constructor===Uint8Array)return new wg(t,!1);if(t.constructor===ArrayBuffer)return t=new Uint8Array(t),new wg(t,!1);if(t.constructor===Rl)return e=N9(t)||new Uint8Array(0),new wg(e,!0,t);if(t instanceof Uint8Array)return t=t.constructor===Uint8Array?t:new Uint8Array(t.buffer,t.byteOffset,t.byteLength),new wg(t,!1);throw Error()}function Qv(t,e){let n,r=0,i=0,s=0;const o=t.h;let a=t.g;do n=o[a++],r|=(127&n)<<s,s+=7;while(s<32&&128&n);if(s>32)for(i|=(127&n)>>4,s=3;s<32&&128&n;s+=7)n=o[a++],i|=(127&n)<<s;if(Cp(t,a),!(128&n))return e(r>>>0,i>>>0);throw Error()}function eD(t){let e=0,n=t.g;const r=n+10,i=t.h;for(;n<r;){const s=i[n++];if(e|=s,(128&s)==0)return Cp(t,n),!!(127&e)}throw Error()}function eh(t){const e=t.h;let n=t.g,r=e[n++],i=127&r;if(128&r&&(r=e[n++],i|=(127&r)<<7,128&r&&(r=e[n++],i|=(127&r)<<14,128&r&&(r=e[n++],i|=(127&r)<<21,128&r&&(r=e[n++],i|=r<<28,128&r&&128&e[n++]&&128&e[n++]&&128&e[n++]&&128&e[n++]&&128&e[n++])))))throw Error();return Cp(t,n),i}function cd(t){return eh(t)>>>0}function Y3(t){var e=t.h;const n=t.g;var r=e[n],i=e[n+1];const s=e[n+2];return e=e[n+3],Cp(t,t.g+4),t=2*((i=(r<<0|i<<8|s<<16|e<<24)>>>0)>>31)+1,r=i>>>23&255,i&=8388607,r==255?i?NaN:t*(1/0):r==0?1401298464324817e-60*t*i:t*Math.pow(2,r-150)*(i+8388608)}function mWe(t){return eh(t)}function Cp(t,e){if(t.g=e,e>t.l)throw Error()}function Gue(t,e){if(e<0)throw Error();const n=t.g;if((e=n+e)>t.l)throw Error();return t.g=e,n}function zue(t,e){if(e==0)return qp();var n=Gue(t,e);return t.Y&&t.j?n=t.h.subarray(n,n+e):(t=t.h,n=n===(e=n+e)?new Uint8Array(0):Wze?t.slice(n,e):new Uint8Array(t.subarray(n,e))),n.length==0?qp():new Rl(n,Gv)}var Yz=[];function Wue(t,e,n,r){if(J3.length){const i=J3.pop();return i.o(r),i.g.init(t,e,n,r),i}return new gWe(t,e,n,r)}function Yue(t){t.g.clear(),t.l=-1,t.h=-1,J3.length<100&&J3.push(t)}function Jue(t){var e=t.g;if(e.g==e.l)return!1;t.m=t.g.g;var n=cd(t.g);if(e=n>>>3,!((n&=7)>=0&&n<=5)||e<1)throw Error();return t.l=e,t.h=n,!0}function fC(t){switch(t.h){case 0:t.h!=0?fC(t):eD(t.g);break;case 1:Cp(t=t.g,t.g+8);break;case 2:if(t.h!=2)fC(t);else{var e=cd(t.g);Cp(t=t.g,t.g+e)}break;case 5:Cp(t=t.g,t.g+4);break;case 3:for(e=t.l;;){if(!Jue(t))throw Error();if(t.h==4){if(t.l!=e)throw Error();break}fC(t)}break;default:throw Error()}}function RS(t,e,n){const r=t.g.l;var i=cd(t.g);let s=(i=t.g.g+i)-r;if(s<=0&&(t.g.l=i,n(e,t,void 0,void 0,void 0),s=i-t.g.g),s)throw Error();return t.g.g=i,t.g.l=r,e}function tD(t){var e=cd(t.g),n=Gue(t=t.g,e);if(t=t.h,kze){var r,i=t;(r=u5)||(r=u5=new TextDecoder("utf-8",{fatal:!0})),e=n+e,i=n===0&&e===i.length?i:i.subarray(n,e);try{var s=r.decode(i)}catch(a){if(Xw===void 0){try{r.decode(new Uint8Array([128]))}catch{}try{r.decode(new Uint8Array([97])),Xw=!0}catch{Xw=!1}}throw!Xw&&(u5=void 0),a}}else{e=(s=n)+e,n=[];let a,c=null;for(;s<e;){var o=t[s++];o<128?n.push(o):o<224?s>=e?Gh():(a=t[s++],o<194||(192&a)!=128?(s--,Gh()):n.push((31&o)<<6|63&a)):o<240?s>=e-1?Gh():(a=t[s++],(192&a)!=128||o===224&&a<160||o===237&&a>=160||(192&(r=t[s++]))!=128?(s--,Gh()):n.push((15&o)<<12|(63&a)<<6|63&r)):o<=244?s>=e-2?Gh():(a=t[s++],(192&a)!=128||a-144+(o<<28)>>30!=0||(192&(r=t[s++]))!=128||(192&(i=t[s++]))!=128?(s--,Gh()):(o=(7&o)<<18|(63&a)<<12|(63&r)<<6|63&i,o-=65536,n.push(55296+(o>>10&1023),56320+(1023&o)))):Gh(),n.length>=8192&&(c=Lz(c,n),n.length=0)}s=Lz(c,n)}return s}function Xue(t){const e=cd(t.g);return zue(t.g,e)}function i4(t,e,n){var r=cd(t.g);for(r=t.g.g+r;t.g.g<r;)n.push(e(t.g))}var gWe=class{constructor(t,e,n,r){if(Yz.length){const i=Yz.pop();i.init(t,e,n,r),t=i}else t=new class{constructor(i,s,o,a){this.h=null,this.j=!1,this.g=this.l=this.m=0,this.init(i,s,o,a)}init(i,s,o,{Y:a=!1,ea:c=!1}={}){this.Y=a,this.ea=c,i&&(i=Z9(i,this.ea),this.h=i.buffer,this.j=i.g,this.m=s||0,this.l=o!==void 0?this.m+o:this.h.length,this.g=this.m)}clear(){this.h=null,this.j=!1,this.g=this.l=this.m=0,this.Y=!1}}(t,e,n,r);this.g=t,this.m=this.g.g,this.h=this.l=-1,this.o(r)}o({ha:t=!1}={}){this.ha=t}},J3=[];function Jz(t){return t?/^\d+$/.test(t)?(ZR(t),new yO(gr,Zr)):null:vWe||=new yO(0,0)}var yO=class{constructor(t,e){this.h=t>>>0,this.g=e>>>0}};let vWe;function Xz(t){return t?/^-?\d+$/.test(t)?(ZR(t),new bO(gr,Zr)):null:yWe||=new bO(0,0)}var bO=class{constructor(t,e){this.h=t>>>0,this.g=e>>>0}};let yWe;function pv(t,e,n){for(;n>0||e>127;)t.g.push(127&e|128),e=(e>>>7|n<<25)>>>0,n>>>=7;t.g.push(e)}function Fy(t,e){for(;e>127;)t.g.push(127&e|128),e>>>=7;t.g.push(e)}function s4(t,e){if(e>=0)Fy(t,e);else{for(let n=0;n<9;n++)t.g.push(127&e|128),e>>=7;t.g.push(1)}}function nD(t){var e=gr;t.g.push(e>>>0&255),t.g.push(e>>>8&255),t.g.push(e>>>16&255),t.g.push(e>>>24&255)}function Zv(t,e){e.length!==0&&(t.l.push(e),t.h+=e.length)}function ac(t,e,n){Fy(t.g,8*e+n)}function rD(t,e){return ac(t,e,2),e=t.g.end(),Zv(t,e),e.push(t.h),e}function iD(t,e){var n=e.pop();for(n=t.h+t.g.length()-n;n>127;)e.push(127&n|128),n>>>=7,t.h++;e.push(n),t.h++}function o4(t,e,n){ac(t,e,2),Fy(t.g,n.length),Zv(t,t.g.end()),Zv(t,n)}function X3(t,e,n,r){n!=null&&(e=rD(t,e),r(n,t),iD(t,e))}function ql(){const t=class{constructor(){throw Error()}};return Object.setPrototypeOf(t,t.prototype),t}var sD=ql(),Que=ql(),oD=ql(),aD=ql(),Zue=ql(),ede=ql(),bWe=ql(),a4=ql(),tde=ql(),nde=ql();function Vl(t,e,n){var r=t.v;ta&&ta in r&&(r=r[ta])&&delete r[e.g],e.h?e.j(t,e.h,e.g,n,e.l):e.j(t,e.g,n,e.l)}var Je=class{constructor(t,e){this.v=Uue(t,e,void 0,2048)}toJSON(){return Nue(this)}j(){var t=tYe,e=this.v,n=t.g,r=ta;if(Ly&&r&&e[r]?.[n]!=null&&zv(jze,3),e=t.g,jz&&ta&&jz===void 0&&(r=(n=this.v)[ta])&&(r=r.da))try{r(n,e,cWe)}catch(i){vue(i)}return t.h?t.m(this,t.h,t.g,t.l):t.m(this,t.g,t.defaultValue,t.l)}clone(){const t=this.v,e=0|t[Ye];return G9(this,t,e)?V9(this,t,!0):new this.constructor(Dy(t,e,!1))}};Je.prototype[Wv]=Yv,Je.prototype.toString=function(){return this.v.toString()};var $y=class{constructor(t,e,n){this.g=t,this.h=e,t=sD,this.l=!!t&&n===t||!1}};function c4(t,e){return new $y(t,e,sD)}function rde(t,e,n,r,i){X3(t,n,ade(e,r),i)}const _We=c4((function(t,e,n,r,i){return t.h===2&&(RS(t,X9(e,r,n),i),!0)}),rde),SWe=c4((function(t,e,n,r,i){return t.h===2&&(RS(t,X9(e,r,n),i),!0)}),rde);var l4=Symbol(),u4=Symbol(),_O=Symbol(),Qz=Symbol(),Zz=Symbol();let ide,sde;function vm(t,e,n,r){var i=r[t];if(i)return i;(i={}).qa=r,i.T=(function(h){switch(typeof h){case"boolean":return dWe||=[0,void 0,!0];case"number":return h>0?void 0:h===0?fWe||=[0,void 0]:[-h,void 0];case"string":return[0,h];case"object":return h}})(r[0]);var s=r[1];let o=1;s&&s.constructor===Object&&(i.ba=s,typeof(s=r[++o])=="function"&&(i.ma=!0,ide??=s,sde??=r[o+1],s=r[o+=2]));const a={};for(;s&&Array.isArray(s)&&s.length&&typeof s[0]=="number"&&s[0]>0;){for(var c=0;c<s.length;c++)a[s[c]]=s;s=r[++o]}for(c=1;s!==void 0;){let h;typeof s=="number"&&(c+=s,s=r[++o]);var l=void 0;if(s instanceof $y?h=s:(h=_We,o--),h?.l){s=r[++o],l=r;var d=o;typeof s=="function"&&(s=s(),l[d]=s),l=s}for(d=c+1,typeof(s=r[++o])=="number"&&s<0&&(d-=s,s=r[++o]);c<d;c++){const m=a[c];l?n(i,c,h,l,m):e(i,c,h,m)}}return r[t]=i}function ode(t){return Array.isArray(t)?t[0]instanceof $y?t:[SWe,t]:[t,void 0]}function ade(t,e){return t instanceof Je?t.v:Array.isArray(t)?Sp(t,e):void 0}function cD(t,e,n,r){const i=n.g;t[e]=r?(s,o,a)=>i(s,o,a,r):i}function lD(t,e,n,r,i){const s=n.g;let o,a;t[e]=(c,l,d)=>s(c,l,d,a||=vm(u4,cD,lD,r).T,o||=uD(r),i)}function uD(t){let e=t[_O];if(e!=null)return e;const n=vm(u4,cD,lD,t);return e=n.ma?(r,i)=>ide(r,i,n):(r,i)=>{for(;Jue(i)&&i.h!=4;){var s=i.l,o=n[s];if(o==null){var a=n.ba;a&&(a=a[s])&&(a=EWe(a))!=null&&(o=n[s]=a)}if(o==null||!o(i,r,s)){if(o=(a=i).m,fC(a),a.ha)var c=void 0;else c=a.g.g-o,a.g.g=o,c=zue(a.g,c);o=void 0,a=r,c&&((o=a[ta]??(a[ta]=new vO))[s]??(o[s]=[])).push(c)}}return(r=t4(r))&&(r.da=n.qa[Zz]),!0},t[_O]=e,t[Zz]=wWe.bind(t),e}function wWe(t,e,n,r){var i=this[u4];const s=this[_O],o=Sp(void 0,i.T),a=t4(t);if(a){var c=!1,l=i.ba;if(l){if(i=(d,h,m)=>{if(m.length!==0)if(l[h])for(const g of m){d=Wue(g);try{c=!0,s(o,d)}finally{Yue(d)}}else r?.(t,h,m)},e==null)z3(a,i);else if(a!=null){const d=a[e];d&&i(a,e,d)}if(c){let d=0|t[Ye];if(2&d&&2048&d&&!n?.Ka)throw Error();const h=Oy(d),m=(g,y)=>{if(sd(t,g,h)!=null){if(n?.Qa===1)return;throw Error()}y!=null&&(d=gi(t,d,g,y,h)),delete a[g]};e==null?Rue(o,0|o[Ye],((g,y)=>{m(g,y)})):m(e,sd(o,e,h))}}}}function EWe(t){const e=(t=ode(t))[0].g;if(t=t[1]){const n=uD(t),r=vm(u4,cD,lD,t).T;return(i,s,o)=>e(i,s,o,r,n)}return e}function d4(t,e,n){t[e]=n.h}function f4(t,e,n,r){let i,s;const o=n.h;t[e]=(a,c,l)=>o(a,c,l,s||=vm(l4,d4,f4,r).T,i||=cde(r))}function cde(t){let e=t[Qz];if(!e){const n=vm(l4,d4,f4,t);e=(r,i)=>lde(r,i,n),t[Qz]=e}return e}function lde(t,e,n){Rue(t,0|t[Ye],((r,i)=>{if(i!=null){var s=(function(o,a){var c=o[a];if(c)return c;if((c=o.ba)&&(c=c[a])){var l=(c=ode(c))[0].h;if(c=c[1]){const d=cde(c),h=vm(l4,d4,f4,c).T;c=o.ma?sde(h,d):(m,g,y)=>l(m,g,y,h,d)}else c=l;return o[a]=c}})(n,r);s?s(e,i,r):r<500||zv(pO,3)}})),(t=t4(t))&&z3(t,((r,i,s)=>{for(Zv(e,e.g.end()),r=0;r<s.length;r++)Zv(e,N9(s[r])||new Uint8Array(0))}))}const CWe=na(0);function By(t,e){if(Array.isArray(e)){var n=0|e[Ye];if(4&n)return e;for(var r=0,i=0;r<e.length;r++){const s=t(e[r]);s!=null&&(e[i++]=s)}return i<r&&(e.length=i),(t=-1537&(5|n))!==n&&bi(e,t),2&t&&Object.freeze(e),e}}function Gs(t,e,n){return new $y(t,e,n)}function Hy(t,e,n){return new $y(t,e,n)}function Bi(t,e,n){gi(t,0|t[Ye],e,n,Oy(0|t[Ye]))}var TWe=c4((function(t,e,n,r,i){if(t.h!==2)return!1;if(t=Uc(t=RS(t,Sp([void 0,void 0],r),i)),i=Oy(r=0|e[Ye]),2&r)throw Error();let s=sd(e,n,i);if(s instanceof id)(2&s.J)!=0?(s=s.V(),s.push(t),gi(e,r,n,s,i)):s.Ma(t);else if(Array.isArray(s)){var o=0|s[Ye];8192&o||bi(s,o|=8192),2&o&&(s=$ue(s),gi(e,r,n,s,i)),s.push(t)}else gi(e,r,n,C_([t]),i);return!0}),(function(t,e,n,r,i){if(e instanceof id)e.forEach(((s,o)=>{X3(t,n,Sp([o,s],r),i)}));else if(Array.isArray(e)){for(let s=0;s<e.length;s++){const o=e[s];Array.isArray(o)&&X3(t,n,Sp(o,r),i)}C_(e)}}));function ude(t,e,n){(e=_l(e))!=null&&(ac(t,n,5),t=t.g,j9(e),nD(t))}function dde(t,e,n){if(e=(function(r){if(r==null)return r;const i=typeof r;if(i==="bigint")return String(ES(64,r));if(CS(r)){if(i==="string")return Lue(r);if(i==="number")return H9(r)}})(e),e!=null&&(typeof e=="string"&&Xz(e),e!=null))switch(ac(t,n,0),typeof e){case"number":t=t.g,Jv(e),pv(t,gr,Zr);break;case"bigint":n=BigInt.asUintN(64,e),n=new bO(Number(n&BigInt(4294967295)),Number(n>>BigInt(32))),pv(t.g,n.h,n.g);break;default:n=Xz(e),pv(t.g,n.h,n.g)}}function fde(t,e,n){(e=Py(e))!=null&&e!=null&&(ac(t,n,0),s4(t.g,e))}function hde(t,e,n){(e=xue(e))!=null&&(ac(t,n,0),t.g.g.push(e?1:0))}function pde(t,e,n){(e=as(e))!=null&&o4(t,n,gue(e))}function mde(t,e,n,r,i){X3(t,n,ade(e,r),i)}function gde(t,e,n){(e=e==null||typeof e=="string"||e instanceof Rl?e:void 0)!=null&&o4(t,n,Z9(e,!0).buffer)}function vde(t,e,n){return(t.h===5||t.h===2)&&(e=jy(e,0|e[Ye],n),t.h==2?i4(t,Y3,e):e.push(Y3(t.g)),!0)}var ei=Gs((function(t,e,n){return t.h===5&&(Bi(e,n,Y3(t.g)),!0)}),ude,a4),RWe=Hy(vde,(function(t,e,n){if((e=By(_l,e))!=null)for(let o=0;o<e.length;o++){var r=t,i=n,s=e[o];s!=null&&(ac(r,i,5),r=r.g,j9(s),nD(r))}}),a4),dD=Hy(vde,(function(t,e,n){if((e=By(_l,e))!=null&&e.length){ac(t,n,2),Fy(t.g,4*e.length);for(let r=0;r<e.length;r++)n=t.g,j9(e[r]),nD(n)}}),a4),kWe=Gs((function(t,e,n){return t.h===5&&(Bi(e,n,(t=Y3(t.g))===0?void 0:t),!0)}),ude,a4),th=Gs((function(t,e,n){return O9?(t.h!==0?t=!1:(Bi(e,n,Qv(t.g,Iue)),t=!0),t):t.h===0&&(Bi(e,n,Qv(t.g,F9)),!0)}),dde,ede),p5=Gs((function(t,e,n){return O9?(t.h!==0?e=!1:(Bi(e,n,(t=Qv(t.g,Iue))===CWe?void 0:t),e=!0),e):t.h===0&&(Bi(e,n,(t=Qv(t.g,F9))===0?void 0:t),!0)}),dde,ede),IWe=Gs((function(t,e,n){return O9?(t.h!==0?t=!1:(Bi(e,n,Qv(t.g,Jze)),t=!0),t):t.h===0&&(Bi(e,n,Qv(t.g,gO)),!0)}),(function(t,e,n){if(e=(function(r){if(r==null)return r;var i=typeof r;if(i==="bigint")return String(Xze(64,r));if(CS(r)){if(i==="string")return i=Xv(Number(r)),Kp(i)&&i>=0?r=String(i):((i=r.indexOf("."))!==-1&&(r=r.substring(0,i)),(i=r[0]!=="-"&&((i=r.length)<20||i===20&&r<="18446744073709551615"))||(ZR(r),r=T_(gr,Zr))),r;if(i==="number")return(r=Xv(r))>=0&&Kp(r)||(Jv(r),r=gO(gr,Zr)),r}})(e),e!=null&&(typeof e=="string"&&Jz(e),e!=null))switch(ac(t,n,0),typeof e){case"number":t=t.g,Jv(e),pv(t,gr,Zr);break;case"bigint":n=BigInt.asUintN(64,e),n=new yO(Number(n&BigInt(4294967295)),Number(n>>BigInt(32))),pv(t.g,n.h,n.g);break;default:n=Jz(e),pv(t.g,n.h,n.g)}}),bWe),Ui=Gs((function(t,e,n){return t.h===0&&(Bi(e,n,eh(t.g)),!0)}),fde,aD),kS=Hy((function(t,e,n){return(t.h===0||t.h===2)&&(e=jy(e,0|e[Ye],n),t.h==2?i4(t,eh,e):e.push(eh(t.g)),!0)}),(function(t,e,n){if((e=By(Py,e))!=null&&e.length){n=rD(t,n);for(let r=0;r<e.length;r++)s4(t.g,e[r]);iD(t,n)}}),aD),Kg=Gs((function(t,e,n){return t.h===0&&(Bi(e,n,(t=eh(t.g))===0?void 0:t),!0)}),fde,aD),Br=Gs((function(t,e,n){return t.h===0&&(Bi(e,n,eD(t.g)),!0)}),hde,Que),Tp=Gs((function(t,e,n){return t.h===0&&(Bi(e,n,(t=eD(t.g))===!1?void 0:t),!0)}),hde,Que),ys=Hy((function(t,e,n){return t.h===2&&(t=tD(t),jy(e,0|e[Ye],n).push(t),!0)}),(function(t,e,n){if((e=By(as,e))!=null)for(let o=0;o<e.length;o++){var r=t,i=n,s=e[o];s!=null&&o4(r,i,gue(s))}}),oD),vf=Gs((function(t,e,n){return t.h===2&&(Bi(e,n,(t=tD(t))===""?void 0:t),!0)}),pde,oD),Hn=Gs((function(t,e,n){return t.h===2&&(Bi(e,n,tD(t)),!0)}),pde,oD),Li=(function(t,e,n=sD){return new $y(t,e,n)})((function(t,e,n,r,i){return t.h===2&&(r=Sp(void 0,r),jy(e,0|e[Ye],n).push(r),RS(t,r,i),!0)}),(function(t,e,n,r,i){if(Array.isArray(e)){for(let s=0;s<e.length;s++)mde(t,e[s],n,r,i);1&(t=0|e[Ye])||bi(e,1|t)}})),Dr=c4((function(t,e,n,r,i,s){if(t.h!==2)return!1;let o=0|e[Ye];return Bue(e,o,s,n,Oy(o)),RS(t,e=X9(e,r,n),i),!0}),mde),yde=Gs((function(t,e,n){return t.h===2&&(Bi(e,n,Xue(t)),!0)}),gde,tde),xWe=Hy((function(t,e,n){return(t.h===0||t.h===2)&&(e=jy(e,0|e[Ye],n),t.h==2?i4(t,cd,e):e.push(cd(t.g)),!0)}),(function(t,e,n){if((e=By(Aue,e))!=null)for(let o=0;o<e.length;o++){var r=t,i=n,s=e[o];s!=null&&(ac(r,i,0),Fy(r.g,s))}}),Zue),AWe=Gs((function(t,e,n){return t.h===0&&(Bi(e,n,(t=cd(t.g))===0?void 0:t),!0)}),(function(t,e,n){(e=Aue(e))!=null&&e!=null&&(ac(t,n,0),Fy(t.g,e))}),Zue),la=Gs((function(t,e,n){return t.h===0&&(Bi(e,n,eh(t.g)),!0)}),(function(t,e,n){(e=Py(e))!=null&&(e=parseInt(e,10),ac(t,n,0),s4(t.g,e))}),nde);class MWe{constructor(e,n){var r=fa;this.g=e,this.h=n,this.m=an,this.j=lt,this.defaultValue=void 0,this.l=r.Oa!=null?kue:void 0}register(){JR(this)}}function Kl(t,e){return new MWe(t,e)}function mh(t,e){return(n,r)=>{{const s={ea:!0};r&&Object.assign(s,r),n=Wue(n,void 0,void 0,s);try{const o=new t,a=o.v;uD(e)(a,n);var i=o}finally{Yue(n)}}return i}}function h4(t){return function(){const e=new class{constructor(){this.l=[],this.h=0,this.g=new class{constructor(){this.g=[]}length(){return this.g.length}end(){const o=this.g;return this.g=[],o}}}};lde(this.v,e,vm(l4,d4,f4,t)),Zv(e,e.g.end());const n=new Uint8Array(e.h),r=e.l,i=r.length;let s=0;for(let o=0;o<i;o++){const a=r[o];n.set(a,s),s+=a.length}return e.l=[n],n}}var eW=class extends Je{constructor(t){super(t)}},tW=[0,vf,Gs((function(t,e,n){return t.h===2&&(Bi(e,n,(t=Xue(t))===qp()?void 0:t),!0)}),(function(t,e,n){if(e!=null){if(e instanceof Je){const r=e.Ra;return void(r?(e=r(e),e!=null&&o4(t,n,Z9(e,!0).buffer)):zv(pO,3))}if(Array.isArray(e))return void zv(pO,3)}gde(t,e,n)}),tde)];let m5,nW=globalThis.trustedTypes;function rW(t){var e;return m5===void 0&&(m5=(function(){let n=null;if(!nW)return n;try{const r=i=>i;n=nW.createPolicy("goog#html",{createHTML:r,createScript:r,createScriptURL:r})}catch{}return n})()),t=(e=m5)?e.createScriptURL(t):t,new class{constructor(n){this.g=n}toString(){return this.g+""}}(t)}function LWe(t,...e){if(e.length===0)return rW(t[0]);let n=t[0];for(let r=0;r<e.length;r++)n+=encodeURIComponent(e[r])+t[r+1];return rW(n)}var bde=[0,Ui,la,Br,-1,kS,la,-1,Br],OWe=class extends Je{constructor(e){super(e)}},_de=[0,Br,Hn,Br,la,-1,Hy((function(t,e,n){return(t.h===0||t.h===2)&&(e=jy(e,0|e[Ye],n),t.h==2?i4(t,mWe,e):e.push(eh(t.g)),!0)}),(function(t,e,n){if((e=By(Py,e))!=null&&e.length){n=rD(t,n);for(let r=0;r<e.length;r++)s4(t.g,e[r]);iD(t,n)}}),nde),Hn,-1,[0,Br,-1],la,Br,-1],Sde=[0,3,Br,-1,2,[0,Ui],[0,la,Br],[0,Hn,-1],[0]],wde=[0,Hn,-2],iW=class extends Je{constructor(e){super(e)}},Ede=[0],Cde=[0,Ui,Br,1,Br,-4],fa=class extends Je{constructor(t){super(t,2)}},vi={};vi[336783863]=[0,Hn,Br,-1,Ui,[0,[1,2,3,4,5,6,7,8,9],Dr,Ede,Dr,_de,Dr,wde,Dr,Cde,Dr,bde,Dr,[0,Hn,-2],Dr,[0,Hn,la],Dr,Sde,Dr,[0,la,-1,Br]],[0,Hn],Br,[0,[1,3],[2,4],Dr,[0,kS],-1,Dr,[0,ys],-1,Li,[0,Hn,-1]],Hn];var sW=[0,p5,-1,Tp,-3,p5,kS,vf,Kg,p5,-1,Tp,Kg,Tp,-2,vf];function ur(t,e){r4(t,3,e)}function Wt(t,e){r4(t,4,e)}var Ro=class extends Je{constructor(t){super(t,500)}o(t){return lt(this,0,7,t)}},bb=[-1,{}],oW=[0,Hn,1,bb],aW=[0,Hn,ys,bb];function cc(t,e){Q9(t,1,Ro,e)}function br(t,e){r4(t,10,e)}function hn(t,e){r4(t,15,e)}var ha=class extends Je{constructor(t){super(t,500)}o(t){return lt(this,0,1001,t)}},Tde=[-500,Li,[-500,vf,-1,ys,-3,[-2,vi,Br],Li,tW,Kg,-1,oW,aW,Li,[0,vf,Tp],vf,sW,Kg,ys,987,ys],4,Li,[-500,Hn,-1,[-1,{}],998,Hn],Li,[-500,Hn,ys,-1,[-2,{},Br],997,ys,-1],Kg,Li,[-500,Hn,ys,bb,998,ys],ys,Kg,oW,aW,Li,[0,vf,-1,bb],ys,-2,sW,vf,-1,Tp,[0,Tp,AWe],978,bb,Li,tW];ha.prototype.g=h4(Tde);var PWe=mh(ha,Tde),DWe=class extends Je{constructor(t){super(t)}},Rde=class extends Je{constructor(e){super(e)}g(){return od(this,DWe,1)}},kde=[0,Li,[0,Ui,ei,Hn,-1]],p4=mh(Rde,kde),NWe=class extends Je{constructor(t){super(t)}},UWe=class extends Je{constructor(t){super(t)}},g5=class extends Je{constructor(t){super(t)}l(){return an(this,NWe,2)}g(){return od(this,UWe,5)}},Ide=mh(class extends Je{constructor(t){super(t)}},[0,ys,kS,dD,[0,la,[0,Ui,-3],[0,ei,-3],[0,Ui,-1,[0,Li,[0,Ui,-2]]],Li,[0,ei,-1,Hn,ei]],Hn,-1,th,Li,[0,Ui,ei],ys,th]),xde=class extends Je{constructor(t){super(t)}},mv=mh(class extends Je{constructor(t){super(t)}},[0,Li,[0,ei,-4]]),Ade=class extends Je{constructor(t){super(t)}},IS=mh(class extends Je{constructor(t){super(t)}},[0,Li,[0,ei,-4]]),jWe=class extends Je{constructor(t){super(t)}},FWe=[0,Ui,-1,dD,la],Mde=class extends Je{constructor(t){super(t)}};Mde.prototype.g=h4([0,ei,-4,th]);var $We=class extends Je{constructor(t){super(t)}},BWe=mh(class extends Je{constructor(t){super(t)}},[0,Li,[0,1,Ui,Hn,kde],th]),cW=class extends Je{constructor(t){super(t)}},HWe=class extends Je{constructor(t){super(t)}na(){const t=lr(this,1,void 0,void 0,Fue);return t??qp()}},qWe=class extends Je{constructor(t){super(t)}},Lde=[1,2],VWe=mh(class extends Je{constructor(t){super(t)}},[0,Li,[0,Lde,Dr,[0,dD],Dr,[0,yde],Ui,Hn],th]),fD=class extends Je{constructor(t){super(t)}},Ode=[0,Hn,Ui,ei,ys,-1],lW=class extends Je{constructor(t){super(t)}},KWe=[0,Br,-1],uW=class extends Je{constructor(t){super(t)}},hC=[1,2,3,4,5,6],Q3=class extends Je{constructor(t){super(t)}g(){return lr(this,1,void 0,void 0,Fue)!=null}l(){return as(lr(this,2))!=null}},Ar=class extends Je{constructor(t){super(t)}g(){return xue(lr(this,2))??!1}},Pde=[0,yde,Hn,[0,Ui,th,-1],[0,IWe,th]],ni=[0,Pde,Br,[0,hC,Dr,Cde,Dr,_de,Dr,bde,Dr,Ede,Dr,wde,Dr,Sde],la],m4=class extends Je{constructor(t){super(t)}},hD=[0,ni,ei,-1,Ui],GWe=Kl(502141897,m4);vi[502141897]=hD;var zWe=mh(class extends Je{constructor(t){super(t)}},[0,[0,la,-1,RWe,xWe],FWe]),Dde=class extends Je{constructor(e){super(e)}},Nde=class extends Je{constructor(t){super(t)}},SO=[0,ni,ei,[0,ni],Br],WWe=Kl(508968150,Nde);vi[508968150]=[0,ni,hD,SO,ei,[0,[0,Pde]]],vi[508968149]=SO;var Eg=class extends Je{constructor(t){super(t)}l(){return an(this,fD,2)}g(){xn(this,2)}},Ude=[0,ni,Ode];vi[478825465]=Ude;var YWe=class extends Je{constructor(t){super(t)}},jde=class extends Je{constructor(e){super(e)}},pD=class extends Je{constructor(t){super(t)}},mD=class extends Je{constructor(e){super(e)}},Fde=class extends Je{constructor(e){super(e)}},dW=[0,ni,[0,ni],Ude,-1],$de=[0,ni,ei,Ui],gD=[0,ni,ei],Bde=[0,ni,$de,gD,ei],JWe=Kl(479097054,Fde);vi[479097054]=[0,ni,Bde,dW],vi[463370452]=dW,vi[464864288]=$de;var XWe=Kl(462713202,mD);vi[462713202]=Bde,vi[474472470]=gD;var QWe=class extends Je{constructor(t){super(t)}},Hde=class extends Je{constructor(t){super(t)}},qde=class extends Je{constructor(t){super(t)}},Vde=class extends Je{constructor(t){super(t)}},vD=[0,ni,ei,-1,Ui],wO=[0,ni,ei,Br];Vde.prototype.g=h4([0,ni,gD,[0,ni],hD,SO,vD,wO]);var Kde=class extends Je{constructor(t){super(t)}},ZWe=Kl(456383383,Kde);vi[456383383]=[0,ni,Ode];var Gde=class extends Je{constructor(t){super(t)}},eYe=Kl(476348187,Gde);vi[476348187]=[0,ni,KWe];var zde=class extends Je{constructor(t){super(t)}},fW=class extends Je{constructor(t){super(t)}},Wde=[0,la,-1],tYe=Kl(458105876,class extends Je{constructor(t){super(t)}g(){let t;var e=this.v;const n=0|e[Ye];return t=aa(this,n),e=(function(r,i,s,o){var a=fW;!o&&Ny(r)&&(s=0|(i=r.v)[Ye]);var c=sd(i,2);if(r=!1,c==null){if(o)return Gz();c=[]}else if(c.constructor===id){if(!(2&c.J)||o)return c;c=c.V()}else Array.isArray(c)?r=!!(2&(0|c[Ye])):c=[];if(o){if(!c.length)return Gz();r||(r=!0,wS(c))}else r&&(r=!1,C_(c),c=$ue(c));return!r&&32&s&&SS(c,32),s=gi(i,s,2,o=new id(c,a,tWe,void 0)),r||gm(i,s),o})(this,e,n,t),!t&&fW&&(e.ra=!0),e}});vi[458105876]=[0,Wde,TWe,[!0,th,[0,Hn,-1,ys]],[0,kS,Br,la]];var yD=class extends Je{constructor(t){super(t)}},Yde=Kl(458105758,yD);vi[458105758]=[0,ni,Hn,Wde];var v5=class extends Je{constructor(t){super(t)}},hW=[0,kWe,-1,Tp],nYe=class extends Je{constructor(t){super(t)}},Jde=class extends Je{constructor(t){super(t)}},EO=[1,2];Jde.prototype.g=h4([0,EO,Dr,hW,Dr,[0,Li,hW]]);var Xde=class extends Je{constructor(t){super(t)}},rYe=Kl(443442058,Xde);vi[443442058]=[0,ni,Hn,Ui,ei,ys,-1,Br,ei],vi[514774813]=vD;var Qde=class extends Je{constructor(t){super(t)}},iYe=Kl(516587230,Qde);function CO(t,e){return e=e?e.clone():new fD,t.displayNamesLocale!==void 0?xn(e,1,TS(t.displayNamesLocale)):t.displayNamesLocale===void 0&&xn(e,1),t.maxResults!==void 0?ad(e,2,t.maxResults):"maxResults"in t&&xn(e,2),t.scoreThreshold!==void 0?tt(e,3,t.scoreThreshold):"scoreThreshold"in t&&xn(e,3),t.categoryAllowlist!==void 0?W3(e,4,t.categoryAllowlist):"categoryAllowlist"in t&&xn(e,4),t.categoryDenylist!==void 0?W3(e,5,t.categoryDenylist):"categoryDenylist"in t&&xn(e,5),e}function Zde(t){const e=Number(t);return Number.isSafeInteger(e)?e:String(t)}function bD(t,e=-1,n=""){return{categories:t.map((r=>({index:za(r,1)??0??-1,score:Nr(r,2)??0,categoryName:as(lr(r,3))??""??"",displayName:as(lr(r,4))??""??""}))),headIndex:e,headName:n}}function sYe(t){const e={classifications:od(t,$We,1).map((n=>bD(an(n,Rde,4)?.g()??[],za(n,2)??0,as(lr(n,3))??"")))};return(function(n){return eWe(P9?lr(n,2,void 0,void 0,G3):lr(n,2))})(t)!=null&&(e.timestampMs=Zde(Kue(t))),e}function efe(t){var e=up(t,3,_l,lp()),n=up(t,2,Py,lp()),r=up(t,1,as,lp()),i=up(t,9,as,lp());const s={categories:[],keypoints:[]};for(let o=0;o<e.length;o++)s.categories.push({score:e[o],index:n[o]??-1,categoryName:r[o]??"",displayName:i[o]??""});if((e=an(t,g5,4)?.l())&&(s.boundingBox={originX:za(e,1,Wd)??0,originY:za(e,2,Wd)??0,width:za(e,3,Wd)??0,height:za(e,4,Wd)??0,angle:0}),an(t,g5,4)?.g().length)for(const o of an(t,g5,4).g())s.keypoints.push({x:lr(o,1,void 0,Wd,_l)??0,y:lr(o,2,void 0,Wd,_l)??0,score:lr(o,4,void 0,Wd,_l)??0,label:as(lr(o,3,void 0,Wd))??""});return s}function g4(t){const e=[];for(const n of od(t,Ade,1))e.push({x:Nr(n,1)??0,y:Nr(n,2)??0,z:Nr(n,3)??0,visibility:Nr(n,4)??0});return e}function _b(t){const e=[];for(const n of od(t,xde,1))e.push({x:Nr(n,1)??0,y:Nr(n,2)??0,z:Nr(n,3)??0,visibility:Nr(n,4)??0});return e}function pW(t){return Array.from(t,(e=>e>127?e-256:e))}function mW(t,e){if(t.length!==e.length)throw Error(`Cannot compute cosine similarity between embeddings of different sizes (${t.length} vs. ${e.length}).`);let n=0,r=0,i=0;for(let s=0;s<t.length;s++)n+=t[s]*e[s],r+=t[s]*t[s],i+=e[s]*e[s];if(r<=0||i<=0)throw Error("Cannot compute cosine similarity on embedding with 0 norm.");return n/Math.sqrt(r*i)}let Qw;vi[516587230]=[0,ni,vD,wO,ei],vi[518928384]=wO;const oYe=new Uint8Array([0,97,115,109,1,0,0,0,1,5,1,96,0,1,123,3,2,1,0,10,10,1,8,0,65,0,253,15,253,98,11]);async function tfe(){if(Qw===void 0)try{await WebAssembly.instantiate(oYe),Qw=!0}catch{Qw=!1}return Qw}async function y1(t,e=LWe``){const n=await tfe()?"wasm_internal":"wasm_nosimd_internal";return{wasmLoaderPath:`${e}/${t}_${n}.js`,wasmBinaryPath:`${e}/${t}_${n}.wasm`}}var np=class{};function nfe(){var t=navigator;return typeof OffscreenCanvas<"u"&&(!(function(e=navigator){return(e=e.userAgent).includes("Safari")&&!e.includes("Chrome")})(t)||!!((t=t.userAgent.match(/Version\/([\d]+).*Safari/))&&t.length>=1&&Number(t[1])>=17))}async function gW(t){if(typeof importScripts!="function"){const e=document.createElement("script");return e.src=t.toString(),e.crossOrigin="anonymous",new Promise(((n,r)=>{e.addEventListener("load",(()=>{n()}),!1),e.addEventListener("error",(i=>{r(i)}),!1),document.body.appendChild(e)}))}try{importScripts(t.toString())}catch(e){if(!(e instanceof TypeError))throw e;await self.import(t.toString())}}function rfe(t){return t.videoWidth!==void 0?[t.videoWidth,t.videoHeight]:t.naturalWidth!==void 0?[t.naturalWidth,t.naturalHeight]:t.displayWidth!==void 0?[t.displayWidth,t.displayHeight]:[t.width,t.height]}function Xe(t,e,n){t.m||console.error("No wasm multistream support detected: ensure dependency inclusion of :gl_graph_runner_internal_multi_input target"),n(e=t.i.stringToNewUTF8(e)),t.i._free(e)}function vW(t,e,n){if(!t.i.canvas)throw Error("No OpenGL canvas configured.");if(n?t.i._bindTextureToStream(n):t.i._bindTextureToCanvas(),!(n=t.i.canvas.getContext("webgl2")||t.i.canvas.getContext("webgl")))throw Error("Failed to obtain WebGL context from the provided canvas. `getContext()` should only be invoked with `webgl` or `webgl2`.");t.i.gpuOriginForWebTexturesIsBottomLeft&&n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL,!0),n.texImage2D(n.TEXTURE_2D,0,n.RGBA,n.RGBA,n.UNSIGNED_BYTE,e),t.i.gpuOriginForWebTexturesIsBottomLeft&&n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL,!1);const[r,i]=rfe(e);return!t.l||r===t.i.canvas.width&&i===t.i.canvas.height||(t.i.canvas.width=r,t.i.canvas.height=i),[r,i]}function yW(t,e,n){t.m||console.error("No wasm multistream support detected: ensure dependency inclusion of :gl_graph_runner_internal_multi_input target");const r=new Uint32Array(e.length);for(let i=0;i<e.length;i++)r[i]=t.i.stringToNewUTF8(e[i]);e=t.i._malloc(4*r.length),t.i.HEAPU32.set(r,e>>2),n(e);for(const i of r)t.i._free(i);t.i._free(e)}function el(t,e,n){t.i.simpleListeners=t.i.simpleListeners||{},t.i.simpleListeners[e]=n}function Yd(t,e,n){let r=[];t.i.simpleListeners=t.i.simpleListeners||{},t.i.simpleListeners[e]=(i,s,o)=>{s?(n(r,o),r=[]):r.push(i)}}np.forVisionTasks=function(t){return y1("vision",t)},np.forTextTasks=function(t){return y1("text",t)},np.forGenAiExperimentalTasks=function(t){return y1("genai_experimental",t)},np.forGenAiTasks=function(t){return y1("genai",t)},np.forAudioTasks=function(t){return y1("audio",t)},np.isSimdSupported=function(){return tfe()};async function aYe(t,e,n,r){return t=await(async(i,s,o,a,c)=>{if(s&&await gW(s),!self.ModuleFactory||o&&(await gW(o),!self.ModuleFactory))throw Error("ModuleFactory not set.");return self.Module&&c&&((s=self.Module).locateFile=c.locateFile,c.mainScriptUrlOrBlob&&(s.mainScriptUrlOrBlob=c.mainScriptUrlOrBlob)),c=await self.ModuleFactory(self.Module||c),self.ModuleFactory=self.Module=void 0,new i(c,a)})(t,n.wasmLoaderPath,n.assetLoaderPath,e,{locateFile:i=>i.endsWith(".wasm")?n.wasmBinaryPath.toString():n.assetBinaryPath&&i.endsWith(".data")?n.assetBinaryPath.toString():i}),await t.o(r),t}function y5(t,e){const n=an(t.baseOptions,Q3,1)||new Q3;typeof e=="string"?(xn(n,2,TS(e)),xn(n,1)):e instanceof Uint8Array&&(xn(n,1,U9(e,!1)),xn(n,2)),lt(t.baseOptions,0,1,n)}function bW(t){try{const e=t.H.length;if(e===1)throw Error(t.H[0].message);if(e>1)throw Error("Encountered multiple errors: "+t.H.map((n=>n.message)).join(", "))}finally{t.H=[]}}function qe(t,e){t.C=Math.max(t.C,e)}function v4(t,e){t.B=new Ro,ca(t.B,2,"PassThroughCalculator"),ur(t.B,"free_memory"),Wt(t.B,"free_memory_unused_out"),br(e,"free_memory"),cc(e,t.B)}function ey(t,e){ur(t.B,e),Wt(t.B,e+"_unused_out")}function y4(t){t.g.addBoolToStream(!0,"free_memory",t.C)}var TO=class{constructor(t){this.g=t,this.H=[],this.C=0,this.g.setAutoRenderToScreen(!1)}l(t,e=!0){if(e){const n=t.baseOptions||{};if(t.baseOptions?.modelAssetBuffer&&t.baseOptions?.modelAssetPath)throw Error("Cannot set both baseOptions.modelAssetPath and baseOptions.modelAssetBuffer");if(!(an(this.baseOptions,Q3,1)?.g()||an(this.baseOptions,Q3,1)?.l()||t.baseOptions?.modelAssetBuffer||t.baseOptions?.modelAssetPath))throw Error("Either baseOptions.modelAssetPath or baseOptions.modelAssetBuffer must be set");if((function(r,i){let s=an(r.baseOptions,uW,3);if(!s){var o=s=new uW,a=new iW;yb(o,4,hC,a)}"delegate"in i&&(i.delegate==="GPU"?(i=s,o=new OWe,yb(i,2,hC,o)):(i=s,o=new iW,yb(i,4,hC,o))),lt(r.baseOptions,0,3,s)})(this,n),n.modelAssetPath)return fetch(n.modelAssetPath.toString()).then((r=>{if(r.ok)return r.arrayBuffer();throw Error(`Failed to fetch model: ${n.modelAssetPath} (${r.status})`)})).then((r=>{try{this.g.i.FS_unlink("/model.dat")}catch{}this.g.i.FS_createDataFile("/","model.dat",new Uint8Array(r),!0,!1,!1),y5(this,"/model.dat"),this.m(),this.L()}));if(n.modelAssetBuffer instanceof Uint8Array)y5(this,n.modelAssetBuffer);else if(n.modelAssetBuffer)return(async function(r){const i=[];for(var s=0;;){const{done:o,value:a}=await r.read();if(o)break;i.push(a),s+=a.length}if(i.length===0)return new Uint8Array(0);if(i.length===1)return i[0];r=new Uint8Array(s),s=0;for(const o of i)r.set(o,s),s+=o.length;return r})(n.modelAssetBuffer).then((r=>{y5(this,r),this.m(),this.L()}))}return this.m(),this.L(),Promise.resolve()}L(){}ca(){let t;if(this.g.ca((e=>{t=PWe(e)})),!t)throw Error("Failed to retrieve CalculatorGraphConfig");return t}setGraph(t,e){this.g.attachErrorListener(((n,r)=>{this.H.push(Error(r))})),this.g.Ja(),this.g.setGraph(t,e),this.B=void 0,bW(this)}finishProcessing(){this.g.finishProcessing(),bW(this)}close(){this.B=void 0,this.g.closeGraph()}};function Uf(t,e){if(!t)throw Error(`Unable to obtain required WebGL resource: ${e}`);return t}TO.prototype.close=TO.prototype.close;class cYe{constructor(e,n,r,i){this.g=e,this.h=n,this.m=r,this.l=i}bind(){this.g.bindVertexArray(this.h)}close(){this.g.deleteVertexArray(this.h),this.g.deleteBuffer(this.m),this.g.deleteBuffer(this.l)}}function _W(t,e,n){const r=t.g;if(n=Uf(r.createShader(n),"Failed to create WebGL shader"),r.shaderSource(n,e),r.compileShader(n),!r.getShaderParameter(n,r.COMPILE_STATUS))throw Error(`Could not compile WebGL shader: ${r.getShaderInfoLog(n)}`);return r.attachShader(t.h,n),n}function SW(t,e){const n=t.g,r=Uf(n.createVertexArray(),"Failed to create vertex array");n.bindVertexArray(r);const i=Uf(n.createBuffer(),"Failed to create buffer");n.bindBuffer(n.ARRAY_BUFFER,i),n.enableVertexAttribArray(t.O),n.vertexAttribPointer(t.O,2,n.FLOAT,!1,0,0),n.bufferData(n.ARRAY_BUFFER,new Float32Array([-1,-1,-1,1,1,1,1,-1]),n.STATIC_DRAW);const s=Uf(n.createBuffer(),"Failed to create buffer");return n.bindBuffer(n.ARRAY_BUFFER,s),n.enableVertexAttribArray(t.L),n.vertexAttribPointer(t.L,2,n.FLOAT,!1,0,0),n.bufferData(n.ARRAY_BUFFER,new Float32Array(e?[0,1,0,0,1,0,1,1]:[0,0,0,1,1,1,1,0]),n.STATIC_DRAW),n.bindBuffer(n.ARRAY_BUFFER,null),n.bindVertexArray(null),new cYe(n,r,i,s)}function _D(t,e){if(t.g){if(e!==t.g)throw Error("Cannot change GL context once initialized")}else t.g=e}function lYe(t,e,n,r){return _D(t,e),t.h||(t.m(),t.D()),n?(t.u||(t.u=SW(t,!0)),n=t.u):(t.A||(t.A=SW(t,!1)),n=t.A),e.useProgram(t.h),n.bind(),t.l(),t=r(),n.g.bindVertexArray(null),t}function ife(t,e,n){return _D(t,e),t=Uf(e.createTexture(),"Failed to create texture"),e.bindTexture(e.TEXTURE_2D,t),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,n??e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,n??e.LINEAR),e.bindTexture(e.TEXTURE_2D,null),t}function sfe(t,e,n){_D(t,e),t.B||(t.B=Uf(e.createFramebuffer(),"Failed to create framebuffe.")),e.bindFramebuffer(e.FRAMEBUFFER,t.B),e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,n,0)}function uYe(t){t.g?.bindFramebuffer(t.g.FRAMEBUFFER,null)}var ofe=class{H(){return`
158
158
  precision mediump float;
159
159
  varying vec2 vTex;
160
160
  uniform sampler2D inputTexture;
@@ -282,7 +282,7 @@ void main() {
282
282
  void main() {
283
283
  gl_FragColor = texture2D(u_texture, v_uv);
284
284
  }
285
- `,a=nh(t,t.VERTEX_SHADER,s),c=nh(t,t.FRAGMENT_SHADER,o),l=b4(t,a,c),d={texture:t.getUniformLocation(l,"u_texture"),position:t.getAttribLocation(l,"position")};return{framebuffer:i,texture:r,program:l,uniforms:d}}function kYe(t,e,n,r,i,s){return t.useProgram(n.program),t.bindFramebuffer(t.FRAMEBUFFER,n.framebuffer),t.viewport(0,0,i,s),t.bindBuffer(t.ARRAY_BUFFER,r),t.enableVertexAttribArray(n.uniforms.position),t.vertexAttribPointer(n.uniforms.position,2,t.FLOAT,!1,0,0),t.activeTexture(t.TEXTURE0),t.bindTexture(t.TEXTURE_2D,e),t.uniform1i(n.uniforms.texture,0),t.drawArrays(t.TRIANGLES,0,6),t.bindFramebuffer(t.FRAMEBUFFER,null),n.texture}var UW=qy("livekit-track-processor-web-gl"),jW=t=>{const e=t.getContext("webgl2",{antialias:!0,premultipliedAlpha:!0});let n=null,r=8;const i=4;if(!e){UW.error("Failed to create WebGL context");return}e.enable(e.BLEND),e.blendFunc(e.SRC_ALPHA,e.ONE_MINUS_SRC_ALPHA);const s=TYe(e),o=s.program,a=s.attribLocations.position,{mask:c,frame:l,background:d,disableBackground:h}=s.uniformLocations,m=SYe(e),g=m.program,y=m.uniforms,v=EYe(e),E=v.program,w=v.uniforms,k=zh(e,0),x=zh(e,1),C=vYe(e);if(!C)throw new Error("Failed to create vertex buffer");let R=[],T=[],M=[],O=0,P=1;R.push(zh(e,3)),R.push(zh(e,4));const D=Math.floor(t.width/i),j=Math.floor(t.height/i),$=RYe(e,D,j);T.push(b1(e,R[0],D,j)),T.push(b1(e,R[1],D,j));const q=zh(e,5),Y=b1(e,q,t.width,t.height);M.push(zh(e,6)),M.push(zh(e,7));const W=[b1(e,M[0],t.width,t.height),b1(e,M[1],t.width,t.height)];let H=!1;e.useProgram(o),e.uniform1i(h,H?1:0),e.uniform1i(d,0),e.uniform1i(l,1),e.uniform1i(c,2);let F=null;function V(de){if(de.codedWidth===0||M.length===0)return;const Te=de.displayWidth,we=de.displayHeight;e.activeTexture(e.TEXTURE1),e.bindTexture(e.TEXTURE_2D,x),e.texImage2D(e.TEXTURE_2D,0,e.RGBA,e.RGBA,e.UNSIGNED_BYTE,de);let ae=k;if(n){const ke=kYe(e,x,$,C,D,j);ae=NW(e,ke,D,j,n,g,y,C,T,R)}else F&&(e.activeTexture(e.TEXTURE0),e.bindTexture(e.TEXTURE_2D,k),e.texImage2D(e.TEXTURE_2D,0,e.RGBA,e.RGBA,e.UNSIGNED_BYTE,F),ae=k);e.viewport(0,0,Te,we),e.clearColor(1,1,1,1),e.clear(e.COLOR_BUFFER_BIT),e.useProgram(o),e.bindBuffer(e.ARRAY_BUFFER,C),e.vertexAttribPointer(a,2,e.FLOAT,!1,0,0),e.enableVertexAttribArray(a),e.activeTexture(e.TEXTURE0),e.bindTexture(e.TEXTURE_2D,ae),e.uniform1i(d,0),e.uniform1i(h,H?1:0),e.activeTexture(e.TEXTURE1),e.bindTexture(e.TEXTURE_2D,x),e.uniform1i(l,1),e.activeTexture(e.TEXTURE2),e.bindTexture(e.TEXTURE_2D,M[O]),e.uniform1i(c,2),e.drawArrays(e.TRIANGLES,0,6)}async function G(de){if(F=null,de){F=bYe();try{F=await yYe(de,t.width,t.height)}catch(Te){UW.error("Error processing background image, falling back to black background:",Te)}e.activeTexture(e.TEXTURE0),e.bindTexture(e.TEXTURE_2D,k),e.texImage2D(e.TEXTURE_2D,0,e.RGBA,e.RGBA,e.UNSIGNED_BYTE,F)}}function ee(de){n=de?Math.max(1,Math.floor(de/i)):null,G(null)}function K(de){H=de}function Q(de){const Te=[Y,W[P]],we=[q,M[P]];NW(e,de,t.width,t.height,r,E,w,C,Te,we),O=P,P=1-P}function fe(){e.deleteProgram(o),e.deleteProgram(g),e.deleteProgram(E),e.deleteTexture(k),e.deleteTexture(x),e.deleteTexture(q),e.deleteFramebuffer(Y);for(const de of R)e.deleteTexture(de);for(const de of T)e.deleteFramebuffer(de);for(const de of M)e.deleteTexture(de);for(const de of W)e.deleteFramebuffer(de);e.deleteBuffer(C),$&&(e.deleteTexture($.texture),e.deleteFramebuffer($.framebuffer),e.deleteProgram($.program)),F&&(F instanceof ImageBitmap&&F.close(),F=null),R=[],T=[],M=[]}return{renderFrame:V,updateMask:Q,setBackgroundImage:G,setBlurRadius:ee,setBackgroundDisabled:K,cleanup:fe}},_fe=class{constructor(){this.isDisabled=!1}async init({outputCanvas:t,inputElement:e}){if(!(e instanceof HTMLVideoElement))throw TypeError("Video transformer needs a HTMLVideoElement as input");this.transformer=new TransformStream({transform:(n,r)=>this.transform(n,r)}),this.canvas=t||null,t&&(this.gl=jW(this.canvas||Z3(e.videoWidth,e.videoHeight))),this.inputVideo=e,this.isDisabled=!1}async restart({outputCanvas:t,inputElement:e}){var n;this.canvas=t||null,(n=this.gl)==null||n.cleanup(),this.gl=jW(this.canvas||Z3(e.videoWidth,e.videoHeight)),this.inputVideo=e,this.isDisabled=!1}async destroy(){var t;this.isDisabled=!0,this.canvas=void 0,(t=this.gl)==null||t.cleanup(),this.gl=void 0}},Sfe=class extends _fe{constructor(t){super(),this.backgroundImageAndPath=null,this.segmentationTimeMs=0,this.isFirstFrame=!0,this.log=qy("livekit-processor-wrapper"),this.options=t,this.update(t)}static get isSupported(){return typeof OffscreenCanvas<"u"&&typeof VideoFrame<"u"&&typeof createImageBitmap<"u"&&!!document.createElement("canvas").getContext("webgl2")}async init({outputCanvas:t,inputElement:e}){var n,r,i,s,o,a,c,l;await super.init({outputCanvas:t,inputElement:e});const d=await np.forVisionTasks((r=(n=this.options.assetPaths)==null?void 0:n.tasksVisionFileSet)!=null?r:`https://cdn.jsdelivr.net/npm/@mediapipe/tasks-vision@${gYe["@mediapipe/tasks-vision"]}/wasm`);this.imageSegmenter=await gs.createFromOptions(d,{baseOptions:{modelAssetPath:(s=(i=this.options.assetPaths)==null?void 0:i.modelAssetPath)!=null?s:"https://storage.googleapis.com/mediapipe-models/image_segmenter/selfie_segmenter/float16/latest/selfie_segmenter.tflite",delegate:"GPU",...this.options.segmenterOptions},canvas:this.canvas,runningMode:"VIDEO",outputCategoryMask:!0,outputConfidenceMasks:!1}),(o=this.options)!=null&&o.imagePath&&await this.loadAndSetBackground(this.options.imagePath).catch(h=>this.log.error("Error while loading processor background image: ",h)),typeof this.options.blurRadius=="number"&&((a=this.gl)==null||a.setBlurRadius(this.options.blurRadius)),(l=this.gl)==null||l.setBackgroundDisabled((c=this.options.backgroundDisabled)!=null?c:!1)}async destroy(t){var e;await super.destroy(),await((e=this.imageSegmenter)==null?void 0:e.close()),this.backgroundImageAndPath=null,t?.willProcessorRestart||(this.isFirstFrame=!0)}async loadAndSetBackground(t){var e,n;if(!this.backgroundImageAndPath||((e=this.backgroundImageAndPath)==null?void 0:e.path)!==t){const r=new Image;await new Promise((s,o)=>{r.crossOrigin="Anonymous",r.onload=()=>s(r),r.onerror=a=>o(a),r.src=t});const i=await createImageBitmap(r);this.backgroundImageAndPath={imageData:i,path:t}}(n=this.gl)==null||n.setBackgroundImage(this.backgroundImageAndPath.imageData)}async transform(t,e){var n,r,i,s;let o=!1;try{if(!(t instanceof VideoFrame)||t.codedWidth===0||t.codedHeight===0){this.log.debug("empty frame detected, ignoring");return}let a=(r=(n=this.isDisabled)!=null?n:this.options.backgroundDisabled)!=null?r:!1;if(typeof this.options.blurRadius!="number"&&typeof this.options.imagePath!="string"&&(a=!0),a){e.enqueue(t),o=!0;return}const c=Date.now();if(!this.canvas)throw TypeError("Canvas needs to be initialized first");this.canvas.width=t.displayWidth,this.canvas.height=t.displayHeight,this.isFirstFrame&&(e.enqueue(t.clone()),this.inputVideo&&await new Promise(h=>{this.inputVideo.requestVideoFrameCallback((m,g)=>{const y=g.expectedDisplayTime-g.presentationTime;setTimeout(h,y)})})),this.isFirstFrame=!1;const l=performance.now(),d=new Promise((h,m)=>{var g;try{let y=performance.now();(g=this.imageSegmenter)==null||g.segmentForVideo(t,y,v=>{this.segmentationTimeMs=performance.now()-y,this.segmentationResults=v,this.updateMask(v.categoryMask),v.close(),h()})}catch(y){m(y)}});if(this.drawFrame(t),this.canvas&&this.canvas.width>0&&this.canvas.height>0){const h=new VideoFrame(this.canvas,{timestamp:t.timestamp||c});e.enqueue(h);const m=performance.now()-l,g={processingTimeMs:this.segmentationTimeMs+m,segmentationTimeMs:this.segmentationTimeMs,filterTimeMs:m};(s=(i=this.options).onFrameProcessed)==null||s.call(i,g)}else e.enqueue(t);await d}catch(a){this.log.error("Error while processing frame: ",a)}finally{o||t.close()}}async update(t){var e,n,r,i,s;this.options={...this.options,...t},(n=this.gl)==null||n.setBlurRadius((e=t.blurRadius)!=null?e:null),t.imagePath?await this.loadAndSetBackground(t.imagePath):(r=this.gl)==null||r.setBackgroundImage(null),(s=this.gl)==null||s.setBackgroundDisabled((i=t.backgroundDisabled)!=null?i:!1)}async drawFrame(t){var e;this.gl&&((e=this.gl)==null||e.renderFrame(t))}async updateMask(t){var e;t&&((e=this.gl)==null||e.updateMask(t.getAsWebGLTexture()))}},IYe=()=>Sfe.isSupported&&vfe.isSupported;const xYe=""+new URL("selfie_segmenter-DF05sdL4.tflite",import.meta.url).href,AYe={wasmLoaderPath:new URL(""+new URL("vision_wasm_internal-B105rqk5.js",import.meta.url).href,import.meta.url).href,wasmBinaryPath:new URL(""+new URL("vision_wasm_internal-cvmXinav.wasm",import.meta.url).href,import.meta.url).href};class MYe extends Sfe{async init({outputCanvas:e,inputElement:n}){await _fe.prototype.init.call(this,{outputCanvas:e,inputElement:n}),this.imageSegmenter=await gs.createFromOptions(AYe,{baseOptions:{modelAssetPath:xYe,delegate:"GPU",...this.options.segmenterOptions},canvas:this.canvas,runningMode:"VIDEO",outputCategoryMask:!0,outputConfidenceMasks:!1}),this.options.blurRadius&&this.gl?.setBlurRadius(this.options.blurRadius)}}const MD=_.createContext(void 0);function LD(){const t=_.use(MD);if(t===void 0)throw new Error("useTrackProcessor must be used within a ProcessorProvider");return t}function LYe(){const t=_.use(MD);if(t===void 0)throw new Error("useTrackProcessor must be used within a ProcessorProvider");return Qle(n=>n.pipe(ge(([r])=>r)),[t])}const OYe=(t,e,n)=>{mt([e,n]).pipe(t.bind()).subscribe(([r,i])=>{if(!i||!r)return;const{processor:s}=i;s&&!r.getProcessor()&&r.setProcessor(s),!s&&r.getProcessor()&&r.stopProcessor()})},PYe=t=>{const{processor:e}=LD();_.useEffect(()=>{t&&(e&&!t.getProcessor()&&t.setProcessor(e),!e&&t.getProcessor()&&t.stopProcessor())},[e,t])},DYe=({children:t})=>{const[e]=Ur(xle),n=_.useMemo(()=>IYe(),[]),r=_.useMemo(()=>new vfe(new MYe({blurRadius:15}),"background-blur"),[]),i=_.useMemo(()=>({supported:n,processor:n&&e?r:void 0}),[n,e,r]);return S.jsx(MD,{value:i,children:t})},NYe="_livekit_room_box_pjiap_12",b5={livekit_room_box:NYe};var wfe=(t=>(t.MISSING_MATRIX_RTC_TRANSPORT="MISSING_MATRIX_RTC_TRANSPORT",t.CONNECTION_LOST_ERROR="CONNECTION_LOST_ERROR",t.INTERNAL_MEMBERSHIP_MANAGER="INTERNAL_MEMBERSHIP_MANAGER",t.FAILED_TO_START_LIVEKIT="FAILED_TO_START_LIVEKIT",t.INSUFFICIENT_CAPACITY_ERROR="INSUFFICIENT_CAPACITY_ERROR",t.E2EE_NOT_SUPPORTED="E2EE_NOT_SUPPORTED",t.OPEN_ID_ERROR="OPEN_ID_ERROR",t.NO_MATRIX_2_AUTHORIZATION_SERVICE="NO_MATRIX_2_0_AUTHORIZATION_SERVICE",t.SFU_ERROR="SFU_ERROR",t.UNKNOWN_ERROR="UNKNOWN_ERROR",t))(wfe||{}),pC=(t=>(t.CONFIGURATION_ISSUE="CONFIGURATION_ISSUE",t.NETWORK_CONNECTIVITY="NETWORK_CONNECTIVITY",t.CLIENT_CONFIGURATION="CLIENT_CONFIGURATION",t.UNKNOWN="UNKNOWN",t.SYSTEM_FAILURE="SYSTEM_FAILURE",t))(pC||{});class ji extends Error{constructor(e,n,r,i,s){super(e,{cause:s}),this.localisedTitle=e,this.localisedMessage=i,this.category=r,this.code=n}}class UYe extends ji{constructor(e){super($i("error.call_is_not_supported"),"MISSING_MATRIX_RTC_TRANSPORT","CONFIGURATION_ISSUE",$i("error.matrix_rtc_transport_missing",{domain:e,brand:"Element Call",errorCode:"MISSING_MATRIX_RTC_TRANSPORT"})),this.domain=e}}class Efe extends ji{constructor(){super($i("error.connection_lost"),"CONNECTION_LOST_ERROR","NETWORK_CONNECTIVITY",$i("error.connection_lost_description"))}}class jYe extends ji{constructor(e){super($i("error.membership_manager"),"INTERNAL_MEMBERSHIP_MANAGER","SYSTEM_FAILURE",$i("error.membership_manager_description"),e)}}class FYe extends ji{constructor(){super($i("error.e2ee_unsupported"),"E2EE_NOT_SUPPORTED","CLIENT_CONFIGURATION",$i("error.e2ee_unsupported_description"))}}class Gp extends ji{constructor(e){super($i("error.generic"),"UNKNOWN_ERROR","UNKNOWN",void 0,e)}}class mC extends ji{constructor(e){super($i("error.generic"),"OPEN_ID_ERROR","CONFIGURATION_ISSUE",void 0,e)}}class Cfe extends ji{constructor(e){super($i("error.generic"),"NO_MATRIX_2_0_AUTHORIZATION_SERVICE","CONFIGURATION_ISSUE",$i("error.no_matrix_2_authorization_service"),e)}}class $Ye extends ji{constructor(e){super($i("error.failed_to_start_livekit"),"FAILED_TO_START_LIVEKIT","NETWORK_CONNECTIVITY",e)}}class BYe extends ji{constructor(){super($i("error.insufficient_capacity"),"INSUFFICIENT_CAPACITY_ERROR","UNKNOWN",$i("error.insufficient_capacity_description"))}}class HYe extends ji{constructor(){super($i("error.room_creation_restricted"),"SFU_ERROR","CONFIGURATION_ISSUE",$i("error.room_creation_restricted_description"))}}function qYe(t){return new Worker(""+new URL("IndexedDBWorker-Crotkr5C.js",import.meta.url).href,{type:"module",name:t?.name})}const Tfe=new Kn;function VYe(t){const e=m_(Tfe,t,_.useCallback(()=>localStorage.getItem(t),[t])),n=_.useCallback(r=>Rfe(t,r),[t]);return[e,n]}const Rfe=(t,e)=>{localStorage.setItem(t,e),Tfe.emit(t)};function kfe(t,e){localStorage.getItem(I_(t))!==e&&Rfe(I_(t),e)}const I_=t=>`room-shared-key-${t}`,KYe=(t,e)=>{const[n,r]=VYe(I_(t));return _.useEffect(()=>{e&&r(e)},[e,r]),[e??n,r]};function Ife(t){const{roomId:e,password:n}=er();return t!==e&&N.warn("requested key for a roomId which is not the current call room id (from the URL)",t,e),n??localStorage.getItem(I_(t))}function _4(t){const{client:e}=hm(),[n]=KYe(I_(t),Ife(t)??void 0),r=e?.getRoom(t);return _.useMemo(()=>r?n?{kind:qn.SHARED_KEY,secret:n}:r.hasEncryptionStateEvent()?{kind:qn.PER_PARTICIPANT}:{kind:qn.NONE}:{kind:qn.NONE},[r,n])}const FW=!1,GYe="element-call-sync";async function zYe(t){let e=!!await t.store.getSavedSyncToken();return new Promise((n,r)=>{const i=(s,o,a)=>{s==="PREPARED"?e?e=!1:(t.removeListener(De.Sync,i),n()):s==="ERROR"&&(t.removeListener(De.Sync,i),r(a?.error))};t.on(De.Sync,i)})}async function xfe(t,e){let n;try{n=window.indexedDB}catch(a){N.warn("Could not get indexDB from window.",a)}const r={fallbackICEServerAllowed:FW,isVoipWithNoMediaAllowed:_n.get().features?.feature_group_calls_without_video_and_audio};n&&localStorage?r.store=new SQ({indexedDB:window.indexedDB,localStorage,dbName:GYe,workerFactory:()=>new qYe}):localStorage&&(r.store=new Vb({localStorage}));const{e2eEnabled:i}=er();i||N.info("Disabling E2E: group call signalling will NOT be encrypted.");const s=OT({...r,...t,useAuthorizationHeader:!0,localTimeoutMs:5e3,useE2eForGroupCall:i,fallbackICEServerAllowed:FW});e||await s.clearStores();try{await s.store.startup()}catch(a){N.error("Error starting matrix client indexDB store. Falling back to memory store.",a),s.store=new Vb({localStorage}),await s.store.startup()}try{await s.initRustCrypto()}catch(a){N.warn(a,"Make sure to clear client stores before initializing the rust crypto.")}const o=zYe(s);return await s.startClient({clientWellKnownPollPeriod:600}),await o,s}function xS(t){return t.trim().replace(/\s/g,"-").replace(/[^\w-]/g,"").toLowerCase()}function WYe(t,e){return`#${xS(t)}:${e.getDomain()}`}function Afe(t){const e=t.split(":",2);if(e.length===2&&e[0][0]==="#"){if(e[1]===_n.defaultServerName())return e[0];throw new Error("Unsupported remote room alias")}return t}async function Mfe(t,e,n){N.log("Creating room for group call");const r=t.createRoom({visibility:FX.Private,preset:RT.PublicChat,name:e,room_alias_name:n?void 0:xS(e),power_level_content_override:{invite:100,kick:100,ban:100,redact:50,state_default:0,events_default:0,users_default:0,events:{"m.room.power_levels":100,"m.room.history_visibility":100,"m.room.tombstone":100,"m.room.encryption":100,"m.room.name":50,"m.room.message":0,"m.room.encrypted":50,"m.sticker":50,"org.matrix.msc3401.call.member":0},users:{[t.getUserId()]:100}}}),i=await new Promise((o,a)=>{r.catch(d=>{a(d),l()});const c=d=>{r.then(h=>{d.roomId===h.room_id&&(o(d.roomId),l())},h=>{N.error("Failed to wait for the room to arrive",h)})},l=()=>{t.off(De.Room,c)};t.on(De.Room,c)});let s;return n==qn.SHARED_KEY&&(s=DX(16),kfe(i,s)),{roomId:i,alias:n?void 0:WYe(e,t),password:s}}function Lfe(t,e,n,r){return`${window.location.protocol}//${window.location.host}${S4(t,e,n)}`}function S4(t,e,n,r){return`/room/#${n?"/"+xS(n):""}?${U$e(t,e).toString()}`}async function YYe(t){let e=0;for(;;)try{return await t()}catch(n){e++;const r=cP(n,e,!0);if(r<0)throw n;await Wp(r)}}function JYe({scope:t,membershipsWithTransport$:e,connectionManager:n}){return t.behavior(mt([e,n.connectionManagerData$]).pipe(Fr(r=>r.every(i=>i.epoch===r[0].epoch)),ge(([r,i])=>new Lc([r.value,i.value],r.epoch)),Jle("MatrixLivekitMembers",function*([r,i]){for(const{membership:s,transport:o}of r){const c=(o?i.getParticipantsForTransport(o):[]).find(d=>d.identity==s.rtcBackendIdentity)??null,l=o?i.getConnectionForTransport(o):null;yield{keys:[s.userId,s.deviceId,s.memberId,s.rtcBackendIdentity],data:{membership:s,participant:c,connection:l}}}},(r,i,s,o,a,c)=>{const{participant$:l,...d}=r.splitBehavior(i);return{userId:s,participant:{type:"remote",value$:l},...d}})),new Lc([],-1))}function Sb(t,e){return t&&e?t.livekit_service_url===e.livekit_service_url:!t&&!e}const xi=N.getChild("[LocalTransport]");var eT=(t=>(t.Legacy="legacy",t.Matrix_2_0="matrix_2_0",t))(eT||{});function XYe(t){return"transport"in t&&"sfuConfig"in t}const QYe=({scope:t,memberships$:e,ownMembershipIdentity:n,client:r,roomId:i,useOldestMember:s,forceJwtEndpoint:o,delayId$:a})=>{const c=t.behavior(e.pipe(ge(d=>{const h=d.value[0];if(h===void 0)return xi.info("Oldest member: not found"),null;const m=h.getTransport(h);return m===void 0?(xi.warn(`Oldest member: ${h.userId}|${h.deviceId}|${h.memberId} has no transport`),null):kT(m)?(xi.info("Oldest member: ${oldestMember.userId}|${oldestMember.deviceId}|${oldestMember.memberId} has valid transport"),m):(xi.warn(`Oldest member: ${h.userId}|${h.deviceId}|${h.memberId} has invalid transport`),null)}),Ni(Sb))),l=t.behavior(Nle.value$.pipe(rt(d=>pn(null)(a.pipe(rt(async h=>(xi.info("Creating preferred transport based on: ","customUrl: ",d,"delayId: ",h,"forceJwtEndpoint: ",o),eJe(r,n,i,d,o,h??void 0))),Ni((h,m)=>Sb(h.transport,m.transport)))))));return s?{advertised$:t.behavior(Nc(c,l.pipe(ge(d=>d?.transport??null))).pipe(AKe(d=>d!==null),ec(d=>xi.info(`Advertise transport: ${d.livekit_service_url}`))),null),active$:t.behavior(c.pipe(rt(d=>d===null?pt(null):Zf((async()=>({transport:d,sfuConfig:await w4(r,n,d.livekit_service_url,i,{forceJwtEndpoint:"legacy"},xi)}))()).pipe(pn(null))),ec(d=>xi.info(`Publish on transport: ${d?.transport.livekit_service_url}`))))}:{advertised$:t.behavior(l.pipe(ge(d=>d?.transport??null),Ni(Sb))),active$:l}},ZYe="org.matrix.msc4143.rtc_foci";async function eJe(t,e,n,r,i,s){xi.trace("Searching for a preferred transport");async function o(d){const h=await w4(t,e,d,n,{forceJwtEndpoint:i,delayEndpointBaseUrl:t.baseUrl,delayId:s},xi);return{transport:{type:"livekit",livekit_service_url:d},sfuConfig:h}}if(r!==null)return xi.info("Using LiveKit transport from dev tools: ",r),await o(r);async function a(d){for(const h of d)if(kT(h))try{return await o(h.livekit_service_url)}catch(m){if(m instanceof mC||m instanceof Cfe)throw m;xi.debug(`Could not use SFU service "${h.livekit_service_url}" as SFU`,m)}return null}if("_unstable_getRTCTransports"in t)try{const d=await t._unstable_getRTCTransports(),h=await a(d);if(h)return xi.info("Using backend-configured (client.getRTCTransports) SFU",h),h}catch(d){if(d instanceof In&&d.httpStatus===404)xi.debug("Matrix homeserver does not provide any RTC transports via `/rtc/transports` (will retry with well-known.)");else{if(d instanceof mC)throw d;xi.error("Unexpected error fetching RTC transports from backend",d)}}const c=t.getDomain();if(c){const d=(await ht.getRawClientConfig(c))?.[ZYe],h=Array.isArray(d)?await a(d):null;if(h)return xi.info("Using .well-known SFU",h),h}const l=_n.get().livekit?.livekit_service_url;if(l)try{return xi.info("Using config SFU",l),await o(l)}catch(d){if(d instanceof mC)throw d;xi.error("Failed to validate config SFU",d)}throw new UYe(c??"")}async function w4(t,e,n,r,i,s){let o;try{o=await YYe(async()=>t.getOpenIdToken())}catch(m){throw new mC(m instanceof Error?m:new Error("Unknown error"))}s?.debug("Got openID token",o),s?.info(`Trying to get JWT for focus ${n}...`);let a;const c=i?.forceJwtEndpoint===void 0,l=i?.forceJwtEndpoint===eT.Matrix_2_0;if(c||l)try{a=await nJe(e,n,r,o,i?.delayEndpointBaseUrl,i?.delayId),s?.info("Got JWT from call's active focus URL.")}catch(m){if(m instanceof Ofe)s?.warn("Failed fetching jwt with matrix 2.0 endpoint (retry with legacy) Not supported",m),a=void 0;else if(s?.warn("Failed fetching jwt with matrix 2.0 endpoint other issues ->","(not going to try with legacy endpoint: forceOldJwtEndpoint is set to false, we did not get a not supported error from the sfu)",m),l)throw new Cfe(m)}if(a===void 0&&(a=await tJe(e.deviceId,n,r,o),s?.info("Got JWT from call's active focus URL.")),!a)throw new Error("No `sfuConfig` after trying with old and new endpoints");const[,d]=a.jwt.split("."),h=JSON.parse(global.atob(d));return{jwt:a.jwt,url:a.url,livekitAlias:h.video.room,livekitIdentity:h.sub}}const tT=4;async function tJe(t,e,n,r){let i;if(await Pb(tT,async()=>{i=await fetch(e+"/sfu/get",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({room:n,openid_token:r,device_id:t})})}),!i)throw new Error(`Network error while connecting to jwt service after ${tT} retries`);if(!i.ok)throw new Error("SFU Config fetch failed with status code "+i.status);return await i.json()}class Ofe extends Error{constructor(e){super(e),this.name="NotSupported"}}async function nJe(t,e,n,r,i,s){const{userId:o,deviceId:a,memberId:c}=t,l={room_id:n,slot_id:"m.call#ROOM",openid_token:r,member:{id:c,claimed_user_id:o,claimed_device_id:a}};let d={};if(s&&i){const m=_n.get().matrix_rtc_session?.delayed_leave_event_delay_ms??1e3;d={delay_id:s,delay_timeout:m,delay_cs_api_url:i}}let h;if(await Pb(tT,async()=>{h=await fetch(e+"/get_token",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({...l,...d})})}),!h)throw new Error(`Network error while connecting to jwt service after ${tT} retries`);if(!h.ok){const m="SFU Config fetch failed with status code "+h.status;throw h.status===404?new Ofe(m):new Error(m)}return await h.json()}const rJe=({client:t,livekitRooms:e,roomId:n,env:r})=>{const{t:i}=ze(),[s,o]=Ur(Ile),[a,c]=Ur(E9),[l,d]=_.useState(!1);_.useEffect(()=>{t.doesServerSupportUnstableFeature(jC).then(q=>{d(q)}).catch(q=>{N.warn("Failed to check if sticky events are supported",q)})},[t]);const[h,m]=Ur(Dle),g=_.useId(),y=_.useCallback(q=>{m(q.target.value)},[m]),[v,E]=Ur(V3),[w,k]=Ur(Ple),[x,C]=_.useState(null),[R,T]=Ur(Nle),[M,O]=_.useState(R);_.useEffect(()=>{O(R)},[R]);const[P,D]=Ur(Ole),j=oc(),$=_.useMemo(()=>{const q=e?.find(Y=>Y.isLocal)?.room;if(q?.engine.client.ws?.url){const Y=new URL(q.engine.client.ws.url);return Y.search="",Y}return null},[e]);return S.jsxs(S.Fragment,{children:[S.jsx("p",{children:i("developer_mode.hostname",{hostname:window.location.hostname||"unknown"})}),S.jsx("p",{children:i("version",{productName:"Element Call",version:"embedded-v0.19.0-rc2"})}),S.jsx("p",{children:i("developer_mode.crypto_version",{version:t.getCrypto()?.getVersion()||"unknown"})}),S.jsx("p",{children:i("developer_mode.matrix_id",{id:t.getUserId()||"unknown"})}),S.jsx("p",{children:i("developer_mode.device_id",{id:t.getDeviceId()||"unknown"})}),S.jsx(Dt,{children:S.jsx(Zn,{id:"duplicateTiles",type:"number",label:i("developer_mode.duplicate_tiles_label"),value:s.toString(),min:0,onChange:_.useCallback(q=>{const Y=q.target.valueAsNumber;Y<0||o(Number.isNaN(Y)?0:Y)},[o])})}),S.jsx(Dt,{children:S.jsx(Zn,{id:"debugTileLayout",type:"checkbox",checked:a,label:i("developer_mode.debug_tile_layout_label"),onChange:q=>c(q.target.checked)})}),S.jsx(Dt,{children:S.jsx(Zn,{id:"showConnectionStats",type:"checkbox",label:i("developer_mode.show_connection_stats"),checked:!!v,onChange:_.useCallback(q=>{E(q.target.checked)},[E])})}),S.jsx(Dt,{children:S.jsx(Zn,{id:"muteAllAudio",type:"checkbox",label:i("developer_mode.mute_all_audio"),checked:P,onChange:_.useCallback(q=>{D(q.target.checked)},[D])})})," ",S.jsxs(Dt,{children:[S.jsx(Zn,{id:"alwaysShowIphoneEarpiece",type:"checkbox",label:i("developer_mode.always_show_iphone_earpiece"),checked:w,onChange:_.useCallback(q=>{k(q.target.checked)},[k])})," "]}),S.jsx(M9e,{onSubmit:q=>q.preventDefault(),helpLabel:R===null?i("developer_mode.custom_livekit_url.from_config"):i("developer_mode.custom_livekit_url.current_url")+R,label:i("developer_mode.custom_livekit_url.label"),saveButtonLabel:i("developer_mode.custom_livekit_url.save"),savingLabel:i("developer_mode.custom_livekit_url.saving"),cancelButtonLabel:i("developer_mode.custom_livekit_url.reset"),onSave:_.useCallback(async q=>{if(n===void 0||M===""||M===null){T(null);return}try{const Y=t.getUserId(),W=t.getDeviceId();if(Y===null||W===null)throw new Error("Invalid user or device ID");await w4(t,{userId:Y,deviceId:W,memberId:""},M,n),C(null),T(M)}catch{C("invalid URL (did not update)")}},[M,T,t,n]),value:M??"",onChange:_.useCallback(q=>{O(q.target.value)},[O]),onCancel:_.useCallback(q=>{T(null)},[T]),serverInvalid:x!==null,children:x!==null&&S.jsx(_9e,{children:x})}),S.jsx(qc,{as:"h3",type:"body",weight:"semibold",size:"lg",children:i("developer_mode.matrixRTCMode.title")}),S.jsxs(_3,{children:[S.jsxs(tC,{name:g,control:S.jsx(eC,{checked:h===lo.Legacy,value:lo.Legacy,onChange:y}),children:[S.jsx(cb,{children:i("developer_mode.matrixRTCMode.Legacy.label")}),S.jsx(nC,{children:i("developer_mode.matrixRTCMode.Legacy.description")})]}),S.jsxs(tC,{name:g,control:S.jsx(eC,{checked:h===lo.Compatibility,value:lo.Compatibility,onChange:y}),children:[S.jsx(cb,{children:i("developer_mode.matrixRTCMode.Comptibility.label")}),S.jsx(nC,{children:i("developer_mode.matrixRTCMode.Comptibility.description")})]}),S.jsxs(tC,{name:g,control:S.jsx(eC,{checked:h===lo.Matrix_2_0,value:lo.Matrix_2_0,disabled:!l,onChange:y}),children:[S.jsx(cb,{children:i("developer_mode.matrixRTCMode.Matrix_2_0.label")}),S.jsx(nC,{children:i("developer_mode.matrixRTCMode.Matrix_2_0.description")})]})]}),e?.map(q=>S.jsxs("div",{className:b5.livekit_room_box,children:[S.jsx("h4",{children:i("developer_mode.livekit_sfu",{url:q.url||"unknown"})}),S.jsxs("p",{children:["LivekitAlias: ",q.livekitAlias]}),S.jsxs("p",{children:["connectionState (wont hot reload): ",q.room.state]}),q.isLocal&&S.jsxs("p",{children:["ws-url: ",$?.href]}),S.jsxs("p",{children:[i("developer_mode.livekit_server_info"),"(",q.isLocal?"local":"remote",")"]}),S.jsxs("pre",{className:b5.pre,children:[q.room.serverInfo?JSON.stringify(q.room.serverInfo,null,2):"undefined",q.room.metadata]}),S.jsx("p",{children:"Local Participant"}),S.jsx("pre",{className:b5.pre,children:q.room.localParticipant.identity}),S.jsx("p",{children:"Remote Participants"}),S.jsx("ul",{children:Array.from(q.room.remoteParticipants.keys()).map(Y=>S.jsx("li",{children:Y},Y))})]})),S.jsx("p",{children:i("developer_mode.environment_variables")}),S.jsx("pre",{children:JSON.stringify(r,null,2)}),S.jsx("p",{children:i("developer_mode.url_params")}),S.jsx("pre",{children:JSON.stringify(j,null,2)})]})},iJe={BASE_URL:"./",DEV:!1,MODE:"production",PROD:!0,SSR:!1,VITE_APP_VERSION:"embedded-v0.19.0-rc2",VITE_PACKAGE:"embedded"},OD="audio",PD=({open:t,onDismiss:e,tab:n,onTabChange:r,client:i,roomId:s,livekitRooms:o})=>{const{t:a}=ze(),c=()=>{const{supported:P}=LD(),[D,j]=Ur(xle);return S.jsxs(S.Fragment,{children:[S.jsx("h4",{children:a("settings.background_blur_header")}),S.jsx(Dt,{children:S.jsx(Zn,{id:"activateBackgroundBlur",label:a("settings.background_blur_label"),description:P?"":a("settings.blur_not_supported_by_browser"),type:"checkbox",checked:!!D,onChange:$=>j($.target.checked),disabled:!P})})]})},l=pm();_.useEffect(()=>{t&&l.requestDeviceNames()},[t,l]);const[d,h]=Ur(Lle),[m,g]=_.useState(d),[y]=Ur(kle),{available:v}=NR(),{controlledAudioDevices:E}=oc(),w=je(Xle),k={key:"audio",name:a("common.audio"),content:S.jsx(S.Fragment,{children:S.jsxs(_3,{children:[!E&&S.jsx(l5,{device:l.audioInput,title:a("settings.devices.microphone"),numberedLabel:P=>a("settings.devices.microphone_numbered",{n:P})}),w&&E&&S.jsx(Ht,{onClick:P=>{P.preventDefault(),window.controls.showNativeAudioDevicePicker?.(),window.controls.showNativeOutputDevicePicker?.()},children:a("settings.devices.change_device_button")}),S.jsx(l5,{device:l.audioOutput,title:a("settings.devices.speaker"),numberedLabel:P=>a("settings.devices.speaker_numbered",{n:P})}),S.jsxs("div",{className:Ez.volumeSlider,children:[S.jsx("label",{children:a("settings.audio_tab.effect_volume_label")}),S.jsx("p",{children:a("settings.audio_tab.effect_volume_description")}),S.jsx(L9,{label:a("video_tile.volume"),value:m,onValueChange:g,onValueCommit:h,min:0,max:1,step:.01})]})]})})},x={key:"video",name:a("common.video"),content:S.jsxs(S.Fragment,{children:[S.jsx(_3,{children:S.jsx(l5,{device:l.videoInput,title:a("settings.devices.camera"),numberedLabel:P=>a("settings.devices.camera_numbered",{n:P})})}),S.jsx(j8,{}),S.jsx(c,{})]})},C={key:"preferences",name:a("common.preferences"),content:S.jsx(JGe,{})},R={key:"profile",name:a("common.profile"),content:S.jsx(dGe,{client:i})},T={key:"feedback",name:a("settings.feedback_tab_title"),content:S.jsx(hGe,{roomId:s})},M={key:"developer",name:a("settings.developer_tab_title"),content:S.jsx(rJe,{env:iJe,client:i,livekitRooms:o,roomId:s})},O=[k,x];return vt===null&&O.push(R),O.push(C),v&&O.push(T),y&&O.push(M),S.jsx(fm,{title:a("common.settings"),className:Ez.settingsModal,open:t,onDismiss:e,tabbed:!0,children:S.jsx(qKe,{label:a("common.settings"),tab:n,onTabChange:r,tabs:O})})},sJe=(t,e)=>_.createElement("svg",{width:22,height:22,viewBox:"0 0 22 22",fill:"none",xmlns:"http://www.w3.org/2000/svg",ref:e,...t},_.createElement("mask",{id:"path-1-inside-1_898_2641",fill:"white"},_.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M17.1502 20.1214C15.3946 21.3074 13.2782 22 11 22C8.52367 22 6.23845 21.1817 4.4 19.8008C1.72821 17.794 0 14.5988 0 11C0 4.92487 4.92487 0 11 0C17.0751 0 22 4.92487 22 11C22 14.797 20.0762 18.1446 17.1502 20.1214ZM11 11.55C12.8225 11.55 14.3 9.94942 14.3 7.975C14.3 6.00058 12.8225 4.4 11 4.4C9.17746 4.4 7.7 6.00058 7.7 7.975C7.7 9.94942 9.17746 11.55 11 11.55ZM11 19.8C13.3782 19.8 15.536 18.8566 17.1197 17.3237C16.1403 14.9056 13.7693 13.2 11 13.2C8.23066 13.2 5.85969 14.9056 4.88028 17.3237C6.46399 18.8566 8.62183 19.8 11 19.8Z"})),_.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M17.1502 20.1214C15.3946 21.3074 13.2782 22 11 22C8.52367 22 6.23845 21.1817 4.4 19.8008C1.72821 17.794 0 14.5988 0 11C0 4.92487 4.92487 0 11 0C17.0751 0 22 4.92487 22 11C22 14.797 20.0762 18.1446 17.1502 20.1214ZM11 11.55C12.8225 11.55 14.3 9.94942 14.3 7.975C14.3 6.00058 12.8225 4.4 11 4.4C9.17746 4.4 7.7 6.00058 7.7 7.975C7.7 9.94942 9.17746 11.55 11 11.55ZM11 19.8C13.3782 19.8 15.536 18.8566 17.1197 17.3237C16.1403 14.9056 13.7693 13.2 11 13.2C8.23066 13.2 5.85969 14.9056 4.88028 17.3237C6.46399 18.8566 8.62183 19.8 11 19.8Z",fill:"white"}),_.createElement("path",{d:"M17.1502 20.1214L17.9339 21.2814L17.1502 20.1214ZM4.4 19.8008L3.55919 20.9202H3.55919L4.4 19.8008ZM17.1197 17.3237L18.0934 18.3296L18.7717 17.6731L18.4173 16.7981L17.1197 17.3237ZM4.88028 17.3237L3.58268 16.7981L3.22829 17.6731L3.90659 18.3296L4.88028 17.3237ZM11 23.4C13.5662 23.4 15.9541 22.619 17.9339 21.2814L16.3665 18.9613C14.835 19.9959 12.9902 20.6 11 20.6V23.4ZM3.55919 20.9202C5.63176 22.477 8.21011 23.4 11 23.4V20.6C8.83723 20.6 6.84514 19.8865 5.24081 18.6814L3.55919 20.9202ZM-1.4 11C-1.4 15.0577 0.55052 18.6603 3.55919 20.9202L5.24081 18.6814C2.90591 16.9276 1.4 14.1399 1.4 11H-1.4ZM11 -1.4C4.15167 -1.4 -1.4 4.15167 -1.4 11H1.4C1.4 5.69807 5.69807 1.4 11 1.4V-1.4ZM23.4 11C23.4 4.15167 17.8483 -1.4 11 -1.4V1.4C16.3019 1.4 20.6 5.69807 20.6 11H23.4ZM17.9339 21.2814C21.2288 19.0554 23.4 15.2815 23.4 11H20.6C20.6 14.3124 18.9236 17.2337 16.3665 18.9613L17.9339 21.2814ZM12.9 7.975C12.9 9.28384 11.9459 10.15 11 10.15V12.95C13.6991 12.95 15.7 10.615 15.7 7.975H12.9ZM11 5.8C11.9459 5.8 12.9 6.66616 12.9 7.975H15.7C15.7 5.335 13.6991 3 11 3V5.8ZM9.1 7.975C9.1 6.66616 10.0541 5.8 11 5.8V3C8.30086 3 6.3 5.335 6.3 7.975H9.1ZM11 10.15C10.0541 10.15 9.1 9.28384 9.1 7.975H6.3C6.3 10.615 8.30086 12.95 11 12.95V10.15ZM16.146 16.3178C14.8129 17.6081 13.0004 18.4 11 18.4V21.2C13.756 21.2 16.2591 20.1051 18.0934 18.3296L16.146 16.3178ZM11 14.6C13.1797 14.6 15.0494 15.9415 15.8221 17.8493L18.4173 16.7981C17.2312 13.8697 14.359 11.8 11 11.8V14.6ZM6.17788 17.8493C6.95058 15.9415 8.8203 14.6 11 14.6V11.8C7.64102 11.8 4.7688 13.8697 3.58268 16.7981L6.17788 17.8493ZM11 18.4C8.99963 18.4 7.18709 17.6081 5.85397 16.3178L3.90659 18.3296C5.74088 20.1051 8.24402 21.2 11 21.2V18.4Z",fill:"white",mask:"url(#path-1-inside-1_898_2641)"})),$W=_.forwardRef(sJe),oJe=(t,e)=>_.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",ref:e,...t},_.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M20.0988 9.01625C20.3188 9.59375 20.8825 9.97875 21.5013 9.97875C22.3263 9.97875 23 10.6525 23 11.4775V12.5225C23 13.3475 22.3263 14.0213 21.5013 14.0213C20.8825 14.0213 20.3188 14.4062 20.0988 14.9838C20.0806 15.0292 20.0624 15.0753 20.0441 15.1218C19.9792 15.2863 19.9125 15.4555 19.8375 15.6163C19.5763 16.18 19.7 16.84 20.14 17.28C20.7313 17.8575 20.7313 18.8062 20.14 19.3975L19.3975 20.14C18.82 20.7313 17.8713 20.7313 17.28 20.14C16.8538 19.7 16.18 19.5763 15.6163 19.8375C15.41 19.9338 15.2037 20.0163 14.9838 20.0988C14.4062 20.3188 14.0213 20.8825 14.0213 21.5013C14.0213 22.3263 13.3475 23 12.5225 23H11.4775C10.6525 23 9.97875 22.3263 9.97875 21.5013C9.97875 20.8825 9.59375 20.3188 9.01625 20.0988C8.97079 20.0806 8.92466 20.0624 8.87815 20.044C8.71368 19.9792 8.54454 19.9125 8.38375 19.8375C7.82 19.5763 7.16 19.7 6.72 20.14C6.1425 20.7313 5.19375 20.7313 4.6025 20.14L3.86 19.3975C3.26875 18.82 3.26875 17.8713 3.86 17.28C4.3 16.8538 4.42375 16.18 4.1625 15.6163C4.06625 15.41 3.98375 15.2037 3.90125 14.9838C3.68125 14.4062 3.1175 14.0213 2.49875 14.0213C1.67375 14.0213 1 13.3475 1 12.5225V11.4775C1 10.6525 1.67375 9.97875 2.49875 9.97875C3.1175 9.97875 3.68125 9.59375 3.90125 9.01625C3.94464 8.87742 3.99897 8.74406 4.0539 8.60926C4.086 8.53046 4.11831 8.45117 4.14875 8.37C4.41 7.80625 4.28625 7.14625 3.84625 6.70625C3.255 6.12875 3.255 5.18 3.84625 4.58875L4.6025 3.86C5.18 3.26875 6.12875 3.26875 6.72 3.86C7.14625 4.3 7.82 4.42375 8.38375 4.1625C8.59 4.06625 8.79625 3.97 9.01625 3.90125C9.59375 3.68125 9.97875 3.1175 9.97875 2.49875C9.97875 1.67375 10.6525 1 11.4775 1H12.5225C13.3475 1 14.0213 1.67375 14.0213 2.49875C14.0213 3.13125 14.4062 3.68125 14.9838 3.90125C15.0292 3.91943 15.0753 3.93762 15.1218 3.95595C15.2863 4.02079 15.4555 4.08746 15.6163 4.1625C16.18 4.42375 16.84 4.3 17.28 3.86C17.8575 3.26875 18.8062 3.26875 19.3975 3.86L20.14 4.6025C20.7313 5.18 20.7313 6.12875 20.14 6.72C19.7 7.14625 19.5763 7.82 19.8375 8.38375C19.9338 8.59 20.0163 8.79625 20.0988 9.01625ZM12 17.5C8.96125 17.5 6.5 15.0387 6.5 12C6.5 8.96125 8.96125 6.5 12 6.5C15.0387 6.5 17.5 8.96125 17.5 12C17.5 15.0387 15.0387 17.5 12 17.5Z",fill:"#ffffff"})),aJe=_.forwardRef(oJe),cJe=(t,e)=>_.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",ref:e,...t},_.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M7.49966 2.38889C7.49966 1.89797 7.89763 1.5 8.38855 1.5H20.1108C20.6017 1.5 20.9997 1.89797 20.9997 2.38889V21.6111C20.9997 22.102 20.6017 22.5 20.1108 22.5H8.38855C7.89763 22.5 7.49966 22.102 7.49966 21.6111V12.6667H7.49089H7.4821H7.47331H7.46452H7.45573H7.44694H7.43815H7.42936H7.42057H7.41178H7.403H7.39421H7.38542H7.37663H7.36784H7.35905H7.35026H7.34147H7.33268H7.32389H7.3151H7.30632H7.29753H7.28874H7.27995H7.27116H7.26237H7.25358H7.24479H7.236H7.22721H7.21842H7.20964H7.20085H7.19206H7.18327H7.17448H7.16569H7.1569H7.14811H7.13932H7.13053H7.12175H7.11296H7.10417H7.09538H7.08659H7.0778H7.06901H7.06022H7.05143H7.04264H7.03385H7.02507H7.01628H7.00749H6.9987H6.98991H6.98112H6.97233H6.96354H6.95475H6.94596H6.93717H6.92839H6.9196H6.91081H6.90202H6.89323H6.88444H6.87565H6.86686H6.85807H6.84928H6.8405H6.83171H6.82292H6.81413H6.80534H6.79655H6.78776H6.77897H6.77018H6.76139H6.7526H6.74382H6.73503H6.72624H6.71745H6.70866H6.69987H6.69108H6.68229H6.6735H6.66471H6.65592H6.64714H6.63835H6.62956H6.62077H6.61198H6.60319H6.5944H6.58561H6.57682H6.56803H6.55925H6.55046H6.54167H6.53288H6.52409H6.5153H6.50651H6.49772H6.48893H6.48014H6.47135H6.46257H6.45378H6.44499H6.4362H6.42741H6.41862H6.40983H6.40104H6.39225H6.38346H6.37467H6.36589H6.3571H6.34831H6.33952H6.33073H6.32194H6.31315H6.30436H6.29557H6.28678H6.27799H6.26921H6.26042H6.25163H6.24284H6.23405H6.22526H6.21647H6.20768H6.19889H6.1901H6.18132H6.17253H6.16374H6.15495H6.14616H6.13737H6.12858H6.11979H6.111H6.10221H6.09342H6.08464H6.07585H6.06706H6.05827H6.04948H6.04069H6.0319H6.02311H6.01432H6.00553H5.99674H5.98796H5.97917H5.97038H5.96159H5.9528H5.94401H5.93522H5.92643H5.91764H5.90885H5.90007H5.89128H5.88249H5.8737H5.86491H5.85612H5.84733H5.83854H5.82975H5.82096H5.81217H5.80339H5.7946H5.78581H5.77702H5.76823H5.75944H5.75065H5.74186H5.73307H5.72428H5.71549H5.70671H5.69792H5.68913H5.68034H5.67155H5.66276H5.65397H5.64518H5.63639H5.6276H5.61882H5.61003H5.60124H5.59245H5.58366H5.57487H5.56608H5.55729H5.5485H5.53971H5.53092H5.52214H5.51335H5.50456H5.49577H5.48698H5.47819H5.4694H5.46061H5.45182H5.44303H5.43424H5.42546H5.41667H5.40788H5.39909H5.3903H5.38151H5.37272H5.36393H5.35514H5.34635H5.33757H5.32878H5.31999H5.3112H5.30241H5.29362H5.28483H5.27604H5.26725H5.25846H5.24967H5.24089H5.2321H5.22331H5.21452H5.20573H5.19694H5.18815H5.17936H5.17057H5.16178H5.15299H5.14421H5.13542H5.12663H5.11784H5.10905H5.10026H5.09147H5.08268H5.07389H5.0651H5.05632H5.04753H5.03874H5.02995H5.02116H5.01237H5.00358H4.99479H4.986H4.97721H4.96842H4.95964H4.95085H4.94206H4.93327H4.92448H4.91569H4.9069H4.89811H4.88932H4.88053H4.87174H4.86296H4.85417H4.84538H4.83659H4.8278H4.81901H4.81022H4.80143H4.79264H4.78385H4.77507H4.76628H4.75749H4.7487H4.73991H4.73112H4.72233H4.71354H4.70475H4.69596H4.68717H4.67839H4.6696H4.66081H4.65202H4.64323H4.63444H4.62565H4.61686H4.60807H4.59928H4.59049H4.58171H4.57292H4.56413H4.55534H4.54655H4.53776H4.52897H4.52018H4.51139H4.5026H4.49382H4.48503H4.47624H4.46745H4.45866H4.44987H4.44108H4.43229H4.4235H4.41471H4.40592H4.39714H4.38835H4.37956H4.37077H4.36198H4.35319H4.3444H4.33561H4.32682H4.31803H4.30924H4.30046H4.29167H4.28288H4.27409H4.2653H4.25651H4.24772H4.23893H4.23014H4.22135H4.21257H4.20378H4.19499H4.1862H4.17741H4.16862H4.15983H4.15104H4.14225H4.13346H4.12467H4.11589H4.1071H4.09831H4.08952H4.08073H4.07194H4.06315H4.05436H4.04557H4.03678H4.02799H4.01921H4.01042H4.00163H3.99284H3.98405H3.97526H3.96647H3.95768H3.94889H3.9401H3.93132H3.92253H3.91374H3.90495H3.89616H3.88737H3.87858H3.86979H3.861H3.85221H3.84342H3.83464H3.82585H3.81706H3.80827H3.79948H3.79069H3.7819H3.77311H3.76432H3.75553H3.74674H3.73796H3.72917H3.72038H3.71159H3.7028H3.69401H3.68522H3.67643H3.66764H3.65885H3.65007H3.64128H3.63249H3.6237H3.61491H3.60612H3.59733H3.58854H3.57975H3.57096H3.56217H3.55339H3.5446H3.53581H3.52702H3.51823H3.50944H3.50065H3.49186H3.48307H3.47428H3.46549H3.45671H3.44792H3.43913H3.43034H3.42155H3.41276H3.40397H3.39518H3.38639H3.3776H3.36882H3.36003H3.35124H3.34245H3.33366H3.32487H3.31608H3.30729H3.2985H3.28971H3.28092H3.27214H3.26335H3.25456H3.24577H3.23698H3.22819H3.2194H3.21061H3.20182H3.19303H3.18424H3.17546H3.16667H3.15788H3.14909H3.1403H3.13151H3.12272H3.11393H3.10514H3.09635H3.08757H3.07878H3.06999H3.0612H3.05241H3.04362H3.03483H3.02604H3.01725H3.00846H2.99967C2.63148 12.6667 2.33301 12.3682 2.33301 12C2.33301 11.6318 2.63148 11.3333 2.99967 11.3333H3.00846H3.01725H3.02604H3.03483H3.04362H3.05241H3.0612H3.06999H3.07878H3.08757H3.09635H3.10514H3.11393H3.12272H3.13151H3.1403H3.14909H3.15788H3.16667H3.17546H3.18424H3.19303H3.20182H3.21061H3.2194H3.22819H3.23698H3.24577H3.25456H3.26335H3.27214H3.28092H3.28971H3.2985H3.30729H3.31608H3.32487H3.33366H3.34245H3.35124H3.36003H3.36882H3.3776H3.38639H3.39518H3.40397H3.41276H3.42155H3.43034H3.43913H3.44792H3.45671H3.46549H3.47428H3.48307H3.49186H3.50065H3.50944H3.51823H3.52702H3.53581H3.5446H3.55339H3.56217H3.57096H3.57975H3.58854H3.59733H3.60612H3.61491H3.6237H3.63249H3.64128H3.65007H3.65885H3.66764H3.67643H3.68522H3.69401H3.7028H3.71159H3.72038H3.72917H3.73796H3.74674H3.75553H3.76432H3.77311H3.7819H3.79069H3.79948H3.80827H3.81706H3.82585H3.83464H3.84342H3.85221H3.861H3.86979H3.87858H3.88737H3.89616H3.90495H3.91374H3.92253H3.93132H3.9401H3.94889H3.95768H3.96647H3.97526H3.98405H3.99284H4.00163H4.01042H4.01921H4.02799H4.03678H4.04557H4.05436H4.06315H4.07194H4.08073H4.08952H4.09831H4.1071H4.11589H4.12467H4.13346H4.14225H4.15104H4.15983H4.16862H4.17741H4.1862H4.19499H4.20378H4.21257H4.22135H4.23014H4.23893H4.24772H4.25651H4.2653H4.27409H4.28288H4.29167H4.30046H4.30924H4.31803H4.32682H4.33561H4.3444H4.35319H4.36198H4.37077H4.37956H4.38835H4.39714H4.40592H4.41471H4.4235H4.43229H4.44108H4.44987H4.45866H4.46745H4.47624H4.48503H4.49382H4.5026H4.51139H4.52018H4.52897H4.53776H4.54655H4.55534H4.56413H4.57292H4.58171H4.59049H4.59928H4.60807H4.61686H4.62565H4.63444H4.64323H4.65202H4.66081H4.6696H4.67839H4.68717H4.69596H4.70475H4.71354H4.72233H4.73112H4.73991H4.7487H4.75749H4.76628H4.77507H4.78385H4.79264H4.80143H4.81022H4.81901H4.8278H4.83659H4.84538H4.85417H4.86296H4.87174H4.88053H4.88932H4.89811H4.9069H4.91569H4.92448H4.93327H4.94206H4.95085H4.95964H4.96842H4.97721H4.986H4.99479H5.00358H5.01237H5.02116H5.02995H5.03874H5.04753H5.05631H5.0651H5.07389H5.08268H5.09147H5.10026H5.10905H5.11784H5.12663H5.13542H5.14421H5.15299H5.16178H5.17057H5.17936H5.18815H5.19694H5.20573H5.21452H5.22331H5.2321H5.24089H5.24967H5.25846H5.26725H5.27604H5.28483H5.29362H5.30241H5.3112H5.31999H5.32878H5.33757H5.34635H5.35514H5.36393H5.37272H5.38151H5.3903H5.39909H5.40788H5.41667H5.42546H5.43424H5.44303H5.45182H5.46061H5.4694H5.47819H5.48698H5.49577H5.50456H5.51335H5.52214H5.53092H5.53971H5.5485H5.55729H5.56608H5.57487H5.58366H5.59245H5.60124H5.61003H5.61882H5.6276H5.63639H5.64518H5.65397H5.66276H5.67155H5.68034H5.68913H5.69792H5.70671H5.71549H5.72428H5.73307H5.74186H5.75065H5.75944H5.76823H5.77702H5.78581H5.7946H5.80339H5.81217H5.82096H5.82975H5.83854H5.84733H5.85612H5.86491H5.8737H5.88249H5.89128H5.90007H5.90885H5.91764H5.92643H5.93522H5.94401H5.9528H5.96159H5.97038H5.97917H5.98796H5.99674H6.00553H6.01432H6.02311H6.0319H6.04069H6.04948H6.05827H6.06706H6.07585H6.08464H6.09342H6.10221H6.111H6.11979H6.12858H6.13737H6.14616H6.15495H6.16374H6.17253H6.18132H6.1901H6.19889H6.20768H6.21647H6.22526H6.23405H6.24284H6.25163H6.26042H6.26921H6.27799H6.28678H6.29557H6.30436H6.31315H6.32194H6.33073H6.33952H6.34831H6.3571H6.36589H6.37467H6.38346H6.39225H6.40104H6.40983H6.41862H6.42741H6.4362H6.44499H6.45378H6.46257H6.47135H6.48014H6.48893H6.49772H6.50651H6.5153H6.52409H6.53288H6.54167H6.55046H6.55925H6.56803H6.57682H6.58561H6.5944H6.60319H6.61198H6.62077H6.62956H6.63835H6.64714H6.65592H6.66471H6.6735H6.68229H6.69108H6.69987H6.70866H6.71745H6.72624H6.73503H6.74382H6.7526H6.76139H6.77018H6.77897H6.78776H6.79655H6.80534H6.81413H6.82292H6.83171H6.8405H6.84928H6.85807H6.86686H6.87565H6.88444H6.89323H6.90202H6.91081H6.9196H6.92839H6.93717H6.94596H6.95475H6.96354H6.97233H6.98112H6.98991H6.9987H7.00749H7.01628H7.02507H7.03385H7.04264H7.05143H7.06022H7.06901H7.0778H7.08659H7.09538H7.10417H7.11296H7.12175H7.13053H7.13932H7.14811H7.1569H7.16569H7.17448H7.18327H7.19206H7.20085H7.20964H7.21842H7.22721H7.236H7.24479H7.25358H7.26237H7.27116H7.27995H7.28874H7.29753H7.30632H7.3151H7.32389H7.33268H7.34147H7.35026H7.35905H7.36784H7.37663H7.38542H7.39421H7.403H7.41178H7.42057H7.42936H7.43815H7.44694H7.45573H7.46452H7.47331H7.4821H7.49089H7.49966V2.38889ZM13.3687 6.24853C13.1172 5.9796 12.7095 5.9796 12.458 6.24853C12.2065 6.51747 12.2065 6.9535 12.458 7.22243L16.3022 11.3336L16.2894 11.3336L16.2726 11.3336L16.2558 11.3336L16.239 11.3335L16.2223 11.3335L16.2055 11.3335L16.1887 11.3335L16.1719 11.3335L16.1552 11.3334L16.1384 11.3334L16.1216 11.3334L16.1048 11.3334L16.088 11.3334L16.0713 11.3333L16.0545 11.3333L16.0377 11.3333L16.0209 11.3333L16.0041 11.3333L15.9874 11.3332L15.9706 11.3332L15.9538 11.3332L15.937 11.3332L15.9202 11.3332L15.9035 11.3331L15.8867 11.3331L15.8699 11.3331L15.8531 11.3331L15.8364 11.3331L15.8196 11.333L15.8028 11.333L15.786 11.333L15.7692 11.333L15.7525 11.333L15.7357 11.3329L15.7189 11.3329L15.7021 11.3329L15.6853 11.3329L15.6686 11.3329L15.6518 11.3328L15.635 11.3328L15.6182 11.3328L15.6014 11.3328L15.5847 11.3328L15.5679 11.3327L15.5511 11.3327L15.5343 11.3327L15.5175 11.3327L15.5008 11.3327L15.484 11.3326L15.4672 11.3326L15.4504 11.3326L15.4337 11.3326L15.4169 11.3326L15.4001 11.3325L15.3833 11.3325L15.3665 11.3325L15.3498 11.3325L15.333 11.3324L15.3162 11.3324L15.2994 11.3324L15.2826 11.3324L15.2659 11.3324L15.2491 11.3323L15.2323 11.3323L15.2155 11.3323L15.1987 11.3323L15.182 11.3323L15.1652 11.3322L15.1484 11.3322L15.1316 11.3322L15.1148 11.3322L15.0981 11.3322L15.0813 11.3321L15.0645 11.3321L15.0477 11.3321L15.031 11.3321L15.0142 11.3321L14.9974 11.332L14.9806 11.332L14.9638 11.332L14.9471 11.332L14.9303 11.332L14.9135 11.3319L14.8967 11.3319L14.8799 11.3319L14.8632 11.3319L14.8464 11.3319L14.8296 11.3318L14.8128 11.3318L14.796 11.3318L14.7793 11.3318L14.7625 11.3318L14.7457 11.3317L14.7289 11.3317L14.7122 11.3317L14.6954 11.3317L14.6786 11.3317L14.6618 11.3316L14.645 11.3316L14.6283 11.3316L14.6115 11.3316L14.5947 11.3316L14.5779 11.3315L14.5611 11.3315L14.5444 11.3315L14.5276 11.3315L14.5108 11.3315L14.494 11.3314L14.4772 11.3314L14.4605 11.3314L14.4437 11.3314L14.4269 11.3314L14.4101 11.3313L14.3933 11.3313L14.3766 11.3313L14.3598 11.3313L14.343 11.3313L14.3262 11.3312L14.3095 11.3312L14.2927 11.3312L14.2759 11.3312L14.2591 11.3312L14.2423 11.3311L14.2256 11.3311L14.2088 11.3311L14.192 11.3311L14.1752 11.3311L14.1584 11.331L14.1417 11.331L14.1249 11.331L14.1081 11.331L14.0913 11.331L14.0745 11.3309L14.0578 11.3309L14.041 11.3309L14.0242 11.3309L14.0074 11.3309L13.9906 11.3308L13.9739 11.3308L13.9571 11.3308L13.9403 11.3308L13.9235 11.3308L13.9068 11.3307L13.89 11.3307L13.8732 11.3307L13.8564 11.3307L13.8396 11.3307L13.8229 11.3306L13.8061 11.3306L13.7893 11.3306L13.7725 11.3306L13.7557 11.3306L13.739 11.3305L13.7222 11.3305L13.7054 11.3305L13.6886 11.3305L13.6718 11.3305L13.6551 11.3304L13.6383 11.3304L13.6215 11.3304L13.6047 11.3304L13.5879 11.3304L13.5712 11.3303L13.5544 11.3303L13.5376 11.3303L13.5208 11.3303L13.5041 11.3303L13.4873 11.3302L13.4705 11.3302L13.4537 11.3302L13.4369 11.3302L13.4202 11.3302L13.4034 11.3301L13.3866 11.3301L13.3698 11.3301L13.353 11.3301L13.3363 11.33L13.3195 11.33L13.3027 11.33L13.2859 11.33L13.2691 11.33L13.2524 11.3299L13.2356 11.3299L13.2188 11.3299L13.202 11.3299L13.1853 11.3299L13.1685 11.3298L13.1517 11.3298L13.1349 11.3298L13.1181 11.3298L13.1014 11.3298L13.0846 11.3297L13.0678 11.3297L13.051 11.3297L13.0342 11.3297L13.0175 11.3297L13.0007 11.3296L12.9839 11.3296L12.9671 11.3296L12.9503 11.3296L12.9336 11.3296L12.9168 11.3295L12.9 11.3295L12.8832 11.3295L12.8664 11.3295L12.8497 11.3295L12.8329 11.3294L12.8161 11.3294L12.7993 11.3294L12.7826 11.3294L12.7658 11.3294L12.749 11.3293L12.7322 11.3293L12.7154 11.3293L12.6987 11.3293L12.6819 11.3293L12.6651 11.3292L12.6483 11.3292L12.6315 11.3292L12.6148 11.3292L12.598 11.3292L12.5812 11.3291L12.5644 11.3291L12.5476 11.3291L12.5309 11.3291L12.5141 11.3291L12.4973 11.329L12.4805 11.329L12.4637 11.329L12.447 11.329L12.4302 11.329L12.4134 11.3289L12.3966 11.3289L12.3799 11.3289L12.3631 11.3289L12.3463 11.3289L12.3295 11.3288L12.3127 11.3288L12.296 11.3288L12.2792 11.3288L12.2624 11.3288L12.2456 11.3287L12.2288 11.3287L12.2121 11.3287L12.1953 11.3287L12.1785 11.3287L12.1617 11.3286L12.1449 11.3286L12.1282 11.3286L12.1114 11.3286L12.0946 11.3286L12.0778 11.3285L12.0611 11.3285L12.0443 11.3285L12.0275 11.3285L12.0107 11.3285L11.9939 11.3284L11.9772 11.3284L11.9604 11.3284L11.9436 11.3284L11.9268 11.3284L11.91 11.3283L11.8933 11.3283L11.8765 11.3283L11.8597 11.3283L11.8429 11.3283L11.8261 11.3282L11.8094 11.3282L11.7926 11.3282L11.7758 11.3282L11.759 11.3282L11.7422 11.3281L11.7255 11.3281L11.7087 11.3281L11.6919 11.3281L11.6751 11.3281L11.6583 11.328L11.6416 11.328L11.6248 11.328L11.608 11.328L11.5912 11.328L11.5745 11.3279L11.5577 11.3279L11.5409 11.3279L11.5241 11.3279L11.5073 11.3279L11.4906 11.3278L11.4738 11.3278L11.457 11.3278L11.4402 11.3278L11.4234 11.3278L11.4067 11.3277L11.3899 11.3277L11.3731 11.3277L11.3563 11.3277L11.3395 11.3277L11.3228 11.3276L11.306 11.3276L11.2892 11.3276L11.2724 11.3276L11.2557 11.3275L11.2389 11.3275L11.2221 11.3275L11.2053 11.3275L11.1885 11.3275L11.1718 11.3274L11.155 11.3274L11.1382 11.3274L11.1214 11.3274L11.1046 11.3274L11.0879 11.3273L11.0711 11.3273L11.0543 11.3273L11.0375 11.3273L11.0207 11.3273L11.004 11.3272L10.9872 11.3272L10.9704 11.3272L10.9536 11.3272L10.9368 11.3272L10.9201 11.3271L10.9033 11.3271L10.8865 11.3271L10.8697 11.3271L10.853 11.3271L10.8362 11.327L10.8194 11.327L10.8026 11.327L10.7858 11.327L10.7691 11.327L10.7523 11.3269L10.7355 11.3269L10.7187 11.3269L10.7019 11.3269L10.6852 11.3269L10.6684 11.3268L10.6516 11.3268L10.6348 11.3268L10.618 11.3268L10.6013 11.3268L10.5845 11.3267L10.5677 11.3267L10.5509 11.3267L10.5341 11.3267L10.5174 11.3267L10.5006 11.3266L10.4838 11.3266L10.467 11.3266L10.4503 11.3266L10.4335 11.3266L10.4167 11.3265L10.3999 11.3265L10.3831 11.3265L10.3664 11.3265L10.3496 11.3265L10.3328 11.3264L10.316 11.3264L10.2992 11.3264L10.2825 11.3264L10.2657 11.3264L10.2489 11.3263L10.2321 11.3263L10.2153 11.3263L10.1986 11.3263L10.1818 11.3263L10.165 11.3262L10.1482 11.3262L10.1315 11.3262L10.1147 11.3262L10.0979 11.3262L10.0811 11.3261L10.0643 11.3261L10.0476 11.3261L10.0308 11.3261L10.014 11.3261L9.99722 11.326L9.98044 11.326L9.96366 11.326L9.94688 11.326L9.9301 11.326L9.91332 11.3259L9.89654 11.3259L9.87977 11.3259L9.86299 11.3259L9.84621 11.3259L9.82943 11.3258L9.81265 11.3258L9.79587 11.3258L9.77909 11.3258L9.76231 11.3258L9.74553 11.3257L9.72875 11.3257L9.71197 11.3257L9.69519 11.3257L9.67841 11.3257L9.66163 11.3256L9.64486 11.3256L9.62808 11.3256L9.6113 11.3256L9.59452 11.3256L9.57774 11.3255L9.56096 11.3255L9.54418 11.3255L9.5274 11.3255L9.51062 11.3255L9.49384 11.3254L9.47706 11.3254L9.46029 11.3254L9.44351 11.3254L9.42673 11.3254L9.40995 11.3253L9.39317 11.3253L9.37639 11.3253L9.35961 11.3253L9.34283 11.3253L9.32605 11.3252L9.30927 11.3252L9.29249 11.3252L9.27572 11.3252L9.25894 11.3252L9.24216 11.3251L9.22538 11.3251L9.2086 11.3251L9.19182 11.3251L9.17504 11.325L9.15826 11.325L9.14148 11.325L9.1247 11.325L9.10792 11.325L9.09115 11.3249L9.07437 11.3249L9.05759 11.3249L9.04081 11.3249L9.02403 11.3249L9.00725 11.3248L8.99047 11.3248L8.97369 11.3248L8.95691 11.3248L8.94013 11.3248L8.92335 11.3247L8.90658 11.3247L8.8898 11.3247L8.87302 11.3247L8.85624 11.3247L8.83946 11.3246L8.82268 11.3246L8.8059 11.3246L8.78912 11.3246L8.77234 11.3246L8.75556 11.3245L8.73878 11.3245L8.722 11.3245L8.70523 11.3245L8.68845 11.3245L8.67167 11.3244L8.65489 11.3244L8.63811 11.3244L8.62133 11.3244L8.60455 11.3244L8.58777 11.3243L8.57099 11.3243L8.55421 11.3243L8.53743 11.3243L8.52066 11.3243L8.50388 11.3242L8.4871 11.3242L8.47032 11.3242L8.45354 11.3242L8.43676 11.3242L8.41998 11.3241L8.4032 11.3241L8.38642 11.3241L8.36964 11.3241L8.35286 11.3241L8.33608 11.324L8.31931 11.324L8.30253 11.324L8.28575 11.324L8.26897 11.324L8.25219 11.3239L8.23541 11.3239L8.21863 11.3239L8.20185 11.3239L8.18507 11.3239L8.16829 11.3238L8.15151 11.3238L8.13474 11.3238L8.11796 11.3238L8.10118 11.3238L8.0844 11.3237L8.06762 11.3237L8.05084 11.3237L8.03406 11.3237L8.01728 11.3237L8.0005 11.3236L7.99885 12.657L8.01563 12.657L8.03241 12.657L8.04919 12.657L8.06597 12.6571L8.08274 12.6571L8.09952 12.6571L8.1163 12.6571L8.13308 12.6571L8.14986 12.6572L8.16664 12.6572L8.18342 12.6572L8.2002 12.6572L8.21698 12.6572L8.23376 12.6573L8.25054 12.6573L8.26731 12.6573L8.28409 12.6573L8.30087 12.6573L8.31765 12.6574L8.33443 12.6574L8.35121 12.6574L8.36799 12.6574L8.38477 12.6574L8.40155 12.6575L8.41833 12.6575L8.43511 12.6575L8.45189 12.6575L8.46866 12.6575L8.48544 12.6576L8.50222 12.6576L8.519 12.6576L8.53578 12.6576L8.55256 12.6576L8.56934 12.6577L8.58612 12.6577L8.6029 12.6577L8.61968 12.6577L8.63646 12.6577L8.65323 12.6578L8.67001 12.6578L8.68679 12.6578L8.70357 12.6578L8.72035 12.6578L8.73713 12.6579L8.75391 12.6579L8.77069 12.6579L8.78747 12.6579L8.80425 12.6579L8.82103 12.658L8.83781 12.658L8.85458 12.658L8.87136 12.658L8.88814 12.658L8.90492 12.6581L8.9217 12.6581L8.93848 12.6581L8.95526 12.6581L8.97204 12.6581L8.98882 12.6582L9.0056 12.6582L9.02238 12.6582L9.03915 12.6582L9.05593 12.6582L9.07271 12.6583L9.08949 12.6583L9.10627 12.6583L9.12305 12.6583L9.13983 12.6583L9.15661 12.6584L9.17339 12.6584L9.19017 12.6584L9.20695 12.6584L9.22373 12.6584L9.2405 12.6585L9.25728 12.6585L9.27406 12.6585L9.29084 12.6585L9.30762 12.6585L9.3244 12.6586L9.34118 12.6586L9.35796 12.6586L9.37474 12.6586L9.39152 12.6586L9.4083 12.6587L9.42507 12.6587L9.44185 12.6587L9.45863 12.6587L9.47541 12.6587L9.49219 12.6588L9.50897 12.6588L9.52575 12.6588L9.54253 12.6588L9.55931 12.6588L9.57609 12.6589L9.59287 12.6589L9.60964 12.6589L9.62642 12.6589L9.6432 12.6589L9.65998 12.659L9.67676 12.659L9.69354 12.659L9.71032 12.659L9.7271 12.659L9.74388 12.6591L9.76066 12.6591L9.77744 12.6591L9.79421 12.6591L9.81099 12.6591L9.82777 12.6592L9.84455 12.6592L9.86133 12.6592L9.87811 12.6592L9.89489 12.6592L9.91167 12.6593L9.92845 12.6593L9.94523 12.6593L9.96201 12.6593L9.97879 12.6594L9.99556 12.6594L10.0123 12.6594L10.0291 12.6594L10.0459 12.6594L10.0627 12.6595L10.0795 12.6595L10.0962 12.6595L10.113 12.6595L10.1298 12.6595L10.1466 12.6596L10.1634 12.6596L10.1801 12.6596L10.1969 12.6596L10.2137 12.6596L10.2305 12.6597L10.2473 12.6597L10.264 12.6597L10.2808 12.6597L10.2976 12.6597L10.3144 12.6598L10.3311 12.6598L10.3479 12.6598L10.3647 12.6598L10.3815 12.6598L10.3983 12.6599L10.415 12.6599L10.4318 12.6599L10.4486 12.6599L10.4654 12.6599L10.4822 12.66L10.4989 12.66L10.5157 12.66L10.5325 12.66L10.5493 12.66L10.5661 12.6601L10.5828 12.6601L10.5996 12.6601L10.6164 12.6601L10.6332 12.6601L10.65 12.6602L10.6667 12.6602L10.6835 12.6602L10.7003 12.6602L10.7171 12.6602L10.7338 12.6603L10.7506 12.6603L10.7674 12.6603L10.7842 12.6603L10.801 12.6603L10.8177 12.6604L10.8345 12.6604L10.8513 12.6604L10.8681 12.6604L10.8849 12.6604L10.9016 12.6605L10.9184 12.6605L10.9352 12.6605L10.952 12.6605L10.9688 12.6605L10.9855 12.6606L11.0023 12.6606L11.0191 12.6606L11.0359 12.6606L11.0526 12.6606L11.0694 12.6607L11.0862 12.6607L11.103 12.6607L11.1198 12.6607L11.1365 12.6607L11.1533 12.6608L11.1701 12.6608L11.1869 12.6608L11.2037 12.6608L11.2204 12.6608L11.2372 12.6609L11.254 12.6609L11.2708 12.6609L11.2876 12.6609L11.3043 12.6609L11.3211 12.661L11.3379 12.661L11.3547 12.661L11.3715 12.661L11.3882 12.661L11.405 12.6611L11.4218 12.6611L11.4386 12.6611L11.4553 12.6611L11.4721 12.6611L11.4889 12.6612L11.5057 12.6612L11.5225 12.6612L11.5392 12.6612L11.556 12.6612L11.5728 12.6613L11.5896 12.6613L11.6064 12.6613L11.6231 12.6613L11.6399 12.6613L11.6567 12.6614L11.6735 12.6614L11.6903 12.6614L11.707 12.6614L11.7238 12.6614L11.7406 12.6615L11.7574 12.6615L11.7742 12.6615L11.7909 12.6615L11.8077 12.6615L11.8245 12.6616L11.8413 12.6616L11.858 12.6616L11.8748 12.6616L11.8916 12.6616L11.9084 12.6617L11.9252 12.6617L11.9419 12.6617L11.9587 12.6617L11.9755 12.6617L11.9923 12.6618L12.0091 12.6618L12.0258 12.6618L12.0426 12.6618L12.0594 12.6618L12.0762 12.6619L12.093 12.6619L12.1097 12.6619L12.1265 12.6619L12.1433 12.662L12.1601 12.662L12.1768 12.662L12.1936 12.662L12.2104 12.662L12.2272 12.6621L12.244 12.6621L12.2607 12.6621L12.2775 12.6621L12.2943 12.6621L12.3111 12.6622L12.3279 12.6622L12.3446 12.6622L12.3614 12.6622L12.3782 12.6622L12.395 12.6623L12.4118 12.6623L12.4285 12.6623L12.4453 12.6623L12.4621 12.6623L12.4789 12.6624L12.4957 12.6624L12.5124 12.6624L12.5292 12.6624L12.546 12.6624L12.5628 12.6625L12.5795 12.6625L12.5963 12.6625L12.6131 12.6625L12.6299 12.6625L12.6467 12.6626L12.6634 12.6626L12.6802 12.6626L12.697 12.6626L12.7138 12.6626L12.7306 12.6627L12.7473 12.6627L12.7641 12.6627L12.7809 12.6627L12.7977 12.6627L12.8145 12.6628L12.8312 12.6628L12.848 12.6628L12.8648 12.6628L12.8816 12.6628L12.8984 12.6629L12.9151 12.6629L12.9319 12.6629L12.9487 12.6629L12.9655 12.6629L12.9822 12.663L12.999 12.663L13.0158 12.663L13.0326 12.663L13.0494 12.663L13.0661 12.6631L13.0829 12.6631L13.0997 12.6631L13.1165 12.6631L13.1333 12.6631L13.15 12.6632L13.1668 12.6632L13.1836 12.6632L13.2004 12.6632L13.2172 12.6632L13.2339 12.6633L13.2507 12.6633L13.2675 12.6633L13.2843 12.6633L13.3011 12.6633L13.3178 12.6634L13.3346 12.6634L13.3514 12.6634L13.3682 12.6634L13.3849 12.6634L13.4017 12.6635L13.4185 12.6635L13.4353 12.6635L13.4521 12.6635L13.4688 12.6635L13.4856 12.6636L13.5024 12.6636L13.5192 12.6636L13.536 12.6636L13.5527 12.6636L13.5695 12.6637L13.5863 12.6637L13.6031 12.6637L13.6199 12.6637L13.6366 12.6637L13.6534 12.6638L13.6702 12.6638L13.687 12.6638L13.7038 12.6638L13.7205 12.6638L13.7373 12.6639L13.7541 12.6639L13.7709 12.6639L13.7876 12.6639L13.8044 12.6639L13.8212 12.664L13.838 12.664L13.8548 12.664L13.8715 12.664L13.8883 12.664L13.9051 12.6641L13.9219 12.6641L13.9387 12.6641L13.9554 12.6641L13.9722 12.6641L13.989 12.6642L14.0058 12.6642L14.0226 12.6642L14.0393 12.6642L14.0561 12.6642L14.0729 12.6643L14.0897 12.6643L14.1064 12.6643L14.1232 12.6643L14.14 12.6644L14.1568 12.6644L14.1736 12.6644L14.1903 12.6644L14.2071 12.6644L14.2239 12.6645L14.2407 12.6645L14.2575 12.6645L14.2742 12.6645L14.291 12.6645L14.3078 12.6646L14.3246 12.6646L14.3414 12.6646L14.3581 12.6646L14.3749 12.6646L14.3917 12.6647L14.4085 12.6647L14.4253 12.6647L14.442 12.6647L14.4588 12.6647L14.4756 12.6648L14.4924 12.6648L14.5091 12.6648L14.5259 12.6648L14.5427 12.6648L14.5595 12.6649L14.5763 12.6649L14.593 12.6649L14.6098 12.6649L14.6266 12.6649L14.6434 12.665L14.6602 12.665L14.6769 12.665L14.6937 12.665L14.7105 12.665L14.7273 12.6651L14.7441 12.6651L14.7608 12.6651L14.7776 12.6651L14.7944 12.6651L14.8112 12.6652L14.828 12.6652L14.8447 12.6652L14.8615 12.6652L14.8783 12.6652L14.8951 12.6653L14.9118 12.6653L14.9286 12.6653L14.9454 12.6653L14.9622 12.6653L14.979 12.6654L14.9957 12.6654L15.0125 12.6654L15.0293 12.6654L15.0461 12.6654L15.0629 12.6655L15.0796 12.6655L15.0964 12.6655L15.1132 12.6655L15.13 12.6655L15.1468 12.6656L15.1635 12.6656L15.1803 12.6656L15.1971 12.6656L15.2139 12.6656L15.2306 12.6657L15.2474 12.6657L15.2642 12.6657L15.281 12.6657L15.2978 12.6657L15.3145 12.6658L15.3313 12.6658L15.3481 12.6658L15.3649 12.6658L15.3817 12.6658L15.3984 12.6659L15.4152 12.6659L15.432 12.6659L15.4488 12.6659L15.4656 12.6659L15.4823 12.666L15.4991 12.666L15.5159 12.666L15.5327 12.666L15.5495 12.666L15.5662 12.6661L15.583 12.6661L15.5998 12.6661L15.6166 12.6661L15.6333 12.6661L15.6501 12.6662L15.6669 12.6662L15.6837 12.6662L15.7005 12.6662L15.7172 12.6662L15.734 12.6663L15.7508 12.6663L15.7676 12.6663L15.7844 12.6663L15.8011 12.6663L15.8179 12.6664L15.8347 12.6664L15.8515 12.6664L15.8683 12.6664L15.885 12.6664L15.9018 12.6665L15.9186 12.6665L15.9354 12.6665L15.9522 12.6665L15.9689 12.6665L15.9857 12.6666L16.0025 12.6666L16.0193 12.6666L16.036 12.6666L16.0528 12.6666L16.0696 12.6667L16.0864 12.6667L16.1032 12.6667L16.1199 12.6667L16.1367 12.6667L16.1535 12.6668L16.1703 12.6668L16.1871 12.6668L16.2038 12.6668L16.2206 12.6669L16.2374 12.6669L16.2542 12.6669L16.271 12.6669L16.2836 12.6669L12.458 16.7581C12.2065 17.0271 12.2065 17.4631 12.458 17.732C12.7095 18.001 13.1172 18.001 13.3687 17.732L18.2822 12.4772C18.5337 12.2083 18.5337 11.7723 18.2822 11.5033L13.3687 6.24853Z",fill:"white"})),lJe=_.forwardRef(cJe),uJe=(t,e)=>_.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",ref:e,...t},_.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M18.2139 2.44646L12 3.99992H5.4375C4.64359 3.99992 4 4.64352 4 5.43742V18.5624C4 19.3563 4.64359 19.9999 5.4375 19.9999H12L18.2139 21.5534C19.1211 21.7802 20 21.094 20 20.1588V3.84104C20 2.90584 19.1211 2.21964 18.2139 2.44646ZM12 17.9999V5.99992H6V17.9999H12Z",fill:"white"})),dJe=_.forwardRef(uJe),fJe="_userButton_t5z8t_15",hJe={userButton:fJe},pJe=({preventNavigation:t,isAuthenticated:e,isPasswordlessUser:n,userId:r,displayName:i,avatarUrl:s,onAction:o})=>{const{t:a}=ze(),c=cs(),l=_.useMemo(()=>{const m=[];return e&&(m.push({key:"user",icon:$W,label:i,dataTestid:"usermenu_user"}),m.push({key:"settings",icon:aJe,label:a("common.settings")}),n&&!t&&m.push({key:"login",label:a("action.sign_in"),icon:lJe,dataTestid:"usermenu_login"}),!n&&!t&&m.push({key:"logout",label:a("action.sign_out"),icon:dJe,dataTestid:"usermenu_logout"})),m},[e,n,i,t,a]),[d,h]=_.useState(!1);return e?S.jsx(wR,{title:a("a11y.user_menu"),showTitle:!1,align:"end",open:d,onOpenChange:h,trigger:S.jsx("button",{"aria-label":a("common.profile"),className:hJe.userButton,"data-testid":"usermenu_open",children:e&&(!n||s)?S.jsx(Iy,{id:r,name:i,size:ky.SM,src:s}):S.jsx($W,{})}),children:l.map(({key:m,icon:g,label:y,dataTestid:v})=>S.jsx(Fp,{Icon:g,label:y,"data-testid":v,onSelect:()=>o(m)},m))}):S.jsx(s9,{to:{pathname:"/login"},state:{from:c},children:a("log_in")})},DD=({preventNavigation:t=!1})=>{const e=cs(),n=Fl(),{client:r,logout:i,authenticated:s,passwordlessUser:o}=R9(),{displayName:a,avatarUrl:c}=yS(r),[l,d]=_.useState(!1),h=_.useCallback(()=>d(!1),[d]),[m,g]=_.useState(OD),y=_.useCallback(E=>{switch(E){case"user":g("profile"),d(!0);break;case"settings":g("audio"),d(!0);break;case"logout":i?.();break;case"login":n("/login",{state:{from:e}})?.catch(w=>N.error("Failed to navigate to login",w));break}},[n,e,i,d]),v=r?.getUserIdLocalpart()??"";return S.jsxs(S.Fragment,{children:[S.jsx(pJe,{preventNavigation:t,isAuthenticated:s,isPasswordlessUser:o,avatarUrl:c,onAction:y,userId:r?.getUserId()??"",displayName:a||(v?v.replace("@",""):"")}),r&&S.jsx(PD,{client:r,open:l,onDismiss:h,tab:m,onTabChange:g})]})},ND=t=>{const[e,n]=_.useState(void 0),[r,i]=_.useState(void 0),s=_.useRef(void 0);s.current||(s.current=OT({baseUrl:_n.defaultHomeserverUrl()})),_.useEffect(()=>{vt||s.current.registerRequest({}).catch(a=>{n(a.data?.params["m.login.terms"]?.policies?.privacy_policy?.en?.url),i(a.data?.params["m.login.recaptcha"]?.public_key)})},[]);const o=_.useCallback(async(a,c,l,d,h)=>{const m=new IP({matrixClient:s.current,doRequest:async x=>s.current.registerRequest({username:a,password:c,auth:x||void 0}),stateUpdated:(x,C)=>{if(C.error)throw new Error(C.error);x==="m.login.terms"?m.submitAuthDict({type:"m.login.terms"}).catch(R=>{N.error(R)}):x==="m.login.recaptcha"&&m.submitAuthDict({type:"m.login.recaptcha",response:d}).catch(R=>{N.error(R)})},requestEmailToken:async()=>Promise.resolve({sid:"dummy"})}),{user_id:g,access_token:y,device_id:v}=await m.attemptAuth();await t?.logout(!0);const E=await xfe({baseUrl:_n.defaultHomeserverUrl(),accessToken:y,userId:g,deviceId:v},!1);await E.setDisplayName(l);const w={user_id:g,device_id:v,access_token:y,passwordlessUser:h};h&&(w.tempPassword=c);const k=E.getUser(E.getUserId());return k.setRawDisplayName(l),k.setDisplayName(l),[E,w]},[t]);return{privacyPolicyUrl:e,recaptchaKey:r,register:o}},mJe="_buttons_1arp2_8",gJe={buttons:mJe},Pfe=({onJoin:t,open:e,onDismiss:n})=>{const{t:r}=ze();return S.jsxs(fm,{title:r("join_existing_call_modal.title"),open:e,onDismiss:n,children:[S.jsx("p",{children:r("join_existing_call_modal.text")}),S.jsxs(Dt,{rightAlign:!0,className:gJe.buttons,children:[S.jsx(Ht,{onClick:n,children:r("action.no")}),S.jsx(Ht,{onClick:t,"data-testid":"home_joinExistingRoom",children:r("join_existing_call_modal.join_button")})]})]})},BW="https://www.recaptcha.net/recaptcha/api.js?onload=mxOnRecaptchaLoaded&render=explicit";function UD(t){const{t:e}=ze(),[n]=_.useState(()=>Qo(16)),r=_.useRef(void 0);_.useEffect(()=>{if(!t)return;const o=()=>{document.getElementById(n)&&window.grecaptcha.render(n,{sitekey:t,size:"invisible",callback:a=>r.current?.resolve(a),"error-callback":()=>r.current?.reject(new Error)})};if(typeof window.grecaptcha?.render=="function")o();else if(window.mxOnRecaptchaLoaded=o,!document.querySelector(`script[src="${BW}"]`)){const a=document.createElement("script");a.src=BW,a.async=!0,document.body.appendChild(a)}},[n,t]);const i=_.useCallback(async()=>t?window.grecaptcha?new Promise((o,a)=>{const c=new MutationObserver(d=>{for(const h of d)if(h.target?.style?.visibility!=="visible"){a(Tz("recaptcha_dismissed",e)),c.disconnect();return}});r.current={resolve:d=>{o(d),c.disconnect()},reject:d=>{a(d),c.disconnect()}},window.grecaptcha.execute().then(()=>{},d=>{N.error("Recaptcha execution failed",d)});const l=document.querySelector('iframe[src*="recaptcha/api2/bframe"]');l?.parentNode?.parentNode&&c.observe(l?.parentNode?.parentNode,{attributes:!0})}):(N.log("Recaptcha not loaded"),Promise.reject(Tz("recaptcha_not_loaded",e))):Promise.resolve(""),[t,e]),s=_.useCallback(()=>{window.grecaptcha?.reset()},[]);return{execute:i,reset:s,recaptchaId:n}}const vJe="_form_jcuzc_8",yJe={form:vJe},E4=({ref:t,children:e,className:n,onSubmit:r})=>S.jsx("form",{onSubmit:r,className:Le(yJe.form,n),ref:t,children:e});E4.displayName="Form";const bJe="_footer_106jg_8",_Je="_mobileLoginLink_106jg_19",SJe="_form_106jg_24",wJe="_notice_106jg_40",_1={footer:bJe,mobileLoginLink:_Je,form:SJe,notice:wJe},EJe="_container_dwllg_8",CJe="_main_dwllg_15",TJe="_logo_dwllg_23",gv={container:EJe,main:CJe,logo:TJe},HW=t=>{t=1831565813+(t|=0)|0;let e=Math.imul(t^t>>>15,1|t);return e=e+Math.imul(e^e>>>7,61|e)^e,((e^e>>>14)>>>0)/4294967296};class RJe{constructor(e){this.dictionaries=void 0,this.length=void 0,this.separator=void 0,this.style=void 0,this.seed=void 0;const{length:n,separator:r,dictionaries:i,style:s,seed:o}=e;this.dictionaries=i,this.separator=r,this.length=n,this.style=s,this.seed=o}generate(){if(!this.dictionaries)throw new Error('Cannot find any dictionary. Please provide at least one, or leave the "dictionary" field empty in the config object');if(this.length<=0)throw new Error("Invalid length provided");if(this.length>this.dictionaries.length)throw new Error(`The length cannot be bigger than the number of dictionaries.
285
+ `,a=nh(t,t.VERTEX_SHADER,s),c=nh(t,t.FRAGMENT_SHADER,o),l=b4(t,a,c),d={texture:t.getUniformLocation(l,"u_texture"),position:t.getAttribLocation(l,"position")};return{framebuffer:i,texture:r,program:l,uniforms:d}}function kYe(t,e,n,r,i,s){return t.useProgram(n.program),t.bindFramebuffer(t.FRAMEBUFFER,n.framebuffer),t.viewport(0,0,i,s),t.bindBuffer(t.ARRAY_BUFFER,r),t.enableVertexAttribArray(n.uniforms.position),t.vertexAttribPointer(n.uniforms.position,2,t.FLOAT,!1,0,0),t.activeTexture(t.TEXTURE0),t.bindTexture(t.TEXTURE_2D,e),t.uniform1i(n.uniforms.texture,0),t.drawArrays(t.TRIANGLES,0,6),t.bindFramebuffer(t.FRAMEBUFFER,null),n.texture}var UW=qy("livekit-track-processor-web-gl"),jW=t=>{const e=t.getContext("webgl2",{antialias:!0,premultipliedAlpha:!0});let n=null,r=8;const i=4;if(!e){UW.error("Failed to create WebGL context");return}e.enable(e.BLEND),e.blendFunc(e.SRC_ALPHA,e.ONE_MINUS_SRC_ALPHA);const s=TYe(e),o=s.program,a=s.attribLocations.position,{mask:c,frame:l,background:d,disableBackground:h}=s.uniformLocations,m=SYe(e),g=m.program,y=m.uniforms,v=EYe(e),E=v.program,w=v.uniforms,k=zh(e,0),x=zh(e,1),C=vYe(e);if(!C)throw new Error("Failed to create vertex buffer");let R=[],T=[],M=[],O=0,P=1;R.push(zh(e,3)),R.push(zh(e,4));const D=Math.floor(t.width/i),j=Math.floor(t.height/i),$=RYe(e,D,j);T.push(b1(e,R[0],D,j)),T.push(b1(e,R[1],D,j));const q=zh(e,5),Y=b1(e,q,t.width,t.height);M.push(zh(e,6)),M.push(zh(e,7));const W=[b1(e,M[0],t.width,t.height),b1(e,M[1],t.width,t.height)];let H=!1;e.useProgram(o),e.uniform1i(h,H?1:0),e.uniform1i(d,0),e.uniform1i(l,1),e.uniform1i(c,2);let F=null;function V(de){if(de.codedWidth===0||M.length===0)return;const Te=de.displayWidth,we=de.displayHeight;e.activeTexture(e.TEXTURE1),e.bindTexture(e.TEXTURE_2D,x),e.texImage2D(e.TEXTURE_2D,0,e.RGBA,e.RGBA,e.UNSIGNED_BYTE,de);let ae=k;if(n){const ke=kYe(e,x,$,C,D,j);ae=NW(e,ke,D,j,n,g,y,C,T,R)}else F&&(e.activeTexture(e.TEXTURE0),e.bindTexture(e.TEXTURE_2D,k),e.texImage2D(e.TEXTURE_2D,0,e.RGBA,e.RGBA,e.UNSIGNED_BYTE,F),ae=k);e.viewport(0,0,Te,we),e.clearColor(1,1,1,1),e.clear(e.COLOR_BUFFER_BIT),e.useProgram(o),e.bindBuffer(e.ARRAY_BUFFER,C),e.vertexAttribPointer(a,2,e.FLOAT,!1,0,0),e.enableVertexAttribArray(a),e.activeTexture(e.TEXTURE0),e.bindTexture(e.TEXTURE_2D,ae),e.uniform1i(d,0),e.uniform1i(h,H?1:0),e.activeTexture(e.TEXTURE1),e.bindTexture(e.TEXTURE_2D,x),e.uniform1i(l,1),e.activeTexture(e.TEXTURE2),e.bindTexture(e.TEXTURE_2D,M[O]),e.uniform1i(c,2),e.drawArrays(e.TRIANGLES,0,6)}async function G(de){if(F=null,de){F=bYe();try{F=await yYe(de,t.width,t.height)}catch(Te){UW.error("Error processing background image, falling back to black background:",Te)}e.activeTexture(e.TEXTURE0),e.bindTexture(e.TEXTURE_2D,k),e.texImage2D(e.TEXTURE_2D,0,e.RGBA,e.RGBA,e.UNSIGNED_BYTE,F)}}function ee(de){n=de?Math.max(1,Math.floor(de/i)):null,G(null)}function K(de){H=de}function Q(de){const Te=[Y,W[P]],we=[q,M[P]];NW(e,de,t.width,t.height,r,E,w,C,Te,we),O=P,P=1-P}function fe(){e.deleteProgram(o),e.deleteProgram(g),e.deleteProgram(E),e.deleteTexture(k),e.deleteTexture(x),e.deleteTexture(q),e.deleteFramebuffer(Y);for(const de of R)e.deleteTexture(de);for(const de of T)e.deleteFramebuffer(de);for(const de of M)e.deleteTexture(de);for(const de of W)e.deleteFramebuffer(de);e.deleteBuffer(C),$&&(e.deleteTexture($.texture),e.deleteFramebuffer($.framebuffer),e.deleteProgram($.program)),F&&(F instanceof ImageBitmap&&F.close(),F=null),R=[],T=[],M=[]}return{renderFrame:V,updateMask:Q,setBackgroundImage:G,setBlurRadius:ee,setBackgroundDisabled:K,cleanup:fe}},_fe=class{constructor(){this.isDisabled=!1}async init({outputCanvas:t,inputElement:e}){if(!(e instanceof HTMLVideoElement))throw TypeError("Video transformer needs a HTMLVideoElement as input");this.transformer=new TransformStream({transform:(n,r)=>this.transform(n,r)}),this.canvas=t||null,t&&(this.gl=jW(this.canvas||Z3(e.videoWidth,e.videoHeight))),this.inputVideo=e,this.isDisabled=!1}async restart({outputCanvas:t,inputElement:e}){var n;this.canvas=t||null,(n=this.gl)==null||n.cleanup(),this.gl=jW(this.canvas||Z3(e.videoWidth,e.videoHeight)),this.inputVideo=e,this.isDisabled=!1}async destroy(){var t;this.isDisabled=!0,this.canvas=void 0,(t=this.gl)==null||t.cleanup(),this.gl=void 0}},Sfe=class extends _fe{constructor(t){super(),this.backgroundImageAndPath=null,this.segmentationTimeMs=0,this.isFirstFrame=!0,this.log=qy("livekit-processor-wrapper"),this.options=t,this.update(t)}static get isSupported(){return typeof OffscreenCanvas<"u"&&typeof VideoFrame<"u"&&typeof createImageBitmap<"u"&&!!document.createElement("canvas").getContext("webgl2")}async init({outputCanvas:t,inputElement:e}){var n,r,i,s,o,a,c,l;await super.init({outputCanvas:t,inputElement:e});const d=await np.forVisionTasks((r=(n=this.options.assetPaths)==null?void 0:n.tasksVisionFileSet)!=null?r:`https://cdn.jsdelivr.net/npm/@mediapipe/tasks-vision@${gYe["@mediapipe/tasks-vision"]}/wasm`);this.imageSegmenter=await gs.createFromOptions(d,{baseOptions:{modelAssetPath:(s=(i=this.options.assetPaths)==null?void 0:i.modelAssetPath)!=null?s:"https://storage.googleapis.com/mediapipe-models/image_segmenter/selfie_segmenter/float16/latest/selfie_segmenter.tflite",delegate:"GPU",...this.options.segmenterOptions},canvas:this.canvas,runningMode:"VIDEO",outputCategoryMask:!0,outputConfidenceMasks:!1}),(o=this.options)!=null&&o.imagePath&&await this.loadAndSetBackground(this.options.imagePath).catch(h=>this.log.error("Error while loading processor background image: ",h)),typeof this.options.blurRadius=="number"&&((a=this.gl)==null||a.setBlurRadius(this.options.blurRadius)),(l=this.gl)==null||l.setBackgroundDisabled((c=this.options.backgroundDisabled)!=null?c:!1)}async destroy(t){var e;await super.destroy(),await((e=this.imageSegmenter)==null?void 0:e.close()),this.backgroundImageAndPath=null,t?.willProcessorRestart||(this.isFirstFrame=!0)}async loadAndSetBackground(t){var e,n;if(!this.backgroundImageAndPath||((e=this.backgroundImageAndPath)==null?void 0:e.path)!==t){const r=new Image;await new Promise((s,o)=>{r.crossOrigin="Anonymous",r.onload=()=>s(r),r.onerror=a=>o(a),r.src=t});const i=await createImageBitmap(r);this.backgroundImageAndPath={imageData:i,path:t}}(n=this.gl)==null||n.setBackgroundImage(this.backgroundImageAndPath.imageData)}async transform(t,e){var n,r,i,s;let o=!1;try{if(!(t instanceof VideoFrame)||t.codedWidth===0||t.codedHeight===0){this.log.debug("empty frame detected, ignoring");return}let a=(r=(n=this.isDisabled)!=null?n:this.options.backgroundDisabled)!=null?r:!1;if(typeof this.options.blurRadius!="number"&&typeof this.options.imagePath!="string"&&(a=!0),a){e.enqueue(t),o=!0;return}const c=Date.now();if(!this.canvas)throw TypeError("Canvas needs to be initialized first");this.canvas.width=t.displayWidth,this.canvas.height=t.displayHeight,this.isFirstFrame&&(e.enqueue(t.clone()),this.inputVideo&&await new Promise(h=>{this.inputVideo.requestVideoFrameCallback((m,g)=>{const y=g.expectedDisplayTime-g.presentationTime;setTimeout(h,y)})})),this.isFirstFrame=!1;const l=performance.now(),d=new Promise((h,m)=>{var g;try{let y=performance.now();(g=this.imageSegmenter)==null||g.segmentForVideo(t,y,v=>{this.segmentationTimeMs=performance.now()-y,this.segmentationResults=v,this.updateMask(v.categoryMask),v.close(),h()})}catch(y){m(y)}});if(this.drawFrame(t),this.canvas&&this.canvas.width>0&&this.canvas.height>0){const h=new VideoFrame(this.canvas,{timestamp:t.timestamp||c});e.enqueue(h);const m=performance.now()-l,g={processingTimeMs:this.segmentationTimeMs+m,segmentationTimeMs:this.segmentationTimeMs,filterTimeMs:m};(s=(i=this.options).onFrameProcessed)==null||s.call(i,g)}else e.enqueue(t);await d}catch(a){this.log.error("Error while processing frame: ",a)}finally{o||t.close()}}async update(t){var e,n,r,i,s;this.options={...this.options,...t},(n=this.gl)==null||n.setBlurRadius((e=t.blurRadius)!=null?e:null),t.imagePath?await this.loadAndSetBackground(t.imagePath):(r=this.gl)==null||r.setBackgroundImage(null),(s=this.gl)==null||s.setBackgroundDisabled((i=t.backgroundDisabled)!=null?i:!1)}async drawFrame(t){var e;this.gl&&((e=this.gl)==null||e.renderFrame(t))}async updateMask(t){var e;t&&((e=this.gl)==null||e.updateMask(t.getAsWebGLTexture()))}},IYe=()=>Sfe.isSupported&&vfe.isSupported;const xYe=""+new URL("selfie_segmenter-DF05sdL4.tflite",import.meta.url).href,AYe={wasmLoaderPath:new URL(""+new URL("vision_wasm_internal-B105rqk5.js",import.meta.url).href,import.meta.url).href,wasmBinaryPath:new URL(""+new URL("vision_wasm_internal-cvmXinav.wasm",import.meta.url).href,import.meta.url).href};class MYe extends Sfe{async init({outputCanvas:e,inputElement:n}){await _fe.prototype.init.call(this,{outputCanvas:e,inputElement:n}),this.imageSegmenter=await gs.createFromOptions(AYe,{baseOptions:{modelAssetPath:xYe,delegate:"GPU",...this.options.segmenterOptions},canvas:this.canvas,runningMode:"VIDEO",outputCategoryMask:!0,outputConfidenceMasks:!1}),this.options.blurRadius&&this.gl?.setBlurRadius(this.options.blurRadius)}}const MD=_.createContext(void 0);function LD(){const t=_.use(MD);if(t===void 0)throw new Error("useTrackProcessor must be used within a ProcessorProvider");return t}function LYe(){const t=_.use(MD);if(t===void 0)throw new Error("useTrackProcessor must be used within a ProcessorProvider");return Qle(n=>n.pipe(ge(([r])=>r)),[t])}const OYe=(t,e,n)=>{mt([e,n]).pipe(t.bind()).subscribe(([r,i])=>{if(!i||!r)return;const{processor:s}=i;s&&!r.getProcessor()&&r.setProcessor(s),!s&&r.getProcessor()&&r.stopProcessor()})},PYe=t=>{const{processor:e}=LD();_.useEffect(()=>{t&&(e&&!t.getProcessor()&&t.setProcessor(e),!e&&t.getProcessor()&&t.stopProcessor())},[e,t])},DYe=({children:t})=>{const[e]=Ur(xle),n=_.useMemo(()=>IYe(),[]),r=_.useMemo(()=>new vfe(new MYe({blurRadius:15}),"background-blur"),[]),i=_.useMemo(()=>({supported:n,processor:n&&e?r:void 0}),[n,e,r]);return S.jsx(MD,{value:i,children:t})},NYe="_livekit_room_box_pjiap_12",b5={livekit_room_box:NYe};var wfe=(t=>(t.MISSING_MATRIX_RTC_TRANSPORT="MISSING_MATRIX_RTC_TRANSPORT",t.CONNECTION_LOST_ERROR="CONNECTION_LOST_ERROR",t.INTERNAL_MEMBERSHIP_MANAGER="INTERNAL_MEMBERSHIP_MANAGER",t.FAILED_TO_START_LIVEKIT="FAILED_TO_START_LIVEKIT",t.INSUFFICIENT_CAPACITY_ERROR="INSUFFICIENT_CAPACITY_ERROR",t.E2EE_NOT_SUPPORTED="E2EE_NOT_SUPPORTED",t.OPEN_ID_ERROR="OPEN_ID_ERROR",t.NO_MATRIX_2_AUTHORIZATION_SERVICE="NO_MATRIX_2_0_AUTHORIZATION_SERVICE",t.SFU_ERROR="SFU_ERROR",t.UNKNOWN_ERROR="UNKNOWN_ERROR",t))(wfe||{}),pC=(t=>(t.CONFIGURATION_ISSUE="CONFIGURATION_ISSUE",t.NETWORK_CONNECTIVITY="NETWORK_CONNECTIVITY",t.CLIENT_CONFIGURATION="CLIENT_CONFIGURATION",t.UNKNOWN="UNKNOWN",t.SYSTEM_FAILURE="SYSTEM_FAILURE",t))(pC||{});class ji extends Error{constructor(e,n,r,i,s){super(e,{cause:s}),this.localisedTitle=e,this.localisedMessage=i,this.category=r,this.code=n}}class UYe extends ji{constructor(e){super($i("error.call_is_not_supported"),"MISSING_MATRIX_RTC_TRANSPORT","CONFIGURATION_ISSUE",$i("error.matrix_rtc_transport_missing",{domain:e,brand:"Element Call",errorCode:"MISSING_MATRIX_RTC_TRANSPORT"})),this.domain=e}}class Efe extends ji{constructor(){super($i("error.connection_lost"),"CONNECTION_LOST_ERROR","NETWORK_CONNECTIVITY",$i("error.connection_lost_description"))}}class jYe extends ji{constructor(e){super($i("error.membership_manager"),"INTERNAL_MEMBERSHIP_MANAGER","SYSTEM_FAILURE",$i("error.membership_manager_description"),e)}}class FYe extends ji{constructor(){super($i("error.e2ee_unsupported"),"E2EE_NOT_SUPPORTED","CLIENT_CONFIGURATION",$i("error.e2ee_unsupported_description"))}}class Gp extends ji{constructor(e){super($i("error.generic"),"UNKNOWN_ERROR","UNKNOWN",void 0,e)}}class mC extends ji{constructor(e){super($i("error.generic"),"OPEN_ID_ERROR","CONFIGURATION_ISSUE",void 0,e)}}class Cfe extends ji{constructor(e){super($i("error.generic"),"NO_MATRIX_2_0_AUTHORIZATION_SERVICE","CONFIGURATION_ISSUE",$i("error.no_matrix_2_authorization_service"),e)}}class $Ye extends ji{constructor(e){super($i("error.failed_to_start_livekit"),"FAILED_TO_START_LIVEKIT","NETWORK_CONNECTIVITY",e)}}class BYe extends ji{constructor(){super($i("error.insufficient_capacity"),"INSUFFICIENT_CAPACITY_ERROR","UNKNOWN",$i("error.insufficient_capacity_description"))}}class HYe extends ji{constructor(){super($i("error.room_creation_restricted"),"SFU_ERROR","CONFIGURATION_ISSUE",$i("error.room_creation_restricted_description"))}}function qYe(t){return new Worker(""+new URL("IndexedDBWorker-Crotkr5C.js",import.meta.url).href,{type:"module",name:t?.name})}const Tfe=new Kn;function VYe(t){const e=m_(Tfe,t,_.useCallback(()=>localStorage.getItem(t),[t])),n=_.useCallback(r=>Rfe(t,r),[t]);return[e,n]}const Rfe=(t,e)=>{localStorage.setItem(t,e),Tfe.emit(t)};function kfe(t,e){localStorage.getItem(I_(t))!==e&&Rfe(I_(t),e)}const I_=t=>`room-shared-key-${t}`,KYe=(t,e)=>{const[n,r]=VYe(I_(t));return _.useEffect(()=>{e&&r(e)},[e,r]),[e??n,r]};function Ife(t){const{roomId:e,password:n}=er();return t!==e&&N.warn("requested key for a roomId which is not the current call room id (from the URL)",t,e),n??localStorage.getItem(I_(t))}function _4(t){const{client:e}=hm(),[n]=KYe(I_(t),Ife(t)??void 0),r=e?.getRoom(t);return _.useMemo(()=>r?n?{kind:qn.SHARED_KEY,secret:n}:r.hasEncryptionStateEvent()?{kind:qn.PER_PARTICIPANT}:{kind:qn.NONE}:{kind:qn.NONE},[r,n])}const FW=!1,GYe="element-call-sync";async function zYe(t){let e=!!await t.store.getSavedSyncToken();return new Promise((n,r)=>{const i=(s,o,a)=>{s==="PREPARED"?e?e=!1:(t.removeListener(De.Sync,i),n()):s==="ERROR"&&(t.removeListener(De.Sync,i),r(a?.error))};t.on(De.Sync,i)})}async function xfe(t,e){let n;try{n=window.indexedDB}catch(a){N.warn("Could not get indexDB from window.",a)}const r={fallbackICEServerAllowed:FW,isVoipWithNoMediaAllowed:_n.get().features?.feature_group_calls_without_video_and_audio};n&&localStorage?r.store=new SQ({indexedDB:window.indexedDB,localStorage,dbName:GYe,workerFactory:()=>new qYe}):localStorage&&(r.store=new Vb({localStorage}));const{e2eEnabled:i}=er();i||N.info("Disabling E2E: group call signalling will NOT be encrypted.");const s=OT({...r,...t,useAuthorizationHeader:!0,localTimeoutMs:5e3,useE2eForGroupCall:i,fallbackICEServerAllowed:FW});e||await s.clearStores();try{await s.store.startup()}catch(a){N.error("Error starting matrix client indexDB store. Falling back to memory store.",a),s.store=new Vb({localStorage}),await s.store.startup()}try{await s.initRustCrypto()}catch(a){N.warn(a,"Make sure to clear client stores before initializing the rust crypto.")}const o=zYe(s);return await s.startClient({clientWellKnownPollPeriod:600}),await o,s}function xS(t){return t.trim().replace(/\s/g,"-").replace(/[^\w-]/g,"").toLowerCase()}function WYe(t,e){return`#${xS(t)}:${e.getDomain()}`}function Afe(t){const e=t.split(":",2);if(e.length===2&&e[0][0]==="#"){if(e[1]===_n.defaultServerName())return e[0];throw new Error("Unsupported remote room alias")}return t}async function Mfe(t,e,n){N.log("Creating room for group call");const r=t.createRoom({visibility:FX.Private,preset:RT.PublicChat,name:e,room_alias_name:n?void 0:xS(e),power_level_content_override:{invite:100,kick:100,ban:100,redact:50,state_default:0,events_default:0,users_default:0,events:{"m.room.power_levels":100,"m.room.history_visibility":100,"m.room.tombstone":100,"m.room.encryption":100,"m.room.name":50,"m.room.message":0,"m.room.encrypted":50,"m.sticker":50,"org.matrix.msc3401.call.member":0},users:{[t.getUserId()]:100}}}),i=await new Promise((o,a)=>{r.catch(d=>{a(d),l()});const c=d=>{r.then(h=>{d.roomId===h.room_id&&(o(d.roomId),l())},h=>{N.error("Failed to wait for the room to arrive",h)})},l=()=>{t.off(De.Room,c)};t.on(De.Room,c)});let s;return n==qn.SHARED_KEY&&(s=DX(16),kfe(i,s)),{roomId:i,alias:n?void 0:WYe(e,t),password:s}}function Lfe(t,e,n,r){return`${window.location.protocol}//${window.location.host}${S4(t,e,n)}`}function S4(t,e,n,r){return`/room/#${n?"/"+xS(n):""}?${U$e(t,e).toString()}`}async function YYe(t){let e=0;for(;;)try{return await t()}catch(n){e++;const r=cP(n,e,!0);if(r<0)throw n;await Wp(r)}}function JYe({scope:t,membershipsWithTransport$:e,connectionManager:n}){return t.behavior(mt([e,n.connectionManagerData$]).pipe(Fr(r=>r.every(i=>i.epoch===r[0].epoch)),ge(([r,i])=>new Lc([r.value,i.value],r.epoch)),Jle("MatrixLivekitMembers",function*([r,i]){for(const{membership:s,transport:o}of r){const c=(o?i.getParticipantsForTransport(o):[]).find(d=>d.identity==s.rtcBackendIdentity)??null,l=o?i.getConnectionForTransport(o):null;yield{keys:[s.userId,s.deviceId,s.memberId,s.rtcBackendIdentity],data:{membership:s,participant:c,connection:l}}}},(r,i,s,o,a,c)=>{const{participant$:l,...d}=r.splitBehavior(i);return{userId:s,participant:{type:"remote",value$:l},...d}})),new Lc([],-1))}function Sb(t,e){return t&&e?t.livekit_service_url===e.livekit_service_url:!t&&!e}const xi=N.getChild("[LocalTransport]");var eT=(t=>(t.Legacy="legacy",t.Matrix_2_0="matrix_2_0",t))(eT||{});function XYe(t){return"transport"in t&&"sfuConfig"in t}const QYe=({scope:t,memberships$:e,ownMembershipIdentity:n,client:r,roomId:i,useOldestMember:s,forceJwtEndpoint:o,delayId$:a})=>{const c=t.behavior(e.pipe(ge(d=>{const h=d.value[0];if(h===void 0)return xi.info("Oldest member: not found"),null;const m=h.getTransport(h);return m===void 0?(xi.warn(`Oldest member: ${h.userId}|${h.deviceId}|${h.memberId} has no transport`),null):kT(m)?(xi.info("Oldest member: ${oldestMember.userId}|${oldestMember.deviceId}|${oldestMember.memberId} has valid transport"),m):(xi.warn(`Oldest member: ${h.userId}|${h.deviceId}|${h.memberId} has invalid transport`),null)}),Ni(Sb))),l=t.behavior(Nle.value$.pipe(rt(d=>pn(null)(a.pipe(rt(async h=>(xi.info("Creating preferred transport based on: ","customUrl: ",d,"delayId: ",h,"forceJwtEndpoint: ",o),eJe(r,n,i,d,o,h??void 0))),Ni((h,m)=>Sb(h.transport,m.transport)))))));return s?{advertised$:t.behavior(Nc(c,l.pipe(ge(d=>d?.transport??null))).pipe(AKe(d=>d!==null),ec(d=>xi.info(`Advertise transport: ${d.livekit_service_url}`))),null),active$:t.behavior(c.pipe(rt(d=>d===null?pt(null):Zf((async()=>({transport:d,sfuConfig:await w4(r,n,d.livekit_service_url,i,{forceJwtEndpoint:"legacy"},xi)}))()).pipe(pn(null))),ec(d=>xi.info(`Publish on transport: ${d?.transport.livekit_service_url}`))))}:{advertised$:t.behavior(l.pipe(ge(d=>d?.transport??null),Ni(Sb))),active$:l}},ZYe="org.matrix.msc4143.rtc_foci";async function eJe(t,e,n,r,i,s){xi.trace("Searching for a preferred transport");async function o(d){const h=await w4(t,e,d,n,{forceJwtEndpoint:i,delayEndpointBaseUrl:t.baseUrl,delayId:s},xi);return{transport:{type:"livekit",livekit_service_url:d},sfuConfig:h}}if(r!==null)return xi.info("Using LiveKit transport from dev tools: ",r),await o(r);async function a(d){for(const h of d)if(kT(h))try{return await o(h.livekit_service_url)}catch(m){if(m instanceof mC||m instanceof Cfe)throw m;xi.debug(`Could not use SFU service "${h.livekit_service_url}" as SFU`,m)}return null}if("_unstable_getRTCTransports"in t)try{const d=await t._unstable_getRTCTransports(),h=await a(d);if(h)return xi.info("Using backend-configured (client.getRTCTransports) SFU",h),h}catch(d){if(d instanceof In&&d.httpStatus===404)xi.debug("Matrix homeserver does not provide any RTC transports via `/rtc/transports` (will retry with well-known.)");else{if(d instanceof mC)throw d;xi.error("Unexpected error fetching RTC transports from backend",d)}}const c=t.getDomain();if(c){const d=(await ht.getRawClientConfig(c))?.[ZYe],h=Array.isArray(d)?await a(d):null;if(h)return xi.info("Using .well-known SFU",h),h}const l=_n.get().livekit?.livekit_service_url;if(l)try{return xi.info("Using config SFU",l),await o(l)}catch(d){if(d instanceof mC)throw d;xi.error("Failed to validate config SFU",d)}throw new UYe(c??"")}async function w4(t,e,n,r,i,s){let o;try{o=await YYe(async()=>t.getOpenIdToken())}catch(m){throw new mC(m instanceof Error?m:new Error("Unknown error"))}s?.debug("Got openID token",o),s?.info(`Trying to get JWT for focus ${n}...`);let a;const c=i?.forceJwtEndpoint===void 0,l=i?.forceJwtEndpoint===eT.Matrix_2_0;if(c||l)try{a=await nJe(e,n,r,o,i?.delayEndpointBaseUrl,i?.delayId),s?.info("Got JWT from call's active focus URL.")}catch(m){if(m instanceof Ofe)s?.warn("Failed fetching jwt with matrix 2.0 endpoint (retry with legacy) Not supported",m),a=void 0;else if(s?.warn("Failed fetching jwt with matrix 2.0 endpoint other issues ->","(not going to try with legacy endpoint: forceOldJwtEndpoint is set to false, we did not get a not supported error from the sfu)",m),l)throw new Cfe(m)}if(a===void 0&&(a=await tJe(e.deviceId,n,r,o),s?.info("Got JWT from call's active focus URL.")),!a)throw new Error("No `sfuConfig` after trying with old and new endpoints");const[,d]=a.jwt.split("."),h=JSON.parse(global.atob(d));return{jwt:a.jwt,url:a.url,livekitAlias:h.video.room,livekitIdentity:h.sub}}const tT=4;async function tJe(t,e,n,r){let i;if(await Pb(tT,async()=>{i=await fetch(e+"/sfu/get",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({room:n,openid_token:r,device_id:t})})}),!i)throw new Error(`Network error while connecting to jwt service after ${tT} retries`);if(!i.ok)throw new Error("SFU Config fetch failed with status code "+i.status);return await i.json()}class Ofe extends Error{constructor(e){super(e),this.name="NotSupported"}}async function nJe(t,e,n,r,i,s){const{userId:o,deviceId:a,memberId:c}=t,l={room_id:n,slot_id:"m.call#ROOM",openid_token:r,member:{id:c,claimed_user_id:o,claimed_device_id:a}};let d={};if(s&&i){const m=_n.get().matrix_rtc_session?.delayed_leave_event_delay_ms??1e3;d={delay_id:s,delay_timeout:m,delay_cs_api_url:i}}let h;if(await Pb(tT,async()=>{h=await fetch(e+"/get_token",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({...l,...d})})}),!h)throw new Error(`Network error while connecting to jwt service after ${tT} retries`);if(!h.ok){const m="SFU Config fetch failed with status code "+h.status;throw h.status===404?new Ofe(m):new Error(m)}return await h.json()}const rJe=({client:t,livekitRooms:e,roomId:n,env:r})=>{const{t:i}=ze(),[s,o]=Ur(Ile),[a,c]=Ur(E9),[l,d]=_.useState(!1);_.useEffect(()=>{t.doesServerSupportUnstableFeature(jC).then(q=>{d(q)}).catch(q=>{N.warn("Failed to check if sticky events are supported",q)})},[t]);const[h,m]=Ur(Dle),g=_.useId(),y=_.useCallback(q=>{m(q.target.value)},[m]),[v,E]=Ur(V3),[w,k]=Ur(Ple),[x,C]=_.useState(null),[R,T]=Ur(Nle),[M,O]=_.useState(R);_.useEffect(()=>{O(R)},[R]);const[P,D]=Ur(Ole),j=oc(),$=_.useMemo(()=>{const q=e?.find(Y=>Y.isLocal)?.room;if(q?.engine.client.ws?.url){const Y=new URL(q.engine.client.ws.url);return Y.search="",Y}return null},[e]);return S.jsxs(S.Fragment,{children:[S.jsx("p",{children:i("developer_mode.hostname",{hostname:window.location.hostname||"unknown"})}),S.jsx("p",{children:i("version",{productName:"Element Call",version:"embedded-v0.19.0"})}),S.jsx("p",{children:i("developer_mode.crypto_version",{version:t.getCrypto()?.getVersion()||"unknown"})}),S.jsx("p",{children:i("developer_mode.matrix_id",{id:t.getUserId()||"unknown"})}),S.jsx("p",{children:i("developer_mode.device_id",{id:t.getDeviceId()||"unknown"})}),S.jsx(Dt,{children:S.jsx(Zn,{id:"duplicateTiles",type:"number",label:i("developer_mode.duplicate_tiles_label"),value:s.toString(),min:0,onChange:_.useCallback(q=>{const Y=q.target.valueAsNumber;Y<0||o(Number.isNaN(Y)?0:Y)},[o])})}),S.jsx(Dt,{children:S.jsx(Zn,{id:"debugTileLayout",type:"checkbox",checked:a,label:i("developer_mode.debug_tile_layout_label"),onChange:q=>c(q.target.checked)})}),S.jsx(Dt,{children:S.jsx(Zn,{id:"showConnectionStats",type:"checkbox",label:i("developer_mode.show_connection_stats"),checked:!!v,onChange:_.useCallback(q=>{E(q.target.checked)},[E])})}),S.jsx(Dt,{children:S.jsx(Zn,{id:"muteAllAudio",type:"checkbox",label:i("developer_mode.mute_all_audio"),checked:P,onChange:_.useCallback(q=>{D(q.target.checked)},[D])})})," ",S.jsxs(Dt,{children:[S.jsx(Zn,{id:"alwaysShowIphoneEarpiece",type:"checkbox",label:i("developer_mode.always_show_iphone_earpiece"),checked:w,onChange:_.useCallback(q=>{k(q.target.checked)},[k])})," "]}),S.jsx(M9e,{onSubmit:q=>q.preventDefault(),helpLabel:R===null?i("developer_mode.custom_livekit_url.from_config"):i("developer_mode.custom_livekit_url.current_url")+R,label:i("developer_mode.custom_livekit_url.label"),saveButtonLabel:i("developer_mode.custom_livekit_url.save"),savingLabel:i("developer_mode.custom_livekit_url.saving"),cancelButtonLabel:i("developer_mode.custom_livekit_url.reset"),onSave:_.useCallback(async q=>{if(n===void 0||M===""||M===null){T(null);return}try{const Y=t.getUserId(),W=t.getDeviceId();if(Y===null||W===null)throw new Error("Invalid user or device ID");await w4(t,{userId:Y,deviceId:W,memberId:""},M,n),C(null),T(M)}catch{C("invalid URL (did not update)")}},[M,T,t,n]),value:M??"",onChange:_.useCallback(q=>{O(q.target.value)},[O]),onCancel:_.useCallback(q=>{T(null)},[T]),serverInvalid:x!==null,children:x!==null&&S.jsx(_9e,{children:x})}),S.jsx(qc,{as:"h3",type:"body",weight:"semibold",size:"lg",children:i("developer_mode.matrixRTCMode.title")}),S.jsxs(_3,{children:[S.jsxs(tC,{name:g,control:S.jsx(eC,{checked:h===lo.Legacy,value:lo.Legacy,onChange:y}),children:[S.jsx(cb,{children:i("developer_mode.matrixRTCMode.Legacy.label")}),S.jsx(nC,{children:i("developer_mode.matrixRTCMode.Legacy.description")})]}),S.jsxs(tC,{name:g,control:S.jsx(eC,{checked:h===lo.Compatibility,value:lo.Compatibility,onChange:y}),children:[S.jsx(cb,{children:i("developer_mode.matrixRTCMode.Comptibility.label")}),S.jsx(nC,{children:i("developer_mode.matrixRTCMode.Comptibility.description")})]}),S.jsxs(tC,{name:g,control:S.jsx(eC,{checked:h===lo.Matrix_2_0,value:lo.Matrix_2_0,disabled:!l,onChange:y}),children:[S.jsx(cb,{children:i("developer_mode.matrixRTCMode.Matrix_2_0.label")}),S.jsx(nC,{children:i("developer_mode.matrixRTCMode.Matrix_2_0.description")})]})]}),e?.map(q=>S.jsxs("div",{className:b5.livekit_room_box,children:[S.jsx("h4",{children:i("developer_mode.livekit_sfu",{url:q.url||"unknown"})}),S.jsxs("p",{children:["LivekitAlias: ",q.livekitAlias]}),S.jsxs("p",{children:["connectionState (wont hot reload): ",q.room.state]}),q.isLocal&&S.jsxs("p",{children:["ws-url: ",$?.href]}),S.jsxs("p",{children:[i("developer_mode.livekit_server_info"),"(",q.isLocal?"local":"remote",")"]}),S.jsxs("pre",{className:b5.pre,children:[q.room.serverInfo?JSON.stringify(q.room.serverInfo,null,2):"undefined",q.room.metadata]}),S.jsx("p",{children:"Local Participant"}),S.jsx("pre",{className:b5.pre,children:q.room.localParticipant.identity}),S.jsx("p",{children:"Remote Participants"}),S.jsx("ul",{children:Array.from(q.room.remoteParticipants.keys()).map(Y=>S.jsx("li",{children:Y},Y))})]})),S.jsx("p",{children:i("developer_mode.environment_variables")}),S.jsx("pre",{children:JSON.stringify(r,null,2)}),S.jsx("p",{children:i("developer_mode.url_params")}),S.jsx("pre",{children:JSON.stringify(j,null,2)})]})},iJe={BASE_URL:"./",DEV:!1,MODE:"production",PROD:!0,SSR:!1,VITE_APP_VERSION:"embedded-v0.19.0",VITE_PACKAGE:"embedded"},OD="audio",PD=({open:t,onDismiss:e,tab:n,onTabChange:r,client:i,roomId:s,livekitRooms:o})=>{const{t:a}=ze(),c=()=>{const{supported:P}=LD(),[D,j]=Ur(xle);return S.jsxs(S.Fragment,{children:[S.jsx("h4",{children:a("settings.background_blur_header")}),S.jsx(Dt,{children:S.jsx(Zn,{id:"activateBackgroundBlur",label:a("settings.background_blur_label"),description:P?"":a("settings.blur_not_supported_by_browser"),type:"checkbox",checked:!!D,onChange:$=>j($.target.checked),disabled:!P})})]})},l=pm();_.useEffect(()=>{t&&l.requestDeviceNames()},[t,l]);const[d,h]=Ur(Lle),[m,g]=_.useState(d),[y]=Ur(kle),{available:v}=NR(),{controlledAudioDevices:E}=oc(),w=je(Xle),k={key:"audio",name:a("common.audio"),content:S.jsx(S.Fragment,{children:S.jsxs(_3,{children:[!E&&S.jsx(l5,{device:l.audioInput,title:a("settings.devices.microphone"),numberedLabel:P=>a("settings.devices.microphone_numbered",{n:P})}),w&&E&&S.jsx(Ht,{onClick:P=>{P.preventDefault(),window.controls.showNativeAudioDevicePicker?.(),window.controls.showNativeOutputDevicePicker?.()},children:a("settings.devices.change_device_button")}),S.jsx(l5,{device:l.audioOutput,title:a("settings.devices.speaker"),numberedLabel:P=>a("settings.devices.speaker_numbered",{n:P})}),S.jsxs("div",{className:Ez.volumeSlider,children:[S.jsx("label",{children:a("settings.audio_tab.effect_volume_label")}),S.jsx("p",{children:a("settings.audio_tab.effect_volume_description")}),S.jsx(L9,{label:a("video_tile.volume"),value:m,onValueChange:g,onValueCommit:h,min:0,max:1,step:.01})]})]})})},x={key:"video",name:a("common.video"),content:S.jsxs(S.Fragment,{children:[S.jsx(_3,{children:S.jsx(l5,{device:l.videoInput,title:a("settings.devices.camera"),numberedLabel:P=>a("settings.devices.camera_numbered",{n:P})})}),S.jsx(j8,{}),S.jsx(c,{})]})},C={key:"preferences",name:a("common.preferences"),content:S.jsx(JGe,{})},R={key:"profile",name:a("common.profile"),content:S.jsx(dGe,{client:i})},T={key:"feedback",name:a("settings.feedback_tab_title"),content:S.jsx(hGe,{roomId:s})},M={key:"developer",name:a("settings.developer_tab_title"),content:S.jsx(rJe,{env:iJe,client:i,livekitRooms:o,roomId:s})},O=[k,x];return vt===null&&O.push(R),O.push(C),v&&O.push(T),y&&O.push(M),S.jsx(fm,{title:a("common.settings"),className:Ez.settingsModal,open:t,onDismiss:e,tabbed:!0,children:S.jsx(qKe,{label:a("common.settings"),tab:n,onTabChange:r,tabs:O})})},sJe=(t,e)=>_.createElement("svg",{width:22,height:22,viewBox:"0 0 22 22",fill:"none",xmlns:"http://www.w3.org/2000/svg",ref:e,...t},_.createElement("mask",{id:"path-1-inside-1_898_2641",fill:"white"},_.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M17.1502 20.1214C15.3946 21.3074 13.2782 22 11 22C8.52367 22 6.23845 21.1817 4.4 19.8008C1.72821 17.794 0 14.5988 0 11C0 4.92487 4.92487 0 11 0C17.0751 0 22 4.92487 22 11C22 14.797 20.0762 18.1446 17.1502 20.1214ZM11 11.55C12.8225 11.55 14.3 9.94942 14.3 7.975C14.3 6.00058 12.8225 4.4 11 4.4C9.17746 4.4 7.7 6.00058 7.7 7.975C7.7 9.94942 9.17746 11.55 11 11.55ZM11 19.8C13.3782 19.8 15.536 18.8566 17.1197 17.3237C16.1403 14.9056 13.7693 13.2 11 13.2C8.23066 13.2 5.85969 14.9056 4.88028 17.3237C6.46399 18.8566 8.62183 19.8 11 19.8Z"})),_.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M17.1502 20.1214C15.3946 21.3074 13.2782 22 11 22C8.52367 22 6.23845 21.1817 4.4 19.8008C1.72821 17.794 0 14.5988 0 11C0 4.92487 4.92487 0 11 0C17.0751 0 22 4.92487 22 11C22 14.797 20.0762 18.1446 17.1502 20.1214ZM11 11.55C12.8225 11.55 14.3 9.94942 14.3 7.975C14.3 6.00058 12.8225 4.4 11 4.4C9.17746 4.4 7.7 6.00058 7.7 7.975C7.7 9.94942 9.17746 11.55 11 11.55ZM11 19.8C13.3782 19.8 15.536 18.8566 17.1197 17.3237C16.1403 14.9056 13.7693 13.2 11 13.2C8.23066 13.2 5.85969 14.9056 4.88028 17.3237C6.46399 18.8566 8.62183 19.8 11 19.8Z",fill:"white"}),_.createElement("path",{d:"M17.1502 20.1214L17.9339 21.2814L17.1502 20.1214ZM4.4 19.8008L3.55919 20.9202H3.55919L4.4 19.8008ZM17.1197 17.3237L18.0934 18.3296L18.7717 17.6731L18.4173 16.7981L17.1197 17.3237ZM4.88028 17.3237L3.58268 16.7981L3.22829 17.6731L3.90659 18.3296L4.88028 17.3237ZM11 23.4C13.5662 23.4 15.9541 22.619 17.9339 21.2814L16.3665 18.9613C14.835 19.9959 12.9902 20.6 11 20.6V23.4ZM3.55919 20.9202C5.63176 22.477 8.21011 23.4 11 23.4V20.6C8.83723 20.6 6.84514 19.8865 5.24081 18.6814L3.55919 20.9202ZM-1.4 11C-1.4 15.0577 0.55052 18.6603 3.55919 20.9202L5.24081 18.6814C2.90591 16.9276 1.4 14.1399 1.4 11H-1.4ZM11 -1.4C4.15167 -1.4 -1.4 4.15167 -1.4 11H1.4C1.4 5.69807 5.69807 1.4 11 1.4V-1.4ZM23.4 11C23.4 4.15167 17.8483 -1.4 11 -1.4V1.4C16.3019 1.4 20.6 5.69807 20.6 11H23.4ZM17.9339 21.2814C21.2288 19.0554 23.4 15.2815 23.4 11H20.6C20.6 14.3124 18.9236 17.2337 16.3665 18.9613L17.9339 21.2814ZM12.9 7.975C12.9 9.28384 11.9459 10.15 11 10.15V12.95C13.6991 12.95 15.7 10.615 15.7 7.975H12.9ZM11 5.8C11.9459 5.8 12.9 6.66616 12.9 7.975H15.7C15.7 5.335 13.6991 3 11 3V5.8ZM9.1 7.975C9.1 6.66616 10.0541 5.8 11 5.8V3C8.30086 3 6.3 5.335 6.3 7.975H9.1ZM11 10.15C10.0541 10.15 9.1 9.28384 9.1 7.975H6.3C6.3 10.615 8.30086 12.95 11 12.95V10.15ZM16.146 16.3178C14.8129 17.6081 13.0004 18.4 11 18.4V21.2C13.756 21.2 16.2591 20.1051 18.0934 18.3296L16.146 16.3178ZM11 14.6C13.1797 14.6 15.0494 15.9415 15.8221 17.8493L18.4173 16.7981C17.2312 13.8697 14.359 11.8 11 11.8V14.6ZM6.17788 17.8493C6.95058 15.9415 8.8203 14.6 11 14.6V11.8C7.64102 11.8 4.7688 13.8697 3.58268 16.7981L6.17788 17.8493ZM11 18.4C8.99963 18.4 7.18709 17.6081 5.85397 16.3178L3.90659 18.3296C5.74088 20.1051 8.24402 21.2 11 21.2V18.4Z",fill:"white",mask:"url(#path-1-inside-1_898_2641)"})),$W=_.forwardRef(sJe),oJe=(t,e)=>_.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",ref:e,...t},_.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M20.0988 9.01625C20.3188 9.59375 20.8825 9.97875 21.5013 9.97875C22.3263 9.97875 23 10.6525 23 11.4775V12.5225C23 13.3475 22.3263 14.0213 21.5013 14.0213C20.8825 14.0213 20.3188 14.4062 20.0988 14.9838C20.0806 15.0292 20.0624 15.0753 20.0441 15.1218C19.9792 15.2863 19.9125 15.4555 19.8375 15.6163C19.5763 16.18 19.7 16.84 20.14 17.28C20.7313 17.8575 20.7313 18.8062 20.14 19.3975L19.3975 20.14C18.82 20.7313 17.8713 20.7313 17.28 20.14C16.8538 19.7 16.18 19.5763 15.6163 19.8375C15.41 19.9338 15.2037 20.0163 14.9838 20.0988C14.4062 20.3188 14.0213 20.8825 14.0213 21.5013C14.0213 22.3263 13.3475 23 12.5225 23H11.4775C10.6525 23 9.97875 22.3263 9.97875 21.5013C9.97875 20.8825 9.59375 20.3188 9.01625 20.0988C8.97079 20.0806 8.92466 20.0624 8.87815 20.044C8.71368 19.9792 8.54454 19.9125 8.38375 19.8375C7.82 19.5763 7.16 19.7 6.72 20.14C6.1425 20.7313 5.19375 20.7313 4.6025 20.14L3.86 19.3975C3.26875 18.82 3.26875 17.8713 3.86 17.28C4.3 16.8538 4.42375 16.18 4.1625 15.6163C4.06625 15.41 3.98375 15.2037 3.90125 14.9838C3.68125 14.4062 3.1175 14.0213 2.49875 14.0213C1.67375 14.0213 1 13.3475 1 12.5225V11.4775C1 10.6525 1.67375 9.97875 2.49875 9.97875C3.1175 9.97875 3.68125 9.59375 3.90125 9.01625C3.94464 8.87742 3.99897 8.74406 4.0539 8.60926C4.086 8.53046 4.11831 8.45117 4.14875 8.37C4.41 7.80625 4.28625 7.14625 3.84625 6.70625C3.255 6.12875 3.255 5.18 3.84625 4.58875L4.6025 3.86C5.18 3.26875 6.12875 3.26875 6.72 3.86C7.14625 4.3 7.82 4.42375 8.38375 4.1625C8.59 4.06625 8.79625 3.97 9.01625 3.90125C9.59375 3.68125 9.97875 3.1175 9.97875 2.49875C9.97875 1.67375 10.6525 1 11.4775 1H12.5225C13.3475 1 14.0213 1.67375 14.0213 2.49875C14.0213 3.13125 14.4062 3.68125 14.9838 3.90125C15.0292 3.91943 15.0753 3.93762 15.1218 3.95595C15.2863 4.02079 15.4555 4.08746 15.6163 4.1625C16.18 4.42375 16.84 4.3 17.28 3.86C17.8575 3.26875 18.8062 3.26875 19.3975 3.86L20.14 4.6025C20.7313 5.18 20.7313 6.12875 20.14 6.72C19.7 7.14625 19.5763 7.82 19.8375 8.38375C19.9338 8.59 20.0163 8.79625 20.0988 9.01625ZM12 17.5C8.96125 17.5 6.5 15.0387 6.5 12C6.5 8.96125 8.96125 6.5 12 6.5C15.0387 6.5 17.5 8.96125 17.5 12C17.5 15.0387 15.0387 17.5 12 17.5Z",fill:"#ffffff"})),aJe=_.forwardRef(oJe),cJe=(t,e)=>_.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",ref:e,...t},_.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M7.49966 2.38889C7.49966 1.89797 7.89763 1.5 8.38855 1.5H20.1108C20.6017 1.5 20.9997 1.89797 20.9997 2.38889V21.6111C20.9997 22.102 20.6017 22.5 20.1108 22.5H8.38855C7.89763 22.5 7.49966 22.102 7.49966 21.6111V12.6667H7.49089H7.4821H7.47331H7.46452H7.45573H7.44694H7.43815H7.42936H7.42057H7.41178H7.403H7.39421H7.38542H7.37663H7.36784H7.35905H7.35026H7.34147H7.33268H7.32389H7.3151H7.30632H7.29753H7.28874H7.27995H7.27116H7.26237H7.25358H7.24479H7.236H7.22721H7.21842H7.20964H7.20085H7.19206H7.18327H7.17448H7.16569H7.1569H7.14811H7.13932H7.13053H7.12175H7.11296H7.10417H7.09538H7.08659H7.0778H7.06901H7.06022H7.05143H7.04264H7.03385H7.02507H7.01628H7.00749H6.9987H6.98991H6.98112H6.97233H6.96354H6.95475H6.94596H6.93717H6.92839H6.9196H6.91081H6.90202H6.89323H6.88444H6.87565H6.86686H6.85807H6.84928H6.8405H6.83171H6.82292H6.81413H6.80534H6.79655H6.78776H6.77897H6.77018H6.76139H6.7526H6.74382H6.73503H6.72624H6.71745H6.70866H6.69987H6.69108H6.68229H6.6735H6.66471H6.65592H6.64714H6.63835H6.62956H6.62077H6.61198H6.60319H6.5944H6.58561H6.57682H6.56803H6.55925H6.55046H6.54167H6.53288H6.52409H6.5153H6.50651H6.49772H6.48893H6.48014H6.47135H6.46257H6.45378H6.44499H6.4362H6.42741H6.41862H6.40983H6.40104H6.39225H6.38346H6.37467H6.36589H6.3571H6.34831H6.33952H6.33073H6.32194H6.31315H6.30436H6.29557H6.28678H6.27799H6.26921H6.26042H6.25163H6.24284H6.23405H6.22526H6.21647H6.20768H6.19889H6.1901H6.18132H6.17253H6.16374H6.15495H6.14616H6.13737H6.12858H6.11979H6.111H6.10221H6.09342H6.08464H6.07585H6.06706H6.05827H6.04948H6.04069H6.0319H6.02311H6.01432H6.00553H5.99674H5.98796H5.97917H5.97038H5.96159H5.9528H5.94401H5.93522H5.92643H5.91764H5.90885H5.90007H5.89128H5.88249H5.8737H5.86491H5.85612H5.84733H5.83854H5.82975H5.82096H5.81217H5.80339H5.7946H5.78581H5.77702H5.76823H5.75944H5.75065H5.74186H5.73307H5.72428H5.71549H5.70671H5.69792H5.68913H5.68034H5.67155H5.66276H5.65397H5.64518H5.63639H5.6276H5.61882H5.61003H5.60124H5.59245H5.58366H5.57487H5.56608H5.55729H5.5485H5.53971H5.53092H5.52214H5.51335H5.50456H5.49577H5.48698H5.47819H5.4694H5.46061H5.45182H5.44303H5.43424H5.42546H5.41667H5.40788H5.39909H5.3903H5.38151H5.37272H5.36393H5.35514H5.34635H5.33757H5.32878H5.31999H5.3112H5.30241H5.29362H5.28483H5.27604H5.26725H5.25846H5.24967H5.24089H5.2321H5.22331H5.21452H5.20573H5.19694H5.18815H5.17936H5.17057H5.16178H5.15299H5.14421H5.13542H5.12663H5.11784H5.10905H5.10026H5.09147H5.08268H5.07389H5.0651H5.05632H5.04753H5.03874H5.02995H5.02116H5.01237H5.00358H4.99479H4.986H4.97721H4.96842H4.95964H4.95085H4.94206H4.93327H4.92448H4.91569H4.9069H4.89811H4.88932H4.88053H4.87174H4.86296H4.85417H4.84538H4.83659H4.8278H4.81901H4.81022H4.80143H4.79264H4.78385H4.77507H4.76628H4.75749H4.7487H4.73991H4.73112H4.72233H4.71354H4.70475H4.69596H4.68717H4.67839H4.6696H4.66081H4.65202H4.64323H4.63444H4.62565H4.61686H4.60807H4.59928H4.59049H4.58171H4.57292H4.56413H4.55534H4.54655H4.53776H4.52897H4.52018H4.51139H4.5026H4.49382H4.48503H4.47624H4.46745H4.45866H4.44987H4.44108H4.43229H4.4235H4.41471H4.40592H4.39714H4.38835H4.37956H4.37077H4.36198H4.35319H4.3444H4.33561H4.32682H4.31803H4.30924H4.30046H4.29167H4.28288H4.27409H4.2653H4.25651H4.24772H4.23893H4.23014H4.22135H4.21257H4.20378H4.19499H4.1862H4.17741H4.16862H4.15983H4.15104H4.14225H4.13346H4.12467H4.11589H4.1071H4.09831H4.08952H4.08073H4.07194H4.06315H4.05436H4.04557H4.03678H4.02799H4.01921H4.01042H4.00163H3.99284H3.98405H3.97526H3.96647H3.95768H3.94889H3.9401H3.93132H3.92253H3.91374H3.90495H3.89616H3.88737H3.87858H3.86979H3.861H3.85221H3.84342H3.83464H3.82585H3.81706H3.80827H3.79948H3.79069H3.7819H3.77311H3.76432H3.75553H3.74674H3.73796H3.72917H3.72038H3.71159H3.7028H3.69401H3.68522H3.67643H3.66764H3.65885H3.65007H3.64128H3.63249H3.6237H3.61491H3.60612H3.59733H3.58854H3.57975H3.57096H3.56217H3.55339H3.5446H3.53581H3.52702H3.51823H3.50944H3.50065H3.49186H3.48307H3.47428H3.46549H3.45671H3.44792H3.43913H3.43034H3.42155H3.41276H3.40397H3.39518H3.38639H3.3776H3.36882H3.36003H3.35124H3.34245H3.33366H3.32487H3.31608H3.30729H3.2985H3.28971H3.28092H3.27214H3.26335H3.25456H3.24577H3.23698H3.22819H3.2194H3.21061H3.20182H3.19303H3.18424H3.17546H3.16667H3.15788H3.14909H3.1403H3.13151H3.12272H3.11393H3.10514H3.09635H3.08757H3.07878H3.06999H3.0612H3.05241H3.04362H3.03483H3.02604H3.01725H3.00846H2.99967C2.63148 12.6667 2.33301 12.3682 2.33301 12C2.33301 11.6318 2.63148 11.3333 2.99967 11.3333H3.00846H3.01725H3.02604H3.03483H3.04362H3.05241H3.0612H3.06999H3.07878H3.08757H3.09635H3.10514H3.11393H3.12272H3.13151H3.1403H3.14909H3.15788H3.16667H3.17546H3.18424H3.19303H3.20182H3.21061H3.2194H3.22819H3.23698H3.24577H3.25456H3.26335H3.27214H3.28092H3.28971H3.2985H3.30729H3.31608H3.32487H3.33366H3.34245H3.35124H3.36003H3.36882H3.3776H3.38639H3.39518H3.40397H3.41276H3.42155H3.43034H3.43913H3.44792H3.45671H3.46549H3.47428H3.48307H3.49186H3.50065H3.50944H3.51823H3.52702H3.53581H3.5446H3.55339H3.56217H3.57096H3.57975H3.58854H3.59733H3.60612H3.61491H3.6237H3.63249H3.64128H3.65007H3.65885H3.66764H3.67643H3.68522H3.69401H3.7028H3.71159H3.72038H3.72917H3.73796H3.74674H3.75553H3.76432H3.77311H3.7819H3.79069H3.79948H3.80827H3.81706H3.82585H3.83464H3.84342H3.85221H3.861H3.86979H3.87858H3.88737H3.89616H3.90495H3.91374H3.92253H3.93132H3.9401H3.94889H3.95768H3.96647H3.97526H3.98405H3.99284H4.00163H4.01042H4.01921H4.02799H4.03678H4.04557H4.05436H4.06315H4.07194H4.08073H4.08952H4.09831H4.1071H4.11589H4.12467H4.13346H4.14225H4.15104H4.15983H4.16862H4.17741H4.1862H4.19499H4.20378H4.21257H4.22135H4.23014H4.23893H4.24772H4.25651H4.2653H4.27409H4.28288H4.29167H4.30046H4.30924H4.31803H4.32682H4.33561H4.3444H4.35319H4.36198H4.37077H4.37956H4.38835H4.39714H4.40592H4.41471H4.4235H4.43229H4.44108H4.44987H4.45866H4.46745H4.47624H4.48503H4.49382H4.5026H4.51139H4.52018H4.52897H4.53776H4.54655H4.55534H4.56413H4.57292H4.58171H4.59049H4.59928H4.60807H4.61686H4.62565H4.63444H4.64323H4.65202H4.66081H4.6696H4.67839H4.68717H4.69596H4.70475H4.71354H4.72233H4.73112H4.73991H4.7487H4.75749H4.76628H4.77507H4.78385H4.79264H4.80143H4.81022H4.81901H4.8278H4.83659H4.84538H4.85417H4.86296H4.87174H4.88053H4.88932H4.89811H4.9069H4.91569H4.92448H4.93327H4.94206H4.95085H4.95964H4.96842H4.97721H4.986H4.99479H5.00358H5.01237H5.02116H5.02995H5.03874H5.04753H5.05631H5.0651H5.07389H5.08268H5.09147H5.10026H5.10905H5.11784H5.12663H5.13542H5.14421H5.15299H5.16178H5.17057H5.17936H5.18815H5.19694H5.20573H5.21452H5.22331H5.2321H5.24089H5.24967H5.25846H5.26725H5.27604H5.28483H5.29362H5.30241H5.3112H5.31999H5.32878H5.33757H5.34635H5.35514H5.36393H5.37272H5.38151H5.3903H5.39909H5.40788H5.41667H5.42546H5.43424H5.44303H5.45182H5.46061H5.4694H5.47819H5.48698H5.49577H5.50456H5.51335H5.52214H5.53092H5.53971H5.5485H5.55729H5.56608H5.57487H5.58366H5.59245H5.60124H5.61003H5.61882H5.6276H5.63639H5.64518H5.65397H5.66276H5.67155H5.68034H5.68913H5.69792H5.70671H5.71549H5.72428H5.73307H5.74186H5.75065H5.75944H5.76823H5.77702H5.78581H5.7946H5.80339H5.81217H5.82096H5.82975H5.83854H5.84733H5.85612H5.86491H5.8737H5.88249H5.89128H5.90007H5.90885H5.91764H5.92643H5.93522H5.94401H5.9528H5.96159H5.97038H5.97917H5.98796H5.99674H6.00553H6.01432H6.02311H6.0319H6.04069H6.04948H6.05827H6.06706H6.07585H6.08464H6.09342H6.10221H6.111H6.11979H6.12858H6.13737H6.14616H6.15495H6.16374H6.17253H6.18132H6.1901H6.19889H6.20768H6.21647H6.22526H6.23405H6.24284H6.25163H6.26042H6.26921H6.27799H6.28678H6.29557H6.30436H6.31315H6.32194H6.33073H6.33952H6.34831H6.3571H6.36589H6.37467H6.38346H6.39225H6.40104H6.40983H6.41862H6.42741H6.4362H6.44499H6.45378H6.46257H6.47135H6.48014H6.48893H6.49772H6.50651H6.5153H6.52409H6.53288H6.54167H6.55046H6.55925H6.56803H6.57682H6.58561H6.5944H6.60319H6.61198H6.62077H6.62956H6.63835H6.64714H6.65592H6.66471H6.6735H6.68229H6.69108H6.69987H6.70866H6.71745H6.72624H6.73503H6.74382H6.7526H6.76139H6.77018H6.77897H6.78776H6.79655H6.80534H6.81413H6.82292H6.83171H6.8405H6.84928H6.85807H6.86686H6.87565H6.88444H6.89323H6.90202H6.91081H6.9196H6.92839H6.93717H6.94596H6.95475H6.96354H6.97233H6.98112H6.98991H6.9987H7.00749H7.01628H7.02507H7.03385H7.04264H7.05143H7.06022H7.06901H7.0778H7.08659H7.09538H7.10417H7.11296H7.12175H7.13053H7.13932H7.14811H7.1569H7.16569H7.17448H7.18327H7.19206H7.20085H7.20964H7.21842H7.22721H7.236H7.24479H7.25358H7.26237H7.27116H7.27995H7.28874H7.29753H7.30632H7.3151H7.32389H7.33268H7.34147H7.35026H7.35905H7.36784H7.37663H7.38542H7.39421H7.403H7.41178H7.42057H7.42936H7.43815H7.44694H7.45573H7.46452H7.47331H7.4821H7.49089H7.49966V2.38889ZM13.3687 6.24853C13.1172 5.9796 12.7095 5.9796 12.458 6.24853C12.2065 6.51747 12.2065 6.9535 12.458 7.22243L16.3022 11.3336L16.2894 11.3336L16.2726 11.3336L16.2558 11.3336L16.239 11.3335L16.2223 11.3335L16.2055 11.3335L16.1887 11.3335L16.1719 11.3335L16.1552 11.3334L16.1384 11.3334L16.1216 11.3334L16.1048 11.3334L16.088 11.3334L16.0713 11.3333L16.0545 11.3333L16.0377 11.3333L16.0209 11.3333L16.0041 11.3333L15.9874 11.3332L15.9706 11.3332L15.9538 11.3332L15.937 11.3332L15.9202 11.3332L15.9035 11.3331L15.8867 11.3331L15.8699 11.3331L15.8531 11.3331L15.8364 11.3331L15.8196 11.333L15.8028 11.333L15.786 11.333L15.7692 11.333L15.7525 11.333L15.7357 11.3329L15.7189 11.3329L15.7021 11.3329L15.6853 11.3329L15.6686 11.3329L15.6518 11.3328L15.635 11.3328L15.6182 11.3328L15.6014 11.3328L15.5847 11.3328L15.5679 11.3327L15.5511 11.3327L15.5343 11.3327L15.5175 11.3327L15.5008 11.3327L15.484 11.3326L15.4672 11.3326L15.4504 11.3326L15.4337 11.3326L15.4169 11.3326L15.4001 11.3325L15.3833 11.3325L15.3665 11.3325L15.3498 11.3325L15.333 11.3324L15.3162 11.3324L15.2994 11.3324L15.2826 11.3324L15.2659 11.3324L15.2491 11.3323L15.2323 11.3323L15.2155 11.3323L15.1987 11.3323L15.182 11.3323L15.1652 11.3322L15.1484 11.3322L15.1316 11.3322L15.1148 11.3322L15.0981 11.3322L15.0813 11.3321L15.0645 11.3321L15.0477 11.3321L15.031 11.3321L15.0142 11.3321L14.9974 11.332L14.9806 11.332L14.9638 11.332L14.9471 11.332L14.9303 11.332L14.9135 11.3319L14.8967 11.3319L14.8799 11.3319L14.8632 11.3319L14.8464 11.3319L14.8296 11.3318L14.8128 11.3318L14.796 11.3318L14.7793 11.3318L14.7625 11.3318L14.7457 11.3317L14.7289 11.3317L14.7122 11.3317L14.6954 11.3317L14.6786 11.3317L14.6618 11.3316L14.645 11.3316L14.6283 11.3316L14.6115 11.3316L14.5947 11.3316L14.5779 11.3315L14.5611 11.3315L14.5444 11.3315L14.5276 11.3315L14.5108 11.3315L14.494 11.3314L14.4772 11.3314L14.4605 11.3314L14.4437 11.3314L14.4269 11.3314L14.4101 11.3313L14.3933 11.3313L14.3766 11.3313L14.3598 11.3313L14.343 11.3313L14.3262 11.3312L14.3095 11.3312L14.2927 11.3312L14.2759 11.3312L14.2591 11.3312L14.2423 11.3311L14.2256 11.3311L14.2088 11.3311L14.192 11.3311L14.1752 11.3311L14.1584 11.331L14.1417 11.331L14.1249 11.331L14.1081 11.331L14.0913 11.331L14.0745 11.3309L14.0578 11.3309L14.041 11.3309L14.0242 11.3309L14.0074 11.3309L13.9906 11.3308L13.9739 11.3308L13.9571 11.3308L13.9403 11.3308L13.9235 11.3308L13.9068 11.3307L13.89 11.3307L13.8732 11.3307L13.8564 11.3307L13.8396 11.3307L13.8229 11.3306L13.8061 11.3306L13.7893 11.3306L13.7725 11.3306L13.7557 11.3306L13.739 11.3305L13.7222 11.3305L13.7054 11.3305L13.6886 11.3305L13.6718 11.3305L13.6551 11.3304L13.6383 11.3304L13.6215 11.3304L13.6047 11.3304L13.5879 11.3304L13.5712 11.3303L13.5544 11.3303L13.5376 11.3303L13.5208 11.3303L13.5041 11.3303L13.4873 11.3302L13.4705 11.3302L13.4537 11.3302L13.4369 11.3302L13.4202 11.3302L13.4034 11.3301L13.3866 11.3301L13.3698 11.3301L13.353 11.3301L13.3363 11.33L13.3195 11.33L13.3027 11.33L13.2859 11.33L13.2691 11.33L13.2524 11.3299L13.2356 11.3299L13.2188 11.3299L13.202 11.3299L13.1853 11.3299L13.1685 11.3298L13.1517 11.3298L13.1349 11.3298L13.1181 11.3298L13.1014 11.3298L13.0846 11.3297L13.0678 11.3297L13.051 11.3297L13.0342 11.3297L13.0175 11.3297L13.0007 11.3296L12.9839 11.3296L12.9671 11.3296L12.9503 11.3296L12.9336 11.3296L12.9168 11.3295L12.9 11.3295L12.8832 11.3295L12.8664 11.3295L12.8497 11.3295L12.8329 11.3294L12.8161 11.3294L12.7993 11.3294L12.7826 11.3294L12.7658 11.3294L12.749 11.3293L12.7322 11.3293L12.7154 11.3293L12.6987 11.3293L12.6819 11.3293L12.6651 11.3292L12.6483 11.3292L12.6315 11.3292L12.6148 11.3292L12.598 11.3292L12.5812 11.3291L12.5644 11.3291L12.5476 11.3291L12.5309 11.3291L12.5141 11.3291L12.4973 11.329L12.4805 11.329L12.4637 11.329L12.447 11.329L12.4302 11.329L12.4134 11.3289L12.3966 11.3289L12.3799 11.3289L12.3631 11.3289L12.3463 11.3289L12.3295 11.3288L12.3127 11.3288L12.296 11.3288L12.2792 11.3288L12.2624 11.3288L12.2456 11.3287L12.2288 11.3287L12.2121 11.3287L12.1953 11.3287L12.1785 11.3287L12.1617 11.3286L12.1449 11.3286L12.1282 11.3286L12.1114 11.3286L12.0946 11.3286L12.0778 11.3285L12.0611 11.3285L12.0443 11.3285L12.0275 11.3285L12.0107 11.3285L11.9939 11.3284L11.9772 11.3284L11.9604 11.3284L11.9436 11.3284L11.9268 11.3284L11.91 11.3283L11.8933 11.3283L11.8765 11.3283L11.8597 11.3283L11.8429 11.3283L11.8261 11.3282L11.8094 11.3282L11.7926 11.3282L11.7758 11.3282L11.759 11.3282L11.7422 11.3281L11.7255 11.3281L11.7087 11.3281L11.6919 11.3281L11.6751 11.3281L11.6583 11.328L11.6416 11.328L11.6248 11.328L11.608 11.328L11.5912 11.328L11.5745 11.3279L11.5577 11.3279L11.5409 11.3279L11.5241 11.3279L11.5073 11.3279L11.4906 11.3278L11.4738 11.3278L11.457 11.3278L11.4402 11.3278L11.4234 11.3278L11.4067 11.3277L11.3899 11.3277L11.3731 11.3277L11.3563 11.3277L11.3395 11.3277L11.3228 11.3276L11.306 11.3276L11.2892 11.3276L11.2724 11.3276L11.2557 11.3275L11.2389 11.3275L11.2221 11.3275L11.2053 11.3275L11.1885 11.3275L11.1718 11.3274L11.155 11.3274L11.1382 11.3274L11.1214 11.3274L11.1046 11.3274L11.0879 11.3273L11.0711 11.3273L11.0543 11.3273L11.0375 11.3273L11.0207 11.3273L11.004 11.3272L10.9872 11.3272L10.9704 11.3272L10.9536 11.3272L10.9368 11.3272L10.9201 11.3271L10.9033 11.3271L10.8865 11.3271L10.8697 11.3271L10.853 11.3271L10.8362 11.327L10.8194 11.327L10.8026 11.327L10.7858 11.327L10.7691 11.327L10.7523 11.3269L10.7355 11.3269L10.7187 11.3269L10.7019 11.3269L10.6852 11.3269L10.6684 11.3268L10.6516 11.3268L10.6348 11.3268L10.618 11.3268L10.6013 11.3268L10.5845 11.3267L10.5677 11.3267L10.5509 11.3267L10.5341 11.3267L10.5174 11.3267L10.5006 11.3266L10.4838 11.3266L10.467 11.3266L10.4503 11.3266L10.4335 11.3266L10.4167 11.3265L10.3999 11.3265L10.3831 11.3265L10.3664 11.3265L10.3496 11.3265L10.3328 11.3264L10.316 11.3264L10.2992 11.3264L10.2825 11.3264L10.2657 11.3264L10.2489 11.3263L10.2321 11.3263L10.2153 11.3263L10.1986 11.3263L10.1818 11.3263L10.165 11.3262L10.1482 11.3262L10.1315 11.3262L10.1147 11.3262L10.0979 11.3262L10.0811 11.3261L10.0643 11.3261L10.0476 11.3261L10.0308 11.3261L10.014 11.3261L9.99722 11.326L9.98044 11.326L9.96366 11.326L9.94688 11.326L9.9301 11.326L9.91332 11.3259L9.89654 11.3259L9.87977 11.3259L9.86299 11.3259L9.84621 11.3259L9.82943 11.3258L9.81265 11.3258L9.79587 11.3258L9.77909 11.3258L9.76231 11.3258L9.74553 11.3257L9.72875 11.3257L9.71197 11.3257L9.69519 11.3257L9.67841 11.3257L9.66163 11.3256L9.64486 11.3256L9.62808 11.3256L9.6113 11.3256L9.59452 11.3256L9.57774 11.3255L9.56096 11.3255L9.54418 11.3255L9.5274 11.3255L9.51062 11.3255L9.49384 11.3254L9.47706 11.3254L9.46029 11.3254L9.44351 11.3254L9.42673 11.3254L9.40995 11.3253L9.39317 11.3253L9.37639 11.3253L9.35961 11.3253L9.34283 11.3253L9.32605 11.3252L9.30927 11.3252L9.29249 11.3252L9.27572 11.3252L9.25894 11.3252L9.24216 11.3251L9.22538 11.3251L9.2086 11.3251L9.19182 11.3251L9.17504 11.325L9.15826 11.325L9.14148 11.325L9.1247 11.325L9.10792 11.325L9.09115 11.3249L9.07437 11.3249L9.05759 11.3249L9.04081 11.3249L9.02403 11.3249L9.00725 11.3248L8.99047 11.3248L8.97369 11.3248L8.95691 11.3248L8.94013 11.3248L8.92335 11.3247L8.90658 11.3247L8.8898 11.3247L8.87302 11.3247L8.85624 11.3247L8.83946 11.3246L8.82268 11.3246L8.8059 11.3246L8.78912 11.3246L8.77234 11.3246L8.75556 11.3245L8.73878 11.3245L8.722 11.3245L8.70523 11.3245L8.68845 11.3245L8.67167 11.3244L8.65489 11.3244L8.63811 11.3244L8.62133 11.3244L8.60455 11.3244L8.58777 11.3243L8.57099 11.3243L8.55421 11.3243L8.53743 11.3243L8.52066 11.3243L8.50388 11.3242L8.4871 11.3242L8.47032 11.3242L8.45354 11.3242L8.43676 11.3242L8.41998 11.3241L8.4032 11.3241L8.38642 11.3241L8.36964 11.3241L8.35286 11.3241L8.33608 11.324L8.31931 11.324L8.30253 11.324L8.28575 11.324L8.26897 11.324L8.25219 11.3239L8.23541 11.3239L8.21863 11.3239L8.20185 11.3239L8.18507 11.3239L8.16829 11.3238L8.15151 11.3238L8.13474 11.3238L8.11796 11.3238L8.10118 11.3238L8.0844 11.3237L8.06762 11.3237L8.05084 11.3237L8.03406 11.3237L8.01728 11.3237L8.0005 11.3236L7.99885 12.657L8.01563 12.657L8.03241 12.657L8.04919 12.657L8.06597 12.6571L8.08274 12.6571L8.09952 12.6571L8.1163 12.6571L8.13308 12.6571L8.14986 12.6572L8.16664 12.6572L8.18342 12.6572L8.2002 12.6572L8.21698 12.6572L8.23376 12.6573L8.25054 12.6573L8.26731 12.6573L8.28409 12.6573L8.30087 12.6573L8.31765 12.6574L8.33443 12.6574L8.35121 12.6574L8.36799 12.6574L8.38477 12.6574L8.40155 12.6575L8.41833 12.6575L8.43511 12.6575L8.45189 12.6575L8.46866 12.6575L8.48544 12.6576L8.50222 12.6576L8.519 12.6576L8.53578 12.6576L8.55256 12.6576L8.56934 12.6577L8.58612 12.6577L8.6029 12.6577L8.61968 12.6577L8.63646 12.6577L8.65323 12.6578L8.67001 12.6578L8.68679 12.6578L8.70357 12.6578L8.72035 12.6578L8.73713 12.6579L8.75391 12.6579L8.77069 12.6579L8.78747 12.6579L8.80425 12.6579L8.82103 12.658L8.83781 12.658L8.85458 12.658L8.87136 12.658L8.88814 12.658L8.90492 12.6581L8.9217 12.6581L8.93848 12.6581L8.95526 12.6581L8.97204 12.6581L8.98882 12.6582L9.0056 12.6582L9.02238 12.6582L9.03915 12.6582L9.05593 12.6582L9.07271 12.6583L9.08949 12.6583L9.10627 12.6583L9.12305 12.6583L9.13983 12.6583L9.15661 12.6584L9.17339 12.6584L9.19017 12.6584L9.20695 12.6584L9.22373 12.6584L9.2405 12.6585L9.25728 12.6585L9.27406 12.6585L9.29084 12.6585L9.30762 12.6585L9.3244 12.6586L9.34118 12.6586L9.35796 12.6586L9.37474 12.6586L9.39152 12.6586L9.4083 12.6587L9.42507 12.6587L9.44185 12.6587L9.45863 12.6587L9.47541 12.6587L9.49219 12.6588L9.50897 12.6588L9.52575 12.6588L9.54253 12.6588L9.55931 12.6588L9.57609 12.6589L9.59287 12.6589L9.60964 12.6589L9.62642 12.6589L9.6432 12.6589L9.65998 12.659L9.67676 12.659L9.69354 12.659L9.71032 12.659L9.7271 12.659L9.74388 12.6591L9.76066 12.6591L9.77744 12.6591L9.79421 12.6591L9.81099 12.6591L9.82777 12.6592L9.84455 12.6592L9.86133 12.6592L9.87811 12.6592L9.89489 12.6592L9.91167 12.6593L9.92845 12.6593L9.94523 12.6593L9.96201 12.6593L9.97879 12.6594L9.99556 12.6594L10.0123 12.6594L10.0291 12.6594L10.0459 12.6594L10.0627 12.6595L10.0795 12.6595L10.0962 12.6595L10.113 12.6595L10.1298 12.6595L10.1466 12.6596L10.1634 12.6596L10.1801 12.6596L10.1969 12.6596L10.2137 12.6596L10.2305 12.6597L10.2473 12.6597L10.264 12.6597L10.2808 12.6597L10.2976 12.6597L10.3144 12.6598L10.3311 12.6598L10.3479 12.6598L10.3647 12.6598L10.3815 12.6598L10.3983 12.6599L10.415 12.6599L10.4318 12.6599L10.4486 12.6599L10.4654 12.6599L10.4822 12.66L10.4989 12.66L10.5157 12.66L10.5325 12.66L10.5493 12.66L10.5661 12.6601L10.5828 12.6601L10.5996 12.6601L10.6164 12.6601L10.6332 12.6601L10.65 12.6602L10.6667 12.6602L10.6835 12.6602L10.7003 12.6602L10.7171 12.6602L10.7338 12.6603L10.7506 12.6603L10.7674 12.6603L10.7842 12.6603L10.801 12.6603L10.8177 12.6604L10.8345 12.6604L10.8513 12.6604L10.8681 12.6604L10.8849 12.6604L10.9016 12.6605L10.9184 12.6605L10.9352 12.6605L10.952 12.6605L10.9688 12.6605L10.9855 12.6606L11.0023 12.6606L11.0191 12.6606L11.0359 12.6606L11.0526 12.6606L11.0694 12.6607L11.0862 12.6607L11.103 12.6607L11.1198 12.6607L11.1365 12.6607L11.1533 12.6608L11.1701 12.6608L11.1869 12.6608L11.2037 12.6608L11.2204 12.6608L11.2372 12.6609L11.254 12.6609L11.2708 12.6609L11.2876 12.6609L11.3043 12.6609L11.3211 12.661L11.3379 12.661L11.3547 12.661L11.3715 12.661L11.3882 12.661L11.405 12.6611L11.4218 12.6611L11.4386 12.6611L11.4553 12.6611L11.4721 12.6611L11.4889 12.6612L11.5057 12.6612L11.5225 12.6612L11.5392 12.6612L11.556 12.6612L11.5728 12.6613L11.5896 12.6613L11.6064 12.6613L11.6231 12.6613L11.6399 12.6613L11.6567 12.6614L11.6735 12.6614L11.6903 12.6614L11.707 12.6614L11.7238 12.6614L11.7406 12.6615L11.7574 12.6615L11.7742 12.6615L11.7909 12.6615L11.8077 12.6615L11.8245 12.6616L11.8413 12.6616L11.858 12.6616L11.8748 12.6616L11.8916 12.6616L11.9084 12.6617L11.9252 12.6617L11.9419 12.6617L11.9587 12.6617L11.9755 12.6617L11.9923 12.6618L12.0091 12.6618L12.0258 12.6618L12.0426 12.6618L12.0594 12.6618L12.0762 12.6619L12.093 12.6619L12.1097 12.6619L12.1265 12.6619L12.1433 12.662L12.1601 12.662L12.1768 12.662L12.1936 12.662L12.2104 12.662L12.2272 12.6621L12.244 12.6621L12.2607 12.6621L12.2775 12.6621L12.2943 12.6621L12.3111 12.6622L12.3279 12.6622L12.3446 12.6622L12.3614 12.6622L12.3782 12.6622L12.395 12.6623L12.4118 12.6623L12.4285 12.6623L12.4453 12.6623L12.4621 12.6623L12.4789 12.6624L12.4957 12.6624L12.5124 12.6624L12.5292 12.6624L12.546 12.6624L12.5628 12.6625L12.5795 12.6625L12.5963 12.6625L12.6131 12.6625L12.6299 12.6625L12.6467 12.6626L12.6634 12.6626L12.6802 12.6626L12.697 12.6626L12.7138 12.6626L12.7306 12.6627L12.7473 12.6627L12.7641 12.6627L12.7809 12.6627L12.7977 12.6627L12.8145 12.6628L12.8312 12.6628L12.848 12.6628L12.8648 12.6628L12.8816 12.6628L12.8984 12.6629L12.9151 12.6629L12.9319 12.6629L12.9487 12.6629L12.9655 12.6629L12.9822 12.663L12.999 12.663L13.0158 12.663L13.0326 12.663L13.0494 12.663L13.0661 12.6631L13.0829 12.6631L13.0997 12.6631L13.1165 12.6631L13.1333 12.6631L13.15 12.6632L13.1668 12.6632L13.1836 12.6632L13.2004 12.6632L13.2172 12.6632L13.2339 12.6633L13.2507 12.6633L13.2675 12.6633L13.2843 12.6633L13.3011 12.6633L13.3178 12.6634L13.3346 12.6634L13.3514 12.6634L13.3682 12.6634L13.3849 12.6634L13.4017 12.6635L13.4185 12.6635L13.4353 12.6635L13.4521 12.6635L13.4688 12.6635L13.4856 12.6636L13.5024 12.6636L13.5192 12.6636L13.536 12.6636L13.5527 12.6636L13.5695 12.6637L13.5863 12.6637L13.6031 12.6637L13.6199 12.6637L13.6366 12.6637L13.6534 12.6638L13.6702 12.6638L13.687 12.6638L13.7038 12.6638L13.7205 12.6638L13.7373 12.6639L13.7541 12.6639L13.7709 12.6639L13.7876 12.6639L13.8044 12.6639L13.8212 12.664L13.838 12.664L13.8548 12.664L13.8715 12.664L13.8883 12.664L13.9051 12.6641L13.9219 12.6641L13.9387 12.6641L13.9554 12.6641L13.9722 12.6641L13.989 12.6642L14.0058 12.6642L14.0226 12.6642L14.0393 12.6642L14.0561 12.6642L14.0729 12.6643L14.0897 12.6643L14.1064 12.6643L14.1232 12.6643L14.14 12.6644L14.1568 12.6644L14.1736 12.6644L14.1903 12.6644L14.2071 12.6644L14.2239 12.6645L14.2407 12.6645L14.2575 12.6645L14.2742 12.6645L14.291 12.6645L14.3078 12.6646L14.3246 12.6646L14.3414 12.6646L14.3581 12.6646L14.3749 12.6646L14.3917 12.6647L14.4085 12.6647L14.4253 12.6647L14.442 12.6647L14.4588 12.6647L14.4756 12.6648L14.4924 12.6648L14.5091 12.6648L14.5259 12.6648L14.5427 12.6648L14.5595 12.6649L14.5763 12.6649L14.593 12.6649L14.6098 12.6649L14.6266 12.6649L14.6434 12.665L14.6602 12.665L14.6769 12.665L14.6937 12.665L14.7105 12.665L14.7273 12.6651L14.7441 12.6651L14.7608 12.6651L14.7776 12.6651L14.7944 12.6651L14.8112 12.6652L14.828 12.6652L14.8447 12.6652L14.8615 12.6652L14.8783 12.6652L14.8951 12.6653L14.9118 12.6653L14.9286 12.6653L14.9454 12.6653L14.9622 12.6653L14.979 12.6654L14.9957 12.6654L15.0125 12.6654L15.0293 12.6654L15.0461 12.6654L15.0629 12.6655L15.0796 12.6655L15.0964 12.6655L15.1132 12.6655L15.13 12.6655L15.1468 12.6656L15.1635 12.6656L15.1803 12.6656L15.1971 12.6656L15.2139 12.6656L15.2306 12.6657L15.2474 12.6657L15.2642 12.6657L15.281 12.6657L15.2978 12.6657L15.3145 12.6658L15.3313 12.6658L15.3481 12.6658L15.3649 12.6658L15.3817 12.6658L15.3984 12.6659L15.4152 12.6659L15.432 12.6659L15.4488 12.6659L15.4656 12.6659L15.4823 12.666L15.4991 12.666L15.5159 12.666L15.5327 12.666L15.5495 12.666L15.5662 12.6661L15.583 12.6661L15.5998 12.6661L15.6166 12.6661L15.6333 12.6661L15.6501 12.6662L15.6669 12.6662L15.6837 12.6662L15.7005 12.6662L15.7172 12.6662L15.734 12.6663L15.7508 12.6663L15.7676 12.6663L15.7844 12.6663L15.8011 12.6663L15.8179 12.6664L15.8347 12.6664L15.8515 12.6664L15.8683 12.6664L15.885 12.6664L15.9018 12.6665L15.9186 12.6665L15.9354 12.6665L15.9522 12.6665L15.9689 12.6665L15.9857 12.6666L16.0025 12.6666L16.0193 12.6666L16.036 12.6666L16.0528 12.6666L16.0696 12.6667L16.0864 12.6667L16.1032 12.6667L16.1199 12.6667L16.1367 12.6667L16.1535 12.6668L16.1703 12.6668L16.1871 12.6668L16.2038 12.6668L16.2206 12.6669L16.2374 12.6669L16.2542 12.6669L16.271 12.6669L16.2836 12.6669L12.458 16.7581C12.2065 17.0271 12.2065 17.4631 12.458 17.732C12.7095 18.001 13.1172 18.001 13.3687 17.732L18.2822 12.4772C18.5337 12.2083 18.5337 11.7723 18.2822 11.5033L13.3687 6.24853Z",fill:"white"})),lJe=_.forwardRef(cJe),uJe=(t,e)=>_.createElement("svg",{width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",ref:e,...t},_.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M18.2139 2.44646L12 3.99992H5.4375C4.64359 3.99992 4 4.64352 4 5.43742V18.5624C4 19.3563 4.64359 19.9999 5.4375 19.9999H12L18.2139 21.5534C19.1211 21.7802 20 21.094 20 20.1588V3.84104C20 2.90584 19.1211 2.21964 18.2139 2.44646ZM12 17.9999V5.99992H6V17.9999H12Z",fill:"white"})),dJe=_.forwardRef(uJe),fJe="_userButton_t5z8t_15",hJe={userButton:fJe},pJe=({preventNavigation:t,isAuthenticated:e,isPasswordlessUser:n,userId:r,displayName:i,avatarUrl:s,onAction:o})=>{const{t:a}=ze(),c=cs(),l=_.useMemo(()=>{const m=[];return e&&(m.push({key:"user",icon:$W,label:i,dataTestid:"usermenu_user"}),m.push({key:"settings",icon:aJe,label:a("common.settings")}),n&&!t&&m.push({key:"login",label:a("action.sign_in"),icon:lJe,dataTestid:"usermenu_login"}),!n&&!t&&m.push({key:"logout",label:a("action.sign_out"),icon:dJe,dataTestid:"usermenu_logout"})),m},[e,n,i,t,a]),[d,h]=_.useState(!1);return e?S.jsx(wR,{title:a("a11y.user_menu"),showTitle:!1,align:"end",open:d,onOpenChange:h,trigger:S.jsx("button",{"aria-label":a("common.profile"),className:hJe.userButton,"data-testid":"usermenu_open",children:e&&(!n||s)?S.jsx(Iy,{id:r,name:i,size:ky.SM,src:s}):S.jsx($W,{})}),children:l.map(({key:m,icon:g,label:y,dataTestid:v})=>S.jsx(Fp,{Icon:g,label:y,"data-testid":v,onSelect:()=>o(m)},m))}):S.jsx(s9,{to:{pathname:"/login"},state:{from:c},children:a("log_in")})},DD=({preventNavigation:t=!1})=>{const e=cs(),n=Fl(),{client:r,logout:i,authenticated:s,passwordlessUser:o}=R9(),{displayName:a,avatarUrl:c}=yS(r),[l,d]=_.useState(!1),h=_.useCallback(()=>d(!1),[d]),[m,g]=_.useState(OD),y=_.useCallback(E=>{switch(E){case"user":g("profile"),d(!0);break;case"settings":g("audio"),d(!0);break;case"logout":i?.();break;case"login":n("/login",{state:{from:e}})?.catch(w=>N.error("Failed to navigate to login",w));break}},[n,e,i,d]),v=r?.getUserIdLocalpart()??"";return S.jsxs(S.Fragment,{children:[S.jsx(pJe,{preventNavigation:t,isAuthenticated:s,isPasswordlessUser:o,avatarUrl:c,onAction:y,userId:r?.getUserId()??"",displayName:a||(v?v.replace("@",""):"")}),r&&S.jsx(PD,{client:r,open:l,onDismiss:h,tab:m,onTabChange:g})]})},ND=t=>{const[e,n]=_.useState(void 0),[r,i]=_.useState(void 0),s=_.useRef(void 0);s.current||(s.current=OT({baseUrl:_n.defaultHomeserverUrl()})),_.useEffect(()=>{vt||s.current.registerRequest({}).catch(a=>{n(a.data?.params["m.login.terms"]?.policies?.privacy_policy?.en?.url),i(a.data?.params["m.login.recaptcha"]?.public_key)})},[]);const o=_.useCallback(async(a,c,l,d,h)=>{const m=new IP({matrixClient:s.current,doRequest:async x=>s.current.registerRequest({username:a,password:c,auth:x||void 0}),stateUpdated:(x,C)=>{if(C.error)throw new Error(C.error);x==="m.login.terms"?m.submitAuthDict({type:"m.login.terms"}).catch(R=>{N.error(R)}):x==="m.login.recaptcha"&&m.submitAuthDict({type:"m.login.recaptcha",response:d}).catch(R=>{N.error(R)})},requestEmailToken:async()=>Promise.resolve({sid:"dummy"})}),{user_id:g,access_token:y,device_id:v}=await m.attemptAuth();await t?.logout(!0);const E=await xfe({baseUrl:_n.defaultHomeserverUrl(),accessToken:y,userId:g,deviceId:v},!1);await E.setDisplayName(l);const w={user_id:g,device_id:v,access_token:y,passwordlessUser:h};h&&(w.tempPassword=c);const k=E.getUser(E.getUserId());return k.setRawDisplayName(l),k.setDisplayName(l),[E,w]},[t]);return{privacyPolicyUrl:e,recaptchaKey:r,register:o}},mJe="_buttons_1arp2_8",gJe={buttons:mJe},Pfe=({onJoin:t,open:e,onDismiss:n})=>{const{t:r}=ze();return S.jsxs(fm,{title:r("join_existing_call_modal.title"),open:e,onDismiss:n,children:[S.jsx("p",{children:r("join_existing_call_modal.text")}),S.jsxs(Dt,{rightAlign:!0,className:gJe.buttons,children:[S.jsx(Ht,{onClick:n,children:r("action.no")}),S.jsx(Ht,{onClick:t,"data-testid":"home_joinExistingRoom",children:r("join_existing_call_modal.join_button")})]})]})},BW="https://www.recaptcha.net/recaptcha/api.js?onload=mxOnRecaptchaLoaded&render=explicit";function UD(t){const{t:e}=ze(),[n]=_.useState(()=>Qo(16)),r=_.useRef(void 0);_.useEffect(()=>{if(!t)return;const o=()=>{document.getElementById(n)&&window.grecaptcha.render(n,{sitekey:t,size:"invisible",callback:a=>r.current?.resolve(a),"error-callback":()=>r.current?.reject(new Error)})};if(typeof window.grecaptcha?.render=="function")o();else if(window.mxOnRecaptchaLoaded=o,!document.querySelector(`script[src="${BW}"]`)){const a=document.createElement("script");a.src=BW,a.async=!0,document.body.appendChild(a)}},[n,t]);const i=_.useCallback(async()=>t?window.grecaptcha?new Promise((o,a)=>{const c=new MutationObserver(d=>{for(const h of d)if(h.target?.style?.visibility!=="visible"){a(Tz("recaptcha_dismissed",e)),c.disconnect();return}});r.current={resolve:d=>{o(d),c.disconnect()},reject:d=>{a(d),c.disconnect()}},window.grecaptcha.execute().then(()=>{},d=>{N.error("Recaptcha execution failed",d)});const l=document.querySelector('iframe[src*="recaptcha/api2/bframe"]');l?.parentNode?.parentNode&&c.observe(l?.parentNode?.parentNode,{attributes:!0})}):(N.log("Recaptcha not loaded"),Promise.reject(Tz("recaptcha_not_loaded",e))):Promise.resolve(""),[t,e]),s=_.useCallback(()=>{window.grecaptcha?.reset()},[]);return{execute:i,reset:s,recaptchaId:n}}const vJe="_form_jcuzc_8",yJe={form:vJe},E4=({ref:t,children:e,className:n,onSubmit:r})=>S.jsx("form",{onSubmit:r,className:Le(yJe.form,n),ref:t,children:e});E4.displayName="Form";const bJe="_footer_106jg_8",_Je="_mobileLoginLink_106jg_19",SJe="_form_106jg_24",wJe="_notice_106jg_40",_1={footer:bJe,mobileLoginLink:_Je,form:SJe,notice:wJe},EJe="_container_dwllg_8",CJe="_main_dwllg_15",TJe="_logo_dwllg_23",gv={container:EJe,main:CJe,logo:TJe},HW=t=>{t=1831565813+(t|=0)|0;let e=Math.imul(t^t>>>15,1|t);return e=e+Math.imul(e^e>>>7,61|e)^e,((e^e>>>14)>>>0)/4294967296};class RJe{constructor(e){this.dictionaries=void 0,this.length=void 0,this.separator=void 0,this.style=void 0,this.seed=void 0;const{length:n,separator:r,dictionaries:i,style:s,seed:o}=e;this.dictionaries=i,this.separator=r,this.length=n,this.style=s,this.seed=o}generate(){if(!this.dictionaries)throw new Error('Cannot find any dictionary. Please provide at least one, or leave the "dictionary" field empty in the config object');if(this.length<=0)throw new Error("Invalid length provided");if(this.length>this.dictionaries.length)throw new Error(`The length cannot be bigger than the number of dictionaries.
286
286
  Length provided: ${this.length}. Number of dictionaries provided: ${this.dictionaries.length}`);let e=this.seed;return this.dictionaries.slice(0,this.length).reduce((n,r)=>{let i;e?(i=(o=>{if(typeof o=="string"){const a=o.split("").map(l=>l.charCodeAt(0)).reduce((l,d)=>l+d,1),c=Math.floor(Number(a));return HW(c)}return HW(o)})(e),e=4294967296*i):i=Math.random();let s=r[Math.floor(i*r.length)]||"";if(this.style==="lowerCase")s=s.toLowerCase();else if(this.style==="capital"){const[o,...a]=s.split("");s=o.toUpperCase()+a.join("")}else this.style==="upperCase"&&(s=s.toUpperCase());return n?`${n}${this.separator}${s}`:`${s}`},"")}}const qW={separator:"_",dictionaries:[]},kJe=t=>{const e=[...t&&t.dictionaries||qW.dictionaries],n={...qW,...t,length:t&&t.length||e.length,dictionaries:e};if(!t||!t.dictionaries||!t.dictionaries.length)throw new Error('A "dictionaries" array must be provided. This is a breaking change introduced starting from Unique Name Generator v4. Read more about the breaking change here: https://github.com/andreasonny83/unique-names-generator#migration-guide');return new RJe(n).generate()};var IJe=["able","above","absent","absolute","abstract","abundant","academic","acceptable","accepted","accessible","accurate","accused","active","actual","acute","added","additional","adequate","adjacent","administrative","adorable","advanced","adverse","advisory","aesthetic","afraid","aggregate","aggressive","agreeable","agreed","agricultural","alert","alive","alleged","allied","alone","alright","alternative","amateur","amazing","ambitious","amused","ancient","angry","annoyed","annual","anonymous","anxious","appalling","apparent","applicable","appropriate","arbitrary","architectural","armed","arrogant","artificial","artistic","ashamed","asleep","assistant","associated","atomic","attractive","automatic","autonomous","available","average","awake","aware","awful","awkward","back","bad","balanced","bare","basic","beautiful","beneficial","better","bewildered","big","binding","biological","bitter","bizarre","blank","blind","blonde","bloody","blushing","boiling","bold","bored","boring","bottom","brainy","brave","breakable","breezy","brief","bright","brilliant","broad","broken","bumpy","burning","busy","calm","capable","capitalist","careful","casual","causal","cautious","central","certain","changing","characteristic","charming","cheap","cheerful","chemical","chief","chilly","chosen","christian","chronic","chubby","circular","civic","civil","civilian","classic","classical","clean","clear","clever","clinical","close","closed","cloudy","clumsy","coastal","cognitive","coherent","cold","collective","colonial","colorful","colossal","coloured","colourful","combative","combined","comfortable","coming","commercial","common","communist","compact","comparable","comparative","compatible","competent","competitive","complete","complex","complicated","comprehensive","compulsory","conceptual","concerned","concrete","condemned","confident","confidential","confused","conscious","conservation","conservative","considerable","consistent","constant","constitutional","contemporary","content","continental","continued","continuing","continuous","controlled","controversial","convenient","conventional","convinced","convincing","cooing","cool","cooperative","corporate","correct","corresponding","costly","courageous","crazy","creative","creepy","criminal","critical","crooked","crowded","crucial","crude","cruel","cuddly","cultural","curious","curly","current","curved","cute","daily","damaged","damp","dangerous","dark","dead","deaf","deafening","dear","decent","decisive","deep","defeated","defensive","defiant","definite","deliberate","delicate","delicious","delighted","delightful","democratic","dependent","depressed","desirable","desperate","detailed","determined","developed","developing","devoted","different","difficult","digital","diplomatic","direct","dirty","disabled","disappointed","disastrous","disciplinary","disgusted","distant","distinct","distinctive","distinguished","disturbed","disturbing","diverse","divine","dizzy","domestic","dominant","double","doubtful","drab","dramatic","dreadful","driving","drunk","dry","dual","due","dull","dusty","dutch","dying","dynamic","eager","early","eastern","easy","economic","educational","eerie","effective","efficient","elaborate","elated","elderly","eldest","electoral","electric","electrical","electronic","elegant","eligible","embarrassed","embarrassing","emotional","empirical","empty","enchanting","encouraging","endless","energetic","enormous","enthusiastic","entire","entitled","envious","environmental","equal","equivalent","essential","established","estimated","ethical","ethnic","eventual","everyday","evident","evil","evolutionary","exact","excellent","exceptional","excess","excessive","excited","exciting","exclusive","existing","exotic","expected","expensive","experienced","experimental","explicit","extended","extensive","external","extra","extraordinary","extreme","exuberant","faint","fair","faithful","familiar","famous","fancy","fantastic","far","fascinating","fashionable","fast","fat","fatal","favourable","favourite","federal","fellow","female","feminist","few","fierce","filthy","final","financial","fine","firm","fiscal","fit","fixed","flaky","flat","flexible","fluffy","fluttering","flying","following","fond","foolish","foreign","formal","formidable","forthcoming","fortunate","forward","fragile","frail","frantic","free","frequent","fresh","friendly","frightened","front","frozen","full","fun","functional","fundamental","funny","furious","future","fuzzy","gastric","gay","general","generous","genetic","gentle","genuine","geographical","giant","gigantic","given","glad","glamorous","gleaming","global","glorious","golden","good","gorgeous","gothic","governing","graceful","gradual","grand","grateful","greasy","great","grieving","grim","gross","grotesque","growing","grubby","grumpy","guilty","handicapped","handsome","happy","hard","harsh","head","healthy","heavy","helpful","helpless","hidden","high","hilarious","hissing","historic","historical","hollow","holy","homeless","homely","hon","honest","horizontal","horrible","hostile","hot","huge","human","hungry","hurt","hushed","husky","icy","ideal","identical","ideological","ill","illegal","imaginative","immediate","immense","imperial","implicit","important","impossible","impressed","impressive","improved","inadequate","inappropriate","inc","inclined","increased","increasing","incredible","independent","indirect","individual","industrial","inevitable","influential","informal","inherent","initial","injured","inland","inner","innocent","innovative","inquisitive","instant","institutional","insufficient","intact","integral","integrated","intellectual","intelligent","intense","intensive","interested","interesting","interim","interior","intermediate","internal","international","intimate","invisible","involved","irrelevant","isolated","itchy","jealous","jittery","joint","jolly","joyous","judicial","juicy","junior","just","keen","key","kind","known","labour","large","late","latin","lazy","leading","left","legal","legislative","legitimate","lengthy","lesser","level","lexical","liable","liberal","light","like","likely","limited","linear","linguistic","liquid","literary","little","live","lively","living","local","logical","lonely","long","loose","lost","loud","lovely","low","loyal","ltd","lucky","mad","magic","magnetic","magnificent","main","major","male","mammoth","managerial","managing","manual","many","marginal","marine","marked","married","marvellous","marxist","mass","massive","mathematical","mature","maximum","mean","meaningful","mechanical","medical","medieval","melodic","melted","mental","mere","metropolitan","mid","middle","mighty","mild","military","miniature","minimal","minimum","ministerial","minor","miserable","misleading","missing","misty","mixed","moaning","mobile","moderate","modern","modest","molecular","monetary","monthly","moral","motionless","muddy","multiple","mushy","musical","mute","mutual","mysterious","naked","narrow","nasty","national","native","natural","naughty","naval","near","nearby","neat","necessary","negative","neighbouring","nervous","net","neutral","new","nice","noble","noisy","normal","northern","nosy","notable","novel","nuclear","numerous","nursing","nutritious","nutty","obedient","objective","obliged","obnoxious","obvious","occasional","occupational","odd","official","ok","okay","old","olympic","only","open","operational","opposite","optimistic","oral","ordinary","organic","organisational","original","orthodox","other","outdoor","outer","outrageous","outside","outstanding","overall","overseas","overwhelming","painful","pale","panicky","parallel","parental","parliamentary","partial","particular","passing","passive","past","patient","payable","peaceful","peculiar","perfect","permanent","persistent","personal","petite","philosophical","physical","plain","planned","plastic","pleasant","pleased","poised","polite","political","poor","popular","positive","possible","potential","powerful","practical","precious","precise","preferred","pregnant","preliminary","premier","prepared","present","presidential","pretty","previous","prickly","primary","prime","primitive","principal","printed","prior","private","probable","productive","professional","profitable","profound","progressive","prominent","promising","proper","proposed","prospective","protective","protestant","proud","provincial","psychiatric","psychological","public","puny","pure","purring","puzzled","quaint","qualified","quarrelsome","querulous","quick","quickest","quiet","quintessential","quixotic","racial","radical","rainy","random","rapid","rare","raspy","rational","ratty","raw","ready","real","realistic","rear","reasonable","recent","reduced","redundant","regional","registered","regular","regulatory","related","relative","relaxed","relevant","reliable","relieved","religious","reluctant","remaining","remarkable","remote","renewed","representative","repulsive","required","resident","residential","resonant","respectable","respective","responsible","resulting","retail","retired","revolutionary","rich","ridiculous","right","rigid","ripe","rising","rival","roasted","robust","rolling","romantic","rotten","rough","round","royal","rubber","rude","ruling","running","rural","sacred","sad","safe","salty","satisfactory","satisfied","scared","scary","scattered","scientific","scornful","scrawny","screeching","secondary","secret","secure","select","selected","selective","selfish","semantic","senior","sensible","sensitive","separate","serious","severe","sexual","shaggy","shaky","shallow","shared","sharp","sheer","shiny","shivering","shocked","short","shrill","shy","sick","significant","silent","silky","silly","similar","simple","single","skilled","skinny","sleepy","slight","slim","slimy","slippery","slow","small","smart","smiling","smoggy","smooth","social","socialist","soft","solar","sole","solid","sophisticated","sore","sorry","sound","sour","southern","soviet","spare","sparkling","spatial","special","specific","specified","spectacular","spicy","spiritual","splendid","spontaneous","sporting","spotless","spotty","square","squealing","stable","stale","standard","static","statistical","statutory","steady","steep","sticky","stiff","still","stingy","stormy","straight","straightforward","strange","strategic","strict","striking","striped","strong","structural","stuck","stupid","subjective","subsequent","substantial","subtle","successful","successive","sudden","sufficient","suitable","sunny","super","superb","superior","supporting","supposed","supreme","sure","surprised","surprising","surrounding","surviving","suspicious","sweet","swift","symbolic","sympathetic","systematic","tall","tame","tart","tasteless","tasty","technical","technological","teenage","temporary","tender","tense","terrible","territorial","testy","then","theoretical","thick","thin","thirsty","thorough","thoughtful","thoughtless","thundering","tight","tiny","tired","top","tory","total","tough","toxic","traditional","tragic","tremendous","tricky","tropical","troubled","typical","ugliest","ugly","ultimate","unable","unacceptable","unaware","uncertain","unchanged","uncomfortable","unconscious","underground","underlying","unemployed","uneven","unexpected","unfair","unfortunate","unhappy","uniform","uninterested","unique","united","universal","unknown","unlikely","unnecessary","unpleasant","unsightly","unusual","unwilling","upper","upset","uptight","urban","urgent","used","useful","useless","usual","vague","valid","valuable","variable","varied","various","varying","vast","verbal","vertical","very","vicarious","vicious","victorious","violent","visible","visiting","visual","vital","vitreous","vivacious","vivid","vocal","vocational","voiceless","voluminous","voluntary","vulnerable","wandering","warm","wasteful","watery","weak","wealthy","weary","wee","weekly","weird","welcome","well","western","wet","whispering","whole","wicked","wide","widespread","wild","wilful","willing","willowy","wily","wise","wispy","wittering","witty","wonderful","wooden","working","worldwide","worried","worrying","worthwhile","worthy","written","wrong","xenacious","xenial","xenogeneic","xenophobic","xeric","xerothermic","yabbering","yammering","yappiest","yappy","yawning","yearling","yearning","yeasty","yelling","yelping","yielding","yodelling","young","youngest","youthful","ytterbic","yucky","yummy","zany","zealous","zeroth","zestful","zesty","zippy","zonal","zoophagous","zygomorphic","zygotic"],xJe=["aardvark","aardwolf","albatross","alligator","alpaca","amphibian","anaconda","angelfish","anglerfish","ant","anteater","antelope","antlion","ape","aphid","armadillo","asp","baboon","badger","bandicoot","barnacle","barracuda","basilisk","bass","bat","bear","beaver","bedbug","bee","beetle","bird","bison","blackbird","boa","boar","bobcat","bobolink","bonobo","booby","bovid","bug","butterfly","buzzard","camel","canid","canidae","capybara","cardinal","caribou","carp","cat","caterpillar","catfish","catshark","cattle","centipede","cephalopod","chameleon","cheetah","chickadee","chicken","chimpanzee","chinchilla","chipmunk","cicada","clam","clownfish","cobra","cockroach","cod","condor","constrictor","coral","cougar","cow","coyote","crab","crane","crawdad","crayfish","cricket","crocodile","crow","cuckoo","damselfly","deer","dingo","dinosaur","dog","dolphin","donkey","dormouse","dove","dragon","dragonfly","duck","eagle","earthworm","earwig","echidna","eel","egret","elephant","elk","emu","ermine","falcon","felidae","ferret","finch","firefly","fish","flamingo","flea","fly","flyingfish","fowl","fox","frog","galliform","gamefowl","gayal","gazelle","gecko","gerbil","gibbon","giraffe","goat","goldfish","goose","gopher","gorilla","grasshopper","grouse","guan","guanaco","guineafowl","gull","guppy","haddock","halibut","hamster","hare","harrier","hawk","hedgehog","heron","herring","hippopotamus","hookworm","hornet","horse","hoverfly","hummingbird","hyena","iguana","impala","jackal","jaguar","jay","jellyfish","junglefowl","kangaroo","kingfisher","kite","kiwi","koala","koi","krill","ladybug","lamprey","landfowl","lark","leech","lemming","lemur","leopard","leopon","limpet","lion","lizard","llama","lobster","locust","loon","louse","lungfish","lynx","macaw","mackerel","magpie","mammal","manatee","mandrill","marlin","marmoset","marmot","marsupial","marten","mastodon","meadowlark","meerkat","mink","minnow","mite","mockingbird","mole","mollusk","mongoose","monkey","moose","mosquito","moth","mouse","mule","muskox","narwhal","newt","nightingale","ocelot","octopus","opossum","orangutan","orca","ostrich","otter","owl","ox","panda","panther","parakeet","parrot","parrotfish","partridge","peacock","peafowl","pelican","penguin","perch","pheasant","pig","pigeon","pike","pinniped","piranha","planarian","platypus","pony","porcupine","porpoise","possum","prawn","primate","ptarmigan","puffin","puma","python","quail","quelea","quokka","rabbit","raccoon","rat","rattlesnake","raven","reindeer","reptile","rhinoceros","roadrunner","rodent","rook","rooster","roundworm","sailfish","salamander","salmon","sawfish","scallop","scorpion","seahorse","shark","sheep","shrew","shrimp","silkworm","silverfish","skink","skunk","sloth","slug","smelt","snail","snake","snipe","sole","sparrow","spider","spoonbill","squid","squirrel","starfish","stingray","stoat","stork","sturgeon","swallow","swan","swift","swordfish","swordtail","tahr","takin","tapir","tarantula","tarsier","termite","tern","thrush","tick","tiger","tiglon","toad","tortoise","toucan","trout","tuna","turkey","turtle","tyrannosaurus","unicorn","urial","vicuna","viper","vole","vulture","wallaby","walrus","warbler","wasp","weasel","whale","whippet","whitefish","wildcat","wildebeest","wildfowl","wolf","wolverine","wombat","woodpecker","worm","wren","xerinae","yak","zebra"],AJe=["amaranth","amber","amethyst","apricot","aqua","aquamarine","azure","beige","black","blue","blush","bronze","brown","chocolate","coffee","copper","coral","crimson","cyan","emerald","fuchsia","gold","gray","green","harlequin","indigo","ivory","jade","lavender","lime","magenta","maroon","moccasin","olive","orange","peach","pink","plum","purple","red","rose","salmon","sapphire","scarlet","silver","tan","teal","tomato","turquoise","violet","white","yellow"];const MJe=["hydrogen","helium","lithium","beryllium","boron","carbon","nitrogen","oxygen","fluorine","neon","sodium","magnesium","aluminum","silicon","phosphorus","sulfur","chlorine","argon","potassium","calcium","scandium","titanium","vanadium","chromium","manganese","iron","cobalt","nickel","copper","zinc","gallium","germanium","arsenic","selenium","bromine","krypton","rubidium","strontium","yttrium","zirconium","niobium","molybdenum","technetium","ruthenium","rhodium","palladium","silver","cadmium","indium","tin","antimony","tellurium","iodine","xenon","cesium","barium","lanthanum","cerium","praseodymium","neodymium","promethium","samarium","europium","gadolinium","terbium","dysprosium","holmium","erbium","thulium","ytterbium","lutetium","hafnium","tantalum","wolfram","rhenium","osmium","iridium","platinum","gold","mercury","thallium","lead","bismuth","polonium","astatine","radon","francium","radium","actinium","thorium","protactinium","uranium","neptunium","plutonium","americium","curium","berkelium","californium","einsteinium","fermium","mendelevium","nobelium","lawrencium","rutherfordium","dubnium","seaborgium","bohrium","hassium","meitnerium","darmstadtium","roentgenium","copernicium","nihonium","flerovium","moscovium","livermorium","tennessine","oganesson"];function Dfe(){return kJe({dictionaries:[AJe,IJe,xJe,MJe],style:"lowerCase",length:3,separator:"-"})}const LJe=()=>{const{setClient:t}=hm(),{header:e}=oc(),[n,r]=_.useState(!1),[i,s]=_.useState(),[o]=VR(),{recaptchaKey:a,register:c}=ND(),{execute:l,reset:d,recaptchaId:h}=UD(a),[m,g]=_.useState(!1),y=_.useCallback(()=>g(!1),[g]),[v,E]=_.useState(),w=Fl(),{t:k}=ze(),x=_.useCallback(C=>{C.preventDefault();const R=new FormData(C.target),T=Afe(R.get("callName")),M=R.get("displayName");async function O(){s(void 0),r(!0);const P=await l(),D=Dfe(),[j,$]=await c(D,Qo(16),M,P,!0);let q;try{q=await Mfe(j,T,qn.SHARED_KEY)}catch(Y){if(!t)throw Y;if(Y.errcode==="M_ROOM_IN_USE"){E(()=>{t(j,$);const W=xS(T);w(`/${W}`)?.catch(H=>{N.error("Failed to navigate to alias localpart",H)})}),r(!1),g(!0);return}else throw Y}if(!t)throw new Error("setClient is undefined");if(!q.password)throw new Error("Failed to create room with shared secret");t(j,$),await w(S4(q.roomId,{kind:qn.SHARED_KEY,secret:q.password},T))}O().catch(P=>{N.error(P),r(!1),s(P),d()})},[c,d,l,w,g,t]);return S.jsxs(S.Fragment,{children:[S.jsxs("div",{className:gv.container,children:[e==="standard"&&S.jsxs(hd,{children:[S.jsx(fh,{children:S.jsx(Bp,{})}),S.jsx(hh,{hideMobile:!0,children:S.jsx(DD,{})})]}),S.jsxs("main",{className:gv.main,children:[S.jsx(Bp,{className:gv.logo}),S.jsx(qc,{size:"lg",weight:"semibold",children:k("start_new_call")}),S.jsxs(E4,{className:_1.form,onSubmit:x,children:[S.jsx(Dt,{children:S.jsx(Zn,{id:"callName",name:"callName",label:k("call_name"),placeholder:k("call_name"),type:"text",required:!0,autoComplete:"off","data-testid":"home_callName"})}),S.jsx(Dt,{children:S.jsx(Zn,{id:"displayName",name:"displayName",label:k("common.display_name"),placeholder:k("common.display_name"),type:"text",required:!0,"data-testid":"home_displayName",autoComplete:"off"})}),o===null&&S.jsx(on,{size:"sm",className:_1.notice,children:S.jsx(Hle,{})}),S.jsx(on,{size:"sm",className:_1.notice,children:S.jsxs(bo,{i18nKey:"unauthenticated_view_ssla_caption",children:['By clicking "Go", you agree to our'," ",S.jsx(_p,{href:_n.get().ssla,children:"Software and Services License Agreement (SSLA)"})]})}),i&&S.jsx(Dt,{children:S.jsx(ph,{error:i})}),S.jsx(Ht,{type:"submit",size:"lg",disabled:n,"data-testid":"home_go",children:k(n?"common.loading":"action.go")}),S.jsx("div",{id:h})]})]}),S.jsxs("footer",{className:_1.footer,children:[S.jsx(on,{className:_1.mobileLoginLink,children:S.jsx(Ll,{to:"/login","data-testid":"home_login",children:k("unauthenticated_view_login_button")})}),S.jsx(on,{children:S.jsxs(bo,{i18nKey:"unauthenticated_view_body",children:["Not registered yet?"," ",S.jsx(Ll,{to:"/register","data-testid":"home_register",children:"Create an account"})]})})]})]}),v&&S.jsx(Pfe,{onJoin:v,open:m,onDismiss:y})]})},Cg={};function VW(t,e){if(Cg[e.roomId])return Cg[e.roomId];if(!e||!e.timeline){const i=Number.MAX_SAFE_INTEGER;return Cg[e.roomId]=i,i}const n=t.getUserId();if(e.getMyMembership()!==Ve.Join){const i=e.currentState.getStateEvents("m.room.member",n);if(i&&!Array.isArray(i)){const s=i.getTs();return Cg[e.roomId]=s,s}}for(let i=e.timeline.length-1;i>=0;--i){const o=e.timeline[i].getTs();if(o)return Cg[e.roomId]=o,o}const r=Number.MAX_SAFE_INTEGER;return Cg[e.roomId]=r,r}function OJe(t,e){return e.sort((n,r)=>VW(t,r)-VW(t,n))}const PJe=t=>{const e=Ife(t.roomId);if(!t.hasEncryptionStateEvent()&&!e)return!1;switch(t.getJoinRule()){case kf.Public:return!0;case kf.Knock:switch(t.getMyMembership()){case Ve.Join:case Ve.Knock:return!0;case Ve.Invite:return t.getLiveTimeline().getState(Fe.FORWARDS)?.getStateEvents(Z.RoomMember,t.myUserId)?.getPrevContent().membership===kf.Knock;default:return!1}default:return t.getMyMembership()===Ve.Join}},DJe=t=>{const e=t.getMyMembership();if(e===Ve.Knock)return!0;if(e!==Ve.Join)return!1;const n=t.getLiveTimeline();if(n.getState(Fe.FORWARDS)?.events?.has(Z.GroupCallMemberPrefix))return!0;for(const r of t._unstable_getStickyEvents())if(r.getType()===Z.RTCMembership)return!0;return n.getEvents().some(r=>r.unstableStickyInfo&&r.getType()===Z.GroupCallMemberPrefix)};function NJe(t){const[e,n]=_.useState([]);return _.useEffect(()=>{function r(){const i=t.getRooms().filter(DJe).filter(PJe),o=OJe(t,i).map(a=>{const c=t.matrixRTC.getRoomSession(a);return{roomAlias:a.getCanonicalAlias()??void 0,roomName:a.name,avatarUrl:a.getMxcAvatarUrl(),room:a,session:c,participants:c.memberships.filter(l=>l.sender).map(l=>a.getMember(l.sender)).filter(l=>l)}});n(o)}return r(),t.matrixRTC.on(OC.SessionStarted,r),t.on(Oe.MyMembership,r),()=>{t.matrixRTC.off(OC.SessionStarted,r),t.off(Oe.MyMembership,r)}},[t]),e}const UJe="_form_1vjc2_8",jJe="_fieldRow_1vjc2_16",FJe="_button_1vjc2_24",$Je="_notice_1vjc2_32",S1={form:UJe,fieldRow:jJe,button:FJe,notice:$Je},BJe="_callTileSpacer_l4ywf_8",HJe="_callTile_l4ywf_8",qJe="_callTileLink_l4ywf_28",VJe="_callInfo_l4ywf_40",KJe="_callName_l4ywf_53",GJe="_callList_l4ywf_63",zJe="_disabled_l4ywf_74",ku={callTileSpacer:BJe,callTile:HJe,callTileLink:qJe,callInfo:VJe,callName:KJe,callList:GJe,disabled:zJe},WJe=({rooms:t,client:e})=>S.jsx(S.Fragment,{children:S.jsxs("div",{className:ku.callList,children:[t.map(({room:n,roomName:r,avatarUrl:i,participants:s})=>S.jsx(YJe,{client:e,name:r,avatarUrl:i,room:n,participants:s},n.roomId)),t.length>3&&S.jsxs(S.Fragment,{children:[S.jsx("div",{className:ku.callTileSpacer}),S.jsx("div",{className:ku.callTileSpacer})]})]})}),YJe=({name:t,avatarUrl:e,room:n,client:r})=>{const{t:i}=ze(),s=_4(n.roomId),[o,a]=_.useState(!1),c=_.useCallback(d=>{d.stopPropagation(),d.preventDefault(),a(!0),r.leave(n.roomId).catch(()=>a(!1))},[n,r]),l=S.jsxs(S.Fragment,{children:[S.jsx(Iy,{id:n.roomId,name:t,size:ky.LG,src:e}),S.jsx("div",{className:ku.callInfo,children:S.jsx(on,{weight:"semibold",className:ku.callName,children:t})}),S.jsx(cR,{onClick:c,disabled:o,"aria-label":i("action.remove"),children:S.jsx(Z_,{})})]});return S.jsx("div",{className:ku.callTile,children:o?S.jsx("span",{className:Le(ku.callTileLink,ku.disabled),children:l}):S.jsx(KT,{to:S4(n.roomId,s,n.name),className:ku.callTileLink,children:l})})},JJe=({client:t})=>{const{header:e}=oc(),[n,r]=_.useState(!1),[i,s]=_.useState(),[o]=VR(),a=Fl(),{t:c}=ze(),[l,d]=_.useState(!1),h=_.useCallback(()=>d(!1),[d]),m=_.useCallback(w=>{w.preventDefault();const x=new FormData(w.target).get("callName"),C=typeof x=="string"?Afe(x):"";async function R(){s(void 0),r(!0);const T=await Mfe(t,C,qn.SHARED_KEY);if(!T.password)throw new Error("Failed to create room with shared secret");await a(S4(T.roomId,{kind:qn.SHARED_KEY,secret:T.password},C))}R().catch(T=>{T.errcode==="M_ROOM_IN_USE"?(v(xS(C)),r(!1),s(void 0),d(!0)):(N.error(T),r(!1),s(T))})},[t,a,d]),g=NJe(t),[y,v]=_.useState(),E=_.useCallback(()=>{a(`/${y}`)?.catch(w=>{N.error("Failed to navigate to existing alias",w)})},[a,y]);return S.jsxs(S.Fragment,{children:[S.jsxs("div",{className:gv.container,children:[e==="standard"&&S.jsxs(hd,{children:[S.jsx(fh,{children:S.jsx(Bp,{})}),S.jsx(hh,{children:S.jsx(DD,{})})]}),S.jsxs("main",{className:gv.main,children:[S.jsx(Bp,{className:gv.logo}),S.jsx(qc,{size:"lg",weight:"semibold",children:c("start_new_call")}),S.jsxs(E4,{className:S1.form,onSubmit:m,children:[S.jsxs(Dt,{className:S1.fieldRow,children:[S.jsx(Zn,{id:"callName",name:"callName",label:c("call_name"),placeholder:c("call_name"),type:"text",required:!0,autoComplete:"off","data-testid":"home_callName"}),S.jsx(Ht,{type:"submit",size:"lg",className:S1.button,disabled:n,"data-testid":"home_go",children:c(n?"common.loading":"action.go")})]}),o===null&&S.jsx(on,{size:"sm",className:S1.notice,children:S.jsx(Hle,{})}),i&&S.jsx(Dt,{className:S1.fieldRow,children:S.jsx(ph,{error:i})})]}),g.length>0&&S.jsx(WJe,{rooms:g,client:t})]})]}),S.jsx(Pfe,{onJoin:E,open:l,onDismiss:h})]})};function AS(t){_.useEffect(()=>{const e="Element Call";document.title=t?`${e} | ${t}`:e},[t])}const Nfe=()=>{const{t}=ze();AS(t("common.home"));const e=xy();return e?e.state==="error"?S.jsx(v_,{widget:vt,error:e.error}):e.authenticated?S.jsx(JJe,{client:e.authenticated.client}):S.jsx(LJe,{}):S.jsx(UR,{})},XJe=(t,e)=>_.createElement("svg",{width:300,height:66,viewBox:"0 0 300 66",fill:"none",xmlns:"http://www.w3.org/2000/svg",ref:e,...t},_.createElement("circle",{cx:32.6901,cy:32.6904,r:23.496,fill:"white"}),_.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M32.6137 65.2274C50.6257 65.2274 65.2274 50.6257 65.2274 32.6137C65.2274 14.6016 50.6257 0 32.6137 0C14.6016 0 0 14.6016 0 32.6137C0 50.6257 14.6016 65.2274 32.6137 65.2274ZM26.6511 15.1961C26.6511 13.8796 27.7205 12.8124 29.0397 12.8124C37.9808 12.8124 45.2291 20.0456 45.2291 28.9681C45.2291 30.2846 44.1596 31.3518 42.8405 31.3518C41.5213 31.3518 40.4519 30.2846 40.4519 28.9681C40.4519 22.6785 35.3425 17.5797 29.0397 17.5797C27.7205 17.5797 26.6511 16.5125 26.6511 15.1961ZM52.4139 28.9683C52.4139 27.6518 51.3445 26.5846 50.0253 26.5846C48.7061 26.5846 47.6367 27.6518 47.6367 28.9683C47.6367 35.2579 42.5274 40.3567 36.2246 40.3567C34.9054 40.3567 33.836 41.4239 33.836 42.7404C33.836 44.0568 34.9054 45.124 36.2246 45.124C45.1657 45.124 52.4139 37.8909 52.4139 28.9683ZM38.6134 50.031C38.6134 51.3475 37.544 52.4146 36.2248 52.4146C27.2837 52.4146 20.0355 45.1815 20.0355 36.2589C20.0355 34.9425 21.1049 33.8753 22.4241 33.8753C23.7432 33.8753 24.8127 34.9425 24.8127 36.2589C24.8127 42.5486 29.922 47.6474 36.2248 47.6474C37.544 47.6474 38.6134 48.7146 38.6134 50.031ZM12.8113 36.2589C12.8113 37.5754 13.8808 38.6426 15.1999 38.6426C16.5191 38.6426 17.5885 37.5754 17.5885 36.2589C17.5885 29.9693 22.6979 24.8705 29.0007 24.8705C30.3198 24.8705 31.3893 23.8033 31.3893 22.4869C31.3893 21.1704 30.3198 20.1032 29.0007 20.1032C20.0595 20.1032 12.8113 27.3364 12.8113 36.2589Z",fill:"#0DBD8B"}),_.createElement("path",{d:"M114.73 36.9816H91.7256C91.9974 39.3888 92.871 41.3107 94.3464 42.7472C95.8217 44.1449 97.763 44.8438 100.17 44.8438C101.762 44.8438 103.199 44.4555 104.48 43.679C105.761 42.9025 106.674 41.8542 107.217 40.5341H114.206C113.274 43.6014 111.527 46.0862 108.964 47.9887C106.441 49.8523 103.451 50.7842 99.9955 50.7842C95.4917 50.7842 91.8421 49.2894 89.0466 46.2998C86.29 43.3102 84.9117 39.5247 84.9117 34.9432C84.9117 30.4783 86.3094 26.7316 89.1049 23.7032C91.9003 20.6747 95.5111 19.1605 99.9373 19.1605C104.363 19.1605 107.935 20.6553 110.653 23.6449C113.41 26.5957 114.788 30.323 114.788 34.8267L114.73 36.9816ZM99.9373 24.8097C97.763 24.8097 95.9576 25.4503 94.5211 26.7316C93.0845 28.0128 92.1915 29.7212 91.8421 31.8566H107.916C107.605 29.7212 106.751 28.0128 105.353 26.7316C103.956 25.4503 102.15 24.8097 99.9373 24.8097Z",fill:"white"}),_.createElement("path",{d:"M119.557 41.0583V6.40625H126.488V41.1748C126.488 42.7278 127.342 43.5043 129.05 43.5043L130.273 43.4461V50.0271C129.613 50.1435 128.914 50.2018 128.177 50.2018C125.187 50.2018 122.993 49.4447 121.596 47.9305C120.237 46.4163 119.557 44.1255 119.557 41.0583Z",fill:"white"}),_.createElement("path",{d:"M162.549 36.9816H139.545C139.817 39.3888 140.69 41.3107 142.166 42.7472C143.641 44.1449 145.582 44.8438 147.99 44.8438C149.582 44.8438 151.018 44.4555 152.299 43.679C153.581 42.9025 154.493 41.8542 155.037 40.5341H162.025C161.093 43.6014 159.346 46.0862 156.784 47.9887C154.26 49.8523 151.27 50.7842 147.815 50.7842C143.311 50.7842 139.662 49.2894 136.866 46.2998C134.109 43.3102 132.731 39.5247 132.731 34.9432C132.731 30.4783 134.129 26.7316 136.924 23.7032C139.72 20.6747 143.331 19.1605 147.757 19.1605C152.183 19.1605 155.755 20.6553 158.473 23.6449C161.229 26.5957 162.608 30.323 162.608 34.8267L162.549 36.9816ZM147.757 24.8097C145.582 24.8097 143.777 25.4503 142.341 26.7316C140.904 28.0128 140.011 29.7212 139.662 31.8566H155.735C155.425 29.7212 154.571 28.0128 153.173 26.7316C151.775 25.4503 149.97 24.8097 147.757 24.8097Z",fill:"white"}),_.createElement("path",{d:"M193.817 32.7302V50.0853H186.887V31.973C186.887 27.3916 184.984 25.1009 181.179 25.1009C179.122 25.1009 177.471 25.7609 176.229 27.081C175.025 28.4011 174.424 30.2065 174.424 32.4972V50.0853H167.493V19.8594H173.9V23.8779C174.637 22.519 175.763 21.393 177.277 20.5C178.792 19.607 180.675 19.1605 182.927 19.1605C187.12 19.1605 190.148 20.7524 192.012 23.9361C194.574 20.7524 197.991 19.1605 202.262 19.1605C205.795 19.1605 208.513 20.2671 210.415 22.4801C212.318 24.6544 213.269 27.5275 213.269 31.0995V50.0853H206.338V31.973C206.338 27.3916 204.436 25.1009 200.631 25.1009C198.535 25.1009 196.865 25.7803 195.623 27.1392C194.419 28.4593 193.817 30.323 193.817 32.7302Z",fill:"white"}),_.createElement("path",{d:"M247.735 36.9816H224.731C225.002 39.3888 225.876 41.3107 227.351 42.7472C228.827 44.1449 230.768 44.8438 233.175 44.8438C234.767 44.8438 236.204 44.4555 237.485 43.679C238.766 42.9025 239.678 41.8542 240.222 40.5341H247.211C246.279 43.6014 244.532 46.0862 241.969 47.9887C239.446 49.8523 236.456 50.7842 233 50.7842C228.497 50.7842 224.847 49.2894 222.052 46.2998C219.295 43.3102 217.917 39.5247 217.917 34.9432C217.917 30.4783 219.314 26.7316 222.11 23.7032C224.905 20.6747 228.516 19.1605 232.942 19.1605C237.368 19.1605 240.94 20.6553 243.658 23.6449C246.415 26.5957 247.793 30.323 247.793 34.8267L247.735 36.9816ZM232.942 24.8097C230.768 24.8097 228.963 25.4503 227.526 26.7316C226.089 28.0128 225.196 29.7212 224.847 31.8566H240.921C240.61 29.7212 239.756 28.0128 238.358 26.7316C236.961 25.4503 235.155 24.8097 232.942 24.8097Z",fill:"white"}),_.createElement("path",{d:"M259.085 19.8594V23.8779C259.784 22.5578 260.929 21.4513 262.521 20.5583C264.152 19.6264 266.113 19.1605 268.403 19.1605C271.975 19.1605 274.732 20.2477 276.673 22.4219C278.653 24.5961 279.643 27.4887 279.643 31.0995V50.0853H272.713V31.973C272.713 29.8376 272.208 28.1681 271.199 26.9645C270.228 25.7221 268.733 25.1009 266.714 25.1009C264.501 25.1009 262.754 25.7609 261.473 27.081C260.23 28.4011 259.609 30.2259 259.609 32.5554V50.0853H252.679V19.8594H259.085Z",fill:"white"}),_.createElement("path",{d:"M299.884 43.912V49.9106C299.029 50.1435 297.826 50.26 296.273 50.26C290.371 50.26 287.42 47.2898 287.42 41.3495V25.3921H282.82V19.8594H287.42V11.9972H294.351V19.8594H300V25.3921H294.351V40.6506C294.351 43.019 295.477 44.2032 297.729 44.2032L299.884 43.912Z",fill:"white"})),Ufe=_.forwardRef(XJe),QJe="_logo_1gx2r_8",ZJe="_container_1gx2r_14",eXe="_content_1gx2r_22",tXe="_formContainer_1gx2r_30",nXe="_authLinks_1gx2r_62",ml={logo:QJe,container:ZJe,content:eXe,formContainer:tXe,authLinks:nXe};function rXe(t){return _.useCallback(async(e,n,r)=>{const i=OT({baseUrl:e}),s=new IP({matrixClient:i,doRequest:async()=>i.login("m.login.password",{identifier:{type:"m.id.user",user:n},password:r}),stateUpdated:()=>{},requestEmailToken:async()=>Promise.resolve({sid:""})}),{user_id:o,access_token:a,device_id:c}=await s.attemptAuth(),l={user_id:o,access_token:a,device_id:c,passwordlessUser:!1};return await t?.logout(!0),[await xfe({baseUrl:e,accessToken:a,userId:o,deviceId:c},!1),l]},[t])}const iXe=()=>{const{t}=ze();AS(t("login_title"));const{client:e,setClient:n}=hm(),r=rXe(e),i=_n.defaultHomeserverUrl(),s=_.useRef(null),o=_.useRef(null),a=Fl(),c=cs(),[l,d]=_.useState(!1),[h,m]=_.useState(),g=_.useCallback(v=>{if(v.preventDefault(),d(!0),!i||!s.current||!o.current){m(Error("Login parameters are undefined")),d(!1);return}r(i,s.current.value,o.current.value).then(async([E,w])=>{if(!n)return;n(E,w);const k=c.state;k&&k.from?await a(k.from):await a("/"),en.instance.eventLogin.track()}).catch(E=>{m(E),d(!1)})},[r,c,a,i,n]);let y=_n.defaultServerName()?.slice(0,25);return y=y?.length!==_n.defaultServerName()?.length?y+"...":y,S.jsx(S.Fragment,{children:S.jsx("div",{className:ml.container,children:S.jsxs("div",{className:ml.content,children:[S.jsxs("div",{className:ml.formContainer,children:[S.jsx(Ufe,{width:"auto",height:"auto",className:ml.logo}),S.jsx("h2",{children:t("log_in")}),S.jsx("h4",{children:t("login_subheading")}),S.jsxs("form",{onSubmit:g,children:[S.jsx(Dt,{children:S.jsx(Zn,{type:"text",ref:s,placeholder:t("common.username"),label:t("common.username"),autoCorrect:"off",autoCapitalize:"none",prefix:"@",suffix:`:${y}`,"data-testid":"login_username"})}),S.jsx(Dt,{children:S.jsx(Zn,{type:"password",ref:o,placeholder:t("common.password"),label:t("common.password"),"data-testid":"login_password"})}),h&&S.jsx(Dt,{children:S.jsx(ph,{error:h})}),S.jsx(Dt,{children:S.jsx(Ht,{type:"submit",disabled:l,"data-testid":"login_login",children:t(l?"logging_in":"login_title")})})]})]}),S.jsxs("div",{className:ml.authLinks,children:[S.jsx("p",{children:t("login_auth_links_prompt")}),S.jsx("p",{children:S.jsxs(bo,{i18nKey:"login_auth_links",children:[S.jsx(Ll,{to:"/register",children:"Create an account"})," Or ",S.jsx(Ll,{to:"/",children:"Access as a guest"})]})})]})]})})})},sXe=()=>{const{t}=ze();AS(t("action.register"));const{loading:e,authenticated:n,passwordlessUser:r,client:i,setClient:s}=R9(),o=_.useRef(null),a=Fl(),c=cs(),[l,d]=_.useState(!1),[h,m]=_.useState(),[g,y]=_.useState(""),[v,E]=_.useState(""),{recaptchaKey:w,register:k}=ND(i),{execute:x,reset:C,recaptchaId:R}=UD(w),T=_.useCallback(M=>{M.preventDefault();const O=new FormData(M.target),P=O.get("userName"),D=O.get("password"),j=O.get("passwordConfirmation");if(D!==j)return;(async()=>{d(!0);const q=await x(),[Y,W]=await k(P,D,P,q,r);if(i&&i?.groupCallEventHandler&&r)for(const H of i.groupCallEventHandler.groupCalls.values()){const F=H.room.roomId;try{await Y.joinRoom(F)}catch(V){V.errcode==="M_LIMIT_EXCEEDED"?(await Wp(V.data.retry_after_ms),await Y.joinRoom(F)):(eR(V),N.error(`Couldn't join room ${F}`,V))}}s?.(Y,W),en.instance.eventSignup.cacheSignupEnd(new Date)})().then(async()=>{c.state?.from?await a(c.state?.from):await a("/")}).catch(q=>{m(q),d(!1),C()})},[k,c,a,r,C,x,i,s]);return _.useEffect(()=>{g&&v&&g!==v?o.current?.setCustomValidity(t("register.passwords_must_match")):o.current?.setCustomValidity("")},[g,v,t]),_.useEffect(()=>{!e&&n&&!r&&!l&&a("/")?.catch(M=>{N.error("Failed to navigate to /",M)})},[e,a,n,r,l]),e?S.jsx(UR,{}):(en.instance.eventSignup.cacheSignupStart(new Date),S.jsx(S.Fragment,{children:S.jsx("div",{className:ml.container,children:S.jsxs("div",{className:ml.content,children:[S.jsxs("div",{className:ml.formContainer,children:[S.jsx(Ufe,{width:"auto",height:"auto",className:ml.logo}),S.jsx("h2",{children:t("register_heading")}),S.jsxs("form",{onSubmit:T,children:[S.jsx(Dt,{children:S.jsx(Zn,{type:"text",name:"userName",placeholder:t("common.username"),label:t("common.username"),autoCorrect:"off",autoCapitalize:"none",prefix:"@",suffix:`:${_n.defaultServerName()}`,"data-testid":"register_username"})}),S.jsx(Dt,{children:S.jsx(Zn,{required:!0,name:"password",type:"password",onChange:M=>y(M.target.value),value:g,placeholder:t("common.password"),label:t("common.password"),"data-testid":"register_password"})}),S.jsx(Dt,{children:S.jsx(Zn,{required:!0,type:"password",name:"passwordConfirmation",onChange:M=>E(M.target.value),value:v,placeholder:t("register_confirm_password_label"),label:t("register_confirm_password_label"),ref:o,"data-testid":"register_confirm_password"})}),S.jsx(on,{size:"sm",children:S.jsxs(bo,{i18nKey:"recaptcha_ssla_caption",children:["This site is protected by ReCAPTCHA and the Google"," ",S.jsx(_p,{href:"https://www.google.com/policies/privacy/",children:"Privacy Policy"})," ","and"," ",S.jsx(_p,{href:"https://policies.google.com/terms",children:"Terms of Service"})," ","apply.",S.jsx("br",{}),'By clicking "Register", you agree to our'," ",S.jsx(_p,{href:_n.get().ssla,children:"Software and Services License Agreement (SSLA)"})]})}),h&&S.jsx(Dt,{children:S.jsx(ph,{error:h})}),S.jsx(Dt,{children:S.jsx(Ht,{type:"submit",disabled:l,"data-testid":"register_register",children:t(l?"register.registering":"action.register")})}),S.jsx("div",{id:R})]})]}),S.jsx("div",{className:ml.authLinks,children:S.jsxs(bo,{i18nKey:"register_auth_links",children:[S.jsx("p",{children:"Already have an account?"}),S.jsxs("p",{children:[S.jsx(Ll,{to:"/login",children:"Log in"})," Or ",S.jsx(Ll,{to:"/",children:"Access as a guest"})]})]})})]})})}))},oXe="_form_1wfyo_8",aXe="_headline_1wfyo_18",cXe="_container_1wfyo_37",lXe="_main_1wfyo_45",uXe="_footer_1wfyo_62",w1={form:oXe,headline:aXe,container:cXe,main:lXe,footer:uXe};function jfe(){const{setClient:t}=hm(),{privacyPolicyUrl:e,recaptchaKey:n,register:r}=ND(),{execute:i,reset:s,recaptchaId:o}=UD(n),a=_.useCallback(async c=>{if(!t)throw new Error("No client context");if(vt)throw new Error("Registration was skipped: We should never try to register password-less user in embedded mode.");try{const l=await i(),d=Dfe(),[h,m]=await r(d,Qo(16),c,l,!0);t(h,m)}catch(l){throw s(),l}},[i,s,r,t]);return{privacyPolicyUrl:e,registerPasswordlessUser:a,recaptchaId:o}}const dXe=()=>{const{header:t}=oc(),[e,n]=_.useState(!1),[r,i]=_.useState(),{registerPasswordlessUser:s,recaptchaId:o}=jfe(),a=_.useCallback(d=>{d.preventDefault(),n(!0);const m=new FormData(d.target).get("displayName");s(typeof m=="string"?m:"").catch(y=>{N.error("Failed to register passwordless user",d),n(!1),i(y)})},[s]),{t:c}=ze(),l=cs();return S.jsxs(S.Fragment,{children:[t==="standard"&&S.jsxs(hd,{children:[S.jsx(fh,{children:S.jsx(Bp,{})}),S.jsx(hh,{children:S.jsx(DD,{preventNavigation:!0})})]}),S.jsxs("div",{className:w1.container,children:[S.jsxs("main",{className:w1.main,children:[S.jsx(qc,{size:"xl",weight:"semibold",className:w1.headline,children:c("lobby.join_as_guest")}),S.jsxs(E4,{className:w1.form,onSubmit:a,children:[S.jsx(Dt,{children:S.jsx(Zn,{id:"displayName",name:"displayName",label:c("common.display_name"),placeholder:c("common.display_name"),"data-testid":"joincall_displayName",type:"text",required:!0,autoComplete:"off"})}),S.jsx(on,{size:"sm",children:S.jsxs(bo,{i18nKey:"room_auth_view_ssla_caption",children:['By clicking "Join call now", you agree to our'," ",S.jsx(_p,{href:_n.get().ssla,children:"Software and Services License Agreement (SSLA)"})]})}),r&&S.jsx(Dt,{children:S.jsx(ph,{error:r})}),S.jsx(Ht,{type:"submit",size:"lg",disabled:e,"data-testid":"joincall_joincall",children:c(e?"common.loading":"room_auth_view_continue_button")}),S.jsx("div",{id:o})]})]}),S.jsx(on,{className:w1.footer,children:S.jsxs(bo,{i18nKey:"unauthenticated_view_body",children:["Not registered yet?"," ",S.jsx(Ll,{to:"/register",state:{from:l},children:"Create an account"})]})})]})]})};var tE=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Ffe(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var MO={exports:{}},fXe=MO.exports,KW;function hXe(){return KW||(KW=1,(function(t){(function(e,n){t.exports?t.exports=n():e.log=n()})(fXe,function(){var e=function(){},n="undefined",r=typeof window!==n&&typeof window.navigator!==n&&/Trident\/|MSIE /.test(window.navigator.userAgent),i=["trace","debug","info","warn","error"],s={},o=null;function a(v,E){var w=v[E];if(typeof w.bind=="function")return w.bind(v);try{return Function.prototype.bind.call(w,v)}catch{return function(){return Function.prototype.apply.apply(w,[v,arguments])}}}function c(){console.log&&(console.log.apply?console.log.apply(console,arguments):Function.prototype.apply.apply(console.log,[console,arguments])),console.trace&&console.trace()}function l(v){return v==="debug"&&(v="log"),typeof console===n?!1:v==="trace"&&r?c:console[v]!==void 0?a(console,v):console.log!==void 0?a(console,"log"):e}function d(){for(var v=this.getLevel(),E=0;E<i.length;E++){var w=i[E];this[w]=E<v?e:this.methodFactory(w,v,this.name)}if(this.log=this.debug,typeof console===n&&v<this.levels.SILENT)return"No console available for logging"}function h(v){return function(){typeof console!==n&&(d.call(this),this[v].apply(this,arguments))}}function m(v,E,w){return l(v)||h.apply(this,arguments)}function g(v,E){var w=this,k,x,C,R="loglevel";typeof v=="string"?R+=":"+v:typeof v=="symbol"&&(R=void 0);function T(j){var $=(i[j]||"silent").toUpperCase();if(!(typeof window===n||!R)){try{window.localStorage[R]=$;return}catch{}try{window.document.cookie=encodeURIComponent(R)+"="+$+";"}catch{}}}function M(){var j;if(!(typeof window===n||!R)){try{j=window.localStorage[R]}catch{}if(typeof j===n)try{var $=window.document.cookie,q=encodeURIComponent(R),Y=$.indexOf(q+"=");Y!==-1&&(j=/^([^;]+)/.exec($.slice(Y+q.length+1))[1])}catch{}return w.levels[j]===void 0&&(j=void 0),j}}function O(){if(!(typeof window===n||!R)){try{window.localStorage.removeItem(R)}catch{}try{window.document.cookie=encodeURIComponent(R)+"=; expires=Thu, 01 Jan 1970 00:00:00 UTC"}catch{}}}function P(j){var $=j;if(typeof $=="string"&&w.levels[$.toUpperCase()]!==void 0&&($=w.levels[$.toUpperCase()]),typeof $=="number"&&$>=0&&$<=w.levels.SILENT)return $;throw new TypeError("log.setLevel() called with invalid level: "+j)}w.name=v,w.levels={TRACE:0,DEBUG:1,INFO:2,WARN:3,ERROR:4,SILENT:5},w.methodFactory=E||m,w.getLevel=function(){return C??x??k},w.setLevel=function(j,$){return C=P(j),$!==!1&&T(C),d.call(w)},w.setDefaultLevel=function(j){x=P(j),M()||w.setLevel(j,!1)},w.resetLevel=function(){C=null,O(),d.call(w)},w.enableAll=function(j){w.setLevel(w.levels.TRACE,j)},w.disableAll=function(j){w.setLevel(w.levels.SILENT,j)},w.rebuild=function(){if(o!==w&&(k=P(o.getLevel())),d.call(w),o===w)for(var j in s)s[j].rebuild()},k=P(o?o.getLevel():"WARN");var D=M();D!=null&&(C=P(D)),d.call(w)}o=new g,o.getLogger=function(v){if(typeof v!="symbol"&&typeof v!="string"||v==="")throw new TypeError("You must supply a name when creating a logger.");var E=s[v];return E||(E=s[v]=new g(v,o.methodFactory)),E};var y=typeof window!==n?window.log:void 0;return o.noConflict=function(){return typeof window!==n&&window.log===o&&(window.log=y),o},o.getLoggers=function(){return s},o.default=o,o})})(MO)),MO.exports}var pXe=hXe();const mXe=Ffe(pXe);var LO=function(t,e){return LO=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,r){n.__proto__=r}||function(n,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[i]=r[i])},LO(t,e)};function gd(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");LO(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}function gXe(t,e,n,r){function i(s){return s instanceof n?s:new n(function(o){o(s)})}return new(n||(n=Promise))(function(s,o){function a(d){try{l(r.next(d))}catch(h){o(h)}}function c(d){try{l(r.throw(d))}catch(h){o(h)}}function l(d){d.done?s(d.value):i(d.value).then(a,c)}l((r=r.apply(t,[])).next())})}function $fe(t,e){var n={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},r,i,s,o=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return o.next=a(0),o.throw=a(1),o.return=a(2),typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function a(l){return function(d){return c([l,d])}}function c(l){if(r)throw new TypeError("Generator is already executing.");for(;o&&(o=0,l[0]&&(n=0)),n;)try{if(r=1,i&&(s=l[0]&2?i.return:l[0]?i.throw||((s=i.return)&&s.call(i),0):i.next)&&!(s=s.call(i,l[1])).done)return s;switch(i=0,s&&(l=[l[0]&2,s.value]),l[0]){case 0:case 1:s=l;break;case 4:return n.label++,{value:l[1],done:!1};case 5:n.label++,i=l[1],l=[0];continue;case 7:l=n.ops.pop(),n.trys.pop();continue;default:if(s=n.trys,!(s=s.length>0&&s[s.length-1])&&(l[0]===6||l[0]===2)){n=0;continue}if(l[0]===3&&(!s||l[1]>s[0]&&l[1]<s[3])){n.label=l[1];break}if(l[0]===6&&n.label<s[1]){n.label=s[1],s=l;break}if(s&&n.label<s[2]){n.label=s[2],n.ops.push(l);break}s[2]&&n.ops.pop(),n.trys.pop();continue}l=e.call(t,n)}catch(d){l=[6,d],i=0}finally{r=s=0}if(l[0]&5)throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}}function ry(t){var e=typeof Symbol=="function"&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function nT(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r=n.call(t),i,s=[],o;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)s.push(i.value)}catch(a){o={error:a}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return s}function rT(t,e,n){if(arguments.length===2)for(var r=0,i=e.length,s;r<i;r++)(s||!(r in e))&&(s||(s=Array.prototype.slice.call(e,0,r)),s[r]=e[r]);return t.concat(s||Array.prototype.slice.call(e))}function vv(t){return this instanceof vv?(this.v=t,this):new vv(t)}function vXe(t,e,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r=n.apply(t,e||[]),i,s=[];return i=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),a("next"),a("throw"),a("return",o),i[Symbol.asyncIterator]=function(){return this},i;function o(g){return function(y){return Promise.resolve(y).then(g,h)}}function a(g,y){r[g]&&(i[g]=function(v){return new Promise(function(E,w){s.push([g,v,E,w])>1||c(g,v)})},y&&(i[g]=y(i[g])))}function c(g,y){try{l(r[g](y))}catch(v){m(s[0][3],v)}}function l(g){g.value instanceof vv?Promise.resolve(g.value.v).then(d,h):m(s[0][2],g)}function d(g){c("next",g)}function h(g){c("throw",g)}function m(g,y){g(y),s.shift(),s.length&&c(s[0][0],s[0][1])}}function yXe(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=t[Symbol.asyncIterator],n;return e?e.call(t):(t=typeof ry=="function"?ry(t):t[Symbol.iterator](),n={},r("next"),r("throw"),r("return"),n[Symbol.asyncIterator]=function(){return this},n);function r(s){n[s]=t[s]&&function(o){return new Promise(function(a,c){o=t[s](o),i(a,c,o.done,o.value)})}}function i(s,o,a,c){Promise.resolve(c).then(function(l){s({value:l,done:a})},o)}}function yi(t){return typeof t=="function"}function jD(t){var e=function(r){Error.call(r),r.stack=new Error().stack},n=t(e);return n.prototype=Object.create(Error.prototype),n.prototype.constructor=n,n}var _5=jD(function(t){return function(e){t(this),this.message=e?e.length+` errors occurred during unsubscription:
287
287
  `+e.map(function(n,r){return r+1+") "+n.toString()}).join(`
288
288
  `):"",this.name="UnsubscriptionError",this.errors=e}});function iT(t,e){if(t){var n=t.indexOf(e);0<=n&&t.splice(n,1)}}var MS=(function(){function t(e){this.initialTeardown=e,this.closed=!1,this._parentage=null,this._finalizers=null}return t.prototype.unsubscribe=function(){var e,n,r,i,s;if(!this.closed){this.closed=!0;var o=this._parentage;if(o)if(this._parentage=null,Array.isArray(o))try{for(var a=ry(o),c=a.next();!c.done;c=a.next()){var l=c.value;l.remove(this)}}catch(v){e={error:v}}finally{try{c&&!c.done&&(n=a.return)&&n.call(a)}finally{if(e)throw e.error}}else o.remove(this);var d=this.initialTeardown;if(yi(d))try{d()}catch(v){s=v instanceof _5?v.errors:[v]}var h=this._finalizers;if(h){this._finalizers=null;try{for(var m=ry(h),g=m.next();!g.done;g=m.next()){var y=g.value;try{GW(y)}catch(v){s=s??[],v instanceof _5?s=rT(rT([],nT(s)),nT(v.errors)):s.push(v)}}}catch(v){r={error:v}}finally{try{g&&!g.done&&(i=m.return)&&i.call(m)}finally{if(r)throw r.error}}}if(s)throw new _5(s)}},t.prototype.add=function(e){var n;if(e&&e!==this)if(this.closed)GW(e);else{if(e instanceof t){if(e.closed||e._hasParent(this))return;e._addParent(this)}(this._finalizers=(n=this._finalizers)!==null&&n!==void 0?n:[]).push(e)}},t.prototype._hasParent=function(e){var n=this._parentage;return n===e||Array.isArray(n)&&n.includes(e)},t.prototype._addParent=function(e){var n=this._parentage;this._parentage=Array.isArray(n)?(n.push(e),n):n?[n,e]:e},t.prototype._removeParent=function(e){var n=this._parentage;n===e?this._parentage=null:Array.isArray(n)&&iT(n,e)},t.prototype.remove=function(e){var n=this._finalizers;n&&iT(n,e),e instanceof t&&e._removeParent(this)},t.EMPTY=(function(){var e=new t;return e.closed=!0,e})(),t})(),Bfe=MS.EMPTY;function Hfe(t){return t instanceof MS||t&&"closed"in t&&yi(t.remove)&&yi(t.add)&&yi(t.unsubscribe)}function GW(t){yi(t)?t():t.unsubscribe()}var bXe={Promise:void 0},_Xe={setTimeout:function(t,e){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];return setTimeout.apply(void 0,rT([t,e],nT(n)))},clearTimeout:function(t){return clearTimeout(t)},delegate:void 0};function qfe(t){_Xe.setTimeout(function(){throw t})}function zW(){}function gC(t){t()}var FD=(function(t){gd(e,t);function e(n){var r=t.call(this)||this;return r.isStopped=!1,n?(r.destination=n,Hfe(n)&&n.add(r)):r.destination=EXe,r}return e.create=function(n,r,i){return new OO(n,r,i)},e.prototype.next=function(n){this.isStopped||this._next(n)},e.prototype.error=function(n){this.isStopped||(this.isStopped=!0,this._error(n))},e.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},e.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,t.prototype.unsubscribe.call(this),this.destination=null)},e.prototype._next=function(n){this.destination.next(n)},e.prototype._error=function(n){try{this.destination.error(n)}finally{this.unsubscribe()}},e.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},e})(MS),SXe=(function(){function t(e){this.partialObserver=e}return t.prototype.next=function(e){var n=this.partialObserver;if(n.next)try{n.next(e)}catch(r){nE(r)}},t.prototype.error=function(e){var n=this.partialObserver;if(n.error)try{n.error(e)}catch(r){nE(r)}else nE(e)},t.prototype.complete=function(){var e=this.partialObserver;if(e.complete)try{e.complete()}catch(n){nE(n)}},t})(),OO=(function(t){gd(e,t);function e(n,r,i){var s=t.call(this)||this,o;return yi(n)||!n?o={next:n??void 0,error:r??void 0,complete:i??void 0}:o=n,s.destination=new SXe(o),s}return e})(FD);function nE(t){qfe(t)}function wXe(t){throw t}var EXe={closed:!0,next:zW,error:wXe,complete:zW},$D=(function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"})();function Vfe(t){return t}function CXe(t){return t.length===0?Vfe:t.length===1?t[0]:function(e){return t.reduce(function(n,r){return r(n)},e)}}var da=(function(){function t(e){e&&(this._subscribe=e)}return t.prototype.lift=function(e){var n=new t;return n.source=this,n.operator=e,n},t.prototype.subscribe=function(e,n,r){var i=this,s=RXe(e)?e:new OO(e,n,r);return gC(function(){var o=i,a=o.operator,c=o.source;s.add(a?a.call(s,c):c?i._subscribe(s):i._trySubscribe(s))}),s},t.prototype._trySubscribe=function(e){try{return this._subscribe(e)}catch(n){e.error(n)}},t.prototype.forEach=function(e,n){var r=this;return n=WW(n),new n(function(i,s){var o=new OO({next:function(a){try{e(a)}catch(c){s(c),o.unsubscribe()}},error:s,complete:i});r.subscribe(o)})},t.prototype._subscribe=function(e){var n;return(n=this.source)===null||n===void 0?void 0:n.subscribe(e)},t.prototype[$D]=function(){return this},t.prototype.pipe=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return CXe(e)(this)},t.prototype.toPromise=function(e){var n=this;return e=WW(e),new e(function(r,i){var s;n.subscribe(function(o){return s=o},function(o){return i(o)},function(){return r(s)})})},t.create=function(e){return new t(e)},t})();function WW(t){var e;return(e=t??bXe.Promise)!==null&&e!==void 0?e:Promise}function TXe(t){return t&&yi(t.next)&&yi(t.error)&&yi(t.complete)}function RXe(t){return t&&t instanceof FD||TXe(t)&&Hfe(t)}function kXe(t){return yi(t?.lift)}function LS(t){return function(e){if(kXe(e))return e.lift(function(n){try{return t(n,this)}catch(r){this.error(r)}});throw new TypeError("Unable to lift unknown Observable type")}}function sT(t,e,n,r,i){return new IXe(t,e,n,r,i)}var IXe=(function(t){gd(e,t);function e(n,r,i,s,o,a){var c=t.call(this,n)||this;return c.onFinalize=o,c.shouldUnsubscribe=a,c._next=r?function(l){try{r(l)}catch(d){n.error(d)}}:t.prototype._next,c._error=s?function(l){try{s(l)}catch(d){n.error(d)}finally{this.unsubscribe()}}:t.prototype._error,c._complete=i?function(){try{i()}catch(l){n.error(l)}finally{this.unsubscribe()}}:t.prototype._complete,c}return e.prototype.unsubscribe=function(){var n;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){var r=this.closed;t.prototype.unsubscribe.call(this),!r&&((n=this.onFinalize)===null||n===void 0||n.call(this))}},e})(FD),xXe=jD(function(t){return function(){t(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}}),Kfe=(function(t){gd(e,t);function e(){var n=t.call(this)||this;return n.closed=!1,n.currentObservers=null,n.observers=[],n.isStopped=!1,n.hasError=!1,n.thrownError=null,n}return e.prototype.lift=function(n){var r=new YW(this,this);return r.operator=n,r},e.prototype._throwIfClosed=function(){if(this.closed)throw new xXe},e.prototype.next=function(n){var r=this;gC(function(){var i,s;if(r._throwIfClosed(),!r.isStopped){r.currentObservers||(r.currentObservers=Array.from(r.observers));try{for(var o=ry(r.currentObservers),a=o.next();!a.done;a=o.next()){var c=a.value;c.next(n)}}catch(l){i={error:l}}finally{try{a&&!a.done&&(s=o.return)&&s.call(o)}finally{if(i)throw i.error}}}})},e.prototype.error=function(n){var r=this;gC(function(){if(r._throwIfClosed(),!r.isStopped){r.hasError=r.isStopped=!0,r.thrownError=n;for(var i=r.observers;i.length;)i.shift().error(n)}})},e.prototype.complete=function(){var n=this;gC(function(){if(n._throwIfClosed(),!n.isStopped){n.isStopped=!0;for(var r=n.observers;r.length;)r.shift().complete()}})},e.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null},Object.defineProperty(e.prototype,"observed",{get:function(){var n;return((n=this.observers)===null||n===void 0?void 0:n.length)>0},enumerable:!1,configurable:!0}),e.prototype._trySubscribe=function(n){return this._throwIfClosed(),t.prototype._trySubscribe.call(this,n)},e.prototype._subscribe=function(n){return this._throwIfClosed(),this._checkFinalizedStatuses(n),this._innerSubscribe(n)},e.prototype._innerSubscribe=function(n){var r=this,i=this,s=i.hasError,o=i.isStopped,a=i.observers;return s||o?Bfe:(this.currentObservers=null,a.push(n),new MS(function(){r.currentObservers=null,iT(a,n)}))},e.prototype._checkFinalizedStatuses=function(n){var r=this,i=r.hasError,s=r.thrownError,o=r.isStopped;i?n.error(s):o&&n.complete()},e.prototype.asObservable=function(){var n=new da;return n.source=this,n},e.create=function(n,r){return new YW(n,r)},e})(da),YW=(function(t){gd(e,t);function e(n,r){var i=t.call(this)||this;return i.destination=n,i.source=r,i}return e.prototype.next=function(n){var r,i;(i=(r=this.destination)===null||r===void 0?void 0:r.next)===null||i===void 0||i.call(r,n)},e.prototype.error=function(n){var r,i;(i=(r=this.destination)===null||r===void 0?void 0:r.error)===null||i===void 0||i.call(r,n)},e.prototype.complete=function(){var n,r;(r=(n=this.destination)===null||n===void 0?void 0:n.complete)===null||r===void 0||r.call(n)},e.prototype._subscribe=function(n){var r,i;return(i=(r=this.source)===null||r===void 0?void 0:r.subscribe(n))!==null&&i!==void 0?i:Bfe},e})(Kfe);(function(t){gd(e,t);function e(n){var r=t.call(this)||this;return r._value=n,r}return Object.defineProperty(e.prototype,"value",{get:function(){return this.getValue()},enumerable:!1,configurable:!0}),e.prototype._subscribe=function(n){var r=t.prototype._subscribe.call(this,n);return!r.closed&&n.next(this._value),r},e.prototype.getValue=function(){var n=this,r=n.hasError,i=n.thrownError,s=n._value;if(r)throw i;return this._throwIfClosed(),s},e.prototype.next=function(n){t.prototype.next.call(this,this._value=n)},e})(Kfe);var AXe={now:function(){return Date.now()}},MXe=(function(t){gd(e,t);function e(n,r){return t.call(this)||this}return e.prototype.schedule=function(n,r){return this},e})(MS),JW={setInterval:function(t,e){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];return setInterval.apply(void 0,rT([t,e],nT(n)))},clearInterval:function(t){return clearInterval(t)},delegate:void 0},LXe=(function(t){gd(e,t);function e(n,r){var i=t.call(this,n,r)||this;return i.scheduler=n,i.work=r,i.pending=!1,i}return e.prototype.schedule=function(n,r){var i;if(r===void 0&&(r=0),this.closed)return this;this.state=n;var s=this.id,o=this.scheduler;return s!=null&&(this.id=this.recycleAsyncId(o,s,r)),this.pending=!0,this.delay=r,this.id=(i=this.id)!==null&&i!==void 0?i:this.requestAsyncId(o,this.id,r),this},e.prototype.requestAsyncId=function(n,r,i){return i===void 0&&(i=0),JW.setInterval(n.flush.bind(n,this),i)},e.prototype.recycleAsyncId=function(n,r,i){if(i===void 0&&(i=0),i!=null&&this.delay===i&&this.pending===!1)return r;r!=null&&JW.clearInterval(r)},e.prototype.execute=function(n,r){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;var i=this._execute(n,r);if(i)return i;this.pending===!1&&this.id!=null&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))},e.prototype._execute=function(n,r){var i=!1,s;try{this.work(n)}catch(o){i=!0,s=o||new Error("Scheduled action threw falsy error")}if(i)return this.unsubscribe(),s},e.prototype.unsubscribe=function(){if(!this.closed){var n=this,r=n.id,i=n.scheduler,s=i.actions;this.work=this.state=this.scheduler=null,this.pending=!1,iT(s,this),r!=null&&(this.id=this.recycleAsyncId(i,r,null)),this.delay=null,t.prototype.unsubscribe.call(this)}},e})(MXe),XW=(function(){function t(e,n){n===void 0&&(n=t.now),this.schedulerActionCtor=e,this.now=n}return t.prototype.schedule=function(e,n,r){return n===void 0&&(n=0),new this.schedulerActionCtor(this,e).schedule(r,n)},t.now=AXe.now,t})(),OXe=(function(t){gd(e,t);function e(n,r){r===void 0&&(r=XW.now);var i=t.call(this,n,r)||this;return i.actions=[],i._active=!1,i}return e.prototype.flush=function(n){var r=this.actions;if(this._active){r.push(n);return}var i;this._active=!0;do if(i=n.execute(n.state,n.delay))break;while(n=r.shift());if(this._active=!1,i){for(;n=r.shift();)n.unsubscribe();throw i}},e})(XW);new OXe(LXe);function PXe(t){return t&&yi(t.schedule)}function DXe(t){return t[t.length-1]}function Gfe(t){return PXe(DXe(t))?t.pop():void 0}var zfe=(function(t){return t&&typeof t.length=="number"&&typeof t!="function"});function Wfe(t){return yi(t?.then)}function Yfe(t){return yi(t[$D])}function Jfe(t){return Symbol.asyncIterator&&yi(t?.[Symbol.asyncIterator])}function Xfe(t){return new TypeError("You provided "+(t!==null&&typeof t=="object"?"an invalid object":"'"+t+"'")+" where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.")}function NXe(){return typeof Symbol!="function"||!Symbol.iterator?"@@iterator":Symbol.iterator}var Qfe=NXe();function Zfe(t){return yi(t?.[Qfe])}function ehe(t){return vXe(this,arguments,function(){var e,n,r,i;return $fe(this,function(s){switch(s.label){case 0:e=t.getReader(),s.label=1;case 1:s.trys.push([1,,9,10]),s.label=2;case 2:return[4,vv(e.read())];case 3:return n=s.sent(),r=n.value,i=n.done,i?[4,vv(void 0)]:[3,5];case 4:return[2,s.sent()];case 5:return[4,vv(r)];case 6:return[4,s.sent()];case 7:return s.sent(),[3,2];case 8:return[3,10];case 9:return e.releaseLock(),[7];case 10:return[2]}})})}function the(t){return yi(t?.getReader)}function OS(t){if(t instanceof da)return t;if(t!=null){if(Yfe(t))return UXe(t);if(zfe(t))return jXe(t);if(Wfe(t))return FXe(t);if(Jfe(t))return nhe(t);if(Zfe(t))return $Xe(t);if(the(t))return BXe(t)}throw Xfe(t)}function UXe(t){return new da(function(e){var n=t[$D]();if(yi(n.subscribe))return n.subscribe(e);throw new TypeError("Provided object does not correctly implement Symbol.observable")})}function jXe(t){return new da(function(e){for(var n=0;n<t.length&&!e.closed;n++)e.next(t[n]);e.complete()})}function FXe(t){return new da(function(e){t.then(function(n){e.closed||(e.next(n),e.complete())},function(n){return e.error(n)}).then(null,qfe)})}function $Xe(t){return new da(function(e){var n,r;try{for(var i=ry(t),s=i.next();!s.done;s=i.next()){var o=s.value;if(e.next(o),e.closed)return}}catch(a){n={error:a}}finally{try{s&&!s.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}e.complete()})}function nhe(t){return new da(function(e){HXe(t,e).catch(function(n){return e.error(n)})})}function BXe(t){return nhe(ehe(t))}function HXe(t,e){var n,r,i,s;return gXe(this,void 0,void 0,function(){var o,a;return $fe(this,function(c){switch(c.label){case 0:c.trys.push([0,5,6,11]),n=yXe(t),c.label=1;case 1:return[4,n.next()];case 2:if(r=c.sent(),!!r.done)return[3,4];if(o=r.value,e.next(o),e.closed)return[2];c.label=3;case 3:return[3,1];case 4:return[3,11];case 5:return a=c.sent(),i={error:a},[3,11];case 6:return c.trys.push([6,,9,10]),r&&!r.done&&(s=n.return)?[4,s.call(n)]:[3,8];case 7:c.sent(),c.label=8;case 8:return[3,10];case 9:if(i)throw i.error;return[7];case 10:return[7];case 11:return e.complete(),[2]}})})}function Rp(t,e,n,r,i){r===void 0&&(r=0),i===void 0&&(i=!1);var s=e.schedule(function(){n(),i?t.add(this.schedule(null,r)):this.unsubscribe()},r);if(t.add(s),!i)return s}function rhe(t,e){return e===void 0&&(e=0),LS(function(n,r){n.subscribe(sT(r,function(i){return Rp(r,t,function(){return r.next(i)},e)},function(){return Rp(r,t,function(){return r.complete()},e)},function(i){return Rp(r,t,function(){return r.error(i)},e)}))})}function ihe(t,e){return e===void 0&&(e=0),LS(function(n,r){r.add(t.schedule(function(){return n.subscribe(r)},e))})}function qXe(t,e){return OS(t).pipe(ihe(e),rhe(e))}function VXe(t,e){return OS(t).pipe(ihe(e),rhe(e))}function KXe(t,e){return new da(function(n){var r=0;return e.schedule(function(){r===t.length?n.complete():(n.next(t[r++]),n.closed||this.schedule())})})}function GXe(t,e){return new da(function(n){var r;return Rp(n,e,function(){r=t[Qfe](),Rp(n,e,function(){var i,s,o;try{i=r.next(),s=i.value,o=i.done}catch(a){n.error(a);return}o?n.complete():n.next(s)},0,!0)}),function(){return yi(r?.return)&&r.return()}})}function she(t,e){if(!t)throw new Error("Iterable cannot be null");return new da(function(n){Rp(n,e,function(){var r=t[Symbol.asyncIterator]();Rp(n,e,function(){r.next().then(function(i){i.done?n.complete():n.next(i.value)})},0,!0)})})}function zXe(t,e){return she(ehe(t),e)}function WXe(t,e){if(t!=null){if(Yfe(t))return qXe(t,e);if(zfe(t))return KXe(t,e);if(Wfe(t))return VXe(t,e);if(Jfe(t))return she(t,e);if(Zfe(t))return GXe(t,e);if(the(t))return zXe(t,e)}throw Xfe(t)}function YXe(t,e){return e?WXe(t,e):OS(t)}jD(function(t){return function(e){e===void 0&&(e=null),t(this),this.message="Timeout has occurred",this.name="TimeoutError",this.info=e}});function C4(t,e){return LS(function(n,r){var i=0;n.subscribe(sT(r,function(s){r.next(t.call(e,s,i++))}))})}function JXe(t,e,n,r,i,s,o,a){var c=[],l=0,d=0,h=!1,m=function(){h&&!c.length&&!l&&e.complete()},g=function(v){return l<r?y(v):c.push(v)},y=function(v){l++;var E=!1;OS(n(v,d++)).subscribe(sT(e,function(w){e.next(w)},function(){E=!0},void 0,function(){if(E)try{l--;for(var w=function(){var k=c.shift();o||y(k)};c.length&&l<r;)w();m()}catch(k){e.error(k)}}))};return t.subscribe(sT(e,g,function(){h=!0,m()})),function(){}}function ohe(t,e,n){return n===void 0&&(n=1/0),yi(e)?ohe(function(r,i){return C4(function(s,o){return e(r,s,i,o)})(OS(t(r,i)))},n):(typeof e=="number"&&(n=e),LS(function(r,i){return JXe(r,i,t,n)}))}function XXe(t){return ohe(Vfe,t)}function QXe(){return XXe(1)}function QW(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return QXe()(YXe(t,Gfe(t)))}function T4(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=Gfe(t);return LS(function(r,i){(n?QW(t,r,n):QW(t,r)).subscribe(i)})}var ZXe="lk";function ahe(t){return typeof t>"u"?!1:eQe(t)||tQe(t)}function eQe(t){var e;return t?t.hasOwnProperty("participant")&&t.hasOwnProperty("source")&&t.hasOwnProperty("track")&&typeof((e=t.publication)==null?void 0:e.track)<"u":!1}function tQe(t){return t?t.hasOwnProperty("participant")&&t.hasOwnProperty("source")&&t.hasOwnProperty("publication")&&typeof t.publication<"u":!1}var nQe=[pe.ConnectionStateChanged,pe.RoomMetadataChanged,pe.ActiveSpeakersChanged,pe.ConnectionQualityChanged,pe.ParticipantConnected,pe.ParticipantDisconnected,pe.ParticipantPermissionsChanged,pe.ParticipantMetadataChanged,pe.ParticipantNameChanged,pe.ParticipantAttributesChanged,pe.TrackMuted,pe.TrackUnmuted,pe.TrackPublished,pe.TrackUnpublished,pe.TrackStreamStateChanged,pe.TrackSubscriptionFailed,pe.TrackSubscriptionPermissionChanged,pe.TrackSubscriptionStatusChanged],rQe=[...nQe,pe.LocalTrackPublished,pe.LocalTrackUnpublished];ce.TrackPublished,ce.TrackUnpublished,ce.TrackMuted,ce.TrackUnmuted,ce.TrackStreamStateChanged,ce.TrackSubscribed,ce.TrackUnsubscribed,ce.TrackSubscriptionPermissionChanged,ce.TrackSubscriptionFailed,ce.LocalTrackPublished,ce.LocalTrackUnpublished;var iQe=[ce.ConnectionQualityChanged,ce.IsSpeakingChanged,ce.ParticipantMetadataChanged,ce.ParticipantPermissionsChanged,ce.TrackMuted,ce.TrackUnmuted,ce.TrackPublished,ce.TrackUnpublished,ce.TrackStreamStateChanged,ce.TrackSubscriptionFailed,ce.TrackSubscriptionPermissionChanged,ce.TrackSubscriptionStatusChanged];[...iQe,ce.LocalTrackPublished,ce.LocalTrackUnpublished];var rh=mXe.getLogger("lk-components-js");rh.setDefaultLevel("WARN");var che=(t=>(t.AgentState="lk.agent.state",t.PublishOnBehalf="lk.publish_on_behalf",t.TranscriptionFinal="lk.transcription_final",t.TranscriptionSegmentId="lk.segment_id",t.TranscribedTrackId="lk.transcribed_track_id",t))(che||{});function lhe(t){return typeof t=="object"}function uhe(t){return Array.isArray(t)&&t.filter(lhe).length>0}function sQe(t){return`${ZXe}-${t}`}function oQe(t){const e=PO(t),n=lQe(t.participant).pipe(C4(()=>PO(t)),T4(e));return{className:sQe(t.source===me.Source.Camera||t.source===me.Source.ScreenShare?"participant-media-video":"participant-media-audio"),trackObserver:n}}function PO(t){if(ahe(t))return t.publication;{const{source:e,name:n,participant:r}=t;if(e&&n)return r.getTrackPublications().find(i=>i.source===e&&i.trackName===n);if(n)return r.getTrackPublicationByName(n);if(e)return r.getTrackPublication(e);throw new Error("At least one of source and name needs to be defined")}}function aQe(t,...e){return new da(n=>{const r=()=>{n.next(t)};return e.forEach(i=>{t.on(i,r)}),()=>{e.forEach(i=>{t.off(i,r)})}}).pipe(T4(t))}function cQe(t,...e){return new da(n=>{const r=()=>{n.next(t)};return e.forEach(i=>{t.on(i,r)}),()=>{e.forEach(i=>{t.off(i,r)})}}).pipe(T4(t))}function lQe(t){return cQe(t,ce.TrackMuted,ce.TrackUnmuted,ce.ParticipantPermissionsChanged,ce.TrackPublished,ce.TrackUnpublished,ce.LocalTrackPublished,ce.LocalTrackUnpublished,ce.MediaDevicesError,ce.TrackSubscriptionStatusChanged).pipe(C4(e=>{const{isMicrophoneEnabled:n,isCameraEnabled:r,isScreenShareEnabled:i}=e,s=e.getTrackPublication(me.Source.Microphone),o=e.getTrackPublication(me.Source.Camera);return{isCameraEnabled:r,isMicrophoneEnabled:n,isScreenShareEnabled:i,cameraTrack:o,microphoneTrack:s,participant:e}}))}function ZW(t,e,n=!0){const r=[t.localParticipant,...Array.from(t.remoteParticipants.values())],i=[];return r.forEach(s=>{e.forEach(o=>{const a=Array.from(s.trackPublications.values()).filter(c=>c.source===o&&(!n||c.track)).map(c=>({participant:s,publication:c,source:c.source}));i.push(...a)})}),{trackReferences:i,participants:r}}function uQe(t,e,n){var r,i;const s=(r=n.additionalRoomEvents)!=null?r:rQe,o=(i=n.onlySubscribed)!=null?i:!0,a=Array.from(new Set([pe.ParticipantConnected,pe.ParticipantDisconnected,pe.ConnectionStateChanged,pe.LocalTrackPublished,pe.LocalTrackUnpublished,pe.TrackPublished,pe.TrackUnpublished,pe.TrackSubscriptionStatusChanged,...s]).values());return aQe(t,...a).pipe(C4(c=>{const l=ZW(c,e,o);return rh.debug(`TrackReference[] was updated. (length ${l.trackReferences.length})`,l),l}),T4(ZW(t,e,o)))}_.createContext(void 0);const dQe=_.createContext(void 0);function fQe(){return _.useContext(dQe)}function dhe(t){const e=fQe(),n=t??e;if(!n)throw new Error("No TrackRef, make sure you are inside a TrackRefContext or pass the TrackRef explicitly");return n}_.createContext(void 0);const hQe=_.createContext(void 0);function pQe(){return _.useContext(hQe)}function mQe(t){const e=pQe(),n=t??e;if(!n)throw new Error("No room provided, make sure you are inside a Room context or pass the room explicitly");return n}_.createContext(void 0);_.createContext(void 0);function fhe(t){var e,n,r="";if(typeof t=="string"||typeof t=="number")r+=t;else if(typeof t=="object")if(Array.isArray(t)){var i=t.length;for(e=0;e<i;e++)t[e]&&(n=fhe(t[e]))&&(r&&(r+=" "),r+=n)}else for(n in t)t[n]&&(r&&(r+=" "),r+=n);return r}function gQe(){for(var t,e,n=0,r="",i=arguments.length;n<i;n++)(t=arguments[n])&&(e=fhe(t))&&(r&&(r+=" "),r+=e);return r}function vQe(...t){return(...e)=>{for(const n of t)if(typeof n=="function")try{n(...e)}catch(r){console.error(r)}}}function yQe(...t){const e={...t[0]};for(let n=1;n<t.length;n++){const r=t[n];for(const i in r){const s=e[i],o=r[i];typeof s=="function"&&typeof o=="function"&&i[0]==="o"&&i[1]==="n"&&i.charCodeAt(2)>=65&&i.charCodeAt(2)<=90?e[i]=vQe(s,o):(i==="className"||i==="UNSAFE_className")&&typeof s=="string"&&typeof o=="string"?e[i]=gQe(s,o):e[i]=o!==void 0?o:s}}return e}function bQe(t){return t!==void 0}function _Qe(...t){return yQe(...t.filter(bQe))}function SQe(t,e){return t==="processor"&&e&&typeof e=="object"&&"name"in e?e.name:t==="e2ee"&&e?"e2ee-enabled":e}function wQe(t=[me.Source.Camera,me.Source.Microphone,me.Source.ScreenShare,me.Source.ScreenShareAudio,me.Source.Unknown],e={}){const n=mQe(e.room),[r,i]=_.useState([]),[s,o]=_.useState([]),a=_.useMemo(()=>t.map(c=>lhe(c)?c.source:c),[JSON.stringify(t)]);return _.useEffect(()=>{const c=uQe(n,a,{additionalRoomEvents:e.updateOnlyOn,onlySubscribed:e.onlySubscribed}).subscribe(({trackReferences:l,participants:d})=>{rh.debug("setting track bundles",l,d),i(l),o(d)});return()=>c.unsubscribe()},[n,JSON.stringify(e.onlySubscribed),JSON.stringify(e.updateOnlyOn),JSON.stringify(t)]),_.useMemo(()=>{if(uhe(t)){const c=CQe(t,s),l=Array.from(r);return s.forEach(d=>{c.has(d.identity)&&(c.get(d.identity)??[]).forEach(h=>{if(r.find(({participant:g,publication:y})=>d.identity===g.identity&&y.source===h))return;rh.debug(`Add ${h} placeholder for participant ${d.identity}.`);const m={participant:d,source:h};l.push(m)})}),l}else return r},[r,s,t])}function EQe(t,e){const n=new Set(t);for(const r of e)n.delete(r);return n}function CQe(t,e){const n=new Map;if(uhe(t)){const r=t.filter(i=>i.withPlaceholder).map(i=>i.source);e.forEach(i=>{const s=i.getTrackPublications().map(a=>{var c;return(c=a.track)==null?void 0:c.source}).filter(a=>a!==void 0),o=Array.from(EQe(new Set(r),new Set(s)));o.length>0&&n.set(i.identity,o)})}return n}che.AgentState;var rE={exports:{}},eY;function TQe(){if(eY)return rE.exports;eY=1;var t=typeof Reflect=="object"?Reflect:null,e=t&&typeof t.apply=="function"?t.apply:function(C,R,T){return Function.prototype.apply.call(C,R,T)},n;t&&typeof t.ownKeys=="function"?n=t.ownKeys:Object.getOwnPropertySymbols?n=function(C){return Object.getOwnPropertyNames(C).concat(Object.getOwnPropertySymbols(C))}:n=function(C){return Object.getOwnPropertyNames(C)};function r(C){console&&console.warn&&console.warn(C)}var i=Number.isNaN||function(C){return C!==C};function s(){s.init.call(this)}rE.exports=s,rE.exports.once=w,s.EventEmitter=s,s.prototype._events=void 0,s.prototype._eventsCount=0,s.prototype._maxListeners=void 0;var o=10;function a(C){if(typeof C!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof C)}Object.defineProperty(s,"defaultMaxListeners",{enumerable:!0,get:function(){return o},set:function(C){if(typeof C!="number"||C<0||i(C))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+C+".");o=C}}),s.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},s.prototype.setMaxListeners=function(C){if(typeof C!="number"||C<0||i(C))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+C+".");return this._maxListeners=C,this};function c(C){return C._maxListeners===void 0?s.defaultMaxListeners:C._maxListeners}s.prototype.getMaxListeners=function(){return c(this)},s.prototype.emit=function(C){for(var R=[],T=1;T<arguments.length;T++)R.push(arguments[T]);var M=C==="error",O=this._events;if(O!==void 0)M=M&&O.error===void 0;else if(!M)return!1;if(M){var P;if(R.length>0&&(P=R[0]),P instanceof Error)throw P;var D=new Error("Unhandled error."+(P?" ("+P.message+")":""));throw D.context=P,D}var j=O[C];if(j===void 0)return!1;if(typeof j=="function")e(j,this,R);else for(var $=j.length,q=y(j,$),T=0;T<$;++T)e(q[T],this,R);return!0};function l(C,R,T,M){var O,P,D;if(a(T),P=C._events,P===void 0?(P=C._events=Object.create(null),C._eventsCount=0):(P.newListener!==void 0&&(C.emit("newListener",R,T.listener?T.listener:T),P=C._events),D=P[R]),D===void 0)D=P[R]=T,++C._eventsCount;else if(typeof D=="function"?D=P[R]=M?[T,D]:[D,T]:M?D.unshift(T):D.push(T),O=c(C),O>0&&D.length>O&&!D.warned){D.warned=!0;var j=new Error("Possible EventEmitter memory leak detected. "+D.length+" "+String(R)+" listeners added. Use emitter.setMaxListeners() to increase limit");j.name="MaxListenersExceededWarning",j.emitter=C,j.type=R,j.count=D.length,r(j)}return C}s.prototype.addListener=function(C,R){return l(this,C,R,!1)},s.prototype.on=s.prototype.addListener,s.prototype.prependListener=function(C,R){return l(this,C,R,!0)};function d(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function h(C,R,T){var M={fired:!1,wrapFn:void 0,target:C,type:R,listener:T},O=d.bind(M);return O.listener=T,M.wrapFn=O,O}s.prototype.once=function(C,R){return a(R),this.on(C,h(this,C,R)),this},s.prototype.prependOnceListener=function(C,R){return a(R),this.prependListener(C,h(this,C,R)),this},s.prototype.removeListener=function(C,R){var T,M,O,P,D;if(a(R),M=this._events,M===void 0)return this;if(T=M[C],T===void 0)return this;if(T===R||T.listener===R)--this._eventsCount===0?this._events=Object.create(null):(delete M[C],M.removeListener&&this.emit("removeListener",C,T.listener||R));else if(typeof T!="function"){for(O=-1,P=T.length-1;P>=0;P--)if(T[P]===R||T[P].listener===R){D=T[P].listener,O=P;break}if(O<0)return this;O===0?T.shift():v(T,O),T.length===1&&(M[C]=T[0]),M.removeListener!==void 0&&this.emit("removeListener",C,D||R)}return this},s.prototype.off=s.prototype.removeListener,s.prototype.removeAllListeners=function(C){var R,T,M;if(T=this._events,T===void 0)return this;if(T.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):T[C]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete T[C]),this;if(arguments.length===0){var O=Object.keys(T),P;for(M=0;M<O.length;++M)P=O[M],P!=="removeListener"&&this.removeAllListeners(P);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(R=T[C],typeof R=="function")this.removeListener(C,R);else if(R!==void 0)for(M=R.length-1;M>=0;M--)this.removeListener(C,R[M]);return this};function m(C,R,T){var M=C._events;if(M===void 0)return[];var O=M[R];return O===void 0?[]:typeof O=="function"?T?[O.listener||O]:[O]:T?E(O):y(O,O.length)}s.prototype.listeners=function(C){return m(this,C,!0)},s.prototype.rawListeners=function(C){return m(this,C,!1)},s.listenerCount=function(C,R){return typeof C.listenerCount=="function"?C.listenerCount(R):g.call(C,R)},s.prototype.listenerCount=g;function g(C){var R=this._events;if(R!==void 0){var T=R[C];if(typeof T=="function")return 1;if(T!==void 0)return T.length}return 0}s.prototype.eventNames=function(){return this._eventsCount>0?n(this._events):[]};function y(C,R){for(var T=new Array(R),M=0;M<R;++M)T[M]=C[M];return T}function v(C,R){for(;R+1<C.length;R++)C[R]=C[R+1];C.pop()}function E(C){for(var R=new Array(C.length),T=0;T<R.length;++T)R[T]=C[T].listener||C[T];return R}function w(C,R){return new Promise(function(T,M){function O(D){C.removeListener(R,P),M(D)}function P(){typeof C.removeListener=="function"&&C.removeListener("error",O),T([].slice.call(arguments))}x(C,R,P,{once:!0}),R!=="error"&&k(C,O,{once:!0})})}function k(C,R,T){typeof C.on=="function"&&x(C,"error",R,T)}function x(C,R,T,M){if(typeof C.on=="function")M.once?C.once(R,T):C.on(R,T);else if(typeof C.addEventListener=="function")C.addEventListener(R,function O(P){M.once&&C.removeEventListener(R,O),T(P)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof C)}return rE.exports}TQe();function hhe(t,e={}){const[n,r]=_.useState(PO(t)),[i,s]=_.useState(n?.isMuted),[o,a]=_.useState(n?.isSubscribed),[c,l]=_.useState(n?.track),[d,h]=_.useState("landscape"),m=_.useRef(),{className:g,trackObserver:y}=_.useMemo(()=>oQe(t),[t.participant.sid??t.participant.identity,t.source,ahe(t)&&t.publication.trackSid]);return _.useEffect(()=>{const v=y.subscribe(E=>{rh.debug("update track",E),r(E),s(E?.isMuted),a(E?.isSubscribed),l(E?.track)});return()=>v?.unsubscribe()},[y]),_.useEffect(()=>{var v,E;return c&&(m.current&&c.detach(m.current),(v=e.element)!=null&&v.current&&!(t.participant.isLocal&&c?.kind==="audio")&&c.attach(e.element.current)),m.current=(E=e.element)==null?void 0:E.current,()=>{m.current&&c?.detach(m.current)}},[c,e.element]),_.useEffect(()=>{var v,E;if(typeof((v=n?.dimensions)==null?void 0:v.width)=="number"&&typeof((E=n?.dimensions)==null?void 0:E.height)=="number"){const w=n.dimensions.width>n.dimensions.height?"landscape":"portrait";h(w)}},[n]),{publication:n,isMuted:i,isSubscribed:o,track:c,elementProps:_Qe(e.props,{className:g,"data-lk-local-participant":t.participant.isLocal,"data-lk-source":n?.source,...n?.kind==="video"&&{"data-lk-orientation":d}})}}var S5,tY;function RQe(){if(tY)return S5;tY=1;var t="Expected a function",e=NaN,n="[object Symbol]",r=/^\s+|\s+$/g,i=/^[-+]0x[0-9a-f]+$/i,s=/^0b[01]+$/i,o=/^0o[0-7]+$/i,a=parseInt,c=typeof tE=="object"&&tE&&tE.Object===Object&&tE,l=typeof self=="object"&&self&&self.Object===Object&&self,d=c||l||Function("return this")(),h=Object.prototype,m=h.toString,g=Math.max,y=Math.min,v=function(){return d.Date.now()};function E(R,T,M){var O,P,D,j,$,q,Y=0,W=!1,H=!1,F=!0;if(typeof R!="function")throw new TypeError(t);T=C(T)||0,w(M)&&(W=!!M.leading,H="maxWait"in M,D=H?g(C(M.maxWait)||0,T):D,F="trailing"in M?!!M.trailing:F);function V(ae){var ke=O,Ne=P;return O=P=void 0,Y=ae,j=R.apply(Ne,ke),j}function G(ae){return Y=ae,$=setTimeout(Q,T),W?V(ae):j}function ee(ae){var ke=ae-q,Ne=ae-Y,Ze=T-ke;return H?y(Ze,D-Ne):Ze}function K(ae){var ke=ae-q,Ne=ae-Y;return q===void 0||ke>=T||ke<0||H&&Ne>=D}function Q(){var ae=v();if(K(ae))return fe(ae);$=setTimeout(Q,ee(ae))}function fe(ae){return $=void 0,F&&O?V(ae):(O=P=void 0,j)}function de(){$!==void 0&&clearTimeout($),Y=0,O=q=P=$=void 0}function Te(){return $===void 0?j:fe(v())}function we(){var ae=v(),ke=K(ae);if(O=arguments,P=this,q=ae,ke){if($===void 0)return G(q);if(H)return $=setTimeout(Q,T),V(q)}return $===void 0&&($=setTimeout(Q,T)),j}return we.cancel=de,we.flush=Te,we}function w(R){var T=typeof R;return!!R&&(T=="object"||T=="function")}function k(R){return!!R&&typeof R=="object"}function x(R){return typeof R=="symbol"||k(R)&&m.call(R)==n}function C(R){if(typeof R=="number")return R;if(x(R))return e;if(w(R)){var T=typeof R.valueOf=="function"?R.valueOf():R;R=w(T)?T+"":T}if(typeof R!="string")return R===0?R:+R;R=R.replace(r,"");var M=s.test(R);return M||o.test(R)?a(R.slice(2),M?2:8):i.test(R)?e:+R}return S5=E,S5}var kQe=RQe();const nY=Ffe(kQe);function IQe(t){const e=_.useRef(t);e.current=t,_.useEffect(()=>()=>{e.current()},[])}function xQe(t,e=500,n){const r=_.useRef();IQe(()=>{r.current&&r.current.cancel()});const i=_.useMemo(()=>{const s=nY(t,e,n),o=(...a)=>s(...a);return o.cancel=()=>{s.cancel()},o.isPending=()=>!!r.current,o.flush=()=>s.flush(),o},[t,e,n]);return _.useEffect(()=>{r.current=nY(t,e,n)},[t,e,n]),i}function AQe(t,e,n){const r=((l,d)=>l===d),i=t instanceof Function?t():t,[s,o]=_.useState(i),a=_.useRef(i),c=xQe(o,e,n);return r(a.current,i)||(c(i),a.current=i),[s,c]}function MQe({threshold:t=0,root:e=null,rootMargin:n="0%",freezeOnceVisible:r=!1,initialIsIntersecting:i=!1,onChange:s}={}){var o;const[a,c]=_.useState(null),[l,d]=_.useState(()=>({isIntersecting:i,entry:void 0})),h=_.useRef();h.current=s;const m=((o=l.entry)==null?void 0:o.isIntersecting)&&r;_.useEffect(()=>{if(!a||!("IntersectionObserver"in window)||m)return;const v=new IntersectionObserver(E=>{const w=Array.isArray(v.thresholds)?v.thresholds:[v.thresholds];E.forEach(k=>{const x=k.isIntersecting&&w.some(C=>k.intersectionRatio>=C);d({isIntersecting:x,entry:k}),h.current&&h.current(x,k)})},{threshold:t,root:e,rootMargin:n});return v.observe(a),()=>{v.disconnect()}},[a,JSON.stringify(t),e,n,m,r]);const g=_.useRef(null);_.useEffect(()=>{var v;!a&&(v=l.entry)!=null&&v.target&&!r&&!m&&g.current!==l.entry.target&&(g.current=l.entry.target,d({isIntersecting:i,entry:void 0}))},[a,l.entry,r,m,i]);const y=[c,!!l.isIntersecting,l.entry];return y.ref=y[0],y.isIntersecting=y[1],y.entry=y[2],y}const LQe=_.forwardRef(function({onTrackClick:t,onClick:e,onSubscriptionStatusChanged:n,trackRef:r,manageSubscription:i,...s},o){const a=dhe(r),c=_.useRef(null);_.useImperativeHandle(o,()=>c.current);const l=MQe({root:c.current}),[d]=AQe(l,3e3);_.useEffect(()=>{i&&a.publication instanceof JC&&d?.isIntersecting===!1&&l?.isIntersecting===!1&&a.publication.setSubscribed(!1)},[d,a,i]),_.useEffect(()=>{i&&a.publication instanceof JC&&l?.isIntersecting===!0&&a.publication.setSubscribed(!0)},[l,a,i]);const{elementProps:h,publication:m,isSubscribed:g}=hhe(a,{element:c,props:s});_.useEffect(()=>{n?.(!!g)},[g,n]);const y=v=>{e?.(v),t?.({participant:a?.participant,track:m})};return _.createElement("video",{ref:c,...h,muted:!0,onClick:y})}),OQe=_.forwardRef(function({trackRef:t,onSubscriptionStatusChanged:e,volume:n,...r},i){const s=dhe(t),o=_.useRef(null);_.useImperativeHandle(i,()=>o.current);const{elementProps:a,isSubscribed:c,track:l,publication:d}=hhe(s,{element:o,props:r});return _.useEffect(()=>{e?.(!!c)},[c,e]),_.useEffect(()=>{l===void 0||n===void 0||(l instanceof bee?l.setVolume(n):rh.warn("Volume can only be set on remote audio tracks."))},[n,l]),_.useEffect(()=>{d===void 0||r.muted===void 0||(d instanceof JC?d.setEnabled(!r.muted):rh.warn("Can only call setEnabled on remote track publications."))},[r.muted,d,l]),_.createElement("audio",{ref:o,...a})});function PQe(t,e){const[n,r]=_.useState(),i=_.useMemo(()=>new ws,[]);return _.useEffect(()=>{let s=!1,o=[];return i.lock().then(async a=>{try{(t.audio||t.video)&&(o=await q_(t),s?o.forEach(c=>c.stop()):r(o))}catch(c){e&&c instanceof Error?e(c):rh.error(c)}finally{a()}}),()=>{s=!0,o.forEach(a=>{a.stop()})}},[JSON.stringify(t,SQe),e,i]),n}const DQe="_inRoom_osvhp_8",NQe="_header_osvhp_17",UQe="_filler_osvhp_29",jQe="_footer_osvhp_34",FQe="_hidden_osvhp_53",$Qe="_overlay_osvhp_57",BQe="_logo_osvhp_76",HQe="_buttons_osvhp_85",qQe="_layout_osvhp_92",VQe="_shareScreen_osvhp_124",KQe="_invite_osvhp_141",GQe="_raiseHand_osvhp_142",zQe="_fixedGrid_osvhp_153",WQe="_scrollingGrid_osvhp_159",YQe="_tile_osvhp_178",JQe="_maximised_osvhp_183",Tr={inRoom:DQe,header:NQe,filler:UQe,footer:jQe,hidden:FQe,overlay:$Qe,logo:BQe,buttons:HQe,layout:qQe,shareScreen:VQe,invite:KQe,raiseHand:GQe,fixedGrid:zQe,scrollingGrid:WQe,tile:YQe,maximised:JQe},XQe="_content_1cy0f_8",QQe="_wait_1cy0f_19",ZQe="_join_1cy0f_32",E1={content:XQe,wait:QQe,join:ZQe};function rY(t,e){let n;return(...r)=>{window.clearTimeout(n),n=window.setTimeout(()=>t(...r),e)}}function wb({debounce:t,scroll:e,polyfill:n,offsetSize:r}={debounce:0,scroll:!1,offsetSize:!1}){const i=n||(typeof window>"u"?class{}:window.ResizeObserver);if(!i)throw new Error("This browser does not support ResizeObserver out of the box. See: https://github.com/react-spring/react-use-measure/#resize-observer-polyfills");const[s,o]=_.useState({left:0,top:0,width:0,height:0,bottom:0,right:0,x:0,y:0}),a=_.useRef({element:null,scrollContainers:null,resizeObserver:null,lastBounds:s,orientationHandler:null}),c=t?typeof t=="number"?t:t.scroll:null,l=t?typeof t=="number"?t:t.resize:null,d=_.useRef(!1);_.useEffect(()=>(d.current=!0,()=>{d.current=!1}));const[h,m,g]=_.useMemo(()=>{const w=()=>{if(!a.current.element)return;const{left:k,top:x,width:C,height:R,bottom:T,right:M,x:O,y:P}=a.current.element.getBoundingClientRect(),D={left:k,top:x,width:C,height:R,bottom:T,right:M,x:O,y:P};a.current.element instanceof HTMLElement&&r&&(D.height=a.current.element.offsetHeight,D.width=a.current.element.offsetWidth),Object.freeze(D),d.current&&!rZe(a.current.lastBounds,D)&&o(a.current.lastBounds=D)};return[w,l?rY(w,l):w,c?rY(w,c):w]},[o,r,c,l]);function y(){a.current.scrollContainers&&(a.current.scrollContainers.forEach(w=>w.removeEventListener("scroll",g,!0)),a.current.scrollContainers=null),a.current.resizeObserver&&(a.current.resizeObserver.disconnect(),a.current.resizeObserver=null),a.current.orientationHandler&&("orientation"in screen&&"removeEventListener"in screen.orientation?screen.orientation.removeEventListener("change",a.current.orientationHandler):"onorientationchange"in window&&window.removeEventListener("orientationchange",a.current.orientationHandler))}function v(){a.current.element&&(a.current.resizeObserver=new i(g),a.current.resizeObserver.observe(a.current.element),e&&a.current.scrollContainers&&a.current.scrollContainers.forEach(w=>w.addEventListener("scroll",g,{capture:!0,passive:!0})),a.current.orientationHandler=()=>{g()},"orientation"in screen&&"addEventListener"in screen.orientation?screen.orientation.addEventListener("change",a.current.orientationHandler):"onorientationchange"in window&&window.addEventListener("orientationchange",a.current.orientationHandler))}const E=w=>{!w||w===a.current.element||(y(),a.current.element=w,a.current.scrollContainers=phe(w),v())};return tZe(g,!!e),eZe(m),_.useEffect(()=>{y(),v()},[e,g,m]),_.useEffect(()=>y,[]),[E,s,h]}function eZe(t){_.useEffect(()=>{const e=t;return window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}},[t])}function tZe(t,e){_.useEffect(()=>{if(e){const n=t;return window.addEventListener("scroll",n,{capture:!0,passive:!0}),()=>{window.removeEventListener("scroll",n,!0)}}},[t,e])}function phe(t){const e=[];if(!t||t===document.body)return e;const{overflow:n,overflowX:r,overflowY:i}=window.getComputedStyle(t);return[n,r,i].some(s=>s==="auto"||s==="scroll")&&e.push(t),[...e,...phe(t.parentElement)]}const nZe=["x","y","top","bottom","left","right","width","height"],rZe=(t,e)=>nZe.every(n=>t[n]===e[n]),iZe="_loading_14w06_8",sZe={loading:iZe},oZe=({size:t,loading:e,...n})=>S.jsxs("div",{children:[e&&S.jsx("div",{className:sZe.loading,children:S.jsx(Ioe,{size:t/3})}),S.jsx(Iy,{size:t,...n})]}),aZe="_preview_1jjvr_8",cZe="_mirror_1jjvr_24",lZe="_cameraStarting_1jjvr_28",uZe="_avatarContainer_1jjvr_39",dZe="_buttonBar_1jjvr_51",C1={preview:aZe,mirror:cZe,cameraStarting:lZe,avatarContainer:uZe,buttonBar:dZe},fZe=({matrixInfo:t,videoEnabled:e,videoTrack:n,children:r})=>{const{t:i}=ze(),[s,o]=wb(),a=_.useRef(null);_.useEffect(()=>(a.current&&n?.attach(a.current),()=>{n?.detach()}),[n]);const c=_.useMemo(()=>e&&!n,[e,n]);return S.jsxs("div",{className:Le(C1.preview),ref:s,children:[S.jsx("video",{className:n&&RM(n).facingMode==="user"?C1.mirror:void 0,ref:a,muted:!0,playsInline:!0,tabIndex:-1,disablePictureInPicture:!0}),(!e||c)&&S.jsx(S.Fragment,{children:S.jsxs("div",{className:C1.avatarContainer,children:[c&&S.jsx("div",{className:C1.cameraStarting,role:"status",children:i("video_tile.camera_starting")}),S.jsx(oZe,{id:t.userId,name:t.displayName,size:Math.min(o.width,o.height)/2,src:t.avatarUrl,loading:c})]})}),S.jsx("div",{className:C1.buttonBar,children:r})]})},mhe=t=>{const{t:e}=ze();return S.jsx(Ht,{kind:"secondary",size:"sm",Icon:cNe,...t,children:e("action.invite")})};function jf(t){const e=_.useRef(void 0);return e.current??={value:t()},e.current.value}const ghe=({client:t,matrixInfo:e,muteStates:n,onEnter:r,enterLabel:i,confineToRoom:s,hideHeader:o,participantCount:a,onShareClick:c,waitingForInvite:l})=>{_.useEffect(()=>(N.info("[Lifecycle] LobbyView Component mounted"),()=>{N.info("[Lifecycle] LobbyView Component unmounted")}),[]);const{t:d}=ze();AS(e.roomName);const h=je(n.audio.enabled$),m=je(n.video.enabled$),g=je(n.audio.toggle$),y=je(n.video.toggle$),[v,E]=_.useState(!1),[w,k]=_.useState(OD),x=_.useCallback(()=>E(!0),[E]),C=_.useCallback(()=>E(!1),[E]),R=Fl(),T=_.useCallback(()=>{R("/")?.catch(V=>{N.error("Failed to navigate to /",V)})},[R]),M=DR("(max-height: 500px)"),O=!s&&S.jsx(Ll,{className:E1.recents,to:"/",children:d("lobby.leave_button")}),P=pm(),D=So(P.videoInput.selected$)?.id,j=jf(()=>h&&{deviceId:DGe(P.audioInput.selected$)?.id}),{processor:$}=LD(),q=jf(()=>$),Y=_.useMemo(()=>({audio:Object.assign({},j),video:m&&{deviceId:D,processor:q}}),[j,m,D,q]),W=_.useCallback(V=>{N.error("Error while creating preview Tracks:",V),n.audio.setEnabled$.value?.(!1),n.video.setEnabled$.value?.(!1)},[n]),H=PQe(Y,W),F=_.useMemo(()=>H?.find(V=>V.kind===me.Kind.Video)??null,[H]);return _.useEffect(()=>{F&&D===void 0&&P.requestDeviceNames()},[P,D,F]),PYe(F),S.jsxs(S.Fragment,{children:[S.jsxs("div",{className:Le(E1.room,Tr.inRoom),children:[!o&&S.jsxs(hd,{children:[S.jsx(fh,{children:S.jsx(sce,{id:e.roomId,name:e.roomName,avatarUrl:e.roomAvatar,encrypted:e.e2eeSystem.kind!==qn.NONE,participantCount:a})}),S.jsx(hh,{children:c!==null&&S.jsx(mhe,{onClick:c})})]}),S.jsxs("div",{className:E1.content,children:[S.jsx(fZe,{matrixInfo:e,videoEnabled:m,videoTrack:F,children:S.jsx(Ht,{className:Le(E1.join,{[E1.wait]:l}),size:l?"sm":"lg",disabled:l,onClick:()=>{l||r()},"data-testid":"lobby_joinCall",children:i??d("lobby.join_button")})}),!M&&O]}),S.jsxs("div",{className:Tr.footer,children:[M&&O,S.jsxs("div",{className:Tr.buttons,children:[S.jsx(oce,{enabled:h,onClick:g??void 0,disabled:g===null}),S.jsx(ace,{enabled:m,onClick:y??void 0,disabled:y===null}),S.jsx(lce,{onClick:x}),!s&&S.jsx(cce,{onClick:T})]})]})]}),t&&S.jsx(PD,{client:t,open:v,onDismiss:C,tab:w,onTabChange:k})]})},hZe="_headline_1em2y_8",pZe="_callEndedContent_1em2y_15",mZe="_callEndedButton_1em2y_35",gZe="_submitButton_1em2y_40",vZe="_container_1em2y_47",yZe="_main_1em2y_55",bZe="_footer_1em2y_72",Jd={headline:hZe,callEndedContent:pZe,callEndedButton:mZe,submitButton:gZe,container:vZe,main:yZe,footer:bZe},_Ze="_starIcon_1m09w_8",SZe="_starRating_1m09w_12",wZe="_inputContainer_1m09w_18",EZe="_hideElement_1m09w_22",T1={starIcon:_Ze,starRating:SZe,inputContainer:wZe,hideElement:EZe},CZe=(t,e)=>_.createElement("svg",{width:28,height:26,viewBox:"0 0 28 26",fill:"none",xmlns:"http://www.w3.org/2000/svg",ref:e,...t},_.createElement("path",{d:"M14 21.0267L22.24 26.0001L20.0533 16.6267L27.3333 10.3201L17.7466 9.50675L14 0.666748L10.2533 9.50675L0.666626 10.3201L7.94663 16.6267L5.75996 26.0001L14 21.0267Z",fill:"white"})),TZe=_.forwardRef(CZe),RZe=(t,e)=>_.createElement("svg",{width:28,height:26,viewBox:"0 0 28 26",fill:"none",xmlns:"http://www.w3.org/2000/svg",ref:e,...t},_.createElement("path",{id:"Vector",d:"M14 7.50675L15.2933 10.5601L15.92 12.0401L17.52 12.1734L20.8133 12.4534L18.3066 14.6267L17.0933 15.6801L17.4533 17.2534L18.2 20.4667L15.3733 18.7601L14 17.9067L12.6266 18.7334L9.79996 20.4401L10.5466 17.2267L10.9066 15.6534L9.69329 14.6001L7.18663 12.4267L10.48 12.1467L12.08 12.0134L12.7066 10.5334L14 7.50675M14 0.666748L10.2533 9.50675L0.666626 10.3201L7.94663 16.6267L5.75996 26.0001L14 21.0267L22.24 26.0001L20.0533 16.6267L27.3333 10.3201L17.7466 9.50675L14 0.666748Z",fill:"white"})),kZe=_.forwardRef(RZe);function IZe({starCount:t,onChange:e,required:n}){const[r,i]=_.useState(0),[s,o]=_.useState(0),{t:a}=ze();return S.jsx("div",{className:T1.starRating,children:[...Array(t)].map((c,l)=>(l+=1,S.jsxs("div",{className:T1.inputContainer,onMouseEnter:()=>o(l),onMouseLeave:()=>o(r),children:[S.jsx("input",{className:T1.hideElement,type:"radio",id:"starInput"+String(l),value:String(l)+"Star",name:"star rating",onChange:d=>{i(l),e(l)},required:!0}),S.jsx("label",{className:T1.hideElement,id:"starInvisibleLabel"+String(l),htmlFor:"starInput"+String(l),children:a("star_rating_input_label",{count:l})}),S.jsx("label",{className:T1.starIcon,id:"starIcon"+String(l),htmlFor:"starInput"+String(l),children:l<=(s||r)?S.jsx(TZe,{}):S.jsx(kZe,{})})]},l)))})}const xZe=({client:t,isPasswordlessUser:e,hideHeader:n,confineToRoom:r,endedCallId:i})=>{const{t:s}=ze(),o=Fl(),{displayName:a}=yS(t),[c,l]=_.useState(!1),[d,h]=_.useState(0),[m,g]=_.useState(!1),[y,v]=_.useState(!1),E=_.useCallback(x=>{x.preventDefault();const R=new FormData(x.target).get("feedbackText");en.instance.eventQualitySurvey.track(i,R,d),g(!0),setTimeout(()=>{v(!0),setTimeout(()=>{e?l(!0):r||o("/")?.catch(T=>{N.error("Failed to navigate to /",T)})},1e3)},1e3)},[i,o,e,r,d]),w=e&&S.jsxs("div",{className:Jd.callEndedContent,children:[S.jsxs(bo,{i18nKey:"call_ended_view.create_account_prompt",children:[S.jsx("p",{children:"Why not finish by setting up a password to keep your account?"}),S.jsx("p",{children:"You'll be able to keep your name and set an avatar for use on future calls"})]}),S.jsx(s9,{className:Jd.callEndedButton,to:"/register",children:s("call_ended_view.create_account_button")})]}),k=S.jsxs("div",{className:Jd.callEndedContent,children:[S.jsx(bo,{i18nKey:"call_ended_view.feedback_prompt",children:S.jsx("p",{children:"We'd love to hear your feedback so we can improve your experience."})}),S.jsxs("form",{onSubmit:E,children:[S.jsx(Dt,{children:S.jsx(IZe,{starCount:5,onChange:h,required:!0})}),S.jsx(Dt,{children:S.jsx(Zn,{className:Ble.feedback,id:"feedbackText",name:"feedbackText",label:s("settings.feedback_tab_description_label"),placeholder:s("settings.feedback_tab_description_label"),type:"textarea"})})," ",S.jsx(Dt,{children:y?S.jsx(bo,{i18nKey:"call_ended_view.feedback_done",children:S.jsx("p",{children:"Thanks for your feedback!"})}):S.jsx(Ht,{type:"submit",className:Jd.submitButton,"data-testid":"home_go",children:s(m?"submitting":"action.submit")})})]})]});return S.jsxs(S.Fragment,{children:[!n&&S.jsxs(hd,{children:[S.jsx(fh,{children:!r&&S.jsx(Bp,{})}),S.jsx(hh,{})]}),S.jsxs("div",{className:Jd.container,children:[S.jsxs("main",{className:Jd.main,children:[S.jsx(qc,{size:"xl",weight:"semibold",className:Jd.headline,children:c?s("call_ended_view.headline",{displayName:a}):s("call_ended_view.headline",{displayName:a})+`
@@ -295,6 +295,6 @@ Make sure your charset is UTF-8`);s=(s>>>8&255)*192+(s&255),r.put(s,13)}},sA=n,s
295
295
  The chosen QR Code version cannot contain this amount of data.
296
296
  Minimum version required to store current data is: `+j+`.
297
297
  `);const $=x(M,O,D),q=t.getSymbolSize(M),Y=new r(q);return g(Y,M),y(Y),v(Y,M),w(Y,O,0),M>=7&&E(Y,M),k(Y,$),isNaN(P)&&(P=o.getBestMask(Y,w.bind(null,Y,O))),o.applyMask(P,Y),w(Y,O,P),{modules:Y,version:M,errorCorrectionLevel:O,maskPattern:P,segments:D}}return H5.create=function(M,O){if(typeof M>"u"||M==="")throw new Error("No input text");let P=e.M,D,j;return typeof O<"u"&&(P=e.from(O.errorCorrectionLevel,e.M),D=l.from(O.version),j=o.from(O.maskPattern),O.toSJISFunc&&t.setToSJISFunction(O.toSJISFunc)),R(M,D,P,j)},H5}var aA={},cA={},SJ;function Upe(){return SJ||(SJ=1,(function(t){function e(n){if(typeof n=="number"&&(n=n.toString()),typeof n!="string")throw new Error("Color should be defined as hex string");let r=n.slice().replace("#","").split("");if(r.length<3||r.length===5||r.length>8)throw new Error("Invalid hex color: "+n);(r.length===3||r.length===4)&&(r=Array.prototype.concat.apply([],r.map(function(s){return[s,s]}))),r.length===6&&r.push("F","F");const i=parseInt(r.join(""),16);return{r:i>>24&255,g:i>>16&255,b:i>>8&255,a:i&255,hex:"#"+r.slice(0,6).join("")}}t.getOptions=function(r){r||(r={}),r.color||(r.color={});const i=typeof r.margin>"u"||r.margin===null||r.margin<0?4:r.margin,s=r.width&&r.width>=21?r.width:void 0,o=r.scale||4;return{width:s,scale:s?4:o,margin:i,color:{dark:e(r.color.dark||"#000000ff"),light:e(r.color.light||"#ffffffff")},type:r.type,rendererOpts:r.rendererOpts||{}}},t.getScale=function(r,i){return i.width&&i.width>=r+i.margin*2?i.width/(r+i.margin*2):i.scale},t.getImageWidth=function(r,i){const s=t.getScale(r,i);return Math.floor((r+i.margin*2)*s)},t.qrToImageData=function(r,i,s){const o=i.modules.size,a=i.modules.data,c=t.getScale(o,s),l=Math.floor((o+s.margin*2)*c),d=s.margin*c,h=[s.color.light,s.color.dark];for(let m=0;m<l;m++)for(let g=0;g<l;g++){let y=(m*l+g)*4,v=s.color.light;if(m>=d&&g>=d&&m<l-d&&g<l-d){const E=Math.floor((m-d)/c),w=Math.floor((g-d)/c);v=h[a[E*o+w]?1:0]}r[y++]=v.r,r[y++]=v.g,r[y++]=v.b,r[y]=v.a}}})(cA)),cA}var wJ;function qst(){return wJ||(wJ=1,(function(t){const e=Upe();function n(i,s,o){i.clearRect(0,0,s.width,s.height),s.style||(s.style={}),s.height=o,s.width=o,s.style.height=o+"px",s.style.width=o+"px"}function r(){try{return document.createElement("canvas")}catch{throw new Error("You need to specify a canvas element")}}t.render=function(s,o,a){let c=a,l=o;typeof c>"u"&&(!o||!o.getContext)&&(c=o,o=void 0),o||(l=r()),c=e.getOptions(c);const d=e.getImageWidth(s.modules.size,c),h=l.getContext("2d"),m=h.createImageData(d,d);return e.qrToImageData(m.data,s,c),n(h,l,d),h.putImageData(m,0,0),l},t.renderToDataURL=function(s,o,a){let c=a;typeof c>"u"&&(!o||!o.getContext)&&(c=o,o=void 0),c||(c={});const l=t.render(s,o,c),d=c.type||"image/png",h=c.rendererOpts||{};return l.toDataURL(d,h.quality)}})(aA)),aA}var lA={},EJ;function Vst(){if(EJ)return lA;EJ=1;const t=Upe();function e(i,s){const o=i.a/255,a=s+'="'+i.hex+'"';return o<1?a+" "+s+'-opacity="'+o.toFixed(2).slice(1)+'"':a}function n(i,s,o){let a=i+s;return typeof o<"u"&&(a+=" "+o),a}function r(i,s,o){let a="",c=0,l=!1,d=0;for(let h=0;h<i.length;h++){const m=Math.floor(h%s),g=Math.floor(h/s);!m&&!l&&(l=!0),i[h]?(d++,h>0&&m>0&&i[h-1]||(a+=l?n("M",m+o,.5+g+o):n("m",c,0),c=0,l=!1),m+1<s&&i[h+1]||(a+=n("h",d),d=0)):c++}return a}return lA.render=function(s,o,a){const c=t.getOptions(o),l=s.modules.size,d=s.modules.data,h=l+c.margin*2,m=c.color.light.a?"<path "+e(c.color.light,"fill")+' d="M0 0h'+h+"v"+h+'H0z"/>':"",g="<path "+e(c.color.dark,"stroke")+' d="'+r(d,l,c.margin)+'"/>',y='viewBox="0 0 '+h+" "+h+'"',E='<svg xmlns="http://www.w3.org/2000/svg" '+(c.width?'width="'+c.width+'" height="'+c.width+'" ':"")+y+' shape-rendering="crispEdges">'+m+g+`</svg>
298
- `;return typeof a=="function"&&a(null,E),E},lA}var CJ;function Kst(){if(CJ)return kg;CJ=1;const t=Tst(),e=Hst(),n=qst(),r=Vst();function i(s,o,a,c,l){const d=[].slice.call(arguments,1),h=d.length,m=typeof d[h-1]=="function";if(!m&&!t())throw new Error("Callback required as last argument");if(m){if(h<2)throw new Error("Too few arguments provided");h===2?(l=a,a=o,o=c=void 0):h===3&&(o.getContext&&typeof l>"u"?(l=c,c=void 0):(l=c,c=a,a=o,o=void 0))}else{if(h<1)throw new Error("Too few arguments provided");return h===1?(a=o,o=c=void 0):h===2&&!o.getContext&&(c=a,a=o,o=void 0),new Promise(function(g,y){try{const v=e.create(a,c);g(s(v,o,c))}catch(v){y(v)}})}try{const g=e.create(a,c);l(null,s(g,o,c))}catch(g){l(g)}}return kg.create=e.create,kg.toCanvas=i.bind(null,n.render),kg.toDataURL=i.bind(null,n.renderToDataURL),kg.toString=i.bind(null,function(s,o,a){return r.render(s,a)}),kg}var Gst=Kst();const zst="_qrCode_h54ia_8",Wst={qrCode:zst},Yst=({data:t,className:e})=>{const[n,r]=_.useState(null);return _.useEffect(()=>{let i=!1;return Gst.toDataURL(t,{errorCorrectionLevel:"L"}).then(s=>{i||r(s)}).catch(s=>{i||r(null)}),()=>{i=!0}},[t]),S.jsx("div",{className:Le(Wst.qrCode,e),children:n&&S.jsx("img",{src:n,alt:$i("qr_code")})})},Jst=({room:t,open:e,onDismiss:n})=>{const{t:r}=ze(),i=_4(t.roomId),s=_.useMemo(()=>Lfe(t.roomId,i,t.name),[i,t.name,t.roomId]),[o,a]=_.useState(!1),c=_.useCallback(()=>a(!1),[a]),l=_.useCallback(d=>{d.stopPropagation(),Sst(s),n(),a(!0)},[s,n]);return S.jsxs(S.Fragment,{children:[S.jsxs(fm,{title:r("invite_modal.title"),open:e,onDismiss:n,children:[S.jsx(Yst,{className:$5.qrCode,data:s}),S.jsx(on,{className:$5.url,size:"sm",weight:"semibold",children:s}),S.jsx(Ht,{className:$5.button,Icon:YDe,onClick:l,"data-testid":"modal_inviteLink",children:r("action.copy_link")})]}),S.jsx(Lpe,{open:o,onDismiss:c,autoDismiss:2e3,Icon:F8,children:r("invite_modal.link_copied_toast")})]})},Xst=({error:t,recoveryActionHandler:e,widget:n})=>{const{t:r}=ze();N.error("Error boundary caught:",t);let i;switch(t.category){case pC.CONFIGURATION_ISSUE:i=WDe;break;case pC.NETWORK_CONNECTIVITY:i=ZDe;break;case pC.CLIENT_CONFIGURATION:i=dNe;break;default:i=Q_}const s=[];return t instanceof Efe&&s.push({label:r("call_ended_view.reconnect_button"),onClick:()=>{e("reconnect")}}),S.jsx(lv,{children:S.jsxs(g_,{Icon:i,title:t.localisedTitle,rageshake:t.code==wfe.UNKNOWN_ERROR,widget:n,children:[S.jsx("p",{children:t.localisedMessage??S.jsx(bo,{i18nKey:"error.unexpected_ec_error",components:[S.jsx("b",{}),S.jsx("code",{})],values:{errorCode:t.code}})}),s&&s.map((o,a)=>S.jsx(Ht,{kind:"secondary",onClick:o.onClick,children:o.label},`action${a}`))]})})},Qst=({recoveryActionHandler:t,onError:e,children:n,widget:r})=>{const i=_.useCallback(({error:s,resetError:o})=>{const a=s instanceof ji?s:new Gp(s instanceof Error?s:new Error);return S.jsx(Xst,{widget:r??null,error:a,resetError:o,recoveryActionHandler:async c=>{await t(c),o()}})},[t,r]);return S.jsx(rR,{fallback:i,onError:s=>e?.(s),children:n})},Zst=8,eot=({client:t,isPasswordlessUser:e,confineToRoom:n,preload:r,skipLobby:i,header:s,rtcSession:o,joined:a,setJoined:c,muteStates:l,widget:d})=>{const[h,m]=_.useState(null),g=dce(o),y=je(Mpe),v=ih(N4({sounds:Ape,latencyHint:"interactive",muted:y}));_.useEffect(()=>{g.length>=Zst&&l.audio.setEnabled$.value?.(!1)},[]),_.useEffect(()=>(N.info("[Lifecycle] GroupCallView Component mounted"),()=>{N.info("[Lifecycle] GroupCallView Component unmounted")}),[]),_.useEffect(()=>(document.body.classList.add("no-scroll-body"),()=>{document.body.classList.remove("no-scroll-body")}),[]),_.useEffect(()=>(window.rtcSession=o,()=>{delete window.rtcSession}),[o]),KBe(o,Zi.MembershipManagerError,ae=>m(new Efe)),_.useEffect(()=>{t.getRoom(o.room.roomId)!==o.room&&N.warn(`We've ended up with multiple rooms for the same ID (${o.room.roomId}). This indicates a bug in the group call loading code, and may lead to incomplete room state.`)},[t,o.room]);const E=o.room,{displayName:w,avatarUrl:k}=yS(t),x=gst(E),C=mst(E),{perParticipantE2EE:R,returnToLobby:T,password:M}=oc(),O=_4(E.roomId);_.useEffect(()=>{M&&kfe(E.roomId,M)},[M,E.roomId]),AS(x),ost(x);const P=_.useMemo(()=>({userId:t.getUserId(),displayName:w,avatarUrl:k,roomId:E.roomId,roomName:x,roomAlias:E.getCanonicalAlias(),roomAvatar:C,e2eeSystem:O}),[t,w,k,x,E,C,O]),D=_.useMemo(()=>new Set(g.map(ae=>ae.userId)).size,[g]),j=pm(),$=ih(l),q=_.useCallback(async ae=>{try{c(!0)}catch(ke){if(ke instanceof ji)m(ke);else{N.error("Unknown Error while entering RTC session",ke);const Ne=new Gp(ke instanceof Error?ke:new Error("Unknown error",{cause:ke}));m(Ne)}}return Promise.resolve()},[c]);_.useEffect(()=>{const ae=async({audioInput:ke,videoInput:Ne})=>{const Ze=await Wu.getLocalDevices(void 0,!0);if(ke){const Ot=iY(ke,"audioinput",Ze);Ot?(N.debug(`Found audio input ID ${Ot} for name ${ke}`),j.audioInput.select(Ot)):(N.warn("Unknown audio input: "+ke),$.current.audio.setEnabled$.value?.(!1))}if(Ne){const Ot=iY(Ne,"videoinput",Ze);Ot?(N.debug(`Found video input ID ${Ot} for name ${Ne}`),j.videoInput.select(Ot)):(N.warn("Unknown video input: "+Ne),$.current.video.setEnabled$.value?.(!1))}};if(i)if(d&&r){const ke=Ne=>{(async()=>{await ae(Ne.detail.data),c(!0),d.api.transport.reply(Ne.detail,{})})().catch(Ze=>{N.error("Error joining RTC session on preload",Ze)})};return d.lazyActions.on(Tl.JoinCall,ke),()=>{d.lazyActions.off(Tl.JoinCall,ke)}}else c(!0)},[d,o,r,i,R,j,$,c]);const[Y,W]=_.useState(!1),H=Fl(),F=_.useCallback(ae=>{let ke="left";(ae==="timeout"||ae==="decline")&&(ke=ae),c(!1),W(!0);const Ne=v.current?.playSound(ke),Ze=new Promise(Ot=>{const Mr=d!==null;en.instance.eventCallEnded.track(E.roomId,o.memberships.length,Mr,o),window.setTimeout(Ot,10)});Promise.all([Ne,Ze]).catch(Ot=>N.error("Failed to play leave audio and/or send PostHog leave event",Ot)).then(async()=>{if(!e&&!n&&!en.instance.isEnabled()&&H("/"),d){try{await d.api.setAlwaysOnScreen(!1)}catch(Ot){N.error("Failed to set call widget `alwaysOnScreen` to false",Ot)}if(ae!="error"&&!er().returnToLobby){try{await d.api.transport.send(Tl.Close,{})}catch(Ot){N.error("Failed to send close action",Ot)}d.api.transport.stop()}}})},[c,v,d,E.roomId,o,e,n,H]);_.useEffect(()=>{d&&a&&d.api.setAlwaysOnScreen(!0).catch(ae=>{N.error("Error calling setAlwaysOnScreen(true)",ae)})},[d,a,o]);const V=vst(E),[G,ee]=_.useState(!1),K=_.useCallback(()=>ee(!1),[ee]),Q=_.useCallback(()=>ee(!0),[ee]),fe=V===kf.Public?Q:null;if(!tee()&&O.kind!==qn.NONE)throw new FYe;const de=S.jsx(Jst,{room:E,open:G,onDismiss:K}),Te=S.jsxs(S.Fragment,{children:[de,S.jsx(ghe,{client:t,matrixInfo:P,muteStates:l,onEnter:()=>c(!0),confineToRoom:n,hideHeader:s===h_.None,participantCount:D,onShareClick:fe})]});let we;if(h){const ae=()=>{throw h};we=S.jsx(ae,{})}else a?we=S.jsxs(S.Fragment,{children:[de,S.jsx(hst,{client:t,matrixInfo:P,rtcSession:o,matrixRoom:E,onLeft:F,header:s,muteStates:l,e2eeSystem:O,onShareClick:fe})]}):Y&&d===null?e||en.instance.isEnabled()&&d===null?we=S.jsx(xZe,{endedCallId:o.room.roomId,client:t,isPasswordlessUser:e,hideHeader:s===h_.None,confineToRoom:n}):we=null:Y&&d!==null?we=T?Te:null:r||i?we=null:we=Te;return S.jsx(Qst,{widget:d,recoveryActionHandler:async ae=>{m(null),ae=="reconnect"&&(W(!1),await q(o).catch(ke=>{N.error("Error re-entering RTC session",ke)}))},onError:()=>{o.isJoined()&&F("error")},children:we})},tot="_modal_1tnec_8",not={modal:tot},rot=({roomId:t})=>{const{t:e}=ze(),[n,r]=_.useState(!0),i=_.useCallback(a=>{a.preventDefault(),a.stopPropagation(),r(!1)},[r]),s=_4(t);s.kind===qn.NONE&&N.error("Generating app redirect URL for encrypted room but don't have key available!");const o=_.useMemo(()=>{const a=new URL(t===null?window.location.href:Lfe(t,s));a.hash=O$e(a.hash,l=>(l.set("appPrompt","false"),l.set("confineToRoom","true"),l));const c=new URL("io.element.call:/");return c.searchParams.set("url",a.toString()),c.toString()},[s,t]);return S.jsxs(fm,{className:not.modal,title:e("app_selection_modal.title"),open:n,children:[S.jsx(on,{size:"md",weight:"semibold",children:e("app_selection_modal.text")}),S.jsx(Ht,{kind:"secondary",onClick:i,children:e("app_selection_modal.continue_in_browser")}),S.jsx(Ht,{as:"a",href:o,Icon:uae,children:e("app_selection_modal.open_in_app")})]})},iot=3,sot=3e3;async function jpe(t,e=0,...n){try{return await t.joinRoom(...n)}catch(r){if(r instanceof In&&r.errcode==="M_FORBIDDEN"&&e<iot)return await new Promise(i=>setTimeout(i,sot)),jpe(t,e+1,...n);throw r}}class _C extends Error{constructor(e,n,r,i){super(n),this.icon=e,this.messageBody=r,this.reason=i}}const oot=(t,e,n)=>{const[r,i]=_.useState({kind:"loading"}),s=_.useRef(void 0),{t:o}=ze(),a=_.useCallback(()=>new _C(qDe,o("group_call_loader.banned_heading"),o("group_call_loader.banned_body"),d()),[o]),c=_.useCallback(()=>new _C(Z_,o("group_call_loader.knock_reject_heading"),o("group_call_loader.knock_reject_body"),d()),[o]),l=_.useCallback(()=>new _C(kR,o("group_call_loader.call_ended_heading"),o("group_call_loader.call_ended_body"),d()),[o]),d=()=>s.current?.currentState.getStateEvents(Z.RoomMember,s.current?.myUserId)?.getContent().reason;return _.useEffect(()=>{if(!t||!e)return;const h=async w=>{let k=null;const x=await t.getRoomIdForAlias(w.toLowerCase());return N.info(`${w} resolved to ${x.room_id}`),k=t.getRoom(x.room_id),k?N.info(`Already in room ${x.room_id}, not rejoining.`):(N.info(`Room ${x.room_id} not found, joining.`),k=await t.joinRoom(x.room_id,{viaServers:x.servers})),k},m=async(w,k,x)=>(await t.knockRoom(w,{viaServers:k}),x(),await new Promise((C,R)=>{t.on(Oe.MyMembership,(T,M,O)=>{w===T.roomId&&(s.current=T,M===Ve.Invite&&O===Ve.Knock&&jpe(t,0,T.roomId,{viaServers:k}).then(P=>{N.log("Auto-joined %s",P.roomId),C(P)},R),M===Ve.Ban&&R(a()),M===Ve.Leave&&R(c()))})})),g=async()=>{let w=null;if(e[0]==="#")w=await h(e),s.current=w;else{const k=e;w=t.getRoom(k),s.current=w??void 0;const x=w?.getMyMembership();if(x===Ve.Join)return w;if(vt)throw new Error("Room not found. The widget-api did not pass over the relevant room events/information.");if(x===Ve.Ban)throw a();if(x===Ve.Invite)w=await t.joinRoom(k,{viaServers:n});else{let C;try{C=await t.getRoomSummary(k,n)}catch(R){N.warn("Could not load room summary to decide whether we want to join or knock.\n EC will fallback to join as if this would be a public room.\n Reach out to your homeserver admin to ask them about supporting the `/summary` endpoint (im.nheko.summary):",R)}if(C===void 0||C.join_rule===kf.Public)w=await t.joinRoom(k,{viaServers:n});else if(C.join_rule===kf.Knock){const R=C;let T=()=>{};const M=new Promise(O=>{R.membership!==Ve.Knock?T=O:O()});i({kind:"canKnock",roomSummary:R,knock:T}),await M,w=await m(C.room_id,n,()=>i({kind:"waitForInvite",roomSummary:R}))}else throw new Error(`Room ${C.room_id} is not joinable. This likely means, that the conference owner has changed the room settings to private.`)}}return N.info(`Joined ${e}, waiting room to be ready for group calls`),await t.waitUntilRoomReadyForGroupCalls(w.roomId),N.info(`${e}, is ready for group calls`),w},y=async()=>{const w=await g();return s.current=w,N.debug(`Fetched / joined room ${e}`),t.matrixRTC.getRoomSession(w)},v=async()=>{t.getSyncState()!==Qt.Syncing&&(N.debug("useLoadGroupCall: waiting for client to start syncing..."),await new Promise(w=>{const k=()=>{if(t.getSyncState()===Qt.Syncing)return t.off(De.Sync,k),w()};t.on(De.Sync,k)}),N.debug("useLoadGroupCall: client is now syncing."))},E=async()=>{await new Promise((w,k)=>{t.on(Oe.MyMembership,(x,C)=>{C===Ve.Leave&&k(l()),C===Ve.Ban&&k(a())})})};r.kind==="loading"&&(N.log("Start loading group call"),v().then(y).then(w=>i({kind:"loaded",rtcSession:w})).then(E).catch(w=>i({kind:"failed",error:w})))},[a,t,c,l,e,r,o,n]),r},uA=async t=>Promise.resolve(t);class TJ{constructor(e,n,r,i){this.scope=e,this.device=n,this.enabledByDefault=r,this.forceMute$=i,this.handler$=new cr(uA),this.canControlDevices$=mt([this.device.available$,this.forceMute$]).pipe(ge(([s,o])=>!o&&s.size>0)),this.data$=this.scope.behavior(this.canControlDevices$.pipe(Ni(),ge(s=>{if(N.info(`MuteState: canControlDevices: ${s}, enabled by default: ${this.enabledByDefault}`),!s)return N.info(`MuteState: devices connected: ${s}, disabling`),this.handler$.value(!1).catch(h=>{N.error("MuteState-disable: handler error",h)}),{enabled$:pt(!1),set:null,toggle:null};let o=this.enabledByDefault;const a=new sr,c=new sr,l=Nc(a,c.pipe(ge(()=>!o))),d=new tr(h=>{h.next(o);let m=this.enabledByDefault,g=!1;const y=async()=>{if(o===m)g=!1;else{const E=o;o=await WVe(this.handler$.pipe(rt(async w=>w(m)))),o===E?g=!1:(h.next(o),g=!0,y().catch(w=>{N.error("MuteState: handler error",w)}))}},v=l.subscribe(E=>{m=E,g===!1&&(g=!0,y().catch(w=>{N.error("MuteState: handler error",w)}))});return()=>v.unsubscribe()});return{set:h=>a.next(h),toggle:()=>c.next(),enabled$:d}}))),this.enabled$=this.scope.behavior(this.data$.pipe(rt(({enabled$:s})=>s))),this.setEnabled$=this.scope.behavior(this.data$.pipe(ge(({set:s})=>s))),this.toggle$=this.scope.behavior(this.data$.pipe(ge(({toggle:s})=>s)))}setHandler(e){if(this.handler$.value!==uA)throw new Error("Multiple mute state handlers are not supported");this.handler$.next(e)}unsetHandler(){this.handler$.next(uA)}}class aot{constructor(e,n,r){if(this.scope=e,this.mediaDevices=n,this.initialMuteState=r,this.isEarpiece$=mt([this.mediaDevices.audioOutput.available$,this.mediaDevices.audioOutput.selected$]).pipe(ge(([i,s])=>{if(!s?.id)return!1;const o=i.get(s.id);return N.info("MuteStates: selected audio output device:",o),o?.type==="earpiece"})),this.audio=new TJ(this.scope,this.mediaDevices.audioInput,this.initialMuteState.audioEnabled,zR(!1)),this.video=new TJ(this.scope,this.mediaDevices.videoInput,this.initialMuteState.videoEnabled,this.isEarpiece$),vt!==null){const i=mt([this.audio.enabled$,this.video.enabled$],(o,a)=>({audio_enabled:o,video_enabled:a}));i.pipe(this.scope.bind()).subscribe(o=>{vt.api.transport.send(Tl.DeviceMute,o).catch(a=>N.warn("Could not send DeviceMute action to widget",a))}),Es(vt.lazyActions,Tl.DeviceMute).pipe(Tle(i,this.audio.setEnabled$,this.video.setEnabled$),this.scope.bind()).subscribe(([o,a,c,l])=>{const d={...a};o.detail.data.audio_enabled!=null&&typeof o.detail.data.audio_enabled=="boolean"&&c!==null&&(d.audio_enabled=o.detail.data.audio_enabled,c(d.audio_enabled)),o.detail.data.video_enabled!=null&&typeof o.detail.data.video_enabled=="boolean"&&l!==null&&(d.video_enabled=o.detail.data.video_enabled,l(d.video_enabled)),vt.api.transport.reply(o.detail,d)})}}}function cot(t,e,n){return N.debug(`calculateInitialMuteState: skipLobby=${t}, callIntent=${e} isWidgetMode=${n}`),t&&!n?{audioEnabled:!1,videoEnabled:!1}:{audioEnabled:!0,videoEnabled:e!="audio"}}const lot=()=>{const t=oc(),{confineToRoom:e,appPrompt:n,preload:r,header:i,displayName:s,skipLobby:o}=t,{t:a}=ze(),{roomAlias:c,roomId:l,viaServers:d}=N$e(),h=l??c;h||N.error("No room specified");const{registerPasswordlessUser:m}=jfe(),[g,y]=_.useState(!1),{loading:v,authenticated:E,client:w,error:k,passwordlessUser:x}=R9(),{avatarUrl:C,displayName:R}=yS(w),T=oot(w,h,d),[M,O]=_.useState(!1),P=pm(),[D,j]=_.useState(null);_.useEffect(()=>{const F=new bS;return j(new aot(F,P,cot(t.skipLobby,t.callIntent,vt!==null))),()=>F.end()},[P,t]),_.useEffect(()=>{!v&&!E&&s&&!vt&&(y(!0),m(s).catch(F=>{N.error("Failed to register passwordless user",F)}).finally(()=>{y(!1)}))},[v,E,s,y,m]);const[$,q]=VR();_.useEffect(()=>{$===null&&q&&q(!0)},[$,q]);const Y=_.useRef(!1);_.useEffect(()=>{T.kind==="loaded"&&Y.current&&N.log("Play join sound 'Not yet implemented'")},[T.kind]);const W=()=>{switch(T.kind){case"loaded":return D&&S.jsx(eot,{widget:vt,client:w,rtcSession:T.rtcSession,joined:M,setJoined:O,isPasswordlessUser:x,confineToRoom:e,preload:r,skipLobby:o||Y.current,header:i,muteStates:D});case"waitForInvite":case"canKnock":{Y.current=Y.current||T.kind==="waitForInvite";const F=T.kind==="canKnock"?T.knock:null,V=T.kind==="canKnock"?a("lobby.ask_to_join"):S.jsxs(S.Fragment,{children:[a("lobby.waiting_for_invite"),S.jsx(F8,{})]});return D&&S.jsx(ghe,{client:w,matrixInfo:{userId:w.getUserId()??"",displayName:R??"",avatarUrl:C??"",roomAlias:null,roomId:T.roomSummary.room_id,roomName:T.roomSummary.name??"",roomAvatar:T.roomSummary.avatar_url??null,e2eeSystem:{kind:T.roomSummary["im.nheko.summary.encryption"]?qn.PER_PARTICIPANT:qn.NONE}},onEnter:()=>F?.(),enterLabel:V,waitingForInvite:T.kind==="waitForInvite",confineToRoom:e,hideHeader:i!=="standard",participantCount:null,muteStates:D,onShareClick:null})}case"loading":return S.jsx(lv,{children:S.jsx("h1",{children:a("common.loading")})});case"failed":return Y.current=!1,T.error.errcode==="M_NOT_FOUND"?S.jsx(lv,{children:S.jsx(g_,{Icon:aNe,title:a("error.call_not_found"),widget:vt,children:S.jsx(bo,{i18nKey:"error.call_not_found_description",children:S.jsxs("p",{children:["That link doesn't appear to belong to any existing call. Check that you have the right link, or"," ",S.jsx(Ll,{to:"/",children:"create a new one"}),"."]})})})}):T.error instanceof _C?S.jsx(lv,{children:S.jsxs(g_,{Icon:T.error.icon,title:T.error.message,widget:vt,children:[S.jsx("p",{children:T.error.messageBody}),T.error.reason&&S.jsx("p",{children:a("group_call_loader.reason",{reason:T.error.reason})})]})}):S.jsx(v_,{widget:vt,error:T.error});default:return S.jsx(S.Fragment,{children:" "})}};let H;return v||g?H=S.jsx(UR,{}):k?H=S.jsx(v_,{widget:vt,error:k}):w?h?H=W():H=S.jsx(Nfe,{}):H=S.jsx(dXe,{}),S.jsxs(S.Fragment,{children:[H,n&&_n.get().app_prompt&&(Hs==="android"||Hs==="ios")&&l&&S.jsx(rot,{roomId:l})]})},uot="data:application/json;base64,ewogICJhMTF5IjogewogICAgInVzZXJfbWVudSI6ICLQn9C+0YLRgNC10LHQuNGC0LXQu9GB0LrQviDQvNC10L3RjiIKICB9LAogICJhY3Rpb24iOiB7CiAgICAiY2xvc2UiOiAi0JfQsNGC0LLQvtGA0LgiLAogICAgImNvcHlfbGluayI6ICLQmtC+0L/QuNGA0LDQvdC1INC90LAg0LLRgNGK0LfQutCw0YLQsCIsCiAgICAiZ28iOiAi0J3QsNC/0YDQtdC0IiwKICAgICJpbnZpdGUiOiAi0J/QvtC60LDQvdCwIiwKICAgICJubyI6ICLQndC1IiwKICAgICJyZWdpc3RlciI6ICLQoNC10LPQuNGB0YLRgNCw0YbQuNGPIiwKICAgICJyZW1vdmUiOiAi0J/RgNC10LzQsNGF0L3QuCIsCiAgICAic2lnbl9pbiI6ICLQktC70LXQtyIsCiAgICAic2lnbl9vdXQiOiAi0JjQt9C70LXQtyIKICB9LAogICJjYWxsX2VuZGVkX3ZpZXciOiB7CiAgICAiY3JlYXRlX2FjY291bnRfYnV0dG9uIjogItCh0YrQt9C00LDQuSDQsNC60LDRg9C90YIiLAogICAgImNyZWF0ZV9hY2NvdW50X3Byb21wdCI6ICI8MD7Ql9Cw0YnQviDQvdC1INC90LDRgdGC0YDQvtC50YLQtSDQv9Cw0YDQvtC70LAg0LfQsCDQtNCwINC30LDQv9Cw0LfQuNGC0LUg0LDQutCw0YPQvdGC0LAg0YHQuD88LzA+PDE+0KnQtSDQvNC+0LbQtdGC0LUg0LTQsCDQt9Cw0L/QsNC30LjRgtC1INC40LzQtdGC0L4g0Lgg0LDQstCw0YLQsNGA0LAg0YHQuCDQt9CwINCx0YrQtNC10YnQuCDRgNCw0LfQs9C+0LLQvtGA0Lg8LzE+IiwKICAgICJub3Rfbm93X2J1dHRvbiI6ICLQndC1INGB0LXQs9CwLCDQstGK0YDQvdC4INGB0LUg0L3QsCDQvdCw0YfQsNC70L3QuNGPINC10LrRgNCw0L0iCiAgfSwKICAiY29tbW9uIjogewogICAgImF1ZGlvIjogItCX0LLRg9C6IiwKICAgICJhdmF0YXIiOiAi0JDQstCw0YLQsNGAIiwKICAgICJkaXNwbGF5X25hbWUiOiAi0JjQvNC1L9C/0YHQtdCy0LTQvtC90LjQvCIsCiAgICAiaG9tZSI6ICLQndCw0YfQsNC70L4iLAogICAgImxvYWRpbmciOiAi0JfQsNGA0LXQttC00LDQvdC14oCmIiwKICAgICJwYXNzd29yZCI6ICLQn9Cw0YDQvtC70LAiLAogICAgInByb2ZpbGUiOiAi0J/RgNC+0YTQuNC7IiwKICAgICJzZXR0aW5ncyI6ICLQndCw0YHRgtGA0L7QudC60LgiLAogICAgInVzZXJuYW1lIjogItCf0L7RgtGA0LXQsdC40YLQtdC70YHQutC+INC40LzQtSIsCiAgICAidmlkZW8iOiAi0JLQuNC00LXQviIKICB9LAogICJqb2luX2V4aXN0aW5nX2NhbGxfbW9kYWwiOiB7CiAgICAiam9pbl9idXR0b24iOiAi0JTQsCwg0L/RgNC40YHRitC10LTQuNC90Lgg0YHQtSIsCiAgICAidGV4dCI6ICLQotC+0LfQuCDRgNCw0LfQs9C+0LLQvtGAINCy0LXRh9C1INGB0YrRidC10YHRgtCy0YPQstCwLCDQuNGB0LrQsNGC0LUg0LvQuCDQtNCwINGB0LUg0L/RgNC40YHRitC10LTQuNC90LjRgtC1PyIsCiAgICAidGl0bGUiOiAi0J/RgNC40YHRitC10LTQuNC90Y/QstCw0L3QtSDQutGK0Lwg0YHRitGJ0LXRgdGC0LLRg9Cy0LDRiSDRgNCw0LfQs9C+0LLQvtGAPyIKICB9LAogICJsYXlvdXRfc3BvdGxpZ2h0X2xhYmVsIjogItCf0YDQvtC20LXQutGC0L7RgCIsCiAgImxvYmJ5IjogewogICAgImpvaW5fYnV0dG9uIjogItCS0LvQtdC3INCyINGA0LDQt9Cz0L7QstC+0YDQsCIKICB9LAogICJsb2dnaW5nX2luIjogItCS0LvQuNC30LDQvdC14oCmIiwKICAibG9naW5fYXV0aF9saW5rcyI6ICI8MD7QodGK0LfQtNCw0LnRgtC1INCw0LrQsNGD0L3RgjwvMD4g0LjQu9C4IDwyPtCS0LvQtdC30YLQtSDQutCw0YLQviDQs9C+0YHRgjwvMj4iLAogICJsb2dpbl90aXRsZSI6ICLQktC70LXQtyIsCiAgInJhZ2VzaGFrZV9yZXF1ZXN0X21vZGFsIjogewogICAgImJvZHkiOiAi0JTRgNGD0LMg0L/QvtGC0YDQtdCx0LjRgtC10Lsg0LIg0YLQvtC30Lgg0YDQsNC30LPQvtCy0L7RgCDQuNC80LAg0L/RgNC+0LHQu9C10LwuINCX0LAg0LTQsCDQtNC40LDQs9C90L7RgdGC0LjRhtC40YDQsNC80LUg0YLQvtC30Lgg0L/RgNC+0LHQu9C10Lwg0L/Qvi3QtNC+0LHRgNC1INC90Lgg0YHQtSDQuNGB0LrQsCDQtNCwINGB0YrQsdC10YDQtdC8IGRlYnVnINC70L7Qs9C+0LLQtS4iLAogICAgInRpdGxlIjogItCX0LDRj9Cy0LrQsCDQt9CwIGRlYnVnINC70L7Qs9C+0LLQtSIKICB9LAogICJyYWdlc2hha2Vfc2VuZF9sb2dzIjogItCY0LfQv9GA0LDRgtC10YLQtSBkZWJ1ZyDQu9C+0LPQvtCy0LUiLAogICJyYWdlc2hha2Vfc2VuZGluZyI6ICLQmNC30L/RgNCw0YnQsNC90LXigKYiLAogICJyZWNhcHRjaGFfZGlzbWlzc2VkIjogIlJlY2FwdGNoYSDQvtGC0YXQstGK0YDQu9C10L3QsCIsCiAgInJlY2FwdGNoYV9ub3RfbG9hZGVkIjogIlJlY2FwdGNoYSDQvdC1INC1INC30LDRgNC10LTQtdC90LAiLAogICJyZWdpc3RlciI6IHsKICAgICJwYXNzd29yZHNfbXVzdF9tYXRjaCI6ICLQn9Cw0YDQvtC70LjRgtC1INC90LUg0YHRitCy0L/QsNC00LDRgiIsCiAgICAicmVnaXN0ZXJpbmciOiAi0KDQtdCz0LjRgdGC0YDQuNGA0LDQvdC14oCmIgogIH0sCiAgInJlZ2lzdGVyX2F1dGhfbGlua3MiOiAiPDA+0JLQtdGH0LUg0LjQvNCw0YLQtSDQsNC60LDRg9C90YI/PC8wPjwxPjwwPtCS0LvQtdC30YLQtSDRgSDQvdC10LPQvjwvMD4g0LjQu9C4IDwyPtCS0LvQtdC30YLQtSDQutCw0YLQviDQs9C+0YHRgjwvMj48LzE+IiwKICAicmVnaXN0ZXJfY29uZmlybV9wYXNzd29yZF9sYWJlbCI6ICLQn9C+0YLQstGK0YDQtNC4INC/0LDRgNC+0LvQsNGC0LAiLAogICJyZXR1cm5faG9tZV9idXR0b24iOiAi0JLRgNGK0YnQsNC90LUg0L3QsCDQvdCw0YfQsNC70L3QuNGPINC10LrRgNCw0L0iLAogICJzY3JlZW5zaGFyZV9idXR0b25fbGFiZWwiOiAi0KHQv9C+0LTQtdC70Lgg0LXQutGA0LDQvdCwIiwKICAic2V0dGluZ3MiOiB7CiAgICAiZGV2ZWxvcGVyX3RhYl90aXRsZSI6ICLQoNCw0LfRgNCw0LHQvtGC0YfQuNC6IiwKICAgICJmZWVkYmFja190YWJfaDQiOiAi0JjQt9C/0YDQsNGC0Lgg0L7QsdGA0LDRgtC90LAg0LLRgNGK0LfQutCwIiwKICAgICJmZWVkYmFja190YWJfc2VuZF9sb2dzX2xhYmVsIjogItCS0LrQu9GO0YfQuCBkZWJ1ZyDQu9C+0LPQvtCy0LUiCiAgfSwKICAidW5hdXRoZW50aWNhdGVkX3ZpZXdfYm9keSI6ICLQktGB0LUg0L7RidC1INC90LUg0YHRgtC1INGA0LXQs9C40YHRgtGA0LjRgNCw0L3QuD8gPDI+0KHRitC30LTQsNC50YLQtSDQsNC60LDRg9C90YI8LzI+IiwKICAidW5hdXRoZW50aWNhdGVkX3ZpZXdfbG9naW5fYnV0dG9uIjogItCS0LvQtdC30YLQtSDQsiDQsNC60LDRg9C90YLQsCDRgdC4IiwKICAidmVyc2lvbiI6ICLQktC10YDRgdC40Y86IHt7dmVyc2lvbn19Igp9Cg==",dot=""+new URL("cs-app-Du_5mVg3.json",import.meta.url).href,fot=""+new URL("da-app-BBz-lePm.json",import.meta.url).href,hot=""+new URL("de-app-DjOuqT-j.json",import.meta.url).href,pot=""+new URL("el-app-BBr3LLTK.json",import.meta.url).href,mot=""+new URL("en-app-DTABSRbn.json",import.meta.url).href,got=""+new URL("es-app-Q3c7lmEj.json",import.meta.url).href,vot=""+new URL("et-app-DLvuR7m2.json",import.meta.url).href,yot="data:application/json;base64,ewogICJhMTF5IjogewogICAgInVzZXJfbWVudSI6ICLZgdmH2LHYs9iqINqp2KfYsdio2LEiCiAgfSwKICAiYWN0aW9uIjogewogICAgImNsb3NlIjogItio2LPYqtmGIiwKICAgICJnbyI6ICLYsdmB2KrZhiIsCiAgICAibm8iOiAi2K7bjNixIiwKICAgICJyZWdpc3RlciI6ICLYq9io2KrigIzZhtin2YUiLAogICAgInJlbW92ZSI6ICLYrdiw2YEiLAogICAgInNpZ25faW4iOiAi2YjYsdmI2K8iLAogICAgInNpZ25fb3V0IjogItiu2LHZiNisIgogIH0sCiAgImNhbGxfZW5kZWRfdmlldyI6IHsKICAgICJjcmVhdGVfYWNjb3VudF9idXR0b24iOiAi2LPYp9iu2Kog2K3Ys9in2Kgg2qnYp9ix2KjYsduMIiwKICAgICJjcmVhdGVfYWNjb3VudF9wcm9tcHQiOiAiPDA+2obYsdinINuM2qkg2LHZhdiyINi52KjZiNixINio2LHYp9uMINit2LPYp9ioINqp2KfYsdio2LHbjCDYrtmI2K8g2KrZhti424zZhSDZhtmF24zigIzaqdmG24zYr9ifPC8wPjwxPti02YXYpyDZhduM4oCM2KrZiNin2YbbjNivINmG2KfZhSDYrtmI2K8g2LHYpyDYrdmB2Lgg2qnZhtuM2K8g2Ygg24zaqSDYotmI2KfYqtin2LEg2KjYsdin24wg2KrZhdin2LPigIzZh9in24wg2KLbjNmG2K/ZhyDYqNiz2KfYstuM2K88LzE+IiwKICAgICJub3Rfbm93X2J1dHRvbiI6ICLYp9mE2KfZhiDZhtmH2Iwg2KjZhyDYtdmB2K3ZhyDYp9i12YTbjCDYqNix2q/Ysdiv24zYryIKICB9LAogICJjb21tb24iOiB7CiAgICAiYXVkaW8iOiAi2LXYr9inIiwKICAgICJhdmF0YXIiOiAi2KLZiNin2KrYp9ixIiwKICAgICJkaXNwbGF5X25hbWUiOiAi2YbYp9mFINmG2YXYp9uM2LTbjCIsCiAgICAiaG9tZSI6ICLYrtin2YbZhyIsCiAgICAibG9hZGluZyI6ICLYqNin2LHar9iy2KfYsduM4oCmIiwKICAgICJwYXNzd29yZCI6ICLYsdmF2LIg2LnYqNmI2LEiLAogICAgInByb2ZpbGUiOiAi2b7YsdmI2YHYp9uM2YQiLAogICAgInNldHRpbmdzIjogItiq2YbYuNuM2YXYp9iqIiwKICAgICJ1c2VybmFtZSI6ICLZhtin2YUg2qnYp9ix2KjYsduMIiwKICAgICJ2aWRlbyI6ICLZiNuM2K/bjNmIIgogIH0sCiAgImhlYWRlcl9sYWJlbCI6ICLYrtin2YbZh9mUINiq2YXYp9izINin2YTZhdmG2KoiLAogICJqb2luX2V4aXN0aW5nX2NhbGxfbW9kYWwiOiB7CiAgICAiam9pbl9idXR0b24iOiAi2KjZhNmH2Iwg2KjZhyDYqtmF2KfYsyDYqNm+24zZiNmG2K/bjNivIiwKICAgICJ0ZXh0IjogItin24zZhiDYqtmF2KfYsyDYp9iyINmC2KjZhCDZiNis2YjYryDYr9in2LHYr9iMINmF24zigIzYrtmI2KfZh9uM2K8g2KjZvtuM2YjZhtiv24zYr9ifIiwKICAgICJ0aXRsZSI6ICLZvtuM2YjYs9iqINio2Ycg2KrZhdin2LPYnyIKICB9LAogICJsYXlvdXRfc3BvdGxpZ2h0X2xhYmVsIjogItmG2YjYsSDYp9mB2qnZhiIsCiAgImxvYmJ5IjogewogICAgImpvaW5fYnV0dG9uIjogItm+24zZiNiz2KrZhiDYqNmHINiq2YXYp9izIgogIH0sCiAgImxvZ2dpbmdfaW4iOiAi2YjYsdmI2K/igKYiLAogICJsb2dpbl9hdXRoX2xpbmtzIjogIjwwPtiz2KfYrtiqINit2LPYp9ioINqp2KfYsdio2LHbjDwvMD4gT3IgPDI+2K/Ys9iq2LHYs9uMINio2Ycg2LnZhtmI2KfZhiDZhduM2YfZhdin2YY8LzI+IiwKICAibG9naW5fdGl0bGUiOiAi2YjYsdmI2K8iLAogICJyYWdlc2hha2VfcmVxdWVzdF9tb2RhbCI6IHsKICAgICJib2R5IjogItqp2KfYsdio2LEg2K/bjNqv2LHbjCDYr9ixINin24zZhiDYqtmF2KfYsyDZhdi02qnZhNuMINiv2KfYsdivLiDYqNix2KfbjCDYqti02K7bjNi1INio2YfYqtixINmF2LTaqdmE2Iwg2KjZh9iq2LEg2KfYs9iqINmF2Kcg2YTYp9qvINi524zYqOKAjNuM2KfYqNuMINix2Kcg2KzZhdi54oCM2KLZiNix24wg2qnZhtuM2YUuIiwKICAgICJ0aXRsZSI6ICLYr9ix2K7ZiNin2LPYqiDZhNin2q8g2LnbjNio4oCM24zYp9io24wiCiAgfSwKICAicmFnZXNoYWtlX3NlbmRfbG9ncyI6ICLYp9ix2LPYp9mEINmE2Kfar+KAjNmH2KfbjCDYuduM2KjigIzbjNin2KjbjCIsCiAgInJhZ2VzaGFrZV9zZW5kaW5nIjogItiv2LEg2K3Yp9mEINin2LHYs9in2YTigKYiLAogICJyYWdlc2hha2Vfc2VuZGluZ19sb2dzIjogItiv2LEg2K3Yp9mEINin2LHYs9in2YQg2KjYp9qv4oCM2YfYp9uMINi524zYqOKAjNuM2KfYqNuM4oCmIiwKICAicmVjYXB0Y2hhX2Rpc21pc3NlZCI6ICLYsduM2qnZvtqG2Kcg2LHYryDYtNivIiwKICAicmVjYXB0Y2hhX25vdF9sb2FkZWQiOiAi2qnZvtqG2Kcg2KjYp9ix2q/bjNix24wg2YbYtNivIiwKICAicmVnaXN0ZXIiOiB7CiAgICAicGFzc3dvcmRzX211c3RfbWF0Y2giOiAi2LHZhdiyINi52KjZiNixINio2KfbjNivINmH2YXYrtmI2KfZhtuMINiv2KfYtNiq2Ycg2KjYp9i02K8iLAogICAgInJlZ2lzdGVyaW5nIjogItir2KjYquKAjNmG2KfZheKApiIKICB9LAogICJyZWdpc3Rlcl9hdXRoX2xpbmtzIjogIjwwPtin2LIg2YLYqNmEINit2LPYp9ioINqp2KfYsdio2LHbjCDYr9in2LHbjNiv2J88LzA+PDE+PDA+2YjYsdmI2K88LzA+IE9yIDwyPtio2Ycg2LnZhtmI2KfZhiDbjNqpINmF24zZh9mF2KfZhiDZiNin2LHYryDYtNmI24zYrzwvMj48LzE+IiwKICAicmVnaXN0ZXJfY29uZmlybV9wYXNzd29yZF9sYWJlbCI6ICLYqtin24zbjNivINix2YXYsti52KjZiNixIiwKICAicmV0dXJuX2hvbWVfYnV0dG9uIjogItio2LHar9i02Kog2KjZhyDYtdmB2K3ZhyDYp9i12YTbjCIsCiAgInNjcmVlbnNoYXJlX2J1dHRvbl9sYWJlbCI6ICLYp9i02KrYsdin2qkg2q/YsNin2LHbjCDYtdmB2K3ZhyDZhtmF2KfbjNi0IiwKICAic2V0dGluZ3MiOiB7CiAgICAiZGV2ZWxvcGVyX3RhYl90aXRsZSI6ICLYqtmI2LPYudmHINiv2YfZhtiv2YciLAogICAgImZlZWRiYWNrX3RhYl9oNCI6ICLYqNin2LLYrtmI2LHYryDYp9ix2KfYptmHINiv2YfbjNivIiwKICAgICJmZWVkYmFja190YWJfc2VuZF9sb2dzX2xhYmVsIjogIti02KfZhdmEINmE2Kfar+KAjNmH2KfbjCDYuduM2KjigIzbjNin2KjbjCIKICB9LAogICJ1bmF1dGhlbnRpY2F0ZWRfdmlld19ib2R5IjogItmH2YbZiNiyINir2KjYquKAjNmG2KfZhSDZhtqp2LHYr9mH4oCM2KfbjNiv2J8gPDI+2LPYp9iu2Kog2K3Ys9in2Kgg2qnYp9ix2KjYsduMPC8yPiIsCiAgInVuYXV0aGVudGljYXRlZF92aWV3X2xvZ2luX2J1dHRvbiI6ICLYqNmHINit2LPYp9ioINqp2KfYsdio2LHbjCDYrtmI2K8g2YjYp9ix2K8g2LTZiNuM2K8iLAogICJ2ZXJzaW9uIjogItmG2LPYrtmHOiB7e9mG2LPYrtmHfX0iCn0K",bot=""+new URL("fi-app-tnO3DMdi.json",import.meta.url).href,_ot=""+new URL("fr-app-BxTYbDfK.json",import.meta.url).href,Sot=""+new URL("id-app-BEz8ptLJ.json",import.meta.url).href,wot=""+new URL("it-app-Cik25Qgd.json",import.meta.url).href,Eot=""+new URL("ja-app-Cp_00ujI.json",import.meta.url).href,Cot=""+new URL("lv-app-D-ZV3Ytk.json",import.meta.url).href,Tot=""+new URL("pl-app-CUkXVSZk.json",import.meta.url).href,Rot=""+new URL("ro-app-CdYgKCOW.json",import.meta.url).href,kot=""+new URL("ru-app-CIijOjFj.json",import.meta.url).href,Iot=""+new URL("sk-app-DaVEeQWZ.json",import.meta.url).href,xot=""+new URL("sv-app-DHLBEOTp.json",import.meta.url).href,Aot=""+new URL("tr-app-Dk--6BpP.json",import.meta.url).href,Mot=""+new URL("uk-app-DZD01h76.json",import.meta.url).href,Lot="data:application/json;base64,ewogICJhY3Rpb24iOiB7CiAgICAiY2xvc2UiOiAixJDDs25nIiwKICAgICJubyI6ICJLaMO0bmciLAogICAgInJlZ2lzdGVyIjogIsSQxINuZyBrw70iLAogICAgInNpZ25faW4iOiAixJDEg25nIG5o4bqtcCIsCiAgICAic2lnbl9vdXQiOiAixJDEg25nIHh14bqldCIsCiAgICAic3VibWl0IjogIkfhu61pIgogIH0sCiAgImNhbGxfZW5kZWRfdmlldyI6IHsKICAgICJjcmVhdGVfYWNjb3VudF9idXR0b24iOiAiVOG6oW8gdMOgaSBraG/huqNuIiwKICAgICJjcmVhdGVfYWNjb3VudF9wcm9tcHQiOiAiPDA+VOG6oWkgc2FvIGzhuqFpIGtow7RuZyBob8OgbiB0aGnhu4duIGLhurFuZyBjw6FjaCDEkeG6t3QgbeG6rXQga2jhuql1IMSR4buDIGdp4buvIHTDoGkga2hv4bqjbiBj4bunYSBi4bqhbj88LzA+PDE+QuG6oW4gc+G6vSBjw7MgdGjhu4MgZ2nhu68gdMOqbiB2w6AgxJHhurd0IOG6o25oIMSR4bqhaSBkaeG7h24gY2hvIG5o4buvbmcgY3Xhu5ljIGfhu41pIHRp4bq/cCB0aGVvLjwvMT4iLAogICAgImZlZWRiYWNrX2RvbmUiOiAiPDA+Q+G6o20gaMahbiB2w6wgxJHDoyBwaOG6o24gaOG7k2khPC8wPiIsCiAgICAiZmVlZGJhY2tfcHJvbXB0IjogIjwwPkNow7puZyB0w7RpIG114buRbiBuZ2hlIHBo4bqjbiBo4buTaSBj4bunYSBi4bqhbiDEkeG7gyBjw7JuIGPhuqNpIHRoaeG7h24gdHLhuqNpIG5naGnhu4dtIGNobyBi4bqhbi48LzA+IiwKICAgICJoZWFkbGluZSI6ICJ7e2Rpc3BsYXlOYW1lfX0sIGN14buZYyBn4buNaSDEkcOjIGvhur90IHRow7pjLiIKICB9LAogICJjb21tb24iOiB7CiAgICAiYXVkaW8iOiAiw4JtIHRoYW5oIiwKICAgICJhdmF0YXIiOiAi4bqibmggxJHhuqFpIGRp4buHbiIsCiAgICAiZGlzcGxheV9uYW1lIjogIlTDqm4gaGnhu4NuIHRo4buLIiwKICAgICJsb2FkaW5nIjogIsSQYW5nIHThuqNp4oCmIiwKICAgICJwYXNzd29yZCI6ICJN4bqtdCBraOG6qXUiLAogICAgInByb2ZpbGUiOiAiSOG7kyBzxqEiLAogICAgInNldHRpbmdzIjogIkPDoGkgxJHhurd0IiwKICAgICJ1c2VybmFtZSI6ICJUw6puIG5nxrDhu51pIGTDuW5nIiwKICAgICJ2aWRlbyI6ICJUcnV54buBbiBow6xuaCIKICB9LAogICJqb2luX2V4aXN0aW5nX2NhbGxfbW9kYWwiOiB7CiAgICAiam9pbl9idXR0b24iOiAiVsOibmcsIHRoYW0gZ2lhIGN14buZYyBn4buNaSIsCiAgICAidGV4dCI6ICJDdeG7mWMgZ+G7jWkgxJHDoyB04buTbiB04bqhaSwgYuG6oW4gY8OzIG114buRbiB0aGFtIGdpYSBraMO0bmc/IiwKICAgICJ0aXRsZSI6ICJUaGFtIGdpYSBjdeG7mWMgZ+G7jWk/IgogIH0sCiAgImxheW91dF9zcG90bGlnaHRfbGFiZWwiOiAiVGnDqnUgxJFp4buDbSIsCiAgImxvYmJ5IjogewogICAgImpvaW5fYnV0dG9uIjogIlRoYW0gZ2lhIGN14buZYyBn4buNaSIKICB9LAogICJsb2dnaW5nX2luIjogIsSQYW5nIMSRxINuZyBuaOG6rXDigKYiLAogICJsb2dpbl9hdXRoX2xpbmtzIjogIjwwPlThuqFvIHTDoGkga2hv4bqjbjwvMD4gSGF5IDwyPlRoYW0gZ2lhIGTGsOG7m2kgdMOqbiBraMOhYzwvMj4iLAogICJsb2dpbl90aXRsZSI6ICLEkMSDbmcgbmjhuq1wIiwKICAicmFnZXNoYWtlX3JlcXVlc3RfbW9kYWwiOiB7CiAgICAiYm9keSI6ICJN4buZdCBuZ8aw4budaSBkw7luZyBraMOhYyB0cm9uZyBjdeG7mWMgZ+G7jWkgxJFhbmcgZ+G6t3AgduG6pW4gxJHhu4EuIMSQ4buDIGPDsyB0aOG7gyBjaOG6qW4gxJFvw6FuIHThu5F0IGjGoW4gY2jDum5nIHTDtGkgbXXhu5FuIHRodSB0aOG6rXAgbmjhuq10IGvDvSBn4buhIGzhu5dpLiIsCiAgICAidGl0bGUiOiAiWcOqdSBj4bqndSBuaOG6rXQga8O9IGfhu6EgbOG7l2kiCiAgfSwKICAicmFnZXNoYWtlX3NlbmRpbmciOiAixJBhbmcgZ+G7rWnigKYiLAogICJyZWNhcHRjaGFfbm90X2xvYWRlZCI6ICJDaMawYSB04bqjaSDEkcaw4bujYyBSZWNhcHRjaGEiLAogICJyZWdpc3RlciI6IHsKICAgICJwYXNzd29yZHNfbXVzdF9tYXRjaCI6ICJN4bqtdCBraOG6qXUgcGjhuqNpIGto4bubcCIsCiAgICAicmVnaXN0ZXJpbmciOiAixJBhbmcgxJHEg25nIGvDveKApiIKICB9LAogICJyZWdpc3Rlcl9hdXRoX2xpbmtzIjogIjwwPsSQw6MgY8OzIHTDoGkga2hv4bqjbj88LzA+PDE+PDA+xJDEg25nIG5o4bqtcDwvMD4gSGF5IDwyPlRoYW0gZ2lhIGTGsOG7m2kgdMOqbiBLaMOhY2g8LzI+PC8xPiIsCiAgInJlZ2lzdGVyX2NvbmZpcm1fcGFzc3dvcmRfbGFiZWwiOiAiWMOhYyBuaOG6rW4gbeG6rXQga2jhuql1IiwKICAic2NyZWVuc2hhcmVfYnV0dG9uX2xhYmVsIjogIkNoaWEgc+G6uyBtw6BuIGjDrG5oIiwKICAic2V0dGluZ3MiOiB7CiAgICAiZGV2ZWxvcGVyX3RhYl90aXRsZSI6ICJOaMOgIHBow6F0IHRyaeG7g24iLAogICAgImZlZWRiYWNrX3RhYl9kZXNjcmlwdGlvbl9sYWJlbCI6ICJQaOG6o24gaOG7k2kgY+G7p2EgYuG6oW4iLAogICAgImZlZWRiYWNrX3RhYl9oNCI6ICJH4butaSBwaOG6o24gaOG7k2kiLAogICAgImZlZWRiYWNrX3RhYl9zZW5kX2xvZ3NfbGFiZWwiOiAiS8OobSB0aGVvIG5o4bqtdCBrw70gZ+G7oSBs4buXaSIsCiAgICAiZmVlZGJhY2tfdGFiX3RoYW5rX3lvdSI6ICJD4bqjbSDGoW4sIGNow7puZyB0w7RpIMSRw6Mgbmjhuq1uIMSRxrDhu6NjIHBo4bqjbiBo4buTaSEiLAogICAgImZlZWRiYWNrX3RhYl90aXRsZSI6ICJQaOG6o24gaOG7k2kiCiAgfSwKICAic3VibWl0dGluZyI6ICLEkGFuZyBn4butaeKApiIsCiAgInVuYXV0aGVudGljYXRlZF92aWV3X2JvZHkiOiAiQ2jGsGEgxJHEg25nIGvDvT8gPDI+VOG6oW8gdMOgaSBraG/huqNuPC8yPiIsCiAgInVuYXV0aGVudGljYXRlZF92aWV3X2xvZ2luX2J1dHRvbiI6ICLEkMSDbmcgbmjhuq1wIHbDoG8gdMOgaSBraG/huqNuIGPhu6dhIGLhuqFuIiwKICAidmVyc2lvbiI6ICJQaGnDqm4gYuG6o246IHt7dmVyc2lvbn19Igp9Cg==",Oot=""+new URL("zh-Hans-app-BY5jJGyr.json",import.meta.url).href,Pot=""+new URL("zh-Hant-app-BV1LKS_j.json",import.meta.url).href,{slice:Dot,forEach:Not}=[];function Uot(t){return Not.call(Dot.call(arguments,1),e=>{if(e)for(const n in e)t[n]===void 0&&(t[n]=e[n])}),t}function jot(t){return typeof t!="string"?!1:[/<\s*script.*?>/i,/<\s*\/\s*script\s*>/i,/<\s*img.*?on\w+\s*=/i,/<\s*\w+\s*on\w+\s*=.*?>/i,/javascript\s*:/i,/vbscript\s*:/i,/expression\s*\(/i,/eval\s*\(/i,/alert\s*\(/i,/document\.cookie/i,/document\.write\s*\(/i,/window\.location/i,/innerHTML/i].some(n=>n.test(t))}const RJ=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/,Fot=function(t,e){const r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{path:"/"},i=encodeURIComponent(e);let s=`${t}=${i}`;if(r.maxAge>0){const o=r.maxAge-0;if(Number.isNaN(o))throw new Error("maxAge should be a Number");s+=`; Max-Age=${Math.floor(o)}`}if(r.domain){if(!RJ.test(r.domain))throw new TypeError("option domain is invalid");s+=`; Domain=${r.domain}`}if(r.path){if(!RJ.test(r.path))throw new TypeError("option path is invalid");s+=`; Path=${r.path}`}if(r.expires){if(typeof r.expires.toUTCString!="function")throw new TypeError("option expires is invalid");s+=`; Expires=${r.expires.toUTCString()}`}if(r.httpOnly&&(s+="; HttpOnly"),r.secure&&(s+="; Secure"),r.sameSite)switch(typeof r.sameSite=="string"?r.sameSite.toLowerCase():r.sameSite){case!0:s+="; SameSite=Strict";break;case"lax":s+="; SameSite=Lax";break;case"strict":s+="; SameSite=Strict";break;case"none":s+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}return r.partitioned&&(s+="; Partitioned"),s},kJ={create(t,e,n,r){let i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{path:"/",sameSite:"strict"};n&&(i.expires=new Date,i.expires.setTime(i.expires.getTime()+n*60*1e3)),r&&(i.domain=r),document.cookie=Fot(t,e,i)},read(t){const e=`${t}=`,n=document.cookie.split(";");for(let r=0;r<n.length;r++){let i=n[r];for(;i.charAt(0)===" ";)i=i.substring(1,i.length);if(i.indexOf(e)===0)return i.substring(e.length,i.length)}return null},remove(t,e){this.create(t,"",-1,e)}};var $ot={name:"cookie",lookup(t){let{lookupCookie:e}=t;if(e&&typeof document<"u")return kJ.read(e)||void 0},cacheUserLanguage(t,e){let{lookupCookie:n,cookieMinutes:r,cookieDomain:i,cookieOptions:s}=e;n&&typeof document<"u"&&kJ.create(n,t,r,i,s)}},Bot={name:"querystring",lookup(t){let{lookupQuerystring:e}=t,n;if(typeof window<"u"){let{search:r}=window.location;!window.location.search&&window.location.hash?.indexOf("?")>-1&&(r=window.location.hash.substring(window.location.hash.indexOf("?")));const s=r.substring(1).split("&");for(let o=0;o<s.length;o++){const a=s[o].indexOf("=");a>0&&s[o].substring(0,a)===e&&(n=s[o].substring(a+1))}}return n}},Hot={name:"hash",lookup(t){let{lookupHash:e,lookupFromHashIndex:n}=t,r;if(typeof window<"u"){const{hash:i}=window.location;if(i&&i.length>2){const s=i.substring(1);if(e){const o=s.split("&");for(let a=0;a<o.length;a++){const c=o[a].indexOf("=");c>0&&o[a].substring(0,c)===e&&(r=o[a].substring(c+1))}}if(r)return r;if(!r&&n>-1){const o=i.match(/\/([a-zA-Z-]*)/g);return Array.isArray(o)?o[typeof n=="number"?n:0]?.replace("/",""):void 0}}}return r}};let Ig=null;const IJ=()=>{if(Ig!==null)return Ig;try{if(Ig=typeof window<"u"&&window.localStorage!==null,!Ig)return!1;const t="i18next.translate.boo";window.localStorage.setItem(t,"foo"),window.localStorage.removeItem(t)}catch{Ig=!1}return Ig};var qot={name:"localStorage",lookup(t){let{lookupLocalStorage:e}=t;if(e&&IJ())return window.localStorage.getItem(e)||void 0},cacheUserLanguage(t,e){let{lookupLocalStorage:n}=e;n&&IJ()&&window.localStorage.setItem(n,t)}};let xg=null;const xJ=()=>{if(xg!==null)return xg;try{if(xg=typeof window<"u"&&window.sessionStorage!==null,!xg)return!1;const t="i18next.translate.boo";window.sessionStorage.setItem(t,"foo"),window.sessionStorage.removeItem(t)}catch{xg=!1}return xg};var Vot={name:"sessionStorage",lookup(t){let{lookupSessionStorage:e}=t;if(e&&xJ())return window.sessionStorage.getItem(e)||void 0},cacheUserLanguage(t,e){let{lookupSessionStorage:n}=e;n&&xJ()&&window.sessionStorage.setItem(n,t)}},Kot={name:"navigator",lookup(t){const e=[];if(typeof navigator<"u"){const{languages:n,userLanguage:r,language:i}=navigator;if(n)for(let s=0;s<n.length;s++)e.push(n[s]);r&&e.push(r),i&&e.push(i)}return e.length>0?e:void 0}},Got={name:"htmlTag",lookup(t){let{htmlTag:e}=t,n;const r=e||(typeof document<"u"?document.documentElement:null);return r&&typeof r.getAttribute=="function"&&(n=r.getAttribute("lang")),n}},zot={name:"path",lookup(t){let{lookupFromPathIndex:e}=t;if(typeof window>"u")return;const n=window.location.pathname.match(/\/([a-zA-Z-]*)/g);return Array.isArray(n)?n[typeof e=="number"?e:0]?.replace("/",""):void 0}},Wot={name:"subdomain",lookup(t){let{lookupFromSubdomainIndex:e}=t;const n=typeof e=="number"?e+1:1,r=typeof window<"u"&&window.location?.hostname?.match(/^(\w{2,5})\.(([a-z0-9-]{1,63}\.[a-z]{2,6})|localhost)/i);if(r)return r[n]}};let Fpe=!1;try{document.cookie,Fpe=!0}catch{}const $pe=["querystring","cookie","localStorage","sessionStorage","navigator","htmlTag"];Fpe||$pe.splice(1,1);const Yot=()=>({order:$pe,lookupQuerystring:"lng",lookupCookie:"i18next",lookupLocalStorage:"i18nextLng",lookupSessionStorage:"i18nextLng",caches:["localStorage"],excludeCacheFor:["cimode"],convertDetectedLanguage:t=>t});class Bpe{constructor(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.type="languageDetector",this.detectors={},this.init(e,n)}init(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{languageUtils:{}},n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.services=e,this.options=Uot(n,this.options||{},Yot()),typeof this.options.convertDetectedLanguage=="string"&&this.options.convertDetectedLanguage.indexOf("15897")>-1&&(this.options.convertDetectedLanguage=i=>i.replace("-","_")),this.options.lookupFromUrlIndex&&(this.options.lookupFromPathIndex=this.options.lookupFromUrlIndex),this.i18nOptions=r,this.addDetector($ot),this.addDetector(Bot),this.addDetector(qot),this.addDetector(Vot),this.addDetector(Kot),this.addDetector(Got),this.addDetector(zot),this.addDetector(Wot),this.addDetector(Hot)}addDetector(e){return this.detectors[e.name]=e,this}detect(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.options.order,n=[];return e.forEach(r=>{if(this.detectors[r]){let i=this.detectors[r].lookup(this.options);i&&typeof i=="string"&&(i=[i]),i&&(n=n.concat(i))}}),n=n.filter(r=>r!=null&&!jot(r)).map(r=>this.options.convertDetectedLanguage(r)),this.services&&this.services.languageUtils&&this.services.languageUtils.getBestMatchFromCodes?n:n.length>0?n[0]:null}cacheUserLanguage(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.options.caches;n&&(this.options.excludeCacheFor&&this.options.excludeCacheFor.indexOf(e)>-1||n.forEach(r=>{this.detectors[r]&&this.detectors[r].cacheUserLanguage(e,this.options)}))}}Bpe.type="languageDetector";var fE={},AJ;function Jot(){if(AJ)return fE;AJ=1,Object.defineProperty(fE,"__esModule",{value:!0}),fE.shouldPolyfill=t;function t(){return!Intl.Segmenter}return fE}var Xot=Jot();function Qot(){return typeof Intl>"u"||!("DurationFormat"in Intl)}const Hpe=Object.assign({"../locales/bg/app.json":uot,"../locales/cs/app.json":dot,"../locales/da/app.json":fot,"../locales/de/app.json":hot,"../locales/el/app.json":pot,"../locales/en/app.json":mot,"../locales/es/app.json":got,"../locales/et/app.json":vot,"../locales/fa/app.json":yot,"../locales/fi/app.json":bot,"../locales/fr/app.json":_ot,"../locales/id/app.json":Sot,"../locales/it/app.json":wot,"../locales/ja/app.json":Eot,"../locales/lv/app.json":Cot,"../locales/pl/app.json":Tot,"../locales/ro/app.json":Rot,"../locales/ru/app.json":kot,"../locales/sk/app.json":Iot,"../locales/sv/app.json":xot,"../locales/tr/app.json":Aot,"../locales/uk/app.json":Mot,"../locales/vi/app.json":Lot,"../locales/zh-Hans/app.json":Oot,"../locales/zh-Hant/app.json":Pot}),Zot=(t,e)=>Hpe[`../locales/${t}/${e}.json`],eat=[...new Set(Object.keys(Hpe).map(t=>{const e=t.match(/\/([^/]+)\/[^/]+\.json$/)?.[1];if(!e)throw new Error(`Could not parse locale URL ${t}`);return e}))],tat={type:"backend",init(){},read(t,e,n){(async()=>{const r=Zot(t,e);if(!r)throw new Error(`Namespace ${e} for locale ${t} not found`);const i=await fetch(r,{credentials:"omit",headers:{Accept:"application/json"}});if(n9(i))throw Error(`Failed to fetch ${r}`);return await i.json()})().then(r=>n(null,r),r=>n(r,null))}};class nat{constructor(){this.config=0,this.sentry=0}allDepsAreLoaded(){return!Object.values(this).some(e=>e!==2)}}class bc{constructor(){this.isInitialized=!1,this.loadStates=new nat}static isInitialized(){return!!bc.internalInstance?.isInitialized}static async initBeforeReact(){oBe();const e=[];Xot.shouldPolyfill()&&e.push(Mb(()=>import("./polyfill-force-CYNuOnga.js").then(s=>s.p),[],import.meta.url)),Qot()&&e.push(Mb(()=>import("./polyfill-force-CXG23BH3.js"),[],import.meta.url)),await Promise.all(e);const n=new Bpe;n.addDetector({name:"urlFragment",lookup:()=>er().lang??void 0}),Cs.on("languageChanged",s=>{document.documentElement.lang=s}),await Cs.use(tat).use(n).use(DDe).init({fallbackLng:"en",defaultNS:"app",keySeparator:".",nsSeparator:!1,pluralSeparator:"_",contextSeparator:"|",supportedLngs:eat,interpolation:{escapeValue:!1},detection:{order:["urlFragment","navigator"],caches:[]}});const{fonts:r,fontScale:i}=er();i!==null&&document.documentElement.style.setProperty("--font-scale",i.toString()),r.length>0&&document.documentElement.style.setProperty("--font-family",r.map(s=>`"${s}"`).join(", ")),document.body.setAttribute("data-platform",Hs)}static init(){return bc?.internalInstance?.initPromise?null:(bc.internalInstance=new bc,bc.internalInstance.initPromise=new Promise(e=>{bc.internalInstance?.initStep(e)}),bc.internalInstance.initPromise)}static reset(){bc.internalInstance=void 0}initStep(e){if(this.loadStates.config===0&&(this.loadStates.config=1,_n.init().then(()=>{this.loadStates.config=2,this.initStep(e)},n=>{N.error("Failed to load config",n)})),this.loadStates.sentry===0&&this.loadStates.config===2){let n,r;n=er().sentryDsn??void 0,r=er().sentryEnvironment??void 0,n&&$Ie({dsn:n,environment:r,integrations:[sxe({useEffect:xe.useEffect,useLocation:cs,useNavigationType:YEe,createRoutesFromChildren:ZC,matchRoutes:t7})],tracesSampleRate:1}),this.loadStates.sentry=2}this.loadStates.allDepsAreLoaded()&&(e(),this.isInitialized=!0)}}const rat=()=>{const[t,e]=_.useState(()=>er().theme),n=_.useRef(document.body.classList.item(0));_.useEffect(()=>{if(vt){const r=i=>{i.preventDefault(),"name"in i.detail.data&&typeof i.detail.data.name=="string"&&e(i.detail.data.name),vt.api.transport.reply(i.detail,{})};return vt.lazyActions.on(Rr.ThemeChange,r),()=>{vt.lazyActions.off(Rr.ThemeChange,r)}}},[]),_.useLayoutEffect(()=>{const r=t?.includes("light")?"light":"dark",i=t?.includes("high-contrast")?"-hc":"",s="cpd-theme-"+r+i;s!==n.current&&(document.body.classList.remove("cpd-theme-light","cpd-theme-dark","cpd-theme-light-hc","cpd-theme-dark-hc"),document.body.classList.add(s),n.current=s),document.body.classList.remove("no-theme")},[n,t])},hE=oxe(Nee),iat=({children:t})=>{const{pathname:e}=cs();return _.useEffect(()=>{let n="";!["/login","/register"].includes(e)&&!vt&&(n="var(--background-gradient)"),document.getElementsByTagName("body")[0].style.backgroundImage=n},[e]),S.jsx(S.Fragment,{children:t})},sat=({children:t})=>(rat(),t),oat=({vm:t})=>{const[e,n]=_.useState(!1);_.useEffect(()=>{bc.init()?.then(async()=>{e||(n(!0),await vt?.api.sendContentLoaded())}).catch(N.error)});const{header:r}=_.useMemo(er,[]),i=e?S.jsx(NKe,{children:S.jsx(Zle,{value:t.mediaDevices,children:S.jsx(DYe,{children:S.jsx(rR,{fallback:s=>S.jsx(v_,{error:s,widget:vt}),children:S.jsxs(dCe,{children:[S.jsx(hE,{path:"/",element:S.jsx(Nfe,{})}),S.jsx(hE,{path:"/login",element:S.jsx(iXe,{})}),S.jsx(hE,{path:"/register",element:S.jsx(sXe,{})}),S.jsx(hE,{path:"*",element:S.jsx(lot,{})})]})})})})}):S.jsx(UR,{});return S.jsx(DCe,{children:S.jsx(iat,{children:S.jsx(sat,{children:S.jsx(Yne,{children:S.jsx(_.Suspense,{fallback:null,children:r===h_.AppBar?S.jsx(sst,{children:i}):i})})})})})};class aat{constructor(e){this.scope=e,this.mediaDevices=new VGe(this.scope)}}window.setLKLogLevel=SZ;RBe().catch(t=>{N.error("Failed to initialize rageshake",t)});SZ("info");ISe((t,e,n)=>{global.mx_rage_logger.log(t,"livekit",e,n)});N.info("Element Call embedded-v0.19.0-rc2");const WO=Gbe.createRoot(document.getElementById("root"));let kb=null;window.isSecureContext?navigator.mediaDevices||(kb=new Error("Your browser does not support WebRTC.")):kb=new Error(`This app cannot run in an insecure context. To fix this, access the app via a local loopback address, or serve it over HTTPS.
298
+ `;return typeof a=="function"&&a(null,E),E},lA}var CJ;function Kst(){if(CJ)return kg;CJ=1;const t=Tst(),e=Hst(),n=qst(),r=Vst();function i(s,o,a,c,l){const d=[].slice.call(arguments,1),h=d.length,m=typeof d[h-1]=="function";if(!m&&!t())throw new Error("Callback required as last argument");if(m){if(h<2)throw new Error("Too few arguments provided");h===2?(l=a,a=o,o=c=void 0):h===3&&(o.getContext&&typeof l>"u"?(l=c,c=void 0):(l=c,c=a,a=o,o=void 0))}else{if(h<1)throw new Error("Too few arguments provided");return h===1?(a=o,o=c=void 0):h===2&&!o.getContext&&(c=a,a=o,o=void 0),new Promise(function(g,y){try{const v=e.create(a,c);g(s(v,o,c))}catch(v){y(v)}})}try{const g=e.create(a,c);l(null,s(g,o,c))}catch(g){l(g)}}return kg.create=e.create,kg.toCanvas=i.bind(null,n.render),kg.toDataURL=i.bind(null,n.renderToDataURL),kg.toString=i.bind(null,function(s,o,a){return r.render(s,a)}),kg}var Gst=Kst();const zst="_qrCode_h54ia_8",Wst={qrCode:zst},Yst=({data:t,className:e})=>{const[n,r]=_.useState(null);return _.useEffect(()=>{let i=!1;return Gst.toDataURL(t,{errorCorrectionLevel:"L"}).then(s=>{i||r(s)}).catch(s=>{i||r(null)}),()=>{i=!0}},[t]),S.jsx("div",{className:Le(Wst.qrCode,e),children:n&&S.jsx("img",{src:n,alt:$i("qr_code")})})},Jst=({room:t,open:e,onDismiss:n})=>{const{t:r}=ze(),i=_4(t.roomId),s=_.useMemo(()=>Lfe(t.roomId,i,t.name),[i,t.name,t.roomId]),[o,a]=_.useState(!1),c=_.useCallback(()=>a(!1),[a]),l=_.useCallback(d=>{d.stopPropagation(),Sst(s),n(),a(!0)},[s,n]);return S.jsxs(S.Fragment,{children:[S.jsxs(fm,{title:r("invite_modal.title"),open:e,onDismiss:n,children:[S.jsx(Yst,{className:$5.qrCode,data:s}),S.jsx(on,{className:$5.url,size:"sm",weight:"semibold",children:s}),S.jsx(Ht,{className:$5.button,Icon:YDe,onClick:l,"data-testid":"modal_inviteLink",children:r("action.copy_link")})]}),S.jsx(Lpe,{open:o,onDismiss:c,autoDismiss:2e3,Icon:F8,children:r("invite_modal.link_copied_toast")})]})},Xst=({error:t,recoveryActionHandler:e,widget:n})=>{const{t:r}=ze();N.error("Error boundary caught:",t);let i;switch(t.category){case pC.CONFIGURATION_ISSUE:i=WDe;break;case pC.NETWORK_CONNECTIVITY:i=ZDe;break;case pC.CLIENT_CONFIGURATION:i=dNe;break;default:i=Q_}const s=[];return t instanceof Efe&&s.push({label:r("call_ended_view.reconnect_button"),onClick:()=>{e("reconnect")}}),S.jsx(lv,{children:S.jsxs(g_,{Icon:i,title:t.localisedTitle,rageshake:t.code==wfe.UNKNOWN_ERROR,widget:n,children:[S.jsx("p",{children:t.localisedMessage??S.jsx(bo,{i18nKey:"error.unexpected_ec_error",components:[S.jsx("b",{}),S.jsx("code",{})],values:{errorCode:t.code}})}),s&&s.map((o,a)=>S.jsx(Ht,{kind:"secondary",onClick:o.onClick,children:o.label},`action${a}`))]})})},Qst=({recoveryActionHandler:t,onError:e,children:n,widget:r})=>{const i=_.useCallback(({error:s,resetError:o})=>{const a=s instanceof ji?s:new Gp(s instanceof Error?s:new Error);return S.jsx(Xst,{widget:r??null,error:a,resetError:o,recoveryActionHandler:async c=>{await t(c),o()}})},[t,r]);return S.jsx(rR,{fallback:i,onError:s=>e?.(s),children:n})},Zst=8,eot=({client:t,isPasswordlessUser:e,confineToRoom:n,preload:r,skipLobby:i,header:s,rtcSession:o,joined:a,setJoined:c,muteStates:l,widget:d})=>{const[h,m]=_.useState(null),g=dce(o),y=je(Mpe),v=ih(N4({sounds:Ape,latencyHint:"interactive",muted:y}));_.useEffect(()=>{g.length>=Zst&&l.audio.setEnabled$.value?.(!1)},[]),_.useEffect(()=>(N.info("[Lifecycle] GroupCallView Component mounted"),()=>{N.info("[Lifecycle] GroupCallView Component unmounted")}),[]),_.useEffect(()=>(document.body.classList.add("no-scroll-body"),()=>{document.body.classList.remove("no-scroll-body")}),[]),_.useEffect(()=>(window.rtcSession=o,()=>{delete window.rtcSession}),[o]),KBe(o,Zi.MembershipManagerError,ae=>m(new Efe)),_.useEffect(()=>{t.getRoom(o.room.roomId)!==o.room&&N.warn(`We've ended up with multiple rooms for the same ID (${o.room.roomId}). This indicates a bug in the group call loading code, and may lead to incomplete room state.`)},[t,o.room]);const E=o.room,{displayName:w,avatarUrl:k}=yS(t),x=gst(E),C=mst(E),{perParticipantE2EE:R,returnToLobby:T,password:M}=oc(),O=_4(E.roomId);_.useEffect(()=>{M&&kfe(E.roomId,M)},[M,E.roomId]),AS(x),ost(x);const P=_.useMemo(()=>({userId:t.getUserId(),displayName:w,avatarUrl:k,roomId:E.roomId,roomName:x,roomAlias:E.getCanonicalAlias(),roomAvatar:C,e2eeSystem:O}),[t,w,k,x,E,C,O]),D=_.useMemo(()=>new Set(g.map(ae=>ae.userId)).size,[g]),j=pm(),$=ih(l),q=_.useCallback(async ae=>{try{c(!0)}catch(ke){if(ke instanceof ji)m(ke);else{N.error("Unknown Error while entering RTC session",ke);const Ne=new Gp(ke instanceof Error?ke:new Error("Unknown error",{cause:ke}));m(Ne)}}return Promise.resolve()},[c]);_.useEffect(()=>{const ae=async({audioInput:ke,videoInput:Ne})=>{const Ze=await Wu.getLocalDevices(void 0,!0);if(ke){const Ot=iY(ke,"audioinput",Ze);Ot?(N.debug(`Found audio input ID ${Ot} for name ${ke}`),j.audioInput.select(Ot)):(N.warn("Unknown audio input: "+ke),$.current.audio.setEnabled$.value?.(!1))}if(Ne){const Ot=iY(Ne,"videoinput",Ze);Ot?(N.debug(`Found video input ID ${Ot} for name ${Ne}`),j.videoInput.select(Ot)):(N.warn("Unknown video input: "+Ne),$.current.video.setEnabled$.value?.(!1))}};if(i)if(d&&r){const ke=Ne=>{(async()=>{await ae(Ne.detail.data),c(!0),d.api.transport.reply(Ne.detail,{})})().catch(Ze=>{N.error("Error joining RTC session on preload",Ze)})};return d.lazyActions.on(Tl.JoinCall,ke),()=>{d.lazyActions.off(Tl.JoinCall,ke)}}else c(!0)},[d,o,r,i,R,j,$,c]);const[Y,W]=_.useState(!1),H=Fl(),F=_.useCallback(ae=>{let ke="left";(ae==="timeout"||ae==="decline")&&(ke=ae),c(!1),W(!0);const Ne=v.current?.playSound(ke),Ze=new Promise(Ot=>{const Mr=d!==null;en.instance.eventCallEnded.track(E.roomId,o.memberships.length,Mr,o),window.setTimeout(Ot,10)});Promise.all([Ne,Ze]).catch(Ot=>N.error("Failed to play leave audio and/or send PostHog leave event",Ot)).then(async()=>{if(!e&&!n&&!en.instance.isEnabled()&&H("/"),d){try{await d.api.setAlwaysOnScreen(!1)}catch(Ot){N.error("Failed to set call widget `alwaysOnScreen` to false",Ot)}if(ae!="error"&&!er().returnToLobby){try{await d.api.transport.send(Tl.Close,{})}catch(Ot){N.error("Failed to send close action",Ot)}d.api.transport.stop()}}})},[c,v,d,E.roomId,o,e,n,H]);_.useEffect(()=>{d&&a&&d.api.setAlwaysOnScreen(!0).catch(ae=>{N.error("Error calling setAlwaysOnScreen(true)",ae)})},[d,a,o]);const V=vst(E),[G,ee]=_.useState(!1),K=_.useCallback(()=>ee(!1),[ee]),Q=_.useCallback(()=>ee(!0),[ee]),fe=V===kf.Public?Q:null;if(!tee()&&O.kind!==qn.NONE)throw new FYe;const de=S.jsx(Jst,{room:E,open:G,onDismiss:K}),Te=S.jsxs(S.Fragment,{children:[de,S.jsx(ghe,{client:t,matrixInfo:P,muteStates:l,onEnter:()=>c(!0),confineToRoom:n,hideHeader:s===h_.None,participantCount:D,onShareClick:fe})]});let we;if(h){const ae=()=>{throw h};we=S.jsx(ae,{})}else a?we=S.jsxs(S.Fragment,{children:[de,S.jsx(hst,{client:t,matrixInfo:P,rtcSession:o,matrixRoom:E,onLeft:F,header:s,muteStates:l,e2eeSystem:O,onShareClick:fe})]}):Y&&d===null?e||en.instance.isEnabled()&&d===null?we=S.jsx(xZe,{endedCallId:o.room.roomId,client:t,isPasswordlessUser:e,hideHeader:s===h_.None,confineToRoom:n}):we=null:Y&&d!==null?we=T?Te:null:r||i?we=null:we=Te;return S.jsx(Qst,{widget:d,recoveryActionHandler:async ae=>{m(null),ae=="reconnect"&&(W(!1),await q(o).catch(ke=>{N.error("Error re-entering RTC session",ke)}))},onError:()=>{o.isJoined()&&F("error")},children:we})},tot="_modal_1tnec_8",not={modal:tot},rot=({roomId:t})=>{const{t:e}=ze(),[n,r]=_.useState(!0),i=_.useCallback(a=>{a.preventDefault(),a.stopPropagation(),r(!1)},[r]),s=_4(t);s.kind===qn.NONE&&N.error("Generating app redirect URL for encrypted room but don't have key available!");const o=_.useMemo(()=>{const a=new URL(t===null?window.location.href:Lfe(t,s));a.hash=O$e(a.hash,l=>(l.set("appPrompt","false"),l.set("confineToRoom","true"),l));const c=new URL("io.element.call:/");return c.searchParams.set("url",a.toString()),c.toString()},[s,t]);return S.jsxs(fm,{className:not.modal,title:e("app_selection_modal.title"),open:n,children:[S.jsx(on,{size:"md",weight:"semibold",children:e("app_selection_modal.text")}),S.jsx(Ht,{kind:"secondary",onClick:i,children:e("app_selection_modal.continue_in_browser")}),S.jsx(Ht,{as:"a",href:o,Icon:uae,children:e("app_selection_modal.open_in_app")})]})},iot=3,sot=3e3;async function jpe(t,e=0,...n){try{return await t.joinRoom(...n)}catch(r){if(r instanceof In&&r.errcode==="M_FORBIDDEN"&&e<iot)return await new Promise(i=>setTimeout(i,sot)),jpe(t,e+1,...n);throw r}}class _C extends Error{constructor(e,n,r,i){super(n),this.icon=e,this.messageBody=r,this.reason=i}}const oot=(t,e,n)=>{const[r,i]=_.useState({kind:"loading"}),s=_.useRef(void 0),{t:o}=ze(),a=_.useCallback(()=>new _C(qDe,o("group_call_loader.banned_heading"),o("group_call_loader.banned_body"),d()),[o]),c=_.useCallback(()=>new _C(Z_,o("group_call_loader.knock_reject_heading"),o("group_call_loader.knock_reject_body"),d()),[o]),l=_.useCallback(()=>new _C(kR,o("group_call_loader.call_ended_heading"),o("group_call_loader.call_ended_body"),d()),[o]),d=()=>s.current?.currentState.getStateEvents(Z.RoomMember,s.current?.myUserId)?.getContent().reason;return _.useEffect(()=>{if(!t||!e)return;const h=async w=>{let k=null;const x=await t.getRoomIdForAlias(w.toLowerCase());return N.info(`${w} resolved to ${x.room_id}`),k=t.getRoom(x.room_id),k?N.info(`Already in room ${x.room_id}, not rejoining.`):(N.info(`Room ${x.room_id} not found, joining.`),k=await t.joinRoom(x.room_id,{viaServers:x.servers})),k},m=async(w,k,x)=>(await t.knockRoom(w,{viaServers:k}),x(),await new Promise((C,R)=>{t.on(Oe.MyMembership,(T,M,O)=>{w===T.roomId&&(s.current=T,M===Ve.Invite&&O===Ve.Knock&&jpe(t,0,T.roomId,{viaServers:k}).then(P=>{N.log("Auto-joined %s",P.roomId),C(P)},R),M===Ve.Ban&&R(a()),M===Ve.Leave&&R(c()))})})),g=async()=>{let w=null;if(e[0]==="#")w=await h(e),s.current=w;else{const k=e;w=t.getRoom(k),s.current=w??void 0;const x=w?.getMyMembership();if(x===Ve.Join)return w;if(vt)throw new Error("Room not found. The widget-api did not pass over the relevant room events/information.");if(x===Ve.Ban)throw a();if(x===Ve.Invite)w=await t.joinRoom(k,{viaServers:n});else{let C;try{C=await t.getRoomSummary(k,n)}catch(R){N.warn("Could not load room summary to decide whether we want to join or knock.\n EC will fallback to join as if this would be a public room.\n Reach out to your homeserver admin to ask them about supporting the `/summary` endpoint (im.nheko.summary):",R)}if(C===void 0||C.join_rule===kf.Public)w=await t.joinRoom(k,{viaServers:n});else if(C.join_rule===kf.Knock){const R=C;let T=()=>{};const M=new Promise(O=>{R.membership!==Ve.Knock?T=O:O()});i({kind:"canKnock",roomSummary:R,knock:T}),await M,w=await m(C.room_id,n,()=>i({kind:"waitForInvite",roomSummary:R}))}else throw new Error(`Room ${C.room_id} is not joinable. This likely means, that the conference owner has changed the room settings to private.`)}}return N.info(`Joined ${e}, waiting room to be ready for group calls`),await t.waitUntilRoomReadyForGroupCalls(w.roomId),N.info(`${e}, is ready for group calls`),w},y=async()=>{const w=await g();return s.current=w,N.debug(`Fetched / joined room ${e}`),t.matrixRTC.getRoomSession(w)},v=async()=>{t.getSyncState()!==Qt.Syncing&&(N.debug("useLoadGroupCall: waiting for client to start syncing..."),await new Promise(w=>{const k=()=>{if(t.getSyncState()===Qt.Syncing)return t.off(De.Sync,k),w()};t.on(De.Sync,k)}),N.debug("useLoadGroupCall: client is now syncing."))},E=async()=>{await new Promise((w,k)=>{t.on(Oe.MyMembership,(x,C)=>{C===Ve.Leave&&k(l()),C===Ve.Ban&&k(a())})})};r.kind==="loading"&&(N.log("Start loading group call"),v().then(y).then(w=>i({kind:"loaded",rtcSession:w})).then(E).catch(w=>i({kind:"failed",error:w})))},[a,t,c,l,e,r,o,n]),r},uA=async t=>Promise.resolve(t);class TJ{constructor(e,n,r,i){this.scope=e,this.device=n,this.enabledByDefault=r,this.forceMute$=i,this.handler$=new cr(uA),this.canControlDevices$=mt([this.device.available$,this.forceMute$]).pipe(ge(([s,o])=>!o&&s.size>0)),this.data$=this.scope.behavior(this.canControlDevices$.pipe(Ni(),ge(s=>{if(N.info(`MuteState: canControlDevices: ${s}, enabled by default: ${this.enabledByDefault}`),!s)return N.info(`MuteState: devices connected: ${s}, disabling`),this.handler$.value(!1).catch(h=>{N.error("MuteState-disable: handler error",h)}),{enabled$:pt(!1),set:null,toggle:null};let o=this.enabledByDefault;const a=new sr,c=new sr,l=Nc(a,c.pipe(ge(()=>!o))),d=new tr(h=>{h.next(o);let m=this.enabledByDefault,g=!1;const y=async()=>{if(o===m)g=!1;else{const E=o;o=await WVe(this.handler$.pipe(rt(async w=>w(m)))),o===E?g=!1:(h.next(o),g=!0,y().catch(w=>{N.error("MuteState: handler error",w)}))}},v=l.subscribe(E=>{m=E,g===!1&&(g=!0,y().catch(w=>{N.error("MuteState: handler error",w)}))});return()=>v.unsubscribe()});return{set:h=>a.next(h),toggle:()=>c.next(),enabled$:d}}))),this.enabled$=this.scope.behavior(this.data$.pipe(rt(({enabled$:s})=>s))),this.setEnabled$=this.scope.behavior(this.data$.pipe(ge(({set:s})=>s))),this.toggle$=this.scope.behavior(this.data$.pipe(ge(({toggle:s})=>s)))}setHandler(e){if(this.handler$.value!==uA)throw new Error("Multiple mute state handlers are not supported");this.handler$.next(e)}unsetHandler(){this.handler$.next(uA)}}class aot{constructor(e,n,r){if(this.scope=e,this.mediaDevices=n,this.initialMuteState=r,this.isEarpiece$=mt([this.mediaDevices.audioOutput.available$,this.mediaDevices.audioOutput.selected$]).pipe(ge(([i,s])=>{if(!s?.id)return!1;const o=i.get(s.id);return N.info("MuteStates: selected audio output device:",o),o?.type==="earpiece"})),this.audio=new TJ(this.scope,this.mediaDevices.audioInput,this.initialMuteState.audioEnabled,zR(!1)),this.video=new TJ(this.scope,this.mediaDevices.videoInput,this.initialMuteState.videoEnabled,this.isEarpiece$),vt!==null){const i=mt([this.audio.enabled$,this.video.enabled$],(o,a)=>({audio_enabled:o,video_enabled:a}));i.pipe(this.scope.bind()).subscribe(o=>{vt.api.transport.send(Tl.DeviceMute,o).catch(a=>N.warn("Could not send DeviceMute action to widget",a))}),Es(vt.lazyActions,Tl.DeviceMute).pipe(Tle(i,this.audio.setEnabled$,this.video.setEnabled$),this.scope.bind()).subscribe(([o,a,c,l])=>{const d={...a};o.detail.data.audio_enabled!=null&&typeof o.detail.data.audio_enabled=="boolean"&&c!==null&&(d.audio_enabled=o.detail.data.audio_enabled,c(d.audio_enabled)),o.detail.data.video_enabled!=null&&typeof o.detail.data.video_enabled=="boolean"&&l!==null&&(d.video_enabled=o.detail.data.video_enabled,l(d.video_enabled)),vt.api.transport.reply(o.detail,d)})}}}function cot(t,e,n){return N.debug(`calculateInitialMuteState: skipLobby=${t}, callIntent=${e} isWidgetMode=${n}`),t&&!n?{audioEnabled:!1,videoEnabled:!1}:{audioEnabled:!0,videoEnabled:e!="audio"}}const lot=()=>{const t=oc(),{confineToRoom:e,appPrompt:n,preload:r,header:i,displayName:s,skipLobby:o}=t,{t:a}=ze(),{roomAlias:c,roomId:l,viaServers:d}=N$e(),h=l??c;h||N.error("No room specified");const{registerPasswordlessUser:m}=jfe(),[g,y]=_.useState(!1),{loading:v,authenticated:E,client:w,error:k,passwordlessUser:x}=R9(),{avatarUrl:C,displayName:R}=yS(w),T=oot(w,h,d),[M,O]=_.useState(!1),P=pm(),[D,j]=_.useState(null);_.useEffect(()=>{const F=new bS;return j(new aot(F,P,cot(t.skipLobby,t.callIntent,vt!==null))),()=>F.end()},[P,t]),_.useEffect(()=>{!v&&!E&&s&&!vt&&(y(!0),m(s).catch(F=>{N.error("Failed to register passwordless user",F)}).finally(()=>{y(!1)}))},[v,E,s,y,m]);const[$,q]=VR();_.useEffect(()=>{$===null&&q&&q(!0)},[$,q]);const Y=_.useRef(!1);_.useEffect(()=>{T.kind==="loaded"&&Y.current&&N.log("Play join sound 'Not yet implemented'")},[T.kind]);const W=()=>{switch(T.kind){case"loaded":return D&&S.jsx(eot,{widget:vt,client:w,rtcSession:T.rtcSession,joined:M,setJoined:O,isPasswordlessUser:x,confineToRoom:e,preload:r,skipLobby:o||Y.current,header:i,muteStates:D});case"waitForInvite":case"canKnock":{Y.current=Y.current||T.kind==="waitForInvite";const F=T.kind==="canKnock"?T.knock:null,V=T.kind==="canKnock"?a("lobby.ask_to_join"):S.jsxs(S.Fragment,{children:[a("lobby.waiting_for_invite"),S.jsx(F8,{})]});return D&&S.jsx(ghe,{client:w,matrixInfo:{userId:w.getUserId()??"",displayName:R??"",avatarUrl:C??"",roomAlias:null,roomId:T.roomSummary.room_id,roomName:T.roomSummary.name??"",roomAvatar:T.roomSummary.avatar_url??null,e2eeSystem:{kind:T.roomSummary["im.nheko.summary.encryption"]?qn.PER_PARTICIPANT:qn.NONE}},onEnter:()=>F?.(),enterLabel:V,waitingForInvite:T.kind==="waitForInvite",confineToRoom:e,hideHeader:i!=="standard",participantCount:null,muteStates:D,onShareClick:null})}case"loading":return S.jsx(lv,{children:S.jsx("h1",{children:a("common.loading")})});case"failed":return Y.current=!1,T.error.errcode==="M_NOT_FOUND"?S.jsx(lv,{children:S.jsx(g_,{Icon:aNe,title:a("error.call_not_found"),widget:vt,children:S.jsx(bo,{i18nKey:"error.call_not_found_description",children:S.jsxs("p",{children:["That link doesn't appear to belong to any existing call. Check that you have the right link, or"," ",S.jsx(Ll,{to:"/",children:"create a new one"}),"."]})})})}):T.error instanceof _C?S.jsx(lv,{children:S.jsxs(g_,{Icon:T.error.icon,title:T.error.message,widget:vt,children:[S.jsx("p",{children:T.error.messageBody}),T.error.reason&&S.jsx("p",{children:a("group_call_loader.reason",{reason:T.error.reason})})]})}):S.jsx(v_,{widget:vt,error:T.error});default:return S.jsx(S.Fragment,{children:" "})}};let H;return v||g?H=S.jsx(UR,{}):k?H=S.jsx(v_,{widget:vt,error:k}):w?h?H=W():H=S.jsx(Nfe,{}):H=S.jsx(dXe,{}),S.jsxs(S.Fragment,{children:[H,n&&_n.get().app_prompt&&(Hs==="android"||Hs==="ios")&&l&&S.jsx(rot,{roomId:l})]})},uot="data:application/json;base64,ewogICJhMTF5IjogewogICAgInVzZXJfbWVudSI6ICLQn9C+0YLRgNC10LHQuNGC0LXQu9GB0LrQviDQvNC10L3RjiIKICB9LAogICJhY3Rpb24iOiB7CiAgICAiY2xvc2UiOiAi0JfQsNGC0LLQvtGA0LgiLAogICAgImNvcHlfbGluayI6ICLQmtC+0L/QuNGA0LDQvdC1INC90LAg0LLRgNGK0LfQutCw0YLQsCIsCiAgICAiZ28iOiAi0J3QsNC/0YDQtdC0IiwKICAgICJpbnZpdGUiOiAi0J/QvtC60LDQvdCwIiwKICAgICJubyI6ICLQndC1IiwKICAgICJyZWdpc3RlciI6ICLQoNC10LPQuNGB0YLRgNCw0YbQuNGPIiwKICAgICJyZW1vdmUiOiAi0J/RgNC10LzQsNGF0L3QuCIsCiAgICAic2lnbl9pbiI6ICLQktC70LXQtyIsCiAgICAic2lnbl9vdXQiOiAi0JjQt9C70LXQtyIKICB9LAogICJjYWxsX2VuZGVkX3ZpZXciOiB7CiAgICAiY3JlYXRlX2FjY291bnRfYnV0dG9uIjogItCh0YrQt9C00LDQuSDQsNC60LDRg9C90YIiLAogICAgImNyZWF0ZV9hY2NvdW50X3Byb21wdCI6ICI8MD7Ql9Cw0YnQviDQvdC1INC90LDRgdGC0YDQvtC50YLQtSDQv9Cw0YDQvtC70LAg0LfQsCDQtNCwINC30LDQv9Cw0LfQuNGC0LUg0LDQutCw0YPQvdGC0LAg0YHQuD88LzA+PDE+0KnQtSDQvNC+0LbQtdGC0LUg0LTQsCDQt9Cw0L/QsNC30LjRgtC1INC40LzQtdGC0L4g0Lgg0LDQstCw0YLQsNGA0LAg0YHQuCDQt9CwINCx0YrQtNC10YnQuCDRgNCw0LfQs9C+0LLQvtGA0Lg8LzE+IiwKICAgICJub3Rfbm93X2J1dHRvbiI6ICLQndC1INGB0LXQs9CwLCDQstGK0YDQvdC4INGB0LUg0L3QsCDQvdCw0YfQsNC70L3QuNGPINC10LrRgNCw0L0iCiAgfSwKICAiY29tbW9uIjogewogICAgImF1ZGlvIjogItCX0LLRg9C6IiwKICAgICJhdmF0YXIiOiAi0JDQstCw0YLQsNGAIiwKICAgICJkaXNwbGF5X25hbWUiOiAi0JjQvNC1L9C/0YHQtdCy0LTQvtC90LjQvCIsCiAgICAiaG9tZSI6ICLQndCw0YfQsNC70L4iLAogICAgImxvYWRpbmciOiAi0JfQsNGA0LXQttC00LDQvdC14oCmIiwKICAgICJwYXNzd29yZCI6ICLQn9Cw0YDQvtC70LAiLAogICAgInByb2ZpbGUiOiAi0J/RgNC+0YTQuNC7IiwKICAgICJzZXR0aW5ncyI6ICLQndCw0YHRgtGA0L7QudC60LgiLAogICAgInVzZXJuYW1lIjogItCf0L7RgtGA0LXQsdC40YLQtdC70YHQutC+INC40LzQtSIsCiAgICAidmlkZW8iOiAi0JLQuNC00LXQviIKICB9LAogICJqb2luX2V4aXN0aW5nX2NhbGxfbW9kYWwiOiB7CiAgICAiam9pbl9idXR0b24iOiAi0JTQsCwg0L/RgNC40YHRitC10LTQuNC90Lgg0YHQtSIsCiAgICAidGV4dCI6ICLQotC+0LfQuCDRgNCw0LfQs9C+0LLQvtGAINCy0LXRh9C1INGB0YrRidC10YHRgtCy0YPQstCwLCDQuNGB0LrQsNGC0LUg0LvQuCDQtNCwINGB0LUg0L/RgNC40YHRitC10LTQuNC90LjRgtC1PyIsCiAgICAidGl0bGUiOiAi0J/RgNC40YHRitC10LTQuNC90Y/QstCw0L3QtSDQutGK0Lwg0YHRitGJ0LXRgdGC0LLRg9Cy0LDRiSDRgNCw0LfQs9C+0LLQvtGAPyIKICB9LAogICJsYXlvdXRfc3BvdGxpZ2h0X2xhYmVsIjogItCf0YDQvtC20LXQutGC0L7RgCIsCiAgImxvYmJ5IjogewogICAgImpvaW5fYnV0dG9uIjogItCS0LvQtdC3INCyINGA0LDQt9Cz0L7QstC+0YDQsCIKICB9LAogICJsb2dnaW5nX2luIjogItCS0LvQuNC30LDQvdC14oCmIiwKICAibG9naW5fYXV0aF9saW5rcyI6ICI8MD7QodGK0LfQtNCw0LnRgtC1INCw0LrQsNGD0L3RgjwvMD4g0LjQu9C4IDwyPtCS0LvQtdC30YLQtSDQutCw0YLQviDQs9C+0YHRgjwvMj4iLAogICJsb2dpbl90aXRsZSI6ICLQktC70LXQtyIsCiAgInJhZ2VzaGFrZV9yZXF1ZXN0X21vZGFsIjogewogICAgImJvZHkiOiAi0JTRgNGD0LMg0L/QvtGC0YDQtdCx0LjRgtC10Lsg0LIg0YLQvtC30Lgg0YDQsNC30LPQvtCy0L7RgCDQuNC80LAg0L/RgNC+0LHQu9C10LwuINCX0LAg0LTQsCDQtNC40LDQs9C90L7RgdGC0LjRhtC40YDQsNC80LUg0YLQvtC30Lgg0L/RgNC+0LHQu9C10Lwg0L/Qvi3QtNC+0LHRgNC1INC90Lgg0YHQtSDQuNGB0LrQsCDQtNCwINGB0YrQsdC10YDQtdC8IGRlYnVnINC70L7Qs9C+0LLQtS4iLAogICAgInRpdGxlIjogItCX0LDRj9Cy0LrQsCDQt9CwIGRlYnVnINC70L7Qs9C+0LLQtSIKICB9LAogICJyYWdlc2hha2Vfc2VuZF9sb2dzIjogItCY0LfQv9GA0LDRgtC10YLQtSBkZWJ1ZyDQu9C+0LPQvtCy0LUiLAogICJyYWdlc2hha2Vfc2VuZGluZyI6ICLQmNC30L/RgNCw0YnQsNC90LXigKYiLAogICJyZWNhcHRjaGFfZGlzbWlzc2VkIjogIlJlY2FwdGNoYSDQvtGC0YXQstGK0YDQu9C10L3QsCIsCiAgInJlY2FwdGNoYV9ub3RfbG9hZGVkIjogIlJlY2FwdGNoYSDQvdC1INC1INC30LDRgNC10LTQtdC90LAiLAogICJyZWdpc3RlciI6IHsKICAgICJwYXNzd29yZHNfbXVzdF9tYXRjaCI6ICLQn9Cw0YDQvtC70LjRgtC1INC90LUg0YHRitCy0L/QsNC00LDRgiIsCiAgICAicmVnaXN0ZXJpbmciOiAi0KDQtdCz0LjRgdGC0YDQuNGA0LDQvdC14oCmIgogIH0sCiAgInJlZ2lzdGVyX2F1dGhfbGlua3MiOiAiPDA+0JLQtdGH0LUg0LjQvNCw0YLQtSDQsNC60LDRg9C90YI/PC8wPjwxPjwwPtCS0LvQtdC30YLQtSDRgSDQvdC10LPQvjwvMD4g0LjQu9C4IDwyPtCS0LvQtdC30YLQtSDQutCw0YLQviDQs9C+0YHRgjwvMj48LzE+IiwKICAicmVnaXN0ZXJfY29uZmlybV9wYXNzd29yZF9sYWJlbCI6ICLQn9C+0YLQstGK0YDQtNC4INC/0LDRgNC+0LvQsNGC0LAiLAogICJyZXR1cm5faG9tZV9idXR0b24iOiAi0JLRgNGK0YnQsNC90LUg0L3QsCDQvdCw0YfQsNC70L3QuNGPINC10LrRgNCw0L0iLAogICJzY3JlZW5zaGFyZV9idXR0b25fbGFiZWwiOiAi0KHQv9C+0LTQtdC70Lgg0LXQutGA0LDQvdCwIiwKICAic2V0dGluZ3MiOiB7CiAgICAiZGV2ZWxvcGVyX3RhYl90aXRsZSI6ICLQoNCw0LfRgNCw0LHQvtGC0YfQuNC6IiwKICAgICJmZWVkYmFja190YWJfaDQiOiAi0JjQt9C/0YDQsNGC0Lgg0L7QsdGA0LDRgtC90LAg0LLRgNGK0LfQutCwIiwKICAgICJmZWVkYmFja190YWJfc2VuZF9sb2dzX2xhYmVsIjogItCS0LrQu9GO0YfQuCBkZWJ1ZyDQu9C+0LPQvtCy0LUiCiAgfSwKICAidW5hdXRoZW50aWNhdGVkX3ZpZXdfYm9keSI6ICLQktGB0LUg0L7RidC1INC90LUg0YHRgtC1INGA0LXQs9C40YHRgtGA0LjRgNCw0L3QuD8gPDI+0KHRitC30LTQsNC50YLQtSDQsNC60LDRg9C90YI8LzI+IiwKICAidW5hdXRoZW50aWNhdGVkX3ZpZXdfbG9naW5fYnV0dG9uIjogItCS0LvQtdC30YLQtSDQsiDQsNC60LDRg9C90YLQsCDRgdC4IiwKICAidmVyc2lvbiI6ICLQktC10YDRgdC40Y86IHt7dmVyc2lvbn19Igp9Cg==",dot=""+new URL("cs-app-Du_5mVg3.json",import.meta.url).href,fot=""+new URL("da-app-BBz-lePm.json",import.meta.url).href,hot=""+new URL("de-app-DjOuqT-j.json",import.meta.url).href,pot=""+new URL("el-app-BBr3LLTK.json",import.meta.url).href,mot=""+new URL("en-app-DTABSRbn.json",import.meta.url).href,got=""+new URL("es-app-Q3c7lmEj.json",import.meta.url).href,vot=""+new URL("et-app-DLvuR7m2.json",import.meta.url).href,yot="data:application/json;base64,ewogICJhMTF5IjogewogICAgInVzZXJfbWVudSI6ICLZgdmH2LHYs9iqINqp2KfYsdio2LEiCiAgfSwKICAiYWN0aW9uIjogewogICAgImNsb3NlIjogItio2LPYqtmGIiwKICAgICJnbyI6ICLYsdmB2KrZhiIsCiAgICAibm8iOiAi2K7bjNixIiwKICAgICJyZWdpc3RlciI6ICLYq9io2KrigIzZhtin2YUiLAogICAgInJlbW92ZSI6ICLYrdiw2YEiLAogICAgInNpZ25faW4iOiAi2YjYsdmI2K8iLAogICAgInNpZ25fb3V0IjogItiu2LHZiNisIgogIH0sCiAgImNhbGxfZW5kZWRfdmlldyI6IHsKICAgICJjcmVhdGVfYWNjb3VudF9idXR0b24iOiAi2LPYp9iu2Kog2K3Ys9in2Kgg2qnYp9ix2KjYsduMIiwKICAgICJjcmVhdGVfYWNjb3VudF9wcm9tcHQiOiAiPDA+2obYsdinINuM2qkg2LHZhdiyINi52KjZiNixINio2LHYp9uMINit2LPYp9ioINqp2KfYsdio2LHbjCDYrtmI2K8g2KrZhti424zZhSDZhtmF24zigIzaqdmG24zYr9ifPC8wPjwxPti02YXYpyDZhduM4oCM2KrZiNin2YbbjNivINmG2KfZhSDYrtmI2K8g2LHYpyDYrdmB2Lgg2qnZhtuM2K8g2Ygg24zaqSDYotmI2KfYqtin2LEg2KjYsdin24wg2KrZhdin2LPigIzZh9in24wg2KLbjNmG2K/ZhyDYqNiz2KfYstuM2K88LzE+IiwKICAgICJub3Rfbm93X2J1dHRvbiI6ICLYp9mE2KfZhiDZhtmH2Iwg2KjZhyDYtdmB2K3ZhyDYp9i12YTbjCDYqNix2q/Ysdiv24zYryIKICB9LAogICJjb21tb24iOiB7CiAgICAiYXVkaW8iOiAi2LXYr9inIiwKICAgICJhdmF0YXIiOiAi2KLZiNin2KrYp9ixIiwKICAgICJkaXNwbGF5X25hbWUiOiAi2YbYp9mFINmG2YXYp9uM2LTbjCIsCiAgICAiaG9tZSI6ICLYrtin2YbZhyIsCiAgICAibG9hZGluZyI6ICLYqNin2LHar9iy2KfYsduM4oCmIiwKICAgICJwYXNzd29yZCI6ICLYsdmF2LIg2LnYqNmI2LEiLAogICAgInByb2ZpbGUiOiAi2b7YsdmI2YHYp9uM2YQiLAogICAgInNldHRpbmdzIjogItiq2YbYuNuM2YXYp9iqIiwKICAgICJ1c2VybmFtZSI6ICLZhtin2YUg2qnYp9ix2KjYsduMIiwKICAgICJ2aWRlbyI6ICLZiNuM2K/bjNmIIgogIH0sCiAgImhlYWRlcl9sYWJlbCI6ICLYrtin2YbZh9mUINiq2YXYp9izINin2YTZhdmG2KoiLAogICJqb2luX2V4aXN0aW5nX2NhbGxfbW9kYWwiOiB7CiAgICAiam9pbl9idXR0b24iOiAi2KjZhNmH2Iwg2KjZhyDYqtmF2KfYsyDYqNm+24zZiNmG2K/bjNivIiwKICAgICJ0ZXh0IjogItin24zZhiDYqtmF2KfYsyDYp9iyINmC2KjZhCDZiNis2YjYryDYr9in2LHYr9iMINmF24zigIzYrtmI2KfZh9uM2K8g2KjZvtuM2YjZhtiv24zYr9ifIiwKICAgICJ0aXRsZSI6ICLZvtuM2YjYs9iqINio2Ycg2KrZhdin2LPYnyIKICB9LAogICJsYXlvdXRfc3BvdGxpZ2h0X2xhYmVsIjogItmG2YjYsSDYp9mB2qnZhiIsCiAgImxvYmJ5IjogewogICAgImpvaW5fYnV0dG9uIjogItm+24zZiNiz2KrZhiDYqNmHINiq2YXYp9izIgogIH0sCiAgImxvZ2dpbmdfaW4iOiAi2YjYsdmI2K/igKYiLAogICJsb2dpbl9hdXRoX2xpbmtzIjogIjwwPtiz2KfYrtiqINit2LPYp9ioINqp2KfYsdio2LHbjDwvMD4gT3IgPDI+2K/Ys9iq2LHYs9uMINio2Ycg2LnZhtmI2KfZhiDZhduM2YfZhdin2YY8LzI+IiwKICAibG9naW5fdGl0bGUiOiAi2YjYsdmI2K8iLAogICJyYWdlc2hha2VfcmVxdWVzdF9tb2RhbCI6IHsKICAgICJib2R5IjogItqp2KfYsdio2LEg2K/bjNqv2LHbjCDYr9ixINin24zZhiDYqtmF2KfYsyDZhdi02qnZhNuMINiv2KfYsdivLiDYqNix2KfbjCDYqti02K7bjNi1INio2YfYqtixINmF2LTaqdmE2Iwg2KjZh9iq2LEg2KfYs9iqINmF2Kcg2YTYp9qvINi524zYqOKAjNuM2KfYqNuMINix2Kcg2KzZhdi54oCM2KLZiNix24wg2qnZhtuM2YUuIiwKICAgICJ0aXRsZSI6ICLYr9ix2K7ZiNin2LPYqiDZhNin2q8g2LnbjNio4oCM24zYp9io24wiCiAgfSwKICAicmFnZXNoYWtlX3NlbmRfbG9ncyI6ICLYp9ix2LPYp9mEINmE2Kfar+KAjNmH2KfbjCDYuduM2KjigIzbjNin2KjbjCIsCiAgInJhZ2VzaGFrZV9zZW5kaW5nIjogItiv2LEg2K3Yp9mEINin2LHYs9in2YTigKYiLAogICJyYWdlc2hha2Vfc2VuZGluZ19sb2dzIjogItiv2LEg2K3Yp9mEINin2LHYs9in2YQg2KjYp9qv4oCM2YfYp9uMINi524zYqOKAjNuM2KfYqNuM4oCmIiwKICAicmVjYXB0Y2hhX2Rpc21pc3NlZCI6ICLYsduM2qnZvtqG2Kcg2LHYryDYtNivIiwKICAicmVjYXB0Y2hhX25vdF9sb2FkZWQiOiAi2qnZvtqG2Kcg2KjYp9ix2q/bjNix24wg2YbYtNivIiwKICAicmVnaXN0ZXIiOiB7CiAgICAicGFzc3dvcmRzX211c3RfbWF0Y2giOiAi2LHZhdiyINi52KjZiNixINio2KfbjNivINmH2YXYrtmI2KfZhtuMINiv2KfYtNiq2Ycg2KjYp9i02K8iLAogICAgInJlZ2lzdGVyaW5nIjogItir2KjYquKAjNmG2KfZheKApiIKICB9LAogICJyZWdpc3Rlcl9hdXRoX2xpbmtzIjogIjwwPtin2LIg2YLYqNmEINit2LPYp9ioINqp2KfYsdio2LHbjCDYr9in2LHbjNiv2J88LzA+PDE+PDA+2YjYsdmI2K88LzA+IE9yIDwyPtio2Ycg2LnZhtmI2KfZhiDbjNqpINmF24zZh9mF2KfZhiDZiNin2LHYryDYtNmI24zYrzwvMj48LzE+IiwKICAicmVnaXN0ZXJfY29uZmlybV9wYXNzd29yZF9sYWJlbCI6ICLYqtin24zbjNivINix2YXYsti52KjZiNixIiwKICAicmV0dXJuX2hvbWVfYnV0dG9uIjogItio2LHar9i02Kog2KjZhyDYtdmB2K3ZhyDYp9i12YTbjCIsCiAgInNjcmVlbnNoYXJlX2J1dHRvbl9sYWJlbCI6ICLYp9i02KrYsdin2qkg2q/YsNin2LHbjCDYtdmB2K3ZhyDZhtmF2KfbjNi0IiwKICAic2V0dGluZ3MiOiB7CiAgICAiZGV2ZWxvcGVyX3RhYl90aXRsZSI6ICLYqtmI2LPYudmHINiv2YfZhtiv2YciLAogICAgImZlZWRiYWNrX3RhYl9oNCI6ICLYqNin2LLYrtmI2LHYryDYp9ix2KfYptmHINiv2YfbjNivIiwKICAgICJmZWVkYmFja190YWJfc2VuZF9sb2dzX2xhYmVsIjogIti02KfZhdmEINmE2Kfar+KAjNmH2KfbjCDYuduM2KjigIzbjNin2KjbjCIKICB9LAogICJ1bmF1dGhlbnRpY2F0ZWRfdmlld19ib2R5IjogItmH2YbZiNiyINir2KjYquKAjNmG2KfZhSDZhtqp2LHYr9mH4oCM2KfbjNiv2J8gPDI+2LPYp9iu2Kog2K3Ys9in2Kgg2qnYp9ix2KjYsduMPC8yPiIsCiAgInVuYXV0aGVudGljYXRlZF92aWV3X2xvZ2luX2J1dHRvbiI6ICLYqNmHINit2LPYp9ioINqp2KfYsdio2LHbjCDYrtmI2K8g2YjYp9ix2K8g2LTZiNuM2K8iLAogICJ2ZXJzaW9uIjogItmG2LPYrtmHOiB7e9mG2LPYrtmHfX0iCn0K",bot=""+new URL("fi-app-tnO3DMdi.json",import.meta.url).href,_ot=""+new URL("fr-app-BxTYbDfK.json",import.meta.url).href,Sot=""+new URL("id-app-BEz8ptLJ.json",import.meta.url).href,wot=""+new URL("it-app-Cik25Qgd.json",import.meta.url).href,Eot=""+new URL("ja-app-Cp_00ujI.json",import.meta.url).href,Cot=""+new URL("lv-app-D-ZV3Ytk.json",import.meta.url).href,Tot=""+new URL("pl-app-CUkXVSZk.json",import.meta.url).href,Rot=""+new URL("ro-app-CdYgKCOW.json",import.meta.url).href,kot=""+new URL("ru-app-CIijOjFj.json",import.meta.url).href,Iot=""+new URL("sk-app-DaVEeQWZ.json",import.meta.url).href,xot=""+new URL("sv-app-DHLBEOTp.json",import.meta.url).href,Aot=""+new URL("tr-app-Dk--6BpP.json",import.meta.url).href,Mot=""+new URL("uk-app-DZD01h76.json",import.meta.url).href,Lot="data:application/json;base64,ewogICJhY3Rpb24iOiB7CiAgICAiY2xvc2UiOiAixJDDs25nIiwKICAgICJubyI6ICJLaMO0bmciLAogICAgInJlZ2lzdGVyIjogIsSQxINuZyBrw70iLAogICAgInNpZ25faW4iOiAixJDEg25nIG5o4bqtcCIsCiAgICAic2lnbl9vdXQiOiAixJDEg25nIHh14bqldCIsCiAgICAic3VibWl0IjogIkfhu61pIgogIH0sCiAgImNhbGxfZW5kZWRfdmlldyI6IHsKICAgICJjcmVhdGVfYWNjb3VudF9idXR0b24iOiAiVOG6oW8gdMOgaSBraG/huqNuIiwKICAgICJjcmVhdGVfYWNjb3VudF9wcm9tcHQiOiAiPDA+VOG6oWkgc2FvIGzhuqFpIGtow7RuZyBob8OgbiB0aGnhu4duIGLhurFuZyBjw6FjaCDEkeG6t3QgbeG6rXQga2jhuql1IMSR4buDIGdp4buvIHTDoGkga2hv4bqjbiBj4bunYSBi4bqhbj88LzA+PDE+QuG6oW4gc+G6vSBjw7MgdGjhu4MgZ2nhu68gdMOqbiB2w6AgxJHhurd0IOG6o25oIMSR4bqhaSBkaeG7h24gY2hvIG5o4buvbmcgY3Xhu5ljIGfhu41pIHRp4bq/cCB0aGVvLjwvMT4iLAogICAgImZlZWRiYWNrX2RvbmUiOiAiPDA+Q+G6o20gaMahbiB2w6wgxJHDoyBwaOG6o24gaOG7k2khPC8wPiIsCiAgICAiZmVlZGJhY2tfcHJvbXB0IjogIjwwPkNow7puZyB0w7RpIG114buRbiBuZ2hlIHBo4bqjbiBo4buTaSBj4bunYSBi4bqhbiDEkeG7gyBjw7JuIGPhuqNpIHRoaeG7h24gdHLhuqNpIG5naGnhu4dtIGNobyBi4bqhbi48LzA+IiwKICAgICJoZWFkbGluZSI6ICJ7e2Rpc3BsYXlOYW1lfX0sIGN14buZYyBn4buNaSDEkcOjIGvhur90IHRow7pjLiIKICB9LAogICJjb21tb24iOiB7CiAgICAiYXVkaW8iOiAiw4JtIHRoYW5oIiwKICAgICJhdmF0YXIiOiAi4bqibmggxJHhuqFpIGRp4buHbiIsCiAgICAiZGlzcGxheV9uYW1lIjogIlTDqm4gaGnhu4NuIHRo4buLIiwKICAgICJsb2FkaW5nIjogIsSQYW5nIHThuqNp4oCmIiwKICAgICJwYXNzd29yZCI6ICJN4bqtdCBraOG6qXUiLAogICAgInByb2ZpbGUiOiAiSOG7kyBzxqEiLAogICAgInNldHRpbmdzIjogIkPDoGkgxJHhurd0IiwKICAgICJ1c2VybmFtZSI6ICJUw6puIG5nxrDhu51pIGTDuW5nIiwKICAgICJ2aWRlbyI6ICJUcnV54buBbiBow6xuaCIKICB9LAogICJqb2luX2V4aXN0aW5nX2NhbGxfbW9kYWwiOiB7CiAgICAiam9pbl9idXR0b24iOiAiVsOibmcsIHRoYW0gZ2lhIGN14buZYyBn4buNaSIsCiAgICAidGV4dCI6ICJDdeG7mWMgZ+G7jWkgxJHDoyB04buTbiB04bqhaSwgYuG6oW4gY8OzIG114buRbiB0aGFtIGdpYSBraMO0bmc/IiwKICAgICJ0aXRsZSI6ICJUaGFtIGdpYSBjdeG7mWMgZ+G7jWk/IgogIH0sCiAgImxheW91dF9zcG90bGlnaHRfbGFiZWwiOiAiVGnDqnUgxJFp4buDbSIsCiAgImxvYmJ5IjogewogICAgImpvaW5fYnV0dG9uIjogIlRoYW0gZ2lhIGN14buZYyBn4buNaSIKICB9LAogICJsb2dnaW5nX2luIjogIsSQYW5nIMSRxINuZyBuaOG6rXDigKYiLAogICJsb2dpbl9hdXRoX2xpbmtzIjogIjwwPlThuqFvIHTDoGkga2hv4bqjbjwvMD4gSGF5IDwyPlRoYW0gZ2lhIGTGsOG7m2kgdMOqbiBraMOhYzwvMj4iLAogICJsb2dpbl90aXRsZSI6ICLEkMSDbmcgbmjhuq1wIiwKICAicmFnZXNoYWtlX3JlcXVlc3RfbW9kYWwiOiB7CiAgICAiYm9keSI6ICJN4buZdCBuZ8aw4budaSBkw7luZyBraMOhYyB0cm9uZyBjdeG7mWMgZ+G7jWkgxJFhbmcgZ+G6t3AgduG6pW4gxJHhu4EuIMSQ4buDIGPDsyB0aOG7gyBjaOG6qW4gxJFvw6FuIHThu5F0IGjGoW4gY2jDum5nIHTDtGkgbXXhu5FuIHRodSB0aOG6rXAgbmjhuq10IGvDvSBn4buhIGzhu5dpLiIsCiAgICAidGl0bGUiOiAiWcOqdSBj4bqndSBuaOG6rXQga8O9IGfhu6EgbOG7l2kiCiAgfSwKICAicmFnZXNoYWtlX3NlbmRpbmciOiAixJBhbmcgZ+G7rWnigKYiLAogICJyZWNhcHRjaGFfbm90X2xvYWRlZCI6ICJDaMawYSB04bqjaSDEkcaw4bujYyBSZWNhcHRjaGEiLAogICJyZWdpc3RlciI6IHsKICAgICJwYXNzd29yZHNfbXVzdF9tYXRjaCI6ICJN4bqtdCBraOG6qXUgcGjhuqNpIGto4bubcCIsCiAgICAicmVnaXN0ZXJpbmciOiAixJBhbmcgxJHEg25nIGvDveKApiIKICB9LAogICJyZWdpc3Rlcl9hdXRoX2xpbmtzIjogIjwwPsSQw6MgY8OzIHTDoGkga2hv4bqjbj88LzA+PDE+PDA+xJDEg25nIG5o4bqtcDwvMD4gSGF5IDwyPlRoYW0gZ2lhIGTGsOG7m2kgdMOqbiBLaMOhY2g8LzI+PC8xPiIsCiAgInJlZ2lzdGVyX2NvbmZpcm1fcGFzc3dvcmRfbGFiZWwiOiAiWMOhYyBuaOG6rW4gbeG6rXQga2jhuql1IiwKICAic2NyZWVuc2hhcmVfYnV0dG9uX2xhYmVsIjogIkNoaWEgc+G6uyBtw6BuIGjDrG5oIiwKICAic2V0dGluZ3MiOiB7CiAgICAiZGV2ZWxvcGVyX3RhYl90aXRsZSI6ICJOaMOgIHBow6F0IHRyaeG7g24iLAogICAgImZlZWRiYWNrX3RhYl9kZXNjcmlwdGlvbl9sYWJlbCI6ICJQaOG6o24gaOG7k2kgY+G7p2EgYuG6oW4iLAogICAgImZlZWRiYWNrX3RhYl9oNCI6ICJH4butaSBwaOG6o24gaOG7k2kiLAogICAgImZlZWRiYWNrX3RhYl9zZW5kX2xvZ3NfbGFiZWwiOiAiS8OobSB0aGVvIG5o4bqtdCBrw70gZ+G7oSBs4buXaSIsCiAgICAiZmVlZGJhY2tfdGFiX3RoYW5rX3lvdSI6ICJD4bqjbSDGoW4sIGNow7puZyB0w7RpIMSRw6Mgbmjhuq1uIMSRxrDhu6NjIHBo4bqjbiBo4buTaSEiLAogICAgImZlZWRiYWNrX3RhYl90aXRsZSI6ICJQaOG6o24gaOG7k2kiCiAgfSwKICAic3VibWl0dGluZyI6ICLEkGFuZyBn4butaeKApiIsCiAgInVuYXV0aGVudGljYXRlZF92aWV3X2JvZHkiOiAiQ2jGsGEgxJHEg25nIGvDvT8gPDI+VOG6oW8gdMOgaSBraG/huqNuPC8yPiIsCiAgInVuYXV0aGVudGljYXRlZF92aWV3X2xvZ2luX2J1dHRvbiI6ICLEkMSDbmcgbmjhuq1wIHbDoG8gdMOgaSBraG/huqNuIGPhu6dhIGLhuqFuIiwKICAidmVyc2lvbiI6ICJQaGnDqm4gYuG6o246IHt7dmVyc2lvbn19Igp9Cg==",Oot=""+new URL("zh-Hans-app-BY5jJGyr.json",import.meta.url).href,Pot=""+new URL("zh-Hant-app-BV1LKS_j.json",import.meta.url).href,{slice:Dot,forEach:Not}=[];function Uot(t){return Not.call(Dot.call(arguments,1),e=>{if(e)for(const n in e)t[n]===void 0&&(t[n]=e[n])}),t}function jot(t){return typeof t!="string"?!1:[/<\s*script.*?>/i,/<\s*\/\s*script\s*>/i,/<\s*img.*?on\w+\s*=/i,/<\s*\w+\s*on\w+\s*=.*?>/i,/javascript\s*:/i,/vbscript\s*:/i,/expression\s*\(/i,/eval\s*\(/i,/alert\s*\(/i,/document\.cookie/i,/document\.write\s*\(/i,/window\.location/i,/innerHTML/i].some(n=>n.test(t))}const RJ=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/,Fot=function(t,e){const r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{path:"/"},i=encodeURIComponent(e);let s=`${t}=${i}`;if(r.maxAge>0){const o=r.maxAge-0;if(Number.isNaN(o))throw new Error("maxAge should be a Number");s+=`; Max-Age=${Math.floor(o)}`}if(r.domain){if(!RJ.test(r.domain))throw new TypeError("option domain is invalid");s+=`; Domain=${r.domain}`}if(r.path){if(!RJ.test(r.path))throw new TypeError("option path is invalid");s+=`; Path=${r.path}`}if(r.expires){if(typeof r.expires.toUTCString!="function")throw new TypeError("option expires is invalid");s+=`; Expires=${r.expires.toUTCString()}`}if(r.httpOnly&&(s+="; HttpOnly"),r.secure&&(s+="; Secure"),r.sameSite)switch(typeof r.sameSite=="string"?r.sameSite.toLowerCase():r.sameSite){case!0:s+="; SameSite=Strict";break;case"lax":s+="; SameSite=Lax";break;case"strict":s+="; SameSite=Strict";break;case"none":s+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}return r.partitioned&&(s+="; Partitioned"),s},kJ={create(t,e,n,r){let i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{path:"/",sameSite:"strict"};n&&(i.expires=new Date,i.expires.setTime(i.expires.getTime()+n*60*1e3)),r&&(i.domain=r),document.cookie=Fot(t,e,i)},read(t){const e=`${t}=`,n=document.cookie.split(";");for(let r=0;r<n.length;r++){let i=n[r];for(;i.charAt(0)===" ";)i=i.substring(1,i.length);if(i.indexOf(e)===0)return i.substring(e.length,i.length)}return null},remove(t,e){this.create(t,"",-1,e)}};var $ot={name:"cookie",lookup(t){let{lookupCookie:e}=t;if(e&&typeof document<"u")return kJ.read(e)||void 0},cacheUserLanguage(t,e){let{lookupCookie:n,cookieMinutes:r,cookieDomain:i,cookieOptions:s}=e;n&&typeof document<"u"&&kJ.create(n,t,r,i,s)}},Bot={name:"querystring",lookup(t){let{lookupQuerystring:e}=t,n;if(typeof window<"u"){let{search:r}=window.location;!window.location.search&&window.location.hash?.indexOf("?")>-1&&(r=window.location.hash.substring(window.location.hash.indexOf("?")));const s=r.substring(1).split("&");for(let o=0;o<s.length;o++){const a=s[o].indexOf("=");a>0&&s[o].substring(0,a)===e&&(n=s[o].substring(a+1))}}return n}},Hot={name:"hash",lookup(t){let{lookupHash:e,lookupFromHashIndex:n}=t,r;if(typeof window<"u"){const{hash:i}=window.location;if(i&&i.length>2){const s=i.substring(1);if(e){const o=s.split("&");for(let a=0;a<o.length;a++){const c=o[a].indexOf("=");c>0&&o[a].substring(0,c)===e&&(r=o[a].substring(c+1))}}if(r)return r;if(!r&&n>-1){const o=i.match(/\/([a-zA-Z-]*)/g);return Array.isArray(o)?o[typeof n=="number"?n:0]?.replace("/",""):void 0}}}return r}};let Ig=null;const IJ=()=>{if(Ig!==null)return Ig;try{if(Ig=typeof window<"u"&&window.localStorage!==null,!Ig)return!1;const t="i18next.translate.boo";window.localStorage.setItem(t,"foo"),window.localStorage.removeItem(t)}catch{Ig=!1}return Ig};var qot={name:"localStorage",lookup(t){let{lookupLocalStorage:e}=t;if(e&&IJ())return window.localStorage.getItem(e)||void 0},cacheUserLanguage(t,e){let{lookupLocalStorage:n}=e;n&&IJ()&&window.localStorage.setItem(n,t)}};let xg=null;const xJ=()=>{if(xg!==null)return xg;try{if(xg=typeof window<"u"&&window.sessionStorage!==null,!xg)return!1;const t="i18next.translate.boo";window.sessionStorage.setItem(t,"foo"),window.sessionStorage.removeItem(t)}catch{xg=!1}return xg};var Vot={name:"sessionStorage",lookup(t){let{lookupSessionStorage:e}=t;if(e&&xJ())return window.sessionStorage.getItem(e)||void 0},cacheUserLanguage(t,e){let{lookupSessionStorage:n}=e;n&&xJ()&&window.sessionStorage.setItem(n,t)}},Kot={name:"navigator",lookup(t){const e=[];if(typeof navigator<"u"){const{languages:n,userLanguage:r,language:i}=navigator;if(n)for(let s=0;s<n.length;s++)e.push(n[s]);r&&e.push(r),i&&e.push(i)}return e.length>0?e:void 0}},Got={name:"htmlTag",lookup(t){let{htmlTag:e}=t,n;const r=e||(typeof document<"u"?document.documentElement:null);return r&&typeof r.getAttribute=="function"&&(n=r.getAttribute("lang")),n}},zot={name:"path",lookup(t){let{lookupFromPathIndex:e}=t;if(typeof window>"u")return;const n=window.location.pathname.match(/\/([a-zA-Z-]*)/g);return Array.isArray(n)?n[typeof e=="number"?e:0]?.replace("/",""):void 0}},Wot={name:"subdomain",lookup(t){let{lookupFromSubdomainIndex:e}=t;const n=typeof e=="number"?e+1:1,r=typeof window<"u"&&window.location?.hostname?.match(/^(\w{2,5})\.(([a-z0-9-]{1,63}\.[a-z]{2,6})|localhost)/i);if(r)return r[n]}};let Fpe=!1;try{document.cookie,Fpe=!0}catch{}const $pe=["querystring","cookie","localStorage","sessionStorage","navigator","htmlTag"];Fpe||$pe.splice(1,1);const Yot=()=>({order:$pe,lookupQuerystring:"lng",lookupCookie:"i18next",lookupLocalStorage:"i18nextLng",lookupSessionStorage:"i18nextLng",caches:["localStorage"],excludeCacheFor:["cimode"],convertDetectedLanguage:t=>t});class Bpe{constructor(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.type="languageDetector",this.detectors={},this.init(e,n)}init(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{languageUtils:{}},n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.services=e,this.options=Uot(n,this.options||{},Yot()),typeof this.options.convertDetectedLanguage=="string"&&this.options.convertDetectedLanguage.indexOf("15897")>-1&&(this.options.convertDetectedLanguage=i=>i.replace("-","_")),this.options.lookupFromUrlIndex&&(this.options.lookupFromPathIndex=this.options.lookupFromUrlIndex),this.i18nOptions=r,this.addDetector($ot),this.addDetector(Bot),this.addDetector(qot),this.addDetector(Vot),this.addDetector(Kot),this.addDetector(Got),this.addDetector(zot),this.addDetector(Wot),this.addDetector(Hot)}addDetector(e){return this.detectors[e.name]=e,this}detect(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.options.order,n=[];return e.forEach(r=>{if(this.detectors[r]){let i=this.detectors[r].lookup(this.options);i&&typeof i=="string"&&(i=[i]),i&&(n=n.concat(i))}}),n=n.filter(r=>r!=null&&!jot(r)).map(r=>this.options.convertDetectedLanguage(r)),this.services&&this.services.languageUtils&&this.services.languageUtils.getBestMatchFromCodes?n:n.length>0?n[0]:null}cacheUserLanguage(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.options.caches;n&&(this.options.excludeCacheFor&&this.options.excludeCacheFor.indexOf(e)>-1||n.forEach(r=>{this.detectors[r]&&this.detectors[r].cacheUserLanguage(e,this.options)}))}}Bpe.type="languageDetector";var fE={},AJ;function Jot(){if(AJ)return fE;AJ=1,Object.defineProperty(fE,"__esModule",{value:!0}),fE.shouldPolyfill=t;function t(){return!Intl.Segmenter}return fE}var Xot=Jot();function Qot(){return typeof Intl>"u"||!("DurationFormat"in Intl)}const Hpe=Object.assign({"../locales/bg/app.json":uot,"../locales/cs/app.json":dot,"../locales/da/app.json":fot,"../locales/de/app.json":hot,"../locales/el/app.json":pot,"../locales/en/app.json":mot,"../locales/es/app.json":got,"../locales/et/app.json":vot,"../locales/fa/app.json":yot,"../locales/fi/app.json":bot,"../locales/fr/app.json":_ot,"../locales/id/app.json":Sot,"../locales/it/app.json":wot,"../locales/ja/app.json":Eot,"../locales/lv/app.json":Cot,"../locales/pl/app.json":Tot,"../locales/ro/app.json":Rot,"../locales/ru/app.json":kot,"../locales/sk/app.json":Iot,"../locales/sv/app.json":xot,"../locales/tr/app.json":Aot,"../locales/uk/app.json":Mot,"../locales/vi/app.json":Lot,"../locales/zh-Hans/app.json":Oot,"../locales/zh-Hant/app.json":Pot}),Zot=(t,e)=>Hpe[`../locales/${t}/${e}.json`],eat=[...new Set(Object.keys(Hpe).map(t=>{const e=t.match(/\/([^/]+)\/[^/]+\.json$/)?.[1];if(!e)throw new Error(`Could not parse locale URL ${t}`);return e}))],tat={type:"backend",init(){},read(t,e,n){(async()=>{const r=Zot(t,e);if(!r)throw new Error(`Namespace ${e} for locale ${t} not found`);const i=await fetch(r,{credentials:"omit",headers:{Accept:"application/json"}});if(n9(i))throw Error(`Failed to fetch ${r}`);return await i.json()})().then(r=>n(null,r),r=>n(r,null))}};class nat{constructor(){this.config=0,this.sentry=0}allDepsAreLoaded(){return!Object.values(this).some(e=>e!==2)}}class bc{constructor(){this.isInitialized=!1,this.loadStates=new nat}static isInitialized(){return!!bc.internalInstance?.isInitialized}static async initBeforeReact(){oBe();const e=[];Xot.shouldPolyfill()&&e.push(Mb(()=>import("./polyfill-force-Bdf0Oo48.js").then(s=>s.p),[],import.meta.url)),Qot()&&e.push(Mb(()=>import("./polyfill-force-CXG23BH3.js"),[],import.meta.url)),await Promise.all(e);const n=new Bpe;n.addDetector({name:"urlFragment",lookup:()=>er().lang??void 0}),Cs.on("languageChanged",s=>{document.documentElement.lang=s}),await Cs.use(tat).use(n).use(DDe).init({fallbackLng:"en",defaultNS:"app",keySeparator:".",nsSeparator:!1,pluralSeparator:"_",contextSeparator:"|",supportedLngs:eat,interpolation:{escapeValue:!1},detection:{order:["urlFragment","navigator"],caches:[]}});const{fonts:r,fontScale:i}=er();i!==null&&document.documentElement.style.setProperty("--font-scale",i.toString()),r.length>0&&document.documentElement.style.setProperty("--font-family",r.map(s=>`"${s}"`).join(", ")),document.body.setAttribute("data-platform",Hs)}static init(){return bc?.internalInstance?.initPromise?null:(bc.internalInstance=new bc,bc.internalInstance.initPromise=new Promise(e=>{bc.internalInstance?.initStep(e)}),bc.internalInstance.initPromise)}static reset(){bc.internalInstance=void 0}initStep(e){if(this.loadStates.config===0&&(this.loadStates.config=1,_n.init().then(()=>{this.loadStates.config=2,this.initStep(e)},n=>{N.error("Failed to load config",n)})),this.loadStates.sentry===0&&this.loadStates.config===2){let n,r;n=er().sentryDsn??void 0,r=er().sentryEnvironment??void 0,n&&$Ie({dsn:n,environment:r,integrations:[sxe({useEffect:xe.useEffect,useLocation:cs,useNavigationType:YEe,createRoutesFromChildren:ZC,matchRoutes:t7})],tracesSampleRate:1}),this.loadStates.sentry=2}this.loadStates.allDepsAreLoaded()&&(e(),this.isInitialized=!0)}}const rat=()=>{const[t,e]=_.useState(()=>er().theme),n=_.useRef(document.body.classList.item(0));_.useEffect(()=>{if(vt){const r=i=>{i.preventDefault(),"name"in i.detail.data&&typeof i.detail.data.name=="string"&&e(i.detail.data.name),vt.api.transport.reply(i.detail,{})};return vt.lazyActions.on(Rr.ThemeChange,r),()=>{vt.lazyActions.off(Rr.ThemeChange,r)}}},[]),_.useLayoutEffect(()=>{const r=t?.includes("light")?"light":"dark",i=t?.includes("high-contrast")?"-hc":"",s="cpd-theme-"+r+i;s!==n.current&&(document.body.classList.remove("cpd-theme-light","cpd-theme-dark","cpd-theme-light-hc","cpd-theme-dark-hc"),document.body.classList.add(s),n.current=s),document.body.classList.remove("no-theme")},[n,t])},hE=oxe(Nee),iat=({children:t})=>{const{pathname:e}=cs();return _.useEffect(()=>{let n="";!["/login","/register"].includes(e)&&!vt&&(n="var(--background-gradient)"),document.getElementsByTagName("body")[0].style.backgroundImage=n},[e]),S.jsx(S.Fragment,{children:t})},sat=({children:t})=>(rat(),t),oat=({vm:t})=>{const[e,n]=_.useState(!1);_.useEffect(()=>{bc.init()?.then(async()=>{e||(n(!0),await vt?.api.sendContentLoaded())}).catch(N.error)});const{header:r}=_.useMemo(er,[]),i=e?S.jsx(NKe,{children:S.jsx(Zle,{value:t.mediaDevices,children:S.jsx(DYe,{children:S.jsx(rR,{fallback:s=>S.jsx(v_,{error:s,widget:vt}),children:S.jsxs(dCe,{children:[S.jsx(hE,{path:"/",element:S.jsx(Nfe,{})}),S.jsx(hE,{path:"/login",element:S.jsx(iXe,{})}),S.jsx(hE,{path:"/register",element:S.jsx(sXe,{})}),S.jsx(hE,{path:"*",element:S.jsx(lot,{})})]})})})})}):S.jsx(UR,{});return S.jsx(DCe,{children:S.jsx(iat,{children:S.jsx(sat,{children:S.jsx(Yne,{children:S.jsx(_.Suspense,{fallback:null,children:r===h_.AppBar?S.jsx(sst,{children:i}):i})})})})})};class aat{constructor(e){this.scope=e,this.mediaDevices=new VGe(this.scope)}}window.setLKLogLevel=SZ;RBe().catch(t=>{N.error("Failed to initialize rageshake",t)});SZ("info");ISe((t,e,n)=>{global.mx_rage_logger.log(t,"livekit",e,n)});N.info("Element Call embedded-v0.19.0");const WO=Gbe.createRoot(document.getElementById("root"));let kb=null;window.isSecureContext?navigator.mediaDevices||(kb=new Error("Your browser does not support WebRTC.")):kb=new Error(`This app cannot run in an insecure context. To fix this, access the app via a local loopback address, or serve it over HTTPS.
299
299
  https://developer.mozilla.org/en-US/docs/Web/Security/Secure_Contexts`);if(kb!==null)throw WO.render(kb.message),kb;bc.initBeforeReact().then(()=>{WO.render(S.jsx(_.StrictMode,{children:S.jsx(oat,{vm:new aat(zle)})}))}).catch(t=>{N.error(`Failed to initialize app ${t.message}`,t),WO.render(t.message)});export{mat as A,vat as B,_n as C,Y0e as D,Z as E,bat as F,Qo as G,gP as H,yat as I,Zt as J,Ve as K,dat as L,In as M,Bu as N,NB as O,W0e as P,_at as Q,Sat as R,Qh as S,Kn as T,gat as U,Xt as V,Sv as W,X0e as X,oa as _,Bc as a,Dl as b,pat as c,B as d,L as e,FW as f,cat as g,uat as h,xfe as i,Ci as j,he as k,N as l,fp as m,Pe as n,_T as o,cP as p,gQ as q,hbe as r,Wp as s,Iat as t,ly as u,Nl as v,hr as w,i1e as x,G1 as y,yT as z};
300
- //# sourceMappingURL=index-CmLeY5vV.js.map
300
+ //# sourceMappingURL=index-DA2EwfZ5.js.map