commit 78707b534cfd47e34f040956c4a867a8575af2de
parent 6e3bdb251287d66548c583ab7d3c70ad6143481b
Author: MTRNord <MTRNord@users.noreply.github.com>
Date: Tue, 3 Jan 2023 19:14:21 +0000
deploy: MTRNord/matrix-art@4e8f1827ce9fc4fee5de3403bd47c7b2f97e9aed
Diffstat:
11 files changed, 60 insertions(+), 51 deletions(-)
diff --git a/pr-121/assets/Join.95fe70ce.js b/pr-121/assets/Join.95fe70ce.js
@@ -0,0 +1 @@
+import{u,o as e,w as g}from"./vendor.8ab614fa.js";import{H as p,C as f}from"./index.7100b17a.js";const b=i=>r=>{const t=u();return e(i,{navigate:t,...r})},l="inline-block p-4 w-full text-gray-900 bg-gray-100 hover:ring-blue-300 hover:ring-1 focus:ring-transparent focus:outline-none dark:bg-gray-700 dark:text-white",c="inline-block p-4 w-full bg-white hover:text-gray-700 hover:bg-gray-50 hover:ring-blue-300 hover:ring-1 focus:ring-transparent focus:outline-none dark:hover:text-white dark:bg-gray-800 dark:hover:bg-gray-700";class d extends g{constructor(r){super(r),this.state={homeserver:"https://art.midnightthoughts.space",username:"",password:"",create_profile:!0,current_tab:"login"}}async onSubmit(r){r.preventDefault();const t=this.context;!t||this.state.homeserver===""||this.state.username===""||this.state.password===""||(this.state.current_tab==="login"&&!(t!=null&&t.isLoggedIn())?await t.login(this.state.homeserver,this.state.username,this.state.password,this.state.create_profile):this.state.current_tab==="register"&&!t.isLoggedIn()&&await t.register(this.state.homeserver,this.state.username,this.state.password,this.state.create_profile),this.props.navigate("/",{replace:!0}))}onInput(r){r.preventDefault();const t=r.target,s=t.type==="checkbox"?t.checked:t.value,n=t.name;this.setState({[n]:s})}render(r,{homeserver:t,username:s,password:n,create_profile:h,current_tab:a}){return e("div",{class:"flex flex-col",children:[e("header",{children:e(p,{})}),e("main",{class:"m-12 mt-6",children:[e("h1",{class:"text-3xl font-bold mb-4 text-white",children:"Join"}),e("div",{class:"flex items-center flex-col",children:[e("ul",{class:"w-1/4 mb-8 hidden text-sm font-medium text-center text-gray-500 rounded-lg divide-x divide-gray-200 shadow sm:flex dark:divide-gray-700 dark:text-gray-400",children:[e("li",{class:"w-full",children:e("a",{href:"#",class:a==="login"?`${l} rounded-l-lg`:`${c} rounded-l-lg`,onClick:o=>{o.preventDefault(),this.setState({current_tab:"login"})},children:"Login"})}),e("li",{class:"w-full",children:e("a",{href:"#",class:a==="register"?`${l} rounded-r-lg`:`${c} rounded-r-lg`,onClick:o=>{o.preventDefault(),this.setState({current_tab:"register"})},children:"Register"})})]}),e("form",{onSubmit:this.onSubmit.bind(this),class:"flex flex-col items-start w-1/4",children:[e("input",{class:"search-bg shadow rounded-lg border-0 py-3 px-4 placeholder-data text-white mb-4 w-full",type:"url",placeholder:"Homeserver",name:"homeserver",value:t,onInput:this.onInput.bind(this)}),e("input",{class:"search-bg shadow rounded-lg border-0 py-3 px-4 placeholder-data text-white mb-4 w-full",autocomplete:"username",type:"text",placeholder:"Username",name:"username",value:s,onInput:this.onInput.bind(this)}),e("input",{class:"search-bg shadow rounded-lg border-0 py-3 px-4 placeholder-data text-white mb-4 w-full",autoComplete:"current-password",type:"password",placeholder:"Password",name:"password",value:n,onInput:this.onInput.bind(this)}),e("label",{class:"mb-4 flex items-center",children:[e("input",{class:"checked:bg-blue-600 checked:border-transparent checked:bg-no-repeat checked:bg-[url('/tick.svg')] outline-none focus:outline-offset-2 focus:ring-blue-600 focus:ring-offset-2 focus:ring-offset-white p-0 inline-block align-middle box-border select-none shrink-0 shadow h-5 w-5 appearance-none rounded bg-white border-none",type:"checkbox",name:"create_profile",checked:h,onInput:this.onInput.bind(this)}),e("span",{class:"ml-4 text-data text-base font-medium",children:"Create account"})]}),e("button",{type:"submit",class:"text-white font-bold text-lg logo-bg rounded-xl py-2 px-10 shadow transform transition-transform ease-in-out duration-300 hover:scale-105 w-1/2 self-center",children:a==="login"?"Login":"Register"})]})]})]})]})}}d.contextType=f;var w=b(d);export{w as default};
diff --git a/pr-121/assets/Join.e97dcbed.js b/pr-121/assets/Join.e97dcbed.js
@@ -1 +0,0 @@
-var b=Object.defineProperty;var c=Object.getOwnPropertySymbols;var m=Object.prototype.hasOwnProperty,x=Object.prototype.propertyIsEnumerable;var d=(s,t,e)=>t in s?b(s,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):s[t]=e,h=(s,t)=>{for(var e in t||(t={}))m.call(t,e)&&d(s,e,t[e]);if(c)for(var e of c(t))x.call(t,e)&&d(s,e,t[e]);return s};import{u as w,E as v}from"./vendor.09079154.js";import{j as r,a as n,H as y,C as k}from"./index.955c971f.js";const I=s=>t=>{const e=w();return r(s,h({navigate:e},t))},u="inline-block p-4 w-full text-gray-900 bg-gray-100 hover:ring-blue-300 hover:ring-1 focus:ring-transparent focus:outline-none dark:bg-gray-700 dark:text-white",g="inline-block p-4 w-full bg-white hover:text-gray-700 hover:bg-gray-50 hover:ring-blue-300 hover:ring-1 focus:ring-transparent focus:outline-none dark:hover:text-white dark:bg-gray-800 dark:hover:bg-gray-700";class p extends v{constructor(t){super(t);this.state={homeserver:"https://art.midnightthoughts.space",username:"",password:"",create_profile:!0,current_tab:"login"}}async onSubmit(t){t.preventDefault();const e=this.context;!e||this.state.homeserver===""||this.state.username===""||this.state.password===""||(this.state.current_tab==="login"&&!(e!=null&&e.isLoggedIn())?await e.login(this.state.homeserver,this.state.username,this.state.password,this.state.create_profile):this.state.current_tab==="register"&&!e.isLoggedIn()&&await e.register(this.state.homeserver,this.state.username,this.state.password,this.state.create_profile),this.props.navigate("/",{replace:!0}))}onInput(t){t.preventDefault();const e=t.target,a=e.type==="checkbox"?e.checked:e.value,o=e.name;this.setState({[o]:a})}render(t,{homeserver:e,username:a,password:o,create_profile:f,current_tab:i}){return n("div",{class:"flex flex-col",children:[r("header",{children:r(y,{})}),n("main",{class:"m-12 mt-6",children:[r("h1",{class:"text-3xl font-bold mb-4 text-white",children:"Join"}),n("div",{class:"flex items-center flex-col",children:[n("ul",{class:"w-1/4 mb-8 hidden text-sm font-medium text-center text-gray-500 rounded-lg divide-x divide-gray-200 shadow sm:flex dark:divide-gray-700 dark:text-gray-400",children:[r("li",{class:"w-full",children:r("a",{href:"#",class:i==="login"?`${u} rounded-l-lg`:`${g} rounded-l-lg`,onClick:l=>{l.preventDefault(),this.setState({current_tab:"login"})},children:"Login"})}),r("li",{class:"w-full",children:r("a",{href:"#",class:i==="register"?`${u} rounded-r-lg`:`${g} rounded-r-lg`,onClick:l=>{l.preventDefault(),this.setState({current_tab:"register"})},children:"Register"})})]}),n("form",{onSubmit:this.onSubmit.bind(this),class:"flex flex-col items-start w-1/4",children:[r("input",{class:"search-bg shadow rounded-lg border-0 py-3 px-4 placeholder-data text-white mb-4 w-full",type:"url",placeholder:"Homeserver",name:"homeserver",value:e,onInput:this.onInput.bind(this)}),r("input",{class:"search-bg shadow rounded-lg border-0 py-3 px-4 placeholder-data text-white mb-4 w-full",autocomplete:"username",type:"text",placeholder:"Username",name:"username",value:a,onInput:this.onInput.bind(this)}),r("input",{class:"search-bg shadow rounded-lg border-0 py-3 px-4 placeholder-data text-white mb-4 w-full",autoComplete:"current-password",type:"password",placeholder:"Password",name:"password",value:o,onInput:this.onInput.bind(this)}),n("label",{class:"mb-4 flex items-center",children:[r("input",{class:"checked:bg-blue-600 checked:border-transparent checked:bg-no-repeat checked:bg-[url('/tick.svg')] outline-none focus:outline-offset-2 focus:ring-blue-600 focus:ring-offset-2 focus:ring-offset-white p-0 inline-block align-middle box-border select-none shrink-0 shadow h-5 w-5 appearance-none rounded bg-white border-none",type:"checkbox",name:"create_profile",checked:f,onInput:this.onInput.bind(this)}),r("span",{class:"ml-4 text-data text-base font-medium",children:"Create account"})]}),r("button",{type:"submit",class:"text-white font-bold text-lg logo-bg rounded-xl py-2 px-10 shadow transform transition-transform ease-in-out duration-300 hover:scale-105 w-1/2 self-center",children:i==="login"?"Login":"Register"})]})]})]})]})}}p.contextType=k;var $=I(p);export{$ as default};
diff --git a/pr-121/assets/index.311ea642.css b/pr-121/assets/index.311ea642.css
@@ -1 +0,0 @@
-*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji"}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-size:100%;line-height:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,[type=button],[type=reset],[type=submit]{-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input:-ms-input-placeholder,textarea:-ms-input-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]{display:none}*,:before,:after{--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }.static{position:static}.absolute{position:absolute}.m-12{margin:3rem}.mx-6{margin-left:1.5rem;margin-right:1.5rem}.mt-6{margin-top:1.5rem}.mt-8{margin-top:2rem}.ml-4{margin-left:1rem}.mt-4{margin-top:1rem}.mr-4{margin-right:1rem}.mr-2{margin-right:.5rem}.mb-4{margin-bottom:1rem}.mb-8{margin-bottom:2rem}.box-border{box-sizing:border-box}.inline-block{display:inline-block}.flex{display:flex}.contents{display:contents}.hidden{display:none}.h-11{height:2.75rem}.h-5{height:1.25rem}.w-80{width:20rem}.w-full{width:100%}.w-11{width:2.75rem}.w-1\/4{width:25%}.w-5{width:1.25rem}.w-1\/2{width:50%}.shrink-0{flex-shrink:0}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.select-none{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.resize{resize:both}.appearance-none{-webkit-appearance:none;-moz-appearance:none;appearance:none}.flex-col{flex-direction:column}.items-start{align-items:flex-start}.items-center{align-items:center}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.divide-x>:not([hidden])~:not([hidden]){--tw-divide-x-reverse: 0;border-right-width:calc(1px * var(--tw-divide-x-reverse));border-left-width:calc(1px * calc(1 - var(--tw-divide-x-reverse)))}.divide-gray-200>:not([hidden])~:not([hidden]){--tw-divide-opacity: 1;border-color:rgb(229 231 235 / var(--tw-divide-opacity))}.self-center{align-self:center}.rounded-2xl{border-radius:1rem}.rounded-3xl{border-radius:1.5rem}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:.5rem}.rounded{border-radius:.25rem}.rounded-xl{border-radius:.75rem}.rounded-l-lg{border-top-left-radius:.5rem;border-bottom-left-radius:.5rem}.rounded-r-lg{border-top-right-radius:.5rem;border-bottom-right-radius:.5rem}.border-0{border-width:0px}.border-2{border-width:2px}.border-none{border-style:none}.border-\[\#AAB3CF\]{--tw-border-opacity: 1;border-color:rgb(170 179 207 / var(--tw-border-opacity))}.bg-gray-100{--tw-bg-opacity: 1;background-color:rgb(243 244 246 / var(--tw-bg-opacity))}.bg-white{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity))}.object-cover{-o-object-fit:cover;object-fit:cover}.p-4{padding:1rem}.p-0{padding:0}.py-3{padding-top:.75rem;padding-bottom:.75rem}.px-4{padding-left:1rem;padding-right:1rem}.px-12{padding-left:3rem;padding-right:3rem}.py-4{padding-top:1rem;padding-bottom:1rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.px-10{padding-left:2.5rem;padding-right:2.5rem}.pl-10{padding-left:2.5rem}.text-center{text-align:center}.align-middle{vertical-align:middle}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-3xl{font-size:1.875rem;line-height:2.25rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-base{font-size:1rem;line-height:1.5rem}.font-bold{font-weight:700}.font-medium{font-weight:500}.text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.text-gray-900{--tw-text-opacity: 1;color:rgb(17 24 39 / var(--tw-text-opacity))}.text-gray-500{--tw-text-opacity: 1;color:rgb(107 114 128 / var(--tw-text-opacity))}.shadow{--tw-shadow: 0 1px 3px 0 rgb(0 0 0 / .1), 0 1px 2px -1px rgb(0 0 0 / .1);--tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.outline-none{outline:2px solid transparent;outline-offset:2px}.transition-transform{transition-property:transform;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.duration-300{transition-duration:.3s}.ease-in-out{transition-timing-function:cubic-bezier(.4,0,.2,1)}@supports not (font-variation-settings: normal){@font-face{font-family:Inter;font-style:normal;font-weight:100;font-display:optional;src:url(/pr-121/fonts/Inter-Thin.woff2) format("woff2")}@font-face{font-family:Inter;font-style:normal;font-weight:200;font-display:optional;src:url(/pr-121/fonts/Inter-ExtraLight.woff2) format("woff2")}@font-face{font-family:Inter;font-style:normal;font-weight:300;font-display:optional;src:url(/pr-121/fonts/Inter-Light.woff2) format("woff2")}@font-face{font-family:Inter;font-style:normal;font-weight:400;font-display:optional;src:url(/pr-121/fonts/Inter-Regular.woff2) format("woff2")}@font-face{font-family:Inter;font-style:normal;font-weight:500;font-display:optional;src:url(/pr-121/fonts/Inter-Medium.woff2) format("woff2")}@font-face{font-family:Inter;font-style:normal;font-weight:600;font-display:optional;src:url(/pr-121/fonts/Inter-SemiBold.woff2) format("woff2")}@font-face{font-family:Inter;font-style:normal;font-weight:700;font-display:optional;src:url(/pr-121/fonts/Inter-Bold.woff2) format("woff2")}@font-face{font-family:Inter;font-style:normal;font-weight:800;font-display:optional;src:url(/pr-121/fonts/Inter-ExtraBold.woff2) format("woff2")}@font-face{font-family:Inter;font-style:normal;font-weight:900;font-display:optional;src:url(/pr-121/fonts/Inter-Black.woff2) format("woff2")}}@supports (font-variation-settings: normal){@font-face{font-family:Inter;font-style:normal;font-weight:100 900;font-display:optional;src:url(/pr-121/fonts/Inter-VariableFont_slnt,wght.woff2) format("woff2 supports variations"),url(/pr-121/fonts/Inter-VariableFont_slnt,wght.woff2) format("woff2-variations")}}html,body,#app{margin:0;height:100%}body{background-color:#424555}.logo-bg{background:linear-gradient(90deg,#751796 -58.41%,#FE7223 152.47%)}.search-bg{background:linear-gradient(90deg,rgba(196,196,196,.11) -33.43%,rgba(196,196,196,.07) 184.14%)}.text-data{color:#aab3cf}.placeholder-data::-moz-placeholder{color:#aab3cf}.placeholder-data:-ms-input-placeholder{color:#aab3cf}.placeholder-data::placeholder{color:#aab3cf}.checked\:border-transparent:checked{border-color:transparent}.checked\:bg-blue-600:checked{--tw-bg-opacity: 1;background-color:rgb(37 99 235 / var(--tw-bg-opacity))}.checked\:bg-\[url\(\'\/tick\.svg\'\)\]:checked{background-image:url(/pr-121/tick.svg)}.checked\:bg-no-repeat:checked{background-repeat:no-repeat}.hover\:scale-105:hover{--tw-scale-x: 1.05;--tw-scale-y: 1.05;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.hover\:bg-gray-50:hover{--tw-bg-opacity: 1;background-color:rgb(249 250 251 / var(--tw-bg-opacity))}.hover\:text-gray-700:hover{--tw-text-opacity: 1;color:rgb(55 65 81 / var(--tw-text-opacity))}.hover\:ring-1:hover{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.hover\:ring-blue-300:hover{--tw-ring-opacity: 1;--tw-ring-color: rgb(147 197 253 / var(--tw-ring-opacity))}.focus\:outline-none:focus{outline:2px solid transparent;outline-offset:2px}.focus\:outline-offset-2:focus{outline-offset:2px}.focus\:ring-transparent:focus{--tw-ring-color: transparent}.focus\:ring-blue-600:focus{--tw-ring-opacity: 1;--tw-ring-color: rgb(37 99 235 / var(--tw-ring-opacity))}.focus\:ring-offset-2:focus{--tw-ring-offset-width: 2px}.focus\:ring-offset-white:focus{--tw-ring-offset-color: #fff}@media (prefers-color-scheme: dark){.dark\:divide-gray-700>:not([hidden])~:not([hidden]){--tw-divide-opacity: 1;border-color:rgb(55 65 81 / var(--tw-divide-opacity))}.dark\:bg-gray-700{--tw-bg-opacity: 1;background-color:rgb(55 65 81 / var(--tw-bg-opacity))}.dark\:bg-gray-800{--tw-bg-opacity: 1;background-color:rgb(31 41 55 / var(--tw-bg-opacity))}.dark\:text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.dark\:text-gray-400{--tw-text-opacity: 1;color:rgb(156 163 175 / var(--tw-text-opacity))}.dark\:hover\:bg-gray-700:hover{--tw-bg-opacity: 1;background-color:rgb(55 65 81 / var(--tw-bg-opacity))}.dark\:hover\:text-white:hover{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}}@media (min-width: 640px){.sm\:mt-0{margin-top:0}.sm\:flex{display:flex}.sm\:flex-row{flex-direction:row}}@media (min-width: 1024px){.lg\:mt-0{margin-top:0}.lg\:flex-row{flex-direction:row}}
diff --git a/pr-121/assets/index.7100b17a.js b/pr-121/assets/index.7100b17a.js
@@ -0,0 +1 @@
+var L=Object.defineProperty;var j=(c,e,n)=>e in c?L(c,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):c[e]=n;var d=(c,e,n)=>(j(c,typeof e!="symbol"?e+"":e,n),n);import{B as z,w as D,o as t,L as _,P as k,l as a,b as s,W as S,M as b,D as R,a as F,c as U,O as W,d as G,e as X,R as Q,f as C,g as V,h as Y,i as J}from"./vendor.8ab614fa.js";const Z=function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))o(i);new MutationObserver(i=>{for(const l of i)if(l.type==="childList")for(const r of l.addedNodes)r.tagName==="LINK"&&r.rel==="modulepreload"&&o(r)}).observe(document,{childList:!0,subtree:!0});function n(i){const l={};return i.integrity&&(l.integrity=i.integrity),i.referrerpolicy&&(l.referrerPolicy=i.referrerpolicy),i.crossorigin==="use-credentials"?l.credentials="include":i.crossorigin==="anonymous"?l.credentials="omit":l.credentials="same-origin",l}function o(i){if(i.ep)return;i.ep=!0;const l=n(i);fetch(i.href,l)}};Z();const q="modulepreload",T={},$="/pr-121/",K=function(e,n){return!n||n.length===0?e():Promise.all(n.map(o=>{if(o=`${$}${o}`,o in T)return;T[o]=!0;const i=o.endsWith(".css"),l=i?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${o}"]${l}`))return;const r=document.createElement("link");if(r.rel=i?"stylesheet":q,i||(r.as="script",r.crossOrigin=""),r.href=o,document.head.appendChild(r),i)return new Promise((m,h)=>{r.addEventListener("load",m),r.addEventListener("error",()=>h(new Error(`Unable to preload CSS for ${o}`)))})})).then(()=>e())},N=z(void 0);class I extends D{render(){const e=this.context;return t("div",{class:"m-12 flex flex-col lg:flex-row items-center justify-between",children:[t(_,{to:"/",children:t("img",{alt:"Matrix Art",src:"Logo_colored.svg",class:"ease-in-out hover:scale-105 trandform transition-transform duration-300"})}),t("div",{class:"flex items-center mt-8 lg:mt-0 flex-col sm:flex-row",children:[t("div",{class:"flex items-center justify-between w-80 max-w-80 mx-6 ease-in-out hover:scale-105 trandform transition-transform duration-300",children:[t("div",{class:"absolute ml-4",children:t("svg",{xmlns:"http://www.w3.org/2000/svg",height:"24px",viewBox:"0 0 24 24",width:"24px",fill:"#AAB3CF",children:[t("path",{d:"M0 0h24v24H0V0z",fill:"none"}),t("path",{d:"M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z"})]})}),t("input",{class:"search-bg shadow rounded-2xl border-0 py-3 px-4 pl-10 text-data",placeholder:"Search"})]}),e!=null&&e.isLoggedIn()?t(_,{to:"/",class:"text-white font-bold text-1xl logo-bg rounded-2xl py-3 px-12 shadow mt-4 sm:mt-0 transform transition-transform ease-in-out duration-300 hover:scale-105",children:"Post"}):t(_,{to:"/join",class:"text-white font-bold text-1xl logo-bg rounded-2xl py-3 px-12 shadow mt-4 sm:mt-0 transform transition-transform ease-in-out duration-300 hover:scale-105",children:"Join"})]})]})}}I.contextType=N;class g extends D{constructor(e){super(e)}render({user:e,post:n}){return t("div",{class:"flex flex-col",children:[t("a",{id:"gallery_click",href:n.content.file.url,class:"w-full",target:"_blank",rel:"noreferrer",children:t("img",{decoding:"async",loading:"lazy",class:"rounded-3xl shadow object-cover transform transition-transform ease-in-out duration-300 hover:scale-105",src:n.content.file.url})}),t("div",{class:"flex items-center justify-between py-4",children:[t("a",{class:"flex items-center",href:"#",children:[t("img",{class:"w-11 h-11 rounded-full mr-4 border-2 border-[#AAB3CF]",src:e.avatar_url}),t("p",{class:"text-data shadow text-lg font-medium",children:e.display_name})]}),t("div",{class:"flex text-data text-lg items-center",children:[t("a",{class:"mr-4 flex items-center",href:"#",children:[t("span",{class:"mr-2",children:t("svg",{xmlns:"http://www.w3.org/2000/svg",height:"24px",viewBox:"0 0 24 24",width:"24px",fill:"#AAB3CF",children:[t("path",{d:"M0 0h24v24H0V0z",fill:"none"}),t("path",{d:"M16.5 3c-1.74 0-3.41.81-4.5 2.09C10.91 3.81 9.24 3 7.5 3 4.42 3 2 5.42 2 8.5c0 3.78 3.4 6.86 8.55 11.54L12 21.35l1.45-1.32C18.6 15.36 22 12.28 22 8.5 22 5.42 19.58 3 16.5 3zm-4.4 15.55l-.1.1-.1-.1C7.14 14.24 4 11.39 4 8.5 4 6.5 5.5 5 7.5 5c1.54 0 3.04.99 3.57 2.36h1.87C13.46 5.99 14.96 5 16.5 5c2 0 3.5 1.5 3.5 3.5 0 2.89-3.14 5.74-7.9 10.05z"})]})}),t("span",{children:"5"})]}),t("a",{class:"flex items-center",href:"#",children:[t("span",{class:"mr-2",children:t("svg",{xmlns:"http://www.w3.org/2000/svg",height:"24px",viewBox:"0 0 24 24",width:"24px",fill:"#AAB3CF",children:[t("path",{d:"M0 0h24v24H0V0z",fill:"none"}),t("path",{d:"M20 2H4c-1.1 0-2 .9-2 2v18l4-4h14c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm0 14H6l-2 2V4h16v12z"})]})}),t("span",{children:"11"})]})]})]})]})}}class p{constructor(e,n,o){d(this,"mxid");d(this,"display_name");d(this,"avatar_url");this.mxid=e,this.display_name=n,this.avatar_url=o}}class y{constructor(e,n){d(this,"event_id");d(this,"content");this.event_id=e,this.content=n}}class ee extends D{constructor(){super(),this.state={columns:this.settingColumns()}}settingColumns(){return window.innerWidth>=1400?4:window.innerWidth>=800?3:window.innerWidth>=500?2:1}componentDidMount(){window.addEventListener("resize",()=>this.setState({columns:this.settingColumns()}))}componentWillUnmount(){window.removeEventListener("resize",()=>this.setState({columns:this.settingColumns()}))}render(){return t("div",{class:"flex flex-col",children:[t("header",{children:t(I,{})}),t("main",{class:"m-12 mt-6",children:[t("h1",{class:"text-3xl font-bold mb-4 text-white",children:"Explore"}),t("div",{class:"flex justify-center",id:"gallery",children:t(k,{gap:24,nColumns:this.state.columns,children:[t(g,{user:new p("","Person A","https://unsplash.com/photos/_cvwXhGqG-o/download?ixid=MnwxMjA3fDB8MXxzZWFyY2h8OHx8ZmFjZXxlbnwwfDJ8fHwxNjQ4Nzc5NzYx"),post:new y("",{file:{url:"https://unsplash.com/photos/UWmrTAQ75iA/download?ixid=MnwxMjA3fDB8MXxhbGx8Mnx8fHx8fDJ8fDE2NDg4MzI0Njg"}})}),t(g,{user:new p("","Person B","https://unsplash.com/photos/uJ8LNVCBjFQ/download?ixid=MnwxMjA3fDB8MXxzZWFyY2h8MTN8fGZhY2V8ZW58MHwyfHx8MTY0ODc3OTc2MQ"),post:new y("",{file:{url:"https://unsplash.com/photos/7ptbiEPxKMQ/download?ixid=MnwxMjA3fDB8MXxhbGx8OXx8fHx8fDJ8fDE2NDg4MzI0Njg"}})}),t(g,{user:new p("","Person C","https://unsplash.com/photos/u3pi6HhSYew/download?ixid=MnwxMjA3fDB8MXxzZWFyY2h8MTd8fGZhY2V8ZW58MHwyfHx8MTY0ODc3OTc2MQ"),post:new y("",{file:{url:"https://unsplash.com/photos/ZiPlVmmKEYA/download?ixid=MnwxMjA3fDB8MXxhbGx8Mzl8fHx8fHwyfHwxNjQ4ODM2MDIz"}})}),t(g,{user:new p("","Person D","https://unsplash.com/photos/TW_z_iUD_bQ/download?ixid=MnwxMjA3fDB8MXxzZWFyY2h8ODR8fHBvcnRyYWl0fGVufDB8Mnx8fDE2NDg4NDQ3MjQ"),post:new y("",{file:{url:"https://unsplash.com/photos/FTQJBGDxKXg/download?ixid=MnwxMjA3fDB8MXxhbGx8M3x8fHx8fDJ8fDE2NDg4NDMyNDY"}})}),t(g,{user:new p("","Person E","https://unsplash.com/photos/kYtN89E5ce4/download?ixid=MnwxMjA3fDB8MXxzZWFyY2h8MTA0fHxwb3J0cmFpdHxlbnwwfDJ8fHwxNjQ4ODQ0NzQy"),post:new y("",{file:{url:"https://unsplash.com/photos/zfhxiaZO3JE/download?ixid=MnwxMjA3fDB8MXxhbGx8Mjl8fHx8fHwyfHwxNjQ4ODQzMjQ1"}})}),t(g,{user:new p("","Person E","https://unsplash.com/photos/kBonaevi3yA/download?ixid=MnwxMjA3fDB8MXxzZWFyY2h8MTE5fHxwb3J0cmFpdHxlbnwwfDJ8fHwxNjQ4ODQ0NzQy"),post:new y("",{file:{url:"https://unsplash.com/photos/jm-JKqrAXsA/download?ixid=MnwxMjA3fDB8MXxhbGx8MTAyfHx8fHx8Mnx8MTY0ODg0MzI1NQ"}})})]})})]})]})}}const v=new a.UnstableValue("m.image","org.matrix.msc1767.image"),B=new a.UnstableValue("m.file","org.matrix.msc1767.file"),P=new a.UnstableValue("m.thumbnail","org.matrix.msc1767.thumbnail"),O=new a.UnstableValue("blurhash","xyz.amorgan.blurhash"),te=new a.NamespacedValue("matrixart.description"),ne=new a.NamespacedValue("matrixart.tags"),ie=new a.NamespacedValue("matrixart.nsfw"),oe=new a.NamespacedValue("matrixart.license");class re extends a.ExtensibleEvent{constructor(n){super(n);d(this,"image");d(this,"text");d(this,"thumbnails");d(this,"blurhash");d(this,"file");d(this,"description");d(this,"tags");d(this,"nsfw",!1);d(this,"license");const o=v.findIn(this.wireContent),i=a.M_TEXT.findIn(this.wireContent),l=B.findIn(this.wireContent),r=P.findIn(this.wireContent),m=O.findIn(this.wireContent),h=te.findIn(this.wireContent),x=ne.findIn(this.wireContent),w=ie.findIn(this.wireContent),u=oe.findIn(this.wireContent);if(a.isProvided(o)){if(!o)throw new a.InvalidEventError("m.image is required to be present");this.image=o}if(a.isProvided(l)){if(!l)throw new a.InvalidEventError("m.file is required to be present");this.file=l}if(a.isOptionalAString(i)){if(!o)throw new a.InvalidEventError("m.text is required to be present");this.text=i}if(a.isProvided(r)){if(!Array.isArray(r))throw new a.InvalidEventError("m.thumbnail contents must be an array");this.thumbnails=r}if(a.isOptionalAString(m)&&(this.blurhash=m),a.isOptionalAString(h)&&(this.description=h),a.isProvided(x)){if(!Array.isArray(x))throw new a.InvalidEventError("matrixart.tags contents must be an array");this.tags=x}if(a.isProvided(w)){if(typeof w!="boolean")throw new a.InvalidEventError("matrixart.tags contents must be an boolean");this.nsfw=w}a.isOptionalAString(u)&&(this.license=u)}isEquivalentTo(n){return a.isEventTypeSame(n,v)}serialize(){const n={[a.M_TEXT.name]:this.text,[B.name]:this.file,[v.name]:this.image,[P.name]:this.thumbnails,[O.name]:this.blurhash,["matrixart.description"]:this.description,["matrixart.tags"]:this.tags,["matrixart.nsfw"]:this.nsfw,["matrixart.license"]:this.license};return{type:"m.image",content:n}}}function se(c){const e=c;return new re(e)}a.ExtensibleEvents.registerInterpreter(v,se);a.ExtensibleEvents.unknownInterpretOrder.push(v);function M(){return new Worker("/pr-121/assets/indexeddb.worker.c669c402.js",{type:"module"})}class E{constructor(e){d(this,"events",[]);d(this,"currentUserDirectory");d(this,"rootDirectory");this.client=e}static async new(){var i,l,r,m,h,x;global.Olm||console.error("global.Olm does not seem to be present. Did you forget to add olm in the out directory?");let e;if(window.localStorage.getItem("server")!==null?e=window.localStorage.getItem("server"):e="https://matrix.art.midnightthoughts.space",!e)throw new Error("No matrix server URL defined");let n;if(window.localStorage.getItem("mxid_guest")!==null){const w=(i=window.localStorage.getItem("mxid_guest"))!=null?i:void 0,u=(l=window.localStorage.getItem("access_token_guest"))!=null?l:void 0,f=(r=window.localStorage.getItem("device_id_guest"))!=null?r:void 0;n=s.createClient({useAuthorizationHeader:!0,baseUrl:e,userId:w,accessToken:u,deviceId:f,sessionStore:new S(window.localStorage),store:new s.IndexedDBStore({indexedDB:window.indexedDB,dbName:"matrix-art-sync:guest",localStorage:window.localStorage,workerFactory:()=>new M}),cryptoStore:new s.IndexedDBCryptoStore(window.indexedDB,"matrix-art:crypto")}),n.setGuest(!0)}{const w=s.createClient("https://matrix.art.midnightthoughts.space"),{user_id:u,device_id:f,access_token:A}=await w.registerGuest();n=s.createClient({useAuthorizationHeader:!0,baseUrl:e,userId:u,accessToken:A,deviceId:f,sessionStore:new S(window.localStorage),store:new s.IndexedDBStore({indexedDB:window.indexedDB,dbName:"matrix-art-sync:guest",localStorage:window.localStorage,workerFactory:()=>new M}),cryptoStore:new s.IndexedDBCryptoStore(window.indexedDB,"matrix-art:crypto")}),n.setGuest(!0),window.localStorage.setItem("mxid_guest",u),window.localStorage.setItem("access_token_guest",A),window.localStorage.setItem("device_id_guest",f),window.localStorage.setItem("server",e)}let o;if(window.localStorage.getItem("mxid")!==null){const w=(m=window.localStorage.getItem("mxid"))!=null?m:void 0,u=(h=window.localStorage.getItem("access_token"))!=null?h:void 0,f=(x=window.localStorage.getItem("device_id"))!=null?x:void 0;o=s.createClient({useAuthorizationHeader:!0,baseUrl:e,userId:w,accessToken:u,deviceId:f,sessionStore:new S(window.localStorage),store:new s.IndexedDBStore({indexedDB:window.indexedDB,dbName:"matrix-art-sync:guest",localStorage:window.localStorage,workerFactory:()=>new M}),cryptoStore:new s.IndexedDBCryptoStore(window.indexedDB,"matrix-art:crypto")}),o.setGuest(!1)}return new E(o!=null?o:n)}isLoggedIn(){return this.client.isLoggedIn()&&!this.client.isGuest()}async start(){this.client.on(s.MatrixEventEvent.Decrypted,(n,o)=>{const i=n.unstableExtensibleEvent;i!=null&&i.isEquivalentTo(v)&&this.events.push(n)}),console.log("start"),await this.client.store.startup(),await this.client.initCrypto(),await this.client.startClient();const e=await this.client.joinRoom("#Matrix_Art:art.midnightthoughts.space");await H(1e3),this.rootDirectory=new b(this.client,e.roomId),console.log("started")}async register(e="https://matrix.art.midnightthoughts.space",n,o,i=!1){var l;if(this.client.stopClient(),this.client=s.createClient({useAuthorizationHeader:!0,baseUrl:e,userId:n,deviceId:"Matrix Art",sessionStore:new S(window.localStorage),store:new s.IndexedDBStore({indexedDB:window.indexedDB,dbName:"matrix-art-sync:loggedin",localStorage:window.localStorage,workerFactory:()=>new M}),cryptoStore:new s.IndexedDBCryptoStore(window.indexedDB,"matrix-art:crypto")}),await this.client.register(n,o,null,{type:"m.login.dummy"}),window.localStorage.setItem("server",e),window.localStorage.setItem("mxid",n),window.localStorage.setItem("access_token",this.client.getAccessToken()),window.localStorage.setItem("device_id","Matrix Art"),await this.start(),i){const r=(l=this.rootDirectory)==null?void 0:l.getDirectories(),m=this.client.getUserId().replace(":","_");r!=null&&r.some(h=>h.room.name===m)?this.rootDirectory=r==null?void 0:r.find(h=>h.room.name===m):await this.createProfileFolder()}}async login(e,n,o,i=!1){var l;if(this.client.stopClient(),this.client=s.createClient({useAuthorizationHeader:!0,baseUrl:e,userId:n,deviceId:"Matrix Art",sessionStore:new S(window.localStorage),store:new s.IndexedDBStore({indexedDB:window.indexedDB,dbName:"matrix-art-sync:loggedin",localStorage:window.localStorage,workerFactory:()=>new M}),cryptoStore:new s.IndexedDBCryptoStore(window.indexedDB,"matrix-art:crypto")}),await this.client.loginWithPassword(n,o),window.localStorage.setItem("server",e),window.localStorage.setItem("mxid",n),window.localStorage.setItem("access_token",this.client.getAccessToken()),window.localStorage.setItem("device_id","Matrix Art"),await this.start(),i){const r=(l=this.rootDirectory)==null?void 0:l.getDirectories();console.log(r);const m=this.client.getUserId().replace(":","_");r!=null&&r.some(h=>h.room.name===m)?this.rootDirectory=r==null?void 0:r.find(h=>h.room.name===m):await this.createProfileFolder()}}async createProfileFolder(){if(this.client.isGuest())throw new Error("Cannot create a file tree space as a guest");const e=await this.client.joinRoom("#Matrix_Art:art.midnightthoughts.space");await H(1e3),this.rootDirectory=new b(this.client,e.roomId);const n=this.client.getUserId().replace(":","_");this.currentUserDirectory=await this.createPublicSubDirectory(this.rootDirectory,n),await this.createPublicSubDirectory(this.currentUserDirectory,"Timeline")}async createPublicFileTree(e){if(this.client.isGuest())throw new Error("Cannot create a file tree space as a guest");const{room_id:n}=await this.client.createRoom({name:e,preset:s.Preset.PublicChat,power_level_content_override:{...R,users:{["@administrator:art.midnightthoughts.space"]:100,[this.client.getUserId()]:100}},invite:["@administrator:art.midnightthoughts.space"],creation_content:{[s.RoomCreateTypeField]:s.RoomType.Space},initial_state:[{type:s.UNSTABLE_MSC3088_PURPOSE.name,state_key:s.UNSTABLE_MSC3089_TREE_SUBTYPE.name,content:{[s.UNSTABLE_MSC3088_ENABLED.name]:!0}},{type:s.EventType.RoomEncryption,state_key:"",content:{algorithm:F}},{type:s.EventType.RoomGuestAccess,state_key:"",content:{guest_access:"can_join"}},{type:s.EventType.RoomHistoryVisibility,state_key:"",content:{history_visibility:"world_readable"}}]}),o=this.client.getRoom(n),i=o==null?void 0:o.getLiveTimeline().getState(s.EventTimeline.FORWARDS).getStateEvents(s.EventType.RoomPowerLevels,"");if(!i)throw new Error("Failed to find PL event");return await this.client.setPowerLevel(n,this.client.getUserId(),50,i),new b(this.client,n)}async createPublicSubDirectory(e,n){const o=await this.createPublicFileTree(n);return await this.client.sendStateEvent(e.roomId,s.EventType.SpaceChild,{via:[this.client.getDomain()]},o.roomId),await this.client.sendStateEvent(o.roomId,s.EventType.SpaceParent,{via:[this.client.getDomain()]},e.roomId),o}}function H(c){return new Promise(e=>setTimeout(e,c))}const ae=U(()=>K(()=>import("./Join.95fe70ce.js"),["assets/Join.95fe70ce.js","assets/vendor.8ab614fa.js"]));class le extends D{constructor(){super(),this.state={client:void 0}}loadOlm(){return W.init({locateFile:()=>G}).then(()=>{console.log("Using WebAssembly Olm")}).catch(e=>(console.log("Failed to load Olm: trying legacy version",e),new Promise((n,o)=>{const i=document.createElement("script");i.src=X,i.onload=n,i.onerror=o,document.body.appendChild(i)}).then(()=>window.Olm.init()).then(()=>{console.log("Using legacy Olm")}).catch(n=>{console.log("Both WebAssembly and asm.js Olm failed!",n)})))}async loadMatrixClient(){var n;let e=await E.new();this.setState({client:e}),console.log("Client loaded"),await((n=this.state.client)==null?void 0:n.start()),console.log("Client started")}async componentDidMount(){try{await this.loadOlm(),console.log("Olm loaded")}catch{console.log("Olm not loaded")}await this.loadMatrixClient()}render(){return t(N.Provider,{value:this.state.client,children:t(Q,{children:[t(C,{path:"/",element:t(ee,{})}),t(C,{path:"join",element:t(V,{fallback:t("div",{class:"flex flex-col",children:[t("header",{children:t(I,{})}),t("main",{class:"m-12 mt-6 flex items-center justify-center",children:t("p",{class:"text-lg text-data font-bold",children:"Loading..."})})]}),children:t(ae,{})})})]})})}}Y(t(J,{basename:"/pr-121/",children:t(le,{})}),document.querySelector("#app"));export{N as C,I as H};
diff --git a/pr-121/assets/index.8bf9a4af.css b/pr-121/assets/index.8bf9a4af.css
@@ -0,0 +1 @@
+*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-feature-settings:normal}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-size:100%;font-weight:inherit;line-height:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,[type=button],[type=reset],[type=submit]{-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]{display:none}*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }.static{position:static}.absolute{position:absolute}.m-12{margin:3rem}.mx-6{margin-left:1.5rem;margin-right:1.5rem}.mt-6{margin-top:1.5rem}.mt-8{margin-top:2rem}.ml-4{margin-left:1rem}.mt-4{margin-top:1rem}.mr-4{margin-right:1rem}.mr-2{margin-right:.5rem}.mb-4{margin-bottom:1rem}.mb-8{margin-bottom:2rem}.box-border{box-sizing:border-box}.inline-block{display:inline-block}.flex{display:flex}.contents{display:contents}.hidden{display:none}.h-11{height:2.75rem}.h-5{height:1.25rem}.w-80{width:20rem}.w-full{width:100%}.w-11{width:2.75rem}.w-1\/4{width:25%}.w-5{width:1.25rem}.w-1\/2{width:50%}.shrink-0{flex-shrink:0}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.select-none{-webkit-user-select:none;-moz-user-select:none;user-select:none}.resize{resize:both}.appearance-none{-webkit-appearance:none;-moz-appearance:none;appearance:none}.flex-col{flex-direction:column}.items-start{align-items:flex-start}.items-center{align-items:center}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.divide-x>:not([hidden])~:not([hidden]){--tw-divide-x-reverse: 0;border-right-width:calc(1px * var(--tw-divide-x-reverse));border-left-width:calc(1px * calc(1 - var(--tw-divide-x-reverse)))}.divide-gray-200>:not([hidden])~:not([hidden]){--tw-divide-opacity: 1;border-color:rgb(229 231 235 / var(--tw-divide-opacity))}.self-center{align-self:center}.rounded-2xl{border-radius:1rem}.rounded-3xl{border-radius:1.5rem}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:.5rem}.rounded{border-radius:.25rem}.rounded-xl{border-radius:.75rem}.rounded-l-lg{border-top-left-radius:.5rem;border-bottom-left-radius:.5rem}.rounded-r-lg{border-top-right-radius:.5rem;border-bottom-right-radius:.5rem}.border-0{border-width:0px}.border-2{border-width:2px}.border-none{border-style:none}.border-\[\#AAB3CF\]{--tw-border-opacity: 1;border-color:rgb(170 179 207 / var(--tw-border-opacity))}.bg-gray-100{--tw-bg-opacity: 1;background-color:rgb(243 244 246 / var(--tw-bg-opacity))}.bg-white{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity))}.object-cover{-o-object-fit:cover;object-fit:cover}.p-4{padding:1rem}.p-0{padding:0}.py-3{padding-top:.75rem;padding-bottom:.75rem}.px-4{padding-left:1rem;padding-right:1rem}.px-12{padding-left:3rem;padding-right:3rem}.py-4{padding-top:1rem;padding-bottom:1rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.px-10{padding-left:2.5rem;padding-right:2.5rem}.pl-10{padding-left:2.5rem}.text-center{text-align:center}.align-middle{vertical-align:middle}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-3xl{font-size:1.875rem;line-height:2.25rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-base{font-size:1rem;line-height:1.5rem}.font-bold{font-weight:700}.font-medium{font-weight:500}.text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.text-gray-900{--tw-text-opacity: 1;color:rgb(17 24 39 / var(--tw-text-opacity))}.text-gray-500{--tw-text-opacity: 1;color:rgb(107 114 128 / var(--tw-text-opacity))}.shadow{--tw-shadow: 0 1px 3px 0 rgb(0 0 0 / .1), 0 1px 2px -1px rgb(0 0 0 / .1);--tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.outline-none{outline:2px solid transparent;outline-offset:2px}.transition-transform{transition-property:transform;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.duration-300{transition-duration:.3s}.ease-in-out{transition-timing-function:cubic-bezier(.4,0,.2,1)}@supports not (font-variation-settings: normal){@font-face{font-family:Inter;font-style:normal;font-weight:100;font-display:optional;src:url(/pr-121/fonts/Inter-Thin.woff2) format("woff2")}@font-face{font-family:Inter;font-style:normal;font-weight:200;font-display:optional;src:url(/pr-121/fonts/Inter-ExtraLight.woff2) format("woff2")}@font-face{font-family:Inter;font-style:normal;font-weight:300;font-display:optional;src:url(/pr-121/fonts/Inter-Light.woff2) format("woff2")}@font-face{font-family:Inter;font-style:normal;font-weight:400;font-display:optional;src:url(/pr-121/fonts/Inter-Regular.woff2) format("woff2")}@font-face{font-family:Inter;font-style:normal;font-weight:500;font-display:optional;src:url(/pr-121/fonts/Inter-Medium.woff2) format("woff2")}@font-face{font-family:Inter;font-style:normal;font-weight:600;font-display:optional;src:url(/pr-121/fonts/Inter-SemiBold.woff2) format("woff2")}@font-face{font-family:Inter;font-style:normal;font-weight:700;font-display:optional;src:url(/pr-121/fonts/Inter-Bold.woff2) format("woff2")}@font-face{font-family:Inter;font-style:normal;font-weight:800;font-display:optional;src:url(/pr-121/fonts/Inter-ExtraBold.woff2) format("woff2")}@font-face{font-family:Inter;font-style:normal;font-weight:900;font-display:optional;src:url(/pr-121/fonts/Inter-Black.woff2) format("woff2")}}@supports (font-variation-settings: normal){@font-face{font-family:Inter;font-style:normal;font-weight:100 900;font-display:optional;src:url(/pr-121/fonts/Inter-VariableFont_slnt,wght.woff2) format("woff2 supports variations"),url(/pr-121/fonts/Inter-VariableFont_slnt,wght.woff2) format("woff2-variations")}}html,body,#app{margin:0;height:100%}body{background-color:#424555}.logo-bg{background:linear-gradient(90deg,#751796 -58.41%,#FE7223 152.47%)}.search-bg{background:linear-gradient(90deg,rgba(196,196,196,.11) -33.43%,rgba(196,196,196,.07) 184.14%)}.text-data{color:#aab3cf}.placeholder-data::-moz-placeholder{color:#aab3cf}.placeholder-data::placeholder{color:#aab3cf}.checked\:border-transparent:checked{border-color:transparent}.checked\:bg-blue-600:checked{--tw-bg-opacity: 1;background-color:rgb(37 99 235 / var(--tw-bg-opacity))}.checked\:bg-\[url\(\'\/tick\.svg\'\)\]:checked{background-image:url(/pr-121/tick.svg)}.checked\:bg-no-repeat:checked{background-repeat:no-repeat}.hover\:scale-105:hover{--tw-scale-x: 1.05;--tw-scale-y: 1.05;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.hover\:bg-gray-50:hover{--tw-bg-opacity: 1;background-color:rgb(249 250 251 / var(--tw-bg-opacity))}.hover\:text-gray-700:hover{--tw-text-opacity: 1;color:rgb(55 65 81 / var(--tw-text-opacity))}.hover\:ring-1:hover{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.hover\:ring-blue-300:hover{--tw-ring-opacity: 1;--tw-ring-color: rgb(147 197 253 / var(--tw-ring-opacity))}.focus\:outline-none:focus{outline:2px solid transparent;outline-offset:2px}.focus\:outline-offset-2:focus{outline-offset:2px}.focus\:ring-transparent:focus{--tw-ring-color: transparent}.focus\:ring-blue-600:focus{--tw-ring-opacity: 1;--tw-ring-color: rgb(37 99 235 / var(--tw-ring-opacity))}.focus\:ring-offset-2:focus{--tw-ring-offset-width: 2px}.focus\:ring-offset-white:focus{--tw-ring-offset-color: #fff}@media (prefers-color-scheme: dark){.dark\:divide-gray-700>:not([hidden])~:not([hidden]){--tw-divide-opacity: 1;border-color:rgb(55 65 81 / var(--tw-divide-opacity))}.dark\:bg-gray-700{--tw-bg-opacity: 1;background-color:rgb(55 65 81 / var(--tw-bg-opacity))}.dark\:bg-gray-800{--tw-bg-opacity: 1;background-color:rgb(31 41 55 / var(--tw-bg-opacity))}.dark\:text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.dark\:text-gray-400{--tw-text-opacity: 1;color:rgb(156 163 175 / var(--tw-text-opacity))}.dark\:hover\:bg-gray-700:hover{--tw-bg-opacity: 1;background-color:rgb(55 65 81 / var(--tw-bg-opacity))}.dark\:hover\:text-white:hover{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}}@media (min-width: 640px){.sm\:mt-0{margin-top:0}.sm\:flex{display:flex}.sm\:flex-row{flex-direction:row}}@media (min-width: 1024px){.lg\:mt-0{margin-top:0}.lg\:flex-row{flex-direction:row}}
diff --git a/pr-121/assets/index.955c971f.js b/pr-121/assets/index.955c971f.js
@@ -1 +0,0 @@
-var F=Object.defineProperty,U=Object.defineProperties;var W=Object.getOwnPropertyDescriptors;var B=Object.getOwnPropertySymbols;var G=Object.prototype.hasOwnProperty,X=Object.prototype.propertyIsEnumerable;var b=(c,e,t)=>e in c?F(c,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):c[e]=t,P=(c,e)=>{for(var t in e||(e={}))G.call(e,t)&&b(c,t,e[t]);if(B)for(var t of B(e))X.call(e,t)&&b(c,t,e[t]);return c},j=(c,e)=>U(c,W(e));var d=(c,e,t)=>(b(c,typeof e!="symbol"?e+"":e,t),t);import{D as Q,j as V,a as Y,E as _,L as I,P as J,l as a,b as s,W as M,M as E,c as Z,d as q,O as $,o as K,e as ee,R as te,f as O,g as ne,F as ie,S as oe,B as re}from"./vendor.09079154.js";const se=function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const n of document.querySelectorAll('link[rel="modulepreload"]'))o(n);new MutationObserver(n=>{for(const l of n)if(l.type==="childList")for(const r of l.addedNodes)r.tagName==="LINK"&&r.rel==="modulepreload"&&o(r)}).observe(document,{childList:!0,subtree:!0});function t(n){const l={};return n.integrity&&(l.integrity=n.integrity),n.referrerpolicy&&(l.referrerPolicy=n.referrerpolicy),n.crossorigin==="use-credentials"?l.credentials="include":n.crossorigin==="anonymous"?l.credentials="omit":l.credentials="same-origin",l}function o(n){if(n.ep)return;n.ep=!0;const l=t(n);fetch(n.href,l)}};se();const ae="modulepreload",H={},le="/pr-121/",ce=function(e,t){return!t||t.length===0?e():Promise.all(t.map(o=>{if(o=`${le}${o}`,o in H)return;H[o]=!0;const n=o.endsWith(".css"),l=n?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${o}"]${l}`))return;const r=document.createElement("link");if(r.rel=n?"stylesheet":ae,n||(r.as="script",r.crossOrigin=""),r.href=o,document.head.appendChild(r),n)return new Promise((w,m)=>{r.addEventListener("load",w),r.addEventListener("error",()=>m(new Error(`Unable to preload CSS for ${o}`)))})})).then(()=>e())},R=Q(void 0),i=V,h=Y;class A extends _{render(){const e=this.context;return h("div",{class:"m-12 flex flex-col lg:flex-row items-center justify-between",children:[i(I,{to:"/",children:i("img",{alt:"Matrix Art",src:"Logo_colored.svg",class:"ease-in-out hover:scale-105 trandform transition-transform duration-300"})}),h("div",{class:"flex items-center mt-8 lg:mt-0 flex-col sm:flex-row",children:[h("div",{class:"flex items-center justify-between w-80 max-w-80 mx-6 ease-in-out hover:scale-105 trandform transition-transform duration-300",children:[i("div",{class:"absolute ml-4",children:h("svg",{xmlns:"http://www.w3.org/2000/svg",height:"24px",viewBox:"0 0 24 24",width:"24px",fill:"#AAB3CF",children:[i("path",{d:"M0 0h24v24H0V0z",fill:"none"}),i("path",{d:"M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z"})]})}),i("input",{class:"search-bg shadow rounded-2xl border-0 py-3 px-4 pl-10 text-data",placeholder:"Search"})]}),e!=null&&e.isLoggedIn()?i(I,{to:"/",class:"text-white font-bold text-1xl logo-bg rounded-2xl py-3 px-12 shadow mt-4 sm:mt-0 transform transition-transform ease-in-out duration-300 hover:scale-105",children:"Post"}):i(I,{to:"/join",class:"text-white font-bold text-1xl logo-bg rounded-2xl py-3 px-12 shadow mt-4 sm:mt-0 transform transition-transform ease-in-out duration-300 hover:scale-105",children:"Join"})]})]})}}A.contextType=R;class p extends _{constructor(e){super(e)}render({user:e,post:t}){return h("div",{class:"flex flex-col",children:[i("a",{id:"gallery_click",href:t.content.file.url,class:"w-full",target:"_blank",rel:"noreferrer",children:i("img",{decoding:"async",loading:"lazy",class:"rounded-3xl shadow object-cover transform transition-transform ease-in-out duration-300 hover:scale-105",src:t.content.file.url})}),h("div",{class:"flex items-center justify-between py-4",children:[h("a",{class:"flex items-center",href:"#",children:[i("img",{class:"w-11 h-11 rounded-full mr-4 border-2 border-[#AAB3CF]",src:e.avatar_url}),i("p",{class:"text-data shadow text-lg font-medium",children:e.display_name})]}),h("div",{class:"flex text-data text-lg items-center",children:[h("a",{class:"mr-4 flex items-center",href:"#",children:[i("span",{class:"mr-2",children:h("svg",{xmlns:"http://www.w3.org/2000/svg",height:"24px",viewBox:"0 0 24 24",width:"24px",fill:"#AAB3CF",children:[i("path",{d:"M0 0h24v24H0V0z",fill:"none"}),i("path",{d:"M16.5 3c-1.74 0-3.41.81-4.5 2.09C10.91 3.81 9.24 3 7.5 3 4.42 3 2 5.42 2 8.5c0 3.78 3.4 6.86 8.55 11.54L12 21.35l1.45-1.32C18.6 15.36 22 12.28 22 8.5 22 5.42 19.58 3 16.5 3zm-4.4 15.55l-.1.1-.1-.1C7.14 14.24 4 11.39 4 8.5 4 6.5 5.5 5 7.5 5c1.54 0 3.04.99 3.57 2.36h1.87C13.46 5.99 14.96 5 16.5 5c2 0 3.5 1.5 3.5 3.5 0 2.89-3.14 5.74-7.9 10.05z"})]})}),i("span",{children:"5"})]}),h("a",{class:"flex items-center",href:"#",children:[i("span",{class:"mr-2",children:h("svg",{xmlns:"http://www.w3.org/2000/svg",height:"24px",viewBox:"0 0 24 24",width:"24px",fill:"#AAB3CF",children:[i("path",{d:"M0 0h24v24H0V0z",fill:"none"}),i("path",{d:"M20 2H4c-1.1 0-2 .9-2 2v18l4-4h14c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm0 14H6l-2 2V4h16v12z"})]})}),i("span",{children:"11"})]})]})]})]})}}class y{constructor(e,t,o){d(this,"mxid");d(this,"display_name");d(this,"avatar_url");this.mxid=e,this.display_name=t,this.avatar_url=o}}class v{constructor(e,t){d(this,"event_id");d(this,"content");this.event_id=e,this.content=t}}class de extends _{constructor(){super();this.state={columns:this.settingColumns()}}settingColumns(){return window.innerWidth>=1400?4:window.innerWidth>=800?3:window.innerWidth>=500?2:1}componentDidMount(){window.addEventListener("resize",()=>this.setState({columns:this.settingColumns()}))}componentWillUnmount(){window.removeEventListener("resize",()=>this.setState({columns:this.settingColumns()}))}render(){return h("div",{class:"flex flex-col",children:[i("header",{children:i(A,{})}),h("main",{class:"m-12 mt-6",children:[i("h1",{class:"text-3xl font-bold mb-4 text-white",children:"Explore"}),i("div",{class:"flex justify-center",id:"gallery",children:h(J,{gap:24,nColumns:this.state.columns,children:[i(p,{user:new y("","Person A","https://unsplash.com/photos/_cvwXhGqG-o/download?ixid=MnwxMjA3fDB8MXxzZWFyY2h8OHx8ZmFjZXxlbnwwfDJ8fHwxNjQ4Nzc5NzYx"),post:new v("",{file:{url:"https://unsplash.com/photos/UWmrTAQ75iA/download?ixid=MnwxMjA3fDB8MXxhbGx8Mnx8fHx8fDJ8fDE2NDg4MzI0Njg"}})}),i(p,{user:new y("","Person B","https://unsplash.com/photos/uJ8LNVCBjFQ/download?ixid=MnwxMjA3fDB8MXxzZWFyY2h8MTN8fGZhY2V8ZW58MHwyfHx8MTY0ODc3OTc2MQ"),post:new v("",{file:{url:"https://unsplash.com/photos/7ptbiEPxKMQ/download?ixid=MnwxMjA3fDB8MXxhbGx8OXx8fHx8fDJ8fDE2NDg4MzI0Njg"}})}),i(p,{user:new y("","Person C","https://unsplash.com/photos/u3pi6HhSYew/download?ixid=MnwxMjA3fDB8MXxzZWFyY2h8MTd8fGZhY2V8ZW58MHwyfHx8MTY0ODc3OTc2MQ"),post:new v("",{file:{url:"https://unsplash.com/photos/ZiPlVmmKEYA/download?ixid=MnwxMjA3fDB8MXxhbGx8Mzl8fHx8fHwyfHwxNjQ4ODM2MDIz"}})}),i(p,{user:new y("","Person D","https://unsplash.com/photos/TW_z_iUD_bQ/download?ixid=MnwxMjA3fDB8MXxzZWFyY2h8ODR8fHBvcnRyYWl0fGVufDB8Mnx8fDE2NDg4NDQ3MjQ"),post:new v("",{file:{url:"https://unsplash.com/photos/FTQJBGDxKXg/download?ixid=MnwxMjA3fDB8MXxhbGx8M3x8fHx8fDJ8fDE2NDg4NDMyNDY"}})}),i(p,{user:new y("","Person E","https://unsplash.com/photos/kYtN89E5ce4/download?ixid=MnwxMjA3fDB8MXxzZWFyY2h8MTA0fHxwb3J0cmFpdHxlbnwwfDJ8fHwxNjQ4ODQ0NzQy"),post:new v("",{file:{url:"https://unsplash.com/photos/zfhxiaZO3JE/download?ixid=MnwxMjA3fDB8MXxhbGx8Mjl8fHx8fHwyfHwxNjQ4ODQzMjQ1"}})}),i(p,{user:new y("","Person E","https://unsplash.com/photos/kBonaevi3yA/download?ixid=MnwxMjA3fDB8MXxzZWFyY2h8MTE5fHxwb3J0cmFpdHxlbnwwfDJ8fHwxNjQ4ODQ0NzQy"),post:new v("",{file:{url:"https://unsplash.com/photos/jm-JKqrAXsA/download?ixid=MnwxMjA3fDB8MXxhbGx8MTAyfHx8fHx8Mnx8MTY0ODg0MzI1NQ"}})})]})})]})]})}}const S=new a.UnstableValue("m.image","org.matrix.msc1767.image"),N=new a.UnstableValue("m.file","org.matrix.msc1767.file"),L=new a.UnstableValue("m.thumbnail","org.matrix.msc1767.thumbnail"),z=new a.UnstableValue("blurhash","xyz.amorgan.blurhash"),he=new a.NamespacedValue("matrixart.description"),me=new a.NamespacedValue("matrixart.tags"),we=new a.NamespacedValue("matrixart.nsfw"),ue=new a.NamespacedValue("matrixart.license");class xe extends a.ExtensibleEvent{constructor(e){super(e);d(this,"image");d(this,"text");d(this,"thumbnails");d(this,"blurhash");d(this,"file");d(this,"description");d(this,"tags");d(this,"nsfw",!1);d(this,"license");const t=S.findIn(this.wireContent),o=a.M_TEXT.findIn(this.wireContent),n=N.findIn(this.wireContent),l=L.findIn(this.wireContent),r=z.findIn(this.wireContent),w=he.findIn(this.wireContent),m=me.findIn(this.wireContent),x=we.findIn(this.wireContent),u=ue.findIn(this.wireContent);if(a.isProvided(t)){if(!t)throw new a.InvalidEventError("m.image is required to be present");this.image=t}if(a.isProvided(n)){if(!n)throw new a.InvalidEventError("m.file is required to be present");this.file=n}if(a.isOptionalAString(o)){if(!t)throw new a.InvalidEventError("m.text is required to be present");this.text=o}if(a.isProvided(l)){if(!Array.isArray(l))throw new a.InvalidEventError("m.thumbnail contents must be an array");this.thumbnails=l}if(a.isOptionalAString(r)&&(this.blurhash=r),a.isOptionalAString(w)&&(this.description=w),a.isProvided(m)){if(!Array.isArray(m))throw new a.InvalidEventError("matrixart.tags contents must be an array");this.tags=m}if(a.isProvided(x)){if(typeof x!="boolean")throw new a.InvalidEventError("matrixart.tags contents must be an boolean");this.nsfw=x}a.isOptionalAString(u)&&(this.license=u)}isEquivalentTo(e){return a.isEventTypeSame(e,S)}serialize(){const e={[a.M_TEXT.name]:this.text,[N.name]:this.file,[S.name]:this.image,[L.name]:this.thumbnails,[z.name]:this.blurhash,["matrixart.description"]:this.description,["matrixart.tags"]:this.tags,["matrixart.nsfw"]:this.nsfw,["matrixart.license"]:this.license};return{type:"m.image",content:e}}}function fe(c){const e=c;return new xe(e)}a.ExtensibleEvents.registerInterpreter(S,fe);a.ExtensibleEvents.unknownInterpretOrder.push(S);function D(){return new Worker("/pr-121/assets/indexeddb.worker.0ae1a28d.js",{type:"module"})}class C{constructor(e){d(this,"events",[]);d(this,"currentUserDirectory");d(this,"rootDirectory");this.client=e}static async new(){var n,l,r,w,m,x;global.Olm||console.error("global.Olm does not seem to be present. Did you forget to add olm in the out directory?");let e;if(window.localStorage.getItem("server")!==null?e=window.localStorage.getItem("server"):e="https://matrix.art.midnightthoughts.space",!e)throw new Error("No matrix server URL defined");let t;if(window.localStorage.getItem("mxid_guest")!==null){const u=(n=window.localStorage.getItem("mxid_guest"))!=null?n:void 0,f=(l=window.localStorage.getItem("access_token_guest"))!=null?l:void 0,g=(r=window.localStorage.getItem("device_id_guest"))!=null?r:void 0;t=s.createClient({useAuthorizationHeader:!0,baseUrl:e,userId:u,accessToken:f,deviceId:g,sessionStore:new M(window.localStorage),store:new s.IndexedDBStore({indexedDB:window.indexedDB,dbName:"matrix-art-sync:guest",localStorage:window.localStorage,workerFactory:()=>new D}),cryptoStore:new s.IndexedDBCryptoStore(window.indexedDB,"matrix-art:crypto")}),t.setGuest(!0)}{const u=s.createClient("https://matrix.art.midnightthoughts.space"),{user_id:f,device_id:g,access_token:T}=await u.registerGuest();t=s.createClient({useAuthorizationHeader:!0,baseUrl:e,userId:f,accessToken:T,deviceId:g,sessionStore:new M(window.localStorage),store:new s.IndexedDBStore({indexedDB:window.indexedDB,dbName:"matrix-art-sync:guest",localStorage:window.localStorage,workerFactory:()=>new D}),cryptoStore:new s.IndexedDBCryptoStore(window.indexedDB,"matrix-art:crypto")}),t.setGuest(!0),window.localStorage.setItem("mxid_guest",f),window.localStorage.setItem("access_token_guest",T),window.localStorage.setItem("device_id_guest",g),window.localStorage.setItem("server",e)}let o;if(window.localStorage.getItem("mxid")!==null){const u=(w=window.localStorage.getItem("mxid"))!=null?w:void 0,f=(m=window.localStorage.getItem("access_token"))!=null?m:void 0,g=(x=window.localStorage.getItem("device_id"))!=null?x:void 0;o=s.createClient({useAuthorizationHeader:!0,baseUrl:e,userId:u,accessToken:f,deviceId:g,sessionStore:new M(window.localStorage),store:new s.IndexedDBStore({indexedDB:window.indexedDB,dbName:"matrix-art-sync:guest",localStorage:window.localStorage,workerFactory:()=>new D}),cryptoStore:new s.IndexedDBCryptoStore(window.indexedDB,"matrix-art:crypto")}),o.setGuest(!1)}return new C(o!=null?o:t)}isLoggedIn(){return this.client.isLoggedIn()&&!this.client.isGuest()}async start(){this.client.on(s.MatrixEventEvent.Decrypted,(t,o)=>{const n=t.unstableExtensibleEvent;n!=null&&n.isEquivalentTo(S)&&this.events.push(t)}),console.log("start"),await this.client.store.startup(),await this.client.initCrypto(),await this.client.startClient();const e=await this.client.joinRoom("#Matrix_Art:art.midnightthoughts.space");await k(1e3),this.rootDirectory=new E(this.client,e.roomId),console.log("started")}async register(e="https://matrix.art.midnightthoughts.space",t,o,n=!1){var l;if(this.client.stopClient(),this.client=s.createClient({useAuthorizationHeader:!0,baseUrl:e,userId:t,deviceId:"Matrix Art",sessionStore:new M(window.localStorage),store:new s.IndexedDBStore({indexedDB:window.indexedDB,dbName:"matrix-art-sync:loggedin",localStorage:window.localStorage,workerFactory:()=>new D}),cryptoStore:new s.IndexedDBCryptoStore(window.indexedDB,"matrix-art:crypto")}),await this.client.register(t,o,null,{type:"m.login.dummy"}),window.localStorage.setItem("server",e),window.localStorage.setItem("mxid",t),window.localStorage.setItem("access_token",this.client.getAccessToken()),window.localStorage.setItem("device_id","Matrix Art"),await this.start(),n){const r=(l=this.rootDirectory)==null?void 0:l.getDirectories(),w=this.client.getUserId().replace(":","_");r!=null&&r.some(m=>m.room.name===w)?this.rootDirectory=r==null?void 0:r.find(m=>m.room.name===w):await this.createProfileFolder()}}async login(e,t,o,n=!1){var l;if(this.client.stopClient(),this.client=s.createClient({useAuthorizationHeader:!0,baseUrl:e,userId:t,deviceId:"Matrix Art",sessionStore:new M(window.localStorage),store:new s.IndexedDBStore({indexedDB:window.indexedDB,dbName:"matrix-art-sync:loggedin",localStorage:window.localStorage,workerFactory:()=>new D}),cryptoStore:new s.IndexedDBCryptoStore(window.indexedDB,"matrix-art:crypto")}),await this.client.loginWithPassword(t,o),window.localStorage.setItem("server",e),window.localStorage.setItem("mxid",t),window.localStorage.setItem("access_token",this.client.getAccessToken()),window.localStorage.setItem("device_id","Matrix Art"),await this.start(),n){const r=(l=this.rootDirectory)==null?void 0:l.getDirectories();console.log(r);const w=this.client.getUserId().replace(":","_");r!=null&&r.some(m=>m.room.name===w)?this.rootDirectory=r==null?void 0:r.find(m=>m.room.name===w):await this.createProfileFolder()}}async createProfileFolder(){if(this.client.isGuest())throw new Error("Cannot create a file tree space as a guest");const e=await this.client.joinRoom("#Matrix_Art:art.midnightthoughts.space");await k(1e3),this.rootDirectory=new E(this.client,e.roomId);const t=this.client.getUserId().replace(":","_");this.currentUserDirectory=await this.createPublicSubDirectory(this.rootDirectory,t),await this.createPublicSubDirectory(this.currentUserDirectory,"Timeline")}async createPublicFileTree(e){if(this.client.isGuest())throw new Error("Cannot create a file tree space as a guest");const{room_id:t}=await this.client.createRoom({name:e,preset:s.Preset.PublicChat,power_level_content_override:j(P({},Z),{users:{["@administrator:art.midnightthoughts.space"]:100,[this.client.getUserId()]:100}}),invite:["@administrator:art.midnightthoughts.space"],creation_content:{[s.RoomCreateTypeField]:s.RoomType.Space},initial_state:[{type:s.UNSTABLE_MSC3088_PURPOSE.name,state_key:s.UNSTABLE_MSC3089_TREE_SUBTYPE.name,content:{[s.UNSTABLE_MSC3088_ENABLED.name]:!0}},{type:s.EventType.RoomEncryption,state_key:"",content:{algorithm:q}},{type:s.EventType.RoomGuestAccess,state_key:"",content:{guest_access:"can_join"}},{type:s.EventType.RoomHistoryVisibility,state_key:"",content:{history_visibility:"world_readable"}}]}),o=this.client.getRoom(t),n=o==null?void 0:o.getLiveTimeline().getState(s.EventTimeline.FORWARDS).getStateEvents(s.EventType.RoomPowerLevels,"");if(!n)throw new Error("Failed to find PL event");return await this.client.setPowerLevel(t,this.client.getUserId(),50,n),new E(this.client,t)}async createPublicSubDirectory(e,t){const o=await this.createPublicFileTree(t);return await this.client.sendStateEvent(e.roomId,s.EventType.SpaceChild,{via:[this.client.getDomain()]},o.roomId),await this.client.sendStateEvent(o.roomId,s.EventType.SpaceParent,{via:[this.client.getDomain()]},e.roomId),o}}function k(c){return new Promise(e=>setTimeout(e,c))}const ge=ie(()=>ce(()=>import("./Join.e97dcbed.js"),["assets/Join.e97dcbed.js","assets/vendor.09079154.js"]));class pe extends _{constructor(){super();this.state={client:void 0}}loadOlm(){return $.init({locateFile:()=>K}).then(()=>{console.log("Using WebAssembly Olm")}).catch(e=>(console.log("Failed to load Olm: trying legacy version",e),new Promise((t,o)=>{const n=document.createElement("script");n.src=ee,n.onload=t,n.onerror=o,document.body.appendChild(n)}).then(()=>window.Olm.init()).then(()=>{console.log("Using legacy Olm")}).catch(t=>{console.log("Both WebAssembly and asm.js Olm failed!",t)})))}async loadMatrixClient(){var t;let e=await C.new();this.setState({client:e}),console.log("Client loaded"),await((t=this.state.client)==null?void 0:t.start()),console.log("Client started")}async componentDidMount(){try{await this.loadOlm(),console.log("Olm loaded")}catch{console.log("Olm not loaded")}await this.loadMatrixClient()}render(){return i(R.Provider,{value:this.state.client,children:h(te,{children:[i(O,{path:"/",element:i(de,{})}),i(O,{path:"join",element:i(ne,{fallback:h("div",{class:"flex flex-col",children:[i("header",{children:i(A,{})}),i("main",{class:"m-12 mt-6 flex items-center justify-center",children:i("p",{class:"text-lg text-data font-bold",children:"Loading..."})})]}),children:i(ge,{})})})]})})}}oe(i(re,{basename:"/pr-121/",children:i(pe,{})}),document.querySelector("#app"));export{R as C,A as H,h as a,i as j};
diff --git a/pr-121/assets/indexeddb.worker.0ae1a28d.js b/pr-121/assets/indexeddb.worker.0ae1a28d.js
@@ -1 +0,0 @@
-var jt=Object.defineProperty;var _e=Object.getOwnPropertySymbols;var Mt=Object.prototype.hasOwnProperty,Ut=Object.prototype.propertyIsEnumerable;var Oe=(k,w,_)=>w in k?jt(k,w,{enumerable:!0,configurable:!0,writable:!0,value:_}):k[w]=_,we=(k,w)=>{for(var _ in w||(w={}))Mt.call(w,_)&&Oe(k,_,w[_]);if(_e)for(var _ of _e(w))Ut.call(w,_)&&Oe(k,_,w[_]);return k};(function(){"use strict";var k=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:{},w={},_={},L={exports:{}};(function(r){function e(t){return t&&t.__esModule?t:{default:t}}r.exports=e,r.exports.__esModule=!0,r.exports.default=r.exports})(L);var F={exports:{}};(function(r){function e(t,n,o){return n in t?Object.defineProperty(t,n,{value:o,enumerable:!0,configurable:!0,writable:!0}):t[n]=o,t}r.exports=e,r.exports.__esModule=!0,r.exports.default=r.exports})(F);var K={},T={},C={},z={exports:{}};(function(r){(function(e,t){r.exports?r.exports=t():e.log=t()})(k,function(){var e=function(){},t="undefined",n=typeof window!==t&&typeof window.navigator!==t&&/Trident\/|MSIE /.test(window.navigator.userAgent),o=["trace","debug","info","warn","error"];function i(h,v){var b=h[v];if(typeof b.bind=="function")return b.bind(h);try{return Function.prototype.bind.call(b,h)}catch{return function(){return Function.prototype.apply.apply(b,[h,arguments])}}}function s(){console.log&&(console.log.apply?console.log.apply(console,arguments):Function.prototype.apply.apply(console.log,[console,arguments])),console.trace&&console.trace()}function c(h){return h==="debug"&&(h="log"),typeof console===t?!1:h==="trace"&&n?s:console[h]!==void 0?i(console,h):console.log!==void 0?i(console,"log"):e}function f(h,v){for(var b=0;b<o.length;b++){var g=o[b];this[g]=b<h?e:this.methodFactory(g,h,v)}this.log=this.debug}function l(h,v,b){return function(){typeof console!==t&&(f.call(this,v,b),this[h].apply(this,arguments))}}function u(h,v,b){return c(h)||l.apply(this,arguments)}function p(h,v,b){var g=this,ye;v=v==null?"WARN":v;var E="loglevel";typeof h=="string"?E+=":"+h:typeof h=="symbol"&&(E=void 0);function At(d){var P=(o[d]||"silent").toUpperCase();if(!(typeof window===t||!E)){try{window.localStorage[E]=P;return}catch{}try{window.document.cookie=encodeURIComponent(E)+"="+P+";"}catch{}}}function be(){var d;if(!(typeof window===t||!E)){try{d=window.localStorage[E]}catch{}if(typeof d===t)try{var P=window.document.cookie,V=P.indexOf(encodeURIComponent(E)+"=");V!==-1&&(d=/^([^;]+)/.exec(P.slice(V))[1])}catch{}return g.levels[d]===void 0&&(d=void 0),d}}function Nt(){if(!(typeof window===t||!E)){try{window.localStorage.removeItem(E);return}catch{}try{window.document.cookie=encodeURIComponent(E)+"=; expires=Thu, 01 Jan 1970 00:00:00 UTC"}catch{}}}g.name=h,g.levels={TRACE:0,DEBUG:1,INFO:2,WARN:3,ERROR:4,SILENT:5},g.methodFactory=b||u,g.getLevel=function(){return ye},g.setLevel=function(d,P){if(typeof d=="string"&&g.levels[d.toUpperCase()]!==void 0&&(d=g.levels[d.toUpperCase()]),typeof d=="number"&&d>=0&&d<=g.levels.SILENT){if(ye=d,P!==!1&&At(d),f.call(g,d,h),typeof console===t&&d<g.levels.SILENT)return"No console available for logging"}else throw"log.setLevel() called with invalid level: "+d},g.setDefaultLevel=function(d){v=d,be()||g.setLevel(d,!1)},g.resetLevel=function(){g.setLevel(v,!1),Nt()},g.enableAll=function(d){g.setLevel(g.levels.TRACE,d)},g.disableAll=function(d){g.setLevel(g.levels.SILENT,d)};var G=be();G==null&&(G=v),g.setLevel(G,!1)}var y=new p,S={};y.getLogger=function(v){if(typeof v!="symbol"&&typeof v!="string"||v==="")throw new TypeError("You must supply a name when creating a logger.");var b=S[v];return b||(b=S[v]=new p(v,y.getLevel(),y.methodFactory)),b};var H=typeof window!==t?window.log:void 0;return y.noConflict=function(){return typeof window!==t&&window.log===y&&(window.log=H),y},y.getLoggers=function(){return S},y.default=y,y})})(z);var xe=L.exports;Object.defineProperty(C,"__esModule",{value:!0}),C.logger=void 0;var N=xe(z.exports);const Z="matrix";N.default.methodFactory=function(r,e,t){return function(...n){return this.prefix&&n.unshift(this.prefix),r==="error"||r==="warn"||r==="trace"||r==="info"?console[r](...n):console.log(...n)}};const W=N.default.getLogger(Z);C.logger=W,W.setLevel(N.default.levels.DEBUG,!1);function Q(r){r.withPrefix=function(e){const t=this.prefix||"";return Se(t+e)}}Q(W);function Se(r){const e=N.default.getLogger(`${Z}-${r}`);return e.prefix!==r&&(Q(e),e.prefix=r,e.setLevel(N.default.levels.DEBUG,!1)),e}var a={},Ee={"0":"O","1":"l","\u05AD":"\u0596","\u05AE":"\u0598","\u05A8":"\u0599","\u05A4":"\u059A","\u1AB4":"\u06DB","\u20DB":"\u06DB","\u0619":"\u0313","\u08F3":"\u0313","\u0343":"\u0313","\u0315":"\u0313","\u064F":"\u0313","\u065D":"\u0314","\u059C":"\u0301","\u059D":"\u0301","\u0618":"\u0301","\u0747":"\u0301","\u0341":"\u0301","\u0954":"\u0301","\u064E":"\u0301","\u0340":"\u0300","\u0953":"\u0300","\u030C":"\u0306","\uA67C":"\u0306","\u0658":"\u0306","\u065A":"\u0306","\u036E":"\u0306","\u06E8":"\u0306\u0307","\u0310":"\u0306\u0307","\u0901":"\u0306\u0307","\u0981":"\u0306\u0307","\u0A81":"\u0306\u0307","\u0B01":"\u0306\u0307","\u0C00":"\u0306\u0307","\u0C81":"\u0306\u0307","\u0D01":"\u0306\u0307","\u{114BF}":"\u0306\u0307","\u1CD0":"\u0302","\u0311":"\u0302","\u065B":"\u0302","\u07EE":"\u0302","\uA6F0":"\u0302","\u05AF":"\u030A","\u06DF":"\u030A","\u17D3":"\u030A","\u309A":"\u030A","\u0652":"\u030A","\u0B82":"\u030A","\u1036":"\u030A","\u17C6":"\u030A","\u{11300}":"\u030A","\u0E4D":"\u030A","\u0ECD":"\u030A","\u0366":"\u030A","\u2DEA":"\u030A","\u08EB":"\u0308","\u07F3":"\u0308","\u064B":"\u030B","\u08F0":"\u030B","\u0342":"\u0303","\u0653":"\u0303","\u05C4":"\u0307","\u06EC":"\u0307","\u0740":"\u0307","\u08EA":"\u0307","\u0741":"\u0307","\u0358":"\u0307","\u05B9":"\u0307","\u05BA":"\u0307","\u05C2":"\u0307","\u05C1":"\u0307","\u07ED":"\u0307","\u0902":"\u0307","\u0A02":"\u0307","\u0A82":"\u0307","\u0BCD":"\u0307","\u0337":"\u0338","\u1AB7":"\u0328","\u0322":"\u0328","\u0345":"\u0328","\u1CD2":"\u0304","\u0305":"\u0304","\u0659":"\u0304","\u07EB":"\u0304","\uA6F1":"\u0304","\u1CDA":"\u030E","\u0657":"\u0312","\u0357":"\u0350","\u08FF":"\u0350","\u08F8":"\u0350","\u0900":"\u0352","\u1CED":"\u0316","\u1CDC":"\u0329","\u0656":"\u0329","\u1CD5":"\u032B","\u0347":"\u0333","\u08F9":"\u0354","\u08FA":"\u0355","\u309B":"\uFF9E","\u309C":"\uFF9F","\u0336":"\u0335","\u302C":"\u0309","\u05C5":"\u0323","\u08ED":"\u0323","\u1CDD":"\u0323","\u05B4":"\u0323","\u065C":"\u0323","\u093C":"\u0323","\u09BC":"\u0323","\u0A3C":"\u0323","\u0ABC":"\u0323","\u0B3C":"\u0323","\u{111CA}":"\u0323","\u{114C3}":"\u0323","\u{10A3A}":"\u0323","\u08EE":"\u0324","\u1CDE":"\u0324","\u0F37":"\u0325","\u302D":"\u0325","\u0327":"\u0326","\u0321":"\u0326","\u0339":"\u0326","\u1CD9":"\u032D","\u1CD8":"\u032E","\u0952":"\u0331","\u0320":"\u0331","\u08F1":"\u064C","\u08E8":"\u064C","\u08E5":"\u064C",\uFC5E:"\uFE72\u0651","\u08F2":"\u064D",\uFC5F:"\uFE74\u0651",\uFCF2:"\uFE77\u0651",\uFC60:"\uFE76\u0651",\uFCF3:"\uFE79\u0651",\uFC61:"\uFE78\u0651","\u061A":"\u0650","\u0317":"\u0650",\uFCF4:"\uFE7B\u0651",\uFC62:"\uFE7A\u0651",\uFC63:"\uFE7C\u0670","\u065F":"\u0655","\u030D":"\u0670","\u0742":"\u073C","\u0A03":"\u0983","\u0C03":"\u0983","\u0C83":"\u0983","\u0D03":"\u0983","\u0D83":"\u0983","\u1038":"\u0983","\u{114C1}":"\u0983","\u17CB":"\u0E48","\u0EC8":"\u0E48","\u0EC9":"\u0E49","\u0ECA":"\u0E4A","\u0ECB":"\u0E4B","\uA66F":"\u20E9","\u2028":" ","\u2029":" ","\u1680":" ","\u2000":" ","\u2001":" ","\u2002":" ","\u2003":" ","\u2004":" ","\u2005":" ","\u2006":" ","\u2008":" ","\u2009":" ","\u200A":" ","\u205F":" ","\xA0":" ","\u2007":" ","\u202F":" ","\u07FA":"_","\uFE4D":"_","\uFE4E":"_","\uFE4F":"_","\u2010":"-","\u2011":"-","\u2012":"-","\u2013":"-","\uFE58":"-","\u06D4":"-","\u2043":"-","\u02D7":"-","\u2212":"-","\u2796":"-","\u2CBA":"-","\u2A29":"-\u0313","\u2E1A":"-\u0308","\uFB29":"-\u0307","\u2238":"-\u0307","\u2A2A":"-\u0323","\uA4FE":"-.","\uFF5E":"\u301C","\u060D":",","\u066B":",","\u201A":",","\xB8":",","\uA4F9":",","\u2E32":"\u060C","\u066C":"\u060C","\u037E":";","\u2E35":"\u061B","\u0903":":","\u0A83":":","\uFF1A":":","\u0589":":","\u0703":":","\u0704":":","\u16EC":":","\uFE30":":","\u1803":":","\u1809":":","\u205A":":","\u05C3":":","\u02F8":":","\uA789":":","\u2236":":",\u02D0:":","\uA4FD":":","\u2A74":"::=","\u29F4":":\u2192","\uFF01":"!",\u01C3:"!","\u2D51":"!","\u203C":"!!","\u2049":"!?",\u0294:"?","\u0241":"?","\u097D":"?",\u13AE:"?","\uA6EB":"?","\u2048":"?!","\u2047":"??","\u2E2E":"\u061F","\u{1D16D}":".","\u2024":".","\u0701":".","\u0702":".","\uA60E":".","\u{10A50}":".","\u0660":".","\u06F0":".","\uA4F8":".","\uA4FB":".,","\u2025":"..","\uA4FA":"..","\u2026":"...","\uA6F4":"\uA6F3\uA6F3","\u30FB":"\xB7","\uFF65":"\xB7","\u16EB":"\xB7","\u0387":"\xB7","\u2E31":"\xB7","\u{10101}":"\xB7","\u2022":"\xB7","\u2027":"\xB7","\u2219":"\xB7","\u22C5":"\xB7","\uA78F":"\xB7",\u1427:"\xB7","\u22EF":"\xB7\xB7\xB7","\u2D48":"\xB7\xB7\xB7",\u1444:"\xB7<","\u22D7":"\xB7>",\u1437:"\xB7>",\u1440:"\xB7>",\u152F:"\xB74",\u147E:"\xB7b",\u1480:"\xB7b\u0307",\u147A:"\xB7d",\u1498:"\xB7J",\u14B6:"\xB7L",\u1476:"\xB7P",\u1457:"\xB7U",\u143A:"\xB7V",\u143C:"\xB7\u0245",\u14AE:"\xB7\u0393",\u140E:"\xB7\u0394",\u1459:"\xB7\u0548",\u140C:"\xB7\u1401",\u1410:"\xB7\u1404",\u1412:"\xB7\u1405",\u1414:"\xB7\u1406",\u1417:"\xB7\u140A",\u1419:"\xB7\u140B",\u143E:"\xB7\u1432",\u1442:"\xB7\u1434",\u1446:"\xB7\u1439",\u145B:"\xB7\u144F",\u1454:"\xB7\u1450",\u145D:"\xB7\u1450",\u145F:"\xB7\u1451",\u1461:"\xB7\u1455",\u1463:"\xB7\u1456",\u1474:"\xB7\u146B",\u1478:"\xB7\u146E",\u147C:"\xB7\u1470",\u1492:"\xB7\u1489",\u1494:"\xB7\u148B",\u1496:"\xB7\u148C",\u149A:"\xB7\u148E",\u149C:"\xB7\u1490",\u149E:"\xB7\u1491",\u14AC:"\xB7\u14A3",\u14B0:"\xB7\u14A6",\u14B2:"\xB7\u14A7",\u14B4:"\xB7\u14A8",\u14B8:"\xB7\u14AB",\u14C9:"\xB7\u14C0","\u18C6":"\xB7\u14C2","\u18C8":"\xB7\u14C3","\u18CA":"\xB7\u14C4","\u18CC":"\xB7\u14C5",\u14CB:"\xB7\u14C7",\u14CD:"\xB7\u14C8",\u14DC:"\xB7\u14D3",\u14DE:"\xB7\u14D5",\u14E0:"\xB7\u14D6",\u14E2:"\xB7\u14D7",\u14E4:"\xB7\u14D8",\u14E6:"\xB7\u14DA",\u14E8:"\xB7\u14DB",\u14F6:"\xB7\u14ED",\u14F8:"\xB7\u14EF",\u14FA:"\xB7\u14F0",\u14FC:"\xB7\u14F1",\u14FE:"\xB7\u14F2",\u1500:"\xB7\u14F4",\u1502:"\xB7\u14F5",\u1517:"\xB7\u1510",\u1519:"\xB7\u1511",\u151B:"\xB7\u1512",\u151D:"\xB7\u1513",\u151F:"\xB7\u1514",\u1521:"\xB7\u1515",\u1523:"\xB7\u1516",\u1531:"\xB7\u1528",\u1533:"\xB7\u1529",\u1535:"\xB7\u152A",\u1537:"\xB7\u152B",\u1539:"\xB7\u152D",\u153B:"\xB7\u152E","\u18CE":"\xB7\u1543","\u18CF":"\xB7\u1546","\u18D0":"\xB7\u1547","\u18D1":"\xB7\u1548","\u18D2":"\xB7\u1549","\u18D3":"\xB7\u154B",\u154E:"\xB7\u154C",\u155B:"\xB7\u155A",\u1568:"\xB7\u1567","\u18B3":"\xB7\u18B1","\u18B6":"\xB7\u18B4","\u18B9":"\xB7\u18B8","\u18C2":"\xB7\u18C0","\uA830":"\u0964","\u0965":"\u0964\u0964","\u1C3C":"\u1C3B\u1C3B","\u104B":"\u104A\u104A","\u1AA9":"\u1AA8\u1AA8","\u1AAB":"\u1AAA\u1AA8","\u1B5F":"\u1B5E\u1B5E","\u{10A57}":"\u{10A56}\u{10A56}","\u{1144C}":"\u{1144B}\u{1144B}","\u{11642}":"\u{11641}\u{11641}","\u{11C42}":"\u{11C41}\u{11C41}","\u1C7F":"\u1C7E\u1C7E","\u055D":"'","\uFF07":"'","\u2018":"'","\u2019":"'","\u201B":"'","\u2032":"'","\u2035":"'","\u055A":"'","\u05F3":"'","`":"'","\u1FEF":"'","\uFF40":"'","\xB4":"'","\u0384":"'","\u1FFD":"'","\u1FBD":"'","\u1FBF":"'","\u1FFE":"'","\u02B9":"'","\u0374":"'","\u02C8":"'","\u02CA":"'","\u02CB":"'","\u02F4":"'",\u02BB:"'",\u02BD:"'",\u02BC:"'",\u02BE:"'","\uA78C":"'",\u05D9:"'","\u07F4":"'","\u07F5":"'",\u144A:"'",\u16CC:"'","\u{16F51}":"'","\u{16F52}":"'","\u1CD3":"''",'"':"''","\uFF02":"''","\u201C":"''","\u201D":"''","\u201F":"''","\u2033":"''","\u2036":"''","\u3003":"''","\u05F4":"''","\u02DD":"''","\u02BA":"''","\u02F6":"''",\u02EE:"''",\u05F2:"''","\u2034":"'''","\u2037":"'''","\u2057":"''''",\u0181:"'B",\u018A:"'D",\u0149:"'n",\u01A4:"'P",\u01AC:"'T",\u01B3:"'Y","\uFF3B":"(","\u2768":"(","\u2772":"(","\u3014":"(","\uFD3E":"(","\u2E28":"((","\u3220":"(\u30FC)","\u2475":"(2)","\u2487":"(2O)","\u2476":"(3)","\u2477":"(4)","\u2478":"(5)","\u2479":"(6)","\u247A":"(7)","\u247B":"(8)","\u247C":"(9)","\u249C":"(a)","\u{1F110}":"(A)","\u249D":"(b)","\u{1F111}":"(B)","\u249E":"(c)","\u{1F112}":"(C)","\u249F":"(d)","\u{1F113}":"(D)","\u24A0":"(e)","\u{1F114}":"(E)","\u24A1":"(f)","\u{1F115}":"(F)","\u24A2":"(g)","\u{1F116}":"(G)","\u24A3":"(h)","\u{1F117}":"(H)","\u24A4":"(i)","\u24A5":"(j)","\u{1F119}":"(J)","\u24A6":"(k)","\u{1F11A}":"(K)","\u2474":"(l)","\u{1F118}":"(l)","\u24A7":"(l)","\u{1F11B}":"(L)","\u247F":"(l2)","\u2480":"(l3)","\u2481":"(l4)","\u2482":"(l5)","\u2483":"(l6)","\u2484":"(l7)","\u2485":"(l8)","\u2486":"(l9)","\u247E":"(ll)","\u247D":"(lO)","\u{1F11C}":"(M)","\u24A9":"(n)","\u{1F11D}":"(N)","\u24AA":"(o)","\u{1F11E}":"(O)","\u24AB":"(p)","\u{1F11F}":"(P)","\u24AC":"(q)","\u{1F120}":"(Q)","\u24AD":"(r)","\u{1F121}":"(R)","\u24A8":"(rn)","\u24AE":"(s)","\u{1F122}":"(S)","\u{1F12A}":"(S)","\u24AF":"(t)","\u{1F123}":"(T)","\u24B0":"(u)","\u{1F124}":"(U)","\u24B1":"(v)","\u{1F125}":"(V)","\u24B2":"(w)","\u{1F126}":"(W)","\u24B3":"(x)","\u{1F127}":"(X)","\u24B4":"(y)","\u{1F128}":"(Y)","\u24B5":"(z)","\u{1F129}":"(Z)","\u3200":"(\u1100)","\u320E":"(\uAC00)","\u3201":"(\u1102)","\u320F":"(\uB098)","\u3202":"(\u1103)","\u3210":"(\uB2E4)","\u3203":"(\u1105)","\u3211":"(\uB77C)","\u3204":"(\u1106)","\u3212":"(\uB9C8)","\u3205":"(\u1107)","\u3213":"(\uBC14)","\u3206":"(\u1109)","\u3214":"(\uC0AC)","\u3207":"(\u110B)","\u3215":"(\uC544)","\u321D":"(\uC624\uC804)","\u321E":"(\uC624\uD6C4)","\u3208":"(\u110C)","\u3216":"(\uC790)","\u321C":"(\uC8FC)","\u3209":"(\u110E)","\u3217":"(\uCC28)","\u320A":"(\u110F)","\u3218":"(\uCE74)","\u320B":"(\u1110)","\u3219":"(\uD0C0)","\u320C":"(\u1111)","\u321A":"(\uD30C)","\u320D":"(\u1112)","\u321B":"(\uD558)","\u3226":"(\u4E03)","\u3222":"(\u4E09)","\u{1F241}":"(\u4E09)","\u3228":"(\u4E5D)","\u3221":"(\u4E8C)","\u{1F242}":"(\u4E8C)","\u3224":"(\u4E94)","\u3239":"(\u4EE3)","\u323D":"(\u4F01)","\u3241":"(\u4F11)","\u3227":"(\u516B)","\u3225":"(\u516D)","\u3238":"(\u52B4)","\u{1F247}":"(\u52DD)","\u3229":"(\u5341)","\u323F":"(\u5354)","\u3234":"(\u540D)","\u323A":"(\u547C)","\u3223":"(\u56DB)","\u322F":"(\u571F)","\u323B":"(\u5B66)","\u{1F243}":"(\u5B89)","\u{1F245}":"(\u6253)","\u{1F248}":"(\u6557)","\u3230":"(\u65E5)","\u322A":"(\u6708)","\u3232":"(\u6709)","\u322D":"(\u6728)","\u{1F240}":"(\u672C)","\u3231":"(\u682A)","\u322C":"(\u6C34)","\u322B":"(\u706B)","\u{1F244}":"(\u70B9)","\u3235":"(\u7279)","\u{1F246}":"(\u76D7)","\u323C":"(\u76E3)","\u3233":"(\u793E)","\u3237":"(\u795D)","\u3240":"(\u796D)","\u3242":"(\u81EA)","\u3243":"(\u81F3)","\u3236":"(\u8CA1)","\u323E":"(\u8CC7)","\u322E":"(\u91D1)","\uFF3D":")","\u2769":")","\u2773":")","\u3015":")","\uFD3F":")","\u2E29":"))","\u2774":"{","\u{1D114}":"{","\u2775":"}","\u301A":"\u27E6","\u301B":"\u27E7","\u27E8":"\u276C","\u2329":"\u276C","\u3008":"\u276C","\u31DB":"\u276C",\u304F:"\u276C","\u{21FE8}":"\u276C","\u27E9":"\u276D","\u232A":"\u276D","\u3009":"\u276D","\uFF3E":"\uFE3F","\u2E3F":"\xB6","\u204E":"*","\u066D":"*","\u2217":"*","\u{1031F}":"*","\u1735":"/","\u2041":"/","\u2215":"/","\u2044":"/","\u2571":"/","\u27CB":"/","\u29F8":"/","\u{1D23A}":"/","\u31D3":"/",\u3033:"/","\u2CC6":"/",\u30CE:"/",\u4E3F:"/","\u2F03":"/","\u29F6":"/\u0304","\u2AFD":"//","\u2AFB":"///","\uFF3C":"\\","\uFE68":"\\","\u2216":"\\","\u27CD":"\\","\u29F5":"\\","\u29F9":"\\","\u{1D20F}":"\\","\u{1D23B}":"\\","\u31D4":"\\",\u4E36:"\\","\u2F02":"\\","\u2CF9":"\\\\","\u244A":"\\\\","\u27C8":"\\\u1455","\uA778":"&","\u0AF0":"\u0970","\u{110BB}":"\u0970","\u{111C7}":"\u0970","\u26AC":"\u0970","\u{111DB}":"\uA8FC","\u17D9":"\u0E4F","\u17D5":"\u0E5A","\u17DA":"\u0E5B","\u0F0C":"\u0F0B","\u0F0E":"\u0F0D\u0F0D","\u02C4":"^","\u02C6":"^","\uA67E":"\u02C7","\u02D8":"\u02C7","\u203E":"\u02C9","\uFE49":"\u02C9","\uFE4A":"\u02C9","\uFE4B":"\u02C9","\uFE4C":"\u02C9","\xAF":"\u02C9","\uFFE3":"\u02C9","\u2594":"\u02C9",\u044A:"\u02C9b","\uA651":"\u02C9bi","\u0375":"\u02CF","\u02FB":"\u02EA","\uA716":"\u02EA","\uA714":"\u02EB","\u3002":"\u02F3","\u2E30":"\xB0","\u02DA":"\xB0","\u2218":"\xB0","\u25CB":"\xB0","\u25E6":"\xB0","\u235C":"\xB0\u0332","\u2364":"\xB0\u0308","\u2103":"\xB0C","\u2109":"\xB0F","\u0BF5":"\u0BF3","\u0F1B":"\u0F1A\u0F1A","\u0F1F":"\u0F1A\u0F1D","\u0FCE":"\u0F1D\u0F1A","\u0F1E":"\u0F1D\u0F1D","\u24B8":"\xA9","\u24C7":"\xAE","\u24C5":"\u2117","\u{1D21B}":"\u2144","\u2BEC":"\u219E","\u2BED":"\u219F","\u2BEE":"\u21A0","\u2BEF":"\u21A1","\u21B5":"\u21B2","\u2965":"\u21C3\u21C2","\u296F":"\u21C3\u16DA","\u{1D6DB}":"\u2202","\u{1D715}":"\u2202","\u{1D74F}":"\u2202","\u{1D789}":"\u2202","\u{1D7C3}":"\u2202","\u{1E8CC}":"\u2202","\u{1E8CD}":"\u2202\u0335",\u00F0:"\u2202\u0335","\u2300":"\u2205","\u{1D6C1}":"\u2207","\u{1D6FB}":"\u2207","\u{1D735}":"\u2207","\u{1D76F}":"\u2207","\u{1D7A9}":"\u2207","\u{118A8}":"\u2207","\u2362":"\u2207\u0308","\u236B":"\u2207\u0334","\u2588":"\u220E","\u25A0":"\u220E","\u2A3F":"\u2210","\u16ED":"+","\u2795":"+","\u{1029B}":"+","\u2A23":"+\u0302","\u2A22":"+\u030A","\u2A24":"+\u0303","\u2214":"+\u0307","\u2A25":"+\u0323","\u2A26":"+\u0330","\u2A27":"+\u2082","\u2797":"\xF7","\u2039":"<","\u276E":"<","\u02C2":"<","\u{1D236}":"<",\u1438:"<",\u16B2:"<","\u22D6":"<\xB7","\u2CB4":"<\xB7",\u1445:"<\xB7","\u226A":"<<","\u22D8":"<<<","\u1400":"=","\u2E40":"=","\u30A0":"=","\uA4FF":"=","\u225A":"=\u0306","\u2259":"=\u0302","\u2257":"=\u030A","\u2250":"=\u0307","\u2251":"=\u0307\u0323","\u2A6E":"=\u20F0","\u2A75":"==","\u2A76":"===","\u225E":"=\u036B","\u203A":">","\u276F":">","\u02C3":">","\u{1D237}":">",\u1433:">","\u{16F3F}":">",\u1441:">\xB7","\u2AA5":"><","\u226B":">>","\u2A20":">>","\u22D9":">>>","\u2053":"~","\u02DC":"~","\u1FC0":"~","\u223C":"~","\u2368":"~\u0308","\u2E1E":"~\u0307","\u2A6A":"~\u0307","\u2E1F":"~\u0323","\u{1E8C8}":"\u2220","\u22C0":"\u2227","\u222F":"\u222E\u222E","\u2230":"\u222E\u222E\u222E","\u2E2B":"\u2234","\u2E2A":"\u2235","\u2E2C":"\u2237","\u{111DE}":"\u2248","\u264E":"\u224F","\u{1F75E}":"\u224F","\u2263":"\u2261","\u2A03":"\u228D","\u2A04":"\u228E","\u{1D238}":"\u228F","\u{1D239}":"\u2290","\u2A05":"\u2293","\u2A06":"\u2294","\u2A02":"\u2297","\u235F":"\u229B","\u{1F771}":"\u22A0","\u{1F755}":"\u22A1","\u25C1":"\u22B2","\u25B7":"\u22B3","\u2363":"\u22C6\u0308","\uFE34":"\u2307","\u25E0":"\u2312","\u2A3D":"\u2319","\u2325":"\u2324","\u29C7":"\u233B","\u25CE":"\u233E","\u29BE":"\u233E","\u29C5":"\u2342","\u29B0":"\u2349","\u23C3":"\u234B","\u23C2":"\u234E","\u23C1":"\u2355","\u23C6":"\u236D","\u2638":"\u2388","\uFE35":"\u23DC","\uFE36":"\u23DD","\uFE37":"\u23DE","\uFE38":"\u23DF","\uFE39":"\u23E0","\uFE3A":"\u23E1","\u25B1":"\u23E5","\u23FC":"\u23FB","\uFE31":"\u2502","\uFF5C":"\u2502","\u2503":"\u2502","\u250F":"\u250C","\u2523":"\u251C","\u2590":"\u258C","\u2597":"\u2596","\u259D":"\u2598","\u2610":"\u25A1","\uFFED":"\u25AA","\u25B8":"\u25B6","\u25BA":"\u25B6","\u2CE9":"\u2627","\u{1F70A}":"\u2629","\u{1F312}":"\u263D","\u{1F319}":"\u263D","\u23FE":"\u263E","\u{1F318}":"\u263E","\u29D9":"\u299A","\u{1F73A}":"\u29DF","\u2A3E":"\u2A1F","\u{101A0}":"\u2CE8","\u2669":"\u{1D158}\u{1D165}","\u266A":"\u{1D158}\u{1D165}\u{1D16E}","\u24EA":"\u{1F10D}","\u21BA":"\u{1F10E}","\u02D9":"\u0971","\u0D4E":"\u0971","\uFF0D":"\u30FC","\u2014":"\u30FC","\u2015":"\u30FC","\u2500":"\u30FC","\u2501":"\u30FC","\u31D0":"\u30FC","\uA7F7":"\u30FC",\u1173:"\u30FC",\u3161:"\u30FC",\u4E00:"\u30FC","\u2F00":"\u30FC",\u1196:"\u30FC\u30FC","\uD7B9":"\u30FC\u1161","\uD7BA":"\u30FC\u1165","\uD7BB":"\u30FC\u1165\u4E28","\uD7BC":"\u30FC\u1169",\u1195:"\u30FC\u116E",\u1174:"\u30FC\u4E28",\u3162:"\u30FC\u4E28",\u1197:"\u30FC\u4E28\u116E","\u{1F10F}":"$\u20E0","\u20A4":"\xA3","\u3012":"\u20B8","\u3036":"\u20B8","\u1B5C":"\u1B50","\uA9C6":"\uA9D0","\u{114D1}":"\u09E7","\u0CE7":"\u0C67","\u1065":"\u1041","\u2460":"\u2780","\u2469":"\u2789","\u23E8":"\u2081\u2080","\u{1D7D0}":"2","\u{1D7DA}":"2","\u{1D7E4}":"2","\u{1D7EE}":"2","\u{1D7F8}":"2","\u{1FBF2}":"2","\uA75A":"2",\u01A7:"2",\u03E8:"2","\uA644":"2",\u14BF:"2","\uA6EF":"2","\uA9CF":"\u0662","\u06F2":"\u0662","\u0AE8":"\u0968","\u{114D2}":"\u09E8","\u0CE8":"\u0C68","\u2461":"\u2781",\u01BB:"2\u0335","\u{1F103}":"2,","\u2489":"2.","\u33F5":"22\u65E5","\u336E":"22\u70B9","\u33F6":"23\u65E5","\u336F":"23\u70B9","\u33F7":"24\u65E5","\u3370":"24\u70B9","\u33F8":"25\u65E5","\u33F9":"26\u65E5","\u33FA":"27\u65E5","\u33FB":"28\u65E5","\u33FC":"29\u65E5","\u33F4":"2l\u65E5","\u336D":"2l\u70B9","\u249B":"2O.","\u33F3":"2O\u65E5","\u336C":"2O\u70B9","\u0DE9":"\u0DE8\u0DCF","\u0DEF":"\u0DE8\u0DD3","\u33E1":"2\u65E5","\u32C1":"2\u6708","\u335A":"2\u70B9","\u{1D206}":"3","\u{1D7D1}":"3","\u{1D7DB}":"3","\u{1D7E5}":"3","\u{1D7EF}":"3","\u{1D7F9}":"3","\u{1FBF3}":"3","\uA7AB":"3",\u021C:"3",\u01B7:"3","\uA76A":"3","\u2CCC":"3",\u0417:"3",\u04E0:"3","\u{16F3B}":"3","\u{118CA}":"3","\u06F3":"\u0663","\u{1E8C9}":"\u0663","\u0AE9":"\u0969","\u2462":"\u2782",\u0498:"3\u0326","\u{1F104}":"3,","\u248A":"3.","\u33FE":"3l\u65E5","\u33FD":"3O\u65E5","\u33E2":"3\u65E5","\u32C2":"3\u6708","\u335B":"3\u70B9","\u{1D7D2}":"4","\u{1D7DC}":"4","\u{1D7E6}":"4","\u{1D7F0}":"4","\u{1D7FA}":"4","\u{1FBF4}":"4",\u13CE:"4","\u{118AF}":"4","\u06F4":"\u0664","\u0AEA":"\u096A","\u2463":"\u2783","\u{1F105}":"4,","\u248B":"4.",\u1530:"4\xB7","\u33E3":"4\u65E5","\u32C3":"4\u6708","\u335C":"4\u70B9","\u{1D7D3}":"5","\u{1D7DD}":"5","\u{1D7E7}":"5","\u{1D7F1}":"5","\u{1D7FB}":"5","\u{1FBF5}":"5",\u01BC:"5","\u{118BB}":"5","\u2464":"\u2784","\u{1F106}":"5,","\u248C":"5.","\u33E4":"5\u65E5","\u32C4":"5\u6708","\u335D":"5\u70B9","\u{1D7D4}":"6","\u{1D7DE}":"6","\u{1D7E8}":"6","\u{1D7F2}":"6","\u{1D7FC}":"6","\u{1FBF6}":"6","\u2CD2":"6",\u0431:"6",\u13EE:"6","\u{118D5}":"6","\u06F6":"\u0666","\u{114D6}":"\u09EC","\u2465":"\u2785","\u{1F107}":"6,","\u248D":"6.","\u33E5":"6\u65E5","\u32C5":"6\u6708","\u335E":"6\u70B9","\u{1D212}":"7","\u{1D7D5}":"7","\u{1D7DF}":"7","\u{1D7E9}":"7","\u{1D7F3}":"7","\u{1D7FD}":"7","\u{1FBF7}":"7","\u{104D2}":"7","\u{118C6}":"7","\u2466":"\u2786","\u{1F108}":"7,","\u248E":"7.","\u33E6":"7\u65E5","\u32C6":"7\u6708","\u335F":"7\u70B9","\u0B03":"8","\u09EA":"8","\u0A6A":"8","\u{1E8CB}":"8","\u{1D7D6}":"8","\u{1D7E0}":"8","\u{1D7EA}":"8","\u{1D7F4}":"8","\u{1D7FE}":"8","\u{1FBF8}":"8",\u0223:"8",\u0222:"8","\u{1031A}":"8","\u0AEE":"\u096E","\u2467":"\u2787","\u{1F109}":"8,","\u248F":"8.","\u33E7":"8\u65E5","\u32C7":"8\u6708","\u3360":"8\u70B9","\u0A67":"9","\u0B68":"9","\u09ED":"9","\u0D6D":"9","\u{1D7D7}":"9","\u{1D7E1}":"9","\u{1D7EB}":"9","\u{1D7F5}":"9","\u{1D7FF}":"9","\u{1FBF9}":"9","\uA76E":"9","\u2CCA":"9","\u{118CC}":"9","\u{118AC}":"9","\u{118D6}":"9","\u0967":"\u0669","\u{118E4}":"\u0669","\u06F9":"\u0669","\u0CEF":"\u0C6F","\u2468":"\u2788","\u{1F10A}":"9,","\u2490":"9.","\u33E8":"9\u65E5","\u32C8":"9\u6708","\u3361":"9\u70B9","\u237A":"a",\uFF41:"a","\u{1D41A}":"a","\u{1D44E}":"a","\u{1D482}":"a","\u{1D4B6}":"a","\u{1D4EA}":"a","\u{1D51E}":"a","\u{1D552}":"a","\u{1D586}":"a","\u{1D5BA}":"a","\u{1D5EE}":"a","\u{1D622}":"a","\u{1D656}":"a","\u{1D68A}":"a",\u0251:"a",\u03B1:"a","\u{1D6C2}":"a","\u{1D6FC}":"a","\u{1D736}":"a","\u{1D770}":"a","\u{1D7AA}":"a",\u0430:"a","\u2DF6":"\u0363",\uFF21:"A","\u{1D400}":"A","\u{1D434}":"A","\u{1D468}":"A","\u{1D49C}":"A","\u{1D4D0}":"A","\u{1D504}":"A","\u{1D538}":"A","\u{1D56C}":"A","\u{1D5A0}":"A","\u{1D5D4}":"A","\u{1D608}":"A","\u{1D63C}":"A","\u{1D670}":"A",\u0391:"A","\u{1D6A8}":"A","\u{1D6E2}":"A","\u{1D71C}":"A","\u{1D756}":"A","\u{1D790}":"A",\u0410:"A",\u13AA:"A",\u15C5:"A","\uA4EE":"A","\u{16F40}":"A","\u{102A0}":"A","\u2376":"a\u0332",\u01CE:"\u0103",\u01CD:"\u0102",\u0227:"\xE5",\u0226:"\xC5",\u1E9A:"\u1EA3","\u2100":"a/c","\u2101":"a/s","\uA733":"aa","\uA732":"AA",\u00E6:"ae",\u04D5:"ae",\u00C6:"AE",\u04D4:"AE","\uA735":"ao","\uA734":"AO","\u{1F707}":"AR","\uA737":"au","\uA736":"AU","\uA739":"av","\uA73B":"av","\uA738":"AV","\uA73A":"AV","\uA73D":"ay","\uA73C":"AY","\uAB7A":"\u1D00","\u2200":"\u2C6F","\u{1D217}":"\u2C6F",\u15C4:"\u2C6F","\uA4EF":"\u2C6F","\u{1041F}":"\u2C70","\u{1D41B}":"b","\u{1D44F}":"b","\u{1D483}":"b","\u{1D4B7}":"b","\u{1D4EB}":"b","\u{1D51F}":"b","\u{1D553}":"b","\u{1D587}":"b","\u{1D5BB}":"b","\u{1D5EF}":"b","\u{1D623}":"b","\u{1D657}":"b","\u{1D68B}":"b",\u0184:"b",\u042C:"b",\u13CF:"b",\u1472:"b",\u15AF:"b",\uFF22:"B",\u212C:"B","\u{1D401}":"B","\u{1D435}":"B","\u{1D469}":"B","\u{1D4D1}":"B","\u{1D505}":"B","\u{1D539}":"B","\u{1D56D}":"B","\u{1D5A1}":"B","\u{1D5D5}":"B","\u{1D609}":"B","\u{1D63D}":"B","\u{1D671}":"B","\uA7B4":"B",\u0392:"B","\u{1D6A9}":"B","\u{1D6E3}":"B","\u{1D71D}":"B","\u{1D757}":"B","\u{1D791}":"B",\u0412:"B",\u13F4:"B",\u15F7:"B","\uA4D0":"B","\u{10282}":"B","\u{102A1}":"B","\u{10301}":"B",\u0253:"b\u0314",\u1473:"b\u0307",\u0183:"b\u0304",\u0182:"b\u0304",\u0411:"b\u0304",\u0180:"b\u0335",\u048D:"b\u0335",\u048C:"b\u0335",\u0463:"b\u0335",\u0462:"b\u0335",\u147F:"b\xB7",\u1481:"b\u0307\xB7",\u1488:"b'",\u042B:"bl",\u0432:"\u0299","\u13FC":"\u0299",\uFF43:"c","\u217D":"c","\u{1D41C}":"c","\u{1D450}":"c","\u{1D484}":"c","\u{1D4B8}":"c","\u{1D4EC}":"c","\u{1D520}":"c","\u{1D554}":"c","\u{1D588}":"c","\u{1D5BC}":"c","\u{1D5F0}":"c","\u{1D624}":"c","\u{1D658}":"c","\u{1D68C}":"c","\u1D04":"c",\u03F2:"c","\u2CA5":"c",\u0441:"c","\uABAF":"c","\u{1043D}":"c","\u2DED":"\u0368","\u{1F74C}":"C","\u{118F2}":"C","\u{118E9}":"C",\uFF23:"C","\u216D":"C",\u2102:"C",\u212D:"C","\u{1D402}":"C","\u{1D436}":"C","\u{1D46A}":"C","\u{1D49E}":"C","\u{1D4D2}":"C","\u{1D56E}":"C","\u{1D5A2}":"C","\u{1D5D6}":"C","\u{1D60A}":"C","\u{1D63E}":"C","\u{1D672}":"C","\u03F9":"C","\u2CA4":"C",\u0421:"C",\u13DF:"C","\uA4DA":"C","\u{102A2}":"C","\u{10302}":"C","\u{10415}":"C","\u{1051C}":"C","\xA2":"c\u0338","\u023C":"c\u0338","\u20A1":"C\u20EB","\u{1F16E}":"C\u20E0",\u00E7:"c\u0326",\u04AB:"c\u0326",\u00C7:"C\u0326",\u04AA:"C\u0326",\u0187:"C'","\u2105":"c/o","\u2106":"c/u","\u{1F16D}":"\u33C4 \u20DD","\u22F4":"\uA793",\u025B:"\uA793",\u03B5:"\uA793","\u03F5":"\uA793","\u{1D6C6}":"\uA793","\u{1D6DC}":"\uA793","\u{1D700}":"\uA793","\u{1D716}":"\uA793","\u{1D73A}":"\uA793","\u{1D750}":"\uA793","\u{1D774}":"\uA793","\u{1D78A}":"\uA793","\u{1D7AE}":"\uA793","\u{1D7C4}":"\uA793","\u2C89":"\uA793",\u0454:"\uA793","\u0511":"\uA793","\uAB9B":"\uA793","\u{118CE}":"\uA793","\u{10429}":"\uA793","\u20AC":"\uA792","\u2C88":"\uA792",\u0404:"\uA792","\u2377":"\uA793\u0332","\u037D":"\uA73F","\u03FF":"\uA73E","\u217E":"d","\u2146":"d","\u{1D41D}":"d","\u{1D451}":"d","\u{1D485}":"d","\u{1D4B9}":"d","\u{1D4ED}":"d","\u{1D521}":"d","\u{1D555}":"d","\u{1D589}":"d","\u{1D5BD}":"d","\u{1D5F1}":"d","\u{1D625}":"d","\u{1D659}":"d","\u{1D68D}":"d","\u0501":"d",\u13E7:"d",\u146F:"d","\uA4D2":"d","\u216E":"D","\u2145":"D","\u{1D403}":"D","\u{1D437}":"D","\u{1D46B}":"D","\u{1D49F}":"D","\u{1D4D3}":"D","\u{1D507}":"D","\u{1D53B}":"D","\u{1D56F}":"D","\u{1D5A3}":"D","\u{1D5D7}":"D","\u{1D60B}":"D","\u{1D63F}":"D","\u{1D673}":"D",\u13A0:"D",\u15DE:"D",\u15EA:"D","\uA4D3":"D",\u0257:"d\u0314",\u0256:"d\u0328",\u018C:"d\u0304",\u0111:"d\u0335",\u0110:"D\u0335",\u00D0:"D\u0335",\u0189:"D\u0335","\u20AB":"d\u0335\u0331","\uA77A":"\uA779",\u147B:"d\xB7",\u1487:"d'",\u02A4:"d\u021D",\u01F3:"dz",\u02A3:"dz",\u01F2:"Dz",\u01F1:"DZ",\u01C6:"d\u017E",\u01C5:"D\u017E",\u01C4:"D\u017D",\u02A5:"d\u0291","\uAB70":"\u1D05","\u2E39":"\u1E9F",\u03B4:"\u1E9F","\u{1D6C5}":"\u1E9F","\u{1D6FF}":"\u1E9F","\u{1D739}":"\u1E9F","\u{1D773}":"\u1E9F","\u{1D7AD}":"\u1E9F",\u056E:"\u1E9F",\u1577:"\u1E9F","\u212E":"e",\uFF45:"e",\u212F:"e","\u2147":"e","\u{1D41E}":"e","\u{1D452}":"e","\u{1D486}":"e","\u{1D4EE}":"e","\u{1D522}":"e","\u{1D556}":"e","\u{1D58A}":"e","\u{1D5BE}":"e","\u{1D5F2}":"e","\u{1D626}":"e","\u{1D65A}":"e","\u{1D68E}":"e","\uAB32":"e",\u0435:"e",\u04BD:"e","\u2DF7":"\u0364","\u22FF":"E",\uFF25:"E",\u2130:"E","\u{1D404}":"E","\u{1D438}":"E","\u{1D46C}":"E","\u{1D4D4}":"E","\u{1D508}":"E","\u{1D53C}":"E","\u{1D570}":"E","\u{1D5A4}":"E","\u{1D5D8}":"E","\u{1D60C}":"E","\u{1D640}":"E","\u{1D674}":"E",\u0395:"E","\u{1D6AC}":"E","\u{1D6E6}":"E","\u{1D720}":"E","\u{1D75A}":"E","\u{1D794}":"E",\u0415:"E","\u2D39":"E",\u13AC:"E","\uA4F0":"E","\u{118A6}":"E","\u{118AE}":"E","\u{10286}":"E",\u011B:"\u0115",\u011A:"\u0114","\u0247":"e\u0338","\u0246":"E\u0338",\u04BF:"e\u0328","\uAB7C":"\u1D07",\u0259:"\u01DD",\u04D9:"\u01DD","\u2203":"\u018E","\u2D3A":"\u018E","\uA4F1":"\u018E",\u025A:"\u01DD\u02DE","\u1D14":"\u01DDo","\uAB41":"\u01DDo\u0338","\uAB42":"\u01DDo\u0335",\u04D8:"\u018F","\u{1D221}":"\u0190",\u2107:"\u0190","\u0510":"\u0190",\u13CB:"\u0190","\u{16F2D}":"\u0190","\u{10401}":"\u0190","\u1D9F":"\u1D4B","\u1D08":"\u025C",\u0437:"\u025C",\u0499:"\u025C\u0326","\u{10442}":"\u025E","\uA79D":"\u029A","\u{1042A}":"\u029A","\u{1D41F}":"f","\u{1D453}":"f","\u{1D487}":"f","\u{1D4BB}":"f","\u{1D4EF}":"f","\u{1D523}":"f","\u{1D557}":"f","\u{1D58B}":"f","\u{1D5BF}":"f","\u{1D5F3}":"f","\u{1D627}":"f","\u{1D65B}":"f","\u{1D68F}":"f","\uAB35":"f","\uA799":"f",\u017F:"f","\u1E9D":"f",\u0584:"f","\u{1D213}":"F",\u2131:"F","\u{1D405}":"F","\u{1D439}":"F","\u{1D46D}":"F","\u{1D4D5}":"F","\u{1D509}":"F","\u{1D53D}":"F","\u{1D571}":"F","\u{1D5A5}":"F","\u{1D5D9}":"F","\u{1D60D}":"F","\u{1D641}":"F","\u{1D675}":"F","\uA798":"F",\u03DC:"F","\u{1D7CA}":"F",\u15B4:"F","\uA4DD":"F","\u{118C2}":"F","\u{118A2}":"F","\u{10287}":"F","\u{102A5}":"F","\u{10525}":"F",\u0192:"f\u0326",\u0191:"F\u0326","\u1D6E":"f\u0334","\u213B":"FAX",\uFB00:"ff",\uFB03:"ffi",\uFB04:"ffl",\uFB01:"fi",\uFB02:"fl",\u02A9:"f\u014B",\u15B5:"\u2132","\uA4DE":"\u2132","\u{1D230}":"\uA7FB",\u15B7:"\uA7FB",\uFF47:"g",\u210A:"g","\u{1D420}":"g","\u{1D454}":"g","\u{1D488}":"g","\u{1D4F0}":"g","\u{1D524}":"g","\u{1D558}":"g","\u{1D58C}":"g","\u{1D5C0}":"g","\u{1D5F4}":"g","\u{1D628}":"g","\u{1D65C}":"g","\u{1D690}":"g",\u0261:"g","\u1D83":"g",\u018D:"g",\u0581:"g","\u{1D406}":"G","\u{1D43A}":"G","\u{1D46E}":"G","\u{1D4A2}":"G","\u{1D4D6}":"G","\u{1D50A}":"G","\u{1D53E}":"G","\u{1D572}":"G","\u{1D5A6}":"G","\u{1D5DA}":"G","\u{1D60E}":"G","\u{1D642}":"G","\u{1D676}":"G","\u050C":"G",\u13C0:"G",\u13F3:"G","\uA4D6":"G","\u1DA2":"\u1D4D",\u0260:"g\u0314",\u01E7:"\u011F",\u01E6:"\u011E",\u01F5:"\u0123",\u01E5:"g\u0335",\u01E4:"G\u0335",\u0193:"G'","\u050D":"\u0262","\uAB90":"\u0262","\u13FB":"\u0262",\uFF48:"h",\u210E:"h","\u{1D421}":"h","\u{1D489}":"h","\u{1D4BD}":"h","\u{1D4F1}":"h","\u{1D525}":"h","\u{1D559}":"h","\u{1D58D}":"h","\u{1D5C1}":"h","\u{1D5F5}":"h","\u{1D629}":"h","\u{1D65D}":"h","\u{1D691}":"h",\u04BB:"h",\u0570:"h",\u13C2:"h",\uFF28:"H",\u210B:"H",\u210C:"H",\u210D:"H","\u{1D407}":"H","\u{1D43B}":"H","\u{1D46F}":"H","\u{1D4D7}":"H","\u{1D573}":"H","\u{1D5A7}":"H","\u{1D5DB}":"H","\u{1D60F}":"H","\u{1D643}":"H","\u{1D677}":"H",\u0397:"H","\u{1D6AE}":"H","\u{1D6E8}":"H","\u{1D722}":"H","\u{1D75C}":"H","\u{1D796}":"H","\u2C8E":"H",\u041D:"H",\u13BB:"H",\u157C:"H","\uA4E7":"H","\u{102CF}":"H","\u1D78":"\u1D34",\u0266:"h\u0314","\uA695":"h\u0314",\u13F2:"h\u0314","\u2C67":"H\u0329",\u04A2:"H\u0329",\u0127:"h\u0335",\u210F:"h\u0335",\u045B:"h\u0335",\u0126:"H\u0335","\u04C9":"H\u0326",\u04C7:"H\u0326",\u043D:"\u029C","\uAB8B":"\u029C",\u04A3:"\u029C\u0329","\u04CA":"\u029C\u0326",\u04C8:"\u029C\u0326","\u050A":"\u01F6","\uAB80":"\u2C76","\u0370":"\u2C75",\u13A8:"\u2C75",\u13B0:"\u2C75","\uA6B1":"\u2C75","\uA795":"\uA727","\u02DB":"i","\u2373":"i",\uFF49:"i","\u2170":"i",\u2139:"i","\u2148":"i","\u{1D422}":"i","\u{1D456}":"i","\u{1D48A}":"i","\u{1D4BE}":"i","\u{1D4F2}":"i","\u{1D526}":"i","\u{1D55A}":"i","\u{1D58E}":"i","\u{1D5C2}":"i","\u{1D5F6}":"i","\u{1D62A}":"i","\u{1D65E}":"i","\u{1D692}":"i",\u0131:"i","\u{1D6A4}":"i",\u026A:"i",\u0269:"i",\u03B9:"i",\u1FBE:"i",\u037A:"i","\u{1D6CA}":"i","\u{1D704}":"i","\u{1D73E}":"i","\u{1D778}":"i","\u{1D7B2}":"i",\u0456:"i","\uA647":"i","\u04CF":"i","\uAB75":"i",\u13A5:"i","\u{118C3}":"i","\u24DB":"\u24BE","\u2378":"i\u0332",\u01D0:"\u012D",\u01CF:"\u012C",\u0268:"i\u0335","\u1D7B":"i\u0335","\u1D7C":"i\u0335","\u2171":"ii","\u2172":"iii",\u0133:"ij","\u2173":"iv","\u2178":"ix",\uFF4A:"j","\u2149":"j","\u{1D423}":"j","\u{1D457}":"j","\u{1D48B}":"j","\u{1D4BF}":"j","\u{1D4F3}":"j","\u{1D527}":"j","\u{1D55B}":"j","\u{1D58F}":"j","\u{1D5C3}":"j","\u{1D5F7}":"j","\u{1D62B}":"j","\u{1D65F}":"j","\u{1D693}":"j",\u03F3:"j",\u0458:"j",\uFF2A:"J","\u{1D409}":"J","\u{1D43D}":"J","\u{1D471}":"J","\u{1D4A5}":"J","\u{1D4D9}":"J","\u{1D50D}":"J","\u{1D541}":"J","\u{1D575}":"J","\u{1D5A9}":"J","\u{1D5DD}":"J","\u{1D611}":"J","\u{1D645}":"J","\u{1D679}":"J","\uA7B2":"J","\u037F":"J",\u0408:"J",\u13AB:"J",\u148D:"J","\uA4D9":"J","\u0249":"j\u0335","\u0248":"J\u0335",\u1499:"J\xB7","\u{1D6A5}":"\u0237",\u0575:"\u0237","\uAB7B":"\u1D0A","\u{1D424}":"k","\u{1D458}":"k","\u{1D48C}":"k","\u{1D4C0}":"k","\u{1D4F4}":"k","\u{1D528}":"k","\u{1D55C}":"k","\u{1D590}":"k","\u{1D5C4}":"k","\u{1D5F8}":"k","\u{1D62C}":"k","\u{1D660}":"k","\u{1D694}":"k",\u212A:"K",\uFF2B:"K","\u{1D40A}":"K","\u{1D43E}":"K","\u{1D472}":"K","\u{1D4A6}":"K","\u{1D4DA}":"K","\u{1D50E}":"K","\u{1D542}":"K","\u{1D576}":"K","\u{1D5AA}":"K","\u{1D5DE}":"K","\u{1D612}":"K","\u{1D646}":"K","\u{1D67A}":"K",\u039A:"K","\u{1D6B1}":"K","\u{1D6EB}":"K","\u{1D725}":"K","\u{1D75F}":"K","\u{1D799}":"K","\u2C94":"K",\u041A:"K",\u13E6:"K",\u16D5:"K","\uA4D7":"K","\u{10518}":"K",\u0199:"k\u0314","\u2C69":"K\u0329",\u049A:"K\u0329","\u20AD":"K\u0335","\uA740":"K\u0335",\u049E:"K\u0335",\u0198:"K'","\u05C0":"l","|":"l","\u2223":"l","\u23FD":"l","\uFFE8":"l","\u0661":"l","\u06F1":"l","\u{10320}":"l","\u{1E8C7}":"l","\u{1D7CF}":"l","\u{1D7D9}":"l","\u{1D7E3}":"l","\u{1D7ED}":"l","\u{1D7F7}":"l","\u{1FBF1}":"l",I:"l",\uFF29:"l","\u2160":"l",\u2110:"l",\u2111:"l","\u{1D408}":"l","\u{1D43C}":"l","\u{1D470}":"l","\u{1D4D8}":"l","\u{1D540}":"l","\u{1D574}":"l","\u{1D5A8}":"l","\u{1D5DC}":"l","\u{1D610}":"l","\u{1D644}":"l","\u{1D678}":"l",\u0196:"l",\uFF4C:"l","\u217C":"l",\u2113:"l","\u{1D425}":"l","\u{1D459}":"l","\u{1D48D}":"l","\u{1D4C1}":"l","\u{1D4F5}":"l","\u{1D529}":"l","\u{1D55D}":"l","\u{1D591}":"l","\u{1D5C5}":"l","\u{1D5F9}":"l","\u{1D62D}":"l","\u{1D661}":"l","\u{1D695}":"l",\u01C0:"l",\u0399:"l","\u{1D6B0}":"l","\u{1D6EA}":"l","\u{1D724}":"l","\u{1D75E}":"l","\u{1D798}":"l","\u2C92":"l",\u0406:"l",\u04C0:"l",\u05D5:"l",\u05DF:"l",\u0627:"l","\u{1EE00}":"l","\u{1EE80}":"l",\uFE8E:"l",\uFE8D:"l","\u07CA":"l","\u2D4F":"l",\u16C1:"l","\uA4F2":"l","\u{16F28}":"l","\u{1028A}":"l","\u{10309}":"l","\u{1D22A}":"L","\u216C":"L",\u2112:"L","\u{1D40B}":"L","\u{1D43F}":"L","\u{1D473}":"L","\u{1D4DB}":"L","\u{1D50F}":"L","\u{1D543}":"L","\u{1D577}":"L","\u{1D5AB}":"L","\u{1D5DF}":"L","\u{1D613}":"L","\u{1D647}":"L","\u{1D67B}":"L","\u2CD0":"L",\u13DE:"L",\u14AA:"L","\uA4E1":"L","\u{16F16}":"L","\u{118A3}":"L","\u{118B2}":"L","\u{1041B}":"L","\u{10526}":"L",\uFD3C:"l\u030B",\uFD3D:"l\u030B",\u0142:"l\u0338",\u0141:"L\u0338",\u026D:"l\u0328",\u0197:"l\u0335",\u019A:"l\u0335",\u026B:"l\u0334",\u0625:"l\u0655",\uFE88:"l\u0655",\uFE87:"l\u0655",\u0673:"l\u0655",\u0140:"l\xB7",\u013F:"l\xB7",\u14B7:"l\xB7","\u{1F102}":"l,","\u2488":"l.",\u05F1:"l'","\u2493":"l2.","\u33EB":"l2\u65E5","\u32CB":"l2\u6708","\u3364":"l2\u70B9","\u2494":"l3.","\u33EC":"l3\u65E5","\u3365":"l3\u70B9","\u2495":"l4.","\u33ED":"l4\u65E5","\u3366":"l4\u70B9","\u2496":"l5.","\u33EE":"l5\u65E5","\u3367":"l5\u70B9","\u2497":"l6.","\u33EF":"l6\u65E5","\u3368":"l6\u70B9","\u2498":"l7.","\u33F0":"l7\u65E5","\u3369":"l7\u70B9","\u2499":"l8.","\u33F1":"l8\u65E5","\u336A":"l8\u70B9","\u249A":"l9.","\u33F2":"l9\u65E5","\u336B":"l9\u70B9",\u01C9:"lj",\u0132:"lJ",\u01C8:"Lj",\u01C7:"LJ","\u2016":"ll","\u2225":"ll","\u2161":"ll",\u01C1:"ll",\u05F0:"ll","\u{10199}":"l\u0335l\u0335","\u2492":"ll.","\u2162":"lll","\u{10198}":"l\u0335l\u0335S\u0335","\u33EA":"ll\u65E5","\u32CA":"ll\u6708","\u3363":"ll\u70B9",\u042E:"lO","\u2491":"lO.","\u33E9":"lO\u65E5","\u32C9":"lO\u6708","\u3362":"lO\u70B9",\u02AA:"ls","\u20B6":"lt","\u2163":"lV","\u2168":"lX",\u026E:"l\u021D",\u02AB:"lz",\u0623:"l\u0674",\uFE84:"l\u0674",\uFE83:"l\u0674",\u0672:"l\u0674",\u0675:"l\u0674",\uFDF3:"l\u0643\u0628\u0631",\uFDF2:"l\u0644\u0644\u0651\u0670o","\u33E0":"l\u65E5","\u32C0":"l\u6708","\u3359":"l\u70B9","\u2CD1":"\u029F","\uABAE":"\u029F","\u{10443}":"\u029F",\uFF2D:"M","\u216F":"M",\u2133:"M","\u{1D40C}":"M","\u{1D440}":"M","\u{1D474}":"M","\u{1D4DC}":"M","\u{1D510}":"M","\u{1D544}":"M","\u{1D578}":"M","\u{1D5AC}":"M","\u{1D5E0}":"M","\u{1D614}":"M","\u{1D648}":"M","\u{1D67C}":"M",\u039C:"M","\u{1D6B3}":"M","\u{1D6ED}":"M","\u{1D727}":"M","\u{1D761}":"M","\u{1D79B}":"M","\u03FA":"M","\u2C98":"M",\u041C:"M",\u13B7:"M",\u15F0:"M",\u16D6:"M","\uA4DF":"M","\u{102B0}":"M","\u{10311}":"M","\u04CD":"M\u0326","\u{1F76B}":"MB","\u2DE8":"\u1DDF","\u{1D427}":"n","\u{1D45B}":"n","\u{1D48F}":"n","\u{1D4C3}":"n","\u{1D4F7}":"n","\u{1D52B}":"n","\u{1D55F}":"n","\u{1D593}":"n","\u{1D5C7}":"n","\u{1D5FB}":"n","\u{1D62F}":"n","\u{1D663}":"n","\u{1D697}":"n",\u0578:"n",\u057C:"n",\uFF2E:"N",\u2115:"N","\u{1D40D}":"N","\u{1D441}":"N","\u{1D475}":"N","\u{1D4A9}":"N","\u{1D4DD}":"N","\u{1D511}":"N","\u{1D579}":"N","\u{1D5AD}":"N","\u{1D5E1}":"N","\u{1D615}":"N","\u{1D649}":"N","\u{1D67D}":"N",\u039D:"N","\u{1D6B4}":"N","\u{1D6EE}":"N","\u{1D728}":"N","\u{1D762}":"N","\u{1D79C}":"N","\u2C9A":"N","\uA4E0":"N","\u{10513}":"N","\u{1018E}":"N\u030A",\u0273:"n\u0328",\u019E:"n\u0329",\u03B7:"n\u0329","\u{1D6C8}":"n\u0329","\u{1D702}":"n\u0329","\u{1D73C}":"n\u0329","\u{1D776}":"n\u0329","\u{1D7B0}":"n\u0329",\u019D:"N\u0326","\u1D70":"n\u0334",\u01CC:"nj",\u01CB:"Nj",\u01CA:"NJ","\u2116":"No","\u0377":"\u1D0E",\u0438:"\u1D0E","\u{1044D}":"\u1D0E",\u0146:"\u0272","\u0C02":"o","\u0C82":"o","\u0D02":"o","\u0D82":"o","\u0966":"o","\u0A66":"o","\u0AE6":"o","\u0BE6":"o","\u0C66":"o","\u0CE6":"o","\u0D66":"o","\u0E50":"o","\u0ED0":"o","\u1040":"o","\u0665":"o","\u06F5":"o",\uFF4F:"o",\u2134:"o","\u{1D428}":"o","\u{1D45C}":"o","\u{1D490}":"o","\u{1D4F8}":"o","\u{1D52C}":"o","\u{1D560}":"o","\u{1D594}":"o","\u{1D5C8}":"o","\u{1D5FC}":"o","\u{1D630}":"o","\u{1D664}":"o","\u{1D698}":"o","\u1D0F":"o","\u1D11":"o","\uAB3D":"o",\u03BF:"o","\u{1D6D0}":"o","\u{1D70A}":"o","\u{1D744}":"o","\u{1D77E}":"o","\u{1D7B8}":"o",\u03C3:"o","\u{1D6D4}":"o","\u{1D70E}":"o","\u{1D748}":"o","\u{1D782}":"o","\u{1D7BC}":"o","\u2C9F":"o",\u043E:"o","\u10FF":"o",\u0585:"o",\u05E1:"o",\u0647:"o","\u{1EE24}":"o","\u{1EE64}":"o","\u{1EE84}":"o",\uFEEB:"o",\uFEEC:"o",\uFEEA:"o",\uFEE9:"o",\u06BE:"o",\uFBAC:"o",\uFBAD:"o",\uFBAB:"o",\uFBAA:"o",\u06C1:"o",\uFBA8:"o",\uFBA9:"o",\uFBA7:"o",\uFBA6:"o",\u06D5:"o",\u0D20:"o",\u101D:"o","\u{104EA}":"o","\u{118C8}":"o","\u{118D7}":"o","\u{1042C}":"o","\u07C0":"O","\u09E6":"O","\u0B66":"O","\u3007":"O","\u{114D0}":"O","\u{118E0}":"O","\u{1D7CE}":"O","\u{1D7D8}":"O","\u{1D7E2}":"O","\u{1D7EC}":"O","\u{1D7F6}":"O","\u{1FBF0}":"O",\uFF2F:"O","\u{1D40E}":"O","\u{1D442}":"O","\u{1D476}":"O","\u{1D4AA}":"O","\u{1D4DE}":"O","\u{1D512}":"O","\u{1D546}":"O","\u{1D57A}":"O","\u{1D5AE}":"O","\u{1D5E2}":"O","\u{1D616}":"O","\u{1D64A}":"O","\u{1D67E}":"O",\u039F:"O","\u{1D6B6}":"O","\u{1D6F0}":"O","\u{1D72A}":"O","\u{1D764}":"O","\u{1D79E}":"O","\u2C9E":"O",\u041E:"O",\u0555:"O","\u2D54":"O",\u12D0:"O",\u0B20:"O","\u{104C2}":"O","\uA4F3":"O","\u{118B5}":"O","\u{10292}":"O","\u{102AB}":"O","\u{10404}":"O","\u{10516}":"O","\u2070":"\xBA","\u1D52":"\xBA",\u01D2:"\u014F",\u01D1:"\u014E","\u06FF":"o\u0302",\u0150:"\xD6",\u00F8:"o\u0338","\uAB3E":"o\u0338",\u00D8:"O\u0338","\u2D41":"O\u0338",\u01FE:"O\u0338\u0301",\u0275:"o\u0335","\uA74B":"o\u0335",\u04E9:"o\u0335",\u0473:"o\u0335","\uAB8E":"o\u0335","\uABBB":"o\u0335","\u2296":"O\u0335","\u229D":"O\u0335","\u236C":"O\u0335","\u{1D21A}":"O\u0335","\u{1F714}":"O\u0335",\u019F:"O\u0335","\uA74A":"O\u0335",\u03B8:"O\u0335",\u03D1:"O\u0335","\u{1D6C9}":"O\u0335","\u{1D6DD}":"O\u0335","\u{1D703}":"O\u0335","\u{1D717}":"O\u0335","\u{1D73D}":"O\u0335","\u{1D751}":"O\u0335","\u{1D777}":"O\u0335","\u{1D78B}":"O\u0335","\u{1D7B1}":"O\u0335","\u{1D7C5}":"O\u0335",\u0398:"O\u0335","\u03F4":"O\u0335","\u{1D6AF}":"O\u0335","\u{1D6B9}":"O\u0335","\u{1D6E9}":"O\u0335","\u{1D6F3}":"O\u0335","\u{1D723}":"O\u0335","\u{1D72D}":"O\u0335","\u{1D75D}":"O\u0335","\u{1D767}":"O\u0335","\u{1D797}":"O\u0335","\u{1D7A1}":"O\u0335",\u04E8:"O\u0335",\u0472:"O\u0335","\u2D31":"O\u0335",\u13BE:"O\u0335",\u13EB:"O\u0335","\uAB74":"o\u031B",\uFCD9:"o\u0670","\u{1F101}":"O,","\u{1F100}":"O.",\u01A1:"o'",\u01A0:"O'",\u13A4:"O'","%":"\xBA/\u2080","\u066A":"\xBA/\u2080","\u2052":"\xBA/\u2080","\u2030":"\xBA/\u2080\u2080","\u0609":"\xBA/\u2080\u2080","\u2031":"\xBA/\u2080\u2080\u2080","\u060A":"\xBA/\u2080\u2080\u2080",\u0153:"oe",\u0152:"OE",\u0276:"o\u1D07","\u221E":"oo","\uA74F":"oo","\uA699":"oo","\uA74E":"OO","\uA698":"OO",\uFCD7:"o\u062C",\uFC51:"o\u062C",\uFCD8:"o\u0645",\uFC52:"o\u0645",\uFD93:"o\u0645\u062C",\uFD94:"o\u0645\u0645",\uFC53:"o\u0649",\uFC54:"o\u0649","\u0D5F":"o\u0D30o",\u1010:"o\u102C","\u3358":"O\u70B9","\u2184":"\u0254","\u1D10":"\u0254","\u037B":"\u0254","\u{1044B}":"\u0254","\u2183":"\u0186","\u03FD":"\u0186","\uA4DB":"\u0186","\u{10423}":"\u0186","\uAB3F":"\u0254\u0338","\uAB62":"\u0254e","\u{1043F}":"\u0277","\u2374":"p",\uFF50:"p","\u{1D429}":"p","\u{1D45D}":"p","\u{1D491}":"p","\u{1D4C5}":"p","\u{1D4F9}":"p","\u{1D52D}":"p","\u{1D561}":"p","\u{1D595}":"p","\u{1D5C9}":"p","\u{1D5FD}":"p","\u{1D631}":"p","\u{1D665}":"p","\u{1D699}":"p",\u03C1:"p",\u03F1:"p","\u{1D6D2}":"p","\u{1D6E0}":"p","\u{1D70C}":"p","\u{1D71A}":"p","\u{1D746}":"p","\u{1D754}":"p","\u{1D780}":"p","\u{1D78E}":"p","\u{1D7BA}":"p","\u{1D7C8}":"p","\u2CA3":"p",\u0440:"p",\uFF30:"P",\u2119:"P","\u{1D40F}":"P","\u{1D443}":"P","\u{1D477}":"P","\u{1D4AB}":"P","\u{1D4DF}":"P","\u{1D513}":"P","\u{1D57B}":"P","\u{1D5AF}":"P","\u{1D5E3}":"P","\u{1D617}":"P","\u{1D64B}":"P","\u{1D67F}":"P",\u03A1:"P","\u{1D6B8}":"P","\u{1D6F2}":"P","\u{1D72C}":"P","\u{1D766}":"P","\u{1D7A0}":"P","\u2CA2":"P",\u0420:"P",\u13E2:"P",\u146D:"P","\uA4D1":"P","\u{10295}":"P",\u01A5:"p\u0314","\u1D7D":"p\u0335",\u1477:"p\xB7",\u1486:"P'","\u1D29":"\u1D18","\uABB2":"\u1D18",\u03C6:"\u0278",\u03D5:"\u0278","\u{1D6D7}":"\u0278","\u{1D6DF}":"\u0278","\u{1D711}":"\u0278","\u{1D719}":"\u0278","\u{1D74B}":"\u0278","\u{1D753}":"\u0278","\u{1D785}":"\u0278","\u{1D78D}":"\u0278","\u{1D7BF}":"\u0278","\u{1D7C7}":"\u0278","\u2CAB":"\u0278",\u0444:"\u0278","\u{1D42A}":"q","\u{1D45E}":"q","\u{1D492}":"q","\u{1D4C6}":"q","\u{1D4FA}":"q","\u{1D52E}":"q","\u{1D562}":"q","\u{1D596}":"q","\u{1D5CA}":"q","\u{1D5FE}":"q","\u{1D632}":"q","\u{1D666}":"q","\u{1D69A}":"q","\u051B":"q",\u0563:"q",\u0566:"q",\u211A:"Q","\u{1D410}":"Q","\u{1D444}":"Q","\u{1D478}":"Q","\u{1D4AC}":"Q","\u{1D4E0}":"Q","\u{1D514}":"Q","\u{1D57C}":"Q","\u{1D5B0}":"Q","\u{1D5E4}":"Q","\u{1D618}":"Q","\u{1D64C}":"Q","\u{1D680}":"Q","\u2D55":"Q",\u02A0:"q\u0314","\u{1F700}":"QE","\u1D90":"\u024B","\u1D0B":"\u0138",\u03BA:"\u0138",\u03F0:"\u0138","\u{1D6CB}":"\u0138","\u{1D6DE}":"\u0138","\u{1D705}":"\u0138","\u{1D718}":"\u0138","\u{1D73F}":"\u0138","\u{1D752}":"\u0138","\u{1D779}":"\u0138","\u{1D78C}":"\u0138","\u{1D7B3}":"\u0138","\u{1D7C6}":"\u0138","\u2C95":"\u0138",\u043A:"\u0138","\uABB6":"\u0138",\u049B:"\u0138\u0329",\u049F:"\u0138\u0335","\u{1D42B}":"r","\u{1D45F}":"r","\u{1D493}":"r","\u{1D4C7}":"r","\u{1D4FB}":"r","\u{1D52F}":"r","\u{1D563}":"r","\u{1D597}":"r","\u{1D5CB}":"r","\u{1D5FF}":"r","\u{1D633}":"r","\u{1D667}":"r","\u{1D69B}":"r","\uAB47":"r","\uAB48":"r","\u1D26":"r","\u2C85":"r",\u0433:"r","\uAB81":"r","\u{1D216}":"R",\u211B:"R",\u211C:"R",\u211D:"R","\u{1D411}":"R","\u{1D445}":"R","\u{1D479}":"R","\u{1D4E1}":"R","\u{1D57D}":"R","\u{1D5B1}":"R","\u{1D5E5}":"R","\u{1D619}":"R","\u{1D64D}":"R","\u{1D681}":"R",\u01A6:"R",\u13A1:"R",\u13D2:"R","\u{104B4}":"R",\u1587:"R","\uA4E3":"R","\u{16F35}":"R",\u027D:"r\u0328",\u027C:"r\u0329","\u024D":"r\u0335",\u0493:"r\u0335","\u1D72":"r\u0334",\u0491:"r'","\u{118E3}":"rn",m:"rn","\u217F":"rn","\u{1D426}":"rn","\u{1D45A}":"rn","\u{1D48E}":"rn","\u{1D4C2}":"rn","\u{1D4F6}":"rn","\u{1D52A}":"rn","\u{1D55E}":"rn","\u{1D592}":"rn","\u{1D5C6}":"rn","\u{1D5FA}":"rn","\u{1D62E}":"rn","\u{1D662}":"rn","\u{1D696}":"rn","\u{11700}":"rn","\u20A5":"rn\u0338",\u0271:"rn\u0326","\u1D6F":"rn\u0334","\u20A8":"Rs","\uAB71":"\u0280","\uABA2":"\u0280",\u044F:"\u1D19","\u1D73":"\u027E\u0334","\u2129":"\u027F",\uFF53:"s","\u{1D42C}":"s","\u{1D460}":"s","\u{1D494}":"s","\u{1D4C8}":"s","\u{1D4FC}":"s","\u{1D530}":"s","\u{1D564}":"s","\u{1D598}":"s","\u{1D5CC}":"s","\u{1D600}":"s","\u{1D634}":"s","\u{1D668}":"s","\u{1D69C}":"s","\uA731":"s",\u01BD:"s",\u0455:"s","\uABAA":"s","\u{118C1}":"s","\u{10448}":"s",\uFF33:"S","\u{1D412}":"S","\u{1D446}":"S","\u{1D47A}":"S","\u{1D4AE}":"S","\u{1D4E2}":"S","\u{1D516}":"S","\u{1D54A}":"S","\u{1D57E}":"S","\u{1D5B2}":"S","\u{1D5E6}":"S","\u{1D61A}":"S","\u{1D64E}":"S","\u{1D682}":"S",\u0405:"S",\u054F:"S",\u13D5:"S",\u13DA:"S","\uA4E2":"S","\u{16F3A}":"S","\u{10296}":"S","\u{10420}":"S",\u0282:"s\u0328","\u1D74":"s\u0334","\uA7B5":"\xDF",\u03B2:"\xDF",\u03D0:"\xDF","\u{1D6C3}":"\xDF","\u{1D6FD}":"\xDF","\u{1D737}":"\xDF","\u{1D771}":"\xDF","\u{1D7AB}":"\xDF",\u13F0:"\xDF","\u{1F75C}":"sss",\uFB06:"st","\u222B":"\u0283","\uAB4D":"\u0283","\u2211":"\u01A9","\u2140":"\u01A9",\u03A3:"\u01A9","\u{1D6BA}":"\u01A9","\u{1D6F4}":"\u01A9","\u{1D72E}":"\u01A9","\u{1D768}":"\u01A9","\u{1D7A2}":"\u01A9","\u2D49":"\u01A9","\u222C":"\u0283\u0283","\u222D":"\u0283\u0283\u0283","\u2A0C":"\u0283\u0283\u0283\u0283","\u{1D42D}":"t","\u{1D461}":"t","\u{1D495}":"t","\u{1D4C9}":"t","\u{1D4FD}":"t","\u{1D531}":"t","\u{1D565}":"t","\u{1D599}":"t","\u{1D5CD}":"t","\u{1D601}":"t","\u{1D635}":"t","\u{1D669}":"t","\u{1D69D}":"t","\u22A4":"T","\u27D9":"T","\u{1F768}":"T",\uFF34:"T","\u{1D413}":"T","\u{1D447}":"T","\u{1D47B}":"T","\u{1D4AF}":"T","\u{1D4E3}":"T","\u{1D517}":"T","\u{1D54B}":"T","\u{1D57F}":"T","\u{1D5B3}":"T","\u{1D5E7}":"T","\u{1D61B}":"T","\u{1D64F}":"T","\u{1D683}":"T",\u03A4:"T","\u{1D6BB}":"T","\u{1D6F5}":"T","\u{1D72F}":"T","\u{1D769}":"T","\u{1D7A3}":"T","\u2CA6":"T",\u0422:"T",\u13A2:"T","\uA4D4":"T","\u{16F0A}":"T","\u{118BC}":"T","\u{10297}":"T","\u{102B1}":"T","\u{10315}":"T",\u01AD:"t\u0314","\u2361":"T\u0308","\u023E":"T\u0338",\u021A:"\u0162",\u01AE:"T\u0328",\u04AC:"T\u0329","\u20AE":"T\u20EB",\u0167:"t\u0335",\u0166:"T\u0335","\u1D75":"t\u0334",\u10A0:"\uA786","\uA728":"T3",\u02A8:"t\u0255","\u2121":"TEL","\uA777":"tf",\u02A6:"ts",\u02A7:"t\u0283","\uA729":"t\u021D",\u03C4:"\u1D1B","\u{1D6D5}":"\u1D1B","\u{1D70F}":"\u1D1B","\u{1D749}":"\u1D1B","\u{1D783}":"\u1D1B","\u{1D7BD}":"\u1D1B",\u0442:"\u1D1B","\uAB72":"\u1D1B",\u04AD:"\u1D1B\u0329",\u0163:"\u01AB",\u021B:"\u01AB",\u13BF:"\u01AB","\u{1D42E}":"u","\u{1D462}":"u","\u{1D496}":"u","\u{1D4CA}":"u","\u{1D4FE}":"u","\u{1D532}":"u","\u{1D566}":"u","\u{1D59A}":"u","\u{1D5CE}":"u","\u{1D602}":"u","\u{1D636}":"u","\u{1D66A}":"u","\u{1D69E}":"u","\uA79F":"u","\u1D1C":"u","\uAB4E":"u","\uAB52":"u",\u028B:"u",\u03C5:"u","\u{1D6D6}":"u","\u{1D710}":"u","\u{1D74A}":"u","\u{1D784}":"u","\u{1D7BE}":"u",\u057D:"u","\u{104F6}":"u","\u{118D8}":"u","\u222A":"U","\u22C3":"U","\u{1D414}":"U","\u{1D448}":"U","\u{1D47C}":"U","\u{1D4B0}":"U","\u{1D4E4}":"U","\u{1D518}":"U","\u{1D54C}":"U","\u{1D580}":"U","\u{1D5B4}":"U","\u{1D5E8}":"U","\u{1D61C}":"U","\u{1D650}":"U","\u{1D684}":"U",\u054D:"U",\u1200:"U","\u{104CE}":"U",\u144C:"U","\uA4F4":"U","\u{16F42}":"U","\u{118B8}":"U",\u01D4:"\u016D",\u01D3:"\u016C","\u1D7E":"u\u0335","\uAB9C":"u\u0335","\u0244":"U\u0335",\u13CC:"U\u0335",\u1458:"U\xB7",\u1467:"U'","\u1D6B":"ue","\uAB63":"uo",\u1E43:"\uAB51",\u057A:"\u0270",\u1223:"\u0270","\u2127":"\u01B1",\u162E:"\u01B1",\u1634:"\u01B1","\u1D7F":"\u028A\u0335","\u2228":"v","\u22C1":"v",\uFF56:"v","\u2174":"v","\u{1D42F}":"v","\u{1D463}":"v","\u{1D497}":"v","\u{1D4CB}":"v","\u{1D4FF}":"v","\u{1D533}":"v","\u{1D567}":"v","\u{1D59B}":"v","\u{1D5CF}":"v","\u{1D603}":"v","\u{1D637}":"v","\u{1D66B}":"v","\u{1D69F}":"v","\u1D20":"v",\u03BD:"v","\u{1D6CE}":"v","\u{1D708}":"v","\u{1D742}":"v","\u{1D77C}":"v","\u{1D7B6}":"v",\u0475:"v",\u05D8:"v","\u{11706}":"v","\uABA9":"v","\u{118C0}":"v","\u{1D20D}":"V","\u0667":"V","\u06F7":"V","\u2164":"V","\u{1D415}":"V","\u{1D449}":"V","\u{1D47D}":"V","\u{1D4B1}":"V","\u{1D4E5}":"V","\u{1D519}":"V","\u{1D54D}":"V","\u{1D581}":"V","\u{1D5B5}":"V","\u{1D5E9}":"V","\u{1D61D}":"V","\u{1D651}":"V","\u{1D685}":"V",\u0474:"V","\u2D38":"V",\u13D9:"V",\u142F:"V","\uA6DF":"V","\uA4E6":"V","\u{16F08}":"V","\u{118A0}":"V","\u{1051D}":"V","\u{10197}":"V\u0335",\u143B:"V\xB7","\u{1F76C}":"VB","\u2175":"vi","\u2176":"vii","\u2177":"viii","\u2165":"Vl","\u2166":"Vll","\u2167":"Vlll","\u{1F708}":"V\u1DE4","\u1D27":"\u028C","\u{104D8}":"\u028C","\u0668":"\u0245","\u06F8":"\u0245",\u039B:"\u0245","\u{1D6B2}":"\u0245","\u{1D6EC}":"\u0245","\u{1D726}":"\u0245","\u{1D760}":"\u0245","\u{1D79A}":"\u0245",\u041B:"\u0245","\u2D37":"\u0245","\u{104B0}":"\u0245",\u1431:"\u0245","\uA6CE":"\u0245","\uA4E5":"\u0245","\u{16F3D}":"\u0245","\u{1028D}":"\u0245","\u04C5":"\u0245\u0326",\u143D:"\u0245\xB7",\u026F:"w","\u{1D430}":"w","\u{1D464}":"w","\u{1D498}":"w","\u{1D4CC}":"w","\u{1D500}":"w","\u{1D534}":"w","\u{1D568}":"w","\u{1D59C}":"w","\u{1D5D0}":"w","\u{1D604}":"w","\u{1D638}":"w","\u{1D66C}":"w","\u{1D6A0}":"w","\u1D21":"w",\u0461:"w","\u051D":"w",\u0561:"w","\u{1170A}":"w","\u{1170E}":"w","\u{1170F}":"w","\uAB83":"w","\u{118EF}":"W","\u{118E6}":"W","\u{1D416}":"W","\u{1D44A}":"W","\u{1D47E}":"W","\u{1D4B2}":"W","\u{1D4E6}":"W","\u{1D51A}":"W","\u{1D54E}":"W","\u{1D582}":"W","\u{1D5B6}":"W","\u{1D5EA}":"W","\u{1D61E}":"W","\u{1D652}":"W","\u{1D686}":"W","\u051C":"W",\u13B3:"W",\u13D4:"W","\uA4EA":"W",\u047D:"w\u0486\u0487","\u{114C5}":"w\u0307","\u20A9":"W\u0335","\uA761":"w\u0326","\u1D0D":"\u028D",\u043C:"\u028D","\uAB87":"\u028D","\u04CE":"\u028D\u0326","\u166E":"x","\xD7":"x","\u292B":"x","\u292C":"x","\u2A2F":"x",\uFF58:"x","\u2179":"x","\u{1D431}":"x","\u{1D465}":"x","\u{1D499}":"x","\u{1D4CD}":"x","\u{1D501}":"x","\u{1D535}":"x","\u{1D569}":"x","\u{1D59D}":"x","\u{1D5D1}":"x","\u{1D605}":"x","\u{1D639}":"x","\u{1D66D}":"x","\u{1D6A1}":"x",\u0445:"x",\u1541:"x",\u157D:"x","\u2DEF":"\u036F","\u166D":"X","\u2573":"X","\u{10322}":"X","\u{118EC}":"X",\uFF38:"X","\u2169":"X","\u{1D417}":"X","\u{1D44B}":"X","\u{1D47F}":"X","\u{1D4B3}":"X","\u{1D4E7}":"X","\u{1D51B}":"X","\u{1D54F}":"X","\u{1D583}":"X","\u{1D5B7}":"X","\u{1D5EB}":"X","\u{1D61F}":"X","\u{1D653}":"X","\u{1D687}":"X","\uA7B3":"X",\u03A7:"X","\u{1D6BE}":"X","\u{1D6F8}":"X","\u{1D732}":"X","\u{1D76C}":"X","\u{1D7A6}":"X","\u2CAC":"X",\u0425:"X","\u2D5D":"X",\u16B7:"X","\uA4EB":"X","\u{10290}":"X","\u{102B4}":"X","\u{10317}":"X","\u{10527}":"X","\u2A30":"x\u0307",\u04B2:"X\u0329","\u{10196}":"X\u0335","\u217A":"xi","\u217B":"xii","\u216A":"Xl","\u216B":"Xll",\u0263:"y","\u1D8C":"y",\uFF59:"y","\u{1D432}":"y","\u{1D466}":"y","\u{1D49A}":"y","\u{1D4CE}":"y","\u{1D502}":"y","\u{1D536}":"y","\u{1D56A}":"y","\u{1D59E}":"y","\u{1D5D2}":"y","\u{1D606}":"y","\u{1D63A}":"y","\u{1D66E}":"y","\u{1D6A2}":"y",\u028F:"y","\u1EFF":"y","\uAB5A":"y",\u03B3:"y","\u213D":"y","\u{1D6C4}":"y","\u{1D6FE}":"y","\u{1D738}":"y","\u{1D772}":"y","\u{1D7AC}":"y",\u0443:"y",\u04AF:"y",\u10E7:"y","\u{118DC}":"y",\uFF39:"Y","\u{1D418}":"Y","\u{1D44C}":"Y","\u{1D480}":"Y","\u{1D4B4}":"Y","\u{1D4E8}":"Y","\u{1D51C}":"Y","\u{1D550}":"Y","\u{1D584}":"Y","\u{1D5B8}":"Y","\u{1D5EC}":"Y","\u{1D620}":"Y","\u{1D654}":"Y","\u{1D688}":"Y",\u03A5:"Y",\u03D2:"Y","\u{1D6BC}":"Y","\u{1D6F6}":"Y","\u{1D730}":"Y","\u{1D76A}":"Y","\u{1D7A4}":"Y","\u2CA8":"Y",\u0423:"Y",\u04AE:"Y",\u13A9:"Y",\u13BD:"Y","\uA4EC":"Y","\u{16F43}":"Y","\u{118A4}":"Y","\u{102B2}":"Y",\u01B4:"y\u0314","\u024F":"y\u0335",\u04B1:"y\u0335","\xA5":"Y\u0335","\u024E":"Y\u0335",\u04B0:"Y\u0335",\u0292:"\u021D","\uA76B":"\u021D","\u2CCD":"\u021D",\u04E1:"\u021D",\u10F3:"\u021D","\u{1D433}":"z","\u{1D467}":"z","\u{1D49B}":"z","\u{1D4CF}":"z","\u{1D503}":"z","\u{1D537}":"z","\u{1D56B}":"z","\u{1D59F}":"z","\u{1D5D3}":"z","\u{1D607}":"z","\u{1D63B}":"z","\u{1D66F}":"z","\u{1D6A3}":"z","\u1D22":"z","\uAB93":"z","\u{118C4}":"z","\u{102F5}":"Z","\u{118E5}":"Z",\uFF3A:"Z",\u2124:"Z",\u2128:"Z","\u{1D419}":"Z","\u{1D44D}":"Z","\u{1D481}":"Z","\u{1D4B5}":"Z","\u{1D4E9}":"Z","\u{1D585}":"Z","\u{1D5B9}":"Z","\u{1D5ED}":"Z","\u{1D621}":"Z","\u{1D655}":"Z","\u{1D689}":"Z",\u0396:"Z","\u{1D6AD}":"Z","\u{1D6E7}":"Z","\u{1D721}":"Z","\u{1D75B}":"Z","\u{1D795}":"Z",\u13C3:"Z","\uA4DC":"Z","\u{118A9}":"Z",\u0290:"z\u0328",\u01B6:"z\u0335",\u01B5:"Z\u0335",\u0225:"z\u0326",\u0224:"Z\u0326","\u1D76":"z\u0334",\u01BF:"\xFE","\u03F8":"\xFE","\u03F7":"\xDE","\u{104C4}":"\xDE","\u2079":"\uA770","\u1D24":"\u01A8",\u03E9:"\u01A8","\uA645":"\u01A8",\u044C:"\u0185","\uAB9F":"\u0185",\u044B:"\u0185i","\uAB7E":"\u0242",\u02E4:"\u02C1","\uA6CD":"\u02A1","\u2299":"\u0298","\u2609":"\u0298","\u2A00":"\u0298","\uA668":"\u0298","\u2D59":"\u0298","\u{104C3}":"\u0298","\u213E":"\u0393","\u{1D6AA}":"\u0393","\u{1D6E4}":"\u0393","\u{1D71E}":"\u0393","\u{1D758}":"\u0393","\u{1D792}":"\u0393","\u2C84":"\u0393",\u0413:"\u0393",\u13B1:"\u0393",\u14A5:"\u0393","\u{16F07}":"\u0393",\u0492:"\u0393\u0335",\u14AF:"\u0393\xB7",\u0490:"\u0393'","\u2206":"\u0394","\u25B3":"\u0394","\u{1F702}":"\u0394","\u{1D6AB}":"\u0394","\u{1D6E5}":"\u0394","\u{1D71F}":"\u0394","\u{1D759}":"\u0394","\u{1D793}":"\u0394","\u2C86":"\u0394","\u2D60":"\u0394",\u1403:"\u0394","\u{16F1A}":"\u0394","\u{10285}":"\u0394","\u{102A3}":"\u0394","\u2359":"\u0394\u0332",\u140F:"\u0394\xB7",\u142C:"\u0394\u1420","\u{1D7CB}":"\u03DD","\u{1D6C7}":"\u03B6","\u{1D701}":"\u03B6","\u{1D73B}":"\u03B6","\u{1D775}":"\u03B6","\u{1D7AF}":"\u03B6","\u2CE4":"\u03D7","\u{1D6CC}":"\u03BB","\u{1D706}":"\u03BB","\u{1D740}":"\u03BB","\u{1D77A}":"\u03BB","\u{1D7B4}":"\u03BB","\u2C96":"\u03BB","\u{104DB}":"\u03BB",\u00B5:"\u03BC","\u{1D6CD}":"\u03BC","\u{1D707}":"\u03BC","\u{1D741}":"\u03BC","\u{1D77B}":"\u03BC","\u{1D7B5}":"\u03BC","\u{1D6CF}":"\u03BE","\u{1D709}":"\u03BE","\u{1D743}":"\u03BE","\u{1D77D}":"\u03BE","\u{1D7B7}":"\u03BE","\u{1D6B5}":"\u039E","\u{1D6EF}":"\u039E","\u{1D729}":"\u039E","\u{1D763}":"\u039E","\u{1D79D}":"\u039E",\u03D6:"\u03C0","\u213C":"\u03C0","\u{1D6D1}":"\u03C0","\u{1D6E1}":"\u03C0","\u{1D70B}":"\u03C0","\u{1D71B}":"\u03C0","\u{1D745}":"\u03C0","\u{1D755}":"\u03C0","\u{1D77F}":"\u03C0","\u{1D78F}":"\u03C0","\u{1D7B9}":"\u03C0","\u{1D7C9}":"\u03C0","\u1D28":"\u03C0",\u043F:"\u03C0","\u220F":"\u03A0","\u213F":"\u03A0","\u{1D6B7}":"\u03A0","\u{1D6F1}":"\u03A0","\u{1D72B}":"\u03A0","\u{1D765}":"\u03A0","\u{1D79F}":"\u03A0","\u2CA0":"\u03A0",\u041F:"\u03A0","\uA6DB":"\u03A0","\u{102AD}":"\u03D8","\u{10312}":"\u03D8",\u03DB:"\u03C2","\u{1D6D3}":"\u03C2","\u{1D70D}":"\u03C2","\u{1D747}":"\u03C2","\u{1D781}":"\u03C2","\u{1D7BB}":"\u03C2","\u{1D6BD}":"\u03A6","\u{1D6F7}":"\u03A6","\u{1D731}":"\u03A6","\u{1D76B}":"\u03A6","\u{1D7A5}":"\u03A6","\u2CAA":"\u03A6",\u0424:"\u03A6",\u0553:"\u03A6",\u1240:"\u03A6","\u16F0":"\u03A6","\u{102B3}":"\u03A6","\uAB53":"\u03C7","\uAB55":"\u03C7","\u{1D6D8}":"\u03C7","\u{1D712}":"\u03C7","\u{1D74C}":"\u03C7","\u{1D786}":"\u03C7","\u{1D7C0}":"\u03C7","\u2CAD":"\u03C7","\u{1D6D9}":"\u03C8","\u{1D713}":"\u03C8","\u{1D74D}":"\u03C8","\u{1D787}":"\u03C8","\u{1D7C1}":"\u03C8",\u0471:"\u03C8","\u{104F9}":"\u03C8","\u{1D6BF}":"\u03A8","\u{1D6F9}":"\u03A8","\u{1D733}":"\u03A8","\u{1D76D}":"\u03A8","\u{1D7A7}":"\u03A8","\u2CAE":"\u03A8",\u0470:"\u03A8","\u{104D1}":"\u03A8",\u16D8:"\u03A8","\u{102B5}":"\u03A8","\u2375":"\u03C9","\uA7B7":"\u03C9","\u{1D6DA}":"\u03C9","\u{1D714}":"\u03C9","\u{1D74E}":"\u03C9","\u{1D788}":"\u03C9","\u{1D7C2}":"\u03C9","\u2CB1":"\u03C9","\uA64D":"\u03C9",\u2126:"\u03A9","\u{1D6C0}":"\u03A9","\u{1D6FA}":"\u03A9","\u{1D734}":"\u03A9","\u{1D76E}":"\u03A9","\u{1D7A8}":"\u03A9",\u162F:"\u03A9",\u1635:"\u03A9","\u{102B6}":"\u03A9","\u2379":"\u03C9\u0332",\u1F7D:"\u1FF4","\u2630":"\u2CB6","\u2CDC":"\u03EC",\u0497:"\u0436\u0329",\u0496:"\u0416\u0329","\u{1D20B}":"\u0418","\u0376":"\u0418","\uA6A1":"\u0418","\u{10425}":"\u0418",\u0419:"\u040D","\u048A":"\u040D\u0326",\u045D:"\u0439","\u048B":"\u0439\u0326","\u{104BC}":"\u04C3","\u1D2B":"\u043B","\u04C6":"\u043B\u0326","\uAB60":"\u0459","\u{104EB}":"\uA669","\u1DEE":"\u2DEC","\u{104CD}":"\u040B","\u{1D202}":"\u04FE","\u{1D222}":"\u0460",\u13C7:"\u0460",\u15EF:"\u0460",\u047C:"\u0460\u0486\u0487","\u18ED":"\u0460\xB7","\uA7B6":"\uA64C",\u04CC:"\u04B7",\u04CB:"\u04B6",\u04BE:"\u04BC\u0328","\u2CBD":"\u0448","\u2CBC":"\u0428","\uA650":"\u042Al","\u2108":"\u042D","\u{1F701}":"\uA658","\u{16F1C}":"\uA658","\uA992":"\u2C3F",\u0587:"\u0565\u0582",\u1294:"\u0571",\uFB14:"\u0574\u0565",\uFB15:"\u0574\u056B",\uFB17:"\u0574\u056D",\uFB13:"\u0574\u0576","\u2229":"\u0548","\u22C2":"\u0548","\u{1D245}":"\u0548",\u1260:"\u0548",\u144E:"\u0548","\uA4F5":"\u0548",\u145A:"\u0548\xB7",\u1468:"\u0548'",\uFB16:"\u057E\u0576","\u20BD":"\u0554","\u02D3":"\u0559",\u02BF:"\u0559",\u2135:"\u05D0",\uFB21:"\u05D0",\uFB2F:"\uFB2E",\uFB30:"\uFB2E",\uFB4F:"\u05D0\u05DC",\u2136:"\u05D1",\u2137:"\u05D2",\u2138:"\u05D3",\uFB22:"\u05D3",\uFB23:"\u05D4",\uFB39:"\uFB1D",\uFB24:"\u05DB",\uFB25:"\u05DC",\uFB26:"\u05DD",\uFB20:"\u05E2",\uFB27:"\u05E8",\uFB2B:"\uFB2A",\uFB49:"\uFB2A",\uFB2D:"\uFB2C",\uFB28:"\u05EA",\uFE80:"\u0621","\u06FD":"\u0621\u0348",\uFE82:"\u0622",\uFE81:"\u0622",\uFB51:"\u0671",\uFB50:"\u0671","\u{1EE01}":"\u0628","\u{1EE21}":"\u0628","\u{1EE61}":"\u0628","\u{1EE81}":"\u0628","\u{1EEA1}":"\u0628",\uFE91:"\u0628",\uFE92:"\u0628",\uFE90:"\u0628",\uFE8F:"\u0628","\u0751":"\u0628\u06DB","\u08B6":"\u0628\u06E2","\u08A1":"\u0628\u0654",\uFCA0:"\u0628o",\uFCE2:"\u0628o",\uFC9C:"\u0628\u062C",\uFC05:"\u0628\u062C",\uFC9D:"\u0628\u062D",\uFC06:"\u0628\u062D",\uFDC2:"\u0628\u062D\u0649",\uFC9E:"\u0628\u062E",\uFC07:"\u0628\u062E",\uFCD2:"\u0628\u062E",\uFC4B:"\u0628\u062E",\uFD9E:"\u0628\u062E\u0649",\uFC6A:"\u0628\u0631",\uFC6B:"\u0628\u0632",\uFC9F:"\u0628\u0645",\uFCE1:"\u0628\u0645",\uFC6C:"\u0628\u0645",\uFC08:"\u0628\u0645",\uFC6D:"\u0628\u0646",\uFC6E:"\u0628\u0649",\uFC09:"\u0628\u0649",\uFC6F:"\u0628\u0649",\uFC0A:"\u0628\u0649",\uFB54:"\u067B",\uFB55:"\u067B",\uFB53:"\u067B",\uFB52:"\u067B",\u06D0:"\u067B",\uFBE6:"\u067B",\uFBE7:"\u067B",\uFBE5:"\u067B",\uFBE4:"\u067B",\uFB5C:"\u0680",\uFB5D:"\u0680",\uFB5B:"\u0680",\uFB5A:"\u0680","\u08A9":"\u0754","\u0767":"\u0754","\u2365":"\u0629",\u00F6:"\u0629",\uFE94:"\u0629",\uFE93:"\u0629",\u06C3:"\u0629","\u{1EE15}":"\u062A","\u{1EE35}":"\u062A","\u{1EE75}":"\u062A","\u{1EE95}":"\u062A","\u{1EEB5}":"\u062A",\uFE97:"\u062A",\uFE98:"\u062A",\uFE96:"\u062A",\uFE95:"\u062A",\uFCA5:"\u062Ao",\uFCE4:"\u062Ao",\uFCA1:"\u062A\u062C",\uFC0B:"\u062A\u062C",\uFD50:"\u062A\u062C\u0645",\uFDA0:"\u062A\u062C\u0649",\uFD9F:"\u062A\u062C\u0649",\uFCA2:"\u062A\u062D",\uFC0C:"\u062A\u062D",\uFD52:"\u062A\u062D\u062C",\uFD51:"\u062A\u062D\u062C",\uFD53:"\u062A\u062D\u0645",\uFCA3:"\u062A\u062E",\uFC0D:"\u062A\u062E",\uFD54:"\u062A\u062E\u0645",\uFDA2:"\u062A\u062E\u0649",\uFDA1:"\u062A\u062E\u0649",\uFC70:"\u062A\u0631",\uFC71:"\u062A\u0632",\uFCA4:"\u062A\u0645",\uFCE3:"\u062A\u0645",\uFC72:"\u062A\u0645",\uFC0E:"\u062A\u0645",\uFD55:"\u062A\u0645\u062C",\uFD56:"\u062A\u0645\u062D",\uFD57:"\u062A\u0645\u062E",\uFDA4:"\u062A\u0645\u0649",\uFDA3:"\u062A\u0645\u0649",\uFC73:"\u062A\u0646",\uFC74:"\u062A\u0649",\uFC0F:"\u062A\u0649",\uFC75:"\u062A\u0649",\uFC10:"\u062A\u0649",\uFB60:"\u067A",\uFB61:"\u067A",\uFB5F:"\u067A",\uFB5E:"\u067A",\uFB64:"\u067F",\uFB65:"\u067F",\uFB63:"\u067F",\uFB62:"\u067F","\u{1EE02}":"\u062C","\u{1EE22}":"\u062C","\u{1EE42}":"\u062C","\u{1EE62}":"\u062C","\u{1EE82}":"\u062C","\u{1EEA2}":"\u062C",\uFE9F:"\u062C",\uFEA0:"\u062C",\uFE9E:"\u062C",\uFE9D:"\u062C",\uFCA7:"\u062C\u062D",\uFC15:"\u062C\u062D",\uFDA6:"\u062C\u062D\u0649",\uFDBE:"\u062C\u062D\u0649",\uFDFB:"\u062C\u0644 \u062C\u0644l\u0644o",\uFCA8:"\u062C\u0645",\uFC16:"\u062C\u0645",\uFD59:"\u062C\u0645\u062D",\uFD58:"\u062C\u0645\u062D",\uFDA7:"\u062C\u0645\u0649",\uFDA5:"\u062C\u0645\u0649",\uFD1D:"\u062C\u0649",\uFD01:"\u062C\u0649",\uFD1E:"\u062C\u0649",\uFD02:"\u062C\u0649",\uFB78:"\u0683",\uFB79:"\u0683",\uFB77:"\u0683",\uFB76:"\u0683",\uFB74:"\u0684",\uFB75:"\u0684",\uFB73:"\u0684",\uFB72:"\u0684",\uFB7C:"\u0686",\uFB7D:"\u0686",\uFB7B:"\u0686",\uFB7A:"\u0686",\uFB80:"\u0687",\uFB81:"\u0687",\uFB7F:"\u0687",\uFB7E:"\u0687","\u{1EE07}":"\u062D","\u{1EE27}":"\u062D","\u{1EE47}":"\u062D","\u{1EE67}":"\u062D","\u{1EE87}":"\u062D","\u{1EEA7}":"\u062D",\uFEA3:"\u062D",\uFEA4:"\u062D",\uFEA2:"\u062D",\uFEA1:"\u062D",\u0685:"\u062D\u06DB",\u0681:"\u062D\u0654","\u0772":"\u062D\u0654",\uFCA9:"\u062D\u062C",\uFC17:"\u062D\u062C",\uFDBF:"\u062D\u062C\u0649",\uFCAA:"\u062D\u0645",\uFC18:"\u062D\u0645",\uFD5B:"\u062D\u0645\u0649",\uFD5A:"\u062D\u0645\u0649",\uFD1B:"\u062D\u0649",\uFCFF:"\u062D\u0649",\uFD1C:"\u062D\u0649",\uFD00:"\u062D\u0649","\u{1EE17}":"\u062E","\u{1EE37}":"\u062E","\u{1EE57}":"\u062E","\u{1EE77}":"\u062E","\u{1EE97}":"\u062E","\u{1EEB7}":"\u062E",\uFEA7:"\u062E",\uFEA8:"\u062E",\uFEA6:"\u062E",\uFEA5:"\u062E",\uFCAB:"\u062E\u062C",\uFC19:"\u062E\u062C",\uFC1A:"\u062E\u062D",\uFCAC:"\u062E\u0645",\uFC1B:"\u062E\u0645",\uFD1F:"\u062E\u0649",\uFD03:"\u062E\u0649",\uFD20:"\u062E\u0649",\uFD04:"\u062E\u0649","\u{102E1}":"\u062F","\u{1EE03}":"\u062F","\u{1EE83}":"\u062F","\u{1EEA3}":"\u062F",\uFEAA:"\u062F",\uFEA9:"\u062F",\u0688:"\u062F\u0615",\uFB89:"\u062F\u0615",\uFB88:"\u062F\u0615",\u068E:"\u062F\u06DB",\uFB87:"\u062F\u06DB",\uFB86:"\u062F\u06DB","\u06EE":"\u062F\u0302","\u08AE":"\u062F\u0324\u0323","\u{1EE18}":"\u0630","\u{1EE98}":"\u0630","\u{1EEB8}":"\u0630",\uFEAC:"\u0630",\uFEAB:"\u0630",\uFC5B:"\u0630\u0670",\u068B:"\u068A\u0615",\uFB85:"\u068C",\uFB84:"\u068C",\uFB83:"\u068D",\uFB82:"\u068D","\u{1EE13}":"\u0631","\u{1EE93}":"\u0631","\u{1EEB3}":"\u0631",\uFEAE:"\u0631",\uFEAD:"\u0631",\u0691:"\u0631\u0615",\uFB8D:"\u0631\u0615",\uFB8C:"\u0631\u0615",\u0698:"\u0631\u06DB",\uFB8B:"\u0631\u06DB",\uFB8A:"\u0631\u06DB",\u0692:"\u0631\u0306","\u08B9":"\u0631\u0306\u0307","\u06EF":"\u0631\u0302","\u076C":"\u0631\u0654",\uFC5C:"\u0631\u0670",\uFDF6:"\u0631\u0633\u0648\u0644","\uFDFC":"\u0631\u0649l\u0644","\u{1EE06}":"\u0632","\u{1EE86}":"\u0632","\u{1EEA6}":"\u0632",\uFEB0:"\u0632",\uFEAF:"\u0632","\u08B2":"\u0632\u0302","\u0771":"\u0697\u0615","\u{1EE0E}":"\u0633","\u{1EE2E}":"\u0633","\u{1EE4E}":"\u0633","\u{1EE6E}":"\u0633","\u{1EE8E}":"\u0633","\u{1EEAE}":"\u0633",\uFEB3:"\u0633",\uFEB4:"\u0633",\uFEB2:"\u0633",\uFEB1:"\u0633",\u0634:"\u0633\u06DB","\u{1EE14}":"\u0633\u06DB","\u{1EE34}":"\u0633\u06DB","\u{1EE54}":"\u0633\u06DB","\u{1EE74}":"\u0633\u06DB","\u{1EE94}":"\u0633\u06DB","\u{1EEB4}":"\u0633\u06DB",\uFEB7:"\u0633\u06DB",\uFEB8:"\u0633\u06DB",\uFEB6:"\u0633\u06DB",\uFEB5:"\u0633\u06DB","\u077E":"\u0633\u0302",\uFD31:"\u0633o",\uFCE8:"\u0633o",\uFD32:"\u0633\u06DBo",\uFCEA:"\u0633\u06DBo",\uFCAD:"\u0633\u062C",\uFD34:"\u0633\u062C",\uFC1C:"\u0633\u062C",\uFD2D:"\u0633\u06DB\u062C",\uFD37:"\u0633\u06DB\u062C",\uFD25:"\u0633\u06DB\u062C",\uFD09:"\u0633\u06DB\u062C",\uFD5D:"\u0633\u062C\u062D",\uFD5E:"\u0633\u062C\u0649",\uFD69:"\u0633\u06DB\u062C\u0649",\uFCAE:"\u0633\u062D",\uFD35:"\u0633\u062D",\uFC1D:"\u0633\u062D",\uFD2E:"\u0633\u06DB\u062D",\uFD38:"\u0633\u06DB\u062D",\uFD26:"\u0633\u06DB\u062D",\uFD0A:"\u0633\u06DB\u062D",\uFD5C:"\u0633\u062D\u062C",\uFD68:"\u0633\u06DB\u062D\u0645",\uFD67:"\u0633\u06DB\u062D\u0645",\uFDAA:"\u0633\u06DB\u062D\u0649",\uFCAF:"\u0633\u062E",\uFD36:"\u0633\u062E",\uFC1E:"\u0633\u062E",\uFD2F:"\u0633\u06DB\u062E",\uFD39:"\u0633\u06DB\u062E",\uFD27:"\u0633\u06DB\u062E",\uFD0B:"\u0633\u06DB\u062E",\uFDA8:"\u0633\u062E\u0649",\uFDC6:"\u0633\u062E\u0649",\uFD2A:"\u0633\u0631",\uFD0E:"\u0633\u0631",\uFD29:"\u0633\u06DB\u0631",\uFD0D:"\u0633\u06DB\u0631",\uFCB0:"\u0633\u0645",\uFCE7:"\u0633\u0645",\uFC1F:"\u0633\u0645",\uFD30:"\u0633\u06DB\u0645",\uFCE9:"\u0633\u06DB\u0645",\uFD28:"\u0633\u06DB\u0645",\uFD0C:"\u0633\u06DB\u0645",\uFD61:"\u0633\u0645\u062C",\uFD60:"\u0633\u0645\u062D",\uFD5F:"\u0633\u0645\u062D",\uFD6B:"\u0633\u06DB\u0645\u062E",\uFD6A:"\u0633\u06DB\u0645\u062E",\uFD63:"\u0633\u0645\u0645",\uFD62:"\u0633\u0645\u0645",\uFD6D:"\u0633\u06DB\u0645\u0645",\uFD6C:"\u0633\u06DB\u0645\u0645",\uFD17:"\u0633\u0649",\uFCFB:"\u0633\u0649",\uFD18:"\u0633\u0649",\uFCFC:"\u0633\u0649",\uFD19:"\u0633\u06DB\u0649",\uFCFD:"\u0633\u06DB\u0649",\uFD1A:"\u0633\u06DB\u0649",\uFCFE:"\u0633\u06DB\u0649","\u{102F2}":"\u0635","\u{1EE11}":"\u0635","\u{1EE31}":"\u0635","\u{1EE51}":"\u0635","\u{1EE71}":"\u0635","\u{1EE91}":"\u0635","\u{1EEB1}":"\u0635",\uFEBB:"\u0635",\uFEBC:"\u0635",\uFEBA:"\u0635",\uFEB9:"\u0635",\u069E:"\u0635\u06DB","\u08AF":"\u0635\u0324\u0323",\uFCB1:"\u0635\u062D",\uFC20:"\u0635\u062D",\uFD65:"\u0635\u062D\u062D",\uFD64:"\u0635\u062D\u062D",\uFDA9:"\u0635\u062D\u0649",\uFCB2:"\u0635\u062E",\uFD2B:"\u0635\u0631",\uFD0F:"\u0635\u0631",\uFDF5:"\u0635\u0644\u0639\u0645",\uFDF9:"\u0635\u0644\u0649",\uFDF0:"\u0635\u0644\u0649",\uFDFA:"\u0635\u0644\u0649 l\u0644\u0644o \u0639\u0644\u0649o \u0648\u0633\u0644\u0645",\uFCB3:"\u0635\u0645",\uFC21:"\u0635\u0645",\uFDC5:"\u0635\u0645\u0645",\uFD66:"\u0635\u0645\u0645",\uFD21:"\u0635\u0649",\uFD05:"\u0635\u0649",\uFD22:"\u0635\u0649",\uFD06:"\u0635\u0649","\u{1EE19}":"\u0636","\u{1EE39}":"\u0636","\u{1EE59}":"\u0636","\u{1EE79}":"\u0636","\u{1EE99}":"\u0636","\u{1EEB9}":"\u0636",\uFEBF:"\u0636",\uFEC0:"\u0636",\uFEBE:"\u0636",\uFEBD:"\u0636",\uFCB4:"\u0636\u062C",\uFC22:"\u0636\u062C",\uFCB5:"\u0636\u062D",\uFC23:"\u0636\u062D",\uFD6E:"\u0636\u062D\u0649",\uFDAB:"\u0636\u062D\u0649",\uFCB6:"\u0636\u062E",\uFC24:"\u0636\u062E",\uFD70:"\u0636\u062E\u0645",\uFD6F:"\u0636\u062E\u0645",\uFD2C:"\u0636\u0631",\uFD10:"\u0636\u0631",\uFCB7:"\u0636\u0645",\uFC25:"\u0636\u0645",\uFD23:"\u0636\u0649",\uFD07:"\u0636\u0649",\uFD24:"\u0636\u0649",\uFD08:"\u0636\u0649","\u{102E8}":"\u0637","\u{1EE08}":"\u0637","\u{1EE68}":"\u0637","\u{1EE88}":"\u0637","\u{1EEA8}":"\u0637",\uFEC3:"\u0637",\uFEC4:"\u0637",\uFEC2:"\u0637",\uFEC1:"\u0637",\u069F:"\u0637\u06DB",\uFCB8:"\u0637\u062D",\uFC26:"\u0637\u062D",\uFD33:"\u0637\u0645",\uFD3A:"\u0637\u0645",\uFC27:"\u0637\u0645",\uFD72:"\u0637\u0645\u062D",\uFD71:"\u0637\u0645\u062D",\uFD73:"\u0637\u0645\u0645",\uFD74:"\u0637\u0645\u0649",\uFD11:"\u0637\u0649",\uFCF5:"\u0637\u0649",\uFD12:"\u0637\u0649",\uFCF6:"\u0637\u0649","\u{1EE1A}":"\u0638","\u{1EE7A}":"\u0638","\u{1EE9A}":"\u0638","\u{1EEBA}":"\u0638",\uFEC7:"\u0638",\uFEC8:"\u0638",\uFEC6:"\u0638",\uFEC5:"\u0638",\uFCB9:"\u0638\u0645",\uFD3B:"\u0638\u0645",\uFC28:"\u0638\u0645","\u060F":"\u0639","\u{1EE0F}":"\u0639","\u{1EE2F}":"\u0639","\u{1EE4F}":"\u0639","\u{1EE6F}":"\u0639","\u{1EE8F}":"\u0639","\u{1EEAF}":"\u0639",\uFECB:"\u0639",\uFECC:"\u0639",\uFECA:"\u0639",\uFEC9:"\u0639",\uFCBA:"\u0639\u062C",\uFC29:"\u0639\u062C",\uFDC4:"\u0639\u062C\u0645",\uFD75:"\u0639\u062C\u0645",\uFDF7:"\u0639\u0644\u0649o",\uFCBB:"\u0639\u0645",\uFC2A:"\u0639\u0645",\uFD77:"\u0639\u0645\u0645",\uFD76:"\u0639\u0645\u0645",\uFD78:"\u0639\u0645\u0649",\uFDB6:"\u0639\u0645\u0649",\uFD13:"\u0639\u0649",\uFCF7:"\u0639\u0649",\uFD14:"\u0639\u0649",\uFCF8:"\u0639\u0649","\u{1EE1B}":"\u063A","\u{1EE3B}":"\u063A","\u{1EE5B}":"\u063A","\u{1EE7B}":"\u063A","\u{1EE9B}":"\u063A","\u{1EEBB}":"\u063A",\uFECF:"\u063A",\uFED0:"\u063A",\uFECE:"\u063A",\uFECD:"\u063A",\uFCBC:"\u063A\u062C",\uFC2B:"\u063A\u062C",\uFCBD:"\u063A\u0645",\uFC2C:"\u063A\u0645",\uFD79:"\u063A\u0645\u0645",\uFD7B:"\u063A\u0645\u0649",\uFD7A:"\u063A\u0645\u0649",\uFD15:"\u063A\u0649",\uFCF9:"\u063A\u0649",\uFD16:"\u063A\u0649",\uFCFA:"\u063A\u0649","\u{1EE10}":"\u0641","\u{1EE30}":"\u0641","\u{1EE70}":"\u0641","\u{1EE90}":"\u0641","\u{1EEB0}":"\u0641",\uFED3:"\u0641",\uFED4:"\u0641",\uFED2:"\u0641",\uFED1:"\u0641",\u06A7:"\u0641",\uFCBE:"\u0641\u062C",\uFC2D:"\u0641\u062C",\uFCBF:"\u0641\u062D",\uFC2E:"\u0641\u062D",\uFCC0:"\u0641\u062E",\uFC2F:"\u0641\u062E",\uFD7D:"\u0641\u062E\u0645",\uFD7C:"\u0641\u062E\u0645",\uFCC1:"\u0641\u0645",\uFC30:"\u0641\u0645",\uFDC1:"\u0641\u0645\u0649",\uFC7C:"\u0641\u0649",\uFC31:"\u0641\u0649",\uFC7D:"\u0641\u0649",\uFC32:"\u0641\u0649","\u{1EE1E}":"\u06A1","\u{1EE7E}":"\u06A1","\u08BB":"\u06A1","\u066F":"\u06A1","\u{1EE1F}":"\u06A1","\u{1EE5F}":"\u06A1","\u08BC":"\u06A1",\u06A4:"\u06A1\u06DB",\uFB6C:"\u06A1\u06DB",\uFB6D:"\u06A1\u06DB",\uFB6B:"\u06A1\u06DB",\uFB6A:"\u06A1\u06DB",\u06A8:"\u06A1\u06DB","\u08A4":"\u06A2\u06DB",\uFB70:"\u06A6",\uFB71:"\u06A6",\uFB6F:"\u06A6",\uFB6E:"\u06A6","\u{1EE12}":"\u0642","\u{1EE32}":"\u0642","\u{1EE52}":"\u0642","\u{1EE72}":"\u0642","\u{1EE92}":"\u0642","\u{1EEB2}":"\u0642",\uFED7:"\u0642",\uFED8:"\u0642",\uFED6:"\u0642",\uFED5:"\u0642",\uFCC2:"\u0642\u062D",\uFC33:"\u0642\u062D",\uFDF1:"\u0642\u0644\u0649",\uFCC3:"\u0642\u0645",\uFC34:"\u0642\u0645",\uFDB4:"\u0642\u0645\u062D",\uFD7E:"\u0642\u0645\u062D",\uFD7F:"\u0642\u0645\u0645",\uFDB2:"\u0642\u0645\u0649",\uFC7E:"\u0642\u0649",\uFC35:"\u0642\u0649",\uFC7F:"\u0642\u0649",\uFC36:"\u0642\u0649","\u{1EE0A}":"\u0643","\u{1EE2A}":"\u0643","\u{1EE6A}":"\u0643",\uFEDB:"\u0643",\uFEDC:"\u0643",\uFEDA:"\u0643",\uFED9:"\u0643",\u06A9:"\u0643",\uFB90:"\u0643",\uFB91:"\u0643",\uFB8F:"\u0643",\uFB8E:"\u0643",\u06AA:"\u0643",\u06AD:"\u0643\u06DB",\uFBD5:"\u0643\u06DB",\uFBD6:"\u0643\u06DB",\uFBD4:"\u0643\u06DB",\uFBD3:"\u0643\u06DB","\u0763":"\u0643\u06DB",\uFC80:"\u0643l",\uFC37:"\u0643l",\uFCC4:"\u0643\u062C",\uFC38:"\u0643\u062C",\uFCC5:"\u0643\u062D",\uFC39:"\u0643\u062D",\uFCC6:"\u0643\u062E",\uFC3A:"\u0643\u062E",\uFCC7:"\u0643\u0644",\uFCEB:"\u0643\u0644",\uFC81:"\u0643\u0644",\uFC3B:"\u0643\u0644",\uFCC8:"\u0643\u0645",\uFCEC:"\u0643\u0645",\uFC82:"\u0643\u0645",\uFC3C:"\u0643\u0645",\uFDC3:"\u0643\u0645\u0645",\uFDBB:"\u0643\u0645\u0645",\uFDB7:"\u0643\u0645\u0649",\uFC83:"\u0643\u0649",\uFC3D:"\u0643\u0649",\uFC84:"\u0643\u0649",\uFC3E:"\u0643\u0649","\u0762":"\u06AC",\uFB94:"\u06AF",\uFB95:"\u06AF",\uFB93:"\u06AF",\uFB92:"\u06AF","\u08B0":"\u06AF",\u06B4:"\u06AF\u06DB",\uFB9C:"\u06B1",\uFB9D:"\u06B1",\uFB9B:"\u06B1",\uFB9A:"\u06B1",\uFB98:"\u06B3",\uFB99:"\u06B3",\uFB97:"\u06B3",\uFB96:"\u06B3","\u{1EE0B}":"\u0644","\u{1EE2B}":"\u0644","\u{1EE4B}":"\u0644","\u{1EE8B}":"\u0644","\u{1EEAB}":"\u0644",\uFEDF:"\u0644",\uFEE0:"\u0644",\uFEDE:"\u0644",\uFEDD:"\u0644",\u06B7:"\u0644\u06DB",\u06B5:"\u0644\u0306",\uFEFC:"\u0644l",\uFEFB:"\u0644l",\uFEFA:"\u0644l\u0655",\uFEF9:"\u0644l\u0655",\uFEF8:"\u0644l\u0674",\uFEF7:"\u0644l\u0674",\uFCCD:"\u0644o",\uFEF6:"\u0644\u0622",\uFEF5:"\u0644\u0622",\uFCC9:"\u0644\u062C",\uFC3F:"\u0644\u062C",\uFD83:"\u0644\u062C\u062C",\uFD84:"\u0644\u062C\u062C",\uFDBA:"\u0644\u062C\u0645",\uFDBC:"\u0644\u062C\u0645",\uFDAC:"\u0644\u062C\u0649",\uFCCA:"\u0644\u062D",\uFC40:"\u0644\u062D",\uFDB5:"\u0644\u062D\u0645",\uFD80:"\u0644\u062D\u0645",\uFD82:"\u0644\u062D\u0649",\uFD81:"\u0644\u062D\u0649",\uFCCB:"\u0644\u062E",\uFC41:"\u0644\u062E",\uFD86:"\u0644\u062E\u0645",\uFD85:"\u0644\u062E\u0645",\uFCCC:"\u0644\u0645",\uFCED:"\u0644\u0645",\uFC85:"\u0644\u0645",\uFC42:"\u0644\u0645",\uFD88:"\u0644\u0645\u062D",\uFD87:"\u0644\u0645\u062D",\uFDAD:"\u0644\u0645\u0649",\uFC86:"\u0644\u0649",\uFC43:"\u0644\u0649",\uFC87:"\u0644\u0649",\uFC44:"\u0644\u0649","\u{1EE0C}":"\u0645","\u{1EE2C}":"\u0645","\u{1EE6C}":"\u0645","\u{1EE8C}":"\u0645","\u{1EEAC}":"\u0645",\uFEE3:"\u0645",\uFEE4:"\u0645",\uFEE2:"\u0645",\uFEE1:"\u0645","\u08A7":"\u0645\u06DB","\u06FE":"\u0645\u0348",\uFC88:"\u0645l",\uFCCE:"\u0645\u062C",\uFC45:"\u0645\u062C",\uFD8C:"\u0645\u062C\u062D",\uFD92:"\u0645\u062C\u062E",\uFD8D:"\u0645\u062C\u0645",\uFDC0:"\u0645\u062C\u0649",\uFCCF:"\u0645\u062D",\uFC46:"\u0645\u062D",\uFD89:"\u0645\u062D\u062C",\uFD8A:"\u0645\u062D\u0645",\uFDF4:"\u0645\u062D\u0645\u062F",\uFD8B:"\u0645\u062D\u0649",\uFCD0:"\u0645\u062E",\uFC47:"\u0645\u062E",\uFD8E:"\u0645\u062E\u062C",\uFD8F:"\u0645\u062E\u0645",\uFDB9:"\u0645\u062E\u0649",\uFCD1:"\u0645\u0645",\uFC89:"\u0645\u0645",\uFC48:"\u0645\u0645",\uFDB1:"\u0645\u0645\u0649",\uFC49:"\u0645\u0649",\uFC4A:"\u0645\u0649","\u{1EE0D}":"\u0646","\u{1EE2D}":"\u0646","\u{1EE4D}":"\u0646","\u{1EE6D}":"\u0646","\u{1EE8D}":"\u0646","\u{1EEAD}":"\u0646",\uFEE7:"\u0646",\uFEE8:"\u0646",\uFEE6:"\u0646",\uFEE5:"\u0646","\u0768":"\u0646\u0615","\u0769":"\u0646\u0306",\uFCD6:"\u0646o",\uFCEF:"\u0646o",\uFDB8:"\u0646\u062C\u062D",\uFDBD:"\u0646\u062C\u062D",\uFD98:"\u0646\u062C\u0645",\uFD97:"\u0646\u062C\u0645",\uFD99:"\u0646\u062C\u0649",\uFDC7:"\u0646\u062C\u0649",\uFCD3:"\u0646\u062D",\uFC4C:"\u0646\u062D",\uFD95:"\u0646\u062D\u0645",\uFD96:"\u0646\u062D\u0649",\uFDB3:"\u0646\u062D\u0649",\uFCD4:"\u0646\u062E",\uFC4D:"\u0646\u062E",\uFC8A:"\u0646\u0631",\uFC8B:"\u0646\u0632",\uFCD5:"\u0646\u0645",\uFCEE:"\u0646\u0645",\uFC8C:"\u0646\u0645",\uFC4E:"\u0646\u0645",\uFD9B:"\u0646\u0645\u0649",\uFD9A:"\u0646\u0645\u0649",\uFC8D:"\u0646\u0646",\uFC8E:"\u0646\u0649",\uFC4F:"\u0646\u0649",\uFC8F:"\u0646\u0649",\uFC50:"\u0646\u0649",\u06C2:"\u06C0",\uFBA5:"\u06C0",\uFBA4:"\u06C0","\u{102E4}":"\u0648","\u{1EE05}":"\u0648","\u{1EE85}":"\u0648","\u{1EEA5}":"\u0648",\uFEEE:"\u0648",\uFEED:"\u0648","\u08B1":"\u0648",\u06CB:"\u0648\u06DB",\uFBDF:"\u0648\u06DB",\uFBDE:"\u0648\u06DB",\u06C7:"\u0648\u0313",\uFBD8:"\u0648\u0313",\uFBD7:"\u0648\u0313",\u06C6:"\u0648\u0306",\uFBDA:"\u0648\u0306",\uFBD9:"\u0648\u0306",\u06C9:"\u0648\u0302",\uFBE3:"\u0648\u0302",\uFBE2:"\u0648\u0302",\u06C8:"\u0648\u0670",\uFBDC:"\u0648\u0670",\uFBDB:"\u0648\u0670",\u0624:"\u0648\u0674",\uFE86:"\u0648\u0674",\uFE85:"\u0648\u0674",\u0676:"\u0648\u0674",\u0677:"\u0648\u0313\u0674",\uFBDD:"\u0648\u0313\u0674",\uFDF8:"\u0648\u0633\u0644\u0645",\uFBE1:"\u06C5",\uFBE0:"\u06C5","\u066E":"\u0649","\u{1EE1C}":"\u0649","\u{1EE7C}":"\u0649",\u06BA:"\u0649","\u{1EE1D}":"\u0649","\u{1EE5D}":"\u0649",\uFB9F:"\u0649",\uFB9E:"\u0649","\u08BD":"\u0649",\uFBE8:"\u0649",\uFBE9:"\u0649",\uFEF0:"\u0649",\uFEEF:"\u0649",\u064A:"\u0649","\u{1EE09}":"\u0649","\u{1EE29}":"\u0649","\u{1EE49}":"\u0649","\u{1EE69}":"\u0649","\u{1EE89}":"\u0649","\u{1EEA9}":"\u0649",\uFEF3:"\u0649",\uFEF4:"\u0649",\uFEF2:"\u0649",\uFEF1:"\u0649",\u06CC:"\u0649",\uFBFE:"\u0649",\uFBFF:"\u0649",\uFBFD:"\u0649",\uFBFC:"\u0649",\u06D2:"\u0649",\uFBAF:"\u0649",\uFBAE:"\u0649",\u0679:"\u0649\u0615",\uFB68:"\u0649\u0615",\uFB69:"\u0649\u0615",\uFB67:"\u0649\u0615",\uFB66:"\u0649\u0615",\u06BB:"\u0649\u0615",\uFBA2:"\u0649\u0615",\uFBA3:"\u0649\u0615",\uFBA1:"\u0649\u0615",\uFBA0:"\u0649\u0615",\u067E:"\u0649\u06DB",\uFB58:"\u0649\u06DB",\uFB59:"\u0649\u06DB",\uFB57:"\u0649\u06DB",\uFB56:"\u0649\u06DB",\u062B:"\u0649\u06DB","\u{1EE16}":"\u0649\u06DB","\u{1EE36}":"\u0649\u06DB","\u{1EE76}":"\u0649\u06DB","\u{1EE96}":"\u0649\u06DB","\u{1EEB6}":"\u0649\u06DB",\uFE9B:"\u0649\u06DB",\uFE9C:"\u0649\u06DB",\uFE9A:"\u0649\u06DB",\uFE99:"\u0649\u06DB",\u06BD:"\u0649\u06DB",\u06D1:"\u0649\u06DB","\u063F":"\u0649\u06DB","\u08B7":"\u0649\u06DB\u06E2","\u0756":"\u0649\u0306",\u06CE:"\u0649\u0306","\u08BA":"\u0649\u0306\u0307","\u063D":"\u0649\u0302","\u08A8":"\u0649\u0654",\uFC90:"\u0649\u0670",\uFC5D:"\u0649\u0670",\uFCDE:"\u0649o",\uFCF1:"\u0649o",\uFCE6:"\u0649\u06DBo",\u0626:"\u0649\u0674",\uFE8B:"\u0649\u0674",\uFE8C:"\u0649\u0674",\uFE8A:"\u0649\u0674",\uFE89:"\u0649\u0674",\u0678:"\u0649\u0674",\uFBEB:"\u0649\u0674l",\uFBEA:"\u0649\u0674l",\uFC9B:"\u0649\u0674o",\uFCE0:"\u0649\u0674o",\uFBED:"\u0649\u0674o",\uFBEC:"\u0649\u0674o",\uFBF8:"\u0649\u0674\u067B",\uFBF7:"\u0649\u0674\u067B",\uFBF6:"\u0649\u0674\u067B",\uFC97:"\u0649\u0674\u062C",\uFC00:"\u0649\u0674\u062C",\uFC98:"\u0649\u0674\u062D",\uFC01:"\u0649\u0674\u062D",\uFC99:"\u0649\u0674\u062E",\uFC64:"\u0649\u0674\u0631",\uFC65:"\u0649\u0674\u0632",\uFC9A:"\u0649\u0674\u0645",\uFCDF:"\u0649\u0674\u0645",\uFC66:"\u0649\u0674\u0645",\uFC02:"\u0649\u0674\u0645",\uFC67:"\u0649\u0674\u0646",\uFBEF:"\u0649\u0674\u0648",\uFBEE:"\u0649\u0674\u0648",\uFBF1:"\u0649\u0674\u0648\u0313",\uFBF0:"\u0649\u0674\u0648\u0313",\uFBF3:"\u0649\u0674\u0648\u0306",\uFBF2:"\u0649\u0674\u0648\u0306",\uFBF5:"\u0649\u0674\u0648\u0670",\uFBF4:"\u0649\u0674\u0648\u0670",\uFBFB:"\u0649\u0674\u0649",\uFBFA:"\u0649\u0674\u0649",\uFC68:"\u0649\u0674\u0649",\uFBF9:"\u0649\u0674\u0649",\uFC03:"\u0649\u0674\u0649",\uFC69:"\u0649\u0674\u0649",\uFC04:"\u0649\u0674\u0649",\uFCDA:"\u0649\u062C",\uFC55:"\u0649\u062C",\uFC11:"\u0649\u06DB\u062C",\uFDAF:"\u0649\u062C\u0649",\uFCDB:"\u0649\u062D",\uFC56:"\u0649\u062D",\uFDAE:"\u0649\u062D\u0649",\uFCDC:"\u0649\u062E",\uFC57:"\u0649\u062E",\uFC91:"\u0649\u0631",\uFC76:"\u0649\u06DB\u0631",\uFC92:"\u0649\u0632",\uFC77:"\u0649\u06DB\u0632",\uFCDD:"\u0649\u0645",\uFCF0:"\u0649\u0645",\uFC93:"\u0649\u0645",\uFC58:"\u0649\u0645",\uFCA6:"\u0649\u06DB\u0645",\uFCE5:"\u0649\u06DB\u0645",\uFC78:"\u0649\u06DB\u0645",\uFC12:"\u0649\u06DB\u0645",\uFD9D:"\u0649\u0645\u0645",\uFD9C:"\u0649\u0645\u0645",\uFDB0:"\u0649\u0645\u0649",\uFC94:"\u0649\u0646",\uFC79:"\u0649\u06DB\u0646",\uFC95:"\u0649\u0649",\uFC59:"\u0649\u0649",\uFC96:"\u0649\u0649",\uFC5A:"\u0649\u0649",\uFC7A:"\u0649\u06DB\u0649",\uFC13:"\u0649\u06DB\u0649",\uFC7B:"\u0649\u06DB\u0649",\uFC14:"\u0649\u06DB\u0649",\uFBB1:"\u06D3",\uFBB0:"\u06D3","\u{102B8}":"\u2D40","\u205E":"\u2D42","\u2E3D":"\u2D42","\u2999":"\u2D42","\uFE19":"\u2D57","\u205D":"\u2D57","\u22EE":"\u2D57",\u0544:"\u1206",\u054C:"\u1261",\u053B:"\u12AE",\u054A:"\u1323",\u0906:"\u0905\u093E",\u0912:"\u0905\u093E\u0946",\u0913:"\u0905\u093E\u0947",\u0914:"\u0905\u093E\u0948","\u0904":"\u0905\u0946",\u0911:"\u0905\u0949",\u090D:"\u090F\u0945",\u090E:"\u090F\u0946",\u0910:"\u090F\u0947",\u0908:"\u0930\u094D\u0907",\u0ABD:"\u093D","\u{111DC}":"\uA8FB","\u{111CB}":"\u093A","\u0AC1":"\u0941","\u0AC2":"\u0942","\u0A4B":"\u0946","\u0A4D":"\u094D","\u0ACD":"\u094D",\u0986:"\u0985\u09BE",\u09E0:"\u098B\u09C3",\u09E1:"\u098B\u09C3","\u{11492}":"\u0998","\u{11494}":"\u099A","\u{11496}":"\u099C","\u{11498}":"\u099E","\u{11499}":"\u099F","\u{1149B}":"\u09A1","\u{114AA}":"\u09A3","\u{1149E}":"\u09A4","\u{1149F}":"\u09A5","\u{114A0}":"\u09A6","\u{114A1}":"\u09A7","\u{114A2}":"\u09A8","\u{114A3}":"\u09AA","\u{114A9}":"\u09AC","\u{114A7}":"\u09AE","\u{114A8}":"\u09AF","\u{114AB}":"\u09B0","\u{1149D}":"\u09B2","\u{114AD}":"\u09B7","\u{114AE}":"\u09B8","\u{114C4}":"\u09BD","\u{114B0}":"\u09BE","\u{114B1}":"\u09BF","\u{114B9}":"\u09C7","\u{114BC}":"\u09CB","\u{114BE}":"\u09CC","\u{114C2}":"\u09CD","\u{114BD}":"\u09D7",\u0A09:"\u0A73\u0A41",\u0A0A:"\u0A73\u0A42",\u0A06:"\u0A05\u0A3E",\u0A10:"\u0A05\u0A48",\u0A14:"\u0A05\u0A4C",\u0A07:"\u0A72\u0A3F",\u0A08:"\u0A72\u0A40",\u0A0F:"\u0A72\u0A47",\u0A86:"\u0A85\u0ABE",\u0A91:"\u0A85\u0ABE\u0AC5",\u0A93:"\u0A85\u0ABE\u0AC7",\u0A94:"\u0A85\u0ABE\u0AC8",\u0A8D:"\u0A85\u0AC5",\u0A8F:"\u0A85\u0AC7",\u0A90:"\u0A85\u0AC8",\u0B06:"\u0B05\u0B3E","\u0BEE":"\u0B85",\u0BB0:"\u0B88","\u0BBE":"\u0B88","\u0BEB":"\u0B88\u0BC1","\u0BE8":"\u0B89",\u0D09:"\u0B89",\u0B8A:"\u0B89\u0BB3",\u0D0A:"\u0B89\u0D57","\u0BED":"\u0B8E","\u0BF7":"\u0B8E\u0BB5",\u0B9C:"\u0B90",\u0D1C:"\u0B90","\u0BE7":"\u0B95","\u0BEA":"\u0B9A","\u0BEC":"\u0B9A\u0BC1","\u0BF2":"\u0B9A\u0BC2","\u0D3A":"\u0B9F\u0BBF",\u0D23:"\u0BA3","\u0BFA":"\u0BA8\u0BC0","\u0BF4":"\u0BAE\u0BC0","\u0BF0":"\u0BAF",\u0D34:"\u0BB4","\u0BD7":"\u0BB3","\u0BC8":"\u0BA9",\u0D36:"\u0BB6","\u0BF8":"\u0BB7","\u0D3F":"\u0BBF","\u0D40":"\u0BBF","\u0BCA":"\u0BC6\u0B88","\u0BCC":"\u0BC6\u0BB3","\u0BCB":"\u0BC7\u0B88",\u0C85:"\u0C05",\u0C86:"\u0C06",\u0C87:"\u0C07",\u0C60:"\u0C0B\u0C3E",\u0C61:"\u0C0C\u0C3E",\u0C92:"\u0C12",\u0C14:"\u0C12\u0C4C",\u0C94:"\u0C12\u0C4C",\u0C13:"\u0C12\u0C55",\u0C93:"\u0C12\u0C55",\u0C9C:"\u0C1C",\u0C9E:"\u0C1E",\u0C22:"\u0C21\u0323",\u0CA3:"\u0C23",\u0C25:"\u0C27\u05BC",\u0C2D:"\u0C2C\u0323",\u0CAF:"\u0C2F",\u0C20:"\u0C30\u05BC",\u0CB1:"\u0C31",\u0CB2:"\u0C32",\u0C37:"\u0C35\u0323",\u0C39:"\u0C35\u0C3E",\u0C2E:"\u0C35\u0C41","\u0C42":"\u0C41\u0C3E","\u0C44":"\u0C43\u0C3E",\u0CE1:"\u0C8C\u0CBE",\u0D08:"\u0D07\u0D57",\u0D10:"\u0D0E\u0D46",\u0D13:"\u0D12\u0D3E",\u0D14:"\u0D12\u0D57",\u0D61:"\u0D1E","\u0D6B":"\u0D26\u0D4D\u0D30","\u0D79":"\u0D28\u0D41",\u0D0C:"\u0D28\u0D41",\u0D19:"\u0D28\u0D41","\u0D6F":"\u0D28\u0D4D","\u0D7B":"\u0D28\u0D4D","\u0D6C":"\u0D28\u0D4D\u0D28","\u0D5A":"\u0D28\u0D4D\u0D2E",\u0D31:"\u0D30","\u0D6A":"\u0D30\u0D4D","\u0D7C":"\u0D30\u0D4D","\u0D6E":"\u0D35\u0D4D\u0D30","\u0D76":"\u0D39\u0D4D\u0D2E","\u0D42":"\u0D41","\u0D43":"\u0D41","\u0D48":"\u0D46\u0D46","\u0DEA":"\u0DA2","\u0DEB":"\u0DAF","\u{11413}":"\u{11434}\u{11442}\u{11412}","\u{11419}":"\u{11434}\u{11442}\u{11418}","\u{11424}":"\u{11434}\u{11442}\u{11423}","\u{1142A}":"\u{11434}\u{11442}\u{11429}","\u{1142D}":"\u{11434}\u{11442}\u{1142C}","\u{1142F}":"\u{11434}\u{11442}\u{1142E}","\u{115D8}":"\u{11582}","\u{115D9}":"\u{11582}","\u{115DA}":"\u{11583}","\u{115DB}":"\u{11584}","\u{115DC}":"\u{115B2}","\u{115DD}":"\u{115B3}",\u0E03:"\u0E02",\u0E14:"\u0E04",\u0E15:"\u0E04",\u0E21:"\u0E06",\u0E88:"\u0E08",\u0E0B:"\u0E0A",\u0E0F:"\u0E0E",\u0E17:"\u0E11",\u0E9A:"\u0E1A",\u0E9B:"\u0E1B",\u0E9D:"\u0E1D",\u0E9E:"\u0E1E",\u0E9F:"\u0E1F",\u0E26:"\u0E20",\u0E8D:"\u0E22","\u17D4":"\u0E2F",\u0E45:"\u0E32",\u0E33:"\u030A\u0E32","\u17B7":"\u0E34","\u17B8":"\u0E35","\u17B9":"\u0E36","\u17BA":"\u0E37","\u0EB8":"\u0E38","\u0EB9":"\u0E39",\u0E41:"\u0E40\u0E40",\u0EDC:"\u0EAB\u0E99",\u0EDD:"\u0EAB\u0EA1",\u0EB3:"\u030A\u0EB2","\u0F02":"\u0F60\u0F74\u0F82\u0F7F","\u0F03":"\u0F60\u0F74\u0F82\u0F14",\u0F6A:"\u0F62",\u0F00:"\u0F68\u0F7C\u0F7E","\u0F77":"\u0FB2\u0F71\u0F80","\u0F79":"\u0FB3\u0F71\u0F80","\u{11CB2}":"\u{11CAA}","\u1081":"\u1002\u103E",\u1000:"\u1002\u102C","\u1070":"\u1003\u103E","\u1066":"\u1015\u103E",\u101F:"\u1015\u102C","\u106F":"\u1015\u102C\u103E","\u107E":"\u107D\u103E",\u1029:"\u101E\u103C",\u102A:"\u101E\u103C\u1031\u102C\u103A","\u109E":"\u1083\u030A",\u17A3:"\u17A2","\u19D0":"\u199E","\u19D1":"\u19B1","\u1A80":"\u1A45","\u1A90":"\u1A45","\uAA53":"\uAA01","\uAA56":"\uAA23","\u1B52":"\u1B0D","\u1B53":"\u1B11","\u1B58":"\u1B28","\uA9A3":"\uA99D",\u1896:"\u185C",\u1855:"\u1835",\u1FF6:"\u13EF",\u140D:"\u1401\xB7",\u142B:"\u1401\u1420",\u1411:"\u1404\xB7",\u1413:"\u1405\xB7",\u142D:"\u1405\u1420",\u1415:"\u1406\xB7",\u1418:"\u140A\xB7",\u142E:"\u140A\u1420",\u141A:"\u140B\xB7","\u18DD":"\u141E\u18DF",\u14D1:"\u1421",\u1540:"\u1429",\u143F:"\u1432\xB7",\u1443:"\u1434\xB7","\u2369":"\u1435",\u1447:"\u1439\xB7",\u145C:"\u144F\xB7","\u2E27":"\u1450","\u2283":"\u1450",\u145E:"\u1450\xB7",\u1469:"\u1450'","\u27C9":"\u1450/","\u2AD7":"\u1450\u1455",\u1460:"\u1451\xB7","\u2E26":"\u1455","\u2282":"\u1455",\u1462:"\u1455\xB7",\u146A:"\u1455'",\u1464:"\u1456\xB7",\u1475:"\u146B\xB7",\u1485:"\u146B'",\u1479:"\u146E\xB7",\u147D:"\u1470\xB7",\u1603:"\u1489",\u1493:"\u1489\xB7",\u1495:"\u148B\xB7",\u1497:"\u148C\xB7",\u149B:"\u148E\xB7",\u1602:"\u1490",\u149D:"\u1490\xB7",\u149F:"\u1491\xB7",\u14AD:"\u14A3\xB7",\u14B1:"\u14A6\xB7",\u14B3:"\u14A7\xB7",\u14B5:"\u14A8\xB7",\u14B9:"\u14AB\xB7",\u14CA:"\u14C0\xB7","\u18C7":"\u14C2\xB7","\u18C9":"\u14C3\xB7","\u18CB":"\u14C4\xB7","\u18CD":"\u14C5\xB7",\u14CC:"\u14C7\xB7",\u14CE:"\u14C8\xB7",\u1604:"\u14D3",\u14DD:"\u14D3\xB7",\u14DF:"\u14D5\xB7",\u14E1:"\u14D6\xB7",\u14E3:"\u14D7\xB7",\u14E5:"\u14D8\xB7",\u1607:"\u14DA",\u14E7:"\u14DA\xB7",\u14E9:"\u14DB\xB7",\u14F7:"\u14ED\xB7",\u14F9:"\u14EF\xB7",\u14FB:"\u14F0\xB7",\u14FD:"\u14F1\xB7",\u14FF:"\u14F2\xB7",\u1501:"\u14F4\xB7",\u1503:"\u14F5\xB7",\u150C:"\u150B<",\u150E:"\u150Bb",\u150D:"\u150B\u1455",\u150F:"\u150B\u1490",\u1518:"\u1510\xB7",\u151A:"\u1511\xB7",\u151C:"\u1512\xB7",\u151E:"\u1513\xB7",\u1520:"\u1514\xB7",\u1522:"\u1515\xB7",\u1524:"\u1516\xB7",\u1532:"\u1528\xB7",\u1534:"\u1529\xB7",\u1536:"\u152A\xB7",\u1538:"\u152B\xB7",\u153A:"\u152D\xB7",\u153C:"\u152E\xB7",\u1622:"\u1543","\u18E0":"\u1543\xB7",\u1623:"\u1546",\u1624:"\u154A",\u154F:"\u154C\xB7",\u1583:"\u1550b",\u1584:"\u1550b\u0307",\u1581:"\u1550d",\u157F:"\u1550P",\u166F:"\u1550\u146B",\u157E:"\u1550\u146C",\u1580:"\u1550\u146E",\u1582:"\u1550\u1470",\u1585:"\u1550\u1483",\u155C:"\u155A\xB7","\u18E3":"\u155E\xB7","\u18E4":"\u1566\xB7",\u1569:"\u1567\xB7","\u18E5":"\u156B\xB7","\u18E8":"\u1586\xB7",\u1591:"\u1595J",\u1670:"\u1595\u1489",\u158E:"\u1595\u148A",\u158F:"\u1595\u148B",\u1590:"\u1595\u148C",\u1592:"\u1595\u148E",\u1593:"\u1595\u1490",\u1594:"\u1595\u1491",\u1673:"\u1596J",\u1671:"\u1596\u148B",\u1672:"\u1596\u148C",\u1674:"\u1596\u148E",\u1675:"\u1596\u1490",\u1676:"\u1596\u1491","\u18EA":"\u1597\xB7","\u1677":"\u15A7\xB7","\u1678":"\u15A8\xB7","\u1679":"\u15A9\xB7","\u167A":"\u15AA\xB7","\u167B":"\u15AB\xB7","\u167C":"\u15AC\xB7","\u167D":"\u15AD\xB7","\u2AAB":"\u15D2","\u2AAA":"\u15D5","\uA4F7":"\u15E1","\u18F0":"\u15F4\xB7","\u18F2":"\u161B\xB7","\u1DBB":"\u1646","\uA4ED":"\u1660","\u1DBA":"\u18D4","\u1D3E":"\u18D6","\u18DC":"\u18DF\u141E",\u02E1:"\u18F3",\u02B3:"\u18F4",\u02E2:"\u18F5","\u18DB":"\u18F5","\uA6B0":"\u16B9",\u16E1:"\u16BC","\u237F":"\u16BD",\u16C2:"\u16BD","\u{1D23F}":"\u16CB","\u2191":"\u16CF","\u21BF":"\u16D0","\u296E":"\u16D0\u21C2","\u2963":"\u16D0\u16DA","\u2D63":"\u16EF","\u21BE":"\u16DA","\u2A21":"\u16DA","\u22C4":"\u16DC","\u25C7":"\u16DC","\u25CA":"\u16DC","\u2662":"\u16DC","\u{1F754}":"\u16DC","\u{118B7}":"\u16DC","\u{10294}":"\u16DC","\u235A":"\u16DC\u0332","\u22C8":"\u16DE","\u2A1D":"\u16DE","\u{104D0}":"\u16E6","\u2195":"\u16E8","\u{10CFC}":"\u{10C82}","\u{10CFA}":"\u{10CA5}",\u3131:"\u1100",\u11A8:"\u1100",\u1101:"\u1100\u1100",\u3132:"\u1100\u1100",\u11A9:"\u1100\u1100","\u11FA":"\u1100\u1102","\u115A":"\u1100\u1103",\u11C3:"\u1100\u1105","\u11FB":"\u1100\u1107",\u11AA:"\u1100\u1109",\u3133:"\u1100\u1109",\u11C4:"\u1100\u1109\u1100","\u11FC":"\u1100\u110E","\u11FD":"\u1100\u110F","\u11FE":"\u1100\u1112",\u3134:"\u1102",\u11AB:"\u1102",\u1113:"\u1102\u1100",\u11C5:"\u1102\u1100",\u1114:"\u1102\u1102",\u3165:"\u1102\u1102","\u11FF":"\u1102\u1102",\u1115:"\u1102\u1103",\u3166:"\u1102\u1103",\u11C6:"\u1102\u1103","\uD7CB":"\u1102\u1105",\u1116:"\u1102\u1107","\u115B":"\u1102\u1109",\u11C7:"\u1102\u1109",\u3167:"\u1102\u1109","\u115C":"\u1102\u110C",\u11AC:"\u1102\u110C",\u3135:"\u1102\u110C","\uD7CC":"\u1102\u110E",\u11C9:"\u1102\u1110","\u115D":"\u1102\u1112",\u11AD:"\u1102\u1112",\u3136:"\u1102\u1112",\u11C8:"\u1102\u1140",\u3168:"\u1102\u1140",\u3137:"\u1103",\u11AE:"\u1103",\u1117:"\u1103\u1100",\u11CA:"\u1103\u1100",\u1104:"\u1103\u1103",\u3138:"\u1103\u1103","\uD7CD":"\u1103\u1103","\uD7CE":"\u1103\u1103\u1107","\u115E":"\u1103\u1105",\u11CB:"\u1103\u1105","\uA960":"\u1103\u1106","\uA961":"\u1103\u1107","\uD7CF":"\u1103\u1107","\uA962":"\u1103\u1109","\uD7D0":"\u1103\u1109","\uD7D1":"\u1103\u1109\u1100","\uA963":"\u1103\u110C","\uD7D2":"\u1103\u110C","\uD7D3":"\u1103\u110E","\uD7D4":"\u1103\u1110",\u3139:"\u1105",\u11AF:"\u1105","\uA964":"\u1105\u1100",\u11B0:"\u1105\u1100",\u313A:"\u1105\u1100","\uA965":"\u1105\u1100\u1100","\uD7D5":"\u1105\u1100\u1100",\u11CC:"\u1105\u1100\u1109",\u3169:"\u1105\u1100\u1109","\uD7D6":"\u1105\u1100\u1112",\u1118:"\u1105\u1102",\u11CD:"\u1105\u1102","\uA966":"\u1105\u1103",\u11CE:"\u1105\u1103",\u316A:"\u1105\u1103","\uA967":"\u1105\u1103\u1103",\u11CF:"\u1105\u1103\u1112",\u1119:"\u1105\u1105",\u11D0:"\u1105\u1105","\uD7D7":"\u1105\u1105\u110F","\uA968":"\u1105\u1106",\u11B1:"\u1105\u1106",\u313B:"\u1105\u1106",\u11D1:"\u1105\u1106\u1100",\u11D2:"\u1105\u1106\u1109","\uD7D8":"\u1105\u1106\u1112","\uA969":"\u1105\u1107",\u11B2:"\u1105\u1107",\u313C:"\u1105\u1107","\uD7D9":"\u1105\u1107\u1103","\uA96A":"\u1105\u1107\u1107",\u11D3:"\u1105\u1107\u1109",\u316B:"\u1105\u1107\u1109","\uA96B":"\u1105\u1107\u110B",\u11D5:"\u1105\u1107\u110B","\uD7DA":"\u1105\u1107\u1111",\u11D4:"\u1105\u1107\u1112","\uA96C":"\u1105\u1109",\u11B3:"\u1105\u1109",\u313D:"\u1105\u1109",\u11D6:"\u1105\u1109\u1109",\u111B:"\u1105\u110B","\uD7DD":"\u1105\u110B","\uA96D":"\u1105\u110C","\uA96E":"\u1105\u110F",\u11D8:"\u1105\u110F",\u11B4:"\u1105\u1110",\u313E:"\u1105\u1110",\u11B5:"\u1105\u1111",\u313F:"\u1105\u1111",\u111A:"\u1105\u1112",\u3140:"\u1105\u1112",\u113B:"\u1105\u1112",\u11B6:"\u1105\u1112","\uD7F2":"\u1105\u1112",\u11D7:"\u1105\u1140",\u316C:"\u1105\u1140","\uD7DB":"\u1105\u114C",\u11D9:"\u1105\u1159",\u316D:"\u1105\u1159","\uD7DC":"\u1105\u1159\u1112",\u3141:"\u1106",\u11B7:"\u1106","\uA96F":"\u1106\u1100",\u11DA:"\u1106\u1100","\uD7DE":"\u1106\u1102","\uD7DF":"\u1106\u1102\u1102","\uA970":"\u1106\u1103",\u11DB:"\u1106\u1105","\uD7E0":"\u1106\u1106",\u111C:"\u1106\u1107",\u316E:"\u1106\u1107",\u11DC:"\u1106\u1107","\uD7E1":"\u1106\u1107\u1109","\uA971":"\u1106\u1109",\u11DD:"\u1106\u1109",\u316F:"\u1106\u1109",\u11DE:"\u1106\u1109\u1109",\u111D:"\u1106\u110B",\u3171:"\u1106\u110B",\u11E2:"\u1106\u110B","\uD7E2":"\u1106\u110C",\u11E0:"\u1106\u110E",\u11E1:"\u1106\u1112",\u11DF:"\u1106\u1140",\u3170:"\u1106\u1140",\u3142:"\u1107",\u11B8:"\u1107",\u111E:"\u1107\u1100",\u3172:"\u1107\u1100",\u111F:"\u1107\u1102",\u1120:"\u1107\u1103",\u3173:"\u1107\u1103","\uD7E3":"\u1107\u1103",\u11E3:"\u1107\u1105","\uD7E4":"\u1107\u1105\u1111","\uD7E5":"\u1107\u1106",\u1108:"\u1107\u1107",\u3143:"\u1107\u1107","\uD7E6":"\u1107\u1107",\u112C:"\u1107\u1107\u110B",\u3179:"\u1107\u1107\u110B",\u1121:"\u1107\u1109",\u3144:"\u1107\u1109",\u11B9:"\u1107\u1109",\u1122:"\u1107\u1109\u1100",\u3174:"\u1107\u1109\u1100",\u1123:"\u1107\u1109\u1103",\u3175:"\u1107\u1109\u1103","\uD7E7":"\u1107\u1109\u1103",\u1124:"\u1107\u1109\u1107",\u1125:"\u1107\u1109\u1109",\u1126:"\u1107\u1109\u110C","\uA972":"\u1107\u1109\u1110",\u112B:"\u1107\u110B",\u3178:"\u1107\u110B",\u11E6:"\u1107\u110B",\u1127:"\u1107\u110C",\u3176:"\u1107\u110C","\uD7E8":"\u1107\u110C",\u1128:"\u1107\u110E","\uD7E9":"\u1107\u110E","\uA973":"\u1107\u110F",\u1129:"\u1107\u1110",\u3177:"\u1107\u1110",\u112A:"\u1107\u1111",\u11E4:"\u1107\u1111","\uA974":"\u1107\u1112",\u11E5:"\u1107\u1112",\u3145:"\u1109",\u11BA:"\u1109",\u112D:"\u1109\u1100",\u317A:"\u1109\u1100",\u11E7:"\u1109\u1100",\u112E:"\u1109\u1102",\u317B:"\u1109\u1102",\u112F:"\u1109\u1103",\u317C:"\u1109\u1103",\u11E8:"\u1109\u1103",\u1130:"\u1109\u1105",\u11E9:"\u1109\u1105",\u1131:"\u1109\u1106","\uD7EA":"\u1109\u1106",\u1132:"\u1109\u1107",\u317D:"\u1109\u1107",\u11EA:"\u1109\u1107",\u1133:"\u1109\u1107\u1100","\uD7EB":"\u1109\u1107\u110B",\u110A:"\u1109\u1109",\u3146:"\u1109\u1109",\u11BB:"\u1109\u1109","\uD7EC":"\u1109\u1109\u1100","\uD7ED":"\u1109\u1109\u1103","\uA975":"\u1109\u1109\u1107",\u1134:"\u1109\u1109\u1109",\u1135:"\u1109\u110B",\u1136:"\u1109\u110C",\u317E:"\u1109\u110C","\uD7EF":"\u1109\u110C",\u1137:"\u1109\u110E","\uD7F0":"\u1109\u110E",\u1138:"\u1109\u110F",\u1139:"\u1109\u1110","\uD7F1":"\u1109\u1110",\u113A:"\u1109\u1111","\uD7EE":"\u1109\u1140",\u3147:"\u110B",\u11BC:"\u110B",\u1141:"\u110B\u1100",\u11EC:"\u110B\u1100",\u11ED:"\u110B\u1100\u1100",\u1142:"\u110B\u1103","\uA976":"\u110B\u1105",\u1143:"\u110B\u1106",\u1144:"\u110B\u1107",\u1145:"\u110B\u1109",\u11F1:"\u110B\u1109",\u3182:"\u110B\u1109",\u1147:"\u110B\u110B",\u3180:"\u110B\u110B",\u11EE:"\u110B\u110B",\u1148:"\u110B\u110C",\u1149:"\u110B\u110E",\u11EF:"\u110B\u110F",\u114A:"\u110B\u1110",\u114B:"\u110B\u1111","\uA977":"\u110B\u1112",\u1146:"\u110B\u1140",\u11F2:"\u110B\u1140",\u3183:"\u110B\u1140",\u3148:"\u110C",\u11BD:"\u110C","\uD7F7":"\u110C\u1107","\uD7F8":"\u110C\u1107\u1107",\u114D:"\u110C\u110B",\u110D:"\u110C\u110C",\u3149:"\u110C\u110C","\uD7F9":"\u110C\u110C","\uA978":"\u110C\u110C\u1112",\u314A:"\u110E",\u11BE:"\u110E",\u1152:"\u110E\u110F",\u1153:"\u110E\u1112",\u314B:"\u110F",\u11BF:"\u110F",\u314C:"\u1110",\u11C0:"\u1110","\uA979":"\u1110\u1110",\u314D:"\u1111",\u11C1:"\u1111",\u1156:"\u1111\u1107",\u11F3:"\u1111\u1107","\uD7FA":"\u1111\u1109",\u1157:"\u1111\u110B",\u3184:"\u1111\u110B",\u11F4:"\u1111\u110B","\uD7FB":"\u1111\u1110","\uA97A":"\u1111\u1112",\u314E:"\u1112",\u11C2:"\u1112",\u11F5:"\u1112\u1102",\u11F6:"\u1112\u1105",\u11F7:"\u1112\u1106",\u11F8:"\u1112\u1107","\uA97B":"\u1112\u1109",\u1158:"\u1112\u1112",\u3185:"\u1112\u1112",\u113D:"\u113C\u113C",\u113F:"\u113E\u113E",\u317F:"\u1140",\u11EB:"\u1140","\uD7F3":"\u1140\u1107","\uD7F4":"\u1140\u1107\u110B",\u3181:"\u114C",\u11F0:"\u114C","\uD7F5":"\u114C\u1106","\uD7F6":"\u114C\u1112",\u114F:"\u114E\u114E",\u1151:"\u1150\u1150",\u3186:"\u1159",\u11F9:"\u1159","\uA97C":"\u1159\u1159",\u3164:"\u1160",\u314F:"\u1161","\u11A3":"\u1161\u30FC",\u1176:"\u1161\u1169",\u1177:"\u1161\u116E",\u1162:"\u1161\u4E28",\u3150:"\u1161\u4E28",\u3151:"\u1163",\u1178:"\u1163\u1169",\u1179:"\u1163\u116D","\u11A4":"\u1163\u116E",\u1164:"\u1163\u4E28",\u3152:"\u1163\u4E28",\u3153:"\u1165",\u117C:"\u1165\u30FC",\u117A:"\u1165\u1169",\u117B:"\u1165\u116E",\u1166:"\u1165\u4E28",\u3154:"\u1165\u4E28",\u3155:"\u1167","\u11A5":"\u1167\u1163",\u117D:"\u1167\u1169",\u117E:"\u1167\u116E",\u1168:"\u1167\u4E28",\u3156:"\u1167\u4E28",\u3157:"\u1169",\u116A:"\u1169\u1161",\u3158:"\u1169\u1161",\u116B:"\u1169\u1161\u4E28",\u3159:"\u1169\u1161\u4E28","\u11A6":"\u1169\u1163","\u11A7":"\u1169\u1163\u4E28",\u117F:"\u1169\u1165",\u1180:"\u1169\u1165\u4E28","\uD7B0":"\u1169\u1167",\u1181:"\u1169\u1167\u4E28",\u1182:"\u1169\u1169","\uD7B1":"\u1169\u1169\u4E28",\u1183:"\u1169\u116E",\u116C:"\u1169\u4E28",\u315A:"\u1169\u4E28",\u315B:"\u116D","\uD7B2":"\u116D\u1161","\uD7B3":"\u116D\u1161\u4E28",\u1184:"\u116D\u1163",\u3187:"\u116D\u1163",\u1186:"\u116D\u1163",\u1185:"\u116D\u1163\u4E28",\u3188:"\u116D\u1163\u4E28","\uD7B4":"\u116D\u1165",\u1187:"\u116D\u1169",\u1188:"\u116D\u4E28",\u3189:"\u116D\u4E28",\u315C:"\u116E",\u1189:"\u116E\u1161",\u118A:"\u116E\u1161\u4E28",\u116F:"\u116E\u1165",\u315D:"\u116E\u1165",\u118B:"\u116E\u1165\u30FC",\u1170:"\u116E\u1165\u4E28",\u315E:"\u116E\u1165\u4E28","\uD7B5":"\u116E\u1167",\u118C:"\u116E\u1167\u4E28",\u118D:"\u116E\u116E",\u1171:"\u116E\u4E28",\u315F:"\u116E\u4E28","\uD7B6":"\u116E\u4E28\u4E28",\u3160:"\u1172",\u118E:"\u1172\u1161","\uD7B7":"\u1172\u1161\u4E28",\u118F:"\u1172\u1165",\u1190:"\u1172\u1165\u4E28",\u1191:"\u1172\u1167",\u318A:"\u1172\u1167",\u1192:"\u1172\u1167\u4E28",\u318B:"\u1172\u1167\u4E28","\uD7B8":"\u1172\u1169",\u1193:"\u1172\u116E",\u1194:"\u1172\u4E28",\u318C:"\u1172\u4E28",\u318D:"\u119E","\uD7C5":"\u119E\u1161",\u119F:"\u119E\u1165","\uD7C6":"\u119E\u1165\u4E28",\u11A0:"\u119E\u116E",\u11A2:"\u119E\u119E",\u11A1:"\u119E\u4E28",\u318E:"\u119E\u4E28",\u30D8:"\u3078","\u2341":"\u303C","\u29C4":"\u303C","\uA49E":"\uA04A","\uA4AC":"\uA050","\uA49C":"\uA0C0","\uA4A8":"\uA132","\uA4BF":"\uA259","\uA4BE":"\uA2B1","\uA494":"\uA2CD","\uA4C0":"\uA3AB","\uA4C2":"\uA3B5","\uA4BA":"\uA3BF","\uA4B0":"\uA3C2","\uA4A7":"\uA458","\u22A5":"\uA4D5","\u27C2":"\uA4D5","\u{1D21C}":"\uA4D5","\uA7B1":"\uA4D5","\uA79E":"\uA4E4","\u2141":"\uA4E8","\u2142":"\uA4F6","\u{1D215}":"\uA4F6","\u{1D22B}":"\uA4F6","\u{16F26}":"\uA4F6","\u{10411}":"\uA4F6","\u2143":"\u{16F00}","\u{11AE6}":"\u{11AE5}\u{11AEF}","\u{11AE8}":"\u{11AE5}\u{11AE5}","\u{11AE9}":"\u{11AE5}\u{11AE5}\u{11AEF}","\u{11AEA}":"\u{11AE5}\u{11AE5}\u{11AF0}","\u{11AE7}":"\u{11AE5}\u{11AF0}","\u{11AF4}":"\u{11AF3}\u{11AEF}","\u{11AF6}":"\u{11AF3}\u{11AF3}","\u{11AF7}":"\u{11AF3}\u{11AF3}\u{11AEF}","\u{11AF8}":"\u{11AF3}\u{11AF3}\u{11AF0}","\u{11AF5}":"\u{11AF3}\u{11AF0}","\u{11AEC}":"\u{11AEB}\u{11AEF}","\u{11AED}":"\u{11AEB}\u{11AEB}","\u{11AEE}":"\u{11AEB}\u{11AEB}\u{11AEF}","\u2295":"\u{102A8}","\u2A01":"\u{102A8}","\u{1F728}":"\u{102A8}","\uA69A":"\u{102A8}","\u25BD":"\u{102BC}","\u{1D214}":"\u{102BC}","\u{1F704}":"\u{102BC}","\u29D6":"\u{102C0}","\uA79B":"\u{1043A}","\uA79A":"\u{10412}","\u{104A0}":"\u{10486}","\u{103D1}":"\u{10382}","\u{103D3}":"\u{10393}","\u{12038}":"\u{1039A}","\u2625":"\u{1099E}","\u{132F9}":"\u{1099E}","\u3039":"\u5344",\uF967:"\u4E0D","\u{2F800}":"\u4E3D","\uFA70":"\u4E26","\u239C":"\u4E28","\u239F":"\u4E28","\u23A2":"\u4E28","\u23A5":"\u4E28","\u23AA":"\u4E28","\u23AE":"\u4E28","\u31D1":"\u4E28",\u1175:"\u4E28",\u3163:"\u4E28","\u2F01":"\u4E28",\u119C:"\u4E28\u30FC",\u1198:"\u4E28\u1161",\u1199:"\u4E28\u1163","\uD7BD":"\u4E28\u1163\u1169","\uD7BE":"\u4E28\u1163\u4E28","\uD7BF":"\u4E28\u1167","\uD7C0":"\u4E28\u1167\u4E28",\u119A:"\u4E28\u1169","\uD7C1":"\u4E28\u1169\u4E28","\uD7C2":"\u4E28\u116D",\u119B:"\u4E28\u116E","\uD7C3":"\u4E28\u1172",\u119D:"\u4E28\u119E","\uD7C4":"\u4E28\u4E28",\uF905:"\u4E32","\u{2F801}":"\u4E38",\uF95E:"\u4E39","\u{2F802}":"\u4E41","\u31E0":"\u4E59","\u2F04":"\u4E59","\u31DF":"\u4E5A","\u2E83":"\u4E5A","\u31D6":"\u4E5B","\u2E82":"\u4E5B","\u2EF2":"\u4E80",\uF91B:"\u4E82","\u31DA":"\u4E85","\u2F05":"\u4E85",\uF9BA:"\u4E86",\u30CB:"\u4E8C","\u2F06":"\u4E8C","\u{2F803}":"\u{20122}","\u2F07":"\u4EA0",\uF977:"\u4EAE","\u2F08":"\u4EBA",\u30A4:"\u4EBB","\u2E85":"\u4EBB",\uF9FD:"\u4EC0","\u{2F819}":"\u4ECC",\uF9A8:"\u4EE4","\u{2F804}":"\u4F60",\u5002:"\u4F75","\u{2F807}":"\u4F75","\uFA73":"\u4F80",\uF92D:"\u4F86",\uF9B5:"\u4F8B","\uFA30":"\u4FAE","\u{2F805}":"\u4FAE","\u{2F806}":"\u4FBB",\uF965:"\u4FBF",\u503C:"\u5024",\uF9D4:"\u502B","\u{2F808}":"\u507A","\u{2F809}":"\u5099","\u{2F80B}":"\u50CF",\uF9BB:"\u50DA","\uFA31":"\u50E7","\u{2F80A}":"\u50E7","\u{2F80C}":"\u349E","\u2F09":"\u513F",\uFA0C:"\u5140","\u2E8E":"\u5140","\uFA74":"\u5145","\uFA32":"\u514D","\u{2F80E}":"\u514D","\u{2F80F}":"\u5154","\u{2F810}":"\u5164","\u2F0A":"\u5165","\u{2F814}":"\u5167","\uFA72":"\u5168",\uF978:"\u5169",\u30CF:"\u516B","\u2F0B":"\u516B",\uF9D1:"\u516D","\u{2F811}":"\u5177","\u{2F812}":"\u{2051C}","\u{2F91B}":"\u{20525}","\uFA75":"\u5180","\u{2F813}":"\u34B9","\u2F0C":"\u5182","\u{2F815}":"\u518D","\u{2F816}":"\u{2054B}","\u{2F8D2}":"\u5192","\u{2F8D3}":"\u5195","\u{2F9CA}":"\u34BB","\u{2F8D4}":"\u6700","\u2F0D":"\u5196","\u{2F817}":"\u5197","\u{2F818}":"\u51A4","\u2F0E":"\u51AB","\u{2F81A}":"\u51AC","\uFA71":"\u51B5","\u{2F81B}":"\u51B5",\uF92E:"\u51B7",\uF979:"\u51C9",\uF955:"\u51CC",\uF954:"\u51DC",\uFA15:"\u51DE","\u2F0F":"\u51E0","\u{2F80D}":"\u{2063A}","\u{2F81D}":"\u51F5","\u2F10":"\u51F5","\u2F11":"\u5200","\u2E89":"\u5202","\u{2F81E}":"\u5203",\uFA00:"\u5207","\u{2F850}":"\u5207",\uF99C:"\u5217",\uF9DD:"\u5229","\u{2F81F}":"\u34DF",\uF9FF:"\u523A","\u{2F820}":"\u523B","\u{2F821}":"\u5246","\u{2F822}":"\u5272","\u{2F823}":"\u5277",\uF9C7:"\u5289","\u{2F9D9}":"\u{20804}",\u30AB:"\u529B",\uF98A:"\u529B","\u2F12":"\u529B",\uF99D:"\u52A3","\u{2F824}":"\u3515","\u{2F992}":"\u52B3","\uFA76":"\u52C7","\u{2F825}":"\u52C7","\uFA33":"\u52C9","\u{2F826}":"\u52C9",\uF952:"\u52D2",\uF92F:"\u52DE","\uFA34":"\u52E4","\u{2F827}":"\u52E4",\uF97F:"\u52F5","\u2F13":"\u52F9","\uFA77":"\u52FA","\u{2F828}":"\u52FA","\u{2F829}":"\u5305","\u{2F82A}":"\u5306","\u{2F9DD}":"\u{208DE}","\u2F14":"\u5315",\uF963:"\u5317","\u{2F82B}":"\u5317","\u2F15":"\u531A","\u2F16":"\u5338",\uF9EB:"\u533F","\u2F17":"\u5341","\u3038":"\u5341","\u303A":"\u5345","\u{2F82C}":"\u5349","\u0FD6":"\u534D","\u0FD5":"\u5350","\uFA35":"\u5351","\u{2F82D}":"\u5351","\u{2F82E}":"\u535A",\u30C8:"\u535C","\u2F18":"\u535C","\u2F19":"\u5369","\u2E8B":"\u353E","\u{2F82F}":"\u5373",\uF91C:"\u5375","\u{2F830}":"\u537D","\u{2F831}":"\u537F","\u{2F832}":"\u537F","\u{2F833}":"\u537F","\u2F1A":"\u5382","\u{2F834}":"\u{20A2C}","\u2F1B":"\u53B6",\uF96B:"\u53C3","\u2F1C":"\u53C8","\u{2F836}":"\u53CA","\u{2F837}":"\u53DF","\u{2F838}":"\u{20B63}",\u30ED:"\u53E3","\u2F1D":"\u53E3",\u56D7:"\u53E3","\u2F1E":"\u53E3",\uF906:"\u53E5","\u{2F839}":"\u53EB","\u{2F83A}":"\u53F1","\u{2F83B}":"\u5406",\uF9DE:"\u540F",\uF9ED:"\u541D","\u{2F83D}":"\u5438",\uF980:"\u5442","\u{2F83E}":"\u5448","\u{2F83F}":"\u5468","\u{2F83C}":"\u549E","\u{2F840}":"\u54A2",\uF99E:"\u54BD",\u439B:"\u3588","\u{2F841}":"\u54F6","\u{2F842}":"\u5510","\u{2F843}":"\u5553",\u555F:"\u5553","\uFA79":"\u5555","\u{2F844}":"\u5563","\u{2F845}":"\u5584","\u{2F846}":"\u5584",\uF90B:"\u5587","\uFA7A":"\u5599","\u{2F847}":"\u5599","\uFA36":"\u559D","\uFA78":"\u559D","\u{2F848}":"\u55AB","\u{2F849}":"\u55B3",\uFA0D:"\u55C0","\u{2F84A}":"\u55C2","\uFA7B":"\u55E2","\uFA37":"\u5606","\u{2F84C}":"\u5606","\u{2F84E}":"\u5651","\u{2F84F}":"\u5674","\uFA38":"\u5668",\uF9A9:"\u56F9","\u{2F84B}":"\u5716","\u{2F84D}":"\u5717","\u2F1F":"\u571F",\u58EB:"\u571F","\u2F20":"\u571F","\u{2F855}":"\u578B","\u{2F852}":"\u57CE",\u39B3:"\u363D","\u{2F853}":"\u57F4","\u{2F854}":"\u580D","\u{2F857}":"\u5831","\u{2F856}":"\u5832","\uFA39":"\u5840",\uFA10:"\u585A","\uFA7C":"\u585A",\uF96C:"\u585E",\u586B:"\u5861",\u58FF:"\u58AB","\u{2F858}":"\u58AC","\uFA7D":"\u58B3",\uF94A:"\u58D8",\uF942:"\u58DF","\u{2F859}":"\u{214E4}","\u{2F851}":"\u58EE","\u{2F85A}":"\u58F2","\u{2F85B}":"\u58F7","\u2F21":"\u5902","\u{2F85C}":"\u5906","\u2F22":"\u590A",\u30BF:"\u5915","\u2F23":"\u5915","\u{2F85D}":"\u591A","\u{2F85E}":"\u5922","\u2F24":"\u5927","\uFA7E":"\u5944",\uF90C:"\u5948",\uF909:"\u5951","\uFA7F":"\u5954","\u{2F85F}":"\u5962",\uF981:"\u5973","\u2F25":"\u5973","\u{2F860}":"\u{216A8}","\u{2F861}":"\u{216EA}","\u{2F865}":"\u59D8","\u{2F862}":"\u59EC","\u{2F863}":"\u5A1B","\u{2F864}":"\u5A27","\uFA80":"\u5A62","\u{2F866}":"\u5A66",\u5B00:"\u5AAF","\u{2F867}":"\u36EE","\u{2F868}":"\u36FC","\u{2F986}":"\u5AB5","\u{2F869}":"\u5B08","\uFA81":"\u5B28","\u{2F86A}":"\u5B3E","\u{2F86B}":"\u5B3E","\u2F26":"\u5B50","\u2F27":"\u5B80",\uFA04:"\u5B85","\u{2F86C}":"\u{219C8}","\u{2F86D}":"\u5BC3","\u{2F86E}":"\u5BD8",\uF95F:"\u5BE7",\uF9AA:"\u5BE7","\u{2F86F}":"\u5BE7",\uF9BC:"\u5BEE","\u{2F870}":"\u5BF3","\u{2F871}":"\u{21B18}","\u2F28":"\u5BF8","\u{2F872}":"\u5BFF","\u{2F873}":"\u5C06","\u2F29":"\u5C0F","\u{2F875}":"\u5C22","\u2E90":"\u5C22","\u2F2A":"\u5C22","\u2E8F":"\u5C23","\u{2F876}":"\u3781","\u2F2B":"\u5C38",\uF9BD:"\u5C3F","\u{2F877}":"\u5C60",\uF94B:"\u5C62","\uFA3B":"\u5C64",\uF9DF:"\u5C65","\uFA3C":"\u5C6E","\u{2F878}":"\u5C6E","\u2F2C":"\u5C6E","\u{2F8F8}":"\u{21D0B}","\u2F2D":"\u5C71","\u{2F879}":"\u5CC0","\u{2F87A}":"\u5C8D","\u{2F87B}":"\u{21DE4}","\u{2F87D}":"\u{21DE6}",\uF9D5:"\u5D19","\u{2F87C}":"\u5D43",\uF921:"\u5D50","\u{2F87F}":"\u5D6B","\u{2F87E}":"\u5D6E","\u{2F880}":"\u5D7C","\u{2F9F4}":"\u5DB2",\uF9AB:"\u5DBA","\u2F2E":"\u5DDB","\u{2F882}":"\u5DE2",\u30A8:"\u5DE5","\u2F2F":"\u5DE5","\u2F30":"\u5DF1","\u2E92":"\u5DF3","\u{2F883}":"\u382F","\u{2F884}":"\u5DFD","\u2F31":"\u5DFE",\u5E32:"\u5E21","\u{2F885}":"\u5E28","\u{2F886}":"\u5E3D","\u{2F887}":"\u5E69","\u{2F888}":"\u3862","\u{2F889}":"\u{22183}","\u2F32":"\u5E72",\uF98E:"\u5E74","\u{2F939}":"\u{2219F}","\u2E93":"\u5E7A","\u2F33":"\u5E7A","\u2F34":"\u5E7F",\uFA01:"\u5EA6","\u{2F88A}":"\u387C","\u{2F88B}":"\u5EB0","\u{2F88C}":"\u5EB3","\u{2F88D}":"\u5EB6",\uF928:"\u5ECA","\u{2F88E}":"\u5ECA",\uF9A2:"\u5EC9","\uFA82":"\u5ED2",\uFA0B:"\u5ED3","\uFA83":"\u5ED9",\uF982:"\u5EEC","\u2F35":"\u5EF4","\u{2F890}":"\u5EFE","\u2F36":"\u5EFE","\u{2F891}":"\u{22331}","\u{2F892}":"\u{22331}",\uF943:"\u5F04","\u2F37":"\u5F0B","\u2F38":"\u5F13","\u{2F894}":"\u5F22","\u{2F895}":"\u5F22","\u2F39":"\u5F50","\u2E94":"\u5F51","\u{2F874}":"\u5F53","\u{2F896}":"\u38C7","\u2F3A":"\u5F61","\u{2F899}":"\u5F62","\uFA84":"\u5F69","\u{2F89A}":"\u5F6B","\u2F3B":"\u5F73",\uF9D8:"\u5F8B","\u{2F89B}":"\u38E3","\u{2F89C}":"\u5F9A",\uF966:"\u5FA9","\uFA85":"\u5FAD","\u2F3C":"\u5FC3","\u2E96":"\u5FC4","\u2E97":"\u38FA","\u{2F89D}":"\u5FCD","\u{2F89E}":"\u5FD7",\uF9A3:"\u5FF5","\u{2F89F}":"\u5FF9",\uF960:"\u6012",\uF9AC:"\u601C","\uFA6B":"\u6075","\u{2F8A2}":"\u391C","\u{2F8A1}":"\u393A","\u{2F8A0}":"\u6081","\uFA3D":"\u6094","\u{2F8A3}":"\u6094","\u{2F8A5}":"\u60C7","\uFA86":"\u60D8",\uF9B9:"\u60E1","\u{2F8A4}":"\u{226D4}","\uFA88":"\u6108","\uFA3E":"\u6168",\uF9D9:"\u6144","\u{2F8A6}":"\u6148","\u{2F8A7}":"\u614C","\u{2F8A9}":"\u614C","\uFA87":"\u614E","\u{2F8A8}":"\u614E","\uFA8A":"\u6160","\u{2F8AA}":"\u617A","\uFA3F":"\u618E","\uFA89":"\u618E","\u{2F8AB}":"\u618E",\uF98F:"\u6190","\u{2F8AD}":"\u61A4","\u{2F8AE}":"\u61AF","\u{2F8AC}":"\u61B2","\uFAD0":"\u{22844}","\uFACF":"\u{2284A}","\u{2F8AF}":"\u61DE","\uFA40":"\u61F2","\uFA8B":"\u61F2","\u{2F8B0}":"\u61F2",\uF90D:"\u61F6","\u{2F8B1}":"\u61F6",\uF990:"\u6200","\u2F3D":"\u6208","\u{2F8B2}":"\u6210","\u{2F8B3}":"\u621B",\uF9D2:"\u622E","\uFA8C":"\u6234","\u2F3E":"\u6236",\u6238:"\u6236","\u2F3F":"\u624B","\u2E98":"\u624C","\u{2F8B4}":"\u625D","\u{2F8B5}":"\u62B1",\uF925:"\u62C9",\uF95B:"\u62CF",\uFA02:"\u62D3","\u{2F8B6}":"\u62D4","\u{2F8BA}":"\u62FC",\uF973:"\u62FE","\u{2F8B8}":"\u{22B0C}","\u{2F8B9}":"\u633D","\u{2F8B7}":"\u6350","\u{2F8BB}":"\u6368",\uF9A4:"\u637B","\u{2F8BC}":"\u6383",\uF975:"\u63A0","\u{2F8C1}":"\u63A9","\uFA8D":"\u63C4","\u{2F8BD}":"\u63E4","\uFA8F":"\u6452","\u{2F8BE}":"\u{22BF1}","\uFA8E":"\u641C","\u{2F8BF}":"\u6422","\u{2F8C0}":"\u63C5","\u{2F8C3}":"\u6469","\u{2F8C6}":"\u6477","\u{2F8C4}":"\u647E","\u{2F8C2}":"\u3A2E",\u6409:"\u3A41",\uF991:"\u649A","\u{2F8C5}":"\u649D",\uF930:"\u64C4","\u{2F8C7}":"\u3A6C","\u2F40":"\u652F","\u2F41":"\u6534","\u2E99":"\u6535","\uFA41":"\u654F","\u{2F8C8}":"\u654F","\uFA90":"\u6556","\u{2F8C9}":"\u656C",\uF969:"\u6578","\u{2F8CA}":"\u{2300A}","\u2F42":"\u6587","\u2EEB":"\u6589","\u2F43":"\u6597",\uF9BE:"\u6599","\u2F44":"\u65A4","\u2F45":"\u65B9",\uF983:"\u65C5","\u2F46":"\u65E0","\u2E9B":"\u65E1","\uFA42":"\u65E2","\u{2F8CB}":"\u65E3","\u2F47":"\u65E5",\uF9E0:"\u6613",\u66F6:"\u3ADA","\u{2F8D1}":"\u3AE4","\u{2F8CD}":"\u6649",\u6669:"\u665A",\uFA12:"\u6674","\uFA91":"\u6674","\uFA43":"\u6691","\u{2F8CF}":"\u6691",\uF9C5:"\u6688","\u{2F8D0}":"\u3B08","\u{2F8D5}":"\u669C",\uFA06:"\u66B4",\uF98B:"\u66C6","\u{2F8CE}":"\u3B19","\u{2F897}":"\u{232B8}","\u2F48":"\u66F0",\uF901:"\u66F4","\u{2F8CC}":"\u66F8","\u2F49":"\u6708","\u{2F980}":"\u{2335F}",\u80A6:"\u670C",\u80D0:"\u670F",\u80CA:"\u6710",\u8101:"\u6713",\u80F6:"\u3B35",\uF929:"\u6717","\uFA92":"\u6717","\u{2F8D8}":"\u6717",\u8127:"\u6718","\uFA93":"\u671B","\u{2F8D9}":"\u671B",\u5E50:"\u3B3A",\u4420:"\u3B3B","\u{2F989}":"\u{23393}",\u81A7:"\u6723","\u{2F98A}":"\u{2339C}","\u2F4A":"\u6728",\uF9E1:"\u674E","\u{2F8DC}":"\u6753","\uFA94":"\u6756","\u{2F8DB}":"\u675E","\u{2F8DD}":"\u{233C3}",\u67FF:"\u676E",\uF9C8:"\u677B","\u{2F8E0}":"\u6785",\uF9F4:"\u6797","\u{2F8DE}":"\u3B49","\uFAD1":"\u{233D5}",\uF9C9:"\u67F3","\u{2F8DF}":"\u67FA",\uF9DA:"\u6817","\u{2F8E5}":"\u681F","\u{2F8E1}":"\u6852","\u{2F8E3}":"\u{2346D}",\uF97A:"\u6881","\uFA44":"\u6885","\u{2F8E2}":"\u6885","\u{2F8E4}":"\u688E",\uF9E2:"\u68A8","\u{2F8E6}":"\u6914","\u{2F8E8}":"\u6942","\uFAD2":"\u3B9D","\u{2F8E7}":"\u3B9D",\u69E9:"\u3BA3",\u6A27:"\u699D","\u{2F8E9}":"\u69A3","\u{2F8EA}":"\u69EA",\uF914:"\u6A02",\uF95C:"\u6A02",\uF9BF:"\u6A02",\uF94C:"\u6A13","\u{2F8EC}":"\u{236A3}","\u{2F8EB}":"\u6AA8",\uF931:"\u6AD3","\u{2F8ED}":"\u6ADB",\uF91D:"\u6B04","\u{2F8EE}":"\u3C18","\u2F4B":"\u6B20","\u{2F8EF}":"\u6B21","\u{2F8F0}":"\u{238A7}","\u{2F8F1}":"\u6B54","\u{2F8F2}":"\u3C4E","\u2F4C":"\u6B62","\u2EED":"\u6B6F","\u{2F8F3}":"\u6B72",\uF98C:"\u6B77","\uFA95":"\u6B79","\u2F4D":"\u6B79","\u2E9E":"\u6B7A","\u{2F8F4}":"\u6B9F",\uF9A5:"\u6BAE","\u2F4E":"\u6BB3",\uF970:"\u6BBA","\uFA96":"\u6BBA","\u{2F8F5}":"\u6BBA","\u{2F8F6}":"\u6BBB","\u{2F8F7}":"\u{23A8D}","\u2F4F":"\u6BCB","\u2E9F":"\u6BCD","\u{2F8F9}":"\u{23AFA}","\u2F50":"\u6BD4","\u2F51":"\u6BDB","\u2F52":"\u6C0F","\u2EA0":"\u6C11","\u2F53":"\u6C14","\u2F54":"\u6C34","\u2EA1":"\u6C35","\u2EA2":"\u6C3A","\u{2F8FA}":"\u6C4E","\u{2F8FE}":"\u6C67",\uF972:"\u6C88","\u{2F8FC}":"\u6CBF",\uF968:"\u6CCC","\u{2F8FD}":"\u6CCD",\uF9E3:"\u6CE5","\u{2F8FB}":"\u{23CBC}",\uF915:"\u6D1B",\uFA05:"\u6D1E","\u{2F907}":"\u6D34","\u{2F900}":"\u6D3E",\uF9CA:"\u6D41","\uFA97":"\u6D41","\u{2F902}":"\u6D41","\u{2F8FF}":"\u6D16","\u{2F903}":"\u6D69",\uF92A:"\u6D6A","\uFA45":"\u6D77","\u{2F901}":"\u6D77","\u{2F904}":"\u6D78","\u{2F905}":"\u6D85","\u{2F906}":"\u{23D1E}",\uF9F5:"\u6DCB",\uF94D:"\u6DDA",\uF9D6:"\u6DEA","\u{2F90E}":"\u6DF9","\uFA46":"\u6E1A","\u{2F908}":"\u6E2F","\u{2F909}":"\u6E6E",\u6F59:"\u6E88","\uFA99":"\u6ECB","\u{2F90B}":"\u6ECB",\uF9CB:"\u6E9C",\uF9EC:"\u6EBA","\u{2F90C}":"\u6EC7",\uF904:"\u6ED1","\uFA98":"\u6EDB","\u{2F90A}":"\u3D33",\uF94E:"\u6F0F","\uFA47":"\u6F22","\uFA9A":"\u6F22",\uF992:"\u6F23","\u{2F90D}":"\u{23ED1}","\u{2F90F}":"\u6F6E","\u{2F910}":"\u{23F5E}","\u{2F911}":"\u{23F8E}","\u{2F912}":"\u6FC6",\uF922:"\u6FEB",\uF984:"\u6FFE","\u{2F915}":"\u701B","\uFA9B":"\u701E","\u{2F914}":"\u701E","\u{2F913}":"\u7039","\u{2F917}":"\u704A","\u{2F916}":"\u3D96","\u2F55":"\u706B","\u2EA3":"\u706C","\u{2F835}":"\u7070","\u{2F919}":"\u7077","\u{2F918}":"\u707D",\uF9FB:"\u7099","\u{2F91A}":"\u70AD",\uF99F:"\u70C8",\uF916:"\u70D9","\uFA48":"\u716E","\uFA9C":"\u716E","\u{2F91D}":"\u{24263}","\u{2F91C}":"\u7145",\uF993:"\u7149","\uFA6C":"\u{242EE}","\u{2F91E}":"\u719C",\uF9C0:"\u71CE",\uF9EE:"\u71D0","\u{2F91F}":"\u{243AB}",\uF932:"\u7210",\uF91E:"\u721B","\u{2F920}":"\u7228","\u2F56":"\u722A","\uFA49":"\u722B","\u2EA4":"\u722B","\uFA9E":"\u7235","\u{2F921}":"\u7235","\u2F57":"\u7236","\u2F58":"\u723B","\u2EA6":"\u4E2C","\u2F59":"\u723F","\u2F5A":"\u7247","\u{2F922}":"\u7250","\u2F5B":"\u7259","\u{2F923}":"\u{24608}","\u2F5C":"\u725B",\uF946:"\u7262","\u{2F924}":"\u7280","\u{2F925}":"\u7295","\u2F5D":"\u72AC","\u2EA8":"\u72AD","\uFA9F":"\u72AF",\uF9FA:"\u72C0","\u{2F926}":"\u{24735}",\uF92B:"\u72FC",\uFA16:"\u732A","\uFAA0":"\u732A","\u{2F927}":"\u{24814}",\uF9A7:"\u7375","\u{2F928}":"\u737A","\u2F5E":"\u7384",\uF961:"\u7387",\uF9DB:"\u7387","\u2F5F":"\u7389","\u{2F929}":"\u738B","\u{2F92A}":"\u3EAC","\u{2F92B}":"\u73A5",\uF9AD:"\u73B2","\u{2F92C}":"\u3EB8","\u{2F92D}":"\u3EB8",\uF917:"\u73DE",\uF9CC:"\u7409",\uF9E4:"\u7406","\uFA4A":"\u7422","\u{2F92E}":"\u7447","\u{2F92F}":"\u745C",\uF9AE:"\u7469","\uFAA1":"\u7471","\u{2F930}":"\u7471","\u{2F931}":"\u7485",\uF994:"\u7489",\uF9EF:"\u7498","\u{2F932}":"\u74CA","\u2F60":"\u74DC","\u2F61":"\u74E6","\u{2F933}":"\u3F1B","\uFAA2":"\u7506","\u2F62":"\u7518","\u2F63":"\u751F","\u{2F934}":"\u7524","\u2F64":"\u7528","\u2F65":"\u7530","\uFAA3":"\u753B","\u{2F936}":"\u753E","\u{2F935}":"\u{24C36}",\uF9CD:"\u7559",\uF976:"\u7565",\uF962:"\u7570","\u{2F938}":"\u7570","\u{2F937}":"\u{24C92}","\u2F66":"\u758B","\u2F67":"\u7592",\uF9E5:"\u75E2","\u{2F93A}":"\u7610","\uFAA5":"\u761F","\uFAA4":"\u761D",\uF9C1:"\u7642",\uF90E:"\u7669","\u2F68":"\u7676","\u2F69":"\u767D","\u{2F93B}":"\u{24FA1}","\u{2F93C}":"\u{24FB8}","\u2F6A":"\u76AE","\u2F6B":"\u76BF","\u{2F93D}":"\u{25044}","\u{2F93E}":"\u3FFC",\uFA17:"\u76CA","\uFAA6":"\u76CA","\uFAA7":"\u76DB",\uF933:"\u76E7","\u{2F93F}":"\u4008","\u2F6C":"\u76EE","\uFAA8":"\u76F4","\u{2F940}":"\u76F4","\u{2F942}":"\u{250F2}","\u{2F941}":"\u{250F3}",\uF96D:"\u7701","\uFAD3":"\u4018","\u{2F943}":"\u{25119}","\u{2F945}":"\u771E","\u{2F946}":"\u771F","\u{2F947}":"\u771F","\u{2F944}":"\u{25133}","\uFAAA":"\u7740","\uFAA9":"\u774A","\u{2F948}":"\u774A","\u9FC3":"\u4039","\uFAD4":"\u4039","\u{2F949}":"\u4039",\u6663:"\u403F","\u{2F94B}":"\u4046","\u{2F94A}":"\u778B","\uFAD5":"\u{25249}","\uFA9D":"\u77A7","\u2F6D":"\u77DB","\u2F6E":"\u77E2","\u2F6F":"\u77F3","\u{2F94C}":"\u4096","\u{2F94D}":"\u{2541D}",\u784F:"\u7814","\u{2F94E}":"\u784E",\uF9CE:"\u786B",\uF93B:"\u788C","\u{2F94F}":"\u788C","\uFA4B":"\u7891",\uF947:"\u78CA","\uFAAB":"\u78CC","\u{2F950}":"\u78CC",\uF964:"\u78FB","\u{2F951}":"\u40E3",\uF985:"\u792A","\u2F70":"\u793A","\u2EAD":"\u793B",\uFA18:"\u793C","\uFA4C":"\u793E","\uFA4E":"\u7948","\uFA4D":"\u7949","\u{2F952}":"\u{25626}","\uFA4F":"\u7950","\uFA50":"\u7956","\u{2F953}":"\u7956","\uFA51":"\u795D",\uFA19:"\u795E",\uFA1A:"\u7965","\uFA61":"\u8996","\uFAB8":"\u8996",\uF93C:"\u797F","\u{2F954}":"\u{2569A}","\uFA52":"\u798D","\uFA53":"\u798E",\uFA1B:"\u798F","\u{2F956}":"\u798F","\u{2F955}":"\u{256C5}",\uF9B6:"\u79AE","\u2F71":"\u79B8","\u2F72":"\u79BE",\uF995:"\u79CA","\u{2F958}":"\u412F","\u{2F957}":"\u79EB",\uF956:"\u7A1C","\u{2F95A}":"\u7A4A","\uFA54":"\u7A40","\u{2F959}":"\u7A40","\u{2F95B}":"\u7A4F","\u2F73":"\u7A74","\uFA55":"\u7A81","\u{2F95C}":"\u{2597C}","\uFAAC":"\u7AB1",\uF9F7:"\u7ACB","\u2F74":"\u7ACB","\u2EEF":"\u7ADC","\u{2F95D}":"\u{25AA7}","\u{2F95E}":"\u{25AA7}","\u{2F95F}":"\u7AEE","\u2F75":"\u7AF9",\uF9F8:"\u7B20","\uFA56":"\u7BC0","\uFAAD":"\u7BC0","\u{2F960}":"\u4202","\u{2F961}":"\u{25BAB}","\u{2F962}":"\u7BC6","\u{2F964}":"\u4227","\u{2F963}":"\u7BC9","\u{2F965}":"\u{25C80}","\uFAD6":"\u{25CD0}",\uF9A6:"\u7C3E",\uF944:"\u7C60","\u2F76":"\u7C73","\uFAAE":"\u7C7B",\uF9F9:"\u7C92",\uFA1D:"\u7CBE","\u{2F966}":"\u7CD2",\uFA03:"\u7CD6","\u{2F968}":"\u7CE8","\u{2F967}":"\u42A0","\u{2F969}":"\u7CE3",\uF97B:"\u7CE7","\u2F77":"\u7CF8","\u2EAF":"\u7CF9","\u{2F96B}":"\u{25F86}","\u{2F96A}":"\u7D00",\uF9CF:"\u7D10",\uF96A:"\u7D22",\uF94F:"\u7D2F",\u7D76:"\u7D55","\u{2F96C}":"\u7D63","\uFAAF":"\u7D5B",\uF93D:"\u7DA0",\uF957:"\u7DBE","\u{2F96E}":"\u7DC7",\uF996:"\u7DF4","\uFA57":"\u7DF4","\uFAB0":"\u7DF4","\u{2F96F}":"\u7E02","\u{2F96D}":"\u4301","\uFA58":"\u7E09",\uF950:"\u7E37","\uFA59":"\u7E41","\u{2F970}":"\u7E45","\u{2F898}":"\u{261DA}","\u{2F971}":"\u4334","\u2F78":"\u7F36","\u{2F972}":"\u{26228}","\uFAB1":"\u7F3E","\u{2F973}":"\u{26247}","\u2F79":"\u7F51","\u2EAB":"\u7F52","\u2EB2":"\u7F52","\u2EB1":"\u7F53","\u{2F974}":"\u4359","\uFA5A":"\u7F72","\u{2F975}":"\u{262D9}",\uF9E6:"\u7F79","\u{2F976}":"\u7F7A",\uF90F:"\u7F85","\u{2F977}":"\u{2633E}","\u2F7A":"\u7F8A","\u{2F978}":"\u7F95",\uF9AF:"\u7F9A",\uFA1E:"\u7FBD","\u2F7B":"\u7FBD","\u{2F979}":"\u7FFA",\uF934:"\u8001","\u2F7C":"\u8001","\u2EB9":"\u8002","\uFA5B":"\u8005","\uFAB2":"\u8005","\u{2F97A}":"\u8005","\u2F7D":"\u800C","\u{2F97B}":"\u{264DA}","\u2F7E":"\u8012","\u{2F97C}":"\u{26523}","\u2F7F":"\u8033",\uF9B0:"\u8046","\u{2F97D}":"\u8060","\u{2F97E}":"\u{265A8}",\uF997:"\u806F","\u{2F97F}":"\u8070",\uF945:"\u807E","\u2F80":"\u807F","\u2EBA":"\u8080","\u2F81":"\u8089",\uF953:"\u808B","\u{2F8D6}":"\u80AD","\u{2F982}":"\u80B2","\u{2F981}":"\u43D5","\u{2F8D7}":"\u43D9",\u8141:"\u80FC","\u{2F983}":"\u8103","\u{2F985}":"\u813E","\u{2F984}":"\u440B","\u{2F8DA}":"\u6721","\u{2F987}":"\u{267A7}","\u{2F988}":"\u{267B5}",\u6726:"\u4443",\uF926:"\u81D8","\u2F82":"\u81E3",\uF9F6:"\u81E8","\u2F83":"\u81EA","\uFA5C":"\u81ED","\u2F84":"\u81F3","\u2F85":"\u81FC","\u{2F893}":"\u8201","\u{2F98B}":"\u8201","\u{2F98C}":"\u8204","\u2F86":"\u820C","\uFA6D":"\u8218","\u2F87":"\u821B","\u2F88":"\u821F","\u{2F98E}":"\u446B","\u2F89":"\u826E",\uF97C:"\u826F","\u2F8A":"\u8272","\u2F8B":"\u8278","\uFA5D":"\u8279","\uFA5E":"\u8279","\u2EBE":"\u8279","\u2EBF":"\u8279","\u2EC0":"\u8279","\u{2F990}":"\u828B","\u{2F98F}":"\u8291","\u{2F991}":"\u829D","\u{2F993}":"\u82B1","\u{2F994}":"\u82B3","\u{2F995}":"\u82BD",\uF974:"\u82E5","\u{2F998}":"\u82E5","\u{2F996}":"\u82E6","\u{2F997}":"\u{26B3C}",\uF9FE:"\u8336","\uFAB3":"\u8352","\u{2F99A}":"\u8363","\u{2F999}":"\u831D","\u{2F99C}":"\u8323","\u{2F99D}":"\u83BD","\u{2F9A0}":"\u8353",\uF93E:"\u83C9","\u{2F9A1}":"\u83CA","\u{2F9A2}":"\u83CC","\u{2F9A3}":"\u83DC","\u{2F99E}":"\u83E7","\uFAB4":"\u83EF",\uF958:"\u83F1","\uFA5F":"\u8457","\u{2F99F}":"\u8457","\u{2F9A4}":"\u{26C36}","\u{2F99B}":"\u83AD",\uF918:"\u843D",\uF96E:"\u8449",\u853F:"\u848D","\u{2F9A6}":"\u{26CD5}","\u{2F9A5}":"\u{26D6B}",\uF999:"\u84EE","\u{2F9A8}":"\u84F1","\u{2F9A9}":"\u84F3",\uF9C2:"\u84FC","\u{2F9AA}":"\u8516","\u{2F9A7}":"\u452B","\u{2F9AC}":"\u8564","\u{2F9AD}":"\u{26F2C}",\uF923:"\u85CD","\u{2F9AE}":"\u455D","\u{2F9B0}":"\u{26FB1}","\u{2F9AF}":"\u4561",\uF9F0:"\u85FA",\uF935:"\u8606","\u{2F9B2}":"\u456B",\uFA20:"\u8612",\uF91F:"\u862D","\u{2F9B1}":"\u{270D2}",\u8641:"\u8637",\uF910:"\u863F","\u2F8C":"\u864D","\u2EC1":"\u864E","\u{2F9B3}":"\u8650",\uF936:"\u865C","\u{2F9B4}":"\u865C","\u{2F9B5}":"\u8667","\u{2F9B6}":"\u8669","\u2F8D":"\u866B","\u{2F9B7}":"\u86A9","\u{2F9B8}":"\u8688","\u{2F9BA}":"\u86E2","\u{2F9B9}":"\u870E","\u{2F9BC}":"\u8728","\u{2F9BD}":"\u876B","\u{2F9C0}":"\u87E1","\uFAB5":"\u8779","\u{2F9BB}":"\u8779","\u{2F9BE}":"\u8786","\u{2F9BF}":"\u45D7","\u{2F9AB}":"\u{273CA}",\uF911:"\u87BA","\u{2F9C1}":"\u8801","\u{2F9C2}":"\u45F9",\uF927:"\u881F","\u2F8E":"\u8840",\uFA08:"\u884C","\u2F8F":"\u884C","\u{2F9C3}":"\u8860","\u{2F9C4}":"\u8863","\u2F90":"\u8863","\u2EC2":"\u8864",\uF9A0:"\u88C2","\u{2F9C5}":"\u{27667}",\uF9E7:"\u88CF","\u{2F9C6}":"\u88D7","\u{2F9C7}":"\u88DE",\uF9E8:"\u88E1",\uF912:"\u88F8","\u{2F9C9}":"\u88FA","\u{2F9C8}":"\u4635","\uFA60":"\u8910","\uFAB6":"\u8941",\uF924:"\u8964","\u2F91":"\u897E","\u2EC4":"\u897F","\u2EC3":"\u8980","\uFAB7":"\u8986",\uFA0A:"\u898B","\u2F92":"\u898B","\u{2F9CB}":"\u{278AE}","\u2EC5":"\u89C1","\u2F93":"\u89D2","\u2F94":"\u8A00","\u{2F9CC}":"\u{27966}",\u8A7D:"\u8A2E",\u8A1E:"\u46B6","\u{2F9CD}":"\u46BE","\u{2F9CE}":"\u46C7","\u{2F9CF}":"\u8AA0",\uF96F:"\u8AAA",\uF9A1:"\u8AAA","\uFAB9":"\u8ABF","\uFABB":"\u8ACB",\uF97D:"\u8AD2",\uF941:"\u8AD6","\uFABE":"\u8AED","\u{2F9D0}":"\u8AED",\uFA22:"\u8AF8","\uFABA":"\u8AF8",\uF95D:"\u8AFE","\uFABD":"\u8AFE","\uFA62":"\u8B01","\uFABC":"\u8B01","\uFA63":"\u8B39","\uFABF":"\u8B39",\uF9FC:"\u8B58",\uF95A:"\u8B80",\u8B8F:"\u8B86","\uFAC0":"\u8B8A","\u{2F9D1}":"\u8B8A","\u2EC8":"\u8BA0","\u2F95":"\u8C37","\u2F96":"\u8C46",\uF900:"\u8C48","\u{2F9D2}":"\u8C55","\u2F97":"\u8C55",\u8C63:"\u8C5C","\u2F98":"\u8C78","\u{2F9D3}":"\u{27CA8}","\u2F99":"\u8C9D","\u{2F9D4}":"\u8CAB","\u{2F9D5}":"\u8CC1",\uF948:"\u8CC2",\uF903:"\u8CC8","\uFA64":"\u8CD3","\uFA65":"\u8D08","\uFAC1":"\u8D08","\u{2F9D6}":"\u8D1B","\u2EC9":"\u8D1D","\u2F9A":"\u8D64","\u2F9B":"\u8D70","\u{2F9D7}":"\u8D77",\u8D86:"\u8D7F","\uFAD7":"\u{27ED3}","\u{2F9D8}":"\u{27F2F}","\u2F9C":"\u8DB3","\u{2F9DA}":"\u8DCB","\u{2F9DB}":"\u8DBC",\u8DFA:"\u8DE5",\uF937:"\u8DEF","\u{2F9DC}":"\u8DF0",\u8E9B:"\u8E97","\u2F9D":"\u8EAB",\uF902:"\u8ECA","\u2F9E":"\u8ECA","\u{2F9DE}":"\u8ED4",\u8F27:"\u8EFF",\uF998:"\u8F26",\uF9D7:"\u8F2A","\uFAC2":"\u8F38","\u{2F9DF}":"\u8F38",\uFA07:"\u8F3B",\uF98D:"\u8F62","\u2ECB":"\u8F66","\u2F9F":"\u8F9B","\u{2F98D}":"\u8F9E",\uF971:"\u8FB0","\u2FA0":"\u8FB0","\u2FA1":"\u8FB5","\uFA66":"\u8FB6","\u2ECC":"\u8FB6","\u2ECD":"\u8FB6","\u{2F881}":"\u5DE1",\uF99A:"\u9023",\uFA25:"\u9038","\uFA67":"\u9038","\uFAC3":"\u9072",\uF9C3:"\u907C","\u{2F9E0}":"\u{285D2}","\u{2F9E1}":"\u{285ED}",\uF913:"\u908F","\u2FA2":"\u9091","\u{2F9E2}":"\u9094",\uF92C:"\u90CE",\u90DE:"\u90CE","\uFA2E":"\u90CE","\u{2F9E3}":"\u90F1",\uFA26:"\u90FD","\u{2F9E5}":"\u{2872E}","\u{2F9E4}":"\u9111","\u{2F9E6}":"\u911B","\u2FA3":"\u9149",\uF919:"\u916A","\uFAC4":"\u9199",\uF9B7:"\u91B4","\u2FA4":"\u91C6",\uF9E9:"\u91CC","\u2FA5":"\u91CC",\uF97E:"\u91CF",\uF90A:"\u91D1","\u2FA6":"\u91D1",\uF9B1:"\u9234","\u{2F9E7}":"\u9238","\uFAC5":"\u9276","\u{2F9E8}":"\u92D7","\u{2F9E9}":"\u92D8","\u{2F9EA}":"\u927C",\uF93F:"\u9304",\uF99B:"\u934A",\u93AE:"\u93AD","\u{2F9EB}":"\u93F9","\u{2F9EC}":"\u9415","\u{2F9ED}":"\u{28BFA}","\u2ED0":"\u9485","\u2ED1":"\u9577","\u2FA7":"\u9577","\u2ED2":"\u9578","\u2ED3":"\u957F","\u2FA8":"\u9580","\u{2F9EE}":"\u958B","\u{2F9EF}":"\u4995",\uF986:"\u95AD","\u{2F9F0}":"\u95B7","\u{2F9F1}":"\u{28D77}","\u2ED4":"\u95E8","\u2FA9":"\u961C","\u2ECF":"\u961D","\u2ED6":"\u961D",\uF9C6:"\u962E",\uF951:"\u964B",\uFA09:"\u964D",\uF959:"\u9675",\uF9D3:"\u9678","\uFAC6":"\u967C",\uF9DC:"\u9686",\uF9F1:"\u96A3","\u{2F9F2}":"\u49E6","\u2FAA":"\u96B6","\uFA2F":"\u96B7",\u96B8:"\u96B7",\uF9B8:"\u96B7","\u2FAB":"\u96B9","\u{2F9F3}":"\u96C3",\uF9EA:"\u96E2","\uFA68":"\u96E3","\uFAC7":"\u96E3","\u2FAC":"\u96E8",\uF9B2:"\u96F6",\uF949:"\u96F7","\u{2F9F5}":"\u9723","\u{2F9F6}":"\u{29145}",\uF938:"\u9732",\uF9B3:"\u9748","\u2FAD":"\u9751","\u2ED8":"\u9752",\uFA1C:"\u9756","\uFAC8":"\u9756","\u{2F81C}":"\u{291DF}","\u2FAE":"\u975E","\u2FAF":"\u9762","\u{2F9F7}":"\u{2921A}","\u2FB0":"\u9769","\u{2F9F8}":"\u4A6E","\u{2F9F9}":"\u4A76","\u2FB1":"\u97CB","\uFAC9":"\u97DB","\u{2F9FA}":"\u97E0","\u2ED9":"\u97E6","\u2FB2":"\u97ED","\u{2F9FB}":"\u{2940A}","\u2FB3":"\u97F3","\uFA69":"\u97FF","\uFACA":"\u97FF","\u2FB4":"\u9801","\u{2F9FC}":"\u4AB2","\uFACB":"\u980B","\u{2F9FE}":"\u980B","\u{2F9FF}":"\u980B",\uF9B4:"\u9818","\u{2FA00}":"\u9829","\u{2F9FD}":"\u{29496}","\uFA6A":"\u983B","\uFACC":"\u983B",\uF9D0:"\u985E","\u2EDA":"\u9875","\u2FB5":"\u98A8","\u{2FA01}":"\u{295B6}","\u2EDB":"\u98CE","\u2FB6":"\u98DB","\u2EDC":"\u98DE","\u2EDD":"\u98DF","\u2FB7":"\u98DF","\u2EDF":"\u98E0","\u{2FA02}":"\u98E2",\uFA2A:"\u98EF",\uFA2B:"\u98FC","\u{2FA03}":"\u4B33",\uFA2C:"\u9928","\u{2FA04}":"\u9929","\u2EE0":"\u9963","\u2FB8":"\u9996","\u2FB9":"\u9999","\u{2FA05}":"\u99A7","\u2FBA":"\u99AC","\u{2FA06}":"\u99C2",\uF91A:"\u99F1","\u{2FA07}":"\u99FE",\uF987:"\u9A6A","\u2EE2":"\u9A6C","\u2FBB":"\u9AA8","\u{2FA08}":"\u4BCE","\u2FBC":"\u9AD8","\u2FBD":"\u9ADF","\u{2FA09}":"\u{29B30}","\uFACD":"\u9B12","\u{2FA0A}":"\u9B12","\u2FBE":"\u9B25","\u2FBF":"\u9B2F","\u2FC0":"\u9B32","\u2FC1":"\u9B3C","\u2EE4":"\u9B3C","\u2FC2":"\u9B5A",\uF939:"\u9B6F","\u{2FA0B}":"\u9C40",\uF9F2:"\u9C57","\u2EE5":"\u9C7C","\u2FC3":"\u9CE5","\u{2FA0C}":"\u9CFD","\u{2FA0D}":"\u4CCE","\u{2FA0F}":"\u9D67","\u{2FA0E}":"\u4CED","\u{2FA10}":"\u{2A0CE}",\uFA2D:"\u9DB4","\u{2FA12}":"\u{2A105}","\u{2FA11}":"\u4CF8",\uF93A:"\u9DFA","\u{2FA13}":"\u{2A20E}",\uF920:"\u9E1E",\u9E43:"\u9E42","\u2FC4":"\u9E75",\uF940:"\u9E7F","\u2FC5":"\u9E7F","\u{2FA14}":"\u{2A291}",\uF988:"\u9E97",\uF9F3:"\u9E9F","\u2FC6":"\u9EA5","\u2EE8":"\u9EA6","\u{2FA15}":"\u9EBB","\u2FC7":"\u9EBB","\u{2F88F}":"\u{2A392}","\u2FC8":"\u9EC3","\u2EE9":"\u9EC4","\u2FC9":"\u9ECD",\uF989:"\u9ECE","\u{2FA16}":"\u4D56","\u2FCA":"\u9ED1",\u9ED2:"\u9ED1","\uFA3A":"\u58A8","\u{2FA17}":"\u9EF9","\u2FCB":"\u9EF9","\u2FCC":"\u9EFD","\u{2FA19}":"\u9F05","\u{2FA18}":"\u9EFE","\u2FCD":"\u9F0E","\u{2FA1A}":"\u9F0F","\u2FCE":"\u9F13","\u{2FA1B}":"\u9F16","\u2FCF":"\u9F20","\u{2FA1C}":"\u9F3B","\u2FD0":"\u9F3B","\uFAD8":"\u9F43","\u2FD1":"\u9F4A","\u2EEC":"\u9F50","\u2FD2":"\u9F52","\u{2FA1D}":"\u{2A600}","\u2EEE":"\u9F7F",\uF9C4:"\u9F8D","\u2FD3":"\u9F8D","\uFAD9":"\u9F8E","\u2EF0":"\u9F99",\uF907:"\u9F9C",\uF908:"\u9F9C","\uFACE":"\u9F9C","\u2FD4":"\u9F9C","\u2EF3":"\u9F9F","\u2FD5":"\u9FA0"},ee=Ee;function ke(r){return r.replace(/([.?*+^$[\]\\(){}|-])/g,"\\$1")}var Te=RegExp(Object.keys(ee).map(ke).join("|"),"g");function De(r){return ee[r]}function Be(r){return r.replace(Te,De)}var Pe=Be,I={exports:{}},te={};function x(r,e){typeof e=="boolean"&&(e={forever:e}),this._originalTimeouts=JSON.parse(JSON.stringify(r)),this._timeouts=r,this._options=e||{},this._maxRetryTime=e&&e.maxRetryTime||1/0,this._fn=null,this._errors=[],this._attempts=1,this._operationTimeout=null,this._operationTimeoutCb=null,this._timeout=null,this._operationStart=null,this._timer=null,this._options.forever&&(this._cachedTimeouts=this._timeouts.slice(0))}var Le=x;x.prototype.reset=function(){this._attempts=1,this._timeouts=this._originalTimeouts.slice(0)},x.prototype.stop=function(){this._timeout&&clearTimeout(this._timeout),this._timer&&clearTimeout(this._timer),this._timeouts=[],this._cachedTimeouts=null},x.prototype.retry=function(r){if(this._timeout&&clearTimeout(this._timeout),!r)return!1;var e=new Date().getTime();if(r&&e-this._operationStart>=this._maxRetryTime)return this._errors.push(r),this._errors.unshift(new Error("RetryOperation timeout occurred")),!1;this._errors.push(r);var t=this._timeouts.shift();if(t===void 0)if(this._cachedTimeouts)this._errors.splice(0,this._errors.length-1),t=this._cachedTimeouts.slice(-1);else return!1;var n=this;return this._timer=setTimeout(function(){n._attempts++,n._operationTimeoutCb&&(n._timeout=setTimeout(function(){n._operationTimeoutCb(n._attempts)},n._operationTimeout),n._options.unref&&n._timeout.unref()),n._fn(n._attempts)},t),this._options.unref&&this._timer.unref(),!0},x.prototype.attempt=function(r,e){this._fn=r,e&&(e.timeout&&(this._operationTimeout=e.timeout),e.cb&&(this._operationTimeoutCb=e.cb));var t=this;this._operationTimeoutCb&&(this._timeout=setTimeout(function(){t._operationTimeoutCb()},t._operationTimeout)),this._operationStart=new Date().getTime(),this._fn(this._attempts)},x.prototype.try=function(r){console.log("Using RetryOperation.try() is deprecated"),this.attempt(r)},x.prototype.start=function(r){console.log("Using RetryOperation.start() is deprecated"),this.attempt(r)},x.prototype.start=x.prototype.try,x.prototype.errors=function(){return this._errors},x.prototype.attempts=function(){return this._attempts},x.prototype.mainError=function(){if(this._errors.length===0)return null;for(var r={},e=null,t=0,n=0;n<this._errors.length;n++){var o=this._errors[n],i=o.message,s=(r[i]||0)+1;r[i]=s,s>=t&&(e=o,t=s)}return e},function(r){var e=Le;r.operation=function(t){var n=r.timeouts(t);return new e(n,{forever:t&&(t.forever||t.retries===1/0),unref:t&&t.unref,maxRetryTime:t&&t.maxRetryTime})},r.timeouts=function(t){if(t instanceof Array)return[].concat(t);var n={retries:10,factor:2,minTimeout:1*1e3,maxTimeout:1/0,randomize:!1};for(var o in t)n[o]=t[o];if(n.minTimeout>n.maxTimeout)throw new Error("minTimeout is greater than maxTimeout");for(var i=[],s=0;s<n.retries;s++)i.push(this.createTimeout(s,n));return t&&t.forever&&!i.length&&i.push(this.createTimeout(s,n)),i.sort(function(c,f){return c-f}),i},r.createTimeout=function(t,n){var o=n.randomize?Math.random()+1:1,i=Math.round(o*Math.max(n.minTimeout,1)*Math.pow(n.factor,t));return i=Math.min(i,n.maxTimeout),i},r.wrap=function(t,n,o){if(n instanceof Array&&(o=n,n=null),!o){o=[];for(var i in t)typeof t[i]=="function"&&o.push(i)}for(var s=0;s<o.length;s++){var c=o[s],f=t[c];t[c]=function(u){var p=r.operation(n),y=Array.prototype.slice.call(arguments,1),S=y.pop();y.push(function(H){p.retry(H)||(H&&(arguments[0]=p.mainError()),S.apply(this,arguments))}),p.attempt(function(){u.apply(t,y)})}.bind(t,f),t[c].options=n}}}(te);var Ce=te;const Ae=Ce,Ne=["Failed to fetch","NetworkError when attempting to fetch resource.","The Internet connection appears to be offline.","Network request failed"];class re 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 Re=(r,e,t)=>{const n=t.retries-(e-1);return r.attemptNumber=e,r.retriesLeft=n,r},je=r=>Ne.includes(r),ne=(r,e)=>new Promise((t,n)=>{e=we({onFailedAttempt:()=>{},retries:10},e);const o=Ae.operation(e);o.attempt(async i=>{try{t(await r(i))}catch(s){if(!(s instanceof Error)){n(new TypeError(`Non-error was thrown: "${s}". You should only throw errors.`));return}if(s instanceof re)o.stop(),n(s.originalError);else if(s instanceof TypeError&&!je(s.message))o.stop(),n(s);else{Re(s,i,e);try{await e.onFailedAttempt(s)}catch(c){n(c);return}o.retry(s)||n(o.mainError())}}})});I.exports=ne,I.exports.default=ne,I.exports.AbortError=re;var oe=L.exports;Object.defineProperty(a,"__esModule",{value:!0}),a.DEFAULT_ALPHABET=void 0,a.alphabetPad=Y,a.averageBetweenStrings=ut,a.baseToString=A,a.checkObjectHasKeys=Ve,a.checkObjectHasNoAdditionalKeys=We,a.chunkPromises=st,a.compare=gt,a.decodeParams=Ke,a.deepCompare=X,a.deepCopy=Xe,a.deepSortedObjectEntries=ie,a.defer=nt,a.encodeParams=Fe,a.encodeUri=Ie,a.ensureNoTrailingSlash=et,a.escapeRegExp=ae,a.getCrypto=lt,a.globToRegexp=Qe,a.inherits=Ye,a.isFunction=He,a.isNullOrUndefined=rt,a.isNumber=$e,a.lexicographicCompare=le,a.nextString=ft,a.normalize=ze,a.polyfillSuper=qe,a.prevString=dt,a.promiseMapSeries=ot,a.promiseTry=it,a.recursivelyAssign=ue,a.removeDirectionOverrideChars=Ge,a.removeElement=Je,a.removeHiddenChars=se,a.setCrypto=ct,a.simpleRetryOperation=at,a.sleep=tt,a.stringToBase=R;var Me=oe(Pe),Ue=oe(I.exports);function Fe(r){const e=new URLSearchParams;for(const[t,n]of Object.entries(r))n!=null&&e.set(t,String(n));return e.toString()}function Ke(r){const e={},t=new URLSearchParams(r);for(const n of t.keys()){const o=t.getAll(n);e[n]=o.length===1?o[0]:o}return e}function Ie(r,e){for(const t in e)!e.hasOwnProperty(t)||(r=r.replace(t,encodeURIComponent(e[t])));return r}function Je(r,e,t){let n;if(t){for(n=r.length-1;n>=0;n--)if(e(r[n],n,r))return r.splice(n,1),!0}else for(n=0;n<r.length;n++)if(e(r[n],n,r))return r.splice(n,1),!0;return!1}function He(r){return Object.prototype.toString.call(r)==="[object Function]"}function Ve(r,e){for(let t=0;t<e.length;t++)if(!r.hasOwnProperty(e[t]))throw new Error("Missing required key: "+e[t])}function We(r,e){for(const t in r)if(!!r.hasOwnProperty(t)&&e.indexOf(t)===-1)throw new Error("Unknown key: "+t)}function Xe(r){return JSON.parse(JSON.stringify(r))}function X(r,e){if(r===e)return!0;if(typeof r!=typeof e)return!1;if(typeof r=="number"&&isNaN(r)&&isNaN(e))return!0;if(r===null||e===null)return r===e;if(!(r instanceof Object)||r.constructor!==e.constructor||r.prototype!==e.prototype)return!1;if(r instanceof RegExp||r instanceof Date)return r.toString()===e.toString();if(r instanceof Array){if(r.length!==e.length)return!1;for(let t=0;t<r.length;t++)if(!X(r[t],e[t]))return!1}else{let t;for(t in e)if(e.hasOwnProperty(t)!==r.hasOwnProperty(t))return!1;for(t in e)if(e.hasOwnProperty(t)!==r.hasOwnProperty(t)||!X(r[t],e[t]))return!1}return!0}function ie(r){if(typeof r!="object"||r==null||Array.isArray(r))return r;const e=[];for(const[t,n]of Object.entries(r))e.push([t,ie(n)]);return e.sort((t,n)=>le(t[0],n[0])),e}function Ye(r,e){r.super_=e,r.prototype=Object.create(e.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}})}function qe(r,e,...t){try{e.call(r,...t)}catch{const o=new e(...t);Object.assign(r,o)}}function $e(r){return typeof r=="number"&&isFinite(r)}function se(r){return typeof r=="string"?(0,Me.default)(r.normalize("NFD").replace(Ze,"")):""}function Ge(r){return typeof r=="string"?r.replace(/[\u202d-\u202e]/g,""):""}function ze(r){return se(r.toLowerCase()).replace(/[\\'!"#$%&()*+,\-./:;<=>?@[\]^_`{|}~\u2000-\u206f\u2e00-\u2e7f]/g,"").toLowerCase()}const Ze=/[\u2000-\u200F\u202A-\u202F\u0300-\u036F\uFEFF\u061C\s]/g;function ae(r){return r.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Qe(r,e){e=typeof e=="boolean"?e:!0;let t=ae(r);return t=t.replace(/\\\*/g,".*"),t=t.replace(/\?/g,"."),e&&(t=t.replace(/\\\[(!|)(.*)\\]/g,function(n,o,i,s,c){const f=o&&"^"||"",l=i.replace(/\\-/,"-");return"["+f+l+"]"})),t}function et(r){return r&&r.endsWith("/")?r.substr(0,r.length-1):r}function tt(r,e){return new Promise(t=>{setTimeout(t,r,e)})}function rt(r){return r==null}function nt(){let r,e;const t=new Promise((n,o)=>{r=n,e=o});return{resolve:r,reject:e,promise:t}}async function ot(r,e){for(const t of r)await e(await t)}function it(r){return new Promise(e=>e(r()))}async function st(r,e){const t=[];for(let n=0;n<r.length;n+=e)t.push(...await Promise.all(r.slice(n,n+e).map(o=>o())));return t}function at(r){return(0,Ue.default)(e=>r(e),{forever:!0,factor:2,minTimeout:3e3,maxTimeout:15e3})}let ce;function ct(r){ce=r}function lt(){return ce}const D=(()=>{let r="";for(let e=32;e<=126;e++)r+=String.fromCharCode(e);return r})();a.DEFAULT_ALPHABET=D;function Y(r,e,t=D){return r.padEnd(e,t[0])}function A(r,e=D){const t=BigInt(e.length);if(r<=t){var n;return(n=e[Number(r)-1])!==null&&n!==void 0?n:""}let o=r/t,i=Number(r%t)-1;return i<0&&(o-=BigInt(Math.abs(i)),i=Number(t)-1),A(o,e)+e[i]}function R(r,e=D){const t=BigInt(e.length);let n=BigInt(0);for(let o=r.length-1,i=BigInt(0);o>=0;o--,i++){const s=r.charCodeAt(o)-e.charCodeAt(0);n+=BigInt(1+s)*t**i}return n}function ut(r,e,t=D){const n=Math.max(r.length,e.length),o=R(Y(r,n,t),t),i=R(Y(e,n,t),t),s=(o+i)/BigInt(2);return s===o||s==i?A(s,t)+t[0]:A(s,t)}function ft(r,e=D){return A(R(r,e)+BigInt(1),e)}function dt(r,e=D){return A(R(r,e)-BigInt(1),e)}function le(r,e){return r<e?-1:r===e?0:1}const pt=new Intl.Collator;function gt(r,e){return pt.compare(r,e)}function ue(r,e,t=!1){for(const[n,o]of Object.entries(e)){if(r[n]instanceof Object&&o){ue(r[n],o);continue}if(o!=null||!t){r[n]=o;continue}}return r}var ht=L.exports;Object.defineProperty(T,"__esModule",{value:!0}),T.SyncAccumulator=T.Category=void 0;var j=ht(F.exports),mt=C,vt=a;let O;T.Category=O,function(r){r.Invite="invite",r.Leave="leave",r.Join="join"}(O||(T.Category=O={}));class yt{constructor(e={}){this.opts=e,(0,j.default)(this,"accountData",{}),(0,j.default)(this,"inviteRooms",{}),(0,j.default)(this,"joinRooms",{}),(0,j.default)(this,"nextBatch",null),(0,j.default)(this,"groups",{invite:{},join:{},leave:{}}),this.opts.maxTimelineEntries=this.opts.maxTimelineEntries||50}accumulate(e,t=!1){this.accumulateRooms(e,t),this.accumulateGroups(e),this.accumulateAccountData(e),this.nextBatch=e.next_batch}accumulateAccountData(e){!e.account_data||!e.account_data.events||e.account_data.events.forEach(t=>{this.accountData[t.type]=t})}accumulateRooms(e,t=!1){!e.rooms||(e.rooms.invite&&Object.keys(e.rooms.invite).forEach(n=>{this.accumulateRoom(n,O.Invite,e.rooms.invite[n],t)}),e.rooms.join&&Object.keys(e.rooms.join).forEach(n=>{this.accumulateRoom(n,O.Join,e.rooms.join[n],t)}),e.rooms.leave&&Object.keys(e.rooms.leave).forEach(n=>{this.accumulateRoom(n,O.Leave,e.rooms.leave[n],t)}))}accumulateRoom(e,t,n,o=!1){switch(t){case O.Invite:this.accumulateInviteState(e,n);break;case O.Join:this.inviteRooms[e]&&delete this.inviteRooms[e],this.accumulateJoinState(e,n,o);break;case O.Leave:this.inviteRooms[e]?delete this.inviteRooms[e]:delete this.joinRooms[e];break;default:mt.logger.error("Unknown cateogory: ",t)}}accumulateInviteState(e,t){if(!t.invite_state||!t.invite_state.events)return;if(!this.inviteRooms[e]){this.inviteRooms[e]={invite_state:t.invite_state};return}const n=this.inviteRooms[e];t.invite_state.events.forEach(o=>{let i=!1;for(let s=0;s<n.invite_state.events.length;s++){const c=n.invite_state.events[s];c.type===o.type&&c.state_key==o.state_key&&(n.invite_state.events[s]=o,i=!0)}i||n.invite_state.events.push(o)})}accumulateJoinState(e,t,n=!1){this.joinRooms[e]||(this.joinRooms[e]={_currentState:Object.create(null),_timeline:[],_accountData:Object.create(null),_unreadNotifications:{},_summary:{},_readReceipts:{}});const o=this.joinRooms[e];if(t.account_data&&t.account_data.events&&t.account_data.events.forEach(i=>{o._accountData[i.type]=i}),t.unread_notifications&&(o._unreadNotifications=t.unread_notifications),t.summary){const i="m.heroes",s="m.invited_member_count",c="m.joined_member_count",f=o._summary,l=t.summary;f[i]=l[i]||f[i],f[c]=l[c]||f[c],f[s]=l[s]||f[s]}if(t.ephemeral&&t.ephemeral.events&&t.ephemeral.events.forEach(i=>{i.type!=="m.receipt"||!i.content||Object.keys(i.content).forEach(s=>{!i.content[s]["m.read"]||Object.keys(i.content[s]["m.read"]).forEach(c=>{o._readReceipts[c]={data:i.content[s]["m.read"][c],eventId:s}})})}),t.timeline&&t.timeline.limited&&(o._timeline=[]),t.state&&t.state.events&&t.state.events.forEach(i=>{q(o._currentState,i)}),t.timeline&&t.timeline.events&&t.timeline.events.forEach((i,s)=>{q(o._currentState,i);let c;if(n)c=i;else{c=Object.assign({},i),c.unsigned!==void 0&&(c.unsigned=Object.assign({},c.unsigned));const f=i.unsigned?i.unsigned.age:i.age;f!==void 0&&(c._localTs=Date.now()-f)}o._timeline.push({event:c,token:s===0?t.timeline.prev_batch:null})}),o._timeline.length>this.opts.maxTimelineEntries){const i=o._timeline.length-this.opts.maxTimelineEntries;for(let s=i;s<o._timeline.length;s++)if(o._timeline[s].token){o._timeline=o._timeline.slice(s,o._timeline.length);break}}}accumulateGroups(e){!e.groups||(e.groups.invite&&Object.keys(e.groups.invite).forEach(t=>{this.accumulateGroup(t,O.Invite,e.groups.invite[t])}),e.groups.join&&Object.keys(e.groups.join).forEach(t=>{this.accumulateGroup(t,O.Join,e.groups.join[t])}),e.groups.leave&&Object.keys(e.groups.leave).forEach(t=>{this.accumulateGroup(t,O.Leave,e.groups.leave[t])}))}accumulateGroup(e,t,n){for(const o of[O.Invite,O.Leave,O.Join])delete this.groups[o][e];this.groups[t][e]=n}getJSON(e=!1){const t={join:{},invite:{},leave:{}};Object.keys(this.inviteRooms).forEach(o=>{t.invite[o]=this.inviteRooms[o]}),Object.keys(this.joinRooms).forEach(o=>{const i=this.joinRooms[o],s={ephemeral:{events:[]},account_data:{events:[]},state:{events:[]},timeline:{events:[],prev_batch:null},unread_notifications:i._unreadNotifications,summary:i._summary};Object.keys(i._accountData).forEach(l=>{s.account_data.events.push(i._accountData[l])});const c={type:"m.receipt",room_id:o,content:{}};Object.keys(i._readReceipts).forEach(l=>{const u=i._readReceipts[l];c.content[u.eventId]||(c.content[u.eventId]={"m.read":{}}),c.content[u.eventId]["m.read"][l]=u.data}),Object.keys(c.content).length>0&&s.ephemeral.events.push(c),i._timeline.forEach(l=>{if(!s.timeline.prev_batch){if(!l.token)return;s.timeline.prev_batch=l.token}let u;!e&&l.event._localTs?(u=Object.assign({},l.event),u.unsigned!==void 0&&(u.unsigned=Object.assign({},u.unsigned)),delete u._localTs,u.unsigned=u.unsigned||{},u.unsigned.age=Date.now()-l.event._localTs):u=l.event,s.timeline.events.push(u)});const f=Object.create(null);for(let l=s.timeline.events.length-1;l>=0;l--){const u=s.timeline.events[l];if(u.state_key===null||u.state_key===void 0)continue;const p=(0,vt.deepCopy)(u);p.unsigned&&(p.unsigned.prev_content&&(p.content=p.unsigned.prev_content),p.unsigned.prev_sender&&(p.sender=p.unsigned.prev_sender)),q(f,p)}Object.keys(i._currentState).forEach(l=>{Object.keys(i._currentState[l]).forEach(u=>{let p=i._currentState[l][u];f[l]&&f[l][u]&&(p=f[l][u]),s.state.events.push(p)})}),t.join[o]=s});const n=[];return Object.keys(this.accountData).forEach(o=>{n.push(this.accountData[o])}),{nextBatch:this.nextBatch,roomsData:t,groupsData:this.groups,accountData:n}}getNextBatchToken(){return this.nextBatch}}T.SyncAccumulator=yt;function q(r,e){e.state_key===null||e.state_key===void 0||!e.type||(r[e.type]||(r[e.type]=Object.create(null)),r[e.type][e.state_key]=e)}var $={};Object.defineProperty($,"__esModule",{value:!0}),$.exists=bt;function bt(r,e){return new Promise((t,n)=>{let o=!0;const i=r.open(e);i.onupgradeneeded=()=>{o=!1},i.onblocked=()=>n(i.error),i.onsuccess=()=>{i.result.close(),o||r.deleteDatabase(e),t(o)},i.onerror=s=>n(i.error)})}var _t=L.exports;Object.defineProperty(K,"__esModule",{value:!0}),K.LocalIndexedDBStoreBackend=void 0;var M=_t(F.exports),Ot=T,B=de(a),wt=de($),m=C;function fe(r){if(typeof WeakMap!="function")return null;var e=new WeakMap,t=new WeakMap;return(fe=function(n){return n?t:e})(r)}function de(r,e){if(!e&&r&&r.__esModule)return r;if(r===null||typeof r!="object"&&typeof r!="function")return{default:r};var t=fe(e);if(t&&t.has(r))return t.get(r);var n={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in r)if(i!=="default"&&Object.prototype.hasOwnProperty.call(r,i)){var s=o?Object.getOwnPropertyDescriptor(r,i):null;s&&(s.get||s.set)?Object.defineProperty(n,i,s):n[i]=r[i]}return n.default=r,t&&t.set(r,n),n}const xt=3;function St(r){r.createObjectStore("users",{keyPath:["userId"]}),r.createObjectStore("accountData",{keyPath:["type"]}),r.createObjectStore("sync",{keyPath:["clobber"]})}function Et(r){r.createObjectStore("oob_membership_events",{keyPath:["room_id","state_key"]}).createIndex("room","room_id")}function kt(r){r.createObjectStore("client_options",{keyPath:["clobber"]})}function J(r,e,t){const n=r.openCursor(e);return new Promise((o,i)=>{const s=[];n.onerror=()=>{i(new Error("Query failed: "+n.error))},n.onsuccess=()=>{const c=n.result;if(!c){o(s);return}s.push(t(c)),c.continue()}})}function U(r){return new Promise((e,t)=>{r.oncomplete=function(n){e(n)},r.onerror=function(){t(r.error)}})}function pe(r){return new Promise((e,t)=>{r.onsuccess=function(n){e(n)},r.onerror=function(){t(r.error)}})}function Tt(r){return new Promise((e,t)=>{r.onsuccess=()=>e(r),r.onerror=n=>t(n)})}function ge(r){return pe(r).then(e=>r.result)}class Dt{static exists(e,t){return t="matrix-js-sdk:"+(t||"default"),wt.exists(e,t)}constructor(e,t){this.indexedDB=e,(0,M.default)(this,"dbName",void 0),(0,M.default)(this,"syncAccumulator",void 0),(0,M.default)(this,"db",null),(0,M.default)(this,"disconnected",!0),(0,M.default)(this,"_isNewlyCreated",!1),this.dbName="matrix-js-sdk:"+(t||"default"),this.syncAccumulator=new Ot.SyncAccumulator}connect(){if(!this.disconnected)return m.logger.log("LocalIndexedDBStoreBackend.connect: already connected or connecting"),Promise.resolve();this.disconnected=!1,m.logger.log("LocalIndexedDBStoreBackend.connect: connecting...");const e=this.indexedDB.open(this.dbName,xt);return e.onupgradeneeded=t=>{const n=e.result,o=t.oldVersion;m.logger.log(`LocalIndexedDBStoreBackend.connect: upgrading from ${o}`),o<1&&(this._isNewlyCreated=!0,St(n)),o<2&&Et(n),o<3&&kt(n)},e.onblocked=()=>{m.logger.log("can't yet open LocalIndexedDBStoreBackend because it is open elsewhere")},m.logger.log("LocalIndexedDBStoreBackend.connect: awaiting connection..."),pe(e).then(()=>(m.logger.log("LocalIndexedDBStoreBackend.connect: connected"),this.db=e.result,this.db.onversionchange=()=>{this.db.close()},this.init()))}isNewlyCreated(){return Promise.resolve(this._isNewlyCreated)}init(){return Promise.all([this.loadAccountData(),this.loadSyncData()]).then(([e,t])=>{m.logger.log("LocalIndexedDBStoreBackend: loaded initial data"),this.syncAccumulator.accumulate({next_batch:t.nextBatch,rooms:t.roomsData,groups:t.groupsData,account_data:{events:e}},!0)})}getOutOfBandMembers(e){return new Promise((t,n)=>{const s=this.db.transaction(["oob_membership_events"],"readonly").objectStore("oob_membership_events").index("room"),c=IDBKeyRange.only(e),f=s.openCursor(c),l=[];let u=!1;f.onsuccess=()=>{const p=f.result;if(!p)return!l.length&&!u?t(null):t(l);const y=p.value;y.oob_written?u=!0:l.push(y),p.continue()},f.onerror=p=>{n(p)}}).then(t=>(m.logger.log(`LL: got ${t&&t.length} membershipEvents from storage for room ${e} ...`),t))}async setOutOfBandMembers(e,t){m.logger.log(`LL: backend about to store ${t.length} members for ${e}`);const n=this.db.transaction(["oob_membership_events"],"readwrite"),o=n.objectStore("oob_membership_events");t.forEach(s=>{o.put(s)});const i={room_id:e,oob_written:!0,state_key:0};o.put(i),await U(n),m.logger.log(`LL: backend done storing for ${e}!`)}async clearOutOfBandMembers(e){const o=this.db.transaction(["oob_membership_events"],"readonly").objectStore("oob_membership_events").index("room"),i=IDBKeyRange.only(e),s=ge(o.openKeyCursor(i,"next")).then(S=>S&&S.primaryKey[1]),c=ge(o.openKeyCursor(i,"prev")).then(S=>S&&S.primaryKey[1]),[f,l]=await Promise.all([s,c]),p=this.db.transaction(["oob_membership_events"],"readwrite").objectStore("oob_membership_events"),y=IDBKeyRange.bound([e,f],[e,l]);m.logger.log(`LL: Deleting all users + marker in storage for room ${e}, with key range:`,[e,f],[e,l]),await Tt(p.delete(y))}clearDatabase(){return new Promise(e=>{m.logger.log(`Removing indexeddb instance: ${this.dbName}`);const t=this.indexedDB.deleteDatabase(this.dbName);t.onblocked=()=>{m.logger.log(`can't yet delete indexeddb ${this.dbName} because it is open elsewhere`)},t.onerror=()=>{m.logger.warn(`unable to delete js-sdk store indexeddb: ${t.error}`),e()},t.onsuccess=()=>{m.logger.log(`Removed indexeddb instance: ${this.dbName}`),e()}})}getSavedSync(e=!0){const t=this.syncAccumulator.getJSON();return t.nextBatch?e?Promise.resolve(B.deepCopy(t)):Promise.resolve(t):Promise.resolve(null)}getNextBatchToken(){return Promise.resolve(this.syncAccumulator.getNextBatchToken())}setSyncData(e){return Promise.resolve().then(()=>{this.syncAccumulator.accumulate(e)})}async syncToDatabase(e){const t=this.syncAccumulator.getJSON(!0);await Promise.all([this.persistUserPresenceEvents(e),this.persistAccountData(t.accountData),this.persistSyncData(t.nextBatch,t.roomsData,t.groupsData)])}persistSyncData(e,t,n){return m.logger.log("Persisting sync data up to",e),B.promiseTry(()=>{const o=this.db.transaction(["sync"],"readwrite");return o.objectStore("sync").put({clobber:"-",nextBatch:e,roomsData:t,groupsData:n}),U(o).then()})}persistAccountData(e){return B.promiseTry(()=>{const t=this.db.transaction(["accountData"],"readwrite"),n=t.objectStore("accountData");for(let o=0;o<e.length;o++)n.put(e[o]);return U(t).then()})}persistUserPresenceEvents(e){return B.promiseTry(()=>{const t=this.db.transaction(["users"],"readwrite"),n=t.objectStore("users");for(const o of e)n.put({userId:o[0],event:o[1]});return U(t).then()})}getUserPresenceEvents(){return B.promiseTry(()=>{const t=this.db.transaction(["users"],"readonly").objectStore("users");return J(t,void 0,n=>[n.value.userId,n.value.event])})}loadAccountData(){return m.logger.log("LocalIndexedDBStoreBackend: loading account data..."),B.promiseTry(()=>{const t=this.db.transaction(["accountData"],"readonly").objectStore("accountData");return J(t,void 0,n=>n.value).then(n=>(m.logger.log("LocalIndexedDBStoreBackend: loaded account data"),n))})}loadSyncData(){return m.logger.log("LocalIndexedDBStoreBackend: loading sync data..."),B.promiseTry(()=>{const t=this.db.transaction(["sync"],"readonly").objectStore("sync");return J(t,void 0,n=>n.value).then(n=>(m.logger.log("LocalIndexedDBStoreBackend: loaded sync data"),n.length>1&&m.logger.warn("loadSyncData: More than 1 sync row found."),n.length>0?n[0]:{}))})}getClientOptions(){return Promise.resolve().then(()=>{const t=this.db.transaction(["client_options"],"readonly").objectStore("client_options");return J(t,void 0,n=>{if(n.value&&n.value&&n.value.options)return n.value.options}).then(n=>n[0])})}async storeClientOptions(e){const t=this.db.transaction(["client_options"],"readwrite");t.objectStore("client_options").put({clobber:"-",options:e}),await U(t)}}K.LocalIndexedDBStoreBackend=Dt;var Bt=L.exports;Object.defineProperty(_,"__esModule",{value:!0}),_.IndexedDBStoreWorker=void 0;var he=Bt(F.exports),Pt=K,me=C;class Lt{constructor(e){this.postMessage=e,(0,he.default)(this,"backend",null),(0,he.default)(this,"onMessage",t=>{const n=t.data;let o;switch(n.command){case"_setupWorker":this.backend=new Pt.LocalIndexedDBStoreBackend(indexedDB,n.args[0]),o=Promise.resolve();break;case"connect":o=this.backend.connect();break;case"isNewlyCreated":o=this.backend.isNewlyCreated();break;case"clearDatabase":o=this.backend.clearDatabase();break;case"getSavedSync":o=this.backend.getSavedSync(!1);break;case"setSyncData":o=this.backend.setSyncData(n.args[0]);break;case"syncToDatabase":o=this.backend.syncToDatabase(n.args[0]);break;case"getUserPresenceEvents":o=this.backend.getUserPresenceEvents();break;case"getNextBatchToken":o=this.backend.getNextBatchToken();break;case"getOutOfBandMembers":o=this.backend.getOutOfBandMembers(n.args[0]);break;case"clearOutOfBandMembers":o=this.backend.clearOutOfBandMembers(n.args[0]);break;case"setOutOfBandMembers":o=this.backend.setOutOfBandMembers(n.args[0],n.args[1]);break;case"getClientOptions":o=this.backend.getClientOptions();break;case"storeClientOptions":o=this.backend.storeClientOptions(n.args[0]);break}if(o===void 0){this.postMessage({command:"cmd_fail",seq:n.seq,error:"Unrecognised command"});return}o.then(i=>{this.postMessage.call(null,{command:"cmd_success",seq:n.seq,result:i})},i=>{me.logger.error("Error running command: "+n.command),me.logger.error(i),this.postMessage.call(null,{command:"cmd_fail",seq:n.seq,error:{message:i.message,name:i.name}})})})}}_.IndexedDBStoreWorker=Lt,function(r){Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"IndexedDBStoreWorker",{enumerable:!0,get:function(){return e.IndexedDBStoreWorker}});var e=_}(w);const ve=self,Ct=new w.IndexedDBStoreWorker(ve.postMessage);ve.onmessage=Ct.onMessage})();
diff --git a/pr-121/assets/indexeddb.worker.c669c402.js b/pr-121/assets/indexeddb.worker.c669c402.js
@@ -0,0 +1 @@
+(function(){"use strict";var xe=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:{},G={},R={},P={exports:{}};(function(r){function e(t){return t&&t.__esModule?t:{default:t}}r.exports=e,r.exports.__esModule=!0,r.exports.default=r.exports})(P);var j={exports:{}},z={exports:{}},H={exports:{}};(function(r){function e(t){return r.exports=e=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(n){return typeof n}:function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},r.exports.__esModule=!0,r.exports.default=r.exports,e(t)}r.exports=e,r.exports.__esModule=!0,r.exports.default=r.exports})(H);var Z={exports:{}};(function(r){var e=H.exports.default;function t(n,o){if(e(n)!=="object"||n===null)return n;var i=n[Symbol.toPrimitive];if(i!==void 0){var s=i.call(n,o||"default");if(e(s)!=="object")return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return(o==="string"?String:Number)(n)}r.exports=t,r.exports.__esModule=!0,r.exports.default=r.exports})(Z),function(r){var e=H.exports.default,t=Z.exports;function n(o){var i=t(o,"string");return e(i)==="symbol"?i:String(i)}r.exports=n,r.exports.__esModule=!0,r.exports.default=r.exports}(z),function(r){var e=z.exports;function t(n,o,i){return o=e(o),o in n?Object.defineProperty(n,o,{value:i,enumerable:!0,configurable:!0,writable:!0}):n[o]=i,n}r.exports=t,r.exports.__esModule=!0,r.exports.default=r.exports}(j);var U={},S={},D={},Q={exports:{}};(function(r){(function(e,t){r.exports?r.exports=t():e.log=t()})(xe,function(){var e=function(){},t="undefined",n=typeof window!==t&&typeof window.navigator!==t&&/Trident\/|MSIE /.test(window.navigator.userAgent),o=["trace","debug","info","warn","error"];function i(h,v){var b=h[v];if(typeof b.bind=="function")return b.bind(h);try{return Function.prototype.bind.call(b,h)}catch{return function(){return Function.prototype.apply.apply(b,[h,arguments])}}}function s(){console.log&&(console.log.apply?console.log.apply(console,arguments):Function.prototype.apply.apply(console.log,[console,arguments])),console.trace&&console.trace()}function c(h){return h==="debug"&&(h="log"),typeof console===t?!1:h==="trace"&&n?s:console[h]!==void 0?i(console,h):console.log!==void 0?i(console,"log"):e}function f(h,v){for(var b=0;b<o.length;b++){var g=o[b];this[g]=b<h?e:this.methodFactory(g,h,v)}this.log=this.debug}function l(h,v,b){return function(){typeof console!==t&&(f.call(this,v,b),this[h].apply(this,arguments))}}function u(h,v,b){return c(h)||l.apply(this,arguments)}function p(h,v,b){var g=this,_e;v=v==null?"WARN":v;var w="loglevel";typeof h=="string"?w+=":"+h:typeof h=="symbol"&&(w=void 0);function At(d){var T=(o[d]||"silent").toUpperCase();if(!(typeof window===t||!w)){try{window.localStorage[w]=T;return}catch{}try{window.document.cookie=encodeURIComponent(w)+"="+T+";"}catch{}}}function Oe(){var d;if(!(typeof window===t||!w)){try{d=window.localStorage[w]}catch{}if(typeof d===t)try{var T=window.document.cookie,J=T.indexOf(encodeURIComponent(w)+"=");J!==-1&&(d=/^([^;]+)/.exec(T.slice(J))[1])}catch{}return g.levels[d]===void 0&&(d=void 0),d}}function Mt(){if(!(typeof window===t||!w)){try{window.localStorage.removeItem(w);return}catch{}try{window.document.cookie=encodeURIComponent(w)+"=; expires=Thu, 01 Jan 1970 00:00:00 UTC"}catch{}}}g.name=h,g.levels={TRACE:0,DEBUG:1,INFO:2,WARN:3,ERROR:4,SILENT:5},g.methodFactory=b||u,g.getLevel=function(){return _e},g.setLevel=function(d,T){if(typeof d=="string"&&g.levels[d.toUpperCase()]!==void 0&&(d=g.levels[d.toUpperCase()]),typeof d=="number"&&d>=0&&d<=g.levels.SILENT){if(_e=d,T!==!1&&At(d),f.call(g,d,h),typeof console===t&&d<g.levels.SILENT)return"No console available for logging"}else throw"log.setLevel() called with invalid level: "+d},g.setDefaultLevel=function(d){v=d,Oe()||g.setLevel(d,!1)},g.resetLevel=function(){g.setLevel(v,!1),Mt()},g.enableAll=function(d){g.setLevel(g.levels.TRACE,d)},g.disableAll=function(d){g.setLevel(g.levels.SILENT,d)};var $=Oe();$==null&&($=v),g.setLevel($,!1)}var y=new p,x={};y.getLogger=function(v){if(typeof v!="symbol"&&typeof v!="string"||v==="")throw new TypeError("You must supply a name when creating a logger.");var b=x[v];return b||(b=x[v]=new p(v,y.getLevel(),y.methodFactory)),b};var I=typeof window!==t?window.log:void 0;return y.noConflict=function(){return typeof window!==t&&window.log===y&&(window.log=I),y},y.getLoggers=function(){return x},y.default=y,y})})(Q);var we=P.exports;Object.defineProperty(D,"__esModule",{value:!0}),D.logger=void 0;var L=we(Q.exports);const ee="matrix";L.default.methodFactory=function(r,e,t){return function(...n){return this.prefix&&n.unshift(this.prefix),r==="error"||r==="warn"||r==="trace"||r==="info"?console[r](...n):console.log(...n)}};const V=L.default.getLogger(ee);D.logger=V,V.setLevel(L.default.levels.DEBUG,!1);function te(r){r.withPrefix=function(e){const t=this.prefix||"";return Se(t+e)}}te(V);function Se(r){const e=L.default.getLogger(`${ee}-${r}`);return e.prefix!==r&&(te(e),e.prefix=r,e.setLevel(L.default.levels.DEBUG,!1)),e}var a={},Ee={0:"O",1:"l","\u05AD":"\u0596","\u05AE":"\u0598","\u05A8":"\u0599","\u05A4":"\u059A","\u1AB4":"\u06DB","\u20DB":"\u06DB","\u0619":"\u0313","\u08F3":"\u0313","\u0343":"\u0313","\u0315":"\u0313","\u064F":"\u0313","\u065D":"\u0314","\u059C":"\u0301","\u059D":"\u0301","\u0618":"\u0301","\u0747":"\u0301","\u0341":"\u0301","\u0954":"\u0301","\u064E":"\u0301","\u0340":"\u0300","\u0953":"\u0300","\u030C":"\u0306","\uA67C":"\u0306","\u0658":"\u0306","\u065A":"\u0306","\u036E":"\u0306","\u06E8":"\u0306\u0307","\u0310":"\u0306\u0307","\u0901":"\u0306\u0307","\u0981":"\u0306\u0307","\u0A81":"\u0306\u0307","\u0B01":"\u0306\u0307","\u0C00":"\u0306\u0307","\u0C81":"\u0306\u0307","\u0D01":"\u0306\u0307","\u{114BF}":"\u0306\u0307","\u1CD0":"\u0302","\u0311":"\u0302","\u065B":"\u0302","\u07EE":"\u0302","\uA6F0":"\u0302","\u05AF":"\u030A","\u06DF":"\u030A","\u17D3":"\u030A","\u309A":"\u030A","\u0652":"\u030A","\u0B82":"\u030A","\u1036":"\u030A","\u17C6":"\u030A","\u{11300}":"\u030A","\u0E4D":"\u030A","\u0ECD":"\u030A","\u0366":"\u030A","\u2DEA":"\u030A","\u08EB":"\u0308","\u07F3":"\u0308","\u064B":"\u030B","\u08F0":"\u030B","\u0342":"\u0303","\u0653":"\u0303","\u05C4":"\u0307","\u06EC":"\u0307","\u0740":"\u0307","\u08EA":"\u0307","\u0741":"\u0307","\u0358":"\u0307","\u05B9":"\u0307","\u05BA":"\u0307","\u05C2":"\u0307","\u05C1":"\u0307","\u07ED":"\u0307","\u0902":"\u0307","\u0A02":"\u0307","\u0A82":"\u0307","\u0BCD":"\u0307","\u0337":"\u0338","\u1AB7":"\u0328","\u0322":"\u0328","\u0345":"\u0328","\u1CD2":"\u0304","\u0305":"\u0304","\u0659":"\u0304","\u07EB":"\u0304","\uA6F1":"\u0304","\u1CDA":"\u030E","\u0657":"\u0312","\u0357":"\u0350","\u08FF":"\u0350","\u08F8":"\u0350","\u0900":"\u0352","\u1CED":"\u0316","\u1CDC":"\u0329","\u0656":"\u0329","\u1CD5":"\u032B","\u0347":"\u0333","\u08F9":"\u0354","\u08FA":"\u0355","\u309B":"\uFF9E","\u309C":"\uFF9F","\u0336":"\u0335","\u302C":"\u0309","\u05C5":"\u0323","\u08ED":"\u0323","\u1CDD":"\u0323","\u05B4":"\u0323","\u065C":"\u0323","\u093C":"\u0323","\u09BC":"\u0323","\u0A3C":"\u0323","\u0ABC":"\u0323","\u0B3C":"\u0323","\u{111CA}":"\u0323","\u{114C3}":"\u0323","\u{10A3A}":"\u0323","\u08EE":"\u0324","\u1CDE":"\u0324","\u0F37":"\u0325","\u302D":"\u0325","\u0327":"\u0326","\u0321":"\u0326","\u0339":"\u0326","\u1CD9":"\u032D","\u1CD8":"\u032E","\u0952":"\u0331","\u0320":"\u0331","\u08F1":"\u064C","\u08E8":"\u064C","\u08E5":"\u064C",\uFC5E:"\uFE72\u0651","\u08F2":"\u064D",\uFC5F:"\uFE74\u0651",\uFCF2:"\uFE77\u0651",\uFC60:"\uFE76\u0651",\uFCF3:"\uFE79\u0651",\uFC61:"\uFE78\u0651","\u061A":"\u0650","\u0317":"\u0650",\uFCF4:"\uFE7B\u0651",\uFC62:"\uFE7A\u0651",\uFC63:"\uFE7C\u0670","\u065F":"\u0655","\u030D":"\u0670","\u0742":"\u073C","\u0A03":"\u0983","\u0C03":"\u0983","\u0C83":"\u0983","\u0D03":"\u0983","\u0D83":"\u0983","\u1038":"\u0983","\u{114C1}":"\u0983","\u17CB":"\u0E48","\u0EC8":"\u0E48","\u0EC9":"\u0E49","\u0ECA":"\u0E4A","\u0ECB":"\u0E4B","\uA66F":"\u20E9","\u2028":" ","\u2029":" ","\u1680":" ","\u2000":" ","\u2001":" ","\u2002":" ","\u2003":" ","\u2004":" ","\u2005":" ","\u2006":" ","\u2008":" ","\u2009":" ","\u200A":" ","\u205F":" ","\xA0":" ","\u2007":" ","\u202F":" ","\u07FA":"_","\uFE4D":"_","\uFE4E":"_","\uFE4F":"_","\u2010":"-","\u2011":"-","\u2012":"-","\u2013":"-","\uFE58":"-","\u06D4":"-","\u2043":"-","\u02D7":"-","\u2212":"-","\u2796":"-","\u2CBA":"-","\u2A29":"-\u0313","\u2E1A":"-\u0308","\uFB29":"-\u0307","\u2238":"-\u0307","\u2A2A":"-\u0323","\uA4FE":"-.","\uFF5E":"\u301C","\u060D":",","\u066B":",","\u201A":",","\xB8":",","\uA4F9":",","\u2E32":"\u060C","\u066C":"\u060C","\u037E":";","\u2E35":"\u061B","\u0903":":","\u0A83":":","\uFF1A":":","\u0589":":","\u0703":":","\u0704":":","\u16EC":":","\uFE30":":","\u1803":":","\u1809":":","\u205A":":","\u05C3":":","\u02F8":":","\uA789":":","\u2236":":",\u02D0:":","\uA4FD":":","\u2A74":"::=","\u29F4":":\u2192","\uFF01":"!",\u01C3:"!","\u2D51":"!","\u203C":"!!","\u2049":"!?",\u0294:"?","\u0241":"?","\u097D":"?",\u13AE:"?","\uA6EB":"?","\u2048":"?!","\u2047":"??","\u2E2E":"\u061F","\u{1D16D}":".","\u2024":".","\u0701":".","\u0702":".","\uA60E":".","\u{10A50}":".","\u0660":".","\u06F0":".","\uA4F8":".","\uA4FB":".,","\u2025":"..","\uA4FA":"..","\u2026":"...","\uA6F4":"\uA6F3\uA6F3","\u30FB":"\xB7","\uFF65":"\xB7","\u16EB":"\xB7","\u0387":"\xB7","\u2E31":"\xB7","\u{10101}":"\xB7","\u2022":"\xB7","\u2027":"\xB7","\u2219":"\xB7","\u22C5":"\xB7","\uA78F":"\xB7",\u1427:"\xB7","\u22EF":"\xB7\xB7\xB7","\u2D48":"\xB7\xB7\xB7",\u1444:"\xB7<","\u22D7":"\xB7>",\u1437:"\xB7>",\u1440:"\xB7>",\u152F:"\xB74",\u147E:"\xB7b",\u1480:"\xB7b\u0307",\u147A:"\xB7d",\u1498:"\xB7J",\u14B6:"\xB7L",\u1476:"\xB7P",\u1457:"\xB7U",\u143A:"\xB7V",\u143C:"\xB7\u0245",\u14AE:"\xB7\u0393",\u140E:"\xB7\u0394",\u1459:"\xB7\u0548",\u140C:"\xB7\u1401",\u1410:"\xB7\u1404",\u1412:"\xB7\u1405",\u1414:"\xB7\u1406",\u1417:"\xB7\u140A",\u1419:"\xB7\u140B",\u143E:"\xB7\u1432",\u1442:"\xB7\u1434",\u1446:"\xB7\u1439",\u145B:"\xB7\u144F",\u1454:"\xB7\u1450",\u145D:"\xB7\u1450",\u145F:"\xB7\u1451",\u1461:"\xB7\u1455",\u1463:"\xB7\u1456",\u1474:"\xB7\u146B",\u1478:"\xB7\u146E",\u147C:"\xB7\u1470",\u1492:"\xB7\u1489",\u1494:"\xB7\u148B",\u1496:"\xB7\u148C",\u149A:"\xB7\u148E",\u149C:"\xB7\u1490",\u149E:"\xB7\u1491",\u14AC:"\xB7\u14A3",\u14B0:"\xB7\u14A6",\u14B2:"\xB7\u14A7",\u14B4:"\xB7\u14A8",\u14B8:"\xB7\u14AB",\u14C9:"\xB7\u14C0","\u18C6":"\xB7\u14C2","\u18C8":"\xB7\u14C3","\u18CA":"\xB7\u14C4","\u18CC":"\xB7\u14C5",\u14CB:"\xB7\u14C7",\u14CD:"\xB7\u14C8",\u14DC:"\xB7\u14D3",\u14DE:"\xB7\u14D5",\u14E0:"\xB7\u14D6",\u14E2:"\xB7\u14D7",\u14E4:"\xB7\u14D8",\u14E6:"\xB7\u14DA",\u14E8:"\xB7\u14DB",\u14F6:"\xB7\u14ED",\u14F8:"\xB7\u14EF",\u14FA:"\xB7\u14F0",\u14FC:"\xB7\u14F1",\u14FE:"\xB7\u14F2",\u1500:"\xB7\u14F4",\u1502:"\xB7\u14F5",\u1517:"\xB7\u1510",\u1519:"\xB7\u1511",\u151B:"\xB7\u1512",\u151D:"\xB7\u1513",\u151F:"\xB7\u1514",\u1521:"\xB7\u1515",\u1523:"\xB7\u1516",\u1531:"\xB7\u1528",\u1533:"\xB7\u1529",\u1535:"\xB7\u152A",\u1537:"\xB7\u152B",\u1539:"\xB7\u152D",\u153B:"\xB7\u152E","\u18CE":"\xB7\u1543","\u18CF":"\xB7\u1546","\u18D0":"\xB7\u1547","\u18D1":"\xB7\u1548","\u18D2":"\xB7\u1549","\u18D3":"\xB7\u154B",\u154E:"\xB7\u154C",\u155B:"\xB7\u155A",\u1568:"\xB7\u1567","\u18B3":"\xB7\u18B1","\u18B6":"\xB7\u18B4","\u18B9":"\xB7\u18B8","\u18C2":"\xB7\u18C0","\uA830":"\u0964","\u0965":"\u0964\u0964","\u1C3C":"\u1C3B\u1C3B","\u104B":"\u104A\u104A","\u1AA9":"\u1AA8\u1AA8","\u1AAB":"\u1AAA\u1AA8","\u1B5F":"\u1B5E\u1B5E","\u{10A57}":"\u{10A56}\u{10A56}","\u{1144C}":"\u{1144B}\u{1144B}","\u{11642}":"\u{11641}\u{11641}","\u{11C42}":"\u{11C41}\u{11C41}","\u1C7F":"\u1C7E\u1C7E","\u055D":"'","\uFF07":"'","\u2018":"'","\u2019":"'","\u201B":"'","\u2032":"'","\u2035":"'","\u055A":"'","\u05F3":"'","`":"'","\u1FEF":"'","\uFF40":"'","\xB4":"'","\u0384":"'","\u1FFD":"'","\u1FBD":"'","\u1FBF":"'","\u1FFE":"'","\u02B9":"'","\u0374":"'","\u02C8":"'","\u02CA":"'","\u02CB":"'","\u02F4":"'",\u02BB:"'",\u02BD:"'",\u02BC:"'",\u02BE:"'","\uA78C":"'",\u05D9:"'","\u07F4":"'","\u07F5":"'",\u144A:"'",\u16CC:"'","\u{16F51}":"'","\u{16F52}":"'","\u1CD3":"''",'"':"''","\uFF02":"''","\u201C":"''","\u201D":"''","\u201F":"''","\u2033":"''","\u2036":"''","\u3003":"''","\u05F4":"''","\u02DD":"''","\u02BA":"''","\u02F6":"''",\u02EE:"''",\u05F2:"''","\u2034":"'''","\u2037":"'''","\u2057":"''''",\u0181:"'B",\u018A:"'D",\u0149:"'n",\u01A4:"'P",\u01AC:"'T",\u01B3:"'Y","\uFF3B":"(","\u2768":"(","\u2772":"(","\u3014":"(","\uFD3E":"(","\u2E28":"((","\u3220":"(\u30FC)","\u2475":"(2)","\u2487":"(2O)","\u2476":"(3)","\u2477":"(4)","\u2478":"(5)","\u2479":"(6)","\u247A":"(7)","\u247B":"(8)","\u247C":"(9)","\u249C":"(a)","\u{1F110}":"(A)","\u249D":"(b)","\u{1F111}":"(B)","\u249E":"(c)","\u{1F112}":"(C)","\u249F":"(d)","\u{1F113}":"(D)","\u24A0":"(e)","\u{1F114}":"(E)","\u24A1":"(f)","\u{1F115}":"(F)","\u24A2":"(g)","\u{1F116}":"(G)","\u24A3":"(h)","\u{1F117}":"(H)","\u24A4":"(i)","\u24A5":"(j)","\u{1F119}":"(J)","\u24A6":"(k)","\u{1F11A}":"(K)","\u2474":"(l)","\u{1F118}":"(l)","\u24A7":"(l)","\u{1F11B}":"(L)","\u247F":"(l2)","\u2480":"(l3)","\u2481":"(l4)","\u2482":"(l5)","\u2483":"(l6)","\u2484":"(l7)","\u2485":"(l8)","\u2486":"(l9)","\u247E":"(ll)","\u247D":"(lO)","\u{1F11C}":"(M)","\u24A9":"(n)","\u{1F11D}":"(N)","\u24AA":"(o)","\u{1F11E}":"(O)","\u24AB":"(p)","\u{1F11F}":"(P)","\u24AC":"(q)","\u{1F120}":"(Q)","\u24AD":"(r)","\u{1F121}":"(R)","\u24A8":"(rn)","\u24AE":"(s)","\u{1F122}":"(S)","\u{1F12A}":"(S)","\u24AF":"(t)","\u{1F123}":"(T)","\u24B0":"(u)","\u{1F124}":"(U)","\u24B1":"(v)","\u{1F125}":"(V)","\u24B2":"(w)","\u{1F126}":"(W)","\u24B3":"(x)","\u{1F127}":"(X)","\u24B4":"(y)","\u{1F128}":"(Y)","\u24B5":"(z)","\u{1F129}":"(Z)","\u3200":"(\u1100)","\u320E":"(\uAC00)","\u3201":"(\u1102)","\u320F":"(\uB098)","\u3202":"(\u1103)","\u3210":"(\uB2E4)","\u3203":"(\u1105)","\u3211":"(\uB77C)","\u3204":"(\u1106)","\u3212":"(\uB9C8)","\u3205":"(\u1107)","\u3213":"(\uBC14)","\u3206":"(\u1109)","\u3214":"(\uC0AC)","\u3207":"(\u110B)","\u3215":"(\uC544)","\u321D":"(\uC624\uC804)","\u321E":"(\uC624\uD6C4)","\u3208":"(\u110C)","\u3216":"(\uC790)","\u321C":"(\uC8FC)","\u3209":"(\u110E)","\u3217":"(\uCC28)","\u320A":"(\u110F)","\u3218":"(\uCE74)","\u320B":"(\u1110)","\u3219":"(\uD0C0)","\u320C":"(\u1111)","\u321A":"(\uD30C)","\u320D":"(\u1112)","\u321B":"(\uD558)","\u3226":"(\u4E03)","\u3222":"(\u4E09)","\u{1F241}":"(\u4E09)","\u3228":"(\u4E5D)","\u3221":"(\u4E8C)","\u{1F242}":"(\u4E8C)","\u3224":"(\u4E94)","\u3239":"(\u4EE3)","\u323D":"(\u4F01)","\u3241":"(\u4F11)","\u3227":"(\u516B)","\u3225":"(\u516D)","\u3238":"(\u52B4)","\u{1F247}":"(\u52DD)","\u3229":"(\u5341)","\u323F":"(\u5354)","\u3234":"(\u540D)","\u323A":"(\u547C)","\u3223":"(\u56DB)","\u322F":"(\u571F)","\u323B":"(\u5B66)","\u{1F243}":"(\u5B89)","\u{1F245}":"(\u6253)","\u{1F248}":"(\u6557)","\u3230":"(\u65E5)","\u322A":"(\u6708)","\u3232":"(\u6709)","\u322D":"(\u6728)","\u{1F240}":"(\u672C)","\u3231":"(\u682A)","\u322C":"(\u6C34)","\u322B":"(\u706B)","\u{1F244}":"(\u70B9)","\u3235":"(\u7279)","\u{1F246}":"(\u76D7)","\u323C":"(\u76E3)","\u3233":"(\u793E)","\u3237":"(\u795D)","\u3240":"(\u796D)","\u3242":"(\u81EA)","\u3243":"(\u81F3)","\u3236":"(\u8CA1)","\u323E":"(\u8CC7)","\u322E":"(\u91D1)","\uFF3D":")","\u2769":")","\u2773":")","\u3015":")","\uFD3F":")","\u2E29":"))","\u2774":"{","\u{1D114}":"{","\u2775":"}","\u301A":"\u27E6","\u301B":"\u27E7","\u27E8":"\u276C","\u2329":"\u276C","\u3008":"\u276C","\u31DB":"\u276C",\u304F:"\u276C","\u{21FE8}":"\u276C","\u27E9":"\u276D","\u232A":"\u276D","\u3009":"\u276D","\uFF3E":"\uFE3F","\u2E3F":"\xB6","\u204E":"*","\u066D":"*","\u2217":"*","\u{1031F}":"*","\u1735":"/","\u2041":"/","\u2215":"/","\u2044":"/","\u2571":"/","\u27CB":"/","\u29F8":"/","\u{1D23A}":"/","\u31D3":"/",\u3033:"/","\u2CC6":"/",\u30CE:"/",\u4E3F:"/","\u2F03":"/","\u29F6":"/\u0304","\u2AFD":"//","\u2AFB":"///","\uFF3C":"\\","\uFE68":"\\","\u2216":"\\","\u27CD":"\\","\u29F5":"\\","\u29F9":"\\","\u{1D20F}":"\\","\u{1D23B}":"\\","\u31D4":"\\",\u4E36:"\\","\u2F02":"\\","\u2CF9":"\\\\","\u244A":"\\\\","\u27C8":"\\\u1455","\uA778":"&","\u0AF0":"\u0970","\u{110BB}":"\u0970","\u{111C7}":"\u0970","\u26AC":"\u0970","\u{111DB}":"\uA8FC","\u17D9":"\u0E4F","\u17D5":"\u0E5A","\u17DA":"\u0E5B","\u0F0C":"\u0F0B","\u0F0E":"\u0F0D\u0F0D","\u02C4":"^","\u02C6":"^","\uA67E":"\u02C7","\u02D8":"\u02C7","\u203E":"\u02C9","\uFE49":"\u02C9","\uFE4A":"\u02C9","\uFE4B":"\u02C9","\uFE4C":"\u02C9","\xAF":"\u02C9","\uFFE3":"\u02C9","\u2594":"\u02C9",\u044A:"\u02C9b","\uA651":"\u02C9bi","\u0375":"\u02CF","\u02FB":"\u02EA","\uA716":"\u02EA","\uA714":"\u02EB","\u3002":"\u02F3","\u2E30":"\xB0","\u02DA":"\xB0","\u2218":"\xB0","\u25CB":"\xB0","\u25E6":"\xB0","\u235C":"\xB0\u0332","\u2364":"\xB0\u0308","\u2103":"\xB0C","\u2109":"\xB0F","\u0BF5":"\u0BF3","\u0F1B":"\u0F1A\u0F1A","\u0F1F":"\u0F1A\u0F1D","\u0FCE":"\u0F1D\u0F1A","\u0F1E":"\u0F1D\u0F1D","\u24B8":"\xA9","\u24C7":"\xAE","\u24C5":"\u2117","\u{1D21B}":"\u2144","\u2BEC":"\u219E","\u2BED":"\u219F","\u2BEE":"\u21A0","\u2BEF":"\u21A1","\u21B5":"\u21B2","\u2965":"\u21C3\u21C2","\u296F":"\u21C3\u16DA","\u{1D6DB}":"\u2202","\u{1D715}":"\u2202","\u{1D74F}":"\u2202","\u{1D789}":"\u2202","\u{1D7C3}":"\u2202","\u{1E8CC}":"\u2202","\u{1E8CD}":"\u2202\u0335",\u00F0:"\u2202\u0335","\u2300":"\u2205","\u{1D6C1}":"\u2207","\u{1D6FB}":"\u2207","\u{1D735}":"\u2207","\u{1D76F}":"\u2207","\u{1D7A9}":"\u2207","\u{118A8}":"\u2207","\u2362":"\u2207\u0308","\u236B":"\u2207\u0334","\u2588":"\u220E","\u25A0":"\u220E","\u2A3F":"\u2210","\u16ED":"+","\u2795":"+","\u{1029B}":"+","\u2A23":"+\u0302","\u2A22":"+\u030A","\u2A24":"+\u0303","\u2214":"+\u0307","\u2A25":"+\u0323","\u2A26":"+\u0330","\u2A27":"+\u2082","\u2797":"\xF7","\u2039":"<","\u276E":"<","\u02C2":"<","\u{1D236}":"<",\u1438:"<",\u16B2:"<","\u22D6":"<\xB7","\u2CB4":"<\xB7",\u1445:"<\xB7","\u226A":"<<","\u22D8":"<<<","\u1400":"=","\u2E40":"=","\u30A0":"=","\uA4FF":"=","\u225A":"=\u0306","\u2259":"=\u0302","\u2257":"=\u030A","\u2250":"=\u0307","\u2251":"=\u0307\u0323","\u2A6E":"=\u20F0","\u2A75":"==","\u2A76":"===","\u225E":"=\u036B","\u203A":">","\u276F":">","\u02C3":">","\u{1D237}":">",\u1433:">","\u{16F3F}":">",\u1441:">\xB7","\u2AA5":"><","\u226B":">>","\u2A20":">>","\u22D9":">>>","\u2053":"~","\u02DC":"~","\u1FC0":"~","\u223C":"~","\u2368":"~\u0308","\u2E1E":"~\u0307","\u2A6A":"~\u0307","\u2E1F":"~\u0323","\u{1E8C8}":"\u2220","\u22C0":"\u2227","\u222F":"\u222E\u222E","\u2230":"\u222E\u222E\u222E","\u2E2B":"\u2234","\u2E2A":"\u2235","\u2E2C":"\u2237","\u{111DE}":"\u2248","\u264E":"\u224F","\u{1F75E}":"\u224F","\u2263":"\u2261","\u2A03":"\u228D","\u2A04":"\u228E","\u{1D238}":"\u228F","\u{1D239}":"\u2290","\u2A05":"\u2293","\u2A06":"\u2294","\u2A02":"\u2297","\u235F":"\u229B","\u{1F771}":"\u22A0","\u{1F755}":"\u22A1","\u25C1":"\u22B2","\u25B7":"\u22B3","\u2363":"\u22C6\u0308","\uFE34":"\u2307","\u25E0":"\u2312","\u2A3D":"\u2319","\u2325":"\u2324","\u29C7":"\u233B","\u25CE":"\u233E","\u29BE":"\u233E","\u29C5":"\u2342","\u29B0":"\u2349","\u23C3":"\u234B","\u23C2":"\u234E","\u23C1":"\u2355","\u23C6":"\u236D","\u2638":"\u2388","\uFE35":"\u23DC","\uFE36":"\u23DD","\uFE37":"\u23DE","\uFE38":"\u23DF","\uFE39":"\u23E0","\uFE3A":"\u23E1","\u25B1":"\u23E5","\u23FC":"\u23FB","\uFE31":"\u2502","\uFF5C":"\u2502","\u2503":"\u2502","\u250F":"\u250C","\u2523":"\u251C","\u2590":"\u258C","\u2597":"\u2596","\u259D":"\u2598","\u2610":"\u25A1","\uFFED":"\u25AA","\u25B8":"\u25B6","\u25BA":"\u25B6","\u2CE9":"\u2627","\u{1F70A}":"\u2629","\u{1F312}":"\u263D","\u{1F319}":"\u263D","\u23FE":"\u263E","\u{1F318}":"\u263E","\u29D9":"\u299A","\u{1F73A}":"\u29DF","\u2A3E":"\u2A1F","\u{101A0}":"\u2CE8","\u2669":"\u{1D158}\u{1D165}","\u266A":"\u{1D158}\u{1D165}\u{1D16E}","\u24EA":"\u{1F10D}","\u21BA":"\u{1F10E}","\u02D9":"\u0971","\u0D4E":"\u0971","\uFF0D":"\u30FC","\u2014":"\u30FC","\u2015":"\u30FC","\u2500":"\u30FC","\u2501":"\u30FC","\u31D0":"\u30FC","\uA7F7":"\u30FC",\u1173:"\u30FC",\u3161:"\u30FC",\u4E00:"\u30FC","\u2F00":"\u30FC",\u1196:"\u30FC\u30FC","\uD7B9":"\u30FC\u1161","\uD7BA":"\u30FC\u1165","\uD7BB":"\u30FC\u1165\u4E28","\uD7BC":"\u30FC\u1169",\u1195:"\u30FC\u116E",\u1174:"\u30FC\u4E28",\u3162:"\u30FC\u4E28",\u1197:"\u30FC\u4E28\u116E","\u{1F10F}":"$\u20E0","\u20A4":"\xA3","\u3012":"\u20B8","\u3036":"\u20B8","\u1B5C":"\u1B50","\uA9C6":"\uA9D0","\u{114D1}":"\u09E7","\u0CE7":"\u0C67","\u1065":"\u1041","\u2460":"\u2780","\u2469":"\u2789","\u23E8":"\u2081\u2080","\u{1D7D0}":"2","\u{1D7DA}":"2","\u{1D7E4}":"2","\u{1D7EE}":"2","\u{1D7F8}":"2","\u{1FBF2}":"2","\uA75A":"2",\u01A7:"2",\u03E8:"2","\uA644":"2",\u14BF:"2","\uA6EF":"2","\uA9CF":"\u0662","\u06F2":"\u0662","\u0AE8":"\u0968","\u{114D2}":"\u09E8","\u0CE8":"\u0C68","\u2461":"\u2781",\u01BB:"2\u0335","\u{1F103}":"2,","\u2489":"2.","\u33F5":"22\u65E5","\u336E":"22\u70B9","\u33F6":"23\u65E5","\u336F":"23\u70B9","\u33F7":"24\u65E5","\u3370":"24\u70B9","\u33F8":"25\u65E5","\u33F9":"26\u65E5","\u33FA":"27\u65E5","\u33FB":"28\u65E5","\u33FC":"29\u65E5","\u33F4":"2l\u65E5","\u336D":"2l\u70B9","\u249B":"2O.","\u33F3":"2O\u65E5","\u336C":"2O\u70B9","\u0DE9":"\u0DE8\u0DCF","\u0DEF":"\u0DE8\u0DD3","\u33E1":"2\u65E5","\u32C1":"2\u6708","\u335A":"2\u70B9","\u{1D206}":"3","\u{1D7D1}":"3","\u{1D7DB}":"3","\u{1D7E5}":"3","\u{1D7EF}":"3","\u{1D7F9}":"3","\u{1FBF3}":"3","\uA7AB":"3",\u021C:"3",\u01B7:"3","\uA76A":"3","\u2CCC":"3",\u0417:"3",\u04E0:"3","\u{16F3B}":"3","\u{118CA}":"3","\u06F3":"\u0663","\u{1E8C9}":"\u0663","\u0AE9":"\u0969","\u2462":"\u2782",\u0498:"3\u0326","\u{1F104}":"3,","\u248A":"3.","\u33FE":"3l\u65E5","\u33FD":"3O\u65E5","\u33E2":"3\u65E5","\u32C2":"3\u6708","\u335B":"3\u70B9","\u{1D7D2}":"4","\u{1D7DC}":"4","\u{1D7E6}":"4","\u{1D7F0}":"4","\u{1D7FA}":"4","\u{1FBF4}":"4",\u13CE:"4","\u{118AF}":"4","\u06F4":"\u0664","\u0AEA":"\u096A","\u2463":"\u2783","\u{1F105}":"4,","\u248B":"4.",\u1530:"4\xB7","\u33E3":"4\u65E5","\u32C3":"4\u6708","\u335C":"4\u70B9","\u{1D7D3}":"5","\u{1D7DD}":"5","\u{1D7E7}":"5","\u{1D7F1}":"5","\u{1D7FB}":"5","\u{1FBF5}":"5",\u01BC:"5","\u{118BB}":"5","\u2464":"\u2784","\u{1F106}":"5,","\u248C":"5.","\u33E4":"5\u65E5","\u32C4":"5\u6708","\u335D":"5\u70B9","\u{1D7D4}":"6","\u{1D7DE}":"6","\u{1D7E8}":"6","\u{1D7F2}":"6","\u{1D7FC}":"6","\u{1FBF6}":"6","\u2CD2":"6",\u0431:"6",\u13EE:"6","\u{118D5}":"6","\u06F6":"\u0666","\u{114D6}":"\u09EC","\u2465":"\u2785","\u{1F107}":"6,","\u248D":"6.","\u33E5":"6\u65E5","\u32C5":"6\u6708","\u335E":"6\u70B9","\u{1D212}":"7","\u{1D7D5}":"7","\u{1D7DF}":"7","\u{1D7E9}":"7","\u{1D7F3}":"7","\u{1D7FD}":"7","\u{1FBF7}":"7","\u{104D2}":"7","\u{118C6}":"7","\u2466":"\u2786","\u{1F108}":"7,","\u248E":"7.","\u33E6":"7\u65E5","\u32C6":"7\u6708","\u335F":"7\u70B9","\u0B03":"8","\u09EA":"8","\u0A6A":"8","\u{1E8CB}":"8","\u{1D7D6}":"8","\u{1D7E0}":"8","\u{1D7EA}":"8","\u{1D7F4}":"8","\u{1D7FE}":"8","\u{1FBF8}":"8",\u0223:"8",\u0222:"8","\u{1031A}":"8","\u0AEE":"\u096E","\u2467":"\u2787","\u{1F109}":"8,","\u248F":"8.","\u33E7":"8\u65E5","\u32C7":"8\u6708","\u3360":"8\u70B9","\u0A67":"9","\u0B68":"9","\u09ED":"9","\u0D6D":"9","\u{1D7D7}":"9","\u{1D7E1}":"9","\u{1D7EB}":"9","\u{1D7F5}":"9","\u{1D7FF}":"9","\u{1FBF9}":"9","\uA76E":"9","\u2CCA":"9","\u{118CC}":"9","\u{118AC}":"9","\u{118D6}":"9","\u0967":"\u0669","\u{118E4}":"\u0669","\u06F9":"\u0669","\u0CEF":"\u0C6F","\u2468":"\u2788","\u{1F10A}":"9,","\u2490":"9.","\u33E8":"9\u65E5","\u32C8":"9\u6708","\u3361":"9\u70B9","\u237A":"a",\uFF41:"a","\u{1D41A}":"a","\u{1D44E}":"a","\u{1D482}":"a","\u{1D4B6}":"a","\u{1D4EA}":"a","\u{1D51E}":"a","\u{1D552}":"a","\u{1D586}":"a","\u{1D5BA}":"a","\u{1D5EE}":"a","\u{1D622}":"a","\u{1D656}":"a","\u{1D68A}":"a",\u0251:"a",\u03B1:"a","\u{1D6C2}":"a","\u{1D6FC}":"a","\u{1D736}":"a","\u{1D770}":"a","\u{1D7AA}":"a",\u0430:"a","\u2DF6":"\u0363",\uFF21:"A","\u{1D400}":"A","\u{1D434}":"A","\u{1D468}":"A","\u{1D49C}":"A","\u{1D4D0}":"A","\u{1D504}":"A","\u{1D538}":"A","\u{1D56C}":"A","\u{1D5A0}":"A","\u{1D5D4}":"A","\u{1D608}":"A","\u{1D63C}":"A","\u{1D670}":"A",\u0391:"A","\u{1D6A8}":"A","\u{1D6E2}":"A","\u{1D71C}":"A","\u{1D756}":"A","\u{1D790}":"A",\u0410:"A",\u13AA:"A",\u15C5:"A","\uA4EE":"A","\u{16F40}":"A","\u{102A0}":"A","\u2376":"a\u0332",\u01CE:"\u0103",\u01CD:"\u0102",\u0227:"\xE5",\u0226:"\xC5",\u1E9A:"\u1EA3","\u2100":"a/c","\u2101":"a/s","\uA733":"aa","\uA732":"AA",\u00E6:"ae",\u04D5:"ae",\u00C6:"AE",\u04D4:"AE","\uA735":"ao","\uA734":"AO","\u{1F707}":"AR","\uA737":"au","\uA736":"AU","\uA739":"av","\uA73B":"av","\uA738":"AV","\uA73A":"AV","\uA73D":"ay","\uA73C":"AY","\uAB7A":"\u1D00","\u2200":"\u2C6F","\u{1D217}":"\u2C6F",\u15C4:"\u2C6F","\uA4EF":"\u2C6F","\u{1041F}":"\u2C70","\u{1D41B}":"b","\u{1D44F}":"b","\u{1D483}":"b","\u{1D4B7}":"b","\u{1D4EB}":"b","\u{1D51F}":"b","\u{1D553}":"b","\u{1D587}":"b","\u{1D5BB}":"b","\u{1D5EF}":"b","\u{1D623}":"b","\u{1D657}":"b","\u{1D68B}":"b",\u0184:"b",\u042C:"b",\u13CF:"b",\u1472:"b",\u15AF:"b",\uFF22:"B",\u212C:"B","\u{1D401}":"B","\u{1D435}":"B","\u{1D469}":"B","\u{1D4D1}":"B","\u{1D505}":"B","\u{1D539}":"B","\u{1D56D}":"B","\u{1D5A1}":"B","\u{1D5D5}":"B","\u{1D609}":"B","\u{1D63D}":"B","\u{1D671}":"B","\uA7B4":"B",\u0392:"B","\u{1D6A9}":"B","\u{1D6E3}":"B","\u{1D71D}":"B","\u{1D757}":"B","\u{1D791}":"B",\u0412:"B",\u13F4:"B",\u15F7:"B","\uA4D0":"B","\u{10282}":"B","\u{102A1}":"B","\u{10301}":"B",\u0253:"b\u0314",\u1473:"b\u0307",\u0183:"b\u0304",\u0182:"b\u0304",\u0411:"b\u0304",\u0180:"b\u0335",\u048D:"b\u0335",\u048C:"b\u0335",\u0463:"b\u0335",\u0462:"b\u0335",\u147F:"b\xB7",\u1481:"b\u0307\xB7",\u1488:"b'",\u042B:"bl",\u0432:"\u0299","\u13FC":"\u0299",\uFF43:"c","\u217D":"c","\u{1D41C}":"c","\u{1D450}":"c","\u{1D484}":"c","\u{1D4B8}":"c","\u{1D4EC}":"c","\u{1D520}":"c","\u{1D554}":"c","\u{1D588}":"c","\u{1D5BC}":"c","\u{1D5F0}":"c","\u{1D624}":"c","\u{1D658}":"c","\u{1D68C}":"c","\u1D04":"c",\u03F2:"c","\u2CA5":"c",\u0441:"c","\uABAF":"c","\u{1043D}":"c","\u2DED":"\u0368","\u{1F74C}":"C","\u{118F2}":"C","\u{118E9}":"C",\uFF23:"C","\u216D":"C",\u2102:"C",\u212D:"C","\u{1D402}":"C","\u{1D436}":"C","\u{1D46A}":"C","\u{1D49E}":"C","\u{1D4D2}":"C","\u{1D56E}":"C","\u{1D5A2}":"C","\u{1D5D6}":"C","\u{1D60A}":"C","\u{1D63E}":"C","\u{1D672}":"C","\u03F9":"C","\u2CA4":"C",\u0421:"C",\u13DF:"C","\uA4DA":"C","\u{102A2}":"C","\u{10302}":"C","\u{10415}":"C","\u{1051C}":"C","\xA2":"c\u0338","\u023C":"c\u0338","\u20A1":"C\u20EB","\u{1F16E}":"C\u20E0",\u00E7:"c\u0326",\u04AB:"c\u0326",\u00C7:"C\u0326",\u04AA:"C\u0326",\u0187:"C'","\u2105":"c/o","\u2106":"c/u","\u{1F16D}":"\u33C4 \u20DD","\u22F4":"\uA793",\u025B:"\uA793",\u03B5:"\uA793","\u03F5":"\uA793","\u{1D6C6}":"\uA793","\u{1D6DC}":"\uA793","\u{1D700}":"\uA793","\u{1D716}":"\uA793","\u{1D73A}":"\uA793","\u{1D750}":"\uA793","\u{1D774}":"\uA793","\u{1D78A}":"\uA793","\u{1D7AE}":"\uA793","\u{1D7C4}":"\uA793","\u2C89":"\uA793",\u0454:"\uA793","\u0511":"\uA793","\uAB9B":"\uA793","\u{118CE}":"\uA793","\u{10429}":"\uA793","\u20AC":"\uA792","\u2C88":"\uA792",\u0404:"\uA792","\u2377":"\uA793\u0332","\u037D":"\uA73F","\u03FF":"\uA73E","\u217E":"d","\u2146":"d","\u{1D41D}":"d","\u{1D451}":"d","\u{1D485}":"d","\u{1D4B9}":"d","\u{1D4ED}":"d","\u{1D521}":"d","\u{1D555}":"d","\u{1D589}":"d","\u{1D5BD}":"d","\u{1D5F1}":"d","\u{1D625}":"d","\u{1D659}":"d","\u{1D68D}":"d","\u0501":"d",\u13E7:"d",\u146F:"d","\uA4D2":"d","\u216E":"D","\u2145":"D","\u{1D403}":"D","\u{1D437}":"D","\u{1D46B}":"D","\u{1D49F}":"D","\u{1D4D3}":"D","\u{1D507}":"D","\u{1D53B}":"D","\u{1D56F}":"D","\u{1D5A3}":"D","\u{1D5D7}":"D","\u{1D60B}":"D","\u{1D63F}":"D","\u{1D673}":"D",\u13A0:"D",\u15DE:"D",\u15EA:"D","\uA4D3":"D",\u0257:"d\u0314",\u0256:"d\u0328",\u018C:"d\u0304",\u0111:"d\u0335",\u0110:"D\u0335",\u00D0:"D\u0335",\u0189:"D\u0335","\u20AB":"d\u0335\u0331","\uA77A":"\uA779",\u147B:"d\xB7",\u1487:"d'",\u02A4:"d\u021D",\u01F3:"dz",\u02A3:"dz",\u01F2:"Dz",\u01F1:"DZ",\u01C6:"d\u017E",\u01C5:"D\u017E",\u01C4:"D\u017D",\u02A5:"d\u0291","\uAB70":"\u1D05","\u2E39":"\u1E9F",\u03B4:"\u1E9F","\u{1D6C5}":"\u1E9F","\u{1D6FF}":"\u1E9F","\u{1D739}":"\u1E9F","\u{1D773}":"\u1E9F","\u{1D7AD}":"\u1E9F",\u056E:"\u1E9F",\u1577:"\u1E9F","\u212E":"e",\uFF45:"e",\u212F:"e","\u2147":"e","\u{1D41E}":"e","\u{1D452}":"e","\u{1D486}":"e","\u{1D4EE}":"e","\u{1D522}":"e","\u{1D556}":"e","\u{1D58A}":"e","\u{1D5BE}":"e","\u{1D5F2}":"e","\u{1D626}":"e","\u{1D65A}":"e","\u{1D68E}":"e","\uAB32":"e",\u0435:"e",\u04BD:"e","\u2DF7":"\u0364","\u22FF":"E",\uFF25:"E",\u2130:"E","\u{1D404}":"E","\u{1D438}":"E","\u{1D46C}":"E","\u{1D4D4}":"E","\u{1D508}":"E","\u{1D53C}":"E","\u{1D570}":"E","\u{1D5A4}":"E","\u{1D5D8}":"E","\u{1D60C}":"E","\u{1D640}":"E","\u{1D674}":"E",\u0395:"E","\u{1D6AC}":"E","\u{1D6E6}":"E","\u{1D720}":"E","\u{1D75A}":"E","\u{1D794}":"E",\u0415:"E","\u2D39":"E",\u13AC:"E","\uA4F0":"E","\u{118A6}":"E","\u{118AE}":"E","\u{10286}":"E",\u011B:"\u0115",\u011A:"\u0114","\u0247":"e\u0338","\u0246":"E\u0338",\u04BF:"e\u0328","\uAB7C":"\u1D07",\u0259:"\u01DD",\u04D9:"\u01DD","\u2203":"\u018E","\u2D3A":"\u018E","\uA4F1":"\u018E",\u025A:"\u01DD\u02DE","\u1D14":"\u01DDo","\uAB41":"\u01DDo\u0338","\uAB42":"\u01DDo\u0335",\u04D8:"\u018F","\u{1D221}":"\u0190",\u2107:"\u0190","\u0510":"\u0190",\u13CB:"\u0190","\u{16F2D}":"\u0190","\u{10401}":"\u0190","\u1D9F":"\u1D4B","\u1D08":"\u025C",\u0437:"\u025C",\u0499:"\u025C\u0326","\u{10442}":"\u025E","\uA79D":"\u029A","\u{1042A}":"\u029A","\u{1D41F}":"f","\u{1D453}":"f","\u{1D487}":"f","\u{1D4BB}":"f","\u{1D4EF}":"f","\u{1D523}":"f","\u{1D557}":"f","\u{1D58B}":"f","\u{1D5BF}":"f","\u{1D5F3}":"f","\u{1D627}":"f","\u{1D65B}":"f","\u{1D68F}":"f","\uAB35":"f","\uA799":"f",\u017F:"f","\u1E9D":"f",\u0584:"f","\u{1D213}":"F",\u2131:"F","\u{1D405}":"F","\u{1D439}":"F","\u{1D46D}":"F","\u{1D4D5}":"F","\u{1D509}":"F","\u{1D53D}":"F","\u{1D571}":"F","\u{1D5A5}":"F","\u{1D5D9}":"F","\u{1D60D}":"F","\u{1D641}":"F","\u{1D675}":"F","\uA798":"F",\u03DC:"F","\u{1D7CA}":"F",\u15B4:"F","\uA4DD":"F","\u{118C2}":"F","\u{118A2}":"F","\u{10287}":"F","\u{102A5}":"F","\u{10525}":"F",\u0192:"f\u0326",\u0191:"F\u0326","\u1D6E":"f\u0334","\u213B":"FAX",\uFB00:"ff",\uFB03:"ffi",\uFB04:"ffl",\uFB01:"fi",\uFB02:"fl",\u02A9:"f\u014B",\u15B5:"\u2132","\uA4DE":"\u2132","\u{1D230}":"\uA7FB",\u15B7:"\uA7FB",\uFF47:"g",\u210A:"g","\u{1D420}":"g","\u{1D454}":"g","\u{1D488}":"g","\u{1D4F0}":"g","\u{1D524}":"g","\u{1D558}":"g","\u{1D58C}":"g","\u{1D5C0}":"g","\u{1D5F4}":"g","\u{1D628}":"g","\u{1D65C}":"g","\u{1D690}":"g",\u0261:"g","\u1D83":"g",\u018D:"g",\u0581:"g","\u{1D406}":"G","\u{1D43A}":"G","\u{1D46E}":"G","\u{1D4A2}":"G","\u{1D4D6}":"G","\u{1D50A}":"G","\u{1D53E}":"G","\u{1D572}":"G","\u{1D5A6}":"G","\u{1D5DA}":"G","\u{1D60E}":"G","\u{1D642}":"G","\u{1D676}":"G","\u050C":"G",\u13C0:"G",\u13F3:"G","\uA4D6":"G","\u1DA2":"\u1D4D",\u0260:"g\u0314",\u01E7:"\u011F",\u01E6:"\u011E",\u01F5:"\u0123",\u01E5:"g\u0335",\u01E4:"G\u0335",\u0193:"G'","\u050D":"\u0262","\uAB90":"\u0262","\u13FB":"\u0262",\uFF48:"h",\u210E:"h","\u{1D421}":"h","\u{1D489}":"h","\u{1D4BD}":"h","\u{1D4F1}":"h","\u{1D525}":"h","\u{1D559}":"h","\u{1D58D}":"h","\u{1D5C1}":"h","\u{1D5F5}":"h","\u{1D629}":"h","\u{1D65D}":"h","\u{1D691}":"h",\u04BB:"h",\u0570:"h",\u13C2:"h",\uFF28:"H",\u210B:"H",\u210C:"H",\u210D:"H","\u{1D407}":"H","\u{1D43B}":"H","\u{1D46F}":"H","\u{1D4D7}":"H","\u{1D573}":"H","\u{1D5A7}":"H","\u{1D5DB}":"H","\u{1D60F}":"H","\u{1D643}":"H","\u{1D677}":"H",\u0397:"H","\u{1D6AE}":"H","\u{1D6E8}":"H","\u{1D722}":"H","\u{1D75C}":"H","\u{1D796}":"H","\u2C8E":"H",\u041D:"H",\u13BB:"H",\u157C:"H","\uA4E7":"H","\u{102CF}":"H","\u1D78":"\u1D34",\u0266:"h\u0314","\uA695":"h\u0314",\u13F2:"h\u0314","\u2C67":"H\u0329",\u04A2:"H\u0329",\u0127:"h\u0335",\u210F:"h\u0335",\u045B:"h\u0335",\u0126:"H\u0335","\u04C9":"H\u0326",\u04C7:"H\u0326",\u043D:"\u029C","\uAB8B":"\u029C",\u04A3:"\u029C\u0329","\u04CA":"\u029C\u0326",\u04C8:"\u029C\u0326","\u050A":"\u01F6","\uAB80":"\u2C76","\u0370":"\u2C75",\u13A8:"\u2C75",\u13B0:"\u2C75","\uA6B1":"\u2C75","\uA795":"\uA727","\u02DB":"i","\u2373":"i",\uFF49:"i","\u2170":"i",\u2139:"i","\u2148":"i","\u{1D422}":"i","\u{1D456}":"i","\u{1D48A}":"i","\u{1D4BE}":"i","\u{1D4F2}":"i","\u{1D526}":"i","\u{1D55A}":"i","\u{1D58E}":"i","\u{1D5C2}":"i","\u{1D5F6}":"i","\u{1D62A}":"i","\u{1D65E}":"i","\u{1D692}":"i",\u0131:"i","\u{1D6A4}":"i",\u026A:"i",\u0269:"i",\u03B9:"i",\u1FBE:"i",\u037A:"i","\u{1D6CA}":"i","\u{1D704}":"i","\u{1D73E}":"i","\u{1D778}":"i","\u{1D7B2}":"i",\u0456:"i","\uA647":"i","\u04CF":"i","\uAB75":"i",\u13A5:"i","\u{118C3}":"i","\u24DB":"\u24BE","\u2378":"i\u0332",\u01D0:"\u012D",\u01CF:"\u012C",\u0268:"i\u0335","\u1D7B":"i\u0335","\u1D7C":"i\u0335","\u2171":"ii","\u2172":"iii",\u0133:"ij","\u2173":"iv","\u2178":"ix",\uFF4A:"j","\u2149":"j","\u{1D423}":"j","\u{1D457}":"j","\u{1D48B}":"j","\u{1D4BF}":"j","\u{1D4F3}":"j","\u{1D527}":"j","\u{1D55B}":"j","\u{1D58F}":"j","\u{1D5C3}":"j","\u{1D5F7}":"j","\u{1D62B}":"j","\u{1D65F}":"j","\u{1D693}":"j",\u03F3:"j",\u0458:"j",\uFF2A:"J","\u{1D409}":"J","\u{1D43D}":"J","\u{1D471}":"J","\u{1D4A5}":"J","\u{1D4D9}":"J","\u{1D50D}":"J","\u{1D541}":"J","\u{1D575}":"J","\u{1D5A9}":"J","\u{1D5DD}":"J","\u{1D611}":"J","\u{1D645}":"J","\u{1D679}":"J","\uA7B2":"J","\u037F":"J",\u0408:"J",\u13AB:"J",\u148D:"J","\uA4D9":"J","\u0249":"j\u0335","\u0248":"J\u0335",\u1499:"J\xB7","\u{1D6A5}":"\u0237",\u0575:"\u0237","\uAB7B":"\u1D0A","\u{1D424}":"k","\u{1D458}":"k","\u{1D48C}":"k","\u{1D4C0}":"k","\u{1D4F4}":"k","\u{1D528}":"k","\u{1D55C}":"k","\u{1D590}":"k","\u{1D5C4}":"k","\u{1D5F8}":"k","\u{1D62C}":"k","\u{1D660}":"k","\u{1D694}":"k",\u212A:"K",\uFF2B:"K","\u{1D40A}":"K","\u{1D43E}":"K","\u{1D472}":"K","\u{1D4A6}":"K","\u{1D4DA}":"K","\u{1D50E}":"K","\u{1D542}":"K","\u{1D576}":"K","\u{1D5AA}":"K","\u{1D5DE}":"K","\u{1D612}":"K","\u{1D646}":"K","\u{1D67A}":"K",\u039A:"K","\u{1D6B1}":"K","\u{1D6EB}":"K","\u{1D725}":"K","\u{1D75F}":"K","\u{1D799}":"K","\u2C94":"K",\u041A:"K",\u13E6:"K",\u16D5:"K","\uA4D7":"K","\u{10518}":"K",\u0199:"k\u0314","\u2C69":"K\u0329",\u049A:"K\u0329","\u20AD":"K\u0335","\uA740":"K\u0335",\u049E:"K\u0335",\u0198:"K'","\u05C0":"l","|":"l","\u2223":"l","\u23FD":"l","\uFFE8":"l","\u0661":"l","\u06F1":"l","\u{10320}":"l","\u{1E8C7}":"l","\u{1D7CF}":"l","\u{1D7D9}":"l","\u{1D7E3}":"l","\u{1D7ED}":"l","\u{1D7F7}":"l","\u{1FBF1}":"l",I:"l",\uFF29:"l","\u2160":"l",\u2110:"l",\u2111:"l","\u{1D408}":"l","\u{1D43C}":"l","\u{1D470}":"l","\u{1D4D8}":"l","\u{1D540}":"l","\u{1D574}":"l","\u{1D5A8}":"l","\u{1D5DC}":"l","\u{1D610}":"l","\u{1D644}":"l","\u{1D678}":"l",\u0196:"l",\uFF4C:"l","\u217C":"l",\u2113:"l","\u{1D425}":"l","\u{1D459}":"l","\u{1D48D}":"l","\u{1D4C1}":"l","\u{1D4F5}":"l","\u{1D529}":"l","\u{1D55D}":"l","\u{1D591}":"l","\u{1D5C5}":"l","\u{1D5F9}":"l","\u{1D62D}":"l","\u{1D661}":"l","\u{1D695}":"l",\u01C0:"l",\u0399:"l","\u{1D6B0}":"l","\u{1D6EA}":"l","\u{1D724}":"l","\u{1D75E}":"l","\u{1D798}":"l","\u2C92":"l",\u0406:"l",\u04C0:"l",\u05D5:"l",\u05DF:"l",\u0627:"l","\u{1EE00}":"l","\u{1EE80}":"l",\uFE8E:"l",\uFE8D:"l","\u07CA":"l","\u2D4F":"l",\u16C1:"l","\uA4F2":"l","\u{16F28}":"l","\u{1028A}":"l","\u{10309}":"l","\u{1D22A}":"L","\u216C":"L",\u2112:"L","\u{1D40B}":"L","\u{1D43F}":"L","\u{1D473}":"L","\u{1D4DB}":"L","\u{1D50F}":"L","\u{1D543}":"L","\u{1D577}":"L","\u{1D5AB}":"L","\u{1D5DF}":"L","\u{1D613}":"L","\u{1D647}":"L","\u{1D67B}":"L","\u2CD0":"L",\u13DE:"L",\u14AA:"L","\uA4E1":"L","\u{16F16}":"L","\u{118A3}":"L","\u{118B2}":"L","\u{1041B}":"L","\u{10526}":"L",\uFD3C:"l\u030B",\uFD3D:"l\u030B",\u0142:"l\u0338",\u0141:"L\u0338",\u026D:"l\u0328",\u0197:"l\u0335",\u019A:"l\u0335",\u026B:"l\u0334",\u0625:"l\u0655",\uFE88:"l\u0655",\uFE87:"l\u0655",\u0673:"l\u0655",\u0140:"l\xB7",\u013F:"l\xB7",\u14B7:"l\xB7","\u{1F102}":"l,","\u2488":"l.",\u05F1:"l'","\u2493":"l2.","\u33EB":"l2\u65E5","\u32CB":"l2\u6708","\u3364":"l2\u70B9","\u2494":"l3.","\u33EC":"l3\u65E5","\u3365":"l3\u70B9","\u2495":"l4.","\u33ED":"l4\u65E5","\u3366":"l4\u70B9","\u2496":"l5.","\u33EE":"l5\u65E5","\u3367":"l5\u70B9","\u2497":"l6.","\u33EF":"l6\u65E5","\u3368":"l6\u70B9","\u2498":"l7.","\u33F0":"l7\u65E5","\u3369":"l7\u70B9","\u2499":"l8.","\u33F1":"l8\u65E5","\u336A":"l8\u70B9","\u249A":"l9.","\u33F2":"l9\u65E5","\u336B":"l9\u70B9",\u01C9:"lj",\u0132:"lJ",\u01C8:"Lj",\u01C7:"LJ","\u2016":"ll","\u2225":"ll","\u2161":"ll",\u01C1:"ll",\u05F0:"ll","\u{10199}":"l\u0335l\u0335","\u2492":"ll.","\u2162":"lll","\u{10198}":"l\u0335l\u0335S\u0335","\u33EA":"ll\u65E5","\u32CA":"ll\u6708","\u3363":"ll\u70B9",\u042E:"lO","\u2491":"lO.","\u33E9":"lO\u65E5","\u32C9":"lO\u6708","\u3362":"lO\u70B9",\u02AA:"ls","\u20B6":"lt","\u2163":"lV","\u2168":"lX",\u026E:"l\u021D",\u02AB:"lz",\u0623:"l\u0674",\uFE84:"l\u0674",\uFE83:"l\u0674",\u0672:"l\u0674",\u0675:"l\u0674",\uFDF3:"l\u0643\u0628\u0631",\uFDF2:"l\u0644\u0644\u0651\u0670o","\u33E0":"l\u65E5","\u32C0":"l\u6708","\u3359":"l\u70B9","\u2CD1":"\u029F","\uABAE":"\u029F","\u{10443}":"\u029F",\uFF2D:"M","\u216F":"M",\u2133:"M","\u{1D40C}":"M","\u{1D440}":"M","\u{1D474}":"M","\u{1D4DC}":"M","\u{1D510}":"M","\u{1D544}":"M","\u{1D578}":"M","\u{1D5AC}":"M","\u{1D5E0}":"M","\u{1D614}":"M","\u{1D648}":"M","\u{1D67C}":"M",\u039C:"M","\u{1D6B3}":"M","\u{1D6ED}":"M","\u{1D727}":"M","\u{1D761}":"M","\u{1D79B}":"M","\u03FA":"M","\u2C98":"M",\u041C:"M",\u13B7:"M",\u15F0:"M",\u16D6:"M","\uA4DF":"M","\u{102B0}":"M","\u{10311}":"M","\u04CD":"M\u0326","\u{1F76B}":"MB","\u2DE8":"\u1DDF","\u{1D427}":"n","\u{1D45B}":"n","\u{1D48F}":"n","\u{1D4C3}":"n","\u{1D4F7}":"n","\u{1D52B}":"n","\u{1D55F}":"n","\u{1D593}":"n","\u{1D5C7}":"n","\u{1D5FB}":"n","\u{1D62F}":"n","\u{1D663}":"n","\u{1D697}":"n",\u0578:"n",\u057C:"n",\uFF2E:"N",\u2115:"N","\u{1D40D}":"N","\u{1D441}":"N","\u{1D475}":"N","\u{1D4A9}":"N","\u{1D4DD}":"N","\u{1D511}":"N","\u{1D579}":"N","\u{1D5AD}":"N","\u{1D5E1}":"N","\u{1D615}":"N","\u{1D649}":"N","\u{1D67D}":"N",\u039D:"N","\u{1D6B4}":"N","\u{1D6EE}":"N","\u{1D728}":"N","\u{1D762}":"N","\u{1D79C}":"N","\u2C9A":"N","\uA4E0":"N","\u{10513}":"N","\u{1018E}":"N\u030A",\u0273:"n\u0328",\u019E:"n\u0329",\u03B7:"n\u0329","\u{1D6C8}":"n\u0329","\u{1D702}":"n\u0329","\u{1D73C}":"n\u0329","\u{1D776}":"n\u0329","\u{1D7B0}":"n\u0329",\u019D:"N\u0326","\u1D70":"n\u0334",\u01CC:"nj",\u01CB:"Nj",\u01CA:"NJ","\u2116":"No","\u0377":"\u1D0E",\u0438:"\u1D0E","\u{1044D}":"\u1D0E",\u0146:"\u0272","\u0C02":"o","\u0C82":"o","\u0D02":"o","\u0D82":"o","\u0966":"o","\u0A66":"o","\u0AE6":"o","\u0BE6":"o","\u0C66":"o","\u0CE6":"o","\u0D66":"o","\u0E50":"o","\u0ED0":"o","\u1040":"o","\u0665":"o","\u06F5":"o",\uFF4F:"o",\u2134:"o","\u{1D428}":"o","\u{1D45C}":"o","\u{1D490}":"o","\u{1D4F8}":"o","\u{1D52C}":"o","\u{1D560}":"o","\u{1D594}":"o","\u{1D5C8}":"o","\u{1D5FC}":"o","\u{1D630}":"o","\u{1D664}":"o","\u{1D698}":"o","\u1D0F":"o","\u1D11":"o","\uAB3D":"o",\u03BF:"o","\u{1D6D0}":"o","\u{1D70A}":"o","\u{1D744}":"o","\u{1D77E}":"o","\u{1D7B8}":"o",\u03C3:"o","\u{1D6D4}":"o","\u{1D70E}":"o","\u{1D748}":"o","\u{1D782}":"o","\u{1D7BC}":"o","\u2C9F":"o",\u043E:"o","\u10FF":"o",\u0585:"o",\u05E1:"o",\u0647:"o","\u{1EE24}":"o","\u{1EE64}":"o","\u{1EE84}":"o",\uFEEB:"o",\uFEEC:"o",\uFEEA:"o",\uFEE9:"o",\u06BE:"o",\uFBAC:"o",\uFBAD:"o",\uFBAB:"o",\uFBAA:"o",\u06C1:"o",\uFBA8:"o",\uFBA9:"o",\uFBA7:"o",\uFBA6:"o",\u06D5:"o",\u0D20:"o",\u101D:"o","\u{104EA}":"o","\u{118C8}":"o","\u{118D7}":"o","\u{1042C}":"o","\u07C0":"O","\u09E6":"O","\u0B66":"O","\u3007":"O","\u{114D0}":"O","\u{118E0}":"O","\u{1D7CE}":"O","\u{1D7D8}":"O","\u{1D7E2}":"O","\u{1D7EC}":"O","\u{1D7F6}":"O","\u{1FBF0}":"O",\uFF2F:"O","\u{1D40E}":"O","\u{1D442}":"O","\u{1D476}":"O","\u{1D4AA}":"O","\u{1D4DE}":"O","\u{1D512}":"O","\u{1D546}":"O","\u{1D57A}":"O","\u{1D5AE}":"O","\u{1D5E2}":"O","\u{1D616}":"O","\u{1D64A}":"O","\u{1D67E}":"O",\u039F:"O","\u{1D6B6}":"O","\u{1D6F0}":"O","\u{1D72A}":"O","\u{1D764}":"O","\u{1D79E}":"O","\u2C9E":"O",\u041E:"O",\u0555:"O","\u2D54":"O",\u12D0:"O",\u0B20:"O","\u{104C2}":"O","\uA4F3":"O","\u{118B5}":"O","\u{10292}":"O","\u{102AB}":"O","\u{10404}":"O","\u{10516}":"O","\u2070":"\xBA","\u1D52":"\xBA",\u01D2:"\u014F",\u01D1:"\u014E","\u06FF":"o\u0302",\u0150:"\xD6",\u00F8:"o\u0338","\uAB3E":"o\u0338",\u00D8:"O\u0338","\u2D41":"O\u0338",\u01FE:"O\u0338\u0301",\u0275:"o\u0335","\uA74B":"o\u0335",\u04E9:"o\u0335",\u0473:"o\u0335","\uAB8E":"o\u0335","\uABBB":"o\u0335","\u2296":"O\u0335","\u229D":"O\u0335","\u236C":"O\u0335","\u{1D21A}":"O\u0335","\u{1F714}":"O\u0335",\u019F:"O\u0335","\uA74A":"O\u0335",\u03B8:"O\u0335",\u03D1:"O\u0335","\u{1D6C9}":"O\u0335","\u{1D6DD}":"O\u0335","\u{1D703}":"O\u0335","\u{1D717}":"O\u0335","\u{1D73D}":"O\u0335","\u{1D751}":"O\u0335","\u{1D777}":"O\u0335","\u{1D78B}":"O\u0335","\u{1D7B1}":"O\u0335","\u{1D7C5}":"O\u0335",\u0398:"O\u0335","\u03F4":"O\u0335","\u{1D6AF}":"O\u0335","\u{1D6B9}":"O\u0335","\u{1D6E9}":"O\u0335","\u{1D6F3}":"O\u0335","\u{1D723}":"O\u0335","\u{1D72D}":"O\u0335","\u{1D75D}":"O\u0335","\u{1D767}":"O\u0335","\u{1D797}":"O\u0335","\u{1D7A1}":"O\u0335",\u04E8:"O\u0335",\u0472:"O\u0335","\u2D31":"O\u0335",\u13BE:"O\u0335",\u13EB:"O\u0335","\uAB74":"o\u031B",\uFCD9:"o\u0670","\u{1F101}":"O,","\u{1F100}":"O.",\u01A1:"o'",\u01A0:"O'",\u13A4:"O'","%":"\xBA/\u2080","\u066A":"\xBA/\u2080","\u2052":"\xBA/\u2080","\u2030":"\xBA/\u2080\u2080","\u0609":"\xBA/\u2080\u2080","\u2031":"\xBA/\u2080\u2080\u2080","\u060A":"\xBA/\u2080\u2080\u2080",\u0153:"oe",\u0152:"OE",\u0276:"o\u1D07","\u221E":"oo","\uA74F":"oo","\uA699":"oo","\uA74E":"OO","\uA698":"OO",\uFCD7:"o\u062C",\uFC51:"o\u062C",\uFCD8:"o\u0645",\uFC52:"o\u0645",\uFD93:"o\u0645\u062C",\uFD94:"o\u0645\u0645",\uFC53:"o\u0649",\uFC54:"o\u0649","\u0D5F":"o\u0D30o",\u1010:"o\u102C","\u3358":"O\u70B9","\u2184":"\u0254","\u1D10":"\u0254","\u037B":"\u0254","\u{1044B}":"\u0254","\u2183":"\u0186","\u03FD":"\u0186","\uA4DB":"\u0186","\u{10423}":"\u0186","\uAB3F":"\u0254\u0338","\uAB62":"\u0254e","\u{1043F}":"\u0277","\u2374":"p",\uFF50:"p","\u{1D429}":"p","\u{1D45D}":"p","\u{1D491}":"p","\u{1D4C5}":"p","\u{1D4F9}":"p","\u{1D52D}":"p","\u{1D561}":"p","\u{1D595}":"p","\u{1D5C9}":"p","\u{1D5FD}":"p","\u{1D631}":"p","\u{1D665}":"p","\u{1D699}":"p",\u03C1:"p",\u03F1:"p","\u{1D6D2}":"p","\u{1D6E0}":"p","\u{1D70C}":"p","\u{1D71A}":"p","\u{1D746}":"p","\u{1D754}":"p","\u{1D780}":"p","\u{1D78E}":"p","\u{1D7BA}":"p","\u{1D7C8}":"p","\u2CA3":"p",\u0440:"p",\uFF30:"P",\u2119:"P","\u{1D40F}":"P","\u{1D443}":"P","\u{1D477}":"P","\u{1D4AB}":"P","\u{1D4DF}":"P","\u{1D513}":"P","\u{1D57B}":"P","\u{1D5AF}":"P","\u{1D5E3}":"P","\u{1D617}":"P","\u{1D64B}":"P","\u{1D67F}":"P",\u03A1:"P","\u{1D6B8}":"P","\u{1D6F2}":"P","\u{1D72C}":"P","\u{1D766}":"P","\u{1D7A0}":"P","\u2CA2":"P",\u0420:"P",\u13E2:"P",\u146D:"P","\uA4D1":"P","\u{10295}":"P",\u01A5:"p\u0314","\u1D7D":"p\u0335",\u1477:"p\xB7",\u1486:"P'","\u1D29":"\u1D18","\uABB2":"\u1D18",\u03C6:"\u0278",\u03D5:"\u0278","\u{1D6D7}":"\u0278","\u{1D6DF}":"\u0278","\u{1D711}":"\u0278","\u{1D719}":"\u0278","\u{1D74B}":"\u0278","\u{1D753}":"\u0278","\u{1D785}":"\u0278","\u{1D78D}":"\u0278","\u{1D7BF}":"\u0278","\u{1D7C7}":"\u0278","\u2CAB":"\u0278",\u0444:"\u0278","\u{1D42A}":"q","\u{1D45E}":"q","\u{1D492}":"q","\u{1D4C6}":"q","\u{1D4FA}":"q","\u{1D52E}":"q","\u{1D562}":"q","\u{1D596}":"q","\u{1D5CA}":"q","\u{1D5FE}":"q","\u{1D632}":"q","\u{1D666}":"q","\u{1D69A}":"q","\u051B":"q",\u0563:"q",\u0566:"q",\u211A:"Q","\u{1D410}":"Q","\u{1D444}":"Q","\u{1D478}":"Q","\u{1D4AC}":"Q","\u{1D4E0}":"Q","\u{1D514}":"Q","\u{1D57C}":"Q","\u{1D5B0}":"Q","\u{1D5E4}":"Q","\u{1D618}":"Q","\u{1D64C}":"Q","\u{1D680}":"Q","\u2D55":"Q",\u02A0:"q\u0314","\u{1F700}":"QE","\u1D90":"\u024B","\u1D0B":"\u0138",\u03BA:"\u0138",\u03F0:"\u0138","\u{1D6CB}":"\u0138","\u{1D6DE}":"\u0138","\u{1D705}":"\u0138","\u{1D718}":"\u0138","\u{1D73F}":"\u0138","\u{1D752}":"\u0138","\u{1D779}":"\u0138","\u{1D78C}":"\u0138","\u{1D7B3}":"\u0138","\u{1D7C6}":"\u0138","\u2C95":"\u0138",\u043A:"\u0138","\uABB6":"\u0138",\u049B:"\u0138\u0329",\u049F:"\u0138\u0335","\u{1D42B}":"r","\u{1D45F}":"r","\u{1D493}":"r","\u{1D4C7}":"r","\u{1D4FB}":"r","\u{1D52F}":"r","\u{1D563}":"r","\u{1D597}":"r","\u{1D5CB}":"r","\u{1D5FF}":"r","\u{1D633}":"r","\u{1D667}":"r","\u{1D69B}":"r","\uAB47":"r","\uAB48":"r","\u1D26":"r","\u2C85":"r",\u0433:"r","\uAB81":"r","\u{1D216}":"R",\u211B:"R",\u211C:"R",\u211D:"R","\u{1D411}":"R","\u{1D445}":"R","\u{1D479}":"R","\u{1D4E1}":"R","\u{1D57D}":"R","\u{1D5B1}":"R","\u{1D5E5}":"R","\u{1D619}":"R","\u{1D64D}":"R","\u{1D681}":"R",\u01A6:"R",\u13A1:"R",\u13D2:"R","\u{104B4}":"R",\u1587:"R","\uA4E3":"R","\u{16F35}":"R",\u027D:"r\u0328",\u027C:"r\u0329","\u024D":"r\u0335",\u0493:"r\u0335","\u1D72":"r\u0334",\u0491:"r'","\u{118E3}":"rn",m:"rn","\u217F":"rn","\u{1D426}":"rn","\u{1D45A}":"rn","\u{1D48E}":"rn","\u{1D4C2}":"rn","\u{1D4F6}":"rn","\u{1D52A}":"rn","\u{1D55E}":"rn","\u{1D592}":"rn","\u{1D5C6}":"rn","\u{1D5FA}":"rn","\u{1D62E}":"rn","\u{1D662}":"rn","\u{1D696}":"rn","\u{11700}":"rn","\u20A5":"rn\u0338",\u0271:"rn\u0326","\u1D6F":"rn\u0334","\u20A8":"Rs","\uAB71":"\u0280","\uABA2":"\u0280",\u044F:"\u1D19","\u1D73":"\u027E\u0334","\u2129":"\u027F",\uFF53:"s","\u{1D42C}":"s","\u{1D460}":"s","\u{1D494}":"s","\u{1D4C8}":"s","\u{1D4FC}":"s","\u{1D530}":"s","\u{1D564}":"s","\u{1D598}":"s","\u{1D5CC}":"s","\u{1D600}":"s","\u{1D634}":"s","\u{1D668}":"s","\u{1D69C}":"s","\uA731":"s",\u01BD:"s",\u0455:"s","\uABAA":"s","\u{118C1}":"s","\u{10448}":"s",\uFF33:"S","\u{1D412}":"S","\u{1D446}":"S","\u{1D47A}":"S","\u{1D4AE}":"S","\u{1D4E2}":"S","\u{1D516}":"S","\u{1D54A}":"S","\u{1D57E}":"S","\u{1D5B2}":"S","\u{1D5E6}":"S","\u{1D61A}":"S","\u{1D64E}":"S","\u{1D682}":"S",\u0405:"S",\u054F:"S",\u13D5:"S",\u13DA:"S","\uA4E2":"S","\u{16F3A}":"S","\u{10296}":"S","\u{10420}":"S",\u0282:"s\u0328","\u1D74":"s\u0334","\uA7B5":"\xDF",\u03B2:"\xDF",\u03D0:"\xDF","\u{1D6C3}":"\xDF","\u{1D6FD}":"\xDF","\u{1D737}":"\xDF","\u{1D771}":"\xDF","\u{1D7AB}":"\xDF",\u13F0:"\xDF","\u{1F75C}":"sss",\uFB06:"st","\u222B":"\u0283","\uAB4D":"\u0283","\u2211":"\u01A9","\u2140":"\u01A9",\u03A3:"\u01A9","\u{1D6BA}":"\u01A9","\u{1D6F4}":"\u01A9","\u{1D72E}":"\u01A9","\u{1D768}":"\u01A9","\u{1D7A2}":"\u01A9","\u2D49":"\u01A9","\u222C":"\u0283\u0283","\u222D":"\u0283\u0283\u0283","\u2A0C":"\u0283\u0283\u0283\u0283","\u{1D42D}":"t","\u{1D461}":"t","\u{1D495}":"t","\u{1D4C9}":"t","\u{1D4FD}":"t","\u{1D531}":"t","\u{1D565}":"t","\u{1D599}":"t","\u{1D5CD}":"t","\u{1D601}":"t","\u{1D635}":"t","\u{1D669}":"t","\u{1D69D}":"t","\u22A4":"T","\u27D9":"T","\u{1F768}":"T",\uFF34:"T","\u{1D413}":"T","\u{1D447}":"T","\u{1D47B}":"T","\u{1D4AF}":"T","\u{1D4E3}":"T","\u{1D517}":"T","\u{1D54B}":"T","\u{1D57F}":"T","\u{1D5B3}":"T","\u{1D5E7}":"T","\u{1D61B}":"T","\u{1D64F}":"T","\u{1D683}":"T",\u03A4:"T","\u{1D6BB}":"T","\u{1D6F5}":"T","\u{1D72F}":"T","\u{1D769}":"T","\u{1D7A3}":"T","\u2CA6":"T",\u0422:"T",\u13A2:"T","\uA4D4":"T","\u{16F0A}":"T","\u{118BC}":"T","\u{10297}":"T","\u{102B1}":"T","\u{10315}":"T",\u01AD:"t\u0314","\u2361":"T\u0308","\u023E":"T\u0338",\u021A:"\u0162",\u01AE:"T\u0328",\u04AC:"T\u0329","\u20AE":"T\u20EB",\u0167:"t\u0335",\u0166:"T\u0335","\u1D75":"t\u0334",\u10A0:"\uA786","\uA728":"T3",\u02A8:"t\u0255","\u2121":"TEL","\uA777":"tf",\u02A6:"ts",\u02A7:"t\u0283","\uA729":"t\u021D",\u03C4:"\u1D1B","\u{1D6D5}":"\u1D1B","\u{1D70F}":"\u1D1B","\u{1D749}":"\u1D1B","\u{1D783}":"\u1D1B","\u{1D7BD}":"\u1D1B",\u0442:"\u1D1B","\uAB72":"\u1D1B",\u04AD:"\u1D1B\u0329",\u0163:"\u01AB",\u021B:"\u01AB",\u13BF:"\u01AB","\u{1D42E}":"u","\u{1D462}":"u","\u{1D496}":"u","\u{1D4CA}":"u","\u{1D4FE}":"u","\u{1D532}":"u","\u{1D566}":"u","\u{1D59A}":"u","\u{1D5CE}":"u","\u{1D602}":"u","\u{1D636}":"u","\u{1D66A}":"u","\u{1D69E}":"u","\uA79F":"u","\u1D1C":"u","\uAB4E":"u","\uAB52":"u",\u028B:"u",\u03C5:"u","\u{1D6D6}":"u","\u{1D710}":"u","\u{1D74A}":"u","\u{1D784}":"u","\u{1D7BE}":"u",\u057D:"u","\u{104F6}":"u","\u{118D8}":"u","\u222A":"U","\u22C3":"U","\u{1D414}":"U","\u{1D448}":"U","\u{1D47C}":"U","\u{1D4B0}":"U","\u{1D4E4}":"U","\u{1D518}":"U","\u{1D54C}":"U","\u{1D580}":"U","\u{1D5B4}":"U","\u{1D5E8}":"U","\u{1D61C}":"U","\u{1D650}":"U","\u{1D684}":"U",\u054D:"U",\u1200:"U","\u{104CE}":"U",\u144C:"U","\uA4F4":"U","\u{16F42}":"U","\u{118B8}":"U",\u01D4:"\u016D",\u01D3:"\u016C","\u1D7E":"u\u0335","\uAB9C":"u\u0335","\u0244":"U\u0335",\u13CC:"U\u0335",\u1458:"U\xB7",\u1467:"U'","\u1D6B":"ue","\uAB63":"uo",\u1E43:"\uAB51",\u057A:"\u0270",\u1223:"\u0270","\u2127":"\u01B1",\u162E:"\u01B1",\u1634:"\u01B1","\u1D7F":"\u028A\u0335","\u2228":"v","\u22C1":"v",\uFF56:"v","\u2174":"v","\u{1D42F}":"v","\u{1D463}":"v","\u{1D497}":"v","\u{1D4CB}":"v","\u{1D4FF}":"v","\u{1D533}":"v","\u{1D567}":"v","\u{1D59B}":"v","\u{1D5CF}":"v","\u{1D603}":"v","\u{1D637}":"v","\u{1D66B}":"v","\u{1D69F}":"v","\u1D20":"v",\u03BD:"v","\u{1D6CE}":"v","\u{1D708}":"v","\u{1D742}":"v","\u{1D77C}":"v","\u{1D7B6}":"v",\u0475:"v",\u05D8:"v","\u{11706}":"v","\uABA9":"v","\u{118C0}":"v","\u{1D20D}":"V","\u0667":"V","\u06F7":"V","\u2164":"V","\u{1D415}":"V","\u{1D449}":"V","\u{1D47D}":"V","\u{1D4B1}":"V","\u{1D4E5}":"V","\u{1D519}":"V","\u{1D54D}":"V","\u{1D581}":"V","\u{1D5B5}":"V","\u{1D5E9}":"V","\u{1D61D}":"V","\u{1D651}":"V","\u{1D685}":"V",\u0474:"V","\u2D38":"V",\u13D9:"V",\u142F:"V","\uA6DF":"V","\uA4E6":"V","\u{16F08}":"V","\u{118A0}":"V","\u{1051D}":"V","\u{10197}":"V\u0335",\u143B:"V\xB7","\u{1F76C}":"VB","\u2175":"vi","\u2176":"vii","\u2177":"viii","\u2165":"Vl","\u2166":"Vll","\u2167":"Vlll","\u{1F708}":"V\u1DE4","\u1D27":"\u028C","\u{104D8}":"\u028C","\u0668":"\u0245","\u06F8":"\u0245",\u039B:"\u0245","\u{1D6B2}":"\u0245","\u{1D6EC}":"\u0245","\u{1D726}":"\u0245","\u{1D760}":"\u0245","\u{1D79A}":"\u0245",\u041B:"\u0245","\u2D37":"\u0245","\u{104B0}":"\u0245",\u1431:"\u0245","\uA6CE":"\u0245","\uA4E5":"\u0245","\u{16F3D}":"\u0245","\u{1028D}":"\u0245","\u04C5":"\u0245\u0326",\u143D:"\u0245\xB7",\u026F:"w","\u{1D430}":"w","\u{1D464}":"w","\u{1D498}":"w","\u{1D4CC}":"w","\u{1D500}":"w","\u{1D534}":"w","\u{1D568}":"w","\u{1D59C}":"w","\u{1D5D0}":"w","\u{1D604}":"w","\u{1D638}":"w","\u{1D66C}":"w","\u{1D6A0}":"w","\u1D21":"w",\u0461:"w","\u051D":"w",\u0561:"w","\u{1170A}":"w","\u{1170E}":"w","\u{1170F}":"w","\uAB83":"w","\u{118EF}":"W","\u{118E6}":"W","\u{1D416}":"W","\u{1D44A}":"W","\u{1D47E}":"W","\u{1D4B2}":"W","\u{1D4E6}":"W","\u{1D51A}":"W","\u{1D54E}":"W","\u{1D582}":"W","\u{1D5B6}":"W","\u{1D5EA}":"W","\u{1D61E}":"W","\u{1D652}":"W","\u{1D686}":"W","\u051C":"W",\u13B3:"W",\u13D4:"W","\uA4EA":"W",\u047D:"w\u0486\u0487","\u{114C5}":"w\u0307","\u20A9":"W\u0335","\uA761":"w\u0326","\u1D0D":"\u028D",\u043C:"\u028D","\uAB87":"\u028D","\u04CE":"\u028D\u0326","\u166E":"x","\xD7":"x","\u292B":"x","\u292C":"x","\u2A2F":"x",\uFF58:"x","\u2179":"x","\u{1D431}":"x","\u{1D465}":"x","\u{1D499}":"x","\u{1D4CD}":"x","\u{1D501}":"x","\u{1D535}":"x","\u{1D569}":"x","\u{1D59D}":"x","\u{1D5D1}":"x","\u{1D605}":"x","\u{1D639}":"x","\u{1D66D}":"x","\u{1D6A1}":"x",\u0445:"x",\u1541:"x",\u157D:"x","\u2DEF":"\u036F","\u166D":"X","\u2573":"X","\u{10322}":"X","\u{118EC}":"X",\uFF38:"X","\u2169":"X","\u{1D417}":"X","\u{1D44B}":"X","\u{1D47F}":"X","\u{1D4B3}":"X","\u{1D4E7}":"X","\u{1D51B}":"X","\u{1D54F}":"X","\u{1D583}":"X","\u{1D5B7}":"X","\u{1D5EB}":"X","\u{1D61F}":"X","\u{1D653}":"X","\u{1D687}":"X","\uA7B3":"X",\u03A7:"X","\u{1D6BE}":"X","\u{1D6F8}":"X","\u{1D732}":"X","\u{1D76C}":"X","\u{1D7A6}":"X","\u2CAC":"X",\u0425:"X","\u2D5D":"X",\u16B7:"X","\uA4EB":"X","\u{10290}":"X","\u{102B4}":"X","\u{10317}":"X","\u{10527}":"X","\u2A30":"x\u0307",\u04B2:"X\u0329","\u{10196}":"X\u0335","\u217A":"xi","\u217B":"xii","\u216A":"Xl","\u216B":"Xll",\u0263:"y","\u1D8C":"y",\uFF59:"y","\u{1D432}":"y","\u{1D466}":"y","\u{1D49A}":"y","\u{1D4CE}":"y","\u{1D502}":"y","\u{1D536}":"y","\u{1D56A}":"y","\u{1D59E}":"y","\u{1D5D2}":"y","\u{1D606}":"y","\u{1D63A}":"y","\u{1D66E}":"y","\u{1D6A2}":"y",\u028F:"y","\u1EFF":"y","\uAB5A":"y",\u03B3:"y","\u213D":"y","\u{1D6C4}":"y","\u{1D6FE}":"y","\u{1D738}":"y","\u{1D772}":"y","\u{1D7AC}":"y",\u0443:"y",\u04AF:"y",\u10E7:"y","\u{118DC}":"y",\uFF39:"Y","\u{1D418}":"Y","\u{1D44C}":"Y","\u{1D480}":"Y","\u{1D4B4}":"Y","\u{1D4E8}":"Y","\u{1D51C}":"Y","\u{1D550}":"Y","\u{1D584}":"Y","\u{1D5B8}":"Y","\u{1D5EC}":"Y","\u{1D620}":"Y","\u{1D654}":"Y","\u{1D688}":"Y",\u03A5:"Y",\u03D2:"Y","\u{1D6BC}":"Y","\u{1D6F6}":"Y","\u{1D730}":"Y","\u{1D76A}":"Y","\u{1D7A4}":"Y","\u2CA8":"Y",\u0423:"Y",\u04AE:"Y",\u13A9:"Y",\u13BD:"Y","\uA4EC":"Y","\u{16F43}":"Y","\u{118A4}":"Y","\u{102B2}":"Y",\u01B4:"y\u0314","\u024F":"y\u0335",\u04B1:"y\u0335","\xA5":"Y\u0335","\u024E":"Y\u0335",\u04B0:"Y\u0335",\u0292:"\u021D","\uA76B":"\u021D","\u2CCD":"\u021D",\u04E1:"\u021D",\u10F3:"\u021D","\u{1D433}":"z","\u{1D467}":"z","\u{1D49B}":"z","\u{1D4CF}":"z","\u{1D503}":"z","\u{1D537}":"z","\u{1D56B}":"z","\u{1D59F}":"z","\u{1D5D3}":"z","\u{1D607}":"z","\u{1D63B}":"z","\u{1D66F}":"z","\u{1D6A3}":"z","\u1D22":"z","\uAB93":"z","\u{118C4}":"z","\u{102F5}":"Z","\u{118E5}":"Z",\uFF3A:"Z",\u2124:"Z",\u2128:"Z","\u{1D419}":"Z","\u{1D44D}":"Z","\u{1D481}":"Z","\u{1D4B5}":"Z","\u{1D4E9}":"Z","\u{1D585}":"Z","\u{1D5B9}":"Z","\u{1D5ED}":"Z","\u{1D621}":"Z","\u{1D655}":"Z","\u{1D689}":"Z",\u0396:"Z","\u{1D6AD}":"Z","\u{1D6E7}":"Z","\u{1D721}":"Z","\u{1D75B}":"Z","\u{1D795}":"Z",\u13C3:"Z","\uA4DC":"Z","\u{118A9}":"Z",\u0290:"z\u0328",\u01B6:"z\u0335",\u01B5:"Z\u0335",\u0225:"z\u0326",\u0224:"Z\u0326","\u1D76":"z\u0334",\u01BF:"\xFE","\u03F8":"\xFE","\u03F7":"\xDE","\u{104C4}":"\xDE","\u2079":"\uA770","\u1D24":"\u01A8",\u03E9:"\u01A8","\uA645":"\u01A8",\u044C:"\u0185","\uAB9F":"\u0185",\u044B:"\u0185i","\uAB7E":"\u0242",\u02E4:"\u02C1","\uA6CD":"\u02A1","\u2299":"\u0298","\u2609":"\u0298","\u2A00":"\u0298","\uA668":"\u0298","\u2D59":"\u0298","\u{104C3}":"\u0298","\u213E":"\u0393","\u{1D6AA}":"\u0393","\u{1D6E4}":"\u0393","\u{1D71E}":"\u0393","\u{1D758}":"\u0393","\u{1D792}":"\u0393","\u2C84":"\u0393",\u0413:"\u0393",\u13B1:"\u0393",\u14A5:"\u0393","\u{16F07}":"\u0393",\u0492:"\u0393\u0335",\u14AF:"\u0393\xB7",\u0490:"\u0393'","\u2206":"\u0394","\u25B3":"\u0394","\u{1F702}":"\u0394","\u{1D6AB}":"\u0394","\u{1D6E5}":"\u0394","\u{1D71F}":"\u0394","\u{1D759}":"\u0394","\u{1D793}":"\u0394","\u2C86":"\u0394","\u2D60":"\u0394",\u1403:"\u0394","\u{16F1A}":"\u0394","\u{10285}":"\u0394","\u{102A3}":"\u0394","\u2359":"\u0394\u0332",\u140F:"\u0394\xB7",\u142C:"\u0394\u1420","\u{1D7CB}":"\u03DD","\u{1D6C7}":"\u03B6","\u{1D701}":"\u03B6","\u{1D73B}":"\u03B6","\u{1D775}":"\u03B6","\u{1D7AF}":"\u03B6","\u2CE4":"\u03D7","\u{1D6CC}":"\u03BB","\u{1D706}":"\u03BB","\u{1D740}":"\u03BB","\u{1D77A}":"\u03BB","\u{1D7B4}":"\u03BB","\u2C96":"\u03BB","\u{104DB}":"\u03BB",\u00B5:"\u03BC","\u{1D6CD}":"\u03BC","\u{1D707}":"\u03BC","\u{1D741}":"\u03BC","\u{1D77B}":"\u03BC","\u{1D7B5}":"\u03BC","\u{1D6CF}":"\u03BE","\u{1D709}":"\u03BE","\u{1D743}":"\u03BE","\u{1D77D}":"\u03BE","\u{1D7B7}":"\u03BE","\u{1D6B5}":"\u039E","\u{1D6EF}":"\u039E","\u{1D729}":"\u039E","\u{1D763}":"\u039E","\u{1D79D}":"\u039E",\u03D6:"\u03C0","\u213C":"\u03C0","\u{1D6D1}":"\u03C0","\u{1D6E1}":"\u03C0","\u{1D70B}":"\u03C0","\u{1D71B}":"\u03C0","\u{1D745}":"\u03C0","\u{1D755}":"\u03C0","\u{1D77F}":"\u03C0","\u{1D78F}":"\u03C0","\u{1D7B9}":"\u03C0","\u{1D7C9}":"\u03C0","\u1D28":"\u03C0",\u043F:"\u03C0","\u220F":"\u03A0","\u213F":"\u03A0","\u{1D6B7}":"\u03A0","\u{1D6F1}":"\u03A0","\u{1D72B}":"\u03A0","\u{1D765}":"\u03A0","\u{1D79F}":"\u03A0","\u2CA0":"\u03A0",\u041F:"\u03A0","\uA6DB":"\u03A0","\u{102AD}":"\u03D8","\u{10312}":"\u03D8",\u03DB:"\u03C2","\u{1D6D3}":"\u03C2","\u{1D70D}":"\u03C2","\u{1D747}":"\u03C2","\u{1D781}":"\u03C2","\u{1D7BB}":"\u03C2","\u{1D6BD}":"\u03A6","\u{1D6F7}":"\u03A6","\u{1D731}":"\u03A6","\u{1D76B}":"\u03A6","\u{1D7A5}":"\u03A6","\u2CAA":"\u03A6",\u0424:"\u03A6",\u0553:"\u03A6",\u1240:"\u03A6","\u16F0":"\u03A6","\u{102B3}":"\u03A6","\uAB53":"\u03C7","\uAB55":"\u03C7","\u{1D6D8}":"\u03C7","\u{1D712}":"\u03C7","\u{1D74C}":"\u03C7","\u{1D786}":"\u03C7","\u{1D7C0}":"\u03C7","\u2CAD":"\u03C7","\u{1D6D9}":"\u03C8","\u{1D713}":"\u03C8","\u{1D74D}":"\u03C8","\u{1D787}":"\u03C8","\u{1D7C1}":"\u03C8",\u0471:"\u03C8","\u{104F9}":"\u03C8","\u{1D6BF}":"\u03A8","\u{1D6F9}":"\u03A8","\u{1D733}":"\u03A8","\u{1D76D}":"\u03A8","\u{1D7A7}":"\u03A8","\u2CAE":"\u03A8",\u0470:"\u03A8","\u{104D1}":"\u03A8",\u16D8:"\u03A8","\u{102B5}":"\u03A8","\u2375":"\u03C9","\uA7B7":"\u03C9","\u{1D6DA}":"\u03C9","\u{1D714}":"\u03C9","\u{1D74E}":"\u03C9","\u{1D788}":"\u03C9","\u{1D7C2}":"\u03C9","\u2CB1":"\u03C9","\uA64D":"\u03C9",\u2126:"\u03A9","\u{1D6C0}":"\u03A9","\u{1D6FA}":"\u03A9","\u{1D734}":"\u03A9","\u{1D76E}":"\u03A9","\u{1D7A8}":"\u03A9",\u162F:"\u03A9",\u1635:"\u03A9","\u{102B6}":"\u03A9","\u2379":"\u03C9\u0332",\u1F7D:"\u1FF4","\u2630":"\u2CB6","\u2CDC":"\u03EC",\u0497:"\u0436\u0329",\u0496:"\u0416\u0329","\u{1D20B}":"\u0418","\u0376":"\u0418","\uA6A1":"\u0418","\u{10425}":"\u0418",\u0419:"\u040D","\u048A":"\u040D\u0326",\u045D:"\u0439","\u048B":"\u0439\u0326","\u{104BC}":"\u04C3","\u1D2B":"\u043B","\u04C6":"\u043B\u0326","\uAB60":"\u0459","\u{104EB}":"\uA669","\u1DEE":"\u2DEC","\u{104CD}":"\u040B","\u{1D202}":"\u04FE","\u{1D222}":"\u0460",\u13C7:"\u0460",\u15EF:"\u0460",\u047C:"\u0460\u0486\u0487","\u18ED":"\u0460\xB7","\uA7B6":"\uA64C",\u04CC:"\u04B7",\u04CB:"\u04B6",\u04BE:"\u04BC\u0328","\u2CBD":"\u0448","\u2CBC":"\u0428","\uA650":"\u042Al","\u2108":"\u042D","\u{1F701}":"\uA658","\u{16F1C}":"\uA658","\uA992":"\u2C3F",\u0587:"\u0565\u0582",\u1294:"\u0571",\uFB14:"\u0574\u0565",\uFB15:"\u0574\u056B",\uFB17:"\u0574\u056D",\uFB13:"\u0574\u0576","\u2229":"\u0548","\u22C2":"\u0548","\u{1D245}":"\u0548",\u1260:"\u0548",\u144E:"\u0548","\uA4F5":"\u0548",\u145A:"\u0548\xB7",\u1468:"\u0548'",\uFB16:"\u057E\u0576","\u20BD":"\u0554","\u02D3":"\u0559",\u02BF:"\u0559",\u2135:"\u05D0",\uFB21:"\u05D0",\uFB2F:"\uFB2E",\uFB30:"\uFB2E",\uFB4F:"\u05D0\u05DC",\u2136:"\u05D1",\u2137:"\u05D2",\u2138:"\u05D3",\uFB22:"\u05D3",\uFB23:"\u05D4",\uFB39:"\uFB1D",\uFB24:"\u05DB",\uFB25:"\u05DC",\uFB26:"\u05DD",\uFB20:"\u05E2",\uFB27:"\u05E8",\uFB2B:"\uFB2A",\uFB49:"\uFB2A",\uFB2D:"\uFB2C",\uFB28:"\u05EA",\uFE80:"\u0621","\u06FD":"\u0621\u0348",\uFE82:"\u0622",\uFE81:"\u0622",\uFB51:"\u0671",\uFB50:"\u0671","\u{1EE01}":"\u0628","\u{1EE21}":"\u0628","\u{1EE61}":"\u0628","\u{1EE81}":"\u0628","\u{1EEA1}":"\u0628",\uFE91:"\u0628",\uFE92:"\u0628",\uFE90:"\u0628",\uFE8F:"\u0628","\u0751":"\u0628\u06DB","\u08B6":"\u0628\u06E2","\u08A1":"\u0628\u0654",\uFCA0:"\u0628o",\uFCE2:"\u0628o",\uFC9C:"\u0628\u062C",\uFC05:"\u0628\u062C",\uFC9D:"\u0628\u062D",\uFC06:"\u0628\u062D",\uFDC2:"\u0628\u062D\u0649",\uFC9E:"\u0628\u062E",\uFC07:"\u0628\u062E",\uFCD2:"\u0628\u062E",\uFC4B:"\u0628\u062E",\uFD9E:"\u0628\u062E\u0649",\uFC6A:"\u0628\u0631",\uFC6B:"\u0628\u0632",\uFC9F:"\u0628\u0645",\uFCE1:"\u0628\u0645",\uFC6C:"\u0628\u0645",\uFC08:"\u0628\u0645",\uFC6D:"\u0628\u0646",\uFC6E:"\u0628\u0649",\uFC09:"\u0628\u0649",\uFC6F:"\u0628\u0649",\uFC0A:"\u0628\u0649",\uFB54:"\u067B",\uFB55:"\u067B",\uFB53:"\u067B",\uFB52:"\u067B",\u06D0:"\u067B",\uFBE6:"\u067B",\uFBE7:"\u067B",\uFBE5:"\u067B",\uFBE4:"\u067B",\uFB5C:"\u0680",\uFB5D:"\u0680",\uFB5B:"\u0680",\uFB5A:"\u0680","\u08A9":"\u0754","\u0767":"\u0754","\u2365":"\u0629",\u00F6:"\u0629",\uFE94:"\u0629",\uFE93:"\u0629",\u06C3:"\u0629","\u{1EE15}":"\u062A","\u{1EE35}":"\u062A","\u{1EE75}":"\u062A","\u{1EE95}":"\u062A","\u{1EEB5}":"\u062A",\uFE97:"\u062A",\uFE98:"\u062A",\uFE96:"\u062A",\uFE95:"\u062A",\uFCA5:"\u062Ao",\uFCE4:"\u062Ao",\uFCA1:"\u062A\u062C",\uFC0B:"\u062A\u062C",\uFD50:"\u062A\u062C\u0645",\uFDA0:"\u062A\u062C\u0649",\uFD9F:"\u062A\u062C\u0649",\uFCA2:"\u062A\u062D",\uFC0C:"\u062A\u062D",\uFD52:"\u062A\u062D\u062C",\uFD51:"\u062A\u062D\u062C",\uFD53:"\u062A\u062D\u0645",\uFCA3:"\u062A\u062E",\uFC0D:"\u062A\u062E",\uFD54:"\u062A\u062E\u0645",\uFDA2:"\u062A\u062E\u0649",\uFDA1:"\u062A\u062E\u0649",\uFC70:"\u062A\u0631",\uFC71:"\u062A\u0632",\uFCA4:"\u062A\u0645",\uFCE3:"\u062A\u0645",\uFC72:"\u062A\u0645",\uFC0E:"\u062A\u0645",\uFD55:"\u062A\u0645\u062C",\uFD56:"\u062A\u0645\u062D",\uFD57:"\u062A\u0645\u062E",\uFDA4:"\u062A\u0645\u0649",\uFDA3:"\u062A\u0645\u0649",\uFC73:"\u062A\u0646",\uFC74:"\u062A\u0649",\uFC0F:"\u062A\u0649",\uFC75:"\u062A\u0649",\uFC10:"\u062A\u0649",\uFB60:"\u067A",\uFB61:"\u067A",\uFB5F:"\u067A",\uFB5E:"\u067A",\uFB64:"\u067F",\uFB65:"\u067F",\uFB63:"\u067F",\uFB62:"\u067F","\u{1EE02}":"\u062C","\u{1EE22}":"\u062C","\u{1EE42}":"\u062C","\u{1EE62}":"\u062C","\u{1EE82}":"\u062C","\u{1EEA2}":"\u062C",\uFE9F:"\u062C",\uFEA0:"\u062C",\uFE9E:"\u062C",\uFE9D:"\u062C",\uFCA7:"\u062C\u062D",\uFC15:"\u062C\u062D",\uFDA6:"\u062C\u062D\u0649",\uFDBE:"\u062C\u062D\u0649",\uFDFB:"\u062C\u0644 \u062C\u0644l\u0644o",\uFCA8:"\u062C\u0645",\uFC16:"\u062C\u0645",\uFD59:"\u062C\u0645\u062D",\uFD58:"\u062C\u0645\u062D",\uFDA7:"\u062C\u0645\u0649",\uFDA5:"\u062C\u0645\u0649",\uFD1D:"\u062C\u0649",\uFD01:"\u062C\u0649",\uFD1E:"\u062C\u0649",\uFD02:"\u062C\u0649",\uFB78:"\u0683",\uFB79:"\u0683",\uFB77:"\u0683",\uFB76:"\u0683",\uFB74:"\u0684",\uFB75:"\u0684",\uFB73:"\u0684",\uFB72:"\u0684",\uFB7C:"\u0686",\uFB7D:"\u0686",\uFB7B:"\u0686",\uFB7A:"\u0686",\uFB80:"\u0687",\uFB81:"\u0687",\uFB7F:"\u0687",\uFB7E:"\u0687","\u{1EE07}":"\u062D","\u{1EE27}":"\u062D","\u{1EE47}":"\u062D","\u{1EE67}":"\u062D","\u{1EE87}":"\u062D","\u{1EEA7}":"\u062D",\uFEA3:"\u062D",\uFEA4:"\u062D",\uFEA2:"\u062D",\uFEA1:"\u062D",\u0685:"\u062D\u06DB",\u0681:"\u062D\u0654","\u0772":"\u062D\u0654",\uFCA9:"\u062D\u062C",\uFC17:"\u062D\u062C",\uFDBF:"\u062D\u062C\u0649",\uFCAA:"\u062D\u0645",\uFC18:"\u062D\u0645",\uFD5B:"\u062D\u0645\u0649",\uFD5A:"\u062D\u0645\u0649",\uFD1B:"\u062D\u0649",\uFCFF:"\u062D\u0649",\uFD1C:"\u062D\u0649",\uFD00:"\u062D\u0649","\u{1EE17}":"\u062E","\u{1EE37}":"\u062E","\u{1EE57}":"\u062E","\u{1EE77}":"\u062E","\u{1EE97}":"\u062E","\u{1EEB7}":"\u062E",\uFEA7:"\u062E",\uFEA8:"\u062E",\uFEA6:"\u062E",\uFEA5:"\u062E",\uFCAB:"\u062E\u062C",\uFC19:"\u062E\u062C",\uFC1A:"\u062E\u062D",\uFCAC:"\u062E\u0645",\uFC1B:"\u062E\u0645",\uFD1F:"\u062E\u0649",\uFD03:"\u062E\u0649",\uFD20:"\u062E\u0649",\uFD04:"\u062E\u0649","\u{102E1}":"\u062F","\u{1EE03}":"\u062F","\u{1EE83}":"\u062F","\u{1EEA3}":"\u062F",\uFEAA:"\u062F",\uFEA9:"\u062F",\u0688:"\u062F\u0615",\uFB89:"\u062F\u0615",\uFB88:"\u062F\u0615",\u068E:"\u062F\u06DB",\uFB87:"\u062F\u06DB",\uFB86:"\u062F\u06DB","\u06EE":"\u062F\u0302","\u08AE":"\u062F\u0324\u0323","\u{1EE18}":"\u0630","\u{1EE98}":"\u0630","\u{1EEB8}":"\u0630",\uFEAC:"\u0630",\uFEAB:"\u0630",\uFC5B:"\u0630\u0670",\u068B:"\u068A\u0615",\uFB85:"\u068C",\uFB84:"\u068C",\uFB83:"\u068D",\uFB82:"\u068D","\u{1EE13}":"\u0631","\u{1EE93}":"\u0631","\u{1EEB3}":"\u0631",\uFEAE:"\u0631",\uFEAD:"\u0631",\u0691:"\u0631\u0615",\uFB8D:"\u0631\u0615",\uFB8C:"\u0631\u0615",\u0698:"\u0631\u06DB",\uFB8B:"\u0631\u06DB",\uFB8A:"\u0631\u06DB",\u0692:"\u0631\u0306","\u08B9":"\u0631\u0306\u0307","\u06EF":"\u0631\u0302","\u076C":"\u0631\u0654",\uFC5C:"\u0631\u0670",\uFDF6:"\u0631\u0633\u0648\u0644","\uFDFC":"\u0631\u0649l\u0644","\u{1EE06}":"\u0632","\u{1EE86}":"\u0632","\u{1EEA6}":"\u0632",\uFEB0:"\u0632",\uFEAF:"\u0632","\u08B2":"\u0632\u0302","\u0771":"\u0697\u0615","\u{1EE0E}":"\u0633","\u{1EE2E}":"\u0633","\u{1EE4E}":"\u0633","\u{1EE6E}":"\u0633","\u{1EE8E}":"\u0633","\u{1EEAE}":"\u0633",\uFEB3:"\u0633",\uFEB4:"\u0633",\uFEB2:"\u0633",\uFEB1:"\u0633",\u0634:"\u0633\u06DB","\u{1EE14}":"\u0633\u06DB","\u{1EE34}":"\u0633\u06DB","\u{1EE54}":"\u0633\u06DB","\u{1EE74}":"\u0633\u06DB","\u{1EE94}":"\u0633\u06DB","\u{1EEB4}":"\u0633\u06DB",\uFEB7:"\u0633\u06DB",\uFEB8:"\u0633\u06DB",\uFEB6:"\u0633\u06DB",\uFEB5:"\u0633\u06DB","\u077E":"\u0633\u0302",\uFD31:"\u0633o",\uFCE8:"\u0633o",\uFD32:"\u0633\u06DBo",\uFCEA:"\u0633\u06DBo",\uFCAD:"\u0633\u062C",\uFD34:"\u0633\u062C",\uFC1C:"\u0633\u062C",\uFD2D:"\u0633\u06DB\u062C",\uFD37:"\u0633\u06DB\u062C",\uFD25:"\u0633\u06DB\u062C",\uFD09:"\u0633\u06DB\u062C",\uFD5D:"\u0633\u062C\u062D",\uFD5E:"\u0633\u062C\u0649",\uFD69:"\u0633\u06DB\u062C\u0649",\uFCAE:"\u0633\u062D",\uFD35:"\u0633\u062D",\uFC1D:"\u0633\u062D",\uFD2E:"\u0633\u06DB\u062D",\uFD38:"\u0633\u06DB\u062D",\uFD26:"\u0633\u06DB\u062D",\uFD0A:"\u0633\u06DB\u062D",\uFD5C:"\u0633\u062D\u062C",\uFD68:"\u0633\u06DB\u062D\u0645",\uFD67:"\u0633\u06DB\u062D\u0645",\uFDAA:"\u0633\u06DB\u062D\u0649",\uFCAF:"\u0633\u062E",\uFD36:"\u0633\u062E",\uFC1E:"\u0633\u062E",\uFD2F:"\u0633\u06DB\u062E",\uFD39:"\u0633\u06DB\u062E",\uFD27:"\u0633\u06DB\u062E",\uFD0B:"\u0633\u06DB\u062E",\uFDA8:"\u0633\u062E\u0649",\uFDC6:"\u0633\u062E\u0649",\uFD2A:"\u0633\u0631",\uFD0E:"\u0633\u0631",\uFD29:"\u0633\u06DB\u0631",\uFD0D:"\u0633\u06DB\u0631",\uFCB0:"\u0633\u0645",\uFCE7:"\u0633\u0645",\uFC1F:"\u0633\u0645",\uFD30:"\u0633\u06DB\u0645",\uFCE9:"\u0633\u06DB\u0645",\uFD28:"\u0633\u06DB\u0645",\uFD0C:"\u0633\u06DB\u0645",\uFD61:"\u0633\u0645\u062C",\uFD60:"\u0633\u0645\u062D",\uFD5F:"\u0633\u0645\u062D",\uFD6B:"\u0633\u06DB\u0645\u062E",\uFD6A:"\u0633\u06DB\u0645\u062E",\uFD63:"\u0633\u0645\u0645",\uFD62:"\u0633\u0645\u0645",\uFD6D:"\u0633\u06DB\u0645\u0645",\uFD6C:"\u0633\u06DB\u0645\u0645",\uFD17:"\u0633\u0649",\uFCFB:"\u0633\u0649",\uFD18:"\u0633\u0649",\uFCFC:"\u0633\u0649",\uFD19:"\u0633\u06DB\u0649",\uFCFD:"\u0633\u06DB\u0649",\uFD1A:"\u0633\u06DB\u0649",\uFCFE:"\u0633\u06DB\u0649","\u{102F2}":"\u0635","\u{1EE11}":"\u0635","\u{1EE31}":"\u0635","\u{1EE51}":"\u0635","\u{1EE71}":"\u0635","\u{1EE91}":"\u0635","\u{1EEB1}":"\u0635",\uFEBB:"\u0635",\uFEBC:"\u0635",\uFEBA:"\u0635",\uFEB9:"\u0635",\u069E:"\u0635\u06DB","\u08AF":"\u0635\u0324\u0323",\uFCB1:"\u0635\u062D",\uFC20:"\u0635\u062D",\uFD65:"\u0635\u062D\u062D",\uFD64:"\u0635\u062D\u062D",\uFDA9:"\u0635\u062D\u0649",\uFCB2:"\u0635\u062E",\uFD2B:"\u0635\u0631",\uFD0F:"\u0635\u0631",\uFDF5:"\u0635\u0644\u0639\u0645",\uFDF9:"\u0635\u0644\u0649",\uFDF0:"\u0635\u0644\u0649",\uFDFA:"\u0635\u0644\u0649 l\u0644\u0644o \u0639\u0644\u0649o \u0648\u0633\u0644\u0645",\uFCB3:"\u0635\u0645",\uFC21:"\u0635\u0645",\uFDC5:"\u0635\u0645\u0645",\uFD66:"\u0635\u0645\u0645",\uFD21:"\u0635\u0649",\uFD05:"\u0635\u0649",\uFD22:"\u0635\u0649",\uFD06:"\u0635\u0649","\u{1EE19}":"\u0636","\u{1EE39}":"\u0636","\u{1EE59}":"\u0636","\u{1EE79}":"\u0636","\u{1EE99}":"\u0636","\u{1EEB9}":"\u0636",\uFEBF:"\u0636",\uFEC0:"\u0636",\uFEBE:"\u0636",\uFEBD:"\u0636",\uFCB4:"\u0636\u062C",\uFC22:"\u0636\u062C",\uFCB5:"\u0636\u062D",\uFC23:"\u0636\u062D",\uFD6E:"\u0636\u062D\u0649",\uFDAB:"\u0636\u062D\u0649",\uFCB6:"\u0636\u062E",\uFC24:"\u0636\u062E",\uFD70:"\u0636\u062E\u0645",\uFD6F:"\u0636\u062E\u0645",\uFD2C:"\u0636\u0631",\uFD10:"\u0636\u0631",\uFCB7:"\u0636\u0645",\uFC25:"\u0636\u0645",\uFD23:"\u0636\u0649",\uFD07:"\u0636\u0649",\uFD24:"\u0636\u0649",\uFD08:"\u0636\u0649","\u{102E8}":"\u0637","\u{1EE08}":"\u0637","\u{1EE68}":"\u0637","\u{1EE88}":"\u0637","\u{1EEA8}":"\u0637",\uFEC3:"\u0637",\uFEC4:"\u0637",\uFEC2:"\u0637",\uFEC1:"\u0637",\u069F:"\u0637\u06DB",\uFCB8:"\u0637\u062D",\uFC26:"\u0637\u062D",\uFD33:"\u0637\u0645",\uFD3A:"\u0637\u0645",\uFC27:"\u0637\u0645",\uFD72:"\u0637\u0645\u062D",\uFD71:"\u0637\u0645\u062D",\uFD73:"\u0637\u0645\u0645",\uFD74:"\u0637\u0645\u0649",\uFD11:"\u0637\u0649",\uFCF5:"\u0637\u0649",\uFD12:"\u0637\u0649",\uFCF6:"\u0637\u0649","\u{1EE1A}":"\u0638","\u{1EE7A}":"\u0638","\u{1EE9A}":"\u0638","\u{1EEBA}":"\u0638",\uFEC7:"\u0638",\uFEC8:"\u0638",\uFEC6:"\u0638",\uFEC5:"\u0638",\uFCB9:"\u0638\u0645",\uFD3B:"\u0638\u0645",\uFC28:"\u0638\u0645","\u060F":"\u0639","\u{1EE0F}":"\u0639","\u{1EE2F}":"\u0639","\u{1EE4F}":"\u0639","\u{1EE6F}":"\u0639","\u{1EE8F}":"\u0639","\u{1EEAF}":"\u0639",\uFECB:"\u0639",\uFECC:"\u0639",\uFECA:"\u0639",\uFEC9:"\u0639",\uFCBA:"\u0639\u062C",\uFC29:"\u0639\u062C",\uFDC4:"\u0639\u062C\u0645",\uFD75:"\u0639\u062C\u0645",\uFDF7:"\u0639\u0644\u0649o",\uFCBB:"\u0639\u0645",\uFC2A:"\u0639\u0645",\uFD77:"\u0639\u0645\u0645",\uFD76:"\u0639\u0645\u0645",\uFD78:"\u0639\u0645\u0649",\uFDB6:"\u0639\u0645\u0649",\uFD13:"\u0639\u0649",\uFCF7:"\u0639\u0649",\uFD14:"\u0639\u0649",\uFCF8:"\u0639\u0649","\u{1EE1B}":"\u063A","\u{1EE3B}":"\u063A","\u{1EE5B}":"\u063A","\u{1EE7B}":"\u063A","\u{1EE9B}":"\u063A","\u{1EEBB}":"\u063A",\uFECF:"\u063A",\uFED0:"\u063A",\uFECE:"\u063A",\uFECD:"\u063A",\uFCBC:"\u063A\u062C",\uFC2B:"\u063A\u062C",\uFCBD:"\u063A\u0645",\uFC2C:"\u063A\u0645",\uFD79:"\u063A\u0645\u0645",\uFD7B:"\u063A\u0645\u0649",\uFD7A:"\u063A\u0645\u0649",\uFD15:"\u063A\u0649",\uFCF9:"\u063A\u0649",\uFD16:"\u063A\u0649",\uFCFA:"\u063A\u0649","\u{1EE10}":"\u0641","\u{1EE30}":"\u0641","\u{1EE70}":"\u0641","\u{1EE90}":"\u0641","\u{1EEB0}":"\u0641",\uFED3:"\u0641",\uFED4:"\u0641",\uFED2:"\u0641",\uFED1:"\u0641",\u06A7:"\u0641",\uFCBE:"\u0641\u062C",\uFC2D:"\u0641\u062C",\uFCBF:"\u0641\u062D",\uFC2E:"\u0641\u062D",\uFCC0:"\u0641\u062E",\uFC2F:"\u0641\u062E",\uFD7D:"\u0641\u062E\u0645",\uFD7C:"\u0641\u062E\u0645",\uFCC1:"\u0641\u0645",\uFC30:"\u0641\u0645",\uFDC1:"\u0641\u0645\u0649",\uFC7C:"\u0641\u0649",\uFC31:"\u0641\u0649",\uFC7D:"\u0641\u0649",\uFC32:"\u0641\u0649","\u{1EE1E}":"\u06A1","\u{1EE7E}":"\u06A1","\u08BB":"\u06A1","\u066F":"\u06A1","\u{1EE1F}":"\u06A1","\u{1EE5F}":"\u06A1","\u08BC":"\u06A1",\u06A4:"\u06A1\u06DB",\uFB6C:"\u06A1\u06DB",\uFB6D:"\u06A1\u06DB",\uFB6B:"\u06A1\u06DB",\uFB6A:"\u06A1\u06DB",\u06A8:"\u06A1\u06DB","\u08A4":"\u06A2\u06DB",\uFB70:"\u06A6",\uFB71:"\u06A6",\uFB6F:"\u06A6",\uFB6E:"\u06A6","\u{1EE12}":"\u0642","\u{1EE32}":"\u0642","\u{1EE52}":"\u0642","\u{1EE72}":"\u0642","\u{1EE92}":"\u0642","\u{1EEB2}":"\u0642",\uFED7:"\u0642",\uFED8:"\u0642",\uFED6:"\u0642",\uFED5:"\u0642",\uFCC2:"\u0642\u062D",\uFC33:"\u0642\u062D",\uFDF1:"\u0642\u0644\u0649",\uFCC3:"\u0642\u0645",\uFC34:"\u0642\u0645",\uFDB4:"\u0642\u0645\u062D",\uFD7E:"\u0642\u0645\u062D",\uFD7F:"\u0642\u0645\u0645",\uFDB2:"\u0642\u0645\u0649",\uFC7E:"\u0642\u0649",\uFC35:"\u0642\u0649",\uFC7F:"\u0642\u0649",\uFC36:"\u0642\u0649","\u{1EE0A}":"\u0643","\u{1EE2A}":"\u0643","\u{1EE6A}":"\u0643",\uFEDB:"\u0643",\uFEDC:"\u0643",\uFEDA:"\u0643",\uFED9:"\u0643",\u06A9:"\u0643",\uFB90:"\u0643",\uFB91:"\u0643",\uFB8F:"\u0643",\uFB8E:"\u0643",\u06AA:"\u0643",\u06AD:"\u0643\u06DB",\uFBD5:"\u0643\u06DB",\uFBD6:"\u0643\u06DB",\uFBD4:"\u0643\u06DB",\uFBD3:"\u0643\u06DB","\u0763":"\u0643\u06DB",\uFC80:"\u0643l",\uFC37:"\u0643l",\uFCC4:"\u0643\u062C",\uFC38:"\u0643\u062C",\uFCC5:"\u0643\u062D",\uFC39:"\u0643\u062D",\uFCC6:"\u0643\u062E",\uFC3A:"\u0643\u062E",\uFCC7:"\u0643\u0644",\uFCEB:"\u0643\u0644",\uFC81:"\u0643\u0644",\uFC3B:"\u0643\u0644",\uFCC8:"\u0643\u0645",\uFCEC:"\u0643\u0645",\uFC82:"\u0643\u0645",\uFC3C:"\u0643\u0645",\uFDC3:"\u0643\u0645\u0645",\uFDBB:"\u0643\u0645\u0645",\uFDB7:"\u0643\u0645\u0649",\uFC83:"\u0643\u0649",\uFC3D:"\u0643\u0649",\uFC84:"\u0643\u0649",\uFC3E:"\u0643\u0649","\u0762":"\u06AC",\uFB94:"\u06AF",\uFB95:"\u06AF",\uFB93:"\u06AF",\uFB92:"\u06AF","\u08B0":"\u06AF",\u06B4:"\u06AF\u06DB",\uFB9C:"\u06B1",\uFB9D:"\u06B1",\uFB9B:"\u06B1",\uFB9A:"\u06B1",\uFB98:"\u06B3",\uFB99:"\u06B3",\uFB97:"\u06B3",\uFB96:"\u06B3","\u{1EE0B}":"\u0644","\u{1EE2B}":"\u0644","\u{1EE4B}":"\u0644","\u{1EE8B}":"\u0644","\u{1EEAB}":"\u0644",\uFEDF:"\u0644",\uFEE0:"\u0644",\uFEDE:"\u0644",\uFEDD:"\u0644",\u06B7:"\u0644\u06DB",\u06B5:"\u0644\u0306",\uFEFC:"\u0644l",\uFEFB:"\u0644l",\uFEFA:"\u0644l\u0655",\uFEF9:"\u0644l\u0655",\uFEF8:"\u0644l\u0674",\uFEF7:"\u0644l\u0674",\uFCCD:"\u0644o",\uFEF6:"\u0644\u0622",\uFEF5:"\u0644\u0622",\uFCC9:"\u0644\u062C",\uFC3F:"\u0644\u062C",\uFD83:"\u0644\u062C\u062C",\uFD84:"\u0644\u062C\u062C",\uFDBA:"\u0644\u062C\u0645",\uFDBC:"\u0644\u062C\u0645",\uFDAC:"\u0644\u062C\u0649",\uFCCA:"\u0644\u062D",\uFC40:"\u0644\u062D",\uFDB5:"\u0644\u062D\u0645",\uFD80:"\u0644\u062D\u0645",\uFD82:"\u0644\u062D\u0649",\uFD81:"\u0644\u062D\u0649",\uFCCB:"\u0644\u062E",\uFC41:"\u0644\u062E",\uFD86:"\u0644\u062E\u0645",\uFD85:"\u0644\u062E\u0645",\uFCCC:"\u0644\u0645",\uFCED:"\u0644\u0645",\uFC85:"\u0644\u0645",\uFC42:"\u0644\u0645",\uFD88:"\u0644\u0645\u062D",\uFD87:"\u0644\u0645\u062D",\uFDAD:"\u0644\u0645\u0649",\uFC86:"\u0644\u0649",\uFC43:"\u0644\u0649",\uFC87:"\u0644\u0649",\uFC44:"\u0644\u0649","\u{1EE0C}":"\u0645","\u{1EE2C}":"\u0645","\u{1EE6C}":"\u0645","\u{1EE8C}":"\u0645","\u{1EEAC}":"\u0645",\uFEE3:"\u0645",\uFEE4:"\u0645",\uFEE2:"\u0645",\uFEE1:"\u0645","\u08A7":"\u0645\u06DB","\u06FE":"\u0645\u0348",\uFC88:"\u0645l",\uFCCE:"\u0645\u062C",\uFC45:"\u0645\u062C",\uFD8C:"\u0645\u062C\u062D",\uFD92:"\u0645\u062C\u062E",\uFD8D:"\u0645\u062C\u0645",\uFDC0:"\u0645\u062C\u0649",\uFCCF:"\u0645\u062D",\uFC46:"\u0645\u062D",\uFD89:"\u0645\u062D\u062C",\uFD8A:"\u0645\u062D\u0645",\uFDF4:"\u0645\u062D\u0645\u062F",\uFD8B:"\u0645\u062D\u0649",\uFCD0:"\u0645\u062E",\uFC47:"\u0645\u062E",\uFD8E:"\u0645\u062E\u062C",\uFD8F:"\u0645\u062E\u0645",\uFDB9:"\u0645\u062E\u0649",\uFCD1:"\u0645\u0645",\uFC89:"\u0645\u0645",\uFC48:"\u0645\u0645",\uFDB1:"\u0645\u0645\u0649",\uFC49:"\u0645\u0649",\uFC4A:"\u0645\u0649","\u{1EE0D}":"\u0646","\u{1EE2D}":"\u0646","\u{1EE4D}":"\u0646","\u{1EE6D}":"\u0646","\u{1EE8D}":"\u0646","\u{1EEAD}":"\u0646",\uFEE7:"\u0646",\uFEE8:"\u0646",\uFEE6:"\u0646",\uFEE5:"\u0646","\u0768":"\u0646\u0615","\u0769":"\u0646\u0306",\uFCD6:"\u0646o",\uFCEF:"\u0646o",\uFDB8:"\u0646\u062C\u062D",\uFDBD:"\u0646\u062C\u062D",\uFD98:"\u0646\u062C\u0645",\uFD97:"\u0646\u062C\u0645",\uFD99:"\u0646\u062C\u0649",\uFDC7:"\u0646\u062C\u0649",\uFCD3:"\u0646\u062D",\uFC4C:"\u0646\u062D",\uFD95:"\u0646\u062D\u0645",\uFD96:"\u0646\u062D\u0649",\uFDB3:"\u0646\u062D\u0649",\uFCD4:"\u0646\u062E",\uFC4D:"\u0646\u062E",\uFC8A:"\u0646\u0631",\uFC8B:"\u0646\u0632",\uFCD5:"\u0646\u0645",\uFCEE:"\u0646\u0645",\uFC8C:"\u0646\u0645",\uFC4E:"\u0646\u0645",\uFD9B:"\u0646\u0645\u0649",\uFD9A:"\u0646\u0645\u0649",\uFC8D:"\u0646\u0646",\uFC8E:"\u0646\u0649",\uFC4F:"\u0646\u0649",\uFC8F:"\u0646\u0649",\uFC50:"\u0646\u0649",\u06C2:"\u06C0",\uFBA5:"\u06C0",\uFBA4:"\u06C0","\u{102E4}":"\u0648","\u{1EE05}":"\u0648","\u{1EE85}":"\u0648","\u{1EEA5}":"\u0648",\uFEEE:"\u0648",\uFEED:"\u0648","\u08B1":"\u0648",\u06CB:"\u0648\u06DB",\uFBDF:"\u0648\u06DB",\uFBDE:"\u0648\u06DB",\u06C7:"\u0648\u0313",\uFBD8:"\u0648\u0313",\uFBD7:"\u0648\u0313",\u06C6:"\u0648\u0306",\uFBDA:"\u0648\u0306",\uFBD9:"\u0648\u0306",\u06C9:"\u0648\u0302",\uFBE3:"\u0648\u0302",\uFBE2:"\u0648\u0302",\u06C8:"\u0648\u0670",\uFBDC:"\u0648\u0670",\uFBDB:"\u0648\u0670",\u0624:"\u0648\u0674",\uFE86:"\u0648\u0674",\uFE85:"\u0648\u0674",\u0676:"\u0648\u0674",\u0677:"\u0648\u0313\u0674",\uFBDD:"\u0648\u0313\u0674",\uFDF8:"\u0648\u0633\u0644\u0645",\uFBE1:"\u06C5",\uFBE0:"\u06C5","\u066E":"\u0649","\u{1EE1C}":"\u0649","\u{1EE7C}":"\u0649",\u06BA:"\u0649","\u{1EE1D}":"\u0649","\u{1EE5D}":"\u0649",\uFB9F:"\u0649",\uFB9E:"\u0649","\u08BD":"\u0649",\uFBE8:"\u0649",\uFBE9:"\u0649",\uFEF0:"\u0649",\uFEEF:"\u0649",\u064A:"\u0649","\u{1EE09}":"\u0649","\u{1EE29}":"\u0649","\u{1EE49}":"\u0649","\u{1EE69}":"\u0649","\u{1EE89}":"\u0649","\u{1EEA9}":"\u0649",\uFEF3:"\u0649",\uFEF4:"\u0649",\uFEF2:"\u0649",\uFEF1:"\u0649",\u06CC:"\u0649",\uFBFE:"\u0649",\uFBFF:"\u0649",\uFBFD:"\u0649",\uFBFC:"\u0649",\u06D2:"\u0649",\uFBAF:"\u0649",\uFBAE:"\u0649",\u0679:"\u0649\u0615",\uFB68:"\u0649\u0615",\uFB69:"\u0649\u0615",\uFB67:"\u0649\u0615",\uFB66:"\u0649\u0615",\u06BB:"\u0649\u0615",\uFBA2:"\u0649\u0615",\uFBA3:"\u0649\u0615",\uFBA1:"\u0649\u0615",\uFBA0:"\u0649\u0615",\u067E:"\u0649\u06DB",\uFB58:"\u0649\u06DB",\uFB59:"\u0649\u06DB",\uFB57:"\u0649\u06DB",\uFB56:"\u0649\u06DB",\u062B:"\u0649\u06DB","\u{1EE16}":"\u0649\u06DB","\u{1EE36}":"\u0649\u06DB","\u{1EE76}":"\u0649\u06DB","\u{1EE96}":"\u0649\u06DB","\u{1EEB6}":"\u0649\u06DB",\uFE9B:"\u0649\u06DB",\uFE9C:"\u0649\u06DB",\uFE9A:"\u0649\u06DB",\uFE99:"\u0649\u06DB",\u06BD:"\u0649\u06DB",\u06D1:"\u0649\u06DB","\u063F":"\u0649\u06DB","\u08B7":"\u0649\u06DB\u06E2","\u0756":"\u0649\u0306",\u06CE:"\u0649\u0306","\u08BA":"\u0649\u0306\u0307","\u063D":"\u0649\u0302","\u08A8":"\u0649\u0654",\uFC90:"\u0649\u0670",\uFC5D:"\u0649\u0670",\uFCDE:"\u0649o",\uFCF1:"\u0649o",\uFCE6:"\u0649\u06DBo",\u0626:"\u0649\u0674",\uFE8B:"\u0649\u0674",\uFE8C:"\u0649\u0674",\uFE8A:"\u0649\u0674",\uFE89:"\u0649\u0674",\u0678:"\u0649\u0674",\uFBEB:"\u0649\u0674l",\uFBEA:"\u0649\u0674l",\uFC9B:"\u0649\u0674o",\uFCE0:"\u0649\u0674o",\uFBED:"\u0649\u0674o",\uFBEC:"\u0649\u0674o",\uFBF8:"\u0649\u0674\u067B",\uFBF7:"\u0649\u0674\u067B",\uFBF6:"\u0649\u0674\u067B",\uFC97:"\u0649\u0674\u062C",\uFC00:"\u0649\u0674\u062C",\uFC98:"\u0649\u0674\u062D",\uFC01:"\u0649\u0674\u062D",\uFC99:"\u0649\u0674\u062E",\uFC64:"\u0649\u0674\u0631",\uFC65:"\u0649\u0674\u0632",\uFC9A:"\u0649\u0674\u0645",\uFCDF:"\u0649\u0674\u0645",\uFC66:"\u0649\u0674\u0645",\uFC02:"\u0649\u0674\u0645",\uFC67:"\u0649\u0674\u0646",\uFBEF:"\u0649\u0674\u0648",\uFBEE:"\u0649\u0674\u0648",\uFBF1:"\u0649\u0674\u0648\u0313",\uFBF0:"\u0649\u0674\u0648\u0313",\uFBF3:"\u0649\u0674\u0648\u0306",\uFBF2:"\u0649\u0674\u0648\u0306",\uFBF5:"\u0649\u0674\u0648\u0670",\uFBF4:"\u0649\u0674\u0648\u0670",\uFBFB:"\u0649\u0674\u0649",\uFBFA:"\u0649\u0674\u0649",\uFC68:"\u0649\u0674\u0649",\uFBF9:"\u0649\u0674\u0649",\uFC03:"\u0649\u0674\u0649",\uFC69:"\u0649\u0674\u0649",\uFC04:"\u0649\u0674\u0649",\uFCDA:"\u0649\u062C",\uFC55:"\u0649\u062C",\uFC11:"\u0649\u06DB\u062C",\uFDAF:"\u0649\u062C\u0649",\uFCDB:"\u0649\u062D",\uFC56:"\u0649\u062D",\uFDAE:"\u0649\u062D\u0649",\uFCDC:"\u0649\u062E",\uFC57:"\u0649\u062E",\uFC91:"\u0649\u0631",\uFC76:"\u0649\u06DB\u0631",\uFC92:"\u0649\u0632",\uFC77:"\u0649\u06DB\u0632",\uFCDD:"\u0649\u0645",\uFCF0:"\u0649\u0645",\uFC93:"\u0649\u0645",\uFC58:"\u0649\u0645",\uFCA6:"\u0649\u06DB\u0645",\uFCE5:"\u0649\u06DB\u0645",\uFC78:"\u0649\u06DB\u0645",\uFC12:"\u0649\u06DB\u0645",\uFD9D:"\u0649\u0645\u0645",\uFD9C:"\u0649\u0645\u0645",\uFDB0:"\u0649\u0645\u0649",\uFC94:"\u0649\u0646",\uFC79:"\u0649\u06DB\u0646",\uFC95:"\u0649\u0649",\uFC59:"\u0649\u0649",\uFC96:"\u0649\u0649",\uFC5A:"\u0649\u0649",\uFC7A:"\u0649\u06DB\u0649",\uFC13:"\u0649\u06DB\u0649",\uFC7B:"\u0649\u06DB\u0649",\uFC14:"\u0649\u06DB\u0649",\uFBB1:"\u06D3",\uFBB0:"\u06D3","\u{102B8}":"\u2D40","\u205E":"\u2D42","\u2E3D":"\u2D42","\u2999":"\u2D42","\uFE19":"\u2D57","\u205D":"\u2D57","\u22EE":"\u2D57",\u0544:"\u1206",\u054C:"\u1261",\u053B:"\u12AE",\u054A:"\u1323",\u0906:"\u0905\u093E",\u0912:"\u0905\u093E\u0946",\u0913:"\u0905\u093E\u0947",\u0914:"\u0905\u093E\u0948","\u0904":"\u0905\u0946",\u0911:"\u0905\u0949",\u090D:"\u090F\u0945",\u090E:"\u090F\u0946",\u0910:"\u090F\u0947",\u0908:"\u0930\u094D\u0907",\u0ABD:"\u093D","\u{111DC}":"\uA8FB","\u{111CB}":"\u093A","\u0AC1":"\u0941","\u0AC2":"\u0942","\u0A4B":"\u0946","\u0A4D":"\u094D","\u0ACD":"\u094D",\u0986:"\u0985\u09BE",\u09E0:"\u098B\u09C3",\u09E1:"\u098B\u09C3","\u{11492}":"\u0998","\u{11494}":"\u099A","\u{11496}":"\u099C","\u{11498}":"\u099E","\u{11499}":"\u099F","\u{1149B}":"\u09A1","\u{114AA}":"\u09A3","\u{1149E}":"\u09A4","\u{1149F}":"\u09A5","\u{114A0}":"\u09A6","\u{114A1}":"\u09A7","\u{114A2}":"\u09A8","\u{114A3}":"\u09AA","\u{114A9}":"\u09AC","\u{114A7}":"\u09AE","\u{114A8}":"\u09AF","\u{114AB}":"\u09B0","\u{1149D}":"\u09B2","\u{114AD}":"\u09B7","\u{114AE}":"\u09B8","\u{114C4}":"\u09BD","\u{114B0}":"\u09BE","\u{114B1}":"\u09BF","\u{114B9}":"\u09C7","\u{114BC}":"\u09CB","\u{114BE}":"\u09CC","\u{114C2}":"\u09CD","\u{114BD}":"\u09D7",\u0A09:"\u0A73\u0A41",\u0A0A:"\u0A73\u0A42",\u0A06:"\u0A05\u0A3E",\u0A10:"\u0A05\u0A48",\u0A14:"\u0A05\u0A4C",\u0A07:"\u0A72\u0A3F",\u0A08:"\u0A72\u0A40",\u0A0F:"\u0A72\u0A47",\u0A86:"\u0A85\u0ABE",\u0A91:"\u0A85\u0ABE\u0AC5",\u0A93:"\u0A85\u0ABE\u0AC7",\u0A94:"\u0A85\u0ABE\u0AC8",\u0A8D:"\u0A85\u0AC5",\u0A8F:"\u0A85\u0AC7",\u0A90:"\u0A85\u0AC8",\u0B06:"\u0B05\u0B3E","\u0BEE":"\u0B85",\u0BB0:"\u0B88","\u0BBE":"\u0B88","\u0BEB":"\u0B88\u0BC1","\u0BE8":"\u0B89",\u0D09:"\u0B89",\u0B8A:"\u0B89\u0BB3",\u0D0A:"\u0B89\u0D57","\u0BED":"\u0B8E","\u0BF7":"\u0B8E\u0BB5",\u0B9C:"\u0B90",\u0D1C:"\u0B90","\u0BE7":"\u0B95","\u0BEA":"\u0B9A","\u0BEC":"\u0B9A\u0BC1","\u0BF2":"\u0B9A\u0BC2","\u0D3A":"\u0B9F\u0BBF",\u0D23:"\u0BA3","\u0BFA":"\u0BA8\u0BC0","\u0BF4":"\u0BAE\u0BC0","\u0BF0":"\u0BAF",\u0D34:"\u0BB4","\u0BD7":"\u0BB3","\u0BC8":"\u0BA9",\u0D36:"\u0BB6","\u0BF8":"\u0BB7","\u0D3F":"\u0BBF","\u0D40":"\u0BBF","\u0BCA":"\u0BC6\u0B88","\u0BCC":"\u0BC6\u0BB3","\u0BCB":"\u0BC7\u0B88",\u0C85:"\u0C05",\u0C86:"\u0C06",\u0C87:"\u0C07",\u0C60:"\u0C0B\u0C3E",\u0C61:"\u0C0C\u0C3E",\u0C92:"\u0C12",\u0C14:"\u0C12\u0C4C",\u0C94:"\u0C12\u0C4C",\u0C13:"\u0C12\u0C55",\u0C93:"\u0C12\u0C55",\u0C9C:"\u0C1C",\u0C9E:"\u0C1E",\u0C22:"\u0C21\u0323",\u0CA3:"\u0C23",\u0C25:"\u0C27\u05BC",\u0C2D:"\u0C2C\u0323",\u0CAF:"\u0C2F",\u0C20:"\u0C30\u05BC",\u0CB1:"\u0C31",\u0CB2:"\u0C32",\u0C37:"\u0C35\u0323",\u0C39:"\u0C35\u0C3E",\u0C2E:"\u0C35\u0C41","\u0C42":"\u0C41\u0C3E","\u0C44":"\u0C43\u0C3E",\u0CE1:"\u0C8C\u0CBE",\u0D08:"\u0D07\u0D57",\u0D10:"\u0D0E\u0D46",\u0D13:"\u0D12\u0D3E",\u0D14:"\u0D12\u0D57",\u0D61:"\u0D1E","\u0D6B":"\u0D26\u0D4D\u0D30","\u0D79":"\u0D28\u0D41",\u0D0C:"\u0D28\u0D41",\u0D19:"\u0D28\u0D41","\u0D6F":"\u0D28\u0D4D","\u0D7B":"\u0D28\u0D4D","\u0D6C":"\u0D28\u0D4D\u0D28","\u0D5A":"\u0D28\u0D4D\u0D2E",\u0D31:"\u0D30","\u0D6A":"\u0D30\u0D4D","\u0D7C":"\u0D30\u0D4D","\u0D6E":"\u0D35\u0D4D\u0D30","\u0D76":"\u0D39\u0D4D\u0D2E","\u0D42":"\u0D41","\u0D43":"\u0D41","\u0D48":"\u0D46\u0D46","\u0DEA":"\u0DA2","\u0DEB":"\u0DAF","\u{11413}":"\u{11434}\u{11442}\u{11412}","\u{11419}":"\u{11434}\u{11442}\u{11418}","\u{11424}":"\u{11434}\u{11442}\u{11423}","\u{1142A}":"\u{11434}\u{11442}\u{11429}","\u{1142D}":"\u{11434}\u{11442}\u{1142C}","\u{1142F}":"\u{11434}\u{11442}\u{1142E}","\u{115D8}":"\u{11582}","\u{115D9}":"\u{11582}","\u{115DA}":"\u{11583}","\u{115DB}":"\u{11584}","\u{115DC}":"\u{115B2}","\u{115DD}":"\u{115B3}",\u0E03:"\u0E02",\u0E14:"\u0E04",\u0E15:"\u0E04",\u0E21:"\u0E06",\u0E88:"\u0E08",\u0E0B:"\u0E0A",\u0E0F:"\u0E0E",\u0E17:"\u0E11",\u0E9A:"\u0E1A",\u0E9B:"\u0E1B",\u0E9D:"\u0E1D",\u0E9E:"\u0E1E",\u0E9F:"\u0E1F",\u0E26:"\u0E20",\u0E8D:"\u0E22","\u17D4":"\u0E2F",\u0E45:"\u0E32",\u0E33:"\u030A\u0E32","\u17B7":"\u0E34","\u17B8":"\u0E35","\u17B9":"\u0E36","\u17BA":"\u0E37","\u0EB8":"\u0E38","\u0EB9":"\u0E39",\u0E41:"\u0E40\u0E40",\u0EDC:"\u0EAB\u0E99",\u0EDD:"\u0EAB\u0EA1",\u0EB3:"\u030A\u0EB2","\u0F02":"\u0F60\u0F74\u0F82\u0F7F","\u0F03":"\u0F60\u0F74\u0F82\u0F14",\u0F6A:"\u0F62",\u0F00:"\u0F68\u0F7C\u0F7E","\u0F77":"\u0FB2\u0F71\u0F80","\u0F79":"\u0FB3\u0F71\u0F80","\u{11CB2}":"\u{11CAA}","\u1081":"\u1002\u103E",\u1000:"\u1002\u102C","\u1070":"\u1003\u103E","\u1066":"\u1015\u103E",\u101F:"\u1015\u102C","\u106F":"\u1015\u102C\u103E","\u107E":"\u107D\u103E",\u1029:"\u101E\u103C",\u102A:"\u101E\u103C\u1031\u102C\u103A","\u109E":"\u1083\u030A",\u17A3:"\u17A2","\u19D0":"\u199E","\u19D1":"\u19B1","\u1A80":"\u1A45","\u1A90":"\u1A45","\uAA53":"\uAA01","\uAA56":"\uAA23","\u1B52":"\u1B0D","\u1B53":"\u1B11","\u1B58":"\u1B28","\uA9A3":"\uA99D",\u1896:"\u185C",\u1855:"\u1835",\u1FF6:"\u13EF",\u140D:"\u1401\xB7",\u142B:"\u1401\u1420",\u1411:"\u1404\xB7",\u1413:"\u1405\xB7",\u142D:"\u1405\u1420",\u1415:"\u1406\xB7",\u1418:"\u140A\xB7",\u142E:"\u140A\u1420",\u141A:"\u140B\xB7","\u18DD":"\u141E\u18DF",\u14D1:"\u1421",\u1540:"\u1429",\u143F:"\u1432\xB7",\u1443:"\u1434\xB7","\u2369":"\u1435",\u1447:"\u1439\xB7",\u145C:"\u144F\xB7","\u2E27":"\u1450","\u2283":"\u1450",\u145E:"\u1450\xB7",\u1469:"\u1450'","\u27C9":"\u1450/","\u2AD7":"\u1450\u1455",\u1460:"\u1451\xB7","\u2E26":"\u1455","\u2282":"\u1455",\u1462:"\u1455\xB7",\u146A:"\u1455'",\u1464:"\u1456\xB7",\u1475:"\u146B\xB7",\u1485:"\u146B'",\u1479:"\u146E\xB7",\u147D:"\u1470\xB7",\u1603:"\u1489",\u1493:"\u1489\xB7",\u1495:"\u148B\xB7",\u1497:"\u148C\xB7",\u149B:"\u148E\xB7",\u1602:"\u1490",\u149D:"\u1490\xB7",\u149F:"\u1491\xB7",\u14AD:"\u14A3\xB7",\u14B1:"\u14A6\xB7",\u14B3:"\u14A7\xB7",\u14B5:"\u14A8\xB7",\u14B9:"\u14AB\xB7",\u14CA:"\u14C0\xB7","\u18C7":"\u14C2\xB7","\u18C9":"\u14C3\xB7","\u18CB":"\u14C4\xB7","\u18CD":"\u14C5\xB7",\u14CC:"\u14C7\xB7",\u14CE:"\u14C8\xB7",\u1604:"\u14D3",\u14DD:"\u14D3\xB7",\u14DF:"\u14D5\xB7",\u14E1:"\u14D6\xB7",\u14E3:"\u14D7\xB7",\u14E5:"\u14D8\xB7",\u1607:"\u14DA",\u14E7:"\u14DA\xB7",\u14E9:"\u14DB\xB7",\u14F7:"\u14ED\xB7",\u14F9:"\u14EF\xB7",\u14FB:"\u14F0\xB7",\u14FD:"\u14F1\xB7",\u14FF:"\u14F2\xB7",\u1501:"\u14F4\xB7",\u1503:"\u14F5\xB7",\u150C:"\u150B<",\u150E:"\u150Bb",\u150D:"\u150B\u1455",\u150F:"\u150B\u1490",\u1518:"\u1510\xB7",\u151A:"\u1511\xB7",\u151C:"\u1512\xB7",\u151E:"\u1513\xB7",\u1520:"\u1514\xB7",\u1522:"\u1515\xB7",\u1524:"\u1516\xB7",\u1532:"\u1528\xB7",\u1534:"\u1529\xB7",\u1536:"\u152A\xB7",\u1538:"\u152B\xB7",\u153A:"\u152D\xB7",\u153C:"\u152E\xB7",\u1622:"\u1543","\u18E0":"\u1543\xB7",\u1623:"\u1546",\u1624:"\u154A",\u154F:"\u154C\xB7",\u1583:"\u1550b",\u1584:"\u1550b\u0307",\u1581:"\u1550d",\u157F:"\u1550P",\u166F:"\u1550\u146B",\u157E:"\u1550\u146C",\u1580:"\u1550\u146E",\u1582:"\u1550\u1470",\u1585:"\u1550\u1483",\u155C:"\u155A\xB7","\u18E3":"\u155E\xB7","\u18E4":"\u1566\xB7",\u1569:"\u1567\xB7","\u18E5":"\u156B\xB7","\u18E8":"\u1586\xB7",\u1591:"\u1595J",\u1670:"\u1595\u1489",\u158E:"\u1595\u148A",\u158F:"\u1595\u148B",\u1590:"\u1595\u148C",\u1592:"\u1595\u148E",\u1593:"\u1595\u1490",\u1594:"\u1595\u1491",\u1673:"\u1596J",\u1671:"\u1596\u148B",\u1672:"\u1596\u148C",\u1674:"\u1596\u148E",\u1675:"\u1596\u1490",\u1676:"\u1596\u1491","\u18EA":"\u1597\xB7","\u1677":"\u15A7\xB7","\u1678":"\u15A8\xB7","\u1679":"\u15A9\xB7","\u167A":"\u15AA\xB7","\u167B":"\u15AB\xB7","\u167C":"\u15AC\xB7","\u167D":"\u15AD\xB7","\u2AAB":"\u15D2","\u2AAA":"\u15D5","\uA4F7":"\u15E1","\u18F0":"\u15F4\xB7","\u18F2":"\u161B\xB7","\u1DBB":"\u1646","\uA4ED":"\u1660","\u1DBA":"\u18D4","\u1D3E":"\u18D6","\u18DC":"\u18DF\u141E",\u02E1:"\u18F3",\u02B3:"\u18F4",\u02E2:"\u18F5","\u18DB":"\u18F5","\uA6B0":"\u16B9",\u16E1:"\u16BC","\u237F":"\u16BD",\u16C2:"\u16BD","\u{1D23F}":"\u16CB","\u2191":"\u16CF","\u21BF":"\u16D0","\u296E":"\u16D0\u21C2","\u2963":"\u16D0\u16DA","\u2D63":"\u16EF","\u21BE":"\u16DA","\u2A21":"\u16DA","\u22C4":"\u16DC","\u25C7":"\u16DC","\u25CA":"\u16DC","\u2662":"\u16DC","\u{1F754}":"\u16DC","\u{118B7}":"\u16DC","\u{10294}":"\u16DC","\u235A":"\u16DC\u0332","\u22C8":"\u16DE","\u2A1D":"\u16DE","\u{104D0}":"\u16E6","\u2195":"\u16E8","\u{10CFC}":"\u{10C82}","\u{10CFA}":"\u{10CA5}",\u3131:"\u1100",\u11A8:"\u1100",\u1101:"\u1100\u1100",\u3132:"\u1100\u1100",\u11A9:"\u1100\u1100","\u11FA":"\u1100\u1102","\u115A":"\u1100\u1103",\u11C3:"\u1100\u1105","\u11FB":"\u1100\u1107",\u11AA:"\u1100\u1109",\u3133:"\u1100\u1109",\u11C4:"\u1100\u1109\u1100","\u11FC":"\u1100\u110E","\u11FD":"\u1100\u110F","\u11FE":"\u1100\u1112",\u3134:"\u1102",\u11AB:"\u1102",\u1113:"\u1102\u1100",\u11C5:"\u1102\u1100",\u1114:"\u1102\u1102",\u3165:"\u1102\u1102","\u11FF":"\u1102\u1102",\u1115:"\u1102\u1103",\u3166:"\u1102\u1103",\u11C6:"\u1102\u1103","\uD7CB":"\u1102\u1105",\u1116:"\u1102\u1107","\u115B":"\u1102\u1109",\u11C7:"\u1102\u1109",\u3167:"\u1102\u1109","\u115C":"\u1102\u110C",\u11AC:"\u1102\u110C",\u3135:"\u1102\u110C","\uD7CC":"\u1102\u110E",\u11C9:"\u1102\u1110","\u115D":"\u1102\u1112",\u11AD:"\u1102\u1112",\u3136:"\u1102\u1112",\u11C8:"\u1102\u1140",\u3168:"\u1102\u1140",\u3137:"\u1103",\u11AE:"\u1103",\u1117:"\u1103\u1100",\u11CA:"\u1103\u1100",\u1104:"\u1103\u1103",\u3138:"\u1103\u1103","\uD7CD":"\u1103\u1103","\uD7CE":"\u1103\u1103\u1107","\u115E":"\u1103\u1105",\u11CB:"\u1103\u1105","\uA960":"\u1103\u1106","\uA961":"\u1103\u1107","\uD7CF":"\u1103\u1107","\uA962":"\u1103\u1109","\uD7D0":"\u1103\u1109","\uD7D1":"\u1103\u1109\u1100","\uA963":"\u1103\u110C","\uD7D2":"\u1103\u110C","\uD7D3":"\u1103\u110E","\uD7D4":"\u1103\u1110",\u3139:"\u1105",\u11AF:"\u1105","\uA964":"\u1105\u1100",\u11B0:"\u1105\u1100",\u313A:"\u1105\u1100","\uA965":"\u1105\u1100\u1100","\uD7D5":"\u1105\u1100\u1100",\u11CC:"\u1105\u1100\u1109",\u3169:"\u1105\u1100\u1109","\uD7D6":"\u1105\u1100\u1112",\u1118:"\u1105\u1102",\u11CD:"\u1105\u1102","\uA966":"\u1105\u1103",\u11CE:"\u1105\u1103",\u316A:"\u1105\u1103","\uA967":"\u1105\u1103\u1103",\u11CF:"\u1105\u1103\u1112",\u1119:"\u1105\u1105",\u11D0:"\u1105\u1105","\uD7D7":"\u1105\u1105\u110F","\uA968":"\u1105\u1106",\u11B1:"\u1105\u1106",\u313B:"\u1105\u1106",\u11D1:"\u1105\u1106\u1100",\u11D2:"\u1105\u1106\u1109","\uD7D8":"\u1105\u1106\u1112","\uA969":"\u1105\u1107",\u11B2:"\u1105\u1107",\u313C:"\u1105\u1107","\uD7D9":"\u1105\u1107\u1103","\uA96A":"\u1105\u1107\u1107",\u11D3:"\u1105\u1107\u1109",\u316B:"\u1105\u1107\u1109","\uA96B":"\u1105\u1107\u110B",\u11D5:"\u1105\u1107\u110B","\uD7DA":"\u1105\u1107\u1111",\u11D4:"\u1105\u1107\u1112","\uA96C":"\u1105\u1109",\u11B3:"\u1105\u1109",\u313D:"\u1105\u1109",\u11D6:"\u1105\u1109\u1109",\u111B:"\u1105\u110B","\uD7DD":"\u1105\u110B","\uA96D":"\u1105\u110C","\uA96E":"\u1105\u110F",\u11D8:"\u1105\u110F",\u11B4:"\u1105\u1110",\u313E:"\u1105\u1110",\u11B5:"\u1105\u1111",\u313F:"\u1105\u1111",\u111A:"\u1105\u1112",\u3140:"\u1105\u1112",\u113B:"\u1105\u1112",\u11B6:"\u1105\u1112","\uD7F2":"\u1105\u1112",\u11D7:"\u1105\u1140",\u316C:"\u1105\u1140","\uD7DB":"\u1105\u114C",\u11D9:"\u1105\u1159",\u316D:"\u1105\u1159","\uD7DC":"\u1105\u1159\u1112",\u3141:"\u1106",\u11B7:"\u1106","\uA96F":"\u1106\u1100",\u11DA:"\u1106\u1100","\uD7DE":"\u1106\u1102","\uD7DF":"\u1106\u1102\u1102","\uA970":"\u1106\u1103",\u11DB:"\u1106\u1105","\uD7E0":"\u1106\u1106",\u111C:"\u1106\u1107",\u316E:"\u1106\u1107",\u11DC:"\u1106\u1107","\uD7E1":"\u1106\u1107\u1109","\uA971":"\u1106\u1109",\u11DD:"\u1106\u1109",\u316F:"\u1106\u1109",\u11DE:"\u1106\u1109\u1109",\u111D:"\u1106\u110B",\u3171:"\u1106\u110B",\u11E2:"\u1106\u110B","\uD7E2":"\u1106\u110C",\u11E0:"\u1106\u110E",\u11E1:"\u1106\u1112",\u11DF:"\u1106\u1140",\u3170:"\u1106\u1140",\u3142:"\u1107",\u11B8:"\u1107",\u111E:"\u1107\u1100",\u3172:"\u1107\u1100",\u111F:"\u1107\u1102",\u1120:"\u1107\u1103",\u3173:"\u1107\u1103","\uD7E3":"\u1107\u1103",\u11E3:"\u1107\u1105","\uD7E4":"\u1107\u1105\u1111","\uD7E5":"\u1107\u1106",\u1108:"\u1107\u1107",\u3143:"\u1107\u1107","\uD7E6":"\u1107\u1107",\u112C:"\u1107\u1107\u110B",\u3179:"\u1107\u1107\u110B",\u1121:"\u1107\u1109",\u3144:"\u1107\u1109",\u11B9:"\u1107\u1109",\u1122:"\u1107\u1109\u1100",\u3174:"\u1107\u1109\u1100",\u1123:"\u1107\u1109\u1103",\u3175:"\u1107\u1109\u1103","\uD7E7":"\u1107\u1109\u1103",\u1124:"\u1107\u1109\u1107",\u1125:"\u1107\u1109\u1109",\u1126:"\u1107\u1109\u110C","\uA972":"\u1107\u1109\u1110",\u112B:"\u1107\u110B",\u3178:"\u1107\u110B",\u11E6:"\u1107\u110B",\u1127:"\u1107\u110C",\u3176:"\u1107\u110C","\uD7E8":"\u1107\u110C",\u1128:"\u1107\u110E","\uD7E9":"\u1107\u110E","\uA973":"\u1107\u110F",\u1129:"\u1107\u1110",\u3177:"\u1107\u1110",\u112A:"\u1107\u1111",\u11E4:"\u1107\u1111","\uA974":"\u1107\u1112",\u11E5:"\u1107\u1112",\u3145:"\u1109",\u11BA:"\u1109",\u112D:"\u1109\u1100",\u317A:"\u1109\u1100",\u11E7:"\u1109\u1100",\u112E:"\u1109\u1102",\u317B:"\u1109\u1102",\u112F:"\u1109\u1103",\u317C:"\u1109\u1103",\u11E8:"\u1109\u1103",\u1130:"\u1109\u1105",\u11E9:"\u1109\u1105",\u1131:"\u1109\u1106","\uD7EA":"\u1109\u1106",\u1132:"\u1109\u1107",\u317D:"\u1109\u1107",\u11EA:"\u1109\u1107",\u1133:"\u1109\u1107\u1100","\uD7EB":"\u1109\u1107\u110B",\u110A:"\u1109\u1109",\u3146:"\u1109\u1109",\u11BB:"\u1109\u1109","\uD7EC":"\u1109\u1109\u1100","\uD7ED":"\u1109\u1109\u1103","\uA975":"\u1109\u1109\u1107",\u1134:"\u1109\u1109\u1109",\u1135:"\u1109\u110B",\u1136:"\u1109\u110C",\u317E:"\u1109\u110C","\uD7EF":"\u1109\u110C",\u1137:"\u1109\u110E","\uD7F0":"\u1109\u110E",\u1138:"\u1109\u110F",\u1139:"\u1109\u1110","\uD7F1":"\u1109\u1110",\u113A:"\u1109\u1111","\uD7EE":"\u1109\u1140",\u3147:"\u110B",\u11BC:"\u110B",\u1141:"\u110B\u1100",\u11EC:"\u110B\u1100",\u11ED:"\u110B\u1100\u1100",\u1142:"\u110B\u1103","\uA976":"\u110B\u1105",\u1143:"\u110B\u1106",\u1144:"\u110B\u1107",\u1145:"\u110B\u1109",\u11F1:"\u110B\u1109",\u3182:"\u110B\u1109",\u1147:"\u110B\u110B",\u3180:"\u110B\u110B",\u11EE:"\u110B\u110B",\u1148:"\u110B\u110C",\u1149:"\u110B\u110E",\u11EF:"\u110B\u110F",\u114A:"\u110B\u1110",\u114B:"\u110B\u1111","\uA977":"\u110B\u1112",\u1146:"\u110B\u1140",\u11F2:"\u110B\u1140",\u3183:"\u110B\u1140",\u3148:"\u110C",\u11BD:"\u110C","\uD7F7":"\u110C\u1107","\uD7F8":"\u110C\u1107\u1107",\u114D:"\u110C\u110B",\u110D:"\u110C\u110C",\u3149:"\u110C\u110C","\uD7F9":"\u110C\u110C","\uA978":"\u110C\u110C\u1112",\u314A:"\u110E",\u11BE:"\u110E",\u1152:"\u110E\u110F",\u1153:"\u110E\u1112",\u314B:"\u110F",\u11BF:"\u110F",\u314C:"\u1110",\u11C0:"\u1110","\uA979":"\u1110\u1110",\u314D:"\u1111",\u11C1:"\u1111",\u1156:"\u1111\u1107",\u11F3:"\u1111\u1107","\uD7FA":"\u1111\u1109",\u1157:"\u1111\u110B",\u3184:"\u1111\u110B",\u11F4:"\u1111\u110B","\uD7FB":"\u1111\u1110","\uA97A":"\u1111\u1112",\u314E:"\u1112",\u11C2:"\u1112",\u11F5:"\u1112\u1102",\u11F6:"\u1112\u1105",\u11F7:"\u1112\u1106",\u11F8:"\u1112\u1107","\uA97B":"\u1112\u1109",\u1158:"\u1112\u1112",\u3185:"\u1112\u1112",\u113D:"\u113C\u113C",\u113F:"\u113E\u113E",\u317F:"\u1140",\u11EB:"\u1140","\uD7F3":"\u1140\u1107","\uD7F4":"\u1140\u1107\u110B",\u3181:"\u114C",\u11F0:"\u114C","\uD7F5":"\u114C\u1106","\uD7F6":"\u114C\u1112",\u114F:"\u114E\u114E",\u1151:"\u1150\u1150",\u3186:"\u1159",\u11F9:"\u1159","\uA97C":"\u1159\u1159",\u3164:"\u1160",\u314F:"\u1161","\u11A3":"\u1161\u30FC",\u1176:"\u1161\u1169",\u1177:"\u1161\u116E",\u1162:"\u1161\u4E28",\u3150:"\u1161\u4E28",\u3151:"\u1163",\u1178:"\u1163\u1169",\u1179:"\u1163\u116D","\u11A4":"\u1163\u116E",\u1164:"\u1163\u4E28",\u3152:"\u1163\u4E28",\u3153:"\u1165",\u117C:"\u1165\u30FC",\u117A:"\u1165\u1169",\u117B:"\u1165\u116E",\u1166:"\u1165\u4E28",\u3154:"\u1165\u4E28",\u3155:"\u1167","\u11A5":"\u1167\u1163",\u117D:"\u1167\u1169",\u117E:"\u1167\u116E",\u1168:"\u1167\u4E28",\u3156:"\u1167\u4E28",\u3157:"\u1169",\u116A:"\u1169\u1161",\u3158:"\u1169\u1161",\u116B:"\u1169\u1161\u4E28",\u3159:"\u1169\u1161\u4E28","\u11A6":"\u1169\u1163","\u11A7":"\u1169\u1163\u4E28",\u117F:"\u1169\u1165",\u1180:"\u1169\u1165\u4E28","\uD7B0":"\u1169\u1167",\u1181:"\u1169\u1167\u4E28",\u1182:"\u1169\u1169","\uD7B1":"\u1169\u1169\u4E28",\u1183:"\u1169\u116E",\u116C:"\u1169\u4E28",\u315A:"\u1169\u4E28",\u315B:"\u116D","\uD7B2":"\u116D\u1161","\uD7B3":"\u116D\u1161\u4E28",\u1184:"\u116D\u1163",\u3187:"\u116D\u1163",\u1186:"\u116D\u1163",\u1185:"\u116D\u1163\u4E28",\u3188:"\u116D\u1163\u4E28","\uD7B4":"\u116D\u1165",\u1187:"\u116D\u1169",\u1188:"\u116D\u4E28",\u3189:"\u116D\u4E28",\u315C:"\u116E",\u1189:"\u116E\u1161",\u118A:"\u116E\u1161\u4E28",\u116F:"\u116E\u1165",\u315D:"\u116E\u1165",\u118B:"\u116E\u1165\u30FC",\u1170:"\u116E\u1165\u4E28",\u315E:"\u116E\u1165\u4E28","\uD7B5":"\u116E\u1167",\u118C:"\u116E\u1167\u4E28",\u118D:"\u116E\u116E",\u1171:"\u116E\u4E28",\u315F:"\u116E\u4E28","\uD7B6":"\u116E\u4E28\u4E28",\u3160:"\u1172",\u118E:"\u1172\u1161","\uD7B7":"\u1172\u1161\u4E28",\u118F:"\u1172\u1165",\u1190:"\u1172\u1165\u4E28",\u1191:"\u1172\u1167",\u318A:"\u1172\u1167",\u1192:"\u1172\u1167\u4E28",\u318B:"\u1172\u1167\u4E28","\uD7B8":"\u1172\u1169",\u1193:"\u1172\u116E",\u1194:"\u1172\u4E28",\u318C:"\u1172\u4E28",\u318D:"\u119E","\uD7C5":"\u119E\u1161",\u119F:"\u119E\u1165","\uD7C6":"\u119E\u1165\u4E28",\u11A0:"\u119E\u116E",\u11A2:"\u119E\u119E",\u11A1:"\u119E\u4E28",\u318E:"\u119E\u4E28",\u30D8:"\u3078","\u2341":"\u303C","\u29C4":"\u303C","\uA49E":"\uA04A","\uA4AC":"\uA050","\uA49C":"\uA0C0","\uA4A8":"\uA132","\uA4BF":"\uA259","\uA4BE":"\uA2B1","\uA494":"\uA2CD","\uA4C0":"\uA3AB","\uA4C2":"\uA3B5","\uA4BA":"\uA3BF","\uA4B0":"\uA3C2","\uA4A7":"\uA458","\u22A5":"\uA4D5","\u27C2":"\uA4D5","\u{1D21C}":"\uA4D5","\uA7B1":"\uA4D5","\uA79E":"\uA4E4","\u2141":"\uA4E8","\u2142":"\uA4F6","\u{1D215}":"\uA4F6","\u{1D22B}":"\uA4F6","\u{16F26}":"\uA4F6","\u{10411}":"\uA4F6","\u2143":"\u{16F00}","\u{11AE6}":"\u{11AE5}\u{11AEF}","\u{11AE8}":"\u{11AE5}\u{11AE5}","\u{11AE9}":"\u{11AE5}\u{11AE5}\u{11AEF}","\u{11AEA}":"\u{11AE5}\u{11AE5}\u{11AF0}","\u{11AE7}":"\u{11AE5}\u{11AF0}","\u{11AF4}":"\u{11AF3}\u{11AEF}","\u{11AF6}":"\u{11AF3}\u{11AF3}","\u{11AF7}":"\u{11AF3}\u{11AF3}\u{11AEF}","\u{11AF8}":"\u{11AF3}\u{11AF3}\u{11AF0}","\u{11AF5}":"\u{11AF3}\u{11AF0}","\u{11AEC}":"\u{11AEB}\u{11AEF}","\u{11AED}":"\u{11AEB}\u{11AEB}","\u{11AEE}":"\u{11AEB}\u{11AEB}\u{11AEF}","\u2295":"\u{102A8}","\u2A01":"\u{102A8}","\u{1F728}":"\u{102A8}","\uA69A":"\u{102A8}","\u25BD":"\u{102BC}","\u{1D214}":"\u{102BC}","\u{1F704}":"\u{102BC}","\u29D6":"\u{102C0}","\uA79B":"\u{1043A}","\uA79A":"\u{10412}","\u{104A0}":"\u{10486}","\u{103D1}":"\u{10382}","\u{103D3}":"\u{10393}","\u{12038}":"\u{1039A}","\u2625":"\u{1099E}","\u{132F9}":"\u{1099E}","\u3039":"\u5344",\uF967:"\u4E0D","\u{2F800}":"\u4E3D","\uFA70":"\u4E26","\u239C":"\u4E28","\u239F":"\u4E28","\u23A2":"\u4E28","\u23A5":"\u4E28","\u23AA":"\u4E28","\u23AE":"\u4E28","\u31D1":"\u4E28",\u1175:"\u4E28",\u3163:"\u4E28","\u2F01":"\u4E28",\u119C:"\u4E28\u30FC",\u1198:"\u4E28\u1161",\u1199:"\u4E28\u1163","\uD7BD":"\u4E28\u1163\u1169","\uD7BE":"\u4E28\u1163\u4E28","\uD7BF":"\u4E28\u1167","\uD7C0":"\u4E28\u1167\u4E28",\u119A:"\u4E28\u1169","\uD7C1":"\u4E28\u1169\u4E28","\uD7C2":"\u4E28\u116D",\u119B:"\u4E28\u116E","\uD7C3":"\u4E28\u1172",\u119D:"\u4E28\u119E","\uD7C4":"\u4E28\u4E28",\uF905:"\u4E32","\u{2F801}":"\u4E38",\uF95E:"\u4E39","\u{2F802}":"\u4E41","\u31E0":"\u4E59","\u2F04":"\u4E59","\u31DF":"\u4E5A","\u2E83":"\u4E5A","\u31D6":"\u4E5B","\u2E82":"\u4E5B","\u2EF2":"\u4E80",\uF91B:"\u4E82","\u31DA":"\u4E85","\u2F05":"\u4E85",\uF9BA:"\u4E86",\u30CB:"\u4E8C","\u2F06":"\u4E8C","\u{2F803}":"\u{20122}","\u2F07":"\u4EA0",\uF977:"\u4EAE","\u2F08":"\u4EBA",\u30A4:"\u4EBB","\u2E85":"\u4EBB",\uF9FD:"\u4EC0","\u{2F819}":"\u4ECC",\uF9A8:"\u4EE4","\u{2F804}":"\u4F60",\u5002:"\u4F75","\u{2F807}":"\u4F75","\uFA73":"\u4F80",\uF92D:"\u4F86",\uF9B5:"\u4F8B","\uFA30":"\u4FAE","\u{2F805}":"\u4FAE","\u{2F806}":"\u4FBB",\uF965:"\u4FBF",\u503C:"\u5024",\uF9D4:"\u502B","\u{2F808}":"\u507A","\u{2F809}":"\u5099","\u{2F80B}":"\u50CF",\uF9BB:"\u50DA","\uFA31":"\u50E7","\u{2F80A}":"\u50E7","\u{2F80C}":"\u349E","\u2F09":"\u513F",\uFA0C:"\u5140","\u2E8E":"\u5140","\uFA74":"\u5145","\uFA32":"\u514D","\u{2F80E}":"\u514D","\u{2F80F}":"\u5154","\u{2F810}":"\u5164","\u2F0A":"\u5165","\u{2F814}":"\u5167","\uFA72":"\u5168",\uF978:"\u5169",\u30CF:"\u516B","\u2F0B":"\u516B",\uF9D1:"\u516D","\u{2F811}":"\u5177","\u{2F812}":"\u{2051C}","\u{2F91B}":"\u{20525}","\uFA75":"\u5180","\u{2F813}":"\u34B9","\u2F0C":"\u5182","\u{2F815}":"\u518D","\u{2F816}":"\u{2054B}","\u{2F8D2}":"\u5192","\u{2F8D3}":"\u5195","\u{2F9CA}":"\u34BB","\u{2F8D4}":"\u6700","\u2F0D":"\u5196","\u{2F817}":"\u5197","\u{2F818}":"\u51A4","\u2F0E":"\u51AB","\u{2F81A}":"\u51AC","\uFA71":"\u51B5","\u{2F81B}":"\u51B5",\uF92E:"\u51B7",\uF979:"\u51C9",\uF955:"\u51CC",\uF954:"\u51DC",\uFA15:"\u51DE","\u2F0F":"\u51E0","\u{2F80D}":"\u{2063A}","\u{2F81D}":"\u51F5","\u2F10":"\u51F5","\u2F11":"\u5200","\u2E89":"\u5202","\u{2F81E}":"\u5203",\uFA00:"\u5207","\u{2F850}":"\u5207",\uF99C:"\u5217",\uF9DD:"\u5229","\u{2F81F}":"\u34DF",\uF9FF:"\u523A","\u{2F820}":"\u523B","\u{2F821}":"\u5246","\u{2F822}":"\u5272","\u{2F823}":"\u5277",\uF9C7:"\u5289","\u{2F9D9}":"\u{20804}",\u30AB:"\u529B",\uF98A:"\u529B","\u2F12":"\u529B",\uF99D:"\u52A3","\u{2F824}":"\u3515","\u{2F992}":"\u52B3","\uFA76":"\u52C7","\u{2F825}":"\u52C7","\uFA33":"\u52C9","\u{2F826}":"\u52C9",\uF952:"\u52D2",\uF92F:"\u52DE","\uFA34":"\u52E4","\u{2F827}":"\u52E4",\uF97F:"\u52F5","\u2F13":"\u52F9","\uFA77":"\u52FA","\u{2F828}":"\u52FA","\u{2F829}":"\u5305","\u{2F82A}":"\u5306","\u{2F9DD}":"\u{208DE}","\u2F14":"\u5315",\uF963:"\u5317","\u{2F82B}":"\u5317","\u2F15":"\u531A","\u2F16":"\u5338",\uF9EB:"\u533F","\u2F17":"\u5341","\u3038":"\u5341","\u303A":"\u5345","\u{2F82C}":"\u5349","\u0FD6":"\u534D","\u0FD5":"\u5350","\uFA35":"\u5351","\u{2F82D}":"\u5351","\u{2F82E}":"\u535A",\u30C8:"\u535C","\u2F18":"\u535C","\u2F19":"\u5369","\u2E8B":"\u353E","\u{2F82F}":"\u5373",\uF91C:"\u5375","\u{2F830}":"\u537D","\u{2F831}":"\u537F","\u{2F832}":"\u537F","\u{2F833}":"\u537F","\u2F1A":"\u5382","\u{2F834}":"\u{20A2C}","\u2F1B":"\u53B6",\uF96B:"\u53C3","\u2F1C":"\u53C8","\u{2F836}":"\u53CA","\u{2F837}":"\u53DF","\u{2F838}":"\u{20B63}",\u30ED:"\u53E3","\u2F1D":"\u53E3",\u56D7:"\u53E3","\u2F1E":"\u53E3",\uF906:"\u53E5","\u{2F839}":"\u53EB","\u{2F83A}":"\u53F1","\u{2F83B}":"\u5406",\uF9DE:"\u540F",\uF9ED:"\u541D","\u{2F83D}":"\u5438",\uF980:"\u5442","\u{2F83E}":"\u5448","\u{2F83F}":"\u5468","\u{2F83C}":"\u549E","\u{2F840}":"\u54A2",\uF99E:"\u54BD",\u439B:"\u3588","\u{2F841}":"\u54F6","\u{2F842}":"\u5510","\u{2F843}":"\u5553",\u555F:"\u5553","\uFA79":"\u5555","\u{2F844}":"\u5563","\u{2F845}":"\u5584","\u{2F846}":"\u5584",\uF90B:"\u5587","\uFA7A":"\u5599","\u{2F847}":"\u5599","\uFA36":"\u559D","\uFA78":"\u559D","\u{2F848}":"\u55AB","\u{2F849}":"\u55B3",\uFA0D:"\u55C0","\u{2F84A}":"\u55C2","\uFA7B":"\u55E2","\uFA37":"\u5606","\u{2F84C}":"\u5606","\u{2F84E}":"\u5651","\u{2F84F}":"\u5674","\uFA38":"\u5668",\uF9A9:"\u56F9","\u{2F84B}":"\u5716","\u{2F84D}":"\u5717","\u2F1F":"\u571F",\u58EB:"\u571F","\u2F20":"\u571F","\u{2F855}":"\u578B","\u{2F852}":"\u57CE",\u39B3:"\u363D","\u{2F853}":"\u57F4","\u{2F854}":"\u580D","\u{2F857}":"\u5831","\u{2F856}":"\u5832","\uFA39":"\u5840",\uFA10:"\u585A","\uFA7C":"\u585A",\uF96C:"\u585E",\u586B:"\u5861",\u58FF:"\u58AB","\u{2F858}":"\u58AC","\uFA7D":"\u58B3",\uF94A:"\u58D8",\uF942:"\u58DF","\u{2F859}":"\u{214E4}","\u{2F851}":"\u58EE","\u{2F85A}":"\u58F2","\u{2F85B}":"\u58F7","\u2F21":"\u5902","\u{2F85C}":"\u5906","\u2F22":"\u590A",\u30BF:"\u5915","\u2F23":"\u5915","\u{2F85D}":"\u591A","\u{2F85E}":"\u5922","\u2F24":"\u5927","\uFA7E":"\u5944",\uF90C:"\u5948",\uF909:"\u5951","\uFA7F":"\u5954","\u{2F85F}":"\u5962",\uF981:"\u5973","\u2F25":"\u5973","\u{2F860}":"\u{216A8}","\u{2F861}":"\u{216EA}","\u{2F865}":"\u59D8","\u{2F862}":"\u59EC","\u{2F863}":"\u5A1B","\u{2F864}":"\u5A27","\uFA80":"\u5A62","\u{2F866}":"\u5A66",\u5B00:"\u5AAF","\u{2F867}":"\u36EE","\u{2F868}":"\u36FC","\u{2F986}":"\u5AB5","\u{2F869}":"\u5B08","\uFA81":"\u5B28","\u{2F86A}":"\u5B3E","\u{2F86B}":"\u5B3E","\u2F26":"\u5B50","\u2F27":"\u5B80",\uFA04:"\u5B85","\u{2F86C}":"\u{219C8}","\u{2F86D}":"\u5BC3","\u{2F86E}":"\u5BD8",\uF95F:"\u5BE7",\uF9AA:"\u5BE7","\u{2F86F}":"\u5BE7",\uF9BC:"\u5BEE","\u{2F870}":"\u5BF3","\u{2F871}":"\u{21B18}","\u2F28":"\u5BF8","\u{2F872}":"\u5BFF","\u{2F873}":"\u5C06","\u2F29":"\u5C0F","\u{2F875}":"\u5C22","\u2E90":"\u5C22","\u2F2A":"\u5C22","\u2E8F":"\u5C23","\u{2F876}":"\u3781","\u2F2B":"\u5C38",\uF9BD:"\u5C3F","\u{2F877}":"\u5C60",\uF94B:"\u5C62","\uFA3B":"\u5C64",\uF9DF:"\u5C65","\uFA3C":"\u5C6E","\u{2F878}":"\u5C6E","\u2F2C":"\u5C6E","\u{2F8F8}":"\u{21D0B}","\u2F2D":"\u5C71","\u{2F879}":"\u5CC0","\u{2F87A}":"\u5C8D","\u{2F87B}":"\u{21DE4}","\u{2F87D}":"\u{21DE6}",\uF9D5:"\u5D19","\u{2F87C}":"\u5D43",\uF921:"\u5D50","\u{2F87F}":"\u5D6B","\u{2F87E}":"\u5D6E","\u{2F880}":"\u5D7C","\u{2F9F4}":"\u5DB2",\uF9AB:"\u5DBA","\u2F2E":"\u5DDB","\u{2F882}":"\u5DE2",\u30A8:"\u5DE5","\u2F2F":"\u5DE5","\u2F30":"\u5DF1","\u2E92":"\u5DF3","\u{2F883}":"\u382F","\u{2F884}":"\u5DFD","\u2F31":"\u5DFE",\u5E32:"\u5E21","\u{2F885}":"\u5E28","\u{2F886}":"\u5E3D","\u{2F887}":"\u5E69","\u{2F888}":"\u3862","\u{2F889}":"\u{22183}","\u2F32":"\u5E72",\uF98E:"\u5E74","\u{2F939}":"\u{2219F}","\u2E93":"\u5E7A","\u2F33":"\u5E7A","\u2F34":"\u5E7F",\uFA01:"\u5EA6","\u{2F88A}":"\u387C","\u{2F88B}":"\u5EB0","\u{2F88C}":"\u5EB3","\u{2F88D}":"\u5EB6",\uF928:"\u5ECA","\u{2F88E}":"\u5ECA",\uF9A2:"\u5EC9","\uFA82":"\u5ED2",\uFA0B:"\u5ED3","\uFA83":"\u5ED9",\uF982:"\u5EEC","\u2F35":"\u5EF4","\u{2F890}":"\u5EFE","\u2F36":"\u5EFE","\u{2F891}":"\u{22331}","\u{2F892}":"\u{22331}",\uF943:"\u5F04","\u2F37":"\u5F0B","\u2F38":"\u5F13","\u{2F894}":"\u5F22","\u{2F895}":"\u5F22","\u2F39":"\u5F50","\u2E94":"\u5F51","\u{2F874}":"\u5F53","\u{2F896}":"\u38C7","\u2F3A":"\u5F61","\u{2F899}":"\u5F62","\uFA84":"\u5F69","\u{2F89A}":"\u5F6B","\u2F3B":"\u5F73",\uF9D8:"\u5F8B","\u{2F89B}":"\u38E3","\u{2F89C}":"\u5F9A",\uF966:"\u5FA9","\uFA85":"\u5FAD","\u2F3C":"\u5FC3","\u2E96":"\u5FC4","\u2E97":"\u38FA","\u{2F89D}":"\u5FCD","\u{2F89E}":"\u5FD7",\uF9A3:"\u5FF5","\u{2F89F}":"\u5FF9",\uF960:"\u6012",\uF9AC:"\u601C","\uFA6B":"\u6075","\u{2F8A2}":"\u391C","\u{2F8A1}":"\u393A","\u{2F8A0}":"\u6081","\uFA3D":"\u6094","\u{2F8A3}":"\u6094","\u{2F8A5}":"\u60C7","\uFA86":"\u60D8",\uF9B9:"\u60E1","\u{2F8A4}":"\u{226D4}","\uFA88":"\u6108","\uFA3E":"\u6168",\uF9D9:"\u6144","\u{2F8A6}":"\u6148","\u{2F8A7}":"\u614C","\u{2F8A9}":"\u614C","\uFA87":"\u614E","\u{2F8A8}":"\u614E","\uFA8A":"\u6160","\u{2F8AA}":"\u617A","\uFA3F":"\u618E","\uFA89":"\u618E","\u{2F8AB}":"\u618E",\uF98F:"\u6190","\u{2F8AD}":"\u61A4","\u{2F8AE}":"\u61AF","\u{2F8AC}":"\u61B2","\uFAD0":"\u{22844}","\uFACF":"\u{2284A}","\u{2F8AF}":"\u61DE","\uFA40":"\u61F2","\uFA8B":"\u61F2","\u{2F8B0}":"\u61F2",\uF90D:"\u61F6","\u{2F8B1}":"\u61F6",\uF990:"\u6200","\u2F3D":"\u6208","\u{2F8B2}":"\u6210","\u{2F8B3}":"\u621B",\uF9D2:"\u622E","\uFA8C":"\u6234","\u2F3E":"\u6236",\u6238:"\u6236","\u2F3F":"\u624B","\u2E98":"\u624C","\u{2F8B4}":"\u625D","\u{2F8B5}":"\u62B1",\uF925:"\u62C9",\uF95B:"\u62CF",\uFA02:"\u62D3","\u{2F8B6}":"\u62D4","\u{2F8BA}":"\u62FC",\uF973:"\u62FE","\u{2F8B8}":"\u{22B0C}","\u{2F8B9}":"\u633D","\u{2F8B7}":"\u6350","\u{2F8BB}":"\u6368",\uF9A4:"\u637B","\u{2F8BC}":"\u6383",\uF975:"\u63A0","\u{2F8C1}":"\u63A9","\uFA8D":"\u63C4","\u{2F8BD}":"\u63E4","\uFA8F":"\u6452","\u{2F8BE}":"\u{22BF1}","\uFA8E":"\u641C","\u{2F8BF}":"\u6422","\u{2F8C0}":"\u63C5","\u{2F8C3}":"\u6469","\u{2F8C6}":"\u6477","\u{2F8C4}":"\u647E","\u{2F8C2}":"\u3A2E",\u6409:"\u3A41",\uF991:"\u649A","\u{2F8C5}":"\u649D",\uF930:"\u64C4","\u{2F8C7}":"\u3A6C","\u2F40":"\u652F","\u2F41":"\u6534","\u2E99":"\u6535","\uFA41":"\u654F","\u{2F8C8}":"\u654F","\uFA90":"\u6556","\u{2F8C9}":"\u656C",\uF969:"\u6578","\u{2F8CA}":"\u{2300A}","\u2F42":"\u6587","\u2EEB":"\u6589","\u2F43":"\u6597",\uF9BE:"\u6599","\u2F44":"\u65A4","\u2F45":"\u65B9",\uF983:"\u65C5","\u2F46":"\u65E0","\u2E9B":"\u65E1","\uFA42":"\u65E2","\u{2F8CB}":"\u65E3","\u2F47":"\u65E5",\uF9E0:"\u6613",\u66F6:"\u3ADA","\u{2F8D1}":"\u3AE4","\u{2F8CD}":"\u6649",\u6669:"\u665A",\uFA12:"\u6674","\uFA91":"\u6674","\uFA43":"\u6691","\u{2F8CF}":"\u6691",\uF9C5:"\u6688","\u{2F8D0}":"\u3B08","\u{2F8D5}":"\u669C",\uFA06:"\u66B4",\uF98B:"\u66C6","\u{2F8CE}":"\u3B19","\u{2F897}":"\u{232B8}","\u2F48":"\u66F0",\uF901:"\u66F4","\u{2F8CC}":"\u66F8","\u2F49":"\u6708","\u{2F980}":"\u{2335F}",\u80A6:"\u670C",\u80D0:"\u670F",\u80CA:"\u6710",\u8101:"\u6713",\u80F6:"\u3B35",\uF929:"\u6717","\uFA92":"\u6717","\u{2F8D8}":"\u6717",\u8127:"\u6718","\uFA93":"\u671B","\u{2F8D9}":"\u671B",\u5E50:"\u3B3A",\u4420:"\u3B3B","\u{2F989}":"\u{23393}",\u81A7:"\u6723","\u{2F98A}":"\u{2339C}","\u2F4A":"\u6728",\uF9E1:"\u674E","\u{2F8DC}":"\u6753","\uFA94":"\u6756","\u{2F8DB}":"\u675E","\u{2F8DD}":"\u{233C3}",\u67FF:"\u676E",\uF9C8:"\u677B","\u{2F8E0}":"\u6785",\uF9F4:"\u6797","\u{2F8DE}":"\u3B49","\uFAD1":"\u{233D5}",\uF9C9:"\u67F3","\u{2F8DF}":"\u67FA",\uF9DA:"\u6817","\u{2F8E5}":"\u681F","\u{2F8E1}":"\u6852","\u{2F8E3}":"\u{2346D}",\uF97A:"\u6881","\uFA44":"\u6885","\u{2F8E2}":"\u6885","\u{2F8E4}":"\u688E",\uF9E2:"\u68A8","\u{2F8E6}":"\u6914","\u{2F8E8}":"\u6942","\uFAD2":"\u3B9D","\u{2F8E7}":"\u3B9D",\u69E9:"\u3BA3",\u6A27:"\u699D","\u{2F8E9}":"\u69A3","\u{2F8EA}":"\u69EA",\uF914:"\u6A02",\uF95C:"\u6A02",\uF9BF:"\u6A02",\uF94C:"\u6A13","\u{2F8EC}":"\u{236A3}","\u{2F8EB}":"\u6AA8",\uF931:"\u6AD3","\u{2F8ED}":"\u6ADB",\uF91D:"\u6B04","\u{2F8EE}":"\u3C18","\u2F4B":"\u6B20","\u{2F8EF}":"\u6B21","\u{2F8F0}":"\u{238A7}","\u{2F8F1}":"\u6B54","\u{2F8F2}":"\u3C4E","\u2F4C":"\u6B62","\u2EED":"\u6B6F","\u{2F8F3}":"\u6B72",\uF98C:"\u6B77","\uFA95":"\u6B79","\u2F4D":"\u6B79","\u2E9E":"\u6B7A","\u{2F8F4}":"\u6B9F",\uF9A5:"\u6BAE","\u2F4E":"\u6BB3",\uF970:"\u6BBA","\uFA96":"\u6BBA","\u{2F8F5}":"\u6BBA","\u{2F8F6}":"\u6BBB","\u{2F8F7}":"\u{23A8D}","\u2F4F":"\u6BCB","\u2E9F":"\u6BCD","\u{2F8F9}":"\u{23AFA}","\u2F50":"\u6BD4","\u2F51":"\u6BDB","\u2F52":"\u6C0F","\u2EA0":"\u6C11","\u2F53":"\u6C14","\u2F54":"\u6C34","\u2EA1":"\u6C35","\u2EA2":"\u6C3A","\u{2F8FA}":"\u6C4E","\u{2F8FE}":"\u6C67",\uF972:"\u6C88","\u{2F8FC}":"\u6CBF",\uF968:"\u6CCC","\u{2F8FD}":"\u6CCD",\uF9E3:"\u6CE5","\u{2F8FB}":"\u{23CBC}",\uF915:"\u6D1B",\uFA05:"\u6D1E","\u{2F907}":"\u6D34","\u{2F900}":"\u6D3E",\uF9CA:"\u6D41","\uFA97":"\u6D41","\u{2F902}":"\u6D41","\u{2F8FF}":"\u6D16","\u{2F903}":"\u6D69",\uF92A:"\u6D6A","\uFA45":"\u6D77","\u{2F901}":"\u6D77","\u{2F904}":"\u6D78","\u{2F905}":"\u6D85","\u{2F906}":"\u{23D1E}",\uF9F5:"\u6DCB",\uF94D:"\u6DDA",\uF9D6:"\u6DEA","\u{2F90E}":"\u6DF9","\uFA46":"\u6E1A","\u{2F908}":"\u6E2F","\u{2F909}":"\u6E6E",\u6F59:"\u6E88","\uFA99":"\u6ECB","\u{2F90B}":"\u6ECB",\uF9CB:"\u6E9C",\uF9EC:"\u6EBA","\u{2F90C}":"\u6EC7",\uF904:"\u6ED1","\uFA98":"\u6EDB","\u{2F90A}":"\u3D33",\uF94E:"\u6F0F","\uFA47":"\u6F22","\uFA9A":"\u6F22",\uF992:"\u6F23","\u{2F90D}":"\u{23ED1}","\u{2F90F}":"\u6F6E","\u{2F910}":"\u{23F5E}","\u{2F911}":"\u{23F8E}","\u{2F912}":"\u6FC6",\uF922:"\u6FEB",\uF984:"\u6FFE","\u{2F915}":"\u701B","\uFA9B":"\u701E","\u{2F914}":"\u701E","\u{2F913}":"\u7039","\u{2F917}":"\u704A","\u{2F916}":"\u3D96","\u2F55":"\u706B","\u2EA3":"\u706C","\u{2F835}":"\u7070","\u{2F919}":"\u7077","\u{2F918}":"\u707D",\uF9FB:"\u7099","\u{2F91A}":"\u70AD",\uF99F:"\u70C8",\uF916:"\u70D9","\uFA48":"\u716E","\uFA9C":"\u716E","\u{2F91D}":"\u{24263}","\u{2F91C}":"\u7145",\uF993:"\u7149","\uFA6C":"\u{242EE}","\u{2F91E}":"\u719C",\uF9C0:"\u71CE",\uF9EE:"\u71D0","\u{2F91F}":"\u{243AB}",\uF932:"\u7210",\uF91E:"\u721B","\u{2F920}":"\u7228","\u2F56":"\u722A","\uFA49":"\u722B","\u2EA4":"\u722B","\uFA9E":"\u7235","\u{2F921}":"\u7235","\u2F57":"\u7236","\u2F58":"\u723B","\u2EA6":"\u4E2C","\u2F59":"\u723F","\u2F5A":"\u7247","\u{2F922}":"\u7250","\u2F5B":"\u7259","\u{2F923}":"\u{24608}","\u2F5C":"\u725B",\uF946:"\u7262","\u{2F924}":"\u7280","\u{2F925}":"\u7295","\u2F5D":"\u72AC","\u2EA8":"\u72AD","\uFA9F":"\u72AF",\uF9FA:"\u72C0","\u{2F926}":"\u{24735}",\uF92B:"\u72FC",\uFA16:"\u732A","\uFAA0":"\u732A","\u{2F927}":"\u{24814}",\uF9A7:"\u7375","\u{2F928}":"\u737A","\u2F5E":"\u7384",\uF961:"\u7387",\uF9DB:"\u7387","\u2F5F":"\u7389","\u{2F929}":"\u738B","\u{2F92A}":"\u3EAC","\u{2F92B}":"\u73A5",\uF9AD:"\u73B2","\u{2F92C}":"\u3EB8","\u{2F92D}":"\u3EB8",\uF917:"\u73DE",\uF9CC:"\u7409",\uF9E4:"\u7406","\uFA4A":"\u7422","\u{2F92E}":"\u7447","\u{2F92F}":"\u745C",\uF9AE:"\u7469","\uFAA1":"\u7471","\u{2F930}":"\u7471","\u{2F931}":"\u7485",\uF994:"\u7489",\uF9EF:"\u7498","\u{2F932}":"\u74CA","\u2F60":"\u74DC","\u2F61":"\u74E6","\u{2F933}":"\u3F1B","\uFAA2":"\u7506","\u2F62":"\u7518","\u2F63":"\u751F","\u{2F934}":"\u7524","\u2F64":"\u7528","\u2F65":"\u7530","\uFAA3":"\u753B","\u{2F936}":"\u753E","\u{2F935}":"\u{24C36}",\uF9CD:"\u7559",\uF976:"\u7565",\uF962:"\u7570","\u{2F938}":"\u7570","\u{2F937}":"\u{24C92}","\u2F66":"\u758B","\u2F67":"\u7592",\uF9E5:"\u75E2","\u{2F93A}":"\u7610","\uFAA5":"\u761F","\uFAA4":"\u761D",\uF9C1:"\u7642",\uF90E:"\u7669","\u2F68":"\u7676","\u2F69":"\u767D","\u{2F93B}":"\u{24FA1}","\u{2F93C}":"\u{24FB8}","\u2F6A":"\u76AE","\u2F6B":"\u76BF","\u{2F93D}":"\u{25044}","\u{2F93E}":"\u3FFC",\uFA17:"\u76CA","\uFAA6":"\u76CA","\uFAA7":"\u76DB",\uF933:"\u76E7","\u{2F93F}":"\u4008","\u2F6C":"\u76EE","\uFAA8":"\u76F4","\u{2F940}":"\u76F4","\u{2F942}":"\u{250F2}","\u{2F941}":"\u{250F3}",\uF96D:"\u7701","\uFAD3":"\u4018","\u{2F943}":"\u{25119}","\u{2F945}":"\u771E","\u{2F946}":"\u771F","\u{2F947}":"\u771F","\u{2F944}":"\u{25133}","\uFAAA":"\u7740","\uFAA9":"\u774A","\u{2F948}":"\u774A","\u9FC3":"\u4039","\uFAD4":"\u4039","\u{2F949}":"\u4039",\u6663:"\u403F","\u{2F94B}":"\u4046","\u{2F94A}":"\u778B","\uFAD5":"\u{25249}","\uFA9D":"\u77A7","\u2F6D":"\u77DB","\u2F6E":"\u77E2","\u2F6F":"\u77F3","\u{2F94C}":"\u4096","\u{2F94D}":"\u{2541D}",\u784F:"\u7814","\u{2F94E}":"\u784E",\uF9CE:"\u786B",\uF93B:"\u788C","\u{2F94F}":"\u788C","\uFA4B":"\u7891",\uF947:"\u78CA","\uFAAB":"\u78CC","\u{2F950}":"\u78CC",\uF964:"\u78FB","\u{2F951}":"\u40E3",\uF985:"\u792A","\u2F70":"\u793A","\u2EAD":"\u793B",\uFA18:"\u793C","\uFA4C":"\u793E","\uFA4E":"\u7948","\uFA4D":"\u7949","\u{2F952}":"\u{25626}","\uFA4F":"\u7950","\uFA50":"\u7956","\u{2F953}":"\u7956","\uFA51":"\u795D",\uFA19:"\u795E",\uFA1A:"\u7965","\uFA61":"\u8996","\uFAB8":"\u8996",\uF93C:"\u797F","\u{2F954}":"\u{2569A}","\uFA52":"\u798D","\uFA53":"\u798E",\uFA1B:"\u798F","\u{2F956}":"\u798F","\u{2F955}":"\u{256C5}",\uF9B6:"\u79AE","\u2F71":"\u79B8","\u2F72":"\u79BE",\uF995:"\u79CA","\u{2F958}":"\u412F","\u{2F957}":"\u79EB",\uF956:"\u7A1C","\u{2F95A}":"\u7A4A","\uFA54":"\u7A40","\u{2F959}":"\u7A40","\u{2F95B}":"\u7A4F","\u2F73":"\u7A74","\uFA55":"\u7A81","\u{2F95C}":"\u{2597C}","\uFAAC":"\u7AB1",\uF9F7:"\u7ACB","\u2F74":"\u7ACB","\u2EEF":"\u7ADC","\u{2F95D}":"\u{25AA7}","\u{2F95E}":"\u{25AA7}","\u{2F95F}":"\u7AEE","\u2F75":"\u7AF9",\uF9F8:"\u7B20","\uFA56":"\u7BC0","\uFAAD":"\u7BC0","\u{2F960}":"\u4202","\u{2F961}":"\u{25BAB}","\u{2F962}":"\u7BC6","\u{2F964}":"\u4227","\u{2F963}":"\u7BC9","\u{2F965}":"\u{25C80}","\uFAD6":"\u{25CD0}",\uF9A6:"\u7C3E",\uF944:"\u7C60","\u2F76":"\u7C73","\uFAAE":"\u7C7B",\uF9F9:"\u7C92",\uFA1D:"\u7CBE","\u{2F966}":"\u7CD2",\uFA03:"\u7CD6","\u{2F968}":"\u7CE8","\u{2F967}":"\u42A0","\u{2F969}":"\u7CE3",\uF97B:"\u7CE7","\u2F77":"\u7CF8","\u2EAF":"\u7CF9","\u{2F96B}":"\u{25F86}","\u{2F96A}":"\u7D00",\uF9CF:"\u7D10",\uF96A:"\u7D22",\uF94F:"\u7D2F",\u7D76:"\u7D55","\u{2F96C}":"\u7D63","\uFAAF":"\u7D5B",\uF93D:"\u7DA0",\uF957:"\u7DBE","\u{2F96E}":"\u7DC7",\uF996:"\u7DF4","\uFA57":"\u7DF4","\uFAB0":"\u7DF4","\u{2F96F}":"\u7E02","\u{2F96D}":"\u4301","\uFA58":"\u7E09",\uF950:"\u7E37","\uFA59":"\u7E41","\u{2F970}":"\u7E45","\u{2F898}":"\u{261DA}","\u{2F971}":"\u4334","\u2F78":"\u7F36","\u{2F972}":"\u{26228}","\uFAB1":"\u7F3E","\u{2F973}":"\u{26247}","\u2F79":"\u7F51","\u2EAB":"\u7F52","\u2EB2":"\u7F52","\u2EB1":"\u7F53","\u{2F974}":"\u4359","\uFA5A":"\u7F72","\u{2F975}":"\u{262D9}",\uF9E6:"\u7F79","\u{2F976}":"\u7F7A",\uF90F:"\u7F85","\u{2F977}":"\u{2633E}","\u2F7A":"\u7F8A","\u{2F978}":"\u7F95",\uF9AF:"\u7F9A",\uFA1E:"\u7FBD","\u2F7B":"\u7FBD","\u{2F979}":"\u7FFA",\uF934:"\u8001","\u2F7C":"\u8001","\u2EB9":"\u8002","\uFA5B":"\u8005","\uFAB2":"\u8005","\u{2F97A}":"\u8005","\u2F7D":"\u800C","\u{2F97B}":"\u{264DA}","\u2F7E":"\u8012","\u{2F97C}":"\u{26523}","\u2F7F":"\u8033",\uF9B0:"\u8046","\u{2F97D}":"\u8060","\u{2F97E}":"\u{265A8}",\uF997:"\u806F","\u{2F97F}":"\u8070",\uF945:"\u807E","\u2F80":"\u807F","\u2EBA":"\u8080","\u2F81":"\u8089",\uF953:"\u808B","\u{2F8D6}":"\u80AD","\u{2F982}":"\u80B2","\u{2F981}":"\u43D5","\u{2F8D7}":"\u43D9",\u8141:"\u80FC","\u{2F983}":"\u8103","\u{2F985}":"\u813E","\u{2F984}":"\u440B","\u{2F8DA}":"\u6721","\u{2F987}":"\u{267A7}","\u{2F988}":"\u{267B5}",\u6726:"\u4443",\uF926:"\u81D8","\u2F82":"\u81E3",\uF9F6:"\u81E8","\u2F83":"\u81EA","\uFA5C":"\u81ED","\u2F84":"\u81F3","\u2F85":"\u81FC","\u{2F893}":"\u8201","\u{2F98B}":"\u8201","\u{2F98C}":"\u8204","\u2F86":"\u820C","\uFA6D":"\u8218","\u2F87":"\u821B","\u2F88":"\u821F","\u{2F98E}":"\u446B","\u2F89":"\u826E",\uF97C:"\u826F","\u2F8A":"\u8272","\u2F8B":"\u8278","\uFA5D":"\u8279","\uFA5E":"\u8279","\u2EBE":"\u8279","\u2EBF":"\u8279","\u2EC0":"\u8279","\u{2F990}":"\u828B","\u{2F98F}":"\u8291","\u{2F991}":"\u829D","\u{2F993}":"\u82B1","\u{2F994}":"\u82B3","\u{2F995}":"\u82BD",\uF974:"\u82E5","\u{2F998}":"\u82E5","\u{2F996}":"\u82E6","\u{2F997}":"\u{26B3C}",\uF9FE:"\u8336","\uFAB3":"\u8352","\u{2F99A}":"\u8363","\u{2F999}":"\u831D","\u{2F99C}":"\u8323","\u{2F99D}":"\u83BD","\u{2F9A0}":"\u8353",\uF93E:"\u83C9","\u{2F9A1}":"\u83CA","\u{2F9A2}":"\u83CC","\u{2F9A3}":"\u83DC","\u{2F99E}":"\u83E7","\uFAB4":"\u83EF",\uF958:"\u83F1","\uFA5F":"\u8457","\u{2F99F}":"\u8457","\u{2F9A4}":"\u{26C36}","\u{2F99B}":"\u83AD",\uF918:"\u843D",\uF96E:"\u8449",\u853F:"\u848D","\u{2F9A6}":"\u{26CD5}","\u{2F9A5}":"\u{26D6B}",\uF999:"\u84EE","\u{2F9A8}":"\u84F1","\u{2F9A9}":"\u84F3",\uF9C2:"\u84FC","\u{2F9AA}":"\u8516","\u{2F9A7}":"\u452B","\u{2F9AC}":"\u8564","\u{2F9AD}":"\u{26F2C}",\uF923:"\u85CD","\u{2F9AE}":"\u455D","\u{2F9B0}":"\u{26FB1}","\u{2F9AF}":"\u4561",\uF9F0:"\u85FA",\uF935:"\u8606","\u{2F9B2}":"\u456B",\uFA20:"\u8612",\uF91F:"\u862D","\u{2F9B1}":"\u{270D2}",\u8641:"\u8637",\uF910:"\u863F","\u2F8C":"\u864D","\u2EC1":"\u864E","\u{2F9B3}":"\u8650",\uF936:"\u865C","\u{2F9B4}":"\u865C","\u{2F9B5}":"\u8667","\u{2F9B6}":"\u8669","\u2F8D":"\u866B","\u{2F9B7}":"\u86A9","\u{2F9B8}":"\u8688","\u{2F9BA}":"\u86E2","\u{2F9B9}":"\u870E","\u{2F9BC}":"\u8728","\u{2F9BD}":"\u876B","\u{2F9C0}":"\u87E1","\uFAB5":"\u8779","\u{2F9BB}":"\u8779","\u{2F9BE}":"\u8786","\u{2F9BF}":"\u45D7","\u{2F9AB}":"\u{273CA}",\uF911:"\u87BA","\u{2F9C1}":"\u8801","\u{2F9C2}":"\u45F9",\uF927:"\u881F","\u2F8E":"\u8840",\uFA08:"\u884C","\u2F8F":"\u884C","\u{2F9C3}":"\u8860","\u{2F9C4}":"\u8863","\u2F90":"\u8863","\u2EC2":"\u8864",\uF9A0:"\u88C2","\u{2F9C5}":"\u{27667}",\uF9E7:"\u88CF","\u{2F9C6}":"\u88D7","\u{2F9C7}":"\u88DE",\uF9E8:"\u88E1",\uF912:"\u88F8","\u{2F9C9}":"\u88FA","\u{2F9C8}":"\u4635","\uFA60":"\u8910","\uFAB6":"\u8941",\uF924:"\u8964","\u2F91":"\u897E","\u2EC4":"\u897F","\u2EC3":"\u8980","\uFAB7":"\u8986",\uFA0A:"\u898B","\u2F92":"\u898B","\u{2F9CB}":"\u{278AE}","\u2EC5":"\u89C1","\u2F93":"\u89D2","\u2F94":"\u8A00","\u{2F9CC}":"\u{27966}",\u8A7D:"\u8A2E",\u8A1E:"\u46B6","\u{2F9CD}":"\u46BE","\u{2F9CE}":"\u46C7","\u{2F9CF}":"\u8AA0",\uF96F:"\u8AAA",\uF9A1:"\u8AAA","\uFAB9":"\u8ABF","\uFABB":"\u8ACB",\uF97D:"\u8AD2",\uF941:"\u8AD6","\uFABE":"\u8AED","\u{2F9D0}":"\u8AED",\uFA22:"\u8AF8","\uFABA":"\u8AF8",\uF95D:"\u8AFE","\uFABD":"\u8AFE","\uFA62":"\u8B01","\uFABC":"\u8B01","\uFA63":"\u8B39","\uFABF":"\u8B39",\uF9FC:"\u8B58",\uF95A:"\u8B80",\u8B8F:"\u8B86","\uFAC0":"\u8B8A","\u{2F9D1}":"\u8B8A","\u2EC8":"\u8BA0","\u2F95":"\u8C37","\u2F96":"\u8C46",\uF900:"\u8C48","\u{2F9D2}":"\u8C55","\u2F97":"\u8C55",\u8C63:"\u8C5C","\u2F98":"\u8C78","\u{2F9D3}":"\u{27CA8}","\u2F99":"\u8C9D","\u{2F9D4}":"\u8CAB","\u{2F9D5}":"\u8CC1",\uF948:"\u8CC2",\uF903:"\u8CC8","\uFA64":"\u8CD3","\uFA65":"\u8D08","\uFAC1":"\u8D08","\u{2F9D6}":"\u8D1B","\u2EC9":"\u8D1D","\u2F9A":"\u8D64","\u2F9B":"\u8D70","\u{2F9D7}":"\u8D77",\u8D86:"\u8D7F","\uFAD7":"\u{27ED3}","\u{2F9D8}":"\u{27F2F}","\u2F9C":"\u8DB3","\u{2F9DA}":"\u8DCB","\u{2F9DB}":"\u8DBC",\u8DFA:"\u8DE5",\uF937:"\u8DEF","\u{2F9DC}":"\u8DF0",\u8E9B:"\u8E97","\u2F9D":"\u8EAB",\uF902:"\u8ECA","\u2F9E":"\u8ECA","\u{2F9DE}":"\u8ED4",\u8F27:"\u8EFF",\uF998:"\u8F26",\uF9D7:"\u8F2A","\uFAC2":"\u8F38","\u{2F9DF}":"\u8F38",\uFA07:"\u8F3B",\uF98D:"\u8F62","\u2ECB":"\u8F66","\u2F9F":"\u8F9B","\u{2F98D}":"\u8F9E",\uF971:"\u8FB0","\u2FA0":"\u8FB0","\u2FA1":"\u8FB5","\uFA66":"\u8FB6","\u2ECC":"\u8FB6","\u2ECD":"\u8FB6","\u{2F881}":"\u5DE1",\uF99A:"\u9023",\uFA25:"\u9038","\uFA67":"\u9038","\uFAC3":"\u9072",\uF9C3:"\u907C","\u{2F9E0}":"\u{285D2}","\u{2F9E1}":"\u{285ED}",\uF913:"\u908F","\u2FA2":"\u9091","\u{2F9E2}":"\u9094",\uF92C:"\u90CE",\u90DE:"\u90CE","\uFA2E":"\u90CE","\u{2F9E3}":"\u90F1",\uFA26:"\u90FD","\u{2F9E5}":"\u{2872E}","\u{2F9E4}":"\u9111","\u{2F9E6}":"\u911B","\u2FA3":"\u9149",\uF919:"\u916A","\uFAC4":"\u9199",\uF9B7:"\u91B4","\u2FA4":"\u91C6",\uF9E9:"\u91CC","\u2FA5":"\u91CC",\uF97E:"\u91CF",\uF90A:"\u91D1","\u2FA6":"\u91D1",\uF9B1:"\u9234","\u{2F9E7}":"\u9238","\uFAC5":"\u9276","\u{2F9E8}":"\u92D7","\u{2F9E9}":"\u92D8","\u{2F9EA}":"\u927C",\uF93F:"\u9304",\uF99B:"\u934A",\u93AE:"\u93AD","\u{2F9EB}":"\u93F9","\u{2F9EC}":"\u9415","\u{2F9ED}":"\u{28BFA}","\u2ED0":"\u9485","\u2ED1":"\u9577","\u2FA7":"\u9577","\u2ED2":"\u9578","\u2ED3":"\u957F","\u2FA8":"\u9580","\u{2F9EE}":"\u958B","\u{2F9EF}":"\u4995",\uF986:"\u95AD","\u{2F9F0}":"\u95B7","\u{2F9F1}":"\u{28D77}","\u2ED4":"\u95E8","\u2FA9":"\u961C","\u2ECF":"\u961D","\u2ED6":"\u961D",\uF9C6:"\u962E",\uF951:"\u964B",\uFA09:"\u964D",\uF959:"\u9675",\uF9D3:"\u9678","\uFAC6":"\u967C",\uF9DC:"\u9686",\uF9F1:"\u96A3","\u{2F9F2}":"\u49E6","\u2FAA":"\u96B6","\uFA2F":"\u96B7",\u96B8:"\u96B7",\uF9B8:"\u96B7","\u2FAB":"\u96B9","\u{2F9F3}":"\u96C3",\uF9EA:"\u96E2","\uFA68":"\u96E3","\uFAC7":"\u96E3","\u2FAC":"\u96E8",\uF9B2:"\u96F6",\uF949:"\u96F7","\u{2F9F5}":"\u9723","\u{2F9F6}":"\u{29145}",\uF938:"\u9732",\uF9B3:"\u9748","\u2FAD":"\u9751","\u2ED8":"\u9752",\uFA1C:"\u9756","\uFAC8":"\u9756","\u{2F81C}":"\u{291DF}","\u2FAE":"\u975E","\u2FAF":"\u9762","\u{2F9F7}":"\u{2921A}","\u2FB0":"\u9769","\u{2F9F8}":"\u4A6E","\u{2F9F9}":"\u4A76","\u2FB1":"\u97CB","\uFAC9":"\u97DB","\u{2F9FA}":"\u97E0","\u2ED9":"\u97E6","\u2FB2":"\u97ED","\u{2F9FB}":"\u{2940A}","\u2FB3":"\u97F3","\uFA69":"\u97FF","\uFACA":"\u97FF","\u2FB4":"\u9801","\u{2F9FC}":"\u4AB2","\uFACB":"\u980B","\u{2F9FE}":"\u980B","\u{2F9FF}":"\u980B",\uF9B4:"\u9818","\u{2FA00}":"\u9829","\u{2F9FD}":"\u{29496}","\uFA6A":"\u983B","\uFACC":"\u983B",\uF9D0:"\u985E","\u2EDA":"\u9875","\u2FB5":"\u98A8","\u{2FA01}":"\u{295B6}","\u2EDB":"\u98CE","\u2FB6":"\u98DB","\u2EDC":"\u98DE","\u2EDD":"\u98DF","\u2FB7":"\u98DF","\u2EDF":"\u98E0","\u{2FA02}":"\u98E2",\uFA2A:"\u98EF",\uFA2B:"\u98FC","\u{2FA03}":"\u4B33",\uFA2C:"\u9928","\u{2FA04}":"\u9929","\u2EE0":"\u9963","\u2FB8":"\u9996","\u2FB9":"\u9999","\u{2FA05}":"\u99A7","\u2FBA":"\u99AC","\u{2FA06}":"\u99C2",\uF91A:"\u99F1","\u{2FA07}":"\u99FE",\uF987:"\u9A6A","\u2EE2":"\u9A6C","\u2FBB":"\u9AA8","\u{2FA08}":"\u4BCE","\u2FBC":"\u9AD8","\u2FBD":"\u9ADF","\u{2FA09}":"\u{29B30}","\uFACD":"\u9B12","\u{2FA0A}":"\u9B12","\u2FBE":"\u9B25","\u2FBF":"\u9B2F","\u2FC0":"\u9B32","\u2FC1":"\u9B3C","\u2EE4":"\u9B3C","\u2FC2":"\u9B5A",\uF939:"\u9B6F","\u{2FA0B}":"\u9C40",\uF9F2:"\u9C57","\u2EE5":"\u9C7C","\u2FC3":"\u9CE5","\u{2FA0C}":"\u9CFD","\u{2FA0D}":"\u4CCE","\u{2FA0F}":"\u9D67","\u{2FA0E}":"\u4CED","\u{2FA10}":"\u{2A0CE}",\uFA2D:"\u9DB4","\u{2FA12}":"\u{2A105}","\u{2FA11}":"\u4CF8",\uF93A:"\u9DFA","\u{2FA13}":"\u{2A20E}",\uF920:"\u9E1E",\u9E43:"\u9E42","\u2FC4":"\u9E75",\uF940:"\u9E7F","\u2FC5":"\u9E7F","\u{2FA14}":"\u{2A291}",\uF988:"\u9E97",\uF9F3:"\u9E9F","\u2FC6":"\u9EA5","\u2EE8":"\u9EA6","\u{2FA15}":"\u9EBB","\u2FC7":"\u9EBB","\u{2F88F}":"\u{2A392}","\u2FC8":"\u9EC3","\u2EE9":"\u9EC4","\u2FC9":"\u9ECD",\uF989:"\u9ECE","\u{2FA16}":"\u4D56","\u2FCA":"\u9ED1",\u9ED2:"\u9ED1","\uFA3A":"\u58A8","\u{2FA17}":"\u9EF9","\u2FCB":"\u9EF9","\u2FCC":"\u9EFD","\u{2FA19}":"\u9F05","\u{2FA18}":"\u9EFE","\u2FCD":"\u9F0E","\u{2FA1A}":"\u9F0F","\u2FCE":"\u9F13","\u{2FA1B}":"\u9F16","\u2FCF":"\u9F20","\u{2FA1C}":"\u9F3B","\u2FD0":"\u9F3B","\uFAD8":"\u9F43","\u2FD1":"\u9F4A","\u2EEC":"\u9F50","\u2FD2":"\u9F52","\u{2FA1D}":"\u{2A600}","\u2EEE":"\u9F7F",\uF9C4:"\u9F8D","\u2FD3":"\u9F8D","\uFAD9":"\u9F8E","\u2EF0":"\u9F99",\uF907:"\u9F9C",\uF908:"\u9F9C","\uFACE":"\u9F9C","\u2FD4":"\u9F9C","\u2EF3":"\u9F9F","\u2FD5":"\u9FA0"},re=Ee;function ke(r){return r.replace(/([.?*+^$[\]\\(){}|-])/g,"\\$1")}var Te=RegExp(Object.keys(re).map(ke).join("|"),"g");function Pe(r){return re[r]}function De(r){return r.replace(Te,Pe)}var Be=De,F={exports:{}},ne={};function O(r,e){typeof e=="boolean"&&(e={forever:e}),this._originalTimeouts=JSON.parse(JSON.stringify(r)),this._timeouts=r,this._options=e||{},this._maxRetryTime=e&&e.maxRetryTime||1/0,this._fn=null,this._errors=[],this._attempts=1,this._operationTimeout=null,this._operationTimeoutCb=null,this._timeout=null,this._operationStart=null,this._timer=null,this._options.forever&&(this._cachedTimeouts=this._timeouts.slice(0))}var Le=O;O.prototype.reset=function(){this._attempts=1,this._timeouts=this._originalTimeouts.slice(0)},O.prototype.stop=function(){this._timeout&&clearTimeout(this._timeout),this._timer&&clearTimeout(this._timer),this._timeouts=[],this._cachedTimeouts=null},O.prototype.retry=function(r){if(this._timeout&&clearTimeout(this._timeout),!r)return!1;var e=new Date().getTime();if(r&&e-this._operationStart>=this._maxRetryTime)return this._errors.push(r),this._errors.unshift(new Error("RetryOperation timeout occurred")),!1;this._errors.push(r);var t=this._timeouts.shift();if(t===void 0)if(this._cachedTimeouts)this._errors.splice(0,this._errors.length-1),t=this._cachedTimeouts.slice(-1);else return!1;var n=this;return this._timer=setTimeout(function(){n._attempts++,n._operationTimeoutCb&&(n._timeout=setTimeout(function(){n._operationTimeoutCb(n._attempts)},n._operationTimeout),n._options.unref&&n._timeout.unref()),n._fn(n._attempts)},t),this._options.unref&&this._timer.unref(),!0},O.prototype.attempt=function(r,e){this._fn=r,e&&(e.timeout&&(this._operationTimeout=e.timeout),e.cb&&(this._operationTimeoutCb=e.cb));var t=this;this._operationTimeoutCb&&(this._timeout=setTimeout(function(){t._operationTimeoutCb()},t._operationTimeout)),this._operationStart=new Date().getTime(),this._fn(this._attempts)},O.prototype.try=function(r){console.log("Using RetryOperation.try() is deprecated"),this.attempt(r)},O.prototype.start=function(r){console.log("Using RetryOperation.start() is deprecated"),this.attempt(r)},O.prototype.start=O.prototype.try,O.prototype.errors=function(){return this._errors},O.prototype.attempts=function(){return this._attempts},O.prototype.mainError=function(){if(this._errors.length===0)return null;for(var r={},e=null,t=0,n=0;n<this._errors.length;n++){var o=this._errors[n],i=o.message,s=(r[i]||0)+1;r[i]=s,s>=t&&(e=o,t=s)}return e},function(r){var e=Le;r.operation=function(t){var n=r.timeouts(t);return new e(n,{forever:t&&(t.forever||t.retries===1/0),unref:t&&t.unref,maxRetryTime:t&&t.maxRetryTime})},r.timeouts=function(t){if(t instanceof Array)return[].concat(t);var n={retries:10,factor:2,minTimeout:1*1e3,maxTimeout:1/0,randomize:!1};for(var o in t)n[o]=t[o];if(n.minTimeout>n.maxTimeout)throw new Error("minTimeout is greater than maxTimeout");for(var i=[],s=0;s<n.retries;s++)i.push(this.createTimeout(s,n));return t&&t.forever&&!i.length&&i.push(this.createTimeout(s,n)),i.sort(function(c,f){return c-f}),i},r.createTimeout=function(t,n){var o=n.randomize?Math.random()+1:1,i=Math.round(o*Math.max(n.minTimeout,1)*Math.pow(n.factor,t));return i=Math.min(i,n.maxTimeout),i},r.wrap=function(t,n,o){if(n instanceof Array&&(o=n,n=null),!o){o=[];for(var i in t)typeof t[i]=="function"&&o.push(i)}for(var s=0;s<o.length;s++){var c=o[s],f=t[c];t[c]=function(u){var p=r.operation(n),y=Array.prototype.slice.call(arguments,1),x=y.pop();y.push(function(I){p.retry(I)||(I&&(arguments[0]=p.mainError()),x.apply(this,arguments))}),p.attempt(function(){u.apply(t,y)})}.bind(t,f),t[c].options=n}}}(ne);var Ce=ne;const Ae=Ce,Me=["Failed to fetch","NetworkError when attempting to fetch resource.","The Internet connection appears to be offline.","Network request failed"];class oe 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 Ne=(r,e,t)=>{const n=t.retries-(e-1);return r.attemptNumber=e,r.retriesLeft=n,r},Re=r=>Me.includes(r),ie=(r,e)=>new Promise((t,n)=>{e={onFailedAttempt:()=>{},retries:10,...e};const o=Ae.operation(e);o.attempt(async i=>{try{t(await r(i))}catch(s){if(!(s instanceof Error)){n(new TypeError(`Non-error was thrown: "${s}". You should only throw errors.`));return}if(s instanceof oe)o.stop(),n(s.originalError);else if(s instanceof TypeError&&!Re(s.message))o.stop(),n(s);else{Ne(s,i,e);try{await e.onFailedAttempt(s)}catch(c){n(c);return}o.retry(s)||n(o.mainError())}}})});F.exports=ie,F.exports.default=ie,F.exports.AbortError=oe;var se=P.exports;Object.defineProperty(a,"__esModule",{value:!0}),a.DEFAULT_ALPHABET=void 0,a.alphabetPad=X,a.averageBetweenStrings=ut,a.baseToString=B,a.checkObjectHasKeys=Ve,a.checkObjectHasNoAdditionalKeys=We,a.chunkPromises=st,a.compare=gt,a.decodeParams=Ke,a.deepCompare=W,a.deepCopy=Xe,a.deepSortedObjectEntries=ae,a.defer=nt,a.encodeParams=Fe,a.encodeUri=Ie,a.ensureNoTrailingSlash=et,a.escapeRegExp=le,a.getCrypto=lt,a.globToRegexp=Qe,a.inherits=Ye,a.isFunction=He,a.isNullOrUndefined=rt,a.isNumber=$e,a.lexicographicCompare=fe,a.nextString=ft,a.normalize=ze,a.polyfillSuper=qe,a.prevString=dt,a.promiseMapSeries=ot,a.promiseTry=it,a.recursivelyAssign=de,a.removeDirectionOverrideChars=Ge,a.removeElement=Je,a.removeHiddenChars=ce,a.setCrypto=ct,a.simpleRetryOperation=at,a.sleep=tt,a.stringToBase=C;var je=se(Be),Ue=se(F.exports);function Fe(r){const e=new URLSearchParams;for(const[t,n]of Object.entries(r))n!=null&&e.set(t,String(n));return e.toString()}function Ke(r){const e={},t=new URLSearchParams(r);for(const n of t.keys()){const o=t.getAll(n);e[n]=o.length===1?o[0]:o}return e}function Ie(r,e){for(const t in e)!e.hasOwnProperty(t)||(r=r.replace(t,encodeURIComponent(e[t])));return r}function Je(r,e,t){let n;if(t){for(n=r.length-1;n>=0;n--)if(e(r[n],n,r))return r.splice(n,1),!0}else for(n=0;n<r.length;n++)if(e(r[n],n,r))return r.splice(n,1),!0;return!1}function He(r){return Object.prototype.toString.call(r)==="[object Function]"}function Ve(r,e){for(let t=0;t<e.length;t++)if(!r.hasOwnProperty(e[t]))throw new Error("Missing required key: "+e[t])}function We(r,e){for(const t in r)if(!!r.hasOwnProperty(t)&&e.indexOf(t)===-1)throw new Error("Unknown key: "+t)}function Xe(r){return JSON.parse(JSON.stringify(r))}function W(r,e){if(r===e)return!0;if(typeof r!=typeof e)return!1;if(typeof r=="number"&&isNaN(r)&&isNaN(e))return!0;if(r===null||e===null)return r===e;if(!(r instanceof Object)||r.constructor!==e.constructor||r.prototype!==e.prototype)return!1;if(r instanceof RegExp||r instanceof Date)return r.toString()===e.toString();if(r instanceof Array){if(r.length!==e.length)return!1;for(let t=0;t<r.length;t++)if(!W(r[t],e[t]))return!1}else{let t;for(t in e)if(e.hasOwnProperty(t)!==r.hasOwnProperty(t))return!1;for(t in e)if(e.hasOwnProperty(t)!==r.hasOwnProperty(t)||!W(r[t],e[t]))return!1}return!0}function ae(r){if(typeof r!="object"||r==null||Array.isArray(r))return r;const e=[];for(const[t,n]of Object.entries(r))e.push([t,ae(n)]);return e.sort((t,n)=>fe(t[0],n[0])),e}function Ye(r,e){r.super_=e,r.prototype=Object.create(e.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}})}function qe(r,e,...t){try{e.call(r,...t)}catch{const o=new e(...t);Object.assign(r,o)}}function $e(r){return typeof r=="number"&&isFinite(r)}function ce(r){return typeof r=="string"?(0,je.default)(r.normalize("NFD").replace(Ze,"")):""}function Ge(r){return typeof r=="string"?r.replace(/[\u202d-\u202e]/g,""):""}function ze(r){return ce(r.toLowerCase()).replace(/[\\'!"#$%&()*+,\-./:;<=>?@[\]^_`{|}~\u2000-\u206f\u2e00-\u2e7f]/g,"").toLowerCase()}const Ze=/[\u2000-\u200F\u202A-\u202F\u0300-\u036F\uFEFF\u061C\s]/g;function le(r){return r.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Qe(r,e){e=typeof e=="boolean"?e:!0;let t=le(r);return t=t.replace(/\\\*/g,".*"),t=t.replace(/\?/g,"."),e&&(t=t.replace(/\\\[(!|)(.*)\\]/g,function(n,o,i,s,c){const f=o&&"^"||"",l=i.replace(/\\-/,"-");return"["+f+l+"]"})),t}function et(r){return r&&r.endsWith("/")?r.substr(0,r.length-1):r}function tt(r,e){return new Promise(t=>{setTimeout(t,r,e)})}function rt(r){return r==null}function nt(){let r,e;const t=new Promise((n,o)=>{r=n,e=o});return{resolve:r,reject:e,promise:t}}async function ot(r,e){for(const t of r)await e(await t)}function it(r){return new Promise(e=>e(r()))}async function st(r,e){const t=[];for(let n=0;n<r.length;n+=e)t.push(...await Promise.all(r.slice(n,n+e).map(o=>o())));return t}function at(r){return(0,Ue.default)(e=>r(e),{forever:!0,factor:2,minTimeout:3e3,maxTimeout:15e3})}let ue;function ct(r){ue=r}function lt(){return ue}const E=(()=>{let r="";for(let e=32;e<=126;e++)r+=String.fromCharCode(e);return r})();a.DEFAULT_ALPHABET=E;function X(r,e,t=E){return r.padEnd(e,t[0])}function B(r,e=E){const t=BigInt(e.length);if(r<=t){var n;return(n=e[Number(r)-1])!==null&&n!==void 0?n:""}let o=r/t,i=Number(r%t)-1;return i<0&&(o-=BigInt(Math.abs(i)),i=Number(t)-1),B(o,e)+e[i]}function C(r,e=E){const t=BigInt(e.length);let n=BigInt(0);for(let o=r.length-1,i=BigInt(0);o>=0;o--,i++){const s=r.charCodeAt(o)-e.charCodeAt(0);n+=BigInt(1+s)*t**i}return n}function ut(r,e,t=E){const n=Math.max(r.length,e.length),o=C(X(r,n,t),t),i=C(X(e,n,t),t),s=(o+i)/BigInt(2);return s===o||s==i?B(s,t)+t[0]:B(s,t)}function ft(r,e=E){return B(C(r,e)+BigInt(1),e)}function dt(r,e=E){return B(C(r,e)-BigInt(1),e)}function fe(r,e){return r<e?-1:r===e?0:1}const pt=new Intl.Collator;function gt(r,e){return pt.compare(r,e)}function de(r,e,t=!1){for(const[n,o]of Object.entries(e)){if(r[n]instanceof Object&&o){de(r[n],o);continue}if(o!=null||!t){r[n]=o;continue}}return r}var ht=P.exports;Object.defineProperty(S,"__esModule",{value:!0}),S.SyncAccumulator=S.Category=void 0;var A=ht(j.exports),mt=D,vt=a;let _;S.Category=_,function(r){r.Invite="invite",r.Leave="leave",r.Join="join"}(_||(S.Category=_={}));class yt{constructor(e={}){this.opts=e,(0,A.default)(this,"accountData",{}),(0,A.default)(this,"inviteRooms",{}),(0,A.default)(this,"joinRooms",{}),(0,A.default)(this,"nextBatch",null),(0,A.default)(this,"groups",{invite:{},join:{},leave:{}}),this.opts.maxTimelineEntries=this.opts.maxTimelineEntries||50}accumulate(e,t=!1){this.accumulateRooms(e,t),this.accumulateGroups(e),this.accumulateAccountData(e),this.nextBatch=e.next_batch}accumulateAccountData(e){!e.account_data||!e.account_data.events||e.account_data.events.forEach(t=>{this.accountData[t.type]=t})}accumulateRooms(e,t=!1){!e.rooms||(e.rooms.invite&&Object.keys(e.rooms.invite).forEach(n=>{this.accumulateRoom(n,_.Invite,e.rooms.invite[n],t)}),e.rooms.join&&Object.keys(e.rooms.join).forEach(n=>{this.accumulateRoom(n,_.Join,e.rooms.join[n],t)}),e.rooms.leave&&Object.keys(e.rooms.leave).forEach(n=>{this.accumulateRoom(n,_.Leave,e.rooms.leave[n],t)}))}accumulateRoom(e,t,n,o=!1){switch(t){case _.Invite:this.accumulateInviteState(e,n);break;case _.Join:this.inviteRooms[e]&&delete this.inviteRooms[e],this.accumulateJoinState(e,n,o);break;case _.Leave:this.inviteRooms[e]?delete this.inviteRooms[e]:delete this.joinRooms[e];break;default:mt.logger.error("Unknown cateogory: ",t)}}accumulateInviteState(e,t){if(!t.invite_state||!t.invite_state.events)return;if(!this.inviteRooms[e]){this.inviteRooms[e]={invite_state:t.invite_state};return}const n=this.inviteRooms[e];t.invite_state.events.forEach(o=>{let i=!1;for(let s=0;s<n.invite_state.events.length;s++){const c=n.invite_state.events[s];c.type===o.type&&c.state_key==o.state_key&&(n.invite_state.events[s]=o,i=!0)}i||n.invite_state.events.push(o)})}accumulateJoinState(e,t,n=!1){this.joinRooms[e]||(this.joinRooms[e]={_currentState:Object.create(null),_timeline:[],_accountData:Object.create(null),_unreadNotifications:{},_summary:{},_readReceipts:{}});const o=this.joinRooms[e];if(t.account_data&&t.account_data.events&&t.account_data.events.forEach(i=>{o._accountData[i.type]=i}),t.unread_notifications&&(o._unreadNotifications=t.unread_notifications),t.summary){const i="m.heroes",s="m.invited_member_count",c="m.joined_member_count",f=o._summary,l=t.summary;f[i]=l[i]||f[i],f[c]=l[c]||f[c],f[s]=l[s]||f[s]}if(t.ephemeral&&t.ephemeral.events&&t.ephemeral.events.forEach(i=>{i.type!=="m.receipt"||!i.content||Object.keys(i.content).forEach(s=>{!i.content[s]["m.read"]||Object.keys(i.content[s]["m.read"]).forEach(c=>{o._readReceipts[c]={data:i.content[s]["m.read"][c],eventId:s}})})}),t.timeline&&t.timeline.limited&&(o._timeline=[]),t.state&&t.state.events&&t.state.events.forEach(i=>{Y(o._currentState,i)}),t.timeline&&t.timeline.events&&t.timeline.events.forEach((i,s)=>{Y(o._currentState,i);let c;if(n)c=i;else{c=Object.assign({},i),c.unsigned!==void 0&&(c.unsigned=Object.assign({},c.unsigned));const f=i.unsigned?i.unsigned.age:i.age;f!==void 0&&(c._localTs=Date.now()-f)}o._timeline.push({event:c,token:s===0?t.timeline.prev_batch:null})}),o._timeline.length>this.opts.maxTimelineEntries){const i=o._timeline.length-this.opts.maxTimelineEntries;for(let s=i;s<o._timeline.length;s++)if(o._timeline[s].token){o._timeline=o._timeline.slice(s,o._timeline.length);break}}}accumulateGroups(e){!e.groups||(e.groups.invite&&Object.keys(e.groups.invite).forEach(t=>{this.accumulateGroup(t,_.Invite,e.groups.invite[t])}),e.groups.join&&Object.keys(e.groups.join).forEach(t=>{this.accumulateGroup(t,_.Join,e.groups.join[t])}),e.groups.leave&&Object.keys(e.groups.leave).forEach(t=>{this.accumulateGroup(t,_.Leave,e.groups.leave[t])}))}accumulateGroup(e,t,n){for(const o of[_.Invite,_.Leave,_.Join])delete this.groups[o][e];this.groups[t][e]=n}getJSON(e=!1){const t={join:{},invite:{},leave:{}};Object.keys(this.inviteRooms).forEach(o=>{t.invite[o]=this.inviteRooms[o]}),Object.keys(this.joinRooms).forEach(o=>{const i=this.joinRooms[o],s={ephemeral:{events:[]},account_data:{events:[]},state:{events:[]},timeline:{events:[],prev_batch:null},unread_notifications:i._unreadNotifications,summary:i._summary};Object.keys(i._accountData).forEach(l=>{s.account_data.events.push(i._accountData[l])});const c={type:"m.receipt",room_id:o,content:{}};Object.keys(i._readReceipts).forEach(l=>{const u=i._readReceipts[l];c.content[u.eventId]||(c.content[u.eventId]={"m.read":{}}),c.content[u.eventId]["m.read"][l]=u.data}),Object.keys(c.content).length>0&&s.ephemeral.events.push(c),i._timeline.forEach(l=>{if(!s.timeline.prev_batch){if(!l.token)return;s.timeline.prev_batch=l.token}let u;!e&&l.event._localTs?(u=Object.assign({},l.event),u.unsigned!==void 0&&(u.unsigned=Object.assign({},u.unsigned)),delete u._localTs,u.unsigned=u.unsigned||{},u.unsigned.age=Date.now()-l.event._localTs):u=l.event,s.timeline.events.push(u)});const f=Object.create(null);for(let l=s.timeline.events.length-1;l>=0;l--){const u=s.timeline.events[l];if(u.state_key===null||u.state_key===void 0)continue;const p=(0,vt.deepCopy)(u);p.unsigned&&(p.unsigned.prev_content&&(p.content=p.unsigned.prev_content),p.unsigned.prev_sender&&(p.sender=p.unsigned.prev_sender)),Y(f,p)}Object.keys(i._currentState).forEach(l=>{Object.keys(i._currentState[l]).forEach(u=>{let p=i._currentState[l][u];f[l]&&f[l][u]&&(p=f[l][u]),s.state.events.push(p)})}),t.join[o]=s});const n=[];return Object.keys(this.accountData).forEach(o=>{n.push(this.accountData[o])}),{nextBatch:this.nextBatch,roomsData:t,groupsData:this.groups,accountData:n}}getNextBatchToken(){return this.nextBatch}}S.SyncAccumulator=yt;function Y(r,e){e.state_key===null||e.state_key===void 0||!e.type||(r[e.type]||(r[e.type]=Object.create(null)),r[e.type][e.state_key]=e)}var q={};Object.defineProperty(q,"__esModule",{value:!0}),q.exists=bt;function bt(r,e){return new Promise((t,n)=>{let o=!0;const i=r.open(e);i.onupgradeneeded=()=>{o=!1},i.onblocked=()=>n(i.error),i.onsuccess=()=>{i.result.close(),o||r.deleteDatabase(e),t(o)},i.onerror=s=>n(i.error)})}var _t=P.exports;Object.defineProperty(U,"__esModule",{value:!0}),U.LocalIndexedDBStoreBackend=void 0;var M=_t(j.exports),Ot=S,k=ge(a),xt=ge(q),m=D;function pe(r){if(typeof WeakMap!="function")return null;var e=new WeakMap,t=new WeakMap;return(pe=function(n){return n?t:e})(r)}function ge(r,e){if(!e&&r&&r.__esModule)return r;if(r===null||typeof r!="object"&&typeof r!="function")return{default:r};var t=pe(e);if(t&&t.has(r))return t.get(r);var n={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in r)if(i!=="default"&&Object.prototype.hasOwnProperty.call(r,i)){var s=o?Object.getOwnPropertyDescriptor(r,i):null;s&&(s.get||s.set)?Object.defineProperty(n,i,s):n[i]=r[i]}return n.default=r,t&&t.set(r,n),n}const wt=3;function St(r){r.createObjectStore("users",{keyPath:["userId"]}),r.createObjectStore("accountData",{keyPath:["type"]}),r.createObjectStore("sync",{keyPath:["clobber"]})}function Et(r){r.createObjectStore("oob_membership_events",{keyPath:["room_id","state_key"]}).createIndex("room","room_id")}function kt(r){r.createObjectStore("client_options",{keyPath:["clobber"]})}function K(r,e,t){const n=r.openCursor(e);return new Promise((o,i)=>{const s=[];n.onerror=()=>{i(new Error("Query failed: "+n.error))},n.onsuccess=()=>{const c=n.result;if(!c){o(s);return}s.push(t(c)),c.continue()}})}function N(r){return new Promise((e,t)=>{r.oncomplete=function(n){e(n)},r.onerror=function(){t(r.error)}})}function he(r){return new Promise((e,t)=>{r.onsuccess=function(n){e(n)},r.onerror=function(){t(r.error)}})}function Tt(r){return new Promise((e,t)=>{r.onsuccess=()=>e(r),r.onerror=n=>t(n)})}function me(r){return he(r).then(e=>r.result)}class Pt{static exists(e,t){return t="matrix-js-sdk:"+(t||"default"),xt.exists(e,t)}constructor(e,t){this.indexedDB=e,(0,M.default)(this,"dbName",void 0),(0,M.default)(this,"syncAccumulator",void 0),(0,M.default)(this,"db",null),(0,M.default)(this,"disconnected",!0),(0,M.default)(this,"_isNewlyCreated",!1),this.dbName="matrix-js-sdk:"+(t||"default"),this.syncAccumulator=new Ot.SyncAccumulator}connect(){if(!this.disconnected)return m.logger.log("LocalIndexedDBStoreBackend.connect: already connected or connecting"),Promise.resolve();this.disconnected=!1,m.logger.log("LocalIndexedDBStoreBackend.connect: connecting...");const e=this.indexedDB.open(this.dbName,wt);return e.onupgradeneeded=t=>{const n=e.result,o=t.oldVersion;m.logger.log(`LocalIndexedDBStoreBackend.connect: upgrading from ${o}`),o<1&&(this._isNewlyCreated=!0,St(n)),o<2&&Et(n),o<3&&kt(n)},e.onblocked=()=>{m.logger.log("can't yet open LocalIndexedDBStoreBackend because it is open elsewhere")},m.logger.log("LocalIndexedDBStoreBackend.connect: awaiting connection..."),he(e).then(()=>(m.logger.log("LocalIndexedDBStoreBackend.connect: connected"),this.db=e.result,this.db.onversionchange=()=>{this.db.close()},this.init()))}isNewlyCreated(){return Promise.resolve(this._isNewlyCreated)}init(){return Promise.all([this.loadAccountData(),this.loadSyncData()]).then(([e,t])=>{m.logger.log("LocalIndexedDBStoreBackend: loaded initial data"),this.syncAccumulator.accumulate({next_batch:t.nextBatch,rooms:t.roomsData,groups:t.groupsData,account_data:{events:e}},!0)})}getOutOfBandMembers(e){return new Promise((t,n)=>{const s=this.db.transaction(["oob_membership_events"],"readonly").objectStore("oob_membership_events").index("room"),c=IDBKeyRange.only(e),f=s.openCursor(c),l=[];let u=!1;f.onsuccess=()=>{const p=f.result;if(!p)return!l.length&&!u?t(null):t(l);const y=p.value;y.oob_written?u=!0:l.push(y),p.continue()},f.onerror=p=>{n(p)}}).then(t=>(m.logger.log(`LL: got ${t&&t.length} membershipEvents from storage for room ${e} ...`),t))}async setOutOfBandMembers(e,t){m.logger.log(`LL: backend about to store ${t.length} members for ${e}`);const n=this.db.transaction(["oob_membership_events"],"readwrite"),o=n.objectStore("oob_membership_events");t.forEach(s=>{o.put(s)});const i={room_id:e,oob_written:!0,state_key:0};o.put(i),await N(n),m.logger.log(`LL: backend done storing for ${e}!`)}async clearOutOfBandMembers(e){const o=this.db.transaction(["oob_membership_events"],"readonly").objectStore("oob_membership_events").index("room"),i=IDBKeyRange.only(e),s=me(o.openKeyCursor(i,"next")).then(x=>x&&x.primaryKey[1]),c=me(o.openKeyCursor(i,"prev")).then(x=>x&&x.primaryKey[1]),[f,l]=await Promise.all([s,c]),p=this.db.transaction(["oob_membership_events"],"readwrite").objectStore("oob_membership_events"),y=IDBKeyRange.bound([e,f],[e,l]);m.logger.log(`LL: Deleting all users + marker in storage for room ${e}, with key range:`,[e,f],[e,l]),await Tt(p.delete(y))}clearDatabase(){return new Promise(e=>{m.logger.log(`Removing indexeddb instance: ${this.dbName}`);const t=this.indexedDB.deleteDatabase(this.dbName);t.onblocked=()=>{m.logger.log(`can't yet delete indexeddb ${this.dbName} because it is open elsewhere`)},t.onerror=()=>{m.logger.warn(`unable to delete js-sdk store indexeddb: ${t.error}`),e()},t.onsuccess=()=>{m.logger.log(`Removed indexeddb instance: ${this.dbName}`),e()}})}getSavedSync(e=!0){const t=this.syncAccumulator.getJSON();return t.nextBatch?e?Promise.resolve(k.deepCopy(t)):Promise.resolve(t):Promise.resolve(null)}getNextBatchToken(){return Promise.resolve(this.syncAccumulator.getNextBatchToken())}setSyncData(e){return Promise.resolve().then(()=>{this.syncAccumulator.accumulate(e)})}async syncToDatabase(e){const t=this.syncAccumulator.getJSON(!0);await Promise.all([this.persistUserPresenceEvents(e),this.persistAccountData(t.accountData),this.persistSyncData(t.nextBatch,t.roomsData,t.groupsData)])}persistSyncData(e,t,n){return m.logger.log("Persisting sync data up to",e),k.promiseTry(()=>{const o=this.db.transaction(["sync"],"readwrite");return o.objectStore("sync").put({clobber:"-",nextBatch:e,roomsData:t,groupsData:n}),N(o).then()})}persistAccountData(e){return k.promiseTry(()=>{const t=this.db.transaction(["accountData"],"readwrite"),n=t.objectStore("accountData");for(let o=0;o<e.length;o++)n.put(e[o]);return N(t).then()})}persistUserPresenceEvents(e){return k.promiseTry(()=>{const t=this.db.transaction(["users"],"readwrite"),n=t.objectStore("users");for(const o of e)n.put({userId:o[0],event:o[1]});return N(t).then()})}getUserPresenceEvents(){return k.promiseTry(()=>{const t=this.db.transaction(["users"],"readonly").objectStore("users");return K(t,void 0,n=>[n.value.userId,n.value.event])})}loadAccountData(){return m.logger.log("LocalIndexedDBStoreBackend: loading account data..."),k.promiseTry(()=>{const t=this.db.transaction(["accountData"],"readonly").objectStore("accountData");return K(t,void 0,n=>n.value).then(n=>(m.logger.log("LocalIndexedDBStoreBackend: loaded account data"),n))})}loadSyncData(){return m.logger.log("LocalIndexedDBStoreBackend: loading sync data..."),k.promiseTry(()=>{const t=this.db.transaction(["sync"],"readonly").objectStore("sync");return K(t,void 0,n=>n.value).then(n=>(m.logger.log("LocalIndexedDBStoreBackend: loaded sync data"),n.length>1&&m.logger.warn("loadSyncData: More than 1 sync row found."),n.length>0?n[0]:{}))})}getClientOptions(){return Promise.resolve().then(()=>{const t=this.db.transaction(["client_options"],"readonly").objectStore("client_options");return K(t,void 0,n=>{if(n.value&&n.value&&n.value.options)return n.value.options}).then(n=>n[0])})}async storeClientOptions(e){const t=this.db.transaction(["client_options"],"readwrite");t.objectStore("client_options").put({clobber:"-",options:e}),await N(t)}}U.LocalIndexedDBStoreBackend=Pt;var Dt=P.exports;Object.defineProperty(R,"__esModule",{value:!0}),R.IndexedDBStoreWorker=void 0;var ve=Dt(j.exports),Bt=U,ye=D;class Lt{constructor(e){this.postMessage=e,(0,ve.default)(this,"backend",null),(0,ve.default)(this,"onMessage",t=>{const n=t.data;let o;switch(n.command){case"_setupWorker":this.backend=new Bt.LocalIndexedDBStoreBackend(indexedDB,n.args[0]),o=Promise.resolve();break;case"connect":o=this.backend.connect();break;case"isNewlyCreated":o=this.backend.isNewlyCreated();break;case"clearDatabase":o=this.backend.clearDatabase();break;case"getSavedSync":o=this.backend.getSavedSync(!1);break;case"setSyncData":o=this.backend.setSyncData(n.args[0]);break;case"syncToDatabase":o=this.backend.syncToDatabase(n.args[0]);break;case"getUserPresenceEvents":o=this.backend.getUserPresenceEvents();break;case"getNextBatchToken":o=this.backend.getNextBatchToken();break;case"getOutOfBandMembers":o=this.backend.getOutOfBandMembers(n.args[0]);break;case"clearOutOfBandMembers":o=this.backend.clearOutOfBandMembers(n.args[0]);break;case"setOutOfBandMembers":o=this.backend.setOutOfBandMembers(n.args[0],n.args[1]);break;case"getClientOptions":o=this.backend.getClientOptions();break;case"storeClientOptions":o=this.backend.storeClientOptions(n.args[0]);break}if(o===void 0){this.postMessage({command:"cmd_fail",seq:n.seq,error:"Unrecognised command"});return}o.then(i=>{this.postMessage.call(null,{command:"cmd_success",seq:n.seq,result:i})},i=>{ye.logger.error("Error running command: "+n.command),ye.logger.error(i),this.postMessage.call(null,{command:"cmd_fail",seq:n.seq,error:{message:i.message,name:i.name}})})})}}R.IndexedDBStoreWorker=Lt,function(r){Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"IndexedDBStoreWorker",{enumerable:!0,get:function(){return e.IndexedDBStoreWorker}});var e=R}(G);const be=self,Ct=new G.IndexedDBStoreWorker(be.postMessage);be.onmessage=Ct.onMessage})();
diff --git a/pr-121/assets/vendor.09079154.js b/pr-121/assets/vendor.09079154.js
@@ -1,44 +0,0 @@
-var G_=Object.defineProperty,W_=Object.defineProperties;var H_=Object.getOwnPropertyDescriptors;var $f=Object.getOwnPropertySymbols;var Y_=Object.prototype.hasOwnProperty,z_=Object.prototype.propertyIsEnumerable;var Nf=(n,e,t)=>e in n?G_(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,gc=(n,e)=>{for(var t in e||(e={}))Y_.call(e,t)&&Nf(n,t,e[t]);if($f)for(var t of $f(e))z_.call(e,t)&&Nf(n,t,e[t]);return n},Lf=(n,e)=>W_(n,H_(e));var za,J,qm,jm,Ra,Vm,Bf,Gm,dl={},Wm=[],J_=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i;function zn(n,e){for(var t in e)n[t]=e[t];return n}function Hm(n){var e=n.parentNode;e&&e.removeChild(n)}function wt(n,e,t){var r,i,s,o={};for(s in e)s=="key"?r=e[s]:s=="ref"?i=e[s]:o[s]=e[s];if(arguments.length>2&&(o.children=arguments.length>3?za.call(arguments,2):t),typeof n=="function"&&n.defaultProps!=null)for(s in n.defaultProps)o[s]===void 0&&(o[s]=n.defaultProps[s]);return Ia(n,o,r,i,null)}function Ia(n,e,t,r,i){var s={type:n,props:e,key:t,ref:r,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:i==null?++qm:i};return i==null&&J.vnode!=null&&J.vnode(s),s}function Wh(){return{current:null}}function $r(n){return n.children}function Ur(n,e){this.props=n,this.context=e}function Eo(n,e){if(e==null)return n.__?Eo(n.__,n.__.__k.indexOf(n)+1):null;for(var t;e<n.__k.length;e++)if((t=n.__k[e])!=null&&t.__e!=null)return t.__e;return typeof n.type=="function"?Eo(n):null}function Ym(n){var e,t;if((n=n.__)!=null&&n.__c!=null){for(n.__e=n.__c.base=null,e=0;e<n.__k.length;e++)if((t=n.__k[e])!=null&&t.__e!=null){n.__e=n.__c.base=t.__e;break}return Ym(n)}}function Td(n){(!n.__d&&(n.__d=!0)&&Ra.push(n)&&!hl.__r++||Bf!==J.debounceRendering)&&((Bf=J.debounceRendering)||Vm)(hl)}function hl(){for(var n;hl.__r=Ra.length;)n=Ra.sort(function(e,t){return e.__v.__b-t.__v.__b}),Ra=[],n.some(function(e){var t,r,i,s,o,a;e.__d&&(o=(s=(t=e).__v).__e,(a=t.__P)&&(r=[],(i=zn({},s)).__v=s.__v+1,Hh(a,s,i,t.__n,a.ownerSVGElement!==void 0,s.__h!=null?[o]:null,r,o==null?Eo(s):o,s.__h),Qm(r,s),s.__e!=o&&Ym(s)))})}function zm(n,e,t,r,i,s,o,a,l,u){var c,g,m,f,E,I,w,k=r&&r.__k||Wm,C=k.length;for(t.__k=[],c=0;c<e.length;c++)if((f=t.__k[c]=(f=e[c])==null||typeof f=="boolean"?null:typeof f=="string"||typeof f=="number"||typeof f=="bigint"?Ia(null,f,null,null,f):Array.isArray(f)?Ia($r,{children:f},null,null,null):f.__b>0?Ia(f.type,f.props,f.key,null,f.__v):f)!=null){if(f.__=t,f.__b=t.__b+1,(m=k[c])===null||m&&f.key==m.key&&f.type===m.type)k[c]=void 0;else for(g=0;g<C;g++){if((m=k[g])&&f.key==m.key&&f.type===m.type){k[g]=void 0;break}m=null}Hh(n,f,m=m||dl,i,s,o,a,l,u),E=f.__e,(g=f.ref)&&m.ref!=g&&(w||(w=[]),m.ref&&w.push(m.ref,null,f),w.push(g,f.__c||E,f)),E!=null?(I==null&&(I=E),typeof f.type=="function"&&f.__k===m.__k?f.__d=l=Jm(f,l,n):l=Xm(n,f,m,k,E,l),typeof t.type=="function"&&(t.__d=l)):l&&m.__e==l&&l.parentNode!=n&&(l=Eo(m))}for(t.__e=I,c=C;c--;)k[c]!=null&&(typeof t.type=="function"&&k[c].__e!=null&&k[c].__e==t.__d&&(t.__d=Eo(r,c+1)),ey(k[c],k[c]));if(w)for(c=0;c<w.length;c++)Zm(w[c],w[++c],w[++c])}function Jm(n,e,t){for(var r,i=n.__k,s=0;i&&s<i.length;s++)(r=i[s])&&(r.__=n,e=typeof r.type=="function"?Jm(r,e,t):Xm(t,r,r,i,r.__e,e));return e}function wn(n,e){return e=e||[],n==null||typeof n=="boolean"||(Array.isArray(n)?n.some(function(t){wn(t,e)}):e.push(n)),e}function Xm(n,e,t,r,i,s){var o,a,l;if(e.__d!==void 0)o=e.__d,e.__d=void 0;else if(t==null||i!=s||i.parentNode==null)e:if(s==null||s.parentNode!==n)n.appendChild(i),o=null;else{for(a=s,l=0;(a=a.nextSibling)&&l<r.length;l+=2)if(a==i)break e;n.insertBefore(i,s),o=s}return o!==void 0?o:i.nextSibling}function X_(n,e,t,r,i){var s;for(s in t)s==="children"||s==="key"||s in e||fl(n,s,null,t[s],r);for(s in e)i&&typeof e[s]!="function"||s==="children"||s==="key"||s==="value"||s==="checked"||t[s]===e[s]||fl(n,s,e[s],t[s],r)}function Kf(n,e,t){e[0]==="-"?n.setProperty(e,t):n[e]=t==null?"":typeof t!="number"||J_.test(e)?t:t+"px"}function fl(n,e,t,r,i){var s;e:if(e==="style")if(typeof t=="string")n.style.cssText=t;else{if(typeof r=="string"&&(n.style.cssText=r=""),r)for(e in r)t&&e in t||Kf(n.style,e,"");if(t)for(e in t)r&&t[e]===r[e]||Kf(n.style,e,t[e])}else if(e[0]==="o"&&e[1]==="n")s=e!==(e=e.replace(/Capture$/,"")),e=e.toLowerCase()in n?e.toLowerCase().slice(2):e.slice(2),n.l||(n.l={}),n.l[e+s]=t,t?r||n.addEventListener(e,s?qf:Ff,s):n.removeEventListener(e,s?qf:Ff,s);else if(e!=="dangerouslySetInnerHTML"){if(i)e=e.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(e!=="href"&&e!=="list"&&e!=="form"&&e!=="tabIndex"&&e!=="download"&&e in n)try{n[e]=t==null?"":t;break e}catch{}typeof t=="function"||(t!=null&&(t!==!1||e[0]==="a"&&e[1]==="r")?n.setAttribute(e,t):n.removeAttribute(e))}}function Ff(n){this.l[n.type+!1](J.event?J.event(n):n)}function qf(n){this.l[n.type+!0](J.event?J.event(n):n)}function Hh(n,e,t,r,i,s,o,a,l){var u,c,g,m,f,E,I,w,k,C,S,T=e.type;if(e.constructor!==void 0)return null;t.__h!=null&&(l=t.__h,a=e.__e=t.__e,e.__h=null,s=[a]),(u=J.__b)&&u(e);try{e:if(typeof T=="function"){if(w=e.props,k=(u=T.contextType)&&r[u.__c],C=u?k?k.props.value:u.__:r,t.__c?I=(c=e.__c=t.__c).__=c.__E:("prototype"in T&&T.prototype.render?e.__c=c=new T(w,C):(e.__c=c=new Ur(w,C),c.constructor=T,c.render=Z_),k&&k.sub(c),c.props=w,c.state||(c.state={}),c.context=C,c.__n=r,g=c.__d=!0,c.__h=[]),c.__s==null&&(c.__s=c.state),T.getDerivedStateFromProps!=null&&(c.__s==c.state&&(c.__s=zn({},c.__s)),zn(c.__s,T.getDerivedStateFromProps(w,c.__s))),m=c.props,f=c.state,g)T.getDerivedStateFromProps==null&&c.componentWillMount!=null&&c.componentWillMount(),c.componentDidMount!=null&&c.__h.push(c.componentDidMount);else{if(T.getDerivedStateFromProps==null&&w!==m&&c.componentWillReceiveProps!=null&&c.componentWillReceiveProps(w,C),!c.__e&&c.shouldComponentUpdate!=null&&c.shouldComponentUpdate(w,c.__s,C)===!1||e.__v===t.__v){c.props=w,c.state=c.__s,e.__v!==t.__v&&(c.__d=!1),c.__v=e,e.__e=t.__e,e.__k=t.__k,e.__k.forEach(function(D){D&&(D.__=e)}),c.__h.length&&o.push(c);break e}c.componentWillUpdate!=null&&c.componentWillUpdate(w,c.__s,C),c.componentDidUpdate!=null&&c.__h.push(function(){c.componentDidUpdate(m,f,E)})}c.context=C,c.props=w,c.state=c.__s,(u=J.__r)&&u(e),c.__d=!1,c.__v=e,c.__P=n,u=c.render(c.props,c.state,c.context),c.state=c.__s,c.getChildContext!=null&&(r=zn(zn({},r),c.getChildContext())),g||c.getSnapshotBeforeUpdate==null||(E=c.getSnapshotBeforeUpdate(m,f)),S=u!=null&&u.type===$r&&u.key==null?u.props.children:u,zm(n,Array.isArray(S)?S:[S],e,t,r,i,s,o,a,l),c.base=e.__e,e.__h=null,c.__h.length&&o.push(c),I&&(c.__E=c.__=null),c.__e=!1}else s==null&&e.__v===t.__v?(e.__k=t.__k,e.__e=t.__e):e.__e=Q_(t.__e,e,t,r,i,s,o,l);(u=J.diffed)&&u(e)}catch(D){e.__v=null,(l||s!=null)&&(e.__e=a,e.__h=!!l,s[s.indexOf(a)]=null),J.__e(D,e,t)}}function Qm(n,e){J.__c&&J.__c(e,n),n.some(function(t){try{n=t.__h,t.__h=[],n.some(function(r){r.call(t)})}catch(r){J.__e(r,t.__v)}})}function Q_(n,e,t,r,i,s,o,a){var l,u,c,g=t.props,m=e.props,f=e.type,E=0;if(f==="svg"&&(i=!0),s!=null){for(;E<s.length;E++)if((l=s[E])&&"setAttribute"in l==!!f&&(f?l.localName===f:l.nodeType===3)){n=l,s[E]=null;break}}if(n==null){if(f===null)return document.createTextNode(m);n=i?document.createElementNS("http://www.w3.org/2000/svg",f):document.createElement(f,m.is&&m),s=null,a=!1}if(f===null)g===m||a&&n.data===m||(n.data=m);else{if(s=s&&za.call(n.childNodes),u=(g=t.props||dl).dangerouslySetInnerHTML,c=m.dangerouslySetInnerHTML,!a){if(s!=null)for(g={},E=0;E<n.attributes.length;E++)g[n.attributes[E].name]=n.attributes[E].value;(c||u)&&(c&&(u&&c.__html==u.__html||c.__html===n.innerHTML)||(n.innerHTML=c&&c.__html||""))}if(X_(n,m,g,i,a),c)e.__k=[];else if(E=e.props.children,zm(n,Array.isArray(E)?E:[E],e,t,r,i&&f!=="foreignObject",s,o,s?s[0]:t.__k&&Eo(t,0),a),s!=null)for(E=s.length;E--;)s[E]!=null&&Hm(s[E]);a||("value"in m&&(E=m.value)!==void 0&&(E!==n.value||f==="progress"&&!E||f==="option"&&E!==g.value)&&fl(n,"value",E,g.value,!1),"checked"in m&&(E=m.checked)!==void 0&&E!==n.checked&&fl(n,"checked",E,g.checked,!1))}return n}function Zm(n,e,t){try{typeof n=="function"?n(e):n.current=e}catch(r){J.__e(r,t)}}function ey(n,e,t){var r,i;if(J.unmount&&J.unmount(n),(r=n.ref)&&(r.current&&r.current!==n.__e||Zm(r,null,e)),(r=n.__c)!=null){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(s){J.__e(s,e)}r.base=r.__P=null}if(r=n.__k)for(i=0;i<r.length;i++)r[i]&&ey(r[i],e,typeof n.type!="function");t||n.__e==null||Hm(n.__e),n.__e=n.__d=void 0}function Z_(n,e,t){return this.constructor(n,t)}function So(n,e,t){var r,i,s;J.__&&J.__(n,e),i=(r=typeof t=="function")?null:t&&t.__k||e.__k,s=[],Hh(e,n=(!r&&t||e).__k=wt($r,null,[n]),i||dl,dl,e.ownerSVGElement!==void 0,!r&&t?[t]:i?null:e.firstChild?za.call(e.childNodes):null,s,!r&&t?t:i?i.__e:e.firstChild,r),Qm(s,n)}function Yh(n,e){So(n,e,Yh)}function ty(n,e,t){var r,i,s,o=zn({},n.props);for(s in e)s=="key"?r=e[s]:s=="ref"?i=e[s]:o[s]=e[s];return arguments.length>2&&(o.children=arguments.length>3?za.call(arguments,2):t),Ia(n.type,o,r||n.key,i||n.ref,null)}function Ao(n,e){var t={__c:e="__cC"+Gm++,__:n,Consumer:function(r,i){return r.children(i)},Provider:function(r){var i,s;return this.getChildContext||(i=[],(s={})[e]=this,this.getChildContext=function(){return s},this.shouldComponentUpdate=function(o){this.props.value!==o.value&&i.some(Td)},this.sub=function(o){i.push(o);var a=o.componentWillUnmount;o.componentWillUnmount=function(){i.splice(i.indexOf(o),1),a&&a.call(o)}}),r.children}};return t.Provider.__=t.Consumer.contextType=t}za=Wm.slice,J={__e:function(n,e,t,r){for(var i,s,o;e=e.__;)if((i=e.__c)&&!i.__)try{if((s=i.constructor)&&s.getDerivedStateFromError!=null&&(i.setState(s.getDerivedStateFromError(n)),o=i.__d),i.componentDidCatch!=null&&(i.componentDidCatch(n,r||{}),o=i.__d),o)return i.__E=i}catch(a){n=a}throw n}},qm=0,jm=function(n){return n!=null&&n.constructor===void 0},Ur.prototype.setState=function(n,e){var t;t=this.__s!=null&&this.__s!==this.state?this.__s:this.__s=zn({},this.state),typeof n=="function"&&(n=n(zn({},t),this.props)),n&&zn(t,n),n!=null&&this.__v&&(e&&this.__h.push(e),Td(this))},Ur.prototype.forceUpdate=function(n){this.__v&&(this.__e=!0,n&&this.__h.push(n),Td(this))},Ur.prototype.render=$r,Ra=[],Vm=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,hl.__r=0,Gm=0;var eE=Object.freeze(Object.defineProperty({__proto__:null,render:So,hydrate:Yh,createElement:wt,h:wt,Fragment:$r,createRef:Wh,get isValidElement(){return jm},Component:Ur,cloneElement:ty,createContext:Ao,toChildArray:wn,get options(){return J}},Symbol.toStringTag,{value:"Module"})),Os,bt,jf,bo=0,ry=[],Vf=J.__b,Gf=J.__r,Wf=J.diffed,Hf=J.__c,Yf=J.unmount;function Do(n,e){J.__h&&J.__h(bt,n,bo||e),bo=0;var t=bt.__H||(bt.__H={__:[],__h:[]});return n>=t.__.length&&t.__.push({}),t.__[n]}function Ml(n){return bo=1,zh(sy,n)}function zh(n,e,t){var r=Do(Os++,2);return r.t=n,r.__c||(r.__=[t?t(e):sy(void 0,e),function(i){var s=r.t(r.__[0],i);r.__[0]!==s&&(r.__=[s,r.__[1]],r.__c.setState({}))}],r.__c=bt),r.__}function Jh(n,e){var t=Do(Os++,3);!J.__s&&Xh(t.__H,e)&&(t.__=n,t.__H=e,bt.__H.__h.push(t))}function Al(n,e){var t=Do(Os++,4);!J.__s&&Xh(t.__H,e)&&(t.__=n,t.__H=e,bt.__h.push(t))}function Dl(n){return bo=5,ds(function(){return{current:n}},[])}function ny(n,e,t){bo=6,Al(function(){return typeof n=="function"?(n(e()),function(){return n(null)}):n?(n.current=e(),function(){return n.current=null}):void 0},t==null?t:t.concat(n))}function ds(n,e){var t=Do(Os++,7);return Xh(t.__H,e)&&(t.__=n(),t.__H=e,t.__h=n),t.__}function xl(n,e){return bo=8,ds(function(){return n},e)}function ei(n){var e=bt.context[n.__c],t=Do(Os++,9);return t.c=n,e?(t.__==null&&(t.__=!0,e.sub(bt)),e.props.value):n.__}function iy(n,e){J.useDebugValue&&J.useDebugValue(e?e(n):n)}function tE(n){var e=Do(Os++,10),t=Ml();return e.__=n,bt.componentDidCatch||(bt.componentDidCatch=function(r){e.__&&e.__(r),t[1](r)}),[t[0],function(){t[1](void 0)}]}function rE(){for(var n;n=ry.shift();)if(n.__P)try{n.__H.__h.forEach(Jc),n.__H.__h.forEach(Od),n.__H.__h=[]}catch(e){n.__H.__h=[],J.__e(e,n.__v)}}J.__b=function(n){bt=null,Vf&&Vf(n)},J.__r=function(n){Gf&&Gf(n),Os=0;var e=(bt=n.__c).__H;e&&(e.__h.forEach(Jc),e.__h.forEach(Od),e.__h=[])},J.diffed=function(n){Wf&&Wf(n);var e=n.__c;e&&e.__H&&e.__H.__h.length&&(ry.push(e)!==1&&jf===J.requestAnimationFrame||((jf=J.requestAnimationFrame)||function(t){var r,i=function(){clearTimeout(s),zf&&cancelAnimationFrame(r),setTimeout(t)},s=setTimeout(i,100);zf&&(r=requestAnimationFrame(i))})(rE)),bt=null},J.__c=function(n,e){e.some(function(t){try{t.__h.forEach(Jc),t.__h=t.__h.filter(function(r){return!r.__||Od(r)})}catch(r){e.some(function(i){i.__h&&(i.__h=[])}),e=[],J.__e(r,t.__v)}}),Hf&&Hf(n,e)},J.unmount=function(n){Yf&&Yf(n);var e,t=n.__c;t&&t.__H&&(t.__H.__.forEach(function(r){try{Jc(r)}catch(i){e=i}}),e&&J.__e(e,t.__v))};var zf=typeof requestAnimationFrame=="function";function Jc(n){var e=bt,t=n.__c;typeof t=="function"&&(n.__c=void 0,t()),bt=e}function Od(n){var e=bt;n.__c=n.__(),bt=e}function Xh(n,e){return!n||n.length!==e.length||e.some(function(t,r){return t!==n[r]})}function sy(n,e){return typeof e=="function"?e(n):e}function oy(n,e){for(var t in e)n[t]=e[t];return n}function kd(n,e){for(var t in n)if(t!=="__source"&&!(t in e))return!0;for(var r in e)if(r!=="__source"&&n[r]!==e[r])return!0;return!1}function pl(n){this.props=n}function ay(n,e){function t(i){var s=this.props.ref,o=s==i.ref;return!o&&s&&(s.call?s(null):s.current=null),e?!e(this.props,i)||!o:kd(this.props,i)}function r(i){return this.shouldComponentUpdate=t,wt(n,i)}return r.displayName="Memo("+(n.displayName||n.name)+")",r.prototype.isReactComponent=!0,r.__f=!0,r}(pl.prototype=new Ur).isPureReactComponent=!0,pl.prototype.shouldComponentUpdate=function(n,e){return kd(this.props,n)||kd(this.state,e)};var Jf=J.__b;J.__b=function(n){n.type&&n.type.__f&&n.ref&&(n.props.ref=n.ref,n.ref=null),Jf&&Jf(n)};var nE=typeof Symbol!="undefined"&&Symbol.for&&Symbol.for("react.forward_ref")||3911;function Qh(n){function e(t,r){var i=oy({},t);return delete i.ref,n(i,!(r=t.ref||r)||typeof r=="object"&&Object.keys(r).length===0?null:r)}return e.$$typeof=nE,e.render=e,e.prototype.isReactComponent=e.__f=!0,e.displayName="ForwardRef("+(n.displayName||n.name)+")",e}var Xf=function(n,e){return n==null?null:wn(wn(n).map(e))},Zh={map:Xf,forEach:Xf,count:function(n){return n?wn(n).length:0},only:function(n){var e=wn(n);if(e.length!==1)throw"Children.only";return e[0]},toArray:wn},iE=J.__e;J.__e=function(n,e,t,r){if(n.then){for(var i,s=e;s=s.__;)if((i=s.__c)&&i.__c)return e.__e==null&&(e.__e=t.__e,e.__k=t.__k),i.__c(n,e)}iE(n,e,t,r)};var Qf=J.unmount;function Ta(){this.__u=0,this.t=null,this.__b=null}function cy(n){var e=n.__.__c;return e&&e.__e&&e.__e(n)}function ly(n){var e,t,r;function i(s){if(e||(e=n()).then(function(o){t=o.default||o},function(o){r=o}),r)throw r;if(!t)throw e;return wt(t,s)}return i.displayName="Lazy",i.__f=!0,i}function lo(){this.u=null,this.o=null}J.unmount=function(n){var e=n.__c;e&&e.__R&&e.__R(),e&&n.__h===!0&&(n.type=null),Qf&&Qf(n)},(Ta.prototype=new Ur).__c=function(n,e){var t=e.__c,r=this;r.t==null&&(r.t=[]),r.t.push(t);var i=cy(r.__v),s=!1,o=function(){s||(s=!0,t.__R=null,i?i(a):a())};t.__R=o;var a=function(){if(!--r.__u){if(r.state.__e){var u=r.state.__e;r.__v.__k[0]=function g(m,f,E){return m&&(m.__v=null,m.__k=m.__k&&m.__k.map(function(I){return g(I,f,E)}),m.__c&&m.__c.__P===f&&(m.__e&&E.insertBefore(m.__e,m.__d),m.__c.__e=!0,m.__c.__P=E)),m}(u,u.__c.__P,u.__c.__O)}var c;for(r.setState({__e:r.__b=null});c=r.t.pop();)c.forceUpdate()}},l=e.__h===!0;r.__u++||l||r.setState({__e:r.__b=r.__v.__k[0]}),n.then(o,o)},Ta.prototype.componentWillUnmount=function(){this.t=[]},Ta.prototype.render=function(n,e){if(this.__b){if(this.__v.__k){var t=document.createElement("div"),r=this.__v.__k[0].__c;this.__v.__k[0]=function s(o,a,l){return o&&(o.__c&&o.__c.__H&&(o.__c.__H.__.forEach(function(u){typeof u.__c=="function"&&u.__c()}),o.__c.__H=null),(o=oy({},o)).__c!=null&&(o.__c.__P===l&&(o.__c.__P=a),o.__c=null),o.__k=o.__k&&o.__k.map(function(u){return s(u,a,l)})),o}(this.__b,t,r.__O=r.__P)}this.__b=null}var i=e.__e&&wt($r,null,n.fallback);return i&&(i.__h=null),[wt($r,null,e.__e?null:n.children),i]};var Zf=function(n,e,t){if(++t[1]===t[0]&&n.o.delete(e),n.props.revealOrder&&(n.props.revealOrder[0]!=="t"||!n.o.size))for(t=n.u;t;){for(;t.length>3;)t.pop()();if(t[1]<t[0])break;n.u=t=t[2]}};function sE(n){return this.getChildContext=function(){return n.context},n.children}function oE(n){var e=this,t=n.i;e.componentWillUnmount=function(){So(null,e.l),e.l=null,e.i=null},e.i&&e.i!==t&&e.componentWillUnmount(),n.__v?(e.l||(e.i=t,e.l={nodeType:1,parentNode:t,childNodes:[],appendChild:function(r){this.childNodes.push(r),e.i.appendChild(r)},insertBefore:function(r,i){this.childNodes.push(r),e.i.appendChild(r)},removeChild:function(r){this.childNodes.splice(this.childNodes.indexOf(r)>>>1,1),e.i.removeChild(r)}}),So(wt(sE,{context:e.context},n.__v),e.l)):e.l&&e.componentWillUnmount()}function uy(n,e){return wt(oE,{__v:n,i:e})}(lo.prototype=new Ur).__e=function(n){var e=this,t=cy(e.__v),r=e.o.get(n);return r[0]++,function(i){var s=function(){e.props.revealOrder?(r.push(i),Zf(e,n,r)):i()};t?t(s):s()}},lo.prototype.render=function(n){this.u=null,this.o=new Map;var e=wn(n.children);n.revealOrder&&n.revealOrder[0]==="b"&&e.reverse();for(var t=e.length;t--;)this.o.set(e[t],this.u=[1,0,this.u]);return n.children},lo.prototype.componentDidUpdate=lo.prototype.componentDidMount=function(){var n=this;this.o.forEach(function(e,t){Zf(n,t,e)})};var dy=typeof Symbol!="undefined"&&Symbol.for&&Symbol.for("react.element")||60103,aE=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|marker(?!H|W|U)|overline|paint|stop|strikethrough|stroke|text(?!L)|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,cE=typeof document!="undefined",lE=function(n){return(typeof Symbol!="undefined"&&typeof Symbol()=="symbol"?/fil|che|rad/i:/fil|che|ra/i).test(n)};function hy(n,e,t){return e.__k==null&&(e.textContent=""),So(n,e),typeof t=="function"&&t(),n?n.__c:null}function fy(n,e,t){return Yh(n,e),typeof t=="function"&&t(),n?n.__c:null}Ur.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach(function(n){Object.defineProperty(Ur.prototype,n,{configurable:!0,get:function(){return this["UNSAFE_"+n]},set:function(e){Object.defineProperty(this,n,{configurable:!0,writable:!0,value:e})}})});var ep=J.event;function uE(){}function dE(){return this.cancelBubble}function hE(){return this.defaultPrevented}J.event=function(n){return ep&&(n=ep(n)),n.persist=uE,n.isPropagationStopped=dE,n.isDefaultPrevented=hE,n.nativeEvent=n};var py,tp={configurable:!0,get:function(){return this.class}},rp=J.vnode;J.vnode=function(n){var e=n.type,t=n.props,r=t;if(typeof e=="string"){var i=e.indexOf("-")===-1;for(var s in r={},t){var o=t[s];cE&&s==="children"&&e==="noscript"||s==="value"&&"defaultValue"in t&&o==null||(s==="defaultValue"&&"value"in t&&t.value==null?s="value":s==="download"&&o===!0?o="":/ondoubleclick/i.test(s)?s="ondblclick":/^onchange(textarea|input)/i.test(s+e)&&!lE(t.type)?s="oninput":/^onfocus$/i.test(s)?s="onfocusin":/^onblur$/i.test(s)?s="onfocusout":/^on(Ani|Tra|Tou|BeforeInp|Compo)/.test(s)?s=s.toLowerCase():i&&aE.test(s)?s=s.replace(/[A-Z0-9]/,"-$&").toLowerCase():o===null&&(o=void 0),r[s]=o)}e=="select"&&r.multiple&&Array.isArray(r.value)&&(r.value=wn(t.children).forEach(function(a){a.props.selected=r.value.indexOf(a.props.value)!=-1})),e=="select"&&r.defaultValue!=null&&(r.value=wn(t.children).forEach(function(a){a.props.selected=r.multiple?r.defaultValue.indexOf(a.props.value)!=-1:r.defaultValue==a.props.value})),n.props=r,t.class!=t.className&&(tp.enumerable="className"in t,t.className!=null&&(r.class=t.className),Object.defineProperty(r,"className",tp))}n.$$typeof=dy,rp&&rp(n)};var np=J.__r;J.__r=function(n){np&&np(n),py=n.__c};var gy={ReactCurrentDispatcher:{current:{readContext:function(n){return py.__n[n.__c].props.value}}}},fE="17.0.2";function my(n){return wt.bind(null,n)}function Ul(n){return!!n&&n.$$typeof===dy}function yy(n){return Ul(n)?ty.apply(null,arguments):n}function vy(n){return!!n.__k&&(So(null,n),!0)}function _y(n){return n&&(n.base||n.nodeType===1&&n)||null}var Ey=function(n,e){return n(e)},Sy=function(n,e){return n(e)},pE=$r,gE={useState:Ml,useReducer:zh,useEffect:Jh,useLayoutEffect:Al,useRef:Dl,useImperativeHandle:ny,useMemo:ds,useCallback:xl,useContext:ei,useDebugValue:iy,version:"17.0.2",Children:Zh,render:hy,hydrate:fy,unmountComponentAtNode:vy,createPortal:uy,createElement:wt,createContext:Ao,createFactory:my,cloneElement:yy,createRef:Wh,Fragment:$r,isValidElement:Ul,findDOMNode:_y,Component:Ur,PureComponent:pl,memo:ay,forwardRef:Qh,flushSync:Sy,unstable_batchedUpdates:Ey,StrictMode:$r,Suspense:Ta,SuspenseList:lo,lazy:ly,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:gy},mE=Object.freeze(Object.defineProperty({__proto__:null,default:gE,version:fE,Children:Zh,render:hy,hydrate:fy,unmountComponentAtNode:vy,createPortal:uy,createFactory:my,cloneElement:yy,isValidElement:Ul,findDOMNode:_y,PureComponent:pl,memo:ay,forwardRef:Qh,flushSync:Sy,unstable_batchedUpdates:Ey,StrictMode:pE,Suspense:Ta,SuspenseList:lo,lazy:ly,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:gy,createElement:wt,createContext:Ao,createRef:Wh,Fragment:$r,Component:Ur,useState:Ml,useReducer:zh,useEffect:Jh,useLayoutEffect:Al,useRef:Dl,useImperativeHandle:ny,useMemo:ds,useCallback:xl,useContext:ei,useDebugValue:iy,useErrorBoundary:tE},Symbol.toStringTag,{value:"Module"}));function gl(){return gl=Object.assign||function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r])}return n},gl.apply(this,arguments)}var ss;(function(n){n.Pop="POP",n.Push="PUSH",n.Replace="REPLACE"})(ss||(ss={}));var ip=function(n){return n},sp="beforeunload",yE="popstate";function vE(n){n===void 0&&(n={});var e=n,t=e.window,r=t===void 0?document.defaultView:t,i=r.history;function s(){var U=r.location,q=U.pathname,B=U.search,te=U.hash,ye=i.state||{};return[ye.idx,ip({pathname:q,search:B,hash:te,state:ye.usr||null,key:ye.key||"default"})]}var o=null;function a(){if(o)f.call(o),o=null;else{var U=ss.Pop,q=s(),B=q[0],te=q[1];if(f.length){if(B!=null){var ye=c-B;ye&&(o={action:U,location:te,retry:function(){D(ye*-1)}},D(ye))}}else C(U)}}r.addEventListener(yE,a);var l=ss.Pop,u=s(),c=u[0],g=u[1],m=ap(),f=ap();c==null&&(c=0,i.replaceState(gl({},i.state,{idx:c}),""));function E(U){return typeof U=="string"?U:Cd(U)}function I(U,q){return q===void 0&&(q=null),ip(gl({pathname:g.pathname,hash:"",search:""},typeof U=="string"?ks(U):U,{state:q,key:_E()}))}function w(U,q){return[{usr:U.state,key:U.key,idx:q},E(U)]}function k(U,q,B){return!f.length||(f.call({action:U,location:q,retry:B}),!1)}function C(U){l=U;var q=s();c=q[0],g=q[1],m.call({action:l,location:g})}function S(U,q){var B=ss.Push,te=I(U,q);function ye(){S(U,q)}if(k(B,te,ye)){var we=w(te,c+1),Te=we[0],Ye=we[1];try{i.pushState(Te,"",Ye)}catch{r.location.assign(Ye)}C(B)}}function T(U,q){var B=ss.Replace,te=I(U,q);function ye(){T(U,q)}if(k(B,te,ye)){var we=w(te,c),Te=we[0],Ye=we[1];i.replaceState(Te,"",Ye),C(B)}}function D(U){i.go(U)}var R={get action(){return l},get location(){return g},createHref:E,push:S,replace:T,go:D,back:function(){D(-1)},forward:function(){D(1)},listen:function(q){return m.push(q)},block:function(q){var B=f.push(q);return f.length===1&&r.addEventListener(sp,op),function(){B(),f.length||r.removeEventListener(sp,op)}}};return R}function op(n){n.preventDefault(),n.returnValue=""}function ap(){var n=[];return{get length(){return n.length},push:function(t){return n.push(t),function(){n=n.filter(function(r){return r!==t})}},call:function(t){n.forEach(function(r){return r&&r(t)})}}}function _E(){return Math.random().toString(36).substr(2,8)}function Cd(n){var e=n.pathname,t=e===void 0?"/":e,r=n.search,i=r===void 0?"":r,s=n.hash,o=s===void 0?"":s;return i&&i!=="?"&&(t+=i.charAt(0)==="?"?i:"?"+i),o&&o!=="#"&&(t+=o.charAt(0)==="#"?o:"#"+o),t}function ks(n){var e={};if(n){var t=n.indexOf("#");t>=0&&(e.hash=n.substr(t),n=n.substr(0,t));var r=n.indexOf("?");r>=0&&(e.search=n.substr(r),n=n.substr(0,r)),n&&(e.pathname=n)}return e}/**
- * React Router v6.3.0
- *
- * Copyright (c) Remix Software Inc.
- *
- * This source code is licensed under the MIT license found in the
- * LICENSE.md file in the root directory of this source tree.
- *
- * @license MIT
- */const ef=Ao(null),tf=Ao(null),$l=Ao({outlet:null,matches:[]});function In(n,e){if(!n)throw new Error(e)}function EE(n,e,t){t===void 0&&(t="/");let r=typeof e=="string"?ks(e):e,i=Ry(r.pathname||"/",t);if(i==null)return null;let s=by(n);SE(s);let o=null;for(let a=0;o==null&&a<s.length;++a)o=PE(s[a],i);return o}function by(n,e,t,r){return e===void 0&&(e=[]),t===void 0&&(t=[]),r===void 0&&(r=""),n.forEach((i,s)=>{let o={relativePath:i.path||"",caseSensitive:i.caseSensitive===!0,childrenIndex:s,route:i};o.relativePath.startsWith("/")&&(o.relativePath.startsWith(r)||In(!1),o.relativePath=o.relativePath.slice(r.length));let a=Ui([r,o.relativePath]),l=t.concat(o);i.children&&i.children.length>0&&(i.index===!0&&In(!1),by(i.children,e,l,a)),!(i.path==null&&!i.index)&&e.push({path:a,score:kE(a,i.index),routesMeta:l})}),e}function SE(n){n.sort((e,t)=>e.score!==t.score?t.score-e.score:CE(e.routesMeta.map(r=>r.childrenIndex),t.routesMeta.map(r=>r.childrenIndex)))}const bE=/^:\w+$/,wE=3,RE=2,IE=1,TE=10,OE=-2,cp=n=>n==="*";function kE(n,e){let t=n.split("/"),r=t.length;return t.some(cp)&&(r+=OE),e&&(r+=RE),t.filter(i=>!cp(i)).reduce((i,s)=>i+(bE.test(s)?wE:s===""?IE:TE),r)}function CE(n,e){return n.length===e.length&&n.slice(0,-1).every((r,i)=>r===e[i])?n[n.length-1]-e[e.length-1]:0}function PE(n,e){let{routesMeta:t}=n,r={},i="/",s=[];for(let o=0;o<t.length;++o){let a=t[o],l=o===t.length-1,u=i==="/"?e:e.slice(i.length)||"/",c=ME({path:a.relativePath,caseSensitive:a.caseSensitive,end:l},u);if(!c)return null;Object.assign(r,c.params);let g=a.route;s.push({params:r,pathname:Ui([i,c.pathname]),pathnameBase:Iy(Ui([i,c.pathnameBase])),route:g}),c.pathnameBase!=="/"&&(i=Ui([i,c.pathnameBase]))}return s}function ME(n,e){typeof n=="string"&&(n={path:n,caseSensitive:!1,end:!0});let[t,r]=AE(n.path,n.caseSensitive,n.end),i=e.match(t);if(!i)return null;let s=i[0],o=s.replace(/(.)\/+$/,"$1"),a=i.slice(1);return{params:r.reduce((u,c,g)=>{if(c==="*"){let m=a[g]||"";o=s.slice(0,s.length-m.length).replace(/(.)\/+$/,"$1")}return u[c]=DE(a[g]||""),u},{}),pathname:s,pathnameBase:o,pattern:n}}function AE(n,e,t){e===void 0&&(e=!1),t===void 0&&(t=!0);let r=[],i="^"+n.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^$?{}|()[\]]/g,"\\$&").replace(/:(\w+)/g,(o,a)=>(r.push(a),"([^\\/]+)"));return n.endsWith("*")?(r.push("*"),i+=n==="*"||n==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):i+=t?"\\/*$":"(?:(?=[.~-]|%[0-9A-F]{2})|\\b|\\/|$)",[new RegExp(i,e?void 0:"i"),r]}function DE(n,e){try{return decodeURIComponent(n)}catch{return n}}function xE(n,e){e===void 0&&(e="/");let{pathname:t,search:r="",hash:i=""}=typeof n=="string"?ks(n):n;return{pathname:t?t.startsWith("/")?t:UE(t,e):e,search:NE(r),hash:LE(i)}}function UE(n,e){let t=e.replace(/\/+$/,"").split("/");return n.split("/").forEach(i=>{i===".."?t.length>1&&t.pop():i!=="."&&t.push(i)}),t.length>1?t.join("/"):"/"}function wy(n,e,t){let r=typeof n=="string"?ks(n):n,i=n===""||r.pathname===""?"/":r.pathname,s;if(i==null)s=t;else{let a=e.length-1;if(i.startsWith("..")){let l=i.split("/");for(;l[0]==="..";)l.shift(),a-=1;r.pathname=l.join("/")}s=a>=0?e[a]:"/"}let o=xE(r,s);return i&&i!=="/"&&i.endsWith("/")&&!o.pathname.endsWith("/")&&(o.pathname+="/"),o}function $E(n){return n===""||n.pathname===""?"/":typeof n=="string"?ks(n).pathname:n.pathname}function Ry(n,e){if(e==="/")return n;if(!n.toLowerCase().startsWith(e.toLowerCase()))return null;let t=n.charAt(e.length);return t&&t!=="/"?null:n.slice(e.length)||"/"}const Ui=n=>n.join("/").replace(/\/\/+/g,"/"),Iy=n=>n.replace(/\/+$/,"").replace(/^\/*/,"/"),NE=n=>!n||n==="?"?"":n.startsWith("?")?n:"?"+n,LE=n=>!n||n==="#"?"":n.startsWith("#")?n:"#"+n;function BE(n){Ja()||In(!1);let{basename:e,navigator:t}=ei(ef),{hash:r,pathname:i,search:s}=Ty(n),o=i;if(e!=="/"){let a=$E(n),l=a!=null&&a.endsWith("/");o=i==="/"?e+(l?"/":""):Ui([e,i])}return t.createHref({pathname:o,search:s,hash:r})}function Ja(){return ei(tf)!=null}function Nl(){return Ja()||In(!1),ei(tf).location}function KE(){Ja()||In(!1);let{basename:n,navigator:e}=ei(ef),{matches:t}=ei($l),{pathname:r}=Nl(),i=JSON.stringify(t.map(a=>a.pathnameBase)),s=Dl(!1);return Jh(()=>{s.current=!0}),xl(function(a,l){if(l===void 0&&(l={}),!s.current)return;if(typeof a=="number"){e.go(a);return}let u=wy(a,JSON.parse(i),r);n!=="/"&&(u.pathname=Ui([n,u.pathname])),(l.replace?e.replace:e.push)(u,l.state)},[n,e,i,r])}function Ty(n){let{matches:e}=ei($l),{pathname:t}=Nl(),r=JSON.stringify(e.map(i=>i.pathnameBase));return ds(()=>wy(n,JSON.parse(r),t),[n,r,t])}function FE(n,e){Ja()||In(!1);let{matches:t}=ei($l),r=t[t.length-1],i=r?r.params:{};r&&r.pathname;let s=r?r.pathnameBase:"/";r&&r.route;let o=Nl(),a;if(e){var l;let m=typeof e=="string"?ks(e):e;s==="/"||((l=m.pathname)==null?void 0:l.startsWith(s))||In(!1),a=m}else a=o;let u=a.pathname||"/",c=s==="/"?u:u.slice(s.length)||"/",g=EE(n,{pathname:c});return qE(g&&g.map(m=>Object.assign({},m,{params:Object.assign({},i,m.params),pathname:Ui([s,m.pathname]),pathnameBase:m.pathnameBase==="/"?s:Ui([s,m.pathnameBase])})),t)}function qE(n,e){return e===void 0&&(e=[]),n==null?null:n.reduceRight((t,r,i)=>wt($l.Provider,{children:r.route.element!==void 0?r.route.element:t,value:{outlet:t,matches:e.concat(n.slice(0,i+1))}}),null)}function jE(n){In(!1)}function VE(n){let{basename:e="/",children:t=null,location:r,navigationType:i=ss.Pop,navigator:s,static:o=!1}=n;Ja()&&In(!1);let a=Iy(e),l=ds(()=>({basename:a,navigator:s,static:o}),[a,s,o]);typeof r=="string"&&(r=ks(r));let{pathname:u="/",search:c="",hash:g="",state:m=null,key:f="default"}=r,E=ds(()=>{let I=Ry(u,a);return I==null?null:{pathname:I,search:c,hash:g,state:m,key:f}},[a,u,c,g,m,f]);return E==null?null:wt(ef.Provider,{value:l},wt(tf.Provider,{children:t,value:{location:E,navigationType:i}}))}function pD(n){let{children:e,location:t}=n;return FE(Pd(e),t)}function Pd(n){let e=[];return Zh.forEach(n,t=>{if(!Ul(t))return;if(t.type===$r){e.push.apply(e,Pd(t.props.children));return}t.type!==jE&&In(!1);let r={caseSensitive:t.props.caseSensitive,element:t.props.element,index:t.props.index,path:t.props.path};t.props.children&&(r.children=Pd(t.props.children)),e.push(r)}),e}/**
- * React Router DOM v6.3.0
- *
- * Copyright (c) Remix Software Inc.
- *
- * This source code is licensed under the MIT license found in the
- * LICENSE.md file in the root directory of this source tree.
- *
- * @license MIT
- */function Md(){return Md=Object.assign||function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r])}return n},Md.apply(this,arguments)}function GE(n,e){if(n==null)return{};var t={},r=Object.keys(n),i,s;for(s=0;s<r.length;s++)i=r[s],!(e.indexOf(i)>=0)&&(t[i]=n[i]);return t}const WE=["onClick","reloadDocument","replace","state","target","to"];function gD(n){let{basename:e,children:t,window:r}=n,i=Dl();i.current==null&&(i.current=vE({window:r}));let s=i.current,[o,a]=Ml({action:s.action,location:s.location});return Al(()=>s.listen(a),[s]),wt(VE,{basename:e,children:t,location:o.location,navigationType:o.action,navigator:s})}function HE(n){return!!(n.metaKey||n.altKey||n.ctrlKey||n.shiftKey)}const mD=Qh(function(e,t){let{onClick:r,reloadDocument:i,replace:s=!1,state:o,target:a,to:l}=e,u=GE(e,WE),c=BE(l),g=YE(l,{replace:s,state:o,target:a});function m(f){r&&r(f),!f.defaultPrevented&&!i&&g(f)}return wt("a",Md({},u,{href:c,onClick:m,ref:t,target:a}))});function YE(n,e){let{target:t,replace:r,state:i}=e===void 0?{}:e,s=KE(),o=Nl(),a=Ty(n);return xl(l=>{if(l.button===0&&(!t||t==="_self")&&!HE(l)){l.preventDefault();let u=!!r||Cd(o)===Cd(a);s(n,{replace:u,state:i})}},[o,s,a,r,i,t,n])}var V=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:{};function rf(n){if(n.__esModule)return n;var e=Object.defineProperty({},"__esModule",{value:!0});return Object.keys(n).forEach(function(t){var r=Object.getOwnPropertyDescriptor(n,t);Object.defineProperty(e,t,r.get?r:{enumerable:!0,get:function(){return n[t]}})}),e}var zE=rf(eE),JE,XE,lp=zE,QE=0;function up(n,e,t,r,i){var s,o,a={};for(o in e)o=="ref"?s=e[o]:a[o]=e[o];var l={type:n,props:a,key:t,ref:s,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:--QE,__source:i,__self:r};if(typeof n=="function"&&(s=n.defaultProps))for(o in s)a[o]===void 0&&(a[o]=s[o]);return lp.options.vnode&&lp.options.vnode(l),l}XE=up,JE=up;var Oy={},ZE=rf(mE);function eS(n){if(n&&n.__esModule)return n;var e=Object.create(null);return n&&Object.keys(n).forEach(function(t){if(t!=="default"){var r=Object.getOwnPropertyDescriptor(n,t);Object.defineProperty(e,t,r.get?r:{enumerable:!0,get:function(){return n[t]}})}}),e.default=n,Object.freeze(e)}Object.defineProperty(Oy,"__esModule",{value:!0});var Fn=eS(ZE);function tS({debounceMs:n}){const[e,t]=Fn.useState(window.innerWidth),r=function(i,s){let o=null;return(...a)=>{clearTimeout(o),o=setTimeout(()=>i(a),s)}}(()=>t(window.innerWidth),n);return Fn.useEffect(()=>(window.addEventListener("resize",r),()=>window.removeEventListener("resize",r)),[r]),e}const rS=Fn.forwardRef(({as:n="div",children:e,className:t,style:r,gap:i=10,debounce:s=200,nColumns:o=3},a)=>{const l=tS({debounceMs:s}),[u,c]=Fn.useState([]);Fn.useLayoutEffect(()=>{var I;const m=w=>w.sort((k,C)=>k.size-C.size),f=typeof o=="number"?{columns:o}:(I=(w=>w==null?void 0:w[w.length-1])(m(((w,k)=>w.filter(C=>C.size<=k))(o,l))))!=null?I:(w=>w==null?void 0:w[0])(m(o)),E=Array.from({length:f.columns},w=>[]);Fn.Children.forEach(e,(w,k)=>{const C=`item-${k}`,S=Fn.cloneElement(w,Lf(gc({},w.props),{key:C}));E[k%E.length].push(S)}),c(E)},[e,o,l]);const g={mainGrid:{display:"grid",gridTemplateColumns:`repeat(${u.length}, 1fr)`,columnGap:i,alignItems:"start"},columnGrid:{display:"grid",gridTemplateColumns:"100%",rowGap:i}};return Fn.createElement(n,{ref:a,"data-testid":"plock-container",className:t,style:gc({style:r},g.mainGrid)},u.map((m,f)=>Fn.createElement("div",{"data-testid":"plock-column",style:g.columnGrid,key:f},m)))});var yD=Oy.Plock=rS,nS={},G={exports:{}};(function(n){function e(t){return t&&t.__esModule?t:{default:t}}n.exports=e,n.exports.__esModule=!0,n.exports.default=n.exports})(G);var ky={exports:{}};(function(n,e){(function(t,r){n.exports=r()})(V,function(){var t=XMLHttpRequest;if(!t)throw new Error("missing XMLHttpRequest");i.log={trace:l,debug:l,info:l,warn:l,error:l};var r=3*60*1e3;function i(f,E){if(typeof E!="function")throw new Error("Bad callback given: "+E);if(!f)throw new Error("No options given");var I=f.onResponse;if(typeof f=="string"?f={uri:f}:f=JSON.parse(JSON.stringify(f)),f.onResponse=I,f.verbose&&(i.log=u()),f.url&&(f.uri=f.url,delete f.url),!f.uri&&f.uri!=="")throw new Error("options.uri is a required argument");if(typeof f.uri!="string")throw new Error("options.uri must be a string");for(var w=["proxy","_redirectsFollowed","maxRedirects","followRedirect"],k=0;k<w.length;k++)if(f[w[k]])throw new Error("options."+w[k]+" is not supported");if(f.callback=E,f.method=f.method||"GET",f.headers=f.headers||{},f.body=f.body||null,f.timeout=f.timeout||i.DEFAULT_TIMEOUT,f.headers.host)throw new Error("Options.headers.host is not supported");f.json&&(f.headers.accept=f.headers.accept||"application/json",f.method!=="GET"&&(f.headers["content-type"]="application/json"),typeof f.json!="boolean"?f.body=JSON.stringify(f.json):typeof f.body!="string"&&(f.body=JSON.stringify(f.body)));var C=function(U){var q=[];for(var B in U)U.hasOwnProperty(B)&&q.push(encodeURIComponent(B)+"="+encodeURIComponent(U[B]));return q.join("&")};if(f.qs){var S=typeof f.qs=="string"?f.qs:C(f.qs);f.uri.indexOf("?")!==-1?f.uri=f.uri+"&"+S:f.uri=f.uri+"?"+S}var T=function(U){var q={};q.boundry="-------------------------------"+Math.floor(Math.random()*1e9);var B=[];for(var te in U)U.hasOwnProperty(te)&&B.push("--"+q.boundry+`
-Content-Disposition: form-data; name="`+te+`"
-
-`+U[te]+`
-`);return B.push("--"+q.boundry+"--"),q.body=B.join(""),q.length=q.body.length,q.type="multipart/form-data; boundary="+q.boundry,q};if(f.form){if(typeof f.form=="string")throw"form name unsupported";if(f.method==="POST"){var D=(f.encoding||"application/x-www-form-urlencoded").toLowerCase();switch(f.headers["content-type"]=D,D){case"application/x-www-form-urlencoded":f.body=C(f.form).replace(/%20/g,"+");break;case"multipart/form-data":var R=T(f.form);f.body=R.body,f.headers["content-type"]=R.type;break;default:throw new Error("unsupported encoding:"+D)}}}return f.onResponse=f.onResponse||l,f.onResponse===!0&&(f.onResponse=E,f.callback=l),!f.headers.authorization&&f.auth&&(f.headers.authorization="Basic "+m(f.auth.username+":"+f.auth.password)),o(f)}var s=0;function o(f){var E=new t,I=!1,w=g(f.uri),k="withCredentials"in E;if(s+=1,E.seq_id=s,E.id=s+": "+f.method+" "+f.uri,E._id=E.id,w&&!k){var C=new Error("Browser does not support cross-origin request: "+f.uri);return C.cors="unsupported",f.callback(C,E)}E.timeoutTimer=setTimeout(S,f.timeout);function S(){I=!0;var B=new Error("ETIMEDOUT");return B.code="ETIMEDOUT",B.duration=f.timeout,i.log.error("Timeout",{id:E._id,milliseconds:f.timeout}),f.callback(B,E)}var T={response:!1,loading:!1,end:!1};return E.onreadystatechange=D,E.open(f.method,f.uri,!0),w&&(E.withCredentials=!!f.withCredentials),E.send(f.body),E;function D(B){if(I)return i.log.debug("Ignoring timed out state change",{state:E.readyState,id:E.id});if(i.log.debug("State change",{state:E.readyState,id:E.id,timed_out:I}),E.readyState===t.OPENED){i.log.debug("Request started",{id:E.id});for(var te in f.headers)E.setRequestHeader(te,f.headers[te])}else E.readyState===t.HEADERS_RECEIVED?R():E.readyState===t.LOADING?(R(),U()):E.readyState===t.DONE&&(R(),U(),q())}function R(){if(!T.response){if(T.response=!0,i.log.debug("Got response",{id:E.id,status:E.status}),clearTimeout(E.timeoutTimer),E.statusCode=E.status,w&&E.statusCode==0){var B=new Error("CORS request rejected: "+f.uri);return B.cors="rejected",T.loading=!0,T.end=!0,f.callback(B,E)}f.onResponse(null,E)}}function U(){T.loading||(T.loading=!0,i.log.debug("Response body loading",{id:E.id}))}function q(){if(!T.end){if(T.end=!0,i.log.debug("Request done",{id:E.id}),E.body=E.responseText,f.json)try{E.body=JSON.parse(E.responseText)}catch(B){return f.callback(B,E)}f.callback(null,E,E.body)}}}i.withCredentials=!1,i.DEFAULT_TIMEOUT=r,i.defaults=function(f,E){var I=function(k){var C=function(S,T){typeof S=="string"?S={uri:S}:S=JSON.parse(JSON.stringify(S));for(var D in f)S[D]===void 0&&(S[D]=f[D]);return k(S,T)};return C},w=I(i);return w.get=I(i.get),w.post=I(i.post),w.put=I(i.put),w.head=I(i.head),w};var a=["get","put","post","head"];a.forEach(function(f){var E=f.toUpperCase(),I=f.toLowerCase();i[I]=function(w){typeof w=="string"?w={method:E,uri:w}:(w=JSON.parse(JSON.stringify(w)),w.method=E);var k=[w].concat(Array.prototype.slice.apply(arguments,[1]));return i.apply(this,k)}}),i.couch=function(f,E){typeof f=="string"&&(f={uri:f}),f.json=!0,f.body&&(f.json=f.body),delete f.body,E=E||l;var I=i(f,w);return I;function w(k,C,S){if(k)return E(k,C,S);if((C.statusCode<200||C.statusCode>299)&&S.error){k=new Error("CouchDB error: "+(S.error.reason||S.error.error));for(var T in S)k[T]=S[T];return E(k,C,S)}return E(k,C,S)}};function l(){}function u(){var f={},E=["trace","debug","info","warn","error"],I,w;for(w=0;w<E.length;w++)I=E[w],f[I]=l,typeof console!="undefined"&&console&&console[I]&&(f[I]=c(console,I));return f}function c(f,E){return I;function I(w,k){return typeof k=="object"&&(w+=" "+JSON.stringify(k)),f[E].call(f,w)}}function g(f){var E=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+))?)?/,I;try{I=location.href}catch{I=document.createElement("a"),I.href="",I=I.href}var w=E.exec(I.toLowerCase())||[],k=E.exec(f.toLowerCase()),C=!!(k&&(k[1]!=w[1]||k[2]!=w[2]||(k[3]||(k[1]==="http:"?80:443))!=(w[3]||(w[1]==="http:"?80:443))));return C}function m(f){var E="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",I,w,k,C,S,T,D,R,U=0,q=0,B="",te=[];if(!f)return f;do I=f.charCodeAt(U++),w=f.charCodeAt(U++),k=f.charCodeAt(U++),R=I<<16|w<<8|k,C=R>>18&63,S=R>>12&63,T=R>>6&63,D=R&63,te[q++]=E.charAt(C)+E.charAt(S)+E.charAt(T)+E.charAt(D);while(U<f.length);switch(B=te.join(""),f.length%3){case 1:B=B.slice(0,-2)+"==";break;case 2:B=B.slice(0,-1)+"=";break}return B}return i})})(ky);var iS=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var e={},t=Symbol("test"),r=Object(t);if(typeof t=="string"||Object.prototype.toString.call(t)!=="[object Symbol]"||Object.prototype.toString.call(r)!=="[object Symbol]")return!1;var i=42;e[t]=i;for(t in e)return!1;if(typeof Object.keys=="function"&&Object.keys(e).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(e).length!==0)return!1;var s=Object.getOwnPropertySymbols(e);if(s.length!==1||s[0]!==t||!Object.prototype.propertyIsEnumerable.call(e,t))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var o=Object.getOwnPropertyDescriptor(e,t);if(o.value!==i||o.enumerable!==!0)return!1}return!0},dp=typeof Symbol!="undefined"&&Symbol,sS=iS,oS=function(){return typeof dp!="function"||typeof Symbol!="function"||typeof dp("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:sS()},aS="Function.prototype.bind called on incompatible ",Eu=Array.prototype.slice,cS=Object.prototype.toString,lS="[object Function]",uS=function(e){var t=this;if(typeof t!="function"||cS.call(t)!==lS)throw new TypeError(aS+t);for(var r=Eu.call(arguments,1),i,s=function(){if(this instanceof i){var c=t.apply(this,r.concat(Eu.call(arguments)));return Object(c)===c?c:this}else return t.apply(e,r.concat(Eu.call(arguments)))},o=Math.max(0,t.length-r.length),a=[],l=0;l<o;l++)a.push("$"+l);if(i=Function("binder","return function ("+a.join(",")+"){ return binder.apply(this,arguments); }")(s),t.prototype){var u=function(){};u.prototype=t.prototype,i.prototype=new u,u.prototype=null}return i},dS=uS,nf=Function.prototype.bind||dS,hS=nf,fS=hS.call(Function.call,Object.prototype.hasOwnProperty),pe,$a=SyntaxError,Cy=Function,ho=TypeError,Su=function(n){try{return Cy('"use strict"; return ('+n+").constructor;")()}catch{}},ls=Object.getOwnPropertyDescriptor;if(ls)try{ls({},"")}catch{ls=null}var bu=function(){throw new ho},pS=ls?function(){try{return arguments.callee,bu}catch{try{return ls(arguments,"callee").get}catch{return bu}}}():bu,Ls=oS(),ki=Object.getPrototypeOf||function(n){return n.__proto__},io={},gS=typeof Uint8Array=="undefined"?pe:ki(Uint8Array),fo={"%AggregateError%":typeof AggregateError=="undefined"?pe:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer=="undefined"?pe:ArrayBuffer,"%ArrayIteratorPrototype%":Ls?ki([][Symbol.iterator]()):pe,"%AsyncFromSyncIteratorPrototype%":pe,"%AsyncFunction%":io,"%AsyncGenerator%":io,"%AsyncGeneratorFunction%":io,"%AsyncIteratorPrototype%":io,"%Atomics%":typeof Atomics=="undefined"?pe:Atomics,"%BigInt%":typeof BigInt=="undefined"?pe:BigInt,"%Boolean%":Boolean,"%DataView%":typeof DataView=="undefined"?pe:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":typeof Float32Array=="undefined"?pe:Float32Array,"%Float64Array%":typeof Float64Array=="undefined"?pe:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry=="undefined"?pe:FinalizationRegistry,"%Function%":Cy,"%GeneratorFunction%":io,"%Int8Array%":typeof Int8Array=="undefined"?pe:Int8Array,"%Int16Array%":typeof Int16Array=="undefined"?pe:Int16Array,"%Int32Array%":typeof Int32Array=="undefined"?pe:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":Ls?ki(ki([][Symbol.iterator]())):pe,"%JSON%":typeof JSON=="object"?JSON:pe,"%Map%":typeof Map=="undefined"?pe:Map,"%MapIteratorPrototype%":typeof Map=="undefined"||!Ls?pe:ki(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise=="undefined"?pe:Promise,"%Proxy%":typeof Proxy=="undefined"?pe:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":typeof Reflect=="undefined"?pe:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set=="undefined"?pe:Set,"%SetIteratorPrototype%":typeof Set=="undefined"||!Ls?pe:ki(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer=="undefined"?pe:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":Ls?ki(""[Symbol.iterator]()):pe,"%Symbol%":Ls?Symbol:pe,"%SyntaxError%":$a,"%ThrowTypeError%":pS,"%TypedArray%":gS,"%TypeError%":ho,"%Uint8Array%":typeof Uint8Array=="undefined"?pe:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray=="undefined"?pe:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array=="undefined"?pe:Uint16Array,"%Uint32Array%":typeof Uint32Array=="undefined"?pe:Uint32Array,"%URIError%":URIError,"%WeakMap%":typeof WeakMap=="undefined"?pe:WeakMap,"%WeakRef%":typeof WeakRef=="undefined"?pe:WeakRef,"%WeakSet%":typeof WeakSet=="undefined"?pe:WeakSet},mS=function n(e){var t;if(e==="%AsyncFunction%")t=Su("async function () {}");else if(e==="%GeneratorFunction%")t=Su("function* () {}");else if(e==="%AsyncGeneratorFunction%")t=Su("async function* () {}");else if(e==="%AsyncGenerator%"){var r=n("%AsyncGeneratorFunction%");r&&(t=r.prototype)}else if(e==="%AsyncIteratorPrototype%"){var i=n("%AsyncGenerator%");i&&(t=ki(i.prototype))}return fo[e]=t,t},hp={"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},Ll=nf,ml=fS,yS=Ll.call(Function.call,Array.prototype.concat),vS=Ll.call(Function.apply,Array.prototype.splice),fp=Ll.call(Function.call,String.prototype.replace),yl=Ll.call(Function.call,String.prototype.slice),_S=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,ES=/\\(\\)?/g,SS=function(e){var t=yl(e,0,1),r=yl(e,-1);if(t==="%"&&r!=="%")throw new $a("invalid intrinsic syntax, expected closing `%`");if(r==="%"&&t!=="%")throw new $a("invalid intrinsic syntax, expected opening `%`");var i=[];return fp(e,_S,function(s,o,a,l){i[i.length]=a?fp(l,ES,"$1"):o||s}),i},bS=function(e,t){var r=e,i;if(ml(hp,r)&&(i=hp[r],r="%"+i[0]+"%"),ml(fo,r)){var s=fo[r];if(s===io&&(s=mS(r)),typeof s=="undefined"&&!t)throw new ho("intrinsic "+e+" exists, but is not available. Please file an issue!");return{alias:i,name:r,value:s}}throw new $a("intrinsic "+e+" does not exist!")},sf=function(e,t){if(typeof e!="string"||e.length===0)throw new ho("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof t!="boolean")throw new ho('"allowMissing" argument must be a boolean');var r=SS(e),i=r.length>0?r[0]:"",s=bS("%"+i+"%",t),o=s.name,a=s.value,l=!1,u=s.alias;u&&(i=u[0],vS(r,yS([0,1],u)));for(var c=1,g=!0;c<r.length;c+=1){var m=r[c],f=yl(m,0,1),E=yl(m,-1);if((f==='"'||f==="'"||f==="`"||E==='"'||E==="'"||E==="`")&&f!==E)throw new $a("property names with quotes must have matching quotes");if((m==="constructor"||!g)&&(l=!0),i+="."+m,o="%"+i+"%",ml(fo,o))a=fo[o];else if(a!=null){if(!(m in a)){if(!t)throw new ho("base intrinsic for "+e+" exists, but the property is not available.");return}if(ls&&c+1>=r.length){var I=ls(a,m);g=!!I,g&&"get"in I&&!("originalValue"in I.get)?a=I.get:a=a[m]}else g=ml(a,m),a=a[m];g&&!l&&(fo[o]=a)}}return a},Py={exports:{}};(function(n){var e=nf,t=sf,r=t("%Function.prototype.apply%"),i=t("%Function.prototype.call%"),s=t("%Reflect.apply%",!0)||e.call(i,r),o=t("%Object.getOwnPropertyDescriptor%",!0),a=t("%Object.defineProperty%",!0),l=t("%Math.max%");if(a)try{a({},"a",{value:1})}catch{a=null}n.exports=function(g){var m=s(e,i,arguments);if(o&&a){var f=o(m,"length");f.configurable&&a(m,"length",{value:1+l(0,g.length-(arguments.length-1))})}return m};var u=function(){return s(e,r,arguments)};a?a(n.exports,"apply",{value:u}):n.exports.apply=u})(Py);var My=sf,Ay=Py.exports,wS=Ay(My("String.prototype.indexOf")),RS=function(e,t){var r=My(e,!!t);return typeof r=="function"&&wS(e,".prototype.")>-1?Ay(r):r},IS={},TS=Object.freeze(Object.defineProperty({__proto__:null,default:IS},Symbol.toStringTag,{value:"Module"})),Ci=rf(TS),of=typeof Map=="function"&&Map.prototype,wu=Object.getOwnPropertyDescriptor&&of?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,vl=of&&wu&&typeof wu.get=="function"?wu.get:null,OS=of&&Map.prototype.forEach,af=typeof Set=="function"&&Set.prototype,Ru=Object.getOwnPropertyDescriptor&&af?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,_l=af&&Ru&&typeof Ru.get=="function"?Ru.get:null,kS=af&&Set.prototype.forEach,CS=typeof WeakMap=="function"&&WeakMap.prototype,Oa=CS?WeakMap.prototype.has:null,PS=typeof WeakSet=="function"&&WeakSet.prototype,ka=PS?WeakSet.prototype.has:null,MS=typeof WeakRef=="function"&&WeakRef.prototype,pp=MS?WeakRef.prototype.deref:null,AS=Boolean.prototype.valueOf,DS=Object.prototype.toString,xS=Function.prototype.toString,US=String.prototype.match,cf=String.prototype.slice,xi=String.prototype.replace,$S=String.prototype.toUpperCase,gp=String.prototype.toLowerCase,Dy=RegExp.prototype.test,mp=Array.prototype.concat,_n=Array.prototype.join,NS=Array.prototype.slice,yp=Math.floor,Ad=typeof BigInt=="function"?BigInt.prototype.valueOf:null,Iu=Object.getOwnPropertySymbols,Dd=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,wo=typeof Symbol=="function"&&typeof Symbol.iterator=="object",Mt=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===wo?"object":"symbol")?Symbol.toStringTag:null,xy=Object.prototype.propertyIsEnumerable,vp=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(n){return n.__proto__}:null);function _p(n,e){if(n===1/0||n===-1/0||n!==n||n&&n>-1e3&&n<1e3||Dy.call(/e/,e))return e;var t=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof n=="number"){var r=n<0?-yp(-n):yp(n);if(r!==n){var i=String(r),s=cf.call(e,i.length+1);return xi.call(i,t,"$&_")+"."+xi.call(xi.call(s,/([0-9]{3})/g,"$&_"),/_$/,"")}}return xi.call(e,t,"$&_")}var Tu=Ci.custom,Ou=Tu&&$y(Tu)?Tu:null,LS=function n(e,t,r,i){var s=t||{};if(Pi(s,"quoteStyle")&&s.quoteStyle!=="single"&&s.quoteStyle!=="double")throw new TypeError('option "quoteStyle" must be "single" or "double"');if(Pi(s,"maxStringLength")&&(typeof s.maxStringLength=="number"?s.maxStringLength<0&&s.maxStringLength!==1/0:s.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var o=Pi(s,"customInspect")?s.customInspect:!0;if(typeof o!="boolean"&&o!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(Pi(s,"indent")&&s.indent!==null&&s.indent!==" "&&!(parseInt(s.indent,10)===s.indent&&s.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(Pi(s,"numericSeparator")&&typeof s.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var a=s.numericSeparator;if(typeof e=="undefined")return"undefined";if(e===null)return"null";if(typeof e=="boolean")return e?"true":"false";if(typeof e=="string")return Ly(e,s);if(typeof e=="number"){if(e===0)return 1/0/e>0?"0":"-0";var l=String(e);return a?_p(e,l):l}if(typeof e=="bigint"){var u=String(e)+"n";return a?_p(e,u):u}var c=typeof s.depth=="undefined"?5:s.depth;if(typeof r=="undefined"&&(r=0),r>=c&&c>0&&typeof e=="object")return xd(e)?"[Array]":"[Object]";var g=nb(s,r);if(typeof i=="undefined")i=[];else if(Ny(i,e)>=0)return"[Circular]";function m(Te,Ye,Vt){if(Ye&&(i=NS.call(i),i.push(Ye)),Vt){var Gt={depth:s.depth};return Pi(s,"quoteStyle")&&(Gt.quoteStyle=s.quoteStyle),n(Te,Gt,r+1,i)}return n(Te,s,r+1,i)}if(typeof e=="function"){var f=YS(e),E=mc(e,m);return"[Function"+(f?": "+f:" (anonymous)")+"]"+(E.length>0?" { "+_n.call(E,", ")+" }":"")}if($y(e)){var I=wo?xi.call(String(e),/^(Symbol\(.*\))_[^)]*$/,"$1"):Dd.call(e);return typeof e=="object"&&!wo?Yo(I):I}if(eb(e)){for(var w="<"+gp.call(String(e.nodeName)),k=e.attributes||[],C=0;C<k.length;C++)w+=" "+k[C].name+"="+Uy(BS(k[C].value),"double",s);return w+=">",e.childNodes&&e.childNodes.length&&(w+="..."),w+="</"+gp.call(String(e.nodeName))+">",w}if(xd(e)){if(e.length===0)return"[]";var S=mc(e,m);return g&&!rb(S)?"["+Ud(S,g)+"]":"[ "+_n.call(S,", ")+" ]"}if(qS(e)){var T=mc(e,m);return"cause"in e&&!xy.call(e,"cause")?"{ ["+String(e)+"] "+_n.call(mp.call("[cause]: "+m(e.cause),T),", ")+" }":T.length===0?"["+String(e)+"]":"{ ["+String(e)+"] "+_n.call(T,", ")+" }"}if(typeof e=="object"&&o){if(Ou&&typeof e[Ou]=="function")return e[Ou]();if(o!=="symbol"&&typeof e.inspect=="function")return e.inspect()}if(zS(e)){var D=[];return OS.call(e,function(Te,Ye){D.push(m(Ye,e,!0)+" => "+m(Te,e))}),Ep("Map",vl.call(e),D,g)}if(QS(e)){var R=[];return kS.call(e,function(Te){R.push(m(Te,e))}),Ep("Set",_l.call(e),R,g)}if(JS(e))return ku("WeakMap");if(ZS(e))return ku("WeakSet");if(XS(e))return ku("WeakRef");if(VS(e))return Yo(m(Number(e)));if(WS(e))return Yo(m(Ad.call(e)));if(GS(e))return Yo(AS.call(e));if(jS(e))return Yo(m(String(e)));if(!KS(e)&&!FS(e)){var U=mc(e,m),q=vp?vp(e)===Object.prototype:e instanceof Object||e.constructor===Object,B=e instanceof Object?"":"null prototype",te=!q&&Mt&&Object(e)===e&&Mt in e?cf.call(Li(e),8,-1):B?"Object":"",ye=q||typeof e.constructor!="function"?"":e.constructor.name?e.constructor.name+" ":"",we=ye+(te||B?"["+_n.call(mp.call([],te||[],B||[]),": ")+"] ":"");return U.length===0?we+"{}":g?we+"{"+Ud(U,g)+"}":we+"{ "+_n.call(U,", ")+" }"}return String(e)};function Uy(n,e,t){var r=(t.quoteStyle||e)==="double"?'"':"'";return r+n+r}function BS(n){return xi.call(String(n),/"/g,""")}function xd(n){return Li(n)==="[object Array]"&&(!Mt||!(typeof n=="object"&&Mt in n))}function KS(n){return Li(n)==="[object Date]"&&(!Mt||!(typeof n=="object"&&Mt in n))}function FS(n){return Li(n)==="[object RegExp]"&&(!Mt||!(typeof n=="object"&&Mt in n))}function qS(n){return Li(n)==="[object Error]"&&(!Mt||!(typeof n=="object"&&Mt in n))}function jS(n){return Li(n)==="[object String]"&&(!Mt||!(typeof n=="object"&&Mt in n))}function VS(n){return Li(n)==="[object Number]"&&(!Mt||!(typeof n=="object"&&Mt in n))}function GS(n){return Li(n)==="[object Boolean]"&&(!Mt||!(typeof n=="object"&&Mt in n))}function $y(n){if(wo)return n&&typeof n=="object"&&n instanceof Symbol;if(typeof n=="symbol")return!0;if(!n||typeof n!="object"||!Dd)return!1;try{return Dd.call(n),!0}catch{}return!1}function WS(n){if(!n||typeof n!="object"||!Ad)return!1;try{return Ad.call(n),!0}catch{}return!1}var HS=Object.prototype.hasOwnProperty||function(n){return n in this};function Pi(n,e){return HS.call(n,e)}function Li(n){return DS.call(n)}function YS(n){if(n.name)return n.name;var e=US.call(xS.call(n),/^function\s*([\w$]+)/);return e?e[1]:null}function Ny(n,e){if(n.indexOf)return n.indexOf(e);for(var t=0,r=n.length;t<r;t++)if(n[t]===e)return t;return-1}function zS(n){if(!vl||!n||typeof n!="object")return!1;try{vl.call(n);try{_l.call(n)}catch{return!0}return n instanceof Map}catch{}return!1}function JS(n){if(!Oa||!n||typeof n!="object")return!1;try{Oa.call(n,Oa);try{ka.call(n,ka)}catch{return!0}return n instanceof WeakMap}catch{}return!1}function XS(n){if(!pp||!n||typeof n!="object")return!1;try{return pp.call(n),!0}catch{}return!1}function QS(n){if(!_l||!n||typeof n!="object")return!1;try{_l.call(n);try{vl.call(n)}catch{return!0}return n instanceof Set}catch{}return!1}function ZS(n){if(!ka||!n||typeof n!="object")return!1;try{ka.call(n,ka);try{Oa.call(n,Oa)}catch{return!0}return n instanceof WeakSet}catch{}return!1}function eb(n){return!n||typeof n!="object"?!1:typeof HTMLElement!="undefined"&&n instanceof HTMLElement?!0:typeof n.nodeName=="string"&&typeof n.getAttribute=="function"}function Ly(n,e){if(n.length>e.maxStringLength){var t=n.length-e.maxStringLength,r="... "+t+" more character"+(t>1?"s":"");return Ly(cf.call(n,0,e.maxStringLength),e)+r}var i=xi.call(xi.call(n,/(['\\])/g,"\\$1"),/[\x00-\x1f]/g,tb);return Uy(i,"single",e)}function tb(n){var e=n.charCodeAt(0),t={8:"b",9:"t",10:"n",12:"f",13:"r"}[e];return t?"\\"+t:"\\x"+(e<16?"0":"")+$S.call(e.toString(16))}function Yo(n){return"Object("+n+")"}function ku(n){return n+" { ? }"}function Ep(n,e,t,r){var i=r?Ud(t,r):_n.call(t,", ");return n+" ("+e+") {"+i+"}"}function rb(n){for(var e=0;e<n.length;e++)if(Ny(n[e],`
-`)>=0)return!1;return!0}function nb(n,e){var t;if(n.indent===" ")t=" ";else if(typeof n.indent=="number"&&n.indent>0)t=_n.call(Array(n.indent+1)," ");else return null;return{base:t,prev:_n.call(Array(e+1),t)}}function Ud(n,e){if(n.length===0)return"";var t=`
-`+e.prev+e.base;return t+_n.call(n,","+t)+`
-`+e.prev}function mc(n,e){var t=xd(n),r=[];if(t){r.length=n.length;for(var i=0;i<n.length;i++)r[i]=Pi(n,i)?e(n[i],n):""}var s=typeof Iu=="function"?Iu(n):[],o;if(wo){o={};for(var a=0;a<s.length;a++)o["$"+s[a]]=s[a]}for(var l in n)!Pi(n,l)||t&&String(Number(l))===l&&l<n.length||wo&&o["$"+l]instanceof Symbol||(Dy.call(/[^\w$]/,l)?r.push(e(l,n)+": "+e(n[l],n)):r.push(l+": "+e(n[l],n)));if(typeof Iu=="function")for(var u=0;u<s.length;u++)xy.call(n,s[u])&&r.push("["+e(s[u])+"]: "+e(n[s[u]],n));return r}var lf=sf,xo=RS,ib=LS,sb=lf("%TypeError%"),yc=lf("%WeakMap%",!0),vc=lf("%Map%",!0),ob=xo("WeakMap.prototype.get",!0),ab=xo("WeakMap.prototype.set",!0),cb=xo("WeakMap.prototype.has",!0),lb=xo("Map.prototype.get",!0),ub=xo("Map.prototype.set",!0),db=xo("Map.prototype.has",!0),uf=function(n,e){for(var t=n,r;(r=t.next)!==null;t=r)if(r.key===e)return t.next=r.next,r.next=n.next,n.next=r,r},hb=function(n,e){var t=uf(n,e);return t&&t.value},fb=function(n,e,t){var r=uf(n,e);r?r.value=t:n.next={key:e,next:n.next,value:t}},pb=function(n,e){return!!uf(n,e)},gb=function(){var e,t,r,i={assert:function(s){if(!i.has(s))throw new sb("Side channel does not contain "+ib(s))},get:function(s){if(yc&&s&&(typeof s=="object"||typeof s=="function")){if(e)return ob(e,s)}else if(vc){if(t)return lb(t,s)}else if(r)return hb(r,s)},has:function(s){if(yc&&s&&(typeof s=="object"||typeof s=="function")){if(e)return cb(e,s)}else if(vc){if(t)return db(t,s)}else if(r)return pb(r,s);return!1},set:function(s,o){yc&&s&&(typeof s=="object"||typeof s=="function")?(e||(e=new yc),ab(e,s,o)):vc?(t||(t=new vc),ub(t,s,o)):(r||(r={key:{},next:null}),fb(r,s,o))}};return i},mb=String.prototype.replace,yb=/%20/g,Cu={RFC1738:"RFC1738",RFC3986:"RFC3986"},df={default:Cu.RFC3986,formatters:{RFC1738:function(n){return mb.call(n,yb,"+")},RFC3986:function(n){return String(n)}},RFC1738:Cu.RFC1738,RFC3986:Cu.RFC3986},vb=df,Pu=Object.prototype.hasOwnProperty,rs=Array.isArray,on=function(){for(var n=[],e=0;e<256;++e)n.push("%"+((e<16?"0":"")+e.toString(16)).toUpperCase());return n}(),_b=function(e){for(;e.length>1;){var t=e.pop(),r=t.obj[t.prop];if(rs(r)){for(var i=[],s=0;s<r.length;++s)typeof r[s]!="undefined"&&i.push(r[s]);t.obj[t.prop]=i}}},By=function(e,t){for(var r=t&&t.plainObjects?Object.create(null):{},i=0;i<e.length;++i)typeof e[i]!="undefined"&&(r[i]=e[i]);return r},Eb=function n(e,t,r){if(!t)return e;if(typeof t!="object"){if(rs(e))e.push(t);else if(e&&typeof e=="object")(r&&(r.plainObjects||r.allowPrototypes)||!Pu.call(Object.prototype,t))&&(e[t]=!0);else return[e,t];return e}if(!e||typeof e!="object")return[e].concat(t);var i=e;return rs(e)&&!rs(t)&&(i=By(e,r)),rs(e)&&rs(t)?(t.forEach(function(s,o){if(Pu.call(e,o)){var a=e[o];a&&typeof a=="object"&&s&&typeof s=="object"?e[o]=n(a,s,r):e.push(s)}else e[o]=s}),e):Object.keys(t).reduce(function(s,o){var a=t[o];return Pu.call(s,o)?s[o]=n(s[o],a,r):s[o]=a,s},i)},Sb=function(e,t){return Object.keys(t).reduce(function(r,i){return r[i]=t[i],r},e)},bb=function(n,e,t){var r=n.replace(/\+/g," ");if(t==="iso-8859-1")return r.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(r)}catch{return r}},wb=function(e,t,r,i,s){if(e.length===0)return e;var o=e;if(typeof e=="symbol"?o=Symbol.prototype.toString.call(e):typeof e!="string"&&(o=String(e)),r==="iso-8859-1")return escape(o).replace(/%u[0-9a-f]{4}/gi,function(c){return"%26%23"+parseInt(c.slice(2),16)+"%3B"});for(var a="",l=0;l<o.length;++l){var u=o.charCodeAt(l);if(u===45||u===46||u===95||u===126||u>=48&&u<=57||u>=65&&u<=90||u>=97&&u<=122||s===vb.RFC1738&&(u===40||u===41)){a+=o.charAt(l);continue}if(u<128){a=a+on[u];continue}if(u<2048){a=a+(on[192|u>>6]+on[128|u&63]);continue}if(u<55296||u>=57344){a=a+(on[224|u>>12]+on[128|u>>6&63]+on[128|u&63]);continue}l+=1,u=65536+((u&1023)<<10|o.charCodeAt(l)&1023),a+=on[240|u>>18]+on[128|u>>12&63]+on[128|u>>6&63]+on[128|u&63]}return a},Rb=function(e){for(var t=[{obj:{o:e},prop:"o"}],r=[],i=0;i<t.length;++i)for(var s=t[i],o=s.obj[s.prop],a=Object.keys(o),l=0;l<a.length;++l){var u=a[l],c=o[u];typeof c=="object"&&c!==null&&r.indexOf(c)===-1&&(t.push({obj:o,prop:u}),r.push(c))}return _b(t),e},Ib=function(e){return Object.prototype.toString.call(e)==="[object RegExp]"},Tb=function(e){return!e||typeof e!="object"?!1:!!(e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer(e))},Ob=function(e,t){return[].concat(e,t)},kb=function(e,t){if(rs(e)){for(var r=[],i=0;i<e.length;i+=1)r.push(t(e[i]));return r}return t(e)},Ky={arrayToObject:By,assign:Sb,combine:Ob,compact:Rb,decode:bb,encode:wb,isBuffer:Tb,isRegExp:Ib,maybeMap:kb,merge:Eb},Fy=gb,$d=Ky,Ca=df,Cb=Object.prototype.hasOwnProperty,Sp={brackets:function(e){return e+"[]"},comma:"comma",indices:function(e,t){return e+"["+t+"]"},repeat:function(e){return e}},os=Array.isArray,Pb=String.prototype.split,Mb=Array.prototype.push,qy=function(n,e){Mb.apply(n,os(e)?e:[e])},Ab=Date.prototype.toISOString,bp=Ca.default,yt={addQueryPrefix:!1,allowDots:!1,charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encoder:$d.encode,encodeValuesOnly:!1,format:bp,formatter:Ca.formatters[bp],indices:!1,serializeDate:function(e){return Ab.call(e)},skipNulls:!1,strictNullHandling:!1},Db=function(e){return typeof e=="string"||typeof e=="number"||typeof e=="boolean"||typeof e=="symbol"||typeof e=="bigint"},Mu={},xb=function n(e,t,r,i,s,o,a,l,u,c,g,m,f,E,I){for(var w=e,k=I,C=0,S=!1;(k=k.get(Mu))!==void 0&&!S;){var T=k.get(e);if(C+=1,typeof T!="undefined"){if(T===C)throw new RangeError("Cyclic object value");S=!0}typeof k.get(Mu)=="undefined"&&(C=0)}if(typeof a=="function"?w=a(t,w):w instanceof Date?w=c(w):r==="comma"&&os(w)&&(w=$d.maybeMap(w,function(Q){return Q instanceof Date?c(Q):Q})),w===null){if(i)return o&&!f?o(t,yt.encoder,E,"key",g):t;w=""}if(Db(w)||$d.isBuffer(w)){if(o){var D=f?t:o(t,yt.encoder,E,"key",g);if(r==="comma"&&f){for(var R=Pb.call(String(w),","),U="",q=0;q<R.length;++q)U+=(q===0?"":",")+m(o(R[q],yt.encoder,E,"value",g));return[m(D)+"="+U]}return[m(D)+"="+m(o(w,yt.encoder,E,"value",g))]}return[m(t)+"="+m(String(w))]}var B=[];if(typeof w=="undefined")return B;var te;if(r==="comma"&&os(w))te=[{value:w.length>0?w.join(",")||null:void 0}];else if(os(a))te=a;else{var ye=Object.keys(w);te=l?ye.sort(l):ye}for(var we=0;we<te.length;++we){var Te=te[we],Ye=typeof Te=="object"&&typeof Te.value!="undefined"?Te.value:w[Te];if(!(s&&Ye===null)){var Vt=os(w)?typeof r=="function"?r(t,Te):t:t+(u?"."+Te:"["+Te+"]");I.set(e,C);var Gt=Fy();Gt.set(Mu,I),qy(B,n(Ye,Vt,r,i,s,o,a,l,u,c,g,m,f,E,Gt))}}return B},Ub=function(e){if(!e)return yt;if(e.encoder!==null&&typeof e.encoder!="undefined"&&typeof e.encoder!="function")throw new TypeError("Encoder has to be a function.");var t=e.charset||yt.charset;if(typeof e.charset!="undefined"&&e.charset!=="utf-8"&&e.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var r=Ca.default;if(typeof e.format!="undefined"){if(!Cb.call(Ca.formatters,e.format))throw new TypeError("Unknown format option provided.");r=e.format}var i=Ca.formatters[r],s=yt.filter;return(typeof e.filter=="function"||os(e.filter))&&(s=e.filter),{addQueryPrefix:typeof e.addQueryPrefix=="boolean"?e.addQueryPrefix:yt.addQueryPrefix,allowDots:typeof e.allowDots=="undefined"?yt.allowDots:!!e.allowDots,charset:t,charsetSentinel:typeof e.charsetSentinel=="boolean"?e.charsetSentinel:yt.charsetSentinel,delimiter:typeof e.delimiter=="undefined"?yt.delimiter:e.delimiter,encode:typeof e.encode=="boolean"?e.encode:yt.encode,encoder:typeof e.encoder=="function"?e.encoder:yt.encoder,encodeValuesOnly:typeof e.encodeValuesOnly=="boolean"?e.encodeValuesOnly:yt.encodeValuesOnly,filter:s,format:r,formatter:i,serializeDate:typeof e.serializeDate=="function"?e.serializeDate:yt.serializeDate,skipNulls:typeof e.skipNulls=="boolean"?e.skipNulls:yt.skipNulls,sort:typeof e.sort=="function"?e.sort:null,strictNullHandling:typeof e.strictNullHandling=="boolean"?e.strictNullHandling:yt.strictNullHandling}},$b=function(n,e){var t=n,r=Ub(e),i,s;typeof r.filter=="function"?(s=r.filter,t=s("",t)):os(r.filter)&&(s=r.filter,i=s);var o=[];if(typeof t!="object"||t===null)return"";var a;e&&e.arrayFormat in Sp?a=e.arrayFormat:e&&"indices"in e?a=e.indices?"indices":"repeat":a="indices";var l=Sp[a];i||(i=Object.keys(t)),r.sort&&i.sort(r.sort);for(var u=Fy(),c=0;c<i.length;++c){var g=i[c];r.skipNulls&&t[g]===null||qy(o,xb(t[g],g,l,r.strictNullHandling,r.skipNulls,r.encode?r.encoder:null,r.filter,r.sort,r.allowDots,r.serializeDate,r.format,r.formatter,r.encodeValuesOnly,r.charset,u))}var m=o.join(r.delimiter),f=r.addQueryPrefix===!0?"?":"";return r.charsetSentinel&&(r.charset==="iso-8859-1"?f+="utf8=%26%2310003%3B&":f+="utf8=%E2%9C%93&"),m.length>0?f+m:""},Ro=Ky,Nd=Object.prototype.hasOwnProperty,Nb=Array.isArray,ut={allowDots:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decoder:Ro.decode,delimiter:"&",depth:5,ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictNullHandling:!1},Lb=function(n){return n.replace(/&#(\d+);/g,function(e,t){return String.fromCharCode(parseInt(t,10))})},jy=function(n,e){return n&&typeof n=="string"&&e.comma&&n.indexOf(",")>-1?n.split(","):n},Bb="utf8=%26%2310003%3B",Kb="utf8=%E2%9C%93",Fb=function(e,t){var r={},i=t.ignoreQueryPrefix?e.replace(/^\?/,""):e,s=t.parameterLimit===1/0?void 0:t.parameterLimit,o=i.split(t.delimiter,s),a=-1,l,u=t.charset;if(t.charsetSentinel)for(l=0;l<o.length;++l)o[l].indexOf("utf8=")===0&&(o[l]===Kb?u="utf-8":o[l]===Bb&&(u="iso-8859-1"),a=l,l=o.length);for(l=0;l<o.length;++l)if(l!==a){var c=o[l],g=c.indexOf("]="),m=g===-1?c.indexOf("="):g+1,f,E;m===-1?(f=t.decoder(c,ut.decoder,u,"key"),E=t.strictNullHandling?null:""):(f=t.decoder(c.slice(0,m),ut.decoder,u,"key"),E=Ro.maybeMap(jy(c.slice(m+1),t),function(I){return t.decoder(I,ut.decoder,u,"value")})),E&&t.interpretNumericEntities&&u==="iso-8859-1"&&(E=Lb(E)),c.indexOf("[]=")>-1&&(E=Nb(E)?[E]:E),Nd.call(r,f)?r[f]=Ro.combine(r[f],E):r[f]=E}return r},qb=function(n,e,t,r){for(var i=r?e:jy(e,t),s=n.length-1;s>=0;--s){var o,a=n[s];if(a==="[]"&&t.parseArrays)o=[].concat(i);else{o=t.plainObjects?Object.create(null):{};var l=a.charAt(0)==="["&&a.charAt(a.length-1)==="]"?a.slice(1,-1):a,u=parseInt(l,10);!t.parseArrays&&l===""?o={0:i}:!isNaN(u)&&a!==l&&String(u)===l&&u>=0&&t.parseArrays&&u<=t.arrayLimit?(o=[],o[u]=i):l!=="__proto__"&&(o[l]=i)}i=o}return i},jb=function(e,t,r,i){if(!!e){var s=r.allowDots?e.replace(/\.([^.[]+)/g,"[$1]"):e,o=/(\[[^[\]]*])/,a=/(\[[^[\]]*])/g,l=r.depth>0&&o.exec(s),u=l?s.slice(0,l.index):s,c=[];if(u){if(!r.plainObjects&&Nd.call(Object.prototype,u)&&!r.allowPrototypes)return;c.push(u)}for(var g=0;r.depth>0&&(l=a.exec(s))!==null&&g<r.depth;){if(g+=1,!r.plainObjects&&Nd.call(Object.prototype,l[1].slice(1,-1))&&!r.allowPrototypes)return;c.push(l[1])}return l&&c.push("["+s.slice(l.index)+"]"),qb(c,t,r,i)}},Vb=function(e){if(!e)return ut;if(e.decoder!==null&&e.decoder!==void 0&&typeof e.decoder!="function")throw new TypeError("Decoder has to be a function.");if(typeof e.charset!="undefined"&&e.charset!=="utf-8"&&e.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var t=typeof e.charset=="undefined"?ut.charset:e.charset;return{allowDots:typeof e.allowDots=="undefined"?ut.allowDots:!!e.allowDots,allowPrototypes:typeof e.allowPrototypes=="boolean"?e.allowPrototypes:ut.allowPrototypes,allowSparse:typeof e.allowSparse=="boolean"?e.allowSparse:ut.allowSparse,arrayLimit:typeof e.arrayLimit=="number"?e.arrayLimit:ut.arrayLimit,charset:t,charsetSentinel:typeof e.charsetSentinel=="boolean"?e.charsetSentinel:ut.charsetSentinel,comma:typeof e.comma=="boolean"?e.comma:ut.comma,decoder:typeof e.decoder=="function"?e.decoder:ut.decoder,delimiter:typeof e.delimiter=="string"||Ro.isRegExp(e.delimiter)?e.delimiter:ut.delimiter,depth:typeof e.depth=="number"||e.depth===!1?+e.depth:ut.depth,ignoreQueryPrefix:e.ignoreQueryPrefix===!0,interpretNumericEntities:typeof e.interpretNumericEntities=="boolean"?e.interpretNumericEntities:ut.interpretNumericEntities,parameterLimit:typeof e.parameterLimit=="number"?e.parameterLimit:ut.parameterLimit,parseArrays:e.parseArrays!==!1,plainObjects:typeof e.plainObjects=="boolean"?e.plainObjects:ut.plainObjects,strictNullHandling:typeof e.strictNullHandling=="boolean"?e.strictNullHandling:ut.strictNullHandling}},Gb=function(n,e){var t=Vb(e);if(n===""||n===null||typeof n=="undefined")return t.plainObjects?Object.create(null):{};for(var r=typeof n=="string"?Fb(n,t):n,i=t.plainObjects?Object.create(null):{},s=Object.keys(r),o=0;o<s.length;++o){var a=s[o],l=jb(a,r[a],t,typeof n=="string");i=Ro.merge(i,l,t)}return t.allowSparse===!0?i:Ro.compact(i)},Wb=$b,Hb=Gb,Yb=df,zb={formats:Yb,parse:Hb,stringify:Wb},Cs={},Uo={},Y={exports:{}};(function(n){function e(t,r,i){return r in t?Object.defineProperty(t,r,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[r]=i,t}n.exports=e,n.exports.__esModule=!0,n.exports.default=n.exports})(Y);var se={},Vy={exports:{}};(function(n){(function(e,t){n.exports?n.exports=t():e.log=t()})(V,function(){var e=function(){},t="undefined",r=typeof window!==t&&typeof window.navigator!==t&&/Trident\/|MSIE /.test(window.navigator.userAgent),i=["trace","debug","info","warn","error"];function s(I,w){var k=I[w];if(typeof k.bind=="function")return k.bind(I);try{return Function.prototype.bind.call(k,I)}catch{return function(){return Function.prototype.apply.apply(k,[I,arguments])}}}function o(){console.log&&(console.log.apply?console.log.apply(console,arguments):Function.prototype.apply.apply(console.log,[console,arguments])),console.trace&&console.trace()}function a(I){return I==="debug"&&(I="log"),typeof console===t?!1:I==="trace"&&r?o:console[I]!==void 0?s(console,I):console.log!==void 0?s(console,"log"):e}function l(I,w){for(var k=0;k<i.length;k++){var C=i[k];this[C]=k<I?e:this.methodFactory(C,I,w)}this.log=this.debug}function u(I,w,k){return function(){typeof console!==t&&(l.call(this,w,k),this[I].apply(this,arguments))}}function c(I,w,k){return a(I)||u.apply(this,arguments)}function g(I,w,k){var C=this,S;w=w==null?"WARN":w;var T="loglevel";typeof I=="string"?T+=":"+I:typeof I=="symbol"&&(T=void 0);function D(B){var te=(i[B]||"silent").toUpperCase();if(!(typeof window===t||!T)){try{window.localStorage[T]=te;return}catch{}try{window.document.cookie=encodeURIComponent(T)+"="+te+";"}catch{}}}function R(){var B;if(!(typeof window===t||!T)){try{B=window.localStorage[T]}catch{}if(typeof B===t)try{var te=window.document.cookie,ye=te.indexOf(encodeURIComponent(T)+"=");ye!==-1&&(B=/^([^;]+)/.exec(te.slice(ye))[1])}catch{}return C.levels[B]===void 0&&(B=void 0),B}}function U(){if(!(typeof window===t||!T)){try{window.localStorage.removeItem(T);return}catch{}try{window.document.cookie=encodeURIComponent(T)+"=; expires=Thu, 01 Jan 1970 00:00:00 UTC"}catch{}}}C.name=I,C.levels={TRACE:0,DEBUG:1,INFO:2,WARN:3,ERROR:4,SILENT:5},C.methodFactory=k||c,C.getLevel=function(){return S},C.setLevel=function(B,te){if(typeof B=="string"&&C.levels[B.toUpperCase()]!==void 0&&(B=C.levels[B.toUpperCase()]),typeof B=="number"&&B>=0&&B<=C.levels.SILENT){if(S=B,te!==!1&&D(B),l.call(C,B,I),typeof console===t&&B<C.levels.SILENT)return"No console available for logging"}else throw"log.setLevel() called with invalid level: "+B},C.setDefaultLevel=function(B){w=B,R()||C.setLevel(B,!1)},C.resetLevel=function(){C.setLevel(w,!1),U()},C.enableAll=function(B){C.setLevel(C.levels.TRACE,B)},C.disableAll=function(B){C.setLevel(C.levels.SILENT,B)};var q=R();q==null&&(q=w),C.setLevel(q,!1)}var m=new g,f={};m.getLogger=function(w){if(typeof w!="symbol"&&typeof w!="string"||w==="")throw new TypeError("You must supply a name when creating a logger.");var k=f[w];return k||(k=f[w]=new g(w,m.getLevel(),m.methodFactory)),k};var E=typeof window!==t?window.log:void 0;return m.noConflict=function(){return typeof window!==t&&window.log===m&&(window.log=E),m},m.getLoggers=function(){return f},m.default=m,m})})(Vy);var Jb=G.exports;Object.defineProperty(se,"__esModule",{value:!0});se.logger=void 0;var Na=Jb(Vy.exports);const Gy="matrix";Na.default.methodFactory=function(n,e,t){return function(...r){return this.prefix&&r.unshift(this.prefix),n==="error"||n==="warn"||n==="trace"||n==="info"?console[n](...r):console.log(...r)}};const hf=Na.default.getLogger(Gy);se.logger=hf;hf.setLevel(Na.default.levels.DEBUG,!1);function Wy(n){n.withPrefix=function(e){const t=this.prefix||"";return Xb(t+e)}}Wy(hf);function Xb(n){const e=Na.default.getLogger(`${Gy}-${n}`);return e.prefix!==n&&(Wy(e),e.prefix=n,e.setLevel(Na.default.levels.DEBUG,!1)),e}var W={};const Qb="l",Zb="rn";var ew={"0":"O","1":"l","\u05AD":"\u0596","\u05AE":"\u0598","\u05A8":"\u0599","\u05A4":"\u059A","\u1AB4":"\u06DB","\u20DB":"\u06DB","\u0619":"\u0313","\u08F3":"\u0313","\u0343":"\u0313","\u0315":"\u0313","\u064F":"\u0313","\u065D":"\u0314","\u059C":"\u0301","\u059D":"\u0301","\u0618":"\u0301","\u0747":"\u0301","\u0341":"\u0301","\u0954":"\u0301","\u064E":"\u0301","\u0340":"\u0300","\u0953":"\u0300","\u030C":"\u0306","\uA67C":"\u0306","\u0658":"\u0306","\u065A":"\u0306","\u036E":"\u0306","\u06E8":"\u0306\u0307","\u0310":"\u0306\u0307","\u0901":"\u0306\u0307","\u0981":"\u0306\u0307","\u0A81":"\u0306\u0307","\u0B01":"\u0306\u0307","\u0C00":"\u0306\u0307","\u0C81":"\u0306\u0307","\u0D01":"\u0306\u0307","\u{114BF}":"\u0306\u0307","\u1CD0":"\u0302","\u0311":"\u0302","\u065B":"\u0302","\u07EE":"\u0302","\uA6F0":"\u0302","\u05AF":"\u030A","\u06DF":"\u030A","\u17D3":"\u030A","\u309A":"\u030A","\u0652":"\u030A","\u0B82":"\u030A","\u1036":"\u030A","\u17C6":"\u030A","\u{11300}":"\u030A","\u0E4D":"\u030A","\u0ECD":"\u030A","\u0366":"\u030A","\u2DEA":"\u030A","\u08EB":"\u0308","\u07F3":"\u0308","\u064B":"\u030B","\u08F0":"\u030B","\u0342":"\u0303","\u0653":"\u0303","\u05C4":"\u0307","\u06EC":"\u0307","\u0740":"\u0307","\u08EA":"\u0307","\u0741":"\u0307","\u0358":"\u0307","\u05B9":"\u0307","\u05BA":"\u0307","\u05C2":"\u0307","\u05C1":"\u0307","\u07ED":"\u0307","\u0902":"\u0307","\u0A02":"\u0307","\u0A82":"\u0307","\u0BCD":"\u0307","\u0337":"\u0338","\u1AB7":"\u0328","\u0322":"\u0328","\u0345":"\u0328","\u1CD2":"\u0304","\u0305":"\u0304","\u0659":"\u0304","\u07EB":"\u0304","\uA6F1":"\u0304","\u1CDA":"\u030E","\u0657":"\u0312","\u0357":"\u0350","\u08FF":"\u0350","\u08F8":"\u0350","\u0900":"\u0352","\u1CED":"\u0316","\u1CDC":"\u0329","\u0656":"\u0329","\u1CD5":"\u032B","\u0347":"\u0333","\u08F9":"\u0354","\u08FA":"\u0355","\u309B":"\uFF9E","\u309C":"\uFF9F","\u0336":"\u0335","\u302C":"\u0309","\u05C5":"\u0323","\u08ED":"\u0323","\u1CDD":"\u0323","\u05B4":"\u0323","\u065C":"\u0323","\u093C":"\u0323","\u09BC":"\u0323","\u0A3C":"\u0323","\u0ABC":"\u0323","\u0B3C":"\u0323","\u{111CA}":"\u0323","\u{114C3}":"\u0323","\u{10A3A}":"\u0323","\u08EE":"\u0324","\u1CDE":"\u0324","\u0F37":"\u0325","\u302D":"\u0325","\u0327":"\u0326","\u0321":"\u0326","\u0339":"\u0326","\u1CD9":"\u032D","\u1CD8":"\u032E","\u0952":"\u0331","\u0320":"\u0331","\u08F1":"\u064C","\u08E8":"\u064C","\u08E5":"\u064C",\uFC5E:"\uFE72\u0651","\u08F2":"\u064D",\uFC5F:"\uFE74\u0651",\uFCF2:"\uFE77\u0651",\uFC60:"\uFE76\u0651",\uFCF3:"\uFE79\u0651",\uFC61:"\uFE78\u0651","\u061A":"\u0650","\u0317":"\u0650",\uFCF4:"\uFE7B\u0651",\uFC62:"\uFE7A\u0651",\uFC63:"\uFE7C\u0670","\u065F":"\u0655","\u030D":"\u0670","\u0742":"\u073C","\u0A03":"\u0983","\u0C03":"\u0983","\u0C83":"\u0983","\u0D03":"\u0983","\u0D83":"\u0983","\u1038":"\u0983","\u{114C1}":"\u0983","\u17CB":"\u0E48","\u0EC8":"\u0E48","\u0EC9":"\u0E49","\u0ECA":"\u0E4A","\u0ECB":"\u0E4B","\uA66F":"\u20E9","\u2028":" ","\u2029":" ","\u1680":" ","\u2000":" ","\u2001":" ","\u2002":" ","\u2003":" ","\u2004":" ","\u2005":" ","\u2006":" ","\u2008":" ","\u2009":" ","\u200A":" ","\u205F":" ","\xA0":" ","\u2007":" ","\u202F":" ","\u07FA":"_","\uFE4D":"_","\uFE4E":"_","\uFE4F":"_","\u2010":"-","\u2011":"-","\u2012":"-","\u2013":"-","\uFE58":"-","\u06D4":"-","\u2043":"-","\u02D7":"-","\u2212":"-","\u2796":"-","\u2CBA":"-","\u2A29":"-\u0313","\u2E1A":"-\u0308","\uFB29":"-\u0307","\u2238":"-\u0307","\u2A2A":"-\u0323","\uA4FE":"-.","\uFF5E":"\u301C","\u060D":",","\u066B":",","\u201A":",","\xB8":",","\uA4F9":",","\u2E32":"\u060C","\u066C":"\u060C","\u037E":";","\u2E35":"\u061B","\u0903":":","\u0A83":":","\uFF1A":":","\u0589":":","\u0703":":","\u0704":":","\u16EC":":","\uFE30":":","\u1803":":","\u1809":":","\u205A":":","\u05C3":":","\u02F8":":","\uA789":":","\u2236":":",\u02D0:":","\uA4FD":":","\u2A74":"::=","\u29F4":":\u2192","\uFF01":"!",\u01C3:"!","\u2D51":"!","\u203C":"!!","\u2049":"!?",\u0294:"?","\u0241":"?","\u097D":"?",\u13AE:"?","\uA6EB":"?","\u2048":"?!","\u2047":"??","\u2E2E":"\u061F","\u{1D16D}":".","\u2024":".","\u0701":".","\u0702":".","\uA60E":".","\u{10A50}":".","\u0660":".","\u06F0":".","\uA4F8":".","\uA4FB":".,","\u2025":"..","\uA4FA":"..","\u2026":"...","\uA6F4":"\uA6F3\uA6F3","\u30FB":"\xB7","\uFF65":"\xB7","\u16EB":"\xB7","\u0387":"\xB7","\u2E31":"\xB7","\u{10101}":"\xB7","\u2022":"\xB7","\u2027":"\xB7","\u2219":"\xB7","\u22C5":"\xB7","\uA78F":"\xB7",\u1427:"\xB7","\u22EF":"\xB7\xB7\xB7","\u2D48":"\xB7\xB7\xB7",\u1444:"\xB7<","\u22D7":"\xB7>",\u1437:"\xB7>",\u1440:"\xB7>",\u152F:"\xB74",\u147E:"\xB7b",\u1480:"\xB7b\u0307",\u147A:"\xB7d",\u1498:"\xB7J",\u14B6:"\xB7L",\u1476:"\xB7P",\u1457:"\xB7U",\u143A:"\xB7V",\u143C:"\xB7\u0245",\u14AE:"\xB7\u0393",\u140E:"\xB7\u0394",\u1459:"\xB7\u0548",\u140C:"\xB7\u1401",\u1410:"\xB7\u1404",\u1412:"\xB7\u1405",\u1414:"\xB7\u1406",\u1417:"\xB7\u140A",\u1419:"\xB7\u140B",\u143E:"\xB7\u1432",\u1442:"\xB7\u1434",\u1446:"\xB7\u1439",\u145B:"\xB7\u144F",\u1454:"\xB7\u1450",\u145D:"\xB7\u1450",\u145F:"\xB7\u1451",\u1461:"\xB7\u1455",\u1463:"\xB7\u1456",\u1474:"\xB7\u146B",\u1478:"\xB7\u146E",\u147C:"\xB7\u1470",\u1492:"\xB7\u1489",\u1494:"\xB7\u148B",\u1496:"\xB7\u148C",\u149A:"\xB7\u148E",\u149C:"\xB7\u1490",\u149E:"\xB7\u1491",\u14AC:"\xB7\u14A3",\u14B0:"\xB7\u14A6",\u14B2:"\xB7\u14A7",\u14B4:"\xB7\u14A8",\u14B8:"\xB7\u14AB",\u14C9:"\xB7\u14C0","\u18C6":"\xB7\u14C2","\u18C8":"\xB7\u14C3","\u18CA":"\xB7\u14C4","\u18CC":"\xB7\u14C5",\u14CB:"\xB7\u14C7",\u14CD:"\xB7\u14C8",\u14DC:"\xB7\u14D3",\u14DE:"\xB7\u14D5",\u14E0:"\xB7\u14D6",\u14E2:"\xB7\u14D7",\u14E4:"\xB7\u14D8",\u14E6:"\xB7\u14DA",\u14E8:"\xB7\u14DB",\u14F6:"\xB7\u14ED",\u14F8:"\xB7\u14EF",\u14FA:"\xB7\u14F0",\u14FC:"\xB7\u14F1",\u14FE:"\xB7\u14F2",\u1500:"\xB7\u14F4",\u1502:"\xB7\u14F5",\u1517:"\xB7\u1510",\u1519:"\xB7\u1511",\u151B:"\xB7\u1512",\u151D:"\xB7\u1513",\u151F:"\xB7\u1514",\u1521:"\xB7\u1515",\u1523:"\xB7\u1516",\u1531:"\xB7\u1528",\u1533:"\xB7\u1529",\u1535:"\xB7\u152A",\u1537:"\xB7\u152B",\u1539:"\xB7\u152D",\u153B:"\xB7\u152E","\u18CE":"\xB7\u1543","\u18CF":"\xB7\u1546","\u18D0":"\xB7\u1547","\u18D1":"\xB7\u1548","\u18D2":"\xB7\u1549","\u18D3":"\xB7\u154B",\u154E:"\xB7\u154C",\u155B:"\xB7\u155A",\u1568:"\xB7\u1567","\u18B3":"\xB7\u18B1","\u18B6":"\xB7\u18B4","\u18B9":"\xB7\u18B8","\u18C2":"\xB7\u18C0","\uA830":"\u0964","\u0965":"\u0964\u0964","\u1C3C":"\u1C3B\u1C3B","\u104B":"\u104A\u104A","\u1AA9":"\u1AA8\u1AA8","\u1AAB":"\u1AAA\u1AA8","\u1B5F":"\u1B5E\u1B5E","\u{10A57}":"\u{10A56}\u{10A56}","\u{1144C}":"\u{1144B}\u{1144B}","\u{11642}":"\u{11641}\u{11641}","\u{11C42}":"\u{11C41}\u{11C41}","\u1C7F":"\u1C7E\u1C7E","\u055D":"'","\uFF07":"'","\u2018":"'","\u2019":"'","\u201B":"'","\u2032":"'","\u2035":"'","\u055A":"'","\u05F3":"'","`":"'","\u1FEF":"'","\uFF40":"'","\xB4":"'","\u0384":"'","\u1FFD":"'","\u1FBD":"'","\u1FBF":"'","\u1FFE":"'","\u02B9":"'","\u0374":"'","\u02C8":"'","\u02CA":"'","\u02CB":"'","\u02F4":"'",\u02BB:"'",\u02BD:"'",\u02BC:"'",\u02BE:"'","\uA78C":"'",\u05D9:"'","\u07F4":"'","\u07F5":"'",\u144A:"'",\u16CC:"'","\u{16F51}":"'","\u{16F52}":"'","\u1CD3":"''",'"':"''","\uFF02":"''","\u201C":"''","\u201D":"''","\u201F":"''","\u2033":"''","\u2036":"''","\u3003":"''","\u05F4":"''","\u02DD":"''","\u02BA":"''","\u02F6":"''",\u02EE:"''",\u05F2:"''","\u2034":"'''","\u2037":"'''","\u2057":"''''",\u0181:"'B",\u018A:"'D",\u0149:"'n",\u01A4:"'P",\u01AC:"'T",\u01B3:"'Y","\uFF3B":"(","\u2768":"(","\u2772":"(","\u3014":"(","\uFD3E":"(","\u2E28":"((","\u3220":"(\u30FC)","\u2475":"(2)","\u2487":"(2O)","\u2476":"(3)","\u2477":"(4)","\u2478":"(5)","\u2479":"(6)","\u247A":"(7)","\u247B":"(8)","\u247C":"(9)","\u249C":"(a)","\u{1F110}":"(A)","\u249D":"(b)","\u{1F111}":"(B)","\u249E":"(c)","\u{1F112}":"(C)","\u249F":"(d)","\u{1F113}":"(D)","\u24A0":"(e)","\u{1F114}":"(E)","\u24A1":"(f)","\u{1F115}":"(F)","\u24A2":"(g)","\u{1F116}":"(G)","\u24A3":"(h)","\u{1F117}":"(H)","\u24A4":"(i)","\u24A5":"(j)","\u{1F119}":"(J)","\u24A6":"(k)","\u{1F11A}":"(K)","\u2474":"(l)","\u{1F118}":"(l)","\u24A7":"(l)","\u{1F11B}":"(L)","\u247F":"(l2)","\u2480":"(l3)","\u2481":"(l4)","\u2482":"(l5)","\u2483":"(l6)","\u2484":"(l7)","\u2485":"(l8)","\u2486":"(l9)","\u247E":"(ll)","\u247D":"(lO)","\u{1F11C}":"(M)","\u24A9":"(n)","\u{1F11D}":"(N)","\u24AA":"(o)","\u{1F11E}":"(O)","\u24AB":"(p)","\u{1F11F}":"(P)","\u24AC":"(q)","\u{1F120}":"(Q)","\u24AD":"(r)","\u{1F121}":"(R)","\u24A8":"(rn)","\u24AE":"(s)","\u{1F122}":"(S)","\u{1F12A}":"(S)","\u24AF":"(t)","\u{1F123}":"(T)","\u24B0":"(u)","\u{1F124}":"(U)","\u24B1":"(v)","\u{1F125}":"(V)","\u24B2":"(w)","\u{1F126}":"(W)","\u24B3":"(x)","\u{1F127}":"(X)","\u24B4":"(y)","\u{1F128}":"(Y)","\u24B5":"(z)","\u{1F129}":"(Z)","\u3200":"(\u1100)","\u320E":"(\uAC00)","\u3201":"(\u1102)","\u320F":"(\uB098)","\u3202":"(\u1103)","\u3210":"(\uB2E4)","\u3203":"(\u1105)","\u3211":"(\uB77C)","\u3204":"(\u1106)","\u3212":"(\uB9C8)","\u3205":"(\u1107)","\u3213":"(\uBC14)","\u3206":"(\u1109)","\u3214":"(\uC0AC)","\u3207":"(\u110B)","\u3215":"(\uC544)","\u321D":"(\uC624\uC804)","\u321E":"(\uC624\uD6C4)","\u3208":"(\u110C)","\u3216":"(\uC790)","\u321C":"(\uC8FC)","\u3209":"(\u110E)","\u3217":"(\uCC28)","\u320A":"(\u110F)","\u3218":"(\uCE74)","\u320B":"(\u1110)","\u3219":"(\uD0C0)","\u320C":"(\u1111)","\u321A":"(\uD30C)","\u320D":"(\u1112)","\u321B":"(\uD558)","\u3226":"(\u4E03)","\u3222":"(\u4E09)","\u{1F241}":"(\u4E09)","\u3228":"(\u4E5D)","\u3221":"(\u4E8C)","\u{1F242}":"(\u4E8C)","\u3224":"(\u4E94)","\u3239":"(\u4EE3)","\u323D":"(\u4F01)","\u3241":"(\u4F11)","\u3227":"(\u516B)","\u3225":"(\u516D)","\u3238":"(\u52B4)","\u{1F247}":"(\u52DD)","\u3229":"(\u5341)","\u323F":"(\u5354)","\u3234":"(\u540D)","\u323A":"(\u547C)","\u3223":"(\u56DB)","\u322F":"(\u571F)","\u323B":"(\u5B66)","\u{1F243}":"(\u5B89)","\u{1F245}":"(\u6253)","\u{1F248}":"(\u6557)","\u3230":"(\u65E5)","\u322A":"(\u6708)","\u3232":"(\u6709)","\u322D":"(\u6728)","\u{1F240}":"(\u672C)","\u3231":"(\u682A)","\u322C":"(\u6C34)","\u322B":"(\u706B)","\u{1F244}":"(\u70B9)","\u3235":"(\u7279)","\u{1F246}":"(\u76D7)","\u323C":"(\u76E3)","\u3233":"(\u793E)","\u3237":"(\u795D)","\u3240":"(\u796D)","\u3242":"(\u81EA)","\u3243":"(\u81F3)","\u3236":"(\u8CA1)","\u323E":"(\u8CC7)","\u322E":"(\u91D1)","\uFF3D":")","\u2769":")","\u2773":")","\u3015":")","\uFD3F":")","\u2E29":"))","\u2774":"{","\u{1D114}":"{","\u2775":"}","\u301A":"\u27E6","\u301B":"\u27E7","\u27E8":"\u276C","\u2329":"\u276C","\u3008":"\u276C","\u31DB":"\u276C",\u304F:"\u276C","\u{21FE8}":"\u276C","\u27E9":"\u276D","\u232A":"\u276D","\u3009":"\u276D","\uFF3E":"\uFE3F","\u2E3F":"\xB6","\u204E":"*","\u066D":"*","\u2217":"*","\u{1031F}":"*","\u1735":"/","\u2041":"/","\u2215":"/","\u2044":"/","\u2571":"/","\u27CB":"/","\u29F8":"/","\u{1D23A}":"/","\u31D3":"/",\u3033:"/","\u2CC6":"/",\u30CE:"/",\u4E3F:"/","\u2F03":"/","\u29F6":"/\u0304","\u2AFD":"//","\u2AFB":"///","\uFF3C":"\\","\uFE68":"\\","\u2216":"\\","\u27CD":"\\","\u29F5":"\\","\u29F9":"\\","\u{1D20F}":"\\","\u{1D23B}":"\\","\u31D4":"\\",\u4E36:"\\","\u2F02":"\\","\u2CF9":"\\\\","\u244A":"\\\\","\u27C8":"\\\u1455","\uA778":"&","\u0AF0":"\u0970","\u{110BB}":"\u0970","\u{111C7}":"\u0970","\u26AC":"\u0970","\u{111DB}":"\uA8FC","\u17D9":"\u0E4F","\u17D5":"\u0E5A","\u17DA":"\u0E5B","\u0F0C":"\u0F0B","\u0F0E":"\u0F0D\u0F0D","\u02C4":"^","\u02C6":"^","\uA67E":"\u02C7","\u02D8":"\u02C7","\u203E":"\u02C9","\uFE49":"\u02C9","\uFE4A":"\u02C9","\uFE4B":"\u02C9","\uFE4C":"\u02C9","\xAF":"\u02C9","\uFFE3":"\u02C9","\u2594":"\u02C9",\u044A:"\u02C9b","\uA651":"\u02C9bi","\u0375":"\u02CF","\u02FB":"\u02EA","\uA716":"\u02EA","\uA714":"\u02EB","\u3002":"\u02F3","\u2E30":"\xB0","\u02DA":"\xB0","\u2218":"\xB0","\u25CB":"\xB0","\u25E6":"\xB0","\u235C":"\xB0\u0332","\u2364":"\xB0\u0308","\u2103":"\xB0C","\u2109":"\xB0F","\u0BF5":"\u0BF3","\u0F1B":"\u0F1A\u0F1A","\u0F1F":"\u0F1A\u0F1D","\u0FCE":"\u0F1D\u0F1A","\u0F1E":"\u0F1D\u0F1D","\u24B8":"\xA9","\u24C7":"\xAE","\u24C5":"\u2117","\u{1D21B}":"\u2144","\u2BEC":"\u219E","\u2BED":"\u219F","\u2BEE":"\u21A0","\u2BEF":"\u21A1","\u21B5":"\u21B2","\u2965":"\u21C3\u21C2","\u296F":"\u21C3\u16DA","\u{1D6DB}":"\u2202","\u{1D715}":"\u2202","\u{1D74F}":"\u2202","\u{1D789}":"\u2202","\u{1D7C3}":"\u2202","\u{1E8CC}":"\u2202","\u{1E8CD}":"\u2202\u0335",\u00F0:"\u2202\u0335","\u2300":"\u2205","\u{1D6C1}":"\u2207","\u{1D6FB}":"\u2207","\u{1D735}":"\u2207","\u{1D76F}":"\u2207","\u{1D7A9}":"\u2207","\u{118A8}":"\u2207","\u2362":"\u2207\u0308","\u236B":"\u2207\u0334","\u2588":"\u220E","\u25A0":"\u220E","\u2A3F":"\u2210","\u16ED":"+","\u2795":"+","\u{1029B}":"+","\u2A23":"+\u0302","\u2A22":"+\u030A","\u2A24":"+\u0303","\u2214":"+\u0307","\u2A25":"+\u0323","\u2A26":"+\u0330","\u2A27":"+\u2082","\u2797":"\xF7","\u2039":"<","\u276E":"<","\u02C2":"<","\u{1D236}":"<",\u1438:"<",\u16B2:"<","\u22D6":"<\xB7","\u2CB4":"<\xB7",\u1445:"<\xB7","\u226A":"<<","\u22D8":"<<<","\u1400":"=","\u2E40":"=","\u30A0":"=","\uA4FF":"=","\u225A":"=\u0306","\u2259":"=\u0302","\u2257":"=\u030A","\u2250":"=\u0307","\u2251":"=\u0307\u0323","\u2A6E":"=\u20F0","\u2A75":"==","\u2A76":"===","\u225E":"=\u036B","\u203A":">","\u276F":">","\u02C3":">","\u{1D237}":">",\u1433:">","\u{16F3F}":">",\u1441:">\xB7","\u2AA5":"><","\u226B":">>","\u2A20":">>","\u22D9":">>>","\u2053":"~","\u02DC":"~","\u1FC0":"~","\u223C":"~","\u2368":"~\u0308","\u2E1E":"~\u0307","\u2A6A":"~\u0307","\u2E1F":"~\u0323","\u{1E8C8}":"\u2220","\u22C0":"\u2227","\u222F":"\u222E\u222E","\u2230":"\u222E\u222E\u222E","\u2E2B":"\u2234","\u2E2A":"\u2235","\u2E2C":"\u2237","\u{111DE}":"\u2248","\u264E":"\u224F","\u{1F75E}":"\u224F","\u2263":"\u2261","\u2A03":"\u228D","\u2A04":"\u228E","\u{1D238}":"\u228F","\u{1D239}":"\u2290","\u2A05":"\u2293","\u2A06":"\u2294","\u2A02":"\u2297","\u235F":"\u229B","\u{1F771}":"\u22A0","\u{1F755}":"\u22A1","\u25C1":"\u22B2","\u25B7":"\u22B3","\u2363":"\u22C6\u0308","\uFE34":"\u2307","\u25E0":"\u2312","\u2A3D":"\u2319","\u2325":"\u2324","\u29C7":"\u233B","\u25CE":"\u233E","\u29BE":"\u233E","\u29C5":"\u2342","\u29B0":"\u2349","\u23C3":"\u234B","\u23C2":"\u234E","\u23C1":"\u2355","\u23C6":"\u236D","\u2638":"\u2388","\uFE35":"\u23DC","\uFE36":"\u23DD","\uFE37":"\u23DE","\uFE38":"\u23DF","\uFE39":"\u23E0","\uFE3A":"\u23E1","\u25B1":"\u23E5","\u23FC":"\u23FB","\uFE31":"\u2502","\uFF5C":"\u2502","\u2503":"\u2502","\u250F":"\u250C","\u2523":"\u251C","\u2590":"\u258C","\u2597":"\u2596","\u259D":"\u2598","\u2610":"\u25A1","\uFFED":"\u25AA","\u25B8":"\u25B6","\u25BA":"\u25B6","\u2CE9":"\u2627","\u{1F70A}":"\u2629","\u{1F312}":"\u263D","\u{1F319}":"\u263D","\u23FE":"\u263E","\u{1F318}":"\u263E","\u29D9":"\u299A","\u{1F73A}":"\u29DF","\u2A3E":"\u2A1F","\u{101A0}":"\u2CE8","\u2669":"\u{1D158}\u{1D165}","\u266A":"\u{1D158}\u{1D165}\u{1D16E}","\u24EA":"\u{1F10D}","\u21BA":"\u{1F10E}","\u02D9":"\u0971","\u0D4E":"\u0971","\uFF0D":"\u30FC","\u2014":"\u30FC","\u2015":"\u30FC","\u2500":"\u30FC","\u2501":"\u30FC","\u31D0":"\u30FC","\uA7F7":"\u30FC",\u1173:"\u30FC",\u3161:"\u30FC",\u4E00:"\u30FC","\u2F00":"\u30FC",\u1196:"\u30FC\u30FC","\uD7B9":"\u30FC\u1161","\uD7BA":"\u30FC\u1165","\uD7BB":"\u30FC\u1165\u4E28","\uD7BC":"\u30FC\u1169",\u1195:"\u30FC\u116E",\u1174:"\u30FC\u4E28",\u3162:"\u30FC\u4E28",\u1197:"\u30FC\u4E28\u116E","\u{1F10F}":"$\u20E0","\u20A4":"\xA3","\u3012":"\u20B8","\u3036":"\u20B8","\u1B5C":"\u1B50","\uA9C6":"\uA9D0","\u{114D1}":"\u09E7","\u0CE7":"\u0C67","\u1065":"\u1041","\u2460":"\u2780","\u2469":"\u2789","\u23E8":"\u2081\u2080","\u{1D7D0}":"2","\u{1D7DA}":"2","\u{1D7E4}":"2","\u{1D7EE}":"2","\u{1D7F8}":"2","\u{1FBF2}":"2","\uA75A":"2",\u01A7:"2",\u03E8:"2","\uA644":"2",\u14BF:"2","\uA6EF":"2","\uA9CF":"\u0662","\u06F2":"\u0662","\u0AE8":"\u0968","\u{114D2}":"\u09E8","\u0CE8":"\u0C68","\u2461":"\u2781",\u01BB:"2\u0335","\u{1F103}":"2,","\u2489":"2.","\u33F5":"22\u65E5","\u336E":"22\u70B9","\u33F6":"23\u65E5","\u336F":"23\u70B9","\u33F7":"24\u65E5","\u3370":"24\u70B9","\u33F8":"25\u65E5","\u33F9":"26\u65E5","\u33FA":"27\u65E5","\u33FB":"28\u65E5","\u33FC":"29\u65E5","\u33F4":"2l\u65E5","\u336D":"2l\u70B9","\u249B":"2O.","\u33F3":"2O\u65E5","\u336C":"2O\u70B9","\u0DE9":"\u0DE8\u0DCF","\u0DEF":"\u0DE8\u0DD3","\u33E1":"2\u65E5","\u32C1":"2\u6708","\u335A":"2\u70B9","\u{1D206}":"3","\u{1D7D1}":"3","\u{1D7DB}":"3","\u{1D7E5}":"3","\u{1D7EF}":"3","\u{1D7F9}":"3","\u{1FBF3}":"3","\uA7AB":"3",\u021C:"3",\u01B7:"3","\uA76A":"3","\u2CCC":"3",\u0417:"3",\u04E0:"3","\u{16F3B}":"3","\u{118CA}":"3","\u06F3":"\u0663","\u{1E8C9}":"\u0663","\u0AE9":"\u0969","\u2462":"\u2782",\u0498:"3\u0326","\u{1F104}":"3,","\u248A":"3.","\u33FE":"3l\u65E5","\u33FD":"3O\u65E5","\u33E2":"3\u65E5","\u32C2":"3\u6708","\u335B":"3\u70B9","\u{1D7D2}":"4","\u{1D7DC}":"4","\u{1D7E6}":"4","\u{1D7F0}":"4","\u{1D7FA}":"4","\u{1FBF4}":"4",\u13CE:"4","\u{118AF}":"4","\u06F4":"\u0664","\u0AEA":"\u096A","\u2463":"\u2783","\u{1F105}":"4,","\u248B":"4.",\u1530:"4\xB7","\u33E3":"4\u65E5","\u32C3":"4\u6708","\u335C":"4\u70B9","\u{1D7D3}":"5","\u{1D7DD}":"5","\u{1D7E7}":"5","\u{1D7F1}":"5","\u{1D7FB}":"5","\u{1FBF5}":"5",\u01BC:"5","\u{118BB}":"5","\u2464":"\u2784","\u{1F106}":"5,","\u248C":"5.","\u33E4":"5\u65E5","\u32C4":"5\u6708","\u335D":"5\u70B9","\u{1D7D4}":"6","\u{1D7DE}":"6","\u{1D7E8}":"6","\u{1D7F2}":"6","\u{1D7FC}":"6","\u{1FBF6}":"6","\u2CD2":"6",\u0431:"6",\u13EE:"6","\u{118D5}":"6","\u06F6":"\u0666","\u{114D6}":"\u09EC","\u2465":"\u2785","\u{1F107}":"6,","\u248D":"6.","\u33E5":"6\u65E5","\u32C5":"6\u6708","\u335E":"6\u70B9","\u{1D212}":"7","\u{1D7D5}":"7","\u{1D7DF}":"7","\u{1D7E9}":"7","\u{1D7F3}":"7","\u{1D7FD}":"7","\u{1FBF7}":"7","\u{104D2}":"7","\u{118C6}":"7","\u2466":"\u2786","\u{1F108}":"7,","\u248E":"7.","\u33E6":"7\u65E5","\u32C6":"7\u6708","\u335F":"7\u70B9","\u0B03":"8","\u09EA":"8","\u0A6A":"8","\u{1E8CB}":"8","\u{1D7D6}":"8","\u{1D7E0}":"8","\u{1D7EA}":"8","\u{1D7F4}":"8","\u{1D7FE}":"8","\u{1FBF8}":"8",\u0223:"8",\u0222:"8","\u{1031A}":"8","\u0AEE":"\u096E","\u2467":"\u2787","\u{1F109}":"8,","\u248F":"8.","\u33E7":"8\u65E5","\u32C7":"8\u6708","\u3360":"8\u70B9","\u0A67":"9","\u0B68":"9","\u09ED":"9","\u0D6D":"9","\u{1D7D7}":"9","\u{1D7E1}":"9","\u{1D7EB}":"9","\u{1D7F5}":"9","\u{1D7FF}":"9","\u{1FBF9}":"9","\uA76E":"9","\u2CCA":"9","\u{118CC}":"9","\u{118AC}":"9","\u{118D6}":"9","\u0967":"\u0669","\u{118E4}":"\u0669","\u06F9":"\u0669","\u0CEF":"\u0C6F","\u2468":"\u2788","\u{1F10A}":"9,","\u2490":"9.","\u33E8":"9\u65E5","\u32C8":"9\u6708","\u3361":"9\u70B9","\u237A":"a",\uFF41:"a","\u{1D41A}":"a","\u{1D44E}":"a","\u{1D482}":"a","\u{1D4B6}":"a","\u{1D4EA}":"a","\u{1D51E}":"a","\u{1D552}":"a","\u{1D586}":"a","\u{1D5BA}":"a","\u{1D5EE}":"a","\u{1D622}":"a","\u{1D656}":"a","\u{1D68A}":"a",\u0251:"a",\u03B1:"a","\u{1D6C2}":"a","\u{1D6FC}":"a","\u{1D736}":"a","\u{1D770}":"a","\u{1D7AA}":"a",\u0430:"a","\u2DF6":"\u0363",\uFF21:"A","\u{1D400}":"A","\u{1D434}":"A","\u{1D468}":"A","\u{1D49C}":"A","\u{1D4D0}":"A","\u{1D504}":"A","\u{1D538}":"A","\u{1D56C}":"A","\u{1D5A0}":"A","\u{1D5D4}":"A","\u{1D608}":"A","\u{1D63C}":"A","\u{1D670}":"A",\u0391:"A","\u{1D6A8}":"A","\u{1D6E2}":"A","\u{1D71C}":"A","\u{1D756}":"A","\u{1D790}":"A",\u0410:"A",\u13AA:"A",\u15C5:"A","\uA4EE":"A","\u{16F40}":"A","\u{102A0}":"A","\u2376":"a\u0332",\u01CE:"\u0103",\u01CD:"\u0102",\u0227:"\xE5",\u0226:"\xC5",\u1E9A:"\u1EA3","\u2100":"a/c","\u2101":"a/s","\uA733":"aa","\uA732":"AA",\u00E6:"ae",\u04D5:"ae",\u00C6:"AE",\u04D4:"AE","\uA735":"ao","\uA734":"AO","\u{1F707}":"AR","\uA737":"au","\uA736":"AU","\uA739":"av","\uA73B":"av","\uA738":"AV","\uA73A":"AV","\uA73D":"ay","\uA73C":"AY","\uAB7A":"\u1D00","\u2200":"\u2C6F","\u{1D217}":"\u2C6F",\u15C4:"\u2C6F","\uA4EF":"\u2C6F","\u{1041F}":"\u2C70","\u{1D41B}":"b","\u{1D44F}":"b","\u{1D483}":"b","\u{1D4B7}":"b","\u{1D4EB}":"b","\u{1D51F}":"b","\u{1D553}":"b","\u{1D587}":"b","\u{1D5BB}":"b","\u{1D5EF}":"b","\u{1D623}":"b","\u{1D657}":"b","\u{1D68B}":"b",\u0184:"b",\u042C:"b",\u13CF:"b",\u1472:"b",\u15AF:"b",\uFF22:"B",\u212C:"B","\u{1D401}":"B","\u{1D435}":"B","\u{1D469}":"B","\u{1D4D1}":"B","\u{1D505}":"B","\u{1D539}":"B","\u{1D56D}":"B","\u{1D5A1}":"B","\u{1D5D5}":"B","\u{1D609}":"B","\u{1D63D}":"B","\u{1D671}":"B","\uA7B4":"B",\u0392:"B","\u{1D6A9}":"B","\u{1D6E3}":"B","\u{1D71D}":"B","\u{1D757}":"B","\u{1D791}":"B",\u0412:"B",\u13F4:"B",\u15F7:"B","\uA4D0":"B","\u{10282}":"B","\u{102A1}":"B","\u{10301}":"B",\u0253:"b\u0314",\u1473:"b\u0307",\u0183:"b\u0304",\u0182:"b\u0304",\u0411:"b\u0304",\u0180:"b\u0335",\u048D:"b\u0335",\u048C:"b\u0335",\u0463:"b\u0335",\u0462:"b\u0335",\u147F:"b\xB7",\u1481:"b\u0307\xB7",\u1488:"b'",\u042B:"bl",\u0432:"\u0299","\u13FC":"\u0299",\uFF43:"c","\u217D":"c","\u{1D41C}":"c","\u{1D450}":"c","\u{1D484}":"c","\u{1D4B8}":"c","\u{1D4EC}":"c","\u{1D520}":"c","\u{1D554}":"c","\u{1D588}":"c","\u{1D5BC}":"c","\u{1D5F0}":"c","\u{1D624}":"c","\u{1D658}":"c","\u{1D68C}":"c","\u1D04":"c",\u03F2:"c","\u2CA5":"c",\u0441:"c","\uABAF":"c","\u{1043D}":"c","\u2DED":"\u0368","\u{1F74C}":"C","\u{118F2}":"C","\u{118E9}":"C",\uFF23:"C","\u216D":"C",\u2102:"C",\u212D:"C","\u{1D402}":"C","\u{1D436}":"C","\u{1D46A}":"C","\u{1D49E}":"C","\u{1D4D2}":"C","\u{1D56E}":"C","\u{1D5A2}":"C","\u{1D5D6}":"C","\u{1D60A}":"C","\u{1D63E}":"C","\u{1D672}":"C","\u03F9":"C","\u2CA4":"C",\u0421:"C",\u13DF:"C","\uA4DA":"C","\u{102A2}":"C","\u{10302}":"C","\u{10415}":"C","\u{1051C}":"C","\xA2":"c\u0338","\u023C":"c\u0338","\u20A1":"C\u20EB","\u{1F16E}":"C\u20E0",\u00E7:"c\u0326",\u04AB:"c\u0326",\u00C7:"C\u0326",\u04AA:"C\u0326",\u0187:"C'","\u2105":"c/o","\u2106":"c/u","\u{1F16D}":"\u33C4 \u20DD","\u22F4":"\uA793",\u025B:"\uA793",\u03B5:"\uA793","\u03F5":"\uA793","\u{1D6C6}":"\uA793","\u{1D6DC}":"\uA793","\u{1D700}":"\uA793","\u{1D716}":"\uA793","\u{1D73A}":"\uA793","\u{1D750}":"\uA793","\u{1D774}":"\uA793","\u{1D78A}":"\uA793","\u{1D7AE}":"\uA793","\u{1D7C4}":"\uA793","\u2C89":"\uA793",\u0454:"\uA793","\u0511":"\uA793","\uAB9B":"\uA793","\u{118CE}":"\uA793","\u{10429}":"\uA793","\u20AC":"\uA792","\u2C88":"\uA792",\u0404:"\uA792","\u2377":"\uA793\u0332","\u037D":"\uA73F","\u03FF":"\uA73E","\u217E":"d","\u2146":"d","\u{1D41D}":"d","\u{1D451}":"d","\u{1D485}":"d","\u{1D4B9}":"d","\u{1D4ED}":"d","\u{1D521}":"d","\u{1D555}":"d","\u{1D589}":"d","\u{1D5BD}":"d","\u{1D5F1}":"d","\u{1D625}":"d","\u{1D659}":"d","\u{1D68D}":"d","\u0501":"d",\u13E7:"d",\u146F:"d","\uA4D2":"d","\u216E":"D","\u2145":"D","\u{1D403}":"D","\u{1D437}":"D","\u{1D46B}":"D","\u{1D49F}":"D","\u{1D4D3}":"D","\u{1D507}":"D","\u{1D53B}":"D","\u{1D56F}":"D","\u{1D5A3}":"D","\u{1D5D7}":"D","\u{1D60B}":"D","\u{1D63F}":"D","\u{1D673}":"D",\u13A0:"D",\u15DE:"D",\u15EA:"D","\uA4D3":"D",\u0257:"d\u0314",\u0256:"d\u0328",\u018C:"d\u0304",\u0111:"d\u0335",\u0110:"D\u0335",\u00D0:"D\u0335",\u0189:"D\u0335","\u20AB":"d\u0335\u0331","\uA77A":"\uA779",\u147B:"d\xB7",\u1487:"d'",\u02A4:"d\u021D",\u01F3:"dz",\u02A3:"dz",\u01F2:"Dz",\u01F1:"DZ",\u01C6:"d\u017E",\u01C5:"D\u017E",\u01C4:"D\u017D",\u02A5:"d\u0291","\uAB70":"\u1D05","\u2E39":"\u1E9F",\u03B4:"\u1E9F","\u{1D6C5}":"\u1E9F","\u{1D6FF}":"\u1E9F","\u{1D739}":"\u1E9F","\u{1D773}":"\u1E9F","\u{1D7AD}":"\u1E9F",\u056E:"\u1E9F",\u1577:"\u1E9F","\u212E":"e",\uFF45:"e",\u212F:"e","\u2147":"e","\u{1D41E}":"e","\u{1D452}":"e","\u{1D486}":"e","\u{1D4EE}":"e","\u{1D522}":"e","\u{1D556}":"e","\u{1D58A}":"e","\u{1D5BE}":"e","\u{1D5F2}":"e","\u{1D626}":"e","\u{1D65A}":"e","\u{1D68E}":"e","\uAB32":"e",\u0435:"e",\u04BD:"e","\u2DF7":"\u0364","\u22FF":"E",\uFF25:"E",\u2130:"E","\u{1D404}":"E","\u{1D438}":"E","\u{1D46C}":"E","\u{1D4D4}":"E","\u{1D508}":"E","\u{1D53C}":"E","\u{1D570}":"E","\u{1D5A4}":"E","\u{1D5D8}":"E","\u{1D60C}":"E","\u{1D640}":"E","\u{1D674}":"E",\u0395:"E","\u{1D6AC}":"E","\u{1D6E6}":"E","\u{1D720}":"E","\u{1D75A}":"E","\u{1D794}":"E",\u0415:"E","\u2D39":"E",\u13AC:"E","\uA4F0":"E","\u{118A6}":"E","\u{118AE}":"E","\u{10286}":"E",\u011B:"\u0115",\u011A:"\u0114","\u0247":"e\u0338","\u0246":"E\u0338",\u04BF:"e\u0328","\uAB7C":"\u1D07",\u0259:"\u01DD",\u04D9:"\u01DD","\u2203":"\u018E","\u2D3A":"\u018E","\uA4F1":"\u018E",\u025A:"\u01DD\u02DE","\u1D14":"\u01DDo","\uAB41":"\u01DDo\u0338","\uAB42":"\u01DDo\u0335",\u04D8:"\u018F","\u{1D221}":"\u0190",\u2107:"\u0190","\u0510":"\u0190",\u13CB:"\u0190","\u{16F2D}":"\u0190","\u{10401}":"\u0190","\u1D9F":"\u1D4B","\u1D08":"\u025C",\u0437:"\u025C",\u0499:"\u025C\u0326","\u{10442}":"\u025E","\uA79D":"\u029A","\u{1042A}":"\u029A","\u{1D41F}":"f","\u{1D453}":"f","\u{1D487}":"f","\u{1D4BB}":"f","\u{1D4EF}":"f","\u{1D523}":"f","\u{1D557}":"f","\u{1D58B}":"f","\u{1D5BF}":"f","\u{1D5F3}":"f","\u{1D627}":"f","\u{1D65B}":"f","\u{1D68F}":"f","\uAB35":"f","\uA799":"f",\u017F:"f","\u1E9D":"f",\u0584:"f","\u{1D213}":"F",\u2131:"F","\u{1D405}":"F","\u{1D439}":"F","\u{1D46D}":"F","\u{1D4D5}":"F","\u{1D509}":"F","\u{1D53D}":"F","\u{1D571}":"F","\u{1D5A5}":"F","\u{1D5D9}":"F","\u{1D60D}":"F","\u{1D641}":"F","\u{1D675}":"F","\uA798":"F",\u03DC:"F","\u{1D7CA}":"F",\u15B4:"F","\uA4DD":"F","\u{118C2}":"F","\u{118A2}":"F","\u{10287}":"F","\u{102A5}":"F","\u{10525}":"F",\u0192:"f\u0326",\u0191:"F\u0326","\u1D6E":"f\u0334","\u213B":"FAX",\uFB00:"ff",\uFB03:"ffi",\uFB04:"ffl",\uFB01:"fi",\uFB02:"fl",\u02A9:"f\u014B",\u15B5:"\u2132","\uA4DE":"\u2132","\u{1D230}":"\uA7FB",\u15B7:"\uA7FB",\uFF47:"g",\u210A:"g","\u{1D420}":"g","\u{1D454}":"g","\u{1D488}":"g","\u{1D4F0}":"g","\u{1D524}":"g","\u{1D558}":"g","\u{1D58C}":"g","\u{1D5C0}":"g","\u{1D5F4}":"g","\u{1D628}":"g","\u{1D65C}":"g","\u{1D690}":"g",\u0261:"g","\u1D83":"g",\u018D:"g",\u0581:"g","\u{1D406}":"G","\u{1D43A}":"G","\u{1D46E}":"G","\u{1D4A2}":"G","\u{1D4D6}":"G","\u{1D50A}":"G","\u{1D53E}":"G","\u{1D572}":"G","\u{1D5A6}":"G","\u{1D5DA}":"G","\u{1D60E}":"G","\u{1D642}":"G","\u{1D676}":"G","\u050C":"G",\u13C0:"G",\u13F3:"G","\uA4D6":"G","\u1DA2":"\u1D4D",\u0260:"g\u0314",\u01E7:"\u011F",\u01E6:"\u011E",\u01F5:"\u0123",\u01E5:"g\u0335",\u01E4:"G\u0335",\u0193:"G'","\u050D":"\u0262","\uAB90":"\u0262","\u13FB":"\u0262",\uFF48:"h",\u210E:"h","\u{1D421}":"h","\u{1D489}":"h","\u{1D4BD}":"h","\u{1D4F1}":"h","\u{1D525}":"h","\u{1D559}":"h","\u{1D58D}":"h","\u{1D5C1}":"h","\u{1D5F5}":"h","\u{1D629}":"h","\u{1D65D}":"h","\u{1D691}":"h",\u04BB:"h",\u0570:"h",\u13C2:"h",\uFF28:"H",\u210B:"H",\u210C:"H",\u210D:"H","\u{1D407}":"H","\u{1D43B}":"H","\u{1D46F}":"H","\u{1D4D7}":"H","\u{1D573}":"H","\u{1D5A7}":"H","\u{1D5DB}":"H","\u{1D60F}":"H","\u{1D643}":"H","\u{1D677}":"H",\u0397:"H","\u{1D6AE}":"H","\u{1D6E8}":"H","\u{1D722}":"H","\u{1D75C}":"H","\u{1D796}":"H","\u2C8E":"H",\u041D:"H",\u13BB:"H",\u157C:"H","\uA4E7":"H","\u{102CF}":"H","\u1D78":"\u1D34",\u0266:"h\u0314","\uA695":"h\u0314",\u13F2:"h\u0314","\u2C67":"H\u0329",\u04A2:"H\u0329",\u0127:"h\u0335",\u210F:"h\u0335",\u045B:"h\u0335",\u0126:"H\u0335","\u04C9":"H\u0326",\u04C7:"H\u0326",\u043D:"\u029C","\uAB8B":"\u029C",\u04A3:"\u029C\u0329","\u04CA":"\u029C\u0326",\u04C8:"\u029C\u0326","\u050A":"\u01F6","\uAB80":"\u2C76","\u0370":"\u2C75",\u13A8:"\u2C75",\u13B0:"\u2C75","\uA6B1":"\u2C75","\uA795":"\uA727","\u02DB":"i","\u2373":"i",\uFF49:"i","\u2170":"i",\u2139:"i","\u2148":"i","\u{1D422}":"i","\u{1D456}":"i","\u{1D48A}":"i","\u{1D4BE}":"i","\u{1D4F2}":"i","\u{1D526}":"i","\u{1D55A}":"i","\u{1D58E}":"i","\u{1D5C2}":"i","\u{1D5F6}":"i","\u{1D62A}":"i","\u{1D65E}":"i","\u{1D692}":"i",\u0131:"i","\u{1D6A4}":"i",\u026A:"i",\u0269:"i",\u03B9:"i",\u1FBE:"i",\u037A:"i","\u{1D6CA}":"i","\u{1D704}":"i","\u{1D73E}":"i","\u{1D778}":"i","\u{1D7B2}":"i",\u0456:"i","\uA647":"i","\u04CF":"i","\uAB75":"i",\u13A5:"i","\u{118C3}":"i","\u24DB":"\u24BE","\u2378":"i\u0332",\u01D0:"\u012D",\u01CF:"\u012C",\u0268:"i\u0335","\u1D7B":"i\u0335","\u1D7C":"i\u0335","\u2171":"ii","\u2172":"iii",\u0133:"ij","\u2173":"iv","\u2178":"ix",\uFF4A:"j","\u2149":"j","\u{1D423}":"j","\u{1D457}":"j","\u{1D48B}":"j","\u{1D4BF}":"j","\u{1D4F3}":"j","\u{1D527}":"j","\u{1D55B}":"j","\u{1D58F}":"j","\u{1D5C3}":"j","\u{1D5F7}":"j","\u{1D62B}":"j","\u{1D65F}":"j","\u{1D693}":"j",\u03F3:"j",\u0458:"j",\uFF2A:"J","\u{1D409}":"J","\u{1D43D}":"J","\u{1D471}":"J","\u{1D4A5}":"J","\u{1D4D9}":"J","\u{1D50D}":"J","\u{1D541}":"J","\u{1D575}":"J","\u{1D5A9}":"J","\u{1D5DD}":"J","\u{1D611}":"J","\u{1D645}":"J","\u{1D679}":"J","\uA7B2":"J","\u037F":"J",\u0408:"J",\u13AB:"J",\u148D:"J","\uA4D9":"J","\u0249":"j\u0335","\u0248":"J\u0335",\u1499:"J\xB7","\u{1D6A5}":"\u0237",\u0575:"\u0237","\uAB7B":"\u1D0A","\u{1D424}":"k","\u{1D458}":"k","\u{1D48C}":"k","\u{1D4C0}":"k","\u{1D4F4}":"k","\u{1D528}":"k","\u{1D55C}":"k","\u{1D590}":"k","\u{1D5C4}":"k","\u{1D5F8}":"k","\u{1D62C}":"k","\u{1D660}":"k","\u{1D694}":"k",\u212A:"K",\uFF2B:"K","\u{1D40A}":"K","\u{1D43E}":"K","\u{1D472}":"K","\u{1D4A6}":"K","\u{1D4DA}":"K","\u{1D50E}":"K","\u{1D542}":"K","\u{1D576}":"K","\u{1D5AA}":"K","\u{1D5DE}":"K","\u{1D612}":"K","\u{1D646}":"K","\u{1D67A}":"K",\u039A:"K","\u{1D6B1}":"K","\u{1D6EB}":"K","\u{1D725}":"K","\u{1D75F}":"K","\u{1D799}":"K","\u2C94":"K",\u041A:"K",\u13E6:"K",\u16D5:"K","\uA4D7":"K","\u{10518}":"K",\u0199:"k\u0314","\u2C69":"K\u0329",\u049A:"K\u0329","\u20AD":"K\u0335","\uA740":"K\u0335",\u049E:"K\u0335",\u0198:"K'","\u05C0":"l","|":"l","\u2223":"l","\u23FD":"l","\uFFE8":"l","\u0661":"l","\u06F1":"l","\u{10320}":"l","\u{1E8C7}":"l","\u{1D7CF}":"l","\u{1D7D9}":"l","\u{1D7E3}":"l","\u{1D7ED}":"l","\u{1D7F7}":"l","\u{1FBF1}":"l",I:Qb,\uFF29:"l","\u2160":"l",\u2110:"l",\u2111:"l","\u{1D408}":"l","\u{1D43C}":"l","\u{1D470}":"l","\u{1D4D8}":"l","\u{1D540}":"l","\u{1D574}":"l","\u{1D5A8}":"l","\u{1D5DC}":"l","\u{1D610}":"l","\u{1D644}":"l","\u{1D678}":"l",\u0196:"l",\uFF4C:"l","\u217C":"l",\u2113:"l","\u{1D425}":"l","\u{1D459}":"l","\u{1D48D}":"l","\u{1D4C1}":"l","\u{1D4F5}":"l","\u{1D529}":"l","\u{1D55D}":"l","\u{1D591}":"l","\u{1D5C5}":"l","\u{1D5F9}":"l","\u{1D62D}":"l","\u{1D661}":"l","\u{1D695}":"l",\u01C0:"l",\u0399:"l","\u{1D6B0}":"l","\u{1D6EA}":"l","\u{1D724}":"l","\u{1D75E}":"l","\u{1D798}":"l","\u2C92":"l",\u0406:"l",\u04C0:"l",\u05D5:"l",\u05DF:"l",\u0627:"l","\u{1EE00}":"l","\u{1EE80}":"l",\uFE8E:"l",\uFE8D:"l","\u07CA":"l","\u2D4F":"l",\u16C1:"l","\uA4F2":"l","\u{16F28}":"l","\u{1028A}":"l","\u{10309}":"l","\u{1D22A}":"L","\u216C":"L",\u2112:"L","\u{1D40B}":"L","\u{1D43F}":"L","\u{1D473}":"L","\u{1D4DB}":"L","\u{1D50F}":"L","\u{1D543}":"L","\u{1D577}":"L","\u{1D5AB}":"L","\u{1D5DF}":"L","\u{1D613}":"L","\u{1D647}":"L","\u{1D67B}":"L","\u2CD0":"L",\u13DE:"L",\u14AA:"L","\uA4E1":"L","\u{16F16}":"L","\u{118A3}":"L","\u{118B2}":"L","\u{1041B}":"L","\u{10526}":"L",\uFD3C:"l\u030B",\uFD3D:"l\u030B",\u0142:"l\u0338",\u0141:"L\u0338",\u026D:"l\u0328",\u0197:"l\u0335",\u019A:"l\u0335",\u026B:"l\u0334",\u0625:"l\u0655",\uFE88:"l\u0655",\uFE87:"l\u0655",\u0673:"l\u0655",\u0140:"l\xB7",\u013F:"l\xB7",\u14B7:"l\xB7","\u{1F102}":"l,","\u2488":"l.",\u05F1:"l'","\u2493":"l2.","\u33EB":"l2\u65E5","\u32CB":"l2\u6708","\u3364":"l2\u70B9","\u2494":"l3.","\u33EC":"l3\u65E5","\u3365":"l3\u70B9","\u2495":"l4.","\u33ED":"l4\u65E5","\u3366":"l4\u70B9","\u2496":"l5.","\u33EE":"l5\u65E5","\u3367":"l5\u70B9","\u2497":"l6.","\u33EF":"l6\u65E5","\u3368":"l6\u70B9","\u2498":"l7.","\u33F0":"l7\u65E5","\u3369":"l7\u70B9","\u2499":"l8.","\u33F1":"l8\u65E5","\u336A":"l8\u70B9","\u249A":"l9.","\u33F2":"l9\u65E5","\u336B":"l9\u70B9",\u01C9:"lj",\u0132:"lJ",\u01C8:"Lj",\u01C7:"LJ","\u2016":"ll","\u2225":"ll","\u2161":"ll",\u01C1:"ll",\u05F0:"ll","\u{10199}":"l\u0335l\u0335","\u2492":"ll.","\u2162":"lll","\u{10198}":"l\u0335l\u0335S\u0335","\u33EA":"ll\u65E5","\u32CA":"ll\u6708","\u3363":"ll\u70B9",\u042E:"lO","\u2491":"lO.","\u33E9":"lO\u65E5","\u32C9":"lO\u6708","\u3362":"lO\u70B9",\u02AA:"ls","\u20B6":"lt","\u2163":"lV","\u2168":"lX",\u026E:"l\u021D",\u02AB:"lz",\u0623:"l\u0674",\uFE84:"l\u0674",\uFE83:"l\u0674",\u0672:"l\u0674",\u0675:"l\u0674",\uFDF3:"l\u0643\u0628\u0631",\uFDF2:"l\u0644\u0644\u0651\u0670o","\u33E0":"l\u65E5","\u32C0":"l\u6708","\u3359":"l\u70B9","\u2CD1":"\u029F","\uABAE":"\u029F","\u{10443}":"\u029F",\uFF2D:"M","\u216F":"M",\u2133:"M","\u{1D40C}":"M","\u{1D440}":"M","\u{1D474}":"M","\u{1D4DC}":"M","\u{1D510}":"M","\u{1D544}":"M","\u{1D578}":"M","\u{1D5AC}":"M","\u{1D5E0}":"M","\u{1D614}":"M","\u{1D648}":"M","\u{1D67C}":"M",\u039C:"M","\u{1D6B3}":"M","\u{1D6ED}":"M","\u{1D727}":"M","\u{1D761}":"M","\u{1D79B}":"M","\u03FA":"M","\u2C98":"M",\u041C:"M",\u13B7:"M",\u15F0:"M",\u16D6:"M","\uA4DF":"M","\u{102B0}":"M","\u{10311}":"M","\u04CD":"M\u0326","\u{1F76B}":"MB","\u2DE8":"\u1DDF","\u{1D427}":"n","\u{1D45B}":"n","\u{1D48F}":"n","\u{1D4C3}":"n","\u{1D4F7}":"n","\u{1D52B}":"n","\u{1D55F}":"n","\u{1D593}":"n","\u{1D5C7}":"n","\u{1D5FB}":"n","\u{1D62F}":"n","\u{1D663}":"n","\u{1D697}":"n",\u0578:"n",\u057C:"n",\uFF2E:"N",\u2115:"N","\u{1D40D}":"N","\u{1D441}":"N","\u{1D475}":"N","\u{1D4A9}":"N","\u{1D4DD}":"N","\u{1D511}":"N","\u{1D579}":"N","\u{1D5AD}":"N","\u{1D5E1}":"N","\u{1D615}":"N","\u{1D649}":"N","\u{1D67D}":"N",\u039D:"N","\u{1D6B4}":"N","\u{1D6EE}":"N","\u{1D728}":"N","\u{1D762}":"N","\u{1D79C}":"N","\u2C9A":"N","\uA4E0":"N","\u{10513}":"N","\u{1018E}":"N\u030A",\u0273:"n\u0328",\u019E:"n\u0329",\u03B7:"n\u0329","\u{1D6C8}":"n\u0329","\u{1D702}":"n\u0329","\u{1D73C}":"n\u0329","\u{1D776}":"n\u0329","\u{1D7B0}":"n\u0329",\u019D:"N\u0326","\u1D70":"n\u0334",\u01CC:"nj",\u01CB:"Nj",\u01CA:"NJ","\u2116":"No","\u0377":"\u1D0E",\u0438:"\u1D0E","\u{1044D}":"\u1D0E",\u0146:"\u0272","\u0C02":"o","\u0C82":"o","\u0D02":"o","\u0D82":"o","\u0966":"o","\u0A66":"o","\u0AE6":"o","\u0BE6":"o","\u0C66":"o","\u0CE6":"o","\u0D66":"o","\u0E50":"o","\u0ED0":"o","\u1040":"o","\u0665":"o","\u06F5":"o",\uFF4F:"o",\u2134:"o","\u{1D428}":"o","\u{1D45C}":"o","\u{1D490}":"o","\u{1D4F8}":"o","\u{1D52C}":"o","\u{1D560}":"o","\u{1D594}":"o","\u{1D5C8}":"o","\u{1D5FC}":"o","\u{1D630}":"o","\u{1D664}":"o","\u{1D698}":"o","\u1D0F":"o","\u1D11":"o","\uAB3D":"o",\u03BF:"o","\u{1D6D0}":"o","\u{1D70A}":"o","\u{1D744}":"o","\u{1D77E}":"o","\u{1D7B8}":"o",\u03C3:"o","\u{1D6D4}":"o","\u{1D70E}":"o","\u{1D748}":"o","\u{1D782}":"o","\u{1D7BC}":"o","\u2C9F":"o",\u043E:"o","\u10FF":"o",\u0585:"o",\u05E1:"o",\u0647:"o","\u{1EE24}":"o","\u{1EE64}":"o","\u{1EE84}":"o",\uFEEB:"o",\uFEEC:"o",\uFEEA:"o",\uFEE9:"o",\u06BE:"o",\uFBAC:"o",\uFBAD:"o",\uFBAB:"o",\uFBAA:"o",\u06C1:"o",\uFBA8:"o",\uFBA9:"o",\uFBA7:"o",\uFBA6:"o",\u06D5:"o",\u0D20:"o",\u101D:"o","\u{104EA}":"o","\u{118C8}":"o","\u{118D7}":"o","\u{1042C}":"o","\u07C0":"O","\u09E6":"O","\u0B66":"O","\u3007":"O","\u{114D0}":"O","\u{118E0}":"O","\u{1D7CE}":"O","\u{1D7D8}":"O","\u{1D7E2}":"O","\u{1D7EC}":"O","\u{1D7F6}":"O","\u{1FBF0}":"O",\uFF2F:"O","\u{1D40E}":"O","\u{1D442}":"O","\u{1D476}":"O","\u{1D4AA}":"O","\u{1D4DE}":"O","\u{1D512}":"O","\u{1D546}":"O","\u{1D57A}":"O","\u{1D5AE}":"O","\u{1D5E2}":"O","\u{1D616}":"O","\u{1D64A}":"O","\u{1D67E}":"O",\u039F:"O","\u{1D6B6}":"O","\u{1D6F0}":"O","\u{1D72A}":"O","\u{1D764}":"O","\u{1D79E}":"O","\u2C9E":"O",\u041E:"O",\u0555:"O","\u2D54":"O",\u12D0:"O",\u0B20:"O","\u{104C2}":"O","\uA4F3":"O","\u{118B5}":"O","\u{10292}":"O","\u{102AB}":"O","\u{10404}":"O","\u{10516}":"O","\u2070":"\xBA","\u1D52":"\xBA",\u01D2:"\u014F",\u01D1:"\u014E","\u06FF":"o\u0302",\u0150:"\xD6",\u00F8:"o\u0338","\uAB3E":"o\u0338",\u00D8:"O\u0338","\u2D41":"O\u0338",\u01FE:"O\u0338\u0301",\u0275:"o\u0335","\uA74B":"o\u0335",\u04E9:"o\u0335",\u0473:"o\u0335","\uAB8E":"o\u0335","\uABBB":"o\u0335","\u2296":"O\u0335","\u229D":"O\u0335","\u236C":"O\u0335","\u{1D21A}":"O\u0335","\u{1F714}":"O\u0335",\u019F:"O\u0335","\uA74A":"O\u0335",\u03B8:"O\u0335",\u03D1:"O\u0335","\u{1D6C9}":"O\u0335","\u{1D6DD}":"O\u0335","\u{1D703}":"O\u0335","\u{1D717}":"O\u0335","\u{1D73D}":"O\u0335","\u{1D751}":"O\u0335","\u{1D777}":"O\u0335","\u{1D78B}":"O\u0335","\u{1D7B1}":"O\u0335","\u{1D7C5}":"O\u0335",\u0398:"O\u0335","\u03F4":"O\u0335","\u{1D6AF}":"O\u0335","\u{1D6B9}":"O\u0335","\u{1D6E9}":"O\u0335","\u{1D6F3}":"O\u0335","\u{1D723}":"O\u0335","\u{1D72D}":"O\u0335","\u{1D75D}":"O\u0335","\u{1D767}":"O\u0335","\u{1D797}":"O\u0335","\u{1D7A1}":"O\u0335",\u04E8:"O\u0335",\u0472:"O\u0335","\u2D31":"O\u0335",\u13BE:"O\u0335",\u13EB:"O\u0335","\uAB74":"o\u031B",\uFCD9:"o\u0670","\u{1F101}":"O,","\u{1F100}":"O.",\u01A1:"o'",\u01A0:"O'",\u13A4:"O'","%":"\xBA/\u2080","\u066A":"\xBA/\u2080","\u2052":"\xBA/\u2080","\u2030":"\xBA/\u2080\u2080","\u0609":"\xBA/\u2080\u2080","\u2031":"\xBA/\u2080\u2080\u2080","\u060A":"\xBA/\u2080\u2080\u2080",\u0153:"oe",\u0152:"OE",\u0276:"o\u1D07","\u221E":"oo","\uA74F":"oo","\uA699":"oo","\uA74E":"OO","\uA698":"OO",\uFCD7:"o\u062C",\uFC51:"o\u062C",\uFCD8:"o\u0645",\uFC52:"o\u0645",\uFD93:"o\u0645\u062C",\uFD94:"o\u0645\u0645",\uFC53:"o\u0649",\uFC54:"o\u0649","\u0D5F":"o\u0D30o",\u1010:"o\u102C","\u3358":"O\u70B9","\u2184":"\u0254","\u1D10":"\u0254","\u037B":"\u0254","\u{1044B}":"\u0254","\u2183":"\u0186","\u03FD":"\u0186","\uA4DB":"\u0186","\u{10423}":"\u0186","\uAB3F":"\u0254\u0338","\uAB62":"\u0254e","\u{1043F}":"\u0277","\u2374":"p",\uFF50:"p","\u{1D429}":"p","\u{1D45D}":"p","\u{1D491}":"p","\u{1D4C5}":"p","\u{1D4F9}":"p","\u{1D52D}":"p","\u{1D561}":"p","\u{1D595}":"p","\u{1D5C9}":"p","\u{1D5FD}":"p","\u{1D631}":"p","\u{1D665}":"p","\u{1D699}":"p",\u03C1:"p",\u03F1:"p","\u{1D6D2}":"p","\u{1D6E0}":"p","\u{1D70C}":"p","\u{1D71A}":"p","\u{1D746}":"p","\u{1D754}":"p","\u{1D780}":"p","\u{1D78E}":"p","\u{1D7BA}":"p","\u{1D7C8}":"p","\u2CA3":"p",\u0440:"p",\uFF30:"P",\u2119:"P","\u{1D40F}":"P","\u{1D443}":"P","\u{1D477}":"P","\u{1D4AB}":"P","\u{1D4DF}":"P","\u{1D513}":"P","\u{1D57B}":"P","\u{1D5AF}":"P","\u{1D5E3}":"P","\u{1D617}":"P","\u{1D64B}":"P","\u{1D67F}":"P",\u03A1:"P","\u{1D6B8}":"P","\u{1D6F2}":"P","\u{1D72C}":"P","\u{1D766}":"P","\u{1D7A0}":"P","\u2CA2":"P",\u0420:"P",\u13E2:"P",\u146D:"P","\uA4D1":"P","\u{10295}":"P",\u01A5:"p\u0314","\u1D7D":"p\u0335",\u1477:"p\xB7",\u1486:"P'","\u1D29":"\u1D18","\uABB2":"\u1D18",\u03C6:"\u0278",\u03D5:"\u0278","\u{1D6D7}":"\u0278","\u{1D6DF}":"\u0278","\u{1D711}":"\u0278","\u{1D719}":"\u0278","\u{1D74B}":"\u0278","\u{1D753}":"\u0278","\u{1D785}":"\u0278","\u{1D78D}":"\u0278","\u{1D7BF}":"\u0278","\u{1D7C7}":"\u0278","\u2CAB":"\u0278",\u0444:"\u0278","\u{1D42A}":"q","\u{1D45E}":"q","\u{1D492}":"q","\u{1D4C6}":"q","\u{1D4FA}":"q","\u{1D52E}":"q","\u{1D562}":"q","\u{1D596}":"q","\u{1D5CA}":"q","\u{1D5FE}":"q","\u{1D632}":"q","\u{1D666}":"q","\u{1D69A}":"q","\u051B":"q",\u0563:"q",\u0566:"q",\u211A:"Q","\u{1D410}":"Q","\u{1D444}":"Q","\u{1D478}":"Q","\u{1D4AC}":"Q","\u{1D4E0}":"Q","\u{1D514}":"Q","\u{1D57C}":"Q","\u{1D5B0}":"Q","\u{1D5E4}":"Q","\u{1D618}":"Q","\u{1D64C}":"Q","\u{1D680}":"Q","\u2D55":"Q",\u02A0:"q\u0314","\u{1F700}":"QE","\u1D90":"\u024B","\u1D0B":"\u0138",\u03BA:"\u0138",\u03F0:"\u0138","\u{1D6CB}":"\u0138","\u{1D6DE}":"\u0138","\u{1D705}":"\u0138","\u{1D718}":"\u0138","\u{1D73F}":"\u0138","\u{1D752}":"\u0138","\u{1D779}":"\u0138","\u{1D78C}":"\u0138","\u{1D7B3}":"\u0138","\u{1D7C6}":"\u0138","\u2C95":"\u0138",\u043A:"\u0138","\uABB6":"\u0138",\u049B:"\u0138\u0329",\u049F:"\u0138\u0335","\u{1D42B}":"r","\u{1D45F}":"r","\u{1D493}":"r","\u{1D4C7}":"r","\u{1D4FB}":"r","\u{1D52F}":"r","\u{1D563}":"r","\u{1D597}":"r","\u{1D5CB}":"r","\u{1D5FF}":"r","\u{1D633}":"r","\u{1D667}":"r","\u{1D69B}":"r","\uAB47":"r","\uAB48":"r","\u1D26":"r","\u2C85":"r",\u0433:"r","\uAB81":"r","\u{1D216}":"R",\u211B:"R",\u211C:"R",\u211D:"R","\u{1D411}":"R","\u{1D445}":"R","\u{1D479}":"R","\u{1D4E1}":"R","\u{1D57D}":"R","\u{1D5B1}":"R","\u{1D5E5}":"R","\u{1D619}":"R","\u{1D64D}":"R","\u{1D681}":"R",\u01A6:"R",\u13A1:"R",\u13D2:"R","\u{104B4}":"R",\u1587:"R","\uA4E3":"R","\u{16F35}":"R",\u027D:"r\u0328",\u027C:"r\u0329","\u024D":"r\u0335",\u0493:"r\u0335","\u1D72":"r\u0334",\u0491:"r'","\u{118E3}":"rn",m:Zb,"\u217F":"rn","\u{1D426}":"rn","\u{1D45A}":"rn","\u{1D48E}":"rn","\u{1D4C2}":"rn","\u{1D4F6}":"rn","\u{1D52A}":"rn","\u{1D55E}":"rn","\u{1D592}":"rn","\u{1D5C6}":"rn","\u{1D5FA}":"rn","\u{1D62E}":"rn","\u{1D662}":"rn","\u{1D696}":"rn","\u{11700}":"rn","\u20A5":"rn\u0338",\u0271:"rn\u0326","\u1D6F":"rn\u0334","\u20A8":"Rs","\uAB71":"\u0280","\uABA2":"\u0280",\u044F:"\u1D19","\u1D73":"\u027E\u0334","\u2129":"\u027F",\uFF53:"s","\u{1D42C}":"s","\u{1D460}":"s","\u{1D494}":"s","\u{1D4C8}":"s","\u{1D4FC}":"s","\u{1D530}":"s","\u{1D564}":"s","\u{1D598}":"s","\u{1D5CC}":"s","\u{1D600}":"s","\u{1D634}":"s","\u{1D668}":"s","\u{1D69C}":"s","\uA731":"s",\u01BD:"s",\u0455:"s","\uABAA":"s","\u{118C1}":"s","\u{10448}":"s",\uFF33:"S","\u{1D412}":"S","\u{1D446}":"S","\u{1D47A}":"S","\u{1D4AE}":"S","\u{1D4E2}":"S","\u{1D516}":"S","\u{1D54A}":"S","\u{1D57E}":"S","\u{1D5B2}":"S","\u{1D5E6}":"S","\u{1D61A}":"S","\u{1D64E}":"S","\u{1D682}":"S",\u0405:"S",\u054F:"S",\u13D5:"S",\u13DA:"S","\uA4E2":"S","\u{16F3A}":"S","\u{10296}":"S","\u{10420}":"S",\u0282:"s\u0328","\u1D74":"s\u0334","\uA7B5":"\xDF",\u03B2:"\xDF",\u03D0:"\xDF","\u{1D6C3}":"\xDF","\u{1D6FD}":"\xDF","\u{1D737}":"\xDF","\u{1D771}":"\xDF","\u{1D7AB}":"\xDF",\u13F0:"\xDF","\u{1F75C}":"sss",\uFB06:"st","\u222B":"\u0283","\uAB4D":"\u0283","\u2211":"\u01A9","\u2140":"\u01A9",\u03A3:"\u01A9","\u{1D6BA}":"\u01A9","\u{1D6F4}":"\u01A9","\u{1D72E}":"\u01A9","\u{1D768}":"\u01A9","\u{1D7A2}":"\u01A9","\u2D49":"\u01A9","\u222C":"\u0283\u0283","\u222D":"\u0283\u0283\u0283","\u2A0C":"\u0283\u0283\u0283\u0283","\u{1D42D}":"t","\u{1D461}":"t","\u{1D495}":"t","\u{1D4C9}":"t","\u{1D4FD}":"t","\u{1D531}":"t","\u{1D565}":"t","\u{1D599}":"t","\u{1D5CD}":"t","\u{1D601}":"t","\u{1D635}":"t","\u{1D669}":"t","\u{1D69D}":"t","\u22A4":"T","\u27D9":"T","\u{1F768}":"T",\uFF34:"T","\u{1D413}":"T","\u{1D447}":"T","\u{1D47B}":"T","\u{1D4AF}":"T","\u{1D4E3}":"T","\u{1D517}":"T","\u{1D54B}":"T","\u{1D57F}":"T","\u{1D5B3}":"T","\u{1D5E7}":"T","\u{1D61B}":"T","\u{1D64F}":"T","\u{1D683}":"T",\u03A4:"T","\u{1D6BB}":"T","\u{1D6F5}":"T","\u{1D72F}":"T","\u{1D769}":"T","\u{1D7A3}":"T","\u2CA6":"T",\u0422:"T",\u13A2:"T","\uA4D4":"T","\u{16F0A}":"T","\u{118BC}":"T","\u{10297}":"T","\u{102B1}":"T","\u{10315}":"T",\u01AD:"t\u0314","\u2361":"T\u0308","\u023E":"T\u0338",\u021A:"\u0162",\u01AE:"T\u0328",\u04AC:"T\u0329","\u20AE":"T\u20EB",\u0167:"t\u0335",\u0166:"T\u0335","\u1D75":"t\u0334",\u10A0:"\uA786","\uA728":"T3",\u02A8:"t\u0255","\u2121":"TEL","\uA777":"tf",\u02A6:"ts",\u02A7:"t\u0283","\uA729":"t\u021D",\u03C4:"\u1D1B","\u{1D6D5}":"\u1D1B","\u{1D70F}":"\u1D1B","\u{1D749}":"\u1D1B","\u{1D783}":"\u1D1B","\u{1D7BD}":"\u1D1B",\u0442:"\u1D1B","\uAB72":"\u1D1B",\u04AD:"\u1D1B\u0329",\u0163:"\u01AB",\u021B:"\u01AB",\u13BF:"\u01AB","\u{1D42E}":"u","\u{1D462}":"u","\u{1D496}":"u","\u{1D4CA}":"u","\u{1D4FE}":"u","\u{1D532}":"u","\u{1D566}":"u","\u{1D59A}":"u","\u{1D5CE}":"u","\u{1D602}":"u","\u{1D636}":"u","\u{1D66A}":"u","\u{1D69E}":"u","\uA79F":"u","\u1D1C":"u","\uAB4E":"u","\uAB52":"u",\u028B:"u",\u03C5:"u","\u{1D6D6}":"u","\u{1D710}":"u","\u{1D74A}":"u","\u{1D784}":"u","\u{1D7BE}":"u",\u057D:"u","\u{104F6}":"u","\u{118D8}":"u","\u222A":"U","\u22C3":"U","\u{1D414}":"U","\u{1D448}":"U","\u{1D47C}":"U","\u{1D4B0}":"U","\u{1D4E4}":"U","\u{1D518}":"U","\u{1D54C}":"U","\u{1D580}":"U","\u{1D5B4}":"U","\u{1D5E8}":"U","\u{1D61C}":"U","\u{1D650}":"U","\u{1D684}":"U",\u054D:"U",\u1200:"U","\u{104CE}":"U",\u144C:"U","\uA4F4":"U","\u{16F42}":"U","\u{118B8}":"U",\u01D4:"\u016D",\u01D3:"\u016C","\u1D7E":"u\u0335","\uAB9C":"u\u0335","\u0244":"U\u0335",\u13CC:"U\u0335",\u1458:"U\xB7",\u1467:"U'","\u1D6B":"ue","\uAB63":"uo",\u1E43:"\uAB51",\u057A:"\u0270",\u1223:"\u0270","\u2127":"\u01B1",\u162E:"\u01B1",\u1634:"\u01B1","\u1D7F":"\u028A\u0335","\u2228":"v","\u22C1":"v",\uFF56:"v","\u2174":"v","\u{1D42F}":"v","\u{1D463}":"v","\u{1D497}":"v","\u{1D4CB}":"v","\u{1D4FF}":"v","\u{1D533}":"v","\u{1D567}":"v","\u{1D59B}":"v","\u{1D5CF}":"v","\u{1D603}":"v","\u{1D637}":"v","\u{1D66B}":"v","\u{1D69F}":"v","\u1D20":"v",\u03BD:"v","\u{1D6CE}":"v","\u{1D708}":"v","\u{1D742}":"v","\u{1D77C}":"v","\u{1D7B6}":"v",\u0475:"v",\u05D8:"v","\u{11706}":"v","\uABA9":"v","\u{118C0}":"v","\u{1D20D}":"V","\u0667":"V","\u06F7":"V","\u2164":"V","\u{1D415}":"V","\u{1D449}":"V","\u{1D47D}":"V","\u{1D4B1}":"V","\u{1D4E5}":"V","\u{1D519}":"V","\u{1D54D}":"V","\u{1D581}":"V","\u{1D5B5}":"V","\u{1D5E9}":"V","\u{1D61D}":"V","\u{1D651}":"V","\u{1D685}":"V",\u0474:"V","\u2D38":"V",\u13D9:"V",\u142F:"V","\uA6DF":"V","\uA4E6":"V","\u{16F08}":"V","\u{118A0}":"V","\u{1051D}":"V","\u{10197}":"V\u0335",\u143B:"V\xB7","\u{1F76C}":"VB","\u2175":"vi","\u2176":"vii","\u2177":"viii","\u2165":"Vl","\u2166":"Vll","\u2167":"Vlll","\u{1F708}":"V\u1DE4","\u1D27":"\u028C","\u{104D8}":"\u028C","\u0668":"\u0245","\u06F8":"\u0245",\u039B:"\u0245","\u{1D6B2}":"\u0245","\u{1D6EC}":"\u0245","\u{1D726}":"\u0245","\u{1D760}":"\u0245","\u{1D79A}":"\u0245",\u041B:"\u0245","\u2D37":"\u0245","\u{104B0}":"\u0245",\u1431:"\u0245","\uA6CE":"\u0245","\uA4E5":"\u0245","\u{16F3D}":"\u0245","\u{1028D}":"\u0245","\u04C5":"\u0245\u0326",\u143D:"\u0245\xB7",\u026F:"w","\u{1D430}":"w","\u{1D464}":"w","\u{1D498}":"w","\u{1D4CC}":"w","\u{1D500}":"w","\u{1D534}":"w","\u{1D568}":"w","\u{1D59C}":"w","\u{1D5D0}":"w","\u{1D604}":"w","\u{1D638}":"w","\u{1D66C}":"w","\u{1D6A0}":"w","\u1D21":"w",\u0461:"w","\u051D":"w",\u0561:"w","\u{1170A}":"w","\u{1170E}":"w","\u{1170F}":"w","\uAB83":"w","\u{118EF}":"W","\u{118E6}":"W","\u{1D416}":"W","\u{1D44A}":"W","\u{1D47E}":"W","\u{1D4B2}":"W","\u{1D4E6}":"W","\u{1D51A}":"W","\u{1D54E}":"W","\u{1D582}":"W","\u{1D5B6}":"W","\u{1D5EA}":"W","\u{1D61E}":"W","\u{1D652}":"W","\u{1D686}":"W","\u051C":"W",\u13B3:"W",\u13D4:"W","\uA4EA":"W",\u047D:"w\u0486\u0487","\u{114C5}":"w\u0307","\u20A9":"W\u0335","\uA761":"w\u0326","\u1D0D":"\u028D",\u043C:"\u028D","\uAB87":"\u028D","\u04CE":"\u028D\u0326","\u166E":"x","\xD7":"x","\u292B":"x","\u292C":"x","\u2A2F":"x",\uFF58:"x","\u2179":"x","\u{1D431}":"x","\u{1D465}":"x","\u{1D499}":"x","\u{1D4CD}":"x","\u{1D501}":"x","\u{1D535}":"x","\u{1D569}":"x","\u{1D59D}":"x","\u{1D5D1}":"x","\u{1D605}":"x","\u{1D639}":"x","\u{1D66D}":"x","\u{1D6A1}":"x",\u0445:"x",\u1541:"x",\u157D:"x","\u2DEF":"\u036F","\u166D":"X","\u2573":"X","\u{10322}":"X","\u{118EC}":"X",\uFF38:"X","\u2169":"X","\u{1D417}":"X","\u{1D44B}":"X","\u{1D47F}":"X","\u{1D4B3}":"X","\u{1D4E7}":"X","\u{1D51B}":"X","\u{1D54F}":"X","\u{1D583}":"X","\u{1D5B7}":"X","\u{1D5EB}":"X","\u{1D61F}":"X","\u{1D653}":"X","\u{1D687}":"X","\uA7B3":"X",\u03A7:"X","\u{1D6BE}":"X","\u{1D6F8}":"X","\u{1D732}":"X","\u{1D76C}":"X","\u{1D7A6}":"X","\u2CAC":"X",\u0425:"X","\u2D5D":"X",\u16B7:"X","\uA4EB":"X","\u{10290}":"X","\u{102B4}":"X","\u{10317}":"X","\u{10527}":"X","\u2A30":"x\u0307",\u04B2:"X\u0329","\u{10196}":"X\u0335","\u217A":"xi","\u217B":"xii","\u216A":"Xl","\u216B":"Xll",\u0263:"y","\u1D8C":"y",\uFF59:"y","\u{1D432}":"y","\u{1D466}":"y","\u{1D49A}":"y","\u{1D4CE}":"y","\u{1D502}":"y","\u{1D536}":"y","\u{1D56A}":"y","\u{1D59E}":"y","\u{1D5D2}":"y","\u{1D606}":"y","\u{1D63A}":"y","\u{1D66E}":"y","\u{1D6A2}":"y",\u028F:"y","\u1EFF":"y","\uAB5A":"y",\u03B3:"y","\u213D":"y","\u{1D6C4}":"y","\u{1D6FE}":"y","\u{1D738}":"y","\u{1D772}":"y","\u{1D7AC}":"y",\u0443:"y",\u04AF:"y",\u10E7:"y","\u{118DC}":"y",\uFF39:"Y","\u{1D418}":"Y","\u{1D44C}":"Y","\u{1D480}":"Y","\u{1D4B4}":"Y","\u{1D4E8}":"Y","\u{1D51C}":"Y","\u{1D550}":"Y","\u{1D584}":"Y","\u{1D5B8}":"Y","\u{1D5EC}":"Y","\u{1D620}":"Y","\u{1D654}":"Y","\u{1D688}":"Y",\u03A5:"Y",\u03D2:"Y","\u{1D6BC}":"Y","\u{1D6F6}":"Y","\u{1D730}":"Y","\u{1D76A}":"Y","\u{1D7A4}":"Y","\u2CA8":"Y",\u0423:"Y",\u04AE:"Y",\u13A9:"Y",\u13BD:"Y","\uA4EC":"Y","\u{16F43}":"Y","\u{118A4}":"Y","\u{102B2}":"Y",\u01B4:"y\u0314","\u024F":"y\u0335",\u04B1:"y\u0335","\xA5":"Y\u0335","\u024E":"Y\u0335",\u04B0:"Y\u0335",\u0292:"\u021D","\uA76B":"\u021D","\u2CCD":"\u021D",\u04E1:"\u021D",\u10F3:"\u021D","\u{1D433}":"z","\u{1D467}":"z","\u{1D49B}":"z","\u{1D4CF}":"z","\u{1D503}":"z","\u{1D537}":"z","\u{1D56B}":"z","\u{1D59F}":"z","\u{1D5D3}":"z","\u{1D607}":"z","\u{1D63B}":"z","\u{1D66F}":"z","\u{1D6A3}":"z","\u1D22":"z","\uAB93":"z","\u{118C4}":"z","\u{102F5}":"Z","\u{118E5}":"Z",\uFF3A:"Z",\u2124:"Z",\u2128:"Z","\u{1D419}":"Z","\u{1D44D}":"Z","\u{1D481}":"Z","\u{1D4B5}":"Z","\u{1D4E9}":"Z","\u{1D585}":"Z","\u{1D5B9}":"Z","\u{1D5ED}":"Z","\u{1D621}":"Z","\u{1D655}":"Z","\u{1D689}":"Z",\u0396:"Z","\u{1D6AD}":"Z","\u{1D6E7}":"Z","\u{1D721}":"Z","\u{1D75B}":"Z","\u{1D795}":"Z",\u13C3:"Z","\uA4DC":"Z","\u{118A9}":"Z",\u0290:"z\u0328",\u01B6:"z\u0335",\u01B5:"Z\u0335",\u0225:"z\u0326",\u0224:"Z\u0326","\u1D76":"z\u0334",\u01BF:"\xFE","\u03F8":"\xFE","\u03F7":"\xDE","\u{104C4}":"\xDE","\u2079":"\uA770","\u1D24":"\u01A8",\u03E9:"\u01A8","\uA645":"\u01A8",\u044C:"\u0185","\uAB9F":"\u0185",\u044B:"\u0185i","\uAB7E":"\u0242",\u02E4:"\u02C1","\uA6CD":"\u02A1","\u2299":"\u0298","\u2609":"\u0298","\u2A00":"\u0298","\uA668":"\u0298","\u2D59":"\u0298","\u{104C3}":"\u0298","\u213E":"\u0393","\u{1D6AA}":"\u0393","\u{1D6E4}":"\u0393","\u{1D71E}":"\u0393","\u{1D758}":"\u0393","\u{1D792}":"\u0393","\u2C84":"\u0393",\u0413:"\u0393",\u13B1:"\u0393",\u14A5:"\u0393","\u{16F07}":"\u0393",\u0492:"\u0393\u0335",\u14AF:"\u0393\xB7",\u0490:"\u0393'","\u2206":"\u0394","\u25B3":"\u0394","\u{1F702}":"\u0394","\u{1D6AB}":"\u0394","\u{1D6E5}":"\u0394","\u{1D71F}":"\u0394","\u{1D759}":"\u0394","\u{1D793}":"\u0394","\u2C86":"\u0394","\u2D60":"\u0394",\u1403:"\u0394","\u{16F1A}":"\u0394","\u{10285}":"\u0394","\u{102A3}":"\u0394","\u2359":"\u0394\u0332",\u140F:"\u0394\xB7",\u142C:"\u0394\u1420","\u{1D7CB}":"\u03DD","\u{1D6C7}":"\u03B6","\u{1D701}":"\u03B6","\u{1D73B}":"\u03B6","\u{1D775}":"\u03B6","\u{1D7AF}":"\u03B6","\u2CE4":"\u03D7","\u{1D6CC}":"\u03BB","\u{1D706}":"\u03BB","\u{1D740}":"\u03BB","\u{1D77A}":"\u03BB","\u{1D7B4}":"\u03BB","\u2C96":"\u03BB","\u{104DB}":"\u03BB",\u00B5:"\u03BC","\u{1D6CD}":"\u03BC","\u{1D707}":"\u03BC","\u{1D741}":"\u03BC","\u{1D77B}":"\u03BC","\u{1D7B5}":"\u03BC","\u{1D6CF}":"\u03BE","\u{1D709}":"\u03BE","\u{1D743}":"\u03BE","\u{1D77D}":"\u03BE","\u{1D7B7}":"\u03BE","\u{1D6B5}":"\u039E","\u{1D6EF}":"\u039E","\u{1D729}":"\u039E","\u{1D763}":"\u039E","\u{1D79D}":"\u039E",\u03D6:"\u03C0","\u213C":"\u03C0","\u{1D6D1}":"\u03C0","\u{1D6E1}":"\u03C0","\u{1D70B}":"\u03C0","\u{1D71B}":"\u03C0","\u{1D745}":"\u03C0","\u{1D755}":"\u03C0","\u{1D77F}":"\u03C0","\u{1D78F}":"\u03C0","\u{1D7B9}":"\u03C0","\u{1D7C9}":"\u03C0","\u1D28":"\u03C0",\u043F:"\u03C0","\u220F":"\u03A0","\u213F":"\u03A0","\u{1D6B7}":"\u03A0","\u{1D6F1}":"\u03A0","\u{1D72B}":"\u03A0","\u{1D765}":"\u03A0","\u{1D79F}":"\u03A0","\u2CA0":"\u03A0",\u041F:"\u03A0","\uA6DB":"\u03A0","\u{102AD}":"\u03D8","\u{10312}":"\u03D8",\u03DB:"\u03C2","\u{1D6D3}":"\u03C2","\u{1D70D}":"\u03C2","\u{1D747}":"\u03C2","\u{1D781}":"\u03C2","\u{1D7BB}":"\u03C2","\u{1D6BD}":"\u03A6","\u{1D6F7}":"\u03A6","\u{1D731}":"\u03A6","\u{1D76B}":"\u03A6","\u{1D7A5}":"\u03A6","\u2CAA":"\u03A6",\u0424:"\u03A6",\u0553:"\u03A6",\u1240:"\u03A6","\u16F0":"\u03A6","\u{102B3}":"\u03A6","\uAB53":"\u03C7","\uAB55":"\u03C7","\u{1D6D8}":"\u03C7","\u{1D712}":"\u03C7","\u{1D74C}":"\u03C7","\u{1D786}":"\u03C7","\u{1D7C0}":"\u03C7","\u2CAD":"\u03C7","\u{1D6D9}":"\u03C8","\u{1D713}":"\u03C8","\u{1D74D}":"\u03C8","\u{1D787}":"\u03C8","\u{1D7C1}":"\u03C8",\u0471:"\u03C8","\u{104F9}":"\u03C8","\u{1D6BF}":"\u03A8","\u{1D6F9}":"\u03A8","\u{1D733}":"\u03A8","\u{1D76D}":"\u03A8","\u{1D7A7}":"\u03A8","\u2CAE":"\u03A8",\u0470:"\u03A8","\u{104D1}":"\u03A8",\u16D8:"\u03A8","\u{102B5}":"\u03A8","\u2375":"\u03C9","\uA7B7":"\u03C9","\u{1D6DA}":"\u03C9","\u{1D714}":"\u03C9","\u{1D74E}":"\u03C9","\u{1D788}":"\u03C9","\u{1D7C2}":"\u03C9","\u2CB1":"\u03C9","\uA64D":"\u03C9",\u2126:"\u03A9","\u{1D6C0}":"\u03A9","\u{1D6FA}":"\u03A9","\u{1D734}":"\u03A9","\u{1D76E}":"\u03A9","\u{1D7A8}":"\u03A9",\u162F:"\u03A9",\u1635:"\u03A9","\u{102B6}":"\u03A9","\u2379":"\u03C9\u0332",\u1F7D:"\u1FF4","\u2630":"\u2CB6","\u2CDC":"\u03EC",\u0497:"\u0436\u0329",\u0496:"\u0416\u0329","\u{1D20B}":"\u0418","\u0376":"\u0418","\uA6A1":"\u0418","\u{10425}":"\u0418",\u0419:"\u040D","\u048A":"\u040D\u0326",\u045D:"\u0439","\u048B":"\u0439\u0326","\u{104BC}":"\u04C3","\u1D2B":"\u043B","\u04C6":"\u043B\u0326","\uAB60":"\u0459","\u{104EB}":"\uA669","\u1DEE":"\u2DEC","\u{104CD}":"\u040B","\u{1D202}":"\u04FE","\u{1D222}":"\u0460",\u13C7:"\u0460",\u15EF:"\u0460",\u047C:"\u0460\u0486\u0487","\u18ED":"\u0460\xB7","\uA7B6":"\uA64C",\u04CC:"\u04B7",\u04CB:"\u04B6",\u04BE:"\u04BC\u0328","\u2CBD":"\u0448","\u2CBC":"\u0428","\uA650":"\u042Al","\u2108":"\u042D","\u{1F701}":"\uA658","\u{16F1C}":"\uA658","\uA992":"\u2C3F",\u0587:"\u0565\u0582",\u1294:"\u0571",\uFB14:"\u0574\u0565",\uFB15:"\u0574\u056B",\uFB17:"\u0574\u056D",\uFB13:"\u0574\u0576","\u2229":"\u0548","\u22C2":"\u0548","\u{1D245}":"\u0548",\u1260:"\u0548",\u144E:"\u0548","\uA4F5":"\u0548",\u145A:"\u0548\xB7",\u1468:"\u0548'",\uFB16:"\u057E\u0576","\u20BD":"\u0554","\u02D3":"\u0559",\u02BF:"\u0559",\u2135:"\u05D0",\uFB21:"\u05D0",\uFB2F:"\uFB2E",\uFB30:"\uFB2E",\uFB4F:"\u05D0\u05DC",\u2136:"\u05D1",\u2137:"\u05D2",\u2138:"\u05D3",\uFB22:"\u05D3",\uFB23:"\u05D4",\uFB39:"\uFB1D",\uFB24:"\u05DB",\uFB25:"\u05DC",\uFB26:"\u05DD",\uFB20:"\u05E2",\uFB27:"\u05E8",\uFB2B:"\uFB2A",\uFB49:"\uFB2A",\uFB2D:"\uFB2C",\uFB28:"\u05EA",\uFE80:"\u0621","\u06FD":"\u0621\u0348",\uFE82:"\u0622",\uFE81:"\u0622",\uFB51:"\u0671",\uFB50:"\u0671","\u{1EE01}":"\u0628","\u{1EE21}":"\u0628","\u{1EE61}":"\u0628","\u{1EE81}":"\u0628","\u{1EEA1}":"\u0628",\uFE91:"\u0628",\uFE92:"\u0628",\uFE90:"\u0628",\uFE8F:"\u0628","\u0751":"\u0628\u06DB","\u08B6":"\u0628\u06E2","\u08A1":"\u0628\u0654",\uFCA0:"\u0628o",\uFCE2:"\u0628o",\uFC9C:"\u0628\u062C",\uFC05:"\u0628\u062C",\uFC9D:"\u0628\u062D",\uFC06:"\u0628\u062D",\uFDC2:"\u0628\u062D\u0649",\uFC9E:"\u0628\u062E",\uFC07:"\u0628\u062E",\uFCD2:"\u0628\u062E",\uFC4B:"\u0628\u062E",\uFD9E:"\u0628\u062E\u0649",\uFC6A:"\u0628\u0631",\uFC6B:"\u0628\u0632",\uFC9F:"\u0628\u0645",\uFCE1:"\u0628\u0645",\uFC6C:"\u0628\u0645",\uFC08:"\u0628\u0645",\uFC6D:"\u0628\u0646",\uFC6E:"\u0628\u0649",\uFC09:"\u0628\u0649",\uFC6F:"\u0628\u0649",\uFC0A:"\u0628\u0649",\uFB54:"\u067B",\uFB55:"\u067B",\uFB53:"\u067B",\uFB52:"\u067B",\u06D0:"\u067B",\uFBE6:"\u067B",\uFBE7:"\u067B",\uFBE5:"\u067B",\uFBE4:"\u067B",\uFB5C:"\u0680",\uFB5D:"\u0680",\uFB5B:"\u0680",\uFB5A:"\u0680","\u08A9":"\u0754","\u0767":"\u0754","\u2365":"\u0629",\u00F6:"\u0629",\uFE94:"\u0629",\uFE93:"\u0629",\u06C3:"\u0629","\u{1EE15}":"\u062A","\u{1EE35}":"\u062A","\u{1EE75}":"\u062A","\u{1EE95}":"\u062A","\u{1EEB5}":"\u062A",\uFE97:"\u062A",\uFE98:"\u062A",\uFE96:"\u062A",\uFE95:"\u062A",\uFCA5:"\u062Ao",\uFCE4:"\u062Ao",\uFCA1:"\u062A\u062C",\uFC0B:"\u062A\u062C",\uFD50:"\u062A\u062C\u0645",\uFDA0:"\u062A\u062C\u0649",\uFD9F:"\u062A\u062C\u0649",\uFCA2:"\u062A\u062D",\uFC0C:"\u062A\u062D",\uFD52:"\u062A\u062D\u062C",\uFD51:"\u062A\u062D\u062C",\uFD53:"\u062A\u062D\u0645",\uFCA3:"\u062A\u062E",\uFC0D:"\u062A\u062E",\uFD54:"\u062A\u062E\u0645",\uFDA2:"\u062A\u062E\u0649",\uFDA1:"\u062A\u062E\u0649",\uFC70:"\u062A\u0631",\uFC71:"\u062A\u0632",\uFCA4:"\u062A\u0645",\uFCE3:"\u062A\u0645",\uFC72:"\u062A\u0645",\uFC0E:"\u062A\u0645",\uFD55:"\u062A\u0645\u062C",\uFD56:"\u062A\u0645\u062D",\uFD57:"\u062A\u0645\u062E",\uFDA4:"\u062A\u0645\u0649",\uFDA3:"\u062A\u0645\u0649",\uFC73:"\u062A\u0646",\uFC74:"\u062A\u0649",\uFC0F:"\u062A\u0649",\uFC75:"\u062A\u0649",\uFC10:"\u062A\u0649",\uFB60:"\u067A",\uFB61:"\u067A",\uFB5F:"\u067A",\uFB5E:"\u067A",\uFB64:"\u067F",\uFB65:"\u067F",\uFB63:"\u067F",\uFB62:"\u067F","\u{1EE02}":"\u062C","\u{1EE22}":"\u062C","\u{1EE42}":"\u062C","\u{1EE62}":"\u062C","\u{1EE82}":"\u062C","\u{1EEA2}":"\u062C",\uFE9F:"\u062C",\uFEA0:"\u062C",\uFE9E:"\u062C",\uFE9D:"\u062C",\uFCA7:"\u062C\u062D",\uFC15:"\u062C\u062D",\uFDA6:"\u062C\u062D\u0649",\uFDBE:"\u062C\u062D\u0649",\uFDFB:"\u062C\u0644 \u062C\u0644l\u0644o",\uFCA8:"\u062C\u0645",\uFC16:"\u062C\u0645",\uFD59:"\u062C\u0645\u062D",\uFD58:"\u062C\u0645\u062D",\uFDA7:"\u062C\u0645\u0649",\uFDA5:"\u062C\u0645\u0649",\uFD1D:"\u062C\u0649",\uFD01:"\u062C\u0649",\uFD1E:"\u062C\u0649",\uFD02:"\u062C\u0649",\uFB78:"\u0683",\uFB79:"\u0683",\uFB77:"\u0683",\uFB76:"\u0683",\uFB74:"\u0684",\uFB75:"\u0684",\uFB73:"\u0684",\uFB72:"\u0684",\uFB7C:"\u0686",\uFB7D:"\u0686",\uFB7B:"\u0686",\uFB7A:"\u0686",\uFB80:"\u0687",\uFB81:"\u0687",\uFB7F:"\u0687",\uFB7E:"\u0687","\u{1EE07}":"\u062D","\u{1EE27}":"\u062D","\u{1EE47}":"\u062D","\u{1EE67}":"\u062D","\u{1EE87}":"\u062D","\u{1EEA7}":"\u062D",\uFEA3:"\u062D",\uFEA4:"\u062D",\uFEA2:"\u062D",\uFEA1:"\u062D",\u0685:"\u062D\u06DB",\u0681:"\u062D\u0654","\u0772":"\u062D\u0654",\uFCA9:"\u062D\u062C",\uFC17:"\u062D\u062C",\uFDBF:"\u062D\u062C\u0649",\uFCAA:"\u062D\u0645",\uFC18:"\u062D\u0645",\uFD5B:"\u062D\u0645\u0649",\uFD5A:"\u062D\u0645\u0649",\uFD1B:"\u062D\u0649",\uFCFF:"\u062D\u0649",\uFD1C:"\u062D\u0649",\uFD00:"\u062D\u0649","\u{1EE17}":"\u062E","\u{1EE37}":"\u062E","\u{1EE57}":"\u062E","\u{1EE77}":"\u062E","\u{1EE97}":"\u062E","\u{1EEB7}":"\u062E",\uFEA7:"\u062E",\uFEA8:"\u062E",\uFEA6:"\u062E",\uFEA5:"\u062E",\uFCAB:"\u062E\u062C",\uFC19:"\u062E\u062C",\uFC1A:"\u062E\u062D",\uFCAC:"\u062E\u0645",\uFC1B:"\u062E\u0645",\uFD1F:"\u062E\u0649",\uFD03:"\u062E\u0649",\uFD20:"\u062E\u0649",\uFD04:"\u062E\u0649","\u{102E1}":"\u062F","\u{1EE03}":"\u062F","\u{1EE83}":"\u062F","\u{1EEA3}":"\u062F",\uFEAA:"\u062F",\uFEA9:"\u062F",\u0688:"\u062F\u0615",\uFB89:"\u062F\u0615",\uFB88:"\u062F\u0615",\u068E:"\u062F\u06DB",\uFB87:"\u062F\u06DB",\uFB86:"\u062F\u06DB","\u06EE":"\u062F\u0302","\u08AE":"\u062F\u0324\u0323","\u{1EE18}":"\u0630","\u{1EE98}":"\u0630","\u{1EEB8}":"\u0630",\uFEAC:"\u0630",\uFEAB:"\u0630",\uFC5B:"\u0630\u0670",\u068B:"\u068A\u0615",\uFB85:"\u068C",\uFB84:"\u068C",\uFB83:"\u068D",\uFB82:"\u068D","\u{1EE13}":"\u0631","\u{1EE93}":"\u0631","\u{1EEB3}":"\u0631",\uFEAE:"\u0631",\uFEAD:"\u0631",\u0691:"\u0631\u0615",\uFB8D:"\u0631\u0615",\uFB8C:"\u0631\u0615",\u0698:"\u0631\u06DB",\uFB8B:"\u0631\u06DB",\uFB8A:"\u0631\u06DB",\u0692:"\u0631\u0306","\u08B9":"\u0631\u0306\u0307","\u06EF":"\u0631\u0302","\u076C":"\u0631\u0654",\uFC5C:"\u0631\u0670",\uFDF6:"\u0631\u0633\u0648\u0644","\uFDFC":"\u0631\u0649l\u0644","\u{1EE06}":"\u0632","\u{1EE86}":"\u0632","\u{1EEA6}":"\u0632",\uFEB0:"\u0632",\uFEAF:"\u0632","\u08B2":"\u0632\u0302","\u0771":"\u0697\u0615","\u{1EE0E}":"\u0633","\u{1EE2E}":"\u0633","\u{1EE4E}":"\u0633","\u{1EE6E}":"\u0633","\u{1EE8E}":"\u0633","\u{1EEAE}":"\u0633",\uFEB3:"\u0633",\uFEB4:"\u0633",\uFEB2:"\u0633",\uFEB1:"\u0633",\u0634:"\u0633\u06DB","\u{1EE14}":"\u0633\u06DB","\u{1EE34}":"\u0633\u06DB","\u{1EE54}":"\u0633\u06DB","\u{1EE74}":"\u0633\u06DB","\u{1EE94}":"\u0633\u06DB","\u{1EEB4}":"\u0633\u06DB",\uFEB7:"\u0633\u06DB",\uFEB8:"\u0633\u06DB",\uFEB6:"\u0633\u06DB",\uFEB5:"\u0633\u06DB","\u077E":"\u0633\u0302",\uFD31:"\u0633o",\uFCE8:"\u0633o",\uFD32:"\u0633\u06DBo",\uFCEA:"\u0633\u06DBo",\uFCAD:"\u0633\u062C",\uFD34:"\u0633\u062C",\uFC1C:"\u0633\u062C",\uFD2D:"\u0633\u06DB\u062C",\uFD37:"\u0633\u06DB\u062C",\uFD25:"\u0633\u06DB\u062C",\uFD09:"\u0633\u06DB\u062C",\uFD5D:"\u0633\u062C\u062D",\uFD5E:"\u0633\u062C\u0649",\uFD69:"\u0633\u06DB\u062C\u0649",\uFCAE:"\u0633\u062D",\uFD35:"\u0633\u062D",\uFC1D:"\u0633\u062D",\uFD2E:"\u0633\u06DB\u062D",\uFD38:"\u0633\u06DB\u062D",\uFD26:"\u0633\u06DB\u062D",\uFD0A:"\u0633\u06DB\u062D",\uFD5C:"\u0633\u062D\u062C",\uFD68:"\u0633\u06DB\u062D\u0645",\uFD67:"\u0633\u06DB\u062D\u0645",\uFDAA:"\u0633\u06DB\u062D\u0649",\uFCAF:"\u0633\u062E",\uFD36:"\u0633\u062E",\uFC1E:"\u0633\u062E",\uFD2F:"\u0633\u06DB\u062E",\uFD39:"\u0633\u06DB\u062E",\uFD27:"\u0633\u06DB\u062E",\uFD0B:"\u0633\u06DB\u062E",\uFDA8:"\u0633\u062E\u0649",\uFDC6:"\u0633\u062E\u0649",\uFD2A:"\u0633\u0631",\uFD0E:"\u0633\u0631",\uFD29:"\u0633\u06DB\u0631",\uFD0D:"\u0633\u06DB\u0631",\uFCB0:"\u0633\u0645",\uFCE7:"\u0633\u0645",\uFC1F:"\u0633\u0645",\uFD30:"\u0633\u06DB\u0645",\uFCE9:"\u0633\u06DB\u0645",\uFD28:"\u0633\u06DB\u0645",\uFD0C:"\u0633\u06DB\u0645",\uFD61:"\u0633\u0645\u062C",\uFD60:"\u0633\u0645\u062D",\uFD5F:"\u0633\u0645\u062D",\uFD6B:"\u0633\u06DB\u0645\u062E",\uFD6A:"\u0633\u06DB\u0645\u062E",\uFD63:"\u0633\u0645\u0645",\uFD62:"\u0633\u0645\u0645",\uFD6D:"\u0633\u06DB\u0645\u0645",\uFD6C:"\u0633\u06DB\u0645\u0645",\uFD17:"\u0633\u0649",\uFCFB:"\u0633\u0649",\uFD18:"\u0633\u0649",\uFCFC:"\u0633\u0649",\uFD19:"\u0633\u06DB\u0649",\uFCFD:"\u0633\u06DB\u0649",\uFD1A:"\u0633\u06DB\u0649",\uFCFE:"\u0633\u06DB\u0649","\u{102F2}":"\u0635","\u{1EE11}":"\u0635","\u{1EE31}":"\u0635","\u{1EE51}":"\u0635","\u{1EE71}":"\u0635","\u{1EE91}":"\u0635","\u{1EEB1}":"\u0635",\uFEBB:"\u0635",\uFEBC:"\u0635",\uFEBA:"\u0635",\uFEB9:"\u0635",\u069E:"\u0635\u06DB","\u08AF":"\u0635\u0324\u0323",\uFCB1:"\u0635\u062D",\uFC20:"\u0635\u062D",\uFD65:"\u0635\u062D\u062D",\uFD64:"\u0635\u062D\u062D",\uFDA9:"\u0635\u062D\u0649",\uFCB2:"\u0635\u062E",\uFD2B:"\u0635\u0631",\uFD0F:"\u0635\u0631",\uFDF5:"\u0635\u0644\u0639\u0645",\uFDF9:"\u0635\u0644\u0649",\uFDF0:"\u0635\u0644\u0649",\uFDFA:"\u0635\u0644\u0649 l\u0644\u0644o \u0639\u0644\u0649o \u0648\u0633\u0644\u0645",\uFCB3:"\u0635\u0645",\uFC21:"\u0635\u0645",\uFDC5:"\u0635\u0645\u0645",\uFD66:"\u0635\u0645\u0645",\uFD21:"\u0635\u0649",\uFD05:"\u0635\u0649",\uFD22:"\u0635\u0649",\uFD06:"\u0635\u0649","\u{1EE19}":"\u0636","\u{1EE39}":"\u0636","\u{1EE59}":"\u0636","\u{1EE79}":"\u0636","\u{1EE99}":"\u0636","\u{1EEB9}":"\u0636",\uFEBF:"\u0636",\uFEC0:"\u0636",\uFEBE:"\u0636",\uFEBD:"\u0636",\uFCB4:"\u0636\u062C",\uFC22:"\u0636\u062C",\uFCB5:"\u0636\u062D",\uFC23:"\u0636\u062D",\uFD6E:"\u0636\u062D\u0649",\uFDAB:"\u0636\u062D\u0649",\uFCB6:"\u0636\u062E",\uFC24:"\u0636\u062E",\uFD70:"\u0636\u062E\u0645",\uFD6F:"\u0636\u062E\u0645",\uFD2C:"\u0636\u0631",\uFD10:"\u0636\u0631",\uFCB7:"\u0636\u0645",\uFC25:"\u0636\u0645",\uFD23:"\u0636\u0649",\uFD07:"\u0636\u0649",\uFD24:"\u0636\u0649",\uFD08:"\u0636\u0649","\u{102E8}":"\u0637","\u{1EE08}":"\u0637","\u{1EE68}":"\u0637","\u{1EE88}":"\u0637","\u{1EEA8}":"\u0637",\uFEC3:"\u0637",\uFEC4:"\u0637",\uFEC2:"\u0637",\uFEC1:"\u0637",\u069F:"\u0637\u06DB",\uFCB8:"\u0637\u062D",\uFC26:"\u0637\u062D",\uFD33:"\u0637\u0645",\uFD3A:"\u0637\u0645",\uFC27:"\u0637\u0645",\uFD72:"\u0637\u0645\u062D",\uFD71:"\u0637\u0645\u062D",\uFD73:"\u0637\u0645\u0645",\uFD74:"\u0637\u0645\u0649",\uFD11:"\u0637\u0649",\uFCF5:"\u0637\u0649",\uFD12:"\u0637\u0649",\uFCF6:"\u0637\u0649","\u{1EE1A}":"\u0638","\u{1EE7A}":"\u0638","\u{1EE9A}":"\u0638","\u{1EEBA}":"\u0638",\uFEC7:"\u0638",\uFEC8:"\u0638",\uFEC6:"\u0638",\uFEC5:"\u0638",\uFCB9:"\u0638\u0645",\uFD3B:"\u0638\u0645",\uFC28:"\u0638\u0645","\u060F":"\u0639","\u{1EE0F}":"\u0639","\u{1EE2F}":"\u0639","\u{1EE4F}":"\u0639","\u{1EE6F}":"\u0639","\u{1EE8F}":"\u0639","\u{1EEAF}":"\u0639",\uFECB:"\u0639",\uFECC:"\u0639",\uFECA:"\u0639",\uFEC9:"\u0639",\uFCBA:"\u0639\u062C",\uFC29:"\u0639\u062C",\uFDC4:"\u0639\u062C\u0645",\uFD75:"\u0639\u062C\u0645",\uFDF7:"\u0639\u0644\u0649o",\uFCBB:"\u0639\u0645",\uFC2A:"\u0639\u0645",\uFD77:"\u0639\u0645\u0645",\uFD76:"\u0639\u0645\u0645",\uFD78:"\u0639\u0645\u0649",\uFDB6:"\u0639\u0645\u0649",\uFD13:"\u0639\u0649",\uFCF7:"\u0639\u0649",\uFD14:"\u0639\u0649",\uFCF8:"\u0639\u0649","\u{1EE1B}":"\u063A","\u{1EE3B}":"\u063A","\u{1EE5B}":"\u063A","\u{1EE7B}":"\u063A","\u{1EE9B}":"\u063A","\u{1EEBB}":"\u063A",\uFECF:"\u063A",\uFED0:"\u063A",\uFECE:"\u063A",\uFECD:"\u063A",\uFCBC:"\u063A\u062C",\uFC2B:"\u063A\u062C",\uFCBD:"\u063A\u0645",\uFC2C:"\u063A\u0645",\uFD79:"\u063A\u0645\u0645",\uFD7B:"\u063A\u0645\u0649",\uFD7A:"\u063A\u0645\u0649",\uFD15:"\u063A\u0649",\uFCF9:"\u063A\u0649",\uFD16:"\u063A\u0649",\uFCFA:"\u063A\u0649","\u{1EE10}":"\u0641","\u{1EE30}":"\u0641","\u{1EE70}":"\u0641","\u{1EE90}":"\u0641","\u{1EEB0}":"\u0641",\uFED3:"\u0641",\uFED4:"\u0641",\uFED2:"\u0641",\uFED1:"\u0641",\u06A7:"\u0641",\uFCBE:"\u0641\u062C",\uFC2D:"\u0641\u062C",\uFCBF:"\u0641\u062D",\uFC2E:"\u0641\u062D",\uFCC0:"\u0641\u062E",\uFC2F:"\u0641\u062E",\uFD7D:"\u0641\u062E\u0645",\uFD7C:"\u0641\u062E\u0645",\uFCC1:"\u0641\u0645",\uFC30:"\u0641\u0645",\uFDC1:"\u0641\u0645\u0649",\uFC7C:"\u0641\u0649",\uFC31:"\u0641\u0649",\uFC7D:"\u0641\u0649",\uFC32:"\u0641\u0649","\u{1EE1E}":"\u06A1","\u{1EE7E}":"\u06A1","\u08BB":"\u06A1","\u066F":"\u06A1","\u{1EE1F}":"\u06A1","\u{1EE5F}":"\u06A1","\u08BC":"\u06A1",\u06A4:"\u06A1\u06DB",\uFB6C:"\u06A1\u06DB",\uFB6D:"\u06A1\u06DB",\uFB6B:"\u06A1\u06DB",\uFB6A:"\u06A1\u06DB",\u06A8:"\u06A1\u06DB","\u08A4":"\u06A2\u06DB",\uFB70:"\u06A6",\uFB71:"\u06A6",\uFB6F:"\u06A6",\uFB6E:"\u06A6","\u{1EE12}":"\u0642","\u{1EE32}":"\u0642","\u{1EE52}":"\u0642","\u{1EE72}":"\u0642","\u{1EE92}":"\u0642","\u{1EEB2}":"\u0642",\uFED7:"\u0642",\uFED8:"\u0642",\uFED6:"\u0642",\uFED5:"\u0642",\uFCC2:"\u0642\u062D",\uFC33:"\u0642\u062D",\uFDF1:"\u0642\u0644\u0649",\uFCC3:"\u0642\u0645",\uFC34:"\u0642\u0645",\uFDB4:"\u0642\u0645\u062D",\uFD7E:"\u0642\u0645\u062D",\uFD7F:"\u0642\u0645\u0645",\uFDB2:"\u0642\u0645\u0649",\uFC7E:"\u0642\u0649",\uFC35:"\u0642\u0649",\uFC7F:"\u0642\u0649",\uFC36:"\u0642\u0649","\u{1EE0A}":"\u0643","\u{1EE2A}":"\u0643","\u{1EE6A}":"\u0643",\uFEDB:"\u0643",\uFEDC:"\u0643",\uFEDA:"\u0643",\uFED9:"\u0643",\u06A9:"\u0643",\uFB90:"\u0643",\uFB91:"\u0643",\uFB8F:"\u0643",\uFB8E:"\u0643",\u06AA:"\u0643",\u06AD:"\u0643\u06DB",\uFBD5:"\u0643\u06DB",\uFBD6:"\u0643\u06DB",\uFBD4:"\u0643\u06DB",\uFBD3:"\u0643\u06DB","\u0763":"\u0643\u06DB",\uFC80:"\u0643l",\uFC37:"\u0643l",\uFCC4:"\u0643\u062C",\uFC38:"\u0643\u062C",\uFCC5:"\u0643\u062D",\uFC39:"\u0643\u062D",\uFCC6:"\u0643\u062E",\uFC3A:"\u0643\u062E",\uFCC7:"\u0643\u0644",\uFCEB:"\u0643\u0644",\uFC81:"\u0643\u0644",\uFC3B:"\u0643\u0644",\uFCC8:"\u0643\u0645",\uFCEC:"\u0643\u0645",\uFC82:"\u0643\u0645",\uFC3C:"\u0643\u0645",\uFDC3:"\u0643\u0645\u0645",\uFDBB:"\u0643\u0645\u0645",\uFDB7:"\u0643\u0645\u0649",\uFC83:"\u0643\u0649",\uFC3D:"\u0643\u0649",\uFC84:"\u0643\u0649",\uFC3E:"\u0643\u0649","\u0762":"\u06AC",\uFB94:"\u06AF",\uFB95:"\u06AF",\uFB93:"\u06AF",\uFB92:"\u06AF","\u08B0":"\u06AF",\u06B4:"\u06AF\u06DB",\uFB9C:"\u06B1",\uFB9D:"\u06B1",\uFB9B:"\u06B1",\uFB9A:"\u06B1",\uFB98:"\u06B3",\uFB99:"\u06B3",\uFB97:"\u06B3",\uFB96:"\u06B3","\u{1EE0B}":"\u0644","\u{1EE2B}":"\u0644","\u{1EE4B}":"\u0644","\u{1EE8B}":"\u0644","\u{1EEAB}":"\u0644",\uFEDF:"\u0644",\uFEE0:"\u0644",\uFEDE:"\u0644",\uFEDD:"\u0644",\u06B7:"\u0644\u06DB",\u06B5:"\u0644\u0306",\uFEFC:"\u0644l",\uFEFB:"\u0644l",\uFEFA:"\u0644l\u0655",\uFEF9:"\u0644l\u0655",\uFEF8:"\u0644l\u0674",\uFEF7:"\u0644l\u0674",\uFCCD:"\u0644o",\uFEF6:"\u0644\u0622",\uFEF5:"\u0644\u0622",\uFCC9:"\u0644\u062C",\uFC3F:"\u0644\u062C",\uFD83:"\u0644\u062C\u062C",\uFD84:"\u0644\u062C\u062C",\uFDBA:"\u0644\u062C\u0645",\uFDBC:"\u0644\u062C\u0645",\uFDAC:"\u0644\u062C\u0649",\uFCCA:"\u0644\u062D",\uFC40:"\u0644\u062D",\uFDB5:"\u0644\u062D\u0645",\uFD80:"\u0644\u062D\u0645",\uFD82:"\u0644\u062D\u0649",\uFD81:"\u0644\u062D\u0649",\uFCCB:"\u0644\u062E",\uFC41:"\u0644\u062E",\uFD86:"\u0644\u062E\u0645",\uFD85:"\u0644\u062E\u0645",\uFCCC:"\u0644\u0645",\uFCED:"\u0644\u0645",\uFC85:"\u0644\u0645",\uFC42:"\u0644\u0645",\uFD88:"\u0644\u0645\u062D",\uFD87:"\u0644\u0645\u062D",\uFDAD:"\u0644\u0645\u0649",\uFC86:"\u0644\u0649",\uFC43:"\u0644\u0649",\uFC87:"\u0644\u0649",\uFC44:"\u0644\u0649","\u{1EE0C}":"\u0645","\u{1EE2C}":"\u0645","\u{1EE6C}":"\u0645","\u{1EE8C}":"\u0645","\u{1EEAC}":"\u0645",\uFEE3:"\u0645",\uFEE4:"\u0645",\uFEE2:"\u0645",\uFEE1:"\u0645","\u08A7":"\u0645\u06DB","\u06FE":"\u0645\u0348",\uFC88:"\u0645l",\uFCCE:"\u0645\u062C",\uFC45:"\u0645\u062C",\uFD8C:"\u0645\u062C\u062D",\uFD92:"\u0645\u062C\u062E",\uFD8D:"\u0645\u062C\u0645",\uFDC0:"\u0645\u062C\u0649",\uFCCF:"\u0645\u062D",\uFC46:"\u0645\u062D",\uFD89:"\u0645\u062D\u062C",\uFD8A:"\u0645\u062D\u0645",\uFDF4:"\u0645\u062D\u0645\u062F",\uFD8B:"\u0645\u062D\u0649",\uFCD0:"\u0645\u062E",\uFC47:"\u0645\u062E",\uFD8E:"\u0645\u062E\u062C",\uFD8F:"\u0645\u062E\u0645",\uFDB9:"\u0645\u062E\u0649",\uFCD1:"\u0645\u0645",\uFC89:"\u0645\u0645",\uFC48:"\u0645\u0645",\uFDB1:"\u0645\u0645\u0649",\uFC49:"\u0645\u0649",\uFC4A:"\u0645\u0649","\u{1EE0D}":"\u0646","\u{1EE2D}":"\u0646","\u{1EE4D}":"\u0646","\u{1EE6D}":"\u0646","\u{1EE8D}":"\u0646","\u{1EEAD}":"\u0646",\uFEE7:"\u0646",\uFEE8:"\u0646",\uFEE6:"\u0646",\uFEE5:"\u0646","\u0768":"\u0646\u0615","\u0769":"\u0646\u0306",\uFCD6:"\u0646o",\uFCEF:"\u0646o",\uFDB8:"\u0646\u062C\u062D",\uFDBD:"\u0646\u062C\u062D",\uFD98:"\u0646\u062C\u0645",\uFD97:"\u0646\u062C\u0645",\uFD99:"\u0646\u062C\u0649",\uFDC7:"\u0646\u062C\u0649",\uFCD3:"\u0646\u062D",\uFC4C:"\u0646\u062D",\uFD95:"\u0646\u062D\u0645",\uFD96:"\u0646\u062D\u0649",\uFDB3:"\u0646\u062D\u0649",\uFCD4:"\u0646\u062E",\uFC4D:"\u0646\u062E",\uFC8A:"\u0646\u0631",\uFC8B:"\u0646\u0632",\uFCD5:"\u0646\u0645",\uFCEE:"\u0646\u0645",\uFC8C:"\u0646\u0645",\uFC4E:"\u0646\u0645",\uFD9B:"\u0646\u0645\u0649",\uFD9A:"\u0646\u0645\u0649",\uFC8D:"\u0646\u0646",\uFC8E:"\u0646\u0649",\uFC4F:"\u0646\u0649",\uFC8F:"\u0646\u0649",\uFC50:"\u0646\u0649",\u06C2:"\u06C0",\uFBA5:"\u06C0",\uFBA4:"\u06C0","\u{102E4}":"\u0648","\u{1EE05}":"\u0648","\u{1EE85}":"\u0648","\u{1EEA5}":"\u0648",\uFEEE:"\u0648",\uFEED:"\u0648","\u08B1":"\u0648",\u06CB:"\u0648\u06DB",\uFBDF:"\u0648\u06DB",\uFBDE:"\u0648\u06DB",\u06C7:"\u0648\u0313",\uFBD8:"\u0648\u0313",\uFBD7:"\u0648\u0313",\u06C6:"\u0648\u0306",\uFBDA:"\u0648\u0306",\uFBD9:"\u0648\u0306",\u06C9:"\u0648\u0302",\uFBE3:"\u0648\u0302",\uFBE2:"\u0648\u0302",\u06C8:"\u0648\u0670",\uFBDC:"\u0648\u0670",\uFBDB:"\u0648\u0670",\u0624:"\u0648\u0674",\uFE86:"\u0648\u0674",\uFE85:"\u0648\u0674",\u0676:"\u0648\u0674",\u0677:"\u0648\u0313\u0674",\uFBDD:"\u0648\u0313\u0674",\uFDF8:"\u0648\u0633\u0644\u0645",\uFBE1:"\u06C5",\uFBE0:"\u06C5","\u066E":"\u0649","\u{1EE1C}":"\u0649","\u{1EE7C}":"\u0649",\u06BA:"\u0649","\u{1EE1D}":"\u0649","\u{1EE5D}":"\u0649",\uFB9F:"\u0649",\uFB9E:"\u0649","\u08BD":"\u0649",\uFBE8:"\u0649",\uFBE9:"\u0649",\uFEF0:"\u0649",\uFEEF:"\u0649",\u064A:"\u0649","\u{1EE09}":"\u0649","\u{1EE29}":"\u0649","\u{1EE49}":"\u0649","\u{1EE69}":"\u0649","\u{1EE89}":"\u0649","\u{1EEA9}":"\u0649",\uFEF3:"\u0649",\uFEF4:"\u0649",\uFEF2:"\u0649",\uFEF1:"\u0649",\u06CC:"\u0649",\uFBFE:"\u0649",\uFBFF:"\u0649",\uFBFD:"\u0649",\uFBFC:"\u0649",\u06D2:"\u0649",\uFBAF:"\u0649",\uFBAE:"\u0649",\u0679:"\u0649\u0615",\uFB68:"\u0649\u0615",\uFB69:"\u0649\u0615",\uFB67:"\u0649\u0615",\uFB66:"\u0649\u0615",\u06BB:"\u0649\u0615",\uFBA2:"\u0649\u0615",\uFBA3:"\u0649\u0615",\uFBA1:"\u0649\u0615",\uFBA0:"\u0649\u0615",\u067E:"\u0649\u06DB",\uFB58:"\u0649\u06DB",\uFB59:"\u0649\u06DB",\uFB57:"\u0649\u06DB",\uFB56:"\u0649\u06DB",\u062B:"\u0649\u06DB","\u{1EE16}":"\u0649\u06DB","\u{1EE36}":"\u0649\u06DB","\u{1EE76}":"\u0649\u06DB","\u{1EE96}":"\u0649\u06DB","\u{1EEB6}":"\u0649\u06DB",\uFE9B:"\u0649\u06DB",\uFE9C:"\u0649\u06DB",\uFE9A:"\u0649\u06DB",\uFE99:"\u0649\u06DB",\u06BD:"\u0649\u06DB",\u06D1:"\u0649\u06DB","\u063F":"\u0649\u06DB","\u08B7":"\u0649\u06DB\u06E2","\u0756":"\u0649\u0306",\u06CE:"\u0649\u0306","\u08BA":"\u0649\u0306\u0307","\u063D":"\u0649\u0302","\u08A8":"\u0649\u0654",\uFC90:"\u0649\u0670",\uFC5D:"\u0649\u0670",\uFCDE:"\u0649o",\uFCF1:"\u0649o",\uFCE6:"\u0649\u06DBo",\u0626:"\u0649\u0674",\uFE8B:"\u0649\u0674",\uFE8C:"\u0649\u0674",\uFE8A:"\u0649\u0674",\uFE89:"\u0649\u0674",\u0678:"\u0649\u0674",\uFBEB:"\u0649\u0674l",\uFBEA:"\u0649\u0674l",\uFC9B:"\u0649\u0674o",\uFCE0:"\u0649\u0674o",\uFBED:"\u0649\u0674o",\uFBEC:"\u0649\u0674o",\uFBF8:"\u0649\u0674\u067B",\uFBF7:"\u0649\u0674\u067B",\uFBF6:"\u0649\u0674\u067B",\uFC97:"\u0649\u0674\u062C",\uFC00:"\u0649\u0674\u062C",\uFC98:"\u0649\u0674\u062D",\uFC01:"\u0649\u0674\u062D",\uFC99:"\u0649\u0674\u062E",\uFC64:"\u0649\u0674\u0631",\uFC65:"\u0649\u0674\u0632",\uFC9A:"\u0649\u0674\u0645",\uFCDF:"\u0649\u0674\u0645",\uFC66:"\u0649\u0674\u0645",\uFC02:"\u0649\u0674\u0645",\uFC67:"\u0649\u0674\u0646",\uFBEF:"\u0649\u0674\u0648",\uFBEE:"\u0649\u0674\u0648",\uFBF1:"\u0649\u0674\u0648\u0313",\uFBF0:"\u0649\u0674\u0648\u0313",\uFBF3:"\u0649\u0674\u0648\u0306",\uFBF2:"\u0649\u0674\u0648\u0306",\uFBF5:"\u0649\u0674\u0648\u0670",\uFBF4:"\u0649\u0674\u0648\u0670",\uFBFB:"\u0649\u0674\u0649",\uFBFA:"\u0649\u0674\u0649",\uFC68:"\u0649\u0674\u0649",\uFBF9:"\u0649\u0674\u0649",\uFC03:"\u0649\u0674\u0649",\uFC69:"\u0649\u0674\u0649",\uFC04:"\u0649\u0674\u0649",\uFCDA:"\u0649\u062C",\uFC55:"\u0649\u062C",\uFC11:"\u0649\u06DB\u062C",\uFDAF:"\u0649\u062C\u0649",\uFCDB:"\u0649\u062D",\uFC56:"\u0649\u062D",\uFDAE:"\u0649\u062D\u0649",\uFCDC:"\u0649\u062E",\uFC57:"\u0649\u062E",\uFC91:"\u0649\u0631",\uFC76:"\u0649\u06DB\u0631",\uFC92:"\u0649\u0632",\uFC77:"\u0649\u06DB\u0632",\uFCDD:"\u0649\u0645",\uFCF0:"\u0649\u0645",\uFC93:"\u0649\u0645",\uFC58:"\u0649\u0645",\uFCA6:"\u0649\u06DB\u0645",\uFCE5:"\u0649\u06DB\u0645",\uFC78:"\u0649\u06DB\u0645",\uFC12:"\u0649\u06DB\u0645",\uFD9D:"\u0649\u0645\u0645",\uFD9C:"\u0649\u0645\u0645",\uFDB0:"\u0649\u0645\u0649",\uFC94:"\u0649\u0646",\uFC79:"\u0649\u06DB\u0646",\uFC95:"\u0649\u0649",\uFC59:"\u0649\u0649",\uFC96:"\u0649\u0649",\uFC5A:"\u0649\u0649",\uFC7A:"\u0649\u06DB\u0649",\uFC13:"\u0649\u06DB\u0649",\uFC7B:"\u0649\u06DB\u0649",\uFC14:"\u0649\u06DB\u0649",\uFBB1:"\u06D3",\uFBB0:"\u06D3","\u{102B8}":"\u2D40","\u205E":"\u2D42","\u2E3D":"\u2D42","\u2999":"\u2D42","\uFE19":"\u2D57","\u205D":"\u2D57","\u22EE":"\u2D57",\u0544:"\u1206",\u054C:"\u1261",\u053B:"\u12AE",\u054A:"\u1323",\u0906:"\u0905\u093E",\u0912:"\u0905\u093E\u0946",\u0913:"\u0905\u093E\u0947",\u0914:"\u0905\u093E\u0948","\u0904":"\u0905\u0946",\u0911:"\u0905\u0949",\u090D:"\u090F\u0945",\u090E:"\u090F\u0946",\u0910:"\u090F\u0947",\u0908:"\u0930\u094D\u0907",\u0ABD:"\u093D","\u{111DC}":"\uA8FB","\u{111CB}":"\u093A","\u0AC1":"\u0941","\u0AC2":"\u0942","\u0A4B":"\u0946","\u0A4D":"\u094D","\u0ACD":"\u094D",\u0986:"\u0985\u09BE",\u09E0:"\u098B\u09C3",\u09E1:"\u098B\u09C3","\u{11492}":"\u0998","\u{11494}":"\u099A","\u{11496}":"\u099C","\u{11498}":"\u099E","\u{11499}":"\u099F","\u{1149B}":"\u09A1","\u{114AA}":"\u09A3","\u{1149E}":"\u09A4","\u{1149F}":"\u09A5","\u{114A0}":"\u09A6","\u{114A1}":"\u09A7","\u{114A2}":"\u09A8","\u{114A3}":"\u09AA","\u{114A9}":"\u09AC","\u{114A7}":"\u09AE","\u{114A8}":"\u09AF","\u{114AB}":"\u09B0","\u{1149D}":"\u09B2","\u{114AD}":"\u09B7","\u{114AE}":"\u09B8","\u{114C4}":"\u09BD","\u{114B0}":"\u09BE","\u{114B1}":"\u09BF","\u{114B9}":"\u09C7","\u{114BC}":"\u09CB","\u{114BE}":"\u09CC","\u{114C2}":"\u09CD","\u{114BD}":"\u09D7",\u0A09:"\u0A73\u0A41",\u0A0A:"\u0A73\u0A42",\u0A06:"\u0A05\u0A3E",\u0A10:"\u0A05\u0A48",\u0A14:"\u0A05\u0A4C",\u0A07:"\u0A72\u0A3F",\u0A08:"\u0A72\u0A40",\u0A0F:"\u0A72\u0A47",\u0A86:"\u0A85\u0ABE",\u0A91:"\u0A85\u0ABE\u0AC5",\u0A93:"\u0A85\u0ABE\u0AC7",\u0A94:"\u0A85\u0ABE\u0AC8",\u0A8D:"\u0A85\u0AC5",\u0A8F:"\u0A85\u0AC7",\u0A90:"\u0A85\u0AC8",\u0B06:"\u0B05\u0B3E","\u0BEE":"\u0B85",\u0BB0:"\u0B88","\u0BBE":"\u0B88","\u0BEB":"\u0B88\u0BC1","\u0BE8":"\u0B89",\u0D09:"\u0B89",\u0B8A:"\u0B89\u0BB3",\u0D0A:"\u0B89\u0D57","\u0BED":"\u0B8E","\u0BF7":"\u0B8E\u0BB5",\u0B9C:"\u0B90",\u0D1C:"\u0B90","\u0BE7":"\u0B95","\u0BEA":"\u0B9A","\u0BEC":"\u0B9A\u0BC1","\u0BF2":"\u0B9A\u0BC2","\u0D3A":"\u0B9F\u0BBF",\u0D23:"\u0BA3","\u0BFA":"\u0BA8\u0BC0","\u0BF4":"\u0BAE\u0BC0","\u0BF0":"\u0BAF",\u0D34:"\u0BB4","\u0BD7":"\u0BB3","\u0BC8":"\u0BA9",\u0D36:"\u0BB6","\u0BF8":"\u0BB7","\u0D3F":"\u0BBF","\u0D40":"\u0BBF","\u0BCA":"\u0BC6\u0B88","\u0BCC":"\u0BC6\u0BB3","\u0BCB":"\u0BC7\u0B88",\u0C85:"\u0C05",\u0C86:"\u0C06",\u0C87:"\u0C07",\u0C60:"\u0C0B\u0C3E",\u0C61:"\u0C0C\u0C3E",\u0C92:"\u0C12",\u0C14:"\u0C12\u0C4C",\u0C94:"\u0C12\u0C4C",\u0C13:"\u0C12\u0C55",\u0C93:"\u0C12\u0C55",\u0C9C:"\u0C1C",\u0C9E:"\u0C1E",\u0C22:"\u0C21\u0323",\u0CA3:"\u0C23",\u0C25:"\u0C27\u05BC",\u0C2D:"\u0C2C\u0323",\u0CAF:"\u0C2F",\u0C20:"\u0C30\u05BC",\u0CB1:"\u0C31",\u0CB2:"\u0C32",\u0C37:"\u0C35\u0323",\u0C39:"\u0C35\u0C3E",\u0C2E:"\u0C35\u0C41","\u0C42":"\u0C41\u0C3E","\u0C44":"\u0C43\u0C3E",\u0CE1:"\u0C8C\u0CBE",\u0D08:"\u0D07\u0D57",\u0D10:"\u0D0E\u0D46",\u0D13:"\u0D12\u0D3E",\u0D14:"\u0D12\u0D57",\u0D61:"\u0D1E","\u0D6B":"\u0D26\u0D4D\u0D30","\u0D79":"\u0D28\u0D41",\u0D0C:"\u0D28\u0D41",\u0D19:"\u0D28\u0D41","\u0D6F":"\u0D28\u0D4D","\u0D7B":"\u0D28\u0D4D","\u0D6C":"\u0D28\u0D4D\u0D28","\u0D5A":"\u0D28\u0D4D\u0D2E",\u0D31:"\u0D30","\u0D6A":"\u0D30\u0D4D","\u0D7C":"\u0D30\u0D4D","\u0D6E":"\u0D35\u0D4D\u0D30","\u0D76":"\u0D39\u0D4D\u0D2E","\u0D42":"\u0D41","\u0D43":"\u0D41","\u0D48":"\u0D46\u0D46","\u0DEA":"\u0DA2","\u0DEB":"\u0DAF","\u{11413}":"\u{11434}\u{11442}\u{11412}","\u{11419}":"\u{11434}\u{11442}\u{11418}","\u{11424}":"\u{11434}\u{11442}\u{11423}","\u{1142A}":"\u{11434}\u{11442}\u{11429}","\u{1142D}":"\u{11434}\u{11442}\u{1142C}","\u{1142F}":"\u{11434}\u{11442}\u{1142E}","\u{115D8}":"\u{11582}","\u{115D9}":"\u{11582}","\u{115DA}":"\u{11583}","\u{115DB}":"\u{11584}","\u{115DC}":"\u{115B2}","\u{115DD}":"\u{115B3}",\u0E03:"\u0E02",\u0E14:"\u0E04",\u0E15:"\u0E04",\u0E21:"\u0E06",\u0E88:"\u0E08",\u0E0B:"\u0E0A",\u0E0F:"\u0E0E",\u0E17:"\u0E11",\u0E9A:"\u0E1A",\u0E9B:"\u0E1B",\u0E9D:"\u0E1D",\u0E9E:"\u0E1E",\u0E9F:"\u0E1F",\u0E26:"\u0E20",\u0E8D:"\u0E22","\u17D4":"\u0E2F",\u0E45:"\u0E32",\u0E33:"\u030A\u0E32","\u17B7":"\u0E34","\u17B8":"\u0E35","\u17B9":"\u0E36","\u17BA":"\u0E37","\u0EB8":"\u0E38","\u0EB9":"\u0E39",\u0E41:"\u0E40\u0E40",\u0EDC:"\u0EAB\u0E99",\u0EDD:"\u0EAB\u0EA1",\u0EB3:"\u030A\u0EB2","\u0F02":"\u0F60\u0F74\u0F82\u0F7F","\u0F03":"\u0F60\u0F74\u0F82\u0F14",\u0F6A:"\u0F62",\u0F00:"\u0F68\u0F7C\u0F7E","\u0F77":"\u0FB2\u0F71\u0F80","\u0F79":"\u0FB3\u0F71\u0F80","\u{11CB2}":"\u{11CAA}","\u1081":"\u1002\u103E",\u1000:"\u1002\u102C","\u1070":"\u1003\u103E","\u1066":"\u1015\u103E",\u101F:"\u1015\u102C","\u106F":"\u1015\u102C\u103E","\u107E":"\u107D\u103E",\u1029:"\u101E\u103C",\u102A:"\u101E\u103C\u1031\u102C\u103A","\u109E":"\u1083\u030A",\u17A3:"\u17A2","\u19D0":"\u199E","\u19D1":"\u19B1","\u1A80":"\u1A45","\u1A90":"\u1A45","\uAA53":"\uAA01","\uAA56":"\uAA23","\u1B52":"\u1B0D","\u1B53":"\u1B11","\u1B58":"\u1B28","\uA9A3":"\uA99D",\u1896:"\u185C",\u1855:"\u1835",\u1FF6:"\u13EF",\u140D:"\u1401\xB7",\u142B:"\u1401\u1420",\u1411:"\u1404\xB7",\u1413:"\u1405\xB7",\u142D:"\u1405\u1420",\u1415:"\u1406\xB7",\u1418:"\u140A\xB7",\u142E:"\u140A\u1420",\u141A:"\u140B\xB7","\u18DD":"\u141E\u18DF",\u14D1:"\u1421",\u1540:"\u1429",\u143F:"\u1432\xB7",\u1443:"\u1434\xB7","\u2369":"\u1435",\u1447:"\u1439\xB7",\u145C:"\u144F\xB7","\u2E27":"\u1450","\u2283":"\u1450",\u145E:"\u1450\xB7",\u1469:"\u1450'","\u27C9":"\u1450/","\u2AD7":"\u1450\u1455",\u1460:"\u1451\xB7","\u2E26":"\u1455","\u2282":"\u1455",\u1462:"\u1455\xB7",\u146A:"\u1455'",\u1464:"\u1456\xB7",\u1475:"\u146B\xB7",\u1485:"\u146B'",\u1479:"\u146E\xB7",\u147D:"\u1470\xB7",\u1603:"\u1489",\u1493:"\u1489\xB7",\u1495:"\u148B\xB7",\u1497:"\u148C\xB7",\u149B:"\u148E\xB7",\u1602:"\u1490",\u149D:"\u1490\xB7",\u149F:"\u1491\xB7",\u14AD:"\u14A3\xB7",\u14B1:"\u14A6\xB7",\u14B3:"\u14A7\xB7",\u14B5:"\u14A8\xB7",\u14B9:"\u14AB\xB7",\u14CA:"\u14C0\xB7","\u18C7":"\u14C2\xB7","\u18C9":"\u14C3\xB7","\u18CB":"\u14C4\xB7","\u18CD":"\u14C5\xB7",\u14CC:"\u14C7\xB7",\u14CE:"\u14C8\xB7",\u1604:"\u14D3",\u14DD:"\u14D3\xB7",\u14DF:"\u14D5\xB7",\u14E1:"\u14D6\xB7",\u14E3:"\u14D7\xB7",\u14E5:"\u14D8\xB7",\u1607:"\u14DA",\u14E7:"\u14DA\xB7",\u14E9:"\u14DB\xB7",\u14F7:"\u14ED\xB7",\u14F9:"\u14EF\xB7",\u14FB:"\u14F0\xB7",\u14FD:"\u14F1\xB7",\u14FF:"\u14F2\xB7",\u1501:"\u14F4\xB7",\u1503:"\u14F5\xB7",\u150C:"\u150B<",\u150E:"\u150Bb",\u150D:"\u150B\u1455",\u150F:"\u150B\u1490",\u1518:"\u1510\xB7",\u151A:"\u1511\xB7",\u151C:"\u1512\xB7",\u151E:"\u1513\xB7",\u1520:"\u1514\xB7",\u1522:"\u1515\xB7",\u1524:"\u1516\xB7",\u1532:"\u1528\xB7",\u1534:"\u1529\xB7",\u1536:"\u152A\xB7",\u1538:"\u152B\xB7",\u153A:"\u152D\xB7",\u153C:"\u152E\xB7",\u1622:"\u1543","\u18E0":"\u1543\xB7",\u1623:"\u1546",\u1624:"\u154A",\u154F:"\u154C\xB7",\u1583:"\u1550b",\u1584:"\u1550b\u0307",\u1581:"\u1550d",\u157F:"\u1550P",\u166F:"\u1550\u146B",\u157E:"\u1550\u146C",\u1580:"\u1550\u146E",\u1582:"\u1550\u1470",\u1585:"\u1550\u1483",\u155C:"\u155A\xB7","\u18E3":"\u155E\xB7","\u18E4":"\u1566\xB7",\u1569:"\u1567\xB7","\u18E5":"\u156B\xB7","\u18E8":"\u1586\xB7",\u1591:"\u1595J",\u1670:"\u1595\u1489",\u158E:"\u1595\u148A",\u158F:"\u1595\u148B",\u1590:"\u1595\u148C",\u1592:"\u1595\u148E",\u1593:"\u1595\u1490",\u1594:"\u1595\u1491",\u1673:"\u1596J",\u1671:"\u1596\u148B",\u1672:"\u1596\u148C",\u1674:"\u1596\u148E",\u1675:"\u1596\u1490",\u1676:"\u1596\u1491","\u18EA":"\u1597\xB7","\u1677":"\u15A7\xB7","\u1678":"\u15A8\xB7","\u1679":"\u15A9\xB7","\u167A":"\u15AA\xB7","\u167B":"\u15AB\xB7","\u167C":"\u15AC\xB7","\u167D":"\u15AD\xB7","\u2AAB":"\u15D2","\u2AAA":"\u15D5","\uA4F7":"\u15E1","\u18F0":"\u15F4\xB7","\u18F2":"\u161B\xB7","\u1DBB":"\u1646","\uA4ED":"\u1660","\u1DBA":"\u18D4","\u1D3E":"\u18D6","\u18DC":"\u18DF\u141E",\u02E1:"\u18F3",\u02B3:"\u18F4",\u02E2:"\u18F5","\u18DB":"\u18F5","\uA6B0":"\u16B9",\u16E1:"\u16BC","\u237F":"\u16BD",\u16C2:"\u16BD","\u{1D23F}":"\u16CB","\u2191":"\u16CF","\u21BF":"\u16D0","\u296E":"\u16D0\u21C2","\u2963":"\u16D0\u16DA","\u2D63":"\u16EF","\u21BE":"\u16DA","\u2A21":"\u16DA","\u22C4":"\u16DC","\u25C7":"\u16DC","\u25CA":"\u16DC","\u2662":"\u16DC","\u{1F754}":"\u16DC","\u{118B7}":"\u16DC","\u{10294}":"\u16DC","\u235A":"\u16DC\u0332","\u22C8":"\u16DE","\u2A1D":"\u16DE","\u{104D0}":"\u16E6","\u2195":"\u16E8","\u{10CFC}":"\u{10C82}","\u{10CFA}":"\u{10CA5}",\u3131:"\u1100",\u11A8:"\u1100",\u1101:"\u1100\u1100",\u3132:"\u1100\u1100",\u11A9:"\u1100\u1100","\u11FA":"\u1100\u1102","\u115A":"\u1100\u1103",\u11C3:"\u1100\u1105","\u11FB":"\u1100\u1107",\u11AA:"\u1100\u1109",\u3133:"\u1100\u1109",\u11C4:"\u1100\u1109\u1100","\u11FC":"\u1100\u110E","\u11FD":"\u1100\u110F","\u11FE":"\u1100\u1112",\u3134:"\u1102",\u11AB:"\u1102",\u1113:"\u1102\u1100",\u11C5:"\u1102\u1100",\u1114:"\u1102\u1102",\u3165:"\u1102\u1102","\u11FF":"\u1102\u1102",\u1115:"\u1102\u1103",\u3166:"\u1102\u1103",\u11C6:"\u1102\u1103","\uD7CB":"\u1102\u1105",\u1116:"\u1102\u1107","\u115B":"\u1102\u1109",\u11C7:"\u1102\u1109",\u3167:"\u1102\u1109","\u115C":"\u1102\u110C",\u11AC:"\u1102\u110C",\u3135:"\u1102\u110C","\uD7CC":"\u1102\u110E",\u11C9:"\u1102\u1110","\u115D":"\u1102\u1112",\u11AD:"\u1102\u1112",\u3136:"\u1102\u1112",\u11C8:"\u1102\u1140",\u3168:"\u1102\u1140",\u3137:"\u1103",\u11AE:"\u1103",\u1117:"\u1103\u1100",\u11CA:"\u1103\u1100",\u1104:"\u1103\u1103",\u3138:"\u1103\u1103","\uD7CD":"\u1103\u1103","\uD7CE":"\u1103\u1103\u1107","\u115E":"\u1103\u1105",\u11CB:"\u1103\u1105","\uA960":"\u1103\u1106","\uA961":"\u1103\u1107","\uD7CF":"\u1103\u1107","\uA962":"\u1103\u1109","\uD7D0":"\u1103\u1109","\uD7D1":"\u1103\u1109\u1100","\uA963":"\u1103\u110C","\uD7D2":"\u1103\u110C","\uD7D3":"\u1103\u110E","\uD7D4":"\u1103\u1110",\u3139:"\u1105",\u11AF:"\u1105","\uA964":"\u1105\u1100",\u11B0:"\u1105\u1100",\u313A:"\u1105\u1100","\uA965":"\u1105\u1100\u1100","\uD7D5":"\u1105\u1100\u1100",\u11CC:"\u1105\u1100\u1109",\u3169:"\u1105\u1100\u1109","\uD7D6":"\u1105\u1100\u1112",\u1118:"\u1105\u1102",\u11CD:"\u1105\u1102","\uA966":"\u1105\u1103",\u11CE:"\u1105\u1103",\u316A:"\u1105\u1103","\uA967":"\u1105\u1103\u1103",\u11CF:"\u1105\u1103\u1112",\u1119:"\u1105\u1105",\u11D0:"\u1105\u1105","\uD7D7":"\u1105\u1105\u110F","\uA968":"\u1105\u1106",\u11B1:"\u1105\u1106",\u313B:"\u1105\u1106",\u11D1:"\u1105\u1106\u1100",\u11D2:"\u1105\u1106\u1109","\uD7D8":"\u1105\u1106\u1112","\uA969":"\u1105\u1107",\u11B2:"\u1105\u1107",\u313C:"\u1105\u1107","\uD7D9":"\u1105\u1107\u1103","\uA96A":"\u1105\u1107\u1107",\u11D3:"\u1105\u1107\u1109",\u316B:"\u1105\u1107\u1109","\uA96B":"\u1105\u1107\u110B",\u11D5:"\u1105\u1107\u110B","\uD7DA":"\u1105\u1107\u1111",\u11D4:"\u1105\u1107\u1112","\uA96C":"\u1105\u1109",\u11B3:"\u1105\u1109",\u313D:"\u1105\u1109",\u11D6:"\u1105\u1109\u1109",\u111B:"\u1105\u110B","\uD7DD":"\u1105\u110B","\uA96D":"\u1105\u110C","\uA96E":"\u1105\u110F",\u11D8:"\u1105\u110F",\u11B4:"\u1105\u1110",\u313E:"\u1105\u1110",\u11B5:"\u1105\u1111",\u313F:"\u1105\u1111",\u111A:"\u1105\u1112",\u3140:"\u1105\u1112",\u113B:"\u1105\u1112",\u11B6:"\u1105\u1112","\uD7F2":"\u1105\u1112",\u11D7:"\u1105\u1140",\u316C:"\u1105\u1140","\uD7DB":"\u1105\u114C",\u11D9:"\u1105\u1159",\u316D:"\u1105\u1159","\uD7DC":"\u1105\u1159\u1112",\u3141:"\u1106",\u11B7:"\u1106","\uA96F":"\u1106\u1100",\u11DA:"\u1106\u1100","\uD7DE":"\u1106\u1102","\uD7DF":"\u1106\u1102\u1102","\uA970":"\u1106\u1103",\u11DB:"\u1106\u1105","\uD7E0":"\u1106\u1106",\u111C:"\u1106\u1107",\u316E:"\u1106\u1107",\u11DC:"\u1106\u1107","\uD7E1":"\u1106\u1107\u1109","\uA971":"\u1106\u1109",\u11DD:"\u1106\u1109",\u316F:"\u1106\u1109",\u11DE:"\u1106\u1109\u1109",\u111D:"\u1106\u110B",\u3171:"\u1106\u110B",\u11E2:"\u1106\u110B","\uD7E2":"\u1106\u110C",\u11E0:"\u1106\u110E",\u11E1:"\u1106\u1112",\u11DF:"\u1106\u1140",\u3170:"\u1106\u1140",\u3142:"\u1107",\u11B8:"\u1107",\u111E:"\u1107\u1100",\u3172:"\u1107\u1100",\u111F:"\u1107\u1102",\u1120:"\u1107\u1103",\u3173:"\u1107\u1103","\uD7E3":"\u1107\u1103",\u11E3:"\u1107\u1105","\uD7E4":"\u1107\u1105\u1111","\uD7E5":"\u1107\u1106",\u1108:"\u1107\u1107",\u3143:"\u1107\u1107","\uD7E6":"\u1107\u1107",\u112C:"\u1107\u1107\u110B",\u3179:"\u1107\u1107\u110B",\u1121:"\u1107\u1109",\u3144:"\u1107\u1109",\u11B9:"\u1107\u1109",\u1122:"\u1107\u1109\u1100",\u3174:"\u1107\u1109\u1100",\u1123:"\u1107\u1109\u1103",\u3175:"\u1107\u1109\u1103","\uD7E7":"\u1107\u1109\u1103",\u1124:"\u1107\u1109\u1107",\u1125:"\u1107\u1109\u1109",\u1126:"\u1107\u1109\u110C","\uA972":"\u1107\u1109\u1110",\u112B:"\u1107\u110B",\u3178:"\u1107\u110B",\u11E6:"\u1107\u110B",\u1127:"\u1107\u110C",\u3176:"\u1107\u110C","\uD7E8":"\u1107\u110C",\u1128:"\u1107\u110E","\uD7E9":"\u1107\u110E","\uA973":"\u1107\u110F",\u1129:"\u1107\u1110",\u3177:"\u1107\u1110",\u112A:"\u1107\u1111",\u11E4:"\u1107\u1111","\uA974":"\u1107\u1112",\u11E5:"\u1107\u1112",\u3145:"\u1109",\u11BA:"\u1109",\u112D:"\u1109\u1100",\u317A:"\u1109\u1100",\u11E7:"\u1109\u1100",\u112E:"\u1109\u1102",\u317B:"\u1109\u1102",\u112F:"\u1109\u1103",\u317C:"\u1109\u1103",\u11E8:"\u1109\u1103",\u1130:"\u1109\u1105",\u11E9:"\u1109\u1105",\u1131:"\u1109\u1106","\uD7EA":"\u1109\u1106",\u1132:"\u1109\u1107",\u317D:"\u1109\u1107",\u11EA:"\u1109\u1107",\u1133:"\u1109\u1107\u1100","\uD7EB":"\u1109\u1107\u110B",\u110A:"\u1109\u1109",\u3146:"\u1109\u1109",\u11BB:"\u1109\u1109","\uD7EC":"\u1109\u1109\u1100","\uD7ED":"\u1109\u1109\u1103","\uA975":"\u1109\u1109\u1107",\u1134:"\u1109\u1109\u1109",\u1135:"\u1109\u110B",\u1136:"\u1109\u110C",\u317E:"\u1109\u110C","\uD7EF":"\u1109\u110C",\u1137:"\u1109\u110E","\uD7F0":"\u1109\u110E",\u1138:"\u1109\u110F",\u1139:"\u1109\u1110","\uD7F1":"\u1109\u1110",\u113A:"\u1109\u1111","\uD7EE":"\u1109\u1140",\u3147:"\u110B",\u11BC:"\u110B",\u1141:"\u110B\u1100",\u11EC:"\u110B\u1100",\u11ED:"\u110B\u1100\u1100",\u1142:"\u110B\u1103","\uA976":"\u110B\u1105",\u1143:"\u110B\u1106",\u1144:"\u110B\u1107",\u1145:"\u110B\u1109",\u11F1:"\u110B\u1109",\u3182:"\u110B\u1109",\u1147:"\u110B\u110B",\u3180:"\u110B\u110B",\u11EE:"\u110B\u110B",\u1148:"\u110B\u110C",\u1149:"\u110B\u110E",\u11EF:"\u110B\u110F",\u114A:"\u110B\u1110",\u114B:"\u110B\u1111","\uA977":"\u110B\u1112",\u1146:"\u110B\u1140",\u11F2:"\u110B\u1140",\u3183:"\u110B\u1140",\u3148:"\u110C",\u11BD:"\u110C","\uD7F7":"\u110C\u1107","\uD7F8":"\u110C\u1107\u1107",\u114D:"\u110C\u110B",\u110D:"\u110C\u110C",\u3149:"\u110C\u110C","\uD7F9":"\u110C\u110C","\uA978":"\u110C\u110C\u1112",\u314A:"\u110E",\u11BE:"\u110E",\u1152:"\u110E\u110F",\u1153:"\u110E\u1112",\u314B:"\u110F",\u11BF:"\u110F",\u314C:"\u1110",\u11C0:"\u1110","\uA979":"\u1110\u1110",\u314D:"\u1111",\u11C1:"\u1111",\u1156:"\u1111\u1107",\u11F3:"\u1111\u1107","\uD7FA":"\u1111\u1109",\u1157:"\u1111\u110B",\u3184:"\u1111\u110B",\u11F4:"\u1111\u110B","\uD7FB":"\u1111\u1110","\uA97A":"\u1111\u1112",\u314E:"\u1112",\u11C2:"\u1112",\u11F5:"\u1112\u1102",\u11F6:"\u1112\u1105",\u11F7:"\u1112\u1106",\u11F8:"\u1112\u1107","\uA97B":"\u1112\u1109",\u1158:"\u1112\u1112",\u3185:"\u1112\u1112",\u113D:"\u113C\u113C",\u113F:"\u113E\u113E",\u317F:"\u1140",\u11EB:"\u1140","\uD7F3":"\u1140\u1107","\uD7F4":"\u1140\u1107\u110B",\u3181:"\u114C",\u11F0:"\u114C","\uD7F5":"\u114C\u1106","\uD7F6":"\u114C\u1112",\u114F:"\u114E\u114E",\u1151:"\u1150\u1150",\u3186:"\u1159",\u11F9:"\u1159","\uA97C":"\u1159\u1159",\u3164:"\u1160",\u314F:"\u1161","\u11A3":"\u1161\u30FC",\u1176:"\u1161\u1169",\u1177:"\u1161\u116E",\u1162:"\u1161\u4E28",\u3150:"\u1161\u4E28",\u3151:"\u1163",\u1178:"\u1163\u1169",\u1179:"\u1163\u116D","\u11A4":"\u1163\u116E",\u1164:"\u1163\u4E28",\u3152:"\u1163\u4E28",\u3153:"\u1165",\u117C:"\u1165\u30FC",\u117A:"\u1165\u1169",\u117B:"\u1165\u116E",\u1166:"\u1165\u4E28",\u3154:"\u1165\u4E28",\u3155:"\u1167","\u11A5":"\u1167\u1163",\u117D:"\u1167\u1169",\u117E:"\u1167\u116E",\u1168:"\u1167\u4E28",\u3156:"\u1167\u4E28",\u3157:"\u1169",\u116A:"\u1169\u1161",\u3158:"\u1169\u1161",\u116B:"\u1169\u1161\u4E28",\u3159:"\u1169\u1161\u4E28","\u11A6":"\u1169\u1163","\u11A7":"\u1169\u1163\u4E28",\u117F:"\u1169\u1165",\u1180:"\u1169\u1165\u4E28","\uD7B0":"\u1169\u1167",\u1181:"\u1169\u1167\u4E28",\u1182:"\u1169\u1169","\uD7B1":"\u1169\u1169\u4E28",\u1183:"\u1169\u116E",\u116C:"\u1169\u4E28",\u315A:"\u1169\u4E28",\u315B:"\u116D","\uD7B2":"\u116D\u1161","\uD7B3":"\u116D\u1161\u4E28",\u1184:"\u116D\u1163",\u3187:"\u116D\u1163",\u1186:"\u116D\u1163",\u1185:"\u116D\u1163\u4E28",\u3188:"\u116D\u1163\u4E28","\uD7B4":"\u116D\u1165",\u1187:"\u116D\u1169",\u1188:"\u116D\u4E28",\u3189:"\u116D\u4E28",\u315C:"\u116E",\u1189:"\u116E\u1161",\u118A:"\u116E\u1161\u4E28",\u116F:"\u116E\u1165",\u315D:"\u116E\u1165",\u118B:"\u116E\u1165\u30FC",\u1170:"\u116E\u1165\u4E28",\u315E:"\u116E\u1165\u4E28","\uD7B5":"\u116E\u1167",\u118C:"\u116E\u1167\u4E28",\u118D:"\u116E\u116E",\u1171:"\u116E\u4E28",\u315F:"\u116E\u4E28","\uD7B6":"\u116E\u4E28\u4E28",\u3160:"\u1172",\u118E:"\u1172\u1161","\uD7B7":"\u1172\u1161\u4E28",\u118F:"\u1172\u1165",\u1190:"\u1172\u1165\u4E28",\u1191:"\u1172\u1167",\u318A:"\u1172\u1167",\u1192:"\u1172\u1167\u4E28",\u318B:"\u1172\u1167\u4E28","\uD7B8":"\u1172\u1169",\u1193:"\u1172\u116E",\u1194:"\u1172\u4E28",\u318C:"\u1172\u4E28",\u318D:"\u119E","\uD7C5":"\u119E\u1161",\u119F:"\u119E\u1165","\uD7C6":"\u119E\u1165\u4E28",\u11A0:"\u119E\u116E",\u11A2:"\u119E\u119E",\u11A1:"\u119E\u4E28",\u318E:"\u119E\u4E28",\u30D8:"\u3078","\u2341":"\u303C","\u29C4":"\u303C","\uA49E":"\uA04A","\uA4AC":"\uA050","\uA49C":"\uA0C0","\uA4A8":"\uA132","\uA4BF":"\uA259","\uA4BE":"\uA2B1","\uA494":"\uA2CD","\uA4C0":"\uA3AB","\uA4C2":"\uA3B5","\uA4BA":"\uA3BF","\uA4B0":"\uA3C2","\uA4A7":"\uA458","\u22A5":"\uA4D5","\u27C2":"\uA4D5","\u{1D21C}":"\uA4D5","\uA7B1":"\uA4D5","\uA79E":"\uA4E4","\u2141":"\uA4E8","\u2142":"\uA4F6","\u{1D215}":"\uA4F6","\u{1D22B}":"\uA4F6","\u{16F26}":"\uA4F6","\u{10411}":"\uA4F6","\u2143":"\u{16F00}","\u{11AE6}":"\u{11AE5}\u{11AEF}","\u{11AE8}":"\u{11AE5}\u{11AE5}","\u{11AE9}":"\u{11AE5}\u{11AE5}\u{11AEF}","\u{11AEA}":"\u{11AE5}\u{11AE5}\u{11AF0}","\u{11AE7}":"\u{11AE5}\u{11AF0}","\u{11AF4}":"\u{11AF3}\u{11AEF}","\u{11AF6}":"\u{11AF3}\u{11AF3}","\u{11AF7}":"\u{11AF3}\u{11AF3}\u{11AEF}","\u{11AF8}":"\u{11AF3}\u{11AF3}\u{11AF0}","\u{11AF5}":"\u{11AF3}\u{11AF0}","\u{11AEC}":"\u{11AEB}\u{11AEF}","\u{11AED}":"\u{11AEB}\u{11AEB}","\u{11AEE}":"\u{11AEB}\u{11AEB}\u{11AEF}","\u2295":"\u{102A8}","\u2A01":"\u{102A8}","\u{1F728}":"\u{102A8}","\uA69A":"\u{102A8}","\u25BD":"\u{102BC}","\u{1D214}":"\u{102BC}","\u{1F704}":"\u{102BC}","\u29D6":"\u{102C0}","\uA79B":"\u{1043A}","\uA79A":"\u{10412}","\u{104A0}":"\u{10486}","\u{103D1}":"\u{10382}","\u{103D3}":"\u{10393}","\u{12038}":"\u{1039A}","\u2625":"\u{1099E}","\u{132F9}":"\u{1099E}","\u3039":"\u5344",\uF967:"\u4E0D","\u{2F800}":"\u4E3D","\uFA70":"\u4E26","\u239C":"\u4E28","\u239F":"\u4E28","\u23A2":"\u4E28","\u23A5":"\u4E28","\u23AA":"\u4E28","\u23AE":"\u4E28","\u31D1":"\u4E28",\u1175:"\u4E28",\u3163:"\u4E28","\u2F01":"\u4E28",\u119C:"\u4E28\u30FC",\u1198:"\u4E28\u1161",\u1199:"\u4E28\u1163","\uD7BD":"\u4E28\u1163\u1169","\uD7BE":"\u4E28\u1163\u4E28","\uD7BF":"\u4E28\u1167","\uD7C0":"\u4E28\u1167\u4E28",\u119A:"\u4E28\u1169","\uD7C1":"\u4E28\u1169\u4E28","\uD7C2":"\u4E28\u116D",\u119B:"\u4E28\u116E","\uD7C3":"\u4E28\u1172",\u119D:"\u4E28\u119E","\uD7C4":"\u4E28\u4E28",\uF905:"\u4E32","\u{2F801}":"\u4E38",\uF95E:"\u4E39","\u{2F802}":"\u4E41","\u31E0":"\u4E59","\u2F04":"\u4E59","\u31DF":"\u4E5A","\u2E83":"\u4E5A","\u31D6":"\u4E5B","\u2E82":"\u4E5B","\u2EF2":"\u4E80",\uF91B:"\u4E82","\u31DA":"\u4E85","\u2F05":"\u4E85",\uF9BA:"\u4E86",\u30CB:"\u4E8C","\u2F06":"\u4E8C","\u{2F803}":"\u{20122}","\u2F07":"\u4EA0",\uF977:"\u4EAE","\u2F08":"\u4EBA",\u30A4:"\u4EBB","\u2E85":"\u4EBB",\uF9FD:"\u4EC0","\u{2F819}":"\u4ECC",\uF9A8:"\u4EE4","\u{2F804}":"\u4F60",\u5002:"\u4F75","\u{2F807}":"\u4F75","\uFA73":"\u4F80",\uF92D:"\u4F86",\uF9B5:"\u4F8B","\uFA30":"\u4FAE","\u{2F805}":"\u4FAE","\u{2F806}":"\u4FBB",\uF965:"\u4FBF",\u503C:"\u5024",\uF9D4:"\u502B","\u{2F808}":"\u507A","\u{2F809}":"\u5099","\u{2F80B}":"\u50CF",\uF9BB:"\u50DA","\uFA31":"\u50E7","\u{2F80A}":"\u50E7","\u{2F80C}":"\u349E","\u2F09":"\u513F",\uFA0C:"\u5140","\u2E8E":"\u5140","\uFA74":"\u5145","\uFA32":"\u514D","\u{2F80E}":"\u514D","\u{2F80F}":"\u5154","\u{2F810}":"\u5164","\u2F0A":"\u5165","\u{2F814}":"\u5167","\uFA72":"\u5168",\uF978:"\u5169",\u30CF:"\u516B","\u2F0B":"\u516B",\uF9D1:"\u516D","\u{2F811}":"\u5177","\u{2F812}":"\u{2051C}","\u{2F91B}":"\u{20525}","\uFA75":"\u5180","\u{2F813}":"\u34B9","\u2F0C":"\u5182","\u{2F815}":"\u518D","\u{2F816}":"\u{2054B}","\u{2F8D2}":"\u5192","\u{2F8D3}":"\u5195","\u{2F9CA}":"\u34BB","\u{2F8D4}":"\u6700","\u2F0D":"\u5196","\u{2F817}":"\u5197","\u{2F818}":"\u51A4","\u2F0E":"\u51AB","\u{2F81A}":"\u51AC","\uFA71":"\u51B5","\u{2F81B}":"\u51B5",\uF92E:"\u51B7",\uF979:"\u51C9",\uF955:"\u51CC",\uF954:"\u51DC",\uFA15:"\u51DE","\u2F0F":"\u51E0","\u{2F80D}":"\u{2063A}","\u{2F81D}":"\u51F5","\u2F10":"\u51F5","\u2F11":"\u5200","\u2E89":"\u5202","\u{2F81E}":"\u5203",\uFA00:"\u5207","\u{2F850}":"\u5207",\uF99C:"\u5217",\uF9DD:"\u5229","\u{2F81F}":"\u34DF",\uF9FF:"\u523A","\u{2F820}":"\u523B","\u{2F821}":"\u5246","\u{2F822}":"\u5272","\u{2F823}":"\u5277",\uF9C7:"\u5289","\u{2F9D9}":"\u{20804}",\u30AB:"\u529B",\uF98A:"\u529B","\u2F12":"\u529B",\uF99D:"\u52A3","\u{2F824}":"\u3515","\u{2F992}":"\u52B3","\uFA76":"\u52C7","\u{2F825}":"\u52C7","\uFA33":"\u52C9","\u{2F826}":"\u52C9",\uF952:"\u52D2",\uF92F:"\u52DE","\uFA34":"\u52E4","\u{2F827}":"\u52E4",\uF97F:"\u52F5","\u2F13":"\u52F9","\uFA77":"\u52FA","\u{2F828}":"\u52FA","\u{2F829}":"\u5305","\u{2F82A}":"\u5306","\u{2F9DD}":"\u{208DE}","\u2F14":"\u5315",\uF963:"\u5317","\u{2F82B}":"\u5317","\u2F15":"\u531A","\u2F16":"\u5338",\uF9EB:"\u533F","\u2F17":"\u5341","\u3038":"\u5341","\u303A":"\u5345","\u{2F82C}":"\u5349","\u0FD6":"\u534D","\u0FD5":"\u5350","\uFA35":"\u5351","\u{2F82D}":"\u5351","\u{2F82E}":"\u535A",\u30C8:"\u535C","\u2F18":"\u535C","\u2F19":"\u5369","\u2E8B":"\u353E","\u{2F82F}":"\u5373",\uF91C:"\u5375","\u{2F830}":"\u537D","\u{2F831}":"\u537F","\u{2F832}":"\u537F","\u{2F833}":"\u537F","\u2F1A":"\u5382","\u{2F834}":"\u{20A2C}","\u2F1B":"\u53B6",\uF96B:"\u53C3","\u2F1C":"\u53C8","\u{2F836}":"\u53CA","\u{2F837}":"\u53DF","\u{2F838}":"\u{20B63}",\u30ED:"\u53E3","\u2F1D":"\u53E3",\u56D7:"\u53E3","\u2F1E":"\u53E3",\uF906:"\u53E5","\u{2F839}":"\u53EB","\u{2F83A}":"\u53F1","\u{2F83B}":"\u5406",\uF9DE:"\u540F",\uF9ED:"\u541D","\u{2F83D}":"\u5438",\uF980:"\u5442","\u{2F83E}":"\u5448","\u{2F83F}":"\u5468","\u{2F83C}":"\u549E","\u{2F840}":"\u54A2",\uF99E:"\u54BD",\u439B:"\u3588","\u{2F841}":"\u54F6","\u{2F842}":"\u5510","\u{2F843}":"\u5553",\u555F:"\u5553","\uFA79":"\u5555","\u{2F844}":"\u5563","\u{2F845}":"\u5584","\u{2F846}":"\u5584",\uF90B:"\u5587","\uFA7A":"\u5599","\u{2F847}":"\u5599","\uFA36":"\u559D","\uFA78":"\u559D","\u{2F848}":"\u55AB","\u{2F849}":"\u55B3",\uFA0D:"\u55C0","\u{2F84A}":"\u55C2","\uFA7B":"\u55E2","\uFA37":"\u5606","\u{2F84C}":"\u5606","\u{2F84E}":"\u5651","\u{2F84F}":"\u5674","\uFA38":"\u5668",\uF9A9:"\u56F9","\u{2F84B}":"\u5716","\u{2F84D}":"\u5717","\u2F1F":"\u571F",\u58EB:"\u571F","\u2F20":"\u571F","\u{2F855}":"\u578B","\u{2F852}":"\u57CE",\u39B3:"\u363D","\u{2F853}":"\u57F4","\u{2F854}":"\u580D","\u{2F857}":"\u5831","\u{2F856}":"\u5832","\uFA39":"\u5840",\uFA10:"\u585A","\uFA7C":"\u585A",\uF96C:"\u585E",\u586B:"\u5861",\u58FF:"\u58AB","\u{2F858}":"\u58AC","\uFA7D":"\u58B3",\uF94A:"\u58D8",\uF942:"\u58DF","\u{2F859}":"\u{214E4}","\u{2F851}":"\u58EE","\u{2F85A}":"\u58F2","\u{2F85B}":"\u58F7","\u2F21":"\u5902","\u{2F85C}":"\u5906","\u2F22":"\u590A",\u30BF:"\u5915","\u2F23":"\u5915","\u{2F85D}":"\u591A","\u{2F85E}":"\u5922","\u2F24":"\u5927","\uFA7E":"\u5944",\uF90C:"\u5948",\uF909:"\u5951","\uFA7F":"\u5954","\u{2F85F}":"\u5962",\uF981:"\u5973","\u2F25":"\u5973","\u{2F860}":"\u{216A8}","\u{2F861}":"\u{216EA}","\u{2F865}":"\u59D8","\u{2F862}":"\u59EC","\u{2F863}":"\u5A1B","\u{2F864}":"\u5A27","\uFA80":"\u5A62","\u{2F866}":"\u5A66",\u5B00:"\u5AAF","\u{2F867}":"\u36EE","\u{2F868}":"\u36FC","\u{2F986}":"\u5AB5","\u{2F869}":"\u5B08","\uFA81":"\u5B28","\u{2F86A}":"\u5B3E","\u{2F86B}":"\u5B3E","\u2F26":"\u5B50","\u2F27":"\u5B80",\uFA04:"\u5B85","\u{2F86C}":"\u{219C8}","\u{2F86D}":"\u5BC3","\u{2F86E}":"\u5BD8",\uF95F:"\u5BE7",\uF9AA:"\u5BE7","\u{2F86F}":"\u5BE7",\uF9BC:"\u5BEE","\u{2F870}":"\u5BF3","\u{2F871}":"\u{21B18}","\u2F28":"\u5BF8","\u{2F872}":"\u5BFF","\u{2F873}":"\u5C06","\u2F29":"\u5C0F","\u{2F875}":"\u5C22","\u2E90":"\u5C22","\u2F2A":"\u5C22","\u2E8F":"\u5C23","\u{2F876}":"\u3781","\u2F2B":"\u5C38",\uF9BD:"\u5C3F","\u{2F877}":"\u5C60",\uF94B:"\u5C62","\uFA3B":"\u5C64",\uF9DF:"\u5C65","\uFA3C":"\u5C6E","\u{2F878}":"\u5C6E","\u2F2C":"\u5C6E","\u{2F8F8}":"\u{21D0B}","\u2F2D":"\u5C71","\u{2F879}":"\u5CC0","\u{2F87A}":"\u5C8D","\u{2F87B}":"\u{21DE4}","\u{2F87D}":"\u{21DE6}",\uF9D5:"\u5D19","\u{2F87C}":"\u5D43",\uF921:"\u5D50","\u{2F87F}":"\u5D6B","\u{2F87E}":"\u5D6E","\u{2F880}":"\u5D7C","\u{2F9F4}":"\u5DB2",\uF9AB:"\u5DBA","\u2F2E":"\u5DDB","\u{2F882}":"\u5DE2",\u30A8:"\u5DE5","\u2F2F":"\u5DE5","\u2F30":"\u5DF1","\u2E92":"\u5DF3","\u{2F883}":"\u382F","\u{2F884}":"\u5DFD","\u2F31":"\u5DFE",\u5E32:"\u5E21","\u{2F885}":"\u5E28","\u{2F886}":"\u5E3D","\u{2F887}":"\u5E69","\u{2F888}":"\u3862","\u{2F889}":"\u{22183}","\u2F32":"\u5E72",\uF98E:"\u5E74","\u{2F939}":"\u{2219F}","\u2E93":"\u5E7A","\u2F33":"\u5E7A","\u2F34":"\u5E7F",\uFA01:"\u5EA6","\u{2F88A}":"\u387C","\u{2F88B}":"\u5EB0","\u{2F88C}":"\u5EB3","\u{2F88D}":"\u5EB6",\uF928:"\u5ECA","\u{2F88E}":"\u5ECA",\uF9A2:"\u5EC9","\uFA82":"\u5ED2",\uFA0B:"\u5ED3","\uFA83":"\u5ED9",\uF982:"\u5EEC","\u2F35":"\u5EF4","\u{2F890}":"\u5EFE","\u2F36":"\u5EFE","\u{2F891}":"\u{22331}","\u{2F892}":"\u{22331}",\uF943:"\u5F04","\u2F37":"\u5F0B","\u2F38":"\u5F13","\u{2F894}":"\u5F22","\u{2F895}":"\u5F22","\u2F39":"\u5F50","\u2E94":"\u5F51","\u{2F874}":"\u5F53","\u{2F896}":"\u38C7","\u2F3A":"\u5F61","\u{2F899}":"\u5F62","\uFA84":"\u5F69","\u{2F89A}":"\u5F6B","\u2F3B":"\u5F73",\uF9D8:"\u5F8B","\u{2F89B}":"\u38E3","\u{2F89C}":"\u5F9A",\uF966:"\u5FA9","\uFA85":"\u5FAD","\u2F3C":"\u5FC3","\u2E96":"\u5FC4","\u2E97":"\u38FA","\u{2F89D}":"\u5FCD","\u{2F89E}":"\u5FD7",\uF9A3:"\u5FF5","\u{2F89F}":"\u5FF9",\uF960:"\u6012",\uF9AC:"\u601C","\uFA6B":"\u6075","\u{2F8A2}":"\u391C","\u{2F8A1}":"\u393A","\u{2F8A0}":"\u6081","\uFA3D":"\u6094","\u{2F8A3}":"\u6094","\u{2F8A5}":"\u60C7","\uFA86":"\u60D8",\uF9B9:"\u60E1","\u{2F8A4}":"\u{226D4}","\uFA88":"\u6108","\uFA3E":"\u6168",\uF9D9:"\u6144","\u{2F8A6}":"\u6148","\u{2F8A7}":"\u614C","\u{2F8A9}":"\u614C","\uFA87":"\u614E","\u{2F8A8}":"\u614E","\uFA8A":"\u6160","\u{2F8AA}":"\u617A","\uFA3F":"\u618E","\uFA89":"\u618E","\u{2F8AB}":"\u618E",\uF98F:"\u6190","\u{2F8AD}":"\u61A4","\u{2F8AE}":"\u61AF","\u{2F8AC}":"\u61B2","\uFAD0":"\u{22844}","\uFACF":"\u{2284A}","\u{2F8AF}":"\u61DE","\uFA40":"\u61F2","\uFA8B":"\u61F2","\u{2F8B0}":"\u61F2",\uF90D:"\u61F6","\u{2F8B1}":"\u61F6",\uF990:"\u6200","\u2F3D":"\u6208","\u{2F8B2}":"\u6210","\u{2F8B3}":"\u621B",\uF9D2:"\u622E","\uFA8C":"\u6234","\u2F3E":"\u6236",\u6238:"\u6236","\u2F3F":"\u624B","\u2E98":"\u624C","\u{2F8B4}":"\u625D","\u{2F8B5}":"\u62B1",\uF925:"\u62C9",\uF95B:"\u62CF",\uFA02:"\u62D3","\u{2F8B6}":"\u62D4","\u{2F8BA}":"\u62FC",\uF973:"\u62FE","\u{2F8B8}":"\u{22B0C}","\u{2F8B9}":"\u633D","\u{2F8B7}":"\u6350","\u{2F8BB}":"\u6368",\uF9A4:"\u637B","\u{2F8BC}":"\u6383",\uF975:"\u63A0","\u{2F8C1}":"\u63A9","\uFA8D":"\u63C4","\u{2F8BD}":"\u63E4","\uFA8F":"\u6452","\u{2F8BE}":"\u{22BF1}","\uFA8E":"\u641C","\u{2F8BF}":"\u6422","\u{2F8C0}":"\u63C5","\u{2F8C3}":"\u6469","\u{2F8C6}":"\u6477","\u{2F8C4}":"\u647E","\u{2F8C2}":"\u3A2E",\u6409:"\u3A41",\uF991:"\u649A","\u{2F8C5}":"\u649D",\uF930:"\u64C4","\u{2F8C7}":"\u3A6C","\u2F40":"\u652F","\u2F41":"\u6534","\u2E99":"\u6535","\uFA41":"\u654F","\u{2F8C8}":"\u654F","\uFA90":"\u6556","\u{2F8C9}":"\u656C",\uF969:"\u6578","\u{2F8CA}":"\u{2300A}","\u2F42":"\u6587","\u2EEB":"\u6589","\u2F43":"\u6597",\uF9BE:"\u6599","\u2F44":"\u65A4","\u2F45":"\u65B9",\uF983:"\u65C5","\u2F46":"\u65E0","\u2E9B":"\u65E1","\uFA42":"\u65E2","\u{2F8CB}":"\u65E3","\u2F47":"\u65E5",\uF9E0:"\u6613",\u66F6:"\u3ADA","\u{2F8D1}":"\u3AE4","\u{2F8CD}":"\u6649",\u6669:"\u665A",\uFA12:"\u6674","\uFA91":"\u6674","\uFA43":"\u6691","\u{2F8CF}":"\u6691",\uF9C5:"\u6688","\u{2F8D0}":"\u3B08","\u{2F8D5}":"\u669C",\uFA06:"\u66B4",\uF98B:"\u66C6","\u{2F8CE}":"\u3B19","\u{2F897}":"\u{232B8}","\u2F48":"\u66F0",\uF901:"\u66F4","\u{2F8CC}":"\u66F8","\u2F49":"\u6708","\u{2F980}":"\u{2335F}",\u80A6:"\u670C",\u80D0:"\u670F",\u80CA:"\u6710",\u8101:"\u6713",\u80F6:"\u3B35",\uF929:"\u6717","\uFA92":"\u6717","\u{2F8D8}":"\u6717",\u8127:"\u6718","\uFA93":"\u671B","\u{2F8D9}":"\u671B",\u5E50:"\u3B3A",\u4420:"\u3B3B","\u{2F989}":"\u{23393}",\u81A7:"\u6723","\u{2F98A}":"\u{2339C}","\u2F4A":"\u6728",\uF9E1:"\u674E","\u{2F8DC}":"\u6753","\uFA94":"\u6756","\u{2F8DB}":"\u675E","\u{2F8DD}":"\u{233C3}",\u67FF:"\u676E",\uF9C8:"\u677B","\u{2F8E0}":"\u6785",\uF9F4:"\u6797","\u{2F8DE}":"\u3B49","\uFAD1":"\u{233D5}",\uF9C9:"\u67F3","\u{2F8DF}":"\u67FA",\uF9DA:"\u6817","\u{2F8E5}":"\u681F","\u{2F8E1}":"\u6852","\u{2F8E3}":"\u{2346D}",\uF97A:"\u6881","\uFA44":"\u6885","\u{2F8E2}":"\u6885","\u{2F8E4}":"\u688E",\uF9E2:"\u68A8","\u{2F8E6}":"\u6914","\u{2F8E8}":"\u6942","\uFAD2":"\u3B9D","\u{2F8E7}":"\u3B9D",\u69E9:"\u3BA3",\u6A27:"\u699D","\u{2F8E9}":"\u69A3","\u{2F8EA}":"\u69EA",\uF914:"\u6A02",\uF95C:"\u6A02",\uF9BF:"\u6A02",\uF94C:"\u6A13","\u{2F8EC}":"\u{236A3}","\u{2F8EB}":"\u6AA8",\uF931:"\u6AD3","\u{2F8ED}":"\u6ADB",\uF91D:"\u6B04","\u{2F8EE}":"\u3C18","\u2F4B":"\u6B20","\u{2F8EF}":"\u6B21","\u{2F8F0}":"\u{238A7}","\u{2F8F1}":"\u6B54","\u{2F8F2}":"\u3C4E","\u2F4C":"\u6B62","\u2EED":"\u6B6F","\u{2F8F3}":"\u6B72",\uF98C:"\u6B77","\uFA95":"\u6B79","\u2F4D":"\u6B79","\u2E9E":"\u6B7A","\u{2F8F4}":"\u6B9F",\uF9A5:"\u6BAE","\u2F4E":"\u6BB3",\uF970:"\u6BBA","\uFA96":"\u6BBA","\u{2F8F5}":"\u6BBA","\u{2F8F6}":"\u6BBB","\u{2F8F7}":"\u{23A8D}","\u2F4F":"\u6BCB","\u2E9F":"\u6BCD","\u{2F8F9}":"\u{23AFA}","\u2F50":"\u6BD4","\u2F51":"\u6BDB","\u2F52":"\u6C0F","\u2EA0":"\u6C11","\u2F53":"\u6C14","\u2F54":"\u6C34","\u2EA1":"\u6C35","\u2EA2":"\u6C3A","\u{2F8FA}":"\u6C4E","\u{2F8FE}":"\u6C67",\uF972:"\u6C88","\u{2F8FC}":"\u6CBF",\uF968:"\u6CCC","\u{2F8FD}":"\u6CCD",\uF9E3:"\u6CE5","\u{2F8FB}":"\u{23CBC}",\uF915:"\u6D1B",\uFA05:"\u6D1E","\u{2F907}":"\u6D34","\u{2F900}":"\u6D3E",\uF9CA:"\u6D41","\uFA97":"\u6D41","\u{2F902}":"\u6D41","\u{2F8FF}":"\u6D16","\u{2F903}":"\u6D69",\uF92A:"\u6D6A","\uFA45":"\u6D77","\u{2F901}":"\u6D77","\u{2F904}":"\u6D78","\u{2F905}":"\u6D85","\u{2F906}":"\u{23D1E}",\uF9F5:"\u6DCB",\uF94D:"\u6DDA",\uF9D6:"\u6DEA","\u{2F90E}":"\u6DF9","\uFA46":"\u6E1A","\u{2F908}":"\u6E2F","\u{2F909}":"\u6E6E",\u6F59:"\u6E88","\uFA99":"\u6ECB","\u{2F90B}":"\u6ECB",\uF9CB:"\u6E9C",\uF9EC:"\u6EBA","\u{2F90C}":"\u6EC7",\uF904:"\u6ED1","\uFA98":"\u6EDB","\u{2F90A}":"\u3D33",\uF94E:"\u6F0F","\uFA47":"\u6F22","\uFA9A":"\u6F22",\uF992:"\u6F23","\u{2F90D}":"\u{23ED1}","\u{2F90F}":"\u6F6E","\u{2F910}":"\u{23F5E}","\u{2F911}":"\u{23F8E}","\u{2F912}":"\u6FC6",\uF922:"\u6FEB",\uF984:"\u6FFE","\u{2F915}":"\u701B","\uFA9B":"\u701E","\u{2F914}":"\u701E","\u{2F913}":"\u7039","\u{2F917}":"\u704A","\u{2F916}":"\u3D96","\u2F55":"\u706B","\u2EA3":"\u706C","\u{2F835}":"\u7070","\u{2F919}":"\u7077","\u{2F918}":"\u707D",\uF9FB:"\u7099","\u{2F91A}":"\u70AD",\uF99F:"\u70C8",\uF916:"\u70D9","\uFA48":"\u716E","\uFA9C":"\u716E","\u{2F91D}":"\u{24263}","\u{2F91C}":"\u7145",\uF993:"\u7149","\uFA6C":"\u{242EE}","\u{2F91E}":"\u719C",\uF9C0:"\u71CE",\uF9EE:"\u71D0","\u{2F91F}":"\u{243AB}",\uF932:"\u7210",\uF91E:"\u721B","\u{2F920}":"\u7228","\u2F56":"\u722A","\uFA49":"\u722B","\u2EA4":"\u722B","\uFA9E":"\u7235","\u{2F921}":"\u7235","\u2F57":"\u7236","\u2F58":"\u723B","\u2EA6":"\u4E2C","\u2F59":"\u723F","\u2F5A":"\u7247","\u{2F922}":"\u7250","\u2F5B":"\u7259","\u{2F923}":"\u{24608}","\u2F5C":"\u725B",\uF946:"\u7262","\u{2F924}":"\u7280","\u{2F925}":"\u7295","\u2F5D":"\u72AC","\u2EA8":"\u72AD","\uFA9F":"\u72AF",\uF9FA:"\u72C0","\u{2F926}":"\u{24735}",\uF92B:"\u72FC",\uFA16:"\u732A","\uFAA0":"\u732A","\u{2F927}":"\u{24814}",\uF9A7:"\u7375","\u{2F928}":"\u737A","\u2F5E":"\u7384",\uF961:"\u7387",\uF9DB:"\u7387","\u2F5F":"\u7389","\u{2F929}":"\u738B","\u{2F92A}":"\u3EAC","\u{2F92B}":"\u73A5",\uF9AD:"\u73B2","\u{2F92C}":"\u3EB8","\u{2F92D}":"\u3EB8",\uF917:"\u73DE",\uF9CC:"\u7409",\uF9E4:"\u7406","\uFA4A":"\u7422","\u{2F92E}":"\u7447","\u{2F92F}":"\u745C",\uF9AE:"\u7469","\uFAA1":"\u7471","\u{2F930}":"\u7471","\u{2F931}":"\u7485",\uF994:"\u7489",\uF9EF:"\u7498","\u{2F932}":"\u74CA","\u2F60":"\u74DC","\u2F61":"\u74E6","\u{2F933}":"\u3F1B","\uFAA2":"\u7506","\u2F62":"\u7518","\u2F63":"\u751F","\u{2F934}":"\u7524","\u2F64":"\u7528","\u2F65":"\u7530","\uFAA3":"\u753B","\u{2F936}":"\u753E","\u{2F935}":"\u{24C36}",\uF9CD:"\u7559",\uF976:"\u7565",\uF962:"\u7570","\u{2F938}":"\u7570","\u{2F937}":"\u{24C92}","\u2F66":"\u758B","\u2F67":"\u7592",\uF9E5:"\u75E2","\u{2F93A}":"\u7610","\uFAA5":"\u761F","\uFAA4":"\u761D",\uF9C1:"\u7642",\uF90E:"\u7669","\u2F68":"\u7676","\u2F69":"\u767D","\u{2F93B}":"\u{24FA1}","\u{2F93C}":"\u{24FB8}","\u2F6A":"\u76AE","\u2F6B":"\u76BF","\u{2F93D}":"\u{25044}","\u{2F93E}":"\u3FFC",\uFA17:"\u76CA","\uFAA6":"\u76CA","\uFAA7":"\u76DB",\uF933:"\u76E7","\u{2F93F}":"\u4008","\u2F6C":"\u76EE","\uFAA8":"\u76F4","\u{2F940}":"\u76F4","\u{2F942}":"\u{250F2}","\u{2F941}":"\u{250F3}",\uF96D:"\u7701","\uFAD3":"\u4018","\u{2F943}":"\u{25119}","\u{2F945}":"\u771E","\u{2F946}":"\u771F","\u{2F947}":"\u771F","\u{2F944}":"\u{25133}","\uFAAA":"\u7740","\uFAA9":"\u774A","\u{2F948}":"\u774A","\u9FC3":"\u4039","\uFAD4":"\u4039","\u{2F949}":"\u4039",\u6663:"\u403F","\u{2F94B}":"\u4046","\u{2F94A}":"\u778B","\uFAD5":"\u{25249}","\uFA9D":"\u77A7","\u2F6D":"\u77DB","\u2F6E":"\u77E2","\u2F6F":"\u77F3","\u{2F94C}":"\u4096","\u{2F94D}":"\u{2541D}",\u784F:"\u7814","\u{2F94E}":"\u784E",\uF9CE:"\u786B",\uF93B:"\u788C","\u{2F94F}":"\u788C","\uFA4B":"\u7891",\uF947:"\u78CA","\uFAAB":"\u78CC","\u{2F950}":"\u78CC",\uF964:"\u78FB","\u{2F951}":"\u40E3",\uF985:"\u792A","\u2F70":"\u793A","\u2EAD":"\u793B",\uFA18:"\u793C","\uFA4C":"\u793E","\uFA4E":"\u7948","\uFA4D":"\u7949","\u{2F952}":"\u{25626}","\uFA4F":"\u7950","\uFA50":"\u7956","\u{2F953}":"\u7956","\uFA51":"\u795D",\uFA19:"\u795E",\uFA1A:"\u7965","\uFA61":"\u8996","\uFAB8":"\u8996",\uF93C:"\u797F","\u{2F954}":"\u{2569A}","\uFA52":"\u798D","\uFA53":"\u798E",\uFA1B:"\u798F","\u{2F956}":"\u798F","\u{2F955}":"\u{256C5}",\uF9B6:"\u79AE","\u2F71":"\u79B8","\u2F72":"\u79BE",\uF995:"\u79CA","\u{2F958}":"\u412F","\u{2F957}":"\u79EB",\uF956:"\u7A1C","\u{2F95A}":"\u7A4A","\uFA54":"\u7A40","\u{2F959}":"\u7A40","\u{2F95B}":"\u7A4F","\u2F73":"\u7A74","\uFA55":"\u7A81","\u{2F95C}":"\u{2597C}","\uFAAC":"\u7AB1",\uF9F7:"\u7ACB","\u2F74":"\u7ACB","\u2EEF":"\u7ADC","\u{2F95D}":"\u{25AA7}","\u{2F95E}":"\u{25AA7}","\u{2F95F}":"\u7AEE","\u2F75":"\u7AF9",\uF9F8:"\u7B20","\uFA56":"\u7BC0","\uFAAD":"\u7BC0","\u{2F960}":"\u4202","\u{2F961}":"\u{25BAB}","\u{2F962}":"\u7BC6","\u{2F964}":"\u4227","\u{2F963}":"\u7BC9","\u{2F965}":"\u{25C80}","\uFAD6":"\u{25CD0}",\uF9A6:"\u7C3E",\uF944:"\u7C60","\u2F76":"\u7C73","\uFAAE":"\u7C7B",\uF9F9:"\u7C92",\uFA1D:"\u7CBE","\u{2F966}":"\u7CD2",\uFA03:"\u7CD6","\u{2F968}":"\u7CE8","\u{2F967}":"\u42A0","\u{2F969}":"\u7CE3",\uF97B:"\u7CE7","\u2F77":"\u7CF8","\u2EAF":"\u7CF9","\u{2F96B}":"\u{25F86}","\u{2F96A}":"\u7D00",\uF9CF:"\u7D10",\uF96A:"\u7D22",\uF94F:"\u7D2F",\u7D76:"\u7D55","\u{2F96C}":"\u7D63","\uFAAF":"\u7D5B",\uF93D:"\u7DA0",\uF957:"\u7DBE","\u{2F96E}":"\u7DC7",\uF996:"\u7DF4","\uFA57":"\u7DF4","\uFAB0":"\u7DF4","\u{2F96F}":"\u7E02","\u{2F96D}":"\u4301","\uFA58":"\u7E09",\uF950:"\u7E37","\uFA59":"\u7E41","\u{2F970}":"\u7E45","\u{2F898}":"\u{261DA}","\u{2F971}":"\u4334","\u2F78":"\u7F36","\u{2F972}":"\u{26228}","\uFAB1":"\u7F3E","\u{2F973}":"\u{26247}","\u2F79":"\u7F51","\u2EAB":"\u7F52","\u2EB2":"\u7F52","\u2EB1":"\u7F53","\u{2F974}":"\u4359","\uFA5A":"\u7F72","\u{2F975}":"\u{262D9}",\uF9E6:"\u7F79","\u{2F976}":"\u7F7A",\uF90F:"\u7F85","\u{2F977}":"\u{2633E}","\u2F7A":"\u7F8A","\u{2F978}":"\u7F95",\uF9AF:"\u7F9A",\uFA1E:"\u7FBD","\u2F7B":"\u7FBD","\u{2F979}":"\u7FFA",\uF934:"\u8001","\u2F7C":"\u8001","\u2EB9":"\u8002","\uFA5B":"\u8005","\uFAB2":"\u8005","\u{2F97A}":"\u8005","\u2F7D":"\u800C","\u{2F97B}":"\u{264DA}","\u2F7E":"\u8012","\u{2F97C}":"\u{26523}","\u2F7F":"\u8033",\uF9B0:"\u8046","\u{2F97D}":"\u8060","\u{2F97E}":"\u{265A8}",\uF997:"\u806F","\u{2F97F}":"\u8070",\uF945:"\u807E","\u2F80":"\u807F","\u2EBA":"\u8080","\u2F81":"\u8089",\uF953:"\u808B","\u{2F8D6}":"\u80AD","\u{2F982}":"\u80B2","\u{2F981}":"\u43D5","\u{2F8D7}":"\u43D9",\u8141:"\u80FC","\u{2F983}":"\u8103","\u{2F985}":"\u813E","\u{2F984}":"\u440B","\u{2F8DA}":"\u6721","\u{2F987}":"\u{267A7}","\u{2F988}":"\u{267B5}",\u6726:"\u4443",\uF926:"\u81D8","\u2F82":"\u81E3",\uF9F6:"\u81E8","\u2F83":"\u81EA","\uFA5C":"\u81ED","\u2F84":"\u81F3","\u2F85":"\u81FC","\u{2F893}":"\u8201","\u{2F98B}":"\u8201","\u{2F98C}":"\u8204","\u2F86":"\u820C","\uFA6D":"\u8218","\u2F87":"\u821B","\u2F88":"\u821F","\u{2F98E}":"\u446B","\u2F89":"\u826E",\uF97C:"\u826F","\u2F8A":"\u8272","\u2F8B":"\u8278","\uFA5D":"\u8279","\uFA5E":"\u8279","\u2EBE":"\u8279","\u2EBF":"\u8279","\u2EC0":"\u8279","\u{2F990}":"\u828B","\u{2F98F}":"\u8291","\u{2F991}":"\u829D","\u{2F993}":"\u82B1","\u{2F994}":"\u82B3","\u{2F995}":"\u82BD",\uF974:"\u82E5","\u{2F998}":"\u82E5","\u{2F996}":"\u82E6","\u{2F997}":"\u{26B3C}",\uF9FE:"\u8336","\uFAB3":"\u8352","\u{2F99A}":"\u8363","\u{2F999}":"\u831D","\u{2F99C}":"\u8323","\u{2F99D}":"\u83BD","\u{2F9A0}":"\u8353",\uF93E:"\u83C9","\u{2F9A1}":"\u83CA","\u{2F9A2}":"\u83CC","\u{2F9A3}":"\u83DC","\u{2F99E}":"\u83E7","\uFAB4":"\u83EF",\uF958:"\u83F1","\uFA5F":"\u8457","\u{2F99F}":"\u8457","\u{2F9A4}":"\u{26C36}","\u{2F99B}":"\u83AD",\uF918:"\u843D",\uF96E:"\u8449",\u853F:"\u848D","\u{2F9A6}":"\u{26CD5}","\u{2F9A5}":"\u{26D6B}",\uF999:"\u84EE","\u{2F9A8}":"\u84F1","\u{2F9A9}":"\u84F3",\uF9C2:"\u84FC","\u{2F9AA}":"\u8516","\u{2F9A7}":"\u452B","\u{2F9AC}":"\u8564","\u{2F9AD}":"\u{26F2C}",\uF923:"\u85CD","\u{2F9AE}":"\u455D","\u{2F9B0}":"\u{26FB1}","\u{2F9AF}":"\u4561",\uF9F0:"\u85FA",\uF935:"\u8606","\u{2F9B2}":"\u456B",\uFA20:"\u8612",\uF91F:"\u862D","\u{2F9B1}":"\u{270D2}",\u8641:"\u8637",\uF910:"\u863F","\u2F8C":"\u864D","\u2EC1":"\u864E","\u{2F9B3}":"\u8650",\uF936:"\u865C","\u{2F9B4}":"\u865C","\u{2F9B5}":"\u8667","\u{2F9B6}":"\u8669","\u2F8D":"\u866B","\u{2F9B7}":"\u86A9","\u{2F9B8}":"\u8688","\u{2F9BA}":"\u86E2","\u{2F9B9}":"\u870E","\u{2F9BC}":"\u8728","\u{2F9BD}":"\u876B","\u{2F9C0}":"\u87E1","\uFAB5":"\u8779","\u{2F9BB}":"\u8779","\u{2F9BE}":"\u8786","\u{2F9BF}":"\u45D7","\u{2F9AB}":"\u{273CA}",\uF911:"\u87BA","\u{2F9C1}":"\u8801","\u{2F9C2}":"\u45F9",\uF927:"\u881F","\u2F8E":"\u8840",\uFA08:"\u884C","\u2F8F":"\u884C","\u{2F9C3}":"\u8860","\u{2F9C4}":"\u8863","\u2F90":"\u8863","\u2EC2":"\u8864",\uF9A0:"\u88C2","\u{2F9C5}":"\u{27667}",\uF9E7:"\u88CF","\u{2F9C6}":"\u88D7","\u{2F9C7}":"\u88DE",\uF9E8:"\u88E1",\uF912:"\u88F8","\u{2F9C9}":"\u88FA","\u{2F9C8}":"\u4635","\uFA60":"\u8910","\uFAB6":"\u8941",\uF924:"\u8964","\u2F91":"\u897E","\u2EC4":"\u897F","\u2EC3":"\u8980","\uFAB7":"\u8986",\uFA0A:"\u898B","\u2F92":"\u898B","\u{2F9CB}":"\u{278AE}","\u2EC5":"\u89C1","\u2F93":"\u89D2","\u2F94":"\u8A00","\u{2F9CC}":"\u{27966}",\u8A7D:"\u8A2E",\u8A1E:"\u46B6","\u{2F9CD}":"\u46BE","\u{2F9CE}":"\u46C7","\u{2F9CF}":"\u8AA0",\uF96F:"\u8AAA",\uF9A1:"\u8AAA","\uFAB9":"\u8ABF","\uFABB":"\u8ACB",\uF97D:"\u8AD2",\uF941:"\u8AD6","\uFABE":"\u8AED","\u{2F9D0}":"\u8AED",\uFA22:"\u8AF8","\uFABA":"\u8AF8",\uF95D:"\u8AFE","\uFABD":"\u8AFE","\uFA62":"\u8B01","\uFABC":"\u8B01","\uFA63":"\u8B39","\uFABF":"\u8B39",\uF9FC:"\u8B58",\uF95A:"\u8B80",\u8B8F:"\u8B86","\uFAC0":"\u8B8A","\u{2F9D1}":"\u8B8A","\u2EC8":"\u8BA0","\u2F95":"\u8C37","\u2F96":"\u8C46",\uF900:"\u8C48","\u{2F9D2}":"\u8C55","\u2F97":"\u8C55",\u8C63:"\u8C5C","\u2F98":"\u8C78","\u{2F9D3}":"\u{27CA8}","\u2F99":"\u8C9D","\u{2F9D4}":"\u8CAB","\u{2F9D5}":"\u8CC1",\uF948:"\u8CC2",\uF903:"\u8CC8","\uFA64":"\u8CD3","\uFA65":"\u8D08","\uFAC1":"\u8D08","\u{2F9D6}":"\u8D1B","\u2EC9":"\u8D1D","\u2F9A":"\u8D64","\u2F9B":"\u8D70","\u{2F9D7}":"\u8D77",\u8D86:"\u8D7F","\uFAD7":"\u{27ED3}","\u{2F9D8}":"\u{27F2F}","\u2F9C":"\u8DB3","\u{2F9DA}":"\u8DCB","\u{2F9DB}":"\u8DBC",\u8DFA:"\u8DE5",\uF937:"\u8DEF","\u{2F9DC}":"\u8DF0",\u8E9B:"\u8E97","\u2F9D":"\u8EAB",\uF902:"\u8ECA","\u2F9E":"\u8ECA","\u{2F9DE}":"\u8ED4",\u8F27:"\u8EFF",\uF998:"\u8F26",\uF9D7:"\u8F2A","\uFAC2":"\u8F38","\u{2F9DF}":"\u8F38",\uFA07:"\u8F3B",\uF98D:"\u8F62","\u2ECB":"\u8F66","\u2F9F":"\u8F9B","\u{2F98D}":"\u8F9E",\uF971:"\u8FB0","\u2FA0":"\u8FB0","\u2FA1":"\u8FB5","\uFA66":"\u8FB6","\u2ECC":"\u8FB6","\u2ECD":"\u8FB6","\u{2F881}":"\u5DE1",\uF99A:"\u9023",\uFA25:"\u9038","\uFA67":"\u9038","\uFAC3":"\u9072",\uF9C3:"\u907C","\u{2F9E0}":"\u{285D2}","\u{2F9E1}":"\u{285ED}",\uF913:"\u908F","\u2FA2":"\u9091","\u{2F9E2}":"\u9094",\uF92C:"\u90CE",\u90DE:"\u90CE","\uFA2E":"\u90CE","\u{2F9E3}":"\u90F1",\uFA26:"\u90FD","\u{2F9E5}":"\u{2872E}","\u{2F9E4}":"\u9111","\u{2F9E6}":"\u911B","\u2FA3":"\u9149",\uF919:"\u916A","\uFAC4":"\u9199",\uF9B7:"\u91B4","\u2FA4":"\u91C6",\uF9E9:"\u91CC","\u2FA5":"\u91CC",\uF97E:"\u91CF",\uF90A:"\u91D1","\u2FA6":"\u91D1",\uF9B1:"\u9234","\u{2F9E7}":"\u9238","\uFAC5":"\u9276","\u{2F9E8}":"\u92D7","\u{2F9E9}":"\u92D8","\u{2F9EA}":"\u927C",\uF93F:"\u9304",\uF99B:"\u934A",\u93AE:"\u93AD","\u{2F9EB}":"\u93F9","\u{2F9EC}":"\u9415","\u{2F9ED}":"\u{28BFA}","\u2ED0":"\u9485","\u2ED1":"\u9577","\u2FA7":"\u9577","\u2ED2":"\u9578","\u2ED3":"\u957F","\u2FA8":"\u9580","\u{2F9EE}":"\u958B","\u{2F9EF}":"\u4995",\uF986:"\u95AD","\u{2F9F0}":"\u95B7","\u{2F9F1}":"\u{28D77}","\u2ED4":"\u95E8","\u2FA9":"\u961C","\u2ECF":"\u961D","\u2ED6":"\u961D",\uF9C6:"\u962E",\uF951:"\u964B",\uFA09:"\u964D",\uF959:"\u9675",\uF9D3:"\u9678","\uFAC6":"\u967C",\uF9DC:"\u9686",\uF9F1:"\u96A3","\u{2F9F2}":"\u49E6","\u2FAA":"\u96B6","\uFA2F":"\u96B7",\u96B8:"\u96B7",\uF9B8:"\u96B7","\u2FAB":"\u96B9","\u{2F9F3}":"\u96C3",\uF9EA:"\u96E2","\uFA68":"\u96E3","\uFAC7":"\u96E3","\u2FAC":"\u96E8",\uF9B2:"\u96F6",\uF949:"\u96F7","\u{2F9F5}":"\u9723","\u{2F9F6}":"\u{29145}",\uF938:"\u9732",\uF9B3:"\u9748","\u2FAD":"\u9751","\u2ED8":"\u9752",\uFA1C:"\u9756","\uFAC8":"\u9756","\u{2F81C}":"\u{291DF}","\u2FAE":"\u975E","\u2FAF":"\u9762","\u{2F9F7}":"\u{2921A}","\u2FB0":"\u9769","\u{2F9F8}":"\u4A6E","\u{2F9F9}":"\u4A76","\u2FB1":"\u97CB","\uFAC9":"\u97DB","\u{2F9FA}":"\u97E0","\u2ED9":"\u97E6","\u2FB2":"\u97ED","\u{2F9FB}":"\u{2940A}","\u2FB3":"\u97F3","\uFA69":"\u97FF","\uFACA":"\u97FF","\u2FB4":"\u9801","\u{2F9FC}":"\u4AB2","\uFACB":"\u980B","\u{2F9FE}":"\u980B","\u{2F9FF}":"\u980B",\uF9B4:"\u9818","\u{2FA00}":"\u9829","\u{2F9FD}":"\u{29496}","\uFA6A":"\u983B","\uFACC":"\u983B",\uF9D0:"\u985E","\u2EDA":"\u9875","\u2FB5":"\u98A8","\u{2FA01}":"\u{295B6}","\u2EDB":"\u98CE","\u2FB6":"\u98DB","\u2EDC":"\u98DE","\u2EDD":"\u98DF","\u2FB7":"\u98DF","\u2EDF":"\u98E0","\u{2FA02}":"\u98E2",\uFA2A:"\u98EF",\uFA2B:"\u98FC","\u{2FA03}":"\u4B33",\uFA2C:"\u9928","\u{2FA04}":"\u9929","\u2EE0":"\u9963","\u2FB8":"\u9996","\u2FB9":"\u9999","\u{2FA05}":"\u99A7","\u2FBA":"\u99AC","\u{2FA06}":"\u99C2",\uF91A:"\u99F1","\u{2FA07}":"\u99FE",\uF987:"\u9A6A","\u2EE2":"\u9A6C","\u2FBB":"\u9AA8","\u{2FA08}":"\u4BCE","\u2FBC":"\u9AD8","\u2FBD":"\u9ADF","\u{2FA09}":"\u{29B30}","\uFACD":"\u9B12","\u{2FA0A}":"\u9B12","\u2FBE":"\u9B25","\u2FBF":"\u9B2F","\u2FC0":"\u9B32","\u2FC1":"\u9B3C","\u2EE4":"\u9B3C","\u2FC2":"\u9B5A",\uF939:"\u9B6F","\u{2FA0B}":"\u9C40",\uF9F2:"\u9C57","\u2EE5":"\u9C7C","\u2FC3":"\u9CE5","\u{2FA0C}":"\u9CFD","\u{2FA0D}":"\u4CCE","\u{2FA0F}":"\u9D67","\u{2FA0E}":"\u4CED","\u{2FA10}":"\u{2A0CE}",\uFA2D:"\u9DB4","\u{2FA12}":"\u{2A105}","\u{2FA11}":"\u4CF8",\uF93A:"\u9DFA","\u{2FA13}":"\u{2A20E}",\uF920:"\u9E1E",\u9E43:"\u9E42","\u2FC4":"\u9E75",\uF940:"\u9E7F","\u2FC5":"\u9E7F","\u{2FA14}":"\u{2A291}",\uF988:"\u9E97",\uF9F3:"\u9E9F","\u2FC6":"\u9EA5","\u2EE8":"\u9EA6","\u{2FA15}":"\u9EBB","\u2FC7":"\u9EBB","\u{2F88F}":"\u{2A392}","\u2FC8":"\u9EC3","\u2EE9":"\u9EC4","\u2FC9":"\u9ECD",\uF989:"\u9ECE","\u{2FA16}":"\u4D56","\u2FCA":"\u9ED1",\u9ED2:"\u9ED1","\uFA3A":"\u58A8","\u{2FA17}":"\u9EF9","\u2FCB":"\u9EF9","\u2FCC":"\u9EFD","\u{2FA19}":"\u9F05","\u{2FA18}":"\u9EFE","\u2FCD":"\u9F0E","\u{2FA1A}":"\u9F0F","\u2FCE":"\u9F13","\u{2FA1B}":"\u9F16","\u2FCF":"\u9F20","\u{2FA1C}":"\u9F3B","\u2FD0":"\u9F3B","\uFAD8":"\u9F43","\u2FD1":"\u9F4A","\u2EEC":"\u9F50","\u2FD2":"\u9F52","\u{2FA1D}":"\u{2A600}","\u2EEE":"\u9F7F",\uF9C4:"\u9F8D","\u2FD3":"\u9F8D","\uFAD9":"\u9F8E","\u2EF0":"\u9F99",\uF907:"\u9F9C",\uF908:"\u9F9C","\uFACE":"\u9F9C","\u2FD4":"\u9F9C","\u2EF3":"\u9F9F","\u2FD5":"\u9FA0"},Hy=ew;function tw(n){return n.replace(/([.?*+^$[\]\\(){}|-])/g,"\\$1")}var rw=RegExp(Object.keys(Hy).map(tw).join("|"),"g");function nw(n){return Hy[n]}function iw(n){return n.replace(rw,nw)}var sw=iw,Xa={exports:{}},Yy={};function Nr(n,e){typeof e=="boolean"&&(e={forever:e}),this._originalTimeouts=JSON.parse(JSON.stringify(n)),this._timeouts=n,this._options=e||{},this._maxRetryTime=e&&e.maxRetryTime||1/0,this._fn=null,this._errors=[],this._attempts=1,this._operationTimeout=null,this._operationTimeoutCb=null,this._timeout=null,this._operationStart=null,this._timer=null,this._options.forever&&(this._cachedTimeouts=this._timeouts.slice(0))}var ow=Nr;Nr.prototype.reset=function(){this._attempts=1,this._timeouts=this._originalTimeouts.slice(0)};Nr.prototype.stop=function(){this._timeout&&clearTimeout(this._timeout),this._timer&&clearTimeout(this._timer),this._timeouts=[],this._cachedTimeouts=null};Nr.prototype.retry=function(n){if(this._timeout&&clearTimeout(this._timeout),!n)return!1;var e=new Date().getTime();if(n&&e-this._operationStart>=this._maxRetryTime)return this._errors.push(n),this._errors.unshift(new Error("RetryOperation timeout occurred")),!1;this._errors.push(n);var t=this._timeouts.shift();if(t===void 0)if(this._cachedTimeouts)this._errors.splice(0,this._errors.length-1),t=this._cachedTimeouts.slice(-1);else return!1;var r=this;return this._timer=setTimeout(function(){r._attempts++,r._operationTimeoutCb&&(r._timeout=setTimeout(function(){r._operationTimeoutCb(r._attempts)},r._operationTimeout),r._options.unref&&r._timeout.unref()),r._fn(r._attempts)},t),this._options.unref&&this._timer.unref(),!0};Nr.prototype.attempt=function(n,e){this._fn=n,e&&(e.timeout&&(this._operationTimeout=e.timeout),e.cb&&(this._operationTimeoutCb=e.cb));var t=this;this._operationTimeoutCb&&(this._timeout=setTimeout(function(){t._operationTimeoutCb()},t._operationTimeout)),this._operationStart=new Date().getTime(),this._fn(this._attempts)};Nr.prototype.try=function(n){console.log("Using RetryOperation.try() is deprecated"),this.attempt(n)};Nr.prototype.start=function(n){console.log("Using RetryOperation.start() is deprecated"),this.attempt(n)};Nr.prototype.start=Nr.prototype.try;Nr.prototype.errors=function(){return this._errors};Nr.prototype.attempts=function(){return this._attempts};Nr.prototype.mainError=function(){if(this._errors.length===0)return null;for(var n={},e=null,t=0,r=0;r<this._errors.length;r++){var i=this._errors[r],s=i.message,o=(n[s]||0)+1;n[s]=o,o>=t&&(e=i,t=o)}return e};(function(n){var e=ow;n.operation=function(t){var r=n.timeouts(t);return new e(r,{forever:t&&(t.forever||t.retries===1/0),unref:t&&t.unref,maxRetryTime:t&&t.maxRetryTime})},n.timeouts=function(t){if(t instanceof Array)return[].concat(t);var r={retries:10,factor:2,minTimeout:1*1e3,maxTimeout:1/0,randomize:!1};for(var i in t)r[i]=t[i];if(r.minTimeout>r.maxTimeout)throw new Error("minTimeout is greater than maxTimeout");for(var s=[],o=0;o<r.retries;o++)s.push(this.createTimeout(o,r));return t&&t.forever&&!s.length&&s.push(this.createTimeout(o,r)),s.sort(function(a,l){return a-l}),s},n.createTimeout=function(t,r){var i=r.randomize?Math.random()+1:1,s=Math.round(i*Math.max(r.minTimeout,1)*Math.pow(r.factor,t));return s=Math.min(s,r.maxTimeout),s},n.wrap=function(t,r,i){if(r instanceof Array&&(i=r,r=null),!i){i=[];for(var s in t)typeof t[s]=="function"&&i.push(s)}for(var o=0;o<i.length;o++){var a=i[o],l=t[a];t[a]=function(c){var g=n.operation(r),m=Array.prototype.slice.call(arguments,1),f=m.pop();m.push(function(E){g.retry(E)||(E&&(arguments[0]=g.mainError()),f.apply(this,arguments))}),g.attempt(function(){c.apply(t,m)})}.bind(t,l),t[a].options=r}}})(Yy);var aw=Yy;const cw=aw,lw=["Failed to fetch","NetworkError when attempting to fetch resource.","The Internet connection appears to be offline.","Network request failed"];class zy 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 uw=(n,e,t)=>{const r=t.retries-(e-1);return n.attemptNumber=e,n.retriesLeft=r,n},dw=n=>lw.includes(n),Jy=(n,e)=>new Promise((t,r)=>{e=gc({onFailedAttempt:()=>{},retries:10},e);const i=cw.operation(e);i.attempt(async s=>{try{t(await n(s))}catch(o){if(!(o instanceof Error)){r(new TypeError(`Non-error was thrown: "${o}". You should only throw errors.`));return}if(o instanceof zy)i.stop(),r(o.originalError);else if(o instanceof TypeError&&!dw(o.message))i.stop(),r(o);else{uw(o,s,e);try{await e.onFailedAttempt(o)}catch(a){r(a);return}i.retry(o)||r(i.mainError())}}})});Xa.exports=Jy;Xa.exports.default=Jy;Xa.exports.AbortError=zy;var Xy=G.exports;Object.defineProperty(W,"__esModule",{value:!0});W.DEFAULT_ALPHABET=void 0;W.alphabetPad=Bd;W.averageBetweenStrings=Bw;W.baseToString=Io;W.checkObjectHasKeys=_w;W.checkObjectHasNoAdditionalKeys=Ew;W.chunkPromises=Uw;W.compare=jw;W.decodeParams=gw;W.deepCompare=Ld;W.deepCopy=Sw;W.deepSortedObjectEntries=Qy;W.defer=Aw;W.encodeParams=pw;W.encodeUri=mw;W.ensureNoTrailingSlash=Cw;W.escapeRegExp=ev;W.getCrypto=Lw;W.globToRegexp=kw;W.inherits=bw;W.isFunction=vw;W.isNullOrUndefined=Mw;W.isNumber=Rw;W.lexicographicCompare=rv;W.nextString=Kw;W.normalize=Tw;W.polyfillSuper=ww;W.prevString=Fw;W.promiseMapSeries=Dw;W.promiseTry=xw;W.recursivelyAssign=nv;W.removeDirectionOverrideChars=Iw;W.removeElement=yw;W.removeHiddenChars=Zy;W.setCrypto=Nw;W.simpleRetryOperation=$w;W.sleep=Pw;W.stringToBase=La;var hw=Xy(sw),fw=Xy(Xa.exports);function pw(n){const e=new URLSearchParams;for(const[t,r]of Object.entries(n))r!=null&&e.set(t,String(r));return e.toString()}function gw(n){const e={},t=new URLSearchParams(n);for(const r of t.keys()){const i=t.getAll(r);e[r]=i.length===1?i[0]:i}return e}function mw(n,e){for(const t in e)!e.hasOwnProperty(t)||(n=n.replace(t,encodeURIComponent(e[t])));return n}function yw(n,e,t){let r;if(t){for(r=n.length-1;r>=0;r--)if(e(n[r],r,n))return n.splice(r,1),!0}else for(r=0;r<n.length;r++)if(e(n[r],r,n))return n.splice(r,1),!0;return!1}function vw(n){return Object.prototype.toString.call(n)==="[object Function]"}function _w(n,e){for(let t=0;t<e.length;t++)if(!n.hasOwnProperty(e[t]))throw new Error("Missing required key: "+e[t])}function Ew(n,e){for(const t in n)if(!!n.hasOwnProperty(t)&&e.indexOf(t)===-1)throw new Error("Unknown key: "+t)}function Sw(n){return JSON.parse(JSON.stringify(n))}function Ld(n,e){if(n===e)return!0;if(typeof n!=typeof e)return!1;if(typeof n=="number"&&isNaN(n)&&isNaN(e))return!0;if(n===null||e===null)return n===e;if(!(n instanceof Object)||n.constructor!==e.constructor||n.prototype!==e.prototype)return!1;if(n instanceof RegExp||n instanceof Date)return n.toString()===e.toString();if(n instanceof Array){if(n.length!==e.length)return!1;for(let t=0;t<n.length;t++)if(!Ld(n[t],e[t]))return!1}else{let t;for(t in e)if(e.hasOwnProperty(t)!==n.hasOwnProperty(t))return!1;for(t in e)if(e.hasOwnProperty(t)!==n.hasOwnProperty(t)||!Ld(n[t],e[t]))return!1}return!0}function Qy(n){if(typeof n!="object"||n==null||Array.isArray(n))return n;const e=[];for(const[t,r]of Object.entries(n))e.push([t,Qy(r)]);return e.sort((t,r)=>rv(t[0],r[0])),e}function bw(n,e){n.super_=e,n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}})}function ww(n,e,...t){try{e.call(n,...t)}catch{const i=new e(...t);Object.assign(n,i)}}function Rw(n){return typeof n=="number"&&isFinite(n)}function Zy(n){return typeof n=="string"?(0,hw.default)(n.normalize("NFD").replace(Ow,"")):""}function Iw(n){return typeof n=="string"?n.replace(/[\u202d-\u202e]/g,""):""}function Tw(n){return Zy(n.toLowerCase()).replace(/[\\'!"#$%&()*+,\-./:;<=>?@[\]^_`{|}~\u2000-\u206f\u2e00-\u2e7f]/g,"").toLowerCase()}const Ow=/[\u2000-\u200F\u202A-\u202F\u0300-\u036F\uFEFF\u061C\s]/g;function ev(n){return n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function kw(n,e){e=typeof e=="boolean"?e:!0;let t=ev(n);return t=t.replace(/\\\*/g,".*"),t=t.replace(/\?/g,"."),e&&(t=t.replace(/\\\[(!|)(.*)\\]/g,function(r,i,s,o,a){const l=i&&"^"||"",u=s.replace(/\\-/,"-");return"["+l+u+"]"})),t}function Cw(n){return n&&n.endsWith("/")?n.substr(0,n.length-1):n}function Pw(n,e){return new Promise(t=>{setTimeout(t,n,e)})}function Mw(n){return n==null}function Aw(){let n,e;const t=new Promise((r,i)=>{n=r,e=i});return{resolve:n,reject:e,promise:t}}async function Dw(n,e){for(const t of n)await e(await t)}function xw(n){return new Promise(e=>e(n()))}async function Uw(n,e){const t=[];for(let r=0;r<n.length;r+=e)t.push(...await Promise.all(n.slice(r,r+e).map(i=>i())));return t}function $w(n){return(0,fw.default)(e=>n(e),{forever:!0,factor:2,minTimeout:3e3,maxTimeout:15e3})}let tv;function Nw(n){tv=n}function Lw(){return tv}const Ps=(()=>{let n="";for(let e=32;e<=126;e++)n+=String.fromCharCode(e);return n})();W.DEFAULT_ALPHABET=Ps;function Bd(n,e,t=Ps){return n.padEnd(e,t[0])}function Io(n,e=Ps){const t=BigInt(e.length);if(n<=t){var r;return(r=e[Number(n)-1])!==null&&r!==void 0?r:""}let i=n/t,s=Number(n%t)-1;return s<0&&(i-=BigInt(Math.abs(s)),s=Number(t)-1),Io(i,e)+e[s]}function La(n,e=Ps){const t=BigInt(e.length);let r=BigInt(0);for(let i=n.length-1,s=BigInt(0);i>=0;i--,s++){const o=n.charCodeAt(i)-e.charCodeAt(0);r+=BigInt(1+o)*t**s}return r}function Bw(n,e,t=Ps){const r=Math.max(n.length,e.length),i=La(Bd(n,r,t),t),s=La(Bd(e,r,t),t),o=(i+s)/BigInt(2);return o===i||o==s?Io(o,t)+t[0]:Io(o,t)}function Kw(n,e=Ps){return Io(La(n,e)+BigInt(1),e)}function Fw(n,e=Ps){return Io(La(n,e)-BigInt(1),e)}function rv(n,e){return n<e?-1:n===e?0:1}const qw=new Intl.Collator;function jw(n,e){return qw.compare(n,e)}function nv(n,e,t=!1){for(const[r,i]of Object.entries(e)){if(n[r]instanceof Object&&i){nv(n[r],i);continue}if(i!=null||!t){n[r]=i;continue}}return n}var Vw=G.exports;Object.defineProperty(Uo,"__esModule",{value:!0});Uo.MemoryCryptoStore=void 0;var Zt=Vw(Y.exports),_c=se,wp=Gw(W);function iv(n){if(typeof WeakMap!="function")return null;var e=new WeakMap,t=new WeakMap;return(iv=function(r){return r?t:e})(n)}function Gw(n,e){if(!e&&n&&n.__esModule)return n;if(n===null||typeof n!="object"&&typeof n!="function")return{default:n};var t=iv(e);if(t&&t.has(n))return t.get(n);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in n)if(s!=="default"&&Object.prototype.hasOwnProperty.call(n,s)){var o=i?Object.getOwnPropertyDescriptor(n,s):null;o&&(o.get||o.set)?Object.defineProperty(r,s,o):r[s]=n[s]}return r.default=n,t&&t.set(n,r),r}function Rp(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function Ip(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Rp(Object(t),!0).forEach(function(r){(0,Zt.default)(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Rp(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}class Ww{constructor(){(0,Zt.default)(this,"outgoingRoomKeyRequests",[]),(0,Zt.default)(this,"account",null),(0,Zt.default)(this,"crossSigningKeys",null),(0,Zt.default)(this,"privateKeys",{}),(0,Zt.default)(this,"sessions",{}),(0,Zt.default)(this,"sessionProblems",{}),(0,Zt.default)(this,"notifiedErrorDevices",{}),(0,Zt.default)(this,"inboundGroupSessions",{}),(0,Zt.default)(this,"inboundGroupSessionsWithheld",{}),(0,Zt.default)(this,"deviceData",null),(0,Zt.default)(this,"rooms",{}),(0,Zt.default)(this,"sessionsNeedingBackup",{}),(0,Zt.default)(this,"sharedHistoryInboundGroupSessions",{})}async startup(){return this}deleteAllData(){return Promise.resolve()}getOrAddOutgoingRoomKeyRequest(e){const t=e.requestBody;return wp.promiseTry(()=>{const r=this._getOutgoingRoomKeyRequest(t);return r?(_c.logger.log(`already have key request outstanding for ${t.room_id} / ${t.session_id}: not sending another`),r):(_c.logger.log(`enqueueing key request for ${t.room_id} / `+t.session_id),this.outgoingRoomKeyRequests.push(e),e)})}getOutgoingRoomKeyRequest(e){return Promise.resolve(this._getOutgoingRoomKeyRequest(e))}_getOutgoingRoomKeyRequest(e){for(const t of this.outgoingRoomKeyRequests)if(wp.deepCompare(t.requestBody,e))return t;return null}getOutgoingRoomKeyRequestByState(e){for(const t of this.outgoingRoomKeyRequests)for(const r of e)if(t.state===r)return Promise.resolve(t);return Promise.resolve(null)}getAllOutgoingRoomKeyRequestsByState(e){return Promise.resolve(this.outgoingRoomKeyRequests.filter(t=>t.state==e))}getOutgoingRoomKeyRequestsByTarget(e,t,r){const i=[];for(const s of this.outgoingRoomKeyRequests)for(const o of r)s.state===o&&s.recipients.includes({userId:e,deviceId:t})&&i.push(s);return Promise.resolve(i)}updateOutgoingRoomKeyRequest(e,t,r){for(const i of this.outgoingRoomKeyRequests)if(i.requestId===e)return i.state!==t?(_c.logger.warn(`Cannot update room key request from ${t} as it was already updated to ${i.state}`),Promise.resolve(null)):(Object.assign(i,r),Promise.resolve(i));return Promise.resolve(null)}deleteOutgoingRoomKeyRequest(e,t){for(let r=0;r<this.outgoingRoomKeyRequests.length;r++){const i=this.outgoingRoomKeyRequests[r];if(i.requestId===e)return i.state!=t?(_c.logger.warn(`Cannot delete room key request in state ${i.state} (expected ${t})`),Promise.resolve(null)):(this.outgoingRoomKeyRequests.splice(r,1),Promise.resolve(i))}return Promise.resolve(null)}getAccount(e,t){t(this.account)}storeAccount(e,t){this.account=t}getCrossSigningKeys(e,t){t(this.crossSigningKeys)}getSecretStorePrivateKey(e,t,r){const i=this.privateKeys[r];t(i||null)}storeCrossSigningKeys(e,t){this.crossSigningKeys=t}storeSecretStorePrivateKey(e,t,r){this.privateKeys[t]=r}countEndToEndSessions(e,t){t(Object.keys(this.sessions).length)}getEndToEndSession(e,t,r,i){const s=this.sessions[e]||{};i(s[t]||null)}getEndToEndSessions(e,t,r){r(this.sessions[e]||{})}getAllEndToEndSessions(e,t){Object.entries(this.sessions).forEach(([r,i])=>{Object.entries(i).forEach(([s,o])=>{t(Ip(Ip({},o),{},{deviceKey:r,sessionId:s}))})})}storeEndToEndSession(e,t,r,i){let s=this.sessions[e];s===void 0&&(s={},this.sessions[e]=s),s[t]=r}async storeEndToEndSessionProblem(e,t,r){const i=this.sessionProblems[e]=this.sessionProblems[e]||[];i.push({type:t,fixed:r,time:Date.now()}),i.sort((s,o)=>s.time-o.time)}async getEndToEndSessionProblem(e,t){const r=this.sessionProblems[e]||[];if(!r.length)return null;const i=r[r.length-1];for(const s of r)if(s.time>t)return Object.assign({},s,{fixed:i.fixed});return i.fixed?null:i}async filterOutNotifiedErrorDevices(e){const t=this.notifiedErrorDevices,r=[];for(const i of e){const{userId:s,deviceInfo:o}=i;s in t?o.deviceId in t[s]||(r.push(i),t[s][o.deviceId]=!0):(r.push(i),t[s]={[o.deviceId]:!0})}return r}getEndToEndInboundGroupSession(e,t,r,i){const s=e+"/"+t;i(this.inboundGroupSessions[s]||null,this.inboundGroupSessionsWithheld[s]||null)}getAllEndToEndInboundGroupSessions(e,t){for(const r of Object.keys(this.inboundGroupSessions))t({senderKey:r.substr(0,43),sessionId:r.substr(44),sessionData:this.inboundGroupSessions[r]});t(null)}addEndToEndInboundGroupSession(e,t,r,i){const s=e+"/"+t;this.inboundGroupSessions[s]===void 0&&(this.inboundGroupSessions[s]=r)}storeEndToEndInboundGroupSession(e,t,r,i){this.inboundGroupSessions[e+"/"+t]=r}storeEndToEndInboundGroupSessionWithheld(e,t,r,i){const s=e+"/"+t;this.inboundGroupSessionsWithheld[s]=r}getEndToEndDeviceData(e,t){t(this.deviceData)}storeEndToEndDeviceData(e,t){this.deviceData=e}storeEndToEndRoom(e,t,r){this.rooms[e]=t}getEndToEndRooms(e,t){t(this.rooms)}getSessionsNeedingBackup(e){const t=[];for(const r in this.sessionsNeedingBackup)if(this.inboundGroupSessions[r]&&(t.push({senderKey:r.substr(0,43),sessionId:r.substr(44),sessionData:this.inboundGroupSessions[r]}),e&&r.length>=e))break;return Promise.resolve(t)}countSessionsNeedingBackup(){return Promise.resolve(Object.keys(this.sessionsNeedingBackup).length)}unmarkSessionsNeedingBackup(e){for(const t of e){const r=t.senderKey+"/"+t.sessionId;delete this.sessionsNeedingBackup[r]}return Promise.resolve()}markSessionsNeedingBackup(e){for(const t of e){const r=t.senderKey+"/"+t.sessionId;this.sessionsNeedingBackup[r]=!0}return Promise.resolve()}addSharedHistoryInboundGroupSession(e,t,r){const i=this.sharedHistoryInboundGroupSessions[e]||[];i.push([t,r]),this.sharedHistoryInboundGroupSessions[e]=i}getSharedHistoryInboundGroupSessions(e){return Promise.resolve(this.sharedHistoryInboundGroupSessions[e]||[])}doTxn(e,t,r){return Promise.resolve(r(null))}}Uo.MemoryCryptoStore=Ww;var Qa={},Qr={},je={},Bl={exports:{}},po=typeof Reflect=="object"?Reflect:null,Tp=po&&typeof po.apply=="function"?po.apply:function(e,t,r){return Function.prototype.apply.call(e,t,r)},Xc;po&&typeof po.ownKeys=="function"?Xc=po.ownKeys:Object.getOwnPropertySymbols?Xc=function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:Xc=function(e){return Object.getOwnPropertyNames(e)};function Hw(n){console&&console.warn&&console.warn(n)}var sv=Number.isNaN||function(e){return e!==e};function Pe(){Pe.init.call(this)}Bl.exports=Pe;Bl.exports.once=Xw;Pe.EventEmitter=Pe;Pe.prototype._events=void 0;Pe.prototype._eventsCount=0;Pe.prototype._maxListeners=void 0;var Op=10;function Kl(n){if(typeof n!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof n)}Object.defineProperty(Pe,"defaultMaxListeners",{enumerable:!0,get:function(){return Op},set:function(n){if(typeof n!="number"||n<0||sv(n))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+n+".");Op=n}});Pe.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};Pe.prototype.setMaxListeners=function(e){if(typeof e!="number"||e<0||sv(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this};function ov(n){return n._maxListeners===void 0?Pe.defaultMaxListeners:n._maxListeners}Pe.prototype.getMaxListeners=function(){return ov(this)};Pe.prototype.emit=function(e){for(var t=[],r=1;r<arguments.length;r++)t.push(arguments[r]);var i=e==="error",s=this._events;if(s!==void 0)i=i&&s.error===void 0;else if(!i)return!1;if(i){var o;if(t.length>0&&(o=t[0]),o instanceof Error)throw o;var a=new Error("Unhandled error."+(o?" ("+o.message+")":""));throw a.context=o,a}var l=s[e];if(l===void 0)return!1;if(typeof l=="function")Tp(l,this,t);else for(var u=l.length,c=dv(l,u),r=0;r<u;++r)Tp(c[r],this,t);return!0};function av(n,e,t,r){var i,s,o;if(Kl(t),s=n._events,s===void 0?(s=n._events=Object.create(null),n._eventsCount=0):(s.newListener!==void 0&&(n.emit("newListener",e,t.listener?t.listener:t),s=n._events),o=s[e]),o===void 0)o=s[e]=t,++n._eventsCount;else if(typeof o=="function"?o=s[e]=r?[t,o]:[o,t]:r?o.unshift(t):o.push(t),i=ov(n),i>0&&o.length>i&&!o.warned){o.warned=!0;var a=new Error("Possible EventEmitter memory leak detected. "+o.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");a.name="MaxListenersExceededWarning",a.emitter=n,a.type=e,a.count=o.length,Hw(a)}return n}Pe.prototype.addListener=function(e,t){return av(this,e,t,!1)};Pe.prototype.on=Pe.prototype.addListener;Pe.prototype.prependListener=function(e,t){return av(this,e,t,!0)};function Yw(){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 cv(n,e,t){var r={fired:!1,wrapFn:void 0,target:n,type:e,listener:t},i=Yw.bind(r);return i.listener=t,r.wrapFn=i,i}Pe.prototype.once=function(e,t){return Kl(t),this.on(e,cv(this,e,t)),this};Pe.prototype.prependOnceListener=function(e,t){return Kl(t),this.prependListener(e,cv(this,e,t)),this};Pe.prototype.removeListener=function(e,t){var r,i,s,o,a;if(Kl(t),i=this._events,i===void 0)return this;if(r=i[e],r===void 0)return this;if(r===t||r.listener===t)--this._eventsCount===0?this._events=Object.create(null):(delete i[e],i.removeListener&&this.emit("removeListener",e,r.listener||t));else if(typeof r!="function"){for(s=-1,o=r.length-1;o>=0;o--)if(r[o]===t||r[o].listener===t){a=r[o].listener,s=o;break}if(s<0)return this;s===0?r.shift():zw(r,s),r.length===1&&(i[e]=r[0]),i.removeListener!==void 0&&this.emit("removeListener",e,a||t)}return this};Pe.prototype.off=Pe.prototype.removeListener;Pe.prototype.removeAllListeners=function(e){var t,r,i;if(r=this._events,r===void 0)return this;if(r.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):r[e]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete r[e]),this;if(arguments.length===0){var s=Object.keys(r),o;for(i=0;i<s.length;++i)o=s[i],o!=="removeListener"&&this.removeAllListeners(o);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(t=r[e],typeof t=="function")this.removeListener(e,t);else if(t!==void 0)for(i=t.length-1;i>=0;i--)this.removeListener(e,t[i]);return this};function lv(n,e,t){var r=n._events;if(r===void 0)return[];var i=r[e];return i===void 0?[]:typeof i=="function"?t?[i.listener||i]:[i]:t?Jw(i):dv(i,i.length)}Pe.prototype.listeners=function(e){return lv(this,e,!0)};Pe.prototype.rawListeners=function(e){return lv(this,e,!1)};Pe.listenerCount=function(n,e){return typeof n.listenerCount=="function"?n.listenerCount(e):uv.call(n,e)};Pe.prototype.listenerCount=uv;function uv(n){var e=this._events;if(e!==void 0){var t=e[n];if(typeof t=="function")return 1;if(t!==void 0)return t.length}return 0}Pe.prototype.eventNames=function(){return this._eventsCount>0?Xc(this._events):[]};function dv(n,e){for(var t=new Array(e),r=0;r<e;++r)t[r]=n[r];return t}function zw(n,e){for(;e+1<n.length;e++)n[e]=n[e+1];n.pop()}function Jw(n){for(var e=new Array(n.length),t=0;t<e.length;++t)e[t]=n[t].listener||n[t];return e}function Xw(n,e){return new Promise(function(t,r){function i(o){n.removeListener(e,s),r(o)}function s(){typeof n.removeListener=="function"&&n.removeListener("error",i),t([].slice.call(arguments))}hv(n,e,s,{once:!0}),e!=="error"&&Qw(n,i,{once:!0})})}function Qw(n,e,t){typeof n.on=="function"&&hv(n,"error",e,t)}function hv(n,e,t,r){if(typeof n.on=="function")r.once?n.once(e,t):n.on(e,t);else if(typeof n.addEventListener=="function")n.addEventListener(e,function i(s){r.once&&n.removeEventListener(e,i),t(s)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof n)}Object.defineProperty(je,"__esModule",{value:!0});je.TypedEventEmitter=je.EventEmitterEvents=void 0;var Zw=Bl.exports;let Kd;je.EventEmitterEvents=Kd;(function(n){n.NewListener="newListener",n.RemoveListener="removeListener",n.Error="error"})(Kd||(je.EventEmitterEvents=Kd={}));class e0 extends Zw.EventEmitter{addListener(e,t){return super.addListener(e,t)}emit(e,...t){return super.emit(e,...t)}eventNames(){return super.eventNames()}listenerCount(e){return super.listenerCount(e)}listeners(e){return super.listeners(e)}off(e,t){return super.off(e,t)}on(e,t){return super.on(e,t)}once(e,t){return super.once(e,t)}prependListener(e,t){return super.prependListener(e,t)}prependOnceListener(e,t){return super.prependOnceListener(e,t)}removeAllListeners(e){return super.removeAllListeners(e)}removeListener(e,t){return super.removeListener(e,t)}rawListeners(e){return super.rawListeners(e)}}je.TypedEventEmitter=e0;var t0=G.exports;Object.defineProperty(Qr,"__esModule",{value:!0});Qr.UserEvent=Qr.User=void 0;var jr=t0(Y.exports),r0=je;let Vn;Qr.UserEvent=Vn;(function(n){n.DisplayName="User.displayName",n.AvatarUrl="User.avatarUrl",n.Presence="User.presence",n.CurrentlyActive="User.currentlyActive",n.LastPresenceTs="User.lastPresenceTs",n._UnstableStatusMessage="User.unstable_statusMessage"})(Vn||(Qr.UserEvent=Vn={}));class n0 extends r0.TypedEventEmitter{constructor(e){super();this.userId=e,(0,jr.default)(this,"modified",void 0),(0,jr.default)(this,"displayName",void 0),(0,jr.default)(this,"rawDisplayName",void 0),(0,jr.default)(this,"avatarUrl",void 0),(0,jr.default)(this,"presenceStatusMsg",null),(0,jr.default)(this,"presence","offline"),(0,jr.default)(this,"lastActiveAgo",0),(0,jr.default)(this,"lastPresenceTs",0),(0,jr.default)(this,"currentlyActive",!1),(0,jr.default)(this,"events",{presence:null,profile:null}),(0,jr.default)(this,"unstable_statusMessage",""),this.displayName=e,this.rawDisplayName=e,this.avatarUrl=null,this.updateModifiedTime()}setPresenceEvent(e){if(e.getType()!=="m.presence")return;const t=this.events.presence===null;this.events.presence=e;const r=[];(e.getContent().presence!==this.presence||t)&&r.push(Vn.Presence),e.getContent().avatar_url&&e.getContent().avatar_url!==this.avatarUrl&&r.push(Vn.AvatarUrl),e.getContent().displayname&&e.getContent().displayname!==this.displayName&&r.push(Vn.DisplayName),e.getContent().currently_active!==void 0&&e.getContent().currently_active!==this.currentlyActive&&r.push(Vn.CurrentlyActive),this.presence=e.getContent().presence,r.push(Vn.LastPresenceTs),e.getContent().status_msg&&(this.presenceStatusMsg=e.getContent().status_msg),e.getContent().displayname&&(this.displayName=e.getContent().displayname),e.getContent().avatar_url&&(this.avatarUrl=e.getContent().avatar_url),this.lastActiveAgo=e.getContent().last_active_ago,this.lastPresenceTs=Date.now(),this.currentlyActive=e.getContent().currently_active,this.updateModifiedTime();for(let i=0;i<r.length;i++)this.emit(r[i],e,this)}setDisplayName(e){const t=this.displayName;typeof e=="string"?this.displayName=e:this.displayName=void 0,e!==t&&this.updateModifiedTime()}setRawDisplayName(e){typeof e=="string"?this.rawDisplayName=e:this.rawDisplayName=void 0}setAvatarUrl(e){const t=this.avatarUrl;this.avatarUrl=e,e!==t&&this.updateModifiedTime()}updateModifiedTime(){this.modified=Date.now()}getLastModifiedTime(){return this.modified}getLastActiveTs(){return this.lastPresenceTs-this.lastActiveAgo}unstable_updateStatusMessage(e){e.getContent()?this.unstable_statusMessage=e.getContent().status:this.unstable_statusMessage="",this.updateModifiedTime(),this.emit(Vn._UnstableStatusMessage,this)}}Qr.User=n0;var Tn={},Zr={},$o={};Object.defineProperty($o,"__esModule",{value:!0});$o.getHttpUriForMxc=o0;var i0=s0(W);function fv(n){if(typeof WeakMap!="function")return null;var e=new WeakMap,t=new WeakMap;return(fv=function(r){return r?t:e})(n)}function s0(n,e){if(!e&&n&&n.__esModule)return n;if(n===null||typeof n!="object"&&typeof n!="function")return{default:n};var t=fv(e);if(t&&t.has(n))return t.get(n);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in n)if(s!=="default"&&Object.prototype.hasOwnProperty.call(n,s)){var o=i?Object.getOwnPropertyDescriptor(n,s):null;o&&(o.get||o.set)?Object.defineProperty(r,s,o):r[s]=n[s]}return r.default=n,t&&t.set(n,r),r}function o0(n,e,t,r,i,s=!1){if(typeof e!="string"||!e)return"";if(e.indexOf("mxc://")!==0)return s?e:"";let o=e.slice(6),a="/_matrix/media/r0/download/";const l={};t&&(l.width=Math.round(t).toString()),r&&(l.height=Math.round(r).toString()),i&&(l.method=i),Object.keys(l).length>0&&(a="/_matrix/media/r0/thumbnail/");const u=o.indexOf("#");let c="";u>=0&&(c=o.substr(u),o=o.substr(0,u));const g=Object.keys(l).length===0?"":"?"+i0.encodeParams(l);return n+a+o+g+c}var ie={},_r={},a0=G.exports;Object.defineProperty(_r,"__esModule",{value:!0});_r.UnstableValue=_r.ServerControlledNamespacedValue=_r.NamespacedValue=void 0;var c0=a0(Y.exports);class ff{constructor(e,t){if(this.stable=e,this.unstable=t,!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}matches(e){return this.name===e||this.altName===e}findIn(e){let t;return this.name&&(t=e==null?void 0:e[this.name]),!t&&this.altName&&(t=e==null?void 0:e[this.altName]),t}includedIn(e){let t=!1;return this.name&&(t=e.includes(this.name)),!t&&this.altName&&(t=e.includes(this.altName)),t}}_r.NamespacedValue=ff;class l0 extends ff{constructor(...e){super(...e);(0,c0.default)(this,"preferUnstable",!1)}setPreferUnstable(e){this.preferUnstable=e}get name(){return this.stable&&!this.preferUnstable?this.stable:this.unstable}}_r.ServerControlledNamespacedValue=l0;class u0 extends ff{constructor(e,t){super(e,t);if(!this.unstable)throw new Error("Unstable value must be supplied")}get name(){return this.unstable}get altName(){return this.stable}}_r.UnstableValue=u0;Object.defineProperty(ie,"__esModule",{value:!0});ie.UNSTABLE_MSC3089_TREE_SUBTYPE=ie.UNSTABLE_MSC3089_LEAF=ie.UNSTABLE_MSC3089_BRANCH=ie.UNSTABLE_MSC3088_PURPOSE=ie.UNSTABLE_MSC3088_ENABLED=ie.UNSTABLE_ELEMENT_FUNCTIONAL_USERS=ie.RoomType=ie.RoomCreateTypeField=ie.RelationType=ie.MsgType=ie.EventType=ie.EVENT_VISIBILITY_CHANGE_TYPE=void 0;var Ms=_r;let Fd;ie.EventType=Fd;(function(n){n.RoomCanonicalAlias="m.room.canonical_alias",n.RoomCreate="m.room.create",n.RoomJoinRules="m.room.join_rules",n.RoomMember="m.room.member",n.RoomThirdPartyInvite="m.room.third_party_invite",n.RoomPowerLevels="m.room.power_levels",n.RoomName="m.room.name",n.RoomTopic="m.room.topic",n.RoomAvatar="m.room.avatar",n.RoomPinnedEvents="m.room.pinned_events",n.RoomEncryption="m.room.encryption",n.RoomHistoryVisibility="m.room.history_visibility",n.RoomGuestAccess="m.room.guest_access",n.RoomServerAcl="m.room.server_acl",n.RoomTombstone="m.room.tombstone",n.RoomAliases="m.room.aliases",n.SpaceChild="m.space.child",n.SpaceParent="m.space.parent",n.RoomRedaction="m.room.redaction",n.RoomMessage="m.room.message",n.RoomMessageEncrypted="m.room.encrypted",n.Sticker="m.sticker",n.CallInvite="m.call.invite",n.CallCandidates="m.call.candidates",n.CallAnswer="m.call.answer",n.CallHangup="m.call.hangup",n.CallReject="m.call.reject",n.CallSelectAnswer="m.call.select_answer",n.CallNegotiate="m.call.negotiate",n.CallSDPStreamMetadataChanged="m.call.sdp_stream_metadata_changed",n.CallSDPStreamMetadataChangedPrefix="org.matrix.call.sdp_stream_metadata_changed",n.CallReplaces="m.call.replaces",n.CallAssertedIdentity="m.call.asserted_identity",n.CallAssertedIdentityPrefix="org.matrix.call.asserted_identity",n.KeyVerificationRequest="m.key.verification.request",n.KeyVerificationStart="m.key.verification.start",n.KeyVerificationCancel="m.key.verification.cancel",n.KeyVerificationMac="m.key.verification.mac",n.KeyVerificationDone="m.key.verification.done",n.RoomMessageFeedback="m.room.message.feedback",n.Reaction="m.reaction",n.Typing="m.typing",n.Receipt="m.receipt",n.Presence="m.presence",n.FullyRead="m.fully_read",n.Tag="m.tag",n.SpaceOrder="org.matrix.msc3230.space_order",n.PushRules="m.push_rules",n.Direct="m.direct",n.IgnoredUserList="m.ignored_user_list",n.RoomKey="m.room_key",n.RoomKeyRequest="m.room_key_request",n.ForwardedRoomKey="m.forwarded_room_key",n.Dummy="m.dummy"})(Fd||(ie.EventType=Fd={}));let qd;ie.RelationType=qd;(function(n){n.Annotation="m.annotation",n.Replace="m.replace",n.Reference="m.reference",n.Thread="io.element.thread"})(qd||(ie.RelationType=qd={}));let jd;ie.MsgType=jd;(function(n){n.Text="m.text",n.Emote="m.emote",n.Notice="m.notice",n.Image="m.image",n.File="m.file",n.Audio="m.audio",n.Location="m.location",n.Video="m.video",n.KeyVerificationRequest="m.key.verification.request"})(jd||(ie.MsgType=jd={}));const d0="type";ie.RoomCreateTypeField=d0;let Vd;ie.RoomType=Vd;(function(n){n.Space="m.space"})(Vd||(ie.RoomType=Vd={}));const h0=new Ms.UnstableValue("m.room.purpose","org.matrix.msc3088.purpose");ie.UNSTABLE_MSC3088_PURPOSE=h0;const f0=new Ms.UnstableValue("m.enabled","org.matrix.msc3088.enabled");ie.UNSTABLE_MSC3088_ENABLED=f0;const p0=new Ms.UnstableValue("m.data_tree","org.matrix.msc3089.data_tree");ie.UNSTABLE_MSC3089_TREE_SUBTYPE=p0;const g0=new Ms.UnstableValue("m.leaf","org.matrix.msc3089.leaf");ie.UNSTABLE_MSC3089_LEAF=g0;const m0=new Ms.UnstableValue("m.branch","org.matrix.msc3089.branch");ie.UNSTABLE_MSC3089_BRANCH=m0;const y0=new Ms.UnstableValue("io.element.functional_members","io.element.functional_members");ie.UNSTABLE_ELEMENT_FUNCTIONAL_USERS=y0;const v0=new Ms.UnstableValue("m.visibility","org.matrix.msc3531.visibility");ie.EVENT_VISIBILITY_CHANGE_TYPE=v0;var _0=G.exports;Object.defineProperty(Zr,"__esModule",{value:!0});Zr.RoomMemberEvent=Zr.RoomMember=void 0;var wr=_0(Y.exports),E0=$o,go=R0(W),S0=se,b0=je,w0=ie;function pv(n){if(typeof WeakMap!="function")return null;var e=new WeakMap,t=new WeakMap;return(pv=function(r){return r?t:e})(n)}function R0(n,e){if(!e&&n&&n.__esModule)return n;if(n===null||typeof n!="object"&&typeof n!="function")return{default:n};var t=pv(e);if(t&&t.has(n))return t.get(n);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in n)if(s!=="default"&&Object.prototype.hasOwnProperty.call(n,s)){var o=i?Object.getOwnPropertyDescriptor(n,s):null;o&&(o.get||o.set)?Object.defineProperty(r,s,o):r[s]=n[s]}return r.default=n,t&&t.set(n,r),r}let as;Zr.RoomMemberEvent=as;(function(n){n.Membership="RoomMember.membership",n.Name="RoomMember.name",n.PowerLevel="RoomMember.powerLevel",n.Typing="RoomMember.typing"})(as||(Zr.RoomMemberEvent=as={}));class I0 extends b0.TypedEventEmitter{constructor(e,t){super();this.roomId=e,this.userId=t,(0,wr.default)(this,"_isOutOfBand",!1),(0,wr.default)(this,"_modified",void 0),(0,wr.default)(this,"_requestedProfileInfo",void 0),(0,wr.default)(this,"typing",!1),(0,wr.default)(this,"name",void 0),(0,wr.default)(this,"rawDisplayName",void 0),(0,wr.default)(this,"powerLevel",0),(0,wr.default)(this,"powerLevelNorm",0),(0,wr.default)(this,"user",null),(0,wr.default)(this,"membership",null),(0,wr.default)(this,"disambiguate",!1),(0,wr.default)(this,"events",{member:null}),this.name=t,this.rawDisplayName=t,this.updateModifiedTime()}markOutOfBand(){this._isOutOfBand=!0}isOutOfBand(){return this._isOutOfBand}setMembershipEvent(e,t){const r=e.getDirectionalContent().displayname;if(e.getType()!==w0.EventType.RoomMember)return;this._isOutOfBand=!1,this.events.member=e;const i=this.membership;this.membership=e.getDirectionalContent().membership,this.membership===void 0&&S0.logger.trace(`membership event with membership undefined (forwardLooking: ${e.forwardLooking})!`,e.getContent(),"prevcontent is ",e.getPrevContent()),this.disambiguate=k0(this.userId,r,t);const s=this.name;this.name=C0(this.userId,r,t,this.disambiguate),this.rawDisplayName=go.removeDirectionOverrideChars(e.getDirectionalContent().displayname),(!this.rawDisplayName||!go.removeHiddenChars(this.rawDisplayName))&&(this.rawDisplayName=this.userId),i!==this.membership&&(this.updateModifiedTime(),this.emit(as.Membership,e,this,i)),s!==this.name&&(this.updateModifiedTime(),this.emit(as.Name,e,this,s))}setPowerLevelEvent(e){if(e.getType()!=="m.room.power_levels")return;const t=e.getDirectionalContent();let r=t.users_default||0;const i=t.users||{};Object.values(i).forEach(function(a){r=Math.max(r,a)});const s=this.powerLevel,o=this.powerLevelNorm;i[this.userId]!==void 0&&Number.isInteger(i[this.userId])?this.powerLevel=i[this.userId]:t.users_default!==void 0?this.powerLevel=t.users_default:this.powerLevel=0,this.powerLevelNorm=0,r>0&&(this.powerLevelNorm=this.powerLevel*100/r),(s!==this.powerLevel||o!==this.powerLevelNorm)&&(this.updateModifiedTime(),this.emit(as.PowerLevel,e,this))}setTypingEvent(e){if(e.getType()!=="m.typing")return;const t=this.typing;this.typing=!1;const r=e.getContent().user_ids;!Array.isArray(r)||(r.indexOf(this.userId)!==-1&&(this.typing=!0),t!==this.typing&&(this.updateModifiedTime(),this.emit(as.Typing,e,this)))}updateModifiedTime(){this._modified=Date.now()}getLastModifiedTime(){return this._modified}isKicked(){return this.membership==="leave"&&this.events.member.getSender()!==this.events.member.getStateKey()}getDMInviter(){if(this.events.member){const e=this.events.member;let t=e.getContent(),r=e.getSender();if(t.membership==="join"&&(t=e.getPrevContent(),r=e.getUnsigned().prev_sender),t.membership==="invite"&&t.is_direct)return r}}getAvatarUrl(e,t,r,i,s=!0,o){const a=this.getMxcAvatarUrl();if(!a&&!s)return null;const l=(0,E0.getHttpUriForMxc)(e,a,t,r,i,o);return l||null}getMxcAvatarUrl(){return this.events.member?this.events.member.getDirectionalContent().avatar_url:this.user?this.user.avatarUrl:null}}Zr.RoomMember=I0;const T0=/@.+:.+/,O0=/[\u200E\u200F\u202A-\u202F]/;function k0(n,e,t){return!e||e===n||!go.removeHiddenChars(e)||!t?!1:!!(T0.test(e)||O0.test(e)||t.getUserIdsWithDisplayName(e).some(i=>i!==n))}function C0(n,e,t,r){return r?go.removeDirectionOverrideChars(e)+" ("+n+")":!e||e===n||!go.removeHiddenChars(e)?n:go.removeDirectionOverrideChars(e)}var Je={};Object.defineProperty(Je,"__esModule",{value:!0});Je.Visibility=Je.RestrictedAllowType=Je.Preset=Je.JoinRule=Je.HistoryVisibility=Je.GuestAccess=void 0;let Gd;Je.Visibility=Gd;(function(n){n.Public="public",n.Private="private"})(Gd||(Je.Visibility=Gd={}));let Wd;Je.Preset=Wd;(function(n){n.PrivateChat="private_chat",n.TrustedPrivateChat="trusted_private_chat",n.PublicChat="public_chat"})(Wd||(Je.Preset=Wd={}));let Hd;Je.JoinRule=Hd;(function(n){n.Public="public",n.Invite="invite",n.Private="private",n.Knock="knock",n.Restricted="restricted"})(Hd||(Je.JoinRule=Hd={}));let Yd;Je.RestrictedAllowType=Yd;(function(n){n.RoomMembership="m.room_membership"})(Yd||(Je.RestrictedAllowType=Yd={}));let zd;Je.GuestAccess=zd;(function(n){n.CanJoin="can_join",n.Forbidden="forbidden"})(zd||(Je.GuestAccess=zd={}));let Jd;Je.HistoryVisibility=Jd;(function(n){n.Invited="invited",n.Joined="joined",n.Shared="shared",n.WorldReadable="world_readable"})(Jd||(Je.HistoryVisibility=Jd={}));var vr={},Rn={};Object.defineProperty(Rn,"__esModule",{value:!0});Rn.M_BEACON_INFO_VARIABLE=Rn.M_BEACON_INFO=Rn.M_BEACON=void 0;var pf=_r;const P0=new pf.UnstableValue("m.beacon_info.*","org.matrix.msc3489.beacon_info.*");Rn.M_BEACON_INFO_VARIABLE=P0;const M0=new pf.UnstableValue("m.beacon_info","org.matrix.msc3489.beacon_info");Rn.M_BEACON_INFO=M0;const A0=new pf.UnstableValue("m.beacon","org.matrix.msc3489.beacon");Rn.M_BEACON=A0;var Xe={},Fl={},ql={},Za={};Object.defineProperty(Za,"__esModule",{value:!0});Za.NamespacedMap=void 0;function D0(n,e){var t=typeof Symbol!="undefined"&&n[Symbol.iterator]||n["@@iterator"];if(!t){if(Array.isArray(n)||(t=x0(n))||e&&n&&typeof n.length=="number"){t&&(n=t);var r=0,i=function(){};return{s:i,n:function(){return r>=n.length?{done:!0}:{done:!1,value:n[r++]}},e:function(u){throw u},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
-In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var s=!0,o=!1,a;return{s:function(){t=t.call(n)},n:function(){var u=t.next();return s=u.done,u},e:function(u){o=!0,a=u},f:function(){try{!s&&t.return!=null&&t.return()}finally{if(o)throw a}}}}function x0(n,e){if(!!n){if(typeof n=="string")return kp(n,e);var t=Object.prototype.toString.call(n).slice(8,-1);if(t==="Object"&&n.constructor&&(t=n.constructor.name),t==="Map"||t==="Set")return Array.from(n);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return kp(n,e)}}function kp(n,e){(e==null||e>n.length)&&(e=n.length);for(var t=0,r=new Array(e);t<e;t++)r[t]=n[t];return r}function U0(n,e){if(!(n instanceof e))throw new TypeError("Cannot call a class as a function")}function Cp(n,e){for(var t=0;t<e.length;t++){var r=e[t];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(n,r.key,r)}}function $0(n,e,t){return e&&Cp(n.prototype,e),t&&Cp(n,t),Object.defineProperty(n,"prototype",{writable:!1}),n}function N0(n,e,t){return e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}var L0=function(){function n(e){if(U0(this,n),N0(this,"internalMap",new Map),e){var t=D0(e),r;try{for(t.s();!(r=t.n()).done;){var i=r.value;this.set(i[0],i[1])}}catch(s){t.e(s)}finally{t.f()}}}return $0(n,[{key:"get",value:function(t){return t.name&&this.internalMap.has(t.name)?this.internalMap.get(t.name):t.altName&&this.internalMap.has(t.altName)?this.internalMap.get(t.altName):null}},{key:"set",value:function(t,r){t.name&&this.internalMap.set(t.name,r),t.altName&&this.internalMap.set(t.altName,r)}},{key:"has",value:function(t){return!!this.get(t)}},{key:"delete",value:function(t){t.name&&this.internalMap.delete(t.name),t.altName&&this.internalMap.delete(t.altName)}},{key:"hasNamespaced",value:function(t){return this.internalMap.has(t)}},{key:"getNamespaced",value:function(t){return this.internalMap.get(t)}}]),n}();Za.NamespacedMap=L0;var ii={};function Xd(n){return Xd=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},Xd(n)}Object.defineProperty(ii,"__esModule",{value:!0});ii.InvalidEventError=void 0;function Pp(n,e){for(var t=0;t<e.length;t++){var r=e[t];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(n,r.key,r)}}function B0(n,e,t){return e&&Pp(n.prototype,e),t&&Pp(n,t),Object.defineProperty(n,"prototype",{writable:!1}),n}function K0(n,e){if(!(n instanceof e))throw new TypeError("Cannot call a class as a function")}function F0(n,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");n.prototype=Object.create(e&&e.prototype,{constructor:{value:n,writable:!0,configurable:!0}}),Object.defineProperty(n,"prototype",{writable:!1}),e&&Ba(n,e)}function q0(n){var e=gv();return function(){var r=Ka(n),i;if(e){var s=Ka(this).constructor;i=Reflect.construct(r,arguments,s)}else i=r.apply(this,arguments);return j0(this,i)}}function j0(n,e){if(e&&(Xd(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return V0(n)}function V0(n){if(n===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return n}function Qd(n){var e=typeof Map=="function"?new Map:void 0;return Qd=function(r){if(r===null||!G0(r))return r;if(typeof r!="function")throw new TypeError("Super expression must either be null or a function");if(typeof e!="undefined"){if(e.has(r))return e.get(r);e.set(r,i)}function i(){return Qc(r,arguments,Ka(this).constructor)}return i.prototype=Object.create(r.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),Ba(i,r)},Qd(n)}function Qc(n,e,t){return gv()?Qc=Reflect.construct:Qc=function(i,s,o){var a=[null];a.push.apply(a,s);var l=Function.bind.apply(i,a),u=new l;return o&&Ba(u,o.prototype),u},Qc.apply(null,arguments)}function gv(){if(typeof Reflect=="undefined"||!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 G0(n){return Function.toString.call(n).indexOf("[native code]")!==-1}function Ba(n,e){return Ba=Object.setPrototypeOf||function(r,i){return r.__proto__=i,r},Ba(n,e)}function Ka(n){return Ka=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},Ka(n)}var W0=function(n){F0(t,n);var e=q0(t);function t(r){return K0(this,t),e.call(this,r)}return B0(t)}(Qd(Error));ii.InvalidEventError=W0;var No={},Cn={},Bi={};Object.defineProperty(Bi,"__esModule",{value:!0});Bi.ExtensibleEvent=void 0;function H0(n,e){if(!(n instanceof e))throw new TypeError("Cannot call a class as a function")}function Mp(n,e){for(var t=0;t<e.length;t++){var r=e[t];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(n,r.key,r)}}function Y0(n,e,t){return e&&Mp(n.prototype,e),t&&Mp(n,t),Object.defineProperty(n,"prototype",{writable:!1}),n}var z0=function(){function n(e){H0(this,n),this.wireFormat=e}return Y0(n,[{key:"wireContent",get:function(){return this.wireFormat.content}}]),n}();Bi.ExtensibleEvent=z0;var ec={};Object.defineProperty(ec,"__esModule",{value:!0});ec.isOptionalAString=J0;ec.isProvided=mv;function J0(n){return mv(n)&&typeof n=="string"}function mv(n){return n!=null}var tt={},en={};function Zd(n){return Zd=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},Zd(n)}Object.defineProperty(en,"__esModule",{value:!0});en.UnstableValue=en.NamespacedValue=void 0;function X0(n,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");n.prototype=Object.create(e&&e.prototype,{constructor:{value:n,writable:!0,configurable:!0}}),Object.defineProperty(n,"prototype",{writable:!1}),e&&eh(n,e)}function eh(n,e){return eh=Object.setPrototypeOf||function(r,i){return r.__proto__=i,r},eh(n,e)}function Q0(n){var e=tR();return function(){var r=El(n),i;if(e){var s=El(this).constructor;i=Reflect.construct(r,arguments,s)}else i=r.apply(this,arguments);return Z0(this,i)}}function Z0(n,e){if(e&&(Zd(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return eR(n)}function eR(n){if(n===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return n}function tR(){if(typeof Reflect=="undefined"||!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 El(n){return El=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},El(n)}function yv(n,e){if(!(n instanceof e))throw new TypeError("Cannot call a class as a function")}function Ap(n,e){for(var t=0;t<e.length;t++){var r=e[t];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(n,r.key,r)}}function vv(n,e,t){return e&&Ap(n.prototype,e),t&&Ap(n,t),Object.defineProperty(n,"prototype",{writable:!1}),n}var _v=function(){function n(e,t){if(yv(this,n),this.stable=e,this.unstable=t,!this.unstable&&!this.stable)throw new Error("One of stable or unstable values must be supplied")}return vv(n,[{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(t){return!!this.name&&this.name===t||!!this.altName&&this.altName===t}},{key:"findIn",value:function(t){var r;return this.name&&(r=t==null?void 0:t[this.name]),!r&&this.altName&&(r=t==null?void 0:t[this.altName]),r}},{key:"includedIn",value:function(t){var r=!1;return this.name&&(r=t.includes(this.name)),!r&&this.altName&&(r=t.includes(this.altName)),r}}]),n}();en.NamespacedValue=_v;var rR=function(n){X0(t,n);var e=Q0(t);function t(r,i){var s;if(yv(this,t),s=e.call(this,r,i),!s.unstable)throw new Error("Unstable value must be supplied");return s}return vv(t,[{key:"name",get:function(){return this.unstable}},{key:"altName",get:function(){return this.stable}}]),t}(_v);en.UnstableValue=rR;Object.defineProperty(tt,"__esModule",{value:!0});tt.M_TEXT=tt.M_NOTICE=tt.M_MESSAGE=tt.M_HTML=tt.M_EMOTE=void 0;var tc=en,nR=new tc.UnstableValue("m.message","org.matrix.msc1767.message");tt.M_MESSAGE=nR;var iR=new tc.UnstableValue("m.text","org.matrix.msc1767.text");tt.M_TEXT=iR;var sR=new tc.UnstableValue("m.html","org.matrix.msc1767.html");tt.M_HTML=sR;var oR=new tc.UnstableValue("m.emote","org.matrix.msc1767.emote");tt.M_EMOTE=oR;var aR=new tc.UnstableValue("m.notice","org.matrix.msc1767.notice");tt.M_NOTICE=aR;var si={};Object.defineProperty(si,"__esModule",{value:!0});si.isEventTypeSame=cR;function cR(n,e){if(typeof n=="string")return typeof e=="string"?e===n:e.matches(n);if(typeof e=="string")return n.matches(e);var t=e,r=n;return t.matches(r.name)||t.matches(r.altName)}function th(n){return th=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},th(n)}Object.defineProperty(Cn,"__esModule",{value:!0});Cn.MessageEvent=void 0;var lR=Bi,zo=ec,Au=ii,fr=tt,uR=si;function Dp(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function xp(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Dp(Object(t),!0).forEach(function(r){Ti(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Dp(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function dR(n,e){if(!(n instanceof e))throw new TypeError("Cannot call a class as a function")}function Up(n,e){for(var t=0;t<e.length;t++){var r=e[t];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(n,r.key,r)}}function hR(n,e,t){return e&&Up(n.prototype,e),t&&Up(n,t),Object.defineProperty(n,"prototype",{writable:!1}),n}function fR(n,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");n.prototype=Object.create(e&&e.prototype,{constructor:{value:n,writable:!0,configurable:!0}}),Object.defineProperty(n,"prototype",{writable:!1}),e&&rh(n,e)}function rh(n,e){return rh=Object.setPrototypeOf||function(r,i){return r.__proto__=i,r},rh(n,e)}function pR(n){var e=mR();return function(){var r=Sl(n),i;if(e){var s=Sl(this).constructor;i=Reflect.construct(r,arguments,s)}else i=r.apply(this,arguments);return gR(this,i)}}function gR(n,e){if(e&&(th(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Zc(n)}function Zc(n){if(n===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return n}function mR(){if(typeof Reflect=="undefined"||!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 Sl(n){return Sl=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},Sl(n)}function Ti(n,e,t){return e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}var yR=function(n){fR(t,n);var e=pR(t);function t(r){var i;dR(this,t),i=e.call(this,r),Ti(Zc(i),"text",void 0),Ti(Zc(i),"html",void 0),Ti(Zc(i),"renderings",void 0);var s=fr.M_MESSAGE.findIn(i.wireContent),o=fr.M_TEXT.findIn(i.wireContent),a=fr.M_HTML.findIn(i.wireContent);if((0,zo.isProvided)(s)){if(!Array.isArray(s))throw new Au.InvalidEventError("m.message contents must be an array");var l=s.find(function(c){return!(0,zo.isProvided)(c.mimetype)||c.mimetype==="text/plain"}),u=s.find(function(c){return c.mimetype==="text/html"});if(!l)throw new Au.InvalidEventError("m.message is missing a plain text representation");i.text=l.body,i.html=u==null?void 0:u.body,i.renderings=s}else if((0,zo.isOptionalAString)(o))i.text=o,i.html=a,i.renderings=[{body:o,mimetype:"text/plain"}],i.html&&i.renderings.push({body:i.html,mimetype:"text/html"});else throw new Au.InvalidEventError("Missing textual representation for event");return i}return hR(t,[{key:"isEmote",get:function(){return fr.M_EMOTE.matches(this.wireFormat.type)||(0,zo.isProvided)(fr.M_EMOTE.findIn(this.wireFormat.content))}},{key:"isNotice",get:function(){return fr.M_NOTICE.matches(this.wireFormat.type)||(0,zo.isProvided)(fr.M_NOTICE.findIn(this.wireFormat.content))}},{key:"isEquivalentTo",value:function(i){return(0,uR.isEventTypeSame)(i,fr.M_MESSAGE)}},{key:"serializeMMessageOnly",value:function(){var i=Ti({},fr.M_MESSAGE.name,this.renderings);if(this.renderings.length===1){var s=this.renderings[0].mimetype;(s===void 0||s==="text/plain")&&(i=Ti({},fr.M_TEXT.name,this.renderings[0].body))}return i}},{key:"serialize",value:function(){var i;return{type:"m.room.message",content:xp(xp({},this.serializeMMessageOnly()),{},{body:this.text,msgtype:"m.text",format:this.html?"org.matrix.custom.html":void 0,formatted_body:(i=this.html)!==null&&i!==void 0?i:void 0})}}}],[{key:"from",value:function(i,s){var o;return new t({type:fr.M_MESSAGE.name,content:(o={},Ti(o,fr.M_TEXT.name,i),Ti(o,fr.M_HTML.name,s),o)})}}]),t}(lR.ExtensibleEvent);Cn.MessageEvent=yR;var Lo={};function nh(n){return nh=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},nh(n)}Object.defineProperty(Lo,"__esModule",{value:!0});Lo.NoticeEvent=void 0;var vR=Cn,Ec=tt,_R=si;function $p(n,e,t){return e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function ER(n,e){if(!(n instanceof e))throw new TypeError("Cannot call a class as a function")}function Np(n,e){for(var t=0;t<e.length;t++){var r=e[t];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(n,r.key,r)}}function SR(n,e,t){return e&&Np(n.prototype,e),t&&Np(n,t),Object.defineProperty(n,"prototype",{writable:!1}),n}function Pa(){return typeof Reflect!="undefined"&&Reflect.get?Pa=Reflect.get:Pa=function(e,t,r){var i=bR(e,t);if(!!i){var s=Object.getOwnPropertyDescriptor(i,t);return s.get?s.get.call(arguments.length<3?e:r):s.value}},Pa.apply(this,arguments)}function bR(n,e){for(;!Object.prototype.hasOwnProperty.call(n,e)&&(n=hs(n),n!==null););return n}function wR(n,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");n.prototype=Object.create(e&&e.prototype,{constructor:{value:n,writable:!0,configurable:!0}}),Object.defineProperty(n,"prototype",{writable:!1}),e&&ih(n,e)}function ih(n,e){return ih=Object.setPrototypeOf||function(r,i){return r.__proto__=i,r},ih(n,e)}function RR(n){var e=OR();return function(){var r=hs(n),i;if(e){var s=hs(this).constructor;i=Reflect.construct(r,arguments,s)}else i=r.apply(this,arguments);return IR(this,i)}}function IR(n,e){if(e&&(nh(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return TR(n)}function TR(n){if(n===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return n}function OR(){if(typeof Reflect=="undefined"||!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 hs(n){return hs=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},hs(n)}var kR=function(n){wR(t,n);var e=RR(t);function t(r){return ER(this,t),e.call(this,r)}return SR(t,[{key:"isNotice",get:function(){return!0}},{key:"isEquivalentTo",value:function(i){return(0,_R.isEventTypeSame)(i,Ec.M_NOTICE)||Pa(hs(t.prototype),"isEquivalentTo",this).call(this,i)}},{key:"serialize",value:function(){var i=Pa(hs(t.prototype),"serialize",this).call(this);return i.content.msgtype="m.notice",i}}],[{key:"from",value:function(i,s){var o;return new t({type:Ec.M_NOTICE.name,content:(o={},$p(o,Ec.M_TEXT.name,i),$p(o,Ec.M_HTML.name,s),o)})}}]),t}(vR.MessageEvent);Lo.NoticeEvent=kR;var Bo={};function sh(n){return sh=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},sh(n)}Object.defineProperty(Bo,"__esModule",{value:!0});Bo.EmoteEvent=void 0;var CR=Cn,Sc=tt,PR=si;function Lp(n,e,t){return e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function MR(n,e){if(!(n instanceof e))throw new TypeError("Cannot call a class as a function")}function Bp(n,e){for(var t=0;t<e.length;t++){var r=e[t];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(n,r.key,r)}}function AR(n,e,t){return e&&Bp(n.prototype,e),t&&Bp(n,t),Object.defineProperty(n,"prototype",{writable:!1}),n}function Ma(){return typeof Reflect!="undefined"&&Reflect.get?Ma=Reflect.get:Ma=function(e,t,r){var i=DR(e,t);if(!!i){var s=Object.getOwnPropertyDescriptor(i,t);return s.get?s.get.call(arguments.length<3?e:r):s.value}},Ma.apply(this,arguments)}function DR(n,e){for(;!Object.prototype.hasOwnProperty.call(n,e)&&(n=fs(n),n!==null););return n}function xR(n,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");n.prototype=Object.create(e&&e.prototype,{constructor:{value:n,writable:!0,configurable:!0}}),Object.defineProperty(n,"prototype",{writable:!1}),e&&oh(n,e)}function oh(n,e){return oh=Object.setPrototypeOf||function(r,i){return r.__proto__=i,r},oh(n,e)}function UR(n){var e=LR();return function(){var r=fs(n),i;if(e){var s=fs(this).constructor;i=Reflect.construct(r,arguments,s)}else i=r.apply(this,arguments);return $R(this,i)}}function $R(n,e){if(e&&(sh(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return NR(n)}function NR(n){if(n===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return n}function LR(){if(typeof Reflect=="undefined"||!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 fs(n){return fs=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},fs(n)}var BR=function(n){xR(t,n);var e=UR(t);function t(r){return MR(this,t),e.call(this,r)}return AR(t,[{key:"isEmote",get:function(){return!0}},{key:"isEquivalentTo",value:function(i){return(0,PR.isEventTypeSame)(i,Sc.M_EMOTE)||Ma(fs(t.prototype),"isEquivalentTo",this).call(this,i)}},{key:"serialize",value:function(){var i=Ma(fs(t.prototype),"serialize",this).call(this);return i.content.msgtype="m.emote",i}}],[{key:"from",value:function(i,s){var o;return new t({type:Sc.M_EMOTE.name,content:(o={},Lp(o,Sc.M_TEXT.name,i),Lp(o,Sc.M_HTML.name,s),o)})}}]),t}(CR.MessageEvent);Bo.EmoteEvent=BR;Object.defineProperty(No,"__esModule",{value:!0});No.LEGACY_M_ROOM_MESSAGE=void 0;No.parseMRoomMessage=VR;var Kp=Cn,KR=Lo,FR=Bo,qR=en,yi=tt;function Fp(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function Rr(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Fp(Object(t),!0).forEach(function(r){Ji(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Fp(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function Ji(n,e,t){return e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}var jR=new qR.NamespacedValue("m.room.message");No.LEGACY_M_ROOM_MESSAGE=jR;function VR(n){var e,t,r;if(yi.M_MESSAGE.findIn(n.content)||yi.M_TEXT.findIn(n.content))return new Kp.MessageEvent(n);var i=(e=n.content)===null||e===void 0?void 0:e.msgtype,s=(t=n.content)===null||t===void 0?void 0:t.body,o=((r=n.content)===null||r===void 0?void 0:r.format)==="org.matrix.custom.html"?n.content.formatted_body:null;if(i==="m.text"){var a;return new Kp.MessageEvent(Rr(Rr({},n),{},{content:Rr(Rr({},n.content),{},(a={},Ji(a,yi.M_TEXT.name,s),Ji(a,yi.M_HTML.name,o),a))}))}else if(i==="m.notice"){var l;return new KR.NoticeEvent(Rr(Rr({},n),{},{content:Rr(Rr({},n.content),{},(l={},Ji(l,yi.M_TEXT.name,s),Ji(l,yi.M_HTML.name,o),l))}))}else if(i==="m.emote"){var u;return new FR.EmoteEvent(Rr(Rr({},n),{},{content:Rr(Rr({},n.content),{},(u={},Ji(u,yi.M_TEXT.name,s),Ji(u,yi.M_HTML.name,o),u))}))}else return null}var jl={};Object.defineProperty(jl,"__esModule",{value:!0});jl.parseMMessage=YR;var GR=Cn,qp=tt,WR=Bo,HR=Lo;function YR(n){return qp.M_EMOTE.matches(n.type)?new WR.EmoteEvent(n):qp.M_NOTICE.matches(n.type)?new HR.NoticeEvent(n):new GR.MessageEvent(n)}var Et={};Object.defineProperty(Et,"__esModule",{value:!0});Et.M_POLL_START=Et.M_POLL_RESPONSE=Et.M_POLL_KIND_UNDISCLOSED=Et.M_POLL_KIND_DISCLOSED=Et.M_POLL_END=void 0;var rc=en,zR=new rc.UnstableValue("m.poll.disclosed","org.matrix.msc3381.poll.disclosed");Et.M_POLL_KIND_DISCLOSED=zR;var JR=new rc.UnstableValue("m.poll.undisclosed","org.matrix.msc3381.poll.undisclosed");Et.M_POLL_KIND_UNDISCLOSED=JR;var XR=new rc.UnstableValue("m.poll.start","org.matrix.msc3381.poll.start");Et.M_POLL_START=XR;var QR=new rc.UnstableValue("m.poll.response","org.matrix.msc3381.poll.response");Et.M_POLL_RESPONSE=QR;var ZR=new rc.UnstableValue("m.poll.end","org.matrix.msc3381.poll.end");Et.M_POLL_END=ZR;var Vl={},ps={};function ah(n){return ah=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},ah(n)}Object.defineProperty(ps,"__esModule",{value:!0});ps.PollStartEvent=ps.PollAnswerSubevent=void 0;var Dn=Et,Ev=Cn,Ea=tt,el=ii,eI=en,tI=si,rI=Bi;function nI(n){return aI(n)||oI(n)||sI(n)||iI()}function iI(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
-In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function sI(n,e){if(!!n){if(typeof n=="string")return ch(n,e);var t=Object.prototype.toString.call(n).slice(8,-1);if(t==="Object"&&n.constructor&&(t=n.constructor.name),t==="Map"||t==="Set")return Array.from(n);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return ch(n,e)}}function oI(n){if(typeof Symbol!="undefined"&&n[Symbol.iterator]!=null||n["@@iterator"]!=null)return Array.from(n)}function aI(n){if(Array.isArray(n))return ch(n)}function ch(n,e){(e==null||e>n.length)&&(e=n.length);for(var t=0,r=new Array(e);t<e;t++)r[t]=n[t];return r}function jp(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function cI(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?jp(Object(t),!0).forEach(function(r){rr(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):jp(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function Sv(n,e){if(!(n instanceof e))throw new TypeError("Cannot call a class as a function")}function Vp(n,e){for(var t=0;t<e.length;t++){var r=e[t];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(n,r.key,r)}}function bv(n,e,t){return e&&Vp(n.prototype,e),t&&Vp(n,t),Object.defineProperty(n,"prototype",{writable:!1}),n}function wv(n,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");n.prototype=Object.create(e&&e.prototype,{constructor:{value:n,writable:!0,configurable:!0}}),Object.defineProperty(n,"prototype",{writable:!1}),e&&lh(n,e)}function lh(n,e){return lh=Object.setPrototypeOf||function(r,i){return r.__proto__=i,r},lh(n,e)}function Rv(n){var e=uI();return function(){var r=bl(n),i;if(e){var s=bl(this).constructor;i=Reflect.construct(r,arguments,s)}else i=r.apply(this,arguments);return lI(this,i)}}function lI(n,e){if(e&&(ah(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return ns(n)}function ns(n){if(n===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return n}function uI(){if(typeof Reflect=="undefined"||!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 bl(n){return bl=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},bl(n)}function rr(n,e,t){return e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}var Iv=function(n){wv(t,n);var e=Rv(t);function t(r){var i;Sv(this,t),i=e.call(this,r),rr(ns(i),"id",void 0);var s=r.content.id;if(!s||typeof s!="string")throw new el.InvalidEventError("Answer ID must be a non-empty string");return i.id=s,i}return bv(t,[{key:"serialize",value:function(){return{type:"org.matrix.sdk.poll.answer",content:cI({id:this.id},this.serializeMMessageOnly())}}}],[{key:"from",value:function(i,s){return new t({type:"org.matrix.sdk.poll.answer",content:rr({id:i},Ea.M_TEXT.name,s)})}}]),t}(Ev.MessageEvent);ps.PollAnswerSubevent=Iv;var dI=function(n){wv(t,n);var e=Rv(t);function t(r){var i;Sv(this,t),i=e.call(this,r),rr(ns(i),"question",void 0),rr(ns(i),"kind",void 0),rr(ns(i),"rawKind",void 0),rr(ns(i),"maxSelections",void 0),rr(ns(i),"answers",void 0);var s=Dn.M_POLL_START.findIn(i.wireContent);if(!s.question)throw new el.InvalidEventError("A question is required");if(i.question=new Ev.MessageEvent({type:"org.matrix.sdk.poll.question",content:s.question}),i.rawKind=s.kind,Dn.M_POLL_KIND_DISCLOSED.matches(i.rawKind)?i.kind=Dn.M_POLL_KIND_DISCLOSED:i.kind=Dn.M_POLL_KIND_UNDISCLOSED,i.maxSelections=Number.isFinite(s.max_selections)&&s.max_selections>0?s.max_selections:1,!Array.isArray(s.answers))throw new el.InvalidEventError("Poll answers must be an array");var o=s.answers.slice(0,20).map(function(a){return new Iv({type:"org.matrix.sdk.poll.answer",content:a})});if(o.length<=0)throw new el.InvalidEventError("No answers available");return i.answers=o,i}return bv(t,[{key:"isEquivalentTo",value:function(i){return(0,tI.isEventTypeSame)(i,Dn.M_POLL_START)}},{key:"serialize",value:function(){var i;return{type:Dn.M_POLL_START.name,content:(i={},rr(i,Dn.M_POLL_START.name,{question:this.question.serialize().content,kind:this.rawKind,max_selections:this.maxSelections,answers:this.answers.map(function(s){return s.serialize().content})}),rr(i,Ea.M_TEXT.name,"".concat(this.question.text,`
-`).concat(this.answers.map(function(s,o){return"".concat(o+1,". ").concat(s.text)}).join(`
-`))),i)}}}],[{key:"from",value:function(i,s,o){var a,l=arguments.length>3&&arguments[3]!==void 0?arguments[3]:1;return new t({type:Dn.M_POLL_START.name,content:(a={},rr(a,Ea.M_TEXT.name,i),rr(a,Dn.M_POLL_START.name,{question:rr({},Ea.M_TEXT.name,i),kind:o instanceof eI.NamespacedValue?o.name:o,max_selections:l,answers:s.map(function(u){return rr({id:hI()},Ea.M_TEXT.name,u)})}),a)})}}]),t}(rI.ExtensibleEvent);ps.PollStartEvent=dI;var Gp="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";function hI(){return nI(Array(16)).map(function(){return Gp.charAt(Math.floor(Math.random()*Gp.length))}).join("")}var nc={},Ko={};Object.defineProperty(Ko,"__esModule",{value:!0});Ko.REFERENCE_RELATION=void 0;var fI=en,pI=new fI.NamespacedValue("m.reference");Ko.REFERENCE_RELATION=pI;function uh(n){return uh=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},uh(n)}Object.defineProperty(nc,"__esModule",{value:!0});nc.PollResponseEvent=void 0;var gI=Bi,Bs=Et,mI=ii,Du=Ko,yI=si;function vI(n,e){if(!(n instanceof e))throw new TypeError("Cannot call a class as a function")}function Wp(n,e){for(var t=0;t<e.length;t++){var r=e[t];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(n,r.key,r)}}function _I(n,e,t){return e&&Wp(n.prototype,e),t&&Wp(n,t),Object.defineProperty(n,"prototype",{writable:!1}),n}function EI(n,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");n.prototype=Object.create(e&&e.prototype,{constructor:{value:n,writable:!0,configurable:!0}}),Object.defineProperty(n,"prototype",{writable:!1}),e&&dh(n,e)}function dh(n,e){return dh=Object.setPrototypeOf||function(r,i){return r.__proto__=i,r},dh(n,e)}function SI(n){var e=wI();return function(){var r=wl(n),i;if(e){var s=wl(this).constructor;i=Reflect.construct(r,arguments,s)}else i=r.apply(this,arguments);return bI(this,i)}}function bI(n,e){if(e&&(uh(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return tl(n)}function tl(n){if(n===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return n}function wI(){if(typeof Reflect=="undefined"||!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 wl(n){return wl=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},wl(n)}function Jo(n,e,t){return e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}var RI=function(n){EI(t,n);var e=SI(t);function t(r){var i;vI(this,t),i=e.call(this,r),Jo(tl(i),"internalAnswerIds",void 0),Jo(tl(i),"internalSpoiled",void 0),Jo(tl(i),"pollEventId",void 0);var s=i.wireContent["m.relates_to"];if(!Du.REFERENCE_RELATION.matches(s==null?void 0:s.rel_type)||typeof(s==null?void 0:s.event_id)!="string")throw new mI.InvalidEventError("Relationship must be a reference to an event");return i.pollEventId=s.event_id,i.validateAgainst(null),i}return _I(t,[{key:"answerIds",get:function(){return this.internalAnswerIds}},{key:"spoiled",get:function(){return this.internalSpoiled}},{key:"validateAgainst",value:function(i){var s=Bs.M_POLL_RESPONSE.findIn(this.wireContent);if(!Array.isArray(s==null?void 0:s.answers)){this.internalSpoiled=!0,this.internalAnswerIds=[];return}var o=s.answers;if(o.some(function(a){return typeof a!="string"})||o.length===0){this.internalSpoiled=!0,this.internalAnswerIds=[];return}if(i){if(o.some(function(a){return!i.answers.some(function(l){return l.id===a})})){this.internalSpoiled=!0,this.internalAnswerIds=[];return}o=o.slice(0,i.maxSelections)}this.internalAnswerIds=o,this.internalSpoiled=!1}},{key:"isEquivalentTo",value:function(i){return(0,yI.isEventTypeSame)(i,Bs.M_POLL_RESPONSE)}},{key:"serialize",value:function(){return{type:Bs.M_POLL_RESPONSE.name,content:Jo({"m.relates_to":{rel_type:Du.REFERENCE_RELATION.name,event_id:this.pollEventId}},Bs.M_POLL_RESPONSE.name,{answers:this.spoiled?void 0:this.answerIds})}}}],[{key:"from",value:function(i,s){return new t({type:Bs.M_POLL_RESPONSE.name,content:Jo({"m.relates_to":{rel_type:Du.REFERENCE_RELATION.name,event_id:s}},Bs.M_POLL_RESPONSE.name,{answers:i})})}}]),t}(gI.ExtensibleEvent);nc.PollResponseEvent=RI;var ic={};function hh(n){return hh=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},hh(n)}Object.defineProperty(ic,"__esModule",{value:!0});ic.PollEndEvent=void 0;var Xo=Et,II=ii,xu=Ko,TI=Cn,OI=tt,kI=si,CI=Bi;function Hp(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function PI(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Hp(Object(t),!0).forEach(function(r){so(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Hp(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function MI(n,e){if(!(n instanceof e))throw new TypeError("Cannot call a class as a function")}function Yp(n,e){for(var t=0;t<e.length;t++){var r=e[t];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(n,r.key,r)}}function AI(n,e,t){return e&&Yp(n.prototype,e),t&&Yp(n,t),Object.defineProperty(n,"prototype",{writable:!1}),n}function DI(n,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");n.prototype=Object.create(e&&e.prototype,{constructor:{value:n,writable:!0,configurable:!0}}),Object.defineProperty(n,"prototype",{writable:!1}),e&&fh(n,e)}function fh(n,e){return fh=Object.setPrototypeOf||function(r,i){return r.__proto__=i,r},fh(n,e)}function xI(n){var e=$I();return function(){var r=Rl(n),i;if(e){var s=Rl(this).constructor;i=Reflect.construct(r,arguments,s)}else i=r.apply(this,arguments);return UI(this,i)}}function UI(n,e){if(e&&(hh(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return ph(n)}function ph(n){if(n===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return n}function $I(){if(typeof Reflect=="undefined"||!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 Rl(n){return Rl=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},Rl(n)}function so(n,e,t){return e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}var NI=function(n){DI(t,n);var e=xI(t);function t(r){var i;MI(this,t),i=e.call(this,r),so(ph(i),"pollEventId",void 0),so(ph(i),"closingMessage",void 0);var s=i.wireContent["m.relates_to"];if(!xu.REFERENCE_RELATION.matches(s==null?void 0:s.rel_type)||typeof(s==null?void 0:s.event_id)!="string")throw new II.InvalidEventError("Relationship must be a reference to an event");return i.pollEventId=s.event_id,i.closingMessage=new TI.MessageEvent(i.wireFormat),i}return AI(t,[{key:"isEquivalentTo",value:function(i){return(0,kI.isEventTypeSame)(i,Xo.M_POLL_END)}},{key:"serialize",value:function(){return{type:Xo.M_POLL_END.name,content:PI(so({"m.relates_to":{rel_type:xu.REFERENCE_RELATION.name,event_id:this.pollEventId}},Xo.M_POLL_END.name,{}),this.closingMessage.serialize().content)}}}],[{key:"from",value:function(i,s){var o;return new t({type:Xo.M_POLL_END.name,content:(o={"m.relates_to":{rel_type:xu.REFERENCE_RELATION.name,event_id:i}},so(o,Xo.M_POLL_END.name,{}),so(o,OI.M_TEXT.name,s),o)})}}]),t}(CI.ExtensibleEvent);ic.PollEndEvent=NI;Object.defineProperty(Vl,"__esModule",{value:!0});Vl.parseMPoll=FI;var Uu=Et,LI=ps,BI=nc,KI=ic;function FI(n){return Uu.M_POLL_START.matches(n.type)?new LI.PollStartEvent(n):Uu.M_POLL_RESPONSE.matches(n.type)?new BI.PollResponseEvent(n):Uu.M_POLL_END.matches(n.type)?new KI.PollEndEvent(n):null}Object.defineProperty(ql,"__esModule",{value:!0});ql.ExtensibleEvents=void 0;var qI=Za,jI=ii,zp=No,$u=jl,bc=tt,Nu=Et,Lu=Vl;function VI(n,e){var t=typeof Symbol!="undefined"&&n[Symbol.iterator]||n["@@iterator"];if(!t){if(Array.isArray(n)||(t=GI(n))||e&&n&&typeof n.length=="number"){t&&(n=t);var r=0,i=function(){};return{s:i,n:function(){return r>=n.length?{done:!0}:{done:!1,value:n[r++]}},e:function(u){throw u},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
-In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var s=!0,o=!1,a;return{s:function(){t=t.call(n)},n:function(){var u=t.next();return s=u.done,u},e:function(u){o=!0,a=u},f:function(){try{!s&&t.return!=null&&t.return()}finally{if(o)throw a}}}}function GI(n,e){if(!!n){if(typeof n=="string")return Jp(n,e);var t=Object.prototype.toString.call(n).slice(8,-1);if(t==="Object"&&n.constructor&&(t=n.constructor.name),t==="Map"||t==="Set")return Array.from(n);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return Jp(n,e)}}function Jp(n,e){(e==null||e>n.length)&&(e=n.length);for(var t=0,r=new Array(e);t<e;t++)r[t]=n[t];return r}function WI(n,e){if(!(n instanceof e))throw new TypeError("Cannot call a class as a function")}function Xp(n,e){for(var t=0;t<e.length;t++){var r=e[t];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(n,r.key,r)}}function HI(n,e,t){return e&&Xp(n.prototype,e),t&&Xp(n,t),Object.defineProperty(n,"prototype",{writable:!1}),n}function gh(n,e,t){return e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}var mh=function(){function n(){WI(this,n),gh(this,"interpreters",new qI.NamespacedMap([[zp.LEGACY_M_ROOM_MESSAGE,zp.parseMRoomMessage],[bc.M_MESSAGE,$u.parseMMessage],[bc.M_EMOTE,$u.parseMMessage],[bc.M_NOTICE,$u.parseMMessage],[Nu.M_POLL_START,Lu.parseMPoll],[Nu.M_POLL_RESPONSE,Lu.parseMPoll],[Nu.M_POLL_END,Lu.parseMPoll]])),gh(this,"_unknownInterpretOrder",[bc.M_MESSAGE])}return HI(n,[{key:"unknownInterpretOrder",get:function(){var t;return(t=this._unknownInterpretOrder)!==null&&t!==void 0?t:[]},set:function(t){this._unknownInterpretOrder=t}},{key:"registerInterpreter",value:function(t,r){this.interpreters.set(t,r)}},{key:"parse",value:function(t){try{if(this.interpreters.hasNamespaced(t.type))return this.interpreters.getNamespaced(t.type)(t);var r=VI(this.unknownInterpretOrder),i;try{for(r.s();!(i=r.n()).done;){var s=i.value;if(this.interpreters.has(s)){var o=this.interpreters.get(s)(t);if(o)return o}}}catch(a){r.e(a)}finally{r.f()}return null}catch(a){if(a instanceof jI.InvalidEventError)return null;throw a}}}],[{key:"defaultInstance",get:function(){return n._defaultInstance}},{key:"unknownInterpretOrder",get:function(){return n.defaultInstance.unknownInterpretOrder},set:function(t){n.defaultInstance.unknownInterpretOrder=t}},{key:"registerInterpreter",value:function(t,r){n.defaultInstance.registerInterpreter(t,r)}},{key:"parse",value:function(t){return n.defaultInstance.parse(t)}}]),n}();ql.ExtensibleEvents=mh;gh(mh,"_defaultInstance",new mh);var Tv={};Object.defineProperty(Tv,"__esModule",{value:!0});var Fo={};Object.defineProperty(Fo,"__esModule",{value:!0});Fo.LegacyMsgType=void 0;Fo.isEventLike=YI;var Bu=tt,mo;Fo.LegacyMsgType=mo;(function(n){n.Text="m.text",n.Notice="m.notice",n.Emote="m.emote"})(mo||(Fo.LegacyMsgType=mo={}));function YI(n,e){var t=n.content;return e===mo.Text?Bu.M_MESSAGE.matches(n.type)||n.type==="m.room.message"&&(t==null?void 0:t.msgtype)==="m.text":e===mo.Emote?Bu.M_EMOTE.matches(n.type)||n.type==="m.room.message"&&(t==null?void 0:t.msgtype)==="m.emote":e===mo.Notice?Bu.M_NOTICE.matches(n.type)||n.type==="m.room.message"&&(t==null?void 0:t.msgtype)==="m.notice":!1}(function(n){Object.defineProperty(n,"__esModule",{value:!0});var e=ql;Object.keys(e).forEach(function(R){R==="default"||R==="__esModule"||R in n&&n[R]===e[R]||Object.defineProperty(n,R,{enumerable:!0,get:function(){return e[R]}})});var t=Tv;Object.keys(t).forEach(function(R){R==="default"||R==="__esModule"||R in n&&n[R]===t[R]||Object.defineProperty(n,R,{enumerable:!0,get:function(){return t[R]}})});var r=ii;Object.keys(r).forEach(function(R){R==="default"||R==="__esModule"||R in n&&n[R]===r[R]||Object.defineProperty(n,R,{enumerable:!0,get:function(){return r[R]}})});var i=en;Object.keys(i).forEach(function(R){R==="default"||R==="__esModule"||R in n&&n[R]===i[R]||Object.defineProperty(n,R,{enumerable:!0,get:function(){return i[R]}})});var s=Za;Object.keys(s).forEach(function(R){R==="default"||R==="__esModule"||R in n&&n[R]===s[R]||Object.defineProperty(n,R,{enumerable:!0,get:function(){return s[R]}})});var o=ec;Object.keys(o).forEach(function(R){R==="default"||R==="__esModule"||R in n&&n[R]===o[R]||Object.defineProperty(n,R,{enumerable:!0,get:function(){return o[R]}})});var a=Fo;Object.keys(a).forEach(function(R){R==="default"||R==="__esModule"||R in n&&n[R]===a[R]||Object.defineProperty(n,R,{enumerable:!0,get:function(){return a[R]}})});var l=si;Object.keys(l).forEach(function(R){R==="default"||R==="__esModule"||R in n&&n[R]===l[R]||Object.defineProperty(n,R,{enumerable:!0,get:function(){return l[R]}})});var u=No;Object.keys(u).forEach(function(R){R==="default"||R==="__esModule"||R in n&&n[R]===u[R]||Object.defineProperty(n,R,{enumerable:!0,get:function(){return u[R]}})});var c=jl;Object.keys(c).forEach(function(R){R==="default"||R==="__esModule"||R in n&&n[R]===c[R]||Object.defineProperty(n,R,{enumerable:!0,get:function(){return c[R]}})});var g=Vl;Object.keys(g).forEach(function(R){R==="default"||R==="__esModule"||R in n&&n[R]===g[R]||Object.defineProperty(n,R,{enumerable:!0,get:function(){return g[R]}})});var m=Ko;Object.keys(m).forEach(function(R){R==="default"||R==="__esModule"||R in n&&n[R]===m[R]||Object.defineProperty(n,R,{enumerable:!0,get:function(){return m[R]}})});var f=Bi;Object.keys(f).forEach(function(R){R==="default"||R==="__esModule"||R in n&&n[R]===f[R]||Object.defineProperty(n,R,{enumerable:!0,get:function(){return f[R]}})});var E=tt;Object.keys(E).forEach(function(R){R==="default"||R==="__esModule"||R in n&&n[R]===E[R]||Object.defineProperty(n,R,{enumerable:!0,get:function(){return E[R]}})});var I=Cn;Object.keys(I).forEach(function(R){R==="default"||R==="__esModule"||R in n&&n[R]===I[R]||Object.defineProperty(n,R,{enumerable:!0,get:function(){return I[R]}})});var w=Bo;Object.keys(w).forEach(function(R){R==="default"||R==="__esModule"||R in n&&n[R]===w[R]||Object.defineProperty(n,R,{enumerable:!0,get:function(){return w[R]}})});var k=Lo;Object.keys(k).forEach(function(R){R==="default"||R==="__esModule"||R in n&&n[R]===k[R]||Object.defineProperty(n,R,{enumerable:!0,get:function(){return k[R]}})});var C=Et;Object.keys(C).forEach(function(R){R==="default"||R==="__esModule"||R in n&&n[R]===C[R]||Object.defineProperty(n,R,{enumerable:!0,get:function(){return C[R]}})});var S=ps;Object.keys(S).forEach(function(R){R==="default"||R==="__esModule"||R in n&&n[R]===S[R]||Object.defineProperty(n,R,{enumerable:!0,get:function(){return S[R]}})});var T=nc;Object.keys(T).forEach(function(R){R==="default"||R==="__esModule"||R in n&&n[R]===T[R]||Object.defineProperty(n,R,{enumerable:!0,get:function(){return T[R]}})});var D=ic;Object.keys(D).forEach(function(R){R==="default"||R==="__esModule"||R in n&&n[R]===D[R]||Object.defineProperty(n,R,{enumerable:!0,get:function(){return D[R]}})})})(Fl);var Gl={};Object.defineProperty(Gl,"__esModule",{value:!0});Gl.TEXT_NODE_TYPE=void 0;var zI=_r;const JI=new zI.UnstableValue("m.text","org.matrix.msc1767.text");Gl.TEXT_NODE_TYPE=JI;var Jr={};Object.defineProperty(Jr,"__esModule",{value:!0});Jr.M_TIMESTAMP=Jr.M_LOCATION=Jr.M_ASSET=Jr.LocationAssetType=void 0;var gf=_r;let yh;Jr.LocationAssetType=yh;(function(n){n.Self="m.self",n.Pin="m.pin"})(yh||(Jr.LocationAssetType=yh={}));const XI=new gf.UnstableValue("m.asset","org.matrix.msc3488.asset");Jr.M_ASSET=XI;const QI=new gf.UnstableValue("m.ts","org.matrix.msc3488.ts");Jr.M_TIMESTAMP=QI;const ZI=new gf.UnstableValue("m.location","org.matrix.msc3488.location");Jr.M_LOCATION=ZI;var eT=G.exports;Object.defineProperty(Xe,"__esModule",{value:!0});Xe.makeBeaconInfoContent=Xe.makeBeaconContent=Xe.getTextForLocationEvent=void 0;Xe.makeEmoteMessage=lT;Xe.makeHtmlEmote=oT;Xe.makeHtmlMessage=iT;Xe.makeHtmlNotice=sT;Xe.makeLocationContent=void 0;Xe.makeNotice=cT;Xe.makeTextMessage=aT;Xe.parseLocationEvent=Xe.parseBeaconInfoContent=void 0;var tT=eT(Y.exports),rT=Fl,Ov=Rn,As=ie,kv=Gl,St=Jr;function Qp(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function nT(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Qp(Object(t),!0).forEach(function(r){(0,tT.default)(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Qp(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function iT(n,e){return{msgtype:As.MsgType.Text,format:"org.matrix.custom.html",body:n,formatted_body:e}}function sT(n,e){return{msgtype:As.MsgType.Notice,format:"org.matrix.custom.html",body:n,formatted_body:e}}function oT(n,e){return{msgtype:As.MsgType.Emote,format:"org.matrix.custom.html",body:n,formatted_body:e}}function aT(n){return{msgtype:As.MsgType.Text,body:n}}function cT(n){return{msgtype:As.MsgType.Notice,body:n}}function lT(n){return{msgtype:As.MsgType.Emote,body:n}}const Cv=(n,e,t,r)=>{const i=`at ${new Date(t).toISOString()}`,s=e===St.LocationAssetType.Self?"User":void 0,o=r?`"${r}"`:void 0;return[s,"Location",o,n,i].filter(Boolean).join(" ")};Xe.getTextForLocationEvent=Cv;const Pv=(n,e,t,r,i)=>{const s=n!=null?n:Cv(e,i||St.LocationAssetType.Self,t,r),o=t?{[St.M_TIMESTAMP.name]:t}:{};return nT({msgtype:As.MsgType.Location,body:s,geo_uri:e,[St.M_LOCATION.name]:{description:r,uri:e},[St.M_ASSET.name]:{type:i||St.LocationAssetType.Self},[kv.TEXT_NODE_TYPE.name]:s},o)};Xe.makeLocationContent=Pv;const uT=n=>{var e,t;const r=St.M_LOCATION.findIn(n),i=St.M_ASSET.findIn(n),s=St.M_TIMESTAMP.findIn(n),o=kv.TEXT_NODE_TYPE.findIn(n),a=(e=r==null?void 0:r.uri)!==null&&e!==void 0?e:n==null?void 0:n.geo_uri,l=r==null?void 0:r.description,u=(t=i==null?void 0:i.type)!==null&&t!==void 0?t:St.LocationAssetType.Self,c=o!=null?o:n.body;return Pv(c,a,s,l,u)};Xe.parseLocationEvent=uT;const dT=(n,e,t,r,i)=>({[Ov.M_BEACON_INFO.name]:{description:t,timeout:n,live:e},[St.M_TIMESTAMP.name]:i||Date.now(),[St.M_ASSET.name]:{type:r!=null?r:St.LocationAssetType.Self}});Xe.makeBeaconInfoContent=dT;const hT=n=>{const{description:e,timeout:t,live:r}=Ov.M_BEACON_INFO.findIn(n),{type:i}=St.M_ASSET.findIn(n),s=St.M_TIMESTAMP.findIn(n);return{description:e,timeout:t,live:r,assetType:i,timestamp:s}};Xe.parseBeaconInfoContent=hT;const fT=(n,e,t,r)=>({[St.M_LOCATION.name]:{description:r,uri:n},[St.M_TIMESTAMP.name]:e,"m.relates_to":{rel_type:rT.REFERENCE_RELATION.name,event_id:t}});Xe.makeBeaconContent=fT;var pT=G.exports;Object.defineProperty(vr,"__esModule",{value:!0});vr.isTimestampInDuration=vr.isBeaconInfoEventType=vr.BeaconEvent=vr.Beacon=void 0;var wc=pT(Y.exports),Zp=Rn,gT=Xe,mT=je;let Fa;vr.BeaconEvent=Fa;(function(n){n.New="Beacon.new",n.Update="Beacon.update",n.LivenessChange="Beacon.LivenessChange"})(Fa||(vr.BeaconEvent=Fa={}));const Mv=(n,e,t)=>t>=n&&n+e>=t;vr.isTimestampInDuration=Mv;const yT=n=>n.startsWith(Zp.M_BEACON_INFO.name)||n.startsWith(Zp.M_BEACON_INFO.altName);vr.isBeaconInfoEventType=yT;class vT extends mT.TypedEventEmitter{constructor(e){super();this.rootEvent=e,(0,wc.default)(this,"roomId",void 0),(0,wc.default)(this,"_beaconInfo",void 0),(0,wc.default)(this,"_isLive",void 0),(0,wc.default)(this,"livenessWatchInterval",void 0),this.setBeaconInfo(this.rootEvent),this.roomId=this.rootEvent.getRoomId()}get isLive(){return this._isLive}get identifier(){return this.beaconInfoEventType}get beaconInfoId(){return this.rootEvent.getId()}get beaconInfoOwner(){return this.rootEvent.getStateKey()}get beaconInfoEventType(){return this.rootEvent.getType()}get beaconInfo(){return this._beaconInfo}update(e){if(e.getType()!==this.beaconInfoEventType)throw new Error("Invalid updating event");this.rootEvent=e,this.setBeaconInfo(this.rootEvent),this.emit(Fa.Update,e,this)}destroy(){this.livenessWatchInterval&&clearInterval(this.livenessWatchInterval)}monitorLiveness(){if(this.livenessWatchInterval&&clearInterval(this.livenessWatchInterval),this.isLive){var e,t;const r=((e=this._beaconInfo)===null||e===void 0?void 0:e.timestamp)+((t=this._beaconInfo)===null||t===void 0?void 0:t.timeout)+1-Date.now();r>1&&(this.livenessWatchInterval=setInterval(this.checkLiveness.bind(this),r))}}setBeaconInfo(e){this._beaconInfo=(0,gT.parseBeaconInfoContent)(e.getContent()),this.checkLiveness()}checkLiveness(){var e,t,r;const i=this.isLive;this._isLive=((e=this._beaconInfo)===null||e===void 0?void 0:e.live)&&Mv((t=this._beaconInfo)===null||t===void 0?void 0:t.timestamp,(r=this._beaconInfo)===null||r===void 0?void 0:r.timeout,Date.now()),i!==this.isLive&&this.emit(Fa.LivenessChange,this.isLive,this)}}vr.Beacon=vT;var tn={};Object.defineProperty(tn,"__esModule",{value:!0});tn.TypedReEmitter=tn.ReEmitter=void 0;class Av{constructor(e){this.target=e}reEmit(e,t){for(const r of t){const i=(...s)=>{r==="error"&&this.target.listenerCount("error")===0||this.target.emit(r,...s,e)};e.on(r,i)}}}tn.ReEmitter=Av;class _T extends Av{constructor(e){super(e)}reEmit(e,t){super.reEmit(e,t)}}tn.TypedReEmitter=_T;var ET=G.exports;Object.defineProperty(Tn,"__esModule",{value:!0});Tn.RoomStateEvent=Tn.RoomState=void 0;var xt=ET(Y.exports),eg=Zr,Ku=se,Qo=wT(W),zt=ie,Fu=Je,ST=je,Fi=vr,bT=tn;function Dv(n){if(typeof WeakMap!="function")return null;var e=new WeakMap,t=new WeakMap;return(Dv=function(r){return r?t:e})(n)}function wT(n,e){if(!e&&n&&n.__esModule)return n;if(n===null||typeof n!="object"&&typeof n!="function")return{default:n};var t=Dv(e);if(t&&t.has(n))return t.get(n);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in n)if(s!=="default"&&Object.prototype.hasOwnProperty.call(n,s)){var o=i?Object.getOwnPropertyDescriptor(n,s):null;o&&(o.get||o.set)?Object.defineProperty(r,s,o):r[s]=n[s]}return r.default=n,t&&t.set(n,r),r}var mr;(function(n){n[n.NotStarted=0]="NotStarted",n[n.InProgress=1]="InProgress",n[n.Finished=2]="Finished"})(mr||(mr={}));let zr;Tn.RoomStateEvent=zr;(function(n){n.Events="RoomState.events",n.Members="RoomState.members",n.NewMember="RoomState.newMember",n.Update="RoomState.update",n.BeaconLiveness="RoomState.BeaconLiveness"})(zr||(Tn.RoomStateEvent=zr={}));class mf extends ST.TypedEventEmitter{constructor(e,t={status:mr.NotStarted}){super();this.roomId=e,this.oobMemberFlags=t,(0,xt.default)(this,"reEmitter",new bT.TypedReEmitter(this)),(0,xt.default)(this,"sentinels",{}),(0,xt.default)(this,"displayNameToUserIds",{}),(0,xt.default)(this,"userIdsToDisplayNames",{}),(0,xt.default)(this,"tokenToInvite",{}),(0,xt.default)(this,"joinedMemberCount",null),(0,xt.default)(this,"summaryJoinedMemberCount",null),(0,xt.default)(this,"invitedMemberCount",null),(0,xt.default)(this,"summaryInvitedMemberCount",null),(0,xt.default)(this,"modified",void 0),(0,xt.default)(this,"members",{}),(0,xt.default)(this,"events",new Map),(0,xt.default)(this,"paginationToken",null),(0,xt.default)(this,"beacons",new Map),(0,xt.default)(this,"liveBeaconIds",[]),this.updateModifiedTime()}getJoinedMemberCount(){return this.summaryJoinedMemberCount!==null?this.summaryJoinedMemberCount:(this.joinedMemberCount===null&&(this.joinedMemberCount=this.getMembers().reduce((e,t)=>t.membership==="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,t)=>t.membership==="invite"?e+1:e,0)),this.invitedMemberCount)}setInvitedMemberCount(e){this.summaryInvitedMemberCount=e}getMembers(){return Object.values(this.members)}getMembersExcept(e){return this.getMembers().filter(t=>!e.includes(t.userId))}getMember(e){return this.members[e]||null}getSentinelMember(e){if(!e)return null;let t=this.sentinels[e];if(t===void 0){t=new eg.RoomMember(this.roomId,e);const r=this.members[e];r&&t.setMembershipEvent(r.events.member,this),this.sentinels[e]=t}return t}getStateEvents(e,t){if(!this.events.has(e))return t===void 0?[]:null;if(t===void 0)return Array.from(this.events.get(e).values());const r=this.events.get(e).get(t);return r||null}get hasLiveBeacons(){var e;return!!((e=this.liveBeaconIds)!==null&&e!==void 0&&e.length)}clone(){const e=new mf(this.roomId,this.oobMemberFlags),t=this.oobMemberFlags.status;return this.oobMemberFlags.status=mr.NotStarted,Array.from(this.events.values()).forEach(r=>{e.setStateEvents(Array.from(r.values()))}),this.oobMemberFlags.status=t,this.summaryInvitedMemberCount!==null&&e.setInvitedMemberCount(this.getInvitedMemberCount()),this.summaryJoinedMemberCount!==null&&e.setJoinedMemberCount(this.getJoinedMemberCount()),this.oobMemberFlags.status==mr.Finished&&this.getMembers().forEach(r=>{r.isOutOfBand()&&e.getMember(r.userId).markOutOfBand()}),e}setUnknownStateEvents(e){const t=e.filter(r=>!this.events.has(r.getType())||!this.events.get(r.getType()).has(r.getStateKey()));this.setStateEvents(t)}setStateEvents(e){this.updateModifiedTime(),e.forEach(t=>{if(t.getRoomId()!==this.roomId||!t.isState())return;(0,Fi.isBeaconInfoEventType)(t.getType())&&this.setBeacon(t);const r=this.getStateEventMatching(t);this.setStateEvent(t),t.getType()===zt.EventType.RoomMember&&(this.updateDisplayNameCache(t.getStateKey(),t.getContent().displayname),this.updateThirdPartyTokenCache(t)),this.emit(zr.Events,t,this,r)}),this.onBeaconLivenessChange(),e.forEach(t=>{if(t.getRoomId()===this.roomId&&!!t.isState()){if(t.getType()===zt.EventType.RoomMember){const r=t.getStateKey();(t.getContent().membership==="leave"||t.getContent().membership==="ban")&&(t.getContent().avatar_url=t.getContent().avatar_url||t.getPrevContent().avatar_url,t.getContent().displayname=t.getContent().displayname||t.getPrevContent().displayname);const i=this.getOrCreateMember(r,t);i.setMembershipEvent(t,this),this.updateMember(i),this.emit(zr.Members,t,this,i)}else if(t.getType()===zt.EventType.RoomPowerLevels){if(t.getStateKey()!=="")return;Object.values(this.members).forEach(i=>{const s=i.getLastModifiedTime();i.setPowerLevelEvent(t),s!==i.getLastModifiedTime()&&this.emit(zr.Members,t,this,i)}),this.sentinels={}}}}),this.emit(zr.Update,this)}getOrCreateMember(e,t){let r=this.members[e];return r||(r=new eg.RoomMember(this.roomId,e),this.members[e]=r,this.emit(zr.NewMember,t,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){if(this.beacons.has(e.getType()))return this.beacons.get(e.getType()).update(e);const t=new Fi.Beacon(e);this.reEmitter.reEmit(t,[Fi.BeaconEvent.New,Fi.BeaconEvent.Update,Fi.BeaconEvent.LivenessChange]),this.emit(Fi.BeaconEvent.New,e,t),t.on(Fi.BeaconEvent.LivenessChange,this.onBeaconLivenessChange.bind(this)),this.beacons.set(t.beaconInfoEventType,t)}onBeaconLivenessChange(){var e;const t=!!((e=this.liveBeaconIds)!==null&&e!==void 0&&e.length);this.liveBeaconIds=Array.from(this.beacons.values()).filter(i=>i.isLive).map(i=>i.beaconInfoId);const r=!!this.liveBeaconIds.length;t!==r&&this.emit(zr.BeaconLiveness,this,r)}getStateEventMatching(e){var t,r;return(t=(r=this.events.get(e.getType()))===null||r===void 0?void 0:r.get(e.getStateKey()))!==null&&t!==void 0?t:null}updateMember(e){const t=this.getStateEvents(zt.EventType.RoomPowerLevels,"");t&&e.setPowerLevelEvent(t),delete this.sentinels[e.userId],this.members[e.userId]=e,this.joinedMemberCount=null,this.invitedMemberCount=null}needsOutOfBandMembers(){return this.oobMemberFlags.status===mr.NotStarted}markOutOfBandMembersStarted(){this.oobMemberFlags.status===mr.NotStarted&&(this.oobMemberFlags.status=mr.InProgress)}markOutOfBandMembersFailed(){this.oobMemberFlags.status===mr.InProgress&&(this.oobMemberFlags.status=mr.NotStarted)}clearOutOfBandMembers(){let e=0;Object.keys(this.members).forEach(t=>{this.members[t].isOutOfBand()&&(++e,delete this.members[t])}),Ku.logger.log(`LL: RoomState removed ${e} members...`),this.oobMemberFlags.status=mr.NotStarted}setOutOfBandMembers(e){Ku.logger.log(`LL: RoomState about to set ${e.length} OOB members ...`),this.oobMemberFlags.status===mr.InProgress&&(Ku.logger.log("LL: RoomState put in finished state ..."),this.oobMemberFlags.status=mr.Finished,e.forEach(t=>this.setOutOfBandMember(t)),this.emit(zr.Update,this))}setOutOfBandMember(e){if(e.getType()!==zt.EventType.RoomMember)return;const t=e.getStateKey(),r=this.getMember(t);if(r&&!r.isOutOfBand())return;const i=this.getOrCreateMember(t,e);i.setMembershipEvent(e,this),i.markOutOfBand(),this.updateDisplayNameCache(i.userId,i.name),this.setStateEvent(e),this.updateMember(i),this.emit(zr.Members,e,this,i)}setTypingEvent(e){Object.values(this.members).forEach(function(t){t.setTypingEvent(e)})}getInviteForThreePidToken(e){return this.tokenToInvite[e]||null}updateModifiedTime(){this.modified=Date.now()}getLastModifiedTime(){return this.modified}getUserIdsWithDisplayName(e){return this.displayNameToUserIds[Qo.removeHiddenChars(e)]||[]}maySendRedactionForEvent(e,t){const r=this.getMember(t);if(!r||r.membership==="leave"||e.status||e.isRedacted())return!1;const i=this.maySendEvent(zt.EventType.RoomRedaction,t);return e.getSender()===t?i:this.hasSufficientPowerLevelFor("redact",r.powerLevel)}hasSufficientPowerLevelFor(e,t){const r=this.getStateEvents(zt.EventType.RoomPowerLevels,"");let i={};r&&(i=r.getContent());let s=50;return Qo.isNumber(i[e])&&(s=i[e]),t>=s}maySendMessage(e){return this.maySendEventOfType(zt.EventType.RoomMessage,e,!1)}maySendEvent(e,t){return this.maySendEventOfType(e,t,!1)}mayClientSendStateEvent(e,t){return t.isGuest()?!1:this.maySendStateEvent(e,t.credentials.userId)}maySendStateEvent(e,t){return this.maySendEventOfType(e,t,!0)}maySendEventOfType(e,t,r){const i=this.getStateEvents(zt.EventType.RoomPowerLevels,"");let s,o={},a=0,l=0,u=0;if(i){s=i.getContent(),o=s.events||{},Number.isSafeInteger(s.state_default)?a=s.state_default:a=50;const g=s.users&&s.users[t];Number.isSafeInteger(g)?u=g:Number.isSafeInteger(s.users_default)&&(u=s.users_default),Number.isSafeInteger(s.events_default)&&(l=s.events_default)}let c=r?a:l;return Number.isSafeInteger(o[e])&&(c=o[e]),u>=c}mayTriggerNotifOfType(e,t){const r=this.getMember(t);if(!r)return!1;const i=this.getStateEvents(zt.EventType.RoomPowerLevels,"");let s=50;return i&&i.getContent()&&i.getContent().notifications&&Qo.isNumber(i.getContent().notifications[e])&&(s=i.getContent().notifications[e]),r.powerLevel>=s}getJoinRule(){var e;const t=this.getStateEvents(zt.EventType.RoomJoinRules,"");return((e=t==null?void 0:t.getContent())!==null&&e!==void 0?e:{}).join_rule||Fu.JoinRule.Invite}getHistoryVisibility(){var e;const t=this.getStateEvents(zt.EventType.RoomHistoryVisibility,"");return((e=t==null?void 0:t.getContent())!==null&&e!==void 0?e:{}).history_visibility||Fu.HistoryVisibility.Shared}getGuestAccess(){var e;const t=this.getStateEvents(zt.EventType.RoomGuestAccess,"");return((e=t==null?void 0:t.getContent())!==null&&e!==void 0?e:{}).guest_access||Fu.GuestAccess.Forbidden}updateThirdPartyTokenCache(e){if(!e.getContent().third_party_invite)return;const t=(e.getContent().third_party_invite.signed||{}).token;!t||!this.getStateEvents(zt.EventType.RoomThirdPartyInvite,t)||(this.tokenToInvite[t]=e)}updateDisplayNameCache(e,t){const r=this.userIdsToDisplayNames[e];if(delete this.userIdsToDisplayNames[e],r){const s=Qo.removeHiddenChars(r),o=this.displayNameToUserIds[s];if(o){const a=o.filter(l=>l!==e);this.displayNameToUserIds[s]=a}}this.userIdsToDisplayNames[e]=t;const i=t&&Qo.removeHiddenChars(t);i&&(this.displayNameToUserIds[i]||(this.displayNameToUserIds[i]=[]),this.displayNameToUserIds[i].push(e))}}Tn.RoomState=mf;var RT=G.exports;Object.defineProperty(Qa,"__esModule",{value:!0});Qa.MemoryStore=void 0;var an=RT(Y.exports),IT=Qr,tg=Tn;function rg(n){return typeof n=="string"&&!!n&&n!=="undefined"&&n!=="null"||typeof n=="number"}class TT{constructor(e={}){(0,an.default)(this,"rooms",{}),(0,an.default)(this,"groups",{}),(0,an.default)(this,"users",{}),(0,an.default)(this,"syncToken",null),(0,an.default)(this,"filters",{}),(0,an.default)(this,"accountData",{}),(0,an.default)(this,"localStorage",void 0),(0,an.default)(this,"oobMembers",{}),(0,an.default)(this,"clientOptions",{}),(0,an.default)(this,"onRoomMember",(t,r,i)=>{if(i.membership==="invite")return;const s=this.users[i.userId]||new IT.User(i.userId);i.name&&(s.setDisplayName(i.name),i.events.member&&s.setRawDisplayName(i.events.member.getDirectionalContent().displayname)),i.events.member&&i.events.member.getContent().avatar_url&&s.setAvatarUrl(i.events.member.getContent().avatar_url),this.users[s.userId]=s}),this.localStorage=e.localStorage}getSyncToken(){return this.syncToken}isNewlyCreated(){return Promise.resolve(!0)}setSyncToken(e){this.syncToken=e}storeGroup(e){this.groups[e.groupId]=e}getGroup(e){return this.groups[e]||null}getGroups(){return Object.values(this.groups)}storeRoom(e){this.rooms[e.roomId]=e,e.currentState.on(tg.RoomStateEvent.Members,this.onRoomMember),e.currentState.getMembers().forEach(t=>{this.onRoomMember(null,e.currentState,t)})}getRoom(e){return this.rooms[e]||null}getRooms(){return Object.values(this.rooms)}removeRoom(e){this.rooms[e]&&this.rooms[e].currentState.removeListener(tg.RoomStateEvent.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,t){return[]}storeEvents(e,t,r,i){}storeFilter(e){!e||(this.filters[e.userId]||(this.filters[e.userId]={}),this.filters[e.userId][e.filterId]=e)}getFilter(e,t){return!this.filters[e]||!this.filters[e][t]?null:this.filters[e][t]}getFilterIdByName(e){if(!this.localStorage)return null;const t="mxjssdk_memory_filter_"+e;try{const r=this.localStorage.getItem(t);if(rg(r))return r}catch{}return null}setFilterIdByName(e,t){if(!this.localStorage)return;const r="mxjssdk_memory_filter_"+e;try{rg(t)?this.localStorage.setItem(r,t):this.localStorage.removeItem(r)}catch{}}storeAccountDataEvents(e){e.forEach(t=>{this.accountData[t.getType()]=t})}getAccountData(e){return this.accountData[e]}setSyncData(e){return Promise.resolve()}wantsSave(){return!1}save(e){}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={},this.accountData={},Promise.resolve()}getOutOfBandMembers(e){return Promise.resolve(this.oobMembers[e]||null)}setOutOfBandMembers(e,t){return this.oobMembers[e]=t,Promise.resolve()}clearOutOfBandMembers(e){return this.oobMembers={},Promise.resolve()}getClientOptions(){return Promise.resolve(this.clientOptions)}storeClientOptions(e){return this.clientOptions=Object.assign({},e),Promise.resolve()}}Qa.MemoryStore=TT;var Wl={},OT=G.exports;Object.defineProperty(Wl,"__esModule",{value:!0});Wl.MatrixScheduler=void 0;var Rc=OT(Y.exports),ng=CT(W),kT=ie;function xv(n){if(typeof WeakMap!="function")return null;var e=new WeakMap,t=new WeakMap;return(xv=function(r){return r?t:e})(n)}function CT(n,e){if(!e&&n&&n.__esModule)return n;if(n===null||typeof n!="object"&&typeof n!="function")return{default:n};var t=xv(e);if(t&&t.has(n))return t.get(n);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in n)if(s!=="default"&&Object.prototype.hasOwnProperty.call(n,s)){var o=i?Object.getOwnPropertyDescriptor(n,s):null;o&&(o.get||o.set)?Object.defineProperty(r,s,o):r[s]=n[s]}return r.default=n,t&&t.set(n,r),r}class Il{static RETRY_BACKOFF_RATELIMIT(e,t,r){if(r.httpStatus===400||r.httpStatus===403||r.httpStatus===401||r.cors==="rejected"||r.name==="M_TOO_LARGE")return-1;if(r.name==="M_LIMIT_EXCEEDED"){const i=r.data.retry_after_ms;if(i>0)return i}return t>4?-1:1e3*Math.pow(2,t)}static QUEUE_MESSAGES(e){return e.getType()===kT.EventType.RoomMessage||e.hasAssocation()?"message":null}constructor(e=Il.RETRY_BACKOFF_RATELIMIT,t=Il.QUEUE_MESSAGES){this.retryAlgorithm=e,this.queueAlgorithm=t,(0,Rc.default)(this,"queues",{}),(0,Rc.default)(this,"activeQueues",[]),(0,Rc.default)(this,"procFn",null),(0,Rc.default)(this,"processQueue",r=>{const i=this.peekNextEvent(r);if(!i){const s=this.activeQueues.indexOf(r);s>=0&&this.activeQueues.splice(s,1);return}Zo("Queue '%s' has %s pending events",r,this.queues[r].length),Promise.resolve().then(()=>this.procFn(i.event)).then(s=>{this.removeNextEvent(r),Zo("Queue '%s' sent event %s",r,i.event.getId()),i.defer.resolve(s),this.processQueue(r)},s=>{i.attempts+=1;const o=this.retryAlgorithm(i.event,i.attempts,s);Zo("retry(%s) err=%s event_id=%s waitTime=%s",i.attempts,s,i.event.getId(),o),o===-1?(Zo("Queue '%s' giving up on event %s",r,i.event.getId()),this.removeNextEvent(r),i.defer.reject(s),this.processQueue(r)):setTimeout(this.processQueue,o,r)})})}getQueueForEvent(e){const t=this.queueAlgorithm(e);return!t||!this.queues[t]?null:this.queues[t].map(function(r){return r.event})}removeEventFromQueue(e){const t=this.queueAlgorithm(e);if(!t||!this.queues[t])return!1;let r=!1;return ng.removeElement(this.queues[t],i=>{if(i.event.getId()===e.getId())return r=!0,!0}),r}setProcessFunction(e){this.procFn=e,this.startProcessingQueues()}queueEvent(e){const t=this.queueAlgorithm(e);if(!t)return null;this.queues[t]||(this.queues[t]=[]);const r=ng.defer();return this.queues[t].push({event:e,defer:r,attempts:0}),Zo("Queue algorithm dumped event %s into queue '%s'",e.getId(),t),this.startProcessingQueues(),r.promise}startProcessingQueues(){!this.procFn||Object.keys(this.queues).filter(e=>this.activeQueues.indexOf(e)===-1&&this.queues[e].length>0).forEach(e=>{this.activeQueues.push(e),this.processQueue(e)})}peekNextEvent(e){const t=this.queues[e];return Array.isArray(t)?t[0]:null}removeNextEvent(e){const t=this.queues[e];return Array.isArray(t)?t.shift():null}}Wl.MatrixScheduler=Il;function Zo(...n){}var st={},$i={},lr={},ti={},qt={},PT=G.exports;Object.defineProperty(qt,"__esModule",{value:!0});qt.EventTimeline=qt.Direction=void 0;var Yr=PT(Y.exports),ig=Tn,MT=ie;let gs;qt.Direction=gs;(function(n){n.Backward="b",n.Forward="f"})(gs||(qt.Direction=gs={}));class nr{static setEventMetadata(e,t,r){var i,s,o,a;(i=e.sender)!==null&&i!==void 0&&(s=i.events)!==null&&s!==void 0&&s.member||(e.sender=t.getSentinelMember(e.getSender())),!((o=e.target)!==null&&o!==void 0&&(a=o.events)!==null&&a!==void 0&&a.member)&&e.getType()===MT.EventType.RoomMember&&(e.target=t.getSentinelMember(e.getStateKey())),e.isState()&&r&&(e.forwardLooking=!1)}constructor(e){var t,r;this.eventTimelineSet=e,(0,Yr.default)(this,"roomId",void 0),(0,Yr.default)(this,"name",void 0),(0,Yr.default)(this,"events",[]),(0,Yr.default)(this,"baseIndex",0),(0,Yr.default)(this,"startState",void 0),(0,Yr.default)(this,"endState",void 0),(0,Yr.default)(this,"prevTimeline",void 0),(0,Yr.default)(this,"nextTimeline",void 0),(0,Yr.default)(this,"paginationRequests",{[gs.Backward]:null,[gs.Forward]:null}),this.roomId=(t=(r=e.room)===null||r===void 0?void 0:r.roomId)!==null&&t!==void 0?t:null,this.startState=new ig.RoomState(this.roomId),this.startState.paginationToken=null,this.endState=new ig.RoomState(this.roomId),this.endState.paginationToken=null,this.prevTimeline=null,this.nextTimeline=null,this.paginationRequests={b:null,f:null},this.name=this.roomId+":"+new Date().toISOString()}initialiseState(e){if(this.events.length>0)throw new Error("Cannot initialise state after events are added");for(const t of e)Object.freeze(t);this.startState.setStateEvents(e),this.endState.setStateEvents(e)}forkLive(e){const t=this.getState(e),r=new nr(this.eventTimelineSet);return r.startState=t.clone(),r.endState=t,this.endState=t.clone(),r}fork(e){const t=this.getState(e),r=new nr(this.eventTimelineSet);return r.startState=t.clone(),r.endState=t.clone(),r}getRoomId(){return this.roomId}getFilter(){return this.eventTimelineSet.getFilter()}getTimelineSet(){return this.eventTimelineSet}getBaseIndex(){return this.baseIndex}getEvents(){return this.events}getState(e){if(e==nr.BACKWARDS)return this.startState;if(e==nr.FORWARDS)return this.endState;throw new Error("Invalid direction '"+e+"'")}getPaginationToken(e){return this.getState(e).paginationToken}setPaginationToken(e,t){this.getState(t).paginationToken=e}getNeighbouringTimeline(e){if(e==nr.BACKWARDS)return this.prevTimeline;if(e==nr.FORWARDS)return this.nextTimeline;throw new Error("Invalid direction '"+e+"'")}setNeighbouringTimeline(e,t){if(this.getNeighbouringTimeline(t))throw new Error("timeline already has a neighbouring timeline - cannot reset neighbour (direction: "+t+")");if(t==nr.BACKWARDS)this.prevTimeline=e;else if(t==nr.FORWARDS)this.nextTimeline=e;else throw new Error("Invalid direction '"+t+"'");this.setPaginationToken(null,t)}addEvent(e,t,r){r||(r=t?this.startState:this.endState);const i=this.getTimelineSet();i.room&&(nr.setEventMetadata(e,r,t),e.isState()&&i.room.getUnfilteredTimelineSet()===i&&(r.setStateEvents([e]),(!e.sender||e.getType()==="m.room.member"&&!t)&&nr.setEventMetadata(e,r,t)));let s;t?s=0:s=this.events.length,this.events.splice(s,0,e),t&&this.baseIndex++}removeEvent(e){for(let t=this.events.length-1;t>=0;t--){const r=this.events[t];if(r.getId()==e)return this.events.splice(t,1),t<this.baseIndex&&this.baseIndex--,r}return null}toString(){return this.name}}qt.EventTimeline=nr;(0,Yr.default)(nr,"BACKWARDS",gs.Backward);(0,Yr.default)(nr,"FORWARDS",gs.Forward);var jt={},lt={},AT=G.exports;Object.defineProperty(lt,"__esModule",{value:!0});lt.ThreadFilterType=lt.ThreadEvent=lt.Thread=lt.THREAD_RELATION_TYPE=lt.FILTER_RELATED_BY_SENDERS=lt.FILTER_RELATED_BY_REL_TYPES=void 0;var Hr=AT(Y.exports),Ic=Cs,DT=tn,sg=jt,qu=qt,xT=ti,UT=je,yf=_r;let yo;lt.ThreadEvent=yo;(function(n){n.New="Thread.new",n.Update="Thread.update",n.NewReply="Thread.newReply",n.ViewThread="Thread.viewThread"})(yo||(lt.ThreadEvent=yo={}));class pn extends UT.TypedEventEmitter{constructor(e,t){var r;super();if(this.rootEvent=e,(0,Hr.default)(this,"timelineSet",void 0),(0,Hr.default)(this,"_currentUserParticipated",!1),(0,Hr.default)(this,"reEmitter",void 0),(0,Hr.default)(this,"lastEvent",void 0),(0,Hr.default)(this,"replyCount",0),(0,Hr.default)(this,"room",void 0),(0,Hr.default)(this,"client",void 0),(0,Hr.default)(this,"initialEventsFetched",!1),(0,Hr.default)(this,"id",void 0),(0,Hr.default)(this,"onEcho",o=>{this.timelineSet.eventIdToTimeline(o.getId())&&this.emit(yo.Update,this)}),this.room=t.room,this.client=t.client,this.timelineSet=new xT.EventTimelineSet(this.room,{unstableClientRelationAggregation:!0,timelineSupport:!0,pendingEvents:!0}),this.reEmitter=new DT.TypedReEmitter(this),this.reEmitter.reEmit(this.timelineSet,[Ic.RoomEvent.Timeline,Ic.RoomEvent.TimelineReset]),e)this.id=e.getId();else{var i,s;this.id=t==null||(i=t.initialEvents)===null||i===void 0||(s=i.find(o=>o.isThreadRelation))===null||s===void 0?void 0:s.relationEventId}this.initialiseThread(this.rootEvent),t==null||(r=t.initialEvents)===null||r===void 0||r.forEach(o=>this.addEvent(o,!1)),this.room.on(Ic.RoomEvent.LocalEchoUpdated,this.onEcho),this.room.on(Ic.RoomEvent.Timeline,this.onEcho)}static setServerSideSupport(e,t){pn.hasServerSideSupport=e,t||(Uv.setPreferUnstable(!0),$v.setPreferUnstable(!0),Sa.setPreferUnstable(!0))}get roomState(){return this.room.getLiveTimeline().getState(qu.EventTimeline.FORWARDS)}addEventToTimeline(e,t){if(e.getUnsigned().transaction_id){const r=this.room.getEventForTxnId(e.getUnsigned().transaction_id);if(r){this.room.handleRemoteEcho(e,r);return}}this.findEventById(e.getId())||this.timelineSet.addEventToTimeline(e,this.liveTimeline,t,!1,this.roomState)}async addEvent(e,t){var r;pn.hasServerSideSupport||(e.setThread(this),this.addEventToTimeline(e,t),await this.client.decryptEventIfNeeded(e,{})),pn.hasServerSideSupport&&this.initialEventsFetched&&e.localTimestamp>this.lastReply().localTimestamp&&this.addEventToTimeline(e,!1),!this._currentUserParticipated&&e.getSender()===this.client.getUserId()&&(this._currentUserParticipated=!0);const i=((r=e.getRelation())===null||r===void 0?void 0:r.rel_type)===Sa.name;!pn.hasServerSideSupport&&i&&this.replyCount++,(!this.lastEvent||i&&e.getId()!==this.lastEvent.getId()&&e.localTimestamp>this.lastEvent.localTimestamp)&&(this.lastEvent=e,this.lastEvent.getId()!==this.id&&(pn.hasServerSideSupport&&this.replyCount++,this.emit(yo.NewReply,this,e))),this.emit(yo.Update,this)}initialiseThread(e){const t=e==null?void 0:e.getServerAggregatedRelation(Sa.name);if(pn.hasServerSideSupport&&t){this.replyCount=t.count,this._currentUserParticipated=t.current_user_participated;const r=new sg.MatrixEvent(t.latest_event);this.setEventMetadata(r),this.lastEvent=r}}async fetchInitialEvents(){if(!pn.hasServerSideSupport)return this.initialEventsFetched=!0,null;try{const e=await this.fetchEvents();return this.initialEventsFetched=!0,e}catch{return null}}setEventMetadata(e){qu.EventTimeline.setEventMetadata(e,this.roomState,!1),e.setThread(this)}findEventById(e){return this.timelineSet.findEventById(e)}lastReply(e=()=>!0){for(let t=this.events.length-1;t>=0;t--){const r=this.events[t];if(e(r))return r}}get roomId(){return this.room.roomId}get length(){return this.replyCount}get replyToEvent(){return this.lastEvent}get events(){return this.liveTimeline.getEvents()}has(e){return this.timelineSet.findEventById(e)instanceof sg.MatrixEvent}get hasCurrentUserParticipated(){return this._currentUserParticipated}get liveTimeline(){return this.timelineSet.getLiveTimeline()}async fetchEvents(e={limit:20}){let{originalEvent:t,events:r,prevBatch:i,nextBatch:s}=await this.client.relations(this.room.roomId,this.id,Sa.name,null,e);!e.to&&!s&&(r=[...r,t]),await Promise.all(r.map(a=>(this.setEventMetadata(a),this.client.decryptEventIfNeeded(a))));const o=!e.direction||e.direction===qu.Direction.Backward;return this.timelineSet.addEventsToTimeline(r,o,this.liveTimeline,o?s:i),{originalEvent:t,events:r,prevBatch:i,nextBatch:s}}}lt.Thread=pn;(0,Hr.default)(pn,"hasServerSideSupport",void 0);const Uv=new yf.ServerControlledNamespacedValue("related_by_senders","io.element.relation_senders");lt.FILTER_RELATED_BY_SENDERS=Uv;const $v=new yf.ServerControlledNamespacedValue("related_by_rel_types","io.element.relation_types");lt.FILTER_RELATED_BY_REL_TYPES=$v;const Sa=new yf.ServerControlledNamespacedValue("m.thread","io.element.thread");lt.THREAD_RELATION_TYPE=Sa;let vh;lt.ThreadFilterType=vh;(function(n){n[n.My=0]="My",n[n.All=1]="All"})(vh||(lt.ThreadFilterType=vh={}));var qo={};Object.defineProperty(qo,"__esModule",{value:!0});qo.EventStatus=void 0;let _h;qo.EventStatus=_h;(function(n){n.NOT_SENT="not_sent",n.ENCRYPTING="encrypting",n.SENDING="sending",n.QUEUED="queued",n.SENT="sent",n.CANCELLED="cancelled"})(_h||(qo.EventStatus=_h={}));(function(n){var e=G.exports;Object.defineProperty(n,"__esModule",{value:!0}),Object.defineProperty(n,"EventStatus",{enumerable:!0,get:function(){return c.EventStatus}}),n.MatrixEventEvent=n.MatrixEvent=void 0;var t=e(Y.exports),r=Fl,i=se,s=ie,o=W,a=lt,l=tn,u=je,c=qo;const g={};function m(C){return g[C]||(g[C]=C),g[C]}const f=Object.freeze({visible:!0});let E;n.MatrixEventEvent=E,function(C){C.Decrypted="Event.decrypted",C.BeforeRedaction="Event.beforeRedaction",C.VisibilityChange="Event.visibilityChange",C.LocalEventIdReplaced="Event.localEventIdReplaced",C.Status="Event.status",C.Replaced="Event.replaced",C.RelationsCreated="Event.relationsCreated"}(E||(n.MatrixEventEvent=E={}));class I extends u.TypedEventEmitter{constructor(S={}){var T;super();this.event=S,(0,t.default)(this,"pushActions",null),(0,t.default)(this,"_replacingEvent",null),(0,t.default)(this,"_localRedactionEvent",null),(0,t.default)(this,"_isCancelled",!1),(0,t.default)(this,"clearEvent",void 0),(0,t.default)(this,"visibility",f),(0,t.default)(this,"_hasCachedExtEv",!1),(0,t.default)(this,"_cachedExtEv",void 0),(0,t.default)(this,"senderCurve25519Key",null),(0,t.default)(this,"claimedEd25519Key",null),(0,t.default)(this,"forwardingCurve25519KeyChain",[]),(0,t.default)(this,"untrusted",null),(0,t.default)(this,"_decryptionPromise",null),(0,t.default)(this,"retryDecryption",!1),(0,t.default)(this,"txnId",null),(0,t.default)(this,"thread",null),(0,t.default)(this,"threadId",void 0),(0,t.default)(this,"localTimestamp",void 0),(0,t.default)(this,"sender",null),(0,t.default)(this,"target",null),(0,t.default)(this,"status",null),(0,t.default)(this,"error",null),(0,t.default)(this,"forwardLooking",!0),(0,t.default)(this,"verificationRequest",null),(0,t.default)(this,"reEmitter",void 0),["state_key","type","sender","room_id","membership"].forEach(D=>{typeof S[D]=="string"&&(S[D]=m(S[D]))}),["membership","avatar_url","displayname"].forEach(D=>{var R;typeof((R=S.content)===null||R===void 0?void 0:R[D])=="string"&&(S.content[D]=m(S.content[D]))}),["rel_type"].forEach(D=>{var R,U;typeof((R=S.content)===null||R===void 0||(U=R["m.relates_to"])===null||U===void 0?void 0:U[D])=="string"&&(S.content["m.relates_to"][D]=m(S.content["m.relates_to"][D]))}),this.txnId=S.txn_id||null,this.localTimestamp=Date.now()-((T=this.getAge())!==null&&T!==void 0?T:0),this.reEmitter=new l.TypedReEmitter(this)}get unstableExtensibleEvent(){return this._hasCachedExtEv||(this._cachedExtEv=r.ExtensibleEvents.parse(this.getEffectiveEvent())),this._cachedExtEv}invalidateExtensibleEvent(){this._hasCachedExtEv=!1}getEffectiveEvent(){const S=Object.assign({},this.getContent());if(this.getWireType()===s.EventType.RoomMessageEncrypted)for(const[T,D]of Object.entries(this.getWireContent()))["algorithm","ciphertext","device_id","sender_key","session_id"].includes(T)||S[T]===void 0&&(S[T]=D);return Object.assign({},this.event,this.clearEvent,{content:S})}getId(){return this.event.event_id}getSender(){return this.event.sender||this.event.user_id}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}getOriginalContent(){return this._localRedactionEvent?{}:this.clearEvent?this.clearEvent.content||{}:this.event.content||{}}getContent(){return this._localRedactionEvent?{}:this._replacingEvent?this._replacingEvent.getContent()["m.new_content"]||{}:this.getOriginalContent()}getWireContent(){return this.event.content||{}}get threadRootId(){var S;const T=(S=this.getWireContent())===null||S===void 0?void 0:S["m.relates_to"];if((T==null?void 0:T.rel_type)===a.THREAD_RELATION_TYPE.name)return T.event_id;var D;return((D=this.getThread())===null||D===void 0?void 0:D.id)||this.threadId}get isThreadRelation(){return!!this.threadRootId&&this.threadId!==this.getId()}get isThreadRoot(){var S;return!!this.getServerAggregatedRelation(a.THREAD_RELATION_TYPE.name)||((S=this.getThread())===null||S===void 0?void 0:S.id)===this.getId()}get replyEventId(){var S;const T=this.getContent()["m.relates_to"]||this.getWireContent()["m.relates_to"];return T==null||(S=T["m.in_reply_to"])===null||S===void 0?void 0:S.event_id}get relationEventId(){var S,T;return(S=this.getWireContent())===null||S===void 0||(T=S["m.relates_to"])===null||T===void 0?void 0:T.event_id}getPrevContent(){return this.getUnsigned().prev_content||this.event.prev_content||{}}getDirectionalContent(){return this.forwardLooking?this.getContent():this.getPrevContent()}getAge(){return this.getUnsigned().age||this.event.age}getLocalAge(){return Date.now()-this.localTimestamp}getStateKey(){return this.event.state_key}isState(){return this.event.state_key!==void 0}makeEncrypted(S,T,D,R){this.clearEvent={type:this.event.type,content:this.event.content},this.event.type=S,this.event.content=T,this.senderCurve25519Key=D,this.claimedEd25519Key=R}isBeingDecrypted(){return this._decryptionPromise!=null}getDecryptionPromise(){return this._decryptionPromise}isDecryptionFailure(){var S,T;return((S=this.clearEvent)===null||S===void 0||(T=S.content)===null||T===void 0?void 0:T.msgtype)==="m.bad.encrypted"}shouldAttemptDecryption(){return!(this.isRedacted()||this.isBeingDecrypted()||this.clearEvent||!this.isEncrypted())}async attemptDecryption(S,T={}){if(typeof T=="boolean"&&(T={isRetry:T}),!this.isEncrypted())throw new Error("Attempt to decrypt event which isn't encrypted");if(this.clearEvent&&!this.isDecryptionFailure())throw new Error("Attempt to decrypt event which has already been decrypted");return this._decryptionPromise?(i.logger.log(`Event ${this.getId()} already being decrypted; queueing a retry`),this.retryDecryption=!0,this._decryptionPromise):(this._decryptionPromise=this.decryptionLoop(S,T),this._decryptionPromise)}cancelAndResendKeyRequest(S,T){const D=this.getWireContent();return S.requestRoomKey({algorithm:D.algorithm,room_id:this.getRoomId(),session_id:D.session_id,sender_key:D.sender_key},this.getKeyRequestRecipients(T),!0)}getKeyRequestRecipients(S){const T=this.getWireContent(),D=[{userId:S,deviceId:"*"}],R=this.getSender();return R!==S&&D.push({userId:R,deviceId:T.device_id}),D}async decryptionLoop(S,T={}){for(await Promise.resolve();;){this.retryDecryption=!1;let D,R;try{S?(D=await S.decryptEvent(this),T.isRetry===!0&&i.logger.info(`Decrypted event on retry (id=${this.getId()})`)):D=this.badEncryptedMessage("Encryption not enabled")}catch(U){if(U.name!=="DecryptionError"){const q=T.isRetry?"re":"";i.logger.error(`Error ${q}decrypting event (id=${this.getId()}): ${U.stack||U}`),this._decryptionPromise=null,this.retryDecryption=!1;return}if(R=U,this.retryDecryption){i.logger.log(`Got error decrypting event (id=${this.getId()}: ${U}), but retrying`);continue}i.logger.warn(`Error decrypting event (id=${this.getId()}): ${U.detailedString}`),D=this.badEncryptedMessage(U.message)}this._decryptionPromise=null,this.retryDecryption=!1,this.setClearData(D),this.setPushActions(null),T.emit!==!1&&this.emit(E.Decrypted,this,R);return}}badEncryptedMessage(S){return{clearEvent:{type:s.EventType.RoomMessage,content:{msgtype:"m.bad.encrypted",body:"** Unable to decrypt: "+S+" **"}}}}setClearData(S){this.clearEvent=S.clearEvent,this.senderCurve25519Key=S.senderCurve25519Key||null,this.claimedEd25519Key=S.claimedEd25519Key||null,this.forwardingCurve25519KeyChain=S.forwardingCurve25519KeyChain||[],this.untrusted=S.untrusted||!1,this.invalidateExtensibleEvent()}getClearContent(){return this.clearEvent?this.clearEvent.content:null}isEncrypted(){return!this.isState()&&this.event.type===s.EventType.RoomMessageEncrypted}getSenderKey(){return this.senderCurve25519Key}getKeysClaimed(){return{ed25519:this.claimedEd25519Key}}getClaimedEd25519Key(){return this.claimedEd25519Key}getForwardingCurve25519KeyChain(){return this.forwardingCurve25519KeyChain}isKeySourceUntrusted(){return this.untrusted}getUnsigned(){return this.event.unsigned||{}}setUnsigned(S){this.event.unsigned=S}unmarkLocallyRedacted(){const S=this._localRedactionEvent;return this._localRedactionEvent=null,this.event.unsigned&&(this.event.unsigned.redacted_because=null),!!S}markLocallyRedacted(S){this._localRedactionEvent||(this.emit(E.BeforeRedaction,this,S),this._localRedactionEvent=S,this.event.unsigned||(this.event.unsigned={}),this.event.unsigned.redacted_because=S.event)}applyVisibilityEvent(S){const T=S?S.visible:!0,D=S?S.reason:null;let R=!1;(this.visibility.visible!==S.visible||!this.visibility.visible&&this.visibility.reason!==D)&&(R=!0),R&&(T?this.visibility=f:this.visibility=Object.freeze({visible:!1,reason:D}),R&&this.emit(E.VisibilityChange,this,T))}messageVisibility(){return this.visibility}makeRedacted(S){if(!S.event)throw new Error("invalid redactionEvent in makeRedacted");this._localRedactionEvent=null,this.emit(E.BeforeRedaction,this,S),this._replacingEvent=null,this.event.unsigned||(this.event.unsigned={}),this.event.unsigned.redacted_because=S.event;let T;for(T in this.event)!this.event.hasOwnProperty(T)||w.has(T)||delete this.event[T];const D=k[this.getType()]||{},R=this.getContent();for(T in R)!R.hasOwnProperty(T)||D[T]||delete R[T];this.invalidateExtensibleEvent()}isRedacted(){return Boolean(this.getUnsigned().redacted_because)}isRedaction(){return this.getType()===s.EventType.RoomRedaction}asVisibilityChange(){if(!s.EVENT_VISIBILITY_CHANGE_TYPE.matches(this.getType()))return null;const S=this.getRelation();if(!S||S.rel_type!="m.reference")return null;const T=S.event_id;if(!T)return null;const D=this.getWireContent(),R=!!D.visible,U=D.reason;return U&&typeof U!="string"?null:{visible:R,reason:U,eventId:T}}isVisibilityEvent(){return s.EVENT_VISIBILITY_CHANGE_TYPE.matches(this.getType())}getRedactionEvent(){var S;if(!this.isRedacted())return null;if((S=this.clearEvent)!==null&&S!==void 0&&S.unsigned){var T;return(T=this.clearEvent)===null||T===void 0?void 0:T.unsigned.redacted_because}else return this.event.unsigned.redacted_because?this.event.unsigned.redacted_because:{}}getPushActions(){return this.pushActions}setPushActions(S){this.pushActions=S}handleRemoteEcho(S){const T=this.getUnsigned(),D=this.getId();this.event=S,T.redacted_because&&(this.event.unsigned||(this.event.unsigned={}),this.event.unsigned.redacted_because=T.redacted_because),this.setStatus(null),this.getId()!==D&&this.emit(E.LocalEventIdReplaced,this),this.localTimestamp=Date.now()-this.getAge()}isSending(){return!!this.status}setStatus(S){this.status=S,this.emit(E.Status,this,S)}replaceLocalEventId(S){this.event.event_id=S,this.emit(E.LocalEventIdReplaced,this)}isRelation(S=void 0){const T=this.getWireContent(),D=T&&T["m.relates_to"];return D&&D.rel_type&&D.event_id&&(S&&D.rel_type===S||!S)}getRelation(){return this.isRelation()?this.getWireContent()["m.relates_to"]:null}makeReplaced(S){this.isRedacted()&&S||this._replacingEvent!==S&&(this._replacingEvent=S,this.emit(E.Replaced,this),this.invalidateExtensibleEvent())}getAssociatedStatus(){return this._replacingEvent?this._replacingEvent.status:this._localRedactionEvent?this._localRedactionEvent.status:this.status}getServerAggregatedRelation(S){var T;return(T=this.getUnsigned()["m.relations"])===null||T===void 0?void 0:T[S]}replacingEventId(){const S=this.getServerAggregatedRelation(s.RelationType.Replace);if(S)return S.event_id;if(this._replacingEvent)return this._replacingEvent.getId()}replacingEvent(){return this._replacingEvent}replacingEventDate(){const S=this.getServerAggregatedRelation(s.RelationType.Replace);if(S){const T=S.origin_server_ts;if(Number.isFinite(T))return new Date(T)}else if(this._replacingEvent)return this._replacingEvent.getDate()}localRedactionEvent(){return this._localRedactionEvent}getAssociatedId(){const S=this.getRelation();if(this.replyEventId)return this.replyEventId;if(S)return S.event_id;if(this.isRedaction())return this.event.redacts}hasAssocation(){return!!this.getAssociatedId()}updateAssociatedId(S){const T=this.getRelation();T?T.event_id=S:this.isRedaction()&&(this.event.redacts=S)}flagCancelled(S=!0){this._isCancelled=S}isCancelled(){return this._isCancelled}toSnapshot(){const S=new I(JSON.parse(JSON.stringify(this.event)));for(const[T,D]of Object.entries(this))T!=="event"&&(S[T]=D);return S}isEquivalentTo(S){if(!S)return!1;if(S===this)return!0;const T=(0,o.deepSortedObjectEntries)(this.event),D=(0,o.deepSortedObjectEntries)(S.event);return JSON.stringify(T)===JSON.stringify(D)}toJSON(){const S=this.getEffectiveEvent();return this.isEncrypted()?{decrypted:S,encrypted:this.event}:S}setVerificationRequest(S){this.verificationRequest=S}setTxnId(S){this.txnId=S}getTxnId(){return this.txnId}setThread(S){this.thread=S,this.setThreadId(S.id),this.reEmitter.reEmit(S,[a.ThreadEvent.Update])}getThread(){return this.thread}setThreadId(S){this.threadId=S}}n.MatrixEvent=I;const w=new Set(["event_id","type","room_id","user_id","sender","state_key","prev_state","content","unsigned","origin_server_ts"]),k={[s.EventType.RoomMember]:{membership:1},[s.EventType.RoomCreate]:{creator:1},[s.EventType.RoomJoinRules]:{join_rule:1},[s.EventType.RoomPowerLevels]:{ban:1,events:1,events_default:1,kick:1,redact:1,state_default:1,users:1,users_default:1},[s.EventType.RoomAliases]:{aliases:1}}})(jt);var ms={},$T=G.exports;Object.defineProperty(ms,"__esModule",{value:!0});ms.RelationsEvent=ms.Relations=void 0;var xn=$T(Y.exports),qi=jt,Tc=se,Vr=ie,NT=je;let vo;ms.RelationsEvent=vo;(function(n){n.Add="Relations.add",n.Remove="Relations.remove",n.Redaction="Relations.redaction"})(vo||(ms.RelationsEvent=vo={}));class LT extends NT.TypedEventEmitter{constructor(e,t,r){super();this.relationType=e,this.eventType=t,this.room=r,(0,xn.default)(this,"relationEventIds",new Set),(0,xn.default)(this,"relations",new Set),(0,xn.default)(this,"annotationsByKey",{}),(0,xn.default)(this,"annotationsBySender",{}),(0,xn.default)(this,"sortedAnnotationsByKey",[]),(0,xn.default)(this,"targetEvent",null),(0,xn.default)(this,"creationEmitted",!1),(0,xn.default)(this,"onEventStatus",(i,s)=>{if(!i.isSending()){i.removeListener(qi.MatrixEventEvent.Status,this.onEventStatus);return}s===qi.EventStatus.CANCELLED&&(i.removeListener(qi.MatrixEventEvent.Status,this.onEventStatus),this.removeEvent(i))}),(0,xn.default)(this,"onBeforeRedaction",async i=>{if(!!this.relations.has(i)){if(this.relations.delete(i),this.relationType===Vr.RelationType.Annotation)this.removeAnnotationFromAggregation(i);else if(this.relationType===Vr.RelationType.Replace&&this.targetEvent){const s=await this.getLastReplacement();this.targetEvent.makeReplaced(s)}i.removeListener(qi.MatrixEventEvent.BeforeRedaction,this.onBeforeRedaction),this.emit(vo.Redaction,i)}})}async addEvent(e){if(this.relationEventIds.has(e.getId()))return;const t=e.getRelation();if(!t){Tc.logger.error("Event must have relation info");return}const r=t.rel_type,i=e.getType();if(this.relationType!==r||this.eventType!==i){Tc.logger.error("Event relation info doesn't match this container");return}if(e.isSending()&&e.on(qi.MatrixEventEvent.Status,this.onEventStatus),this.relations.add(e),this.relationEventIds.add(e.getId()),this.relationType===Vr.RelationType.Annotation)this.addAnnotationToAggregation(e);else if(this.relationType===Vr.RelationType.Replace&&this.targetEvent){const s=await this.getLastReplacement();this.targetEvent.makeReplaced(s)}e.on(qi.MatrixEventEvent.BeforeRedaction,this.onBeforeRedaction),this.emit(vo.Add,e),this.maybeEmitCreated()}async removeEvent(e){if(!this.relations.has(e))return;const t=e.getRelation();if(!t){Tc.logger.error("Event must have relation info");return}const r=t.rel_type,i=e.getType();if(this.relationType!==r||this.eventType!==i){Tc.logger.error("Event relation info doesn't match this container");return}if(this.relations.delete(e),this.relationType===Vr.RelationType.Annotation)this.removeAnnotationFromAggregation(e);else if(this.relationType===Vr.RelationType.Replace&&this.targetEvent){const s=await this.getLastReplacement();this.targetEvent.makeReplaced(s)}this.emit(vo.Remove,e)}getRelations(){return[...this.relations]}addAnnotationToAggregation(e){const{key:t}=e.getRelation();if(!t)return;let r=this.annotationsByKey[t];r||(r=this.annotationsByKey[t]=new Set,this.sortedAnnotationsByKey.push([t,r])),r.add(e),this.sortedAnnotationsByKey.sort((o,a)=>{const l=o[1];return a[1].size-l.size});const i=e.getSender();let s=this.annotationsBySender[i];s||(s=this.annotationsBySender[i]=new Set),s.add(e)}removeAnnotationFromAggregation(e){const{key:t}=e.getRelation();if(!t)return;const r=this.annotationsByKey[t];r&&(r.delete(e),this.sortedAnnotationsByKey.sort((o,a)=>{const l=o[1];return a[1].size-l.size}));const i=e.getSender(),s=this.annotationsBySender[i];s&&s.delete(e)}getSortedAnnotationsByKey(){return this.relationType!==Vr.RelationType.Annotation?null:this.sortedAnnotationsByKey}getAnnotationsBySender(){return this.relationType!==Vr.RelationType.Annotation?null:this.annotationsBySender}async getLastReplacement(){if(this.relationType!==Vr.RelationType.Replace||!this.targetEvent)return null;const e=this.targetEvent.getServerAggregatedRelation(Vr.RelationType.Replace),t=e&&e.origin_server_ts,r=this.getRelations().reduce((i,s)=>s.getSender()!==this.targetEvent.getSender()||t&&t>s.getTs()||i&&i.getTs()>s.getTs()?i:s,null);return r!=null&&r.shouldAttemptDecryption()?await r.attemptDecryption(this.room.client.crypto):r!=null&&r.isBeingDecrypted()&&await r.getDecryptionPromise(),r}async setTargetEvent(e){if(!this.targetEvent){if(this.targetEvent=e,this.relationType===Vr.RelationType.Replace){const t=await this.getLastReplacement();t&&this.targetEvent.makeReplaced(t)}this.maybeEmitCreated()}}maybeEmitCreated(){this.creationEmitted||!this.targetEvent||!this.relations.size||(this.creationEmitted=!0,this.targetEvent.emit(qi.MatrixEventEvent.RelationsCreated,this.relationType,this.eventType))}}ms.Relations=LT;var BT=G.exports;Object.defineProperty(ti,"__esModule",{value:!0});ti.EventTimelineSet=ti.DuplicateStrategy=void 0;var vi=BT(Y.exports),dt=qt,og=jt,is=se,KT=ms,ju=lr,FT=je;let oo;oo=is.logger.log.bind(is.logger);let qa;ti.DuplicateStrategy=qa;(function(n){n.Ignore="ignore",n.Replace="replace"})(qa||(ti.DuplicateStrategy=qa={}));class qT extends FT.TypedEventEmitter{constructor(e,t){super();this.room=e,(0,vi.default)(this,"timelineSupport",void 0),(0,vi.default)(this,"unstableClientRelationAggregation",void 0),(0,vi.default)(this,"displayPendingEvents",void 0),(0,vi.default)(this,"liveTimeline",void 0),(0,vi.default)(this,"timelines",void 0),(0,vi.default)(this,"_eventIdToTimeline",void 0),(0,vi.default)(this,"filter",void 0),(0,vi.default)(this,"relations",void 0),this.timelineSupport=Boolean(t.timelineSupport),this.liveTimeline=new dt.EventTimeline(this),this.unstableClientRelationAggregation=!!t.unstableClientRelationAggregation,this.displayPendingEvents=t.pendingEvents!==!1,this.timelines=[this.liveTimeline],this._eventIdToTimeline={},this.filter=t.filter,this.unstableClientRelationAggregation&&(this.relations={})}getTimelines(){return this.timelines}getFilter(){return this.filter}setFilter(e){this.filter=e}getPendingEvents(){return!this.room||!this.displayPendingEvents?[]:this.room.getPendingEvents()}getLiveTimeline(){return this.liveTimeline}eventIdToTimeline(e){return this._eventIdToTimeline[e]}replaceEventId(e,t){const r=this._eventIdToTimeline[e];r&&(delete this._eventIdToTimeline[e],this._eventIdToTimeline[t]=r)}resetLiveTimeline(e,t){const r=!this.timelineSupport||!t,i=this.liveTimeline,s=r?i.forkLive(dt.EventTimeline.FORWARDS):i.fork(dt.EventTimeline.FORWARDS);r?(this.timelines=[s],this._eventIdToTimeline={}):this.timelines.push(s),t&&i.setPaginationToken(t,dt.EventTimeline.FORWARDS),s.setPaginationToken(e,dt.EventTimeline.BACKWARDS),this.liveTimeline=s,this.emit(ju.RoomEvent.TimelineReset,this.room,this,r)}getTimelineForEvent(e){const t=this._eventIdToTimeline[e];return t===void 0?null:t}findEventById(e){const t=this.getTimelineForEvent(e);if(!!t)return t.getEvents().find(function(r){return r.getId()==e})}addTimeline(){if(!this.timelineSupport)throw new Error("timeline support is disabled. Set the 'timelineSupport' parameter to true when creating MatrixClient to enable it.");const e=new dt.EventTimeline(this);return this.timelines.push(e),e}addEventsToTimeline(e,t,r,i){if(!r)throw new Error("'timeline' not specified for EventTimelineSet.addEventsToTimeline");if(!t&&r==this.liveTimeline)throw new Error("EventTimelineSet.addEventsToTimeline cannot be used for adding events to the live timeline - use Room.addLiveEvents instead");if(this.filter&&(e=this.filter.filterRoomTimeline(e),!e.length))return;const s=t?dt.EventTimeline.BACKWARDS:dt.EventTimeline.FORWARDS,o=t?dt.EventTimeline.FORWARDS:dt.EventTimeline.BACKWARDS;let a=!1,l=!1;for(let u=0;u<e.length;u++){const c=e[u],g=c.getId(),m=this._eventIdToTimeline[g];if(!m){this.addEventToTimeline(c,r,t),l=!0,a=!0;continue}if(l=!1,m==r){oo("Event "+g+" already in timeline "+r);continue}const f=r.getNeighbouringTimeline(s);if(f){m==f?oo("Event "+g+" in neighbouring timeline - switching to "+m):oo("Event "+g+" already in a different timeline "+m),r=m;continue}is.logger.info("Already have timeline for "+g+" - joining timeline "+r+" to "+m);const E=m===this.liveTimeline,I=r===this.liveTimeline,w=s===dt.EventTimeline.BACKWARDS&&E,k=s===dt.EventTimeline.FORWARDS&&I;if(w||k){w&&is.logger.warn("Refusing to set a preceding existingTimeLine on our timeline as the existingTimeLine is live ("+m+")"),k&&is.logger.warn("Refusing to set our preceding timeline on a existingTimeLine as our timeline is live ("+r+")");continue}r.setNeighbouringTimeline(m,s),m.setNeighbouringTimeline(r,o),r=m,a=!0}if(l||!a){if(s===dt.EventTimeline.FORWARDS&&r===this.liveTimeline){is.logger.warn({lastEventWasNew:l,didUpdate:a}),is.logger.warn(`Refusing to set forwards pagination token of live timeline ${r} to ${i}`);return}r.setPaginationToken(i,s)}}addLiveEvent(e,t=qa.Ignore,r=!1,i){if(this.filter&&!this.filter.filterRoomTimeline([e]).length)return;const s=this._eventIdToTimeline[e.getId()];if(s){if(t===qa.Replace){oo("EventTimelineSet.addLiveEvent: replacing duplicate event "+e.getId());const o=s.getEvents();for(let a=0;a<o.length;a++)if(o[a].getId()===e.getId()){i||(i=s.getState(dt.EventTimeline.FORWARDS)),dt.EventTimeline.setEventMetadata(e,i,!1),o[a]=e;break}}else oo("EventTimelineSet.addLiveEvent: ignoring duplicate event "+e.getId());return}this.addEventToTimeline(e,this.liveTimeline,!1,r,i)}addEventToTimeline(e,t,r,i=!1,s){const o=e.getId();t.addEvent(e,r,s),this._eventIdToTimeline[o]=t,this.setRelationsTarget(e),this.aggregateRelations(e);const a={timeline:t,liveEvent:!r&&t==this.liveTimeline&&!i};this.emit(ju.RoomEvent.Timeline,e,this.room,Boolean(r),!1,a)}handleRemoteEcho(e,t,r){const i=this._eventIdToTimeline[t];i?(delete this._eventIdToTimeline[t],this._eventIdToTimeline[r]=i):this.filter?this.filter.filterRoomTimeline([e]).length&&this.addEventToTimeline(e,this.liveTimeline,!1):this.addEventToTimeline(e,this.liveTimeline,!1)}removeEvent(e){const t=this._eventIdToTimeline[e];if(!t)return null;const r=t.removeEvent(e);if(r){delete this._eventIdToTimeline[e];const i={timeline:t};this.emit(ju.RoomEvent.Timeline,r,this.room,void 0,!0,i)}return r}compareEventOrdering(e,t){if(e==t)return 0;const r=this._eventIdToTimeline[e],i=this._eventIdToTimeline[t];if(r===void 0||i===void 0)return null;if(r===i){let o,a;const l=r.getEvents();for(let u=0;u<l.length&&(o===void 0||a===void 0);u++){const c=l[u].getId();c==e&&(o=u),c==t&&(a=u)}return o-a}let s=r;for(;s;){if(s===i)return-1;s=s.getNeighbouringTimeline(dt.EventTimeline.FORWARDS)}for(s=r;s;){if(s===i)return 1;s=s.getNeighbouringTimeline(dt.EventTimeline.BACKWARDS)}return null}getRelationsForEvent(e,t,r){if(!this.unstableClientRelationAggregation)throw new Error("Client-side relation aggregation is disabled");if(!e||!t||!r)throw new Error("Invalid arguments for `getRelationsForEvent`");return((this.relations[e]||{})[t]||{})[r]}getAllRelationsEventForEvent(e){const t=this.relations[e]||{},r=[];for(const i of Object.values(t))for(const s of Object.values(i))r.push(...s.getRelations());return r}setRelationsTarget(e){if(!this.unstableClientRelationAggregation)return;const t=this.relations[e.getId()];if(!!t)for(const r of Object.values(t))for(const i of Object.values(r))i.setTargetEvent(e)}aggregateRelations(e){if(!this.unstableClientRelationAggregation||e.isRedacted()||e.status===og.EventStatus.CANCELLED)return;if(e.isBeingDecrypted()||e.shouldAttemptDecryption()){e.once(og.MatrixEventEvent.Decrypted,()=>{this.aggregateRelations(e)});return}const t=e.getRelation();if(!t)return;const r=t.event_id,i=t.rel_type,s=e.getType();let o=this.relations[r];o||(o=this.relations[r]={});let a=o[i];a||(a=o[i]={});let l=a[s],u;l||(l=a[s]=new KT.Relations(i,s,this.room),u=this.findEventById(r)||this.room.getPendingEvent(r),u&&l.setTargetEvent(u)),l.addEvent(e)}}ti.EventTimelineSet=qT;var sc={};Object.defineProperty(sc,"__esModule",{value:!0});sc.RoomSummary=void 0;class jT{constructor(e,t){this.roomId=e}}sc.RoomSummary=jT;var Ds={},Hl={};Object.defineProperty(Hl,"__esModule",{value:!0});Hl.FilterComponent=void 0;var ji=lt;function VT(n,e){if(e.endsWith("*")){const t=e.slice(0,-1);return n.substr(0,t.length)===t}else return n===e}class GT{constructor(e,t){this.filterJson=e,this.userId=t}check(e){var t,r;const i=((t=e.getUnsigned())===null||t===void 0?void 0:t["m.relations"])||{},s=Object.keys(i),o=[];return this.userId&&i!==null&&i!==void 0&&(r=i[ji.THREAD_RELATION_TYPE.name])!==null&&r!==void 0&&r.current_user_participated&&o.push(this.userId),this.checkFields(e.getRoomId(),e.getSender(),e.getType(),e.getContent()?e.getContent().url!==void 0:!1,s,o)}toJSON(){return{types:this.filterJson.types||null,not_types:this.filterJson.not_types||[],rooms:this.filterJson.rooms||null,not_rooms:this.filterJson.not_rooms||[],senders:this.filterJson.senders||null,not_senders:this.filterJson.not_senders||[],contains_url:this.filterJson.contains_url||null,[ji.FILTER_RELATED_BY_SENDERS.name]:this.filterJson[ji.FILTER_RELATED_BY_SENDERS.name]||[],[ji.FILTER_RELATED_BY_REL_TYPES.name]:this.filterJson[ji.FILTER_RELATED_BY_REL_TYPES.name]||[]}}checkFields(e,t,r,i,s,o){const a={rooms:function(g){return e===g},senders:function(g){return t===g},types:function(g){return VT(r,g)}};for(let g=0;g<Object.keys(a).length;g++){const m=Object.keys(a)[g],f=a[m],E="not_"+m,I=this.filterJson[E];if(I!=null&&I.some(f))return!1;const w=this.filterJson[m];if(w&&!w.some(f))return!1}const l=this.filterJson.contains_url;if(l!==void 0&&l!==i)return!1;const u=this.filterJson[ji.FILTER_RELATED_BY_REL_TYPES.name];if(u!==void 0&&!this.arrayMatchesFilter(u,s))return!1;const c=this.filterJson[ji.FILTER_RELATED_BY_SENDERS.name];return!(c!==void 0&&!this.arrayMatchesFilter(c,o))}arrayMatchesFilter(e,t){return t.length>0&&e.every(r=>t.includes(r))}filter(e){return e.filter(this.check,this)}limit(){return this.filterJson.limit!==void 0?this.filterJson.limit:10}}Hl.FilterComponent=GT;var WT=G.exports;Object.defineProperty(Ds,"__esModule",{value:!0});Ds.Filter=void 0;var rl=WT(Y.exports),ag=Hl;function Vu(n,e,t){const r=e.split(".");let i=n;for(let s=0;s<r.length-1;s++)i[r[s]]||(i[r[s]]={}),i=i[r[s]];i[r[r.length-1]]=t}class Yl{static fromJson(e,t,r){const i=new Yl(e,t);return i.setDefinition(r),i}constructor(e,t){this.userId=e,this.filterId=t,(0,rl.default)(this,"definition",{}),(0,rl.default)(this,"roomFilter",void 0),(0,rl.default)(this,"roomTimelineFilter",void 0)}getFilterId(){return this.filterId}getDefinition(){return this.definition}setDefinition(e){this.definition=e;const t=e.room,r={};t&&(t.rooms&&(r.rooms=t.rooms),t.rooms&&(r.not_rooms=t.not_rooms)),this.roomFilter=new ag.FilterComponent(r,this.userId),this.roomTimelineFilter=new ag.FilterComponent((t==null?void 0:t.timeline)||{},this.userId)}getRoomTimelineFilterComponent(){return this.roomTimelineFilter}filterRoomTimeline(e){return this.roomTimelineFilter.filter(this.roomFilter.filter(e))}setTimelineLimit(e){Vu(this.definition,"room.timeline.limit",e)}setLazyLoadMembers(e){Vu(this.definition,"room.state.lazy_load_members",!!e)}setIncludeLeaveRooms(e){Vu(this.definition,"room.include_leave",e)}}Ds.Filter=Yl;(0,rl.default)(Yl,"LAZY_LOADING_MESSAGES_FILTER",{lazy_load_members:!0});var me={},vf={};/*!
- * content-type
- * Copyright(c) 2015 Douglas Christopher Wilson
- * MIT Licensed
- */var cg=/; *([!#$%&'*+.^_`|~0-9A-Za-z-]+) *= *("(?:[\u000b\u0020\u0021\u0023-\u005b\u005d-\u007e\u0080-\u00ff]|\\[\u000b\u0020-\u00ff])*"|[!#$%&'*+.^_`|~0-9A-Za-z-]+) */g,HT=/^[\u000b\u0020-\u007e\u0080-\u00ff]+$/,Nv=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+$/,YT=/\\([\u000b\u0020-\u00ff])/g,zT=/([\\"])/g,Lv=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+\/[!#$%&'*+.^_`|~0-9A-Za-z-]+$/;vf.format=JT;vf.parse=XT;function JT(n){if(!n||typeof n!="object")throw new TypeError("argument obj is required");var e=n.parameters,t=n.type;if(!t||!Lv.test(t))throw new TypeError("invalid type");var r=t;if(e&&typeof e=="object")for(var i,s=Object.keys(e).sort(),o=0;o<s.length;o++){if(i=s[o],!Nv.test(i))throw new TypeError("invalid parameter name");r+="; "+i+"="+ZT(e[i])}return r}function XT(n){if(!n)throw new TypeError("argument string is required");var e=typeof n=="object"?QT(n):n;if(typeof e!="string")throw new TypeError("argument string is required to be a string");var t=e.indexOf(";"),r=t!==-1?e.substr(0,t).trim():e.trim();if(!Lv.test(r))throw new TypeError("invalid media type");var i=new eO(r.toLowerCase());if(t!==-1){var s,o,a;for(cg.lastIndex=t;o=cg.exec(e);){if(o.index!==t)throw new TypeError("invalid parameter format");t+=o[0].length,s=o[1].toLowerCase(),a=o[2],a[0]==='"'&&(a=a.substr(1,a.length-2).replace(YT,"$1")),i.parameters[s]=a}if(t!==e.length)throw new TypeError("invalid parameter format")}return i}function QT(n){var e;if(typeof n.getHeader=="function"?e=n.getHeader("content-type"):typeof n.headers=="object"&&(e=n.headers&&n.headers["content-type"]),typeof e!="string")throw new TypeError("content-type header is missing from object");return e}function ZT(n){var e=String(n);if(Nv.test(e))return e;if(e.length>0&&!HT.test(e))throw new TypeError("invalid parameter value");return'"'+e.replace(zT,"\\$1")+'"'}function eO(n){this.parameters=Object.create(null),this.type=n}var oc={};Object.defineProperty(oc,"__esModule",{value:!0});oc.clearTimeout=aO;oc.setNow=sO;oc.setTimeout=oO;var tO=se;const rO=1e3;let nO=0,Gu;const Jn=[],iO=function(...n){};function sO(n){zl=n||Date.now}let zl=Date.now;function oO(n,e,...t){e=e||0,e<0&&(e=0);const r=zl()+e,i=nO++,s={runAt:r,func:n,params:t,key:i},o=lO(Jn,function(a){return a.runAt-r});return Jn.splice(o,0,s),_f(),i}function aO(n){if(Jn.length===0)return;let e;for(e=0;e<Jn.length;e++)if(Jn[e].key==n){Jn.splice(e,1);break}e===0&&_f()}function _f(){Gu&&V.clearTimeout(Gu);const n=Jn[0];if(!n)return;const e=zl(),t=Math.min(n.runAt-e,rO);Gu=V.setTimeout(cO,t)}function cO(){let n;const e=zl(),t=[];for(;;){const r=Jn[0];if(!r||r.runAt>e)break;n=Jn.shift(),iO("runCallbacks: popping",n.key),t.push(n)}_f();for(let r=0;r<t.length;r++){n=t[r];try{n.func.apply(V,n.params)}catch(i){tO.logger.error("Uncaught exception in callback function",i.stack||i)}}}function lO(n,e){let t=0,r=n.length;for(;t<r;){const i=t+r>>1;e(n[i])>0?r=i:t=i+1}return t}var uO=G.exports;Object.defineProperty(me,"__esModule",{value:!0});me.PREFIX_V1=me.PREFIX_UNSTABLE=me.PREFIX_R0=me.PREFIX_MEDIA_R0=me.PREFIX_IDENTITY_V2=me.PREFIX_IDENTITY_V1=me.Method=me.MatrixHttpApi=me.MatrixError=me.HttpApiEvent=me.ConnectionError=me.AbortError=void 0;me.retryNetworkOperation=SO;var Aa=uO(Y.exports),dO=vf,Vi=Kv(oc),_i=Kv(W),nl=se;function Bv(n){if(typeof WeakMap!="function")return null;var e=new WeakMap,t=new WeakMap;return(Bv=function(r){return r?t:e})(n)}function Kv(n,e){if(!e&&n&&n.__esModule)return n;if(n===null||typeof n!="object"&&typeof n!="function")return{default:n};var t=Bv(e);if(t&&t.has(n))return t.get(n);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in n)if(s!=="default"&&Object.prototype.hasOwnProperty.call(n,s)){var o=i?Object.getOwnPropertyDescriptor(n,s):null;o&&(o.get||o.set)?Object.defineProperty(r,s,o):r[s]=n[s]}return r.default=n,t&&t.set(n,r),r}function lg(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function ug(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?lg(Object(t),!0).forEach(function(r){(0,Aa.default)(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):lg(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}const hO="/_matrix/client/r0";me.PREFIX_R0=hO;const fO="/_matrix/client/v1";me.PREFIX_V1=fO;const pO="/_matrix/client/unstable";me.PREFIX_UNSTABLE=pO;const gO="/_matrix/identity/api/v1";me.PREFIX_IDENTITY_V1=gO;const mO="/_matrix/identity/v2";me.PREFIX_IDENTITY_V2=mO;const yO="/_matrix/media/r0";me.PREFIX_MEDIA_R0=yO;let ja;me.Method=ja;(function(n){n.Get="GET",n.Put="PUT",n.Post="POST",n.Delete="DELETE"})(ja||(me.Method=ja={}));let Va;me.HttpApiEvent=Va;(function(n){n.SessionLoggedOut="Session.logged_out",n.NoConsent="no_consent"})(Va||(me.HttpApiEvent=Va={}));class vO{constructor(e,t){this.eventEmitter=e,this.opts=t,(0,Aa.default)(this,"uploads",[]),_i.checkObjectHasKeys(t,["baseUrl","request","prefix"]),t.onlyData=!!t.onlyData,t.useAuthorizationHeader=!!t.useAuthorizationHeader}setIdBaseUrl(e){this.opts.idBaseUrl=e}getContentUri(){return{base:this.opts.baseUrl,path:"/_matrix/media/r0/upload",params:{access_token:this.opts.accessToken}}}uploadContent(e,t){_i.isFunction(t)?t={callback:t}:t||(t={});const r=t.includeFilename!==!1,i=t.type||e.type||"application/octet-stream",s=t.name||e.name;let o=e;const a=o.stream;a&&typeof a!="function"&&(nl.logger.warn("Using `file.stream` as the content to upload. Future versions of the js-sdk will change this to expect `file` to be the content directly."),o=a);let l=t.rawResponse;l===void 0&&(V.XMLHttpRequest?l=!1:(nl.logger.warn("Returning the raw JSON from uploadContent(). Future versions of the js-sdk will change this default, to return the parsed object. Set opts.rawResponse=false to change this behaviour now."),l=!0));let u=t.onlyContentUri;!l&&u===void 0&&(V.XMLHttpRequest?(nl.logger.warn("Returning only the content-uri from uploadContent(). Future versions of the js-sdk will change this default, to return the whole response object. Set opts.onlyContentUri=false to change this behaviour now."),u=!0):u=!1);const c={loaded:0,total:0};let g,m=null;if(l||(m=function(f){let E=JSON.parse(f);if(u&&(E=E.content_uri,E===void 0))throw Error("Bad response");return E}),V.XMLHttpRequest){const f=_i.defer(),E=new V.XMLHttpRequest,I=Wu(f,t.callback,this.opts.onlyData),w=function(){E.abort(),I(new Error("Timeout"))};let k=Vi.setTimeout(w,3e4);E.onreadystatechange=function(){let T;switch(E.readyState){case V.XMLHttpRequest.DONE:Vi.clearTimeout(k);try{if(E.status===0)throw new Fv;if(!E.responseText)throw new Error("No response body.");T=E.responseText,m&&(T=m(T))}catch(D){D.http_status=E.status,I(D);return}I(void 0,E,T);break}},E.upload.addEventListener("progress",function(T){Vi.clearTimeout(k),c.loaded=T.loaded,c.total=T.total,k=Vi.setTimeout(w,3e4),t.progressHandler&&t.progressHandler({loaded:T.loaded,total:T.total})});let C=this.opts.baseUrl+"/_matrix/media/r0/upload";const S=[];r&&s&&S.push("filename="+encodeURIComponent(s)),this.opts.useAuthorizationHeader||S.push("access_token="+encodeURIComponent(this.opts.accessToken)),S.length>0&&(C+="?"+S.join("&")),E.open("POST",C),this.opts.useAuthorizationHeader&&E.setRequestHeader("Authorization","Bearer "+this.opts.accessToken),E.setRequestHeader("Content-Type",i),E.send(o),g=f.promise,g.abort=E.abort.bind(E)}else{const f={};r&&s&&(f.filename=s);const E={"Content-Type":i};o.length===0&&(E["Content-Length"]="0"),g=this.authedRequest(t.callback,ja.Post,"/upload",f,o,{prefix:"/_matrix/media/r0",headers:E,json:!1,bodyParser:m})}return c.promise=g.finally(()=>{for(let f=0;f<this.uploads.length;++f)if(this.uploads[f]===c){this.uploads.splice(f,1);return}}),c.promise.abort=g.abort,this.uploads.push(c),c.promise}cancelUpload(e){return e.abort?(e.abort(),!0):!1}getCurrentUploads(){return this.uploads}idServerRequest(e,t,r,i,s,o){if(!this.opts.idBaseUrl)throw new Error("No identity server base URL set");const a=this.opts.idBaseUrl+s+r;if(e!==void 0&&!_i.isFunction(e))throw Error("Expected callback to be a function but got "+typeof e);const l={uri:a,method:t,withCredentials:!1,json:!0,_matrix_opts:this.opts,headers:{}};t===ja.Get?l.qs=i:typeof i=="object"&&(l.json=i),o&&(l.headers.Authorization=`Bearer ${o}`);const u=_i.defer();return this.opts.request(l,Wu(u,e,this.opts.onlyData)),u.promise}authedRequest(e,t,r,i,s,o){i||(i={});let a=o||{};this.opts.useAuthorizationHeader?(isFinite(o)&&(a={localTimeoutMs:o}),a.headers||(a.headers={}),a.headers.Authorization||(a.headers.Authorization="Bearer "+this.opts.accessToken),i.access_token&&delete i.access_token):i.access_token||(i.access_token=this.opts.accessToken);const l=this.request(e,t,r,i,s,a);return l.catch(u=>{var c;u.errcode=="M_UNKNOWN_TOKEN"&&!((c=a)!==null&&c!==void 0&&c.inhibitLogoutEmit)?this.eventEmitter.emit(Va.SessionLoggedOut,u):u.errcode=="M_CONSENT_NOT_GIVEN"&&this.eventEmitter.emit(Va.NoConsent,u.message,u.data.consent_uri)}),l}request(e,t,r,i,s,o){var a;const l=(a=o==null?void 0:o.prefix)!==null&&a!==void 0?a:this.opts.prefix,u=this.opts.baseUrl+l+r;return this.requestOtherUrl(e,t,u,i,s,o)}requestOtherUrl(e,t,r,i,s,o){let a=o||{};return isFinite(o)&&(a={localTimeoutMs:o}),this.doRequest(e,t,r,i,s,a)}getUrl(e,t,r){let i="";return t&&(i="?"+_i.encodeParams(t)),this.opts.baseUrl+r+e+i}doRequest(e,t,r,i,s,o){var a;if(e!==void 0&&!_i.isFunction(e))throw Error("Expected callback to be a function but got "+typeof e);this.opts.extraParams&&(i=ug(ug({},i||{}),this.opts.extraParams));const l=Object.assign({},o.headers||{});o||(o={});const u=(a=o.json)!==null&&a!==void 0?a:!0;let c=o.bodyParser;u&&(s&&(s=JSON.stringify(s),l["content-type"]="application/json"),l.accept||(l.accept="application/json"),c===void 0&&(c=function(C){return JSON.parse(C)}));const g=_i.defer();let m,f=!1,E;const I=o.localTimeoutMs||this.opts.localTimeoutMs,w=()=>{I&&(m&&Vi.clearTimeout(m),m=Vi.setTimeout(function(){var C,S;f=!0,(C=E)===null||C===void 0||(S=C.abort)===null||S===void 0||S.call(C),g.reject(new Jl({error:"Locally timed out waiting for a response",errcode:"ORG.MATRIX.JSSDK_TIMEOUT",timeout:I}))},I))};w();const k=g.promise;try{E=this.opts.request({uri:r,method:t,withCredentials:!1,qs:i,qsStringifyOptions:o.qsStringifyOptions,useQuerystring:!0,body:s,json:!1,timeout:I,headers:l||{},_matrix_opts:this.opts},(C,S,T)=>{if(I&&(Vi.clearTimeout(m),f))return;Wu(g,e,this.opts.onlyData,c)(C,S,T)}),E&&("onprogress"in E&&(E.onprogress=C=>{w()}),E.abort&&(k.abort=E.abort.bind(E)))}catch(C){g.reject(C),e&&e(C)}return k}}me.MatrixHttpApi=vO;function Eh(n){return n.status||n.statusCode}function Wu(n,e,t=!1,r){return function(i,s,o){i&&!(i.name==="AbortError"||i==="aborted")&&!(i instanceof Jl)&&(i=new Ef("request failed",i));let a=o;if(!i)try{Eh(s)>=400?i=_O(s,o):r&&(a=r(o))}catch(l){i=new Error(`Error parsing server response: ${l}`)}if(i)n.reject(i),e==null||e(i);else if(t)n.resolve(a),e==null||e(null,a);else{const l={code:Eh(s),headers:s.headers,data:a};n.resolve(l),e==null||e(null,l)}}}function _O(n,e){const t=Eh(n),r=EO(n);let i;if(r)if(r.type==="application/json"){const s=typeof e=="object"?e:JSON.parse(e);i=new Jl(s)}else r.type==="text/plain"&&(i=new Error(`Server returned ${t} error: ${e}`));return i||(i=new Error(`Server returned ${t} error`)),i.httpStatus=t,i}function EO(n){let e;if(n.getResponseHeader?e=n.getResponseHeader("Content-Type"):n.headers&&(e=n.headers["content-type"]||null),!e)return null;try{return(0,dO.parse)(e)}catch(t){throw new Error(`Error parsing Content-Type '${e}': ${t}`)}}class Jl extends Error{constructor(e={}){super(`MatrixError: ${e.errcode}`);(0,Aa.default)(this,"errcode",void 0),(0,Aa.default)(this,"data",void 0),(0,Aa.default)(this,"httpStatus",void 0),this.errcode=e.errcode,this.name=e.errcode||"Unknown error code",this.message=e.error||"Unknown message",this.data=e}}me.MatrixError=Jl;class Ef extends Error{constructor(e,t=void 0){super(e+(t?`: ${t.message}`:""))}get name(){return"ConnectionError"}}me.ConnectionError=Ef;class Fv extends Error{constructor(){super("Operation aborted")}get name(){return"AbortError"}}me.AbortError=Fv;async function SO(n,e){let t=0,r=null;for(;t<n;)try{if(t>0){const i=1e3*Math.pow(2,t);nl.logger.log(`network operation failed ${t} times, retrying in ${i}ms...`),await new Promise(s=>setTimeout(s,i))}return await e()}catch(i){if(i instanceof Ef)t+=1,r=i;else throw i}throw r}var bO=G.exports;Object.defineProperty(lr,"__esModule",{value:!0});lr.RoomEvent=lr.Room=lr.NotificationCountType=void 0;var Oe=bO(Y.exports),Hu=ti,Jt=qt,wO=$o,ea=PO(W),il=jt,De=qo,RO=Zr,IO=sc,ht=se,TO=tn,Ne=ie,Ei=st,OO=Ds,Ir=lt,kO=me,CO=je;function qv(n){if(typeof WeakMap!="function")return null;var e=new WeakMap,t=new WeakMap;return(qv=function(r){return r?t:e})(n)}function PO(n,e){if(!e&&n&&n.__esModule)return n;if(n===null||typeof n!="object"&&typeof n!="function")return{default:n};var t=qv(e);if(t&&t.has(n))return t.get(n);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in n)if(s!=="default"&&Object.prototype.hasOwnProperty.call(n,s)){var o=i?Object.getOwnPropertyDescriptor(n,s):null;o&&(o.get||o.set)?Object.defineProperty(r,s,o):r[s]=n[s]}return r.default=n,t&&t.set(n,r),r}function dg(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function hg(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?dg(Object(t),!0).forEach(function(r){(0,Oe.default)(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):dg(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}const fg="6",pg=["1","2","3","4","5","6"];function gg(n,e,t){return new il.MatrixEvent({content:{[e.getId()]:{[t]:{[n]:{ts:e.getTs()}}}},type:"m.receipt",room_id:e.getRoomId()})}const Ks=0,Fs=1,MO=30;let Tl;lr.NotificationCountType=Tl;(function(n){n.Highlight="highlight",n.Total="total"})(Tl||(lr.NotificationCountType=Tl={}));let it;lr.RoomEvent=it;(function(n){n.MyMembership="Room.myMembership",n.Tags="Room.tags",n.AccountData="Room.accountData",n.Receipt="Room.receipt",n.Name="Room.name",n.Redaction="Room.redaction",n.RedactionCancelled="Room.redactionCancelled",n.LocalEchoUpdated="Room.localEchoUpdated",n.Timeline="Room.timeline",n.TimelineReset="Room.timelineReset"})(it||(lr.RoomEvent=it={}));class AO extends CO.TypedEventEmitter{constructor(e,t,r,i={}){super();if(this.roomId=e,this.client=t,this.myUserId=r,this.opts=i,(0,Oe.default)(this,"reEmitter",void 0),(0,Oe.default)(this,"txnToEvent",{}),(0,Oe.default)(this,"receipts",{}),(0,Oe.default)(this,"receiptCacheByEventId",{}),(0,Oe.default)(this,"notificationCounts",{}),(0,Oe.default)(this,"timelineSets",void 0),(0,Oe.default)(this,"threadsTimelineSets",[]),(0,Oe.default)(this,"filteredTimelineSets",{}),(0,Oe.default)(this,"pendingEventList",void 0),(0,Oe.default)(this,"blacklistUnverifiedDevices",null),(0,Oe.default)(this,"selfMembership",null),(0,Oe.default)(this,"summaryHeroes",null),(0,Oe.default)(this,"getTypeWarning",!1),(0,Oe.default)(this,"getVersionWarning",!1),(0,Oe.default)(this,"membersPromise",void 0),(0,Oe.default)(this,"name",void 0),(0,Oe.default)(this,"normalizedName",void 0),(0,Oe.default)(this,"tags",{}),(0,Oe.default)(this,"accountData",{}),(0,Oe.default)(this,"summary",null),(0,Oe.default)(this,"storageToken",void 0),(0,Oe.default)(this,"timeline",void 0),(0,Oe.default)(this,"oldState",void 0),(0,Oe.default)(this,"currentState",void 0),(0,Oe.default)(this,"threads",new Map),(0,Oe.default)(this,"lastThread",void 0),(0,Oe.default)(this,"visibilityEvents",new Map),(0,Oe.default)(this,"threadTimelineSetsPromise",null),this.setMaxListeners(100),this.reEmitter=new TO.TypedReEmitter(this),i.pendingEventOrdering=i.pendingEventOrdering||Ei.PendingEventOrdering.Chronological,this.name=e,this.timelineSets=[new Hu.EventTimelineSet(this,i)],this.reEmitter.reEmit(this.getUnfilteredTimelineSet(),[it.Timeline,it.TimelineReset]),this.fixUpLegacyTimelineFields(),this.opts.pendingEventOrdering===Ei.PendingEventOrdering.Detached){this.pendingEventList=[];const s=t.sessionStore.store.getItem(Yu(this.roomId));s&&JSON.parse(s).forEach(async o=>{const a=new il.MatrixEvent(o);a.getType()===Ne.EventType.RoomMessageEncrypted&&await a.attemptDecryption(this.client.crypto),a.setStatus(De.EventStatus.NOT_SENT),this.addPendingEvent(a,a.getTxnId())})}this.opts.lazyLoadMembers?this.membersPromise=null:this.membersPromise=Promise.resolve(!1)}async createThreadsTimelineSets(){var e;if(this.threadTimelineSetsPromise)return this.threadTimelineSetsPromise;if((e=this.client)!==null&&e!==void 0&&e.supportsExperimentalThreads)try{this.threadTimelineSetsPromise=Promise.all([this.createThreadTimelineSet(),this.createThreadTimelineSet(Ir.ThreadFilterType.My)]);const t=await this.threadTimelineSetsPromise;this.threadsTimelineSets.push(...t)}catch{this.threadTimelineSetsPromise=null}}decryptCriticalEvents(){const e=this.getEventReadUpTo(this.client.getUserId(),!0),t=this.getLiveTimeline().getEvents(),r=t.findIndex(s=>s.event.event_id===e),i=t.slice(r).filter(s=>s.shouldAttemptDecryption()).reverse().map(s=>s.attemptDecryption(this.client.crypto,{isRetry:!0}));return Promise.allSettled(i)}decryptAllEvents(){const e=this.getUnfilteredTimelineSet().getLiveTimeline().getEvents().filter(t=>t.shouldAttemptDecryption()).reverse().map(t=>t.attemptDecryption(this.client.crypto,{isRetry:!0}));return Promise.allSettled(e)}getVersion(){const e=this.currentState.getStateEvents(Ne.EventType.RoomCreate,"");if(!e)return this.getVersionWarning||(ht.logger.warn("[getVersion] Room "+this.roomId+" does not have an m.room.create event"),this.getVersionWarning=!0),"1";const t=e.getContent().room_version;return t===void 0?"1":t}shouldUpgradeToVersion(){return pg.includes(this.getVersion())?null:fg}async getRecommendedVersion(){let t=(await this.client.getCapabilities())["m.room_versions"];if(!t){t={default:fg,available:{}};for(const i of pg)t.available[i]=Ei.RoomVersionStability.Stable}let r=this.checkVersionAgainstCapability(t);if(r.urgent&&r.needsUpgrade)if(ht.logger.warn("Refreshing room version capability because the server looks to be supporting a newer room version we don't know about."),t=(await this.client.getCapabilities(!0))["m.room_versions"],t)r=this.checkVersionAgainstCapability(t);else return ht.logger.warn("No room version capability - assuming upgrade required."),r;return r}checkVersionAgainstCapability(e){const t=this.getVersion();ht.logger.log(`[${this.roomId}] Current version: ${t}`),ht.logger.log(`[${this.roomId}] Version capability: `,e);const r={version:t,needsUpgrade:!1,urgent:!1};return t===e.default||Object.keys(e.available).filter(s=>e.available[s]==="stable").includes(t)||(r.version=e.default,r.needsUpgrade=!0,r.urgent=!!this.getVersion().match(/^[0-9]+[0-9.]*$/g),r.urgent?ht.logger.warn(`URGENT upgrade required on ${this.roomId}`):ht.logger.warn(`Non-urgent upgrade required on ${this.roomId}`)),r}userMayUpgradeRoom(e){return this.currentState.maySendStateEvent(Ne.EventType.RoomTombstone,e)}getPendingEvents(){if(this.opts.pendingEventOrdering!==Ei.PendingEventOrdering.Detached)throw new Error("Cannot call getPendingEvents with pendingEventOrdering == "+this.opts.pendingEventOrdering);return this.pendingEventList}removePendingEvent(e){if(this.opts.pendingEventOrdering!==Ei.PendingEventOrdering.Detached)throw new Error("Cannot call removePendingEvent with pendingEventOrdering == "+this.opts.pendingEventOrdering);const t=ea.removeElement(this.pendingEventList,function(r){return r.getId()==e},!1);return this.savePendingEvents(),t}hasPendingEvent(e){return this.opts.pendingEventOrdering!==Ei.PendingEventOrdering.Detached?!1:this.pendingEventList.some(t=>t.getId()===e)}getPendingEvent(e){return this.opts.pendingEventOrdering!==Ei.PendingEventOrdering.Detached?null:this.pendingEventList.find(t=>t.getId()===e)}getLiveTimeline(){return this.getUnfilteredTimelineSet().getLiveTimeline()}getLastActiveTimestamp(){const t=this.getLiveTimeline().getEvents();return t.length?t[t.length-1].getTs():Number.MIN_SAFE_INTEGER}getMyMembership(){return this.selfMembership}getDMInviter(){if(this.myUserId){const e=this.getMember(this.myUserId);if(e)return e.getDMInviter()}if(this.selfMembership==="invite"&&this.getInvitedAndJoinedMemberCount()==2&&this.summaryHeroes.length)return this.summaryHeroes[0]}guessDMUserId(){const e=this.getMember(this.myUserId);if(e){const s=e.getDMInviter();if(s)return s}if(Array.isArray(this.summaryHeroes)&&this.summaryHeroes.length)return this.summaryHeroes[0];const i=this.currentState.getMembers().find(s=>s.userId!==this.myUserId);return i?i.userId:this.myUserId}getAvatarFallbackMember(){if(this.getInvitedAndJoinedMemberCount()>2)return;const t=Array.isArray(this.summaryHeroes)&&this.summaryHeroes.length;if(t){const i=this.summaryHeroes.map(s=>this.getMember(s)).find(s=>!!s);if(i)return i}const r=this.currentState.getMembers();if(r.length<=2){const i=r.find(s=>s.userId!==this.myUserId);if(i)return i}if(t){const i=this.summaryHeroes.map(s=>this.client.getUser(s)).find(s=>!!s);if(i){const s=new RO.RoomMember(this.roomId,i.userId);return s.user=i,s}}}updateMyMembership(e){const t=this.selfMembership;this.selfMembership=e,t!==e&&(e==="leave"&&this.cleanupAfterLeaving(),this.emit(it.MyMembership,this,e,t))}async loadMembersFromServer(){const e=this.client.store.getSyncToken(),t=ea.encodeParams({not_membership:"leave",at:e}),r=ea.encodeUri("/rooms/$roomId/members?"+t,{$roomId:this.roomId});return(await this.client.http.authedRequest(void 0,kO.Method.Get,r)).chunk}async loadMembers(){let e=!1,t=await this.client.store.getOutOfBandMembers(this.roomId);return(t===null||this.client.isCryptoEnabled()&&this.client.isRoomEncrypted(this.roomId))&&(e=!0,t=await this.loadMembersFromServer(),ht.logger.log(`LL: got ${t.length} members from server for room ${this.roomId}`)),{memberEvents:t.map(this.client.getEventMapper()),fromServer:e}}loadMembersIfNeeded(){if(this.membersPromise)return this.membersPromise;this.currentState.markOutOfBandMembersStarted();const e=this.loadMembers().then(t=>(this.currentState.setOutOfBandMembers(t.memberEvents),this.client.isCryptoEnabled()&&this.client.isRoomEncrypted(this.roomId)&&this.client.crypto.trackRoomDevices(this.roomId),t.fromServer)).catch(t=>{throw this.membersPromise=null,this.currentState.markOutOfBandMembersFailed(),t});return e.then(t=>{if(t){const r=this.currentState.getMembers().filter(s=>s.isOutOfBand()).map(s=>s.events.member.event);return ht.logger.log(`LL: telling store to write ${r.length} members for room ${this.roomId}`),this.client.store.setOutOfBandMembers(this.roomId,r).catch(s=>{ht.logger.log("LL: storing OOB room members failed, oh well",s)})}}).catch(t=>{ht.logger.error(t)}),this.membersPromise=e,this.membersPromise}async clearLoadedMembersIfNeeded(){this.opts.lazyLoadMembers&&this.membersPromise&&(await this.loadMembersIfNeeded(),await this.client.store.clearOutOfBandMembers(this.roomId),this.currentState.clearOutOfBandMembers(),this.membersPromise=null)}cleanupAfterLeaving(){this.clearLoadedMembersIfNeeded().catch(e=>{ht.logger.error(`error after clearing loaded members from room ${this.roomId} after leaving`),ht.logger.log(e)})}resetLiveTimeline(e,t){for(let r=0;r<this.timelineSets.length;r++)this.timelineSets[r].resetLiveTimeline(e,t);this.fixUpLegacyTimelineFields()}fixUpLegacyTimelineFields(){this.timeline=this.getLiveTimeline().getEvents(),this.oldState=this.getLiveTimeline().getState(Jt.EventTimeline.BACKWARDS),this.currentState=this.getLiveTimeline().getState(Jt.EventTimeline.FORWARDS)}async hasUnverifiedDevices(){if(!this.client.isRoomEncrypted(this.roomId))return!1;const e=await this.getEncryptionTargetMembers();for(const t of e)if(this.client.getStoredDevicesForUser(t.userId).some(i=>i.isUnverified()))return!0;return!1}getTimelineSets(){return this.timelineSets}getUnfilteredTimelineSet(){return this.timelineSets[0]}getTimelineForEvent(e){const t=this.findEventById(e),r=this.findThreadForEvent(t);return r?r.timelineSet.getLiveTimeline():this.getUnfilteredTimelineSet().getTimelineForEvent(e)}addTimeline(){return this.getUnfilteredTimelineSet().addTimeline()}findEventById(e){let t=this.getUnfilteredTimelineSet().findEventById(e);if(t)return t;{const r=this.getThreads();for(let i=0;i<r.length;i++)if(t=r[i].findEventById(e),t)return t}}getUnreadNotificationCount(e=Tl.Total){return this.notificationCounts[e]}setUnreadNotificationCount(e,t){this.notificationCounts[e]=t}setSummary(e){const t=e["m.heroes"],r=e["m.joined_member_count"],i=e["m.invited_member_count"];Number.isInteger(r)&&this.currentState.setJoinedMemberCount(r),Number.isInteger(i)&&this.currentState.setInvitedMemberCount(i),Array.isArray(t)&&(this.summaryHeroes=t.filter(s=>s!==this.myUserId))}setBlacklistUnverifiedDevices(e){this.blacklistUnverifiedDevices=e}getBlacklistUnverifiedDevices(){return this.blacklistUnverifiedDevices}getAvatarUrl(e,t,r,i,s=!0){const o=this.currentState.getStateEvents(Ne.EventType.RoomAvatar,"");if(!o&&!s)return null;const a=o?o.getContent().url:null;return a?(0,wO.getHttpUriForMxc)(e,a,t,r,i):null}getMxcAvatarUrl(){var e,t;return((e=this.currentState.getStateEvents(Ne.EventType.RoomAvatar,""))===null||e===void 0||(t=e.getContent())===null||t===void 0?void 0:t.url)||null}getAliases(){const e=[],t=this.currentState.getStateEvents(Ne.EventType.RoomAliases);if(t)for(let r=0;r<t.length;++r){const i=t[r];if(Array.isArray(i.getContent().aliases)){const s=i.getContent().aliases.filter(o=>!(typeof o!="string"||o[0]!=="#"||!o.endsWith(`:${i.getStateKey()}`)));Array.prototype.push.apply(e,s)}}return e}getCanonicalAlias(){const e=this.currentState.getStateEvents(Ne.EventType.RoomCanonicalAlias,"");return e&&e.getContent().alias||null}getAltAliases(){const e=this.currentState.getStateEvents(Ne.EventType.RoomCanonicalAlias,"");return e?e.getContent().alt_aliases||[]:[]}addEventsToTimeline(e,t,r,i){r.getTimelineSet().addEventsToTimeline(e,t,r,i)}getThread(e){return this.getThreads().find(t=>t.id===e)}getThreads(){return Array.from(this.threads.values())}getMember(e){return this.currentState.getMember(e)}getMembers(){return this.currentState.getMembers()}getJoinedMembers(){return this.getMembersWithMembership("join")}getJoinedMemberCount(){return this.currentState.getJoinedMemberCount()}getInvitedMemberCount(){return this.currentState.getInvitedMemberCount()}getInvitedAndJoinedMemberCount(){return this.getInvitedMemberCount()+this.getJoinedMemberCount()}getMembersWithMembership(e){return this.currentState.getMembers().filter(function(t){return t.membership===e})}async getEncryptionTargetMembers(){await this.loadMembersIfNeeded();let e=this.getMembersWithMembership("join");return this.shouldEncryptForInvitedMembers()&&(e=e.concat(this.getMembersWithMembership("invite"))),e}shouldEncryptForInvitedMembers(){var e;const t=this.currentState.getStateEvents(Ne.EventType.RoomHistoryVisibility,"");return(t==null||(e=t.getContent())===null||e===void 0?void 0:e.history_visibility)!=="joined"}getDefaultRoomName(e){return this.calculateRoomName(e,!0)}hasMembershipState(e,t){const r=this.getMember(e);return r?r.membership===t:!1}getOrCreateFilteredTimelineSet(e,{prepopulateTimeline:t=!0,pendingEvents:r=!0}={}){if(this.filteredTimelineSets[e.filterId])return this.filteredTimelineSets[e.filterId];const i=Object.assign({filter:e,pendingEvents:r},this.opts),s=new Hu.EventTimelineSet(this,i);this.reEmitter.reEmit(s,[it.Timeline,it.TimelineReset]),this.filteredTimelineSets[e.filterId]=s,this.timelineSets.push(s);const o=this.getLiveTimeline();if(t){o.getEvents().forEach(function(l){s.addLiveEvent(l)});let a=o;for(;a.getNeighbouringTimeline(Jt.EventTimeline.BACKWARDS);)a=a.getNeighbouringTimeline(Jt.EventTimeline.BACKWARDS);s.getLiveTimeline().setPaginationToken(a.getPaginationToken(Jt.EventTimeline.BACKWARDS),Jt.EventTimeline.BACKWARDS)}else{const a=o.getPaginationToken(Jt.Direction.Forward);s.getLiveTimeline().setPaginationToken(a,Jt.Direction.Backward)}return s}async createThreadTimelineSet(e){let t;if(Ir.Thread.hasServerSideSupport){const r=this.client.getUserId(),i=new OO.Filter(r),s={room:{timeline:{[Ir.FILTER_RELATED_BY_REL_TYPES.name]:[Ir.THREAD_RELATION_TYPE.name]}}};e===Ir.ThreadFilterType.My&&(s.room.timeline[Ir.FILTER_RELATED_BY_SENDERS.name]=[r]),i.setDefinition(s);const o=await this.client.getOrCreateFilter(`THREAD_PANEL_${this.roomId}_${e}`,i);i.filterId=o,t=this.getOrCreateFilteredTimelineSet(i,{prepopulateTimeline:!1,pendingEvents:!1}),t.getLiveTimeline().setPaginationToken("",Jt.EventTimeline.BACKWARDS)}else t=new Hu.EventTimelineSet(this,{pendingEvents:!1}),Array.from(this.threads).forEach(([,r])=>{if(r.length===0)return;const i=r.events.some(s=>s.getSender()===this.client.getUserId());(e!==Ir.ThreadFilterType.My||i)&&t.getLiveTimeline().addEvent(r.rootEvent,!1)});return t}removeFilteredTimelineSet(e){const t=this.filteredTimelineSets[e.filterId];delete this.filteredTimelineSets[e.filterId];const r=this.timelineSets.indexOf(t);r>-1&&this.timelineSets.splice(r,1)}findThreadForEvent(e){if(!e)return null;if(e.isThreadRelation)return this.threads.get(e.threadRootId);if(e.isThreadRoot)return this.threads.get(e.getId());{const t=this.findEventById(e.getAssociatedId());return this.findThreadForEvent(t)}}async addThreadedEvent(e,t){this.applyRedaction(e);let r=this.findThreadForEvent(e);if(r)r.addEvent(e,t);else{const i=[e];let s=this.findEventById(e.threadRootId);try{let o;e.threadRootId&&(o=await this.client.fetchRoomEvent(this.roomId,e.threadRootId)),s?s.setUnsigned(o.unsigned):s=new il.MatrixEvent(o)}finally{r=this.createThread(s,i,t)}}this.emit(Ir.ThreadEvent.Update,r)}createThread(e,t=[],r){if(e){const o=this.getTimelineForEvent(e.getId()),a=o==null?void 0:o.getTimelineSet().getAllRelationsEventForEvent(e.getId());a&&(t=t.concat(a))}const i=new Ir.Thread(e,{initialEvents:t,room:this,client:this.client});if(i.id){var s;return this.threads.set(i.id,i),this.reEmitter.reEmit(i,[Ir.ThreadEvent.Update,it.Timeline,it.TimelineReset]),(!this.lastThread||((s=this.lastThread.rootEvent)===null||s===void 0?void 0:s.localTimestamp)<(e==null?void 0:e.localTimestamp))&&(this.lastThread=i),this.emit(Ir.ThreadEvent.New,i,r),this.threadsTimelineSets.forEach(o=>{i.rootEvent&&(Ir.Thread.hasServerSideSupport?o.addLiveEvent(i.rootEvent):o.addEventToTimeline(i.rootEvent,o.getLiveTimeline(),r))}),i}}applyRedaction(e){if(e.isRedaction()){const t=e.event.redacts,r=this.findEventById(t);r&&(r.makeRedacted(e),r.getStateKey()&&this.currentState.getStateEvents(r.getType(),r.getStateKey()).getId()===r.getId()&&this.currentState.setStateEvents([r]),this.emit(it.Redaction,e,this),this.visibilityEvents.delete(t),r.isVisibilityEvent()&&this.redactVisibilityChangeEvent(e))}}addLiveEvent(e,t,r=!1){if(this.applyRedaction(e),e.isVisibilityEvent()&&this.applyNewVisibilityEvent(e),this.applyPendingVisibilityEvents(e),e.getUnsigned().transaction_id){const i=this.txnToEvent[e.getUnsigned().transaction_id];if(i){this.handleRemoteEcho(e,i);return}}for(let i=0;i<this.timelineSets.length;i++)this.timelineSets[i].addLiveEvent(e,t,r);e.sender&&e.getType()!==Ne.EventType.RoomRedaction&&this.addReceipt(gg(e.sender.userId,e,"m.read"),!0)}addPendingEvent(e,t){if(e.status!==De.EventStatus.SENDING&&e.status!==De.EventStatus.NOT_SENT)throw new Error("addPendingEvent called on an event with status "+e.status);if(this.txnToEvent[t])throw new Error("addPendingEvent called on an event with known txnId "+t);if(Jt.EventTimeline.setEventMetadata(e,this.getLiveTimeline().getState(Jt.EventTimeline.FORWARDS),!1),this.txnToEvent[t]=e,this.opts.pendingEventOrdering===Ei.PendingEventOrdering.Detached){if(this.pendingEventList.some(i=>i.status===De.EventStatus.NOT_SENT)&&(ht.logger.warn("Setting event as NOT_SENT due to messages in the same state"),e.setStatus(De.EventStatus.NOT_SENT)),this.pendingEventList.push(e),this.savePendingEvents(),e.isRelation()&&this.aggregateNonLiveRelation(e),e.isRedaction()){var r;const i=e.event.redacts;let s=(r=this.pendingEventList)===null||r===void 0?void 0:r.find(o=>o.getId()===i);s||(s=this.findEventById(i)),s&&(s.markLocallyRedacted(e),this.emit(it.Redaction,e,this))}}else for(let i=0;i<this.timelineSets.length;i++){const s=this.timelineSets[i];s.getFilter()?s.getFilter().filterRoomTimeline([e]).length&&s.addEventToTimeline(e,s.getLiveTimeline(),!1):s.addEventToTimeline(e,s.getLiveTimeline(),!1)}this.emit(it.LocalEchoUpdated,e,this,null,null)}savePendingEvents(){if(this.pendingEventList){const e=this.pendingEventList.map(r=>hg(hg({},r.event),{},{txn_id:r.getTxnId()})).filter(r=>{const i=r.type===Ne.EventType.RoomMessageEncrypted,s=this.client.isRoomEncrypted(this.roomId);return i||!s}),{store:t}=this.client.sessionStore;this.pendingEventList.length>0?t.setItem(Yu(this.roomId),JSON.stringify(e)):t.removeItem(Yu(this.roomId))}}aggregateNonLiveRelation(e){const t=this.findThreadForEvent(e);if(t&&t.timelineSet.aggregateRelations(e),(t==null?void 0:t.id)===e.getAssociatedId()||!t)for(let r=0;r<this.timelineSets.length;r++){const i=this.timelineSets[r];i.getFilter()?i.getFilter().filterRoomTimeline([e]).length&&i.aggregateRelations(e):i.aggregateRelations(e)}}getEventForTxnId(e){return this.txnToEvent[e]}handleRemoteEcho(e,t){const r=t.getId(),i=e.getId(),s=t.status;ht.logger.debug(`Got remote echo for event ${r} -> ${i} old status ${s}`),delete this.txnToEvent[e.getUnsigned().transaction_id],this.pendingEventList&&this.removePendingEvent(r),t.handleRemoteEcho(e.event);const o=this.findThreadForEvent(e);if(o&&o.timelineSet.handleRemoteEcho(t,r,i),(o==null?void 0:o.id)===e.getAssociatedId()||!o)for(let a=0;a<this.timelineSets.length;a++)this.timelineSets[a].handleRemoteEcho(t,r,i);this.emit(it.LocalEchoUpdated,t,this,r,s)}updatePendingEvent(e,t,r){if(ht.logger.log(`setting pendingEvent status to ${t} in ${e.getRoomId()} event ID ${e.getId()} -> ${r}`),t==De.EventStatus.SENT&&!r)throw new Error("updatePendingEvent called with status=SENT, but no new event id");if(t==De.EventStatus.SENT&&this.getTimelineForEvent(r))return;const i=e.status,s=e.getId();if(!i)throw new Error("updatePendingEventStatus called on an event which is not a local echo.");const o=DO[i];if(!o||o.indexOf(t)<0)throw new Error("Invalid EventStatus transition "+i+"->"+t);if(e.setStatus(t),t==De.EventStatus.SENT){e.replaceLocalEventId(r);const a=this.findThreadForEvent(e);if(a&&a.timelineSet.replaceEventId(s,r),(a==null?void 0:a.id)===e.getAssociatedId()||!a)for(let l=0;l<this.timelineSets.length;l++)this.timelineSets[l].replaceEventId(s,r)}else if(t==De.EventStatus.CANCELLED){if(this.pendingEventList){const a=this.pendingEventList.findIndex(l=>l.getId()===s);if(a!==-1){const[l]=this.pendingEventList.splice(a,1);l.isRedaction()&&this.revertRedactionLocalEcho(l)}}this.removeEvent(s)}this.savePendingEvents(),this.emit(it.LocalEchoUpdated,e,this,s,i)}revertRedactionLocalEcho(e){const t=e.event.redacts;if(!t)return;const r=this.getUnfilteredTimelineSet().findEventById(t);r&&(r.unmarkLocallyRedacted(),this.emit(it.RedactionCancelled,e,this),r.isRelation()&&this.aggregateNonLiveRelation(r))}addLiveEvents(e,t,r=!1){let i;if(t&&["replace","ignore"].indexOf(t)===-1)throw new Error("duplicateStrategy MUST be either 'replace' or 'ignore'");for(i=0;i<this.timelineSets.length;i++){const s=this.timelineSets[i].getLiveTimeline();if(s.getPaginationToken(Jt.EventTimeline.FORWARDS))throw new Error("live timeline "+i+" is no longer live - it has a pagination token ("+s.getPaginationToken(Jt.EventTimeline.FORWARDS)+")");if(s.getNeighbouringTimeline(Jt.EventTimeline.FORWARDS))throw new Error("live timeline "+i+" is no longer live - it has a neighbouring timeline")}for(i=0;i<e.length;i++){this.addLiveEvent(e[i],t,r);const s=this.findThreadForEvent(e[i]);s&&s.addEvent(e[i],!0)}}addEphemeralEvents(e){for(const t of e)t.getType()==="m.typing"?this.currentState.setTypingEvent(t):t.getType()==="m.receipt"&&this.addReceipt(t)}removeEvents(e){for(let t=0;t<e.length;++t)this.removeEvent(e[t])}removeEvent(e){let t=!1;for(let r=0;r<this.timelineSets.length;r++){const i=this.timelineSets[r].removeEvent(e);i&&(i.isRedaction()&&this.revertRedactionLocalEcho(i),t=!0)}return t}recalculate(){const e=this.currentState.getStateEvents(Ne.EventType.RoomMember,this.myUserId);e&&e.getContent().membership==="invite"&&(e.getUnsigned().invite_room_state||[]).forEach(i=>{this.currentState.getStateEvents(i.type,i.state_key)||this.currentState.setStateEvents([new il.MatrixEvent({type:i.type,state_key:i.state_key,content:i.content,event_id:"$fake"+Date.now(),room_id:this.roomId,user_id:this.myUserId})])});const t=this.name;this.name=this.calculateRoomName(this.myUserId),this.normalizedName=(0,ea.normalize)(this.name),this.summary=new IO.RoomSummary(this.roomId,{title:this.name}),t!==this.name&&this.emit(it.Name,this)}getUsersReadUpTo(e){return this.getReceiptsForEvent(e).filter(function(t){return t.type==="m.read"}).map(function(t){return t.userId})}getReadReceiptForUserId(e,t=!1){var r,i;const[s,o]=(r=(i=this.receipts["m.read"])===null||i===void 0?void 0:i[e])!==null&&r!==void 0?r:[];return t?s:o!=null?o:s}getEventReadUpTo(e,t=!1){var r;const i=this.getReadReceiptForUserId(e,t);return(r=i==null?void 0:i.eventId)!==null&&r!==void 0?r:null}hasUserReadEvent(e,t){const r=this.getEventReadUpTo(e,!1);if(r===t||this.timeline.length&&this.timeline[this.timeline.length-1].getSender()&&this.timeline[this.timeline.length-1].getSender()===e)return!0;for(let i=this.timeline.length-1;i>=0;--i){const s=this.timeline[i];if(s.getId()===t)return!1;if(s.getId()===r)return!0}return!1}getReceiptsForEvent(e){return this.receiptCacheByEventId[e.getId()]||[]}addReceipt(e,t=!1){this.addReceiptsToStructure(e,t),this.emit(it.Receipt,e,this)}addReceiptsToStructure(e,t){const r=e.getContent();Object.keys(r).forEach(i=>{Object.keys(r[i]).forEach(s=>{Object.keys(r[i][s]).forEach(o=>{var a,l;const u=r[i][s][o];this.receipts[s]||(this.receipts[s]={}),this.receipts[s][o]||(this.receipts[s][o]=[null,null]);const c=this.receipts[s][o];let g=c[Ks];if(t){var m;g=(m=c[Fs])!==null&&m!==void 0?m:c[Ks]}if(g){const T=this.getUnfilteredTimelineSet().compareEventOrdering(g.eventId,i);if(T!==null&&T>=0)return}const f={eventId:i,data:u},E=t?c[Ks]:f,I=t?f:c[Fs];let w=null;E&&I&&(w=this.getUnfilteredTimelineSet().compareEventOrdering(E.eventId,I.eventId));const k=w===null||w<0,C=(a=c[Fs])!==null&&a!==void 0?a:c[Ks];t&&k?c[Fs]=f:t||(c[Ks]=f,k||(c[Fs]=null));const S=(l=c[Fs])!==null&&l!==void 0?l:c[Ks];if(C!==S){if(C&&this.receiptCacheByEventId[C.eventId]){const T=C.eventId;this.receiptCacheByEventId[T]=this.receiptCacheByEventId[T].filter(D=>D.type!==s||D.userId!==o),this.receiptCacheByEventId[T].length<1&&delete this.receiptCacheByEventId[T]}this.receiptCacheByEventId[i]||(this.receiptCacheByEventId[i]=[]),this.receiptCacheByEventId[i].push({userId:o,type:s,data:u})}})})})}addLocalEchoReceipt(e,t,r){this.addReceipt(gg(e,t,r),!0)}addTags(e){this.tags=e.getContent().tags||{},this.emit(it.Tags,e,this)}addAccountData(e){for(let t=0;t<e.length;t++){const r=e[t];r.getType()==="m.tag"&&this.addTags(r);const i=this.accountData[r.getType()];this.accountData[r.getType()]=r,this.emit(it.AccountData,r,this,i)}}getAccountData(e){return this.accountData[e]}maySendMessage(){return this.getMyMembership()==="join"&&(this.client.isRoomEncrypted(this.roomId)?this.currentState.maySendEvent(Ne.EventType.RoomMessageEncrypted,this.myUserId):this.currentState.maySendEvent(Ne.EventType.RoomMessage,this.myUserId))}canInvite(e){let t=this.getMyMembership()==="join";const r=this.currentState.getStateEvents(Ne.EventType.RoomPowerLevels,""),i=r&&r.getContent(),s=this.getMember(e);return i&&s&&i.invite>s.powerLevel&&(t=!1),t}getJoinRule(){return this.currentState.getJoinRule()}getHistoryVisibility(){return this.currentState.getHistoryVisibility()}getGuestAccess(){return this.currentState.getGuestAccess()}getType(){const e=this.currentState.getStateEvents(Ne.EventType.RoomCreate,"");if(!e){this.getTypeWarning||(ht.logger.warn("[getType] Room "+this.roomId+" does not have an m.room.create event"),this.getTypeWarning=!0);return}return e.getContent()[Ne.RoomCreateTypeField]}isSpaceRoom(){return this.getType()===Ne.RoomType.Space}calculateRoomName(e,t=!1){if(!t){const m=this.currentState.getStateEvents(Ne.EventType.RoomName,"");if(m&&m.getContent()&&m.getContent().name)return m.getContent().name}const r=this.getCanonicalAlias();if(r)return r;const i=this.currentState.getJoinedMemberCount(),s=this.currentState.getInvitedMemberCount();let o=i+s-1,a=[];const l=this.currentState.getStateEvents(Ne.UNSTABLE_ELEMENT_FUNCTIONAL_USERS.name,"");Array.isArray(l==null?void 0:l.getContent().service_members)&&(a=l.getContent().service_members);let u=null;if(this.summaryHeroes)u=[],this.summaryHeroes.forEach(m=>{if(a.includes(m)){o--;return}const f=this.getMember(m);u.push(f?f.name:m)});else{let m=this.currentState.getMembers().filter(f=>f.userId!==e&&(f.membership==="invite"||f.membership==="join"));m=m.filter(({userId:f})=>a.includes(f)?(o--,!1):!0),m.sort((f,E)=>ea.compare(f.userId,E.userId)),m=m.slice(0,5),u=m.map(f=>f.name)}if(o)return zu(u,o);if(this.getMyMembership()=="join"){const m=this.currentState.getStateEvents(Ne.EventType.RoomThirdPartyInvite);if(m&&m.length){const f=m.map(E=>E.getContent().display_name);return`Inviting ${zu(f)}`}}let g=u;return g.length||(g=this.currentState.getMembers().filter(m=>m.userId!==e&&m.membership!=="invite"&&m.membership!=="join").map(m=>m.name)),g.length?`Empty room (was ${zu(g)})`:"Empty room"}applyNewVisibilityEvent(e){const t=e.asVisibilityChange();if(!t)return;const r=e.getSender();if(!r||!(Ne.EVENT_VISIBILITY_CHANGE_TYPE.name&&this.currentState.maySendStateEvent(Ne.EVENT_VISIBILITY_CHANGE_TYPE.name,r)||Ne.EVENT_VISIBILITY_CHANGE_TYPE.altName&&this.currentState.maySendStateEvent(Ne.EVENT_VISIBILITY_CHANGE_TYPE.altName,r)))return;const s=this.visibilityEvents.get(t.eventId);if(s){let a=s.length-1;const l=Math.max(0,s.length-MO);for(;a>=l&&!(s[a].getTs()<e.getTs());--a);a===-1?s.unshift(e):s.splice(a+1,0,e)}else this.visibilityEvents.set(t.eventId,[e]);const o=this.findEventById(t.eventId);!o||o.applyVisibilityEvent(t)}redactVisibilityChangeEvent(e){if(!e.isVisibilityEvent)throw new Error("expected a visibility change event");const r=e.getRelation().event_id,i=this.visibilityEvents.get(r);if(!i)return;const s=i.findIndex(o=>o.getId()===e.getId());if(s!==-1&&(i.splice(s,1),s===i.length)){const o=this.findEventById(r);if(!o)return;if(s===0)this.visibilityEvents.delete(r),o.applyVisibilityEvent();else{const l=i[i.length-1].asVisibilityChange();if(!l)throw new Error("at this stage, visibility changes should be well-formed");o.applyVisibilityEvent(l)}}}applyPendingVisibilityEvents(e){const t=this.visibilityEvents.get(e.getId());if(!t||t.length==0)return;const r=t[t.length-1],i=r.asVisibilityChange();!i||(i.visible,!(r.getTs()<e.getTs())&&e.applyVisibilityEvent(i))}}lr.Room=AO;function Yu(n){return`mx_pending_events_${n}`}const DO={[De.EventStatus.ENCRYPTING]:[De.EventStatus.SENDING,De.EventStatus.NOT_SENT,De.EventStatus.CANCELLED],[De.EventStatus.SENDING]:[De.EventStatus.ENCRYPTING,De.EventStatus.QUEUED,De.EventStatus.NOT_SENT,De.EventStatus.SENT],[De.EventStatus.QUEUED]:[De.EventStatus.SENDING,De.EventStatus.CANCELLED],[De.EventStatus.SENT]:[],[De.EventStatus.NOT_SENT]:[De.EventStatus.SENDING,De.EventStatus.QUEUED,De.EventStatus.CANCELLED],[De.EventStatus.CANCELLED]:[]};function zu(n,e=n.length+1){const t=e-1;return n.length?n.length===1&&t<=1?n[0]:n.length===2&&t<=2?`${n[0]} and ${n[1]}`:t>1?`${n[0]} and ${t} others`:`${n[0]} and 1 other`:"Empty room"}var Xl={};Object.defineProperty(Xl,"__esModule",{value:!0});Xl.Group=ac;var xO=Bl.exports,UO=$O(W);function jv(n){if(typeof WeakMap!="function")return null;var e=new WeakMap,t=new WeakMap;return(jv=function(r){return r?t:e})(n)}function $O(n,e){if(!e&&n&&n.__esModule)return n;if(n===null||typeof n!="object"&&typeof n!="function")return{default:n};var t=jv(e);if(t&&t.has(n))return t.get(n);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in n)if(s!=="default"&&Object.prototype.hasOwnProperty.call(n,s)){var o=i?Object.getOwnPropertyDescriptor(n,s):null;o&&(o.get||o.set)?Object.defineProperty(r,s,o):r[s]=n[s]}return r.default=n,t&&t.set(n,r),r}function ac(n){this.groupId=n,this.name=null,this.avatarUrl=null,this.myMembership=null,this.inviter=null}UO.inherits(ac,xO.EventEmitter);ac.prototype.setProfile=function(n,e){this.name===n&&this.avatarUrl===e||(this.name=n||this.groupId,this.avatarUrl=e,this.emit("Group.profile",this))};ac.prototype.setMyMembership=function(n){this.myMembership!==n&&(this.myMembership=n,this.emit("Group.myMembership",this))};ac.prototype.setInviter=function(n){this.inviter=n};var cc={},Fe={};Object.defineProperty(Fe,"__esModule",{value:!0});Fe.TweakName=Fe.RuleId=Fe.PushRuleKind=Fe.PushRuleActionName=Fe.DMMemberCountCondition=Fe.ConditionOperator=Fe.ConditionKind=void 0;Fe.isDmMemberCountCondition=LO;let Sh;Fe.PushRuleActionName=Sh;(function(n){n.DontNotify="dont_notify",n.Notify="notify",n.Coalesce="coalesce"})(Sh||(Fe.PushRuleActionName=Sh={}));let bh;Fe.TweakName=bh;(function(n){n.Highlight="highlight",n.Sound="sound"})(bh||(Fe.TweakName=bh={}));let wh;Fe.ConditionOperator=wh;(function(n){n.ExactEquals="==",n.LessThan="<",n.GreaterThan=">",n.GreaterThanOrEqual=">=",n.LessThanOrEqual="<="})(wh||(Fe.ConditionOperator=wh={}));const NO="2";Fe.DMMemberCountCondition=NO;function LO(n){return n==="==2"||n==="2"}let Rh;Fe.ConditionKind=Rh;(function(n){n.EventMatch="event_match",n.ContainsDisplayName="contains_display_name",n.RoomMemberCount="room_member_count",n.SenderNotificationPermission="sender_notification_permission"})(Rh||(Fe.ConditionKind=Rh={}));let Ih;Fe.PushRuleKind=Ih;(function(n){n.Override="override",n.ContentSpecific="content",n.RoomSpecific="room",n.SenderSpecific="sender",n.Underride="underride"})(Ih||(Fe.PushRuleKind=Ih={}));let Th;Fe.RuleId=Th;(function(n){n.Master=".m.rule.master",n.ContainsDisplayName=".m.rule.contains_display_name",n.ContainsUserName=".m.rule.contains_user_name",n.AtRoomNotification=".m.rule.roomnotif",n.DM=".m.rule.room_one_to_one",n.EncryptedDM=".m.rule.encrypted_room_one_to_one",n.Message=".m.rule.message",n.EncryptedMessage=".m.rule.encrypted",n.InviteToSelf=".m.rule.invite_for_me",n.MemberEvent=".m.rule.member_event",n.IncomingCall=".m.rule.call",n.SuppressNotices=".m.rule.suppress_notices",n.Tombstone=".m.rule.tombstone"})(Th||(Fe.RuleId=Th={}));var BO=G.exports;Object.defineProperty(cc,"__esModule",{value:!0});cc.PushProcessor=void 0;var Vv=BO(Y.exports),Ju=W,KO=se,Be=Fe;function mg(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function yg(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?mg(Object(t),!0).forEach(function(r){(0,Vv.default)(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):mg(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}const Xu=[Be.PushRuleKind.Override,Be.PushRuleKind.ContentSpecific,Be.PushRuleKind.RoomSpecific,Be.PushRuleKind.SenderSpecific,Be.PushRuleKind.Underride],FO=[{rule_id:".m.rule.tombstone",default:!0,enabled:!0,conditions:[{kind:Be.ConditionKind.EventMatch,key:"type",pattern:"m.room.tombstone"},{kind:Be.ConditionKind.EventMatch,key:"state_key",pattern:""}],actions:[Be.PushRuleActionName.Notify,{set_tweak:Be.TweakName.Highlight,value:!0}]},{rule_id:".m.rule.reaction",default:!0,enabled:!0,conditions:[{kind:Be.ConditionKind.EventMatch,key:"type",pattern:"m.reaction"}],actions:[Be.PushRuleActionName.DontNotify]}];class Ai{constructor(e){this.client=e}static actionListToActionsObject(e){const t={notify:!1,tweaks:{}};for(let r=0;r<e.length;++r){const i=e[r];i===Be.PushRuleActionName.Notify?t.notify=!0:typeof i=="object"&&(i.value===void 0&&(i.value=!0),t.tweaks[i.set_tweak]=i.value)}return t}static rewriteDefaultRules(e){let t=JSON.parse(JSON.stringify(e));t||(t={}),t.global||(t.global={}),t.global.override||(t.global.override=[]);const r=t.global.override;for(const i of FO){const s=r.find(o=>o.rule_id===i.rule_id);if(s)s.default=i.default,s.conditions=i.conditions,s.actions=i.actions;else{const o=i.rule_id;KO.logger.warn(`Adding default global override for ${o}`),r.push(i)}}return t}matchingRuleFromKindSet(e,t){for(let r=0;r<Xu.length;++r){const i=Xu[r],s=t[i];if(!!s)for(let o=0;o<s.length;++o){const a=s[o];if(!a.enabled)continue;const l=this.templateRuleToRaw(i,a);if(!!l&&this.ruleMatchesEvent(l,e))return yg(yg({},a),{},{kind:i})}}return null}templateRuleToRaw(e,t){const r={rule_id:t.rule_id,actions:t.actions,conditions:[]};switch(e){case Be.PushRuleKind.Underride:case Be.PushRuleKind.Override:r.conditions=t.conditions;break;case Be.PushRuleKind.RoomSpecific:if(!t.rule_id)return null;r.conditions.push({kind:Be.ConditionKind.EventMatch,key:"room_id",value:t.rule_id});break;case Be.PushRuleKind.SenderSpecific:if(!t.rule_id)return null;r.conditions.push({kind:Be.ConditionKind.EventMatch,key:"user_id",value:t.rule_id});break;case Be.PushRuleKind.ContentSpecific:if(!t.pattern)return null;r.conditions.push({kind:Be.ConditionKind.EventMatch,key:"content.body",pattern:t.pattern});break}return r}eventFulfillsCondition(e,t){switch(e.kind){case Be.ConditionKind.EventMatch:return this.eventFulfillsEventMatchCondition(e,t);case Be.ConditionKind.ContainsDisplayName:return this.eventFulfillsDisplayNameCondition(e,t);case Be.ConditionKind.RoomMemberCount:return this.eventFulfillsRoomMemberCountCondition(e,t);case Be.ConditionKind.SenderNotificationPermission:return this.eventFulfillsSenderNotifPermCondition(e,t)}return!1}eventFulfillsSenderNotifPermCondition(e,t){const r=e.key;if(!r)return!1;const i=this.client.getRoom(t.getRoomId());return i!=null&&i.currentState?i.currentState.mayTriggerNotifOfType(r,t.getSender()):!1}eventFulfillsRoomMemberCountCondition(e,t){if(!e.is)return!1;const r=this.client.getRoom(t.getRoomId());if(!r||!r.currentState||!r.currentState.members)return!1;const i=r.currentState.getJoinedMemberCount(),s=e.is.match(/^([=<>]*)([0-9]*)$/);if(!s)return!1;const o=s[1],a=parseInt(s[2]);if(isNaN(a))return!1;switch(o){case"":case"==":return i==a;case"<":return i<a;case">":return i>a;case"<=":return i<=a;case">=":return i>=a;default:return!1}}eventFulfillsDisplayNameCondition(e,t){let r=t.getContent();if(t.isEncrypted()&&t.getClearContent()&&(r=t.getClearContent()),!r||!r.body||typeof r.body!="string")return!1;const i=this.client.getRoom(t.getRoomId());if(!i||!i.currentState||!i.currentState.members||!i.currentState.getMember(this.client.credentials.userId))return!1;const s=i.currentState.getMember(this.client.credentials.userId).name,o=new RegExp("(^|\\W)"+(0,Ju.escapeRegExp)(s)+"(\\W|$)","i");return r.body.search(o)>-1}eventFulfillsEventMatchCondition(e,t){if(!e.key)return!1;const r=this.valueForDottedKey(e.key,t);if(typeof r!="string")return!1;if(e.value)return e.value===r;if(typeof e.pattern!="string")return!1;let i;return e.key=="content.body"?i=this.createCachedRegex("(^|\\W)",e.pattern,"(\\W|$)"):i=this.createCachedRegex("^",e.pattern,"$"),!!r.match(i)}createCachedRegex(e,t,r){return Ai.cachedGlobToRegex[t]||(Ai.cachedGlobToRegex[t]=new RegExp(e+(0,Ju.globToRegexp)(t)+r,"i")),Ai.cachedGlobToRegex[t]}valueForDottedKey(e,t){const r=e.split(".");let i;const s=r[0];for(s==="content"?(i=t.getContent(),r.shift()):s==="type"?(i=t.getType(),r.shift()):i=t.event;r.length>0;){const o=r.shift();if((0,Ju.isNullOrUndefined)(i[o]))return null;i=i[o]}return i}matchingRuleForEventWithRulesets(e,t){return!t||e.getSender()===this.client.credentials.userId?null:this.matchingRuleFromKindSet(e,t.global)}pushActionsForEventAndRulesets(e,t){const r=this.matchingRuleForEventWithRulesets(e,t);if(!r)return{};const i=Ai.actionListToActionsObject(r.actions);return i.tweaks.highlight===void 0&&(i.tweaks.highlight=r.kind==Be.PushRuleKind.ContentSpecific),i}ruleMatchesEvent(e,t){var r;if(!((r=e.conditions)!==null&&r!==void 0&&r.length))return!0;let i=!0;for(let s=0;s<e.conditions.length;++s){const o=e.conditions[s];i&=this.eventFulfillsCondition(o,t)}return i}actionsForEvent(e){return this.pushActionsForEventAndRulesets(e,this.client.pushRules)}getPushRuleById(e){for(const t of["global"])if(this.client.pushRules[t]!==void 0){for(const r of Xu)if(this.client.pushRules[t][r]!==void 0){for(const i of this.client.pushRules[t][r])if(i.rule_id===e)return i}}return null}}cc.PushProcessor=Ai;(0,Vv.default)(Ai,"cachedGlobToRegex",{});var oi={};Object.defineProperty(oi,"__esModule",{value:!0});oi.InvalidCryptoStoreError=Zl;oi.InvalidStoreError=Ql;oi.KeySignatureUploadError=void 0;function Ql(n,e){const t=`Store is invalid because ${n}, please stop the client, delete all data and start the client again`,r=Reflect.construct(Error,[t]);return Reflect.setPrototypeOf(r,Reflect.getPrototypeOf(this)),r.reason=n,r.value=e,r}Ql.TOGGLED_LAZY_LOADING="TOGGLED_LAZY_LOADING";Ql.prototype=Object.create(Error.prototype,{constructor:{value:Error,enumerable:!1,writable:!0,configurable:!0}});Reflect.setPrototypeOf(Ql,Error);function Zl(n){const e=`Crypto store is invalid because ${n}, please stop the client, delete all data and start the client again`,t=Reflect.construct(Error,[e]);return Reflect.setPrototypeOf(t,Reflect.getPrototypeOf(this)),t.reason=n,t.name="InvalidCryptoStoreError",t}Zl.TOO_NEW="TOO_NEW";Zl.prototype=Object.create(Error.prototype,{constructor:{value:Error,enumerable:!1,writable:!0,configurable:!0}});Reflect.setPrototypeOf(Zl,Error);class qO extends Error{constructor(e,t){super(e);this.value=t}}oi.KeySignatureUploadError=qO;var ri={},jO=G.exports;Object.defineProperty(ri,"__esModule",{value:!0});ri.SyncAccumulator=ri.Category=void 0;var ta=jO(Y.exports),VO=se,GO=W;let Bt;ri.Category=Bt;(function(n){n.Invite="invite",n.Leave="leave",n.Join="join"})(Bt||(ri.Category=Bt={}));class WO{constructor(e={}){this.opts=e,(0,ta.default)(this,"accountData",{}),(0,ta.default)(this,"inviteRooms",{}),(0,ta.default)(this,"joinRooms",{}),(0,ta.default)(this,"nextBatch",null),(0,ta.default)(this,"groups",{invite:{},join:{},leave:{}}),this.opts.maxTimelineEntries=this.opts.maxTimelineEntries||50}accumulate(e,t=!1){this.accumulateRooms(e,t),this.accumulateGroups(e),this.accumulateAccountData(e),this.nextBatch=e.next_batch}accumulateAccountData(e){!e.account_data||!e.account_data.events||e.account_data.events.forEach(t=>{this.accountData[t.type]=t})}accumulateRooms(e,t=!1){!e.rooms||(e.rooms.invite&&Object.keys(e.rooms.invite).forEach(r=>{this.accumulateRoom(r,Bt.Invite,e.rooms.invite[r],t)}),e.rooms.join&&Object.keys(e.rooms.join).forEach(r=>{this.accumulateRoom(r,Bt.Join,e.rooms.join[r],t)}),e.rooms.leave&&Object.keys(e.rooms.leave).forEach(r=>{this.accumulateRoom(r,Bt.Leave,e.rooms.leave[r],t)}))}accumulateRoom(e,t,r,i=!1){switch(t){case Bt.Invite:this.accumulateInviteState(e,r);break;case Bt.Join:this.inviteRooms[e]&&delete this.inviteRooms[e],this.accumulateJoinState(e,r,i);break;case Bt.Leave:this.inviteRooms[e]?delete this.inviteRooms[e]:delete this.joinRooms[e];break;default:VO.logger.error("Unknown cateogory: ",t)}}accumulateInviteState(e,t){if(!t.invite_state||!t.invite_state.events)return;if(!this.inviteRooms[e]){this.inviteRooms[e]={invite_state:t.invite_state};return}const r=this.inviteRooms[e];t.invite_state.events.forEach(i=>{let s=!1;for(let o=0;o<r.invite_state.events.length;o++){const 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)})}accumulateJoinState(e,t,r=!1){this.joinRooms[e]||(this.joinRooms[e]={_currentState:Object.create(null),_timeline:[],_accountData:Object.create(null),_unreadNotifications:{},_summary:{},_readReceipts:{}});const i=this.joinRooms[e];if(t.account_data&&t.account_data.events&&t.account_data.events.forEach(s=>{i._accountData[s.type]=s}),t.unread_notifications&&(i._unreadNotifications=t.unread_notifications),t.summary){const s="m.heroes",o="m.invited_member_count",a="m.joined_member_count",l=i._summary,u=t.summary;l[s]=u[s]||l[s],l[a]=u[a]||l[a],l[o]=u[o]||l[o]}if(t.ephemeral&&t.ephemeral.events&&t.ephemeral.events.forEach(s=>{s.type!=="m.receipt"||!s.content||Object.keys(s.content).forEach(o=>{!s.content[o]["m.read"]||Object.keys(s.content[o]["m.read"]).forEach(a=>{i._readReceipts[a]={data:s.content[o]["m.read"][a],eventId:o}})})}),t.timeline&&t.timeline.limited&&(i._timeline=[]),t.state&&t.state.events&&t.state.events.forEach(s=>{Qu(i._currentState,s)}),t.timeline&&t.timeline.events&&t.timeline.events.forEach((s,o)=>{Qu(i._currentState,s);let a;if(r)a=s;else{a=Object.assign({},s),a.unsigned!==void 0&&(a.unsigned=Object.assign({},a.unsigned));const l=s.unsigned?s.unsigned.age:s.age;l!==void 0&&(a._localTs=Date.now()-l)}i._timeline.push({event:a,token:o===0?t.timeline.prev_batch:null})}),i._timeline.length>this.opts.maxTimelineEntries){const s=i._timeline.length-this.opts.maxTimelineEntries;for(let o=s;o<i._timeline.length;o++)if(i._timeline[o].token){i._timeline=i._timeline.slice(o,i._timeline.length);break}}}accumulateGroups(e){!e.groups||(e.groups.invite&&Object.keys(e.groups.invite).forEach(t=>{this.accumulateGroup(t,Bt.Invite,e.groups.invite[t])}),e.groups.join&&Object.keys(e.groups.join).forEach(t=>{this.accumulateGroup(t,Bt.Join,e.groups.join[t])}),e.groups.leave&&Object.keys(e.groups.leave).forEach(t=>{this.accumulateGroup(t,Bt.Leave,e.groups.leave[t])}))}accumulateGroup(e,t,r){for(const i of[Bt.Invite,Bt.Leave,Bt.Join])delete this.groups[i][e];this.groups[t][e]=r}getJSON(e=!1){const t={join:{},invite:{},leave:{}};Object.keys(this.inviteRooms).forEach(i=>{t.invite[i]=this.inviteRooms[i]}),Object.keys(this.joinRooms).forEach(i=>{const s=this.joinRooms[i],o={ephemeral:{events:[]},account_data:{events:[]},state:{events:[]},timeline:{events:[],prev_batch:null},unread_notifications:s._unreadNotifications,summary:s._summary};Object.keys(s._accountData).forEach(u=>{o.account_data.events.push(s._accountData[u])});const a={type:"m.receipt",room_id:i,content:{}};Object.keys(s._readReceipts).forEach(u=>{const c=s._readReceipts[u];a.content[c.eventId]||(a.content[c.eventId]={"m.read":{}}),a.content[c.eventId]["m.read"][u]=c.data}),Object.keys(a.content).length>0&&o.ephemeral.events.push(a),s._timeline.forEach(u=>{if(!o.timeline.prev_batch){if(!u.token)return;o.timeline.prev_batch=u.token}let c;!e&&u.event._localTs?(c=Object.assign({},u.event),c.unsigned!==void 0&&(c.unsigned=Object.assign({},c.unsigned)),delete c._localTs,c.unsigned=c.unsigned||{},c.unsigned.age=Date.now()-u.event._localTs):c=u.event,o.timeline.events.push(c)});const l=Object.create(null);for(let u=o.timeline.events.length-1;u>=0;u--){const c=o.timeline.events[u];if(c.state_key===null||c.state_key===void 0)continue;const g=(0,GO.deepCopy)(c);g.unsigned&&(g.unsigned.prev_content&&(g.content=g.unsigned.prev_content),g.unsigned.prev_sender&&(g.sender=g.unsigned.prev_sender)),Qu(l,g)}Object.keys(s._currentState).forEach(u=>{Object.keys(s._currentState[u]).forEach(c=>{let g=s._currentState[u][c];l[u]&&l[u][c]&&(g=l[u][c]),o.state.events.push(g)})}),t.join[i]=o});const r=[];return Object.keys(this.accountData).forEach(i=>{r.push(this.accountData[i])}),{nextBatch:this.nextBatch,roomsData:t,groupsData:this.groups,accountData:r}}getNextBatchToken(){return this.nextBatch}}ri.SyncAccumulator=WO;function Qu(n,e){e.state_key===null||e.state_key===void 0||!e.type||(n[e.type]||(n[e.type]=Object.create(null)),n[e.type][e.state_key]=e)}var HO=G.exports;Object.defineProperty($i,"__esModule",{value:!0});$i.SyncState=$i.SyncApi=void 0;var Tr=HO(Y.exports),qs=Qr,It=lr,YO=Xl,js=XO(W),vg=Ds,_g=qt,zO=cc,er=se,Eg=oi,qe=st,Zu=ri,Oc=me,JO=ie,Si=Tn,kc=Zr,ed=vr;function Gv(n){if(typeof WeakMap!="function")return null;var e=new WeakMap,t=new WeakMap;return(Gv=function(r){return r?t:e})(n)}function XO(n,e){if(!e&&n&&n.__esModule)return n;if(n===null||typeof n!="object"&&typeof n!="function")return{default:n};var t=Gv(e);if(t&&t.has(n))return t.get(n);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in n)if(s!=="default"&&Object.prototype.hasOwnProperty.call(n,s)){var o=i?Object.getOwnPropertyDescriptor(n,s):null;o&&(o.get||o.set)?Object.defineProperty(r,s,o):r[s]=n[s]}return r.default=n,t&&t.set(n,r),r}const Sg=80*1e3,QO=3;let kt;$i.SyncState=kt;(function(n){n.Error="ERROR",n.Prepared="PREPARED",n.Stopped="STOPPED",n.Syncing="SYNCING",n.Catchup="CATCHUP",n.Reconnecting="RECONNECTING"})(kt||($i.SyncState=kt={}));function bg(n,e){return"FILTER_SYNC_"+n+(e?"_"+e:"")}function Me(...n){er.logger.log(...n)}var Oh;(function(n){n.Offline="offline",n.Online="online",n.Unavailable="unavailable"})(Oh||(Oh={}));class ZO{constructor(e,t={}){var r;this.client=e,this.opts=t,(0,Tr.default)(this,"_peekRoom",null),(0,Tr.default)(this,"currentSyncRequest",null),(0,Tr.default)(this,"syncState",null),(0,Tr.default)(this,"syncStateData",null),(0,Tr.default)(this,"catchingUp",!1),(0,Tr.default)(this,"running",!1),(0,Tr.default)(this,"keepAliveTimer",null),(0,Tr.default)(this,"connectionReturnedDefer",null),(0,Tr.default)(this,"notifEvents",[]),(0,Tr.default)(this,"failedSyncCount",0),(0,Tr.default)(this,"storeIsInvalid",!1),(0,Tr.default)(this,"onOnline",()=>{Me("Browser thinks we are back online"),this.startKeepAlives(0)}),this.opts.initialSyncLimit=(r=this.opts.initialSyncLimit)!==null&&r!==void 0?r:8,this.opts.resolveInvitesToProfiles=this.opts.resolveInvitesToProfiles||!1,this.opts.pollTimeout=this.opts.pollTimeout||30*1e3,this.opts.pendingEventOrdering=this.opts.pendingEventOrdering||qe.PendingEventOrdering.Chronological,this.opts.experimentalThreadSupport=this.opts.experimentalThreadSupport===!0,t.canResetEntireTimeline||(t.canResetEntireTimeline=i=>!1),e.getNotifTimelineSet()&&e.reEmitter.reEmit(e.getNotifTimelineSet(),[It.RoomEvent.Timeline,It.RoomEvent.TimelineReset])}createRoom(e){const t=this.client,{timelineSupport:r,unstableClientRelationAggregation:i}=t,s=new It.Room(e,t,t.getUserId(),{lazyLoadMembers:this.opts.lazyLoadMembers,pendingEventOrdering:this.opts.pendingEventOrdering,timelineSupport:r,unstableClientRelationAggregation:i});return t.reEmitter.reEmit(s,[It.RoomEvent.Name,It.RoomEvent.Redaction,It.RoomEvent.RedactionCancelled,It.RoomEvent.Receipt,It.RoomEvent.Tags,It.RoomEvent.LocalEchoUpdated,It.RoomEvent.AccountData,It.RoomEvent.MyMembership,It.RoomEvent.Timeline,It.RoomEvent.TimelineReset]),this.registerStateListeners(s),s}createGroup(e){const t=this.client,r=new YO.Group(e);return t.reEmitter.reEmit(r,[qe.ClientEvent.GroupProfile,qe.ClientEvent.GroupMyMembership]),t.store.storeGroup(r),r}registerStateListeners(e){const t=this.client;t.reEmitter.reEmit(e.currentState,[Si.RoomStateEvent.Events,Si.RoomStateEvent.Members,Si.RoomStateEvent.NewMember,Si.RoomStateEvent.Update,ed.BeaconEvent.New,ed.BeaconEvent.Update,ed.BeaconEvent.LivenessChange]),e.currentState.on(Si.RoomStateEvent.NewMember,function(r,i,s){s.user=t.getUser(s.userId),t.reEmitter.reEmit(s,[kc.RoomMemberEvent.Name,kc.RoomMemberEvent.Typing,kc.RoomMemberEvent.PowerLevel,kc.RoomMemberEvent.Membership])})}deregisterStateListeners(e){e.currentState.removeAllListeners(Si.RoomStateEvent.Events),e.currentState.removeAllListeners(Si.RoomStateEvent.Members),e.currentState.removeAllListeners(Si.RoomStateEvent.NewMember)}syncLeftRooms(){const e=this.client,t=new vg.Filter(this.client.credentials.userId);t.setTimelineLimit(1),t.setIncludeLeaveRooms(!0);const r=this.opts.pollTimeout+Sg,i={timeout:0};return e.getOrCreateFilter(bg(e.credentials.userId,"LEFT_ROOMS"),t).then(function(s){return i.filter=s,e.http.authedRequest(void 0,Oc.Method.Get,"/sync",i,void 0,r)}).then(s=>{var o;let a=[];(o=s.rooms)!==null&&o!==void 0&&o.leave&&(a=this.mapSyncResponseToRoomArray(s.rooms.leave));const l=[];return a.forEach(async u=>{const c=u.room;if(l.push(c),!u.isBrandNewRoom)return;u.timeline=u.timeline||{};const g=this.mapSyncEventsFormat(u.timeline,c),[m,f]=this.client.partitionThreadedEvents(g),E=this.mapSyncEventsFormat(u.state,c);c.getLiveTimeline().setPaginationToken(u.timeline.prev_batch,_g.EventTimeline.BACKWARDS),this.processRoomEvents(c,E,m),await this.processThreadEvents(c,f,!1),c.recalculate(),e.store.storeRoom(c),e.emit(qe.ClientEvent.Room,c),this.processEventsForNotifs(c,g)}),l})}peek(e){if(this._peekRoom&&this._peekRoom.roomId===e)return Promise.resolve(this._peekRoom);const t=this.client;return this._peekRoom=this.createRoom(e),this.client.roomInitialSync(e,20).then(r=>{r.messages=r.messages||{chunk:[]},r.messages.chunk=r.messages.chunk||[],r.state=r.state||[];const i=js.deepCopy(r.state).map(t.getEventMapper()),s=r.state.map(t.getEventMapper()),o=r.messages.chunk.map(t.getEventMapper());return r.presence&&Array.isArray(r.presence)&&r.presence.map(t.getEventMapper()).forEach(function(a){let l=t.store.getUser(a.getContent().user_id);l?l.setPresenceEvent(a):(l=Cc(t,a.getContent().user_id),l.setPresenceEvent(a),t.store.storeUser(l)),t.emit(qe.ClientEvent.Event,a)}),r.messages.start&&(this._peekRoom.oldState.paginationToken=r.messages.start),this._peekRoom.oldState.setStateEvents(i),this._peekRoom.currentState.setStateEvents(s),this.resolveInvites(this._peekRoom),this._peekRoom.recalculate(),this._peekRoom.addEventsToTimeline(o.reverse(),!0,this._peekRoom.getLiveTimeline(),r.messages.start),t.store.storeRoom(this._peekRoom),t.emit(qe.ClientEvent.Room,this._peekRoom),this.peekPoll(this._peekRoom),this._peekRoom})}stopPeeking(){this._peekRoom=null}peekPoll(e,t){if(this._peekRoom!==e){Me("Stopped peeking in room %s",e.roomId);return}this.client.http.authedRequest(void 0,Oc.Method.Get,"/events",{room_id:e.roomId,timeout:String(30*1e3),from:t},void 0,50*1e3).then(r=>{if(this._peekRoom!==e){Me("Stopped peeking in room %s",e.roomId);return}r.chunk.filter(function(s){return s.type==="m.presence"}).map(this.client.getEventMapper()).forEach(s=>{let o=this.client.store.getUser(s.getContent().user_id);o?o.setPresenceEvent(s):(o=Cc(this.client,s.getContent().user_id),o.setPresenceEvent(s),this.client.store.storeUser(o)),this.client.emit(qe.ClientEvent.Event,s)});const i=r.chunk.filter(function(s){return s.room_id===e.roomId&&s.event_id}).map(this.client.getEventMapper());e.addLiveEvents(i),this.peekPoll(e,r.end)},r=>{er.logger.error("[%s] Peek poll failed: %s",e.roomId,r),setTimeout(()=>{this.peekPoll(e,t)},30*1e3)})}getSyncState(){return this.syncState}getSyncStateData(){return this.syncStateData}async recoverFromSyncStartupError(e,t){await e;const r=this.startKeepAlives();this.updateSyncState(kt.Error,{error:t}),await r}async wasLazyLoadingToggled(e=!1){let t=!1;if(!await this.client.store.isNewlyCreated()){const i=await this.client.store.getClientOptions();return i&&(t=!!i.lazyLoadMembers),t!==e}return!1}shouldAbortSync(e){return e.errcode==="M_UNKNOWN_TOKEN"?(er.logger.warn("Token no longer valid - assuming logout"),this.stop(),this.updateSyncState(kt.Error,{error:e}),!0):!1}sync(){const e=this.client;this.running=!0,V.window&&V.window.addEventListener&&V.window.addEventListener("online",this.onOnline,!1);let t=Promise.resolve(),r=null;const i=async()=>{try{Me("Getting push rules...");const l=await e.getPushRules();Me("Got push rules"),e.pushRules=l}catch(l){if(er.logger.error("Getting push rules failed",l),this.shouldAbortSync(l))return;Me("Waiting for saved sync before retrying push rules..."),await this.recoverFromSyncStartupError(t,l),i();return}o()},s=()=>{const l=new vg.Filter(e.credentials.userId);return l.setTimelineLimit(this.opts.initialSyncLimit),l},o=async()=>{if(Me("Checking lazy load status..."),this.opts.lazyLoadMembers&&e.isGuest()&&(this.opts.lazyLoadMembers=!1),this.opts.lazyLoadMembers&&(Me("Checking server lazy load support..."),await e.doesServerSupportLazyLoading()?(Me("Enabling lazy load on sync filter..."),this.opts.filter||(this.opts.filter=s()),this.opts.filter.setLazyLoadMembers(!0)):(Me("LL: lazy loading requested but not supported by server, so disabling"),this.opts.lazyLoadMembers=!1)),Me("Checking whether lazy loading has changed in store..."),await this.wasLazyLoadingToggled(this.opts.lazyLoadMembers)){this.storeIsInvalid=!0;const u=Eg.InvalidStoreError.TOGGLED_LAZY_LOADING,c=new Eg.InvalidStoreError(u,!!this.opts.lazyLoadMembers);this.updateSyncState(kt.Error,{error:c}),er.logger.warn("InvalidStoreError: store is not usable: stopping sync.");return}this.opts.lazyLoadMembers&&this.opts.crypto&&this.opts.crypto.enableLazyLoading();try{Me("Storing client options..."),await this.client.storeClientOptions(),Me("Stored client options")}catch(u){throw er.logger.error("Storing client options failed",u),u}a()},a=async()=>{Me("Getting filter...");let l;this.opts.filter?l=this.opts.filter:l=s();let u;try{u=await e.getOrCreateFilter(bg(e.credentials.userId),l)}catch(c){if(er.logger.error("Getting filter failed",c),this.shouldAbortSync(c))return;Me("Waiting for saved sync before retrying filter..."),await this.recoverFromSyncStartupError(t,c),a();return}e.resetNotifTimelineSet(),this.currentSyncRequest===null&&(Me("Sending first sync request..."),this.currentSyncRequest=this.doSyncRequest({filterId:u},r)),Me("Waiting for saved sync before starting sync processing..."),await t,this.doSync({filterId:u})};e.isGuest()?this.doSync({}):(Me("Getting saved sync token..."),t=e.store.getSavedSyncToken().then(l=>(Me("Got saved sync token"),r=l,Me("Getting saved sync..."),e.store.getSavedSync())).then(l=>{if(Me(`Got reply from saved sync, exists? ${!!l}`),l)return this.syncFromCache(l)}).catch(l=>{er.logger.error("Getting saved sync failed",l)}),i())}stop(){Me("SyncApi.stop"),V.window&&V.window.removeEventListener&&V.window.removeEventListener("online",this.onOnline,!1),this.running=!1,this.currentSyncRequest&&this.currentSyncRequest.abort(),this.keepAliveTimer&&(clearTimeout(this.keepAliveTimer),this.keepAliveTimer=null)}retryImmediately(){return this.connectionReturnedDefer?(this.startKeepAlives(0),!0):!1}async syncFromCache(e){Me("sync(): not doing HTTP hit, instead returning stored /sync data");const t=e.nextBatch;this.client.store.setSyncToken(t);const r={oldSyncToken:null,nextSyncToken:t,catchingUp:!1,fromCache:!0},i={next_batch:t,rooms:e.roomsData,groups:e.groupsData,account_data:{events:e.accountData}};try{await this.processSyncResponse(r,i)}catch(s){er.logger.error("Error processing cached sync",s.stack||s)}this.storeIsInvalid||this.updateSyncState(kt.Prepared,r)}async doSync(e){const t=this.client;if(!this.running){Me("Sync no longer running: exiting."),this.connectionReturnedDefer&&(this.connectionReturnedDefer.reject(),this.connectionReturnedDefer=null),this.updateSyncState(kt.Stopped);return}const r=t.store.getSyncToken();let i;try{this.currentSyncRequest===null&&(this.currentSyncRequest=this.doSyncRequest(e,r)),i=await this.currentSyncRequest}catch(o){this.onSyncError(o,e);return}finally{this.currentSyncRequest=null}t.store.setSyncToken(i.next_batch),this.failedSyncCount=0,await t.store.setSyncData(i);const s={oldSyncToken:r,nextSyncToken:i.next_batch,catchingUp:this.catchingUp};this.opts.crypto&&await this.opts.crypto.onSyncWillProcess(s);try{await this.processSyncResponse(s,i)}catch(o){er.logger.error("Caught /sync error",o.stack||o),this.client.emit(qe.ClientEvent.SyncUnexpectedError,o)}s.catchingUp=this.catchingUp,e.hasSyncedBefore||(this.updateSyncState(kt.Prepared,s),e.hasSyncedBefore=!0),this.opts.crypto&&await this.opts.crypto.onSyncCompleted(s),this.updateSyncState(kt.Syncing,s),t.store.wantsSave()&&(this.opts.crypto&&await this.opts.crypto.saveDeviceList(0),t.store.save()),this.doSync(e)}doSyncRequest(e,t){const r=this.getSyncParams(e,t);return this.client.http.authedRequest(void 0,Oc.Method.Get,"/sync",r,void 0,r.timeout+Sg)}getSyncParams(e,t){let r=this.opts.pollTimeout;(this.getSyncState()!=="SYNCING"||this.catchingUp)&&(this.catchingUp=!0,r=0);let i=e.filterId;this.client.isGuest()&&!i&&(i=this.getGuestFilter());const s={filter:i,timeout:r};return this.opts.disablePresence&&(s.set_presence=Oh.Offline),t?s.since=t:s._cacheBuster=Date.now(),(this.getSyncState()=="ERROR"||this.getSyncState()=="RECONNECTING")&&(s.timeout=0),s}onSyncError(e,t){if(!this.running){Me("Sync no longer running: exiting"),this.connectionReturnedDefer&&(this.connectionReturnedDefer.reject(),this.connectionReturnedDefer=null),this.updateSyncState(kt.Stopped);return}er.logger.error("/sync error %s",e),er.logger.error(e),!this.shouldAbortSync(e)&&(this.failedSyncCount++,er.logger.log("Number of consecutive failed sync requests:",this.failedSyncCount),Me("Starting keep-alive"),this.startKeepAlives().then(r=>{r&&this.getSyncState()===kt.Error&&this.updateSyncState(kt.Catchup,{oldSyncToken:null,nextSyncToken:null,catchingUp:!0}),this.doSync(t)}),this.currentSyncRequest=null,this.updateSyncState(this.failedSyncCount>=QO?kt.Error:kt.Reconnecting,{error:e}))}async processSyncResponse(e,t){const r=this.client;if(t.presence&&Array.isArray(t.presence.events)&&t.presence.events.map(r.getEventMapper()).forEach(function(a){let l=r.store.getUser(a.getSender());l?l.setPresenceEvent(a):(l=Cc(r,a.getSender()),l.setPresenceEvent(a),r.store.storeUser(l)),r.emit(qe.ClientEvent.Event,a)}),t.account_data&&Array.isArray(t.account_data.events)){const a=t.account_data.events.map(r.getEventMapper()),l=a.reduce((u,c)=>(u[c.getId()]=r.store.getAccountData(c.getType()),u),{});r.store.storeAccountDataEvents(a),a.forEach(function(u){if(u.getType()===JO.EventType.PushRules){const g=u.getContent();r.pushRules=zO.PushProcessor.rewriteDefaultRules(g)}const c=l[u.getId()];return r.emit(qe.ClientEvent.AccountData,u,c),u})}if(t.to_device&&Array.isArray(t.to_device.events)&&t.to_device.events.length>0){const a=[];t.to_device.events.map(r.getEventMapper()).map(l=>{if(l.getType()==="m.key.verification.cancel"){const u=l.getContent().transaction_id;u&&a.push(u)}return l}).forEach(function(l){const u=l.getContent();if(l.getType()=="m.room.message"&&u.msgtype=="m.bad.encrypted"){er.logger.log("Ignoring undecryptable to-device event from "+l.getSender());return}if(l.getType()==="m.key.verification.start"||l.getType()==="m.key.verification.request"){const c=u.transaction_id;a.includes(c)&&l.flagCancelled()}r.emit(qe.ClientEvent.ToDeviceEvent,l)})}else this.catchingUp=!1;t.groups&&(t.groups.invite&&this.processGroupSyncEntry(t.groups.invite,Zu.Category.Invite),t.groups.join&&this.processGroupSyncEntry(t.groups.join,Zu.Category.Join),t.groups.leave&&this.processGroupSyncEntry(t.groups.leave,Zu.Category.Leave));let i=[],s=[],o=[];if(t.rooms&&(t.rooms.invite&&(i=this.mapSyncResponseToRoomArray(t.rooms.invite)),t.rooms.join&&(s=this.mapSyncResponseToRoomArray(t.rooms.join)),t.rooms.leave&&(o=this.mapSyncResponseToRoomArray(t.rooms.leave))),this.notifEvents=[],i.forEach(a=>{const l=a.room,u=this.mapSyncEventsFormat(a.invite_state,l);this.processRoomEvents(l,u),a.isBrandNewRoom&&(l.recalculate(),r.store.storeRoom(l),r.emit(qe.ClientEvent.Room,l)),u.forEach(function(c){r.emit(qe.ClientEvent.Event,c)}),l.updateMyMembership("invite")}),await js.promiseMapSeries(s,async a=>{const l=a.room,u=this.mapSyncEventsFormat(a.state,l),c=this.mapSyncEventsFormat(a.timeline,l,!1),g=this.mapSyncEventsFormat(a.ephemeral),m=this.mapSyncEventsFormat(a.account_data),f=r.isRoomEncrypted(l.roomId);if(a.unread_notifications&&(l.setUnreadNotificationCount(It.NotificationCountType.Total,a.unread_notifications.notification_count),(!f||f&&l.getUnreadNotificationCount(It.NotificationCountType.Highlight)<=0)&&l.setUnreadNotificationCount(It.NotificationCountType.Highlight,a.unread_notifications.highlight_count)),a.timeline=a.timeline||{},a.isBrandNewRoom)l.getLiveTimeline().setPaginationToken(a.timeline.prev_batch,_g.EventTimeline.BACKWARDS);else if(a.timeline.limited){let k=!0;for(let C=c.length-1;C>=0;C--){const S=c[C].getId();if(l.getTimelineForEvent(S)){Me("Already have event "+S+" in limited sync - not resetting"),k=!1,c.splice(0,C);break}}k&&(this.deregisterStateListeners(l),l.resetLiveTimeline(a.timeline.prev_batch,this.opts.canResetEntireTimeline(l.roomId)?null:e.oldSyncToken),r.resetNotifTimelineSet(),this.registerStateListeners(l))}const[E,I]=this.client.partitionThreadedEvents(c);this.processRoomEvents(l,u,E,e.fromCache),await this.processThreadEvents(l,I,!1),a.summary&&l.setSummary(a.summary),l.addEphemeralEvents(g),l.addAccountData(m),l.recalculate(),a.isBrandNewRoom&&(r.store.storeRoom(l),r.emit(qe.ClientEvent.Room,l)),this.processEventsForNotifs(l,c);const w=async k=>{if(r.emit(qe.ClientEvent.Event,k),k.isState()&&k.getType()=="m.room.encryption"&&this.opts.crypto&&await this.opts.crypto.onCryptoEvent(k),k.isState()&&k.getType()==="im.vector.user_status"){let C=r.store.getUser(k.getStateKey());C?C.unstable_updateStatusMessage(k):(C=Cc(r,k.getStateKey()),C.unstable_updateStatusMessage(k),r.store.storeUser(C))}};await js.promiseMapSeries(u,w),await js.promiseMapSeries(E,w),await js.promiseMapSeries(I,w),g.forEach(function(k){r.emit(qe.ClientEvent.Event,k)}),m.forEach(function(k){r.emit(qe.ClientEvent.Event,k)}),l.updateMyMembership("join"),l.decryptCriticalEvents()}),o.forEach(async a=>{const l=a.room,u=this.mapSyncEventsFormat(a.state,l),c=this.mapSyncEventsFormat(a.timeline,l),g=this.mapSyncEventsFormat(a.account_data),[m,f]=this.client.partitionThreadedEvents(c);this.processRoomEvents(l,u,m),await this.processThreadEvents(l,f,!1),l.addAccountData(g),l.recalculate(),a.isBrandNewRoom&&(r.store.storeRoom(l),r.emit(qe.ClientEvent.Room,l)),this.processEventsForNotifs(l,c),u.forEach(function(E){r.emit(qe.ClientEvent.Event,E)}),m.forEach(function(E){r.emit(qe.ClientEvent.Event,E)}),f.forEach(function(E){r.emit(qe.ClientEvent.Event,E)}),g.forEach(function(E){r.emit(qe.ClientEvent.Event,E)}),l.updateMyMembership("leave")}),e.oldSyncToken&&this.notifEvents.length&&(this.notifEvents.sort(function(a,l){return a.getTs()-l.getTs()}),this.notifEvents.forEach(function(a){r.getNotifTimelineSet().addLiveEvent(a)})),t.device_lists&&this.opts.crypto&&await this.opts.crypto.handleDeviceListChanges(e,t.device_lists),this.opts.crypto&&t.device_one_time_keys_count){const a=t.device_one_time_keys_count.signed_curve25519||0;this.opts.crypto.updateOneTimeKeyCount(a)}if(this.opts.crypto&&(t.device_unused_fallback_key_types||t["org.matrix.msc2732.device_unused_fallback_key_types"])){const a=t.device_unused_fallback_key_types||t["org.matrix.msc2732.device_unused_fallback_key_types"];this.opts.crypto.setNeedsNewFallback(a instanceof Array&&!a.includes("signed_curve25519"))}}startKeepAlives(e){return e===void 0&&(e=2e3+Math.floor(Math.random()*5e3)),this.keepAliveTimer!==null&&clearTimeout(this.keepAliveTimer),e>0?this.keepAliveTimer=setTimeout(this.pokeKeepAlive.bind(this),e):this.pokeKeepAlive(),this.connectionReturnedDefer||(this.connectionReturnedDefer=js.defer()),this.connectionReturnedDefer.promise}pokeKeepAlive(e=!1){const t=()=>{clearTimeout(this.keepAliveTimer),this.connectionReturnedDefer&&(this.connectionReturnedDefer.resolve(e),this.connectionReturnedDefer=null)};this.client.http.request(void 0,Oc.Method.Get,"/_matrix/client/versions",void 0,void 0,{prefix:"",localTimeoutMs:15*1e3}).then(()=>{t()},r=>{r.httpStatus==400||r.httpStatus==404?this.keepAliveTimer=setTimeout(t,2e3):(e=!0,this.keepAliveTimer=setTimeout(this.pokeKeepAlive.bind(this,e),5e3+Math.floor(Math.random()*5e3)),this.updateSyncState(kt.Error,{error:r}))})}processGroupSyncEntry(e,t){for(const r of Object.keys(e)){const i=e[r];let s=this.client.store.getGroup(r);const o=s===null;s===null&&(s=this.createGroup(r)),i.profile&&s.setProfile(i.profile.name,i.profile.avatar_url),i.inviter&&s.setInviter({userId:i.inviter}),s.setMyMembership(t),o&&this.client.emit(qe.ClientEvent.Group,s)}}mapSyncResponseToRoomArray(e){const t=this.client;return Object.keys(e).map(r=>{const i=e[r];let s=t.store.getRoom(r),o=!1;return s||(s=this.createRoom(r),o=!0),i.room=s,i.isBrandNewRoom=o,i})}mapSyncEventsFormat(e,t,r=!0){if(!e||!Array.isArray(e.events))return[];const i=this.client.getEventMapper({decrypt:r});return e.events.map(function(s){return t&&(s.room_id=t.roomId),i(s)})}resolveInvites(e){if(!e||!this.opts.resolveInvitesToProfiles)return;const t=this.client;e.getMembersWithMembership("invite").forEach(function(r){if(r._requestedProfileInfo)return;r._requestedProfileInfo=!0;const i=t.getUser(r.userId);let s;i?s=Promise.resolve({avatar_url:i.avatarUrl,displayname:i.displayName}):s=t.getProfileInfo(r.userId),s.then(function(o){const a=r.events.member;a.getContent().membership==="invite"&&(a.getContent().avatar_url=o.avatar_url,a.getContent().displayname=o.displayname,r.setMembershipEvent(a,e.currentState))},function(o){})})}processRoomEvents(e,t,r,i=!1){const s=e.getLiveTimeline(),o=s.getEvents().length==0;if(o){for(const a of t)this.client.getPushActionsForEvent(a);s.initialiseState(t)}this.resolveInvites(e),e.recalculate(),o||(e.oldState.setStateEvents(t||[]),e.currentState.setStateEvents(t||[])),e.addLiveEvents(r||[],null,i)}processThreadEvents(e,t,r){return this.client.processThreadEvents(e,t,r)}processEventsForNotifs(e,t){if(this.client.getNotifTimelineSet())for(let r=0;r<t.length;r++){const i=this.client.getPushActionsForEvent(t[r]);i&&i.notify&&i.tweaks&&i.tweaks.highlight&&this.notifEvents.push(t[r])}}getGuestFilter(){return"{}"}updateSyncState(e,t){const r=this.syncState;this.syncState=e,this.syncStateData=t,this.client.emit(qe.ClientEvent.Sync,this.syncState,r,t)}}$i.SyncApi=ZO;function Cc(n,e){const t=new qs.User(e);return n.reEmitter.reEmit(t,[qs.UserEvent.AvatarUrl,qs.UserEvent.DisplayName,qs.UserEvent.Presence,qs.UserEvent.CurrentlyActive,qs.UserEvent.LastPresenceTs]),t}var eu={},ek=G.exports;Object.defineProperty(eu,"__esModule",{value:!0});eu.StubStore=void 0;var wg=ek(Y.exports);class tk{constructor(){(0,wg.default)(this,"accountData",{}),(0,wg.default)(this,"fromToken",null)}isNewlyCreated(){return Promise.resolve(!0)}getSyncToken(){return this.fromToken}setSyncToken(e){this.fromToken=e}storeGroup(e){}getGroup(e){return null}getGroups(){return[]}storeRoom(e){}getRoom(e){return null}getRooms(){return[]}removeRoom(e){}getRoomSummaries(){return[]}storeUser(e){}getUser(e){return null}getUsers(){return[]}scrollback(e,t){return[]}storeEvents(e,t,r,i){}storeFilter(e){}getFilter(e,t){return null}getFilterIdByName(e){return null}setFilterIdByName(e,t){}storeAccountDataEvents(e){}getAccountData(e){}setSyncData(e){return Promise.resolve()}wantsSave(){return!1}save(){}startup(){return Promise.resolve()}getSavedSync(){return Promise.resolve(null)}getSavedSyncToken(){return Promise.resolve(null)}deleteAllData(){return Promise.resolve()}getOutOfBandMembers(){return Promise.resolve(null)}setOutOfBandMembers(e,t){return Promise.resolve()}clearOutOfBandMembers(){return Promise.resolve()}getClientOptions(){return Promise.resolve({})}storeClientOptions(e){return Promise.resolve()}}eu.StubStore=tk;var Ce={},ai={};Object.defineProperty(ai,"__esModule",{value:!0});ai.randomLowercaseString=ik;ai.randomString=nk;ai.randomUppercaseString=sk;const Wv="abcdefghijklmnopqrstuvwxyz",Hv="ABCDEFGHIJKLMNOPQRSTUVWXYZ",rk="0123456789";function nk(n){return Sf(n,Hv+Wv+rk)}function ik(n){return Sf(n,Wv)}function sk(n){return Sf(n,Hv)}function Sf(n,e){let t="";for(let r=0;r<n;++r)t+=e.charAt(Math.floor(Math.random()*e.length));return t}var ys={};Object.defineProperty(ys,"__esModule",{value:!0});ys.SDPStreamMetadataPurpose=ys.SDPStreamMetadataKey=void 0;const ok="org.matrix.msc3077.sdp_stream_metadata";ys.SDPStreamMetadataKey=ok;let kh;ys.SDPStreamMetadataPurpose=kh;(function(n){n.Usermedia="m.usermedia",n.Screenshare="m.screenshare"})(kh||(ys.SDPStreamMetadataPurpose=kh={}));var Qn={},ak=G.exports;Object.defineProperty(Qn,"__esModule",{value:!0});Qn.SPEAKING_THRESHOLD=Qn.CallFeedEvent=Qn.CallFeed=void 0;var ft=ak(Y.exports),ck=je;const lk=200,Yv=-60;Qn.SPEAKING_THRESHOLD=Yv;const uk=8;let gn;Qn.CallFeedEvent=gn;(function(n){n.NewStream="new_stream",n.MuteStateChanged="mute_state_changed",n.VolumeChanged="volume_changed",n.Speaking="speaking"})(gn||(Qn.CallFeedEvent=gn={}));class dk extends ck.TypedEventEmitter{constructor(e){super();(0,ft.default)(this,"stream",void 0),(0,ft.default)(this,"userId",void 0),(0,ft.default)(this,"purpose",void 0),(0,ft.default)(this,"speakingVolumeSamples",void 0),(0,ft.default)(this,"client",void 0),(0,ft.default)(this,"roomId",void 0),(0,ft.default)(this,"audioMuted",void 0),(0,ft.default)(this,"videoMuted",void 0),(0,ft.default)(this,"measuringVolumeActivity",!1),(0,ft.default)(this,"audioContext",void 0),(0,ft.default)(this,"analyser",void 0),(0,ft.default)(this,"frequencyBinCount",void 0),(0,ft.default)(this,"speakingThreshold",Yv),(0,ft.default)(this,"speaking",!1),(0,ft.default)(this,"volumeLooperTimeout",void 0),(0,ft.default)(this,"onAddTrack",()=>{this.emit(gn.NewStream,this.stream)}),(0,ft.default)(this,"volumeLooper",()=>{if(!this.analyser||!this.measuringVolumeActivity)return;this.analyser.getFloatFrequencyData(this.frequencyBinCount);let t=-1/0;for(let i=0;i<this.frequencyBinCount.length;i++)this.frequencyBinCount[i]>t&&(t=this.frequencyBinCount[i]);this.speakingVolumeSamples.shift(),this.speakingVolumeSamples.push(t),this.emit(gn.VolumeChanged,t);let r=!1;for(let i=0;i<this.speakingVolumeSamples.length;i++)if(this.speakingVolumeSamples[i]>this.speakingThreshold){r=!0;break}this.speaking!==r&&(this.speaking=r,this.emit(gn.Speaking,this.speaking)),this.volumeLooperTimeout=setTimeout(this.volumeLooper,lk)}),this.client=e.client,this.roomId=e.roomId,this.userId=e.userId,this.purpose=e.purpose,this.audioMuted=e.audioMuted,this.videoMuted=e.videoMuted,this.speakingVolumeSamples=new Array(uk).fill(-1/0),this.updateStream(null,e.stream),this.hasAudioTrack&&this.initVolumeMeasuring()}get hasAudioTrack(){return this.stream.getAudioTracks().length>0}updateStream(e,t){t!==e&&(e&&(e.removeEventListener("addtrack",this.onAddTrack),this.measureVolumeActivity(!1)),t&&(this.stream=t,t.addEventListener("addtrack",this.onAddTrack),this.hasAudioTrack?this.initVolumeMeasuring():this.measureVolumeActivity(!1)),this.emit(gn.NewStream,this.stream))}initVolumeMeasuring(){const e=window.AudioContext||window.webkitAudioContext;if(!this.hasAudioTrack||!e)return;this.audioContext=new e,this.analyser=this.audioContext.createAnalyser(),this.analyser.fftSize=512,this.analyser.smoothingTimeConstant=.1,this.audioContext.createMediaStreamSource(this.stream).connect(this.analyser),this.frequencyBinCount=new Float32Array(this.analyser.frequencyBinCount)}getMember(){return this.client.getRoom(this.roomId).getMember(this.userId)}isLocal(){return this.userId===this.client.getUserId()}isAudioMuted(){return this.stream.getAudioTracks().length===0||this.audioMuted}isVideoMuted(){return this.stream.getVideoTracks().length===0||this.videoMuted}isSpeaking(){return this.speaking}setNewStream(e){this.updateStream(this.stream,e)}setAudioMuted(e){this.audioMuted=e,this.speakingVolumeSamples.fill(-1/0),this.emit(gn.MuteStateChanged,this.audioMuted,this.videoMuted)}setVideoMuted(e){this.videoMuted=e,this.emit(gn.MuteStateChanged,this.audioMuted,this.videoMuted)}measureVolumeActivity(e){if(e){if(!this.audioContext||!this.analyser||!this.frequencyBinCount||!this.hasAudioTrack)return;this.measuringVolumeActivity=!0,this.volumeLooper()}else this.measuringVolumeActivity=!1,this.speakingVolumeSamples.fill(-1/0),this.emit(gn.VolumeChanged,-1/0)}setSpeakingThreshold(e){this.speakingThreshold=e}dispose(){clearTimeout(this.volumeLooperTimeout)}}Qn.CallFeed=dk;var hk=G.exports;Object.defineProperty(Ce,"__esModule",{value:!0});Ce.MatrixCall=Ce.CallType=Ce.CallState=Ce.CallParty=Ce.CallEvent=Ce.CallErrorCode=Ce.CallError=Ce.CallDirection=void 0;Ce.createNewMatrixCall=yk;var re=hk(Y.exports),F=se,td=pk(W),Or=ie,fk=ai,He=ys,ra=Qn,Rg=je;function zv(n){if(typeof WeakMap!="function")return null;var e=new WeakMap,t=new WeakMap;return(zv=function(r){return r?t:e})(n)}function pk(n,e){if(!e&&n&&n.__esModule)return n;if(n===null||typeof n!="object"&&typeof n!="function")return{default:n};var t=zv(e);if(t&&t.has(n))return t.get(n);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in n)if(s!=="default"&&Object.prototype.hasOwnProperty.call(n,s)){var o=i?Object.getOwnPropertyDescriptor(n,s):null;o&&(o.get||o.set)?Object.defineProperty(r,s,o):r[s]=n[s]}return r.default=n,t&&t.set(n,r),r}let he;Ce.CallState=he;(function(n){n.Fledgling="fledgling",n.InviteSent="invite_sent",n.WaitLocalMedia="wait_local_media",n.CreateOffer="create_offer",n.CreateAnswer="create_answer",n.Connecting="connecting",n.Connected="connected",n.Ringing="ringing",n.Ended="ended"})(he||(Ce.CallState=he={}));let Ga;Ce.CallType=Ga;(function(n){n.Voice="voice",n.Video="video"})(Ga||(Ce.CallType=Ga={}));let Gn;Ce.CallDirection=Gn;(function(n){n.Inbound="inbound",n.Outbound="outbound"})(Gn||(Ce.CallDirection=Gn={}));let ze;Ce.CallParty=ze;(function(n){n.Local="local",n.Remote="remote"})(ze||(Ce.CallParty=ze={}));let Ae;Ce.CallEvent=Ae;(function(n){n.Hangup="hangup",n.State="state",n.Error="error",n.Replaced="replaced",n.LocalHoldUnhold="local_hold_unhold",n.RemoteHoldUnhold="remote_hold_unhold",n.HoldUnhold="hold_unhold",n.FeedsChanged="feeds_changed",n.AssertedIdentityChanged="asserted_identity_changed",n.LengthChanged="length_changed",n.DataChannel="datachannel"})(Ae||(Ce.CallEvent=Ae={}));let ge;Ce.CallErrorCode=ge;(function(n){n.UserHangup="user_hangup",n.LocalOfferFailed="local_offer_failed",n.NoUserMedia="no_user_media",n.UnknownDevices="unknown_devices",n.SendInvite="send_invite",n.CreateAnswer="create_answer",n.SendAnswer="send_answer",n.SetRemoteDescription="set_remote_description",n.SetLocalDescription="set_local_description",n.AnsweredElsewhere="answered_elsewhere",n.IceFailed="ice_failed",n.InviteTimeout="invite_timeout",n.Replaced="replaced",n.SignallingFailed="signalling_timeout",n.UserBusy="user_busy",n.Transfered="transferred"})(ge||(Ce.CallErrorCode=ge={}));const gk=1,mk="stun:turn.matrix.org",Ig=6e4;class Xi extends Error{constructor(e,t,r){super(t+": "+r);(0,re.default)(this,"code",void 0),this.code=e}}Ce.CallError=Xi;function Vs(){return Date.now().toString()+(0,fk.randomString)(16)}class Jv extends Rg.TypedEventEmitter{constructor(e){super();(0,re.default)(this,"roomId",void 0),(0,re.default)(this,"callId",void 0),(0,re.default)(this,"state",he.Fledgling),(0,re.default)(this,"hangupParty",void 0),(0,re.default)(this,"hangupReason",void 0),(0,re.default)(this,"direction",void 0),(0,re.default)(this,"ourPartyId",void 0),(0,re.default)(this,"client",void 0),(0,re.default)(this,"forceTURN",void 0),(0,re.default)(this,"turnServers",void 0),(0,re.default)(this,"candidateSendQueue",[]),(0,re.default)(this,"candidateSendTries",0),(0,re.default)(this,"sentEndOfCandidates",!1),(0,re.default)(this,"peerConn",void 0),(0,re.default)(this,"feeds",[]),(0,re.default)(this,"usermediaSenders",[]),(0,re.default)(this,"screensharingSenders",[]),(0,re.default)(this,"inviteOrAnswerSent",!1),(0,re.default)(this,"waitForLocalAVStream",void 0),(0,re.default)(this,"successor",void 0),(0,re.default)(this,"opponentMember",void 0),(0,re.default)(this,"opponentVersion",void 0),(0,re.default)(this,"opponentPartyId",void 0),(0,re.default)(this,"opponentCaps",void 0),(0,re.default)(this,"inviteTimeout",void 0),(0,re.default)(this,"remoteOnHold",!1),(0,re.default)(this,"callStatsAtEnd",void 0),(0,re.default)(this,"makingOffer",!1),(0,re.default)(this,"ignoreOffer",void 0),(0,re.default)(this,"remoteCandidateBuffer",new Map),(0,re.default)(this,"remoteAssertedIdentity",void 0),(0,re.default)(this,"remoteSDPStreamMetadata",void 0),(0,re.default)(this,"callLengthInterval",void 0),(0,re.default)(this,"callLength",0),(0,re.default)(this,"gotLocalIceCandidate",t=>{if(t.candidate){if(F.logger.debug("Call "+this.callId+" got local ICE "+t.candidate.sdpMid+" candidate: "+t.candidate.candidate),this.callHasEnded())return;(t.candidate.candidate!==""||!this.sentEndOfCandidates)&&(this.queueCandidate(t.candidate),t.candidate.candidate===""&&(this.sentEndOfCandidates=!0))}}),(0,re.default)(this,"onIceGatheringStateChange",t=>{if(F.logger.debug("ice gathering state changed to "+this.peerConn.iceGatheringState),this.peerConn.iceGatheringState==="complete"&&!this.sentEndOfCandidates){const r={candidate:""};this.queueCandidate(r),this.sentEndOfCandidates=!0}}),(0,re.default)(this,"gotLocalOffer",async t=>{if(F.logger.debug("Created offer: ",t),this.callHasEnded()){F.logger.debug("Ignoring newly created offer on call ID "+this.callId+" because the call has ended");return}try{await this.peerConn.setLocalDescription(t)}catch(s){F.logger.debug("Error setting local description!",s),this.terminate(ze.Local,ge.SetLocalDescription,!0);return}if(this.peerConn.iceGatheringState==="gathering"&&await new Promise(s=>{setTimeout(s,200)}),this.callHasEnded())return;const r=this.state===he.CreateOffer?Or.EventType.CallInvite:Or.EventType.CallNegotiate,i={lifetime:Ig};this.state===he.CreateOffer?i.offer=this.peerConn.localDescription:i.description=this.peerConn.localDescription,i.capabilities={"m.call.transferee":this.client.supportsCallTransfer,"m.call.dtmf":!1},i[He.SDPStreamMetadataKey]=this.getLocalSDPStreamMetadata(),F.logger.info(`Discarding ${this.candidateSendQueue.length} candidates that will be sent in offer`),this.candidateSendQueue=[];try{await this.sendVoipEvent(r,i)}catch(s){F.logger.error("Failed to send invite",s),s.event&&this.client.cancelPendingEvent(s.event);let o=ge.SignallingFailed,a="Signalling failed";this.state===he.CreateOffer&&(o=ge.SendInvite,a="Failed to send invite"),s.name=="UnknownDeviceError"&&(o=ge.UnknownDevices,a="Unknown devices present in the room"),this.emit(Ae.Error,new Xi(o,a,s)),this.terminate(ze.Local,o,!1);return}this.sendCandidateQueue(),this.state===he.CreateOffer&&(this.inviteOrAnswerSent=!0,this.setState(he.InviteSent),this.inviteTimeout=setTimeout(()=>{this.inviteTimeout=null,this.state===he.InviteSent&&this.hangup(ge.InviteTimeout,!1)},Ig))}),(0,re.default)(this,"getLocalOfferFailed",t=>{F.logger.error("Failed to get local offer",t),this.emit(Ae.Error,new Xi(ge.LocalOfferFailed,"Failed to get local offer!",t)),this.terminate(ze.Local,ge.LocalOfferFailed,!1)}),(0,re.default)(this,"getUserMediaFailed",t=>{if(this.successor){this.successor.getUserMediaFailed(t);return}F.logger.warn("Failed to get user media - ending call",t),this.emit(Ae.Error,new Xi(ge.NoUserMedia,"Couldn't start capturing media! Is your microphone set up and does this app have permission?",t)),this.terminate(ze.Local,ge.NoUserMedia,!1)}),(0,re.default)(this,"onIceConnectionStateChanged",()=>{this.callHasEnded()||(F.logger.debug("Call ID "+this.callId+": ICE connection state changed to: "+this.peerConn.iceConnectionState),this.peerConn.iceConnectionState=="connected"?(this.setState(he.Connected),this.callLengthInterval||(this.callLengthInterval=setInterval(()=>{this.callLength++,this.emit(Ae.LengthChanged,this.callLength)},1e3))):this.peerConn.iceConnectionState=="failed"&&this.hangup(ge.IceFailed,!1))}),(0,re.default)(this,"onSignallingStateChanged",()=>{F.logger.debug("call "+this.callId+": Signalling state changed to: "+this.peerConn.signalingState)}),(0,re.default)(this,"onTrack",t=>{if(t.streams.length===0){F.logger.warn(`Streamless ${t.track.kind} found: ignoring.`);return}const r=t.streams[0];this.pushRemoteFeed(r),r.addEventListener("removetrack",()=>{r.getTracks().length===0&&(F.logger.info(`Stream ID ${r.id} has no tracks remaining - removing`),this.deleteFeedByStream(r))})}),(0,re.default)(this,"onDataChannel",t=>{this.emit(Ae.DataChannel,t.channel)}),(0,re.default)(this,"onNegotiationNeeded",async()=>{if(F.logger.info("Negotiation is needed!"),this.state!==he.CreateOffer&&this.opponentVersion===0){F.logger.info("Opponent does not support renegotiation: ignoring negotiationneeded event");return}this.makingOffer=!0;try{this.getRidOfRTXCodecs();const t=await this.peerConn.createOffer();await this.gotLocalOffer(t)}catch(t){this.getLocalOfferFailed(t);return}finally{this.makingOffer=!1}}),(0,re.default)(this,"onHangupReceived",t=>{F.logger.debug("Hangup received for call ID "+this.callId),this.partyIdMatches(t)||this.state===he.Ringing?this.terminate(ze.Remote,t.reason||ge.UserHangup,!0):F.logger.info(`Ignoring message from party ID ${t.party_id}: our partner is ${this.opponentPartyId}`)}),(0,re.default)(this,"onRejectReceived",t=>{F.logger.debug("Reject received for call ID "+this.callId),[he.InviteSent,he.Ringing].includes(this.state)||this.state===he.Fledgling&&this.direction===Gn.Inbound?this.terminate(ze.Remote,t.reason||ge.UserHangup,!0):F.logger.debug(`Call is in state: ${this.state}: ignoring reject`)}),(0,re.default)(this,"onAnsweredElsewhere",t=>{F.logger.debug("Call ID "+this.callId+" answered elsewhere"),this.terminate(ze.Remote,ge.AnsweredElsewhere,!0)}),this.roomId=e.roomId,this.client=e.client,this.forceTURN=e.forceTURN,this.ourPartyId=this.client.deviceId,this.turnServers=e.turnServers||[],this.turnServers.length===0&&this.client.isFallbackICEServerAllowed()&&this.turnServers.push({urls:[mk]});for(const t of this.turnServers)td.checkObjectHasKeys(t,["urls"]);this.callId=Vs()}async placeVoiceCall(){await this.placeCall(!0,!1)}async placeVideoCall(){await this.placeCall(!0,!0)}createDataChannel(e,t){const r=this.peerConn.createDataChannel(e,t);return this.emit(Ae.DataChannel,r),F.logger.debug("created data channel"),r}getOpponentMember(){return this.opponentMember}opponentCanBeTransferred(){return Boolean(this.opponentCaps&&this.opponentCaps["m.call.transferee"])}opponentSupportsDTMF(){return Boolean(this.opponentCaps&&this.opponentCaps["m.call.dtmf"])}getRemoteAssertedIdentity(){return this.remoteAssertedIdentity}get type(){return this.hasLocalUserMediaVideoTrack||this.hasRemoteUserMediaVideoTrack?Ga.Video:Ga.Voice}get hasLocalUserMediaVideoTrack(){var e;return((e=this.localUsermediaStream)===null||e===void 0?void 0:e.getVideoTracks().length)>0}get hasRemoteUserMediaVideoTrack(){return this.getRemoteFeeds().some(e=>e.purpose===He.SDPStreamMetadataPurpose.Usermedia&&e.stream.getVideoTracks().length>0)}get hasLocalUserMediaAudioTrack(){var e;return((e=this.localUsermediaStream)===null||e===void 0?void 0:e.getAudioTracks().length)>0}get hasRemoteUserMediaAudioTrack(){return this.getRemoteFeeds().some(e=>e.purpose===He.SDPStreamMetadataPurpose.Usermedia&&e.stream.getAudioTracks().length>0)}get localUsermediaFeed(){return this.getLocalFeeds().find(e=>e.purpose===He.SDPStreamMetadataPurpose.Usermedia)}get localScreensharingFeed(){return this.getLocalFeeds().find(e=>e.purpose===He.SDPStreamMetadataPurpose.Screenshare)}get localUsermediaStream(){var e;return(e=this.localUsermediaFeed)===null||e===void 0?void 0:e.stream}get localScreensharingStream(){var e;return(e=this.localScreensharingFeed)===null||e===void 0?void 0:e.stream}get remoteUsermediaFeed(){return this.getRemoteFeeds().find(e=>e.purpose===He.SDPStreamMetadataPurpose.Usermedia)}get remoteScreensharingFeed(){return this.getRemoteFeeds().find(e=>e.purpose===He.SDPStreamMetadataPurpose.Screenshare)}get remoteUsermediaStream(){var e;return(e=this.remoteUsermediaFeed)===null||e===void 0?void 0:e.stream}get remoteScreensharingStream(){var e;return(e=this.remoteScreensharingFeed)===null||e===void 0?void 0:e.stream}getFeedByStreamId(e){return this.getFeeds().find(t=>t.stream.id===e)}getFeeds(){return this.feeds}getLocalFeeds(){return this.feeds.filter(e=>e.isLocal())}getRemoteFeeds(){return this.feeds.filter(e=>!e.isLocal())}getLocalSDPStreamMetadata(){const e={};for(const t of this.getLocalFeeds())e[t.stream.id]={purpose:t.purpose,audio_muted:t.isAudioMuted(),video_muted:t.isVideoMuted()};return F.logger.debug("Got local SDPStreamMetadata",e),e}noIncomingFeeds(){return!this.feeds.some(e=>!e.isLocal())}pushRemoteFeed(e){if(!this.opponentSupportsSDPStreamMetadata()){this.pushRemoteFeedWithoutMetadata(e);return}const t=this.getOpponentMember().userId,r=this.remoteSDPStreamMetadata[e.id].purpose,i=this.remoteSDPStreamMetadata[e.id].audio_muted,s=this.remoteSDPStreamMetadata[e.id].video_muted;if(!r){F.logger.warn(`Ignoring stream with id ${e.id} because we didn't get any metadata about it`);return}const o=this.getRemoteFeeds().find(a=>a.purpose===r);o?o.setNewStream(e):(this.feeds.push(new ra.CallFeed({client:this.client,roomId:this.roomId,userId:t,stream:e,purpose:r,audioMuted:i,videoMuted:s})),this.emit(Ae.FeedsChanged,this.feeds)),F.logger.info(`Pushed remote stream (id="${e.id}", active="${e.active}", purpose=${r})`)}pushRemoteFeedWithoutMetadata(e){var t;const r=this.getOpponentMember().userId,i=He.SDPStreamMetadataPurpose.Usermedia,s=(t=this.feeds.find(a=>!a.isLocal()))===null||t===void 0?void 0:t.stream;if(s&&e.id!==s.id){F.logger.warn(`Ignoring new stream ID ${e.id}: we already have stream ID ${s.id}`);return}const o=this.getFeedByStreamId(e.id);o?o.setNewStream(e):(this.feeds.push(new ra.CallFeed({client:this.client,roomId:this.roomId,audioMuted:!1,videoMuted:!1,userId:r,stream:e,purpose:i})),this.emit(Ae.FeedsChanged,this.feeds)),F.logger.info(`Pushed remote stream (id="${e.id}", active="${e.active}")`)}pushNewLocalFeed(e,t,r=!0){const i=this.client.getUserId();bi(e.getAudioTracks(),!0),bi(e.getVideoTracks(),!0);const s=this.getLocalFeeds().find(o=>o.purpose===t);s?s.setNewStream(e):(this.pushLocalFeed(new ra.CallFeed({client:this.client,roomId:this.roomId,audioMuted:!1,videoMuted:!1,userId:i,stream:e,purpose:t}),r),this.emit(Ae.FeedsChanged,this.feeds))}pushLocalFeed(e,t=!0){if(this.feeds.push(e),t){const r=e.purpose===He.SDPStreamMetadataPurpose.Usermedia?this.usermediaSenders:this.screensharingSenders;r.splice(0,r.length);for(const i of e.stream.getTracks())F.logger.info(`Adding track (id="${i.id}", kind="${i.kind}", streamId="${e.stream.id}", streamPurpose="${e.purpose}", enabled=${i.enabled}) to peer connection`),r.push(this.peerConn.addTrack(i,e.stream))}F.logger.info(`Pushed local stream (id="${e.stream.id}", active="${e.stream.active}", purpose="${e.purpose}")`),this.emit(Ae.FeedsChanged,this.feeds)}removeLocalFeed(e){const t=e.purpose===He.SDPStreamMetadataPurpose.Usermedia?this.usermediaSenders:this.screensharingSenders;for(const r of t)this.peerConn.removeTrack(r);t.splice(0,t.length),this.deleteFeedByStream(e.stream)}deleteAllFeeds(){for(const e of this.feeds)e.dispose();this.feeds=[],this.emit(Ae.FeedsChanged,this.feeds)}deleteFeedByStream(e){F.logger.debug(`Removing feed with stream id ${e.id}`);const t=this.getFeedByStreamId(e.id);if(!t){F.logger.warn(`Didn't find the feed with stream id ${e.id} to delete`);return}t.dispose(),this.feeds.splice(this.feeds.indexOf(t),1),this.emit(Ae.FeedsChanged,this.feeds)}async getCurrentCallStats(){return this.callHasEnded()?this.callStatsAtEnd:this.collectCallStats()}async collectCallStats(){if(!this.peerConn)return;const e=await this.peerConn.getStats(),t=[];for(const r of e)t.push(r[1]);return t}async initWithInvite(e){var t;const r=e.getContent();this.direction=Gn.Inbound,await this.client.checkTurnServers()||F.logger.warn("Failed to get TURN credentials! Proceeding with call anyway...");const s=r[He.SDPStreamMetadataKey];s?this.updateRemoteSDPStreamMetadata(s):F.logger.debug("Did not get any SDPStreamMetadata! Can not send/receive multiple streams"),this.peerConn=this.createPeerConnection(),this.chooseOpponent(e);try{await this.peerConn.setRemoteDescription(r.offer),await this.addBufferedIceCandidates()}catch(a){F.logger.debug("Failed to set remote description",a),this.terminate(ze.Local,ge.SetRemoteDescription,!1);return}const o=(t=this.feeds.find(a=>!a.isLocal()))===null||t===void 0?void 0:t.stream;if(!o||o.getTracks().length===0){F.logger.error("No remote stream or no tracks after setting remote description!"),this.terminate(ze.Local,ge.SetRemoteDescription,!1);return}this.setState(he.Ringing),e.getLocalAge()&&setTimeout(()=>{this.state==he.Ringing&&(F.logger.debug("Call invite has expired. Hanging up."),this.hangupParty=ze.Remote,this.setState(he.Ended),this.stopAllMedia(),this.peerConn.signalingState!="closed"&&this.peerConn.close(),this.emit(Ae.Hangup))},r.lifetime-e.getLocalAge())}initWithHangup(e){this.setState(he.Ended)}shouldAnswerWithMediaType(e,t,r){return e&&!t?(F.logger.warn(`Unable to answer with ${r} because the other side isn't sending it either.`),!1):!td.isNullOrUndefined(e)&&e!==t&&!this.opponentSupportsSDPStreamMetadata()?(F.logger.warn(`Unable to answer with ${r}=${e} because the other side doesn't support it. Answering with ${r}=${t}.`),t):e!=null?e:t}async answer(e,t){if(!this.inviteOrAnswerSent){if(e===!1&&t===!1)throw new Error("You CANNOT answer a call without media");if(F.logger.debug(`Answering call ${this.callId}`),!this.localUsermediaStream&&!this.waitForLocalAVStream){const r=this.state,i=this.shouldAnswerWithMediaType(e,this.hasRemoteUserMediaAudioTrack,"audio"),s=this.shouldAnswerWithMediaType(t,this.hasRemoteUserMediaVideoTrack,"video");this.setState(he.WaitLocalMedia),this.waitForLocalAVStream=!0;try{const o=await this.client.getMediaHandler().getUserMediaStream(i,s);this.waitForLocalAVStream=!1;const l=[new ra.CallFeed({client:this.client,roomId:this.roomId,userId:this.client.getUserId(),stream:o,purpose:He.SDPStreamMetadataPurpose.Usermedia,audioMuted:!1,videoMuted:!1})];this.localScreensharingFeed&&l.push(this.localScreensharingFeed),this.answerWithCallFeeds(l)}catch(o){if(s)F.logger.warn("Failed to getUserMedia(), trying to getUserMedia() without video"),this.setState(r),this.waitForLocalAVStream=!1,await this.answer(i,!1);else{this.getUserMediaFailed(o);return}}}else this.waitForLocalAVStream&&this.setState(he.WaitLocalMedia)}}answerWithCallFeeds(e){this.inviteOrAnswerSent||(F.logger.debug(`Answering call ${this.callId}`),this.gotCallFeedsForAnswer(e))}replacedBy(e){this.state===he.WaitLocalMedia?(F.logger.debug("Telling new call to wait for local media"),e.waitForLocalAVStream=!0):[he.CreateOffer,he.InviteSent].includes(this.state)&&(F.logger.debug("Handing local stream to new call"),e.gotCallFeedsForAnswer(this.getLocalFeeds())),this.successor=e,this.emit(Ae.Replaced,e),this.hangup(ge.Replaced,!0)}hangup(e,t){if(this.callHasEnded()||(F.logger.debug("Ending call "+this.callId),this.terminate(ze.Local,e,!t),this.state===he.WaitLocalMedia))return;const r={};(this.opponentVersion&&this.opponentVersion>=1||e!==ge.UserHangup)&&(r.reason=e),this.sendVoipEvent(Or.EventType.CallHangup,r)}reject(){if(this.state!==he.Ringing)throw Error("Call must be in 'ringing' state to reject!");if(this.opponentVersion<1){F.logger.info(`Opponent version is less than 1 (${this.opponentVersion}): sending hangup instead of reject`),this.hangup(ge.UserHangup,!0);return}F.logger.debug("Rejecting call: "+this.callId),this.terminate(ze.Local,ge.UserHangup,!0),this.sendVoipEvent(Or.EventType.CallReject,{})}async upgradeCall(e,t){if(!(!e&&!t)&&!!this.opponentSupportsSDPStreamMetadata())try{const r=e||this.hasLocalUserMediaAudioTrack,i=t||this.hasLocalUserMediaVideoTrack,s=await this.client.getMediaHandler().getUserMediaStream(r,i,!1);await this.updateLocalUsermediaStream(s,e,t)}catch(r){F.logger.error("Failed to upgrade the call",r),this.emit(Ae.Error,new Xi(ge.NoUserMedia,"Failed to get camera access: ",r))}}opponentSupportsSDPStreamMetadata(){return Boolean(this.remoteSDPStreamMetadata)}isScreensharing(){return Boolean(this.localScreensharingStream)}async setScreensharingEnabled(e,t){if(e&&this.isScreensharing())return F.logger.warn("There is already a screensharing stream - there is nothing to do!"),!0;if(!e&&!this.isScreensharing())return F.logger.warn("There already isn't a screensharing stream - there is nothing to do!"),!1;if(!this.opponentSupportsSDPStreamMetadata())return await this.setScreensharingEnabledWithoutMetadataSupport(e,t);if(F.logger.debug(`Set screensharing enabled? ${e}`),e)try{const r=await this.client.getMediaHandler().getScreensharingStream(t);return r?(this.pushNewLocalFeed(r,He.SDPStreamMetadataPurpose.Screenshare),!0):!1}catch(r){return F.logger.error("Failed to get screen-sharing stream:",r),!1}else{for(const r of this.screensharingSenders)this.peerConn.removeTrack(r);return this.client.getMediaHandler().stopScreensharingStream(this.localScreensharingStream),this.deleteFeedByStream(this.localScreensharingStream),!1}}async setScreensharingEnabledWithoutMetadataSupport(e,t){if(F.logger.debug(`Set screensharing enabled? ${e} using replaceTrack()`),e)try{const r=await this.client.getMediaHandler().getScreensharingStream(t);if(!r)return!1;const i=r.getTracks().find(o=>o.kind==="video");return this.usermediaSenders.find(o=>{var a;return((a=o.track)===null||a===void 0?void 0:a.kind)==="video"}).replaceTrack(i),this.pushNewLocalFeed(r,He.SDPStreamMetadataPurpose.Screenshare,!1),!0}catch(r){return F.logger.error("Failed to get screen-sharing stream:",r),!1}else{const r=this.localUsermediaStream.getTracks().find(s=>s.kind==="video");return this.usermediaSenders.find(s=>{var o;return((o=s.track)===null||o===void 0?void 0:o.kind)==="video"}).replaceTrack(r),this.client.getMediaHandler().stopScreensharingStream(this.localScreensharingStream),this.deleteFeedByStream(this.localScreensharingStream),!1}}async updateLocalUsermediaStream(e,t=!1,r=!1){const i=this.localUsermediaFeed,s=t||!i.isAudioMuted()&&!this.remoteOnHold,o=r||!i.isVideoMuted()&&!this.remoteOnHold;bi(e.getAudioTracks(),s),bi(e.getVideoTracks(),o);for(const l of this.localUsermediaStream.getTracks())this.localUsermediaStream.removeTrack(l),l.stop();for(const l of e.getTracks())this.localUsermediaStream.addTrack(l);const a=[];for(const l of e.getTracks()){const u=this.usermediaSenders.find(g=>{var m;return((m=g.track)===null||m===void 0?void 0:m.kind)===l.kind});let c;u?(F.logger.info(`Replacing track (id="${l.id}", kind="${l.kind}", streamId="${e.id}", streamPurpose="${i.purpose}") to peer connection`),await u.replaceTrack(l),c=u):(F.logger.info(`Adding track (id="${l.id}", kind="${l.kind}", streamId="${e.id}", streamPurpose="${i.purpose}") to peer connection`),c=this.peerConn.addTrack(l,this.localUsermediaStream)),a.push(c)}this.usermediaSenders=a}async setLocalVideoMuted(e){var t;return await this.client.getMediaHandler().hasVideoDevice()?!this.hasLocalUserMediaVideoTrack&&!e?(await this.upgradeCall(!1,!0),this.isLocalVideoMuted()):((t=this.localUsermediaFeed)===null||t===void 0||t.setVideoMuted(e),this.updateMuteStatus(),this.isLocalVideoMuted()):this.isLocalVideoMuted()}isLocalVideoMuted(){var e;return(e=this.localUsermediaFeed)===null||e===void 0?void 0:e.isVideoMuted()}async setMicrophoneMuted(e){var t;return await this.client.getMediaHandler().hasAudioDevice()?!this.hasLocalUserMediaAudioTrack&&!e?(await this.upgradeCall(!0,!1),this.isMicrophoneMuted()):((t=this.localUsermediaFeed)===null||t===void 0||t.setAudioMuted(e),this.updateMuteStatus(),this.isMicrophoneMuted()):this.isMicrophoneMuted()}isMicrophoneMuted(){var e;return(e=this.localUsermediaFeed)===null||e===void 0?void 0:e.isAudioMuted()}isRemoteOnHold(){return this.remoteOnHold}setRemoteOnHold(e){if(this.isRemoteOnHold()!==e){this.remoteOnHold=e;for(const t of this.peerConn.getTransceivers())t.direction=e?"sendonly":"sendrecv";this.updateMuteStatus(),this.emit(Ae.RemoteHoldUnhold,this.remoteOnHold)}}isLocalOnHold(){if(this.state!==he.Connected)return!1;let e=!0;for(const t of this.peerConn.getTransceivers())["inactive","recvonly"].includes(t.currentDirection)||(e=!1);return e}sendDtmfDigit(e){for(const t of this.peerConn.getSenders())if(t.track.kind==="audio"&&t.dtmf){t.dtmf.insertDTMF(e);return}throw new Error("Unable to find a track to send DTMF on")}updateMuteStatus(){this.sendVoipEvent(Or.EventType.CallSDPStreamMetadataChangedPrefix,{[He.SDPStreamMetadataKey]:this.getLocalSDPStreamMetadata()});const e=this.isMicrophoneMuted()||this.remoteOnHold,t=this.isLocalVideoMuted()||this.remoteOnHold;bi(this.localUsermediaStream.getAudioTracks(),!e),bi(this.localUsermediaStream.getVideoTracks(),!t)}gotCallFeedsForInvite(e){if(this.successor){this.successor.gotCallFeedsForAnswer(e);return}if(this.callHasEnded()){this.stopAllMedia();return}for(const t of e)this.pushLocalFeed(t);this.setState(he.CreateOffer),F.logger.debug("gotUserMediaForInvite")}async sendAnswer(){const e={answer:{sdp:this.peerConn.localDescription.sdp,type:this.peerConn.localDescription.type},[He.SDPStreamMetadataKey]:this.getLocalSDPStreamMetadata()};e.capabilities={"m.call.transferee":this.client.supportsCallTransfer,"m.call.dtmf":!1},F.logger.info(`Discarding ${this.candidateSendQueue.length} candidates that will be sent in answer`),this.candidateSendQueue=[];try{await this.sendVoipEvent(Or.EventType.CallAnswer,e),this.inviteOrAnswerSent=!0}catch(t){this.setState(he.Ringing),this.client.cancelPendingEvent(t.event);let r=ge.SendAnswer,i="Failed to send answer";throw t.name=="UnknownDeviceError"&&(r=ge.UnknownDevices,i="Unknown devices present in the room"),this.emit(Ae.Error,new Xi(r,i,t)),t}this.sendCandidateQueue()}async gotCallFeedsForAnswer(e){if(this.callHasEnded())return;this.waitForLocalAVStream=!1;for(const r of e)this.pushLocalFeed(r);this.setState(he.CreateAnswer);let t;try{this.getRidOfRTXCodecs(),t=await this.peerConn.createAnswer()}catch(r){F.logger.debug("Failed to create answer: ",r),this.terminate(ze.Local,ge.CreateAnswer,!0);return}try{await this.peerConn.setLocalDescription(t),this.setState(he.Connecting),await new Promise(r=>{setTimeout(r,200)}),this.sendAnswer()}catch(r){F.logger.debug("Error setting local description!",r),this.terminate(ze.Local,ge.SetLocalDescription,!0);return}}async onRemoteIceCandidatesReceived(e){if(this.callHasEnded())return;const t=e.getContent(),r=t.candidates;if(!r){F.logger.info("Ignoring candidates event with no candidates!");return}const i=t.version===0?null:t.party_id||null;if(this.opponentPartyId===void 0){F.logger.info(`Buffering ${r.length} candidates until we pick an opponent`);const s=this.remoteCandidateBuffer.get(i)||[];s.push(...r),this.remoteCandidateBuffer.set(i,s);return}if(!this.partyIdMatches(t)){F.logger.info(`Ignoring candidates from party ID ${t.party_id}: we have chosen party ID ${this.opponentPartyId}`);return}await this.addIceCandidates(r)}async onAnswerReceived(e){const t=e.getContent();if(F.logger.debug(`Got answer for call ID ${this.callId} from party ID ${t.party_id}`),this.callHasEnded()){F.logger.debug(`Ignoring answer because call ID ${this.callId} has ended`);return}if(this.opponentPartyId!==void 0){F.logger.info(`Ignoring answer from party ID ${t.party_id}: we already have an answer/reject from ${this.opponentPartyId}`);return}this.chooseOpponent(e),await this.addBufferedIceCandidates(),this.setState(he.Connecting);const r=t[He.SDPStreamMetadataKey];r?this.updateRemoteSDPStreamMetadata(r):F.logger.warn("Did not get any SDPStreamMetadata! Can not send/receive multiple streams");try{await this.peerConn.setRemoteDescription(t.answer)}catch(i){F.logger.debug("Failed to set remote description",i),this.terminate(ze.Local,ge.SetRemoteDescription,!1);return}if(this.opponentPartyId!==null)try{await this.sendVoipEvent(Or.EventType.CallSelectAnswer,{selected_party_id:this.opponentPartyId})}catch(i){F.logger.warn("Failed to send select_answer event",i)}}async onSelectAnswerReceived(e){if(this.direction!==Gn.Inbound){F.logger.warn("Got select_answer for an outbound call: ignoring");return}const t=e.getContent().selected_party_id;if(t==null){F.logger.warn("Got nonsensical select_answer with null/undefined selected_party_id: ignoring");return}t!==this.ourPartyId&&(F.logger.info(`Got select_answer for party ID ${t}: we are party ID ${this.ourPartyId}.`),this.terminate(ze.Remote,ge.AnsweredElsewhere,!0))}async onNegotiateReceived(e){const t=e.getContent(),r=t.description;if(!r||!r.sdp||!r.type){F.logger.info("Ignoring invalid m.call.negotiate event");return}const i=this.direction===Gn.Inbound,s=r.type==="offer"&&(this.makingOffer||this.peerConn.signalingState!=="stable");if(this.ignoreOffer=!i&&s,this.ignoreOffer){F.logger.info("Ignoring colliding negotiate event because we're impolite");return}const o=this.isLocalOnHold(),a=t[He.SDPStreamMetadataKey];a?this.updateRemoteSDPStreamMetadata(a):F.logger.warn("Received negotiation event without SDPStreamMetadata!");try{if(await this.peerConn.setRemoteDescription(r),r.type==="offer"){this.getRidOfRTXCodecs();const u=await this.peerConn.createAnswer();await this.peerConn.setLocalDescription(u),this.sendVoipEvent(Or.EventType.CallNegotiate,{description:this.peerConn.localDescription,[He.SDPStreamMetadataKey]:this.getLocalSDPStreamMetadata()})}}catch(u){F.logger.warn("Failed to complete negotiation",u)}const l=this.isLocalOnHold();o!==l&&(this.emit(Ae.LocalHoldUnhold,l),this.emit(Ae.HoldUnhold,l))}updateRemoteSDPStreamMetadata(e){this.remoteSDPStreamMetadata=td.recursivelyAssign(this.remoteSDPStreamMetadata||{},e,!0);for(const s of this.getRemoteFeeds()){var t,r,i;const o=s.stream.id;s.setAudioMuted((t=this.remoteSDPStreamMetadata[o])===null||t===void 0?void 0:t.audio_muted),s.setVideoMuted((r=this.remoteSDPStreamMetadata[o])===null||r===void 0?void 0:r.video_muted),s.purpose=(i=this.remoteSDPStreamMetadata[o])===null||i===void 0?void 0:i.purpose}}onSDPStreamMetadataChangedReceived(e){const r=e.getContent()[He.SDPStreamMetadataKey];this.updateRemoteSDPStreamMetadata(r)}async onAssertedIdentityReceived(e){const t=e.getContent();!t.asserted_identity||(this.remoteAssertedIdentity={id:t.asserted_identity.id,displayName:t.asserted_identity.display_name},this.emit(Ae.AssertedIdentityChanged))}callHasEnded(){return this.state===he.Ended}getRidOfRTXCodecs(){if(!RTCRtpReceiver.getCapabilities||!RTCRtpSender.getCapabilities)return;const e=RTCRtpReceiver.getCapabilities("video").codecs,r=[...RTCRtpSender.getCapabilities("video").codecs,...e];for(const o of r)if(o.mimeType==="video/rtx"){const a=r.indexOf(o);r.splice(a,1)}for(const o of this.peerConn.getTransceivers()){var i,s;this.screensharingSenders.includes(o.sender)&&(((i=o.sender.track)===null||i===void 0?void 0:i.kind)==="video"||((s=o.receiver.track)===null||s===void 0?void 0:s.kind)==="video")&&o.setCodecPreferences(r)}}setState(e){const t=this.state;this.state=e,this.emit(Ae.State,e,t)}sendVoipEvent(e,t){return this.client.sendEvent(this.roomId,e,Object.assign({},t,{version:gk,call_id:this.callId,party_id:this.ourPartyId}))}queueCandidate(e){if(this.candidateSendQueue.push(e),this.state===he.Ringing||!this.inviteOrAnswerSent)return;const t=this.direction===Gn.Inbound?500:2e3;this.candidateSendTries===0&&setTimeout(()=>{this.sendCandidateQueue()},t)}async transfer(e){const t=await this.client.getProfileInfo(e),r=Vs(),i={replacement_id:Vs(),target_user:{id:e,display_name:t.displayname,avatar_url:t.avatar_url},create_call:r};await this.sendVoipEvent(Or.EventType.CallReplaces,i),await this.terminate(ze.Local,ge.Transfered,!0)}async transferToCall(e){const t=await this.client.getProfileInfo(e.getOpponentMember().userId),r=await this.client.getProfileInfo(this.getOpponentMember().userId),i=Vs(),s={replacement_id:Vs(),target_user:{id:this.getOpponentMember().userId,display_name:r.displayname,avatar_url:r.avatar_url},await_call:i};await e.sendVoipEvent(Or.EventType.CallReplaces,s);const o={replacement_id:Vs(),target_user:{id:e.getOpponentMember().userId,display_name:t.displayname,avatar_url:t.avatar_url},create_call:i};await this.sendVoipEvent(Or.EventType.CallReplaces,o),await this.terminate(ze.Local,ge.Transfered,!0),await e.terminate(ze.Local,ge.Transfered,!0)}async terminate(e,t,r){this.callHasEnded()||(this.callStatsAtEnd=await this.collectCallStats(),this.inviteTimeout&&(clearTimeout(this.inviteTimeout),this.inviteTimeout=null),this.callLengthInterval&&(clearInterval(this.callLengthInterval),this.callLengthInterval=null),t!==ge.Replaced&&this.stopAllMedia(),this.deleteAllFeeds(),this.hangupParty=e,this.hangupReason=t,this.setState(he.Ended),this.peerConn&&this.peerConn.signalingState!=="closed"&&this.peerConn.close(),r&&this.emit(Ae.Hangup))}stopAllMedia(){F.logger.debug("Stopping all media for call",this.callId);for(const e of this.feeds)if(e.isLocal()&&e.purpose===He.SDPStreamMetadataPurpose.Usermedia)this.client.getMediaHandler().stopUserMediaStream(e.stream);else if(e.isLocal()&&e.purpose===He.SDPStreamMetadataPurpose.Screenshare)this.client.getMediaHandler().stopScreensharingStream(e.stream);else{F.logger.debug("Stopping remote stream",e.stream.id);for(const t of e.stream.getTracks())t.stop()}}checkForErrorListener(){if(this.listeners(Rg.EventEmitterEvents.Error).length===0)throw new Error("You MUST attach an error listener using call.on('error', function() {})")}async sendCandidateQueue(){if(this.candidateSendQueue.length===0)return;const e=this.candidateSendQueue;this.candidateSendQueue=[],++this.candidateSendTries;const t={candidates:e};F.logger.debug("Attempting to send "+e.length+" candidates");try{await this.sendVoipEvent(Or.EventType.CallCandidates,t),this.candidateSendTries=0}catch(r){if(r.event&&this.client.cancelPendingEvent(r.event),this.candidateSendQueue.push(...e),this.candidateSendTries>5){F.logger.debug("Failed to send candidates on attempt "+this.candidateSendTries+". Giving up on this call.",r);const s=ge.SignallingFailed,o="Signalling failed";this.emit(Ae.Error,new Xi(s,o,r)),this.hangup(s,!1);return}const i=500*Math.pow(2,this.candidateSendTries);++this.candidateSendTries,F.logger.debug("Failed to send candidates. Retrying in "+i+"ms",r),setTimeout(()=>{this.sendCandidateQueue()},i)}}async placeCall(e,t){if(!e)throw new Error("You CANNOT start a call without audio");this.setState(he.WaitLocalMedia);try{const r=await this.client.getMediaHandler().getUserMediaStream(e,t);bi(r.getAudioTracks(),!0),bi(r.getVideoTracks(),!0);const i=new ra.CallFeed({client:this.client,roomId:this.roomId,userId:this.client.getUserId(),stream:r,purpose:He.SDPStreamMetadataPurpose.Usermedia,audioMuted:!1,videoMuted:!1});await this.placeCallWithCallFeeds([i])}catch(r){this.getUserMediaFailed(r);return}}async placeCallWithCallFeeds(e){this.checkForErrorListener(),this.direction=Gn.Outbound,this.client.callEventHandler.calls.set(this.callId,this),await this.client.checkTurnServers()||F.logger.warn("Failed to get TURN credentials! Proceeding with call anyway..."),this.peerConn=this.createPeerConnection(),this.gotCallFeedsForInvite(e)}createPeerConnection(){const e=new window.RTCPeerConnection({iceTransportPolicy:this.forceTURN?"relay":void 0,iceServers:this.turnServers,iceCandidatePoolSize:this.client.iceCandidatePoolSize});return e.addEventListener("iceconnectionstatechange",this.onIceConnectionStateChanged),e.addEventListener("signalingstatechange",this.onSignallingStateChanged),e.addEventListener("icecandidate",this.gotLocalIceCandidate),e.addEventListener("icegatheringstatechange",this.onIceGatheringStateChange),e.addEventListener("track",this.onTrack),e.addEventListener("negotiationneeded",this.onNegotiationNeeded),e.addEventListener("datachannel",this.onDataChannel),e}partyIdMatches(e){return(e.version===0?null:e.party_id||null)===this.opponentPartyId}chooseOpponent(e){const t=e.getContent();F.logger.debug(`Choosing party ID ${t.party_id} for call ID ${this.callId}`),this.opponentVersion=t.version,this.opponentVersion===0?this.opponentPartyId=null:this.opponentPartyId=t.party_id||null,this.opponentCaps=t.capabilities||{},this.opponentMember=e.sender}async addBufferedIceCandidates(){const e=this.remoteCandidateBuffer.get(this.opponentPartyId);e&&(F.logger.info(`Adding ${e.length} buffered candidates for opponent ${this.opponentPartyId}`),await this.addIceCandidates(e)),this.remoteCandidateBuffer=null}async addIceCandidates(e){for(const t of e){if((t.sdpMid===null||t.sdpMid===void 0)&&(t.sdpMLineIndex===null||t.sdpMLineIndex===void 0)){F.logger.debug("Ignoring remote ICE candidate with no sdpMid or sdpMLineIndex");continue}F.logger.debug("Call "+this.callId+" got remote ICE "+t.sdpMid+" candidate: "+t.candidate);try{await this.peerConn.addIceCandidate(t)}catch(r){this.ignoreOffer||F.logger.info("Failed to add remote ICE candidate",r)}}}get hasPeerConnection(){return Boolean(this.peerConn)}}Ce.MatrixCall=Jv;function bi(n,e){for(let t=0;t<n.length;t++)n[t].enabled=e}function yk(n,e,t){if(typeof window=="undefined"||typeof document=="undefined")return null;try{if(!Boolean(window.RTCPeerConnection||window.RTCSessionDescription||window.RTCIceCandidate||navigator.mediaDevices))return F.logger.error("WebRTC is not supported in this browser / environment"),null}catch(o){return F.logger.error("Exception thrown when trying to access WebRTC",o),null}const r=t?t.forceTURN:!1,i={client:n,roomId:e,turnServers:n.getTurnServers(),forceTURN:n.forceTURN||r},s=new Jv(i);return n.reEmitter.reEmit(s,Object.values(Ae)),s}var vs={},vk=G.exports;Object.defineProperty(vs,"__esModule",{value:!0});vs.CallEventHandlerEvent=vs.CallEventHandler=void 0;var Gs=vk(Y.exports),_k=jt,wi=se,pr=Ce,Ut=ie,Tg=st,Ek=$i,Og=lr;const Sk=3e3;let Ol;vs.CallEventHandlerEvent=Ol;(function(n){n.Incoming="Call.incoming"})(Ol||(vs.CallEventHandlerEvent=Ol={}));class bk{constructor(e){(0,Gs.default)(this,"client",void 0),(0,Gs.default)(this,"calls",void 0),(0,Gs.default)(this,"callEventBuffer",void 0),(0,Gs.default)(this,"candidateEventsByCall",void 0),(0,Gs.default)(this,"evaluateEventBuffer",async()=>{if(this.client.getSyncState()===Ek.SyncState.Syncing){await Promise.all(this.callEventBuffer.map(r=>{this.client.decryptEventIfNeeded(r)}));const t=new Set;for(const r of this.callEventBuffer)(r.getType()===Ut.EventType.CallAnswer||r.getType()===Ut.EventType.CallHangup)&&t.add(r.getContent().call_id);for(const r of this.callEventBuffer)if(!(r.getType()===Ut.EventType.CallInvite&&t.has(r.getContent().call_id)))try{await this.handleCallEvent(r)}catch(i){wi.logger.error("Caught exception handling call event",i)}this.callEventBuffer=[]}}),(0,Gs.default)(this,"onRoomTimeline",t=>{this.client.decryptEventIfNeeded(t),(this.eventIsACall(t)||t.isBeingDecrypted())&&this.callEventBuffer.push(t),(t.isBeingDecrypted()||t.isDecryptionFailure())&&t.once(_k.MatrixEventEvent.Decrypted,async()=>{if(!!this.eventIsACall(t))if(this.callEventBuffer.includes(t))this.evaluateEventBuffer();else try{await this.handleCallEvent(t)}catch(r){wi.logger.error("Caught exception handling call event",r)}})}),this.client=e,this.calls=new Map,this.callEventBuffer=[],this.candidateEventsByCall=new Map}start(){this.client.on(Tg.ClientEvent.Sync,this.evaluateEventBuffer),this.client.on(Og.RoomEvent.Timeline,this.onRoomTimeline)}stop(){this.client.removeListener(Tg.ClientEvent.Sync,this.evaluateEventBuffer),this.client.removeListener(Og.RoomEvent.Timeline,this.onRoomTimeline)}eventIsACall(e){const t=e.getType();return t.startsWith("m.call.")||t.startsWith("org.matrix.call.")}async handleCallEvent(e){const t=e.getContent(),r=e.getType(),i=e.getSender()===this.client.credentials.userId;let s=t.call_id?this.calls.get(t.call_id):void 0;if(r===Ut.EventType.CallInvite){if(i||e.getLocalAge()>t.lifetime-Sk||s&&s.state===pr.CallState.Ended)return;s&&wi.logger.log(`WARN: Already have a MatrixCall with id ${t.call_id} but got an invite. Clobbering.`);const o=this.client.getTurnServersExpiry()-Date.now();if(wi.logger.info("Current turn creds expire in "+o+" ms"),s=(0,pr.createNewMatrixCall)(this.client,e.getRoomId(),{forceTURN:this.client.forceTURN}),!s){wi.logger.log("Incoming call ID "+t.call_id+" but this client doesn't support WebRTC");return}if(s.callId=t.call_id,await s.initWithInvite(e),this.calls.set(s.callId,s),this.candidateEventsByCall.get(s.callId))for(const l of this.candidateEventsByCall.get(s.callId))s.onRemoteIceCandidatesReceived(l);let a;for(const l of this.calls.values()){const u=[pr.CallState.WaitLocalMedia,pr.CallState.CreateOffer,pr.CallState.InviteSent].includes(l.state);if(s.roomId===l.roomId&&l.direction===pr.CallDirection.Outbound&&u){a=l;break}}a?a.state===pr.CallState.WaitLocalMedia||a.state===pr.CallState.CreateOffer||a.callId>s.callId?(wi.logger.log("Glare detected: answering incoming call "+s.callId+" and canceling outgoing call "+a.callId),a.replacedBy(s),s.answer()):(wi.logger.log("Glare detected: rejecting incoming call "+s.callId+" and keeping outgoing call "+a.callId),s.hangup(pr.CallErrorCode.Replaced,!0)):this.client.emit(Ol.Incoming,s);return}else if(r===Ut.EventType.CallCandidates){if(i)return;s?s.onRemoteIceCandidatesReceived(e):(this.candidateEventsByCall.has(t.call_id)||this.candidateEventsByCall.set(t.call_id,[]),this.candidateEventsByCall.get(t.call_id).push(e));return}else if([Ut.EventType.CallHangup,Ut.EventType.CallReject].includes(r)){s?s.state!==pr.CallState.Ended&&(r===Ut.EventType.CallHangup?s.onHangupReceived(t):s.onRejectReceived(t),s.state===pr.CallState.Ended&&this.calls.delete(t.call_id)):(s=(0,pr.createNewMatrixCall)(this.client,e.getRoomId()),s&&(s.callId=t.call_id,s.initWithHangup(e),this.calls.set(t.call_id,s)));return}if(!s||!s.hasPeerConnection){wi.logger.warn("Discarding an event, we don't have a call/peerConn",r);return}if(e.getContent().party_id!==s.ourPartyId)switch(r){case Ut.EventType.CallAnswer:i?s.state===pr.CallState.Ringing&&s.onAnsweredElsewhere(t):s.onAnswerReceived(e);break;case Ut.EventType.CallSelectAnswer:s.onSelectAnswerReceived(e);break;case Ut.EventType.CallNegotiate:s.onNegotiateReceived(e);break;case Ut.EventType.CallAssertedIdentity:case Ut.EventType.CallAssertedIdentityPrefix:s.onAssertedIdentityReceived(e);break;case Ut.EventType.CallSDPStreamMetadataChanged:case Ut.EventType.CallSDPStreamMetadataChangedPrefix:s.onSDPStreamMetadataChangedReceived(e);break}}}vs.CallEventHandler=bk;var Ni={},wk=G.exports;Object.defineProperty(Ni,"__esModule",{value:!0});Ni.AutoDiscoveryAction=Ni.AutoDiscovery=void 0;var ur=wk(Y.exports),kg=Ci,Un=se;let ar;Ni.AutoDiscoveryAction=ar;(function(n){n.SUCCESS="SUCCESS",n.IGNORE="IGNORE",n.PROMPT="PROMPT",n.FAIL_PROMPT="FAIL_PROMPT",n.FAIL_ERROR="FAIL_ERROR"})(ar||(Ni.AutoDiscoveryAction=ar={}));class Z{static async fromDiscoveryConfig(e){const t={"m.homeserver":{state:Z.FAIL_ERROR,error:Z.ERROR_INVALID,base_url:null},"m.identity_server":{state:Z.PROMPT,error:null,base_url:null}};if(!e||!e["m.homeserver"])return Un.logger.error("No m.homeserver key in config"),t["m.homeserver"].state=Z.FAIL_PROMPT,t["m.homeserver"].error=Z.ERROR_INVALID,Promise.resolve(t);if(!e["m.homeserver"].base_url)return Un.logger.error("No m.homeserver base_url in config"),t["m.homeserver"].state=Z.FAIL_PROMPT,t["m.homeserver"].error=Z.ERROR_INVALID_HS_BASE_URL,Promise.resolve(t);const r=this.sanitizeWellKnownUrl(e["m.homeserver"].base_url);if(!r)return Un.logger.error("Invalid base_url for m.homeserver"),t["m.homeserver"].error=Z.ERROR_INVALID_HS_BASE_URL,Promise.resolve(t);const i=await this.fetchWellKnownObject(`${r}/_matrix/client/versions`);if(!i||!i.raw.versions)return Un.logger.error("Invalid /versions response"),t["m.homeserver"].error=Z.ERROR_INVALID_HOMESERVER,t["m.homeserver"].base_url=r,Promise.resolve(t);t["m.homeserver"]={state:Z.SUCCESS,error:null,base_url:r};let s="";if(e["m.identity_server"]){const o={"m.homeserver":t["m.homeserver"],"m.identity_server":{state:Z.FAIL_PROMPT,error:Z.ERROR_INVALID_IS,base_url:null}};if(s=this.sanitizeWellKnownUrl(e["m.identity_server"].base_url),!s)return Un.logger.error("Invalid base_url for m.identity_server"),o["m.identity_server"].error=Z.ERROR_INVALID_IS_BASE_URL,Promise.resolve(o);const a=await this.fetchWellKnownObject(`${s}/_matrix/identity/api/v1`);if(!a||!a.raw||a.action!==ar.SUCCESS)return Un.logger.error("Invalid /api/v1 response"),o["m.identity_server"].error=Z.ERROR_INVALID_IDENTITY_SERVER,o["m.identity_server"].base_url=s,Promise.resolve(o)}return s&&s.toString().length>0&&(t["m.identity_server"]={state:Z.SUCCESS,error:null,base_url:s}),Object.keys(e).map(o=>{if(o==="m.homeserver"||o==="m.identity_server"){const a=["error","state","base_url"];for(const l of Object.keys(e[o]))a.includes(l)||(t[o][l]=e[o][l])}else t[o]=e[o]}),Promise.resolve(t)}static async findClientConfig(e){if(!e||typeof e!="string"||e.length===0)throw new Error("'domain' must be a string of non-zero length");const t={"m.homeserver":{state:Z.FAIL_ERROR,error:Z.ERROR_INVALID,base_url:null},"m.identity_server":{state:Z.PROMPT,error:null,base_url:null}},r=await this.fetchWellKnownObject(`https://${e}/.well-known/matrix/client`);return!r||r.action!==ar.SUCCESS?(Un.logger.error("No response or error when parsing .well-known"),r.reason&&Un.logger.error(r.reason),r.action===ar.IGNORE?t["m.homeserver"]={state:Z.PROMPT,error:null,base_url:null}:(t["m.homeserver"].state=Z.FAIL_PROMPT,t["m.homeserver"].error=Z.ERROR_INVALID),Promise.resolve(t)):Z.fromDiscoveryConfig(r.raw)}static async getRawClientConfig(e){if(!e||typeof e!="string"||e.length===0)throw new Error("'domain' must be a string of non-zero length");const t=await this.fetchWellKnownObject(`https://${e}/.well-known/matrix/client`);return t?t.raw||{}:{}}static sanitizeWellKnownUrl(e){if(!e)return!1;try{let t=null;try{kg.URL?t=new kg.URL(e):t=new URL(e)}catch{t=new URL(e)}if(!t||!t.hostname||t.protocol!=="http:"&&t.protocol!=="https:")return!1;const r=t.port?`:${t.port}`:"",i=t.pathname?t.pathname:"";let s=`${t.protocol}//${t.hostname}${r}${i}`;return s.endsWith("/")&&(s=s.substring(0,s.length-1)),s}catch(t){return Un.logger.error(t),!1}}static async fetchWellKnownObject(e){return new Promise(function(t,r){const i=Cs.getRequest();if(!i)throw new Error("No request library available");i({method:"GET",uri:e,timeout:5e3},(s,o,a)=>{if(s||o&&(o.statusCode<200||o.statusCode>=300)){let l=ar.FAIL_PROMPT,u=(s?s.message:null)||"General failure";o&&o.statusCode===404&&(l=ar.IGNORE,u=Z.ERROR_MISSING_WELLKNOWN),t({raw:{},action:l,reason:u,error:s});return}try{t({raw:JSON.parse(a),action:ar.SUCCESS})}catch(l){let u=Z.ERROR_INVALID;l.name==="SyntaxError"&&(u=Z.ERROR_INVALID_JSON),t({raw:{},action:ar.FAIL_PROMPT,reason:u,error:l})}})})}}Ni.AutoDiscovery=Z;(0,ur.default)(Z,"ERROR_INVALID","Invalid homeserver discovery response");(0,ur.default)(Z,"ERROR_GENERIC_FAILURE","Failed to get autodiscovery configuration from server");(0,ur.default)(Z,"ERROR_INVALID_HS_BASE_URL","Invalid base_url for m.homeserver");(0,ur.default)(Z,"ERROR_INVALID_HOMESERVER","Homeserver URL does not appear to be a valid Matrix homeserver");(0,ur.default)(Z,"ERROR_INVALID_IS_BASE_URL","Invalid base_url for m.identity_server");(0,ur.default)(Z,"ERROR_INVALID_IDENTITY_SERVER","Identity server URL does not appear to be a valid identity server");(0,ur.default)(Z,"ERROR_INVALID_IS","Invalid identity server discovery response");(0,ur.default)(Z,"ERROR_MISSING_WELLKNOWN","No .well-known JSON file found");(0,ur.default)(Z,"ERROR_INVALID_JSON","Invalid JSON");(0,ur.default)(Z,"ALL_ERRORS",[Z.ERROR_INVALID,Z.ERROR_GENERIC_FAILURE,Z.ERROR_INVALID_HS_BASE_URL,Z.ERROR_INVALID_HOMESERVER,Z.ERROR_INVALID_IS_BASE_URL,Z.ERROR_INVALID_IDENTITY_SERVER,Z.ERROR_INVALID_IS,Z.ERROR_MISSING_WELLKNOWN,Z.ERROR_INVALID_JSON]);(0,ur.default)(Z,"FAIL_ERROR",ar.FAIL_ERROR);(0,ur.default)(Z,"FAIL_PROMPT",ar.FAIL_PROMPT);(0,ur.default)(Z,"PROMPT",ar.PROMPT);(0,ur.default)(Z,"SUCCESS",ar.SUCCESS);var xe={},Cg=/[\\\"\x00-\x1F]/g,ci={};for(var Pc=0;Pc<32;++Pc)ci[String.fromCharCode(Pc)]="\\U"+("0000"+Pc.toString(16)).slice(-4).toUpperCase();ci["\b"]="\\b";ci[" "]="\\t";ci[`
-`]="\\n";ci["\f"]="\\f";ci["\r"]="\\r";ci['"']='\\"';ci["\\"]="\\\\";function Xv(n){return Cg.lastIndex=0,n.replace(Cg,function(e){return ci[e]})}function bf(n){switch(typeof n){case"string":return'"'+Xv(n)+'"';case"number":return isFinite(n)?n:"null";case"boolean":return n;case"object":return n===null?"null":Array.isArray(n)?Rk(n):Ik(n);default:throw new Error("Cannot stringify: "+typeof n)}}function Rk(n){for(var e="[",t="",r=0;r<n.length;++r)t+=e,e=",",t+=bf(n[r]);return e!=","?"[]":t+"]"}function Ik(n){var e="{",t="",r=Object.keys(n);r.sort();for(var i=0;i<r.length;++i){var s=r[i];t+=e+'"'+Xv(s)+'":',e=",",t+=bf(n[s])}return e!=","?"{}":t+"}"}var tu={stringify:bf},Tk=G.exports;Object.defineProperty(xe,"__esModule",{value:!0});xe.OLM_ALGORITHM=xe.MEGOLM_BACKUP_ALGORITHM=Ck=xe.MEGOLM_ALGORITHM=void 0;xe.decodeBase64=Lk;xe.encodeBase64=Zv;xe.encodeUnpaddedBase64=Nk;xe.encryptMessageForDevice=Mk;xe.ensureOlmSessionsForDevices=Dk;xe.getExistingOlmSessions=Ak;xe.pkSign=Uk;xe.pkVerify=$k;xe.verifySignature=Qv;var wf=Tk(tu),Da=se,Wa;(function(n){n.Olm="m.olm.v1.curve25519-aes-sha2",n.Megolm="m.megolm.v1.aes-sha2",n.MegolmBackup="m.megolm_backup.v1.curve25519-aes-sha2"})(Wa||(Wa={}));const Ok=Wa.Olm;xe.OLM_ALGORITHM=Ok;const kk=Wa.Megolm;var Ck=xe.MEGOLM_ALGORITHM=kk;const Pk=Wa.MegolmBackup;xe.MEGOLM_BACKUP_ALGORITHM=Pk;async function Mk(n,e,t,r,i,s,o){const a=s.getIdentityKey(),l=await r.getSessionIdForDevice(a);if(l===null)return;Da.logger.log("Using sessionid "+l+" for device "+i+":"+s.deviceId);const u={sender:e,sender_device:t,keys:{ed25519:r.deviceEd25519Key},recipient:i,recipient_keys:{ed25519:s.getFingerprint()}};Object.assign(u,o),n[a]=await r.encryptMessage(a,l,JSON.stringify(u))}async function Ak(n,e,t){const r={},i={},s=[];for(const[o,a]of Object.entries(t))for(const l of a){const u=l.deviceId,c=l.getIdentityKey();s.push((async()=>{const g=await n.getSessionIdForDevice(c,!0);g===null?(r[o]=r[o]||[],r[o].push(l)):(i[o]=i[o]||{},i[o][u]={device:l,sessionId:g})})())}return await Promise.all(s),[r,i]}async function Dk(n,e,t,r=!1,i,s,o=Da.logger){typeof r=="number"&&(o=s,s=i,i=r,r=!1);const a=[],l={},u={};for(const[,I]of Object.entries(t))for(const w of I){const k=w.getIdentityKey();k!==n.deviceCurve25519Key&&(n.sessionsInProgress[k]||(n.sessionsInProgress[k]=new Promise(C=>{u[k]=S=>{delete n.sessionsInProgress[k],C(S)}})))}for(const[I,w]of Object.entries(t)){l[I]={};for(const k of w){const C=k.deviceId,S=k.getIdentityKey();if(S===n.deviceCurve25519Key){o.info("Attempted to start session with ourself! Ignoring"),l[I][C]={device:k,sessionId:null};continue}const T=`for ${S} (${I}:${C})`,D=await n.getSessionIdForDevice(S,!!u[S],o);D!==null&&u[S]&&u[S](),(D===null||r)&&(r?o.info(`Forcing new Olm session ${T}`):o.info(`Making new Olm session ${T}`),a.push([I,C])),l[I][C]={device:k,sessionId:D}}}if(a.length===0)return l;const c="signed_curve25519";let g,m=`one-time keys for ${a.length} devices`;try{o.debug(`Claiming ${m}`),g=await e.claimOneTimeKeys(a,c,i),o.debug(`Claimed ${m}`)}catch(I){for(const w of Object.values(u))w();throw o.log(`Failed to claim ${m}`,I,a),I}s&&"failures"in g&&s.push(...Object.keys(g.failures));const f=g.one_time_keys||{},E=[];for(const[I,w]of Object.entries(t)){const k=f[I]||{};for(let C=0;C<w.length;C++){const S=w[C],T=S.deviceId,D=S.getIdentityKey();if(D===n.deviceCurve25519Key||l[I][T].sessionId&&!r)continue;const R=k[T]||{};let U=null;for(const q in R)q.indexOf(c+":")===0&&(U=R[q]);if(!U){o.warn(`No one-time keys (alg=${c}) for device ${I}:${T}`),u[D]&&u[D]();continue}E.push(xk(n,U,I,S).then(q=>{u[D]&&u[D](q),l[I][T].sessionId=q},q=>{throw u[D]&&u[D](),q}))}}return m=`Olm sessions for ${E.length} devices`,o.debug(`Starting ${m}`),await Promise.all(E),o.debug(`Started ${m}`),l}async function xk(n,e,t,r){const i=r.deviceId;try{await Qv(n,e,t,i,r.getFingerprint())}catch(o){return Da.logger.error("Unable to verify signature on one-time key for device "+t+":"+i+":",o),null}let s;try{s=await n.createOutboundSession(r.getIdentityKey(),e.key)}catch(o){return Da.logger.error("Error starting olm session with device "+t+":"+i+": "+o),null}return Da.logger.log("Started new olm sessionid "+s+" for device "+t+":"+i),s}async function Qv(n,e,t,r,i){const s="ed25519:"+r,l=((e.signatures||{})[t]||{})[s];if(!l)throw Error("No signature");const u=Object.assign({},e);"unsigned"in u&&delete u.unsigned,delete u.signatures;const c=wf.default.stringify(u);n.verifySignature(i,c,l)}function Uk(n,e,t,r){let i=!1;if(e instanceof Uint8Array){const a=new V.Olm.PkSigning;r=a.init_with_seed(e),e=a,i=!0}const s=n.signatures||{};delete n.signatures;const o=n.unsigned;n.unsigned&&delete n.unsigned;try{const a=s[t]||{};return s[t]=a,a["ed25519:"+r]=e.sign(wf.default.stringify(n))}finally{n.signatures=s,o&&(n.unsigned=o),i&&e.free()}}function $k(n,e,t){const r="ed25519:"+e;if(!(n.signatures&&n.signatures[t]&&n.signatures[t][r]))throw new Error("No signature");const i=n.signatures[t][r],s=new V.Olm.Utility,o=n.signatures;delete n.signatures;const a=n.unsigned;n.unsigned&&delete n.unsigned;try{s.ed25519_verify(e,wf.default.stringify(n),i)}finally{n.signatures=o,a&&(n.unsigned=a),s.free()}}function Zv(n){return Buffer.from(n).toString("base64")}function Nk(n){return Zv(n).replace(/=+$/g,"")}function Lk(n){return Buffer.from(n,"base64")}var ru={},Br={},nu={};Object.defineProperty(nu,"__esModule",{value:!0});nu.LocalStorageCryptoStore=void 0;var Pg=se,Bk=Uo;const Er="crypto.",rd=Er+"account",Mg=Er+"cross_signing_keys",Ag=Er+"notified_error_devices",Dg=Er+"device_data",sl=Er+"inboundgroupsessions/",Kk=Er+"inboundgroupsessions.withheld/",Fk=Er+"rooms/",Ws=Er+"sessionsneedingbackup";function Mc(n){return Er+"sessions/"+n}function xg(n){return Er+"session.problems/"+n}function nd(n,e){return sl+n+"/"+e}function Ug(n,e){return Kk+n+"/"+e}function $g(n){return Fk+n}class qk extends Bk.MemoryCryptoStore{static exists(e){const t=e.length;for(let r=0;r<t;r++)if(e.key(r).startsWith(Er))return!0;return!1}constructor(e){super();this.store=e}countEndToEndSessions(e,t){let r=0;for(let i=0;i<this.store.length;++i)this.store.key(i).startsWith(Mc(""))&&++r;t(r)}_getEndToEndSessions(e){const t=pt(this.store,Mc(e)),r={};for(const[i,s]of Object.entries(t||{}))typeof s=="string"?r[i]={session:s}:r[i]=s;return r}getEndToEndSession(e,t,r,i){const s=this._getEndToEndSessions(e);i(s[t]||{})}getEndToEndSessions(e,t,r){r(this._getEndToEndSessions(e)||{})}getAllEndToEndSessions(e,t){for(let r=0;r<this.store.length;++r)if(this.store.key(r).startsWith(Mc(""))){const i=this.store.key(r).split("/")[1];for(const s of Object.values(this._getEndToEndSessions(i)))t(s)}}storeEndToEndSession(e,t,r,i){const s=this._getEndToEndSessions(e)||{};s[t]=r,kr(this.store,Mc(e),s)}async storeEndToEndSessionProblem(e,t,r){const i=xg(e),s=pt(this.store,i)||[];s.push({type:t,fixed:r,time:Date.now()}),s.sort((o,a)=>o.time-a.time),kr(this.store,i,s)}async getEndToEndSessionProblem(e,t){const r=xg(e),i=pt(this.store,r)||[];if(!i.length)return null;const s=i[i.length-1];for(const o of i)if(o.time>t)return Object.assign({},o,{fixed:s.fixed});return s.fixed?null:s}async filterOutNotifiedErrorDevices(e){const t=pt(this.store,Ag)||{},r=[];for(const i of e){const{userId:s,deviceInfo:o}=i;s in t?o.deviceId in t[s]||(r.push(i),t[s][o.deviceId]=!0):(r.push(i),t[s]={[o.deviceId]:!0})}return kr(this.store,Ag,t),r}getEndToEndInboundGroupSession(e,t,r,i){i(pt(this.store,nd(e,t)),pt(this.store,Ug(e,t)))}getAllEndToEndInboundGroupSessions(e,t){for(let r=0;r<this.store.length;++r){const i=this.store.key(r);i.startsWith(sl)&&t({senderKey:i.substr(sl.length,43),sessionId:i.substr(sl.length+44),sessionData:pt(this.store,i)})}t(null)}addEndToEndInboundGroupSession(e,t,r,i){pt(this.store,nd(e,t))||this.storeEndToEndInboundGroupSession(e,t,r,i)}storeEndToEndInboundGroupSession(e,t,r,i){kr(this.store,nd(e,t),r)}storeEndToEndInboundGroupSessionWithheld(e,t,r,i){kr(this.store,Ug(e,t),r)}getEndToEndDeviceData(e,t){t(pt(this.store,Dg))}storeEndToEndDeviceData(e,t){kr(this.store,Dg,e)}storeEndToEndRoom(e,t,r){kr(this.store,$g(e),t)}getEndToEndRooms(e,t){const r={},i=$g("");for(let s=0;s<this.store.length;++s){const o=this.store.key(s);if(o.startsWith(i)){const a=o.substr(i.length);r[a]=pt(this.store,o)}}t(r)}getSessionsNeedingBackup(e){const t=pt(this.store,Ws)||{},r=[];for(const i in t)if(Object.prototype.hasOwnProperty.call(t,i)){const s=i.substr(0,43),o=i.substr(44);if(this.getEndToEndInboundGroupSession(s,o,null,a=>{r.push({senderKey:s,sessionId:o,sessionData:a})}),e&&i.length>=e)break}return Promise.resolve(r)}countSessionsNeedingBackup(){const e=pt(this.store,Ws)||{};return Promise.resolve(Object.keys(e).length)}unmarkSessionsNeedingBackup(e){const t=pt(this.store,Ws)||{};for(const r of e)delete t[r.senderKey+"/"+r.sessionId];return kr(this.store,Ws,t),Promise.resolve()}markSessionsNeedingBackup(e){const t=pt(this.store,Ws)||{};for(const r of e)t[r.senderKey+"/"+r.sessionId]=!0;return kr(this.store,Ws,t),Promise.resolve()}deleteAllData(){return this.store.removeItem(rd),Promise.resolve()}getAccount(e,t){const r=pt(this.store,rd);t(r)}storeAccount(e,t){kr(this.store,rd,t)}getCrossSigningKeys(e,t){const r=pt(this.store,Mg);t(r)}getSecretStorePrivateKey(e,t,r){const i=pt(this.store,Er+`ssss_cache.${r}`);t(i)}storeCrossSigningKeys(e,t){kr(this.store,Mg,t)}storeSecretStorePrivateKey(e,t,r){kr(this.store,Er+`ssss_cache.${t}`,r)}doTxn(e,t,r){return Promise.resolve(r(null))}}nu.LocalStorageCryptoStore=qk;function pt(n,e){try{return JSON.parse(n.getItem(e))}catch(t){Pg.logger.log("Error: Failed to get key %s: %s",e,t.stack||t),Pg.logger.log(t.stack)}return null}function kr(n,e,t){n.setItem(e,JSON.stringify(t))}var _s={},jk=G.exports;Object.defineProperty(_s,"__esModule",{value:!0});_s.VERSION=_s.Backend=void 0;_s.upgradeDatabase=Yk;var Vk=jk(Y.exports),mn=se,Gk=Wk(W);function e_(n){if(typeof WeakMap!="function")return null;var e=new WeakMap,t=new WeakMap;return(e_=function(r){return r?t:e})(n)}function Wk(n,e){if(!e&&n&&n.__esModule)return n;if(n===null||typeof n!="object"&&typeof n!="function")return{default:n};var t=e_(e);if(t&&t.has(n))return t.get(n);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in n)if(s!=="default"&&Object.prototype.hasOwnProperty.call(n,s)){var o=i?Object.getOwnPropertyDescriptor(n,s):null;o&&(o.get||o.set)?Object.defineProperty(r,s,o):r[s]=n[s]}return r.default=n,t&&t.set(n,r),r}const t_=10;_s.VERSION=t_;class Hk{constructor(e){this.db=e,(0,Vk.default)(this,"nextTxnId",0),e.onversionchange=()=>{mn.logger.log(`versionchange for indexeddb ${this.db.name}: closing`),e.close()}}async startup(){return this}async deleteAllData(){throw Error("This is not implemented, call IDBFactory::deleteDatabase(dbName) instead.")}getOrAddOutgoingRoomKeyRequest(e){const t=e.requestBody;return new Promise((r,i)=>{const s=this.db.transaction("outgoingRoomKeyRequests","readwrite");s.onerror=i,this._getOutgoingRoomKeyRequest(s,t,o=>{if(o){mn.logger.log(`already have key request outstanding for ${t.room_id} / ${t.session_id}: not sending another`),r(o);return}mn.logger.log(`enqueueing key request for ${t.room_id} / `+t.session_id),s.oncomplete=()=>{r(e)},s.objectStore("outgoingRoomKeyRequests").add(e)})})}getOutgoingRoomKeyRequest(e){return new Promise((t,r)=>{const i=this.db.transaction("outgoingRoomKeyRequests","readonly");i.onerror=r,this._getOutgoingRoomKeyRequest(i,e,s=>{t(s)})})}_getOutgoingRoomKeyRequest(e,t,r){const o=e.objectStore("outgoingRoomKeyRequests").index("session").openCursor([t.room_id,t.session_id]);o.onsuccess=()=>{const a=o.result;if(!a){r(null);return}const l=a.value;if(Gk.deepCompare(l.requestBody,t)){r(l);return}a.continue()}}getOutgoingRoomKeyRequestByState(e){if(e.length===0)return Promise.resolve(null);let t=0,r;function i(){const u=this.result;if(u){r=u.value;return}if(t++,t>=e.length)return;const c=e[t],g=this.source.openCursor(c);g.onsuccess=i}const s=this.db.transaction("outgoingRoomKeyRequests","readonly"),o=s.objectStore("outgoingRoomKeyRequests"),a=e[t],l=o.index("state").openCursor(a);return l.onsuccess=i,Gi(s).then(()=>r)}getAllOutgoingRoomKeyRequestsByState(e){return new Promise((t,r)=>{const a=this.db.transaction("outgoingRoomKeyRequests","readonly").objectStore("outgoingRoomKeyRequests").index("state").getAll(e);a.onsuccess=()=>t(a.result),a.onerror=()=>r(a.error)})}getOutgoingRoomKeyRequestsByTarget(e,t,r){let i=0;const s=[];function o(){const g=this.result;if(g){const m=g.value;m.recipients.includes({userId:e,deviceId:t})&&s.push(m),g.continue()}else{if(i++,i>=r.length)return;const m=r[i],f=this.source.openCursor(m);f.onsuccess=o}}const a=this.db.transaction("outgoingRoomKeyRequests","readonly"),l=a.objectStore("outgoingRoomKeyRequests"),u=r[i],c=l.index("state").openCursor(u);return c.onsuccess=o,Gi(a).then(()=>s)}updateOutgoingRoomKeyRequest(e,t,r){let i=null;function s(){const l=this.result;if(!l)return;const u=l.value;if(u.state!=t){mn.logger.warn(`Cannot update room key request from ${t} as it was already updated to ${u.state}`);return}Object.assign(u,r),l.update(u),i=u}const o=this.db.transaction("outgoingRoomKeyRequests","readwrite"),a=o.objectStore("outgoingRoomKeyRequests").openCursor(e);return a.onsuccess=s,Gi(o).then(()=>i)}deleteOutgoingRoomKeyRequest(e,t){const r=this.db.transaction("outgoingRoomKeyRequests","readwrite"),i=r.objectStore("outgoingRoomKeyRequests").openCursor(e);return i.onsuccess=()=>{const s=i.result;if(!s)return;const o=s.value;if(o.state!=t){mn.logger.warn(`Cannot delete room key request in state ${o.state} (expected ${t})`);return}s.delete()},Gi(r)}getAccount(e,t){const i=e.objectStore("account").get("-");i.onsuccess=function(){try{t(i.result||null)}catch(s){Xt(e,s)}}}storeAccount(e,t){e.objectStore("account").put(t,"-")}getCrossSigningKeys(e,t){const i=e.objectStore("account").get("crossSigningKeys");i.onsuccess=function(){try{t(i.result||null)}catch(s){Xt(e,s)}}}getSecretStorePrivateKey(e,t,r){const s=e.objectStore("account").get(`ssss_cache:${r}`);s.onsuccess=function(){try{t(s.result||null)}catch(o){Xt(e,o)}}}storeCrossSigningKeys(e,t){e.objectStore("account").put(t,"crossSigningKeys")}storeSecretStorePrivateKey(e,t,r){e.objectStore("account").put(r,`ssss_cache:${t}`)}countEndToEndSessions(e,t){const i=e.objectStore("sessions").count();i.onsuccess=function(){try{t(i.result)}catch(s){Xt(e,s)}}}getEndToEndSessions(e,t,r){const o=t.objectStore("sessions").index("deviceKey").openCursor(e),a={};o.onsuccess=function(){const l=o.result;if(l)a[l.value.sessionId]={session:l.value.session,lastReceivedMessageTs:l.value.lastReceivedMessageTs},l.continue();else try{r(a)}catch(u){Xt(t,u)}}}getEndToEndSession(e,t,r,i){const o=r.objectStore("sessions").get([e,t]);o.onsuccess=function(){try{o.result?i({session:o.result.session,lastReceivedMessageTs:o.result.lastReceivedMessageTs}):i(null)}catch(a){Xt(r,a)}}}getAllEndToEndSessions(e,t){const i=e.objectStore("sessions").openCursor();i.onsuccess=function(){try{const s=i.result;s?(t(s.value),s.continue()):t(null)}catch(s){Xt(e,s)}}}storeEndToEndSession(e,t,r,i){i.objectStore("sessions").put({deviceKey:e,sessionId:t,session:r.session,lastReceivedMessageTs:r.lastReceivedMessageTs})}async storeEndToEndSessionProblem(e,t,r){const i=this.db.transaction("session_problems","readwrite");return i.objectStore("session_problems").put({deviceKey:e,type:t,fixed:r,time:Date.now()}),Gi(i)}async getEndToEndSessionProblem(e,t){let r;const i=this.db.transaction("session_problems","readwrite"),a=i.objectStore("session_problems").index("deviceKey").getAll(e);return a.onsuccess=()=>{const l=a.result;if(!l.length){r=null;return}l.sort((c,g)=>c.time-g.time);const u=l[l.length-1];for(const c of l)if(c.time>t){r=Object.assign({},c,{fixed:u.fixed});return}u.fixed?r=null:r=u},await Gi(i),r}async filterOutNotifiedErrorDevices(e){const r=this.db.transaction("notified_error_devices","readwrite").objectStore("notified_error_devices"),i=[];return await Promise.all(e.map(s=>new Promise(o=>{const{userId:a,deviceInfo:l}=s,u=r.get([a,l.deviceId]);u.onsuccess=function(){u.result||(r.put({userId:a,deviceId:l.deviceId}),i.push(s)),o()}}))),i}getEndToEndInboundGroupSession(e,t,r,i){let s=!1,o=!1;const l=r.objectStore("inbound_group_sessions").get([e,t]);l.onsuccess=function(){try{l.result?s=l.result.session:s=null,o!==!1&&i(s,o)}catch(g){Xt(r,g)}};const c=r.objectStore("inbound_group_sessions_withheld").get([e,t]);c.onsuccess=function(){try{c.result?o=c.result.session:o=null,s!==!1&&i(s,o)}catch(g){Xt(r,g)}}}getAllEndToEndInboundGroupSessions(e,t){const i=e.objectStore("inbound_group_sessions").openCursor();i.onsuccess=function(){const s=i.result;if(s){try{t({senderKey:s.value.senderCurve25519Key,sessionId:s.value.sessionId,sessionData:s.value.session})}catch(o){Xt(e,o)}s.continue()}else try{t(null)}catch(o){Xt(e,o)}}}addEndToEndInboundGroupSession(e,t,r,i){const o=i.objectStore("inbound_group_sessions").add({senderCurve25519Key:e,sessionId:t,session:r});o.onerror=a=>{o.error.name==="ConstraintError"?(a.stopPropagation(),a.preventDefault(),mn.logger.log("Ignoring duplicate inbound group session: "+e+" / "+t)):Xt(i,new Error("Failed to add inbound group session: "+o.error))}}storeEndToEndInboundGroupSession(e,t,r,i){i.objectStore("inbound_group_sessions").put({senderCurve25519Key:e,sessionId:t,session:r})}storeEndToEndInboundGroupSessionWithheld(e,t,r,i){i.objectStore("inbound_group_sessions_withheld").put({senderCurve25519Key:e,sessionId:t,session:r})}getEndToEndDeviceData(e,t){const i=e.objectStore("device_data").get("-");i.onsuccess=function(){try{t(i.result||null)}catch(s){Xt(e,s)}}}storeEndToEndDeviceData(e,t){t.objectStore("device_data").put(e,"-")}storeEndToEndRoom(e,t,r){r.objectStore("rooms").put(t,e)}getEndToEndRooms(e,t){const r={},s=e.objectStore("rooms").openCursor();s.onsuccess=function(){const o=s.result;if(o)r[o.key]=o.value,o.continue();else try{t(r)}catch(a){Xt(e,a)}}}getSessionsNeedingBackup(e){return new Promise((t,r)=>{const i=[],s=this.db.transaction(["sessions_needing_backup","inbound_group_sessions"],"readonly");s.onerror=r,s.oncomplete=function(){t(i)};const o=s.objectStore("sessions_needing_backup"),a=s.objectStore("inbound_group_sessions"),l=o.openCursor();l.onsuccess=function(){const u=l.result;if(u){const c=a.get(u.key);c.onsuccess=function(){i.push({senderKey:c.result.senderCurve25519Key,sessionId:c.result.sessionId,sessionData:c.result.session})},(!e||i.length<e)&&u.continue()}}})}countSessionsNeedingBackup(e){e||(e=this.db.transaction("sessions_needing_backup","readonly"));const t=e.objectStore("sessions_needing_backup");return new Promise((r,i)=>{const s=t.count();s.onerror=i,s.onsuccess=()=>r(s.result)})}async unmarkSessionsNeedingBackup(e,t){t||(t=this.db.transaction("sessions_needing_backup","readwrite"));const r=t.objectStore("sessions_needing_backup");await Promise.all(e.map(i=>new Promise((s,o)=>{const a=r.delete([i.senderKey,i.sessionId]);a.onsuccess=s,a.onerror=o})))}async markSessionsNeedingBackup(e,t){t||(t=this.db.transaction("sessions_needing_backup","readwrite"));const r=t.objectStore("sessions_needing_backup");await Promise.all(e.map(i=>new Promise((s,o)=>{const a=r.put({senderCurve25519Key:i.senderKey,sessionId:i.sessionId});a.onsuccess=s,a.onerror=o})))}addSharedHistoryInboundGroupSession(e,t,r,i){i||(i=this.db.transaction("shared_history_inbound_group_sessions","readwrite"));const s=i.objectStore("shared_history_inbound_group_sessions"),o=s.get([e]);o.onsuccess=()=>{const{sessions:a}=o.result||{sessions:[]};a.push([t,r]),s.put({roomId:e,sessions:a})}}getSharedHistoryInboundGroupSessions(e,t){t||(t=this.db.transaction("shared_history_inbound_group_sessions","readonly"));const i=t.objectStore("shared_history_inbound_group_sessions").get([e]);return new Promise((s,o)=>{i.onsuccess=()=>{const{sessions:a}=i.result||{sessions:[]};s(a)},i.onerror=o})}doTxn(e,t,r,i=mn.logger){const s=this.db.transaction(t,e),o=Gi(s),a=r(s);return o.then(()=>a)}}_s.Backend=Hk;function Yk(n,e){mn.logger.log(`Upgrading IndexedDBCryptoStore from version ${e} to ${t_}`),e<1&&zk(n),e<2&&n.createObjectStore("account"),e<3&&n.createObjectStore("sessions",{keyPath:["deviceKey","sessionId"]}).createIndex("deviceKey","deviceKey"),e<4&&n.createObjectStore("inbound_group_sessions",{keyPath:["senderCurve25519Key","sessionId"]}),e<5&&n.createObjectStore("device_data"),e<6&&n.createObjectStore("rooms"),e<7&&n.createObjectStore("sessions_needing_backup",{keyPath:["senderCurve25519Key","sessionId"]}),e<8&&n.createObjectStore("inbound_group_sessions_withheld",{keyPath:["senderCurve25519Key","sessionId"]}),e<9&&(n.createObjectStore("session_problems",{keyPath:["deviceKey","time"]}).createIndex("deviceKey","deviceKey"),n.createObjectStore("notified_error_devices",{keyPath:["userId","deviceId"]})),e<10&&n.createObjectStore("shared_history_inbound_group_sessions",{keyPath:["roomId"]})}function zk(n){const e=n.createObjectStore("outgoingRoomKeyRequests",{keyPath:"requestId"});e.createIndex("session",["requestBody.room_id","requestBody.session_id"]),e.createIndex("state","state")}function Xt(n,e){n._mx_abortexception=e;try{n.abort()}catch{}}function Gi(n){return new Promise((e,t)=>{n.oncomplete=()=>{n._mx_abortexception!==void 0&&t(n._mx_abortexception),e(null)},n.onerror=r=>{n._mx_abortexception!==void 0?t(n._mx_abortexception):(mn.logger.log("Error performing indexeddb txn",r),t(n.error))},n.onabort=r=>{n._mx_abortexception!==void 0?t(n._mx_abortexception):(mn.logger.log("Error performing indexeddb txn",r),t(n.error))}})}var iu={};Object.defineProperty(iu,"__esModule",{value:!0});iu.exists=Jk;function Jk(n,e){return new Promise((t,r)=>{let i=!0;const s=n.open(e);s.onupgradeneeded=()=>{i=!1},s.onblocked=()=>r(s.error),s.onsuccess=()=>{s.result.close(),i||n.deleteDatabase(e),t(i)},s.onerror=o=>r(s.error)})}var Xk=G.exports;Object.defineProperty(Br,"__esModule",{value:!0});Br.IndexedDBCryptoStore=void 0;var On=Xk(Y.exports),Cr=se,Qk=nu,Zk=Uo,id=n_(_s),Ng=oi,eC=n_(iu);function r_(n){if(typeof WeakMap!="function")return null;var e=new WeakMap,t=new WeakMap;return(r_=function(r){return r?t:e})(n)}function n_(n,e){if(!e&&n&&n.__esModule)return n;if(n===null||typeof n!="object"&&typeof n!="function")return{default:n};var t=r_(e);if(t&&t.has(n))return t.get(n);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in n)if(s!=="default"&&Object.prototype.hasOwnProperty.call(n,s)){var o=i?Object.getOwnPropertyDescriptor(n,s):null;o&&(o.get||o.set)?Object.defineProperty(r,s,o):r[s]=n[s]}return r.default=n,t&&t.set(n,r),r}class Lr{static exists(e,t){return eC.exists(e,t)}constructor(e,t){this.indexedDB=e,this.dbName=t,(0,On.default)(this,"backendPromise",null),(0,On.default)(this,"backend",null)}startup(){return this.backendPromise?this.backendPromise:(this.backendPromise=new Promise((e,t)=>{if(!this.indexedDB){t(new Error("no indexeddb support available"));return}Cr.logger.log(`connecting to indexeddb ${this.dbName}`);const r=this.indexedDB.open(this.dbName,id.VERSION);r.onupgradeneeded=i=>{const s=r.result,o=i.oldVersion;id.upgradeDatabase(s,o)},r.onblocked=()=>{Cr.logger.log("can't yet open IndexedDBCryptoStore because it is open elsewhere")},r.onerror=i=>{Cr.logger.log("Error connecting to indexeddb",i),t(r.error)},r.onsuccess=()=>{const i=r.result;Cr.logger.log(`connected to indexeddb ${this.dbName}`),e(new id.Backend(i))}}).then(e=>e.doTxn("readonly",[Lr.STORE_INBOUND_GROUP_SESSIONS,Lr.STORE_INBOUND_GROUP_SESSIONS_WITHHELD],t=>{e.getEndToEndInboundGroupSession("","",t,()=>{})}).then(()=>e)).catch(e=>{if(e.name==="VersionError")throw Cr.logger.warn("Crypto DB is too new for us to use!",e),new Ng.InvalidCryptoStoreError(Ng.InvalidCryptoStoreError.TOO_NEW);Cr.logger.warn(`unable to connect to indexeddb ${this.dbName}: falling back to localStorage store: ${e}`);try{return new Qk.LocalStorageCryptoStore(V.localStorage)}catch(t){return Cr.logger.warn(`unable to open localStorage: falling back to in-memory store: ${t}`),new Zk.MemoryCryptoStore}}).then(e=>(this.backend=e,e)),this.backendPromise)}deleteAllData(){return new Promise((e,t)=>{if(!this.indexedDB){t(new Error("no indexeddb support available"));return}Cr.logger.log(`Removing indexeddb instance: ${this.dbName}`);const r=this.indexedDB.deleteDatabase(this.dbName);r.onblocked=()=>{Cr.logger.log("can't yet delete IndexedDBCryptoStore because it is open elsewhere")},r.onerror=i=>{Cr.logger.log("Error deleting data from indexeddb",i),t(r.error)},r.onsuccess=()=>{Cr.logger.log(`Removed indexeddb instance: ${this.dbName}`),e()}}).catch(e=>{Cr.logger.warn(`unable to delete IndexedDBCryptoStore: ${e}`)})}getOrAddOutgoingRoomKeyRequest(e){return this.backend.getOrAddOutgoingRoomKeyRequest(e)}getOutgoingRoomKeyRequest(e){return this.backend.getOutgoingRoomKeyRequest(e)}getOutgoingRoomKeyRequestByState(e){return this.backend.getOutgoingRoomKeyRequestByState(e)}getAllOutgoingRoomKeyRequestsByState(e){return this.backend.getAllOutgoingRoomKeyRequestsByState(e)}getOutgoingRoomKeyRequestsByTarget(e,t,r){return this.backend.getOutgoingRoomKeyRequestsByTarget(e,t,r)}updateOutgoingRoomKeyRequest(e,t,r){return this.backend.updateOutgoingRoomKeyRequest(e,t,r)}deleteOutgoingRoomKeyRequest(e,t){return this.backend.deleteOutgoingRoomKeyRequest(e,t)}getAccount(e,t){this.backend.getAccount(e,t)}storeAccount(e,t){this.backend.storeAccount(e,t)}getCrossSigningKeys(e,t){this.backend.getCrossSigningKeys(e,t)}getSecretStorePrivateKey(e,t,r){this.backend.getSecretStorePrivateKey(e,t,r)}storeCrossSigningKeys(e,t){this.backend.storeCrossSigningKeys(e,t)}storeSecretStorePrivateKey(e,t,r){this.backend.storeSecretStorePrivateKey(e,t,r)}countEndToEndSessions(e,t){this.backend.countEndToEndSessions(e,t)}getEndToEndSession(e,t,r,i){this.backend.getEndToEndSession(e,t,r,i)}getEndToEndSessions(e,t,r){this.backend.getEndToEndSessions(e,t,r)}getAllEndToEndSessions(e,t){this.backend.getAllEndToEndSessions(e,t)}storeEndToEndSession(e,t,r,i){this.backend.storeEndToEndSession(e,t,r,i)}storeEndToEndSessionProblem(e,t,r){return this.backend.storeEndToEndSessionProblem(e,t,r)}getEndToEndSessionProblem(e,t){return this.backend.getEndToEndSessionProblem(e,t)}filterOutNotifiedErrorDevices(e){return this.backend.filterOutNotifiedErrorDevices(e)}getEndToEndInboundGroupSession(e,t,r,i){this.backend.getEndToEndInboundGroupSession(e,t,r,i)}getAllEndToEndInboundGroupSessions(e,t){this.backend.getAllEndToEndInboundGroupSessions(e,t)}addEndToEndInboundGroupSession(e,t,r,i){this.backend.addEndToEndInboundGroupSession(e,t,r,i)}storeEndToEndInboundGroupSession(e,t,r,i){this.backend.storeEndToEndInboundGroupSession(e,t,r,i)}storeEndToEndInboundGroupSessionWithheld(e,t,r,i){this.backend.storeEndToEndInboundGroupSessionWithheld(e,t,r,i)}storeEndToEndDeviceData(e,t){this.backend.storeEndToEndDeviceData(e,t)}getEndToEndDeviceData(e,t){this.backend.getEndToEndDeviceData(e,t)}storeEndToEndRoom(e,t,r){this.backend.storeEndToEndRoom(e,t,r)}getEndToEndRooms(e,t){this.backend.getEndToEndRooms(e,t)}getSessionsNeedingBackup(e){return this.backend.getSessionsNeedingBackup(e)}countSessionsNeedingBackup(e){return this.backend.countSessionsNeedingBackup(e)}unmarkSessionsNeedingBackup(e,t){return this.backend.unmarkSessionsNeedingBackup(e,t)}markSessionsNeedingBackup(e,t){return this.backend.markSessionsNeedingBackup(e,t)}addSharedHistoryInboundGroupSession(e,t,r,i){this.backend.addSharedHistoryInboundGroupSession(e,t,r,i)}getSharedHistoryInboundGroupSessions(e,t){return this.backend.getSharedHistoryInboundGroupSessions(e,t)}doTxn(e,t,r,i){return this.backend.doTxn(e,t,r,i)}}Br.IndexedDBCryptoStore=Lr;(0,On.default)(Lr,"STORE_ACCOUNT","account");(0,On.default)(Lr,"STORE_SESSIONS","sessions");(0,On.default)(Lr,"STORE_INBOUND_GROUP_SESSIONS","inbound_group_sessions");(0,On.default)(Lr,"STORE_INBOUND_GROUP_SESSIONS_WITHHELD","inbound_group_sessions_withheld");(0,On.default)(Lr,"STORE_SHARED_HISTORY_INBOUND_GROUP_SESSIONS","shared_history_inbound_group_sessions");(0,On.default)(Lr,"STORE_DEVICE_DATA","device_data");(0,On.default)(Lr,"STORE_ROOMS","rooms");(0,On.default)(Lr,"STORE_BACKUP","sessions_needing_backup");var tC=G.exports;Object.defineProperty(ru,"__esModule",{value:!0});ru.RoomList=void 0;var rC=tC(Y.exports),Lg=Br;class nC{constructor(e){this.cryptoStore=e,(0,rC.default)(this,"roomEncryption",{})}async init(){await this.cryptoStore.doTxn("readwrite",[Lg.IndexedDBCryptoStore.STORE_ROOMS],e=>{this.cryptoStore.getEndToEndRooms(e,t=>{this.roomEncryption=t})})}getRoomEncryption(e){return this.roomEncryption[e]||null}isRoomEncrypted(e){return Boolean(this.getRoomEncryption(e))}async setRoomEncryption(e,t){this.roomEncryption[e]=t,await this.cryptoStore.doTxn("readwrite",[Lg.IndexedDBCryptoStore.STORE_ROOMS],r=>{this.cryptoStore.storeEndToEndRoom(e,t,r)})}}ru.RoomList=nC;var jo={};Object.defineProperty(jo,"__esModule",{value:!0});jo.SERVICE_TYPES=void 0;let Ch;jo.SERVICE_TYPES=Ch;(function(n){n.IS="SERVICE_TYPE_IS",n.IM="SERVICE_TYPE_IM"})(Ch||(jo.SERVICE_TYPES=Ch={}));var Ft={},Es={},Rf={},xs={},iC=G.exports;Object.defineProperty(xs,"__esModule",{value:!0});xs.DeviceInfo=void 0;var Qi=iC(Y.exports),Xn;(function(n){n[n.Blocked=-1]="Blocked",n[n.Unverified=0]="Unverified",n[n.Verified=1]="Verified"})(Xn||(Xn={}));class su{static fromStorage(e,t){const r=new su(t);for(const i in e)e.hasOwnProperty(i)&&(r[i]=e[i]);return r}constructor(e){this.deviceId=e,(0,Qi.default)(this,"algorithms",void 0),(0,Qi.default)(this,"keys",{}),(0,Qi.default)(this,"verified",Xn.Unverified),(0,Qi.default)(this,"known",!1),(0,Qi.default)(this,"unsigned",{}),(0,Qi.default)(this,"signatures",{})}toStorage(){return{algorithms:this.algorithms,keys:this.keys,verified:this.verified,known:this.known,unsigned:this.unsigned,signatures:this.signatures}}getFingerprint(){return this.keys["ed25519:"+this.deviceId]}getIdentityKey(){return this.keys["curve25519:"+this.deviceId]}getDisplayName(){return this.unsigned.device_display_name||null}isBlocked(){return this.verified==Xn.Blocked}isVerified(){return this.verified==Xn.Verified}isUnverified(){return this.verified==Xn.Unverified}isKnown(){return this.known===!0}}xs.DeviceInfo=su;(0,Qi.default)(su,"DeviceVerification",{VERIFIED:Xn.Verified,UNVERIFIED:Xn.Unverified,BLOCKED:Xn.Blocked});var _t={},sC=G.exports;Object.defineProperty(_t,"__esModule",{value:!0});_t.UnknownDeviceError=_t.EncryptionAlgorithm=_t.ENCRYPTION_CLASSES=_t.DecryptionError=_t.DecryptionAlgorithm=_t.DECRYPTION_CLASSES=void 0;_t.registerAlgorithm=dC;var Dr=sC(Y.exports);const i_={};_t.ENCRYPTION_CLASSES=i_;const s_={};_t.DECRYPTION_CLASSES=s_;class oC{constructor(e){(0,Dr.default)(this,"userId",void 0),(0,Dr.default)(this,"deviceId",void 0),(0,Dr.default)(this,"crypto",void 0),(0,Dr.default)(this,"olmDevice",void 0),(0,Dr.default)(this,"baseApis",void 0),(0,Dr.default)(this,"roomId",void 0),this.userId=e.userId,this.deviceId=e.deviceId,this.crypto=e.crypto,this.olmDevice=e.olmDevice,this.baseApis=e.baseApis,this.roomId=e.roomId}prepareToEncrypt(e){}onRoomMembership(e,t,r){}}_t.EncryptionAlgorithm=oC;class aC{constructor(e){(0,Dr.default)(this,"userId",void 0),(0,Dr.default)(this,"crypto",void 0),(0,Dr.default)(this,"olmDevice",void 0),(0,Dr.default)(this,"baseApis",void 0),(0,Dr.default)(this,"roomId",void 0),this.userId=e.userId,this.crypto=e.crypto,this.olmDevice=e.olmDevice,this.baseApis=e.baseApis,this.roomId=e.roomId}onRoomKeyEvent(e){}async importRoomKey(e,t){}hasKeysForKeyRequest(e){return Promise.resolve(!1)}shareKeysWithDevice(e){throw new Error("shareKeysWithDevice not supported for this DecryptionAlgorithm")}async retryDecryptionFromSender(e){return!1}}_t.DecryptionAlgorithm=aC;class cC extends Error{constructor(e,t,r){super(t);this.code=e,(0,Dr.default)(this,"detailedString",void 0),this.code=e,this.name="DecryptionError",this.detailedString=lC(this,r)}}_t.DecryptionError=cC;function lC(n,e){let t=n.name+"[msg: "+n.message;return e&&(t+=", "+Object.keys(e).map(r=>r+": "+e[r]).join(", ")),t+="]",t}class uC extends Error{constructor(e,t){super(e);this.devices=t,this.name="UnknownDeviceError",this.devices=t}}_t.UnknownDeviceError=uC;function dC(n,e,t){i_[n]=e,s_[n]=t}var hC=G.exports,Bg=hC(Y.exports),Kg=se,Ph=pC(xe),fC=xs,fn=_t;function o_(n){if(typeof WeakMap!="function")return null;var e=new WeakMap,t=new WeakMap;return(o_=function(r){return r?t:e})(n)}function pC(n,e){if(!e&&n&&n.__esModule)return n;if(n===null||typeof n!="object"&&typeof n!="function")return{default:n};var t=o_(e);if(t&&t.has(n))return t.get(n);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in n)if(s!=="default"&&Object.prototype.hasOwnProperty.call(n,s)){var o=i?Object.getOwnPropertyDescriptor(n,s):null;o&&(o.get||o.set)?Object.defineProperty(r,s,o):r[s]=n[s]}return r.default=n,t&&t.set(n,r),r}const gC=fC.DeviceInfo.DeviceVerification;class mC extends fn.EncryptionAlgorithm{constructor(...e){super(...e);(0,Bg.default)(this,"sessionPrepared",!1),(0,Bg.default)(this,"prepPromise",null)}ensureSession(e){return this.prepPromise?this.prepPromise:this.sessionPrepared?Promise.resolve():(this.prepPromise=this.crypto.downloadKeys(e).then(t=>this.crypto.ensureOlmSessionsForUsers(e)).then(()=>{this.sessionPrepared=!0}).finally(()=>{this.prepPromise=null}),this.prepPromise)}async encryptMessage(e,t,r){const s=(await e.getEncryptionTargetMembers()).map(function(u){return u.userId});await this.ensureSession(s);const o={room_id:e.roomId,type:t,content:r},a={algorithm:Ph.OLM_ALGORITHM,sender_key:this.olmDevice.deviceCurve25519Key,ciphertext:{}},l=[];for(let u=0;u<s.length;++u){const c=s[u],g=this.crypto.getStoredDevicesForUser(c);for(let m=0;m<g.length;++m){const f=g[m];f.getIdentityKey()!=this.olmDevice.deviceCurve25519Key&&f.verified!=gC.BLOCKED&&l.push(Ph.encryptMessageForDevice(a.ciphertext,this.userId,this.deviceId,this.olmDevice,c,f,o))}}return await Promise.all(l).then(()=>a)}}class yC extends fn.DecryptionAlgorithm{async decryptEvent(e){const t=e.getWireContent(),r=t.sender_key,i=t.ciphertext;if(!i)throw new fn.DecryptionError("OLM_MISSING_CIPHERTEXT","Missing ciphertext");if(!(this.olmDevice.deviceCurve25519Key in i))throw new fn.DecryptionError("OLM_NOT_INCLUDED_IN_RECIPIENTS","Not included in recipients");const s=i[this.olmDevice.deviceCurve25519Key];let o;try{o=await this.decryptMessage(r,s)}catch(u){throw new fn.DecryptionError("OLM_BAD_ENCRYPTED_MESSAGE","Bad Encrypted Message",{sender:r,err:u})}const a=JSON.parse(o);if(a.recipient!=this.userId)throw new fn.DecryptionError("OLM_BAD_RECIPIENT","Message was intented for "+a.recipient);if(a.recipient_keys.ed25519!=this.olmDevice.deviceEd25519Key)throw new fn.DecryptionError("OLM_BAD_RECIPIENT_KEY","Message not intended for this device",{intended:a.recipient_keys.ed25519,our_key:this.olmDevice.deviceEd25519Key});if(a.sender!=e.getSender())throw new fn.DecryptionError("OLM_FORWARDED_MESSAGE","Message forwarded from "+a.sender,{reported_sender:e.getSender()});if(a.room_id!==e.getRoomId())throw new fn.DecryptionError("OLM_BAD_ROOM","Message intended for room "+a.room_id,{reported_room:e.getRoomId()});const l=a.keys||{};return{clearEvent:a,senderCurve25519Key:r,claimedEd25519Key:l.ed25519||null}}async decryptMessage(e,t){if(t.type!==0)return this.reallyDecryptMessage(e,t);{const r=this.olmDevice.olmPrekeyPromise.then(()=>this.reallyDecryptMessage(e,t));return this.olmDevice.olmPrekeyPromise=r.catch(()=>{}),await r}}async reallyDecryptMessage(e,t){const r=await this.olmDevice.getSessionIdsForDevice(e),i={};for(let o=0;o<r.length;o++){const a=r[o];try{const l=await this.olmDevice.decryptMessage(e,a,t.type,t.body);return Kg.logger.log("Decrypted Olm message from "+e+" with session "+a),l}catch(l){if(await this.olmDevice.matchesSession(e,a,t.type,t.body))throw new Error("Error decrypting prekey message with existing session id "+a+": "+l.message);i[a]=l.message}}if(t.type!==0)throw r.length===0?new Error("No existing sessions"):new Error("Error decrypting non-prekey message with existing sessions: "+JSON.stringify(i));let s;try{s=await this.olmDevice.createInboundSession(e,t.type,t.body)}catch(o){throw i["(new)"]=o.message,new Error("Error decrypting prekey message: "+JSON.stringify(i))}return Kg.logger.log("created new inbound Olm session ID "+s.session_id+" with "+e),s.payload}}(0,fn.registerAlgorithm)(Ph.OLM_ALGORITHM,mC,yC);var If={},vC=G.exports;Object.defineProperty(If,"__esModule",{value:!0});If.isRoomSharedHistory=c_;var xr=vC(Y.exports),H=se,et=_C(xe),Wn=_t,Fg=Es;function a_(n){if(typeof WeakMap!="function")return null;var e=new WeakMap,t=new WeakMap;return(a_=function(r){return r?t:e})(n)}function _C(n,e){if(!e&&n&&n.__esModule)return n;if(n===null||typeof n!="object"&&typeof n!="function")return{default:n};var t=a_(e);if(t&&t.has(n))return t.get(n);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in n)if(s!=="default"&&Object.prototype.hasOwnProperty.call(n,s)){var o=i?Object.getOwnPropertyDescriptor(n,s):null;o&&(o.get||o.set)?Object.defineProperty(r,s,o):r[s]=n[s]}return r.default=n,t&&t.set(n,r),r}function c_(n){var e,t;const r=n==null||(e=n.currentState)===null||e===void 0?void 0:e.getStateEvents("m.room.history_visibility",""),i=r==null||(t=r.getContent())===null||t===void 0?void 0:t.history_visibility;return["world_readable","shared"].includes(i)}class EC{constructor(e,t=!1){this.sessionId=e,this.sharedHistory=t,(0,xr.default)(this,"useCount",0),(0,xr.default)(this,"creationTime",void 0),(0,xr.default)(this,"sharedWithDevices",{}),(0,xr.default)(this,"blockedDevicesNotified",{}),this.creationTime=new Date().getTime()}needsRotation(e,t){const r=new Date().getTime()-this.creationTime;return this.useCount>=e||r>=t?(H.logger.log("Rotating megolm session after "+this.useCount+" messages, "+r+"ms"),!0):!1}markSharedWithDevice(e,t,r,i){this.sharedWithDevices[e]||(this.sharedWithDevices[e]={}),this.sharedWithDevices[e][t]={deviceKey:r,messageIndex:i}}markNotifiedBlockedDevice(e,t){this.blockedDevicesNotified[e]||(this.blockedDevicesNotified[e]={}),this.blockedDevicesNotified[e][t]=!0}sharedWithTooManyDevices(e){for(const t in this.sharedWithDevices)if(!!this.sharedWithDevices.hasOwnProperty(t)){if(!e.hasOwnProperty(t))return H.logger.log("Starting new megolm session because we shared with "+t),!0;for(const r in this.sharedWithDevices[t])if(!!this.sharedWithDevices[t].hasOwnProperty(r)&&!e[t].hasOwnProperty(r))return H.logger.log("Starting new megolm session because we shared with "+t+":"+r),!0}}}class SC extends Wn.EncryptionAlgorithm{constructor(e){var t,r,i,s;super(e);(0,xr.default)(this,"setupPromise",Promise.resolve(void 0)),(0,xr.default)(this,"outboundSessions",{}),(0,xr.default)(this,"sessionRotationPeriodMsgs",void 0),(0,xr.default)(this,"sessionRotationPeriodMs",void 0),(0,xr.default)(this,"encryptionPreparation",void 0),(0,xr.default)(this,"encryptionPreparationMetadata",void 0),this.sessionRotationPeriodMsgs=(t=(r=e.config)===null||r===void 0?void 0:r.rotation_period_msgs)!==null&&t!==void 0?t:100,this.sessionRotationPeriodMs=(i=(s=e.config)===null||s===void 0?void 0:s.rotation_period_ms)!==null&&i!==void 0?i:7*24*3600*1e3}async ensureOutboundSession(e,t,r,i=!1){let s;const o=async u=>{s=u;const c=c_(e);s&&c!==s.sharedHistory&&(s=null),s&&s.needsRotation(this.sessionRotationPeriodMsgs,this.sessionRotationPeriodMs)&&(H.logger.log("Starting new megolm session because we need to rotate."),s=null),s&&s.sharedWithTooManyDevices(t)&&(s=null),s||(H.logger.log(`Starting new megolm session for room ${this.roomId}`),s=await this.prepareNewSession(c),H.logger.log(`Started new megolm session ${s.sessionId} for room ${this.roomId}`),this.outboundSessions[s.sessionId]=s);const g={};for(const[w,k]of Object.entries(t))for(const[C,S]of Object.entries(k))S.getIdentityKey()!=this.olmDevice.deviceCurve25519Key&&(!s.sharedWithDevices[w]||s.sharedWithDevices[w][C]===void 0)&&(g[w]=g[w]||[],g[w].push(S));const m=this.olmDevice.getOutboundGroupSessionKey(s.sessionId),f={type:"m.room_key",content:{algorithm:et.MEGOLM_ALGORITHM,room_id:this.roomId,session_id:s.sessionId,session_key:m.key,chain_index:m.chain_index,"org.matrix.msc3061.shared_history":c}},[E,I]=await et.getExistingOlmSessions(this.olmDevice,this.baseApis,g);await Promise.all([(async()=>{H.logger.debug(`Sharing keys with existing Olm sessions in ${this.roomId}`,I),await this.shareKeyWithOlmSessions(s,m,f,I),H.logger.debug(`Shared keys with existing Olm sessions in ${this.roomId}`)})(),(async()=>{H.logger.debug(`Sharing keys (start phase 1) with new Olm sessions in ${this.roomId}`,E);const w=[],k=Date.now(),C=[];await this.shareKeyWithDevices(s,m,f,E,w,i?1e4:2e3,C),H.logger.debug(`Shared keys (end phase 1) with new Olm sessions in ${this.roomId}`),!i&&Date.now()-k<1e4?(async()=>{const S={},T=new Set;for(const R of C)T.add(R);const D=[];for(const{userId:R,deviceInfo:U}of w){const q=R.slice(R.indexOf(":")+1);T.has(q)?(S[R]=S[R]||[],S[R].push(U)):D.push({userId:R,deviceInfo:U})}H.logger.debug(`Sharing keys (start phase 2) with new Olm sessions in ${this.roomId}`),await this.shareKeyWithDevices(s,m,f,S,D,3e4),H.logger.debug(`Shared keys (end phase 2) with new Olm sessions in ${this.roomId}`),await this.notifyFailedOlmDevices(s,m,D)})():await this.notifyFailedOlmDevices(s,m,w),H.logger.debug(`Shared keys (all phases done) with new Olm sessions in ${this.roomId}`)})(),(async()=>{H.logger.debug(`There are ${Object.entries(r).length} blocked devices in ${this.roomId}`,Object.entries(r)),H.logger.debug(`Notifying newly blocked devices in ${this.roomId}`);const w={};let k=0;for(const[C,S]of Object.entries(r))for(const[T,D]of Object.entries(S))(!s.blockedDevicesNotified[C]||s.blockedDevicesNotified[C][T]===void 0)&&(w[C]=w[C]||{},w[C][T]={device:D},k++);await this.notifyBlockedDevices(s,w),H.logger.debug(`Notified ${k} newly blocked devices in ${this.roomId}`,w)})()])};function a(){return s}const l=this.setupPromise.then(o);return l.catch(u=>{H.logger.error(`Failed to ensure outbound session in ${this.roomId}`,u)}),this.setupPromise=l.then(a,a),l.then(a)}async prepareNewSession(e){const t=this.olmDevice.createOutboundGroupSession(),r=this.olmDevice.getOutboundGroupSessionKey(t);return await this.olmDevice.addInboundGroupSession(this.roomId,this.olmDevice.deviceCurve25519Key,[],t,r.key,{ed25519:this.olmDevice.deviceEd25519Key},!1,{sharedHistory:e}),this.crypto.backupManager.backupGroupSession(this.olmDevice.deviceCurve25519Key,t),new EC(t,e)}getDevicesWithoutSessions(e,t,r=[]){for(const[i,s]of Object.entries(t)){const o=e[i];for(const a of s){const l=a.deviceId;if(!o[l].sessionId){r.push({userId:i,deviceInfo:a}),delete o[l];continue}}}return r}splitDevices(e){let r=[];const i=[r];for(const[s,o]of Object.entries(e)){for(const a of Object.values(o))r.push({userId:s,deviceInfo:a.device});r.length>20&&(r=[],i.push(r))}return r.length===0&&i.pop(),i}encryptAndSendKeysToDevices(e,t,r,i){const s={},o=new Map,a=[];for(let l=0;l<r.length;l++){const u={algorithm:et.OLM_ALGORITHM,sender_key:this.olmDevice.deviceCurve25519Key,ciphertext:{}},c=r[l],g=c.userId,m=c.deviceInfo,f=m.deviceId;o.set(f,m),s[g]||(s[g]={}),s[g][f]=u,a.push(et.encryptMessageForDevice(u.ciphertext,this.userId,this.deviceId,this.olmDevice,g,m,i))}return Promise.all(a).then(()=>{for(const l of Object.keys(s)){for(const u of Object.keys(s[l]))Object.keys(s[l][u].ciphertext).length===0&&(H.logger.log("No ciphertext for device "+l+":"+u+": pruning"),delete s[l][u]);Object.keys(s[l]).length===0&&(H.logger.log("Pruned all devices for user "+l),delete s[l])}if(Object.keys(s).length===0){H.logger.log("No users left to send to: aborting");return}return this.baseApis.sendToDevice("m.room.encrypted",s).then(()=>{for(const l of Object.keys(s))for(const u of Object.keys(s[l]))e.markSharedWithDevice(l,u,o.get(u).getIdentityKey(),t)})})}async sendBlockedNotificationsToDevices(e,t,r){const i={};for(const s of t){const o=s.userId,a=s.deviceInfo,u=a.deviceInfo.deviceId,c=Object.assign({},r);c.code=a.code,c.reason=a.reason,c.code==="m.no_olm"&&(delete c.room_id,delete c.session_id),i[o]||(i[o]={}),i[o][u]=c}await this.baseApis.sendToDevice("org.matrix.room_key.withheld",i),await this.baseApis.sendToDevice("m.room_key.withheld",i);for(const s of Object.keys(i))for(const o of Object.keys(i[s]))e.markNotifiedBlockedDevice(s,o)}async reshareKeyWithDevice(e,t,r,i){const s=this.outboundSessions[t];if(!s){H.logger.debug(`megolm session ${t} not found: not re-sharing keys`);return}if(s.sharedWithDevices[r]===void 0){H.logger.debug(`megolm session ${t} never shared with user ${r}`);return}const o=s.sharedWithDevices[r][i.deviceId];if(o===void 0){H.logger.debug("megolm session ID "+t+" never shared with device "+r+":"+i.deviceId);return}if(o.deviceKey!==i.getIdentityKey()){H.logger.warn(`Session has been shared with device ${i.deviceId} but with identity key ${o.deviceKey}. Key is now ${i.getIdentityKey()}!`);return}const a=await this.olmDevice.getInboundGroupSessionKey(this.roomId,e,t,o.messageIndex);if(!a){H.logger.warn(`No inbound session key found for megolm ${t}: not re-sharing keys`);return}await et.ensureOlmSessionsForDevices(this.olmDevice,this.baseApis,{[r]:[i]});const l={type:"m.forwarded_room_key",content:{algorithm:et.MEGOLM_ALGORITHM,room_id:this.roomId,session_id:t,session_key:a.key,chain_index:a.chain_index,sender_key:e,sender_claimed_ed25519_key:a.sender_claimed_ed25519_key,forwarding_curve25519_key_chain:a.forwarding_curve25519_key_chain,"org.matrix.msc3061.shared_history":a.shared_history||!1}},u={algorithm:et.OLM_ALGORITHM,sender_key:this.olmDevice.deviceCurve25519Key,ciphertext:{}};await et.encryptMessageForDevice(u.ciphertext,this.userId,this.deviceId,this.olmDevice,r,i,l),await this.baseApis.sendToDevice("m.room.encrypted",{[r]:{[i.deviceId]:u}}),H.logger.debug(`Re-shared key for megolm session ${t} with ${r}:${i.deviceId}`)}async shareKeyWithDevices(e,t,r,i,s,o,a){H.logger.debug(`Ensuring Olm sessions for devices in ${this.roomId}`);const l=await et.ensureOlmSessionsForDevices(this.olmDevice,this.baseApis,i,!1,o,a,H.logger.withPrefix(`[${this.roomId}]`));H.logger.debug(`Ensured Olm sessions for devices in ${this.roomId}`),this.getDevicesWithoutSessions(l,i,s),H.logger.debug(`Sharing keys with newly created Olm sessions in ${this.roomId}`),await this.shareKeyWithOlmSessions(e,t,r,l),H.logger.debug(`Shared keys with newly created Olm sessions in ${this.roomId}`)}async shareKeyWithOlmSessions(e,t,r,i){const s=this.splitDevices(i);for(let o=0;o<s.length;o++){const a=`megolm keys for ${e.sessionId} in ${this.roomId} (slice ${o+1}/${s.length})`;try{H.logger.debug(`Sharing ${a}`,s[o].map(l=>`${l.userId}/${l.deviceInfo.deviceId}`)),await this.encryptAndSendKeysToDevices(e,t.chain_index,s[o],r),H.logger.debug(`Shared ${a}`)}catch(l){throw H.logger.error(`Failed to share ${a}`),l}}}async notifyFailedOlmDevices(e,t,r){H.logger.debug(`Notifying ${r.length} devices we failed to create Olm sessions in ${this.roomId}`);for(const{userId:o,deviceInfo:a}of r){const l=a.deviceId;e.markSharedWithDevice(o,l,a.getIdentityKey(),t.chain_index)}const i=await this.olmDevice.filterOutNotifiedErrorDevices(r);H.logger.debug(`Need to notify ${i.length} failed devices which haven't been notified before in ${this.roomId}`);const s={};for(const{userId:o,deviceInfo:a}of i)s[o]=s[o]||{},s[o][a.deviceId]={device:{code:"m.no_olm",reason:Fg.WITHHELD_MESSAGES["m.no_olm"],deviceInfo:a}};await this.notifyBlockedDevices(e,s),H.logger.debug(`Notified ${i.length} devices we failed to create Olm sessions in ${this.roomId}`)}async notifyBlockedDevices(e,t){const r={room_id:this.roomId,session_id:e.sessionId,algorithm:et.MEGOLM_ALGORITHM,sender_key:this.olmDevice.deviceCurve25519Key},i=this.splitDevices(t);for(let s=0;s<i.length;s++)try{await this.sendBlockedNotificationsToDevices(e,i[s],r),H.logger.log(`Completed blacklist notification for ${e.sessionId} in ${this.roomId} (slice ${s+1}/${i.length})`)}catch(o){throw H.logger.log(`blacklist notification for ${e.sessionId} in ${this.roomId} (slice ${s+1}/${i.length}) failed`),o}}prepareToEncrypt(e){if(this.encryptionPreparation){const t=Date.now()-this.encryptionPreparationMetadata.startTime;H.logger.debug(`Already started preparing to encrypt for ${this.roomId} ${t} ms ago, skipping`);return}H.logger.debug(`Preparing to encrypt events for ${this.roomId}`),this.encryptionPreparationMetadata={startTime:Date.now()},this.encryptionPreparation=(async()=>{try{H.logger.debug(`Getting devices in ${this.roomId}`);const[t,r]=await this.getDevicesInRoom(e);this.crypto.getGlobalErrorOnUnknownDevices()&&this.removeUnknownDevices(t),H.logger.debug(`Ensuring outbound session in ${this.roomId}`),await this.ensureOutboundSession(e,t,r,!0),H.logger.debug(`Ready to encrypt events for ${this.roomId}`)}catch(t){H.logger.error(`Failed to prepare to encrypt events for ${this.roomId}`,t)}finally{delete this.encryptionPreparationMetadata,delete this.encryptionPreparation}})()}async encryptMessage(e,t,r){if(H.logger.log(`Starting to encrypt event for ${this.roomId}`),this.encryptionPreparation)try{await this.encryptionPreparation}catch{}const[i,s]=await this.getDevicesInRoom(e);this.crypto.getGlobalErrorOnUnknownDevices()&&this.checkForUnknownDevices(i);const o=await this.ensureOutboundSession(e,i,s),a={room_id:this.roomId,type:t,content:r},l=this.olmDevice.encryptGroupMessage(o.sessionId,JSON.stringify(a)),u={algorithm:et.MEGOLM_ALGORITHM,sender_key:this.olmDevice.deviceCurve25519Key,ciphertext:l,session_id:o.sessionId,device_id:this.deviceId};return o.useCount++,u}forceDiscardSession(){this.setupPromise=this.setupPromise.then(()=>null)}checkForUnknownDevices(e){const t={};if(Object.keys(e).forEach(r=>{Object.keys(e[r]).forEach(i=>{const s=e[r][i];s.isUnverified()&&!s.isKnown()&&(t[r]||(t[r]={}),t[r][i]=s)})}),Object.keys(t).length)throw new Wn.UnknownDeviceError("This room contains unknown devices which have not been verified. We strongly recommend you verify them before continuing.",t)}removeUnknownDevices(e){for(const[t,r]of Object.entries(e)){for(const[i,s]of Object.entries(r))s.isUnverified()&&!s.isKnown()&&delete r[i];Object.keys(r).length===0&&delete e[t]}}async getDevicesInRoom(e){const r=(await e.getEncryptionTargetMembers()).map(function(a){return a.userId});let i=this.crypto.getGlobalBlacklistUnverifiedDevices();typeof e.getBlacklistUnverifiedDevices()=="boolean"&&(i=e.getBlacklistUnverifiedDevices());const s=await this.crypto.downloadKeys(r,!1),o={};for(const a in s){if(!s.hasOwnProperty(a))continue;const l=s[a];for(const u in l){if(!l.hasOwnProperty(u))continue;const c=this.crypto.checkDeviceTrust(a,u);if(l[u].isBlocked()||!c.isVerified()&&i){o[a]||(o[a]={});const g=l[u].isBlocked();o[a][u]={code:g?"m.blacklisted":"m.unverified",reason:Fg.WITHHELD_MESSAGES[g?"m.blacklisted":"m.unverified"],deviceInfo:l[u]},delete l[u]}}}return[s,o]}}class bC extends Wn.DecryptionAlgorithm{constructor(...e){super(...e);(0,xr.default)(this,"pendingEvents",{}),(0,xr.default)(this,"olmlib",et)}async decryptEvent(e){const t=e.getWireContent();if(!t.sender_key||!t.session_id||!t.ciphertext)throw new Wn.DecryptionError("MEGOLM_MISSING_FIELDS","Missing fields in input");this.addEventToPendingList(e);let r;try{r=await this.olmDevice.decryptGroupMessage(e.getRoomId(),t.sender_key,t.session_id,t.ciphertext,e.getId(),e.getTs())}catch(s){if(s.name==="DecryptionError")throw s;let o="OLM_DECRYPT_GROUP_MESSAGE_ERROR";throw s&&s.message==="OLM.UNKNOWN_MESSAGE_INDEX"&&(this.requestKeysForEvent(e),o="OLM_UNKNOWN_MESSAGE_INDEX"),new Wn.DecryptionError(o,s?s.toString():"Unknown Error: Error is undefined",{session:t.sender_key+"|"+t.session_id})}if(r===null){this.requestKeysForEvent(e);const s=await this.olmDevice.sessionMayHaveProblems(t.sender_key,e.getTs()-12e4);if(s){let o=qg[s.type]||qg.unknown;throw s.fixed&&(o+=" Trying to create a new secure channel and re-requesting the keys."),new Wn.DecryptionError("MEGOLM_UNKNOWN_INBOUND_SESSION_ID",o,{session:t.sender_key+"|"+t.session_id})}throw new Wn.DecryptionError("MEGOLM_UNKNOWN_INBOUND_SESSION_ID","The sender's device has not sent us the keys for this message.",{session:t.sender_key+"|"+t.session_id})}this.removeEventFromPendingList(e);const i=JSON.parse(r.result);if(i.room_id!==e.getRoomId())throw new Wn.DecryptionError("MEGOLM_BAD_ROOM","Message intended for room "+i.room_id);return{clearEvent:i,senderCurve25519Key:r.senderKey,claimedEd25519Key:r.keysClaimed.ed25519,forwardingCurve25519KeyChain:r.forwardingCurve25519KeyChain,untrusted:r.untrusted}}requestKeysForEvent(e){const t=e.getWireContent(),r=e.getKeyRequestRecipients(this.userId);this.crypto.requestRoomKey({room_id:e.getRoomId(),algorithm:t.algorithm,sender_key:t.sender_key,session_id:t.session_id},r)}addEventToPendingList(e){const t=e.getWireContent(),r=t.sender_key,i=t.session_id;this.pendingEvents[r]||(this.pendingEvents[r]=new Map);const s=this.pendingEvents[r];s.has(i)||s.set(i,new Set),s.get(i).add(e)}removeEventFromPendingList(e){const t=e.getWireContent(),r=t.sender_key,i=t.session_id,s=this.pendingEvents[r],o=s==null?void 0:s.get(i);!o||(o.delete(e),o.size===0&&s.delete(i),s.size===0&&delete this.pendingEvents[r])}onRoomKeyEvent(e){const t=e.getContent(),r=t.session_id;let i=e.getSenderKey(),s=[],o=!1,a;if(!t.room_id||!r||!t.session_key){H.logger.error("key event is missing fields");return}if(!i){H.logger.error("key event has no sender key (not encrypted?)");return}if(e.getType()=="m.forwarded_room_key"){if(o=!0,s=t.forwarding_curve25519_key_chain,Array.isArray(s)||(s=[]),s=s.slice(),s.push(i),i=t.sender_key,!i){H.logger.error("forwarded_room_key event is missing sender_key field");return}const u=t.sender_claimed_ed25519_key;if(!u){H.logger.error("forwarded_room_key_event is missing sender_claimed_ed25519_key field");return}a={ed25519:u}}else a=e.getKeysClaimed();const l={};return t["org.matrix.msc3061.shared_history"]&&(l.sharedHistory=!0),this.olmDevice.addInboundGroupSession(t.room_id,i,s,r,t.session_key,a,o,l).then(()=>{this.retryDecryption(i,r).then(u=>{u&&this.crypto.cancelRoomKeyRequest({algorithm:t.algorithm,room_id:t.room_id,session_id:t.session_id,sender_key:i})})}).then(()=>{this.crypto.backupManager.backupGroupSession(i,t.session_id)}).catch(u=>{H.logger.error(`Error handling m.room_key_event: ${u}`)})}async onRoomKeyWithheldEvent(e){const t=e.getContent(),r=t.sender_key;if(t.code==="m.no_olm"){const i=e.getSender();if(H.logger.warn(`${i}:${r} was unable to establish an olm session with us`),await this.olmDevice.getSessionIdForDevice(r)){H.logger.debug("New session already created. Not creating a new one."),await this.olmDevice.recordSessionProblem(r,"no_olm",!0),this.retryDecryptionFromSender(r);return}let s=this.crypto.deviceList.getDeviceByIdentityKey(t.algorithm,r);if(!s&&(await this.crypto.downloadKeys([i],!1),s=this.crypto.deviceList.getDeviceByIdentityKey(t.algorithm,r),!s)){H.logger.info("Couldn't find device for identity key "+r+": not establishing session"),await this.olmDevice.recordSessionProblem(r,"no_olm",!1),this.retryDecryptionFromSender(r);return}await et.ensureOlmSessionsForDevices(this.olmDevice,this.baseApis,{[i]:[s]},!1);const o={algorithm:et.OLM_ALGORITHM,sender_key:this.olmDevice.deviceCurve25519Key,ciphertext:{}};await et.encryptMessageForDevice(o.ciphertext,this.userId,void 0,this.olmDevice,i,s,{type:"m.dummy"}),await this.olmDevice.recordSessionProblem(r,"no_olm",!0),this.retryDecryptionFromSender(r),await this.baseApis.sendToDevice("m.room.encrypted",{[i]:{[s.deviceId]:o}})}else await this.olmDevice.addInboundGroupSessionWithheld(t.room_id,r,t.session_id,t.code,t.reason)}hasKeysForKeyRequest(e){const t=e.requestBody;return this.olmDevice.hasInboundSessionKeys(t.room_id,t.sender_key,t.session_id)}shareKeysWithDevice(e){const t=e.userId,r=e.deviceId,i=this.crypto.getStoredDevice(t,r),s=e.requestBody;this.olmlib.ensureOlmSessionsForDevices(this.olmDevice,this.baseApis,{[t]:[i]}).then(o=>o[t][r].sessionId?(H.logger.log("sharing keys for session "+s.sender_key+"|"+s.session_id+" with device "+t+":"+r),this.buildKeyForwardingMessage(s.room_id,s.sender_key,s.session_id)):null).then(o=>{const a={algorithm:et.OLM_ALGORITHM,sender_key:this.olmDevice.deviceCurve25519Key,ciphertext:{}};return this.olmlib.encryptMessageForDevice(a.ciphertext,this.userId,void 0,this.olmDevice,t,i,o).then(()=>{const l={[t]:{[r]:a}};return this.baseApis.sendToDevice("m.room.encrypted",l)})})}async buildKeyForwardingMessage(e,t,r){const i=await this.olmDevice.getInboundGroupSessionKey(e,t,r);return{type:"m.forwarded_room_key",content:{algorithm:et.MEGOLM_ALGORITHM,room_id:e,sender_key:t,sender_claimed_ed25519_key:i.sender_claimed_ed25519_key,session_id:r,session_key:i.key,chain_index:i.chain_index,forwarding_curve25519_key_chain:i.forwarding_curve25519_key_chain,"org.matrix.msc3061.shared_history":i.shared_history||!1}}}importRoomKey(e,t={}){const r={};return(t.untrusted||e.untrusted)&&(r.untrusted=!0),e["org.matrix.msc3061.shared_history"]&&(r.sharedHistory=!0),this.olmDevice.addInboundGroupSession(e.room_id,e.sender_key,e.forwarding_curve25519_key_chain,e.session_id,e.session_key,e.sender_claimed_keys,!0,r).then(()=>{t.source!=="backup"&&this.crypto.backupManager.backupGroupSession(e.sender_key,e.session_id).catch(i=>{H.logger.log("Failed to back up megolm session",i)}),this.retryDecryption(e.sender_key,e.session_id)})}async retryDecryption(e,t){var r;const i=this.pendingEvents[e];if(!i)return!0;const s=i.get(t);return s?(H.logger.debug("Retrying decryption on events",[...s]),await Promise.all([...s].map(async o=>{try{await o.attemptDecryption(this.crypto,{isRetry:!0})}catch{}})),!((r=this.pendingEvents[e])!==null&&r!==void 0&&r.has(t))):!0}async retryDecryptionFromSender(e){const t=this.pendingEvents[e];return t?(delete this.pendingEvents[e],await Promise.all([...t].map(async([r,i])=>{await Promise.all([...i].map(async s=>{try{await s.attemptDecryption(this.crypto)}catch{}}))})),!this.pendingEvents[e]):!0}async sendSharedHistoryInboundSessions(e){await et.ensureOlmSessionsForDevices(this.olmDevice,this.baseApis,e),H.logger.log("sendSharedHistoryInboundSessions to users",Object.keys(e));const t=await this.olmDevice.getSharedHistoryInboundGroupSessions(this.roomId);H.logger.log("shared-history sessions",t);for(const[r,i]of t){const s=await this.buildKeyForwardingMessage(this.roomId,r,i),o=[],a={};for(const[l,u]of Object.entries(e)){a[l]={};for(const c of u){const g={algorithm:et.OLM_ALGORITHM,sender_key:this.olmDevice.deviceCurve25519Key,ciphertext:{}};a[l][c.deviceId]=g,o.push(et.encryptMessageForDevice(g.ciphertext,this.userId,void 0,this.olmDevice,l,c,s))}}await Promise.all(o);for(const l of Object.keys(a)){for(const u of Object.keys(a[l]))Object.keys(a[l][u].ciphertext).length===0&&(H.logger.log("No ciphertext for device "+l+":"+u+": pruning"),delete a[l][u]);Object.keys(a[l]).length===0&&(H.logger.log("Pruned all devices for user "+l),delete a[l])}if(Object.keys(a).length===0){H.logger.log("No users left to send to: aborting");return}await this.baseApis.sendToDevice("m.room.encrypted",a)}}}const qg={no_olm:"The sender was unable to establish a secure channel.",unknown:"The secure channel with the sender was corrupted."};(0,Wn.registerAlgorithm)(et.MEGOLM_ALGORITHM,SC,bC);(function(n){Object.defineProperty(n,"__esModule",{value:!0});var e=_t;Object.keys(e).forEach(function(t){t==="default"||t==="__esModule"||t in n&&n[t]===e[t]||Object.defineProperty(n,t,{enumerable:!0,get:function(){return e[t]}})})})(Rf);var wC=G.exports;Object.defineProperty(Es,"__esModule",{value:!0});Es.WITHHELD_MESSAGES=Es.OlmDevice=void 0;var Ri=wC(Y.exports),rt=se,be=Br,jg=RC(Rf);function l_(n){if(typeof WeakMap!="function")return null;var e=new WeakMap,t=new WeakMap;return(l_=function(r){return r?t:e})(n)}function RC(n,e){if(!e&&n&&n.__esModule)return n;if(n===null||typeof n!="object"&&typeof n!="function")return{default:n};var t=l_(e);if(t&&t.has(n))return t.get(n);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in n)if(s!=="default"&&Object.prototype.hasOwnProperty.call(n,s)){var o=i?Object.getOwnPropertyDescriptor(n,s):null;o&&(o.get||o.set)?Object.defineProperty(r,s,o):r[s]=n[s]}return r.default=n,t&&t.set(n,r),r}const Vg=65536*3/4;function Gg(n){if(n===void 0)throw new Error("payloadString undefined");if(n.length>Vg){const e=new Error("Message too long ("+n.length+" bytes). The maximum for an encrypted message is "+Vg+" bytes.");throw e.data={errcode:"M_TOO_LARGE",error:"Payload too large for encrypted message"},e}}class IC{constructor(e){this.cryptoStore=e,(0,Ri.default)(this,"pickleKey","DEFAULT_KEY"),(0,Ri.default)(this,"deviceCurve25519Key",null),(0,Ri.default)(this,"deviceEd25519Key",null),(0,Ri.default)(this,"maxOneTimeKeys",null),(0,Ri.default)(this,"outboundGroupSessionStore",{}),(0,Ri.default)(this,"inboundGroupSessionMessageIndexes",{}),(0,Ri.default)(this,"sessionsInProgress",{}),(0,Ri.default)(this,"olmPrekeyPromise",Promise.resolve())}static getOlmVersion(){return V.Olm.get_library_version()}async init({pickleKey:e,fromExportedDevice:t}={}){let r;const i=new V.Olm.Account;try{t?(e&&rt.logger.warn("ignoring opts.pickleKey because opts.fromExportedDevice is present."),this.pickleKey=t.pickleKey,await this.initialiseFromExportedDevice(t,i)):(e&&(this.pickleKey=e),await this.initialiseAccount(i)),r=JSON.parse(i.identity_keys()),this.maxOneTimeKeys=i.max_number_of_one_time_keys()}finally{i.free()}this.deviceCurve25519Key=r.curve25519,this.deviceEd25519Key=r.ed25519}async initialiseFromExportedDevice(e,t){await this.cryptoStore.doTxn("readwrite",[be.IndexedDBCryptoStore.STORE_ACCOUNT,be.IndexedDBCryptoStore.STORE_SESSIONS],r=>{this.cryptoStore.storeAccount(r,e.pickledAccount),e.sessions.forEach(i=>{const{deviceKey:s,sessionId:o}=i,a={session:i.session,lastReceivedMessageTs:i.lastReceivedMessageTs};this.cryptoStore.storeEndToEndSession(s,o,a,r)})}),t.unpickle(this.pickleKey,e.pickledAccount)}async initialiseAccount(e){await this.cryptoStore.doTxn("readwrite",[be.IndexedDBCryptoStore.STORE_ACCOUNT],t=>{this.cryptoStore.getAccount(t,r=>{r!==null?e.unpickle(this.pickleKey,r):(e.create(),r=e.pickle(this.pickleKey),this.cryptoStore.storeAccount(t,r))})})}getAccount(e,t){this.cryptoStore.getAccount(e,r=>{const i=new V.Olm.Account;try{i.unpickle(this.pickleKey,r),t(i)}finally{i.free()}})}storeAccount(e,t){this.cryptoStore.storeAccount(e,t.pickle(this.pickleKey))}async export(){const e={pickleKey:this.pickleKey};return await this.cryptoStore.doTxn("readonly",[be.IndexedDBCryptoStore.STORE_ACCOUNT,be.IndexedDBCryptoStore.STORE_SESSIONS],t=>{this.cryptoStore.getAccount(t,r=>{e.pickledAccount=r}),e.sessions=[],this.cryptoStore.getAllEndToEndSessions(t,r=>{e.sessions.push(r)})}),e}getSession(e,t,r,i){this.cryptoStore.getEndToEndSession(e,t,r,s=>{this.unpickleSession(s,i)})}unpickleSession(e,t){const r=new V.Olm.Session;try{r.unpickle(this.pickleKey,e.session);const i=Object.assign({},e,{session:r});t(i)}finally{r.free()}}saveSession(e,t,r){const i=t.session.session_id(),s=Object.assign(t,{session:t.session.pickle(this.pickleKey)});this.cryptoStore.storeEndToEndSession(e,i,s,r)}getUtility(e){const t=new V.Olm.Utility;try{return e(t)}finally{t.free()}}async sign(e){let t;return await this.cryptoStore.doTxn("readonly",[be.IndexedDBCryptoStore.STORE_ACCOUNT],r=>{this.getAccount(r,i=>{t=i.sign(e)})}),t}async getOneTimeKeys(){let e;return await this.cryptoStore.doTxn("readonly",[be.IndexedDBCryptoStore.STORE_ACCOUNT],t=>{this.getAccount(t,r=>{e=JSON.parse(r.one_time_keys())})}),e}maxNumberOfOneTimeKeys(){return this.maxOneTimeKeys}async markKeysAsPublished(){await this.cryptoStore.doTxn("readwrite",[be.IndexedDBCryptoStore.STORE_ACCOUNT],e=>{this.getAccount(e,t=>{t.mark_keys_as_published(),this.storeAccount(e,t)})})}generateOneTimeKeys(e){return this.cryptoStore.doTxn("readwrite",[be.IndexedDBCryptoStore.STORE_ACCOUNT],t=>{this.getAccount(t,r=>{r.generate_one_time_keys(e),this.storeAccount(t,r)})})}async generateFallbackKey(){await this.cryptoStore.doTxn("readwrite",[be.IndexedDBCryptoStore.STORE_ACCOUNT],e=>{this.getAccount(e,t=>{t.generate_fallback_key(),this.storeAccount(e,t)})})}async getFallbackKey(){let e;return await this.cryptoStore.doTxn("readonly",[be.IndexedDBCryptoStore.STORE_ACCOUNT],t=>{this.getAccount(t,r=>{e=JSON.parse(r.unpublished_fallback_key())})}),e}async forgetOldFallbackKey(){await this.cryptoStore.doTxn("readwrite",[be.IndexedDBCryptoStore.STORE_ACCOUNT],e=>{this.getAccount(e,t=>{t.forget_old_fallback_key(),this.storeAccount(e,t)})})}async createOutboundSession(e,t){let r;return await this.cryptoStore.doTxn("readwrite",[be.IndexedDBCryptoStore.STORE_ACCOUNT,be.IndexedDBCryptoStore.STORE_SESSIONS],i=>{this.getAccount(i,s=>{const o=new V.Olm.Session;try{o.create_outbound(s,e,t),r=o.session_id(),this.storeAccount(i,s);const a={session:o,lastReceivedMessageTs:Date.now()};this.saveSession(e,a,i)}finally{o.free()}})},rt.logger.withPrefix("[createOutboundSession]")),r}async createInboundSession(e,t,r){if(t!==0)throw new Error("Need messageType == 0 to create inbound session");let i;return await this.cryptoStore.doTxn("readwrite",[be.IndexedDBCryptoStore.STORE_ACCOUNT,be.IndexedDBCryptoStore.STORE_SESSIONS],s=>{this.getAccount(s,o=>{const a=new V.Olm.Session;try{a.create_inbound_from(o,e,r),o.remove_one_time_keys(a),this.storeAccount(s,o);const l=a.decrypt(t,r),u={session:a,lastReceivedMessageTs:Date.now()};this.saveSession(e,u,s),i={payload:l,session_id:a.session_id()}}finally{a.free()}})},rt.logger.withPrefix("[createInboundSession]")),i}async getSessionIdsForDevice(e){const t=rt.logger.withPrefix("[getSessionIdsForDevice]");if(this.sessionsInProgress[e]){t.debug(`Waiting for Olm session for ${e} to be created`);try{await this.sessionsInProgress[e]}catch{}}let r;return await this.cryptoStore.doTxn("readonly",[be.IndexedDBCryptoStore.STORE_SESSIONS],i=>{this.cryptoStore.getEndToEndSessions(e,i,s=>{r=Object.keys(s)})},t),r}async getSessionIdForDevice(e,t=!1,r){const i=await this.getSessionInfoForDevice(e,t,r);if(i.length===0)return null;let s=0;for(let o=1;o<i.length;o++){const a=i[o],l=a.lastReceivedMessageTs===void 0?0:a.lastReceivedMessageTs,u=i[s],c=u.lastReceivedMessageTs===void 0?0:u.lastReceivedMessageTs;(l>c||l===c&&a.sessionId<u.sessionId)&&(s=o)}return i[s].sessionId}async getSessionInfoForDevice(e,t=!1,r=rt.logger){if(r=r.withPrefix("[getSessionInfoForDevice]"),this.sessionsInProgress[e]&&!t){r.debug(`Waiting for Olm session for ${e} to be created`);try{await this.sessionsInProgress[e]}catch{}}const i=[];return await this.cryptoStore.doTxn("readonly",[be.IndexedDBCryptoStore.STORE_SESSIONS],s=>{this.cryptoStore.getEndToEndSessions(e,s,o=>{const a=Object.keys(o).sort();for(const l of a)this.unpickleSession(o[l],u=>{i.push({lastReceivedMessageTs:u.lastReceivedMessageTs,hasReceivedMessage:u.session.has_received_message(),sessionId:l})})})},r),i}async encryptMessage(e,t,r){Gg(r);let i;return await this.cryptoStore.doTxn("readwrite",[be.IndexedDBCryptoStore.STORE_SESSIONS],s=>{this.getSession(e,t,s,o=>{const a=o.session.describe();rt.logger.log("encryptMessage: Olm Session ID "+t+" to "+e+": "+a),i=o.session.encrypt(r),this.saveSession(e,o,s)})},rt.logger.withPrefix("[encryptMessage]")),i}async decryptMessage(e,t,r,i){let s;return await this.cryptoStore.doTxn("readwrite",[be.IndexedDBCryptoStore.STORE_SESSIONS],o=>{this.getSession(e,t,o,a=>{const l=a.session.describe();rt.logger.log("decryptMessage: Olm Session ID "+t+" from "+e+": "+l),s=a.session.decrypt(r,i),a.lastReceivedMessageTs=Date.now(),this.saveSession(e,a,o)})},rt.logger.withPrefix("[decryptMessage]")),s}async matchesSession(e,t,r,i){if(r!==0)return!1;let s;return await this.cryptoStore.doTxn("readonly",[be.IndexedDBCryptoStore.STORE_SESSIONS],o=>{this.getSession(e,t,o,a=>{s=a.session.matches_inbound(i)})},rt.logger.withPrefix("[matchesSession]")),s}async recordSessionProblem(e,t,r){await this.cryptoStore.storeEndToEndSessionProblem(e,t,r)}async sessionMayHaveProblems(e,t){return await this.cryptoStore.getEndToEndSessionProblem(e,t)}async filterOutNotifiedErrorDevices(e){return await this.cryptoStore.filterOutNotifiedErrorDevices(e)}saveOutboundGroupSession(e){this.outboundGroupSessionStore[e.session_id()]=e.pickle(this.pickleKey)}getOutboundGroupSession(e,t){const r=this.outboundGroupSessionStore[e];if(r===void 0)throw new Error("Unknown outbound group session "+e);const i=new V.Olm.OutboundGroupSession;try{return i.unpickle(this.pickleKey,r),t(i)}finally{i.free()}}createOutboundGroupSession(){const e=new V.Olm.OutboundGroupSession;try{return e.create(),this.saveOutboundGroupSession(e),e.session_id()}finally{e.free()}}encryptGroupMessage(e,t){return rt.logger.log(`encrypting msg with megolm session ${e}`),Gg(t),this.getOutboundGroupSession(e,r=>{const i=r.encrypt(t);return this.saveOutboundGroupSession(r),i})}getOutboundGroupSessionKey(e){return this.getOutboundGroupSession(e,function(t){return{chain_index:t.message_index(),key:t.session_key()}})}unpickleInboundGroupSession(e,t){const r=new V.Olm.InboundGroupSession;try{return r.unpickle(this.pickleKey,e.session),t(r)}finally{r.free()}}getInboundGroupSession(e,t,r,i,s){this.cryptoStore.getEndToEndInboundGroupSession(t,r,i,(o,a)=>{if(o===null){s(null,null,a);return}if(e!==null&&e!==o.room_id)throw new Error("Mismatched room_id for inbound group session (expected "+o.room_id+", was "+e+")");this.unpickleInboundGroupSession(o,l=>{s(l,o,a)})})}async addInboundGroupSession(e,t,r,i,s,o,a,l={}){await this.cryptoStore.doTxn("readwrite",[be.IndexedDBCryptoStore.STORE_INBOUND_GROUP_SESSIONS,be.IndexedDBCryptoStore.STORE_INBOUND_GROUP_SESSIONS_WITHHELD,be.IndexedDBCryptoStore.STORE_SHARED_HISTORY_INBOUND_GROUP_SESSIONS],u=>{this.getInboundGroupSession(e,t,i,u,(c,g)=>{const m=new V.Olm.InboundGroupSession;try{if(a?m.import_session(s):m.create(s),i!=m.session_id())throw new Error("Mismatched group session ID from senderKey: "+t);if(c&&(rt.logger.log("Update for megolm session "+t+"/"+i),c.first_known_index()<=m.first_known_index()&&!(c.first_known_index()==m.first_known_index()&&!l.untrusted&&g.untrusted))){rt.logger.log(`Keeping existing megolm session ${i}`);return}rt.logger.info("Storing megolm session "+t+"/"+i+" with first index "+m.first_known_index());const f=Object.assign({},l,{room_id:e,session:m.pickle(this.pickleKey),keysClaimed:o,forwardingCurve25519KeyChain:r});this.cryptoStore.storeEndToEndInboundGroupSession(t,i,f,u),!c&&l.sharedHistory&&this.cryptoStore.addSharedHistoryInboundGroupSession(e,t,i,u)}finally{m.free()}})},rt.logger.withPrefix("[addInboundGroupSession]"))}async addInboundGroupSessionWithheld(e,t,r,i,s){await this.cryptoStore.doTxn("readwrite",[be.IndexedDBCryptoStore.STORE_INBOUND_GROUP_SESSIONS_WITHHELD],o=>{this.cryptoStore.storeEndToEndInboundGroupSessionWithheld(t,r,{room_id:e,code:i,reason:s},o)})}async decryptGroupMessage(e,t,r,i,s,o){let a,l;if(await this.cryptoStore.doTxn("readwrite",[be.IndexedDBCryptoStore.STORE_INBOUND_GROUP_SESSIONS,be.IndexedDBCryptoStore.STORE_INBOUND_GROUP_SESSIONS_WITHHELD],u=>{this.getInboundGroupSession(e,t,r,u,(c,g,m)=>{if(c===null){m&&(l=new jg.DecryptionError("MEGOLM_UNKNOWN_INBOUND_SESSION_ID",Wg(m),{session:t+"|"+r})),a=null;return}let f;try{f=c.decrypt(i)}catch(I){I&&I.message==="OLM.UNKNOWN_MESSAGE_INDEX"&&m?l=new jg.DecryptionError("MEGOLM_UNKNOWN_INBOUND_SESSION_ID",Wg(m),{session:t+"|"+r}):l=I;return}let E=f.plaintext;if(E===void 0)E=f;else{const I=t+"|"+r+"|"+f.message_index;if(I in this.inboundGroupSessionMessageIndexes){const w=this.inboundGroupSessionMessageIndexes[I];if(w.id!==s||w.timestamp!==o){l=new Error("Duplicate message index, possible replay attack: "+I);return}}this.inboundGroupSessionMessageIndexes[I]={id:s,timestamp:o}}g.session=c.pickle(this.pickleKey),this.cryptoStore.storeEndToEndInboundGroupSession(t,r,g,u),a={result:E,keysClaimed:g.keysClaimed||{},senderKey:t,forwardingCurve25519KeyChain:g.forwardingCurve25519KeyChain||[],untrusted:g.untrusted}})},rt.logger.withPrefix("[decryptGroupMessage]")),l)throw l;return a}async hasInboundSessionKeys(e,t,r){let i;return await this.cryptoStore.doTxn("readonly",[be.IndexedDBCryptoStore.STORE_INBOUND_GROUP_SESSIONS,be.IndexedDBCryptoStore.STORE_INBOUND_GROUP_SESSIONS_WITHHELD],s=>{this.cryptoStore.getEndToEndInboundGroupSession(t,r,s,o=>{if(o===null){i=!1;return}e!==o.room_id?(rt.logger.warn(`requested keys for inbound group session ${t}|${r}, with incorrect room_id (expected ${o.room_id}, was ${e})`),i=!1):i=!0})},rt.logger.withPrefix("[hasInboundSessionKeys]")),i}async getInboundGroupSessionKey(e,t,r,i){let s;return await this.cryptoStore.doTxn("readonly",[be.IndexedDBCryptoStore.STORE_INBOUND_GROUP_SESSIONS,be.IndexedDBCryptoStore.STORE_INBOUND_GROUP_SESSIONS_WITHHELD],o=>{this.getInboundGroupSession(e,t,r,o,(a,l)=>{if(a===null){s=null;return}i===void 0&&(i=a.first_known_index());const u=a.export_session(i),g=(l.keysClaimed||{}).ed25519||null;s={chain_index:i,key:u,forwarding_curve25519_key_chain:l.forwardingCurve25519KeyChain||[],sender_claimed_ed25519_key:g,shared_history:l.sharedHistory||!1}})},rt.logger.withPrefix("[getInboundGroupSessionKey]")),s}exportInboundGroupSession(e,t,r){return this.unpickleInboundGroupSession(r,i=>{const s=i.first_known_index();return{sender_key:e,sender_claimed_keys:r.keysClaimed,room_id:r.room_id,session_id:t,session_key:i.export_session(s),forwarding_curve25519_key_chain:r.forwardingCurve25519KeyChain||[],first_known_index:i.first_known_index(),"org.matrix.msc3061.shared_history":r.sharedHistory||!1}})}async getSharedHistoryInboundGroupSessions(e){let t;return await this.cryptoStore.doTxn("readonly",[be.IndexedDBCryptoStore.STORE_SHARED_HISTORY_INBOUND_GROUP_SESSIONS],r=>{t=this.cryptoStore.getSharedHistoryInboundGroupSessions(e,r)},rt.logger.withPrefix("[getSharedHistoryInboundGroupSessionsForRoom]")),t}verifySignature(e,t,r){this.getUtility(function(i){i.ed25519_verify(e,t,r)})}}Es.OlmDevice=IC;const Mh={"m.unverified":"The sender has disabled encrypting to unverified devices.","m.blacklisted":"The sender has blocked you.","m.unauthorised":"You are not authorised to read the message.","m.no_olm":"Unable to establish a secure channel."};Es.WITHHELD_MESSAGES=Mh;function Wg(n){return n.code&&n.code in Mh?Mh[n.code]:n.reason?n.reason:"decryption key withheld"}var Ss={},Pt={},li={};Object.defineProperty(li,"__esModule",{value:!0});li.calculateKeyCheck=AC;li.decryptAES=PC;li.encryptAES=f_;var Tf=W,Sn=xe;const bn=typeof window!="undefined"&&window.crypto?window.crypto.subtle||window.crypto.webkitSubtle:null,u_=new Uint8Array(8);async function TC(n,e,t,r){const i=(0,Tf.getCrypto)();if(!i)throw new Error("No usable crypto implementation");let s;r?s=(0,Sn.decodeBase64)(r):(s=i.randomBytes(16),s[8]&=127);const[o,a]=d_(e,t),l=i.createCipheriv("aes-256-ctr",o,s),u=Buffer.concat([l.update(n,"utf8"),l.final()]),c=i.createHmac("sha256",a).update(u).digest("base64");return{iv:(0,Sn.encodeBase64)(s),ciphertext:u.toString("base64"),mac:c}}async function OC(n,e,t){const r=(0,Tf.getCrypto)();if(!r)throw new Error("No usable crypto implementation");const[i,s]=d_(e,t);if(r.createHmac("sha256",s).update(Buffer.from(n.ciphertext,"base64")).digest("base64").replace(/=+$/g,"")!==n.mac.replace(/=+$/g,""))throw new Error(`Error decrypting secret ${t}: bad MAC`);const a=r.createDecipheriv("aes-256-ctr",i,(0,Sn.decodeBase64)(n.iv));return a.update(n.ciphertext,"base64","utf8")+a.final("utf8")}function d_(n,e){const t=(0,Tf.getCrypto)(),r=t.createHmac("sha256",u_).update(n).digest(),i=Buffer.alloc(1,1),s=t.createHmac("sha256",r).update(e,"utf8").update(i).digest();i[0]=2;const o=t.createHmac("sha256",r).update(s).update(e,"utf8").update(i).digest();return[s,o]}async function kC(n,e,t,r){let i;r?i=(0,Sn.decodeBase64)(r):(i=new Uint8Array(16),window.crypto.getRandomValues(i),i[8]&=127);const[s,o]=await h_(e,t),a=new TextEncoder().encode(n),l=await bn.encrypt({name:"AES-CTR",counter:i,length:64},s,a),u=await bn.sign({name:"HMAC"},o,l);return{iv:(0,Sn.encodeBase64)(i),ciphertext:(0,Sn.encodeBase64)(l),mac:(0,Sn.encodeBase64)(u)}}async function CC(n,e,t){const[r,i]=await h_(e,t),s=(0,Sn.decodeBase64)(n.ciphertext);if(!await bn.verify({name:"HMAC"},i,(0,Sn.decodeBase64)(n.mac),s))throw new Error(`Error decrypting secret ${t}: bad MAC`);const o=await bn.decrypt({name:"AES-CTR",counter:(0,Sn.decodeBase64)(n.iv),length:64},r,s);return new TextDecoder().decode(new Uint8Array(o))}async function h_(n,e){const t=await bn.importKey("raw",n,{name:"HKDF"},!1,["deriveBits"]),r=await bn.deriveBits({name:"HKDF",salt:u_,info:new TextEncoder().encode(e),hash:"SHA-256"},t,512),i=r.slice(0,32),s=r.slice(32),o=bn.importKey("raw",i,{name:"AES-CTR"},!1,["encrypt","decrypt"]),a=bn.importKey("raw",s,{name:"HMAC",hash:{name:"SHA-256"}},!1,["sign","verify"]);return await Promise.all([o,a])}function f_(n,e,t,r){return bn?kC(n,e,t,r):TC(n,e,t,r)}function PC(n,e,t){return bn?CC(n,e,t):OC(n,e,t)}const MC="\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0";function AC(n,e){return f_(MC,n,"",e)}var DC=G.exports;Object.defineProperty(Pt,"__esModule",{value:!0});Pt.UserTrustLevel=Pt.DeviceTrustLevel=Pt.CrossSigningLevel=Pt.CrossSigningInfo=void 0;Pt.createCryptoStoreCacheCallbacks=$C;Pt.requestKeysDuringVerification=NC;var sd=DC(Y.exports),ir=xe,Kt=se,Hg=Br,Yg=li;const xC=1e3*60;function Ac(n){return Object.values(n.keys)[0]}class ou{constructor(e,t={},r={}){this.userId=e,this.callbacks=t,this.cacheCallbacks=r,(0,sd.default)(this,"keys",{}),(0,sd.default)(this,"firstUse",!0),(0,sd.default)(this,"crossSigningVerifiedBefore",!1)}static fromStorage(e,t){const r=new ou(t);for(const i in e)e.hasOwnProperty(i)&&(r[i]=e[i]);return r}toStorage(){return{keys:this.keys,firstUse:this.firstUse,crossSigningVerifiedBefore:this.crossSigningVerifiedBefore}}async getCrossSigningKey(e,t){const r=["master","self_signing","user_signing"].indexOf(e)>=0;if(!this.callbacks.getCrossSigningKey)throw new Error("No getCrossSigningKey callback supplied");t===void 0&&(t=this.getId(e));function i(l){if(!l)return;const u=new V.Olm.PkSigning,c=u.init_with_seed(l);if(c===t)return[c,u];u.free()}let s;this.cacheCallbacks.getCrossSigningKeyCache&&r&&(s=await this.cacheCallbacks.getCrossSigningKeyCache(e,t));const o=i(s);if(o)return o;s=await this.callbacks.getCrossSigningKey(e,t);const a=i(s);if(a)return this.cacheCallbacks.storeCrossSigningKeyCache&&r&&await this.cacheCallbacks.storeCrossSigningKeyCache(e,s),a;throw s?new Error("Key type "+e+" from getCrossSigningKey callback did not match"):new Error("getCrossSigningKey callback for "+e+" returned falsey")}async isStoredInSecretStorage(e){const t=await e.isStored("m.cross_signing.master",!1)||{};function r(i){for(const s of Object.keys(t))i[s]||delete t[s]}for(const i of["self_signing","user_signing"])r(await e.isStored(`m.cross_signing.${i}`,!1)||{});return Object.keys(t).length?t:null}static async storeInSecretStorage(e,t){for(const[r,i]of e){const s=(0,ir.encodeBase64)(i);await t.store(`m.cross_signing.${r}`,s)}}static async getFromSecretStorage(e,t){const r=await t.get(`m.cross_signing.${e}`);return r?(0,ir.decodeBase64)(r):null}async isStoredInKeyCache(e){const t=this.cacheCallbacks;if(!t)return!1;const r=e?[e]:["master","self_signing","user_signing"];for(const i of r)if(!await t.getCrossSigningKeyCache(i))return!1;return!0}async getCrossSigningKeysFromCache(){const e=new Map,t=this.cacheCallbacks;if(!t)return e;for(const r of["master","self_signing","user_signing"]){const i=await t.getCrossSigningKeyCache(r);!i||e.set(r,i)}return e}getId(e="master"){if(!this.keys[e])return null;const t=this.keys[e];return Ac(t)}async resetKeys(e){if(!this.callbacks.saveCrossSigningKeys)throw new Error("No saveCrossSigningKeys callback supplied");if(e===void 0||e&yn.MASTER||!this.keys.master)e=yn.MASTER|yn.USER_SIGNING|yn.SELF_SIGNING;else if(e===0)return;const t={},r={};let i,s;try{if(e&yn.MASTER?(i=new V.Olm.PkSigning,t.master=i.generate_seed(),s=i.init_with_seed(t.master),r.master={user_id:this.userId,usage:["master"],keys:{["ed25519:"+s]:s}}):[s,i]=await this.getCrossSigningKey("master"),e&yn.SELF_SIGNING){const o=new V.Olm.PkSigning;try{t.self_signing=o.generate_seed();const a=o.init_with_seed(t.self_signing);r.self_signing={user_id:this.userId,usage:["self_signing"],keys:{["ed25519:"+a]:a}},(0,ir.pkSign)(r.self_signing,i,this.userId,s)}finally{o.free()}}if(e&yn.USER_SIGNING){const o=new V.Olm.PkSigning;try{t.user_signing=o.generate_seed();const a=o.init_with_seed(t.user_signing);r.user_signing={user_id:this.userId,usage:["user_signing"],keys:{["ed25519:"+a]:a}},(0,ir.pkSign)(r.user_signing,i,this.userId,s)}finally{o.free()}}Object.assign(this.keys,r),this.callbacks.saveCrossSigningKeys(t)}finally{i&&i.free()}}clearKeys(){this.keys={}}setKeys(e){const t={};if(e.master){if(e.master.user_id!==this.userId){const i="Mismatched user ID "+e.master.user_id+" in master key from "+this.userId;throw Kt.logger.error(i),new Error(i)}this.keys.master?Ac(e.master)!==this.getId()&&(this.firstUse=!1):this.firstUse=!0,t.master=e.master}else if(this.keys.master)t.master=this.keys.master;else throw new Error("Tried to set cross-signing keys without a master key");const r=Ac(t.master);if(e.user_signing){if(e.user_signing.user_id!==this.userId){const i="Mismatched user ID "+e.master.user_id+" in user_signing key from "+this.userId;throw Kt.logger.error(i),new Error(i)}try{(0,ir.pkVerify)(e.user_signing,r,this.userId)}catch(i){throw Kt.logger.error("invalid signature on user-signing key"),i}}if(e.self_signing){if(e.self_signing.user_id!==this.userId){const i="Mismatched user ID "+e.master.user_id+" in self_signing key from "+this.userId;throw Kt.logger.error(i),new Error(i)}try{(0,ir.pkVerify)(e.self_signing,r,this.userId)}catch(i){throw Kt.logger.error("invalid signature on self-signing key"),i}}e.master&&(this.keys.master=e.master,this.keys.self_signing=null,this.keys.user_signing=null),e.self_signing&&(this.keys.self_signing=e.self_signing),e.user_signing&&(this.keys.user_signing=e.user_signing)}updateCrossSigningVerifiedBefore(e){!this.crossSigningVerifiedBefore&&e&&(this.crossSigningVerifiedBefore=!0)}async signObject(e,t){if(!this.keys[t])throw new Error("Attempted to sign with "+t+" key but no such key present");const[r,i]=await this.getCrossSigningKey(t);try{return(0,ir.pkSign)(e,i,this.userId,r),e}finally{i.free()}}async signUser(e){if(!this.keys.user_signing){Kt.logger.info("No user signing key: not signing user");return}return this.signObject(e.keys.master,"user_signing")}async signDevice(e,t){if(e!==this.userId)throw new Error(`Trying to sign ${e}'s device; can only sign our own device`);if(!this.keys.self_signing){Kt.logger.info("No self signing key: not signing device");return}return this.signObject({algorithms:t.algorithms,keys:t.keys,device_id:t.deviceId,user_id:e},"self_signing")}checkUserTrust(e){if(this.userId===e.userId&&this.getId()&&this.getId()===e.getId()&&this.getId("self_signing")&&this.getId("self_signing")===e.getId("self_signing"))return new ol(!0,!0,this.firstUse);if(!this.keys.user_signing)return new ol(!1,!1,e.firstUse);let t;const r=e.keys.master,i=this.getId("user_signing");try{(0,ir.pkVerify)(r,i,this.userId),t=!0}catch{t=!1}return new ol(t,e.crossSigningVerifiedBefore,e.firstUse)}checkDeviceTrust(e,t,r,i){const s=this.checkUserTrust(e),o=e.keys.self_signing;if(!o)return new _o(!1,!1,r,i);const a=UC(t,e.userId);try{return(0,ir.pkVerify)(o,e.getId(),e.userId),(0,ir.pkVerify)(a,Ac(o),e.userId),_o.fromUserTrustLevel(s,r,i)}catch{return new _o(!1,!1,r,i)}}getCacheCallbacks(){return this.cacheCallbacks}}Pt.CrossSigningInfo=ou;function UC(n,e){return{algorithms:n.algorithms,keys:n.keys,device_id:n.deviceId,user_id:e,signatures:n.signatures}}let yn;Pt.CrossSigningLevel=yn;(function(n){n[n.MASTER=4]="MASTER",n[n.USER_SIGNING=2]="USER_SIGNING",n[n.SELF_SIGNING=1]="SELF_SIGNING"})(yn||(Pt.CrossSigningLevel=yn={}));class ol{constructor(e,t,r){this.crossSigningVerified=e,this.crossSigningVerifiedBefore=t,this.tofu=r}isVerified(){return this.isCrossSigningVerified()}isCrossSigningVerified(){return this.crossSigningVerified}wasCrossSigningVerified(){return this.crossSigningVerifiedBefore}isTofu(){return this.tofu}}Pt.UserTrustLevel=ol;class _o{constructor(e,t,r,i){this.crossSigningVerified=e,this.tofu=t,this.localVerified=r,this.trustCrossSignedDevices=i}static fromUserTrustLevel(e,t,r){return new _o(e.isCrossSigningVerified(),e.isTofu(),t,r)}isVerified(){return Boolean(this.isLocallyVerified()||this.trustCrossSignedDevices&&this.isCrossSigningVerified())}isCrossSigningVerified(){return this.crossSigningVerified}isLocallyVerified(){return this.localVerified}isTofu(){return this.tofu}}Pt.DeviceTrustLevel=_o;function $C(n,e){return{getCrossSigningKeyCache:async function(t,r){const i=await new Promise(s=>n.doTxn("readonly",[Hg.IndexedDBCryptoStore.STORE_ACCOUNT],o=>{n.getSecretStorePrivateKey(o,s,t)}));if(i&&i.ciphertext){const s=Buffer.from(e.pickleKey),o=await(0,Yg.decryptAES)(i,s,t);return(0,ir.decodeBase64)(o)}else return i},storeCrossSigningKeyCache:async function(t,r){if(!(r instanceof Uint8Array))throw new Error(`storeCrossSigningKeyCache expects Uint8Array, got ${r}`);const i=Buffer.from(e.pickleKey),s=await(0,Yg.encryptAES)((0,ir.encodeBase64)(r),i,t);return n.doTxn("readwrite",[Hg.IndexedDBCryptoStore.STORE_ACCOUNT],o=>{n.storeSecretStorePrivateKey(o,t,s)})}}}function NC(n,e,t){if(n.getUserId()===e)return Kt.logger.log("Cross-signing: Self-verification done; requesting keys"),new Promise((r,i)=>{const s=n,o=s.crypto.crossSigningInfo,a=new ou(o.userId,{getCrossSigningKey:async c=>{Kt.logger.debug("Cross-signing: requesting secret",c,t);const{promise:g}=s.requestSecret(`m.cross_signing.${c}`,[t]),m=await g,f=(0,ir.decodeBase64)(m);return Uint8Array.from(f)}},o.getCacheCallbacks());a.keys=o.keys;const l=new Promise(c=>{setTimeout(c,xC,new Error("Timeout"))}),u=(async()=>{if(!await s.crypto.getSessionBackupPrivateKey()){Kt.logger.info("No cached backup key found. Requesting...");const m=await s.requestSecret("m.megolm_backup.v1",[t]).promise;Kt.logger.info("Got key backup key, decoding...");const f=(0,ir.decodeBase64)(m);Kt.logger.info("Decoded backup key, storing..."),await s.crypto.storeSessionBackupPrivateKey(Uint8Array.from(f)),Kt.logger.info("Backup key stored. Starting backup restore...");const E=await s.getKeyBackupVersion();s.restoreKeyBackupWithCache(void 0,void 0,E).then(()=>{Kt.logger.info("Backup restored.")})}})();return Promise.race([Promise.all([a.getCrossSigningKey("master"),a.getCrossSigningKey("self_signing"),a.getCrossSigningKey("user_signing"),u]),l]).then(r,i)}).catch(r=>{Kt.logger.warn("Cross-signing: failure while requesting keys:",r)})}var LC=G.exports;Object.defineProperty(Ss,"__esModule",{value:!0});Ss.TrackingStatus=Ss.DeviceList=void 0;var vt=LC(Y.exports),Ue=se,xa=xs,p_=Pt,Ah=KC(xe),zg=Br,od=W,BC=je,Dh=Ft;function g_(n){if(typeof WeakMap!="function")return null;var e=new WeakMap,t=new WeakMap;return(g_=function(r){return r?t:e})(n)}function KC(n,e){if(!e&&n&&n.__esModule)return n;if(n===null||typeof n!="object"&&typeof n!="function")return{default:n};var t=g_(e);if(t&&t.has(n))return t.get(n);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in n)if(s!=="default"&&Object.prototype.hasOwnProperty.call(n,s)){var o=i?Object.getOwnPropertyDescriptor(n,s):null;o&&(o.get||o.set)?Object.defineProperty(r,s,o):r[s]=n[s]}return r.default=n,t&&t.set(n,r),r}let Ct;Ss.TrackingStatus=Ct;(function(n){n[n.NotTracked=0]="NotTracked",n[n.PendingDownload=1]="PendingDownload",n[n.DownloadInProgress=2]="DownloadInProgress",n[n.UpToDate=3]="UpToDate"})(Ct||(Ss.TrackingStatus=Ct={}));class FC extends BC.TypedEventEmitter{constructor(e,t,r,i=250){super();this.cryptoStore=t,this.keyDownloadChunkSize=i,(0,vt.default)(this,"devices",{}),(0,vt.default)(this,"crossSigningInfo",{}),(0,vt.default)(this,"userByIdentityKey",{}),(0,vt.default)(this,"deviceTrackingStatus",{}),(0,vt.default)(this,"syncToken",null),(0,vt.default)(this,"keyDownloadsInProgressByUser",{}),(0,vt.default)(this,"dirty",!1),(0,vt.default)(this,"savePromise",null),(0,vt.default)(this,"resolveSavePromise",null),(0,vt.default)(this,"savePromiseTime",null),(0,vt.default)(this,"saveTimer",null),(0,vt.default)(this,"hasFetched",null),(0,vt.default)(this,"serialiser",void 0),this.serialiser=new qC(e,r,this)}async load(){await this.cryptoStore.doTxn("readonly",[zg.IndexedDBCryptoStore.STORE_DEVICE_DATA],e=>{this.cryptoStore.getEndToEndDeviceData(e,t=>{this.hasFetched=Boolean(t&&t.devices),this.devices=t?t.devices:{},this.crossSigningInfo=t?t.crossSigningInfo||{}:{},this.deviceTrackingStatus=t?t.trackingStatus:{},this.syncToken=t?t.syncToken:null,this.userByIdentityKey={};for(const r of Object.keys(this.devices)){const i=this.devices[r];for(const s of Object.keys(i)){const o=i[s].keys["curve25519:"+s];o!==void 0&&(this.userByIdentityKey[o]=r)}}})});for(const e of Object.keys(this.deviceTrackingStatus))this.deviceTrackingStatus[e]==Ct.DownloadInProgress&&(this.deviceTrackingStatus[e]=Ct.PendingDownload)}stop(){this.saveTimer!==null&&clearTimeout(this.saveTimer)}async saveIfDirty(e=500){if(!this.dirty)return Promise.resolve(!1);const t=Date.now()+e;this.savePromiseTime&&t<this.savePromiseTime&&(clearTimeout(this.saveTimer),this.saveTimer=null,this.savePromiseTime=null);let r=this.savePromise;if(r===null&&(r=new Promise((i,s)=>{this.resolveSavePromise=i}),this.savePromise=r),this.saveTimer===null){const i=this.resolveSavePromise;this.savePromiseTime=t,this.saveTimer=setTimeout(()=>{Ue.logger.log("Saving device tracking data",this.syncToken),this.savePromiseTime=null,this.saveTimer=null,this.savePromise=null,this.resolveSavePromise=null,this.cryptoStore.doTxn("readwrite",[zg.IndexedDBCryptoStore.STORE_DEVICE_DATA],s=>{this.cryptoStore.storeEndToEndDeviceData({devices:this.devices,crossSigningInfo:this.crossSigningInfo,trackingStatus:this.deviceTrackingStatus,syncToken:this.syncToken},s)}).then(()=>{this.dirty=!1,i(!0)},s=>{Ue.logger.error("Failed to save device tracking data",this.syncToken),Ue.logger.error(s)})},e)}return r}getSyncToken(){return this.syncToken}setSyncToken(e){this.syncToken=e}downloadKeys(e,t){const r=[],i=[];if(e.forEach(s=>{const o=this.deviceTrackingStatus[s];this.keyDownloadsInProgressByUser[s]?(Ue.logger.log(`downloadKeys: already have a download in progress for ${s}: awaiting its result`),i.push(this.keyDownloadsInProgressByUser[s])):(t||o!=Ct.UpToDate)&&r.push(s)}),r.length!=0){Ue.logger.log("downloadKeys: downloading for",r);const s=this.doKeyDownload(r);i.push(s)}return i.length===0&&Ue.logger.log("downloadKeys: already have all necessary keys"),Promise.all(i).then(()=>this.getDevicesFromStore(e))}getDevicesFromStore(e){const t={};return e.map(r=>{t[r]={},(this.getStoredDevicesForUser(r)||[]).map(function(s){t[r][s.deviceId]=s})}),t}getKnownUserIds(){return Object.keys(this.devices)}getStoredDevicesForUser(e){const t=this.devices[e];if(!t)return null;const r=[];for(const i in t)t.hasOwnProperty(i)&&r.push(xa.DeviceInfo.fromStorage(t[i],i));return r}getRawStoredDevicesForUser(e){return this.devices[e]}getStoredCrossSigningForUser(e){return this.crossSigningInfo[e]?p_.CrossSigningInfo.fromStorage(this.crossSigningInfo[e],e):null}storeCrossSigningForUser(e,t){this.crossSigningInfo[e]=t,this.dirty=!0}getStoredDevice(e,t){const r=this.devices[e];if(!(!r||!r[t]))return xa.DeviceInfo.fromStorage(r[t],t)}getUserByIdentityKey(e,t){return e!==Ah.OLM_ALGORITHM&&e!==Ah.MEGOLM_ALGORITHM?null:this.userByIdentityKey[t]}getDeviceByIdentityKey(e,t){const r=this.getUserByIdentityKey(e,t);if(!r)return null;const i=this.devices[r];if(!i)return null;for(const s in i){if(!i.hasOwnProperty(s))continue;const o=i[s];for(const a in o.keys){if(!o.keys.hasOwnProperty(a)||a.indexOf("curve25519:")!==0)continue;if(o.keys[a]==t)return xa.DeviceInfo.fromStorage(o,s)}}return null}storeDevicesForUser(e,t){this.setRawStoredDevicesForUser(e,t),this.dirty=!0}startTrackingDeviceList(e){if(typeof e!="string")throw new Error("userId must be a string; was "+e);this.deviceTrackingStatus[e]||(Ue.logger.log("Now tracking device list for "+e),this.deviceTrackingStatus[e]=Ct.PendingDownload,this.dirty=!0)}stopTrackingDeviceList(e){this.deviceTrackingStatus[e]&&(Ue.logger.log("No longer tracking device list for "+e),this.deviceTrackingStatus[e]=Ct.NotTracked,this.dirty=!0)}stopTrackingAllDeviceLists(){for(const e of Object.keys(this.deviceTrackingStatus))this.deviceTrackingStatus[e]=Ct.NotTracked;this.dirty=!0}invalidateUserDeviceList(e){this.deviceTrackingStatus[e]&&(Ue.logger.log("Marking device list outdated for",e),this.deviceTrackingStatus[e]=Ct.PendingDownload,this.dirty=!0)}refreshOutdatedDeviceLists(){this.saveIfDirty();const e=[];for(const t of Object.keys(this.deviceTrackingStatus))this.deviceTrackingStatus[t]==Ct.PendingDownload&&e.push(t);return this.doKeyDownload(e)}setRawStoredDevicesForUser(e,t){if(this.devices[e]!==void 0)for(const[r,i]of Object.entries(this.devices[e])){const s=i.keys["curve25519:"+r];delete this.userByIdentityKey[s]}this.devices[e]=t;for(const[r,i]of Object.entries(t)){const s=i.keys["curve25519:"+r];this.userByIdentityKey[s]=e}}setRawStoredCrossSigningForUser(e,t){this.crossSigningInfo[e]=t}doKeyDownload(e){if(e.length===0)return Promise.resolve();const t=this.serialiser.updateDevicesForUsers(e,this.syncToken).then(()=>{r(!0)},i=>{throw Ue.logger.error("Error downloading keys for "+e+":",i),r(!1),i});e.forEach(i=>{this.keyDownloadsInProgressByUser[i]=t,this.deviceTrackingStatus[i]==Ct.PendingDownload&&(this.deviceTrackingStatus[i]=Ct.DownloadInProgress)});const r=i=>{this.emit(Dh.CryptoEvent.WillUpdateDevices,e,!this.hasFetched),e.forEach(s=>{if(this.dirty=!0,this.keyDownloadsInProgressByUser[s]!==t){Ue.logger.log("Another update in the queue for",s,"- not marking up-to-date");return}delete this.keyDownloadsInProgressByUser[s],this.deviceTrackingStatus[s]==Ct.DownloadInProgress&&(i?(this.deviceTrackingStatus[s]=Ct.UpToDate,Ue.logger.log("Device list for",s,"now up to date")):this.deviceTrackingStatus[s]=Ct.PendingDownload)}),this.saveIfDirty(),this.emit(Dh.CryptoEvent.DevicesUpdated,e,!this.hasFetched),this.hasFetched=!0};return t}}Ss.DeviceList=FC;class qC{constructor(e,t,r){this.baseApis=e,this.olmDevice=t,this.deviceList=r,(0,vt.default)(this,"downloadInProgress",!1),(0,vt.default)(this,"keyDownloadsQueuedByUser",{}),(0,vt.default)(this,"queuedQueryDeferred",null),(0,vt.default)(this,"syncToken",null)}updateDevicesForUsers(e,t){return e.forEach(r=>{this.keyDownloadsQueuedByUser[r]=!0}),this.queuedQueryDeferred||(this.queuedQueryDeferred=(0,od.defer)()),this.syncToken=t,this.downloadInProgress?(Ue.logger.log("Queued key download for",e),this.queuedQueryDeferred.promise):this.doQueuedQueries()}doQueuedQueries(){if(this.downloadInProgress)throw new Error("DeviceListUpdateSerialiser.doQueuedQueries called with request active");const e=Object.keys(this.keyDownloadsQueuedByUser);this.keyDownloadsQueuedByUser={};const t=this.queuedQueryDeferred;this.queuedQueryDeferred=null,Ue.logger.log("Starting key download for",e),this.downloadInProgress=!0;const r={};this.syncToken&&(r.token=this.syncToken);const i=[];for(let s=0;s<e.length;s+=this.deviceList.keyDownloadChunkSize){const o=e.slice(s,s+this.deviceList.keyDownloadChunkSize);i.push(()=>this.baseApis.downloadKeysForUsers(o,r))}return(0,od.chunkPromises)(i,3).then(async s=>{const o=Object.assign({},...s.map(c=>c.device_keys||{})),a=Object.assign({},...s.map(c=>c.master_keys||{})),l=Object.assign({},...s.map(c=>c.self_signing_keys||{})),u=Object.assign({},...s.map(c=>c.user_signing_keys||{}));for(const c of e){await(0,od.sleep)(5);try{await this.processQueryResponseForUser(c,o[c],{master:a[c],self_signing:l[c],user_signing:u[c]})}catch(g){Ue.logger.error(`Error processing keys for ${c}:`,g)}}}).then(()=>{Ue.logger.log("Completed key download for "+e),this.downloadInProgress=!1,t.resolve(),this.queuedQueryDeferred&&this.doQueuedQueries()},s=>{Ue.logger.warn("Error downloading keys for "+e+":",s),this.downloadInProgress=!1,t.reject(s)}),t.promise}async processQueryResponseForUser(e,t,r){Ue.logger.log("got device keys for "+e+":",t),Ue.logger.log("got cross-signing keys for "+e+":",r);{const i={},s=this.deviceList.getRawStoredDevicesForUser(e);s&&Object.keys(s).forEach(a=>{const l=xa.DeviceInfo.fromStorage(s[a],a);i[a]=l}),await jC(this.olmDevice,e,i,t||{},this.baseApis.getUserId(),this.baseApis.deviceId);const o={};Object.keys(i).forEach(a=>{o[a]=i[a].toStorage()}),this.deviceList.setRawStoredDevicesForUser(e,o)}if(r&&(r.master||r.self_signing||r.user_signing)){const i=this.deviceList.getStoredCrossSigningForUser(e)||new p_.CrossSigningInfo(e);i.setKeys(r),this.deviceList.setRawStoredCrossSigningForUser(e,i.toStorage()),this.deviceList.emit(Dh.CryptoEvent.UserCrossSigningUpdated,e)}}}async function jC(n,e,t,r,i,s){let o=!1;for(const a in t)if(!!t.hasOwnProperty(a)&&!(a in r)){if(e===i&&a===s){Ue.logger.warn(`Local device ${a} missing from sync, skipping removal`);continue}Ue.logger.log("Device "+e+":"+a+" has been removed"),delete t[a],o=!0}for(const a in r){if(!r.hasOwnProperty(a))continue;const l=r[a];if(l.user_id!==e){Ue.logger.warn("Mismatched user_id "+l.user_id+" in keys from "+e+":"+a);continue}if(l.device_id!==a){Ue.logger.warn("Mismatched device_id "+l.device_id+" in keys from "+e+":"+a);continue}await VC(n,t,l)&&(o=!0)}return o}async function VC(n,e,t){if(!t.keys)return!1;const r=t.device_id,i=t.user_id,s="ed25519:"+r,o=t.keys[s];if(!o)return Ue.logger.warn("Device "+i+":"+r+" has no ed25519 key"),!1;const a=t.unsigned||{},l=t.signatures||{};try{await Ah.verifySignature(n,t,i,r,o)}catch(c){return Ue.logger.warn("Unable to verify signature on device "+i+":"+r+":"+c),!1}let u;if(r in e){if(u=e[r],u.getFingerprint()!=o)return Ue.logger.warn("Ed25519 key for device "+i+":"+r+" has changed"),!1}else e[r]=u=new xa.DeviceInfo(r);return u.keys=t.keys||{},u.algorithms=t.algorithms||[],u.unsigned=a,u.signatures=l,!0}var To={},GC=G.exports;Object.defineProperty(To,"__esModule",{value:!0});To.EncryptionSetupOperation=To.EncryptionSetupBuilder=void 0;var vn=GC(Y.exports),WC=se,HC=jt,YC=Pt,zC=Br,Dc=me,JC=Cs,XC=je;class QC{constructor(e,t){(0,vn.default)(this,"accountDataClientAdapter",void 0),(0,vn.default)(this,"crossSigningCallbacks",void 0),(0,vn.default)(this,"ssssCryptoCallbacks",void 0),(0,vn.default)(this,"crossSigningKeys",null),(0,vn.default)(this,"keySignatures",null),(0,vn.default)(this,"keyBackupInfo",null),(0,vn.default)(this,"sessionBackupPrivateKey",void 0),this.accountDataClientAdapter=new ZC(e),this.crossSigningCallbacks=new eP,this.ssssCryptoCallbacks=new tP(t)}addCrossSigningKeys(e,t){this.crossSigningKeys={authUpload:e,keys:t}}addSessionBackup(e){this.keyBackupInfo=e}addSessionBackupPrivateKeyToCache(e){this.sessionBackupPrivateKey=e}addKeySignature(e,t,r){this.keySignatures||(this.keySignatures={});const i=this.keySignatures[e]||{};this.keySignatures[e]=i,i[t]=r}async setAccountData(e,t){await this.accountDataClientAdapter.setAccountData(e,t)}buildOperation(){const e=this.accountDataClientAdapter.values;return new m_(e,this.crossSigningKeys,this.keyBackupInfo,this.keySignatures)}async persist(e){if(this.crossSigningKeys){const t=(0,YC.createCryptoStoreCacheCallbacks)(e.cryptoStore,e.olmDevice);for(const r of["master","self_signing","user_signing"]){WC.logger.log(`Cache ${r} cross-signing private key locally`);const i=this.crossSigningCallbacks.privateKeys.get(r);await t.storeCrossSigningKeyCache(r,i)}await e.cryptoStore.doTxn("readwrite",[zC.IndexedDBCryptoStore.STORE_ACCOUNT],r=>{e.cryptoStore.storeCrossSigningKeys(r,this.crossSigningKeys.keys)})}this.sessionBackupPrivateKey&&await e.storeSessionBackupPrivateKey(this.sessionBackupPrivateKey)}}To.EncryptionSetupBuilder=QC;class m_{constructor(e,t,r,i){this.accountData=e,this.crossSigningKeys=t,this.keyBackupInfo=r,this.keySignatures=i}async apply(e){const t=e.baseApis;if(this.crossSigningKeys){const r={};for(const[i,s]of Object.entries(this.crossSigningKeys.keys))r[i+"_key"]=s;await this.crossSigningKeys.authUpload(i=>t.uploadDeviceSigningKeys(i,r)),e.crossSigningInfo.setKeys(this.crossSigningKeys.keys)}if(this.accountData)for(const[r,i]of this.accountData)await t.setAccountData(r,i);this.keySignatures&&await t.uploadKeySignatures(this.keySignatures),this.keyBackupInfo&&(this.keyBackupInfo.version?await t.http.authedRequest(void 0,Dc.Method.Put,"/room_keys/version/"+this.keyBackupInfo.version,void 0,{algorithm:this.keyBackupInfo.algorithm,auth_data:this.keyBackupInfo.auth_data},{prefix:Dc.PREFIX_UNSTABLE}):await t.http.authedRequest(void 0,Dc.Method.Post,"/room_keys/version",void 0,this.keyBackupInfo,{prefix:Dc.PREFIX_UNSTABLE}))}}To.EncryptionSetupOperation=m_;class ZC extends XC.TypedEventEmitter{constructor(e){super();this.existingValues=e,(0,vn.default)(this,"values",new Map)}getAccountDataFromServer(e){return Promise.resolve(this.getAccountData(e))}getAccountData(e){const t=this.values.get(e);if(t)return t;const r=this.existingValues[e];return r?r.getContent():null}setAccountData(e,t){const r=this.values.get(e);return this.values.set(e,t),Promise.resolve().then(()=>{const i=new HC.MatrixEvent({type:e,content:t});return this.emit(JC.ClientEvent.AccountData,i,r),{}})}}class eP{constructor(){(0,vn.default)(this,"privateKeys",new Map)}getCrossSigningKeyCache(e,t){return this.getCrossSigningKey(e,t)}storeCrossSigningKeyCache(e,t){return this.privateKeys.set(e,t),Promise.resolve()}getCrossSigningKey(e,t){return Promise.resolve(this.privateKeys.get(e))}saveCrossSigningKeys(e){for(const[t,r]of Object.entries(e))this.privateKeys.set(t,r)}}class tP{constructor(e){this.delegateCryptoCallbacks=e,(0,vn.default)(this,"privateKeys",new Map)}async getSecretStorageKey({keys:e},t){var r;for(const i of Object.keys(e)){const s=this.privateKeys.get(i);if(s)return[i,s]}if(this!==null&&this!==void 0&&(r=this.delegateCryptoCallbacks)!==null&&r!==void 0&&r.getSecretStorageKey){const i=await this.delegateCryptoCallbacks.getSecretStorageKey({keys:e},t);if(i){const[s,o]=i;this.privateKeys.set(s,o)}return i}return null}addPrivateKey(e,t,r){var i,s;this.privateKeys.set(e,r),(i=this.delegateCryptoCallbacks)===null||i===void 0||(s=i.cacheSecretStorageKey)===null||s===void 0||s.call(i,e,t,r)}}var Oo={},rP=G.exports;Object.defineProperty(Oo,"__esModule",{value:!0});Oo.SecretStorage=Oo.SECRET_STORAGE_ALGORITHM_V1_AES=void 0;var nP=rP(Y.exports),cn=se,na=sP(xe),iP=ai,xc=li,ad=Cs;function y_(n){if(typeof WeakMap!="function")return null;var e=new WeakMap,t=new WeakMap;return(y_=function(r){return r?t:e})(n)}function sP(n,e){if(!e&&n&&n.__esModule)return n;if(n===null||typeof n!="object"&&typeof n!="function")return{default:n};var t=y_(e);if(t&&t.has(n))return t.get(n);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in n)if(s!=="default"&&Object.prototype.hasOwnProperty.call(n,s)){var o=i?Object.getOwnPropertyDescriptor(n,s):null;o&&(o.get||o.set)?Object.defineProperty(r,s,o):r[s]=n[s]}return r.default=n,t&&t.set(n,r),r}const Zi="m.secret_storage.v1.aes-hmac-sha2";Oo.SECRET_STORAGE_ALGORITHM_V1_AES=Zi;class oP{constructor(e,t,r){this.accountDataAdapter=e,this.cryptoCallbacks=t,this.baseApis=r,(0,nP.default)(this,"requests",new Map)}async getDefaultKeyId(){const e=await this.accountDataAdapter.getAccountDataFromServer("m.secret_storage.default_key");return e?e.key:null}setDefaultKeyId(e){return new Promise((t,r)=>{const i=s=>{s.getType()==="m.secret_storage.default_key"&&s.getContent().key===e&&(this.accountDataAdapter.removeListener(ad.ClientEvent.AccountData,i),t())};this.accountDataAdapter.on(ad.ClientEvent.AccountData,i),this.accountDataAdapter.setAccountData("m.secret_storage.default_key",{key:e}).catch(s=>{this.accountDataAdapter.removeListener(ad.ClientEvent.AccountData,i),r(s)})})}async addKey(e,t,r){const i={algorithm:e};if(t||(t={}),t.name&&(i.name=t.name),e===Zi){if(t.passphrase&&(i.passphrase=t.passphrase),t.key){const{iv:s,mac:o}=await(0,xc.calculateKeyCheck)(t.key);i.iv=s,i.mac=o}}else throw new Error(`Unknown key algorithm ${e}`);if(!r)do r=(0,iP.randomString)(32);while(await this.accountDataAdapter.getAccountDataFromServer(`m.secret_storage.key.${r}`));return await this.accountDataAdapter.setAccountData(`m.secret_storage.key.${r}`,i),{keyId:r,keyInfo:i}}async getKey(e){if(e||(e=await this.getDefaultKeyId()),!e)return null;const t=await this.accountDataAdapter.getAccountDataFromServer("m.secret_storage.key."+e);return t?[e,t]:null}async hasKey(e){return Boolean(await this.getKey(e))}async checkKey(e,t){if(t.algorithm===Zi)if(t.mac){const{mac:r}=await(0,xc.calculateKeyCheck)(e,t.iv);return t.mac.replace(/=+$/g,"")===r.replace(/=+$/g,"")}else return!0;else throw new Error("Unknown algorithm")}async store(e,t,r){const i={};if(!r){const s=await this.getDefaultKeyId();if(!s)throw new Error("No keys specified and no default key present");r=[s]}if(r.length===0)throw new Error("Zero keys given to encrypt with!");for(const s of r){const o=await this.accountDataAdapter.getAccountDataFromServer("m.secret_storage.key."+s);if(!o)throw new Error("Unknown key: "+s);if(o.algorithm===Zi){const a={[s]:o},[,l]=await this.getSecretStorageKey(a,e);i[s]=await l.encrypt(t)}else cn.logger.warn("unknown algorithm for secret storage key "+s+": "+o.algorithm)}await this.accountDataAdapter.setAccountData(e,{encrypted:i})}async get(e){const t=await this.accountDataAdapter.getAccountDataFromServer(e);if(!t)return;if(!t.encrypted)throw new Error("Content is not encrypted!");const r={};for(const o of Object.keys(t.encrypted)){const a=await this.accountDataAdapter.getAccountDataFromServer("m.secret_storage.key."+o),l=t.encrypted[o];a.algorithm===Zi&&l.iv&&l.ciphertext&&l.mac&&(r[o]=a)}if(Object.keys(r).length===0)throw new Error(`Could not decrypt ${e} because none of the keys it is encrypted with are for a supported algorithm`);let i,s;try{[i,s]=await this.getSecretStorageKey(r,e);const o=t.encrypted[i];return o.passthrough?(0,na.encodeBase64)(s.get_private_key()):await s.decrypt(o)}finally{s&&s.free&&s.free()}}async isStored(e,t){const r=await this.accountDataAdapter.getAccountDataFromServer(e);if(!r||!r.encrypted)return null;const i={};for(const s of Object.keys(r.encrypted)){const o=await this.accountDataAdapter.getAccountDataFromServer("m.secret_storage.key."+s);if(!o)continue;const a=r.encrypted[s];o.algorithm===Zi&&a.iv&&a.ciphertext&&a.mac&&(i[s]=o)}return Object.keys(i).length?i:null}request(e,t){const r=this.baseApis.makeTxnId();let i,s;const o=new Promise((c,g)=>{i=c,s=g});this.requests.set(r,{name:e,devices:t,resolve:i,reject:s});const a=c=>{const g={action:"request_cancellation",requesting_device_id:this.baseApis.deviceId,request_id:r},m={};for(const f of t)m[f]=g;this.baseApis.sendToDevice("m.secret.request",{[this.baseApis.getUserId()]:m}),s(new Error(c||"Cancelled"))},l={name:e,action:"request",requesting_device_id:this.baseApis.deviceId,request_id:r},u={};for(const c of t)u[c]=l;return cn.logger.info(`Request secret ${e} from ${t}, id ${r}`),this.baseApis.sendToDevice("m.secret.request",{[this.baseApis.getUserId()]:u}),{requestId:r,promise:o,cancel:a}}async onRequestReceived(e){const t=e.getSender(),r=e.getContent();if(t!==this.baseApis.getUserId()||!(r.name&&r.action&&r.requesting_device_id&&r.request_id))return;const i=r.requesting_device_id;if(r.action!=="request_cancellation"){if(r.action==="request"){if(i===this.baseApis.deviceId||(cn.logger.info("received request for secret ("+t+", "+i+", "+r.request_id+")"),!this.cryptoCallbacks.onSecretRequested))return;const s=await this.cryptoCallbacks.onSecretRequested(t,i,r.request_id,r.name,this.baseApis.checkDeviceTrust(t,i));if(s){cn.logger.info(`Preparing ${r.name} secret for ${i}`);const o={type:"m.secret.send",content:{request_id:r.request_id,secret:s}},a={algorithm:na.OLM_ALGORITHM,sender_key:this.baseApis.crypto.olmDevice.deviceCurve25519Key,ciphertext:{}};await na.ensureOlmSessionsForDevices(this.baseApis.crypto.olmDevice,this.baseApis,{[t]:[this.baseApis.getStoredDevice(t,i)]}),await na.encryptMessageForDevice(a.ciphertext,this.baseApis.getUserId(),this.baseApis.deviceId,this.baseApis.crypto.olmDevice,t,this.baseApis.getStoredDevice(t,i),o);const l={[t]:{[i]:a}};cn.logger.info(`Sending ${r.name} secret for ${i}`),this.baseApis.sendToDevice("m.room.encrypted",l)}else cn.logger.info(`Request denied for ${r.name} secret for ${i}`)}}}onSecretReceived(e){if(e.getSender()!==this.baseApis.getUserId())return;const t=e.getContent();cn.logger.log("got secret share for request",t.request_id);const r=this.requests.get(t.request_id);if(r){const i=this.baseApis.crypto.deviceList.getDeviceByIdentityKey(na.OLM_ALGORITHM,e.getSenderKey());if(!i){cn.logger.log("secret share from unknown device with key",e.getSenderKey());return}if(!r.devices.includes(i.deviceId)){cn.logger.log("unsolicited secret share from device",i.deviceId);return}cn.logger.log(`Successfully received secret ${r.name} from ${i.deviceId}`),r.resolve(t.secret)}}async getSecretStorageKey(e,t){if(!this.cryptoCallbacks.getSecretStorageKey)throw new Error("No getSecretStorageKey callback supplied");const r=await this.cryptoCallbacks.getSecretStorageKey({keys:e},t);if(!r)throw new Error("getSecretStorageKey callback returned falsey");if(r.length<2)throw new Error("getSecretStorageKey callback returned invalid data");const[i,s]=r;if(!e[i])throw new Error("App returned unknown key from getSecretStorageKey!");if(e[i].algorithm===Zi)return[i,{encrypt:async function(a){return await(0,xc.encryptAES)(a,s,t)},decrypt:async function(a){return await(0,xc.decryptAES)(a,s,t)}}];throw new Error("Unknown key type: "+e[i].algorithm)}}Oo.SecretStorage=oP;var bs={},aP=G.exports;Object.defineProperty(bs,"__esModule",{value:!0});bs.RoomKeyRequestState=bs.OutgoingRoomKeyRequestManager=void 0;var cd=aP(Y.exports),$n=se,cP=ie;const lP=500;let Ee;bs.RoomKeyRequestState=Ee;(function(n){n[n.Unsent=0]="Unsent",n[n.Sent=1]="Sent",n[n.CancellationPending=2]="CancellationPending",n[n.CancellationPendingAndWillResend=3]="CancellationPendingAndWillResend"})(Ee||(bs.RoomKeyRequestState=Ee={}));class uP{constructor(e,t,r){this.baseApis=e,this.deviceId=t,this.cryptoStore=r,(0,cd.default)(this,"sendOutgoingRoomKeyRequestsTimer",null),(0,cd.default)(this,"sendOutgoingRoomKeyRequestsRunning",!1),(0,cd.default)(this,"clientRunning",!1)}start(){this.clientRunning=!0}stop(){$n.logger.log("stopping OutgoingRoomKeyRequestManager"),this.clientRunning=!1}sendQueuedRequests(){this.startTimer()}async queueRoomKeyRequest(e,t,r=!1){const i=await this.cryptoStore.getOutgoingRoomKeyRequest(e);if(!i)await this.cryptoStore.getOrAddOutgoingRoomKeyRequest({requestBody:e,recipients:t,requestId:this.baseApis.makeTxnId(),state:Ee.Unsent});else switch(i.state){case Ee.CancellationPendingAndWillResend:case Ee.Unsent:return;case Ee.CancellationPending:{const s=r?Ee.CancellationPendingAndWillResend:Ee.Sent;await this.cryptoStore.updateOutgoingRoomKeyRequest(i.requestId,Ee.CancellationPending,{state:s,cancellationTxnId:this.baseApis.makeTxnId()});break}case Ee.Sent:{if(r){const s=Ee.CancellationPendingAndWillResend,o=await this.cryptoStore.updateOutgoingRoomKeyRequest(i.requestId,Ee.Sent,{state:s,cancellationTxnId:this.baseApis.makeTxnId(),requestTxnId:this.baseApis.makeTxnId()});if(!o)return await this.queueRoomKeyRequest(e,t,r);try{await this.sendOutgoingRoomKeyRequestCancellation(o,!0)}catch(a){$n.logger.error("Error sending room key request cancellation; will retry later.",a)}}break}default:throw new Error("unhandled state: "+i.state)}}cancelRoomKeyRequest(e){return this.cryptoStore.getOutgoingRoomKeyRequest(e).then(t=>{if(!!t)switch(t.state){case Ee.CancellationPending:case Ee.CancellationPendingAndWillResend:return;case Ee.Unsent:return $n.logger.log("deleting unnecessary room key request for "+Uc(e)),this.cryptoStore.deleteOutgoingRoomKeyRequest(t.requestId,Ee.Unsent);case Ee.Sent:return this.cryptoStore.updateOutgoingRoomKeyRequest(t.requestId,Ee.Sent,{state:Ee.CancellationPending,cancellationTxnId:this.baseApis.makeTxnId()}).then(r=>{if(!r){$n.logger.log("Tried to cancel room key request for "+Uc(e)+" but it was already cancelled in another tab");return}this.sendOutgoingRoomKeyRequestCancellation(r).catch(i=>{$n.logger.error("Error sending room key request cancellation; will retry later.",i),this.startTimer()})});default:throw new Error("unhandled state: "+t.state)}})}getOutgoingSentRoomKeyRequest(e,t){return this.cryptoStore.getOutgoingRoomKeyRequestsByTarget(e,t,[Ee.Sent])}async cancelAndResendAllOutgoingRequests(){const e=await this.cryptoStore.getAllOutgoingRoomKeyRequestsByState(Ee.Sent);return Promise.all(e.map(({requestBody:t,recipients:r})=>this.queueRoomKeyRequest(t,r,!0)))}startTimer(){if(this.sendOutgoingRoomKeyRequestsTimer)return;const e=()=>{if(this.sendOutgoingRoomKeyRequestsRunning)throw new Error("RoomKeyRequestSend already in progress!");this.sendOutgoingRoomKeyRequestsRunning=!0,this.sendOutgoingRoomKeyRequests().finally(()=>{this.sendOutgoingRoomKeyRequestsRunning=!1}).catch(t=>{$n.logger.warn(`error in OutgoingRoomKeyRequestManager: ${t}`)})};this.sendOutgoingRoomKeyRequestsTimer=setTimeout(e,lP)}sendOutgoingRoomKeyRequests(){return this.clientRunning?this.cryptoStore.getOutgoingRoomKeyRequestByState([Ee.CancellationPending,Ee.CancellationPendingAndWillResend,Ee.Unsent]).then(e=>{if(!e){this.sendOutgoingRoomKeyRequestsTimer=null;return}let t;switch(e.state){case Ee.Unsent:t=this.sendOutgoingRoomKeyRequest(e);break;case Ee.CancellationPending:t=this.sendOutgoingRoomKeyRequestCancellation(e);break;case Ee.CancellationPendingAndWillResend:t=this.sendOutgoingRoomKeyRequestCancellation(e,!0);break}return t.then(()=>this.sendOutgoingRoomKeyRequests()).catch(r=>{$n.logger.error("Error sending room key request; will retry later.",r),this.sendOutgoingRoomKeyRequestsTimer=null})}):(this.sendOutgoingRoomKeyRequestsTimer=null,Promise.resolve())}sendOutgoingRoomKeyRequest(e){$n.logger.log(`Requesting keys for ${Uc(e.requestBody)} from ${Jg(e.recipients)}(id ${e.requestId})`);const t={action:"request",requesting_device_id:this.deviceId,request_id:e.requestId,body:e.requestBody};return this.sendMessageToDevices(t,e.recipients,e.requestTxnId||e.requestId).then(()=>this.cryptoStore.updateOutgoingRoomKeyRequest(e.requestId,Ee.Unsent,{state:Ee.Sent}))}sendOutgoingRoomKeyRequestCancellation(e,t=!1){$n.logger.log(`Sending cancellation for key request for ${Uc(e.requestBody)} to ${Jg(e.recipients)} (cancellation id ${e.cancellationTxnId})`);const r={action:"request_cancellation",requesting_device_id:this.deviceId,request_id:e.requestId};return this.sendMessageToDevices(r,e.recipients,e.cancellationTxnId).then(()=>t?this.cryptoStore.updateOutgoingRoomKeyRequest(e.requestId,Ee.CancellationPendingAndWillResend,{state:Ee.Unsent}):this.cryptoStore.deleteOutgoingRoomKeyRequest(e.requestId,Ee.CancellationPending))}sendMessageToDevices(e,t,r){const i={};for(const s of t)i[s.userId]||(i[s.userId]={}),i[s.userId][s.deviceId]=e;return this.baseApis.sendToDevice(cP.EventType.RoomKeyRequest,i,r)}}bs.OutgoingRoomKeyRequestManager=uP;function Uc(n){return n.room_id+" / "+n.session_id}function Jg(n){return"["+n.map(e=>`${e.userId}:${e.deviceId}`).join(",")+"]"}var cr={},Xr={},Ke={};Object.defineProperty(Ke,"__esModule",{value:!0});Ke.errorFactory=ui;Ke.errorFromEvent=EP;Ke.newUserMismatchError=Ke.newUserCancelledError=Ke.newUnknownTransactionError=Ke.newUnknownMethodError=Ke.newUnexpectedMessageError=Ke.newTimeoutError=Ke.newKeyMismatchError=Ke.newInvalidMessageError=void 0;Ke.newVerificationError=v_;var dP=jt;function v_(n,e,t){const r=Object.assign({},{code:n,reason:e},t);return new dP.MatrixEvent({type:"m.key.verification.cancel",content:r})}function ui(n,e){return function(t){return v_(n,e,t)}}const hP=ui("m.user","Cancelled by user");Ke.newUserCancelledError=hP;const fP=ui("m.timeout","Timed out");Ke.newTimeoutError=fP;const pP=ui("m.unknown_transaction","Unknown transaction");Ke.newUnknownTransactionError=pP;const gP=ui("m.unknown_method","Unknown method");Ke.newUnknownMethodError=gP;const mP=ui("m.unexpected_message","Unexpected message");Ke.newUnexpectedMessageError=mP;const yP=ui("m.key_mismatch","Key mismatch");Ke.newKeyMismatchError=yP;const vP=ui("m.user_error","User mismatch");Ke.newUserMismatchError=vP;const _P=ui("m.invalid_message","Invalid message");Ke.newInvalidMessageError=_P;function EP(n){const e=n.getContent();if(e){const{code:t,reason:r}=e;return{code:t,reason:r}}else return{code:"Unknown error",reason:"m.unknown"}}var SP=G.exports;Object.defineProperty(Xr,"__esModule",{value:!0});Xr.VerificationEvent=Xr.VerificationBase=Xr.SwitchStartEventError=void 0;var Gr=SP(Y.exports),bP=jt,ia=se,wP=xs,RP=Ke,IP=Pt,TP=je;const Xg=new Error("Verification timed out");class __ extends Error{constructor(e){super();this.startEvent=e}}Xr.SwitchStartEventError=__;let kl;Xr.VerificationEvent=kl;(function(n){n.Cancel="cancel"})(kl||(Xr.VerificationEvent=kl={}));class OP extends TP.TypedEventEmitter{constructor(e,t,r,i,s,o){super();this.channel=e,this.baseApis=t,this.userId=r,this.deviceId=i,this.startEvent=s,this.request=o,(0,Gr.default)(this,"cancelled",!1),(0,Gr.default)(this,"_done",!1),(0,Gr.default)(this,"promise",null),(0,Gr.default)(this,"transactionTimeoutTimer",null),(0,Gr.default)(this,"expectedEvent",void 0),(0,Gr.default)(this,"resolve",void 0),(0,Gr.default)(this,"reject",void 0),(0,Gr.default)(this,"resolveEvent",void 0),(0,Gr.default)(this,"rejectEvent",void 0),(0,Gr.default)(this,"started",void 0),(0,Gr.default)(this,"doVerification",void 0)}get initiatedByMe(){if(!this.startEvent)return!0;const e=this.startEvent.getSender(),t=this.startEvent.getContent();return e===this.baseApis.getUserId()&&t.from_device===this.baseApis.getDeviceId()}get hasBeenCancelled(){return this.cancelled}resetTimer(){ia.logger.info("Refreshing/starting the verification transaction timeout timer"),this.transactionTimeoutTimer!==null&&clearTimeout(this.transactionTimeoutTimer),this.transactionTimeoutTimer=setTimeout(()=>{!this._done&&!this.cancelled&&(ia.logger.info("Triggering verification timeout"),this.cancel(Xg))},10*60*1e3)}endTimer(){this.transactionTimeoutTimer!==null&&(clearTimeout(this.transactionTimeoutTimer),this.transactionTimeoutTimer=null)}send(e,t){return this.channel.send(e,t)}waitForEvent(e){if(this._done)return Promise.reject(new Error("Verification is already done"));const t=this.request.getEventFromOtherParty(e);return t?Promise.resolve(t):(this.expectedEvent=e,new Promise((r,i)=>{this.resolveEvent=r,this.rejectEvent=i}))}canSwitchStartEvent(e){return!1}switchStartEvent(e){if(this.canSwitchStartEvent(e))if(ia.logger.log("Verification Base: switching verification start event",{restartingFlow:!!this.rejectEvent}),this.rejectEvent){const t=this.rejectEvent;this.rejectEvent=void 0,t(new __(e))}else this.startEvent=e}handleEvent(e){if(!this._done){if(e.getType()===this.expectedEvent)this.expectedEvent!=="m.key.verification.done"&&(this.expectedEvent=void 0,this.rejectEvent=void 0,this.resetTimer(),this.resolveEvent(e));else if(e.getType()==="m.key.verification.cancel"){const t=this.reject;if(this.reject=void 0,t){const r=e.getContent(),{reason:i,code:s}=r;t(new Error(`Other side cancelled verification because ${i} (${s})`))}}else if(this.expectedEvent){const t=new Error("Unexpected message: expecting "+this.expectedEvent+" but got "+e.getType());if(this.expectedEvent=void 0,this.rejectEvent){const r=this.rejectEvent;this.rejectEvent=void 0,r(t)}this.cancel(t)}}}done(){if(this.endTimer(),!this._done)return this.request.onVerifierFinished(),this.resolve(),(0,IP.requestKeysDuringVerification)(this.baseApis,this.userId,this.deviceId)}cancel(e){if(this.endTimer(),!this._done){if(this.cancelled=!0,this.request.onVerifierCancelled(),this.userId&&this.deviceId)if(e===Xg){const t=(0,RP.newTimeoutError)();this.send(t.getType(),t.getContent())}else if(e instanceof bP.MatrixEvent){if(e.getSender()!==this.userId){const r=e.getContent();e.getType()==="m.key.verification.cancel"?(r.code=r.code||"m.unknown",r.reason=r.reason||r.body||"Unknown reason",this.send("m.key.verification.cancel",r)):this.send("m.key.verification.cancel",{code:"m.unknown",reason:r.body||"Unknown reason"})}}else this.send("m.key.verification.cancel",{code:"m.unknown",reason:e.toString()});this.promise!==null?this.reject&&this.reject(e):this.promise=Promise.reject(e),this.emit(kl.Cancel,e)}}verify(){return this.promise?this.promise:(this.promise=new Promise((e,t)=>{this.resolve=(...r)=>{this._done=!0,this.endTimer(),e(...r)},this.reject=r=>{this._done=!0,this.endTimer(),t(r)}}),this.doVerification&&!this.started&&(this.started=!0,this.resetTimer(),Promise.resolve(this.doVerification()).then(this.done.bind(this),this.cancel.bind(this))),this.promise)}async verifyKeys(e,t,r){const i=[];for(const[s,o]of Object.entries(t)){const a=s.split(":",2)[1],l=this.baseApis.getStoredDevice(e,a);if(l)r(s,l,o),i.push(a);else{const u=this.baseApis.crypto.deviceList.getStoredCrossSigningForUser(e);u&&u.getId()===a?(r(s,wP.DeviceInfo.fromStorage({keys:{[s]:a}},a),o),i.push(a)):ia.logger.warn(`verification: Could not find device ${a} to verify`)}}if(!i.length)throw new Error("No devices could be verified");ia.logger.info("Verification completed! Marking devices verified: ",i);for(const s of i)await this.baseApis.setDeviceVerified(e,s)}get events(){}}Xr.VerificationBase=OP;var kP=G.exports;Object.defineProperty(cr,"__esModule",{value:!0});cr.SHOW_QR_CODE_METHOD=cr.SCAN_QR_CODE_METHOD=cr.ReciprocateQRCode=cr.QrCodeEvent=cr.QRCodeData=void 0;var Qg=kP(Y.exports),CP=Xr,Hs=Ke,Zg=xe,em=se;const PP="m.qr_code.show.v1";cr.SHOW_QR_CODE_METHOD=PP;const MP="m.qr_code.scan.v1";cr.SCAN_QR_CODE_METHOD=MP;let Cl;cr.QrCodeEvent=Cl;(function(n){n.ShowReciprocateQr="show_reciprocate_qr"})(Cl||(cr.QrCodeEvent=Cl={}));class Of extends CP.VerificationBase{constructor(...e){super(...e);(0,Qg.default)(this,"reciprocateQREvent",void 0),(0,Qg.default)(this,"doVerification",async()=>{if(!this.startEvent)throw new Error("It is not currently possible to start verificationwith this method yet.");const{qrCodeData:t}=this.request;if(this.startEvent.getContent().secret!==t.encodedSharedSecret)throw(0,Hs.newKeyMismatchError)();await new Promise((i,s)=>{this.reciprocateQREvent={confirm:i,cancel:()=>s((0,Hs.newUserCancelledError)())},this.emit(Cl.ShowReciprocateQr,this.reciprocateQREvent)});const r={};switch(t.mode){case sr.VerifyOtherUser:{const i=t.otherUserMasterKey;r[`ed25519:${i}`]=i;break}case sr.VerifySelfTrusted:{const i=this.request.targetDevice.deviceId;r[`ed25519:${i}`]=t.otherDeviceKey;break}case sr.VerifySelfUntrusted:{const i=t.myMasterKey;r[`ed25519:${i}`]=i;break}}await this.verifyKeys(this.userId,r,(i,s,o)=>{const a=r[i];if(!a)throw(0,Hs.newKeyMismatchError)();if(o!==a)throw em.logger.error("key ID from key info does not match"),(0,Hs.newKeyMismatchError)();for(const l in s.keys){if(!l.startsWith("ed25519"))continue;const u=r[l];if(!u)throw(0,Hs.newKeyMismatchError)();if(s.keys[l]!==u)throw em.logger.error("master key does not match"),(0,Hs.newKeyMismatchError)()}})})}static factory(e,t,r,i,s,o){return new Of(e,t,r,i,s,o)}static get NAME(){return"m.reciprocate.v1"}}cr.ReciprocateQRCode=Of;const AP=2,DP="MATRIX";var sr;(function(n){n[n.VerifyOtherUser=0]="VerifyOtherUser",n[n.VerifySelfTrusted=1]="VerifySelfTrusted",n[n.VerifySelfUntrusted=2]="VerifySelfUntrusted"})(sr||(sr={}));class Mi{constructor(e,t,r,i,s,o){this.mode=e,this.sharedSecret=t,this.otherUserMasterKey=r,this.otherDeviceKey=i,this.myMasterKey=s,this.buffer=o}static async create(e,t){const r=Mi.generateSharedSecret(),i=Mi.determineMode(e,t);let s=null,o=null,a=null;if(i===sr.VerifyOtherUser)s=t.getStoredCrossSigningForUser(e.otherUserId).getId("master");else if(i===sr.VerifySelfTrusted)o=await Mi.getOtherDeviceKey(e,t);else if(i===sr.VerifySelfUntrusted){const c=t.getUserId();a=t.getStoredCrossSigningForUser(c).getId("master")}const l=Mi.generateQrData(e,t,i,r,s,o,a),u=Mi.generateBuffer(l);return new Mi(i,r,s,o,a,u)}get encodedSharedSecret(){return this.sharedSecret}getBuffer(){return this.buffer}static generateSharedSecret(){const e=new Uint8Array(11);return V.crypto.getRandomValues(e),(0,Zg.encodeUnpaddedBase64)(e)}static async getOtherDeviceKey(e,t){const r=t.getUserId(),i=e.targetDevice,s=i?i.deviceId:null,o=t.getStoredDevice(r,s);if(!o)throw new Error("could not find device "+s);return o.getFingerprint()}static determineMode(e,t){const r=t.getUserId(),i=e.otherUserId;let s=sr.VerifyOtherUser;return r===i&&(t.checkUserTrust(r).isCrossSigningVerified()?s=sr.VerifySelfTrusted:s=sr.VerifySelfUntrusted),s}static generateQrData(e,t,r,i,s,o,a){const l=t.getUserId(),u=e.channel.transactionId,c={prefix:DP,version:AP,mode:r,transactionId:u,firstKeyB64:"",secondKeyB64:"",secretB64:i},g=t.getStoredCrossSigningForUser(l);return r===sr.VerifyOtherUser?(c.firstKeyB64=g.getId("master"),c.secondKeyB64=s):r===sr.VerifySelfTrusted?(c.firstKeyB64=g.getId("master"),c.secondKeyB64=o):r===sr.VerifySelfUntrusted&&(c.firstKeyB64=t.getDeviceEd25519Key(),c.secondKeyB64=a),c}static generateBuffer(e){let t=Buffer.alloc(0);const r=a=>{const l=Buffer.from([a]);t=Buffer.concat([t,l])},i=a=>{const l=Buffer.alloc(2);l.writeInt16BE(a,0),t=Buffer.concat([t,l])},s=(a,l,u=!0)=>{const c=Buffer.from(a,l);u&&i(c.byteLength),t=Buffer.concat([t,c])},o=a=>{const l=(0,Zg.decodeBase64)(a),u=Buffer.from(l);t=Buffer.concat([t,u])};return s(e.prefix,"ascii",!1),r(e.version),r(e.mode),s(e.transactionId,"utf-8"),o(e.firstKeyB64),o(e.secondKeyB64),o(e.secretB64),t}}cr.QRCodeData=Mi;var ws={},E_=G.exports;Object.defineProperty(ws,"__esModule",{value:!0});ws.SasEvent=ws.SAS=void 0;var sa=E_(Y.exports),tm=E_(tu),ld=Xr,qn=Ke,xP=se;const ud="m.key.verification.start",UP=["m.key.verification.accept","m.key.verification.key","m.key.verification.mac"];let $c;const rm=(0,qn.errorFactory)("m.mismatched_sas","Mismatched short authentication string"),$P=(0,qn.errorFactory)("m.mismatched_commitment","Mismatched commitment");function NP(n){return[(n[0]<<5|n[1]>>3)+1e3,((n[1]&7)<<10|n[2]<<2|n[3]>>6)+1e3,((n[3]&63)<<7|n[4]>>1)+1e3]}const LP=[["\u{1F436}","dog"],["\u{1F431}","cat"],["\u{1F981}","lion"],["\u{1F40E}","horse"],["\u{1F984}","unicorn"],["\u{1F437}","pig"],["\u{1F418}","elephant"],["\u{1F430}","rabbit"],["\u{1F43C}","panda"],["\u{1F413}","rooster"],["\u{1F427}","penguin"],["\u{1F422}","turtle"],["\u{1F41F}","fish"],["\u{1F419}","octopus"],["\u{1F98B}","butterfly"],["\u{1F337}","flower"],["\u{1F333}","tree"],["\u{1F335}","cactus"],["\u{1F344}","mushroom"],["\u{1F30F}","globe"],["\u{1F319}","moon"],["\u2601\uFE0F","cloud"],["\u{1F525}","fire"],["\u{1F34C}","banana"],["\u{1F34E}","apple"],["\u{1F353}","strawberry"],["\u{1F33D}","corn"],["\u{1F355}","pizza"],["\u{1F382}","cake"],["\u2764\uFE0F","heart"],["\u{1F642}","smiley"],["\u{1F916}","robot"],["\u{1F3A9}","hat"],["\u{1F453}","glasses"],["\u{1F527}","spanner"],["\u{1F385}","santa"],["\u{1F44D}","thumbs up"],["\u2602\uFE0F","umbrella"],["\u231B","hourglass"],["\u23F0","clock"],["\u{1F381}","gift"],["\u{1F4A1}","light bulb"],["\u{1F4D5}","book"],["\u270F\uFE0F","pencil"],["\u{1F4CE}","paperclip"],["\u2702\uFE0F","scissors"],["\u{1F512}","lock"],["\u{1F511}","key"],["\u{1F528}","hammer"],["\u260E\uFE0F","telephone"],["\u{1F3C1}","flag"],["\u{1F682}","train"],["\u{1F6B2}","bicycle"],["\u2708\uFE0F","aeroplane"],["\u{1F680}","rocket"],["\u{1F3C6}","trophy"],["\u26BD","ball"],["\u{1F3B8}","guitar"],["\u{1F3BA}","trumpet"],["\u{1F514}","bell"],["\u2693\uFE0F","anchor"],["\u{1F3A7}","headphones"],["\u{1F4C1}","folder"],["\u{1F4CC}","pin"]];function BP(n){return[n[0]>>2,(n[0]&3)<<4|n[1]>>4,(n[1]&15)<<2|n[2]>>6,n[2]&63,n[3]>>2,(n[3]&3)<<4|n[4]>>4,(n[4]&15)<<2|n[5]>>6].map(t=>LP[t])}const xh={decimal:NP,emoji:BP};function nm(n,e){const t={};for(const r of e)r in xh&&(t[r]=xh[r](n));return t}const KP={"hkdf-hmac-sha256":"calculate_mac","hmac-sha256":"calculate_mac_long_kdf"};function oa(n,e){return function(...t){const i=n[KP[e]].apply(n,t);return xP.logger.log("SAS calculateMAC:",e,t,i),i}}const im={"curve25519-hkdf-sha256":function(n,e,t){const r=`${n.baseApis.getUserId()}|${n.baseApis.deviceId}|${n.ourSASPubKey}|`,i=`${n.userId}|${n.deviceId}|${n.theirSASPubKey}|`,s="MATRIX_KEY_VERIFICATION_SAS|"+(n.initiatedByMe?r+i:i+r)+n.channel.transactionId;return e.generate_bytes(s,t)},curve25519:function(n,e,t){const r=`${n.baseApis.getUserId()}${n.baseApis.deviceId}`,i=`${n.userId}${n.deviceId}`,s="MATRIX_KEY_VERIFICATION_SAS"+(n.initiatedByMe?r+i:i+r)+n.channel.transactionId;return e.generate_bytes(s,t)}},Uh=["curve25519-hkdf-sha256","curve25519"],$h=["sha256"],Nh=["hkdf-hmac-sha256","hmac-sha256"],S_=Object.keys(xh),FP=new Set(Uh),qP=new Set($h),jP=new Set(Nh),sm=new Set(S_);function aa(n,e){return n instanceof Array?n.filter(t=>e.has(t)):[]}let Ha;ws.SasEvent=Ha;(function(n){n.ShowSas="show_sas"})(Ha||(ws.SasEvent=Ha={}));class Pl extends ld.VerificationBase{constructor(...e){super(...e);(0,sa.default)(this,"waitingForAccept",void 0),(0,sa.default)(this,"ourSASPubKey",void 0),(0,sa.default)(this,"theirSASPubKey",void 0),(0,sa.default)(this,"sasEvent",void 0),(0,sa.default)(this,"doVerification",async()=>{await V.Olm.init(),$c=$c||new V.Olm.Utility,await this.baseApis.downloadKeys([this.userId]);let t=!1;do try{return this.initiatedByMe?await this.doSendVerification():await this.doRespondVerification()}catch(r){if(r instanceof ld.SwitchStartEventError)this.startEvent=r.startEvent,t=!0;else throw r}while(t)})}static get NAME(){return"m.sas.v1"}get events(){return UP}canSwitchStartEvent(e){if(e.getType()!==ud)return!1;const t=e.getContent();return t&&t.method===Pl.NAME&&this.waitingForAccept}async sendStart(){const e=this.channel.completeContent(ud,{method:Pl.NAME,from_device:this.baseApis.deviceId,key_agreement_protocols:Uh,hashes:$h,message_authentication_codes:Nh,short_authentication_string:S_});return await this.channel.sendCompleted(ud,e),e}async doSendVerification(){this.waitingForAccept=!0;let e;if(this.startEvent?e=this.channel.completedContentFromEvent(this.startEvent):e=await this.sendStart(),!this.initiatedByMe)throw new ld.SwitchStartEventError(this.startEvent);let t;try{t=await this.waitForEvent("m.key.verification.accept")}finally{this.waitingForAccept=!1}let r=t.getContent();const i=aa(r.short_authentication_string,sm);if(!(FP.has(r.key_agreement_protocol)&&qP.has(r.hash)&&jP.has(r.message_authentication_code)&&i.length))throw(0,qn.newUnknownMethodError)();if(typeof r.commitment!="string")throw(0,qn.newInvalidMessageError)();const s=r.key_agreement_protocol,o=r.message_authentication_code,a=r.commitment,l=new V.Olm.SAS;try{this.ourSASPubKey=l.get_pubkey(),await this.send("m.key.verification.key",{key:this.ourSASPubKey}),t=await this.waitForEvent("m.key.verification.key"),r=t.getContent();const u=r.key+tm.default.stringify(e);if($c.sha256(u)!==a)throw $P();this.theirSASPubKey=r.key,l.set_their_key(r.key);const c=im[s](this,l,6),g=new Promise((m,f)=>{this.sasEvent={sas:nm(c,i),confirm:async()=>{try{await this.sendMAC(l,o),m()}catch(E){f(E)}},cancel:()=>f((0,qn.newUserCancelledError)()),mismatch:()=>f(rm())},this.emit(Ha.ShowSas,this.sasEvent)});[t]=await Promise.all([this.waitForEvent("m.key.verification.mac").then(m=>(this.expectedEvent="m.key.verification.done",m)),g]),r=t.getContent(),await this.checkMAC(l,r,o)}finally{l.free()}}async doRespondVerification(){let e=this.channel.completedContentFromEvent(this.startEvent);const t=aa(Uh,new Set(e.key_agreement_protocols))[0],r=aa($h,new Set(e.hashes))[0],i=aa(Nh,new Set(e.message_authentication_codes))[0],s=aa(e.short_authentication_string,sm);if(!(t!==void 0&&r!==void 0&&i!==void 0&&s.length))throw(0,qn.newUnknownMethodError)();const o=new V.Olm.SAS;try{const a=o.get_pubkey()+tm.default.stringify(e);await this.send("m.key.verification.accept",{key_agreement_protocol:t,hash:r,message_authentication_code:i,short_authentication_string:s,commitment:$c.sha256(a)});let l=await this.waitForEvent("m.key.verification.key");e=l.getContent(),this.theirSASPubKey=e.key,o.set_their_key(e.key),this.ourSASPubKey=o.get_pubkey(),await this.send("m.key.verification.key",{key:this.ourSASPubKey});const u=im[t](this,o,6),c=new Promise((g,m)=>{this.sasEvent={sas:nm(u,s),confirm:async()=>{try{await this.sendMAC(o,i),g()}catch(f){m(f)}},cancel:()=>m((0,qn.newUserCancelledError)()),mismatch:()=>m(rm())},this.emit(Ha.ShowSas,this.sasEvent)});[l]=await Promise.all([this.waitForEvent("m.key.verification.mac").then(g=>(this.expectedEvent="m.key.verification.done",g)),c]),e=l.getContent(),await this.checkMAC(o,e,i)}finally{o.free()}}sendMAC(e,t){const r={},i=[],s="MATRIX_KEY_VERIFICATION_MAC"+this.baseApis.getUserId()+this.baseApis.deviceId+this.userId+this.deviceId+this.channel.transactionId,o=`ed25519:${this.baseApis.deviceId}`;r[o]=oa(e,t)(this.baseApis.getDeviceEd25519Key(),s+o),i.push(o);const a=this.baseApis.getCrossSigningId();if(a){const u=`ed25519:${a}`;r[u]=oa(e,t)(a,s+u),i.push(u)}const l=oa(e,t)(i.sort().join(","),s+"KEY_IDS");return this.send("m.key.verification.mac",{mac:r,keys:l})}async checkMAC(e,t,r){const i="MATRIX_KEY_VERIFICATION_MAC"+this.userId+this.deviceId+this.baseApis.getUserId()+this.baseApis.deviceId+this.channel.transactionId;if(t.keys!==oa(e,r)(Object.keys(t.mac).sort().join(","),i+"KEY_IDS"))throw(0,qn.newKeyMismatchError)();await this.verifyKeys(this.userId,t.mac,(s,o,a)=>{if(a!==oa(e,r)(o.keys[s],i+s))throw(0,qn.newKeyMismatchError)()})}}ws.SAS=Pl;var Us={};Object.defineProperty(Us,"__esModule",{value:!0});Us.deriveKey=Cf;Us.keyFromAuthData=HP;Us.keyFromPassphrase=YP;var VP=ai,GP=W;const WP=typeof window!="undefined"&&window.crypto?window.crypto.subtle||window.crypto.webkitSubtle:null,om=5e5,kf=256;async function HP(n,e){if(!V.Olm)throw new Error("Olm is not available");if(!n.private_key_salt||!n.private_key_iterations)throw new Error("Salt and/or iterations not found: this backup cannot be restored with a passphrase");return await Cf(e,n.private_key_salt,n.private_key_iterations,n.private_key_bits||kf)}async function YP(n){if(!V.Olm)throw new Error("Olm is not available");const e=(0,VP.randomString)(32);return{key:await Cf(n,e,om,kf),salt:e,iterations:om}}async function Cf(n,e,t,r=kf){return WP?zP(n,e,t,r):JP(n,e,t,r)}async function zP(n,e,t,r){const i=V.crypto.subtle,s=V.TextEncoder;if(!i||!s)throw new Error("Password-based backup is not avaiable on this platform");const o=await i.importKey("raw",new s().encode(n),{name:"PBKDF2"},!1,["deriveBits"]),a=await i.deriveBits({name:"PBKDF2",salt:new s().encode(e),iterations:t,hash:"SHA-512"},o,r);return new Uint8Array(a)}async function JP(n,e,t,r){const i=(0,GP.getCrypto)();if(!i)throw new Error("No usable crypto implementation");return i.pbkdf2Sync(n,Buffer.from(e,"binary"),t,r,"sha512")}var Vo={},Lh={exports:{}},b_={},au={};au.byteLength=ZP;au.toByteArray=tM;au.fromByteArray=iM;var En=[],Ar=[],XP=typeof Uint8Array!="undefined"?Uint8Array:Array,dd="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(var Ys=0,QP=dd.length;Ys<QP;++Ys)En[Ys]=dd[Ys],Ar[dd.charCodeAt(Ys)]=Ys;Ar["-".charCodeAt(0)]=62;Ar["_".charCodeAt(0)]=63;function w_(n){var e=n.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var t=n.indexOf("=");t===-1&&(t=e);var r=t===e?0:4-t%4;return[t,r]}function ZP(n){var e=w_(n),t=e[0],r=e[1];return(t+r)*3/4-r}function eM(n,e,t){return(e+t)*3/4-t}function tM(n){var e,t=w_(n),r=t[0],i=t[1],s=new XP(eM(n,r,i)),o=0,a=i>0?r-4:r,l;for(l=0;l<a;l+=4)e=Ar[n.charCodeAt(l)]<<18|Ar[n.charCodeAt(l+1)]<<12|Ar[n.charCodeAt(l+2)]<<6|Ar[n.charCodeAt(l+3)],s[o++]=e>>16&255,s[o++]=e>>8&255,s[o++]=e&255;return i===2&&(e=Ar[n.charCodeAt(l)]<<2|Ar[n.charCodeAt(l+1)]>>4,s[o++]=e&255),i===1&&(e=Ar[n.charCodeAt(l)]<<10|Ar[n.charCodeAt(l+1)]<<4|Ar[n.charCodeAt(l+2)]>>2,s[o++]=e>>8&255,s[o++]=e&255),s}function rM(n){return En[n>>18&63]+En[n>>12&63]+En[n>>6&63]+En[n&63]}function nM(n,e,t){for(var r,i=[],s=e;s<t;s+=3)r=(n[s]<<16&16711680)+(n[s+1]<<8&65280)+(n[s+2]&255),i.push(rM(r));return i.join("")}function iM(n){for(var e,t=n.length,r=t%3,i=[],s=16383,o=0,a=t-r;o<a;o+=s)i.push(nM(n,o,o+s>a?a:o+s));return r===1?(e=n[t-1],i.push(En[e>>2]+En[e<<4&63]+"==")):r===2&&(e=(n[t-2]<<8)+n[t-1],i.push(En[e>>10]+En[e>>4&63]+En[e<<2&63]+"=")),i.join("")}var Pf={};/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */Pf.read=function(n,e,t,r,i){var s,o,a=i*8-r-1,l=(1<<a)-1,u=l>>1,c=-7,g=t?i-1:0,m=t?-1:1,f=n[e+g];for(g+=m,s=f&(1<<-c)-1,f>>=-c,c+=a;c>0;s=s*256+n[e+g],g+=m,c-=8);for(o=s&(1<<-c)-1,s>>=-c,c+=r;c>0;o=o*256+n[e+g],g+=m,c-=8);if(s===0)s=1-u;else{if(s===l)return o?NaN:(f?-1:1)*(1/0);o=o+Math.pow(2,r),s=s-u}return(f?-1:1)*o*Math.pow(2,s-r)};Pf.write=function(n,e,t,r,i,s){var o,a,l,u=s*8-i-1,c=(1<<u)-1,g=c>>1,m=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,f=r?0:s-1,E=r?1:-1,I=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,o=c):(o=Math.floor(Math.log(e)/Math.LN2),e*(l=Math.pow(2,-o))<1&&(o--,l*=2),o+g>=1?e+=m/l:e+=m*Math.pow(2,1-g),e*l>=2&&(o++,l/=2),o+g>=c?(a=0,o=c):o+g>=1?(a=(e*l-1)*Math.pow(2,i),o=o+g):(a=e*Math.pow(2,g-1)*Math.pow(2,i),o=0));i>=8;n[t+f]=a&255,f+=E,a/=256,i-=8);for(o=o<<i|a,u+=i;u>0;n[t+f]=o&255,f+=E,o/=256,u-=8);n[t+f-E]|=I*128};/*!
- * The buffer module from node.js, for the browser.
- *
- * @author Feross Aboukhadijeh <https://feross.org>
- * @license MIT
- */(function(n){const e=au,t=Pf,r=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;n.Buffer=a,n.SlowBuffer=C,n.INSPECT_MAX_BYTES=50;const i=2147483647;n.kMaxLength=i,a.TYPED_ARRAY_SUPPORT=s(),!a.TYPED_ARRAY_SUPPORT&&typeof console!="undefined"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function s(){try{const v=new Uint8Array(1),d={foo:function(){return 42}};return Object.setPrototypeOf(d,Uint8Array.prototype),Object.setPrototypeOf(v,d),v.foo()===42}catch{return!1}}Object.defineProperty(a.prototype,"parent",{enumerable:!0,get:function(){if(!!a.isBuffer(this))return this.buffer}}),Object.defineProperty(a.prototype,"offset",{enumerable:!0,get:function(){if(!!a.isBuffer(this))return this.byteOffset}});function o(v){if(v>i)throw new RangeError('The value "'+v+'" is invalid for option "size"');const d=new Uint8Array(v);return Object.setPrototypeOf(d,a.prototype),d}function a(v,d,h){if(typeof v=="number"){if(typeof d=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return g(v)}return l(v,d,h)}a.poolSize=8192;function l(v,d,h){if(typeof v=="string")return m(v,d);if(ArrayBuffer.isView(v))return E(v);if(v==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof v);if(Ht(v,ArrayBuffer)||v&&Ht(v.buffer,ArrayBuffer)||typeof SharedArrayBuffer!="undefined"&&(Ht(v,SharedArrayBuffer)||v&&Ht(v.buffer,SharedArrayBuffer)))return I(v,d,h);if(typeof v=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const b=v.valueOf&&v.valueOf();if(b!=null&&b!==v)return a.from(b,d,h);const P=w(v);if(P)return P;if(typeof Symbol!="undefined"&&Symbol.toPrimitive!=null&&typeof v[Symbol.toPrimitive]=="function")return a.from(v[Symbol.toPrimitive]("string"),d,h);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof v)}a.from=function(v,d,h){return l(v,d,h)},Object.setPrototypeOf(a.prototype,Uint8Array.prototype),Object.setPrototypeOf(a,Uint8Array);function u(v){if(typeof v!="number")throw new TypeError('"size" argument must be of type number');if(v<0)throw new RangeError('The value "'+v+'" is invalid for option "size"')}function c(v,d,h){return u(v),v<=0?o(v):d!==void 0?typeof h=="string"?o(v).fill(d,h):o(v).fill(d):o(v)}a.alloc=function(v,d,h){return c(v,d,h)};function g(v){return u(v),o(v<0?0:k(v)|0)}a.allocUnsafe=function(v){return g(v)},a.allocUnsafeSlow=function(v){return g(v)};function m(v,d){if((typeof d!="string"||d==="")&&(d="utf8"),!a.isEncoding(d))throw new TypeError("Unknown encoding: "+d);const h=S(v,d)|0;let b=o(h);const P=b.write(v,d);return P!==h&&(b=b.slice(0,P)),b}function f(v){const d=v.length<0?0:k(v.length)|0,h=o(d);for(let b=0;b<d;b+=1)h[b]=v[b]&255;return h}function E(v){if(Ht(v,Uint8Array)){const d=new Uint8Array(v);return I(d.buffer,d.byteOffset,d.byteLength)}return f(v)}function I(v,d,h){if(d<0||v.byteLength<d)throw new RangeError('"offset" is outside of buffer bounds');if(v.byteLength<d+(h||0))throw new RangeError('"length" is outside of buffer bounds');let b;return d===void 0&&h===void 0?b=new Uint8Array(v):h===void 0?b=new Uint8Array(v,d):b=new Uint8Array(v,d,h),Object.setPrototypeOf(b,a.prototype),b}function w(v){if(a.isBuffer(v)){const d=k(v.length)|0,h=o(d);return h.length===0||v.copy(h,0,0,d),h}if(v.length!==void 0)return typeof v.length!="number"||Wo(v.length)?o(0):f(v);if(v.type==="Buffer"&&Array.isArray(v.data))return f(v.data)}function k(v){if(v>=i)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+i.toString(16)+" bytes");return v|0}function C(v){return+v!=v&&(v=0),a.alloc(+v)}a.isBuffer=function(d){return d!=null&&d._isBuffer===!0&&d!==a.prototype},a.compare=function(d,h){if(Ht(d,Uint8Array)&&(d=a.from(d,d.offset,d.byteLength)),Ht(h,Uint8Array)&&(h=a.from(h,h.offset,h.byteLength)),!a.isBuffer(d)||!a.isBuffer(h))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(d===h)return 0;let b=d.length,P=h.length;for(let A=0,$=Math.min(b,P);A<$;++A)if(d[A]!==h[A]){b=d[A],P=h[A];break}return b<P?-1:P<b?1:0},a.isEncoding=function(d){switch(String(d).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},a.concat=function(d,h){if(!Array.isArray(d))throw new TypeError('"list" argument must be an Array of Buffers');if(d.length===0)return a.alloc(0);let b;if(h===void 0)for(h=0,b=0;b<d.length;++b)h+=d[b].length;const P=a.allocUnsafe(h);let A=0;for(b=0;b<d.length;++b){let $=d[b];if(Ht($,Uint8Array))A+$.length>P.length?(a.isBuffer($)||($=a.from($)),$.copy(P,A)):Uint8Array.prototype.set.call(P,$,A);else if(a.isBuffer($))$.copy(P,A);else throw new TypeError('"list" argument must be an Array of Buffers');A+=$.length}return P};function S(v,d){if(a.isBuffer(v))return v.length;if(ArrayBuffer.isView(v)||Ht(v,ArrayBuffer))return v.byteLength;if(typeof v!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof v);const h=v.length,b=arguments.length>2&&arguments[2]===!0;if(!b&&h===0)return 0;let P=!1;for(;;)switch(d){case"ascii":case"latin1":case"binary":return h;case"utf8":case"utf-8":return Ns(v).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return h*2;case"hex":return h>>>1;case"base64":return Mn(v).length;default:if(P)return b?-1:Ns(v).length;d=(""+d).toLowerCase(),P=!0}}a.byteLength=S;function T(v,d,h){let b=!1;if((d===void 0||d<0)&&(d=0),d>this.length||((h===void 0||h>this.length)&&(h=this.length),h<=0)||(h>>>=0,d>>>=0,h<=d))return"";for(v||(v="utf8");;)switch(v){case"hex":return Kr(this,d,h);case"utf8":case"utf-8":return Ye(this,d,h);case"ascii":return Q(this,d,h);case"latin1":case"binary":return rn(this,d,h);case"base64":return Te(this,d,h);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return di(this,d,h);default:if(b)throw new TypeError("Unknown encoding: "+v);v=(v+"").toLowerCase(),b=!0}}a.prototype._isBuffer=!0;function D(v,d,h){const b=v[d];v[d]=v[h],v[h]=b}a.prototype.swap16=function(){const d=this.length;if(d%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let h=0;h<d;h+=2)D(this,h,h+1);return this},a.prototype.swap32=function(){const d=this.length;if(d%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let h=0;h<d;h+=4)D(this,h,h+3),D(this,h+1,h+2);return this},a.prototype.swap64=function(){const d=this.length;if(d%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let h=0;h<d;h+=8)D(this,h,h+7),D(this,h+1,h+6),D(this,h+2,h+5),D(this,h+3,h+4);return this},a.prototype.toString=function(){const d=this.length;return d===0?"":arguments.length===0?Ye(this,0,d):T.apply(this,arguments)},a.prototype.toLocaleString=a.prototype.toString,a.prototype.equals=function(d){if(!a.isBuffer(d))throw new TypeError("Argument must be a Buffer");return this===d?!0:a.compare(this,d)===0},a.prototype.inspect=function(){let d="";const h=n.INSPECT_MAX_BYTES;return d=this.toString("hex",0,h).replace(/(.{2})/g,"$1 ").trim(),this.length>h&&(d+=" ... "),"<Buffer "+d+">"},r&&(a.prototype[r]=a.prototype.inspect),a.prototype.compare=function(d,h,b,P,A){if(Ht(d,Uint8Array)&&(d=a.from(d,d.offset,d.byteLength)),!a.isBuffer(d))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof d);if(h===void 0&&(h=0),b===void 0&&(b=d?d.length:0),P===void 0&&(P=0),A===void 0&&(A=this.length),h<0||b>d.length||P<0||A>this.length)throw new RangeError("out of range index");if(P>=A&&h>=b)return 0;if(P>=A)return-1;if(h>=b)return 1;if(h>>>=0,b>>>=0,P>>>=0,A>>>=0,this===d)return 0;let $=A-P,ne=b-h;const Ie=Math.min($,ne),de=this.slice(P,A),ke=d.slice(h,b);for(let ve=0;ve<Ie;++ve)if(de[ve]!==ke[ve]){$=de[ve],ne=ke[ve];break}return $<ne?-1:ne<$?1:0};function R(v,d,h,b,P){if(v.length===0)return-1;if(typeof h=="string"?(b=h,h=0):h>2147483647?h=2147483647:h<-2147483648&&(h=-2147483648),h=+h,Wo(h)&&(h=P?0:v.length-1),h<0&&(h=v.length+h),h>=v.length){if(P)return-1;h=v.length-1}else if(h<0)if(P)h=0;else return-1;if(typeof d=="string"&&(d=a.from(d,b)),a.isBuffer(d))return d.length===0?-1:U(v,d,h,b,P);if(typeof d=="number")return d=d&255,typeof Uint8Array.prototype.indexOf=="function"?P?Uint8Array.prototype.indexOf.call(v,d,h):Uint8Array.prototype.lastIndexOf.call(v,d,h):U(v,[d],h,b,P);throw new TypeError("val must be string, number or Buffer")}function U(v,d,h,b,P){let A=1,$=v.length,ne=d.length;if(b!==void 0&&(b=String(b).toLowerCase(),b==="ucs2"||b==="ucs-2"||b==="utf16le"||b==="utf-16le")){if(v.length<2||d.length<2)return-1;A=2,$/=2,ne/=2,h/=2}function Ie(ke,ve){return A===1?ke[ve]:ke.readUInt16BE(ve*A)}let de;if(P){let ke=-1;for(de=h;de<$;de++)if(Ie(v,de)===Ie(d,ke===-1?0:de-ke)){if(ke===-1&&(ke=de),de-ke+1===ne)return ke*A}else ke!==-1&&(de-=de-ke),ke=-1}else for(h+ne>$&&(h=$-ne),de=h;de>=0;de--){let ke=!0;for(let ve=0;ve<ne;ve++)if(Ie(v,de+ve)!==Ie(d,ve)){ke=!1;break}if(ke)return de}return-1}a.prototype.includes=function(d,h,b){return this.indexOf(d,h,b)!==-1},a.prototype.indexOf=function(d,h,b){return R(this,d,h,b,!0)},a.prototype.lastIndexOf=function(d,h,b){return R(this,d,h,b,!1)};function q(v,d,h,b){h=Number(h)||0;const P=v.length-h;b?(b=Number(b),b>P&&(b=P)):b=P;const A=d.length;b>A/2&&(b=A/2);let $;for($=0;$<b;++$){const ne=parseInt(d.substr($*2,2),16);if(Wo(ne))return $;v[h+$]=ne}return $}function B(v,d,h,b){return gi(Ns(d,v.length-h),v,h,b)}function te(v,d,h,b){return gi(dc(d),v,h,b)}function ye(v,d,h,b){return gi(Mn(d),v,h,b)}function we(v,d,h,b){return gi(yu(d,v.length-h),v,h,b)}a.prototype.write=function(d,h,b,P){if(h===void 0)P="utf8",b=this.length,h=0;else if(b===void 0&&typeof h=="string")P=h,b=this.length,h=0;else if(isFinite(h))h=h>>>0,isFinite(b)?(b=b>>>0,P===void 0&&(P="utf8")):(P=b,b=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");const A=this.length-h;if((b===void 0||b>A)&&(b=A),d.length>0&&(b<0||h<0)||h>this.length)throw new RangeError("Attempt to write outside buffer bounds");P||(P="utf8");let $=!1;for(;;)switch(P){case"hex":return q(this,d,h,b);case"utf8":case"utf-8":return B(this,d,h,b);case"ascii":case"latin1":case"binary":return te(this,d,h,b);case"base64":return ye(this,d,h,b);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return we(this,d,h,b);default:if($)throw new TypeError("Unknown encoding: "+P);P=(""+P).toLowerCase(),$=!0}},a.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function Te(v,d,h){return d===0&&h===v.length?e.fromByteArray(v):e.fromByteArray(v.slice(d,h))}function Ye(v,d,h){h=Math.min(v.length,h);const b=[];let P=d;for(;P<h;){const A=v[P];let $=null,ne=A>239?4:A>223?3:A>191?2:1;if(P+ne<=h){let Ie,de,ke,ve;switch(ne){case 1:A<128&&($=A);break;case 2:Ie=v[P+1],(Ie&192)===128&&(ve=(A&31)<<6|Ie&63,ve>127&&($=ve));break;case 3:Ie=v[P+1],de=v[P+2],(Ie&192)===128&&(de&192)===128&&(ve=(A&15)<<12|(Ie&63)<<6|de&63,ve>2047&&(ve<55296||ve>57343)&&($=ve));break;case 4:Ie=v[P+1],de=v[P+2],ke=v[P+3],(Ie&192)===128&&(de&192)===128&&(ke&192)===128&&(ve=(A&15)<<18|(Ie&63)<<12|(de&63)<<6|ke&63,ve>65535&&ve<1114112&&($=ve))}}$===null?($=65533,ne=1):$>65535&&($-=65536,b.push($>>>10&1023|55296),$=56320|$&1023),b.push($),P+=ne}return Gt(b)}const Vt=4096;function Gt(v){const d=v.length;if(d<=Vt)return String.fromCharCode.apply(String,v);let h="",b=0;for(;b<d;)h+=String.fromCharCode.apply(String,v.slice(b,b+=Vt));return h}function Q(v,d,h){let b="";h=Math.min(v.length,h);for(let P=d;P<h;++P)b+=String.fromCharCode(v[P]&127);return b}function rn(v,d,h){let b="";h=Math.min(v.length,h);for(let P=d;P<h;++P)b+=String.fromCharCode(v[P]);return b}function Kr(v,d,h){const b=v.length;(!d||d<0)&&(d=0),(!h||h<0||h>b)&&(h=b);let P="";for(let A=d;A<h;++A)P+=hc[v[A]];return P}function di(v,d,h){const b=v.slice(d,h);let P="";for(let A=0;A<b.length-1;A+=2)P+=String.fromCharCode(b[A]+b[A+1]*256);return P}a.prototype.slice=function(d,h){const b=this.length;d=~~d,h=h===void 0?b:~~h,d<0?(d+=b,d<0&&(d=0)):d>b&&(d=b),h<0?(h+=b,h<0&&(h=0)):h>b&&(h=b),h<d&&(h=d);const P=this.subarray(d,h);return Object.setPrototypeOf(P,a.prototype),P};function Re(v,d,h){if(v%1!==0||v<0)throw new RangeError("offset is not uint");if(v+d>h)throw new RangeError("Trying to access beyond buffer length")}a.prototype.readUintLE=a.prototype.readUIntLE=function(d,h,b){d=d>>>0,h=h>>>0,b||Re(d,h,this.length);let P=this[d],A=1,$=0;for(;++$<h&&(A*=256);)P+=this[d+$]*A;return P},a.prototype.readUintBE=a.prototype.readUIntBE=function(d,h,b){d=d>>>0,h=h>>>0,b||Re(d,h,this.length);let P=this[d+--h],A=1;for(;h>0&&(A*=256);)P+=this[d+--h]*A;return P},a.prototype.readUint8=a.prototype.readUInt8=function(d,h){return d=d>>>0,h||Re(d,1,this.length),this[d]},a.prototype.readUint16LE=a.prototype.readUInt16LE=function(d,h){return d=d>>>0,h||Re(d,2,this.length),this[d]|this[d+1]<<8},a.prototype.readUint16BE=a.prototype.readUInt16BE=function(d,h){return d=d>>>0,h||Re(d,2,this.length),this[d]<<8|this[d+1]},a.prototype.readUint32LE=a.prototype.readUInt32LE=function(d,h){return d=d>>>0,h||Re(d,4,this.length),(this[d]|this[d+1]<<8|this[d+2]<<16)+this[d+3]*16777216},a.prototype.readUint32BE=a.prototype.readUInt32BE=function(d,h){return d=d>>>0,h||Re(d,4,this.length),this[d]*16777216+(this[d+1]<<16|this[d+2]<<8|this[d+3])},a.prototype.readBigUInt64LE=qr(function(d){d=d>>>0,ot(d,"offset");const h=this[d],b=this[d+7];(h===void 0||b===void 0)&&at(d,this.length-8);const P=h+this[++d]*2**8+this[++d]*2**16+this[++d]*2**24,A=this[++d]+this[++d]*2**8+this[++d]*2**16+b*2**24;return BigInt(P)+(BigInt(A)<<BigInt(32))}),a.prototype.readBigUInt64BE=qr(function(d){d=d>>>0,ot(d,"offset");const h=this[d],b=this[d+7];(h===void 0||b===void 0)&&at(d,this.length-8);const P=h*2**24+this[++d]*2**16+this[++d]*2**8+this[++d],A=this[++d]*2**24+this[++d]*2**16+this[++d]*2**8+b;return(BigInt(P)<<BigInt(32))+BigInt(A)}),a.prototype.readIntLE=function(d,h,b){d=d>>>0,h=h>>>0,b||Re(d,h,this.length);let P=this[d],A=1,$=0;for(;++$<h&&(A*=256);)P+=this[d+$]*A;return A*=128,P>=A&&(P-=Math.pow(2,8*h)),P},a.prototype.readIntBE=function(d,h,b){d=d>>>0,h=h>>>0,b||Re(d,h,this.length);let P=h,A=1,$=this[d+--P];for(;P>0&&(A*=256);)$+=this[d+--P]*A;return A*=128,$>=A&&($-=Math.pow(2,8*h)),$},a.prototype.readInt8=function(d,h){return d=d>>>0,h||Re(d,1,this.length),this[d]&128?(255-this[d]+1)*-1:this[d]},a.prototype.readInt16LE=function(d,h){d=d>>>0,h||Re(d,2,this.length);const b=this[d]|this[d+1]<<8;return b&32768?b|4294901760:b},a.prototype.readInt16BE=function(d,h){d=d>>>0,h||Re(d,2,this.length);const b=this[d+1]|this[d]<<8;return b&32768?b|4294901760:b},a.prototype.readInt32LE=function(d,h){return d=d>>>0,h||Re(d,4,this.length),this[d]|this[d+1]<<8|this[d+2]<<16|this[d+3]<<24},a.prototype.readInt32BE=function(d,h){return d=d>>>0,h||Re(d,4,this.length),this[d]<<24|this[d+1]<<16|this[d+2]<<8|this[d+3]},a.prototype.readBigInt64LE=qr(function(d){d=d>>>0,ot(d,"offset");const h=this[d],b=this[d+7];(h===void 0||b===void 0)&&at(d,this.length-8);const P=this[d+4]+this[d+5]*2**8+this[d+6]*2**16+(b<<24);return(BigInt(P)<<BigInt(32))+BigInt(h+this[++d]*2**8+this[++d]*2**16+this[++d]*2**24)}),a.prototype.readBigInt64BE=qr(function(d){d=d>>>0,ot(d,"offset");const h=this[d],b=this[d+7];(h===void 0||b===void 0)&&at(d,this.length-8);const P=(h<<24)+this[++d]*2**16+this[++d]*2**8+this[++d];return(BigInt(P)<<BigInt(32))+BigInt(this[++d]*2**24+this[++d]*2**16+this[++d]*2**8+b)}),a.prototype.readFloatLE=function(d,h){return d=d>>>0,h||Re(d,4,this.length),t.read(this,d,!0,23,4)},a.prototype.readFloatBE=function(d,h){return d=d>>>0,h||Re(d,4,this.length),t.read(this,d,!1,23,4)},a.prototype.readDoubleLE=function(d,h){return d=d>>>0,h||Re(d,8,this.length),t.read(this,d,!0,52,8)},a.prototype.readDoubleBE=function(d,h){return d=d>>>0,h||Re(d,8,this.length),t.read(this,d,!1,52,8)};function $e(v,d,h,b,P,A){if(!a.isBuffer(v))throw new TypeError('"buffer" argument must be a Buffer instance');if(d>P||d<A)throw new RangeError('"value" argument is out of bounds');if(h+b>v.length)throw new RangeError("Index out of range")}a.prototype.writeUintLE=a.prototype.writeUIntLE=function(d,h,b,P){if(d=+d,h=h>>>0,b=b>>>0,!P){const ne=Math.pow(2,8*b)-1;$e(this,d,h,b,ne,0)}let A=1,$=0;for(this[h]=d&255;++$<b&&(A*=256);)this[h+$]=d/A&255;return h+b},a.prototype.writeUintBE=a.prototype.writeUIntBE=function(d,h,b,P){if(d=+d,h=h>>>0,b=b>>>0,!P){const ne=Math.pow(2,8*b)-1;$e(this,d,h,b,ne,0)}let A=b-1,$=1;for(this[h+A]=d&255;--A>=0&&($*=256);)this[h+A]=d/$&255;return h+b},a.prototype.writeUint8=a.prototype.writeUInt8=function(d,h,b){return d=+d,h=h>>>0,b||$e(this,d,h,1,255,0),this[h]=d&255,h+1},a.prototype.writeUint16LE=a.prototype.writeUInt16LE=function(d,h,b){return d=+d,h=h>>>0,b||$e(this,d,h,2,65535,0),this[h]=d&255,this[h+1]=d>>>8,h+2},a.prototype.writeUint16BE=a.prototype.writeUInt16BE=function(d,h,b){return d=+d,h=h>>>0,b||$e(this,d,h,2,65535,0),this[h]=d>>>8,this[h+1]=d&255,h+2},a.prototype.writeUint32LE=a.prototype.writeUInt32LE=function(d,h,b){return d=+d,h=h>>>0,b||$e(this,d,h,4,4294967295,0),this[h+3]=d>>>24,this[h+2]=d>>>16,this[h+1]=d>>>8,this[h]=d&255,h+4},a.prototype.writeUint32BE=a.prototype.writeUInt32BE=function(d,h,b){return d=+d,h=h>>>0,b||$e(this,d,h,4,4294967295,0),this[h]=d>>>24,this[h+1]=d>>>16,this[h+2]=d>>>8,this[h+3]=d&255,h+4};function hi(v,d,h,b,P){Sr(d,b,P,v,h,7);let A=Number(d&BigInt(4294967295));v[h++]=A,A=A>>8,v[h++]=A,A=A>>8,v[h++]=A,A=A>>8,v[h++]=A;let $=Number(d>>BigInt(32)&BigInt(4294967295));return v[h++]=$,$=$>>8,v[h++]=$,$=$>>8,v[h++]=$,$=$>>8,v[h++]=$,h}function Fr(v,d,h,b,P){Sr(d,b,P,v,h,7);let A=Number(d&BigInt(4294967295));v[h+7]=A,A=A>>8,v[h+6]=A,A=A>>8,v[h+5]=A,A=A>>8,v[h+4]=A;let $=Number(d>>BigInt(32)&BigInt(4294967295));return v[h+3]=$,$=$>>8,v[h+2]=$,$=$>>8,v[h+1]=$,$=$>>8,v[h]=$,h+8}a.prototype.writeBigUInt64LE=qr(function(d,h=0){return hi(this,d,h,BigInt(0),BigInt("0xffffffffffffffff"))}),a.prototype.writeBigUInt64BE=qr(function(d,h=0){return Fr(this,d,h,BigInt(0),BigInt("0xffffffffffffffff"))}),a.prototype.writeIntLE=function(d,h,b,P){if(d=+d,h=h>>>0,!P){const Ie=Math.pow(2,8*b-1);$e(this,d,h,b,Ie-1,-Ie)}let A=0,$=1,ne=0;for(this[h]=d&255;++A<b&&($*=256);)d<0&&ne===0&&this[h+A-1]!==0&&(ne=1),this[h+A]=(d/$>>0)-ne&255;return h+b},a.prototype.writeIntBE=function(d,h,b,P){if(d=+d,h=h>>>0,!P){const Ie=Math.pow(2,8*b-1);$e(this,d,h,b,Ie-1,-Ie)}let A=b-1,$=1,ne=0;for(this[h+A]=d&255;--A>=0&&($*=256);)d<0&&ne===0&&this[h+A+1]!==0&&(ne=1),this[h+A]=(d/$>>0)-ne&255;return h+b},a.prototype.writeInt8=function(d,h,b){return d=+d,h=h>>>0,b||$e(this,d,h,1,127,-128),d<0&&(d=255+d+1),this[h]=d&255,h+1},a.prototype.writeInt16LE=function(d,h,b){return d=+d,h=h>>>0,b||$e(this,d,h,2,32767,-32768),this[h]=d&255,this[h+1]=d>>>8,h+2},a.prototype.writeInt16BE=function(d,h,b){return d=+d,h=h>>>0,b||$e(this,d,h,2,32767,-32768),this[h]=d>>>8,this[h+1]=d&255,h+2},a.prototype.writeInt32LE=function(d,h,b){return d=+d,h=h>>>0,b||$e(this,d,h,4,2147483647,-2147483648),this[h]=d&255,this[h+1]=d>>>8,this[h+2]=d>>>16,this[h+3]=d>>>24,h+4},a.prototype.writeInt32BE=function(d,h,b){return d=+d,h=h>>>0,b||$e(this,d,h,4,2147483647,-2147483648),d<0&&(d=4294967295+d+1),this[h]=d>>>24,this[h+1]=d>>>16,this[h+2]=d>>>8,this[h+3]=d&255,h+4},a.prototype.writeBigInt64LE=qr(function(d,h=0){return hi(this,d,h,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),a.prototype.writeBigInt64BE=qr(function(d,h=0){return Fr(this,d,h,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function Pn(v,d,h,b,P,A){if(h+b>v.length)throw new RangeError("Index out of range");if(h<0)throw new RangeError("Index out of range")}function fi(v,d,h,b,P){return d=+d,h=h>>>0,P||Pn(v,d,h,4),t.write(v,d,h,b,23,4),h+4}a.prototype.writeFloatLE=function(d,h,b){return fi(this,d,h,!0,b)},a.prototype.writeFloatBE=function(d,h,b){return fi(this,d,h,!1,b)};function pi(v,d,h,b,P){return d=+d,h=h>>>0,P||Pn(v,d,h,8),t.write(v,d,h,b,52,8),h+8}a.prototype.writeDoubleLE=function(d,h,b){return pi(this,d,h,!0,b)},a.prototype.writeDoubleBE=function(d,h,b){return pi(this,d,h,!1,b)},a.prototype.copy=function(d,h,b,P){if(!a.isBuffer(d))throw new TypeError("argument should be a Buffer");if(b||(b=0),!P&&P!==0&&(P=this.length),h>=d.length&&(h=d.length),h||(h=0),P>0&&P<b&&(P=b),P===b||d.length===0||this.length===0)return 0;if(h<0)throw new RangeError("targetStart out of bounds");if(b<0||b>=this.length)throw new RangeError("Index out of range");if(P<0)throw new RangeError("sourceEnd out of bounds");P>this.length&&(P=this.length),d.length-h<P-b&&(P=d.length-h+b);const A=P-b;return this===d&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(h,b,P):Uint8Array.prototype.set.call(d,this.subarray(b,P),h),A},a.prototype.fill=function(d,h,b,P){if(typeof d=="string"){if(typeof h=="string"?(P=h,h=0,b=this.length):typeof b=="string"&&(P=b,b=this.length),P!==void 0&&typeof P!="string")throw new TypeError("encoding must be a string");if(typeof P=="string"&&!a.isEncoding(P))throw new TypeError("Unknown encoding: "+P);if(d.length===1){const $=d.charCodeAt(0);(P==="utf8"&&$<128||P==="latin1")&&(d=$)}}else typeof d=="number"?d=d&255:typeof d=="boolean"&&(d=Number(d));if(h<0||this.length<h||this.length<b)throw new RangeError("Out of range index");if(b<=h)return this;h=h>>>0,b=b===void 0?this.length:b>>>0,d||(d=0);let A;if(typeof d=="number")for(A=h;A<b;++A)this[A]=d;else{const $=a.isBuffer(d)?d:a.from(d,P),ne=$.length;if(ne===0)throw new TypeError('The value "'+d+'" is invalid for argument "value"');for(A=0;A<b-h;++A)this[A+h]=$[A%ne]}return this};const _={};function dr(v,d,h){_[v]=class extends h{constructor(){super();Object.defineProperty(this,"message",{value:d.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${v}]`,this.stack,delete this.name}get code(){return v}set code(P){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:P,writable:!0})}toString(){return`${this.name} [${v}]: ${this.message}`}}}dr("ERR_BUFFER_OUT_OF_BOUNDS",function(v){return v?`${v} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),dr("ERR_INVALID_ARG_TYPE",function(v,d){return`The "${v}" argument must be of type number. Received type ${typeof d}`},TypeError),dr("ERR_OUT_OF_RANGE",function(v,d,h){let b=`The value of "${v}" is out of range.`,P=h;return Number.isInteger(h)&&Math.abs(h)>2**32?P=At(String(h)):typeof h=="bigint"&&(P=String(h),(h>BigInt(2)**BigInt(32)||h<-(BigInt(2)**BigInt(32)))&&(P=At(P)),P+="n"),b+=` It must be ${d}. Received ${P}`,b},RangeError);function At(v){let d="",h=v.length;const b=v[0]==="-"?1:0;for(;h>=b+4;h-=3)d=`_${v.slice(h-3,h)}${d}`;return`${v.slice(0,h)}${d}`}function hr(v,d,h){ot(d,"offset"),(v[d]===void 0||v[d+h]===void 0)&&at(d,v.length-(h+1))}function Sr(v,d,h,b,P,A){if(v>h||v<d){const $=typeof d=="bigint"?"n":"";let ne;throw A>3?d===0||d===BigInt(0)?ne=`>= 0${$} and < 2${$} ** ${(A+1)*8}${$}`:ne=`>= -(2${$} ** ${(A+1)*8-1}${$}) and < 2 ** ${(A+1)*8-1}${$}`:ne=`>= ${d}${$} and <= ${h}${$}`,new _.ERR_OUT_OF_RANGE("value",ne,v)}hr(b,P,A)}function ot(v,d){if(typeof v!="number")throw new _.ERR_INVALID_ARG_TYPE(d,"number",v)}function at(v,d,h){throw Math.floor(v)!==v?(ot(v,h),new _.ERR_OUT_OF_RANGE(h||"offset","an integer",v)):d<0?new _.ERR_BUFFER_OUT_OF_BOUNDS:new _.ERR_OUT_OF_RANGE(h||"offset",`>= ${h?1:0} and <= ${d}`,v)}const uc=/[^+/0-9A-Za-z-_]/g;function Wt(v){if(v=v.split("=")[0],v=v.trim().replace(uc,""),v.length<2)return"";for(;v.length%4!==0;)v=v+"=";return v}function Ns(v,d){d=d||1/0;let h;const b=v.length;let P=null;const A=[];for(let $=0;$<b;++$){if(h=v.charCodeAt($),h>55295&&h<57344){if(!P){if(h>56319){(d-=3)>-1&&A.push(239,191,189);continue}else if($+1===b){(d-=3)>-1&&A.push(239,191,189);continue}P=h;continue}if(h<56320){(d-=3)>-1&&A.push(239,191,189),P=h;continue}h=(P-55296<<10|h-56320)+65536}else P&&(d-=3)>-1&&A.push(239,191,189);if(P=null,h<128){if((d-=1)<0)break;A.push(h)}else if(h<2048){if((d-=2)<0)break;A.push(h>>6|192,h&63|128)}else if(h<65536){if((d-=3)<0)break;A.push(h>>12|224,h>>6&63|128,h&63|128)}else if(h<1114112){if((d-=4)<0)break;A.push(h>>18|240,h>>12&63|128,h>>6&63|128,h&63|128)}else throw new Error("Invalid code point")}return A}function dc(v){const d=[];for(let h=0;h<v.length;++h)d.push(v.charCodeAt(h)&255);return d}function yu(v,d){let h,b,P;const A=[];for(let $=0;$<v.length&&!((d-=2)<0);++$)h=v.charCodeAt($),b=h>>8,P=h%256,A.push(P),A.push(b);return A}function Mn(v){return e.toByteArray(Wt(v))}function gi(v,d,h,b){let P;for(P=0;P<b&&!(P+h>=d.length||P>=v.length);++P)d[P+h]=v[P];return P}function Ht(v,d){return v instanceof d||v!=null&&v.constructor!=null&&v.constructor.name!=null&&v.constructor.name===d.name}function Wo(v){return v!==v}const hc=function(){const v="0123456789abcdef",d=new Array(256);for(let h=0;h<16;++h){const b=h*16;for(let P=0;P<16;++P)d[b+P]=v[h]+v[P]}return d}();function qr(v){return typeof BigInt=="undefined"?fc:v}function fc(){throw new Error("BigInt not supported")}})(b_);(function(n,e){var t=b_,r=t.Buffer;function i(o,a){for(var l in o)a[l]=o[l]}r.from&&r.alloc&&r.allocUnsafe&&r.allocUnsafeSlow?n.exports=t:(i(t,e),e.Buffer=s);function s(o,a,l){return r(o,a,l)}i(r,s),s.from=function(o,a,l){if(typeof o=="number")throw new TypeError("Argument must not be a number");return r(o,a,l)},s.alloc=function(o,a,l){if(typeof o!="number")throw new TypeError("Argument must be a number");var u=r(o);return a!==void 0?typeof l=="string"?u.fill(a,l):u.fill(a):u.fill(0),u},s.allocUnsafe=function(o){if(typeof o!="number")throw new TypeError("Argument must be a number");return r(o)},s.allocUnsafeSlow=function(o){if(typeof o!="number")throw new TypeError("Argument must be a number");return t.SlowBuffer(o)}})(Lh,Lh.exports);var Nc=Lh.exports.Buffer;function sM(n){if(n.length>=255)throw new TypeError("Alphabet too long");for(var e=new Uint8Array(256),t=0;t<e.length;t++)e[t]=255;for(var r=0;r<n.length;r++){var i=n.charAt(r),s=i.charCodeAt(0);if(e[s]!==255)throw new TypeError(i+" is ambiguous");e[s]=r}var o=n.length,a=n.charAt(0),l=Math.log(o)/Math.log(256),u=Math.log(256)/Math.log(o);function c(f){if((Array.isArray(f)||f instanceof Uint8Array)&&(f=Nc.from(f)),!Nc.isBuffer(f))throw new TypeError("Expected Buffer");if(f.length===0)return"";for(var E=0,I=0,w=0,k=f.length;w!==k&&f[w]===0;)w++,E++;for(var C=(k-w)*u+1>>>0,S=new Uint8Array(C);w!==k;){for(var T=f[w],D=0,R=C-1;(T!==0||D<I)&&R!==-1;R--,D++)T+=256*S[R]>>>0,S[R]=T%o>>>0,T=T/o>>>0;if(T!==0)throw new Error("Non-zero carry");I=D,w++}for(var U=C-I;U!==C&&S[U]===0;)U++;for(var q=a.repeat(E);U<C;++U)q+=n.charAt(S[U]);return q}function g(f){if(typeof f!="string")throw new TypeError("Expected String");if(f.length===0)return Nc.alloc(0);for(var E=0,I=0,w=0;f[E]===a;)I++,E++;for(var k=(f.length-E)*l+1>>>0,C=new Uint8Array(k);f[E];){var S=e[f.charCodeAt(E)];if(S===255)return;for(var T=0,D=k-1;(S!==0||T<w)&&D!==-1;D--,T++)S+=o*C[D]>>>0,C[D]=S%256>>>0,S=S/256>>>0;if(S!==0)throw new Error("Non-zero carry");w=T,E++}for(var R=k-w;R!==k&&C[R]===0;)R++;var U=Nc.allocUnsafe(I+(k-R));U.fill(0,0,I);for(var q=I;R!==k;)U[q++]=C[R++];return U}function m(f){var E=g(f);if(E)return E;throw new Error("Non-base"+o+" character")}return{encode:c,decodeUnsafe:g,decode:m}}var oM=sM,aM=oM,cM="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz",lM=aM(cM),uM=G.exports;Object.defineProperty(Vo,"__esModule",{value:!0});Vo.decodeRecoveryKey=hM;Vo.encodeRecoveryKey=dM;var R_=uM(lM);const Di=[139,1];function dM(n){const e=new Buffer(Di.length+n.length+1);e.set(Di,0),e.set(n,Di.length);let t=0;for(let i=0;i<e.length-1;++i)t^=e[i];return e[e.length-1]=t,R_.default.encode(e).match(/.{1,4}/g).join(" ")}function hM(n){const e=R_.default.decode(n.replace(/ /g,""));let t=0;for(const r of e)t^=r;if(t!==0)throw new Error("Incorrect parity");for(let r=0;r<Di.length;++r)if(e[r]!==Di[r])throw new Error("Incorrect prefix");if(e.length!==Di.length+V.Olm.PRIVATE_KEY_LENGTH+1)throw new Error("Incorrect length");return Uint8Array.from(e.slice(Di.length,Di.length+V.Olm.PRIVATE_KEY_LENGTH))}var fe={},fM=G.exports;Object.defineProperty(fe,"__esModule",{value:!0});fe.VerificationRequestEvent=fe.VerificationRequest=fe.START_TYPE=fe.REQUEST_TYPE=fe.READY_TYPE=fe.Phase=fe.PHASE_UNSENT=fe.PHASE_STARTED=fe.PHASE_REQUESTED=fe.PHASE_READY=fe.PHASE_DONE=fe.PHASE_CANCELLED=fe.EVENT_PREFIX=fe.DONE_TYPE=fe.CANCEL_TYPE=void 0;var Tt=fM(Y.exports),Wi=se,Hi=Ke,am=cr,pM=je;const gM=10*60*1e3,mM=2*60*1e3,yM=3*1e3,$s="m.key.verification.";fe.EVENT_PREFIX=$s;const tr=$s+"request";fe.REQUEST_TYPE=tr;const gr=$s+"start";fe.START_TYPE=gr;const es=$s+"cancel";fe.CANCEL_TYPE=es;const I_=$s+"done";fe.DONE_TYPE=I_;const Oi=$s+"ready";fe.READY_TYPE=Oi;let ni;fe.Phase=ni;(function(n){n[n.Unsent=1]="Unsent",n[n.Requested=2]="Requested",n[n.Ready=3]="Ready",n[n.Started=4]="Started",n[n.Cancelled=5]="Cancelled",n[n.Done=6]="Done"})(ni||(fe.Phase=ni={}));const dn=ni.Unsent;fe.PHASE_UNSENT=dn;const Mr=ni.Requested;fe.PHASE_REQUESTED=Mr;const hn=ni.Ready;fe.PHASE_READY=hn;const ts=ni.Started;fe.PHASE_STARTED=ts;const ao=ni.Cancelled;fe.PHASE_CANCELLED=ao;const co=ni.Done;fe.PHASE_DONE=co;let Hn;fe.VerificationRequestEvent=Hn;(function(n){n.Change="change"})(Hn||(fe.VerificationRequestEvent=Hn={}));class vM extends pM.TypedEventEmitter{constructor(e,t,r){super();this.channel=e,this.verificationMethods=t,this.client=r,(0,Tt.default)(this,"eventsByUs",new Map),(0,Tt.default)(this,"eventsByThem",new Map),(0,Tt.default)(this,"_observeOnly",!1),(0,Tt.default)(this,"timeoutTimer",null),(0,Tt.default)(this,"_accepting",!1),(0,Tt.default)(this,"_declining",!1),(0,Tt.default)(this,"verifierHasFinished",!1),(0,Tt.default)(this,"_cancelled",!1),(0,Tt.default)(this,"_chosenMethod",null),(0,Tt.default)(this,"_qrCodeData",null),(0,Tt.default)(this,"requestReceivedAt",null),(0,Tt.default)(this,"commonMethods",[]),(0,Tt.default)(this,"_phase",void 0),(0,Tt.default)(this,"_cancellingUserId",void 0),(0,Tt.default)(this,"_verifier",void 0),(0,Tt.default)(this,"cancelOnTimeout",()=>{try{this.initiatedByMe?this.cancel({reason:"Other party didn't accept in time",code:"m.timeout"}):this.cancel({reason:"User didn't accept in time",code:"m.timeout"})}catch(i){Wi.logger.error("Error while cancelling verification request",i)}}),this.channel.request=this,this.setPhase(dn,!1)}static validateEvent(e,t,r){const i=t.getContent();return!e||!e.startsWith($s)?!1:i?(e===tr||e===Oi)&&!Array.isArray(i.methods)?(Wi.logger.log("VerificationRequest: validateEvent: fail because methods"),!1):(e===tr||e===Oi||e===gr)&&(typeof i.from_device!="string"||i.from_device.length===0)?(Wi.logger.log("VerificationRequest: validateEvent: fail because from_device"),!1):!0:(Wi.logger.log("VerificationRequest: validateEvent: no content"),!1)}get invalid(){return this.phase===dn}get requested(){return this.phase===Mr}get cancelled(){return this.phase===ao}get ready(){return this.phase===hn}get started(){return this.phase===ts}get done(){return this.phase===co}get methods(){return this.commonMethods}get chosenMethod(){return this._chosenMethod}calculateEventTimeout(e){let t=this.channel.getTimestamp(e)+gM;if(this.requestReceivedAt&&!this.initiatedByMe&&this.phase<=Mr){const r=this.requestReceivedAt+mM;t=Math.min(t,r)}return Math.max(0,t-Date.now())}get timeout(){const e=this.getEventByEither(tr);return e?this.calculateEventTimeout(e):0}get requestEvent(){return this.getEventByEither(tr)}get phase(){return this._phase}get verifier(){return this._verifier}get canAccept(){return this.phase<hn&&!this._accepting&&!this._declining}get accepting(){return this._accepting}get declining(){return this._declining}get pending(){return!this.observeOnly&&this._phase!==co&&this._phase!==ao}get qrCodeData(){return this._qrCodeData}otherPartySupportsMethod(e,t=!1){if(!t&&!this.ready&&!this.started)return!1;const r=this.eventsByThem.get(tr)||this.eventsByThem.get(Oi);if(!r){if(this.started&&this.initiatedByMe){const o=this.eventsByUs.get(gr),a=o&&o.getContent(),l=a&&a.method;return e==l}return!1}const i=r.getContent();if(!i)return!1;const{methods:s}=i;return Array.isArray(s)?s.includes(e):!1}get initiatedByMe(){const e=this.eventsByUs.size+this.eventsByThem.size===0;if(this._phase===dn&&e)return!0;const t=this.eventsByUs.has(tr),r=this.eventsByThem.has(tr);if(t&&!r)return!0;if(!t&&r)return!1;const i=this.eventsByUs.has(gr),s=this.eventsByThem.has(gr);return!!(i&&!s)}get requestingUserId(){return this.initiatedByMe?this.client.getUserId():this.otherUserId}get receivingUserId(){return this.initiatedByMe?this.otherUserId:this.client.getUserId()}get otherUserId(){return this.channel.userId}get isSelfVerification(){return this.client.getUserId()===this.otherUserId}get cancellingUserId(){const e=this.eventsByUs.get(es),t=this.eventsByThem.get(es);if(e&&(!t||e.getId()<t.getId()))return e.getSender();if(t)return t.getSender()}get cancellationCode(){const e=this.getEventByEither(es);return e?e.getContent().code:null}get observeOnly(){return this._observeOnly}get targetDevice(){const r=(this.eventsByThem.get(tr)||this.eventsByThem.get(Oi)||this.eventsByThem.get(gr)).getContent().from_device;return{userId:this.otherUserId,deviceId:r}}beginKeyVerification(e,t=null){if(!this.observeOnly&&!this._verifier&&(this.phase===Mr||this.phase===hn||this.phase===dn&&this.channel.canCreateRequest(gr))){if(this.commonMethods.length&&!this.commonMethods.includes(e)||(this._verifier=this.createVerifier(e,null,t),!this._verifier))throw(0,Hi.newUnknownMethodError)();this._chosenMethod=e}return this._verifier}async sendRequest(){if(!this.observeOnly&&this._phase===dn){const e=[...this.verificationMethods.keys()];await this.channel.send(tr,{methods:e})}}async cancel({reason:e="User declined",code:t="m.user"}={}){if(!this.observeOnly&&this._phase!==ao){if(this._declining=!0,this.emit(Hn.Change),this._verifier)return this._verifier.cancel((0,Hi.errorFactory)(t,e)());this._cancellingUserId=this.client.getUserId(),await this.channel.send(es,{code:t,reason:e})}}async accept(){if(!this.observeOnly&&this.phase===Mr&&!this.initiatedByMe){const e=[...this.verificationMethods.keys()];this._accepting=!0,this.emit(Hn.Change),await this.channel.send(Oi,{methods:e})}}waitFor(e){return new Promise((t,r)=>{const i=()=>{let s=!1;return e(this)?(t(this),s=!0):this.cancelled&&(r(new Error("cancelled")),s=!0),s&&this.off(Hn.Change,i),s};i()||this.on(Hn.Change,i)})}setPhase(e,t=!0){this._phase=e,t&&this.emit(Hn.Change)}getEventByEither(e){return this.eventsByThem.get(e)||this.eventsByUs.get(e)}getEventBy(e,t=!1){return t?this.eventsByThem.get(e):this.eventsByUs.get(e)}calculatePhaseTransitions(){const e=[{phase:dn}],t=()=>e[e.length-1].phase,r=this.eventsByThem.has(tr),i=this.getEventBy(tr,r);i&&e.push({phase:Mr,event:i});const s=i&&this.getEventBy(Oi,!r);s&&t()===Mr&&e.push({phase:hn,event:s});let o;if(s||!i){const u=this.eventsByThem.get(gr),c=this.eventsByUs.get(gr);u&&c?o=u.getSender()<c.getSender()?u:c:o=u||c}else o=this.getEventBy(gr,!r);if(o){const u=t()===Mr&&i.getSender()!==o.getSender(),c=t()===dn&&this.channel.canCreateRequest(gr);(u||t()===hn||c)&&e.push({phase:ts,event:o})}const a=this.eventsByUs.get(I_);(this.verifierHasFinished||a&&t()===ts)&&e.push({phase:co});const l=this.getEventByEither(es);return(this._cancelled||l)&&t()!==co&&e.push({phase:ao,event:l}),e}transitionToPhase(e){const{phase:t,event:r}=e;if((t===Mr||t===hn)&&!this.wasSentByOwnDevice(r)){const i=r.getContent();this.commonMethods=i.methods.filter(s=>this.verificationMethods.has(s))}if(this.observeOnly||(t===Mr||t===ts||t===hn)&&this.channel.receiveStartFromOtherDevices&&this.wasSentByOwnUser(r)&&!this.wasSentByOwnDevice(r)&&(this._observeOnly=!0),t===ts){const{method:i}=r.getContent();!this._verifier&&!this.observeOnly&&(this._verifier=this.createVerifier(i,r),this._verifier?this._chosenMethod=i:this.cancel({code:"m.unknown_method",reason:`Unknown method: ${i}`}))}}applyPhaseTransitions(){const e=this.calculatePhaseTransitions(),t=e.findIndex(i=>i.phase===this.phase),r=e.slice(t+1);for(const i of r)this.transitionToPhase(i);return r}isWinningStartRace(e){if(e.getType()!==gr)return!1;const t=this._verifier.startEvent;let r;if(this.isSelfVerification)if(t){const s=t.getContent();r=s&&s.from_device}else r=this.client.getDeviceId();else t?r=t.getSender():r=this.client.getUserId();let i;if(this.isSelfVerification){const s=e.getContent();i=s&&s.from_device}else i=e.getSender();return i<r}hasEventId(e){for(const t of this.eventsByUs.values())if(t.getId()===e)return!0;for(const t of this.eventsByThem.values())if(t.getId()===e)return!0;return!1}async handleEvent(e,t,r,i,s){if(this.done||this.cancelled)return;const o=this._observeOnly;if(this.adjustObserveOnly(t,r),!this.observeOnly&&!i&&await this.cancelOnError(e,t)||(s?this.eventsByUs.has(e):this.eventsByThem.has(e)))return;const l=this.phase;this.addEvent(e,t,s);const u=this.applyPhaseTransitions();try{if(this._verifier&&!this.observeOnly){const g=this.isWinningStartRace(t);if(this._verifier.canSwitchStartEvent(t)&&g)this._verifier.switchStartEvent(t);else if(!i){var c;(e===es||(c=this._verifier.events)!==null&&c!==void 0&&c.includes(e))&&this._verifier.handleEvent(t)}}if(u.length){r&&u.some(f=>f.phase===hn)&&this.otherPartySupportsMethod(am.SCAN_QR_CODE_METHOD,!0)&&(this._qrCodeData=await am.QRCodeData.create(this,this.client));const g=u[u.length-1],{phase:m}=g;this.setupTimeout(m),this.setPhase(m)}else this._observeOnly!==o&&this.emit(Hn.Change)}finally{Wi.logger.log(`Verification request ${this.channel.transactionId}: ${e} event with id:${t.getId()}, content:${JSON.stringify(t.getContent())} deviceId:${this.channel.deviceId}, sender:${t.getSender()}, isSentByUs:${s}, isLiveEvent:${r}, isRemoteEcho:${i}, phase:${l}=>${this.phase}, observeOnly:${o}=>${this._observeOnly}`)}}setupTimeout(e){!this.timeoutTimer&&!this.observeOnly&&e===Mr&&(this.timeoutTimer=setTimeout(this.cancelOnTimeout,this.timeout)),this.timeoutTimer&&(e===ts||e===hn||e===co||e===ao)&&(clearTimeout(this.timeoutTimer),this.timeoutTimer=null)}async cancelOnError(e,t){if(e===gr){const s=t.getContent().method;if(!this.verificationMethods.has(s))return await this.cancel((0,Hi.errorFromEvent)((0,Hi.newUnknownMethodError)())),!0}const r=e===tr&&this.phase!==dn,i=e===Oi&&this.phase!==Mr;if(this.phase!==dn&&(r||i)){Wi.logger.warn(`Cancelling, unexpected ${e} verification event from ${t.getSender()}`);const s=`Unexpected ${e} event in phase ${this.phase}`;return await this.cancel((0,Hi.errorFromEvent)((0,Hi.newUnexpectedMessageError)({reason:s}))),!0}return!1}adjustObserveOnly(e,t=!1){t||(this._observeOnly=!0),this.calculateEventTimeout(e)<yM&&(this._observeOnly=!0)}addEvent(e,t,r=!1){if(r?this.eventsByUs.set(e,t):this.eventsByThem.set(e,t),e===tr){for(const[i,s]of this.eventsByThem.entries())s.getSender()!==this.otherUserId&&this.eventsByThem.delete(i);this.requestReceivedAt=Date.now()}}createVerifier(e,t=null,r=null){r||(r=this.targetDevice);const{userId:i,deviceId:s}=r,o=this.verificationMethods.get(e);if(!o){Wi.logger.warn("could not find verifier constructor for method",e);return}return new o(this.channel,this.client,i,s,t,this)}wasSentByOwnUser(e){return e.getSender()===this.client.getUserId()}wasSentByOwnDevice(e){if(!this.wasSentByOwnUser(e))return!1;const t=e.getContent();return!(!t||t.from_device!==this.client.getDeviceId())}onVerifierCancelled(){this._cancelled=!0;const e=this.applyPhaseTransitions();e.length&&this.setPhase(e[e.length-1].phase)}onVerifierFinished(){this.channel.send("m.key.verification.done",{}),this.verifierHasFinished=!0;const e=this.applyPhaseTransitions();e.length&&this.setPhase(e[e.length-1].phase)}getEventFromOtherParty(e){return this.eventsByThem.get(e)}}fe.VerificationRequest=vM;var ko={},_M=G.exports;Object.defineProperty(ko,"__esModule",{value:!0});ko.InRoomRequests=ko.InRoomChannel=void 0;var T_=_M(Y.exports),$t=fe,hd=se,EM=ie;const cm=EM.EventType.RoomMessage,lm="m.reference",um="m.relates_to";class or{constructor(e,t,r=null){this.client=e,this.roomId=t,this.userId=r,(0,T_.default)(this,"requestEventId",null)}get receiveStartFromOtherDevices(){return!0}get transactionId(){return this.requestEventId}static getOtherPartyUserId(e,t){if(or.getEventType(e)!==$t.REQUEST_TYPE)return;const i=t.getUserId(),s=e.getSender(),a=e.getContent().to;if(s===i)return a;if(a===i)return s}getTimestamp(e){return e.getTs()}static canCreateRequest(e){return e===$t.REQUEST_TYPE}canCreateRequest(e){return or.canCreateRequest(e)}static getTransactionId(e){if(or.getEventType(e)===$t.REQUEST_TYPE)return e.getId();{const t=e.getRelation();if(t&&t.rel_type===lm)return t.event_id}}static validateEvent(e,t){const r=or.getTransactionId(e);if(typeof r!="string"||r.length===0)return!1;const i=or.getEventType(e),s=e.getContent();if(i===$t.REQUEST_TYPE){if(!s||typeof s.to!="string"||!s.to.length)return hd.logger.log("InRoomChannel: validateEvent: no valid to "+(s&&s.to)),!1;if(!or.getOtherPartyUserId(e,t))return hd.logger.log(`InRoomChannel: validateEvent: not directed to or sent by me: ${e.getSender()}, ${s&&s.to}`),!1}return $t.VerificationRequest.validateEvent(i,e,t)}static getEventType(e){const t=e.getType();if(t===cm){const r=e.getContent();if(r){const{msgtype:i}=r;if(i===$t.REQUEST_TYPE)return $t.REQUEST_TYPE}}return t&&t!==$t.REQUEST_TYPE?t:""}async handleEvent(e,t,r=!1){if(t.hasEventId(e.getId()))return;const i=or.getEventType(e);if(e.getRoomId()!==this.roomId)return;if(this.userId===null){const u=or.getOtherPartyUserId(e,this.client);u&&(this.userId=u)}const s=this.client.getUserId(),o=e.getSender();if(this.userId!==null&&o!==s&&o!==this.userId){hd.logger.log(`InRoomChannel: ignoring verification event from non-participating sender ${o}`);return}this.requestEventId===null&&(this.requestEventId=or.getTransactionId(e));const a=!!e.getUnsigned().transaction_id,l=e.getSender()===this.client.getUserId();return await t.handleEvent(i,e,r,a,l)}completedContentFromEvent(e){const t=Object.assign({},e.getContent());return t[um]=e.getRelation(),t}completeContent(e,t){return t=Object.assign({},t),(e===$t.REQUEST_TYPE||e===$t.READY_TYPE||e===$t.START_TYPE)&&(t.from_device=this.client.getDeviceId()),e===$t.REQUEST_TYPE?t={body:this.client.getUserId()+" is requesting to verify your key, but your client does not support in-chat key verification. You will need to use legacy key verification to verify keys.",msgtype:$t.REQUEST_TYPE,to:this.userId,from_device:t.from_device,methods:t.methods}:t[um]={rel_type:lm,event_id:this.transactionId},t}send(e,t){const r=this.completeContent(e,t);return this.sendCompleted(e,r)}async sendCompleted(e,t){let r=e;e===$t.REQUEST_TYPE&&(r=cm);const i=await this.client.sendEvent(this.roomId,r,t);e===$t.REQUEST_TYPE&&(this.requestEventId=i.event_id)}}ko.InRoomChannel=or;class SM{constructor(){(0,T_.default)(this,"requestsByRoomId",new Map)}getRequest(e){const t=e.getRoomId(),r=or.getTransactionId(e);return this.getRequestByTxnId(t,r)}getRequestByChannel(e){return this.getRequestByTxnId(e.roomId,e.transactionId)}getRequestByTxnId(e,t){const r=this.requestsByRoomId.get(e);if(r)return r.get(t)}setRequest(e,t){this.doSetRequest(e.getRoomId(),or.getTransactionId(e),t)}setRequestByChannel(e,t){this.doSetRequest(e.roomId,e.transactionId,t)}doSetRequest(e,t,r){let i=this.requestsByRoomId.get(e);i||(i=new Map,this.requestsByRoomId.set(e,i)),i.set(t,r)}removeRequest(e){const t=e.getRoomId(),r=this.requestsByRoomId.get(t);r&&(r.delete(or.getTransactionId(e)),r.size===0&&this.requestsByRoomId.delete(t))}findRequestInProgress(e){const t=this.requestsByRoomId.get(e);if(t){for(const r of t.values())if(r.pending)return r}}}ko.InRoomRequests=SM;var Co={},bM=G.exports;Object.defineProperty(Co,"__esModule",{value:!0});Co.ToDeviceRequests=Co.ToDeviceChannel=void 0;var O_=bM(Y.exports),wM=ai,ca=se,Le=fe,dm=Ke,RM=jt;class us{constructor(e,t,r,i=null,s=null){this.client=e,this.userId=t,this.devices=r,this.transactionId=i,this.deviceId=s,(0,O_.default)(this,"request",void 0)}isToDevices(e){if(e.length===this.devices.length){for(const t of e)if(!this.devices.includes(t))return!1;return!0}else return!1}static getEventType(e){return e.getType()}static getTransactionId(e){const t=e.getContent();return t&&t.transaction_id}static canCreateRequest(e){return e===Le.REQUEST_TYPE||e===Le.START_TYPE}canCreateRequest(e){return us.canCreateRequest(e)}static validateEvent(e,t){if(e.isCancelled())return ca.logger.warn("Ignoring flagged verification request from "+e.getSender()),!1;const r=e.getContent();if(!r)return ca.logger.warn("ToDeviceChannel.validateEvent: invalid: no content"),!1;if(!r.transaction_id)return ca.logger.warn("ToDeviceChannel.validateEvent: invalid: no transaction_id"),!1;const i=e.getType();if(i===Le.REQUEST_TYPE){if(!Number.isFinite(r.timestamp))return ca.logger.warn("ToDeviceChannel.validateEvent: invalid: no timestamp"),!1;if(e.getSender()===t.getUserId()&&r.from_device==t.getDeviceId())return ca.logger.warn("ToDeviceChannel.validateEvent: invalid: from own device"),!1}return Le.VerificationRequest.validateEvent(i,e,t)}getTimestamp(e){const t=e.getContent();return t&&t.timestamp}async handleEvent(e,t,r=!1){const i=e.getType(),s=e.getContent();if(i===Le.REQUEST_TYPE||i===Le.READY_TYPE||i===Le.START_TYPE){this.transactionId||(this.transactionId=s.transaction_id);const u=s.from_device;if(!this.deviceId&&this.devices.includes(u)&&(this.deviceId=u),!this.deviceId||this.deviceId!==u){const c=this.completeContent(Le.CANCEL_TYPE,(0,dm.errorFromEvent)((0,dm.newUnexpectedMessageError)()));return this.sendToDevices(Le.CANCEL_TYPE,c,[u])}}const o=t.phase===Le.PHASE_STARTED||t.phase===Le.PHASE_READY;await t.handleEvent(e.getType(),e,r,!1,!1);const a=t.phase===Le.PHASE_STARTED||t.phase===Le.PHASE_READY;if((i===Le.START_TYPE||i===Le.READY_TYPE)&&!o&&a&&this.deviceId){const u=this.devices.filter(c=>c!==this.deviceId&&c!==this.client.getDeviceId());if(u.length){const c=this.completeContent(Le.CANCEL_TYPE,{code:"m.accepted",reason:"Verification request accepted by another device"});await this.sendToDevices(Le.CANCEL_TYPE,c,u)}}}completedContentFromEvent(e){return e.getContent()}completeContent(e,t){return t=Object.assign({},t),this.transactionId&&(t.transaction_id=this.transactionId),(e===Le.REQUEST_TYPE||e===Le.READY_TYPE||e===Le.START_TYPE)&&(t.from_device=this.client.getDeviceId()),e===Le.REQUEST_TYPE&&(t.timestamp=Date.now()),t}send(e,t={}){(e===Le.REQUEST_TYPE||e===Le.START_TYPE)&&!this.transactionId&&(this.transactionId=us.makeTransactionId());const r=this.completeContent(e,t);return this.sendCompleted(e,r)}async sendCompleted(e,t){let r;e===Le.REQUEST_TYPE||e===Le.CANCEL_TYPE&&!this.deviceId?r=await this.sendToDevices(e,t,this.devices):r=await this.sendToDevices(e,t,[this.deviceId]);const i=new RM.MatrixEvent({sender:this.client.getUserId(),content:t,type:e});return await this.request.handleEvent(e,i,!0,!0,!0),r}async sendToDevices(e,t,r){if(r.length){const i={};for(const s of r)i[s]=t;await this.client.sendToDevice(e,{[this.userId]:i})}}static makeTransactionId(){return(0,wM.randomString)(32)}}Co.ToDeviceChannel=us;class IM{constructor(){(0,O_.default)(this,"requestsByUserId",new Map)}getRequest(e){return this.getRequestBySenderAndTxnId(e.getSender(),us.getTransactionId(e))}getRequestByChannel(e){return this.getRequestBySenderAndTxnId(e.userId,e.transactionId)}getRequestBySenderAndTxnId(e,t){const r=this.requestsByUserId.get(e);if(r)return r.get(t)}setRequest(e,t){this.setRequestBySenderAndTxnId(e.getSender(),us.getTransactionId(e),t)}setRequestByChannel(e,t){this.setRequestBySenderAndTxnId(e.userId,e.transactionId,t)}setRequestBySenderAndTxnId(e,t,r){let i=this.requestsByUserId.get(e);i||(i=new Map,this.requestsByUserId.set(e,i)),i.set(t,r)}removeRequest(e){const t=e.getSender(),r=this.requestsByUserId.get(t);r&&(r.delete(us.getTransactionId(e)),r.size===0&&this.requestsByUserId.delete(t))}findRequestInProgress(e,t){const r=this.requestsByUserId.get(e);if(r){for(const i of r.values())if(i.pending&&i.channel.isToDevices(t))return i}}getRequestsInProgress(e){const t=this.requestsByUserId.get(e);return t?Array.from(t.values()).filter(r=>r.pending):[]}}Co.ToDeviceRequests=IM;var cu={},TM=G.exports;Object.defineProperty(cu,"__esModule",{value:!0});cu.IllegalMethod=void 0;var OM=TM(Y.exports),kM=Xr;class Mf extends kM.VerificationBase{constructor(...e){super(...e);(0,OM.default)(this,"doVerification",async()=>{throw new Error("Verification is not possible with this method")})}static factory(e,t,r,i,s,o){return new Mf(e,t,r,i,s,o)}static get NAME(){return"org.matrix.illegal_method"}}cu.IllegalMethod=Mf;var Rs={},k_=G.exports;Object.defineProperty(Rs,"__esModule",{value:!0});Rs.DehydrationManager=Rs.DEHYDRATION_ALGORITHM=void 0;var la=k_(Y.exports),fd=k_(tu),hm=xe,pd=Br,fm=li,Nn=se,pm=me;const al="org.matrix.msc2697.v1.olm.libolm_pickle";Rs.DEHYDRATION_ALGORITHM=al;const gm=7*24*60*60*1e3;class CM{constructor(e){this.crypto=e,(0,la.default)(this,"inProgress",!1),(0,la.default)(this,"timeoutId",void 0),(0,la.default)(this,"key",void 0),(0,la.default)(this,"keyInfo",void 0),(0,la.default)(this,"deviceDisplayName",void 0),this.getDehydrationKeyFromCache()}async getDehydrationKeyFromCache(){return await this.crypto.cryptoStore.doTxn("readonly",[pd.IndexedDBCryptoStore.STORE_ACCOUNT],e=>{this.crypto.cryptoStore.getSecretStorePrivateKey(e,async t=>{if(t){const{key:r,keyInfo:i,deviceDisplayName:s,time:o}=t,a=Buffer.from(this.crypto.olmDevice.pickleKey),l=await(0,fm.decryptAES)(r,a,al);this.key=(0,hm.decodeBase64)(l),this.keyInfo=i,this.deviceDisplayName=s;const u=Date.now(),c=Math.max(1,o+gm-u);this.timeoutId=V.setTimeout(this.dehydrateDevice.bind(this),c)}},"dehydration")})}async setKeyAndQueueDehydration(e,t={},r=void 0){await this.setKey(e,t,r)||this.dehydrateDevice()}async setKey(e,t={},r=void 0){if(!e){this.timeoutId&&(V.clearTimeout(this.timeoutId),this.timeoutId=void 0),await this.crypto.cryptoStore.doTxn("readwrite",[pd.IndexedDBCryptoStore.STORE_ACCOUNT],s=>{this.crypto.cryptoStore.storeSecretStorePrivateKey(s,"dehydration",null)}),this.key=void 0,this.keyInfo=void 0;return}let i=this.key&&e.length==this.key.length;for(let s=0;i&&s<e.length;s++)e[s]!=this.key[s]&&(i=!1);return i||(this.key=e,this.keyInfo=t,this.deviceDisplayName=r),i}async dehydrateDevice(){if(this.inProgress){Nn.logger.log("Dehydration already in progress -- not starting new dehydration");return}this.inProgress=!0,this.timeoutId&&(V.clearTimeout(this.timeoutId),this.timeoutId=void 0);try{const e=Buffer.from(this.crypto.olmDevice.pickleKey),t=await(0,fm.encryptAES)((0,hm.encodeBase64)(this.key),e,al);await this.crypto.cryptoStore.doTxn("readwrite",[pd.IndexedDBCryptoStore.STORE_ACCOUNT],w=>{this.crypto.cryptoStore.storeSecretStorePrivateKey(w,"dehydration",{keyInfo:this.keyInfo,key:t,deviceDisplayName:this.deviceDisplayName,time:Date.now()})}),Nn.logger.log("Attempting to dehydrate device"),Nn.logger.log("Creating account");const r=new V.Olm.Account;r.create();const i=JSON.parse(r.identity_keys()),s=r.max_number_of_one_time_keys();r.generate_one_time_keys(s/2),r.generate_fallback_key();const o=JSON.parse(r.one_time_keys()),a=JSON.parse(r.fallback_key());r.mark_keys_as_published();const l=r.pickle(new Uint8Array(this.key)),u={algorithm:al,account:l};this.keyInfo.passphrase&&(u.passphrase=this.keyInfo.passphrase),Nn.logger.log("Uploading account to server");const g=(await this.crypto.baseApis.http.authedRequest(void 0,pm.Method.Put,"/dehydrated_device",void 0,{device_data:u,initial_device_display_name:this.deviceDisplayName},{prefix:"/_matrix/client/unstable/org.matrix.msc2697.v2"})).device_id;Nn.logger.log("Preparing device keys",g);const m={algorithms:this.crypto.supportedAlgorithms,device_id:g,user_id:this.crypto.userId,keys:{[`ed25519:${g}`]:i.ed25519,[`curve25519:${g}`]:i.curve25519}},f=r.sign(fd.default.stringify(m));m.signatures={[this.crypto.userId]:{[`ed25519:${g}`]:f}},this.crypto.crossSigningInfo.getId("self_signing")&&await this.crypto.crossSigningInfo.signObject(m,"self_signing"),Nn.logger.log("Preparing one-time keys");const E={};for(const[w,k]of Object.entries(o.curve25519)){const C={key:k},S=r.sign(fd.default.stringify(C));C.signatures={[this.crypto.userId]:{[`ed25519:${g}`]:S}},E[`signed_curve25519:${w}`]=C}Nn.logger.log("Preparing fallback keys");const I={};for(const[w,k]of Object.entries(a.curve25519)){const C={key:k,fallback:!0},S=r.sign(fd.default.stringify(C));C.signatures={[this.crypto.userId]:{[`ed25519:${g}`]:S}},I[`signed_curve25519:${w}`]=C}return Nn.logger.log("Uploading keys to server"),await this.crypto.baseApis.http.authedRequest(void 0,pm.Method.Post,"/keys/upload/"+encodeURI(g),void 0,{device_keys:m,one_time_keys:E,"org.matrix.msc2732.fallback_keys":I}),Nn.logger.log("Done dehydrating"),this.timeoutId=V.setTimeout(this.dehydrateDevice.bind(this),gm),g}finally{this.inProgress=!1}}stop(){this.timeoutId&&(V.clearTimeout(this.timeoutId),this.timeoutId=void 0)}}Rs.DehydrationManager=CM;var yr={},PM=G.exports;Object.defineProperty(yr,"__esModule",{value:!0});yr.algorithmsByName=yr.DefaultAlgorithm=yr.Curve25519=yr.BackupManager=yr.Aes256=void 0;var uo=PM(Y.exports),MM=st,mt=se,ua=xe,C_=Us,Bh=W,mm=Br,AM=Vo,da=li,DM=_r,zs=Ft;const xM=200;class Ua{constructor(e,t){this.baseApis=e,this.getKey=t,(0,uo.default)(this,"algorithm",void 0),(0,uo.default)(this,"backupInfo",void 0),(0,uo.default)(this,"checkedForBackup",void 0),(0,uo.default)(this,"sendingBackups",void 0),this.checkedForBackup=!1,this.sendingBackups=!1}get version(){return this.backupInfo&&this.backupInfo.version}static checkBackupVersion(e){const t=cl[e.algorithm];if(!t)throw new Error("Unknown backup algorithm: "+e.algorithm);if(typeof e.auth_data!="object")throw new Error("Invalid backup data returned");return t.checkBackupVersion(e)}static async makeAlgorithm(e,t){const r=cl[e.algorithm];if(!r)throw new Error("Unknown backup algorithm");return await r.init(e.auth_data,t)}async enableKeyBackup(e){this.backupInfo=e,this.algorithm&&this.algorithm.free(),this.algorithm=await Ua.makeAlgorithm(e,this.getKey),this.baseApis.emit(zs.CryptoEvent.KeyBackupStatus,!0),this.scheduleKeyBackupSend()}disableKeyBackup(){this.algorithm&&this.algorithm.free(),this.algorithm=void 0,this.backupInfo=void 0,this.baseApis.emit(zs.CryptoEvent.KeyBackupStatus,!1)}getKeyBackupEnabled(){return this.checkedForBackup?Boolean(this.algorithm):null}async prepareKeyBackupVersion(e,t){const r=t?cl[t]:P_;if(!r)throw new Error("Unknown backup algorithm");const[i,s]=await r.prepare(e),o=(0,AM.encodeRecoveryKey)(i);return{algorithm:r.algorithmName,auth_data:s,recovery_key:o,privateKey:i}}async createKeyBackupVersion(e){this.algorithm=await Ua.makeAlgorithm(e,this.getKey)}async checkAndStart(){if(mt.logger.log("Checking key backup status..."),this.baseApis.isGuest())return mt.logger.log("Skipping key backup check since user is guest"),this.checkedForBackup=!0,null;let e;try{e=await this.baseApis.getKeyBackupVersion()}catch(r){return mt.logger.log("Error checking for active key backup",r),r.httpStatus===404&&(this.checkedForBackup=!0),null}this.checkedForBackup=!0;const t=await this.isKeyBackupTrusted(e);return t.usable&&!this.backupInfo?(mt.logger.log("Found usable key backup v"+e.version+": enabling key backups"),await this.enableKeyBackup(e)):!t.usable&&this.backupInfo?(mt.logger.log("No usable key backup: disabling key backup"),this.disableKeyBackup()):!t.usable&&!this.backupInfo?mt.logger.log("No usable key backup: not enabling key backup"):t.usable&&this.backupInfo&&(e.version!==this.backupInfo.version?(mt.logger.log("On backup version "+this.backupInfo.version+" but found version "+e.version+": switching."),this.disableKeyBackup(),await this.enableKeyBackup(e),await this.scheduleAllGroupSessionsForBackup()):mt.logger.log("Backup version "+e.version+" still current")),{backupInfo:e,trustInfo:t}}async checkKeyBackup(){return this.checkedForBackup=!1,this.checkAndStart()}async isKeyBackupTrusted(e){const t={usable:!1,trusted_locally:!1,sigs:[]};if(!e||!e.algorithm||!e.auth_data||!e.auth_data.signatures)return mt.logger.info("Key backup is absent or missing required data"),t;const r=await this.baseApis.crypto.getSessionBackupPrivateKey();if(r){let s;try{s=await Ua.makeAlgorithm(e,async()=>r),await s.keyMatches(r)&&(mt.logger.info("Backup is trusted locally"),t.trusted_locally=!0)}catch{}finally{s&&s.free()}}const i=e.auth_data.signatures[this.baseApis.getUserId()]||{};for(const s of Object.keys(i)){const o=s.split(":");if(o[0]!=="ed25519"){mt.logger.log("Ignoring unknown signature type: "+o[0]);continue}const a={deviceId:o[1]},l=this.baseApis.crypto.crossSigningInfo.getId();if(l===a.deviceId){a.crossSigningId=!0;try{await(0,ua.verifySignature)(this.baseApis.crypto.olmDevice,e.auth_data,this.baseApis.getUserId(),a.deviceId,l),a.valid=!0}catch(c){mt.logger.warn("Bad signature from cross signing key "+l,c),a.valid=!1}t.sigs.push(a);continue}const u=this.baseApis.crypto.deviceList.getStoredDevice(this.baseApis.getUserId(),a.deviceId);if(u){a.device=u,a.deviceTrust=await this.baseApis.checkDeviceTrust(this.baseApis.getUserId(),a.deviceId);try{await(0,ua.verifySignature)(this.baseApis.crypto.olmDevice,e.auth_data,this.baseApis.getUserId(),u.deviceId,u.getFingerprint()),a.valid=!0}catch(c){mt.logger.info("Bad signature from key ID "+s+" userID "+this.baseApis.getUserId()+" device ID "+u.deviceId+" fingerprint: "+u.getFingerprint(),e.auth_data,c),a.valid=!1}}else a.valid=null,mt.logger.info("Ignoring signature from unknown key "+s);t.sigs.push(a)}return t.usable=t.sigs.some(s=>s.valid&&(s.device&&s.deviceTrust.isVerified()||s.crossSigningId)),t.usable=t.usable||t.trusted_locally,t}async scheduleKeyBackupSend(e=1e4){if(!this.sendingBackups){this.sendingBackups=!0;try{const t=Math.random()*e;await(0,Bh.sleep)(t,void 0);let r=0;for(;;){if(!this.algorithm)return;try{if(await this.backupPendingKeys(xM)===0)return;r=0}catch(i){if(r++,mt.logger.log("Key backup request failed",i),i.data&&(i.data.errcode=="M_NOT_FOUND"||i.data.errcode=="M_WRONG_ROOM_KEYS_VERSION"))throw await this.checkKeyBackup(),this.baseApis.crypto.emit(zs.CryptoEvent.KeyBackupFailed,i.data.errcode),i}r&&await(0,Bh.sleep)(1e3*Math.pow(2,Math.min(r-1,4)),void 0)}}finally{this.sendingBackups=!1}}}async backupPendingKeys(e){const t=await this.baseApis.crypto.cryptoStore.getSessionsNeedingBackup(e);if(!t.length)return 0;let r=await this.baseApis.crypto.cryptoStore.countSessionsNeedingBackup();this.baseApis.crypto.emit(zs.CryptoEvent.KeyBackupSessionsRemaining,r);const i={};for(const s of t){const o=s.sessionData.room_id;i[o]===void 0&&(i[o]={sessions:{}});const a=await this.baseApis.crypto.olmDevice.exportInboundGroupSession(s.senderKey,s.sessionId,s.sessionData);a.algorithm=ua.MEGOLM_ALGORITHM;const l=(a.forwarding_curve25519_key_chain||[]).length,u=this.baseApis.crypto.deviceList.getUserByIdentityKey(ua.MEGOLM_ALGORITHM,s.senderKey),c=this.baseApis.crypto.deviceList.getDeviceByIdentityKey(ua.MEGOLM_ALGORITHM,s.senderKey),g=this.baseApis.crypto.checkDeviceInfoTrust(u,c).isVerified();i[o].sessions[s.sessionId]={first_message_index:a.first_known_index,forwarded_count:l,is_verified:g,session_data:await this.algorithm.encryptSession(a)}}return await this.baseApis.sendKeyBackup(void 0,void 0,this.backupInfo.version,{rooms:i}),await this.baseApis.crypto.cryptoStore.unmarkSessionsNeedingBackup(t),r=await this.baseApis.crypto.cryptoStore.countSessionsNeedingBackup(),this.baseApis.crypto.emit(zs.CryptoEvent.KeyBackupSessionsRemaining,r),t.length}async backupGroupSession(e,t){await this.baseApis.crypto.cryptoStore.markSessionsNeedingBackup([{senderKey:e,sessionId:t}]),this.backupInfo&&this.scheduleKeyBackupSend()}async scheduleAllGroupSessionsForBackup(){await this.flagAllGroupSessionsForBackup(),this.scheduleKeyBackupSend(0)}async flagAllGroupSessionsForBackup(){await this.baseApis.crypto.cryptoStore.doTxn("readwrite",[mm.IndexedDBCryptoStore.STORE_INBOUND_GROUP_SESSIONS,mm.IndexedDBCryptoStore.STORE_BACKUP],t=>{this.baseApis.crypto.cryptoStore.getAllEndToEndInboundGroupSessions(t,r=>{r!==null&&this.baseApis.crypto.cryptoStore.markSessionsNeedingBackup([r],t)})});const e=await this.baseApis.crypto.cryptoStore.countSessionsNeedingBackup();return this.baseApis.emit(zs.CryptoEvent.KeyBackupSessionsRemaining,e),e}countSessionsNeedingBackup(){return this.baseApis.crypto.cryptoStore.countSessionsNeedingBackup()}}yr.BackupManager=Ua;class Is{constructor(e,t,r){this.authData=e,this.publicKey=t,this.getKey=r}static async init(e,t){if(!e||!("public_key"in e))throw new Error("auth_data missing required information");const r=new V.Olm.PkEncryption;return r.set_recipient_key(e.public_key),new Is(e,r,t)}static async prepare(e){const t=new V.Olm.PkDecryption;try{const r={};if(!e)r.public_key=t.generate_key();else if(e instanceof Uint8Array)r.public_key=t.init_with_private_key(e);else{const s=await(0,C_.keyFromPassphrase)(e);r.private_key_salt=s.salt,r.private_key_iterations=s.iterations,r.public_key=t.init_with_private_key(s.key)}return new V.Olm.PkEncryption().set_recipient_key(r.public_key),[t.get_private_key(),r]}finally{t.free()}}static checkBackupVersion(e){if(!("public_key"in e.auth_data))throw new Error("Invalid backup data returned")}get untrusted(){return!0}async encryptSession(e){const t=Object.assign({},e);return delete t.session_id,delete t.room_id,delete t.first_known_index,this.publicKey.encrypt(JSON.stringify(t))}async decryptSessions(e){const t=await this.getKey(),r=new V.Olm.PkDecryption;try{if(r.init_with_private_key(t)!==this.authData.public_key)throw{errcode:MM.MatrixClient.RESTORE_BACKUP_ERROR_BAD_KEY};const s=[];for(const[o,a]of Object.entries(e))try{const l=JSON.parse(r.decrypt(a.session_data.ephemeral,a.session_data.mac,a.session_data.ciphertext));l.session_id=o,s.push(l)}catch(l){mt.logger.log("Failed to decrypt megolm session from backup",l,a)}return s}finally{r.free()}}async keyMatches(e){const t=new V.Olm.PkDecryption;let r;try{r=t.init_with_private_key(e)}finally{t.free()}return r===this.authData.public_key}free(){this.publicKey.free()}}yr.Curve25519=Is;(0,uo.default)(Is,"algorithmName","m.megolm_backup.v1.curve25519-aes-sha2");function UM(n){var e;const t=(0,Bh.getCrypto)();if(t)return t.randomBytes(n);if((e=window)!==null&&e!==void 0&&e.crypto){const r=new Uint8Array(n);return window.crypto.getRandomValues(r),r}throw new Error("No usable crypto implementation")}const $M=new DM.UnstableValue(null,"org.matrix.msc3270.v1.aes-hmac-sha2");class Po{constructor(e,t){this.authData=e,this.key=t}static async init(e,t){if(!e)throw new Error("auth_data missing");const r=await t();if(e.mac){const{mac:i}=await(0,da.calculateKeyCheck)(r,e.iv);if(e.mac.replace(/=+$/g,"")!==i.replace(/=+/g,""))throw new Error("Key does not match")}return new Po(e,r)}static async prepare(e){let t;const r={};if(!e)t=UM(32);else if(e instanceof Uint8Array)t=new Uint8Array(e);else{const o=await(0,C_.keyFromPassphrase)(e);r.private_key_salt=o.salt,r.private_key_iterations=o.iterations,t=o.key}const{iv:i,mac:s}=await(0,da.calculateKeyCheck)(t);return r.iv=i,r.mac=s,[t,r]}static checkBackupVersion(e){if(!("iv"in e.auth_data&&"mac"in e.auth_data))throw new Error("Invalid backup data returned")}get untrusted(){return!1}async encryptSession(e){const t=Object.assign({},e);return delete t.session_id,delete t.room_id,delete t.first_known_index,await(0,da.encryptAES)(JSON.stringify(t),this.key,e.session_id)}async decryptSessions(e){const t=[];for(const[r,i]of Object.entries(e))try{const s=JSON.parse(await(0,da.decryptAES)(i.session_data,this.key,r));s.session_id=r,t.push(s)}catch(s){mt.logger.log("Failed to decrypt megolm session from backup",s,i)}return t}async keyMatches(e){if(this.authData.mac){const{mac:t}=await(0,da.calculateKeyCheck)(e,this.authData.iv);return this.authData.mac.replace(/=+$/g,"")===t.replace(/=+/g,"")}else return!0}free(){this.key.fill(0)}}yr.Aes256=Po;(0,uo.default)(Po,"algorithmName",$M.name);const cl={[Is.algorithmName]:Is,[Po.algorithmName]:Po};yr.algorithmsByName=cl;const P_=Is;yr.DefaultAlgorithm=P_;var M_=G.exports;Object.defineProperty(Ft,"__esModule",{value:!0});Ft.IncomingRoomKeyRequest=Ft.CryptoEvent=Ft.Crypto=void 0;Ft.fixBackupKey=ul;Ft.isCryptoAvailable=zM;Ft.verificationMethods=void 0;var ae=M_(Y.exports),NM=M_(tu),LM=tn,L=se,ym=Es,Ot=D_(xe),BM=Ss,ll=xs,Lc=D_(Rf),Ln=Pt,vm=To,Js=Oo,KM=bs,ha=Br,ba=cr,Kh=ws,FM=Us,_m=Vo,fa=fe,Bc=ko,Wr=Co,Em=cu,Kc=oi,gd=li,qM=Rs,jM=yr,VM=lr,GM=Zr,Bn=jt,WM=st,HM=je;function A_(n){if(typeof WeakMap!="function")return null;var e=new WeakMap,t=new WeakMap;return(A_=function(r){return r?t:e})(n)}function D_(n,e){if(!e&&n&&n.__esModule)return n;if(n===null||typeof n!="object"&&typeof n!="function")return{default:n};var t=A_(e);if(t&&t.has(n))return t.get(n);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in n)if(s!=="default"&&Object.prototype.hasOwnProperty.call(n,s)){var o=i?Object.getOwnPropertyDescriptor(n,s):null;o&&(o.get||o.set)?Object.defineProperty(r,s,o):r[s]=n[s]}return r.default=n,t&&t.set(n,r),r}const Kn=ll.DeviceInfo.DeviceVerification,md={[ba.ReciprocateQRCode.NAME]:ba.ReciprocateQRCode,[Kh.SAS.NAME]:Kh.SAS,[ba.SHOW_QR_CODE_METHOD]:Em.IllegalMethod,[ba.SCAN_QR_CODE_METHOD]:Em.IllegalMethod},YM={RECIPROCATE_QR_CODE:ba.ReciprocateQRCode.NAME,SAS:Kh.SAS.NAME};Ft.verificationMethods=YM;function zM(){return Boolean(V.Olm)}const JM=60*60*1e3;let Ze;Ft.CryptoEvent=Ze;(function(n){n.DeviceVerificationChanged="deviceVerificationChanged",n.UserTrustStatusChanged="userTrustStatusChanged",n.UserCrossSigningUpdated="userCrossSigningUpdated",n.RoomKeyRequest="crypto.roomKeyRequest",n.RoomKeyRequestCancellation="crypto.roomKeyRequestCancellation",n.KeyBackupStatus="crypto.keyBackupStatus",n.KeyBackupFailed="crypto.keyBackupFailed",n.KeyBackupSessionsRemaining="crypto.keyBackupSessionsRemaining",n.KeySignatureUploadFailure="crypto.keySignatureUploadFailure",n.VerificationRequest="crypto.verification.request",n.Warning="crypto.warning",n.WillUpdateDevices="crypto.willUpdateDevices",n.DevicesUpdated="crypto.devicesUpdated",n.KeysChanged="crossSigning.keysChanged"})(Ze||(Ft.CryptoEvent=Ze={}));class XM extends HM.TypedEventEmitter{static getOlmVersion(){return ym.OlmDevice.getOlmVersion()}constructor(e,t,r,i,s,o,a,l){super();if(this.baseApis=e,this.sessionStore=t,this.userId=r,this.deviceId=i,this.clientStore=s,this.cryptoStore=o,this.roomList=a,(0,ae.default)(this,"backupManager",void 0),(0,ae.default)(this,"crossSigningInfo",void 0),(0,ae.default)(this,"olmDevice",void 0),(0,ae.default)(this,"deviceList",void 0),(0,ae.default)(this,"dehydrationManager",void 0),(0,ae.default)(this,"secretStorage",void 0),(0,ae.default)(this,"reEmitter",void 0),(0,ae.default)(this,"verificationMethods",void 0),(0,ae.default)(this,"supportedAlgorithms",void 0),(0,ae.default)(this,"outgoingRoomKeyRequestManager",void 0),(0,ae.default)(this,"toDeviceVerificationRequests",void 0),(0,ae.default)(this,"inRoomVerificationRequests",void 0),(0,ae.default)(this,"trustCrossSignedDevices",!0),(0,ae.default)(this,"lastOneTimeKeyCheck",null),(0,ae.default)(this,"oneTimeKeyCheckInProgress",!1),(0,ae.default)(this,"roomEncryptors",{}),(0,ae.default)(this,"roomDecryptors",{}),(0,ae.default)(this,"deviceKeys",{}),(0,ae.default)(this,"globalBlacklistUnverifiedDevices",!1),(0,ae.default)(this,"globalErrorOnUnknownDevices",!0),(0,ae.default)(this,"receivedRoomKeyRequests",[]),(0,ae.default)(this,"receivedRoomKeyRequestCancellations",[]),(0,ae.default)(this,"processingRoomKeyRequests",!1),(0,ae.default)(this,"lazyLoadMembers",!1),(0,ae.default)(this,"roomDeviceTrackingState",{}),(0,ae.default)(this,"lastNewSessionForced",{}),(0,ae.default)(this,"sendKeyRequestsImmediately",!1),(0,ae.default)(this,"oneTimeKeyCount",void 0),(0,ae.default)(this,"needsNewFallback",void 0),(0,ae.default)(this,"fallbackCleanup",void 0),(0,ae.default)(this,"onDeviceListUserCrossSigningUpdated",async g=>{if(g===this.userId){const m=this.deviceList.getStoredCrossSigningForUser(g),f=m?m.getId():null,E=this.crossSigningInfo.getId();E&&f&&!(E!==f)?await this.checkOwnCrossSigningTrust():(this.storeTrustedSelfKeys(null),this.emit(Ze.KeysChanged,{}),this.emit(Ze.UserTrustStatusChanged,this.userId,this.checkUserTrust(g)))}else{await this.checkDeviceVerifications(g);const m=this.deviceList.getStoredCrossSigningForUser(g);m&&(m.updateCrossSigningVerifiedBefore(this.checkUserTrust(g).isCrossSigningVerified()),this.deviceList.setRawStoredCrossSigningForUser(g,m.toStorage())),this.emit(Ze.UserTrustStatusChanged,g,this.checkUserTrust(g))}}),(0,ae.default)(this,"onMembership",(g,m,f)=>{try{this.onRoomMembership(g,m,f)}catch(E){L.logger.error("Error handling membership change:",E)}}),(0,ae.default)(this,"onToDeviceEvent",g=>{try{L.logger.log(`received to_device ${g.getType()} from: ${g.getSender()} id: ${g.getId()}`),g.getType()=="m.room_key"||g.getType()=="m.forwarded_room_key"?this.onRoomKeyEvent(g):g.getType()=="m.room_key_request"?this.onRoomKeyRequestEvent(g):g.getType()==="m.secret.request"?this.secretStorage.onRequestReceived(g):g.getType()==="m.secret.send"?this.secretStorage.onSecretReceived(g):g.getType()==="m.room_key.withheld"||g.getType()==="org.matrix.room_key.withheld"?this.onRoomKeyWithheldEvent(g):g.getContent().transaction_id?this.onKeyVerificationMessage(g):g.getContent().msgtype==="m.bad.encrypted"?this.onToDeviceBadEncrypted(g):(g.isBeingDecrypted()||g.shouldAttemptDecryption())&&(g.isBeingDecrypted()||g.attemptDecryption(this),g.once(Bn.MatrixEventEvent.Decrypted,m=>{this.onToDeviceEvent(m)}))}catch(m){L.logger.error("Error handling toDeviceEvent:",m)}}),(0,ae.default)(this,"onTimelineEvent",(g,m,f,E,{liveEvent:I=!0}={})=>{if(!Bc.InRoomChannel.validateEvent(g,this.baseApis))return;const w=k=>{const C=new Bc.InRoomChannel(this.baseApis,k.getRoomId());return new fa.VerificationRequest(C,this.verificationMethods,this.baseApis)};this.handleVerificationEvent(g,this.inRoomVerificationRequests,w,I)}),this.reEmitter=new LM.TypedReEmitter(this),l){this.verificationMethods=new Map;for(const g of l)typeof g=="string"?md[g]&&this.verificationMethods.set(g,md[g]):g.NAME?this.verificationMethods.set(g.NAME,g):L.logger.warn(`Excluding unknown verification method ${g}`)}else this.verificationMethods=new Map(Object.entries(md));this.backupManager=new jM.BackupManager(e,async()=>{const g=await this.getSessionBackupPrivateKey();if(g)return g;const m=await this.getSecret("m.megolm_backup.v1");if(m){const f=ul(m);if(f){const[E]=await this.getSecretStorageKey();await this.storeSecret("m.megolm_backup.v1",f,[E])}return Ot.decodeBase64(f||m)}if(this.baseApis.cryptoCallbacks&&this.baseApis.cryptoCallbacks.getBackupKey)return await this.baseApis.cryptoCallbacks.getBackupKey();throw new Error("Unable to get private key")}),this.olmDevice=new ym.OlmDevice(o),this.deviceList=new BM.DeviceList(e,o,this.olmDevice),this.deviceList.on(Ze.UserCrossSigningUpdated,this.onDeviceListUserCrossSigningUpdated),this.reEmitter.reEmit(this.deviceList,[Ze.DevicesUpdated,Ze.WillUpdateDevices]),this.supportedAlgorithms=Object.keys(Lc.DECRYPTION_CLASSES),this.outgoingRoomKeyRequestManager=new KM.OutgoingRoomKeyRequestManager(e,this.deviceId,this.cryptoStore),this.toDeviceVerificationRequests=new Wr.ToDeviceRequests,this.inRoomVerificationRequests=new Bc.InRoomRequests;const u=this.baseApis.cryptoCallbacks||{},c=(0,Ln.createCryptoStoreCacheCallbacks)(o,this.olmDevice);this.crossSigningInfo=new Ln.CrossSigningInfo(r,u,c),this.secretStorage=new Js.SecretStorage(e,u,e),this.dehydrationManager=new qM.DehydrationManager(this),!u.getCrossSigningKey&&u.getSecretStorageKey&&(u.getCrossSigningKey=async g=>Ln.CrossSigningInfo.getFromSecretStorage(g,this.secretStorage))}async init({exportedOlmDevice:e,pickleKey:t}={}){L.logger.log("Crypto: initialising Olm..."),await V.Olm.init(),L.logger.log(e?"Crypto: initialising Olm device from exported device...":"Crypto: initialising Olm device..."),await this.olmDevice.init({fromExportedDevice:e,pickleKey:t}),L.logger.log("Crypto: loading device list..."),await this.deviceList.load(),this.deviceKeys["ed25519:"+this.deviceId]=this.olmDevice.deviceEd25519Key,this.deviceKeys["curve25519:"+this.deviceId]=this.olmDevice.deviceCurve25519Key,L.logger.log("Crypto: fetching own devices...");let r=this.deviceList.getRawStoredDevicesForUser(this.userId);if(r||(r={}),!r[this.deviceId]){L.logger.log("Crypto: adding this device to the store...");const i={keys:this.deviceKeys,algorithms:this.supportedAlgorithms,verified:Kn.VERIFIED,known:!0};r[this.deviceId]=i,this.deviceList.storeDevicesForUser(this.userId,r),this.deviceList.saveIfDirty()}await this.cryptoStore.doTxn("readonly",[ha.IndexedDBCryptoStore.STORE_ACCOUNT],i=>{this.cryptoStore.getCrossSigningKeys(i,s=>{s&&Object.keys(s).length!==0&&(L.logger.log("Loaded cross-signing public keys from crypto store"),this.crossSigningInfo.setKeys(s))})}),this.deviceList.startTrackingDeviceList(this.userId),L.logger.log("Crypto: checking for key backup..."),this.backupManager.checkAndStart()}getCryptoTrustCrossSignedDevices(){return this.trustCrossSignedDevices}setCryptoTrustCrossSignedDevices(e){this.trustCrossSignedDevices=e;for(const t of this.deviceList.getKnownUserIds()){const r=this.deviceList.getRawStoredDevicesForUser(t);for(const i of Object.keys(r)){const s=this.checkDeviceTrust(t,i);if(!s.isLocallyVerified()&&s.isCrossSigningVerified()){const o=this.deviceList.getStoredDevice(t,i);this.emit(Ze.DeviceVerificationChanged,t,i,o)}}}}async createRecoveryKeyFromPassphrase(e){const t=new V.Olm.PkDecryption;try{const r={};if(e){const o=await(0,FM.keyFromPassphrase)(e);r.passphrase={algorithm:"m.pbkdf2",iterations:o.iterations,salt:o.salt},r.pubkey=t.init_with_private_key(o.key)}else r.pubkey=t.generate_key();const i=t.get_private_key(),s=(0,_m.encodeRecoveryKey)(i);return{keyInfo:r,encodedPrivateKey:s,privateKey:i}}finally{t&&t.free()}}async isCrossSigningReady(){const e=this.crossSigningInfo.getId(),t=await this.crossSigningInfo.isStoredInKeyCache()||await this.crossSigningInfo.isStoredInSecretStorage(this.secretStorage);return!!(e&&t)}async isSecretStorageReady(){const e=await this.secretStorage.hasKey(),t=await this.crossSigningInfo.isStoredInSecretStorage(this.secretStorage),r=!this.backupManager.getKeyBackupEnabled()||await this.baseApis.isKeyBackupKeyStored();return!!(e&&t&&r)}async bootstrapCrossSigning({authUploadDeviceSigningKeys:e,setupNewCrossSigning:t}={}){L.logger.log("Bootstrapping cross-signing");const r=this.baseApis.cryptoCallbacks,i=new vm.EncryptionSetupBuilder(this.baseApis.store.accountData,r),s=new Ln.CrossSigningInfo(this.userId,i.crossSigningCallbacks,i.crossSigningCallbacks),o=async()=>{s.resetKeys(),await this.signObject(s.keys.master),i.addCrossSigningKeys(e,s.keys);const f=this.deviceList.getStoredDevice(this.userId,this.deviceId),E=await s.signDevice(this.userId,f);i.addKeySignature(this.userId,this.deviceId,E),this.backupManager.backupInfo&&(await s.signObject(this.backupManager.backupInfo.auth_data,"master"),i.addSessionBackup(this.backupManager.backupInfo))},a=this.crossSigningInfo.getId(),l=await this.crossSigningInfo.isStoredInKeyCache(),u=await this.crossSigningInfo.isStoredInSecretStorage(this.secretStorage),c=l||u;L.logger.log({setupNewCrossSigning:t,publicKeysOnDevice:a,privateKeysInCache:l,privateKeysInStorage:u,privateKeysExistSomewhere:c}),!c||t?(L.logger.log("Cross-signing private keys not found locally or in secret storage, creating new keys"),await o()):a&&l?L.logger.log("Cross-signing public keys trusted and private keys found locally"):u&&(L.logger.log("Cross-signing private keys not found locally, but they are available in secret storage, reading storage and caching locally"),await this.checkOwnCrossSigningTrust({allowPrivateKeyRequests:!0}));const g=i.crossSigningCallbacks.privateKeys;if(g.size&&!this.baseApis.cryptoCallbacks.saveCrossSigningKeys){const f=new Js.SecretStorage(i.accountDataClientAdapter,i.ssssCryptoCallbacks);await f.hasKey()&&(L.logger.log("Storing new cross-signing private keys in secret storage"),await Ln.CrossSigningInfo.storeInSecretStorage(g,f))}await i.buildOperation().apply(this),await i.persist(this),L.logger.log("Cross-signing ready")}async bootstrapSecretStorage({createSecretStorageKey:e=async()=>({}),keyBackupInfo:t,setupNewKeyBackup:r,setupNewSecretStorage:i,getKeyBackupPassphrase:s}={}){L.logger.log("Bootstrapping Secure Secret Storage");const o=this.baseApis.cryptoCallbacks,a=new vm.EncryptionSetupBuilder(this.baseApis.store.accountData,o),l=new Js.SecretStorage(a.accountDataClientAdapter,a.ssssCryptoCallbacks);let u=null;const c=async(S,T)=>{T&&(S.key=T);const{keyId:D,keyInfo:R}=await l.addKey(Js.SECRET_STORAGE_ALGORITHM_V1_AES,S);return T&&a.ssssCryptoCallbacks.addPrivateKey(D,R,T),await l.setDefaultKeyId(D),D},g=async(S,T)=>{if(!T.mac){const D=await this.baseApis.cryptoCallbacks.getSecretStorageKey({keys:{[S]:T}},"");if(D){const R=D[1];a.ssssCryptoCallbacks.addPrivateKey(S,T,R);const{iv:U,mac:q}=await(0,gd.calculateKeyCheck)(R);T.iv=U,T.mac=q,await a.setAccountData(`m.secret_storage.key.${S}`,T)}}},m=async S=>{if(this.crossSigningInfo.getId()&&await this.crossSigningInfo.isStoredInKeyCache("master"))try{L.logger.log("Adding cross-signing signature to key backup"),await this.crossSigningInfo.signObject(S,"master")}catch(T){L.logger.error("Signing key backup with cross-signing keys failed",T)}else L.logger.warn("Cross-signing keys not available, skipping signature on key backup")},f=await this.getSecretStorageKey(),[E,I]=f||[null,null],w=!i&&I&&I.algorithm===Js.SECRET_STORAGE_ALGORITHM_V1_AES;if(L.logger.log({keyBackupInfo:t,setupNewKeyBackup:r,setupNewSecretStorage:i,storageExists:w,oldKeyInfo:I}),!w&&!t){L.logger.log("Secret storage does not exist, creating new storage key");const{keyInfo:S,privateKey:T}=await e();u=await c(S,T)}else if(!w&&t){L.logger.log("Secret storage does not exist, using key backup key");const S=await this.getSessionBackupPrivateKey()||await s(),T={};t.auth_data.private_key_salt&&t.auth_data.private_key_iterations&&(T.passphrase={algorithm:"m.pbkdf2",iterations:t.auth_data.private_key_iterations,salt:t.auth_data.private_key_salt,bits:256}),u=await c(T,S),await l.store("m.megolm_backup.v1",Ot.encodeBase64(S),[u]),await m(t.auth_data),a.addSessionBackup(t)}else L.logger.log("Secret storage exists"),I&&I.algorithm===Js.SECRET_STORAGE_ALGORITHM_V1_AES&&await g(E,I);if(!this.baseApis.cryptoCallbacks.saveCrossSigningKeys&&await this.isCrossSigningReady()&&(u||!await this.crossSigningInfo.isStoredInSecretStorage(l))){L.logger.log("Copying cross-signing private keys from cache to secret storage");const S=await this.crossSigningInfo.getCrossSigningKeysFromCache();await Ln.CrossSigningInfo.storeInSecretStorage(S,l)}if(r&&!t){L.logger.log("Creating new message key backup version");const S=await this.baseApis.prepareKeyBackupVersion(null,{secureSecretStorage:!1}),T=(0,_m.decodeRecoveryKey)(S.recovery_key);await l.store("m.megolm_backup.v1",Ot.encodeBase64(T));const D={algorithm:S.algorithm,auth_data:S.auth_data};await m(D.auth_data),await this.signObject(D.auth_data),a.addSessionBackup(D)}const k=await l.get("m.megolm_backup.v1");if(k){L.logger.info("Got session backup key from secret storage: caching");const S=ul(k);S&&await l.store("m.megolm_backup.v1",S,[u||E]);const T=new Uint8Array(Ot.decodeBase64(S||k));await a.addSessionBackupPrivateKeyToCache(T)}else if(this.backupManager.getKeyBackupEnabled()){const S=await this.getSessionBackupPrivateKey()||await s();if(!S){L.logger.error("Key backup is enabled but couldn't get key backup key!");return}L.logger.info("Got session backup key from cache/user that wasn't in SSSS: saving to SSSS"),await l.store("m.megolm_backup.v1",Ot.encodeBase64(S))}await a.buildOperation().apply(this),await a.persist(this),L.logger.log("Secure Secret Storage ready")}addSecretStorageKey(e,t,r){return this.secretStorage.addKey(e,t,r)}hasSecretStorageKey(e){return this.secretStorage.hasKey(e)}getSecretStorageKey(e){return this.secretStorage.getKey(e)}storeSecret(e,t,r){return this.secretStorage.store(e,t,r)}getSecret(e){return this.secretStorage.get(e)}isSecretStored(e,t){return this.secretStorage.isStored(e,t)}requestSecret(e,t){return t||(t=Object.keys(this.deviceList.getRawStoredDevicesForUser(this.userId))),this.secretStorage.request(e,t)}getDefaultSecretStorageKeyId(){return this.secretStorage.getDefaultKeyId()}setDefaultSecretStorageKeyId(e){return this.secretStorage.setDefaultKeyId(e)}checkSecretStorageKey(e,t){return this.secretStorage.checkKey(e,t)}checkSecretStoragePrivateKey(e,t){let r=null;try{return r=new V.Olm.PkDecryption,r.init_with_private_key(e)===t}finally{r&&r.free()}}async getSessionBackupPrivateKey(){let e=await new Promise(t=>{this.cryptoStore.doTxn("readonly",[ha.IndexedDBCryptoStore.STORE_ACCOUNT],r=>{this.cryptoStore.getSecretStorePrivateKey(r,t,"m.megolm_backup.v1")})});if(e&&typeof e=="string"&&(e=new Uint8Array(Ot.decodeBase64(ul(e)||e)),await this.storeSessionBackupPrivateKey(e)),e&&e.ciphertext){const t=Buffer.from(this.olmDevice.pickleKey),r=await(0,gd.decryptAES)(e,t,"m.megolm_backup.v1");e=Ot.decodeBase64(r)}return e}async storeSessionBackupPrivateKey(e){if(!(e instanceof Uint8Array))throw new Error(`storeSessionBackupPrivateKey expects Uint8Array, got ${e}`);const t=Buffer.from(this.olmDevice.pickleKey),r=await(0,gd.encryptAES)(Ot.encodeBase64(e),t,"m.megolm_backup.v1");return this.cryptoStore.doTxn("readwrite",[ha.IndexedDBCryptoStore.STORE_ACCOUNT],i=>{this.cryptoStore.storeSecretStorePrivateKey(i,"m.megolm_backup.v1",r)})}checkCrossSigningPrivateKey(e,t){let r=null;try{return r=new V.Olm.PkSigning,r.init_with_seed(e)===t}finally{r&&r.free()}}async afterCrossSigningLocalKeyChange(){L.logger.info("Starting cross-signing key change post-processing");const e=this.deviceList.getStoredDevice(this.userId,this.deviceId),t=await this.crossSigningInfo.signDevice(this.userId,e);L.logger.info(`Starting background key sig upload for ${this.deviceId}`);const r=({shouldEmit:s=!1})=>this.baseApis.uploadKeySignatures({[this.userId]:{[this.deviceId]:t}}).then(o=>{const{failures:a}=o||{};if(Object.keys(a||[]).length>0)throw s&&this.baseApis.emit(Ze.KeySignatureUploadFailure,a,"afterCrossSigningLocalKeyChange",r),new Kc.KeySignatureUploadError("Key upload failed",{failures:a});L.logger.info(`Finished background key sig upload for ${this.deviceId}`)}).catch(o=>{L.logger.error(`Error during background key sig upload for ${this.deviceId}`,o)});r({shouldEmit:!0});const i=this.baseApis.cryptoCallbacks.shouldUpgradeDeviceVerifications;if(i){L.logger.info("Starting device verification upgrade");const s={};for(const[o,a]of Object.entries(this.deviceList.crossSigningInfo)){const l=await this.checkForDeviceVerificationUpgrade(o,Ln.CrossSigningInfo.fromStorage(a,o));l&&(s[o]=l)}if(Object.keys(s).length>0){L.logger.info(`Found ${Object.keys(s).length} verif users to upgrade`);try{const o=await i({users:s});if(o)for(const a of o)a in s&&await this.baseApis.setDeviceVerified(a,s[a].crossSigningInfo.getId())}catch(o){L.logger.log("shouldUpgradeDeviceVerifications threw an error: not upgrading",o)}}L.logger.info("Finished device verification upgrade")}L.logger.info("Finished cross-signing key change post-processing")}async checkForDeviceVerificationUpgrade(e,t){const r=this.crossSigningInfo.checkUserTrust(t);if(t.firstUse&&!r.isVerified()){const i=this.deviceList.getRawStoredDevicesForUser(e),s=await this.checkForValidDeviceSignature(e,t.keys.master,i);if(s.length)return{devices:s.map(o=>ll.DeviceInfo.fromStorage(i[o],o)),crossSigningInfo:t}}}async checkForValidDeviceSignature(e,t,r){const i=[];if(r&&t.signatures&&t.signatures[e])for(const s of Object.keys(t.signatures[e])){const[,o]=s.split(":",2);if(o in r&&r[o].verified===Kn.VERIFIED)try{await Ot.verifySignature(this.olmDevice,t,e,o,r[o].keys[s]),i.push(o)}catch{}}return i}getCrossSigningId(e){return this.crossSigningInfo.getId(e)}getStoredCrossSigningForUser(e){return this.deviceList.getStoredCrossSigningForUser(e)}checkUserTrust(e){const t=this.deviceList.getStoredCrossSigningForUser(e);return t?this.crossSigningInfo.checkUserTrust(t):new Ln.UserTrustLevel(!1,!1,!1)}checkDeviceTrust(e,t){const r=this.deviceList.getStoredDevice(e,t);return this.checkDeviceInfoTrust(e,r)}checkDeviceInfoTrust(e,t){const r=!!(t&&t.isVerified()),i=this.deviceList.getStoredCrossSigningForUser(e);if(t&&i){const s=this.trustCrossSignedDevices||e===this.userId;return this.crossSigningInfo.checkDeviceTrust(i,t,r,s)}else return new Ln.DeviceTrustLevel(!1,!1,r,!1)}async checkOwnCrossSigningTrust({allowPrivateKeyRequests:e=!1}={}){const t=this.userId;await this.downloadKeys([this.userId]);const r=await this.crossSigningInfo.getCrossSigningKeysFromCache(),i=this.deviceList.getStoredCrossSigningForUser(t);if(!i){L.logger.error("Got cross-signing update event for user "+t+" but no new cross-signing information found!");return}const s=i.getId(),o=this.crossSigningInfo.getId()!==s,a=i.getId()&&!r.has("master");if(o&&L.logger.info("Got new master public key",s),e&&(o||a)){L.logger.info("Attempting to retrieve cross-signing master private key");let w=null;try{w=(await this.crossSigningInfo.getCrossSigningKey("master",s))[1],L.logger.info("Got cross-signing master private key")}finally{w&&w.free()}}const l=this.crossSigningInfo.getId("self_signing"),u=this.crossSigningInfo.getId("user_signing");this.storeTrustedSelfKeys(i.keys);const c=l!==i.getId("self_signing"),g=u!==i.getId("user_signing"),m=i.getId("self_signing")&&!r.has("self_signing"),f=i.getId("user_signing")&&!r.has("user_signing"),E={};if(c&&L.logger.info("Got new self-signing key",i.getId("self_signing")),e&&(c||m)){L.logger.info("Attempting to retrieve cross-signing self-signing private key");let w=null;try{w=(await this.crossSigningInfo.getCrossSigningKey("self_signing",i.getId("self_signing")))[1],L.logger.info("Got cross-signing self-signing private key")}finally{w&&w.free()}const k=this.deviceList.getStoredDevice(this.userId,this.deviceId),C=await this.crossSigningInfo.signDevice(this.userId,k);E[this.deviceId]=C}if(g&&L.logger.info("Got new user-signing key",i.getId("user_signing")),e&&(g||f)){L.logger.info("Attempting to retrieve cross-signing user-signing private key");let w=null;try{w=(await this.crossSigningInfo.getCrossSigningKey("user_signing",i.getId("user_signing")))[1],L.logger.info("Got cross-signing user-signing private key")}finally{w&&w.free()}}if(o){const w=this.crossSigningInfo.keys.master;await this.signObject(w);const k=w.signatures[this.userId]["ed25519:"+this.deviceId];E[this.crossSigningInfo.getId()]=Object.assign({},w,{signatures:{[this.userId]:{["ed25519:"+this.deviceId]:k}}})}const I=Object.keys(E);if(I.length){const w=({shouldEmit:k=!1})=>(L.logger.info(`Starting background key sig upload for ${I}`),this.baseApis.uploadKeySignatures({[this.userId]:E}).then(C=>{const{failures:S}=C||{};if(L.logger.info(`Finished background key sig upload for ${I}`),Object.keys(S||[]).length>0)throw k&&this.baseApis.emit(Ze.KeySignatureUploadFailure,S,"checkOwnCrossSigningTrust",w),new Kc.KeySignatureUploadError("Key upload failed",{failures:S})}).catch(C=>{L.logger.error(`Error during background key sig upload for ${I}`,C)}));w({shouldEmit:!0})}this.emit(Ze.UserTrustStatusChanged,t,this.checkUserTrust(t)),o&&(this.emit(Ze.KeysChanged,{}),await this.afterCrossSigningLocalKeyChange()),await this.backupManager.checkKeyBackup()}async storeTrustedSelfKeys(e){e?this.crossSigningInfo.setKeys(e):this.crossSigningInfo.clearKeys(),await this.cryptoStore.doTxn("readwrite",[ha.IndexedDBCryptoStore.STORE_ACCOUNT],t=>{this.cryptoStore.storeCrossSigningKeys(t,this.crossSigningInfo.keys)})}async checkDeviceVerifications(e){const t=this.baseApis.cryptoCallbacks.shouldUpgradeDeviceVerifications;if(!!t){if(L.logger.info(`Starting device verification upgrade for ${e}`),this.crossSigningInfo.keys.user_signing){const r=this.deviceList.getStoredCrossSigningForUser(e);if(r){const i=await this.checkForDeviceVerificationUpgrade(e,r);i&&(await t({users:{[e]:i}})).includes(e)&&await this.baseApis.setDeviceVerified(e,r.getId())}}L.logger.info(`Finished device verification upgrade for ${e}`)}}async setTrustedBackupPubKey(e){this.sessionStore.setLocalTrustedBackupPubKey(e),await this.backupManager.checkKeyBackup()}enableLazyLoading(){this.lazyLoadMembers=!0}registerEventHandlers(e){e.on(GM.RoomMemberEvent.Membership,this.onMembership),e.on(WM.ClientEvent.ToDeviceEvent,this.onToDeviceEvent),e.on(VM.RoomEvent.Timeline,this.onTimelineEvent),e.on(Bn.MatrixEventEvent.Decrypted,this.onTimelineEvent)}start(){this.outgoingRoomKeyRequestManager.start()}stop(){this.outgoingRoomKeyRequestManager.stop(),this.deviceList.stop(),this.dehydrationManager.stop()}getDeviceEd25519Key(){return this.olmDevice.deviceEd25519Key}getDeviceCurve25519Key(){return this.olmDevice.deviceCurve25519Key}setGlobalBlacklistUnverifiedDevices(e){this.globalBlacklistUnverifiedDevices=e}getGlobalBlacklistUnverifiedDevices(){return this.globalBlacklistUnverifiedDevices}setGlobalErrorOnUnknownDevices(e){this.globalErrorOnUnknownDevices=e}getGlobalErrorOnUnknownDevices(){return this.globalErrorOnUnknownDevices}uploadDeviceKeys(){const e={algorithms:this.supportedAlgorithms,device_id:this.deviceId,keys:this.deviceKeys,user_id:this.userId};return this.signObject(e).then(()=>this.baseApis.uploadKeysRequest({device_keys:e}))}updateOneTimeKeyCount(e){if(isFinite(e))this.oneTimeKeyCount=e;else throw new TypeError("Parameter for updateOneTimeKeyCount has to be a number")}setNeedsNewFallback(e){this.needsNewFallback=!!e}getNeedsNewFallback(){return this.needsNewFallback}maybeUploadOneTimeKeys(){if(this.oneTimeKeyCheckInProgress)return;const r=Date.now();if(this.lastOneTimeKeyCheck!==null&&r-this.lastOneTimeKeyCheck<6e4)return;this.lastOneTimeKeyCheck=r;const i=this.olmDevice.maxNumberOfOneTimeKeys(),s=Math.floor(i/2),o=async a=>{for(;s>a||this.getNeedsNewFallback();){if(s>a){L.logger.info("generating oneTimeKeys");const u=Math.min(s-a,5);await this.olmDevice.generateOneTimeKeys(u)}if(this.getNeedsNewFallback()){const u=await this.olmDevice.getFallbackKey();(!u.curve25519||Object.keys(u.curve25519).length==0)&&(L.logger.info("generating fallback key"),this.fallbackCleanup&&(clearTimeout(this.fallbackCleanup),delete this.fallbackCleanup),await this.olmDevice.generateFallbackKey())}L.logger.info("calling uploadOneTimeKeys");const l=await this.uploadOneTimeKeys();if(l.one_time_key_counts&&l.one_time_key_counts.signed_curve25519)a=l.one_time_key_counts.signed_curve25519;else throw new Error("response for uploading keys does not contain one_time_key_counts.signed_curve25519")}};this.oneTimeKeyCheckInProgress=!0,Promise.resolve().then(()=>this.oneTimeKeyCount!==void 0?Promise.resolve(this.oneTimeKeyCount):this.baseApis.uploadKeysRequest({}).then(a=>a.one_time_key_counts.signed_curve25519||0)).then(a=>o(a)).catch(a=>{L.logger.error("Error uploading one-time keys",a.stack||a)}).finally(()=>{this.oneTimeKeyCount=void 0,this.oneTimeKeyCheckInProgress=!1})}async uploadOneTimeKeys(){const e=[];let t;if(this.getNeedsNewFallback()){t={};const a=await this.olmDevice.getFallbackKey();for(const[l,u]of Object.entries(a.curve25519)){const c={key:u,fallback:!0};t["signed_curve25519:"+l]=c,e.push(this.signObject(c))}this.setNeedsNewFallback(!1)}const r=await this.olmDevice.getOneTimeKeys(),i={};for(const a in r.curve25519)if(r.curve25519.hasOwnProperty(a)){const l={key:r.curve25519[a]};i["signed_curve25519:"+a]=l,e.push(this.signObject(l))}await Promise.all(e);const s={one_time_keys:i};t&&(s["org.matrix.msc2732.fallback_keys"]=t,s.fallback_keys=t);const o=await this.baseApis.uploadKeysRequest(s);return t&&(this.fallbackCleanup=setTimeout(()=>{delete this.fallbackCleanup,this.olmDevice.forgetOldFallbackKey()},60*60*1e3)),await this.olmDevice.markKeysAsPublished(),o}downloadKeys(e,t){return this.deviceList.downloadKeys(e,t)}getStoredDevicesForUser(e){return this.deviceList.getStoredDevicesForUser(e)}getStoredDevice(e,t){return this.deviceList.getStoredDevice(e,t)}saveDeviceList(e){return this.deviceList.saveIfDirty(e)}async setDeviceVerification(e,t,r,i,s){r===void 0&&(r=null),i===void 0&&(i=null),s===void 0&&(s=null);const o=this.deviceList.getStoredCrossSigningForUser(e);if(o&&o.getId()===t){if(i!==null||s!==null)throw new Error("Cannot set blocked or known for a cross-signing key");if(!r)throw new Error("Cannot set a cross-signing key as unverified");if(!this.crossSigningInfo.getId()&&e===this.crossSigningInfo.userId&&(this.storeTrustedSelfKeys(o.keys),this.emit(Ze.UserTrustStatusChanged,this.userId,this.checkUserTrust(e))),e!==this.userId){L.logger.info("Master key "+o.getId()+" for "+e+" marked verified. Signing...");const m=await this.crossSigningInfo.signUser(o);if(m){const f=async({shouldEmit:E=!1})=>{L.logger.info("Uploading signature for "+e+"...");const I=await this.baseApis.uploadKeySignatures({[e]:{[t]:m}}),{failures:w}=I||{};if(Object.keys(w||[]).length>0)throw E&&this.baseApis.emit(Ze.KeySignatureUploadFailure,w,"setDeviceVerification",f),new Kc.KeySignatureUploadError("Key upload failed",{failures:w})};await f({shouldEmit:!0})}return m}else return o}const a=this.deviceList.getRawStoredDevicesForUser(e);if(!a||!a[t])throw new Error("Unknown device "+e+":"+t);const l=a[t];let u=l.verified;r?u=Kn.VERIFIED:r!==null&&u==Kn.VERIFIED&&(u=Kn.UNVERIFIED),i?u=Kn.BLOCKED:i!==null&&u==Kn.BLOCKED&&(u=Kn.UNVERIFIED);let c=l.known;if(s!==null&&(c=s),(l.verified!==u||l.known!==c)&&(l.verified=u,l.known=c,this.deviceList.storeDevicesForUser(e,a),this.deviceList.saveIfDirty()),r&&e===this.userId){L.logger.info("Own device "+t+" marked verified: signing");let m;if(this.checkDeviceTrust(e,t).isCrossSigningVerified()?L.logger.log(`Own device ${t} already cross-signing verified`):m=await this.crossSigningInfo.signDevice(e,ll.DeviceInfo.fromStorage(l,t)),m){const E=async({shouldEmit:I=!1})=>{L.logger.info("Uploading signature for "+t);const w=await this.baseApis.uploadKeySignatures({[e]:{[t]:m}}),{failures:k}=w||{};if(Object.keys(k||[]).length>0)throw I&&this.baseApis.emit(Ze.KeySignatureUploadFailure,k,"setDeviceVerification",E),new Kc.KeySignatureUploadError("Key upload failed",{failures:k})};await E({shouldEmit:!0})}}const g=ll.DeviceInfo.fromStorage(l,t);return this.emit(Ze.DeviceVerificationChanged,e,t,g),g}findVerificationRequestDMInProgress(e){return this.inRoomVerificationRequests.findRequestInProgress(e)}getVerificationRequestsToDeviceInProgress(e){return this.toDeviceVerificationRequests.getRequestsInProgress(e)}requestVerificationDM(e,t){const r=this.inRoomVerificationRequests.findRequestInProgress(t);if(r)return Promise.resolve(r);const i=new Bc.InRoomChannel(this.baseApis,t,e);return this.requestVerificationWithChannel(e,i,this.inRoomVerificationRequests)}requestVerification(e,t){t||(t=Object.keys(this.deviceList.getRawStoredDevicesForUser(e)));const r=this.toDeviceVerificationRequests.findRequestInProgress(e,t);if(r)return Promise.resolve(r);const i=new Wr.ToDeviceChannel(this.baseApis,e,t,Wr.ToDeviceChannel.makeTransactionId());return this.requestVerificationWithChannel(e,i,this.toDeviceVerificationRequests)}async requestVerificationWithChannel(e,t,r){let i=new fa.VerificationRequest(t,this.verificationMethods,this.baseApis);t.transactionId&&r.setRequestByChannel(t,i),await i.sendRequest();const s=r.getRequestByChannel(t);return s?i=s:(L.logger.log(`Crypto: adding new request to requestsByTxnId with id ${t.transactionId} ${t.roomId}`),r.setRequestByChannel(t,i)),i}beginKeyVerification(e,t,r,i=null){let s;if(i){if(s=this.toDeviceVerificationRequests.getRequestBySenderAndTxnId(t,i),!s)throw new Error(`No request found for user ${t} with transactionId ${i}`)}else{i=Wr.ToDeviceChannel.makeTransactionId();const o=new Wr.ToDeviceChannel(this.baseApis,t,[r],i,r);s=new fa.VerificationRequest(o,this.verificationMethods,this.baseApis),this.toDeviceVerificationRequests.setRequestBySenderAndTxnId(t,i,s)}return s.beginKeyVerification(e,{userId:t,deviceId:r})}async legacyDeviceVerification(e,t,r){const i=Wr.ToDeviceChannel.makeTransactionId(),s=new Wr.ToDeviceChannel(this.baseApis,e,[t],i,t),o=new fa.VerificationRequest(s,this.verificationMethods,this.baseApis);this.toDeviceVerificationRequests.setRequestBySenderAndTxnId(e,i,o);const a=o.beginKeyVerification(r,{userId:e,deviceId:t});return await Promise.race([a.verify(),o.waitFor(l=>l.started)]),o}async getOlmSessionsForUser(e){const t=this.getStoredDevicesForUser(e)||[],r={};for(let i=0;i<t.length;++i){const s=t[i],o=s.getIdentityKey(),a=await this.olmDevice.getSessionInfoForDevice(o);r[s.deviceId]={deviceIdKey:o,sessions:a}}return r}getEventSenderDeviceInfo(e){const t=e.getSenderKey(),r=e.getWireContent().algorithm;if(!t||!r||e.getForwardingCurve25519KeyChain().length>0||e.isKeySourceUntrusted())return null;const s=this.deviceList.getDeviceByIdentityKey(r,t);if(s===null)return null;const o=e.getClaimedEd25519Key();return o?o!==s.getFingerprint()?(L.logger.warn("Event "+e.getId()+" claims ed25519 key "+o+" but sender device has key "+s.getFingerprint()),null):s:(L.logger.warn("Event "+e.getId()+" claims no ed25519 key: cannot verify sending device"),null)}getEventEncryptionInfo(e){const t={};if(t.senderKey=e.getSenderKey(),t.algorithm=e.getWireContent().algorithm,!t.senderKey||!t.algorithm)return t.encrypted=!1,t;t.encrypted=!0,e.getForwardingCurve25519KeyChain().length>0||e.isKeySourceUntrusted()?t.authenticated=!1:t.authenticated=!0,t.sender=this.deviceList.getDeviceByIdentityKey(t.algorithm,t.senderKey);const i=e.getClaimedEd25519Key();return i||(L.logger.warn("Event "+e.getId()+" claims no ed25519 key: cannot verify sending device"),t.mismatchedSender=!0),t.sender&&i!==t.sender.getFingerprint()&&(L.logger.warn("Event "+e.getId()+" claims ed25519 key "+i+"but sender device has key "+t.sender.getFingerprint()),t.mismatchedSender=!0),t}forceDiscardSession(e){const t=this.roomEncryptors[e];if(t===void 0)throw new Error("Room not encrypted");if(t.forceDiscardSession===void 0)throw new Error("Room encryption algorithm doesn't support session discarding");t.forceDiscardSession()}async setRoomEncryption(e,t,r){if(!t.algorithm){L.logger.log("Ignoring setRoomEncryption with no algorithm");return}const i=this.roomList.getRoomEncryption(e);if(i&&JSON.stringify(i)!=JSON.stringify(t)){L.logger.error("Ignoring m.room.encryption event which requests a change of config in "+e);return}if(this.roomEncryptors[e])return;let o=null;i||(o=this.roomList.setRoomEncryption(e,t));const a=Lc.ENCRYPTION_CLASSES[t.algorithm];if(!a)throw new Error("Unable to encrypt with "+t.algorithm);const l=new a({userId:this.userId,deviceId:this.deviceId,crypto:this,olmDevice:this.olmDevice,baseApis:this.baseApis,roomId:e,config:t});this.roomEncryptors[e]=l,o&&await o,this.lazyLoadMembers?L.logger.log("Enabling encryption in "+e):(L.logger.log("Enabling encryption in "+e+"; starting to track device lists for all users therein"),await this.trackRoomDevices(e),r||this.deviceList.refreshOutdatedDeviceLists())}trackRoomDevices(e){const t=async()=>{if(!this.roomEncryptors[e])return;const i=this.clientStore.getRoom(e);if(!i)throw new Error(`Unable to start tracking devices in unknown room ${e}`);L.logger.log(`Starting to track devices for room ${e} ...`),(await i.getEncryptionTargetMembers()).forEach(o=>{this.deviceList.startTrackingDeviceList(o.userId)})};let r=this.roomDeviceTrackingState[e];return r||(r=t(),this.roomDeviceTrackingState[e]=r.catch(i=>{throw this.roomDeviceTrackingState[e]=null,i})),r}ensureOlmSessionsForUsers(e,t){const r={};for(let i=0;i<e.length;++i){const s=e[i];r[s]=[];const o=this.getStoredDevicesForUser(s)||[];for(let a=0;a<o.length;++a){const l=o[a];l.getIdentityKey()!=this.olmDevice.deviceCurve25519Key&&l.verified!=Kn.BLOCKED&&r[s].push(l)}}return Ot.ensureOlmSessionsForDevices(this.olmDevice,this.baseApis,r,t)}async exportRoomKeys(){const e=[];return await this.cryptoStore.doTxn("readonly",[ha.IndexedDBCryptoStore.STORE_INBOUND_GROUP_SESSIONS],t=>{this.cryptoStore.getAllEndToEndInboundGroupSessions(t,r=>{if(r===null)return;const i=this.olmDevice.exportInboundGroupSession(r.senderKey,r.sessionId,r.sessionData);delete i.first_known_index,i.algorithm=Ot.MEGOLM_ALGORITHM,e.push(i)})}),e}importRoomKeys(e,t={}){let r=0,i=0;const s=e.length;function o(){t.progressCallback({stage:"load_keys",successes:r,failures:i,total:s})}return Promise.all(e.map(a=>!a.room_id||!a.algorithm?(L.logger.warn("ignoring room key entry with missing fields",a),i++,t.progressCallback&&o(),null):this.getRoomDecryptor(a.room_id,a.algorithm).importRoomKey(a,t).finally(()=>{r++,t.progressCallback&&o()}))).then()}countSessionsNeedingBackup(){return this.backupManager.countSessionsNeedingBackup()}prepareToEncrypt(e){const t=this.roomEncryptors[e.roomId];t&&t.prepareToEncrypt(e)}async encryptEvent(e,t){if(!t)throw new Error("Cannot send encrypted messages in unknown rooms");const r=e.getRoomId(),i=this.roomEncryptors[r];if(!i)throw new Error("Room was previously configured to use encryption, but is no longer. Perhaps the homeserver is hiding the configuration event.");this.roomDeviceTrackingState[r]||this.trackRoomDevices(r),await this.roomDeviceTrackingState[r];let s=e.getContent();const o=s["m.relates_to"];o&&(s=Object.assign({},s),delete s["m.relates_to"]);const a=s["io.element.performance_metrics"];a&&(s=Object.assign({},s),delete s["io.element.performance_metrics"]);const l=await i.encryptMessage(t,e.getType(),s);o&&(l["m.relates_to"]=o),a&&(l["io.element.performance_metrics"]=a),e.makeEncrypted("m.room.encrypted",l,this.olmDevice.deviceCurve25519Key,this.olmDevice.deviceEd25519Key)}async decryptEvent(e){if(e.isRedacted()){const t=new Bn.MatrixEvent(e.getUnsigned().redacted_because),r=await this.decryptEvent(t);return{clearEvent:{room_id:e.getRoomId(),type:"m.room.message",content:{},unsigned:{redacted_because:r.clearEvent}}}}else{const t=e.getWireContent();return await this.getRoomDecryptor(e.getRoomId(),t.algorithm).decryptEvent(e)}}async handleDeviceListChanges(e,t){!e.oldSyncToken||await this.evalDeviceListChanges(t)}requestRoomKey(e,t,r=!1){return this.outgoingRoomKeyRequestManager.queueRoomKeyRequest(e,t,r).then(()=>{this.sendKeyRequestsImmediately&&this.outgoingRoomKeyRequestManager.sendQueuedRequests()}).catch(i=>{L.logger.error("Error requesting key for event",i)})}cancelRoomKeyRequest(e){this.outgoingRoomKeyRequestManager.cancelRoomKeyRequest(e).catch(t=>{L.logger.warn("Error clearing pending room key requests",t)})}async cancelAndResendAllOutgoingKeyRequests(){await this.outgoingRoomKeyRequestManager.cancelAndResendAllOutgoingRequests()}async onCryptoEvent(e){const t=e.getRoomId(),r=e.getContent();try{await this.setRoomEncryption(t,r,!0)}catch(i){L.logger.error("Error configuring encryption in room "+t+":",i)}}async onSyncWillProcess(e){e.oldSyncToken||(L.logger.log("Initial sync performed - resetting device tracking state"),this.deviceList.stopTrackingAllDeviceLists(),this.deviceList.startTrackingDeviceList(this.userId),this.roomDeviceTrackingState={}),this.sendKeyRequestsImmediately=!1}async onSyncCompleted(e){this.deviceList.setSyncToken(e.nextSyncToken),this.deviceList.saveIfDirty(),this.deviceList.startTrackingDeviceList(this.userId),this.deviceList.refreshOutdatedDeviceLists(),e.catchingUp||(this.maybeUploadOneTimeKeys(),this.processReceivedRoomKeyRequests(),this.outgoingRoomKeyRequestManager.sendQueuedRequests(),this.sendKeyRequestsImmediately=!0)}async evalDeviceListChanges(e){if(e.changed&&Array.isArray(e.changed)&&e.changed.forEach(t=>{this.deviceList.invalidateUserDeviceList(t)}),e.left&&Array.isArray(e.left)&&e.left.length){const t=new Set(await this.getTrackedE2eUsers());e.left.forEach(r=>{t.has(r)||this.deviceList.stopTrackingDeviceList(r)})}}async getTrackedE2eUsers(){const e=[];for(const t of this.getTrackedE2eRooms()){const r=await t.getEncryptionTargetMembers();for(const i of r)e.push(i.userId)}return e}getTrackedE2eRooms(){return this.clientStore.getRooms().filter(e=>{if(!this.roomEncryptors[e.roomId]||!this.roomDeviceTrackingState[e.roomId])return!1;const r=e.getMyMembership();return r==="join"||r==="invite"})}onRoomKeyEvent(e){const t=e.getContent();if(!t.room_id||!t.algorithm){L.logger.error("key event is missing fields");return}this.backupManager.checkedForBackup||this.backupManager.checkAndStart(),this.getRoomDecryptor(t.room_id,t.algorithm).onRoomKeyEvent(e)}onRoomKeyWithheldEvent(e){const t=e.getContent();if(t.code!=="m.no_olm"&&(!t.room_id||!t.session_id)||!t.algorithm||!t.sender_key){L.logger.error("key withheld event is missing fields");return}L.logger.info(`Got room key withheld event from ${e.getSender()} (${t.sender_key}) for ${t.algorithm}/${t.room_id}/${t.session_id} with reason ${t.code} (${t.reason})`);const r=this.getRoomDecryptor(t.room_id,t.algorithm);if(r.onRoomKeyWithheldEvent&&r.onRoomKeyWithheldEvent(e),!t.room_id){const i=this.getRoomDecryptors(t.algorithm);for(const s of i)s.retryDecryptionFromSender(t.sender_key)}}onKeyVerificationMessage(e){if(!Wr.ToDeviceChannel.validateEvent(e,this.baseApis))return;const t=r=>{if(!Wr.ToDeviceChannel.canCreateRequest(Wr.ToDeviceChannel.getEventType(r)))return;const i=r.getContent(),s=i&&i.from_device;if(!s)return;const o=r.getSender(),a=new Wr.ToDeviceChannel(this.baseApis,o,[s]);return new fa.VerificationRequest(a,this.verificationMethods,this.baseApis)};this.handleVerificationEvent(e,this.toDeviceVerificationRequests,t)}async handleVerificationEvent(e,t,r,i=!0){if(e.isSending()&&e.status!=Bn.EventStatus.SENT){let l,u;try{await new Promise((c,g)=>{l=c,u=()=>{e.status==Bn.EventStatus.CANCELLED&&g(new Error("Event status set to CANCELLED."))},e.once(Bn.MatrixEventEvent.LocalEventIdReplaced,l),e.on(Bn.MatrixEventEvent.Status,u)})}catch(c){L.logger.error("error while waiting for the verification event to be sent: "+c.message);return}finally{e.removeListener(Bn.MatrixEventEvent.LocalEventIdReplaced,l),e.removeListener(Bn.MatrixEventEvent.Status,u)}}let s=t.getRequest(e),o=!1;if(!s){if(s=r(e),!s){L.logger.log(`Crypto: could not find VerificationRequest for ${e.getType()}, and could not create one, so ignoring.`);return}o=!0,t.setRequest(e,s)}e.setVerificationRequest(s);try{await s.channel.handleEvent(e,s,i)}catch(l){L.logger.error("error while handling verification event: "+l.message)}o&&!s.initiatedByMe&&!s.invalid&&!s.observeOnly&&this.baseApis.emit(Ze.VerificationRequest,s)}async onToDeviceBadEncrypted(e){const t=e.getWireContent(),r=e.getSender(),i=t.algorithm,s=t.sender_key,o=()=>{const m=this.getRoomDecryptors(Ot.MEGOLM_ALGORITHM);for(const f of m)f.retryDecryptionFromSender(s)};if(r===void 0||s===void 0||s===void 0)return;this.lastNewSessionForced[r]=this.lastNewSessionForced[r]||{};const a=this.lastNewSessionForced[r][s]||0;if(a+JM>Date.now()){L.logger.debug("New session already forced with device "+r+":"+s+" at "+a+": not forcing another"),await this.olmDevice.recordSessionProblem(s,"wedged",!0),o();return}let l=this.deviceList.getDeviceByIdentityKey(i,s);if(!l&&(await this.downloadKeys([r],!1),l=this.deviceList.getDeviceByIdentityKey(i,s),!l)){L.logger.info("Couldn't find device for identity key "+s+": not re-establishing session"),await this.olmDevice.recordSessionProblem(s,"wedged",!1),o();return}const u={};u[r]=[l],await Ot.ensureOlmSessionsForDevices(this.olmDevice,this.baseApis,u,!0),this.lastNewSessionForced[r][s]=Date.now();const c={algorithm:Ot.OLM_ALGORITHM,sender_key:this.olmDevice.deviceCurve25519Key,ciphertext:{}};await Ot.encryptMessageForDevice(c.ciphertext,this.userId,this.deviceId,this.olmDevice,r,l,{type:"m.dummy"}),await this.olmDevice.recordSessionProblem(s,"wedged",!0),o(),await this.baseApis.sendToDevice("m.room.encrypted",{[r]:{[l.deviceId]:c}});const g=await this.outgoingRoomKeyRequestManager.getOutgoingSentRoomKeyRequest(r,l.deviceId);for(const m of g)this.requestRoomKey(m.requestBody,m.recipients,!0)}onRoomMembership(e,t,r){const i=t.roomId,s=this.roomEncryptors[i];!s||(this.roomDeviceTrackingState[i]&&(t.membership=="join"?(L.logger.log("Join event for "+t.userId+" in "+i),this.deviceList.startTrackingDeviceList(t.userId)):t.membership=="invite"&&this.clientStore.getRoom(i).shouldEncryptForInvitedMembers()&&(L.logger.log("Invite event for "+t.userId+" in "+i),this.deviceList.startTrackingDeviceList(t.userId))),s.onRoomMembership(e,t,r))}onRoomKeyRequestEvent(e){const t=e.getContent();if(t.action==="request"){const r=new x_(e);this.receivedRoomKeyRequests.push(r)}else if(t.action==="request_cancellation"){const r=new QM(e);this.receivedRoomKeyRequestCancellations.push(r)}}async processReceivedRoomKeyRequests(){if(!this.processingRoomKeyRequests){this.processingRoomKeyRequests=!0;try{const e=this.receivedRoomKeyRequests;this.receivedRoomKeyRequests=[];const t=this.receivedRoomKeyRequestCancellations;this.receivedRoomKeyRequestCancellations=[],await Promise.all(e.map(r=>this.processReceivedRoomKeyRequest(r))),await Promise.all(t.map(r=>this.processReceivedRoomKeyRequestCancellation(r)))}catch(e){L.logger.error(`Error processing room key requsts: ${e}`)}finally{this.processingRoomKeyRequests=!1}}}async processReceivedRoomKeyRequest(e){const t=e.userId,r=e.deviceId,i=e.requestBody,s=i.room_id,o=i.algorithm;if(L.logger.log(`m.room_key_request from ${t}:${r} for ${s} / ${i.session_id} (id ${e.requestId})`),t!==this.userId){if(!this.roomEncryptors[s]){L.logger.debug(`room key request for unencrypted room ${s}`);return}const l=this.roomEncryptors[s],u=this.deviceList.getStoredDevice(t,r);if(!u){L.logger.debug(`Ignoring keyshare for unknown device ${t}:${r}`);return}try{await l.reshareKeyWithDevice(i.sender_key,i.session_id,t,u)}catch(c){L.logger.warn("Failed to re-share keys for session "+i.session_id+" with device "+t+":"+u.deviceId,c)}return}if(r===this.deviceId){L.logger.log("Ignoring room key request from ourselves");return}if(!this.roomDecryptors[s]){L.logger.log(`room key request for unencrypted room ${s}`);return}const a=this.roomDecryptors[s][o];if(!a){L.logger.log(`room key request for unknown alg ${o} in room ${s}`);return}if(!await a.hasKeysForKeyRequest(e)){L.logger.log(`room key request for unknown session ${s} / `+i.session_id);return}if(e.share=()=>{a.shareKeysWithDevice(e)},this.checkDeviceTrust(t,r).isVerified()){L.logger.log("device is already verified: sharing keys"),e.share();return}this.emit(Ze.RoomKeyRequest,e)}async processReceivedRoomKeyRequestCancellation(e){L.logger.log(`m.room_key_request cancellation for ${e.userId}:${e.deviceId} (id ${e.requestId})`),this.emit(Ze.RoomKeyRequestCancellation,e)}getRoomDecryptor(e,t){let r,i;if(e=e||null,e&&(r=this.roomDecryptors[e],r||(this.roomDecryptors[e]=r={}),i=r[t],i))return i;const s=Lc.DECRYPTION_CLASSES[t];if(!s)throw new Lc.DecryptionError("UNKNOWN_ENCRYPTION_ALGORITHM",'Unknown encryption algorithm "'+t+'".');return i=new s({userId:this.userId,crypto:this,olmDevice:this.olmDevice,baseApis:this.baseApis,roomId:e}),r&&(r[t]=i),i}getRoomDecryptors(e){const t=[];for(const r of Object.values(this.roomDecryptors))e in r&&t.push(r[e]);return t}async signObject(e){const t=e.signatures||{},r=e.unsigned;delete e.signatures,delete e.unsigned,t[this.userId]=t[this.userId]||{},t[this.userId]["ed25519:"+this.deviceId]=await this.olmDevice.sign(NM.default.stringify(e)),e.signatures=t,r!==void 0&&(e.unsigned=r)}}Ft.Crypto=XM;function ul(n){if(typeof n!="string"||n.indexOf(",")<0)return null;const e=Uint8Array.from(n.split(","),t=>parseInt(t));return Ot.encodeBase64(e)}class x_{constructor(e){(0,ae.default)(this,"userId",void 0),(0,ae.default)(this,"deviceId",void 0),(0,ae.default)(this,"requestId",void 0),(0,ae.default)(this,"requestBody",void 0),(0,ae.default)(this,"share",void 0);const t=e.getContent();this.userId=e.getSender(),this.deviceId=t.requesting_device_id,this.requestId=t.request_id,this.requestBody=t.body||{},this.share=()=>{throw new Error("don't know how to share keys for this request yet")}}}Ft.IncomingRoomKeyRequest=x_;class QM{constructor(e){(0,ae.default)(this,"userId",void 0),(0,ae.default)(this,"deviceId",void 0),(0,ae.default)(this,"requestId",void 0);const t=e.getContent();this.userId=e.getSender(),this.deviceId=t.requesting_device_id,this.requestId=t.request_id}}var lu={},uu={},ZM=G.exports;Object.defineProperty(uu,"__esModule",{value:!0});uu.EventContext=void 0;var yd=ZM(Y.exports),Xs=qt;class eA{constructor(e){(0,yd.default)(this,"timeline",void 0),(0,yd.default)(this,"ourEventIndex",0),(0,yd.default)(this,"paginateTokens",{[Xs.Direction.Backward]:null,[Xs.Direction.Forward]:null}),this.timeline=[e]}getEvent(){return this.timeline[this.ourEventIndex]}getTimeline(){return this.timeline}getOurEventIndex(){return this.ourEventIndex}getPaginateToken(e=!1){return this.paginateTokens[e?Xs.Direction.Backward:Xs.Direction.Forward]}setPaginateToken(e,t=!1){this.paginateTokens[t?Xs.Direction.Backward:Xs.Direction.Forward]=e}addEvents(e,t=!1){t?(this.timeline=e.concat(this.timeline),this.ourEventIndex+=e.length):this.timeline=this.timeline.concat(e)}}uu.EventContext=eA;Object.defineProperty(lu,"__esModule",{value:!0});lu.SearchResult=void 0;var tA=uu;class Af{static fromJson(e,t){const r=e.context||{},i=r.events_before||[],s=r.events_after||[],o=new tA.EventContext(t(e.result));return o.setPaginateToken(r.start,!0),o.addEvents(i.map(t),!0),o.addEvents(s.map(t),!1),o.setPaginateToken(r.end,!1),new Af(e.rank,o)}constructor(e,t){this.rank=e,this.context=t}}lu.SearchResult=Af;var lc={};Object.defineProperty(lc,"__esModule",{value:!0});lc.CrossSigningKey=void 0;let Fh;lc.CrossSigningKey=Fh;(function(n){n.Master="master",n.SelfSigning="self_signing",n.UserSigning="user_signing"})(Fh||(lc.CrossSigningKey=Fh={}));var Df={};Object.defineProperty(Df,"__esModule",{value:!0});Df.eventMapperFor=rA;var Fc=jt;function rA(n,e){const t=Boolean(e.preventReEmit),r=e.decrypt!==!1;function i(s){const o=new Fc.MatrixEvent(s),a=n.getRoom(o.getRoomId());return a!=null&&a.threads.has(o.getId())&&o.setThread(a.threads.get(o.getId())),o.isEncrypted()&&(t||n.reEmitter.reEmit(o,[Fc.MatrixEventEvent.Decrypted]),r&&n.decryptEventIfNeeded(o)),t||n.reEmitter.reEmit(o,[Fc.MatrixEventEvent.Replaced,Fc.MatrixEventEvent.VisibilityChange]),o}return i}var Zn={},du={},nA=G.exports;Object.defineProperty(du,"__esModule",{value:!0});du.MSC3089Branch=void 0;var iA=nA(Y.exports),Qs=ie,sA=qt;function Sm(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function Ii(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Sm(Object(t),!0).forEach(function(r){(0,iA.default)(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Sm(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}class oA{constructor(e,t,r){this.client=e,this.indexEvent=t,this.directory=r}get id(){const e=this.indexEvent.getStateKey();if(!e)throw new Error("State key not found for branch");return e}get isActive(){return this.indexEvent.getContent().active===!0}get version(){var e;return(e=this.indexEvent.getContent().version)!==null&&e!==void 0?e:1}get roomId(){return this.indexEvent.getRoomId()}async delete(){await this.client.sendStateEvent(this.roomId,Qs.UNSTABLE_MSC3089_BRANCH.name,{},this.id),await this.client.redactEvent(this.roomId,this.id);const e=(await this.getVersionHistory())[1];e&&await e.delete()}getName(){return this.indexEvent.getContent().name||"Unnamed File"}async setName(e){await this.client.sendStateEvent(this.roomId,Qs.UNSTABLE_MSC3089_BRANCH.name,Ii(Ii({},this.indexEvent.getContent()),{},{name:e}),this.id)}isLocked(){return this.indexEvent.getContent().locked||!1}async setLocked(e){await this.client.sendStateEvent(this.roomId,Qs.UNSTABLE_MSC3089_BRANCH.name,Ii(Ii({},this.indexEvent.getContent()),{},{locked:e}),this.id)}async getFileInfo(){const t=(await this.getFileEvent()).getOriginalContent().file,r=this.client.mxcUrlToHttp(t.url);if(!r)throw new Error(`No HTTP URL available for ${t.url}`);return{info:t,httpUrl:r}}async getFileEvent(){const e=this.client.getRoom(this.roomId);if(!e)throw new Error("Unknown room");let t=e.getUnfilteredTimelineSet().findEventById(this.id);for(;!t&&e.getLiveTimeline().getState(sA.EventTimeline.BACKWARDS).paginationToken;)await this.client.scrollback(e,100),t=e.getUnfilteredTimelineSet().findEventById(this.id);if(!t)throw new Error("Failed to find event");return await this.client.decryptEventIfNeeded(t,{emit:!0,isRetry:!0}),t}async createNewVersion(e,t,r,i){const s=await this.directory.createFile(e,t,r,Ii(Ii({},i!=null?i:{}),{},{"m.new_content":!0,"m.relates_to":{rel_type:Qs.RelationType.Replace,event_id:this.id}}));return await this.client.sendStateEvent(this.roomId,Qs.UNSTABLE_MSC3089_BRANCH.name,{active:!0,name:e,version:this.version+1},s.event_id),await this.client.sendStateEvent(this.roomId,Qs.UNSTABLE_MSC3089_BRANCH.name,Ii(Ii({},this.indexEvent.getContent()),{},{active:!1}),this.id),s}async getVersionHistory(){const e=[];e.push(this);const t=this.client.getRoom(this.roomId);if(!t)throw new Error("Invalid or unknown room");const r=[...t.getLiveTimeline().getEvents()].reverse();let i,s=await this.getFileEvent();do if(i=r.find(o=>o.replacingEventId()===s.getId()),i){const o=this.directory.getFile(i.getId());if(o)e.push(o),s=i;else break}while(i);return e}}du.MSC3089Branch=oA;var U_=G.exports;Object.defineProperty(Zn,"__esModule",{value:!0});Zn.TreePermissions=fA=Zn.MSC3089TreeSpace=dA=Zn.DEFAULT_TREE_POWER_LEVELS_TEMPLATE=void 0;var $_=U_(Y.exports),aA=U_(Xa.exports),Se=ie,cA=se,Qt=W,bm=du,lA=If;function wm(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function Yi(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?wm(Object(t),!0).forEach(function(r){(0,$_.default)(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):wm(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}const uA={invite:100,kick:100,ban:100,redact:50,state_default:50,events_default:50,users_default:0,events:{[Se.EventType.RoomPowerLevels]:100,[Se.EventType.RoomHistoryVisibility]:100,[Se.EventType.RoomTombstone]:100,[Se.EventType.RoomEncryption]:100,[Se.EventType.RoomName]:50,[Se.EventType.RoomMessage]:50,[Se.EventType.RoomMessageEncrypted]:50,[Se.EventType.Sticker]:50},users:{}};var dA=Zn.DEFAULT_TREE_POWER_LEVELS_TEMPLATE=uA;let Yn;Zn.TreePermissions=Yn;(function(n){n.Viewer="viewer",n.Editor="editor",n.Owner="owner"})(Yn||(Zn.TreePermissions=Yn={}));class hA{constructor(e,t){if(this.client=e,this.roomId=t,(0,$_.default)(this,"room",void 0),this.room=this.client.getRoom(this.roomId),!this.room)throw new Error("Unknown room")}get id(){return this.roomId}get isTopLevel(){const e=this.room.currentState.getStateEvents(Se.EventType.SpaceParent);return e!=null&&e.length?e.every(t=>{var r;return!((r=t.getContent())!==null&&r!==void 0&&r.via)}):!0}async setName(e){await this.client.sendStateEvent(this.roomId,Se.EventType.RoomName,{name:e},"")}async invite(e,t=!0,r=!0){const i=[this.retryInvite(e)];return t&&i.push(...this.getDirectories().map(s=>s.invite(e,t,r))),Promise.all(i).then(()=>{r&&(0,lA.isRoomSharedHistory)(this.room)&&this.client.sendSharedHistoryKeys(this.roomId,[e])})}retryInvite(e){return(0,Qt.simpleRetryOperation)(async()=>{await this.client.invite(this.roomId,e).catch(t=>{throw(t==null?void 0:t.errcode)==="M_FORBIDDEN"?new aA.default.AbortError(t):t})})}async setPermissions(e,t){var r;const i=this.room.currentState.getStateEvents(Se.EventType.RoomPowerLevels,"");if(Array.isArray(i))throw new Error("Unexpected return type for power levels");const s=i.getContent()||{},o=s.users_default||0,a=s.events_default||50,l=((r=s.events)===null||r===void 0?void 0:r[Se.EventType.RoomPowerLevels])||100,u=s.users||{};switch(t){case Yn.Viewer:u[e]=o;break;case Yn.Editor:u[e]=a;break;case Yn.Owner:u[e]=l;break;default:throw new Error("Invalid role: "+t)}s.users=u,await this.client.sendStateEvent(this.roomId,Se.EventType.RoomPowerLevels,s,"")}getPermissions(e){var t,r;const i=this.room.currentState.getStateEvents(Se.EventType.RoomPowerLevels,"");if(Array.isArray(i))throw new Error("Unexpected return type for power levels");const s=i.getContent()||{},o=s.users_default||0,a=s.events_default||50,l=((t=s.events)===null||t===void 0?void 0:t[Se.EventType.RoomPowerLevels])||100,u=((r=s.users)===null||r===void 0?void 0:r[e])||o;return u>=l?Yn.Owner:u>=a?Yn.Editor:Yn.Viewer}async createDirectory(e){const t=await this.client.unstableCreateFileTree(e);return await this.client.sendStateEvent(this.roomId,Se.EventType.SpaceChild,{via:[this.client.getDomain()]},t.roomId),await this.client.sendStateEvent(t.roomId,Se.EventType.SpaceParent,{via:[this.client.getDomain()]},this.roomId),t}getDirectories(){const e=[],t=this.room.currentState.getStateEvents(Se.EventType.SpaceChild);for(const r of t)try{const i=r.getStateKey();if(i){const s=this.client.unstableGetFileTreeSpace(i);s&&e.push(s)}}catch(i){cA.logger.warn("Unable to create tree space instance for listing. Are we joined?",i)}return e}getDirectory(e){return this.getDirectories().find(t=>t.roomId===e)}async delete(){const e=this.getDirectories();for(const i of e)await i.delete();const t=["invite","knock","join"],r=this.room.currentState.getStateEvents(Se.EventType.RoomMember);for(const i of r)if(i.getStateKey()!==this.client.getUserId()&&t.includes(i.getContent().membership)){const o=i.getStateKey();if(!o)throw new Error("State key not found for branch");await this.client.kick(this.roomId,o,"Room deleted")}await this.client.leave(this.roomId)}getOrderedChildren(e){const t=e.map(r=>({roomId:r.getStateKey(),order:r.getContent().order})).filter(r=>r.roomId);return t.sort((r,i)=>{if(r.order&&!i.order)return-1;if(!r.order&&i.order)return 1;if(!r.order&&!i.order){var s,o,a,l;const u=this.client.getRoom(r.roomId),c=this.client.getRoom(i.roomId);if(!u||!c)return(0,Qt.lexicographicCompare)(r.roomId,i.roomId);const g=(s=(o=u.currentState.getStateEvents(Se.EventType.RoomCreate,""))===null||o===void 0?void 0:o.getTs())!==null&&s!==void 0?s:0,m=(a=(l=c.currentState.getStateEvents(Se.EventType.RoomCreate,""))===null||l===void 0?void 0:l.getTs())!==null&&a!==void 0?a:0;return g===m?(0,Qt.lexicographicCompare)(r.roomId,i.roomId):g-m}else return(0,Qt.lexicographicCompare)(r.order,i.order)}),t}getParentRoom(){const t=this.room.currentState.getStateEvents(Se.EventType.SpaceParent)[0];if(!t)throw new Error("Expected to have a parent in a non-top level space");const r=t.getStateKey();if(!r)throw new Error("No state key found for parent");const i=this.client.getRoom(r);if(!i)throw new Error("Unable to locate room for parent");return i}getOrder(){if(this.isTopLevel)return-1;const t=this.getParentRoom().currentState.getStateEvents(Se.EventType.SpaceChild);return this.getOrderedChildren(t).findIndex(i=>i.roomId===this.roomId)}async setOrder(e){var t;if(this.isTopLevel)throw new Error("Cannot set order of top level spaces currently");const r=this.getParentRoom(),i=r.currentState.getStateEvents(Se.EventType.SpaceChild),s=this.getOrderedChildren(i);e=Math.max(Math.min(e,s.length-1),0);const a=this.getOrder()<e;a&&e===s.length-1?e--:!a&&e===0&&e++;const l=s[a?e:e-1],u=s[a?e+1:e];let c=Qt.DEFAULT_ALPHABET[0],g=!1;if(!l)u!=null&&u.order&&(c=(0,Qt.prevString)(u.order));else if(e===s.length-1)u!=null&&u.order&&(c=(0,Qt.nextString)(u.order));else{const I=l==null?void 0:l.order,w=u==null?void 0:u.order;I&&w?I===w?c=(0,Qt.nextString)(I):c=(0,Qt.averageBetweenStrings)(I,w):I?c=(0,Qt.nextString)(I):w?c=(0,Qt.prevString)(w):g=!0}if(g){let I;for(let w=0;w<=e;w++){const k=s[w];if(w===0&&(I=k.order),k.order)I=k.order;else{var m;I=I?(0,Qt.nextString)(I):Qt.DEFAULT_ALPHABET[0];const C=r.currentState.getStateEvents(Se.EventType.SpaceChild,k.roomId),S=(m=C==null?void 0:C.getContent())!==null&&m!==void 0?m:{via:[this.client.getDomain()]};await this.client.sendStateEvent(r.roomId,Se.EventType.SpaceChild,Yi(Yi({},S),{},{order:I}),k.roomId)}}I&&(c=(0,Qt.nextString)(I))}const f=r.currentState.getStateEvents(Se.EventType.SpaceChild,this.roomId),E=(t=f==null?void 0:f.getContent())!==null&&t!==void 0?t:{via:[this.client.getDomain()]};await this.client.sendStateEvent(r.roomId,Se.EventType.SpaceChild,Yi(Yi({},E),{},{order:c}),this.roomId)}async createFile(e,t,r,i){var s;const o=await this.client.uploadContent(t,{includeFilename:!1,onlyContentUri:!0,rawResponse:!1});r.url=o;const a={msgtype:Se.MsgType.File,body:e,url:o,file:r};i=(s=i)!==null&&s!==void 0?s:{},i["m.new_content"]&&(i["m.new_content"]=a);const l=await this.client.sendMessage(this.roomId,Yi(Yi(Yi({},i),a),{},{[Se.UNSTABLE_MSC3089_LEAF.name]:{}}));return await this.client.sendStateEvent(this.roomId,Se.UNSTABLE_MSC3089_BRANCH.name,{active:!0,name:e},l.event_id),l}getFile(e){const t=this.room.currentState.getStateEvents(Se.UNSTABLE_MSC3089_BRANCH.name,e);return t?new bm.MSC3089Branch(this.client,t,this):null}listFiles(){return this.listAllFiles().filter(e=>e.isActive)}listAllFiles(){var e;return((e=this.room.currentState.getStateEvents(Se.UNSTABLE_MSC3089_BRANCH.name))!==null&&e!==void 0?e:[]).map(r=>new bm.MSC3089Branch(this.client,r,this))}}var fA=Zn.MSC3089TreeSpace=hA,Go={};Object.defineProperty(Go,"__esModule",{value:!0});Go.SearchOrderBy=void 0;var Rm;(function(n){n.RoomId="room_id",n.Sender="sender"})(Rm||(Rm={}));let qh;Go.SearchOrderBy=qh;(function(n){n.Recent="recent",n.Rank="rank"})(qh||(Go.SearchOrderBy=qh={}));var hu={},pA=G.exports;Object.defineProperty(hu,"__esModule",{value:!0});hu.MediaHandler=void 0;var pa=pA(Y.exports),Pr=se,gA=Ce;class mA{constructor(e){this.client=e,(0,pa.default)(this,"audioInput",void 0),(0,pa.default)(this,"videoInput",void 0),(0,pa.default)(this,"localUserMediaStream",void 0),(0,pa.default)(this,"userMediaStreams",[]),(0,pa.default)(this,"screensharingStreams",[])}async setAudioInput(e){Pr.logger.info("LOG setting audio input to",e),this.audioInput!==e&&(this.audioInput=e,await this.updateLocalUsermediaStreams())}async setVideoInput(e){Pr.logger.info("LOG setting video input to",e),this.videoInput!==e&&(this.videoInput=e,await this.updateLocalUsermediaStreams())}async updateLocalUsermediaStreams(){if(this.userMediaStreams.length===0)return;const e=new Map;for(const t of this.client.callEventHandler.calls.values())e.set(t.callId,{audio:t.hasLocalUserMediaAudioTrack,video:t.hasLocalUserMediaVideoTrack});for(const t of this.client.callEventHandler.calls.values()){if(t.state===gA.CallState.Ended||!e.has(t.callId))continue;const{audio:r,video:i}=e.get(t.callId),s=await this.getUserMediaStream(r,i,!1);await t.updateLocalUsermediaStream(s)}}async hasAudioDevice(){return(await navigator.mediaDevices.enumerateDevices()).filter(t=>t.kind==="audioinput").length>0}async hasVideoDevice(){return(await navigator.mediaDevices.enumerateDevices()).filter(t=>t.kind==="videoinput").length>0}async getUserMediaStream(e,t,r=!0){var i,s,o,a;const l=e&&await this.hasAudioDevice(),u=t&&await this.hasVideoDevice();let c;if(!this.localUserMediaStream||this.localUserMediaStream.getAudioTracks().length===0&&l||this.localUserMediaStream.getVideoTracks().length===0&&u||((i=this.localUserMediaStream.getAudioTracks()[0])===null||i===void 0||(s=i.getSettings())===null||s===void 0?void 0:s.deviceId)!==this.audioInput||((o=this.localUserMediaStream.getVideoTracks()[0])===null||o===void 0||(a=o.getSettings())===null||a===void 0?void 0:a.deviceId)!==this.videoInput){const g=this.getUserMediaContraints(l,u);Pr.logger.log("Getting user media with constraints",g),c=await navigator.mediaDevices.getUserMedia(g);for(const m of c.getTracks()){const f=m.getSettings();m.kind==="audio"?this.audioInput=f.deviceId:m.kind==="video"&&(this.videoInput=f.deviceId)}r&&(this.localUserMediaStream=c)}else{if(c=this.localUserMediaStream.clone(),!l)for(const g of c.getAudioTracks())c.removeTrack(g);if(!u)for(const g of c.getVideoTracks())c.removeTrack(g)}return r&&this.userMediaStreams.push(c),c}stopUserMediaStream(e){Pr.logger.debug("Stopping usermedia stream",e.id);for(const r of e.getTracks())r.stop();const t=this.userMediaStreams.indexOf(e);t!==-1&&(Pr.logger.debug("Splicing usermedia stream out stream array",e.id),this.userMediaStreams.splice(t,1)),this.localUserMediaStream===e&&(this.localUserMediaStream=void 0)}async getScreensharingStream(e,t=!0){let r;if(this.screensharingStreams.length===0){const i=this.getScreenshareContraints(e);if(!i)return null;e?(Pr.logger.debug("Getting screensharing stream using getUserMedia()",e),r=await navigator.mediaDevices.getUserMedia(i)):(Pr.logger.debug("Getting screensharing stream using getDisplayMedia()"),r=await navigator.mediaDevices.getDisplayMedia(i))}else{const i=this.screensharingStreams[this.screensharingStreams.length-1];Pr.logger.log("Cloning screensharing stream",i.id),r=i.clone()}return t&&this.screensharingStreams.push(r),r}stopScreensharingStream(e){Pr.logger.debug("Stopping screensharing stream",e.id);for(const r of e.getTracks())r.stop();const t=this.screensharingStreams.indexOf(e);t!==-1&&(Pr.logger.debug("Splicing screensharing stream out stream array",e.id),this.screensharingStreams.splice(t,1))}stopAllStreams(){for(const e of this.userMediaStreams)for(const t of e.getTracks())t.stop();for(const e of this.screensharingStreams)for(const t of e.getTracks())t.stop();this.userMediaStreams=[],this.screensharingStreams=[],this.localUserMediaStream=void 0}getUserMediaContraints(e,t){const r=!!navigator.webkitGetUserMedia;return{audio:e?{deviceId:this.audioInput?{ideal:this.audioInput}:void 0}:!1,video:t?{deviceId:this.videoInput?{ideal:this.videoInput}:void 0,width:r?{exact:640}:{ideal:640},height:r?{exact:360}:{ideal:360}}:!1}}getScreenshareContraints(e){return e?(Pr.logger.debug("Using desktop capturer source",e),{audio:!1,video:{mandatory:{chromeMediaSource:"desktop",chromeMediaSourceId:e}}}):(Pr.logger.debug("Not using desktop capturer source"),{audio:!1,video:!0})}}hu.MediaHandler=mA;var yA=G.exports;Object.defineProperty(st,"__esModule",{value:!0});st.RoomVersionStability=st.PendingEventOrdering=st.MatrixClient=st.ClientEvent=st.CRYPTO_ENABLED=void 0;var X=yA(Y.exports),vd=Fl,Zs=$i,nt=jt,vA=eu,Im=Ce,qc=Ds,_A=vs,N=xf(W),ga=qt,_d=cc,EA=Ni,Ed=xf(xe),SA=tn,bA=ru,oe=se,Tm=jo,M=me,Nt=Ft,Sd=Vo,Om=Us,bd=Qr,wA=$o,RA=lu,IA=Rs,eo=Cs,TA=lc,to=xf(Xe),ue=ie,OA=Je,kA=Df,CA=ai,km=yr,wd=Zn,PA=Go,jc=Fe,MA=hu,AA=je,Vc=lt,DA=Rn;function N_(n){if(typeof WeakMap!="function")return null;var e=new WeakMap,t=new WeakMap;return(N_=function(r){return r?t:e})(n)}function xf(n,e){if(!e&&n&&n.__esModule)return n;if(n===null||typeof n!="object"&&typeof n!="function")return{default:n};var t=N_(e);if(t&&t.has(n))return t.get(n);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in n)if(s!=="default"&&Object.prototype.hasOwnProperty.call(n,s)){var o=i?Object.getOwnPropertyDescriptor(n,s):null;o&&(o.get||o.set)?Object.defineProperty(r,s,o):r[s]=n[s]}return r.default=n,t&&t.set(n,r),r}function Cm(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function Gc(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Cm(Object(t),!0).forEach(function(r){(0,X.default)(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Cm(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}const xA=3e3,UA=(0,Nt.isCryptoAvailable)();st.CRYPTO_ENABLED=UA;const $A=216e5,Pm=10*60*1e3;let jh;st.PendingEventOrdering=jh;(function(n){n.Chronological="chronological",n.Detached="detached"})(jh||(st.PendingEventOrdering=jh={}));let Vh;st.RoomVersionStability=Vh;(function(n){n.Stable="stable",n.Unstable="unstable"})(Vh||(st.RoomVersionStability=Vh={}));var Mm;(function(n){n.MasterKey="master_key",n.SelfSigningKey="self_signing_key",n.UserSigningKey="user_signing_key"})(Mm||(Mm={}));const ln="$";let cs;st.ClientEvent=cs;(function(n){n.Sync="sync",n.Event="event",n.ToDeviceEvent="toDeviceEvent",n.AccountData="accountData",n.Room="Room",n.DeleteRoom="deleteRoom",n.SyncUnexpectedError="sync.unexpectedError",n.ClientWellKnown="WellKnown.client",n.Group="Group",n.GroupProfile="Group.profile",n.GroupMyMembership="Group.myMembership"})(cs||(st.ClientEvent=cs={}));class fu extends AA.TypedEventEmitter{constructor(e){super();(0,X.default)(this,"reEmitter",new SA.TypedReEmitter(this)),(0,X.default)(this,"olmVersion",null),(0,X.default)(this,"usingExternalCrypto",!1),(0,X.default)(this,"store",void 0),(0,X.default)(this,"deviceId",void 0),(0,X.default)(this,"credentials",void 0),(0,X.default)(this,"pickleKey",void 0),(0,X.default)(this,"scheduler",void 0),(0,X.default)(this,"clientRunning",!1),(0,X.default)(this,"timelineSupport",!1),(0,X.default)(this,"urlPreviewCache",{}),(0,X.default)(this,"unstableClientRelationAggregation",!1),(0,X.default)(this,"identityServer",void 0),(0,X.default)(this,"sessionStore",void 0),(0,X.default)(this,"http",void 0),(0,X.default)(this,"crypto",void 0),(0,X.default)(this,"cryptoCallbacks",void 0),(0,X.default)(this,"callEventHandler",void 0),(0,X.default)(this,"supportsCallTransfer",!1),(0,X.default)(this,"forceTURN",!1),(0,X.default)(this,"iceCandidatePoolSize",0),(0,X.default)(this,"idBaseUrl",void 0),(0,X.default)(this,"baseUrl",void 0),(0,X.default)(this,"canSupportVoip",!1),(0,X.default)(this,"peekSync",null),(0,X.default)(this,"isGuestAccount",!1),(0,X.default)(this,"ongoingScrollbacks",{}),(0,X.default)(this,"notifTimelineSet",null),(0,X.default)(this,"cryptoStore",void 0),(0,X.default)(this,"verificationMethods",void 0),(0,X.default)(this,"fallbackICEServerAllowed",!1),(0,X.default)(this,"roomList",void 0),(0,X.default)(this,"syncApi",void 0),(0,X.default)(this,"pushRules",void 0),(0,X.default)(this,"syncLeftRoomsPromise",void 0),(0,X.default)(this,"syncedLeftRooms",!1),(0,X.default)(this,"clientOpts",void 0),(0,X.default)(this,"clientWellKnownIntervalID",void 0),(0,X.default)(this,"canResetTimelineCallback",void 0),(0,X.default)(this,"pushProcessor",new _d.PushProcessor(this)),(0,X.default)(this,"serverVersionsPromise",void 0),(0,X.default)(this,"cachedCapabilities",void 0),(0,X.default)(this,"clientWellKnown",void 0),(0,X.default)(this,"clientWellKnownPromise",void 0),(0,X.default)(this,"turnServers",[]),(0,X.default)(this,"turnServersExpiry",0),(0,X.default)(this,"checkTurnServersIntervalID",void 0),(0,X.default)(this,"exportedOlmDeviceToImport",void 0),(0,X.default)(this,"txnCtr",0),(0,X.default)(this,"mediaHandler",new MA.MediaHandler(this)),(0,X.default)(this,"pendingEventEncryption",new Map),(0,X.default)(this,"startCallEventHandler",()=>{this.isInitialSyncComplete()&&(this.callEventHandler.start(),this.off(cs.Sync,this.startCallEventHandler))}),e.baseUrl=N.ensureNoTrailingSlash(e.baseUrl),e.idBaseUrl=N.ensureNoTrailingSlash(e.idBaseUrl),this.baseUrl=e.baseUrl,this.idBaseUrl=e.idBaseUrl,this.usingExternalCrypto=e.usingExternalCrypto,this.store=e.store||new vA.StubStore,this.deviceId=e.deviceId||null;const t=e.userId||null;this.credentials={userId:t},this.http=new M.MatrixHttpApi(this,{baseUrl:e.baseUrl,idBaseUrl:e.idBaseUrl,accessToken:e.accessToken,request:e.request,prefix:M.PREFIX_R0,onlyData:!0,extraParams:e.queryParams,localTimeoutMs:e.localTimeoutMs,useAuthorizationHeader:e.useAuthorizationHeader}),e.deviceToImport?this.deviceId?oe.logger.warn("not importing device because device ID is provided to constructor independently of exported data"):this.credentials.userId?oe.logger.warn("not importing device because user ID is provided to constructor independently of exported data"):e.deviceToImport.deviceId?(this.deviceId=e.deviceToImport.deviceId,this.credentials.userId=e.deviceToImport.userId,this.exportedOlmDeviceToImport=e.deviceToImport.olmDevice):oe.logger.warn("not importing device because no device ID in exported data"):e.pickleKey&&(this.pickleKey=e.pickleKey),this.scheduler=e.scheduler,this.scheduler&&this.scheduler.setProcessFunction(async i=>{const s=this.getRoom(i.getRoomId());i.status!==nt.EventStatus.SENDING&&this.updatePendingEventStatus(s,i,nt.EventStatus.SENDING);const o=await this.sendEventHttpRequest(i);return s&&s.updatePendingEvent(i,nt.EventStatus.SENT,o.event_id),o}),(0,Im.createNewMatrixCall)(this,void 0,void 0)&&(this.callEventHandler=new _A.CallEventHandler(this),this.canSupportVoip=!0,this.on(cs.Sync,this.startCallEventHandler)),this.timelineSupport=Boolean(e.timelineSupport),this.unstableClientRelationAggregation=!!e.unstableClientRelationAggregation,this.cryptoStore=e.cryptoStore,this.sessionStore=e.sessionStore,this.verificationMethods=e.verificationMethods,this.cryptoCallbacks=e.cryptoCallbacks||{},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.roomList=new bA.RoomList(this.cryptoStore),this.on(nt.MatrixEventEvent.Decrypted,i=>{var s,o;const a=i.getPushActions(),l=this.getPushActionsForEvent(i,!0),u=this.getRoom(i.getRoomId());if(!u)return;const c=u.getUnreadNotificationCount(eo.NotificationCountType.Highlight),g=!!(a!=null&&(s=a.tweaks)!==null&&s!==void 0&&s.highlight),m=!!(l!=null&&(o=l.tweaks)!==null&&o!==void 0&&o.highlight);if((g!==m||c>0)&&!u.hasUserReadEvent(this.getUserId(),i.getId())){let f=c;m&&!g&&f++,!m&&g&&f--,u.setUnreadNotificationCount(eo.NotificationCountType.Highlight,f),u.getUnreadNotificationCount(eo.NotificationCountType.Total)<f&&u.setUnreadNotificationCount(eo.NotificationCountType.Total,f)}}),this.on(eo.RoomEvent.Receipt,(i,s)=>{if(s&&this.isRoomEncrypted(s.roomId)){const o=i.getContent();if(!(Object.keys(o).filter(g=>Object.keys(o[g]["m.read"]).includes(this.getUserId())).length>0))return;const l=20,u=s.getLiveTimeline().getEvents();let c=0;for(let g=u.length-1;g>=0;g--){if(g===u.length-l)return;const m=u[g];if(s.hasUserReadEvent(this.getUserId(),m.getId()))break;const f=this.getPushActionsForEvent(m);c+=f.tweaks&&f.tweaks.highlight?1:0}s.setUnreadNotificationCount(eo.NotificationCountType.Highlight,c)}})}async startClient(e){if(this.clientRunning)return;this.clientRunning=!0,typeof e=="number"&&(e={initialSyncLimit:e});const t=this.getUserId();t&&this.store.storeUser(new bd.User(t)),this.crypto&&(this.crypto.uploadDeviceKeys(),this.crypto.start()),this.canSupportVoip&&(this.checkTurnServersIntervalID=setInterval(()=>{this.checkTurnServers()},Pm),this.checkTurnServers()),this.syncApi&&(oe.logger.error("Still have sync object whilst not running: stopping old one"),this.syncApi.stop());try{const{serverSupport:r,stable:i}=await this.doesServerSupportThread();Vc.Thread.setServerSideSupport(r,i)}catch{Vc.Thread.setServerSideSupport(!1,!0)}this.clientOpts=Object.assign({},e),this.clientOpts.crypto=this.crypto,this.clientOpts.canResetEntireTimeline=r=>this.canResetTimelineCallback?this.canResetTimelineCallback(r):!1,this.syncApi=new Zs.SyncApi(this,this.clientOpts),this.syncApi.sync(),this.clientOpts.clientWellKnownPollPeriod!==void 0&&(this.clientWellKnownIntervalID=setInterval(()=>{this.fetchClientWellKnown()},1e3*this.clientOpts.clientWellKnownPollPeriod),this.fetchClientWellKnown())}stopClient(){var e,t,r,i;oe.logger.log("stopping MatrixClient"),this.clientRunning=!1,(e=this.syncApi)===null||e===void 0||e.stop(),this.syncApi=null,(t=this.crypto)===null||t===void 0||t.stop(),(r=this.peekSync)===null||r===void 0||r.stopPeeking(),(i=this.callEventHandler)===null||i===void 0||i.stop(),this.callEventHandler=null,V.clearInterval(this.checkTurnServersIntervalID),this.clientWellKnownIntervalID!==void 0&&V.clearInterval(this.clientWellKnownIntervalID)}async rehydrateDevice(){if(this.crypto)throw new Error("Cannot rehydrate device after crypto is initialized");if(!this.cryptoCallbacks.getDehydrationKey)return;const e=await this.getDehydratedDevice();if(!e)return;if(!e.device_data||!e.device_id){oe.logger.info("no dehydrated device found");return}const t=new V.Olm.Account;try{const r=e.device_data;if(r.algorithm!==IA.DEHYDRATION_ALGORITHM){oe.logger.warn("Wrong algorithm for dehydrated device");return}oe.logger.log("unpickling dehydrated device");const i=await this.cryptoCallbacks.getDehydrationKey(r,o=>{t.unpickle(new Uint8Array(o),r.account)});if(t.unpickle(i,r.account),oe.logger.log("unpickled device"),(await this.http.authedRequest(void 0,M.Method.Post,"/dehydrated_device/claim",void 0,{device_id:e.device_id},{prefix:"/_matrix/client/unstable/org.matrix.msc2697.v2"})).success===!0){this.deviceId=e.device_id,oe.logger.info("using dehydrated device");const o=this.pickleKey||"DEFAULT_KEY";return this.exportedOlmDeviceToImport={pickledAccount:t.pickle(o),sessions:[],pickleKey:o},t.free(),this.deviceId}else{t.free(),oe.logger.info("not using dehydrated device");return}}catch(r){t.free(),oe.logger.warn("could not unpickle",r)}}async getDehydratedDevice(){try{return await this.http.authedRequest(void 0,M.Method.Get,"/dehydrated_device",void 0,void 0,{prefix:"/_matrix/client/unstable/org.matrix.msc2697.v2"})}catch(e){oe.logger.info("could not get dehydrated device",e.toString());return}}async setDehydrationKey(e,t,r){if(!this.crypto){oe.logger.warn("not dehydrating device if crypto is not enabled");return}return await this.crypto.dehydrationManager.setKeyAndQueueDehydration(e,t,r)}async createDehydratedDevice(e,t,r){if(!this.crypto){oe.logger.warn("not dehydrating device if crypto is not enabled");return}return await this.crypto.dehydrationManager.setKey(e,t,r),await this.crypto.dehydrationManager.dehydrateDevice()}async exportDevice(){if(!this.crypto){oe.logger.warn("not exporting device if crypto is not enabled");return}return{userId:this.credentials.userId,deviceId:this.deviceId,olmDevice:await this.crypto.olmDevice.export()}}clearStores(){if(this.clientRunning)throw new Error("Cannot clear stores while client is running");const e=[];return e.push(this.store.deleteAllData()),this.cryptoStore&&e.push(this.cryptoStore.deleteAllData()),Promise.all(e).then()}getUserId(){return this.credentials&&this.credentials.userId?this.credentials.userId:null}getDomain(){return this.credentials&&this.credentials.userId?this.credentials.userId.replace(/^.*?:/,""):null}getUserIdLocalpart(){return this.credentials&&this.credentials.userId?this.credentials.userId.split(":")[0].substring(1):null}getDeviceId(){return this.deviceId}supportsVoip(){return this.canSupportVoip}getMediaHandler(){return this.mediaHandler}setForceTURN(e){this.forceTURN=e}setSupportsCallTransfer(e){this.supportsCallTransfer=e}createCall(e){return(0,Im.createNewMatrixCall)(this,e)}getSyncState(){return this.syncApi?this.syncApi.getSyncState():null}getSyncStateData(){return this.syncApi?this.syncApi.getSyncStateData():null}isInitialSyncComplete(){const e=this.getSyncState();return e?e===Zs.SyncState.Prepared||e===Zs.SyncState.Syncing:!1}isGuest(){return this.isGuestAccount}setGuest(e){this.isGuestAccount=e}getScheduler(){return this.scheduler}retryImmediately(){return this.syncApi.retryImmediately()}getNotifTimelineSet(){return this.notifTimelineSet}setNotifTimelineSet(e){this.notifTimelineSet=e}getCapabilities(e=!1){const t=new Date().getTime();return this.cachedCapabilities&&!e&&t<this.cachedCapabilities.expiration?(oe.logger.log("Returning cached capabilities"),Promise.resolve(this.cachedCapabilities.capabilities)):this.http.authedRequest(void 0,M.Method.Get,"/capabilities").catch(r=>{oe.logger.error(r)}).then((r={})=>{const i=r.capabilities||{},s=Object.keys(i).length?$A:6e4+Math.random()*5e3;return this.cachedCapabilities={capabilities:i,expiration:t+s},oe.logger.log("Caching capabilities: ",i),i})}async initCrypto(){if(!(0,Nt.isCryptoAvailable)())throw new Error("End-to-end encryption not supported in this js-sdk build: did you remember to load the olm library?");if(this.crypto){oe.logger.warn("Attempt to re-initialise e2e encryption on MatrixClient");return}if(!this.sessionStore)throw new Error("Cannot enable encryption: no sessionStore provided");if(!this.cryptoStore)throw new Error("Cannot enable encryption: no cryptoStore provided");oe.logger.log("Crypto: Starting up crypto store..."),await this.cryptoStore.startup(),oe.logger.log("Crypto: initialising roomlist..."),await this.roomList.init();const e=this.getUserId();if(e===null)throw new Error("Cannot enable encryption on MatrixClient with unknown userId: ensure userId is passed in createClient().");if(this.deviceId===null)throw new Error("Cannot enable encryption on MatrixClient with unknown deviceId: ensure deviceId is passed in createClient().");const t=new Nt.Crypto(this,this.sessionStore,e,this.deviceId,this.store,this.cryptoStore,this.roomList,this.verificationMethods);this.reEmitter.reEmit(t,[Nt.CryptoEvent.KeyBackupFailed,Nt.CryptoEvent.KeyBackupSessionsRemaining,Nt.CryptoEvent.RoomKeyRequest,Nt.CryptoEvent.RoomKeyRequestCancellation,Nt.CryptoEvent.Warning,Nt.CryptoEvent.DevicesUpdated,Nt.CryptoEvent.WillUpdateDevices,Nt.CryptoEvent.DeviceVerificationChanged,Nt.CryptoEvent.UserTrustStatusChanged,Nt.CryptoEvent.KeysChanged]),oe.logger.log("Crypto: initialising crypto object..."),await t.init({exportedOlmDevice:this.exportedOlmDeviceToImport,pickleKey:this.pickleKey}),delete this.exportedOlmDeviceToImport,this.olmVersion=Nt.Crypto.getOlmVersion(),t.registerEventHandlers(this),this.crypto=t}isCryptoEnabled(){return!!this.crypto}getDeviceEd25519Key(){return this.crypto?this.crypto.getDeviceEd25519Key():null}getDeviceCurve25519Key(){return this.crypto?this.crypto.getDeviceCurve25519Key():null}async uploadKeys(){if(!this.crypto)throw new Error("End-to-end encryption disabled");await this.crypto.uploadDeviceKeys()}downloadKeys(e,t){return this.crypto?this.crypto.downloadKeys(e,t):Promise.reject(new Error("End-to-end encryption disabled"))}getStoredDevicesForUser(e){if(!this.crypto)throw new Error("End-to-end encryption disabled");return this.crypto.getStoredDevicesForUser(e)||[]}getStoredDevice(e,t){if(!this.crypto)throw new Error("End-to-end encryption disabled");return this.crypto.getStoredDevice(e,t)||null}setDeviceVerified(e,t,r=!0){const i=this.setDeviceVerification(e,t,r,null,null);return e==this.credentials.userId&&this.checkKeyBackup(),i}setDeviceBlocked(e,t,r=!0){return this.setDeviceVerification(e,t,null,r,null)}setDeviceKnown(e,t,r=!0){return this.setDeviceVerification(e,t,null,null,r)}async setDeviceVerification(e,t,r,i,s){if(!this.crypto)throw new Error("End-to-end encryption disabled");await this.crypto.setDeviceVerification(e,t,r,i,s)}requestVerificationDM(e,t){if(!this.crypto)throw new Error("End-to-end encryption disabled");return this.crypto.requestVerificationDM(e,t)}findVerificationRequestDMInProgress(e){if(!this.crypto)throw new Error("End-to-end encryption disabled");return this.crypto.findVerificationRequestDMInProgress(e)}getVerificationRequestsToDeviceInProgress(e){if(!this.crypto)throw new Error("End-to-end encryption disabled");return this.crypto.getVerificationRequestsToDeviceInProgress(e)}requestVerification(e,t){if(!this.crypto)throw new Error("End-to-end encryption disabled");return this.crypto.requestVerification(e,t)}beginKeyVerification(e,t,r){if(!this.crypto)throw new Error("End-to-end encryption disabled");return this.crypto.beginKeyVerification(e,t,r)}checkSecretStorageKey(e,t){if(!this.crypto)throw new Error("End-to-end encryption disabled");return this.crypto.checkSecretStorageKey(e,t)}setGlobalBlacklistUnverifiedDevices(e){if(!this.crypto)throw new Error("End-to-end encryption disabled");return this.crypto.setGlobalBlacklistUnverifiedDevices(e)}getGlobalBlacklistUnverifiedDevices(){if(!this.crypto)throw new Error("End-to-end encryption disabled");return this.crypto.getGlobalBlacklistUnverifiedDevices()}setGlobalErrorOnUnknownDevices(e){if(!this.crypto)throw new Error("End-to-end encryption disabled");return this.crypto.setGlobalErrorOnUnknownDevices(e)}getGlobalErrorOnUnknownDevices(){if(!this.crypto)throw new Error("End-to-end encryption disabled");return this.crypto.getGlobalErrorOnUnknownDevices()}getCrossSigningId(e=TA.CrossSigningKey.Master){if(!this.crypto)throw new Error("End-to-end encryption disabled");return this.crypto.getCrossSigningId(e)}getStoredCrossSigningForUser(e){if(!this.crypto)throw new Error("End-to-end encryption disabled");return this.crypto.getStoredCrossSigningForUser(e)}checkUserTrust(e){if(!this.crypto)throw new Error("End-to-end encryption disabled");return this.crypto.checkUserTrust(e)}checkDeviceTrust(e,t){if(!this.crypto)throw new Error("End-to-end encryption disabled");return this.crypto.checkDeviceTrust(e,t)}checkOwnCrossSigningTrust(e){if(!this.crypto)throw new Error("End-to-end encryption disabled");return this.crypto.checkOwnCrossSigningTrust(e)}checkCrossSigningPrivateKey(e,t){if(!this.crypto)throw new Error("End-to-end encryption disabled");return this.crypto.checkCrossSigningPrivateKey(e,t)}legacyDeviceVerification(e,t,r){if(!this.crypto)throw new Error("End-to-end encryption disabled");return this.crypto.legacyDeviceVerification(e,t,r)}prepareToEncrypt(e){if(!this.crypto)throw new Error("End-to-end encryption disabled");return this.crypto.prepareToEncrypt(e)}isCrossSigningReady(){if(!this.crypto)throw new Error("End-to-end encryption disabled");return this.crypto.isCrossSigningReady()}bootstrapCrossSigning(e){if(!this.crypto)throw new Error("End-to-end encryption disabled");return this.crypto.bootstrapCrossSigning(e)}getCryptoTrustCrossSignedDevices(){if(!this.crypto)throw new Error("End-to-end encryption disabled");return this.crypto.getCryptoTrustCrossSignedDevices()}setCryptoTrustCrossSignedDevices(e){if(!this.crypto)throw new Error("End-to-end encryption disabled");return this.crypto.setCryptoTrustCrossSignedDevices(e)}countSessionsNeedingBackup(){if(!this.crypto)throw new Error("End-to-end encryption disabled");return this.crypto.countSessionsNeedingBackup()}getEventEncryptionInfo(e){if(!this.crypto)throw new Error("End-to-end encryption disabled");return this.crypto.getEventEncryptionInfo(e)}createRecoveryKeyFromPassphrase(e){if(!this.crypto)throw new Error("End-to-end encryption disabled");return this.crypto.createRecoveryKeyFromPassphrase(e)}isSecretStorageReady(){if(!this.crypto)throw new Error("End-to-end encryption disabled");return this.crypto.isSecretStorageReady()}bootstrapSecretStorage(e){if(!this.crypto)throw new Error("End-to-end encryption disabled");return this.crypto.bootstrapSecretStorage(e)}addSecretStorageKey(e,t,r){if(!this.crypto)throw new Error("End-to-end encryption disabled");return this.crypto.addSecretStorageKey(e,t,r)}hasSecretStorageKey(e){if(!this.crypto)throw new Error("End-to-end encryption disabled");return this.crypto.hasSecretStorageKey(e)}storeSecret(e,t,r){if(!this.crypto)throw new Error("End-to-end encryption disabled");return this.crypto.storeSecret(e,t,r)}getSecret(e){if(!this.crypto)throw new Error("End-to-end encryption disabled");return this.crypto.getSecret(e)}isSecretStored(e,t){if(!this.crypto)throw new Error("End-to-end encryption disabled");return this.crypto.isSecretStored(e,t)}requestSecret(e,t){if(!this.crypto)throw new Error("End-to-end encryption disabled");return this.crypto.requestSecret(e,t)}getDefaultSecretStorageKeyId(){if(!this.crypto)throw new Error("End-to-end encryption disabled");return this.crypto.getDefaultSecretStorageKeyId()}setDefaultSecretStorageKeyId(e){if(!this.crypto)throw new Error("End-to-end encryption disabled");return this.crypto.setDefaultSecretStorageKeyId(e)}checkSecretStoragePrivateKey(e,t){if(!this.crypto)throw new Error("End-to-end encryption disabled");return this.crypto.checkSecretStoragePrivateKey(e,t)}async getEventSenderDeviceInfo(e){return this.crypto?this.crypto.getEventSenderDeviceInfo(e):null}async isEventSenderVerified(e){const t=await this.getEventSenderDeviceInfo(e);return t?t.isVerified():!1}cancelAndResendEventRoomKeyRequest(e){return e.cancelAndResendKeyRequest(this.crypto,this.getUserId())}setRoomEncryption(e,t){if(!this.crypto)throw new Error("End-to-End encryption disabled");return this.crypto.setRoomEncryption(e,t)}isRoomEncrypted(e){const t=this.getRoom(e);return t?t.currentState.getStateEvents(ue.EventType.RoomEncryption,"")?!0:this.roomList.isRoomEncrypted(e):!1}forceDiscardSession(e){if(!this.crypto)throw new Error("End-to-End encryption disabled");this.crypto.forceDiscardSession(e)}exportRoomKeys(){return this.crypto?this.crypto.exportRoomKeys():Promise.reject(new Error("End-to-end encryption disabled"))}importRoomKeys(e,t){if(!this.crypto)throw new Error("End-to-end encryption disabled");return this.crypto.importRoomKeys(e,t)}checkKeyBackup(){return this.crypto.backupManager.checkKeyBackup()}async getKeyBackupVersion(){let e;try{e=await this.http.authedRequest(void 0,M.Method.Get,"/room_keys/version",void 0,void 0,{prefix:M.PREFIX_UNSTABLE})}catch(t){if(t.errcode==="M_NOT_FOUND")return null;throw t}try{km.BackupManager.checkBackupVersion(e)}catch(t){throw t}return e}isKeyBackupTrusted(e){return this.crypto.backupManager.isKeyBackupTrusted(e)}getKeyBackupEnabled(){if(!this.crypto)throw new Error("End-to-end encryption disabled");return this.crypto.backupManager.getKeyBackupEnabled()}enableKeyBackup(e){if(!this.crypto)throw new Error("End-to-end encryption disabled");return this.crypto.backupManager.enableKeyBackup(e)}disableKeyBackup(){if(!this.crypto)throw new Error("End-to-end encryption disabled");this.crypto.backupManager.disableKeyBackup()}async prepareKeyBackupVersion(e,t={secureSecretStorage:!1}){if(!this.crypto)throw new Error("End-to-end encryption disabled");const{algorithm:r,auth_data:i,recovery_key:s,privateKey:o}=await this.crypto.backupManager.prepareKeyBackupVersion(e);return t.secureSecretStorage&&(await this.storeSecret("m.megolm_backup.v1",(0,Ed.encodeBase64)(o)),oe.logger.info("Key backup private key stored in secret storage")),{algorithm:r,auth_data:i,recovery_key:s}}isKeyBackupKeyStored(){return Promise.resolve(this.isSecretStored("m.megolm_backup.v1",!1))}async createKeyBackupVersion(e){if(!this.crypto)throw new Error("End-to-end encryption disabled");await this.crypto.backupManager.createKeyBackupVersion(e);const t={algorithm:e.algorithm,auth_data:e.auth_data};await this.crypto.signObject(t.auth_data),this.cryptoCallbacks.getCrossSigningKey&&this.crypto.crossSigningInfo.getId()&&await this.crypto.crossSigningInfo.signObject(t.auth_data,"master");const r=await this.http.authedRequest(void 0,M.Method.Post,"/room_keys/version",void 0,t,{prefix:M.PREFIX_UNSTABLE});return await this.checkKeyBackup(),this.getKeyBackupEnabled()||oe.logger.error("Key backup not usable even though we just created it"),r}deleteKeyBackupVersion(e){if(!this.crypto)throw new Error("End-to-end encryption disabled");this.crypto.backupManager.version&&this.crypto.backupManager.disableKeyBackup();const t=N.encodeUri("/room_keys/version/$version",{$version:e});return this.http.authedRequest(void 0,M.Method.Delete,t,void 0,void 0,{prefix:M.PREFIX_UNSTABLE})}makeKeyBackupPath(e,t,r){let i;return t!==void 0?i=N.encodeUri("/room_keys/keys/$roomId/$sessionId",{$roomId:e,$sessionId:t}):e!==void 0?i=N.encodeUri("/room_keys/keys/$roomId",{$roomId:e}):i="/room_keys/keys",{path:i,queryData:r===void 0?void 0:{version:r}}}sendKeyBackup(e,t,r,i){if(!this.crypto)throw new Error("End-to-end encryption disabled");const s=this.makeKeyBackupPath(e,t,r);return this.http.authedRequest(void 0,M.Method.Put,s.path,s.queryData,i,{prefix:M.PREFIX_UNSTABLE})}async scheduleAllGroupSessionsForBackup(){if(!this.crypto)throw new Error("End-to-end encryption disabled");await this.crypto.backupManager.scheduleAllGroupSessionsForBackup()}flagAllGroupSessionsForBackup(){if(!this.crypto)throw new Error("End-to-end encryption disabled");return this.crypto.backupManager.flagAllGroupSessionsForBackup()}isValidRecoveryKey(e){try{return(0,Sd.decodeRecoveryKey)(e),!0}catch{return!1}}keyBackupKeyFromPassword(e,t){return(0,Om.keyFromAuthData)(t.auth_data,e)}keyBackupKeyFromRecoveryKey(e){return(0,Sd.decodeRecoveryKey)(e)}async restoreKeyBackupWithPassword(e,t,r,i,s){const o=await(0,Om.keyFromAuthData)(i.auth_data,e);return this.restoreKeyBackup(o,t,r,i,s)}async restoreKeyBackupWithSecretStorage(e,t,r,i){const s=await this.getSecret("m.megolm_backup.v1"),o=(0,Nt.fixBackupKey)(s);if(o){const[l]=await this.crypto.getSecretStorageKey();await this.storeSecret("m.megolm_backup.v1",o,[l])}const a=(0,Ed.decodeBase64)(o||s);return this.restoreKeyBackup(a,t,r,e,i)}restoreKeyBackupWithRecoveryKey(e,t,r,i,s){const o=(0,Sd.decodeRecoveryKey)(e);return this.restoreKeyBackup(o,t,r,i,s)}async restoreKeyBackupWithCache(e,t,r,i){const s=await this.crypto.getSessionBackupPrivateKey();if(!s)throw new Error("Couldn't get key");return this.restoreKeyBackup(s,e,t,r,i)}async restoreKeyBackup(e,t,r,i,s){const o=s==null?void 0:s.cacheCompleteCallback,a=s==null?void 0:s.progressCallback;if(!this.crypto)throw new Error("End-to-end encryption disabled");let l=0,u=[];const c=this.makeKeyBackupPath(t,r,i.version),g=await km.BackupManager.makeAlgorithm(i,async()=>e),m=g.untrusted;try{if(!await g.keyMatches(e))return Promise.reject(new M.MatrixError({errcode:fu.RESTORE_BACKUP_ERROR_BAD_KEY}));this.crypto.storeSessionBackupPrivateKey(e).catch(E=>{oe.logger.warn("Error caching session backup key:",E)}).then(o),a&&a({stage:"fetch"});const f=await this.http.authedRequest(void 0,M.Method.Get,c.path,c.queryData,void 0,{prefix:M.PREFIX_UNSTABLE});if(f.rooms){const E=f.rooms;for(const[I,w]of Object.entries(E)){if(!w.sessions)continue;l+=Object.keys(w.sessions).length;const k=await g.decryptSessions(w.sessions);for(const C of k)C.room_id=I,u.push(C)}}else if(f.sessions){const E=f.sessions;l=Object.keys(E).length,u=await g.decryptSessions(E);for(const I of u)I.room_id=t}else{l=1;try{const[E]=await g.decryptSessions({[r]:f});E.room_id=t,E.session_id=r,u.push(E)}catch(E){oe.logger.log("Failed to decrypt megolm session from backup",E)}}}finally{g.free()}return await this.importRoomKeys(u,{progressCallback:a,untrusted:m,source:"backup"}),await this.checkKeyBackup(),{total:l,imported:u.length}}deleteKeysFromBackup(e,t,r){if(!this.crypto)throw new Error("End-to-end encryption disabled");const i=this.makeKeyBackupPath(e,t,r);return this.http.authedRequest(void 0,M.Method.Delete,i.path,i.queryData,void 0,{prefix:M.PREFIX_UNSTABLE})}async sendSharedHistoryKeys(e,t){if(!this.crypto)throw new Error("End-to-end encryption disabled");const r=this.roomList.getRoomEncryption(e);if(!r){oe.logger.error("Unknown room. Not sharing decryption keys");return}const i=await this.crypto.downloadKeys(t),s={};for(const[a,l]of Object.entries(i))s[a]=Object.values(l);const o=this.crypto.getRoomDecryptor(e,r.algorithm);o.sendSharedHistoryInboundSessions?await o.sendSharedHistoryInboundSessions(s):oe.logger.warn("Algorithm does not support sharing previous keys",r.algorithm)}getGroup(e){return this.store.getGroup(e)}getGroups(){return this.store.getGroups()}getMediaConfig(e){return this.http.authedRequest(e,M.Method.Get,"/config",void 0,void 0,{prefix:M.PREFIX_MEDIA_R0})}getRoom(e){return this.store.getRoom(e)}getRooms(){return this.store.getRooms()}getVisibleRooms(){const e=this.store.getRooms(),t=new Set;for(const r of e){const i=r.currentState.getStateEvents(ue.EventType.RoomCreate,"");if(i){const s=i.getContent().predecessor;s&&s.room_id&&t.add(s.room_id)}}return e.filter(r=>!(r.currentState.getStateEvents(ue.EventType.RoomTombstone,"")&&t.has(r.roomId)))}getUser(e){return this.store.getUser(e)}getUsers(){return this.store.getUsers()}setAccountData(e,t,r){const i=N.encodeUri("/user/$userId/account_data/$type",{$userId:this.credentials.userId,$type:e}),s=(0,M.retryNetworkOperation)(5,()=>this.http.authedRequest(void 0,M.Method.Put,i,void 0,t));return r&&s.then(o=>r(null,o),r),s}getAccountData(e){return this.store.getAccountData(e)}async getAccountDataFromServer(e){if(this.isInitialSyncComplete()){const r=this.store.getAccountData(e);return r?r.getContent():null}const t=N.encodeUri("/user/$userId/account_data/$type",{$userId:this.credentials.userId,$type:e});try{return await this.http.authedRequest(void 0,M.Method.Get,t,void 0)}catch(r){if(r.data&&r.data.errcode==="M_NOT_FOUND")return null;throw r}}getIgnoredUsers(){const e=this.getAccountData("m.ignored_user_list");return!e||!e.getContent()||!e.getContent().ignored_users?[]:Object.keys(e.getContent().ignored_users)}setIgnoredUsers(e,t){const r={ignored_users:{}};return e.map(i=>r.ignored_users[i]={}),this.setAccountData("m.ignored_user_list",r,t)}isUserIgnored(e){return this.getIgnoredUsers().includes(e)}async joinRoom(e,t,r){if(N.isFunction(t))throw new Error("Expected 'opts' object, got function.");t=t||{},t.syncRoom===void 0&&(t.syncRoom=!0);const i=this.getRoom(e);if(i&&i.hasMembershipState(this.credentials.userId,"join"))return Promise.resolve(i);let s=Promise.resolve();t.inviteSignUrl&&(s=this.http.requestOtherUrl(void 0,M.Method.Post,t.inviteSignUrl,{mxid:this.credentials.userId}));const o={};t.viaServers&&(o.server_name=t.viaServers);const a={qsStringifyOptions:{arrayFormat:"repeat"}};try{const l={},u=await s;u&&(l.third_party_signed=u);const c=N.encodeUri("/join/$roomid",{$roomid:e}),m=(await this.http.authedRequest(void 0,M.Method.Post,c,o,l,a)).room_id,E=new Zs.SyncApi(this,this.clientOpts).createRoom(m);return t.syncRoom,r==null||r(null,E),E}catch(l){throw r==null||r(l),l}}resendEvent(e,t){return this.updatePendingEventStatus(t,e,nt.EventStatus.SENDING),this.encryptAndSendEvent(t,e)}cancelPendingEvent(e){if(![nt.EventStatus.QUEUED,nt.EventStatus.NOT_SENT,nt.EventStatus.ENCRYPTING].includes(e.status))throw new Error("cannot cancel an event with status "+e.status);e.status===nt.EventStatus.ENCRYPTING?this.pendingEventEncryption.delete(e.getId()):this.scheduler&&e.status===nt.EventStatus.QUEUED&&this.scheduler.removeEventFromQueue(e);const t=this.getRoom(e.getRoomId());this.updatePendingEventStatus(t,e,nt.EventStatus.CANCELLED)}setRoomName(e,t,r){return this.sendStateEvent(e,ue.EventType.RoomName,{name:t},void 0,r)}setRoomTopic(e,t,r){return this.sendStateEvent(e,ue.EventType.RoomTopic,{topic:t},void 0,r)}getRoomTags(e,t){const r=N.encodeUri("/user/$userId/rooms/$roomId/tags/",{$userId:this.credentials.userId,$roomId:e});return this.http.authedRequest(t,M.Method.Get,r,void 0)}setRoomTag(e,t,r,i){const s=N.encodeUri("/user/$userId/rooms/$roomId/tags/$tag",{$userId:this.credentials.userId,$roomId:e,$tag:t});return this.http.authedRequest(i,M.Method.Put,s,void 0,r)}deleteRoomTag(e,t,r){const i=N.encodeUri("/user/$userId/rooms/$roomId/tags/$tag",{$userId:this.credentials.userId,$roomId:e,$tag:t});return this.http.authedRequest(r,M.Method.Delete,i,void 0,void 0)}setRoomAccountData(e,t,r,i){const s=N.encodeUri("/user/$userId/rooms/$roomId/account_data/$type",{$userId:this.credentials.userId,$roomId:e,$type:t});return this.http.authedRequest(i,M.Method.Put,s,void 0,r)}setPowerLevel(e,t,r,i,s){let o={users:{}};(i==null?void 0:i.getType())===ue.EventType.RoomPowerLevels&&(o=N.deepCopy(i.getContent())),o.users[t]=r;const a=N.encodeUri("/rooms/$roomId/state/m.room.power_levels",{$roomId:e});return this.http.authedRequest(s,M.Method.Put,a,void 0,o)}async unstable_createLiveBeacon(e,t,r){const i=this.getUserId(),s=DA.M_BEACON_INFO_VARIABLE.name.replace("*",`${i}.${r}`);return this.unstable_setLiveBeacon(e,s,t)}async unstable_setLiveBeacon(e,t,r){const i=this.getUserId();return this.sendStateEvent(e,t,r,i)}sendEvent(e,t,r,i,s,o){var a,l;if(!((a=t)!==null&&a!==void 0&&a.startsWith(ln))&&t!==null&&(o=s,s=i,i=r,r=t,t=null),t&&!((l=i["m.relates_to"])!==null&&l!==void 0&&l.rel_type)){var u;i["m.relates_to"]=Gc(Gc({},i["m.relates_to"]),{},{rel_type:Vc.THREAD_RELATION_TYPE.name,event_id:t});const g=(u=this.getRoom(e))===null||u===void 0?void 0:u.threads.get(t);if(g){var c;i["m.relates_to"]["m.in_reply_to"]={event_id:(c=g.lastReply(m=>m.isRelation(Vc.THREAD_RELATION_TYPE.name)&&!m.status))===null||c===void 0?void 0:c.getId()}}}return this.sendCompleteEvent(e,t,{type:r,content:i},s,o)}sendCompleteEvent(e,t,r,i,s){N.isFunction(i)&&(s=i,i=void 0),i||(i=this.makeTxnId());const o=new nt.MatrixEvent(Object.assign(r,{event_id:"~"+e+":"+i,user_id:this.credentials.userId,sender:this.credentials.userId,room_id:e,origin_server_ts:new Date().getTime()})),a=this.getRoom(e),l=a==null?void 0:a.threads.get(t);l&&(o.setThread(l),o.setThreadId(l.id));const u=o.getAssociatedId();if(u!=null&&u.startsWith("~")){const g=a.getPendingEvents().find(m=>m.getId()===u);g.once(nt.MatrixEventEvent.LocalEventIdReplaced,()=>{o.updateAssociatedId(g.getId())})}const c=o.getType();return oe.logger.log(`sendEvent of type ${c} in ${e} with txnId ${i}`),o.setTxnId(i),o.setStatus(nt.EventStatus.SENDING),a&&a.addPendingEvent(o,i),o.status===nt.EventStatus.NOT_SENT?Promise.reject(new Error("Event blocked by other events not yet sent")):this.encryptAndSendEvent(a,o,s)}encryptAndSendEvent(e,t,r){let i=!1;return Promise.resolve().then(()=>{const s=this.encryptEventIfNeeded(t,e);return s?(this.pendingEventEncryption.set(t.getId(),s),this.updatePendingEventStatus(e,t,nt.EventStatus.ENCRYPTING),s.then(()=>{if(!this.pendingEventEncryption.has(t.getId())){i=!0;return}this.updatePendingEventStatus(e,t,nt.EventStatus.SENDING)})):null}).then(()=>{if(i)return{};let s;return this.scheduler&&(s=this.scheduler.queueEvent(t),s&&this.scheduler.getQueueForEvent(t).length>1&&this.updatePendingEventStatus(e,t,nt.EventStatus.QUEUED)),s||(s=this.sendEventHttpRequest(t),e&&(s=s.then(o=>(e.updatePendingEvent(t,nt.EventStatus.SENT,o.event_id),o)))),s}).then(s=>(r==null||r(null,s),s)).catch(s=>{oe.logger.error("Error sending event",s.stack||s);try{t.error=s,this.updatePendingEventStatus(e,t,nt.EventStatus.NOT_SENT),s.event=t,r==null||r(s)}catch(o){oe.logger.error("Exception in error handler!",o.stack||s)}throw s})}encryptEventIfNeeded(e,t){if(e.isEncrypted()||e.isRedaction()||!this.isRoomEncrypted(e.getRoomId())||!this.crypto&&this.usingExternalCrypto||e.getType()===ue.EventType.Reaction)return null;if(!this.crypto)throw new Error("This room is configured to use encryption, but your client does not support encryption.");return this.crypto.encryptEvent(e,t)}getEncryptedIfNeededEventType(e,t){return t===ue.EventType.Reaction?t:this.isRoomEncrypted(e)?ue.EventType.RoomMessageEncrypted:t}updatePendingEventStatus(e,t,r){e?e.updatePendingEvent(t,r):t.setStatus(r)}sendEventHttpRequest(e){let t=e.getTxnId();t||(t=this.makeTxnId(),e.setTxnId(t));const r={$roomId:e.getRoomId(),$eventType:e.getWireType(),$stateKey:e.getStateKey(),$txnId:t};let i;if(e.isState()){let s="/rooms/$roomId/state/$eventType";e.getStateKey()&&e.getStateKey().length>0&&(s="/rooms/$roomId/state/$eventType/$stateKey"),i=N.encodeUri(s,r)}else if(e.isRedaction()){const s="/rooms/$roomId/redact/$redactsEventId/$txnId";i=N.encodeUri(s,Object.assign({$redactsEventId:e.event.redacts},r))}else i=N.encodeUri("/rooms/$roomId/send/$eventType/$txnId",r);return this.http.authedRequest(void 0,M.Method.Put,i,void 0,e.getWireContent()).then(s=>(oe.logger.log(`Event sent to ${e.getRoomId()} with event id ${s.event_id}`),s))}redactEvent(e,t,r,i,s){var o;(o=r)!==null&&o!==void 0&&o.startsWith(ln)||(s=i,i=r,r=t,t=null);const l=(typeof s=="object"?s:{}).reason,u=typeof s=="function"?s:void 0;return this.sendCompleteEvent(e,t,{type:ue.EventType.RoomRedaction,content:{reason:l},redacts:r},i,u)}sendMessage(e,t,r,i,s){typeof t!="string"&&t!==null&&(s=i,i=r,r=t,t=null),N.isFunction(i)&&(s=i,i=void 0);let o=ue.EventType.RoomMessage,a=r;const l=(c={},g=!0)=>{let m=null;if(c.msgtype===ue.MsgType.Text?m=vd.MessageEvent.from(c.body,c.formatted_body).serialize():c.msgtype===ue.MsgType.Emote?m=vd.EmoteEvent.from(c.body,c.formatted_body).serialize():c.msgtype===ue.MsgType.Notice&&(m=vd.NoticeEvent.from(c.body,c.formatted_body).serialize()),m&&c["m.new_content"]&&g){const f=l(c["m.new_content"],!1);f&&(m.content["m.new_content"]=f.content)}if(m)for(const[f,E]of Object.entries(c))m.content.hasOwnProperty(f)||(m.content[f]=E);return m},u=l(a);return u&&(o=u.type,a=u.content),this.sendEvent(e,t,o,a,i,s)}sendTextMessage(e,t,r,i,s){var o;!((o=t)!==null&&o!==void 0&&o.startsWith(ln))&&t!==null&&(s=i,i=r,r=t,t=null);const a=to.makeTextMessage(r);return this.sendMessage(e,t,a,i,s)}sendNotice(e,t,r,i,s){var o;!((o=t)!==null&&o!==void 0&&o.startsWith(ln))&&t!==null&&(s=i,i=r,r=t,t=null);const a=to.makeNotice(r);return this.sendMessage(e,t,a,i,s)}sendEmoteMessage(e,t,r,i,s){var o;!((o=t)!==null&&o!==void 0&&o.startsWith(ln))&&t!==null&&(s=i,i=r,r=t,t=null);const a=to.makeEmoteMessage(r);return this.sendMessage(e,t,a,i,s)}sendImageMessage(e,t,r,i,s="Image",o){var a;!((a=t)!==null&&a!==void 0&&a.startsWith(ln))&&t!==null&&(o=s,s=i||"Image",i=r,r=t,t=null),N.isFunction(s)&&(o=s,s=void 0);const l={msgtype:ue.MsgType.Image,url:r,info:i,body:s};return this.sendMessage(e,t,l,void 0,o)}sendStickerMessage(e,t,r,i,s="Sticker",o){var a;!((a=t)!==null&&a!==void 0&&a.startsWith(ln))&&t!==null&&(o=s,s=i||"Sticker",i=r,r=t,t=null),N.isFunction(s)&&(o=s,s=void 0);const l={url:r,info:i,body:s};return this.sendEvent(e,t,ue.EventType.Sticker,l,void 0,o)}sendHtmlMessage(e,t,r,i,s){var o;!((o=t)!==null&&o!==void 0&&o.startsWith(ln))&&t!==null&&(s=i,i=r,r=t,t=null);const a=to.makeHtmlMessage(r,i);return this.sendMessage(e,t,a,void 0,s)}sendHtmlNotice(e,t,r,i,s){var o;!((o=t)!==null&&o!==void 0&&o.startsWith(ln))&&t!==null&&(s=i,i=r,r=t,t=null);const a=to.makeHtmlNotice(r,i);return this.sendMessage(e,t,a,void 0,s)}sendHtmlEmote(e,t,r,i,s){var o;!((o=t)!==null&&o!==void 0&&o.startsWith(ln))&&t!==null&&(s=i,i=r,r=t,t=null);const a=to.makeHtmlEmote(r,i);return this.sendMessage(e,t,a,void 0,s)}sendReceipt(e,t,r,i){if(typeof r=="function"&&(i=r,r={}),this.isGuest())return Promise.resolve({});const s=N.encodeUri("/rooms/$roomId/receipt/$receiptType/$eventId",{$roomId:e.getRoomId(),$receiptType:t,$eventId:e.getId()}),o=this.http.authedRequest(i,M.Method.Post,s,void 0,r||{}),a=this.getRoom(e.getRoomId());return a&&a.addLocalEchoReceipt(this.credentials.userId,e,t),o}async sendReadReceipt(e,t,r){typeof t=="function"&&(r=t,t={}),t||(t={});const i=e.getId(),s=this.getRoom(e.getRoomId());if(s&&s.hasPendingEvent(i))throw new Error(`Cannot set read receipt to a pending event (${i})`);const o={"org.matrix.msc2285.hidden":Boolean(t.hidden)};return this.sendReceipt(e,"m.read",o,r)}async setRoomReadMarkers(e,t,r,i){const s=this.getRoom(e);if(s&&s.hasPendingEvent(t))throw new Error(`Cannot set read marker to a pending event (${t})`);let o;if(r){if(o=r.getId(),s&&s.hasPendingEvent(o))throw new Error(`Cannot set read receipt to a pending event (${o})`);s&&s.addLocalEchoReceipt(this.credentials.userId,r,"m.read")}return this.setRoomReadMarkersHttpRequest(e,t,o,i)}getUrlPreview(e,t,r){t=Math.floor(t/6e4)*6e4;const i=new URL(e);i.hash="",e=i.toString();const s=t+"_"+e,o=this.urlPreviewCache[s];if(o)return r&&o.then(r).catch(r),o;const a=this.http.authedRequest(r,M.Method.Get,"/preview_url",{url:e,ts:t.toString()},void 0,{prefix:M.PREFIX_MEDIA_R0});return this.urlPreviewCache[s]=a,a}sendTyping(e,t,r,i){if(this.isGuest())return Promise.resolve({});const s=N.encodeUri("/rooms/$roomId/typing/$userId",{$roomId:e,$userId:this.credentials.userId}),o={typing:t};return t&&(o.timeout=r||2e4),this.http.authedRequest(i,M.Method.Put,s,void 0,o)}getRoomUpgradeHistory(e,t=!1){let r=this.getRoom(e);if(!r)return[];const i=[r];let s=r.currentState.getStateEvents(ue.EventType.RoomCreate,"");for(;s;){const a=s.getContent().predecessor;if(a&&a.room_id){const l=this.getRoom(a.room_id);if(!l)break;if(t){const u=l.currentState.getStateEvents(ue.EventType.RoomTombstone,"");if(!u||u.getContent().replacement_room!==l.roomId)break}i.splice(0,0,l),s=l.currentState.getStateEvents(ue.EventType.RoomCreate,"")}else break}let o=r.currentState.getStateEvents(ue.EventType.RoomTombstone,"");for(;o;){const a=this.getRoom(o.getContent().replacement_room);if(!a||a.roomId===r.roomId||t&&(s=a.currentState.getStateEvents(ue.EventType.RoomCreate,""),!s||!s.getContent().predecessor||s.getContent().predecessor.room_id!==r.roomId))break;if(i.push(a),new Set(i.map(u=>u.roomId)).size<i.length)return i.slice(0,i.length-1);r=a,o=r.currentState.getStateEvents(ue.EventType.RoomTombstone,"")}return i}invite(e,t,r,i){return this.membershipChange(e,t,"invite",i,r)}inviteByEmail(e,t,r){return this.inviteByThreePid(e,"email",t,r)}async inviteByThreePid(e,t,r,i){const s=N.encodeUri("/rooms/$roomId/invite",{$roomId:e}),o=this.getIdentityServerUrl(!0);if(!o)return Promise.reject(new M.MatrixError({error:"No supplied identity server URL",errcode:"ORG.MATRIX.JSSDK_MISSING_PARAM"}));const a={id_server:o,medium:t,address:r};if(this.identityServer&&this.identityServer.getAccessToken&&await this.doesServerAcceptIdentityAccessToken()){const l=await this.identityServer.getAccessToken();l&&(a.id_access_token=l)}return this.http.authedRequest(i,M.Method.Post,s,void 0,a)}leave(e,t){return this.membershipChange(e,void 0,"leave",void 0,t)}leaveRoomChain(e,t=!0){const r=this.getRoomUpgradeHistory(e);let i=r;if(!t){i=[];for(const l of r)if(i.push(l),l.roomId===e)break}const s={},o=[],a=l=>this.leave(l).then(()=>{s[l]=null}).catch(u=>(s[l]=u,null));for(const l of i)o.push(a(l.roomId));return Promise.all(o).then(()=>s)}ban(e,t,r,i){return this.membershipChange(e,t,"ban",r,i)}forget(e,t,r){t===void 0&&(t=!0);const i=this.membershipChange(e,void 0,"forget",void 0,r);return t?i.then(s=>(this.store.removeRoom(e),this.emit(cs.DeleteRoom,e),s)):i}unban(e,t,r){const i=N.encodeUri("/rooms/$roomId/unban",{$roomId:e}),s={user_id:t};return this.http.authedRequest(r,M.Method.Post,i,void 0,s)}kick(e,t,r,i){const s=N.encodeUri("/rooms/$roomId/kick",{$roomId:e}),o={user_id:t,reason:r};return this.http.authedRequest(i,M.Method.Post,s,void 0,o)}membershipChange(e,t,r,i,s){N.isFunction(i)&&(s=i,i=void 0);const o=N.encodeUri("/rooms/$room_id/$membership",{$room_id:e,$membership:r});return this.http.authedRequest(s,M.Method.Post,o,void 0,{user_id:t,reason:i})}getPushActionsForEvent(e,t=!1){return(!e.getPushActions()||t)&&e.setPushActions(this.pushProcessor.actionsForEvent(e)),e.getPushActions()}setProfileInfo(e,t,r){const i=N.encodeUri("/profile/$userId/$info",{$userId:this.credentials.userId,$info:e});return this.http.authedRequest(r,M.Method.Put,i,void 0,t)}async setDisplayName(e,t){const r=await this.setProfileInfo("displayname",{displayname:e},t),i=this.getUser(this.getUserId());return i&&(i.displayName=e,i.emit(bd.UserEvent.DisplayName,i.events.presence,i)),r}async setAvatarUrl(e,t){const r=await this.setProfileInfo("avatar_url",{avatar_url:e},t),i=this.getUser(this.getUserId());return i&&(i.avatarUrl=e,i.emit(bd.UserEvent.AvatarUrl,i.events.presence,i)),r}mxcUrlToHttp(e,t,r,i,s){return(0,wA.getHttpUriForMxc)(this.baseUrl,e,t,r,i,s)}_unstable_setStatusMessage(e){const t="im.vector.user_status";return Promise.all(this.getRooms().map(async r=>{const i=r.getMyMembership()==="join",s=r.getInvitedAndJoinedMemberCount()===2;!i||!s||!r.currentState.mayClientSendStateEvent(t,this)||await this.sendStateEvent(r.roomId,t,{status:e},this.getUserId())})).then()}setPresence(e,t){const r=N.encodeUri("/presence/$userId/status",{$userId:this.credentials.userId});if(typeof e=="string"&&(e={presence:e}),["offline","online","unavailable"].indexOf(e.presence)===-1)throw new Error("Bad presence value: "+e.presence);return this.http.authedRequest(t,M.Method.Put,r,void 0,e)}getPresence(e,t){const r=N.encodeUri("/presence/$userId/status",{$userId:e});return this.http.authedRequest(t,M.Method.Get,r,void 0,void 0)}scrollback(e,t=30,r){N.isFunction(t)&&(r=t,t=void 0);let i=0,s=this.ongoingScrollbacks[e.roomId]||{};if(s.promise)return s.promise;if(s.errorTs){const l=Date.now()-s.errorTs;i=Math.max(xA-l,0)}if(e.oldState.paginationToken===null)return Promise.resolve(e);const o=this.store.scrollback(e,t).length;if(o===t)return Promise.resolve(e);t=t-o;const a=new Promise((l,u)=>{(0,N.sleep)(i).then(()=>this.createMessagesRequest(e.roomId,e.oldState.paginationToken,t,ga.Direction.Backward)).then(async c=>{var g;const m=c.chunk.map(this.getEventMapper());if(c.state){const I=c.state.map(this.getEventMapper());e.currentState.setUnknownStateEvents(I)}const[f,E]=this.partitionThreadedEvents(m);e.addEventsToTimeline(f,!0,e.getLiveTimeline()),await this.processThreadEvents(e,E,!0),e.oldState.paginationToken=c.end,c.chunk.length===0&&(e.oldState.paginationToken=null),this.store.storeEvents(e,m,c.end,!0),this.ongoingScrollbacks[e.roomId]=null,(g=r)===null||g===void 0||g(null,e),l(e)}).catch(c=>{var g;this.ongoingScrollbacks[e.roomId]={errorTs:Date.now()},(g=r)===null||g===void 0||g(c),u(c)})});return s={promise:a,errorTs:null},this.ongoingScrollbacks[e.roomId]=s,a}getEventMapper(e){return(0,kA.eventMapperFor)(this,e||{})}getEventTimeline(e,t){if(!this.timelineSupport)throw new Error("timeline support is disabled. Set the 'timelineSupport' parameter to true when creating MatrixClient to enable it.");if(e.getTimelineForEvent(t))return Promise.resolve(e.getTimelineForEvent(t));const r=N.encodeUri("/rooms/$roomId/context/$eventId",{$roomId:e.room.roomId,$eventId:t});let i;return this.clientOpts.lazyLoadMembers&&(i={filter:JSON.stringify(qc.Filter.LAZY_LOADING_MESSAGES_FILTER)}),this.http.authedRequest(void 0,M.Method.Get,r,i).then(async o=>{if(!o.event)throw new Error("'event' not in '/context' result - homeserver too old?");if(e.getTimelineForEvent(t))return e.getTimelineForEvent(t);o.events_after.reverse();const l=o.events_after.concat([o.event]).concat(o.events_before).map(this.getEventMapper());let u=e.getTimelineForEvent(l[0].getId());if(!u)u=e.addTimeline(),u.initialiseState(o.state.map(this.getEventMapper())),u.getState(ga.EventTimeline.FORWARDS).paginationToken=o.end;else{const m=o.state.map(this.getEventMapper());u.getState(ga.EventTimeline.BACKWARDS).setUnknownStateEvents(m)}const[c,g]=this.partitionThreadedEvents(l);return e.addEventsToTimeline(c,!0,u,o.start),await this.processThreadEvents(e.room,g,!0),e.getTimelineForEvent(t)||u})}createMessagesRequest(e,t,r=30,i,s){const o=N.encodeUri("/rooms/$roomId/messages",{$roomId:e}),a={limit:r.toString(),dir:i};t&&(a.from=t);let l=null;if(this.clientOpts.lazyLoadMembers&&(l=Object.assign({},qc.Filter.LAZY_LOADING_MESSAGES_FILTER)),s){var u;l=l||{},Object.assign(l,(u=s.getRoomTimelineFilterComponent())===null||u===void 0?void 0:u.toJSON())}return l&&(a.filter=JSON.stringify(l)),this.http.authedRequest(void 0,M.Method.Get,o,a)}paginateEventTimeline(e,t){const r=e.getTimelineSet()===this.notifTimelineSet;t=t||{};const i=t.backwards||!1;if(r&&!i)throw new Error("paginateNotifTimeline can only paginate backwards");const s=i?ga.EventTimeline.BACKWARDS:ga.EventTimeline.FORWARDS,o=e.getPaginationToken(s),a=e.paginationRequests[s];if(a)return a;let l,u,c;if(r){var g;l="/notifications",u={limit:((g=t.limit)!==null&&g!==void 0?g:30).toString(),only:"highlight"},o!=="end"&&(u.from=o),c=this.http.authedRequest(void 0,M.Method.Get,l,u,void 0).then(async m=>{const f=m.next_token,E=[];for(let C=0;C<m.notifications.length;C++){const S=m.notifications[C],T=this.getEventMapper()(S.event);T.setPushActions(_d.PushProcessor.actionListToActionsObject(S.actions)),T.event.room_id=S.room_id,E[C]=T}const[I,w]=this.partitionThreadedEvents(E),k=e.getTimelineSet();return k.addEventsToTimeline(I,i,e,f),await this.processThreadEvents(k.room,w,i),i&&!m.next_token&&e.setPaginationToken(null,s),!!m.next_token}).finally(()=>{e.paginationRequests[s]=null}),e.paginationRequests[s]=c}else{const m=this.getRoom(e.getRoomId());if(!m)throw new Error("Unknown room "+e.getRoomId());c=this.createMessagesRequest(e.getRoomId(),o,t.limit,s,e.getFilter()).then(async f=>{if(f.state){const C=e.getState(s),S=f.state.map(this.getEventMapper());C.setUnknownStateEvents(S)}const E=f.end,I=f.chunk.map(this.getEventMapper()),[w,k]=this.partitionThreadedEvents(I);return e.getTimelineSet().addEventsToTimeline(w,i,e,E),await this.processThreadEvents(m,k,i),i&&f.end==f.start&&e.setPaginationToken(null,s),f.end!=f.start}).finally(()=>{e.paginationRequests[s]=null}),e.paginationRequests[s]=c}return c}resetNotifTimelineSet(){!this.notifTimelineSet||this.notifTimelineSet.resetLiveTimeline("end",null)}peekInRoom(e){return this.peekSync&&this.peekSync.stopPeeking(),this.peekSync=new Zs.SyncApi(this,this.clientOpts),this.peekSync.peek(e)}stopPeeking(){this.peekSync&&(this.peekSync.stopPeeking(),this.peekSync=null)}setGuestAccess(e,t){const r=this.sendStateEvent(e,ue.EventType.RoomGuestAccess,{guest_access:t.allowJoin?"can_join":"forbidden"},"");let i=Promise.resolve(void 0);return t.allowRead&&(i=this.sendStateEvent(e,ue.EventType.RoomHistoryVisibility,{history_visibility:"world_readable"},"")),Promise.all([i,r]).then()}requestRegisterEmailToken(e,t,r,i){return this.requestTokenFromEndpoint("/register/email/requestToken",{email:e,client_secret:t,send_attempt:r,next_link:i})}requestRegisterMsisdnToken(e,t,r,i,s){return this.requestTokenFromEndpoint("/register/msisdn/requestToken",{country:e,phone_number:t,client_secret:r,send_attempt:i,next_link:s})}requestAdd3pidEmailToken(e,t,r,i){return this.requestTokenFromEndpoint("/account/3pid/email/requestToken",{email:e,client_secret:t,send_attempt:r,next_link:i})}requestAdd3pidMsisdnToken(e,t,r,i,s){return this.requestTokenFromEndpoint("/account/3pid/msisdn/requestToken",{country:e,phone_number:t,client_secret:r,send_attempt:i,next_link:s})}requestPasswordEmailToken(e,t,r,i){return this.requestTokenFromEndpoint("/account/password/email/requestToken",{email:e,client_secret:t,send_attempt:r,next_link:i})}requestPasswordMsisdnToken(e,t,r,i,s){return this.requestTokenFromEndpoint("/account/password/msisdn/requestToken",{country:e,phone_number:t,client_secret:r,send_attempt:i,next_link:s})}async requestTokenFromEndpoint(e,t){const r=Object.assign({},t);if(!await this.doesServerSupportSeparateAddAndBind()&&this.idBaseUrl){const i=new URL(this.idBaseUrl);if(r.id_server=i.host,this.identityServer&&this.identityServer.getAccessToken&&await this.doesServerAcceptIdentityAccessToken()){const s=await this.identityServer.getAccessToken();s&&(r.id_access_token=s)}}return this.http.request(void 0,M.Method.Post,e,void 0,r)}getRoomPushRule(e,t){if(this.pushRules)for(let r=0;r<this.pushRules[e].room.length;r++){const i=this.pushRules[e].room[r];if(i.rule_id===t)return i}else throw new Error("SyncApi.sync() must be done before accessing to push rules.")}setRoomMutePushRule(e,t,r){let i,s;const o=this.getRoomPushRule(e,t);if(o&&0<=o.actions.indexOf("dont_notify")&&(s=!0),!r)s&&(i=this.deletePushRule(e,jc.PushRuleKind.RoomSpecific,o.rule_id));else if(!o)i=this.addPushRule(e,jc.PushRuleKind.RoomSpecific,t,{actions:["dont_notify"]});else if(!s){const a=N.defer();this.deletePushRule(e,jc.PushRuleKind.RoomSpecific,o.rule_id).then(()=>{this.addPushRule(e,jc.PushRuleKind.RoomSpecific,t,{actions:["dont_notify"]}).then(()=>{a.resolve()}).catch(l=>{a.reject(l)})}).catch(l=>{a.reject(l)}),i=a.promise}if(i)return new Promise((a,l)=>{i.then(()=>{this.getPushRules().then(u=>{this.pushRules=u,a()}).catch(u=>{l(u)})}).catch(u=>{this.getPushRules().then(c=>{this.pushRules=c,l(u)}).catch(c=>{l(u)})})})}searchMessageText(e,t){const r={search_term:e.query};return"keys"in e&&(r.keys=e.keys),this.search({body:{search_categories:{room_events:r}}},t)}searchRoomEvents(e){const t={search_categories:{room_events:{search_term:e.term,filter:e.filter,order_by:PA.SearchOrderBy.Recent,event_context:{before_limit:1,after_limit:1,include_profile:!0}}}},r={_query:t,results:[],highlights:[]};return this.search({body:t}).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;const t={body:e._query,next_batch:e.next_batch},r=this.search(t).then(i=>this.processRoomEventsSearch(e,i)).finally(()=>{e.pendingRequest=null});return e.pendingRequest=r,r}processRoomEventsSearch(e,t){const r=t.search_categories.room_events;e.count=r.count,e.next_batch=r.next_batch;const i=new Set(r.highlights);e.highlights.forEach(o=>{i.add(o)}),e.highlights=Array.from(i);const s=r.results?r.results.length:0;for(let o=0;o<s;o++){const a=RA.SearchResult.fromJson(r.results[o],this.getEventMapper()),l=this.getRoom(a.context.getEvent().getRoomId());if(l)for(const u of a.context.getTimeline()){const c=l.getMember(u.getSender());!u.sender&&c&&(u.sender=c)}e.results.push(a)}return e}syncLeftRooms(){if(this.syncedLeftRooms)return Promise.resolve([]);if(this.syncLeftRoomsPromise)return this.syncLeftRoomsPromise;const e=new Zs.SyncApi(this,this.clientOpts);return this.syncLeftRoomsPromise=e.syncLeftRooms(),this.syncLeftRoomsPromise.then(t=>{oe.logger.log("Marking success of sync left room request"),this.syncedLeftRooms=!0}).finally(()=>{this.syncLeftRoomsPromise=null}),this.syncLeftRoomsPromise}createFilter(e){const t=N.encodeUri("/user/$userId/filter",{$userId:this.credentials.userId});return this.http.authedRequest(void 0,M.Method.Post,t,void 0,e).then(r=>{const i=qc.Filter.fromJson(this.credentials.userId,r.filter_id,e);return this.store.storeFilter(i),i})}getFilter(e,t,r){if(r){const s=this.store.getFilter(e,t);if(s)return Promise.resolve(s)}const i=N.encodeUri("/user/$userId/filter/$filterId",{$userId:e,$filterId:t});return this.http.authedRequest(void 0,M.Method.Get,i,void 0,void 0).then(s=>{const o=qc.Filter.fromJson(e,t,s);return this.store.storeFilter(o),o})}async getOrCreateFilter(e,t){const r=this.store.getFilterIdByName(e);let i;if(r){try{const o=await this.getFilter(this.credentials.userId,r,!0);if(o){const a=o.getDefinition(),l=t.getDefinition();N.deepCompare(a,l)&&(i=r)}}catch(o){if(o.errcode!=="M_UNKNOWN"&&o.errcode!=="M_NOT_FOUND")throw o}i||this.store.setFilterIdByName(e,void 0)}if(i)return i;const s=await this.createFilter(t.getDefinition());return this.store.setFilterIdByName(e,s.filterId),s.filterId}getOpenIdToken(){const e=N.encodeUri("/user/$userId/openid/request_token",{$userId:this.credentials.userId});return this.http.authedRequest(void 0,M.Method.Post,e,void 0,{})}turnServer(e){return this.http.authedRequest(e,M.Method.Get,"/voip/turnServer")}getTurnServers(){return this.turnServers||[]}getTurnServersExpiry(){return this.turnServersExpiry}async checkTurnServers(){if(!this.canSupportVoip)return;let e=!1;const t=this.turnServersExpiry-Date.now();if(t>Pm)oe.logger.debug("TURN creds are valid for another "+t+" ms: not fetching new ones."),e=!0;else{oe.logger.debug("Fetching new TURN credentials");try{const r=await this.turnServer();if(r.uris){oe.logger.log("Got TURN URIs: "+r.uris+" refresh in "+r.ttl+" secs");const i={urls:r.uris,username:r.username,credential:r.password};this.turnServers=[i],this.turnServersExpiry=Date.now()+r.ttl*1e3,e=!0}}catch(r){oe.logger.error("Failed to get TURN URIs",r),r.httpStatus===403&&(oe.logger.info("TURN access unavailable for this account: stopping credentials checks"),this.checkTurnServersIntervalID!==null&&V.clearInterval(this.checkTurnServersIntervalID),this.checkTurnServersIntervalID=null)}}return e}setFallbackICEServerAllowed(e){this.fallbackICEServerAllowed=e}isFallbackICEServerAllowed(){return this.fallbackICEServerAllowed}isSynapseAdministrator(){const e=N.encodeUri("/_synapse/admin/v1/users/$userId/admin",{$userId:this.getUserId()});return this.http.authedRequest(void 0,M.Method.Get,e,void 0,void 0,{prefix:""}).then(t=>t.admin)}whoisSynapseUser(e){const t=N.encodeUri("/_synapse/admin/v1/whois/$userId",{$userId:e});return this.http.authedRequest(void 0,M.Method.Get,t,void 0,void 0,{prefix:""})}deactivateSynapseUser(e){const t=N.encodeUri("/_synapse/admin/v1/deactivate/$userId",{$userId:e});return this.http.authedRequest(void 0,M.Method.Post,t,void 0,void 0,{prefix:""})}async fetchClientWellKnown(){this.clientWellKnownPromise=EA.AutoDiscovery.getRawClientConfig(this.getDomain()),this.clientWellKnown=await this.clientWellKnownPromise,this.emit(cs.ClientWellKnown,this.clientWellKnown)}getClientWellKnown(){return this.clientWellKnown}waitForClientWellKnown(){return this.clientWellKnownPromise}storeClientOptions(){const e=["boolean","string","number"],t=Object.entries(this.clientOpts).filter(([r,i])=>e.includes(typeof i)).reduce((r,[i,s])=>(r[i]=s,r),{});return this.store.storeClientOptions(t)}async _unstable_getSharedRooms(e){if(!await this.doesServerSupportUnstableFeature("uk.half-shot.msc2666"))throw Error("Server does not support shared_rooms API");const t=N.encodeUri("/uk.half-shot.msc2666/user/shared_rooms/$userId",{$userId:e});return(await this.http.authedRequest(void 0,M.Method.Get,t,void 0,void 0,{prefix:M.PREFIX_UNSTABLE})).joined}getVersions(){return this.serverVersionsPromise?this.serverVersionsPromise:(this.serverVersionsPromise=this.http.request(void 0,M.Method.Get,"/_matrix/client/versions",void 0,void 0,{prefix:""}).catch(e=>{throw this.serverVersionsPromise=null,e}),this.serverVersionsPromise)}async isVersionSupported(e){const{versions:t}=await this.getVersions();return t&&t.includes(e)}async doesServerSupportLazyLoading(){const e=await this.getVersions();if(!e)return!1;const t=e.versions,r=e.unstable_features;return t&&t.includes("r0.5.0")||r&&r["m.lazy_load_members"]}async doesServerRequireIdServerParam(){const e=await this.getVersions();if(!e)return!0;const t=e.versions;if(t&&t.includes("r0.6.0"))return!1;const r=e.unstable_features;return!r||r["m.require_identity_server"]===void 0?!0:r["m.require_identity_server"]}async doesServerAcceptIdentityAccessToken(){const e=await this.getVersions();if(!e)return!1;const t=e.versions,r=e.unstable_features;return t&&t.includes("r0.6.0")||r&&r["m.id_access_token"]}async doesServerSupportSeparateAddAndBind(){const e=await this.getVersions();if(!e)return!1;const t=e.versions,r=e.unstable_features;return t&&t.includes("r0.6.0")||r&&r["m.separate_add_and_bind"]}async doesServerSupportUnstableFeature(e){const t=await this.getVersions();if(!t)return!1;const r=t.unstable_features;return r&&!!r[e]}async doesServerForceEncryptionForPreset(e){const t=await this.getVersions();if(!t)return!1;const r=t.unstable_features,i=e.includes("_chat")?e.substring(0,e.indexOf("_chat")):e;return r&&!!r[`io.element.e2ee_forced.${i}`]}async doesServerSupportThread(){try{const e=await this.doesServerSupportUnstableFeature("org.matrix.msc3440"),t=await this.doesServerSupportUnstableFeature("org.matrix.msc3440.stable")||await this.isVersionSupported("v1.3");return{serverSupport:e||t,stable:t}}catch{return null}}hasLazyLoadMembersEnabled(){return!!this.clientOpts.lazyLoadMembers}setCanResetTimelineCallback(e){this.canResetTimelineCallback=e}getCanResetTimelineCallback(){return this.canResetTimelineCallback}async relations(e,t,r,i,s={}){const o=this.getEncryptedIfNeededEventType(e,i),a=await this.fetchRelations(e,t,r,o,s),l=this.getEventMapper();let u;a.original_event&&(u=l(a.original_event));let c=a.chunk.map(l);if(o===ue.EventType.RoomMessageEncrypted){const g=u?c.concat(u):c;await Promise.all(g.map(m=>this.decryptEventIfNeeded(m))),i!==null&&(c=c.filter(m=>m.getType()===i))}return u&&r===ue.RelationType.Replace&&(c=c.filter(g=>g.getSender()===u.getSender())),{originalEvent:u,events:c,nextBatch:a.next_batch,prevBatch:a.prev_batch}}getCrossSigningCacheCallbacks(){var e;return(e=this.crypto)===null||e===void 0?void 0:e.crossSigningInfo.getCacheCallbacks()}generateClientSecret(){return(0,CA.randomString)(32)}decryptEventIfNeeded(e,t){return e.shouldAttemptDecryption()&&e.attemptDecryption(this.crypto,t),e.isBeingDecrypted()?e.getDecryptionPromise():Promise.resolve()}termsUrlForService(e,t){switch(e){case Tm.SERVICE_TYPES.IS:return t+M.PREFIX_IDENTITY_V2+"/terms";case Tm.SERVICE_TYPES.IM:return t+"/_matrix/integrations/v1/terms";default:throw new Error("Unsupported service type")}}getHomeserverUrl(){return this.baseUrl}getIdentityServerUrl(e=!1){return e&&(this.idBaseUrl.startsWith("http://")||this.idBaseUrl.startsWith("https://"))?this.idBaseUrl.split("://")[1]:this.idBaseUrl}setIdentityServerUrl(e){this.idBaseUrl=N.ensureNoTrailingSlash(e),this.http.setIdBaseUrl(this.idBaseUrl)}getAccessToken(){return this.http.opts.accessToken||null}setAccessToken(e){this.http.opts.accessToken=e}isLoggedIn(){return this.http.opts.accessToken!==void 0}makeTxnId(){return"m"+new Date().getTime()+"."+this.txnCtr++}isUsernameAvailable(e){return this.http.authedRequest(void 0,M.Method.Get,"/register/available",{username:e}).then(t=>t.available).catch(t=>t.errcode==="M_USER_IN_USE"?!1:Promise.reject(t))}register(e,t,r,i,s,o,a,l){s===!0?s={email:!0}:(s==null||s===!1)&&(s={}),typeof a=="function"&&(l=a,a=void 0),r&&(i.session=r);const u={auth:i,refresh_token:!0};return e!=null&&(u.username=e),t!=null&&(u.password=t),s.email&&(u.bind_email=!0),s.msisdn&&(u.bind_msisdn=!0),o!=null&&(u.guest_access_token=o),a!=null&&(u.inhibit_login=a),t!=null&&(u.x_show_msisdn=!0),this.registerRequest(u,void 0,l)}registerGuest(e,t){return e=e||{},e.body=e.body||{},this.registerRequest(e.body,"guest",t)}registerRequest(e,t,r){const i={};return t&&(i.kind=t),this.http.request(r,M.Method.Post,"/register",i,e)}refreshToken(e){return this.http.authedRequest(void 0,M.Method.Post,"/refresh",void 0,{refresh_token:e},{prefix:M.PREFIX_V1,inhibitLogoutEmit:!0})}loginFlows(e){return this.http.request(e,M.Method.Get,"/login")}login(e,t,r){const i={type:e};return Object.assign(i,t),this.http.authedRequest((s,o)=>{o&&o.access_token&&o.user_id&&(this.http.opts.accessToken=o.access_token,this.credentials={userId:o.user_id}),r&&r(s,o)},M.Method.Post,"/login",void 0,i)}loginWithPassword(e,t,r){return this.login("m.login.password",{user:e,password:t},r)}loginWithSAML2(e,t){return this.login("m.login.saml2",{relay_state:e},t)}getCasLoginUrl(e){return this.getSsoLoginUrl(e,"cas")}getSsoLoginUrl(e,t="sso",r){let i="/login/"+t+"/redirect";return r&&(i+="/"+r),this.http.getUrl(i,{redirectUrl:e},M.PREFIX_R0)}loginWithToken(e,t){return this.login("m.login.token",{token:e},t)}async logout(e){var t,r;if((t=this.crypto)!==null&&t!==void 0&&(r=t.backupManager)!==null&&r!==void 0&&r.getKeyBackupEnabled())try{for(;await this.crypto.backupManager.backupPendingKeys(200)>0;);}catch(i){oe.logger.error("Key backup request failed when logging out. Some keys may be missing from backup",i)}return this.http.authedRequest(e,M.Method.Post,"/logout")}deactivateAccount(e,t){if(typeof t=="function")throw new Error("deactivateAccount no longer accepts a callback parameter");const r={};return e&&(r.auth=e),t!==void 0&&(r.erase=t),this.http.authedRequest(void 0,M.Method.Post,"/account/deactivate",void 0,r)}getFallbackAuthUrl(e,t){const r=N.encodeUri("/auth/$loginType/fallback/web",{$loginType:e});return this.http.getUrl(r,{session:t},M.PREFIX_R0)}async createRoom(e,t){const r=(e.invite_3pid||[]).filter(i=>!i.id_access_token);if(r.length>0&&this.identityServer&&this.identityServer.getAccessToken&&await this.doesServerAcceptIdentityAccessToken()){const i=await this.identityServer.getAccessToken();if(i)for(const s of r)s.id_access_token=i}return this.http.authedRequest(t,M.Method.Post,"/createRoom",void 0,e)}async fetchRelations(e,t,r,i,s={}){const o=N.encodeParams(s);let a="/rooms/$roomId/relations/$eventId";r!==null?(a+="/$relationType",i!==null&&(a+="/$eventType")):i!==null&&(oe.logger.warn(`eventType: ${i} ignored when fetching
- relations as relationType is null`),i=null);const l=N.encodeUri(a+"?"+o,{$roomId:e,$eventId:t,$relationType:r,$eventType:i});return await this.http.authedRequest(void 0,M.Method.Get,l,null,null,{prefix:M.PREFIX_UNSTABLE})}roomState(e,t){const r=N.encodeUri("/rooms/$roomId/state",{$roomId:e});return this.http.authedRequest(t,M.Method.Get,r)}fetchRoomEvent(e,t,r){const i=N.encodeUri("/rooms/$roomId/event/$eventId",{$roomId:e,$eventId:t});return this.http.authedRequest(r,M.Method.Get,i)}members(e,t,r,i,s){const o={};t&&(o.membership=t),r&&(o.not_membership=r),i&&(o.at=i);const a=N.encodeParams(o),l=N.encodeUri("/rooms/$roomId/members?"+a,{$roomId:e});return this.http.authedRequest(s,M.Method.Get,l)}upgradeRoom(e,t){const r=N.encodeUri("/rooms/$roomId/upgrade",{$roomId:e});return this.http.authedRequest(void 0,M.Method.Post,r,void 0,{new_version:t})}getStateEvent(e,t,r,i){const s={$roomId:e,$eventType:t,$stateKey:r};let o=N.encodeUri("/rooms/$roomId/state/$eventType",s);return r!==void 0&&(o=N.encodeUri(o+"/$stateKey",s)),this.http.authedRequest(i,M.Method.Get,o)}sendStateEvent(e,t,r,i="",s){const o={$roomId:e,$eventType:t,$stateKey:i};let a=N.encodeUri("/rooms/$roomId/state/$eventType",o);return i!==void 0&&(a=N.encodeUri(a+"/$stateKey",o)),this.http.authedRequest(s,M.Method.Put,a,void 0,r)}roomInitialSync(e,t,r){var i,s;N.isFunction(t)&&(r=t,t=void 0);const o=N.encodeUri("/rooms/$roomId/initialSync",{$roomId:e});return this.http.authedRequest(r,M.Method.Get,o,{limit:(i=(s=t)===null||s===void 0?void 0:s.toString())!==null&&i!==void 0?i:"30"})}setRoomReadMarkersHttpRequest(e,t,r,i){const s=N.encodeUri("/rooms/$roomId/read_markers",{$roomId:e}),o={"m.fully_read":t,"m.read":r,"org.matrix.msc2285.hidden":Boolean(i?i.hidden:!1)};return this.http.authedRequest(void 0,M.Method.Post,s,void 0,o)}getJoinedRooms(){const e=N.encodeUri("/joined_rooms",{});return this.http.authedRequest(void 0,M.Method.Get,e)}getJoinedRoomMembers(e){const t=N.encodeUri("/rooms/$roomId/joined_members",{$roomId:e});return this.http.authedRequest(void 0,M.Method.Get,t)}publicRooms(e,t){typeof e=="function"&&(t=e,e={}),e===void 0&&(e={});const r={};return e.server&&(r.server=e.server,delete e.server),Object.keys(e).length===0&&Object.keys(r).length===0?this.http.authedRequest(t,M.Method.Get,"/publicRooms"):this.http.authedRequest(t,M.Method.Post,"/publicRooms",r,e)}createAlias(e,t,r){const i=N.encodeUri("/directory/room/$alias",{$alias:e}),s={room_id:t};return this.http.authedRequest(r,M.Method.Put,i,void 0,s)}deleteAlias(e,t){const r=N.encodeUri("/directory/room/$alias",{$alias:e});return this.http.authedRequest(t,M.Method.Delete,r,void 0,void 0)}unstableGetLocalAliases(e,t){const r=N.encodeUri("/rooms/$roomId/aliases",{$roomId:e}),i=M.PREFIX_UNSTABLE+"/org.matrix.msc2432";return this.http.authedRequest(t,M.Method.Get,r,null,null,{prefix:i})}getRoomIdForAlias(e,t){const r=N.encodeUri("/directory/room/$alias",{$alias:e});return this.http.authedRequest(t,M.Method.Get,r)}resolveRoomAlias(e,t){const r=N.encodeUri("/directory/room/$alias",{$alias:e});return this.http.request(t,M.Method.Get,r)}getRoomDirectoryVisibility(e,t){const r=N.encodeUri("/directory/list/room/$roomId",{$roomId:e});return this.http.authedRequest(t,M.Method.Get,r)}setRoomDirectoryVisibility(e,t,r){const i=N.encodeUri("/directory/list/room/$roomId",{$roomId:e});return this.http.authedRequest(r,M.Method.Put,i,void 0,{visibility:t})}setRoomDirectoryVisibilityAppService(e,t,r,i){const s=N.encodeUri("/directory/list/appservice/$networkId/$roomId",{$networkId:e,$roomId:t});return this.http.authedRequest(i,M.Method.Put,s,void 0,{visibility:r})}searchUserDirectory(e){const t={search_term:e.term};return e.limit!==void 0&&(t.limit=e.limit),this.http.authedRequest(void 0,M.Method.Post,"/user_directory/search",void 0,t)}uploadContent(e,t){return this.http.uploadContent(e,t)}cancelUpload(e){return this.http.cancelUpload(e)}getCurrentUploads(){return this.http.getCurrentUploads()}getProfileInfo(e,t,r){N.isFunction(t)&&(r=t,t=void 0);const i=t?N.encodeUri("/profile/$userId/$info",{$userId:e,$info:t}):N.encodeUri("/profile/$userId",{$userId:e});return this.http.authedRequest(r,M.Method.Get,i)}getThreePids(e){const t="/account/3pid";return this.http.authedRequest(e,M.Method.Get,t,void 0,void 0)}addThreePid(e,t,r){const i="/account/3pid",s={threePidCreds:e,bind:t};return this.http.authedRequest(r,M.Method.Post,i,null,s)}async addThreePidOnly(e){const t="/account/3pid/add",r=await this.isVersionSupported("r0.6.0")?M.PREFIX_R0:M.PREFIX_UNSTABLE;return this.http.authedRequest(void 0,M.Method.Post,t,null,e,{prefix:r})}async bindThreePid(e){const t="/account/3pid/bind",r=await this.isVersionSupported("r0.6.0")?M.PREFIX_R0:M.PREFIX_UNSTABLE;return this.http.authedRequest(void 0,M.Method.Post,t,null,e,{prefix:r})}async unbindThreePid(e,t){const r="/account/3pid/unbind",i={medium:e,address:t,id_server:this.getIdentityServerUrl(!0)},s=await this.isVersionSupported("r0.6.0")?M.PREFIX_R0:M.PREFIX_UNSTABLE;return this.http.authedRequest(void 0,M.Method.Post,r,null,i,{prefix:s})}deleteThreePid(e,t){const r="/account/3pid/delete";return this.http.authedRequest(void 0,M.Method.Post,r,null,{medium:e,address:t})}setPassword(e,t,r){const i="/account/password",s={auth:e,new_password:t};return this.http.authedRequest(r,M.Method.Post,i,null,s)}getDevices(){return this.http.authedRequest(void 0,M.Method.Get,"/devices",void 0,void 0)}getDevice(e){const t=N.encodeUri("/devices/$device_id",{$device_id:e});return this.http.authedRequest(void 0,M.Method.Get,t,void 0,void 0)}setDeviceDetails(e,t){const r=N.encodeUri("/devices/$device_id",{$device_id:e});return this.http.authedRequest(void 0,M.Method.Put,r,void 0,t)}deleteDevice(e,t){const r=N.encodeUri("/devices/$device_id",{$device_id:e}),i={};return t&&(i.auth=t),this.http.authedRequest(void 0,M.Method.Delete,r,void 0,i)}deleteMultipleDevices(e,t){const r={devices:e};t&&(r.auth=t);const i="/delete_devices";return this.http.authedRequest(void 0,M.Method.Post,i,void 0,r)}getPushers(e){const t="/pushers";return this.http.authedRequest(e,M.Method.Get,t,void 0,void 0)}setPusher(e,t){const r="/pushers/set";return this.http.authedRequest(t,M.Method.Post,r,null,e)}getPushRules(e){return this.http.authedRequest(e,M.Method.Get,"/pushrules/").then(t=>_d.PushProcessor.rewriteDefaultRules(t))}addPushRule(e,t,r,i,s){const o=N.encodeUri("/pushrules/"+e+"/$kind/$ruleId",{$kind:t,$ruleId:r});return this.http.authedRequest(s,M.Method.Put,o,void 0,i)}deletePushRule(e,t,r,i){const s=N.encodeUri("/pushrules/"+e+"/$kind/$ruleId",{$kind:t,$ruleId:r});return this.http.authedRequest(i,M.Method.Delete,s)}setPushRuleEnabled(e,t,r,i,s){const o=N.encodeUri("/pushrules/"+e+"/$kind/$ruleId/enabled",{$kind:t,$ruleId:r});return this.http.authedRequest(s,M.Method.Put,o,void 0,{enabled:i})}setPushRuleActions(e,t,r,i,s){const o=N.encodeUri("/pushrules/"+e+"/$kind/$ruleId/actions",{$kind:t,$ruleId:r});return this.http.authedRequest(s,M.Method.Put,o,void 0,{actions:i})}search(e,t){const r={};return e.next_batch&&(r.next_batch=e.next_batch),this.http.authedRequest(t,M.Method.Post,"/search",r,e.body)}uploadKeysRequest(e,t,r){return this.http.authedRequest(r,M.Method.Post,"/keys/upload",void 0,e)}uploadKeySignatures(e){return this.http.authedRequest(void 0,M.Method.Post,"/keys/signatures/upload",void 0,e,{prefix:M.PREFIX_UNSTABLE})}downloadKeysForUsers(e,t){if(N.isFunction(t))throw new Error("downloadKeysForUsers no longer accepts a callback parameter");t=t||{};const r={device_keys:{}};return"token"in t&&(r.token=t.token),e.forEach(i=>{r.device_keys[i]=[]}),this.http.authedRequest(void 0,M.Method.Post,"/keys/query",void 0,r)}claimOneTimeKeys(e,t="signed_curve25519",r){const i={};t===void 0&&(t="signed_curve25519");for(let a=0;a<e.length;++a){const l=e[a][0],u=e[a][1],c=i[l]||{};i[l]=c,c[u]=t}const s={one_time_keys:i};r&&(s.timeout=r);const o="/keys/claim";return this.http.authedRequest(void 0,M.Method.Post,o,void 0,s)}getKeyChanges(e,t){const r={from:e,to:t},i="/keys/changes";return this.http.authedRequest(void 0,M.Method.Get,i,r,void 0)}uploadDeviceSigningKeys(e,t){const r=Object.assign({},t);return e&&Object.assign(r,{auth:e}),this.http.authedRequest(void 0,M.Method.Post,"/keys/device_signing/upload",void 0,r,{prefix:M.PREFIX_UNSTABLE})}registerWithIdentityServer(e){if(!this.idBaseUrl)throw new Error("No identity server base URL set");const t=this.idBaseUrl+M.PREFIX_IDENTITY_V2+"/account/register";return this.http.requestOtherUrl(void 0,M.Method.Post,t,null,e)}async requestEmailToken(e,t,r,i,s,o){const a={client_secret:t,email:e,send_attempt:r==null?void 0:r.toString(),next_link:i};return await this.http.idServerRequest(s,M.Method.Post,"/validate/email/requestToken",a,M.PREFIX_IDENTITY_V2,o)}async requestMsisdnToken(e,t,r,i,s,o,a){const l={client_secret:r,country:e,phone_number:t,send_attempt:i==null?void 0:i.toString(),next_link:s};return await this.http.idServerRequest(o,M.Method.Post,"/validate/msisdn/requestToken",l,M.PREFIX_IDENTITY_V2,a)}async submitMsisdnToken(e,t,r,i){const s={sid:e,client_secret:t,token:r};return await this.http.idServerRequest(void 0,M.Method.Post,"/validate/msisdn/submitToken",s,M.PREFIX_IDENTITY_V2,i)}submitMsisdnTokenOtherUrl(e,t,r,i){const s={sid:t,client_secret:r,token:i};return this.http.requestOtherUrl(void 0,M.Method.Post,e,void 0,s)}getIdentityHashDetails(e){return this.http.idServerRequest(void 0,M.Method.Get,"/hash_details",null,M.PREFIX_IDENTITY_V2,e)}async identityHashedLookup(e,t){const r={},i=await this.getIdentityHashDetails(t);if(!i||!i.lookup_pepper||!i.algorithms)throw new Error("Unsupported identity server: bad response");r.pepper=i.lookup_pepper;const s={};if(i.algorithms.includes("sha256")){const l=new V.Olm.Utility;r.addresses=e.map(u=>{const c=u[0].toLowerCase(),g=u[1].toLowerCase(),m=l.sha256(`${c} ${g} ${r.pepper}`).replace(/\+/g,"-").replace(/\//g,"_");return s[m]=u[0],m}),r.algorithm="sha256"}else if(i.algorithms.includes("none"))r.addresses=e.map(l=>{const u=l[0].toLowerCase(),c=l[1].toLowerCase(),g=`${u} ${c}`;return s[g]=l[0],g}),r.algorithm="none";else throw new Error("Unsupported identity server: unknown hash algorithm");const o=await this.http.idServerRequest(void 0,M.Method.Post,"/lookup",r,M.PREFIX_IDENTITY_V2,t);if(!o||!o.mappings)return[];const a=[];for(const l of Object.keys(o.mappings)){const u=o.mappings[l],c=s[l];if(!c)throw new Error("Identity server returned more results than expected");a.push({address:c,mxid:u})}return a}async lookupThreePid(e,t,r,i){const o=(await this.identityHashedLookup([[t,e]],i)).find(l=>l.address===t);if(!o)return r&&r(null,{}),{};const a={address:t,medium:e,mxid:o.mxid};return r&&r(null,a),a}async bulkLookupThreePids(e,t){const r=await this.identityHashedLookup(e.map(s=>[s[1],s[0]]),t),i=[];for(const s of r){const o=e.find(a=>a[1]===s.address);if(!o)throw new Error("Identity sever returned unexpected results");i.push([o[0],s.address,s.mxid])}return{threepids:i}}getIdentityAccount(e){return this.http.idServerRequest(void 0,M.Method.Get,"/account",void 0,M.PREFIX_IDENTITY_V2,e)}sendToDevice(e,t,r){const i=N.encodeUri("/sendToDevice/$eventType/$txnId",{$eventType:e,$txnId:r||this.makeTxnId()}),s={messages:t},o=Object.keys(t).reduce((a,l)=>(a[l]=Object.keys(t[l]),a),{});return oe.logger.log(`PUT ${i}`,o),this.http.authedRequest(void 0,M.Method.Put,i,void 0,s)}getThirdpartyProtocols(){return this.http.authedRequest(void 0,M.Method.Get,"/thirdparty/protocols",void 0,void 0).then(e=>{if(!e||typeof e!="object")throw new Error(`/thirdparty/protocols did not return an object: ${e}`);return e})}getThirdpartyLocation(e,t){const r=N.encodeUri("/thirdparty/location/$protocol",{$protocol:e});return this.http.authedRequest(void 0,M.Method.Get,r,t,void 0)}getThirdpartyUser(e,t){const r=N.encodeUri("/thirdparty/user/$protocol",{$protocol:e});return this.http.authedRequest(void 0,M.Method.Get,r,t,void 0)}getTerms(e,t){const r=this.termsUrlForService(e,t);return this.http.requestOtherUrl(void 0,M.Method.Get,r)}agreeToTerms(e,t,r,i){const s=this.termsUrlForService(e,t),o={Authorization:"Bearer "+r};return this.http.requestOtherUrl(void 0,M.Method.Post,s,null,{user_accepts:i},{headers:o})}reportEvent(e,t,r,i){const s=N.encodeUri("/rooms/$roomId/report/$eventId",{$roomId:e,$eventId:t});return this.http.authedRequest(void 0,M.Method.Post,s,null,{score:r,reason:i})}getRoomHierarchy(e,t,r,i=!1,s){const o=N.encodeUri("/rooms/$roomId/hierarchy",{$roomId:e}),a={suggested_only:String(i),max_depth:r==null?void 0:r.toString(),from:s,limit:t==null?void 0:t.toString()};return this.http.authedRequest(void 0,M.Method.Get,o,a,void 0,{prefix:M.PREFIX_V1}).catch(l=>{if(l.errcode==="M_UNRECOGNIZED")return this.http.authedRequest(void 0,M.Method.Get,o,a,void 0,{prefix:"/_matrix/client/unstable/org.matrix.msc2946"});throw l})}async unstableCreateFileTree(e){const{room_id:t}=await this.createRoom({name:e,preset:OA.Preset.PrivateChat,power_level_content_override:Gc(Gc({},wd.DEFAULT_TREE_POWER_LEVELS_TEMPLATE),{},{users:{[this.getUserId()]:100}}),creation_content:{[ue.RoomCreateTypeField]:ue.RoomType.Space},initial_state:[{type:ue.UNSTABLE_MSC3088_PURPOSE.name,state_key:ue.UNSTABLE_MSC3089_TREE_SUBTYPE.name,content:{[ue.UNSTABLE_MSC3088_ENABLED.name]:!0}},{type:ue.EventType.RoomEncryption,state_key:"",content:{algorithm:Ed.MEGOLM_ALGORITHM}}]});return new wd.MSC3089TreeSpace(this,t)}unstableGetFileTreeSpace(e){var t,r;const i=this.getRoom(e);if((i==null?void 0:i.getMyMembership())!=="join")return null;const s=i.currentState.getStateEvents(ue.EventType.RoomCreate,""),o=i.currentState.getStateEvents(ue.UNSTABLE_MSC3088_PURPOSE.name,ue.UNSTABLE_MSC3089_TREE_SUBTYPE.name);if(!s)throw new Error("Expected single room create event");return!(o!=null&&(t=o.getContent())!==null&&t!==void 0&&t[ue.UNSTABLE_MSC3088_ENABLED.name])||((r=s.getContent())===null||r===void 0?void 0:r[ue.RoomCreateTypeField])!==ue.RoomType.Space?null:new wd.MSC3089TreeSpace(this,e)}getGroupSummary(e){const t=N.encodeUri("/groups/$groupId/summary",{$groupId:e});return this.http.authedRequest(void 0,M.Method.Get,t)}getGroupProfile(e){const t=N.encodeUri("/groups/$groupId/profile",{$groupId:e});return this.http.authedRequest(void 0,M.Method.Get,t)}setGroupProfile(e,t){const r=N.encodeUri("/groups/$groupId/profile",{$groupId:e});return this.http.authedRequest(void 0,M.Method.Post,r,void 0,t)}setGroupJoinPolicy(e,t){const r=N.encodeUri("/groups/$groupId/settings/m.join_policy",{$groupId:e});return this.http.authedRequest(void 0,M.Method.Put,r,void 0,{"m.join_policy":t})}getGroupUsers(e){const t=N.encodeUri("/groups/$groupId/users",{$groupId:e});return this.http.authedRequest(void 0,M.Method.Get,t)}getGroupInvitedUsers(e){const t=N.encodeUri("/groups/$groupId/invited_users",{$groupId:e});return this.http.authedRequest(void 0,M.Method.Get,t)}getGroupRooms(e){const t=N.encodeUri("/groups/$groupId/rooms",{$groupId:e});return this.http.authedRequest(void 0,M.Method.Get,t)}inviteUserToGroup(e,t){const r=N.encodeUri("/groups/$groupId/admin/users/invite/$userId",{$groupId:e,$userId:t});return this.http.authedRequest(void 0,M.Method.Put,r,void 0,{})}removeUserFromGroup(e,t){const r=N.encodeUri("/groups/$groupId/admin/users/remove/$userId",{$groupId:e,$userId:t});return this.http.authedRequest(void 0,M.Method.Put,r,void 0,{})}addUserToGroupSummary(e,t,r){const i=N.encodeUri(r?"/groups/$groupId/summary/$roleId/users/$userId":"/groups/$groupId/summary/users/$userId",{$groupId:e,$roleId:r,$userId:t});return this.http.authedRequest(void 0,M.Method.Put,i,void 0,{})}removeUserFromGroupSummary(e,t){const r=N.encodeUri("/groups/$groupId/summary/users/$userId",{$groupId:e,$userId:t});return this.http.authedRequest(void 0,M.Method.Delete,r,void 0,{})}addRoomToGroupSummary(e,t,r){const i=N.encodeUri(r?"/groups/$groupId/summary/$categoryId/rooms/$roomId":"/groups/$groupId/summary/rooms/$roomId",{$groupId:e,$categoryId:r,$roomId:t});return this.http.authedRequest(void 0,M.Method.Put,i,void 0,{})}removeRoomFromGroupSummary(e,t){const r=N.encodeUri("/groups/$groupId/summary/rooms/$roomId",{$groupId:e,$roomId:t});return this.http.authedRequest(void 0,M.Method.Delete,r,void 0,{})}addRoomToGroup(e,t,r){r===void 0&&(r=!0);const i=N.encodeUri("/groups/$groupId/admin/rooms/$roomId",{$groupId:e,$roomId:t});return this.http.authedRequest(void 0,M.Method.Put,i,void 0,{"m.visibility":{type:r?"public":"private"}})}updateGroupRoomVisibility(e,t,r){const i=N.encodeUri("/groups/$groupId/admin/rooms/$roomId/config/m.visibility",{$groupId:e,$roomId:t});return this.http.authedRequest(void 0,M.Method.Put,i,void 0,{type:r?"public":"private"})}removeRoomFromGroup(e,t){const r=N.encodeUri("/groups/$groupId/admin/rooms/$roomId",{$groupId:e,$roomId:t});return this.http.authedRequest(void 0,M.Method.Delete,r,void 0,{})}acceptGroupInvite(e,t=null){const r=N.encodeUri("/groups/$groupId/self/accept_invite",{$groupId:e});return this.http.authedRequest(void 0,M.Method.Put,r,void 0,t||{})}joinGroup(e){const t=N.encodeUri("/groups/$groupId/self/join",{$groupId:e});return this.http.authedRequest(void 0,M.Method.Put,t,void 0,{})}leaveGroup(e){const t=N.encodeUri("/groups/$groupId/self/leave",{$groupId:e});return this.http.authedRequest(void 0,M.Method.Put,t,void 0,{})}getJoinedGroups(){const e=N.encodeUri("/joined_groups",{});return this.http.authedRequest(void 0,M.Method.Get,e)}createGroup(e){const t=N.encodeUri("/create_group",{});return this.http.authedRequest(void 0,M.Method.Post,t,void 0,e)}getPublicisedGroups(e){const t=N.encodeUri("/publicised_groups",{});return this.http.authedRequest(void 0,M.Method.Post,t,void 0,{user_ids:e})}setGroupPublicity(e,t){const r=N.encodeUri("/groups/$groupId/self/update_publicity",{$groupId:e});return this.http.authedRequest(void 0,M.Method.Put,r,void 0,{publicise:t})}supportsExperimentalThreads(){var e;return((e=this.clientOpts)===null||e===void 0?void 0:e.experimentalThreadSupport)||!1}async getRoomSummary(e,t){const r=N.encodeUri("/rooms/$roomid/summary",{$roomid:e});return this.http.authedRequest(void 0,M.Method.Get,r,{via:t},null,{qsStringifyOptions:{arrayFormat:"repeat"},prefix:"/_matrix/client/unstable/im.nheko.summary"})}findThreadRoots(e){const t=new Set;for(const r of e)r.isThreadRelation&&t.add(r.relationEventId);return t}eventShouldLiveIn(e,t,r,i){if(e.isThreadRoot)return{shouldLiveInRoom:!0,shouldLiveInThread:!0,threadId:e.getId()};if(e.isThreadRelation)return{shouldLiveInRoom:!1,shouldLiveInThread:!0,threadId:e.relationEventId};const s=e.getAssociatedId(),o=(t==null?void 0:t.findEventById(s))||r.find(l=>l.getId()===s);return(o==null?void 0:o.isThreadRoot)||i.has(e.relationEventId)?{shouldLiveInRoom:!0,shouldLiveInThread:!0,threadId:e.relationEventId}:o!=null&&o.getAssociatedId()?this.eventShouldLiveIn(o,t,r,i):{shouldLiveInRoom:!0,shouldLiveInThread:!1}}partitionThreadedEvents(e){if(this.supportsExperimentalThreads()){const i=this.findThreadRoots(e);return e.reduce((s,o)=>{const a=this.getRoom(o.getRoomId()),{shouldLiveInRoom:l,shouldLiveInThread:u,threadId:c}=this.eventShouldLiveIn(o,a,e,i);return l&&s[0].push(o),u&&(o.setThreadId(c),s[1].push(o)),s},[[],[]])}else return[e,[]]}async processThreadEvents(e,t,r){for(const i of t)await e.addThreadedEvent(i,r)}async whoami(){return this.http.authedRequest(void 0,M.Method.Get,"/account/whoami")}async timestampToEvent(e,t,r){const i=N.encodeUri("/rooms/$roomId/timestamp_to_event",{$roomId:e});return await this.http.authedRequest(void 0,M.Method.Get,i,{ts:t.toString(),dir:r},void 0,{prefix:"/_matrix/client/unstable/org.matrix.msc3030"})}}st.MatrixClient=fu;(0,X.default)(fu,"RESTORE_BACKUP_ERROR_BAD_KEY","RESTORE_BACKUP_ERROR_BAD_KEY");var Mo={},NA=G.exports;Object.defineProperty(Mo,"__esModule",{value:!0});Mo.TimelineWindow=Mo.TimelineIndex=void 0;var wa=NA(Y.exports),jn=qt;const Am=function(){},LA=5;class BA{constructor(e,t,r={}){this.client=e,this.timelineSet=t,(0,wa.default)(this,"windowLimit",void 0),(0,wa.default)(this,"start",null),(0,wa.default)(this,"end",null),(0,wa.default)(this,"eventCount",0),this.windowLimit=r.windowLimit||1e3}load(e,t=20){const r=i=>{let s;const o=i.getEvents();if(!e)s=o.length;else{for(let u=0;u<o.length;u++)if(o[u].getId()==e){s=u;break}if(s===void 0)throw new Error("getEventTimeline result didn't include requested event")}const a=Math.min(o.length,s+Math.ceil(t/2)),l=Math.max(0,a-t);this.start=new Gh(i,l-i.getBaseIndex()),this.end=new Gh(i,a-i.getBaseIndex()),this.eventCount=a-l};if(e){const i=this.timelineSet.getTimelineForEvent(e);return i?(r(i),Promise.resolve(i)):this.client.getEventTimeline(this.timelineSet,e).then(r)}else{const i=this.timelineSet.getLiveTimeline();return r(i),Promise.resolve()}}getTimelineIndex(e){if(e==jn.EventTimeline.BACKWARDS)return this.start;if(e==jn.EventTimeline.FORWARDS)return this.end;throw new Error("Invalid direction '"+e+"'")}extend(e,t){const r=this.getTimelineIndex(e);if(!r)return!1;const i=e==jn.EventTimeline.BACKWARDS?r.retreat(t):r.advance(t);if(i){this.eventCount+=i,Am("TimelineWindow: increased cap by "+i+" (now "+this.eventCount+")");const s=this.eventCount-this.windowLimit;return s>0&&this.unpaginate(s,e!=jn.EventTimeline.BACKWARDS),!0}return!1}canPaginate(e){const t=this.getTimelineIndex(e);if(!t)return!1;if(e==jn.EventTimeline.BACKWARDS){if(t.index>t.minIndex())return!0}else if(t.index<t.maxIndex())return!0;return Boolean(t.timeline.getNeighbouringTimeline(e)||t.timeline.getPaginationToken(e)!==null)}paginate(e,t,r=!0,i=LA){const s=this.getTimelineIndex(e);if(!s)return Promise.resolve(!1);if(s.pendingPaginate)return s.pendingPaginate;if(this.extend(e,t))return Promise.resolve(!0);if(!r||i===0||s.timeline.getPaginationToken(e)===null)return Promise.resolve(!1);const a=this.client.paginateEventTimeline(s.timeline,{backwards:e==jn.EventTimeline.BACKWARDS,limit:t}).finally(function(){s.pendingPaginate=null}).then(l=>l?this.paginate(e,t,!0,i-1):!1);return s.pendingPaginate=a,a}unpaginate(e,t){const r=t?this.start:this.end;if(e>this.eventCount||e<0)throw new Error("Attemting to unpaginate "+e+" events, but only have "+this.eventCount+" in the timeline");for(;e>0;){const i=t?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,Am("TimelineWindow.unpaginate: dropped "+i+" (now "+this.eventCount+")")}}getEvents(){if(!this.start)return[];const e=[];let t=this.start.timeline;for(;;){const r=t.getEvents();let i=0,s=r.length;t===this.start.timeline&&(i=this.start.index+t.getBaseIndex()),t===this.end.timeline&&(s=this.end.index+t.getBaseIndex());for(let o=i;o<s;o++)e.push(r[o]);if(t===this.end.timeline)break;t=t.getNeighbouringTimeline(jn.EventTimeline.FORWARDS)}return e}}Mo.TimelineWindow=BA;class Gh{constructor(e,t){this.timeline=e,this.index=t,(0,wa.default)(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;let t;if(e<0){if(t=Math.max(e,this.minIndex()-this.index),t<0)return this.index+=t,t}else if(t=Math.min(e,this.maxIndex()-this.index),t>0)return this.index+=t,t;const r=this.timeline.getNeighbouringTimeline(e<0?jn.EventTimeline.BACKWARDS:jn.EventTimeline.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}}Mo.TimelineIndex=Gh;var Ts={},KA=G.exports;Object.defineProperty(Ts,"__esModule",{value:!0});Ts.InteractiveAuth=Ts.AuthType=void 0;var Lt=KA(Y.exports),Rd=se,FA=W;const ma="m.login.email.identity",Dm="m.login.msisdn";let Ya;Ts.AuthType=Ya;(function(n){n.Password="m.login.password",n.Recaptcha="m.login.recaptcha",n.Terms="m.login.terms",n.Email="m.login.email.identity",n.Msisdn="m.login.msisdn",n.Sso="m.login.sso",n.SsoUnstable="org.matrix.login.sso",n.Dummy="m.login.dummy",n.RegistrationToken="org.matrix.msc3231.login.registration_token"})(Ya||(Ts.AuthType=Ya={}));class qA extends Error{constructor(e,t,r){super(e);this.required_stages=t,this.flows=r,(0,Lt.default)(this,"name","NoAuthFlowFoundError")}}class jA{constructor(e){var t;(0,Lt.default)(this,"matrixClient",void 0),(0,Lt.default)(this,"inputs",void 0),(0,Lt.default)(this,"clientSecret",void 0),(0,Lt.default)(this,"requestCallback",void 0),(0,Lt.default)(this,"busyChangedCallback",void 0),(0,Lt.default)(this,"stateUpdatedCallback",void 0),(0,Lt.default)(this,"requestEmailTokenCallback",void 0),(0,Lt.default)(this,"data",void 0),(0,Lt.default)(this,"emailSid",void 0),(0,Lt.default)(this,"requestingEmailToken",!1),(0,Lt.default)(this,"attemptAuthDeferred",null),(0,Lt.default)(this,"chosenFlow",null),(0,Lt.default)(this,"currentStage",null),(0,Lt.default)(this,"submitPromise",null),this.matrixClient=e.matrixClient,this.data=e.authData||{},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=(t=e.emailSid)!==null&&t!==void 0?t:null}attemptAuth(){var e;this.attemptAuthDeferred=(0,FA.defer)();const t=this.attemptAuthDeferred.promise;if((e=this.data)!==null&&e!==void 0&&e.flows)this.startNextAuthStage();else{var r;(r=this.busyChangedCallback)===null||r===void 0||r.call(this,!0);let i=null;this.data.session&&(i={session:this.data.session}),this.doRequest(i).finally(()=>{var s;(s=this.busyChangedCallback)===null||s===void 0||s.call(this,!1)})}return t}async poll(){if(!this.data.session||!this.attemptAuthDeferred||this.submitPromise)return;let e={};if(this.currentStage==ma&&this.emailSid){const t={sid:this.emailSid,client_secret:this.clientSecret};if(await this.matrixClient.doesServerRequireIdServerParam()){const r=new URL(this.matrixClient.getIdentityServerUrl());t.id_server=r.host}e={type:ma,threepid_creds:t,threepidCreds:t}}this.submitAuthDict(e,!0)}getSessionId(){return this.data?this.data.session:void 0}getClientSecret(){return this.clientSecret}getStageParams(e){var t;return(t=this.data.params)===null||t===void 0?void 0:t[e]}getChosenFlow(){return this.chosenFlow}async submitAuthDict(e,t=!1){if(!this.attemptAuthDeferred)throw new Error("submitAuthDict() called before attemptAuth()");if(!t){var r;(r=this.busyChangedCallback)===null||r===void 0||r.call(this,!0)}for(;this.submitPromise;)try{await this.submitPromise}catch{}let i;this.data.session?(i={session:this.data.session},Object.assign(i,e)):i=e;try{this.submitPromise=this.doRequest(i,t),await this.submitPromise}finally{if(this.submitPromise=null,!t){var s;(s=this.busyChangedCallback)===null||s===void 0||s.call(this,!1)}}}getEmailSid(){return this.emailSid}setEmailSid(e){this.emailSid=e}async doRequest(e,t=!1){try{const o=await this.requestCallback(e,t);this.attemptAuthDeferred.resolve(o),this.attemptAuthDeferred=null}catch(o){var r,i;const a=(r=(i=o.data)===null||i===void 0?void 0:i.flows)!==null&&r!==void 0?r:null,l=this.data.flows||Boolean(a);if(o.httpStatus!==401||!o.data||!l)if(t)Rd.logger.log("Background poll request failed doing UI auth: ignoring",o);else{var s;(s=this.attemptAuthDeferred)===null||s===void 0||s.reject(o)}!o.data.flows&&!o.data.completed&&!o.data.session&&(o.data.flows=this.data.flows,o.data.completed=this.data.completed,o.data.session=this.data.session),this.data=o.data;try{this.startNextAuthStage()}catch(u){this.attemptAuthDeferred.reject(u),this.attemptAuthDeferred=null;return}if(!this.emailSid&&!this.requestingEmailToken&&this.chosenFlow.stages.includes(Ya.Email)){this.requestingEmailToken=!0;try{const u=await this.requestEmailTokenCallback(this.inputs.emailAddress,this.clientSecret,1,this.data.session);this.emailSid=u.sid}catch(u){this.attemptAuthDeferred.reject(u),this.attemptAuthDeferred=null}finally{this.requestingEmailToken=!1}}}}startNextAuthStage(){const e=this.chooseStage();if(!e)throw new Error("No incomplete flows from the server");if(this.currentStage=e,e===Ya.Dummy){this.submitAuthDict({type:"m.login.dummy"});return}if(this.data&&this.data.errcode||this.data.error){this.stateUpdatedCallback(e,{errcode:this.data.errcode||"",error:this.data.error||""});return}const t={};e==ma&&(t.emailSid=this.emailSid),this.stateUpdatedCallback(e,t)}chooseStage(){this.chosenFlow===null&&(this.chosenFlow=this.chooseFlow()),Rd.logger.log("Active flow => %s",JSON.stringify(this.chosenFlow));const e=this.firstUncompletedStage(this.chosenFlow);return Rd.logger.log("Next stage: %s",e),e}chooseFlow(){const e=this.data.flows||[],t=Boolean(this.inputs.emailAddress)||Boolean(this.emailSid),r=Boolean(this.inputs.phoneCountry)&&Boolean(this.inputs.phoneNumber);for(const s of e){let o=!1,a=!1;for(const l of s.stages)l===ma?o=!0:l==Dm&&(a=!0);if(o==t&&a==r)return s}const i=[];throw t&&i.push(ma),r&&i.push(Dm),new qA("No appropriate authentication flow found",i,e)}firstUncompletedStage(e){const t=this.data.completed||[];for(let r=0;r<e.stages.length;++r){const i=e.stages[r];if(t.indexOf(i)===-1)return i}}}Ts.InteractiveAuth=jA;var pu={},gu={},VA=G.exports;Object.defineProperty(gu,"__esModule",{value:!0});gu.LocalIndexedDBStoreBackend=void 0;var ya=VA(Y.exports),GA=ri,zi=B_(W),WA=B_(iu),Qe=se;function L_(n){if(typeof WeakMap!="function")return null;var e=new WeakMap,t=new WeakMap;return(L_=function(r){return r?t:e})(n)}function B_(n,e){if(!e&&n&&n.__esModule)return n;if(n===null||typeof n!="object"&&typeof n!="function")return{default:n};var t=L_(e);if(t&&t.has(n))return t.get(n);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in n)if(s!=="default"&&Object.prototype.hasOwnProperty.call(n,s)){var o=i?Object.getOwnPropertyDescriptor(n,s):null;o&&(o.get||o.set)?Object.defineProperty(r,s,o):r[s]=n[s]}return r.default=n,t&&t.set(n,r),r}const HA=3;function YA(n){n.createObjectStore("users",{keyPath:["userId"]}),n.createObjectStore("accountData",{keyPath:["type"]}),n.createObjectStore("sync",{keyPath:["clobber"]})}function zA(n){n.createObjectStore("oob_membership_events",{keyPath:["room_id","state_key"]}).createIndex("room","room_id")}function JA(n){n.createObjectStore("client_options",{keyPath:["clobber"]})}function Wc(n,e,t){const r=n.openCursor(e);return new Promise((i,s)=>{const o=[];r.onerror=()=>{s(new Error("Query failed: "+r.error))},r.onsuccess=()=>{const a=r.result;if(!a){i(o);return}o.push(t(a)),a.continue()}})}function va(n){return new Promise((e,t)=>{n.oncomplete=function(r){e(r)},n.onerror=function(){t(n.error)}})}function K_(n){return new Promise((e,t)=>{n.onsuccess=function(r){e(r)},n.onerror=function(){t(n.error)}})}function XA(n){return new Promise((e,t)=>{n.onsuccess=()=>e(n),n.onerror=r=>t(r)})}function xm(n){return K_(n).then(e=>n.result)}class QA{static exists(e,t){return t="matrix-js-sdk:"+(t||"default"),WA.exists(e,t)}constructor(e,t){this.indexedDB=e,(0,ya.default)(this,"dbName",void 0),(0,ya.default)(this,"syncAccumulator",void 0),(0,ya.default)(this,"db",null),(0,ya.default)(this,"disconnected",!0),(0,ya.default)(this,"_isNewlyCreated",!1),this.dbName="matrix-js-sdk:"+(t||"default"),this.syncAccumulator=new GA.SyncAccumulator}connect(){if(!this.disconnected)return Qe.logger.log("LocalIndexedDBStoreBackend.connect: already connected or connecting"),Promise.resolve();this.disconnected=!1,Qe.logger.log("LocalIndexedDBStoreBackend.connect: connecting...");const e=this.indexedDB.open(this.dbName,HA);return e.onupgradeneeded=t=>{const r=e.result,i=t.oldVersion;Qe.logger.log(`LocalIndexedDBStoreBackend.connect: upgrading from ${i}`),i<1&&(this._isNewlyCreated=!0,YA(r)),i<2&&zA(r),i<3&&JA(r)},e.onblocked=()=>{Qe.logger.log("can't yet open LocalIndexedDBStoreBackend because it is open elsewhere")},Qe.logger.log("LocalIndexedDBStoreBackend.connect: awaiting connection..."),K_(e).then(()=>(Qe.logger.log("LocalIndexedDBStoreBackend.connect: connected"),this.db=e.result,this.db.onversionchange=()=>{this.db.close()},this.init()))}isNewlyCreated(){return Promise.resolve(this._isNewlyCreated)}init(){return Promise.all([this.loadAccountData(),this.loadSyncData()]).then(([e,t])=>{Qe.logger.log("LocalIndexedDBStoreBackend: loaded initial data"),this.syncAccumulator.accumulate({next_batch:t.nextBatch,rooms:t.roomsData,groups:t.groupsData,account_data:{events:e}},!0)})}getOutOfBandMembers(e){return new Promise((t,r)=>{const o=this.db.transaction(["oob_membership_events"],"readonly").objectStore("oob_membership_events").index("room"),a=IDBKeyRange.only(e),l=o.openCursor(a),u=[];let c=!1;l.onsuccess=()=>{const g=l.result;if(!g)return!u.length&&!c?t(null):t(u);const m=g.value;m.oob_written?c=!0:u.push(m),g.continue()},l.onerror=g=>{r(g)}}).then(t=>(Qe.logger.log(`LL: got ${t&&t.length} membershipEvents from storage for room ${e} ...`),t))}async setOutOfBandMembers(e,t){Qe.logger.log(`LL: backend about to store ${t.length} members for ${e}`);const r=this.db.transaction(["oob_membership_events"],"readwrite"),i=r.objectStore("oob_membership_events");t.forEach(o=>{i.put(o)});const s={room_id:e,oob_written:!0,state_key:0};i.put(s),await va(r),Qe.logger.log(`LL: backend done storing for ${e}!`)}async clearOutOfBandMembers(e){const i=this.db.transaction(["oob_membership_events"],"readonly").objectStore("oob_membership_events").index("room"),s=IDBKeyRange.only(e),o=xm(i.openKeyCursor(s,"next")).then(f=>f&&f.primaryKey[1]),a=xm(i.openKeyCursor(s,"prev")).then(f=>f&&f.primaryKey[1]),[l,u]=await Promise.all([o,a]),g=this.db.transaction(["oob_membership_events"],"readwrite").objectStore("oob_membership_events"),m=IDBKeyRange.bound([e,l],[e,u]);Qe.logger.log(`LL: Deleting all users + marker in storage for room ${e}, with key range:`,[e,l],[e,u]),await XA(g.delete(m))}clearDatabase(){return new Promise(e=>{Qe.logger.log(`Removing indexeddb instance: ${this.dbName}`);const t=this.indexedDB.deleteDatabase(this.dbName);t.onblocked=()=>{Qe.logger.log(`can't yet delete indexeddb ${this.dbName} because it is open elsewhere`)},t.onerror=()=>{Qe.logger.warn(`unable to delete js-sdk store indexeddb: ${t.error}`),e()},t.onsuccess=()=>{Qe.logger.log(`Removed indexeddb instance: ${this.dbName}`),e()}})}getSavedSync(e=!0){const t=this.syncAccumulator.getJSON();return t.nextBatch?e?Promise.resolve(zi.deepCopy(t)):Promise.resolve(t):Promise.resolve(null)}getNextBatchToken(){return Promise.resolve(this.syncAccumulator.getNextBatchToken())}setSyncData(e){return Promise.resolve().then(()=>{this.syncAccumulator.accumulate(e)})}async syncToDatabase(e){const t=this.syncAccumulator.getJSON(!0);await Promise.all([this.persistUserPresenceEvents(e),this.persistAccountData(t.accountData),this.persistSyncData(t.nextBatch,t.roomsData,t.groupsData)])}persistSyncData(e,t,r){return Qe.logger.log("Persisting sync data up to",e),zi.promiseTry(()=>{const i=this.db.transaction(["sync"],"readwrite");return i.objectStore("sync").put({clobber:"-",nextBatch:e,roomsData:t,groupsData:r}),va(i).then()})}persistAccountData(e){return zi.promiseTry(()=>{const t=this.db.transaction(["accountData"],"readwrite"),r=t.objectStore("accountData");for(let i=0;i<e.length;i++)r.put(e[i]);return va(t).then()})}persistUserPresenceEvents(e){return zi.promiseTry(()=>{const t=this.db.transaction(["users"],"readwrite"),r=t.objectStore("users");for(const i of e)r.put({userId:i[0],event:i[1]});return va(t).then()})}getUserPresenceEvents(){return zi.promiseTry(()=>{const t=this.db.transaction(["users"],"readonly").objectStore("users");return Wc(t,void 0,r=>[r.value.userId,r.value.event])})}loadAccountData(){return Qe.logger.log("LocalIndexedDBStoreBackend: loading account data..."),zi.promiseTry(()=>{const t=this.db.transaction(["accountData"],"readonly").objectStore("accountData");return Wc(t,void 0,r=>r.value).then(r=>(Qe.logger.log("LocalIndexedDBStoreBackend: loaded account data"),r))})}loadSyncData(){return Qe.logger.log("LocalIndexedDBStoreBackend: loading sync data..."),zi.promiseTry(()=>{const t=this.db.transaction(["sync"],"readonly").objectStore("sync");return Wc(t,void 0,r=>r.value).then(r=>(Qe.logger.log("LocalIndexedDBStoreBackend: loaded sync data"),r.length>1&&Qe.logger.warn("loadSyncData: More than 1 sync row found."),r.length>0?r[0]:{}))})}getClientOptions(){return Promise.resolve().then(()=>{const t=this.db.transaction(["client_options"],"readonly").objectStore("client_options");return Wc(t,void 0,r=>{if(r.value&&r.value&&r.value.options)return r.value.options}).then(r=>r[0])})}async storeClientOptions(e){const t=this.db.transaction(["client_options"],"readwrite");t.objectStore("client_options").put({clobber:"-",options:e}),await va(t)}}gu.LocalIndexedDBStoreBackend=QA;var mu={},ZA=G.exports;Object.defineProperty(mu,"__esModule",{value:!0});mu.RemoteIndexedDBStoreBackend=void 0;var _a=ZA(Y.exports),Hc=se,eD=W;class tD{constructor(e,t){this.workerFactory=e,this.dbName=t,(0,_a.default)(this,"worker",void 0),(0,_a.default)(this,"nextSeq",0),(0,_a.default)(this,"inFlight",{}),(0,_a.default)(this,"startPromise",null),(0,_a.default)(this,"onWorkerMessage",r=>{const i=r.data;if(i.command=="cmd_success"||i.command=="cmd_fail"){if(i.seq===void 0){Hc.logger.error("Got reply from worker with no seq");return}const s=this.inFlight[i.seq];if(s===void 0){Hc.logger.error("Got reply for unknown seq "+i.seq);return}if(delete this.inFlight[i.seq],i.command=="cmd_success")s.resolve(i.result);else{const o=new Error(i.error.message);o.name=i.error.name,s.reject(o)}}else Hc.logger.warn("Unrecognised message from worker: ",i)})}connect(){return 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,t){return this.doCmd("setOutOfBandMembers",[e,t])}clearOutOfBandMembers(e){return this.doCmd("clearOutOfBandMembers",[e])}getClientOptions(){return this.doCmd("getClientOptions")}storeClientOptions(e){return this.doCmd("storeClientOptions",[e])}getUserPresenceEvents(){return this.doCmd("getUserPresenceEvents")}ensureStarted(){return this.startPromise===null&&(this.worker=this.workerFactory(),this.worker.onmessage=this.onWorkerMessage,this.startPromise=this.doCmd("_setupWorker",[this.dbName]).then(()=>{Hc.logger.log("IndexedDB worker is ready")})),this.startPromise}doCmd(e,t){return Promise.resolve().then(()=>{const r=this.nextSeq++,i=(0,eD.defer)();return this.inFlight[r]=i,this.worker.postMessage({command:e,seq:r,args:t}),i.promise})}}mu.RemoteIndexedDBStoreBackend=tD;var rD=G.exports;Object.defineProperty(pu,"__esModule",{value:!0});pu.IndexedDBStore=void 0;var gt=rD(Y.exports),nD=Qa,Um=gu,iD=mu,sD=Qr,oD=jt,un=se,aD=je;const cD=1e3*60*5;class lD extends nD.MemoryStore{static exists(e,t){return Um.LocalIndexedDBStoreBackend.exists(e,t)}constructor(e){super(e);if((0,gt.default)(this,"backend",void 0),(0,gt.default)(this,"startedUp",!1),(0,gt.default)(this,"syncTs",0),(0,gt.default)(this,"userModifiedMap",{}),(0,gt.default)(this,"emitter",new aD.TypedEventEmitter),(0,gt.default)(this,"on",this.emitter.on.bind(this.emitter)),(0,gt.default)(this,"getSavedSync",this.degradable(()=>this.backend.getSavedSync(),"getSavedSync")),(0,gt.default)(this,"isNewlyCreated",this.degradable(()=>this.backend.isNewlyCreated(),"isNewlyCreated")),(0,gt.default)(this,"getSavedSyncToken",this.degradable(()=>this.backend.getNextBatchToken(),"getSavedSyncToken")),(0,gt.default)(this,"deleteAllData",this.degradable(()=>(super.deleteAllData(),this.backend.clearDatabase().then(()=>{un.logger.log("Deleted indexeddb data.")},t=>{throw un.logger.error(`Failed to delete indexeddb data: ${t}`),t})))),(0,gt.default)(this,"reallySave",this.degradable(()=>{this.syncTs=Date.now();const t=[];for(const r of this.getUsers())this.userModifiedMap[r.userId]!==r.getLastModifiedTime()&&(!r.events.presence||(t.push([r.userId,r.events.presence.event]),this.userModifiedMap[r.userId]=r.getLastModifiedTime()));return this.backend.syncToDatabase(t)})),(0,gt.default)(this,"setSyncData",this.degradable(t=>this.backend.setSyncData(t),"setSyncData")),(0,gt.default)(this,"getOutOfBandMembers",this.degradable(t=>this.backend.getOutOfBandMembers(t),"getOutOfBandMembers")),(0,gt.default)(this,"setOutOfBandMembers",this.degradable((t,r)=>(super.setOutOfBandMembers(t,r),this.backend.setOutOfBandMembers(t,r)),"setOutOfBandMembers")),(0,gt.default)(this,"clearOutOfBandMembers",this.degradable(t=>(super.clearOutOfBandMembers(t),this.backend.clearOutOfBandMembers(t)),"clearOutOfBandMembers")),(0,gt.default)(this,"getClientOptions",this.degradable(()=>this.backend.getClientOptions(),"getClientOptions")),(0,gt.default)(this,"storeClientOptions",this.degradable(t=>(super.storeClientOptions(t),this.backend.storeClientOptions(t)),"storeClientOptions")),!e.indexedDB)throw new Error("Missing required option: indexedDB");e.workerFactory?this.backend=new iD.RemoteIndexedDBStoreBackend(e.workerFactory,e.dbName):this.backend=new Um.LocalIndexedDBStoreBackend(e.indexedDB,e.dbName)}startup(){return this.startedUp?(un.logger.log("IndexedDBStore.startup: already started"),Promise.resolve()):(un.logger.log("IndexedDBStore.startup: connecting to backend"),this.backend.connect().then(()=>(un.logger.log("IndexedDBStore.startup: loading presence events"),this.backend.getUserPresenceEvents())).then(e=>{un.logger.log("IndexedDBStore.startup: processing presence events"),e.forEach(([t,r])=>{const i=new sD.User(t);r&&i.setPresenceEvent(new oD.MatrixEvent(r)),this.userModifiedMap[i.userId]=i.getLastModifiedTime(),this.storeUser(i)})}))}wantsSave(){return Date.now()-this.syncTs>cD}save(e=!1){return e||this.wantsSave()?this.reallySave():Promise.resolve()}degradable(e,t){const r=super[t];return async(...i)=>{try{return e.call(this,...i)}catch(s){un.logger.error("IndexedDBStore failure, degrading to MemoryStore",s),this.emitter.emit("degraded",s);try{un.logger.log("IndexedDBStore trying to delete degraded data"),await this.backend.clearDatabase(),un.logger.log("IndexedDBStore delete after degrading succeeded")}catch(o){un.logger.warn("IndexedDBStore delete after degrading failed",o)}if(r)return r(...i)}}}}pu.IndexedDBStore=lD;var Uf={};Object.defineProperty(Uf,"__esModule",{value:!0});var _D=Uf.WebStorageSessionStore=q_,Yc=uD(W);function F_(n){if(typeof WeakMap!="function")return null;var e=new WeakMap,t=new WeakMap;return(F_=function(r){return r?t:e})(n)}function uD(n,e){if(!e&&n&&n.__esModule)return n;if(n===null||typeof n!="object"&&typeof n!="function")return{default:n};var t=F_(e);if(t&&t.has(n))return t.get(n);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in n)if(s!=="default"&&Object.prototype.hasOwnProperty.call(n,s)){var o=i?Object.getOwnPropertyDescriptor(n,s):null;o&&(o.get||o.set)?Object.defineProperty(r,s,o):r[s]=n[s]}return r.default=n,t&&t.set(n,r),r}const kn="session.e2e.";function q_(n){if(this.store=n,!Yc.isFunction(n.getItem)||!Yc.isFunction(n.setItem)||!Yc.isFunction(n.removeItem)||!Yc.isFunction(n.key)||typeof n.length!="number")throw new Error("Supplied webStore does not meet the WebStorage API interface")}q_.prototype={removeEndToEndAccount:function(){this.store.removeItem($m)},getEndToEndAccount:function(){return this.store.getItem($m)},getAllEndToEndDevices:function(){const n=Km(""),e={};for(let t=0;t<this.store.length;++t){const r=this.store.key(t),i=r.substr(n.length);r.startsWith(n)&&(e[i]=ro(this.store,r))}return e},getEndToEndDeviceTrackingStatus:function(){return ro(this.store,Lm)},getEndToEndDeviceSyncToken:function(){return ro(this.store,Nm)},removeEndToEndDeviceData:function(){no(this.store,Km("")),no(this.store,Lm),no(this.store,Nm)},getEndToEndSessions:function(n){return ro(this.store,zc(n))},getAllEndToEndSessions:function(){const n=Fm(this.store,zc("")),e={};for(const t of n){const r=t.substr(zc("").length);e[r]=ro(this.store,t)}return e},removeAllEndToEndSessions:function(){no(this.store,zc(""))},getAllEndToEndInboundGroupSessionKeys:function(){const n=kn+"inboundgroupsessions/",e=[];for(let t=0;t<this.store.length;t++){const r=this.store.key(t);!r.startsWith(n)||e.push({senderKey:r.substr(n.length,43),sessionId:r.substr(n.length+44)})}return e},getEndToEndInboundGroupSession:function(n,e){const t=dD(n,e);return this.store.getItem(t)},removeAllEndToEndInboundGroupSessions:function(){no(this.store,kn+"inboundgroupsessions/")},getAllEndToEndRooms:function(){const n=Fm(this.store,Id("")),e={};for(const t of n){const r=t.substr(Id("").length);e[r]=ro(this.store,t)}return e},removeAllEndToEndRooms:function(){no(this.store,Id(""))},setLocalTrustedBackupPubKey:function(n){this.store.setItem(Bm,n)},getLocalTrustedBackupPubKey:function(){return this.store.getItem(Bm)}};const $m=kn+"account",Nm=kn+"device_sync_token",Lm=kn+"device_tracking",Bm=kn+"trusted_backup_pubkey";function Km(n){return kn+"devices/"+n}function zc(n){return kn+"sessions/"+n}function dD(n,e){return kn+"inboundgroupsessions/"+n+"/"+e}function Id(n){return kn+"rooms/"+n}function ro(n,e){try{return JSON.parse(n.getItem(e))}catch(t){hD(t.stack)}return null}function Fm(n,e){const t=[];for(let r=0;r<n.length;++r){const i=n.key(r);i.startsWith(e)&&t.push(i)}return t}function no(n,e){const t=[];for(let r=0;r<n.length;++r){const i=n.key(r);i.startsWith(e)&&t.push(i)}for(const r of t)n.removeItem(r)}function hD(...n){}var j_={};Object.defineProperty(j_,"__esModule",{value:!0});(function(n){Object.defineProperty(n,"__esModule",{value:!0});var e={request:!0,getRequest:!0,wrapRequest:!0,setCryptoStoreFactory:!0,createClient:!0,ContentHelpers:!0,createNewMatrixCall:!0};n.ContentHelpers=void 0,n.createClient=pi,Object.defineProperty(n,"createNewMatrixCall",{enumerable:!0,get:function(){return rn.createNewMatrixCall}}),n.getRequest=hi,n.request=$e,n.setCryptoStoreFactory=fi,n.wrapRequest=Fr;var t=Uo;Object.keys(t).forEach(function(_){_==="default"||_==="__esModule"||Object.prototype.hasOwnProperty.call(e,_)||_ in n&&n[_]===t[_]||Object.defineProperty(n,_,{enumerable:!0,get:function(){return t[_]}})});var r=Qa;Object.keys(r).forEach(function(_){_==="default"||_==="__esModule"||Object.prototype.hasOwnProperty.call(e,_)||_ in n&&n[_]===r[_]||Object.defineProperty(n,_,{enumerable:!0,get:function(){return r[_]}})});var i=Wl;Object.keys(i).forEach(function(_){_==="default"||_==="__esModule"||Object.prototype.hasOwnProperty.call(e,_)||_ in n&&n[_]===i[_]||Object.defineProperty(n,_,{enumerable:!0,get:function(){return i[_]}})});var s=st;Object.keys(s).forEach(function(_){_==="default"||_==="__esModule"||Object.prototype.hasOwnProperty.call(e,_)||_ in n&&n[_]===s[_]||Object.defineProperty(n,_,{enumerable:!0,get:function(){return s[_]}})});var o=me;Object.keys(o).forEach(function(_){_==="default"||_==="__esModule"||Object.prototype.hasOwnProperty.call(e,_)||_ in n&&n[_]===o[_]||Object.defineProperty(n,_,{enumerable:!0,get:function(){return o[_]}})});var a=Ni;Object.keys(a).forEach(function(_){_==="default"||_==="__esModule"||Object.prototype.hasOwnProperty.call(e,_)||_ in n&&n[_]===a[_]||Object.defineProperty(n,_,{enumerable:!0,get:function(){return a[_]}})});var l=ri;Object.keys(l).forEach(function(_){_==="default"||_==="__esModule"||Object.prototype.hasOwnProperty.call(e,_)||_ in n&&n[_]===l[_]||Object.defineProperty(n,_,{enumerable:!0,get:function(){return l[_]}})});var u=oi;Object.keys(u).forEach(function(_){_==="default"||_==="__esModule"||Object.prototype.hasOwnProperty.call(e,_)||_ in n&&n[_]===u[_]||Object.defineProperty(n,_,{enumerable:!0,get:function(){return u[_]}})});var c=vr;Object.keys(c).forEach(function(_){_==="default"||_==="__esModule"||Object.prototype.hasOwnProperty.call(e,_)||_ in n&&n[_]===c[_]||Object.defineProperty(n,_,{enumerable:!0,get:function(){return c[_]}})});var g=jt;Object.keys(g).forEach(function(_){_==="default"||_==="__esModule"||Object.prototype.hasOwnProperty.call(e,_)||_ in n&&n[_]===g[_]||Object.defineProperty(n,_,{enumerable:!0,get:function(){return g[_]}})});var m=lr;Object.keys(m).forEach(function(_){_==="default"||_==="__esModule"||Object.prototype.hasOwnProperty.call(e,_)||_ in n&&n[_]===m[_]||Object.defineProperty(n,_,{enumerable:!0,get:function(){return m[_]}})});var f=Xl;Object.keys(f).forEach(function(_){_==="default"||_==="__esModule"||Object.prototype.hasOwnProperty.call(e,_)||_ in n&&n[_]===f[_]||Object.defineProperty(n,_,{enumerable:!0,get:function(){return f[_]}})});var E=qt;Object.keys(E).forEach(function(_){_==="default"||_==="__esModule"||Object.prototype.hasOwnProperty.call(e,_)||_ in n&&n[_]===E[_]||Object.defineProperty(n,_,{enumerable:!0,get:function(){return E[_]}})});var I=ti;Object.keys(I).forEach(function(_){_==="default"||_==="__esModule"||Object.prototype.hasOwnProperty.call(e,_)||_ in n&&n[_]===I[_]||Object.defineProperty(n,_,{enumerable:!0,get:function(){return I[_]}})});var w=Zr;Object.keys(w).forEach(function(_){_==="default"||_==="__esModule"||Object.prototype.hasOwnProperty.call(e,_)||_ in n&&n[_]===w[_]||Object.defineProperty(n,_,{enumerable:!0,get:function(){return w[_]}})});var k=Tn;Object.keys(k).forEach(function(_){_==="default"||_==="__esModule"||Object.prototype.hasOwnProperty.call(e,_)||_ in n&&n[_]===k[_]||Object.defineProperty(n,_,{enumerable:!0,get:function(){return k[_]}})});var C=Qr;Object.keys(C).forEach(function(_){_==="default"||_==="__esModule"||Object.prototype.hasOwnProperty.call(e,_)||_ in n&&n[_]===C[_]||Object.defineProperty(n,_,{enumerable:!0,get:function(){return C[_]}})});var S=Ds;Object.keys(S).forEach(function(_){_==="default"||_==="__esModule"||Object.prototype.hasOwnProperty.call(e,_)||_ in n&&n[_]===S[_]||Object.defineProperty(n,_,{enumerable:!0,get:function(){return S[_]}})});var T=Mo;Object.keys(T).forEach(function(_){_==="default"||_==="__esModule"||Object.prototype.hasOwnProperty.call(e,_)||_ in n&&n[_]===T[_]||Object.defineProperty(n,_,{enumerable:!0,get:function(){return T[_]}})});var D=Ts;Object.keys(D).forEach(function(_){_==="default"||_==="__esModule"||Object.prototype.hasOwnProperty.call(e,_)||_ in n&&n[_]===D[_]||Object.defineProperty(n,_,{enumerable:!0,get:function(){return D[_]}})});var R=jo;Object.keys(R).forEach(function(_){_==="default"||_==="__esModule"||Object.prototype.hasOwnProperty.call(e,_)||_ in n&&n[_]===R[_]||Object.defineProperty(n,_,{enumerable:!0,get:function(){return R[_]}})});var U=pu;Object.keys(U).forEach(function(_){_==="default"||_==="__esModule"||Object.prototype.hasOwnProperty.call(e,_)||_ in n&&n[_]===U[_]||Object.defineProperty(n,_,{enumerable:!0,get:function(){return U[_]}})});var q=Uf;Object.keys(q).forEach(function(_){_==="default"||_==="__esModule"||Object.prototype.hasOwnProperty.call(e,_)||_ in n&&n[_]===q[_]||Object.defineProperty(n,_,{enumerable:!0,get:function(){return q[_]}})});var B=Br;Object.keys(B).forEach(function(_){_==="default"||_==="__esModule"||Object.prototype.hasOwnProperty.call(e,_)||_ in n&&n[_]===B[_]||Object.defineProperty(n,_,{enumerable:!0,get:function(){return B[_]}})});var te=$o;Object.keys(te).forEach(function(_){_==="default"||_==="__esModule"||Object.prototype.hasOwnProperty.call(e,_)||_ in n&&n[_]===te[_]||Object.defineProperty(n,_,{enumerable:!0,get:function(){return te[_]}})});var ye=ie;Object.keys(ye).forEach(function(_){_==="default"||_==="__esModule"||Object.prototype.hasOwnProperty.call(e,_)||_ in n&&n[_]===ye[_]||Object.defineProperty(n,_,{enumerable:!0,get:function(){return ye[_]}})});var we=Fe;Object.keys(we).forEach(function(_){_==="default"||_==="__esModule"||Object.prototype.hasOwnProperty.call(e,_)||_ in n&&n[_]===we[_]||Object.defineProperty(n,_,{enumerable:!0,get:function(){return we[_]}})});var Te=Je;Object.keys(Te).forEach(function(_){_==="default"||_==="__esModule"||Object.prototype.hasOwnProperty.call(e,_)||_ in n&&n[_]===Te[_]||Object.defineProperty(n,_,{enumerable:!0,get:function(){return Te[_]}})});var Ye=j_;Object.keys(Ye).forEach(function(_){_==="default"||_==="__esModule"||Object.prototype.hasOwnProperty.call(e,_)||_ in n&&n[_]===Ye[_]||Object.defineProperty(n,_,{enumerable:!0,get:function(){return Ye[_]}})});var Vt=Go;Object.keys(Vt).forEach(function(_){_==="default"||_==="__esModule"||Object.prototype.hasOwnProperty.call(e,_)||_ in n&&n[_]===Vt[_]||Object.defineProperty(n,_,{enumerable:!0,get:function(){return Vt[_]}})});var Gt=sc;Object.keys(Gt).forEach(function(_){_==="default"||_==="__esModule"||Object.prototype.hasOwnProperty.call(e,_)||_ in n&&n[_]===Gt[_]||Object.defineProperty(n,_,{enumerable:!0,get:function(){return Gt[_]}})});var Q=di(Xe);n.ContentHelpers=Q;var rn=Ce;function Kr(_){if(typeof WeakMap!="function")return null;var dr=new WeakMap,At=new WeakMap;return(Kr=function(hr){return hr?At:dr})(_)}function di(_,dr){if(!dr&&_&&_.__esModule)return _;if(_===null||typeof _!="object"&&typeof _!="function")return{default:_};var At=Kr(dr);if(At&&At.has(_))return At.get(_);var hr={},Sr=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var ot in _)if(ot!=="default"&&Object.prototype.hasOwnProperty.call(_,ot)){var at=Sr?Object.getOwnPropertyDescriptor(_,ot):null;at&&(at.get||at.set)?Object.defineProperty(hr,ot,at):hr[ot]=_[ot]}return hr.default=_,At&&At.set(_,hr),hr}let Re;function $e(_){Re=_}function hi(){return Re}function Fr(_){const dr=Re;Re=function(At,hr){return _(dr,At,hr)}}let Pn=()=>new t.MemoryCryptoStore;function fi(_){Pn=_}function pi(_){return typeof _=="string"&&(_={baseUrl:_}),_.request=_.request||Re,_.store=_.store||new r.MemoryStore({localStorage:V.localStorage}),_.scheduler=_.scheduler||new i.MatrixScheduler,_.cryptoStore=_.cryptoStore||Pn(),new s.MatrixClient(_)}})(Cs);(function(n){var e=G.exports;Object.defineProperty(n,"__esModule",{value:!0});var t={};n.default=void 0;var r=e(ky.exports),i=e(zb),s=a(Cs);Object.keys(s).forEach(function(c){c==="default"||c==="__esModule"||Object.prototype.hasOwnProperty.call(t,c)||c in n&&n[c]===s[c]||Object.defineProperty(n,c,{enumerable:!0,get:function(){return s[c]}})});function o(c){if(typeof WeakMap!="function")return null;var g=new WeakMap,m=new WeakMap;return(o=function(f){return f?m:g})(c)}function a(c,g){if(!g&&c&&c.__esModule)return c;if(c===null||typeof c!="object"&&typeof c!="function")return{default:c};var m=o(g);if(m&&m.has(c))return m.get(c);var f={},E=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var I in c)if(I!=="default"&&Object.prototype.hasOwnProperty.call(c,I)){var w=E?Object.getOwnPropertyDescriptor(c,I):null;w&&(w.get||w.set)?Object.defineProperty(f,I,w):f[I]=c[I]}return f.default=c,m&&m.set(c,f),f}if(s.getRequest())throw new Error("Multiple matrix-js-sdk entrypoints detected!");s.request(function(c,g){return c.qs=i.default.stringify(c.qs||{},c.qsStringifyOptions),(0,r.default)(c,g)});let l;try{l=V.indexedDB}catch{}l&&s.setCryptoStoreFactory(function(){return new s.IndexedDBCryptoStore(l,"matrix-js-sdk:crypto")});var u=s;n.default=u,V.matrixcs=s})(nS);var ED="/pr-121/assets/olm.b3e0f9b4.wasm",SD="/pr-121/assets/olm_legacy.9dc48f49.js",V_={exports:{}};(function(n,e){// @license magnet:?xt=urn:btih:8e4f440f4c65981c5bf93c76d35135ba5064d8b7&dn=apache-2.0.txt Apache-2.0
-var t=function(){var r={},i,s,o=function(){var l=typeof document!="undefined"&&document.currentScript?document.currentScript.src:void 0;return typeof __filename!="undefined"&&(l=l||__filename),function(u){u=u||{};var c;c||(c=typeof u!="undefined"?u:{});var g,m;c.ready=new Promise(function(p,y){g=p,m=y});var f;if(typeof window!="undefined")f=function(p){window.crypto.getRandomValues(p)};else if(n.exports){var E=Ci;f=function(p){var y=E.randomBytes(p.length);p.set(y)},process=V.process}else throw Error("Cannot find global to attach library to");if(typeof OLM_OPTIONS!="undefined")for(var I in OLM_OPTIONS)OLM_OPTIONS.hasOwnProperty(I)&&(c[I]=OLM_OPTIONS[I]);c.onRuntimeInitialized=function(){nn=c._olm_error(),r.PRIVATE_KEY_LENGTH=c._olm_pk_private_key_length(),i&&i()},c.onAbort=function(p){s&&s(p)};var w={},k;for(k in c)c.hasOwnProperty(k)&&(w[k]=c[k]);var C=typeof window=="object",S=typeof importScripts=="function",T="",D,R,U,q,B;typeof process=="object"&&typeof process.versions=="object"&&typeof process.versions.node=="string"?(T=S?Ci.dirname(T)+"/":__dirname+"/",D=function(p,y){return q||(q=Ci),B||(B=Ci),p=B.normalize(p),q.readFileSync(p,y?null:"utf8")},U=function(p){return p=D(p,!0),p.buffer||(p=new Uint8Array(p)),p.buffer||at("Assertion failed: undefined"),p},R=function(p,y,O){q||(q=Ci),B||(B=Ci),p=B.normalize(p),q.readFile(p,function(x,K){x?O(x):y(K.buffer)})},1<process.argv.length&&process.argv[1].replace(/\\/g,"/"),process.argv.slice(2),process.on("uncaughtException",function(p){throw p}),process.on("unhandledRejection",at),c.inspect=function(){return"[Emscripten Module object]"}):(C||S)&&(S?T=self.location.href:typeof document!="undefined"&&document.currentScript&&(T=document.currentScript.src),l&&(T=l),T.indexOf("blob:")!==0?T=T.substr(0,T.lastIndexOf("/")+1):T="",D=function(p){var y=new XMLHttpRequest;return y.open("GET",p,!1),y.send(null),y.responseText},S&&(U=function(p){var y=new XMLHttpRequest;return y.open("GET",p,!1),y.responseType="arraybuffer",y.send(null),new Uint8Array(y.response)}),R=function(p,y,O){var x=new XMLHttpRequest;x.open("GET",p,!0),x.responseType="arraybuffer",x.onload=function(){x.status==200||x.status==0&&x.response?y(x.response):O()},x.onerror=O,x.send(null)}),c.print||console.log.bind(console);var te=c.printErr||console.warn.bind(console);for(k in w)w.hasOwnProperty(k)&&(c[k]=w[k]);w=null;var ye;c.wasmBinary&&(ye=c.wasmBinary),c.noExitRuntime,typeof WebAssembly!="object"&&at("no native wasm support detected");function we(p){var y="i8";switch(y.charAt(y.length-1)==="*"&&(y="i32"),y){case"i1":Re[p>>0]=0;break;case"i8":Re[p>>0]=0;break;case"i16":hi[p>>1]=0;break;case"i32":Fr[p>>2]=0;break;case"i64":gi=[0,(Mn=0,1<=+Math.abs(Mn)?0<Mn?(Math.min(+Math.floor(Mn/4294967296),4294967295)|0)>>>0:~~+Math.ceil((Mn-+(~~Mn>>>0))/4294967296)>>>0:0)],Fr[p>>2]=gi[0],Fr[p+4>>2]=gi[1];break;case"float":Pn[p>>2]=0;break;case"double":fi[p>>3]=0;break;default:at("invalid type for setValue: "+y)}}function Te(p,y){switch(y=y||"i8",y.charAt(y.length-1)==="*"&&(y="i32"),y){case"i1":return Re[p>>0];case"i8":return Re[p>>0];case"i16":return hi[p>>1];case"i32":return Fr[p>>2];case"i64":return Fr[p>>2];case"float":return Pn[p>>2];case"double":return fi[p>>3];default:at("invalid type for getValue: "+y)}return null}var Ye,Vt=!1,Gt=typeof TextDecoder!="undefined"?new TextDecoder("utf8"):void 0;function Q(p,y){if(p){var O=$e,x=p+y;for(y=p;O[y]&&!(y>=x);)++y;if(16<y-p&&O.subarray&&Gt)p=Gt.decode(O.subarray(p,y));else{for(x="";p<y;){var K=O[p++];if(K&128){var ee=O[p++]&63;if((K&224)==192)x+=String.fromCharCode((K&31)<<6|ee);else{var _e=O[p++]&63;K=(K&240)==224?(K&15)<<12|ee<<6|_e:(K&7)<<18|ee<<12|_e<<6|O[p++]&63,65536>K?x+=String.fromCharCode(K):(K-=65536,x+=String.fromCharCode(55296|K>>10,56320|K&1023))}}else x+=String.fromCharCode(K)}p=x}}else p="";return p}function rn(p,y,O,x){if(!(0<x))return 0;var K=O;x=O+x-1;for(var ee=0;ee<p.length;++ee){var _e=p.charCodeAt(ee);if(55296<=_e&&57343>=_e){var Dt=p.charCodeAt(++ee);_e=65536+((_e&1023)<<10)|Dt&1023}if(127>=_e){if(O>=x)break;y[O++]=_e}else{if(2047>=_e){if(O+1>=x)break;y[O++]=192|_e>>6}else{if(65535>=_e){if(O+2>=x)break;y[O++]=224|_e>>12}else{if(O+3>=x)break;y[O++]=240|_e>>18,y[O++]=128|_e>>12&63}y[O++]=128|_e>>6&63}y[O++]=128|_e&63}}return y[O]=0,O-K}function Kr(p){for(var y=0,O=0;O<p.length;++O){var x=p.charCodeAt(O);55296<=x&&57343>=x&&(x=65536+((x&1023)<<10)|p.charCodeAt(++O)&1023),127>=x?++y:y=2047>=x?y+2:65535>=x?y+3:y+4}return y}function di(p,y){for(var O=0;O<p.length;++O)Re[y++>>0]=p.charCodeAt(O)}var Re,$e,hi,Fr,Pn,fi,pi,_=[],dr=[],At=[];function hr(){var p=c.preRun.shift();_.unshift(p)}var Sr=0,ot=null;c.preloadedImages={},c.preloadedAudios={};function at(p){throw c.onAbort&&c.onAbort(p),te(p),Vt=!0,p=new WebAssembly.RuntimeError("abort("+p+"). Build with -s ASSERTIONS=1 for more info."),m(p),p}function uc(){return Wt.startsWith("data:application/octet-stream;base64,")}var Wt;if(Wt="olm.wasm",!uc()){var Ns=Wt;Wt=c.locateFile?c.locateFile(Ns,T):T+Ns}function dc(){var p=Wt;try{if(p==Wt&&ye)return new Uint8Array(ye);if(U)return U(p);throw"both async and sync fetching of the wasm failed"}catch(y){at(y)}}function yu(){if(!ye&&(C||S)){if(typeof fetch=="function"&&!Wt.startsWith("file://"))return fetch(Wt,{credentials:"same-origin"}).then(function(p){if(!p.ok)throw"failed to load wasm binary file at '"+Wt+"'";return p.arrayBuffer()}).catch(function(){return dc()});if(R)return new Promise(function(p,y){R(Wt,function(O){p(new Uint8Array(O))},y)})}return Promise.resolve().then(function(){return dc()})}var Mn,gi;function Ht(p){for(;0<p.length;){var y=p.shift();if(typeof y=="function")y(c);else{var O=y.cc;typeof O=="number"?y.bc===void 0?pi.get(O)():pi.get(O)(y.bc):O(y.bc===void 0?null:y.bc)}}}var Wo={a:function(p,y,O){$e.copyWithin(p,y,y+O)},b:function(){at("OOM")}};(function(){function p(K){c.asm=K.exports,Ye=c.asm.c,K=Ye.buffer,c.HEAP8=Re=new Int8Array(K),c.HEAP16=hi=new Int16Array(K),c.HEAP32=Fr=new Int32Array(K),c.HEAPU8=$e=new Uint8Array(K),c.HEAPU16=new Uint16Array(K),c.HEAPU32=new Uint32Array(K),c.HEAPF32=Pn=new Float32Array(K),c.HEAPF64=fi=new Float64Array(K),pi=c.asm.e,dr.unshift(c.asm.d),Sr--,c.monitorRunDependencies&&c.monitorRunDependencies(Sr),Sr==0&&ot&&(K=ot,ot=null,K())}function y(K){p(K.instance)}function O(K){return yu().then(function(ee){return WebAssembly.instantiate(ee,x)}).then(function(ee){return ee}).then(K,function(ee){te("failed to asynchronously prepare wasm: "+ee),at(ee)})}var x={a:Wo};if(Sr++,c.monitorRunDependencies&&c.monitorRunDependencies(Sr),c.instantiateWasm)try{return c.instantiateWasm(x,p)}catch(K){return te("Module.instantiateWasm callback failed with error: "+K),!1}return function(){return ye||typeof WebAssembly.instantiateStreaming!="function"||uc()||Wt.startsWith("file://")||typeof fetch!="function"?O(y):fetch(Wt,{credentials:"same-origin"}).then(function(K){return WebAssembly.instantiateStreaming(K,x).then(y,function(ee){return te("wasm streaming compile failed: "+ee),te("falling back to ArrayBuffer instantiation"),O(y)})})}().catch(m),{}})(),c.___wasm_call_ctors=function(){return(c.___wasm_call_ctors=c.asm.d).apply(null,arguments)},c._olm_pk_encryption_last_error=function(){return(c._olm_pk_encryption_last_error=c.asm.f).apply(null,arguments)},c.__olm_error_to_string=function(){return(c.__olm_error_to_string=c.asm.g).apply(null,arguments)},c._olm_pk_encryption_last_error_code=function(){return(c._olm_pk_encryption_last_error_code=c.asm.h).apply(null,arguments)},c._olm_pk_encryption_size=function(){return(c._olm_pk_encryption_size=c.asm.i).apply(null,arguments)},c._olm_pk_encryption=function(){return(c._olm_pk_encryption=c.asm.j).apply(null,arguments)},c._olm_clear_pk_encryption=function(){return(c._olm_clear_pk_encryption=c.asm.k).apply(null,arguments)},c._olm_pk_encryption_set_recipient_key=function(){return(c._olm_pk_encryption_set_recipient_key=c.asm.l).apply(null,arguments)},c._olm_pk_key_length=function(){return(c._olm_pk_key_length=c.asm.m).apply(null,arguments)},c._olm_pk_ciphertext_length=function(){return(c._olm_pk_ciphertext_length=c.asm.n).apply(null,arguments)},c._olm_pk_mac_length=function(){return(c._olm_pk_mac_length=c.asm.o).apply(null,arguments)},c._olm_pk_encrypt_random_length=function(){return(c._olm_pk_encrypt_random_length=c.asm.p).apply(null,arguments)},c._olm_pk_encrypt=function(){return(c._olm_pk_encrypt=c.asm.q).apply(null,arguments)},c._olm_pk_decryption_last_error=function(){return(c._olm_pk_decryption_last_error=c.asm.r).apply(null,arguments)},c._olm_pk_decryption_last_error_code=function(){return(c._olm_pk_decryption_last_error_code=c.asm.s).apply(null,arguments)},c._olm_pk_decryption_size=function(){return(c._olm_pk_decryption_size=c.asm.t).apply(null,arguments)},c._olm_pk_decryption=function(){return(c._olm_pk_decryption=c.asm.u).apply(null,arguments)},c._olm_clear_pk_decryption=function(){return(c._olm_clear_pk_decryption=c.asm.v).apply(null,arguments)},c._olm_pk_private_key_length=function(){return(c._olm_pk_private_key_length=c.asm.w).apply(null,arguments)},c._olm_pk_generate_key_random_length=function(){return(c._olm_pk_generate_key_random_length=c.asm.x).apply(null,arguments)},c._olm_pk_key_from_private=function(){return(c._olm_pk_key_from_private=c.asm.y).apply(null,arguments)},c._olm_pk_generate_key=function(){return(c._olm_pk_generate_key=c.asm.z).apply(null,arguments)},c._olm_pickle_pk_decryption_length=function(){return(c._olm_pickle_pk_decryption_length=c.asm.A).apply(null,arguments)},c._olm_pickle_pk_decryption=function(){return(c._olm_pickle_pk_decryption=c.asm.B).apply(null,arguments)},c._olm_unpickle_pk_decryption=function(){return(c._olm_unpickle_pk_decryption=c.asm.C).apply(null,arguments)},c._olm_pk_max_plaintext_length=function(){return(c._olm_pk_max_plaintext_length=c.asm.D).apply(null,arguments)},c._olm_pk_decrypt=function(){return(c._olm_pk_decrypt=c.asm.E).apply(null,arguments)},c._olm_pk_get_private_key=function(){return(c._olm_pk_get_private_key=c.asm.F).apply(null,arguments)},c._olm_pk_signing_size=function(){return(c._olm_pk_signing_size=c.asm.G).apply(null,arguments)},c._olm_pk_signing=function(){return(c._olm_pk_signing=c.asm.H).apply(null,arguments)},c._olm_pk_signing_last_error=function(){return(c._olm_pk_signing_last_error=c.asm.I).apply(null,arguments)},c._olm_pk_signing_last_error_code=function(){return(c._olm_pk_signing_last_error_code=c.asm.J).apply(null,arguments)},c._olm_clear_pk_signing=function(){return(c._olm_clear_pk_signing=c.asm.K).apply(null,arguments)},c._olm_pk_signing_seed_length=function(){return(c._olm_pk_signing_seed_length=c.asm.L).apply(null,arguments)},c._olm_pk_signing_public_key_length=function(){return(c._olm_pk_signing_public_key_length=c.asm.M).apply(null,arguments)},c._olm_pk_signing_key_from_seed=function(){return(c._olm_pk_signing_key_from_seed=c.asm.N).apply(null,arguments)},c._olm_pk_signature_length=function(){return(c._olm_pk_signature_length=c.asm.O).apply(null,arguments)},c._olm_pk_sign=function(){return(c._olm_pk_sign=c.asm.P).apply(null,arguments)},c._olm_get_library_version=function(){return(c._olm_get_library_version=c.asm.Q).apply(null,arguments)},c._olm_error=function(){return(c._olm_error=c.asm.R).apply(null,arguments)},c._olm_account_last_error=function(){return(c._olm_account_last_error=c.asm.S).apply(null,arguments)},c._olm_account_last_error_code=function(){return(c._olm_account_last_error_code=c.asm.T).apply(null,arguments)},c._olm_session_last_error=function(){return(c._olm_session_last_error=c.asm.U).apply(null,arguments)},c._olm_session_last_error_code=function(){return(c._olm_session_last_error_code=c.asm.V).apply(null,arguments)},c._olm_utility_last_error=function(){return(c._olm_utility_last_error=c.asm.W).apply(null,arguments)},c._olm_utility_last_error_code=function(){return(c._olm_utility_last_error_code=c.asm.X).apply(null,arguments)},c._olm_account_size=function(){return(c._olm_account_size=c.asm.Y).apply(null,arguments)},c._olm_session_size=function(){return(c._olm_session_size=c.asm.Z).apply(null,arguments)},c._olm_utility_size=function(){return(c._olm_utility_size=c.asm._).apply(null,arguments)},c._olm_account=function(){return(c._olm_account=c.asm.$).apply(null,arguments)},c._olm_session=function(){return(c._olm_session=c.asm.aa).apply(null,arguments)},c._olm_utility=function(){return(c._olm_utility=c.asm.ba).apply(null,arguments)},c._olm_clear_account=function(){return(c._olm_clear_account=c.asm.ca).apply(null,arguments)},c._olm_clear_session=function(){return(c._olm_clear_session=c.asm.da).apply(null,arguments)},c._olm_clear_utility=function(){return(c._olm_clear_utility=c.asm.ea).apply(null,arguments)},c._olm_pickle_account_length=function(){return(c._olm_pickle_account_length=c.asm.fa).apply(null,arguments)},c._olm_pickle_session_length=function(){return(c._olm_pickle_session_length=c.asm.ga).apply(null,arguments)},c._olm_pickle_account=function(){return(c._olm_pickle_account=c.asm.ha).apply(null,arguments)},c._olm_pickle_session=function(){return(c._olm_pickle_session=c.asm.ia).apply(null,arguments)},c._olm_unpickle_account=function(){return(c._olm_unpickle_account=c.asm.ja).apply(null,arguments)},c._olm_unpickle_session=function(){return(c._olm_unpickle_session=c.asm.ka).apply(null,arguments)},c._olm_create_account_random_length=function(){return(c._olm_create_account_random_length=c.asm.la).apply(null,arguments)},c._olm_create_account=function(){return(c._olm_create_account=c.asm.ma).apply(null,arguments)},c._olm_account_identity_keys_length=function(){return(c._olm_account_identity_keys_length=c.asm.na).apply(null,arguments)},c._olm_account_identity_keys=function(){return(c._olm_account_identity_keys=c.asm.oa).apply(null,arguments)},c._olm_account_signature_length=function(){return(c._olm_account_signature_length=c.asm.pa).apply(null,arguments)},c._olm_account_sign=function(){return(c._olm_account_sign=c.asm.qa).apply(null,arguments)},c._olm_account_one_time_keys_length=function(){return(c._olm_account_one_time_keys_length=c.asm.ra).apply(null,arguments)},c._olm_account_one_time_keys=function(){return(c._olm_account_one_time_keys=c.asm.sa).apply(null,arguments)},c._olm_account_mark_keys_as_published=function(){return(c._olm_account_mark_keys_as_published=c.asm.ta).apply(null,arguments)},c._olm_account_max_number_of_one_time_keys=function(){return(c._olm_account_max_number_of_one_time_keys=c.asm.ua).apply(null,arguments)},c._olm_account_generate_one_time_keys_random_length=function(){return(c._olm_account_generate_one_time_keys_random_length=c.asm.va).apply(null,arguments)},c._olm_account_generate_one_time_keys=function(){return(c._olm_account_generate_one_time_keys=c.asm.wa).apply(null,arguments)},c._olm_account_generate_fallback_key_random_length=function(){return(c._olm_account_generate_fallback_key_random_length=c.asm.xa).apply(null,arguments)},c._olm_account_generate_fallback_key=function(){return(c._olm_account_generate_fallback_key=c.asm.ya).apply(null,arguments)},c._olm_account_fallback_key_length=function(){return(c._olm_account_fallback_key_length=c.asm.za).apply(null,arguments)},c._olm_account_fallback_key=function(){return(c._olm_account_fallback_key=c.asm.Aa).apply(null,arguments)},c._olm_account_unpublished_fallback_key_length=function(){return(c._olm_account_unpublished_fallback_key_length=c.asm.Ba).apply(null,arguments)},c._olm_account_unpublished_fallback_key=function(){return(c._olm_account_unpublished_fallback_key=c.asm.Ca).apply(null,arguments)},c._olm_account_forget_old_fallback_key=function(){return(c._olm_account_forget_old_fallback_key=c.asm.Da).apply(null,arguments)},c._olm_create_outbound_session_random_length=function(){return(c._olm_create_outbound_session_random_length=c.asm.Ea).apply(null,arguments)},c._olm_create_outbound_session=function(){return(c._olm_create_outbound_session=c.asm.Fa).apply(null,arguments)},c._olm_create_inbound_session=function(){return(c._olm_create_inbound_session=c.asm.Ga).apply(null,arguments)},c._olm_create_inbound_session_from=function(){return(c._olm_create_inbound_session_from=c.asm.Ha).apply(null,arguments)},c._olm_session_id_length=function(){return(c._olm_session_id_length=c.asm.Ia).apply(null,arguments)},c._olm_session_id=function(){return(c._olm_session_id=c.asm.Ja).apply(null,arguments)},c._olm_session_has_received_message=function(){return(c._olm_session_has_received_message=c.asm.Ka).apply(null,arguments)},c._olm_session_describe=function(){return(c._olm_session_describe=c.asm.La).apply(null,arguments)},c._olm_matches_inbound_session=function(){return(c._olm_matches_inbound_session=c.asm.Ma).apply(null,arguments)},c._olm_matches_inbound_session_from=function(){return(c._olm_matches_inbound_session_from=c.asm.Na).apply(null,arguments)},c._olm_remove_one_time_keys=function(){return(c._olm_remove_one_time_keys=c.asm.Oa).apply(null,arguments)},c._olm_encrypt_message_type=function(){return(c._olm_encrypt_message_type=c.asm.Pa).apply(null,arguments)},c._olm_encrypt_random_length=function(){return(c._olm_encrypt_random_length=c.asm.Qa).apply(null,arguments)},c._olm_encrypt_message_length=function(){return(c._olm_encrypt_message_length=c.asm.Ra).apply(null,arguments)},c._olm_encrypt=function(){return(c._olm_encrypt=c.asm.Sa).apply(null,arguments)},c._olm_decrypt_max_plaintext_length=function(){return(c._olm_decrypt_max_plaintext_length=c.asm.Ta).apply(null,arguments)},c._olm_decrypt=function(){return(c._olm_decrypt=c.asm.Ua).apply(null,arguments)},c._olm_sha256_length=function(){return(c._olm_sha256_length=c.asm.Va).apply(null,arguments)},c._olm_sha256=function(){return(c._olm_sha256=c.asm.Wa).apply(null,arguments)},c._olm_ed25519_verify=function(){return(c._olm_ed25519_verify=c.asm.Xa).apply(null,arguments)},c._olm_inbound_group_session_size=function(){return(c._olm_inbound_group_session_size=c.asm.Ya).apply(null,arguments)},c._olm_inbound_group_session=function(){return(c._olm_inbound_group_session=c.asm.Za).apply(null,arguments)},c._olm_clear_inbound_group_session=function(){return(c._olm_clear_inbound_group_session=c.asm._a).apply(null,arguments)},c._olm_inbound_group_session_last_error=function(){return(c._olm_inbound_group_session_last_error=c.asm.$a).apply(null,arguments)},c._olm_inbound_group_session_last_error_code=function(){return(c._olm_inbound_group_session_last_error_code=c.asm.ab).apply(null,arguments)},c._olm_init_inbound_group_session=function(){return(c._olm_init_inbound_group_session=c.asm.bb).apply(null,arguments)},c._olm_import_inbound_group_session=function(){return(c._olm_import_inbound_group_session=c.asm.cb).apply(null,arguments)},c._olm_pickle_inbound_group_session_length=function(){return(c._olm_pickle_inbound_group_session_length=c.asm.db).apply(null,arguments)},c._olm_pickle_inbound_group_session=function(){return(c._olm_pickle_inbound_group_session=c.asm.eb).apply(null,arguments)},c._olm_unpickle_inbound_group_session=function(){return(c._olm_unpickle_inbound_group_session=c.asm.fb).apply(null,arguments)},c._olm_group_decrypt_max_plaintext_length=function(){return(c._olm_group_decrypt_max_plaintext_length=c.asm.gb).apply(null,arguments)},c._olm_group_decrypt=function(){return(c._olm_group_decrypt=c.asm.hb).apply(null,arguments)},c._olm_inbound_group_session_id_length=function(){return(c._olm_inbound_group_session_id_length=c.asm.ib).apply(null,arguments)},c._olm_inbound_group_session_id=function(){return(c._olm_inbound_group_session_id=c.asm.jb).apply(null,arguments)},c._olm_inbound_group_session_first_known_index=function(){return(c._olm_inbound_group_session_first_known_index=c.asm.kb).apply(null,arguments)},c._olm_inbound_group_session_is_verified=function(){return(c._olm_inbound_group_session_is_verified=c.asm.lb).apply(null,arguments)},c._olm_export_inbound_group_session_length=function(){return(c._olm_export_inbound_group_session_length=c.asm.mb).apply(null,arguments)},c._olm_export_inbound_group_session=function(){return(c._olm_export_inbound_group_session=c.asm.nb).apply(null,arguments)},c._olm_sas_last_error=function(){return(c._olm_sas_last_error=c.asm.ob).apply(null,arguments)},c._olm_sas_last_error_code=function(){return(c._olm_sas_last_error_code=c.asm.pb).apply(null,arguments)},c._olm_sas_size=function(){return(c._olm_sas_size=c.asm.qb).apply(null,arguments)},c._olm_sas=function(){return(c._olm_sas=c.asm.rb).apply(null,arguments)},c._olm_clear_sas=function(){return(c._olm_clear_sas=c.asm.sb).apply(null,arguments)},c._olm_create_sas_random_length=function(){return(c._olm_create_sas_random_length=c.asm.tb).apply(null,arguments)},c._olm_create_sas=function(){return(c._olm_create_sas=c.asm.ub).apply(null,arguments)},c._olm_sas_pubkey_length=function(){return(c._olm_sas_pubkey_length=c.asm.vb).apply(null,arguments)},c._olm_sas_get_pubkey=function(){return(c._olm_sas_get_pubkey=c.asm.wb).apply(null,arguments)},c._olm_sas_set_their_key=function(){return(c._olm_sas_set_their_key=c.asm.xb).apply(null,arguments)},c._olm_sas_is_their_key_set=function(){return(c._olm_sas_is_their_key_set=c.asm.yb).apply(null,arguments)},c._olm_sas_generate_bytes=function(){return(c._olm_sas_generate_bytes=c.asm.zb).apply(null,arguments)},c._olm_sas_mac_length=function(){return(c._olm_sas_mac_length=c.asm.Ab).apply(null,arguments)},c._olm_sas_calculate_mac_fixed_base64=function(){return(c._olm_sas_calculate_mac_fixed_base64=c.asm.Bb).apply(null,arguments)},c._olm_sas_calculate_mac=function(){return(c._olm_sas_calculate_mac=c.asm.Cb).apply(null,arguments)},c._olm_sas_calculate_mac_long_kdf=function(){return(c._olm_sas_calculate_mac_long_kdf=c.asm.Db).apply(null,arguments)},c._olm_outbound_group_session_size=function(){return(c._olm_outbound_group_session_size=c.asm.Eb).apply(null,arguments)},c._olm_outbound_group_session=function(){return(c._olm_outbound_group_session=c.asm.Fb).apply(null,arguments)},c._olm_clear_outbound_group_session=function(){return(c._olm_clear_outbound_group_session=c.asm.Gb).apply(null,arguments)},c._olm_outbound_group_session_last_error=function(){return(c._olm_outbound_group_session_last_error=c.asm.Hb).apply(null,arguments)},c._olm_outbound_group_session_last_error_code=function(){return(c._olm_outbound_group_session_last_error_code=c.asm.Ib).apply(null,arguments)},c._olm_pickle_outbound_group_session_length=function(){return(c._olm_pickle_outbound_group_session_length=c.asm.Jb).apply(null,arguments)},c._olm_pickle_outbound_group_session=function(){return(c._olm_pickle_outbound_group_session=c.asm.Kb).apply(null,arguments)},c._olm_unpickle_outbound_group_session=function(){return(c._olm_unpickle_outbound_group_session=c.asm.Lb).apply(null,arguments)},c._olm_init_outbound_group_session_random_length=function(){return(c._olm_init_outbound_group_session_random_length=c.asm.Mb).apply(null,arguments)},c._olm_init_outbound_group_session=function(){return(c._olm_init_outbound_group_session=c.asm.Nb).apply(null,arguments)},c._olm_group_encrypt_message_length=function(){return(c._olm_group_encrypt_message_length=c.asm.Ob).apply(null,arguments)},c._olm_group_encrypt=function(){return(c._olm_group_encrypt=c.asm.Pb).apply(null,arguments)},c._olm_outbound_group_session_id_length=function(){return(c._olm_outbound_group_session_id_length=c.asm.Qb).apply(null,arguments)},c._olm_outbound_group_session_id=function(){return(c._olm_outbound_group_session_id=c.asm.Rb).apply(null,arguments)},c._olm_outbound_group_session_message_index=function(){return(c._olm_outbound_group_session_message_index=c.asm.Sb).apply(null,arguments)},c._olm_outbound_group_session_key_length=function(){return(c._olm_outbound_group_session_key_length=c.asm.Tb).apply(null,arguments)},c._olm_outbound_group_session_key=function(){return(c._olm_outbound_group_session_key=c.asm.Ub).apply(null,arguments)},c._malloc=function(){return(c._malloc=c.asm.Vb).apply(null,arguments)},c._free=function(){return(c._free=c.asm.Wb).apply(null,arguments)};var hc=c.stackSave=function(){return(hc=c.stackSave=c.asm.Xb).apply(null,arguments)},qr=c.stackRestore=function(){return(qr=c.stackRestore=c.asm.Yb).apply(null,arguments)},fc=c.stackAlloc=function(){return(fc=c.stackAlloc=c.asm.Zb).apply(null,arguments)};c.ALLOC_STACK=1;var v;ot=function p(){v||d(),v||(ot=p)};function d(){function p(){if(!v&&(v=!0,c.calledRun=!0,!Vt)){if(Ht(dr),g(c),c.onRuntimeInitialized&&c.onRuntimeInitialized(),c.postRun)for(typeof c.postRun=="function"&&(c.postRun=[c.postRun]);c.postRun.length;){var y=c.postRun.shift();At.unshift(y)}Ht(At)}}if(!(0<Sr)){if(c.preRun)for(typeof c.preRun=="function"&&(c.preRun=[c.preRun]);c.preRun.length;)hr();Ht(_),0<Sr||(c.setStatus?(c.setStatus("Running..."),setTimeout(function(){setTimeout(function(){c.setStatus("")},1),p()},1)):p())}}if(c.run=d,c.preInit)for(typeof c.preInit=="function"&&(c.preInit=[c.preInit]);0<c.preInit.length;)c.preInit.pop()();d();function h(){var p=c._olm_outbound_group_session_size();this.ac=Ve(p),this.$b=c._olm_outbound_group_session(this.ac)}function b(p){return function(){var y=p.apply(this,arguments);if(y===nn)throw y=Q(c._olm_outbound_group_session_last_error(arguments[0])),Error("OLM."+y);return y}}h.prototype.free=function(){c._olm_clear_outbound_group_session(this.$b),Ge(this.$b)},h.prototype.pickle=z(function(p){p=ce(p);var y=b(c._olm_pickle_outbound_group_session_length)(this.$b),O=j(p),x=j(y+1);try{b(c._olm_pickle_outbound_group_session)(this.$b,O,p.length,x,y)}finally{for(le(O,p.length),O=0;O<p.length;O++)p[O]=0}return Q(x,y)}),h.prototype.unpickle=z(function(p,y){p=ce(p);var O=j(p);y=ce(y);var x=j(y);try{b(c._olm_unpickle_outbound_group_session)(this.$b,O,p.length,x,y.length)}finally{for(le(O,p.length),O=0;O<p.length;O++)p[O]=0}}),h.prototype.create=z(function(){var p=b(c._olm_init_outbound_group_session_random_length)(this.$b),y=br(p,f);try{b(c._olm_init_outbound_group_session)(this.$b,y,p)}finally{le(y,p)}}),h.prototype.encrypt=function(p){try{var y=Kr(p),O=b(c._olm_group_encrypt_message_length)(this.$b,y),x=Ve(y+1);rn(p,$e,x,y+1);var K=Ve(O+1);return b(c._olm_group_encrypt)(this.$b,x,y,K,O),we(K+O),Q(K,O)}finally{x!==void 0&&(le(x,y+1),Ge(x)),K!==void 0&&Ge(K)}},h.prototype.session_id=z(function(){var p=b(c._olm_outbound_group_session_id_length)(this.$b),y=j(p+1);return b(c._olm_outbound_group_session_id)(this.$b,y,p),Q(y,p)}),h.prototype.session_key=z(function(){var p=b(c._olm_outbound_group_session_key_length)(this.$b),y=j(p+1);b(c._olm_outbound_group_session_key)(this.$b,y,p);var O=Q(y,p);return le(y,p),O}),h.prototype.message_index=function(){return b(c._olm_outbound_group_session_message_index)(this.$b)},r.OutboundGroupSession=h;function P(){var p=c._olm_inbound_group_session_size();this.ac=Ve(p),this.$b=c._olm_inbound_group_session(this.ac)}function A(p){return function(){var y=p.apply(this,arguments);if(y===nn)throw y=Q(c._olm_inbound_group_session_last_error(arguments[0])),Error("OLM."+y);return y}}P.prototype.free=function(){c._olm_clear_inbound_group_session(this.$b),Ge(this.$b)},P.prototype.pickle=z(function(p){p=ce(p);var y=A(c._olm_pickle_inbound_group_session_length)(this.$b),O=j(p),x=j(y+1);try{A(c._olm_pickle_inbound_group_session)(this.$b,O,p.length,x,y)}finally{for(le(O,p.length),O=0;O<p.length;O++)p[O]=0}return Q(x,y)}),P.prototype.unpickle=z(function(p,y){p=ce(p);var O=j(p);y=ce(y);var x=j(y);try{A(c._olm_unpickle_inbound_group_session)(this.$b,O,p.length,x,y.length)}finally{for(le(O,p.length),O=0;O<p.length;O++)p[O]=0}}),P.prototype.create=z(function(p){p=ce(p);var y=j(p);try{A(c._olm_init_inbound_group_session)(this.$b,y,p.length)}finally{for(le(y,p.length),y=0;y<p.length;y++)p[y]=0}}),P.prototype.import_session=z(function(p){p=ce(p);var y=j(p);try{A(c._olm_import_inbound_group_session)(this.$b,y,p.length)}finally{for(le(y,p.length),y=0;y<p.length;y++)p[y]=0}}),P.prototype.decrypt=z(function(p){try{var y=Ve(p.length);di(p,y);var O=A(c._olm_group_decrypt_max_plaintext_length)(this.$b,y,p.length);di(p,y);var x=Ve(O+1),K=j(4),ee=A(c._olm_group_decrypt)(this.$b,y,p.length,x,O,K);return we(x+ee),{plaintext:Q(x,ee),message_index:Te(K,"i32")}}finally{y!==void 0&&Ge(y),x!==void 0&&(le(x,ee),Ge(x))}}),P.prototype.session_id=z(function(){var p=A(c._olm_inbound_group_session_id_length)(this.$b),y=j(p+1);return A(c._olm_inbound_group_session_id)(this.$b,y,p),Q(y,p)}),P.prototype.first_known_index=z(function(){return A(c._olm_inbound_group_session_first_known_index)(this.$b)}),P.prototype.export_session=z(function(p){var y=A(c._olm_export_inbound_group_session_length)(this.$b),O=j(y+1);return b(c._olm_export_inbound_group_session)(this.$b,O,y,p),p=Q(O,y),le(O,y),p}),r.InboundGroupSession=P;function $(){var p=c._olm_pk_encryption_size();this.ac=Ve(p),this.$b=c._olm_pk_encryption(this.ac)}function ne(p){return function(){var y=p.apply(this,arguments);if(y===nn)throw y=Q(c._olm_pk_encryption_last_error(arguments[0])),Error("OLM."+y);return y}}$.prototype.free=function(){c._olm_clear_pk_encryption(this.$b),Ge(this.$b)},$.prototype.set_recipient_key=z(function(p){p=ce(p);var y=j(p);ne(c._olm_pk_encryption_set_recipient_key)(this.$b,y,p.length)}),$.prototype.encrypt=z(function(p){try{var y=Kr(p),O=Ve(y+1);rn(p,$e,O,y+1);var x=ne(c._olm_pk_encrypt_random_length)(),K=br(x,f),ee=ne(c._olm_pk_ciphertext_length)(this.$b,y),_e=Ve(ee+1),Dt=ne(c._olm_pk_mac_length)(this.$b),Ho=j(Dt+1);we(Ho+Dt);var Ki=ne(c._olm_pk_key_length)(),sn=j(Ki+1);return we(sn+Ki),ne(c._olm_pk_encrypt)(this.$b,O,y,_e,ee,Ho,Dt,sn,Ki,K,x),we(_e+ee),{ciphertext:Q(_e,ee),mac:Q(Ho,Dt),ephemeral:Q(sn,Ki)}}finally{K!==void 0&&le(K,x),O!==void 0&&(le(O,y+1),Ge(O)),_e!==void 0&&Ge(_e)}});function Ie(){var p=c._olm_pk_decryption_size();this.ac=Ve(p),this.$b=c._olm_pk_decryption(this.ac)}function de(p){return function(){var y=p.apply(this,arguments);if(y===nn)throw y=Q(c._olm_pk_decryption_last_error(arguments[0])),Error("OLM."+y);return y}}Ie.prototype.free=function(){c._olm_clear_pk_decryption(this.$b),Ge(this.$b)},Ie.prototype.init_with_private_key=z(function(p){var y=j(p.length);c.HEAPU8.set(p,y);var O=de(c._olm_pk_key_length)(),x=j(O+1);try{de(c._olm_pk_key_from_private)(this.$b,x,O,y,p.length)}finally{le(y,p.length)}return Q(x,O)}),Ie.prototype.generate_key=z(function(){var p=de(c._olm_pk_private_key_length)(),y=br(p,f),O=de(c._olm_pk_key_length)(),x=j(O+1);try{de(c._olm_pk_key_from_private)(this.$b,x,O,y,p)}finally{le(y,p)}return Q(x,O)}),Ie.prototype.get_private_key=z(function(){var p=ne(c._olm_pk_private_key_length)(),y=j(p);de(c._olm_pk_get_private_key)(this.$b,y,p);var O=new Uint8Array(new Uint8Array(c.HEAPU8.buffer,y,p));return le(y,p),O}),Ie.prototype.pickle=z(function(p){p=ce(p);var y=de(c._olm_pickle_pk_decryption_length)(this.$b),O=j(p),x=j(y+1);try{de(c._olm_pickle_pk_decryption)(this.$b,O,p.length,x,y)}finally{for(le(O,p.length),O=0;O<p.length;O++)p[O]=0}return Q(x,y)}),Ie.prototype.unpickle=z(function(p,y){p=ce(p);var O=j(p),x=ce(y),K=j(x);y=de(c._olm_pk_key_length)();var ee=j(y+1);try{de(c._olm_unpickle_pk_decryption)(this.$b,O,p.length,K,x.length,ee,y)}finally{for(le(O,p.length),O=0;O<p.length;O++)p[O]=0}return Q(ee,y)}),Ie.prototype.decrypt=z(function(p,y,O){try{var x=Kr(O),K=Ve(x+1);rn(O,$e,K,x+1);var ee=ce(p),_e=j(ee),Dt=ce(y),Ho=j(Dt),Ki=de(c._olm_pk_max_plaintext_length)(this.$b,x),sn=Ve(Ki+1),_u=de(c._olm_pk_decrypt)(this.$b,_e,ee.length,Ho,Dt.length,K,x,sn,Ki);return we(sn+_u),Q(sn,_u)}finally{sn!==void 0&&(le(sn,_u+1),Ge(sn)),K!==void 0&&Ge(K)}});function ke(){var p=c._olm_pk_signing_size();this.ac=Ve(p),this.$b=c._olm_pk_signing(this.ac)}function ve(p){return function(){var y=p.apply(this,arguments);if(y===nn)throw y=Q(c._olm_pk_signing_last_error(arguments[0])),Error("OLM."+y);return y}}ke.prototype.free=function(){c._olm_clear_pk_signing(this.$b),Ge(this.$b)},ke.prototype.init_with_seed=z(function(p){var y=j(p.length);c.HEAPU8.set(p,y);var O=ve(c._olm_pk_signing_public_key_length)(),x=j(O+1);try{ve(c._olm_pk_signing_key_from_seed)(this.$b,x,O,y,p.length)}finally{le(y,p.length)}return Q(x,O)}),ke.prototype.generate_seed=z(function(){var p=ve(c._olm_pk_signing_seed_length)(),y=br(p,f),O=new Uint8Array(new Uint8Array(c.HEAPU8.buffer,y,p));return le(y,p),O}),ke.prototype.sign=z(function(p){try{var y=Kr(p),O=Ve(y+1);rn(p,$e,O,y+1);var x=ve(c._olm_pk_signature_length)(),K=j(x+1);return ve(c._olm_pk_sign)(this.$b,O,y,K,x),Q(K,x)}finally{O!==void 0&&(le(O,y+1),Ge(O))}});function mi(){var p=c._olm_sas_size(),y=c._olm_create_sas_random_length(),O=br(y,f);this.ac=Ve(p),this.$b=c._olm_sas(this.ac),c._olm_create_sas(this.$b,O,y),le(O,y)}function An(p){return function(){var y=p.apply(this,arguments);if(y===nn)throw y=Q(c._olm_sas_last_error(arguments[0])),Error("OLM."+y);return y}}mi.prototype.free=function(){c._olm_clear_sas(this.$b),Ge(this.$b)},mi.prototype.get_pubkey=z(function(){var p=An(c._olm_sas_pubkey_length)(this.$b),y=j(p+1);return An(c._olm_sas_get_pubkey)(this.$b,y,p),Q(y,p)}),mi.prototype.set_their_key=z(function(p){p=ce(p);var y=j(p);An(c._olm_sas_set_their_key)(this.$b,y,p.length)}),mi.prototype.is_their_key_set=z(function(){return!!An(c._olm_sas_is_their_key_set)(this.$b)}),mi.prototype.generate_bytes=z(function(p,y){p=ce(p);var O=j(p),x=j(y);return An(c._olm_sas_generate_bytes)(this.$b,O,p.length,x,y),new Uint8Array(new Uint8Array(c.HEAPU8.buffer,x,y))}),mi.prototype.calculate_mac=z(function(p,y){p=ce(p);var O=j(p);y=ce(y);var x=j(y),K=An(c._olm_sas_mac_length)(this.$b),ee=j(K+1);return An(c._olm_sas_calculate_mac)(this.$b,O,p.length,x,y.length,ee,K),Q(ee,K)}),mi.prototype.calculate_mac_long_kdf=z(function(p,y){p=ce(p);var O=j(p);y=ce(y);var x=j(y),K=An(c._olm_sas_mac_length)(this.$b),ee=j(K+1);return An(c._olm_sas_calculate_mac_long_kdf)(this.$b,O,p.length,x,y.length,ee,K),Q(ee,K)});var Ve=c._malloc,Ge=c._free,nn;function br(p,y){var O=fc(p);return y(new Uint8Array(c.HEAPU8.buffer,O,p)),O}function j(p){return typeof p=="number"?br(p,function(y){y.fill(0)}):br(p.length,function(y){y.set(p)})}function ce(p){if(p instanceof Uint8Array)var y=p;else y=Array(Kr(p)+1),p=rn(p,y,0,y.length),y.length=p;return y}function z(p){return function(){var y=hc();try{return p.apply(this,arguments)}finally{qr(y)}}}function le(p,y){for(;0<y--;)c.HEAP8[p++]=0}function Rt(){var p=c._olm_account_size();this.ac=Ve(p),this.$b=c._olm_account(this.ac)}function We(p){return function(){var y=p.apply(this,arguments);if(y===nn)throw y=Q(c._olm_account_last_error(arguments[0])),Error("OLM."+y);return y}}Rt.prototype.free=function(){c._olm_clear_account(this.$b),Ge(this.$b)},Rt.prototype.create=z(function(){var p=We(c._olm_create_account_random_length)(this.$b),y=br(p,f);try{We(c._olm_create_account)(this.$b,y,p)}finally{le(y,p)}}),Rt.prototype.identity_keys=z(function(){var p=We(c._olm_account_identity_keys_length)(this.$b),y=j(p+1);return We(c._olm_account_identity_keys)(this.$b,y,p),Q(y,p)}),Rt.prototype.sign=z(function(p){var y=We(c._olm_account_signature_length)(this.$b);p=ce(p);var O=j(p),x=j(y+1);try{We(c._olm_account_sign)(this.$b,O,p.length,x,y)}finally{for(le(O,p.length),O=0;O<p.length;O++)p[O]=0}return Q(x,y)}),Rt.prototype.one_time_keys=z(function(){var p=We(c._olm_account_one_time_keys_length)(this.$b),y=j(p+1);return We(c._olm_account_one_time_keys)(this.$b,y,p),Q(y,p)}),Rt.prototype.mark_keys_as_published=z(function(){We(c._olm_account_mark_keys_as_published)(this.$b)}),Rt.prototype.max_number_of_one_time_keys=z(function(){return We(c._olm_account_max_number_of_one_time_keys)(this.$b)}),Rt.prototype.generate_one_time_keys=z(function(p){var y=We(c._olm_account_generate_one_time_keys_random_length)(this.$b,p),O=br(y,f);try{We(c._olm_account_generate_one_time_keys)(this.$b,p,O,y)}finally{le(O,y)}}),Rt.prototype.remove_one_time_keys=z(function(p){We(c._olm_remove_one_time_keys)(this.$b,p.$b)}),Rt.prototype.generate_fallback_key=z(function(){var p=We(c._olm_account_generate_fallback_key_random_length)(this.$b),y=br(p,f);try{We(c._olm_account_generate_fallback_key)(this.$b,y,p)}finally{le(y,p)}}),Rt.prototype.fallback_key=z(function(){var p=We(c._olm_account_fallback_key_length)(this.$b),y=j(p+1);return We(c._olm_account_fallback_key)(this.$b,y,p),Q(y,p)}),Rt.prototype.unpublished_fallback_key=z(function(){var p=We(c._olm_account_unpublished_fallback_key_length)(this.$b),y=j(p+1);return We(c._olm_account_unpublished_fallback_key)(this.$b,y,p),Q(y,p)}),Rt.prototype.forget_old_fallback_key=z(function(){We(c._olm_account_forget_old_fallback_key)(this.$b)}),Rt.prototype.pickle=z(function(p){p=ce(p);var y=We(c._olm_pickle_account_length)(this.$b),O=j(p),x=j(y+1);try{We(c._olm_pickle_account)(this.$b,O,p.length,x,y)}finally{for(le(O,p.length),O=0;O<p.length;O++)p[O]=0}return Q(x,y)}),Rt.prototype.unpickle=z(function(p,y){p=ce(p);var O=j(p);y=ce(y);var x=j(y);try{We(c._olm_unpickle_account)(this.$b,O,p.length,x,y.length)}finally{for(le(O,p.length),O=0;O<p.length;O++)p[O]=0}});function Yt(){var p=c._olm_session_size();this.ac=Ve(p),this.$b=c._olm_session(this.ac)}function ct(p){return function(){var y=p.apply(this,arguments);if(y===nn)throw y=Q(c._olm_session_last_error(arguments[0])),Error("OLM."+y);return y}}Yt.prototype.free=function(){c._olm_clear_session(this.$b),Ge(this.$b)},Yt.prototype.pickle=z(function(p){p=ce(p);var y=ct(c._olm_pickle_session_length)(this.$b),O=j(p),x=j(y+1);try{ct(c._olm_pickle_session)(this.$b,O,p.length,x,y)}finally{for(le(O,p.length),O=0;O<p.length;O++)p[O]=0}return Q(x,y)}),Yt.prototype.unpickle=z(function(p,y){p=ce(p);var O=j(p);y=ce(y);var x=j(y);try{ct(c._olm_unpickle_session)(this.$b,O,p.length,x,y.length)}finally{for(le(O,p.length),O=0;O<p.length;O++)p[O]=0}}),Yt.prototype.create_outbound=z(function(p,y,O){var x=ct(c._olm_create_outbound_session_random_length)(this.$b),K=br(x,f);y=ce(y),O=ce(O);var ee=j(y),_e=j(O);try{ct(c._olm_create_outbound_session)(this.$b,p.$b,ee,y.length,_e,O.length,K,x)}finally{le(K,x)}}),Yt.prototype.create_inbound=z(function(p,y){y=ce(y);var O=j(y);try{ct(c._olm_create_inbound_session)(this.$b,p.$b,O,y.length)}finally{for(le(O,y.length),p=0;p<y.length;p++)y[p]=0}}),Yt.prototype.create_inbound_from=z(function(p,y,O){y=ce(y);var x=j(y);O=ce(O);var K=j(O);try{ct(c._olm_create_inbound_session_from)(this.$b,p.$b,x,y.length,K,O.length)}finally{for(le(K,O.length),p=0;p<O.length;p++)O[p]=0}}),Yt.prototype.session_id=z(function(){var p=ct(c._olm_session_id_length)(this.$b),y=j(p+1);return ct(c._olm_session_id)(this.$b,y,p),Q(y,p)}),Yt.prototype.has_received_message=function(){return!!ct(c._olm_session_has_received_message)(this.$b)},Yt.prototype.matches_inbound=z(function(p){p=ce(p);var y=j(p);return!!ct(c._olm_matches_inbound_session)(this.$b,y,p.length)}),Yt.prototype.matches_inbound_from=z(function(p,y){p=ce(p);var O=j(p);y=ce(y);var x=j(y);return!!ct(c._olm_matches_inbound_session_from)(this.$b,O,p.length,x,y.length)}),Yt.prototype.encrypt=z(function(p){try{var y=ct(c._olm_encrypt_random_length)(this.$b),O=ct(c._olm_encrypt_message_type)(this.$b),x=Kr(p),K=ct(c._olm_encrypt_message_length)(this.$b,x),ee=br(y,f),_e=Ve(x+1);rn(p,$e,_e,x+1);var Dt=Ve(K+1);return ct(c._olm_encrypt)(this.$b,_e,x,ee,y,Dt,K),we(Dt+K),{type:O,body:Q(Dt,K)}}finally{ee!==void 0&&le(ee,y),_e!==void 0&&(le(_e,x+1),Ge(_e)),Dt!==void 0&&Ge(Dt)}}),Yt.prototype.decrypt=z(function(p,y){try{var O=Ve(y.length);di(y,O);var x=ct(c._olm_decrypt_max_plaintext_length)(this.$b,p,O,y.length);di(y,O);var K=Ve(x+1),ee=ct(c._olm_decrypt)(this.$b,p,O,y.length,K,x);return we(K+ee),Q(K,ee)}finally{O!==void 0&&Ge(O),K!==void 0&&(le(K,x),Ge(K))}}),Yt.prototype.describe=z(function(){try{var p=Ve(256);return ct(c._olm_session_describe)(this.$b,p,256),Q(p)}finally{p!==void 0&&Ge(p)}});function pc(){var p=c._olm_utility_size();this.ac=Ve(p),this.$b=c._olm_utility(this.ac)}function vu(p){return function(){var y=p.apply(this,arguments);if(y===nn)throw y=Q(c._olm_utility_last_error(arguments[0])),Error("OLM."+y);return y}}return pc.prototype.free=function(){c._olm_clear_utility(this.$b),Ge(this.$b)},pc.prototype.sha256=z(function(p){var y=vu(c._olm_sha256_length)(this.$b);p=ce(p);var O=j(p),x=j(y+1);try{vu(c._olm_sha256)(this.$b,O,p.length,x,y)}finally{for(le(O,p.length),O=0;O<p.length;O++)p[O]=0}return Q(x,y)}),pc.prototype.ed25519_verify=z(function(p,y,O){p=ce(p);var x=j(p);y=ce(y);var K=j(y);O=ce(O);var ee=j(O);try{vu(c._olm_ed25519_verify)(this.$b,x,p.length,K,y.length,ee,O.length)}finally{for(le(K,y.length),p=0;p<y.length;p++)y[p]=0}}),r.Account=Rt,r.Session=Yt,r.Utility=pc,r.PkEncryption=$,r.PkDecryption=Ie,r.PkSigning=ke,r.SAS=mi,r.get_library_version=z(function(){var p=j(3);return c._olm_get_library_version(p,p+1,p+2),[Te(p,"i8"),Te(p+1,"i8"),Te(p+2,"i8")]}),u.ready}}();n.exports=o;var a;return r.init=function(l){return a||(l&&(OLM_OPTIONS=l),a=new Promise(function(u,c){i=function(){u()},s=function(g){c(g)},o()}),a)},r}();typeof window!="undefined"&&(window.Olm=t),n.exports=t;// @license-end
-})(V_);var bD=V_.exports;export{gD as B,Ao as D,pl as E,ly as F,mD as L,fA as M,bD as O,yD as P,pD as R,So as S,_D as W,JE as a,nS as b,dA as c,Ck as d,SD as e,jE as f,Ta as g,XE as j,Fl as l,ED as o,KE as u};
diff --git a/pr-121/assets/vendor.8ab614fa.js b/pr-121/assets/vendor.8ab614fa.js
@@ -0,0 +1,53 @@
+var Qa,J,Qm,Ia,Gf,Zm,yl={},ey=[],gE=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i;function Jn(n,e){for(var t in e)n[t]=e[t];return n}function ty(n){var e=n.parentNode;e&&e.removeChild(n)}function Ie(n,e,t){var r,i,s,o={};for(s in e)s=="key"?r=e[s]:s=="ref"?i=e[s]:o[s]=e[s];if(arguments.length>2&&(o.children=arguments.length>3?Qa.call(arguments,2):t),typeof n=="function"&&n.defaultProps!=null)for(s in n.defaultProps)o[s]===void 0&&(o[s]=n.defaultProps[s]);return Ta(n,o,r,i,null)}function Ta(n,e,t,r,i){var s={type:n,props:e,key:t,ref:r,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:i==null?++Qm:i};return i==null&&J.vnode!=null&&J.vnode(s),s}function ry(){return{current:null}}function en(n){return n.children}function Br(n,e){this.props=n,this.context=e}function Na(n,e){if(e==null)return n.__?Na(n.__,n.__.__k.indexOf(n)+1):null;for(var t;e<n.__k.length;e++)if((t=n.__k[e])!=null&&t.__e!=null)return t.__e;return typeof n.type=="function"?Na(n):null}function ny(n){var e,t;if((n=n.__)!=null&&n.__c!=null){for(n.__e=n.__c.base=null,e=0;e<n.__k.length;e++)if((t=n.__k[e])!=null&&t.__e!=null){n.__e=n.__c.base=t.__e;break}return ny(n)}}function $d(n){(!n.__d&&(n.__d=!0)&&Ia.push(n)&&!vl.__r++||Gf!==J.debounceRendering)&&((Gf=J.debounceRendering)||setTimeout)(vl)}function vl(){for(var n;vl.__r=Ia.length;)n=Ia.sort(function(e,t){return e.__v.__b-t.__v.__b}),Ia=[],n.some(function(e){var t,r,i,s,o,a;e.__d&&(o=(s=(t=e).__v).__e,(a=t.__P)&&(r=[],(i=Jn({},s)).__v=s.__v+1,sf(a,s,i,t.__n,a.ownerSVGElement!==void 0,s.__h!=null?[o]:null,r,o==null?Na(s):o,s.__h),ay(r,s),s.__e!=o&&ny(s)))})}function iy(n,e,t,r,i,s,o,a,l,u){var c,g,m,f,_,I,R,T=r&&r.__k||ey,C=T.length;for(t.__k=[],c=0;c<e.length;c++)if((f=t.__k[c]=(f=e[c])==null||typeof f=="boolean"?null:typeof f=="string"||typeof f=="number"||typeof f=="bigint"?Ta(null,f,null,null,f):Array.isArray(f)?Ta(en,{children:f},null,null,null):f.__b>0?Ta(f.type,f.props,f.key,f.ref?f.ref:null,f.__v):f)!=null){if(f.__=t,f.__b=t.__b+1,(m=T[c])===null||m&&f.key==m.key&&f.type===m.type)T[c]=void 0;else for(g=0;g<C;g++){if((m=T[g])&&f.key==m.key&&f.type===m.type){T[g]=void 0;break}m=null}sf(n,f,m=m||yl,i,s,o,a,l,u),_=f.__e,(g=f.ref)&&m.ref!=g&&(R||(R=[]),m.ref&&R.push(m.ref,null,f),R.push(g,f.__c||_,f)),_!=null?(I==null&&(I=_),typeof f.type=="function"&&f.__k===m.__k?f.__d=l=sy(f,l,n):l=oy(n,f,m,T,_,l),typeof t.type=="function"&&(t.__d=l)):l&&m.__e==l&&l.parentNode!=n&&(l=Na(m))}for(t.__e=I,c=C;c--;)T[c]!=null&&ly(T[c],T[c]);if(R)for(c=0;c<R.length;c++)cy(R[c],R[++c],R[++c])}function sy(n,e,t){for(var r,i=n.__k,s=0;i&&s<i.length;s++)(r=i[s])&&(r.__=n,e=typeof r.type=="function"?sy(r,e,t):oy(t,r,r,i,r.__e,e));return e}function Zn(n,e){return e=e||[],n==null||typeof n=="boolean"||(Array.isArray(n)?n.some(function(t){Zn(t,e)}):e.push(n)),e}function oy(n,e,t,r,i,s){var o,a,l;if(e.__d!==void 0)o=e.__d,e.__d=void 0;else if(t==null||i!=s||i.parentNode==null)e:if(s==null||s.parentNode!==n)n.appendChild(i),o=null;else{for(a=s,l=0;(a=a.nextSibling)&&l<r.length;l+=1)if(a==i)break e;n.insertBefore(i,s),o=s}return o!==void 0?o:i.nextSibling}function mE(n,e,t,r,i){var s;for(s in t)s==="children"||s==="key"||s in e||_l(n,s,null,t[s],r);for(s in e)i&&typeof e[s]!="function"||s==="children"||s==="key"||s==="value"||s==="checked"||t[s]===e[s]||_l(n,s,e[s],t[s],r)}function Wf(n,e,t){e[0]==="-"?n.setProperty(e,t):n[e]=t==null?"":typeof t!="number"||gE.test(e)?t:t+"px"}function _l(n,e,t,r,i){var s;e:if(e==="style")if(typeof t=="string")n.style.cssText=t;else{if(typeof r=="string"&&(n.style.cssText=r=""),r)for(e in r)t&&e in t||Wf(n.style,e,"");if(t)for(e in t)r&&t[e]===r[e]||Wf(n.style,e,t[e])}else if(e[0]==="o"&&e[1]==="n")s=e!==(e=e.replace(/Capture$/,"")),e=e.toLowerCase()in n?e.toLowerCase().slice(2):e.slice(2),n.l||(n.l={}),n.l[e+s]=t,t?r||n.addEventListener(e,s?Yf:Hf,s):n.removeEventListener(e,s?Yf:Hf,s);else if(e!=="dangerouslySetInnerHTML"){if(i)e=e.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(e!=="href"&&e!=="list"&&e!=="form"&&e!=="tabIndex"&&e!=="download"&&e in n)try{n[e]=t==null?"":t;break e}catch{}typeof t=="function"||(t==null||t===!1&&e.indexOf("-")==-1?n.removeAttribute(e):n.setAttribute(e,t))}}function Hf(n){this.l[n.type+!1](J.event?J.event(n):n)}function Yf(n){this.l[n.type+!0](J.event?J.event(n):n)}function sf(n,e,t,r,i,s,o,a,l){var u,c,g,m,f,_,I,R,T,C,S,k,A,w,L,q=e.type;if(e.constructor!==void 0)return null;t.__h!=null&&(l=t.__h,a=e.__e=t.__e,e.__h=null,s=[a]),(u=J.__b)&&u(e);try{e:if(typeof q=="function"){if(R=e.props,T=(u=q.contextType)&&r[u.__c],C=u?T?T.props.value:u.__:r,t.__c?I=(c=e.__c=t.__c).__=c.__E:("prototype"in q&&q.prototype.render?e.__c=c=new q(R,C):(e.__c=c=new Br(R,C),c.constructor=q,c.render=vE),T&&T.sub(c),c.props=R,c.state||(c.state={}),c.context=C,c.__n=r,g=c.__d=!0,c.__h=[],c._sb=[]),c.__s==null&&(c.__s=c.state),q.getDerivedStateFromProps!=null&&(c.__s==c.state&&(c.__s=Jn({},c.__s)),Jn(c.__s,q.getDerivedStateFromProps(R,c.__s))),m=c.props,f=c.state,g)q.getDerivedStateFromProps==null&&c.componentWillMount!=null&&c.componentWillMount(),c.componentDidMount!=null&&c.__h.push(c.componentDidMount);else{if(q.getDerivedStateFromProps==null&&R!==m&&c.componentWillReceiveProps!=null&&c.componentWillReceiveProps(R,C),!c.__e&&c.shouldComponentUpdate!=null&&c.shouldComponentUpdate(R,c.__s,C)===!1||e.__v===t.__v){for(c.props=R,c.state=c.__s,e.__v!==t.__v&&(c.__d=!1),c.__v=e,e.__e=t.__e,e.__k=t.__k,e.__k.forEach(function(F){F&&(F.__=e)}),S=0;S<c._sb.length;S++)c.__h.push(c._sb[S]);c._sb=[],c.__h.length&&o.push(c);break e}c.componentWillUpdate!=null&&c.componentWillUpdate(R,c.__s,C),c.componentDidUpdate!=null&&c.__h.push(function(){c.componentDidUpdate(m,f,_)})}if(c.context=C,c.props=R,c.__v=e,c.__P=n,k=J.__r,A=0,"prototype"in q&&q.prototype.render){for(c.state=c.__s,c.__d=!1,k&&k(e),u=c.render(c.props,c.state,c.context),w=0;w<c._sb.length;w++)c.__h.push(c._sb[w]);c._sb=[]}else do c.__d=!1,k&&k(e),u=c.render(c.props,c.state,c.context),c.state=c.__s;while(c.__d&&++A<25);c.state=c.__s,c.getChildContext!=null&&(r=Jn(Jn({},r),c.getChildContext())),g||c.getSnapshotBeforeUpdate==null||(_=c.getSnapshotBeforeUpdate(m,f)),L=u!=null&&u.type===en&&u.key==null?u.props.children:u,iy(n,Array.isArray(L)?L:[L],e,t,r,i,s,o,a,l),c.base=e.__e,e.__h=null,c.__h.length&&o.push(c),I&&(c.__E=c.__=null),c.__e=!1}else s==null&&e.__v===t.__v?(e.__k=t.__k,e.__e=t.__e):e.__e=yE(t.__e,e,t,r,i,s,o,l);(u=J.diffed)&&u(e)}catch(F){e.__v=null,(l||s!=null)&&(e.__e=a,e.__h=!!l,s[s.indexOf(a)]=null),J.__e(F,e,t)}}function ay(n,e){J.__c&&J.__c(e,n),n.some(function(t){try{n=t.__h,t.__h=[],n.some(function(r){r.call(t)})}catch(r){J.__e(r,t.__v)}})}function yE(n,e,t,r,i,s,o,a){var l,u,c,g=t.props,m=e.props,f=e.type,_=0;if(f==="svg"&&(i=!0),s!=null){for(;_<s.length;_++)if((l=s[_])&&"setAttribute"in l==!!f&&(f?l.localName===f:l.nodeType===3)){n=l,s[_]=null;break}}if(n==null){if(f===null)return document.createTextNode(m);n=i?document.createElementNS("http://www.w3.org/2000/svg",f):document.createElement(f,m.is&&m),s=null,a=!1}if(f===null)g===m||a&&n.data===m||(n.data=m);else{if(s=s&&Qa.call(n.childNodes),u=(g=t.props||yl).dangerouslySetInnerHTML,c=m.dangerouslySetInnerHTML,!a){if(s!=null)for(g={},_=0;_<n.attributes.length;_++)g[n.attributes[_].name]=n.attributes[_].value;(c||u)&&(c&&(u&&c.__html==u.__html||c.__html===n.innerHTML)||(n.innerHTML=c&&c.__html||""))}if(mE(n,m,g,i,a),c)e.__k=[];else if(_=e.props.children,iy(n,Array.isArray(_)?_:[_],e,t,r,i&&f!=="foreignObject",s,o,s?s[0]:t.__k&&Na(t,0),a),s!=null)for(_=s.length;_--;)s[_]!=null&&ty(s[_]);a||("value"in m&&(_=m.value)!==void 0&&(_!==n.value||f==="progress"&&!_||f==="option"&&_!==g.value)&&_l(n,"value",_,g.value,!1),"checked"in m&&(_=m.checked)!==void 0&&_!==n.checked&&_l(n,"checked",_,g.checked,!1))}return n}function cy(n,e,t){try{typeof n=="function"?n(e):n.current=e}catch(r){J.__e(r,t)}}function ly(n,e,t){var r,i;if(J.unmount&&J.unmount(n),(r=n.ref)&&(r.current&&r.current!==n.__e||cy(r,null,e)),(r=n.__c)!=null){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(s){J.__e(s,e)}r.base=r.__P=null,n.__c=void 0}if(r=n.__k)for(i=0;i<r.length;i++)r[i]&&ly(r[i],e,t||typeof n.type!="function");t||n.__e==null||ty(n.__e),n.__=n.__e=n.__d=void 0}function vE(n,e,t){return this.constructor(n,t)}function La(n,e,t){var r,i,s;J.__&&J.__(n,e),i=(r=typeof t=="function")?null:t&&t.__k||e.__k,s=[],sf(e,n=(!r&&t||e).__k=Ie(en,null,[n]),i||yl,yl,e.ownerSVGElement!==void 0,!r&&t?[t]:i?null:e.firstChild?Qa.call(e.childNodes):null,s,!r&&t?t:i?i.__e:e.firstChild,r),ay(s,n)}function uy(n,e){La(n,e,uy)}function _E(n,e,t){var r,i,s,o=Jn({},n.props);for(s in e)s=="key"?r=e[s]:s=="ref"?i=e[s]:o[s]=e[s];return arguments.length>2&&(o.children=arguments.length>3?Qa.call(arguments,2):t),Ta(n.type,o,r||n.key,i||n.ref,null)}function si(n,e){var t={__c:e="__cC"+Zm++,__:n,Consumer:function(r,i){return r.children(i)},Provider:function(r){var i,s;return this.getChildContext||(i=[],(s={})[e]=this,this.getChildContext=function(){return s},this.shouldComponentUpdate=function(o){this.props.value!==o.value&&i.some($d)},this.sub=function(o){i.push(o);var a=o.componentWillUnmount;o.componentWillUnmount=function(){i.splice(i.indexOf(o),1),a&&a.call(o)}}),r.children}};return t.Provider.__=t.Consumer.contextType=t}Qa=ey.slice,J={__e:function(n,e,t,r){for(var i,s,o;e=e.__;)if((i=e.__c)&&!i.__)try{if((s=i.constructor)&&s.getDerivedStateFromError!=null&&(i.setState(s.getDerivedStateFromError(n)),o=i.__d),i.componentDidCatch!=null&&(i.componentDidCatch(n,r||{}),o=i.__d),o)return i.__E=i}catch(a){n=a}throw n}},Qm=0,Br.prototype.setState=function(n,e){var t;t=this.__s!=null&&this.__s!==this.state?this.__s:this.__s=Jn({},this.state),typeof n=="function"&&(n=n(Jn({},t),this.props)),n&&Jn(t,n),n!=null&&this.__v&&(e&&this._sb.push(e),$d(this))},Br.prototype.forceUpdate=function(n){this.__v&&(this.__e=!0,n&&this.__h.push(n),$d(this))},Br.prototype.render=en,Ia=[],vl.__r=0,Zm=0;var Fi,Ke,Ou,zf,So=0,dy=[],el=[],Jf=J.__b,Xf=J.__r,Qf=J.diffed,Zf=J.__c,ep=J.unmount;function Cs(n,e){J.__h&&J.__h(Ke,n,So||e),So=0;var t=Ke.__H||(Ke.__H={__:[],__h:[]});return n>=t.__.length&&t.__.push({__V:el}),t.__[n]}function Za(n){return So=1,of(gy,n)}function of(n,e,t){var r=Cs(Fi++,2);if(r.t=n,!r.__c&&(r.__=[t?t(e):gy(void 0,e),function(s){var o=r.__N?r.__N[0]:r.__[0],a=r.t(o,s);o!==a&&(r.__N=[a,r.__[1]],r.__c.setState({}))}],r.__c=Ke,!Ke.u)){Ke.u=!0;var i=Ke.shouldComponentUpdate;Ke.shouldComponentUpdate=function(s,o,a){if(!r.__c.__H)return!0;var l=r.__c.__H.__.filter(function(c){return c.__c});if(l.every(function(c){return!c.__N}))return!i||i.call(this,s,o,a);var u=!1;return l.forEach(function(c){if(c.__N){var g=c.__[0];c.__=c.__N,c.__N=void 0,g!==c.__[0]&&(u=!0)}}),!(!u&&r.__c.props===s)&&(!i||i.call(this,s,o,a))}}return r.__N||r.__}function Bl(n,e){var t=Cs(Fi++,3);!J.__s&&af(t.__H,e)&&(t.__=n,t.i=e,Ke.__H.__h.push(t))}function Do(n,e){var t=Cs(Fi++,4);!J.__s&&af(t.__H,e)&&(t.__=n,t.i=e,Ke.__h.push(t))}function Kl(n){return So=5,fs(function(){return{current:n}},[])}function hy(n,e,t){So=6,Do(function(){return typeof n=="function"?(n(e()),function(){return n(null)}):n?(n.current=e(),function(){return n.current=null}):void 0},t==null?t:t.concat(n))}function fs(n,e){var t=Cs(Fi++,7);return af(t.__H,e)?(t.__V=n(),t.i=e,t.__h=n,t.__V):t.__}function Fl(n,e){return So=8,fs(function(){return n},e)}function At(n){var e=Ke.context[n.__c],t=Cs(Fi++,9);return t.c=n,e?(t.__==null&&(t.__=!0,e.sub(Ke)),e.props.value):n.__}function fy(n,e){J.useDebugValue&&J.useDebugValue(e?e(n):n)}function EE(n){var e=Cs(Fi++,10),t=Za();return e.__=n,Ke.componentDidCatch||(Ke.componentDidCatch=function(r,i){e.__&&e.__(r,i),t[1](r)}),[t[0],function(){t[1](void 0)}]}function py(){var n=Cs(Fi++,11);if(!n.__){for(var e=Ke.__v;e!==null&&!e.__m&&e.__!==null;)e=e.__;var t=e.__m||(e.__m=[0,0]);n.__="P"+t[0]+"-"+t[1]++}return n.__}function SE(){for(var n;n=dy.shift();)if(n.__P&&n.__H)try{n.__H.__h.forEach(tl),n.__H.__h.forEach(Nd),n.__H.__h=[]}catch(e){n.__H.__h=[],J.__e(e,n.__v)}}J.__b=function(n){Ke=null,Jf&&Jf(n)},J.__r=function(n){Xf&&Xf(n),Fi=0;var e=(Ke=n.__c).__H;e&&(Ou===Ke?(e.__h=[],Ke.__h=[],e.__.forEach(function(t){t.__N&&(t.__=t.__N),t.__V=el,t.__N=t.i=void 0})):(e.__h.forEach(tl),e.__h.forEach(Nd),e.__h=[])),Ou=Ke},J.diffed=function(n){Qf&&Qf(n);var e=n.__c;e&&e.__H&&(e.__H.__h.length&&(dy.push(e)!==1&&zf===J.requestAnimationFrame||((zf=J.requestAnimationFrame)||bE)(SE)),e.__H.__.forEach(function(t){t.i&&(t.__H=t.i),t.__V!==el&&(t.__=t.__V),t.i=void 0,t.__V=el})),Ou=Ke=null},J.__c=function(n,e){e.some(function(t){try{t.__h.forEach(tl),t.__h=t.__h.filter(function(r){return!r.__||Nd(r)})}catch(r){e.some(function(i){i.__h&&(i.__h=[])}),e=[],J.__e(r,t.__v)}}),Zf&&Zf(n,e)},J.unmount=function(n){ep&&ep(n);var e,t=n.__c;t&&t.__H&&(t.__H.__.forEach(function(r){try{tl(r)}catch(i){e=i}}),t.__H=void 0,e&&J.__e(e,t.__v))};var tp=typeof requestAnimationFrame=="function";function bE(n){var e,t=function(){clearTimeout(r),tp&&cancelAnimationFrame(e),setTimeout(n)},r=setTimeout(t,100);tp&&(e=requestAnimationFrame(t))}function tl(n){var e=Ke,t=n.__c;typeof t=="function"&&(n.__c=void 0,t()),Ke=e}function Nd(n){var e=Ke;n.__c=n.__(),Ke=e}function af(n,e){return!n||n.length!==e.length||e.some(function(t,r){return t!==n[r]})}function gy(n,e){return typeof e=="function"?e(n):e}function my(n,e){for(var t in e)n[t]=e[t];return n}function Ld(n,e){for(var t in n)if(t!=="__source"&&!(t in e))return!0;for(var r in e)if(r!=="__source"&&n[r]!==e[r])return!0;return!1}function ku(n,e){return n===e&&(n!==0||1/n==1/e)||n!=n&&e!=e}function El(n){this.props=n}function yy(n,e){function t(i){var s=this.props.ref,o=s==i.ref;return!o&&s&&(s.call?s(null):s.current=null),e?!e(this.props,i)||!o:Ld(this.props,i)}function r(i){return this.shouldComponentUpdate=t,Ie(n,i)}return r.displayName="Memo("+(n.displayName||n.name)+")",r.prototype.isReactComponent=!0,r.__f=!0,r}(El.prototype=new Br).isPureReactComponent=!0,El.prototype.shouldComponentUpdate=function(n,e){return Ld(this.props,n)||Ld(this.state,e)};var rp=J.__b;J.__b=function(n){n.type&&n.type.__f&&n.ref&&(n.props.ref=n.ref,n.ref=null),rp&&rp(n)};var wE=typeof Symbol!="undefined"&&Symbol.for&&Symbol.for("react.forward_ref")||3911;function cf(n){function e(t){var r=my({},t);return delete r.ref,n(r,t.ref||null)}return e.$$typeof=wE,e.render=e,e.prototype.isReactComponent=e.__f=!0,e.displayName="ForwardRef("+(n.displayName||n.name)+")",e}var np=function(n,e){return n==null?null:Zn(Zn(n).map(e))},lf={map:np,forEach:np,count:function(n){return n?Zn(n).length:0},only:function(n){var e=Zn(n);if(e.length!==1)throw"Children.only";return e[0]},toArray:Zn},RE=J.__e;J.__e=function(n,e,t,r){if(n.then){for(var i,s=e;s=s.__;)if((i=s.__c)&&i.__c)return e.__e==null&&(e.__e=t.__e,e.__k=t.__k),i.__c(n,e)}RE(n,e,t,r)};var ip=J.unmount;function vy(n,e,t){return n&&(n.__c&&n.__c.__H&&(n.__c.__H.__.forEach(function(r){typeof r.__c=="function"&&r.__c()}),n.__c.__H=null),(n=my({},n)).__c!=null&&(n.__c.__P===t&&(n.__c.__P=e),n.__c=null),n.__k=n.__k&&n.__k.map(function(r){return vy(r,e,t)})),n}function _y(n,e,t){return n&&(n.__v=null,n.__k=n.__k&&n.__k.map(function(r){return _y(r,e,t)}),n.__c&&n.__c.__P===e&&(n.__e&&t.insertBefore(n.__e,n.__d),n.__c.__e=!0,n.__c.__P=t)),n}function Oa(){this.__u=0,this.t=null,this.__b=null}function Ey(n){var e=n.__.__c;return e&&e.__a&&e.__a(n)}function Sy(n){var e,t,r;function i(s){if(e||(e=n()).then(function(o){t=o.default||o},function(o){r=o}),r)throw r;if(!t)throw e;return Ie(t,s)}return i.displayName="Lazy",i.__f=!0,i}function uo(){this.u=null,this.o=null}J.unmount=function(n){var e=n.__c;e&&e.__R&&e.__R(),e&&n.__h===!0&&(n.type=null),ip&&ip(n)},(Oa.prototype=new Br).__c=function(n,e){var t=e.__c,r=this;r.t==null&&(r.t=[]),r.t.push(t);var i=Ey(r.__v),s=!1,o=function(){s||(s=!0,t.__R=null,i?i(a):a())};t.__R=o;var a=function(){if(!--r.__u){if(r.state.__a){var u=r.state.__a;r.__v.__k[0]=_y(u,u.__c.__P,u.__c.__O)}var c;for(r.setState({__a:r.__b=null});c=r.t.pop();)c.forceUpdate()}},l=e.__h===!0;r.__u++||l||r.setState({__a:r.__b=r.__v.__k[0]}),n.then(o,o)},Oa.prototype.componentWillUnmount=function(){this.t=[]},Oa.prototype.render=function(n,e){if(this.__b){if(this.__v.__k){var t=document.createElement("div"),r=this.__v.__k[0].__c;this.__v.__k[0]=vy(this.__b,t,r.__O=r.__P)}this.__b=null}var i=e.__a&&Ie(en,null,n.fallback);return i&&(i.__h=null),[Ie(en,null,e.__a?null:n.children),i]};var sp=function(n,e,t){if(++t[1]===t[0]&&n.o.delete(e),n.props.revealOrder&&(n.props.revealOrder[0]!=="t"||!n.o.size))for(t=n.u;t;){for(;t.length>3;)t.pop()();if(t[1]<t[0])break;n.u=t=t[2]}};function IE(n){return this.getChildContext=function(){return n.context},n.children}function TE(n){var e=this,t=n.i;e.componentWillUnmount=function(){La(null,e.l),e.l=null,e.i=null},e.i&&e.i!==t&&e.componentWillUnmount(),n.__v?(e.l||(e.i=t,e.l={nodeType:1,parentNode:t,childNodes:[],appendChild:function(r){this.childNodes.push(r),e.i.appendChild(r)},insertBefore:function(r,i){this.childNodes.push(r),e.i.appendChild(r)},removeChild:function(r){this.childNodes.splice(this.childNodes.indexOf(r)>>>1,1),e.i.removeChild(r)}}),La(Ie(IE,{context:e.context},n.__v),e.l)):e.l&&e.componentWillUnmount()}function by(n,e){var t=Ie(TE,{__v:n,i:e});return t.containerInfo=e,t}(uo.prototype=new Br).__a=function(n){var e=this,t=Ey(e.__v),r=e.o.get(n);return r[0]++,function(i){var s=function(){e.props.revealOrder?(r.push(i),sp(e,n,r)):i()};t?t(s):s()}},uo.prototype.render=function(n){this.u=null,this.o=new Map;var e=Zn(n.children);n.revealOrder&&n.revealOrder[0]==="b"&&e.reverse();for(var t=e.length;t--;)this.o.set(e[t],this.u=[1,0,this.u]);return n.children},uo.prototype.componentDidUpdate=uo.prototype.componentDidMount=function(){var n=this;this.o.forEach(function(e,t){sp(n,t,e)})};var wy=typeof Symbol!="undefined"&&Symbol.for&&Symbol.for("react.element")||60103,OE=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,kE=typeof document!="undefined",CE=function(n){return(typeof Symbol!="undefined"&&typeof Symbol()=="symbol"?/fil|che|rad/i:/fil|che|ra/i).test(n)};function Ry(n,e,t){return e.__k==null&&(e.textContent=""),La(n,e),typeof t=="function"&&t(),n?n.__c:null}function Iy(n,e,t){return uy(n,e),typeof t=="function"&&t(),n?n.__c:null}Br.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach(function(n){Object.defineProperty(Br.prototype,n,{configurable:!0,get:function(){return this["UNSAFE_"+n]},set:function(e){Object.defineProperty(this,n,{configurable:!0,writable:!0,value:e})}})});var op=J.event;function PE(){}function ME(){return this.cancelBubble}function DE(){return this.defaultPrevented}J.event=function(n){return op&&(n=op(n)),n.persist=PE,n.isPropagationStopped=ME,n.isDefaultPrevented=DE,n.nativeEvent=n};var Ty,ap={configurable:!0,get:function(){return this.class}},cp=J.vnode;J.vnode=function(n){var e=n.type,t=n.props,r=t;if(typeof e=="string"){var i=e.indexOf("-")===-1;for(var s in r={},t){var o=t[s];kE&&s==="children"&&e==="noscript"||s==="value"&&"defaultValue"in t&&o==null||(s==="defaultValue"&&"value"in t&&t.value==null?s="value":s==="download"&&o===!0?o="":/ondoubleclick/i.test(s)?s="ondblclick":/^onchange(textarea|input)/i.test(s+e)&&!CE(t.type)?s="oninput":/^onfocus$/i.test(s)?s="onfocusin":/^onblur$/i.test(s)?s="onfocusout":/^on(Ani|Tra|Tou|BeforeInp|Compo)/.test(s)?s=s.toLowerCase():i&&OE.test(s)?s=s.replace(/[A-Z0-9]/g,"-$&").toLowerCase():o===null&&(o=void 0),/^oninput$/i.test(s)&&(s=s.toLowerCase(),r[s]&&(s="oninputCapture")),r[s]=o)}e=="select"&&r.multiple&&Array.isArray(r.value)&&(r.value=Zn(t.children).forEach(function(a){a.props.selected=r.value.indexOf(a.props.value)!=-1})),e=="select"&&r.defaultValue!=null&&(r.value=Zn(t.children).forEach(function(a){a.props.selected=r.multiple?r.defaultValue.indexOf(a.props.value)!=-1:r.defaultValue==a.props.value})),n.props=r,t.class!=t.className&&(ap.enumerable="className"in t,t.className!=null&&(r.class=t.className),Object.defineProperty(r,"className",ap))}n.$$typeof=wy,cp&&cp(n)};var lp=J.__r;J.__r=function(n){lp&&lp(n),Ty=n.__c};var Oy={ReactCurrentDispatcher:{current:{readContext:function(n){return Ty.__n[n.__c].props.value}}}},AE="17.0.2";function ky(n){return Ie.bind(null,n)}function ql(n){return!!n&&n.$$typeof===wy}function Cy(n){return ql(n)?_E.apply(null,arguments):n}function Py(n){return!!n.__k&&(La(null,n),!0)}function My(n){return n&&(n.base||n.nodeType===1&&n)||null}var Dy=function(n,e){return n(e)},Ay=function(n,e){return n(e)},xy=en;function uf(n){n()}function Uy(n){return n}function $y(){return[!1,uf]}var Ny=Do;function Ly(n,e){var t=e(),r=Za({h:{__:t,v:e}}),i=r[0].h,s=r[1];return Do(function(){i.__=t,i.v=e,ku(i.__,e())||s({h:i})},[n,t,e]),Bl(function(){return ku(i.__,i.v())||s({h:i}),n(function(){ku(i.__,i.v())||s({h:i})})},[n]),t}var xE={useState:Za,useId:py,useReducer:of,useEffect:Bl,useLayoutEffect:Do,useInsertionEffect:Ny,useTransition:$y,useDeferredValue:Uy,useSyncExternalStore:Ly,startTransition:uf,useRef:Kl,useImperativeHandle:hy,useMemo:fs,useCallback:Fl,useContext:At,useDebugValue:fy,version:"17.0.2",Children:lf,render:Ry,hydrate:Iy,unmountComponentAtNode:Py,createPortal:by,createElement:Ie,createContext:si,createFactory:ky,cloneElement:Cy,createRef:ry,Fragment:en,isValidElement:ql,findDOMNode:My,Component:Br,PureComponent:El,memo:yy,forwardRef:cf,flushSync:Ay,unstable_batchedUpdates:Dy,StrictMode:xy,Suspense:Oa,SuspenseList:uo,lazy:Sy,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:Oy},Sl=Object.freeze(Object.defineProperty({__proto__:null,Children:lf,PureComponent:El,StrictMode:xy,Suspense:Oa,SuspenseList:uo,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:Oy,cloneElement:Cy,createFactory:ky,createPortal:by,default:xE,findDOMNode:My,flushSync:Ay,forwardRef:cf,hydrate:Iy,isValidElement:ql,lazy:Sy,memo:yy,render:Ry,startTransition:uf,unmountComponentAtNode:Py,unstable_batchedUpdates:Dy,useDeferredValue:Uy,useInsertionEffect:Ny,useSyncExternalStore:Ly,useTransition:$y,version:AE,Component:Br,Fragment:en,createContext:si,createElement:Ie,createRef:ry,useCallback:Fl,useContext:At,useDebugValue:fy,useEffect:Bl,useErrorBoundary:EE,useId:py,useImperativeHandle:hy,useLayoutEffect:Do,useMemo:fs,useReducer:of,useRef:Kl,useState:Za},Symbol.toStringTag,{value:"Module"}));/**
+ * @remix-run/router v1.2.1
+ *
+ * Copyright (c) Remix Software Inc.
+ *
+ * This source code is licensed under the MIT license found in the
+ * LICENSE.md file in the root directory of this source tree.
+ *
+ * @license MIT
+ */function bl(){return bl=Object.assign?Object.assign.bind():function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r])}return n},bl.apply(this,arguments)}var $i;(function(n){n.Pop="POP",n.Push="PUSH",n.Replace="REPLACE"})($i||($i={}));const up="popstate";function UE(n){n===void 0&&(n={});function e(r,i){let{pathname:s,search:o,hash:a}=r.location;return Bd("",{pathname:s,search:o,hash:a},i.state&&i.state.usr||null,i.state&&i.state.key||"default")}function t(r,i){return typeof i=="string"?i:Ba(i)}return LE(e,t,null,n)}function ht(n,e){if(n===!1||n===null||typeof n=="undefined")throw new Error(e)}function $E(){return Math.random().toString(36).substr(2,8)}function dp(n){return{usr:n.state,key:n.key}}function Bd(n,e,t,r){return t===void 0&&(t=null),bl({pathname:typeof n=="string"?n:n.pathname,search:"",hash:""},typeof e=="string"?Ao(e):e,{state:t,key:e&&e.key||r||$E()})}function Ba(n){let{pathname:e="/",search:t="",hash:r=""}=n;return t&&t!=="?"&&(e+=t.charAt(0)==="?"?t:"?"+t),r&&r!=="#"&&(e+=r.charAt(0)==="#"?r:"#"+r),e}function Ao(n){let e={};if(n){let t=n.indexOf("#");t>=0&&(e.hash=n.substr(t),n=n.substr(0,t));let r=n.indexOf("?");r>=0&&(e.search=n.substr(r),n=n.substr(0,r)),n&&(e.pathname=n)}return e}function NE(n){let e=typeof window!="undefined"&&typeof window.location!="undefined"&&window.location.origin!=="null"?window.location.origin:window.location.href,t=typeof n=="string"?n:Ba(n);return ht(e,"No window.location.(origin|href) available to create URL for href: "+t),new URL(t,e)}function LE(n,e,t,r){r===void 0&&(r={});let{window:i=document.defaultView,v5Compat:s=!1}=r,o=i.history,a=$i.Pop,l=null;function u(){a=$i.Pop,l&&l({action:a,location:m.location})}function c(f,_){a=$i.Push;let I=Bd(m.location,f,_);t&&t(I,f);let R=dp(I),T=m.createHref(I);try{o.pushState(R,"",T)}catch{i.location.assign(T)}s&&l&&l({action:a,location:m.location})}function g(f,_){a=$i.Replace;let I=Bd(m.location,f,_);t&&t(I,f);let R=dp(I),T=m.createHref(I);o.replaceState(R,"",T),s&&l&&l({action:a,location:m.location})}let m={get action(){return a},get location(){return n(i,o)},listen(f){if(l)throw new Error("A history only accepts one active listener");return i.addEventListener(up,u),l=f,()=>{i.removeEventListener(up,u),l=null}},createHref(f){return e(i,f)},encodeLocation(f){let _=NE(typeof f=="string"?f:Ba(f));return{pathname:_.pathname,search:_.search,hash:_.hash}},push:c,replace:g,go(f){return o.go(f)}};return m}var hp;(function(n){n.data="data",n.deferred="deferred",n.redirect="redirect",n.error="error"})(hp||(hp={}));function BE(n,e,t){t===void 0&&(t="/");let r=typeof e=="string"?Ao(e):e,i=Fy(r.pathname||"/",t);if(i==null)return null;let s=By(n);KE(s);let o=null;for(let a=0;o==null&&a<s.length;++a)o=zE(s[a],QE(i));return o}function By(n,e,t,r){e===void 0&&(e=[]),t===void 0&&(t=[]),r===void 0&&(r="");let i=(s,o,a)=>{let l={relativePath:a===void 0?s.path||"":a,caseSensitive:s.caseSensitive===!0,childrenIndex:o,route:s};l.relativePath.startsWith("/")&&(ht(l.relativePath.startsWith(r),'Absolute route path "'+l.relativePath+'" nested under path '+('"'+r+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),l.relativePath=l.relativePath.slice(r.length));let u=Li([r,l.relativePath]),c=t.concat(l);s.children&&s.children.length>0&&(ht(s.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+u+'".')),By(s.children,e,c,u)),!(s.path==null&&!s.index)&&e.push({path:u,score:HE(u,s.index),routesMeta:c})};return n.forEach((s,o)=>{var a;if(s.path===""||!((a=s.path)!=null&&a.includes("?")))i(s,o);else for(let l of Ky(s.path))i(s,o,l)}),e}function Ky(n){let e=n.split("/");if(e.length===0)return[];let[t,...r]=e,i=t.endsWith("?"),s=t.replace(/\?$/,"");if(r.length===0)return i?[s,""]:[s];let o=Ky(r.join("/")),a=[];return a.push(...o.map(l=>l===""?s:[s,l].join("/"))),i&&a.push(...o),a.map(l=>n.startsWith("/")&&l===""?"/":l)}function KE(n){n.sort((e,t)=>e.score!==t.score?t.score-e.score:YE(e.routesMeta.map(r=>r.childrenIndex),t.routesMeta.map(r=>r.childrenIndex)))}const FE=/^:\w+$/,qE=3,jE=2,VE=1,GE=10,WE=-2,fp=n=>n==="*";function HE(n,e){let t=n.split("/"),r=t.length;return t.some(fp)&&(r+=WE),e&&(r+=jE),t.filter(i=>!fp(i)).reduce((i,s)=>i+(FE.test(s)?qE:s===""?VE:GE),r)}function YE(n,e){return n.length===e.length&&n.slice(0,-1).every((r,i)=>r===e[i])?n[n.length-1]-e[e.length-1]:0}function zE(n,e){let{routesMeta:t}=n,r={},i="/",s=[];for(let o=0;o<t.length;++o){let a=t[o],l=o===t.length-1,u=i==="/"?e:e.slice(i.length)||"/",c=JE({path:a.relativePath,caseSensitive:a.caseSensitive,end:l},u);if(!c)return null;Object.assign(r,c.params);let g=a.route;s.push({params:r,pathname:Li([i,c.pathname]),pathnameBase:rS(Li([i,c.pathnameBase])),route:g}),c.pathnameBase!=="/"&&(i=Li([i,c.pathnameBase]))}return s}function JE(n,e){typeof n=="string"&&(n={path:n,caseSensitive:!1,end:!0});let[t,r]=XE(n.path,n.caseSensitive,n.end),i=e.match(t);if(!i)return null;let s=i[0],o=s.replace(/(.)\/+$/,"$1"),a=i.slice(1);return{params:r.reduce((u,c,g)=>{if(c==="*"){let m=a[g]||"";o=s.slice(0,s.length-m.length).replace(/(.)\/+$/,"$1")}return u[c]=ZE(a[g]||"",c),u},{}),pathname:s,pathnameBase:o,pattern:n}}function XE(n,e,t){e===void 0&&(e=!1),t===void 0&&(t=!0),df(n==="*"||!n.endsWith("*")||n.endsWith("/*"),'Route path "'+n+'" will be treated as if it were '+('"'+n.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+n.replace(/\*$/,"/*")+'".'));let r=[],i="^"+n.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^$?{}|()[\]]/g,"\\$&").replace(/\/:(\w+)/g,(o,a)=>(r.push(a),"/([^\\/]+)"));return n.endsWith("*")?(r.push("*"),i+=n==="*"||n==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):t?i+="\\/*$":n!==""&&n!=="/"&&(i+="(?:(?=\\/|$))"),[new RegExp(i,e?void 0:"i"),r]}function QE(n){try{return decodeURI(n)}catch(e){return df(!1,'The URL path "'+n+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+e+").")),n}}function ZE(n,e){try{return decodeURIComponent(n)}catch(t){return df(!1,'The value for the URL param "'+e+'" will not be decoded because'+(' the string "'+n+'" is a malformed URL segment. This is probably')+(" due to a bad percent encoding ("+t+").")),n}}function Fy(n,e){if(e==="/")return n;if(!n.toLowerCase().startsWith(e.toLowerCase()))return null;let t=e.endsWith("/")?e.length-1:e.length,r=n.charAt(t);return r&&r!=="/"?null:n.slice(t)||"/"}function df(n,e){if(!n){typeof console!="undefined"&&console.warn(e);try{throw new Error(e)}catch{}}}function eS(n,e){e===void 0&&(e="/");let{pathname:t,search:r="",hash:i=""}=typeof n=="string"?Ao(n):n;return{pathname:t?t.startsWith("/")?t:tS(t,e):e,search:nS(r),hash:iS(i)}}function tS(n,e){let t=e.replace(/\/+$/,"").split("/");return n.split("/").forEach(i=>{i===".."?t.length>1&&t.pop():i!=="."&&t.push(i)}),t.length>1?t.join("/"):"/"}function Cu(n,e,t,r){return"Cannot include a '"+n+"' character in a manually specified "+("`to."+e+"` field ["+JSON.stringify(r)+"]. Please separate it out to the ")+("`to."+t+"` field. Alternatively you may provide the full path as ")+'a string in <Link to="..."> and the router will parse it for you.'}function qy(n){return n.filter((e,t)=>t===0||e.route.path&&e.route.path.length>0)}function jy(n,e,t,r){r===void 0&&(r=!1);let i;typeof n=="string"?i=Ao(n):(i=bl({},n),ht(!i.pathname||!i.pathname.includes("?"),Cu("?","pathname","search",i)),ht(!i.pathname||!i.pathname.includes("#"),Cu("#","pathname","hash",i)),ht(!i.search||!i.search.includes("#"),Cu("#","search","hash",i)));let s=n===""||i.pathname==="",o=s?"/":i.pathname,a;if(r||o==null)a=t;else{let g=e.length-1;if(o.startsWith("..")){let m=o.split("/");for(;m[0]==="..";)m.shift(),g-=1;i.pathname=m.join("/")}a=g>=0?e[g]:"/"}let l=eS(i,a),u=o&&o!=="/"&&o.endsWith("/"),c=(s||o===".")&&t.endsWith("/");return!l.pathname.endsWith("/")&&(u||c)&&(l.pathname+="/"),l}const Li=n=>n.join("/").replace(/\/\/+/g,"/"),rS=n=>n.replace(/\/+$/,"").replace(/^\/*/,"/"),nS=n=>!n||n==="?"?"":n.startsWith("?")?n:"?"+n,iS=n=>!n||n==="#"?"":n.startsWith("#")?n:"#"+n;class sS{constructor(e,t,r,i){i===void 0&&(i=!1),this.status=e,this.statusText=t||"",this.internal=i,r instanceof Error?(this.data=r.toString(),this.error=r):this.data=r}}function oS(n){return n instanceof sS}const aS=["post","put","patch","delete"];[...aS];/**
+ * React Router v6.6.1
+ *
+ * Copyright (c) Remix Software Inc.
+ *
+ * This source code is licensed under the MIT license found in the
+ * LICENSE.md file in the root directory of this source tree.
+ *
+ * @license MIT
+ */function Kd(){return Kd=Object.assign?Object.assign.bind():function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r])}return n},Kd.apply(this,arguments)}function cS(n,e){return n===e&&(n!==0||1/n===1/e)||n!==n&&e!==e}const lS=typeof Object.is=="function"?Object.is:cS,{useState:uS,useEffect:dS,useLayoutEffect:hS,useDebugValue:fS}=Sl;function pS(n,e,t){const r=e(),[{inst:i},s]=uS({inst:{value:r,getSnapshot:e}});return hS(()=>{i.value=r,i.getSnapshot=e,Pu(i)&&s({inst:i})},[n,r,e]),dS(()=>(Pu(i)&&s({inst:i}),n(()=>{Pu(i)&&s({inst:i})})),[n]),fS(r),r}function Pu(n){const e=n.getSnapshot,t=n.value;try{const r=e();return!lS(t,r)}catch{return!0}}function gS(n,e,t){return e()}const mS=typeof window!="undefined"&&typeof window.document!="undefined"&&typeof window.document.createElement!="undefined",yS=!mS,vS=yS?gS:pS;"useSyncExternalStore"in Sl&&(n=>n.useSyncExternalStore)(Sl);const _S=si(null),ES=si(null),Vy=si(null),jl=si(null),Vl=si(null),xo=si({outlet:null,matches:[]}),Gy=si(null);function SS(n,e){let{relative:t}=e===void 0?{}:e;ec()||ht(!1);let{basename:r,navigator:i}=At(jl),{hash:s,pathname:o,search:a}=Wy(n,{relative:t}),l=o;return r!=="/"&&(l=o==="/"?r:Li([r,o])),i.createHref({pathname:l,search:a,hash:s})}function ec(){return At(Vl)!=null}function Gl(){return ec()||ht(!1),At(Vl).location}function bS(){ec()||ht(!1);let{basename:n,navigator:e}=At(jl),{matches:t}=At(xo),{pathname:r}=Gl(),i=JSON.stringify(qy(t).map(a=>a.pathnameBase)),s=Kl(!1);return Bl(()=>{s.current=!0}),Fl(function(a,l){if(l===void 0&&(l={}),!s.current)return;if(typeof a=="number"){e.go(a);return}let u=jy(a,JSON.parse(i),r,l.relative==="path");n!=="/"&&(u.pathname=u.pathname==="/"?n:Li([n,u.pathname])),(l.replace?e.replace:e.push)(u,l.state,l)},[n,e,i,r])}function Wy(n,e){let{relative:t}=e===void 0?{}:e,{matches:r}=At(xo),{pathname:i}=Gl(),s=JSON.stringify(qy(r).map(o=>o.pathnameBase));return fs(()=>jy(n,JSON.parse(s),i,t==="path"),[n,s,i,t])}function wS(n,e){ec()||ht(!1);let{navigator:t}=At(jl),r=At(Vy),{matches:i}=At(xo),s=i[i.length-1],o=s?s.params:{};s&&s.pathname;let a=s?s.pathnameBase:"/";s&&s.route;let l=Gl(),u;if(e){var c;let I=typeof e=="string"?Ao(e):e;a==="/"||((c=I.pathname)==null?void 0:c.startsWith(a))||ht(!1),u=I}else u=l;let g=u.pathname||"/",m=a==="/"?g:g.slice(a.length)||"/",f=BE(n,{pathname:m}),_=OS(f&&f.map(I=>Object.assign({},I,{params:Object.assign({},o,I.params),pathname:Li([a,t.encodeLocation?t.encodeLocation(I.pathname).pathname:I.pathname]),pathnameBase:I.pathnameBase==="/"?a:Li([a,t.encodeLocation?t.encodeLocation(I.pathnameBase).pathname:I.pathnameBase])})),i,r||void 0);return e&&_?Ie(Vl.Provider,{value:{location:Kd({pathname:"/",search:"",hash:"",state:null,key:"default"},u),navigationType:$i.Pop}},_):_}function RS(){let n=MS(),e=oS(n)?n.status+" "+n.statusText:n instanceof Error?n.message:JSON.stringify(n),t=n instanceof Error?n.stack:null,r="rgba(200,200,200, 0.5)",i={padding:"0.5rem",backgroundColor:r},s={padding:"2px 4px",backgroundColor:r};return Ie(en,null,Ie("h2",null,"Unhandled Thrown Error!"),Ie("h3",{style:{fontStyle:"italic"}},e),t?Ie("pre",{style:i},t):null,Ie("p",null,"\u{1F4BF} Hey developer \u{1F44B}"),Ie("p",null,"You can provide a way better UX than this when your app throws errors by providing your own\xA0",Ie("code",{style:s},"errorElement")," props on\xA0",Ie("code",{style:s},"<Route>")))}class IS extends Br{constructor(e){super(e),this.state={location:e.location,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location?{error:e.error,location:e.location}:{error:e.error||t.error,location:t.location}}componentDidCatch(e,t){console.error("React Router caught the following error during render",e,t)}render(){return this.state.error?Ie(xo.Provider,{value:this.props.routeContext},Ie(Gy.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function TS(n){let{routeContext:e,match:t,children:r}=n,i=At(_S);return i&&t.route.errorElement&&(i._deepestRenderedBoundaryId=t.route.id),Ie(xo.Provider,{value:e},r)}function OS(n,e,t){if(e===void 0&&(e=[]),n==null)if(t!=null&&t.errors)n=t.matches;else return null;let r=n,i=t==null?void 0:t.errors;if(i!=null){let s=r.findIndex(o=>o.route.id&&(i==null?void 0:i[o.route.id]));s>=0||ht(!1),r=r.slice(0,Math.min(r.length,s+1))}return r.reduceRight((s,o,a)=>{let l=o.route.id?i==null?void 0:i[o.route.id]:null,u=t?o.route.errorElement||Ie(RS,null):null,c=e.concat(r.slice(0,a+1)),g=()=>Ie(TS,{match:o,routeContext:{outlet:s,matches:c}},l?u:o.route.element!==void 0?o.route.element:s);return t&&(o.route.errorElement||a===0)?Ie(IS,{location:t.location,component:u,error:l,children:g(),routeContext:{outlet:null,matches:c}}):g()},null)}var pp;(function(n){n.UseRevalidator="useRevalidator"})(pp||(pp={}));var wl;(function(n){n.UseLoaderData="useLoaderData",n.UseActionData="useActionData",n.UseRouteError="useRouteError",n.UseNavigation="useNavigation",n.UseRouteLoaderData="useRouteLoaderData",n.UseMatches="useMatches",n.UseRevalidator="useRevalidator"})(wl||(wl={}));function kS(n){let e=At(Vy);return e||ht(!1),e}function CS(n){let e=At(xo);return e||ht(!1),e}function PS(n){let e=CS(),t=e.matches[e.matches.length-1];return t.route.id||ht(!1),t.route.id}function MS(){var n;let e=At(Gy),t=kS(wl.UseRouteError),r=PS(wl.UseRouteError);return e||((n=t.errors)==null?void 0:n[r])}function DS(n){ht(!1)}function AS(n){let{basename:e="/",children:t=null,location:r,navigationType:i=$i.Pop,navigator:s,static:o=!1}=n;ec()&&ht(!1);let a=e.replace(/^\/*/,"/"),l=fs(()=>({basename:a,navigator:s,static:o}),[a,s,o]);typeof r=="string"&&(r=Ao(r));let{pathname:u="/",search:c="",hash:g="",state:m=null,key:f="default"}=r,_=fs(()=>{let I=Fy(u,a);return I==null?null:{pathname:I,search:c,hash:g,state:m,key:f}},[a,u,c,g,m,f]);return _==null?null:Ie(jl.Provider,{value:l},Ie(Vl.Provider,{children:t,value:{location:_,navigationType:i}}))}function ex(n){let{children:e,location:t}=n,r=At(ES),i=r&&!e?r.router.routes:Fd(e);return wS(i,t)}var gp;(function(n){n[n.pending=0]="pending",n[n.success=1]="success",n[n.error=2]="error"})(gp||(gp={}));new Promise(()=>{});function Fd(n,e){e===void 0&&(e=[]);let t=[];return lf.forEach(n,(r,i)=>{if(!ql(r))return;if(r.type===en){t.push.apply(t,Fd(r.props.children,e));return}r.type!==DS&&ht(!1),!r.props.index||!r.props.children||ht(!1);let s=[...e,i],o={id:r.props.id||s.join("-"),caseSensitive:r.props.caseSensitive,element:r.props.element,index:r.props.index,path:r.props.path,loader:r.props.loader,action:r.props.action,errorElement:r.props.errorElement,hasErrorBoundary:r.props.errorElement!=null,shouldRevalidate:r.props.shouldRevalidate,handle:r.props.handle};r.props.children&&(o.children=Fd(r.props.children,s)),t.push(o)}),t}/**
+ * React Router DOM v6.6.1
+ *
+ * Copyright (c) Remix Software Inc.
+ *
+ * This source code is licensed under the MIT license found in the
+ * LICENSE.md file in the root directory of this source tree.
+ *
+ * @license MIT
+ */function qd(){return qd=Object.assign?Object.assign.bind():function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r])}return n},qd.apply(this,arguments)}function xS(n,e){if(n==null)return{};var t={},r=Object.keys(n),i,s;for(s=0;s<r.length;s++)i=r[s],!(e.indexOf(i)>=0)&&(t[i]=n[i]);return t}function US(n){return!!(n.metaKey||n.altKey||n.ctrlKey||n.shiftKey)}function $S(n,e){return n.button===0&&(!e||e==="_self")&&!US(n)}const NS=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset"];function tx(n){let{basename:e,children:t,window:r}=n,i=Kl();i.current==null&&(i.current=UE({window:r,v5Compat:!0}));let s=i.current,[o,a]=Za({action:s.action,location:s.location});return Do(()=>s.listen(a),[s]),Ie(AS,{basename:e,children:t,location:o.location,navigationType:o.action,navigator:s})}const rx=cf(function(e,t){let{onClick:r,relative:i,reloadDocument:s,replace:o,state:a,target:l,to:u,preventScrollReset:c}=e,g=xS(e,NS),m=SS(u,{relative:i}),f=LS(u,{replace:o,state:a,target:l,preventScrollReset:c,relative:i});function _(I){r&&r(I),I.defaultPrevented||f(I)}return Ie("a",qd({},g,{href:m,onClick:s?r:_,ref:t,target:l}))});var mp;(function(n){n.UseScrollRestoration="useScrollRestoration",n.UseSubmitImpl="useSubmitImpl",n.UseFetcher="useFetcher"})(mp||(mp={}));var yp;(function(n){n.UseFetchers="useFetchers",n.UseScrollRestoration="useScrollRestoration"})(yp||(yp={}));function LS(n,e){let{target:t,replace:r,state:i,preventScrollReset:s,relative:o}=e===void 0?{}:e,a=bS(),l=Gl(),u=Wy(n,{relative:o});return Fl(c=>{if($S(c,t)){c.preventDefault();let g=r!==void 0?r:Ba(l)===Ba(u);a(n,{replace:g,state:i,preventScrollReset:s,relative:o})}},[l,a,u,r,i,t,n,s,o])}var BS=0;function nx(n,e,t,r,i){var s,o,a={};for(o in e)o=="ref"?s=e[o]:a[o]=e[o];var l={type:n,props:a,key:t,ref:s,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:--BS,__source:i,__self:r};if(typeof n=="function"&&(s=n.defaultProps))for(o in s)a[o]===void 0&&(a[o]=s[o]);return J.vnode&&J.vnode(l),l}var V=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:{};function Hy(n){if(n.__esModule)return n;var e=Object.defineProperty({},"__esModule",{value:!0});return Object.keys(n).forEach(function(t){var r=Object.getOwnPropertyDescriptor(n,t);Object.defineProperty(e,t,r.get?r:{enumerable:!0,get:function(){return n[t]}})}),e}var rl={},KS=Hy(Sl),FS;function qS(n){if(n&&n.__esModule)return n;var e=Object.create(null);return n&&Object.keys(n).forEach(function(t){if(t!=="default"){var r=Object.getOwnPropertyDescriptor(n,t);Object.defineProperty(e,t,r.get?r:{enumerable:!0,get:function(){return n[t]}})}}),e.default=n,Object.freeze(e)}Object.defineProperty(rl,"__esModule",{value:!0});var Fn=qS(KS);const Mu=typeof window!="undefined";function Yy({debounceMs:n}){const[e,t]=Fn.useState(Mu?window.innerWidth:0),r=zy(()=>t(Mu?window.innerWidth:0),n);return Fn.useEffect(()=>{if(Mu)return window.addEventListener("resize",r),()=>window.removeEventListener("resize",r)},[r]),e}function zy(n,e){let t=null;return(...r)=>{clearTimeout(t),t=setTimeout(()=>n(r),e)}}const jS=Fn.forwardRef(({as:n="div",children:e,className:t,style:r,gap:i=10,debounce:s=200,nColumns:o=3},a)=>{const l=Yy({debounceMs:s}),[u,c]=Fn.useState([]);Fn.useLayoutEffect(()=>{var I;const m=R=>R.sort((T,C)=>T.size-C.size),f=typeof o=="number"?{columns:o}:(I=(R=>R==null?void 0:R[R.length-1])(m(((R,T)=>R.filter(C=>C.size<=T))(o,l))))!=null?I:(R=>R==null?void 0:R[0])(m(o)),_=Array.from({length:f.columns},R=>[]);Fn.Children.forEach(e,(R,T)=>{const C=`item-${T}`,S=Fn.cloneElement(R,{...R.props,key:C});_[T%_.length].push(S)}),c(_)},[e,o,l]);const g={mainGrid:{display:"grid",gridTemplateColumns:`repeat(${u.length}, 1fr)`,columnGap:i,alignItems:"start"},columnGrid:{display:"grid",gridTemplateColumns:"100%",rowGap:i}};return Fn.createElement(n,{ref:a,"data-testid":"plock-container",className:t,style:{style:r,...g.mainGrid}},u.map((m,f)=>Fn.createElement("div",{"data-testid":"plock-column",style:g.columnGrid,key:f},m)))});FS=rl.Plock=jS,rl.useDebounce=zy,rl.useWindowWidth=Yy;var VS={},G={exports:{}};(function(n){function e(t){return t&&t.__esModule?t:{default:t}}n.exports=e,n.exports.__esModule=!0,n.exports.default=n.exports})(G);var Jy={exports:{}};(function(n,e){(function(t,r){n.exports=r()})(V,function(){var t=XMLHttpRequest;if(!t)throw new Error("missing XMLHttpRequest");i.log={trace:l,debug:l,info:l,warn:l,error:l};var r=3*60*1e3;function i(f,_){if(typeof _!="function")throw new Error("Bad callback given: "+_);if(!f)throw new Error("No options given");var I=f.onResponse;if(typeof f=="string"?f={uri:f}:f=JSON.parse(JSON.stringify(f)),f.onResponse=I,f.verbose&&(i.log=u()),f.url&&(f.uri=f.url,delete f.url),!f.uri&&f.uri!=="")throw new Error("options.uri is a required argument");if(typeof f.uri!="string")throw new Error("options.uri must be a string");for(var R=["proxy","_redirectsFollowed","maxRedirects","followRedirect"],T=0;T<R.length;T++)if(f[R[T]])throw new Error("options."+R[T]+" is not supported");if(f.callback=_,f.method=f.method||"GET",f.headers=f.headers||{},f.body=f.body||null,f.timeout=f.timeout||i.DEFAULT_TIMEOUT,f.headers.host)throw new Error("Options.headers.host is not supported");f.json&&(f.headers.accept=f.headers.accept||"application/json",f.method!=="GET"&&(f.headers["content-type"]="application/json"),typeof f.json!="boolean"?f.body=JSON.stringify(f.json):typeof f.body!="string"&&(f.body=JSON.stringify(f.body)));var C=function(L){var q=[];for(var F in L)L.hasOwnProperty(F)&&q.push(encodeURIComponent(F)+"="+encodeURIComponent(L[F]));return q.join("&")};if(f.qs){var S=typeof f.qs=="string"?f.qs:C(f.qs);f.uri.indexOf("?")!==-1?f.uri=f.uri+"&"+S:f.uri=f.uri+"?"+S}var k=function(L){var q={};q.boundry="-------------------------------"+Math.floor(Math.random()*1e9);var F=[];for(var he in L)L.hasOwnProperty(he)&&F.push("--"+q.boundry+`
+Content-Disposition: form-data; name="`+he+`"
+
+`+L[he]+`
+`);return F.push("--"+q.boundry+"--"),q.body=F.join(""),q.length=q.body.length,q.type="multipart/form-data; boundary="+q.boundry,q};if(f.form){if(typeof f.form=="string")throw"form name unsupported";if(f.method==="POST"){var A=(f.encoding||"application/x-www-form-urlencoded").toLowerCase();switch(f.headers["content-type"]=A,A){case"application/x-www-form-urlencoded":f.body=C(f.form).replace(/%20/g,"+");break;case"multipart/form-data":var w=k(f.form);f.body=w.body,f.headers["content-type"]=w.type;break;default:throw new Error("unsupported encoding:"+A)}}}return f.onResponse=f.onResponse||l,f.onResponse===!0&&(f.onResponse=_,f.callback=l),!f.headers.authorization&&f.auth&&(f.headers.authorization="Basic "+m(f.auth.username+":"+f.auth.password)),o(f)}var s=0;function o(f){var _=new t,I=!1,R=g(f.uri),T="withCredentials"in _;if(s+=1,_.seq_id=s,_.id=s+": "+f.method+" "+f.uri,_._id=_.id,R&&!T){var C=new Error("Browser does not support cross-origin request: "+f.uri);return C.cors="unsupported",f.callback(C,_)}_.timeoutTimer=setTimeout(S,f.timeout);function S(){I=!0;var F=new Error("ETIMEDOUT");return F.code="ETIMEDOUT",F.duration=f.timeout,i.log.error("Timeout",{id:_._id,milliseconds:f.timeout}),f.callback(F,_)}var k={response:!1,loading:!1,end:!1};return _.onreadystatechange=A,_.open(f.method,f.uri,!0),R&&(_.withCredentials=!!f.withCredentials),_.send(f.body),_;function A(F){if(I)return i.log.debug("Ignoring timed out state change",{state:_.readyState,id:_.id});if(i.log.debug("State change",{state:_.readyState,id:_.id,timed_out:I}),_.readyState===t.OPENED){i.log.debug("Request started",{id:_.id});for(var he in f.headers)_.setRequestHeader(he,f.headers[he])}else _.readyState===t.HEADERS_RECEIVED?w():_.readyState===t.LOADING?(w(),L()):_.readyState===t.DONE&&(w(),L(),q())}function w(){if(!k.response){if(k.response=!0,i.log.debug("Got response",{id:_.id,status:_.status}),clearTimeout(_.timeoutTimer),_.statusCode=_.status,R&&_.statusCode==0){var F=new Error("CORS request rejected: "+f.uri);return F.cors="rejected",k.loading=!0,k.end=!0,f.callback(F,_)}f.onResponse(null,_)}}function L(){k.loading||(k.loading=!0,i.log.debug("Response body loading",{id:_.id}))}function q(){if(!k.end){if(k.end=!0,i.log.debug("Request done",{id:_.id}),_.body=_.responseText,f.json)try{_.body=JSON.parse(_.responseText)}catch(F){return f.callback(F,_)}f.callback(null,_,_.body)}}}i.withCredentials=!1,i.DEFAULT_TIMEOUT=r,i.defaults=function(f,_){var I=function(T){var C=function(S,k){typeof S=="string"?S={uri:S}:S=JSON.parse(JSON.stringify(S));for(var A in f)S[A]===void 0&&(S[A]=f[A]);return T(S,k)};return C},R=I(i);return R.get=I(i.get),R.post=I(i.post),R.put=I(i.put),R.head=I(i.head),R};var a=["get","put","post","head"];a.forEach(function(f){var _=f.toUpperCase(),I=f.toLowerCase();i[I]=function(R){typeof R=="string"?R={method:_,uri:R}:(R=JSON.parse(JSON.stringify(R)),R.method=_);var T=[R].concat(Array.prototype.slice.apply(arguments,[1]));return i.apply(this,T)}}),i.couch=function(f,_){typeof f=="string"&&(f={uri:f}),f.json=!0,f.body&&(f.json=f.body),delete f.body,_=_||l;var I=i(f,R);return I;function R(T,C,S){if(T)return _(T,C,S);if((C.statusCode<200||C.statusCode>299)&&S.error){T=new Error("CouchDB error: "+(S.error.reason||S.error.error));for(var k in S)T[k]=S[k];return _(T,C,S)}return _(T,C,S)}};function l(){}function u(){var f={},_=["trace","debug","info","warn","error"],I,R;for(R=0;R<_.length;R++)I=_[R],f[I]=l,typeof console!="undefined"&&console&&console[I]&&(f[I]=c(console,I));return f}function c(f,_){return I;function I(R,T){return typeof T=="object"&&(R+=" "+JSON.stringify(T)),f[_].call(f,R)}}function g(f){var _=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+))?)?/,I;try{I=location.href}catch{I=document.createElement("a"),I.href="",I=I.href}var R=_.exec(I.toLowerCase())||[],T=_.exec(f.toLowerCase()),C=!!(T&&(T[1]!=R[1]||T[2]!=R[2]||(T[3]||(T[1]==="http:"?80:443))!=(R[3]||(R[1]==="http:"?80:443))));return C}function m(f){var _="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",I,R,T,C,S,k,A,w,L=0,q=0,F="",he=[];if(!f)return f;do I=f.charCodeAt(L++),R=f.charCodeAt(L++),T=f.charCodeAt(L++),w=I<<16|R<<8|T,C=w>>18&63,S=w>>12&63,k=w>>6&63,A=w&63,he[q++]=_.charAt(C)+_.charAt(S)+_.charAt(k)+_.charAt(A);while(L<f.length);switch(F=he.join(""),f.length%3){case 1:F=F.slice(0,-2)+"==";break;case 2:F=F.slice(0,-1)+"=";break}return F}return i})})(Jy);var GS=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var e={},t=Symbol("test"),r=Object(t);if(typeof t=="string"||Object.prototype.toString.call(t)!=="[object Symbol]"||Object.prototype.toString.call(r)!=="[object Symbol]")return!1;var i=42;e[t]=i;for(t in e)return!1;if(typeof Object.keys=="function"&&Object.keys(e).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(e).length!==0)return!1;var s=Object.getOwnPropertySymbols(e);if(s.length!==1||s[0]!==t||!Object.prototype.propertyIsEnumerable.call(e,t))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var o=Object.getOwnPropertyDescriptor(e,t);if(o.value!==i||o.enumerable!==!0)return!1}return!0},vp=typeof Symbol!="undefined"&&Symbol,WS=GS,HS=function(){return typeof vp!="function"||typeof Symbol!="function"||typeof vp("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:WS()},YS="Function.prototype.bind called on incompatible ",Du=Array.prototype.slice,zS=Object.prototype.toString,JS="[object Function]",XS=function(e){var t=this;if(typeof t!="function"||zS.call(t)!==JS)throw new TypeError(YS+t);for(var r=Du.call(arguments,1),i,s=function(){if(this instanceof i){var c=t.apply(this,r.concat(Du.call(arguments)));return Object(c)===c?c:this}else return t.apply(e,r.concat(Du.call(arguments)))},o=Math.max(0,t.length-r.length),a=[],l=0;l<o;l++)a.push("$"+l);if(i=Function("binder","return function ("+a.join(",")+"){ return binder.apply(this,arguments); }")(s),t.prototype){var u=function(){};u.prototype=t.prototype,i.prototype=new u,u.prototype=null}return i},QS=XS,hf=Function.prototype.bind||QS,ZS=hf,eb=ZS.call(Function.call,Object.prototype.hasOwnProperty),pe,bo=SyntaxError,Xy=Function,fo=TypeError,Au=function(n){try{return Xy('"use strict"; return ('+n+").constructor;")()}catch{}},ds=Object.getOwnPropertyDescriptor;if(ds)try{ds({},"")}catch{ds=null}var xu=function(){throw new fo},tb=ds?function(){try{return arguments.callee,xu}catch{try{return ds(arguments,"callee").get}catch{return xu}}}():xu,Bs=HS(),Pi=Object.getPrototypeOf||function(n){return n.__proto__},so={},rb=typeof Uint8Array=="undefined"?pe:Pi(Uint8Array),po={"%AggregateError%":typeof AggregateError=="undefined"?pe:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer=="undefined"?pe:ArrayBuffer,"%ArrayIteratorPrototype%":Bs?Pi([][Symbol.iterator]()):pe,"%AsyncFromSyncIteratorPrototype%":pe,"%AsyncFunction%":so,"%AsyncGenerator%":so,"%AsyncGeneratorFunction%":so,"%AsyncIteratorPrototype%":so,"%Atomics%":typeof Atomics=="undefined"?pe:Atomics,"%BigInt%":typeof BigInt=="undefined"?pe:BigInt,"%Boolean%":Boolean,"%DataView%":typeof DataView=="undefined"?pe:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":typeof Float32Array=="undefined"?pe:Float32Array,"%Float64Array%":typeof Float64Array=="undefined"?pe:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry=="undefined"?pe:FinalizationRegistry,"%Function%":Xy,"%GeneratorFunction%":so,"%Int8Array%":typeof Int8Array=="undefined"?pe:Int8Array,"%Int16Array%":typeof Int16Array=="undefined"?pe:Int16Array,"%Int32Array%":typeof Int32Array=="undefined"?pe:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":Bs?Pi(Pi([][Symbol.iterator]())):pe,"%JSON%":typeof JSON=="object"?JSON:pe,"%Map%":typeof Map=="undefined"?pe:Map,"%MapIteratorPrototype%":typeof Map=="undefined"||!Bs?pe:Pi(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise=="undefined"?pe:Promise,"%Proxy%":typeof Proxy=="undefined"?pe:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":typeof Reflect=="undefined"?pe:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set=="undefined"?pe:Set,"%SetIteratorPrototype%":typeof Set=="undefined"||!Bs?pe:Pi(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer=="undefined"?pe:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":Bs?Pi(""[Symbol.iterator]()):pe,"%Symbol%":Bs?Symbol:pe,"%SyntaxError%":bo,"%ThrowTypeError%":tb,"%TypedArray%":rb,"%TypeError%":fo,"%Uint8Array%":typeof Uint8Array=="undefined"?pe:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray=="undefined"?pe:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array=="undefined"?pe:Uint16Array,"%Uint32Array%":typeof Uint32Array=="undefined"?pe:Uint32Array,"%URIError%":URIError,"%WeakMap%":typeof WeakMap=="undefined"?pe:WeakMap,"%WeakRef%":typeof WeakRef=="undefined"?pe:WeakRef,"%WeakSet%":typeof WeakSet=="undefined"?pe:WeakSet},nb=function n(e){var t;if(e==="%AsyncFunction%")t=Au("async function () {}");else if(e==="%GeneratorFunction%")t=Au("function* () {}");else if(e==="%AsyncGeneratorFunction%")t=Au("async function* () {}");else if(e==="%AsyncGenerator%"){var r=n("%AsyncGeneratorFunction%");r&&(t=r.prototype)}else if(e==="%AsyncIteratorPrototype%"){var i=n("%AsyncGenerator%");i&&(t=Pi(i.prototype))}return po[e]=t,t},_p={"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},tc=hf,Rl=eb,ib=tc.call(Function.call,Array.prototype.concat),sb=tc.call(Function.apply,Array.prototype.splice),Ep=tc.call(Function.call,String.prototype.replace),Il=tc.call(Function.call,String.prototype.slice),ob=tc.call(Function.call,RegExp.prototype.exec),ab=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,cb=/\\(\\)?/g,lb=function(e){var t=Il(e,0,1),r=Il(e,-1);if(t==="%"&&r!=="%")throw new bo("invalid intrinsic syntax, expected closing `%`");if(r==="%"&&t!=="%")throw new bo("invalid intrinsic syntax, expected opening `%`");var i=[];return Ep(e,ab,function(s,o,a,l){i[i.length]=a?Ep(l,cb,"$1"):o||s}),i},ub=function(e,t){var r=e,i;if(Rl(_p,r)&&(i=_p[r],r="%"+i[0]+"%"),Rl(po,r)){var s=po[r];if(s===so&&(s=nb(r)),typeof s=="undefined"&&!t)throw new fo("intrinsic "+e+" exists, but is not available. Please file an issue!");return{alias:i,name:r,value:s}}throw new bo("intrinsic "+e+" does not exist!")},ff=function(e,t){if(typeof e!="string"||e.length===0)throw new fo("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof t!="boolean")throw new fo('"allowMissing" argument must be a boolean');if(ob(/^%?[^%]*%?$/,e)===null)throw new bo("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var r=lb(e),i=r.length>0?r[0]:"",s=ub("%"+i+"%",t),o=s.name,a=s.value,l=!1,u=s.alias;u&&(i=u[0],sb(r,ib([0,1],u)));for(var c=1,g=!0;c<r.length;c+=1){var m=r[c],f=Il(m,0,1),_=Il(m,-1);if((f==='"'||f==="'"||f==="`"||_==='"'||_==="'"||_==="`")&&f!==_)throw new bo("property names with quotes must have matching quotes");if((m==="constructor"||!g)&&(l=!0),i+="."+m,o="%"+i+"%",Rl(po,o))a=po[o];else if(a!=null){if(!(m in a)){if(!t)throw new fo("base intrinsic for "+e+" exists, but the property is not available.");return}if(ds&&c+1>=r.length){var I=ds(a,m);g=!!I,g&&"get"in I&&!("originalValue"in I.get)?a=I.get:a=a[m]}else g=Rl(a,m),a=a[m];g&&!l&&(po[o]=a)}}return a},Qy={exports:{}};(function(n){var e=hf,t=ff,r=t("%Function.prototype.apply%"),i=t("%Function.prototype.call%"),s=t("%Reflect.apply%",!0)||e.call(i,r),o=t("%Object.getOwnPropertyDescriptor%",!0),a=t("%Object.defineProperty%",!0),l=t("%Math.max%");if(a)try{a({},"a",{value:1})}catch{a=null}n.exports=function(g){var m=s(e,i,arguments);if(o&&a){var f=o(m,"length");f.configurable&&a(m,"length",{value:1+l(0,g.length-(arguments.length-1))})}return m};var u=function(){return s(e,r,arguments)};a?a(n.exports,"apply",{value:u}):n.exports.apply=u})(Qy);var Zy=ff,ev=Qy.exports,db=ev(Zy("String.prototype.indexOf")),hb=function(e,t){var r=Zy(e,!!t);return typeof r=="function"&&db(e,".prototype.")>-1?ev(r):r},fb={},pb=Object.freeze(Object.defineProperty({__proto__:null,default:fb},Symbol.toStringTag,{value:"Module"})),Mi=Hy(pb),pf=typeof Map=="function"&&Map.prototype,Uu=Object.getOwnPropertyDescriptor&&pf?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,Tl=pf&&Uu&&typeof Uu.get=="function"?Uu.get:null,gb=pf&&Map.prototype.forEach,gf=typeof Set=="function"&&Set.prototype,$u=Object.getOwnPropertyDescriptor&&gf?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,Ol=gf&&$u&&typeof $u.get=="function"?$u.get:null,mb=gf&&Set.prototype.forEach,yb=typeof WeakMap=="function"&&WeakMap.prototype,ka=yb?WeakMap.prototype.has:null,vb=typeof WeakSet=="function"&&WeakSet.prototype,Ca=vb?WeakSet.prototype.has:null,_b=typeof WeakRef=="function"&&WeakRef.prototype,Sp=_b?WeakRef.prototype.deref:null,Eb=Boolean.prototype.valueOf,Sb=Object.prototype.toString,bb=Function.prototype.toString,wb=String.prototype.match,mf=String.prototype.slice,Ni=String.prototype.replace,Rb=String.prototype.toUpperCase,bp=String.prototype.toLowerCase,tv=RegExp.prototype.test,wp=Array.prototype.concat,Sn=Array.prototype.join,Ib=Array.prototype.slice,Rp=Math.floor,jd=typeof BigInt=="function"?BigInt.prototype.valueOf:null,Nu=Object.getOwnPropertySymbols,Vd=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,wo=typeof Symbol=="function"&&typeof Symbol.iterator=="object",xt=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===wo?"object":"symbol")?Symbol.toStringTag:null,rv=Object.prototype.propertyIsEnumerable,Ip=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(n){return n.__proto__}:null);function Tp(n,e){if(n===1/0||n===-1/0||n!==n||n&&n>-1e3&&n<1e3||tv.call(/e/,e))return e;var t=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof n=="number"){var r=n<0?-Rp(-n):Rp(n);if(r!==n){var i=String(r),s=mf.call(e,i.length+1);return Ni.call(i,t,"$&_")+"."+Ni.call(Ni.call(s,/([0-9]{3})/g,"$&_"),/_$/,"")}}return Ni.call(e,t,"$&_")}var Gd=Mi,Op=Gd.custom,kp=iv(Op)?Op:null,Tb=function n(e,t,r,i){var s=t||{};if(Di(s,"quoteStyle")&&s.quoteStyle!=="single"&&s.quoteStyle!=="double")throw new TypeError('option "quoteStyle" must be "single" or "double"');if(Di(s,"maxStringLength")&&(typeof s.maxStringLength=="number"?s.maxStringLength<0&&s.maxStringLength!==1/0:s.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var o=Di(s,"customInspect")?s.customInspect:!0;if(typeof o!="boolean"&&o!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(Di(s,"indent")&&s.indent!==null&&s.indent!==" "&&!(parseInt(s.indent,10)===s.indent&&s.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(Di(s,"numericSeparator")&&typeof s.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var a=s.numericSeparator;if(typeof e=="undefined")return"undefined";if(e===null)return"null";if(typeof e=="boolean")return e?"true":"false";if(typeof e=="string")return ov(e,s);if(typeof e=="number"){if(e===0)return 1/0/e>0?"0":"-0";var l=String(e);return a?Tp(e,l):l}if(typeof e=="bigint"){var u=String(e)+"n";return a?Tp(e,u):u}var c=typeof s.depth=="undefined"?5:s.depth;if(typeof r=="undefined"&&(r=0),r>=c&&c>0&&typeof e=="object")return Wd(e)?"[Array]":"[Object]";var g=Vb(s,r);if(typeof i=="undefined")i=[];else if(sv(i,e)>=0)return"[Circular]";function m(Qe,ft,at){if(ft&&(i=Ib.call(i),i.push(ft)),at){var Yt={depth:s.depth};return Di(s,"quoteStyle")&&(Yt.quoteStyle=s.quoteStyle),n(Qe,Yt,r+1,i)}return n(Qe,s,r+1,i)}if(typeof e=="function"&&!Cp(e)){var f=Ub(e),_=Ec(e,m);return"[Function"+(f?": "+f:" (anonymous)")+"]"+(_.length>0?" { "+Sn.call(_,", ")+" }":"")}if(iv(e)){var I=wo?Ni.call(String(e),/^(Symbol\(.*\))_[^)]*$/,"$1"):Vd.call(e);return typeof e=="object"&&!wo?zo(I):I}if(Fb(e)){for(var R="<"+bp.call(String(e.nodeName)),T=e.attributes||[],C=0;C<T.length;C++)R+=" "+T[C].name+"="+nv(Ob(T[C].value),"double",s);return R+=">",e.childNodes&&e.childNodes.length&&(R+="..."),R+="</"+bp.call(String(e.nodeName))+">",R}if(Wd(e)){if(e.length===0)return"[]";var S=Ec(e,m);return g&&!jb(S)?"["+Hd(S,g)+"]":"[ "+Sn.call(S,", ")+" ]"}if(Cb(e)){var k=Ec(e,m);return!("cause"in Error.prototype)&&"cause"in e&&!rv.call(e,"cause")?"{ ["+String(e)+"] "+Sn.call(wp.call("[cause]: "+m(e.cause),k),", ")+" }":k.length===0?"["+String(e)+"]":"{ ["+String(e)+"] "+Sn.call(k,", ")+" }"}if(typeof e=="object"&&o){if(kp&&typeof e[kp]=="function"&&Gd)return Gd(e,{depth:c-r});if(o!=="symbol"&&typeof e.inspect=="function")return e.inspect()}if($b(e)){var A=[];return gb.call(e,function(Qe,ft){A.push(m(ft,e,!0)+" => "+m(Qe,e))}),Pp("Map",Tl.call(e),A,g)}if(Bb(e)){var w=[];return mb.call(e,function(Qe){w.push(m(Qe,e))}),Pp("Set",Ol.call(e),w,g)}if(Nb(e))return Lu("WeakMap");if(Kb(e))return Lu("WeakSet");if(Lb(e))return Lu("WeakRef");if(Mb(e))return zo(m(Number(e)));if(Ab(e))return zo(m(jd.call(e)));if(Db(e))return zo(Eb.call(e));if(Pb(e))return zo(m(String(e)));if(!kb(e)&&!Cp(e)){var L=Ec(e,m),q=Ip?Ip(e)===Object.prototype:e instanceof Object||e.constructor===Object,F=e instanceof Object?"":"null prototype",he=!q&&xt&&Object(e)===e&&xt in e?mf.call(qi(e),8,-1):F?"Object":"",Fe=q||typeof e.constructor!="function"?"":e.constructor.name?e.constructor.name+" ":"",Ve=Fe+(he||F?"["+Sn.call(wp.call([],he||[],F||[]),": ")+"] ":"");return L.length===0?Ve+"{}":g?Ve+"{"+Hd(L,g)+"}":Ve+"{ "+Sn.call(L,", ")+" }"}return String(e)};function nv(n,e,t){var r=(t.quoteStyle||e)==="double"?'"':"'";return r+n+r}function Ob(n){return Ni.call(String(n),/"/g,""")}function Wd(n){return qi(n)==="[object Array]"&&(!xt||!(typeof n=="object"&&xt in n))}function kb(n){return qi(n)==="[object Date]"&&(!xt||!(typeof n=="object"&&xt in n))}function Cp(n){return qi(n)==="[object RegExp]"&&(!xt||!(typeof n=="object"&&xt in n))}function Cb(n){return qi(n)==="[object Error]"&&(!xt||!(typeof n=="object"&&xt in n))}function Pb(n){return qi(n)==="[object String]"&&(!xt||!(typeof n=="object"&&xt in n))}function Mb(n){return qi(n)==="[object Number]"&&(!xt||!(typeof n=="object"&&xt in n))}function Db(n){return qi(n)==="[object Boolean]"&&(!xt||!(typeof n=="object"&&xt in n))}function iv(n){if(wo)return n&&typeof n=="object"&&n instanceof Symbol;if(typeof n=="symbol")return!0;if(!n||typeof n!="object"||!Vd)return!1;try{return Vd.call(n),!0}catch{}return!1}function Ab(n){if(!n||typeof n!="object"||!jd)return!1;try{return jd.call(n),!0}catch{}return!1}var xb=Object.prototype.hasOwnProperty||function(n){return n in this};function Di(n,e){return xb.call(n,e)}function qi(n){return Sb.call(n)}function Ub(n){if(n.name)return n.name;var e=wb.call(bb.call(n),/^function\s*([\w$]+)/);return e?e[1]:null}function sv(n,e){if(n.indexOf)return n.indexOf(e);for(var t=0,r=n.length;t<r;t++)if(n[t]===e)return t;return-1}function $b(n){if(!Tl||!n||typeof n!="object")return!1;try{Tl.call(n);try{Ol.call(n)}catch{return!0}return n instanceof Map}catch{}return!1}function Nb(n){if(!ka||!n||typeof n!="object")return!1;try{ka.call(n,ka);try{Ca.call(n,Ca)}catch{return!0}return n instanceof WeakMap}catch{}return!1}function Lb(n){if(!Sp||!n||typeof n!="object")return!1;try{return Sp.call(n),!0}catch{}return!1}function Bb(n){if(!Ol||!n||typeof n!="object")return!1;try{Ol.call(n);try{Tl.call(n)}catch{return!0}return n instanceof Set}catch{}return!1}function Kb(n){if(!Ca||!n||typeof n!="object")return!1;try{Ca.call(n,Ca);try{ka.call(n,ka)}catch{return!0}return n instanceof WeakSet}catch{}return!1}function Fb(n){return!n||typeof n!="object"?!1:typeof HTMLElement!="undefined"&&n instanceof HTMLElement?!0:typeof n.nodeName=="string"&&typeof n.getAttribute=="function"}function ov(n,e){if(n.length>e.maxStringLength){var t=n.length-e.maxStringLength,r="... "+t+" more character"+(t>1?"s":"");return ov(mf.call(n,0,e.maxStringLength),e)+r}var i=Ni.call(Ni.call(n,/(['\\])/g,"\\$1"),/[\x00-\x1f]/g,qb);return nv(i,"single",e)}function qb(n){var e=n.charCodeAt(0),t={8:"b",9:"t",10:"n",12:"f",13:"r"}[e];return t?"\\"+t:"\\x"+(e<16?"0":"")+Rb.call(e.toString(16))}function zo(n){return"Object("+n+")"}function Lu(n){return n+" { ? }"}function Pp(n,e,t,r){var i=r?Hd(t,r):Sn.call(t,", ");return n+" ("+e+") {"+i+"}"}function jb(n){for(var e=0;e<n.length;e++)if(sv(n[e],`
+`)>=0)return!1;return!0}function Vb(n,e){var t;if(n.indent===" ")t=" ";else if(typeof n.indent=="number"&&n.indent>0)t=Sn.call(Array(n.indent+1)," ");else return null;return{base:t,prev:Sn.call(Array(e+1),t)}}function Hd(n,e){if(n.length===0)return"";var t=`
+`+e.prev+e.base;return t+Sn.call(n,","+t)+`
+`+e.prev}function Ec(n,e){var t=Wd(n),r=[];if(t){r.length=n.length;for(var i=0;i<n.length;i++)r[i]=Di(n,i)?e(n[i],n):""}var s=typeof Nu=="function"?Nu(n):[],o;if(wo){o={};for(var a=0;a<s.length;a++)o["$"+s[a]]=s[a]}for(var l in n)!Di(n,l)||t&&String(Number(l))===l&&l<n.length||wo&&o["$"+l]instanceof Symbol||(tv.call(/[^\w$]/,l)?r.push(e(l,n)+": "+e(n[l],n)):r.push(l+": "+e(n[l],n)));if(typeof Nu=="function")for(var u=0;u<s.length;u++)rv.call(n,s[u])&&r.push("["+e(s[u])+"]: "+e(n[s[u]],n));return r}var yf=ff,Uo=hb,Gb=Tb,Wb=yf("%TypeError%"),Sc=yf("%WeakMap%",!0),bc=yf("%Map%",!0),Hb=Uo("WeakMap.prototype.get",!0),Yb=Uo("WeakMap.prototype.set",!0),zb=Uo("WeakMap.prototype.has",!0),Jb=Uo("Map.prototype.get",!0),Xb=Uo("Map.prototype.set",!0),Qb=Uo("Map.prototype.has",!0),vf=function(n,e){for(var t=n,r;(r=t.next)!==null;t=r)if(r.key===e)return t.next=r.next,r.next=n.next,n.next=r,r},Zb=function(n,e){var t=vf(n,e);return t&&t.value},ew=function(n,e,t){var r=vf(n,e);r?r.value=t:n.next={key:e,next:n.next,value:t}},tw=function(n,e){return!!vf(n,e)},rw=function(){var e,t,r,i={assert:function(s){if(!i.has(s))throw new Wb("Side channel does not contain "+Gb(s))},get:function(s){if(Sc&&s&&(typeof s=="object"||typeof s=="function")){if(e)return Hb(e,s)}else if(bc){if(t)return Jb(t,s)}else if(r)return Zb(r,s)},has:function(s){if(Sc&&s&&(typeof s=="object"||typeof s=="function")){if(e)return zb(e,s)}else if(bc){if(t)return Qb(t,s)}else if(r)return tw(r,s);return!1},set:function(s,o){Sc&&s&&(typeof s=="object"||typeof s=="function")?(e||(e=new Sc),Yb(e,s,o)):bc?(t||(t=new bc),Xb(t,s,o)):(r||(r={key:{},next:null}),ew(r,s,o))}};return i},nw=String.prototype.replace,iw=/%20/g,Bu={RFC1738:"RFC1738",RFC3986:"RFC3986"},_f={default:Bu.RFC3986,formatters:{RFC1738:function(n){return nw.call(n,iw,"+")},RFC3986:function(n){return String(n)}},RFC1738:Bu.RFC1738,RFC3986:Bu.RFC3986},sw=_f,Ku=Object.prototype.hasOwnProperty,os=Array.isArray,cn=function(){for(var n=[],e=0;e<256;++e)n.push("%"+((e<16?"0":"")+e.toString(16)).toUpperCase());return n}(),ow=function(e){for(;e.length>1;){var t=e.pop(),r=t.obj[t.prop];if(os(r)){for(var i=[],s=0;s<r.length;++s)typeof r[s]!="undefined"&&i.push(r[s]);t.obj[t.prop]=i}}},av=function(e,t){for(var r=t&&t.plainObjects?Object.create(null):{},i=0;i<e.length;++i)typeof e[i]!="undefined"&&(r[i]=e[i]);return r},aw=function n(e,t,r){if(!t)return e;if(typeof t!="object"){if(os(e))e.push(t);else if(e&&typeof e=="object")(r&&(r.plainObjects||r.allowPrototypes)||!Ku.call(Object.prototype,t))&&(e[t]=!0);else return[e,t];return e}if(!e||typeof e!="object")return[e].concat(t);var i=e;return os(e)&&!os(t)&&(i=av(e,r)),os(e)&&os(t)?(t.forEach(function(s,o){if(Ku.call(e,o)){var a=e[o];a&&typeof a=="object"&&s&&typeof s=="object"?e[o]=n(a,s,r):e.push(s)}else e[o]=s}),e):Object.keys(t).reduce(function(s,o){var a=t[o];return Ku.call(s,o)?s[o]=n(s[o],a,r):s[o]=a,s},i)},cw=function(e,t){return Object.keys(t).reduce(function(r,i){return r[i]=t[i],r},e)},lw=function(n,e,t){var r=n.replace(/\+/g," ");if(t==="iso-8859-1")return r.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(r)}catch{return r}},uw=function(e,t,r,i,s){if(e.length===0)return e;var o=e;if(typeof e=="symbol"?o=Symbol.prototype.toString.call(e):typeof e!="string"&&(o=String(e)),r==="iso-8859-1")return escape(o).replace(/%u[0-9a-f]{4}/gi,function(c){return"%26%23"+parseInt(c.slice(2),16)+"%3B"});for(var a="",l=0;l<o.length;++l){var u=o.charCodeAt(l);if(u===45||u===46||u===95||u===126||u>=48&&u<=57||u>=65&&u<=90||u>=97&&u<=122||s===sw.RFC1738&&(u===40||u===41)){a+=o.charAt(l);continue}if(u<128){a=a+cn[u];continue}if(u<2048){a=a+(cn[192|u>>6]+cn[128|u&63]);continue}if(u<55296||u>=57344){a=a+(cn[224|u>>12]+cn[128|u>>6&63]+cn[128|u&63]);continue}l+=1,u=65536+((u&1023)<<10|o.charCodeAt(l)&1023),a+=cn[240|u>>18]+cn[128|u>>12&63]+cn[128|u>>6&63]+cn[128|u&63]}return a},dw=function(e){for(var t=[{obj:{o:e},prop:"o"}],r=[],i=0;i<t.length;++i)for(var s=t[i],o=s.obj[s.prop],a=Object.keys(o),l=0;l<a.length;++l){var u=a[l],c=o[u];typeof c=="object"&&c!==null&&r.indexOf(c)===-1&&(t.push({obj:o,prop:u}),r.push(c))}return ow(t),e},hw=function(e){return Object.prototype.toString.call(e)==="[object RegExp]"},fw=function(e){return!e||typeof e!="object"?!1:!!(e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer(e))},pw=function(e,t){return[].concat(e,t)},gw=function(e,t){if(os(e)){for(var r=[],i=0;i<e.length;i+=1)r.push(t(e[i]));return r}return t(e)},cv={arrayToObject:av,assign:cw,combine:pw,compact:dw,decode:lw,encode:uw,isBuffer:fw,isRegExp:hw,maybeMap:gw,merge:aw},lv=rw,Yd=cv,Pa=_f,mw=Object.prototype.hasOwnProperty,Mp={brackets:function(e){return e+"[]"},comma:"comma",indices:function(e,t){return e+"["+t+"]"},repeat:function(e){return e}},Vn=Array.isArray,yw=String.prototype.split,vw=Array.prototype.push,uv=function(n,e){vw.apply(n,Vn(e)?e:[e])},_w=Date.prototype.toISOString,Dp=Pa.default,St={addQueryPrefix:!1,allowDots:!1,charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encoder:Yd.encode,encodeValuesOnly:!1,format:Dp,formatter:Pa.formatters[Dp],indices:!1,serializeDate:function(e){return _w.call(e)},skipNulls:!1,strictNullHandling:!1},Ew=function(e){return typeof e=="string"||typeof e=="number"||typeof e=="boolean"||typeof e=="symbol"||typeof e=="bigint"},Fu={},Sw=function n(e,t,r,i,s,o,a,l,u,c,g,m,f,_,I,R){for(var T=e,C=R,S=0,k=!1;(C=C.get(Fu))!==void 0&&!k;){var A=C.get(e);if(S+=1,typeof A!="undefined"){if(A===S)throw new RangeError("Cyclic object value");k=!0}typeof C.get(Fu)=="undefined"&&(S=0)}if(typeof l=="function"?T=l(t,T):T instanceof Date?T=g(T):r==="comma"&&Vn(T)&&(T=Yd.maybeMap(T,function(Ut){return Ut instanceof Date?g(Ut):Ut})),T===null){if(s)return a&&!_?a(t,St.encoder,I,"key",m):t;T=""}if(Ew(T)||Yd.isBuffer(T)){if(a){var w=_?t:a(t,St.encoder,I,"key",m);if(r==="comma"&&_){for(var L=yw.call(String(T),","),q="",F=0;F<L.length;++F)q+=(F===0?"":",")+f(a(L[F],St.encoder,I,"value",m));return[f(w)+(i&&Vn(T)&&L.length===1?"[]":"")+"="+q]}return[f(w)+"="+f(a(T,St.encoder,I,"value",m))]}return[f(t)+"="+f(String(T))]}var he=[];if(typeof T=="undefined")return he;var Fe;if(r==="comma"&&Vn(T))Fe=[{value:T.length>0?T.join(",")||null:void 0}];else if(Vn(l))Fe=l;else{var Ve=Object.keys(T);Fe=u?Ve.sort(u):Ve}for(var Qe=i&&Vn(T)&&T.length===1?t+"[]":t,ft=0;ft<Fe.length;++ft){var at=Fe[ft],Yt=typeof at=="object"&&typeof at.value!="undefined"?at.value:T[at];if(!(o&&Yt===null)){var ee=Vn(T)?typeof r=="function"?r(Qe,at):Qe:Qe+(c?"."+at:"["+at+"]");R.set(e,S);var pr=lv();pr.set(Fu,R),uv(he,n(Yt,ee,r,i,s,o,a,l,u,c,g,m,f,_,I,pr))}}return he},bw=function(e){if(!e)return St;if(e.encoder!==null&&typeof e.encoder!="undefined"&&typeof e.encoder!="function")throw new TypeError("Encoder has to be a function.");var t=e.charset||St.charset;if(typeof e.charset!="undefined"&&e.charset!=="utf-8"&&e.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var r=Pa.default;if(typeof e.format!="undefined"){if(!mw.call(Pa.formatters,e.format))throw new TypeError("Unknown format option provided.");r=e.format}var i=Pa.formatters[r],s=St.filter;return(typeof e.filter=="function"||Vn(e.filter))&&(s=e.filter),{addQueryPrefix:typeof e.addQueryPrefix=="boolean"?e.addQueryPrefix:St.addQueryPrefix,allowDots:typeof e.allowDots=="undefined"?St.allowDots:!!e.allowDots,charset:t,charsetSentinel:typeof e.charsetSentinel=="boolean"?e.charsetSentinel:St.charsetSentinel,delimiter:typeof e.delimiter=="undefined"?St.delimiter:e.delimiter,encode:typeof e.encode=="boolean"?e.encode:St.encode,encoder:typeof e.encoder=="function"?e.encoder:St.encoder,encodeValuesOnly:typeof e.encodeValuesOnly=="boolean"?e.encodeValuesOnly:St.encodeValuesOnly,filter:s,format:r,formatter:i,serializeDate:typeof e.serializeDate=="function"?e.serializeDate:St.serializeDate,skipNulls:typeof e.skipNulls=="boolean"?e.skipNulls:St.skipNulls,sort:typeof e.sort=="function"?e.sort:null,strictNullHandling:typeof e.strictNullHandling=="boolean"?e.strictNullHandling:St.strictNullHandling}},ww=function(n,e){var t=n,r=bw(e),i,s;typeof r.filter=="function"?(s=r.filter,t=s("",t)):Vn(r.filter)&&(s=r.filter,i=s);var o=[];if(typeof t!="object"||t===null)return"";var a;e&&e.arrayFormat in Mp?a=e.arrayFormat:e&&"indices"in e?a=e.indices?"indices":"repeat":a="indices";var l=Mp[a];if(e&&"commaRoundTrip"in e&&typeof e.commaRoundTrip!="boolean")throw new TypeError("`commaRoundTrip` must be a boolean, or absent");var u=l==="comma"&&e&&e.commaRoundTrip;i||(i=Object.keys(t)),r.sort&&i.sort(r.sort);for(var c=lv(),g=0;g<i.length;++g){var m=i[g];r.skipNulls&&t[m]===null||uv(o,Sw(t[m],m,l,u,r.strictNullHandling,r.skipNulls,r.encode?r.encoder:null,r.filter,r.sort,r.allowDots,r.serializeDate,r.format,r.formatter,r.encodeValuesOnly,r.charset,c))}var f=o.join(r.delimiter),_=r.addQueryPrefix===!0?"?":"";return r.charsetSentinel&&(r.charset==="iso-8859-1"?_+="utf8=%26%2310003%3B&":_+="utf8=%E2%9C%93&"),f.length>0?_+f:""},Ro=cv,zd=Object.prototype.hasOwnProperty,Rw=Array.isArray,pt={allowDots:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decoder:Ro.decode,delimiter:"&",depth:5,ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictNullHandling:!1},Iw=function(n){return n.replace(/&#(\d+);/g,function(e,t){return String.fromCharCode(parseInt(t,10))})},dv=function(n,e){return n&&typeof n=="string"&&e.comma&&n.indexOf(",")>-1?n.split(","):n},Tw="utf8=%26%2310003%3B",Ow="utf8=%E2%9C%93",kw=function(e,t){var r={},i=t.ignoreQueryPrefix?e.replace(/^\?/,""):e,s=t.parameterLimit===1/0?void 0:t.parameterLimit,o=i.split(t.delimiter,s),a=-1,l,u=t.charset;if(t.charsetSentinel)for(l=0;l<o.length;++l)o[l].indexOf("utf8=")===0&&(o[l]===Ow?u="utf-8":o[l]===Tw&&(u="iso-8859-1"),a=l,l=o.length);for(l=0;l<o.length;++l)if(l!==a){var c=o[l],g=c.indexOf("]="),m=g===-1?c.indexOf("="):g+1,f,_;m===-1?(f=t.decoder(c,pt.decoder,u,"key"),_=t.strictNullHandling?null:""):(f=t.decoder(c.slice(0,m),pt.decoder,u,"key"),_=Ro.maybeMap(dv(c.slice(m+1),t),function(I){return t.decoder(I,pt.decoder,u,"value")})),_&&t.interpretNumericEntities&&u==="iso-8859-1"&&(_=Iw(_)),c.indexOf("[]=")>-1&&(_=Rw(_)?[_]:_),zd.call(r,f)?r[f]=Ro.combine(r[f],_):r[f]=_}return r},Cw=function(n,e,t,r){for(var i=r?e:dv(e,t),s=n.length-1;s>=0;--s){var o,a=n[s];if(a==="[]"&&t.parseArrays)o=[].concat(i);else{o=t.plainObjects?Object.create(null):{};var l=a.charAt(0)==="["&&a.charAt(a.length-1)==="]"?a.slice(1,-1):a,u=parseInt(l,10);!t.parseArrays&&l===""?o={0:i}:!isNaN(u)&&a!==l&&String(u)===l&&u>=0&&t.parseArrays&&u<=t.arrayLimit?(o=[],o[u]=i):l!=="__proto__"&&(o[l]=i)}i=o}return i},Pw=function(e,t,r,i){if(!!e){var s=r.allowDots?e.replace(/\.([^.[]+)/g,"[$1]"):e,o=/(\[[^[\]]*])/,a=/(\[[^[\]]*])/g,l=r.depth>0&&o.exec(s),u=l?s.slice(0,l.index):s,c=[];if(u){if(!r.plainObjects&&zd.call(Object.prototype,u)&&!r.allowPrototypes)return;c.push(u)}for(var g=0;r.depth>0&&(l=a.exec(s))!==null&&g<r.depth;){if(g+=1,!r.plainObjects&&zd.call(Object.prototype,l[1].slice(1,-1))&&!r.allowPrototypes)return;c.push(l[1])}return l&&c.push("["+s.slice(l.index)+"]"),Cw(c,t,r,i)}},Mw=function(e){if(!e)return pt;if(e.decoder!==null&&e.decoder!==void 0&&typeof e.decoder!="function")throw new TypeError("Decoder has to be a function.");if(typeof e.charset!="undefined"&&e.charset!=="utf-8"&&e.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var t=typeof e.charset=="undefined"?pt.charset:e.charset;return{allowDots:typeof e.allowDots=="undefined"?pt.allowDots:!!e.allowDots,allowPrototypes:typeof e.allowPrototypes=="boolean"?e.allowPrototypes:pt.allowPrototypes,allowSparse:typeof e.allowSparse=="boolean"?e.allowSparse:pt.allowSparse,arrayLimit:typeof e.arrayLimit=="number"?e.arrayLimit:pt.arrayLimit,charset:t,charsetSentinel:typeof e.charsetSentinel=="boolean"?e.charsetSentinel:pt.charsetSentinel,comma:typeof e.comma=="boolean"?e.comma:pt.comma,decoder:typeof e.decoder=="function"?e.decoder:pt.decoder,delimiter:typeof e.delimiter=="string"||Ro.isRegExp(e.delimiter)?e.delimiter:pt.delimiter,depth:typeof e.depth=="number"||e.depth===!1?+e.depth:pt.depth,ignoreQueryPrefix:e.ignoreQueryPrefix===!0,interpretNumericEntities:typeof e.interpretNumericEntities=="boolean"?e.interpretNumericEntities:pt.interpretNumericEntities,parameterLimit:typeof e.parameterLimit=="number"?e.parameterLimit:pt.parameterLimit,parseArrays:e.parseArrays!==!1,plainObjects:typeof e.plainObjects=="boolean"?e.plainObjects:pt.plainObjects,strictNullHandling:typeof e.strictNullHandling=="boolean"?e.strictNullHandling:pt.strictNullHandling}},Dw=function(n,e){var t=Mw(e);if(n===""||n===null||typeof n=="undefined")return t.plainObjects?Object.create(null):{};for(var r=typeof n=="string"?kw(n,t):n,i=t.plainObjects?Object.create(null):{},s=Object.keys(r),o=0;o<s.length;++o){var a=s[o],l=Pw(a,r[a],t,typeof n=="string");i=Ro.merge(i,l,t)}return t.allowSparse===!0?i:Ro.compact(i)},Aw=ww,xw=Dw,Uw=_f,$w={formats:Uw,parse:xw,stringify:Aw},Ps={},$o={},Y={exports:{}},hv={exports:{}},Ef={exports:{}};(function(n){function e(t){return n.exports=e=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},n.exports.__esModule=!0,n.exports.default=n.exports,e(t)}n.exports=e,n.exports.__esModule=!0,n.exports.default=n.exports})(Ef);var fv={exports:{}};(function(n){var e=Ef.exports.default;function t(r,i){if(e(r)!=="object"||r===null)return r;var s=r[Symbol.toPrimitive];if(s!==void 0){var o=s.call(r,i||"default");if(e(o)!=="object")return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return(i==="string"?String:Number)(r)}n.exports=t,n.exports.__esModule=!0,n.exports.default=n.exports})(fv);(function(n){var e=Ef.exports.default,t=fv.exports;function r(i){var s=t(i,"string");return e(s)==="symbol"?s:String(s)}n.exports=r,n.exports.__esModule=!0,n.exports.default=n.exports})(hv);(function(n){var e=hv.exports;function t(r,i,s){return i=e(i),i in r?Object.defineProperty(r,i,{value:s,enumerable:!0,configurable:!0,writable:!0}):r[i]=s,r}n.exports=t,n.exports.__esModule=!0,n.exports.default=n.exports})(Y);var ie={},pv={exports:{}};(function(n){(function(e,t){n.exports?n.exports=t():e.log=t()})(V,function(){var e=function(){},t="undefined",r=typeof window!==t&&typeof window.navigator!==t&&/Trident\/|MSIE /.test(window.navigator.userAgent),i=["trace","debug","info","warn","error"];function s(I,R){var T=I[R];if(typeof T.bind=="function")return T.bind(I);try{return Function.prototype.bind.call(T,I)}catch{return function(){return Function.prototype.apply.apply(T,[I,arguments])}}}function o(){console.log&&(console.log.apply?console.log.apply(console,arguments):Function.prototype.apply.apply(console.log,[console,arguments])),console.trace&&console.trace()}function a(I){return I==="debug"&&(I="log"),typeof console===t?!1:I==="trace"&&r?o:console[I]!==void 0?s(console,I):console.log!==void 0?s(console,"log"):e}function l(I,R){for(var T=0;T<i.length;T++){var C=i[T];this[C]=T<I?e:this.methodFactory(C,I,R)}this.log=this.debug}function u(I,R,T){return function(){typeof console!==t&&(l.call(this,R,T),this[I].apply(this,arguments))}}function c(I,R,T){return a(I)||u.apply(this,arguments)}function g(I,R,T){var C=this,S;R=R==null?"WARN":R;var k="loglevel";typeof I=="string"?k+=":"+I:typeof I=="symbol"&&(k=void 0);function A(F){var he=(i[F]||"silent").toUpperCase();if(!(typeof window===t||!k)){try{window.localStorage[k]=he;return}catch{}try{window.document.cookie=encodeURIComponent(k)+"="+he+";"}catch{}}}function w(){var F;if(!(typeof window===t||!k)){try{F=window.localStorage[k]}catch{}if(typeof F===t)try{var he=window.document.cookie,Fe=he.indexOf(encodeURIComponent(k)+"=");Fe!==-1&&(F=/^([^;]+)/.exec(he.slice(Fe))[1])}catch{}return C.levels[F]===void 0&&(F=void 0),F}}function L(){if(!(typeof window===t||!k)){try{window.localStorage.removeItem(k);return}catch{}try{window.document.cookie=encodeURIComponent(k)+"=; expires=Thu, 01 Jan 1970 00:00:00 UTC"}catch{}}}C.name=I,C.levels={TRACE:0,DEBUG:1,INFO:2,WARN:3,ERROR:4,SILENT:5},C.methodFactory=T||c,C.getLevel=function(){return S},C.setLevel=function(F,he){if(typeof F=="string"&&C.levels[F.toUpperCase()]!==void 0&&(F=C.levels[F.toUpperCase()]),typeof F=="number"&&F>=0&&F<=C.levels.SILENT){if(S=F,he!==!1&&A(F),l.call(C,F,I),typeof console===t&&F<C.levels.SILENT)return"No console available for logging"}else throw"log.setLevel() called with invalid level: "+F},C.setDefaultLevel=function(F){R=F,w()||C.setLevel(F,!1)},C.resetLevel=function(){C.setLevel(R,!1),L()},C.enableAll=function(F){C.setLevel(C.levels.TRACE,F)},C.disableAll=function(F){C.setLevel(C.levels.SILENT,F)};var q=w();q==null&&(q=R),C.setLevel(q,!1)}var m=new g,f={};m.getLogger=function(R){if(typeof R!="symbol"&&typeof R!="string"||R==="")throw new TypeError("You must supply a name when creating a logger.");var T=f[R];return T||(T=f[R]=new g(R,m.getLevel(),m.methodFactory)),T};var _=typeof window!==t?window.log:void 0;return m.noConflict=function(){return typeof window!==t&&window.log===m&&(window.log=_),m},m.getLoggers=function(){return f},m.default=m,m})})(pv);var Nw=G.exports;Object.defineProperty(ie,"__esModule",{value:!0});ie.logger=void 0;var Ka=Nw(pv.exports);const gv="matrix";Ka.default.methodFactory=function(n,e,t){return function(...r){return this.prefix&&r.unshift(this.prefix),n==="error"||n==="warn"||n==="trace"||n==="info"?console[n](...r):console.log(...r)}};const Sf=Ka.default.getLogger(gv);ie.logger=Sf;Sf.setLevel(Ka.default.levels.DEBUG,!1);function mv(n){n.withPrefix=function(e){const t=this.prefix||"";return Lw(t+e)}}mv(Sf);function Lw(n){const e=Ka.default.getLogger(`${gv}-${n}`);return e.prefix!==n&&(mv(e),e.prefix=n,e.setLevel(Ka.default.levels.DEBUG,!1)),e}var W={};const Bw="l",Kw="rn";var Fw={0:"O",1:"l","\u05AD":"\u0596","\u05AE":"\u0598","\u05A8":"\u0599","\u05A4":"\u059A","\u1AB4":"\u06DB","\u20DB":"\u06DB","\u0619":"\u0313","\u08F3":"\u0313","\u0343":"\u0313","\u0315":"\u0313","\u064F":"\u0313","\u065D":"\u0314","\u059C":"\u0301","\u059D":"\u0301","\u0618":"\u0301","\u0747":"\u0301","\u0341":"\u0301","\u0954":"\u0301","\u064E":"\u0301","\u0340":"\u0300","\u0953":"\u0300","\u030C":"\u0306","\uA67C":"\u0306","\u0658":"\u0306","\u065A":"\u0306","\u036E":"\u0306","\u06E8":"\u0306\u0307","\u0310":"\u0306\u0307","\u0901":"\u0306\u0307","\u0981":"\u0306\u0307","\u0A81":"\u0306\u0307","\u0B01":"\u0306\u0307","\u0C00":"\u0306\u0307","\u0C81":"\u0306\u0307","\u0D01":"\u0306\u0307","\u{114BF}":"\u0306\u0307","\u1CD0":"\u0302","\u0311":"\u0302","\u065B":"\u0302","\u07EE":"\u0302","\uA6F0":"\u0302","\u05AF":"\u030A","\u06DF":"\u030A","\u17D3":"\u030A","\u309A":"\u030A","\u0652":"\u030A","\u0B82":"\u030A","\u1036":"\u030A","\u17C6":"\u030A","\u{11300}":"\u030A","\u0E4D":"\u030A","\u0ECD":"\u030A","\u0366":"\u030A","\u2DEA":"\u030A","\u08EB":"\u0308","\u07F3":"\u0308","\u064B":"\u030B","\u08F0":"\u030B","\u0342":"\u0303","\u0653":"\u0303","\u05C4":"\u0307","\u06EC":"\u0307","\u0740":"\u0307","\u08EA":"\u0307","\u0741":"\u0307","\u0358":"\u0307","\u05B9":"\u0307","\u05BA":"\u0307","\u05C2":"\u0307","\u05C1":"\u0307","\u07ED":"\u0307","\u0902":"\u0307","\u0A02":"\u0307","\u0A82":"\u0307","\u0BCD":"\u0307","\u0337":"\u0338","\u1AB7":"\u0328","\u0322":"\u0328","\u0345":"\u0328","\u1CD2":"\u0304","\u0305":"\u0304","\u0659":"\u0304","\u07EB":"\u0304","\uA6F1":"\u0304","\u1CDA":"\u030E","\u0657":"\u0312","\u0357":"\u0350","\u08FF":"\u0350","\u08F8":"\u0350","\u0900":"\u0352","\u1CED":"\u0316","\u1CDC":"\u0329","\u0656":"\u0329","\u1CD5":"\u032B","\u0347":"\u0333","\u08F9":"\u0354","\u08FA":"\u0355","\u309B":"\uFF9E","\u309C":"\uFF9F","\u0336":"\u0335","\u302C":"\u0309","\u05C5":"\u0323","\u08ED":"\u0323","\u1CDD":"\u0323","\u05B4":"\u0323","\u065C":"\u0323","\u093C":"\u0323","\u09BC":"\u0323","\u0A3C":"\u0323","\u0ABC":"\u0323","\u0B3C":"\u0323","\u{111CA}":"\u0323","\u{114C3}":"\u0323","\u{10A3A}":"\u0323","\u08EE":"\u0324","\u1CDE":"\u0324","\u0F37":"\u0325","\u302D":"\u0325","\u0327":"\u0326","\u0321":"\u0326","\u0339":"\u0326","\u1CD9":"\u032D","\u1CD8":"\u032E","\u0952":"\u0331","\u0320":"\u0331","\u08F1":"\u064C","\u08E8":"\u064C","\u08E5":"\u064C",\uFC5E:"\uFE72\u0651","\u08F2":"\u064D",\uFC5F:"\uFE74\u0651",\uFCF2:"\uFE77\u0651",\uFC60:"\uFE76\u0651",\uFCF3:"\uFE79\u0651",\uFC61:"\uFE78\u0651","\u061A":"\u0650","\u0317":"\u0650",\uFCF4:"\uFE7B\u0651",\uFC62:"\uFE7A\u0651",\uFC63:"\uFE7C\u0670","\u065F":"\u0655","\u030D":"\u0670","\u0742":"\u073C","\u0A03":"\u0983","\u0C03":"\u0983","\u0C83":"\u0983","\u0D03":"\u0983","\u0D83":"\u0983","\u1038":"\u0983","\u{114C1}":"\u0983","\u17CB":"\u0E48","\u0EC8":"\u0E48","\u0EC9":"\u0E49","\u0ECA":"\u0E4A","\u0ECB":"\u0E4B","\uA66F":"\u20E9","\u2028":" ","\u2029":" ","\u1680":" ","\u2000":" ","\u2001":" ","\u2002":" ","\u2003":" ","\u2004":" ","\u2005":" ","\u2006":" ","\u2008":" ","\u2009":" ","\u200A":" ","\u205F":" ","\xA0":" ","\u2007":" ","\u202F":" ","\u07FA":"_","\uFE4D":"_","\uFE4E":"_","\uFE4F":"_","\u2010":"-","\u2011":"-","\u2012":"-","\u2013":"-","\uFE58":"-","\u06D4":"-","\u2043":"-","\u02D7":"-","\u2212":"-","\u2796":"-","\u2CBA":"-","\u2A29":"-\u0313","\u2E1A":"-\u0308","\uFB29":"-\u0307","\u2238":"-\u0307","\u2A2A":"-\u0323","\uA4FE":"-.","\uFF5E":"\u301C","\u060D":",","\u066B":",","\u201A":",","\xB8":",","\uA4F9":",","\u2E32":"\u060C","\u066C":"\u060C","\u037E":";","\u2E35":"\u061B","\u0903":":","\u0A83":":","\uFF1A":":","\u0589":":","\u0703":":","\u0704":":","\u16EC":":","\uFE30":":","\u1803":":","\u1809":":","\u205A":":","\u05C3":":","\u02F8":":","\uA789":":","\u2236":":",\u02D0:":","\uA4FD":":","\u2A74":"::=","\u29F4":":\u2192","\uFF01":"!",\u01C3:"!","\u2D51":"!","\u203C":"!!","\u2049":"!?",\u0294:"?","\u0241":"?","\u097D":"?",\u13AE:"?","\uA6EB":"?","\u2048":"?!","\u2047":"??","\u2E2E":"\u061F","\u{1D16D}":".","\u2024":".","\u0701":".","\u0702":".","\uA60E":".","\u{10A50}":".","\u0660":".","\u06F0":".","\uA4F8":".","\uA4FB":".,","\u2025":"..","\uA4FA":"..","\u2026":"...","\uA6F4":"\uA6F3\uA6F3","\u30FB":"\xB7","\uFF65":"\xB7","\u16EB":"\xB7","\u0387":"\xB7","\u2E31":"\xB7","\u{10101}":"\xB7","\u2022":"\xB7","\u2027":"\xB7","\u2219":"\xB7","\u22C5":"\xB7","\uA78F":"\xB7",\u1427:"\xB7","\u22EF":"\xB7\xB7\xB7","\u2D48":"\xB7\xB7\xB7",\u1444:"\xB7<","\u22D7":"\xB7>",\u1437:"\xB7>",\u1440:"\xB7>",\u152F:"\xB74",\u147E:"\xB7b",\u1480:"\xB7b\u0307",\u147A:"\xB7d",\u1498:"\xB7J",\u14B6:"\xB7L",\u1476:"\xB7P",\u1457:"\xB7U",\u143A:"\xB7V",\u143C:"\xB7\u0245",\u14AE:"\xB7\u0393",\u140E:"\xB7\u0394",\u1459:"\xB7\u0548",\u140C:"\xB7\u1401",\u1410:"\xB7\u1404",\u1412:"\xB7\u1405",\u1414:"\xB7\u1406",\u1417:"\xB7\u140A",\u1419:"\xB7\u140B",\u143E:"\xB7\u1432",\u1442:"\xB7\u1434",\u1446:"\xB7\u1439",\u145B:"\xB7\u144F",\u1454:"\xB7\u1450",\u145D:"\xB7\u1450",\u145F:"\xB7\u1451",\u1461:"\xB7\u1455",\u1463:"\xB7\u1456",\u1474:"\xB7\u146B",\u1478:"\xB7\u146E",\u147C:"\xB7\u1470",\u1492:"\xB7\u1489",\u1494:"\xB7\u148B",\u1496:"\xB7\u148C",\u149A:"\xB7\u148E",\u149C:"\xB7\u1490",\u149E:"\xB7\u1491",\u14AC:"\xB7\u14A3",\u14B0:"\xB7\u14A6",\u14B2:"\xB7\u14A7",\u14B4:"\xB7\u14A8",\u14B8:"\xB7\u14AB",\u14C9:"\xB7\u14C0","\u18C6":"\xB7\u14C2","\u18C8":"\xB7\u14C3","\u18CA":"\xB7\u14C4","\u18CC":"\xB7\u14C5",\u14CB:"\xB7\u14C7",\u14CD:"\xB7\u14C8",\u14DC:"\xB7\u14D3",\u14DE:"\xB7\u14D5",\u14E0:"\xB7\u14D6",\u14E2:"\xB7\u14D7",\u14E4:"\xB7\u14D8",\u14E6:"\xB7\u14DA",\u14E8:"\xB7\u14DB",\u14F6:"\xB7\u14ED",\u14F8:"\xB7\u14EF",\u14FA:"\xB7\u14F0",\u14FC:"\xB7\u14F1",\u14FE:"\xB7\u14F2",\u1500:"\xB7\u14F4",\u1502:"\xB7\u14F5",\u1517:"\xB7\u1510",\u1519:"\xB7\u1511",\u151B:"\xB7\u1512",\u151D:"\xB7\u1513",\u151F:"\xB7\u1514",\u1521:"\xB7\u1515",\u1523:"\xB7\u1516",\u1531:"\xB7\u1528",\u1533:"\xB7\u1529",\u1535:"\xB7\u152A",\u1537:"\xB7\u152B",\u1539:"\xB7\u152D",\u153B:"\xB7\u152E","\u18CE":"\xB7\u1543","\u18CF":"\xB7\u1546","\u18D0":"\xB7\u1547","\u18D1":"\xB7\u1548","\u18D2":"\xB7\u1549","\u18D3":"\xB7\u154B",\u154E:"\xB7\u154C",\u155B:"\xB7\u155A",\u1568:"\xB7\u1567","\u18B3":"\xB7\u18B1","\u18B6":"\xB7\u18B4","\u18B9":"\xB7\u18B8","\u18C2":"\xB7\u18C0","\uA830":"\u0964","\u0965":"\u0964\u0964","\u1C3C":"\u1C3B\u1C3B","\u104B":"\u104A\u104A","\u1AA9":"\u1AA8\u1AA8","\u1AAB":"\u1AAA\u1AA8","\u1B5F":"\u1B5E\u1B5E","\u{10A57}":"\u{10A56}\u{10A56}","\u{1144C}":"\u{1144B}\u{1144B}","\u{11642}":"\u{11641}\u{11641}","\u{11C42}":"\u{11C41}\u{11C41}","\u1C7F":"\u1C7E\u1C7E","\u055D":"'","\uFF07":"'","\u2018":"'","\u2019":"'","\u201B":"'","\u2032":"'","\u2035":"'","\u055A":"'","\u05F3":"'","`":"'","\u1FEF":"'","\uFF40":"'","\xB4":"'","\u0384":"'","\u1FFD":"'","\u1FBD":"'","\u1FBF":"'","\u1FFE":"'","\u02B9":"'","\u0374":"'","\u02C8":"'","\u02CA":"'","\u02CB":"'","\u02F4":"'",\u02BB:"'",\u02BD:"'",\u02BC:"'",\u02BE:"'","\uA78C":"'",\u05D9:"'","\u07F4":"'","\u07F5":"'",\u144A:"'",\u16CC:"'","\u{16F51}":"'","\u{16F52}":"'","\u1CD3":"''",'"':"''","\uFF02":"''","\u201C":"''","\u201D":"''","\u201F":"''","\u2033":"''","\u2036":"''","\u3003":"''","\u05F4":"''","\u02DD":"''","\u02BA":"''","\u02F6":"''",\u02EE:"''",\u05F2:"''","\u2034":"'''","\u2037":"'''","\u2057":"''''",\u0181:"'B",\u018A:"'D",\u0149:"'n",\u01A4:"'P",\u01AC:"'T",\u01B3:"'Y","\uFF3B":"(","\u2768":"(","\u2772":"(","\u3014":"(","\uFD3E":"(","\u2E28":"((","\u3220":"(\u30FC)","\u2475":"(2)","\u2487":"(2O)","\u2476":"(3)","\u2477":"(4)","\u2478":"(5)","\u2479":"(6)","\u247A":"(7)","\u247B":"(8)","\u247C":"(9)","\u249C":"(a)","\u{1F110}":"(A)","\u249D":"(b)","\u{1F111}":"(B)","\u249E":"(c)","\u{1F112}":"(C)","\u249F":"(d)","\u{1F113}":"(D)","\u24A0":"(e)","\u{1F114}":"(E)","\u24A1":"(f)","\u{1F115}":"(F)","\u24A2":"(g)","\u{1F116}":"(G)","\u24A3":"(h)","\u{1F117}":"(H)","\u24A4":"(i)","\u24A5":"(j)","\u{1F119}":"(J)","\u24A6":"(k)","\u{1F11A}":"(K)","\u2474":"(l)","\u{1F118}":"(l)","\u24A7":"(l)","\u{1F11B}":"(L)","\u247F":"(l2)","\u2480":"(l3)","\u2481":"(l4)","\u2482":"(l5)","\u2483":"(l6)","\u2484":"(l7)","\u2485":"(l8)","\u2486":"(l9)","\u247E":"(ll)","\u247D":"(lO)","\u{1F11C}":"(M)","\u24A9":"(n)","\u{1F11D}":"(N)","\u24AA":"(o)","\u{1F11E}":"(O)","\u24AB":"(p)","\u{1F11F}":"(P)","\u24AC":"(q)","\u{1F120}":"(Q)","\u24AD":"(r)","\u{1F121}":"(R)","\u24A8":"(rn)","\u24AE":"(s)","\u{1F122}":"(S)","\u{1F12A}":"(S)","\u24AF":"(t)","\u{1F123}":"(T)","\u24B0":"(u)","\u{1F124}":"(U)","\u24B1":"(v)","\u{1F125}":"(V)","\u24B2":"(w)","\u{1F126}":"(W)","\u24B3":"(x)","\u{1F127}":"(X)","\u24B4":"(y)","\u{1F128}":"(Y)","\u24B5":"(z)","\u{1F129}":"(Z)","\u3200":"(\u1100)","\u320E":"(\uAC00)","\u3201":"(\u1102)","\u320F":"(\uB098)","\u3202":"(\u1103)","\u3210":"(\uB2E4)","\u3203":"(\u1105)","\u3211":"(\uB77C)","\u3204":"(\u1106)","\u3212":"(\uB9C8)","\u3205":"(\u1107)","\u3213":"(\uBC14)","\u3206":"(\u1109)","\u3214":"(\uC0AC)","\u3207":"(\u110B)","\u3215":"(\uC544)","\u321D":"(\uC624\uC804)","\u321E":"(\uC624\uD6C4)","\u3208":"(\u110C)","\u3216":"(\uC790)","\u321C":"(\uC8FC)","\u3209":"(\u110E)","\u3217":"(\uCC28)","\u320A":"(\u110F)","\u3218":"(\uCE74)","\u320B":"(\u1110)","\u3219":"(\uD0C0)","\u320C":"(\u1111)","\u321A":"(\uD30C)","\u320D":"(\u1112)","\u321B":"(\uD558)","\u3226":"(\u4E03)","\u3222":"(\u4E09)","\u{1F241}":"(\u4E09)","\u3228":"(\u4E5D)","\u3221":"(\u4E8C)","\u{1F242}":"(\u4E8C)","\u3224":"(\u4E94)","\u3239":"(\u4EE3)","\u323D":"(\u4F01)","\u3241":"(\u4F11)","\u3227":"(\u516B)","\u3225":"(\u516D)","\u3238":"(\u52B4)","\u{1F247}":"(\u52DD)","\u3229":"(\u5341)","\u323F":"(\u5354)","\u3234":"(\u540D)","\u323A":"(\u547C)","\u3223":"(\u56DB)","\u322F":"(\u571F)","\u323B":"(\u5B66)","\u{1F243}":"(\u5B89)","\u{1F245}":"(\u6253)","\u{1F248}":"(\u6557)","\u3230":"(\u65E5)","\u322A":"(\u6708)","\u3232":"(\u6709)","\u322D":"(\u6728)","\u{1F240}":"(\u672C)","\u3231":"(\u682A)","\u322C":"(\u6C34)","\u322B":"(\u706B)","\u{1F244}":"(\u70B9)","\u3235":"(\u7279)","\u{1F246}":"(\u76D7)","\u323C":"(\u76E3)","\u3233":"(\u793E)","\u3237":"(\u795D)","\u3240":"(\u796D)","\u3242":"(\u81EA)","\u3243":"(\u81F3)","\u3236":"(\u8CA1)","\u323E":"(\u8CC7)","\u322E":"(\u91D1)","\uFF3D":")","\u2769":")","\u2773":")","\u3015":")","\uFD3F":")","\u2E29":"))","\u2774":"{","\u{1D114}":"{","\u2775":"}","\u301A":"\u27E6","\u301B":"\u27E7","\u27E8":"\u276C","\u2329":"\u276C","\u3008":"\u276C","\u31DB":"\u276C",\u304F:"\u276C","\u{21FE8}":"\u276C","\u27E9":"\u276D","\u232A":"\u276D","\u3009":"\u276D","\uFF3E":"\uFE3F","\u2E3F":"\xB6","\u204E":"*","\u066D":"*","\u2217":"*","\u{1031F}":"*","\u1735":"/","\u2041":"/","\u2215":"/","\u2044":"/","\u2571":"/","\u27CB":"/","\u29F8":"/","\u{1D23A}":"/","\u31D3":"/",\u3033:"/","\u2CC6":"/",\u30CE:"/",\u4E3F:"/","\u2F03":"/","\u29F6":"/\u0304","\u2AFD":"//","\u2AFB":"///","\uFF3C":"\\","\uFE68":"\\","\u2216":"\\","\u27CD":"\\","\u29F5":"\\","\u29F9":"\\","\u{1D20F}":"\\","\u{1D23B}":"\\","\u31D4":"\\",\u4E36:"\\","\u2F02":"\\","\u2CF9":"\\\\","\u244A":"\\\\","\u27C8":"\\\u1455","\uA778":"&","\u0AF0":"\u0970","\u{110BB}":"\u0970","\u{111C7}":"\u0970","\u26AC":"\u0970","\u{111DB}":"\uA8FC","\u17D9":"\u0E4F","\u17D5":"\u0E5A","\u17DA":"\u0E5B","\u0F0C":"\u0F0B","\u0F0E":"\u0F0D\u0F0D","\u02C4":"^","\u02C6":"^","\uA67E":"\u02C7","\u02D8":"\u02C7","\u203E":"\u02C9","\uFE49":"\u02C9","\uFE4A":"\u02C9","\uFE4B":"\u02C9","\uFE4C":"\u02C9","\xAF":"\u02C9","\uFFE3":"\u02C9","\u2594":"\u02C9",\u044A:"\u02C9b","\uA651":"\u02C9bi","\u0375":"\u02CF","\u02FB":"\u02EA","\uA716":"\u02EA","\uA714":"\u02EB","\u3002":"\u02F3","\u2E30":"\xB0","\u02DA":"\xB0","\u2218":"\xB0","\u25CB":"\xB0","\u25E6":"\xB0","\u235C":"\xB0\u0332","\u2364":"\xB0\u0308","\u2103":"\xB0C","\u2109":"\xB0F","\u0BF5":"\u0BF3","\u0F1B":"\u0F1A\u0F1A","\u0F1F":"\u0F1A\u0F1D","\u0FCE":"\u0F1D\u0F1A","\u0F1E":"\u0F1D\u0F1D","\u24B8":"\xA9","\u24C7":"\xAE","\u24C5":"\u2117","\u{1D21B}":"\u2144","\u2BEC":"\u219E","\u2BED":"\u219F","\u2BEE":"\u21A0","\u2BEF":"\u21A1","\u21B5":"\u21B2","\u2965":"\u21C3\u21C2","\u296F":"\u21C3\u16DA","\u{1D6DB}":"\u2202","\u{1D715}":"\u2202","\u{1D74F}":"\u2202","\u{1D789}":"\u2202","\u{1D7C3}":"\u2202","\u{1E8CC}":"\u2202","\u{1E8CD}":"\u2202\u0335",\u00F0:"\u2202\u0335","\u2300":"\u2205","\u{1D6C1}":"\u2207","\u{1D6FB}":"\u2207","\u{1D735}":"\u2207","\u{1D76F}":"\u2207","\u{1D7A9}":"\u2207","\u{118A8}":"\u2207","\u2362":"\u2207\u0308","\u236B":"\u2207\u0334","\u2588":"\u220E","\u25A0":"\u220E","\u2A3F":"\u2210","\u16ED":"+","\u2795":"+","\u{1029B}":"+","\u2A23":"+\u0302","\u2A22":"+\u030A","\u2A24":"+\u0303","\u2214":"+\u0307","\u2A25":"+\u0323","\u2A26":"+\u0330","\u2A27":"+\u2082","\u2797":"\xF7","\u2039":"<","\u276E":"<","\u02C2":"<","\u{1D236}":"<",\u1438:"<",\u16B2:"<","\u22D6":"<\xB7","\u2CB4":"<\xB7",\u1445:"<\xB7","\u226A":"<<","\u22D8":"<<<","\u1400":"=","\u2E40":"=","\u30A0":"=","\uA4FF":"=","\u225A":"=\u0306","\u2259":"=\u0302","\u2257":"=\u030A","\u2250":"=\u0307","\u2251":"=\u0307\u0323","\u2A6E":"=\u20F0","\u2A75":"==","\u2A76":"===","\u225E":"=\u036B","\u203A":">","\u276F":">","\u02C3":">","\u{1D237}":">",\u1433:">","\u{16F3F}":">",\u1441:">\xB7","\u2AA5":"><","\u226B":">>","\u2A20":">>","\u22D9":">>>","\u2053":"~","\u02DC":"~","\u1FC0":"~","\u223C":"~","\u2368":"~\u0308","\u2E1E":"~\u0307","\u2A6A":"~\u0307","\u2E1F":"~\u0323","\u{1E8C8}":"\u2220","\u22C0":"\u2227","\u222F":"\u222E\u222E","\u2230":"\u222E\u222E\u222E","\u2E2B":"\u2234","\u2E2A":"\u2235","\u2E2C":"\u2237","\u{111DE}":"\u2248","\u264E":"\u224F","\u{1F75E}":"\u224F","\u2263":"\u2261","\u2A03":"\u228D","\u2A04":"\u228E","\u{1D238}":"\u228F","\u{1D239}":"\u2290","\u2A05":"\u2293","\u2A06":"\u2294","\u2A02":"\u2297","\u235F":"\u229B","\u{1F771}":"\u22A0","\u{1F755}":"\u22A1","\u25C1":"\u22B2","\u25B7":"\u22B3","\u2363":"\u22C6\u0308","\uFE34":"\u2307","\u25E0":"\u2312","\u2A3D":"\u2319","\u2325":"\u2324","\u29C7":"\u233B","\u25CE":"\u233E","\u29BE":"\u233E","\u29C5":"\u2342","\u29B0":"\u2349","\u23C3":"\u234B","\u23C2":"\u234E","\u23C1":"\u2355","\u23C6":"\u236D","\u2638":"\u2388","\uFE35":"\u23DC","\uFE36":"\u23DD","\uFE37":"\u23DE","\uFE38":"\u23DF","\uFE39":"\u23E0","\uFE3A":"\u23E1","\u25B1":"\u23E5","\u23FC":"\u23FB","\uFE31":"\u2502","\uFF5C":"\u2502","\u2503":"\u2502","\u250F":"\u250C","\u2523":"\u251C","\u2590":"\u258C","\u2597":"\u2596","\u259D":"\u2598","\u2610":"\u25A1","\uFFED":"\u25AA","\u25B8":"\u25B6","\u25BA":"\u25B6","\u2CE9":"\u2627","\u{1F70A}":"\u2629","\u{1F312}":"\u263D","\u{1F319}":"\u263D","\u23FE":"\u263E","\u{1F318}":"\u263E","\u29D9":"\u299A","\u{1F73A}":"\u29DF","\u2A3E":"\u2A1F","\u{101A0}":"\u2CE8","\u2669":"\u{1D158}\u{1D165}","\u266A":"\u{1D158}\u{1D165}\u{1D16E}","\u24EA":"\u{1F10D}","\u21BA":"\u{1F10E}","\u02D9":"\u0971","\u0D4E":"\u0971","\uFF0D":"\u30FC","\u2014":"\u30FC","\u2015":"\u30FC","\u2500":"\u30FC","\u2501":"\u30FC","\u31D0":"\u30FC","\uA7F7":"\u30FC",\u1173:"\u30FC",\u3161:"\u30FC",\u4E00:"\u30FC","\u2F00":"\u30FC",\u1196:"\u30FC\u30FC","\uD7B9":"\u30FC\u1161","\uD7BA":"\u30FC\u1165","\uD7BB":"\u30FC\u1165\u4E28","\uD7BC":"\u30FC\u1169",\u1195:"\u30FC\u116E",\u1174:"\u30FC\u4E28",\u3162:"\u30FC\u4E28",\u1197:"\u30FC\u4E28\u116E","\u{1F10F}":"$\u20E0","\u20A4":"\xA3","\u3012":"\u20B8","\u3036":"\u20B8","\u1B5C":"\u1B50","\uA9C6":"\uA9D0","\u{114D1}":"\u09E7","\u0CE7":"\u0C67","\u1065":"\u1041","\u2460":"\u2780","\u2469":"\u2789","\u23E8":"\u2081\u2080","\u{1D7D0}":"2","\u{1D7DA}":"2","\u{1D7E4}":"2","\u{1D7EE}":"2","\u{1D7F8}":"2","\u{1FBF2}":"2","\uA75A":"2",\u01A7:"2",\u03E8:"2","\uA644":"2",\u14BF:"2","\uA6EF":"2","\uA9CF":"\u0662","\u06F2":"\u0662","\u0AE8":"\u0968","\u{114D2}":"\u09E8","\u0CE8":"\u0C68","\u2461":"\u2781",\u01BB:"2\u0335","\u{1F103}":"2,","\u2489":"2.","\u33F5":"22\u65E5","\u336E":"22\u70B9","\u33F6":"23\u65E5","\u336F":"23\u70B9","\u33F7":"24\u65E5","\u3370":"24\u70B9","\u33F8":"25\u65E5","\u33F9":"26\u65E5","\u33FA":"27\u65E5","\u33FB":"28\u65E5","\u33FC":"29\u65E5","\u33F4":"2l\u65E5","\u336D":"2l\u70B9","\u249B":"2O.","\u33F3":"2O\u65E5","\u336C":"2O\u70B9","\u0DE9":"\u0DE8\u0DCF","\u0DEF":"\u0DE8\u0DD3","\u33E1":"2\u65E5","\u32C1":"2\u6708","\u335A":"2\u70B9","\u{1D206}":"3","\u{1D7D1}":"3","\u{1D7DB}":"3","\u{1D7E5}":"3","\u{1D7EF}":"3","\u{1D7F9}":"3","\u{1FBF3}":"3","\uA7AB":"3",\u021C:"3",\u01B7:"3","\uA76A":"3","\u2CCC":"3",\u0417:"3",\u04E0:"3","\u{16F3B}":"3","\u{118CA}":"3","\u06F3":"\u0663","\u{1E8C9}":"\u0663","\u0AE9":"\u0969","\u2462":"\u2782",\u0498:"3\u0326","\u{1F104}":"3,","\u248A":"3.","\u33FE":"3l\u65E5","\u33FD":"3O\u65E5","\u33E2":"3\u65E5","\u32C2":"3\u6708","\u335B":"3\u70B9","\u{1D7D2}":"4","\u{1D7DC}":"4","\u{1D7E6}":"4","\u{1D7F0}":"4","\u{1D7FA}":"4","\u{1FBF4}":"4",\u13CE:"4","\u{118AF}":"4","\u06F4":"\u0664","\u0AEA":"\u096A","\u2463":"\u2783","\u{1F105}":"4,","\u248B":"4.",\u1530:"4\xB7","\u33E3":"4\u65E5","\u32C3":"4\u6708","\u335C":"4\u70B9","\u{1D7D3}":"5","\u{1D7DD}":"5","\u{1D7E7}":"5","\u{1D7F1}":"5","\u{1D7FB}":"5","\u{1FBF5}":"5",\u01BC:"5","\u{118BB}":"5","\u2464":"\u2784","\u{1F106}":"5,","\u248C":"5.","\u33E4":"5\u65E5","\u32C4":"5\u6708","\u335D":"5\u70B9","\u{1D7D4}":"6","\u{1D7DE}":"6","\u{1D7E8}":"6","\u{1D7F2}":"6","\u{1D7FC}":"6","\u{1FBF6}":"6","\u2CD2":"6",\u0431:"6",\u13EE:"6","\u{118D5}":"6","\u06F6":"\u0666","\u{114D6}":"\u09EC","\u2465":"\u2785","\u{1F107}":"6,","\u248D":"6.","\u33E5":"6\u65E5","\u32C5":"6\u6708","\u335E":"6\u70B9","\u{1D212}":"7","\u{1D7D5}":"7","\u{1D7DF}":"7","\u{1D7E9}":"7","\u{1D7F3}":"7","\u{1D7FD}":"7","\u{1FBF7}":"7","\u{104D2}":"7","\u{118C6}":"7","\u2466":"\u2786","\u{1F108}":"7,","\u248E":"7.","\u33E6":"7\u65E5","\u32C6":"7\u6708","\u335F":"7\u70B9","\u0B03":"8","\u09EA":"8","\u0A6A":"8","\u{1E8CB}":"8","\u{1D7D6}":"8","\u{1D7E0}":"8","\u{1D7EA}":"8","\u{1D7F4}":"8","\u{1D7FE}":"8","\u{1FBF8}":"8",\u0223:"8",\u0222:"8","\u{1031A}":"8","\u0AEE":"\u096E","\u2467":"\u2787","\u{1F109}":"8,","\u248F":"8.","\u33E7":"8\u65E5","\u32C7":"8\u6708","\u3360":"8\u70B9","\u0A67":"9","\u0B68":"9","\u09ED":"9","\u0D6D":"9","\u{1D7D7}":"9","\u{1D7E1}":"9","\u{1D7EB}":"9","\u{1D7F5}":"9","\u{1D7FF}":"9","\u{1FBF9}":"9","\uA76E":"9","\u2CCA":"9","\u{118CC}":"9","\u{118AC}":"9","\u{118D6}":"9","\u0967":"\u0669","\u{118E4}":"\u0669","\u06F9":"\u0669","\u0CEF":"\u0C6F","\u2468":"\u2788","\u{1F10A}":"9,","\u2490":"9.","\u33E8":"9\u65E5","\u32C8":"9\u6708","\u3361":"9\u70B9","\u237A":"a",\uFF41:"a","\u{1D41A}":"a","\u{1D44E}":"a","\u{1D482}":"a","\u{1D4B6}":"a","\u{1D4EA}":"a","\u{1D51E}":"a","\u{1D552}":"a","\u{1D586}":"a","\u{1D5BA}":"a","\u{1D5EE}":"a","\u{1D622}":"a","\u{1D656}":"a","\u{1D68A}":"a",\u0251:"a",\u03B1:"a","\u{1D6C2}":"a","\u{1D6FC}":"a","\u{1D736}":"a","\u{1D770}":"a","\u{1D7AA}":"a",\u0430:"a","\u2DF6":"\u0363",\uFF21:"A","\u{1D400}":"A","\u{1D434}":"A","\u{1D468}":"A","\u{1D49C}":"A","\u{1D4D0}":"A","\u{1D504}":"A","\u{1D538}":"A","\u{1D56C}":"A","\u{1D5A0}":"A","\u{1D5D4}":"A","\u{1D608}":"A","\u{1D63C}":"A","\u{1D670}":"A",\u0391:"A","\u{1D6A8}":"A","\u{1D6E2}":"A","\u{1D71C}":"A","\u{1D756}":"A","\u{1D790}":"A",\u0410:"A",\u13AA:"A",\u15C5:"A","\uA4EE":"A","\u{16F40}":"A","\u{102A0}":"A","\u2376":"a\u0332",\u01CE:"\u0103",\u01CD:"\u0102",\u0227:"\xE5",\u0226:"\xC5",\u1E9A:"\u1EA3","\u2100":"a/c","\u2101":"a/s","\uA733":"aa","\uA732":"AA",\u00E6:"ae",\u04D5:"ae",\u00C6:"AE",\u04D4:"AE","\uA735":"ao","\uA734":"AO","\u{1F707}":"AR","\uA737":"au","\uA736":"AU","\uA739":"av","\uA73B":"av","\uA738":"AV","\uA73A":"AV","\uA73D":"ay","\uA73C":"AY","\uAB7A":"\u1D00","\u2200":"\u2C6F","\u{1D217}":"\u2C6F",\u15C4:"\u2C6F","\uA4EF":"\u2C6F","\u{1041F}":"\u2C70","\u{1D41B}":"b","\u{1D44F}":"b","\u{1D483}":"b","\u{1D4B7}":"b","\u{1D4EB}":"b","\u{1D51F}":"b","\u{1D553}":"b","\u{1D587}":"b","\u{1D5BB}":"b","\u{1D5EF}":"b","\u{1D623}":"b","\u{1D657}":"b","\u{1D68B}":"b",\u0184:"b",\u042C:"b",\u13CF:"b",\u1472:"b",\u15AF:"b",\uFF22:"B",\u212C:"B","\u{1D401}":"B","\u{1D435}":"B","\u{1D469}":"B","\u{1D4D1}":"B","\u{1D505}":"B","\u{1D539}":"B","\u{1D56D}":"B","\u{1D5A1}":"B","\u{1D5D5}":"B","\u{1D609}":"B","\u{1D63D}":"B","\u{1D671}":"B","\uA7B4":"B",\u0392:"B","\u{1D6A9}":"B","\u{1D6E3}":"B","\u{1D71D}":"B","\u{1D757}":"B","\u{1D791}":"B",\u0412:"B",\u13F4:"B",\u15F7:"B","\uA4D0":"B","\u{10282}":"B","\u{102A1}":"B","\u{10301}":"B",\u0253:"b\u0314",\u1473:"b\u0307",\u0183:"b\u0304",\u0182:"b\u0304",\u0411:"b\u0304",\u0180:"b\u0335",\u048D:"b\u0335",\u048C:"b\u0335",\u0463:"b\u0335",\u0462:"b\u0335",\u147F:"b\xB7",\u1481:"b\u0307\xB7",\u1488:"b'",\u042B:"bl",\u0432:"\u0299","\u13FC":"\u0299",\uFF43:"c","\u217D":"c","\u{1D41C}":"c","\u{1D450}":"c","\u{1D484}":"c","\u{1D4B8}":"c","\u{1D4EC}":"c","\u{1D520}":"c","\u{1D554}":"c","\u{1D588}":"c","\u{1D5BC}":"c","\u{1D5F0}":"c","\u{1D624}":"c","\u{1D658}":"c","\u{1D68C}":"c","\u1D04":"c",\u03F2:"c","\u2CA5":"c",\u0441:"c","\uABAF":"c","\u{1043D}":"c","\u2DED":"\u0368","\u{1F74C}":"C","\u{118F2}":"C","\u{118E9}":"C",\uFF23:"C","\u216D":"C",\u2102:"C",\u212D:"C","\u{1D402}":"C","\u{1D436}":"C","\u{1D46A}":"C","\u{1D49E}":"C","\u{1D4D2}":"C","\u{1D56E}":"C","\u{1D5A2}":"C","\u{1D5D6}":"C","\u{1D60A}":"C","\u{1D63E}":"C","\u{1D672}":"C","\u03F9":"C","\u2CA4":"C",\u0421:"C",\u13DF:"C","\uA4DA":"C","\u{102A2}":"C","\u{10302}":"C","\u{10415}":"C","\u{1051C}":"C","\xA2":"c\u0338","\u023C":"c\u0338","\u20A1":"C\u20EB","\u{1F16E}":"C\u20E0",\u00E7:"c\u0326",\u04AB:"c\u0326",\u00C7:"C\u0326",\u04AA:"C\u0326",\u0187:"C'","\u2105":"c/o","\u2106":"c/u","\u{1F16D}":"\u33C4 \u20DD","\u22F4":"\uA793",\u025B:"\uA793",\u03B5:"\uA793","\u03F5":"\uA793","\u{1D6C6}":"\uA793","\u{1D6DC}":"\uA793","\u{1D700}":"\uA793","\u{1D716}":"\uA793","\u{1D73A}":"\uA793","\u{1D750}":"\uA793","\u{1D774}":"\uA793","\u{1D78A}":"\uA793","\u{1D7AE}":"\uA793","\u{1D7C4}":"\uA793","\u2C89":"\uA793",\u0454:"\uA793","\u0511":"\uA793","\uAB9B":"\uA793","\u{118CE}":"\uA793","\u{10429}":"\uA793","\u20AC":"\uA792","\u2C88":"\uA792",\u0404:"\uA792","\u2377":"\uA793\u0332","\u037D":"\uA73F","\u03FF":"\uA73E","\u217E":"d","\u2146":"d","\u{1D41D}":"d","\u{1D451}":"d","\u{1D485}":"d","\u{1D4B9}":"d","\u{1D4ED}":"d","\u{1D521}":"d","\u{1D555}":"d","\u{1D589}":"d","\u{1D5BD}":"d","\u{1D5F1}":"d","\u{1D625}":"d","\u{1D659}":"d","\u{1D68D}":"d","\u0501":"d",\u13E7:"d",\u146F:"d","\uA4D2":"d","\u216E":"D","\u2145":"D","\u{1D403}":"D","\u{1D437}":"D","\u{1D46B}":"D","\u{1D49F}":"D","\u{1D4D3}":"D","\u{1D507}":"D","\u{1D53B}":"D","\u{1D56F}":"D","\u{1D5A3}":"D","\u{1D5D7}":"D","\u{1D60B}":"D","\u{1D63F}":"D","\u{1D673}":"D",\u13A0:"D",\u15DE:"D",\u15EA:"D","\uA4D3":"D",\u0257:"d\u0314",\u0256:"d\u0328",\u018C:"d\u0304",\u0111:"d\u0335",\u0110:"D\u0335",\u00D0:"D\u0335",\u0189:"D\u0335","\u20AB":"d\u0335\u0331","\uA77A":"\uA779",\u147B:"d\xB7",\u1487:"d'",\u02A4:"d\u021D",\u01F3:"dz",\u02A3:"dz",\u01F2:"Dz",\u01F1:"DZ",\u01C6:"d\u017E",\u01C5:"D\u017E",\u01C4:"D\u017D",\u02A5:"d\u0291","\uAB70":"\u1D05","\u2E39":"\u1E9F",\u03B4:"\u1E9F","\u{1D6C5}":"\u1E9F","\u{1D6FF}":"\u1E9F","\u{1D739}":"\u1E9F","\u{1D773}":"\u1E9F","\u{1D7AD}":"\u1E9F",\u056E:"\u1E9F",\u1577:"\u1E9F","\u212E":"e",\uFF45:"e",\u212F:"e","\u2147":"e","\u{1D41E}":"e","\u{1D452}":"e","\u{1D486}":"e","\u{1D4EE}":"e","\u{1D522}":"e","\u{1D556}":"e","\u{1D58A}":"e","\u{1D5BE}":"e","\u{1D5F2}":"e","\u{1D626}":"e","\u{1D65A}":"e","\u{1D68E}":"e","\uAB32":"e",\u0435:"e",\u04BD:"e","\u2DF7":"\u0364","\u22FF":"E",\uFF25:"E",\u2130:"E","\u{1D404}":"E","\u{1D438}":"E","\u{1D46C}":"E","\u{1D4D4}":"E","\u{1D508}":"E","\u{1D53C}":"E","\u{1D570}":"E","\u{1D5A4}":"E","\u{1D5D8}":"E","\u{1D60C}":"E","\u{1D640}":"E","\u{1D674}":"E",\u0395:"E","\u{1D6AC}":"E","\u{1D6E6}":"E","\u{1D720}":"E","\u{1D75A}":"E","\u{1D794}":"E",\u0415:"E","\u2D39":"E",\u13AC:"E","\uA4F0":"E","\u{118A6}":"E","\u{118AE}":"E","\u{10286}":"E",\u011B:"\u0115",\u011A:"\u0114","\u0247":"e\u0338","\u0246":"E\u0338",\u04BF:"e\u0328","\uAB7C":"\u1D07",\u0259:"\u01DD",\u04D9:"\u01DD","\u2203":"\u018E","\u2D3A":"\u018E","\uA4F1":"\u018E",\u025A:"\u01DD\u02DE","\u1D14":"\u01DDo","\uAB41":"\u01DDo\u0338","\uAB42":"\u01DDo\u0335",\u04D8:"\u018F","\u{1D221}":"\u0190",\u2107:"\u0190","\u0510":"\u0190",\u13CB:"\u0190","\u{16F2D}":"\u0190","\u{10401}":"\u0190","\u1D9F":"\u1D4B","\u1D08":"\u025C",\u0437:"\u025C",\u0499:"\u025C\u0326","\u{10442}":"\u025E","\uA79D":"\u029A","\u{1042A}":"\u029A","\u{1D41F}":"f","\u{1D453}":"f","\u{1D487}":"f","\u{1D4BB}":"f","\u{1D4EF}":"f","\u{1D523}":"f","\u{1D557}":"f","\u{1D58B}":"f","\u{1D5BF}":"f","\u{1D5F3}":"f","\u{1D627}":"f","\u{1D65B}":"f","\u{1D68F}":"f","\uAB35":"f","\uA799":"f",\u017F:"f","\u1E9D":"f",\u0584:"f","\u{1D213}":"F",\u2131:"F","\u{1D405}":"F","\u{1D439}":"F","\u{1D46D}":"F","\u{1D4D5}":"F","\u{1D509}":"F","\u{1D53D}":"F","\u{1D571}":"F","\u{1D5A5}":"F","\u{1D5D9}":"F","\u{1D60D}":"F","\u{1D641}":"F","\u{1D675}":"F","\uA798":"F",\u03DC:"F","\u{1D7CA}":"F",\u15B4:"F","\uA4DD":"F","\u{118C2}":"F","\u{118A2}":"F","\u{10287}":"F","\u{102A5}":"F","\u{10525}":"F",\u0192:"f\u0326",\u0191:"F\u0326","\u1D6E":"f\u0334","\u213B":"FAX",\uFB00:"ff",\uFB03:"ffi",\uFB04:"ffl",\uFB01:"fi",\uFB02:"fl",\u02A9:"f\u014B",\u15B5:"\u2132","\uA4DE":"\u2132","\u{1D230}":"\uA7FB",\u15B7:"\uA7FB",\uFF47:"g",\u210A:"g","\u{1D420}":"g","\u{1D454}":"g","\u{1D488}":"g","\u{1D4F0}":"g","\u{1D524}":"g","\u{1D558}":"g","\u{1D58C}":"g","\u{1D5C0}":"g","\u{1D5F4}":"g","\u{1D628}":"g","\u{1D65C}":"g","\u{1D690}":"g",\u0261:"g","\u1D83":"g",\u018D:"g",\u0581:"g","\u{1D406}":"G","\u{1D43A}":"G","\u{1D46E}":"G","\u{1D4A2}":"G","\u{1D4D6}":"G","\u{1D50A}":"G","\u{1D53E}":"G","\u{1D572}":"G","\u{1D5A6}":"G","\u{1D5DA}":"G","\u{1D60E}":"G","\u{1D642}":"G","\u{1D676}":"G","\u050C":"G",\u13C0:"G",\u13F3:"G","\uA4D6":"G","\u1DA2":"\u1D4D",\u0260:"g\u0314",\u01E7:"\u011F",\u01E6:"\u011E",\u01F5:"\u0123",\u01E5:"g\u0335",\u01E4:"G\u0335",\u0193:"G'","\u050D":"\u0262","\uAB90":"\u0262","\u13FB":"\u0262",\uFF48:"h",\u210E:"h","\u{1D421}":"h","\u{1D489}":"h","\u{1D4BD}":"h","\u{1D4F1}":"h","\u{1D525}":"h","\u{1D559}":"h","\u{1D58D}":"h","\u{1D5C1}":"h","\u{1D5F5}":"h","\u{1D629}":"h","\u{1D65D}":"h","\u{1D691}":"h",\u04BB:"h",\u0570:"h",\u13C2:"h",\uFF28:"H",\u210B:"H",\u210C:"H",\u210D:"H","\u{1D407}":"H","\u{1D43B}":"H","\u{1D46F}":"H","\u{1D4D7}":"H","\u{1D573}":"H","\u{1D5A7}":"H","\u{1D5DB}":"H","\u{1D60F}":"H","\u{1D643}":"H","\u{1D677}":"H",\u0397:"H","\u{1D6AE}":"H","\u{1D6E8}":"H","\u{1D722}":"H","\u{1D75C}":"H","\u{1D796}":"H","\u2C8E":"H",\u041D:"H",\u13BB:"H",\u157C:"H","\uA4E7":"H","\u{102CF}":"H","\u1D78":"\u1D34",\u0266:"h\u0314","\uA695":"h\u0314",\u13F2:"h\u0314","\u2C67":"H\u0329",\u04A2:"H\u0329",\u0127:"h\u0335",\u210F:"h\u0335",\u045B:"h\u0335",\u0126:"H\u0335","\u04C9":"H\u0326",\u04C7:"H\u0326",\u043D:"\u029C","\uAB8B":"\u029C",\u04A3:"\u029C\u0329","\u04CA":"\u029C\u0326",\u04C8:"\u029C\u0326","\u050A":"\u01F6","\uAB80":"\u2C76","\u0370":"\u2C75",\u13A8:"\u2C75",\u13B0:"\u2C75","\uA6B1":"\u2C75","\uA795":"\uA727","\u02DB":"i","\u2373":"i",\uFF49:"i","\u2170":"i",\u2139:"i","\u2148":"i","\u{1D422}":"i","\u{1D456}":"i","\u{1D48A}":"i","\u{1D4BE}":"i","\u{1D4F2}":"i","\u{1D526}":"i","\u{1D55A}":"i","\u{1D58E}":"i","\u{1D5C2}":"i","\u{1D5F6}":"i","\u{1D62A}":"i","\u{1D65E}":"i","\u{1D692}":"i",\u0131:"i","\u{1D6A4}":"i",\u026A:"i",\u0269:"i",\u03B9:"i",\u1FBE:"i",\u037A:"i","\u{1D6CA}":"i","\u{1D704}":"i","\u{1D73E}":"i","\u{1D778}":"i","\u{1D7B2}":"i",\u0456:"i","\uA647":"i","\u04CF":"i","\uAB75":"i",\u13A5:"i","\u{118C3}":"i","\u24DB":"\u24BE","\u2378":"i\u0332",\u01D0:"\u012D",\u01CF:"\u012C",\u0268:"i\u0335","\u1D7B":"i\u0335","\u1D7C":"i\u0335","\u2171":"ii","\u2172":"iii",\u0133:"ij","\u2173":"iv","\u2178":"ix",\uFF4A:"j","\u2149":"j","\u{1D423}":"j","\u{1D457}":"j","\u{1D48B}":"j","\u{1D4BF}":"j","\u{1D4F3}":"j","\u{1D527}":"j","\u{1D55B}":"j","\u{1D58F}":"j","\u{1D5C3}":"j","\u{1D5F7}":"j","\u{1D62B}":"j","\u{1D65F}":"j","\u{1D693}":"j",\u03F3:"j",\u0458:"j",\uFF2A:"J","\u{1D409}":"J","\u{1D43D}":"J","\u{1D471}":"J","\u{1D4A5}":"J","\u{1D4D9}":"J","\u{1D50D}":"J","\u{1D541}":"J","\u{1D575}":"J","\u{1D5A9}":"J","\u{1D5DD}":"J","\u{1D611}":"J","\u{1D645}":"J","\u{1D679}":"J","\uA7B2":"J","\u037F":"J",\u0408:"J",\u13AB:"J",\u148D:"J","\uA4D9":"J","\u0249":"j\u0335","\u0248":"J\u0335",\u1499:"J\xB7","\u{1D6A5}":"\u0237",\u0575:"\u0237","\uAB7B":"\u1D0A","\u{1D424}":"k","\u{1D458}":"k","\u{1D48C}":"k","\u{1D4C0}":"k","\u{1D4F4}":"k","\u{1D528}":"k","\u{1D55C}":"k","\u{1D590}":"k","\u{1D5C4}":"k","\u{1D5F8}":"k","\u{1D62C}":"k","\u{1D660}":"k","\u{1D694}":"k",\u212A:"K",\uFF2B:"K","\u{1D40A}":"K","\u{1D43E}":"K","\u{1D472}":"K","\u{1D4A6}":"K","\u{1D4DA}":"K","\u{1D50E}":"K","\u{1D542}":"K","\u{1D576}":"K","\u{1D5AA}":"K","\u{1D5DE}":"K","\u{1D612}":"K","\u{1D646}":"K","\u{1D67A}":"K",\u039A:"K","\u{1D6B1}":"K","\u{1D6EB}":"K","\u{1D725}":"K","\u{1D75F}":"K","\u{1D799}":"K","\u2C94":"K",\u041A:"K",\u13E6:"K",\u16D5:"K","\uA4D7":"K","\u{10518}":"K",\u0199:"k\u0314","\u2C69":"K\u0329",\u049A:"K\u0329","\u20AD":"K\u0335","\uA740":"K\u0335",\u049E:"K\u0335",\u0198:"K'","\u05C0":"l","|":"l","\u2223":"l","\u23FD":"l","\uFFE8":"l","\u0661":"l","\u06F1":"l","\u{10320}":"l","\u{1E8C7}":"l","\u{1D7CF}":"l","\u{1D7D9}":"l","\u{1D7E3}":"l","\u{1D7ED}":"l","\u{1D7F7}":"l","\u{1FBF1}":"l",I:Bw,\uFF29:"l","\u2160":"l",\u2110:"l",\u2111:"l","\u{1D408}":"l","\u{1D43C}":"l","\u{1D470}":"l","\u{1D4D8}":"l","\u{1D540}":"l","\u{1D574}":"l","\u{1D5A8}":"l","\u{1D5DC}":"l","\u{1D610}":"l","\u{1D644}":"l","\u{1D678}":"l",\u0196:"l",\uFF4C:"l","\u217C":"l",\u2113:"l","\u{1D425}":"l","\u{1D459}":"l","\u{1D48D}":"l","\u{1D4C1}":"l","\u{1D4F5}":"l","\u{1D529}":"l","\u{1D55D}":"l","\u{1D591}":"l","\u{1D5C5}":"l","\u{1D5F9}":"l","\u{1D62D}":"l","\u{1D661}":"l","\u{1D695}":"l",\u01C0:"l",\u0399:"l","\u{1D6B0}":"l","\u{1D6EA}":"l","\u{1D724}":"l","\u{1D75E}":"l","\u{1D798}":"l","\u2C92":"l",\u0406:"l",\u04C0:"l",\u05D5:"l",\u05DF:"l",\u0627:"l","\u{1EE00}":"l","\u{1EE80}":"l",\uFE8E:"l",\uFE8D:"l","\u07CA":"l","\u2D4F":"l",\u16C1:"l","\uA4F2":"l","\u{16F28}":"l","\u{1028A}":"l","\u{10309}":"l","\u{1D22A}":"L","\u216C":"L",\u2112:"L","\u{1D40B}":"L","\u{1D43F}":"L","\u{1D473}":"L","\u{1D4DB}":"L","\u{1D50F}":"L","\u{1D543}":"L","\u{1D577}":"L","\u{1D5AB}":"L","\u{1D5DF}":"L","\u{1D613}":"L","\u{1D647}":"L","\u{1D67B}":"L","\u2CD0":"L",\u13DE:"L",\u14AA:"L","\uA4E1":"L","\u{16F16}":"L","\u{118A3}":"L","\u{118B2}":"L","\u{1041B}":"L","\u{10526}":"L",\uFD3C:"l\u030B",\uFD3D:"l\u030B",\u0142:"l\u0338",\u0141:"L\u0338",\u026D:"l\u0328",\u0197:"l\u0335",\u019A:"l\u0335",\u026B:"l\u0334",\u0625:"l\u0655",\uFE88:"l\u0655",\uFE87:"l\u0655",\u0673:"l\u0655",\u0140:"l\xB7",\u013F:"l\xB7",\u14B7:"l\xB7","\u{1F102}":"l,","\u2488":"l.",\u05F1:"l'","\u2493":"l2.","\u33EB":"l2\u65E5","\u32CB":"l2\u6708","\u3364":"l2\u70B9","\u2494":"l3.","\u33EC":"l3\u65E5","\u3365":"l3\u70B9","\u2495":"l4.","\u33ED":"l4\u65E5","\u3366":"l4\u70B9","\u2496":"l5.","\u33EE":"l5\u65E5","\u3367":"l5\u70B9","\u2497":"l6.","\u33EF":"l6\u65E5","\u3368":"l6\u70B9","\u2498":"l7.","\u33F0":"l7\u65E5","\u3369":"l7\u70B9","\u2499":"l8.","\u33F1":"l8\u65E5","\u336A":"l8\u70B9","\u249A":"l9.","\u33F2":"l9\u65E5","\u336B":"l9\u70B9",\u01C9:"lj",\u0132:"lJ",\u01C8:"Lj",\u01C7:"LJ","\u2016":"ll","\u2225":"ll","\u2161":"ll",\u01C1:"ll",\u05F0:"ll","\u{10199}":"l\u0335l\u0335","\u2492":"ll.","\u2162":"lll","\u{10198}":"l\u0335l\u0335S\u0335","\u33EA":"ll\u65E5","\u32CA":"ll\u6708","\u3363":"ll\u70B9",\u042E:"lO","\u2491":"lO.","\u33E9":"lO\u65E5","\u32C9":"lO\u6708","\u3362":"lO\u70B9",\u02AA:"ls","\u20B6":"lt","\u2163":"lV","\u2168":"lX",\u026E:"l\u021D",\u02AB:"lz",\u0623:"l\u0674",\uFE84:"l\u0674",\uFE83:"l\u0674",\u0672:"l\u0674",\u0675:"l\u0674",\uFDF3:"l\u0643\u0628\u0631",\uFDF2:"l\u0644\u0644\u0651\u0670o","\u33E0":"l\u65E5","\u32C0":"l\u6708","\u3359":"l\u70B9","\u2CD1":"\u029F","\uABAE":"\u029F","\u{10443}":"\u029F",\uFF2D:"M","\u216F":"M",\u2133:"M","\u{1D40C}":"M","\u{1D440}":"M","\u{1D474}":"M","\u{1D4DC}":"M","\u{1D510}":"M","\u{1D544}":"M","\u{1D578}":"M","\u{1D5AC}":"M","\u{1D5E0}":"M","\u{1D614}":"M","\u{1D648}":"M","\u{1D67C}":"M",\u039C:"M","\u{1D6B3}":"M","\u{1D6ED}":"M","\u{1D727}":"M","\u{1D761}":"M","\u{1D79B}":"M","\u03FA":"M","\u2C98":"M",\u041C:"M",\u13B7:"M",\u15F0:"M",\u16D6:"M","\uA4DF":"M","\u{102B0}":"M","\u{10311}":"M","\u04CD":"M\u0326","\u{1F76B}":"MB","\u2DE8":"\u1DDF","\u{1D427}":"n","\u{1D45B}":"n","\u{1D48F}":"n","\u{1D4C3}":"n","\u{1D4F7}":"n","\u{1D52B}":"n","\u{1D55F}":"n","\u{1D593}":"n","\u{1D5C7}":"n","\u{1D5FB}":"n","\u{1D62F}":"n","\u{1D663}":"n","\u{1D697}":"n",\u0578:"n",\u057C:"n",\uFF2E:"N",\u2115:"N","\u{1D40D}":"N","\u{1D441}":"N","\u{1D475}":"N","\u{1D4A9}":"N","\u{1D4DD}":"N","\u{1D511}":"N","\u{1D579}":"N","\u{1D5AD}":"N","\u{1D5E1}":"N","\u{1D615}":"N","\u{1D649}":"N","\u{1D67D}":"N",\u039D:"N","\u{1D6B4}":"N","\u{1D6EE}":"N","\u{1D728}":"N","\u{1D762}":"N","\u{1D79C}":"N","\u2C9A":"N","\uA4E0":"N","\u{10513}":"N","\u{1018E}":"N\u030A",\u0273:"n\u0328",\u019E:"n\u0329",\u03B7:"n\u0329","\u{1D6C8}":"n\u0329","\u{1D702}":"n\u0329","\u{1D73C}":"n\u0329","\u{1D776}":"n\u0329","\u{1D7B0}":"n\u0329",\u019D:"N\u0326","\u1D70":"n\u0334",\u01CC:"nj",\u01CB:"Nj",\u01CA:"NJ","\u2116":"No","\u0377":"\u1D0E",\u0438:"\u1D0E","\u{1044D}":"\u1D0E",\u0146:"\u0272","\u0C02":"o","\u0C82":"o","\u0D02":"o","\u0D82":"o","\u0966":"o","\u0A66":"o","\u0AE6":"o","\u0BE6":"o","\u0C66":"o","\u0CE6":"o","\u0D66":"o","\u0E50":"o","\u0ED0":"o","\u1040":"o","\u0665":"o","\u06F5":"o",\uFF4F:"o",\u2134:"o","\u{1D428}":"o","\u{1D45C}":"o","\u{1D490}":"o","\u{1D4F8}":"o","\u{1D52C}":"o","\u{1D560}":"o","\u{1D594}":"o","\u{1D5C8}":"o","\u{1D5FC}":"o","\u{1D630}":"o","\u{1D664}":"o","\u{1D698}":"o","\u1D0F":"o","\u1D11":"o","\uAB3D":"o",\u03BF:"o","\u{1D6D0}":"o","\u{1D70A}":"o","\u{1D744}":"o","\u{1D77E}":"o","\u{1D7B8}":"o",\u03C3:"o","\u{1D6D4}":"o","\u{1D70E}":"o","\u{1D748}":"o","\u{1D782}":"o","\u{1D7BC}":"o","\u2C9F":"o",\u043E:"o","\u10FF":"o",\u0585:"o",\u05E1:"o",\u0647:"o","\u{1EE24}":"o","\u{1EE64}":"o","\u{1EE84}":"o",\uFEEB:"o",\uFEEC:"o",\uFEEA:"o",\uFEE9:"o",\u06BE:"o",\uFBAC:"o",\uFBAD:"o",\uFBAB:"o",\uFBAA:"o",\u06C1:"o",\uFBA8:"o",\uFBA9:"o",\uFBA7:"o",\uFBA6:"o",\u06D5:"o",\u0D20:"o",\u101D:"o","\u{104EA}":"o","\u{118C8}":"o","\u{118D7}":"o","\u{1042C}":"o","\u07C0":"O","\u09E6":"O","\u0B66":"O","\u3007":"O","\u{114D0}":"O","\u{118E0}":"O","\u{1D7CE}":"O","\u{1D7D8}":"O","\u{1D7E2}":"O","\u{1D7EC}":"O","\u{1D7F6}":"O","\u{1FBF0}":"O",\uFF2F:"O","\u{1D40E}":"O","\u{1D442}":"O","\u{1D476}":"O","\u{1D4AA}":"O","\u{1D4DE}":"O","\u{1D512}":"O","\u{1D546}":"O","\u{1D57A}":"O","\u{1D5AE}":"O","\u{1D5E2}":"O","\u{1D616}":"O","\u{1D64A}":"O","\u{1D67E}":"O",\u039F:"O","\u{1D6B6}":"O","\u{1D6F0}":"O","\u{1D72A}":"O","\u{1D764}":"O","\u{1D79E}":"O","\u2C9E":"O",\u041E:"O",\u0555:"O","\u2D54":"O",\u12D0:"O",\u0B20:"O","\u{104C2}":"O","\uA4F3":"O","\u{118B5}":"O","\u{10292}":"O","\u{102AB}":"O","\u{10404}":"O","\u{10516}":"O","\u2070":"\xBA","\u1D52":"\xBA",\u01D2:"\u014F",\u01D1:"\u014E","\u06FF":"o\u0302",\u0150:"\xD6",\u00F8:"o\u0338","\uAB3E":"o\u0338",\u00D8:"O\u0338","\u2D41":"O\u0338",\u01FE:"O\u0338\u0301",\u0275:"o\u0335","\uA74B":"o\u0335",\u04E9:"o\u0335",\u0473:"o\u0335","\uAB8E":"o\u0335","\uABBB":"o\u0335","\u2296":"O\u0335","\u229D":"O\u0335","\u236C":"O\u0335","\u{1D21A}":"O\u0335","\u{1F714}":"O\u0335",\u019F:"O\u0335","\uA74A":"O\u0335",\u03B8:"O\u0335",\u03D1:"O\u0335","\u{1D6C9}":"O\u0335","\u{1D6DD}":"O\u0335","\u{1D703}":"O\u0335","\u{1D717}":"O\u0335","\u{1D73D}":"O\u0335","\u{1D751}":"O\u0335","\u{1D777}":"O\u0335","\u{1D78B}":"O\u0335","\u{1D7B1}":"O\u0335","\u{1D7C5}":"O\u0335",\u0398:"O\u0335","\u03F4":"O\u0335","\u{1D6AF}":"O\u0335","\u{1D6B9}":"O\u0335","\u{1D6E9}":"O\u0335","\u{1D6F3}":"O\u0335","\u{1D723}":"O\u0335","\u{1D72D}":"O\u0335","\u{1D75D}":"O\u0335","\u{1D767}":"O\u0335","\u{1D797}":"O\u0335","\u{1D7A1}":"O\u0335",\u04E8:"O\u0335",\u0472:"O\u0335","\u2D31":"O\u0335",\u13BE:"O\u0335",\u13EB:"O\u0335","\uAB74":"o\u031B",\uFCD9:"o\u0670","\u{1F101}":"O,","\u{1F100}":"O.",\u01A1:"o'",\u01A0:"O'",\u13A4:"O'","%":"\xBA/\u2080","\u066A":"\xBA/\u2080","\u2052":"\xBA/\u2080","\u2030":"\xBA/\u2080\u2080","\u0609":"\xBA/\u2080\u2080","\u2031":"\xBA/\u2080\u2080\u2080","\u060A":"\xBA/\u2080\u2080\u2080",\u0153:"oe",\u0152:"OE",\u0276:"o\u1D07","\u221E":"oo","\uA74F":"oo","\uA699":"oo","\uA74E":"OO","\uA698":"OO",\uFCD7:"o\u062C",\uFC51:"o\u062C",\uFCD8:"o\u0645",\uFC52:"o\u0645",\uFD93:"o\u0645\u062C",\uFD94:"o\u0645\u0645",\uFC53:"o\u0649",\uFC54:"o\u0649","\u0D5F":"o\u0D30o",\u1010:"o\u102C","\u3358":"O\u70B9","\u2184":"\u0254","\u1D10":"\u0254","\u037B":"\u0254","\u{1044B}":"\u0254","\u2183":"\u0186","\u03FD":"\u0186","\uA4DB":"\u0186","\u{10423}":"\u0186","\uAB3F":"\u0254\u0338","\uAB62":"\u0254e","\u{1043F}":"\u0277","\u2374":"p",\uFF50:"p","\u{1D429}":"p","\u{1D45D}":"p","\u{1D491}":"p","\u{1D4C5}":"p","\u{1D4F9}":"p","\u{1D52D}":"p","\u{1D561}":"p","\u{1D595}":"p","\u{1D5C9}":"p","\u{1D5FD}":"p","\u{1D631}":"p","\u{1D665}":"p","\u{1D699}":"p",\u03C1:"p",\u03F1:"p","\u{1D6D2}":"p","\u{1D6E0}":"p","\u{1D70C}":"p","\u{1D71A}":"p","\u{1D746}":"p","\u{1D754}":"p","\u{1D780}":"p","\u{1D78E}":"p","\u{1D7BA}":"p","\u{1D7C8}":"p","\u2CA3":"p",\u0440:"p",\uFF30:"P",\u2119:"P","\u{1D40F}":"P","\u{1D443}":"P","\u{1D477}":"P","\u{1D4AB}":"P","\u{1D4DF}":"P","\u{1D513}":"P","\u{1D57B}":"P","\u{1D5AF}":"P","\u{1D5E3}":"P","\u{1D617}":"P","\u{1D64B}":"P","\u{1D67F}":"P",\u03A1:"P","\u{1D6B8}":"P","\u{1D6F2}":"P","\u{1D72C}":"P","\u{1D766}":"P","\u{1D7A0}":"P","\u2CA2":"P",\u0420:"P",\u13E2:"P",\u146D:"P","\uA4D1":"P","\u{10295}":"P",\u01A5:"p\u0314","\u1D7D":"p\u0335",\u1477:"p\xB7",\u1486:"P'","\u1D29":"\u1D18","\uABB2":"\u1D18",\u03C6:"\u0278",\u03D5:"\u0278","\u{1D6D7}":"\u0278","\u{1D6DF}":"\u0278","\u{1D711}":"\u0278","\u{1D719}":"\u0278","\u{1D74B}":"\u0278","\u{1D753}":"\u0278","\u{1D785}":"\u0278","\u{1D78D}":"\u0278","\u{1D7BF}":"\u0278","\u{1D7C7}":"\u0278","\u2CAB":"\u0278",\u0444:"\u0278","\u{1D42A}":"q","\u{1D45E}":"q","\u{1D492}":"q","\u{1D4C6}":"q","\u{1D4FA}":"q","\u{1D52E}":"q","\u{1D562}":"q","\u{1D596}":"q","\u{1D5CA}":"q","\u{1D5FE}":"q","\u{1D632}":"q","\u{1D666}":"q","\u{1D69A}":"q","\u051B":"q",\u0563:"q",\u0566:"q",\u211A:"Q","\u{1D410}":"Q","\u{1D444}":"Q","\u{1D478}":"Q","\u{1D4AC}":"Q","\u{1D4E0}":"Q","\u{1D514}":"Q","\u{1D57C}":"Q","\u{1D5B0}":"Q","\u{1D5E4}":"Q","\u{1D618}":"Q","\u{1D64C}":"Q","\u{1D680}":"Q","\u2D55":"Q",\u02A0:"q\u0314","\u{1F700}":"QE","\u1D90":"\u024B","\u1D0B":"\u0138",\u03BA:"\u0138",\u03F0:"\u0138","\u{1D6CB}":"\u0138","\u{1D6DE}":"\u0138","\u{1D705}":"\u0138","\u{1D718}":"\u0138","\u{1D73F}":"\u0138","\u{1D752}":"\u0138","\u{1D779}":"\u0138","\u{1D78C}":"\u0138","\u{1D7B3}":"\u0138","\u{1D7C6}":"\u0138","\u2C95":"\u0138",\u043A:"\u0138","\uABB6":"\u0138",\u049B:"\u0138\u0329",\u049F:"\u0138\u0335","\u{1D42B}":"r","\u{1D45F}":"r","\u{1D493}":"r","\u{1D4C7}":"r","\u{1D4FB}":"r","\u{1D52F}":"r","\u{1D563}":"r","\u{1D597}":"r","\u{1D5CB}":"r","\u{1D5FF}":"r","\u{1D633}":"r","\u{1D667}":"r","\u{1D69B}":"r","\uAB47":"r","\uAB48":"r","\u1D26":"r","\u2C85":"r",\u0433:"r","\uAB81":"r","\u{1D216}":"R",\u211B:"R",\u211C:"R",\u211D:"R","\u{1D411}":"R","\u{1D445}":"R","\u{1D479}":"R","\u{1D4E1}":"R","\u{1D57D}":"R","\u{1D5B1}":"R","\u{1D5E5}":"R","\u{1D619}":"R","\u{1D64D}":"R","\u{1D681}":"R",\u01A6:"R",\u13A1:"R",\u13D2:"R","\u{104B4}":"R",\u1587:"R","\uA4E3":"R","\u{16F35}":"R",\u027D:"r\u0328",\u027C:"r\u0329","\u024D":"r\u0335",\u0493:"r\u0335","\u1D72":"r\u0334",\u0491:"r'","\u{118E3}":"rn",m:Kw,"\u217F":"rn","\u{1D426}":"rn","\u{1D45A}":"rn","\u{1D48E}":"rn","\u{1D4C2}":"rn","\u{1D4F6}":"rn","\u{1D52A}":"rn","\u{1D55E}":"rn","\u{1D592}":"rn","\u{1D5C6}":"rn","\u{1D5FA}":"rn","\u{1D62E}":"rn","\u{1D662}":"rn","\u{1D696}":"rn","\u{11700}":"rn","\u20A5":"rn\u0338",\u0271:"rn\u0326","\u1D6F":"rn\u0334","\u20A8":"Rs","\uAB71":"\u0280","\uABA2":"\u0280",\u044F:"\u1D19","\u1D73":"\u027E\u0334","\u2129":"\u027F",\uFF53:"s","\u{1D42C}":"s","\u{1D460}":"s","\u{1D494}":"s","\u{1D4C8}":"s","\u{1D4FC}":"s","\u{1D530}":"s","\u{1D564}":"s","\u{1D598}":"s","\u{1D5CC}":"s","\u{1D600}":"s","\u{1D634}":"s","\u{1D668}":"s","\u{1D69C}":"s","\uA731":"s",\u01BD:"s",\u0455:"s","\uABAA":"s","\u{118C1}":"s","\u{10448}":"s",\uFF33:"S","\u{1D412}":"S","\u{1D446}":"S","\u{1D47A}":"S","\u{1D4AE}":"S","\u{1D4E2}":"S","\u{1D516}":"S","\u{1D54A}":"S","\u{1D57E}":"S","\u{1D5B2}":"S","\u{1D5E6}":"S","\u{1D61A}":"S","\u{1D64E}":"S","\u{1D682}":"S",\u0405:"S",\u054F:"S",\u13D5:"S",\u13DA:"S","\uA4E2":"S","\u{16F3A}":"S","\u{10296}":"S","\u{10420}":"S",\u0282:"s\u0328","\u1D74":"s\u0334","\uA7B5":"\xDF",\u03B2:"\xDF",\u03D0:"\xDF","\u{1D6C3}":"\xDF","\u{1D6FD}":"\xDF","\u{1D737}":"\xDF","\u{1D771}":"\xDF","\u{1D7AB}":"\xDF",\u13F0:"\xDF","\u{1F75C}":"sss",\uFB06:"st","\u222B":"\u0283","\uAB4D":"\u0283","\u2211":"\u01A9","\u2140":"\u01A9",\u03A3:"\u01A9","\u{1D6BA}":"\u01A9","\u{1D6F4}":"\u01A9","\u{1D72E}":"\u01A9","\u{1D768}":"\u01A9","\u{1D7A2}":"\u01A9","\u2D49":"\u01A9","\u222C":"\u0283\u0283","\u222D":"\u0283\u0283\u0283","\u2A0C":"\u0283\u0283\u0283\u0283","\u{1D42D}":"t","\u{1D461}":"t","\u{1D495}":"t","\u{1D4C9}":"t","\u{1D4FD}":"t","\u{1D531}":"t","\u{1D565}":"t","\u{1D599}":"t","\u{1D5CD}":"t","\u{1D601}":"t","\u{1D635}":"t","\u{1D669}":"t","\u{1D69D}":"t","\u22A4":"T","\u27D9":"T","\u{1F768}":"T",\uFF34:"T","\u{1D413}":"T","\u{1D447}":"T","\u{1D47B}":"T","\u{1D4AF}":"T","\u{1D4E3}":"T","\u{1D517}":"T","\u{1D54B}":"T","\u{1D57F}":"T","\u{1D5B3}":"T","\u{1D5E7}":"T","\u{1D61B}":"T","\u{1D64F}":"T","\u{1D683}":"T",\u03A4:"T","\u{1D6BB}":"T","\u{1D6F5}":"T","\u{1D72F}":"T","\u{1D769}":"T","\u{1D7A3}":"T","\u2CA6":"T",\u0422:"T",\u13A2:"T","\uA4D4":"T","\u{16F0A}":"T","\u{118BC}":"T","\u{10297}":"T","\u{102B1}":"T","\u{10315}":"T",\u01AD:"t\u0314","\u2361":"T\u0308","\u023E":"T\u0338",\u021A:"\u0162",\u01AE:"T\u0328",\u04AC:"T\u0329","\u20AE":"T\u20EB",\u0167:"t\u0335",\u0166:"T\u0335","\u1D75":"t\u0334",\u10A0:"\uA786","\uA728":"T3",\u02A8:"t\u0255","\u2121":"TEL","\uA777":"tf",\u02A6:"ts",\u02A7:"t\u0283","\uA729":"t\u021D",\u03C4:"\u1D1B","\u{1D6D5}":"\u1D1B","\u{1D70F}":"\u1D1B","\u{1D749}":"\u1D1B","\u{1D783}":"\u1D1B","\u{1D7BD}":"\u1D1B",\u0442:"\u1D1B","\uAB72":"\u1D1B",\u04AD:"\u1D1B\u0329",\u0163:"\u01AB",\u021B:"\u01AB",\u13BF:"\u01AB","\u{1D42E}":"u","\u{1D462}":"u","\u{1D496}":"u","\u{1D4CA}":"u","\u{1D4FE}":"u","\u{1D532}":"u","\u{1D566}":"u","\u{1D59A}":"u","\u{1D5CE}":"u","\u{1D602}":"u","\u{1D636}":"u","\u{1D66A}":"u","\u{1D69E}":"u","\uA79F":"u","\u1D1C":"u","\uAB4E":"u","\uAB52":"u",\u028B:"u",\u03C5:"u","\u{1D6D6}":"u","\u{1D710}":"u","\u{1D74A}":"u","\u{1D784}":"u","\u{1D7BE}":"u",\u057D:"u","\u{104F6}":"u","\u{118D8}":"u","\u222A":"U","\u22C3":"U","\u{1D414}":"U","\u{1D448}":"U","\u{1D47C}":"U","\u{1D4B0}":"U","\u{1D4E4}":"U","\u{1D518}":"U","\u{1D54C}":"U","\u{1D580}":"U","\u{1D5B4}":"U","\u{1D5E8}":"U","\u{1D61C}":"U","\u{1D650}":"U","\u{1D684}":"U",\u054D:"U",\u1200:"U","\u{104CE}":"U",\u144C:"U","\uA4F4":"U","\u{16F42}":"U","\u{118B8}":"U",\u01D4:"\u016D",\u01D3:"\u016C","\u1D7E":"u\u0335","\uAB9C":"u\u0335","\u0244":"U\u0335",\u13CC:"U\u0335",\u1458:"U\xB7",\u1467:"U'","\u1D6B":"ue","\uAB63":"uo",\u1E43:"\uAB51",\u057A:"\u0270",\u1223:"\u0270","\u2127":"\u01B1",\u162E:"\u01B1",\u1634:"\u01B1","\u1D7F":"\u028A\u0335","\u2228":"v","\u22C1":"v",\uFF56:"v","\u2174":"v","\u{1D42F}":"v","\u{1D463}":"v","\u{1D497}":"v","\u{1D4CB}":"v","\u{1D4FF}":"v","\u{1D533}":"v","\u{1D567}":"v","\u{1D59B}":"v","\u{1D5CF}":"v","\u{1D603}":"v","\u{1D637}":"v","\u{1D66B}":"v","\u{1D69F}":"v","\u1D20":"v",\u03BD:"v","\u{1D6CE}":"v","\u{1D708}":"v","\u{1D742}":"v","\u{1D77C}":"v","\u{1D7B6}":"v",\u0475:"v",\u05D8:"v","\u{11706}":"v","\uABA9":"v","\u{118C0}":"v","\u{1D20D}":"V","\u0667":"V","\u06F7":"V","\u2164":"V","\u{1D415}":"V","\u{1D449}":"V","\u{1D47D}":"V","\u{1D4B1}":"V","\u{1D4E5}":"V","\u{1D519}":"V","\u{1D54D}":"V","\u{1D581}":"V","\u{1D5B5}":"V","\u{1D5E9}":"V","\u{1D61D}":"V","\u{1D651}":"V","\u{1D685}":"V",\u0474:"V","\u2D38":"V",\u13D9:"V",\u142F:"V","\uA6DF":"V","\uA4E6":"V","\u{16F08}":"V","\u{118A0}":"V","\u{1051D}":"V","\u{10197}":"V\u0335",\u143B:"V\xB7","\u{1F76C}":"VB","\u2175":"vi","\u2176":"vii","\u2177":"viii","\u2165":"Vl","\u2166":"Vll","\u2167":"Vlll","\u{1F708}":"V\u1DE4","\u1D27":"\u028C","\u{104D8}":"\u028C","\u0668":"\u0245","\u06F8":"\u0245",\u039B:"\u0245","\u{1D6B2}":"\u0245","\u{1D6EC}":"\u0245","\u{1D726}":"\u0245","\u{1D760}":"\u0245","\u{1D79A}":"\u0245",\u041B:"\u0245","\u2D37":"\u0245","\u{104B0}":"\u0245",\u1431:"\u0245","\uA6CE":"\u0245","\uA4E5":"\u0245","\u{16F3D}":"\u0245","\u{1028D}":"\u0245","\u04C5":"\u0245\u0326",\u143D:"\u0245\xB7",\u026F:"w","\u{1D430}":"w","\u{1D464}":"w","\u{1D498}":"w","\u{1D4CC}":"w","\u{1D500}":"w","\u{1D534}":"w","\u{1D568}":"w","\u{1D59C}":"w","\u{1D5D0}":"w","\u{1D604}":"w","\u{1D638}":"w","\u{1D66C}":"w","\u{1D6A0}":"w","\u1D21":"w",\u0461:"w","\u051D":"w",\u0561:"w","\u{1170A}":"w","\u{1170E}":"w","\u{1170F}":"w","\uAB83":"w","\u{118EF}":"W","\u{118E6}":"W","\u{1D416}":"W","\u{1D44A}":"W","\u{1D47E}":"W","\u{1D4B2}":"W","\u{1D4E6}":"W","\u{1D51A}":"W","\u{1D54E}":"W","\u{1D582}":"W","\u{1D5B6}":"W","\u{1D5EA}":"W","\u{1D61E}":"W","\u{1D652}":"W","\u{1D686}":"W","\u051C":"W",\u13B3:"W",\u13D4:"W","\uA4EA":"W",\u047D:"w\u0486\u0487","\u{114C5}":"w\u0307","\u20A9":"W\u0335","\uA761":"w\u0326","\u1D0D":"\u028D",\u043C:"\u028D","\uAB87":"\u028D","\u04CE":"\u028D\u0326","\u166E":"x","\xD7":"x","\u292B":"x","\u292C":"x","\u2A2F":"x",\uFF58:"x","\u2179":"x","\u{1D431}":"x","\u{1D465}":"x","\u{1D499}":"x","\u{1D4CD}":"x","\u{1D501}":"x","\u{1D535}":"x","\u{1D569}":"x","\u{1D59D}":"x","\u{1D5D1}":"x","\u{1D605}":"x","\u{1D639}":"x","\u{1D66D}":"x","\u{1D6A1}":"x",\u0445:"x",\u1541:"x",\u157D:"x","\u2DEF":"\u036F","\u166D":"X","\u2573":"X","\u{10322}":"X","\u{118EC}":"X",\uFF38:"X","\u2169":"X","\u{1D417}":"X","\u{1D44B}":"X","\u{1D47F}":"X","\u{1D4B3}":"X","\u{1D4E7}":"X","\u{1D51B}":"X","\u{1D54F}":"X","\u{1D583}":"X","\u{1D5B7}":"X","\u{1D5EB}":"X","\u{1D61F}":"X","\u{1D653}":"X","\u{1D687}":"X","\uA7B3":"X",\u03A7:"X","\u{1D6BE}":"X","\u{1D6F8}":"X","\u{1D732}":"X","\u{1D76C}":"X","\u{1D7A6}":"X","\u2CAC":"X",\u0425:"X","\u2D5D":"X",\u16B7:"X","\uA4EB":"X","\u{10290}":"X","\u{102B4}":"X","\u{10317}":"X","\u{10527}":"X","\u2A30":"x\u0307",\u04B2:"X\u0329","\u{10196}":"X\u0335","\u217A":"xi","\u217B":"xii","\u216A":"Xl","\u216B":"Xll",\u0263:"y","\u1D8C":"y",\uFF59:"y","\u{1D432}":"y","\u{1D466}":"y","\u{1D49A}":"y","\u{1D4CE}":"y","\u{1D502}":"y","\u{1D536}":"y","\u{1D56A}":"y","\u{1D59E}":"y","\u{1D5D2}":"y","\u{1D606}":"y","\u{1D63A}":"y","\u{1D66E}":"y","\u{1D6A2}":"y",\u028F:"y","\u1EFF":"y","\uAB5A":"y",\u03B3:"y","\u213D":"y","\u{1D6C4}":"y","\u{1D6FE}":"y","\u{1D738}":"y","\u{1D772}":"y","\u{1D7AC}":"y",\u0443:"y",\u04AF:"y",\u10E7:"y","\u{118DC}":"y",\uFF39:"Y","\u{1D418}":"Y","\u{1D44C}":"Y","\u{1D480}":"Y","\u{1D4B4}":"Y","\u{1D4E8}":"Y","\u{1D51C}":"Y","\u{1D550}":"Y","\u{1D584}":"Y","\u{1D5B8}":"Y","\u{1D5EC}":"Y","\u{1D620}":"Y","\u{1D654}":"Y","\u{1D688}":"Y",\u03A5:"Y",\u03D2:"Y","\u{1D6BC}":"Y","\u{1D6F6}":"Y","\u{1D730}":"Y","\u{1D76A}":"Y","\u{1D7A4}":"Y","\u2CA8":"Y",\u0423:"Y",\u04AE:"Y",\u13A9:"Y",\u13BD:"Y","\uA4EC":"Y","\u{16F43}":"Y","\u{118A4}":"Y","\u{102B2}":"Y",\u01B4:"y\u0314","\u024F":"y\u0335",\u04B1:"y\u0335","\xA5":"Y\u0335","\u024E":"Y\u0335",\u04B0:"Y\u0335",\u0292:"\u021D","\uA76B":"\u021D","\u2CCD":"\u021D",\u04E1:"\u021D",\u10F3:"\u021D","\u{1D433}":"z","\u{1D467}":"z","\u{1D49B}":"z","\u{1D4CF}":"z","\u{1D503}":"z","\u{1D537}":"z","\u{1D56B}":"z","\u{1D59F}":"z","\u{1D5D3}":"z","\u{1D607}":"z","\u{1D63B}":"z","\u{1D66F}":"z","\u{1D6A3}":"z","\u1D22":"z","\uAB93":"z","\u{118C4}":"z","\u{102F5}":"Z","\u{118E5}":"Z",\uFF3A:"Z",\u2124:"Z",\u2128:"Z","\u{1D419}":"Z","\u{1D44D}":"Z","\u{1D481}":"Z","\u{1D4B5}":"Z","\u{1D4E9}":"Z","\u{1D585}":"Z","\u{1D5B9}":"Z","\u{1D5ED}":"Z","\u{1D621}":"Z","\u{1D655}":"Z","\u{1D689}":"Z",\u0396:"Z","\u{1D6AD}":"Z","\u{1D6E7}":"Z","\u{1D721}":"Z","\u{1D75B}":"Z","\u{1D795}":"Z",\u13C3:"Z","\uA4DC":"Z","\u{118A9}":"Z",\u0290:"z\u0328",\u01B6:"z\u0335",\u01B5:"Z\u0335",\u0225:"z\u0326",\u0224:"Z\u0326","\u1D76":"z\u0334",\u01BF:"\xFE","\u03F8":"\xFE","\u03F7":"\xDE","\u{104C4}":"\xDE","\u2079":"\uA770","\u1D24":"\u01A8",\u03E9:"\u01A8","\uA645":"\u01A8",\u044C:"\u0185","\uAB9F":"\u0185",\u044B:"\u0185i","\uAB7E":"\u0242",\u02E4:"\u02C1","\uA6CD":"\u02A1","\u2299":"\u0298","\u2609":"\u0298","\u2A00":"\u0298","\uA668":"\u0298","\u2D59":"\u0298","\u{104C3}":"\u0298","\u213E":"\u0393","\u{1D6AA}":"\u0393","\u{1D6E4}":"\u0393","\u{1D71E}":"\u0393","\u{1D758}":"\u0393","\u{1D792}":"\u0393","\u2C84":"\u0393",\u0413:"\u0393",\u13B1:"\u0393",\u14A5:"\u0393","\u{16F07}":"\u0393",\u0492:"\u0393\u0335",\u14AF:"\u0393\xB7",\u0490:"\u0393'","\u2206":"\u0394","\u25B3":"\u0394","\u{1F702}":"\u0394","\u{1D6AB}":"\u0394","\u{1D6E5}":"\u0394","\u{1D71F}":"\u0394","\u{1D759}":"\u0394","\u{1D793}":"\u0394","\u2C86":"\u0394","\u2D60":"\u0394",\u1403:"\u0394","\u{16F1A}":"\u0394","\u{10285}":"\u0394","\u{102A3}":"\u0394","\u2359":"\u0394\u0332",\u140F:"\u0394\xB7",\u142C:"\u0394\u1420","\u{1D7CB}":"\u03DD","\u{1D6C7}":"\u03B6","\u{1D701}":"\u03B6","\u{1D73B}":"\u03B6","\u{1D775}":"\u03B6","\u{1D7AF}":"\u03B6","\u2CE4":"\u03D7","\u{1D6CC}":"\u03BB","\u{1D706}":"\u03BB","\u{1D740}":"\u03BB","\u{1D77A}":"\u03BB","\u{1D7B4}":"\u03BB","\u2C96":"\u03BB","\u{104DB}":"\u03BB",\u00B5:"\u03BC","\u{1D6CD}":"\u03BC","\u{1D707}":"\u03BC","\u{1D741}":"\u03BC","\u{1D77B}":"\u03BC","\u{1D7B5}":"\u03BC","\u{1D6CF}":"\u03BE","\u{1D709}":"\u03BE","\u{1D743}":"\u03BE","\u{1D77D}":"\u03BE","\u{1D7B7}":"\u03BE","\u{1D6B5}":"\u039E","\u{1D6EF}":"\u039E","\u{1D729}":"\u039E","\u{1D763}":"\u039E","\u{1D79D}":"\u039E",\u03D6:"\u03C0","\u213C":"\u03C0","\u{1D6D1}":"\u03C0","\u{1D6E1}":"\u03C0","\u{1D70B}":"\u03C0","\u{1D71B}":"\u03C0","\u{1D745}":"\u03C0","\u{1D755}":"\u03C0","\u{1D77F}":"\u03C0","\u{1D78F}":"\u03C0","\u{1D7B9}":"\u03C0","\u{1D7C9}":"\u03C0","\u1D28":"\u03C0",\u043F:"\u03C0","\u220F":"\u03A0","\u213F":"\u03A0","\u{1D6B7}":"\u03A0","\u{1D6F1}":"\u03A0","\u{1D72B}":"\u03A0","\u{1D765}":"\u03A0","\u{1D79F}":"\u03A0","\u2CA0":"\u03A0",\u041F:"\u03A0","\uA6DB":"\u03A0","\u{102AD}":"\u03D8","\u{10312}":"\u03D8",\u03DB:"\u03C2","\u{1D6D3}":"\u03C2","\u{1D70D}":"\u03C2","\u{1D747}":"\u03C2","\u{1D781}":"\u03C2","\u{1D7BB}":"\u03C2","\u{1D6BD}":"\u03A6","\u{1D6F7}":"\u03A6","\u{1D731}":"\u03A6","\u{1D76B}":"\u03A6","\u{1D7A5}":"\u03A6","\u2CAA":"\u03A6",\u0424:"\u03A6",\u0553:"\u03A6",\u1240:"\u03A6","\u16F0":"\u03A6","\u{102B3}":"\u03A6","\uAB53":"\u03C7","\uAB55":"\u03C7","\u{1D6D8}":"\u03C7","\u{1D712}":"\u03C7","\u{1D74C}":"\u03C7","\u{1D786}":"\u03C7","\u{1D7C0}":"\u03C7","\u2CAD":"\u03C7","\u{1D6D9}":"\u03C8","\u{1D713}":"\u03C8","\u{1D74D}":"\u03C8","\u{1D787}":"\u03C8","\u{1D7C1}":"\u03C8",\u0471:"\u03C8","\u{104F9}":"\u03C8","\u{1D6BF}":"\u03A8","\u{1D6F9}":"\u03A8","\u{1D733}":"\u03A8","\u{1D76D}":"\u03A8","\u{1D7A7}":"\u03A8","\u2CAE":"\u03A8",\u0470:"\u03A8","\u{104D1}":"\u03A8",\u16D8:"\u03A8","\u{102B5}":"\u03A8","\u2375":"\u03C9","\uA7B7":"\u03C9","\u{1D6DA}":"\u03C9","\u{1D714}":"\u03C9","\u{1D74E}":"\u03C9","\u{1D788}":"\u03C9","\u{1D7C2}":"\u03C9","\u2CB1":"\u03C9","\uA64D":"\u03C9",\u2126:"\u03A9","\u{1D6C0}":"\u03A9","\u{1D6FA}":"\u03A9","\u{1D734}":"\u03A9","\u{1D76E}":"\u03A9","\u{1D7A8}":"\u03A9",\u162F:"\u03A9",\u1635:"\u03A9","\u{102B6}":"\u03A9","\u2379":"\u03C9\u0332",\u1F7D:"\u1FF4","\u2630":"\u2CB6","\u2CDC":"\u03EC",\u0497:"\u0436\u0329",\u0496:"\u0416\u0329","\u{1D20B}":"\u0418","\u0376":"\u0418","\uA6A1":"\u0418","\u{10425}":"\u0418",\u0419:"\u040D","\u048A":"\u040D\u0326",\u045D:"\u0439","\u048B":"\u0439\u0326","\u{104BC}":"\u04C3","\u1D2B":"\u043B","\u04C6":"\u043B\u0326","\uAB60":"\u0459","\u{104EB}":"\uA669","\u1DEE":"\u2DEC","\u{104CD}":"\u040B","\u{1D202}":"\u04FE","\u{1D222}":"\u0460",\u13C7:"\u0460",\u15EF:"\u0460",\u047C:"\u0460\u0486\u0487","\u18ED":"\u0460\xB7","\uA7B6":"\uA64C",\u04CC:"\u04B7",\u04CB:"\u04B6",\u04BE:"\u04BC\u0328","\u2CBD":"\u0448","\u2CBC":"\u0428","\uA650":"\u042Al","\u2108":"\u042D","\u{1F701}":"\uA658","\u{16F1C}":"\uA658","\uA992":"\u2C3F",\u0587:"\u0565\u0582",\u1294:"\u0571",\uFB14:"\u0574\u0565",\uFB15:"\u0574\u056B",\uFB17:"\u0574\u056D",\uFB13:"\u0574\u0576","\u2229":"\u0548","\u22C2":"\u0548","\u{1D245}":"\u0548",\u1260:"\u0548",\u144E:"\u0548","\uA4F5":"\u0548",\u145A:"\u0548\xB7",\u1468:"\u0548'",\uFB16:"\u057E\u0576","\u20BD":"\u0554","\u02D3":"\u0559",\u02BF:"\u0559",\u2135:"\u05D0",\uFB21:"\u05D0",\uFB2F:"\uFB2E",\uFB30:"\uFB2E",\uFB4F:"\u05D0\u05DC",\u2136:"\u05D1",\u2137:"\u05D2",\u2138:"\u05D3",\uFB22:"\u05D3",\uFB23:"\u05D4",\uFB39:"\uFB1D",\uFB24:"\u05DB",\uFB25:"\u05DC",\uFB26:"\u05DD",\uFB20:"\u05E2",\uFB27:"\u05E8",\uFB2B:"\uFB2A",\uFB49:"\uFB2A",\uFB2D:"\uFB2C",\uFB28:"\u05EA",\uFE80:"\u0621","\u06FD":"\u0621\u0348",\uFE82:"\u0622",\uFE81:"\u0622",\uFB51:"\u0671",\uFB50:"\u0671","\u{1EE01}":"\u0628","\u{1EE21}":"\u0628","\u{1EE61}":"\u0628","\u{1EE81}":"\u0628","\u{1EEA1}":"\u0628",\uFE91:"\u0628",\uFE92:"\u0628",\uFE90:"\u0628",\uFE8F:"\u0628","\u0751":"\u0628\u06DB","\u08B6":"\u0628\u06E2","\u08A1":"\u0628\u0654",\uFCA0:"\u0628o",\uFCE2:"\u0628o",\uFC9C:"\u0628\u062C",\uFC05:"\u0628\u062C",\uFC9D:"\u0628\u062D",\uFC06:"\u0628\u062D",\uFDC2:"\u0628\u062D\u0649",\uFC9E:"\u0628\u062E",\uFC07:"\u0628\u062E",\uFCD2:"\u0628\u062E",\uFC4B:"\u0628\u062E",\uFD9E:"\u0628\u062E\u0649",\uFC6A:"\u0628\u0631",\uFC6B:"\u0628\u0632",\uFC9F:"\u0628\u0645",\uFCE1:"\u0628\u0645",\uFC6C:"\u0628\u0645",\uFC08:"\u0628\u0645",\uFC6D:"\u0628\u0646",\uFC6E:"\u0628\u0649",\uFC09:"\u0628\u0649",\uFC6F:"\u0628\u0649",\uFC0A:"\u0628\u0649",\uFB54:"\u067B",\uFB55:"\u067B",\uFB53:"\u067B",\uFB52:"\u067B",\u06D0:"\u067B",\uFBE6:"\u067B",\uFBE7:"\u067B",\uFBE5:"\u067B",\uFBE4:"\u067B",\uFB5C:"\u0680",\uFB5D:"\u0680",\uFB5B:"\u0680",\uFB5A:"\u0680","\u08A9":"\u0754","\u0767":"\u0754","\u2365":"\u0629",\u00F6:"\u0629",\uFE94:"\u0629",\uFE93:"\u0629",\u06C3:"\u0629","\u{1EE15}":"\u062A","\u{1EE35}":"\u062A","\u{1EE75}":"\u062A","\u{1EE95}":"\u062A","\u{1EEB5}":"\u062A",\uFE97:"\u062A",\uFE98:"\u062A",\uFE96:"\u062A",\uFE95:"\u062A",\uFCA5:"\u062Ao",\uFCE4:"\u062Ao",\uFCA1:"\u062A\u062C",\uFC0B:"\u062A\u062C",\uFD50:"\u062A\u062C\u0645",\uFDA0:"\u062A\u062C\u0649",\uFD9F:"\u062A\u062C\u0649",\uFCA2:"\u062A\u062D",\uFC0C:"\u062A\u062D",\uFD52:"\u062A\u062D\u062C",\uFD51:"\u062A\u062D\u062C",\uFD53:"\u062A\u062D\u0645",\uFCA3:"\u062A\u062E",\uFC0D:"\u062A\u062E",\uFD54:"\u062A\u062E\u0645",\uFDA2:"\u062A\u062E\u0649",\uFDA1:"\u062A\u062E\u0649",\uFC70:"\u062A\u0631",\uFC71:"\u062A\u0632",\uFCA4:"\u062A\u0645",\uFCE3:"\u062A\u0645",\uFC72:"\u062A\u0645",\uFC0E:"\u062A\u0645",\uFD55:"\u062A\u0645\u062C",\uFD56:"\u062A\u0645\u062D",\uFD57:"\u062A\u0645\u062E",\uFDA4:"\u062A\u0645\u0649",\uFDA3:"\u062A\u0645\u0649",\uFC73:"\u062A\u0646",\uFC74:"\u062A\u0649",\uFC0F:"\u062A\u0649",\uFC75:"\u062A\u0649",\uFC10:"\u062A\u0649",\uFB60:"\u067A",\uFB61:"\u067A",\uFB5F:"\u067A",\uFB5E:"\u067A",\uFB64:"\u067F",\uFB65:"\u067F",\uFB63:"\u067F",\uFB62:"\u067F","\u{1EE02}":"\u062C","\u{1EE22}":"\u062C","\u{1EE42}":"\u062C","\u{1EE62}":"\u062C","\u{1EE82}":"\u062C","\u{1EEA2}":"\u062C",\uFE9F:"\u062C",\uFEA0:"\u062C",\uFE9E:"\u062C",\uFE9D:"\u062C",\uFCA7:"\u062C\u062D",\uFC15:"\u062C\u062D",\uFDA6:"\u062C\u062D\u0649",\uFDBE:"\u062C\u062D\u0649",\uFDFB:"\u062C\u0644 \u062C\u0644l\u0644o",\uFCA8:"\u062C\u0645",\uFC16:"\u062C\u0645",\uFD59:"\u062C\u0645\u062D",\uFD58:"\u062C\u0645\u062D",\uFDA7:"\u062C\u0645\u0649",\uFDA5:"\u062C\u0645\u0649",\uFD1D:"\u062C\u0649",\uFD01:"\u062C\u0649",\uFD1E:"\u062C\u0649",\uFD02:"\u062C\u0649",\uFB78:"\u0683",\uFB79:"\u0683",\uFB77:"\u0683",\uFB76:"\u0683",\uFB74:"\u0684",\uFB75:"\u0684",\uFB73:"\u0684",\uFB72:"\u0684",\uFB7C:"\u0686",\uFB7D:"\u0686",\uFB7B:"\u0686",\uFB7A:"\u0686",\uFB80:"\u0687",\uFB81:"\u0687",\uFB7F:"\u0687",\uFB7E:"\u0687","\u{1EE07}":"\u062D","\u{1EE27}":"\u062D","\u{1EE47}":"\u062D","\u{1EE67}":"\u062D","\u{1EE87}":"\u062D","\u{1EEA7}":"\u062D",\uFEA3:"\u062D",\uFEA4:"\u062D",\uFEA2:"\u062D",\uFEA1:"\u062D",\u0685:"\u062D\u06DB",\u0681:"\u062D\u0654","\u0772":"\u062D\u0654",\uFCA9:"\u062D\u062C",\uFC17:"\u062D\u062C",\uFDBF:"\u062D\u062C\u0649",\uFCAA:"\u062D\u0645",\uFC18:"\u062D\u0645",\uFD5B:"\u062D\u0645\u0649",\uFD5A:"\u062D\u0645\u0649",\uFD1B:"\u062D\u0649",\uFCFF:"\u062D\u0649",\uFD1C:"\u062D\u0649",\uFD00:"\u062D\u0649","\u{1EE17}":"\u062E","\u{1EE37}":"\u062E","\u{1EE57}":"\u062E","\u{1EE77}":"\u062E","\u{1EE97}":"\u062E","\u{1EEB7}":"\u062E",\uFEA7:"\u062E",\uFEA8:"\u062E",\uFEA6:"\u062E",\uFEA5:"\u062E",\uFCAB:"\u062E\u062C",\uFC19:"\u062E\u062C",\uFC1A:"\u062E\u062D",\uFCAC:"\u062E\u0645",\uFC1B:"\u062E\u0645",\uFD1F:"\u062E\u0649",\uFD03:"\u062E\u0649",\uFD20:"\u062E\u0649",\uFD04:"\u062E\u0649","\u{102E1}":"\u062F","\u{1EE03}":"\u062F","\u{1EE83}":"\u062F","\u{1EEA3}":"\u062F",\uFEAA:"\u062F",\uFEA9:"\u062F",\u0688:"\u062F\u0615",\uFB89:"\u062F\u0615",\uFB88:"\u062F\u0615",\u068E:"\u062F\u06DB",\uFB87:"\u062F\u06DB",\uFB86:"\u062F\u06DB","\u06EE":"\u062F\u0302","\u08AE":"\u062F\u0324\u0323","\u{1EE18}":"\u0630","\u{1EE98}":"\u0630","\u{1EEB8}":"\u0630",\uFEAC:"\u0630",\uFEAB:"\u0630",\uFC5B:"\u0630\u0670",\u068B:"\u068A\u0615",\uFB85:"\u068C",\uFB84:"\u068C",\uFB83:"\u068D",\uFB82:"\u068D","\u{1EE13}":"\u0631","\u{1EE93}":"\u0631","\u{1EEB3}":"\u0631",\uFEAE:"\u0631",\uFEAD:"\u0631",\u0691:"\u0631\u0615",\uFB8D:"\u0631\u0615",\uFB8C:"\u0631\u0615",\u0698:"\u0631\u06DB",\uFB8B:"\u0631\u06DB",\uFB8A:"\u0631\u06DB",\u0692:"\u0631\u0306","\u08B9":"\u0631\u0306\u0307","\u06EF":"\u0631\u0302","\u076C":"\u0631\u0654",\uFC5C:"\u0631\u0670",\uFDF6:"\u0631\u0633\u0648\u0644","\uFDFC":"\u0631\u0649l\u0644","\u{1EE06}":"\u0632","\u{1EE86}":"\u0632","\u{1EEA6}":"\u0632",\uFEB0:"\u0632",\uFEAF:"\u0632","\u08B2":"\u0632\u0302","\u0771":"\u0697\u0615","\u{1EE0E}":"\u0633","\u{1EE2E}":"\u0633","\u{1EE4E}":"\u0633","\u{1EE6E}":"\u0633","\u{1EE8E}":"\u0633","\u{1EEAE}":"\u0633",\uFEB3:"\u0633",\uFEB4:"\u0633",\uFEB2:"\u0633",\uFEB1:"\u0633",\u0634:"\u0633\u06DB","\u{1EE14}":"\u0633\u06DB","\u{1EE34}":"\u0633\u06DB","\u{1EE54}":"\u0633\u06DB","\u{1EE74}":"\u0633\u06DB","\u{1EE94}":"\u0633\u06DB","\u{1EEB4}":"\u0633\u06DB",\uFEB7:"\u0633\u06DB",\uFEB8:"\u0633\u06DB",\uFEB6:"\u0633\u06DB",\uFEB5:"\u0633\u06DB","\u077E":"\u0633\u0302",\uFD31:"\u0633o",\uFCE8:"\u0633o",\uFD32:"\u0633\u06DBo",\uFCEA:"\u0633\u06DBo",\uFCAD:"\u0633\u062C",\uFD34:"\u0633\u062C",\uFC1C:"\u0633\u062C",\uFD2D:"\u0633\u06DB\u062C",\uFD37:"\u0633\u06DB\u062C",\uFD25:"\u0633\u06DB\u062C",\uFD09:"\u0633\u06DB\u062C",\uFD5D:"\u0633\u062C\u062D",\uFD5E:"\u0633\u062C\u0649",\uFD69:"\u0633\u06DB\u062C\u0649",\uFCAE:"\u0633\u062D",\uFD35:"\u0633\u062D",\uFC1D:"\u0633\u062D",\uFD2E:"\u0633\u06DB\u062D",\uFD38:"\u0633\u06DB\u062D",\uFD26:"\u0633\u06DB\u062D",\uFD0A:"\u0633\u06DB\u062D",\uFD5C:"\u0633\u062D\u062C",\uFD68:"\u0633\u06DB\u062D\u0645",\uFD67:"\u0633\u06DB\u062D\u0645",\uFDAA:"\u0633\u06DB\u062D\u0649",\uFCAF:"\u0633\u062E",\uFD36:"\u0633\u062E",\uFC1E:"\u0633\u062E",\uFD2F:"\u0633\u06DB\u062E",\uFD39:"\u0633\u06DB\u062E",\uFD27:"\u0633\u06DB\u062E",\uFD0B:"\u0633\u06DB\u062E",\uFDA8:"\u0633\u062E\u0649",\uFDC6:"\u0633\u062E\u0649",\uFD2A:"\u0633\u0631",\uFD0E:"\u0633\u0631",\uFD29:"\u0633\u06DB\u0631",\uFD0D:"\u0633\u06DB\u0631",\uFCB0:"\u0633\u0645",\uFCE7:"\u0633\u0645",\uFC1F:"\u0633\u0645",\uFD30:"\u0633\u06DB\u0645",\uFCE9:"\u0633\u06DB\u0645",\uFD28:"\u0633\u06DB\u0645",\uFD0C:"\u0633\u06DB\u0645",\uFD61:"\u0633\u0645\u062C",\uFD60:"\u0633\u0645\u062D",\uFD5F:"\u0633\u0645\u062D",\uFD6B:"\u0633\u06DB\u0645\u062E",\uFD6A:"\u0633\u06DB\u0645\u062E",\uFD63:"\u0633\u0645\u0645",\uFD62:"\u0633\u0645\u0645",\uFD6D:"\u0633\u06DB\u0645\u0645",\uFD6C:"\u0633\u06DB\u0645\u0645",\uFD17:"\u0633\u0649",\uFCFB:"\u0633\u0649",\uFD18:"\u0633\u0649",\uFCFC:"\u0633\u0649",\uFD19:"\u0633\u06DB\u0649",\uFCFD:"\u0633\u06DB\u0649",\uFD1A:"\u0633\u06DB\u0649",\uFCFE:"\u0633\u06DB\u0649","\u{102F2}":"\u0635","\u{1EE11}":"\u0635","\u{1EE31}":"\u0635","\u{1EE51}":"\u0635","\u{1EE71}":"\u0635","\u{1EE91}":"\u0635","\u{1EEB1}":"\u0635",\uFEBB:"\u0635",\uFEBC:"\u0635",\uFEBA:"\u0635",\uFEB9:"\u0635",\u069E:"\u0635\u06DB","\u08AF":"\u0635\u0324\u0323",\uFCB1:"\u0635\u062D",\uFC20:"\u0635\u062D",\uFD65:"\u0635\u062D\u062D",\uFD64:"\u0635\u062D\u062D",\uFDA9:"\u0635\u062D\u0649",\uFCB2:"\u0635\u062E",\uFD2B:"\u0635\u0631",\uFD0F:"\u0635\u0631",\uFDF5:"\u0635\u0644\u0639\u0645",\uFDF9:"\u0635\u0644\u0649",\uFDF0:"\u0635\u0644\u0649",\uFDFA:"\u0635\u0644\u0649 l\u0644\u0644o \u0639\u0644\u0649o \u0648\u0633\u0644\u0645",\uFCB3:"\u0635\u0645",\uFC21:"\u0635\u0645",\uFDC5:"\u0635\u0645\u0645",\uFD66:"\u0635\u0645\u0645",\uFD21:"\u0635\u0649",\uFD05:"\u0635\u0649",\uFD22:"\u0635\u0649",\uFD06:"\u0635\u0649","\u{1EE19}":"\u0636","\u{1EE39}":"\u0636","\u{1EE59}":"\u0636","\u{1EE79}":"\u0636","\u{1EE99}":"\u0636","\u{1EEB9}":"\u0636",\uFEBF:"\u0636",\uFEC0:"\u0636",\uFEBE:"\u0636",\uFEBD:"\u0636",\uFCB4:"\u0636\u062C",\uFC22:"\u0636\u062C",\uFCB5:"\u0636\u062D",\uFC23:"\u0636\u062D",\uFD6E:"\u0636\u062D\u0649",\uFDAB:"\u0636\u062D\u0649",\uFCB6:"\u0636\u062E",\uFC24:"\u0636\u062E",\uFD70:"\u0636\u062E\u0645",\uFD6F:"\u0636\u062E\u0645",\uFD2C:"\u0636\u0631",\uFD10:"\u0636\u0631",\uFCB7:"\u0636\u0645",\uFC25:"\u0636\u0645",\uFD23:"\u0636\u0649",\uFD07:"\u0636\u0649",\uFD24:"\u0636\u0649",\uFD08:"\u0636\u0649","\u{102E8}":"\u0637","\u{1EE08}":"\u0637","\u{1EE68}":"\u0637","\u{1EE88}":"\u0637","\u{1EEA8}":"\u0637",\uFEC3:"\u0637",\uFEC4:"\u0637",\uFEC2:"\u0637",\uFEC1:"\u0637",\u069F:"\u0637\u06DB",\uFCB8:"\u0637\u062D",\uFC26:"\u0637\u062D",\uFD33:"\u0637\u0645",\uFD3A:"\u0637\u0645",\uFC27:"\u0637\u0645",\uFD72:"\u0637\u0645\u062D",\uFD71:"\u0637\u0645\u062D",\uFD73:"\u0637\u0645\u0645",\uFD74:"\u0637\u0645\u0649",\uFD11:"\u0637\u0649",\uFCF5:"\u0637\u0649",\uFD12:"\u0637\u0649",\uFCF6:"\u0637\u0649","\u{1EE1A}":"\u0638","\u{1EE7A}":"\u0638","\u{1EE9A}":"\u0638","\u{1EEBA}":"\u0638",\uFEC7:"\u0638",\uFEC8:"\u0638",\uFEC6:"\u0638",\uFEC5:"\u0638",\uFCB9:"\u0638\u0645",\uFD3B:"\u0638\u0645",\uFC28:"\u0638\u0645","\u060F":"\u0639","\u{1EE0F}":"\u0639","\u{1EE2F}":"\u0639","\u{1EE4F}":"\u0639","\u{1EE6F}":"\u0639","\u{1EE8F}":"\u0639","\u{1EEAF}":"\u0639",\uFECB:"\u0639",\uFECC:"\u0639",\uFECA:"\u0639",\uFEC9:"\u0639",\uFCBA:"\u0639\u062C",\uFC29:"\u0639\u062C",\uFDC4:"\u0639\u062C\u0645",\uFD75:"\u0639\u062C\u0645",\uFDF7:"\u0639\u0644\u0649o",\uFCBB:"\u0639\u0645",\uFC2A:"\u0639\u0645",\uFD77:"\u0639\u0645\u0645",\uFD76:"\u0639\u0645\u0645",\uFD78:"\u0639\u0645\u0649",\uFDB6:"\u0639\u0645\u0649",\uFD13:"\u0639\u0649",\uFCF7:"\u0639\u0649",\uFD14:"\u0639\u0649",\uFCF8:"\u0639\u0649","\u{1EE1B}":"\u063A","\u{1EE3B}":"\u063A","\u{1EE5B}":"\u063A","\u{1EE7B}":"\u063A","\u{1EE9B}":"\u063A","\u{1EEBB}":"\u063A",\uFECF:"\u063A",\uFED0:"\u063A",\uFECE:"\u063A",\uFECD:"\u063A",\uFCBC:"\u063A\u062C",\uFC2B:"\u063A\u062C",\uFCBD:"\u063A\u0645",\uFC2C:"\u063A\u0645",\uFD79:"\u063A\u0645\u0645",\uFD7B:"\u063A\u0645\u0649",\uFD7A:"\u063A\u0645\u0649",\uFD15:"\u063A\u0649",\uFCF9:"\u063A\u0649",\uFD16:"\u063A\u0649",\uFCFA:"\u063A\u0649","\u{1EE10}":"\u0641","\u{1EE30}":"\u0641","\u{1EE70}":"\u0641","\u{1EE90}":"\u0641","\u{1EEB0}":"\u0641",\uFED3:"\u0641",\uFED4:"\u0641",\uFED2:"\u0641",\uFED1:"\u0641",\u06A7:"\u0641",\uFCBE:"\u0641\u062C",\uFC2D:"\u0641\u062C",\uFCBF:"\u0641\u062D",\uFC2E:"\u0641\u062D",\uFCC0:"\u0641\u062E",\uFC2F:"\u0641\u062E",\uFD7D:"\u0641\u062E\u0645",\uFD7C:"\u0641\u062E\u0645",\uFCC1:"\u0641\u0645",\uFC30:"\u0641\u0645",\uFDC1:"\u0641\u0645\u0649",\uFC7C:"\u0641\u0649",\uFC31:"\u0641\u0649",\uFC7D:"\u0641\u0649",\uFC32:"\u0641\u0649","\u{1EE1E}":"\u06A1","\u{1EE7E}":"\u06A1","\u08BB":"\u06A1","\u066F":"\u06A1","\u{1EE1F}":"\u06A1","\u{1EE5F}":"\u06A1","\u08BC":"\u06A1",\u06A4:"\u06A1\u06DB",\uFB6C:"\u06A1\u06DB",\uFB6D:"\u06A1\u06DB",\uFB6B:"\u06A1\u06DB",\uFB6A:"\u06A1\u06DB",\u06A8:"\u06A1\u06DB","\u08A4":"\u06A2\u06DB",\uFB70:"\u06A6",\uFB71:"\u06A6",\uFB6F:"\u06A6",\uFB6E:"\u06A6","\u{1EE12}":"\u0642","\u{1EE32}":"\u0642","\u{1EE52}":"\u0642","\u{1EE72}":"\u0642","\u{1EE92}":"\u0642","\u{1EEB2}":"\u0642",\uFED7:"\u0642",\uFED8:"\u0642",\uFED6:"\u0642",\uFED5:"\u0642",\uFCC2:"\u0642\u062D",\uFC33:"\u0642\u062D",\uFDF1:"\u0642\u0644\u0649",\uFCC3:"\u0642\u0645",\uFC34:"\u0642\u0645",\uFDB4:"\u0642\u0645\u062D",\uFD7E:"\u0642\u0645\u062D",\uFD7F:"\u0642\u0645\u0645",\uFDB2:"\u0642\u0645\u0649",\uFC7E:"\u0642\u0649",\uFC35:"\u0642\u0649",\uFC7F:"\u0642\u0649",\uFC36:"\u0642\u0649","\u{1EE0A}":"\u0643","\u{1EE2A}":"\u0643","\u{1EE6A}":"\u0643",\uFEDB:"\u0643",\uFEDC:"\u0643",\uFEDA:"\u0643",\uFED9:"\u0643",\u06A9:"\u0643",\uFB90:"\u0643",\uFB91:"\u0643",\uFB8F:"\u0643",\uFB8E:"\u0643",\u06AA:"\u0643",\u06AD:"\u0643\u06DB",\uFBD5:"\u0643\u06DB",\uFBD6:"\u0643\u06DB",\uFBD4:"\u0643\u06DB",\uFBD3:"\u0643\u06DB","\u0763":"\u0643\u06DB",\uFC80:"\u0643l",\uFC37:"\u0643l",\uFCC4:"\u0643\u062C",\uFC38:"\u0643\u062C",\uFCC5:"\u0643\u062D",\uFC39:"\u0643\u062D",\uFCC6:"\u0643\u062E",\uFC3A:"\u0643\u062E",\uFCC7:"\u0643\u0644",\uFCEB:"\u0643\u0644",\uFC81:"\u0643\u0644",\uFC3B:"\u0643\u0644",\uFCC8:"\u0643\u0645",\uFCEC:"\u0643\u0645",\uFC82:"\u0643\u0645",\uFC3C:"\u0643\u0645",\uFDC3:"\u0643\u0645\u0645",\uFDBB:"\u0643\u0645\u0645",\uFDB7:"\u0643\u0645\u0649",\uFC83:"\u0643\u0649",\uFC3D:"\u0643\u0649",\uFC84:"\u0643\u0649",\uFC3E:"\u0643\u0649","\u0762":"\u06AC",\uFB94:"\u06AF",\uFB95:"\u06AF",\uFB93:"\u06AF",\uFB92:"\u06AF","\u08B0":"\u06AF",\u06B4:"\u06AF\u06DB",\uFB9C:"\u06B1",\uFB9D:"\u06B1",\uFB9B:"\u06B1",\uFB9A:"\u06B1",\uFB98:"\u06B3",\uFB99:"\u06B3",\uFB97:"\u06B3",\uFB96:"\u06B3","\u{1EE0B}":"\u0644","\u{1EE2B}":"\u0644","\u{1EE4B}":"\u0644","\u{1EE8B}":"\u0644","\u{1EEAB}":"\u0644",\uFEDF:"\u0644",\uFEE0:"\u0644",\uFEDE:"\u0644",\uFEDD:"\u0644",\u06B7:"\u0644\u06DB",\u06B5:"\u0644\u0306",\uFEFC:"\u0644l",\uFEFB:"\u0644l",\uFEFA:"\u0644l\u0655",\uFEF9:"\u0644l\u0655",\uFEF8:"\u0644l\u0674",\uFEF7:"\u0644l\u0674",\uFCCD:"\u0644o",\uFEF6:"\u0644\u0622",\uFEF5:"\u0644\u0622",\uFCC9:"\u0644\u062C",\uFC3F:"\u0644\u062C",\uFD83:"\u0644\u062C\u062C",\uFD84:"\u0644\u062C\u062C",\uFDBA:"\u0644\u062C\u0645",\uFDBC:"\u0644\u062C\u0645",\uFDAC:"\u0644\u062C\u0649",\uFCCA:"\u0644\u062D",\uFC40:"\u0644\u062D",\uFDB5:"\u0644\u062D\u0645",\uFD80:"\u0644\u062D\u0645",\uFD82:"\u0644\u062D\u0649",\uFD81:"\u0644\u062D\u0649",\uFCCB:"\u0644\u062E",\uFC41:"\u0644\u062E",\uFD86:"\u0644\u062E\u0645",\uFD85:"\u0644\u062E\u0645",\uFCCC:"\u0644\u0645",\uFCED:"\u0644\u0645",\uFC85:"\u0644\u0645",\uFC42:"\u0644\u0645",\uFD88:"\u0644\u0645\u062D",\uFD87:"\u0644\u0645\u062D",\uFDAD:"\u0644\u0645\u0649",\uFC86:"\u0644\u0649",\uFC43:"\u0644\u0649",\uFC87:"\u0644\u0649",\uFC44:"\u0644\u0649","\u{1EE0C}":"\u0645","\u{1EE2C}":"\u0645","\u{1EE6C}":"\u0645","\u{1EE8C}":"\u0645","\u{1EEAC}":"\u0645",\uFEE3:"\u0645",\uFEE4:"\u0645",\uFEE2:"\u0645",\uFEE1:"\u0645","\u08A7":"\u0645\u06DB","\u06FE":"\u0645\u0348",\uFC88:"\u0645l",\uFCCE:"\u0645\u062C",\uFC45:"\u0645\u062C",\uFD8C:"\u0645\u062C\u062D",\uFD92:"\u0645\u062C\u062E",\uFD8D:"\u0645\u062C\u0645",\uFDC0:"\u0645\u062C\u0649",\uFCCF:"\u0645\u062D",\uFC46:"\u0645\u062D",\uFD89:"\u0645\u062D\u062C",\uFD8A:"\u0645\u062D\u0645",\uFDF4:"\u0645\u062D\u0645\u062F",\uFD8B:"\u0645\u062D\u0649",\uFCD0:"\u0645\u062E",\uFC47:"\u0645\u062E",\uFD8E:"\u0645\u062E\u062C",\uFD8F:"\u0645\u062E\u0645",\uFDB9:"\u0645\u062E\u0649",\uFCD1:"\u0645\u0645",\uFC89:"\u0645\u0645",\uFC48:"\u0645\u0645",\uFDB1:"\u0645\u0645\u0649",\uFC49:"\u0645\u0649",\uFC4A:"\u0645\u0649","\u{1EE0D}":"\u0646","\u{1EE2D}":"\u0646","\u{1EE4D}":"\u0646","\u{1EE6D}":"\u0646","\u{1EE8D}":"\u0646","\u{1EEAD}":"\u0646",\uFEE7:"\u0646",\uFEE8:"\u0646",\uFEE6:"\u0646",\uFEE5:"\u0646","\u0768":"\u0646\u0615","\u0769":"\u0646\u0306",\uFCD6:"\u0646o",\uFCEF:"\u0646o",\uFDB8:"\u0646\u062C\u062D",\uFDBD:"\u0646\u062C\u062D",\uFD98:"\u0646\u062C\u0645",\uFD97:"\u0646\u062C\u0645",\uFD99:"\u0646\u062C\u0649",\uFDC7:"\u0646\u062C\u0649",\uFCD3:"\u0646\u062D",\uFC4C:"\u0646\u062D",\uFD95:"\u0646\u062D\u0645",\uFD96:"\u0646\u062D\u0649",\uFDB3:"\u0646\u062D\u0649",\uFCD4:"\u0646\u062E",\uFC4D:"\u0646\u062E",\uFC8A:"\u0646\u0631",\uFC8B:"\u0646\u0632",\uFCD5:"\u0646\u0645",\uFCEE:"\u0646\u0645",\uFC8C:"\u0646\u0645",\uFC4E:"\u0646\u0645",\uFD9B:"\u0646\u0645\u0649",\uFD9A:"\u0646\u0645\u0649",\uFC8D:"\u0646\u0646",\uFC8E:"\u0646\u0649",\uFC4F:"\u0646\u0649",\uFC8F:"\u0646\u0649",\uFC50:"\u0646\u0649",\u06C2:"\u06C0",\uFBA5:"\u06C0",\uFBA4:"\u06C0","\u{102E4}":"\u0648","\u{1EE05}":"\u0648","\u{1EE85}":"\u0648","\u{1EEA5}":"\u0648",\uFEEE:"\u0648",\uFEED:"\u0648","\u08B1":"\u0648",\u06CB:"\u0648\u06DB",\uFBDF:"\u0648\u06DB",\uFBDE:"\u0648\u06DB",\u06C7:"\u0648\u0313",\uFBD8:"\u0648\u0313",\uFBD7:"\u0648\u0313",\u06C6:"\u0648\u0306",\uFBDA:"\u0648\u0306",\uFBD9:"\u0648\u0306",\u06C9:"\u0648\u0302",\uFBE3:"\u0648\u0302",\uFBE2:"\u0648\u0302",\u06C8:"\u0648\u0670",\uFBDC:"\u0648\u0670",\uFBDB:"\u0648\u0670",\u0624:"\u0648\u0674",\uFE86:"\u0648\u0674",\uFE85:"\u0648\u0674",\u0676:"\u0648\u0674",\u0677:"\u0648\u0313\u0674",\uFBDD:"\u0648\u0313\u0674",\uFDF8:"\u0648\u0633\u0644\u0645",\uFBE1:"\u06C5",\uFBE0:"\u06C5","\u066E":"\u0649","\u{1EE1C}":"\u0649","\u{1EE7C}":"\u0649",\u06BA:"\u0649","\u{1EE1D}":"\u0649","\u{1EE5D}":"\u0649",\uFB9F:"\u0649",\uFB9E:"\u0649","\u08BD":"\u0649",\uFBE8:"\u0649",\uFBE9:"\u0649",\uFEF0:"\u0649",\uFEEF:"\u0649",\u064A:"\u0649","\u{1EE09}":"\u0649","\u{1EE29}":"\u0649","\u{1EE49}":"\u0649","\u{1EE69}":"\u0649","\u{1EE89}":"\u0649","\u{1EEA9}":"\u0649",\uFEF3:"\u0649",\uFEF4:"\u0649",\uFEF2:"\u0649",\uFEF1:"\u0649",\u06CC:"\u0649",\uFBFE:"\u0649",\uFBFF:"\u0649",\uFBFD:"\u0649",\uFBFC:"\u0649",\u06D2:"\u0649",\uFBAF:"\u0649",\uFBAE:"\u0649",\u0679:"\u0649\u0615",\uFB68:"\u0649\u0615",\uFB69:"\u0649\u0615",\uFB67:"\u0649\u0615",\uFB66:"\u0649\u0615",\u06BB:"\u0649\u0615",\uFBA2:"\u0649\u0615",\uFBA3:"\u0649\u0615",\uFBA1:"\u0649\u0615",\uFBA0:"\u0649\u0615",\u067E:"\u0649\u06DB",\uFB58:"\u0649\u06DB",\uFB59:"\u0649\u06DB",\uFB57:"\u0649\u06DB",\uFB56:"\u0649\u06DB",\u062B:"\u0649\u06DB","\u{1EE16}":"\u0649\u06DB","\u{1EE36}":"\u0649\u06DB","\u{1EE76}":"\u0649\u06DB","\u{1EE96}":"\u0649\u06DB","\u{1EEB6}":"\u0649\u06DB",\uFE9B:"\u0649\u06DB",\uFE9C:"\u0649\u06DB",\uFE9A:"\u0649\u06DB",\uFE99:"\u0649\u06DB",\u06BD:"\u0649\u06DB",\u06D1:"\u0649\u06DB","\u063F":"\u0649\u06DB","\u08B7":"\u0649\u06DB\u06E2","\u0756":"\u0649\u0306",\u06CE:"\u0649\u0306","\u08BA":"\u0649\u0306\u0307","\u063D":"\u0649\u0302","\u08A8":"\u0649\u0654",\uFC90:"\u0649\u0670",\uFC5D:"\u0649\u0670",\uFCDE:"\u0649o",\uFCF1:"\u0649o",\uFCE6:"\u0649\u06DBo",\u0626:"\u0649\u0674",\uFE8B:"\u0649\u0674",\uFE8C:"\u0649\u0674",\uFE8A:"\u0649\u0674",\uFE89:"\u0649\u0674",\u0678:"\u0649\u0674",\uFBEB:"\u0649\u0674l",\uFBEA:"\u0649\u0674l",\uFC9B:"\u0649\u0674o",\uFCE0:"\u0649\u0674o",\uFBED:"\u0649\u0674o",\uFBEC:"\u0649\u0674o",\uFBF8:"\u0649\u0674\u067B",\uFBF7:"\u0649\u0674\u067B",\uFBF6:"\u0649\u0674\u067B",\uFC97:"\u0649\u0674\u062C",\uFC00:"\u0649\u0674\u062C",\uFC98:"\u0649\u0674\u062D",\uFC01:"\u0649\u0674\u062D",\uFC99:"\u0649\u0674\u062E",\uFC64:"\u0649\u0674\u0631",\uFC65:"\u0649\u0674\u0632",\uFC9A:"\u0649\u0674\u0645",\uFCDF:"\u0649\u0674\u0645",\uFC66:"\u0649\u0674\u0645",\uFC02:"\u0649\u0674\u0645",\uFC67:"\u0649\u0674\u0646",\uFBEF:"\u0649\u0674\u0648",\uFBEE:"\u0649\u0674\u0648",\uFBF1:"\u0649\u0674\u0648\u0313",\uFBF0:"\u0649\u0674\u0648\u0313",\uFBF3:"\u0649\u0674\u0648\u0306",\uFBF2:"\u0649\u0674\u0648\u0306",\uFBF5:"\u0649\u0674\u0648\u0670",\uFBF4:"\u0649\u0674\u0648\u0670",\uFBFB:"\u0649\u0674\u0649",\uFBFA:"\u0649\u0674\u0649",\uFC68:"\u0649\u0674\u0649",\uFBF9:"\u0649\u0674\u0649",\uFC03:"\u0649\u0674\u0649",\uFC69:"\u0649\u0674\u0649",\uFC04:"\u0649\u0674\u0649",\uFCDA:"\u0649\u062C",\uFC55:"\u0649\u062C",\uFC11:"\u0649\u06DB\u062C",\uFDAF:"\u0649\u062C\u0649",\uFCDB:"\u0649\u062D",\uFC56:"\u0649\u062D",\uFDAE:"\u0649\u062D\u0649",\uFCDC:"\u0649\u062E",\uFC57:"\u0649\u062E",\uFC91:"\u0649\u0631",\uFC76:"\u0649\u06DB\u0631",\uFC92:"\u0649\u0632",\uFC77:"\u0649\u06DB\u0632",\uFCDD:"\u0649\u0645",\uFCF0:"\u0649\u0645",\uFC93:"\u0649\u0645",\uFC58:"\u0649\u0645",\uFCA6:"\u0649\u06DB\u0645",\uFCE5:"\u0649\u06DB\u0645",\uFC78:"\u0649\u06DB\u0645",\uFC12:"\u0649\u06DB\u0645",\uFD9D:"\u0649\u0645\u0645",\uFD9C:"\u0649\u0645\u0645",\uFDB0:"\u0649\u0645\u0649",\uFC94:"\u0649\u0646",\uFC79:"\u0649\u06DB\u0646",\uFC95:"\u0649\u0649",\uFC59:"\u0649\u0649",\uFC96:"\u0649\u0649",\uFC5A:"\u0649\u0649",\uFC7A:"\u0649\u06DB\u0649",\uFC13:"\u0649\u06DB\u0649",\uFC7B:"\u0649\u06DB\u0649",\uFC14:"\u0649\u06DB\u0649",\uFBB1:"\u06D3",\uFBB0:"\u06D3","\u{102B8}":"\u2D40","\u205E":"\u2D42","\u2E3D":"\u2D42","\u2999":"\u2D42","\uFE19":"\u2D57","\u205D":"\u2D57","\u22EE":"\u2D57",\u0544:"\u1206",\u054C:"\u1261",\u053B:"\u12AE",\u054A:"\u1323",\u0906:"\u0905\u093E",\u0912:"\u0905\u093E\u0946",\u0913:"\u0905\u093E\u0947",\u0914:"\u0905\u093E\u0948","\u0904":"\u0905\u0946",\u0911:"\u0905\u0949",\u090D:"\u090F\u0945",\u090E:"\u090F\u0946",\u0910:"\u090F\u0947",\u0908:"\u0930\u094D\u0907",\u0ABD:"\u093D","\u{111DC}":"\uA8FB","\u{111CB}":"\u093A","\u0AC1":"\u0941","\u0AC2":"\u0942","\u0A4B":"\u0946","\u0A4D":"\u094D","\u0ACD":"\u094D",\u0986:"\u0985\u09BE",\u09E0:"\u098B\u09C3",\u09E1:"\u098B\u09C3","\u{11492}":"\u0998","\u{11494}":"\u099A","\u{11496}":"\u099C","\u{11498}":"\u099E","\u{11499}":"\u099F","\u{1149B}":"\u09A1","\u{114AA}":"\u09A3","\u{1149E}":"\u09A4","\u{1149F}":"\u09A5","\u{114A0}":"\u09A6","\u{114A1}":"\u09A7","\u{114A2}":"\u09A8","\u{114A3}":"\u09AA","\u{114A9}":"\u09AC","\u{114A7}":"\u09AE","\u{114A8}":"\u09AF","\u{114AB}":"\u09B0","\u{1149D}":"\u09B2","\u{114AD}":"\u09B7","\u{114AE}":"\u09B8","\u{114C4}":"\u09BD","\u{114B0}":"\u09BE","\u{114B1}":"\u09BF","\u{114B9}":"\u09C7","\u{114BC}":"\u09CB","\u{114BE}":"\u09CC","\u{114C2}":"\u09CD","\u{114BD}":"\u09D7",\u0A09:"\u0A73\u0A41",\u0A0A:"\u0A73\u0A42",\u0A06:"\u0A05\u0A3E",\u0A10:"\u0A05\u0A48",\u0A14:"\u0A05\u0A4C",\u0A07:"\u0A72\u0A3F",\u0A08:"\u0A72\u0A40",\u0A0F:"\u0A72\u0A47",\u0A86:"\u0A85\u0ABE",\u0A91:"\u0A85\u0ABE\u0AC5",\u0A93:"\u0A85\u0ABE\u0AC7",\u0A94:"\u0A85\u0ABE\u0AC8",\u0A8D:"\u0A85\u0AC5",\u0A8F:"\u0A85\u0AC7",\u0A90:"\u0A85\u0AC8",\u0B06:"\u0B05\u0B3E","\u0BEE":"\u0B85",\u0BB0:"\u0B88","\u0BBE":"\u0B88","\u0BEB":"\u0B88\u0BC1","\u0BE8":"\u0B89",\u0D09:"\u0B89",\u0B8A:"\u0B89\u0BB3",\u0D0A:"\u0B89\u0D57","\u0BED":"\u0B8E","\u0BF7":"\u0B8E\u0BB5",\u0B9C:"\u0B90",\u0D1C:"\u0B90","\u0BE7":"\u0B95","\u0BEA":"\u0B9A","\u0BEC":"\u0B9A\u0BC1","\u0BF2":"\u0B9A\u0BC2","\u0D3A":"\u0B9F\u0BBF",\u0D23:"\u0BA3","\u0BFA":"\u0BA8\u0BC0","\u0BF4":"\u0BAE\u0BC0","\u0BF0":"\u0BAF",\u0D34:"\u0BB4","\u0BD7":"\u0BB3","\u0BC8":"\u0BA9",\u0D36:"\u0BB6","\u0BF8":"\u0BB7","\u0D3F":"\u0BBF","\u0D40":"\u0BBF","\u0BCA":"\u0BC6\u0B88","\u0BCC":"\u0BC6\u0BB3","\u0BCB":"\u0BC7\u0B88",\u0C85:"\u0C05",\u0C86:"\u0C06",\u0C87:"\u0C07",\u0C60:"\u0C0B\u0C3E",\u0C61:"\u0C0C\u0C3E",\u0C92:"\u0C12",\u0C14:"\u0C12\u0C4C",\u0C94:"\u0C12\u0C4C",\u0C13:"\u0C12\u0C55",\u0C93:"\u0C12\u0C55",\u0C9C:"\u0C1C",\u0C9E:"\u0C1E",\u0C22:"\u0C21\u0323",\u0CA3:"\u0C23",\u0C25:"\u0C27\u05BC",\u0C2D:"\u0C2C\u0323",\u0CAF:"\u0C2F",\u0C20:"\u0C30\u05BC",\u0CB1:"\u0C31",\u0CB2:"\u0C32",\u0C37:"\u0C35\u0323",\u0C39:"\u0C35\u0C3E",\u0C2E:"\u0C35\u0C41","\u0C42":"\u0C41\u0C3E","\u0C44":"\u0C43\u0C3E",\u0CE1:"\u0C8C\u0CBE",\u0D08:"\u0D07\u0D57",\u0D10:"\u0D0E\u0D46",\u0D13:"\u0D12\u0D3E",\u0D14:"\u0D12\u0D57",\u0D61:"\u0D1E","\u0D6B":"\u0D26\u0D4D\u0D30","\u0D79":"\u0D28\u0D41",\u0D0C:"\u0D28\u0D41",\u0D19:"\u0D28\u0D41","\u0D6F":"\u0D28\u0D4D","\u0D7B":"\u0D28\u0D4D","\u0D6C":"\u0D28\u0D4D\u0D28","\u0D5A":"\u0D28\u0D4D\u0D2E",\u0D31:"\u0D30","\u0D6A":"\u0D30\u0D4D","\u0D7C":"\u0D30\u0D4D","\u0D6E":"\u0D35\u0D4D\u0D30","\u0D76":"\u0D39\u0D4D\u0D2E","\u0D42":"\u0D41","\u0D43":"\u0D41","\u0D48":"\u0D46\u0D46","\u0DEA":"\u0DA2","\u0DEB":"\u0DAF","\u{11413}":"\u{11434}\u{11442}\u{11412}","\u{11419}":"\u{11434}\u{11442}\u{11418}","\u{11424}":"\u{11434}\u{11442}\u{11423}","\u{1142A}":"\u{11434}\u{11442}\u{11429}","\u{1142D}":"\u{11434}\u{11442}\u{1142C}","\u{1142F}":"\u{11434}\u{11442}\u{1142E}","\u{115D8}":"\u{11582}","\u{115D9}":"\u{11582}","\u{115DA}":"\u{11583}","\u{115DB}":"\u{11584}","\u{115DC}":"\u{115B2}","\u{115DD}":"\u{115B3}",\u0E03:"\u0E02",\u0E14:"\u0E04",\u0E15:"\u0E04",\u0E21:"\u0E06",\u0E88:"\u0E08",\u0E0B:"\u0E0A",\u0E0F:"\u0E0E",\u0E17:"\u0E11",\u0E9A:"\u0E1A",\u0E9B:"\u0E1B",\u0E9D:"\u0E1D",\u0E9E:"\u0E1E",\u0E9F:"\u0E1F",\u0E26:"\u0E20",\u0E8D:"\u0E22","\u17D4":"\u0E2F",\u0E45:"\u0E32",\u0E33:"\u030A\u0E32","\u17B7":"\u0E34","\u17B8":"\u0E35","\u17B9":"\u0E36","\u17BA":"\u0E37","\u0EB8":"\u0E38","\u0EB9":"\u0E39",\u0E41:"\u0E40\u0E40",\u0EDC:"\u0EAB\u0E99",\u0EDD:"\u0EAB\u0EA1",\u0EB3:"\u030A\u0EB2","\u0F02":"\u0F60\u0F74\u0F82\u0F7F","\u0F03":"\u0F60\u0F74\u0F82\u0F14",\u0F6A:"\u0F62",\u0F00:"\u0F68\u0F7C\u0F7E","\u0F77":"\u0FB2\u0F71\u0F80","\u0F79":"\u0FB3\u0F71\u0F80","\u{11CB2}":"\u{11CAA}","\u1081":"\u1002\u103E",\u1000:"\u1002\u102C","\u1070":"\u1003\u103E","\u1066":"\u1015\u103E",\u101F:"\u1015\u102C","\u106F":"\u1015\u102C\u103E","\u107E":"\u107D\u103E",\u1029:"\u101E\u103C",\u102A:"\u101E\u103C\u1031\u102C\u103A","\u109E":"\u1083\u030A",\u17A3:"\u17A2","\u19D0":"\u199E","\u19D1":"\u19B1","\u1A80":"\u1A45","\u1A90":"\u1A45","\uAA53":"\uAA01","\uAA56":"\uAA23","\u1B52":"\u1B0D","\u1B53":"\u1B11","\u1B58":"\u1B28","\uA9A3":"\uA99D",\u1896:"\u185C",\u1855:"\u1835",\u1FF6:"\u13EF",\u140D:"\u1401\xB7",\u142B:"\u1401\u1420",\u1411:"\u1404\xB7",\u1413:"\u1405\xB7",\u142D:"\u1405\u1420",\u1415:"\u1406\xB7",\u1418:"\u140A\xB7",\u142E:"\u140A\u1420",\u141A:"\u140B\xB7","\u18DD":"\u141E\u18DF",\u14D1:"\u1421",\u1540:"\u1429",\u143F:"\u1432\xB7",\u1443:"\u1434\xB7","\u2369":"\u1435",\u1447:"\u1439\xB7",\u145C:"\u144F\xB7","\u2E27":"\u1450","\u2283":"\u1450",\u145E:"\u1450\xB7",\u1469:"\u1450'","\u27C9":"\u1450/","\u2AD7":"\u1450\u1455",\u1460:"\u1451\xB7","\u2E26":"\u1455","\u2282":"\u1455",\u1462:"\u1455\xB7",\u146A:"\u1455'",\u1464:"\u1456\xB7",\u1475:"\u146B\xB7",\u1485:"\u146B'",\u1479:"\u146E\xB7",\u147D:"\u1470\xB7",\u1603:"\u1489",\u1493:"\u1489\xB7",\u1495:"\u148B\xB7",\u1497:"\u148C\xB7",\u149B:"\u148E\xB7",\u1602:"\u1490",\u149D:"\u1490\xB7",\u149F:"\u1491\xB7",\u14AD:"\u14A3\xB7",\u14B1:"\u14A6\xB7",\u14B3:"\u14A7\xB7",\u14B5:"\u14A8\xB7",\u14B9:"\u14AB\xB7",\u14CA:"\u14C0\xB7","\u18C7":"\u14C2\xB7","\u18C9":"\u14C3\xB7","\u18CB":"\u14C4\xB7","\u18CD":"\u14C5\xB7",\u14CC:"\u14C7\xB7",\u14CE:"\u14C8\xB7",\u1604:"\u14D3",\u14DD:"\u14D3\xB7",\u14DF:"\u14D5\xB7",\u14E1:"\u14D6\xB7",\u14E3:"\u14D7\xB7",\u14E5:"\u14D8\xB7",\u1607:"\u14DA",\u14E7:"\u14DA\xB7",\u14E9:"\u14DB\xB7",\u14F7:"\u14ED\xB7",\u14F9:"\u14EF\xB7",\u14FB:"\u14F0\xB7",\u14FD:"\u14F1\xB7",\u14FF:"\u14F2\xB7",\u1501:"\u14F4\xB7",\u1503:"\u14F5\xB7",\u150C:"\u150B<",\u150E:"\u150Bb",\u150D:"\u150B\u1455",\u150F:"\u150B\u1490",\u1518:"\u1510\xB7",\u151A:"\u1511\xB7",\u151C:"\u1512\xB7",\u151E:"\u1513\xB7",\u1520:"\u1514\xB7",\u1522:"\u1515\xB7",\u1524:"\u1516\xB7",\u1532:"\u1528\xB7",\u1534:"\u1529\xB7",\u1536:"\u152A\xB7",\u1538:"\u152B\xB7",\u153A:"\u152D\xB7",\u153C:"\u152E\xB7",\u1622:"\u1543","\u18E0":"\u1543\xB7",\u1623:"\u1546",\u1624:"\u154A",\u154F:"\u154C\xB7",\u1583:"\u1550b",\u1584:"\u1550b\u0307",\u1581:"\u1550d",\u157F:"\u1550P",\u166F:"\u1550\u146B",\u157E:"\u1550\u146C",\u1580:"\u1550\u146E",\u1582:"\u1550\u1470",\u1585:"\u1550\u1483",\u155C:"\u155A\xB7","\u18E3":"\u155E\xB7","\u18E4":"\u1566\xB7",\u1569:"\u1567\xB7","\u18E5":"\u156B\xB7","\u18E8":"\u1586\xB7",\u1591:"\u1595J",\u1670:"\u1595\u1489",\u158E:"\u1595\u148A",\u158F:"\u1595\u148B",\u1590:"\u1595\u148C",\u1592:"\u1595\u148E",\u1593:"\u1595\u1490",\u1594:"\u1595\u1491",\u1673:"\u1596J",\u1671:"\u1596\u148B",\u1672:"\u1596\u148C",\u1674:"\u1596\u148E",\u1675:"\u1596\u1490",\u1676:"\u1596\u1491","\u18EA":"\u1597\xB7","\u1677":"\u15A7\xB7","\u1678":"\u15A8\xB7","\u1679":"\u15A9\xB7","\u167A":"\u15AA\xB7","\u167B":"\u15AB\xB7","\u167C":"\u15AC\xB7","\u167D":"\u15AD\xB7","\u2AAB":"\u15D2","\u2AAA":"\u15D5","\uA4F7":"\u15E1","\u18F0":"\u15F4\xB7","\u18F2":"\u161B\xB7","\u1DBB":"\u1646","\uA4ED":"\u1660","\u1DBA":"\u18D4","\u1D3E":"\u18D6","\u18DC":"\u18DF\u141E",\u02E1:"\u18F3",\u02B3:"\u18F4",\u02E2:"\u18F5","\u18DB":"\u18F5","\uA6B0":"\u16B9",\u16E1:"\u16BC","\u237F":"\u16BD",\u16C2:"\u16BD","\u{1D23F}":"\u16CB","\u2191":"\u16CF","\u21BF":"\u16D0","\u296E":"\u16D0\u21C2","\u2963":"\u16D0\u16DA","\u2D63":"\u16EF","\u21BE":"\u16DA","\u2A21":"\u16DA","\u22C4":"\u16DC","\u25C7":"\u16DC","\u25CA":"\u16DC","\u2662":"\u16DC","\u{1F754}":"\u16DC","\u{118B7}":"\u16DC","\u{10294}":"\u16DC","\u235A":"\u16DC\u0332","\u22C8":"\u16DE","\u2A1D":"\u16DE","\u{104D0}":"\u16E6","\u2195":"\u16E8","\u{10CFC}":"\u{10C82}","\u{10CFA}":"\u{10CA5}",\u3131:"\u1100",\u11A8:"\u1100",\u1101:"\u1100\u1100",\u3132:"\u1100\u1100",\u11A9:"\u1100\u1100","\u11FA":"\u1100\u1102","\u115A":"\u1100\u1103",\u11C3:"\u1100\u1105","\u11FB":"\u1100\u1107",\u11AA:"\u1100\u1109",\u3133:"\u1100\u1109",\u11C4:"\u1100\u1109\u1100","\u11FC":"\u1100\u110E","\u11FD":"\u1100\u110F","\u11FE":"\u1100\u1112",\u3134:"\u1102",\u11AB:"\u1102",\u1113:"\u1102\u1100",\u11C5:"\u1102\u1100",\u1114:"\u1102\u1102",\u3165:"\u1102\u1102","\u11FF":"\u1102\u1102",\u1115:"\u1102\u1103",\u3166:"\u1102\u1103",\u11C6:"\u1102\u1103","\uD7CB":"\u1102\u1105",\u1116:"\u1102\u1107","\u115B":"\u1102\u1109",\u11C7:"\u1102\u1109",\u3167:"\u1102\u1109","\u115C":"\u1102\u110C",\u11AC:"\u1102\u110C",\u3135:"\u1102\u110C","\uD7CC":"\u1102\u110E",\u11C9:"\u1102\u1110","\u115D":"\u1102\u1112",\u11AD:"\u1102\u1112",\u3136:"\u1102\u1112",\u11C8:"\u1102\u1140",\u3168:"\u1102\u1140",\u3137:"\u1103",\u11AE:"\u1103",\u1117:"\u1103\u1100",\u11CA:"\u1103\u1100",\u1104:"\u1103\u1103",\u3138:"\u1103\u1103","\uD7CD":"\u1103\u1103","\uD7CE":"\u1103\u1103\u1107","\u115E":"\u1103\u1105",\u11CB:"\u1103\u1105","\uA960":"\u1103\u1106","\uA961":"\u1103\u1107","\uD7CF":"\u1103\u1107","\uA962":"\u1103\u1109","\uD7D0":"\u1103\u1109","\uD7D1":"\u1103\u1109\u1100","\uA963":"\u1103\u110C","\uD7D2":"\u1103\u110C","\uD7D3":"\u1103\u110E","\uD7D4":"\u1103\u1110",\u3139:"\u1105",\u11AF:"\u1105","\uA964":"\u1105\u1100",\u11B0:"\u1105\u1100",\u313A:"\u1105\u1100","\uA965":"\u1105\u1100\u1100","\uD7D5":"\u1105\u1100\u1100",\u11CC:"\u1105\u1100\u1109",\u3169:"\u1105\u1100\u1109","\uD7D6":"\u1105\u1100\u1112",\u1118:"\u1105\u1102",\u11CD:"\u1105\u1102","\uA966":"\u1105\u1103",\u11CE:"\u1105\u1103",\u316A:"\u1105\u1103","\uA967":"\u1105\u1103\u1103",\u11CF:"\u1105\u1103\u1112",\u1119:"\u1105\u1105",\u11D0:"\u1105\u1105","\uD7D7":"\u1105\u1105\u110F","\uA968":"\u1105\u1106",\u11B1:"\u1105\u1106",\u313B:"\u1105\u1106",\u11D1:"\u1105\u1106\u1100",\u11D2:"\u1105\u1106\u1109","\uD7D8":"\u1105\u1106\u1112","\uA969":"\u1105\u1107",\u11B2:"\u1105\u1107",\u313C:"\u1105\u1107","\uD7D9":"\u1105\u1107\u1103","\uA96A":"\u1105\u1107\u1107",\u11D3:"\u1105\u1107\u1109",\u316B:"\u1105\u1107\u1109","\uA96B":"\u1105\u1107\u110B",\u11D5:"\u1105\u1107\u110B","\uD7DA":"\u1105\u1107\u1111",\u11D4:"\u1105\u1107\u1112","\uA96C":"\u1105\u1109",\u11B3:"\u1105\u1109",\u313D:"\u1105\u1109",\u11D6:"\u1105\u1109\u1109",\u111B:"\u1105\u110B","\uD7DD":"\u1105\u110B","\uA96D":"\u1105\u110C","\uA96E":"\u1105\u110F",\u11D8:"\u1105\u110F",\u11B4:"\u1105\u1110",\u313E:"\u1105\u1110",\u11B5:"\u1105\u1111",\u313F:"\u1105\u1111",\u111A:"\u1105\u1112",\u3140:"\u1105\u1112",\u113B:"\u1105\u1112",\u11B6:"\u1105\u1112","\uD7F2":"\u1105\u1112",\u11D7:"\u1105\u1140",\u316C:"\u1105\u1140","\uD7DB":"\u1105\u114C",\u11D9:"\u1105\u1159",\u316D:"\u1105\u1159","\uD7DC":"\u1105\u1159\u1112",\u3141:"\u1106",\u11B7:"\u1106","\uA96F":"\u1106\u1100",\u11DA:"\u1106\u1100","\uD7DE":"\u1106\u1102","\uD7DF":"\u1106\u1102\u1102","\uA970":"\u1106\u1103",\u11DB:"\u1106\u1105","\uD7E0":"\u1106\u1106",\u111C:"\u1106\u1107",\u316E:"\u1106\u1107",\u11DC:"\u1106\u1107","\uD7E1":"\u1106\u1107\u1109","\uA971":"\u1106\u1109",\u11DD:"\u1106\u1109",\u316F:"\u1106\u1109",\u11DE:"\u1106\u1109\u1109",\u111D:"\u1106\u110B",\u3171:"\u1106\u110B",\u11E2:"\u1106\u110B","\uD7E2":"\u1106\u110C",\u11E0:"\u1106\u110E",\u11E1:"\u1106\u1112",\u11DF:"\u1106\u1140",\u3170:"\u1106\u1140",\u3142:"\u1107",\u11B8:"\u1107",\u111E:"\u1107\u1100",\u3172:"\u1107\u1100",\u111F:"\u1107\u1102",\u1120:"\u1107\u1103",\u3173:"\u1107\u1103","\uD7E3":"\u1107\u1103",\u11E3:"\u1107\u1105","\uD7E4":"\u1107\u1105\u1111","\uD7E5":"\u1107\u1106",\u1108:"\u1107\u1107",\u3143:"\u1107\u1107","\uD7E6":"\u1107\u1107",\u112C:"\u1107\u1107\u110B",\u3179:"\u1107\u1107\u110B",\u1121:"\u1107\u1109",\u3144:"\u1107\u1109",\u11B9:"\u1107\u1109",\u1122:"\u1107\u1109\u1100",\u3174:"\u1107\u1109\u1100",\u1123:"\u1107\u1109\u1103",\u3175:"\u1107\u1109\u1103","\uD7E7":"\u1107\u1109\u1103",\u1124:"\u1107\u1109\u1107",\u1125:"\u1107\u1109\u1109",\u1126:"\u1107\u1109\u110C","\uA972":"\u1107\u1109\u1110",\u112B:"\u1107\u110B",\u3178:"\u1107\u110B",\u11E6:"\u1107\u110B",\u1127:"\u1107\u110C",\u3176:"\u1107\u110C","\uD7E8":"\u1107\u110C",\u1128:"\u1107\u110E","\uD7E9":"\u1107\u110E","\uA973":"\u1107\u110F",\u1129:"\u1107\u1110",\u3177:"\u1107\u1110",\u112A:"\u1107\u1111",\u11E4:"\u1107\u1111","\uA974":"\u1107\u1112",\u11E5:"\u1107\u1112",\u3145:"\u1109",\u11BA:"\u1109",\u112D:"\u1109\u1100",\u317A:"\u1109\u1100",\u11E7:"\u1109\u1100",\u112E:"\u1109\u1102",\u317B:"\u1109\u1102",\u112F:"\u1109\u1103",\u317C:"\u1109\u1103",\u11E8:"\u1109\u1103",\u1130:"\u1109\u1105",\u11E9:"\u1109\u1105",\u1131:"\u1109\u1106","\uD7EA":"\u1109\u1106",\u1132:"\u1109\u1107",\u317D:"\u1109\u1107",\u11EA:"\u1109\u1107",\u1133:"\u1109\u1107\u1100","\uD7EB":"\u1109\u1107\u110B",\u110A:"\u1109\u1109",\u3146:"\u1109\u1109",\u11BB:"\u1109\u1109","\uD7EC":"\u1109\u1109\u1100","\uD7ED":"\u1109\u1109\u1103","\uA975":"\u1109\u1109\u1107",\u1134:"\u1109\u1109\u1109",\u1135:"\u1109\u110B",\u1136:"\u1109\u110C",\u317E:"\u1109\u110C","\uD7EF":"\u1109\u110C",\u1137:"\u1109\u110E","\uD7F0":"\u1109\u110E",\u1138:"\u1109\u110F",\u1139:"\u1109\u1110","\uD7F1":"\u1109\u1110",\u113A:"\u1109\u1111","\uD7EE":"\u1109\u1140",\u3147:"\u110B",\u11BC:"\u110B",\u1141:"\u110B\u1100",\u11EC:"\u110B\u1100",\u11ED:"\u110B\u1100\u1100",\u1142:"\u110B\u1103","\uA976":"\u110B\u1105",\u1143:"\u110B\u1106",\u1144:"\u110B\u1107",\u1145:"\u110B\u1109",\u11F1:"\u110B\u1109",\u3182:"\u110B\u1109",\u1147:"\u110B\u110B",\u3180:"\u110B\u110B",\u11EE:"\u110B\u110B",\u1148:"\u110B\u110C",\u1149:"\u110B\u110E",\u11EF:"\u110B\u110F",\u114A:"\u110B\u1110",\u114B:"\u110B\u1111","\uA977":"\u110B\u1112",\u1146:"\u110B\u1140",\u11F2:"\u110B\u1140",\u3183:"\u110B\u1140",\u3148:"\u110C",\u11BD:"\u110C","\uD7F7":"\u110C\u1107","\uD7F8":"\u110C\u1107\u1107",\u114D:"\u110C\u110B",\u110D:"\u110C\u110C",\u3149:"\u110C\u110C","\uD7F9":"\u110C\u110C","\uA978":"\u110C\u110C\u1112",\u314A:"\u110E",\u11BE:"\u110E",\u1152:"\u110E\u110F",\u1153:"\u110E\u1112",\u314B:"\u110F",\u11BF:"\u110F",\u314C:"\u1110",\u11C0:"\u1110","\uA979":"\u1110\u1110",\u314D:"\u1111",\u11C1:"\u1111",\u1156:"\u1111\u1107",\u11F3:"\u1111\u1107","\uD7FA":"\u1111\u1109",\u1157:"\u1111\u110B",\u3184:"\u1111\u110B",\u11F4:"\u1111\u110B","\uD7FB":"\u1111\u1110","\uA97A":"\u1111\u1112",\u314E:"\u1112",\u11C2:"\u1112",\u11F5:"\u1112\u1102",\u11F6:"\u1112\u1105",\u11F7:"\u1112\u1106",\u11F8:"\u1112\u1107","\uA97B":"\u1112\u1109",\u1158:"\u1112\u1112",\u3185:"\u1112\u1112",\u113D:"\u113C\u113C",\u113F:"\u113E\u113E",\u317F:"\u1140",\u11EB:"\u1140","\uD7F3":"\u1140\u1107","\uD7F4":"\u1140\u1107\u110B",\u3181:"\u114C",\u11F0:"\u114C","\uD7F5":"\u114C\u1106","\uD7F6":"\u114C\u1112",\u114F:"\u114E\u114E",\u1151:"\u1150\u1150",\u3186:"\u1159",\u11F9:"\u1159","\uA97C":"\u1159\u1159",\u3164:"\u1160",\u314F:"\u1161","\u11A3":"\u1161\u30FC",\u1176:"\u1161\u1169",\u1177:"\u1161\u116E",\u1162:"\u1161\u4E28",\u3150:"\u1161\u4E28",\u3151:"\u1163",\u1178:"\u1163\u1169",\u1179:"\u1163\u116D","\u11A4":"\u1163\u116E",\u1164:"\u1163\u4E28",\u3152:"\u1163\u4E28",\u3153:"\u1165",\u117C:"\u1165\u30FC",\u117A:"\u1165\u1169",\u117B:"\u1165\u116E",\u1166:"\u1165\u4E28",\u3154:"\u1165\u4E28",\u3155:"\u1167","\u11A5":"\u1167\u1163",\u117D:"\u1167\u1169",\u117E:"\u1167\u116E",\u1168:"\u1167\u4E28",\u3156:"\u1167\u4E28",\u3157:"\u1169",\u116A:"\u1169\u1161",\u3158:"\u1169\u1161",\u116B:"\u1169\u1161\u4E28",\u3159:"\u1169\u1161\u4E28","\u11A6":"\u1169\u1163","\u11A7":"\u1169\u1163\u4E28",\u117F:"\u1169\u1165",\u1180:"\u1169\u1165\u4E28","\uD7B0":"\u1169\u1167",\u1181:"\u1169\u1167\u4E28",\u1182:"\u1169\u1169","\uD7B1":"\u1169\u1169\u4E28",\u1183:"\u1169\u116E",\u116C:"\u1169\u4E28",\u315A:"\u1169\u4E28",\u315B:"\u116D","\uD7B2":"\u116D\u1161","\uD7B3":"\u116D\u1161\u4E28",\u1184:"\u116D\u1163",\u3187:"\u116D\u1163",\u1186:"\u116D\u1163",\u1185:"\u116D\u1163\u4E28",\u3188:"\u116D\u1163\u4E28","\uD7B4":"\u116D\u1165",\u1187:"\u116D\u1169",\u1188:"\u116D\u4E28",\u3189:"\u116D\u4E28",\u315C:"\u116E",\u1189:"\u116E\u1161",\u118A:"\u116E\u1161\u4E28",\u116F:"\u116E\u1165",\u315D:"\u116E\u1165",\u118B:"\u116E\u1165\u30FC",\u1170:"\u116E\u1165\u4E28",\u315E:"\u116E\u1165\u4E28","\uD7B5":"\u116E\u1167",\u118C:"\u116E\u1167\u4E28",\u118D:"\u116E\u116E",\u1171:"\u116E\u4E28",\u315F:"\u116E\u4E28","\uD7B6":"\u116E\u4E28\u4E28",\u3160:"\u1172",\u118E:"\u1172\u1161","\uD7B7":"\u1172\u1161\u4E28",\u118F:"\u1172\u1165",\u1190:"\u1172\u1165\u4E28",\u1191:"\u1172\u1167",\u318A:"\u1172\u1167",\u1192:"\u1172\u1167\u4E28",\u318B:"\u1172\u1167\u4E28","\uD7B8":"\u1172\u1169",\u1193:"\u1172\u116E",\u1194:"\u1172\u4E28",\u318C:"\u1172\u4E28",\u318D:"\u119E","\uD7C5":"\u119E\u1161",\u119F:"\u119E\u1165","\uD7C6":"\u119E\u1165\u4E28",\u11A0:"\u119E\u116E",\u11A2:"\u119E\u119E",\u11A1:"\u119E\u4E28",\u318E:"\u119E\u4E28",\u30D8:"\u3078","\u2341":"\u303C","\u29C4":"\u303C","\uA49E":"\uA04A","\uA4AC":"\uA050","\uA49C":"\uA0C0","\uA4A8":"\uA132","\uA4BF":"\uA259","\uA4BE":"\uA2B1","\uA494":"\uA2CD","\uA4C0":"\uA3AB","\uA4C2":"\uA3B5","\uA4BA":"\uA3BF","\uA4B0":"\uA3C2","\uA4A7":"\uA458","\u22A5":"\uA4D5","\u27C2":"\uA4D5","\u{1D21C}":"\uA4D5","\uA7B1":"\uA4D5","\uA79E":"\uA4E4","\u2141":"\uA4E8","\u2142":"\uA4F6","\u{1D215}":"\uA4F6","\u{1D22B}":"\uA4F6","\u{16F26}":"\uA4F6","\u{10411}":"\uA4F6","\u2143":"\u{16F00}","\u{11AE6}":"\u{11AE5}\u{11AEF}","\u{11AE8}":"\u{11AE5}\u{11AE5}","\u{11AE9}":"\u{11AE5}\u{11AE5}\u{11AEF}","\u{11AEA}":"\u{11AE5}\u{11AE5}\u{11AF0}","\u{11AE7}":"\u{11AE5}\u{11AF0}","\u{11AF4}":"\u{11AF3}\u{11AEF}","\u{11AF6}":"\u{11AF3}\u{11AF3}","\u{11AF7}":"\u{11AF3}\u{11AF3}\u{11AEF}","\u{11AF8}":"\u{11AF3}\u{11AF3}\u{11AF0}","\u{11AF5}":"\u{11AF3}\u{11AF0}","\u{11AEC}":"\u{11AEB}\u{11AEF}","\u{11AED}":"\u{11AEB}\u{11AEB}","\u{11AEE}":"\u{11AEB}\u{11AEB}\u{11AEF}","\u2295":"\u{102A8}","\u2A01":"\u{102A8}","\u{1F728}":"\u{102A8}","\uA69A":"\u{102A8}","\u25BD":"\u{102BC}","\u{1D214}":"\u{102BC}","\u{1F704}":"\u{102BC}","\u29D6":"\u{102C0}","\uA79B":"\u{1043A}","\uA79A":"\u{10412}","\u{104A0}":"\u{10486}","\u{103D1}":"\u{10382}","\u{103D3}":"\u{10393}","\u{12038}":"\u{1039A}","\u2625":"\u{1099E}","\u{132F9}":"\u{1099E}","\u3039":"\u5344",\uF967:"\u4E0D","\u{2F800}":"\u4E3D","\uFA70":"\u4E26","\u239C":"\u4E28","\u239F":"\u4E28","\u23A2":"\u4E28","\u23A5":"\u4E28","\u23AA":"\u4E28","\u23AE":"\u4E28","\u31D1":"\u4E28",\u1175:"\u4E28",\u3163:"\u4E28","\u2F01":"\u4E28",\u119C:"\u4E28\u30FC",\u1198:"\u4E28\u1161",\u1199:"\u4E28\u1163","\uD7BD":"\u4E28\u1163\u1169","\uD7BE":"\u4E28\u1163\u4E28","\uD7BF":"\u4E28\u1167","\uD7C0":"\u4E28\u1167\u4E28",\u119A:"\u4E28\u1169","\uD7C1":"\u4E28\u1169\u4E28","\uD7C2":"\u4E28\u116D",\u119B:"\u4E28\u116E","\uD7C3":"\u4E28\u1172",\u119D:"\u4E28\u119E","\uD7C4":"\u4E28\u4E28",\uF905:"\u4E32","\u{2F801}":"\u4E38",\uF95E:"\u4E39","\u{2F802}":"\u4E41","\u31E0":"\u4E59","\u2F04":"\u4E59","\u31DF":"\u4E5A","\u2E83":"\u4E5A","\u31D6":"\u4E5B","\u2E82":"\u4E5B","\u2EF2":"\u4E80",\uF91B:"\u4E82","\u31DA":"\u4E85","\u2F05":"\u4E85",\uF9BA:"\u4E86",\u30CB:"\u4E8C","\u2F06":"\u4E8C","\u{2F803}":"\u{20122}","\u2F07":"\u4EA0",\uF977:"\u4EAE","\u2F08":"\u4EBA",\u30A4:"\u4EBB","\u2E85":"\u4EBB",\uF9FD:"\u4EC0","\u{2F819}":"\u4ECC",\uF9A8:"\u4EE4","\u{2F804}":"\u4F60",\u5002:"\u4F75","\u{2F807}":"\u4F75","\uFA73":"\u4F80",\uF92D:"\u4F86",\uF9B5:"\u4F8B","\uFA30":"\u4FAE","\u{2F805}":"\u4FAE","\u{2F806}":"\u4FBB",\uF965:"\u4FBF",\u503C:"\u5024",\uF9D4:"\u502B","\u{2F808}":"\u507A","\u{2F809}":"\u5099","\u{2F80B}":"\u50CF",\uF9BB:"\u50DA","\uFA31":"\u50E7","\u{2F80A}":"\u50E7","\u{2F80C}":"\u349E","\u2F09":"\u513F",\uFA0C:"\u5140","\u2E8E":"\u5140","\uFA74":"\u5145","\uFA32":"\u514D","\u{2F80E}":"\u514D","\u{2F80F}":"\u5154","\u{2F810}":"\u5164","\u2F0A":"\u5165","\u{2F814}":"\u5167","\uFA72":"\u5168",\uF978:"\u5169",\u30CF:"\u516B","\u2F0B":"\u516B",\uF9D1:"\u516D","\u{2F811}":"\u5177","\u{2F812}":"\u{2051C}","\u{2F91B}":"\u{20525}","\uFA75":"\u5180","\u{2F813}":"\u34B9","\u2F0C":"\u5182","\u{2F815}":"\u518D","\u{2F816}":"\u{2054B}","\u{2F8D2}":"\u5192","\u{2F8D3}":"\u5195","\u{2F9CA}":"\u34BB","\u{2F8D4}":"\u6700","\u2F0D":"\u5196","\u{2F817}":"\u5197","\u{2F818}":"\u51A4","\u2F0E":"\u51AB","\u{2F81A}":"\u51AC","\uFA71":"\u51B5","\u{2F81B}":"\u51B5",\uF92E:"\u51B7",\uF979:"\u51C9",\uF955:"\u51CC",\uF954:"\u51DC",\uFA15:"\u51DE","\u2F0F":"\u51E0","\u{2F80D}":"\u{2063A}","\u{2F81D}":"\u51F5","\u2F10":"\u51F5","\u2F11":"\u5200","\u2E89":"\u5202","\u{2F81E}":"\u5203",\uFA00:"\u5207","\u{2F850}":"\u5207",\uF99C:"\u5217",\uF9DD:"\u5229","\u{2F81F}":"\u34DF",\uF9FF:"\u523A","\u{2F820}":"\u523B","\u{2F821}":"\u5246","\u{2F822}":"\u5272","\u{2F823}":"\u5277",\uF9C7:"\u5289","\u{2F9D9}":"\u{20804}",\u30AB:"\u529B",\uF98A:"\u529B","\u2F12":"\u529B",\uF99D:"\u52A3","\u{2F824}":"\u3515","\u{2F992}":"\u52B3","\uFA76":"\u52C7","\u{2F825}":"\u52C7","\uFA33":"\u52C9","\u{2F826}":"\u52C9",\uF952:"\u52D2",\uF92F:"\u52DE","\uFA34":"\u52E4","\u{2F827}":"\u52E4",\uF97F:"\u52F5","\u2F13":"\u52F9","\uFA77":"\u52FA","\u{2F828}":"\u52FA","\u{2F829}":"\u5305","\u{2F82A}":"\u5306","\u{2F9DD}":"\u{208DE}","\u2F14":"\u5315",\uF963:"\u5317","\u{2F82B}":"\u5317","\u2F15":"\u531A","\u2F16":"\u5338",\uF9EB:"\u533F","\u2F17":"\u5341","\u3038":"\u5341","\u303A":"\u5345","\u{2F82C}":"\u5349","\u0FD6":"\u534D","\u0FD5":"\u5350","\uFA35":"\u5351","\u{2F82D}":"\u5351","\u{2F82E}":"\u535A",\u30C8:"\u535C","\u2F18":"\u535C","\u2F19":"\u5369","\u2E8B":"\u353E","\u{2F82F}":"\u5373",\uF91C:"\u5375","\u{2F830}":"\u537D","\u{2F831}":"\u537F","\u{2F832}":"\u537F","\u{2F833}":"\u537F","\u2F1A":"\u5382","\u{2F834}":"\u{20A2C}","\u2F1B":"\u53B6",\uF96B:"\u53C3","\u2F1C":"\u53C8","\u{2F836}":"\u53CA","\u{2F837}":"\u53DF","\u{2F838}":"\u{20B63}",\u30ED:"\u53E3","\u2F1D":"\u53E3",\u56D7:"\u53E3","\u2F1E":"\u53E3",\uF906:"\u53E5","\u{2F839}":"\u53EB","\u{2F83A}":"\u53F1","\u{2F83B}":"\u5406",\uF9DE:"\u540F",\uF9ED:"\u541D","\u{2F83D}":"\u5438",\uF980:"\u5442","\u{2F83E}":"\u5448","\u{2F83F}":"\u5468","\u{2F83C}":"\u549E","\u{2F840}":"\u54A2",\uF99E:"\u54BD",\u439B:"\u3588","\u{2F841}":"\u54F6","\u{2F842}":"\u5510","\u{2F843}":"\u5553",\u555F:"\u5553","\uFA79":"\u5555","\u{2F844}":"\u5563","\u{2F845}":"\u5584","\u{2F846}":"\u5584",\uF90B:"\u5587","\uFA7A":"\u5599","\u{2F847}":"\u5599","\uFA36":"\u559D","\uFA78":"\u559D","\u{2F848}":"\u55AB","\u{2F849}":"\u55B3",\uFA0D:"\u55C0","\u{2F84A}":"\u55C2","\uFA7B":"\u55E2","\uFA37":"\u5606","\u{2F84C}":"\u5606","\u{2F84E}":"\u5651","\u{2F84F}":"\u5674","\uFA38":"\u5668",\uF9A9:"\u56F9","\u{2F84B}":"\u5716","\u{2F84D}":"\u5717","\u2F1F":"\u571F",\u58EB:"\u571F","\u2F20":"\u571F","\u{2F855}":"\u578B","\u{2F852}":"\u57CE",\u39B3:"\u363D","\u{2F853}":"\u57F4","\u{2F854}":"\u580D","\u{2F857}":"\u5831","\u{2F856}":"\u5832","\uFA39":"\u5840",\uFA10:"\u585A","\uFA7C":"\u585A",\uF96C:"\u585E",\u586B:"\u5861",\u58FF:"\u58AB","\u{2F858}":"\u58AC","\uFA7D":"\u58B3",\uF94A:"\u58D8",\uF942:"\u58DF","\u{2F859}":"\u{214E4}","\u{2F851}":"\u58EE","\u{2F85A}":"\u58F2","\u{2F85B}":"\u58F7","\u2F21":"\u5902","\u{2F85C}":"\u5906","\u2F22":"\u590A",\u30BF:"\u5915","\u2F23":"\u5915","\u{2F85D}":"\u591A","\u{2F85E}":"\u5922","\u2F24":"\u5927","\uFA7E":"\u5944",\uF90C:"\u5948",\uF909:"\u5951","\uFA7F":"\u5954","\u{2F85F}":"\u5962",\uF981:"\u5973","\u2F25":"\u5973","\u{2F860}":"\u{216A8}","\u{2F861}":"\u{216EA}","\u{2F865}":"\u59D8","\u{2F862}":"\u59EC","\u{2F863}":"\u5A1B","\u{2F864}":"\u5A27","\uFA80":"\u5A62","\u{2F866}":"\u5A66",\u5B00:"\u5AAF","\u{2F867}":"\u36EE","\u{2F868}":"\u36FC","\u{2F986}":"\u5AB5","\u{2F869}":"\u5B08","\uFA81":"\u5B28","\u{2F86A}":"\u5B3E","\u{2F86B}":"\u5B3E","\u2F26":"\u5B50","\u2F27":"\u5B80",\uFA04:"\u5B85","\u{2F86C}":"\u{219C8}","\u{2F86D}":"\u5BC3","\u{2F86E}":"\u5BD8",\uF95F:"\u5BE7",\uF9AA:"\u5BE7","\u{2F86F}":"\u5BE7",\uF9BC:"\u5BEE","\u{2F870}":"\u5BF3","\u{2F871}":"\u{21B18}","\u2F28":"\u5BF8","\u{2F872}":"\u5BFF","\u{2F873}":"\u5C06","\u2F29":"\u5C0F","\u{2F875}":"\u5C22","\u2E90":"\u5C22","\u2F2A":"\u5C22","\u2E8F":"\u5C23","\u{2F876}":"\u3781","\u2F2B":"\u5C38",\uF9BD:"\u5C3F","\u{2F877}":"\u5C60",\uF94B:"\u5C62","\uFA3B":"\u5C64",\uF9DF:"\u5C65","\uFA3C":"\u5C6E","\u{2F878}":"\u5C6E","\u2F2C":"\u5C6E","\u{2F8F8}":"\u{21D0B}","\u2F2D":"\u5C71","\u{2F879}":"\u5CC0","\u{2F87A}":"\u5C8D","\u{2F87B}":"\u{21DE4}","\u{2F87D}":"\u{21DE6}",\uF9D5:"\u5D19","\u{2F87C}":"\u5D43",\uF921:"\u5D50","\u{2F87F}":"\u5D6B","\u{2F87E}":"\u5D6E","\u{2F880}":"\u5D7C","\u{2F9F4}":"\u5DB2",\uF9AB:"\u5DBA","\u2F2E":"\u5DDB","\u{2F882}":"\u5DE2",\u30A8:"\u5DE5","\u2F2F":"\u5DE5","\u2F30":"\u5DF1","\u2E92":"\u5DF3","\u{2F883}":"\u382F","\u{2F884}":"\u5DFD","\u2F31":"\u5DFE",\u5E32:"\u5E21","\u{2F885}":"\u5E28","\u{2F886}":"\u5E3D","\u{2F887}":"\u5E69","\u{2F888}":"\u3862","\u{2F889}":"\u{22183}","\u2F32":"\u5E72",\uF98E:"\u5E74","\u{2F939}":"\u{2219F}","\u2E93":"\u5E7A","\u2F33":"\u5E7A","\u2F34":"\u5E7F",\uFA01:"\u5EA6","\u{2F88A}":"\u387C","\u{2F88B}":"\u5EB0","\u{2F88C}":"\u5EB3","\u{2F88D}":"\u5EB6",\uF928:"\u5ECA","\u{2F88E}":"\u5ECA",\uF9A2:"\u5EC9","\uFA82":"\u5ED2",\uFA0B:"\u5ED3","\uFA83":"\u5ED9",\uF982:"\u5EEC","\u2F35":"\u5EF4","\u{2F890}":"\u5EFE","\u2F36":"\u5EFE","\u{2F891}":"\u{22331}","\u{2F892}":"\u{22331}",\uF943:"\u5F04","\u2F37":"\u5F0B","\u2F38":"\u5F13","\u{2F894}":"\u5F22","\u{2F895}":"\u5F22","\u2F39":"\u5F50","\u2E94":"\u5F51","\u{2F874}":"\u5F53","\u{2F896}":"\u38C7","\u2F3A":"\u5F61","\u{2F899}":"\u5F62","\uFA84":"\u5F69","\u{2F89A}":"\u5F6B","\u2F3B":"\u5F73",\uF9D8:"\u5F8B","\u{2F89B}":"\u38E3","\u{2F89C}":"\u5F9A",\uF966:"\u5FA9","\uFA85":"\u5FAD","\u2F3C":"\u5FC3","\u2E96":"\u5FC4","\u2E97":"\u38FA","\u{2F89D}":"\u5FCD","\u{2F89E}":"\u5FD7",\uF9A3:"\u5FF5","\u{2F89F}":"\u5FF9",\uF960:"\u6012",\uF9AC:"\u601C","\uFA6B":"\u6075","\u{2F8A2}":"\u391C","\u{2F8A1}":"\u393A","\u{2F8A0}":"\u6081","\uFA3D":"\u6094","\u{2F8A3}":"\u6094","\u{2F8A5}":"\u60C7","\uFA86":"\u60D8",\uF9B9:"\u60E1","\u{2F8A4}":"\u{226D4}","\uFA88":"\u6108","\uFA3E":"\u6168",\uF9D9:"\u6144","\u{2F8A6}":"\u6148","\u{2F8A7}":"\u614C","\u{2F8A9}":"\u614C","\uFA87":"\u614E","\u{2F8A8}":"\u614E","\uFA8A":"\u6160","\u{2F8AA}":"\u617A","\uFA3F":"\u618E","\uFA89":"\u618E","\u{2F8AB}":"\u618E",\uF98F:"\u6190","\u{2F8AD}":"\u61A4","\u{2F8AE}":"\u61AF","\u{2F8AC}":"\u61B2","\uFAD0":"\u{22844}","\uFACF":"\u{2284A}","\u{2F8AF}":"\u61DE","\uFA40":"\u61F2","\uFA8B":"\u61F2","\u{2F8B0}":"\u61F2",\uF90D:"\u61F6","\u{2F8B1}":"\u61F6",\uF990:"\u6200","\u2F3D":"\u6208","\u{2F8B2}":"\u6210","\u{2F8B3}":"\u621B",\uF9D2:"\u622E","\uFA8C":"\u6234","\u2F3E":"\u6236",\u6238:"\u6236","\u2F3F":"\u624B","\u2E98":"\u624C","\u{2F8B4}":"\u625D","\u{2F8B5}":"\u62B1",\uF925:"\u62C9",\uF95B:"\u62CF",\uFA02:"\u62D3","\u{2F8B6}":"\u62D4","\u{2F8BA}":"\u62FC",\uF973:"\u62FE","\u{2F8B8}":"\u{22B0C}","\u{2F8B9}":"\u633D","\u{2F8B7}":"\u6350","\u{2F8BB}":"\u6368",\uF9A4:"\u637B","\u{2F8BC}":"\u6383",\uF975:"\u63A0","\u{2F8C1}":"\u63A9","\uFA8D":"\u63C4","\u{2F8BD}":"\u63E4","\uFA8F":"\u6452","\u{2F8BE}":"\u{22BF1}","\uFA8E":"\u641C","\u{2F8BF}":"\u6422","\u{2F8C0}":"\u63C5","\u{2F8C3}":"\u6469","\u{2F8C6}":"\u6477","\u{2F8C4}":"\u647E","\u{2F8C2}":"\u3A2E",\u6409:"\u3A41",\uF991:"\u649A","\u{2F8C5}":"\u649D",\uF930:"\u64C4","\u{2F8C7}":"\u3A6C","\u2F40":"\u652F","\u2F41":"\u6534","\u2E99":"\u6535","\uFA41":"\u654F","\u{2F8C8}":"\u654F","\uFA90":"\u6556","\u{2F8C9}":"\u656C",\uF969:"\u6578","\u{2F8CA}":"\u{2300A}","\u2F42":"\u6587","\u2EEB":"\u6589","\u2F43":"\u6597",\uF9BE:"\u6599","\u2F44":"\u65A4","\u2F45":"\u65B9",\uF983:"\u65C5","\u2F46":"\u65E0","\u2E9B":"\u65E1","\uFA42":"\u65E2","\u{2F8CB}":"\u65E3","\u2F47":"\u65E5",\uF9E0:"\u6613",\u66F6:"\u3ADA","\u{2F8D1}":"\u3AE4","\u{2F8CD}":"\u6649",\u6669:"\u665A",\uFA12:"\u6674","\uFA91":"\u6674","\uFA43":"\u6691","\u{2F8CF}":"\u6691",\uF9C5:"\u6688","\u{2F8D0}":"\u3B08","\u{2F8D5}":"\u669C",\uFA06:"\u66B4",\uF98B:"\u66C6","\u{2F8CE}":"\u3B19","\u{2F897}":"\u{232B8}","\u2F48":"\u66F0",\uF901:"\u66F4","\u{2F8CC}":"\u66F8","\u2F49":"\u6708","\u{2F980}":"\u{2335F}",\u80A6:"\u670C",\u80D0:"\u670F",\u80CA:"\u6710",\u8101:"\u6713",\u80F6:"\u3B35",\uF929:"\u6717","\uFA92":"\u6717","\u{2F8D8}":"\u6717",\u8127:"\u6718","\uFA93":"\u671B","\u{2F8D9}":"\u671B",\u5E50:"\u3B3A",\u4420:"\u3B3B","\u{2F989}":"\u{23393}",\u81A7:"\u6723","\u{2F98A}":"\u{2339C}","\u2F4A":"\u6728",\uF9E1:"\u674E","\u{2F8DC}":"\u6753","\uFA94":"\u6756","\u{2F8DB}":"\u675E","\u{2F8DD}":"\u{233C3}",\u67FF:"\u676E",\uF9C8:"\u677B","\u{2F8E0}":"\u6785",\uF9F4:"\u6797","\u{2F8DE}":"\u3B49","\uFAD1":"\u{233D5}",\uF9C9:"\u67F3","\u{2F8DF}":"\u67FA",\uF9DA:"\u6817","\u{2F8E5}":"\u681F","\u{2F8E1}":"\u6852","\u{2F8E3}":"\u{2346D}",\uF97A:"\u6881","\uFA44":"\u6885","\u{2F8E2}":"\u6885","\u{2F8E4}":"\u688E",\uF9E2:"\u68A8","\u{2F8E6}":"\u6914","\u{2F8E8}":"\u6942","\uFAD2":"\u3B9D","\u{2F8E7}":"\u3B9D",\u69E9:"\u3BA3",\u6A27:"\u699D","\u{2F8E9}":"\u69A3","\u{2F8EA}":"\u69EA",\uF914:"\u6A02",\uF95C:"\u6A02",\uF9BF:"\u6A02",\uF94C:"\u6A13","\u{2F8EC}":"\u{236A3}","\u{2F8EB}":"\u6AA8",\uF931:"\u6AD3","\u{2F8ED}":"\u6ADB",\uF91D:"\u6B04","\u{2F8EE}":"\u3C18","\u2F4B":"\u6B20","\u{2F8EF}":"\u6B21","\u{2F8F0}":"\u{238A7}","\u{2F8F1}":"\u6B54","\u{2F8F2}":"\u3C4E","\u2F4C":"\u6B62","\u2EED":"\u6B6F","\u{2F8F3}":"\u6B72",\uF98C:"\u6B77","\uFA95":"\u6B79","\u2F4D":"\u6B79","\u2E9E":"\u6B7A","\u{2F8F4}":"\u6B9F",\uF9A5:"\u6BAE","\u2F4E":"\u6BB3",\uF970:"\u6BBA","\uFA96":"\u6BBA","\u{2F8F5}":"\u6BBA","\u{2F8F6}":"\u6BBB","\u{2F8F7}":"\u{23A8D}","\u2F4F":"\u6BCB","\u2E9F":"\u6BCD","\u{2F8F9}":"\u{23AFA}","\u2F50":"\u6BD4","\u2F51":"\u6BDB","\u2F52":"\u6C0F","\u2EA0":"\u6C11","\u2F53":"\u6C14","\u2F54":"\u6C34","\u2EA1":"\u6C35","\u2EA2":"\u6C3A","\u{2F8FA}":"\u6C4E","\u{2F8FE}":"\u6C67",\uF972:"\u6C88","\u{2F8FC}":"\u6CBF",\uF968:"\u6CCC","\u{2F8FD}":"\u6CCD",\uF9E3:"\u6CE5","\u{2F8FB}":"\u{23CBC}",\uF915:"\u6D1B",\uFA05:"\u6D1E","\u{2F907}":"\u6D34","\u{2F900}":"\u6D3E",\uF9CA:"\u6D41","\uFA97":"\u6D41","\u{2F902}":"\u6D41","\u{2F8FF}":"\u6D16","\u{2F903}":"\u6D69",\uF92A:"\u6D6A","\uFA45":"\u6D77","\u{2F901}":"\u6D77","\u{2F904}":"\u6D78","\u{2F905}":"\u6D85","\u{2F906}":"\u{23D1E}",\uF9F5:"\u6DCB",\uF94D:"\u6DDA",\uF9D6:"\u6DEA","\u{2F90E}":"\u6DF9","\uFA46":"\u6E1A","\u{2F908}":"\u6E2F","\u{2F909}":"\u6E6E",\u6F59:"\u6E88","\uFA99":"\u6ECB","\u{2F90B}":"\u6ECB",\uF9CB:"\u6E9C",\uF9EC:"\u6EBA","\u{2F90C}":"\u6EC7",\uF904:"\u6ED1","\uFA98":"\u6EDB","\u{2F90A}":"\u3D33",\uF94E:"\u6F0F","\uFA47":"\u6F22","\uFA9A":"\u6F22",\uF992:"\u6F23","\u{2F90D}":"\u{23ED1}","\u{2F90F}":"\u6F6E","\u{2F910}":"\u{23F5E}","\u{2F911}":"\u{23F8E}","\u{2F912}":"\u6FC6",\uF922:"\u6FEB",\uF984:"\u6FFE","\u{2F915}":"\u701B","\uFA9B":"\u701E","\u{2F914}":"\u701E","\u{2F913}":"\u7039","\u{2F917}":"\u704A","\u{2F916}":"\u3D96","\u2F55":"\u706B","\u2EA3":"\u706C","\u{2F835}":"\u7070","\u{2F919}":"\u7077","\u{2F918}":"\u707D",\uF9FB:"\u7099","\u{2F91A}":"\u70AD",\uF99F:"\u70C8",\uF916:"\u70D9","\uFA48":"\u716E","\uFA9C":"\u716E","\u{2F91D}":"\u{24263}","\u{2F91C}":"\u7145",\uF993:"\u7149","\uFA6C":"\u{242EE}","\u{2F91E}":"\u719C",\uF9C0:"\u71CE",\uF9EE:"\u71D0","\u{2F91F}":"\u{243AB}",\uF932:"\u7210",\uF91E:"\u721B","\u{2F920}":"\u7228","\u2F56":"\u722A","\uFA49":"\u722B","\u2EA4":"\u722B","\uFA9E":"\u7235","\u{2F921}":"\u7235","\u2F57":"\u7236","\u2F58":"\u723B","\u2EA6":"\u4E2C","\u2F59":"\u723F","\u2F5A":"\u7247","\u{2F922}":"\u7250","\u2F5B":"\u7259","\u{2F923}":"\u{24608}","\u2F5C":"\u725B",\uF946:"\u7262","\u{2F924}":"\u7280","\u{2F925}":"\u7295","\u2F5D":"\u72AC","\u2EA8":"\u72AD","\uFA9F":"\u72AF",\uF9FA:"\u72C0","\u{2F926}":"\u{24735}",\uF92B:"\u72FC",\uFA16:"\u732A","\uFAA0":"\u732A","\u{2F927}":"\u{24814}",\uF9A7:"\u7375","\u{2F928}":"\u737A","\u2F5E":"\u7384",\uF961:"\u7387",\uF9DB:"\u7387","\u2F5F":"\u7389","\u{2F929}":"\u738B","\u{2F92A}":"\u3EAC","\u{2F92B}":"\u73A5",\uF9AD:"\u73B2","\u{2F92C}":"\u3EB8","\u{2F92D}":"\u3EB8",\uF917:"\u73DE",\uF9CC:"\u7409",\uF9E4:"\u7406","\uFA4A":"\u7422","\u{2F92E}":"\u7447","\u{2F92F}":"\u745C",\uF9AE:"\u7469","\uFAA1":"\u7471","\u{2F930}":"\u7471","\u{2F931}":"\u7485",\uF994:"\u7489",\uF9EF:"\u7498","\u{2F932}":"\u74CA","\u2F60":"\u74DC","\u2F61":"\u74E6","\u{2F933}":"\u3F1B","\uFAA2":"\u7506","\u2F62":"\u7518","\u2F63":"\u751F","\u{2F934}":"\u7524","\u2F64":"\u7528","\u2F65":"\u7530","\uFAA3":"\u753B","\u{2F936}":"\u753E","\u{2F935}":"\u{24C36}",\uF9CD:"\u7559",\uF976:"\u7565",\uF962:"\u7570","\u{2F938}":"\u7570","\u{2F937}":"\u{24C92}","\u2F66":"\u758B","\u2F67":"\u7592",\uF9E5:"\u75E2","\u{2F93A}":"\u7610","\uFAA5":"\u761F","\uFAA4":"\u761D",\uF9C1:"\u7642",\uF90E:"\u7669","\u2F68":"\u7676","\u2F69":"\u767D","\u{2F93B}":"\u{24FA1}","\u{2F93C}":"\u{24FB8}","\u2F6A":"\u76AE","\u2F6B":"\u76BF","\u{2F93D}":"\u{25044}","\u{2F93E}":"\u3FFC",\uFA17:"\u76CA","\uFAA6":"\u76CA","\uFAA7":"\u76DB",\uF933:"\u76E7","\u{2F93F}":"\u4008","\u2F6C":"\u76EE","\uFAA8":"\u76F4","\u{2F940}":"\u76F4","\u{2F942}":"\u{250F2}","\u{2F941}":"\u{250F3}",\uF96D:"\u7701","\uFAD3":"\u4018","\u{2F943}":"\u{25119}","\u{2F945}":"\u771E","\u{2F946}":"\u771F","\u{2F947}":"\u771F","\u{2F944}":"\u{25133}","\uFAAA":"\u7740","\uFAA9":"\u774A","\u{2F948}":"\u774A","\u9FC3":"\u4039","\uFAD4":"\u4039","\u{2F949}":"\u4039",\u6663:"\u403F","\u{2F94B}":"\u4046","\u{2F94A}":"\u778B","\uFAD5":"\u{25249}","\uFA9D":"\u77A7","\u2F6D":"\u77DB","\u2F6E":"\u77E2","\u2F6F":"\u77F3","\u{2F94C}":"\u4096","\u{2F94D}":"\u{2541D}",\u784F:"\u7814","\u{2F94E}":"\u784E",\uF9CE:"\u786B",\uF93B:"\u788C","\u{2F94F}":"\u788C","\uFA4B":"\u7891",\uF947:"\u78CA","\uFAAB":"\u78CC","\u{2F950}":"\u78CC",\uF964:"\u78FB","\u{2F951}":"\u40E3",\uF985:"\u792A","\u2F70":"\u793A","\u2EAD":"\u793B",\uFA18:"\u793C","\uFA4C":"\u793E","\uFA4E":"\u7948","\uFA4D":"\u7949","\u{2F952}":"\u{25626}","\uFA4F":"\u7950","\uFA50":"\u7956","\u{2F953}":"\u7956","\uFA51":"\u795D",\uFA19:"\u795E",\uFA1A:"\u7965","\uFA61":"\u8996","\uFAB8":"\u8996",\uF93C:"\u797F","\u{2F954}":"\u{2569A}","\uFA52":"\u798D","\uFA53":"\u798E",\uFA1B:"\u798F","\u{2F956}":"\u798F","\u{2F955}":"\u{256C5}",\uF9B6:"\u79AE","\u2F71":"\u79B8","\u2F72":"\u79BE",\uF995:"\u79CA","\u{2F958}":"\u412F","\u{2F957}":"\u79EB",\uF956:"\u7A1C","\u{2F95A}":"\u7A4A","\uFA54":"\u7A40","\u{2F959}":"\u7A40","\u{2F95B}":"\u7A4F","\u2F73":"\u7A74","\uFA55":"\u7A81","\u{2F95C}":"\u{2597C}","\uFAAC":"\u7AB1",\uF9F7:"\u7ACB","\u2F74":"\u7ACB","\u2EEF":"\u7ADC","\u{2F95D}":"\u{25AA7}","\u{2F95E}":"\u{25AA7}","\u{2F95F}":"\u7AEE","\u2F75":"\u7AF9",\uF9F8:"\u7B20","\uFA56":"\u7BC0","\uFAAD":"\u7BC0","\u{2F960}":"\u4202","\u{2F961}":"\u{25BAB}","\u{2F962}":"\u7BC6","\u{2F964}":"\u4227","\u{2F963}":"\u7BC9","\u{2F965}":"\u{25C80}","\uFAD6":"\u{25CD0}",\uF9A6:"\u7C3E",\uF944:"\u7C60","\u2F76":"\u7C73","\uFAAE":"\u7C7B",\uF9F9:"\u7C92",\uFA1D:"\u7CBE","\u{2F966}":"\u7CD2",\uFA03:"\u7CD6","\u{2F968}":"\u7CE8","\u{2F967}":"\u42A0","\u{2F969}":"\u7CE3",\uF97B:"\u7CE7","\u2F77":"\u7CF8","\u2EAF":"\u7CF9","\u{2F96B}":"\u{25F86}","\u{2F96A}":"\u7D00",\uF9CF:"\u7D10",\uF96A:"\u7D22",\uF94F:"\u7D2F",\u7D76:"\u7D55","\u{2F96C}":"\u7D63","\uFAAF":"\u7D5B",\uF93D:"\u7DA0",\uF957:"\u7DBE","\u{2F96E}":"\u7DC7",\uF996:"\u7DF4","\uFA57":"\u7DF4","\uFAB0":"\u7DF4","\u{2F96F}":"\u7E02","\u{2F96D}":"\u4301","\uFA58":"\u7E09",\uF950:"\u7E37","\uFA59":"\u7E41","\u{2F970}":"\u7E45","\u{2F898}":"\u{261DA}","\u{2F971}":"\u4334","\u2F78":"\u7F36","\u{2F972}":"\u{26228}","\uFAB1":"\u7F3E","\u{2F973}":"\u{26247}","\u2F79":"\u7F51","\u2EAB":"\u7F52","\u2EB2":"\u7F52","\u2EB1":"\u7F53","\u{2F974}":"\u4359","\uFA5A":"\u7F72","\u{2F975}":"\u{262D9}",\uF9E6:"\u7F79","\u{2F976}":"\u7F7A",\uF90F:"\u7F85","\u{2F977}":"\u{2633E}","\u2F7A":"\u7F8A","\u{2F978}":"\u7F95",\uF9AF:"\u7F9A",\uFA1E:"\u7FBD","\u2F7B":"\u7FBD","\u{2F979}":"\u7FFA",\uF934:"\u8001","\u2F7C":"\u8001","\u2EB9":"\u8002","\uFA5B":"\u8005","\uFAB2":"\u8005","\u{2F97A}":"\u8005","\u2F7D":"\u800C","\u{2F97B}":"\u{264DA}","\u2F7E":"\u8012","\u{2F97C}":"\u{26523}","\u2F7F":"\u8033",\uF9B0:"\u8046","\u{2F97D}":"\u8060","\u{2F97E}":"\u{265A8}",\uF997:"\u806F","\u{2F97F}":"\u8070",\uF945:"\u807E","\u2F80":"\u807F","\u2EBA":"\u8080","\u2F81":"\u8089",\uF953:"\u808B","\u{2F8D6}":"\u80AD","\u{2F982}":"\u80B2","\u{2F981}":"\u43D5","\u{2F8D7}":"\u43D9",\u8141:"\u80FC","\u{2F983}":"\u8103","\u{2F985}":"\u813E","\u{2F984}":"\u440B","\u{2F8DA}":"\u6721","\u{2F987}":"\u{267A7}","\u{2F988}":"\u{267B5}",\u6726:"\u4443",\uF926:"\u81D8","\u2F82":"\u81E3",\uF9F6:"\u81E8","\u2F83":"\u81EA","\uFA5C":"\u81ED","\u2F84":"\u81F3","\u2F85":"\u81FC","\u{2F893}":"\u8201","\u{2F98B}":"\u8201","\u{2F98C}":"\u8204","\u2F86":"\u820C","\uFA6D":"\u8218","\u2F87":"\u821B","\u2F88":"\u821F","\u{2F98E}":"\u446B","\u2F89":"\u826E",\uF97C:"\u826F","\u2F8A":"\u8272","\u2F8B":"\u8278","\uFA5D":"\u8279","\uFA5E":"\u8279","\u2EBE":"\u8279","\u2EBF":"\u8279","\u2EC0":"\u8279","\u{2F990}":"\u828B","\u{2F98F}":"\u8291","\u{2F991}":"\u829D","\u{2F993}":"\u82B1","\u{2F994}":"\u82B3","\u{2F995}":"\u82BD",\uF974:"\u82E5","\u{2F998}":"\u82E5","\u{2F996}":"\u82E6","\u{2F997}":"\u{26B3C}",\uF9FE:"\u8336","\uFAB3":"\u8352","\u{2F99A}":"\u8363","\u{2F999}":"\u831D","\u{2F99C}":"\u8323","\u{2F99D}":"\u83BD","\u{2F9A0}":"\u8353",\uF93E:"\u83C9","\u{2F9A1}":"\u83CA","\u{2F9A2}":"\u83CC","\u{2F9A3}":"\u83DC","\u{2F99E}":"\u83E7","\uFAB4":"\u83EF",\uF958:"\u83F1","\uFA5F":"\u8457","\u{2F99F}":"\u8457","\u{2F9A4}":"\u{26C36}","\u{2F99B}":"\u83AD",\uF918:"\u843D",\uF96E:"\u8449",\u853F:"\u848D","\u{2F9A6}":"\u{26CD5}","\u{2F9A5}":"\u{26D6B}",\uF999:"\u84EE","\u{2F9A8}":"\u84F1","\u{2F9A9}":"\u84F3",\uF9C2:"\u84FC","\u{2F9AA}":"\u8516","\u{2F9A7}":"\u452B","\u{2F9AC}":"\u8564","\u{2F9AD}":"\u{26F2C}",\uF923:"\u85CD","\u{2F9AE}":"\u455D","\u{2F9B0}":"\u{26FB1}","\u{2F9AF}":"\u4561",\uF9F0:"\u85FA",\uF935:"\u8606","\u{2F9B2}":"\u456B",\uFA20:"\u8612",\uF91F:"\u862D","\u{2F9B1}":"\u{270D2}",\u8641:"\u8637",\uF910:"\u863F","\u2F8C":"\u864D","\u2EC1":"\u864E","\u{2F9B3}":"\u8650",\uF936:"\u865C","\u{2F9B4}":"\u865C","\u{2F9B5}":"\u8667","\u{2F9B6}":"\u8669","\u2F8D":"\u866B","\u{2F9B7}":"\u86A9","\u{2F9B8}":"\u8688","\u{2F9BA}":"\u86E2","\u{2F9B9}":"\u870E","\u{2F9BC}":"\u8728","\u{2F9BD}":"\u876B","\u{2F9C0}":"\u87E1","\uFAB5":"\u8779","\u{2F9BB}":"\u8779","\u{2F9BE}":"\u8786","\u{2F9BF}":"\u45D7","\u{2F9AB}":"\u{273CA}",\uF911:"\u87BA","\u{2F9C1}":"\u8801","\u{2F9C2}":"\u45F9",\uF927:"\u881F","\u2F8E":"\u8840",\uFA08:"\u884C","\u2F8F":"\u884C","\u{2F9C3}":"\u8860","\u{2F9C4}":"\u8863","\u2F90":"\u8863","\u2EC2":"\u8864",\uF9A0:"\u88C2","\u{2F9C5}":"\u{27667}",\uF9E7:"\u88CF","\u{2F9C6}":"\u88D7","\u{2F9C7}":"\u88DE",\uF9E8:"\u88E1",\uF912:"\u88F8","\u{2F9C9}":"\u88FA","\u{2F9C8}":"\u4635","\uFA60":"\u8910","\uFAB6":"\u8941",\uF924:"\u8964","\u2F91":"\u897E","\u2EC4":"\u897F","\u2EC3":"\u8980","\uFAB7":"\u8986",\uFA0A:"\u898B","\u2F92":"\u898B","\u{2F9CB}":"\u{278AE}","\u2EC5":"\u89C1","\u2F93":"\u89D2","\u2F94":"\u8A00","\u{2F9CC}":"\u{27966}",\u8A7D:"\u8A2E",\u8A1E:"\u46B6","\u{2F9CD}":"\u46BE","\u{2F9CE}":"\u46C7","\u{2F9CF}":"\u8AA0",\uF96F:"\u8AAA",\uF9A1:"\u8AAA","\uFAB9":"\u8ABF","\uFABB":"\u8ACB",\uF97D:"\u8AD2",\uF941:"\u8AD6","\uFABE":"\u8AED","\u{2F9D0}":"\u8AED",\uFA22:"\u8AF8","\uFABA":"\u8AF8",\uF95D:"\u8AFE","\uFABD":"\u8AFE","\uFA62":"\u8B01","\uFABC":"\u8B01","\uFA63":"\u8B39","\uFABF":"\u8B39",\uF9FC:"\u8B58",\uF95A:"\u8B80",\u8B8F:"\u8B86","\uFAC0":"\u8B8A","\u{2F9D1}":"\u8B8A","\u2EC8":"\u8BA0","\u2F95":"\u8C37","\u2F96":"\u8C46",\uF900:"\u8C48","\u{2F9D2}":"\u8C55","\u2F97":"\u8C55",\u8C63:"\u8C5C","\u2F98":"\u8C78","\u{2F9D3}":"\u{27CA8}","\u2F99":"\u8C9D","\u{2F9D4}":"\u8CAB","\u{2F9D5}":"\u8CC1",\uF948:"\u8CC2",\uF903:"\u8CC8","\uFA64":"\u8CD3","\uFA65":"\u8D08","\uFAC1":"\u8D08","\u{2F9D6}":"\u8D1B","\u2EC9":"\u8D1D","\u2F9A":"\u8D64","\u2F9B":"\u8D70","\u{2F9D7}":"\u8D77",\u8D86:"\u8D7F","\uFAD7":"\u{27ED3}","\u{2F9D8}":"\u{27F2F}","\u2F9C":"\u8DB3","\u{2F9DA}":"\u8DCB","\u{2F9DB}":"\u8DBC",\u8DFA:"\u8DE5",\uF937:"\u8DEF","\u{2F9DC}":"\u8DF0",\u8E9B:"\u8E97","\u2F9D":"\u8EAB",\uF902:"\u8ECA","\u2F9E":"\u8ECA","\u{2F9DE}":"\u8ED4",\u8F27:"\u8EFF",\uF998:"\u8F26",\uF9D7:"\u8F2A","\uFAC2":"\u8F38","\u{2F9DF}":"\u8F38",\uFA07:"\u8F3B",\uF98D:"\u8F62","\u2ECB":"\u8F66","\u2F9F":"\u8F9B","\u{2F98D}":"\u8F9E",\uF971:"\u8FB0","\u2FA0":"\u8FB0","\u2FA1":"\u8FB5","\uFA66":"\u8FB6","\u2ECC":"\u8FB6","\u2ECD":"\u8FB6","\u{2F881}":"\u5DE1",\uF99A:"\u9023",\uFA25:"\u9038","\uFA67":"\u9038","\uFAC3":"\u9072",\uF9C3:"\u907C","\u{2F9E0}":"\u{285D2}","\u{2F9E1}":"\u{285ED}",\uF913:"\u908F","\u2FA2":"\u9091","\u{2F9E2}":"\u9094",\uF92C:"\u90CE",\u90DE:"\u90CE","\uFA2E":"\u90CE","\u{2F9E3}":"\u90F1",\uFA26:"\u90FD","\u{2F9E5}":"\u{2872E}","\u{2F9E4}":"\u9111","\u{2F9E6}":"\u911B","\u2FA3":"\u9149",\uF919:"\u916A","\uFAC4":"\u9199",\uF9B7:"\u91B4","\u2FA4":"\u91C6",\uF9E9:"\u91CC","\u2FA5":"\u91CC",\uF97E:"\u91CF",\uF90A:"\u91D1","\u2FA6":"\u91D1",\uF9B1:"\u9234","\u{2F9E7}":"\u9238","\uFAC5":"\u9276","\u{2F9E8}":"\u92D7","\u{2F9E9}":"\u92D8","\u{2F9EA}":"\u927C",\uF93F:"\u9304",\uF99B:"\u934A",\u93AE:"\u93AD","\u{2F9EB}":"\u93F9","\u{2F9EC}":"\u9415","\u{2F9ED}":"\u{28BFA}","\u2ED0":"\u9485","\u2ED1":"\u9577","\u2FA7":"\u9577","\u2ED2":"\u9578","\u2ED3":"\u957F","\u2FA8":"\u9580","\u{2F9EE}":"\u958B","\u{2F9EF}":"\u4995",\uF986:"\u95AD","\u{2F9F0}":"\u95B7","\u{2F9F1}":"\u{28D77}","\u2ED4":"\u95E8","\u2FA9":"\u961C","\u2ECF":"\u961D","\u2ED6":"\u961D",\uF9C6:"\u962E",\uF951:"\u964B",\uFA09:"\u964D",\uF959:"\u9675",\uF9D3:"\u9678","\uFAC6":"\u967C",\uF9DC:"\u9686",\uF9F1:"\u96A3","\u{2F9F2}":"\u49E6","\u2FAA":"\u96B6","\uFA2F":"\u96B7",\u96B8:"\u96B7",\uF9B8:"\u96B7","\u2FAB":"\u96B9","\u{2F9F3}":"\u96C3",\uF9EA:"\u96E2","\uFA68":"\u96E3","\uFAC7":"\u96E3","\u2FAC":"\u96E8",\uF9B2:"\u96F6",\uF949:"\u96F7","\u{2F9F5}":"\u9723","\u{2F9F6}":"\u{29145}",\uF938:"\u9732",\uF9B3:"\u9748","\u2FAD":"\u9751","\u2ED8":"\u9752",\uFA1C:"\u9756","\uFAC8":"\u9756","\u{2F81C}":"\u{291DF}","\u2FAE":"\u975E","\u2FAF":"\u9762","\u{2F9F7}":"\u{2921A}","\u2FB0":"\u9769","\u{2F9F8}":"\u4A6E","\u{2F9F9}":"\u4A76","\u2FB1":"\u97CB","\uFAC9":"\u97DB","\u{2F9FA}":"\u97E0","\u2ED9":"\u97E6","\u2FB2":"\u97ED","\u{2F9FB}":"\u{2940A}","\u2FB3":"\u97F3","\uFA69":"\u97FF","\uFACA":"\u97FF","\u2FB4":"\u9801","\u{2F9FC}":"\u4AB2","\uFACB":"\u980B","\u{2F9FE}":"\u980B","\u{2F9FF}":"\u980B",\uF9B4:"\u9818","\u{2FA00}":"\u9829","\u{2F9FD}":"\u{29496}","\uFA6A":"\u983B","\uFACC":"\u983B",\uF9D0:"\u985E","\u2EDA":"\u9875","\u2FB5":"\u98A8","\u{2FA01}":"\u{295B6}","\u2EDB":"\u98CE","\u2FB6":"\u98DB","\u2EDC":"\u98DE","\u2EDD":"\u98DF","\u2FB7":"\u98DF","\u2EDF":"\u98E0","\u{2FA02}":"\u98E2",\uFA2A:"\u98EF",\uFA2B:"\u98FC","\u{2FA03}":"\u4B33",\uFA2C:"\u9928","\u{2FA04}":"\u9929","\u2EE0":"\u9963","\u2FB8":"\u9996","\u2FB9":"\u9999","\u{2FA05}":"\u99A7","\u2FBA":"\u99AC","\u{2FA06}":"\u99C2",\uF91A:"\u99F1","\u{2FA07}":"\u99FE",\uF987:"\u9A6A","\u2EE2":"\u9A6C","\u2FBB":"\u9AA8","\u{2FA08}":"\u4BCE","\u2FBC":"\u9AD8","\u2FBD":"\u9ADF","\u{2FA09}":"\u{29B30}","\uFACD":"\u9B12","\u{2FA0A}":"\u9B12","\u2FBE":"\u9B25","\u2FBF":"\u9B2F","\u2FC0":"\u9B32","\u2FC1":"\u9B3C","\u2EE4":"\u9B3C","\u2FC2":"\u9B5A",\uF939:"\u9B6F","\u{2FA0B}":"\u9C40",\uF9F2:"\u9C57","\u2EE5":"\u9C7C","\u2FC3":"\u9CE5","\u{2FA0C}":"\u9CFD","\u{2FA0D}":"\u4CCE","\u{2FA0F}":"\u9D67","\u{2FA0E}":"\u4CED","\u{2FA10}":"\u{2A0CE}",\uFA2D:"\u9DB4","\u{2FA12}":"\u{2A105}","\u{2FA11}":"\u4CF8",\uF93A:"\u9DFA","\u{2FA13}":"\u{2A20E}",\uF920:"\u9E1E",\u9E43:"\u9E42","\u2FC4":"\u9E75",\uF940:"\u9E7F","\u2FC5":"\u9E7F","\u{2FA14}":"\u{2A291}",\uF988:"\u9E97",\uF9F3:"\u9E9F","\u2FC6":"\u9EA5","\u2EE8":"\u9EA6","\u{2FA15}":"\u9EBB","\u2FC7":"\u9EBB","\u{2F88F}":"\u{2A392}","\u2FC8":"\u9EC3","\u2EE9":"\u9EC4","\u2FC9":"\u9ECD",\uF989:"\u9ECE","\u{2FA16}":"\u4D56","\u2FCA":"\u9ED1",\u9ED2:"\u9ED1","\uFA3A":"\u58A8","\u{2FA17}":"\u9EF9","\u2FCB":"\u9EF9","\u2FCC":"\u9EFD","\u{2FA19}":"\u9F05","\u{2FA18}":"\u9EFE","\u2FCD":"\u9F0E","\u{2FA1A}":"\u9F0F","\u2FCE":"\u9F13","\u{2FA1B}":"\u9F16","\u2FCF":"\u9F20","\u{2FA1C}":"\u9F3B","\u2FD0":"\u9F3B","\uFAD8":"\u9F43","\u2FD1":"\u9F4A","\u2EEC":"\u9F50","\u2FD2":"\u9F52","\u{2FA1D}":"\u{2A600}","\u2EEE":"\u9F7F",\uF9C4:"\u9F8D","\u2FD3":"\u9F8D","\uFAD9":"\u9F8E","\u2EF0":"\u9F99",\uF907:"\u9F9C",\uF908:"\u9F9C","\uFACE":"\u9F9C","\u2FD4":"\u9F9C","\u2EF3":"\u9F9F","\u2FD5":"\u9FA0"},yv=Fw;function qw(n){return n.replace(/([.?*+^$[\]\\(){}|-])/g,"\\$1")}var jw=RegExp(Object.keys(yv).map(qw).join("|"),"g");function Vw(n){return yv[n]}function Gw(n){return n.replace(jw,Vw)}var Ww=Gw,rc={exports:{}},vv={};function Kr(n,e){typeof e=="boolean"&&(e={forever:e}),this._originalTimeouts=JSON.parse(JSON.stringify(n)),this._timeouts=n,this._options=e||{},this._maxRetryTime=e&&e.maxRetryTime||1/0,this._fn=null,this._errors=[],this._attempts=1,this._operationTimeout=null,this._operationTimeoutCb=null,this._timeout=null,this._operationStart=null,this._timer=null,this._options.forever&&(this._cachedTimeouts=this._timeouts.slice(0))}var Hw=Kr;Kr.prototype.reset=function(){this._attempts=1,this._timeouts=this._originalTimeouts.slice(0)};Kr.prototype.stop=function(){this._timeout&&clearTimeout(this._timeout),this._timer&&clearTimeout(this._timer),this._timeouts=[],this._cachedTimeouts=null};Kr.prototype.retry=function(n){if(this._timeout&&clearTimeout(this._timeout),!n)return!1;var e=new Date().getTime();if(n&&e-this._operationStart>=this._maxRetryTime)return this._errors.push(n),this._errors.unshift(new Error("RetryOperation timeout occurred")),!1;this._errors.push(n);var t=this._timeouts.shift();if(t===void 0)if(this._cachedTimeouts)this._errors.splice(0,this._errors.length-1),t=this._cachedTimeouts.slice(-1);else return!1;var r=this;return this._timer=setTimeout(function(){r._attempts++,r._operationTimeoutCb&&(r._timeout=setTimeout(function(){r._operationTimeoutCb(r._attempts)},r._operationTimeout),r._options.unref&&r._timeout.unref()),r._fn(r._attempts)},t),this._options.unref&&this._timer.unref(),!0};Kr.prototype.attempt=function(n,e){this._fn=n,e&&(e.timeout&&(this._operationTimeout=e.timeout),e.cb&&(this._operationTimeoutCb=e.cb));var t=this;this._operationTimeoutCb&&(this._timeout=setTimeout(function(){t._operationTimeoutCb()},t._operationTimeout)),this._operationStart=new Date().getTime(),this._fn(this._attempts)};Kr.prototype.try=function(n){console.log("Using RetryOperation.try() is deprecated"),this.attempt(n)};Kr.prototype.start=function(n){console.log("Using RetryOperation.start() is deprecated"),this.attempt(n)};Kr.prototype.start=Kr.prototype.try;Kr.prototype.errors=function(){return this._errors};Kr.prototype.attempts=function(){return this._attempts};Kr.prototype.mainError=function(){if(this._errors.length===0)return null;for(var n={},e=null,t=0,r=0;r<this._errors.length;r++){var i=this._errors[r],s=i.message,o=(n[s]||0)+1;n[s]=o,o>=t&&(e=i,t=o)}return e};(function(n){var e=Hw;n.operation=function(t){var r=n.timeouts(t);return new e(r,{forever:t&&(t.forever||t.retries===1/0),unref:t&&t.unref,maxRetryTime:t&&t.maxRetryTime})},n.timeouts=function(t){if(t instanceof Array)return[].concat(t);var r={retries:10,factor:2,minTimeout:1*1e3,maxTimeout:1/0,randomize:!1};for(var i in t)r[i]=t[i];if(r.minTimeout>r.maxTimeout)throw new Error("minTimeout is greater than maxTimeout");for(var s=[],o=0;o<r.retries;o++)s.push(this.createTimeout(o,r));return t&&t.forever&&!s.length&&s.push(this.createTimeout(o,r)),s.sort(function(a,l){return a-l}),s},n.createTimeout=function(t,r){var i=r.randomize?Math.random()+1:1,s=Math.round(i*Math.max(r.minTimeout,1)*Math.pow(r.factor,t));return s=Math.min(s,r.maxTimeout),s},n.wrap=function(t,r,i){if(r instanceof Array&&(i=r,r=null),!i){i=[];for(var s in t)typeof t[s]=="function"&&i.push(s)}for(var o=0;o<i.length;o++){var a=i[o],l=t[a];t[a]=function(c){var g=n.operation(r),m=Array.prototype.slice.call(arguments,1),f=m.pop();m.push(function(_){g.retry(_)||(_&&(arguments[0]=g.mainError()),f.apply(this,arguments))}),g.attempt(function(){c.apply(t,m)})}.bind(t,l),t[a].options=r}}})(vv);var Yw=vv;const zw=Yw,Jw=["Failed to fetch","NetworkError when attempting to fetch resource.","The Internet connection appears to be offline.","Network request failed"];class _v 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 Xw=(n,e,t)=>{const r=t.retries-(e-1);return n.attemptNumber=e,n.retriesLeft=r,n},Qw=n=>Jw.includes(n),Ev=(n,e)=>new Promise((t,r)=>{e={onFailedAttempt:()=>{},retries:10,...e};const i=zw.operation(e);i.attempt(async s=>{try{t(await n(s))}catch(o){if(!(o instanceof Error)){r(new TypeError(`Non-error was thrown: "${o}". You should only throw errors.`));return}if(o instanceof _v)i.stop(),r(o.originalError);else if(o instanceof TypeError&&!Qw(o.message))i.stop(),r(o);else{Xw(o,s,e);try{await e.onFailedAttempt(o)}catch(a){r(a);return}i.retry(o)||r(i.mainError())}}})});rc.exports=Ev;rc.exports.default=Ev;rc.exports.AbortError=_v;var Sv=G.exports;Object.defineProperty(W,"__esModule",{value:!0});W.DEFAULT_ALPHABET=void 0;W.alphabetPad=Xd;W.averageBetweenStrings=T0;W.baseToString=Io;W.checkObjectHasKeys=o0;W.checkObjectHasNoAdditionalKeys=a0;W.chunkPromises=b0;W.compare=P0;W.decodeParams=r0;W.deepCompare=Jd;W.deepCopy=c0;W.deepSortedObjectEntries=bv;W.defer=_0;W.encodeParams=t0;W.encodeUri=n0;W.ensureNoTrailingSlash=m0;W.escapeRegExp=Rv;W.getCrypto=I0;W.globToRegexp=g0;W.inherits=l0;W.isFunction=s0;W.isNullOrUndefined=v0;W.isNumber=d0;W.lexicographicCompare=Tv;W.nextString=O0;W.normalize=f0;W.polyfillSuper=u0;W.prevString=k0;W.promiseMapSeries=E0;W.promiseTry=S0;W.recursivelyAssign=Ov;W.removeDirectionOverrideChars=h0;W.removeElement=i0;W.removeHiddenChars=wv;W.setCrypto=R0;W.simpleRetryOperation=w0;W.sleep=y0;W.stringToBase=Fa;var Zw=Sv(Ww),e0=Sv(rc.exports);function t0(n){const e=new URLSearchParams;for(const[t,r]of Object.entries(n))r!=null&&e.set(t,String(r));return e.toString()}function r0(n){const e={},t=new URLSearchParams(n);for(const r of t.keys()){const i=t.getAll(r);e[r]=i.length===1?i[0]:i}return e}function n0(n,e){for(const t in e)!e.hasOwnProperty(t)||(n=n.replace(t,encodeURIComponent(e[t])));return n}function i0(n,e,t){let r;if(t){for(r=n.length-1;r>=0;r--)if(e(n[r],r,n))return n.splice(r,1),!0}else for(r=0;r<n.length;r++)if(e(n[r],r,n))return n.splice(r,1),!0;return!1}function s0(n){return Object.prototype.toString.call(n)==="[object Function]"}function o0(n,e){for(let t=0;t<e.length;t++)if(!n.hasOwnProperty(e[t]))throw new Error("Missing required key: "+e[t])}function a0(n,e){for(const t in n)if(!!n.hasOwnProperty(t)&&e.indexOf(t)===-1)throw new Error("Unknown key: "+t)}function c0(n){return JSON.parse(JSON.stringify(n))}function Jd(n,e){if(n===e)return!0;if(typeof n!=typeof e)return!1;if(typeof n=="number"&&isNaN(n)&&isNaN(e))return!0;if(n===null||e===null)return n===e;if(!(n instanceof Object)||n.constructor!==e.constructor||n.prototype!==e.prototype)return!1;if(n instanceof RegExp||n instanceof Date)return n.toString()===e.toString();if(n instanceof Array){if(n.length!==e.length)return!1;for(let t=0;t<n.length;t++)if(!Jd(n[t],e[t]))return!1}else{let t;for(t in e)if(e.hasOwnProperty(t)!==n.hasOwnProperty(t))return!1;for(t in e)if(e.hasOwnProperty(t)!==n.hasOwnProperty(t)||!Jd(n[t],e[t]))return!1}return!0}function bv(n){if(typeof n!="object"||n==null||Array.isArray(n))return n;const e=[];for(const[t,r]of Object.entries(n))e.push([t,bv(r)]);return e.sort((t,r)=>Tv(t[0],r[0])),e}function l0(n,e){n.super_=e,n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}})}function u0(n,e,...t){try{e.call(n,...t)}catch{const i=new e(...t);Object.assign(n,i)}}function d0(n){return typeof n=="number"&&isFinite(n)}function wv(n){return typeof n=="string"?(0,Zw.default)(n.normalize("NFD").replace(p0,"")):""}function h0(n){return typeof n=="string"?n.replace(/[\u202d-\u202e]/g,""):""}function f0(n){return wv(n.toLowerCase()).replace(/[\\'!"#$%&()*+,\-./:;<=>?@[\]^_`{|}~\u2000-\u206f\u2e00-\u2e7f]/g,"").toLowerCase()}const p0=/[\u2000-\u200F\u202A-\u202F\u0300-\u036F\uFEFF\u061C\s]/g;function Rv(n){return n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function g0(n,e){e=typeof e=="boolean"?e:!0;let t=Rv(n);return t=t.replace(/\\\*/g,".*"),t=t.replace(/\?/g,"."),e&&(t=t.replace(/\\\[(!|)(.*)\\]/g,function(r,i,s,o,a){const l=i&&"^"||"",u=s.replace(/\\-/,"-");return"["+l+u+"]"})),t}function m0(n){return n&&n.endsWith("/")?n.substr(0,n.length-1):n}function y0(n,e){return new Promise(t=>{setTimeout(t,n,e)})}function v0(n){return n==null}function _0(){let n,e;const t=new Promise((r,i)=>{n=r,e=i});return{resolve:n,reject:e,promise:t}}async function E0(n,e){for(const t of n)await e(await t)}function S0(n){return new Promise(e=>e(n()))}async function b0(n,e){const t=[];for(let r=0;r<n.length;r+=e)t.push(...await Promise.all(n.slice(r,r+e).map(i=>i())));return t}function w0(n){return(0,e0.default)(e=>n(e),{forever:!0,factor:2,minTimeout:3e3,maxTimeout:15e3})}let Iv;function R0(n){Iv=n}function I0(){return Iv}const Ms=(()=>{let n="";for(let e=32;e<=126;e++)n+=String.fromCharCode(e);return n})();W.DEFAULT_ALPHABET=Ms;function Xd(n,e,t=Ms){return n.padEnd(e,t[0])}function Io(n,e=Ms){const t=BigInt(e.length);if(n<=t){var r;return(r=e[Number(n)-1])!==null&&r!==void 0?r:""}let i=n/t,s=Number(n%t)-1;return s<0&&(i-=BigInt(Math.abs(s)),s=Number(t)-1),Io(i,e)+e[s]}function Fa(n,e=Ms){const t=BigInt(e.length);let r=BigInt(0);for(let i=n.length-1,s=BigInt(0);i>=0;i--,s++){const o=n.charCodeAt(i)-e.charCodeAt(0);r+=BigInt(1+o)*t**s}return r}function T0(n,e,t=Ms){const r=Math.max(n.length,e.length),i=Fa(Xd(n,r,t),t),s=Fa(Xd(e,r,t),t),o=(i+s)/BigInt(2);return o===i||o==s?Io(o,t)+t[0]:Io(o,t)}function O0(n,e=Ms){return Io(Fa(n,e)+BigInt(1),e)}function k0(n,e=Ms){return Io(Fa(n,e)-BigInt(1),e)}function Tv(n,e){return n<e?-1:n===e?0:1}const C0=new Intl.Collator;function P0(n,e){return C0.compare(n,e)}function Ov(n,e,t=!1){for(const[r,i]of Object.entries(e)){if(n[r]instanceof Object&&i){Ov(n[r],i);continue}if(i!=null||!t){n[r]=i;continue}}return n}var M0=G.exports;Object.defineProperty($o,"__esModule",{value:!0});$o.MemoryCryptoStore=void 0;var rr=M0(Y.exports),wc=ie,Ap=D0(W);function kv(n){if(typeof WeakMap!="function")return null;var e=new WeakMap,t=new WeakMap;return(kv=function(r){return r?t:e})(n)}function D0(n,e){if(!e&&n&&n.__esModule)return n;if(n===null||typeof n!="object"&&typeof n!="function")return{default:n};var t=kv(e);if(t&&t.has(n))return t.get(n);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in n)if(s!=="default"&&Object.prototype.hasOwnProperty.call(n,s)){var o=i?Object.getOwnPropertyDescriptor(n,s):null;o&&(o.get||o.set)?Object.defineProperty(r,s,o):r[s]=n[s]}return r.default=n,t&&t.set(n,r),r}function xp(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function Up(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?xp(Object(t),!0).forEach(function(r){(0,rr.default)(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):xp(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}class A0{constructor(){(0,rr.default)(this,"outgoingRoomKeyRequests",[]),(0,rr.default)(this,"account",null),(0,rr.default)(this,"crossSigningKeys",null),(0,rr.default)(this,"privateKeys",{}),(0,rr.default)(this,"sessions",{}),(0,rr.default)(this,"sessionProblems",{}),(0,rr.default)(this,"notifiedErrorDevices",{}),(0,rr.default)(this,"inboundGroupSessions",{}),(0,rr.default)(this,"inboundGroupSessionsWithheld",{}),(0,rr.default)(this,"deviceData",null),(0,rr.default)(this,"rooms",{}),(0,rr.default)(this,"sessionsNeedingBackup",{}),(0,rr.default)(this,"sharedHistoryInboundGroupSessions",{})}async startup(){return this}deleteAllData(){return Promise.resolve()}getOrAddOutgoingRoomKeyRequest(e){const t=e.requestBody;return Ap.promiseTry(()=>{const r=this._getOutgoingRoomKeyRequest(t);return r?(wc.logger.log(`already have key request outstanding for ${t.room_id} / ${t.session_id}: not sending another`),r):(wc.logger.log(`enqueueing key request for ${t.room_id} / `+t.session_id),this.outgoingRoomKeyRequests.push(e),e)})}getOutgoingRoomKeyRequest(e){return Promise.resolve(this._getOutgoingRoomKeyRequest(e))}_getOutgoingRoomKeyRequest(e){for(const t of this.outgoingRoomKeyRequests)if(Ap.deepCompare(t.requestBody,e))return t;return null}getOutgoingRoomKeyRequestByState(e){for(const t of this.outgoingRoomKeyRequests)for(const r of e)if(t.state===r)return Promise.resolve(t);return Promise.resolve(null)}getAllOutgoingRoomKeyRequestsByState(e){return Promise.resolve(this.outgoingRoomKeyRequests.filter(t=>t.state==e))}getOutgoingRoomKeyRequestsByTarget(e,t,r){const i=[];for(const s of this.outgoingRoomKeyRequests)for(const o of r)s.state===o&&s.recipients.includes({userId:e,deviceId:t})&&i.push(s);return Promise.resolve(i)}updateOutgoingRoomKeyRequest(e,t,r){for(const i of this.outgoingRoomKeyRequests)if(i.requestId===e)return i.state!==t?(wc.logger.warn(`Cannot update room key request from ${t} as it was already updated to ${i.state}`),Promise.resolve(null)):(Object.assign(i,r),Promise.resolve(i));return Promise.resolve(null)}deleteOutgoingRoomKeyRequest(e,t){for(let r=0;r<this.outgoingRoomKeyRequests.length;r++){const i=this.outgoingRoomKeyRequests[r];if(i.requestId===e)return i.state!=t?(wc.logger.warn(`Cannot delete room key request in state ${i.state} (expected ${t})`),Promise.resolve(null)):(this.outgoingRoomKeyRequests.splice(r,1),Promise.resolve(i))}return Promise.resolve(null)}getAccount(e,t){t(this.account)}storeAccount(e,t){this.account=t}getCrossSigningKeys(e,t){t(this.crossSigningKeys)}getSecretStorePrivateKey(e,t,r){const i=this.privateKeys[r];t(i||null)}storeCrossSigningKeys(e,t){this.crossSigningKeys=t}storeSecretStorePrivateKey(e,t,r){this.privateKeys[t]=r}countEndToEndSessions(e,t){t(Object.keys(this.sessions).length)}getEndToEndSession(e,t,r,i){const s=this.sessions[e]||{};i(s[t]||null)}getEndToEndSessions(e,t,r){r(this.sessions[e]||{})}getAllEndToEndSessions(e,t){Object.entries(this.sessions).forEach(([r,i])=>{Object.entries(i).forEach(([s,o])=>{t(Up(Up({},o),{},{deviceKey:r,sessionId:s}))})})}storeEndToEndSession(e,t,r,i){let s=this.sessions[e];s===void 0&&(s={},this.sessions[e]=s),s[t]=r}async storeEndToEndSessionProblem(e,t,r){const i=this.sessionProblems[e]=this.sessionProblems[e]||[];i.push({type:t,fixed:r,time:Date.now()}),i.sort((s,o)=>s.time-o.time)}async getEndToEndSessionProblem(e,t){const r=this.sessionProblems[e]||[];if(!r.length)return null;const i=r[r.length-1];for(const s of r)if(s.time>t)return Object.assign({},s,{fixed:i.fixed});return i.fixed?null:i}async filterOutNotifiedErrorDevices(e){const t=this.notifiedErrorDevices,r=[];for(const i of e){const{userId:s,deviceInfo:o}=i;s in t?o.deviceId in t[s]||(r.push(i),t[s][o.deviceId]=!0):(r.push(i),t[s]={[o.deviceId]:!0})}return r}getEndToEndInboundGroupSession(e,t,r,i){const s=e+"/"+t;i(this.inboundGroupSessions[s]||null,this.inboundGroupSessionsWithheld[s]||null)}getAllEndToEndInboundGroupSessions(e,t){for(const r of Object.keys(this.inboundGroupSessions))t({senderKey:r.substr(0,43),sessionId:r.substr(44),sessionData:this.inboundGroupSessions[r]});t(null)}addEndToEndInboundGroupSession(e,t,r,i){const s=e+"/"+t;this.inboundGroupSessions[s]===void 0&&(this.inboundGroupSessions[s]=r)}storeEndToEndInboundGroupSession(e,t,r,i){this.inboundGroupSessions[e+"/"+t]=r}storeEndToEndInboundGroupSessionWithheld(e,t,r,i){const s=e+"/"+t;this.inboundGroupSessionsWithheld[s]=r}getEndToEndDeviceData(e,t){t(this.deviceData)}storeEndToEndDeviceData(e,t){this.deviceData=e}storeEndToEndRoom(e,t,r){this.rooms[e]=t}getEndToEndRooms(e,t){t(this.rooms)}getSessionsNeedingBackup(e){const t=[];for(const r in this.sessionsNeedingBackup)if(this.inboundGroupSessions[r]&&(t.push({senderKey:r.substr(0,43),sessionId:r.substr(44),sessionData:this.inboundGroupSessions[r]}),e&&r.length>=e))break;return Promise.resolve(t)}countSessionsNeedingBackup(){return Promise.resolve(Object.keys(this.sessionsNeedingBackup).length)}unmarkSessionsNeedingBackup(e){for(const t of e){const r=t.senderKey+"/"+t.sessionId;delete this.sessionsNeedingBackup[r]}return Promise.resolve()}markSessionsNeedingBackup(e){for(const t of e){const r=t.senderKey+"/"+t.sessionId;this.sessionsNeedingBackup[r]=!0}return Promise.resolve()}addSharedHistoryInboundGroupSession(e,t,r){const i=this.sharedHistoryInboundGroupSessions[e]||[];i.push([t,r]),this.sharedHistoryInboundGroupSessions[e]=i}getSharedHistoryInboundGroupSessions(e){return Promise.resolve(this.sharedHistoryInboundGroupSessions[e]||[])}doTxn(e,t,r){return Promise.resolve(r(null))}}$o.MemoryCryptoStore=A0;var nc={},tn={},je={},Wl={exports:{}},go=typeof Reflect=="object"?Reflect:null,$p=go&&typeof go.apply=="function"?go.apply:function(e,t,r){return Function.prototype.apply.call(e,t,r)},nl;go&&typeof go.ownKeys=="function"?nl=go.ownKeys:Object.getOwnPropertySymbols?nl=function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:nl=function(e){return Object.getOwnPropertyNames(e)};function x0(n){console&&console.warn&&console.warn(n)}var Cv=Number.isNaN||function(e){return e!==e};function ke(){ke.init.call(this)}Wl.exports=ke;Wl.exports.once=L0;ke.EventEmitter=ke;ke.prototype._events=void 0;ke.prototype._eventsCount=0;ke.prototype._maxListeners=void 0;var Np=10;function Hl(n){if(typeof n!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof n)}Object.defineProperty(ke,"defaultMaxListeners",{enumerable:!0,get:function(){return Np},set:function(n){if(typeof n!="number"||n<0||Cv(n))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+n+".");Np=n}});ke.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};ke.prototype.setMaxListeners=function(e){if(typeof e!="number"||e<0||Cv(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this};function Pv(n){return n._maxListeners===void 0?ke.defaultMaxListeners:n._maxListeners}ke.prototype.getMaxListeners=function(){return Pv(this)};ke.prototype.emit=function(e){for(var t=[],r=1;r<arguments.length;r++)t.push(arguments[r]);var i=e==="error",s=this._events;if(s!==void 0)i=i&&s.error===void 0;else if(!i)return!1;if(i){var o;if(t.length>0&&(o=t[0]),o instanceof Error)throw o;var a=new Error("Unhandled error."+(o?" ("+o.message+")":""));throw a.context=o,a}var l=s[e];if(l===void 0)return!1;if(typeof l=="function")$p(l,this,t);else for(var u=l.length,c=Uv(l,u),r=0;r<u;++r)$p(c[r],this,t);return!0};function Mv(n,e,t,r){var i,s,o;if(Hl(t),s=n._events,s===void 0?(s=n._events=Object.create(null),n._eventsCount=0):(s.newListener!==void 0&&(n.emit("newListener",e,t.listener?t.listener:t),s=n._events),o=s[e]),o===void 0)o=s[e]=t,++n._eventsCount;else if(typeof o=="function"?o=s[e]=r?[t,o]:[o,t]:r?o.unshift(t):o.push(t),i=Pv(n),i>0&&o.length>i&&!o.warned){o.warned=!0;var a=new Error("Possible EventEmitter memory leak detected. "+o.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");a.name="MaxListenersExceededWarning",a.emitter=n,a.type=e,a.count=o.length,x0(a)}return n}ke.prototype.addListener=function(e,t){return Mv(this,e,t,!1)};ke.prototype.on=ke.prototype.addListener;ke.prototype.prependListener=function(e,t){return Mv(this,e,t,!0)};function U0(){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 Dv(n,e,t){var r={fired:!1,wrapFn:void 0,target:n,type:e,listener:t},i=U0.bind(r);return i.listener=t,r.wrapFn=i,i}ke.prototype.once=function(e,t){return Hl(t),this.on(e,Dv(this,e,t)),this};ke.prototype.prependOnceListener=function(e,t){return Hl(t),this.prependListener(e,Dv(this,e,t)),this};ke.prototype.removeListener=function(e,t){var r,i,s,o,a;if(Hl(t),i=this._events,i===void 0)return this;if(r=i[e],r===void 0)return this;if(r===t||r.listener===t)--this._eventsCount===0?this._events=Object.create(null):(delete i[e],i.removeListener&&this.emit("removeListener",e,r.listener||t));else if(typeof r!="function"){for(s=-1,o=r.length-1;o>=0;o--)if(r[o]===t||r[o].listener===t){a=r[o].listener,s=o;break}if(s<0)return this;s===0?r.shift():$0(r,s),r.length===1&&(i[e]=r[0]),i.removeListener!==void 0&&this.emit("removeListener",e,a||t)}return this};ke.prototype.off=ke.prototype.removeListener;ke.prototype.removeAllListeners=function(e){var t,r,i;if(r=this._events,r===void 0)return this;if(r.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):r[e]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete r[e]),this;if(arguments.length===0){var s=Object.keys(r),o;for(i=0;i<s.length;++i)o=s[i],o!=="removeListener"&&this.removeAllListeners(o);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(t=r[e],typeof t=="function")this.removeListener(e,t);else if(t!==void 0)for(i=t.length-1;i>=0;i--)this.removeListener(e,t[i]);return this};function Av(n,e,t){var r=n._events;if(r===void 0)return[];var i=r[e];return i===void 0?[]:typeof i=="function"?t?[i.listener||i]:[i]:t?N0(i):Uv(i,i.length)}ke.prototype.listeners=function(e){return Av(this,e,!0)};ke.prototype.rawListeners=function(e){return Av(this,e,!1)};ke.listenerCount=function(n,e){return typeof n.listenerCount=="function"?n.listenerCount(e):xv.call(n,e)};ke.prototype.listenerCount=xv;function xv(n){var e=this._events;if(e!==void 0){var t=e[n];if(typeof t=="function")return 1;if(t!==void 0)return t.length}return 0}ke.prototype.eventNames=function(){return this._eventsCount>0?nl(this._events):[]};function Uv(n,e){for(var t=new Array(e),r=0;r<e;++r)t[r]=n[r];return t}function $0(n,e){for(;e+1<n.length;e++)n[e]=n[e+1];n.pop()}function N0(n){for(var e=new Array(n.length),t=0;t<e.length;++t)e[t]=n[t].listener||n[t];return e}function L0(n,e){return new Promise(function(t,r){function i(o){n.removeListener(e,s),r(o)}function s(){typeof n.removeListener=="function"&&n.removeListener("error",i),t([].slice.call(arguments))}$v(n,e,s,{once:!0}),e!=="error"&&B0(n,i,{once:!0})})}function B0(n,e,t){typeof n.on=="function"&&$v(n,"error",e,t)}function $v(n,e,t,r){if(typeof n.on=="function")r.once?n.once(e,t):n.on(e,t);else if(typeof n.addEventListener=="function")n.addEventListener(e,function i(s){r.once&&n.removeEventListener(e,i),t(s)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof n)}Object.defineProperty(je,"__esModule",{value:!0});je.TypedEventEmitter=je.EventEmitterEvents=void 0;var K0=Wl.exports;let Qd;je.EventEmitterEvents=Qd;(function(n){n.NewListener="newListener",n.RemoveListener="removeListener",n.Error="error"})(Qd||(je.EventEmitterEvents=Qd={}));class F0 extends K0.EventEmitter{addListener(e,t){return super.addListener(e,t)}emit(e,...t){return super.emit(e,...t)}eventNames(){return super.eventNames()}listenerCount(e){return super.listenerCount(e)}listeners(e){return super.listeners(e)}off(e,t){return super.off(e,t)}on(e,t){return super.on(e,t)}once(e,t){return super.once(e,t)}prependListener(e,t){return super.prependListener(e,t)}prependOnceListener(e,t){return super.prependOnceListener(e,t)}removeAllListeners(e){return super.removeAllListeners(e)}removeListener(e,t){return super.removeListener(e,t)}rawListeners(e){return super.rawListeners(e)}}je.TypedEventEmitter=F0;var q0=G.exports;Object.defineProperty(tn,"__esModule",{value:!0});tn.UserEvent=tn.User=void 0;var Gr=q0(Y.exports),j0=je;let Gn;tn.UserEvent=Gn;(function(n){n.DisplayName="User.displayName",n.AvatarUrl="User.avatarUrl",n.Presence="User.presence",n.CurrentlyActive="User.currentlyActive",n.LastPresenceTs="User.lastPresenceTs",n._UnstableStatusMessage="User.unstable_statusMessage"})(Gn||(tn.UserEvent=Gn={}));class V0 extends j0.TypedEventEmitter{constructor(e){super(),this.userId=e,(0,Gr.default)(this,"modified",void 0),(0,Gr.default)(this,"displayName",void 0),(0,Gr.default)(this,"rawDisplayName",void 0),(0,Gr.default)(this,"avatarUrl",void 0),(0,Gr.default)(this,"presenceStatusMsg",null),(0,Gr.default)(this,"presence","offline"),(0,Gr.default)(this,"lastActiveAgo",0),(0,Gr.default)(this,"lastPresenceTs",0),(0,Gr.default)(this,"currentlyActive",!1),(0,Gr.default)(this,"events",{presence:null,profile:null}),(0,Gr.default)(this,"unstable_statusMessage",""),this.displayName=e,this.rawDisplayName=e,this.avatarUrl=null,this.updateModifiedTime()}setPresenceEvent(e){if(e.getType()!=="m.presence")return;const t=this.events.presence===null;this.events.presence=e;const r=[];(e.getContent().presence!==this.presence||t)&&r.push(Gn.Presence),e.getContent().avatar_url&&e.getContent().avatar_url!==this.avatarUrl&&r.push(Gn.AvatarUrl),e.getContent().displayname&&e.getContent().displayname!==this.displayName&&r.push(Gn.DisplayName),e.getContent().currently_active!==void 0&&e.getContent().currently_active!==this.currentlyActive&&r.push(Gn.CurrentlyActive),this.presence=e.getContent().presence,r.push(Gn.LastPresenceTs),e.getContent().status_msg&&(this.presenceStatusMsg=e.getContent().status_msg),e.getContent().displayname&&(this.displayName=e.getContent().displayname),e.getContent().avatar_url&&(this.avatarUrl=e.getContent().avatar_url),this.lastActiveAgo=e.getContent().last_active_ago,this.lastPresenceTs=Date.now(),this.currentlyActive=e.getContent().currently_active,this.updateModifiedTime();for(let i=0;i<r.length;i++)this.emit(r[i],e,this)}setDisplayName(e){const t=this.displayName;typeof e=="string"?this.displayName=e:this.displayName=void 0,e!==t&&this.updateModifiedTime()}setRawDisplayName(e){typeof e=="string"?this.rawDisplayName=e:this.rawDisplayName=void 0}setAvatarUrl(e){const t=this.avatarUrl;this.avatarUrl=e,e!==t&&this.updateModifiedTime()}updateModifiedTime(){this.modified=Date.now()}getLastModifiedTime(){return this.modified}getLastActiveTs(){return this.lastPresenceTs-this.lastActiveAgo}unstable_updateStatusMessage(e){e.getContent()?this.unstable_statusMessage=e.getContent().status:this.unstable_statusMessage="",this.updateModifiedTime(),this.emit(Gn._UnstableStatusMessage,this)}}tn.User=V0;var Tn={},rn={},No={};Object.defineProperty(No,"__esModule",{value:!0});No.getHttpUriForMxc=H0;var G0=W0(W);function Nv(n){if(typeof WeakMap!="function")return null;var e=new WeakMap,t=new WeakMap;return(Nv=function(r){return r?t:e})(n)}function W0(n,e){if(!e&&n&&n.__esModule)return n;if(n===null||typeof n!="object"&&typeof n!="function")return{default:n};var t=Nv(e);if(t&&t.has(n))return t.get(n);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in n)if(s!=="default"&&Object.prototype.hasOwnProperty.call(n,s)){var o=i?Object.getOwnPropertyDescriptor(n,s):null;o&&(o.get||o.set)?Object.defineProperty(r,s,o):r[s]=n[s]}return r.default=n,t&&t.set(n,r),r}function H0(n,e,t,r,i,s=!1){if(typeof e!="string"||!e)return"";if(e.indexOf("mxc://")!==0)return s?e:"";let o=e.slice(6),a="/_matrix/media/r0/download/";const l={};t&&(l.width=Math.round(t).toString()),r&&(l.height=Math.round(r).toString()),i&&(l.method=i),Object.keys(l).length>0&&(a="/_matrix/media/r0/thumbnail/");const u=o.indexOf("#");let c="";u>=0&&(c=o.substr(u),o=o.substr(0,u));const g=Object.keys(l).length===0?"":"?"+G0.encodeParams(l);return n+a+o+g+c}var ne={},wr={},Y0=G.exports;Object.defineProperty(wr,"__esModule",{value:!0});wr.UnstableValue=wr.ServerControlledNamespacedValue=wr.NamespacedValue=void 0;var z0=Y0(Y.exports);class bf{constructor(e,t){if(this.stable=e,this.unstable=t,!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}matches(e){return this.name===e||this.altName===e}findIn(e){let t;return this.name&&(t=e==null?void 0:e[this.name]),!t&&this.altName&&(t=e==null?void 0:e[this.altName]),t}includedIn(e){let t=!1;return this.name&&(t=e.includes(this.name)),!t&&this.altName&&(t=e.includes(this.altName)),t}}wr.NamespacedValue=bf;class J0 extends bf{constructor(...e){super(...e),(0,z0.default)(this,"preferUnstable",!1)}setPreferUnstable(e){this.preferUnstable=e}get name(){return this.stable&&!this.preferUnstable?this.stable:this.unstable}}wr.ServerControlledNamespacedValue=J0;class X0 extends bf{constructor(e,t){if(super(e,t),!this.unstable)throw new Error("Unstable value must be supplied")}get name(){return this.unstable}get altName(){return this.stable}}wr.UnstableValue=X0;Object.defineProperty(ne,"__esModule",{value:!0});ne.UNSTABLE_MSC3089_TREE_SUBTYPE=ne.UNSTABLE_MSC3089_LEAF=ne.UNSTABLE_MSC3089_BRANCH=ne.UNSTABLE_MSC3088_PURPOSE=ne.UNSTABLE_MSC3088_ENABLED=ne.UNSTABLE_ELEMENT_FUNCTIONAL_USERS=ne.RoomType=ne.RoomCreateTypeField=ne.RelationType=ne.MsgType=ne.EventType=ne.EVENT_VISIBILITY_CHANGE_TYPE=void 0;var Ds=wr;let Zd;ne.EventType=Zd;(function(n){n.RoomCanonicalAlias="m.room.canonical_alias",n.RoomCreate="m.room.create",n.RoomJoinRules="m.room.join_rules",n.RoomMember="m.room.member",n.RoomThirdPartyInvite="m.room.third_party_invite",n.RoomPowerLevels="m.room.power_levels",n.RoomName="m.room.name",n.RoomTopic="m.room.topic",n.RoomAvatar="m.room.avatar",n.RoomPinnedEvents="m.room.pinned_events",n.RoomEncryption="m.room.encryption",n.RoomHistoryVisibility="m.room.history_visibility",n.RoomGuestAccess="m.room.guest_access",n.RoomServerAcl="m.room.server_acl",n.RoomTombstone="m.room.tombstone",n.RoomAliases="m.room.aliases",n.SpaceChild="m.space.child",n.SpaceParent="m.space.parent",n.RoomRedaction="m.room.redaction",n.RoomMessage="m.room.message",n.RoomMessageEncrypted="m.room.encrypted",n.Sticker="m.sticker",n.CallInvite="m.call.invite",n.CallCandidates="m.call.candidates",n.CallAnswer="m.call.answer",n.CallHangup="m.call.hangup",n.CallReject="m.call.reject",n.CallSelectAnswer="m.call.select_answer",n.CallNegotiate="m.call.negotiate",n.CallSDPStreamMetadataChanged="m.call.sdp_stream_metadata_changed",n.CallSDPStreamMetadataChangedPrefix="org.matrix.call.sdp_stream_metadata_changed",n.CallReplaces="m.call.replaces",n.CallAssertedIdentity="m.call.asserted_identity",n.CallAssertedIdentityPrefix="org.matrix.call.asserted_identity",n.KeyVerificationRequest="m.key.verification.request",n.KeyVerificationStart="m.key.verification.start",n.KeyVerificationCancel="m.key.verification.cancel",n.KeyVerificationMac="m.key.verification.mac",n.KeyVerificationDone="m.key.verification.done",n.RoomMessageFeedback="m.room.message.feedback",n.Reaction="m.reaction",n.Typing="m.typing",n.Receipt="m.receipt",n.Presence="m.presence",n.FullyRead="m.fully_read",n.Tag="m.tag",n.SpaceOrder="org.matrix.msc3230.space_order",n.PushRules="m.push_rules",n.Direct="m.direct",n.IgnoredUserList="m.ignored_user_list",n.RoomKey="m.room_key",n.RoomKeyRequest="m.room_key_request",n.ForwardedRoomKey="m.forwarded_room_key",n.Dummy="m.dummy"})(Zd||(ne.EventType=Zd={}));let eh;ne.RelationType=eh;(function(n){n.Annotation="m.annotation",n.Replace="m.replace",n.Reference="m.reference",n.Thread="io.element.thread"})(eh||(ne.RelationType=eh={}));let th;ne.MsgType=th;(function(n){n.Text="m.text",n.Emote="m.emote",n.Notice="m.notice",n.Image="m.image",n.File="m.file",n.Audio="m.audio",n.Location="m.location",n.Video="m.video",n.KeyVerificationRequest="m.key.verification.request"})(th||(ne.MsgType=th={}));const Q0="type";ne.RoomCreateTypeField=Q0;let rh;ne.RoomType=rh;(function(n){n.Space="m.space"})(rh||(ne.RoomType=rh={}));const Z0=new Ds.UnstableValue("m.room.purpose","org.matrix.msc3088.purpose");ne.UNSTABLE_MSC3088_PURPOSE=Z0;const eR=new Ds.UnstableValue("m.enabled","org.matrix.msc3088.enabled");ne.UNSTABLE_MSC3088_ENABLED=eR;const tR=new Ds.UnstableValue("m.data_tree","org.matrix.msc3089.data_tree");ne.UNSTABLE_MSC3089_TREE_SUBTYPE=tR;const rR=new Ds.UnstableValue("m.leaf","org.matrix.msc3089.leaf");ne.UNSTABLE_MSC3089_LEAF=rR;const nR=new Ds.UnstableValue("m.branch","org.matrix.msc3089.branch");ne.UNSTABLE_MSC3089_BRANCH=nR;const iR=new Ds.UnstableValue("io.element.functional_members","io.element.functional_members");ne.UNSTABLE_ELEMENT_FUNCTIONAL_USERS=iR;const sR=new Ds.UnstableValue("m.visibility","org.matrix.msc3531.visibility");ne.EVENT_VISIBILITY_CHANGE_TYPE=sR;var oR=G.exports;Object.defineProperty(rn,"__esModule",{value:!0});rn.RoomMemberEvent=rn.RoomMember=void 0;var Or=oR(Y.exports),aR=No,mo=dR(W),cR=ie,lR=je,uR=ne;function Lv(n){if(typeof WeakMap!="function")return null;var e=new WeakMap,t=new WeakMap;return(Lv=function(r){return r?t:e})(n)}function dR(n,e){if(!e&&n&&n.__esModule)return n;if(n===null||typeof n!="object"&&typeof n!="function")return{default:n};var t=Lv(e);if(t&&t.has(n))return t.get(n);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in n)if(s!=="default"&&Object.prototype.hasOwnProperty.call(n,s)){var o=i?Object.getOwnPropertyDescriptor(n,s):null;o&&(o.get||o.set)?Object.defineProperty(r,s,o):r[s]=n[s]}return r.default=n,t&&t.set(n,r),r}let ls;rn.RoomMemberEvent=ls;(function(n){n.Membership="RoomMember.membership",n.Name="RoomMember.name",n.PowerLevel="RoomMember.powerLevel",n.Typing="RoomMember.typing"})(ls||(rn.RoomMemberEvent=ls={}));class hR extends lR.TypedEventEmitter{constructor(e,t){super(),this.roomId=e,this.userId=t,(0,Or.default)(this,"_isOutOfBand",!1),(0,Or.default)(this,"_modified",void 0),(0,Or.default)(this,"_requestedProfileInfo",void 0),(0,Or.default)(this,"typing",!1),(0,Or.default)(this,"name",void 0),(0,Or.default)(this,"rawDisplayName",void 0),(0,Or.default)(this,"powerLevel",0),(0,Or.default)(this,"powerLevelNorm",0),(0,Or.default)(this,"user",null),(0,Or.default)(this,"membership",null),(0,Or.default)(this,"disambiguate",!1),(0,Or.default)(this,"events",{member:null}),this.name=t,this.rawDisplayName=t,this.updateModifiedTime()}markOutOfBand(){this._isOutOfBand=!0}isOutOfBand(){return this._isOutOfBand}setMembershipEvent(e,t){const r=e.getDirectionalContent().displayname;if(e.getType()!==uR.EventType.RoomMember)return;this._isOutOfBand=!1,this.events.member=e;const i=this.membership;this.membership=e.getDirectionalContent().membership,this.membership===void 0&&cR.logger.trace(`membership event with membership undefined (forwardLooking: ${e.forwardLooking})!`,e.getContent(),"prevcontent is ",e.getPrevContent()),this.disambiguate=gR(this.userId,r,t);const s=this.name;this.name=mR(this.userId,r,t,this.disambiguate),this.rawDisplayName=mo.removeDirectionOverrideChars(e.getDirectionalContent().displayname),(!this.rawDisplayName||!mo.removeHiddenChars(this.rawDisplayName))&&(this.rawDisplayName=this.userId),i!==this.membership&&(this.updateModifiedTime(),this.emit(ls.Membership,e,this,i)),s!==this.name&&(this.updateModifiedTime(),this.emit(ls.Name,e,this,s))}setPowerLevelEvent(e){if(e.getType()!=="m.room.power_levels")return;const t=e.getDirectionalContent();let r=t.users_default||0;const i=t.users||{};Object.values(i).forEach(function(a){r=Math.max(r,a)});const s=this.powerLevel,o=this.powerLevelNorm;i[this.userId]!==void 0&&Number.isInteger(i[this.userId])?this.powerLevel=i[this.userId]:t.users_default!==void 0?this.powerLevel=t.users_default:this.powerLevel=0,this.powerLevelNorm=0,r>0&&(this.powerLevelNorm=this.powerLevel*100/r),(s!==this.powerLevel||o!==this.powerLevelNorm)&&(this.updateModifiedTime(),this.emit(ls.PowerLevel,e,this))}setTypingEvent(e){if(e.getType()!=="m.typing")return;const t=this.typing;this.typing=!1;const r=e.getContent().user_ids;!Array.isArray(r)||(r.indexOf(this.userId)!==-1&&(this.typing=!0),t!==this.typing&&(this.updateModifiedTime(),this.emit(ls.Typing,e,this)))}updateModifiedTime(){this._modified=Date.now()}getLastModifiedTime(){return this._modified}isKicked(){return this.membership==="leave"&&this.events.member.getSender()!==this.events.member.getStateKey()}getDMInviter(){if(this.events.member){const e=this.events.member;let t=e.getContent(),r=e.getSender();if(t.membership==="join"&&(t=e.getPrevContent(),r=e.getUnsigned().prev_sender),t.membership==="invite"&&t.is_direct)return r}}getAvatarUrl(e,t,r,i,s=!0,o){const a=this.getMxcAvatarUrl();if(!a&&!s)return null;const l=(0,aR.getHttpUriForMxc)(e,a,t,r,i,o);return l||null}getMxcAvatarUrl(){return this.events.member?this.events.member.getDirectionalContent().avatar_url:this.user?this.user.avatarUrl:null}}rn.RoomMember=hR;const fR=/@.+:.+/,pR=/[\u200E\u200F\u202A-\u202F]/;function gR(n,e,t){return!e||e===n||!mo.removeHiddenChars(e)||!t?!1:!!(fR.test(e)||pR.test(e)||t.getUserIdsWithDisplayName(e).some(i=>i!==n))}function mR(n,e,t,r){return r?mo.removeDirectionOverrideChars(e)+" ("+n+")":!e||e===n||!mo.removeHiddenChars(e)?n:mo.removeDirectionOverrideChars(e)}var Je={};Object.defineProperty(Je,"__esModule",{value:!0});Je.Visibility=Je.RestrictedAllowType=Je.Preset=Je.JoinRule=Je.HistoryVisibility=Je.GuestAccess=void 0;let nh;Je.Visibility=nh;(function(n){n.Public="public",n.Private="private"})(nh||(Je.Visibility=nh={}));let ih;Je.Preset=ih;(function(n){n.PrivateChat="private_chat",n.TrustedPrivateChat="trusted_private_chat",n.PublicChat="public_chat"})(ih||(Je.Preset=ih={}));let sh;Je.JoinRule=sh;(function(n){n.Public="public",n.Invite="invite",n.Private="private",n.Knock="knock",n.Restricted="restricted"})(sh||(Je.JoinRule=sh={}));let oh;Je.RestrictedAllowType=oh;(function(n){n.RoomMembership="m.room_membership"})(oh||(Je.RestrictedAllowType=oh={}));let ah;Je.GuestAccess=ah;(function(n){n.CanJoin="can_join",n.Forbidden="forbidden"})(ah||(Je.GuestAccess=ah={}));let ch;Je.HistoryVisibility=ch;(function(n){n.Invited="invited",n.Joined="joined",n.Shared="shared",n.WorldReadable="world_readable"})(ch||(Je.HistoryVisibility=ch={}));var br={},In={};Object.defineProperty(In,"__esModule",{value:!0});In.M_BEACON_INFO_VARIABLE=In.M_BEACON_INFO=In.M_BEACON=void 0;var wf=wr;const yR=new wf.UnstableValue("m.beacon_info.*","org.matrix.msc3489.beacon_info.*");In.M_BEACON_INFO_VARIABLE=yR;const vR=new wf.UnstableValue("m.beacon_info","org.matrix.msc3489.beacon_info");In.M_BEACON_INFO=vR;const _R=new wf.UnstableValue("m.beacon","org.matrix.msc3489.beacon");In.M_BEACON=_R;var Xe={},Yl={},zl={},ic={};Object.defineProperty(ic,"__esModule",{value:!0});ic.NamespacedMap=void 0;function ER(n,e){var t=typeof Symbol!="undefined"&&n[Symbol.iterator]||n["@@iterator"];if(!t){if(Array.isArray(n)||(t=SR(n))||e&&n&&typeof n.length=="number"){t&&(n=t);var r=0,i=function(){};return{s:i,n:function(){return r>=n.length?{done:!0}:{done:!1,value:n[r++]}},e:function(u){throw u},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
+In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var s=!0,o=!1,a;return{s:function(){t=t.call(n)},n:function(){var u=t.next();return s=u.done,u},e:function(u){o=!0,a=u},f:function(){try{!s&&t.return!=null&&t.return()}finally{if(o)throw a}}}}function SR(n,e){if(!!n){if(typeof n=="string")return Lp(n,e);var t=Object.prototype.toString.call(n).slice(8,-1);if(t==="Object"&&n.constructor&&(t=n.constructor.name),t==="Map"||t==="Set")return Array.from(n);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return Lp(n,e)}}function Lp(n,e){(e==null||e>n.length)&&(e=n.length);for(var t=0,r=new Array(e);t<e;t++)r[t]=n[t];return r}function bR(n,e){if(!(n instanceof e))throw new TypeError("Cannot call a class as a function")}function Bp(n,e){for(var t=0;t<e.length;t++){var r=e[t];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(n,r.key,r)}}function wR(n,e,t){return e&&Bp(n.prototype,e),t&&Bp(n,t),Object.defineProperty(n,"prototype",{writable:!1}),n}function RR(n,e,t){return e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}var IR=function(){function n(e){if(bR(this,n),RR(this,"internalMap",new Map),e){var t=ER(e),r;try{for(t.s();!(r=t.n()).done;){var i=r.value;this.set(i[0],i[1])}}catch(s){t.e(s)}finally{t.f()}}}return wR(n,[{key:"get",value:function(t){return t.name&&this.internalMap.has(t.name)?this.internalMap.get(t.name):t.altName&&this.internalMap.has(t.altName)?this.internalMap.get(t.altName):null}},{key:"set",value:function(t,r){t.name&&this.internalMap.set(t.name,r),t.altName&&this.internalMap.set(t.altName,r)}},{key:"has",value:function(t){return!!this.get(t)}},{key:"delete",value:function(t){t.name&&this.internalMap.delete(t.name),t.altName&&this.internalMap.delete(t.altName)}},{key:"hasNamespaced",value:function(t){return this.internalMap.has(t)}},{key:"getNamespaced",value:function(t){return this.internalMap.get(t)}}]),n}();ic.NamespacedMap=IR;var oi={};function lh(n){return lh=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},lh(n)}Object.defineProperty(oi,"__esModule",{value:!0});oi.InvalidEventError=void 0;function Kp(n,e){for(var t=0;t<e.length;t++){var r=e[t];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(n,r.key,r)}}function TR(n,e,t){return e&&Kp(n.prototype,e),t&&Kp(n,t),Object.defineProperty(n,"prototype",{writable:!1}),n}function OR(n,e){if(!(n instanceof e))throw new TypeError("Cannot call a class as a function")}function kR(n,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");n.prototype=Object.create(e&&e.prototype,{constructor:{value:n,writable:!0,configurable:!0}}),Object.defineProperty(n,"prototype",{writable:!1}),e&&qa(n,e)}function CR(n){var e=Bv();return function(){var r=ja(n),i;if(e){var s=ja(this).constructor;i=Reflect.construct(r,arguments,s)}else i=r.apply(this,arguments);return PR(this,i)}}function PR(n,e){if(e&&(lh(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return MR(n)}function MR(n){if(n===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return n}function uh(n){var e=typeof Map=="function"?new Map:void 0;return uh=function(r){if(r===null||!DR(r))return r;if(typeof r!="function")throw new TypeError("Super expression must either be null or a function");if(typeof e!="undefined"){if(e.has(r))return e.get(r);e.set(r,i)}function i(){return il(r,arguments,ja(this).constructor)}return i.prototype=Object.create(r.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),qa(i,r)},uh(n)}function il(n,e,t){return Bv()?il=Reflect.construct:il=function(i,s,o){var a=[null];a.push.apply(a,s);var l=Function.bind.apply(i,a),u=new l;return o&&qa(u,o.prototype),u},il.apply(null,arguments)}function Bv(){if(typeof Reflect=="undefined"||!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 DR(n){return Function.toString.call(n).indexOf("[native code]")!==-1}function qa(n,e){return qa=Object.setPrototypeOf||function(r,i){return r.__proto__=i,r},qa(n,e)}function ja(n){return ja=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},ja(n)}var AR=function(n){kR(t,n);var e=CR(t);function t(r){return OR(this,t),e.call(this,r)}return TR(t)}(uh(Error));oi.InvalidEventError=AR;var Lo={},Cn={},ji={};Object.defineProperty(ji,"__esModule",{value:!0});ji.ExtensibleEvent=void 0;function xR(n,e){if(!(n instanceof e))throw new TypeError("Cannot call a class as a function")}function Fp(n,e){for(var t=0;t<e.length;t++){var r=e[t];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(n,r.key,r)}}function UR(n,e,t){return e&&Fp(n.prototype,e),t&&Fp(n,t),Object.defineProperty(n,"prototype",{writable:!1}),n}var $R=function(){function n(e){xR(this,n),this.wireFormat=e}return UR(n,[{key:"wireContent",get:function(){return this.wireFormat.content}}]),n}();ji.ExtensibleEvent=$R;var sc={};Object.defineProperty(sc,"__esModule",{value:!0});sc.isOptionalAString=NR;sc.isProvided=Kv;function NR(n){return Kv(n)&&typeof n=="string"}function Kv(n){return n!=null}var rt={},nn={};function dh(n){return dh=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},dh(n)}Object.defineProperty(nn,"__esModule",{value:!0});nn.UnstableValue=nn.NamespacedValue=void 0;function LR(n,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");n.prototype=Object.create(e&&e.prototype,{constructor:{value:n,writable:!0,configurable:!0}}),Object.defineProperty(n,"prototype",{writable:!1}),e&&hh(n,e)}function hh(n,e){return hh=Object.setPrototypeOf||function(r,i){return r.__proto__=i,r},hh(n,e)}function BR(n){var e=qR();return function(){var r=kl(n),i;if(e){var s=kl(this).constructor;i=Reflect.construct(r,arguments,s)}else i=r.apply(this,arguments);return KR(this,i)}}function KR(n,e){if(e&&(dh(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return FR(n)}function FR(n){if(n===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return n}function qR(){if(typeof Reflect=="undefined"||!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 kl(n){return kl=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},kl(n)}function Fv(n,e){if(!(n instanceof e))throw new TypeError("Cannot call a class as a function")}function qp(n,e){for(var t=0;t<e.length;t++){var r=e[t];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(n,r.key,r)}}function qv(n,e,t){return e&&qp(n.prototype,e),t&&qp(n,t),Object.defineProperty(n,"prototype",{writable:!1}),n}var jv=function(){function n(e,t){if(Fv(this,n),this.stable=e,this.unstable=t,!this.unstable&&!this.stable)throw new Error("One of stable or unstable values must be supplied")}return qv(n,[{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(t){return!!this.name&&this.name===t||!!this.altName&&this.altName===t}},{key:"findIn",value:function(t){var r;return this.name&&(r=t==null?void 0:t[this.name]),!r&&this.altName&&(r=t==null?void 0:t[this.altName]),r}},{key:"includedIn",value:function(t){var r=!1;return this.name&&(r=t.includes(this.name)),!r&&this.altName&&(r=t.includes(this.altName)),r}}]),n}();nn.NamespacedValue=jv;var jR=function(n){LR(t,n);var e=BR(t);function t(r,i){var s;if(Fv(this,t),s=e.call(this,r,i),!s.unstable)throw new Error("Unstable value must be supplied");return s}return qv(t,[{key:"name",get:function(){return this.unstable}},{key:"altName",get:function(){return this.stable}}]),t}(jv);nn.UnstableValue=jR;Object.defineProperty(rt,"__esModule",{value:!0});rt.M_TEXT=rt.M_NOTICE=rt.M_MESSAGE=rt.M_HTML=rt.M_EMOTE=void 0;var oc=nn,VR=new oc.UnstableValue("m.message","org.matrix.msc1767.message");rt.M_MESSAGE=VR;var GR=new oc.UnstableValue("m.text","org.matrix.msc1767.text");rt.M_TEXT=GR;var WR=new oc.UnstableValue("m.html","org.matrix.msc1767.html");rt.M_HTML=WR;var HR=new oc.UnstableValue("m.emote","org.matrix.msc1767.emote");rt.M_EMOTE=HR;var YR=new oc.UnstableValue("m.notice","org.matrix.msc1767.notice");rt.M_NOTICE=YR;var ai={};Object.defineProperty(ai,"__esModule",{value:!0});ai.isEventTypeSame=zR;function zR(n,e){if(typeof n=="string")return typeof e=="string"?e===n:e.matches(n);if(typeof e=="string")return n.matches(e);var t=e,r=n;return t.matches(r.name)||t.matches(r.altName)}function fh(n){return fh=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},fh(n)}Object.defineProperty(Cn,"__esModule",{value:!0});Cn.MessageEvent=void 0;var JR=ji,Jo=sc,qu=oi,yr=rt,XR=ai;function jp(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function Vp(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?jp(Object(t),!0).forEach(function(r){ki(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):jp(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function QR(n,e){if(!(n instanceof e))throw new TypeError("Cannot call a class as a function")}function Gp(n,e){for(var t=0;t<e.length;t++){var r=e[t];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(n,r.key,r)}}function ZR(n,e,t){return e&&Gp(n.prototype,e),t&&Gp(n,t),Object.defineProperty(n,"prototype",{writable:!1}),n}function eI(n,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");n.prototype=Object.create(e&&e.prototype,{constructor:{value:n,writable:!0,configurable:!0}}),Object.defineProperty(n,"prototype",{writable:!1}),e&&ph(n,e)}function ph(n,e){return ph=Object.setPrototypeOf||function(r,i){return r.__proto__=i,r},ph(n,e)}function tI(n){var e=nI();return function(){var r=Cl(n),i;if(e){var s=Cl(this).constructor;i=Reflect.construct(r,arguments,s)}else i=r.apply(this,arguments);return rI(this,i)}}function rI(n,e){if(e&&(fh(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return sl(n)}function sl(n){if(n===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return n}function nI(){if(typeof Reflect=="undefined"||!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 Cl(n){return Cl=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},Cl(n)}function ki(n,e,t){return e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}var iI=function(n){eI(t,n);var e=tI(t);function t(r){var i;QR(this,t),i=e.call(this,r),ki(sl(i),"text",void 0),ki(sl(i),"html",void 0),ki(sl(i),"renderings",void 0);var s=yr.M_MESSAGE.findIn(i.wireContent),o=yr.M_TEXT.findIn(i.wireContent),a=yr.M_HTML.findIn(i.wireContent);if((0,Jo.isProvided)(s)){if(!Array.isArray(s))throw new qu.InvalidEventError("m.message contents must be an array");var l=s.find(function(c){return!(0,Jo.isProvided)(c.mimetype)||c.mimetype==="text/plain"}),u=s.find(function(c){return c.mimetype==="text/html"});if(!l)throw new qu.InvalidEventError("m.message is missing a plain text representation");i.text=l.body,i.html=u==null?void 0:u.body,i.renderings=s}else if((0,Jo.isOptionalAString)(o))i.text=o,i.html=a,i.renderings=[{body:o,mimetype:"text/plain"}],i.html&&i.renderings.push({body:i.html,mimetype:"text/html"});else throw new qu.InvalidEventError("Missing textual representation for event");return i}return ZR(t,[{key:"isEmote",get:function(){return yr.M_EMOTE.matches(this.wireFormat.type)||(0,Jo.isProvided)(yr.M_EMOTE.findIn(this.wireFormat.content))}},{key:"isNotice",get:function(){return yr.M_NOTICE.matches(this.wireFormat.type)||(0,Jo.isProvided)(yr.M_NOTICE.findIn(this.wireFormat.content))}},{key:"isEquivalentTo",value:function(i){return(0,XR.isEventTypeSame)(i,yr.M_MESSAGE)}},{key:"serializeMMessageOnly",value:function(){var i=ki({},yr.M_MESSAGE.name,this.renderings);if(this.renderings.length===1){var s=this.renderings[0].mimetype;(s===void 0||s==="text/plain")&&(i=ki({},yr.M_TEXT.name,this.renderings[0].body))}return i}},{key:"serialize",value:function(){var i;return{type:"m.room.message",content:Vp(Vp({},this.serializeMMessageOnly()),{},{body:this.text,msgtype:"m.text",format:this.html?"org.matrix.custom.html":void 0,formatted_body:(i=this.html)!==null&&i!==void 0?i:void 0})}}}],[{key:"from",value:function(i,s){var o;return new t({type:yr.M_MESSAGE.name,content:(o={},ki(o,yr.M_TEXT.name,i),ki(o,yr.M_HTML.name,s),o)})}}]),t}(JR.ExtensibleEvent);Cn.MessageEvent=iI;var Bo={};function gh(n){return gh=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},gh(n)}Object.defineProperty(Bo,"__esModule",{value:!0});Bo.NoticeEvent=void 0;var sI=Cn,Rc=rt,oI=ai;function Wp(n,e,t){return e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function aI(n,e){if(!(n instanceof e))throw new TypeError("Cannot call a class as a function")}function Hp(n,e){for(var t=0;t<e.length;t++){var r=e[t];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(n,r.key,r)}}function cI(n,e,t){return e&&Hp(n.prototype,e),t&&Hp(n,t),Object.defineProperty(n,"prototype",{writable:!1}),n}function Ma(){return typeof Reflect!="undefined"&&Reflect.get?Ma=Reflect.get:Ma=function(e,t,r){var i=lI(e,t);if(!!i){var s=Object.getOwnPropertyDescriptor(i,t);return s.get?s.get.call(arguments.length<3?e:r):s.value}},Ma.apply(this,arguments)}function lI(n,e){for(;!Object.prototype.hasOwnProperty.call(n,e)&&(n=ps(n),n!==null););return n}function uI(n,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");n.prototype=Object.create(e&&e.prototype,{constructor:{value:n,writable:!0,configurable:!0}}),Object.defineProperty(n,"prototype",{writable:!1}),e&&mh(n,e)}function mh(n,e){return mh=Object.setPrototypeOf||function(r,i){return r.__proto__=i,r},mh(n,e)}function dI(n){var e=pI();return function(){var r=ps(n),i;if(e){var s=ps(this).constructor;i=Reflect.construct(r,arguments,s)}else i=r.apply(this,arguments);return hI(this,i)}}function hI(n,e){if(e&&(gh(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return fI(n)}function fI(n){if(n===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return n}function pI(){if(typeof Reflect=="undefined"||!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 ps(n){return ps=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},ps(n)}var gI=function(n){uI(t,n);var e=dI(t);function t(r){return aI(this,t),e.call(this,r)}return cI(t,[{key:"isNotice",get:function(){return!0}},{key:"isEquivalentTo",value:function(i){return(0,oI.isEventTypeSame)(i,Rc.M_NOTICE)||Ma(ps(t.prototype),"isEquivalentTo",this).call(this,i)}},{key:"serialize",value:function(){var i=Ma(ps(t.prototype),"serialize",this).call(this);return i.content.msgtype="m.notice",i}}],[{key:"from",value:function(i,s){var o;return new t({type:Rc.M_NOTICE.name,content:(o={},Wp(o,Rc.M_TEXT.name,i),Wp(o,Rc.M_HTML.name,s),o)})}}]),t}(sI.MessageEvent);Bo.NoticeEvent=gI;var Ko={};function yh(n){return yh=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},yh(n)}Object.defineProperty(Ko,"__esModule",{value:!0});Ko.EmoteEvent=void 0;var mI=Cn,Ic=rt,yI=ai;function Yp(n,e,t){return e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function vI(n,e){if(!(n instanceof e))throw new TypeError("Cannot call a class as a function")}function zp(n,e){for(var t=0;t<e.length;t++){var r=e[t];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(n,r.key,r)}}function _I(n,e,t){return e&&zp(n.prototype,e),t&&zp(n,t),Object.defineProperty(n,"prototype",{writable:!1}),n}function Da(){return typeof Reflect!="undefined"&&Reflect.get?Da=Reflect.get:Da=function(e,t,r){var i=EI(e,t);if(!!i){var s=Object.getOwnPropertyDescriptor(i,t);return s.get?s.get.call(arguments.length<3?e:r):s.value}},Da.apply(this,arguments)}function EI(n,e){for(;!Object.prototype.hasOwnProperty.call(n,e)&&(n=gs(n),n!==null););return n}function SI(n,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");n.prototype=Object.create(e&&e.prototype,{constructor:{value:n,writable:!0,configurable:!0}}),Object.defineProperty(n,"prototype",{writable:!1}),e&&vh(n,e)}function vh(n,e){return vh=Object.setPrototypeOf||function(r,i){return r.__proto__=i,r},vh(n,e)}function bI(n){var e=II();return function(){var r=gs(n),i;if(e){var s=gs(this).constructor;i=Reflect.construct(r,arguments,s)}else i=r.apply(this,arguments);return wI(this,i)}}function wI(n,e){if(e&&(yh(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return RI(n)}function RI(n){if(n===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return n}function II(){if(typeof Reflect=="undefined"||!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 gs(n){return gs=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},gs(n)}var TI=function(n){SI(t,n);var e=bI(t);function t(r){return vI(this,t),e.call(this,r)}return _I(t,[{key:"isEmote",get:function(){return!0}},{key:"isEquivalentTo",value:function(i){return(0,yI.isEventTypeSame)(i,Ic.M_EMOTE)||Da(gs(t.prototype),"isEquivalentTo",this).call(this,i)}},{key:"serialize",value:function(){var i=Da(gs(t.prototype),"serialize",this).call(this);return i.content.msgtype="m.emote",i}}],[{key:"from",value:function(i,s){var o;return new t({type:Ic.M_EMOTE.name,content:(o={},Yp(o,Ic.M_TEXT.name,i),Yp(o,Ic.M_HTML.name,s),o)})}}]),t}(mI.MessageEvent);Ko.EmoteEvent=TI;Object.defineProperty(Lo,"__esModule",{value:!0});Lo.LEGACY_M_ROOM_MESSAGE=void 0;Lo.parseMRoomMessage=MI;var Jp=Cn,OI=Bo,kI=Ko,CI=nn,_i=rt;function Xp(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function kr(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Xp(Object(t),!0).forEach(function(r){es(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Xp(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function es(n,e,t){return e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}var PI=new CI.NamespacedValue("m.room.message");Lo.LEGACY_M_ROOM_MESSAGE=PI;function MI(n){var e,t,r;if(_i.M_MESSAGE.findIn(n.content)||_i.M_TEXT.findIn(n.content))return new Jp.MessageEvent(n);var i=(e=n.content)===null||e===void 0?void 0:e.msgtype,s=(t=n.content)===null||t===void 0?void 0:t.body,o=((r=n.content)===null||r===void 0?void 0:r.format)==="org.matrix.custom.html"?n.content.formatted_body:null;if(i==="m.text"){var a;return new Jp.MessageEvent(kr(kr({},n),{},{content:kr(kr({},n.content),{},(a={},es(a,_i.M_TEXT.name,s),es(a,_i.M_HTML.name,o),a))}))}else if(i==="m.notice"){var l;return new OI.NoticeEvent(kr(kr({},n),{},{content:kr(kr({},n.content),{},(l={},es(l,_i.M_TEXT.name,s),es(l,_i.M_HTML.name,o),l))}))}else if(i==="m.emote"){var u;return new kI.EmoteEvent(kr(kr({},n),{},{content:kr(kr({},n.content),{},(u={},es(u,_i.M_TEXT.name,s),es(u,_i.M_HTML.name,o),u))}))}else return null}var Jl={};Object.defineProperty(Jl,"__esModule",{value:!0});Jl.parseMMessage=UI;var DI=Cn,Qp=rt,AI=Ko,xI=Bo;function UI(n){return Qp.M_EMOTE.matches(n.type)?new AI.EmoteEvent(n):Qp.M_NOTICE.matches(n.type)?new xI.NoticeEvent(n):new DI.MessageEvent(n)}var Rt={};Object.defineProperty(Rt,"__esModule",{value:!0});Rt.M_POLL_START=Rt.M_POLL_RESPONSE=Rt.M_POLL_KIND_UNDISCLOSED=Rt.M_POLL_KIND_DISCLOSED=Rt.M_POLL_END=void 0;var ac=nn,$I=new ac.UnstableValue("m.poll.disclosed","org.matrix.msc3381.poll.disclosed");Rt.M_POLL_KIND_DISCLOSED=$I;var NI=new ac.UnstableValue("m.poll.undisclosed","org.matrix.msc3381.poll.undisclosed");Rt.M_POLL_KIND_UNDISCLOSED=NI;var LI=new ac.UnstableValue("m.poll.start","org.matrix.msc3381.poll.start");Rt.M_POLL_START=LI;var BI=new ac.UnstableValue("m.poll.response","org.matrix.msc3381.poll.response");Rt.M_POLL_RESPONSE=BI;var KI=new ac.UnstableValue("m.poll.end","org.matrix.msc3381.poll.end");Rt.M_POLL_END=KI;var Xl={},ms={};function _h(n){return _h=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},_h(n)}Object.defineProperty(ms,"__esModule",{value:!0});ms.PollStartEvent=ms.PollAnswerSubevent=void 0;var An=Rt,Vv=Cn,Sa=rt,ol=oi,FI=nn,qI=ai,jI=ji;function VI(n){return YI(n)||HI(n)||WI(n)||GI()}function GI(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
+In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function WI(n,e){if(!!n){if(typeof n=="string")return Eh(n,e);var t=Object.prototype.toString.call(n).slice(8,-1);if(t==="Object"&&n.constructor&&(t=n.constructor.name),t==="Map"||t==="Set")return Array.from(n);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return Eh(n,e)}}function HI(n){if(typeof Symbol!="undefined"&&n[Symbol.iterator]!=null||n["@@iterator"]!=null)return Array.from(n)}function YI(n){if(Array.isArray(n))return Eh(n)}function Eh(n,e){(e==null||e>n.length)&&(e=n.length);for(var t=0,r=new Array(e);t<e;t++)r[t]=n[t];return r}function Zp(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function zI(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Zp(Object(t),!0).forEach(function(r){sr(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Zp(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function Gv(n,e){if(!(n instanceof e))throw new TypeError("Cannot call a class as a function")}function eg(n,e){for(var t=0;t<e.length;t++){var r=e[t];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(n,r.key,r)}}function Wv(n,e,t){return e&&eg(n.prototype,e),t&&eg(n,t),Object.defineProperty(n,"prototype",{writable:!1}),n}function Hv(n,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");n.prototype=Object.create(e&&e.prototype,{constructor:{value:n,writable:!0,configurable:!0}}),Object.defineProperty(n,"prototype",{writable:!1}),e&&Sh(n,e)}function Sh(n,e){return Sh=Object.setPrototypeOf||function(r,i){return r.__proto__=i,r},Sh(n,e)}function Yv(n){var e=XI();return function(){var r=Pl(n),i;if(e){var s=Pl(this).constructor;i=Reflect.construct(r,arguments,s)}else i=r.apply(this,arguments);return JI(this,i)}}function JI(n,e){if(e&&(_h(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return as(n)}function as(n){if(n===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return n}function XI(){if(typeof Reflect=="undefined"||!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 Pl(n){return Pl=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},Pl(n)}function sr(n,e,t){return e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}var zv=function(n){Hv(t,n);var e=Yv(t);function t(r){var i;Gv(this,t),i=e.call(this,r),sr(as(i),"id",void 0);var s=r.content.id;if(!s||typeof s!="string")throw new ol.InvalidEventError("Answer ID must be a non-empty string");return i.id=s,i}return Wv(t,[{key:"serialize",value:function(){return{type:"org.matrix.sdk.poll.answer",content:zI({id:this.id},this.serializeMMessageOnly())}}}],[{key:"from",value:function(i,s){return new t({type:"org.matrix.sdk.poll.answer",content:sr({id:i},Sa.M_TEXT.name,s)})}}]),t}(Vv.MessageEvent);ms.PollAnswerSubevent=zv;var QI=function(n){Hv(t,n);var e=Yv(t);function t(r){var i;Gv(this,t),i=e.call(this,r),sr(as(i),"question",void 0),sr(as(i),"kind",void 0),sr(as(i),"rawKind",void 0),sr(as(i),"maxSelections",void 0),sr(as(i),"answers",void 0);var s=An.M_POLL_START.findIn(i.wireContent);if(!s.question)throw new ol.InvalidEventError("A question is required");if(i.question=new Vv.MessageEvent({type:"org.matrix.sdk.poll.question",content:s.question}),i.rawKind=s.kind,An.M_POLL_KIND_DISCLOSED.matches(i.rawKind)?i.kind=An.M_POLL_KIND_DISCLOSED:i.kind=An.M_POLL_KIND_UNDISCLOSED,i.maxSelections=Number.isFinite(s.max_selections)&&s.max_selections>0?s.max_selections:1,!Array.isArray(s.answers))throw new ol.InvalidEventError("Poll answers must be an array");var o=s.answers.slice(0,20).map(function(a){return new zv({type:"org.matrix.sdk.poll.answer",content:a})});if(o.length<=0)throw new ol.InvalidEventError("No answers available");return i.answers=o,i}return Wv(t,[{key:"isEquivalentTo",value:function(i){return(0,qI.isEventTypeSame)(i,An.M_POLL_START)}},{key:"serialize",value:function(){var i;return{type:An.M_POLL_START.name,content:(i={},sr(i,An.M_POLL_START.name,{question:this.question.serialize().content,kind:this.rawKind,max_selections:this.maxSelections,answers:this.answers.map(function(s){return s.serialize().content})}),sr(i,Sa.M_TEXT.name,"".concat(this.question.text,`
+`).concat(this.answers.map(function(s,o){return"".concat(o+1,". ").concat(s.text)}).join(`
+`))),i)}}}],[{key:"from",value:function(i,s,o){var a,l=arguments.length>3&&arguments[3]!==void 0?arguments[3]:1;return new t({type:An.M_POLL_START.name,content:(a={},sr(a,Sa.M_TEXT.name,i),sr(a,An.M_POLL_START.name,{question:sr({},Sa.M_TEXT.name,i),kind:o instanceof FI.NamespacedValue?o.name:o,max_selections:l,answers:s.map(function(u){return sr({id:ZI()},Sa.M_TEXT.name,u)})}),a)})}}]),t}(jI.ExtensibleEvent);ms.PollStartEvent=QI;var tg="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";function ZI(){return VI(Array(16)).map(function(){return tg.charAt(Math.floor(Math.random()*tg.length))}).join("")}var cc={},Fo={};Object.defineProperty(Fo,"__esModule",{value:!0});Fo.REFERENCE_RELATION=void 0;var eT=nn,tT=new eT.NamespacedValue("m.reference");Fo.REFERENCE_RELATION=tT;function bh(n){return bh=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},bh(n)}Object.defineProperty(cc,"__esModule",{value:!0});cc.PollResponseEvent=void 0;var rT=ji,Ks=Rt,nT=oi,ju=Fo,iT=ai;function sT(n,e){if(!(n instanceof e))throw new TypeError("Cannot call a class as a function")}function rg(n,e){for(var t=0;t<e.length;t++){var r=e[t];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(n,r.key,r)}}function oT(n,e,t){return e&&rg(n.prototype,e),t&&rg(n,t),Object.defineProperty(n,"prototype",{writable:!1}),n}function aT(n,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");n.prototype=Object.create(e&&e.prototype,{constructor:{value:n,writable:!0,configurable:!0}}),Object.defineProperty(n,"prototype",{writable:!1}),e&&wh(n,e)}function wh(n,e){return wh=Object.setPrototypeOf||function(r,i){return r.__proto__=i,r},wh(n,e)}function cT(n){var e=uT();return function(){var r=Ml(n),i;if(e){var s=Ml(this).constructor;i=Reflect.construct(r,arguments,s)}else i=r.apply(this,arguments);return lT(this,i)}}function lT(n,e){if(e&&(bh(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return al(n)}function al(n){if(n===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return n}function uT(){if(typeof Reflect=="undefined"||!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 Ml(n){return Ml=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},Ml(n)}function Xo(n,e,t){return e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}var dT=function(n){aT(t,n);var e=cT(t);function t(r){var i;sT(this,t),i=e.call(this,r),Xo(al(i),"internalAnswerIds",void 0),Xo(al(i),"internalSpoiled",void 0),Xo(al(i),"pollEventId",void 0);var s=i.wireContent["m.relates_to"];if(!ju.REFERENCE_RELATION.matches(s==null?void 0:s.rel_type)||typeof(s==null?void 0:s.event_id)!="string")throw new nT.InvalidEventError("Relationship must be a reference to an event");return i.pollEventId=s.event_id,i.validateAgainst(null),i}return oT(t,[{key:"answerIds",get:function(){return this.internalAnswerIds}},{key:"spoiled",get:function(){return this.internalSpoiled}},{key:"validateAgainst",value:function(i){var s=Ks.M_POLL_RESPONSE.findIn(this.wireContent);if(!Array.isArray(s==null?void 0:s.answers)){this.internalSpoiled=!0,this.internalAnswerIds=[];return}var o=s.answers;if(o.some(function(a){return typeof a!="string"})||o.length===0){this.internalSpoiled=!0,this.internalAnswerIds=[];return}if(i){if(o.some(function(a){return!i.answers.some(function(l){return l.id===a})})){this.internalSpoiled=!0,this.internalAnswerIds=[];return}o=o.slice(0,i.maxSelections)}this.internalAnswerIds=o,this.internalSpoiled=!1}},{key:"isEquivalentTo",value:function(i){return(0,iT.isEventTypeSame)(i,Ks.M_POLL_RESPONSE)}},{key:"serialize",value:function(){return{type:Ks.M_POLL_RESPONSE.name,content:Xo({"m.relates_to":{rel_type:ju.REFERENCE_RELATION.name,event_id:this.pollEventId}},Ks.M_POLL_RESPONSE.name,{answers:this.spoiled?void 0:this.answerIds})}}}],[{key:"from",value:function(i,s){return new t({type:Ks.M_POLL_RESPONSE.name,content:Xo({"m.relates_to":{rel_type:ju.REFERENCE_RELATION.name,event_id:s}},Ks.M_POLL_RESPONSE.name,{answers:i})})}}]),t}(rT.ExtensibleEvent);cc.PollResponseEvent=dT;var lc={};function Rh(n){return Rh=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},Rh(n)}Object.defineProperty(lc,"__esModule",{value:!0});lc.PollEndEvent=void 0;var Qo=Rt,hT=oi,Vu=Fo,fT=Cn,pT=rt,gT=ai,mT=ji;function ng(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function yT(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?ng(Object(t),!0).forEach(function(r){oo(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):ng(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function vT(n,e){if(!(n instanceof e))throw new TypeError("Cannot call a class as a function")}function ig(n,e){for(var t=0;t<e.length;t++){var r=e[t];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(n,r.key,r)}}function _T(n,e,t){return e&&ig(n.prototype,e),t&&ig(n,t),Object.defineProperty(n,"prototype",{writable:!1}),n}function ET(n,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");n.prototype=Object.create(e&&e.prototype,{constructor:{value:n,writable:!0,configurable:!0}}),Object.defineProperty(n,"prototype",{writable:!1}),e&&Ih(n,e)}function Ih(n,e){return Ih=Object.setPrototypeOf||function(r,i){return r.__proto__=i,r},Ih(n,e)}function ST(n){var e=wT();return function(){var r=Dl(n),i;if(e){var s=Dl(this).constructor;i=Reflect.construct(r,arguments,s)}else i=r.apply(this,arguments);return bT(this,i)}}function bT(n,e){if(e&&(Rh(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Th(n)}function Th(n){if(n===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return n}function wT(){if(typeof Reflect=="undefined"||!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 Dl(n){return Dl=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},Dl(n)}function oo(n,e,t){return e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}var RT=function(n){ET(t,n);var e=ST(t);function t(r){var i;vT(this,t),i=e.call(this,r),oo(Th(i),"pollEventId",void 0),oo(Th(i),"closingMessage",void 0);var s=i.wireContent["m.relates_to"];if(!Vu.REFERENCE_RELATION.matches(s==null?void 0:s.rel_type)||typeof(s==null?void 0:s.event_id)!="string")throw new hT.InvalidEventError("Relationship must be a reference to an event");return i.pollEventId=s.event_id,i.closingMessage=new fT.MessageEvent(i.wireFormat),i}return _T(t,[{key:"isEquivalentTo",value:function(i){return(0,gT.isEventTypeSame)(i,Qo.M_POLL_END)}},{key:"serialize",value:function(){return{type:Qo.M_POLL_END.name,content:yT(oo({"m.relates_to":{rel_type:Vu.REFERENCE_RELATION.name,event_id:this.pollEventId}},Qo.M_POLL_END.name,{}),this.closingMessage.serialize().content)}}}],[{key:"from",value:function(i,s){var o;return new t({type:Qo.M_POLL_END.name,content:(o={"m.relates_to":{rel_type:Vu.REFERENCE_RELATION.name,event_id:i}},oo(o,Qo.M_POLL_END.name,{}),oo(o,pT.M_TEXT.name,s),o)})}}]),t}(mT.ExtensibleEvent);lc.PollEndEvent=RT;Object.defineProperty(Xl,"__esModule",{value:!0});Xl.parseMPoll=kT;var Gu=Rt,IT=ms,TT=cc,OT=lc;function kT(n){return Gu.M_POLL_START.matches(n.type)?new IT.PollStartEvent(n):Gu.M_POLL_RESPONSE.matches(n.type)?new TT.PollResponseEvent(n):Gu.M_POLL_END.matches(n.type)?new OT.PollEndEvent(n):null}Object.defineProperty(zl,"__esModule",{value:!0});zl.ExtensibleEvents=void 0;var CT=ic,PT=oi,sg=Lo,Wu=Jl,Tc=rt,Hu=Rt,Yu=Xl;function MT(n,e){var t=typeof Symbol!="undefined"&&n[Symbol.iterator]||n["@@iterator"];if(!t){if(Array.isArray(n)||(t=DT(n))||e&&n&&typeof n.length=="number"){t&&(n=t);var r=0,i=function(){};return{s:i,n:function(){return r>=n.length?{done:!0}:{done:!1,value:n[r++]}},e:function(u){throw u},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
+In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var s=!0,o=!1,a;return{s:function(){t=t.call(n)},n:function(){var u=t.next();return s=u.done,u},e:function(u){o=!0,a=u},f:function(){try{!s&&t.return!=null&&t.return()}finally{if(o)throw a}}}}function DT(n,e){if(!!n){if(typeof n=="string")return og(n,e);var t=Object.prototype.toString.call(n).slice(8,-1);if(t==="Object"&&n.constructor&&(t=n.constructor.name),t==="Map"||t==="Set")return Array.from(n);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return og(n,e)}}function og(n,e){(e==null||e>n.length)&&(e=n.length);for(var t=0,r=new Array(e);t<e;t++)r[t]=n[t];return r}function AT(n,e){if(!(n instanceof e))throw new TypeError("Cannot call a class as a function")}function ag(n,e){for(var t=0;t<e.length;t++){var r=e[t];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(n,r.key,r)}}function xT(n,e,t){return e&&ag(n.prototype,e),t&&ag(n,t),Object.defineProperty(n,"prototype",{writable:!1}),n}function Oh(n,e,t){return e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}var kh=function(){function n(){AT(this,n),Oh(this,"interpreters",new CT.NamespacedMap([[sg.LEGACY_M_ROOM_MESSAGE,sg.parseMRoomMessage],[Tc.M_MESSAGE,Wu.parseMMessage],[Tc.M_EMOTE,Wu.parseMMessage],[Tc.M_NOTICE,Wu.parseMMessage],[Hu.M_POLL_START,Yu.parseMPoll],[Hu.M_POLL_RESPONSE,Yu.parseMPoll],[Hu.M_POLL_END,Yu.parseMPoll]])),Oh(this,"_unknownInterpretOrder",[Tc.M_MESSAGE])}return xT(n,[{key:"unknownInterpretOrder",get:function(){var t;return(t=this._unknownInterpretOrder)!==null&&t!==void 0?t:[]},set:function(t){this._unknownInterpretOrder=t}},{key:"registerInterpreter",value:function(t,r){this.interpreters.set(t,r)}},{key:"parse",value:function(t){try{if(this.interpreters.hasNamespaced(t.type))return this.interpreters.getNamespaced(t.type)(t);var r=MT(this.unknownInterpretOrder),i;try{for(r.s();!(i=r.n()).done;){var s=i.value;if(this.interpreters.has(s)){var o=this.interpreters.get(s)(t);if(o)return o}}}catch(a){r.e(a)}finally{r.f()}return null}catch(a){if(a instanceof PT.InvalidEventError)return null;throw a}}}],[{key:"defaultInstance",get:function(){return n._defaultInstance}},{key:"unknownInterpretOrder",get:function(){return n.defaultInstance.unknownInterpretOrder},set:function(t){n.defaultInstance.unknownInterpretOrder=t}},{key:"registerInterpreter",value:function(t,r){n.defaultInstance.registerInterpreter(t,r)}},{key:"parse",value:function(t){return n.defaultInstance.parse(t)}}]),n}();zl.ExtensibleEvents=kh;Oh(kh,"_defaultInstance",new kh);var Jv={};Object.defineProperty(Jv,"__esModule",{value:!0});var qo={};Object.defineProperty(qo,"__esModule",{value:!0});qo.LegacyMsgType=void 0;qo.isEventLike=UT;var zu=rt,yo;qo.LegacyMsgType=yo;(function(n){n.Text="m.text",n.Notice="m.notice",n.Emote="m.emote"})(yo||(qo.LegacyMsgType=yo={}));function UT(n,e){var t=n.content;return e===yo.Text?zu.M_MESSAGE.matches(n.type)||n.type==="m.room.message"&&(t==null?void 0:t.msgtype)==="m.text":e===yo.Emote?zu.M_EMOTE.matches(n.type)||n.type==="m.room.message"&&(t==null?void 0:t.msgtype)==="m.emote":e===yo.Notice?zu.M_NOTICE.matches(n.type)||n.type==="m.room.message"&&(t==null?void 0:t.msgtype)==="m.notice":!1}(function(n){Object.defineProperty(n,"__esModule",{value:!0});var e=zl;Object.keys(e).forEach(function(w){w==="default"||w==="__esModule"||w in n&&n[w]===e[w]||Object.defineProperty(n,w,{enumerable:!0,get:function(){return e[w]}})});var t=Jv;Object.keys(t).forEach(function(w){w==="default"||w==="__esModule"||w in n&&n[w]===t[w]||Object.defineProperty(n,w,{enumerable:!0,get:function(){return t[w]}})});var r=oi;Object.keys(r).forEach(function(w){w==="default"||w==="__esModule"||w in n&&n[w]===r[w]||Object.defineProperty(n,w,{enumerable:!0,get:function(){return r[w]}})});var i=nn;Object.keys(i).forEach(function(w){w==="default"||w==="__esModule"||w in n&&n[w]===i[w]||Object.defineProperty(n,w,{enumerable:!0,get:function(){return i[w]}})});var s=ic;Object.keys(s).forEach(function(w){w==="default"||w==="__esModule"||w in n&&n[w]===s[w]||Object.defineProperty(n,w,{enumerable:!0,get:function(){return s[w]}})});var o=sc;Object.keys(o).forEach(function(w){w==="default"||w==="__esModule"||w in n&&n[w]===o[w]||Object.defineProperty(n,w,{enumerable:!0,get:function(){return o[w]}})});var a=qo;Object.keys(a).forEach(function(w){w==="default"||w==="__esModule"||w in n&&n[w]===a[w]||Object.defineProperty(n,w,{enumerable:!0,get:function(){return a[w]}})});var l=ai;Object.keys(l).forEach(function(w){w==="default"||w==="__esModule"||w in n&&n[w]===l[w]||Object.defineProperty(n,w,{enumerable:!0,get:function(){return l[w]}})});var u=Lo;Object.keys(u).forEach(function(w){w==="default"||w==="__esModule"||w in n&&n[w]===u[w]||Object.defineProperty(n,w,{enumerable:!0,get:function(){return u[w]}})});var c=Jl;Object.keys(c).forEach(function(w){w==="default"||w==="__esModule"||w in n&&n[w]===c[w]||Object.defineProperty(n,w,{enumerable:!0,get:function(){return c[w]}})});var g=Xl;Object.keys(g).forEach(function(w){w==="default"||w==="__esModule"||w in n&&n[w]===g[w]||Object.defineProperty(n,w,{enumerable:!0,get:function(){return g[w]}})});var m=Fo;Object.keys(m).forEach(function(w){w==="default"||w==="__esModule"||w in n&&n[w]===m[w]||Object.defineProperty(n,w,{enumerable:!0,get:function(){return m[w]}})});var f=ji;Object.keys(f).forEach(function(w){w==="default"||w==="__esModule"||w in n&&n[w]===f[w]||Object.defineProperty(n,w,{enumerable:!0,get:function(){return f[w]}})});var _=rt;Object.keys(_).forEach(function(w){w==="default"||w==="__esModule"||w in n&&n[w]===_[w]||Object.defineProperty(n,w,{enumerable:!0,get:function(){return _[w]}})});var I=Cn;Object.keys(I).forEach(function(w){w==="default"||w==="__esModule"||w in n&&n[w]===I[w]||Object.defineProperty(n,w,{enumerable:!0,get:function(){return I[w]}})});var R=Ko;Object.keys(R).forEach(function(w){w==="default"||w==="__esModule"||w in n&&n[w]===R[w]||Object.defineProperty(n,w,{enumerable:!0,get:function(){return R[w]}})});var T=Bo;Object.keys(T).forEach(function(w){w==="default"||w==="__esModule"||w in n&&n[w]===T[w]||Object.defineProperty(n,w,{enumerable:!0,get:function(){return T[w]}})});var C=Rt;Object.keys(C).forEach(function(w){w==="default"||w==="__esModule"||w in n&&n[w]===C[w]||Object.defineProperty(n,w,{enumerable:!0,get:function(){return C[w]}})});var S=ms;Object.keys(S).forEach(function(w){w==="default"||w==="__esModule"||w in n&&n[w]===S[w]||Object.defineProperty(n,w,{enumerable:!0,get:function(){return S[w]}})});var k=cc;Object.keys(k).forEach(function(w){w==="default"||w==="__esModule"||w in n&&n[w]===k[w]||Object.defineProperty(n,w,{enumerable:!0,get:function(){return k[w]}})});var A=lc;Object.keys(A).forEach(function(w){w==="default"||w==="__esModule"||w in n&&n[w]===A[w]||Object.defineProperty(n,w,{enumerable:!0,get:function(){return A[w]}})})})(Yl);var Ql={};Object.defineProperty(Ql,"__esModule",{value:!0});Ql.TEXT_NODE_TYPE=void 0;var $T=wr;const NT=new $T.UnstableValue("m.text","org.matrix.msc1767.text");Ql.TEXT_NODE_TYPE=NT;var Qr={};Object.defineProperty(Qr,"__esModule",{value:!0});Qr.M_TIMESTAMP=Qr.M_LOCATION=Qr.M_ASSET=Qr.LocationAssetType=void 0;var Rf=wr;let Ch;Qr.LocationAssetType=Ch;(function(n){n.Self="m.self",n.Pin="m.pin"})(Ch||(Qr.LocationAssetType=Ch={}));const LT=new Rf.UnstableValue("m.asset","org.matrix.msc3488.asset");Qr.M_ASSET=LT;const BT=new Rf.UnstableValue("m.ts","org.matrix.msc3488.ts");Qr.M_TIMESTAMP=BT;const KT=new Rf.UnstableValue("m.location","org.matrix.msc3488.location");Qr.M_LOCATION=KT;var FT=G.exports;Object.defineProperty(Xe,"__esModule",{value:!0});Xe.makeBeaconInfoContent=Xe.makeBeaconContent=Xe.getTextForLocationEvent=void 0;Xe.makeEmoteMessage=JT;Xe.makeHtmlEmote=HT;Xe.makeHtmlMessage=GT;Xe.makeHtmlNotice=WT;Xe.makeLocationContent=void 0;Xe.makeNotice=zT;Xe.makeTextMessage=YT;Xe.parseLocationEvent=Xe.parseBeaconInfoContent=void 0;var qT=FT(Y.exports),jT=Yl,Xv=In,As=ne,Qv=Ql,It=Qr;function cg(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function VT(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?cg(Object(t),!0).forEach(function(r){(0,qT.default)(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):cg(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function GT(n,e){return{msgtype:As.MsgType.Text,format:"org.matrix.custom.html",body:n,formatted_body:e}}function WT(n,e){return{msgtype:As.MsgType.Notice,format:"org.matrix.custom.html",body:n,formatted_body:e}}function HT(n,e){return{msgtype:As.MsgType.Emote,format:"org.matrix.custom.html",body:n,formatted_body:e}}function YT(n){return{msgtype:As.MsgType.Text,body:n}}function zT(n){return{msgtype:As.MsgType.Notice,body:n}}function JT(n){return{msgtype:As.MsgType.Emote,body:n}}const Zv=(n,e,t,r)=>{const i=`at ${new Date(t).toISOString()}`,s=e===It.LocationAssetType.Self?"User":void 0,o=r?`"${r}"`:void 0;return[s,"Location",o,n,i].filter(Boolean).join(" ")};Xe.getTextForLocationEvent=Zv;const e_=(n,e,t,r,i)=>{const s=n!=null?n:Zv(e,i||It.LocationAssetType.Self,t,r),o=t?{[It.M_TIMESTAMP.name]:t}:{};return VT({msgtype:As.MsgType.Location,body:s,geo_uri:e,[It.M_LOCATION.name]:{description:r,uri:e},[It.M_ASSET.name]:{type:i||It.LocationAssetType.Self},[Qv.TEXT_NODE_TYPE.name]:s},o)};Xe.makeLocationContent=e_;const XT=n=>{var e,t;const r=It.M_LOCATION.findIn(n),i=It.M_ASSET.findIn(n),s=It.M_TIMESTAMP.findIn(n),o=Qv.TEXT_NODE_TYPE.findIn(n),a=(e=r==null?void 0:r.uri)!==null&&e!==void 0?e:n==null?void 0:n.geo_uri,l=r==null?void 0:r.description,u=(t=i==null?void 0:i.type)!==null&&t!==void 0?t:It.LocationAssetType.Self,c=o!=null?o:n.body;return e_(c,a,s,l,u)};Xe.parseLocationEvent=XT;const QT=(n,e,t,r,i)=>({[Xv.M_BEACON_INFO.name]:{description:t,timeout:n,live:e},[It.M_TIMESTAMP.name]:i||Date.now(),[It.M_ASSET.name]:{type:r!=null?r:It.LocationAssetType.Self}});Xe.makeBeaconInfoContent=QT;const ZT=n=>{const{description:e,timeout:t,live:r}=Xv.M_BEACON_INFO.findIn(n),{type:i}=It.M_ASSET.findIn(n),s=It.M_TIMESTAMP.findIn(n);return{description:e,timeout:t,live:r,assetType:i,timestamp:s}};Xe.parseBeaconInfoContent=ZT;const eO=(n,e,t,r)=>({[It.M_LOCATION.name]:{description:r,uri:n},[It.M_TIMESTAMP.name]:e,"m.relates_to":{rel_type:jT.REFERENCE_RELATION.name,event_id:t}});Xe.makeBeaconContent=eO;var tO=G.exports;Object.defineProperty(br,"__esModule",{value:!0});br.isTimestampInDuration=br.isBeaconInfoEventType=br.BeaconEvent=br.Beacon=void 0;var Oc=tO(Y.exports),lg=In,rO=Xe,nO=je;let Va;br.BeaconEvent=Va;(function(n){n.New="Beacon.new",n.Update="Beacon.update",n.LivenessChange="Beacon.LivenessChange"})(Va||(br.BeaconEvent=Va={}));const t_=(n,e,t)=>t>=n&&n+e>=t;br.isTimestampInDuration=t_;const iO=n=>n.startsWith(lg.M_BEACON_INFO.name)||n.startsWith(lg.M_BEACON_INFO.altName);br.isBeaconInfoEventType=iO;class sO extends nO.TypedEventEmitter{constructor(e){super(),this.rootEvent=e,(0,Oc.default)(this,"roomId",void 0),(0,Oc.default)(this,"_beaconInfo",void 0),(0,Oc.default)(this,"_isLive",void 0),(0,Oc.default)(this,"livenessWatchInterval",void 0),this.setBeaconInfo(this.rootEvent),this.roomId=this.rootEvent.getRoomId()}get isLive(){return this._isLive}get identifier(){return this.beaconInfoEventType}get beaconInfoId(){return this.rootEvent.getId()}get beaconInfoOwner(){return this.rootEvent.getStateKey()}get beaconInfoEventType(){return this.rootEvent.getType()}get beaconInfo(){return this._beaconInfo}update(e){if(e.getType()!==this.beaconInfoEventType)throw new Error("Invalid updating event");this.rootEvent=e,this.setBeaconInfo(this.rootEvent),this.emit(Va.Update,e,this)}destroy(){this.livenessWatchInterval&&clearInterval(this.livenessWatchInterval)}monitorLiveness(){if(this.livenessWatchInterval&&clearInterval(this.livenessWatchInterval),this.isLive){var e,t;const r=((e=this._beaconInfo)===null||e===void 0?void 0:e.timestamp)+((t=this._beaconInfo)===null||t===void 0?void 0:t.timeout)+1-Date.now();r>1&&(this.livenessWatchInterval=setInterval(this.checkLiveness.bind(this),r))}}setBeaconInfo(e){this._beaconInfo=(0,rO.parseBeaconInfoContent)(e.getContent()),this.checkLiveness()}checkLiveness(){var e,t,r;const i=this.isLive;this._isLive=((e=this._beaconInfo)===null||e===void 0?void 0:e.live)&&t_((t=this._beaconInfo)===null||t===void 0?void 0:t.timestamp,(r=this._beaconInfo)===null||r===void 0?void 0:r.timeout,Date.now()),i!==this.isLive&&this.emit(Va.LivenessChange,this.isLive,this)}}br.Beacon=sO;var sn={};Object.defineProperty(sn,"__esModule",{value:!0});sn.TypedReEmitter=sn.ReEmitter=void 0;class r_{constructor(e){this.target=e}reEmit(e,t){for(const r of t){const i=(...s)=>{r==="error"&&this.target.listenerCount("error")===0||this.target.emit(r,...s,e)};e.on(r,i)}}}sn.ReEmitter=r_;class oO extends r_{constructor(e){super(e)}reEmit(e,t){super.reEmit(e,t)}}sn.TypedReEmitter=oO;var aO=G.exports;Object.defineProperty(Tn,"__esModule",{value:!0});Tn.RoomStateEvent=Tn.RoomState=void 0;var Lt=aO(Y.exports),ug=rn,Ju=ie,Zo=uO(W),Qt=ne,Xu=Je,cO=je,Gi=br,lO=sn;function n_(n){if(typeof WeakMap!="function")return null;var e=new WeakMap,t=new WeakMap;return(n_=function(r){return r?t:e})(n)}function uO(n,e){if(!e&&n&&n.__esModule)return n;if(n===null||typeof n!="object"&&typeof n!="function")return{default:n};var t=n_(e);if(t&&t.has(n))return t.get(n);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in n)if(s!=="default"&&Object.prototype.hasOwnProperty.call(n,s)){var o=i?Object.getOwnPropertyDescriptor(n,s):null;o&&(o.get||o.set)?Object.defineProperty(r,s,o):r[s]=n[s]}return r.default=n,t&&t.set(n,r),r}var Er;(function(n){n[n.NotStarted=0]="NotStarted",n[n.InProgress=1]="InProgress",n[n.Finished=2]="Finished"})(Er||(Er={}));let Xr;Tn.RoomStateEvent=Xr;(function(n){n.Events="RoomState.events",n.Members="RoomState.members",n.NewMember="RoomState.newMember",n.Update="RoomState.update",n.BeaconLiveness="RoomState.BeaconLiveness"})(Xr||(Tn.RoomStateEvent=Xr={}));class If extends cO.TypedEventEmitter{constructor(e,t={status:Er.NotStarted}){super(),this.roomId=e,this.oobMemberFlags=t,(0,Lt.default)(this,"reEmitter",new lO.TypedReEmitter(this)),(0,Lt.default)(this,"sentinels",{}),(0,Lt.default)(this,"displayNameToUserIds",{}),(0,Lt.default)(this,"userIdsToDisplayNames",{}),(0,Lt.default)(this,"tokenToInvite",{}),(0,Lt.default)(this,"joinedMemberCount",null),(0,Lt.default)(this,"summaryJoinedMemberCount",null),(0,Lt.default)(this,"invitedMemberCount",null),(0,Lt.default)(this,"summaryInvitedMemberCount",null),(0,Lt.default)(this,"modified",void 0),(0,Lt.default)(this,"members",{}),(0,Lt.default)(this,"events",new Map),(0,Lt.default)(this,"paginationToken",null),(0,Lt.default)(this,"beacons",new Map),(0,Lt.default)(this,"liveBeaconIds",[]),this.updateModifiedTime()}getJoinedMemberCount(){return this.summaryJoinedMemberCount!==null?this.summaryJoinedMemberCount:(this.joinedMemberCount===null&&(this.joinedMemberCount=this.getMembers().reduce((e,t)=>t.membership==="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,t)=>t.membership==="invite"?e+1:e,0)),this.invitedMemberCount)}setInvitedMemberCount(e){this.summaryInvitedMemberCount=e}getMembers(){return Object.values(this.members)}getMembersExcept(e){return this.getMembers().filter(t=>!e.includes(t.userId))}getMember(e){return this.members[e]||null}getSentinelMember(e){if(!e)return null;let t=this.sentinels[e];if(t===void 0){t=new ug.RoomMember(this.roomId,e);const r=this.members[e];r&&t.setMembershipEvent(r.events.member,this),this.sentinels[e]=t}return t}getStateEvents(e,t){if(!this.events.has(e))return t===void 0?[]:null;if(t===void 0)return Array.from(this.events.get(e).values());const r=this.events.get(e).get(t);return r||null}get hasLiveBeacons(){var e;return!!((e=this.liveBeaconIds)!==null&&e!==void 0&&e.length)}clone(){const e=new If(this.roomId,this.oobMemberFlags),t=this.oobMemberFlags.status;return this.oobMemberFlags.status=Er.NotStarted,Array.from(this.events.values()).forEach(r=>{e.setStateEvents(Array.from(r.values()))}),this.oobMemberFlags.status=t,this.summaryInvitedMemberCount!==null&&e.setInvitedMemberCount(this.getInvitedMemberCount()),this.summaryJoinedMemberCount!==null&&e.setJoinedMemberCount(this.getJoinedMemberCount()),this.oobMemberFlags.status==Er.Finished&&this.getMembers().forEach(r=>{r.isOutOfBand()&&e.getMember(r.userId).markOutOfBand()}),e}setUnknownStateEvents(e){const t=e.filter(r=>!this.events.has(r.getType())||!this.events.get(r.getType()).has(r.getStateKey()));this.setStateEvents(t)}setStateEvents(e){this.updateModifiedTime(),e.forEach(t=>{if(t.getRoomId()!==this.roomId||!t.isState())return;(0,Gi.isBeaconInfoEventType)(t.getType())&&this.setBeacon(t);const r=this.getStateEventMatching(t);this.setStateEvent(t),t.getType()===Qt.EventType.RoomMember&&(this.updateDisplayNameCache(t.getStateKey(),t.getContent().displayname),this.updateThirdPartyTokenCache(t)),this.emit(Xr.Events,t,this,r)}),this.onBeaconLivenessChange(),e.forEach(t=>{if(t.getRoomId()===this.roomId&&!!t.isState()){if(t.getType()===Qt.EventType.RoomMember){const r=t.getStateKey();(t.getContent().membership==="leave"||t.getContent().membership==="ban")&&(t.getContent().avatar_url=t.getContent().avatar_url||t.getPrevContent().avatar_url,t.getContent().displayname=t.getContent().displayname||t.getPrevContent().displayname);const i=this.getOrCreateMember(r,t);i.setMembershipEvent(t,this),this.updateMember(i),this.emit(Xr.Members,t,this,i)}else if(t.getType()===Qt.EventType.RoomPowerLevels){if(t.getStateKey()!=="")return;Object.values(this.members).forEach(i=>{const s=i.getLastModifiedTime();i.setPowerLevelEvent(t),s!==i.getLastModifiedTime()&&this.emit(Xr.Members,t,this,i)}),this.sentinels={}}}}),this.emit(Xr.Update,this)}getOrCreateMember(e,t){let r=this.members[e];return r||(r=new ug.RoomMember(this.roomId,e),this.members[e]=r,this.emit(Xr.NewMember,t,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){if(this.beacons.has(e.getType()))return this.beacons.get(e.getType()).update(e);const t=new Gi.Beacon(e);this.reEmitter.reEmit(t,[Gi.BeaconEvent.New,Gi.BeaconEvent.Update,Gi.BeaconEvent.LivenessChange]),this.emit(Gi.BeaconEvent.New,e,t),t.on(Gi.BeaconEvent.LivenessChange,this.onBeaconLivenessChange.bind(this)),this.beacons.set(t.beaconInfoEventType,t)}onBeaconLivenessChange(){var e;const t=!!((e=this.liveBeaconIds)!==null&&e!==void 0&&e.length);this.liveBeaconIds=Array.from(this.beacons.values()).filter(i=>i.isLive).map(i=>i.beaconInfoId);const r=!!this.liveBeaconIds.length;t!==r&&this.emit(Xr.BeaconLiveness,this,r)}getStateEventMatching(e){var t,r;return(t=(r=this.events.get(e.getType()))===null||r===void 0?void 0:r.get(e.getStateKey()))!==null&&t!==void 0?t:null}updateMember(e){const t=this.getStateEvents(Qt.EventType.RoomPowerLevels,"");t&&e.setPowerLevelEvent(t),delete this.sentinels[e.userId],this.members[e.userId]=e,this.joinedMemberCount=null,this.invitedMemberCount=null}needsOutOfBandMembers(){return this.oobMemberFlags.status===Er.NotStarted}markOutOfBandMembersStarted(){this.oobMemberFlags.status===Er.NotStarted&&(this.oobMemberFlags.status=Er.InProgress)}markOutOfBandMembersFailed(){this.oobMemberFlags.status===Er.InProgress&&(this.oobMemberFlags.status=Er.NotStarted)}clearOutOfBandMembers(){let e=0;Object.keys(this.members).forEach(t=>{this.members[t].isOutOfBand()&&(++e,delete this.members[t])}),Ju.logger.log(`LL: RoomState removed ${e} members...`),this.oobMemberFlags.status=Er.NotStarted}setOutOfBandMembers(e){Ju.logger.log(`LL: RoomState about to set ${e.length} OOB members ...`),this.oobMemberFlags.status===Er.InProgress&&(Ju.logger.log("LL: RoomState put in finished state ..."),this.oobMemberFlags.status=Er.Finished,e.forEach(t=>this.setOutOfBandMember(t)),this.emit(Xr.Update,this))}setOutOfBandMember(e){if(e.getType()!==Qt.EventType.RoomMember)return;const t=e.getStateKey(),r=this.getMember(t);if(r&&!r.isOutOfBand())return;const i=this.getOrCreateMember(t,e);i.setMembershipEvent(e,this),i.markOutOfBand(),this.updateDisplayNameCache(i.userId,i.name),this.setStateEvent(e),this.updateMember(i),this.emit(Xr.Members,e,this,i)}setTypingEvent(e){Object.values(this.members).forEach(function(t){t.setTypingEvent(e)})}getInviteForThreePidToken(e){return this.tokenToInvite[e]||null}updateModifiedTime(){this.modified=Date.now()}getLastModifiedTime(){return this.modified}getUserIdsWithDisplayName(e){return this.displayNameToUserIds[Zo.removeHiddenChars(e)]||[]}maySendRedactionForEvent(e,t){const r=this.getMember(t);if(!r||r.membership==="leave"||e.status||e.isRedacted())return!1;const i=this.maySendEvent(Qt.EventType.RoomRedaction,t);return e.getSender()===t?i:this.hasSufficientPowerLevelFor("redact",r.powerLevel)}hasSufficientPowerLevelFor(e,t){const r=this.getStateEvents(Qt.EventType.RoomPowerLevels,"");let i={};r&&(i=r.getContent());let s=50;return Zo.isNumber(i[e])&&(s=i[e]),t>=s}maySendMessage(e){return this.maySendEventOfType(Qt.EventType.RoomMessage,e,!1)}maySendEvent(e,t){return this.maySendEventOfType(e,t,!1)}mayClientSendStateEvent(e,t){return t.isGuest()?!1:this.maySendStateEvent(e,t.credentials.userId)}maySendStateEvent(e,t){return this.maySendEventOfType(e,t,!0)}maySendEventOfType(e,t,r){const i=this.getStateEvents(Qt.EventType.RoomPowerLevels,"");let s,o={},a=0,l=0,u=0;if(i){s=i.getContent(),o=s.events||{},Number.isSafeInteger(s.state_default)?a=s.state_default:a=50;const g=s.users&&s.users[t];Number.isSafeInteger(g)?u=g:Number.isSafeInteger(s.users_default)&&(u=s.users_default),Number.isSafeInteger(s.events_default)&&(l=s.events_default)}let c=r?a:l;return Number.isSafeInteger(o[e])&&(c=o[e]),u>=c}mayTriggerNotifOfType(e,t){const r=this.getMember(t);if(!r)return!1;const i=this.getStateEvents(Qt.EventType.RoomPowerLevels,"");let s=50;return i&&i.getContent()&&i.getContent().notifications&&Zo.isNumber(i.getContent().notifications[e])&&(s=i.getContent().notifications[e]),r.powerLevel>=s}getJoinRule(){var e;const t=this.getStateEvents(Qt.EventType.RoomJoinRules,"");return((e=t==null?void 0:t.getContent())!==null&&e!==void 0?e:{}).join_rule||Xu.JoinRule.Invite}getHistoryVisibility(){var e;const t=this.getStateEvents(Qt.EventType.RoomHistoryVisibility,"");return((e=t==null?void 0:t.getContent())!==null&&e!==void 0?e:{}).history_visibility||Xu.HistoryVisibility.Shared}getGuestAccess(){var e;const t=this.getStateEvents(Qt.EventType.RoomGuestAccess,"");return((e=t==null?void 0:t.getContent())!==null&&e!==void 0?e:{}).guest_access||Xu.GuestAccess.Forbidden}updateThirdPartyTokenCache(e){if(!e.getContent().third_party_invite)return;const t=(e.getContent().third_party_invite.signed||{}).token;!t||!this.getStateEvents(Qt.EventType.RoomThirdPartyInvite,t)||(this.tokenToInvite[t]=e)}updateDisplayNameCache(e,t){const r=this.userIdsToDisplayNames[e];if(delete this.userIdsToDisplayNames[e],r){const s=Zo.removeHiddenChars(r),o=this.displayNameToUserIds[s];if(o){const a=o.filter(l=>l!==e);this.displayNameToUserIds[s]=a}}this.userIdsToDisplayNames[e]=t;const i=t&&Zo.removeHiddenChars(t);i&&(this.displayNameToUserIds[i]||(this.displayNameToUserIds[i]=[]),this.displayNameToUserIds[i].push(e))}}Tn.RoomState=If;var dO=G.exports;Object.defineProperty(nc,"__esModule",{value:!0});nc.MemoryStore=void 0;var ln=dO(Y.exports),hO=tn,dg=Tn;function hg(n){return typeof n=="string"&&!!n&&n!=="undefined"&&n!=="null"||typeof n=="number"}class fO{constructor(e={}){(0,ln.default)(this,"rooms",{}),(0,ln.default)(this,"groups",{}),(0,ln.default)(this,"users",{}),(0,ln.default)(this,"syncToken",null),(0,ln.default)(this,"filters",{}),(0,ln.default)(this,"accountData",{}),(0,ln.default)(this,"localStorage",void 0),(0,ln.default)(this,"oobMembers",{}),(0,ln.default)(this,"clientOptions",{}),(0,ln.default)(this,"onRoomMember",(t,r,i)=>{if(i.membership==="invite")return;const s=this.users[i.userId]||new hO.User(i.userId);i.name&&(s.setDisplayName(i.name),i.events.member&&s.setRawDisplayName(i.events.member.getDirectionalContent().displayname)),i.events.member&&i.events.member.getContent().avatar_url&&s.setAvatarUrl(i.events.member.getContent().avatar_url),this.users[s.userId]=s}),this.localStorage=e.localStorage}getSyncToken(){return this.syncToken}isNewlyCreated(){return Promise.resolve(!0)}setSyncToken(e){this.syncToken=e}storeGroup(e){this.groups[e.groupId]=e}getGroup(e){return this.groups[e]||null}getGroups(){return Object.values(this.groups)}storeRoom(e){this.rooms[e.roomId]=e,e.currentState.on(dg.RoomStateEvent.Members,this.onRoomMember),e.currentState.getMembers().forEach(t=>{this.onRoomMember(null,e.currentState,t)})}getRoom(e){return this.rooms[e]||null}getRooms(){return Object.values(this.rooms)}removeRoom(e){this.rooms[e]&&this.rooms[e].currentState.removeListener(dg.RoomStateEvent.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,t){return[]}storeEvents(e,t,r,i){}storeFilter(e){!e||(this.filters[e.userId]||(this.filters[e.userId]={}),this.filters[e.userId][e.filterId]=e)}getFilter(e,t){return!this.filters[e]||!this.filters[e][t]?null:this.filters[e][t]}getFilterIdByName(e){if(!this.localStorage)return null;const t="mxjssdk_memory_filter_"+e;try{const r=this.localStorage.getItem(t);if(hg(r))return r}catch{}return null}setFilterIdByName(e,t){if(!this.localStorage)return;const r="mxjssdk_memory_filter_"+e;try{hg(t)?this.localStorage.setItem(r,t):this.localStorage.removeItem(r)}catch{}}storeAccountDataEvents(e){e.forEach(t=>{this.accountData[t.getType()]=t})}getAccountData(e){return this.accountData[e]}setSyncData(e){return Promise.resolve()}wantsSave(){return!1}save(e){}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={},this.accountData={},Promise.resolve()}getOutOfBandMembers(e){return Promise.resolve(this.oobMembers[e]||null)}setOutOfBandMembers(e,t){return this.oobMembers[e]=t,Promise.resolve()}clearOutOfBandMembers(e){return this.oobMembers={},Promise.resolve()}getClientOptions(){return Promise.resolve(this.clientOptions)}storeClientOptions(e){return this.clientOptions=Object.assign({},e),Promise.resolve()}}nc.MemoryStore=fO;var Zl={},pO=G.exports;Object.defineProperty(Zl,"__esModule",{value:!0});Zl.MatrixScheduler=void 0;var kc=pO(Y.exports),fg=mO(W),gO=ne;function i_(n){if(typeof WeakMap!="function")return null;var e=new WeakMap,t=new WeakMap;return(i_=function(r){return r?t:e})(n)}function mO(n,e){if(!e&&n&&n.__esModule)return n;if(n===null||typeof n!="object"&&typeof n!="function")return{default:n};var t=i_(e);if(t&&t.has(n))return t.get(n);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in n)if(s!=="default"&&Object.prototype.hasOwnProperty.call(n,s)){var o=i?Object.getOwnPropertyDescriptor(n,s):null;o&&(o.get||o.set)?Object.defineProperty(r,s,o):r[s]=n[s]}return r.default=n,t&&t.set(n,r),r}class Al{static RETRY_BACKOFF_RATELIMIT(e,t,r){if(r.httpStatus===400||r.httpStatus===403||r.httpStatus===401||r.cors==="rejected"||r.name==="M_TOO_LARGE")return-1;if(r.name==="M_LIMIT_EXCEEDED"){const i=r.data.retry_after_ms;if(i>0)return i}return t>4?-1:1e3*Math.pow(2,t)}static QUEUE_MESSAGES(e){return e.getType()===gO.EventType.RoomMessage||e.hasAssocation()?"message":null}constructor(e=Al.RETRY_BACKOFF_RATELIMIT,t=Al.QUEUE_MESSAGES){this.retryAlgorithm=e,this.queueAlgorithm=t,(0,kc.default)(this,"queues",{}),(0,kc.default)(this,"activeQueues",[]),(0,kc.default)(this,"procFn",null),(0,kc.default)(this,"processQueue",r=>{const i=this.peekNextEvent(r);if(!i){const s=this.activeQueues.indexOf(r);s>=0&&this.activeQueues.splice(s,1);return}ea("Queue '%s' has %s pending events",r,this.queues[r].length),Promise.resolve().then(()=>this.procFn(i.event)).then(s=>{this.removeNextEvent(r),ea("Queue '%s' sent event %s",r,i.event.getId()),i.defer.resolve(s),this.processQueue(r)},s=>{i.attempts+=1;const o=this.retryAlgorithm(i.event,i.attempts,s);ea("retry(%s) err=%s event_id=%s waitTime=%s",i.attempts,s,i.event.getId(),o),o===-1?(ea("Queue '%s' giving up on event %s",r,i.event.getId()),this.removeNextEvent(r),i.defer.reject(s),this.processQueue(r)):setTimeout(this.processQueue,o,r)})})}getQueueForEvent(e){const t=this.queueAlgorithm(e);return!t||!this.queues[t]?null:this.queues[t].map(function(r){return r.event})}removeEventFromQueue(e){const t=this.queueAlgorithm(e);if(!t||!this.queues[t])return!1;let r=!1;return fg.removeElement(this.queues[t],i=>{if(i.event.getId()===e.getId())return r=!0,!0}),r}setProcessFunction(e){this.procFn=e,this.startProcessingQueues()}queueEvent(e){const t=this.queueAlgorithm(e);if(!t)return null;this.queues[t]||(this.queues[t]=[]);const r=fg.defer();return this.queues[t].push({event:e,defer:r,attempts:0}),ea("Queue algorithm dumped event %s into queue '%s'",e.getId(),t),this.startProcessingQueues(),r.promise}startProcessingQueues(){!this.procFn||Object.keys(this.queues).filter(e=>this.activeQueues.indexOf(e)===-1&&this.queues[e].length>0).forEach(e=>{this.activeQueues.push(e),this.processQueue(e)})}peekNextEvent(e){const t=this.queues[e];return Array.isArray(t)?t[0]:null}removeNextEvent(e){const t=this.queues[e];return Array.isArray(t)?t.shift():null}}Zl.MatrixScheduler=Al;function ea(...n){}var ot={},Bi={},hr={},ri={},Wt={},yO=G.exports;Object.defineProperty(Wt,"__esModule",{value:!0});Wt.EventTimeline=Wt.Direction=void 0;var Jr=yO(Y.exports),pg=Tn,vO=ne;let ys;Wt.Direction=ys;(function(n){n.Backward="b",n.Forward="f"})(ys||(Wt.Direction=ys={}));class or{static setEventMetadata(e,t,r){var i,s,o,a;(i=e.sender)!==null&&i!==void 0&&(s=i.events)!==null&&s!==void 0&&s.member||(e.sender=t.getSentinelMember(e.getSender())),!((o=e.target)!==null&&o!==void 0&&(a=o.events)!==null&&a!==void 0&&a.member)&&e.getType()===vO.EventType.RoomMember&&(e.target=t.getSentinelMember(e.getStateKey())),e.isState()&&r&&(e.forwardLooking=!1)}constructor(e){var t,r;this.eventTimelineSet=e,(0,Jr.default)(this,"roomId",void 0),(0,Jr.default)(this,"name",void 0),(0,Jr.default)(this,"events",[]),(0,Jr.default)(this,"baseIndex",0),(0,Jr.default)(this,"startState",void 0),(0,Jr.default)(this,"endState",void 0),(0,Jr.default)(this,"prevTimeline",void 0),(0,Jr.default)(this,"nextTimeline",void 0),(0,Jr.default)(this,"paginationRequests",{[ys.Backward]:null,[ys.Forward]:null}),this.roomId=(t=(r=e.room)===null||r===void 0?void 0:r.roomId)!==null&&t!==void 0?t:null,this.startState=new pg.RoomState(this.roomId),this.startState.paginationToken=null,this.endState=new pg.RoomState(this.roomId),this.endState.paginationToken=null,this.prevTimeline=null,this.nextTimeline=null,this.paginationRequests={b:null,f:null},this.name=this.roomId+":"+new Date().toISOString()}initialiseState(e){if(this.events.length>0)throw new Error("Cannot initialise state after events are added");for(const t of e)Object.freeze(t);this.startState.setStateEvents(e),this.endState.setStateEvents(e)}forkLive(e){const t=this.getState(e),r=new or(this.eventTimelineSet);return r.startState=t.clone(),r.endState=t,this.endState=t.clone(),r}fork(e){const t=this.getState(e),r=new or(this.eventTimelineSet);return r.startState=t.clone(),r.endState=t.clone(),r}getRoomId(){return this.roomId}getFilter(){return this.eventTimelineSet.getFilter()}getTimelineSet(){return this.eventTimelineSet}getBaseIndex(){return this.baseIndex}getEvents(){return this.events}getState(e){if(e==or.BACKWARDS)return this.startState;if(e==or.FORWARDS)return this.endState;throw new Error("Invalid direction '"+e+"'")}getPaginationToken(e){return this.getState(e).paginationToken}setPaginationToken(e,t){this.getState(t).paginationToken=e}getNeighbouringTimeline(e){if(e==or.BACKWARDS)return this.prevTimeline;if(e==or.FORWARDS)return this.nextTimeline;throw new Error("Invalid direction '"+e+"'")}setNeighbouringTimeline(e,t){if(this.getNeighbouringTimeline(t))throw new Error("timeline already has a neighbouring timeline - cannot reset neighbour (direction: "+t+")");if(t==or.BACKWARDS)this.prevTimeline=e;else if(t==or.FORWARDS)this.nextTimeline=e;else throw new Error("Invalid direction '"+t+"'");this.setPaginationToken(null,t)}addEvent(e,t,r){r||(r=t?this.startState:this.endState);const i=this.getTimelineSet();i.room&&(or.setEventMetadata(e,r,t),e.isState()&&i.room.getUnfilteredTimelineSet()===i&&(r.setStateEvents([e]),(!e.sender||e.getType()==="m.room.member"&&!t)&&or.setEventMetadata(e,r,t)));let s;t?s=0:s=this.events.length,this.events.splice(s,0,e),t&&this.baseIndex++}removeEvent(e){for(let t=this.events.length-1;t>=0;t--){const r=this.events[t];if(r.getId()==e)return this.events.splice(t,1),t<this.baseIndex&&this.baseIndex--,r}return null}toString(){return this.name}}Wt.EventTimeline=or;(0,Jr.default)(or,"BACKWARDS",ys.Backward);(0,Jr.default)(or,"FORWARDS",ys.Forward);var Ht={},dt={},_O=G.exports;Object.defineProperty(dt,"__esModule",{value:!0});dt.ThreadFilterType=dt.ThreadEvent=dt.Thread=dt.THREAD_RELATION_TYPE=dt.FILTER_RELATED_BY_SENDERS=dt.FILTER_RELATED_BY_REL_TYPES=void 0;var zr=_O(Y.exports),Cc=Ps,EO=sn,gg=Ht,Qu=Wt,SO=ri,bO=je,Tf=wr;let vo;dt.ThreadEvent=vo;(function(n){n.New="Thread.new",n.Update="Thread.update",n.NewReply="Thread.newReply",n.ViewThread="Thread.viewThread"})(vo||(dt.ThreadEvent=vo={}));class mn extends bO.TypedEventEmitter{constructor(e,t){var r;if(super(),this.rootEvent=e,(0,zr.default)(this,"timelineSet",void 0),(0,zr.default)(this,"_currentUserParticipated",!1),(0,zr.default)(this,"reEmitter",void 0),(0,zr.default)(this,"lastEvent",void 0),(0,zr.default)(this,"replyCount",0),(0,zr.default)(this,"room",void 0),(0,zr.default)(this,"client",void 0),(0,zr.default)(this,"initialEventsFetched",!1),(0,zr.default)(this,"id",void 0),(0,zr.default)(this,"onEcho",o=>{this.timelineSet.eventIdToTimeline(o.getId())&&this.emit(vo.Update,this)}),this.room=t.room,this.client=t.client,this.timelineSet=new SO.EventTimelineSet(this.room,{unstableClientRelationAggregation:!0,timelineSupport:!0,pendingEvents:!0}),this.reEmitter=new EO.TypedReEmitter(this),this.reEmitter.reEmit(this.timelineSet,[Cc.RoomEvent.Timeline,Cc.RoomEvent.TimelineReset]),e)this.id=e.getId();else{var i,s;this.id=t==null||(i=t.initialEvents)===null||i===void 0||(s=i.find(o=>o.isThreadRelation))===null||s===void 0?void 0:s.relationEventId}this.initialiseThread(this.rootEvent),t==null||(r=t.initialEvents)===null||r===void 0||r.forEach(o=>this.addEvent(o,!1)),this.room.on(Cc.RoomEvent.LocalEchoUpdated,this.onEcho),this.room.on(Cc.RoomEvent.Timeline,this.onEcho)}static setServerSideSupport(e,t){mn.hasServerSideSupport=e,t||(s_.setPreferUnstable(!0),o_.setPreferUnstable(!0),ba.setPreferUnstable(!0))}get roomState(){return this.room.getLiveTimeline().getState(Qu.EventTimeline.FORWARDS)}addEventToTimeline(e,t){if(e.getUnsigned().transaction_id){const r=this.room.getEventForTxnId(e.getUnsigned().transaction_id);if(r){this.room.handleRemoteEcho(e,r);return}}this.findEventById(e.getId())||this.timelineSet.addEventToTimeline(e,this.liveTimeline,t,!1,this.roomState)}async addEvent(e,t){var r;mn.hasServerSideSupport||(e.setThread(this),this.addEventToTimeline(e,t),await this.client.decryptEventIfNeeded(e,{})),mn.hasServerSideSupport&&this.initialEventsFetched&&e.localTimestamp>this.lastReply().localTimestamp&&this.addEventToTimeline(e,!1),!this._currentUserParticipated&&e.getSender()===this.client.getUserId()&&(this._currentUserParticipated=!0);const i=((r=e.getRelation())===null||r===void 0?void 0:r.rel_type)===ba.name;!mn.hasServerSideSupport&&i&&this.replyCount++,(!this.lastEvent||i&&e.getId()!==this.lastEvent.getId()&&e.localTimestamp>this.lastEvent.localTimestamp)&&(this.lastEvent=e,this.lastEvent.getId()!==this.id&&(mn.hasServerSideSupport&&this.replyCount++,this.emit(vo.NewReply,this,e))),this.emit(vo.Update,this)}initialiseThread(e){const t=e==null?void 0:e.getServerAggregatedRelation(ba.name);if(mn.hasServerSideSupport&&t){this.replyCount=t.count,this._currentUserParticipated=t.current_user_participated;const r=new gg.MatrixEvent(t.latest_event);this.setEventMetadata(r),this.lastEvent=r}}async fetchInitialEvents(){if(!mn.hasServerSideSupport)return this.initialEventsFetched=!0,null;try{const e=await this.fetchEvents();return this.initialEventsFetched=!0,e}catch{return null}}setEventMetadata(e){Qu.EventTimeline.setEventMetadata(e,this.roomState,!1),e.setThread(this)}findEventById(e){return this.timelineSet.findEventById(e)}lastReply(e=()=>!0){for(let t=this.events.length-1;t>=0;t--){const r=this.events[t];if(e(r))return r}}get roomId(){return this.room.roomId}get length(){return this.replyCount}get replyToEvent(){return this.lastEvent}get events(){return this.liveTimeline.getEvents()}has(e){return this.timelineSet.findEventById(e)instanceof gg.MatrixEvent}get hasCurrentUserParticipated(){return this._currentUserParticipated}get liveTimeline(){return this.timelineSet.getLiveTimeline()}async fetchEvents(e={limit:20}){let{originalEvent:t,events:r,prevBatch:i,nextBatch:s}=await this.client.relations(this.room.roomId,this.id,ba.name,null,e);!e.to&&!s&&(r=[...r,t]),await Promise.all(r.map(a=>(this.setEventMetadata(a),this.client.decryptEventIfNeeded(a))));const o=!e.direction||e.direction===Qu.Direction.Backward;return this.timelineSet.addEventsToTimeline(r,o,this.liveTimeline,o?s:i),{originalEvent:t,events:r,prevBatch:i,nextBatch:s}}}dt.Thread=mn;(0,zr.default)(mn,"hasServerSideSupport",void 0);const s_=new Tf.ServerControlledNamespacedValue("related_by_senders","io.element.relation_senders");dt.FILTER_RELATED_BY_SENDERS=s_;const o_=new Tf.ServerControlledNamespacedValue("related_by_rel_types","io.element.relation_types");dt.FILTER_RELATED_BY_REL_TYPES=o_;const ba=new Tf.ServerControlledNamespacedValue("m.thread","io.element.thread");dt.THREAD_RELATION_TYPE=ba;let Ph;dt.ThreadFilterType=Ph;(function(n){n[n.My=0]="My",n[n.All=1]="All"})(Ph||(dt.ThreadFilterType=Ph={}));var jo={};Object.defineProperty(jo,"__esModule",{value:!0});jo.EventStatus=void 0;let Mh;jo.EventStatus=Mh;(function(n){n.NOT_SENT="not_sent",n.ENCRYPTING="encrypting",n.SENDING="sending",n.QUEUED="queued",n.SENT="sent",n.CANCELLED="cancelled"})(Mh||(jo.EventStatus=Mh={}));(function(n){var e=G.exports;Object.defineProperty(n,"__esModule",{value:!0}),Object.defineProperty(n,"EventStatus",{enumerable:!0,get:function(){return c.EventStatus}}),n.MatrixEventEvent=n.MatrixEvent=void 0;var t=e(Y.exports),r=Yl,i=ie,s=ne,o=W,a=dt,l=sn,u=je,c=jo;const g={};function m(C){return g[C]||(g[C]=C),g[C]}const f=Object.freeze({visible:!0});let _;n.MatrixEventEvent=_,function(C){C.Decrypted="Event.decrypted",C.BeforeRedaction="Event.beforeRedaction",C.VisibilityChange="Event.visibilityChange",C.LocalEventIdReplaced="Event.localEventIdReplaced",C.Status="Event.status",C.Replaced="Event.replaced",C.RelationsCreated="Event.relationsCreated"}(_||(n.MatrixEventEvent=_={}));class I extends u.TypedEventEmitter{constructor(S={}){var k;super(),this.event=S,(0,t.default)(this,"pushActions",null),(0,t.default)(this,"_replacingEvent",null),(0,t.default)(this,"_localRedactionEvent",null),(0,t.default)(this,"_isCancelled",!1),(0,t.default)(this,"clearEvent",void 0),(0,t.default)(this,"visibility",f),(0,t.default)(this,"_hasCachedExtEv",!1),(0,t.default)(this,"_cachedExtEv",void 0),(0,t.default)(this,"senderCurve25519Key",null),(0,t.default)(this,"claimedEd25519Key",null),(0,t.default)(this,"forwardingCurve25519KeyChain",[]),(0,t.default)(this,"untrusted",null),(0,t.default)(this,"_decryptionPromise",null),(0,t.default)(this,"retryDecryption",!1),(0,t.default)(this,"txnId",null),(0,t.default)(this,"thread",null),(0,t.default)(this,"threadId",void 0),(0,t.default)(this,"localTimestamp",void 0),(0,t.default)(this,"sender",null),(0,t.default)(this,"target",null),(0,t.default)(this,"status",null),(0,t.default)(this,"error",null),(0,t.default)(this,"forwardLooking",!0),(0,t.default)(this,"verificationRequest",null),(0,t.default)(this,"reEmitter",void 0),["state_key","type","sender","room_id","membership"].forEach(A=>{typeof S[A]=="string"&&(S[A]=m(S[A]))}),["membership","avatar_url","displayname"].forEach(A=>{var w;typeof((w=S.content)===null||w===void 0?void 0:w[A])=="string"&&(S.content[A]=m(S.content[A]))}),["rel_type"].forEach(A=>{var w,L;typeof((w=S.content)===null||w===void 0||(L=w["m.relates_to"])===null||L===void 0?void 0:L[A])=="string"&&(S.content["m.relates_to"][A]=m(S.content["m.relates_to"][A]))}),this.txnId=S.txn_id||null,this.localTimestamp=Date.now()-((k=this.getAge())!==null&&k!==void 0?k:0),this.reEmitter=new l.TypedReEmitter(this)}get unstableExtensibleEvent(){return this._hasCachedExtEv||(this._cachedExtEv=r.ExtensibleEvents.parse(this.getEffectiveEvent())),this._cachedExtEv}invalidateExtensibleEvent(){this._hasCachedExtEv=!1}getEffectiveEvent(){const S=Object.assign({},this.getContent());if(this.getWireType()===s.EventType.RoomMessageEncrypted)for(const[k,A]of Object.entries(this.getWireContent()))["algorithm","ciphertext","device_id","sender_key","session_id"].includes(k)||S[k]===void 0&&(S[k]=A);return Object.assign({},this.event,this.clearEvent,{content:S})}getId(){return this.event.event_id}getSender(){return this.event.sender||this.event.user_id}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}getOriginalContent(){return this._localRedactionEvent?{}:this.clearEvent?this.clearEvent.content||{}:this.event.content||{}}getContent(){return this._localRedactionEvent?{}:this._replacingEvent?this._replacingEvent.getContent()["m.new_content"]||{}:this.getOriginalContent()}getWireContent(){return this.event.content||{}}get threadRootId(){var S;const k=(S=this.getWireContent())===null||S===void 0?void 0:S["m.relates_to"];if((k==null?void 0:k.rel_type)===a.THREAD_RELATION_TYPE.name)return k.event_id;var A;return((A=this.getThread())===null||A===void 0?void 0:A.id)||this.threadId}get isThreadRelation(){return!!this.threadRootId&&this.threadId!==this.getId()}get isThreadRoot(){var S;return!!this.getServerAggregatedRelation(a.THREAD_RELATION_TYPE.name)||((S=this.getThread())===null||S===void 0?void 0:S.id)===this.getId()}get replyEventId(){var S;const k=this.getContent()["m.relates_to"]||this.getWireContent()["m.relates_to"];return k==null||(S=k["m.in_reply_to"])===null||S===void 0?void 0:S.event_id}get relationEventId(){var S,k;return(S=this.getWireContent())===null||S===void 0||(k=S["m.relates_to"])===null||k===void 0?void 0:k.event_id}getPrevContent(){return this.getUnsigned().prev_content||this.event.prev_content||{}}getDirectionalContent(){return this.forwardLooking?this.getContent():this.getPrevContent()}getAge(){return this.getUnsigned().age||this.event.age}getLocalAge(){return Date.now()-this.localTimestamp}getStateKey(){return this.event.state_key}isState(){return this.event.state_key!==void 0}makeEncrypted(S,k,A,w){this.clearEvent={type:this.event.type,content:this.event.content},this.event.type=S,this.event.content=k,this.senderCurve25519Key=A,this.claimedEd25519Key=w}isBeingDecrypted(){return this._decryptionPromise!=null}getDecryptionPromise(){return this._decryptionPromise}isDecryptionFailure(){var S,k;return((S=this.clearEvent)===null||S===void 0||(k=S.content)===null||k===void 0?void 0:k.msgtype)==="m.bad.encrypted"}shouldAttemptDecryption(){return!(this.isRedacted()||this.isBeingDecrypted()||this.clearEvent||!this.isEncrypted())}async attemptDecryption(S,k={}){if(typeof k=="boolean"&&(k={isRetry:k}),!this.isEncrypted())throw new Error("Attempt to decrypt event which isn't encrypted");if(this.clearEvent&&!this.isDecryptionFailure())throw new Error("Attempt to decrypt event which has already been decrypted");return this._decryptionPromise?(i.logger.log(`Event ${this.getId()} already being decrypted; queueing a retry`),this.retryDecryption=!0,this._decryptionPromise):(this._decryptionPromise=this.decryptionLoop(S,k),this._decryptionPromise)}cancelAndResendKeyRequest(S,k){const A=this.getWireContent();return S.requestRoomKey({algorithm:A.algorithm,room_id:this.getRoomId(),session_id:A.session_id,sender_key:A.sender_key},this.getKeyRequestRecipients(k),!0)}getKeyRequestRecipients(S){const k=this.getWireContent(),A=[{userId:S,deviceId:"*"}],w=this.getSender();return w!==S&&A.push({userId:w,deviceId:k.device_id}),A}async decryptionLoop(S,k={}){for(await Promise.resolve();;){this.retryDecryption=!1;let A,w;try{S?(A=await S.decryptEvent(this),k.isRetry===!0&&i.logger.info(`Decrypted event on retry (id=${this.getId()})`)):A=this.badEncryptedMessage("Encryption not enabled")}catch(L){if(L.name!=="DecryptionError"){const q=k.isRetry?"re":"";i.logger.error(`Error ${q}decrypting event (id=${this.getId()}): ${L.stack||L}`),this._decryptionPromise=null,this.retryDecryption=!1;return}if(w=L,this.retryDecryption){i.logger.log(`Got error decrypting event (id=${this.getId()}: ${L}), but retrying`);continue}i.logger.warn(`Error decrypting event (id=${this.getId()}): ${L.detailedString}`),A=this.badEncryptedMessage(L.message)}this._decryptionPromise=null,this.retryDecryption=!1,this.setClearData(A),this.setPushActions(null),k.emit!==!1&&this.emit(_.Decrypted,this,w);return}}badEncryptedMessage(S){return{clearEvent:{type:s.EventType.RoomMessage,content:{msgtype:"m.bad.encrypted",body:"** Unable to decrypt: "+S+" **"}}}}setClearData(S){this.clearEvent=S.clearEvent,this.senderCurve25519Key=S.senderCurve25519Key||null,this.claimedEd25519Key=S.claimedEd25519Key||null,this.forwardingCurve25519KeyChain=S.forwardingCurve25519KeyChain||[],this.untrusted=S.untrusted||!1,this.invalidateExtensibleEvent()}getClearContent(){return this.clearEvent?this.clearEvent.content:null}isEncrypted(){return!this.isState()&&this.event.type===s.EventType.RoomMessageEncrypted}getSenderKey(){return this.senderCurve25519Key}getKeysClaimed(){return{ed25519:this.claimedEd25519Key}}getClaimedEd25519Key(){return this.claimedEd25519Key}getForwardingCurve25519KeyChain(){return this.forwardingCurve25519KeyChain}isKeySourceUntrusted(){return this.untrusted}getUnsigned(){return this.event.unsigned||{}}setUnsigned(S){this.event.unsigned=S}unmarkLocallyRedacted(){const S=this._localRedactionEvent;return this._localRedactionEvent=null,this.event.unsigned&&(this.event.unsigned.redacted_because=null),!!S}markLocallyRedacted(S){this._localRedactionEvent||(this.emit(_.BeforeRedaction,this,S),this._localRedactionEvent=S,this.event.unsigned||(this.event.unsigned={}),this.event.unsigned.redacted_because=S.event)}applyVisibilityEvent(S){const k=S?S.visible:!0,A=S?S.reason:null;let w=!1;(this.visibility.visible!==S.visible||!this.visibility.visible&&this.visibility.reason!==A)&&(w=!0),w&&(k?this.visibility=f:this.visibility=Object.freeze({visible:!1,reason:A}),w&&this.emit(_.VisibilityChange,this,k))}messageVisibility(){return this.visibility}makeRedacted(S){if(!S.event)throw new Error("invalid redactionEvent in makeRedacted");this._localRedactionEvent=null,this.emit(_.BeforeRedaction,this,S),this._replacingEvent=null,this.event.unsigned||(this.event.unsigned={}),this.event.unsigned.redacted_because=S.event;let k;for(k in this.event)!this.event.hasOwnProperty(k)||R.has(k)||delete this.event[k];const A=T[this.getType()]||{},w=this.getContent();for(k in w)!w.hasOwnProperty(k)||A[k]||delete w[k];this.invalidateExtensibleEvent()}isRedacted(){return Boolean(this.getUnsigned().redacted_because)}isRedaction(){return this.getType()===s.EventType.RoomRedaction}asVisibilityChange(){if(!s.EVENT_VISIBILITY_CHANGE_TYPE.matches(this.getType()))return null;const S=this.getRelation();if(!S||S.rel_type!="m.reference")return null;const k=S.event_id;if(!k)return null;const A=this.getWireContent(),w=!!A.visible,L=A.reason;return L&&typeof L!="string"?null:{visible:w,reason:L,eventId:k}}isVisibilityEvent(){return s.EVENT_VISIBILITY_CHANGE_TYPE.matches(this.getType())}getRedactionEvent(){var S;if(!this.isRedacted())return null;if((S=this.clearEvent)!==null&&S!==void 0&&S.unsigned){var k;return(k=this.clearEvent)===null||k===void 0?void 0:k.unsigned.redacted_because}else return this.event.unsigned.redacted_because?this.event.unsigned.redacted_because:{}}getPushActions(){return this.pushActions}setPushActions(S){this.pushActions=S}handleRemoteEcho(S){const k=this.getUnsigned(),A=this.getId();this.event=S,k.redacted_because&&(this.event.unsigned||(this.event.unsigned={}),this.event.unsigned.redacted_because=k.redacted_because),this.setStatus(null),this.getId()!==A&&this.emit(_.LocalEventIdReplaced,this),this.localTimestamp=Date.now()-this.getAge()}isSending(){return!!this.status}setStatus(S){this.status=S,this.emit(_.Status,this,S)}replaceLocalEventId(S){this.event.event_id=S,this.emit(_.LocalEventIdReplaced,this)}isRelation(S=void 0){const k=this.getWireContent(),A=k&&k["m.relates_to"];return A&&A.rel_type&&A.event_id&&(S&&A.rel_type===S||!S)}getRelation(){return this.isRelation()?this.getWireContent()["m.relates_to"]:null}makeReplaced(S){this.isRedacted()&&S||this._replacingEvent!==S&&(this._replacingEvent=S,this.emit(_.Replaced,this),this.invalidateExtensibleEvent())}getAssociatedStatus(){return this._replacingEvent?this._replacingEvent.status:this._localRedactionEvent?this._localRedactionEvent.status:this.status}getServerAggregatedRelation(S){var k;return(k=this.getUnsigned()["m.relations"])===null||k===void 0?void 0:k[S]}replacingEventId(){const S=this.getServerAggregatedRelation(s.RelationType.Replace);if(S)return S.event_id;if(this._replacingEvent)return this._replacingEvent.getId()}replacingEvent(){return this._replacingEvent}replacingEventDate(){const S=this.getServerAggregatedRelation(s.RelationType.Replace);if(S){const k=S.origin_server_ts;if(Number.isFinite(k))return new Date(k)}else if(this._replacingEvent)return this._replacingEvent.getDate()}localRedactionEvent(){return this._localRedactionEvent}getAssociatedId(){const S=this.getRelation();if(this.replyEventId)return this.replyEventId;if(S)return S.event_id;if(this.isRedaction())return this.event.redacts}hasAssocation(){return!!this.getAssociatedId()}updateAssociatedId(S){const k=this.getRelation();k?k.event_id=S:this.isRedaction()&&(this.event.redacts=S)}flagCancelled(S=!0){this._isCancelled=S}isCancelled(){return this._isCancelled}toSnapshot(){const S=new I(JSON.parse(JSON.stringify(this.event)));for(const[k,A]of Object.entries(this))k!=="event"&&(S[k]=A);return S}isEquivalentTo(S){if(!S)return!1;if(S===this)return!0;const k=(0,o.deepSortedObjectEntries)(this.event),A=(0,o.deepSortedObjectEntries)(S.event);return JSON.stringify(k)===JSON.stringify(A)}toJSON(){const S=this.getEffectiveEvent();return this.isEncrypted()?{decrypted:S,encrypted:this.event}:S}setVerificationRequest(S){this.verificationRequest=S}setTxnId(S){this.txnId=S}getTxnId(){return this.txnId}setThread(S){this.thread=S,this.setThreadId(S.id),this.reEmitter.reEmit(S,[a.ThreadEvent.Update])}getThread(){return this.thread}setThreadId(S){this.threadId=S}}n.MatrixEvent=I;const R=new Set(["event_id","type","room_id","user_id","sender","state_key","prev_state","content","unsigned","origin_server_ts"]),T={[s.EventType.RoomMember]:{membership:1},[s.EventType.RoomCreate]:{creator:1},[s.EventType.RoomJoinRules]:{join_rule:1},[s.EventType.RoomPowerLevels]:{ban:1,events:1,events_default:1,kick:1,redact:1,state_default:1,users:1,users_default:1},[s.EventType.RoomAliases]:{aliases:1}}})(Ht);var vs={},wO=G.exports;Object.defineProperty(vs,"__esModule",{value:!0});vs.RelationsEvent=vs.Relations=void 0;var xn=wO(Y.exports),Wi=Ht,Pc=ie,Wr=ne,RO=je;let _o;vs.RelationsEvent=_o;(function(n){n.Add="Relations.add",n.Remove="Relations.remove",n.Redaction="Relations.redaction"})(_o||(vs.RelationsEvent=_o={}));class IO extends RO.TypedEventEmitter{constructor(e,t,r){super(),this.relationType=e,this.eventType=t,this.room=r,(0,xn.default)(this,"relationEventIds",new Set),(0,xn.default)(this,"relations",new Set),(0,xn.default)(this,"annotationsByKey",{}),(0,xn.default)(this,"annotationsBySender",{}),(0,xn.default)(this,"sortedAnnotationsByKey",[]),(0,xn.default)(this,"targetEvent",null),(0,xn.default)(this,"creationEmitted",!1),(0,xn.default)(this,"onEventStatus",(i,s)=>{if(!i.isSending()){i.removeListener(Wi.MatrixEventEvent.Status,this.onEventStatus);return}s===Wi.EventStatus.CANCELLED&&(i.removeListener(Wi.MatrixEventEvent.Status,this.onEventStatus),this.removeEvent(i))}),(0,xn.default)(this,"onBeforeRedaction",async i=>{if(!!this.relations.has(i)){if(this.relations.delete(i),this.relationType===Wr.RelationType.Annotation)this.removeAnnotationFromAggregation(i);else if(this.relationType===Wr.RelationType.Replace&&this.targetEvent){const s=await this.getLastReplacement();this.targetEvent.makeReplaced(s)}i.removeListener(Wi.MatrixEventEvent.BeforeRedaction,this.onBeforeRedaction),this.emit(_o.Redaction,i)}})}async addEvent(e){if(this.relationEventIds.has(e.getId()))return;const t=e.getRelation();if(!t){Pc.logger.error("Event must have relation info");return}const r=t.rel_type,i=e.getType();if(this.relationType!==r||this.eventType!==i){Pc.logger.error("Event relation info doesn't match this container");return}if(e.isSending()&&e.on(Wi.MatrixEventEvent.Status,this.onEventStatus),this.relations.add(e),this.relationEventIds.add(e.getId()),this.relationType===Wr.RelationType.Annotation)this.addAnnotationToAggregation(e);else if(this.relationType===Wr.RelationType.Replace&&this.targetEvent){const s=await this.getLastReplacement();this.targetEvent.makeReplaced(s)}e.on(Wi.MatrixEventEvent.BeforeRedaction,this.onBeforeRedaction),this.emit(_o.Add,e),this.maybeEmitCreated()}async removeEvent(e){if(!this.relations.has(e))return;const t=e.getRelation();if(!t){Pc.logger.error("Event must have relation info");return}const r=t.rel_type,i=e.getType();if(this.relationType!==r||this.eventType!==i){Pc.logger.error("Event relation info doesn't match this container");return}if(this.relations.delete(e),this.relationType===Wr.RelationType.Annotation)this.removeAnnotationFromAggregation(e);else if(this.relationType===Wr.RelationType.Replace&&this.targetEvent){const s=await this.getLastReplacement();this.targetEvent.makeReplaced(s)}this.emit(_o.Remove,e)}getRelations(){return[...this.relations]}addAnnotationToAggregation(e){const{key:t}=e.getRelation();if(!t)return;let r=this.annotationsByKey[t];r||(r=this.annotationsByKey[t]=new Set,this.sortedAnnotationsByKey.push([t,r])),r.add(e),this.sortedAnnotationsByKey.sort((o,a)=>{const l=o[1];return a[1].size-l.size});const i=e.getSender();let s=this.annotationsBySender[i];s||(s=this.annotationsBySender[i]=new Set),s.add(e)}removeAnnotationFromAggregation(e){const{key:t}=e.getRelation();if(!t)return;const r=this.annotationsByKey[t];r&&(r.delete(e),this.sortedAnnotationsByKey.sort((o,a)=>{const l=o[1];return a[1].size-l.size}));const i=e.getSender(),s=this.annotationsBySender[i];s&&s.delete(e)}getSortedAnnotationsByKey(){return this.relationType!==Wr.RelationType.Annotation?null:this.sortedAnnotationsByKey}getAnnotationsBySender(){return this.relationType!==Wr.RelationType.Annotation?null:this.annotationsBySender}async getLastReplacement(){if(this.relationType!==Wr.RelationType.Replace||!this.targetEvent)return null;const e=this.targetEvent.getServerAggregatedRelation(Wr.RelationType.Replace),t=e&&e.origin_server_ts,r=this.getRelations().reduce((i,s)=>s.getSender()!==this.targetEvent.getSender()||t&&t>s.getTs()||i&&i.getTs()>s.getTs()?i:s,null);return r!=null&&r.shouldAttemptDecryption()?await r.attemptDecryption(this.room.client.crypto):r!=null&&r.isBeingDecrypted()&&await r.getDecryptionPromise(),r}async setTargetEvent(e){if(!this.targetEvent){if(this.targetEvent=e,this.relationType===Wr.RelationType.Replace){const t=await this.getLastReplacement();t&&this.targetEvent.makeReplaced(t)}this.maybeEmitCreated()}}maybeEmitCreated(){this.creationEmitted||!this.targetEvent||!this.relations.size||(this.creationEmitted=!0,this.targetEvent.emit(Wi.MatrixEventEvent.RelationsCreated,this.relationType,this.eventType))}}vs.Relations=IO;var TO=G.exports;Object.defineProperty(ri,"__esModule",{value:!0});ri.EventTimelineSet=ri.DuplicateStrategy=void 0;var Ei=TO(Y.exports),gt=Wt,mg=Ht,cs=ie,OO=vs,Zu=hr,kO=je;let ao;ao=cs.logger.log.bind(cs.logger);let Ga;ri.DuplicateStrategy=Ga;(function(n){n.Ignore="ignore",n.Replace="replace"})(Ga||(ri.DuplicateStrategy=Ga={}));class CO extends kO.TypedEventEmitter{constructor(e,t){super(),this.room=e,(0,Ei.default)(this,"timelineSupport",void 0),(0,Ei.default)(this,"unstableClientRelationAggregation",void 0),(0,Ei.default)(this,"displayPendingEvents",void 0),(0,Ei.default)(this,"liveTimeline",void 0),(0,Ei.default)(this,"timelines",void 0),(0,Ei.default)(this,"_eventIdToTimeline",void 0),(0,Ei.default)(this,"filter",void 0),(0,Ei.default)(this,"relations",void 0),this.timelineSupport=Boolean(t.timelineSupport),this.liveTimeline=new gt.EventTimeline(this),this.unstableClientRelationAggregation=!!t.unstableClientRelationAggregation,this.displayPendingEvents=t.pendingEvents!==!1,this.timelines=[this.liveTimeline],this._eventIdToTimeline={},this.filter=t.filter,this.unstableClientRelationAggregation&&(this.relations={})}getTimelines(){return this.timelines}getFilter(){return this.filter}setFilter(e){this.filter=e}getPendingEvents(){return!this.room||!this.displayPendingEvents?[]:this.room.getPendingEvents()}getLiveTimeline(){return this.liveTimeline}eventIdToTimeline(e){return this._eventIdToTimeline[e]}replaceEventId(e,t){const r=this._eventIdToTimeline[e];r&&(delete this._eventIdToTimeline[e],this._eventIdToTimeline[t]=r)}resetLiveTimeline(e,t){const r=!this.timelineSupport||!t,i=this.liveTimeline,s=r?i.forkLive(gt.EventTimeline.FORWARDS):i.fork(gt.EventTimeline.FORWARDS);r?(this.timelines=[s],this._eventIdToTimeline={}):this.timelines.push(s),t&&i.setPaginationToken(t,gt.EventTimeline.FORWARDS),s.setPaginationToken(e,gt.EventTimeline.BACKWARDS),this.liveTimeline=s,this.emit(Zu.RoomEvent.TimelineReset,this.room,this,r)}getTimelineForEvent(e){const t=this._eventIdToTimeline[e];return t===void 0?null:t}findEventById(e){const t=this.getTimelineForEvent(e);if(!!t)return t.getEvents().find(function(r){return r.getId()==e})}addTimeline(){if(!this.timelineSupport)throw new Error("timeline support is disabled. Set the 'timelineSupport' parameter to true when creating MatrixClient to enable it.");const e=new gt.EventTimeline(this);return this.timelines.push(e),e}addEventsToTimeline(e,t,r,i){if(!r)throw new Error("'timeline' not specified for EventTimelineSet.addEventsToTimeline");if(!t&&r==this.liveTimeline)throw new Error("EventTimelineSet.addEventsToTimeline cannot be used for adding events to the live timeline - use Room.addLiveEvents instead");if(this.filter&&(e=this.filter.filterRoomTimeline(e),!e.length))return;const s=t?gt.EventTimeline.BACKWARDS:gt.EventTimeline.FORWARDS,o=t?gt.EventTimeline.FORWARDS:gt.EventTimeline.BACKWARDS;let a=!1,l=!1;for(let u=0;u<e.length;u++){const c=e[u],g=c.getId(),m=this._eventIdToTimeline[g];if(!m){this.addEventToTimeline(c,r,t),l=!0,a=!0;continue}if(l=!1,m==r){ao("Event "+g+" already in timeline "+r);continue}const f=r.getNeighbouringTimeline(s);if(f){m==f?ao("Event "+g+" in neighbouring timeline - switching to "+m):ao("Event "+g+" already in a different timeline "+m),r=m;continue}cs.logger.info("Already have timeline for "+g+" - joining timeline "+r+" to "+m);const _=m===this.liveTimeline,I=r===this.liveTimeline,R=s===gt.EventTimeline.BACKWARDS&&_,T=s===gt.EventTimeline.FORWARDS&&I;if(R||T){R&&cs.logger.warn("Refusing to set a preceding existingTimeLine on our timeline as the existingTimeLine is live ("+m+")"),T&&cs.logger.warn("Refusing to set our preceding timeline on a existingTimeLine as our timeline is live ("+r+")");continue}r.setNeighbouringTimeline(m,s),m.setNeighbouringTimeline(r,o),r=m,a=!0}if(l||!a){if(s===gt.EventTimeline.FORWARDS&&r===this.liveTimeline){cs.logger.warn({lastEventWasNew:l,didUpdate:a}),cs.logger.warn(`Refusing to set forwards pagination token of live timeline ${r} to ${i}`);return}r.setPaginationToken(i,s)}}addLiveEvent(e,t=Ga.Ignore,r=!1,i){if(this.filter&&!this.filter.filterRoomTimeline([e]).length)return;const s=this._eventIdToTimeline[e.getId()];if(s){if(t===Ga.Replace){ao("EventTimelineSet.addLiveEvent: replacing duplicate event "+e.getId());const o=s.getEvents();for(let a=0;a<o.length;a++)if(o[a].getId()===e.getId()){i||(i=s.getState(gt.EventTimeline.FORWARDS)),gt.EventTimeline.setEventMetadata(e,i,!1),o[a]=e;break}}else ao("EventTimelineSet.addLiveEvent: ignoring duplicate event "+e.getId());return}this.addEventToTimeline(e,this.liveTimeline,!1,r,i)}addEventToTimeline(e,t,r,i=!1,s){const o=e.getId();t.addEvent(e,r,s),this._eventIdToTimeline[o]=t,this.setRelationsTarget(e),this.aggregateRelations(e);const a={timeline:t,liveEvent:!r&&t==this.liveTimeline&&!i};this.emit(Zu.RoomEvent.Timeline,e,this.room,Boolean(r),!1,a)}handleRemoteEcho(e,t,r){const i=this._eventIdToTimeline[t];i?(delete this._eventIdToTimeline[t],this._eventIdToTimeline[r]=i):this.filter?this.filter.filterRoomTimeline([e]).length&&this.addEventToTimeline(e,this.liveTimeline,!1):this.addEventToTimeline(e,this.liveTimeline,!1)}removeEvent(e){const t=this._eventIdToTimeline[e];if(!t)return null;const r=t.removeEvent(e);if(r){delete this._eventIdToTimeline[e];const i={timeline:t};this.emit(Zu.RoomEvent.Timeline,r,this.room,void 0,!0,i)}return r}compareEventOrdering(e,t){if(e==t)return 0;const r=this._eventIdToTimeline[e],i=this._eventIdToTimeline[t];if(r===void 0||i===void 0)return null;if(r===i){let o,a;const l=r.getEvents();for(let u=0;u<l.length&&(o===void 0||a===void 0);u++){const c=l[u].getId();c==e&&(o=u),c==t&&(a=u)}return o-a}let s=r;for(;s;){if(s===i)return-1;s=s.getNeighbouringTimeline(gt.EventTimeline.FORWARDS)}for(s=r;s;){if(s===i)return 1;s=s.getNeighbouringTimeline(gt.EventTimeline.BACKWARDS)}return null}getRelationsForEvent(e,t,r){if(!this.unstableClientRelationAggregation)throw new Error("Client-side relation aggregation is disabled");if(!e||!t||!r)throw new Error("Invalid arguments for `getRelationsForEvent`");return((this.relations[e]||{})[t]||{})[r]}getAllRelationsEventForEvent(e){const t=this.relations[e]||{},r=[];for(const i of Object.values(t))for(const s of Object.values(i))r.push(...s.getRelations());return r}setRelationsTarget(e){if(!this.unstableClientRelationAggregation)return;const t=this.relations[e.getId()];if(!!t)for(const r of Object.values(t))for(const i of Object.values(r))i.setTargetEvent(e)}aggregateRelations(e){if(!this.unstableClientRelationAggregation||e.isRedacted()||e.status===mg.EventStatus.CANCELLED)return;if(e.isBeingDecrypted()||e.shouldAttemptDecryption()){e.once(mg.MatrixEventEvent.Decrypted,()=>{this.aggregateRelations(e)});return}const t=e.getRelation();if(!t)return;const r=t.event_id,i=t.rel_type,s=e.getType();let o=this.relations[r];o||(o=this.relations[r]={});let a=o[i];a||(a=o[i]={});let l=a[s],u;l||(l=a[s]=new OO.Relations(i,s,this.room),u=this.findEventById(r)||this.room.getPendingEvent(r),u&&l.setTargetEvent(u)),l.addEvent(e)}}ri.EventTimelineSet=CO;var uc={};Object.defineProperty(uc,"__esModule",{value:!0});uc.RoomSummary=void 0;class PO{constructor(e,t){this.roomId=e}}uc.RoomSummary=PO;var xs={},eu={};Object.defineProperty(eu,"__esModule",{value:!0});eu.FilterComponent=void 0;var Hi=dt;function MO(n,e){if(e.endsWith("*")){const t=e.slice(0,-1);return n.substr(0,t.length)===t}else return n===e}class DO{constructor(e,t){this.filterJson=e,this.userId=t}check(e){var t,r;const i=((t=e.getUnsigned())===null||t===void 0?void 0:t["m.relations"])||{},s=Object.keys(i),o=[];return this.userId&&i!==null&&i!==void 0&&(r=i[Hi.THREAD_RELATION_TYPE.name])!==null&&r!==void 0&&r.current_user_participated&&o.push(this.userId),this.checkFields(e.getRoomId(),e.getSender(),e.getType(),e.getContent()?e.getContent().url!==void 0:!1,s,o)}toJSON(){return{types:this.filterJson.types||null,not_types:this.filterJson.not_types||[],rooms:this.filterJson.rooms||null,not_rooms:this.filterJson.not_rooms||[],senders:this.filterJson.senders||null,not_senders:this.filterJson.not_senders||[],contains_url:this.filterJson.contains_url||null,[Hi.FILTER_RELATED_BY_SENDERS.name]:this.filterJson[Hi.FILTER_RELATED_BY_SENDERS.name]||[],[Hi.FILTER_RELATED_BY_REL_TYPES.name]:this.filterJson[Hi.FILTER_RELATED_BY_REL_TYPES.name]||[]}}checkFields(e,t,r,i,s,o){const a={rooms:function(g){return e===g},senders:function(g){return t===g},types:function(g){return MO(r,g)}};for(let g=0;g<Object.keys(a).length;g++){const m=Object.keys(a)[g],f=a[m],_="not_"+m,I=this.filterJson[_];if(I!=null&&I.some(f))return!1;const R=this.filterJson[m];if(R&&!R.some(f))return!1}const l=this.filterJson.contains_url;if(l!==void 0&&l!==i)return!1;const u=this.filterJson[Hi.FILTER_RELATED_BY_REL_TYPES.name];if(u!==void 0&&!this.arrayMatchesFilter(u,s))return!1;const c=this.filterJson[Hi.FILTER_RELATED_BY_SENDERS.name];return!(c!==void 0&&!this.arrayMatchesFilter(c,o))}arrayMatchesFilter(e,t){return t.length>0&&e.every(r=>t.includes(r))}filter(e){return e.filter(this.check,this)}limit(){return this.filterJson.limit!==void 0?this.filterJson.limit:10}}eu.FilterComponent=DO;var AO=G.exports;Object.defineProperty(xs,"__esModule",{value:!0});xs.Filter=void 0;var cl=AO(Y.exports),yg=eu;function ed(n,e,t){const r=e.split(".");let i=n;for(let s=0;s<r.length-1;s++)i[r[s]]||(i[r[s]]={}),i=i[r[s]];i[r[r.length-1]]=t}class tu{static fromJson(e,t,r){const i=new tu(e,t);return i.setDefinition(r),i}constructor(e,t){this.userId=e,this.filterId=t,(0,cl.default)(this,"definition",{}),(0,cl.default)(this,"roomFilter",void 0),(0,cl.default)(this,"roomTimelineFilter",void 0)}getFilterId(){return this.filterId}getDefinition(){return this.definition}setDefinition(e){this.definition=e;const t=e.room,r={};t&&(t.rooms&&(r.rooms=t.rooms),t.rooms&&(r.not_rooms=t.not_rooms)),this.roomFilter=new yg.FilterComponent(r,this.userId),this.roomTimelineFilter=new yg.FilterComponent((t==null?void 0:t.timeline)||{},this.userId)}getRoomTimelineFilterComponent(){return this.roomTimelineFilter}filterRoomTimeline(e){return this.roomTimelineFilter.filter(this.roomFilter.filter(e))}setTimelineLimit(e){ed(this.definition,"room.timeline.limit",e)}setLazyLoadMembers(e){ed(this.definition,"room.state.lazy_load_members",!!e)}setIncludeLeaveRooms(e){ed(this.definition,"room.include_leave",e)}}xs.Filter=tu;(0,cl.default)(tu,"LAZY_LOADING_MESSAGES_FILTER",{lazy_load_members:!0});var me={},Of={};/*!
+ * content-type
+ * Copyright(c) 2015 Douglas Christopher Wilson
+ * MIT Licensed
+ */var vg=/; *([!#$%&'*+.^_`|~0-9A-Za-z-]+) *= *("(?:[\u000b\u0020\u0021\u0023-\u005b\u005d-\u007e\u0080-\u00ff]|\\[\u000b\u0020-\u00ff])*"|[!#$%&'*+.^_`|~0-9A-Za-z-]+) */g,xO=/^[\u000b\u0020-\u007e\u0080-\u00ff]+$/,a_=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+$/,UO=/\\([\u000b\u0020-\u00ff])/g,$O=/([\\"])/g,c_=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+\/[!#$%&'*+.^_`|~0-9A-Za-z-]+$/;Of.format=NO;Of.parse=LO;function NO(n){if(!n||typeof n!="object")throw new TypeError("argument obj is required");var e=n.parameters,t=n.type;if(!t||!c_.test(t))throw new TypeError("invalid type");var r=t;if(e&&typeof e=="object")for(var i,s=Object.keys(e).sort(),o=0;o<s.length;o++){if(i=s[o],!a_.test(i))throw new TypeError("invalid parameter name");r+="; "+i+"="+KO(e[i])}return r}function LO(n){if(!n)throw new TypeError("argument string is required");var e=typeof n=="object"?BO(n):n;if(typeof e!="string")throw new TypeError("argument string is required to be a string");var t=e.indexOf(";"),r=t!==-1?e.substr(0,t).trim():e.trim();if(!c_.test(r))throw new TypeError("invalid media type");var i=new FO(r.toLowerCase());if(t!==-1){var s,o,a;for(vg.lastIndex=t;o=vg.exec(e);){if(o.index!==t)throw new TypeError("invalid parameter format");t+=o[0].length,s=o[1].toLowerCase(),a=o[2],a[0]==='"'&&(a=a.substr(1,a.length-2).replace(UO,"$1")),i.parameters[s]=a}if(t!==e.length)throw new TypeError("invalid parameter format")}return i}function BO(n){var e;if(typeof n.getHeader=="function"?e=n.getHeader("content-type"):typeof n.headers=="object"&&(e=n.headers&&n.headers["content-type"]),typeof e!="string")throw new TypeError("content-type header is missing from object");return e}function KO(n){var e=String(n);if(a_.test(e))return e;if(e.length>0&&!xO.test(e))throw new TypeError("invalid parameter value");return'"'+e.replace($O,"\\$1")+'"'}function FO(n){this.parameters=Object.create(null),this.type=n}var dc={};Object.defineProperty(dc,"__esModule",{value:!0});dc.clearTimeout=YO;dc.setNow=WO;dc.setTimeout=HO;var qO=ie;const jO=1e3;let VO=0,td;const Xn=[],GO=function(...n){};function WO(n){ru=n||Date.now}let ru=Date.now;function HO(n,e,...t){e=e||0,e<0&&(e=0);const r=ru()+e,i=VO++,s={runAt:r,func:n,params:t,key:i},o=JO(Xn,function(a){return a.runAt-r});return Xn.splice(o,0,s),kf(),i}function YO(n){if(Xn.length===0)return;let e;for(e=0;e<Xn.length;e++)if(Xn[e].key==n){Xn.splice(e,1);break}e===0&&kf()}function kf(){td&&V.clearTimeout(td);const n=Xn[0];if(!n)return;const e=ru(),t=Math.min(n.runAt-e,jO);td=V.setTimeout(zO,t)}function zO(){let n;const e=ru(),t=[];for(;;){const r=Xn[0];if(!r||r.runAt>e)break;n=Xn.shift(),GO("runCallbacks: popping",n.key),t.push(n)}kf();for(let r=0;r<t.length;r++){n=t[r];try{n.func.apply(V,n.params)}catch(i){qO.logger.error("Uncaught exception in callback function",i.stack||i)}}}function JO(n,e){let t=0,r=n.length;for(;t<r;){const i=t+r>>1;e(n[i])>0?r=i:t=i+1}return t}var XO=G.exports;Object.defineProperty(me,"__esModule",{value:!0});me.PREFIX_V1=me.PREFIX_UNSTABLE=me.PREFIX_R0=me.PREFIX_MEDIA_R0=me.PREFIX_IDENTITY_V2=me.PREFIX_IDENTITY_V1=me.Method=me.MatrixHttpApi=me.MatrixError=me.HttpApiEvent=me.ConnectionError=me.AbortError=void 0;me.retryNetworkOperation=ck;var Aa=XO(Y.exports),QO=Of,Yi=u_(dc),Si=u_(W),ll=ie;function l_(n){if(typeof WeakMap!="function")return null;var e=new WeakMap,t=new WeakMap;return(l_=function(r){return r?t:e})(n)}function u_(n,e){if(!e&&n&&n.__esModule)return n;if(n===null||typeof n!="object"&&typeof n!="function")return{default:n};var t=l_(e);if(t&&t.has(n))return t.get(n);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in n)if(s!=="default"&&Object.prototype.hasOwnProperty.call(n,s)){var o=i?Object.getOwnPropertyDescriptor(n,s):null;o&&(o.get||o.set)?Object.defineProperty(r,s,o):r[s]=n[s]}return r.default=n,t&&t.set(n,r),r}function _g(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function Eg(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?_g(Object(t),!0).forEach(function(r){(0,Aa.default)(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):_g(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}const ZO="/_matrix/client/r0";me.PREFIX_R0=ZO;const ek="/_matrix/client/v1";me.PREFIX_V1=ek;const tk="/_matrix/client/unstable";me.PREFIX_UNSTABLE=tk;const rk="/_matrix/identity/api/v1";me.PREFIX_IDENTITY_V1=rk;const nk="/_matrix/identity/v2";me.PREFIX_IDENTITY_V2=nk;const ik="/_matrix/media/r0";me.PREFIX_MEDIA_R0=ik;let Wa;me.Method=Wa;(function(n){n.Get="GET",n.Put="PUT",n.Post="POST",n.Delete="DELETE"})(Wa||(me.Method=Wa={}));let Ha;me.HttpApiEvent=Ha;(function(n){n.SessionLoggedOut="Session.logged_out",n.NoConsent="no_consent"})(Ha||(me.HttpApiEvent=Ha={}));class sk{constructor(e,t){this.eventEmitter=e,this.opts=t,(0,Aa.default)(this,"uploads",[]),Si.checkObjectHasKeys(t,["baseUrl","request","prefix"]),t.onlyData=!!t.onlyData,t.useAuthorizationHeader=!!t.useAuthorizationHeader}setIdBaseUrl(e){this.opts.idBaseUrl=e}getContentUri(){return{base:this.opts.baseUrl,path:"/_matrix/media/r0/upload",params:{access_token:this.opts.accessToken}}}uploadContent(e,t){Si.isFunction(t)?t={callback:t}:t||(t={});const r=t.includeFilename!==!1,i=t.type||e.type||"application/octet-stream",s=t.name||e.name;let o=e;const a=o.stream;a&&typeof a!="function"&&(ll.logger.warn("Using `file.stream` as the content to upload. Future versions of the js-sdk will change this to expect `file` to be the content directly."),o=a);let l=t.rawResponse;l===void 0&&(V.XMLHttpRequest?l=!1:(ll.logger.warn("Returning the raw JSON from uploadContent(). Future versions of the js-sdk will change this default, to return the parsed object. Set opts.rawResponse=false to change this behaviour now."),l=!0));let u=t.onlyContentUri;!l&&u===void 0&&(V.XMLHttpRequest?(ll.logger.warn("Returning only the content-uri from uploadContent(). Future versions of the js-sdk will change this default, to return the whole response object. Set opts.onlyContentUri=false to change this behaviour now."),u=!0):u=!1);const c={loaded:0,total:0};let g,m=null;if(l||(m=function(f){let _=JSON.parse(f);if(u&&(_=_.content_uri,_===void 0))throw Error("Bad response");return _}),V.XMLHttpRequest){const f=Si.defer(),_=new V.XMLHttpRequest,I=rd(f,t.callback,this.opts.onlyData),R=function(){_.abort(),I(new Error("Timeout"))};let T=Yi.setTimeout(R,3e4);_.onreadystatechange=function(){let k;switch(_.readyState){case V.XMLHttpRequest.DONE:Yi.clearTimeout(T);try{if(_.status===0)throw new d_;if(!_.responseText)throw new Error("No response body.");k=_.responseText,m&&(k=m(k))}catch(A){A.http_status=_.status,I(A);return}I(void 0,_,k);break}},_.upload.addEventListener("progress",function(k){Yi.clearTimeout(T),c.loaded=k.loaded,c.total=k.total,T=Yi.setTimeout(R,3e4),t.progressHandler&&t.progressHandler({loaded:k.loaded,total:k.total})});let C=this.opts.baseUrl+"/_matrix/media/r0/upload";const S=[];r&&s&&S.push("filename="+encodeURIComponent(s)),this.opts.useAuthorizationHeader||S.push("access_token="+encodeURIComponent(this.opts.accessToken)),S.length>0&&(C+="?"+S.join("&")),_.open("POST",C),this.opts.useAuthorizationHeader&&_.setRequestHeader("Authorization","Bearer "+this.opts.accessToken),_.setRequestHeader("Content-Type",i),_.send(o),g=f.promise,g.abort=_.abort.bind(_)}else{const f={};r&&s&&(f.filename=s);const _={"Content-Type":i};o.length===0&&(_["Content-Length"]="0"),g=this.authedRequest(t.callback,Wa.Post,"/upload",f,o,{prefix:"/_matrix/media/r0",headers:_,json:!1,bodyParser:m})}return c.promise=g.finally(()=>{for(let f=0;f<this.uploads.length;++f)if(this.uploads[f]===c){this.uploads.splice(f,1);return}}),c.promise.abort=g.abort,this.uploads.push(c),c.promise}cancelUpload(e){return e.abort?(e.abort(),!0):!1}getCurrentUploads(){return this.uploads}idServerRequest(e,t,r,i,s,o){if(!this.opts.idBaseUrl)throw new Error("No identity server base URL set");const a=this.opts.idBaseUrl+s+r;if(e!==void 0&&!Si.isFunction(e))throw Error("Expected callback to be a function but got "+typeof e);const l={uri:a,method:t,withCredentials:!1,json:!0,_matrix_opts:this.opts,headers:{}};t===Wa.Get?l.qs=i:typeof i=="object"&&(l.json=i),o&&(l.headers.Authorization=`Bearer ${o}`);const u=Si.defer();return this.opts.request(l,rd(u,e,this.opts.onlyData)),u.promise}authedRequest(e,t,r,i,s,o){i||(i={});let a=o||{};this.opts.useAuthorizationHeader?(isFinite(o)&&(a={localTimeoutMs:o}),a.headers||(a.headers={}),a.headers.Authorization||(a.headers.Authorization="Bearer "+this.opts.accessToken),i.access_token&&delete i.access_token):i.access_token||(i.access_token=this.opts.accessToken);const l=this.request(e,t,r,i,s,a);return l.catch(u=>{var c;u.errcode=="M_UNKNOWN_TOKEN"&&!((c=a)!==null&&c!==void 0&&c.inhibitLogoutEmit)?this.eventEmitter.emit(Ha.SessionLoggedOut,u):u.errcode=="M_CONSENT_NOT_GIVEN"&&this.eventEmitter.emit(Ha.NoConsent,u.message,u.data.consent_uri)}),l}request(e,t,r,i,s,o){var a;const l=(a=o==null?void 0:o.prefix)!==null&&a!==void 0?a:this.opts.prefix,u=this.opts.baseUrl+l+r;return this.requestOtherUrl(e,t,u,i,s,o)}requestOtherUrl(e,t,r,i,s,o){let a=o||{};return isFinite(o)&&(a={localTimeoutMs:o}),this.doRequest(e,t,r,i,s,a)}getUrl(e,t,r){let i="";return t&&(i="?"+Si.encodeParams(t)),this.opts.baseUrl+r+e+i}doRequest(e,t,r,i,s,o){var a;if(e!==void 0&&!Si.isFunction(e))throw Error("Expected callback to be a function but got "+typeof e);this.opts.extraParams&&(i=Eg(Eg({},i||{}),this.opts.extraParams));const l=Object.assign({},o.headers||{});o||(o={});const u=(a=o.json)!==null&&a!==void 0?a:!0;let c=o.bodyParser;u&&(s&&(s=JSON.stringify(s),l["content-type"]="application/json"),l.accept||(l.accept="application/json"),c===void 0&&(c=function(C){return JSON.parse(C)}));const g=Si.defer();let m,f=!1,_;const I=o.localTimeoutMs||this.opts.localTimeoutMs,R=()=>{I&&(m&&Yi.clearTimeout(m),m=Yi.setTimeout(function(){var C,S;f=!0,(C=_)===null||C===void 0||(S=C.abort)===null||S===void 0||S.call(C),g.reject(new nu({error:"Locally timed out waiting for a response",errcode:"ORG.MATRIX.JSSDK_TIMEOUT",timeout:I}))},I))};R();const T=g.promise;try{_=this.opts.request({uri:r,method:t,withCredentials:!1,qs:i,qsStringifyOptions:o.qsStringifyOptions,useQuerystring:!0,body:s,json:!1,timeout:I,headers:l||{},_matrix_opts:this.opts},(C,S,k)=>{if(I&&(Yi.clearTimeout(m),f))return;rd(g,e,this.opts.onlyData,c)(C,S,k)}),_&&("onprogress"in _&&(_.onprogress=C=>{R()}),_.abort&&(T.abort=_.abort.bind(_)))}catch(C){g.reject(C),e&&e(C)}return T}}me.MatrixHttpApi=sk;function Dh(n){return n.status||n.statusCode}function rd(n,e,t=!1,r){return function(i,s,o){i&&!(i.name==="AbortError"||i==="aborted")&&!(i instanceof nu)&&(i=new Cf("request failed",i));let a=o;if(!i)try{Dh(s)>=400?i=ok(s,o):r&&(a=r(o))}catch(l){i=new Error(`Error parsing server response: ${l}`)}if(i)n.reject(i),e==null||e(i);else if(t)n.resolve(a),e==null||e(null,a);else{const l={code:Dh(s),headers:s.headers,data:a};n.resolve(l),e==null||e(null,l)}}}function ok(n,e){const t=Dh(n),r=ak(n);let i;if(r)if(r.type==="application/json"){const s=typeof e=="object"?e:JSON.parse(e);i=new nu(s)}else r.type==="text/plain"&&(i=new Error(`Server returned ${t} error: ${e}`));return i||(i=new Error(`Server returned ${t} error`)),i.httpStatus=t,i}function ak(n){let e;if(n.getResponseHeader?e=n.getResponseHeader("Content-Type"):n.headers&&(e=n.headers["content-type"]||null),!e)return null;try{return(0,QO.parse)(e)}catch(t){throw new Error(`Error parsing Content-Type '${e}': ${t}`)}}class nu extends Error{constructor(e={}){super(`MatrixError: ${e.errcode}`),(0,Aa.default)(this,"errcode",void 0),(0,Aa.default)(this,"data",void 0),(0,Aa.default)(this,"httpStatus",void 0),this.errcode=e.errcode,this.name=e.errcode||"Unknown error code",this.message=e.error||"Unknown message",this.data=e}}me.MatrixError=nu;class Cf extends Error{constructor(e,t=void 0){super(e+(t?`: ${t.message}`:""))}get name(){return"ConnectionError"}}me.ConnectionError=Cf;class d_ extends Error{constructor(){super("Operation aborted")}get name(){return"AbortError"}}me.AbortError=d_;async function ck(n,e){let t=0,r=null;for(;t<n;)try{if(t>0){const i=1e3*Math.pow(2,t);ll.logger.log(`network operation failed ${t} times, retrying in ${i}ms...`),await new Promise(s=>setTimeout(s,i))}return await e()}catch(i){if(i instanceof Cf)t+=1,r=i;else throw i}throw r}var lk=G.exports;Object.defineProperty(hr,"__esModule",{value:!0});hr.RoomEvent=hr.Room=hr.NotificationCountType=void 0;var Re=lk(Y.exports),nd=ri,Zt=Wt,uk=No,ta=yk(W),ul=Ht,Me=jo,dk=rn,hk=uc,mt=ie,fk=sn,Ue=ne,bi=ot,pk=xs,Cr=dt,gk=me,mk=je;function h_(n){if(typeof WeakMap!="function")return null;var e=new WeakMap,t=new WeakMap;return(h_=function(r){return r?t:e})(n)}function yk(n,e){if(!e&&n&&n.__esModule)return n;if(n===null||typeof n!="object"&&typeof n!="function")return{default:n};var t=h_(e);if(t&&t.has(n))return t.get(n);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in n)if(s!=="default"&&Object.prototype.hasOwnProperty.call(n,s)){var o=i?Object.getOwnPropertyDescriptor(n,s):null;o&&(o.get||o.set)?Object.defineProperty(r,s,o):r[s]=n[s]}return r.default=n,t&&t.set(n,r),r}function Sg(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function bg(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Sg(Object(t),!0).forEach(function(r){(0,Re.default)(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Sg(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}const wg="6",Rg=["1","2","3","4","5","6"];function Ig(n,e,t){return new ul.MatrixEvent({content:{[e.getId()]:{[t]:{[n]:{ts:e.getTs()}}}},type:"m.receipt",room_id:e.getRoomId()})}const Fs=0,qs=1,vk=30;let xl;hr.NotificationCountType=xl;(function(n){n.Highlight="highlight",n.Total="total"})(xl||(hr.NotificationCountType=xl={}));let st;hr.RoomEvent=st;(function(n){n.MyMembership="Room.myMembership",n.Tags="Room.tags",n.AccountData="Room.accountData",n.Receipt="Room.receipt",n.Name="Room.name",n.Redaction="Room.redaction",n.RedactionCancelled="Room.redactionCancelled",n.LocalEchoUpdated="Room.localEchoUpdated",n.Timeline="Room.timeline",n.TimelineReset="Room.timelineReset"})(st||(hr.RoomEvent=st={}));class _k extends mk.TypedEventEmitter{constructor(e,t,r,i={}){if(super(),this.roomId=e,this.client=t,this.myUserId=r,this.opts=i,(0,Re.default)(this,"reEmitter",void 0),(0,Re.default)(this,"txnToEvent",{}),(0,Re.default)(this,"receipts",{}),(0,Re.default)(this,"receiptCacheByEventId",{}),(0,Re.default)(this,"notificationCounts",{}),(0,Re.default)(this,"timelineSets",void 0),(0,Re.default)(this,"threadsTimelineSets",[]),(0,Re.default)(this,"filteredTimelineSets",{}),(0,Re.default)(this,"pendingEventList",void 0),(0,Re.default)(this,"blacklistUnverifiedDevices",null),(0,Re.default)(this,"selfMembership",null),(0,Re.default)(this,"summaryHeroes",null),(0,Re.default)(this,"getTypeWarning",!1),(0,Re.default)(this,"getVersionWarning",!1),(0,Re.default)(this,"membersPromise",void 0),(0,Re.default)(this,"name",void 0),(0,Re.default)(this,"normalizedName",void 0),(0,Re.default)(this,"tags",{}),(0,Re.default)(this,"accountData",{}),(0,Re.default)(this,"summary",null),(0,Re.default)(this,"storageToken",void 0),(0,Re.default)(this,"timeline",void 0),(0,Re.default)(this,"oldState",void 0),(0,Re.default)(this,"currentState",void 0),(0,Re.default)(this,"threads",new Map),(0,Re.default)(this,"lastThread",void 0),(0,Re.default)(this,"visibilityEvents",new Map),(0,Re.default)(this,"threadTimelineSetsPromise",null),this.setMaxListeners(100),this.reEmitter=new fk.TypedReEmitter(this),i.pendingEventOrdering=i.pendingEventOrdering||bi.PendingEventOrdering.Chronological,this.name=e,this.timelineSets=[new nd.EventTimelineSet(this,i)],this.reEmitter.reEmit(this.getUnfilteredTimelineSet(),[st.Timeline,st.TimelineReset]),this.fixUpLegacyTimelineFields(),this.opts.pendingEventOrdering===bi.PendingEventOrdering.Detached){this.pendingEventList=[];const s=t.sessionStore.store.getItem(id(this.roomId));s&&JSON.parse(s).forEach(async o=>{const a=new ul.MatrixEvent(o);a.getType()===Ue.EventType.RoomMessageEncrypted&&await a.attemptDecryption(this.client.crypto),a.setStatus(Me.EventStatus.NOT_SENT),this.addPendingEvent(a,a.getTxnId())})}this.opts.lazyLoadMembers?this.membersPromise=null:this.membersPromise=Promise.resolve(!1)}async createThreadsTimelineSets(){var e;if(this.threadTimelineSetsPromise)return this.threadTimelineSetsPromise;if((e=this.client)!==null&&e!==void 0&&e.supportsExperimentalThreads)try{this.threadTimelineSetsPromise=Promise.all([this.createThreadTimelineSet(),this.createThreadTimelineSet(Cr.ThreadFilterType.My)]);const t=await this.threadTimelineSetsPromise;this.threadsTimelineSets.push(...t)}catch{this.threadTimelineSetsPromise=null}}decryptCriticalEvents(){const e=this.getEventReadUpTo(this.client.getUserId(),!0),t=this.getLiveTimeline().getEvents(),r=t.findIndex(s=>s.event.event_id===e),i=t.slice(r).filter(s=>s.shouldAttemptDecryption()).reverse().map(s=>s.attemptDecryption(this.client.crypto,{isRetry:!0}));return Promise.allSettled(i)}decryptAllEvents(){const e=this.getUnfilteredTimelineSet().getLiveTimeline().getEvents().filter(t=>t.shouldAttemptDecryption()).reverse().map(t=>t.attemptDecryption(this.client.crypto,{isRetry:!0}));return Promise.allSettled(e)}getVersion(){const e=this.currentState.getStateEvents(Ue.EventType.RoomCreate,"");if(!e)return this.getVersionWarning||(mt.logger.warn("[getVersion] Room "+this.roomId+" does not have an m.room.create event"),this.getVersionWarning=!0),"1";const t=e.getContent().room_version;return t===void 0?"1":t}shouldUpgradeToVersion(){return Rg.includes(this.getVersion())?null:wg}async getRecommendedVersion(){let t=(await this.client.getCapabilities())["m.room_versions"];if(!t){t={default:wg,available:{}};for(const i of Rg)t.available[i]=bi.RoomVersionStability.Stable}let r=this.checkVersionAgainstCapability(t);if(r.urgent&&r.needsUpgrade)if(mt.logger.warn("Refreshing room version capability because the server looks to be supporting a newer room version we don't know about."),t=(await this.client.getCapabilities(!0))["m.room_versions"],t)r=this.checkVersionAgainstCapability(t);else return mt.logger.warn("No room version capability - assuming upgrade required."),r;return r}checkVersionAgainstCapability(e){const t=this.getVersion();mt.logger.log(`[${this.roomId}] Current version: ${t}`),mt.logger.log(`[${this.roomId}] Version capability: `,e);const r={version:t,needsUpgrade:!1,urgent:!1};return t===e.default||Object.keys(e.available).filter(s=>e.available[s]==="stable").includes(t)||(r.version=e.default,r.needsUpgrade=!0,r.urgent=!!this.getVersion().match(/^[0-9]+[0-9.]*$/g),r.urgent?mt.logger.warn(`URGENT upgrade required on ${this.roomId}`):mt.logger.warn(`Non-urgent upgrade required on ${this.roomId}`)),r}userMayUpgradeRoom(e){return this.currentState.maySendStateEvent(Ue.EventType.RoomTombstone,e)}getPendingEvents(){if(this.opts.pendingEventOrdering!==bi.PendingEventOrdering.Detached)throw new Error("Cannot call getPendingEvents with pendingEventOrdering == "+this.opts.pendingEventOrdering);return this.pendingEventList}removePendingEvent(e){if(this.opts.pendingEventOrdering!==bi.PendingEventOrdering.Detached)throw new Error("Cannot call removePendingEvent with pendingEventOrdering == "+this.opts.pendingEventOrdering);const t=ta.removeElement(this.pendingEventList,function(r){return r.getId()==e},!1);return this.savePendingEvents(),t}hasPendingEvent(e){return this.opts.pendingEventOrdering!==bi.PendingEventOrdering.Detached?!1:this.pendingEventList.some(t=>t.getId()===e)}getPendingEvent(e){return this.opts.pendingEventOrdering!==bi.PendingEventOrdering.Detached?null:this.pendingEventList.find(t=>t.getId()===e)}getLiveTimeline(){return this.getUnfilteredTimelineSet().getLiveTimeline()}getLastActiveTimestamp(){const t=this.getLiveTimeline().getEvents();return t.length?t[t.length-1].getTs():Number.MIN_SAFE_INTEGER}getMyMembership(){return this.selfMembership}getDMInviter(){if(this.myUserId){const e=this.getMember(this.myUserId);if(e)return e.getDMInviter()}if(this.selfMembership==="invite"&&this.getInvitedAndJoinedMemberCount()==2&&this.summaryHeroes.length)return this.summaryHeroes[0]}guessDMUserId(){const e=this.getMember(this.myUserId);if(e){const s=e.getDMInviter();if(s)return s}if(Array.isArray(this.summaryHeroes)&&this.summaryHeroes.length)return this.summaryHeroes[0];const i=this.currentState.getMembers().find(s=>s.userId!==this.myUserId);return i?i.userId:this.myUserId}getAvatarFallbackMember(){if(this.getInvitedAndJoinedMemberCount()>2)return;const t=Array.isArray(this.summaryHeroes)&&this.summaryHeroes.length;if(t){const i=this.summaryHeroes.map(s=>this.getMember(s)).find(s=>!!s);if(i)return i}const r=this.currentState.getMembers();if(r.length<=2){const i=r.find(s=>s.userId!==this.myUserId);if(i)return i}if(t){const i=this.summaryHeroes.map(s=>this.client.getUser(s)).find(s=>!!s);if(i){const s=new dk.RoomMember(this.roomId,i.userId);return s.user=i,s}}}updateMyMembership(e){const t=this.selfMembership;this.selfMembership=e,t!==e&&(e==="leave"&&this.cleanupAfterLeaving(),this.emit(st.MyMembership,this,e,t))}async loadMembersFromServer(){const e=this.client.store.getSyncToken(),t=ta.encodeParams({not_membership:"leave",at:e}),r=ta.encodeUri("/rooms/$roomId/members?"+t,{$roomId:this.roomId});return(await this.client.http.authedRequest(void 0,gk.Method.Get,r)).chunk}async loadMembers(){let e=!1,t=await this.client.store.getOutOfBandMembers(this.roomId);return(t===null||this.client.isCryptoEnabled()&&this.client.isRoomEncrypted(this.roomId))&&(e=!0,t=await this.loadMembersFromServer(),mt.logger.log(`LL: got ${t.length} members from server for room ${this.roomId}`)),{memberEvents:t.map(this.client.getEventMapper()),fromServer:e}}loadMembersIfNeeded(){if(this.membersPromise)return this.membersPromise;this.currentState.markOutOfBandMembersStarted();const e=this.loadMembers().then(t=>(this.currentState.setOutOfBandMembers(t.memberEvents),this.client.isCryptoEnabled()&&this.client.isRoomEncrypted(this.roomId)&&this.client.crypto.trackRoomDevices(this.roomId),t.fromServer)).catch(t=>{throw this.membersPromise=null,this.currentState.markOutOfBandMembersFailed(),t});return e.then(t=>{if(t){const r=this.currentState.getMembers().filter(s=>s.isOutOfBand()).map(s=>s.events.member.event);return mt.logger.log(`LL: telling store to write ${r.length} members for room ${this.roomId}`),this.client.store.setOutOfBandMembers(this.roomId,r).catch(s=>{mt.logger.log("LL: storing OOB room members failed, oh well",s)})}}).catch(t=>{mt.logger.error(t)}),this.membersPromise=e,this.membersPromise}async clearLoadedMembersIfNeeded(){this.opts.lazyLoadMembers&&this.membersPromise&&(await this.loadMembersIfNeeded(),await this.client.store.clearOutOfBandMembers(this.roomId),this.currentState.clearOutOfBandMembers(),this.membersPromise=null)}cleanupAfterLeaving(){this.clearLoadedMembersIfNeeded().catch(e=>{mt.logger.error(`error after clearing loaded members from room ${this.roomId} after leaving`),mt.logger.log(e)})}resetLiveTimeline(e,t){for(let r=0;r<this.timelineSets.length;r++)this.timelineSets[r].resetLiveTimeline(e,t);this.fixUpLegacyTimelineFields()}fixUpLegacyTimelineFields(){this.timeline=this.getLiveTimeline().getEvents(),this.oldState=this.getLiveTimeline().getState(Zt.EventTimeline.BACKWARDS),this.currentState=this.getLiveTimeline().getState(Zt.EventTimeline.FORWARDS)}async hasUnverifiedDevices(){if(!this.client.isRoomEncrypted(this.roomId))return!1;const e=await this.getEncryptionTargetMembers();for(const t of e)if(this.client.getStoredDevicesForUser(t.userId).some(i=>i.isUnverified()))return!0;return!1}getTimelineSets(){return this.timelineSets}getUnfilteredTimelineSet(){return this.timelineSets[0]}getTimelineForEvent(e){const t=this.findEventById(e),r=this.findThreadForEvent(t);return r?r.timelineSet.getLiveTimeline():this.getUnfilteredTimelineSet().getTimelineForEvent(e)}addTimeline(){return this.getUnfilteredTimelineSet().addTimeline()}findEventById(e){let t=this.getUnfilteredTimelineSet().findEventById(e);if(t)return t;{const r=this.getThreads();for(let i=0;i<r.length;i++)if(t=r[i].findEventById(e),t)return t}}getUnreadNotificationCount(e=xl.Total){return this.notificationCounts[e]}setUnreadNotificationCount(e,t){this.notificationCounts[e]=t}setSummary(e){const t=e["m.heroes"],r=e["m.joined_member_count"],i=e["m.invited_member_count"];Number.isInteger(r)&&this.currentState.setJoinedMemberCount(r),Number.isInteger(i)&&this.currentState.setInvitedMemberCount(i),Array.isArray(t)&&(this.summaryHeroes=t.filter(s=>s!==this.myUserId))}setBlacklistUnverifiedDevices(e){this.blacklistUnverifiedDevices=e}getBlacklistUnverifiedDevices(){return this.blacklistUnverifiedDevices}getAvatarUrl(e,t,r,i,s=!0){const o=this.currentState.getStateEvents(Ue.EventType.RoomAvatar,"");if(!o&&!s)return null;const a=o?o.getContent().url:null;return a?(0,uk.getHttpUriForMxc)(e,a,t,r,i):null}getMxcAvatarUrl(){var e,t;return((e=this.currentState.getStateEvents(Ue.EventType.RoomAvatar,""))===null||e===void 0||(t=e.getContent())===null||t===void 0?void 0:t.url)||null}getAliases(){const e=[],t=this.currentState.getStateEvents(Ue.EventType.RoomAliases);if(t)for(let r=0;r<t.length;++r){const i=t[r];if(Array.isArray(i.getContent().aliases)){const s=i.getContent().aliases.filter(o=>!(typeof o!="string"||o[0]!=="#"||!o.endsWith(`:${i.getStateKey()}`)));Array.prototype.push.apply(e,s)}}return e}getCanonicalAlias(){const e=this.currentState.getStateEvents(Ue.EventType.RoomCanonicalAlias,"");return e&&e.getContent().alias||null}getAltAliases(){const e=this.currentState.getStateEvents(Ue.EventType.RoomCanonicalAlias,"");return e?e.getContent().alt_aliases||[]:[]}addEventsToTimeline(e,t,r,i){r.getTimelineSet().addEventsToTimeline(e,t,r,i)}getThread(e){return this.getThreads().find(t=>t.id===e)}getThreads(){return Array.from(this.threads.values())}getMember(e){return this.currentState.getMember(e)}getMembers(){return this.currentState.getMembers()}getJoinedMembers(){return this.getMembersWithMembership("join")}getJoinedMemberCount(){return this.currentState.getJoinedMemberCount()}getInvitedMemberCount(){return this.currentState.getInvitedMemberCount()}getInvitedAndJoinedMemberCount(){return this.getInvitedMemberCount()+this.getJoinedMemberCount()}getMembersWithMembership(e){return this.currentState.getMembers().filter(function(t){return t.membership===e})}async getEncryptionTargetMembers(){await this.loadMembersIfNeeded();let e=this.getMembersWithMembership("join");return this.shouldEncryptForInvitedMembers()&&(e=e.concat(this.getMembersWithMembership("invite"))),e}shouldEncryptForInvitedMembers(){var e;const t=this.currentState.getStateEvents(Ue.EventType.RoomHistoryVisibility,"");return(t==null||(e=t.getContent())===null||e===void 0?void 0:e.history_visibility)!=="joined"}getDefaultRoomName(e){return this.calculateRoomName(e,!0)}hasMembershipState(e,t){const r=this.getMember(e);return r?r.membership===t:!1}getOrCreateFilteredTimelineSet(e,{prepopulateTimeline:t=!0,pendingEvents:r=!0}={}){if(this.filteredTimelineSets[e.filterId])return this.filteredTimelineSets[e.filterId];const i=Object.assign({filter:e,pendingEvents:r},this.opts),s=new nd.EventTimelineSet(this,i);this.reEmitter.reEmit(s,[st.Timeline,st.TimelineReset]),this.filteredTimelineSets[e.filterId]=s,this.timelineSets.push(s);const o=this.getLiveTimeline();if(t){o.getEvents().forEach(function(l){s.addLiveEvent(l)});let a=o;for(;a.getNeighbouringTimeline(Zt.EventTimeline.BACKWARDS);)a=a.getNeighbouringTimeline(Zt.EventTimeline.BACKWARDS);s.getLiveTimeline().setPaginationToken(a.getPaginationToken(Zt.EventTimeline.BACKWARDS),Zt.EventTimeline.BACKWARDS)}else{const a=o.getPaginationToken(Zt.Direction.Forward);s.getLiveTimeline().setPaginationToken(a,Zt.Direction.Backward)}return s}async createThreadTimelineSet(e){let t;if(Cr.Thread.hasServerSideSupport){const r=this.client.getUserId(),i=new pk.Filter(r),s={room:{timeline:{[Cr.FILTER_RELATED_BY_REL_TYPES.name]:[Cr.THREAD_RELATION_TYPE.name]}}};e===Cr.ThreadFilterType.My&&(s.room.timeline[Cr.FILTER_RELATED_BY_SENDERS.name]=[r]),i.setDefinition(s);const o=await this.client.getOrCreateFilter(`THREAD_PANEL_${this.roomId}_${e}`,i);i.filterId=o,t=this.getOrCreateFilteredTimelineSet(i,{prepopulateTimeline:!1,pendingEvents:!1}),t.getLiveTimeline().setPaginationToken("",Zt.EventTimeline.BACKWARDS)}else t=new nd.EventTimelineSet(this,{pendingEvents:!1}),Array.from(this.threads).forEach(([,r])=>{if(r.length===0)return;const i=r.events.some(s=>s.getSender()===this.client.getUserId());(e!==Cr.ThreadFilterType.My||i)&&t.getLiveTimeline().addEvent(r.rootEvent,!1)});return t}removeFilteredTimelineSet(e){const t=this.filteredTimelineSets[e.filterId];delete this.filteredTimelineSets[e.filterId];const r=this.timelineSets.indexOf(t);r>-1&&this.timelineSets.splice(r,1)}findThreadForEvent(e){if(!e)return null;if(e.isThreadRelation)return this.threads.get(e.threadRootId);if(e.isThreadRoot)return this.threads.get(e.getId());{const t=this.findEventById(e.getAssociatedId());return this.findThreadForEvent(t)}}async addThreadedEvent(e,t){this.applyRedaction(e);let r=this.findThreadForEvent(e);if(r)r.addEvent(e,t);else{const i=[e];let s=this.findEventById(e.threadRootId);try{let o;e.threadRootId&&(o=await this.client.fetchRoomEvent(this.roomId,e.threadRootId)),s?s.setUnsigned(o.unsigned):s=new ul.MatrixEvent(o)}finally{r=this.createThread(s,i,t)}}this.emit(Cr.ThreadEvent.Update,r)}createThread(e,t=[],r){if(e){const o=this.getTimelineForEvent(e.getId()),a=o==null?void 0:o.getTimelineSet().getAllRelationsEventForEvent(e.getId());a&&(t=t.concat(a))}const i=new Cr.Thread(e,{initialEvents:t,room:this,client:this.client});if(i.id){var s;return this.threads.set(i.id,i),this.reEmitter.reEmit(i,[Cr.ThreadEvent.Update,st.Timeline,st.TimelineReset]),(!this.lastThread||((s=this.lastThread.rootEvent)===null||s===void 0?void 0:s.localTimestamp)<(e==null?void 0:e.localTimestamp))&&(this.lastThread=i),this.emit(Cr.ThreadEvent.New,i,r),this.threadsTimelineSets.forEach(o=>{i.rootEvent&&(Cr.Thread.hasServerSideSupport?o.addLiveEvent(i.rootEvent):o.addEventToTimeline(i.rootEvent,o.getLiveTimeline(),r))}),i}}applyRedaction(e){if(e.isRedaction()){const t=e.event.redacts,r=this.findEventById(t);r&&(r.makeRedacted(e),r.getStateKey()&&this.currentState.getStateEvents(r.getType(),r.getStateKey()).getId()===r.getId()&&this.currentState.setStateEvents([r]),this.emit(st.Redaction,e,this),this.visibilityEvents.delete(t),r.isVisibilityEvent()&&this.redactVisibilityChangeEvent(e))}}addLiveEvent(e,t,r=!1){if(this.applyRedaction(e),e.isVisibilityEvent()&&this.applyNewVisibilityEvent(e),this.applyPendingVisibilityEvents(e),e.getUnsigned().transaction_id){const i=this.txnToEvent[e.getUnsigned().transaction_id];if(i){this.handleRemoteEcho(e,i);return}}for(let i=0;i<this.timelineSets.length;i++)this.timelineSets[i].addLiveEvent(e,t,r);e.sender&&e.getType()!==Ue.EventType.RoomRedaction&&this.addReceipt(Ig(e.sender.userId,e,"m.read"),!0)}addPendingEvent(e,t){if(e.status!==Me.EventStatus.SENDING&&e.status!==Me.EventStatus.NOT_SENT)throw new Error("addPendingEvent called on an event with status "+e.status);if(this.txnToEvent[t])throw new Error("addPendingEvent called on an event with known txnId "+t);if(Zt.EventTimeline.setEventMetadata(e,this.getLiveTimeline().getState(Zt.EventTimeline.FORWARDS),!1),this.txnToEvent[t]=e,this.opts.pendingEventOrdering===bi.PendingEventOrdering.Detached){if(this.pendingEventList.some(i=>i.status===Me.EventStatus.NOT_SENT)&&(mt.logger.warn("Setting event as NOT_SENT due to messages in the same state"),e.setStatus(Me.EventStatus.NOT_SENT)),this.pendingEventList.push(e),this.savePendingEvents(),e.isRelation()&&this.aggregateNonLiveRelation(e),e.isRedaction()){var r;const i=e.event.redacts;let s=(r=this.pendingEventList)===null||r===void 0?void 0:r.find(o=>o.getId()===i);s||(s=this.findEventById(i)),s&&(s.markLocallyRedacted(e),this.emit(st.Redaction,e,this))}}else for(let i=0;i<this.timelineSets.length;i++){const s=this.timelineSets[i];s.getFilter()?s.getFilter().filterRoomTimeline([e]).length&&s.addEventToTimeline(e,s.getLiveTimeline(),!1):s.addEventToTimeline(e,s.getLiveTimeline(),!1)}this.emit(st.LocalEchoUpdated,e,this,null,null)}savePendingEvents(){if(this.pendingEventList){const e=this.pendingEventList.map(r=>bg(bg({},r.event),{},{txn_id:r.getTxnId()})).filter(r=>{const i=r.type===Ue.EventType.RoomMessageEncrypted,s=this.client.isRoomEncrypted(this.roomId);return i||!s}),{store:t}=this.client.sessionStore;this.pendingEventList.length>0?t.setItem(id(this.roomId),JSON.stringify(e)):t.removeItem(id(this.roomId))}}aggregateNonLiveRelation(e){const t=this.findThreadForEvent(e);if(t&&t.timelineSet.aggregateRelations(e),(t==null?void 0:t.id)===e.getAssociatedId()||!t)for(let r=0;r<this.timelineSets.length;r++){const i=this.timelineSets[r];i.getFilter()?i.getFilter().filterRoomTimeline([e]).length&&i.aggregateRelations(e):i.aggregateRelations(e)}}getEventForTxnId(e){return this.txnToEvent[e]}handleRemoteEcho(e,t){const r=t.getId(),i=e.getId(),s=t.status;mt.logger.debug(`Got remote echo for event ${r} -> ${i} old status ${s}`),delete this.txnToEvent[e.getUnsigned().transaction_id],this.pendingEventList&&this.removePendingEvent(r),t.handleRemoteEcho(e.event);const o=this.findThreadForEvent(e);if(o&&o.timelineSet.handleRemoteEcho(t,r,i),(o==null?void 0:o.id)===e.getAssociatedId()||!o)for(let a=0;a<this.timelineSets.length;a++)this.timelineSets[a].handleRemoteEcho(t,r,i);this.emit(st.LocalEchoUpdated,t,this,r,s)}updatePendingEvent(e,t,r){if(mt.logger.log(`setting pendingEvent status to ${t} in ${e.getRoomId()} event ID ${e.getId()} -> ${r}`),t==Me.EventStatus.SENT&&!r)throw new Error("updatePendingEvent called with status=SENT, but no new event id");if(t==Me.EventStatus.SENT&&this.getTimelineForEvent(r))return;const i=e.status,s=e.getId();if(!i)throw new Error("updatePendingEventStatus called on an event which is not a local echo.");const o=Ek[i];if(!o||o.indexOf(t)<0)throw new Error("Invalid EventStatus transition "+i+"->"+t);if(e.setStatus(t),t==Me.EventStatus.SENT){e.replaceLocalEventId(r);const a=this.findThreadForEvent(e);if(a&&a.timelineSet.replaceEventId(s,r),(a==null?void 0:a.id)===e.getAssociatedId()||!a)for(let l=0;l<this.timelineSets.length;l++)this.timelineSets[l].replaceEventId(s,r)}else if(t==Me.EventStatus.CANCELLED){if(this.pendingEventList){const a=this.pendingEventList.findIndex(l=>l.getId()===s);if(a!==-1){const[l]=this.pendingEventList.splice(a,1);l.isRedaction()&&this.revertRedactionLocalEcho(l)}}this.removeEvent(s)}this.savePendingEvents(),this.emit(st.LocalEchoUpdated,e,this,s,i)}revertRedactionLocalEcho(e){const t=e.event.redacts;if(!t)return;const r=this.getUnfilteredTimelineSet().findEventById(t);r&&(r.unmarkLocallyRedacted(),this.emit(st.RedactionCancelled,e,this),r.isRelation()&&this.aggregateNonLiveRelation(r))}addLiveEvents(e,t,r=!1){let i;if(t&&["replace","ignore"].indexOf(t)===-1)throw new Error("duplicateStrategy MUST be either 'replace' or 'ignore'");for(i=0;i<this.timelineSets.length;i++){const s=this.timelineSets[i].getLiveTimeline();if(s.getPaginationToken(Zt.EventTimeline.FORWARDS))throw new Error("live timeline "+i+" is no longer live - it has a pagination token ("+s.getPaginationToken(Zt.EventTimeline.FORWARDS)+")");if(s.getNeighbouringTimeline(Zt.EventTimeline.FORWARDS))throw new Error("live timeline "+i+" is no longer live - it has a neighbouring timeline")}for(i=0;i<e.length;i++){this.addLiveEvent(e[i],t,r);const s=this.findThreadForEvent(e[i]);s&&s.addEvent(e[i],!0)}}addEphemeralEvents(e){for(const t of e)t.getType()==="m.typing"?this.currentState.setTypingEvent(t):t.getType()==="m.receipt"&&this.addReceipt(t)}removeEvents(e){for(let t=0;t<e.length;++t)this.removeEvent(e[t])}removeEvent(e){let t=!1;for(let r=0;r<this.timelineSets.length;r++){const i=this.timelineSets[r].removeEvent(e);i&&(i.isRedaction()&&this.revertRedactionLocalEcho(i),t=!0)}return t}recalculate(){const e=this.currentState.getStateEvents(Ue.EventType.RoomMember,this.myUserId);e&&e.getContent().membership==="invite"&&(e.getUnsigned().invite_room_state||[]).forEach(i=>{this.currentState.getStateEvents(i.type,i.state_key)||this.currentState.setStateEvents([new ul.MatrixEvent({type:i.type,state_key:i.state_key,content:i.content,event_id:"$fake"+Date.now(),room_id:this.roomId,user_id:this.myUserId})])});const t=this.name;this.name=this.calculateRoomName(this.myUserId),this.normalizedName=(0,ta.normalize)(this.name),this.summary=new hk.RoomSummary(this.roomId,{title:this.name}),t!==this.name&&this.emit(st.Name,this)}getUsersReadUpTo(e){return this.getReceiptsForEvent(e).filter(function(t){return t.type==="m.read"}).map(function(t){return t.userId})}getReadReceiptForUserId(e,t=!1){var r,i;const[s,o]=(r=(i=this.receipts["m.read"])===null||i===void 0?void 0:i[e])!==null&&r!==void 0?r:[];return t?s:o!=null?o:s}getEventReadUpTo(e,t=!1){var r;const i=this.getReadReceiptForUserId(e,t);return(r=i==null?void 0:i.eventId)!==null&&r!==void 0?r:null}hasUserReadEvent(e,t){const r=this.getEventReadUpTo(e,!1);if(r===t||this.timeline.length&&this.timeline[this.timeline.length-1].getSender()&&this.timeline[this.timeline.length-1].getSender()===e)return!0;for(let i=this.timeline.length-1;i>=0;--i){const s=this.timeline[i];if(s.getId()===t)return!1;if(s.getId()===r)return!0}return!1}getReceiptsForEvent(e){return this.receiptCacheByEventId[e.getId()]||[]}addReceipt(e,t=!1){this.addReceiptsToStructure(e,t),this.emit(st.Receipt,e,this)}addReceiptsToStructure(e,t){const r=e.getContent();Object.keys(r).forEach(i=>{Object.keys(r[i]).forEach(s=>{Object.keys(r[i][s]).forEach(o=>{var a,l;const u=r[i][s][o];this.receipts[s]||(this.receipts[s]={}),this.receipts[s][o]||(this.receipts[s][o]=[null,null]);const c=this.receipts[s][o];let g=c[Fs];if(t){var m;g=(m=c[qs])!==null&&m!==void 0?m:c[Fs]}if(g){const k=this.getUnfilteredTimelineSet().compareEventOrdering(g.eventId,i);if(k!==null&&k>=0)return}const f={eventId:i,data:u},_=t?c[Fs]:f,I=t?f:c[qs];let R=null;_&&I&&(R=this.getUnfilteredTimelineSet().compareEventOrdering(_.eventId,I.eventId));const T=R===null||R<0,C=(a=c[qs])!==null&&a!==void 0?a:c[Fs];t&&T?c[qs]=f:t||(c[Fs]=f,T||(c[qs]=null));const S=(l=c[qs])!==null&&l!==void 0?l:c[Fs];if(C!==S){if(C&&this.receiptCacheByEventId[C.eventId]){const k=C.eventId;this.receiptCacheByEventId[k]=this.receiptCacheByEventId[k].filter(A=>A.type!==s||A.userId!==o),this.receiptCacheByEventId[k].length<1&&delete this.receiptCacheByEventId[k]}this.receiptCacheByEventId[i]||(this.receiptCacheByEventId[i]=[]),this.receiptCacheByEventId[i].push({userId:o,type:s,data:u})}})})})}addLocalEchoReceipt(e,t,r){this.addReceipt(Ig(e,t,r),!0)}addTags(e){this.tags=e.getContent().tags||{},this.emit(st.Tags,e,this)}addAccountData(e){for(let t=0;t<e.length;t++){const r=e[t];r.getType()==="m.tag"&&this.addTags(r);const i=this.accountData[r.getType()];this.accountData[r.getType()]=r,this.emit(st.AccountData,r,this,i)}}getAccountData(e){return this.accountData[e]}maySendMessage(){return this.getMyMembership()==="join"&&(this.client.isRoomEncrypted(this.roomId)?this.currentState.maySendEvent(Ue.EventType.RoomMessageEncrypted,this.myUserId):this.currentState.maySendEvent(Ue.EventType.RoomMessage,this.myUserId))}canInvite(e){let t=this.getMyMembership()==="join";const r=this.currentState.getStateEvents(Ue.EventType.RoomPowerLevels,""),i=r&&r.getContent(),s=this.getMember(e);return i&&s&&i.invite>s.powerLevel&&(t=!1),t}getJoinRule(){return this.currentState.getJoinRule()}getHistoryVisibility(){return this.currentState.getHistoryVisibility()}getGuestAccess(){return this.currentState.getGuestAccess()}getType(){const e=this.currentState.getStateEvents(Ue.EventType.RoomCreate,"");if(!e){this.getTypeWarning||(mt.logger.warn("[getType] Room "+this.roomId+" does not have an m.room.create event"),this.getTypeWarning=!0);return}return e.getContent()[Ue.RoomCreateTypeField]}isSpaceRoom(){return this.getType()===Ue.RoomType.Space}calculateRoomName(e,t=!1){if(!t){const m=this.currentState.getStateEvents(Ue.EventType.RoomName,"");if(m&&m.getContent()&&m.getContent().name)return m.getContent().name}const r=this.getCanonicalAlias();if(r)return r;const i=this.currentState.getJoinedMemberCount(),s=this.currentState.getInvitedMemberCount();let o=i+s-1,a=[];const l=this.currentState.getStateEvents(Ue.UNSTABLE_ELEMENT_FUNCTIONAL_USERS.name,"");Array.isArray(l==null?void 0:l.getContent().service_members)&&(a=l.getContent().service_members);let u=null;if(this.summaryHeroes)u=[],this.summaryHeroes.forEach(m=>{if(a.includes(m)){o--;return}const f=this.getMember(m);u.push(f?f.name:m)});else{let m=this.currentState.getMembers().filter(f=>f.userId!==e&&(f.membership==="invite"||f.membership==="join"));m=m.filter(({userId:f})=>a.includes(f)?(o--,!1):!0),m.sort((f,_)=>ta.compare(f.userId,_.userId)),m=m.slice(0,5),u=m.map(f=>f.name)}if(o)return sd(u,o);if(this.getMyMembership()=="join"){const m=this.currentState.getStateEvents(Ue.EventType.RoomThirdPartyInvite);if(m&&m.length){const f=m.map(_=>_.getContent().display_name);return`Inviting ${sd(f)}`}}let g=u;return g.length||(g=this.currentState.getMembers().filter(m=>m.userId!==e&&m.membership!=="invite"&&m.membership!=="join").map(m=>m.name)),g.length?`Empty room (was ${sd(g)})`:"Empty room"}applyNewVisibilityEvent(e){const t=e.asVisibilityChange();if(!t)return;const r=e.getSender();if(!r||!(Ue.EVENT_VISIBILITY_CHANGE_TYPE.name&&this.currentState.maySendStateEvent(Ue.EVENT_VISIBILITY_CHANGE_TYPE.name,r)||Ue.EVENT_VISIBILITY_CHANGE_TYPE.altName&&this.currentState.maySendStateEvent(Ue.EVENT_VISIBILITY_CHANGE_TYPE.altName,r)))return;const s=this.visibilityEvents.get(t.eventId);if(s){let a=s.length-1;const l=Math.max(0,s.length-vk);for(;a>=l&&!(s[a].getTs()<e.getTs());--a);a===-1?s.unshift(e):s.splice(a+1,0,e)}else this.visibilityEvents.set(t.eventId,[e]);const o=this.findEventById(t.eventId);!o||o.applyVisibilityEvent(t)}redactVisibilityChangeEvent(e){if(!e.isVisibilityEvent)throw new Error("expected a visibility change event");const r=e.getRelation().event_id,i=this.visibilityEvents.get(r);if(!i)return;const s=i.findIndex(o=>o.getId()===e.getId());if(s!==-1&&(i.splice(s,1),s===i.length)){const o=this.findEventById(r);if(!o)return;if(s===0)this.visibilityEvents.delete(r),o.applyVisibilityEvent();else{const l=i[i.length-1].asVisibilityChange();if(!l)throw new Error("at this stage, visibility changes should be well-formed");o.applyVisibilityEvent(l)}}}applyPendingVisibilityEvents(e){const t=this.visibilityEvents.get(e.getId());if(!t||t.length==0)return;const r=t[t.length-1],i=r.asVisibilityChange();!i||(i.visible,!(r.getTs()<e.getTs())&&e.applyVisibilityEvent(i))}}hr.Room=_k;function id(n){return`mx_pending_events_${n}`}const Ek={[Me.EventStatus.ENCRYPTING]:[Me.EventStatus.SENDING,Me.EventStatus.NOT_SENT,Me.EventStatus.CANCELLED],[Me.EventStatus.SENDING]:[Me.EventStatus.ENCRYPTING,Me.EventStatus.QUEUED,Me.EventStatus.NOT_SENT,Me.EventStatus.SENT],[Me.EventStatus.QUEUED]:[Me.EventStatus.SENDING,Me.EventStatus.CANCELLED],[Me.EventStatus.SENT]:[],[Me.EventStatus.NOT_SENT]:[Me.EventStatus.SENDING,Me.EventStatus.QUEUED,Me.EventStatus.CANCELLED],[Me.EventStatus.CANCELLED]:[]};function sd(n,e=n.length+1){const t=e-1;return n.length?n.length===1&&t<=1?n[0]:n.length===2&&t<=2?`${n[0]} and ${n[1]}`:t>1?`${n[0]} and ${t} others`:`${n[0]} and 1 other`:"Empty room"}var iu={};Object.defineProperty(iu,"__esModule",{value:!0});iu.Group=hc;var Sk=Wl.exports,bk=wk(W);function f_(n){if(typeof WeakMap!="function")return null;var e=new WeakMap,t=new WeakMap;return(f_=function(r){return r?t:e})(n)}function wk(n,e){if(!e&&n&&n.__esModule)return n;if(n===null||typeof n!="object"&&typeof n!="function")return{default:n};var t=f_(e);if(t&&t.has(n))return t.get(n);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in n)if(s!=="default"&&Object.prototype.hasOwnProperty.call(n,s)){var o=i?Object.getOwnPropertyDescriptor(n,s):null;o&&(o.get||o.set)?Object.defineProperty(r,s,o):r[s]=n[s]}return r.default=n,t&&t.set(n,r),r}function hc(n){this.groupId=n,this.name=null,this.avatarUrl=null,this.myMembership=null,this.inviter=null}bk.inherits(hc,Sk.EventEmitter);hc.prototype.setProfile=function(n,e){this.name===n&&this.avatarUrl===e||(this.name=n||this.groupId,this.avatarUrl=e,this.emit("Group.profile",this))};hc.prototype.setMyMembership=function(n){this.myMembership!==n&&(this.myMembership=n,this.emit("Group.myMembership",this))};hc.prototype.setInviter=function(n){this.inviter=n};var fc={},Be={};Object.defineProperty(Be,"__esModule",{value:!0});Be.TweakName=Be.RuleId=Be.PushRuleKind=Be.PushRuleActionName=Be.DMMemberCountCondition=Be.ConditionOperator=Be.ConditionKind=void 0;Be.isDmMemberCountCondition=Ik;let Ah;Be.PushRuleActionName=Ah;(function(n){n.DontNotify="dont_notify",n.Notify="notify",n.Coalesce="coalesce"})(Ah||(Be.PushRuleActionName=Ah={}));let xh;Be.TweakName=xh;(function(n){n.Highlight="highlight",n.Sound="sound"})(xh||(Be.TweakName=xh={}));let Uh;Be.ConditionOperator=Uh;(function(n){n.ExactEquals="==",n.LessThan="<",n.GreaterThan=">",n.GreaterThanOrEqual=">=",n.LessThanOrEqual="<="})(Uh||(Be.ConditionOperator=Uh={}));const Rk="2";Be.DMMemberCountCondition=Rk;function Ik(n){return n==="==2"||n==="2"}let $h;Be.ConditionKind=$h;(function(n){n.EventMatch="event_match",n.ContainsDisplayName="contains_display_name",n.RoomMemberCount="room_member_count",n.SenderNotificationPermission="sender_notification_permission"})($h||(Be.ConditionKind=$h={}));let Nh;Be.PushRuleKind=Nh;(function(n){n.Override="override",n.ContentSpecific="content",n.RoomSpecific="room",n.SenderSpecific="sender",n.Underride="underride"})(Nh||(Be.PushRuleKind=Nh={}));let Lh;Be.RuleId=Lh;(function(n){n.Master=".m.rule.master",n.ContainsDisplayName=".m.rule.contains_display_name",n.ContainsUserName=".m.rule.contains_user_name",n.AtRoomNotification=".m.rule.roomnotif",n.DM=".m.rule.room_one_to_one",n.EncryptedDM=".m.rule.encrypted_room_one_to_one",n.Message=".m.rule.message",n.EncryptedMessage=".m.rule.encrypted",n.InviteToSelf=".m.rule.invite_for_me",n.MemberEvent=".m.rule.member_event",n.IncomingCall=".m.rule.call",n.SuppressNotices=".m.rule.suppress_notices",n.Tombstone=".m.rule.tombstone"})(Lh||(Be.RuleId=Lh={}));var Tk=G.exports;Object.defineProperty(fc,"__esModule",{value:!0});fc.PushProcessor=void 0;var p_=Tk(Y.exports),od=W,Ok=ie,Ne=Be;function Tg(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function Og(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Tg(Object(t),!0).forEach(function(r){(0,p_.default)(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Tg(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}const ad=[Ne.PushRuleKind.Override,Ne.PushRuleKind.ContentSpecific,Ne.PushRuleKind.RoomSpecific,Ne.PushRuleKind.SenderSpecific,Ne.PushRuleKind.Underride],kk=[{rule_id:".m.rule.tombstone",default:!0,enabled:!0,conditions:[{kind:Ne.ConditionKind.EventMatch,key:"type",pattern:"m.room.tombstone"},{kind:Ne.ConditionKind.EventMatch,key:"state_key",pattern:""}],actions:[Ne.PushRuleActionName.Notify,{set_tweak:Ne.TweakName.Highlight,value:!0}]},{rule_id:".m.rule.reaction",default:!0,enabled:!0,conditions:[{kind:Ne.ConditionKind.EventMatch,key:"type",pattern:"m.reaction"}],actions:[Ne.PushRuleActionName.DontNotify]}];class xi{constructor(e){this.client=e}static actionListToActionsObject(e){const t={notify:!1,tweaks:{}};for(let r=0;r<e.length;++r){const i=e[r];i===Ne.PushRuleActionName.Notify?t.notify=!0:typeof i=="object"&&(i.value===void 0&&(i.value=!0),t.tweaks[i.set_tweak]=i.value)}return t}static rewriteDefaultRules(e){let t=JSON.parse(JSON.stringify(e));t||(t={}),t.global||(t.global={}),t.global.override||(t.global.override=[]);const r=t.global.override;for(const i of kk){const s=r.find(o=>o.rule_id===i.rule_id);if(s)s.default=i.default,s.conditions=i.conditions,s.actions=i.actions;else{const o=i.rule_id;Ok.logger.warn(`Adding default global override for ${o}`),r.push(i)}}return t}matchingRuleFromKindSet(e,t){for(let r=0;r<ad.length;++r){const i=ad[r],s=t[i];if(!!s)for(let o=0;o<s.length;++o){const a=s[o];if(!a.enabled)continue;const l=this.templateRuleToRaw(i,a);if(!!l&&this.ruleMatchesEvent(l,e))return Og(Og({},a),{},{kind:i})}}return null}templateRuleToRaw(e,t){const r={rule_id:t.rule_id,actions:t.actions,conditions:[]};switch(e){case Ne.PushRuleKind.Underride:case Ne.PushRuleKind.Override:r.conditions=t.conditions;break;case Ne.PushRuleKind.RoomSpecific:if(!t.rule_id)return null;r.conditions.push({kind:Ne.ConditionKind.EventMatch,key:"room_id",value:t.rule_id});break;case Ne.PushRuleKind.SenderSpecific:if(!t.rule_id)return null;r.conditions.push({kind:Ne.ConditionKind.EventMatch,key:"user_id",value:t.rule_id});break;case Ne.PushRuleKind.ContentSpecific:if(!t.pattern)return null;r.conditions.push({kind:Ne.ConditionKind.EventMatch,key:"content.body",pattern:t.pattern});break}return r}eventFulfillsCondition(e,t){switch(e.kind){case Ne.ConditionKind.EventMatch:return this.eventFulfillsEventMatchCondition(e,t);case Ne.ConditionKind.ContainsDisplayName:return this.eventFulfillsDisplayNameCondition(e,t);case Ne.ConditionKind.RoomMemberCount:return this.eventFulfillsRoomMemberCountCondition(e,t);case Ne.ConditionKind.SenderNotificationPermission:return this.eventFulfillsSenderNotifPermCondition(e,t)}return!1}eventFulfillsSenderNotifPermCondition(e,t){const r=e.key;if(!r)return!1;const i=this.client.getRoom(t.getRoomId());return i!=null&&i.currentState?i.currentState.mayTriggerNotifOfType(r,t.getSender()):!1}eventFulfillsRoomMemberCountCondition(e,t){if(!e.is)return!1;const r=this.client.getRoom(t.getRoomId());if(!r||!r.currentState||!r.currentState.members)return!1;const i=r.currentState.getJoinedMemberCount(),s=e.is.match(/^([=<>]*)([0-9]*)$/);if(!s)return!1;const o=s[1],a=parseInt(s[2]);if(isNaN(a))return!1;switch(o){case"":case"==":return i==a;case"<":return i<a;case">":return i>a;case"<=":return i<=a;case">=":return i>=a;default:return!1}}eventFulfillsDisplayNameCondition(e,t){let r=t.getContent();if(t.isEncrypted()&&t.getClearContent()&&(r=t.getClearContent()),!r||!r.body||typeof r.body!="string")return!1;const i=this.client.getRoom(t.getRoomId());if(!i||!i.currentState||!i.currentState.members||!i.currentState.getMember(this.client.credentials.userId))return!1;const s=i.currentState.getMember(this.client.credentials.userId).name,o=new RegExp("(^|\\W)"+(0,od.escapeRegExp)(s)+"(\\W|$)","i");return r.body.search(o)>-1}eventFulfillsEventMatchCondition(e,t){if(!e.key)return!1;const r=this.valueForDottedKey(e.key,t);if(typeof r!="string")return!1;if(e.value)return e.value===r;if(typeof e.pattern!="string")return!1;let i;return e.key=="content.body"?i=this.createCachedRegex("(^|\\W)",e.pattern,"(\\W|$)"):i=this.createCachedRegex("^",e.pattern,"$"),!!r.match(i)}createCachedRegex(e,t,r){return xi.cachedGlobToRegex[t]||(xi.cachedGlobToRegex[t]=new RegExp(e+(0,od.globToRegexp)(t)+r,"i")),xi.cachedGlobToRegex[t]}valueForDottedKey(e,t){const r=e.split(".");let i;const s=r[0];for(s==="content"?(i=t.getContent(),r.shift()):s==="type"?(i=t.getType(),r.shift()):i=t.event;r.length>0;){const o=r.shift();if((0,od.isNullOrUndefined)(i[o]))return null;i=i[o]}return i}matchingRuleForEventWithRulesets(e,t){return!t||e.getSender()===this.client.credentials.userId?null:this.matchingRuleFromKindSet(e,t.global)}pushActionsForEventAndRulesets(e,t){const r=this.matchingRuleForEventWithRulesets(e,t);if(!r)return{};const i=xi.actionListToActionsObject(r.actions);return i.tweaks.highlight===void 0&&(i.tweaks.highlight=r.kind==Ne.PushRuleKind.ContentSpecific),i}ruleMatchesEvent(e,t){var r;if(!((r=e.conditions)!==null&&r!==void 0&&r.length))return!0;let i=!0;for(let s=0;s<e.conditions.length;++s){const o=e.conditions[s];i&=this.eventFulfillsCondition(o,t)}return i}actionsForEvent(e){return this.pushActionsForEventAndRulesets(e,this.client.pushRules)}getPushRuleById(e){for(const t of["global"])if(this.client.pushRules[t]!==void 0){for(const r of ad)if(this.client.pushRules[t][r]!==void 0){for(const i of this.client.pushRules[t][r])if(i.rule_id===e)return i}}return null}}fc.PushProcessor=xi;(0,p_.default)(xi,"cachedGlobToRegex",{});var ci={};Object.defineProperty(ci,"__esModule",{value:!0});ci.InvalidCryptoStoreError=ou;ci.InvalidStoreError=su;ci.KeySignatureUploadError=void 0;function su(n,e){const t=`Store is invalid because ${n}, please stop the client, delete all data and start the client again`,r=Reflect.construct(Error,[t]);return Reflect.setPrototypeOf(r,Reflect.getPrototypeOf(this)),r.reason=n,r.value=e,r}su.TOGGLED_LAZY_LOADING="TOGGLED_LAZY_LOADING";su.prototype=Object.create(Error.prototype,{constructor:{value:Error,enumerable:!1,writable:!0,configurable:!0}});Reflect.setPrototypeOf(su,Error);function ou(n){const e=`Crypto store is invalid because ${n}, please stop the client, delete all data and start the client again`,t=Reflect.construct(Error,[e]);return Reflect.setPrototypeOf(t,Reflect.getPrototypeOf(this)),t.reason=n,t.name="InvalidCryptoStoreError",t}ou.TOO_NEW="TOO_NEW";ou.prototype=Object.create(Error.prototype,{constructor:{value:Error,enumerable:!1,writable:!0,configurable:!0}});Reflect.setPrototypeOf(ou,Error);class Ck extends Error{constructor(e,t){super(e),this.value=t}}ci.KeySignatureUploadError=Ck;var ni={},Pk=G.exports;Object.defineProperty(ni,"__esModule",{value:!0});ni.SyncAccumulator=ni.Category=void 0;var ra=Pk(Y.exports),Mk=ie,Dk=W;let jt;ni.Category=jt;(function(n){n.Invite="invite",n.Leave="leave",n.Join="join"})(jt||(ni.Category=jt={}));class Ak{constructor(e={}){this.opts=e,(0,ra.default)(this,"accountData",{}),(0,ra.default)(this,"inviteRooms",{}),(0,ra.default)(this,"joinRooms",{}),(0,ra.default)(this,"nextBatch",null),(0,ra.default)(this,"groups",{invite:{},join:{},leave:{}}),this.opts.maxTimelineEntries=this.opts.maxTimelineEntries||50}accumulate(e,t=!1){this.accumulateRooms(e,t),this.accumulateGroups(e),this.accumulateAccountData(e),this.nextBatch=e.next_batch}accumulateAccountData(e){!e.account_data||!e.account_data.events||e.account_data.events.forEach(t=>{this.accountData[t.type]=t})}accumulateRooms(e,t=!1){!e.rooms||(e.rooms.invite&&Object.keys(e.rooms.invite).forEach(r=>{this.accumulateRoom(r,jt.Invite,e.rooms.invite[r],t)}),e.rooms.join&&Object.keys(e.rooms.join).forEach(r=>{this.accumulateRoom(r,jt.Join,e.rooms.join[r],t)}),e.rooms.leave&&Object.keys(e.rooms.leave).forEach(r=>{this.accumulateRoom(r,jt.Leave,e.rooms.leave[r],t)}))}accumulateRoom(e,t,r,i=!1){switch(t){case jt.Invite:this.accumulateInviteState(e,r);break;case jt.Join:this.inviteRooms[e]&&delete this.inviteRooms[e],this.accumulateJoinState(e,r,i);break;case jt.Leave:this.inviteRooms[e]?delete this.inviteRooms[e]:delete this.joinRooms[e];break;default:Mk.logger.error("Unknown cateogory: ",t)}}accumulateInviteState(e,t){if(!t.invite_state||!t.invite_state.events)return;if(!this.inviteRooms[e]){this.inviteRooms[e]={invite_state:t.invite_state};return}const r=this.inviteRooms[e];t.invite_state.events.forEach(i=>{let s=!1;for(let o=0;o<r.invite_state.events.length;o++){const 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)})}accumulateJoinState(e,t,r=!1){this.joinRooms[e]||(this.joinRooms[e]={_currentState:Object.create(null),_timeline:[],_accountData:Object.create(null),_unreadNotifications:{},_summary:{},_readReceipts:{}});const i=this.joinRooms[e];if(t.account_data&&t.account_data.events&&t.account_data.events.forEach(s=>{i._accountData[s.type]=s}),t.unread_notifications&&(i._unreadNotifications=t.unread_notifications),t.summary){const s="m.heroes",o="m.invited_member_count",a="m.joined_member_count",l=i._summary,u=t.summary;l[s]=u[s]||l[s],l[a]=u[a]||l[a],l[o]=u[o]||l[o]}if(t.ephemeral&&t.ephemeral.events&&t.ephemeral.events.forEach(s=>{s.type!=="m.receipt"||!s.content||Object.keys(s.content).forEach(o=>{!s.content[o]["m.read"]||Object.keys(s.content[o]["m.read"]).forEach(a=>{i._readReceipts[a]={data:s.content[o]["m.read"][a],eventId:o}})})}),t.timeline&&t.timeline.limited&&(i._timeline=[]),t.state&&t.state.events&&t.state.events.forEach(s=>{cd(i._currentState,s)}),t.timeline&&t.timeline.events&&t.timeline.events.forEach((s,o)=>{cd(i._currentState,s);let a;if(r)a=s;else{a=Object.assign({},s),a.unsigned!==void 0&&(a.unsigned=Object.assign({},a.unsigned));const l=s.unsigned?s.unsigned.age:s.age;l!==void 0&&(a._localTs=Date.now()-l)}i._timeline.push({event:a,token:o===0?t.timeline.prev_batch:null})}),i._timeline.length>this.opts.maxTimelineEntries){const s=i._timeline.length-this.opts.maxTimelineEntries;for(let o=s;o<i._timeline.length;o++)if(i._timeline[o].token){i._timeline=i._timeline.slice(o,i._timeline.length);break}}}accumulateGroups(e){!e.groups||(e.groups.invite&&Object.keys(e.groups.invite).forEach(t=>{this.accumulateGroup(t,jt.Invite,e.groups.invite[t])}),e.groups.join&&Object.keys(e.groups.join).forEach(t=>{this.accumulateGroup(t,jt.Join,e.groups.join[t])}),e.groups.leave&&Object.keys(e.groups.leave).forEach(t=>{this.accumulateGroup(t,jt.Leave,e.groups.leave[t])}))}accumulateGroup(e,t,r){for(const i of[jt.Invite,jt.Leave,jt.Join])delete this.groups[i][e];this.groups[t][e]=r}getJSON(e=!1){const t={join:{},invite:{},leave:{}};Object.keys(this.inviteRooms).forEach(i=>{t.invite[i]=this.inviteRooms[i]}),Object.keys(this.joinRooms).forEach(i=>{const s=this.joinRooms[i],o={ephemeral:{events:[]},account_data:{events:[]},state:{events:[]},timeline:{events:[],prev_batch:null},unread_notifications:s._unreadNotifications,summary:s._summary};Object.keys(s._accountData).forEach(u=>{o.account_data.events.push(s._accountData[u])});const a={type:"m.receipt",room_id:i,content:{}};Object.keys(s._readReceipts).forEach(u=>{const c=s._readReceipts[u];a.content[c.eventId]||(a.content[c.eventId]={"m.read":{}}),a.content[c.eventId]["m.read"][u]=c.data}),Object.keys(a.content).length>0&&o.ephemeral.events.push(a),s._timeline.forEach(u=>{if(!o.timeline.prev_batch){if(!u.token)return;o.timeline.prev_batch=u.token}let c;!e&&u.event._localTs?(c=Object.assign({},u.event),c.unsigned!==void 0&&(c.unsigned=Object.assign({},c.unsigned)),delete c._localTs,c.unsigned=c.unsigned||{},c.unsigned.age=Date.now()-u.event._localTs):c=u.event,o.timeline.events.push(c)});const l=Object.create(null);for(let u=o.timeline.events.length-1;u>=0;u--){const c=o.timeline.events[u];if(c.state_key===null||c.state_key===void 0)continue;const g=(0,Dk.deepCopy)(c);g.unsigned&&(g.unsigned.prev_content&&(g.content=g.unsigned.prev_content),g.unsigned.prev_sender&&(g.sender=g.unsigned.prev_sender)),cd(l,g)}Object.keys(s._currentState).forEach(u=>{Object.keys(s._currentState[u]).forEach(c=>{let g=s._currentState[u][c];l[u]&&l[u][c]&&(g=l[u][c]),o.state.events.push(g)})}),t.join[i]=o});const r=[];return Object.keys(this.accountData).forEach(i=>{r.push(this.accountData[i])}),{nextBatch:this.nextBatch,roomsData:t,groupsData:this.groups,accountData:r}}getNextBatchToken(){return this.nextBatch}}ni.SyncAccumulator=Ak;function cd(n,e){e.state_key===null||e.state_key===void 0||!e.type||(n[e.type]||(n[e.type]=Object.create(null)),n[e.type][e.state_key]=e)}var xk=G.exports;Object.defineProperty(Bi,"__esModule",{value:!0});Bi.SyncState=Bi.SyncApi=void 0;var Pr=xk(Y.exports),js=tn,Ot=hr,Uk=iu,Vs=Lk(W),kg=xs,Cg=Wt,$k=fc,nr=ie,Pg=ci,qe=ot,ld=ni,Mc=me,Nk=ne,wi=Tn,Dc=rn,ud=br;function g_(n){if(typeof WeakMap!="function")return null;var e=new WeakMap,t=new WeakMap;return(g_=function(r){return r?t:e})(n)}function Lk(n,e){if(!e&&n&&n.__esModule)return n;if(n===null||typeof n!="object"&&typeof n!="function")return{default:n};var t=g_(e);if(t&&t.has(n))return t.get(n);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in n)if(s!=="default"&&Object.prototype.hasOwnProperty.call(n,s)){var o=i?Object.getOwnPropertyDescriptor(n,s):null;o&&(o.get||o.set)?Object.defineProperty(r,s,o):r[s]=n[s]}return r.default=n,t&&t.set(n,r),r}const Mg=80*1e3,Bk=3;let Pt;Bi.SyncState=Pt;(function(n){n.Error="ERROR",n.Prepared="PREPARED",n.Stopped="STOPPED",n.Syncing="SYNCING",n.Catchup="CATCHUP",n.Reconnecting="RECONNECTING"})(Pt||(Bi.SyncState=Pt={}));function Dg(n,e){return"FILTER_SYNC_"+n+(e?"_"+e:"")}function Ce(...n){nr.logger.log(...n)}var Bh;(function(n){n.Offline="offline",n.Online="online",n.Unavailable="unavailable"})(Bh||(Bh={}));class Kk{constructor(e,t={}){var r;this.client=e,this.opts=t,(0,Pr.default)(this,"_peekRoom",null),(0,Pr.default)(this,"currentSyncRequest",null),(0,Pr.default)(this,"syncState",null),(0,Pr.default)(this,"syncStateData",null),(0,Pr.default)(this,"catchingUp",!1),(0,Pr.default)(this,"running",!1),(0,Pr.default)(this,"keepAliveTimer",null),(0,Pr.default)(this,"connectionReturnedDefer",null),(0,Pr.default)(this,"notifEvents",[]),(0,Pr.default)(this,"failedSyncCount",0),(0,Pr.default)(this,"storeIsInvalid",!1),(0,Pr.default)(this,"onOnline",()=>{Ce("Browser thinks we are back online"),this.startKeepAlives(0)}),this.opts.initialSyncLimit=(r=this.opts.initialSyncLimit)!==null&&r!==void 0?r:8,this.opts.resolveInvitesToProfiles=this.opts.resolveInvitesToProfiles||!1,this.opts.pollTimeout=this.opts.pollTimeout||30*1e3,this.opts.pendingEventOrdering=this.opts.pendingEventOrdering||qe.PendingEventOrdering.Chronological,this.opts.experimentalThreadSupport=this.opts.experimentalThreadSupport===!0,t.canResetEntireTimeline||(t.canResetEntireTimeline=i=>!1),e.getNotifTimelineSet()&&e.reEmitter.reEmit(e.getNotifTimelineSet(),[Ot.RoomEvent.Timeline,Ot.RoomEvent.TimelineReset])}createRoom(e){const t=this.client,{timelineSupport:r,unstableClientRelationAggregation:i}=t,s=new Ot.Room(e,t,t.getUserId(),{lazyLoadMembers:this.opts.lazyLoadMembers,pendingEventOrdering:this.opts.pendingEventOrdering,timelineSupport:r,unstableClientRelationAggregation:i});return t.reEmitter.reEmit(s,[Ot.RoomEvent.Name,Ot.RoomEvent.Redaction,Ot.RoomEvent.RedactionCancelled,Ot.RoomEvent.Receipt,Ot.RoomEvent.Tags,Ot.RoomEvent.LocalEchoUpdated,Ot.RoomEvent.AccountData,Ot.RoomEvent.MyMembership,Ot.RoomEvent.Timeline,Ot.RoomEvent.TimelineReset]),this.registerStateListeners(s),s}createGroup(e){const t=this.client,r=new Uk.Group(e);return t.reEmitter.reEmit(r,[qe.ClientEvent.GroupProfile,qe.ClientEvent.GroupMyMembership]),t.store.storeGroup(r),r}registerStateListeners(e){const t=this.client;t.reEmitter.reEmit(e.currentState,[wi.RoomStateEvent.Events,wi.RoomStateEvent.Members,wi.RoomStateEvent.NewMember,wi.RoomStateEvent.Update,ud.BeaconEvent.New,ud.BeaconEvent.Update,ud.BeaconEvent.LivenessChange]),e.currentState.on(wi.RoomStateEvent.NewMember,function(r,i,s){s.user=t.getUser(s.userId),t.reEmitter.reEmit(s,[Dc.RoomMemberEvent.Name,Dc.RoomMemberEvent.Typing,Dc.RoomMemberEvent.PowerLevel,Dc.RoomMemberEvent.Membership])})}deregisterStateListeners(e){e.currentState.removeAllListeners(wi.RoomStateEvent.Events),e.currentState.removeAllListeners(wi.RoomStateEvent.Members),e.currentState.removeAllListeners(wi.RoomStateEvent.NewMember)}syncLeftRooms(){const e=this.client,t=new kg.Filter(this.client.credentials.userId);t.setTimelineLimit(1),t.setIncludeLeaveRooms(!0);const r=this.opts.pollTimeout+Mg,i={timeout:0};return e.getOrCreateFilter(Dg(e.credentials.userId,"LEFT_ROOMS"),t).then(function(s){return i.filter=s,e.http.authedRequest(void 0,Mc.Method.Get,"/sync",i,void 0,r)}).then(s=>{var o;let a=[];(o=s.rooms)!==null&&o!==void 0&&o.leave&&(a=this.mapSyncResponseToRoomArray(s.rooms.leave));const l=[];return a.forEach(async u=>{const c=u.room;if(l.push(c),!u.isBrandNewRoom)return;u.timeline=u.timeline||{};const g=this.mapSyncEventsFormat(u.timeline,c),[m,f]=this.client.partitionThreadedEvents(g),_=this.mapSyncEventsFormat(u.state,c);c.getLiveTimeline().setPaginationToken(u.timeline.prev_batch,Cg.EventTimeline.BACKWARDS),this.processRoomEvents(c,_,m),await this.processThreadEvents(c,f,!1),c.recalculate(),e.store.storeRoom(c),e.emit(qe.ClientEvent.Room,c),this.processEventsForNotifs(c,g)}),l})}peek(e){if(this._peekRoom&&this._peekRoom.roomId===e)return Promise.resolve(this._peekRoom);const t=this.client;return this._peekRoom=this.createRoom(e),this.client.roomInitialSync(e,20).then(r=>{r.messages=r.messages||{chunk:[]},r.messages.chunk=r.messages.chunk||[],r.state=r.state||[];const i=Vs.deepCopy(r.state).map(t.getEventMapper()),s=r.state.map(t.getEventMapper()),o=r.messages.chunk.map(t.getEventMapper());return r.presence&&Array.isArray(r.presence)&&r.presence.map(t.getEventMapper()).forEach(function(a){let l=t.store.getUser(a.getContent().user_id);l?l.setPresenceEvent(a):(l=Ac(t,a.getContent().user_id),l.setPresenceEvent(a),t.store.storeUser(l)),t.emit(qe.ClientEvent.Event,a)}),r.messages.start&&(this._peekRoom.oldState.paginationToken=r.messages.start),this._peekRoom.oldState.setStateEvents(i),this._peekRoom.currentState.setStateEvents(s),this.resolveInvites(this._peekRoom),this._peekRoom.recalculate(),this._peekRoom.addEventsToTimeline(o.reverse(),!0,this._peekRoom.getLiveTimeline(),r.messages.start),t.store.storeRoom(this._peekRoom),t.emit(qe.ClientEvent.Room,this._peekRoom),this.peekPoll(this._peekRoom),this._peekRoom})}stopPeeking(){this._peekRoom=null}peekPoll(e,t){if(this._peekRoom!==e){Ce("Stopped peeking in room %s",e.roomId);return}this.client.http.authedRequest(void 0,Mc.Method.Get,"/events",{room_id:e.roomId,timeout:String(30*1e3),from:t},void 0,50*1e3).then(r=>{if(this._peekRoom!==e){Ce("Stopped peeking in room %s",e.roomId);return}r.chunk.filter(function(s){return s.type==="m.presence"}).map(this.client.getEventMapper()).forEach(s=>{let o=this.client.store.getUser(s.getContent().user_id);o?o.setPresenceEvent(s):(o=Ac(this.client,s.getContent().user_id),o.setPresenceEvent(s),this.client.store.storeUser(o)),this.client.emit(qe.ClientEvent.Event,s)});const i=r.chunk.filter(function(s){return s.room_id===e.roomId&&s.event_id}).map(this.client.getEventMapper());e.addLiveEvents(i),this.peekPoll(e,r.end)},r=>{nr.logger.error("[%s] Peek poll failed: %s",e.roomId,r),setTimeout(()=>{this.peekPoll(e,t)},30*1e3)})}getSyncState(){return this.syncState}getSyncStateData(){return this.syncStateData}async recoverFromSyncStartupError(e,t){await e;const r=this.startKeepAlives();this.updateSyncState(Pt.Error,{error:t}),await r}async wasLazyLoadingToggled(e=!1){let t=!1;if(!await this.client.store.isNewlyCreated()){const i=await this.client.store.getClientOptions();return i&&(t=!!i.lazyLoadMembers),t!==e}return!1}shouldAbortSync(e){return e.errcode==="M_UNKNOWN_TOKEN"?(nr.logger.warn("Token no longer valid - assuming logout"),this.stop(),this.updateSyncState(Pt.Error,{error:e}),!0):!1}sync(){const e=this.client;this.running=!0,V.window&&V.window.addEventListener&&V.window.addEventListener("online",this.onOnline,!1);let t=Promise.resolve(),r=null;const i=async()=>{try{Ce("Getting push rules...");const l=await e.getPushRules();Ce("Got push rules"),e.pushRules=l}catch(l){if(nr.logger.error("Getting push rules failed",l),this.shouldAbortSync(l))return;Ce("Waiting for saved sync before retrying push rules..."),await this.recoverFromSyncStartupError(t,l),i();return}o()},s=()=>{const l=new kg.Filter(e.credentials.userId);return l.setTimelineLimit(this.opts.initialSyncLimit),l},o=async()=>{if(Ce("Checking lazy load status..."),this.opts.lazyLoadMembers&&e.isGuest()&&(this.opts.lazyLoadMembers=!1),this.opts.lazyLoadMembers&&(Ce("Checking server lazy load support..."),await e.doesServerSupportLazyLoading()?(Ce("Enabling lazy load on sync filter..."),this.opts.filter||(this.opts.filter=s()),this.opts.filter.setLazyLoadMembers(!0)):(Ce("LL: lazy loading requested but not supported by server, so disabling"),this.opts.lazyLoadMembers=!1)),Ce("Checking whether lazy loading has changed in store..."),await this.wasLazyLoadingToggled(this.opts.lazyLoadMembers)){this.storeIsInvalid=!0;const u=Pg.InvalidStoreError.TOGGLED_LAZY_LOADING,c=new Pg.InvalidStoreError(u,!!this.opts.lazyLoadMembers);this.updateSyncState(Pt.Error,{error:c}),nr.logger.warn("InvalidStoreError: store is not usable: stopping sync.");return}this.opts.lazyLoadMembers&&this.opts.crypto&&this.opts.crypto.enableLazyLoading();try{Ce("Storing client options..."),await this.client.storeClientOptions(),Ce("Stored client options")}catch(u){throw nr.logger.error("Storing client options failed",u),u}a()},a=async()=>{Ce("Getting filter...");let l;this.opts.filter?l=this.opts.filter:l=s();let u;try{u=await e.getOrCreateFilter(Dg(e.credentials.userId),l)}catch(c){if(nr.logger.error("Getting filter failed",c),this.shouldAbortSync(c))return;Ce("Waiting for saved sync before retrying filter..."),await this.recoverFromSyncStartupError(t,c),a();return}e.resetNotifTimelineSet(),this.currentSyncRequest===null&&(Ce("Sending first sync request..."),this.currentSyncRequest=this.doSyncRequest({filterId:u},r)),Ce("Waiting for saved sync before starting sync processing..."),await t,this.doSync({filterId:u})};e.isGuest()?this.doSync({}):(Ce("Getting saved sync token..."),t=e.store.getSavedSyncToken().then(l=>(Ce("Got saved sync token"),r=l,Ce("Getting saved sync..."),e.store.getSavedSync())).then(l=>{if(Ce(`Got reply from saved sync, exists? ${!!l}`),l)return this.syncFromCache(l)}).catch(l=>{nr.logger.error("Getting saved sync failed",l)}),i())}stop(){Ce("SyncApi.stop"),V.window&&V.window.removeEventListener&&V.window.removeEventListener("online",this.onOnline,!1),this.running=!1,this.currentSyncRequest&&this.currentSyncRequest.abort(),this.keepAliveTimer&&(clearTimeout(this.keepAliveTimer),this.keepAliveTimer=null)}retryImmediately(){return this.connectionReturnedDefer?(this.startKeepAlives(0),!0):!1}async syncFromCache(e){Ce("sync(): not doing HTTP hit, instead returning stored /sync data");const t=e.nextBatch;this.client.store.setSyncToken(t);const r={oldSyncToken:null,nextSyncToken:t,catchingUp:!1,fromCache:!0},i={next_batch:t,rooms:e.roomsData,groups:e.groupsData,account_data:{events:e.accountData}};try{await this.processSyncResponse(r,i)}catch(s){nr.logger.error("Error processing cached sync",s.stack||s)}this.storeIsInvalid||this.updateSyncState(Pt.Prepared,r)}async doSync(e){const t=this.client;if(!this.running){Ce("Sync no longer running: exiting."),this.connectionReturnedDefer&&(this.connectionReturnedDefer.reject(),this.connectionReturnedDefer=null),this.updateSyncState(Pt.Stopped);return}const r=t.store.getSyncToken();let i;try{this.currentSyncRequest===null&&(this.currentSyncRequest=this.doSyncRequest(e,r)),i=await this.currentSyncRequest}catch(o){this.onSyncError(o,e);return}finally{this.currentSyncRequest=null}t.store.setSyncToken(i.next_batch),this.failedSyncCount=0,await t.store.setSyncData(i);const s={oldSyncToken:r,nextSyncToken:i.next_batch,catchingUp:this.catchingUp};this.opts.crypto&&await this.opts.crypto.onSyncWillProcess(s);try{await this.processSyncResponse(s,i)}catch(o){nr.logger.error("Caught /sync error",o.stack||o),this.client.emit(qe.ClientEvent.SyncUnexpectedError,o)}s.catchingUp=this.catchingUp,e.hasSyncedBefore||(this.updateSyncState(Pt.Prepared,s),e.hasSyncedBefore=!0),this.opts.crypto&&await this.opts.crypto.onSyncCompleted(s),this.updateSyncState(Pt.Syncing,s),t.store.wantsSave()&&(this.opts.crypto&&await this.opts.crypto.saveDeviceList(0),t.store.save()),this.doSync(e)}doSyncRequest(e,t){const r=this.getSyncParams(e,t);return this.client.http.authedRequest(void 0,Mc.Method.Get,"/sync",r,void 0,r.timeout+Mg)}getSyncParams(e,t){let r=this.opts.pollTimeout;(this.getSyncState()!=="SYNCING"||this.catchingUp)&&(this.catchingUp=!0,r=0);let i=e.filterId;this.client.isGuest()&&!i&&(i=this.getGuestFilter());const s={filter:i,timeout:r};return this.opts.disablePresence&&(s.set_presence=Bh.Offline),t?s.since=t:s._cacheBuster=Date.now(),(this.getSyncState()=="ERROR"||this.getSyncState()=="RECONNECTING")&&(s.timeout=0),s}onSyncError(e,t){if(!this.running){Ce("Sync no longer running: exiting"),this.connectionReturnedDefer&&(this.connectionReturnedDefer.reject(),this.connectionReturnedDefer=null),this.updateSyncState(Pt.Stopped);return}nr.logger.error("/sync error %s",e),nr.logger.error(e),!this.shouldAbortSync(e)&&(this.failedSyncCount++,nr.logger.log("Number of consecutive failed sync requests:",this.failedSyncCount),Ce("Starting keep-alive"),this.startKeepAlives().then(r=>{r&&this.getSyncState()===Pt.Error&&this.updateSyncState(Pt.Catchup,{oldSyncToken:null,nextSyncToken:null,catchingUp:!0}),this.doSync(t)}),this.currentSyncRequest=null,this.updateSyncState(this.failedSyncCount>=Bk?Pt.Error:Pt.Reconnecting,{error:e}))}async processSyncResponse(e,t){const r=this.client;if(t.presence&&Array.isArray(t.presence.events)&&t.presence.events.map(r.getEventMapper()).forEach(function(a){let l=r.store.getUser(a.getSender());l?l.setPresenceEvent(a):(l=Ac(r,a.getSender()),l.setPresenceEvent(a),r.store.storeUser(l)),r.emit(qe.ClientEvent.Event,a)}),t.account_data&&Array.isArray(t.account_data.events)){const a=t.account_data.events.map(r.getEventMapper()),l=a.reduce((u,c)=>(u[c.getId()]=r.store.getAccountData(c.getType()),u),{});r.store.storeAccountDataEvents(a),a.forEach(function(u){if(u.getType()===Nk.EventType.PushRules){const g=u.getContent();r.pushRules=$k.PushProcessor.rewriteDefaultRules(g)}const c=l[u.getId()];return r.emit(qe.ClientEvent.AccountData,u,c),u})}if(t.to_device&&Array.isArray(t.to_device.events)&&t.to_device.events.length>0){const a=[];t.to_device.events.map(r.getEventMapper()).map(l=>{if(l.getType()==="m.key.verification.cancel"){const u=l.getContent().transaction_id;u&&a.push(u)}return l}).forEach(function(l){const u=l.getContent();if(l.getType()=="m.room.message"&&u.msgtype=="m.bad.encrypted"){nr.logger.log("Ignoring undecryptable to-device event from "+l.getSender());return}if(l.getType()==="m.key.verification.start"||l.getType()==="m.key.verification.request"){const c=u.transaction_id;a.includes(c)&&l.flagCancelled()}r.emit(qe.ClientEvent.ToDeviceEvent,l)})}else this.catchingUp=!1;t.groups&&(t.groups.invite&&this.processGroupSyncEntry(t.groups.invite,ld.Category.Invite),t.groups.join&&this.processGroupSyncEntry(t.groups.join,ld.Category.Join),t.groups.leave&&this.processGroupSyncEntry(t.groups.leave,ld.Category.Leave));let i=[],s=[],o=[];if(t.rooms&&(t.rooms.invite&&(i=this.mapSyncResponseToRoomArray(t.rooms.invite)),t.rooms.join&&(s=this.mapSyncResponseToRoomArray(t.rooms.join)),t.rooms.leave&&(o=this.mapSyncResponseToRoomArray(t.rooms.leave))),this.notifEvents=[],i.forEach(a=>{const l=a.room,u=this.mapSyncEventsFormat(a.invite_state,l);this.processRoomEvents(l,u),a.isBrandNewRoom&&(l.recalculate(),r.store.storeRoom(l),r.emit(qe.ClientEvent.Room,l)),u.forEach(function(c){r.emit(qe.ClientEvent.Event,c)}),l.updateMyMembership("invite")}),await Vs.promiseMapSeries(s,async a=>{const l=a.room,u=this.mapSyncEventsFormat(a.state,l),c=this.mapSyncEventsFormat(a.timeline,l,!1),g=this.mapSyncEventsFormat(a.ephemeral),m=this.mapSyncEventsFormat(a.account_data),f=r.isRoomEncrypted(l.roomId);if(a.unread_notifications&&(l.setUnreadNotificationCount(Ot.NotificationCountType.Total,a.unread_notifications.notification_count),(!f||f&&l.getUnreadNotificationCount(Ot.NotificationCountType.Highlight)<=0)&&l.setUnreadNotificationCount(Ot.NotificationCountType.Highlight,a.unread_notifications.highlight_count)),a.timeline=a.timeline||{},a.isBrandNewRoom)l.getLiveTimeline().setPaginationToken(a.timeline.prev_batch,Cg.EventTimeline.BACKWARDS);else if(a.timeline.limited){let T=!0;for(let C=c.length-1;C>=0;C--){const S=c[C].getId();if(l.getTimelineForEvent(S)){Ce("Already have event "+S+" in limited sync - not resetting"),T=!1,c.splice(0,C);break}}T&&(this.deregisterStateListeners(l),l.resetLiveTimeline(a.timeline.prev_batch,this.opts.canResetEntireTimeline(l.roomId)?null:e.oldSyncToken),r.resetNotifTimelineSet(),this.registerStateListeners(l))}const[_,I]=this.client.partitionThreadedEvents(c);this.processRoomEvents(l,u,_,e.fromCache),await this.processThreadEvents(l,I,!1),a.summary&&l.setSummary(a.summary),l.addEphemeralEvents(g),l.addAccountData(m),l.recalculate(),a.isBrandNewRoom&&(r.store.storeRoom(l),r.emit(qe.ClientEvent.Room,l)),this.processEventsForNotifs(l,c);const R=async T=>{if(r.emit(qe.ClientEvent.Event,T),T.isState()&&T.getType()=="m.room.encryption"&&this.opts.crypto&&await this.opts.crypto.onCryptoEvent(T),T.isState()&&T.getType()==="im.vector.user_status"){let C=r.store.getUser(T.getStateKey());C?C.unstable_updateStatusMessage(T):(C=Ac(r,T.getStateKey()),C.unstable_updateStatusMessage(T),r.store.storeUser(C))}};await Vs.promiseMapSeries(u,R),await Vs.promiseMapSeries(_,R),await Vs.promiseMapSeries(I,R),g.forEach(function(T){r.emit(qe.ClientEvent.Event,T)}),m.forEach(function(T){r.emit(qe.ClientEvent.Event,T)}),l.updateMyMembership("join"),l.decryptCriticalEvents()}),o.forEach(async a=>{const l=a.room,u=this.mapSyncEventsFormat(a.state,l),c=this.mapSyncEventsFormat(a.timeline,l),g=this.mapSyncEventsFormat(a.account_data),[m,f]=this.client.partitionThreadedEvents(c);this.processRoomEvents(l,u,m),await this.processThreadEvents(l,f,!1),l.addAccountData(g),l.recalculate(),a.isBrandNewRoom&&(r.store.storeRoom(l),r.emit(qe.ClientEvent.Room,l)),this.processEventsForNotifs(l,c),u.forEach(function(_){r.emit(qe.ClientEvent.Event,_)}),m.forEach(function(_){r.emit(qe.ClientEvent.Event,_)}),f.forEach(function(_){r.emit(qe.ClientEvent.Event,_)}),g.forEach(function(_){r.emit(qe.ClientEvent.Event,_)}),l.updateMyMembership("leave")}),e.oldSyncToken&&this.notifEvents.length&&(this.notifEvents.sort(function(a,l){return a.getTs()-l.getTs()}),this.notifEvents.forEach(function(a){r.getNotifTimelineSet().addLiveEvent(a)})),t.device_lists&&this.opts.crypto&&await this.opts.crypto.handleDeviceListChanges(e,t.device_lists),this.opts.crypto&&t.device_one_time_keys_count){const a=t.device_one_time_keys_count.signed_curve25519||0;this.opts.crypto.updateOneTimeKeyCount(a)}if(this.opts.crypto&&(t.device_unused_fallback_key_types||t["org.matrix.msc2732.device_unused_fallback_key_types"])){const a=t.device_unused_fallback_key_types||t["org.matrix.msc2732.device_unused_fallback_key_types"];this.opts.crypto.setNeedsNewFallback(a instanceof Array&&!a.includes("signed_curve25519"))}}startKeepAlives(e){return e===void 0&&(e=2e3+Math.floor(Math.random()*5e3)),this.keepAliveTimer!==null&&clearTimeout(this.keepAliveTimer),e>0?this.keepAliveTimer=setTimeout(this.pokeKeepAlive.bind(this),e):this.pokeKeepAlive(),this.connectionReturnedDefer||(this.connectionReturnedDefer=Vs.defer()),this.connectionReturnedDefer.promise}pokeKeepAlive(e=!1){const t=()=>{clearTimeout(this.keepAliveTimer),this.connectionReturnedDefer&&(this.connectionReturnedDefer.resolve(e),this.connectionReturnedDefer=null)};this.client.http.request(void 0,Mc.Method.Get,"/_matrix/client/versions",void 0,void 0,{prefix:"",localTimeoutMs:15*1e3}).then(()=>{t()},r=>{r.httpStatus==400||r.httpStatus==404?this.keepAliveTimer=setTimeout(t,2e3):(e=!0,this.keepAliveTimer=setTimeout(this.pokeKeepAlive.bind(this,e),5e3+Math.floor(Math.random()*5e3)),this.updateSyncState(Pt.Error,{error:r}))})}processGroupSyncEntry(e,t){for(const r of Object.keys(e)){const i=e[r];let s=this.client.store.getGroup(r);const o=s===null;s===null&&(s=this.createGroup(r)),i.profile&&s.setProfile(i.profile.name,i.profile.avatar_url),i.inviter&&s.setInviter({userId:i.inviter}),s.setMyMembership(t),o&&this.client.emit(qe.ClientEvent.Group,s)}}mapSyncResponseToRoomArray(e){const t=this.client;return Object.keys(e).map(r=>{const i=e[r];let s=t.store.getRoom(r),o=!1;return s||(s=this.createRoom(r),o=!0),i.room=s,i.isBrandNewRoom=o,i})}mapSyncEventsFormat(e,t,r=!0){if(!e||!Array.isArray(e.events))return[];const i=this.client.getEventMapper({decrypt:r});return e.events.map(function(s){return t&&(s.room_id=t.roomId),i(s)})}resolveInvites(e){if(!e||!this.opts.resolveInvitesToProfiles)return;const t=this.client;e.getMembersWithMembership("invite").forEach(function(r){if(r._requestedProfileInfo)return;r._requestedProfileInfo=!0;const i=t.getUser(r.userId);let s;i?s=Promise.resolve({avatar_url:i.avatarUrl,displayname:i.displayName}):s=t.getProfileInfo(r.userId),s.then(function(o){const a=r.events.member;a.getContent().membership==="invite"&&(a.getContent().avatar_url=o.avatar_url,a.getContent().displayname=o.displayname,r.setMembershipEvent(a,e.currentState))},function(o){})})}processRoomEvents(e,t,r,i=!1){const s=e.getLiveTimeline(),o=s.getEvents().length==0;if(o){for(const a of t)this.client.getPushActionsForEvent(a);s.initialiseState(t)}this.resolveInvites(e),e.recalculate(),o||(e.oldState.setStateEvents(t||[]),e.currentState.setStateEvents(t||[])),e.addLiveEvents(r||[],null,i)}processThreadEvents(e,t,r){return this.client.processThreadEvents(e,t,r)}processEventsForNotifs(e,t){if(this.client.getNotifTimelineSet())for(let r=0;r<t.length;r++){const i=this.client.getPushActionsForEvent(t[r]);i&&i.notify&&i.tweaks&&i.tweaks.highlight&&this.notifEvents.push(t[r])}}getGuestFilter(){return"{}"}updateSyncState(e,t){const r=this.syncState;this.syncState=e,this.syncStateData=t,this.client.emit(qe.ClientEvent.Sync,this.syncState,r,t)}}Bi.SyncApi=Kk;function Ac(n,e){const t=new js.User(e);return n.reEmitter.reEmit(t,[js.UserEvent.AvatarUrl,js.UserEvent.DisplayName,js.UserEvent.Presence,js.UserEvent.CurrentlyActive,js.UserEvent.LastPresenceTs]),t}var au={},Fk=G.exports;Object.defineProperty(au,"__esModule",{value:!0});au.StubStore=void 0;var Ag=Fk(Y.exports);class qk{constructor(){(0,Ag.default)(this,"accountData",{}),(0,Ag.default)(this,"fromToken",null)}isNewlyCreated(){return Promise.resolve(!0)}getSyncToken(){return this.fromToken}setSyncToken(e){this.fromToken=e}storeGroup(e){}getGroup(e){return null}getGroups(){return[]}storeRoom(e){}getRoom(e){return null}getRooms(){return[]}removeRoom(e){}getRoomSummaries(){return[]}storeUser(e){}getUser(e){return null}getUsers(){return[]}scrollback(e,t){return[]}storeEvents(e,t,r,i){}storeFilter(e){}getFilter(e,t){return null}getFilterIdByName(e){return null}setFilterIdByName(e,t){}storeAccountDataEvents(e){}getAccountData(e){}setSyncData(e){return Promise.resolve()}wantsSave(){return!1}save(){}startup(){return Promise.resolve()}getSavedSync(){return Promise.resolve(null)}getSavedSyncToken(){return Promise.resolve(null)}deleteAllData(){return Promise.resolve()}getOutOfBandMembers(){return Promise.resolve(null)}setOutOfBandMembers(e,t){return Promise.resolve()}clearOutOfBandMembers(){return Promise.resolve()}getClientOptions(){return Promise.resolve({})}storeClientOptions(e){return Promise.resolve()}}au.StubStore=qk;var Oe={},li={};Object.defineProperty(li,"__esModule",{value:!0});li.randomLowercaseString=Gk;li.randomString=Vk;li.randomUppercaseString=Wk;const m_="abcdefghijklmnopqrstuvwxyz",y_="ABCDEFGHIJKLMNOPQRSTUVWXYZ",jk="0123456789";function Vk(n){return Pf(n,y_+m_+jk)}function Gk(n){return Pf(n,m_)}function Wk(n){return Pf(n,y_)}function Pf(n,e){let t="";for(let r=0;r<n;++r)t+=e.charAt(Math.floor(Math.random()*e.length));return t}var _s={};Object.defineProperty(_s,"__esModule",{value:!0});_s.SDPStreamMetadataPurpose=_s.SDPStreamMetadataKey=void 0;const Hk="org.matrix.msc3077.sdp_stream_metadata";_s.SDPStreamMetadataKey=Hk;let Kh;_s.SDPStreamMetadataPurpose=Kh;(function(n){n.Usermedia="m.usermedia",n.Screenshare="m.screenshare"})(Kh||(_s.SDPStreamMetadataPurpose=Kh={}));var ei={},Yk=G.exports;Object.defineProperty(ei,"__esModule",{value:!0});ei.SPEAKING_THRESHOLD=ei.CallFeedEvent=ei.CallFeed=void 0;var yt=Yk(Y.exports),zk=je;const Jk=200,v_=-60;ei.SPEAKING_THRESHOLD=v_;const Xk=8;let yn;ei.CallFeedEvent=yn;(function(n){n.NewStream="new_stream",n.MuteStateChanged="mute_state_changed",n.VolumeChanged="volume_changed",n.Speaking="speaking"})(yn||(ei.CallFeedEvent=yn={}));class Qk extends zk.TypedEventEmitter{constructor(e){super(),(0,yt.default)(this,"stream",void 0),(0,yt.default)(this,"userId",void 0),(0,yt.default)(this,"purpose",void 0),(0,yt.default)(this,"speakingVolumeSamples",void 0),(0,yt.default)(this,"client",void 0),(0,yt.default)(this,"roomId",void 0),(0,yt.default)(this,"audioMuted",void 0),(0,yt.default)(this,"videoMuted",void 0),(0,yt.default)(this,"measuringVolumeActivity",!1),(0,yt.default)(this,"audioContext",void 0),(0,yt.default)(this,"analyser",void 0),(0,yt.default)(this,"frequencyBinCount",void 0),(0,yt.default)(this,"speakingThreshold",v_),(0,yt.default)(this,"speaking",!1),(0,yt.default)(this,"volumeLooperTimeout",void 0),(0,yt.default)(this,"onAddTrack",()=>{this.emit(yn.NewStream,this.stream)}),(0,yt.default)(this,"volumeLooper",()=>{if(!this.analyser||!this.measuringVolumeActivity)return;this.analyser.getFloatFrequencyData(this.frequencyBinCount);let t=-1/0;for(let i=0;i<this.frequencyBinCount.length;i++)this.frequencyBinCount[i]>t&&(t=this.frequencyBinCount[i]);this.speakingVolumeSamples.shift(),this.speakingVolumeSamples.push(t),this.emit(yn.VolumeChanged,t);let r=!1;for(let i=0;i<this.speakingVolumeSamples.length;i++)if(this.speakingVolumeSamples[i]>this.speakingThreshold){r=!0;break}this.speaking!==r&&(this.speaking=r,this.emit(yn.Speaking,this.speaking)),this.volumeLooperTimeout=setTimeout(this.volumeLooper,Jk)}),this.client=e.client,this.roomId=e.roomId,this.userId=e.userId,this.purpose=e.purpose,this.audioMuted=e.audioMuted,this.videoMuted=e.videoMuted,this.speakingVolumeSamples=new Array(Xk).fill(-1/0),this.updateStream(null,e.stream),this.hasAudioTrack&&this.initVolumeMeasuring()}get hasAudioTrack(){return this.stream.getAudioTracks().length>0}updateStream(e,t){t!==e&&(e&&(e.removeEventListener("addtrack",this.onAddTrack),this.measureVolumeActivity(!1)),t&&(this.stream=t,t.addEventListener("addtrack",this.onAddTrack),this.hasAudioTrack?this.initVolumeMeasuring():this.measureVolumeActivity(!1)),this.emit(yn.NewStream,this.stream))}initVolumeMeasuring(){const e=window.AudioContext||window.webkitAudioContext;if(!this.hasAudioTrack||!e)return;this.audioContext=new e,this.analyser=this.audioContext.createAnalyser(),this.analyser.fftSize=512,this.analyser.smoothingTimeConstant=.1,this.audioContext.createMediaStreamSource(this.stream).connect(this.analyser),this.frequencyBinCount=new Float32Array(this.analyser.frequencyBinCount)}getMember(){return this.client.getRoom(this.roomId).getMember(this.userId)}isLocal(){return this.userId===this.client.getUserId()}isAudioMuted(){return this.stream.getAudioTracks().length===0||this.audioMuted}isVideoMuted(){return this.stream.getVideoTracks().length===0||this.videoMuted}isSpeaking(){return this.speaking}setNewStream(e){this.updateStream(this.stream,e)}setAudioMuted(e){this.audioMuted=e,this.speakingVolumeSamples.fill(-1/0),this.emit(yn.MuteStateChanged,this.audioMuted,this.videoMuted)}setVideoMuted(e){this.videoMuted=e,this.emit(yn.MuteStateChanged,this.audioMuted,this.videoMuted)}measureVolumeActivity(e){if(e){if(!this.audioContext||!this.analyser||!this.frequencyBinCount||!this.hasAudioTrack)return;this.measuringVolumeActivity=!0,this.volumeLooper()}else this.measuringVolumeActivity=!1,this.speakingVolumeSamples.fill(-1/0),this.emit(yn.VolumeChanged,-1/0)}setSpeakingThreshold(e){this.speakingThreshold=e}dispose(){clearTimeout(this.volumeLooperTimeout)}}ei.CallFeed=Qk;var Zk=G.exports;Object.defineProperty(Oe,"__esModule",{value:!0});Oe.MatrixCall=Oe.CallType=Oe.CallState=Oe.CallParty=Oe.CallEvent=Oe.CallErrorCode=Oe.CallError=Oe.CallDirection=void 0;Oe.createNewMatrixCall=iC;var te=Zk(Y.exports),K=ie,dd=tC(W),Mr=ne,eC=li,Ye=_s,na=ei,xg=je;function __(n){if(typeof WeakMap!="function")return null;var e=new WeakMap,t=new WeakMap;return(__=function(r){return r?t:e})(n)}function tC(n,e){if(!e&&n&&n.__esModule)return n;if(n===null||typeof n!="object"&&typeof n!="function")return{default:n};var t=__(e);if(t&&t.has(n))return t.get(n);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in n)if(s!=="default"&&Object.prototype.hasOwnProperty.call(n,s)){var o=i?Object.getOwnPropertyDescriptor(n,s):null;o&&(o.get||o.set)?Object.defineProperty(r,s,o):r[s]=n[s]}return r.default=n,t&&t.set(n,r),r}let de;Oe.CallState=de;(function(n){n.Fledgling="fledgling",n.InviteSent="invite_sent",n.WaitLocalMedia="wait_local_media",n.CreateOffer="create_offer",n.CreateAnswer="create_answer",n.Connecting="connecting",n.Connected="connected",n.Ringing="ringing",n.Ended="ended"})(de||(Oe.CallState=de={}));let Ya;Oe.CallType=Ya;(function(n){n.Voice="voice",n.Video="video"})(Ya||(Oe.CallType=Ya={}));let Wn;Oe.CallDirection=Wn;(function(n){n.Inbound="inbound",n.Outbound="outbound"})(Wn||(Oe.CallDirection=Wn={}));let ze;Oe.CallParty=ze;(function(n){n.Local="local",n.Remote="remote"})(ze||(Oe.CallParty=ze={}));let Pe;Oe.CallEvent=Pe;(function(n){n.Hangup="hangup",n.State="state",n.Error="error",n.Replaced="replaced",n.LocalHoldUnhold="local_hold_unhold",n.RemoteHoldUnhold="remote_hold_unhold",n.HoldUnhold="hold_unhold",n.FeedsChanged="feeds_changed",n.AssertedIdentityChanged="asserted_identity_changed",n.LengthChanged="length_changed",n.DataChannel="datachannel"})(Pe||(Oe.CallEvent=Pe={}));let ge;Oe.CallErrorCode=ge;(function(n){n.UserHangup="user_hangup",n.LocalOfferFailed="local_offer_failed",n.NoUserMedia="no_user_media",n.UnknownDevices="unknown_devices",n.SendInvite="send_invite",n.CreateAnswer="create_answer",n.SendAnswer="send_answer",n.SetRemoteDescription="set_remote_description",n.SetLocalDescription="set_local_description",n.AnsweredElsewhere="answered_elsewhere",n.IceFailed="ice_failed",n.InviteTimeout="invite_timeout",n.Replaced="replaced",n.SignallingFailed="signalling_timeout",n.UserBusy="user_busy",n.Transfered="transferred"})(ge||(Oe.CallErrorCode=ge={}));const rC=1,nC="stun:turn.matrix.org",Ug=6e4;class ts extends Error{constructor(e,t,r){super(t+": "+r),(0,te.default)(this,"code",void 0),this.code=e}}Oe.CallError=ts;function Gs(){return Date.now().toString()+(0,eC.randomString)(16)}class E_ extends xg.TypedEventEmitter{constructor(e){super(),(0,te.default)(this,"roomId",void 0),(0,te.default)(this,"callId",void 0),(0,te.default)(this,"state",de.Fledgling),(0,te.default)(this,"hangupParty",void 0),(0,te.default)(this,"hangupReason",void 0),(0,te.default)(this,"direction",void 0),(0,te.default)(this,"ourPartyId",void 0),(0,te.default)(this,"client",void 0),(0,te.default)(this,"forceTURN",void 0),(0,te.default)(this,"turnServers",void 0),(0,te.default)(this,"candidateSendQueue",[]),(0,te.default)(this,"candidateSendTries",0),(0,te.default)(this,"sentEndOfCandidates",!1),(0,te.default)(this,"peerConn",void 0),(0,te.default)(this,"feeds",[]),(0,te.default)(this,"usermediaSenders",[]),(0,te.default)(this,"screensharingSenders",[]),(0,te.default)(this,"inviteOrAnswerSent",!1),(0,te.default)(this,"waitForLocalAVStream",void 0),(0,te.default)(this,"successor",void 0),(0,te.default)(this,"opponentMember",void 0),(0,te.default)(this,"opponentVersion",void 0),(0,te.default)(this,"opponentPartyId",void 0),(0,te.default)(this,"opponentCaps",void 0),(0,te.default)(this,"inviteTimeout",void 0),(0,te.default)(this,"remoteOnHold",!1),(0,te.default)(this,"callStatsAtEnd",void 0),(0,te.default)(this,"makingOffer",!1),(0,te.default)(this,"ignoreOffer",void 0),(0,te.default)(this,"remoteCandidateBuffer",new Map),(0,te.default)(this,"remoteAssertedIdentity",void 0),(0,te.default)(this,"remoteSDPStreamMetadata",void 0),(0,te.default)(this,"callLengthInterval",void 0),(0,te.default)(this,"callLength",0),(0,te.default)(this,"gotLocalIceCandidate",t=>{if(t.candidate){if(K.logger.debug("Call "+this.callId+" got local ICE "+t.candidate.sdpMid+" candidate: "+t.candidate.candidate),this.callHasEnded())return;(t.candidate.candidate!==""||!this.sentEndOfCandidates)&&(this.queueCandidate(t.candidate),t.candidate.candidate===""&&(this.sentEndOfCandidates=!0))}}),(0,te.default)(this,"onIceGatheringStateChange",t=>{if(K.logger.debug("ice gathering state changed to "+this.peerConn.iceGatheringState),this.peerConn.iceGatheringState==="complete"&&!this.sentEndOfCandidates){const r={candidate:""};this.queueCandidate(r),this.sentEndOfCandidates=!0}}),(0,te.default)(this,"gotLocalOffer",async t=>{if(K.logger.debug("Created offer: ",t),this.callHasEnded()){K.logger.debug("Ignoring newly created offer on call ID "+this.callId+" because the call has ended");return}try{await this.peerConn.setLocalDescription(t)}catch(s){K.logger.debug("Error setting local description!",s),this.terminate(ze.Local,ge.SetLocalDescription,!0);return}if(this.peerConn.iceGatheringState==="gathering"&&await new Promise(s=>{setTimeout(s,200)}),this.callHasEnded())return;const r=this.state===de.CreateOffer?Mr.EventType.CallInvite:Mr.EventType.CallNegotiate,i={lifetime:Ug};this.state===de.CreateOffer?i.offer=this.peerConn.localDescription:i.description=this.peerConn.localDescription,i.capabilities={"m.call.transferee":this.client.supportsCallTransfer,"m.call.dtmf":!1},i[Ye.SDPStreamMetadataKey]=this.getLocalSDPStreamMetadata(),K.logger.info(`Discarding ${this.candidateSendQueue.length} candidates that will be sent in offer`),this.candidateSendQueue=[];try{await this.sendVoipEvent(r,i)}catch(s){K.logger.error("Failed to send invite",s),s.event&&this.client.cancelPendingEvent(s.event);let o=ge.SignallingFailed,a="Signalling failed";this.state===de.CreateOffer&&(o=ge.SendInvite,a="Failed to send invite"),s.name=="UnknownDeviceError"&&(o=ge.UnknownDevices,a="Unknown devices present in the room"),this.emit(Pe.Error,new ts(o,a,s)),this.terminate(ze.Local,o,!1);return}this.sendCandidateQueue(),this.state===de.CreateOffer&&(this.inviteOrAnswerSent=!0,this.setState(de.InviteSent),this.inviteTimeout=setTimeout(()=>{this.inviteTimeout=null,this.state===de.InviteSent&&this.hangup(ge.InviteTimeout,!1)},Ug))}),(0,te.default)(this,"getLocalOfferFailed",t=>{K.logger.error("Failed to get local offer",t),this.emit(Pe.Error,new ts(ge.LocalOfferFailed,"Failed to get local offer!",t)),this.terminate(ze.Local,ge.LocalOfferFailed,!1)}),(0,te.default)(this,"getUserMediaFailed",t=>{if(this.successor){this.successor.getUserMediaFailed(t);return}K.logger.warn("Failed to get user media - ending call",t),this.emit(Pe.Error,new ts(ge.NoUserMedia,"Couldn't start capturing media! Is your microphone set up and does this app have permission?",t)),this.terminate(ze.Local,ge.NoUserMedia,!1)}),(0,te.default)(this,"onIceConnectionStateChanged",()=>{this.callHasEnded()||(K.logger.debug("Call ID "+this.callId+": ICE connection state changed to: "+this.peerConn.iceConnectionState),this.peerConn.iceConnectionState=="connected"?(this.setState(de.Connected),this.callLengthInterval||(this.callLengthInterval=setInterval(()=>{this.callLength++,this.emit(Pe.LengthChanged,this.callLength)},1e3))):this.peerConn.iceConnectionState=="failed"&&this.hangup(ge.IceFailed,!1))}),(0,te.default)(this,"onSignallingStateChanged",()=>{K.logger.debug("call "+this.callId+": Signalling state changed to: "+this.peerConn.signalingState)}),(0,te.default)(this,"onTrack",t=>{if(t.streams.length===0){K.logger.warn(`Streamless ${t.track.kind} found: ignoring.`);return}const r=t.streams[0];this.pushRemoteFeed(r),r.addEventListener("removetrack",()=>{r.getTracks().length===0&&(K.logger.info(`Stream ID ${r.id} has no tracks remaining - removing`),this.deleteFeedByStream(r))})}),(0,te.default)(this,"onDataChannel",t=>{this.emit(Pe.DataChannel,t.channel)}),(0,te.default)(this,"onNegotiationNeeded",async()=>{if(K.logger.info("Negotiation is needed!"),this.state!==de.CreateOffer&&this.opponentVersion===0){K.logger.info("Opponent does not support renegotiation: ignoring negotiationneeded event");return}this.makingOffer=!0;try{this.getRidOfRTXCodecs();const t=await this.peerConn.createOffer();await this.gotLocalOffer(t)}catch(t){this.getLocalOfferFailed(t);return}finally{this.makingOffer=!1}}),(0,te.default)(this,"onHangupReceived",t=>{K.logger.debug("Hangup received for call ID "+this.callId),this.partyIdMatches(t)||this.state===de.Ringing?this.terminate(ze.Remote,t.reason||ge.UserHangup,!0):K.logger.info(`Ignoring message from party ID ${t.party_id}: our partner is ${this.opponentPartyId}`)}),(0,te.default)(this,"onRejectReceived",t=>{K.logger.debug("Reject received for call ID "+this.callId),[de.InviteSent,de.Ringing].includes(this.state)||this.state===de.Fledgling&&this.direction===Wn.Inbound?this.terminate(ze.Remote,t.reason||ge.UserHangup,!0):K.logger.debug(`Call is in state: ${this.state}: ignoring reject`)}),(0,te.default)(this,"onAnsweredElsewhere",t=>{K.logger.debug("Call ID "+this.callId+" answered elsewhere"),this.terminate(ze.Remote,ge.AnsweredElsewhere,!0)}),this.roomId=e.roomId,this.client=e.client,this.forceTURN=e.forceTURN,this.ourPartyId=this.client.deviceId,this.turnServers=e.turnServers||[],this.turnServers.length===0&&this.client.isFallbackICEServerAllowed()&&this.turnServers.push({urls:[nC]});for(const t of this.turnServers)dd.checkObjectHasKeys(t,["urls"]);this.callId=Gs()}async placeVoiceCall(){await this.placeCall(!0,!1)}async placeVideoCall(){await this.placeCall(!0,!0)}createDataChannel(e,t){const r=this.peerConn.createDataChannel(e,t);return this.emit(Pe.DataChannel,r),K.logger.debug("created data channel"),r}getOpponentMember(){return this.opponentMember}opponentCanBeTransferred(){return Boolean(this.opponentCaps&&this.opponentCaps["m.call.transferee"])}opponentSupportsDTMF(){return Boolean(this.opponentCaps&&this.opponentCaps["m.call.dtmf"])}getRemoteAssertedIdentity(){return this.remoteAssertedIdentity}get type(){return this.hasLocalUserMediaVideoTrack||this.hasRemoteUserMediaVideoTrack?Ya.Video:Ya.Voice}get hasLocalUserMediaVideoTrack(){var e;return((e=this.localUsermediaStream)===null||e===void 0?void 0:e.getVideoTracks().length)>0}get hasRemoteUserMediaVideoTrack(){return this.getRemoteFeeds().some(e=>e.purpose===Ye.SDPStreamMetadataPurpose.Usermedia&&e.stream.getVideoTracks().length>0)}get hasLocalUserMediaAudioTrack(){var e;return((e=this.localUsermediaStream)===null||e===void 0?void 0:e.getAudioTracks().length)>0}get hasRemoteUserMediaAudioTrack(){return this.getRemoteFeeds().some(e=>e.purpose===Ye.SDPStreamMetadataPurpose.Usermedia&&e.stream.getAudioTracks().length>0)}get localUsermediaFeed(){return this.getLocalFeeds().find(e=>e.purpose===Ye.SDPStreamMetadataPurpose.Usermedia)}get localScreensharingFeed(){return this.getLocalFeeds().find(e=>e.purpose===Ye.SDPStreamMetadataPurpose.Screenshare)}get localUsermediaStream(){var e;return(e=this.localUsermediaFeed)===null||e===void 0?void 0:e.stream}get localScreensharingStream(){var e;return(e=this.localScreensharingFeed)===null||e===void 0?void 0:e.stream}get remoteUsermediaFeed(){return this.getRemoteFeeds().find(e=>e.purpose===Ye.SDPStreamMetadataPurpose.Usermedia)}get remoteScreensharingFeed(){return this.getRemoteFeeds().find(e=>e.purpose===Ye.SDPStreamMetadataPurpose.Screenshare)}get remoteUsermediaStream(){var e;return(e=this.remoteUsermediaFeed)===null||e===void 0?void 0:e.stream}get remoteScreensharingStream(){var e;return(e=this.remoteScreensharingFeed)===null||e===void 0?void 0:e.stream}getFeedByStreamId(e){return this.getFeeds().find(t=>t.stream.id===e)}getFeeds(){return this.feeds}getLocalFeeds(){return this.feeds.filter(e=>e.isLocal())}getRemoteFeeds(){return this.feeds.filter(e=>!e.isLocal())}getLocalSDPStreamMetadata(){const e={};for(const t of this.getLocalFeeds())e[t.stream.id]={purpose:t.purpose,audio_muted:t.isAudioMuted(),video_muted:t.isVideoMuted()};return K.logger.debug("Got local SDPStreamMetadata",e),e}noIncomingFeeds(){return!this.feeds.some(e=>!e.isLocal())}pushRemoteFeed(e){if(!this.opponentSupportsSDPStreamMetadata()){this.pushRemoteFeedWithoutMetadata(e);return}const t=this.getOpponentMember().userId,r=this.remoteSDPStreamMetadata[e.id].purpose,i=this.remoteSDPStreamMetadata[e.id].audio_muted,s=this.remoteSDPStreamMetadata[e.id].video_muted;if(!r){K.logger.warn(`Ignoring stream with id ${e.id} because we didn't get any metadata about it`);return}const o=this.getRemoteFeeds().find(a=>a.purpose===r);o?o.setNewStream(e):(this.feeds.push(new na.CallFeed({client:this.client,roomId:this.roomId,userId:t,stream:e,purpose:r,audioMuted:i,videoMuted:s})),this.emit(Pe.FeedsChanged,this.feeds)),K.logger.info(`Pushed remote stream (id="${e.id}", active="${e.active}", purpose=${r})`)}pushRemoteFeedWithoutMetadata(e){var t;const r=this.getOpponentMember().userId,i=Ye.SDPStreamMetadataPurpose.Usermedia,s=(t=this.feeds.find(a=>!a.isLocal()))===null||t===void 0?void 0:t.stream;if(s&&e.id!==s.id){K.logger.warn(`Ignoring new stream ID ${e.id}: we already have stream ID ${s.id}`);return}const o=this.getFeedByStreamId(e.id);o?o.setNewStream(e):(this.feeds.push(new na.CallFeed({client:this.client,roomId:this.roomId,audioMuted:!1,videoMuted:!1,userId:r,stream:e,purpose:i})),this.emit(Pe.FeedsChanged,this.feeds)),K.logger.info(`Pushed remote stream (id="${e.id}", active="${e.active}")`)}pushNewLocalFeed(e,t,r=!0){const i=this.client.getUserId();Ri(e.getAudioTracks(),!0),Ri(e.getVideoTracks(),!0);const s=this.getLocalFeeds().find(o=>o.purpose===t);s?s.setNewStream(e):(this.pushLocalFeed(new na.CallFeed({client:this.client,roomId:this.roomId,audioMuted:!1,videoMuted:!1,userId:i,stream:e,purpose:t}),r),this.emit(Pe.FeedsChanged,this.feeds))}pushLocalFeed(e,t=!0){if(this.feeds.push(e),t){const r=e.purpose===Ye.SDPStreamMetadataPurpose.Usermedia?this.usermediaSenders:this.screensharingSenders;r.splice(0,r.length);for(const i of e.stream.getTracks())K.logger.info(`Adding track (id="${i.id}", kind="${i.kind}", streamId="${e.stream.id}", streamPurpose="${e.purpose}", enabled=${i.enabled}) to peer connection`),r.push(this.peerConn.addTrack(i,e.stream))}K.logger.info(`Pushed local stream (id="${e.stream.id}", active="${e.stream.active}", purpose="${e.purpose}")`),this.emit(Pe.FeedsChanged,this.feeds)}removeLocalFeed(e){const t=e.purpose===Ye.SDPStreamMetadataPurpose.Usermedia?this.usermediaSenders:this.screensharingSenders;for(const r of t)this.peerConn.removeTrack(r);t.splice(0,t.length),this.deleteFeedByStream(e.stream)}deleteAllFeeds(){for(const e of this.feeds)e.dispose();this.feeds=[],this.emit(Pe.FeedsChanged,this.feeds)}deleteFeedByStream(e){K.logger.debug(`Removing feed with stream id ${e.id}`);const t=this.getFeedByStreamId(e.id);if(!t){K.logger.warn(`Didn't find the feed with stream id ${e.id} to delete`);return}t.dispose(),this.feeds.splice(this.feeds.indexOf(t),1),this.emit(Pe.FeedsChanged,this.feeds)}async getCurrentCallStats(){return this.callHasEnded()?this.callStatsAtEnd:this.collectCallStats()}async collectCallStats(){if(!this.peerConn)return;const e=await this.peerConn.getStats(),t=[];for(const r of e)t.push(r[1]);return t}async initWithInvite(e){var t;const r=e.getContent();this.direction=Wn.Inbound,await this.client.checkTurnServers()||K.logger.warn("Failed to get TURN credentials! Proceeding with call anyway...");const s=r[Ye.SDPStreamMetadataKey];s?this.updateRemoteSDPStreamMetadata(s):K.logger.debug("Did not get any SDPStreamMetadata! Can not send/receive multiple streams"),this.peerConn=this.createPeerConnection(),this.chooseOpponent(e);try{await this.peerConn.setRemoteDescription(r.offer),await this.addBufferedIceCandidates()}catch(a){K.logger.debug("Failed to set remote description",a),this.terminate(ze.Local,ge.SetRemoteDescription,!1);return}const o=(t=this.feeds.find(a=>!a.isLocal()))===null||t===void 0?void 0:t.stream;if(!o||o.getTracks().length===0){K.logger.error("No remote stream or no tracks after setting remote description!"),this.terminate(ze.Local,ge.SetRemoteDescription,!1);return}this.setState(de.Ringing),e.getLocalAge()&&setTimeout(()=>{this.state==de.Ringing&&(K.logger.debug("Call invite has expired. Hanging up."),this.hangupParty=ze.Remote,this.setState(de.Ended),this.stopAllMedia(),this.peerConn.signalingState!="closed"&&this.peerConn.close(),this.emit(Pe.Hangup))},r.lifetime-e.getLocalAge())}initWithHangup(e){this.setState(de.Ended)}shouldAnswerWithMediaType(e,t,r){return e&&!t?(K.logger.warn(`Unable to answer with ${r} because the other side isn't sending it either.`),!1):!dd.isNullOrUndefined(e)&&e!==t&&!this.opponentSupportsSDPStreamMetadata()?(K.logger.warn(`Unable to answer with ${r}=${e} because the other side doesn't support it. Answering with ${r}=${t}.`),t):e!=null?e:t}async answer(e,t){if(!this.inviteOrAnswerSent){if(e===!1&&t===!1)throw new Error("You CANNOT answer a call without media");if(K.logger.debug(`Answering call ${this.callId}`),!this.localUsermediaStream&&!this.waitForLocalAVStream){const r=this.state,i=this.shouldAnswerWithMediaType(e,this.hasRemoteUserMediaAudioTrack,"audio"),s=this.shouldAnswerWithMediaType(t,this.hasRemoteUserMediaVideoTrack,"video");this.setState(de.WaitLocalMedia),this.waitForLocalAVStream=!0;try{const o=await this.client.getMediaHandler().getUserMediaStream(i,s);this.waitForLocalAVStream=!1;const l=[new na.CallFeed({client:this.client,roomId:this.roomId,userId:this.client.getUserId(),stream:o,purpose:Ye.SDPStreamMetadataPurpose.Usermedia,audioMuted:!1,videoMuted:!1})];this.localScreensharingFeed&&l.push(this.localScreensharingFeed),this.answerWithCallFeeds(l)}catch(o){if(s)K.logger.warn("Failed to getUserMedia(), trying to getUserMedia() without video"),this.setState(r),this.waitForLocalAVStream=!1,await this.answer(i,!1);else{this.getUserMediaFailed(o);return}}}else this.waitForLocalAVStream&&this.setState(de.WaitLocalMedia)}}answerWithCallFeeds(e){this.inviteOrAnswerSent||(K.logger.debug(`Answering call ${this.callId}`),this.gotCallFeedsForAnswer(e))}replacedBy(e){this.state===de.WaitLocalMedia?(K.logger.debug("Telling new call to wait for local media"),e.waitForLocalAVStream=!0):[de.CreateOffer,de.InviteSent].includes(this.state)&&(K.logger.debug("Handing local stream to new call"),e.gotCallFeedsForAnswer(this.getLocalFeeds())),this.successor=e,this.emit(Pe.Replaced,e),this.hangup(ge.Replaced,!0)}hangup(e,t){if(this.callHasEnded()||(K.logger.debug("Ending call "+this.callId),this.terminate(ze.Local,e,!t),this.state===de.WaitLocalMedia))return;const r={};(this.opponentVersion&&this.opponentVersion>=1||e!==ge.UserHangup)&&(r.reason=e),this.sendVoipEvent(Mr.EventType.CallHangup,r)}reject(){if(this.state!==de.Ringing)throw Error("Call must be in 'ringing' state to reject!");if(this.opponentVersion<1){K.logger.info(`Opponent version is less than 1 (${this.opponentVersion}): sending hangup instead of reject`),this.hangup(ge.UserHangup,!0);return}K.logger.debug("Rejecting call: "+this.callId),this.terminate(ze.Local,ge.UserHangup,!0),this.sendVoipEvent(Mr.EventType.CallReject,{})}async upgradeCall(e,t){if(!(!e&&!t)&&!!this.opponentSupportsSDPStreamMetadata())try{const r=e||this.hasLocalUserMediaAudioTrack,i=t||this.hasLocalUserMediaVideoTrack,s=await this.client.getMediaHandler().getUserMediaStream(r,i,!1);await this.updateLocalUsermediaStream(s,e,t)}catch(r){K.logger.error("Failed to upgrade the call",r),this.emit(Pe.Error,new ts(ge.NoUserMedia,"Failed to get camera access: ",r))}}opponentSupportsSDPStreamMetadata(){return Boolean(this.remoteSDPStreamMetadata)}isScreensharing(){return Boolean(this.localScreensharingStream)}async setScreensharingEnabled(e,t){if(e&&this.isScreensharing())return K.logger.warn("There is already a screensharing stream - there is nothing to do!"),!0;if(!e&&!this.isScreensharing())return K.logger.warn("There already isn't a screensharing stream - there is nothing to do!"),!1;if(!this.opponentSupportsSDPStreamMetadata())return await this.setScreensharingEnabledWithoutMetadataSupport(e,t);if(K.logger.debug(`Set screensharing enabled? ${e}`),e)try{const r=await this.client.getMediaHandler().getScreensharingStream(t);return r?(this.pushNewLocalFeed(r,Ye.SDPStreamMetadataPurpose.Screenshare),!0):!1}catch(r){return K.logger.error("Failed to get screen-sharing stream:",r),!1}else{for(const r of this.screensharingSenders)this.peerConn.removeTrack(r);return this.client.getMediaHandler().stopScreensharingStream(this.localScreensharingStream),this.deleteFeedByStream(this.localScreensharingStream),!1}}async setScreensharingEnabledWithoutMetadataSupport(e,t){if(K.logger.debug(`Set screensharing enabled? ${e} using replaceTrack()`),e)try{const r=await this.client.getMediaHandler().getScreensharingStream(t);if(!r)return!1;const i=r.getTracks().find(o=>o.kind==="video");return this.usermediaSenders.find(o=>{var a;return((a=o.track)===null||a===void 0?void 0:a.kind)==="video"}).replaceTrack(i),this.pushNewLocalFeed(r,Ye.SDPStreamMetadataPurpose.Screenshare,!1),!0}catch(r){return K.logger.error("Failed to get screen-sharing stream:",r),!1}else{const r=this.localUsermediaStream.getTracks().find(s=>s.kind==="video");return this.usermediaSenders.find(s=>{var o;return((o=s.track)===null||o===void 0?void 0:o.kind)==="video"}).replaceTrack(r),this.client.getMediaHandler().stopScreensharingStream(this.localScreensharingStream),this.deleteFeedByStream(this.localScreensharingStream),!1}}async updateLocalUsermediaStream(e,t=!1,r=!1){const i=this.localUsermediaFeed,s=t||!i.isAudioMuted()&&!this.remoteOnHold,o=r||!i.isVideoMuted()&&!this.remoteOnHold;Ri(e.getAudioTracks(),s),Ri(e.getVideoTracks(),o);for(const l of this.localUsermediaStream.getTracks())this.localUsermediaStream.removeTrack(l),l.stop();for(const l of e.getTracks())this.localUsermediaStream.addTrack(l);const a=[];for(const l of e.getTracks()){const u=this.usermediaSenders.find(g=>{var m;return((m=g.track)===null||m===void 0?void 0:m.kind)===l.kind});let c;u?(K.logger.info(`Replacing track (id="${l.id}", kind="${l.kind}", streamId="${e.id}", streamPurpose="${i.purpose}") to peer connection`),await u.replaceTrack(l),c=u):(K.logger.info(`Adding track (id="${l.id}", kind="${l.kind}", streamId="${e.id}", streamPurpose="${i.purpose}") to peer connection`),c=this.peerConn.addTrack(l,this.localUsermediaStream)),a.push(c)}this.usermediaSenders=a}async setLocalVideoMuted(e){var t;return await this.client.getMediaHandler().hasVideoDevice()?!this.hasLocalUserMediaVideoTrack&&!e?(await this.upgradeCall(!1,!0),this.isLocalVideoMuted()):((t=this.localUsermediaFeed)===null||t===void 0||t.setVideoMuted(e),this.updateMuteStatus(),this.isLocalVideoMuted()):this.isLocalVideoMuted()}isLocalVideoMuted(){var e;return(e=this.localUsermediaFeed)===null||e===void 0?void 0:e.isVideoMuted()}async setMicrophoneMuted(e){var t;return await this.client.getMediaHandler().hasAudioDevice()?!this.hasLocalUserMediaAudioTrack&&!e?(await this.upgradeCall(!0,!1),this.isMicrophoneMuted()):((t=this.localUsermediaFeed)===null||t===void 0||t.setAudioMuted(e),this.updateMuteStatus(),this.isMicrophoneMuted()):this.isMicrophoneMuted()}isMicrophoneMuted(){var e;return(e=this.localUsermediaFeed)===null||e===void 0?void 0:e.isAudioMuted()}isRemoteOnHold(){return this.remoteOnHold}setRemoteOnHold(e){if(this.isRemoteOnHold()!==e){this.remoteOnHold=e;for(const t of this.peerConn.getTransceivers())t.direction=e?"sendonly":"sendrecv";this.updateMuteStatus(),this.emit(Pe.RemoteHoldUnhold,this.remoteOnHold)}}isLocalOnHold(){if(this.state!==de.Connected)return!1;let e=!0;for(const t of this.peerConn.getTransceivers())["inactive","recvonly"].includes(t.currentDirection)||(e=!1);return e}sendDtmfDigit(e){for(const t of this.peerConn.getSenders())if(t.track.kind==="audio"&&t.dtmf){t.dtmf.insertDTMF(e);return}throw new Error("Unable to find a track to send DTMF on")}updateMuteStatus(){this.sendVoipEvent(Mr.EventType.CallSDPStreamMetadataChangedPrefix,{[Ye.SDPStreamMetadataKey]:this.getLocalSDPStreamMetadata()});const e=this.isMicrophoneMuted()||this.remoteOnHold,t=this.isLocalVideoMuted()||this.remoteOnHold;Ri(this.localUsermediaStream.getAudioTracks(),!e),Ri(this.localUsermediaStream.getVideoTracks(),!t)}gotCallFeedsForInvite(e){if(this.successor){this.successor.gotCallFeedsForAnswer(e);return}if(this.callHasEnded()){this.stopAllMedia();return}for(const t of e)this.pushLocalFeed(t);this.setState(de.CreateOffer),K.logger.debug("gotUserMediaForInvite")}async sendAnswer(){const e={answer:{sdp:this.peerConn.localDescription.sdp,type:this.peerConn.localDescription.type},[Ye.SDPStreamMetadataKey]:this.getLocalSDPStreamMetadata()};e.capabilities={"m.call.transferee":this.client.supportsCallTransfer,"m.call.dtmf":!1},K.logger.info(`Discarding ${this.candidateSendQueue.length} candidates that will be sent in answer`),this.candidateSendQueue=[];try{await this.sendVoipEvent(Mr.EventType.CallAnswer,e),this.inviteOrAnswerSent=!0}catch(t){this.setState(de.Ringing),this.client.cancelPendingEvent(t.event);let r=ge.SendAnswer,i="Failed to send answer";throw t.name=="UnknownDeviceError"&&(r=ge.UnknownDevices,i="Unknown devices present in the room"),this.emit(Pe.Error,new ts(r,i,t)),t}this.sendCandidateQueue()}async gotCallFeedsForAnswer(e){if(this.callHasEnded())return;this.waitForLocalAVStream=!1;for(const r of e)this.pushLocalFeed(r);this.setState(de.CreateAnswer);let t;try{this.getRidOfRTXCodecs(),t=await this.peerConn.createAnswer()}catch(r){K.logger.debug("Failed to create answer: ",r),this.terminate(ze.Local,ge.CreateAnswer,!0);return}try{await this.peerConn.setLocalDescription(t),this.setState(de.Connecting),await new Promise(r=>{setTimeout(r,200)}),this.sendAnswer()}catch(r){K.logger.debug("Error setting local description!",r),this.terminate(ze.Local,ge.SetLocalDescription,!0);return}}async onRemoteIceCandidatesReceived(e){if(this.callHasEnded())return;const t=e.getContent(),r=t.candidates;if(!r){K.logger.info("Ignoring candidates event with no candidates!");return}const i=t.version===0?null:t.party_id||null;if(this.opponentPartyId===void 0){K.logger.info(`Buffering ${r.length} candidates until we pick an opponent`);const s=this.remoteCandidateBuffer.get(i)||[];s.push(...r),this.remoteCandidateBuffer.set(i,s);return}if(!this.partyIdMatches(t)){K.logger.info(`Ignoring candidates from party ID ${t.party_id}: we have chosen party ID ${this.opponentPartyId}`);return}await this.addIceCandidates(r)}async onAnswerReceived(e){const t=e.getContent();if(K.logger.debug(`Got answer for call ID ${this.callId} from party ID ${t.party_id}`),this.callHasEnded()){K.logger.debug(`Ignoring answer because call ID ${this.callId} has ended`);return}if(this.opponentPartyId!==void 0){K.logger.info(`Ignoring answer from party ID ${t.party_id}: we already have an answer/reject from ${this.opponentPartyId}`);return}this.chooseOpponent(e),await this.addBufferedIceCandidates(),this.setState(de.Connecting);const r=t[Ye.SDPStreamMetadataKey];r?this.updateRemoteSDPStreamMetadata(r):K.logger.warn("Did not get any SDPStreamMetadata! Can not send/receive multiple streams");try{await this.peerConn.setRemoteDescription(t.answer)}catch(i){K.logger.debug("Failed to set remote description",i),this.terminate(ze.Local,ge.SetRemoteDescription,!1);return}if(this.opponentPartyId!==null)try{await this.sendVoipEvent(Mr.EventType.CallSelectAnswer,{selected_party_id:this.opponentPartyId})}catch(i){K.logger.warn("Failed to send select_answer event",i)}}async onSelectAnswerReceived(e){if(this.direction!==Wn.Inbound){K.logger.warn("Got select_answer for an outbound call: ignoring");return}const t=e.getContent().selected_party_id;if(t==null){K.logger.warn("Got nonsensical select_answer with null/undefined selected_party_id: ignoring");return}t!==this.ourPartyId&&(K.logger.info(`Got select_answer for party ID ${t}: we are party ID ${this.ourPartyId}.`),this.terminate(ze.Remote,ge.AnsweredElsewhere,!0))}async onNegotiateReceived(e){const t=e.getContent(),r=t.description;if(!r||!r.sdp||!r.type){K.logger.info("Ignoring invalid m.call.negotiate event");return}const i=this.direction===Wn.Inbound,s=r.type==="offer"&&(this.makingOffer||this.peerConn.signalingState!=="stable");if(this.ignoreOffer=!i&&s,this.ignoreOffer){K.logger.info("Ignoring colliding negotiate event because we're impolite");return}const o=this.isLocalOnHold(),a=t[Ye.SDPStreamMetadataKey];a?this.updateRemoteSDPStreamMetadata(a):K.logger.warn("Received negotiation event without SDPStreamMetadata!");try{if(await this.peerConn.setRemoteDescription(r),r.type==="offer"){this.getRidOfRTXCodecs();const u=await this.peerConn.createAnswer();await this.peerConn.setLocalDescription(u),this.sendVoipEvent(Mr.EventType.CallNegotiate,{description:this.peerConn.localDescription,[Ye.SDPStreamMetadataKey]:this.getLocalSDPStreamMetadata()})}}catch(u){K.logger.warn("Failed to complete negotiation",u)}const l=this.isLocalOnHold();o!==l&&(this.emit(Pe.LocalHoldUnhold,l),this.emit(Pe.HoldUnhold,l))}updateRemoteSDPStreamMetadata(e){this.remoteSDPStreamMetadata=dd.recursivelyAssign(this.remoteSDPStreamMetadata||{},e,!0);for(const s of this.getRemoteFeeds()){var t,r,i;const o=s.stream.id;s.setAudioMuted((t=this.remoteSDPStreamMetadata[o])===null||t===void 0?void 0:t.audio_muted),s.setVideoMuted((r=this.remoteSDPStreamMetadata[o])===null||r===void 0?void 0:r.video_muted),s.purpose=(i=this.remoteSDPStreamMetadata[o])===null||i===void 0?void 0:i.purpose}}onSDPStreamMetadataChangedReceived(e){const r=e.getContent()[Ye.SDPStreamMetadataKey];this.updateRemoteSDPStreamMetadata(r)}async onAssertedIdentityReceived(e){const t=e.getContent();!t.asserted_identity||(this.remoteAssertedIdentity={id:t.asserted_identity.id,displayName:t.asserted_identity.display_name},this.emit(Pe.AssertedIdentityChanged))}callHasEnded(){return this.state===de.Ended}getRidOfRTXCodecs(){if(!RTCRtpReceiver.getCapabilities||!RTCRtpSender.getCapabilities)return;const e=RTCRtpReceiver.getCapabilities("video").codecs,r=[...RTCRtpSender.getCapabilities("video").codecs,...e];for(const o of r)if(o.mimeType==="video/rtx"){const a=r.indexOf(o);r.splice(a,1)}for(const o of this.peerConn.getTransceivers()){var i,s;this.screensharingSenders.includes(o.sender)&&(((i=o.sender.track)===null||i===void 0?void 0:i.kind)==="video"||((s=o.receiver.track)===null||s===void 0?void 0:s.kind)==="video")&&o.setCodecPreferences(r)}}setState(e){const t=this.state;this.state=e,this.emit(Pe.State,e,t)}sendVoipEvent(e,t){return this.client.sendEvent(this.roomId,e,Object.assign({},t,{version:rC,call_id:this.callId,party_id:this.ourPartyId}))}queueCandidate(e){if(this.candidateSendQueue.push(e),this.state===de.Ringing||!this.inviteOrAnswerSent)return;const t=this.direction===Wn.Inbound?500:2e3;this.candidateSendTries===0&&setTimeout(()=>{this.sendCandidateQueue()},t)}async transfer(e){const t=await this.client.getProfileInfo(e),r=Gs(),i={replacement_id:Gs(),target_user:{id:e,display_name:t.displayname,avatar_url:t.avatar_url},create_call:r};await this.sendVoipEvent(Mr.EventType.CallReplaces,i),await this.terminate(ze.Local,ge.Transfered,!0)}async transferToCall(e){const t=await this.client.getProfileInfo(e.getOpponentMember().userId),r=await this.client.getProfileInfo(this.getOpponentMember().userId),i=Gs(),s={replacement_id:Gs(),target_user:{id:this.getOpponentMember().userId,display_name:r.displayname,avatar_url:r.avatar_url},await_call:i};await e.sendVoipEvent(Mr.EventType.CallReplaces,s);const o={replacement_id:Gs(),target_user:{id:e.getOpponentMember().userId,display_name:t.displayname,avatar_url:t.avatar_url},create_call:i};await this.sendVoipEvent(Mr.EventType.CallReplaces,o),await this.terminate(ze.Local,ge.Transfered,!0),await e.terminate(ze.Local,ge.Transfered,!0)}async terminate(e,t,r){this.callHasEnded()||(this.callStatsAtEnd=await this.collectCallStats(),this.inviteTimeout&&(clearTimeout(this.inviteTimeout),this.inviteTimeout=null),this.callLengthInterval&&(clearInterval(this.callLengthInterval),this.callLengthInterval=null),t!==ge.Replaced&&this.stopAllMedia(),this.deleteAllFeeds(),this.hangupParty=e,this.hangupReason=t,this.setState(de.Ended),this.peerConn&&this.peerConn.signalingState!=="closed"&&this.peerConn.close(),r&&this.emit(Pe.Hangup))}stopAllMedia(){K.logger.debug("Stopping all media for call",this.callId);for(const e of this.feeds)if(e.isLocal()&&e.purpose===Ye.SDPStreamMetadataPurpose.Usermedia)this.client.getMediaHandler().stopUserMediaStream(e.stream);else if(e.isLocal()&&e.purpose===Ye.SDPStreamMetadataPurpose.Screenshare)this.client.getMediaHandler().stopScreensharingStream(e.stream);else{K.logger.debug("Stopping remote stream",e.stream.id);for(const t of e.stream.getTracks())t.stop()}}checkForErrorListener(){if(this.listeners(xg.EventEmitterEvents.Error).length===0)throw new Error("You MUST attach an error listener using call.on('error', function() {})")}async sendCandidateQueue(){if(this.candidateSendQueue.length===0)return;const e=this.candidateSendQueue;this.candidateSendQueue=[],++this.candidateSendTries;const t={candidates:e};K.logger.debug("Attempting to send "+e.length+" candidates");try{await this.sendVoipEvent(Mr.EventType.CallCandidates,t),this.candidateSendTries=0}catch(r){if(r.event&&this.client.cancelPendingEvent(r.event),this.candidateSendQueue.push(...e),this.candidateSendTries>5){K.logger.debug("Failed to send candidates on attempt "+this.candidateSendTries+". Giving up on this call.",r);const s=ge.SignallingFailed,o="Signalling failed";this.emit(Pe.Error,new ts(s,o,r)),this.hangup(s,!1);return}const i=500*Math.pow(2,this.candidateSendTries);++this.candidateSendTries,K.logger.debug("Failed to send candidates. Retrying in "+i+"ms",r),setTimeout(()=>{this.sendCandidateQueue()},i)}}async placeCall(e,t){if(!e)throw new Error("You CANNOT start a call without audio");this.setState(de.WaitLocalMedia);try{const r=await this.client.getMediaHandler().getUserMediaStream(e,t);Ri(r.getAudioTracks(),!0),Ri(r.getVideoTracks(),!0);const i=new na.CallFeed({client:this.client,roomId:this.roomId,userId:this.client.getUserId(),stream:r,purpose:Ye.SDPStreamMetadataPurpose.Usermedia,audioMuted:!1,videoMuted:!1});await this.placeCallWithCallFeeds([i])}catch(r){this.getUserMediaFailed(r);return}}async placeCallWithCallFeeds(e){this.checkForErrorListener(),this.direction=Wn.Outbound,this.client.callEventHandler.calls.set(this.callId,this),await this.client.checkTurnServers()||K.logger.warn("Failed to get TURN credentials! Proceeding with call anyway..."),this.peerConn=this.createPeerConnection(),this.gotCallFeedsForInvite(e)}createPeerConnection(){const e=new window.RTCPeerConnection({iceTransportPolicy:this.forceTURN?"relay":void 0,iceServers:this.turnServers,iceCandidatePoolSize:this.client.iceCandidatePoolSize});return e.addEventListener("iceconnectionstatechange",this.onIceConnectionStateChanged),e.addEventListener("signalingstatechange",this.onSignallingStateChanged),e.addEventListener("icecandidate",this.gotLocalIceCandidate),e.addEventListener("icegatheringstatechange",this.onIceGatheringStateChange),e.addEventListener("track",this.onTrack),e.addEventListener("negotiationneeded",this.onNegotiationNeeded),e.addEventListener("datachannel",this.onDataChannel),e}partyIdMatches(e){return(e.version===0?null:e.party_id||null)===this.opponentPartyId}chooseOpponent(e){const t=e.getContent();K.logger.debug(`Choosing party ID ${t.party_id} for call ID ${this.callId}`),this.opponentVersion=t.version,this.opponentVersion===0?this.opponentPartyId=null:this.opponentPartyId=t.party_id||null,this.opponentCaps=t.capabilities||{},this.opponentMember=e.sender}async addBufferedIceCandidates(){const e=this.remoteCandidateBuffer.get(this.opponentPartyId);e&&(K.logger.info(`Adding ${e.length} buffered candidates for opponent ${this.opponentPartyId}`),await this.addIceCandidates(e)),this.remoteCandidateBuffer=null}async addIceCandidates(e){for(const t of e){if((t.sdpMid===null||t.sdpMid===void 0)&&(t.sdpMLineIndex===null||t.sdpMLineIndex===void 0)){K.logger.debug("Ignoring remote ICE candidate with no sdpMid or sdpMLineIndex");continue}K.logger.debug("Call "+this.callId+" got remote ICE "+t.sdpMid+" candidate: "+t.candidate);try{await this.peerConn.addIceCandidate(t)}catch(r){this.ignoreOffer||K.logger.info("Failed to add remote ICE candidate",r)}}}get hasPeerConnection(){return Boolean(this.peerConn)}}Oe.MatrixCall=E_;function Ri(n,e){for(let t=0;t<n.length;t++)n[t].enabled=e}function iC(n,e,t){if(typeof window=="undefined"||typeof document=="undefined")return null;try{if(!Boolean(window.RTCPeerConnection||window.RTCSessionDescription||window.RTCIceCandidate||navigator.mediaDevices))return K.logger.error("WebRTC is not supported in this browser / environment"),null}catch(o){return K.logger.error("Exception thrown when trying to access WebRTC",o),null}const r=t?t.forceTURN:!1,i={client:n,roomId:e,turnServers:n.getTurnServers(),forceTURN:n.forceTURN||r},s=new E_(i);return n.reEmitter.reEmit(s,Object.values(Pe)),s}var Es={},sC=G.exports;Object.defineProperty(Es,"__esModule",{value:!0});Es.CallEventHandlerEvent=Es.CallEventHandler=void 0;var Ws=sC(Y.exports),oC=Ht,Ii=ie,vr=Oe,Bt=ne,$g=ot,aC=Bi,Ng=hr;const cC=3e3;let Ul;Es.CallEventHandlerEvent=Ul;(function(n){n.Incoming="Call.incoming"})(Ul||(Es.CallEventHandlerEvent=Ul={}));class lC{constructor(e){(0,Ws.default)(this,"client",void 0),(0,Ws.default)(this,"calls",void 0),(0,Ws.default)(this,"callEventBuffer",void 0),(0,Ws.default)(this,"candidateEventsByCall",void 0),(0,Ws.default)(this,"evaluateEventBuffer",async()=>{if(this.client.getSyncState()===aC.SyncState.Syncing){await Promise.all(this.callEventBuffer.map(r=>{this.client.decryptEventIfNeeded(r)}));const t=new Set;for(const r of this.callEventBuffer)(r.getType()===Bt.EventType.CallAnswer||r.getType()===Bt.EventType.CallHangup)&&t.add(r.getContent().call_id);for(const r of this.callEventBuffer)if(!(r.getType()===Bt.EventType.CallInvite&&t.has(r.getContent().call_id)))try{await this.handleCallEvent(r)}catch(i){Ii.logger.error("Caught exception handling call event",i)}this.callEventBuffer=[]}}),(0,Ws.default)(this,"onRoomTimeline",t=>{this.client.decryptEventIfNeeded(t),(this.eventIsACall(t)||t.isBeingDecrypted())&&this.callEventBuffer.push(t),(t.isBeingDecrypted()||t.isDecryptionFailure())&&t.once(oC.MatrixEventEvent.Decrypted,async()=>{if(!!this.eventIsACall(t))if(this.callEventBuffer.includes(t))this.evaluateEventBuffer();else try{await this.handleCallEvent(t)}catch(r){Ii.logger.error("Caught exception handling call event",r)}})}),this.client=e,this.calls=new Map,this.callEventBuffer=[],this.candidateEventsByCall=new Map}start(){this.client.on($g.ClientEvent.Sync,this.evaluateEventBuffer),this.client.on(Ng.RoomEvent.Timeline,this.onRoomTimeline)}stop(){this.client.removeListener($g.ClientEvent.Sync,this.evaluateEventBuffer),this.client.removeListener(Ng.RoomEvent.Timeline,this.onRoomTimeline)}eventIsACall(e){const t=e.getType();return t.startsWith("m.call.")||t.startsWith("org.matrix.call.")}async handleCallEvent(e){const t=e.getContent(),r=e.getType(),i=e.getSender()===this.client.credentials.userId;let s=t.call_id?this.calls.get(t.call_id):void 0;if(r===Bt.EventType.CallInvite){if(i||e.getLocalAge()>t.lifetime-cC||s&&s.state===vr.CallState.Ended)return;s&&Ii.logger.log(`WARN: Already have a MatrixCall with id ${t.call_id} but got an invite. Clobbering.`);const o=this.client.getTurnServersExpiry()-Date.now();if(Ii.logger.info("Current turn creds expire in "+o+" ms"),s=(0,vr.createNewMatrixCall)(this.client,e.getRoomId(),{forceTURN:this.client.forceTURN}),!s){Ii.logger.log("Incoming call ID "+t.call_id+" but this client doesn't support WebRTC");return}if(s.callId=t.call_id,await s.initWithInvite(e),this.calls.set(s.callId,s),this.candidateEventsByCall.get(s.callId))for(const l of this.candidateEventsByCall.get(s.callId))s.onRemoteIceCandidatesReceived(l);let a;for(const l of this.calls.values()){const u=[vr.CallState.WaitLocalMedia,vr.CallState.CreateOffer,vr.CallState.InviteSent].includes(l.state);if(s.roomId===l.roomId&&l.direction===vr.CallDirection.Outbound&&u){a=l;break}}a?a.state===vr.CallState.WaitLocalMedia||a.state===vr.CallState.CreateOffer||a.callId>s.callId?(Ii.logger.log("Glare detected: answering incoming call "+s.callId+" and canceling outgoing call "+a.callId),a.replacedBy(s),s.answer()):(Ii.logger.log("Glare detected: rejecting incoming call "+s.callId+" and keeping outgoing call "+a.callId),s.hangup(vr.CallErrorCode.Replaced,!0)):this.client.emit(Ul.Incoming,s);return}else if(r===Bt.EventType.CallCandidates){if(i)return;s?s.onRemoteIceCandidatesReceived(e):(this.candidateEventsByCall.has(t.call_id)||this.candidateEventsByCall.set(t.call_id,[]),this.candidateEventsByCall.get(t.call_id).push(e));return}else if([Bt.EventType.CallHangup,Bt.EventType.CallReject].includes(r)){s?s.state!==vr.CallState.Ended&&(r===Bt.EventType.CallHangup?s.onHangupReceived(t):s.onRejectReceived(t),s.state===vr.CallState.Ended&&this.calls.delete(t.call_id)):(s=(0,vr.createNewMatrixCall)(this.client,e.getRoomId()),s&&(s.callId=t.call_id,s.initWithHangup(e),this.calls.set(t.call_id,s)));return}if(!s||!s.hasPeerConnection){Ii.logger.warn("Discarding an event, we don't have a call/peerConn",r);return}if(e.getContent().party_id!==s.ourPartyId)switch(r){case Bt.EventType.CallAnswer:i?s.state===vr.CallState.Ringing&&s.onAnsweredElsewhere(t):s.onAnswerReceived(e);break;case Bt.EventType.CallSelectAnswer:s.onSelectAnswerReceived(e);break;case Bt.EventType.CallNegotiate:s.onNegotiateReceived(e);break;case Bt.EventType.CallAssertedIdentity:case Bt.EventType.CallAssertedIdentityPrefix:s.onAssertedIdentityReceived(e);break;case Bt.EventType.CallSDPStreamMetadataChanged:case Bt.EventType.CallSDPStreamMetadataChangedPrefix:s.onSDPStreamMetadataChangedReceived(e);break}}}Es.CallEventHandler=lC;var Ki={},uC=G.exports;Object.defineProperty(Ki,"__esModule",{value:!0});Ki.AutoDiscoveryAction=Ki.AutoDiscovery=void 0;var fr=uC(Y.exports),Lg=Mi,Un=ie;let ur;Ki.AutoDiscoveryAction=ur;(function(n){n.SUCCESS="SUCCESS",n.IGNORE="IGNORE",n.PROMPT="PROMPT",n.FAIL_PROMPT="FAIL_PROMPT",n.FAIL_ERROR="FAIL_ERROR"})(ur||(Ki.AutoDiscoveryAction=ur={}));class Q{static async fromDiscoveryConfig(e){const t={"m.homeserver":{state:Q.FAIL_ERROR,error:Q.ERROR_INVALID,base_url:null},"m.identity_server":{state:Q.PROMPT,error:null,base_url:null}};if(!e||!e["m.homeserver"])return Un.logger.error("No m.homeserver key in config"),t["m.homeserver"].state=Q.FAIL_PROMPT,t["m.homeserver"].error=Q.ERROR_INVALID,Promise.resolve(t);if(!e["m.homeserver"].base_url)return Un.logger.error("No m.homeserver base_url in config"),t["m.homeserver"].state=Q.FAIL_PROMPT,t["m.homeserver"].error=Q.ERROR_INVALID_HS_BASE_URL,Promise.resolve(t);const r=this.sanitizeWellKnownUrl(e["m.homeserver"].base_url);if(!r)return Un.logger.error("Invalid base_url for m.homeserver"),t["m.homeserver"].error=Q.ERROR_INVALID_HS_BASE_URL,Promise.resolve(t);const i=await this.fetchWellKnownObject(`${r}/_matrix/client/versions`);if(!i||!i.raw.versions)return Un.logger.error("Invalid /versions response"),t["m.homeserver"].error=Q.ERROR_INVALID_HOMESERVER,t["m.homeserver"].base_url=r,Promise.resolve(t);t["m.homeserver"]={state:Q.SUCCESS,error:null,base_url:r};let s="";if(e["m.identity_server"]){const o={"m.homeserver":t["m.homeserver"],"m.identity_server":{state:Q.FAIL_PROMPT,error:Q.ERROR_INVALID_IS,base_url:null}};if(s=this.sanitizeWellKnownUrl(e["m.identity_server"].base_url),!s)return Un.logger.error("Invalid base_url for m.identity_server"),o["m.identity_server"].error=Q.ERROR_INVALID_IS_BASE_URL,Promise.resolve(o);const a=await this.fetchWellKnownObject(`${s}/_matrix/identity/api/v1`);if(!a||!a.raw||a.action!==ur.SUCCESS)return Un.logger.error("Invalid /api/v1 response"),o["m.identity_server"].error=Q.ERROR_INVALID_IDENTITY_SERVER,o["m.identity_server"].base_url=s,Promise.resolve(o)}return s&&s.toString().length>0&&(t["m.identity_server"]={state:Q.SUCCESS,error:null,base_url:s}),Object.keys(e).map(o=>{if(o==="m.homeserver"||o==="m.identity_server"){const a=["error","state","base_url"];for(const l of Object.keys(e[o]))a.includes(l)||(t[o][l]=e[o][l])}else t[o]=e[o]}),Promise.resolve(t)}static async findClientConfig(e){if(!e||typeof e!="string"||e.length===0)throw new Error("'domain' must be a string of non-zero length");const t={"m.homeserver":{state:Q.FAIL_ERROR,error:Q.ERROR_INVALID,base_url:null},"m.identity_server":{state:Q.PROMPT,error:null,base_url:null}},r=await this.fetchWellKnownObject(`https://${e}/.well-known/matrix/client`);return!r||r.action!==ur.SUCCESS?(Un.logger.error("No response or error when parsing .well-known"),r.reason&&Un.logger.error(r.reason),r.action===ur.IGNORE?t["m.homeserver"]={state:Q.PROMPT,error:null,base_url:null}:(t["m.homeserver"].state=Q.FAIL_PROMPT,t["m.homeserver"].error=Q.ERROR_INVALID),Promise.resolve(t)):Q.fromDiscoveryConfig(r.raw)}static async getRawClientConfig(e){if(!e||typeof e!="string"||e.length===0)throw new Error("'domain' must be a string of non-zero length");const t=await this.fetchWellKnownObject(`https://${e}/.well-known/matrix/client`);return t?t.raw||{}:{}}static sanitizeWellKnownUrl(e){if(!e)return!1;try{let t=null;try{Lg.URL?t=new Lg.URL(e):t=new URL(e)}catch{t=new URL(e)}if(!t||!t.hostname||t.protocol!=="http:"&&t.protocol!=="https:")return!1;const r=t.port?`:${t.port}`:"",i=t.pathname?t.pathname:"";let s=`${t.protocol}//${t.hostname}${r}${i}`;return s.endsWith("/")&&(s=s.substring(0,s.length-1)),s}catch(t){return Un.logger.error(t),!1}}static async fetchWellKnownObject(e){return new Promise(function(t,r){const i=Ps.getRequest();if(!i)throw new Error("No request library available");i({method:"GET",uri:e,timeout:5e3},(s,o,a)=>{if(s||o&&(o.statusCode<200||o.statusCode>=300)){let l=ur.FAIL_PROMPT,u=(s?s.message:null)||"General failure";o&&o.statusCode===404&&(l=ur.IGNORE,u=Q.ERROR_MISSING_WELLKNOWN),t({raw:{},action:l,reason:u,error:s});return}try{t({raw:JSON.parse(a),action:ur.SUCCESS})}catch(l){let u=Q.ERROR_INVALID;l.name==="SyntaxError"&&(u=Q.ERROR_INVALID_JSON),t({raw:{},action:ur.FAIL_PROMPT,reason:u,error:l})}})})}}Ki.AutoDiscovery=Q;(0,fr.default)(Q,"ERROR_INVALID","Invalid homeserver discovery response");(0,fr.default)(Q,"ERROR_GENERIC_FAILURE","Failed to get autodiscovery configuration from server");(0,fr.default)(Q,"ERROR_INVALID_HS_BASE_URL","Invalid base_url for m.homeserver");(0,fr.default)(Q,"ERROR_INVALID_HOMESERVER","Homeserver URL does not appear to be a valid Matrix homeserver");(0,fr.default)(Q,"ERROR_INVALID_IS_BASE_URL","Invalid base_url for m.identity_server");(0,fr.default)(Q,"ERROR_INVALID_IDENTITY_SERVER","Identity server URL does not appear to be a valid identity server");(0,fr.default)(Q,"ERROR_INVALID_IS","Invalid identity server discovery response");(0,fr.default)(Q,"ERROR_MISSING_WELLKNOWN","No .well-known JSON file found");(0,fr.default)(Q,"ERROR_INVALID_JSON","Invalid JSON");(0,fr.default)(Q,"ALL_ERRORS",[Q.ERROR_INVALID,Q.ERROR_GENERIC_FAILURE,Q.ERROR_INVALID_HS_BASE_URL,Q.ERROR_INVALID_HOMESERVER,Q.ERROR_INVALID_IS_BASE_URL,Q.ERROR_INVALID_IDENTITY_SERVER,Q.ERROR_INVALID_IS,Q.ERROR_MISSING_WELLKNOWN,Q.ERROR_INVALID_JSON]);(0,fr.default)(Q,"FAIL_ERROR",ur.FAIL_ERROR);(0,fr.default)(Q,"FAIL_PROMPT",ur.FAIL_PROMPT);(0,fr.default)(Q,"PROMPT",ur.PROMPT);(0,fr.default)(Q,"SUCCESS",ur.SUCCESS);var De={},Bg=/[\\\"\x00-\x1F]/g,ui={};for(var xc=0;xc<32;++xc)ui[String.fromCharCode(xc)]="\\U"+("0000"+xc.toString(16)).slice(-4).toUpperCase();ui["\b"]="\\b";ui[" "]="\\t";ui[`
+`]="\\n";ui["\f"]="\\f";ui["\r"]="\\r";ui['"']='\\"';ui["\\"]="\\\\";function S_(n){return Bg.lastIndex=0,n.replace(Bg,function(e){return ui[e]})}function Mf(n){switch(typeof n){case"string":return'"'+S_(n)+'"';case"number":return isFinite(n)?n:"null";case"boolean":return n;case"object":return n===null?"null":Array.isArray(n)?dC(n):hC(n);default:throw new Error("Cannot stringify: "+typeof n)}}function dC(n){for(var e="[",t="",r=0;r<n.length;++r)t+=e,e=",",t+=Mf(n[r]);return e!=","?"[]":t+"]"}function hC(n){var e="{",t="",r=Object.keys(n);r.sort();for(var i=0;i<r.length;++i){var s=r[i];t+=e+'"'+S_(s)+'":',e=",",t+=Mf(n[s])}return e!=","?"{}":t+"}"}var cu={stringify:Mf},fC=G.exports;Object.defineProperty(De,"__esModule",{value:!0});De.OLM_ALGORITHM=De.MEGOLM_BACKUP_ALGORITHM=mC=De.MEGOLM_ALGORITHM=void 0;De.decodeBase64=IC;De.encodeBase64=w_;De.encodeUnpaddedBase64=RC;De.encryptMessageForDevice=vC;De.ensureOlmSessionsForDevices=EC;De.getExistingOlmSessions=_C;De.pkSign=bC;De.pkVerify=wC;De.verifySignature=b_;var Df=fC(cu),xa=ie,za;(function(n){n.Olm="m.olm.v1.curve25519-aes-sha2",n.Megolm="m.megolm.v1.aes-sha2",n.MegolmBackup="m.megolm_backup.v1.curve25519-aes-sha2"})(za||(za={}));const pC=za.Olm;De.OLM_ALGORITHM=pC;const gC=za.Megolm;var mC=De.MEGOLM_ALGORITHM=gC;const yC=za.MegolmBackup;De.MEGOLM_BACKUP_ALGORITHM=yC;async function vC(n,e,t,r,i,s,o){const a=s.getIdentityKey(),l=await r.getSessionIdForDevice(a);if(l===null)return;xa.logger.log("Using sessionid "+l+" for device "+i+":"+s.deviceId);const u={sender:e,sender_device:t,keys:{ed25519:r.deviceEd25519Key},recipient:i,recipient_keys:{ed25519:s.getFingerprint()}};Object.assign(u,o),n[a]=await r.encryptMessage(a,l,JSON.stringify(u))}async function _C(n,e,t){const r={},i={},s=[];for(const[o,a]of Object.entries(t))for(const l of a){const u=l.deviceId,c=l.getIdentityKey();s.push((async()=>{const g=await n.getSessionIdForDevice(c,!0);g===null?(r[o]=r[o]||[],r[o].push(l)):(i[o]=i[o]||{},i[o][u]={device:l,sessionId:g})})())}return await Promise.all(s),[r,i]}async function EC(n,e,t,r=!1,i,s,o=xa.logger){typeof r=="number"&&(o=s,s=i,i=r,r=!1);const a=[],l={},u={};for(const[,I]of Object.entries(t))for(const R of I){const T=R.getIdentityKey();T!==n.deviceCurve25519Key&&(n.sessionsInProgress[T]||(n.sessionsInProgress[T]=new Promise(C=>{u[T]=S=>{delete n.sessionsInProgress[T],C(S)}})))}for(const[I,R]of Object.entries(t)){l[I]={};for(const T of R){const C=T.deviceId,S=T.getIdentityKey();if(S===n.deviceCurve25519Key){o.info("Attempted to start session with ourself! Ignoring"),l[I][C]={device:T,sessionId:null};continue}const k=`for ${S} (${I}:${C})`,A=await n.getSessionIdForDevice(S,!!u[S],o);A!==null&&u[S]&&u[S](),(A===null||r)&&(r?o.info(`Forcing new Olm session ${k}`):o.info(`Making new Olm session ${k}`),a.push([I,C])),l[I][C]={device:T,sessionId:A}}}if(a.length===0)return l;const c="signed_curve25519";let g,m=`one-time keys for ${a.length} devices`;try{o.debug(`Claiming ${m}`),g=await e.claimOneTimeKeys(a,c,i),o.debug(`Claimed ${m}`)}catch(I){for(const R of Object.values(u))R();throw o.log(`Failed to claim ${m}`,I,a),I}s&&"failures"in g&&s.push(...Object.keys(g.failures));const f=g.one_time_keys||{},_=[];for(const[I,R]of Object.entries(t)){const T=f[I]||{};for(let C=0;C<R.length;C++){const S=R[C],k=S.deviceId,A=S.getIdentityKey();if(A===n.deviceCurve25519Key||l[I][k].sessionId&&!r)continue;const w=T[k]||{};let L=null;for(const q in w)q.indexOf(c+":")===0&&(L=w[q]);if(!L){o.warn(`No one-time keys (alg=${c}) for device ${I}:${k}`),u[A]&&u[A]();continue}_.push(SC(n,L,I,S).then(q=>{u[A]&&u[A](q),l[I][k].sessionId=q},q=>{throw u[A]&&u[A](),q}))}}return m=`Olm sessions for ${_.length} devices`,o.debug(`Starting ${m}`),await Promise.all(_),o.debug(`Started ${m}`),l}async function SC(n,e,t,r){const i=r.deviceId;try{await b_(n,e,t,i,r.getFingerprint())}catch(o){return xa.logger.error("Unable to verify signature on one-time key for device "+t+":"+i+":",o),null}let s;try{s=await n.createOutboundSession(r.getIdentityKey(),e.key)}catch(o){return xa.logger.error("Error starting olm session with device "+t+":"+i+": "+o),null}return xa.logger.log("Started new olm sessionid "+s+" for device "+t+":"+i),s}async function b_(n,e,t,r,i){const s="ed25519:"+r,l=((e.signatures||{})[t]||{})[s];if(!l)throw Error("No signature");const u=Object.assign({},e);"unsigned"in u&&delete u.unsigned,delete u.signatures;const c=Df.default.stringify(u);n.verifySignature(i,c,l)}function bC(n,e,t,r){let i=!1;if(e instanceof Uint8Array){const a=new V.Olm.PkSigning;r=a.init_with_seed(e),e=a,i=!0}const s=n.signatures||{};delete n.signatures;const o=n.unsigned;n.unsigned&&delete n.unsigned;try{const a=s[t]||{};return s[t]=a,a["ed25519:"+r]=e.sign(Df.default.stringify(n))}finally{n.signatures=s,o&&(n.unsigned=o),i&&e.free()}}function wC(n,e,t){const r="ed25519:"+e;if(!(n.signatures&&n.signatures[t]&&n.signatures[t][r]))throw new Error("No signature");const i=n.signatures[t][r],s=new V.Olm.Utility,o=n.signatures;delete n.signatures;const a=n.unsigned;n.unsigned&&delete n.unsigned;try{s.ed25519_verify(e,Df.default.stringify(n),i)}finally{n.signatures=o,a&&(n.unsigned=a),s.free()}}function w_(n){return Buffer.from(n).toString("base64")}function RC(n){return w_(n).replace(/=+$/g,"")}function IC(n){return Buffer.from(n,"base64")}var lu={},qr={},uu={};Object.defineProperty(uu,"__esModule",{value:!0});uu.LocalStorageCryptoStore=void 0;var Kg=ie,TC=$o;const Rr="crypto.",hd=Rr+"account",Fg=Rr+"cross_signing_keys",qg=Rr+"notified_error_devices",jg=Rr+"device_data",dl=Rr+"inboundgroupsessions/",OC=Rr+"inboundgroupsessions.withheld/",kC=Rr+"rooms/",Hs=Rr+"sessionsneedingbackup";function Uc(n){return Rr+"sessions/"+n}function Vg(n){return Rr+"session.problems/"+n}function fd(n,e){return dl+n+"/"+e}function Gg(n,e){return OC+n+"/"+e}function Wg(n){return kC+n}class CC extends TC.MemoryCryptoStore{static exists(e){const t=e.length;for(let r=0;r<t;r++)if(e.key(r).startsWith(Rr))return!0;return!1}constructor(e){super(),this.store=e}countEndToEndSessions(e,t){let r=0;for(let i=0;i<this.store.length;++i)this.store.key(i).startsWith(Uc(""))&&++r;t(r)}_getEndToEndSessions(e){const t=vt(this.store,Uc(e)),r={};for(const[i,s]of Object.entries(t||{}))typeof s=="string"?r[i]={session:s}:r[i]=s;return r}getEndToEndSession(e,t,r,i){const s=this._getEndToEndSessions(e);i(s[t]||{})}getEndToEndSessions(e,t,r){r(this._getEndToEndSessions(e)||{})}getAllEndToEndSessions(e,t){for(let r=0;r<this.store.length;++r)if(this.store.key(r).startsWith(Uc(""))){const i=this.store.key(r).split("/")[1];for(const s of Object.values(this._getEndToEndSessions(i)))t(s)}}storeEndToEndSession(e,t,r,i){const s=this._getEndToEndSessions(e)||{};s[t]=r,Dr(this.store,Uc(e),s)}async storeEndToEndSessionProblem(e,t,r){const i=Vg(e),s=vt(this.store,i)||[];s.push({type:t,fixed:r,time:Date.now()}),s.sort((o,a)=>o.time-a.time),Dr(this.store,i,s)}async getEndToEndSessionProblem(e,t){const r=Vg(e),i=vt(this.store,r)||[];if(!i.length)return null;const s=i[i.length-1];for(const o of i)if(o.time>t)return Object.assign({},o,{fixed:s.fixed});return s.fixed?null:s}async filterOutNotifiedErrorDevices(e){const t=vt(this.store,qg)||{},r=[];for(const i of e){const{userId:s,deviceInfo:o}=i;s in t?o.deviceId in t[s]||(r.push(i),t[s][o.deviceId]=!0):(r.push(i),t[s]={[o.deviceId]:!0})}return Dr(this.store,qg,t),r}getEndToEndInboundGroupSession(e,t,r,i){i(vt(this.store,fd(e,t)),vt(this.store,Gg(e,t)))}getAllEndToEndInboundGroupSessions(e,t){for(let r=0;r<this.store.length;++r){const i=this.store.key(r);i.startsWith(dl)&&t({senderKey:i.substr(dl.length,43),sessionId:i.substr(dl.length+44),sessionData:vt(this.store,i)})}t(null)}addEndToEndInboundGroupSession(e,t,r,i){vt(this.store,fd(e,t))||this.storeEndToEndInboundGroupSession(e,t,r,i)}storeEndToEndInboundGroupSession(e,t,r,i){Dr(this.store,fd(e,t),r)}storeEndToEndInboundGroupSessionWithheld(e,t,r,i){Dr(this.store,Gg(e,t),r)}getEndToEndDeviceData(e,t){t(vt(this.store,jg))}storeEndToEndDeviceData(e,t){Dr(this.store,jg,e)}storeEndToEndRoom(e,t,r){Dr(this.store,Wg(e),t)}getEndToEndRooms(e,t){const r={},i=Wg("");for(let s=0;s<this.store.length;++s){const o=this.store.key(s);if(o.startsWith(i)){const a=o.substr(i.length);r[a]=vt(this.store,o)}}t(r)}getSessionsNeedingBackup(e){const t=vt(this.store,Hs)||{},r=[];for(const i in t)if(Object.prototype.hasOwnProperty.call(t,i)){const s=i.substr(0,43),o=i.substr(44);if(this.getEndToEndInboundGroupSession(s,o,null,a=>{r.push({senderKey:s,sessionId:o,sessionData:a})}),e&&i.length>=e)break}return Promise.resolve(r)}countSessionsNeedingBackup(){const e=vt(this.store,Hs)||{};return Promise.resolve(Object.keys(e).length)}unmarkSessionsNeedingBackup(e){const t=vt(this.store,Hs)||{};for(const r of e)delete t[r.senderKey+"/"+r.sessionId];return Dr(this.store,Hs,t),Promise.resolve()}markSessionsNeedingBackup(e){const t=vt(this.store,Hs)||{};for(const r of e)t[r.senderKey+"/"+r.sessionId]=!0;return Dr(this.store,Hs,t),Promise.resolve()}deleteAllData(){return this.store.removeItem(hd),Promise.resolve()}getAccount(e,t){const r=vt(this.store,hd);t(r)}storeAccount(e,t){Dr(this.store,hd,t)}getCrossSigningKeys(e,t){const r=vt(this.store,Fg);t(r)}getSecretStorePrivateKey(e,t,r){const i=vt(this.store,Rr+`ssss_cache.${r}`);t(i)}storeCrossSigningKeys(e,t){Dr(this.store,Fg,t)}storeSecretStorePrivateKey(e,t,r){Dr(this.store,Rr+`ssss_cache.${t}`,r)}doTxn(e,t,r){return Promise.resolve(r(null))}}uu.LocalStorageCryptoStore=CC;function vt(n,e){try{return JSON.parse(n.getItem(e))}catch(t){Kg.logger.log("Error: Failed to get key %s: %s",e,t.stack||t),Kg.logger.log(t.stack)}return null}function Dr(n,e,t){n.setItem(e,JSON.stringify(t))}var Ss={},PC=G.exports;Object.defineProperty(Ss,"__esModule",{value:!0});Ss.VERSION=Ss.Backend=void 0;Ss.upgradeDatabase=UC;var MC=PC(Y.exports),vn=ie,DC=AC(W);function R_(n){if(typeof WeakMap!="function")return null;var e=new WeakMap,t=new WeakMap;return(R_=function(r){return r?t:e})(n)}function AC(n,e){if(!e&&n&&n.__esModule)return n;if(n===null||typeof n!="object"&&typeof n!="function")return{default:n};var t=R_(e);if(t&&t.has(n))return t.get(n);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in n)if(s!=="default"&&Object.prototype.hasOwnProperty.call(n,s)){var o=i?Object.getOwnPropertyDescriptor(n,s):null;o&&(o.get||o.set)?Object.defineProperty(r,s,o):r[s]=n[s]}return r.default=n,t&&t.set(n,r),r}const I_=10;Ss.VERSION=I_;class xC{constructor(e){this.db=e,(0,MC.default)(this,"nextTxnId",0),e.onversionchange=()=>{vn.logger.log(`versionchange for indexeddb ${this.db.name}: closing`),e.close()}}async startup(){return this}async deleteAllData(){throw Error("This is not implemented, call IDBFactory::deleteDatabase(dbName) instead.")}getOrAddOutgoingRoomKeyRequest(e){const t=e.requestBody;return new Promise((r,i)=>{const s=this.db.transaction("outgoingRoomKeyRequests","readwrite");s.onerror=i,this._getOutgoingRoomKeyRequest(s,t,o=>{if(o){vn.logger.log(`already have key request outstanding for ${t.room_id} / ${t.session_id}: not sending another`),r(o);return}vn.logger.log(`enqueueing key request for ${t.room_id} / `+t.session_id),s.oncomplete=()=>{r(e)},s.objectStore("outgoingRoomKeyRequests").add(e)})})}getOutgoingRoomKeyRequest(e){return new Promise((t,r)=>{const i=this.db.transaction("outgoingRoomKeyRequests","readonly");i.onerror=r,this._getOutgoingRoomKeyRequest(i,e,s=>{t(s)})})}_getOutgoingRoomKeyRequest(e,t,r){const o=e.objectStore("outgoingRoomKeyRequests").index("session").openCursor([t.room_id,t.session_id]);o.onsuccess=()=>{const a=o.result;if(!a){r(null);return}const l=a.value;if(DC.deepCompare(l.requestBody,t)){r(l);return}a.continue()}}getOutgoingRoomKeyRequestByState(e){if(e.length===0)return Promise.resolve(null);let t=0,r;function i(){const u=this.result;if(u){r=u.value;return}if(t++,t>=e.length)return;const c=e[t],g=this.source.openCursor(c);g.onsuccess=i}const s=this.db.transaction("outgoingRoomKeyRequests","readonly"),o=s.objectStore("outgoingRoomKeyRequests"),a=e[t],l=o.index("state").openCursor(a);return l.onsuccess=i,zi(s).then(()=>r)}getAllOutgoingRoomKeyRequestsByState(e){return new Promise((t,r)=>{const a=this.db.transaction("outgoingRoomKeyRequests","readonly").objectStore("outgoingRoomKeyRequests").index("state").getAll(e);a.onsuccess=()=>t(a.result),a.onerror=()=>r(a.error)})}getOutgoingRoomKeyRequestsByTarget(e,t,r){let i=0;const s=[];function o(){const g=this.result;if(g){const m=g.value;m.recipients.includes({userId:e,deviceId:t})&&s.push(m),g.continue()}else{if(i++,i>=r.length)return;const m=r[i],f=this.source.openCursor(m);f.onsuccess=o}}const a=this.db.transaction("outgoingRoomKeyRequests","readonly"),l=a.objectStore("outgoingRoomKeyRequests"),u=r[i],c=l.index("state").openCursor(u);return c.onsuccess=o,zi(a).then(()=>s)}updateOutgoingRoomKeyRequest(e,t,r){let i=null;function s(){const l=this.result;if(!l)return;const u=l.value;if(u.state!=t){vn.logger.warn(`Cannot update room key request from ${t} as it was already updated to ${u.state}`);return}Object.assign(u,r),l.update(u),i=u}const o=this.db.transaction("outgoingRoomKeyRequests","readwrite"),a=o.objectStore("outgoingRoomKeyRequests").openCursor(e);return a.onsuccess=s,zi(o).then(()=>i)}deleteOutgoingRoomKeyRequest(e,t){const r=this.db.transaction("outgoingRoomKeyRequests","readwrite"),i=r.objectStore("outgoingRoomKeyRequests").openCursor(e);return i.onsuccess=()=>{const s=i.result;if(!s)return;const o=s.value;if(o.state!=t){vn.logger.warn(`Cannot delete room key request in state ${o.state} (expected ${t})`);return}s.delete()},zi(r)}getAccount(e,t){const i=e.objectStore("account").get("-");i.onsuccess=function(){try{t(i.result||null)}catch(s){er(e,s)}}}storeAccount(e,t){e.objectStore("account").put(t,"-")}getCrossSigningKeys(e,t){const i=e.objectStore("account").get("crossSigningKeys");i.onsuccess=function(){try{t(i.result||null)}catch(s){er(e,s)}}}getSecretStorePrivateKey(e,t,r){const s=e.objectStore("account").get(`ssss_cache:${r}`);s.onsuccess=function(){try{t(s.result||null)}catch(o){er(e,o)}}}storeCrossSigningKeys(e,t){e.objectStore("account").put(t,"crossSigningKeys")}storeSecretStorePrivateKey(e,t,r){e.objectStore("account").put(r,`ssss_cache:${t}`)}countEndToEndSessions(e,t){const i=e.objectStore("sessions").count();i.onsuccess=function(){try{t(i.result)}catch(s){er(e,s)}}}getEndToEndSessions(e,t,r){const o=t.objectStore("sessions").index("deviceKey").openCursor(e),a={};o.onsuccess=function(){const l=o.result;if(l)a[l.value.sessionId]={session:l.value.session,lastReceivedMessageTs:l.value.lastReceivedMessageTs},l.continue();else try{r(a)}catch(u){er(t,u)}}}getEndToEndSession(e,t,r,i){const o=r.objectStore("sessions").get([e,t]);o.onsuccess=function(){try{o.result?i({session:o.result.session,lastReceivedMessageTs:o.result.lastReceivedMessageTs}):i(null)}catch(a){er(r,a)}}}getAllEndToEndSessions(e,t){const i=e.objectStore("sessions").openCursor();i.onsuccess=function(){try{const s=i.result;s?(t(s.value),s.continue()):t(null)}catch(s){er(e,s)}}}storeEndToEndSession(e,t,r,i){i.objectStore("sessions").put({deviceKey:e,sessionId:t,session:r.session,lastReceivedMessageTs:r.lastReceivedMessageTs})}async storeEndToEndSessionProblem(e,t,r){const i=this.db.transaction("session_problems","readwrite");return i.objectStore("session_problems").put({deviceKey:e,type:t,fixed:r,time:Date.now()}),zi(i)}async getEndToEndSessionProblem(e,t){let r;const i=this.db.transaction("session_problems","readwrite"),a=i.objectStore("session_problems").index("deviceKey").getAll(e);return a.onsuccess=()=>{const l=a.result;if(!l.length){r=null;return}l.sort((c,g)=>c.time-g.time);const u=l[l.length-1];for(const c of l)if(c.time>t){r=Object.assign({},c,{fixed:u.fixed});return}u.fixed?r=null:r=u},await zi(i),r}async filterOutNotifiedErrorDevices(e){const r=this.db.transaction("notified_error_devices","readwrite").objectStore("notified_error_devices"),i=[];return await Promise.all(e.map(s=>new Promise(o=>{const{userId:a,deviceInfo:l}=s,u=r.get([a,l.deviceId]);u.onsuccess=function(){u.result||(r.put({userId:a,deviceId:l.deviceId}),i.push(s)),o()}}))),i}getEndToEndInboundGroupSession(e,t,r,i){let s=!1,o=!1;const l=r.objectStore("inbound_group_sessions").get([e,t]);l.onsuccess=function(){try{l.result?s=l.result.session:s=null,o!==!1&&i(s,o)}catch(g){er(r,g)}};const c=r.objectStore("inbound_group_sessions_withheld").get([e,t]);c.onsuccess=function(){try{c.result?o=c.result.session:o=null,s!==!1&&i(s,o)}catch(g){er(r,g)}}}getAllEndToEndInboundGroupSessions(e,t){const i=e.objectStore("inbound_group_sessions").openCursor();i.onsuccess=function(){const s=i.result;if(s){try{t({senderKey:s.value.senderCurve25519Key,sessionId:s.value.sessionId,sessionData:s.value.session})}catch(o){er(e,o)}s.continue()}else try{t(null)}catch(o){er(e,o)}}}addEndToEndInboundGroupSession(e,t,r,i){const o=i.objectStore("inbound_group_sessions").add({senderCurve25519Key:e,sessionId:t,session:r});o.onerror=a=>{o.error.name==="ConstraintError"?(a.stopPropagation(),a.preventDefault(),vn.logger.log("Ignoring duplicate inbound group session: "+e+" / "+t)):er(i,new Error("Failed to add inbound group session: "+o.error))}}storeEndToEndInboundGroupSession(e,t,r,i){i.objectStore("inbound_group_sessions").put({senderCurve25519Key:e,sessionId:t,session:r})}storeEndToEndInboundGroupSessionWithheld(e,t,r,i){i.objectStore("inbound_group_sessions_withheld").put({senderCurve25519Key:e,sessionId:t,session:r})}getEndToEndDeviceData(e,t){const i=e.objectStore("device_data").get("-");i.onsuccess=function(){try{t(i.result||null)}catch(s){er(e,s)}}}storeEndToEndDeviceData(e,t){t.objectStore("device_data").put(e,"-")}storeEndToEndRoom(e,t,r){r.objectStore("rooms").put(t,e)}getEndToEndRooms(e,t){const r={},s=e.objectStore("rooms").openCursor();s.onsuccess=function(){const o=s.result;if(o)r[o.key]=o.value,o.continue();else try{t(r)}catch(a){er(e,a)}}}getSessionsNeedingBackup(e){return new Promise((t,r)=>{const i=[],s=this.db.transaction(["sessions_needing_backup","inbound_group_sessions"],"readonly");s.onerror=r,s.oncomplete=function(){t(i)};const o=s.objectStore("sessions_needing_backup"),a=s.objectStore("inbound_group_sessions"),l=o.openCursor();l.onsuccess=function(){const u=l.result;if(u){const c=a.get(u.key);c.onsuccess=function(){i.push({senderKey:c.result.senderCurve25519Key,sessionId:c.result.sessionId,sessionData:c.result.session})},(!e||i.length<e)&&u.continue()}}})}countSessionsNeedingBackup(e){e||(e=this.db.transaction("sessions_needing_backup","readonly"));const t=e.objectStore("sessions_needing_backup");return new Promise((r,i)=>{const s=t.count();s.onerror=i,s.onsuccess=()=>r(s.result)})}async unmarkSessionsNeedingBackup(e,t){t||(t=this.db.transaction("sessions_needing_backup","readwrite"));const r=t.objectStore("sessions_needing_backup");await Promise.all(e.map(i=>new Promise((s,o)=>{const a=r.delete([i.senderKey,i.sessionId]);a.onsuccess=s,a.onerror=o})))}async markSessionsNeedingBackup(e,t){t||(t=this.db.transaction("sessions_needing_backup","readwrite"));const r=t.objectStore("sessions_needing_backup");await Promise.all(e.map(i=>new Promise((s,o)=>{const a=r.put({senderCurve25519Key:i.senderKey,sessionId:i.sessionId});a.onsuccess=s,a.onerror=o})))}addSharedHistoryInboundGroupSession(e,t,r,i){i||(i=this.db.transaction("shared_history_inbound_group_sessions","readwrite"));const s=i.objectStore("shared_history_inbound_group_sessions"),o=s.get([e]);o.onsuccess=()=>{const{sessions:a}=o.result||{sessions:[]};a.push([t,r]),s.put({roomId:e,sessions:a})}}getSharedHistoryInboundGroupSessions(e,t){t||(t=this.db.transaction("shared_history_inbound_group_sessions","readonly"));const i=t.objectStore("shared_history_inbound_group_sessions").get([e]);return new Promise((s,o)=>{i.onsuccess=()=>{const{sessions:a}=i.result||{sessions:[]};s(a)},i.onerror=o})}doTxn(e,t,r,i=vn.logger){const s=this.db.transaction(t,e),o=zi(s),a=r(s);return o.then(()=>a)}}Ss.Backend=xC;function UC(n,e){vn.logger.log(`Upgrading IndexedDBCryptoStore from version ${e} to ${I_}`),e<1&&$C(n),e<2&&n.createObjectStore("account"),e<3&&n.createObjectStore("sessions",{keyPath:["deviceKey","sessionId"]}).createIndex("deviceKey","deviceKey"),e<4&&n.createObjectStore("inbound_group_sessions",{keyPath:["senderCurve25519Key","sessionId"]}),e<5&&n.createObjectStore("device_data"),e<6&&n.createObjectStore("rooms"),e<7&&n.createObjectStore("sessions_needing_backup",{keyPath:["senderCurve25519Key","sessionId"]}),e<8&&n.createObjectStore("inbound_group_sessions_withheld",{keyPath:["senderCurve25519Key","sessionId"]}),e<9&&(n.createObjectStore("session_problems",{keyPath:["deviceKey","time"]}).createIndex("deviceKey","deviceKey"),n.createObjectStore("notified_error_devices",{keyPath:["userId","deviceId"]})),e<10&&n.createObjectStore("shared_history_inbound_group_sessions",{keyPath:["roomId"]})}function $C(n){const e=n.createObjectStore("outgoingRoomKeyRequests",{keyPath:"requestId"});e.createIndex("session",["requestBody.room_id","requestBody.session_id"]),e.createIndex("state","state")}function er(n,e){n._mx_abortexception=e;try{n.abort()}catch{}}function zi(n){return new Promise((e,t)=>{n.oncomplete=()=>{n._mx_abortexception!==void 0&&t(n._mx_abortexception),e(null)},n.onerror=r=>{n._mx_abortexception!==void 0?t(n._mx_abortexception):(vn.logger.log("Error performing indexeddb txn",r),t(n.error))},n.onabort=r=>{n._mx_abortexception!==void 0?t(n._mx_abortexception):(vn.logger.log("Error performing indexeddb txn",r),t(n.error))}})}var du={};Object.defineProperty(du,"__esModule",{value:!0});du.exists=NC;function NC(n,e){return new Promise((t,r)=>{let i=!0;const s=n.open(e);s.onupgradeneeded=()=>{i=!1},s.onblocked=()=>r(s.error),s.onsuccess=()=>{s.result.close(),i||n.deleteDatabase(e),t(i)},s.onerror=o=>r(s.error)})}var LC=G.exports;Object.defineProperty(qr,"__esModule",{value:!0});qr.IndexedDBCryptoStore=void 0;var On=LC(Y.exports),Ar=ie,BC=uu,KC=$o,pd=O_(Ss),Hg=ci,FC=O_(du);function T_(n){if(typeof WeakMap!="function")return null;var e=new WeakMap,t=new WeakMap;return(T_=function(r){return r?t:e})(n)}function O_(n,e){if(!e&&n&&n.__esModule)return n;if(n===null||typeof n!="object"&&typeof n!="function")return{default:n};var t=T_(e);if(t&&t.has(n))return t.get(n);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in n)if(s!=="default"&&Object.prototype.hasOwnProperty.call(n,s)){var o=i?Object.getOwnPropertyDescriptor(n,s):null;o&&(o.get||o.set)?Object.defineProperty(r,s,o):r[s]=n[s]}return r.default=n,t&&t.set(n,r),r}class Fr{static exists(e,t){return FC.exists(e,t)}constructor(e,t){this.indexedDB=e,this.dbName=t,(0,On.default)(this,"backendPromise",null),(0,On.default)(this,"backend",null)}startup(){return this.backendPromise?this.backendPromise:(this.backendPromise=new Promise((e,t)=>{if(!this.indexedDB){t(new Error("no indexeddb support available"));return}Ar.logger.log(`connecting to indexeddb ${this.dbName}`);const r=this.indexedDB.open(this.dbName,pd.VERSION);r.onupgradeneeded=i=>{const s=r.result,o=i.oldVersion;pd.upgradeDatabase(s,o)},r.onblocked=()=>{Ar.logger.log("can't yet open IndexedDBCryptoStore because it is open elsewhere")},r.onerror=i=>{Ar.logger.log("Error connecting to indexeddb",i),t(r.error)},r.onsuccess=()=>{const i=r.result;Ar.logger.log(`connected to indexeddb ${this.dbName}`),e(new pd.Backend(i))}}).then(e=>e.doTxn("readonly",[Fr.STORE_INBOUND_GROUP_SESSIONS,Fr.STORE_INBOUND_GROUP_SESSIONS_WITHHELD],t=>{e.getEndToEndInboundGroupSession("","",t,()=>{})}).then(()=>e)).catch(e=>{if(e.name==="VersionError")throw Ar.logger.warn("Crypto DB is too new for us to use!",e),new Hg.InvalidCryptoStoreError(Hg.InvalidCryptoStoreError.TOO_NEW);Ar.logger.warn(`unable to connect to indexeddb ${this.dbName}: falling back to localStorage store: ${e}`);try{return new BC.LocalStorageCryptoStore(V.localStorage)}catch(t){return Ar.logger.warn(`unable to open localStorage: falling back to in-memory store: ${t}`),new KC.MemoryCryptoStore}}).then(e=>(this.backend=e,e)),this.backendPromise)}deleteAllData(){return new Promise((e,t)=>{if(!this.indexedDB){t(new Error("no indexeddb support available"));return}Ar.logger.log(`Removing indexeddb instance: ${this.dbName}`);const r=this.indexedDB.deleteDatabase(this.dbName);r.onblocked=()=>{Ar.logger.log("can't yet delete IndexedDBCryptoStore because it is open elsewhere")},r.onerror=i=>{Ar.logger.log("Error deleting data from indexeddb",i),t(r.error)},r.onsuccess=()=>{Ar.logger.log(`Removed indexeddb instance: ${this.dbName}`),e()}}).catch(e=>{Ar.logger.warn(`unable to delete IndexedDBCryptoStore: ${e}`)})}getOrAddOutgoingRoomKeyRequest(e){return this.backend.getOrAddOutgoingRoomKeyRequest(e)}getOutgoingRoomKeyRequest(e){return this.backend.getOutgoingRoomKeyRequest(e)}getOutgoingRoomKeyRequestByState(e){return this.backend.getOutgoingRoomKeyRequestByState(e)}getAllOutgoingRoomKeyRequestsByState(e){return this.backend.getAllOutgoingRoomKeyRequestsByState(e)}getOutgoingRoomKeyRequestsByTarget(e,t,r){return this.backend.getOutgoingRoomKeyRequestsByTarget(e,t,r)}updateOutgoingRoomKeyRequest(e,t,r){return this.backend.updateOutgoingRoomKeyRequest(e,t,r)}deleteOutgoingRoomKeyRequest(e,t){return this.backend.deleteOutgoingRoomKeyRequest(e,t)}getAccount(e,t){this.backend.getAccount(e,t)}storeAccount(e,t){this.backend.storeAccount(e,t)}getCrossSigningKeys(e,t){this.backend.getCrossSigningKeys(e,t)}getSecretStorePrivateKey(e,t,r){this.backend.getSecretStorePrivateKey(e,t,r)}storeCrossSigningKeys(e,t){this.backend.storeCrossSigningKeys(e,t)}storeSecretStorePrivateKey(e,t,r){this.backend.storeSecretStorePrivateKey(e,t,r)}countEndToEndSessions(e,t){this.backend.countEndToEndSessions(e,t)}getEndToEndSession(e,t,r,i){this.backend.getEndToEndSession(e,t,r,i)}getEndToEndSessions(e,t,r){this.backend.getEndToEndSessions(e,t,r)}getAllEndToEndSessions(e,t){this.backend.getAllEndToEndSessions(e,t)}storeEndToEndSession(e,t,r,i){this.backend.storeEndToEndSession(e,t,r,i)}storeEndToEndSessionProblem(e,t,r){return this.backend.storeEndToEndSessionProblem(e,t,r)}getEndToEndSessionProblem(e,t){return this.backend.getEndToEndSessionProblem(e,t)}filterOutNotifiedErrorDevices(e){return this.backend.filterOutNotifiedErrorDevices(e)}getEndToEndInboundGroupSession(e,t,r,i){this.backend.getEndToEndInboundGroupSession(e,t,r,i)}getAllEndToEndInboundGroupSessions(e,t){this.backend.getAllEndToEndInboundGroupSessions(e,t)}addEndToEndInboundGroupSession(e,t,r,i){this.backend.addEndToEndInboundGroupSession(e,t,r,i)}storeEndToEndInboundGroupSession(e,t,r,i){this.backend.storeEndToEndInboundGroupSession(e,t,r,i)}storeEndToEndInboundGroupSessionWithheld(e,t,r,i){this.backend.storeEndToEndInboundGroupSessionWithheld(e,t,r,i)}storeEndToEndDeviceData(e,t){this.backend.storeEndToEndDeviceData(e,t)}getEndToEndDeviceData(e,t){this.backend.getEndToEndDeviceData(e,t)}storeEndToEndRoom(e,t,r){this.backend.storeEndToEndRoom(e,t,r)}getEndToEndRooms(e,t){this.backend.getEndToEndRooms(e,t)}getSessionsNeedingBackup(e){return this.backend.getSessionsNeedingBackup(e)}countSessionsNeedingBackup(e){return this.backend.countSessionsNeedingBackup(e)}unmarkSessionsNeedingBackup(e,t){return this.backend.unmarkSessionsNeedingBackup(e,t)}markSessionsNeedingBackup(e,t){return this.backend.markSessionsNeedingBackup(e,t)}addSharedHistoryInboundGroupSession(e,t,r,i){this.backend.addSharedHistoryInboundGroupSession(e,t,r,i)}getSharedHistoryInboundGroupSessions(e,t){return this.backend.getSharedHistoryInboundGroupSessions(e,t)}doTxn(e,t,r,i){return this.backend.doTxn(e,t,r,i)}}qr.IndexedDBCryptoStore=Fr;(0,On.default)(Fr,"STORE_ACCOUNT","account");(0,On.default)(Fr,"STORE_SESSIONS","sessions");(0,On.default)(Fr,"STORE_INBOUND_GROUP_SESSIONS","inbound_group_sessions");(0,On.default)(Fr,"STORE_INBOUND_GROUP_SESSIONS_WITHHELD","inbound_group_sessions_withheld");(0,On.default)(Fr,"STORE_SHARED_HISTORY_INBOUND_GROUP_SESSIONS","shared_history_inbound_group_sessions");(0,On.default)(Fr,"STORE_DEVICE_DATA","device_data");(0,On.default)(Fr,"STORE_ROOMS","rooms");(0,On.default)(Fr,"STORE_BACKUP","sessions_needing_backup");var qC=G.exports;Object.defineProperty(lu,"__esModule",{value:!0});lu.RoomList=void 0;var jC=qC(Y.exports),Yg=qr;class VC{constructor(e){this.cryptoStore=e,(0,jC.default)(this,"roomEncryption",{})}async init(){await this.cryptoStore.doTxn("readwrite",[Yg.IndexedDBCryptoStore.STORE_ROOMS],e=>{this.cryptoStore.getEndToEndRooms(e,t=>{this.roomEncryption=t})})}getRoomEncryption(e){return this.roomEncryption[e]||null}isRoomEncrypted(e){return Boolean(this.getRoomEncryption(e))}async setRoomEncryption(e,t){this.roomEncryption[e]=t,await this.cryptoStore.doTxn("readwrite",[Yg.IndexedDBCryptoStore.STORE_ROOMS],r=>{this.cryptoStore.storeEndToEndRoom(e,t,r)})}}lu.RoomList=VC;var Vo={};Object.defineProperty(Vo,"__esModule",{value:!0});Vo.SERVICE_TYPES=void 0;let Fh;Vo.SERVICE_TYPES=Fh;(function(n){n.IS="SERVICE_TYPE_IS",n.IM="SERVICE_TYPE_IM"})(Fh||(Vo.SERVICE_TYPES=Fh={}));var Gt={},bs={},Af={},Us={},GC=G.exports;Object.defineProperty(Us,"__esModule",{value:!0});Us.DeviceInfo=void 0;var rs=GC(Y.exports),Qn;(function(n){n[n.Blocked=-1]="Blocked",n[n.Unverified=0]="Unverified",n[n.Verified=1]="Verified"})(Qn||(Qn={}));class hu{static fromStorage(e,t){const r=new hu(t);for(const i in e)e.hasOwnProperty(i)&&(r[i]=e[i]);return r}constructor(e){this.deviceId=e,(0,rs.default)(this,"algorithms",void 0),(0,rs.default)(this,"keys",{}),(0,rs.default)(this,"verified",Qn.Unverified),(0,rs.default)(this,"known",!1),(0,rs.default)(this,"unsigned",{}),(0,rs.default)(this,"signatures",{})}toStorage(){return{algorithms:this.algorithms,keys:this.keys,verified:this.verified,known:this.known,unsigned:this.unsigned,signatures:this.signatures}}getFingerprint(){return this.keys["ed25519:"+this.deviceId]}getIdentityKey(){return this.keys["curve25519:"+this.deviceId]}getDisplayName(){return this.unsigned.device_display_name||null}isBlocked(){return this.verified==Qn.Blocked}isVerified(){return this.verified==Qn.Verified}isUnverified(){return this.verified==Qn.Unverified}isKnown(){return this.known===!0}}Us.DeviceInfo=hu;(0,rs.default)(hu,"DeviceVerification",{VERIFIED:Qn.Verified,UNVERIFIED:Qn.Unverified,BLOCKED:Qn.Blocked});var wt={},WC=G.exports;Object.defineProperty(wt,"__esModule",{value:!0});wt.UnknownDeviceError=wt.EncryptionAlgorithm=wt.ENCRYPTION_CLASSES=wt.DecryptionError=wt.DecryptionAlgorithm=wt.DECRYPTION_CLASSES=void 0;wt.registerAlgorithm=QC;var Nr=WC(Y.exports);const k_={};wt.ENCRYPTION_CLASSES=k_;const C_={};wt.DECRYPTION_CLASSES=C_;class HC{constructor(e){(0,Nr.default)(this,"userId",void 0),(0,Nr.default)(this,"deviceId",void 0),(0,Nr.default)(this,"crypto",void 0),(0,Nr.default)(this,"olmDevice",void 0),(0,Nr.default)(this,"baseApis",void 0),(0,Nr.default)(this,"roomId",void 0),this.userId=e.userId,this.deviceId=e.deviceId,this.crypto=e.crypto,this.olmDevice=e.olmDevice,this.baseApis=e.baseApis,this.roomId=e.roomId}prepareToEncrypt(e){}onRoomMembership(e,t,r){}}wt.EncryptionAlgorithm=HC;class YC{constructor(e){(0,Nr.default)(this,"userId",void 0),(0,Nr.default)(this,"crypto",void 0),(0,Nr.default)(this,"olmDevice",void 0),(0,Nr.default)(this,"baseApis",void 0),(0,Nr.default)(this,"roomId",void 0),this.userId=e.userId,this.crypto=e.crypto,this.olmDevice=e.olmDevice,this.baseApis=e.baseApis,this.roomId=e.roomId}onRoomKeyEvent(e){}async importRoomKey(e,t){}hasKeysForKeyRequest(e){return Promise.resolve(!1)}shareKeysWithDevice(e){throw new Error("shareKeysWithDevice not supported for this DecryptionAlgorithm")}async retryDecryptionFromSender(e){return!1}}wt.DecryptionAlgorithm=YC;class zC extends Error{constructor(e,t,r){super(t),this.code=e,(0,Nr.default)(this,"detailedString",void 0),this.code=e,this.name="DecryptionError",this.detailedString=JC(this,r)}}wt.DecryptionError=zC;function JC(n,e){let t=n.name+"[msg: "+n.message;return e&&(t+=", "+Object.keys(e).map(r=>r+": "+e[r]).join(", ")),t+="]",t}class XC extends Error{constructor(e,t){super(e),this.devices=t,this.name="UnknownDeviceError",this.devices=t}}wt.UnknownDeviceError=XC;function QC(n,e,t){k_[n]=e,C_[n]=t}var ZC=G.exports,zg=ZC(Y.exports),Jg=ie,qh=tP(De),eP=Us,gn=wt;function P_(n){if(typeof WeakMap!="function")return null;var e=new WeakMap,t=new WeakMap;return(P_=function(r){return r?t:e})(n)}function tP(n,e){if(!e&&n&&n.__esModule)return n;if(n===null||typeof n!="object"&&typeof n!="function")return{default:n};var t=P_(e);if(t&&t.has(n))return t.get(n);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in n)if(s!=="default"&&Object.prototype.hasOwnProperty.call(n,s)){var o=i?Object.getOwnPropertyDescriptor(n,s):null;o&&(o.get||o.set)?Object.defineProperty(r,s,o):r[s]=n[s]}return r.default=n,t&&t.set(n,r),r}const rP=eP.DeviceInfo.DeviceVerification;class nP extends gn.EncryptionAlgorithm{constructor(...e){super(...e),(0,zg.default)(this,"sessionPrepared",!1),(0,zg.default)(this,"prepPromise",null)}ensureSession(e){return this.prepPromise?this.prepPromise:this.sessionPrepared?Promise.resolve():(this.prepPromise=this.crypto.downloadKeys(e).then(t=>this.crypto.ensureOlmSessionsForUsers(e)).then(()=>{this.sessionPrepared=!0}).finally(()=>{this.prepPromise=null}),this.prepPromise)}async encryptMessage(e,t,r){const s=(await e.getEncryptionTargetMembers()).map(function(u){return u.userId});await this.ensureSession(s);const o={room_id:e.roomId,type:t,content:r},a={algorithm:qh.OLM_ALGORITHM,sender_key:this.olmDevice.deviceCurve25519Key,ciphertext:{}},l=[];for(let u=0;u<s.length;++u){const c=s[u],g=this.crypto.getStoredDevicesForUser(c);for(let m=0;m<g.length;++m){const f=g[m];f.getIdentityKey()!=this.olmDevice.deviceCurve25519Key&&f.verified!=rP.BLOCKED&&l.push(qh.encryptMessageForDevice(a.ciphertext,this.userId,this.deviceId,this.olmDevice,c,f,o))}}return await Promise.all(l).then(()=>a)}}class iP extends gn.DecryptionAlgorithm{async decryptEvent(e){const t=e.getWireContent(),r=t.sender_key,i=t.ciphertext;if(!i)throw new gn.DecryptionError("OLM_MISSING_CIPHERTEXT","Missing ciphertext");if(!(this.olmDevice.deviceCurve25519Key in i))throw new gn.DecryptionError("OLM_NOT_INCLUDED_IN_RECIPIENTS","Not included in recipients");const s=i[this.olmDevice.deviceCurve25519Key];let o;try{o=await this.decryptMessage(r,s)}catch(u){throw new gn.DecryptionError("OLM_BAD_ENCRYPTED_MESSAGE","Bad Encrypted Message",{sender:r,err:u})}const a=JSON.parse(o);if(a.recipient!=this.userId)throw new gn.DecryptionError("OLM_BAD_RECIPIENT","Message was intented for "+a.recipient);if(a.recipient_keys.ed25519!=this.olmDevice.deviceEd25519Key)throw new gn.DecryptionError("OLM_BAD_RECIPIENT_KEY","Message not intended for this device",{intended:a.recipient_keys.ed25519,our_key:this.olmDevice.deviceEd25519Key});if(a.sender!=e.getSender())throw new gn.DecryptionError("OLM_FORWARDED_MESSAGE","Message forwarded from "+a.sender,{reported_sender:e.getSender()});if(a.room_id!==e.getRoomId())throw new gn.DecryptionError("OLM_BAD_ROOM","Message intended for room "+a.room_id,{reported_room:e.getRoomId()});const l=a.keys||{};return{clearEvent:a,senderCurve25519Key:r,claimedEd25519Key:l.ed25519||null}}async decryptMessage(e,t){if(t.type!==0)return this.reallyDecryptMessage(e,t);{const r=this.olmDevice.olmPrekeyPromise.then(()=>this.reallyDecryptMessage(e,t));return this.olmDevice.olmPrekeyPromise=r.catch(()=>{}),await r}}async reallyDecryptMessage(e,t){const r=await this.olmDevice.getSessionIdsForDevice(e),i={};for(let o=0;o<r.length;o++){const a=r[o];try{const l=await this.olmDevice.decryptMessage(e,a,t.type,t.body);return Jg.logger.log("Decrypted Olm message from "+e+" with session "+a),l}catch(l){if(await this.olmDevice.matchesSession(e,a,t.type,t.body))throw new Error("Error decrypting prekey message with existing session id "+a+": "+l.message);i[a]=l.message}}if(t.type!==0)throw r.length===0?new Error("No existing sessions"):new Error("Error decrypting non-prekey message with existing sessions: "+JSON.stringify(i));let s;try{s=await this.olmDevice.createInboundSession(e,t.type,t.body)}catch(o){throw i["(new)"]=o.message,new Error("Error decrypting prekey message: "+JSON.stringify(i))}return Jg.logger.log("created new inbound Olm session ID "+s.session_id+" with "+e),s.payload}}(0,gn.registerAlgorithm)(qh.OLM_ALGORITHM,nP,iP);var xf={},sP=G.exports;Object.defineProperty(xf,"__esModule",{value:!0});xf.isRoomSharedHistory=D_;var Lr=sP(Y.exports),H=ie,tt=oP(De),Hn=wt,Xg=bs;function M_(n){if(typeof WeakMap!="function")return null;var e=new WeakMap,t=new WeakMap;return(M_=function(r){return r?t:e})(n)}function oP(n,e){if(!e&&n&&n.__esModule)return n;if(n===null||typeof n!="object"&&typeof n!="function")return{default:n};var t=M_(e);if(t&&t.has(n))return t.get(n);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in n)if(s!=="default"&&Object.prototype.hasOwnProperty.call(n,s)){var o=i?Object.getOwnPropertyDescriptor(n,s):null;o&&(o.get||o.set)?Object.defineProperty(r,s,o):r[s]=n[s]}return r.default=n,t&&t.set(n,r),r}function D_(n){var e,t;const r=n==null||(e=n.currentState)===null||e===void 0?void 0:e.getStateEvents("m.room.history_visibility",""),i=r==null||(t=r.getContent())===null||t===void 0?void 0:t.history_visibility;return["world_readable","shared"].includes(i)}class aP{constructor(e,t=!1){this.sessionId=e,this.sharedHistory=t,(0,Lr.default)(this,"useCount",0),(0,Lr.default)(this,"creationTime",void 0),(0,Lr.default)(this,"sharedWithDevices",{}),(0,Lr.default)(this,"blockedDevicesNotified",{}),this.creationTime=new Date().getTime()}needsRotation(e,t){const r=new Date().getTime()-this.creationTime;return this.useCount>=e||r>=t?(H.logger.log("Rotating megolm session after "+this.useCount+" messages, "+r+"ms"),!0):!1}markSharedWithDevice(e,t,r,i){this.sharedWithDevices[e]||(this.sharedWithDevices[e]={}),this.sharedWithDevices[e][t]={deviceKey:r,messageIndex:i}}markNotifiedBlockedDevice(e,t){this.blockedDevicesNotified[e]||(this.blockedDevicesNotified[e]={}),this.blockedDevicesNotified[e][t]=!0}sharedWithTooManyDevices(e){for(const t in this.sharedWithDevices)if(!!this.sharedWithDevices.hasOwnProperty(t)){if(!e.hasOwnProperty(t))return H.logger.log("Starting new megolm session because we shared with "+t),!0;for(const r in this.sharedWithDevices[t])if(!!this.sharedWithDevices[t].hasOwnProperty(r)&&!e[t].hasOwnProperty(r))return H.logger.log("Starting new megolm session because we shared with "+t+":"+r),!0}}}class cP extends Hn.EncryptionAlgorithm{constructor(e){var t,r,i,s;super(e),(0,Lr.default)(this,"setupPromise",Promise.resolve(void 0)),(0,Lr.default)(this,"outboundSessions",{}),(0,Lr.default)(this,"sessionRotationPeriodMsgs",void 0),(0,Lr.default)(this,"sessionRotationPeriodMs",void 0),(0,Lr.default)(this,"encryptionPreparation",void 0),(0,Lr.default)(this,"encryptionPreparationMetadata",void 0),this.sessionRotationPeriodMsgs=(t=(r=e.config)===null||r===void 0?void 0:r.rotation_period_msgs)!==null&&t!==void 0?t:100,this.sessionRotationPeriodMs=(i=(s=e.config)===null||s===void 0?void 0:s.rotation_period_ms)!==null&&i!==void 0?i:7*24*3600*1e3}async ensureOutboundSession(e,t,r,i=!1){let s;const o=async u=>{s=u;const c=D_(e);s&&c!==s.sharedHistory&&(s=null),s&&s.needsRotation(this.sessionRotationPeriodMsgs,this.sessionRotationPeriodMs)&&(H.logger.log("Starting new megolm session because we need to rotate."),s=null),s&&s.sharedWithTooManyDevices(t)&&(s=null),s||(H.logger.log(`Starting new megolm session for room ${this.roomId}`),s=await this.prepareNewSession(c),H.logger.log(`Started new megolm session ${s.sessionId} for room ${this.roomId}`),this.outboundSessions[s.sessionId]=s);const g={};for(const[R,T]of Object.entries(t))for(const[C,S]of Object.entries(T))S.getIdentityKey()!=this.olmDevice.deviceCurve25519Key&&(!s.sharedWithDevices[R]||s.sharedWithDevices[R][C]===void 0)&&(g[R]=g[R]||[],g[R].push(S));const m=this.olmDevice.getOutboundGroupSessionKey(s.sessionId),f={type:"m.room_key",content:{algorithm:tt.MEGOLM_ALGORITHM,room_id:this.roomId,session_id:s.sessionId,session_key:m.key,chain_index:m.chain_index,"org.matrix.msc3061.shared_history":c}},[_,I]=await tt.getExistingOlmSessions(this.olmDevice,this.baseApis,g);await Promise.all([(async()=>{H.logger.debug(`Sharing keys with existing Olm sessions in ${this.roomId}`,I),await this.shareKeyWithOlmSessions(s,m,f,I),H.logger.debug(`Shared keys with existing Olm sessions in ${this.roomId}`)})(),(async()=>{H.logger.debug(`Sharing keys (start phase 1) with new Olm sessions in ${this.roomId}`,_);const R=[],T=Date.now(),C=[];await this.shareKeyWithDevices(s,m,f,_,R,i?1e4:2e3,C),H.logger.debug(`Shared keys (end phase 1) with new Olm sessions in ${this.roomId}`),!i&&Date.now()-T<1e4?(async()=>{const S={},k=new Set;for(const w of C)k.add(w);const A=[];for(const{userId:w,deviceInfo:L}of R){const q=w.slice(w.indexOf(":")+1);k.has(q)?(S[w]=S[w]||[],S[w].push(L)):A.push({userId:w,deviceInfo:L})}H.logger.debug(`Sharing keys (start phase 2) with new Olm sessions in ${this.roomId}`),await this.shareKeyWithDevices(s,m,f,S,A,3e4),H.logger.debug(`Shared keys (end phase 2) with new Olm sessions in ${this.roomId}`),await this.notifyFailedOlmDevices(s,m,A)})():await this.notifyFailedOlmDevices(s,m,R),H.logger.debug(`Shared keys (all phases done) with new Olm sessions in ${this.roomId}`)})(),(async()=>{H.logger.debug(`There are ${Object.entries(r).length} blocked devices in ${this.roomId}`,Object.entries(r)),H.logger.debug(`Notifying newly blocked devices in ${this.roomId}`);const R={};let T=0;for(const[C,S]of Object.entries(r))for(const[k,A]of Object.entries(S))(!s.blockedDevicesNotified[C]||s.blockedDevicesNotified[C][k]===void 0)&&(R[C]=R[C]||{},R[C][k]={device:A},T++);await this.notifyBlockedDevices(s,R),H.logger.debug(`Notified ${T} newly blocked devices in ${this.roomId}`,R)})()])};function a(){return s}const l=this.setupPromise.then(o);return l.catch(u=>{H.logger.error(`Failed to ensure outbound session in ${this.roomId}`,u)}),this.setupPromise=l.then(a,a),l.then(a)}async prepareNewSession(e){const t=this.olmDevice.createOutboundGroupSession(),r=this.olmDevice.getOutboundGroupSessionKey(t);return await this.olmDevice.addInboundGroupSession(this.roomId,this.olmDevice.deviceCurve25519Key,[],t,r.key,{ed25519:this.olmDevice.deviceEd25519Key},!1,{sharedHistory:e}),this.crypto.backupManager.backupGroupSession(this.olmDevice.deviceCurve25519Key,t),new aP(t,e)}getDevicesWithoutSessions(e,t,r=[]){for(const[i,s]of Object.entries(t)){const o=e[i];for(const a of s){const l=a.deviceId;if(!o[l].sessionId){r.push({userId:i,deviceInfo:a}),delete o[l];continue}}}return r}splitDevices(e){let r=[];const i=[r];for(const[s,o]of Object.entries(e)){for(const a of Object.values(o))r.push({userId:s,deviceInfo:a.device});r.length>20&&(r=[],i.push(r))}return r.length===0&&i.pop(),i}encryptAndSendKeysToDevices(e,t,r,i){const s={},o=new Map,a=[];for(let l=0;l<r.length;l++){const u={algorithm:tt.OLM_ALGORITHM,sender_key:this.olmDevice.deviceCurve25519Key,ciphertext:{}},c=r[l],g=c.userId,m=c.deviceInfo,f=m.deviceId;o.set(f,m),s[g]||(s[g]={}),s[g][f]=u,a.push(tt.encryptMessageForDevice(u.ciphertext,this.userId,this.deviceId,this.olmDevice,g,m,i))}return Promise.all(a).then(()=>{for(const l of Object.keys(s)){for(const u of Object.keys(s[l]))Object.keys(s[l][u].ciphertext).length===0&&(H.logger.log("No ciphertext for device "+l+":"+u+": pruning"),delete s[l][u]);Object.keys(s[l]).length===0&&(H.logger.log("Pruned all devices for user "+l),delete s[l])}if(Object.keys(s).length===0){H.logger.log("No users left to send to: aborting");return}return this.baseApis.sendToDevice("m.room.encrypted",s).then(()=>{for(const l of Object.keys(s))for(const u of Object.keys(s[l]))e.markSharedWithDevice(l,u,o.get(u).getIdentityKey(),t)})})}async sendBlockedNotificationsToDevices(e,t,r){const i={};for(const s of t){const o=s.userId,a=s.deviceInfo,u=a.deviceInfo.deviceId,c=Object.assign({},r);c.code=a.code,c.reason=a.reason,c.code==="m.no_olm"&&(delete c.room_id,delete c.session_id),i[o]||(i[o]={}),i[o][u]=c}await this.baseApis.sendToDevice("org.matrix.room_key.withheld",i),await this.baseApis.sendToDevice("m.room_key.withheld",i);for(const s of Object.keys(i))for(const o of Object.keys(i[s]))e.markNotifiedBlockedDevice(s,o)}async reshareKeyWithDevice(e,t,r,i){const s=this.outboundSessions[t];if(!s){H.logger.debug(`megolm session ${t} not found: not re-sharing keys`);return}if(s.sharedWithDevices[r]===void 0){H.logger.debug(`megolm session ${t} never shared with user ${r}`);return}const o=s.sharedWithDevices[r][i.deviceId];if(o===void 0){H.logger.debug("megolm session ID "+t+" never shared with device "+r+":"+i.deviceId);return}if(o.deviceKey!==i.getIdentityKey()){H.logger.warn(`Session has been shared with device ${i.deviceId} but with identity key ${o.deviceKey}. Key is now ${i.getIdentityKey()}!`);return}const a=await this.olmDevice.getInboundGroupSessionKey(this.roomId,e,t,o.messageIndex);if(!a){H.logger.warn(`No inbound session key found for megolm ${t}: not re-sharing keys`);return}await tt.ensureOlmSessionsForDevices(this.olmDevice,this.baseApis,{[r]:[i]});const l={type:"m.forwarded_room_key",content:{algorithm:tt.MEGOLM_ALGORITHM,room_id:this.roomId,session_id:t,session_key:a.key,chain_index:a.chain_index,sender_key:e,sender_claimed_ed25519_key:a.sender_claimed_ed25519_key,forwarding_curve25519_key_chain:a.forwarding_curve25519_key_chain,"org.matrix.msc3061.shared_history":a.shared_history||!1}},u={algorithm:tt.OLM_ALGORITHM,sender_key:this.olmDevice.deviceCurve25519Key,ciphertext:{}};await tt.encryptMessageForDevice(u.ciphertext,this.userId,this.deviceId,this.olmDevice,r,i,l),await this.baseApis.sendToDevice("m.room.encrypted",{[r]:{[i.deviceId]:u}}),H.logger.debug(`Re-shared key for megolm session ${t} with ${r}:${i.deviceId}`)}async shareKeyWithDevices(e,t,r,i,s,o,a){H.logger.debug(`Ensuring Olm sessions for devices in ${this.roomId}`);const l=await tt.ensureOlmSessionsForDevices(this.olmDevice,this.baseApis,i,!1,o,a,H.logger.withPrefix(`[${this.roomId}]`));H.logger.debug(`Ensured Olm sessions for devices in ${this.roomId}`),this.getDevicesWithoutSessions(l,i,s),H.logger.debug(`Sharing keys with newly created Olm sessions in ${this.roomId}`),await this.shareKeyWithOlmSessions(e,t,r,l),H.logger.debug(`Shared keys with newly created Olm sessions in ${this.roomId}`)}async shareKeyWithOlmSessions(e,t,r,i){const s=this.splitDevices(i);for(let o=0;o<s.length;o++){const a=`megolm keys for ${e.sessionId} in ${this.roomId} (slice ${o+1}/${s.length})`;try{H.logger.debug(`Sharing ${a}`,s[o].map(l=>`${l.userId}/${l.deviceInfo.deviceId}`)),await this.encryptAndSendKeysToDevices(e,t.chain_index,s[o],r),H.logger.debug(`Shared ${a}`)}catch(l){throw H.logger.error(`Failed to share ${a}`),l}}}async notifyFailedOlmDevices(e,t,r){H.logger.debug(`Notifying ${r.length} devices we failed to create Olm sessions in ${this.roomId}`);for(const{userId:o,deviceInfo:a}of r){const l=a.deviceId;e.markSharedWithDevice(o,l,a.getIdentityKey(),t.chain_index)}const i=await this.olmDevice.filterOutNotifiedErrorDevices(r);H.logger.debug(`Need to notify ${i.length} failed devices which haven't been notified before in ${this.roomId}`);const s={};for(const{userId:o,deviceInfo:a}of i)s[o]=s[o]||{},s[o][a.deviceId]={device:{code:"m.no_olm",reason:Xg.WITHHELD_MESSAGES["m.no_olm"],deviceInfo:a}};await this.notifyBlockedDevices(e,s),H.logger.debug(`Notified ${i.length} devices we failed to create Olm sessions in ${this.roomId}`)}async notifyBlockedDevices(e,t){const r={room_id:this.roomId,session_id:e.sessionId,algorithm:tt.MEGOLM_ALGORITHM,sender_key:this.olmDevice.deviceCurve25519Key},i=this.splitDevices(t);for(let s=0;s<i.length;s++)try{await this.sendBlockedNotificationsToDevices(e,i[s],r),H.logger.log(`Completed blacklist notification for ${e.sessionId} in ${this.roomId} (slice ${s+1}/${i.length})`)}catch(o){throw H.logger.log(`blacklist notification for ${e.sessionId} in ${this.roomId} (slice ${s+1}/${i.length}) failed`),o}}prepareToEncrypt(e){if(this.encryptionPreparation){const t=Date.now()-this.encryptionPreparationMetadata.startTime;H.logger.debug(`Already started preparing to encrypt for ${this.roomId} ${t} ms ago, skipping`);return}H.logger.debug(`Preparing to encrypt events for ${this.roomId}`),this.encryptionPreparationMetadata={startTime:Date.now()},this.encryptionPreparation=(async()=>{try{H.logger.debug(`Getting devices in ${this.roomId}`);const[t,r]=await this.getDevicesInRoom(e);this.crypto.getGlobalErrorOnUnknownDevices()&&this.removeUnknownDevices(t),H.logger.debug(`Ensuring outbound session in ${this.roomId}`),await this.ensureOutboundSession(e,t,r,!0),H.logger.debug(`Ready to encrypt events for ${this.roomId}`)}catch(t){H.logger.error(`Failed to prepare to encrypt events for ${this.roomId}`,t)}finally{delete this.encryptionPreparationMetadata,delete this.encryptionPreparation}})()}async encryptMessage(e,t,r){if(H.logger.log(`Starting to encrypt event for ${this.roomId}`),this.encryptionPreparation)try{await this.encryptionPreparation}catch{}const[i,s]=await this.getDevicesInRoom(e);this.crypto.getGlobalErrorOnUnknownDevices()&&this.checkForUnknownDevices(i);const o=await this.ensureOutboundSession(e,i,s),a={room_id:this.roomId,type:t,content:r},l=this.olmDevice.encryptGroupMessage(o.sessionId,JSON.stringify(a)),u={algorithm:tt.MEGOLM_ALGORITHM,sender_key:this.olmDevice.deviceCurve25519Key,ciphertext:l,session_id:o.sessionId,device_id:this.deviceId};return o.useCount++,u}forceDiscardSession(){this.setupPromise=this.setupPromise.then(()=>null)}checkForUnknownDevices(e){const t={};if(Object.keys(e).forEach(r=>{Object.keys(e[r]).forEach(i=>{const s=e[r][i];s.isUnverified()&&!s.isKnown()&&(t[r]||(t[r]={}),t[r][i]=s)})}),Object.keys(t).length)throw new Hn.UnknownDeviceError("This room contains unknown devices which have not been verified. We strongly recommend you verify them before continuing.",t)}removeUnknownDevices(e){for(const[t,r]of Object.entries(e)){for(const[i,s]of Object.entries(r))s.isUnverified()&&!s.isKnown()&&delete r[i];Object.keys(r).length===0&&delete e[t]}}async getDevicesInRoom(e){const r=(await e.getEncryptionTargetMembers()).map(function(a){return a.userId});let i=this.crypto.getGlobalBlacklistUnverifiedDevices();typeof e.getBlacklistUnverifiedDevices()=="boolean"&&(i=e.getBlacklistUnverifiedDevices());const s=await this.crypto.downloadKeys(r,!1),o={};for(const a in s){if(!s.hasOwnProperty(a))continue;const l=s[a];for(const u in l){if(!l.hasOwnProperty(u))continue;const c=this.crypto.checkDeviceTrust(a,u);if(l[u].isBlocked()||!c.isVerified()&&i){o[a]||(o[a]={});const g=l[u].isBlocked();o[a][u]={code:g?"m.blacklisted":"m.unverified",reason:Xg.WITHHELD_MESSAGES[g?"m.blacklisted":"m.unverified"],deviceInfo:l[u]},delete l[u]}}}return[s,o]}}class lP extends Hn.DecryptionAlgorithm{constructor(...e){super(...e),(0,Lr.default)(this,"pendingEvents",{}),(0,Lr.default)(this,"olmlib",tt)}async decryptEvent(e){const t=e.getWireContent();if(!t.sender_key||!t.session_id||!t.ciphertext)throw new Hn.DecryptionError("MEGOLM_MISSING_FIELDS","Missing fields in input");this.addEventToPendingList(e);let r;try{r=await this.olmDevice.decryptGroupMessage(e.getRoomId(),t.sender_key,t.session_id,t.ciphertext,e.getId(),e.getTs())}catch(s){if(s.name==="DecryptionError")throw s;let o="OLM_DECRYPT_GROUP_MESSAGE_ERROR";throw s&&s.message==="OLM.UNKNOWN_MESSAGE_INDEX"&&(this.requestKeysForEvent(e),o="OLM_UNKNOWN_MESSAGE_INDEX"),new Hn.DecryptionError(o,s?s.toString():"Unknown Error: Error is undefined",{session:t.sender_key+"|"+t.session_id})}if(r===null){this.requestKeysForEvent(e);const s=await this.olmDevice.sessionMayHaveProblems(t.sender_key,e.getTs()-12e4);if(s){let o=Qg[s.type]||Qg.unknown;throw s.fixed&&(o+=" Trying to create a new secure channel and re-requesting the keys."),new Hn.DecryptionError("MEGOLM_UNKNOWN_INBOUND_SESSION_ID",o,{session:t.sender_key+"|"+t.session_id})}throw new Hn.DecryptionError("MEGOLM_UNKNOWN_INBOUND_SESSION_ID","The sender's device has not sent us the keys for this message.",{session:t.sender_key+"|"+t.session_id})}this.removeEventFromPendingList(e);const i=JSON.parse(r.result);if(i.room_id!==e.getRoomId())throw new Hn.DecryptionError("MEGOLM_BAD_ROOM","Message intended for room "+i.room_id);return{clearEvent:i,senderCurve25519Key:r.senderKey,claimedEd25519Key:r.keysClaimed.ed25519,forwardingCurve25519KeyChain:r.forwardingCurve25519KeyChain,untrusted:r.untrusted}}requestKeysForEvent(e){const t=e.getWireContent(),r=e.getKeyRequestRecipients(this.userId);this.crypto.requestRoomKey({room_id:e.getRoomId(),algorithm:t.algorithm,sender_key:t.sender_key,session_id:t.session_id},r)}addEventToPendingList(e){const t=e.getWireContent(),r=t.sender_key,i=t.session_id;this.pendingEvents[r]||(this.pendingEvents[r]=new Map);const s=this.pendingEvents[r];s.has(i)||s.set(i,new Set),s.get(i).add(e)}removeEventFromPendingList(e){const t=e.getWireContent(),r=t.sender_key,i=t.session_id,s=this.pendingEvents[r],o=s==null?void 0:s.get(i);!o||(o.delete(e),o.size===0&&s.delete(i),s.size===0&&delete this.pendingEvents[r])}onRoomKeyEvent(e){const t=e.getContent(),r=t.session_id;let i=e.getSenderKey(),s=[],o=!1,a;if(!t.room_id||!r||!t.session_key){H.logger.error("key event is missing fields");return}if(!i){H.logger.error("key event has no sender key (not encrypted?)");return}if(e.getType()=="m.forwarded_room_key"){if(o=!0,s=t.forwarding_curve25519_key_chain,Array.isArray(s)||(s=[]),s=s.slice(),s.push(i),i=t.sender_key,!i){H.logger.error("forwarded_room_key event is missing sender_key field");return}const u=t.sender_claimed_ed25519_key;if(!u){H.logger.error("forwarded_room_key_event is missing sender_claimed_ed25519_key field");return}a={ed25519:u}}else a=e.getKeysClaimed();const l={};return t["org.matrix.msc3061.shared_history"]&&(l.sharedHistory=!0),this.olmDevice.addInboundGroupSession(t.room_id,i,s,r,t.session_key,a,o,l).then(()=>{this.retryDecryption(i,r).then(u=>{u&&this.crypto.cancelRoomKeyRequest({algorithm:t.algorithm,room_id:t.room_id,session_id:t.session_id,sender_key:i})})}).then(()=>{this.crypto.backupManager.backupGroupSession(i,t.session_id)}).catch(u=>{H.logger.error(`Error handling m.room_key_event: ${u}`)})}async onRoomKeyWithheldEvent(e){const t=e.getContent(),r=t.sender_key;if(t.code==="m.no_olm"){const i=e.getSender();if(H.logger.warn(`${i}:${r} was unable to establish an olm session with us`),await this.olmDevice.getSessionIdForDevice(r)){H.logger.debug("New session already created. Not creating a new one."),await this.olmDevice.recordSessionProblem(r,"no_olm",!0),this.retryDecryptionFromSender(r);return}let s=this.crypto.deviceList.getDeviceByIdentityKey(t.algorithm,r);if(!s&&(await this.crypto.downloadKeys([i],!1),s=this.crypto.deviceList.getDeviceByIdentityKey(t.algorithm,r),!s)){H.logger.info("Couldn't find device for identity key "+r+": not establishing session"),await this.olmDevice.recordSessionProblem(r,"no_olm",!1),this.retryDecryptionFromSender(r);return}await tt.ensureOlmSessionsForDevices(this.olmDevice,this.baseApis,{[i]:[s]},!1);const o={algorithm:tt.OLM_ALGORITHM,sender_key:this.olmDevice.deviceCurve25519Key,ciphertext:{}};await tt.encryptMessageForDevice(o.ciphertext,this.userId,void 0,this.olmDevice,i,s,{type:"m.dummy"}),await this.olmDevice.recordSessionProblem(r,"no_olm",!0),this.retryDecryptionFromSender(r),await this.baseApis.sendToDevice("m.room.encrypted",{[i]:{[s.deviceId]:o}})}else await this.olmDevice.addInboundGroupSessionWithheld(t.room_id,r,t.session_id,t.code,t.reason)}hasKeysForKeyRequest(e){const t=e.requestBody;return this.olmDevice.hasInboundSessionKeys(t.room_id,t.sender_key,t.session_id)}shareKeysWithDevice(e){const t=e.userId,r=e.deviceId,i=this.crypto.getStoredDevice(t,r),s=e.requestBody;this.olmlib.ensureOlmSessionsForDevices(this.olmDevice,this.baseApis,{[t]:[i]}).then(o=>o[t][r].sessionId?(H.logger.log("sharing keys for session "+s.sender_key+"|"+s.session_id+" with device "+t+":"+r),this.buildKeyForwardingMessage(s.room_id,s.sender_key,s.session_id)):null).then(o=>{const a={algorithm:tt.OLM_ALGORITHM,sender_key:this.olmDevice.deviceCurve25519Key,ciphertext:{}};return this.olmlib.encryptMessageForDevice(a.ciphertext,this.userId,void 0,this.olmDevice,t,i,o).then(()=>{const l={[t]:{[r]:a}};return this.baseApis.sendToDevice("m.room.encrypted",l)})})}async buildKeyForwardingMessage(e,t,r){const i=await this.olmDevice.getInboundGroupSessionKey(e,t,r);return{type:"m.forwarded_room_key",content:{algorithm:tt.MEGOLM_ALGORITHM,room_id:e,sender_key:t,sender_claimed_ed25519_key:i.sender_claimed_ed25519_key,session_id:r,session_key:i.key,chain_index:i.chain_index,forwarding_curve25519_key_chain:i.forwarding_curve25519_key_chain,"org.matrix.msc3061.shared_history":i.shared_history||!1}}}importRoomKey(e,t={}){const r={};return(t.untrusted||e.untrusted)&&(r.untrusted=!0),e["org.matrix.msc3061.shared_history"]&&(r.sharedHistory=!0),this.olmDevice.addInboundGroupSession(e.room_id,e.sender_key,e.forwarding_curve25519_key_chain,e.session_id,e.session_key,e.sender_claimed_keys,!0,r).then(()=>{t.source!=="backup"&&this.crypto.backupManager.backupGroupSession(e.sender_key,e.session_id).catch(i=>{H.logger.log("Failed to back up megolm session",i)}),this.retryDecryption(e.sender_key,e.session_id)})}async retryDecryption(e,t){var r;const i=this.pendingEvents[e];if(!i)return!0;const s=i.get(t);return s?(H.logger.debug("Retrying decryption on events",[...s]),await Promise.all([...s].map(async o=>{try{await o.attemptDecryption(this.crypto,{isRetry:!0})}catch{}})),!((r=this.pendingEvents[e])!==null&&r!==void 0&&r.has(t))):!0}async retryDecryptionFromSender(e){const t=this.pendingEvents[e];return t?(delete this.pendingEvents[e],await Promise.all([...t].map(async([r,i])=>{await Promise.all([...i].map(async s=>{try{await s.attemptDecryption(this.crypto)}catch{}}))})),!this.pendingEvents[e]):!0}async sendSharedHistoryInboundSessions(e){await tt.ensureOlmSessionsForDevices(this.olmDevice,this.baseApis,e),H.logger.log("sendSharedHistoryInboundSessions to users",Object.keys(e));const t=await this.olmDevice.getSharedHistoryInboundGroupSessions(this.roomId);H.logger.log("shared-history sessions",t);for(const[r,i]of t){const s=await this.buildKeyForwardingMessage(this.roomId,r,i),o=[],a={};for(const[l,u]of Object.entries(e)){a[l]={};for(const c of u){const g={algorithm:tt.OLM_ALGORITHM,sender_key:this.olmDevice.deviceCurve25519Key,ciphertext:{}};a[l][c.deviceId]=g,o.push(tt.encryptMessageForDevice(g.ciphertext,this.userId,void 0,this.olmDevice,l,c,s))}}await Promise.all(o);for(const l of Object.keys(a)){for(const u of Object.keys(a[l]))Object.keys(a[l][u].ciphertext).length===0&&(H.logger.log("No ciphertext for device "+l+":"+u+": pruning"),delete a[l][u]);Object.keys(a[l]).length===0&&(H.logger.log("Pruned all devices for user "+l),delete a[l])}if(Object.keys(a).length===0){H.logger.log("No users left to send to: aborting");return}await this.baseApis.sendToDevice("m.room.encrypted",a)}}}const Qg={no_olm:"The sender was unable to establish a secure channel.",unknown:"The secure channel with the sender was corrupted."};(0,Hn.registerAlgorithm)(tt.MEGOLM_ALGORITHM,cP,lP);(function(n){Object.defineProperty(n,"__esModule",{value:!0});var e=wt;Object.keys(e).forEach(function(t){t==="default"||t==="__esModule"||t in n&&n[t]===e[t]||Object.defineProperty(n,t,{enumerable:!0,get:function(){return e[t]}})})})(Af);var uP=G.exports;Object.defineProperty(bs,"__esModule",{value:!0});bs.WITHHELD_MESSAGES=bs.OlmDevice=void 0;var Ti=uP(Y.exports),nt=ie,Se=qr,Zg=dP(Af);function A_(n){if(typeof WeakMap!="function")return null;var e=new WeakMap,t=new WeakMap;return(A_=function(r){return r?t:e})(n)}function dP(n,e){if(!e&&n&&n.__esModule)return n;if(n===null||typeof n!="object"&&typeof n!="function")return{default:n};var t=A_(e);if(t&&t.has(n))return t.get(n);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in n)if(s!=="default"&&Object.prototype.hasOwnProperty.call(n,s)){var o=i?Object.getOwnPropertyDescriptor(n,s):null;o&&(o.get||o.set)?Object.defineProperty(r,s,o):r[s]=n[s]}return r.default=n,t&&t.set(n,r),r}const em=65536*3/4;function tm(n){if(n===void 0)throw new Error("payloadString undefined");if(n.length>em){const e=new Error("Message too long ("+n.length+" bytes). The maximum for an encrypted message is "+em+" bytes.");throw e.data={errcode:"M_TOO_LARGE",error:"Payload too large for encrypted message"},e}}class hP{constructor(e){this.cryptoStore=e,(0,Ti.default)(this,"pickleKey","DEFAULT_KEY"),(0,Ti.default)(this,"deviceCurve25519Key",null),(0,Ti.default)(this,"deviceEd25519Key",null),(0,Ti.default)(this,"maxOneTimeKeys",null),(0,Ti.default)(this,"outboundGroupSessionStore",{}),(0,Ti.default)(this,"inboundGroupSessionMessageIndexes",{}),(0,Ti.default)(this,"sessionsInProgress",{}),(0,Ti.default)(this,"olmPrekeyPromise",Promise.resolve())}static getOlmVersion(){return V.Olm.get_library_version()}async init({pickleKey:e,fromExportedDevice:t}={}){let r;const i=new V.Olm.Account;try{t?(e&&nt.logger.warn("ignoring opts.pickleKey because opts.fromExportedDevice is present."),this.pickleKey=t.pickleKey,await this.initialiseFromExportedDevice(t,i)):(e&&(this.pickleKey=e),await this.initialiseAccount(i)),r=JSON.parse(i.identity_keys()),this.maxOneTimeKeys=i.max_number_of_one_time_keys()}finally{i.free()}this.deviceCurve25519Key=r.curve25519,this.deviceEd25519Key=r.ed25519}async initialiseFromExportedDevice(e,t){await this.cryptoStore.doTxn("readwrite",[Se.IndexedDBCryptoStore.STORE_ACCOUNT,Se.IndexedDBCryptoStore.STORE_SESSIONS],r=>{this.cryptoStore.storeAccount(r,e.pickledAccount),e.sessions.forEach(i=>{const{deviceKey:s,sessionId:o}=i,a={session:i.session,lastReceivedMessageTs:i.lastReceivedMessageTs};this.cryptoStore.storeEndToEndSession(s,o,a,r)})}),t.unpickle(this.pickleKey,e.pickledAccount)}async initialiseAccount(e){await this.cryptoStore.doTxn("readwrite",[Se.IndexedDBCryptoStore.STORE_ACCOUNT],t=>{this.cryptoStore.getAccount(t,r=>{r!==null?e.unpickle(this.pickleKey,r):(e.create(),r=e.pickle(this.pickleKey),this.cryptoStore.storeAccount(t,r))})})}getAccount(e,t){this.cryptoStore.getAccount(e,r=>{const i=new V.Olm.Account;try{i.unpickle(this.pickleKey,r),t(i)}finally{i.free()}})}storeAccount(e,t){this.cryptoStore.storeAccount(e,t.pickle(this.pickleKey))}async export(){const e={pickleKey:this.pickleKey};return await this.cryptoStore.doTxn("readonly",[Se.IndexedDBCryptoStore.STORE_ACCOUNT,Se.IndexedDBCryptoStore.STORE_SESSIONS],t=>{this.cryptoStore.getAccount(t,r=>{e.pickledAccount=r}),e.sessions=[],this.cryptoStore.getAllEndToEndSessions(t,r=>{e.sessions.push(r)})}),e}getSession(e,t,r,i){this.cryptoStore.getEndToEndSession(e,t,r,s=>{this.unpickleSession(s,i)})}unpickleSession(e,t){const r=new V.Olm.Session;try{r.unpickle(this.pickleKey,e.session);const i=Object.assign({},e,{session:r});t(i)}finally{r.free()}}saveSession(e,t,r){const i=t.session.session_id(),s=Object.assign(t,{session:t.session.pickle(this.pickleKey)});this.cryptoStore.storeEndToEndSession(e,i,s,r)}getUtility(e){const t=new V.Olm.Utility;try{return e(t)}finally{t.free()}}async sign(e){let t;return await this.cryptoStore.doTxn("readonly",[Se.IndexedDBCryptoStore.STORE_ACCOUNT],r=>{this.getAccount(r,i=>{t=i.sign(e)})}),t}async getOneTimeKeys(){let e;return await this.cryptoStore.doTxn("readonly",[Se.IndexedDBCryptoStore.STORE_ACCOUNT],t=>{this.getAccount(t,r=>{e=JSON.parse(r.one_time_keys())})}),e}maxNumberOfOneTimeKeys(){return this.maxOneTimeKeys}async markKeysAsPublished(){await this.cryptoStore.doTxn("readwrite",[Se.IndexedDBCryptoStore.STORE_ACCOUNT],e=>{this.getAccount(e,t=>{t.mark_keys_as_published(),this.storeAccount(e,t)})})}generateOneTimeKeys(e){return this.cryptoStore.doTxn("readwrite",[Se.IndexedDBCryptoStore.STORE_ACCOUNT],t=>{this.getAccount(t,r=>{r.generate_one_time_keys(e),this.storeAccount(t,r)})})}async generateFallbackKey(){await this.cryptoStore.doTxn("readwrite",[Se.IndexedDBCryptoStore.STORE_ACCOUNT],e=>{this.getAccount(e,t=>{t.generate_fallback_key(),this.storeAccount(e,t)})})}async getFallbackKey(){let e;return await this.cryptoStore.doTxn("readonly",[Se.IndexedDBCryptoStore.STORE_ACCOUNT],t=>{this.getAccount(t,r=>{e=JSON.parse(r.unpublished_fallback_key())})}),e}async forgetOldFallbackKey(){await this.cryptoStore.doTxn("readwrite",[Se.IndexedDBCryptoStore.STORE_ACCOUNT],e=>{this.getAccount(e,t=>{t.forget_old_fallback_key(),this.storeAccount(e,t)})})}async createOutboundSession(e,t){let r;return await this.cryptoStore.doTxn("readwrite",[Se.IndexedDBCryptoStore.STORE_ACCOUNT,Se.IndexedDBCryptoStore.STORE_SESSIONS],i=>{this.getAccount(i,s=>{const o=new V.Olm.Session;try{o.create_outbound(s,e,t),r=o.session_id(),this.storeAccount(i,s);const a={session:o,lastReceivedMessageTs:Date.now()};this.saveSession(e,a,i)}finally{o.free()}})},nt.logger.withPrefix("[createOutboundSession]")),r}async createInboundSession(e,t,r){if(t!==0)throw new Error("Need messageType == 0 to create inbound session");let i;return await this.cryptoStore.doTxn("readwrite",[Se.IndexedDBCryptoStore.STORE_ACCOUNT,Se.IndexedDBCryptoStore.STORE_SESSIONS],s=>{this.getAccount(s,o=>{const a=new V.Olm.Session;try{a.create_inbound_from(o,e,r),o.remove_one_time_keys(a),this.storeAccount(s,o);const l=a.decrypt(t,r),u={session:a,lastReceivedMessageTs:Date.now()};this.saveSession(e,u,s),i={payload:l,session_id:a.session_id()}}finally{a.free()}})},nt.logger.withPrefix("[createInboundSession]")),i}async getSessionIdsForDevice(e){const t=nt.logger.withPrefix("[getSessionIdsForDevice]");if(this.sessionsInProgress[e]){t.debug(`Waiting for Olm session for ${e} to be created`);try{await this.sessionsInProgress[e]}catch{}}let r;return await this.cryptoStore.doTxn("readonly",[Se.IndexedDBCryptoStore.STORE_SESSIONS],i=>{this.cryptoStore.getEndToEndSessions(e,i,s=>{r=Object.keys(s)})},t),r}async getSessionIdForDevice(e,t=!1,r){const i=await this.getSessionInfoForDevice(e,t,r);if(i.length===0)return null;let s=0;for(let o=1;o<i.length;o++){const a=i[o],l=a.lastReceivedMessageTs===void 0?0:a.lastReceivedMessageTs,u=i[s],c=u.lastReceivedMessageTs===void 0?0:u.lastReceivedMessageTs;(l>c||l===c&&a.sessionId<u.sessionId)&&(s=o)}return i[s].sessionId}async getSessionInfoForDevice(e,t=!1,r=nt.logger){if(r=r.withPrefix("[getSessionInfoForDevice]"),this.sessionsInProgress[e]&&!t){r.debug(`Waiting for Olm session for ${e} to be created`);try{await this.sessionsInProgress[e]}catch{}}const i=[];return await this.cryptoStore.doTxn("readonly",[Se.IndexedDBCryptoStore.STORE_SESSIONS],s=>{this.cryptoStore.getEndToEndSessions(e,s,o=>{const a=Object.keys(o).sort();for(const l of a)this.unpickleSession(o[l],u=>{i.push({lastReceivedMessageTs:u.lastReceivedMessageTs,hasReceivedMessage:u.session.has_received_message(),sessionId:l})})})},r),i}async encryptMessage(e,t,r){tm(r);let i;return await this.cryptoStore.doTxn("readwrite",[Se.IndexedDBCryptoStore.STORE_SESSIONS],s=>{this.getSession(e,t,s,o=>{const a=o.session.describe();nt.logger.log("encryptMessage: Olm Session ID "+t+" to "+e+": "+a),i=o.session.encrypt(r),this.saveSession(e,o,s)})},nt.logger.withPrefix("[encryptMessage]")),i}async decryptMessage(e,t,r,i){let s;return await this.cryptoStore.doTxn("readwrite",[Se.IndexedDBCryptoStore.STORE_SESSIONS],o=>{this.getSession(e,t,o,a=>{const l=a.session.describe();nt.logger.log("decryptMessage: Olm Session ID "+t+" from "+e+": "+l),s=a.session.decrypt(r,i),a.lastReceivedMessageTs=Date.now(),this.saveSession(e,a,o)})},nt.logger.withPrefix("[decryptMessage]")),s}async matchesSession(e,t,r,i){if(r!==0)return!1;let s;return await this.cryptoStore.doTxn("readonly",[Se.IndexedDBCryptoStore.STORE_SESSIONS],o=>{this.getSession(e,t,o,a=>{s=a.session.matches_inbound(i)})},nt.logger.withPrefix("[matchesSession]")),s}async recordSessionProblem(e,t,r){await this.cryptoStore.storeEndToEndSessionProblem(e,t,r)}async sessionMayHaveProblems(e,t){return await this.cryptoStore.getEndToEndSessionProblem(e,t)}async filterOutNotifiedErrorDevices(e){return await this.cryptoStore.filterOutNotifiedErrorDevices(e)}saveOutboundGroupSession(e){this.outboundGroupSessionStore[e.session_id()]=e.pickle(this.pickleKey)}getOutboundGroupSession(e,t){const r=this.outboundGroupSessionStore[e];if(r===void 0)throw new Error("Unknown outbound group session "+e);const i=new V.Olm.OutboundGroupSession;try{return i.unpickle(this.pickleKey,r),t(i)}finally{i.free()}}createOutboundGroupSession(){const e=new V.Olm.OutboundGroupSession;try{return e.create(),this.saveOutboundGroupSession(e),e.session_id()}finally{e.free()}}encryptGroupMessage(e,t){return nt.logger.log(`encrypting msg with megolm session ${e}`),tm(t),this.getOutboundGroupSession(e,r=>{const i=r.encrypt(t);return this.saveOutboundGroupSession(r),i})}getOutboundGroupSessionKey(e){return this.getOutboundGroupSession(e,function(t){return{chain_index:t.message_index(),key:t.session_key()}})}unpickleInboundGroupSession(e,t){const r=new V.Olm.InboundGroupSession;try{return r.unpickle(this.pickleKey,e.session),t(r)}finally{r.free()}}getInboundGroupSession(e,t,r,i,s){this.cryptoStore.getEndToEndInboundGroupSession(t,r,i,(o,a)=>{if(o===null){s(null,null,a);return}if(e!==null&&e!==o.room_id)throw new Error("Mismatched room_id for inbound group session (expected "+o.room_id+", was "+e+")");this.unpickleInboundGroupSession(o,l=>{s(l,o,a)})})}async addInboundGroupSession(e,t,r,i,s,o,a,l={}){await this.cryptoStore.doTxn("readwrite",[Se.IndexedDBCryptoStore.STORE_INBOUND_GROUP_SESSIONS,Se.IndexedDBCryptoStore.STORE_INBOUND_GROUP_SESSIONS_WITHHELD,Se.IndexedDBCryptoStore.STORE_SHARED_HISTORY_INBOUND_GROUP_SESSIONS],u=>{this.getInboundGroupSession(e,t,i,u,(c,g)=>{const m=new V.Olm.InboundGroupSession;try{if(a?m.import_session(s):m.create(s),i!=m.session_id())throw new Error("Mismatched group session ID from senderKey: "+t);if(c&&(nt.logger.log("Update for megolm session "+t+"/"+i),c.first_known_index()<=m.first_known_index()&&!(c.first_known_index()==m.first_known_index()&&!l.untrusted&&g.untrusted))){nt.logger.log(`Keeping existing megolm session ${i}`);return}nt.logger.info("Storing megolm session "+t+"/"+i+" with first index "+m.first_known_index());const f=Object.assign({},l,{room_id:e,session:m.pickle(this.pickleKey),keysClaimed:o,forwardingCurve25519KeyChain:r});this.cryptoStore.storeEndToEndInboundGroupSession(t,i,f,u),!c&&l.sharedHistory&&this.cryptoStore.addSharedHistoryInboundGroupSession(e,t,i,u)}finally{m.free()}})},nt.logger.withPrefix("[addInboundGroupSession]"))}async addInboundGroupSessionWithheld(e,t,r,i,s){await this.cryptoStore.doTxn("readwrite",[Se.IndexedDBCryptoStore.STORE_INBOUND_GROUP_SESSIONS_WITHHELD],o=>{this.cryptoStore.storeEndToEndInboundGroupSessionWithheld(t,r,{room_id:e,code:i,reason:s},o)})}async decryptGroupMessage(e,t,r,i,s,o){let a,l;if(await this.cryptoStore.doTxn("readwrite",[Se.IndexedDBCryptoStore.STORE_INBOUND_GROUP_SESSIONS,Se.IndexedDBCryptoStore.STORE_INBOUND_GROUP_SESSIONS_WITHHELD],u=>{this.getInboundGroupSession(e,t,r,u,(c,g,m)=>{if(c===null){m&&(l=new Zg.DecryptionError("MEGOLM_UNKNOWN_INBOUND_SESSION_ID",rm(m),{session:t+"|"+r})),a=null;return}let f;try{f=c.decrypt(i)}catch(I){I&&I.message==="OLM.UNKNOWN_MESSAGE_INDEX"&&m?l=new Zg.DecryptionError("MEGOLM_UNKNOWN_INBOUND_SESSION_ID",rm(m),{session:t+"|"+r}):l=I;return}let _=f.plaintext;if(_===void 0)_=f;else{const I=t+"|"+r+"|"+f.message_index;if(I in this.inboundGroupSessionMessageIndexes){const R=this.inboundGroupSessionMessageIndexes[I];if(R.id!==s||R.timestamp!==o){l=new Error("Duplicate message index, possible replay attack: "+I);return}}this.inboundGroupSessionMessageIndexes[I]={id:s,timestamp:o}}g.session=c.pickle(this.pickleKey),this.cryptoStore.storeEndToEndInboundGroupSession(t,r,g,u),a={result:_,keysClaimed:g.keysClaimed||{},senderKey:t,forwardingCurve25519KeyChain:g.forwardingCurve25519KeyChain||[],untrusted:g.untrusted}})},nt.logger.withPrefix("[decryptGroupMessage]")),l)throw l;return a}async hasInboundSessionKeys(e,t,r){let i;return await this.cryptoStore.doTxn("readonly",[Se.IndexedDBCryptoStore.STORE_INBOUND_GROUP_SESSIONS,Se.IndexedDBCryptoStore.STORE_INBOUND_GROUP_SESSIONS_WITHHELD],s=>{this.cryptoStore.getEndToEndInboundGroupSession(t,r,s,o=>{if(o===null){i=!1;return}e!==o.room_id?(nt.logger.warn(`requested keys for inbound group session ${t}|${r}, with incorrect room_id (expected ${o.room_id}, was ${e})`),i=!1):i=!0})},nt.logger.withPrefix("[hasInboundSessionKeys]")),i}async getInboundGroupSessionKey(e,t,r,i){let s;return await this.cryptoStore.doTxn("readonly",[Se.IndexedDBCryptoStore.STORE_INBOUND_GROUP_SESSIONS,Se.IndexedDBCryptoStore.STORE_INBOUND_GROUP_SESSIONS_WITHHELD],o=>{this.getInboundGroupSession(e,t,r,o,(a,l)=>{if(a===null){s=null;return}i===void 0&&(i=a.first_known_index());const u=a.export_session(i),g=(l.keysClaimed||{}).ed25519||null;s={chain_index:i,key:u,forwarding_curve25519_key_chain:l.forwardingCurve25519KeyChain||[],sender_claimed_ed25519_key:g,shared_history:l.sharedHistory||!1}})},nt.logger.withPrefix("[getInboundGroupSessionKey]")),s}exportInboundGroupSession(e,t,r){return this.unpickleInboundGroupSession(r,i=>{const s=i.first_known_index();return{sender_key:e,sender_claimed_keys:r.keysClaimed,room_id:r.room_id,session_id:t,session_key:i.export_session(s),forwarding_curve25519_key_chain:r.forwardingCurve25519KeyChain||[],first_known_index:i.first_known_index(),"org.matrix.msc3061.shared_history":r.sharedHistory||!1}})}async getSharedHistoryInboundGroupSessions(e){let t;return await this.cryptoStore.doTxn("readonly",[Se.IndexedDBCryptoStore.STORE_SHARED_HISTORY_INBOUND_GROUP_SESSIONS],r=>{t=this.cryptoStore.getSharedHistoryInboundGroupSessions(e,r)},nt.logger.withPrefix("[getSharedHistoryInboundGroupSessionsForRoom]")),t}verifySignature(e,t,r){this.getUtility(function(i){i.ed25519_verify(e,t,r)})}}bs.OlmDevice=hP;const jh={"m.unverified":"The sender has disabled encrypting to unverified devices.","m.blacklisted":"The sender has blocked you.","m.unauthorised":"You are not authorised to read the message.","m.no_olm":"Unable to establish a secure channel."};bs.WITHHELD_MESSAGES=jh;function rm(n){return n.code&&n.code in jh?jh[n.code]:n.reason?n.reason:"decryption key withheld"}var ws={},Dt={},di={};Object.defineProperty(di,"__esModule",{value:!0});di.calculateKeyCheck=_P;di.decryptAES=yP;di.encryptAES=N_;var Uf=W,wn=De;const Rn=typeof window!="undefined"&&window.crypto?window.crypto.subtle||window.crypto.webkitSubtle:null,x_=new Uint8Array(8);async function fP(n,e,t,r){const i=(0,Uf.getCrypto)();if(!i)throw new Error("No usable crypto implementation");let s;r?s=(0,wn.decodeBase64)(r):(s=i.randomBytes(16),s[8]&=127);const[o,a]=U_(e,t),l=i.createCipheriv("aes-256-ctr",o,s),u=Buffer.concat([l.update(n,"utf8"),l.final()]),c=i.createHmac("sha256",a).update(u).digest("base64");return{iv:(0,wn.encodeBase64)(s),ciphertext:u.toString("base64"),mac:c}}async function pP(n,e,t){const r=(0,Uf.getCrypto)();if(!r)throw new Error("No usable crypto implementation");const[i,s]=U_(e,t);if(r.createHmac("sha256",s).update(Buffer.from(n.ciphertext,"base64")).digest("base64").replace(/=+$/g,"")!==n.mac.replace(/=+$/g,""))throw new Error(`Error decrypting secret ${t}: bad MAC`);const a=r.createDecipheriv("aes-256-ctr",i,(0,wn.decodeBase64)(n.iv));return a.update(n.ciphertext,"base64","utf8")+a.final("utf8")}function U_(n,e){const t=(0,Uf.getCrypto)(),r=t.createHmac("sha256",x_).update(n).digest(),i=Buffer.alloc(1,1),s=t.createHmac("sha256",r).update(e,"utf8").update(i).digest();i[0]=2;const o=t.createHmac("sha256",r).update(s).update(e,"utf8").update(i).digest();return[s,o]}async function gP(n,e,t,r){let i;r?i=(0,wn.decodeBase64)(r):(i=new Uint8Array(16),window.crypto.getRandomValues(i),i[8]&=127);const[s,o]=await $_(e,t),a=new TextEncoder().encode(n),l=await Rn.encrypt({name:"AES-CTR",counter:i,length:64},s,a),u=await Rn.sign({name:"HMAC"},o,l);return{iv:(0,wn.encodeBase64)(i),ciphertext:(0,wn.encodeBase64)(l),mac:(0,wn.encodeBase64)(u)}}async function mP(n,e,t){const[r,i]=await $_(e,t),s=(0,wn.decodeBase64)(n.ciphertext);if(!await Rn.verify({name:"HMAC"},i,(0,wn.decodeBase64)(n.mac),s))throw new Error(`Error decrypting secret ${t}: bad MAC`);const o=await Rn.decrypt({name:"AES-CTR",counter:(0,wn.decodeBase64)(n.iv),length:64},r,s);return new TextDecoder().decode(new Uint8Array(o))}async function $_(n,e){const t=await Rn.importKey("raw",n,{name:"HKDF"},!1,["deriveBits"]),r=await Rn.deriveBits({name:"HKDF",salt:x_,info:new TextEncoder().encode(e),hash:"SHA-256"},t,512),i=r.slice(0,32),s=r.slice(32),o=Rn.importKey("raw",i,{name:"AES-CTR"},!1,["encrypt","decrypt"]),a=Rn.importKey("raw",s,{name:"HMAC",hash:{name:"SHA-256"}},!1,["sign","verify"]);return await Promise.all([o,a])}function N_(n,e,t,r){return Rn?gP(n,e,t,r):fP(n,e,t,r)}function yP(n,e,t){return Rn?mP(n,e,t):pP(n,e,t)}const vP="\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0";function _P(n,e){return N_(vP,n,"",e)}var EP=G.exports;Object.defineProperty(Dt,"__esModule",{value:!0});Dt.UserTrustLevel=Dt.DeviceTrustLevel=Dt.CrossSigningLevel=Dt.CrossSigningInfo=void 0;Dt.createCryptoStoreCacheCallbacks=wP;Dt.requestKeysDuringVerification=RP;var gd=EP(Y.exports),ar=De,Vt=ie,nm=qr,im=di;const SP=1e3*60;function $c(n){return Object.values(n.keys)[0]}class fu{constructor(e,t={},r={}){this.userId=e,this.callbacks=t,this.cacheCallbacks=r,(0,gd.default)(this,"keys",{}),(0,gd.default)(this,"firstUse",!0),(0,gd.default)(this,"crossSigningVerifiedBefore",!1)}static fromStorage(e,t){const r=new fu(t);for(const i in e)e.hasOwnProperty(i)&&(r[i]=e[i]);return r}toStorage(){return{keys:this.keys,firstUse:this.firstUse,crossSigningVerifiedBefore:this.crossSigningVerifiedBefore}}async getCrossSigningKey(e,t){const r=["master","self_signing","user_signing"].indexOf(e)>=0;if(!this.callbacks.getCrossSigningKey)throw new Error("No getCrossSigningKey callback supplied");t===void 0&&(t=this.getId(e));function i(l){if(!l)return;const u=new V.Olm.PkSigning,c=u.init_with_seed(l);if(c===t)return[c,u];u.free()}let s;this.cacheCallbacks.getCrossSigningKeyCache&&r&&(s=await this.cacheCallbacks.getCrossSigningKeyCache(e,t));const o=i(s);if(o)return o;s=await this.callbacks.getCrossSigningKey(e,t);const a=i(s);if(a)return this.cacheCallbacks.storeCrossSigningKeyCache&&r&&await this.cacheCallbacks.storeCrossSigningKeyCache(e,s),a;throw s?new Error("Key type "+e+" from getCrossSigningKey callback did not match"):new Error("getCrossSigningKey callback for "+e+" returned falsey")}async isStoredInSecretStorage(e){const t=await e.isStored("m.cross_signing.master",!1)||{};function r(i){for(const s of Object.keys(t))i[s]||delete t[s]}for(const i of["self_signing","user_signing"])r(await e.isStored(`m.cross_signing.${i}`,!1)||{});return Object.keys(t).length?t:null}static async storeInSecretStorage(e,t){for(const[r,i]of e){const s=(0,ar.encodeBase64)(i);await t.store(`m.cross_signing.${r}`,s)}}static async getFromSecretStorage(e,t){const r=await t.get(`m.cross_signing.${e}`);return r?(0,ar.decodeBase64)(r):null}async isStoredInKeyCache(e){const t=this.cacheCallbacks;if(!t)return!1;const r=e?[e]:["master","self_signing","user_signing"];for(const i of r)if(!await t.getCrossSigningKeyCache(i))return!1;return!0}async getCrossSigningKeysFromCache(){const e=new Map,t=this.cacheCallbacks;if(!t)return e;for(const r of["master","self_signing","user_signing"]){const i=await t.getCrossSigningKeyCache(r);!i||e.set(r,i)}return e}getId(e="master"){if(!this.keys[e])return null;const t=this.keys[e];return $c(t)}async resetKeys(e){if(!this.callbacks.saveCrossSigningKeys)throw new Error("No saveCrossSigningKeys callback supplied");if(e===void 0||e&_n.MASTER||!this.keys.master)e=_n.MASTER|_n.USER_SIGNING|_n.SELF_SIGNING;else if(e===0)return;const t={},r={};let i,s;try{if(e&_n.MASTER?(i=new V.Olm.PkSigning,t.master=i.generate_seed(),s=i.init_with_seed(t.master),r.master={user_id:this.userId,usage:["master"],keys:{["ed25519:"+s]:s}}):[s,i]=await this.getCrossSigningKey("master"),e&_n.SELF_SIGNING){const o=new V.Olm.PkSigning;try{t.self_signing=o.generate_seed();const a=o.init_with_seed(t.self_signing);r.self_signing={user_id:this.userId,usage:["self_signing"],keys:{["ed25519:"+a]:a}},(0,ar.pkSign)(r.self_signing,i,this.userId,s)}finally{o.free()}}if(e&_n.USER_SIGNING){const o=new V.Olm.PkSigning;try{t.user_signing=o.generate_seed();const a=o.init_with_seed(t.user_signing);r.user_signing={user_id:this.userId,usage:["user_signing"],keys:{["ed25519:"+a]:a}},(0,ar.pkSign)(r.user_signing,i,this.userId,s)}finally{o.free()}}Object.assign(this.keys,r),this.callbacks.saveCrossSigningKeys(t)}finally{i&&i.free()}}clearKeys(){this.keys={}}setKeys(e){const t={};if(e.master){if(e.master.user_id!==this.userId){const i="Mismatched user ID "+e.master.user_id+" in master key from "+this.userId;throw Vt.logger.error(i),new Error(i)}this.keys.master?$c(e.master)!==this.getId()&&(this.firstUse=!1):this.firstUse=!0,t.master=e.master}else if(this.keys.master)t.master=this.keys.master;else throw new Error("Tried to set cross-signing keys without a master key");const r=$c(t.master);if(e.user_signing){if(e.user_signing.user_id!==this.userId){const i="Mismatched user ID "+e.master.user_id+" in user_signing key from "+this.userId;throw Vt.logger.error(i),new Error(i)}try{(0,ar.pkVerify)(e.user_signing,r,this.userId)}catch(i){throw Vt.logger.error("invalid signature on user-signing key"),i}}if(e.self_signing){if(e.self_signing.user_id!==this.userId){const i="Mismatched user ID "+e.master.user_id+" in self_signing key from "+this.userId;throw Vt.logger.error(i),new Error(i)}try{(0,ar.pkVerify)(e.self_signing,r,this.userId)}catch(i){throw Vt.logger.error("invalid signature on self-signing key"),i}}e.master&&(this.keys.master=e.master,this.keys.self_signing=null,this.keys.user_signing=null),e.self_signing&&(this.keys.self_signing=e.self_signing),e.user_signing&&(this.keys.user_signing=e.user_signing)}updateCrossSigningVerifiedBefore(e){!this.crossSigningVerifiedBefore&&e&&(this.crossSigningVerifiedBefore=!0)}async signObject(e,t){if(!this.keys[t])throw new Error("Attempted to sign with "+t+" key but no such key present");const[r,i]=await this.getCrossSigningKey(t);try{return(0,ar.pkSign)(e,i,this.userId,r),e}finally{i.free()}}async signUser(e){if(!this.keys.user_signing){Vt.logger.info("No user signing key: not signing user");return}return this.signObject(e.keys.master,"user_signing")}async signDevice(e,t){if(e!==this.userId)throw new Error(`Trying to sign ${e}'s device; can only sign our own device`);if(!this.keys.self_signing){Vt.logger.info("No self signing key: not signing device");return}return this.signObject({algorithms:t.algorithms,keys:t.keys,device_id:t.deviceId,user_id:e},"self_signing")}checkUserTrust(e){if(this.userId===e.userId&&this.getId()&&this.getId()===e.getId()&&this.getId("self_signing")&&this.getId("self_signing")===e.getId("self_signing"))return new hl(!0,!0,this.firstUse);if(!this.keys.user_signing)return new hl(!1,!1,e.firstUse);let t;const r=e.keys.master,i=this.getId("user_signing");try{(0,ar.pkVerify)(r,i,this.userId),t=!0}catch{t=!1}return new hl(t,e.crossSigningVerifiedBefore,e.firstUse)}checkDeviceTrust(e,t,r,i){const s=this.checkUserTrust(e),o=e.keys.self_signing;if(!o)return new Eo(!1,!1,r,i);const a=bP(t,e.userId);try{return(0,ar.pkVerify)(o,e.getId(),e.userId),(0,ar.pkVerify)(a,$c(o),e.userId),Eo.fromUserTrustLevel(s,r,i)}catch{return new Eo(!1,!1,r,i)}}getCacheCallbacks(){return this.cacheCallbacks}}Dt.CrossSigningInfo=fu;function bP(n,e){return{algorithms:n.algorithms,keys:n.keys,device_id:n.deviceId,user_id:e,signatures:n.signatures}}let _n;Dt.CrossSigningLevel=_n;(function(n){n[n.MASTER=4]="MASTER",n[n.USER_SIGNING=2]="USER_SIGNING",n[n.SELF_SIGNING=1]="SELF_SIGNING"})(_n||(Dt.CrossSigningLevel=_n={}));class hl{constructor(e,t,r){this.crossSigningVerified=e,this.crossSigningVerifiedBefore=t,this.tofu=r}isVerified(){return this.isCrossSigningVerified()}isCrossSigningVerified(){return this.crossSigningVerified}wasCrossSigningVerified(){return this.crossSigningVerifiedBefore}isTofu(){return this.tofu}}Dt.UserTrustLevel=hl;class Eo{constructor(e,t,r,i){this.crossSigningVerified=e,this.tofu=t,this.localVerified=r,this.trustCrossSignedDevices=i}static fromUserTrustLevel(e,t,r){return new Eo(e.isCrossSigningVerified(),e.isTofu(),t,r)}isVerified(){return Boolean(this.isLocallyVerified()||this.trustCrossSignedDevices&&this.isCrossSigningVerified())}isCrossSigningVerified(){return this.crossSigningVerified}isLocallyVerified(){return this.localVerified}isTofu(){return this.tofu}}Dt.DeviceTrustLevel=Eo;function wP(n,e){return{getCrossSigningKeyCache:async function(t,r){const i=await new Promise(s=>n.doTxn("readonly",[nm.IndexedDBCryptoStore.STORE_ACCOUNT],o=>{n.getSecretStorePrivateKey(o,s,t)}));if(i&&i.ciphertext){const s=Buffer.from(e.pickleKey),o=await(0,im.decryptAES)(i,s,t);return(0,ar.decodeBase64)(o)}else return i},storeCrossSigningKeyCache:async function(t,r){if(!(r instanceof Uint8Array))throw new Error(`storeCrossSigningKeyCache expects Uint8Array, got ${r}`);const i=Buffer.from(e.pickleKey),s=await(0,im.encryptAES)((0,ar.encodeBase64)(r),i,t);return n.doTxn("readwrite",[nm.IndexedDBCryptoStore.STORE_ACCOUNT],o=>{n.storeSecretStorePrivateKey(o,t,s)})}}}function RP(n,e,t){if(n.getUserId()===e)return Vt.logger.log("Cross-signing: Self-verification done; requesting keys"),new Promise((r,i)=>{const s=n,o=s.crypto.crossSigningInfo,a=new fu(o.userId,{getCrossSigningKey:async c=>{Vt.logger.debug("Cross-signing: requesting secret",c,t);const{promise:g}=s.requestSecret(`m.cross_signing.${c}`,[t]),m=await g,f=(0,ar.decodeBase64)(m);return Uint8Array.from(f)}},o.getCacheCallbacks());a.keys=o.keys;const l=new Promise(c=>{setTimeout(c,SP,new Error("Timeout"))}),u=(async()=>{if(!await s.crypto.getSessionBackupPrivateKey()){Vt.logger.info("No cached backup key found. Requesting...");const m=await s.requestSecret("m.megolm_backup.v1",[t]).promise;Vt.logger.info("Got key backup key, decoding...");const f=(0,ar.decodeBase64)(m);Vt.logger.info("Decoded backup key, storing..."),await s.crypto.storeSessionBackupPrivateKey(Uint8Array.from(f)),Vt.logger.info("Backup key stored. Starting backup restore...");const _=await s.getKeyBackupVersion();s.restoreKeyBackupWithCache(void 0,void 0,_).then(()=>{Vt.logger.info("Backup restored.")})}})();return Promise.race([Promise.all([a.getCrossSigningKey("master"),a.getCrossSigningKey("self_signing"),a.getCrossSigningKey("user_signing"),u]),l]).then(r,i)}).catch(r=>{Vt.logger.warn("Cross-signing: failure while requesting keys:",r)})}var IP=G.exports;Object.defineProperty(ws,"__esModule",{value:!0});ws.TrackingStatus=ws.DeviceList=void 0;var bt=IP(Y.exports),Ae=ie,Ua=Us,L_=Dt,Vh=OP(De),sm=qr,md=W,TP=je,Gh=Gt;function B_(n){if(typeof WeakMap!="function")return null;var e=new WeakMap,t=new WeakMap;return(B_=function(r){return r?t:e})(n)}function OP(n,e){if(!e&&n&&n.__esModule)return n;if(n===null||typeof n!="object"&&typeof n!="function")return{default:n};var t=B_(e);if(t&&t.has(n))return t.get(n);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in n)if(s!=="default"&&Object.prototype.hasOwnProperty.call(n,s)){var o=i?Object.getOwnPropertyDescriptor(n,s):null;o&&(o.get||o.set)?Object.defineProperty(r,s,o):r[s]=n[s]}return r.default=n,t&&t.set(n,r),r}let Mt;ws.TrackingStatus=Mt;(function(n){n[n.NotTracked=0]="NotTracked",n[n.PendingDownload=1]="PendingDownload",n[n.DownloadInProgress=2]="DownloadInProgress",n[n.UpToDate=3]="UpToDate"})(Mt||(ws.TrackingStatus=Mt={}));class kP extends TP.TypedEventEmitter{constructor(e,t,r,i=250){super(),this.cryptoStore=t,this.keyDownloadChunkSize=i,(0,bt.default)(this,"devices",{}),(0,bt.default)(this,"crossSigningInfo",{}),(0,bt.default)(this,"userByIdentityKey",{}),(0,bt.default)(this,"deviceTrackingStatus",{}),(0,bt.default)(this,"syncToken",null),(0,bt.default)(this,"keyDownloadsInProgressByUser",{}),(0,bt.default)(this,"dirty",!1),(0,bt.default)(this,"savePromise",null),(0,bt.default)(this,"resolveSavePromise",null),(0,bt.default)(this,"savePromiseTime",null),(0,bt.default)(this,"saveTimer",null),(0,bt.default)(this,"hasFetched",null),(0,bt.default)(this,"serialiser",void 0),this.serialiser=new CP(e,r,this)}async load(){await this.cryptoStore.doTxn("readonly",[sm.IndexedDBCryptoStore.STORE_DEVICE_DATA],e=>{this.cryptoStore.getEndToEndDeviceData(e,t=>{this.hasFetched=Boolean(t&&t.devices),this.devices=t?t.devices:{},this.crossSigningInfo=t?t.crossSigningInfo||{}:{},this.deviceTrackingStatus=t?t.trackingStatus:{},this.syncToken=t?t.syncToken:null,this.userByIdentityKey={};for(const r of Object.keys(this.devices)){const i=this.devices[r];for(const s of Object.keys(i)){const o=i[s].keys["curve25519:"+s];o!==void 0&&(this.userByIdentityKey[o]=r)}}})});for(const e of Object.keys(this.deviceTrackingStatus))this.deviceTrackingStatus[e]==Mt.DownloadInProgress&&(this.deviceTrackingStatus[e]=Mt.PendingDownload)}stop(){this.saveTimer!==null&&clearTimeout(this.saveTimer)}async saveIfDirty(e=500){if(!this.dirty)return Promise.resolve(!1);const t=Date.now()+e;this.savePromiseTime&&t<this.savePromiseTime&&(clearTimeout(this.saveTimer),this.saveTimer=null,this.savePromiseTime=null);let r=this.savePromise;if(r===null&&(r=new Promise((i,s)=>{this.resolveSavePromise=i}),this.savePromise=r),this.saveTimer===null){const i=this.resolveSavePromise;this.savePromiseTime=t,this.saveTimer=setTimeout(()=>{Ae.logger.log("Saving device tracking data",this.syncToken),this.savePromiseTime=null,this.saveTimer=null,this.savePromise=null,this.resolveSavePromise=null,this.cryptoStore.doTxn("readwrite",[sm.IndexedDBCryptoStore.STORE_DEVICE_DATA],s=>{this.cryptoStore.storeEndToEndDeviceData({devices:this.devices,crossSigningInfo:this.crossSigningInfo,trackingStatus:this.deviceTrackingStatus,syncToken:this.syncToken},s)}).then(()=>{this.dirty=!1,i(!0)},s=>{Ae.logger.error("Failed to save device tracking data",this.syncToken),Ae.logger.error(s)})},e)}return r}getSyncToken(){return this.syncToken}setSyncToken(e){this.syncToken=e}downloadKeys(e,t){const r=[],i=[];if(e.forEach(s=>{const o=this.deviceTrackingStatus[s];this.keyDownloadsInProgressByUser[s]?(Ae.logger.log(`downloadKeys: already have a download in progress for ${s}: awaiting its result`),i.push(this.keyDownloadsInProgressByUser[s])):(t||o!=Mt.UpToDate)&&r.push(s)}),r.length!=0){Ae.logger.log("downloadKeys: downloading for",r);const s=this.doKeyDownload(r);i.push(s)}return i.length===0&&Ae.logger.log("downloadKeys: already have all necessary keys"),Promise.all(i).then(()=>this.getDevicesFromStore(e))}getDevicesFromStore(e){const t={};return e.map(r=>{t[r]={},(this.getStoredDevicesForUser(r)||[]).map(function(s){t[r][s.deviceId]=s})}),t}getKnownUserIds(){return Object.keys(this.devices)}getStoredDevicesForUser(e){const t=this.devices[e];if(!t)return null;const r=[];for(const i in t)t.hasOwnProperty(i)&&r.push(Ua.DeviceInfo.fromStorage(t[i],i));return r}getRawStoredDevicesForUser(e){return this.devices[e]}getStoredCrossSigningForUser(e){return this.crossSigningInfo[e]?L_.CrossSigningInfo.fromStorage(this.crossSigningInfo[e],e):null}storeCrossSigningForUser(e,t){this.crossSigningInfo[e]=t,this.dirty=!0}getStoredDevice(e,t){const r=this.devices[e];if(!(!r||!r[t]))return Ua.DeviceInfo.fromStorage(r[t],t)}getUserByIdentityKey(e,t){return e!==Vh.OLM_ALGORITHM&&e!==Vh.MEGOLM_ALGORITHM?null:this.userByIdentityKey[t]}getDeviceByIdentityKey(e,t){const r=this.getUserByIdentityKey(e,t);if(!r)return null;const i=this.devices[r];if(!i)return null;for(const s in i){if(!i.hasOwnProperty(s))continue;const o=i[s];for(const a in o.keys){if(!o.keys.hasOwnProperty(a)||a.indexOf("curve25519:")!==0)continue;if(o.keys[a]==t)return Ua.DeviceInfo.fromStorage(o,s)}}return null}storeDevicesForUser(e,t){this.setRawStoredDevicesForUser(e,t),this.dirty=!0}startTrackingDeviceList(e){if(typeof e!="string")throw new Error("userId must be a string; was "+e);this.deviceTrackingStatus[e]||(Ae.logger.log("Now tracking device list for "+e),this.deviceTrackingStatus[e]=Mt.PendingDownload,this.dirty=!0)}stopTrackingDeviceList(e){this.deviceTrackingStatus[e]&&(Ae.logger.log("No longer tracking device list for "+e),this.deviceTrackingStatus[e]=Mt.NotTracked,this.dirty=!0)}stopTrackingAllDeviceLists(){for(const e of Object.keys(this.deviceTrackingStatus))this.deviceTrackingStatus[e]=Mt.NotTracked;this.dirty=!0}invalidateUserDeviceList(e){this.deviceTrackingStatus[e]&&(Ae.logger.log("Marking device list outdated for",e),this.deviceTrackingStatus[e]=Mt.PendingDownload,this.dirty=!0)}refreshOutdatedDeviceLists(){this.saveIfDirty();const e=[];for(const t of Object.keys(this.deviceTrackingStatus))this.deviceTrackingStatus[t]==Mt.PendingDownload&&e.push(t);return this.doKeyDownload(e)}setRawStoredDevicesForUser(e,t){if(this.devices[e]!==void 0)for(const[r,i]of Object.entries(this.devices[e])){const s=i.keys["curve25519:"+r];delete this.userByIdentityKey[s]}this.devices[e]=t;for(const[r,i]of Object.entries(t)){const s=i.keys["curve25519:"+r];this.userByIdentityKey[s]=e}}setRawStoredCrossSigningForUser(e,t){this.crossSigningInfo[e]=t}doKeyDownload(e){if(e.length===0)return Promise.resolve();const t=this.serialiser.updateDevicesForUsers(e,this.syncToken).then(()=>{r(!0)},i=>{throw Ae.logger.error("Error downloading keys for "+e+":",i),r(!1),i});e.forEach(i=>{this.keyDownloadsInProgressByUser[i]=t,this.deviceTrackingStatus[i]==Mt.PendingDownload&&(this.deviceTrackingStatus[i]=Mt.DownloadInProgress)});const r=i=>{this.emit(Gh.CryptoEvent.WillUpdateDevices,e,!this.hasFetched),e.forEach(s=>{if(this.dirty=!0,this.keyDownloadsInProgressByUser[s]!==t){Ae.logger.log("Another update in the queue for",s,"- not marking up-to-date");return}delete this.keyDownloadsInProgressByUser[s],this.deviceTrackingStatus[s]==Mt.DownloadInProgress&&(i?(this.deviceTrackingStatus[s]=Mt.UpToDate,Ae.logger.log("Device list for",s,"now up to date")):this.deviceTrackingStatus[s]=Mt.PendingDownload)}),this.saveIfDirty(),this.emit(Gh.CryptoEvent.DevicesUpdated,e,!this.hasFetched),this.hasFetched=!0};return t}}ws.DeviceList=kP;class CP{constructor(e,t,r){this.baseApis=e,this.olmDevice=t,this.deviceList=r,(0,bt.default)(this,"downloadInProgress",!1),(0,bt.default)(this,"keyDownloadsQueuedByUser",{}),(0,bt.default)(this,"queuedQueryDeferred",null),(0,bt.default)(this,"syncToken",null)}updateDevicesForUsers(e,t){return e.forEach(r=>{this.keyDownloadsQueuedByUser[r]=!0}),this.queuedQueryDeferred||(this.queuedQueryDeferred=(0,md.defer)()),this.syncToken=t,this.downloadInProgress?(Ae.logger.log("Queued key download for",e),this.queuedQueryDeferred.promise):this.doQueuedQueries()}doQueuedQueries(){if(this.downloadInProgress)throw new Error("DeviceListUpdateSerialiser.doQueuedQueries called with request active");const e=Object.keys(this.keyDownloadsQueuedByUser);this.keyDownloadsQueuedByUser={};const t=this.queuedQueryDeferred;this.queuedQueryDeferred=null,Ae.logger.log("Starting key download for",e),this.downloadInProgress=!0;const r={};this.syncToken&&(r.token=this.syncToken);const i=[];for(let s=0;s<e.length;s+=this.deviceList.keyDownloadChunkSize){const o=e.slice(s,s+this.deviceList.keyDownloadChunkSize);i.push(()=>this.baseApis.downloadKeysForUsers(o,r))}return(0,md.chunkPromises)(i,3).then(async s=>{const o=Object.assign({},...s.map(c=>c.device_keys||{})),a=Object.assign({},...s.map(c=>c.master_keys||{})),l=Object.assign({},...s.map(c=>c.self_signing_keys||{})),u=Object.assign({},...s.map(c=>c.user_signing_keys||{}));for(const c of e){await(0,md.sleep)(5);try{await this.processQueryResponseForUser(c,o[c],{master:a[c],self_signing:l[c],user_signing:u[c]})}catch(g){Ae.logger.error(`Error processing keys for ${c}:`,g)}}}).then(()=>{Ae.logger.log("Completed key download for "+e),this.downloadInProgress=!1,t.resolve(),this.queuedQueryDeferred&&this.doQueuedQueries()},s=>{Ae.logger.warn("Error downloading keys for "+e+":",s),this.downloadInProgress=!1,t.reject(s)}),t.promise}async processQueryResponseForUser(e,t,r){Ae.logger.log("got device keys for "+e+":",t),Ae.logger.log("got cross-signing keys for "+e+":",r);{const i={},s=this.deviceList.getRawStoredDevicesForUser(e);s&&Object.keys(s).forEach(a=>{const l=Ua.DeviceInfo.fromStorage(s[a],a);i[a]=l}),await PP(this.olmDevice,e,i,t||{},this.baseApis.getUserId(),this.baseApis.deviceId);const o={};Object.keys(i).forEach(a=>{o[a]=i[a].toStorage()}),this.deviceList.setRawStoredDevicesForUser(e,o)}if(r&&(r.master||r.self_signing||r.user_signing)){const i=this.deviceList.getStoredCrossSigningForUser(e)||new L_.CrossSigningInfo(e);i.setKeys(r),this.deviceList.setRawStoredCrossSigningForUser(e,i.toStorage()),this.deviceList.emit(Gh.CryptoEvent.UserCrossSigningUpdated,e)}}}async function PP(n,e,t,r,i,s){let o=!1;for(const a in t)if(!!t.hasOwnProperty(a)&&!(a in r)){if(e===i&&a===s){Ae.logger.warn(`Local device ${a} missing from sync, skipping removal`);continue}Ae.logger.log("Device "+e+":"+a+" has been removed"),delete t[a],o=!0}for(const a in r){if(!r.hasOwnProperty(a))continue;const l=r[a];if(l.user_id!==e){Ae.logger.warn("Mismatched user_id "+l.user_id+" in keys from "+e+":"+a);continue}if(l.device_id!==a){Ae.logger.warn("Mismatched device_id "+l.device_id+" in keys from "+e+":"+a);continue}await MP(n,t,l)&&(o=!0)}return o}async function MP(n,e,t){if(!t.keys)return!1;const r=t.device_id,i=t.user_id,s="ed25519:"+r,o=t.keys[s];if(!o)return Ae.logger.warn("Device "+i+":"+r+" has no ed25519 key"),!1;const a=t.unsigned||{},l=t.signatures||{};try{await Vh.verifySignature(n,t,i,r,o)}catch(c){return Ae.logger.warn("Unable to verify signature on device "+i+":"+r+":"+c),!1}let u;if(r in e){if(u=e[r],u.getFingerprint()!=o)return Ae.logger.warn("Ed25519 key for device "+i+":"+r+" has changed"),!1}else e[r]=u=new Ua.DeviceInfo(r);return u.keys=t.keys||{},u.algorithms=t.algorithms||[],u.unsigned=a,u.signatures=l,!0}var To={},DP=G.exports;Object.defineProperty(To,"__esModule",{value:!0});To.EncryptionSetupOperation=To.EncryptionSetupBuilder=void 0;var En=DP(Y.exports),AP=ie,xP=Ht,UP=Dt,$P=qr,Nc=me,NP=Ps,LP=je;class BP{constructor(e,t){(0,En.default)(this,"accountDataClientAdapter",void 0),(0,En.default)(this,"crossSigningCallbacks",void 0),(0,En.default)(this,"ssssCryptoCallbacks",void 0),(0,En.default)(this,"crossSigningKeys",null),(0,En.default)(this,"keySignatures",null),(0,En.default)(this,"keyBackupInfo",null),(0,En.default)(this,"sessionBackupPrivateKey",void 0),this.accountDataClientAdapter=new KP(e),this.crossSigningCallbacks=new FP,this.ssssCryptoCallbacks=new qP(t)}addCrossSigningKeys(e,t){this.crossSigningKeys={authUpload:e,keys:t}}addSessionBackup(e){this.keyBackupInfo=e}addSessionBackupPrivateKeyToCache(e){this.sessionBackupPrivateKey=e}addKeySignature(e,t,r){this.keySignatures||(this.keySignatures={});const i=this.keySignatures[e]||{};this.keySignatures[e]=i,i[t]=r}async setAccountData(e,t){await this.accountDataClientAdapter.setAccountData(e,t)}buildOperation(){const e=this.accountDataClientAdapter.values;return new K_(e,this.crossSigningKeys,this.keyBackupInfo,this.keySignatures)}async persist(e){if(this.crossSigningKeys){const t=(0,UP.createCryptoStoreCacheCallbacks)(e.cryptoStore,e.olmDevice);for(const r of["master","self_signing","user_signing"]){AP.logger.log(`Cache ${r} cross-signing private key locally`);const i=this.crossSigningCallbacks.privateKeys.get(r);await t.storeCrossSigningKeyCache(r,i)}await e.cryptoStore.doTxn("readwrite",[$P.IndexedDBCryptoStore.STORE_ACCOUNT],r=>{e.cryptoStore.storeCrossSigningKeys(r,this.crossSigningKeys.keys)})}this.sessionBackupPrivateKey&&await e.storeSessionBackupPrivateKey(this.sessionBackupPrivateKey)}}To.EncryptionSetupBuilder=BP;class K_{constructor(e,t,r,i){this.accountData=e,this.crossSigningKeys=t,this.keyBackupInfo=r,this.keySignatures=i}async apply(e){const t=e.baseApis;if(this.crossSigningKeys){const r={};for(const[i,s]of Object.entries(this.crossSigningKeys.keys))r[i+"_key"]=s;await this.crossSigningKeys.authUpload(i=>t.uploadDeviceSigningKeys(i,r)),e.crossSigningInfo.setKeys(this.crossSigningKeys.keys)}if(this.accountData)for(const[r,i]of this.accountData)await t.setAccountData(r,i);this.keySignatures&&await t.uploadKeySignatures(this.keySignatures),this.keyBackupInfo&&(this.keyBackupInfo.version?await t.http.authedRequest(void 0,Nc.Method.Put,"/room_keys/version/"+this.keyBackupInfo.version,void 0,{algorithm:this.keyBackupInfo.algorithm,auth_data:this.keyBackupInfo.auth_data},{prefix:Nc.PREFIX_UNSTABLE}):await t.http.authedRequest(void 0,Nc.Method.Post,"/room_keys/version",void 0,this.keyBackupInfo,{prefix:Nc.PREFIX_UNSTABLE}))}}To.EncryptionSetupOperation=K_;class KP extends LP.TypedEventEmitter{constructor(e){super(),this.existingValues=e,(0,En.default)(this,"values",new Map)}getAccountDataFromServer(e){return Promise.resolve(this.getAccountData(e))}getAccountData(e){const t=this.values.get(e);if(t)return t;const r=this.existingValues[e];return r?r.getContent():null}setAccountData(e,t){const r=this.values.get(e);return this.values.set(e,t),Promise.resolve().then(()=>{const i=new xP.MatrixEvent({type:e,content:t});return this.emit(NP.ClientEvent.AccountData,i,r),{}})}}class FP{constructor(){(0,En.default)(this,"privateKeys",new Map)}getCrossSigningKeyCache(e,t){return this.getCrossSigningKey(e,t)}storeCrossSigningKeyCache(e,t){return this.privateKeys.set(e,t),Promise.resolve()}getCrossSigningKey(e,t){return Promise.resolve(this.privateKeys.get(e))}saveCrossSigningKeys(e){for(const[t,r]of Object.entries(e))this.privateKeys.set(t,r)}}class qP{constructor(e){this.delegateCryptoCallbacks=e,(0,En.default)(this,"privateKeys",new Map)}async getSecretStorageKey({keys:e},t){var r;for(const i of Object.keys(e)){const s=this.privateKeys.get(i);if(s)return[i,s]}if(this!==null&&this!==void 0&&(r=this.delegateCryptoCallbacks)!==null&&r!==void 0&&r.getSecretStorageKey){const i=await this.delegateCryptoCallbacks.getSecretStorageKey({keys:e},t);if(i){const[s,o]=i;this.privateKeys.set(s,o)}return i}return null}addPrivateKey(e,t,r){var i,s;this.privateKeys.set(e,r),(i=this.delegateCryptoCallbacks)===null||i===void 0||(s=i.cacheSecretStorageKey)===null||s===void 0||s.call(i,e,t,r)}}var Oo={},jP=G.exports;Object.defineProperty(Oo,"__esModule",{value:!0});Oo.SecretStorage=Oo.SECRET_STORAGE_ALGORITHM_V1_AES=void 0;var VP=jP(Y.exports),un=ie,ia=WP(De),GP=li,Lc=di,yd=Ps;function F_(n){if(typeof WeakMap!="function")return null;var e=new WeakMap,t=new WeakMap;return(F_=function(r){return r?t:e})(n)}function WP(n,e){if(!e&&n&&n.__esModule)return n;if(n===null||typeof n!="object"&&typeof n!="function")return{default:n};var t=F_(e);if(t&&t.has(n))return t.get(n);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in n)if(s!=="default"&&Object.prototype.hasOwnProperty.call(n,s)){var o=i?Object.getOwnPropertyDescriptor(n,s):null;o&&(o.get||o.set)?Object.defineProperty(r,s,o):r[s]=n[s]}return r.default=n,t&&t.set(n,r),r}const ns="m.secret_storage.v1.aes-hmac-sha2";Oo.SECRET_STORAGE_ALGORITHM_V1_AES=ns;class HP{constructor(e,t,r){this.accountDataAdapter=e,this.cryptoCallbacks=t,this.baseApis=r,(0,VP.default)(this,"requests",new Map)}async getDefaultKeyId(){const e=await this.accountDataAdapter.getAccountDataFromServer("m.secret_storage.default_key");return e?e.key:null}setDefaultKeyId(e){return new Promise((t,r)=>{const i=s=>{s.getType()==="m.secret_storage.default_key"&&s.getContent().key===e&&(this.accountDataAdapter.removeListener(yd.ClientEvent.AccountData,i),t())};this.accountDataAdapter.on(yd.ClientEvent.AccountData,i),this.accountDataAdapter.setAccountData("m.secret_storage.default_key",{key:e}).catch(s=>{this.accountDataAdapter.removeListener(yd.ClientEvent.AccountData,i),r(s)})})}async addKey(e,t,r){const i={algorithm:e};if(t||(t={}),t.name&&(i.name=t.name),e===ns){if(t.passphrase&&(i.passphrase=t.passphrase),t.key){const{iv:s,mac:o}=await(0,Lc.calculateKeyCheck)(t.key);i.iv=s,i.mac=o}}else throw new Error(`Unknown key algorithm ${e}`);if(!r)do r=(0,GP.randomString)(32);while(await this.accountDataAdapter.getAccountDataFromServer(`m.secret_storage.key.${r}`));return await this.accountDataAdapter.setAccountData(`m.secret_storage.key.${r}`,i),{keyId:r,keyInfo:i}}async getKey(e){if(e||(e=await this.getDefaultKeyId()),!e)return null;const t=await this.accountDataAdapter.getAccountDataFromServer("m.secret_storage.key."+e);return t?[e,t]:null}async hasKey(e){return Boolean(await this.getKey(e))}async checkKey(e,t){if(t.algorithm===ns)if(t.mac){const{mac:r}=await(0,Lc.calculateKeyCheck)(e,t.iv);return t.mac.replace(/=+$/g,"")===r.replace(/=+$/g,"")}else return!0;else throw new Error("Unknown algorithm")}async store(e,t,r){const i={};if(!r){const s=await this.getDefaultKeyId();if(!s)throw new Error("No keys specified and no default key present");r=[s]}if(r.length===0)throw new Error("Zero keys given to encrypt with!");for(const s of r){const o=await this.accountDataAdapter.getAccountDataFromServer("m.secret_storage.key."+s);if(!o)throw new Error("Unknown key: "+s);if(o.algorithm===ns){const a={[s]:o},[,l]=await this.getSecretStorageKey(a,e);i[s]=await l.encrypt(t)}else un.logger.warn("unknown algorithm for secret storage key "+s+": "+o.algorithm)}await this.accountDataAdapter.setAccountData(e,{encrypted:i})}async get(e){const t=await this.accountDataAdapter.getAccountDataFromServer(e);if(!t)return;if(!t.encrypted)throw new Error("Content is not encrypted!");const r={};for(const o of Object.keys(t.encrypted)){const a=await this.accountDataAdapter.getAccountDataFromServer("m.secret_storage.key."+o),l=t.encrypted[o];a.algorithm===ns&&l.iv&&l.ciphertext&&l.mac&&(r[o]=a)}if(Object.keys(r).length===0)throw new Error(`Could not decrypt ${e} because none of the keys it is encrypted with are for a supported algorithm`);let i,s;try{[i,s]=await this.getSecretStorageKey(r,e);const o=t.encrypted[i];return o.passthrough?(0,ia.encodeBase64)(s.get_private_key()):await s.decrypt(o)}finally{s&&s.free&&s.free()}}async isStored(e,t){const r=await this.accountDataAdapter.getAccountDataFromServer(e);if(!r||!r.encrypted)return null;const i={};for(const s of Object.keys(r.encrypted)){const o=await this.accountDataAdapter.getAccountDataFromServer("m.secret_storage.key."+s);if(!o)continue;const a=r.encrypted[s];o.algorithm===ns&&a.iv&&a.ciphertext&&a.mac&&(i[s]=o)}return Object.keys(i).length?i:null}request(e,t){const r=this.baseApis.makeTxnId();let i,s;const o=new Promise((c,g)=>{i=c,s=g});this.requests.set(r,{name:e,devices:t,resolve:i,reject:s});const a=c=>{const g={action:"request_cancellation",requesting_device_id:this.baseApis.deviceId,request_id:r},m={};for(const f of t)m[f]=g;this.baseApis.sendToDevice("m.secret.request",{[this.baseApis.getUserId()]:m}),s(new Error(c||"Cancelled"))},l={name:e,action:"request",requesting_device_id:this.baseApis.deviceId,request_id:r},u={};for(const c of t)u[c]=l;return un.logger.info(`Request secret ${e} from ${t}, id ${r}`),this.baseApis.sendToDevice("m.secret.request",{[this.baseApis.getUserId()]:u}),{requestId:r,promise:o,cancel:a}}async onRequestReceived(e){const t=e.getSender(),r=e.getContent();if(t!==this.baseApis.getUserId()||!(r.name&&r.action&&r.requesting_device_id&&r.request_id))return;const i=r.requesting_device_id;if(r.action!=="request_cancellation"){if(r.action==="request"){if(i===this.baseApis.deviceId||(un.logger.info("received request for secret ("+t+", "+i+", "+r.request_id+")"),!this.cryptoCallbacks.onSecretRequested))return;const s=await this.cryptoCallbacks.onSecretRequested(t,i,r.request_id,r.name,this.baseApis.checkDeviceTrust(t,i));if(s){un.logger.info(`Preparing ${r.name} secret for ${i}`);const o={type:"m.secret.send",content:{request_id:r.request_id,secret:s}},a={algorithm:ia.OLM_ALGORITHM,sender_key:this.baseApis.crypto.olmDevice.deviceCurve25519Key,ciphertext:{}};await ia.ensureOlmSessionsForDevices(this.baseApis.crypto.olmDevice,this.baseApis,{[t]:[this.baseApis.getStoredDevice(t,i)]}),await ia.encryptMessageForDevice(a.ciphertext,this.baseApis.getUserId(),this.baseApis.deviceId,this.baseApis.crypto.olmDevice,t,this.baseApis.getStoredDevice(t,i),o);const l={[t]:{[i]:a}};un.logger.info(`Sending ${r.name} secret for ${i}`),this.baseApis.sendToDevice("m.room.encrypted",l)}else un.logger.info(`Request denied for ${r.name} secret for ${i}`)}}}onSecretReceived(e){if(e.getSender()!==this.baseApis.getUserId())return;const t=e.getContent();un.logger.log("got secret share for request",t.request_id);const r=this.requests.get(t.request_id);if(r){const i=this.baseApis.crypto.deviceList.getDeviceByIdentityKey(ia.OLM_ALGORITHM,e.getSenderKey());if(!i){un.logger.log("secret share from unknown device with key",e.getSenderKey());return}if(!r.devices.includes(i.deviceId)){un.logger.log("unsolicited secret share from device",i.deviceId);return}un.logger.log(`Successfully received secret ${r.name} from ${i.deviceId}`),r.resolve(t.secret)}}async getSecretStorageKey(e,t){if(!this.cryptoCallbacks.getSecretStorageKey)throw new Error("No getSecretStorageKey callback supplied");const r=await this.cryptoCallbacks.getSecretStorageKey({keys:e},t);if(!r)throw new Error("getSecretStorageKey callback returned falsey");if(r.length<2)throw new Error("getSecretStorageKey callback returned invalid data");const[i,s]=r;if(!e[i])throw new Error("App returned unknown key from getSecretStorageKey!");if(e[i].algorithm===ns)return[i,{encrypt:async function(a){return await(0,Lc.encryptAES)(a,s,t)},decrypt:async function(a){return await(0,Lc.decryptAES)(a,s,t)}}];throw new Error("Unknown key type: "+e[i].algorithm)}}Oo.SecretStorage=HP;var Rs={},YP=G.exports;Object.defineProperty(Rs,"__esModule",{value:!0});Rs.RoomKeyRequestState=Rs.OutgoingRoomKeyRequestManager=void 0;var vd=YP(Y.exports),$n=ie,zP=ne;const JP=500;let _e;Rs.RoomKeyRequestState=_e;(function(n){n[n.Unsent=0]="Unsent",n[n.Sent=1]="Sent",n[n.CancellationPending=2]="CancellationPending",n[n.CancellationPendingAndWillResend=3]="CancellationPendingAndWillResend"})(_e||(Rs.RoomKeyRequestState=_e={}));class XP{constructor(e,t,r){this.baseApis=e,this.deviceId=t,this.cryptoStore=r,(0,vd.default)(this,"sendOutgoingRoomKeyRequestsTimer",null),(0,vd.default)(this,"sendOutgoingRoomKeyRequestsRunning",!1),(0,vd.default)(this,"clientRunning",!1)}start(){this.clientRunning=!0}stop(){$n.logger.log("stopping OutgoingRoomKeyRequestManager"),this.clientRunning=!1}sendQueuedRequests(){this.startTimer()}async queueRoomKeyRequest(e,t,r=!1){const i=await this.cryptoStore.getOutgoingRoomKeyRequest(e);if(!i)await this.cryptoStore.getOrAddOutgoingRoomKeyRequest({requestBody:e,recipients:t,requestId:this.baseApis.makeTxnId(),state:_e.Unsent});else switch(i.state){case _e.CancellationPendingAndWillResend:case _e.Unsent:return;case _e.CancellationPending:{const s=r?_e.CancellationPendingAndWillResend:_e.Sent;await this.cryptoStore.updateOutgoingRoomKeyRequest(i.requestId,_e.CancellationPending,{state:s,cancellationTxnId:this.baseApis.makeTxnId()});break}case _e.Sent:{if(r){const s=_e.CancellationPendingAndWillResend,o=await this.cryptoStore.updateOutgoingRoomKeyRequest(i.requestId,_e.Sent,{state:s,cancellationTxnId:this.baseApis.makeTxnId(),requestTxnId:this.baseApis.makeTxnId()});if(!o)return await this.queueRoomKeyRequest(e,t,r);try{await this.sendOutgoingRoomKeyRequestCancellation(o,!0)}catch(a){$n.logger.error("Error sending room key request cancellation; will retry later.",a)}}break}default:throw new Error("unhandled state: "+i.state)}}cancelRoomKeyRequest(e){return this.cryptoStore.getOutgoingRoomKeyRequest(e).then(t=>{if(!!t)switch(t.state){case _e.CancellationPending:case _e.CancellationPendingAndWillResend:return;case _e.Unsent:return $n.logger.log("deleting unnecessary room key request for "+Bc(e)),this.cryptoStore.deleteOutgoingRoomKeyRequest(t.requestId,_e.Unsent);case _e.Sent:return this.cryptoStore.updateOutgoingRoomKeyRequest(t.requestId,_e.Sent,{state:_e.CancellationPending,cancellationTxnId:this.baseApis.makeTxnId()}).then(r=>{if(!r){$n.logger.log("Tried to cancel room key request for "+Bc(e)+" but it was already cancelled in another tab");return}this.sendOutgoingRoomKeyRequestCancellation(r).catch(i=>{$n.logger.error("Error sending room key request cancellation; will retry later.",i),this.startTimer()})});default:throw new Error("unhandled state: "+t.state)}})}getOutgoingSentRoomKeyRequest(e,t){return this.cryptoStore.getOutgoingRoomKeyRequestsByTarget(e,t,[_e.Sent])}async cancelAndResendAllOutgoingRequests(){const e=await this.cryptoStore.getAllOutgoingRoomKeyRequestsByState(_e.Sent);return Promise.all(e.map(({requestBody:t,recipients:r})=>this.queueRoomKeyRequest(t,r,!0)))}startTimer(){if(this.sendOutgoingRoomKeyRequestsTimer)return;const e=()=>{if(this.sendOutgoingRoomKeyRequestsRunning)throw new Error("RoomKeyRequestSend already in progress!");this.sendOutgoingRoomKeyRequestsRunning=!0,this.sendOutgoingRoomKeyRequests().finally(()=>{this.sendOutgoingRoomKeyRequestsRunning=!1}).catch(t=>{$n.logger.warn(`error in OutgoingRoomKeyRequestManager: ${t}`)})};this.sendOutgoingRoomKeyRequestsTimer=setTimeout(e,JP)}sendOutgoingRoomKeyRequests(){return this.clientRunning?this.cryptoStore.getOutgoingRoomKeyRequestByState([_e.CancellationPending,_e.CancellationPendingAndWillResend,_e.Unsent]).then(e=>{if(!e){this.sendOutgoingRoomKeyRequestsTimer=null;return}let t;switch(e.state){case _e.Unsent:t=this.sendOutgoingRoomKeyRequest(e);break;case _e.CancellationPending:t=this.sendOutgoingRoomKeyRequestCancellation(e);break;case _e.CancellationPendingAndWillResend:t=this.sendOutgoingRoomKeyRequestCancellation(e,!0);break}return t.then(()=>this.sendOutgoingRoomKeyRequests()).catch(r=>{$n.logger.error("Error sending room key request; will retry later.",r),this.sendOutgoingRoomKeyRequestsTimer=null})}):(this.sendOutgoingRoomKeyRequestsTimer=null,Promise.resolve())}sendOutgoingRoomKeyRequest(e){$n.logger.log(`Requesting keys for ${Bc(e.requestBody)} from ${om(e.recipients)}(id ${e.requestId})`);const t={action:"request",requesting_device_id:this.deviceId,request_id:e.requestId,body:e.requestBody};return this.sendMessageToDevices(t,e.recipients,e.requestTxnId||e.requestId).then(()=>this.cryptoStore.updateOutgoingRoomKeyRequest(e.requestId,_e.Unsent,{state:_e.Sent}))}sendOutgoingRoomKeyRequestCancellation(e,t=!1){$n.logger.log(`Sending cancellation for key request for ${Bc(e.requestBody)} to ${om(e.recipients)} (cancellation id ${e.cancellationTxnId})`);const r={action:"request_cancellation",requesting_device_id:this.deviceId,request_id:e.requestId};return this.sendMessageToDevices(r,e.recipients,e.cancellationTxnId).then(()=>t?this.cryptoStore.updateOutgoingRoomKeyRequest(e.requestId,_e.CancellationPendingAndWillResend,{state:_e.Unsent}):this.cryptoStore.deleteOutgoingRoomKeyRequest(e.requestId,_e.CancellationPending))}sendMessageToDevices(e,t,r){const i={};for(const s of t)i[s.userId]||(i[s.userId]={}),i[s.userId][s.deviceId]=e;return this.baseApis.sendToDevice(zP.EventType.RoomKeyRequest,i,r)}}Rs.OutgoingRoomKeyRequestManager=XP;function Bc(n){return n.room_id+" / "+n.session_id}function om(n){return"["+n.map(e=>`${e.userId}:${e.deviceId}`).join(",")+"]"}var dr={},Zr={},Le={};Object.defineProperty(Le,"__esModule",{value:!0});Le.errorFactory=hi;Le.errorFromEvent=aM;Le.newUserMismatchError=Le.newUserCancelledError=Le.newUnknownTransactionError=Le.newUnknownMethodError=Le.newUnexpectedMessageError=Le.newTimeoutError=Le.newKeyMismatchError=Le.newInvalidMessageError=void 0;Le.newVerificationError=q_;var QP=Ht;function q_(n,e,t){const r=Object.assign({},{code:n,reason:e},t);return new QP.MatrixEvent({type:"m.key.verification.cancel",content:r})}function hi(n,e){return function(t){return q_(n,e,t)}}const ZP=hi("m.user","Cancelled by user");Le.newUserCancelledError=ZP;const eM=hi("m.timeout","Timed out");Le.newTimeoutError=eM;const tM=hi("m.unknown_transaction","Unknown transaction");Le.newUnknownTransactionError=tM;const rM=hi("m.unknown_method","Unknown method");Le.newUnknownMethodError=rM;const nM=hi("m.unexpected_message","Unexpected message");Le.newUnexpectedMessageError=nM;const iM=hi("m.key_mismatch","Key mismatch");Le.newKeyMismatchError=iM;const sM=hi("m.user_error","User mismatch");Le.newUserMismatchError=sM;const oM=hi("m.invalid_message","Invalid message");Le.newInvalidMessageError=oM;function aM(n){const e=n.getContent();if(e){const{code:t,reason:r}=e;return{code:t,reason:r}}else return{code:"Unknown error",reason:"m.unknown"}}var cM=G.exports;Object.defineProperty(Zr,"__esModule",{value:!0});Zr.VerificationEvent=Zr.VerificationBase=Zr.SwitchStartEventError=void 0;var Hr=cM(Y.exports),lM=Ht,sa=ie,uM=Us,dM=Le,hM=Dt,fM=je;const am=new Error("Verification timed out");class j_ extends Error{constructor(e){super(),this.startEvent=e}}Zr.SwitchStartEventError=j_;let $l;Zr.VerificationEvent=$l;(function(n){n.Cancel="cancel"})($l||(Zr.VerificationEvent=$l={}));class pM extends fM.TypedEventEmitter{constructor(e,t,r,i,s,o){super(),this.channel=e,this.baseApis=t,this.userId=r,this.deviceId=i,this.startEvent=s,this.request=o,(0,Hr.default)(this,"cancelled",!1),(0,Hr.default)(this,"_done",!1),(0,Hr.default)(this,"promise",null),(0,Hr.default)(this,"transactionTimeoutTimer",null),(0,Hr.default)(this,"expectedEvent",void 0),(0,Hr.default)(this,"resolve",void 0),(0,Hr.default)(this,"reject",void 0),(0,Hr.default)(this,"resolveEvent",void 0),(0,Hr.default)(this,"rejectEvent",void 0),(0,Hr.default)(this,"started",void 0),(0,Hr.default)(this,"doVerification",void 0)}get initiatedByMe(){if(!this.startEvent)return!0;const e=this.startEvent.getSender(),t=this.startEvent.getContent();return e===this.baseApis.getUserId()&&t.from_device===this.baseApis.getDeviceId()}get hasBeenCancelled(){return this.cancelled}resetTimer(){sa.logger.info("Refreshing/starting the verification transaction timeout timer"),this.transactionTimeoutTimer!==null&&clearTimeout(this.transactionTimeoutTimer),this.transactionTimeoutTimer=setTimeout(()=>{!this._done&&!this.cancelled&&(sa.logger.info("Triggering verification timeout"),this.cancel(am))},10*60*1e3)}endTimer(){this.transactionTimeoutTimer!==null&&(clearTimeout(this.transactionTimeoutTimer),this.transactionTimeoutTimer=null)}send(e,t){return this.channel.send(e,t)}waitForEvent(e){if(this._done)return Promise.reject(new Error("Verification is already done"));const t=this.request.getEventFromOtherParty(e);return t?Promise.resolve(t):(this.expectedEvent=e,new Promise((r,i)=>{this.resolveEvent=r,this.rejectEvent=i}))}canSwitchStartEvent(e){return!1}switchStartEvent(e){if(this.canSwitchStartEvent(e))if(sa.logger.log("Verification Base: switching verification start event",{restartingFlow:!!this.rejectEvent}),this.rejectEvent){const t=this.rejectEvent;this.rejectEvent=void 0,t(new j_(e))}else this.startEvent=e}handleEvent(e){if(!this._done){if(e.getType()===this.expectedEvent)this.expectedEvent!=="m.key.verification.done"&&(this.expectedEvent=void 0,this.rejectEvent=void 0,this.resetTimer(),this.resolveEvent(e));else if(e.getType()==="m.key.verification.cancel"){const t=this.reject;if(this.reject=void 0,t){const r=e.getContent(),{reason:i,code:s}=r;t(new Error(`Other side cancelled verification because ${i} (${s})`))}}else if(this.expectedEvent){const t=new Error("Unexpected message: expecting "+this.expectedEvent+" but got "+e.getType());if(this.expectedEvent=void 0,this.rejectEvent){const r=this.rejectEvent;this.rejectEvent=void 0,r(t)}this.cancel(t)}}}done(){if(this.endTimer(),!this._done)return this.request.onVerifierFinished(),this.resolve(),(0,hM.requestKeysDuringVerification)(this.baseApis,this.userId,this.deviceId)}cancel(e){if(this.endTimer(),!this._done){if(this.cancelled=!0,this.request.onVerifierCancelled(),this.userId&&this.deviceId)if(e===am){const t=(0,dM.newTimeoutError)();this.send(t.getType(),t.getContent())}else if(e instanceof lM.MatrixEvent){if(e.getSender()!==this.userId){const r=e.getContent();e.getType()==="m.key.verification.cancel"?(r.code=r.code||"m.unknown",r.reason=r.reason||r.body||"Unknown reason",this.send("m.key.verification.cancel",r)):this.send("m.key.verification.cancel",{code:"m.unknown",reason:r.body||"Unknown reason"})}}else this.send("m.key.verification.cancel",{code:"m.unknown",reason:e.toString()});this.promise!==null?this.reject&&this.reject(e):this.promise=Promise.reject(e),this.emit($l.Cancel,e)}}verify(){return this.promise?this.promise:(this.promise=new Promise((e,t)=>{this.resolve=(...r)=>{this._done=!0,this.endTimer(),e(...r)},this.reject=r=>{this._done=!0,this.endTimer(),t(r)}}),this.doVerification&&!this.started&&(this.started=!0,this.resetTimer(),Promise.resolve(this.doVerification()).then(this.done.bind(this),this.cancel.bind(this))),this.promise)}async verifyKeys(e,t,r){const i=[];for(const[s,o]of Object.entries(t)){const a=s.split(":",2)[1],l=this.baseApis.getStoredDevice(e,a);if(l)r(s,l,o),i.push(a);else{const u=this.baseApis.crypto.deviceList.getStoredCrossSigningForUser(e);u&&u.getId()===a?(r(s,uM.DeviceInfo.fromStorage({keys:{[s]:a}},a),o),i.push(a)):sa.logger.warn(`verification: Could not find device ${a} to verify`)}}if(!i.length)throw new Error("No devices could be verified");sa.logger.info("Verification completed! Marking devices verified: ",i);for(const s of i)await this.baseApis.setDeviceVerified(e,s)}get events(){}}Zr.VerificationBase=pM;var gM=G.exports;Object.defineProperty(dr,"__esModule",{value:!0});dr.SHOW_QR_CODE_METHOD=dr.SCAN_QR_CODE_METHOD=dr.ReciprocateQRCode=dr.QrCodeEvent=dr.QRCodeData=void 0;var cm=gM(Y.exports),mM=Zr,Ys=Le,lm=De,um=ie;const yM="m.qr_code.show.v1";dr.SHOW_QR_CODE_METHOD=yM;const vM="m.qr_code.scan.v1";dr.SCAN_QR_CODE_METHOD=vM;let Nl;dr.QrCodeEvent=Nl;(function(n){n.ShowReciprocateQr="show_reciprocate_qr"})(Nl||(dr.QrCodeEvent=Nl={}));class $f extends mM.VerificationBase{constructor(...e){super(...e),(0,cm.default)(this,"reciprocateQREvent",void 0),(0,cm.default)(this,"doVerification",async()=>{if(!this.startEvent)throw new Error("It is not currently possible to start verificationwith this method yet.");const{qrCodeData:t}=this.request;if(this.startEvent.getContent().secret!==t.encodedSharedSecret)throw(0,Ys.newKeyMismatchError)();await new Promise((i,s)=>{this.reciprocateQREvent={confirm:i,cancel:()=>s((0,Ys.newUserCancelledError)())},this.emit(Nl.ShowReciprocateQr,this.reciprocateQREvent)});const r={};switch(t.mode){case cr.VerifyOtherUser:{const i=t.otherUserMasterKey;r[`ed25519:${i}`]=i;break}case cr.VerifySelfTrusted:{const i=this.request.targetDevice.deviceId;r[`ed25519:${i}`]=t.otherDeviceKey;break}case cr.VerifySelfUntrusted:{const i=t.myMasterKey;r[`ed25519:${i}`]=i;break}}await this.verifyKeys(this.userId,r,(i,s,o)=>{const a=r[i];if(!a)throw(0,Ys.newKeyMismatchError)();if(o!==a)throw um.logger.error("key ID from key info does not match"),(0,Ys.newKeyMismatchError)();for(const l in s.keys){if(!l.startsWith("ed25519"))continue;const u=r[l];if(!u)throw(0,Ys.newKeyMismatchError)();if(s.keys[l]!==u)throw um.logger.error("master key does not match"),(0,Ys.newKeyMismatchError)()}})})}static factory(e,t,r,i,s,o){return new $f(e,t,r,i,s,o)}static get NAME(){return"m.reciprocate.v1"}}dr.ReciprocateQRCode=$f;const _M=2,EM="MATRIX";var cr;(function(n){n[n.VerifyOtherUser=0]="VerifyOtherUser",n[n.VerifySelfTrusted=1]="VerifySelfTrusted",n[n.VerifySelfUntrusted=2]="VerifySelfUntrusted"})(cr||(cr={}));class Ai{constructor(e,t,r,i,s,o){this.mode=e,this.sharedSecret=t,this.otherUserMasterKey=r,this.otherDeviceKey=i,this.myMasterKey=s,this.buffer=o}static async create(e,t){const r=Ai.generateSharedSecret(),i=Ai.determineMode(e,t);let s=null,o=null,a=null;if(i===cr.VerifyOtherUser)s=t.getStoredCrossSigningForUser(e.otherUserId).getId("master");else if(i===cr.VerifySelfTrusted)o=await Ai.getOtherDeviceKey(e,t);else if(i===cr.VerifySelfUntrusted){const c=t.getUserId();a=t.getStoredCrossSigningForUser(c).getId("master")}const l=Ai.generateQrData(e,t,i,r,s,o,a),u=Ai.generateBuffer(l);return new Ai(i,r,s,o,a,u)}get encodedSharedSecret(){return this.sharedSecret}getBuffer(){return this.buffer}static generateSharedSecret(){const e=new Uint8Array(11);return V.crypto.getRandomValues(e),(0,lm.encodeUnpaddedBase64)(e)}static async getOtherDeviceKey(e,t){const r=t.getUserId(),i=e.targetDevice,s=i?i.deviceId:null,o=t.getStoredDevice(r,s);if(!o)throw new Error("could not find device "+s);return o.getFingerprint()}static determineMode(e,t){const r=t.getUserId(),i=e.otherUserId;let s=cr.VerifyOtherUser;return r===i&&(t.checkUserTrust(r).isCrossSigningVerified()?s=cr.VerifySelfTrusted:s=cr.VerifySelfUntrusted),s}static generateQrData(e,t,r,i,s,o,a){const l=t.getUserId(),u=e.channel.transactionId,c={prefix:EM,version:_M,mode:r,transactionId:u,firstKeyB64:"",secondKeyB64:"",secretB64:i},g=t.getStoredCrossSigningForUser(l);return r===cr.VerifyOtherUser?(c.firstKeyB64=g.getId("master"),c.secondKeyB64=s):r===cr.VerifySelfTrusted?(c.firstKeyB64=g.getId("master"),c.secondKeyB64=o):r===cr.VerifySelfUntrusted&&(c.firstKeyB64=t.getDeviceEd25519Key(),c.secondKeyB64=a),c}static generateBuffer(e){let t=Buffer.alloc(0);const r=a=>{const l=Buffer.from([a]);t=Buffer.concat([t,l])},i=a=>{const l=Buffer.alloc(2);l.writeInt16BE(a,0),t=Buffer.concat([t,l])},s=(a,l,u=!0)=>{const c=Buffer.from(a,l);u&&i(c.byteLength),t=Buffer.concat([t,c])},o=a=>{const l=(0,lm.decodeBase64)(a),u=Buffer.from(l);t=Buffer.concat([t,u])};return s(e.prefix,"ascii",!1),r(e.version),r(e.mode),s(e.transactionId,"utf-8"),o(e.firstKeyB64),o(e.secondKeyB64),o(e.secretB64),t}}dr.QRCodeData=Ai;var Is={},V_=G.exports;Object.defineProperty(Is,"__esModule",{value:!0});Is.SasEvent=Is.SAS=void 0;var oa=V_(Y.exports),dm=V_(cu),_d=Zr,qn=Le,SM=ie;const Ed="m.key.verification.start",bM=["m.key.verification.accept","m.key.verification.key","m.key.verification.mac"];let Kc;const hm=(0,qn.errorFactory)("m.mismatched_sas","Mismatched short authentication string"),wM=(0,qn.errorFactory)("m.mismatched_commitment","Mismatched commitment");function RM(n){return[(n[0]<<5|n[1]>>3)+1e3,((n[1]&7)<<10|n[2]<<2|n[3]>>6)+1e3,((n[3]&63)<<7|n[4]>>1)+1e3]}const IM=[["\u{1F436}","dog"],["\u{1F431}","cat"],["\u{1F981}","lion"],["\u{1F40E}","horse"],["\u{1F984}","unicorn"],["\u{1F437}","pig"],["\u{1F418}","elephant"],["\u{1F430}","rabbit"],["\u{1F43C}","panda"],["\u{1F413}","rooster"],["\u{1F427}","penguin"],["\u{1F422}","turtle"],["\u{1F41F}","fish"],["\u{1F419}","octopus"],["\u{1F98B}","butterfly"],["\u{1F337}","flower"],["\u{1F333}","tree"],["\u{1F335}","cactus"],["\u{1F344}","mushroom"],["\u{1F30F}","globe"],["\u{1F319}","moon"],["\u2601\uFE0F","cloud"],["\u{1F525}","fire"],["\u{1F34C}","banana"],["\u{1F34E}","apple"],["\u{1F353}","strawberry"],["\u{1F33D}","corn"],["\u{1F355}","pizza"],["\u{1F382}","cake"],["\u2764\uFE0F","heart"],["\u{1F642}","smiley"],["\u{1F916}","robot"],["\u{1F3A9}","hat"],["\u{1F453}","glasses"],["\u{1F527}","spanner"],["\u{1F385}","santa"],["\u{1F44D}","thumbs up"],["\u2602\uFE0F","umbrella"],["\u231B","hourglass"],["\u23F0","clock"],["\u{1F381}","gift"],["\u{1F4A1}","light bulb"],["\u{1F4D5}","book"],["\u270F\uFE0F","pencil"],["\u{1F4CE}","paperclip"],["\u2702\uFE0F","scissors"],["\u{1F512}","lock"],["\u{1F511}","key"],["\u{1F528}","hammer"],["\u260E\uFE0F","telephone"],["\u{1F3C1}","flag"],["\u{1F682}","train"],["\u{1F6B2}","bicycle"],["\u2708\uFE0F","aeroplane"],["\u{1F680}","rocket"],["\u{1F3C6}","trophy"],["\u26BD","ball"],["\u{1F3B8}","guitar"],["\u{1F3BA}","trumpet"],["\u{1F514}","bell"],["\u2693\uFE0F","anchor"],["\u{1F3A7}","headphones"],["\u{1F4C1}","folder"],["\u{1F4CC}","pin"]];function TM(n){return[n[0]>>2,(n[0]&3)<<4|n[1]>>4,(n[1]&15)<<2|n[2]>>6,n[2]&63,n[3]>>2,(n[3]&3)<<4|n[4]>>4,(n[4]&15)<<2|n[5]>>6].map(t=>IM[t])}const Wh={decimal:RM,emoji:TM};function fm(n,e){const t={};for(const r of e)r in Wh&&(t[r]=Wh[r](n));return t}const OM={"hkdf-hmac-sha256":"calculate_mac","hmac-sha256":"calculate_mac_long_kdf"};function aa(n,e){return function(...t){const i=n[OM[e]].apply(n,t);return SM.logger.log("SAS calculateMAC:",e,t,i),i}}const pm={"curve25519-hkdf-sha256":function(n,e,t){const r=`${n.baseApis.getUserId()}|${n.baseApis.deviceId}|${n.ourSASPubKey}|`,i=`${n.userId}|${n.deviceId}|${n.theirSASPubKey}|`,s="MATRIX_KEY_VERIFICATION_SAS|"+(n.initiatedByMe?r+i:i+r)+n.channel.transactionId;return e.generate_bytes(s,t)},curve25519:function(n,e,t){const r=`${n.baseApis.getUserId()}${n.baseApis.deviceId}`,i=`${n.userId}${n.deviceId}`,s="MATRIX_KEY_VERIFICATION_SAS"+(n.initiatedByMe?r+i:i+r)+n.channel.transactionId;return e.generate_bytes(s,t)}},Hh=["curve25519-hkdf-sha256","curve25519"],Yh=["sha256"],zh=["hkdf-hmac-sha256","hmac-sha256"],G_=Object.keys(Wh),kM=new Set(Hh),CM=new Set(Yh),PM=new Set(zh),gm=new Set(G_);function ca(n,e){return n instanceof Array?n.filter(t=>e.has(t)):[]}let Ja;Is.SasEvent=Ja;(function(n){n.ShowSas="show_sas"})(Ja||(Is.SasEvent=Ja={}));class Ll extends _d.VerificationBase{constructor(...e){super(...e),(0,oa.default)(this,"waitingForAccept",void 0),(0,oa.default)(this,"ourSASPubKey",void 0),(0,oa.default)(this,"theirSASPubKey",void 0),(0,oa.default)(this,"sasEvent",void 0),(0,oa.default)(this,"doVerification",async()=>{await V.Olm.init(),Kc=Kc||new V.Olm.Utility,await this.baseApis.downloadKeys([this.userId]);let t=!1;do try{return this.initiatedByMe?await this.doSendVerification():await this.doRespondVerification()}catch(r){if(r instanceof _d.SwitchStartEventError)this.startEvent=r.startEvent,t=!0;else throw r}while(t)})}static get NAME(){return"m.sas.v1"}get events(){return bM}canSwitchStartEvent(e){if(e.getType()!==Ed)return!1;const t=e.getContent();return t&&t.method===Ll.NAME&&this.waitingForAccept}async sendStart(){const e=this.channel.completeContent(Ed,{method:Ll.NAME,from_device:this.baseApis.deviceId,key_agreement_protocols:Hh,hashes:Yh,message_authentication_codes:zh,short_authentication_string:G_});return await this.channel.sendCompleted(Ed,e),e}async doSendVerification(){this.waitingForAccept=!0;let e;if(this.startEvent?e=this.channel.completedContentFromEvent(this.startEvent):e=await this.sendStart(),!this.initiatedByMe)throw new _d.SwitchStartEventError(this.startEvent);let t;try{t=await this.waitForEvent("m.key.verification.accept")}finally{this.waitingForAccept=!1}let r=t.getContent();const i=ca(r.short_authentication_string,gm);if(!(kM.has(r.key_agreement_protocol)&&CM.has(r.hash)&&PM.has(r.message_authentication_code)&&i.length))throw(0,qn.newUnknownMethodError)();if(typeof r.commitment!="string")throw(0,qn.newInvalidMessageError)();const s=r.key_agreement_protocol,o=r.message_authentication_code,a=r.commitment,l=new V.Olm.SAS;try{this.ourSASPubKey=l.get_pubkey(),await this.send("m.key.verification.key",{key:this.ourSASPubKey}),t=await this.waitForEvent("m.key.verification.key"),r=t.getContent();const u=r.key+dm.default.stringify(e);if(Kc.sha256(u)!==a)throw wM();this.theirSASPubKey=r.key,l.set_their_key(r.key);const c=pm[s](this,l,6),g=new Promise((m,f)=>{this.sasEvent={sas:fm(c,i),confirm:async()=>{try{await this.sendMAC(l,o),m()}catch(_){f(_)}},cancel:()=>f((0,qn.newUserCancelledError)()),mismatch:()=>f(hm())},this.emit(Ja.ShowSas,this.sasEvent)});[t]=await Promise.all([this.waitForEvent("m.key.verification.mac").then(m=>(this.expectedEvent="m.key.verification.done",m)),g]),r=t.getContent(),await this.checkMAC(l,r,o)}finally{l.free()}}async doRespondVerification(){let e=this.channel.completedContentFromEvent(this.startEvent);const t=ca(Hh,new Set(e.key_agreement_protocols))[0],r=ca(Yh,new Set(e.hashes))[0],i=ca(zh,new Set(e.message_authentication_codes))[0],s=ca(e.short_authentication_string,gm);if(!(t!==void 0&&r!==void 0&&i!==void 0&&s.length))throw(0,qn.newUnknownMethodError)();const o=new V.Olm.SAS;try{const a=o.get_pubkey()+dm.default.stringify(e);await this.send("m.key.verification.accept",{key_agreement_protocol:t,hash:r,message_authentication_code:i,short_authentication_string:s,commitment:Kc.sha256(a)});let l=await this.waitForEvent("m.key.verification.key");e=l.getContent(),this.theirSASPubKey=e.key,o.set_their_key(e.key),this.ourSASPubKey=o.get_pubkey(),await this.send("m.key.verification.key",{key:this.ourSASPubKey});const u=pm[t](this,o,6),c=new Promise((g,m)=>{this.sasEvent={sas:fm(u,s),confirm:async()=>{try{await this.sendMAC(o,i),g()}catch(f){m(f)}},cancel:()=>m((0,qn.newUserCancelledError)()),mismatch:()=>m(hm())},this.emit(Ja.ShowSas,this.sasEvent)});[l]=await Promise.all([this.waitForEvent("m.key.verification.mac").then(g=>(this.expectedEvent="m.key.verification.done",g)),c]),e=l.getContent(),await this.checkMAC(o,e,i)}finally{o.free()}}sendMAC(e,t){const r={},i=[],s="MATRIX_KEY_VERIFICATION_MAC"+this.baseApis.getUserId()+this.baseApis.deviceId+this.userId+this.deviceId+this.channel.transactionId,o=`ed25519:${this.baseApis.deviceId}`;r[o]=aa(e,t)(this.baseApis.getDeviceEd25519Key(),s+o),i.push(o);const a=this.baseApis.getCrossSigningId();if(a){const u=`ed25519:${a}`;r[u]=aa(e,t)(a,s+u),i.push(u)}const l=aa(e,t)(i.sort().join(","),s+"KEY_IDS");return this.send("m.key.verification.mac",{mac:r,keys:l})}async checkMAC(e,t,r){const i="MATRIX_KEY_VERIFICATION_MAC"+this.userId+this.deviceId+this.baseApis.getUserId()+this.baseApis.deviceId+this.channel.transactionId;if(t.keys!==aa(e,r)(Object.keys(t.mac).sort().join(","),i+"KEY_IDS"))throw(0,qn.newKeyMismatchError)();await this.verifyKeys(this.userId,t.mac,(s,o,a)=>{if(a!==aa(e,r)(o.keys[s],i+s))throw(0,qn.newKeyMismatchError)()})}}Is.SAS=Ll;var $s={};Object.defineProperty($s,"__esModule",{value:!0});$s.deriveKey=Lf;$s.keyFromAuthData=xM;$s.keyFromPassphrase=UM;var MM=li,DM=W;const AM=typeof window!="undefined"&&window.crypto?window.crypto.subtle||window.crypto.webkitSubtle:null,mm=5e5,Nf=256;async function xM(n,e){if(!V.Olm)throw new Error("Olm is not available");if(!n.private_key_salt||!n.private_key_iterations)throw new Error("Salt and/or iterations not found: this backup cannot be restored with a passphrase");return await Lf(e,n.private_key_salt,n.private_key_iterations,n.private_key_bits||Nf)}async function UM(n){if(!V.Olm)throw new Error("Olm is not available");const e=(0,MM.randomString)(32);return{key:await Lf(n,e,mm,Nf),salt:e,iterations:mm}}async function Lf(n,e,t,r=Nf){return AM?$M(n,e,t,r):NM(n,e,t,r)}async function $M(n,e,t,r){const i=V.crypto.subtle,s=V.TextEncoder;if(!i||!s)throw new Error("Password-based backup is not avaiable on this platform");const o=await i.importKey("raw",new s().encode(n),{name:"PBKDF2"},!1,["deriveBits"]),a=await i.deriveBits({name:"PBKDF2",salt:new s().encode(e),iterations:t,hash:"SHA-512"},o,r);return new Uint8Array(a)}async function NM(n,e,t,r){const i=(0,DM.getCrypto)();if(!i)throw new Error("No usable crypto implementation");return i.pbkdf2Sync(n,Buffer.from(e,"binary"),t,r,"sha512")}var Go={},Jh={exports:{}},W_={},pu={};pu.byteLength=KM;pu.toByteArray=qM;pu.fromByteArray=GM;var bn=[],$r=[],LM=typeof Uint8Array!="undefined"?Uint8Array:Array,Sd="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(var zs=0,BM=Sd.length;zs<BM;++zs)bn[zs]=Sd[zs],$r[Sd.charCodeAt(zs)]=zs;$r["-".charCodeAt(0)]=62;$r["_".charCodeAt(0)]=63;function H_(n){var e=n.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var t=n.indexOf("=");t===-1&&(t=e);var r=t===e?0:4-t%4;return[t,r]}function KM(n){var e=H_(n),t=e[0],r=e[1];return(t+r)*3/4-r}function FM(n,e,t){return(e+t)*3/4-t}function qM(n){var e,t=H_(n),r=t[0],i=t[1],s=new LM(FM(n,r,i)),o=0,a=i>0?r-4:r,l;for(l=0;l<a;l+=4)e=$r[n.charCodeAt(l)]<<18|$r[n.charCodeAt(l+1)]<<12|$r[n.charCodeAt(l+2)]<<6|$r[n.charCodeAt(l+3)],s[o++]=e>>16&255,s[o++]=e>>8&255,s[o++]=e&255;return i===2&&(e=$r[n.charCodeAt(l)]<<2|$r[n.charCodeAt(l+1)]>>4,s[o++]=e&255),i===1&&(e=$r[n.charCodeAt(l)]<<10|$r[n.charCodeAt(l+1)]<<4|$r[n.charCodeAt(l+2)]>>2,s[o++]=e>>8&255,s[o++]=e&255),s}function jM(n){return bn[n>>18&63]+bn[n>>12&63]+bn[n>>6&63]+bn[n&63]}function VM(n,e,t){for(var r,i=[],s=e;s<t;s+=3)r=(n[s]<<16&16711680)+(n[s+1]<<8&65280)+(n[s+2]&255),i.push(jM(r));return i.join("")}function GM(n){for(var e,t=n.length,r=t%3,i=[],s=16383,o=0,a=t-r;o<a;o+=s)i.push(VM(n,o,o+s>a?a:o+s));return r===1?(e=n[t-1],i.push(bn[e>>2]+bn[e<<4&63]+"==")):r===2&&(e=(n[t-2]<<8)+n[t-1],i.push(bn[e>>10]+bn[e>>4&63]+bn[e<<2&63]+"=")),i.join("")}var Bf={};/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */Bf.read=function(n,e,t,r,i){var s,o,a=i*8-r-1,l=(1<<a)-1,u=l>>1,c=-7,g=t?i-1:0,m=t?-1:1,f=n[e+g];for(g+=m,s=f&(1<<-c)-1,f>>=-c,c+=a;c>0;s=s*256+n[e+g],g+=m,c-=8);for(o=s&(1<<-c)-1,s>>=-c,c+=r;c>0;o=o*256+n[e+g],g+=m,c-=8);if(s===0)s=1-u;else{if(s===l)return o?NaN:(f?-1:1)*(1/0);o=o+Math.pow(2,r),s=s-u}return(f?-1:1)*o*Math.pow(2,s-r)};Bf.write=function(n,e,t,r,i,s){var o,a,l,u=s*8-i-1,c=(1<<u)-1,g=c>>1,m=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,f=r?0:s-1,_=r?1:-1,I=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,o=c):(o=Math.floor(Math.log(e)/Math.LN2),e*(l=Math.pow(2,-o))<1&&(o--,l*=2),o+g>=1?e+=m/l:e+=m*Math.pow(2,1-g),e*l>=2&&(o++,l/=2),o+g>=c?(a=0,o=c):o+g>=1?(a=(e*l-1)*Math.pow(2,i),o=o+g):(a=e*Math.pow(2,g-1)*Math.pow(2,i),o=0));i>=8;n[t+f]=a&255,f+=_,a/=256,i-=8);for(o=o<<i|a,u+=i;u>0;n[t+f]=o&255,f+=_,o/=256,u-=8);n[t+f-_]|=I*128};/*!
+ * The buffer module from node.js, for the browser.
+ *
+ * @author Feross Aboukhadijeh <https://feross.org>
+ * @license MIT
+ */(function(n){const e=pu,t=Bf,r=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;n.Buffer=a,n.SlowBuffer=C,n.INSPECT_MAX_BYTES=50;const i=2147483647;n.kMaxLength=i,a.TYPED_ARRAY_SUPPORT=s(),!a.TYPED_ARRAY_SUPPORT&&typeof console!="undefined"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function s(){try{const v=new Uint8Array(1),d={foo:function(){return 42}};return Object.setPrototypeOf(d,Uint8Array.prototype),Object.setPrototypeOf(v,d),v.foo()===42}catch{return!1}}Object.defineProperty(a.prototype,"parent",{enumerable:!0,get:function(){if(!!a.isBuffer(this))return this.buffer}}),Object.defineProperty(a.prototype,"offset",{enumerable:!0,get:function(){if(!!a.isBuffer(this))return this.byteOffset}});function o(v){if(v>i)throw new RangeError('The value "'+v+'" is invalid for option "size"');const d=new Uint8Array(v);return Object.setPrototypeOf(d,a.prototype),d}function a(v,d,h){if(typeof v=="number"){if(typeof d=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return g(v)}return l(v,d,h)}a.poolSize=8192;function l(v,d,h){if(typeof v=="string")return m(v,d);if(ArrayBuffer.isView(v))return _(v);if(v==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof v);if(Jt(v,ArrayBuffer)||v&&Jt(v.buffer,ArrayBuffer)||typeof SharedArrayBuffer!="undefined"&&(Jt(v,SharedArrayBuffer)||v&&Jt(v.buffer,SharedArrayBuffer)))return I(v,d,h);if(typeof v=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const b=v.valueOf&&v.valueOf();if(b!=null&&b!==v)return a.from(b,d,h);const P=R(v);if(P)return P;if(typeof Symbol!="undefined"&&Symbol.toPrimitive!=null&&typeof v[Symbol.toPrimitive]=="function")return a.from(v[Symbol.toPrimitive]("string"),d,h);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof v)}a.from=function(v,d,h){return l(v,d,h)},Object.setPrototypeOf(a.prototype,Uint8Array.prototype),Object.setPrototypeOf(a,Uint8Array);function u(v){if(typeof v!="number")throw new TypeError('"size" argument must be of type number');if(v<0)throw new RangeError('The value "'+v+'" is invalid for option "size"')}function c(v,d,h){return u(v),v<=0?o(v):d!==void 0?typeof h=="string"?o(v).fill(d,h):o(v).fill(d):o(v)}a.alloc=function(v,d,h){return c(v,d,h)};function g(v){return u(v),o(v<0?0:T(v)|0)}a.allocUnsafe=function(v){return g(v)},a.allocUnsafeSlow=function(v){return g(v)};function m(v,d){if((typeof d!="string"||d==="")&&(d="utf8"),!a.isEncoding(d))throw new TypeError("Unknown encoding: "+d);const h=S(v,d)|0;let b=o(h);const P=b.write(v,d);return P!==h&&(b=b.slice(0,P)),b}function f(v){const d=v.length<0?0:T(v.length)|0,h=o(d);for(let b=0;b<d;b+=1)h[b]=v[b]&255;return h}function _(v){if(Jt(v,Uint8Array)){const d=new Uint8Array(v);return I(d.buffer,d.byteOffset,d.byteLength)}return f(v)}function I(v,d,h){if(d<0||v.byteLength<d)throw new RangeError('"offset" is outside of buffer bounds');if(v.byteLength<d+(h||0))throw new RangeError('"length" is outside of buffer bounds');let b;return d===void 0&&h===void 0?b=new Uint8Array(v):h===void 0?b=new Uint8Array(v,d):b=new Uint8Array(v,d,h),Object.setPrototypeOf(b,a.prototype),b}function R(v){if(a.isBuffer(v)){const d=T(v.length)|0,h=o(d);return h.length===0||v.copy(h,0,0,d),h}if(v.length!==void 0)return typeof v.length!="number"||Ho(v.length)?o(0):f(v);if(v.type==="Buffer"&&Array.isArray(v.data))return f(v.data)}function T(v){if(v>=i)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+i.toString(16)+" bytes");return v|0}function C(v){return+v!=v&&(v=0),a.alloc(+v)}a.isBuffer=function(d){return d!=null&&d._isBuffer===!0&&d!==a.prototype},a.compare=function(d,h){if(Jt(d,Uint8Array)&&(d=a.from(d,d.offset,d.byteLength)),Jt(h,Uint8Array)&&(h=a.from(h,h.offset,h.byteLength)),!a.isBuffer(d)||!a.isBuffer(h))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(d===h)return 0;let b=d.length,P=h.length;for(let D=0,U=Math.min(b,P);D<U;++D)if(d[D]!==h[D]){b=d[D],P=h[D];break}return b<P?-1:P<b?1:0},a.isEncoding=function(d){switch(String(d).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},a.concat=function(d,h){if(!Array.isArray(d))throw new TypeError('"list" argument must be an Array of Buffers');if(d.length===0)return a.alloc(0);let b;if(h===void 0)for(h=0,b=0;b<d.length;++b)h+=d[b].length;const P=a.allocUnsafe(h);let D=0;for(b=0;b<d.length;++b){let U=d[b];if(Jt(U,Uint8Array))D+U.length>P.length?(a.isBuffer(U)||(U=a.from(U)),U.copy(P,D)):Uint8Array.prototype.set.call(P,U,D);else if(a.isBuffer(U))U.copy(P,D);else throw new TypeError('"list" argument must be an Array of Buffers');D+=U.length}return P};function S(v,d){if(a.isBuffer(v))return v.length;if(ArrayBuffer.isView(v)||Jt(v,ArrayBuffer))return v.byteLength;if(typeof v!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof v);const h=v.length,b=arguments.length>2&&arguments[2]===!0;if(!b&&h===0)return 0;let P=!1;for(;;)switch(d){case"ascii":case"latin1":case"binary":return h;case"utf8":case"utf-8":return Ls(v).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return h*2;case"hex":return h>>>1;case"base64":return Mn(v).length;default:if(P)return b?-1:Ls(v).length;d=(""+d).toLowerCase(),P=!0}}a.byteLength=S;function k(v,d,h){let b=!1;if((d===void 0||d<0)&&(d=0),d>this.length||((h===void 0||h>this.length)&&(h=this.length),h<=0)||(h>>>=0,d>>>=0,h<=d))return"";for(v||(v="utf8");;)switch(v){case"hex":return Ut(this,d,h);case"utf8":case"utf-8":return ft(this,d,h);case"ascii":return ee(this,d,h);case"latin1":case"binary":return pr(this,d,h);case"base64":return Qe(this,d,h);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return fi(this,d,h);default:if(b)throw new TypeError("Unknown encoding: "+v);v=(v+"").toLowerCase(),b=!0}}a.prototype._isBuffer=!0;function A(v,d,h){const b=v[d];v[d]=v[h],v[h]=b}a.prototype.swap16=function(){const d=this.length;if(d%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let h=0;h<d;h+=2)A(this,h,h+1);return this},a.prototype.swap32=function(){const d=this.length;if(d%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let h=0;h<d;h+=4)A(this,h,h+3),A(this,h+1,h+2);return this},a.prototype.swap64=function(){const d=this.length;if(d%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let h=0;h<d;h+=8)A(this,h,h+7),A(this,h+1,h+6),A(this,h+2,h+5),A(this,h+3,h+4);return this},a.prototype.toString=function(){const d=this.length;return d===0?"":arguments.length===0?ft(this,0,d):k.apply(this,arguments)},a.prototype.toLocaleString=a.prototype.toString,a.prototype.equals=function(d){if(!a.isBuffer(d))throw new TypeError("Argument must be a Buffer");return this===d?!0:a.compare(this,d)===0},a.prototype.inspect=function(){let d="";const h=n.INSPECT_MAX_BYTES;return d=this.toString("hex",0,h).replace(/(.{2})/g,"$1 ").trim(),this.length>h&&(d+=" ... "),"<Buffer "+d+">"},r&&(a.prototype[r]=a.prototype.inspect),a.prototype.compare=function(d,h,b,P,D){if(Jt(d,Uint8Array)&&(d=a.from(d,d.offset,d.byteLength)),!a.isBuffer(d))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof d);if(h===void 0&&(h=0),b===void 0&&(b=d?d.length:0),P===void 0&&(P=0),D===void 0&&(D=this.length),h<0||b>d.length||P<0||D>this.length)throw new RangeError("out of range index");if(P>=D&&h>=b)return 0;if(P>=D)return-1;if(h>=b)return 1;if(h>>>=0,b>>>=0,P>>>=0,D>>>=0,this===d)return 0;let U=D-P,re=b-h;const we=Math.min(U,re),ue=this.slice(P,D),Te=d.slice(h,b);for(let ye=0;ye<we;++ye)if(ue[ye]!==Te[ye]){U=ue[ye],re=Te[ye];break}return U<re?-1:re<U?1:0};function w(v,d,h,b,P){if(v.length===0)return-1;if(typeof h=="string"?(b=h,h=0):h>2147483647?h=2147483647:h<-2147483648&&(h=-2147483648),h=+h,Ho(h)&&(h=P?0:v.length-1),h<0&&(h=v.length+h),h>=v.length){if(P)return-1;h=v.length-1}else if(h<0)if(P)h=0;else return-1;if(typeof d=="string"&&(d=a.from(d,b)),a.isBuffer(d))return d.length===0?-1:L(v,d,h,b,P);if(typeof d=="number")return d=d&255,typeof Uint8Array.prototype.indexOf=="function"?P?Uint8Array.prototype.indexOf.call(v,d,h):Uint8Array.prototype.lastIndexOf.call(v,d,h):L(v,[d],h,b,P);throw new TypeError("val must be string, number or Buffer")}function L(v,d,h,b,P){let D=1,U=v.length,re=d.length;if(b!==void 0&&(b=String(b).toLowerCase(),b==="ucs2"||b==="ucs-2"||b==="utf16le"||b==="utf-16le")){if(v.length<2||d.length<2)return-1;D=2,U/=2,re/=2,h/=2}function we(Te,ye){return D===1?Te[ye]:Te.readUInt16BE(ye*D)}let ue;if(P){let Te=-1;for(ue=h;ue<U;ue++)if(we(v,ue)===we(d,Te===-1?0:ue-Te)){if(Te===-1&&(Te=ue),ue-Te+1===re)return Te*D}else Te!==-1&&(ue-=ue-Te),Te=-1}else for(h+re>U&&(h=U-re),ue=h;ue>=0;ue--){let Te=!0;for(let ye=0;ye<re;ye++)if(we(v,ue+ye)!==we(d,ye)){Te=!1;break}if(Te)return ue}return-1}a.prototype.includes=function(d,h,b){return this.indexOf(d,h,b)!==-1},a.prototype.indexOf=function(d,h,b){return w(this,d,h,b,!0)},a.prototype.lastIndexOf=function(d,h,b){return w(this,d,h,b,!1)};function q(v,d,h,b){h=Number(h)||0;const P=v.length-h;b?(b=Number(b),b>P&&(b=P)):b=P;const D=d.length;b>D/2&&(b=D/2);let U;for(U=0;U<b;++U){const re=parseInt(d.substr(U*2,2),16);if(Ho(re))return U;v[h+U]=re}return U}function F(v,d,h,b){return yi(Ls(d,v.length-h),v,h,b)}function he(v,d,h,b){return yi(mc(d),v,h,b)}function Fe(v,d,h,b){return yi(Mn(d),v,h,b)}function Ve(v,d,h,b){return yi(Ru(d,v.length-h),v,h,b)}a.prototype.write=function(d,h,b,P){if(h===void 0)P="utf8",b=this.length,h=0;else if(b===void 0&&typeof h=="string")P=h,b=this.length,h=0;else if(isFinite(h))h=h>>>0,isFinite(b)?(b=b>>>0,P===void 0&&(P="utf8")):(P=b,b=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");const D=this.length-h;if((b===void 0||b>D)&&(b=D),d.length>0&&(b<0||h<0)||h>this.length)throw new RangeError("Attempt to write outside buffer bounds");P||(P="utf8");let U=!1;for(;;)switch(P){case"hex":return q(this,d,h,b);case"utf8":case"utf-8":return F(this,d,h,b);case"ascii":case"latin1":case"binary":return he(this,d,h,b);case"base64":return Fe(this,d,h,b);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Ve(this,d,h,b);default:if(U)throw new TypeError("Unknown encoding: "+P);P=(""+P).toLowerCase(),U=!0}},a.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function Qe(v,d,h){return d===0&&h===v.length?e.fromByteArray(v):e.fromByteArray(v.slice(d,h))}function ft(v,d,h){h=Math.min(v.length,h);const b=[];let P=d;for(;P<h;){const D=v[P];let U=null,re=D>239?4:D>223?3:D>191?2:1;if(P+re<=h){let we,ue,Te,ye;switch(re){case 1:D<128&&(U=D);break;case 2:we=v[P+1],(we&192)===128&&(ye=(D&31)<<6|we&63,ye>127&&(U=ye));break;case 3:we=v[P+1],ue=v[P+2],(we&192)===128&&(ue&192)===128&&(ye=(D&15)<<12|(we&63)<<6|ue&63,ye>2047&&(ye<55296||ye>57343)&&(U=ye));break;case 4:we=v[P+1],ue=v[P+2],Te=v[P+3],(we&192)===128&&(ue&192)===128&&(Te&192)===128&&(ye=(D&15)<<18|(we&63)<<12|(ue&63)<<6|Te&63,ye>65535&&ye<1114112&&(U=ye))}}U===null?(U=65533,re=1):U>65535&&(U-=65536,b.push(U>>>10&1023|55296),U=56320|U&1023),b.push(U),P+=re}return Yt(b)}const at=4096;function Yt(v){const d=v.length;if(d<=at)return String.fromCharCode.apply(String,v);let h="",b=0;for(;b<d;)h+=String.fromCharCode.apply(String,v.slice(b,b+=at));return h}function ee(v,d,h){let b="";h=Math.min(v.length,h);for(let P=d;P<h;++P)b+=String.fromCharCode(v[P]&127);return b}function pr(v,d,h){let b="";h=Math.min(v.length,h);for(let P=d;P<h;++P)b+=String.fromCharCode(v[P]);return b}function Ut(v,d,h){const b=v.length;(!d||d<0)&&(d=0),(!h||h<0||h>b)&&(h=b);let P="";for(let D=d;D<h;++D)P+=yc[v[D]];return P}function fi(v,d,h){const b=v.slice(d,h);let P="";for(let D=0;D<b.length-1;D+=2)P+=String.fromCharCode(b[D]+b[D+1]*256);return P}a.prototype.slice=function(d,h){const b=this.length;d=~~d,h=h===void 0?b:~~h,d<0?(d+=b,d<0&&(d=0)):d>b&&(d=b),h<0?(h+=b,h<0&&(h=0)):h>b&&(h=b),h<d&&(h=d);const P=this.subarray(d,h);return Object.setPrototypeOf(P,a.prototype),P};function be(v,d,h){if(v%1!==0||v<0)throw new RangeError("offset is not uint");if(v+d>h)throw new RangeError("Trying to access beyond buffer length")}a.prototype.readUintLE=a.prototype.readUIntLE=function(d,h,b){d=d>>>0,h=h>>>0,b||be(d,h,this.length);let P=this[d],D=1,U=0;for(;++U<h&&(D*=256);)P+=this[d+U]*D;return P},a.prototype.readUintBE=a.prototype.readUIntBE=function(d,h,b){d=d>>>0,h=h>>>0,b||be(d,h,this.length);let P=this[d+--h],D=1;for(;h>0&&(D*=256);)P+=this[d+--h]*D;return P},a.prototype.readUint8=a.prototype.readUInt8=function(d,h){return d=d>>>0,h||be(d,1,this.length),this[d]},a.prototype.readUint16LE=a.prototype.readUInt16LE=function(d,h){return d=d>>>0,h||be(d,2,this.length),this[d]|this[d+1]<<8},a.prototype.readUint16BE=a.prototype.readUInt16BE=function(d,h){return d=d>>>0,h||be(d,2,this.length),this[d]<<8|this[d+1]},a.prototype.readUint32LE=a.prototype.readUInt32LE=function(d,h){return d=d>>>0,h||be(d,4,this.length),(this[d]|this[d+1]<<8|this[d+2]<<16)+this[d+3]*16777216},a.prototype.readUint32BE=a.prototype.readUInt32BE=function(d,h){return d=d>>>0,h||be(d,4,this.length),this[d]*16777216+(this[d+1]<<16|this[d+2]<<8|this[d+3])},a.prototype.readBigUInt64LE=Vr(function(d){d=d>>>0,ct(d,"offset");const h=this[d],b=this[d+7];(h===void 0||b===void 0)&<(d,this.length-8);const P=h+this[++d]*2**8+this[++d]*2**16+this[++d]*2**24,D=this[++d]+this[++d]*2**8+this[++d]*2**16+b*2**24;return BigInt(P)+(BigInt(D)<<BigInt(32))}),a.prototype.readBigUInt64BE=Vr(function(d){d=d>>>0,ct(d,"offset");const h=this[d],b=this[d+7];(h===void 0||b===void 0)&<(d,this.length-8);const P=h*2**24+this[++d]*2**16+this[++d]*2**8+this[++d],D=this[++d]*2**24+this[++d]*2**16+this[++d]*2**8+b;return(BigInt(P)<<BigInt(32))+BigInt(D)}),a.prototype.readIntLE=function(d,h,b){d=d>>>0,h=h>>>0,b||be(d,h,this.length);let P=this[d],D=1,U=0;for(;++U<h&&(D*=256);)P+=this[d+U]*D;return D*=128,P>=D&&(P-=Math.pow(2,8*h)),P},a.prototype.readIntBE=function(d,h,b){d=d>>>0,h=h>>>0,b||be(d,h,this.length);let P=h,D=1,U=this[d+--P];for(;P>0&&(D*=256);)U+=this[d+--P]*D;return D*=128,U>=D&&(U-=Math.pow(2,8*h)),U},a.prototype.readInt8=function(d,h){return d=d>>>0,h||be(d,1,this.length),this[d]&128?(255-this[d]+1)*-1:this[d]},a.prototype.readInt16LE=function(d,h){d=d>>>0,h||be(d,2,this.length);const b=this[d]|this[d+1]<<8;return b&32768?b|4294901760:b},a.prototype.readInt16BE=function(d,h){d=d>>>0,h||be(d,2,this.length);const b=this[d+1]|this[d]<<8;return b&32768?b|4294901760:b},a.prototype.readInt32LE=function(d,h){return d=d>>>0,h||be(d,4,this.length),this[d]|this[d+1]<<8|this[d+2]<<16|this[d+3]<<24},a.prototype.readInt32BE=function(d,h){return d=d>>>0,h||be(d,4,this.length),this[d]<<24|this[d+1]<<16|this[d+2]<<8|this[d+3]},a.prototype.readBigInt64LE=Vr(function(d){d=d>>>0,ct(d,"offset");const h=this[d],b=this[d+7];(h===void 0||b===void 0)&<(d,this.length-8);const P=this[d+4]+this[d+5]*2**8+this[d+6]*2**16+(b<<24);return(BigInt(P)<<BigInt(32))+BigInt(h+this[++d]*2**8+this[++d]*2**16+this[++d]*2**24)}),a.prototype.readBigInt64BE=Vr(function(d){d=d>>>0,ct(d,"offset");const h=this[d],b=this[d+7];(h===void 0||b===void 0)&<(d,this.length-8);const P=(h<<24)+this[++d]*2**16+this[++d]*2**8+this[++d];return(BigInt(P)<<BigInt(32))+BigInt(this[++d]*2**24+this[++d]*2**16+this[++d]*2**8+b)}),a.prototype.readFloatLE=function(d,h){return d=d>>>0,h||be(d,4,this.length),t.read(this,d,!0,23,4)},a.prototype.readFloatBE=function(d,h){return d=d>>>0,h||be(d,4,this.length),t.read(this,d,!1,23,4)},a.prototype.readDoubleLE=function(d,h){return d=d>>>0,h||be(d,8,this.length),t.read(this,d,!0,52,8)},a.prototype.readDoubleBE=function(d,h){return d=d>>>0,h||be(d,8,this.length),t.read(this,d,!1,52,8)};function xe(v,d,h,b,P,D){if(!a.isBuffer(v))throw new TypeError('"buffer" argument must be a Buffer instance');if(d>P||d<D)throw new RangeError('"value" argument is out of bounds');if(h+b>v.length)throw new RangeError("Index out of range")}a.prototype.writeUintLE=a.prototype.writeUIntLE=function(d,h,b,P){if(d=+d,h=h>>>0,b=b>>>0,!P){const re=Math.pow(2,8*b)-1;xe(this,d,h,b,re,0)}let D=1,U=0;for(this[h]=d&255;++U<b&&(D*=256);)this[h+U]=d/D&255;return h+b},a.prototype.writeUintBE=a.prototype.writeUIntBE=function(d,h,b,P){if(d=+d,h=h>>>0,b=b>>>0,!P){const re=Math.pow(2,8*b)-1;xe(this,d,h,b,re,0)}let D=b-1,U=1;for(this[h+D]=d&255;--D>=0&&(U*=256);)this[h+D]=d/U&255;return h+b},a.prototype.writeUint8=a.prototype.writeUInt8=function(d,h,b){return d=+d,h=h>>>0,b||xe(this,d,h,1,255,0),this[h]=d&255,h+1},a.prototype.writeUint16LE=a.prototype.writeUInt16LE=function(d,h,b){return d=+d,h=h>>>0,b||xe(this,d,h,2,65535,0),this[h]=d&255,this[h+1]=d>>>8,h+2},a.prototype.writeUint16BE=a.prototype.writeUInt16BE=function(d,h,b){return d=+d,h=h>>>0,b||xe(this,d,h,2,65535,0),this[h]=d>>>8,this[h+1]=d&255,h+2},a.prototype.writeUint32LE=a.prototype.writeUInt32LE=function(d,h,b){return d=+d,h=h>>>0,b||xe(this,d,h,4,4294967295,0),this[h+3]=d>>>24,this[h+2]=d>>>16,this[h+1]=d>>>8,this[h]=d&255,h+4},a.prototype.writeUint32BE=a.prototype.writeUInt32BE=function(d,h,b){return d=+d,h=h>>>0,b||xe(this,d,h,4,4294967295,0),this[h]=d>>>24,this[h+1]=d>>>16,this[h+2]=d>>>8,this[h+3]=d&255,h+4};function pi(v,d,h,b,P){Ir(d,b,P,v,h,7);let D=Number(d&BigInt(4294967295));v[h++]=D,D=D>>8,v[h++]=D,D=D>>8,v[h++]=D,D=D>>8,v[h++]=D;let U=Number(d>>BigInt(32)&BigInt(4294967295));return v[h++]=U,U=U>>8,v[h++]=U,U=U>>8,v[h++]=U,U=U>>8,v[h++]=U,h}function jr(v,d,h,b,P){Ir(d,b,P,v,h,7);let D=Number(d&BigInt(4294967295));v[h+7]=D,D=D>>8,v[h+6]=D,D=D>>8,v[h+5]=D,D=D>>8,v[h+4]=D;let U=Number(d>>BigInt(32)&BigInt(4294967295));return v[h+3]=U,U=U>>8,v[h+2]=U,U=U>>8,v[h+1]=U,U=U>>8,v[h]=U,h+8}a.prototype.writeBigUInt64LE=Vr(function(d,h=0){return pi(this,d,h,BigInt(0),BigInt("0xffffffffffffffff"))}),a.prototype.writeBigUInt64BE=Vr(function(d,h=0){return jr(this,d,h,BigInt(0),BigInt("0xffffffffffffffff"))}),a.prototype.writeIntLE=function(d,h,b,P){if(d=+d,h=h>>>0,!P){const we=Math.pow(2,8*b-1);xe(this,d,h,b,we-1,-we)}let D=0,U=1,re=0;for(this[h]=d&255;++D<b&&(U*=256);)d<0&&re===0&&this[h+D-1]!==0&&(re=1),this[h+D]=(d/U>>0)-re&255;return h+b},a.prototype.writeIntBE=function(d,h,b,P){if(d=+d,h=h>>>0,!P){const we=Math.pow(2,8*b-1);xe(this,d,h,b,we-1,-we)}let D=b-1,U=1,re=0;for(this[h+D]=d&255;--D>=0&&(U*=256);)d<0&&re===0&&this[h+D+1]!==0&&(re=1),this[h+D]=(d/U>>0)-re&255;return h+b},a.prototype.writeInt8=function(d,h,b){return d=+d,h=h>>>0,b||xe(this,d,h,1,127,-128),d<0&&(d=255+d+1),this[h]=d&255,h+1},a.prototype.writeInt16LE=function(d,h,b){return d=+d,h=h>>>0,b||xe(this,d,h,2,32767,-32768),this[h]=d&255,this[h+1]=d>>>8,h+2},a.prototype.writeInt16BE=function(d,h,b){return d=+d,h=h>>>0,b||xe(this,d,h,2,32767,-32768),this[h]=d>>>8,this[h+1]=d&255,h+2},a.prototype.writeInt32LE=function(d,h,b){return d=+d,h=h>>>0,b||xe(this,d,h,4,2147483647,-2147483648),this[h]=d&255,this[h+1]=d>>>8,this[h+2]=d>>>16,this[h+3]=d>>>24,h+4},a.prototype.writeInt32BE=function(d,h,b){return d=+d,h=h>>>0,b||xe(this,d,h,4,2147483647,-2147483648),d<0&&(d=4294967295+d+1),this[h]=d>>>24,this[h+1]=d>>>16,this[h+2]=d>>>8,this[h+3]=d&255,h+4},a.prototype.writeBigInt64LE=Vr(function(d,h=0){return pi(this,d,h,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),a.prototype.writeBigInt64BE=Vr(function(d,h=0){return jr(this,d,h,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function Pn(v,d,h,b,P,D){if(h+b>v.length)throw new RangeError("Index out of range");if(h<0)throw new RangeError("Index out of range")}function gi(v,d,h,b,P){return d=+d,h=h>>>0,P||Pn(v,d,h,4),t.write(v,d,h,b,23,4),h+4}a.prototype.writeFloatLE=function(d,h,b){return gi(this,d,h,!0,b)},a.prototype.writeFloatBE=function(d,h,b){return gi(this,d,h,!1,b)};function mi(v,d,h,b,P){return d=+d,h=h>>>0,P||Pn(v,d,h,8),t.write(v,d,h,b,52,8),h+8}a.prototype.writeDoubleLE=function(d,h,b){return mi(this,d,h,!0,b)},a.prototype.writeDoubleBE=function(d,h,b){return mi(this,d,h,!1,b)},a.prototype.copy=function(d,h,b,P){if(!a.isBuffer(d))throw new TypeError("argument should be a Buffer");if(b||(b=0),!P&&P!==0&&(P=this.length),h>=d.length&&(h=d.length),h||(h=0),P>0&&P<b&&(P=b),P===b||d.length===0||this.length===0)return 0;if(h<0)throw new RangeError("targetStart out of bounds");if(b<0||b>=this.length)throw new RangeError("Index out of range");if(P<0)throw new RangeError("sourceEnd out of bounds");P>this.length&&(P=this.length),d.length-h<P-b&&(P=d.length-h+b);const D=P-b;return this===d&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(h,b,P):Uint8Array.prototype.set.call(d,this.subarray(b,P),h),D},a.prototype.fill=function(d,h,b,P){if(typeof d=="string"){if(typeof h=="string"?(P=h,h=0,b=this.length):typeof b=="string"&&(P=b,b=this.length),P!==void 0&&typeof P!="string")throw new TypeError("encoding must be a string");if(typeof P=="string"&&!a.isEncoding(P))throw new TypeError("Unknown encoding: "+P);if(d.length===1){const U=d.charCodeAt(0);(P==="utf8"&&U<128||P==="latin1")&&(d=U)}}else typeof d=="number"?d=d&255:typeof d=="boolean"&&(d=Number(d));if(h<0||this.length<h||this.length<b)throw new RangeError("Out of range index");if(b<=h)return this;h=h>>>0,b=b===void 0?this.length:b>>>0,d||(d=0);let D;if(typeof d=="number")for(D=h;D<b;++D)this[D]=d;else{const U=a.isBuffer(d)?d:a.from(d,P),re=U.length;if(re===0)throw new TypeError('The value "'+d+'" is invalid for argument "value"');for(D=0;D<b-h;++D)this[D+h]=U[D%re]}return this};const E={};function gr(v,d,h){E[v]=class extends h{constructor(){super(),Object.defineProperty(this,"message",{value:d.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${v}]`,this.stack,delete this.name}get code(){return v}set code(P){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:P,writable:!0})}toString(){return`${this.name} [${v}]: ${this.message}`}}}gr("ERR_BUFFER_OUT_OF_BOUNDS",function(v){return v?`${v} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),gr("ERR_INVALID_ARG_TYPE",function(v,d){return`The "${v}" argument must be of type number. Received type ${typeof d}`},TypeError),gr("ERR_OUT_OF_RANGE",function(v,d,h){let b=`The value of "${v}" is out of range.`,P=h;return Number.isInteger(h)&&Math.abs(h)>2**32?P=$t(String(h)):typeof h=="bigint"&&(P=String(h),(h>BigInt(2)**BigInt(32)||h<-(BigInt(2)**BigInt(32)))&&(P=$t(P)),P+="n"),b+=` It must be ${d}. Received ${P}`,b},RangeError);function $t(v){let d="",h=v.length;const b=v[0]==="-"?1:0;for(;h>=b+4;h-=3)d=`_${v.slice(h-3,h)}${d}`;return`${v.slice(0,h)}${d}`}function mr(v,d,h){ct(d,"offset"),(v[d]===void 0||v[d+h]===void 0)&<(d,v.length-(h+1))}function Ir(v,d,h,b,P,D){if(v>h||v<d){const U=typeof d=="bigint"?"n":"";let re;throw D>3?d===0||d===BigInt(0)?re=`>= 0${U} and < 2${U} ** ${(D+1)*8}${U}`:re=`>= -(2${U} ** ${(D+1)*8-1}${U}) and < 2 ** ${(D+1)*8-1}${U}`:re=`>= ${d}${U} and <= ${h}${U}`,new E.ERR_OUT_OF_RANGE("value",re,v)}mr(b,P,D)}function ct(v,d){if(typeof v!="number")throw new E.ERR_INVALID_ARG_TYPE(d,"number",v)}function lt(v,d,h){throw Math.floor(v)!==v?(ct(v,h),new E.ERR_OUT_OF_RANGE(h||"offset","an integer",v)):d<0?new E.ERR_BUFFER_OUT_OF_BOUNDS:new E.ERR_OUT_OF_RANGE(h||"offset",`>= ${h?1:0} and <= ${d}`,v)}const gc=/[^+/0-9A-Za-z-_]/g;function zt(v){if(v=v.split("=")[0],v=v.trim().replace(gc,""),v.length<2)return"";for(;v.length%4!==0;)v=v+"=";return v}function Ls(v,d){d=d||1/0;let h;const b=v.length;let P=null;const D=[];for(let U=0;U<b;++U){if(h=v.charCodeAt(U),h>55295&&h<57344){if(!P){if(h>56319){(d-=3)>-1&&D.push(239,191,189);continue}else if(U+1===b){(d-=3)>-1&&D.push(239,191,189);continue}P=h;continue}if(h<56320){(d-=3)>-1&&D.push(239,191,189),P=h;continue}h=(P-55296<<10|h-56320)+65536}else P&&(d-=3)>-1&&D.push(239,191,189);if(P=null,h<128){if((d-=1)<0)break;D.push(h)}else if(h<2048){if((d-=2)<0)break;D.push(h>>6|192,h&63|128)}else if(h<65536){if((d-=3)<0)break;D.push(h>>12|224,h>>6&63|128,h&63|128)}else if(h<1114112){if((d-=4)<0)break;D.push(h>>18|240,h>>12&63|128,h>>6&63|128,h&63|128)}else throw new Error("Invalid code point")}return D}function mc(v){const d=[];for(let h=0;h<v.length;++h)d.push(v.charCodeAt(h)&255);return d}function Ru(v,d){let h,b,P;const D=[];for(let U=0;U<v.length&&!((d-=2)<0);++U)h=v.charCodeAt(U),b=h>>8,P=h%256,D.push(P),D.push(b);return D}function Mn(v){return e.toByteArray(zt(v))}function yi(v,d,h,b){let P;for(P=0;P<b&&!(P+h>=d.length||P>=v.length);++P)d[P+h]=v[P];return P}function Jt(v,d){return v instanceof d||v!=null&&v.constructor!=null&&v.constructor.name!=null&&v.constructor.name===d.name}function Ho(v){return v!==v}const yc=function(){const v="0123456789abcdef",d=new Array(256);for(let h=0;h<16;++h){const b=h*16;for(let P=0;P<16;++P)d[b+P]=v[h]+v[P]}return d}();function Vr(v){return typeof BigInt=="undefined"?vc:v}function vc(){throw new Error("BigInt not supported")}})(W_);/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */(function(n,e){var t=W_,r=t.Buffer;function i(o,a){for(var l in o)a[l]=o[l]}r.from&&r.alloc&&r.allocUnsafe&&r.allocUnsafeSlow?n.exports=t:(i(t,e),e.Buffer=s);function s(o,a,l){return r(o,a,l)}s.prototype=Object.create(r.prototype),i(r,s),s.from=function(o,a,l){if(typeof o=="number")throw new TypeError("Argument must not be a number");return r(o,a,l)},s.alloc=function(o,a,l){if(typeof o!="number")throw new TypeError("Argument must be a number");var u=r(o);return a!==void 0?typeof l=="string"?u.fill(a,l):u.fill(a):u.fill(0),u},s.allocUnsafe=function(o){if(typeof o!="number")throw new TypeError("Argument must be a number");return r(o)},s.allocUnsafeSlow=function(o){if(typeof o!="number")throw new TypeError("Argument must be a number");return t.SlowBuffer(o)}})(Jh,Jh.exports);var Fc=Jh.exports.Buffer;function WM(n){if(n.length>=255)throw new TypeError("Alphabet too long");for(var e=new Uint8Array(256),t=0;t<e.length;t++)e[t]=255;for(var r=0;r<n.length;r++){var i=n.charAt(r),s=i.charCodeAt(0);if(e[s]!==255)throw new TypeError(i+" is ambiguous");e[s]=r}var o=n.length,a=n.charAt(0),l=Math.log(o)/Math.log(256),u=Math.log(256)/Math.log(o);function c(f){if((Array.isArray(f)||f instanceof Uint8Array)&&(f=Fc.from(f)),!Fc.isBuffer(f))throw new TypeError("Expected Buffer");if(f.length===0)return"";for(var _=0,I=0,R=0,T=f.length;R!==T&&f[R]===0;)R++,_++;for(var C=(T-R)*u+1>>>0,S=new Uint8Array(C);R!==T;){for(var k=f[R],A=0,w=C-1;(k!==0||A<I)&&w!==-1;w--,A++)k+=256*S[w]>>>0,S[w]=k%o>>>0,k=k/o>>>0;if(k!==0)throw new Error("Non-zero carry");I=A,R++}for(var L=C-I;L!==C&&S[L]===0;)L++;for(var q=a.repeat(_);L<C;++L)q+=n.charAt(S[L]);return q}function g(f){if(typeof f!="string")throw new TypeError("Expected String");if(f.length===0)return Fc.alloc(0);for(var _=0,I=0,R=0;f[_]===a;)I++,_++;for(var T=(f.length-_)*l+1>>>0,C=new Uint8Array(T);f[_];){var S=e[f.charCodeAt(_)];if(S===255)return;for(var k=0,A=T-1;(S!==0||k<R)&&A!==-1;A--,k++)S+=o*C[A]>>>0,C[A]=S%256>>>0,S=S/256>>>0;if(S!==0)throw new Error("Non-zero carry");R=k,_++}for(var w=T-R;w!==T&&C[w]===0;)w++;var L=Fc.allocUnsafe(I+(T-w));L.fill(0,0,I);for(var q=I;w!==T;)L[q++]=C[w++];return L}function m(f){var _=g(f);if(_)return _;throw new Error("Non-base"+o+" character")}return{encode:c,decodeUnsafe:g,decode:m}}var HM=WM,YM=HM,zM="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz",JM=YM(zM),XM=G.exports;Object.defineProperty(Go,"__esModule",{value:!0});Go.decodeRecoveryKey=ZM;Go.encodeRecoveryKey=QM;var Y_=XM(JM);const Ui=[139,1];function QM(n){const e=new Buffer(Ui.length+n.length+1);e.set(Ui,0),e.set(n,Ui.length);let t=0;for(let i=0;i<e.length-1;++i)t^=e[i];return e[e.length-1]=t,Y_.default.encode(e).match(/.{1,4}/g).join(" ")}function ZM(n){const e=Y_.default.decode(n.replace(/ /g,""));let t=0;for(const r of e)t^=r;if(t!==0)throw new Error("Incorrect parity");for(let r=0;r<Ui.length;++r)if(e[r]!==Ui[r])throw new Error("Incorrect prefix");if(e.length!==Ui.length+V.Olm.PRIVATE_KEY_LENGTH+1)throw new Error("Incorrect length");return Uint8Array.from(e.slice(Ui.length,Ui.length+V.Olm.PRIVATE_KEY_LENGTH))}var fe={},eD=G.exports;Object.defineProperty(fe,"__esModule",{value:!0});fe.VerificationRequestEvent=fe.VerificationRequest=fe.START_TYPE=fe.REQUEST_TYPE=fe.READY_TYPE=fe.Phase=fe.PHASE_UNSENT=fe.PHASE_STARTED=fe.PHASE_REQUESTED=fe.PHASE_READY=fe.PHASE_DONE=fe.PHASE_CANCELLED=fe.EVENT_PREFIX=fe.DONE_TYPE=fe.CANCEL_TYPE=void 0;var kt=eD(Y.exports),Ji=ie,Xi=Le,ym=dr,tD=je;const rD=10*60*1e3,nD=2*60*1e3,iD=3*1e3,Ns="m.key.verification.";fe.EVENT_PREFIX=Ns;const ir=Ns+"request";fe.REQUEST_TYPE=ir;const _r=Ns+"start";fe.START_TYPE=_r;const is=Ns+"cancel";fe.CANCEL_TYPE=is;const z_=Ns+"done";fe.DONE_TYPE=z_;const Ci=Ns+"ready";fe.READY_TYPE=Ci;let ii;fe.Phase=ii;(function(n){n[n.Unsent=1]="Unsent",n[n.Requested=2]="Requested",n[n.Ready=3]="Ready",n[n.Started=4]="Started",n[n.Cancelled=5]="Cancelled",n[n.Done=6]="Done"})(ii||(fe.Phase=ii={}));const fn=ii.Unsent;fe.PHASE_UNSENT=fn;const Ur=ii.Requested;fe.PHASE_REQUESTED=Ur;const pn=ii.Ready;fe.PHASE_READY=pn;const ss=ii.Started;fe.PHASE_STARTED=ss;const co=ii.Cancelled;fe.PHASE_CANCELLED=co;const lo=ii.Done;fe.PHASE_DONE=lo;let Yn;fe.VerificationRequestEvent=Yn;(function(n){n.Change="change"})(Yn||(fe.VerificationRequestEvent=Yn={}));class sD extends tD.TypedEventEmitter{constructor(e,t,r){super(),this.channel=e,this.verificationMethods=t,this.client=r,(0,kt.default)(this,"eventsByUs",new Map),(0,kt.default)(this,"eventsByThem",new Map),(0,kt.default)(this,"_observeOnly",!1),(0,kt.default)(this,"timeoutTimer",null),(0,kt.default)(this,"_accepting",!1),(0,kt.default)(this,"_declining",!1),(0,kt.default)(this,"verifierHasFinished",!1),(0,kt.default)(this,"_cancelled",!1),(0,kt.default)(this,"_chosenMethod",null),(0,kt.default)(this,"_qrCodeData",null),(0,kt.default)(this,"requestReceivedAt",null),(0,kt.default)(this,"commonMethods",[]),(0,kt.default)(this,"_phase",void 0),(0,kt.default)(this,"_cancellingUserId",void 0),(0,kt.default)(this,"_verifier",void 0),(0,kt.default)(this,"cancelOnTimeout",()=>{try{this.initiatedByMe?this.cancel({reason:"Other party didn't accept in time",code:"m.timeout"}):this.cancel({reason:"User didn't accept in time",code:"m.timeout"})}catch(i){Ji.logger.error("Error while cancelling verification request",i)}}),this.channel.request=this,this.setPhase(fn,!1)}static validateEvent(e,t,r){const i=t.getContent();return!e||!e.startsWith(Ns)?!1:i?(e===ir||e===Ci)&&!Array.isArray(i.methods)?(Ji.logger.log("VerificationRequest: validateEvent: fail because methods"),!1):(e===ir||e===Ci||e===_r)&&(typeof i.from_device!="string"||i.from_device.length===0)?(Ji.logger.log("VerificationRequest: validateEvent: fail because from_device"),!1):!0:(Ji.logger.log("VerificationRequest: validateEvent: no content"),!1)}get invalid(){return this.phase===fn}get requested(){return this.phase===Ur}get cancelled(){return this.phase===co}get ready(){return this.phase===pn}get started(){return this.phase===ss}get done(){return this.phase===lo}get methods(){return this.commonMethods}get chosenMethod(){return this._chosenMethod}calculateEventTimeout(e){let t=this.channel.getTimestamp(e)+rD;if(this.requestReceivedAt&&!this.initiatedByMe&&this.phase<=Ur){const r=this.requestReceivedAt+nD;t=Math.min(t,r)}return Math.max(0,t-Date.now())}get timeout(){const e=this.getEventByEither(ir);return e?this.calculateEventTimeout(e):0}get requestEvent(){return this.getEventByEither(ir)}get phase(){return this._phase}get verifier(){return this._verifier}get canAccept(){return this.phase<pn&&!this._accepting&&!this._declining}get accepting(){return this._accepting}get declining(){return this._declining}get pending(){return!this.observeOnly&&this._phase!==lo&&this._phase!==co}get qrCodeData(){return this._qrCodeData}otherPartySupportsMethod(e,t=!1){if(!t&&!this.ready&&!this.started)return!1;const r=this.eventsByThem.get(ir)||this.eventsByThem.get(Ci);if(!r){if(this.started&&this.initiatedByMe){const o=this.eventsByUs.get(_r),a=o&&o.getContent(),l=a&&a.method;return e==l}return!1}const i=r.getContent();if(!i)return!1;const{methods:s}=i;return Array.isArray(s)?s.includes(e):!1}get initiatedByMe(){const e=this.eventsByUs.size+this.eventsByThem.size===0;if(this._phase===fn&&e)return!0;const t=this.eventsByUs.has(ir),r=this.eventsByThem.has(ir);if(t&&!r)return!0;if(!t&&r)return!1;const i=this.eventsByUs.has(_r),s=this.eventsByThem.has(_r);return!!(i&&!s)}get requestingUserId(){return this.initiatedByMe?this.client.getUserId():this.otherUserId}get receivingUserId(){return this.initiatedByMe?this.otherUserId:this.client.getUserId()}get otherUserId(){return this.channel.userId}get isSelfVerification(){return this.client.getUserId()===this.otherUserId}get cancellingUserId(){const e=this.eventsByUs.get(is),t=this.eventsByThem.get(is);if(e&&(!t||e.getId()<t.getId()))return e.getSender();if(t)return t.getSender()}get cancellationCode(){const e=this.getEventByEither(is);return e?e.getContent().code:null}get observeOnly(){return this._observeOnly}get targetDevice(){const r=(this.eventsByThem.get(ir)||this.eventsByThem.get(Ci)||this.eventsByThem.get(_r)).getContent().from_device;return{userId:this.otherUserId,deviceId:r}}beginKeyVerification(e,t=null){if(!this.observeOnly&&!this._verifier&&(this.phase===Ur||this.phase===pn||this.phase===fn&&this.channel.canCreateRequest(_r))){if(this.commonMethods.length&&!this.commonMethods.includes(e)||(this._verifier=this.createVerifier(e,null,t),!this._verifier))throw(0,Xi.newUnknownMethodError)();this._chosenMethod=e}return this._verifier}async sendRequest(){if(!this.observeOnly&&this._phase===fn){const e=[...this.verificationMethods.keys()];await this.channel.send(ir,{methods:e})}}async cancel({reason:e="User declined",code:t="m.user"}={}){if(!this.observeOnly&&this._phase!==co){if(this._declining=!0,this.emit(Yn.Change),this._verifier)return this._verifier.cancel((0,Xi.errorFactory)(t,e)());this._cancellingUserId=this.client.getUserId(),await this.channel.send(is,{code:t,reason:e})}}async accept(){if(!this.observeOnly&&this.phase===Ur&&!this.initiatedByMe){const e=[...this.verificationMethods.keys()];this._accepting=!0,this.emit(Yn.Change),await this.channel.send(Ci,{methods:e})}}waitFor(e){return new Promise((t,r)=>{const i=()=>{let s=!1;return e(this)?(t(this),s=!0):this.cancelled&&(r(new Error("cancelled")),s=!0),s&&this.off(Yn.Change,i),s};i()||this.on(Yn.Change,i)})}setPhase(e,t=!0){this._phase=e,t&&this.emit(Yn.Change)}getEventByEither(e){return this.eventsByThem.get(e)||this.eventsByUs.get(e)}getEventBy(e,t=!1){return t?this.eventsByThem.get(e):this.eventsByUs.get(e)}calculatePhaseTransitions(){const e=[{phase:fn}],t=()=>e[e.length-1].phase,r=this.eventsByThem.has(ir),i=this.getEventBy(ir,r);i&&e.push({phase:Ur,event:i});const s=i&&this.getEventBy(Ci,!r);s&&t()===Ur&&e.push({phase:pn,event:s});let o;if(s||!i){const u=this.eventsByThem.get(_r),c=this.eventsByUs.get(_r);u&&c?o=u.getSender()<c.getSender()?u:c:o=u||c}else o=this.getEventBy(_r,!r);if(o){const u=t()===Ur&&i.getSender()!==o.getSender(),c=t()===fn&&this.channel.canCreateRequest(_r);(u||t()===pn||c)&&e.push({phase:ss,event:o})}const a=this.eventsByUs.get(z_);(this.verifierHasFinished||a&&t()===ss)&&e.push({phase:lo});const l=this.getEventByEither(is);return(this._cancelled||l)&&t()!==lo&&e.push({phase:co,event:l}),e}transitionToPhase(e){const{phase:t,event:r}=e;if((t===Ur||t===pn)&&!this.wasSentByOwnDevice(r)){const i=r.getContent();this.commonMethods=i.methods.filter(s=>this.verificationMethods.has(s))}if(this.observeOnly||(t===Ur||t===ss||t===pn)&&this.channel.receiveStartFromOtherDevices&&this.wasSentByOwnUser(r)&&!this.wasSentByOwnDevice(r)&&(this._observeOnly=!0),t===ss){const{method:i}=r.getContent();!this._verifier&&!this.observeOnly&&(this._verifier=this.createVerifier(i,r),this._verifier?this._chosenMethod=i:this.cancel({code:"m.unknown_method",reason:`Unknown method: ${i}`}))}}applyPhaseTransitions(){const e=this.calculatePhaseTransitions(),t=e.findIndex(i=>i.phase===this.phase),r=e.slice(t+1);for(const i of r)this.transitionToPhase(i);return r}isWinningStartRace(e){if(e.getType()!==_r)return!1;const t=this._verifier.startEvent;let r;if(this.isSelfVerification)if(t){const s=t.getContent();r=s&&s.from_device}else r=this.client.getDeviceId();else t?r=t.getSender():r=this.client.getUserId();let i;if(this.isSelfVerification){const s=e.getContent();i=s&&s.from_device}else i=e.getSender();return i<r}hasEventId(e){for(const t of this.eventsByUs.values())if(t.getId()===e)return!0;for(const t of this.eventsByThem.values())if(t.getId()===e)return!0;return!1}async handleEvent(e,t,r,i,s){if(this.done||this.cancelled)return;const o=this._observeOnly;if(this.adjustObserveOnly(t,r),!this.observeOnly&&!i&&await this.cancelOnError(e,t)||(s?this.eventsByUs.has(e):this.eventsByThem.has(e)))return;const l=this.phase;this.addEvent(e,t,s);const u=this.applyPhaseTransitions();try{if(this._verifier&&!this.observeOnly){const g=this.isWinningStartRace(t);if(this._verifier.canSwitchStartEvent(t)&&g)this._verifier.switchStartEvent(t);else if(!i){var c;(e===is||(c=this._verifier.events)!==null&&c!==void 0&&c.includes(e))&&this._verifier.handleEvent(t)}}if(u.length){r&&u.some(f=>f.phase===pn)&&this.otherPartySupportsMethod(ym.SCAN_QR_CODE_METHOD,!0)&&(this._qrCodeData=await ym.QRCodeData.create(this,this.client));const g=u[u.length-1],{phase:m}=g;this.setupTimeout(m),this.setPhase(m)}else this._observeOnly!==o&&this.emit(Yn.Change)}finally{Ji.logger.log(`Verification request ${this.channel.transactionId}: ${e} event with id:${t.getId()}, content:${JSON.stringify(t.getContent())} deviceId:${this.channel.deviceId}, sender:${t.getSender()}, isSentByUs:${s}, isLiveEvent:${r}, isRemoteEcho:${i}, phase:${l}=>${this.phase}, observeOnly:${o}=>${this._observeOnly}`)}}setupTimeout(e){!this.timeoutTimer&&!this.observeOnly&&e===Ur&&(this.timeoutTimer=setTimeout(this.cancelOnTimeout,this.timeout)),this.timeoutTimer&&(e===ss||e===pn||e===lo||e===co)&&(clearTimeout(this.timeoutTimer),this.timeoutTimer=null)}async cancelOnError(e,t){if(e===_r){const s=t.getContent().method;if(!this.verificationMethods.has(s))return await this.cancel((0,Xi.errorFromEvent)((0,Xi.newUnknownMethodError)())),!0}const r=e===ir&&this.phase!==fn,i=e===Ci&&this.phase!==Ur;if(this.phase!==fn&&(r||i)){Ji.logger.warn(`Cancelling, unexpected ${e} verification event from ${t.getSender()}`);const s=`Unexpected ${e} event in phase ${this.phase}`;return await this.cancel((0,Xi.errorFromEvent)((0,Xi.newUnexpectedMessageError)({reason:s}))),!0}return!1}adjustObserveOnly(e,t=!1){t||(this._observeOnly=!0),this.calculateEventTimeout(e)<iD&&(this._observeOnly=!0)}addEvent(e,t,r=!1){if(r?this.eventsByUs.set(e,t):this.eventsByThem.set(e,t),e===ir){for(const[i,s]of this.eventsByThem.entries())s.getSender()!==this.otherUserId&&this.eventsByThem.delete(i);this.requestReceivedAt=Date.now()}}createVerifier(e,t=null,r=null){r||(r=this.targetDevice);const{userId:i,deviceId:s}=r,o=this.verificationMethods.get(e);if(!o){Ji.logger.warn("could not find verifier constructor for method",e);return}return new o(this.channel,this.client,i,s,t,this)}wasSentByOwnUser(e){return e.getSender()===this.client.getUserId()}wasSentByOwnDevice(e){if(!this.wasSentByOwnUser(e))return!1;const t=e.getContent();return!(!t||t.from_device!==this.client.getDeviceId())}onVerifierCancelled(){this._cancelled=!0;const e=this.applyPhaseTransitions();e.length&&this.setPhase(e[e.length-1].phase)}onVerifierFinished(){this.channel.send("m.key.verification.done",{}),this.verifierHasFinished=!0;const e=this.applyPhaseTransitions();e.length&&this.setPhase(e[e.length-1].phase)}getEventFromOtherParty(e){return this.eventsByThem.get(e)}}fe.VerificationRequest=sD;var ko={},oD=G.exports;Object.defineProperty(ko,"__esModule",{value:!0});ko.InRoomRequests=ko.InRoomChannel=void 0;var J_=oD(Y.exports),Kt=fe,bd=ie,aD=ne;const vm=aD.EventType.RoomMessage,_m="m.reference",Em="m.relates_to";class lr{constructor(e,t,r=null){this.client=e,this.roomId=t,this.userId=r,(0,J_.default)(this,"requestEventId",null)}get receiveStartFromOtherDevices(){return!0}get transactionId(){return this.requestEventId}static getOtherPartyUserId(e,t){if(lr.getEventType(e)!==Kt.REQUEST_TYPE)return;const i=t.getUserId(),s=e.getSender(),a=e.getContent().to;if(s===i)return a;if(a===i)return s}getTimestamp(e){return e.getTs()}static canCreateRequest(e){return e===Kt.REQUEST_TYPE}canCreateRequest(e){return lr.canCreateRequest(e)}static getTransactionId(e){if(lr.getEventType(e)===Kt.REQUEST_TYPE)return e.getId();{const t=e.getRelation();if(t&&t.rel_type===_m)return t.event_id}}static validateEvent(e,t){const r=lr.getTransactionId(e);if(typeof r!="string"||r.length===0)return!1;const i=lr.getEventType(e),s=e.getContent();if(i===Kt.REQUEST_TYPE){if(!s||typeof s.to!="string"||!s.to.length)return bd.logger.log("InRoomChannel: validateEvent: no valid to "+(s&&s.to)),!1;if(!lr.getOtherPartyUserId(e,t))return bd.logger.log(`InRoomChannel: validateEvent: not directed to or sent by me: ${e.getSender()}, ${s&&s.to}`),!1}return Kt.VerificationRequest.validateEvent(i,e,t)}static getEventType(e){const t=e.getType();if(t===vm){const r=e.getContent();if(r){const{msgtype:i}=r;if(i===Kt.REQUEST_TYPE)return Kt.REQUEST_TYPE}}return t&&t!==Kt.REQUEST_TYPE?t:""}async handleEvent(e,t,r=!1){if(t.hasEventId(e.getId()))return;const i=lr.getEventType(e);if(e.getRoomId()!==this.roomId)return;if(this.userId===null){const u=lr.getOtherPartyUserId(e,this.client);u&&(this.userId=u)}const s=this.client.getUserId(),o=e.getSender();if(this.userId!==null&&o!==s&&o!==this.userId){bd.logger.log(`InRoomChannel: ignoring verification event from non-participating sender ${o}`);return}this.requestEventId===null&&(this.requestEventId=lr.getTransactionId(e));const a=!!e.getUnsigned().transaction_id,l=e.getSender()===this.client.getUserId();return await t.handleEvent(i,e,r,a,l)}completedContentFromEvent(e){const t=Object.assign({},e.getContent());return t[Em]=e.getRelation(),t}completeContent(e,t){return t=Object.assign({},t),(e===Kt.REQUEST_TYPE||e===Kt.READY_TYPE||e===Kt.START_TYPE)&&(t.from_device=this.client.getDeviceId()),e===Kt.REQUEST_TYPE?t={body:this.client.getUserId()+" is requesting to verify your key, but your client does not support in-chat key verification. You will need to use legacy key verification to verify keys.",msgtype:Kt.REQUEST_TYPE,to:this.userId,from_device:t.from_device,methods:t.methods}:t[Em]={rel_type:_m,event_id:this.transactionId},t}send(e,t){const r=this.completeContent(e,t);return this.sendCompleted(e,r)}async sendCompleted(e,t){let r=e;e===Kt.REQUEST_TYPE&&(r=vm);const i=await this.client.sendEvent(this.roomId,r,t);e===Kt.REQUEST_TYPE&&(this.requestEventId=i.event_id)}}ko.InRoomChannel=lr;class cD{constructor(){(0,J_.default)(this,"requestsByRoomId",new Map)}getRequest(e){const t=e.getRoomId(),r=lr.getTransactionId(e);return this.getRequestByTxnId(t,r)}getRequestByChannel(e){return this.getRequestByTxnId(e.roomId,e.transactionId)}getRequestByTxnId(e,t){const r=this.requestsByRoomId.get(e);if(r)return r.get(t)}setRequest(e,t){this.doSetRequest(e.getRoomId(),lr.getTransactionId(e),t)}setRequestByChannel(e,t){this.doSetRequest(e.roomId,e.transactionId,t)}doSetRequest(e,t,r){let i=this.requestsByRoomId.get(e);i||(i=new Map,this.requestsByRoomId.set(e,i)),i.set(t,r)}removeRequest(e){const t=e.getRoomId(),r=this.requestsByRoomId.get(t);r&&(r.delete(lr.getTransactionId(e)),r.size===0&&this.requestsByRoomId.delete(t))}findRequestInProgress(e){const t=this.requestsByRoomId.get(e);if(t){for(const r of t.values())if(r.pending)return r}}}ko.InRoomRequests=cD;var Co={},lD=G.exports;Object.defineProperty(Co,"__esModule",{value:!0});Co.ToDeviceRequests=Co.ToDeviceChannel=void 0;var X_=lD(Y.exports),uD=li,la=ie,$e=fe,Sm=Le,dD=Ht;class hs{constructor(e,t,r,i=null,s=null){this.client=e,this.userId=t,this.devices=r,this.transactionId=i,this.deviceId=s,(0,X_.default)(this,"request",void 0)}isToDevices(e){if(e.length===this.devices.length){for(const t of e)if(!this.devices.includes(t))return!1;return!0}else return!1}static getEventType(e){return e.getType()}static getTransactionId(e){const t=e.getContent();return t&&t.transaction_id}static canCreateRequest(e){return e===$e.REQUEST_TYPE||e===$e.START_TYPE}canCreateRequest(e){return hs.canCreateRequest(e)}static validateEvent(e,t){if(e.isCancelled())return la.logger.warn("Ignoring flagged verification request from "+e.getSender()),!1;const r=e.getContent();if(!r)return la.logger.warn("ToDeviceChannel.validateEvent: invalid: no content"),!1;if(!r.transaction_id)return la.logger.warn("ToDeviceChannel.validateEvent: invalid: no transaction_id"),!1;const i=e.getType();if(i===$e.REQUEST_TYPE){if(!Number.isFinite(r.timestamp))return la.logger.warn("ToDeviceChannel.validateEvent: invalid: no timestamp"),!1;if(e.getSender()===t.getUserId()&&r.from_device==t.getDeviceId())return la.logger.warn("ToDeviceChannel.validateEvent: invalid: from own device"),!1}return $e.VerificationRequest.validateEvent(i,e,t)}getTimestamp(e){const t=e.getContent();return t&&t.timestamp}async handleEvent(e,t,r=!1){const i=e.getType(),s=e.getContent();if(i===$e.REQUEST_TYPE||i===$e.READY_TYPE||i===$e.START_TYPE){this.transactionId||(this.transactionId=s.transaction_id);const u=s.from_device;if(!this.deviceId&&this.devices.includes(u)&&(this.deviceId=u),!this.deviceId||this.deviceId!==u){const c=this.completeContent($e.CANCEL_TYPE,(0,Sm.errorFromEvent)((0,Sm.newUnexpectedMessageError)()));return this.sendToDevices($e.CANCEL_TYPE,c,[u])}}const o=t.phase===$e.PHASE_STARTED||t.phase===$e.PHASE_READY;await t.handleEvent(e.getType(),e,r,!1,!1);const a=t.phase===$e.PHASE_STARTED||t.phase===$e.PHASE_READY;if((i===$e.START_TYPE||i===$e.READY_TYPE)&&!o&&a&&this.deviceId){const u=this.devices.filter(c=>c!==this.deviceId&&c!==this.client.getDeviceId());if(u.length){const c=this.completeContent($e.CANCEL_TYPE,{code:"m.accepted",reason:"Verification request accepted by another device"});await this.sendToDevices($e.CANCEL_TYPE,c,u)}}}completedContentFromEvent(e){return e.getContent()}completeContent(e,t){return t=Object.assign({},t),this.transactionId&&(t.transaction_id=this.transactionId),(e===$e.REQUEST_TYPE||e===$e.READY_TYPE||e===$e.START_TYPE)&&(t.from_device=this.client.getDeviceId()),e===$e.REQUEST_TYPE&&(t.timestamp=Date.now()),t}send(e,t={}){(e===$e.REQUEST_TYPE||e===$e.START_TYPE)&&!this.transactionId&&(this.transactionId=hs.makeTransactionId());const r=this.completeContent(e,t);return this.sendCompleted(e,r)}async sendCompleted(e,t){let r;e===$e.REQUEST_TYPE||e===$e.CANCEL_TYPE&&!this.deviceId?r=await this.sendToDevices(e,t,this.devices):r=await this.sendToDevices(e,t,[this.deviceId]);const i=new dD.MatrixEvent({sender:this.client.getUserId(),content:t,type:e});return await this.request.handleEvent(e,i,!0,!0,!0),r}async sendToDevices(e,t,r){if(r.length){const i={};for(const s of r)i[s]=t;await this.client.sendToDevice(e,{[this.userId]:i})}}static makeTransactionId(){return(0,uD.randomString)(32)}}Co.ToDeviceChannel=hs;class hD{constructor(){(0,X_.default)(this,"requestsByUserId",new Map)}getRequest(e){return this.getRequestBySenderAndTxnId(e.getSender(),hs.getTransactionId(e))}getRequestByChannel(e){return this.getRequestBySenderAndTxnId(e.userId,e.transactionId)}getRequestBySenderAndTxnId(e,t){const r=this.requestsByUserId.get(e);if(r)return r.get(t)}setRequest(e,t){this.setRequestBySenderAndTxnId(e.getSender(),hs.getTransactionId(e),t)}setRequestByChannel(e,t){this.setRequestBySenderAndTxnId(e.userId,e.transactionId,t)}setRequestBySenderAndTxnId(e,t,r){let i=this.requestsByUserId.get(e);i||(i=new Map,this.requestsByUserId.set(e,i)),i.set(t,r)}removeRequest(e){const t=e.getSender(),r=this.requestsByUserId.get(t);r&&(r.delete(hs.getTransactionId(e)),r.size===0&&this.requestsByUserId.delete(t))}findRequestInProgress(e,t){const r=this.requestsByUserId.get(e);if(r){for(const i of r.values())if(i.pending&&i.channel.isToDevices(t))return i}}getRequestsInProgress(e){const t=this.requestsByUserId.get(e);return t?Array.from(t.values()).filter(r=>r.pending):[]}}Co.ToDeviceRequests=hD;var gu={},fD=G.exports;Object.defineProperty(gu,"__esModule",{value:!0});gu.IllegalMethod=void 0;var pD=fD(Y.exports),gD=Zr;class Kf extends gD.VerificationBase{constructor(...e){super(...e),(0,pD.default)(this,"doVerification",async()=>{throw new Error("Verification is not possible with this method")})}static factory(e,t,r,i,s,o){return new Kf(e,t,r,i,s,o)}static get NAME(){return"org.matrix.illegal_method"}}gu.IllegalMethod=Kf;var Ts={},Q_=G.exports;Object.defineProperty(Ts,"__esModule",{value:!0});Ts.DehydrationManager=Ts.DEHYDRATION_ALGORITHM=void 0;var ua=Q_(Y.exports),wd=Q_(cu),bm=De,Rd=qr,wm=di,Nn=ie,Rm=me;const fl="org.matrix.msc2697.v1.olm.libolm_pickle";Ts.DEHYDRATION_ALGORITHM=fl;const Im=7*24*60*60*1e3;class mD{constructor(e){this.crypto=e,(0,ua.default)(this,"inProgress",!1),(0,ua.default)(this,"timeoutId",void 0),(0,ua.default)(this,"key",void 0),(0,ua.default)(this,"keyInfo",void 0),(0,ua.default)(this,"deviceDisplayName",void 0),this.getDehydrationKeyFromCache()}async getDehydrationKeyFromCache(){return await this.crypto.cryptoStore.doTxn("readonly",[Rd.IndexedDBCryptoStore.STORE_ACCOUNT],e=>{this.crypto.cryptoStore.getSecretStorePrivateKey(e,async t=>{if(t){const{key:r,keyInfo:i,deviceDisplayName:s,time:o}=t,a=Buffer.from(this.crypto.olmDevice.pickleKey),l=await(0,wm.decryptAES)(r,a,fl);this.key=(0,bm.decodeBase64)(l),this.keyInfo=i,this.deviceDisplayName=s;const u=Date.now(),c=Math.max(1,o+Im-u);this.timeoutId=V.setTimeout(this.dehydrateDevice.bind(this),c)}},"dehydration")})}async setKeyAndQueueDehydration(e,t={},r=void 0){await this.setKey(e,t,r)||this.dehydrateDevice()}async setKey(e,t={},r=void 0){if(!e){this.timeoutId&&(V.clearTimeout(this.timeoutId),this.timeoutId=void 0),await this.crypto.cryptoStore.doTxn("readwrite",[Rd.IndexedDBCryptoStore.STORE_ACCOUNT],s=>{this.crypto.cryptoStore.storeSecretStorePrivateKey(s,"dehydration",null)}),this.key=void 0,this.keyInfo=void 0;return}let i=this.key&&e.length==this.key.length;for(let s=0;i&&s<e.length;s++)e[s]!=this.key[s]&&(i=!1);return i||(this.key=e,this.keyInfo=t,this.deviceDisplayName=r),i}async dehydrateDevice(){if(this.inProgress){Nn.logger.log("Dehydration already in progress -- not starting new dehydration");return}this.inProgress=!0,this.timeoutId&&(V.clearTimeout(this.timeoutId),this.timeoutId=void 0);try{const e=Buffer.from(this.crypto.olmDevice.pickleKey),t=await(0,wm.encryptAES)((0,bm.encodeBase64)(this.key),e,fl);await this.crypto.cryptoStore.doTxn("readwrite",[Rd.IndexedDBCryptoStore.STORE_ACCOUNT],R=>{this.crypto.cryptoStore.storeSecretStorePrivateKey(R,"dehydration",{keyInfo:this.keyInfo,key:t,deviceDisplayName:this.deviceDisplayName,time:Date.now()})}),Nn.logger.log("Attempting to dehydrate device"),Nn.logger.log("Creating account");const r=new V.Olm.Account;r.create();const i=JSON.parse(r.identity_keys()),s=r.max_number_of_one_time_keys();r.generate_one_time_keys(s/2),r.generate_fallback_key();const o=JSON.parse(r.one_time_keys()),a=JSON.parse(r.fallback_key());r.mark_keys_as_published();const l=r.pickle(new Uint8Array(this.key)),u={algorithm:fl,account:l};this.keyInfo.passphrase&&(u.passphrase=this.keyInfo.passphrase),Nn.logger.log("Uploading account to server");const g=(await this.crypto.baseApis.http.authedRequest(void 0,Rm.Method.Put,"/dehydrated_device",void 0,{device_data:u,initial_device_display_name:this.deviceDisplayName},{prefix:"/_matrix/client/unstable/org.matrix.msc2697.v2"})).device_id;Nn.logger.log("Preparing device keys",g);const m={algorithms:this.crypto.supportedAlgorithms,device_id:g,user_id:this.crypto.userId,keys:{[`ed25519:${g}`]:i.ed25519,[`curve25519:${g}`]:i.curve25519}},f=r.sign(wd.default.stringify(m));m.signatures={[this.crypto.userId]:{[`ed25519:${g}`]:f}},this.crypto.crossSigningInfo.getId("self_signing")&&await this.crypto.crossSigningInfo.signObject(m,"self_signing"),Nn.logger.log("Preparing one-time keys");const _={};for(const[R,T]of Object.entries(o.curve25519)){const C={key:T},S=r.sign(wd.default.stringify(C));C.signatures={[this.crypto.userId]:{[`ed25519:${g}`]:S}},_[`signed_curve25519:${R}`]=C}Nn.logger.log("Preparing fallback keys");const I={};for(const[R,T]of Object.entries(a.curve25519)){const C={key:T,fallback:!0},S=r.sign(wd.default.stringify(C));C.signatures={[this.crypto.userId]:{[`ed25519:${g}`]:S}},I[`signed_curve25519:${R}`]=C}return Nn.logger.log("Uploading keys to server"),await this.crypto.baseApis.http.authedRequest(void 0,Rm.Method.Post,"/keys/upload/"+encodeURI(g),void 0,{device_keys:m,one_time_keys:_,"org.matrix.msc2732.fallback_keys":I}),Nn.logger.log("Done dehydrating"),this.timeoutId=V.setTimeout(this.dehydrateDevice.bind(this),Im),g}finally{this.inProgress=!1}}stop(){this.timeoutId&&(V.clearTimeout(this.timeoutId),this.timeoutId=void 0)}}Ts.DehydrationManager=mD;var Sr={},yD=G.exports;Object.defineProperty(Sr,"__esModule",{value:!0});Sr.algorithmsByName=Sr.DefaultAlgorithm=Sr.Curve25519=Sr.BackupManager=Sr.Aes256=void 0;var ho=yD(Y.exports),vD=ot,Et=ie,da=De,Z_=$s,Xh=W,Tm=qr,_D=Go,ha=di,ED=wr,Js=Gt;const SD=200;class $a{constructor(e,t){this.baseApis=e,this.getKey=t,(0,ho.default)(this,"algorithm",void 0),(0,ho.default)(this,"backupInfo",void 0),(0,ho.default)(this,"checkedForBackup",void 0),(0,ho.default)(this,"sendingBackups",void 0),this.checkedForBackup=!1,this.sendingBackups=!1}get version(){return this.backupInfo&&this.backupInfo.version}static checkBackupVersion(e){const t=pl[e.algorithm];if(!t)throw new Error("Unknown backup algorithm: "+e.algorithm);if(typeof e.auth_data!="object")throw new Error("Invalid backup data returned");return t.checkBackupVersion(e)}static async makeAlgorithm(e,t){const r=pl[e.algorithm];if(!r)throw new Error("Unknown backup algorithm");return await r.init(e.auth_data,t)}async enableKeyBackup(e){this.backupInfo=e,this.algorithm&&this.algorithm.free(),this.algorithm=await $a.makeAlgorithm(e,this.getKey),this.baseApis.emit(Js.CryptoEvent.KeyBackupStatus,!0),this.scheduleKeyBackupSend()}disableKeyBackup(){this.algorithm&&this.algorithm.free(),this.algorithm=void 0,this.backupInfo=void 0,this.baseApis.emit(Js.CryptoEvent.KeyBackupStatus,!1)}getKeyBackupEnabled(){return this.checkedForBackup?Boolean(this.algorithm):null}async prepareKeyBackupVersion(e,t){const r=t?pl[t]:eE;if(!r)throw new Error("Unknown backup algorithm");const[i,s]=await r.prepare(e),o=(0,_D.encodeRecoveryKey)(i);return{algorithm:r.algorithmName,auth_data:s,recovery_key:o,privateKey:i}}async createKeyBackupVersion(e){this.algorithm=await $a.makeAlgorithm(e,this.getKey)}async checkAndStart(){if(Et.logger.log("Checking key backup status..."),this.baseApis.isGuest())return Et.logger.log("Skipping key backup check since user is guest"),this.checkedForBackup=!0,null;let e;try{e=await this.baseApis.getKeyBackupVersion()}catch(r){return Et.logger.log("Error checking for active key backup",r),r.httpStatus===404&&(this.checkedForBackup=!0),null}this.checkedForBackup=!0;const t=await this.isKeyBackupTrusted(e);return t.usable&&!this.backupInfo?(Et.logger.log("Found usable key backup v"+e.version+": enabling key backups"),await this.enableKeyBackup(e)):!t.usable&&this.backupInfo?(Et.logger.log("No usable key backup: disabling key backup"),this.disableKeyBackup()):!t.usable&&!this.backupInfo?Et.logger.log("No usable key backup: not enabling key backup"):t.usable&&this.backupInfo&&(e.version!==this.backupInfo.version?(Et.logger.log("On backup version "+this.backupInfo.version+" but found version "+e.version+": switching."),this.disableKeyBackup(),await this.enableKeyBackup(e),await this.scheduleAllGroupSessionsForBackup()):Et.logger.log("Backup version "+e.version+" still current")),{backupInfo:e,trustInfo:t}}async checkKeyBackup(){return this.checkedForBackup=!1,this.checkAndStart()}async isKeyBackupTrusted(e){const t={usable:!1,trusted_locally:!1,sigs:[]};if(!e||!e.algorithm||!e.auth_data||!e.auth_data.signatures)return Et.logger.info("Key backup is absent or missing required data"),t;const r=await this.baseApis.crypto.getSessionBackupPrivateKey();if(r){let s;try{s=await $a.makeAlgorithm(e,async()=>r),await s.keyMatches(r)&&(Et.logger.info("Backup is trusted locally"),t.trusted_locally=!0)}catch{}finally{s&&s.free()}}const i=e.auth_data.signatures[this.baseApis.getUserId()]||{};for(const s of Object.keys(i)){const o=s.split(":");if(o[0]!=="ed25519"){Et.logger.log("Ignoring unknown signature type: "+o[0]);continue}const a={deviceId:o[1]},l=this.baseApis.crypto.crossSigningInfo.getId();if(l===a.deviceId){a.crossSigningId=!0;try{await(0,da.verifySignature)(this.baseApis.crypto.olmDevice,e.auth_data,this.baseApis.getUserId(),a.deviceId,l),a.valid=!0}catch(c){Et.logger.warn("Bad signature from cross signing key "+l,c),a.valid=!1}t.sigs.push(a);continue}const u=this.baseApis.crypto.deviceList.getStoredDevice(this.baseApis.getUserId(),a.deviceId);if(u){a.device=u,a.deviceTrust=await this.baseApis.checkDeviceTrust(this.baseApis.getUserId(),a.deviceId);try{await(0,da.verifySignature)(this.baseApis.crypto.olmDevice,e.auth_data,this.baseApis.getUserId(),u.deviceId,u.getFingerprint()),a.valid=!0}catch(c){Et.logger.info("Bad signature from key ID "+s+" userID "+this.baseApis.getUserId()+" device ID "+u.deviceId+" fingerprint: "+u.getFingerprint(),e.auth_data,c),a.valid=!1}}else a.valid=null,Et.logger.info("Ignoring signature from unknown key "+s);t.sigs.push(a)}return t.usable=t.sigs.some(s=>s.valid&&(s.device&&s.deviceTrust.isVerified()||s.crossSigningId)),t.usable=t.usable||t.trusted_locally,t}async scheduleKeyBackupSend(e=1e4){if(!this.sendingBackups){this.sendingBackups=!0;try{const t=Math.random()*e;await(0,Xh.sleep)(t,void 0);let r=0;for(;;){if(!this.algorithm)return;try{if(await this.backupPendingKeys(SD)===0)return;r=0}catch(i){if(r++,Et.logger.log("Key backup request failed",i),i.data&&(i.data.errcode=="M_NOT_FOUND"||i.data.errcode=="M_WRONG_ROOM_KEYS_VERSION"))throw await this.checkKeyBackup(),this.baseApis.crypto.emit(Js.CryptoEvent.KeyBackupFailed,i.data.errcode),i}r&&await(0,Xh.sleep)(1e3*Math.pow(2,Math.min(r-1,4)),void 0)}}finally{this.sendingBackups=!1}}}async backupPendingKeys(e){const t=await this.baseApis.crypto.cryptoStore.getSessionsNeedingBackup(e);if(!t.length)return 0;let r=await this.baseApis.crypto.cryptoStore.countSessionsNeedingBackup();this.baseApis.crypto.emit(Js.CryptoEvent.KeyBackupSessionsRemaining,r);const i={};for(const s of t){const o=s.sessionData.room_id;i[o]===void 0&&(i[o]={sessions:{}});const a=await this.baseApis.crypto.olmDevice.exportInboundGroupSession(s.senderKey,s.sessionId,s.sessionData);a.algorithm=da.MEGOLM_ALGORITHM;const l=(a.forwarding_curve25519_key_chain||[]).length,u=this.baseApis.crypto.deviceList.getUserByIdentityKey(da.MEGOLM_ALGORITHM,s.senderKey),c=this.baseApis.crypto.deviceList.getDeviceByIdentityKey(da.MEGOLM_ALGORITHM,s.senderKey),g=this.baseApis.crypto.checkDeviceInfoTrust(u,c).isVerified();i[o].sessions[s.sessionId]={first_message_index:a.first_known_index,forwarded_count:l,is_verified:g,session_data:await this.algorithm.encryptSession(a)}}return await this.baseApis.sendKeyBackup(void 0,void 0,this.backupInfo.version,{rooms:i}),await this.baseApis.crypto.cryptoStore.unmarkSessionsNeedingBackup(t),r=await this.baseApis.crypto.cryptoStore.countSessionsNeedingBackup(),this.baseApis.crypto.emit(Js.CryptoEvent.KeyBackupSessionsRemaining,r),t.length}async backupGroupSession(e,t){await this.baseApis.crypto.cryptoStore.markSessionsNeedingBackup([{senderKey:e,sessionId:t}]),this.backupInfo&&this.scheduleKeyBackupSend()}async scheduleAllGroupSessionsForBackup(){await this.flagAllGroupSessionsForBackup(),this.scheduleKeyBackupSend(0)}async flagAllGroupSessionsForBackup(){await this.baseApis.crypto.cryptoStore.doTxn("readwrite",[Tm.IndexedDBCryptoStore.STORE_INBOUND_GROUP_SESSIONS,Tm.IndexedDBCryptoStore.STORE_BACKUP],t=>{this.baseApis.crypto.cryptoStore.getAllEndToEndInboundGroupSessions(t,r=>{r!==null&&this.baseApis.crypto.cryptoStore.markSessionsNeedingBackup([r],t)})});const e=await this.baseApis.crypto.cryptoStore.countSessionsNeedingBackup();return this.baseApis.emit(Js.CryptoEvent.KeyBackupSessionsRemaining,e),e}countSessionsNeedingBackup(){return this.baseApis.crypto.cryptoStore.countSessionsNeedingBackup()}}Sr.BackupManager=$a;class Os{constructor(e,t,r){this.authData=e,this.publicKey=t,this.getKey=r}static async init(e,t){if(!e||!("public_key"in e))throw new Error("auth_data missing required information");const r=new V.Olm.PkEncryption;return r.set_recipient_key(e.public_key),new Os(e,r,t)}static async prepare(e){const t=new V.Olm.PkDecryption;try{const r={};if(!e)r.public_key=t.generate_key();else if(e instanceof Uint8Array)r.public_key=t.init_with_private_key(e);else{const s=await(0,Z_.keyFromPassphrase)(e);r.private_key_salt=s.salt,r.private_key_iterations=s.iterations,r.public_key=t.init_with_private_key(s.key)}return new V.Olm.PkEncryption().set_recipient_key(r.public_key),[t.get_private_key(),r]}finally{t.free()}}static checkBackupVersion(e){if(!("public_key"in e.auth_data))throw new Error("Invalid backup data returned")}get untrusted(){return!0}async encryptSession(e){const t=Object.assign({},e);return delete t.session_id,delete t.room_id,delete t.first_known_index,this.publicKey.encrypt(JSON.stringify(t))}async decryptSessions(e){const t=await this.getKey(),r=new V.Olm.PkDecryption;try{if(r.init_with_private_key(t)!==this.authData.public_key)throw{errcode:vD.MatrixClient.RESTORE_BACKUP_ERROR_BAD_KEY};const s=[];for(const[o,a]of Object.entries(e))try{const l=JSON.parse(r.decrypt(a.session_data.ephemeral,a.session_data.mac,a.session_data.ciphertext));l.session_id=o,s.push(l)}catch(l){Et.logger.log("Failed to decrypt megolm session from backup",l,a)}return s}finally{r.free()}}async keyMatches(e){const t=new V.Olm.PkDecryption;let r;try{r=t.init_with_private_key(e)}finally{t.free()}return r===this.authData.public_key}free(){this.publicKey.free()}}Sr.Curve25519=Os;(0,ho.default)(Os,"algorithmName","m.megolm_backup.v1.curve25519-aes-sha2");function bD(n){var e;const t=(0,Xh.getCrypto)();if(t)return t.randomBytes(n);if((e=window)!==null&&e!==void 0&&e.crypto){const r=new Uint8Array(n);return window.crypto.getRandomValues(r),r}throw new Error("No usable crypto implementation")}const wD=new ED.UnstableValue(null,"org.matrix.msc3270.v1.aes-hmac-sha2");class Po{constructor(e,t){this.authData=e,this.key=t}static async init(e,t){if(!e)throw new Error("auth_data missing");const r=await t();if(e.mac){const{mac:i}=await(0,ha.calculateKeyCheck)(r,e.iv);if(e.mac.replace(/=+$/g,"")!==i.replace(/=+/g,""))throw new Error("Key does not match")}return new Po(e,r)}static async prepare(e){let t;const r={};if(!e)t=bD(32);else if(e instanceof Uint8Array)t=new Uint8Array(e);else{const o=await(0,Z_.keyFromPassphrase)(e);r.private_key_salt=o.salt,r.private_key_iterations=o.iterations,t=o.key}const{iv:i,mac:s}=await(0,ha.calculateKeyCheck)(t);return r.iv=i,r.mac=s,[t,r]}static checkBackupVersion(e){if(!("iv"in e.auth_data&&"mac"in e.auth_data))throw new Error("Invalid backup data returned")}get untrusted(){return!1}async encryptSession(e){const t=Object.assign({},e);return delete t.session_id,delete t.room_id,delete t.first_known_index,await(0,ha.encryptAES)(JSON.stringify(t),this.key,e.session_id)}async decryptSessions(e){const t=[];for(const[r,i]of Object.entries(e))try{const s=JSON.parse(await(0,ha.decryptAES)(i.session_data,this.key,r));s.session_id=r,t.push(s)}catch(s){Et.logger.log("Failed to decrypt megolm session from backup",s,i)}return t}async keyMatches(e){if(this.authData.mac){const{mac:t}=await(0,ha.calculateKeyCheck)(e,this.authData.iv);return this.authData.mac.replace(/=+$/g,"")===t.replace(/=+/g,"")}else return!0}free(){this.key.fill(0)}}Sr.Aes256=Po;(0,ho.default)(Po,"algorithmName",wD.name);const pl={[Os.algorithmName]:Os,[Po.algorithmName]:Po};Sr.algorithmsByName=pl;const eE=Os;Sr.DefaultAlgorithm=eE;var tE=G.exports;Object.defineProperty(Gt,"__esModule",{value:!0});Gt.IncomingRoomKeyRequest=Gt.CryptoEvent=Gt.Crypto=void 0;Gt.fixBackupKey=ml;Gt.isCryptoAvailable=$D;Gt.verificationMethods=void 0;var oe=tE(Y.exports),RD=tE(cu),ID=sn,N=ie,Om=bs,Ct=nE(De),TD=ws,gl=Us,qc=nE(Af),Ln=Dt,km=To,Xs=Oo,OD=Rs,fa=qr,wa=dr,Qh=Is,kD=$s,Cm=Go,pa=fe,jc=ko,Yr=Co,Pm=gu,Vc=ci,Id=di,CD=Ts,PD=Sr,MD=hr,DD=rn,Bn=Ht,AD=ot,xD=je;function rE(n){if(typeof WeakMap!="function")return null;var e=new WeakMap,t=new WeakMap;return(rE=function(r){return r?t:e})(n)}function nE(n,e){if(!e&&n&&n.__esModule)return n;if(n===null||typeof n!="object"&&typeof n!="function")return{default:n};var t=rE(e);if(t&&t.has(n))return t.get(n);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in n)if(s!=="default"&&Object.prototype.hasOwnProperty.call(n,s)){var o=i?Object.getOwnPropertyDescriptor(n,s):null;o&&(o.get||o.set)?Object.defineProperty(r,s,o):r[s]=n[s]}return r.default=n,t&&t.set(n,r),r}const Kn=gl.DeviceInfo.DeviceVerification,Td={[wa.ReciprocateQRCode.NAME]:wa.ReciprocateQRCode,[Qh.SAS.NAME]:Qh.SAS,[wa.SHOW_QR_CODE_METHOD]:Pm.IllegalMethod,[wa.SCAN_QR_CODE_METHOD]:Pm.IllegalMethod},UD={RECIPROCATE_QR_CODE:wa.ReciprocateQRCode.NAME,SAS:Qh.SAS.NAME};Gt.verificationMethods=UD;function $D(){return Boolean(V.Olm)}const ND=60*60*1e3;let et;Gt.CryptoEvent=et;(function(n){n.DeviceVerificationChanged="deviceVerificationChanged",n.UserTrustStatusChanged="userTrustStatusChanged",n.UserCrossSigningUpdated="userCrossSigningUpdated",n.RoomKeyRequest="crypto.roomKeyRequest",n.RoomKeyRequestCancellation="crypto.roomKeyRequestCancellation",n.KeyBackupStatus="crypto.keyBackupStatus",n.KeyBackupFailed="crypto.keyBackupFailed",n.KeyBackupSessionsRemaining="crypto.keyBackupSessionsRemaining",n.KeySignatureUploadFailure="crypto.keySignatureUploadFailure",n.VerificationRequest="crypto.verification.request",n.Warning="crypto.warning",n.WillUpdateDevices="crypto.willUpdateDevices",n.DevicesUpdated="crypto.devicesUpdated",n.KeysChanged="crossSigning.keysChanged"})(et||(Gt.CryptoEvent=et={}));class LD extends xD.TypedEventEmitter{static getOlmVersion(){return Om.OlmDevice.getOlmVersion()}constructor(e,t,r,i,s,o,a,l){if(super(),this.baseApis=e,this.sessionStore=t,this.userId=r,this.deviceId=i,this.clientStore=s,this.cryptoStore=o,this.roomList=a,(0,oe.default)(this,"backupManager",void 0),(0,oe.default)(this,"crossSigningInfo",void 0),(0,oe.default)(this,"olmDevice",void 0),(0,oe.default)(this,"deviceList",void 0),(0,oe.default)(this,"dehydrationManager",void 0),(0,oe.default)(this,"secretStorage",void 0),(0,oe.default)(this,"reEmitter",void 0),(0,oe.default)(this,"verificationMethods",void 0),(0,oe.default)(this,"supportedAlgorithms",void 0),(0,oe.default)(this,"outgoingRoomKeyRequestManager",void 0),(0,oe.default)(this,"toDeviceVerificationRequests",void 0),(0,oe.default)(this,"inRoomVerificationRequests",void 0),(0,oe.default)(this,"trustCrossSignedDevices",!0),(0,oe.default)(this,"lastOneTimeKeyCheck",null),(0,oe.default)(this,"oneTimeKeyCheckInProgress",!1),(0,oe.default)(this,"roomEncryptors",{}),(0,oe.default)(this,"roomDecryptors",{}),(0,oe.default)(this,"deviceKeys",{}),(0,oe.default)(this,"globalBlacklistUnverifiedDevices",!1),(0,oe.default)(this,"globalErrorOnUnknownDevices",!0),(0,oe.default)(this,"receivedRoomKeyRequests",[]),(0,oe.default)(this,"receivedRoomKeyRequestCancellations",[]),(0,oe.default)(this,"processingRoomKeyRequests",!1),(0,oe.default)(this,"lazyLoadMembers",!1),(0,oe.default)(this,"roomDeviceTrackingState",{}),(0,oe.default)(this,"lastNewSessionForced",{}),(0,oe.default)(this,"sendKeyRequestsImmediately",!1),(0,oe.default)(this,"oneTimeKeyCount",void 0),(0,oe.default)(this,"needsNewFallback",void 0),(0,oe.default)(this,"fallbackCleanup",void 0),(0,oe.default)(this,"onDeviceListUserCrossSigningUpdated",async g=>{if(g===this.userId){const m=this.deviceList.getStoredCrossSigningForUser(g),f=m?m.getId():null,_=this.crossSigningInfo.getId();_&&f&&!(_!==f)?await this.checkOwnCrossSigningTrust():(this.storeTrustedSelfKeys(null),this.emit(et.KeysChanged,{}),this.emit(et.UserTrustStatusChanged,this.userId,this.checkUserTrust(g)))}else{await this.checkDeviceVerifications(g);const m=this.deviceList.getStoredCrossSigningForUser(g);m&&(m.updateCrossSigningVerifiedBefore(this.checkUserTrust(g).isCrossSigningVerified()),this.deviceList.setRawStoredCrossSigningForUser(g,m.toStorage())),this.emit(et.UserTrustStatusChanged,g,this.checkUserTrust(g))}}),(0,oe.default)(this,"onMembership",(g,m,f)=>{try{this.onRoomMembership(g,m,f)}catch(_){N.logger.error("Error handling membership change:",_)}}),(0,oe.default)(this,"onToDeviceEvent",g=>{try{N.logger.log(`received to_device ${g.getType()} from: ${g.getSender()} id: ${g.getId()}`),g.getType()=="m.room_key"||g.getType()=="m.forwarded_room_key"?this.onRoomKeyEvent(g):g.getType()=="m.room_key_request"?this.onRoomKeyRequestEvent(g):g.getType()==="m.secret.request"?this.secretStorage.onRequestReceived(g):g.getType()==="m.secret.send"?this.secretStorage.onSecretReceived(g):g.getType()==="m.room_key.withheld"||g.getType()==="org.matrix.room_key.withheld"?this.onRoomKeyWithheldEvent(g):g.getContent().transaction_id?this.onKeyVerificationMessage(g):g.getContent().msgtype==="m.bad.encrypted"?this.onToDeviceBadEncrypted(g):(g.isBeingDecrypted()||g.shouldAttemptDecryption())&&(g.isBeingDecrypted()||g.attemptDecryption(this),g.once(Bn.MatrixEventEvent.Decrypted,m=>{this.onToDeviceEvent(m)}))}catch(m){N.logger.error("Error handling toDeviceEvent:",m)}}),(0,oe.default)(this,"onTimelineEvent",(g,m,f,_,{liveEvent:I=!0}={})=>{if(!jc.InRoomChannel.validateEvent(g,this.baseApis))return;const R=T=>{const C=new jc.InRoomChannel(this.baseApis,T.getRoomId());return new pa.VerificationRequest(C,this.verificationMethods,this.baseApis)};this.handleVerificationEvent(g,this.inRoomVerificationRequests,R,I)}),this.reEmitter=new ID.TypedReEmitter(this),l){this.verificationMethods=new Map;for(const g of l)typeof g=="string"?Td[g]&&this.verificationMethods.set(g,Td[g]):g.NAME?this.verificationMethods.set(g.NAME,g):N.logger.warn(`Excluding unknown verification method ${g}`)}else this.verificationMethods=new Map(Object.entries(Td));this.backupManager=new PD.BackupManager(e,async()=>{const g=await this.getSessionBackupPrivateKey();if(g)return g;const m=await this.getSecret("m.megolm_backup.v1");if(m){const f=ml(m);if(f){const[_]=await this.getSecretStorageKey();await this.storeSecret("m.megolm_backup.v1",f,[_])}return Ct.decodeBase64(f||m)}if(this.baseApis.cryptoCallbacks&&this.baseApis.cryptoCallbacks.getBackupKey)return await this.baseApis.cryptoCallbacks.getBackupKey();throw new Error("Unable to get private key")}),this.olmDevice=new Om.OlmDevice(o),this.deviceList=new TD.DeviceList(e,o,this.olmDevice),this.deviceList.on(et.UserCrossSigningUpdated,this.onDeviceListUserCrossSigningUpdated),this.reEmitter.reEmit(this.deviceList,[et.DevicesUpdated,et.WillUpdateDevices]),this.supportedAlgorithms=Object.keys(qc.DECRYPTION_CLASSES),this.outgoingRoomKeyRequestManager=new OD.OutgoingRoomKeyRequestManager(e,this.deviceId,this.cryptoStore),this.toDeviceVerificationRequests=new Yr.ToDeviceRequests,this.inRoomVerificationRequests=new jc.InRoomRequests;const u=this.baseApis.cryptoCallbacks||{},c=(0,Ln.createCryptoStoreCacheCallbacks)(o,this.olmDevice);this.crossSigningInfo=new Ln.CrossSigningInfo(r,u,c),this.secretStorage=new Xs.SecretStorage(e,u,e),this.dehydrationManager=new CD.DehydrationManager(this),!u.getCrossSigningKey&&u.getSecretStorageKey&&(u.getCrossSigningKey=async g=>Ln.CrossSigningInfo.getFromSecretStorage(g,this.secretStorage))}async init({exportedOlmDevice:e,pickleKey:t}={}){N.logger.log("Crypto: initialising Olm..."),await V.Olm.init(),N.logger.log(e?"Crypto: initialising Olm device from exported device...":"Crypto: initialising Olm device..."),await this.olmDevice.init({fromExportedDevice:e,pickleKey:t}),N.logger.log("Crypto: loading device list..."),await this.deviceList.load(),this.deviceKeys["ed25519:"+this.deviceId]=this.olmDevice.deviceEd25519Key,this.deviceKeys["curve25519:"+this.deviceId]=this.olmDevice.deviceCurve25519Key,N.logger.log("Crypto: fetching own devices...");let r=this.deviceList.getRawStoredDevicesForUser(this.userId);if(r||(r={}),!r[this.deviceId]){N.logger.log("Crypto: adding this device to the store...");const i={keys:this.deviceKeys,algorithms:this.supportedAlgorithms,verified:Kn.VERIFIED,known:!0};r[this.deviceId]=i,this.deviceList.storeDevicesForUser(this.userId,r),this.deviceList.saveIfDirty()}await this.cryptoStore.doTxn("readonly",[fa.IndexedDBCryptoStore.STORE_ACCOUNT],i=>{this.cryptoStore.getCrossSigningKeys(i,s=>{s&&Object.keys(s).length!==0&&(N.logger.log("Loaded cross-signing public keys from crypto store"),this.crossSigningInfo.setKeys(s))})}),this.deviceList.startTrackingDeviceList(this.userId),N.logger.log("Crypto: checking for key backup..."),this.backupManager.checkAndStart()}getCryptoTrustCrossSignedDevices(){return this.trustCrossSignedDevices}setCryptoTrustCrossSignedDevices(e){this.trustCrossSignedDevices=e;for(const t of this.deviceList.getKnownUserIds()){const r=this.deviceList.getRawStoredDevicesForUser(t);for(const i of Object.keys(r)){const s=this.checkDeviceTrust(t,i);if(!s.isLocallyVerified()&&s.isCrossSigningVerified()){const o=this.deviceList.getStoredDevice(t,i);this.emit(et.DeviceVerificationChanged,t,i,o)}}}}async createRecoveryKeyFromPassphrase(e){const t=new V.Olm.PkDecryption;try{const r={};if(e){const o=await(0,kD.keyFromPassphrase)(e);r.passphrase={algorithm:"m.pbkdf2",iterations:o.iterations,salt:o.salt},r.pubkey=t.init_with_private_key(o.key)}else r.pubkey=t.generate_key();const i=t.get_private_key(),s=(0,Cm.encodeRecoveryKey)(i);return{keyInfo:r,encodedPrivateKey:s,privateKey:i}}finally{t&&t.free()}}async isCrossSigningReady(){const e=this.crossSigningInfo.getId(),t=await this.crossSigningInfo.isStoredInKeyCache()||await this.crossSigningInfo.isStoredInSecretStorage(this.secretStorage);return!!(e&&t)}async isSecretStorageReady(){const e=await this.secretStorage.hasKey(),t=await this.crossSigningInfo.isStoredInSecretStorage(this.secretStorage),r=!this.backupManager.getKeyBackupEnabled()||await this.baseApis.isKeyBackupKeyStored();return!!(e&&t&&r)}async bootstrapCrossSigning({authUploadDeviceSigningKeys:e,setupNewCrossSigning:t}={}){N.logger.log("Bootstrapping cross-signing");const r=this.baseApis.cryptoCallbacks,i=new km.EncryptionSetupBuilder(this.baseApis.store.accountData,r),s=new Ln.CrossSigningInfo(this.userId,i.crossSigningCallbacks,i.crossSigningCallbacks),o=async()=>{s.resetKeys(),await this.signObject(s.keys.master),i.addCrossSigningKeys(e,s.keys);const f=this.deviceList.getStoredDevice(this.userId,this.deviceId),_=await s.signDevice(this.userId,f);i.addKeySignature(this.userId,this.deviceId,_),this.backupManager.backupInfo&&(await s.signObject(this.backupManager.backupInfo.auth_data,"master"),i.addSessionBackup(this.backupManager.backupInfo))},a=this.crossSigningInfo.getId(),l=await this.crossSigningInfo.isStoredInKeyCache(),u=await this.crossSigningInfo.isStoredInSecretStorage(this.secretStorage),c=l||u;N.logger.log({setupNewCrossSigning:t,publicKeysOnDevice:a,privateKeysInCache:l,privateKeysInStorage:u,privateKeysExistSomewhere:c}),!c||t?(N.logger.log("Cross-signing private keys not found locally or in secret storage, creating new keys"),await o()):a&&l?N.logger.log("Cross-signing public keys trusted and private keys found locally"):u&&(N.logger.log("Cross-signing private keys not found locally, but they are available in secret storage, reading storage and caching locally"),await this.checkOwnCrossSigningTrust({allowPrivateKeyRequests:!0}));const g=i.crossSigningCallbacks.privateKeys;if(g.size&&!this.baseApis.cryptoCallbacks.saveCrossSigningKeys){const f=new Xs.SecretStorage(i.accountDataClientAdapter,i.ssssCryptoCallbacks);await f.hasKey()&&(N.logger.log("Storing new cross-signing private keys in secret storage"),await Ln.CrossSigningInfo.storeInSecretStorage(g,f))}await i.buildOperation().apply(this),await i.persist(this),N.logger.log("Cross-signing ready")}async bootstrapSecretStorage({createSecretStorageKey:e=async()=>({}),keyBackupInfo:t,setupNewKeyBackup:r,setupNewSecretStorage:i,getKeyBackupPassphrase:s}={}){N.logger.log("Bootstrapping Secure Secret Storage");const o=this.baseApis.cryptoCallbacks,a=new km.EncryptionSetupBuilder(this.baseApis.store.accountData,o),l=new Xs.SecretStorage(a.accountDataClientAdapter,a.ssssCryptoCallbacks);let u=null;const c=async(S,k)=>{k&&(S.key=k);const{keyId:A,keyInfo:w}=await l.addKey(Xs.SECRET_STORAGE_ALGORITHM_V1_AES,S);return k&&a.ssssCryptoCallbacks.addPrivateKey(A,w,k),await l.setDefaultKeyId(A),A},g=async(S,k)=>{if(!k.mac){const A=await this.baseApis.cryptoCallbacks.getSecretStorageKey({keys:{[S]:k}},"");if(A){const w=A[1];a.ssssCryptoCallbacks.addPrivateKey(S,k,w);const{iv:L,mac:q}=await(0,Id.calculateKeyCheck)(w);k.iv=L,k.mac=q,await a.setAccountData(`m.secret_storage.key.${S}`,k)}}},m=async S=>{if(this.crossSigningInfo.getId()&&await this.crossSigningInfo.isStoredInKeyCache("master"))try{N.logger.log("Adding cross-signing signature to key backup"),await this.crossSigningInfo.signObject(S,"master")}catch(k){N.logger.error("Signing key backup with cross-signing keys failed",k)}else N.logger.warn("Cross-signing keys not available, skipping signature on key backup")},f=await this.getSecretStorageKey(),[_,I]=f||[null,null],R=!i&&I&&I.algorithm===Xs.SECRET_STORAGE_ALGORITHM_V1_AES;if(N.logger.log({keyBackupInfo:t,setupNewKeyBackup:r,setupNewSecretStorage:i,storageExists:R,oldKeyInfo:I}),!R&&!t){N.logger.log("Secret storage does not exist, creating new storage key");const{keyInfo:S,privateKey:k}=await e();u=await c(S,k)}else if(!R&&t){N.logger.log("Secret storage does not exist, using key backup key");const S=await this.getSessionBackupPrivateKey()||await s(),k={};t.auth_data.private_key_salt&&t.auth_data.private_key_iterations&&(k.passphrase={algorithm:"m.pbkdf2",iterations:t.auth_data.private_key_iterations,salt:t.auth_data.private_key_salt,bits:256}),u=await c(k,S),await l.store("m.megolm_backup.v1",Ct.encodeBase64(S),[u]),await m(t.auth_data),a.addSessionBackup(t)}else N.logger.log("Secret storage exists"),I&&I.algorithm===Xs.SECRET_STORAGE_ALGORITHM_V1_AES&&await g(_,I);if(!this.baseApis.cryptoCallbacks.saveCrossSigningKeys&&await this.isCrossSigningReady()&&(u||!await this.crossSigningInfo.isStoredInSecretStorage(l))){N.logger.log("Copying cross-signing private keys from cache to secret storage");const S=await this.crossSigningInfo.getCrossSigningKeysFromCache();await Ln.CrossSigningInfo.storeInSecretStorage(S,l)}if(r&&!t){N.logger.log("Creating new message key backup version");const S=await this.baseApis.prepareKeyBackupVersion(null,{secureSecretStorage:!1}),k=(0,Cm.decodeRecoveryKey)(S.recovery_key);await l.store("m.megolm_backup.v1",Ct.encodeBase64(k));const A={algorithm:S.algorithm,auth_data:S.auth_data};await m(A.auth_data),await this.signObject(A.auth_data),a.addSessionBackup(A)}const T=await l.get("m.megolm_backup.v1");if(T){N.logger.info("Got session backup key from secret storage: caching");const S=ml(T);S&&await l.store("m.megolm_backup.v1",S,[u||_]);const k=new Uint8Array(Ct.decodeBase64(S||T));await a.addSessionBackupPrivateKeyToCache(k)}else if(this.backupManager.getKeyBackupEnabled()){const S=await this.getSessionBackupPrivateKey()||await s();if(!S){N.logger.error("Key backup is enabled but couldn't get key backup key!");return}N.logger.info("Got session backup key from cache/user that wasn't in SSSS: saving to SSSS"),await l.store("m.megolm_backup.v1",Ct.encodeBase64(S))}await a.buildOperation().apply(this),await a.persist(this),N.logger.log("Secure Secret Storage ready")}addSecretStorageKey(e,t,r){return this.secretStorage.addKey(e,t,r)}hasSecretStorageKey(e){return this.secretStorage.hasKey(e)}getSecretStorageKey(e){return this.secretStorage.getKey(e)}storeSecret(e,t,r){return this.secretStorage.store(e,t,r)}getSecret(e){return this.secretStorage.get(e)}isSecretStored(e,t){return this.secretStorage.isStored(e,t)}requestSecret(e,t){return t||(t=Object.keys(this.deviceList.getRawStoredDevicesForUser(this.userId))),this.secretStorage.request(e,t)}getDefaultSecretStorageKeyId(){return this.secretStorage.getDefaultKeyId()}setDefaultSecretStorageKeyId(e){return this.secretStorage.setDefaultKeyId(e)}checkSecretStorageKey(e,t){return this.secretStorage.checkKey(e,t)}checkSecretStoragePrivateKey(e,t){let r=null;try{return r=new V.Olm.PkDecryption,r.init_with_private_key(e)===t}finally{r&&r.free()}}async getSessionBackupPrivateKey(){let e=await new Promise(t=>{this.cryptoStore.doTxn("readonly",[fa.IndexedDBCryptoStore.STORE_ACCOUNT],r=>{this.cryptoStore.getSecretStorePrivateKey(r,t,"m.megolm_backup.v1")})});if(e&&typeof e=="string"&&(e=new Uint8Array(Ct.decodeBase64(ml(e)||e)),await this.storeSessionBackupPrivateKey(e)),e&&e.ciphertext){const t=Buffer.from(this.olmDevice.pickleKey),r=await(0,Id.decryptAES)(e,t,"m.megolm_backup.v1");e=Ct.decodeBase64(r)}return e}async storeSessionBackupPrivateKey(e){if(!(e instanceof Uint8Array))throw new Error(`storeSessionBackupPrivateKey expects Uint8Array, got ${e}`);const t=Buffer.from(this.olmDevice.pickleKey),r=await(0,Id.encryptAES)(Ct.encodeBase64(e),t,"m.megolm_backup.v1");return this.cryptoStore.doTxn("readwrite",[fa.IndexedDBCryptoStore.STORE_ACCOUNT],i=>{this.cryptoStore.storeSecretStorePrivateKey(i,"m.megolm_backup.v1",r)})}checkCrossSigningPrivateKey(e,t){let r=null;try{return r=new V.Olm.PkSigning,r.init_with_seed(e)===t}finally{r&&r.free()}}async afterCrossSigningLocalKeyChange(){N.logger.info("Starting cross-signing key change post-processing");const e=this.deviceList.getStoredDevice(this.userId,this.deviceId),t=await this.crossSigningInfo.signDevice(this.userId,e);N.logger.info(`Starting background key sig upload for ${this.deviceId}`);const r=({shouldEmit:s=!1})=>this.baseApis.uploadKeySignatures({[this.userId]:{[this.deviceId]:t}}).then(o=>{const{failures:a}=o||{};if(Object.keys(a||[]).length>0)throw s&&this.baseApis.emit(et.KeySignatureUploadFailure,a,"afterCrossSigningLocalKeyChange",r),new Vc.KeySignatureUploadError("Key upload failed",{failures:a});N.logger.info(`Finished background key sig upload for ${this.deviceId}`)}).catch(o=>{N.logger.error(`Error during background key sig upload for ${this.deviceId}`,o)});r({shouldEmit:!0});const i=this.baseApis.cryptoCallbacks.shouldUpgradeDeviceVerifications;if(i){N.logger.info("Starting device verification upgrade");const s={};for(const[o,a]of Object.entries(this.deviceList.crossSigningInfo)){const l=await this.checkForDeviceVerificationUpgrade(o,Ln.CrossSigningInfo.fromStorage(a,o));l&&(s[o]=l)}if(Object.keys(s).length>0){N.logger.info(`Found ${Object.keys(s).length} verif users to upgrade`);try{const o=await i({users:s});if(o)for(const a of o)a in s&&await this.baseApis.setDeviceVerified(a,s[a].crossSigningInfo.getId())}catch(o){N.logger.log("shouldUpgradeDeviceVerifications threw an error: not upgrading",o)}}N.logger.info("Finished device verification upgrade")}N.logger.info("Finished cross-signing key change post-processing")}async checkForDeviceVerificationUpgrade(e,t){const r=this.crossSigningInfo.checkUserTrust(t);if(t.firstUse&&!r.isVerified()){const i=this.deviceList.getRawStoredDevicesForUser(e),s=await this.checkForValidDeviceSignature(e,t.keys.master,i);if(s.length)return{devices:s.map(o=>gl.DeviceInfo.fromStorage(i[o],o)),crossSigningInfo:t}}}async checkForValidDeviceSignature(e,t,r){const i=[];if(r&&t.signatures&&t.signatures[e])for(const s of Object.keys(t.signatures[e])){const[,o]=s.split(":",2);if(o in r&&r[o].verified===Kn.VERIFIED)try{await Ct.verifySignature(this.olmDevice,t,e,o,r[o].keys[s]),i.push(o)}catch{}}return i}getCrossSigningId(e){return this.crossSigningInfo.getId(e)}getStoredCrossSigningForUser(e){return this.deviceList.getStoredCrossSigningForUser(e)}checkUserTrust(e){const t=this.deviceList.getStoredCrossSigningForUser(e);return t?this.crossSigningInfo.checkUserTrust(t):new Ln.UserTrustLevel(!1,!1,!1)}checkDeviceTrust(e,t){const r=this.deviceList.getStoredDevice(e,t);return this.checkDeviceInfoTrust(e,r)}checkDeviceInfoTrust(e,t){const r=!!(t&&t.isVerified()),i=this.deviceList.getStoredCrossSigningForUser(e);if(t&&i){const s=this.trustCrossSignedDevices||e===this.userId;return this.crossSigningInfo.checkDeviceTrust(i,t,r,s)}else return new Ln.DeviceTrustLevel(!1,!1,r,!1)}async checkOwnCrossSigningTrust({allowPrivateKeyRequests:e=!1}={}){const t=this.userId;await this.downloadKeys([this.userId]);const r=await this.crossSigningInfo.getCrossSigningKeysFromCache(),i=this.deviceList.getStoredCrossSigningForUser(t);if(!i){N.logger.error("Got cross-signing update event for user "+t+" but no new cross-signing information found!");return}const s=i.getId(),o=this.crossSigningInfo.getId()!==s,a=i.getId()&&!r.has("master");if(o&&N.logger.info("Got new master public key",s),e&&(o||a)){N.logger.info("Attempting to retrieve cross-signing master private key");let R=null;try{R=(await this.crossSigningInfo.getCrossSigningKey("master",s))[1],N.logger.info("Got cross-signing master private key")}finally{R&&R.free()}}const l=this.crossSigningInfo.getId("self_signing"),u=this.crossSigningInfo.getId("user_signing");this.storeTrustedSelfKeys(i.keys);const c=l!==i.getId("self_signing"),g=u!==i.getId("user_signing"),m=i.getId("self_signing")&&!r.has("self_signing"),f=i.getId("user_signing")&&!r.has("user_signing"),_={};if(c&&N.logger.info("Got new self-signing key",i.getId("self_signing")),e&&(c||m)){N.logger.info("Attempting to retrieve cross-signing self-signing private key");let R=null;try{R=(await this.crossSigningInfo.getCrossSigningKey("self_signing",i.getId("self_signing")))[1],N.logger.info("Got cross-signing self-signing private key")}finally{R&&R.free()}const T=this.deviceList.getStoredDevice(this.userId,this.deviceId),C=await this.crossSigningInfo.signDevice(this.userId,T);_[this.deviceId]=C}if(g&&N.logger.info("Got new user-signing key",i.getId("user_signing")),e&&(g||f)){N.logger.info("Attempting to retrieve cross-signing user-signing private key");let R=null;try{R=(await this.crossSigningInfo.getCrossSigningKey("user_signing",i.getId("user_signing")))[1],N.logger.info("Got cross-signing user-signing private key")}finally{R&&R.free()}}if(o){const R=this.crossSigningInfo.keys.master;await this.signObject(R);const T=R.signatures[this.userId]["ed25519:"+this.deviceId];_[this.crossSigningInfo.getId()]=Object.assign({},R,{signatures:{[this.userId]:{["ed25519:"+this.deviceId]:T}}})}const I=Object.keys(_);if(I.length){const R=({shouldEmit:T=!1})=>(N.logger.info(`Starting background key sig upload for ${I}`),this.baseApis.uploadKeySignatures({[this.userId]:_}).then(C=>{const{failures:S}=C||{};if(N.logger.info(`Finished background key sig upload for ${I}`),Object.keys(S||[]).length>0)throw T&&this.baseApis.emit(et.KeySignatureUploadFailure,S,"checkOwnCrossSigningTrust",R),new Vc.KeySignatureUploadError("Key upload failed",{failures:S})}).catch(C=>{N.logger.error(`Error during background key sig upload for ${I}`,C)}));R({shouldEmit:!0})}this.emit(et.UserTrustStatusChanged,t,this.checkUserTrust(t)),o&&(this.emit(et.KeysChanged,{}),await this.afterCrossSigningLocalKeyChange()),await this.backupManager.checkKeyBackup()}async storeTrustedSelfKeys(e){e?this.crossSigningInfo.setKeys(e):this.crossSigningInfo.clearKeys(),await this.cryptoStore.doTxn("readwrite",[fa.IndexedDBCryptoStore.STORE_ACCOUNT],t=>{this.cryptoStore.storeCrossSigningKeys(t,this.crossSigningInfo.keys)})}async checkDeviceVerifications(e){const t=this.baseApis.cryptoCallbacks.shouldUpgradeDeviceVerifications;if(!!t){if(N.logger.info(`Starting device verification upgrade for ${e}`),this.crossSigningInfo.keys.user_signing){const r=this.deviceList.getStoredCrossSigningForUser(e);if(r){const i=await this.checkForDeviceVerificationUpgrade(e,r);i&&(await t({users:{[e]:i}})).includes(e)&&await this.baseApis.setDeviceVerified(e,r.getId())}}N.logger.info(`Finished device verification upgrade for ${e}`)}}async setTrustedBackupPubKey(e){this.sessionStore.setLocalTrustedBackupPubKey(e),await this.backupManager.checkKeyBackup()}enableLazyLoading(){this.lazyLoadMembers=!0}registerEventHandlers(e){e.on(DD.RoomMemberEvent.Membership,this.onMembership),e.on(AD.ClientEvent.ToDeviceEvent,this.onToDeviceEvent),e.on(MD.RoomEvent.Timeline,this.onTimelineEvent),e.on(Bn.MatrixEventEvent.Decrypted,this.onTimelineEvent)}start(){this.outgoingRoomKeyRequestManager.start()}stop(){this.outgoingRoomKeyRequestManager.stop(),this.deviceList.stop(),this.dehydrationManager.stop()}getDeviceEd25519Key(){return this.olmDevice.deviceEd25519Key}getDeviceCurve25519Key(){return this.olmDevice.deviceCurve25519Key}setGlobalBlacklistUnverifiedDevices(e){this.globalBlacklistUnverifiedDevices=e}getGlobalBlacklistUnverifiedDevices(){return this.globalBlacklistUnverifiedDevices}setGlobalErrorOnUnknownDevices(e){this.globalErrorOnUnknownDevices=e}getGlobalErrorOnUnknownDevices(){return this.globalErrorOnUnknownDevices}uploadDeviceKeys(){const e={algorithms:this.supportedAlgorithms,device_id:this.deviceId,keys:this.deviceKeys,user_id:this.userId};return this.signObject(e).then(()=>this.baseApis.uploadKeysRequest({device_keys:e}))}updateOneTimeKeyCount(e){if(isFinite(e))this.oneTimeKeyCount=e;else throw new TypeError("Parameter for updateOneTimeKeyCount has to be a number")}setNeedsNewFallback(e){this.needsNewFallback=!!e}getNeedsNewFallback(){return this.needsNewFallback}maybeUploadOneTimeKeys(){if(this.oneTimeKeyCheckInProgress)return;const r=Date.now();if(this.lastOneTimeKeyCheck!==null&&r-this.lastOneTimeKeyCheck<6e4)return;this.lastOneTimeKeyCheck=r;const i=this.olmDevice.maxNumberOfOneTimeKeys(),s=Math.floor(i/2),o=async a=>{for(;s>a||this.getNeedsNewFallback();){if(s>a){N.logger.info("generating oneTimeKeys");const u=Math.min(s-a,5);await this.olmDevice.generateOneTimeKeys(u)}if(this.getNeedsNewFallback()){const u=await this.olmDevice.getFallbackKey();(!u.curve25519||Object.keys(u.curve25519).length==0)&&(N.logger.info("generating fallback key"),this.fallbackCleanup&&(clearTimeout(this.fallbackCleanup),delete this.fallbackCleanup),await this.olmDevice.generateFallbackKey())}N.logger.info("calling uploadOneTimeKeys");const l=await this.uploadOneTimeKeys();if(l.one_time_key_counts&&l.one_time_key_counts.signed_curve25519)a=l.one_time_key_counts.signed_curve25519;else throw new Error("response for uploading keys does not contain one_time_key_counts.signed_curve25519")}};this.oneTimeKeyCheckInProgress=!0,Promise.resolve().then(()=>this.oneTimeKeyCount!==void 0?Promise.resolve(this.oneTimeKeyCount):this.baseApis.uploadKeysRequest({}).then(a=>a.one_time_key_counts.signed_curve25519||0)).then(a=>o(a)).catch(a=>{N.logger.error("Error uploading one-time keys",a.stack||a)}).finally(()=>{this.oneTimeKeyCount=void 0,this.oneTimeKeyCheckInProgress=!1})}async uploadOneTimeKeys(){const e=[];let t;if(this.getNeedsNewFallback()){t={};const a=await this.olmDevice.getFallbackKey();for(const[l,u]of Object.entries(a.curve25519)){const c={key:u,fallback:!0};t["signed_curve25519:"+l]=c,e.push(this.signObject(c))}this.setNeedsNewFallback(!1)}const r=await this.olmDevice.getOneTimeKeys(),i={};for(const a in r.curve25519)if(r.curve25519.hasOwnProperty(a)){const l={key:r.curve25519[a]};i["signed_curve25519:"+a]=l,e.push(this.signObject(l))}await Promise.all(e);const s={one_time_keys:i};t&&(s["org.matrix.msc2732.fallback_keys"]=t,s.fallback_keys=t);const o=await this.baseApis.uploadKeysRequest(s);return t&&(this.fallbackCleanup=setTimeout(()=>{delete this.fallbackCleanup,this.olmDevice.forgetOldFallbackKey()},60*60*1e3)),await this.olmDevice.markKeysAsPublished(),o}downloadKeys(e,t){return this.deviceList.downloadKeys(e,t)}getStoredDevicesForUser(e){return this.deviceList.getStoredDevicesForUser(e)}getStoredDevice(e,t){return this.deviceList.getStoredDevice(e,t)}saveDeviceList(e){return this.deviceList.saveIfDirty(e)}async setDeviceVerification(e,t,r,i,s){r===void 0&&(r=null),i===void 0&&(i=null),s===void 0&&(s=null);const o=this.deviceList.getStoredCrossSigningForUser(e);if(o&&o.getId()===t){if(i!==null||s!==null)throw new Error("Cannot set blocked or known for a cross-signing key");if(!r)throw new Error("Cannot set a cross-signing key as unverified");if(!this.crossSigningInfo.getId()&&e===this.crossSigningInfo.userId&&(this.storeTrustedSelfKeys(o.keys),this.emit(et.UserTrustStatusChanged,this.userId,this.checkUserTrust(e))),e!==this.userId){N.logger.info("Master key "+o.getId()+" for "+e+" marked verified. Signing...");const m=await this.crossSigningInfo.signUser(o);if(m){const f=async({shouldEmit:_=!1})=>{N.logger.info("Uploading signature for "+e+"...");const I=await this.baseApis.uploadKeySignatures({[e]:{[t]:m}}),{failures:R}=I||{};if(Object.keys(R||[]).length>0)throw _&&this.baseApis.emit(et.KeySignatureUploadFailure,R,"setDeviceVerification",f),new Vc.KeySignatureUploadError("Key upload failed",{failures:R})};await f({shouldEmit:!0})}return m}else return o}const a=this.deviceList.getRawStoredDevicesForUser(e);if(!a||!a[t])throw new Error("Unknown device "+e+":"+t);const l=a[t];let u=l.verified;r?u=Kn.VERIFIED:r!==null&&u==Kn.VERIFIED&&(u=Kn.UNVERIFIED),i?u=Kn.BLOCKED:i!==null&&u==Kn.BLOCKED&&(u=Kn.UNVERIFIED);let c=l.known;if(s!==null&&(c=s),(l.verified!==u||l.known!==c)&&(l.verified=u,l.known=c,this.deviceList.storeDevicesForUser(e,a),this.deviceList.saveIfDirty()),r&&e===this.userId){N.logger.info("Own device "+t+" marked verified: signing");let m;if(this.checkDeviceTrust(e,t).isCrossSigningVerified()?N.logger.log(`Own device ${t} already cross-signing verified`):m=await this.crossSigningInfo.signDevice(e,gl.DeviceInfo.fromStorage(l,t)),m){const _=async({shouldEmit:I=!1})=>{N.logger.info("Uploading signature for "+t);const R=await this.baseApis.uploadKeySignatures({[e]:{[t]:m}}),{failures:T}=R||{};if(Object.keys(T||[]).length>0)throw I&&this.baseApis.emit(et.KeySignatureUploadFailure,T,"setDeviceVerification",_),new Vc.KeySignatureUploadError("Key upload failed",{failures:T})};await _({shouldEmit:!0})}}const g=gl.DeviceInfo.fromStorage(l,t);return this.emit(et.DeviceVerificationChanged,e,t,g),g}findVerificationRequestDMInProgress(e){return this.inRoomVerificationRequests.findRequestInProgress(e)}getVerificationRequestsToDeviceInProgress(e){return this.toDeviceVerificationRequests.getRequestsInProgress(e)}requestVerificationDM(e,t){const r=this.inRoomVerificationRequests.findRequestInProgress(t);if(r)return Promise.resolve(r);const i=new jc.InRoomChannel(this.baseApis,t,e);return this.requestVerificationWithChannel(e,i,this.inRoomVerificationRequests)}requestVerification(e,t){t||(t=Object.keys(this.deviceList.getRawStoredDevicesForUser(e)));const r=this.toDeviceVerificationRequests.findRequestInProgress(e,t);if(r)return Promise.resolve(r);const i=new Yr.ToDeviceChannel(this.baseApis,e,t,Yr.ToDeviceChannel.makeTransactionId());return this.requestVerificationWithChannel(e,i,this.toDeviceVerificationRequests)}async requestVerificationWithChannel(e,t,r){let i=new pa.VerificationRequest(t,this.verificationMethods,this.baseApis);t.transactionId&&r.setRequestByChannel(t,i),await i.sendRequest();const s=r.getRequestByChannel(t);return s?i=s:(N.logger.log(`Crypto: adding new request to requestsByTxnId with id ${t.transactionId} ${t.roomId}`),r.setRequestByChannel(t,i)),i}beginKeyVerification(e,t,r,i=null){let s;if(i){if(s=this.toDeviceVerificationRequests.getRequestBySenderAndTxnId(t,i),!s)throw new Error(`No request found for user ${t} with transactionId ${i}`)}else{i=Yr.ToDeviceChannel.makeTransactionId();const o=new Yr.ToDeviceChannel(this.baseApis,t,[r],i,r);s=new pa.VerificationRequest(o,this.verificationMethods,this.baseApis),this.toDeviceVerificationRequests.setRequestBySenderAndTxnId(t,i,s)}return s.beginKeyVerification(e,{userId:t,deviceId:r})}async legacyDeviceVerification(e,t,r){const i=Yr.ToDeviceChannel.makeTransactionId(),s=new Yr.ToDeviceChannel(this.baseApis,e,[t],i,t),o=new pa.VerificationRequest(s,this.verificationMethods,this.baseApis);this.toDeviceVerificationRequests.setRequestBySenderAndTxnId(e,i,o);const a=o.beginKeyVerification(r,{userId:e,deviceId:t});return await Promise.race([a.verify(),o.waitFor(l=>l.started)]),o}async getOlmSessionsForUser(e){const t=this.getStoredDevicesForUser(e)||[],r={};for(let i=0;i<t.length;++i){const s=t[i],o=s.getIdentityKey(),a=await this.olmDevice.getSessionInfoForDevice(o);r[s.deviceId]={deviceIdKey:o,sessions:a}}return r}getEventSenderDeviceInfo(e){const t=e.getSenderKey(),r=e.getWireContent().algorithm;if(!t||!r||e.getForwardingCurve25519KeyChain().length>0||e.isKeySourceUntrusted())return null;const s=this.deviceList.getDeviceByIdentityKey(r,t);if(s===null)return null;const o=e.getClaimedEd25519Key();return o?o!==s.getFingerprint()?(N.logger.warn("Event "+e.getId()+" claims ed25519 key "+o+" but sender device has key "+s.getFingerprint()),null):s:(N.logger.warn("Event "+e.getId()+" claims no ed25519 key: cannot verify sending device"),null)}getEventEncryptionInfo(e){const t={};if(t.senderKey=e.getSenderKey(),t.algorithm=e.getWireContent().algorithm,!t.senderKey||!t.algorithm)return t.encrypted=!1,t;t.encrypted=!0,e.getForwardingCurve25519KeyChain().length>0||e.isKeySourceUntrusted()?t.authenticated=!1:t.authenticated=!0,t.sender=this.deviceList.getDeviceByIdentityKey(t.algorithm,t.senderKey);const i=e.getClaimedEd25519Key();return i||(N.logger.warn("Event "+e.getId()+" claims no ed25519 key: cannot verify sending device"),t.mismatchedSender=!0),t.sender&&i!==t.sender.getFingerprint()&&(N.logger.warn("Event "+e.getId()+" claims ed25519 key "+i+"but sender device has key "+t.sender.getFingerprint()),t.mismatchedSender=!0),t}forceDiscardSession(e){const t=this.roomEncryptors[e];if(t===void 0)throw new Error("Room not encrypted");if(t.forceDiscardSession===void 0)throw new Error("Room encryption algorithm doesn't support session discarding");t.forceDiscardSession()}async setRoomEncryption(e,t,r){if(!t.algorithm){N.logger.log("Ignoring setRoomEncryption with no algorithm");return}const i=this.roomList.getRoomEncryption(e);if(i&&JSON.stringify(i)!=JSON.stringify(t)){N.logger.error("Ignoring m.room.encryption event which requests a change of config in "+e);return}if(this.roomEncryptors[e])return;let o=null;i||(o=this.roomList.setRoomEncryption(e,t));const a=qc.ENCRYPTION_CLASSES[t.algorithm];if(!a)throw new Error("Unable to encrypt with "+t.algorithm);const l=new a({userId:this.userId,deviceId:this.deviceId,crypto:this,olmDevice:this.olmDevice,baseApis:this.baseApis,roomId:e,config:t});this.roomEncryptors[e]=l,o&&await o,this.lazyLoadMembers?N.logger.log("Enabling encryption in "+e):(N.logger.log("Enabling encryption in "+e+"; starting to track device lists for all users therein"),await this.trackRoomDevices(e),r||this.deviceList.refreshOutdatedDeviceLists())}trackRoomDevices(e){const t=async()=>{if(!this.roomEncryptors[e])return;const i=this.clientStore.getRoom(e);if(!i)throw new Error(`Unable to start tracking devices in unknown room ${e}`);N.logger.log(`Starting to track devices for room ${e} ...`),(await i.getEncryptionTargetMembers()).forEach(o=>{this.deviceList.startTrackingDeviceList(o.userId)})};let r=this.roomDeviceTrackingState[e];return r||(r=t(),this.roomDeviceTrackingState[e]=r.catch(i=>{throw this.roomDeviceTrackingState[e]=null,i})),r}ensureOlmSessionsForUsers(e,t){const r={};for(let i=0;i<e.length;++i){const s=e[i];r[s]=[];const o=this.getStoredDevicesForUser(s)||[];for(let a=0;a<o.length;++a){const l=o[a];l.getIdentityKey()!=this.olmDevice.deviceCurve25519Key&&l.verified!=Kn.BLOCKED&&r[s].push(l)}}return Ct.ensureOlmSessionsForDevices(this.olmDevice,this.baseApis,r,t)}async exportRoomKeys(){const e=[];return await this.cryptoStore.doTxn("readonly",[fa.IndexedDBCryptoStore.STORE_INBOUND_GROUP_SESSIONS],t=>{this.cryptoStore.getAllEndToEndInboundGroupSessions(t,r=>{if(r===null)return;const i=this.olmDevice.exportInboundGroupSession(r.senderKey,r.sessionId,r.sessionData);delete i.first_known_index,i.algorithm=Ct.MEGOLM_ALGORITHM,e.push(i)})}),e}importRoomKeys(e,t={}){let r=0,i=0;const s=e.length;function o(){t.progressCallback({stage:"load_keys",successes:r,failures:i,total:s})}return Promise.all(e.map(a=>!a.room_id||!a.algorithm?(N.logger.warn("ignoring room key entry with missing fields",a),i++,t.progressCallback&&o(),null):this.getRoomDecryptor(a.room_id,a.algorithm).importRoomKey(a,t).finally(()=>{r++,t.progressCallback&&o()}))).then()}countSessionsNeedingBackup(){return this.backupManager.countSessionsNeedingBackup()}prepareToEncrypt(e){const t=this.roomEncryptors[e.roomId];t&&t.prepareToEncrypt(e)}async encryptEvent(e,t){if(!t)throw new Error("Cannot send encrypted messages in unknown rooms");const r=e.getRoomId(),i=this.roomEncryptors[r];if(!i)throw new Error("Room was previously configured to use encryption, but is no longer. Perhaps the homeserver is hiding the configuration event.");this.roomDeviceTrackingState[r]||this.trackRoomDevices(r),await this.roomDeviceTrackingState[r];let s=e.getContent();const o=s["m.relates_to"];o&&(s=Object.assign({},s),delete s["m.relates_to"]);const a=s["io.element.performance_metrics"];a&&(s=Object.assign({},s),delete s["io.element.performance_metrics"]);const l=await i.encryptMessage(t,e.getType(),s);o&&(l["m.relates_to"]=o),a&&(l["io.element.performance_metrics"]=a),e.makeEncrypted("m.room.encrypted",l,this.olmDevice.deviceCurve25519Key,this.olmDevice.deviceEd25519Key)}async decryptEvent(e){if(e.isRedacted()){const t=new Bn.MatrixEvent(e.getUnsigned().redacted_because),r=await this.decryptEvent(t);return{clearEvent:{room_id:e.getRoomId(),type:"m.room.message",content:{},unsigned:{redacted_because:r.clearEvent}}}}else{const t=e.getWireContent();return await this.getRoomDecryptor(e.getRoomId(),t.algorithm).decryptEvent(e)}}async handleDeviceListChanges(e,t){!e.oldSyncToken||await this.evalDeviceListChanges(t)}requestRoomKey(e,t,r=!1){return this.outgoingRoomKeyRequestManager.queueRoomKeyRequest(e,t,r).then(()=>{this.sendKeyRequestsImmediately&&this.outgoingRoomKeyRequestManager.sendQueuedRequests()}).catch(i=>{N.logger.error("Error requesting key for event",i)})}cancelRoomKeyRequest(e){this.outgoingRoomKeyRequestManager.cancelRoomKeyRequest(e).catch(t=>{N.logger.warn("Error clearing pending room key requests",t)})}async cancelAndResendAllOutgoingKeyRequests(){await this.outgoingRoomKeyRequestManager.cancelAndResendAllOutgoingRequests()}async onCryptoEvent(e){const t=e.getRoomId(),r=e.getContent();try{await this.setRoomEncryption(t,r,!0)}catch(i){N.logger.error("Error configuring encryption in room "+t+":",i)}}async onSyncWillProcess(e){e.oldSyncToken||(N.logger.log("Initial sync performed - resetting device tracking state"),this.deviceList.stopTrackingAllDeviceLists(),this.deviceList.startTrackingDeviceList(this.userId),this.roomDeviceTrackingState={}),this.sendKeyRequestsImmediately=!1}async onSyncCompleted(e){this.deviceList.setSyncToken(e.nextSyncToken),this.deviceList.saveIfDirty(),this.deviceList.startTrackingDeviceList(this.userId),this.deviceList.refreshOutdatedDeviceLists(),e.catchingUp||(this.maybeUploadOneTimeKeys(),this.processReceivedRoomKeyRequests(),this.outgoingRoomKeyRequestManager.sendQueuedRequests(),this.sendKeyRequestsImmediately=!0)}async evalDeviceListChanges(e){if(e.changed&&Array.isArray(e.changed)&&e.changed.forEach(t=>{this.deviceList.invalidateUserDeviceList(t)}),e.left&&Array.isArray(e.left)&&e.left.length){const t=new Set(await this.getTrackedE2eUsers());e.left.forEach(r=>{t.has(r)||this.deviceList.stopTrackingDeviceList(r)})}}async getTrackedE2eUsers(){const e=[];for(const t of this.getTrackedE2eRooms()){const r=await t.getEncryptionTargetMembers();for(const i of r)e.push(i.userId)}return e}getTrackedE2eRooms(){return this.clientStore.getRooms().filter(e=>{if(!this.roomEncryptors[e.roomId]||!this.roomDeviceTrackingState[e.roomId])return!1;const r=e.getMyMembership();return r==="join"||r==="invite"})}onRoomKeyEvent(e){const t=e.getContent();if(!t.room_id||!t.algorithm){N.logger.error("key event is missing fields");return}this.backupManager.checkedForBackup||this.backupManager.checkAndStart(),this.getRoomDecryptor(t.room_id,t.algorithm).onRoomKeyEvent(e)}onRoomKeyWithheldEvent(e){const t=e.getContent();if(t.code!=="m.no_olm"&&(!t.room_id||!t.session_id)||!t.algorithm||!t.sender_key){N.logger.error("key withheld event is missing fields");return}N.logger.info(`Got room key withheld event from ${e.getSender()} (${t.sender_key}) for ${t.algorithm}/${t.room_id}/${t.session_id} with reason ${t.code} (${t.reason})`);const r=this.getRoomDecryptor(t.room_id,t.algorithm);if(r.onRoomKeyWithheldEvent&&r.onRoomKeyWithheldEvent(e),!t.room_id){const i=this.getRoomDecryptors(t.algorithm);for(const s of i)s.retryDecryptionFromSender(t.sender_key)}}onKeyVerificationMessage(e){if(!Yr.ToDeviceChannel.validateEvent(e,this.baseApis))return;const t=r=>{if(!Yr.ToDeviceChannel.canCreateRequest(Yr.ToDeviceChannel.getEventType(r)))return;const i=r.getContent(),s=i&&i.from_device;if(!s)return;const o=r.getSender(),a=new Yr.ToDeviceChannel(this.baseApis,o,[s]);return new pa.VerificationRequest(a,this.verificationMethods,this.baseApis)};this.handleVerificationEvent(e,this.toDeviceVerificationRequests,t)}async handleVerificationEvent(e,t,r,i=!0){if(e.isSending()&&e.status!=Bn.EventStatus.SENT){let l,u;try{await new Promise((c,g)=>{l=c,u=()=>{e.status==Bn.EventStatus.CANCELLED&&g(new Error("Event status set to CANCELLED."))},e.once(Bn.MatrixEventEvent.LocalEventIdReplaced,l),e.on(Bn.MatrixEventEvent.Status,u)})}catch(c){N.logger.error("error while waiting for the verification event to be sent: "+c.message);return}finally{e.removeListener(Bn.MatrixEventEvent.LocalEventIdReplaced,l),e.removeListener(Bn.MatrixEventEvent.Status,u)}}let s=t.getRequest(e),o=!1;if(!s){if(s=r(e),!s){N.logger.log(`Crypto: could not find VerificationRequest for ${e.getType()}, and could not create one, so ignoring.`);return}o=!0,t.setRequest(e,s)}e.setVerificationRequest(s);try{await s.channel.handleEvent(e,s,i)}catch(l){N.logger.error("error while handling verification event: "+l.message)}o&&!s.initiatedByMe&&!s.invalid&&!s.observeOnly&&this.baseApis.emit(et.VerificationRequest,s)}async onToDeviceBadEncrypted(e){const t=e.getWireContent(),r=e.getSender(),i=t.algorithm,s=t.sender_key,o=()=>{const m=this.getRoomDecryptors(Ct.MEGOLM_ALGORITHM);for(const f of m)f.retryDecryptionFromSender(s)};if(r===void 0||s===void 0||s===void 0)return;this.lastNewSessionForced[r]=this.lastNewSessionForced[r]||{};const a=this.lastNewSessionForced[r][s]||0;if(a+ND>Date.now()){N.logger.debug("New session already forced with device "+r+":"+s+" at "+a+": not forcing another"),await this.olmDevice.recordSessionProblem(s,"wedged",!0),o();return}let l=this.deviceList.getDeviceByIdentityKey(i,s);if(!l&&(await this.downloadKeys([r],!1),l=this.deviceList.getDeviceByIdentityKey(i,s),!l)){N.logger.info("Couldn't find device for identity key "+s+": not re-establishing session"),await this.olmDevice.recordSessionProblem(s,"wedged",!1),o();return}const u={};u[r]=[l],await Ct.ensureOlmSessionsForDevices(this.olmDevice,this.baseApis,u,!0),this.lastNewSessionForced[r][s]=Date.now();const c={algorithm:Ct.OLM_ALGORITHM,sender_key:this.olmDevice.deviceCurve25519Key,ciphertext:{}};await Ct.encryptMessageForDevice(c.ciphertext,this.userId,this.deviceId,this.olmDevice,r,l,{type:"m.dummy"}),await this.olmDevice.recordSessionProblem(s,"wedged",!0),o(),await this.baseApis.sendToDevice("m.room.encrypted",{[r]:{[l.deviceId]:c}});const g=await this.outgoingRoomKeyRequestManager.getOutgoingSentRoomKeyRequest(r,l.deviceId);for(const m of g)this.requestRoomKey(m.requestBody,m.recipients,!0)}onRoomMembership(e,t,r){const i=t.roomId,s=this.roomEncryptors[i];!s||(this.roomDeviceTrackingState[i]&&(t.membership=="join"?(N.logger.log("Join event for "+t.userId+" in "+i),this.deviceList.startTrackingDeviceList(t.userId)):t.membership=="invite"&&this.clientStore.getRoom(i).shouldEncryptForInvitedMembers()&&(N.logger.log("Invite event for "+t.userId+" in "+i),this.deviceList.startTrackingDeviceList(t.userId))),s.onRoomMembership(e,t,r))}onRoomKeyRequestEvent(e){const t=e.getContent();if(t.action==="request"){const r=new iE(e);this.receivedRoomKeyRequests.push(r)}else if(t.action==="request_cancellation"){const r=new BD(e);this.receivedRoomKeyRequestCancellations.push(r)}}async processReceivedRoomKeyRequests(){if(!this.processingRoomKeyRequests){this.processingRoomKeyRequests=!0;try{const e=this.receivedRoomKeyRequests;this.receivedRoomKeyRequests=[];const t=this.receivedRoomKeyRequestCancellations;this.receivedRoomKeyRequestCancellations=[],await Promise.all(e.map(r=>this.processReceivedRoomKeyRequest(r))),await Promise.all(t.map(r=>this.processReceivedRoomKeyRequestCancellation(r)))}catch(e){N.logger.error(`Error processing room key requsts: ${e}`)}finally{this.processingRoomKeyRequests=!1}}}async processReceivedRoomKeyRequest(e){const t=e.userId,r=e.deviceId,i=e.requestBody,s=i.room_id,o=i.algorithm;if(N.logger.log(`m.room_key_request from ${t}:${r} for ${s} / ${i.session_id} (id ${e.requestId})`),t!==this.userId){if(!this.roomEncryptors[s]){N.logger.debug(`room key request for unencrypted room ${s}`);return}const l=this.roomEncryptors[s],u=this.deviceList.getStoredDevice(t,r);if(!u){N.logger.debug(`Ignoring keyshare for unknown device ${t}:${r}`);return}try{await l.reshareKeyWithDevice(i.sender_key,i.session_id,t,u)}catch(c){N.logger.warn("Failed to re-share keys for session "+i.session_id+" with device "+t+":"+u.deviceId,c)}return}if(r===this.deviceId){N.logger.log("Ignoring room key request from ourselves");return}if(!this.roomDecryptors[s]){N.logger.log(`room key request for unencrypted room ${s}`);return}const a=this.roomDecryptors[s][o];if(!a){N.logger.log(`room key request for unknown alg ${o} in room ${s}`);return}if(!await a.hasKeysForKeyRequest(e)){N.logger.log(`room key request for unknown session ${s} / `+i.session_id);return}if(e.share=()=>{a.shareKeysWithDevice(e)},this.checkDeviceTrust(t,r).isVerified()){N.logger.log("device is already verified: sharing keys"),e.share();return}this.emit(et.RoomKeyRequest,e)}async processReceivedRoomKeyRequestCancellation(e){N.logger.log(`m.room_key_request cancellation for ${e.userId}:${e.deviceId} (id ${e.requestId})`),this.emit(et.RoomKeyRequestCancellation,e)}getRoomDecryptor(e,t){let r,i;if(e=e||null,e&&(r=this.roomDecryptors[e],r||(this.roomDecryptors[e]=r={}),i=r[t],i))return i;const s=qc.DECRYPTION_CLASSES[t];if(!s)throw new qc.DecryptionError("UNKNOWN_ENCRYPTION_ALGORITHM",'Unknown encryption algorithm "'+t+'".');return i=new s({userId:this.userId,crypto:this,olmDevice:this.olmDevice,baseApis:this.baseApis,roomId:e}),r&&(r[t]=i),i}getRoomDecryptors(e){const t=[];for(const r of Object.values(this.roomDecryptors))e in r&&t.push(r[e]);return t}async signObject(e){const t=e.signatures||{},r=e.unsigned;delete e.signatures,delete e.unsigned,t[this.userId]=t[this.userId]||{},t[this.userId]["ed25519:"+this.deviceId]=await this.olmDevice.sign(RD.default.stringify(e)),e.signatures=t,r!==void 0&&(e.unsigned=r)}}Gt.Crypto=LD;function ml(n){if(typeof n!="string"||n.indexOf(",")<0)return null;const e=Uint8Array.from(n.split(","),t=>parseInt(t));return Ct.encodeBase64(e)}class iE{constructor(e){(0,oe.default)(this,"userId",void 0),(0,oe.default)(this,"deviceId",void 0),(0,oe.default)(this,"requestId",void 0),(0,oe.default)(this,"requestBody",void 0),(0,oe.default)(this,"share",void 0);const t=e.getContent();this.userId=e.getSender(),this.deviceId=t.requesting_device_id,this.requestId=t.request_id,this.requestBody=t.body||{},this.share=()=>{throw new Error("don't know how to share keys for this request yet")}}}Gt.IncomingRoomKeyRequest=iE;class BD{constructor(e){(0,oe.default)(this,"userId",void 0),(0,oe.default)(this,"deviceId",void 0),(0,oe.default)(this,"requestId",void 0);const t=e.getContent();this.userId=e.getSender(),this.deviceId=t.requesting_device_id,this.requestId=t.request_id}}var mu={},yu={},KD=G.exports;Object.defineProperty(yu,"__esModule",{value:!0});yu.EventContext=void 0;var Od=KD(Y.exports),Qs=Wt;class FD{constructor(e){(0,Od.default)(this,"timeline",void 0),(0,Od.default)(this,"ourEventIndex",0),(0,Od.default)(this,"paginateTokens",{[Qs.Direction.Backward]:null,[Qs.Direction.Forward]:null}),this.timeline=[e]}getEvent(){return this.timeline[this.ourEventIndex]}getTimeline(){return this.timeline}getOurEventIndex(){return this.ourEventIndex}getPaginateToken(e=!1){return this.paginateTokens[e?Qs.Direction.Backward:Qs.Direction.Forward]}setPaginateToken(e,t=!1){this.paginateTokens[t?Qs.Direction.Backward:Qs.Direction.Forward]=e}addEvents(e,t=!1){t?(this.timeline=e.concat(this.timeline),this.ourEventIndex+=e.length):this.timeline=this.timeline.concat(e)}}yu.EventContext=FD;Object.defineProperty(mu,"__esModule",{value:!0});mu.SearchResult=void 0;var qD=yu;class Ff{static fromJson(e,t){const r=e.context||{},i=r.events_before||[],s=r.events_after||[],o=new qD.EventContext(t(e.result));return o.setPaginateToken(r.start,!0),o.addEvents(i.map(t),!0),o.addEvents(s.map(t),!1),o.setPaginateToken(r.end,!1),new Ff(e.rank,o)}constructor(e,t){this.rank=e,this.context=t}}mu.SearchResult=Ff;var pc={};Object.defineProperty(pc,"__esModule",{value:!0});pc.CrossSigningKey=void 0;let Zh;pc.CrossSigningKey=Zh;(function(n){n.Master="master",n.SelfSigning="self_signing",n.UserSigning="user_signing"})(Zh||(pc.CrossSigningKey=Zh={}));var qf={};Object.defineProperty(qf,"__esModule",{value:!0});qf.eventMapperFor=jD;var Gc=Ht;function jD(n,e){const t=Boolean(e.preventReEmit),r=e.decrypt!==!1;function i(s){const o=new Gc.MatrixEvent(s),a=n.getRoom(o.getRoomId());return a!=null&&a.threads.has(o.getId())&&o.setThread(a.threads.get(o.getId())),o.isEncrypted()&&(t||n.reEmitter.reEmit(o,[Gc.MatrixEventEvent.Decrypted]),r&&n.decryptEventIfNeeded(o)),t||n.reEmitter.reEmit(o,[Gc.MatrixEventEvent.Replaced,Gc.MatrixEventEvent.VisibilityChange]),o}return i}var ti={},vu={},VD=G.exports;Object.defineProperty(vu,"__esModule",{value:!0});vu.MSC3089Branch=void 0;var GD=VD(Y.exports),Zs=ne,WD=Wt;function Mm(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function Oi(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Mm(Object(t),!0).forEach(function(r){(0,GD.default)(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Mm(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}class HD{constructor(e,t,r){this.client=e,this.indexEvent=t,this.directory=r}get id(){const e=this.indexEvent.getStateKey();if(!e)throw new Error("State key not found for branch");return e}get isActive(){return this.indexEvent.getContent().active===!0}get version(){var e;return(e=this.indexEvent.getContent().version)!==null&&e!==void 0?e:1}get roomId(){return this.indexEvent.getRoomId()}async delete(){await this.client.sendStateEvent(this.roomId,Zs.UNSTABLE_MSC3089_BRANCH.name,{},this.id),await this.client.redactEvent(this.roomId,this.id);const e=(await this.getVersionHistory())[1];e&&await e.delete()}getName(){return this.indexEvent.getContent().name||"Unnamed File"}async setName(e){await this.client.sendStateEvent(this.roomId,Zs.UNSTABLE_MSC3089_BRANCH.name,Oi(Oi({},this.indexEvent.getContent()),{},{name:e}),this.id)}isLocked(){return this.indexEvent.getContent().locked||!1}async setLocked(e){await this.client.sendStateEvent(this.roomId,Zs.UNSTABLE_MSC3089_BRANCH.name,Oi(Oi({},this.indexEvent.getContent()),{},{locked:e}),this.id)}async getFileInfo(){const t=(await this.getFileEvent()).getOriginalContent().file,r=this.client.mxcUrlToHttp(t.url);if(!r)throw new Error(`No HTTP URL available for ${t.url}`);return{info:t,httpUrl:r}}async getFileEvent(){const e=this.client.getRoom(this.roomId);if(!e)throw new Error("Unknown room");let t=e.getUnfilteredTimelineSet().findEventById(this.id);for(;!t&&e.getLiveTimeline().getState(WD.EventTimeline.BACKWARDS).paginationToken;)await this.client.scrollback(e,100),t=e.getUnfilteredTimelineSet().findEventById(this.id);if(!t)throw new Error("Failed to find event");return await this.client.decryptEventIfNeeded(t,{emit:!0,isRetry:!0}),t}async createNewVersion(e,t,r,i){const s=await this.directory.createFile(e,t,r,Oi(Oi({},i!=null?i:{}),{},{"m.new_content":!0,"m.relates_to":{rel_type:Zs.RelationType.Replace,event_id:this.id}}));return await this.client.sendStateEvent(this.roomId,Zs.UNSTABLE_MSC3089_BRANCH.name,{active:!0,name:e,version:this.version+1},s.event_id),await this.client.sendStateEvent(this.roomId,Zs.UNSTABLE_MSC3089_BRANCH.name,Oi(Oi({},this.indexEvent.getContent()),{},{active:!1}),this.id),s}async getVersionHistory(){const e=[];e.push(this);const t=this.client.getRoom(this.roomId);if(!t)throw new Error("Invalid or unknown room");const r=[...t.getLiveTimeline().getEvents()].reverse();let i,s=await this.getFileEvent();do if(i=r.find(o=>o.replacingEventId()===s.getId()),i){const o=this.directory.getFile(i.getId());if(o)e.push(o),s=i;else break}while(i);return e}}vu.MSC3089Branch=HD;var sE=G.exports;Object.defineProperty(ti,"__esModule",{value:!0});ti.TreePermissions=eA=ti.MSC3089TreeSpace=QD=ti.DEFAULT_TREE_POWER_LEVELS_TEMPLATE=void 0;var oE=sE(Y.exports),YD=sE(rc.exports),Ee=ne,zD=ie,tr=W,Dm=vu,JD=xf;function Am(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function Qi(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Am(Object(t),!0).forEach(function(r){(0,oE.default)(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Am(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}const XD={invite:100,kick:100,ban:100,redact:50,state_default:50,events_default:50,users_default:0,events:{[Ee.EventType.RoomPowerLevels]:100,[Ee.EventType.RoomHistoryVisibility]:100,[Ee.EventType.RoomTombstone]:100,[Ee.EventType.RoomEncryption]:100,[Ee.EventType.RoomName]:50,[Ee.EventType.RoomMessage]:50,[Ee.EventType.RoomMessageEncrypted]:50,[Ee.EventType.Sticker]:50},users:{}};var QD=ti.DEFAULT_TREE_POWER_LEVELS_TEMPLATE=XD;let zn;ti.TreePermissions=zn;(function(n){n.Viewer="viewer",n.Editor="editor",n.Owner="owner"})(zn||(ti.TreePermissions=zn={}));class ZD{constructor(e,t){if(this.client=e,this.roomId=t,(0,oE.default)(this,"room",void 0),this.room=this.client.getRoom(this.roomId),!this.room)throw new Error("Unknown room")}get id(){return this.roomId}get isTopLevel(){const e=this.room.currentState.getStateEvents(Ee.EventType.SpaceParent);return e!=null&&e.length?e.every(t=>{var r;return!((r=t.getContent())!==null&&r!==void 0&&r.via)}):!0}async setName(e){await this.client.sendStateEvent(this.roomId,Ee.EventType.RoomName,{name:e},"")}async invite(e,t=!0,r=!0){const i=[this.retryInvite(e)];return t&&i.push(...this.getDirectories().map(s=>s.invite(e,t,r))),Promise.all(i).then(()=>{r&&(0,JD.isRoomSharedHistory)(this.room)&&this.client.sendSharedHistoryKeys(this.roomId,[e])})}retryInvite(e){return(0,tr.simpleRetryOperation)(async()=>{await this.client.invite(this.roomId,e).catch(t=>{throw(t==null?void 0:t.errcode)==="M_FORBIDDEN"?new YD.default.AbortError(t):t})})}async setPermissions(e,t){var r;const i=this.room.currentState.getStateEvents(Ee.EventType.RoomPowerLevels,"");if(Array.isArray(i))throw new Error("Unexpected return type for power levels");const s=i.getContent()||{},o=s.users_default||0,a=s.events_default||50,l=((r=s.events)===null||r===void 0?void 0:r[Ee.EventType.RoomPowerLevels])||100,u=s.users||{};switch(t){case zn.Viewer:u[e]=o;break;case zn.Editor:u[e]=a;break;case zn.Owner:u[e]=l;break;default:throw new Error("Invalid role: "+t)}s.users=u,await this.client.sendStateEvent(this.roomId,Ee.EventType.RoomPowerLevels,s,"")}getPermissions(e){var t,r;const i=this.room.currentState.getStateEvents(Ee.EventType.RoomPowerLevels,"");if(Array.isArray(i))throw new Error("Unexpected return type for power levels");const s=i.getContent()||{},o=s.users_default||0,a=s.events_default||50,l=((t=s.events)===null||t===void 0?void 0:t[Ee.EventType.RoomPowerLevels])||100,u=((r=s.users)===null||r===void 0?void 0:r[e])||o;return u>=l?zn.Owner:u>=a?zn.Editor:zn.Viewer}async createDirectory(e){const t=await this.client.unstableCreateFileTree(e);return await this.client.sendStateEvent(this.roomId,Ee.EventType.SpaceChild,{via:[this.client.getDomain()]},t.roomId),await this.client.sendStateEvent(t.roomId,Ee.EventType.SpaceParent,{via:[this.client.getDomain()]},this.roomId),t}getDirectories(){const e=[],t=this.room.currentState.getStateEvents(Ee.EventType.SpaceChild);for(const r of t)try{const i=r.getStateKey();if(i){const s=this.client.unstableGetFileTreeSpace(i);s&&e.push(s)}}catch(i){zD.logger.warn("Unable to create tree space instance for listing. Are we joined?",i)}return e}getDirectory(e){return this.getDirectories().find(t=>t.roomId===e)}async delete(){const e=this.getDirectories();for(const i of e)await i.delete();const t=["invite","knock","join"],r=this.room.currentState.getStateEvents(Ee.EventType.RoomMember);for(const i of r)if(i.getStateKey()!==this.client.getUserId()&&t.includes(i.getContent().membership)){const o=i.getStateKey();if(!o)throw new Error("State key not found for branch");await this.client.kick(this.roomId,o,"Room deleted")}await this.client.leave(this.roomId)}getOrderedChildren(e){const t=e.map(r=>({roomId:r.getStateKey(),order:r.getContent().order})).filter(r=>r.roomId);return t.sort((r,i)=>{if(r.order&&!i.order)return-1;if(!r.order&&i.order)return 1;if(!r.order&&!i.order){var s,o,a,l;const u=this.client.getRoom(r.roomId),c=this.client.getRoom(i.roomId);if(!u||!c)return(0,tr.lexicographicCompare)(r.roomId,i.roomId);const g=(s=(o=u.currentState.getStateEvents(Ee.EventType.RoomCreate,""))===null||o===void 0?void 0:o.getTs())!==null&&s!==void 0?s:0,m=(a=(l=c.currentState.getStateEvents(Ee.EventType.RoomCreate,""))===null||l===void 0?void 0:l.getTs())!==null&&a!==void 0?a:0;return g===m?(0,tr.lexicographicCompare)(r.roomId,i.roomId):g-m}else return(0,tr.lexicographicCompare)(r.order,i.order)}),t}getParentRoom(){const t=this.room.currentState.getStateEvents(Ee.EventType.SpaceParent)[0];if(!t)throw new Error("Expected to have a parent in a non-top level space");const r=t.getStateKey();if(!r)throw new Error("No state key found for parent");const i=this.client.getRoom(r);if(!i)throw new Error("Unable to locate room for parent");return i}getOrder(){if(this.isTopLevel)return-1;const t=this.getParentRoom().currentState.getStateEvents(Ee.EventType.SpaceChild);return this.getOrderedChildren(t).findIndex(i=>i.roomId===this.roomId)}async setOrder(e){var t;if(this.isTopLevel)throw new Error("Cannot set order of top level spaces currently");const r=this.getParentRoom(),i=r.currentState.getStateEvents(Ee.EventType.SpaceChild),s=this.getOrderedChildren(i);e=Math.max(Math.min(e,s.length-1),0);const a=this.getOrder()<e;a&&e===s.length-1?e--:!a&&e===0&&e++;const l=s[a?e:e-1],u=s[a?e+1:e];let c=tr.DEFAULT_ALPHABET[0],g=!1;if(!l)u!=null&&u.order&&(c=(0,tr.prevString)(u.order));else if(e===s.length-1)u!=null&&u.order&&(c=(0,tr.nextString)(u.order));else{const I=l==null?void 0:l.order,R=u==null?void 0:u.order;I&&R?I===R?c=(0,tr.nextString)(I):c=(0,tr.averageBetweenStrings)(I,R):I?c=(0,tr.nextString)(I):R?c=(0,tr.prevString)(R):g=!0}if(g){let I;for(let R=0;R<=e;R++){const T=s[R];if(R===0&&(I=T.order),T.order)I=T.order;else{var m;I=I?(0,tr.nextString)(I):tr.DEFAULT_ALPHABET[0];const C=r.currentState.getStateEvents(Ee.EventType.SpaceChild,T.roomId),S=(m=C==null?void 0:C.getContent())!==null&&m!==void 0?m:{via:[this.client.getDomain()]};await this.client.sendStateEvent(r.roomId,Ee.EventType.SpaceChild,Qi(Qi({},S),{},{order:I}),T.roomId)}}I&&(c=(0,tr.nextString)(I))}const f=r.currentState.getStateEvents(Ee.EventType.SpaceChild,this.roomId),_=(t=f==null?void 0:f.getContent())!==null&&t!==void 0?t:{via:[this.client.getDomain()]};await this.client.sendStateEvent(r.roomId,Ee.EventType.SpaceChild,Qi(Qi({},_),{},{order:c}),this.roomId)}async createFile(e,t,r,i){var s;const o=await this.client.uploadContent(t,{includeFilename:!1,onlyContentUri:!0,rawResponse:!1});r.url=o;const a={msgtype:Ee.MsgType.File,body:e,url:o,file:r};i=(s=i)!==null&&s!==void 0?s:{},i["m.new_content"]&&(i["m.new_content"]=a);const l=await this.client.sendMessage(this.roomId,Qi(Qi(Qi({},i),a),{},{[Ee.UNSTABLE_MSC3089_LEAF.name]:{}}));return await this.client.sendStateEvent(this.roomId,Ee.UNSTABLE_MSC3089_BRANCH.name,{active:!0,name:e},l.event_id),l}getFile(e){const t=this.room.currentState.getStateEvents(Ee.UNSTABLE_MSC3089_BRANCH.name,e);return t?new Dm.MSC3089Branch(this.client,t,this):null}listFiles(){return this.listAllFiles().filter(e=>e.isActive)}listAllFiles(){var e;return((e=this.room.currentState.getStateEvents(Ee.UNSTABLE_MSC3089_BRANCH.name))!==null&&e!==void 0?e:[]).map(r=>new Dm.MSC3089Branch(this.client,r,this))}}var eA=ti.MSC3089TreeSpace=ZD,Wo={};Object.defineProperty(Wo,"__esModule",{value:!0});Wo.SearchOrderBy=void 0;var xm;(function(n){n.RoomId="room_id",n.Sender="sender"})(xm||(xm={}));let ef;Wo.SearchOrderBy=ef;(function(n){n.Recent="recent",n.Rank="rank"})(ef||(Wo.SearchOrderBy=ef={}));var _u={},tA=G.exports;Object.defineProperty(_u,"__esModule",{value:!0});_u.MediaHandler=void 0;var ga=tA(Y.exports),xr=ie,rA=Oe;class nA{constructor(e){this.client=e,(0,ga.default)(this,"audioInput",void 0),(0,ga.default)(this,"videoInput",void 0),(0,ga.default)(this,"localUserMediaStream",void 0),(0,ga.default)(this,"userMediaStreams",[]),(0,ga.default)(this,"screensharingStreams",[])}async setAudioInput(e){xr.logger.info("LOG setting audio input to",e),this.audioInput!==e&&(this.audioInput=e,await this.updateLocalUsermediaStreams())}async setVideoInput(e){xr.logger.info("LOG setting video input to",e),this.videoInput!==e&&(this.videoInput=e,await this.updateLocalUsermediaStreams())}async updateLocalUsermediaStreams(){if(this.userMediaStreams.length===0)return;const e=new Map;for(const t of this.client.callEventHandler.calls.values())e.set(t.callId,{audio:t.hasLocalUserMediaAudioTrack,video:t.hasLocalUserMediaVideoTrack});for(const t of this.client.callEventHandler.calls.values()){if(t.state===rA.CallState.Ended||!e.has(t.callId))continue;const{audio:r,video:i}=e.get(t.callId),s=await this.getUserMediaStream(r,i,!1);await t.updateLocalUsermediaStream(s)}}async hasAudioDevice(){return(await navigator.mediaDevices.enumerateDevices()).filter(t=>t.kind==="audioinput").length>0}async hasVideoDevice(){return(await navigator.mediaDevices.enumerateDevices()).filter(t=>t.kind==="videoinput").length>0}async getUserMediaStream(e,t,r=!0){var i,s,o,a;const l=e&&await this.hasAudioDevice(),u=t&&await this.hasVideoDevice();let c;if(!this.localUserMediaStream||this.localUserMediaStream.getAudioTracks().length===0&&l||this.localUserMediaStream.getVideoTracks().length===0&&u||((i=this.localUserMediaStream.getAudioTracks()[0])===null||i===void 0||(s=i.getSettings())===null||s===void 0?void 0:s.deviceId)!==this.audioInput||((o=this.localUserMediaStream.getVideoTracks()[0])===null||o===void 0||(a=o.getSettings())===null||a===void 0?void 0:a.deviceId)!==this.videoInput){const g=this.getUserMediaContraints(l,u);xr.logger.log("Getting user media with constraints",g),c=await navigator.mediaDevices.getUserMedia(g);for(const m of c.getTracks()){const f=m.getSettings();m.kind==="audio"?this.audioInput=f.deviceId:m.kind==="video"&&(this.videoInput=f.deviceId)}r&&(this.localUserMediaStream=c)}else{if(c=this.localUserMediaStream.clone(),!l)for(const g of c.getAudioTracks())c.removeTrack(g);if(!u)for(const g of c.getVideoTracks())c.removeTrack(g)}return r&&this.userMediaStreams.push(c),c}stopUserMediaStream(e){xr.logger.debug("Stopping usermedia stream",e.id);for(const r of e.getTracks())r.stop();const t=this.userMediaStreams.indexOf(e);t!==-1&&(xr.logger.debug("Splicing usermedia stream out stream array",e.id),this.userMediaStreams.splice(t,1)),this.localUserMediaStream===e&&(this.localUserMediaStream=void 0)}async getScreensharingStream(e,t=!0){let r;if(this.screensharingStreams.length===0){const i=this.getScreenshareContraints(e);if(!i)return null;e?(xr.logger.debug("Getting screensharing stream using getUserMedia()",e),r=await navigator.mediaDevices.getUserMedia(i)):(xr.logger.debug("Getting screensharing stream using getDisplayMedia()"),r=await navigator.mediaDevices.getDisplayMedia(i))}else{const i=this.screensharingStreams[this.screensharingStreams.length-1];xr.logger.log("Cloning screensharing stream",i.id),r=i.clone()}return t&&this.screensharingStreams.push(r),r}stopScreensharingStream(e){xr.logger.debug("Stopping screensharing stream",e.id);for(const r of e.getTracks())r.stop();const t=this.screensharingStreams.indexOf(e);t!==-1&&(xr.logger.debug("Splicing screensharing stream out stream array",e.id),this.screensharingStreams.splice(t,1))}stopAllStreams(){for(const e of this.userMediaStreams)for(const t of e.getTracks())t.stop();for(const e of this.screensharingStreams)for(const t of e.getTracks())t.stop();this.userMediaStreams=[],this.screensharingStreams=[],this.localUserMediaStream=void 0}getUserMediaContraints(e,t){const r=!!navigator.webkitGetUserMedia;return{audio:e?{deviceId:this.audioInput?{ideal:this.audioInput}:void 0}:!1,video:t?{deviceId:this.videoInput?{ideal:this.videoInput}:void 0,width:r?{exact:640}:{ideal:640},height:r?{exact:360}:{ideal:360}}:!1}}getScreenshareContraints(e){return e?(xr.logger.debug("Using desktop capturer source",e),{audio:!1,video:{mandatory:{chromeMediaSource:"desktop",chromeMediaSourceId:e}}}):(xr.logger.debug("Not using desktop capturer source"),{audio:!1,video:!0})}}_u.MediaHandler=nA;var iA=G.exports;Object.defineProperty(ot,"__esModule",{value:!0});ot.RoomVersionStability=ot.PendingEventOrdering=ot.MatrixClient=ot.ClientEvent=ot.CRYPTO_ENABLED=void 0;var X=iA(Y.exports),kd=Yl,eo=Bi,it=Ht,sA=au,Um=Oe,Wc=xs,oA=Es,$=jf(W),ma=Wt,Cd=fc,aA=Ki,Pd=jf(De),cA=sn,lA=lu,se=ie,$m=Vo,M=me,Ft=Gt,Md=Go,Nm=$s,Dd=tn,uA=No,dA=mu,hA=Ts,to=Ps,fA=pc,ro=jf(Xe),le=ne,pA=Je,gA=qf,mA=li,Lm=Sr,Ad=ti,yA=Wo,Hc=Be,vA=_u,_A=je,Yc=dt,EA=In;function aE(n){if(typeof WeakMap!="function")return null;var e=new WeakMap,t=new WeakMap;return(aE=function(r){return r?t:e})(n)}function jf(n,e){if(!e&&n&&n.__esModule)return n;if(n===null||typeof n!="object"&&typeof n!="function")return{default:n};var t=aE(e);if(t&&t.has(n))return t.get(n);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in n)if(s!=="default"&&Object.prototype.hasOwnProperty.call(n,s)){var o=i?Object.getOwnPropertyDescriptor(n,s):null;o&&(o.get||o.set)?Object.defineProperty(r,s,o):r[s]=n[s]}return r.default=n,t&&t.set(n,r),r}function Bm(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(n,i).enumerable})),t.push.apply(t,r)}return t}function zc(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Bm(Object(t),!0).forEach(function(r){(0,X.default)(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):Bm(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}const SA=3e3,bA=(0,Ft.isCryptoAvailable)();ot.CRYPTO_ENABLED=bA;const wA=216e5,Km=10*60*1e3;let tf;ot.PendingEventOrdering=tf;(function(n){n.Chronological="chronological",n.Detached="detached"})(tf||(ot.PendingEventOrdering=tf={}));let rf;ot.RoomVersionStability=rf;(function(n){n.Stable="stable",n.Unstable="unstable"})(rf||(ot.RoomVersionStability=rf={}));var Fm;(function(n){n.MasterKey="master_key",n.SelfSigningKey="self_signing_key",n.UserSigningKey="user_signing_key"})(Fm||(Fm={}));const dn="$";let us;ot.ClientEvent=us;(function(n){n.Sync="sync",n.Event="event",n.ToDeviceEvent="toDeviceEvent",n.AccountData="accountData",n.Room="Room",n.DeleteRoom="deleteRoom",n.SyncUnexpectedError="sync.unexpectedError",n.ClientWellKnown="WellKnown.client",n.Group="Group",n.GroupProfile="Group.profile",n.GroupMyMembership="Group.myMembership"})(us||(ot.ClientEvent=us={}));class Eu extends _A.TypedEventEmitter{constructor(e){super(),(0,X.default)(this,"reEmitter",new cA.TypedReEmitter(this)),(0,X.default)(this,"olmVersion",null),(0,X.default)(this,"usingExternalCrypto",!1),(0,X.default)(this,"store",void 0),(0,X.default)(this,"deviceId",void 0),(0,X.default)(this,"credentials",void 0),(0,X.default)(this,"pickleKey",void 0),(0,X.default)(this,"scheduler",void 0),(0,X.default)(this,"clientRunning",!1),(0,X.default)(this,"timelineSupport",!1),(0,X.default)(this,"urlPreviewCache",{}),(0,X.default)(this,"unstableClientRelationAggregation",!1),(0,X.default)(this,"identityServer",void 0),(0,X.default)(this,"sessionStore",void 0),(0,X.default)(this,"http",void 0),(0,X.default)(this,"crypto",void 0),(0,X.default)(this,"cryptoCallbacks",void 0),(0,X.default)(this,"callEventHandler",void 0),(0,X.default)(this,"supportsCallTransfer",!1),(0,X.default)(this,"forceTURN",!1),(0,X.default)(this,"iceCandidatePoolSize",0),(0,X.default)(this,"idBaseUrl",void 0),(0,X.default)(this,"baseUrl",void 0),(0,X.default)(this,"canSupportVoip",!1),(0,X.default)(this,"peekSync",null),(0,X.default)(this,"isGuestAccount",!1),(0,X.default)(this,"ongoingScrollbacks",{}),(0,X.default)(this,"notifTimelineSet",null),(0,X.default)(this,"cryptoStore",void 0),(0,X.default)(this,"verificationMethods",void 0),(0,X.default)(this,"fallbackICEServerAllowed",!1),(0,X.default)(this,"roomList",void 0),(0,X.default)(this,"syncApi",void 0),(0,X.default)(this,"pushRules",void 0),(0,X.default)(this,"syncLeftRoomsPromise",void 0),(0,X.default)(this,"syncedLeftRooms",!1),(0,X.default)(this,"clientOpts",void 0),(0,X.default)(this,"clientWellKnownIntervalID",void 0),(0,X.default)(this,"canResetTimelineCallback",void 0),(0,X.default)(this,"pushProcessor",new Cd.PushProcessor(this)),(0,X.default)(this,"serverVersionsPromise",void 0),(0,X.default)(this,"cachedCapabilities",void 0),(0,X.default)(this,"clientWellKnown",void 0),(0,X.default)(this,"clientWellKnownPromise",void 0),(0,X.default)(this,"turnServers",[]),(0,X.default)(this,"turnServersExpiry",0),(0,X.default)(this,"checkTurnServersIntervalID",void 0),(0,X.default)(this,"exportedOlmDeviceToImport",void 0),(0,X.default)(this,"txnCtr",0),(0,X.default)(this,"mediaHandler",new vA.MediaHandler(this)),(0,X.default)(this,"pendingEventEncryption",new Map),(0,X.default)(this,"startCallEventHandler",()=>{this.isInitialSyncComplete()&&(this.callEventHandler.start(),this.off(us.Sync,this.startCallEventHandler))}),e.baseUrl=$.ensureNoTrailingSlash(e.baseUrl),e.idBaseUrl=$.ensureNoTrailingSlash(e.idBaseUrl),this.baseUrl=e.baseUrl,this.idBaseUrl=e.idBaseUrl,this.usingExternalCrypto=e.usingExternalCrypto,this.store=e.store||new sA.StubStore,this.deviceId=e.deviceId||null;const t=e.userId||null;this.credentials={userId:t},this.http=new M.MatrixHttpApi(this,{baseUrl:e.baseUrl,idBaseUrl:e.idBaseUrl,accessToken:e.accessToken,request:e.request,prefix:M.PREFIX_R0,onlyData:!0,extraParams:e.queryParams,localTimeoutMs:e.localTimeoutMs,useAuthorizationHeader:e.useAuthorizationHeader}),e.deviceToImport?this.deviceId?se.logger.warn("not importing device because device ID is provided to constructor independently of exported data"):this.credentials.userId?se.logger.warn("not importing device because user ID is provided to constructor independently of exported data"):e.deviceToImport.deviceId?(this.deviceId=e.deviceToImport.deviceId,this.credentials.userId=e.deviceToImport.userId,this.exportedOlmDeviceToImport=e.deviceToImport.olmDevice):se.logger.warn("not importing device because no device ID in exported data"):e.pickleKey&&(this.pickleKey=e.pickleKey),this.scheduler=e.scheduler,this.scheduler&&this.scheduler.setProcessFunction(async i=>{const s=this.getRoom(i.getRoomId());i.status!==it.EventStatus.SENDING&&this.updatePendingEventStatus(s,i,it.EventStatus.SENDING);const o=await this.sendEventHttpRequest(i);return s&&s.updatePendingEvent(i,it.EventStatus.SENT,o.event_id),o}),(0,Um.createNewMatrixCall)(this,void 0,void 0)&&(this.callEventHandler=new oA.CallEventHandler(this),this.canSupportVoip=!0,this.on(us.Sync,this.startCallEventHandler)),this.timelineSupport=Boolean(e.timelineSupport),this.unstableClientRelationAggregation=!!e.unstableClientRelationAggregation,this.cryptoStore=e.cryptoStore,this.sessionStore=e.sessionStore,this.verificationMethods=e.verificationMethods,this.cryptoCallbacks=e.cryptoCallbacks||{},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.roomList=new lA.RoomList(this.cryptoStore),this.on(it.MatrixEventEvent.Decrypted,i=>{var s,o;const a=i.getPushActions(),l=this.getPushActionsForEvent(i,!0),u=this.getRoom(i.getRoomId());if(!u)return;const c=u.getUnreadNotificationCount(to.NotificationCountType.Highlight),g=!!(a!=null&&(s=a.tweaks)!==null&&s!==void 0&&s.highlight),m=!!(l!=null&&(o=l.tweaks)!==null&&o!==void 0&&o.highlight);if((g!==m||c>0)&&!u.hasUserReadEvent(this.getUserId(),i.getId())){let f=c;m&&!g&&f++,!m&&g&&f--,u.setUnreadNotificationCount(to.NotificationCountType.Highlight,f),u.getUnreadNotificationCount(to.NotificationCountType.Total)<f&&u.setUnreadNotificationCount(to.NotificationCountType.Total,f)}}),this.on(to.RoomEvent.Receipt,(i,s)=>{if(s&&this.isRoomEncrypted(s.roomId)){const o=i.getContent();if(!(Object.keys(o).filter(g=>Object.keys(o[g]["m.read"]).includes(this.getUserId())).length>0))return;const l=20,u=s.getLiveTimeline().getEvents();let c=0;for(let g=u.length-1;g>=0;g--){if(g===u.length-l)return;const m=u[g];if(s.hasUserReadEvent(this.getUserId(),m.getId()))break;const f=this.getPushActionsForEvent(m);c+=f.tweaks&&f.tweaks.highlight?1:0}s.setUnreadNotificationCount(to.NotificationCountType.Highlight,c)}})}async startClient(e){if(this.clientRunning)return;this.clientRunning=!0,typeof e=="number"&&(e={initialSyncLimit:e});const t=this.getUserId();t&&this.store.storeUser(new Dd.User(t)),this.crypto&&(this.crypto.uploadDeviceKeys(),this.crypto.start()),this.canSupportVoip&&(this.checkTurnServersIntervalID=setInterval(()=>{this.checkTurnServers()},Km),this.checkTurnServers()),this.syncApi&&(se.logger.error("Still have sync object whilst not running: stopping old one"),this.syncApi.stop());try{const{serverSupport:r,stable:i}=await this.doesServerSupportThread();Yc.Thread.setServerSideSupport(r,i)}catch{Yc.Thread.setServerSideSupport(!1,!0)}this.clientOpts=Object.assign({},e),this.clientOpts.crypto=this.crypto,this.clientOpts.canResetEntireTimeline=r=>this.canResetTimelineCallback?this.canResetTimelineCallback(r):!1,this.syncApi=new eo.SyncApi(this,this.clientOpts),this.syncApi.sync(),this.clientOpts.clientWellKnownPollPeriod!==void 0&&(this.clientWellKnownIntervalID=setInterval(()=>{this.fetchClientWellKnown()},1e3*this.clientOpts.clientWellKnownPollPeriod),this.fetchClientWellKnown())}stopClient(){var e,t,r,i;se.logger.log("stopping MatrixClient"),this.clientRunning=!1,(e=this.syncApi)===null||e===void 0||e.stop(),this.syncApi=null,(t=this.crypto)===null||t===void 0||t.stop(),(r=this.peekSync)===null||r===void 0||r.stopPeeking(),(i=this.callEventHandler)===null||i===void 0||i.stop(),this.callEventHandler=null,V.clearInterval(this.checkTurnServersIntervalID),this.clientWellKnownIntervalID!==void 0&&V.clearInterval(this.clientWellKnownIntervalID)}async rehydrateDevice(){if(this.crypto)throw new Error("Cannot rehydrate device after crypto is initialized");if(!this.cryptoCallbacks.getDehydrationKey)return;const e=await this.getDehydratedDevice();if(!e)return;if(!e.device_data||!e.device_id){se.logger.info("no dehydrated device found");return}const t=new V.Olm.Account;try{const r=e.device_data;if(r.algorithm!==hA.DEHYDRATION_ALGORITHM){se.logger.warn("Wrong algorithm for dehydrated device");return}se.logger.log("unpickling dehydrated device");const i=await this.cryptoCallbacks.getDehydrationKey(r,o=>{t.unpickle(new Uint8Array(o),r.account)});if(t.unpickle(i,r.account),se.logger.log("unpickled device"),(await this.http.authedRequest(void 0,M.Method.Post,"/dehydrated_device/claim",void 0,{device_id:e.device_id},{prefix:"/_matrix/client/unstable/org.matrix.msc2697.v2"})).success===!0){this.deviceId=e.device_id,se.logger.info("using dehydrated device");const o=this.pickleKey||"DEFAULT_KEY";return this.exportedOlmDeviceToImport={pickledAccount:t.pickle(o),sessions:[],pickleKey:o},t.free(),this.deviceId}else{t.free(),se.logger.info("not using dehydrated device");return}}catch(r){t.free(),se.logger.warn("could not unpickle",r)}}async getDehydratedDevice(){try{return await this.http.authedRequest(void 0,M.Method.Get,"/dehydrated_device",void 0,void 0,{prefix:"/_matrix/client/unstable/org.matrix.msc2697.v2"})}catch(e){se.logger.info("could not get dehydrated device",e.toString());return}}async setDehydrationKey(e,t,r){if(!this.crypto){se.logger.warn("not dehydrating device if crypto is not enabled");return}return await this.crypto.dehydrationManager.setKeyAndQueueDehydration(e,t,r)}async createDehydratedDevice(e,t,r){if(!this.crypto){se.logger.warn("not dehydrating device if crypto is not enabled");return}return await this.crypto.dehydrationManager.setKey(e,t,r),await this.crypto.dehydrationManager.dehydrateDevice()}async exportDevice(){if(!this.crypto){se.logger.warn("not exporting device if crypto is not enabled");return}return{userId:this.credentials.userId,deviceId:this.deviceId,olmDevice:await this.crypto.olmDevice.export()}}clearStores(){if(this.clientRunning)throw new Error("Cannot clear stores while client is running");const e=[];return e.push(this.store.deleteAllData()),this.cryptoStore&&e.push(this.cryptoStore.deleteAllData()),Promise.all(e).then()}getUserId(){return this.credentials&&this.credentials.userId?this.credentials.userId:null}getDomain(){return this.credentials&&this.credentials.userId?this.credentials.userId.replace(/^.*?:/,""):null}getUserIdLocalpart(){return this.credentials&&this.credentials.userId?this.credentials.userId.split(":")[0].substring(1):null}getDeviceId(){return this.deviceId}supportsVoip(){return this.canSupportVoip}getMediaHandler(){return this.mediaHandler}setForceTURN(e){this.forceTURN=e}setSupportsCallTransfer(e){this.supportsCallTransfer=e}createCall(e){return(0,Um.createNewMatrixCall)(this,e)}getSyncState(){return this.syncApi?this.syncApi.getSyncState():null}getSyncStateData(){return this.syncApi?this.syncApi.getSyncStateData():null}isInitialSyncComplete(){const e=this.getSyncState();return e?e===eo.SyncState.Prepared||e===eo.SyncState.Syncing:!1}isGuest(){return this.isGuestAccount}setGuest(e){this.isGuestAccount=e}getScheduler(){return this.scheduler}retryImmediately(){return this.syncApi.retryImmediately()}getNotifTimelineSet(){return this.notifTimelineSet}setNotifTimelineSet(e){this.notifTimelineSet=e}getCapabilities(e=!1){const t=new Date().getTime();return this.cachedCapabilities&&!e&&t<this.cachedCapabilities.expiration?(se.logger.log("Returning cached capabilities"),Promise.resolve(this.cachedCapabilities.capabilities)):this.http.authedRequest(void 0,M.Method.Get,"/capabilities").catch(r=>{se.logger.error(r)}).then((r={})=>{const i=r.capabilities||{},s=Object.keys(i).length?wA:6e4+Math.random()*5e3;return this.cachedCapabilities={capabilities:i,expiration:t+s},se.logger.log("Caching capabilities: ",i),i})}async initCrypto(){if(!(0,Ft.isCryptoAvailable)())throw new Error("End-to-end encryption not supported in this js-sdk build: did you remember to load the olm library?");if(this.crypto){se.logger.warn("Attempt to re-initialise e2e encryption on MatrixClient");return}if(!this.sessionStore)throw new Error("Cannot enable encryption: no sessionStore provided");if(!this.cryptoStore)throw new Error("Cannot enable encryption: no cryptoStore provided");se.logger.log("Crypto: Starting up crypto store..."),await this.cryptoStore.startup(),se.logger.log("Crypto: initialising roomlist..."),await this.roomList.init();const e=this.getUserId();if(e===null)throw new Error("Cannot enable encryption on MatrixClient with unknown userId: ensure userId is passed in createClient().");if(this.deviceId===null)throw new Error("Cannot enable encryption on MatrixClient with unknown deviceId: ensure deviceId is passed in createClient().");const t=new Ft.Crypto(this,this.sessionStore,e,this.deviceId,this.store,this.cryptoStore,this.roomList,this.verificationMethods);this.reEmitter.reEmit(t,[Ft.CryptoEvent.KeyBackupFailed,Ft.CryptoEvent.KeyBackupSessionsRemaining,Ft.CryptoEvent.RoomKeyRequest,Ft.CryptoEvent.RoomKeyRequestCancellation,Ft.CryptoEvent.Warning,Ft.CryptoEvent.DevicesUpdated,Ft.CryptoEvent.WillUpdateDevices,Ft.CryptoEvent.DeviceVerificationChanged,Ft.CryptoEvent.UserTrustStatusChanged,Ft.CryptoEvent.KeysChanged]),se.logger.log("Crypto: initialising crypto object..."),await t.init({exportedOlmDevice:this.exportedOlmDeviceToImport,pickleKey:this.pickleKey}),delete this.exportedOlmDeviceToImport,this.olmVersion=Ft.Crypto.getOlmVersion(),t.registerEventHandlers(this),this.crypto=t}isCryptoEnabled(){return!!this.crypto}getDeviceEd25519Key(){return this.crypto?this.crypto.getDeviceEd25519Key():null}getDeviceCurve25519Key(){return this.crypto?this.crypto.getDeviceCurve25519Key():null}async uploadKeys(){if(!this.crypto)throw new Error("End-to-end encryption disabled");await this.crypto.uploadDeviceKeys()}downloadKeys(e,t){return this.crypto?this.crypto.downloadKeys(e,t):Promise.reject(new Error("End-to-end encryption disabled"))}getStoredDevicesForUser(e){if(!this.crypto)throw new Error("End-to-end encryption disabled");return this.crypto.getStoredDevicesForUser(e)||[]}getStoredDevice(e,t){if(!this.crypto)throw new Error("End-to-end encryption disabled");return this.crypto.getStoredDevice(e,t)||null}setDeviceVerified(e,t,r=!0){const i=this.setDeviceVerification(e,t,r,null,null);return e==this.credentials.userId&&this.checkKeyBackup(),i}setDeviceBlocked(e,t,r=!0){return this.setDeviceVerification(e,t,null,r,null)}setDeviceKnown(e,t,r=!0){return this.setDeviceVerification(e,t,null,null,r)}async setDeviceVerification(e,t,r,i,s){if(!this.crypto)throw new Error("End-to-end encryption disabled");await this.crypto.setDeviceVerification(e,t,r,i,s)}requestVerificationDM(e,t){if(!this.crypto)throw new Error("End-to-end encryption disabled");return this.crypto.requestVerificationDM(e,t)}findVerificationRequestDMInProgress(e){if(!this.crypto)throw new Error("End-to-end encryption disabled");return this.crypto.findVerificationRequestDMInProgress(e)}getVerificationRequestsToDeviceInProgress(e){if(!this.crypto)throw new Error("End-to-end encryption disabled");return this.crypto.getVerificationRequestsToDeviceInProgress(e)}requestVerification(e,t){if(!this.crypto)throw new Error("End-to-end encryption disabled");return this.crypto.requestVerification(e,t)}beginKeyVerification(e,t,r){if(!this.crypto)throw new Error("End-to-end encryption disabled");return this.crypto.beginKeyVerification(e,t,r)}checkSecretStorageKey(e,t){if(!this.crypto)throw new Error("End-to-end encryption disabled");return this.crypto.checkSecretStorageKey(e,t)}setGlobalBlacklistUnverifiedDevices(e){if(!this.crypto)throw new Error("End-to-end encryption disabled");return this.crypto.setGlobalBlacklistUnverifiedDevices(e)}getGlobalBlacklistUnverifiedDevices(){if(!this.crypto)throw new Error("End-to-end encryption disabled");return this.crypto.getGlobalBlacklistUnverifiedDevices()}setGlobalErrorOnUnknownDevices(e){if(!this.crypto)throw new Error("End-to-end encryption disabled");return this.crypto.setGlobalErrorOnUnknownDevices(e)}getGlobalErrorOnUnknownDevices(){if(!this.crypto)throw new Error("End-to-end encryption disabled");return this.crypto.getGlobalErrorOnUnknownDevices()}getCrossSigningId(e=fA.CrossSigningKey.Master){if(!this.crypto)throw new Error("End-to-end encryption disabled");return this.crypto.getCrossSigningId(e)}getStoredCrossSigningForUser(e){if(!this.crypto)throw new Error("End-to-end encryption disabled");return this.crypto.getStoredCrossSigningForUser(e)}checkUserTrust(e){if(!this.crypto)throw new Error("End-to-end encryption disabled");return this.crypto.checkUserTrust(e)}checkDeviceTrust(e,t){if(!this.crypto)throw new Error("End-to-end encryption disabled");return this.crypto.checkDeviceTrust(e,t)}checkOwnCrossSigningTrust(e){if(!this.crypto)throw new Error("End-to-end encryption disabled");return this.crypto.checkOwnCrossSigningTrust(e)}checkCrossSigningPrivateKey(e,t){if(!this.crypto)throw new Error("End-to-end encryption disabled");return this.crypto.checkCrossSigningPrivateKey(e,t)}legacyDeviceVerification(e,t,r){if(!this.crypto)throw new Error("End-to-end encryption disabled");return this.crypto.legacyDeviceVerification(e,t,r)}prepareToEncrypt(e){if(!this.crypto)throw new Error("End-to-end encryption disabled");return this.crypto.prepareToEncrypt(e)}isCrossSigningReady(){if(!this.crypto)throw new Error("End-to-end encryption disabled");return this.crypto.isCrossSigningReady()}bootstrapCrossSigning(e){if(!this.crypto)throw new Error("End-to-end encryption disabled");return this.crypto.bootstrapCrossSigning(e)}getCryptoTrustCrossSignedDevices(){if(!this.crypto)throw new Error("End-to-end encryption disabled");return this.crypto.getCryptoTrustCrossSignedDevices()}setCryptoTrustCrossSignedDevices(e){if(!this.crypto)throw new Error("End-to-end encryption disabled");return this.crypto.setCryptoTrustCrossSignedDevices(e)}countSessionsNeedingBackup(){if(!this.crypto)throw new Error("End-to-end encryption disabled");return this.crypto.countSessionsNeedingBackup()}getEventEncryptionInfo(e){if(!this.crypto)throw new Error("End-to-end encryption disabled");return this.crypto.getEventEncryptionInfo(e)}createRecoveryKeyFromPassphrase(e){if(!this.crypto)throw new Error("End-to-end encryption disabled");return this.crypto.createRecoveryKeyFromPassphrase(e)}isSecretStorageReady(){if(!this.crypto)throw new Error("End-to-end encryption disabled");return this.crypto.isSecretStorageReady()}bootstrapSecretStorage(e){if(!this.crypto)throw new Error("End-to-end encryption disabled");return this.crypto.bootstrapSecretStorage(e)}addSecretStorageKey(e,t,r){if(!this.crypto)throw new Error("End-to-end encryption disabled");return this.crypto.addSecretStorageKey(e,t,r)}hasSecretStorageKey(e){if(!this.crypto)throw new Error("End-to-end encryption disabled");return this.crypto.hasSecretStorageKey(e)}storeSecret(e,t,r){if(!this.crypto)throw new Error("End-to-end encryption disabled");return this.crypto.storeSecret(e,t,r)}getSecret(e){if(!this.crypto)throw new Error("End-to-end encryption disabled");return this.crypto.getSecret(e)}isSecretStored(e,t){if(!this.crypto)throw new Error("End-to-end encryption disabled");return this.crypto.isSecretStored(e,t)}requestSecret(e,t){if(!this.crypto)throw new Error("End-to-end encryption disabled");return this.crypto.requestSecret(e,t)}getDefaultSecretStorageKeyId(){if(!this.crypto)throw new Error("End-to-end encryption disabled");return this.crypto.getDefaultSecretStorageKeyId()}setDefaultSecretStorageKeyId(e){if(!this.crypto)throw new Error("End-to-end encryption disabled");return this.crypto.setDefaultSecretStorageKeyId(e)}checkSecretStoragePrivateKey(e,t){if(!this.crypto)throw new Error("End-to-end encryption disabled");return this.crypto.checkSecretStoragePrivateKey(e,t)}async getEventSenderDeviceInfo(e){return this.crypto?this.crypto.getEventSenderDeviceInfo(e):null}async isEventSenderVerified(e){const t=await this.getEventSenderDeviceInfo(e);return t?t.isVerified():!1}cancelAndResendEventRoomKeyRequest(e){return e.cancelAndResendKeyRequest(this.crypto,this.getUserId())}setRoomEncryption(e,t){if(!this.crypto)throw new Error("End-to-End encryption disabled");return this.crypto.setRoomEncryption(e,t)}isRoomEncrypted(e){const t=this.getRoom(e);return t?t.currentState.getStateEvents(le.EventType.RoomEncryption,"")?!0:this.roomList.isRoomEncrypted(e):!1}forceDiscardSession(e){if(!this.crypto)throw new Error("End-to-End encryption disabled");this.crypto.forceDiscardSession(e)}exportRoomKeys(){return this.crypto?this.crypto.exportRoomKeys():Promise.reject(new Error("End-to-end encryption disabled"))}importRoomKeys(e,t){if(!this.crypto)throw new Error("End-to-end encryption disabled");return this.crypto.importRoomKeys(e,t)}checkKeyBackup(){return this.crypto.backupManager.checkKeyBackup()}async getKeyBackupVersion(){let e;try{e=await this.http.authedRequest(void 0,M.Method.Get,"/room_keys/version",void 0,void 0,{prefix:M.PREFIX_UNSTABLE})}catch(t){if(t.errcode==="M_NOT_FOUND")return null;throw t}try{Lm.BackupManager.checkBackupVersion(e)}catch(t){throw t}return e}isKeyBackupTrusted(e){return this.crypto.backupManager.isKeyBackupTrusted(e)}getKeyBackupEnabled(){if(!this.crypto)throw new Error("End-to-end encryption disabled");return this.crypto.backupManager.getKeyBackupEnabled()}enableKeyBackup(e){if(!this.crypto)throw new Error("End-to-end encryption disabled");return this.crypto.backupManager.enableKeyBackup(e)}disableKeyBackup(){if(!this.crypto)throw new Error("End-to-end encryption disabled");this.crypto.backupManager.disableKeyBackup()}async prepareKeyBackupVersion(e,t={secureSecretStorage:!1}){if(!this.crypto)throw new Error("End-to-end encryption disabled");const{algorithm:r,auth_data:i,recovery_key:s,privateKey:o}=await this.crypto.backupManager.prepareKeyBackupVersion(e);return t.secureSecretStorage&&(await this.storeSecret("m.megolm_backup.v1",(0,Pd.encodeBase64)(o)),se.logger.info("Key backup private key stored in secret storage")),{algorithm:r,auth_data:i,recovery_key:s}}isKeyBackupKeyStored(){return Promise.resolve(this.isSecretStored("m.megolm_backup.v1",!1))}async createKeyBackupVersion(e){if(!this.crypto)throw new Error("End-to-end encryption disabled");await this.crypto.backupManager.createKeyBackupVersion(e);const t={algorithm:e.algorithm,auth_data:e.auth_data};await this.crypto.signObject(t.auth_data),this.cryptoCallbacks.getCrossSigningKey&&this.crypto.crossSigningInfo.getId()&&await this.crypto.crossSigningInfo.signObject(t.auth_data,"master");const r=await this.http.authedRequest(void 0,M.Method.Post,"/room_keys/version",void 0,t,{prefix:M.PREFIX_UNSTABLE});return await this.checkKeyBackup(),this.getKeyBackupEnabled()||se.logger.error("Key backup not usable even though we just created it"),r}deleteKeyBackupVersion(e){if(!this.crypto)throw new Error("End-to-end encryption disabled");this.crypto.backupManager.version&&this.crypto.backupManager.disableKeyBackup();const t=$.encodeUri("/room_keys/version/$version",{$version:e});return this.http.authedRequest(void 0,M.Method.Delete,t,void 0,void 0,{prefix:M.PREFIX_UNSTABLE})}makeKeyBackupPath(e,t,r){let i;return t!==void 0?i=$.encodeUri("/room_keys/keys/$roomId/$sessionId",{$roomId:e,$sessionId:t}):e!==void 0?i=$.encodeUri("/room_keys/keys/$roomId",{$roomId:e}):i="/room_keys/keys",{path:i,queryData:r===void 0?void 0:{version:r}}}sendKeyBackup(e,t,r,i){if(!this.crypto)throw new Error("End-to-end encryption disabled");const s=this.makeKeyBackupPath(e,t,r);return this.http.authedRequest(void 0,M.Method.Put,s.path,s.queryData,i,{prefix:M.PREFIX_UNSTABLE})}async scheduleAllGroupSessionsForBackup(){if(!this.crypto)throw new Error("End-to-end encryption disabled");await this.crypto.backupManager.scheduleAllGroupSessionsForBackup()}flagAllGroupSessionsForBackup(){if(!this.crypto)throw new Error("End-to-end encryption disabled");return this.crypto.backupManager.flagAllGroupSessionsForBackup()}isValidRecoveryKey(e){try{return(0,Md.decodeRecoveryKey)(e),!0}catch{return!1}}keyBackupKeyFromPassword(e,t){return(0,Nm.keyFromAuthData)(t.auth_data,e)}keyBackupKeyFromRecoveryKey(e){return(0,Md.decodeRecoveryKey)(e)}async restoreKeyBackupWithPassword(e,t,r,i,s){const o=await(0,Nm.keyFromAuthData)(i.auth_data,e);return this.restoreKeyBackup(o,t,r,i,s)}async restoreKeyBackupWithSecretStorage(e,t,r,i){const s=await this.getSecret("m.megolm_backup.v1"),o=(0,Ft.fixBackupKey)(s);if(o){const[l]=await this.crypto.getSecretStorageKey();await this.storeSecret("m.megolm_backup.v1",o,[l])}const a=(0,Pd.decodeBase64)(o||s);return this.restoreKeyBackup(a,t,r,e,i)}restoreKeyBackupWithRecoveryKey(e,t,r,i,s){const o=(0,Md.decodeRecoveryKey)(e);return this.restoreKeyBackup(o,t,r,i,s)}async restoreKeyBackupWithCache(e,t,r,i){const s=await this.crypto.getSessionBackupPrivateKey();if(!s)throw new Error("Couldn't get key");return this.restoreKeyBackup(s,e,t,r,i)}async restoreKeyBackup(e,t,r,i,s){const o=s==null?void 0:s.cacheCompleteCallback,a=s==null?void 0:s.progressCallback;if(!this.crypto)throw new Error("End-to-end encryption disabled");let l=0,u=[];const c=this.makeKeyBackupPath(t,r,i.version),g=await Lm.BackupManager.makeAlgorithm(i,async()=>e),m=g.untrusted;try{if(!await g.keyMatches(e))return Promise.reject(new M.MatrixError({errcode:Eu.RESTORE_BACKUP_ERROR_BAD_KEY}));this.crypto.storeSessionBackupPrivateKey(e).catch(_=>{se.logger.warn("Error caching session backup key:",_)}).then(o),a&&a({stage:"fetch"});const f=await this.http.authedRequest(void 0,M.Method.Get,c.path,c.queryData,void 0,{prefix:M.PREFIX_UNSTABLE});if(f.rooms){const _=f.rooms;for(const[I,R]of Object.entries(_)){if(!R.sessions)continue;l+=Object.keys(R.sessions).length;const T=await g.decryptSessions(R.sessions);for(const C of T)C.room_id=I,u.push(C)}}else if(f.sessions){const _=f.sessions;l=Object.keys(_).length,u=await g.decryptSessions(_);for(const I of u)I.room_id=t}else{l=1;try{const[_]=await g.decryptSessions({[r]:f});_.room_id=t,_.session_id=r,u.push(_)}catch(_){se.logger.log("Failed to decrypt megolm session from backup",_)}}}finally{g.free()}return await this.importRoomKeys(u,{progressCallback:a,untrusted:m,source:"backup"}),await this.checkKeyBackup(),{total:l,imported:u.length}}deleteKeysFromBackup(e,t,r){if(!this.crypto)throw new Error("End-to-end encryption disabled");const i=this.makeKeyBackupPath(e,t,r);return this.http.authedRequest(void 0,M.Method.Delete,i.path,i.queryData,void 0,{prefix:M.PREFIX_UNSTABLE})}async sendSharedHistoryKeys(e,t){if(!this.crypto)throw new Error("End-to-end encryption disabled");const r=this.roomList.getRoomEncryption(e);if(!r){se.logger.error("Unknown room. Not sharing decryption keys");return}const i=await this.crypto.downloadKeys(t),s={};for(const[a,l]of Object.entries(i))s[a]=Object.values(l);const o=this.crypto.getRoomDecryptor(e,r.algorithm);o.sendSharedHistoryInboundSessions?await o.sendSharedHistoryInboundSessions(s):se.logger.warn("Algorithm does not support sharing previous keys",r.algorithm)}getGroup(e){return this.store.getGroup(e)}getGroups(){return this.store.getGroups()}getMediaConfig(e){return this.http.authedRequest(e,M.Method.Get,"/config",void 0,void 0,{prefix:M.PREFIX_MEDIA_R0})}getRoom(e){return this.store.getRoom(e)}getRooms(){return this.store.getRooms()}getVisibleRooms(){const e=this.store.getRooms(),t=new Set;for(const r of e){const i=r.currentState.getStateEvents(le.EventType.RoomCreate,"");if(i){const s=i.getContent().predecessor;s&&s.room_id&&t.add(s.room_id)}}return e.filter(r=>!(r.currentState.getStateEvents(le.EventType.RoomTombstone,"")&&t.has(r.roomId)))}getUser(e){return this.store.getUser(e)}getUsers(){return this.store.getUsers()}setAccountData(e,t,r){const i=$.encodeUri("/user/$userId/account_data/$type",{$userId:this.credentials.userId,$type:e}),s=(0,M.retryNetworkOperation)(5,()=>this.http.authedRequest(void 0,M.Method.Put,i,void 0,t));return r&&s.then(o=>r(null,o),r),s}getAccountData(e){return this.store.getAccountData(e)}async getAccountDataFromServer(e){if(this.isInitialSyncComplete()){const r=this.store.getAccountData(e);return r?r.getContent():null}const t=$.encodeUri("/user/$userId/account_data/$type",{$userId:this.credentials.userId,$type:e});try{return await this.http.authedRequest(void 0,M.Method.Get,t,void 0)}catch(r){if(r.data&&r.data.errcode==="M_NOT_FOUND")return null;throw r}}getIgnoredUsers(){const e=this.getAccountData("m.ignored_user_list");return!e||!e.getContent()||!e.getContent().ignored_users?[]:Object.keys(e.getContent().ignored_users)}setIgnoredUsers(e,t){const r={ignored_users:{}};return e.map(i=>r.ignored_users[i]={}),this.setAccountData("m.ignored_user_list",r,t)}isUserIgnored(e){return this.getIgnoredUsers().includes(e)}async joinRoom(e,t,r){if($.isFunction(t))throw new Error("Expected 'opts' object, got function.");t=t||{},t.syncRoom===void 0&&(t.syncRoom=!0);const i=this.getRoom(e);if(i&&i.hasMembershipState(this.credentials.userId,"join"))return Promise.resolve(i);let s=Promise.resolve();t.inviteSignUrl&&(s=this.http.requestOtherUrl(void 0,M.Method.Post,t.inviteSignUrl,{mxid:this.credentials.userId}));const o={};t.viaServers&&(o.server_name=t.viaServers);const a={qsStringifyOptions:{arrayFormat:"repeat"}};try{const l={},u=await s;u&&(l.third_party_signed=u);const c=$.encodeUri("/join/$roomid",{$roomid:e}),m=(await this.http.authedRequest(void 0,M.Method.Post,c,o,l,a)).room_id,_=new eo.SyncApi(this,this.clientOpts).createRoom(m);return t.syncRoom,r==null||r(null,_),_}catch(l){throw r==null||r(l),l}}resendEvent(e,t){return this.updatePendingEventStatus(t,e,it.EventStatus.SENDING),this.encryptAndSendEvent(t,e)}cancelPendingEvent(e){if(![it.EventStatus.QUEUED,it.EventStatus.NOT_SENT,it.EventStatus.ENCRYPTING].includes(e.status))throw new Error("cannot cancel an event with status "+e.status);e.status===it.EventStatus.ENCRYPTING?this.pendingEventEncryption.delete(e.getId()):this.scheduler&&e.status===it.EventStatus.QUEUED&&this.scheduler.removeEventFromQueue(e);const t=this.getRoom(e.getRoomId());this.updatePendingEventStatus(t,e,it.EventStatus.CANCELLED)}setRoomName(e,t,r){return this.sendStateEvent(e,le.EventType.RoomName,{name:t},void 0,r)}setRoomTopic(e,t,r){return this.sendStateEvent(e,le.EventType.RoomTopic,{topic:t},void 0,r)}getRoomTags(e,t){const r=$.encodeUri("/user/$userId/rooms/$roomId/tags/",{$userId:this.credentials.userId,$roomId:e});return this.http.authedRequest(t,M.Method.Get,r,void 0)}setRoomTag(e,t,r,i){const s=$.encodeUri("/user/$userId/rooms/$roomId/tags/$tag",{$userId:this.credentials.userId,$roomId:e,$tag:t});return this.http.authedRequest(i,M.Method.Put,s,void 0,r)}deleteRoomTag(e,t,r){const i=$.encodeUri("/user/$userId/rooms/$roomId/tags/$tag",{$userId:this.credentials.userId,$roomId:e,$tag:t});return this.http.authedRequest(r,M.Method.Delete,i,void 0,void 0)}setRoomAccountData(e,t,r,i){const s=$.encodeUri("/user/$userId/rooms/$roomId/account_data/$type",{$userId:this.credentials.userId,$roomId:e,$type:t});return this.http.authedRequest(i,M.Method.Put,s,void 0,r)}setPowerLevel(e,t,r,i,s){let o={users:{}};(i==null?void 0:i.getType())===le.EventType.RoomPowerLevels&&(o=$.deepCopy(i.getContent())),o.users[t]=r;const a=$.encodeUri("/rooms/$roomId/state/m.room.power_levels",{$roomId:e});return this.http.authedRequest(s,M.Method.Put,a,void 0,o)}async unstable_createLiveBeacon(e,t,r){const i=this.getUserId(),s=EA.M_BEACON_INFO_VARIABLE.name.replace("*",`${i}.${r}`);return this.unstable_setLiveBeacon(e,s,t)}async unstable_setLiveBeacon(e,t,r){const i=this.getUserId();return this.sendStateEvent(e,t,r,i)}sendEvent(e,t,r,i,s,o){var a,l;if(!((a=t)!==null&&a!==void 0&&a.startsWith(dn))&&t!==null&&(o=s,s=i,i=r,r=t,t=null),t&&!((l=i["m.relates_to"])!==null&&l!==void 0&&l.rel_type)){var u;i["m.relates_to"]=zc(zc({},i["m.relates_to"]),{},{rel_type:Yc.THREAD_RELATION_TYPE.name,event_id:t});const g=(u=this.getRoom(e))===null||u===void 0?void 0:u.threads.get(t);if(g){var c;i["m.relates_to"]["m.in_reply_to"]={event_id:(c=g.lastReply(m=>m.isRelation(Yc.THREAD_RELATION_TYPE.name)&&!m.status))===null||c===void 0?void 0:c.getId()}}}return this.sendCompleteEvent(e,t,{type:r,content:i},s,o)}sendCompleteEvent(e,t,r,i,s){$.isFunction(i)&&(s=i,i=void 0),i||(i=this.makeTxnId());const o=new it.MatrixEvent(Object.assign(r,{event_id:"~"+e+":"+i,user_id:this.credentials.userId,sender:this.credentials.userId,room_id:e,origin_server_ts:new Date().getTime()})),a=this.getRoom(e),l=a==null?void 0:a.threads.get(t);l&&(o.setThread(l),o.setThreadId(l.id));const u=o.getAssociatedId();if(u!=null&&u.startsWith("~")){const g=a.getPendingEvents().find(m=>m.getId()===u);g.once(it.MatrixEventEvent.LocalEventIdReplaced,()=>{o.updateAssociatedId(g.getId())})}const c=o.getType();return se.logger.log(`sendEvent of type ${c} in ${e} with txnId ${i}`),o.setTxnId(i),o.setStatus(it.EventStatus.SENDING),a&&a.addPendingEvent(o,i),o.status===it.EventStatus.NOT_SENT?Promise.reject(new Error("Event blocked by other events not yet sent")):this.encryptAndSendEvent(a,o,s)}encryptAndSendEvent(e,t,r){let i=!1;return Promise.resolve().then(()=>{const s=this.encryptEventIfNeeded(t,e);return s?(this.pendingEventEncryption.set(t.getId(),s),this.updatePendingEventStatus(e,t,it.EventStatus.ENCRYPTING),s.then(()=>{if(!this.pendingEventEncryption.has(t.getId())){i=!0;return}this.updatePendingEventStatus(e,t,it.EventStatus.SENDING)})):null}).then(()=>{if(i)return{};let s;return this.scheduler&&(s=this.scheduler.queueEvent(t),s&&this.scheduler.getQueueForEvent(t).length>1&&this.updatePendingEventStatus(e,t,it.EventStatus.QUEUED)),s||(s=this.sendEventHttpRequest(t),e&&(s=s.then(o=>(e.updatePendingEvent(t,it.EventStatus.SENT,o.event_id),o)))),s}).then(s=>(r==null||r(null,s),s)).catch(s=>{se.logger.error("Error sending event",s.stack||s);try{t.error=s,this.updatePendingEventStatus(e,t,it.EventStatus.NOT_SENT),s.event=t,r==null||r(s)}catch(o){se.logger.error("Exception in error handler!",o.stack||s)}throw s})}encryptEventIfNeeded(e,t){if(e.isEncrypted()||e.isRedaction()||!this.isRoomEncrypted(e.getRoomId())||!this.crypto&&this.usingExternalCrypto||e.getType()===le.EventType.Reaction)return null;if(!this.crypto)throw new Error("This room is configured to use encryption, but your client does not support encryption.");return this.crypto.encryptEvent(e,t)}getEncryptedIfNeededEventType(e,t){return t===le.EventType.Reaction?t:this.isRoomEncrypted(e)?le.EventType.RoomMessageEncrypted:t}updatePendingEventStatus(e,t,r){e?e.updatePendingEvent(t,r):t.setStatus(r)}sendEventHttpRequest(e){let t=e.getTxnId();t||(t=this.makeTxnId(),e.setTxnId(t));const r={$roomId:e.getRoomId(),$eventType:e.getWireType(),$stateKey:e.getStateKey(),$txnId:t};let i;if(e.isState()){let s="/rooms/$roomId/state/$eventType";e.getStateKey()&&e.getStateKey().length>0&&(s="/rooms/$roomId/state/$eventType/$stateKey"),i=$.encodeUri(s,r)}else if(e.isRedaction()){const s="/rooms/$roomId/redact/$redactsEventId/$txnId";i=$.encodeUri(s,Object.assign({$redactsEventId:e.event.redacts},r))}else i=$.encodeUri("/rooms/$roomId/send/$eventType/$txnId",r);return this.http.authedRequest(void 0,M.Method.Put,i,void 0,e.getWireContent()).then(s=>(se.logger.log(`Event sent to ${e.getRoomId()} with event id ${s.event_id}`),s))}redactEvent(e,t,r,i,s){var o;(o=r)!==null&&o!==void 0&&o.startsWith(dn)||(s=i,i=r,r=t,t=null);const l=(typeof s=="object"?s:{}).reason,u=typeof s=="function"?s:void 0;return this.sendCompleteEvent(e,t,{type:le.EventType.RoomRedaction,content:{reason:l},redacts:r},i,u)}sendMessage(e,t,r,i,s){typeof t!="string"&&t!==null&&(s=i,i=r,r=t,t=null),$.isFunction(i)&&(s=i,i=void 0);let o=le.EventType.RoomMessage,a=r;const l=(c={},g=!0)=>{let m=null;if(c.msgtype===le.MsgType.Text?m=kd.MessageEvent.from(c.body,c.formatted_body).serialize():c.msgtype===le.MsgType.Emote?m=kd.EmoteEvent.from(c.body,c.formatted_body).serialize():c.msgtype===le.MsgType.Notice&&(m=kd.NoticeEvent.from(c.body,c.formatted_body).serialize()),m&&c["m.new_content"]&&g){const f=l(c["m.new_content"],!1);f&&(m.content["m.new_content"]=f.content)}if(m)for(const[f,_]of Object.entries(c))m.content.hasOwnProperty(f)||(m.content[f]=_);return m},u=l(a);return u&&(o=u.type,a=u.content),this.sendEvent(e,t,o,a,i,s)}sendTextMessage(e,t,r,i,s){var o;!((o=t)!==null&&o!==void 0&&o.startsWith(dn))&&t!==null&&(s=i,i=r,r=t,t=null);const a=ro.makeTextMessage(r);return this.sendMessage(e,t,a,i,s)}sendNotice(e,t,r,i,s){var o;!((o=t)!==null&&o!==void 0&&o.startsWith(dn))&&t!==null&&(s=i,i=r,r=t,t=null);const a=ro.makeNotice(r);return this.sendMessage(e,t,a,i,s)}sendEmoteMessage(e,t,r,i,s){var o;!((o=t)!==null&&o!==void 0&&o.startsWith(dn))&&t!==null&&(s=i,i=r,r=t,t=null);const a=ro.makeEmoteMessage(r);return this.sendMessage(e,t,a,i,s)}sendImageMessage(e,t,r,i,s="Image",o){var a;!((a=t)!==null&&a!==void 0&&a.startsWith(dn))&&t!==null&&(o=s,s=i||"Image",i=r,r=t,t=null),$.isFunction(s)&&(o=s,s=void 0);const l={msgtype:le.MsgType.Image,url:r,info:i,body:s};return this.sendMessage(e,t,l,void 0,o)}sendStickerMessage(e,t,r,i,s="Sticker",o){var a;!((a=t)!==null&&a!==void 0&&a.startsWith(dn))&&t!==null&&(o=s,s=i||"Sticker",i=r,r=t,t=null),$.isFunction(s)&&(o=s,s=void 0);const l={url:r,info:i,body:s};return this.sendEvent(e,t,le.EventType.Sticker,l,void 0,o)}sendHtmlMessage(e,t,r,i,s){var o;!((o=t)!==null&&o!==void 0&&o.startsWith(dn))&&t!==null&&(s=i,i=r,r=t,t=null);const a=ro.makeHtmlMessage(r,i);return this.sendMessage(e,t,a,void 0,s)}sendHtmlNotice(e,t,r,i,s){var o;!((o=t)!==null&&o!==void 0&&o.startsWith(dn))&&t!==null&&(s=i,i=r,r=t,t=null);const a=ro.makeHtmlNotice(r,i);return this.sendMessage(e,t,a,void 0,s)}sendHtmlEmote(e,t,r,i,s){var o;!((o=t)!==null&&o!==void 0&&o.startsWith(dn))&&t!==null&&(s=i,i=r,r=t,t=null);const a=ro.makeHtmlEmote(r,i);return this.sendMessage(e,t,a,void 0,s)}sendReceipt(e,t,r,i){if(typeof r=="function"&&(i=r,r={}),this.isGuest())return Promise.resolve({});const s=$.encodeUri("/rooms/$roomId/receipt/$receiptType/$eventId",{$roomId:e.getRoomId(),$receiptType:t,$eventId:e.getId()}),o=this.http.authedRequest(i,M.Method.Post,s,void 0,r||{}),a=this.getRoom(e.getRoomId());return a&&a.addLocalEchoReceipt(this.credentials.userId,e,t),o}async sendReadReceipt(e,t,r){typeof t=="function"&&(r=t,t={}),t||(t={});const i=e.getId(),s=this.getRoom(e.getRoomId());if(s&&s.hasPendingEvent(i))throw new Error(`Cannot set read receipt to a pending event (${i})`);const o={"org.matrix.msc2285.hidden":Boolean(t.hidden)};return this.sendReceipt(e,"m.read",o,r)}async setRoomReadMarkers(e,t,r,i){const s=this.getRoom(e);if(s&&s.hasPendingEvent(t))throw new Error(`Cannot set read marker to a pending event (${t})`);let o;if(r){if(o=r.getId(),s&&s.hasPendingEvent(o))throw new Error(`Cannot set read receipt to a pending event (${o})`);s&&s.addLocalEchoReceipt(this.credentials.userId,r,"m.read")}return this.setRoomReadMarkersHttpRequest(e,t,o,i)}getUrlPreview(e,t,r){t=Math.floor(t/6e4)*6e4;const i=new URL(e);i.hash="",e=i.toString();const s=t+"_"+e,o=this.urlPreviewCache[s];if(o)return r&&o.then(r).catch(r),o;const a=this.http.authedRequest(r,M.Method.Get,"/preview_url",{url:e,ts:t.toString()},void 0,{prefix:M.PREFIX_MEDIA_R0});return this.urlPreviewCache[s]=a,a}sendTyping(e,t,r,i){if(this.isGuest())return Promise.resolve({});const s=$.encodeUri("/rooms/$roomId/typing/$userId",{$roomId:e,$userId:this.credentials.userId}),o={typing:t};return t&&(o.timeout=r||2e4),this.http.authedRequest(i,M.Method.Put,s,void 0,o)}getRoomUpgradeHistory(e,t=!1){let r=this.getRoom(e);if(!r)return[];const i=[r];let s=r.currentState.getStateEvents(le.EventType.RoomCreate,"");for(;s;){const a=s.getContent().predecessor;if(a&&a.room_id){const l=this.getRoom(a.room_id);if(!l)break;if(t){const u=l.currentState.getStateEvents(le.EventType.RoomTombstone,"");if(!u||u.getContent().replacement_room!==l.roomId)break}i.splice(0,0,l),s=l.currentState.getStateEvents(le.EventType.RoomCreate,"")}else break}let o=r.currentState.getStateEvents(le.EventType.RoomTombstone,"");for(;o;){const a=this.getRoom(o.getContent().replacement_room);if(!a||a.roomId===r.roomId||t&&(s=a.currentState.getStateEvents(le.EventType.RoomCreate,""),!s||!s.getContent().predecessor||s.getContent().predecessor.room_id!==r.roomId))break;if(i.push(a),new Set(i.map(u=>u.roomId)).size<i.length)return i.slice(0,i.length-1);r=a,o=r.currentState.getStateEvents(le.EventType.RoomTombstone,"")}return i}invite(e,t,r,i){return this.membershipChange(e,t,"invite",i,r)}inviteByEmail(e,t,r){return this.inviteByThreePid(e,"email",t,r)}async inviteByThreePid(e,t,r,i){const s=$.encodeUri("/rooms/$roomId/invite",{$roomId:e}),o=this.getIdentityServerUrl(!0);if(!o)return Promise.reject(new M.MatrixError({error:"No supplied identity server URL",errcode:"ORG.MATRIX.JSSDK_MISSING_PARAM"}));const a={id_server:o,medium:t,address:r};if(this.identityServer&&this.identityServer.getAccessToken&&await this.doesServerAcceptIdentityAccessToken()){const l=await this.identityServer.getAccessToken();l&&(a.id_access_token=l)}return this.http.authedRequest(i,M.Method.Post,s,void 0,a)}leave(e,t){return this.membershipChange(e,void 0,"leave",void 0,t)}leaveRoomChain(e,t=!0){const r=this.getRoomUpgradeHistory(e);let i=r;if(!t){i=[];for(const l of r)if(i.push(l),l.roomId===e)break}const s={},o=[],a=l=>this.leave(l).then(()=>{s[l]=null}).catch(u=>(s[l]=u,null));for(const l of i)o.push(a(l.roomId));return Promise.all(o).then(()=>s)}ban(e,t,r,i){return this.membershipChange(e,t,"ban",r,i)}forget(e,t,r){t===void 0&&(t=!0);const i=this.membershipChange(e,void 0,"forget",void 0,r);return t?i.then(s=>(this.store.removeRoom(e),this.emit(us.DeleteRoom,e),s)):i}unban(e,t,r){const i=$.encodeUri("/rooms/$roomId/unban",{$roomId:e}),s={user_id:t};return this.http.authedRequest(r,M.Method.Post,i,void 0,s)}kick(e,t,r,i){const s=$.encodeUri("/rooms/$roomId/kick",{$roomId:e}),o={user_id:t,reason:r};return this.http.authedRequest(i,M.Method.Post,s,void 0,o)}membershipChange(e,t,r,i,s){$.isFunction(i)&&(s=i,i=void 0);const o=$.encodeUri("/rooms/$room_id/$membership",{$room_id:e,$membership:r});return this.http.authedRequest(s,M.Method.Post,o,void 0,{user_id:t,reason:i})}getPushActionsForEvent(e,t=!1){return(!e.getPushActions()||t)&&e.setPushActions(this.pushProcessor.actionsForEvent(e)),e.getPushActions()}setProfileInfo(e,t,r){const i=$.encodeUri("/profile/$userId/$info",{$userId:this.credentials.userId,$info:e});return this.http.authedRequest(r,M.Method.Put,i,void 0,t)}async setDisplayName(e,t){const r=await this.setProfileInfo("displayname",{displayname:e},t),i=this.getUser(this.getUserId());return i&&(i.displayName=e,i.emit(Dd.UserEvent.DisplayName,i.events.presence,i)),r}async setAvatarUrl(e,t){const r=await this.setProfileInfo("avatar_url",{avatar_url:e},t),i=this.getUser(this.getUserId());return i&&(i.avatarUrl=e,i.emit(Dd.UserEvent.AvatarUrl,i.events.presence,i)),r}mxcUrlToHttp(e,t,r,i,s){return(0,uA.getHttpUriForMxc)(this.baseUrl,e,t,r,i,s)}_unstable_setStatusMessage(e){const t="im.vector.user_status";return Promise.all(this.getRooms().map(async r=>{const i=r.getMyMembership()==="join",s=r.getInvitedAndJoinedMemberCount()===2;!i||!s||!r.currentState.mayClientSendStateEvent(t,this)||await this.sendStateEvent(r.roomId,t,{status:e},this.getUserId())})).then()}setPresence(e,t){const r=$.encodeUri("/presence/$userId/status",{$userId:this.credentials.userId});if(typeof e=="string"&&(e={presence:e}),["offline","online","unavailable"].indexOf(e.presence)===-1)throw new Error("Bad presence value: "+e.presence);return this.http.authedRequest(t,M.Method.Put,r,void 0,e)}getPresence(e,t){const r=$.encodeUri("/presence/$userId/status",{$userId:e});return this.http.authedRequest(t,M.Method.Get,r,void 0,void 0)}scrollback(e,t=30,r){$.isFunction(t)&&(r=t,t=void 0);let i=0,s=this.ongoingScrollbacks[e.roomId]||{};if(s.promise)return s.promise;if(s.errorTs){const l=Date.now()-s.errorTs;i=Math.max(SA-l,0)}if(e.oldState.paginationToken===null)return Promise.resolve(e);const o=this.store.scrollback(e,t).length;if(o===t)return Promise.resolve(e);t=t-o;const a=new Promise((l,u)=>{(0,$.sleep)(i).then(()=>this.createMessagesRequest(e.roomId,e.oldState.paginationToken,t,ma.Direction.Backward)).then(async c=>{var g;const m=c.chunk.map(this.getEventMapper());if(c.state){const I=c.state.map(this.getEventMapper());e.currentState.setUnknownStateEvents(I)}const[f,_]=this.partitionThreadedEvents(m);e.addEventsToTimeline(f,!0,e.getLiveTimeline()),await this.processThreadEvents(e,_,!0),e.oldState.paginationToken=c.end,c.chunk.length===0&&(e.oldState.paginationToken=null),this.store.storeEvents(e,m,c.end,!0),this.ongoingScrollbacks[e.roomId]=null,(g=r)===null||g===void 0||g(null,e),l(e)}).catch(c=>{var g;this.ongoingScrollbacks[e.roomId]={errorTs:Date.now()},(g=r)===null||g===void 0||g(c),u(c)})});return s={promise:a,errorTs:null},this.ongoingScrollbacks[e.roomId]=s,a}getEventMapper(e){return(0,gA.eventMapperFor)(this,e||{})}getEventTimeline(e,t){if(!this.timelineSupport)throw new Error("timeline support is disabled. Set the 'timelineSupport' parameter to true when creating MatrixClient to enable it.");if(e.getTimelineForEvent(t))return Promise.resolve(e.getTimelineForEvent(t));const r=$.encodeUri("/rooms/$roomId/context/$eventId",{$roomId:e.room.roomId,$eventId:t});let i;return this.clientOpts.lazyLoadMembers&&(i={filter:JSON.stringify(Wc.Filter.LAZY_LOADING_MESSAGES_FILTER)}),this.http.authedRequest(void 0,M.Method.Get,r,i).then(async o=>{if(!o.event)throw new Error("'event' not in '/context' result - homeserver too old?");if(e.getTimelineForEvent(t))return e.getTimelineForEvent(t);o.events_after.reverse();const l=o.events_after.concat([o.event]).concat(o.events_before).map(this.getEventMapper());let u=e.getTimelineForEvent(l[0].getId());if(!u)u=e.addTimeline(),u.initialiseState(o.state.map(this.getEventMapper())),u.getState(ma.EventTimeline.FORWARDS).paginationToken=o.end;else{const m=o.state.map(this.getEventMapper());u.getState(ma.EventTimeline.BACKWARDS).setUnknownStateEvents(m)}const[c,g]=this.partitionThreadedEvents(l);return e.addEventsToTimeline(c,!0,u,o.start),await this.processThreadEvents(e.room,g,!0),e.getTimelineForEvent(t)||u})}createMessagesRequest(e,t,r=30,i,s){const o=$.encodeUri("/rooms/$roomId/messages",{$roomId:e}),a={limit:r.toString(),dir:i};t&&(a.from=t);let l=null;if(this.clientOpts.lazyLoadMembers&&(l=Object.assign({},Wc.Filter.LAZY_LOADING_MESSAGES_FILTER)),s){var u;l=l||{},Object.assign(l,(u=s.getRoomTimelineFilterComponent())===null||u===void 0?void 0:u.toJSON())}return l&&(a.filter=JSON.stringify(l)),this.http.authedRequest(void 0,M.Method.Get,o,a)}paginateEventTimeline(e,t){const r=e.getTimelineSet()===this.notifTimelineSet;t=t||{};const i=t.backwards||!1;if(r&&!i)throw new Error("paginateNotifTimeline can only paginate backwards");const s=i?ma.EventTimeline.BACKWARDS:ma.EventTimeline.FORWARDS,o=e.getPaginationToken(s),a=e.paginationRequests[s];if(a)return a;let l,u,c;if(r){var g;l="/notifications",u={limit:((g=t.limit)!==null&&g!==void 0?g:30).toString(),only:"highlight"},o!=="end"&&(u.from=o),c=this.http.authedRequest(void 0,M.Method.Get,l,u,void 0).then(async m=>{const f=m.next_token,_=[];for(let C=0;C<m.notifications.length;C++){const S=m.notifications[C],k=this.getEventMapper()(S.event);k.setPushActions(Cd.PushProcessor.actionListToActionsObject(S.actions)),k.event.room_id=S.room_id,_[C]=k}const[I,R]=this.partitionThreadedEvents(_),T=e.getTimelineSet();return T.addEventsToTimeline(I,i,e,f),await this.processThreadEvents(T.room,R,i),i&&!m.next_token&&e.setPaginationToken(null,s),!!m.next_token}).finally(()=>{e.paginationRequests[s]=null}),e.paginationRequests[s]=c}else{const m=this.getRoom(e.getRoomId());if(!m)throw new Error("Unknown room "+e.getRoomId());c=this.createMessagesRequest(e.getRoomId(),o,t.limit,s,e.getFilter()).then(async f=>{if(f.state){const C=e.getState(s),S=f.state.map(this.getEventMapper());C.setUnknownStateEvents(S)}const _=f.end,I=f.chunk.map(this.getEventMapper()),[R,T]=this.partitionThreadedEvents(I);return e.getTimelineSet().addEventsToTimeline(R,i,e,_),await this.processThreadEvents(m,T,i),i&&f.end==f.start&&e.setPaginationToken(null,s),f.end!=f.start}).finally(()=>{e.paginationRequests[s]=null}),e.paginationRequests[s]=c}return c}resetNotifTimelineSet(){!this.notifTimelineSet||this.notifTimelineSet.resetLiveTimeline("end",null)}peekInRoom(e){return this.peekSync&&this.peekSync.stopPeeking(),this.peekSync=new eo.SyncApi(this,this.clientOpts),this.peekSync.peek(e)}stopPeeking(){this.peekSync&&(this.peekSync.stopPeeking(),this.peekSync=null)}setGuestAccess(e,t){const r=this.sendStateEvent(e,le.EventType.RoomGuestAccess,{guest_access:t.allowJoin?"can_join":"forbidden"},"");let i=Promise.resolve(void 0);return t.allowRead&&(i=this.sendStateEvent(e,le.EventType.RoomHistoryVisibility,{history_visibility:"world_readable"},"")),Promise.all([i,r]).then()}requestRegisterEmailToken(e,t,r,i){return this.requestTokenFromEndpoint("/register/email/requestToken",{email:e,client_secret:t,send_attempt:r,next_link:i})}requestRegisterMsisdnToken(e,t,r,i,s){return this.requestTokenFromEndpoint("/register/msisdn/requestToken",{country:e,phone_number:t,client_secret:r,send_attempt:i,next_link:s})}requestAdd3pidEmailToken(e,t,r,i){return this.requestTokenFromEndpoint("/account/3pid/email/requestToken",{email:e,client_secret:t,send_attempt:r,next_link:i})}requestAdd3pidMsisdnToken(e,t,r,i,s){return this.requestTokenFromEndpoint("/account/3pid/msisdn/requestToken",{country:e,phone_number:t,client_secret:r,send_attempt:i,next_link:s})}requestPasswordEmailToken(e,t,r,i){return this.requestTokenFromEndpoint("/account/password/email/requestToken",{email:e,client_secret:t,send_attempt:r,next_link:i})}requestPasswordMsisdnToken(e,t,r,i,s){return this.requestTokenFromEndpoint("/account/password/msisdn/requestToken",{country:e,phone_number:t,client_secret:r,send_attempt:i,next_link:s})}async requestTokenFromEndpoint(e,t){const r=Object.assign({},t);if(!await this.doesServerSupportSeparateAddAndBind()&&this.idBaseUrl){const i=new URL(this.idBaseUrl);if(r.id_server=i.host,this.identityServer&&this.identityServer.getAccessToken&&await this.doesServerAcceptIdentityAccessToken()){const s=await this.identityServer.getAccessToken();s&&(r.id_access_token=s)}}return this.http.request(void 0,M.Method.Post,e,void 0,r)}getRoomPushRule(e,t){if(this.pushRules)for(let r=0;r<this.pushRules[e].room.length;r++){const i=this.pushRules[e].room[r];if(i.rule_id===t)return i}else throw new Error("SyncApi.sync() must be done before accessing to push rules.")}setRoomMutePushRule(e,t,r){let i,s;const o=this.getRoomPushRule(e,t);if(o&&0<=o.actions.indexOf("dont_notify")&&(s=!0),!r)s&&(i=this.deletePushRule(e,Hc.PushRuleKind.RoomSpecific,o.rule_id));else if(!o)i=this.addPushRule(e,Hc.PushRuleKind.RoomSpecific,t,{actions:["dont_notify"]});else if(!s){const a=$.defer();this.deletePushRule(e,Hc.PushRuleKind.RoomSpecific,o.rule_id).then(()=>{this.addPushRule(e,Hc.PushRuleKind.RoomSpecific,t,{actions:["dont_notify"]}).then(()=>{a.resolve()}).catch(l=>{a.reject(l)})}).catch(l=>{a.reject(l)}),i=a.promise}if(i)return new Promise((a,l)=>{i.then(()=>{this.getPushRules().then(u=>{this.pushRules=u,a()}).catch(u=>{l(u)})}).catch(u=>{this.getPushRules().then(c=>{this.pushRules=c,l(u)}).catch(c=>{l(u)})})})}searchMessageText(e,t){const r={search_term:e.query};return"keys"in e&&(r.keys=e.keys),this.search({body:{search_categories:{room_events:r}}},t)}searchRoomEvents(e){const t={search_categories:{room_events:{search_term:e.term,filter:e.filter,order_by:yA.SearchOrderBy.Recent,event_context:{before_limit:1,after_limit:1,include_profile:!0}}}},r={_query:t,results:[],highlights:[]};return this.search({body:t}).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;const t={body:e._query,next_batch:e.next_batch},r=this.search(t).then(i=>this.processRoomEventsSearch(e,i)).finally(()=>{e.pendingRequest=null});return e.pendingRequest=r,r}processRoomEventsSearch(e,t){const r=t.search_categories.room_events;e.count=r.count,e.next_batch=r.next_batch;const i=new Set(r.highlights);e.highlights.forEach(o=>{i.add(o)}),e.highlights=Array.from(i);const s=r.results?r.results.length:0;for(let o=0;o<s;o++){const a=dA.SearchResult.fromJson(r.results[o],this.getEventMapper()),l=this.getRoom(a.context.getEvent().getRoomId());if(l)for(const u of a.context.getTimeline()){const c=l.getMember(u.getSender());!u.sender&&c&&(u.sender=c)}e.results.push(a)}return e}syncLeftRooms(){if(this.syncedLeftRooms)return Promise.resolve([]);if(this.syncLeftRoomsPromise)return this.syncLeftRoomsPromise;const e=new eo.SyncApi(this,this.clientOpts);return this.syncLeftRoomsPromise=e.syncLeftRooms(),this.syncLeftRoomsPromise.then(t=>{se.logger.log("Marking success of sync left room request"),this.syncedLeftRooms=!0}).finally(()=>{this.syncLeftRoomsPromise=null}),this.syncLeftRoomsPromise}createFilter(e){const t=$.encodeUri("/user/$userId/filter",{$userId:this.credentials.userId});return this.http.authedRequest(void 0,M.Method.Post,t,void 0,e).then(r=>{const i=Wc.Filter.fromJson(this.credentials.userId,r.filter_id,e);return this.store.storeFilter(i),i})}getFilter(e,t,r){if(r){const s=this.store.getFilter(e,t);if(s)return Promise.resolve(s)}const i=$.encodeUri("/user/$userId/filter/$filterId",{$userId:e,$filterId:t});return this.http.authedRequest(void 0,M.Method.Get,i,void 0,void 0).then(s=>{const o=Wc.Filter.fromJson(e,t,s);return this.store.storeFilter(o),o})}async getOrCreateFilter(e,t){const r=this.store.getFilterIdByName(e);let i;if(r){try{const o=await this.getFilter(this.credentials.userId,r,!0);if(o){const a=o.getDefinition(),l=t.getDefinition();$.deepCompare(a,l)&&(i=r)}}catch(o){if(o.errcode!=="M_UNKNOWN"&&o.errcode!=="M_NOT_FOUND")throw o}i||this.store.setFilterIdByName(e,void 0)}if(i)return i;const s=await this.createFilter(t.getDefinition());return this.store.setFilterIdByName(e,s.filterId),s.filterId}getOpenIdToken(){const e=$.encodeUri("/user/$userId/openid/request_token",{$userId:this.credentials.userId});return this.http.authedRequest(void 0,M.Method.Post,e,void 0,{})}turnServer(e){return this.http.authedRequest(e,M.Method.Get,"/voip/turnServer")}getTurnServers(){return this.turnServers||[]}getTurnServersExpiry(){return this.turnServersExpiry}async checkTurnServers(){if(!this.canSupportVoip)return;let e=!1;const t=this.turnServersExpiry-Date.now();if(t>Km)se.logger.debug("TURN creds are valid for another "+t+" ms: not fetching new ones."),e=!0;else{se.logger.debug("Fetching new TURN credentials");try{const r=await this.turnServer();if(r.uris){se.logger.log("Got TURN URIs: "+r.uris+" refresh in "+r.ttl+" secs");const i={urls:r.uris,username:r.username,credential:r.password};this.turnServers=[i],this.turnServersExpiry=Date.now()+r.ttl*1e3,e=!0}}catch(r){se.logger.error("Failed to get TURN URIs",r),r.httpStatus===403&&(se.logger.info("TURN access unavailable for this account: stopping credentials checks"),this.checkTurnServersIntervalID!==null&&V.clearInterval(this.checkTurnServersIntervalID),this.checkTurnServersIntervalID=null)}}return e}setFallbackICEServerAllowed(e){this.fallbackICEServerAllowed=e}isFallbackICEServerAllowed(){return this.fallbackICEServerAllowed}isSynapseAdministrator(){const e=$.encodeUri("/_synapse/admin/v1/users/$userId/admin",{$userId:this.getUserId()});return this.http.authedRequest(void 0,M.Method.Get,e,void 0,void 0,{prefix:""}).then(t=>t.admin)}whoisSynapseUser(e){const t=$.encodeUri("/_synapse/admin/v1/whois/$userId",{$userId:e});return this.http.authedRequest(void 0,M.Method.Get,t,void 0,void 0,{prefix:""})}deactivateSynapseUser(e){const t=$.encodeUri("/_synapse/admin/v1/deactivate/$userId",{$userId:e});return this.http.authedRequest(void 0,M.Method.Post,t,void 0,void 0,{prefix:""})}async fetchClientWellKnown(){this.clientWellKnownPromise=aA.AutoDiscovery.getRawClientConfig(this.getDomain()),this.clientWellKnown=await this.clientWellKnownPromise,this.emit(us.ClientWellKnown,this.clientWellKnown)}getClientWellKnown(){return this.clientWellKnown}waitForClientWellKnown(){return this.clientWellKnownPromise}storeClientOptions(){const e=["boolean","string","number"],t=Object.entries(this.clientOpts).filter(([r,i])=>e.includes(typeof i)).reduce((r,[i,s])=>(r[i]=s,r),{});return this.store.storeClientOptions(t)}async _unstable_getSharedRooms(e){if(!await this.doesServerSupportUnstableFeature("uk.half-shot.msc2666"))throw Error("Server does not support shared_rooms API");const t=$.encodeUri("/uk.half-shot.msc2666/user/shared_rooms/$userId",{$userId:e});return(await this.http.authedRequest(void 0,M.Method.Get,t,void 0,void 0,{prefix:M.PREFIX_UNSTABLE})).joined}getVersions(){return this.serverVersionsPromise?this.serverVersionsPromise:(this.serverVersionsPromise=this.http.request(void 0,M.Method.Get,"/_matrix/client/versions",void 0,void 0,{prefix:""}).catch(e=>{throw this.serverVersionsPromise=null,e}),this.serverVersionsPromise)}async isVersionSupported(e){const{versions:t}=await this.getVersions();return t&&t.includes(e)}async doesServerSupportLazyLoading(){const e=await this.getVersions();if(!e)return!1;const t=e.versions,r=e.unstable_features;return t&&t.includes("r0.5.0")||r&&r["m.lazy_load_members"]}async doesServerRequireIdServerParam(){const e=await this.getVersions();if(!e)return!0;const t=e.versions;if(t&&t.includes("r0.6.0"))return!1;const r=e.unstable_features;return!r||r["m.require_identity_server"]===void 0?!0:r["m.require_identity_server"]}async doesServerAcceptIdentityAccessToken(){const e=await this.getVersions();if(!e)return!1;const t=e.versions,r=e.unstable_features;return t&&t.includes("r0.6.0")||r&&r["m.id_access_token"]}async doesServerSupportSeparateAddAndBind(){const e=await this.getVersions();if(!e)return!1;const t=e.versions,r=e.unstable_features;return t&&t.includes("r0.6.0")||r&&r["m.separate_add_and_bind"]}async doesServerSupportUnstableFeature(e){const t=await this.getVersions();if(!t)return!1;const r=t.unstable_features;return r&&!!r[e]}async doesServerForceEncryptionForPreset(e){const t=await this.getVersions();if(!t)return!1;const r=t.unstable_features,i=e.includes("_chat")?e.substring(0,e.indexOf("_chat")):e;return r&&!!r[`io.element.e2ee_forced.${i}`]}async doesServerSupportThread(){try{const e=await this.doesServerSupportUnstableFeature("org.matrix.msc3440"),t=await this.doesServerSupportUnstableFeature("org.matrix.msc3440.stable")||await this.isVersionSupported("v1.3");return{serverSupport:e||t,stable:t}}catch{return null}}hasLazyLoadMembersEnabled(){return!!this.clientOpts.lazyLoadMembers}setCanResetTimelineCallback(e){this.canResetTimelineCallback=e}getCanResetTimelineCallback(){return this.canResetTimelineCallback}async relations(e,t,r,i,s={}){const o=this.getEncryptedIfNeededEventType(e,i),a=await this.fetchRelations(e,t,r,o,s),l=this.getEventMapper();let u;a.original_event&&(u=l(a.original_event));let c=a.chunk.map(l);if(o===le.EventType.RoomMessageEncrypted){const g=u?c.concat(u):c;await Promise.all(g.map(m=>this.decryptEventIfNeeded(m))),i!==null&&(c=c.filter(m=>m.getType()===i))}return u&&r===le.RelationType.Replace&&(c=c.filter(g=>g.getSender()===u.getSender())),{originalEvent:u,events:c,nextBatch:a.next_batch,prevBatch:a.prev_batch}}getCrossSigningCacheCallbacks(){var e;return(e=this.crypto)===null||e===void 0?void 0:e.crossSigningInfo.getCacheCallbacks()}generateClientSecret(){return(0,mA.randomString)(32)}decryptEventIfNeeded(e,t){return e.shouldAttemptDecryption()&&e.attemptDecryption(this.crypto,t),e.isBeingDecrypted()?e.getDecryptionPromise():Promise.resolve()}termsUrlForService(e,t){switch(e){case $m.SERVICE_TYPES.IS:return t+M.PREFIX_IDENTITY_V2+"/terms";case $m.SERVICE_TYPES.IM:return t+"/_matrix/integrations/v1/terms";default:throw new Error("Unsupported service type")}}getHomeserverUrl(){return this.baseUrl}getIdentityServerUrl(e=!1){return e&&(this.idBaseUrl.startsWith("http://")||this.idBaseUrl.startsWith("https://"))?this.idBaseUrl.split("://")[1]:this.idBaseUrl}setIdentityServerUrl(e){this.idBaseUrl=$.ensureNoTrailingSlash(e),this.http.setIdBaseUrl(this.idBaseUrl)}getAccessToken(){return this.http.opts.accessToken||null}setAccessToken(e){this.http.opts.accessToken=e}isLoggedIn(){return this.http.opts.accessToken!==void 0}makeTxnId(){return"m"+new Date().getTime()+"."+this.txnCtr++}isUsernameAvailable(e){return this.http.authedRequest(void 0,M.Method.Get,"/register/available",{username:e}).then(t=>t.available).catch(t=>t.errcode==="M_USER_IN_USE"?!1:Promise.reject(t))}register(e,t,r,i,s,o,a,l){s===!0?s={email:!0}:(s==null||s===!1)&&(s={}),typeof a=="function"&&(l=a,a=void 0),r&&(i.session=r);const u={auth:i,refresh_token:!0};return e!=null&&(u.username=e),t!=null&&(u.password=t),s.email&&(u.bind_email=!0),s.msisdn&&(u.bind_msisdn=!0),o!=null&&(u.guest_access_token=o),a!=null&&(u.inhibit_login=a),t!=null&&(u.x_show_msisdn=!0),this.registerRequest(u,void 0,l)}registerGuest(e,t){return e=e||{},e.body=e.body||{},this.registerRequest(e.body,"guest",t)}registerRequest(e,t,r){const i={};return t&&(i.kind=t),this.http.request(r,M.Method.Post,"/register",i,e)}refreshToken(e){return this.http.authedRequest(void 0,M.Method.Post,"/refresh",void 0,{refresh_token:e},{prefix:M.PREFIX_V1,inhibitLogoutEmit:!0})}loginFlows(e){return this.http.request(e,M.Method.Get,"/login")}login(e,t,r){const i={type:e};return Object.assign(i,t),this.http.authedRequest((s,o)=>{o&&o.access_token&&o.user_id&&(this.http.opts.accessToken=o.access_token,this.credentials={userId:o.user_id}),r&&r(s,o)},M.Method.Post,"/login",void 0,i)}loginWithPassword(e,t,r){return this.login("m.login.password",{user:e,password:t},r)}loginWithSAML2(e,t){return this.login("m.login.saml2",{relay_state:e},t)}getCasLoginUrl(e){return this.getSsoLoginUrl(e,"cas")}getSsoLoginUrl(e,t="sso",r){let i="/login/"+t+"/redirect";return r&&(i+="/"+r),this.http.getUrl(i,{redirectUrl:e},M.PREFIX_R0)}loginWithToken(e,t){return this.login("m.login.token",{token:e},t)}async logout(e){var t,r;if((t=this.crypto)!==null&&t!==void 0&&(r=t.backupManager)!==null&&r!==void 0&&r.getKeyBackupEnabled())try{for(;await this.crypto.backupManager.backupPendingKeys(200)>0;);}catch(i){se.logger.error("Key backup request failed when logging out. Some keys may be missing from backup",i)}return this.http.authedRequest(e,M.Method.Post,"/logout")}deactivateAccount(e,t){if(typeof t=="function")throw new Error("deactivateAccount no longer accepts a callback parameter");const r={};return e&&(r.auth=e),t!==void 0&&(r.erase=t),this.http.authedRequest(void 0,M.Method.Post,"/account/deactivate",void 0,r)}getFallbackAuthUrl(e,t){const r=$.encodeUri("/auth/$loginType/fallback/web",{$loginType:e});return this.http.getUrl(r,{session:t},M.PREFIX_R0)}async createRoom(e,t){const r=(e.invite_3pid||[]).filter(i=>!i.id_access_token);if(r.length>0&&this.identityServer&&this.identityServer.getAccessToken&&await this.doesServerAcceptIdentityAccessToken()){const i=await this.identityServer.getAccessToken();if(i)for(const s of r)s.id_access_token=i}return this.http.authedRequest(t,M.Method.Post,"/createRoom",void 0,e)}async fetchRelations(e,t,r,i,s={}){const o=$.encodeParams(s);let a="/rooms/$roomId/relations/$eventId";r!==null?(a+="/$relationType",i!==null&&(a+="/$eventType")):i!==null&&(se.logger.warn(`eventType: ${i} ignored when fetching
+ relations as relationType is null`),i=null);const l=$.encodeUri(a+"?"+o,{$roomId:e,$eventId:t,$relationType:r,$eventType:i});return await this.http.authedRequest(void 0,M.Method.Get,l,null,null,{prefix:M.PREFIX_UNSTABLE})}roomState(e,t){const r=$.encodeUri("/rooms/$roomId/state",{$roomId:e});return this.http.authedRequest(t,M.Method.Get,r)}fetchRoomEvent(e,t,r){const i=$.encodeUri("/rooms/$roomId/event/$eventId",{$roomId:e,$eventId:t});return this.http.authedRequest(r,M.Method.Get,i)}members(e,t,r,i,s){const o={};t&&(o.membership=t),r&&(o.not_membership=r),i&&(o.at=i);const a=$.encodeParams(o),l=$.encodeUri("/rooms/$roomId/members?"+a,{$roomId:e});return this.http.authedRequest(s,M.Method.Get,l)}upgradeRoom(e,t){const r=$.encodeUri("/rooms/$roomId/upgrade",{$roomId:e});return this.http.authedRequest(void 0,M.Method.Post,r,void 0,{new_version:t})}getStateEvent(e,t,r,i){const s={$roomId:e,$eventType:t,$stateKey:r};let o=$.encodeUri("/rooms/$roomId/state/$eventType",s);return r!==void 0&&(o=$.encodeUri(o+"/$stateKey",s)),this.http.authedRequest(i,M.Method.Get,o)}sendStateEvent(e,t,r,i="",s){const o={$roomId:e,$eventType:t,$stateKey:i};let a=$.encodeUri("/rooms/$roomId/state/$eventType",o);return i!==void 0&&(a=$.encodeUri(a+"/$stateKey",o)),this.http.authedRequest(s,M.Method.Put,a,void 0,r)}roomInitialSync(e,t,r){var i,s;$.isFunction(t)&&(r=t,t=void 0);const o=$.encodeUri("/rooms/$roomId/initialSync",{$roomId:e});return this.http.authedRequest(r,M.Method.Get,o,{limit:(i=(s=t)===null||s===void 0?void 0:s.toString())!==null&&i!==void 0?i:"30"})}setRoomReadMarkersHttpRequest(e,t,r,i){const s=$.encodeUri("/rooms/$roomId/read_markers",{$roomId:e}),o={"m.fully_read":t,"m.read":r,"org.matrix.msc2285.hidden":Boolean(i?i.hidden:!1)};return this.http.authedRequest(void 0,M.Method.Post,s,void 0,o)}getJoinedRooms(){const e=$.encodeUri("/joined_rooms",{});return this.http.authedRequest(void 0,M.Method.Get,e)}getJoinedRoomMembers(e){const t=$.encodeUri("/rooms/$roomId/joined_members",{$roomId:e});return this.http.authedRequest(void 0,M.Method.Get,t)}publicRooms(e,t){typeof e=="function"&&(t=e,e={}),e===void 0&&(e={});const r={};return e.server&&(r.server=e.server,delete e.server),Object.keys(e).length===0&&Object.keys(r).length===0?this.http.authedRequest(t,M.Method.Get,"/publicRooms"):this.http.authedRequest(t,M.Method.Post,"/publicRooms",r,e)}createAlias(e,t,r){const i=$.encodeUri("/directory/room/$alias",{$alias:e}),s={room_id:t};return this.http.authedRequest(r,M.Method.Put,i,void 0,s)}deleteAlias(e,t){const r=$.encodeUri("/directory/room/$alias",{$alias:e});return this.http.authedRequest(t,M.Method.Delete,r,void 0,void 0)}unstableGetLocalAliases(e,t){const r=$.encodeUri("/rooms/$roomId/aliases",{$roomId:e}),i=M.PREFIX_UNSTABLE+"/org.matrix.msc2432";return this.http.authedRequest(t,M.Method.Get,r,null,null,{prefix:i})}getRoomIdForAlias(e,t){const r=$.encodeUri("/directory/room/$alias",{$alias:e});return this.http.authedRequest(t,M.Method.Get,r)}resolveRoomAlias(e,t){const r=$.encodeUri("/directory/room/$alias",{$alias:e});return this.http.request(t,M.Method.Get,r)}getRoomDirectoryVisibility(e,t){const r=$.encodeUri("/directory/list/room/$roomId",{$roomId:e});return this.http.authedRequest(t,M.Method.Get,r)}setRoomDirectoryVisibility(e,t,r){const i=$.encodeUri("/directory/list/room/$roomId",{$roomId:e});return this.http.authedRequest(r,M.Method.Put,i,void 0,{visibility:t})}setRoomDirectoryVisibilityAppService(e,t,r,i){const s=$.encodeUri("/directory/list/appservice/$networkId/$roomId",{$networkId:e,$roomId:t});return this.http.authedRequest(i,M.Method.Put,s,void 0,{visibility:r})}searchUserDirectory(e){const t={search_term:e.term};return e.limit!==void 0&&(t.limit=e.limit),this.http.authedRequest(void 0,M.Method.Post,"/user_directory/search",void 0,t)}uploadContent(e,t){return this.http.uploadContent(e,t)}cancelUpload(e){return this.http.cancelUpload(e)}getCurrentUploads(){return this.http.getCurrentUploads()}getProfileInfo(e,t,r){$.isFunction(t)&&(r=t,t=void 0);const i=t?$.encodeUri("/profile/$userId/$info",{$userId:e,$info:t}):$.encodeUri("/profile/$userId",{$userId:e});return this.http.authedRequest(r,M.Method.Get,i)}getThreePids(e){const t="/account/3pid";return this.http.authedRequest(e,M.Method.Get,t,void 0,void 0)}addThreePid(e,t,r){const i="/account/3pid",s={threePidCreds:e,bind:t};return this.http.authedRequest(r,M.Method.Post,i,null,s)}async addThreePidOnly(e){const t="/account/3pid/add",r=await this.isVersionSupported("r0.6.0")?M.PREFIX_R0:M.PREFIX_UNSTABLE;return this.http.authedRequest(void 0,M.Method.Post,t,null,e,{prefix:r})}async bindThreePid(e){const t="/account/3pid/bind",r=await this.isVersionSupported("r0.6.0")?M.PREFIX_R0:M.PREFIX_UNSTABLE;return this.http.authedRequest(void 0,M.Method.Post,t,null,e,{prefix:r})}async unbindThreePid(e,t){const r="/account/3pid/unbind",i={medium:e,address:t,id_server:this.getIdentityServerUrl(!0)},s=await this.isVersionSupported("r0.6.0")?M.PREFIX_R0:M.PREFIX_UNSTABLE;return this.http.authedRequest(void 0,M.Method.Post,r,null,i,{prefix:s})}deleteThreePid(e,t){const r="/account/3pid/delete";return this.http.authedRequest(void 0,M.Method.Post,r,null,{medium:e,address:t})}setPassword(e,t,r){const i="/account/password",s={auth:e,new_password:t};return this.http.authedRequest(r,M.Method.Post,i,null,s)}getDevices(){return this.http.authedRequest(void 0,M.Method.Get,"/devices",void 0,void 0)}getDevice(e){const t=$.encodeUri("/devices/$device_id",{$device_id:e});return this.http.authedRequest(void 0,M.Method.Get,t,void 0,void 0)}setDeviceDetails(e,t){const r=$.encodeUri("/devices/$device_id",{$device_id:e});return this.http.authedRequest(void 0,M.Method.Put,r,void 0,t)}deleteDevice(e,t){const r=$.encodeUri("/devices/$device_id",{$device_id:e}),i={};return t&&(i.auth=t),this.http.authedRequest(void 0,M.Method.Delete,r,void 0,i)}deleteMultipleDevices(e,t){const r={devices:e};t&&(r.auth=t);const i="/delete_devices";return this.http.authedRequest(void 0,M.Method.Post,i,void 0,r)}getPushers(e){const t="/pushers";return this.http.authedRequest(e,M.Method.Get,t,void 0,void 0)}setPusher(e,t){const r="/pushers/set";return this.http.authedRequest(t,M.Method.Post,r,null,e)}getPushRules(e){return this.http.authedRequest(e,M.Method.Get,"/pushrules/").then(t=>Cd.PushProcessor.rewriteDefaultRules(t))}addPushRule(e,t,r,i,s){const o=$.encodeUri("/pushrules/"+e+"/$kind/$ruleId",{$kind:t,$ruleId:r});return this.http.authedRequest(s,M.Method.Put,o,void 0,i)}deletePushRule(e,t,r,i){const s=$.encodeUri("/pushrules/"+e+"/$kind/$ruleId",{$kind:t,$ruleId:r});return this.http.authedRequest(i,M.Method.Delete,s)}setPushRuleEnabled(e,t,r,i,s){const o=$.encodeUri("/pushrules/"+e+"/$kind/$ruleId/enabled",{$kind:t,$ruleId:r});return this.http.authedRequest(s,M.Method.Put,o,void 0,{enabled:i})}setPushRuleActions(e,t,r,i,s){const o=$.encodeUri("/pushrules/"+e+"/$kind/$ruleId/actions",{$kind:t,$ruleId:r});return this.http.authedRequest(s,M.Method.Put,o,void 0,{actions:i})}search(e,t){const r={};return e.next_batch&&(r.next_batch=e.next_batch),this.http.authedRequest(t,M.Method.Post,"/search",r,e.body)}uploadKeysRequest(e,t,r){return this.http.authedRequest(r,M.Method.Post,"/keys/upload",void 0,e)}uploadKeySignatures(e){return this.http.authedRequest(void 0,M.Method.Post,"/keys/signatures/upload",void 0,e,{prefix:M.PREFIX_UNSTABLE})}downloadKeysForUsers(e,t){if($.isFunction(t))throw new Error("downloadKeysForUsers no longer accepts a callback parameter");t=t||{};const r={device_keys:{}};return"token"in t&&(r.token=t.token),e.forEach(i=>{r.device_keys[i]=[]}),this.http.authedRequest(void 0,M.Method.Post,"/keys/query",void 0,r)}claimOneTimeKeys(e,t="signed_curve25519",r){const i={};t===void 0&&(t="signed_curve25519");for(let a=0;a<e.length;++a){const l=e[a][0],u=e[a][1],c=i[l]||{};i[l]=c,c[u]=t}const s={one_time_keys:i};r&&(s.timeout=r);const o="/keys/claim";return this.http.authedRequest(void 0,M.Method.Post,o,void 0,s)}getKeyChanges(e,t){const r={from:e,to:t},i="/keys/changes";return this.http.authedRequest(void 0,M.Method.Get,i,r,void 0)}uploadDeviceSigningKeys(e,t){const r=Object.assign({},t);return e&&Object.assign(r,{auth:e}),this.http.authedRequest(void 0,M.Method.Post,"/keys/device_signing/upload",void 0,r,{prefix:M.PREFIX_UNSTABLE})}registerWithIdentityServer(e){if(!this.idBaseUrl)throw new Error("No identity server base URL set");const t=this.idBaseUrl+M.PREFIX_IDENTITY_V2+"/account/register";return this.http.requestOtherUrl(void 0,M.Method.Post,t,null,e)}async requestEmailToken(e,t,r,i,s,o){const a={client_secret:t,email:e,send_attempt:r==null?void 0:r.toString(),next_link:i};return await this.http.idServerRequest(s,M.Method.Post,"/validate/email/requestToken",a,M.PREFIX_IDENTITY_V2,o)}async requestMsisdnToken(e,t,r,i,s,o,a){const l={client_secret:r,country:e,phone_number:t,send_attempt:i==null?void 0:i.toString(),next_link:s};return await this.http.idServerRequest(o,M.Method.Post,"/validate/msisdn/requestToken",l,M.PREFIX_IDENTITY_V2,a)}async submitMsisdnToken(e,t,r,i){const s={sid:e,client_secret:t,token:r};return await this.http.idServerRequest(void 0,M.Method.Post,"/validate/msisdn/submitToken",s,M.PREFIX_IDENTITY_V2,i)}submitMsisdnTokenOtherUrl(e,t,r,i){const s={sid:t,client_secret:r,token:i};return this.http.requestOtherUrl(void 0,M.Method.Post,e,void 0,s)}getIdentityHashDetails(e){return this.http.idServerRequest(void 0,M.Method.Get,"/hash_details",null,M.PREFIX_IDENTITY_V2,e)}async identityHashedLookup(e,t){const r={},i=await this.getIdentityHashDetails(t);if(!i||!i.lookup_pepper||!i.algorithms)throw new Error("Unsupported identity server: bad response");r.pepper=i.lookup_pepper;const s={};if(i.algorithms.includes("sha256")){const l=new V.Olm.Utility;r.addresses=e.map(u=>{const c=u[0].toLowerCase(),g=u[1].toLowerCase(),m=l.sha256(`${c} ${g} ${r.pepper}`).replace(/\+/g,"-").replace(/\//g,"_");return s[m]=u[0],m}),r.algorithm="sha256"}else if(i.algorithms.includes("none"))r.addresses=e.map(l=>{const u=l[0].toLowerCase(),c=l[1].toLowerCase(),g=`${u} ${c}`;return s[g]=l[0],g}),r.algorithm="none";else throw new Error("Unsupported identity server: unknown hash algorithm");const o=await this.http.idServerRequest(void 0,M.Method.Post,"/lookup",r,M.PREFIX_IDENTITY_V2,t);if(!o||!o.mappings)return[];const a=[];for(const l of Object.keys(o.mappings)){const u=o.mappings[l],c=s[l];if(!c)throw new Error("Identity server returned more results than expected");a.push({address:c,mxid:u})}return a}async lookupThreePid(e,t,r,i){const o=(await this.identityHashedLookup([[t,e]],i)).find(l=>l.address===t);if(!o)return r&&r(null,{}),{};const a={address:t,medium:e,mxid:o.mxid};return r&&r(null,a),a}async bulkLookupThreePids(e,t){const r=await this.identityHashedLookup(e.map(s=>[s[1],s[0]]),t),i=[];for(const s of r){const o=e.find(a=>a[1]===s.address);if(!o)throw new Error("Identity sever returned unexpected results");i.push([o[0],s.address,s.mxid])}return{threepids:i}}getIdentityAccount(e){return this.http.idServerRequest(void 0,M.Method.Get,"/account",void 0,M.PREFIX_IDENTITY_V2,e)}sendToDevice(e,t,r){const i=$.encodeUri("/sendToDevice/$eventType/$txnId",{$eventType:e,$txnId:r||this.makeTxnId()}),s={messages:t},o=Object.keys(t).reduce((a,l)=>(a[l]=Object.keys(t[l]),a),{});return se.logger.log(`PUT ${i}`,o),this.http.authedRequest(void 0,M.Method.Put,i,void 0,s)}getThirdpartyProtocols(){return this.http.authedRequest(void 0,M.Method.Get,"/thirdparty/protocols",void 0,void 0).then(e=>{if(!e||typeof e!="object")throw new Error(`/thirdparty/protocols did not return an object: ${e}`);return e})}getThirdpartyLocation(e,t){const r=$.encodeUri("/thirdparty/location/$protocol",{$protocol:e});return this.http.authedRequest(void 0,M.Method.Get,r,t,void 0)}getThirdpartyUser(e,t){const r=$.encodeUri("/thirdparty/user/$protocol",{$protocol:e});return this.http.authedRequest(void 0,M.Method.Get,r,t,void 0)}getTerms(e,t){const r=this.termsUrlForService(e,t);return this.http.requestOtherUrl(void 0,M.Method.Get,r)}agreeToTerms(e,t,r,i){const s=this.termsUrlForService(e,t),o={Authorization:"Bearer "+r};return this.http.requestOtherUrl(void 0,M.Method.Post,s,null,{user_accepts:i},{headers:o})}reportEvent(e,t,r,i){const s=$.encodeUri("/rooms/$roomId/report/$eventId",{$roomId:e,$eventId:t});return this.http.authedRequest(void 0,M.Method.Post,s,null,{score:r,reason:i})}getRoomHierarchy(e,t,r,i=!1,s){const o=$.encodeUri("/rooms/$roomId/hierarchy",{$roomId:e}),a={suggested_only:String(i),max_depth:r==null?void 0:r.toString(),from:s,limit:t==null?void 0:t.toString()};return this.http.authedRequest(void 0,M.Method.Get,o,a,void 0,{prefix:M.PREFIX_V1}).catch(l=>{if(l.errcode==="M_UNRECOGNIZED")return this.http.authedRequest(void 0,M.Method.Get,o,a,void 0,{prefix:"/_matrix/client/unstable/org.matrix.msc2946"});throw l})}async unstableCreateFileTree(e){const{room_id:t}=await this.createRoom({name:e,preset:pA.Preset.PrivateChat,power_level_content_override:zc(zc({},Ad.DEFAULT_TREE_POWER_LEVELS_TEMPLATE),{},{users:{[this.getUserId()]:100}}),creation_content:{[le.RoomCreateTypeField]:le.RoomType.Space},initial_state:[{type:le.UNSTABLE_MSC3088_PURPOSE.name,state_key:le.UNSTABLE_MSC3089_TREE_SUBTYPE.name,content:{[le.UNSTABLE_MSC3088_ENABLED.name]:!0}},{type:le.EventType.RoomEncryption,state_key:"",content:{algorithm:Pd.MEGOLM_ALGORITHM}}]});return new Ad.MSC3089TreeSpace(this,t)}unstableGetFileTreeSpace(e){var t,r;const i=this.getRoom(e);if((i==null?void 0:i.getMyMembership())!=="join")return null;const s=i.currentState.getStateEvents(le.EventType.RoomCreate,""),o=i.currentState.getStateEvents(le.UNSTABLE_MSC3088_PURPOSE.name,le.UNSTABLE_MSC3089_TREE_SUBTYPE.name);if(!s)throw new Error("Expected single room create event");return!(o!=null&&(t=o.getContent())!==null&&t!==void 0&&t[le.UNSTABLE_MSC3088_ENABLED.name])||((r=s.getContent())===null||r===void 0?void 0:r[le.RoomCreateTypeField])!==le.RoomType.Space?null:new Ad.MSC3089TreeSpace(this,e)}getGroupSummary(e){const t=$.encodeUri("/groups/$groupId/summary",{$groupId:e});return this.http.authedRequest(void 0,M.Method.Get,t)}getGroupProfile(e){const t=$.encodeUri("/groups/$groupId/profile",{$groupId:e});return this.http.authedRequest(void 0,M.Method.Get,t)}setGroupProfile(e,t){const r=$.encodeUri("/groups/$groupId/profile",{$groupId:e});return this.http.authedRequest(void 0,M.Method.Post,r,void 0,t)}setGroupJoinPolicy(e,t){const r=$.encodeUri("/groups/$groupId/settings/m.join_policy",{$groupId:e});return this.http.authedRequest(void 0,M.Method.Put,r,void 0,{"m.join_policy":t})}getGroupUsers(e){const t=$.encodeUri("/groups/$groupId/users",{$groupId:e});return this.http.authedRequest(void 0,M.Method.Get,t)}getGroupInvitedUsers(e){const t=$.encodeUri("/groups/$groupId/invited_users",{$groupId:e});return this.http.authedRequest(void 0,M.Method.Get,t)}getGroupRooms(e){const t=$.encodeUri("/groups/$groupId/rooms",{$groupId:e});return this.http.authedRequest(void 0,M.Method.Get,t)}inviteUserToGroup(e,t){const r=$.encodeUri("/groups/$groupId/admin/users/invite/$userId",{$groupId:e,$userId:t});return this.http.authedRequest(void 0,M.Method.Put,r,void 0,{})}removeUserFromGroup(e,t){const r=$.encodeUri("/groups/$groupId/admin/users/remove/$userId",{$groupId:e,$userId:t});return this.http.authedRequest(void 0,M.Method.Put,r,void 0,{})}addUserToGroupSummary(e,t,r){const i=$.encodeUri(r?"/groups/$groupId/summary/$roleId/users/$userId":"/groups/$groupId/summary/users/$userId",{$groupId:e,$roleId:r,$userId:t});return this.http.authedRequest(void 0,M.Method.Put,i,void 0,{})}removeUserFromGroupSummary(e,t){const r=$.encodeUri("/groups/$groupId/summary/users/$userId",{$groupId:e,$userId:t});return this.http.authedRequest(void 0,M.Method.Delete,r,void 0,{})}addRoomToGroupSummary(e,t,r){const i=$.encodeUri(r?"/groups/$groupId/summary/$categoryId/rooms/$roomId":"/groups/$groupId/summary/rooms/$roomId",{$groupId:e,$categoryId:r,$roomId:t});return this.http.authedRequest(void 0,M.Method.Put,i,void 0,{})}removeRoomFromGroupSummary(e,t){const r=$.encodeUri("/groups/$groupId/summary/rooms/$roomId",{$groupId:e,$roomId:t});return this.http.authedRequest(void 0,M.Method.Delete,r,void 0,{})}addRoomToGroup(e,t,r){r===void 0&&(r=!0);const i=$.encodeUri("/groups/$groupId/admin/rooms/$roomId",{$groupId:e,$roomId:t});return this.http.authedRequest(void 0,M.Method.Put,i,void 0,{"m.visibility":{type:r?"public":"private"}})}updateGroupRoomVisibility(e,t,r){const i=$.encodeUri("/groups/$groupId/admin/rooms/$roomId/config/m.visibility",{$groupId:e,$roomId:t});return this.http.authedRequest(void 0,M.Method.Put,i,void 0,{type:r?"public":"private"})}removeRoomFromGroup(e,t){const r=$.encodeUri("/groups/$groupId/admin/rooms/$roomId",{$groupId:e,$roomId:t});return this.http.authedRequest(void 0,M.Method.Delete,r,void 0,{})}acceptGroupInvite(e,t=null){const r=$.encodeUri("/groups/$groupId/self/accept_invite",{$groupId:e});return this.http.authedRequest(void 0,M.Method.Put,r,void 0,t||{})}joinGroup(e){const t=$.encodeUri("/groups/$groupId/self/join",{$groupId:e});return this.http.authedRequest(void 0,M.Method.Put,t,void 0,{})}leaveGroup(e){const t=$.encodeUri("/groups/$groupId/self/leave",{$groupId:e});return this.http.authedRequest(void 0,M.Method.Put,t,void 0,{})}getJoinedGroups(){const e=$.encodeUri("/joined_groups",{});return this.http.authedRequest(void 0,M.Method.Get,e)}createGroup(e){const t=$.encodeUri("/create_group",{});return this.http.authedRequest(void 0,M.Method.Post,t,void 0,e)}getPublicisedGroups(e){const t=$.encodeUri("/publicised_groups",{});return this.http.authedRequest(void 0,M.Method.Post,t,void 0,{user_ids:e})}setGroupPublicity(e,t){const r=$.encodeUri("/groups/$groupId/self/update_publicity",{$groupId:e});return this.http.authedRequest(void 0,M.Method.Put,r,void 0,{publicise:t})}supportsExperimentalThreads(){var e;return((e=this.clientOpts)===null||e===void 0?void 0:e.experimentalThreadSupport)||!1}async getRoomSummary(e,t){const r=$.encodeUri("/rooms/$roomid/summary",{$roomid:e});return this.http.authedRequest(void 0,M.Method.Get,r,{via:t},null,{qsStringifyOptions:{arrayFormat:"repeat"},prefix:"/_matrix/client/unstable/im.nheko.summary"})}findThreadRoots(e){const t=new Set;for(const r of e)r.isThreadRelation&&t.add(r.relationEventId);return t}eventShouldLiveIn(e,t,r,i){if(e.isThreadRoot)return{shouldLiveInRoom:!0,shouldLiveInThread:!0,threadId:e.getId()};if(e.isThreadRelation)return{shouldLiveInRoom:!1,shouldLiveInThread:!0,threadId:e.relationEventId};const s=e.getAssociatedId(),o=(t==null?void 0:t.findEventById(s))||r.find(l=>l.getId()===s);return(o==null?void 0:o.isThreadRoot)||i.has(e.relationEventId)?{shouldLiveInRoom:!0,shouldLiveInThread:!0,threadId:e.relationEventId}:o!=null&&o.getAssociatedId()?this.eventShouldLiveIn(o,t,r,i):{shouldLiveInRoom:!0,shouldLiveInThread:!1}}partitionThreadedEvents(e){if(this.supportsExperimentalThreads()){const i=this.findThreadRoots(e);return e.reduce((s,o)=>{const a=this.getRoom(o.getRoomId()),{shouldLiveInRoom:l,shouldLiveInThread:u,threadId:c}=this.eventShouldLiveIn(o,a,e,i);return l&&s[0].push(o),u&&(o.setThreadId(c),s[1].push(o)),s},[[],[]])}else return[e,[]]}async processThreadEvents(e,t,r){for(const i of t)await e.addThreadedEvent(i,r)}async whoami(){return this.http.authedRequest(void 0,M.Method.Get,"/account/whoami")}async timestampToEvent(e,t,r){const i=$.encodeUri("/rooms/$roomId/timestamp_to_event",{$roomId:e});return await this.http.authedRequest(void 0,M.Method.Get,i,{ts:t.toString(),dir:r},void 0,{prefix:"/_matrix/client/unstable/org.matrix.msc3030"})}}ot.MatrixClient=Eu;(0,X.default)(Eu,"RESTORE_BACKUP_ERROR_BAD_KEY","RESTORE_BACKUP_ERROR_BAD_KEY");var Mo={},RA=G.exports;Object.defineProperty(Mo,"__esModule",{value:!0});Mo.TimelineWindow=Mo.TimelineIndex=void 0;var Ra=RA(Y.exports),jn=Wt;const qm=function(){},IA=5;class TA{constructor(e,t,r={}){this.client=e,this.timelineSet=t,(0,Ra.default)(this,"windowLimit",void 0),(0,Ra.default)(this,"start",null),(0,Ra.default)(this,"end",null),(0,Ra.default)(this,"eventCount",0),this.windowLimit=r.windowLimit||1e3}load(e,t=20){const r=i=>{let s;const o=i.getEvents();if(!e)s=o.length;else{for(let u=0;u<o.length;u++)if(o[u].getId()==e){s=u;break}if(s===void 0)throw new Error("getEventTimeline result didn't include requested event")}const a=Math.min(o.length,s+Math.ceil(t/2)),l=Math.max(0,a-t);this.start=new nf(i,l-i.getBaseIndex()),this.end=new nf(i,a-i.getBaseIndex()),this.eventCount=a-l};if(e){const i=this.timelineSet.getTimelineForEvent(e);return i?(r(i),Promise.resolve(i)):this.client.getEventTimeline(this.timelineSet,e).then(r)}else{const i=this.timelineSet.getLiveTimeline();return r(i),Promise.resolve()}}getTimelineIndex(e){if(e==jn.EventTimeline.BACKWARDS)return this.start;if(e==jn.EventTimeline.FORWARDS)return this.end;throw new Error("Invalid direction '"+e+"'")}extend(e,t){const r=this.getTimelineIndex(e);if(!r)return!1;const i=e==jn.EventTimeline.BACKWARDS?r.retreat(t):r.advance(t);if(i){this.eventCount+=i,qm("TimelineWindow: increased cap by "+i+" (now "+this.eventCount+")");const s=this.eventCount-this.windowLimit;return s>0&&this.unpaginate(s,e!=jn.EventTimeline.BACKWARDS),!0}return!1}canPaginate(e){const t=this.getTimelineIndex(e);if(!t)return!1;if(e==jn.EventTimeline.BACKWARDS){if(t.index>t.minIndex())return!0}else if(t.index<t.maxIndex())return!0;return Boolean(t.timeline.getNeighbouringTimeline(e)||t.timeline.getPaginationToken(e)!==null)}paginate(e,t,r=!0,i=IA){const s=this.getTimelineIndex(e);if(!s)return Promise.resolve(!1);if(s.pendingPaginate)return s.pendingPaginate;if(this.extend(e,t))return Promise.resolve(!0);if(!r||i===0||s.timeline.getPaginationToken(e)===null)return Promise.resolve(!1);const a=this.client.paginateEventTimeline(s.timeline,{backwards:e==jn.EventTimeline.BACKWARDS,limit:t}).finally(function(){s.pendingPaginate=null}).then(l=>l?this.paginate(e,t,!0,i-1):!1);return s.pendingPaginate=a,a}unpaginate(e,t){const r=t?this.start:this.end;if(e>this.eventCount||e<0)throw new Error("Attemting to unpaginate "+e+" events, but only have "+this.eventCount+" in the timeline");for(;e>0;){const i=t?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,qm("TimelineWindow.unpaginate: dropped "+i+" (now "+this.eventCount+")")}}getEvents(){if(!this.start)return[];const e=[];let t=this.start.timeline;for(;;){const r=t.getEvents();let i=0,s=r.length;t===this.start.timeline&&(i=this.start.index+t.getBaseIndex()),t===this.end.timeline&&(s=this.end.index+t.getBaseIndex());for(let o=i;o<s;o++)e.push(r[o]);if(t===this.end.timeline)break;t=t.getNeighbouringTimeline(jn.EventTimeline.FORWARDS)}return e}}Mo.TimelineWindow=TA;class nf{constructor(e,t){this.timeline=e,this.index=t,(0,Ra.default)(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;let t;if(e<0){if(t=Math.max(e,this.minIndex()-this.index),t<0)return this.index+=t,t}else if(t=Math.min(e,this.maxIndex()-this.index),t>0)return this.index+=t,t;const r=this.timeline.getNeighbouringTimeline(e<0?jn.EventTimeline.BACKWARDS:jn.EventTimeline.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}}Mo.TimelineIndex=nf;var ks={},OA=G.exports;Object.defineProperty(ks,"__esModule",{value:!0});ks.InteractiveAuth=ks.AuthType=void 0;var qt=OA(Y.exports),xd=ie,kA=W;const ya="m.login.email.identity",jm="m.login.msisdn";let Xa;ks.AuthType=Xa;(function(n){n.Password="m.login.password",n.Recaptcha="m.login.recaptcha",n.Terms="m.login.terms",n.Email="m.login.email.identity",n.Msisdn="m.login.msisdn",n.Sso="m.login.sso",n.SsoUnstable="org.matrix.login.sso",n.Dummy="m.login.dummy",n.RegistrationToken="org.matrix.msc3231.login.registration_token"})(Xa||(ks.AuthType=Xa={}));class CA extends Error{constructor(e,t,r){super(e),this.required_stages=t,this.flows=r,(0,qt.default)(this,"name","NoAuthFlowFoundError")}}class PA{constructor(e){var t;(0,qt.default)(this,"matrixClient",void 0),(0,qt.default)(this,"inputs",void 0),(0,qt.default)(this,"clientSecret",void 0),(0,qt.default)(this,"requestCallback",void 0),(0,qt.default)(this,"busyChangedCallback",void 0),(0,qt.default)(this,"stateUpdatedCallback",void 0),(0,qt.default)(this,"requestEmailTokenCallback",void 0),(0,qt.default)(this,"data",void 0),(0,qt.default)(this,"emailSid",void 0),(0,qt.default)(this,"requestingEmailToken",!1),(0,qt.default)(this,"attemptAuthDeferred",null),(0,qt.default)(this,"chosenFlow",null),(0,qt.default)(this,"currentStage",null),(0,qt.default)(this,"submitPromise",null),this.matrixClient=e.matrixClient,this.data=e.authData||{},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=(t=e.emailSid)!==null&&t!==void 0?t:null}attemptAuth(){var e;this.attemptAuthDeferred=(0,kA.defer)();const t=this.attemptAuthDeferred.promise;if((e=this.data)!==null&&e!==void 0&&e.flows)this.startNextAuthStage();else{var r;(r=this.busyChangedCallback)===null||r===void 0||r.call(this,!0);let i=null;this.data.session&&(i={session:this.data.session}),this.doRequest(i).finally(()=>{var s;(s=this.busyChangedCallback)===null||s===void 0||s.call(this,!1)})}return t}async poll(){if(!this.data.session||!this.attemptAuthDeferred||this.submitPromise)return;let e={};if(this.currentStage==ya&&this.emailSid){const t={sid:this.emailSid,client_secret:this.clientSecret};if(await this.matrixClient.doesServerRequireIdServerParam()){const r=new URL(this.matrixClient.getIdentityServerUrl());t.id_server=r.host}e={type:ya,threepid_creds:t,threepidCreds:t}}this.submitAuthDict(e,!0)}getSessionId(){return this.data?this.data.session:void 0}getClientSecret(){return this.clientSecret}getStageParams(e){var t;return(t=this.data.params)===null||t===void 0?void 0:t[e]}getChosenFlow(){return this.chosenFlow}async submitAuthDict(e,t=!1){if(!this.attemptAuthDeferred)throw new Error("submitAuthDict() called before attemptAuth()");if(!t){var r;(r=this.busyChangedCallback)===null||r===void 0||r.call(this,!0)}for(;this.submitPromise;)try{await this.submitPromise}catch{}let i;this.data.session?(i={session:this.data.session},Object.assign(i,e)):i=e;try{this.submitPromise=this.doRequest(i,t),await this.submitPromise}finally{if(this.submitPromise=null,!t){var s;(s=this.busyChangedCallback)===null||s===void 0||s.call(this,!1)}}}getEmailSid(){return this.emailSid}setEmailSid(e){this.emailSid=e}async doRequest(e,t=!1){try{const o=await this.requestCallback(e,t);this.attemptAuthDeferred.resolve(o),this.attemptAuthDeferred=null}catch(o){var r,i;const a=(r=(i=o.data)===null||i===void 0?void 0:i.flows)!==null&&r!==void 0?r:null,l=this.data.flows||Boolean(a);if(o.httpStatus!==401||!o.data||!l)if(t)xd.logger.log("Background poll request failed doing UI auth: ignoring",o);else{var s;(s=this.attemptAuthDeferred)===null||s===void 0||s.reject(o)}!o.data.flows&&!o.data.completed&&!o.data.session&&(o.data.flows=this.data.flows,o.data.completed=this.data.completed,o.data.session=this.data.session),this.data=o.data;try{this.startNextAuthStage()}catch(u){this.attemptAuthDeferred.reject(u),this.attemptAuthDeferred=null;return}if(!this.emailSid&&!this.requestingEmailToken&&this.chosenFlow.stages.includes(Xa.Email)){this.requestingEmailToken=!0;try{const u=await this.requestEmailTokenCallback(this.inputs.emailAddress,this.clientSecret,1,this.data.session);this.emailSid=u.sid}catch(u){this.attemptAuthDeferred.reject(u),this.attemptAuthDeferred=null}finally{this.requestingEmailToken=!1}}}}startNextAuthStage(){const e=this.chooseStage();if(!e)throw new Error("No incomplete flows from the server");if(this.currentStage=e,e===Xa.Dummy){this.submitAuthDict({type:"m.login.dummy"});return}if(this.data&&this.data.errcode||this.data.error){this.stateUpdatedCallback(e,{errcode:this.data.errcode||"",error:this.data.error||""});return}const t={};e==ya&&(t.emailSid=this.emailSid),this.stateUpdatedCallback(e,t)}chooseStage(){this.chosenFlow===null&&(this.chosenFlow=this.chooseFlow()),xd.logger.log("Active flow => %s",JSON.stringify(this.chosenFlow));const e=this.firstUncompletedStage(this.chosenFlow);return xd.logger.log("Next stage: %s",e),e}chooseFlow(){const e=this.data.flows||[],t=Boolean(this.inputs.emailAddress)||Boolean(this.emailSid),r=Boolean(this.inputs.phoneCountry)&&Boolean(this.inputs.phoneNumber);for(const s of e){let o=!1,a=!1;for(const l of s.stages)l===ya?o=!0:l==jm&&(a=!0);if(o==t&&a==r)return s}const i=[];throw t&&i.push(ya),r&&i.push(jm),new CA("No appropriate authentication flow found",i,e)}firstUncompletedStage(e){const t=this.data.completed||[];for(let r=0;r<e.stages.length;++r){const i=e.stages[r];if(t.indexOf(i)===-1)return i}}}ks.InteractiveAuth=PA;var Su={},bu={},MA=G.exports;Object.defineProperty(bu,"__esModule",{value:!0});bu.LocalIndexedDBStoreBackend=void 0;var va=MA(Y.exports),DA=ni,Zi=lE(W),AA=lE(du),Ze=ie;function cE(n){if(typeof WeakMap!="function")return null;var e=new WeakMap,t=new WeakMap;return(cE=function(r){return r?t:e})(n)}function lE(n,e){if(!e&&n&&n.__esModule)return n;if(n===null||typeof n!="object"&&typeof n!="function")return{default:n};var t=cE(e);if(t&&t.has(n))return t.get(n);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in n)if(s!=="default"&&Object.prototype.hasOwnProperty.call(n,s)){var o=i?Object.getOwnPropertyDescriptor(n,s):null;o&&(o.get||o.set)?Object.defineProperty(r,s,o):r[s]=n[s]}return r.default=n,t&&t.set(n,r),r}const xA=3;function UA(n){n.createObjectStore("users",{keyPath:["userId"]}),n.createObjectStore("accountData",{keyPath:["type"]}),n.createObjectStore("sync",{keyPath:["clobber"]})}function $A(n){n.createObjectStore("oob_membership_events",{keyPath:["room_id","state_key"]}).createIndex("room","room_id")}function NA(n){n.createObjectStore("client_options",{keyPath:["clobber"]})}function Jc(n,e,t){const r=n.openCursor(e);return new Promise((i,s)=>{const o=[];r.onerror=()=>{s(new Error("Query failed: "+r.error))},r.onsuccess=()=>{const a=r.result;if(!a){i(o);return}o.push(t(a)),a.continue()}})}function _a(n){return new Promise((e,t)=>{n.oncomplete=function(r){e(r)},n.onerror=function(){t(n.error)}})}function uE(n){return new Promise((e,t)=>{n.onsuccess=function(r){e(r)},n.onerror=function(){t(n.error)}})}function LA(n){return new Promise((e,t)=>{n.onsuccess=()=>e(n),n.onerror=r=>t(r)})}function Vm(n){return uE(n).then(e=>n.result)}class BA{static exists(e,t){return t="matrix-js-sdk:"+(t||"default"),AA.exists(e,t)}constructor(e,t){this.indexedDB=e,(0,va.default)(this,"dbName",void 0),(0,va.default)(this,"syncAccumulator",void 0),(0,va.default)(this,"db",null),(0,va.default)(this,"disconnected",!0),(0,va.default)(this,"_isNewlyCreated",!1),this.dbName="matrix-js-sdk:"+(t||"default"),this.syncAccumulator=new DA.SyncAccumulator}connect(){if(!this.disconnected)return Ze.logger.log("LocalIndexedDBStoreBackend.connect: already connected or connecting"),Promise.resolve();this.disconnected=!1,Ze.logger.log("LocalIndexedDBStoreBackend.connect: connecting...");const e=this.indexedDB.open(this.dbName,xA);return e.onupgradeneeded=t=>{const r=e.result,i=t.oldVersion;Ze.logger.log(`LocalIndexedDBStoreBackend.connect: upgrading from ${i}`),i<1&&(this._isNewlyCreated=!0,UA(r)),i<2&&$A(r),i<3&&NA(r)},e.onblocked=()=>{Ze.logger.log("can't yet open LocalIndexedDBStoreBackend because it is open elsewhere")},Ze.logger.log("LocalIndexedDBStoreBackend.connect: awaiting connection..."),uE(e).then(()=>(Ze.logger.log("LocalIndexedDBStoreBackend.connect: connected"),this.db=e.result,this.db.onversionchange=()=>{this.db.close()},this.init()))}isNewlyCreated(){return Promise.resolve(this._isNewlyCreated)}init(){return Promise.all([this.loadAccountData(),this.loadSyncData()]).then(([e,t])=>{Ze.logger.log("LocalIndexedDBStoreBackend: loaded initial data"),this.syncAccumulator.accumulate({next_batch:t.nextBatch,rooms:t.roomsData,groups:t.groupsData,account_data:{events:e}},!0)})}getOutOfBandMembers(e){return new Promise((t,r)=>{const o=this.db.transaction(["oob_membership_events"],"readonly").objectStore("oob_membership_events").index("room"),a=IDBKeyRange.only(e),l=o.openCursor(a),u=[];let c=!1;l.onsuccess=()=>{const g=l.result;if(!g)return!u.length&&!c?t(null):t(u);const m=g.value;m.oob_written?c=!0:u.push(m),g.continue()},l.onerror=g=>{r(g)}}).then(t=>(Ze.logger.log(`LL: got ${t&&t.length} membershipEvents from storage for room ${e} ...`),t))}async setOutOfBandMembers(e,t){Ze.logger.log(`LL: backend about to store ${t.length} members for ${e}`);const r=this.db.transaction(["oob_membership_events"],"readwrite"),i=r.objectStore("oob_membership_events");t.forEach(o=>{i.put(o)});const s={room_id:e,oob_written:!0,state_key:0};i.put(s),await _a(r),Ze.logger.log(`LL: backend done storing for ${e}!`)}async clearOutOfBandMembers(e){const i=this.db.transaction(["oob_membership_events"],"readonly").objectStore("oob_membership_events").index("room"),s=IDBKeyRange.only(e),o=Vm(i.openKeyCursor(s,"next")).then(f=>f&&f.primaryKey[1]),a=Vm(i.openKeyCursor(s,"prev")).then(f=>f&&f.primaryKey[1]),[l,u]=await Promise.all([o,a]),g=this.db.transaction(["oob_membership_events"],"readwrite").objectStore("oob_membership_events"),m=IDBKeyRange.bound([e,l],[e,u]);Ze.logger.log(`LL: Deleting all users + marker in storage for room ${e}, with key range:`,[e,l],[e,u]),await LA(g.delete(m))}clearDatabase(){return new Promise(e=>{Ze.logger.log(`Removing indexeddb instance: ${this.dbName}`);const t=this.indexedDB.deleteDatabase(this.dbName);t.onblocked=()=>{Ze.logger.log(`can't yet delete indexeddb ${this.dbName} because it is open elsewhere`)},t.onerror=()=>{Ze.logger.warn(`unable to delete js-sdk store indexeddb: ${t.error}`),e()},t.onsuccess=()=>{Ze.logger.log(`Removed indexeddb instance: ${this.dbName}`),e()}})}getSavedSync(e=!0){const t=this.syncAccumulator.getJSON();return t.nextBatch?e?Promise.resolve(Zi.deepCopy(t)):Promise.resolve(t):Promise.resolve(null)}getNextBatchToken(){return Promise.resolve(this.syncAccumulator.getNextBatchToken())}setSyncData(e){return Promise.resolve().then(()=>{this.syncAccumulator.accumulate(e)})}async syncToDatabase(e){const t=this.syncAccumulator.getJSON(!0);await Promise.all([this.persistUserPresenceEvents(e),this.persistAccountData(t.accountData),this.persistSyncData(t.nextBatch,t.roomsData,t.groupsData)])}persistSyncData(e,t,r){return Ze.logger.log("Persisting sync data up to",e),Zi.promiseTry(()=>{const i=this.db.transaction(["sync"],"readwrite");return i.objectStore("sync").put({clobber:"-",nextBatch:e,roomsData:t,groupsData:r}),_a(i).then()})}persistAccountData(e){return Zi.promiseTry(()=>{const t=this.db.transaction(["accountData"],"readwrite"),r=t.objectStore("accountData");for(let i=0;i<e.length;i++)r.put(e[i]);return _a(t).then()})}persistUserPresenceEvents(e){return Zi.promiseTry(()=>{const t=this.db.transaction(["users"],"readwrite"),r=t.objectStore("users");for(const i of e)r.put({userId:i[0],event:i[1]});return _a(t).then()})}getUserPresenceEvents(){return Zi.promiseTry(()=>{const t=this.db.transaction(["users"],"readonly").objectStore("users");return Jc(t,void 0,r=>[r.value.userId,r.value.event])})}loadAccountData(){return Ze.logger.log("LocalIndexedDBStoreBackend: loading account data..."),Zi.promiseTry(()=>{const t=this.db.transaction(["accountData"],"readonly").objectStore("accountData");return Jc(t,void 0,r=>r.value).then(r=>(Ze.logger.log("LocalIndexedDBStoreBackend: loaded account data"),r))})}loadSyncData(){return Ze.logger.log("LocalIndexedDBStoreBackend: loading sync data..."),Zi.promiseTry(()=>{const t=this.db.transaction(["sync"],"readonly").objectStore("sync");return Jc(t,void 0,r=>r.value).then(r=>(Ze.logger.log("LocalIndexedDBStoreBackend: loaded sync data"),r.length>1&&Ze.logger.warn("loadSyncData: More than 1 sync row found."),r.length>0?r[0]:{}))})}getClientOptions(){return Promise.resolve().then(()=>{const t=this.db.transaction(["client_options"],"readonly").objectStore("client_options");return Jc(t,void 0,r=>{if(r.value&&r.value&&r.value.options)return r.value.options}).then(r=>r[0])})}async storeClientOptions(e){const t=this.db.transaction(["client_options"],"readwrite");t.objectStore("client_options").put({clobber:"-",options:e}),await _a(t)}}bu.LocalIndexedDBStoreBackend=BA;var wu={},KA=G.exports;Object.defineProperty(wu,"__esModule",{value:!0});wu.RemoteIndexedDBStoreBackend=void 0;var Ea=KA(Y.exports),Xc=ie,FA=W;class qA{constructor(e,t){this.workerFactory=e,this.dbName=t,(0,Ea.default)(this,"worker",void 0),(0,Ea.default)(this,"nextSeq",0),(0,Ea.default)(this,"inFlight",{}),(0,Ea.default)(this,"startPromise",null),(0,Ea.default)(this,"onWorkerMessage",r=>{const i=r.data;if(i.command=="cmd_success"||i.command=="cmd_fail"){if(i.seq===void 0){Xc.logger.error("Got reply from worker with no seq");return}const s=this.inFlight[i.seq];if(s===void 0){Xc.logger.error("Got reply for unknown seq "+i.seq);return}if(delete this.inFlight[i.seq],i.command=="cmd_success")s.resolve(i.result);else{const o=new Error(i.error.message);o.name=i.error.name,s.reject(o)}}else Xc.logger.warn("Unrecognised message from worker: ",i)})}connect(){return 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,t){return this.doCmd("setOutOfBandMembers",[e,t])}clearOutOfBandMembers(e){return this.doCmd("clearOutOfBandMembers",[e])}getClientOptions(){return this.doCmd("getClientOptions")}storeClientOptions(e){return this.doCmd("storeClientOptions",[e])}getUserPresenceEvents(){return this.doCmd("getUserPresenceEvents")}ensureStarted(){return this.startPromise===null&&(this.worker=this.workerFactory(),this.worker.onmessage=this.onWorkerMessage,this.startPromise=this.doCmd("_setupWorker",[this.dbName]).then(()=>{Xc.logger.log("IndexedDB worker is ready")})),this.startPromise}doCmd(e,t){return Promise.resolve().then(()=>{const r=this.nextSeq++,i=(0,FA.defer)();return this.inFlight[r]=i,this.worker.postMessage({command:e,seq:r,args:t}),i.promise})}}wu.RemoteIndexedDBStoreBackend=qA;var jA=G.exports;Object.defineProperty(Su,"__esModule",{value:!0});Su.IndexedDBStore=void 0;var _t=jA(Y.exports),VA=nc,Gm=bu,GA=wu,WA=tn,HA=Ht,hn=ie,YA=je;const zA=1e3*60*5;class JA extends VA.MemoryStore{static exists(e,t){return Gm.LocalIndexedDBStoreBackend.exists(e,t)}constructor(e){if(super(e),(0,_t.default)(this,"backend",void 0),(0,_t.default)(this,"startedUp",!1),(0,_t.default)(this,"syncTs",0),(0,_t.default)(this,"userModifiedMap",{}),(0,_t.default)(this,"emitter",new YA.TypedEventEmitter),(0,_t.default)(this,"on",this.emitter.on.bind(this.emitter)),(0,_t.default)(this,"getSavedSync",this.degradable(()=>this.backend.getSavedSync(),"getSavedSync")),(0,_t.default)(this,"isNewlyCreated",this.degradable(()=>this.backend.isNewlyCreated(),"isNewlyCreated")),(0,_t.default)(this,"getSavedSyncToken",this.degradable(()=>this.backend.getNextBatchToken(),"getSavedSyncToken")),(0,_t.default)(this,"deleteAllData",this.degradable(()=>(super.deleteAllData(),this.backend.clearDatabase().then(()=>{hn.logger.log("Deleted indexeddb data.")},t=>{throw hn.logger.error(`Failed to delete indexeddb data: ${t}`),t})))),(0,_t.default)(this,"reallySave",this.degradable(()=>{this.syncTs=Date.now();const t=[];for(const r of this.getUsers())this.userModifiedMap[r.userId]!==r.getLastModifiedTime()&&(!r.events.presence||(t.push([r.userId,r.events.presence.event]),this.userModifiedMap[r.userId]=r.getLastModifiedTime()));return this.backend.syncToDatabase(t)})),(0,_t.default)(this,"setSyncData",this.degradable(t=>this.backend.setSyncData(t),"setSyncData")),(0,_t.default)(this,"getOutOfBandMembers",this.degradable(t=>this.backend.getOutOfBandMembers(t),"getOutOfBandMembers")),(0,_t.default)(this,"setOutOfBandMembers",this.degradable((t,r)=>(super.setOutOfBandMembers(t,r),this.backend.setOutOfBandMembers(t,r)),"setOutOfBandMembers")),(0,_t.default)(this,"clearOutOfBandMembers",this.degradable(t=>(super.clearOutOfBandMembers(t),this.backend.clearOutOfBandMembers(t)),"clearOutOfBandMembers")),(0,_t.default)(this,"getClientOptions",this.degradable(()=>this.backend.getClientOptions(),"getClientOptions")),(0,_t.default)(this,"storeClientOptions",this.degradable(t=>(super.storeClientOptions(t),this.backend.storeClientOptions(t)),"storeClientOptions")),!e.indexedDB)throw new Error("Missing required option: indexedDB");e.workerFactory?this.backend=new GA.RemoteIndexedDBStoreBackend(e.workerFactory,e.dbName):this.backend=new Gm.LocalIndexedDBStoreBackend(e.indexedDB,e.dbName)}startup(){return this.startedUp?(hn.logger.log("IndexedDBStore.startup: already started"),Promise.resolve()):(hn.logger.log("IndexedDBStore.startup: connecting to backend"),this.backend.connect().then(()=>(hn.logger.log("IndexedDBStore.startup: loading presence events"),this.backend.getUserPresenceEvents())).then(e=>{hn.logger.log("IndexedDBStore.startup: processing presence events"),e.forEach(([t,r])=>{const i=new WA.User(t);r&&i.setPresenceEvent(new HA.MatrixEvent(r)),this.userModifiedMap[i.userId]=i.getLastModifiedTime(),this.storeUser(i)})}))}wantsSave(){return Date.now()-this.syncTs>zA}save(e=!1){return e||this.wantsSave()?this.reallySave():Promise.resolve()}degradable(e,t){const r=super[t];return async(...i)=>{try{return e.call(this,...i)}catch(s){hn.logger.error("IndexedDBStore failure, degrading to MemoryStore",s),this.emitter.emit("degraded",s);try{hn.logger.log("IndexedDBStore trying to delete degraded data"),await this.backend.clearDatabase(),hn.logger.log("IndexedDBStore delete after degrading succeeded")}catch(o){hn.logger.warn("IndexedDBStore delete after degrading failed",o)}if(r)return r(...i)}}}}Su.IndexedDBStore=JA;var Vf={};Object.defineProperty(Vf,"__esModule",{value:!0});var sx=Vf.WebStorageSessionStore=hE,Qc=XA(W);function dE(n){if(typeof WeakMap!="function")return null;var e=new WeakMap,t=new WeakMap;return(dE=function(r){return r?t:e})(n)}function XA(n,e){if(!e&&n&&n.__esModule)return n;if(n===null||typeof n!="object"&&typeof n!="function")return{default:n};var t=dE(e);if(t&&t.has(n))return t.get(n);var r={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in n)if(s!=="default"&&Object.prototype.hasOwnProperty.call(n,s)){var o=i?Object.getOwnPropertyDescriptor(n,s):null;o&&(o.get||o.set)?Object.defineProperty(r,s,o):r[s]=n[s]}return r.default=n,t&&t.set(n,r),r}const kn="session.e2e.";function hE(n){if(this.store=n,!Qc.isFunction(n.getItem)||!Qc.isFunction(n.setItem)||!Qc.isFunction(n.removeItem)||!Qc.isFunction(n.key)||typeof n.length!="number")throw new Error("Supplied webStore does not meet the WebStorage API interface")}hE.prototype={removeEndToEndAccount:function(){this.store.removeItem(Wm)},getEndToEndAccount:function(){return this.store.getItem(Wm)},getAllEndToEndDevices:function(){const n=Jm(""),e={};for(let t=0;t<this.store.length;++t){const r=this.store.key(t),i=r.substr(n.length);r.startsWith(n)&&(e[i]=no(this.store,r))}return e},getEndToEndDeviceTrackingStatus:function(){return no(this.store,Ym)},getEndToEndDeviceSyncToken:function(){return no(this.store,Hm)},removeEndToEndDeviceData:function(){io(this.store,Jm("")),io(this.store,Ym),io(this.store,Hm)},getEndToEndSessions:function(n){return no(this.store,Zc(n))},getAllEndToEndSessions:function(){const n=Xm(this.store,Zc("")),e={};for(const t of n){const r=t.substr(Zc("").length);e[r]=no(this.store,t)}return e},removeAllEndToEndSessions:function(){io(this.store,Zc(""))},getAllEndToEndInboundGroupSessionKeys:function(){const n=kn+"inboundgroupsessions/",e=[];for(let t=0;t<this.store.length;t++){const r=this.store.key(t);!r.startsWith(n)||e.push({senderKey:r.substr(n.length,43),sessionId:r.substr(n.length+44)})}return e},getEndToEndInboundGroupSession:function(n,e){const t=QA(n,e);return this.store.getItem(t)},removeAllEndToEndInboundGroupSessions:function(){io(this.store,kn+"inboundgroupsessions/")},getAllEndToEndRooms:function(){const n=Xm(this.store,Ud("")),e={};for(const t of n){const r=t.substr(Ud("").length);e[r]=no(this.store,t)}return e},removeAllEndToEndRooms:function(){io(this.store,Ud(""))},setLocalTrustedBackupPubKey:function(n){this.store.setItem(zm,n)},getLocalTrustedBackupPubKey:function(){return this.store.getItem(zm)}};const Wm=kn+"account",Hm=kn+"device_sync_token",Ym=kn+"device_tracking",zm=kn+"trusted_backup_pubkey";function Jm(n){return kn+"devices/"+n}function Zc(n){return kn+"sessions/"+n}function QA(n,e){return kn+"inboundgroupsessions/"+n+"/"+e}function Ud(n){return kn+"rooms/"+n}function no(n,e){try{return JSON.parse(n.getItem(e))}catch(t){ZA(t.stack)}return null}function Xm(n,e){const t=[];for(let r=0;r<n.length;++r){const i=n.key(r);i.startsWith(e)&&t.push(i)}return t}function io(n,e){const t=[];for(let r=0;r<n.length;++r){const i=n.key(r);i.startsWith(e)&&t.push(i)}for(const r of t)n.removeItem(r)}function ZA(...n){}var fE={};Object.defineProperty(fE,"__esModule",{value:!0});(function(n){Object.defineProperty(n,"__esModule",{value:!0});var e={request:!0,getRequest:!0,wrapRequest:!0,setCryptoStoreFactory:!0,createClient:!0,ContentHelpers:!0,createNewMatrixCall:!0};n.ContentHelpers=void 0,n.createClient=mi,Object.defineProperty(n,"createNewMatrixCall",{enumerable:!0,get:function(){return pr.createNewMatrixCall}}),n.getRequest=pi,n.request=xe,n.setCryptoStoreFactory=gi,n.wrapRequest=jr;var t=$o;Object.keys(t).forEach(function(E){E==="default"||E==="__esModule"||Object.prototype.hasOwnProperty.call(e,E)||E in n&&n[E]===t[E]||Object.defineProperty(n,E,{enumerable:!0,get:function(){return t[E]}})});var r=nc;Object.keys(r).forEach(function(E){E==="default"||E==="__esModule"||Object.prototype.hasOwnProperty.call(e,E)||E in n&&n[E]===r[E]||Object.defineProperty(n,E,{enumerable:!0,get:function(){return r[E]}})});var i=Zl;Object.keys(i).forEach(function(E){E==="default"||E==="__esModule"||Object.prototype.hasOwnProperty.call(e,E)||E in n&&n[E]===i[E]||Object.defineProperty(n,E,{enumerable:!0,get:function(){return i[E]}})});var s=ot;Object.keys(s).forEach(function(E){E==="default"||E==="__esModule"||Object.prototype.hasOwnProperty.call(e,E)||E in n&&n[E]===s[E]||Object.defineProperty(n,E,{enumerable:!0,get:function(){return s[E]}})});var o=me;Object.keys(o).forEach(function(E){E==="default"||E==="__esModule"||Object.prototype.hasOwnProperty.call(e,E)||E in n&&n[E]===o[E]||Object.defineProperty(n,E,{enumerable:!0,get:function(){return o[E]}})});var a=Ki;Object.keys(a).forEach(function(E){E==="default"||E==="__esModule"||Object.prototype.hasOwnProperty.call(e,E)||E in n&&n[E]===a[E]||Object.defineProperty(n,E,{enumerable:!0,get:function(){return a[E]}})});var l=ni;Object.keys(l).forEach(function(E){E==="default"||E==="__esModule"||Object.prototype.hasOwnProperty.call(e,E)||E in n&&n[E]===l[E]||Object.defineProperty(n,E,{enumerable:!0,get:function(){return l[E]}})});var u=ci;Object.keys(u).forEach(function(E){E==="default"||E==="__esModule"||Object.prototype.hasOwnProperty.call(e,E)||E in n&&n[E]===u[E]||Object.defineProperty(n,E,{enumerable:!0,get:function(){return u[E]}})});var c=br;Object.keys(c).forEach(function(E){E==="default"||E==="__esModule"||Object.prototype.hasOwnProperty.call(e,E)||E in n&&n[E]===c[E]||Object.defineProperty(n,E,{enumerable:!0,get:function(){return c[E]}})});var g=Ht;Object.keys(g).forEach(function(E){E==="default"||E==="__esModule"||Object.prototype.hasOwnProperty.call(e,E)||E in n&&n[E]===g[E]||Object.defineProperty(n,E,{enumerable:!0,get:function(){return g[E]}})});var m=hr;Object.keys(m).forEach(function(E){E==="default"||E==="__esModule"||Object.prototype.hasOwnProperty.call(e,E)||E in n&&n[E]===m[E]||Object.defineProperty(n,E,{enumerable:!0,get:function(){return m[E]}})});var f=iu;Object.keys(f).forEach(function(E){E==="default"||E==="__esModule"||Object.prototype.hasOwnProperty.call(e,E)||E in n&&n[E]===f[E]||Object.defineProperty(n,E,{enumerable:!0,get:function(){return f[E]}})});var _=Wt;Object.keys(_).forEach(function(E){E==="default"||E==="__esModule"||Object.prototype.hasOwnProperty.call(e,E)||E in n&&n[E]===_[E]||Object.defineProperty(n,E,{enumerable:!0,get:function(){return _[E]}})});var I=ri;Object.keys(I).forEach(function(E){E==="default"||E==="__esModule"||Object.prototype.hasOwnProperty.call(e,E)||E in n&&n[E]===I[E]||Object.defineProperty(n,E,{enumerable:!0,get:function(){return I[E]}})});var R=rn;Object.keys(R).forEach(function(E){E==="default"||E==="__esModule"||Object.prototype.hasOwnProperty.call(e,E)||E in n&&n[E]===R[E]||Object.defineProperty(n,E,{enumerable:!0,get:function(){return R[E]}})});var T=Tn;Object.keys(T).forEach(function(E){E==="default"||E==="__esModule"||Object.prototype.hasOwnProperty.call(e,E)||E in n&&n[E]===T[E]||Object.defineProperty(n,E,{enumerable:!0,get:function(){return T[E]}})});var C=tn;Object.keys(C).forEach(function(E){E==="default"||E==="__esModule"||Object.prototype.hasOwnProperty.call(e,E)||E in n&&n[E]===C[E]||Object.defineProperty(n,E,{enumerable:!0,get:function(){return C[E]}})});var S=xs;Object.keys(S).forEach(function(E){E==="default"||E==="__esModule"||Object.prototype.hasOwnProperty.call(e,E)||E in n&&n[E]===S[E]||Object.defineProperty(n,E,{enumerable:!0,get:function(){return S[E]}})});var k=Mo;Object.keys(k).forEach(function(E){E==="default"||E==="__esModule"||Object.prototype.hasOwnProperty.call(e,E)||E in n&&n[E]===k[E]||Object.defineProperty(n,E,{enumerable:!0,get:function(){return k[E]}})});var A=ks;Object.keys(A).forEach(function(E){E==="default"||E==="__esModule"||Object.prototype.hasOwnProperty.call(e,E)||E in n&&n[E]===A[E]||Object.defineProperty(n,E,{enumerable:!0,get:function(){return A[E]}})});var w=Vo;Object.keys(w).forEach(function(E){E==="default"||E==="__esModule"||Object.prototype.hasOwnProperty.call(e,E)||E in n&&n[E]===w[E]||Object.defineProperty(n,E,{enumerable:!0,get:function(){return w[E]}})});var L=Su;Object.keys(L).forEach(function(E){E==="default"||E==="__esModule"||Object.prototype.hasOwnProperty.call(e,E)||E in n&&n[E]===L[E]||Object.defineProperty(n,E,{enumerable:!0,get:function(){return L[E]}})});var q=Vf;Object.keys(q).forEach(function(E){E==="default"||E==="__esModule"||Object.prototype.hasOwnProperty.call(e,E)||E in n&&n[E]===q[E]||Object.defineProperty(n,E,{enumerable:!0,get:function(){return q[E]}})});var F=qr;Object.keys(F).forEach(function(E){E==="default"||E==="__esModule"||Object.prototype.hasOwnProperty.call(e,E)||E in n&&n[E]===F[E]||Object.defineProperty(n,E,{enumerable:!0,get:function(){return F[E]}})});var he=No;Object.keys(he).forEach(function(E){E==="default"||E==="__esModule"||Object.prototype.hasOwnProperty.call(e,E)||E in n&&n[E]===he[E]||Object.defineProperty(n,E,{enumerable:!0,get:function(){return he[E]}})});var Fe=ne;Object.keys(Fe).forEach(function(E){E==="default"||E==="__esModule"||Object.prototype.hasOwnProperty.call(e,E)||E in n&&n[E]===Fe[E]||Object.defineProperty(n,E,{enumerable:!0,get:function(){return Fe[E]}})});var Ve=Be;Object.keys(Ve).forEach(function(E){E==="default"||E==="__esModule"||Object.prototype.hasOwnProperty.call(e,E)||E in n&&n[E]===Ve[E]||Object.defineProperty(n,E,{enumerable:!0,get:function(){return Ve[E]}})});var Qe=Je;Object.keys(Qe).forEach(function(E){E==="default"||E==="__esModule"||Object.prototype.hasOwnProperty.call(e,E)||E in n&&n[E]===Qe[E]||Object.defineProperty(n,E,{enumerable:!0,get:function(){return Qe[E]}})});var ft=fE;Object.keys(ft).forEach(function(E){E==="default"||E==="__esModule"||Object.prototype.hasOwnProperty.call(e,E)||E in n&&n[E]===ft[E]||Object.defineProperty(n,E,{enumerable:!0,get:function(){return ft[E]}})});var at=Wo;Object.keys(at).forEach(function(E){E==="default"||E==="__esModule"||Object.prototype.hasOwnProperty.call(e,E)||E in n&&n[E]===at[E]||Object.defineProperty(n,E,{enumerable:!0,get:function(){return at[E]}})});var Yt=uc;Object.keys(Yt).forEach(function(E){E==="default"||E==="__esModule"||Object.prototype.hasOwnProperty.call(e,E)||E in n&&n[E]===Yt[E]||Object.defineProperty(n,E,{enumerable:!0,get:function(){return Yt[E]}})});var ee=fi(Xe);n.ContentHelpers=ee;var pr=Oe;function Ut(E){if(typeof WeakMap!="function")return null;var gr=new WeakMap,$t=new WeakMap;return(Ut=function(mr){return mr?$t:gr})(E)}function fi(E,gr){if(!gr&&E&&E.__esModule)return E;if(E===null||typeof E!="object"&&typeof E!="function")return{default:E};var $t=Ut(gr);if($t&&$t.has(E))return $t.get(E);var mr={},Ir=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var ct in E)if(ct!=="default"&&Object.prototype.hasOwnProperty.call(E,ct)){var lt=Ir?Object.getOwnPropertyDescriptor(E,ct):null;lt&&(lt.get||lt.set)?Object.defineProperty(mr,ct,lt):mr[ct]=E[ct]}return mr.default=E,$t&&$t.set(E,mr),mr}let be;function xe(E){be=E}function pi(){return be}function jr(E){const gr=be;be=function($t,mr){return E(gr,$t,mr)}}let Pn=()=>new t.MemoryCryptoStore;function gi(E){Pn=E}function mi(E){return typeof E=="string"&&(E={baseUrl:E}),E.request=E.request||be,E.store=E.store||new r.MemoryStore({localStorage:V.localStorage}),E.scheduler=E.scheduler||new i.MatrixScheduler,E.cryptoStore=E.cryptoStore||Pn(),new s.MatrixClient(E)}})(Ps);(function(n){var e=G.exports;Object.defineProperty(n,"__esModule",{value:!0});var t={};n.default=void 0;var r=e(Jy.exports),i=e($w),s=a(Ps);Object.keys(s).forEach(function(c){c==="default"||c==="__esModule"||Object.prototype.hasOwnProperty.call(t,c)||c in n&&n[c]===s[c]||Object.defineProperty(n,c,{enumerable:!0,get:function(){return s[c]}})});function o(c){if(typeof WeakMap!="function")return null;var g=new WeakMap,m=new WeakMap;return(o=function(f){return f?m:g})(c)}function a(c,g){if(!g&&c&&c.__esModule)return c;if(c===null||typeof c!="object"&&typeof c!="function")return{default:c};var m=o(g);if(m&&m.has(c))return m.get(c);var f={},_=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var I in c)if(I!=="default"&&Object.prototype.hasOwnProperty.call(c,I)){var R=_?Object.getOwnPropertyDescriptor(c,I):null;R&&(R.get||R.set)?Object.defineProperty(f,I,R):f[I]=c[I]}return f.default=c,m&&m.set(c,f),f}if(s.getRequest())throw new Error("Multiple matrix-js-sdk entrypoints detected!");s.request(function(c,g){return c.qs=i.default.stringify(c.qs||{},c.qsStringifyOptions),(0,r.default)(c,g)});let l;try{l=V.indexedDB}catch{}l&&s.setCryptoStoreFactory(function(){return new s.IndexedDBCryptoStore(l,"matrix-js-sdk:crypto")});var u=s;n.default=u,V.matrixcs=s})(VS);var ox="/pr-121/assets/olm.b3e0f9b4.wasm",ax="/pr-121/assets/olm_legacy.9dc48f49.js",pE={exports:{}};(function(n,e){// @license magnet:?xt=urn:btih:8e4f440f4c65981c5bf93c76d35135ba5064d8b7&dn=apache-2.0.txt Apache-2.0
+var t=function(){var r={},i,s,o=function(){var l=typeof document!="undefined"&&document.currentScript?document.currentScript.src:void 0;return typeof __filename!="undefined"&&(l=l||__filename),function(u){u=u||{};var c;c||(c=typeof u!="undefined"?u:{});var g,m;c.ready=new Promise(function(p,y){g=p,m=y});var f;if(typeof window!="undefined")f=function(p){window.crypto.getRandomValues(p)};else if(n.exports){var _=Mi;f=function(p){var y=_.randomBytes(p.length);p.set(y)},process=V.process}else throw Error("Cannot find global to attach library to");if(typeof OLM_OPTIONS!="undefined")for(var I in OLM_OPTIONS)OLM_OPTIONS.hasOwnProperty(I)&&(c[I]=OLM_OPTIONS[I]);c.onRuntimeInitialized=function(){on=c._olm_error(),r.PRIVATE_KEY_LENGTH=c._olm_pk_private_key_length(),i&&i()},c.onAbort=function(p){s&&s(p)};var R={},T;for(T in c)c.hasOwnProperty(T)&&(R[T]=c[T]);var C=typeof window=="object",S=typeof importScripts=="function",k="",A,w,L,q,F;typeof process=="object"&&typeof process.versions=="object"&&typeof process.versions.node=="string"?(k=S?Mi.dirname(k)+"/":__dirname+"/",A=function(p,y){return q||(q=Mi),F||(F=Mi),p=F.normalize(p),q.readFileSync(p,y?null:"utf8")},L=function(p){return p=A(p,!0),p.buffer||(p=new Uint8Array(p)),p.buffer||lt("Assertion failed: undefined"),p},w=function(p,y,O){q||(q=Mi),F||(F=Mi),p=F.normalize(p),q.readFile(p,function(x,B){x?O(x):y(B.buffer)})},1<process.argv.length&&process.argv[1].replace(/\\/g,"/"),process.argv.slice(2),process.on("uncaughtException",function(p){throw p}),process.on("unhandledRejection",lt),c.inspect=function(){return"[Emscripten Module object]"}):(C||S)&&(S?k=self.location.href:typeof document!="undefined"&&document.currentScript&&(k=document.currentScript.src),l&&(k=l),k.indexOf("blob:")!==0?k=k.substr(0,k.lastIndexOf("/")+1):k="",A=function(p){var y=new XMLHttpRequest;return y.open("GET",p,!1),y.send(null),y.responseText},S&&(L=function(p){var y=new XMLHttpRequest;return y.open("GET",p,!1),y.responseType="arraybuffer",y.send(null),new Uint8Array(y.response)}),w=function(p,y,O){var x=new XMLHttpRequest;x.open("GET",p,!0),x.responseType="arraybuffer",x.onload=function(){x.status==200||x.status==0&&x.response?y(x.response):O()},x.onerror=O,x.send(null)}),c.print||console.log.bind(console);var he=c.printErr||console.warn.bind(console);for(T in R)R.hasOwnProperty(T)&&(c[T]=R[T]);R=null;var Fe;c.wasmBinary&&(Fe=c.wasmBinary),c.noExitRuntime,typeof WebAssembly!="object"&<("no native wasm support detected");function Ve(p){var y="i8";switch(y.charAt(y.length-1)==="*"&&(y="i32"),y){case"i1":be[p>>0]=0;break;case"i8":be[p>>0]=0;break;case"i16":pi[p>>1]=0;break;case"i32":jr[p>>2]=0;break;case"i64":yi=[0,(Mn=0,1<=+Math.abs(Mn)?0<Mn?(Math.min(+Math.floor(Mn/4294967296),4294967295)|0)>>>0:~~+Math.ceil((Mn-+(~~Mn>>>0))/4294967296)>>>0:0)],jr[p>>2]=yi[0],jr[p+4>>2]=yi[1];break;case"float":Pn[p>>2]=0;break;case"double":gi[p>>3]=0;break;default:lt("invalid type for setValue: "+y)}}function Qe(p,y){switch(y=y||"i8",y.charAt(y.length-1)==="*"&&(y="i32"),y){case"i1":return be[p>>0];case"i8":return be[p>>0];case"i16":return pi[p>>1];case"i32":return jr[p>>2];case"i64":return jr[p>>2];case"float":return Pn[p>>2];case"double":return gi[p>>3];default:lt("invalid type for getValue: "+y)}return null}var ft,at=!1,Yt=typeof TextDecoder!="undefined"?new TextDecoder("utf8"):void 0;function ee(p,y){if(p){var O=xe,x=p+y;for(y=p;O[y]&&!(y>=x);)++y;if(16<y-p&&O.subarray&&Yt)p=Yt.decode(O.subarray(p,y));else{for(x="";p<y;){var B=O[p++];if(B&128){var Z=O[p++]&63;if((B&224)==192)x+=String.fromCharCode((B&31)<<6|Z);else{var ve=O[p++]&63;B=(B&240)==224?(B&15)<<12|Z<<6|ve:(B&7)<<18|Z<<12|ve<<6|O[p++]&63,65536>B?x+=String.fromCharCode(B):(B-=65536,x+=String.fromCharCode(55296|B>>10,56320|B&1023))}}else x+=String.fromCharCode(B)}p=x}}else p="";return p}function pr(p,y,O,x){if(!(0<x))return 0;var B=O;x=O+x-1;for(var Z=0;Z<p.length;++Z){var ve=p.charCodeAt(Z);if(55296<=ve&&57343>=ve){var Nt=p.charCodeAt(++Z);ve=65536+((ve&1023)<<10)|Nt&1023}if(127>=ve){if(O>=x)break;y[O++]=ve}else{if(2047>=ve){if(O+1>=x)break;y[O++]=192|ve>>6}else{if(65535>=ve){if(O+2>=x)break;y[O++]=224|ve>>12}else{if(O+3>=x)break;y[O++]=240|ve>>18,y[O++]=128|ve>>12&63}y[O++]=128|ve>>6&63}y[O++]=128|ve&63}}return y[O]=0,O-B}function Ut(p){for(var y=0,O=0;O<p.length;++O){var x=p.charCodeAt(O);55296<=x&&57343>=x&&(x=65536+((x&1023)<<10)|p.charCodeAt(++O)&1023),127>=x?++y:y=2047>=x?y+2:65535>=x?y+3:y+4}return y}function fi(p,y){for(var O=0;O<p.length;++O)be[y++>>0]=p.charCodeAt(O)}var be,xe,pi,jr,Pn,gi,mi,E=[],gr=[],$t=[];function mr(){var p=c.preRun.shift();E.unshift(p)}var Ir=0,ct=null;c.preloadedImages={},c.preloadedAudios={};function lt(p){throw c.onAbort&&c.onAbort(p),he(p),at=!0,p=new WebAssembly.RuntimeError("abort("+p+"). Build with -s ASSERTIONS=1 for more info."),m(p),p}function gc(){return zt.startsWith("data:application/octet-stream;base64,")}var zt;if(zt="olm.wasm",!gc()){var Ls=zt;zt=c.locateFile?c.locateFile(Ls,k):k+Ls}function mc(){var p=zt;try{if(p==zt&&Fe)return new Uint8Array(Fe);if(L)return L(p);throw"both async and sync fetching of the wasm failed"}catch(y){lt(y)}}function Ru(){if(!Fe&&(C||S)){if(typeof fetch=="function"&&!zt.startsWith("file://"))return fetch(zt,{credentials:"same-origin"}).then(function(p){if(!p.ok)throw"failed to load wasm binary file at '"+zt+"'";return p.arrayBuffer()}).catch(function(){return mc()});if(w)return new Promise(function(p,y){w(zt,function(O){p(new Uint8Array(O))},y)})}return Promise.resolve().then(function(){return mc()})}var Mn,yi;function Jt(p){for(;0<p.length;){var y=p.shift();if(typeof y=="function")y(c);else{var O=y.cc;typeof O=="number"?y.bc===void 0?mi.get(O)():mi.get(O)(y.bc):O(y.bc===void 0?null:y.bc)}}}var Ho={a:function(p,y,O){xe.copyWithin(p,y,y+O)},b:function(){lt("OOM")}};(function(){function p(B){c.asm=B.exports,ft=c.asm.c,B=ft.buffer,c.HEAP8=be=new Int8Array(B),c.HEAP16=pi=new Int16Array(B),c.HEAP32=jr=new Int32Array(B),c.HEAPU8=xe=new Uint8Array(B),c.HEAPU16=new Uint16Array(B),c.HEAPU32=new Uint32Array(B),c.HEAPF32=Pn=new Float32Array(B),c.HEAPF64=gi=new Float64Array(B),mi=c.asm.e,gr.unshift(c.asm.d),Ir--,c.monitorRunDependencies&&c.monitorRunDependencies(Ir),Ir==0&&ct&&(B=ct,ct=null,B())}function y(B){p(B.instance)}function O(B){return Ru().then(function(Z){return WebAssembly.instantiate(Z,x)}).then(function(Z){return Z}).then(B,function(Z){he("failed to asynchronously prepare wasm: "+Z),lt(Z)})}var x={a:Ho};if(Ir++,c.monitorRunDependencies&&c.monitorRunDependencies(Ir),c.instantiateWasm)try{return c.instantiateWasm(x,p)}catch(B){return he("Module.instantiateWasm callback failed with error: "+B),!1}return function(){return Fe||typeof WebAssembly.instantiateStreaming!="function"||gc()||zt.startsWith("file://")||typeof fetch!="function"?O(y):fetch(zt,{credentials:"same-origin"}).then(function(B){return WebAssembly.instantiateStreaming(B,x).then(y,function(Z){return he("wasm streaming compile failed: "+Z),he("falling back to ArrayBuffer instantiation"),O(y)})})}().catch(m),{}})(),c.___wasm_call_ctors=function(){return(c.___wasm_call_ctors=c.asm.d).apply(null,arguments)},c._olm_pk_encryption_last_error=function(){return(c._olm_pk_encryption_last_error=c.asm.f).apply(null,arguments)},c.__olm_error_to_string=function(){return(c.__olm_error_to_string=c.asm.g).apply(null,arguments)},c._olm_pk_encryption_last_error_code=function(){return(c._olm_pk_encryption_last_error_code=c.asm.h).apply(null,arguments)},c._olm_pk_encryption_size=function(){return(c._olm_pk_encryption_size=c.asm.i).apply(null,arguments)},c._olm_pk_encryption=function(){return(c._olm_pk_encryption=c.asm.j).apply(null,arguments)},c._olm_clear_pk_encryption=function(){return(c._olm_clear_pk_encryption=c.asm.k).apply(null,arguments)},c._olm_pk_encryption_set_recipient_key=function(){return(c._olm_pk_encryption_set_recipient_key=c.asm.l).apply(null,arguments)},c._olm_pk_key_length=function(){return(c._olm_pk_key_length=c.asm.m).apply(null,arguments)},c._olm_pk_ciphertext_length=function(){return(c._olm_pk_ciphertext_length=c.asm.n).apply(null,arguments)},c._olm_pk_mac_length=function(){return(c._olm_pk_mac_length=c.asm.o).apply(null,arguments)},c._olm_pk_encrypt_random_length=function(){return(c._olm_pk_encrypt_random_length=c.asm.p).apply(null,arguments)},c._olm_pk_encrypt=function(){return(c._olm_pk_encrypt=c.asm.q).apply(null,arguments)},c._olm_pk_decryption_last_error=function(){return(c._olm_pk_decryption_last_error=c.asm.r).apply(null,arguments)},c._olm_pk_decryption_last_error_code=function(){return(c._olm_pk_decryption_last_error_code=c.asm.s).apply(null,arguments)},c._olm_pk_decryption_size=function(){return(c._olm_pk_decryption_size=c.asm.t).apply(null,arguments)},c._olm_pk_decryption=function(){return(c._olm_pk_decryption=c.asm.u).apply(null,arguments)},c._olm_clear_pk_decryption=function(){return(c._olm_clear_pk_decryption=c.asm.v).apply(null,arguments)},c._olm_pk_private_key_length=function(){return(c._olm_pk_private_key_length=c.asm.w).apply(null,arguments)},c._olm_pk_generate_key_random_length=function(){return(c._olm_pk_generate_key_random_length=c.asm.x).apply(null,arguments)},c._olm_pk_key_from_private=function(){return(c._olm_pk_key_from_private=c.asm.y).apply(null,arguments)},c._olm_pk_generate_key=function(){return(c._olm_pk_generate_key=c.asm.z).apply(null,arguments)},c._olm_pickle_pk_decryption_length=function(){return(c._olm_pickle_pk_decryption_length=c.asm.A).apply(null,arguments)},c._olm_pickle_pk_decryption=function(){return(c._olm_pickle_pk_decryption=c.asm.B).apply(null,arguments)},c._olm_unpickle_pk_decryption=function(){return(c._olm_unpickle_pk_decryption=c.asm.C).apply(null,arguments)},c._olm_pk_max_plaintext_length=function(){return(c._olm_pk_max_plaintext_length=c.asm.D).apply(null,arguments)},c._olm_pk_decrypt=function(){return(c._olm_pk_decrypt=c.asm.E).apply(null,arguments)},c._olm_pk_get_private_key=function(){return(c._olm_pk_get_private_key=c.asm.F).apply(null,arguments)},c._olm_pk_signing_size=function(){return(c._olm_pk_signing_size=c.asm.G).apply(null,arguments)},c._olm_pk_signing=function(){return(c._olm_pk_signing=c.asm.H).apply(null,arguments)},c._olm_pk_signing_last_error=function(){return(c._olm_pk_signing_last_error=c.asm.I).apply(null,arguments)},c._olm_pk_signing_last_error_code=function(){return(c._olm_pk_signing_last_error_code=c.asm.J).apply(null,arguments)},c._olm_clear_pk_signing=function(){return(c._olm_clear_pk_signing=c.asm.K).apply(null,arguments)},c._olm_pk_signing_seed_length=function(){return(c._olm_pk_signing_seed_length=c.asm.L).apply(null,arguments)},c._olm_pk_signing_public_key_length=function(){return(c._olm_pk_signing_public_key_length=c.asm.M).apply(null,arguments)},c._olm_pk_signing_key_from_seed=function(){return(c._olm_pk_signing_key_from_seed=c.asm.N).apply(null,arguments)},c._olm_pk_signature_length=function(){return(c._olm_pk_signature_length=c.asm.O).apply(null,arguments)},c._olm_pk_sign=function(){return(c._olm_pk_sign=c.asm.P).apply(null,arguments)},c._olm_get_library_version=function(){return(c._olm_get_library_version=c.asm.Q).apply(null,arguments)},c._olm_error=function(){return(c._olm_error=c.asm.R).apply(null,arguments)},c._olm_account_last_error=function(){return(c._olm_account_last_error=c.asm.S).apply(null,arguments)},c._olm_account_last_error_code=function(){return(c._olm_account_last_error_code=c.asm.T).apply(null,arguments)},c._olm_session_last_error=function(){return(c._olm_session_last_error=c.asm.U).apply(null,arguments)},c._olm_session_last_error_code=function(){return(c._olm_session_last_error_code=c.asm.V).apply(null,arguments)},c._olm_utility_last_error=function(){return(c._olm_utility_last_error=c.asm.W).apply(null,arguments)},c._olm_utility_last_error_code=function(){return(c._olm_utility_last_error_code=c.asm.X).apply(null,arguments)},c._olm_account_size=function(){return(c._olm_account_size=c.asm.Y).apply(null,arguments)},c._olm_session_size=function(){return(c._olm_session_size=c.asm.Z).apply(null,arguments)},c._olm_utility_size=function(){return(c._olm_utility_size=c.asm._).apply(null,arguments)},c._olm_account=function(){return(c._olm_account=c.asm.$).apply(null,arguments)},c._olm_session=function(){return(c._olm_session=c.asm.aa).apply(null,arguments)},c._olm_utility=function(){return(c._olm_utility=c.asm.ba).apply(null,arguments)},c._olm_clear_account=function(){return(c._olm_clear_account=c.asm.ca).apply(null,arguments)},c._olm_clear_session=function(){return(c._olm_clear_session=c.asm.da).apply(null,arguments)},c._olm_clear_utility=function(){return(c._olm_clear_utility=c.asm.ea).apply(null,arguments)},c._olm_pickle_account_length=function(){return(c._olm_pickle_account_length=c.asm.fa).apply(null,arguments)},c._olm_pickle_session_length=function(){return(c._olm_pickle_session_length=c.asm.ga).apply(null,arguments)},c._olm_pickle_account=function(){return(c._olm_pickle_account=c.asm.ha).apply(null,arguments)},c._olm_pickle_session=function(){return(c._olm_pickle_session=c.asm.ia).apply(null,arguments)},c._olm_unpickle_account=function(){return(c._olm_unpickle_account=c.asm.ja).apply(null,arguments)},c._olm_unpickle_session=function(){return(c._olm_unpickle_session=c.asm.ka).apply(null,arguments)},c._olm_create_account_random_length=function(){return(c._olm_create_account_random_length=c.asm.la).apply(null,arguments)},c._olm_create_account=function(){return(c._olm_create_account=c.asm.ma).apply(null,arguments)},c._olm_account_identity_keys_length=function(){return(c._olm_account_identity_keys_length=c.asm.na).apply(null,arguments)},c._olm_account_identity_keys=function(){return(c._olm_account_identity_keys=c.asm.oa).apply(null,arguments)},c._olm_account_signature_length=function(){return(c._olm_account_signature_length=c.asm.pa).apply(null,arguments)},c._olm_account_sign=function(){return(c._olm_account_sign=c.asm.qa).apply(null,arguments)},c._olm_account_one_time_keys_length=function(){return(c._olm_account_one_time_keys_length=c.asm.ra).apply(null,arguments)},c._olm_account_one_time_keys=function(){return(c._olm_account_one_time_keys=c.asm.sa).apply(null,arguments)},c._olm_account_mark_keys_as_published=function(){return(c._olm_account_mark_keys_as_published=c.asm.ta).apply(null,arguments)},c._olm_account_max_number_of_one_time_keys=function(){return(c._olm_account_max_number_of_one_time_keys=c.asm.ua).apply(null,arguments)},c._olm_account_generate_one_time_keys_random_length=function(){return(c._olm_account_generate_one_time_keys_random_length=c.asm.va).apply(null,arguments)},c._olm_account_generate_one_time_keys=function(){return(c._olm_account_generate_one_time_keys=c.asm.wa).apply(null,arguments)},c._olm_account_generate_fallback_key_random_length=function(){return(c._olm_account_generate_fallback_key_random_length=c.asm.xa).apply(null,arguments)},c._olm_account_generate_fallback_key=function(){return(c._olm_account_generate_fallback_key=c.asm.ya).apply(null,arguments)},c._olm_account_fallback_key_length=function(){return(c._olm_account_fallback_key_length=c.asm.za).apply(null,arguments)},c._olm_account_fallback_key=function(){return(c._olm_account_fallback_key=c.asm.Aa).apply(null,arguments)},c._olm_account_unpublished_fallback_key_length=function(){return(c._olm_account_unpublished_fallback_key_length=c.asm.Ba).apply(null,arguments)},c._olm_account_unpublished_fallback_key=function(){return(c._olm_account_unpublished_fallback_key=c.asm.Ca).apply(null,arguments)},c._olm_account_forget_old_fallback_key=function(){return(c._olm_account_forget_old_fallback_key=c.asm.Da).apply(null,arguments)},c._olm_create_outbound_session_random_length=function(){return(c._olm_create_outbound_session_random_length=c.asm.Ea).apply(null,arguments)},c._olm_create_outbound_session=function(){return(c._olm_create_outbound_session=c.asm.Fa).apply(null,arguments)},c._olm_create_inbound_session=function(){return(c._olm_create_inbound_session=c.asm.Ga).apply(null,arguments)},c._olm_create_inbound_session_from=function(){return(c._olm_create_inbound_session_from=c.asm.Ha).apply(null,arguments)},c._olm_session_id_length=function(){return(c._olm_session_id_length=c.asm.Ia).apply(null,arguments)},c._olm_session_id=function(){return(c._olm_session_id=c.asm.Ja).apply(null,arguments)},c._olm_session_has_received_message=function(){return(c._olm_session_has_received_message=c.asm.Ka).apply(null,arguments)},c._olm_session_describe=function(){return(c._olm_session_describe=c.asm.La).apply(null,arguments)},c._olm_matches_inbound_session=function(){return(c._olm_matches_inbound_session=c.asm.Ma).apply(null,arguments)},c._olm_matches_inbound_session_from=function(){return(c._olm_matches_inbound_session_from=c.asm.Na).apply(null,arguments)},c._olm_remove_one_time_keys=function(){return(c._olm_remove_one_time_keys=c.asm.Oa).apply(null,arguments)},c._olm_encrypt_message_type=function(){return(c._olm_encrypt_message_type=c.asm.Pa).apply(null,arguments)},c._olm_encrypt_random_length=function(){return(c._olm_encrypt_random_length=c.asm.Qa).apply(null,arguments)},c._olm_encrypt_message_length=function(){return(c._olm_encrypt_message_length=c.asm.Ra).apply(null,arguments)},c._olm_encrypt=function(){return(c._olm_encrypt=c.asm.Sa).apply(null,arguments)},c._olm_decrypt_max_plaintext_length=function(){return(c._olm_decrypt_max_plaintext_length=c.asm.Ta).apply(null,arguments)},c._olm_decrypt=function(){return(c._olm_decrypt=c.asm.Ua).apply(null,arguments)},c._olm_sha256_length=function(){return(c._olm_sha256_length=c.asm.Va).apply(null,arguments)},c._olm_sha256=function(){return(c._olm_sha256=c.asm.Wa).apply(null,arguments)},c._olm_ed25519_verify=function(){return(c._olm_ed25519_verify=c.asm.Xa).apply(null,arguments)},c._olm_inbound_group_session_size=function(){return(c._olm_inbound_group_session_size=c.asm.Ya).apply(null,arguments)},c._olm_inbound_group_session=function(){return(c._olm_inbound_group_session=c.asm.Za).apply(null,arguments)},c._olm_clear_inbound_group_session=function(){return(c._olm_clear_inbound_group_session=c.asm._a).apply(null,arguments)},c._olm_inbound_group_session_last_error=function(){return(c._olm_inbound_group_session_last_error=c.asm.$a).apply(null,arguments)},c._olm_inbound_group_session_last_error_code=function(){return(c._olm_inbound_group_session_last_error_code=c.asm.ab).apply(null,arguments)},c._olm_init_inbound_group_session=function(){return(c._olm_init_inbound_group_session=c.asm.bb).apply(null,arguments)},c._olm_import_inbound_group_session=function(){return(c._olm_import_inbound_group_session=c.asm.cb).apply(null,arguments)},c._olm_pickle_inbound_group_session_length=function(){return(c._olm_pickle_inbound_group_session_length=c.asm.db).apply(null,arguments)},c._olm_pickle_inbound_group_session=function(){return(c._olm_pickle_inbound_group_session=c.asm.eb).apply(null,arguments)},c._olm_unpickle_inbound_group_session=function(){return(c._olm_unpickle_inbound_group_session=c.asm.fb).apply(null,arguments)},c._olm_group_decrypt_max_plaintext_length=function(){return(c._olm_group_decrypt_max_plaintext_length=c.asm.gb).apply(null,arguments)},c._olm_group_decrypt=function(){return(c._olm_group_decrypt=c.asm.hb).apply(null,arguments)},c._olm_inbound_group_session_id_length=function(){return(c._olm_inbound_group_session_id_length=c.asm.ib).apply(null,arguments)},c._olm_inbound_group_session_id=function(){return(c._olm_inbound_group_session_id=c.asm.jb).apply(null,arguments)},c._olm_inbound_group_session_first_known_index=function(){return(c._olm_inbound_group_session_first_known_index=c.asm.kb).apply(null,arguments)},c._olm_inbound_group_session_is_verified=function(){return(c._olm_inbound_group_session_is_verified=c.asm.lb).apply(null,arguments)},c._olm_export_inbound_group_session_length=function(){return(c._olm_export_inbound_group_session_length=c.asm.mb).apply(null,arguments)},c._olm_export_inbound_group_session=function(){return(c._olm_export_inbound_group_session=c.asm.nb).apply(null,arguments)},c._olm_sas_last_error=function(){return(c._olm_sas_last_error=c.asm.ob).apply(null,arguments)},c._olm_sas_last_error_code=function(){return(c._olm_sas_last_error_code=c.asm.pb).apply(null,arguments)},c._olm_sas_size=function(){return(c._olm_sas_size=c.asm.qb).apply(null,arguments)},c._olm_sas=function(){return(c._olm_sas=c.asm.rb).apply(null,arguments)},c._olm_clear_sas=function(){return(c._olm_clear_sas=c.asm.sb).apply(null,arguments)},c._olm_create_sas_random_length=function(){return(c._olm_create_sas_random_length=c.asm.tb).apply(null,arguments)},c._olm_create_sas=function(){return(c._olm_create_sas=c.asm.ub).apply(null,arguments)},c._olm_sas_pubkey_length=function(){return(c._olm_sas_pubkey_length=c.asm.vb).apply(null,arguments)},c._olm_sas_get_pubkey=function(){return(c._olm_sas_get_pubkey=c.asm.wb).apply(null,arguments)},c._olm_sas_set_their_key=function(){return(c._olm_sas_set_their_key=c.asm.xb).apply(null,arguments)},c._olm_sas_is_their_key_set=function(){return(c._olm_sas_is_their_key_set=c.asm.yb).apply(null,arguments)},c._olm_sas_generate_bytes=function(){return(c._olm_sas_generate_bytes=c.asm.zb).apply(null,arguments)},c._olm_sas_mac_length=function(){return(c._olm_sas_mac_length=c.asm.Ab).apply(null,arguments)},c._olm_sas_calculate_mac_fixed_base64=function(){return(c._olm_sas_calculate_mac_fixed_base64=c.asm.Bb).apply(null,arguments)},c._olm_sas_calculate_mac=function(){return(c._olm_sas_calculate_mac=c.asm.Cb).apply(null,arguments)},c._olm_sas_calculate_mac_long_kdf=function(){return(c._olm_sas_calculate_mac_long_kdf=c.asm.Db).apply(null,arguments)},c._olm_outbound_group_session_size=function(){return(c._olm_outbound_group_session_size=c.asm.Eb).apply(null,arguments)},c._olm_outbound_group_session=function(){return(c._olm_outbound_group_session=c.asm.Fb).apply(null,arguments)},c._olm_clear_outbound_group_session=function(){return(c._olm_clear_outbound_group_session=c.asm.Gb).apply(null,arguments)},c._olm_outbound_group_session_last_error=function(){return(c._olm_outbound_group_session_last_error=c.asm.Hb).apply(null,arguments)},c._olm_outbound_group_session_last_error_code=function(){return(c._olm_outbound_group_session_last_error_code=c.asm.Ib).apply(null,arguments)},c._olm_pickle_outbound_group_session_length=function(){return(c._olm_pickle_outbound_group_session_length=c.asm.Jb).apply(null,arguments)},c._olm_pickle_outbound_group_session=function(){return(c._olm_pickle_outbound_group_session=c.asm.Kb).apply(null,arguments)},c._olm_unpickle_outbound_group_session=function(){return(c._olm_unpickle_outbound_group_session=c.asm.Lb).apply(null,arguments)},c._olm_init_outbound_group_session_random_length=function(){return(c._olm_init_outbound_group_session_random_length=c.asm.Mb).apply(null,arguments)},c._olm_init_outbound_group_session=function(){return(c._olm_init_outbound_group_session=c.asm.Nb).apply(null,arguments)},c._olm_group_encrypt_message_length=function(){return(c._olm_group_encrypt_message_length=c.asm.Ob).apply(null,arguments)},c._olm_group_encrypt=function(){return(c._olm_group_encrypt=c.asm.Pb).apply(null,arguments)},c._olm_outbound_group_session_id_length=function(){return(c._olm_outbound_group_session_id_length=c.asm.Qb).apply(null,arguments)},c._olm_outbound_group_session_id=function(){return(c._olm_outbound_group_session_id=c.asm.Rb).apply(null,arguments)},c._olm_outbound_group_session_message_index=function(){return(c._olm_outbound_group_session_message_index=c.asm.Sb).apply(null,arguments)},c._olm_outbound_group_session_key_length=function(){return(c._olm_outbound_group_session_key_length=c.asm.Tb).apply(null,arguments)},c._olm_outbound_group_session_key=function(){return(c._olm_outbound_group_session_key=c.asm.Ub).apply(null,arguments)},c._malloc=function(){return(c._malloc=c.asm.Vb).apply(null,arguments)},c._free=function(){return(c._free=c.asm.Wb).apply(null,arguments)};var yc=c.stackSave=function(){return(yc=c.stackSave=c.asm.Xb).apply(null,arguments)},Vr=c.stackRestore=function(){return(Vr=c.stackRestore=c.asm.Yb).apply(null,arguments)},vc=c.stackAlloc=function(){return(vc=c.stackAlloc=c.asm.Zb).apply(null,arguments)};c.ALLOC_STACK=1;var v;ct=function p(){v||d(),v||(ct=p)};function d(){function p(){if(!v&&(v=!0,c.calledRun=!0,!at)){if(Jt(gr),g(c),c.onRuntimeInitialized&&c.onRuntimeInitialized(),c.postRun)for(typeof c.postRun=="function"&&(c.postRun=[c.postRun]);c.postRun.length;){var y=c.postRun.shift();$t.unshift(y)}Jt($t)}}if(!(0<Ir)){if(c.preRun)for(typeof c.preRun=="function"&&(c.preRun=[c.preRun]);c.preRun.length;)mr();Jt(E),0<Ir||(c.setStatus?(c.setStatus("Running..."),setTimeout(function(){setTimeout(function(){c.setStatus("")},1),p()},1)):p())}}if(c.run=d,c.preInit)for(typeof c.preInit=="function"&&(c.preInit=[c.preInit]);0<c.preInit.length;)c.preInit.pop()();d();function h(){var p=c._olm_outbound_group_session_size();this.ac=Ge(p),this.$b=c._olm_outbound_group_session(this.ac)}function b(p){return function(){var y=p.apply(this,arguments);if(y===on)throw y=ee(c._olm_outbound_group_session_last_error(arguments[0])),Error("OLM."+y);return y}}h.prototype.free=function(){c._olm_clear_outbound_group_session(this.$b),We(this.$b)},h.prototype.pickle=z(function(p){p=ae(p);var y=b(c._olm_pickle_outbound_group_session_length)(this.$b),O=j(p),x=j(y+1);try{b(c._olm_pickle_outbound_group_session)(this.$b,O,p.length,x,y)}finally{for(ce(O,p.length),O=0;O<p.length;O++)p[O]=0}return ee(x,y)}),h.prototype.unpickle=z(function(p,y){p=ae(p);var O=j(p);y=ae(y);var x=j(y);try{b(c._olm_unpickle_outbound_group_session)(this.$b,O,p.length,x,y.length)}finally{for(ce(O,p.length),O=0;O<p.length;O++)p[O]=0}}),h.prototype.create=z(function(){var p=b(c._olm_init_outbound_group_session_random_length)(this.$b),y=Tr(p,f);try{b(c._olm_init_outbound_group_session)(this.$b,y,p)}finally{ce(y,p)}}),h.prototype.encrypt=function(p){try{var y=Ut(p),O=b(c._olm_group_encrypt_message_length)(this.$b,y),x=Ge(y+1);pr(p,xe,x,y+1);var B=Ge(O+1);return b(c._olm_group_encrypt)(this.$b,x,y,B,O),Ve(B+O),ee(B,O)}finally{x!==void 0&&(ce(x,y+1),We(x)),B!==void 0&&We(B)}},h.prototype.session_id=z(function(){var p=b(c._olm_outbound_group_session_id_length)(this.$b),y=j(p+1);return b(c._olm_outbound_group_session_id)(this.$b,y,p),ee(y,p)}),h.prototype.session_key=z(function(){var p=b(c._olm_outbound_group_session_key_length)(this.$b),y=j(p+1);b(c._olm_outbound_group_session_key)(this.$b,y,p);var O=ee(y,p);return ce(y,p),O}),h.prototype.message_index=function(){return b(c._olm_outbound_group_session_message_index)(this.$b)},r.OutboundGroupSession=h;function P(){var p=c._olm_inbound_group_session_size();this.ac=Ge(p),this.$b=c._olm_inbound_group_session(this.ac)}function D(p){return function(){var y=p.apply(this,arguments);if(y===on)throw y=ee(c._olm_inbound_group_session_last_error(arguments[0])),Error("OLM."+y);return y}}P.prototype.free=function(){c._olm_clear_inbound_group_session(this.$b),We(this.$b)},P.prototype.pickle=z(function(p){p=ae(p);var y=D(c._olm_pickle_inbound_group_session_length)(this.$b),O=j(p),x=j(y+1);try{D(c._olm_pickle_inbound_group_session)(this.$b,O,p.length,x,y)}finally{for(ce(O,p.length),O=0;O<p.length;O++)p[O]=0}return ee(x,y)}),P.prototype.unpickle=z(function(p,y){p=ae(p);var O=j(p);y=ae(y);var x=j(y);try{D(c._olm_unpickle_inbound_group_session)(this.$b,O,p.length,x,y.length)}finally{for(ce(O,p.length),O=0;O<p.length;O++)p[O]=0}}),P.prototype.create=z(function(p){p=ae(p);var y=j(p);try{D(c._olm_init_inbound_group_session)(this.$b,y,p.length)}finally{for(ce(y,p.length),y=0;y<p.length;y++)p[y]=0}}),P.prototype.import_session=z(function(p){p=ae(p);var y=j(p);try{D(c._olm_import_inbound_group_session)(this.$b,y,p.length)}finally{for(ce(y,p.length),y=0;y<p.length;y++)p[y]=0}}),P.prototype.decrypt=z(function(p){try{var y=Ge(p.length);fi(p,y);var O=D(c._olm_group_decrypt_max_plaintext_length)(this.$b,y,p.length);fi(p,y);var x=Ge(O+1),B=j(4),Z=D(c._olm_group_decrypt)(this.$b,y,p.length,x,O,B);return Ve(x+Z),{plaintext:ee(x,Z),message_index:Qe(B,"i32")}}finally{y!==void 0&&We(y),x!==void 0&&(ce(x,Z),We(x))}}),P.prototype.session_id=z(function(){var p=D(c._olm_inbound_group_session_id_length)(this.$b),y=j(p+1);return D(c._olm_inbound_group_session_id)(this.$b,y,p),ee(y,p)}),P.prototype.first_known_index=z(function(){return D(c._olm_inbound_group_session_first_known_index)(this.$b)}),P.prototype.export_session=z(function(p){var y=D(c._olm_export_inbound_group_session_length)(this.$b),O=j(y+1);return b(c._olm_export_inbound_group_session)(this.$b,O,y,p),p=ee(O,y),ce(O,y),p}),r.InboundGroupSession=P;function U(){var p=c._olm_pk_encryption_size();this.ac=Ge(p),this.$b=c._olm_pk_encryption(this.ac)}function re(p){return function(){var y=p.apply(this,arguments);if(y===on)throw y=ee(c._olm_pk_encryption_last_error(arguments[0])),Error("OLM."+y);return y}}U.prototype.free=function(){c._olm_clear_pk_encryption(this.$b),We(this.$b)},U.prototype.set_recipient_key=z(function(p){p=ae(p);var y=j(p);re(c._olm_pk_encryption_set_recipient_key)(this.$b,y,p.length)}),U.prototype.encrypt=z(function(p){try{var y=Ut(p),O=Ge(y+1);pr(p,xe,O,y+1);var x=re(c._olm_pk_encrypt_random_length)(),B=Tr(x,f),Z=re(c._olm_pk_ciphertext_length)(this.$b,y),ve=Ge(Z+1),Nt=re(c._olm_pk_mac_length)(this.$b),Yo=j(Nt+1);Ve(Yo+Nt);var Vi=re(c._olm_pk_key_length)(),an=j(Vi+1);return Ve(an+Vi),re(c._olm_pk_encrypt)(this.$b,O,y,ve,Z,Yo,Nt,an,Vi,B,x),Ve(ve+Z),{ciphertext:ee(ve,Z),mac:ee(Yo,Nt),ephemeral:ee(an,Vi)}}finally{B!==void 0&&ce(B,x),O!==void 0&&(ce(O,y+1),We(O)),ve!==void 0&&We(ve)}});function we(){var p=c._olm_pk_decryption_size();this.ac=Ge(p),this.$b=c._olm_pk_decryption(this.ac)}function ue(p){return function(){var y=p.apply(this,arguments);if(y===on)throw y=ee(c._olm_pk_decryption_last_error(arguments[0])),Error("OLM."+y);return y}}we.prototype.free=function(){c._olm_clear_pk_decryption(this.$b),We(this.$b)},we.prototype.init_with_private_key=z(function(p){var y=j(p.length);c.HEAPU8.set(p,y);var O=ue(c._olm_pk_key_length)(),x=j(O+1);try{ue(c._olm_pk_key_from_private)(this.$b,x,O,y,p.length)}finally{ce(y,p.length)}return ee(x,O)}),we.prototype.generate_key=z(function(){var p=ue(c._olm_pk_private_key_length)(),y=Tr(p,f),O=ue(c._olm_pk_key_length)(),x=j(O+1);try{ue(c._olm_pk_key_from_private)(this.$b,x,O,y,p)}finally{ce(y,p)}return ee(x,O)}),we.prototype.get_private_key=z(function(){var p=re(c._olm_pk_private_key_length)(),y=j(p);ue(c._olm_pk_get_private_key)(this.$b,y,p);var O=new Uint8Array(new Uint8Array(c.HEAPU8.buffer,y,p));return ce(y,p),O}),we.prototype.pickle=z(function(p){p=ae(p);var y=ue(c._olm_pickle_pk_decryption_length)(this.$b),O=j(p),x=j(y+1);try{ue(c._olm_pickle_pk_decryption)(this.$b,O,p.length,x,y)}finally{for(ce(O,p.length),O=0;O<p.length;O++)p[O]=0}return ee(x,y)}),we.prototype.unpickle=z(function(p,y){p=ae(p);var O=j(p),x=ae(y),B=j(x);y=ue(c._olm_pk_key_length)();var Z=j(y+1);try{ue(c._olm_unpickle_pk_decryption)(this.$b,O,p.length,B,x.length,Z,y)}finally{for(ce(O,p.length),O=0;O<p.length;O++)p[O]=0}return ee(Z,y)}),we.prototype.decrypt=z(function(p,y,O){try{var x=Ut(O),B=Ge(x+1);pr(O,xe,B,x+1);var Z=ae(p),ve=j(Z),Nt=ae(y),Yo=j(Nt),Vi=ue(c._olm_pk_max_plaintext_length)(this.$b,x),an=Ge(Vi+1),Tu=ue(c._olm_pk_decrypt)(this.$b,ve,Z.length,Yo,Nt.length,B,x,an,Vi);return Ve(an+Tu),ee(an,Tu)}finally{an!==void 0&&(ce(an,Tu+1),We(an)),B!==void 0&&We(B)}});function Te(){var p=c._olm_pk_signing_size();this.ac=Ge(p),this.$b=c._olm_pk_signing(this.ac)}function ye(p){return function(){var y=p.apply(this,arguments);if(y===on)throw y=ee(c._olm_pk_signing_last_error(arguments[0])),Error("OLM."+y);return y}}Te.prototype.free=function(){c._olm_clear_pk_signing(this.$b),We(this.$b)},Te.prototype.init_with_seed=z(function(p){var y=j(p.length);c.HEAPU8.set(p,y);var O=ye(c._olm_pk_signing_public_key_length)(),x=j(O+1);try{ye(c._olm_pk_signing_key_from_seed)(this.$b,x,O,y,p.length)}finally{ce(y,p.length)}return ee(x,O)}),Te.prototype.generate_seed=z(function(){var p=ye(c._olm_pk_signing_seed_length)(),y=Tr(p,f),O=new Uint8Array(new Uint8Array(c.HEAPU8.buffer,y,p));return ce(y,p),O}),Te.prototype.sign=z(function(p){try{var y=Ut(p),O=Ge(y+1);pr(p,xe,O,y+1);var x=ye(c._olm_pk_signature_length)(),B=j(x+1);return ye(c._olm_pk_sign)(this.$b,O,y,B,x),ee(B,x)}finally{O!==void 0&&(ce(O,y+1),We(O))}});function vi(){var p=c._olm_sas_size(),y=c._olm_create_sas_random_length(),O=Tr(y,f);this.ac=Ge(p),this.$b=c._olm_sas(this.ac),c._olm_create_sas(this.$b,O,y),ce(O,y)}function Dn(p){return function(){var y=p.apply(this,arguments);if(y===on)throw y=ee(c._olm_sas_last_error(arguments[0])),Error("OLM."+y);return y}}vi.prototype.free=function(){c._olm_clear_sas(this.$b),We(this.$b)},vi.prototype.get_pubkey=z(function(){var p=Dn(c._olm_sas_pubkey_length)(this.$b),y=j(p+1);return Dn(c._olm_sas_get_pubkey)(this.$b,y,p),ee(y,p)}),vi.prototype.set_their_key=z(function(p){p=ae(p);var y=j(p);Dn(c._olm_sas_set_their_key)(this.$b,y,p.length)}),vi.prototype.is_their_key_set=z(function(){return!!Dn(c._olm_sas_is_their_key_set)(this.$b)}),vi.prototype.generate_bytes=z(function(p,y){p=ae(p);var O=j(p),x=j(y);return Dn(c._olm_sas_generate_bytes)(this.$b,O,p.length,x,y),new Uint8Array(new Uint8Array(c.HEAPU8.buffer,x,y))}),vi.prototype.calculate_mac=z(function(p,y){p=ae(p);var O=j(p);y=ae(y);var x=j(y),B=Dn(c._olm_sas_mac_length)(this.$b),Z=j(B+1);return Dn(c._olm_sas_calculate_mac)(this.$b,O,p.length,x,y.length,Z,B),ee(Z,B)}),vi.prototype.calculate_mac_long_kdf=z(function(p,y){p=ae(p);var O=j(p);y=ae(y);var x=j(y),B=Dn(c._olm_sas_mac_length)(this.$b),Z=j(B+1);return Dn(c._olm_sas_calculate_mac_long_kdf)(this.$b,O,p.length,x,y.length,Z,B),ee(Z,B)});var Ge=c._malloc,We=c._free,on;function Tr(p,y){var O=vc(p);return y(new Uint8Array(c.HEAPU8.buffer,O,p)),O}function j(p){return typeof p=="number"?Tr(p,function(y){y.fill(0)}):Tr(p.length,function(y){y.set(p)})}function ae(p){if(p instanceof Uint8Array)var y=p;else y=Array(Ut(p)+1),p=pr(p,y,0,y.length),y.length=p;return y}function z(p){return function(){var y=yc();try{return p.apply(this,arguments)}finally{Vr(y)}}}function ce(p,y){for(;0<y--;)c.HEAP8[p++]=0}function Tt(){var p=c._olm_account_size();this.ac=Ge(p),this.$b=c._olm_account(this.ac)}function He(p){return function(){var y=p.apply(this,arguments);if(y===on)throw y=ee(c._olm_account_last_error(arguments[0])),Error("OLM."+y);return y}}Tt.prototype.free=function(){c._olm_clear_account(this.$b),We(this.$b)},Tt.prototype.create=z(function(){var p=He(c._olm_create_account_random_length)(this.$b),y=Tr(p,f);try{He(c._olm_create_account)(this.$b,y,p)}finally{ce(y,p)}}),Tt.prototype.identity_keys=z(function(){var p=He(c._olm_account_identity_keys_length)(this.$b),y=j(p+1);return He(c._olm_account_identity_keys)(this.$b,y,p),ee(y,p)}),Tt.prototype.sign=z(function(p){var y=He(c._olm_account_signature_length)(this.$b);p=ae(p);var O=j(p),x=j(y+1);try{He(c._olm_account_sign)(this.$b,O,p.length,x,y)}finally{for(ce(O,p.length),O=0;O<p.length;O++)p[O]=0}return ee(x,y)}),Tt.prototype.one_time_keys=z(function(){var p=He(c._olm_account_one_time_keys_length)(this.$b),y=j(p+1);return He(c._olm_account_one_time_keys)(this.$b,y,p),ee(y,p)}),Tt.prototype.mark_keys_as_published=z(function(){He(c._olm_account_mark_keys_as_published)(this.$b)}),Tt.prototype.max_number_of_one_time_keys=z(function(){return He(c._olm_account_max_number_of_one_time_keys)(this.$b)}),Tt.prototype.generate_one_time_keys=z(function(p){var y=He(c._olm_account_generate_one_time_keys_random_length)(this.$b,p),O=Tr(y,f);try{He(c._olm_account_generate_one_time_keys)(this.$b,p,O,y)}finally{ce(O,y)}}),Tt.prototype.remove_one_time_keys=z(function(p){He(c._olm_remove_one_time_keys)(this.$b,p.$b)}),Tt.prototype.generate_fallback_key=z(function(){var p=He(c._olm_account_generate_fallback_key_random_length)(this.$b),y=Tr(p,f);try{He(c._olm_account_generate_fallback_key)(this.$b,y,p)}finally{ce(y,p)}}),Tt.prototype.fallback_key=z(function(){var p=He(c._olm_account_fallback_key_length)(this.$b),y=j(p+1);return He(c._olm_account_fallback_key)(this.$b,y,p),ee(y,p)}),Tt.prototype.unpublished_fallback_key=z(function(){var p=He(c._olm_account_unpublished_fallback_key_length)(this.$b),y=j(p+1);return He(c._olm_account_unpublished_fallback_key)(this.$b,y,p),ee(y,p)}),Tt.prototype.forget_old_fallback_key=z(function(){He(c._olm_account_forget_old_fallback_key)(this.$b)}),Tt.prototype.pickle=z(function(p){p=ae(p);var y=He(c._olm_pickle_account_length)(this.$b),O=j(p),x=j(y+1);try{He(c._olm_pickle_account)(this.$b,O,p.length,x,y)}finally{for(ce(O,p.length),O=0;O<p.length;O++)p[O]=0}return ee(x,y)}),Tt.prototype.unpickle=z(function(p,y){p=ae(p);var O=j(p);y=ae(y);var x=j(y);try{He(c._olm_unpickle_account)(this.$b,O,p.length,x,y.length)}finally{for(ce(O,p.length),O=0;O<p.length;O++)p[O]=0}});function Xt(){var p=c._olm_session_size();this.ac=Ge(p),this.$b=c._olm_session(this.ac)}function ut(p){return function(){var y=p.apply(this,arguments);if(y===on)throw y=ee(c._olm_session_last_error(arguments[0])),Error("OLM."+y);return y}}Xt.prototype.free=function(){c._olm_clear_session(this.$b),We(this.$b)},Xt.prototype.pickle=z(function(p){p=ae(p);var y=ut(c._olm_pickle_session_length)(this.$b),O=j(p),x=j(y+1);try{ut(c._olm_pickle_session)(this.$b,O,p.length,x,y)}finally{for(ce(O,p.length),O=0;O<p.length;O++)p[O]=0}return ee(x,y)}),Xt.prototype.unpickle=z(function(p,y){p=ae(p);var O=j(p);y=ae(y);var x=j(y);try{ut(c._olm_unpickle_session)(this.$b,O,p.length,x,y.length)}finally{for(ce(O,p.length),O=0;O<p.length;O++)p[O]=0}}),Xt.prototype.create_outbound=z(function(p,y,O){var x=ut(c._olm_create_outbound_session_random_length)(this.$b),B=Tr(x,f);y=ae(y),O=ae(O);var Z=j(y),ve=j(O);try{ut(c._olm_create_outbound_session)(this.$b,p.$b,Z,y.length,ve,O.length,B,x)}finally{ce(B,x)}}),Xt.prototype.create_inbound=z(function(p,y){y=ae(y);var O=j(y);try{ut(c._olm_create_inbound_session)(this.$b,p.$b,O,y.length)}finally{for(ce(O,y.length),p=0;p<y.length;p++)y[p]=0}}),Xt.prototype.create_inbound_from=z(function(p,y,O){y=ae(y);var x=j(y);O=ae(O);var B=j(O);try{ut(c._olm_create_inbound_session_from)(this.$b,p.$b,x,y.length,B,O.length)}finally{for(ce(B,O.length),p=0;p<O.length;p++)O[p]=0}}),Xt.prototype.session_id=z(function(){var p=ut(c._olm_session_id_length)(this.$b),y=j(p+1);return ut(c._olm_session_id)(this.$b,y,p),ee(y,p)}),Xt.prototype.has_received_message=function(){return!!ut(c._olm_session_has_received_message)(this.$b)},Xt.prototype.matches_inbound=z(function(p){p=ae(p);var y=j(p);return!!ut(c._olm_matches_inbound_session)(this.$b,y,p.length)}),Xt.prototype.matches_inbound_from=z(function(p,y){p=ae(p);var O=j(p);y=ae(y);var x=j(y);return!!ut(c._olm_matches_inbound_session_from)(this.$b,O,p.length,x,y.length)}),Xt.prototype.encrypt=z(function(p){try{var y=ut(c._olm_encrypt_random_length)(this.$b),O=ut(c._olm_encrypt_message_type)(this.$b),x=Ut(p),B=ut(c._olm_encrypt_message_length)(this.$b,x),Z=Tr(y,f),ve=Ge(x+1);pr(p,xe,ve,x+1);var Nt=Ge(B+1);return ut(c._olm_encrypt)(this.$b,ve,x,Z,y,Nt,B),Ve(Nt+B),{type:O,body:ee(Nt,B)}}finally{Z!==void 0&&ce(Z,y),ve!==void 0&&(ce(ve,x+1),We(ve)),Nt!==void 0&&We(Nt)}}),Xt.prototype.decrypt=z(function(p,y){try{var O=Ge(y.length);fi(y,O);var x=ut(c._olm_decrypt_max_plaintext_length)(this.$b,p,O,y.length);fi(y,O);var B=Ge(x+1),Z=ut(c._olm_decrypt)(this.$b,p,O,y.length,B,x);return Ve(B+Z),ee(B,Z)}finally{O!==void 0&&We(O),B!==void 0&&(ce(B,x),We(B))}}),Xt.prototype.describe=z(function(){try{var p=Ge(256);return ut(c._olm_session_describe)(this.$b,p,256),ee(p)}finally{p!==void 0&&We(p)}});function _c(){var p=c._olm_utility_size();this.ac=Ge(p),this.$b=c._olm_utility(this.ac)}function Iu(p){return function(){var y=p.apply(this,arguments);if(y===on)throw y=ee(c._olm_utility_last_error(arguments[0])),Error("OLM."+y);return y}}return _c.prototype.free=function(){c._olm_clear_utility(this.$b),We(this.$b)},_c.prototype.sha256=z(function(p){var y=Iu(c._olm_sha256_length)(this.$b);p=ae(p);var O=j(p),x=j(y+1);try{Iu(c._olm_sha256)(this.$b,O,p.length,x,y)}finally{for(ce(O,p.length),O=0;O<p.length;O++)p[O]=0}return ee(x,y)}),_c.prototype.ed25519_verify=z(function(p,y,O){p=ae(p);var x=j(p);y=ae(y);var B=j(y);O=ae(O);var Z=j(O);try{Iu(c._olm_ed25519_verify)(this.$b,x,p.length,B,y.length,Z,O.length)}finally{for(ce(B,y.length),p=0;p<y.length;p++)y[p]=0}}),r.Account=Tt,r.Session=Xt,r.Utility=_c,r.PkEncryption=U,r.PkDecryption=we,r.PkSigning=Te,r.SAS=vi,r.get_library_version=z(function(){var p=j(3);return c._olm_get_library_version(p,p+1,p+2),[Qe(p,"i8"),Qe(p+1,"i8"),Qe(p+2,"i8")]}),u.ready}}();n.exports=o;var a;return r.init=function(l){return a||(l&&(OLM_OPTIONS=l),a=new Promise(function(u,c){i=function(){u()},s=function(g){c(g)},o()}),a)},r}();typeof window!="undefined"&&(window.Olm=t),n.exports=t;// @license-end
+})(pE);var cx=pE.exports;export{si as B,QD as D,rx as L,eA as M,cx as O,FS as P,ex as R,sx as W,mC as a,VS as b,Sy as c,ox as d,ax as e,DS as f,Oa as g,La as h,tx as i,Yl as l,nx as o,bS as u,El as w};
diff --git a/pr-121/index.html b/pr-121/index.html
@@ -11,9 +11,9 @@
global = globalThis // fix for "global not defined" error
globalThis.OLM_OPTIONS = undefined; // Fix missing var for olm
</script>
- <script type="module" crossorigin src="/pr-121/assets/index.955c971f.js"></script>
- <link rel="modulepreload" href="/pr-121/assets/vendor.09079154.js">
- <link rel="stylesheet" href="/pr-121/assets/index.311ea642.css">
+ <script type="module" crossorigin src="/pr-121/assets/index.7100b17a.js"></script>
+ <link rel="modulepreload" href="/pr-121/assets/vendor.8ab614fa.js">
+ <link rel="stylesheet" href="/pr-121/assets/index.8bf9a4af.css">
</head>
<body>